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_BYTECODE_REGISTER_H_ | 5 #ifndef V8_INTERPRETER_BYTECODE_REGISTER_H_ |
6 #define V8_INTERPRETER_BYTECODE_REGISTER_H_ | 6 #define V8_INTERPRETER_BYTECODE_REGISTER_H_ |
7 | 7 |
| 8 #include "src/frames.h" |
8 #include "src/interpreter/bytecodes.h" | 9 #include "src/interpreter/bytecodes.h" |
9 | 10 |
10 namespace v8 { | 11 namespace v8 { |
11 namespace internal { | 12 namespace internal { |
12 namespace interpreter { | 13 namespace interpreter { |
13 | 14 |
14 // An interpreter Register which is located in the function's Register file | 15 // An interpreter Register which is located in the function's Register file |
15 // in its stack-frame. Register hold parameters, this, and expression values. | 16 // in its stack-frame. Register hold parameters, this, and expression values. |
16 class Register final { | 17 class Register final { |
17 public: | 18 public: |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 return index() <= other.index(); | 80 return index() <= other.index(); |
80 } | 81 } |
81 bool operator>(const Register& other) const { | 82 bool operator>(const Register& other) const { |
82 return index() > other.index(); | 83 return index() > other.index(); |
83 } | 84 } |
84 bool operator>=(const Register& other) const { | 85 bool operator>=(const Register& other) const { |
85 return index() >= other.index(); | 86 return index() >= other.index(); |
86 } | 87 } |
87 | 88 |
88 private: | 89 private: |
89 static const int kInvalidIndex; | 90 static const int kInvalidIndex = kMaxInt; |
90 static const int kRegisterFileStartOffset; | 91 static const int kRegisterFileStartOffset = |
| 92 InterpreterFrameConstants::kRegisterFileFromFp / kPointerSize; |
91 | 93 |
92 void* operator new(size_t size) = delete; | 94 void* operator new(size_t size) = delete; |
93 void operator delete(void* p) = delete; | 95 void operator delete(void* p) = delete; |
94 | 96 |
95 int index_; | 97 int index_; |
96 }; | 98 }; |
97 | 99 |
98 } // namespace interpreter | 100 } // namespace interpreter |
99 } // namespace internal | 101 } // namespace internal |
100 } // namespace v8 | 102 } // namespace v8 |
101 | 103 |
102 #endif // V8_INTERPRETER_BYTECODE_REGISTER_H_ | 104 #endif // V8_INTERPRETER_BYTECODE_REGISTER_H_ |
OLD | NEW |