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-peephole-optimizer.h" | 9 #include "src/interpreter/bytecode-peephole-optimizer.h" |
10 #include "src/interpreter/interpreter-intrinsics.h" | 10 #include "src/interpreter/interpreter-intrinsics.h" |
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
753 | 753 |
754 | 754 |
755 BytecodeArrayBuilder& BytecodeArrayBuilder::ReThrow() { | 755 BytecodeArrayBuilder& BytecodeArrayBuilder::ReThrow() { |
756 Output(Bytecode::kReThrow); | 756 Output(Bytecode::kReThrow); |
757 exit_seen_in_block_ = true; | 757 exit_seen_in_block_ = true; |
758 return *this; | 758 return *this; |
759 } | 759 } |
760 | 760 |
761 | 761 |
762 BytecodeArrayBuilder& BytecodeArrayBuilder::Return() { | 762 BytecodeArrayBuilder& BytecodeArrayBuilder::Return() { |
763 SetReturnPosition(); | |
764 Output(Bytecode::kReturn); | 763 Output(Bytecode::kReturn); |
765 exit_seen_in_block_ = true; | 764 exit_seen_in_block_ = true; |
766 return *this; | 765 return *this; |
767 } | 766 } |
768 | 767 |
769 BytecodeArrayBuilder& BytecodeArrayBuilder::Debugger() { | 768 BytecodeArrayBuilder& BytecodeArrayBuilder::Debugger() { |
770 Output(Bytecode::kDebugger); | 769 Output(Bytecode::kDebugger); |
771 return *this; | 770 return *this; |
772 } | 771 } |
773 | 772 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
857 | 856 |
858 | 857 |
859 void BytecodeArrayBuilder::LeaveBasicBlock() { | 858 void BytecodeArrayBuilder::LeaveBasicBlock() { |
860 exit_seen_in_block_ = false; | 859 exit_seen_in_block_ = false; |
861 pipeline()->FlushBasicBlock(); | 860 pipeline()->FlushBasicBlock(); |
862 } | 861 } |
863 | 862 |
864 void BytecodeArrayBuilder::EnsureReturn() { | 863 void BytecodeArrayBuilder::EnsureReturn() { |
865 if (!exit_seen_in_block_) { | 864 if (!exit_seen_in_block_) { |
866 LoadUndefined(); | 865 LoadUndefined(); |
| 866 SetReturnPosition(); |
867 Return(); | 867 Return(); |
868 } | 868 } |
869 DCHECK(exit_seen_in_block_); | 869 DCHECK(exit_seen_in_block_); |
870 } | 870 } |
871 | 871 |
872 BytecodeArrayBuilder& BytecodeArrayBuilder::Call(Register callable, | 872 BytecodeArrayBuilder& BytecodeArrayBuilder::Call(Register callable, |
873 Register receiver_args, | 873 Register receiver_args, |
874 size_t receiver_args_count, | 874 size_t receiver_args_count, |
875 int feedback_slot, | 875 int feedback_slot, |
876 TailCallMode tail_call_mode) { | 876 TailCallMode tail_call_mode) { |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1284 } | 1284 } |
1285 | 1285 |
1286 uint32_t BytecodeArrayBuilder::UnsignedOperand(size_t value) { | 1286 uint32_t BytecodeArrayBuilder::UnsignedOperand(size_t value) { |
1287 DCHECK_LE(value, kMaxUInt32); | 1287 DCHECK_LE(value, kMaxUInt32); |
1288 return static_cast<uint32_t>(value); | 1288 return static_cast<uint32_t>(value); |
1289 } | 1289 } |
1290 | 1290 |
1291 } // namespace interpreter | 1291 } // namespace interpreter |
1292 } // namespace internal | 1292 } // namespace internal |
1293 } // namespace v8 | 1293 } // namespace v8 |
OLD | NEW |