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/ast.h" | 10 #include "src/ast/ast.h" |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 // applied to the constructor. | 162 // applied to the constructor. |
163 BytecodeArrayBuilder& New(Register constructor, Register first_arg, | 163 BytecodeArrayBuilder& New(Register constructor, Register first_arg, |
164 size_t arg_count); | 164 size_t arg_count); |
165 | 165 |
166 // Call the runtime function with |function_id|. The first argument should be | 166 // Call the runtime function with |function_id|. The first argument should be |
167 // in |first_arg| and all subsequent arguments should be in registers | 167 // in |first_arg| and all subsequent arguments should be in registers |
168 // <first_arg + 1> to <first_arg + 1 + arg_count>. | 168 // <first_arg + 1> to <first_arg + 1 + arg_count>. |
169 BytecodeArrayBuilder& CallRuntime(Runtime::FunctionId function_id, | 169 BytecodeArrayBuilder& CallRuntime(Runtime::FunctionId function_id, |
170 Register first_arg, size_t arg_count); | 170 Register first_arg, size_t arg_count); |
171 | 171 |
| 172 // Call the runtime function with |function_id| that returns a pair of values. |
| 173 // The first argument should be in |first_arg| and all subsequent arguments |
| 174 // should be in registers <first_arg + 1> to <first_arg + 1 + arg_count>. The |
| 175 // return values will be returned in <first_return> and <first_return + 1>. |
| 176 BytecodeArrayBuilder& CallRuntimePair(Runtime::FunctionId function_id, |
| 177 Register first_arg, size_t arg_count, |
| 178 Register first_return); |
| 179 |
172 // Call the JS runtime function with |context_index|. The the receiver should | 180 // Call the JS runtime function with |context_index|. The the receiver should |
173 // be in |receiver| and all subsequent arguments should be in registers | 181 // be in |receiver| and all subsequent arguments should be in registers |
174 // <receiver + 1> to <receiver + 1 + arg_count>. | 182 // <receiver + 1> to <receiver + 1 + arg_count>. |
175 BytecodeArrayBuilder& CallJSRuntime(int context_index, Register receiver, | 183 BytecodeArrayBuilder& CallJSRuntime(int context_index, Register receiver, |
176 size_t arg_count); | 184 size_t arg_count); |
177 | 185 |
178 // Operators (register holds the lhs value, accumulator holds the rhs value). | 186 // Operators (register holds the lhs value, accumulator holds the rhs value). |
179 BytecodeArrayBuilder& BinaryOperation(Token::Value binop, Register reg, | 187 BytecodeArrayBuilder& BinaryOperation(Token::Value binop, Register reg, |
180 Strength strength); | 188 Strength strength); |
181 | 189 |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 | 402 |
395 DISALLOW_COPY_AND_ASSIGN(TemporaryRegisterScope); | 403 DISALLOW_COPY_AND_ASSIGN(TemporaryRegisterScope); |
396 }; | 404 }; |
397 | 405 |
398 | 406 |
399 } // namespace interpreter | 407 } // namespace interpreter |
400 } // namespace internal | 408 } // namespace internal |
401 } // namespace v8 | 409 } // namespace v8 |
402 | 410 |
403 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ | 411 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ |
OLD | NEW |