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_ARRAY_BUILDER_H_ | 5 #ifndef V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ |
6 #define V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ | 6 #define V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "src/ast.h" | 10 #include "src/ast.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 BytecodeArrayBuilder& LoadUndefined(); | 44 BytecodeArrayBuilder& LoadUndefined(); |
45 BytecodeArrayBuilder& LoadNull(); | 45 BytecodeArrayBuilder& LoadNull(); |
46 BytecodeArrayBuilder& LoadTheHole(); | 46 BytecodeArrayBuilder& LoadTheHole(); |
47 BytecodeArrayBuilder& LoadTrue(); | 47 BytecodeArrayBuilder& LoadTrue(); |
48 BytecodeArrayBuilder& LoadFalse(); | 48 BytecodeArrayBuilder& LoadFalse(); |
49 | 49 |
50 // Register-accumulator transfers. | 50 // Register-accumulator transfers. |
51 BytecodeArrayBuilder& LoadAccumulatorWithRegister(Register reg); | 51 BytecodeArrayBuilder& LoadAccumulatorWithRegister(Register reg); |
52 BytecodeArrayBuilder& StoreAccumulatorInRegister(Register reg); | 52 BytecodeArrayBuilder& StoreAccumulatorInRegister(Register reg); |
53 | 53 |
| 54 // Load properties. The property name should be in the accumulator. |
| 55 BytecodeArrayBuilder& LoadNamedProperty(Register object, int feedback_slot, |
| 56 LanguageMode language_mode); |
| 57 BytecodeArrayBuilder& LoadKeyedProperty(Register object, int feedback_slot, |
| 58 LanguageMode language_mode); |
| 59 |
54 // Operators. | 60 // Operators. |
55 BytecodeArrayBuilder& BinaryOperation(Token::Value binop, Register reg); | 61 BytecodeArrayBuilder& BinaryOperation(Token::Value binop, Register reg); |
56 | 62 |
57 // Flow Control. | 63 // Flow Control. |
58 BytecodeArrayBuilder& Return(); | 64 BytecodeArrayBuilder& Return(); |
59 | 65 |
60 private: | 66 private: |
61 static const int kLastParamRegisterIndex = | 67 static const int kLastParamRegisterIndex = |
62 -InterpreterFrameConstants::kLastParamFromRegisterPointer / kPointerSize; | 68 -InterpreterFrameConstants::kLastParamFromRegisterPointer / kPointerSize; |
63 | 69 |
64 static Bytecode BytecodeForBinaryOperation(Token::Value op); | 70 static Bytecode BytecodeForBinaryOperation(Token::Value op); |
| 71 static bool FitsInByteOperand(int value); |
| 72 static bool FitsInByteOperand(size_t value); |
65 | 73 |
66 void Output(Bytecode bytecode, uint8_t r0, uint8_t r1, uint8_t r2); | 74 void Output(Bytecode bytecode, uint8_t r0, uint8_t r1, uint8_t r2); |
67 void Output(Bytecode bytecode, uint8_t r0, uint8_t r1); | 75 void Output(Bytecode bytecode, uint8_t r0, uint8_t r1); |
68 void Output(Bytecode bytecode, uint8_t r0); | 76 void Output(Bytecode bytecode, uint8_t r0); |
69 void Output(Bytecode bytecode); | 77 void Output(Bytecode bytecode); |
70 | 78 |
71 bool OperandIsValid(Bytecode bytecode, int operand_index, | 79 bool OperandIsValid(Bytecode bytecode, int operand_index, |
72 uint8_t operand_value) const; | 80 uint8_t operand_value) const; |
73 | 81 |
74 size_t GetConstantPoolEntry(Handle<Object> object); | 82 size_t GetConstantPoolEntry(Handle<Object> object); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 | 144 |
137 DISALLOW_COPY_AND_ASSIGN(TemporaryRegisterScope); | 145 DISALLOW_COPY_AND_ASSIGN(TemporaryRegisterScope); |
138 }; | 146 }; |
139 | 147 |
140 | 148 |
141 } // namespace interpreter | 149 } // namespace interpreter |
142 } // namespace internal | 150 } // namespace internal |
143 } // namespace v8 | 151 } // namespace v8 |
144 | 152 |
145 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ | 153 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ |
OLD | NEW |