| 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 962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 973 // Pop the temporary registers, so that return address is on top of stack. | 973 // Pop the temporary registers, so that return address is on top of stack. |
| 974 __ Pop(edx); | 974 __ Pop(edx); |
| 975 | 975 |
| 976 __ TailCallRuntime(Runtime::kThrowStackOverflow); | 976 __ TailCallRuntime(Runtime::kThrowStackOverflow); |
| 977 | 977 |
| 978 // This should be unreachable. | 978 // This should be unreachable. |
| 979 __ int3(); | 979 __ int3(); |
| 980 } | 980 } |
| 981 } | 981 } |
| 982 | 982 |
| 983 void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) { | 983 static void Generate_InterpreterEnterBytecode(MacroAssembler* masm) { |
| 984 // Set the return address to the correct point in the interpreter entry | 984 // Set the return address to the correct point in the interpreter entry |
| 985 // trampoline. | 985 // trampoline. |
| 986 Smi* interpreter_entry_return_pc_offset( | 986 Smi* interpreter_entry_return_pc_offset( |
| 987 masm->isolate()->heap()->interpreter_entry_return_pc_offset()); | 987 masm->isolate()->heap()->interpreter_entry_return_pc_offset()); |
| 988 DCHECK_NE(interpreter_entry_return_pc_offset, Smi::kZero); | 988 DCHECK_NE(interpreter_entry_return_pc_offset, Smi::kZero); |
| 989 __ LoadHeapObject(ebx, | 989 __ LoadHeapObject(ebx, |
| 990 masm->isolate()->builtins()->InterpreterEntryTrampoline()); | 990 masm->isolate()->builtins()->InterpreterEntryTrampoline()); |
| 991 __ add(ebx, Immediate(interpreter_entry_return_pc_offset->value() + | 991 __ add(ebx, Immediate(interpreter_entry_return_pc_offset->value() + |
| 992 Code::kHeaderSize - kHeapObjectTag)); | 992 Code::kHeaderSize - kHeapObjectTag)); |
| 993 __ push(ebx); | 993 __ push(ebx); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 1015 __ SmiUntag(kInterpreterBytecodeOffsetRegister); | 1015 __ SmiUntag(kInterpreterBytecodeOffsetRegister); |
| 1016 | 1016 |
| 1017 // Dispatch to the target bytecode. | 1017 // Dispatch to the target bytecode. |
| 1018 __ movzx_b(ebx, Operand(kInterpreterBytecodeArrayRegister, | 1018 __ movzx_b(ebx, Operand(kInterpreterBytecodeArrayRegister, |
| 1019 kInterpreterBytecodeOffsetRegister, times_1, 0)); | 1019 kInterpreterBytecodeOffsetRegister, times_1, 0)); |
| 1020 __ mov(ebx, Operand(kInterpreterDispatchTableRegister, ebx, | 1020 __ mov(ebx, Operand(kInterpreterDispatchTableRegister, ebx, |
| 1021 times_pointer_size, 0)); | 1021 times_pointer_size, 0)); |
| 1022 __ jmp(ebx); | 1022 __ jmp(ebx); |
| 1023 } | 1023 } |
| 1024 | 1024 |
| 1025 void Builtins::Generate_InterpreterEnterBytecodeAdvance(MacroAssembler* masm) { |
| 1026 // Advance the current bytecode offset stored within the given interpreter |
| 1027 // stack frame. This simulates what all bytecode handlers do upon completion |
| 1028 // of the underlying operation. |
| 1029 __ mov(ebx, Operand(ebp, InterpreterFrameConstants::kBytecodeArrayFromFp)); |
| 1030 __ mov(edx, Operand(ebp, InterpreterFrameConstants::kBytecodeOffsetFromFp)); |
| 1031 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
| 1032 { |
| 1033 FrameScope scope(masm, StackFrame::INTERNAL); |
| 1034 __ Push(kInterpreterAccumulatorRegister); |
| 1035 __ Push(ebx); // First argument is the bytecode array. |
| 1036 __ Push(edx); // Second argument is the bytecode offset. |
| 1037 __ CallRuntime(Runtime::kInterpreterAdvanceBytecodeOffset); |
| 1038 __ Move(edx, eax); // Result is the new bytecode offset. |
| 1039 __ Pop(kInterpreterAccumulatorRegister); |
| 1040 } |
| 1041 __ mov(Operand(ebp, InterpreterFrameConstants::kBytecodeOffsetFromFp), edx); |
| 1042 |
| 1043 Generate_InterpreterEnterBytecode(masm); |
| 1044 } |
| 1045 |
| 1046 void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) { |
| 1047 Generate_InterpreterEnterBytecode(masm); |
| 1048 } |
| 1049 |
| 1025 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { | 1050 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { |
| 1026 // ----------- S t a t e ------------- | 1051 // ----------- S t a t e ------------- |
| 1027 // -- eax : argument count (preserved for callee) | 1052 // -- eax : argument count (preserved for callee) |
| 1028 // -- edx : new target (preserved for callee) | 1053 // -- edx : new target (preserved for callee) |
| 1029 // -- edi : target function (preserved for callee) | 1054 // -- edi : target function (preserved for callee) |
| 1030 // ----------------------------------- | 1055 // ----------------------------------- |
| 1031 // First lookup code, maybe we don't need to compile! | 1056 // First lookup code, maybe we don't need to compile! |
| 1032 Label gotta_call_runtime, gotta_call_runtime_no_stack; | 1057 Label gotta_call_runtime, gotta_call_runtime_no_stack; |
| 1033 Label try_shared; | 1058 Label try_shared; |
| 1034 Label loop_top, loop_bottom; | 1059 Label loop_top, loop_bottom; |
| (...skipping 2070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3105 | 3130 |
| 3106 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) { | 3131 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) { |
| 3107 Generate_OnStackReplacementHelper(masm, true); | 3132 Generate_OnStackReplacementHelper(masm, true); |
| 3108 } | 3133 } |
| 3109 | 3134 |
| 3110 #undef __ | 3135 #undef __ |
| 3111 } // namespace internal | 3136 } // namespace internal |
| 3112 } // namespace v8 | 3137 } // namespace v8 |
| 3113 | 3138 |
| 3114 #endif // V8_TARGET_ARCH_IA32 | 3139 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |