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

Side by Side Diff: src/arm/builtins-arm.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 | « no previous file | src/arm64/builtins-arm64.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_ARM 5 #if V8_TARGET_ARCH_ARM
6 6
7 #include "src/codegen.h" 7 #include "src/codegen.h"
8 #include "src/debug/debug.h" 8 #include "src/debug/debug.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 967 matching lines...) Expand 10 before | Expand all | Expand 10 after
978 // 978 //
979 // The function builds an interpreter frame. See InterpreterFrameConstants in 979 // The function builds an interpreter frame. See InterpreterFrameConstants in
980 // frames.h for its layout. 980 // frames.h for its layout.
981 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { 981 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
982 // Open a frame scope to indicate that there is a frame on the stack. The 982 // Open a frame scope to indicate that there is a frame on the stack. The
983 // MANUAL indicates that the scope shouldn't actually generate code to set up 983 // MANUAL indicates that the scope shouldn't actually generate code to set up
984 // the frame (that is done below). 984 // the frame (that is done below).
985 FrameScope frame_scope(masm, StackFrame::MANUAL); 985 FrameScope frame_scope(masm, StackFrame::MANUAL);
986 __ PushFixedFrame(r1); 986 __ PushFixedFrame(r1);
987 __ add(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); 987 __ add(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp));
988 __ push(r3);
989 988
990 // Push zero for bytecode array offset. 989 // Push new.target, dispatch table pointer and zero for bytecode array offset.
991 __ mov(r0, Operand(0)); 990 __ mov(r0, Operand(0));
992 __ push(r0); 991 __ mov(r2, Operand(ExternalReference::interpreter_dispatch_table_address(
992 masm->isolate())));
993 __ Push(r3, r2, r0);
993 994
994 // Get the bytecode array from the function object and load the pointer to the 995 // Get the bytecode array from the function object and load the pointer to the
995 // first entry into kInterpreterBytecodeRegister. 996 // first entry into kInterpreterBytecodeRegister.
996 __ ldr(r0, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset)); 997 __ ldr(r0, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset));
997 __ ldr(kInterpreterBytecodeArrayRegister, 998 __ ldr(kInterpreterBytecodeArrayRegister,
998 FieldMemOperand(r0, SharedFunctionInfo::kFunctionDataOffset)); 999 FieldMemOperand(r0, SharedFunctionInfo::kFunctionDataOffset));
999 1000
1000 if (FLAG_debug_code) { 1001 if (FLAG_debug_code) {
1001 // Check function data field is actually a BytecodeArray object. 1002 // Check function data field is actually a BytecodeArray object.
1002 __ SmiTst(kInterpreterBytecodeArrayRegister); 1003 __ SmiTst(kInterpreterBytecodeArrayRegister);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
1041 // - Call ProfileEntryHookStub when isolate has a function_entry_hook. 1042 // - Call ProfileEntryHookStub when isolate has a function_entry_hook.
1042 // - Code aging of the BytecodeArray object. 1043 // - Code aging of the BytecodeArray object.
1043 1044
1044 // Load accumulator, register file, bytecode offset, dispatch table into 1045 // Load accumulator, register file, bytecode offset, dispatch table into
1045 // registers. 1046 // registers.
1046 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); 1047 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex);
1047 __ add(kInterpreterRegisterFileRegister, fp, 1048 __ add(kInterpreterRegisterFileRegister, fp,
1048 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp)); 1049 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp));
1049 __ mov(kInterpreterBytecodeOffsetRegister, 1050 __ mov(kInterpreterBytecodeOffsetRegister,
1050 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag)); 1051 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag));
1051 __ mov(kInterpreterDispatchTableRegister, 1052 __ ldr(kInterpreterDispatchTableRegister,
1052 Operand(ExternalReference::interpreter_dispatch_table_address( 1053 MemOperand(fp, InterpreterFrameConstants::kDispatchTableFromFp));
1053 masm->isolate())));
1054 1054
1055 // Dispatch to the first bytecode handler for the function. 1055 // Dispatch to the first bytecode handler for the function.
1056 __ ldrb(r1, MemOperand(kInterpreterBytecodeArrayRegister, 1056 __ ldrb(r1, MemOperand(kInterpreterBytecodeArrayRegister,
1057 kInterpreterBytecodeOffsetRegister)); 1057 kInterpreterBytecodeOffsetRegister));
1058 __ ldr(ip, MemOperand(kInterpreterDispatchTableRegister, r1, LSL, 1058 __ ldr(ip, MemOperand(kInterpreterDispatchTableRegister, r1, LSL,
1059 kPointerSizeLog2)); 1059 kPointerSizeLog2));
1060 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging 1060 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging
1061 // and header removal. 1061 // and header removal.
1062 __ add(ip, ip, Operand(Code::kHeaderSize - kHeapObjectTag)); 1062 __ add(ip, ip, Operand(Code::kHeaderSize - kHeapObjectTag));
1063 __ Call(ip); 1063 __ Call(ip);
(...skipping 1618 matching lines...) Expand 10 before | Expand all | Expand 10 after
2682 } 2682 }
2683 } 2683 }
2684 2684
2685 2685
2686 #undef __ 2686 #undef __
2687 2687
2688 } // namespace internal 2688 } // namespace internal
2689 } // namespace v8 2689 } // namespace v8
2690 2690
2691 #endif // V8_TARGET_ARCH_ARM 2691 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm64/builtins-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698