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 #include "src/interpreter/bytecode-array-builder.h" | 5 #include "src/interpreter/bytecode-array-builder.h" |
6 | 6 |
7 #include "src/compiler.h" | 7 #include "src/compiler.h" |
8 #include "src/interpreter/bytecode-array-writer.h" | 8 #include "src/interpreter/bytecode-array-writer.h" |
9 #include "src/interpreter/bytecode-label.h" | 9 #include "src/interpreter/bytecode-label.h" |
10 #include "src/interpreter/bytecode-peephole-optimizer.h" | 10 #include "src/interpreter/bytecode-peephole-optimizer.h" |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 Output(Bytecode::kThrow); | 529 Output(Bytecode::kThrow); |
530 return *this; | 530 return *this; |
531 } | 531 } |
532 | 532 |
533 BytecodeArrayBuilder& BytecodeArrayBuilder::ReThrow() { | 533 BytecodeArrayBuilder& BytecodeArrayBuilder::ReThrow() { |
534 Output(Bytecode::kReThrow); | 534 Output(Bytecode::kReThrow); |
535 return *this; | 535 return *this; |
536 } | 536 } |
537 | 537 |
538 BytecodeArrayBuilder& BytecodeArrayBuilder::Return() { | 538 BytecodeArrayBuilder& BytecodeArrayBuilder::Return() { |
| 539 SetReturnPosition(); |
539 Output(Bytecode::kReturn); | 540 Output(Bytecode::kReturn); |
540 return_seen_in_block_ = true; | 541 return_seen_in_block_ = true; |
541 return *this; | 542 return *this; |
542 } | 543 } |
543 | 544 |
544 BytecodeArrayBuilder& BytecodeArrayBuilder::Debugger() { | 545 BytecodeArrayBuilder& BytecodeArrayBuilder::Debugger() { |
545 Output(Bytecode::kDebugger); | 546 Output(Bytecode::kDebugger); |
546 return *this; | 547 return *this; |
547 } | 548 } |
548 | 549 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 BytecodeArrayBuilder& BytecodeArrayBuilder::MarkTryEnd(int handler_id) { | 624 BytecodeArrayBuilder& BytecodeArrayBuilder::MarkTryEnd(int handler_id) { |
624 BytecodeLabel try_end; | 625 BytecodeLabel try_end; |
625 Bind(&try_end); | 626 Bind(&try_end); |
626 handler_table_builder()->SetTryRegionEnd(handler_id, try_end.offset()); | 627 handler_table_builder()->SetTryRegionEnd(handler_id, try_end.offset()); |
627 return *this; | 628 return *this; |
628 } | 629 } |
629 | 630 |
630 void BytecodeArrayBuilder::EnsureReturn() { | 631 void BytecodeArrayBuilder::EnsureReturn() { |
631 if (!return_seen_in_block_) { | 632 if (!return_seen_in_block_) { |
632 LoadUndefined(); | 633 LoadUndefined(); |
633 SetReturnPosition(); | |
634 Return(); | 634 Return(); |
635 } | 635 } |
636 DCHECK(return_seen_in_block_); | 636 DCHECK(return_seen_in_block_); |
637 } | 637 } |
638 | 638 |
639 BytecodeArrayBuilder& BytecodeArrayBuilder::Call(Register callable, | 639 BytecodeArrayBuilder& BytecodeArrayBuilder::Call(Register callable, |
640 Register receiver_args, | 640 Register receiver_args, |
641 size_t receiver_args_count, | 641 size_t receiver_args_count, |
642 int feedback_slot, | 642 int feedback_slot, |
643 TailCallMode tail_call_mode) { | 643 TailCallMode tail_call_mode) { |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1046 } | 1046 } |
1047 | 1047 |
1048 uint32_t BytecodeArrayBuilder::UnsignedOperand(size_t value) { | 1048 uint32_t BytecodeArrayBuilder::UnsignedOperand(size_t value) { |
1049 DCHECK_LE(value, kMaxUInt32); | 1049 DCHECK_LE(value, kMaxUInt32); |
1050 return static_cast<uint32_t>(value); | 1050 return static_cast<uint32_t>(value); |
1051 } | 1051 } |
1052 | 1052 |
1053 } // namespace interpreter | 1053 } // namespace interpreter |
1054 } // namespace internal | 1054 } // namespace internal |
1055 } // namespace v8 | 1055 } // namespace v8 |
OLD | NEW |