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

Side by Side Diff: src/ia32/builtins-ia32.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/heap/heap.cc ('k') | src/interpreter/interpreter.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 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 // - Code aging of the BytecodeArray object. 601 // - Code aging of the BytecodeArray object.
602 602
603 // Load accumulator, register file, bytecode offset, dispatch table into 603 // Load accumulator, register file, bytecode offset, dispatch table into
604 // registers. 604 // registers.
605 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); 605 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex);
606 __ mov(kInterpreterRegisterFileRegister, ebp); 606 __ mov(kInterpreterRegisterFileRegister, ebp);
607 __ add(kInterpreterRegisterFileRegister, 607 __ add(kInterpreterRegisterFileRegister,
608 Immediate(InterpreterFrameConstants::kRegisterFilePointerFromFp)); 608 Immediate(InterpreterFrameConstants::kRegisterFilePointerFromFp));
609 __ mov(kInterpreterBytecodeOffsetRegister, 609 __ mov(kInterpreterBytecodeOffsetRegister,
610 Immediate(BytecodeArray::kHeaderSize - kHeapObjectTag)); 610 Immediate(BytecodeArray::kHeaderSize - kHeapObjectTag));
611 // Since the dispatch table root might be set after builtins are generated, 611 __ mov(ebx, Immediate(ExternalReference::interpreter_dispatch_table_address(
612 // load directly from the roots table. 612 masm->isolate())));
613 __ LoadRoot(ebx, Heap::kInterpreterTableRootIndex);
614 __ add(ebx, Immediate(FixedArray::kHeaderSize - kHeapObjectTag));
615 613
616 // Push dispatch table as a stack located parameter to the bytecode handler. 614 // Push dispatch table as a stack located parameter to the bytecode handler.
617 DCHECK_EQ(-1, kInterpreterDispatchTableSpillSlot); 615 DCHECK_EQ(-1, kInterpreterDispatchTableSpillSlot);
618 __ push(ebx); 616 __ push(ebx);
619 617
620 // Dispatch to the first bytecode handler for the function. 618 // Dispatch to the first bytecode handler for the function.
621 __ movzx_b(eax, Operand(kInterpreterBytecodeArrayRegister, 619 __ movzx_b(eax, Operand(kInterpreterBytecodeArrayRegister,
622 kInterpreterBytecodeOffsetRegister, times_1, 0)); 620 kInterpreterBytecodeOffsetRegister, times_1, 0));
623 __ mov(ebx, Operand(ebx, eax, times_pointer_size, 0)); 621 __ mov(ebx, Operand(ebx, eax, times_pointer_size, 0));
624 // Restore undefined_value in accumulator (eax) 622 // Restore undefined_value in accumulator (eax)
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 } 764 }
767 765
768 // Get the target bytecode offset from the frame. 766 // Get the target bytecode offset from the frame.
769 __ mov( 767 __ mov(
770 kInterpreterBytecodeOffsetRegister, 768 kInterpreterBytecodeOffsetRegister,
771 Operand(kInterpreterRegisterFileRegister, 769 Operand(kInterpreterRegisterFileRegister,
772 InterpreterFrameConstants::kBytecodeOffsetFromRegisterPointer)); 770 InterpreterFrameConstants::kBytecodeOffsetFromRegisterPointer));
773 __ SmiUntag(kInterpreterBytecodeOffsetRegister); 771 __ SmiUntag(kInterpreterBytecodeOffsetRegister);
774 772
775 // Push dispatch table as a stack located parameter to the bytecode handler. 773 // Push dispatch table as a stack located parameter to the bytecode handler.
776 __ LoadRoot(ebx, Heap::kInterpreterTableRootIndex); 774 __ mov(ebx, Immediate(ExternalReference::interpreter_dispatch_table_address(
777 __ add(ebx, Immediate(FixedArray::kHeaderSize - kHeapObjectTag)); 775 masm->isolate())));
778 DCHECK_EQ(-1, kInterpreterDispatchTableSpillSlot); 776 DCHECK_EQ(-1, kInterpreterDispatchTableSpillSlot);
779 __ Pop(esi); 777 __ Pop(esi);
780 __ Push(ebx); 778 __ Push(ebx);
781 __ Push(esi); 779 __ Push(esi);
782 780
783 // Dispatch to the target bytecode. 781 // Dispatch to the target bytecode.
784 __ movzx_b(esi, Operand(kInterpreterBytecodeArrayRegister, 782 __ movzx_b(esi, Operand(kInterpreterBytecodeArrayRegister,
785 kInterpreterBytecodeOffsetRegister, times_1, 0)); 783 kInterpreterBytecodeOffsetRegister, times_1, 0));
786 __ mov(ebx, Operand(ebx, esi, times_pointer_size, 0)); 784 __ mov(ebx, Operand(ebx, esi, times_pointer_size, 0));
787 785
(...skipping 1989 matching lines...) Expand 10 before | Expand all | Expand 10 after
2777 2775
2778 __ bind(&ok); 2776 __ bind(&ok);
2779 __ ret(0); 2777 __ ret(0);
2780 } 2778 }
2781 2779
2782 #undef __ 2780 #undef __
2783 } // namespace internal 2781 } // namespace internal
2784 } // namespace v8 2782 } // namespace v8
2785 2783
2786 #endif // V8_TARGET_ARCH_IA32 2784 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/heap/heap.cc ('k') | src/interpreter/interpreter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698