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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
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 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 __ push(ebx); | 605 __ push(ebx); |
606 | 606 |
607 // Dispatch to the first bytecode handler for the function. | 607 // Dispatch to the first bytecode handler for the function. |
608 __ movzx_b(eax, Operand(kInterpreterBytecodeArrayRegister, | 608 __ movzx_b(eax, Operand(kInterpreterBytecodeArrayRegister, |
609 kInterpreterBytecodeOffsetRegister, times_1, 0)); | 609 kInterpreterBytecodeOffsetRegister, times_1, 0)); |
610 __ mov(ebx, Operand(ebx, eax, times_pointer_size, 0)); | 610 __ mov(ebx, Operand(ebx, eax, times_pointer_size, 0)); |
611 // Restore undefined_value in accumulator (eax) | 611 // Restore undefined_value in accumulator (eax) |
612 // TODO(rmcilroy): Remove this once we move the dispatch table back into a | 612 // TODO(rmcilroy): Remove this once we move the dispatch table back into a |
613 // register. | 613 // register. |
614 __ mov(eax, Immediate(masm->isolate()->factory()->undefined_value())); | 614 __ mov(eax, Immediate(masm->isolate()->factory()->undefined_value())); |
615 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging | |
616 // and header removal. | |
617 __ add(ebx, Immediate(Code::kHeaderSize - kHeapObjectTag)); | |
618 __ call(ebx); | 615 __ call(ebx); |
619 | 616 |
620 // Even though the first bytecode handler was called, we will never return. | 617 // Even though the first bytecode handler was called, we will never return. |
621 __ Abort(kUnexpectedReturnFromBytecodeHandler); | 618 __ Abort(kUnexpectedReturnFromBytecodeHandler); |
622 | 619 |
623 // Load debug copy of the bytecode array. | 620 // Load debug copy of the bytecode array. |
624 __ bind(&load_debug_bytecode_array); | 621 __ bind(&load_debug_bytecode_array); |
625 Register debug_info = kInterpreterBytecodeArrayRegister; | 622 Register debug_info = kInterpreterBytecodeArrayRegister; |
626 __ mov(debug_info, FieldOperand(eax, SharedFunctionInfo::kDebugInfoOffset)); | 623 __ mov(debug_info, FieldOperand(eax, SharedFunctionInfo::kDebugInfoOffset)); |
627 __ mov(kInterpreterBytecodeArrayRegister, | 624 __ mov(kInterpreterBytecodeArrayRegister, |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
775 | 772 |
776 // Dispatch to the target bytecode. | 773 // Dispatch to the target bytecode. |
777 __ movzx_b(esi, Operand(kInterpreterBytecodeArrayRegister, | 774 __ movzx_b(esi, Operand(kInterpreterBytecodeArrayRegister, |
778 kInterpreterBytecodeOffsetRegister, times_1, 0)); | 775 kInterpreterBytecodeOffsetRegister, times_1, 0)); |
779 __ mov(ebx, Operand(ebx, esi, times_pointer_size, 0)); | 776 __ mov(ebx, Operand(ebx, esi, times_pointer_size, 0)); |
780 | 777 |
781 // Get the context from the frame. | 778 // Get the context from the frame. |
782 __ mov(kContextRegister, | 779 __ mov(kContextRegister, |
783 Operand(kInterpreterRegisterFileRegister, | 780 Operand(kInterpreterRegisterFileRegister, |
784 InterpreterFrameConstants::kContextFromRegisterPointer)); | 781 InterpreterFrameConstants::kContextFromRegisterPointer)); |
785 | |
786 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging | |
787 // and header removal. | |
788 __ add(ebx, Immediate(Code::kHeaderSize - kHeapObjectTag)); | |
789 __ jmp(ebx); | 782 __ jmp(ebx); |
790 } | 783 } |
791 | 784 |
792 | 785 |
793 static void Generate_InterpreterNotifyDeoptimizedHelper( | 786 static void Generate_InterpreterNotifyDeoptimizedHelper( |
794 MacroAssembler* masm, Deoptimizer::BailoutType type) { | 787 MacroAssembler* masm, Deoptimizer::BailoutType type) { |
795 // Enter an internal frame. | 788 // Enter an internal frame. |
796 { | 789 { |
797 FrameScope scope(masm, StackFrame::INTERNAL); | 790 FrameScope scope(masm, StackFrame::INTERNAL); |
798 | 791 |
(...skipping 1923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2722 // And "return" to the OSR entry point of the function. | 2715 // And "return" to the OSR entry point of the function. |
2723 __ ret(0); | 2716 __ ret(0); |
2724 } | 2717 } |
2725 | 2718 |
2726 | 2719 |
2727 #undef __ | 2720 #undef __ |
2728 } // namespace internal | 2721 } // namespace internal |
2729 } // namespace v8 | 2722 } // namespace v8 |
2730 | 2723 |
2731 #endif // V8_TARGET_ARCH_IA32 | 2724 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |