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

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

Issue 1642063002: [interpreter] Add a safety-net for interpreter entry. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comment. Created 4 years, 10 months 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
« no previous file with comments | « src/bailout-reason.h ('k') | src/mips/builtins-mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 // stack left to right. The actual argument count matches the formal parameter 525 // stack left to right. The actual argument count matches the formal parameter
526 // count expected by the function. 526 // count expected by the function.
527 // 527 //
528 // The live registers are: 528 // The live registers are:
529 // o edi: the JS function object being called 529 // o edi: the JS function object being called
530 // o edx: the new target 530 // o edx: the new target
531 // o esi: our context 531 // o esi: our context
532 // o ebp: the caller's frame pointer 532 // o ebp: the caller's frame pointer
533 // o esp: stack pointer (pointing to return address) 533 // o esp: stack pointer (pointing to return address)
534 // 534 //
535 // The function builds a JS frame. Please see JavaScriptFrameConstants in 535 // The function builds an interpreter frame. See InterpreterFrameConstants in
536 // frames-ia32.h for its layout. 536 // frames.h for its layout.
537 // TODO(rmcilroy): We will need to include the current bytecode pointer in the
538 // frame.
539 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { 537 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
540 // Open a frame scope to indicate that there is a frame on the stack. The 538 // Open a frame scope to indicate that there is a frame on the stack. The
541 // MANUAL indicates that the scope shouldn't actually generate code to set up 539 // MANUAL indicates that the scope shouldn't actually generate code to set up
542 // the frame (that is done below). 540 // the frame (that is done below).
543 FrameScope frame_scope(masm, StackFrame::MANUAL); 541 FrameScope frame_scope(masm, StackFrame::MANUAL);
544 __ push(ebp); // Caller's frame pointer. 542 __ push(ebp); // Caller's frame pointer.
545 __ mov(ebp, esp); 543 __ mov(ebp, esp);
546 __ push(esi); // Callee's context. 544 __ push(esi); // Callee's context.
547 __ push(edi); // Callee's JS function. 545 __ push(edi); // Callee's JS function.
548 __ push(edx); // Callee's new target. 546 __ push(edx); // Callee's new target.
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 kInterpreterBytecodeOffsetRegister, times_1, 0)); 635 kInterpreterBytecodeOffsetRegister, times_1, 0));
638 __ mov(ebx, Operand(ebx, eax, times_pointer_size, 0)); 636 __ mov(ebx, Operand(ebx, eax, times_pointer_size, 0));
639 // Restore undefined_value in accumulator (eax) 637 // Restore undefined_value in accumulator (eax)
640 // TODO(rmcilroy): Remove this once we move the dispatch table back into a 638 // TODO(rmcilroy): Remove this once we move the dispatch table back into a
641 // register. 639 // register.
642 __ mov(eax, Immediate(masm->isolate()->factory()->undefined_value())); 640 __ mov(eax, Immediate(masm->isolate()->factory()->undefined_value()));
643 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging 641 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging
644 // and header removal. 642 // and header removal.
645 __ add(ebx, Immediate(Code::kHeaderSize - kHeapObjectTag)); 643 __ add(ebx, Immediate(Code::kHeaderSize - kHeapObjectTag));
646 __ call(ebx); 644 __ call(ebx);
647 __ nop(); // Ensure that return address still counts as interpreter entry 645
648 // trampoline. 646 // Even though the first bytecode handler was called, we will never return.
647 __ Abort(kUnexpectedReturnFromBytecodeHandler);
649 } 648 }
650 649
651 650
652 void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) { 651 void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) {
653 // TODO(rmcilroy): List of things not currently dealt with here but done in 652 // TODO(rmcilroy): List of things not currently dealt with here but done in
654 // fullcodegen's EmitReturnSequence. 653 // fullcodegen's EmitReturnSequence.
655 // - Supporting FLAG_trace for Runtime::TraceExit. 654 // - Supporting FLAG_trace for Runtime::TraceExit.
656 // - Support profiler (specifically decrementing profiling_counter 655 // - Support profiler (specifically decrementing profiling_counter
657 // appropriately and calling out to HandleInterrupts if necessary). 656 // appropriately and calling out to HandleInterrupts if necessary).
658 657
(...skipping 2016 matching lines...) Expand 10 before | Expand all | Expand 10 after
2675 2674
2676 __ bind(&ok); 2675 __ bind(&ok);
2677 __ ret(0); 2676 __ ret(0);
2678 } 2677 }
2679 2678
2680 #undef __ 2679 #undef __
2681 } // namespace internal 2680 } // namespace internal
2682 } // namespace v8 2681 } // namespace v8
2683 2682
2684 #endif // V8_TARGET_ARCH_IA32 2683 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/bailout-reason.h ('k') | src/mips/builtins-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698