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/globals.h" | 7 #include "src/globals.h" |
8 #include "src/interpreter/bytecode-array-writer.h" | 8 #include "src/interpreter/bytecode-array-writer.h" |
9 #include "src/interpreter/bytecode-jump-table.h" | 9 #include "src/interpreter/bytecode-jump-table.h" |
10 #include "src/interpreter/bytecode-label.h" | 10 #include "src/interpreter/bytecode-label.h" |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 | 255 |
256 template <> | 256 template <> |
257 class OperandHelper<OperandType::kRegOut> { | 257 class OperandHelper<OperandType::kRegOut> { |
258 public: | 258 public: |
259 INLINE(static uint32_t Convert(BytecodeArrayBuilder* builder, Register reg)) { | 259 INLINE(static uint32_t Convert(BytecodeArrayBuilder* builder, Register reg)) { |
260 return builder->GetOutputRegisterOperand(reg); | 260 return builder->GetOutputRegisterOperand(reg); |
261 } | 261 } |
262 }; | 262 }; |
263 | 263 |
264 template <> | 264 template <> |
| 265 class OperandHelper<OperandType::kRegOutList> { |
| 266 public: |
| 267 INLINE(static uint32_t Convert(BytecodeArrayBuilder* builder, |
| 268 RegisterList reg_list)) { |
| 269 return builder->GetOutputRegisterListOperand(reg_list); |
| 270 } |
| 271 }; |
| 272 |
| 273 template <> |
265 class OperandHelper<OperandType::kRegOutPair> { | 274 class OperandHelper<OperandType::kRegOutPair> { |
266 public: | 275 public: |
267 INLINE(static uint32_t Convert(BytecodeArrayBuilder* builder, | 276 INLINE(static uint32_t Convert(BytecodeArrayBuilder* builder, |
268 RegisterList reg_list)) { | 277 RegisterList reg_list)) { |
269 DCHECK_EQ(2, reg_list.register_count()); | 278 DCHECK_EQ(2, reg_list.register_count()); |
270 return builder->GetOutputRegisterListOperand(reg_list); | 279 return builder->GetOutputRegisterListOperand(reg_list); |
271 } | 280 } |
272 }; | 281 }; |
273 | 282 |
274 template <> | 283 template <> |
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1228 return *this; | 1237 return *this; |
1229 } | 1238 } |
1230 | 1239 |
1231 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadModuleVariable(int cell_index, | 1240 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadModuleVariable(int cell_index, |
1232 int depth) { | 1241 int depth) { |
1233 OutputLdaModuleVariable(cell_index, depth); | 1242 OutputLdaModuleVariable(cell_index, depth); |
1234 return *this; | 1243 return *this; |
1235 } | 1244 } |
1236 | 1245 |
1237 BytecodeArrayBuilder& BytecodeArrayBuilder::SuspendGenerator( | 1246 BytecodeArrayBuilder& BytecodeArrayBuilder::SuspendGenerator( |
1238 Register generator, SuspendFlags flags) { | 1247 Register generator, RegisterList registers, SuspendFlags flags) { |
1239 OutputSuspendGenerator(generator, | 1248 OutputSuspendGenerator(generator, registers, registers.register_count(), |
1240 SuspendGeneratorBytecodeFlags::Encode(flags)); | 1249 SuspendGeneratorBytecodeFlags::Encode(flags)); |
1241 return *this; | 1250 return *this; |
1242 } | 1251 } |
1243 | 1252 |
1244 BytecodeArrayBuilder& BytecodeArrayBuilder::ResumeGenerator( | 1253 BytecodeArrayBuilder& BytecodeArrayBuilder::RestoreGeneratorState( |
1245 Register generator) { | 1254 Register generator) { |
1246 OutputResumeGenerator(generator); | 1255 OutputRestoreGeneratorState(generator); |
1247 return *this; | 1256 return *this; |
1248 } | 1257 } |
1249 | 1258 |
| 1259 BytecodeArrayBuilder& BytecodeArrayBuilder::RestoreGeneratorRegisters( |
| 1260 Register generator, RegisterList registers) { |
| 1261 OutputRestoreGeneratorRegisters(generator, registers, |
| 1262 registers.register_count()); |
| 1263 return *this; |
| 1264 } |
| 1265 |
1250 BytecodeArrayBuilder& BytecodeArrayBuilder::MarkHandler( | 1266 BytecodeArrayBuilder& BytecodeArrayBuilder::MarkHandler( |
1251 int handler_id, HandlerTable::CatchPrediction catch_prediction) { | 1267 int handler_id, HandlerTable::CatchPrediction catch_prediction) { |
1252 BytecodeLabel handler; | 1268 BytecodeLabel handler; |
1253 Bind(&handler); | 1269 Bind(&handler); |
1254 handler_table_builder()->SetHandlerTarget(handler_id, handler.offset()); | 1270 handler_table_builder()->SetHandlerTarget(handler_id, handler.offset()); |
1255 handler_table_builder()->SetPrediction(handler_id, catch_prediction); | 1271 handler_table_builder()->SetPrediction(handler_id, catch_prediction); |
1256 return *this; | 1272 return *this; |
1257 } | 1273 } |
1258 | 1274 |
1259 BytecodeArrayBuilder& BytecodeArrayBuilder::MarkTryBegin(int handler_id, | 1275 BytecodeArrayBuilder& BytecodeArrayBuilder::MarkTryBegin(int handler_id, |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1513 return os << "AlreadyBoolean"; | 1529 return os << "AlreadyBoolean"; |
1514 case BytecodeArrayBuilder::ToBooleanMode::kConvertToBoolean: | 1530 case BytecodeArrayBuilder::ToBooleanMode::kConvertToBoolean: |
1515 return os << "ConvertToBoolean"; | 1531 return os << "ConvertToBoolean"; |
1516 } | 1532 } |
1517 UNREACHABLE(); | 1533 UNREACHABLE(); |
1518 } | 1534 } |
1519 | 1535 |
1520 } // namespace interpreter | 1536 } // namespace interpreter |
1521 } // namespace internal | 1537 } // namespace internal |
1522 } // namespace v8 | 1538 } // namespace v8 |
OLD | NEW |