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

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

Issue 1671813003: [interpreter] move the dispatch table off heap. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix verify heap 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 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 // - Code aging of the BytecodeArray object. 602 // - Code aging of the BytecodeArray object.
603 603
604 // Load accumulator, register file, bytecode offset, dispatch table into 604 // Load accumulator, register file, bytecode offset, dispatch table into
605 // registers. 605 // registers.
606 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); 606 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex);
607 __ mov(kInterpreterRegisterFileRegister, ebp); 607 __ mov(kInterpreterRegisterFileRegister, ebp);
608 __ add(kInterpreterRegisterFileRegister, 608 __ add(kInterpreterRegisterFileRegister,
609 Immediate(InterpreterFrameConstants::kRegisterFilePointerFromFp)); 609 Immediate(InterpreterFrameConstants::kRegisterFilePointerFromFp));
610 __ mov(kInterpreterBytecodeOffsetRegister, 610 __ mov(kInterpreterBytecodeOffsetRegister,
611 Immediate(BytecodeArray::kHeaderSize - kHeapObjectTag)); 611 Immediate(BytecodeArray::kHeaderSize - kHeapObjectTag));
612 // Since the dispatch table root might be set after builtins are generated, 612 __ mov(ebx, Immediate(ExternalReference::interpreter_dispatch_table_address(
613 // load directly from the roots table. 613 masm->isolate())));
614 __ LoadRoot(ebx, Heap::kInterpreterTableRootIndex);
615 __ add(ebx, Immediate(FixedArray::kHeaderSize - kHeapObjectTag));
616 614
617 // Push dispatch table as a stack located parameter to the bytecode handler. 615 // Push dispatch table as a stack located parameter to the bytecode handler.
618 DCHECK_EQ(-1, kInterpreterDispatchTableSpillSlot); 616 DCHECK_EQ(-1, kInterpreterDispatchTableSpillSlot);
619 __ push(ebx); 617 __ push(ebx);
620 618
621 // Dispatch to the first bytecode handler for the function. 619 // Dispatch to the first bytecode handler for the function.
622 __ movzx_b(eax, Operand(kInterpreterBytecodeArrayRegister, 620 __ movzx_b(eax, Operand(kInterpreterBytecodeArrayRegister,
623 kInterpreterBytecodeOffsetRegister, times_1, 0)); 621 kInterpreterBytecodeOffsetRegister, times_1, 0));
624 __ mov(ebx, Operand(ebx, eax, times_pointer_size, 0)); 622 __ mov(ebx, Operand(ebx, eax, times_pointer_size, 0));
625 // Restore undefined_value in accumulator (eax) 623 // Restore undefined_value in accumulator (eax)
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 } 765 }
768 766
769 // Get the target bytecode offset from the frame. 767 // Get the target bytecode offset from the frame.
770 __ mov( 768 __ mov(
771 kInterpreterBytecodeOffsetRegister, 769 kInterpreterBytecodeOffsetRegister,
772 Operand(kInterpreterRegisterFileRegister, 770 Operand(kInterpreterRegisterFileRegister,
773 InterpreterFrameConstants::kBytecodeOffsetFromRegisterPointer)); 771 InterpreterFrameConstants::kBytecodeOffsetFromRegisterPointer));
774 __ SmiUntag(kInterpreterBytecodeOffsetRegister); 772 __ SmiUntag(kInterpreterBytecodeOffsetRegister);
775 773
776 // Push dispatch table as a stack located parameter to the bytecode handler. 774 // Push dispatch table as a stack located parameter to the bytecode handler.
777 __ LoadRoot(ebx, Heap::kInterpreterTableRootIndex); 775 __ mov(ebx, Immediate(ExternalReference::interpreter_dispatch_table_address(
778 __ add(ebx, Immediate(FixedArray::kHeaderSize - kHeapObjectTag)); 776 masm->isolate())));
779 DCHECK_EQ(-1, kInterpreterDispatchTableSpillSlot); 777 DCHECK_EQ(-1, kInterpreterDispatchTableSpillSlot);
780 __ Pop(esi); 778 __ Pop(esi);
781 __ Push(ebx); 779 __ Push(ebx);
782 __ Push(esi); 780 __ Push(esi);
783 781
784 // Dispatch to the target bytecode. 782 // Dispatch to the target bytecode.
785 __ movzx_b(esi, Operand(kInterpreterBytecodeArrayRegister, 783 __ movzx_b(esi, Operand(kInterpreterBytecodeArrayRegister,
786 kInterpreterBytecodeOffsetRegister, times_1, 0)); 784 kInterpreterBytecodeOffsetRegister, times_1, 0));
787 __ mov(ebx, Operand(ebx, esi, times_pointer_size, 0)); 785 __ mov(ebx, Operand(ebx, esi, times_pointer_size, 0));
788 786
(...skipping 2014 matching lines...) Expand 10 before | Expand all | Expand 10 after
2803 2801
2804 __ bind(&ok); 2802 __ bind(&ok);
2805 __ ret(0); 2803 __ ret(0);
2806 } 2804 }
2807 2805
2808 #undef __ 2806 #undef __
2809 } // namespace internal 2807 } // namespace internal
2810 } // namespace v8 2808 } // namespace v8
2811 2809
2812 #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