OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #if V8_TARGET_ARCH_X87 | 5 #if V8_TARGET_ARCH_X87 |
6 | 6 |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
658 // registers. | 658 // registers. |
659 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); | 659 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); |
660 __ mov(kInterpreterRegisterFileRegister, ebp); | 660 __ mov(kInterpreterRegisterFileRegister, ebp); |
661 __ sub( | 661 __ sub( |
662 kInterpreterRegisterFileRegister, | 662 kInterpreterRegisterFileRegister, |
663 Immediate(kPointerSize + StandardFrameConstants::kFixedFrameSizeFromFp)); | 663 Immediate(kPointerSize + StandardFrameConstants::kFixedFrameSizeFromFp)); |
664 __ mov(kInterpreterBytecodeOffsetRegister, | 664 __ mov(kInterpreterBytecodeOffsetRegister, |
665 Immediate(BytecodeArray::kHeaderSize - kHeapObjectTag)); | 665 Immediate(BytecodeArray::kHeaderSize - kHeapObjectTag)); |
666 // Since the dispatch table root might be set after builtins are generated, | 666 // Since the dispatch table root might be set after builtins are generated, |
667 // load directly from the roots table. | 667 // load directly from the roots table. |
668 __ LoadRoot(kInterpreterDispatchTableRegister, | 668 __ LoadRoot(ebx, Heap::kInterpreterTableRootIndex); |
669 Heap::kInterpreterTableRootIndex); | 669 __ add(ebx, Immediate(FixedArray::kHeaderSize - kHeapObjectTag)); |
670 __ add(kInterpreterDispatchTableRegister, | |
671 Immediate(FixedArray::kHeaderSize - kHeapObjectTag)); | |
672 | 670 |
673 // Push context as a stack located parameter to the bytecode handler. | 671 // Push context as a stack located parameter to the bytecode handler. |
674 DCHECK_EQ(-1, kInterpreterContextSpillSlot); | 672 DCHECK_EQ(-1, kInterpreterDispatchTableSpillSlot); |
675 __ push(esi); | 673 __ push(ebx); |
676 | 674 |
677 // Dispatch to the first bytecode handler for the function. | 675 // Dispatch to the first bytecode handler for the function. |
678 __ movzx_b(esi, Operand(kInterpreterBytecodeArrayRegister, | 676 __ movzx_b(eax, Operand(kInterpreterBytecodeArrayRegister, |
679 kInterpreterBytecodeOffsetRegister, times_1, 0)); | 677 kInterpreterBytecodeOffsetRegister, times_1, 0)); |
680 __ mov(esi, Operand(kInterpreterDispatchTableRegister, esi, | 678 __ mov(ebx, Operand(ebx, eax, times_pointer_size, 0)); |
681 times_pointer_size, 0)); | 679 // Restore undefined_value in accumulator (eax) |
| 680 // TODO(rmcilroy): Remove this once we move the dispatch table back into a |
| 681 // register. |
| 682 __ mov(eax, Immediate(masm->isolate()->factory()->undefined_value())); |
682 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging | 683 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging |
683 // and header removal. | 684 // and header removal. |
684 __ add(esi, Immediate(Code::kHeaderSize - kHeapObjectTag)); | 685 __ add(ebx, Immediate(Code::kHeaderSize - kHeapObjectTag)); |
685 __ call(esi); | 686 __ call(ebx); |
686 } | 687 } |
687 | 688 |
688 | 689 |
689 void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) { | 690 void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) { |
690 // TODO(rmcilroy): List of things not currently dealt with here but done in | 691 // TODO(rmcilroy): List of things not currently dealt with here but done in |
691 // fullcodegen's EmitReturnSequence. | 692 // fullcodegen's EmitReturnSequence. |
692 // - Supporting FLAG_trace for Runtime::TraceExit. | 693 // - Supporting FLAG_trace for Runtime::TraceExit. |
693 // - Support profiler (specifically decrementing profiling_counter | 694 // - Support profiler (specifically decrementing profiling_counter |
694 // appropriately and calling out to HandleInterrupts if necessary). | 695 // appropriately and calling out to HandleInterrupts if necessary). |
695 | 696 |
(...skipping 1146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1842 | 1843 |
1843 __ bind(&ok); | 1844 __ bind(&ok); |
1844 __ ret(0); | 1845 __ ret(0); |
1845 } | 1846 } |
1846 | 1847 |
1847 #undef __ | 1848 #undef __ |
1848 } // namespace internal | 1849 } // namespace internal |
1849 } // namespace v8 | 1850 } // namespace v8 |
1850 | 1851 |
1851 #endif // V8_TARGET_ARCH_X87 | 1852 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |