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

Side by Side Diff: src/x87/builtins-x87.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/x64/builtins-x64.cc ('k') | no next file » | 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_X87 5 #if V8_TARGET_ARCH_X87
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 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 // Open a frame scope to indicate that there is a frame on the stack. The 539 // Open a frame scope to indicate that there is a frame on the stack. The
540 // MANUAL indicates that the scope shouldn't actually generate code to set up 540 // MANUAL indicates that the scope shouldn't actually generate code to set up
541 // the frame (that is done below). 541 // the frame (that is done below).
542 FrameScope frame_scope(masm, StackFrame::MANUAL); 542 FrameScope frame_scope(masm, StackFrame::MANUAL);
543 __ push(ebp); // Caller's frame pointer. 543 __ push(ebp); // Caller's frame pointer.
544 __ mov(ebp, esp); 544 __ mov(ebp, esp);
545 __ push(esi); // Callee's context. 545 __ push(esi); // Callee's context.
546 __ push(edi); // Callee's JS function. 546 __ push(edi); // Callee's JS function.
547 __ push(edx); // Callee's new target. 547 __ push(edx); // Callee's new target.
548 548
549 // Push dispatch table pointer.
550 __ mov(eax, Immediate(ExternalReference::interpreter_dispatch_table_address(
551 masm->isolate())));
552 __ push(eax);
549 // Push zero for bytecode array offset. 553 // Push zero for bytecode array offset.
550 __ push(Immediate(0)); 554 __ push(Immediate(0));
551 555
552 // Get the bytecode array from the function object and load the pointer to the 556 // Get the bytecode array from the function object and load the pointer to the
553 // first entry into edi (InterpreterBytecodeRegister). 557 // first entry into edi (InterpreterBytecodeRegister).
554 __ mov(eax, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); 558 __ mov(eax, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset));
555 __ mov(kInterpreterBytecodeArrayRegister, 559 __ mov(kInterpreterBytecodeArrayRegister,
556 FieldOperand(eax, SharedFunctionInfo::kFunctionDataOffset)); 560 FieldOperand(eax, SharedFunctionInfo::kFunctionDataOffset));
557 561
558 if (FLAG_debug_code) { 562 if (FLAG_debug_code) {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 // - Code aging of the BytecodeArray object. 605 // - Code aging of the BytecodeArray object.
602 606
603 // Load accumulator, register file, bytecode offset, dispatch table into 607 // Load accumulator, register file, bytecode offset, dispatch table into
604 // registers. 608 // registers.
605 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); 609 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex);
606 __ mov(kInterpreterRegisterFileRegister, ebp); 610 __ mov(kInterpreterRegisterFileRegister, ebp);
607 __ add(kInterpreterRegisterFileRegister, 611 __ add(kInterpreterRegisterFileRegister,
608 Immediate(InterpreterFrameConstants::kRegisterFilePointerFromFp)); 612 Immediate(InterpreterFrameConstants::kRegisterFilePointerFromFp));
609 __ mov(kInterpreterBytecodeOffsetRegister, 613 __ mov(kInterpreterBytecodeOffsetRegister,
610 Immediate(BytecodeArray::kHeaderSize - kHeapObjectTag)); 614 Immediate(BytecodeArray::kHeaderSize - kHeapObjectTag));
611 __ mov(ebx, Immediate(ExternalReference::interpreter_dispatch_table_address( 615 __ mov(ebx, Operand(ebp, InterpreterFrameConstants::kDispatchTableFromFp));
612 masm->isolate())));
613 616
614 // Push dispatch table as a stack located parameter to the bytecode handler. 617 // Push dispatch table as a stack located parameter to the bytecode handler.
615 DCHECK_EQ(-1, kInterpreterDispatchTableSpillSlot); 618 DCHECK_EQ(-1, kInterpreterDispatchTableSpillSlot);
616 __ push(ebx); 619 __ push(ebx);
617 620
618 // Dispatch to the first bytecode handler for the function. 621 // Dispatch to the first bytecode handler for the function.
619 __ movzx_b(eax, Operand(kInterpreterBytecodeArrayRegister, 622 __ movzx_b(eax, Operand(kInterpreterBytecodeArrayRegister,
620 kInterpreterBytecodeOffsetRegister, times_1, 0)); 623 kInterpreterBytecodeOffsetRegister, times_1, 0));
621 __ mov(ebx, Operand(ebx, eax, times_pointer_size, 0)); 624 __ mov(ebx, Operand(ebx, eax, times_pointer_size, 0));
622 // Restore undefined_value in accumulator (eax) 625 // Restore undefined_value in accumulator (eax)
(...skipping 2175 matching lines...) Expand 10 before | Expand all | Expand 10 after
2798 2801
2799 __ bind(&ok); 2802 __ bind(&ok);
2800 __ ret(0); 2803 __ ret(0);
2801 } 2804 }
2802 2805
2803 #undef __ 2806 #undef __
2804 } // namespace internal 2807 } // namespace internal
2805 } // namespace v8 2808 } // namespace v8
2806 2809
2807 #endif // V8_TARGET_ARCH_X87 2810 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/x64/builtins-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698