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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 // Pop the current context and replace with |context|. | 93 // Pop the current context and replace with |context|. |
94 BytecodeArrayBuilder& PopContext(Register context); | 94 BytecodeArrayBuilder& PopContext(Register context); |
95 | 95 |
96 // Call a JS function. The JSFunction or Callable to be called should be in | 96 // Call a JS function. The JSFunction or Callable to be called should be in |
97 // |callable|, the receiver should be in |receiver| and all subsequent | 97 // |callable|, the receiver should be in |receiver| and all subsequent |
98 // arguments should be in registers <receiver + 1> to | 98 // arguments should be in registers <receiver + 1> to |
99 // <receiver + 1 + arg_count>. | 99 // <receiver + 1 + arg_count>. |
100 BytecodeArrayBuilder& Call(Register callable, Register receiver, | 100 BytecodeArrayBuilder& Call(Register callable, Register receiver, |
101 size_t arg_count); | 101 size_t arg_count); |
102 | 102 |
| 103 // Call the new operator. The |constructor| register is followed by |
| 104 // |arg_count| consecutive registers containing arguments to be |
| 105 // applied to the constructor. |
| 106 BytecodeArrayBuilder& New(Register constructor, Register first_arg, |
| 107 size_t arg_count); |
| 108 |
103 // Call the runtime function with |function_id|. The first argument should be | 109 // Call the runtime function with |function_id|. The first argument should be |
104 // in |first_arg| and all subsequent arguments should be in registers | 110 // in |first_arg| and all subsequent arguments should be in registers |
105 // <first_arg + 1> to <first_arg + 1 + arg_count>. | 111 // <first_arg + 1> to <first_arg + 1 + arg_count>. |
106 BytecodeArrayBuilder& CallRuntime(Runtime::FunctionId function_id, | 112 BytecodeArrayBuilder& CallRuntime(Runtime::FunctionId function_id, |
107 Register first_arg, size_t arg_count); | 113 Register first_arg, size_t arg_count); |
108 | 114 |
109 // Operators (register == lhs, accumulator = rhs). | 115 // Operators (register holds the lhs value, accumulator holds the rhs value). |
110 BytecodeArrayBuilder& BinaryOperation(Token::Value binop, Register reg, | 116 BytecodeArrayBuilder& BinaryOperation(Token::Value binop, Register reg, |
111 Strength strength); | 117 Strength strength); |
112 | 118 |
113 // Unary Operators. | 119 // Unary Operators. |
114 BytecodeArrayBuilder& LogicalNot(); | 120 BytecodeArrayBuilder& LogicalNot(); |
115 BytecodeArrayBuilder& TypeOf(); | 121 BytecodeArrayBuilder& TypeOf(); |
116 | 122 |
117 // Tests. | 123 // Tests. |
118 BytecodeArrayBuilder& CompareOperation(Token::Value op, Register reg, | 124 BytecodeArrayBuilder& CompareOperation(Token::Value op, Register reg, |
119 Strength strength); | 125 Strength strength); |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 | 270 |
265 DISALLOW_COPY_AND_ASSIGN(TemporaryRegisterScope); | 271 DISALLOW_COPY_AND_ASSIGN(TemporaryRegisterScope); |
266 }; | 272 }; |
267 | 273 |
268 | 274 |
269 } // namespace interpreter | 275 } // namespace interpreter |
270 } // namespace internal | 276 } // namespace internal |
271 } // namespace v8 | 277 } // namespace v8 |
272 | 278 |
273 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ | 279 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ |
OLD | NEW |