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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 // Flow Control. | 247 // Flow Control. |
248 BytecodeArrayBuilder& Bind(BytecodeLabel* label); | 248 BytecodeArrayBuilder& Bind(BytecodeLabel* label); |
249 BytecodeArrayBuilder& Bind(const BytecodeLabel& target, BytecodeLabel* label); | 249 BytecodeArrayBuilder& Bind(const BytecodeLabel& target, BytecodeLabel* label); |
250 | 250 |
251 BytecodeArrayBuilder& Jump(BytecodeLabel* label); | 251 BytecodeArrayBuilder& Jump(BytecodeLabel* label); |
252 BytecodeArrayBuilder& JumpIfTrue(BytecodeLabel* label); | 252 BytecodeArrayBuilder& JumpIfTrue(BytecodeLabel* label); |
253 BytecodeArrayBuilder& JumpIfFalse(BytecodeLabel* label); | 253 BytecodeArrayBuilder& JumpIfFalse(BytecodeLabel* label); |
254 BytecodeArrayBuilder& JumpIfNotHole(BytecodeLabel* label); | 254 BytecodeArrayBuilder& JumpIfNotHole(BytecodeLabel* label); |
255 BytecodeArrayBuilder& JumpIfNull(BytecodeLabel* label); | 255 BytecodeArrayBuilder& JumpIfNull(BytecodeLabel* label); |
256 BytecodeArrayBuilder& JumpIfUndefined(BytecodeLabel* label); | 256 BytecodeArrayBuilder& JumpIfUndefined(BytecodeLabel* label); |
| 257 BytecodeArrayBuilder& JumpLoop(BytecodeLabel* label, int loop_depth); |
257 | 258 |
258 BytecodeArrayBuilder& StackCheck(int position); | 259 BytecodeArrayBuilder& StackCheck(int position); |
259 | 260 |
260 BytecodeArrayBuilder& OsrPoll(int loop_depth); | |
261 | |
262 BytecodeArrayBuilder& Throw(); | 261 BytecodeArrayBuilder& Throw(); |
263 BytecodeArrayBuilder& ReThrow(); | 262 BytecodeArrayBuilder& ReThrow(); |
264 BytecodeArrayBuilder& Return(); | 263 BytecodeArrayBuilder& Return(); |
265 | 264 |
266 // Debugger. | 265 // Debugger. |
267 BytecodeArrayBuilder& Debugger(); | 266 BytecodeArrayBuilder& Debugger(); |
268 | 267 |
269 // Complex flow control. | 268 // Complex flow control. |
270 BytecodeArrayBuilder& ForInPrepare(Register receiver, | 269 BytecodeArrayBuilder& ForInPrepare(Register receiver, |
271 Register cache_info_triple); | 270 Register cache_info_triple); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 static Bytecode BytecodeForCall(TailCallMode tail_call_mode); | 344 static Bytecode BytecodeForCall(TailCallMode tail_call_mode); |
346 | 345 |
347 void Output(Bytecode bytecode, uint32_t operand0, uint32_t operand1, | 346 void Output(Bytecode bytecode, uint32_t operand0, uint32_t operand1, |
348 uint32_t operand2, uint32_t operand3); | 347 uint32_t operand2, uint32_t operand3); |
349 void Output(Bytecode bytecode, uint32_t operand0, uint32_t operand1, | 348 void Output(Bytecode bytecode, uint32_t operand0, uint32_t operand1, |
350 uint32_t operand2); | 349 uint32_t operand2); |
351 void Output(Bytecode bytecode, uint32_t operand0, uint32_t operand1); | 350 void Output(Bytecode bytecode, uint32_t operand0, uint32_t operand1); |
352 void Output(Bytecode bytecode, uint32_t operand0); | 351 void Output(Bytecode bytecode, uint32_t operand0); |
353 void Output(Bytecode bytecode); | 352 void Output(Bytecode bytecode); |
354 | 353 |
355 BytecodeArrayBuilder& OutputJump(Bytecode jump_bytecode, | 354 BytecodeArrayBuilder& OutputJump(BytecodeNode* node, BytecodeLabel* label); |
356 BytecodeLabel* label); | |
357 | 355 |
358 bool RegisterIsValid(Register reg) const; | 356 bool RegisterIsValid(Register reg) const; |
359 bool OperandsAreValid(Bytecode bytecode, int operand_count, | 357 bool OperandsAreValid(Bytecode bytecode, int operand_count, |
360 uint32_t operand0 = 0, uint32_t operand1 = 0, | 358 uint32_t operand0 = 0, uint32_t operand1 = 0, |
361 uint32_t operand2 = 0, uint32_t operand3 = 0) const; | 359 uint32_t operand2 = 0, uint32_t operand3 = 0) const; |
362 | 360 |
363 // Attach latest source position to |node|. | 361 // Attach latest source position to |node|. |
364 void AttachSourceInfo(BytecodeNode* node); | 362 void AttachSourceInfo(BytecodeNode* node); |
365 | 363 |
366 // Set position for return. | 364 // Set position for return. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 static int const kNoFeedbackSlot = 0; | 405 static int const kNoFeedbackSlot = 0; |
408 | 406 |
409 DISALLOW_COPY_AND_ASSIGN(BytecodeArrayBuilder); | 407 DISALLOW_COPY_AND_ASSIGN(BytecodeArrayBuilder); |
410 }; | 408 }; |
411 | 409 |
412 } // namespace interpreter | 410 } // namespace interpreter |
413 } // namespace internal | 411 } // namespace internal |
414 } // namespace v8 | 412 } // namespace v8 |
415 | 413 |
416 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ | 414 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ |
OLD | NEW |