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/globals.h" | 8 #include "src/globals.h" |
9 #include "src/interpreter/bytecode-array-writer.h" | 9 #include "src/interpreter/bytecode-array-writer.h" |
10 #include "src/interpreter/bytecode-dead-code-optimizer.h" | 10 #include "src/interpreter/bytecode-dead-code-optimizer.h" |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 return *this; | 338 return *this; |
339 } | 339 } |
340 | 340 |
341 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateBlockContext( | 341 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateBlockContext( |
342 Handle<ScopeInfo> scope_info) { | 342 Handle<ScopeInfo> scope_info) { |
343 size_t entry = GetConstantPoolEntry(scope_info); | 343 size_t entry = GetConstantPoolEntry(scope_info); |
344 Output(Bytecode::kCreateBlockContext, UnsignedOperand(entry)); | 344 Output(Bytecode::kCreateBlockContext, UnsignedOperand(entry)); |
345 return *this; | 345 return *this; |
346 } | 346 } |
347 | 347 |
| 348 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateCatchContext( |
| 349 Register exception, Handle<String> name) { |
| 350 size_t name_index = GetConstantPoolEntry(name); |
| 351 Output(Bytecode::kCreateCatchContext, RegisterOperand(exception), |
| 352 UnsignedOperand(name_index)); |
| 353 return *this; |
| 354 } |
| 355 |
348 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateFunctionContext(int slots) { | 356 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateFunctionContext(int slots) { |
349 Output(Bytecode::kCreateFunctionContext, UnsignedOperand(slots)); | 357 Output(Bytecode::kCreateFunctionContext, UnsignedOperand(slots)); |
350 return *this; | 358 return *this; |
351 } | 359 } |
352 | 360 |
353 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateWithContext(Register object) { | 361 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateWithContext(Register object) { |
354 Output(Bytecode::kCreateWithContext, RegisterOperand(object)); | 362 Output(Bytecode::kCreateWithContext, RegisterOperand(object)); |
355 return *this; | 363 return *this; |
356 } | 364 } |
357 | 365 |
358 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateArguments( | 366 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateArguments( |
359 CreateArgumentsType type) { | 367 CreateArgumentsType type) { |
360 // TODO(rmcilroy): Consider passing the type as a bytecode operand rather | 368 // TODO(rmcilroy): Consider passing the type as a bytecode operand rather |
361 // than having two different bytecodes once we have better support for | 369 // than having two different bytecodes once we have better support for |
362 // branches in the InterpreterAssembler. | 370 // branches in the InterpreterAssembler. |
363 Bytecode bytecode = BytecodeForCreateArguments(type); | 371 Bytecode bytecode = BytecodeForCreateArguments(type); |
364 Output(bytecode); | 372 Output(bytecode); |
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
976 return Bytecode::kTailCall; | 984 return Bytecode::kTailCall; |
977 default: | 985 default: |
978 UNREACHABLE(); | 986 UNREACHABLE(); |
979 } | 987 } |
980 return Bytecode::kIllegal; | 988 return Bytecode::kIllegal; |
981 } | 989 } |
982 | 990 |
983 } // namespace interpreter | 991 } // namespace interpreter |
984 } // namespace internal | 992 } // namespace internal |
985 } // namespace v8 | 993 } // namespace v8 |
OLD | NEW |