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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 // Create a new closure for the SharedFunctionInfo in the accumulator. | 75 // Create a new closure for the SharedFunctionInfo in the accumulator. |
76 BytecodeArrayBuilder& CreateClosure(PretenureFlag tenured); | 76 BytecodeArrayBuilder& CreateClosure(PretenureFlag tenured); |
77 | 77 |
78 // Call a JS function. The JSFunction or Callable to be called should be in | 78 // Call a JS function. The JSFunction or Callable to be called should be in |
79 // |callable|, the receiver should be in |receiver| and all subsequent | 79 // |callable|, the receiver should be in |receiver| and all subsequent |
80 // arguments should be in registers <receiver + 1> to | 80 // arguments should be in registers <receiver + 1> to |
81 // <receiver + 1 + arg_count>. | 81 // <receiver + 1 + arg_count>. |
82 BytecodeArrayBuilder& Call(Register callable, Register receiver, | 82 BytecodeArrayBuilder& Call(Register callable, Register receiver, |
83 size_t arg_count); | 83 size_t arg_count); |
84 | 84 |
| 85 // Call the new operator. The |constructor| register is followed by |
| 86 // |arg_count| consecutive registers containing arguments to be |
| 87 // applied to the constructor. |
| 88 BytecodeArrayBuilder& New(Register constructor, Register first_arg, |
| 89 size_t arg_count); |
| 90 |
85 // Call the runtime function with |function_id|. The first argument should be | 91 // Call the runtime function with |function_id|. The first argument should be |
86 // in |first_arg| and all subsequent arguments should be in registers | 92 // in |first_arg| and all subsequent arguments should be in registers |
87 // <first_arg + 1> to <first_arg + 1 + arg_count>. | 93 // <first_arg + 1> to <first_arg + 1 + arg_count>. |
88 BytecodeArrayBuilder& CallRuntime(Runtime::FunctionId function_id, | 94 BytecodeArrayBuilder& CallRuntime(Runtime::FunctionId function_id, |
89 Register first_arg, size_t arg_count); | 95 Register first_arg, size_t arg_count); |
90 | 96 |
91 // Operators (register == lhs, accumulator = rhs). | 97 // Operators (register holds the lhs value, accumulator holds the rhs value). |
92 BytecodeArrayBuilder& BinaryOperation(Token::Value binop, Register reg, | 98 BytecodeArrayBuilder& BinaryOperation(Token::Value binop, Register reg, |
93 Strength strength); | 99 Strength strength); |
94 | 100 |
95 // Unary Operators. | 101 // Unary Operators. |
96 BytecodeArrayBuilder& LogicalNot(); | 102 BytecodeArrayBuilder& LogicalNot(); |
97 BytecodeArrayBuilder& TypeOf(); | 103 BytecodeArrayBuilder& TypeOf(); |
98 | 104 |
99 // Tests. | 105 // Tests. |
100 BytecodeArrayBuilder& CompareOperation(Token::Value op, Register reg, | 106 BytecodeArrayBuilder& CompareOperation(Token::Value op, Register reg, |
101 Strength strength); | 107 Strength strength); |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 | 245 |
240 DISALLOW_COPY_AND_ASSIGN(TemporaryRegisterScope); | 246 DISALLOW_COPY_AND_ASSIGN(TemporaryRegisterScope); |
241 }; | 247 }; |
242 | 248 |
243 | 249 |
244 } // namespace interpreter | 250 } // namespace interpreter |
245 } // namespace internal | 251 } // namespace internal |
246 } // namespace v8 | 252 } // namespace v8 |
247 | 253 |
248 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ | 254 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ |
OLD | NEW |