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

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

Issue 1884133002: [Interpreter] Add support for FunctionEntryHook. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Make test stricter Created 4 years, 8 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/arm64/builtins-arm64.cc ('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 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 // The live registers are: 511 // The live registers are:
512 // o edi: the JS function object being called 512 // o edi: the JS function object being called
513 // o edx: the new target 513 // o edx: the new target
514 // o esi: our context 514 // o esi: our context
515 // o ebp: the caller's frame pointer 515 // o ebp: the caller's frame pointer
516 // o esp: stack pointer (pointing to return address) 516 // o esp: stack pointer (pointing to return address)
517 // 517 //
518 // The function builds an interpreter frame. See InterpreterFrameConstants in 518 // The function builds an interpreter frame. See InterpreterFrameConstants in
519 // frames.h for its layout. 519 // frames.h for its layout.
520 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { 520 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
521 ProfileEntryHookStub::MaybeCallEntryHook(masm);
522
521 // Open a frame scope to indicate that there is a frame on the stack. The 523 // Open a frame scope to indicate that there is a frame on the stack. The
522 // MANUAL indicates that the scope shouldn't actually generate code to set up 524 // MANUAL indicates that the scope shouldn't actually generate code to set up
523 // the frame (that is done below). 525 // the frame (that is done below).
524 FrameScope frame_scope(masm, StackFrame::MANUAL); 526 FrameScope frame_scope(masm, StackFrame::MANUAL);
525 __ push(ebp); // Caller's frame pointer. 527 __ push(ebp); // Caller's frame pointer.
526 __ mov(ebp, esp); 528 __ mov(ebp, esp);
527 __ push(esi); // Callee's context. 529 __ push(esi); // Callee's context.
528 __ push(edi); // Callee's JS function. 530 __ push(edi); // Callee's JS function.
529 __ push(edx); // Callee's new target. 531 __ push(edx); // Callee's new target.
530 532
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 __ jmp(&loop_check); 579 __ jmp(&loop_check);
578 __ bind(&loop_header); 580 __ bind(&loop_header);
579 // TODO(rmcilroy): Consider doing more than one push per loop iteration. 581 // TODO(rmcilroy): Consider doing more than one push per loop iteration.
580 __ push(eax); 582 __ push(eax);
581 // Continue loop if not done. 583 // Continue loop if not done.
582 __ bind(&loop_check); 584 __ bind(&loop_check);
583 __ sub(ebx, Immediate(kPointerSize)); 585 __ sub(ebx, Immediate(kPointerSize));
584 __ j(greater_equal, &loop_header); 586 __ j(greater_equal, &loop_header);
585 } 587 }
586 588
587 // TODO(rmcilroy): List of things not currently dealt with here but done in
588 // fullcodegen's prologue:
589 // - Call ProfileEntryHookStub when isolate has a function_entry_hook.
590 // - Code aging of the BytecodeArray object.
591
592 // Load accumulator, register file, bytecode offset, dispatch table into 589 // Load accumulator, register file, bytecode offset, dispatch table into
593 // registers. 590 // registers.
594 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); 591 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex);
595 __ mov(kInterpreterRegisterFileRegister, ebp); 592 __ mov(kInterpreterRegisterFileRegister, ebp);
596 __ add(kInterpreterRegisterFileRegister, 593 __ add(kInterpreterRegisterFileRegister,
597 Immediate(InterpreterFrameConstants::kRegisterFilePointerFromFp)); 594 Immediate(InterpreterFrameConstants::kRegisterFilePointerFromFp));
598 __ mov(kInterpreterBytecodeOffsetRegister, 595 __ mov(kInterpreterBytecodeOffsetRegister,
599 Immediate(BytecodeArray::kHeaderSize - kHeapObjectTag)); 596 Immediate(BytecodeArray::kHeaderSize - kHeapObjectTag));
600 __ mov(ebx, Immediate(ExternalReference::interpreter_dispatch_table_address( 597 __ mov(ebx, Immediate(ExternalReference::interpreter_dispatch_table_address(
601 masm->isolate()))); 598 masm->isolate())));
(...skipping 2268 matching lines...) Expand 10 before | Expand all | Expand 10 after
2870 // And "return" to the OSR entry point of the function. 2867 // And "return" to the OSR entry point of the function.
2871 __ ret(0); 2868 __ ret(0);
2872 } 2869 }
2873 2870
2874 2871
2875 #undef __ 2872 #undef __
2876 } // namespace internal 2873 } // namespace internal
2877 } // namespace v8 2874 } // namespace v8
2878 2875
2879 #endif // V8_TARGET_ARCH_IA32 2876 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/arm64/builtins-arm64.cc ('k') | src/mips/builtins-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698