Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Side by Side Diff: src/builtins/ia32/builtins-ia32.cc

Issue 2487173002: [turbofan] Advance bytecode offset after lazy deopt. (Closed)
Patch Set: Rebased. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 __ pushad();
1030 { // NOLINT
1031 FrameScope scope(masm, StackFrame::MANUAL);
1032 __ PrepareCallCFunction(2, ebx);
1033 __ mov(ebx, Operand(ebp, InterpreterFrameConstants::kBytecodeArrayFromFp));
1034 __ mov(eax, Operand(ebp, InterpreterFrameConstants::kBytecodeOffsetFromFp));
1035 __ SmiUntag(eax);
1036 __ mov(Operand(esp, 1 * kPointerSize), eax);
1037 __ mov(Operand(esp, 0 * kPointerSize), ebx);
1038 __ CallCFunction(
1039 ExternalReference::interpreter_advance_bytecode_offset(masm->isolate()),
1040 2);
1041 __ SmiTag(eax);
1042 __ mov(Operand(ebp, InterpreterFrameConstants::kBytecodeOffsetFromFp), eax);
1043 }
1044 __ popad();
1045
1046 Generate_InterpreterEnterBytecode(masm);
1047 }
1048
1049 void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) {
1050 Generate_InterpreterEnterBytecode(masm);
1051 }
1052
1025 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { 1053 void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
1026 // ----------- S t a t e ------------- 1054 // ----------- S t a t e -------------
1027 // -- eax : argument count (preserved for callee) 1055 // -- eax : argument count (preserved for callee)
1028 // -- edx : new target (preserved for callee) 1056 // -- edx : new target (preserved for callee)
1029 // -- edi : target function (preserved for callee) 1057 // -- edi : target function (preserved for callee)
1030 // ----------------------------------- 1058 // -----------------------------------
1031 // First lookup code, maybe we don't need to compile! 1059 // First lookup code, maybe we don't need to compile!
1032 Label gotta_call_runtime, gotta_call_runtime_no_stack; 1060 Label gotta_call_runtime, gotta_call_runtime_no_stack;
1033 Label try_shared; 1061 Label try_shared;
1034 Label loop_top, loop_bottom; 1062 Label loop_top, loop_bottom;
(...skipping 2070 matching lines...) Expand 10 before | Expand all | Expand 10 after
3105 3133
3106 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) { 3134 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) {
3107 Generate_OnStackReplacementHelper(masm, true); 3135 Generate_OnStackReplacementHelper(masm, true);
3108 } 3136 }
3109 3137
3110 #undef __ 3138 #undef __
3111 } // namespace internal 3139 } // namespace internal
3112 } // namespace v8 3140 } // namespace v8
3113 3141
3114 #endif // V8_TARGET_ARCH_IA32 3142 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698