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 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 Immediate(BytecodeArray::kHeaderSize - kHeapObjectTag)); | 600 Immediate(BytecodeArray::kHeaderSize - kHeapObjectTag)); |
601 __ mov(kInterpreterDispatchTableRegister, | 601 __ mov(kInterpreterDispatchTableRegister, |
602 Immediate(ExternalReference::interpreter_dispatch_table_address( | 602 Immediate(ExternalReference::interpreter_dispatch_table_address( |
603 masm->isolate()))); | 603 masm->isolate()))); |
604 | 604 |
605 // Dispatch to the first bytecode handler for the function. | 605 // Dispatch to the first bytecode handler for the function. |
606 __ movzx_b(ebx, Operand(kInterpreterBytecodeArrayRegister, | 606 __ movzx_b(ebx, Operand(kInterpreterBytecodeArrayRegister, |
607 kInterpreterBytecodeOffsetRegister, times_1, 0)); | 607 kInterpreterBytecodeOffsetRegister, times_1, 0)); |
608 __ mov(ebx, Operand(kInterpreterDispatchTableRegister, ebx, | 608 __ mov(ebx, Operand(kInterpreterDispatchTableRegister, ebx, |
609 times_pointer_size, 0)); | 609 times_pointer_size, 0)); |
610 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging | |
611 // and header removal. | |
612 __ add(ebx, Immediate(Code::kHeaderSize - kHeapObjectTag)); | |
613 __ call(ebx); | 610 __ call(ebx); |
614 | 611 |
615 // Even though the first bytecode handler was called, we will never return. | 612 // Even though the first bytecode handler was called, we will never return. |
616 __ Abort(kUnexpectedReturnFromBytecodeHandler); | 613 __ Abort(kUnexpectedReturnFromBytecodeHandler); |
617 | 614 |
618 // Load debug copy of the bytecode array. | 615 // Load debug copy of the bytecode array. |
619 __ bind(&load_debug_bytecode_array); | 616 __ bind(&load_debug_bytecode_array); |
620 Register debug_info = kInterpreterBytecodeArrayRegister; | 617 Register debug_info = kInterpreterBytecodeArrayRegister; |
621 __ mov(debug_info, FieldOperand(eax, SharedFunctionInfo::kDebugInfoOffset)); | 618 __ mov(debug_info, FieldOperand(eax, SharedFunctionInfo::kDebugInfoOffset)); |
622 __ mov(kInterpreterBytecodeArrayRegister, | 619 __ mov(kInterpreterBytecodeArrayRegister, |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
761 kInterpreterBytecodeOffsetRegister, | 758 kInterpreterBytecodeOffsetRegister, |
762 Operand(kInterpreterRegisterFileRegister, | 759 Operand(kInterpreterRegisterFileRegister, |
763 InterpreterFrameConstants::kBytecodeOffsetFromRegisterPointer)); | 760 InterpreterFrameConstants::kBytecodeOffsetFromRegisterPointer)); |
764 __ SmiUntag(kInterpreterBytecodeOffsetRegister); | 761 __ SmiUntag(kInterpreterBytecodeOffsetRegister); |
765 | 762 |
766 // Dispatch to the target bytecode. | 763 // Dispatch to the target bytecode. |
767 __ movzx_b(ebx, Operand(kInterpreterBytecodeArrayRegister, | 764 __ movzx_b(ebx, Operand(kInterpreterBytecodeArrayRegister, |
768 kInterpreterBytecodeOffsetRegister, times_1, 0)); | 765 kInterpreterBytecodeOffsetRegister, times_1, 0)); |
769 __ mov(ebx, Operand(kInterpreterDispatchTableRegister, ebx, | 766 __ mov(ebx, Operand(kInterpreterDispatchTableRegister, ebx, |
770 times_pointer_size, 0)); | 767 times_pointer_size, 0)); |
771 | |
772 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging | |
773 // and header removal. | |
774 __ add(ebx, Immediate(Code::kHeaderSize - kHeapObjectTag)); | |
775 __ jmp(ebx); | 768 __ jmp(ebx); |
776 } | 769 } |
777 | 770 |
778 | 771 |
779 static void Generate_InterpreterNotifyDeoptimizedHelper( | 772 static void Generate_InterpreterNotifyDeoptimizedHelper( |
780 MacroAssembler* masm, Deoptimizer::BailoutType type) { | 773 MacroAssembler* masm, Deoptimizer::BailoutType type) { |
781 // Enter an internal frame. | 774 // Enter an internal frame. |
782 { | 775 { |
783 FrameScope scope(masm, StackFrame::INTERNAL); | 776 FrameScope scope(masm, StackFrame::INTERNAL); |
784 | 777 |
(...skipping 2097 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2882 // And "return" to the OSR entry point of the function. | 2875 // And "return" to the OSR entry point of the function. |
2883 __ ret(0); | 2876 __ ret(0); |
2884 } | 2877 } |
2885 | 2878 |
2886 | 2879 |
2887 #undef __ | 2880 #undef __ |
2888 } // namespace internal | 2881 } // namespace internal |
2889 } // namespace v8 | 2882 } // namespace v8 |
2890 | 2883 |
2891 #endif // V8_TARGET_ARCH_X87 | 2884 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |