Chromium Code Reviews| 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/interpreter-assembler.h" | 5 #include "src/interpreter/interpreter-assembler.h" |
| 6 | 6 |
| 7 #include <ostream> | 7 #include <ostream> |
| 8 | 8 |
| 9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
| 10 #include "src/frames.h" | 10 #include "src/frames.h" |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 418 Load(MachineType::Pointer(), DispatchTableRawPointer(), | 418 Load(MachineType::Pointer(), DispatchTableRawPointer(), |
| 419 Word32Shl(target_bytecode, Int32Constant(kPointerSizeLog2))); | 419 Word32Shl(target_bytecode, Int32Constant(kPointerSizeLog2))); |
| 420 | 420 |
| 421 InterpreterDispatchDescriptor descriptor(isolate()); | 421 InterpreterDispatchDescriptor descriptor(isolate()); |
| 422 Node* args[] = {GetAccumulator(), RegisterFileRawPointer(), | 422 Node* args[] = {GetAccumulator(), RegisterFileRawPointer(), |
| 423 new_bytecode_offset, BytecodeArrayTaggedPointer(), | 423 new_bytecode_offset, BytecodeArrayTaggedPointer(), |
| 424 DispatchTableRawPointer(), GetContext()}; | 424 DispatchTableRawPointer(), GetContext()}; |
| 425 TailCall(descriptor, target_code_object, args, 0); | 425 TailCall(descriptor, target_code_object, args, 0); |
| 426 } | 426 } |
| 427 | 427 |
| 428 void InterpreterAssembler::DispatchToHandler(Node* handler) { | |
| 429 if (FLAG_trace_ignition) { | |
| 430 TraceBytecode(Runtime::kInterpreterTraceBytecodeExit); | |
| 431 } | |
| 432 | |
| 433 InterpreterDispatchDescriptor descriptor(isolate()); | |
| 434 Node* args[] = {GetAccumulator(), RegisterFileRawPointer(), | |
| 435 BytecodeOffset(), BytecodeArrayTaggedPointer(), | |
| 436 DispatchTableRawPointer(), GetContext()}; | |
| 437 TailCall(descriptor, handler, args, 0); | |
| 438 } | |
| 439 | |
| 428 void InterpreterAssembler::InterpreterReturn() { | 440 void InterpreterAssembler::InterpreterReturn() { |
| 429 if (FLAG_trace_ignition) { | 441 if (FLAG_trace_ignition) { |
| 430 TraceBytecode(Runtime::kInterpreterTraceBytecodeExit); | 442 TraceBytecode(Runtime::kInterpreterTraceBytecodeExit); |
| 431 } | 443 } |
| 432 InterpreterDispatchDescriptor descriptor(isolate()); | 444 InterpreterDispatchDescriptor descriptor(isolate()); |
| 433 Node* exit_trampoline_code_object = | 445 Node* exit_trampoline_code_object = |
| 434 HeapConstant(isolate()->builtins()->InterpreterExitTrampoline()); | 446 HeapConstant(isolate()->builtins()->InterpreterExitTrampoline()); |
| 435 Node* args[] = {GetAccumulator(), RegisterFileRawPointer(), | 447 Node* args[] = {GetAccumulator(), RegisterFileRawPointer(), |
| 436 BytecodeOffset(), BytecodeArrayTaggedPointer(), | 448 BytecodeOffset(), BytecodeArrayTaggedPointer(), |
| 437 DispatchTableRawPointer(), GetContext()}; | 449 DispatchTableRawPointer(), GetContext()}; |
| 438 TailCall(descriptor, exit_trampoline_code_object, args, 0); | 450 TailCall(descriptor, exit_trampoline_code_object, args, 0); |
|
rmcilroy
2016/02/16 10:46:38
Could you make InterpreterReturn (and possibly use
Yang
2016/02/19 13:09:18
Done.
| |
| 439 } | 451 } |
| 440 | 452 |
| 441 void InterpreterAssembler::StackCheck() { | 453 void InterpreterAssembler::StackCheck() { |
| 442 CodeStubAssembler::Label end(this); | 454 CodeStubAssembler::Label end(this); |
| 443 CodeStubAssembler::Label ok(this); | 455 CodeStubAssembler::Label ok(this); |
| 444 CodeStubAssembler::Label stack_guard(this); | 456 CodeStubAssembler::Label stack_guard(this); |
| 445 | 457 |
| 446 Node* sp = LoadStackPointer(); | 458 Node* sp = LoadStackPointer(); |
| 447 Node* stack_limit = Load( | 459 Node* stack_limit = Load( |
| 448 MachineType::Pointer(), | 460 MachineType::Pointer(), |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 492 #elif V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_X87 | 504 #elif V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_X87 |
| 493 return true; | 505 return true; |
| 494 #else | 506 #else |
| 495 #error "Unknown Architecture" | 507 #error "Unknown Architecture" |
| 496 #endif | 508 #endif |
| 497 } | 509 } |
| 498 | 510 |
| 499 } // namespace interpreter | 511 } // namespace interpreter |
| 500 } // namespace internal | 512 } // namespace internal |
| 501 } // namespace v8 | 513 } // namespace v8 |
| OLD | NEW |