| 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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 BytecodeArrayBuilder& CallRuntime(Runtime::FunctionId function_id, | 198 BytecodeArrayBuilder& CallRuntime(Runtime::FunctionId function_id, |
| 199 RegisterList args); | 199 RegisterList args); |
| 200 // Call the runtime function with |function_id| with single argument |arg|. | 200 // Call the runtime function with |function_id| with single argument |arg|. |
| 201 BytecodeArrayBuilder& CallRuntime(Runtime::FunctionId function_id, | 201 BytecodeArrayBuilder& CallRuntime(Runtime::FunctionId function_id, |
| 202 Register arg); | 202 Register arg); |
| 203 // Call the runtime function with |function_id| with no arguments. | 203 // Call the runtime function with |function_id| with no arguments. |
| 204 BytecodeArrayBuilder& CallRuntime(Runtime::FunctionId function_id); | 204 BytecodeArrayBuilder& CallRuntime(Runtime::FunctionId function_id); |
| 205 | 205 |
| 206 // Call the runtime function with |function_id| and arguments |args|, that | 206 // Call the runtime function with |function_id| and arguments |args|, that |
| 207 // returns a pair of values. The return values will be returned in | 207 // returns a pair of values. The return values will be returned in |
| 208 // <first_return> and <first_return + 1>. | 208 // |return_pair|. |
| 209 BytecodeArrayBuilder& CallRuntimeForPair(Runtime::FunctionId function_id, | 209 BytecodeArrayBuilder& CallRuntimeForPair(Runtime::FunctionId function_id, |
| 210 RegisterList args, | 210 RegisterList args, |
| 211 Register first_return); | 211 RegisterList return_pair); |
| 212 // Call the runtime function with |function_id| with single argument |arg|. | 212 // Call the runtime function with |function_id| with single argument |arg| |
| 213 // that returns a pair of values. The return values will be returned in |
| 214 // |return_pair|. |
| 213 BytecodeArrayBuilder& CallRuntimeForPair(Runtime::FunctionId function_id, | 215 BytecodeArrayBuilder& CallRuntimeForPair(Runtime::FunctionId function_id, |
| 214 Register arg, Register first_return); | 216 Register arg, |
| 217 RegisterList return_pair); |
| 215 | 218 |
| 216 // Call the JS runtime function with |context_index| and arguments |args|. | 219 // Call the JS runtime function with |context_index| and arguments |args|. |
| 217 BytecodeArrayBuilder& CallJSRuntime(int context_index, RegisterList args); | 220 BytecodeArrayBuilder& CallJSRuntime(int context_index, RegisterList args); |
| 218 | 221 |
| 219 // Operators (register holds the lhs value, accumulator holds the rhs value). | 222 // Operators (register holds the lhs value, accumulator holds the rhs value). |
| 220 // Type feedback will be recorded in the |feedback_slot| | 223 // Type feedback will be recorded in the |feedback_slot| |
| 221 BytecodeArrayBuilder& BinaryOperation(Token::Value binop, Register reg, | 224 BytecodeArrayBuilder& BinaryOperation(Token::Value binop, Register reg, |
| 222 int feedback_slot); | 225 int feedback_slot); |
| 223 | 226 |
| 224 // Count Operators (value stored in accumulator). | 227 // Count Operators (value stored in accumulator). |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 | 261 |
| 259 BytecodeArrayBuilder& Throw(); | 262 BytecodeArrayBuilder& Throw(); |
| 260 BytecodeArrayBuilder& ReThrow(); | 263 BytecodeArrayBuilder& ReThrow(); |
| 261 BytecodeArrayBuilder& Return(); | 264 BytecodeArrayBuilder& Return(); |
| 262 | 265 |
| 263 // Debugger. | 266 // Debugger. |
| 264 BytecodeArrayBuilder& Debugger(); | 267 BytecodeArrayBuilder& Debugger(); |
| 265 | 268 |
| 266 // Complex flow control. | 269 // Complex flow control. |
| 267 BytecodeArrayBuilder& ForInPrepare(Register receiver, | 270 BytecodeArrayBuilder& ForInPrepare(Register receiver, |
| 268 Register cache_info_triple); | 271 RegisterList cache_info_triple); |
| 269 BytecodeArrayBuilder& ForInContinue(Register index, Register cache_length); | 272 BytecodeArrayBuilder& ForInContinue(Register index, Register cache_length); |
| 270 BytecodeArrayBuilder& ForInNext(Register receiver, Register index, | 273 BytecodeArrayBuilder& ForInNext(Register receiver, Register index, |
| 271 Register cache_type_array_pair, | 274 RegisterList cache_type_array_pair, |
| 272 int feedback_slot); | 275 int feedback_slot); |
| 273 BytecodeArrayBuilder& ForInStep(Register index); | 276 BytecodeArrayBuilder& ForInStep(Register index); |
| 274 | 277 |
| 275 // Generators. | 278 // Generators. |
| 276 BytecodeArrayBuilder& SuspendGenerator(Register generator); | 279 BytecodeArrayBuilder& SuspendGenerator(Register generator); |
| 277 BytecodeArrayBuilder& ResumeGenerator(Register generator); | 280 BytecodeArrayBuilder& ResumeGenerator(Register generator); |
| 278 | 281 |
| 279 // Exception handling. | 282 // Exception handling. |
| 280 BytecodeArrayBuilder& MarkHandler(int handler_id, | 283 BytecodeArrayBuilder& MarkHandler(int handler_id, |
| 281 HandlerTable::CatchPrediction will_catch); | 284 HandlerTable::CatchPrediction will_catch); |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 static int const kNoFeedbackSlot = 0; | 408 static int const kNoFeedbackSlot = 0; |
| 406 | 409 |
| 407 DISALLOW_COPY_AND_ASSIGN(BytecodeArrayBuilder); | 410 DISALLOW_COPY_AND_ASSIGN(BytecodeArrayBuilder); |
| 408 }; | 411 }; |
| 409 | 412 |
| 410 } // namespace interpreter | 413 } // namespace interpreter |
| 411 } // namespace internal | 414 } // namespace internal |
| 412 } // namespace v8 | 415 } // namespace v8 |
| 413 | 416 |
| 414 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ | 417 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ |
| OLD | NEW |