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

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

Issue 1684073002: [Interpreter] Save and restore dispatch table pointer during calls. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@int_assm
Patch Set: Address review comments 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/frames.cc ('k') | src/interpreter/interpreter-assembler.h » ('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 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 // 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
539 // 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
540 // the frame (that is done below). 540 // the frame (that is done below).
541 FrameScope frame_scope(masm, StackFrame::MANUAL); 541 FrameScope frame_scope(masm, StackFrame::MANUAL);
542 __ push(ebp); // Caller's frame pointer. 542 __ push(ebp); // Caller's frame pointer.
543 __ mov(ebp, esp); 543 __ mov(ebp, esp);
544 __ push(esi); // Callee's context. 544 __ push(esi); // Callee's context.
545 __ push(edi); // Callee's JS function. 545 __ push(edi); // Callee's JS function.
546 __ push(edx); // Callee's new target. 546 __ push(edx); // Callee's new target.
547 547
548 // Push dispatch table pointer.
549 __ mov(eax, Immediate(ExternalReference::interpreter_dispatch_table_address(
550 masm->isolate())));
551 __ push(eax);
548 // Push zero for bytecode array offset. 552 // Push zero for bytecode array offset.
549 __ push(Immediate(0)); 553 __ push(Immediate(0));
550 554
551 // Get the bytecode array from the function object and load the pointer to the 555 // Get the bytecode array from the function object and load the pointer to the
552 // first entry into edi (InterpreterBytecodeRegister). 556 // first entry into edi (InterpreterBytecodeRegister).
553 __ mov(eax, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); 557 __ mov(eax, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset));
554 __ mov(kInterpreterBytecodeArrayRegister, 558 __ mov(kInterpreterBytecodeArrayRegister,
555 FieldOperand(eax, SharedFunctionInfo::kFunctionDataOffset)); 559 FieldOperand(eax, SharedFunctionInfo::kFunctionDataOffset));
556 560
557 if (FLAG_debug_code) { 561 if (FLAG_debug_code) {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 // - Code aging of the BytecodeArray object. 604 // - Code aging of the BytecodeArray object.
601 605
602 // Load accumulator, register file, bytecode offset, dispatch table into 606 // Load accumulator, register file, bytecode offset, dispatch table into
603 // registers. 607 // registers.
604 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); 608 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex);
605 __ mov(kInterpreterRegisterFileRegister, ebp); 609 __ mov(kInterpreterRegisterFileRegister, ebp);
606 __ add(kInterpreterRegisterFileRegister, 610 __ add(kInterpreterRegisterFileRegister,
607 Immediate(InterpreterFrameConstants::kRegisterFilePointerFromFp)); 611 Immediate(InterpreterFrameConstants::kRegisterFilePointerFromFp));
608 __ mov(kInterpreterBytecodeOffsetRegister, 612 __ mov(kInterpreterBytecodeOffsetRegister,
609 Immediate(BytecodeArray::kHeaderSize - kHeapObjectTag)); 613 Immediate(BytecodeArray::kHeaderSize - kHeapObjectTag));
610 __ mov(ebx, Immediate(ExternalReference::interpreter_dispatch_table_address( 614 __ mov(ebx, Operand(ebp, InterpreterFrameConstants::kDispatchTableFromFp));
611 masm->isolate())));
612 615
613 // Push dispatch table as a stack located parameter to the bytecode handler. 616 // Push dispatch table as a stack located parameter to the bytecode handler.
614 DCHECK_EQ(-1, kInterpreterDispatchTableSpillSlot); 617 DCHECK_EQ(-1, kInterpreterDispatchTableSpillSlot);
615 __ push(ebx); 618 __ push(ebx);
616 619
617 // Dispatch to the first bytecode handler for the function. 620 // Dispatch to the first bytecode handler for the function.
618 __ movzx_b(eax, Operand(kInterpreterBytecodeArrayRegister, 621 __ movzx_b(eax, Operand(kInterpreterBytecodeArrayRegister,
619 kInterpreterBytecodeOffsetRegister, times_1, 0)); 622 kInterpreterBytecodeOffsetRegister, times_1, 0));
620 __ mov(ebx, Operand(ebx, eax, times_pointer_size, 0)); 623 __ mov(ebx, Operand(ebx, eax, times_pointer_size, 0));
621 // Restore undefined_value in accumulator (eax) 624 // Restore undefined_value in accumulator (eax)
(...skipping 2150 matching lines...) Expand 10 before | Expand all | Expand 10 after
2772 2775
2773 __ bind(&ok); 2776 __ bind(&ok);
2774 __ ret(0); 2777 __ ret(0);
2775 } 2778 }
2776 2779
2777 #undef __ 2780 #undef __
2778 } // namespace internal 2781 } // namespace internal
2779 } // namespace v8 2782 } // namespace v8
2780 2783
2781 #endif // V8_TARGET_ARCH_IA32 2784 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/frames.cc ('k') | src/interpreter/interpreter-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698