| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_INTERPRETER_BYTECODES_H_ | 5 #ifndef V8_INTERPRETER_BYTECODES_H_ |
| 6 #define V8_INTERPRETER_BYTECODES_H_ | 6 #define V8_INTERPRETER_BYTECODES_H_ |
| 7 | 7 |
| 8 #include <iosfwd> | 8 #include <iosfwd> |
| 9 | 9 |
| 10 // Clients of this interface shouldn't depend on lots of interpreter internals. | 10 // Clients of this interface shouldn't depend on lots of interpreter internals. |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 | 433 |
| 434 void* operator new(size_t size); | 434 void* operator new(size_t size); |
| 435 void operator delete(void* p); | 435 void operator delete(void* p); |
| 436 | 436 |
| 437 int index_; | 437 int index_; |
| 438 }; | 438 }; |
| 439 | 439 |
| 440 | 440 |
| 441 class Bytecodes { | 441 class Bytecodes { |
| 442 public: | 442 public: |
| 443 // The maximum number of operands a bytecode may have. |
| 444 static const int kMaxOperands = 4; |
| 445 |
| 443 // Returns string representation of |bytecode|. | 446 // Returns string representation of |bytecode|. |
| 444 static const char* ToString(Bytecode bytecode); | 447 static const char* ToString(Bytecode bytecode); |
| 445 | 448 |
| 446 // Returns string representation of |bytecode|. | 449 // Returns string representation of |bytecode|. |
| 447 static std::string ToString(Bytecode bytecode, OperandScale operand_scale); | 450 static std::string ToString(Bytecode bytecode, OperandScale operand_scale); |
| 448 | 451 |
| 449 // Returns string representation of |accumulator_use|. | 452 // Returns string representation of |accumulator_use|. |
| 450 static const char* AccumulatorUseToString(AccumulatorUse accumulator_use); | 453 static const char* AccumulatorUseToString(AccumulatorUse accumulator_use); |
| 451 | 454 |
| 452 // Returns string representation of |operand_type|. | 455 // Returns string representation of |operand_type|. |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 static const OperandType* GetOperandTypes(Bytecode bytecode); | 523 static const OperandType* GetOperandTypes(Bytecode bytecode); |
| 521 | 524 |
| 522 // Returns a pointer to an array of operand type info terminated in | 525 // Returns a pointer to an array of operand type info terminated in |
| 523 // OperandTypeInfo::kNone. | 526 // OperandTypeInfo::kNone. |
| 524 static const OperandTypeInfo* GetOperandTypeInfos(Bytecode bytecode); | 527 static const OperandTypeInfo* GetOperandTypeInfos(Bytecode bytecode); |
| 525 | 528 |
| 526 // Returns the size of the i-th operand of |bytecode|. | 529 // Returns the size of the i-th operand of |bytecode|. |
| 527 static OperandSize GetOperandSize(Bytecode bytecode, int i, | 530 static OperandSize GetOperandSize(Bytecode bytecode, int i, |
| 528 OperandScale operand_scale); | 531 OperandScale operand_scale); |
| 529 | 532 |
| 530 // Returns a pointer to an array of the operand sizes for |bytecode|. | |
| 531 static const OperandSize* GetOperandSizes(Bytecode bytecode, | |
| 532 OperandScale operand_scale); | |
| 533 | |
| 534 // Returns the offset of the i-th operand of |bytecode| relative to the start | 533 // Returns the offset of the i-th operand of |bytecode| relative to the start |
| 535 // of the bytecode. | 534 // of the bytecode. |
| 536 static int GetOperandOffset(Bytecode bytecode, int i, | 535 static int GetOperandOffset(Bytecode bytecode, int i, |
| 537 OperandScale operand_scale); | 536 OperandScale operand_scale); |
| 538 | 537 |
| 539 // Returns a zero-based bitmap of the register operand positions of | |
| 540 // |bytecode|. | |
| 541 static int GetRegisterOperandBitmap(Bytecode bytecode); | |
| 542 | |
| 543 // Returns a debug break bytecode to replace |bytecode|. | 538 // Returns a debug break bytecode to replace |bytecode|. |
| 544 static Bytecode GetDebugBreak(Bytecode bytecode); | 539 static Bytecode GetDebugBreak(Bytecode bytecode); |
| 545 | 540 |
| 546 // Returns the size of the bytecode including its operands for the | 541 // Returns the size of the bytecode including its operands for the |
| 547 // given |operand_scale|. | 542 // given |operand_scale|. |
| 548 static int Size(Bytecode bytecode, OperandScale operand_scale); | 543 static int Size(Bytecode bytecode, OperandScale operand_scale); |
| 549 | 544 |
| 550 // Returns the size of |operand|. | 545 // Returns the size of |operand|. |
| 551 static OperandSize SizeOfOperand(OperandType operand, OperandScale scale); | 546 static OperandSize SizeOfOperand(OperandType operand, OperandScale scale); |
| 552 | 547 |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 std::ostream& operator<<(std::ostream& os, const AccumulatorUse& use); | 670 std::ostream& operator<<(std::ostream& os, const AccumulatorUse& use); |
| 676 std::ostream& operator<<(std::ostream& os, const OperandScale& operand_scale); | 671 std::ostream& operator<<(std::ostream& os, const OperandScale& operand_scale); |
| 677 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_size); | 672 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_size); |
| 678 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type); | 673 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type); |
| 679 | 674 |
| 680 } // namespace interpreter | 675 } // namespace interpreter |
| 681 } // namespace internal | 676 } // namespace internal |
| 682 } // namespace v8 | 677 } // namespace v8 |
| 683 | 678 |
| 684 #endif // V8_INTERPRETER_BYTECODES_H_ | 679 #endif // V8_INTERPRETER_BYTECODES_H_ |
| OLD | NEW |