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 #include "src/compiler.h" | 6 #include "src/compiler.h" |
7 #include "src/interpreter/interpreter-intrinsics.h" | 7 #include "src/interpreter/interpreter-intrinsics.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
934 } | 934 } |
935 | 935 |
936 | 936 |
937 BytecodeArrayBuilder& BytecodeArrayBuilder::ForInStep(Register index) { | 937 BytecodeArrayBuilder& BytecodeArrayBuilder::ForInStep(Register index) { |
938 OperandScale operand_scale = OperandSizesToScale(index.SizeOfOperand()); | 938 OperandScale operand_scale = OperandSizesToScale(index.SizeOfOperand()); |
939 OutputScaled(Bytecode::kForInStep, operand_scale, RegisterOperand(index)); | 939 OutputScaled(Bytecode::kForInStep, operand_scale, RegisterOperand(index)); |
940 return *this; | 940 return *this; |
941 } | 941 } |
942 | 942 |
943 | 943 |
| 944 BytecodeArrayBuilder& BytecodeArrayBuilder::SuspendGenerator( |
| 945 Register generator) { |
| 946 OperandScale operand_scale = OperandSizesToScale(generator.SizeOfOperand()); |
| 947 OutputScaled(Bytecode::kSuspendGenerator, operand_scale, |
| 948 RegisterOperand(generator)); |
| 949 return *this; |
| 950 } |
| 951 |
| 952 |
| 953 BytecodeArrayBuilder& BytecodeArrayBuilder::ResumeGenerator( |
| 954 Register generator) { |
| 955 OperandScale operand_scale = OperandSizesToScale(generator.SizeOfOperand()); |
| 956 OutputScaled(Bytecode::kResumeGenerator, operand_scale, |
| 957 RegisterOperand(generator)); |
| 958 return *this; |
| 959 } |
| 960 |
| 961 |
944 BytecodeArrayBuilder& BytecodeArrayBuilder::MarkHandler(int handler_id, | 962 BytecodeArrayBuilder& BytecodeArrayBuilder::MarkHandler(int handler_id, |
945 bool will_catch) { | 963 bool will_catch) { |
946 handler_table_builder()->SetHandlerTarget(handler_id, bytecodes()->size()); | 964 handler_table_builder()->SetHandlerTarget(handler_id, bytecodes()->size()); |
947 handler_table_builder()->SetPrediction(handler_id, will_catch); | 965 handler_table_builder()->SetPrediction(handler_id, will_catch); |
948 return *this; | 966 return *this; |
949 } | 967 } |
950 | 968 |
951 | 969 |
952 BytecodeArrayBuilder& BytecodeArrayBuilder::MarkTryBegin(int handler_id, | 970 BytecodeArrayBuilder& BytecodeArrayBuilder::MarkTryBegin(int handler_id, |
953 Register context) { | 971 Register context) { |
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1471 } | 1489 } |
1472 | 1490 |
1473 uint32_t BytecodeArrayBuilder::UnsignedOperand(size_t value) { | 1491 uint32_t BytecodeArrayBuilder::UnsignedOperand(size_t value) { |
1474 DCHECK_LE(value, kMaxUInt32); | 1492 DCHECK_LE(value, kMaxUInt32); |
1475 return static_cast<uint32_t>(value); | 1493 return static_cast<uint32_t>(value); |
1476 } | 1494 } |
1477 | 1495 |
1478 } // namespace interpreter | 1496 } // namespace interpreter |
1479 } // namespace internal | 1497 } // namespace internal |
1480 } // namespace v8 | 1498 } // namespace v8 |
OLD | NEW |