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-dead-code-optimizer.h" | 9 #include "src/interpreter/bytecode-dead-code-optimizer.h" |
10 #include "src/interpreter/bytecode-label.h" | 10 #include "src/interpreter/bytecode-label.h" |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 Output(Bytecode::kCreateCatchContext, RegisterOperand(exception), | 356 Output(Bytecode::kCreateCatchContext, RegisterOperand(exception), |
357 UnsignedOperand(name_index), UnsignedOperand(scope_info_index)); | 357 UnsignedOperand(name_index), UnsignedOperand(scope_info_index)); |
358 return *this; | 358 return *this; |
359 } | 359 } |
360 | 360 |
361 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateFunctionContext(int slots) { | 361 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateFunctionContext(int slots) { |
362 Output(Bytecode::kCreateFunctionContext, UnsignedOperand(slots)); | 362 Output(Bytecode::kCreateFunctionContext, UnsignedOperand(slots)); |
363 return *this; | 363 return *this; |
364 } | 364 } |
365 | 365 |
366 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateWithContext(Register object) { | 366 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateWithContext( |
367 Output(Bytecode::kCreateWithContext, RegisterOperand(object)); | 367 Register object, Handle<ScopeInfo> scope_info) { |
| 368 size_t scope_info_index = GetConstantPoolEntry(scope_info); |
| 369 Output(Bytecode::kCreateWithContext, RegisterOperand(object), |
| 370 UnsignedOperand(scope_info_index)); |
368 return *this; | 371 return *this; |
369 } | 372 } |
370 | 373 |
371 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateArguments( | 374 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateArguments( |
372 CreateArgumentsType type) { | 375 CreateArgumentsType type) { |
373 // TODO(rmcilroy): Consider passing the type as a bytecode operand rather | 376 // TODO(rmcilroy): Consider passing the type as a bytecode operand rather |
374 // than having two different bytecodes once we have better support for | 377 // than having two different bytecodes once we have better support for |
375 // branches in the InterpreterAssembler. | 378 // branches in the InterpreterAssembler. |
376 Bytecode bytecode = BytecodeForCreateArguments(type); | 379 Bytecode bytecode = BytecodeForCreateArguments(type); |
377 Output(bytecode); | 380 Output(bytecode); |
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
991 return Bytecode::kTailCall; | 994 return Bytecode::kTailCall; |
992 default: | 995 default: |
993 UNREACHABLE(); | 996 UNREACHABLE(); |
994 } | 997 } |
995 return Bytecode::kIllegal; | 998 return Bytecode::kIllegal; |
996 } | 999 } |
997 | 1000 |
998 } // namespace interpreter | 1001 } // namespace interpreter |
999 } // namespace internal | 1002 } // namespace internal |
1000 } // namespace v8 | 1003 } // namespace v8 |
OLD | NEW |