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 "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
9 #include "src/interpreter/bytecode-array-writer.h" | 9 #include "src/interpreter/bytecode-array-writer.h" |
10 #include "src/interpreter/bytecode-register-allocator.h" | 10 #include "src/interpreter/bytecode-register-allocator.h" |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 // Push the context in accumulator as the new context, and store in register | 145 // Push the context in accumulator as the new context, and store in register |
146 // |context|. | 146 // |context|. |
147 BytecodeArrayBuilder& PushContext(Register context); | 147 BytecodeArrayBuilder& PushContext(Register context); |
148 | 148 |
149 // Pop the current context and replace with |context|. | 149 // Pop the current context and replace with |context|. |
150 BytecodeArrayBuilder& PopContext(Register context); | 150 BytecodeArrayBuilder& PopContext(Register context); |
151 | 151 |
152 // Call a JS function. The JSFunction or Callable to be called should be in | 152 // Call a JS function. The JSFunction or Callable to be called should be in |
153 // |callable|, the receiver should be in |receiver_args| and all subsequent | 153 // |callable|, the receiver should be in |receiver_args| and all subsequent |
154 // arguments should be in registers <receiver_args + 1> to | 154 // arguments should be in registers <receiver_args + 1> to |
155 // <receiver_args + receiver_arg_count - 1>. | 155 // <receiver_args + receiver_arg_count - 1>. Type feedback is recorded in |
| 156 // the |feedback_slot| in the type feedback vector. |
156 BytecodeArrayBuilder& Call( | 157 BytecodeArrayBuilder& Call( |
157 Register callable, Register receiver_args, size_t receiver_arg_count, | 158 Register callable, Register receiver_args, size_t receiver_arg_count, |
158 int feedback_slot, TailCallMode tail_call_mode = TailCallMode::kDisallow); | 159 int feedback_slot, TailCallMode tail_call_mode = TailCallMode::kDisallow); |
159 | 160 |
160 BytecodeArrayBuilder& TailCall(Register callable, Register receiver_args, | 161 BytecodeArrayBuilder& TailCall(Register callable, Register receiver_args, |
161 size_t receiver_arg_count, int feedback_slot) { | 162 size_t receiver_arg_count, int feedback_slot) { |
162 return Call(callable, receiver_args, receiver_arg_count, feedback_slot, | 163 return Call(callable, receiver_args, receiver_arg_count, feedback_slot, |
163 TailCallMode::kAllow); | 164 TailCallMode::kAllow); |
164 } | 165 } |
165 | 166 |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 BytecodeSourceInfo latest_source_info_; | 368 BytecodeSourceInfo latest_source_info_; |
368 | 369 |
369 DISALLOW_COPY_AND_ASSIGN(BytecodeArrayBuilder); | 370 DISALLOW_COPY_AND_ASSIGN(BytecodeArrayBuilder); |
370 }; | 371 }; |
371 | 372 |
372 } // namespace interpreter | 373 } // namespace interpreter |
373 } // namespace internal | 374 } // namespace internal |
374 } // namespace v8 | 375 } // namespace v8 |
375 | 376 |
376 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ | 377 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ |
OLD | NEW |