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

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: Update for off-heap dispatch table and 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') | src/frames.h » ('J')
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 969 matching lines...) Expand 10 before | Expand all | Expand 10 after
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); 988 __ push(r3);
989 989
990 // Push dispatch table pointer.
991 __ mov(r0, Operand(ExternalReference::interpreter_dispatch_table_address(
992 masm->isolate())));
993 __ push(r0);
990 // Push zero for bytecode array offset. 994 // Push zero for bytecode array offset.
991 __ mov(r0, Operand(0)); 995 __ mov(r0, Operand(0));
992 __ push(r0); 996 __ push(r0);
993 997
994 // Get the bytecode array from the function object and load the pointer to the 998 // Get the bytecode array from the function object and load the pointer to the
995 // first entry into kInterpreterBytecodeRegister. 999 // first entry into kInterpreterBytecodeRegister.
996 __ ldr(r0, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset)); 1000 __ ldr(r0, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset));
997 __ ldr(kInterpreterBytecodeArrayRegister, 1001 __ ldr(kInterpreterBytecodeArrayRegister,
998 FieldMemOperand(r0, SharedFunctionInfo::kFunctionDataOffset)); 1002 FieldMemOperand(r0, SharedFunctionInfo::kFunctionDataOffset));
999 1003
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
1041 // - Call ProfileEntryHookStub when isolate has a function_entry_hook. 1045 // - Call ProfileEntryHookStub when isolate has a function_entry_hook.
1042 // - Code aging of the BytecodeArray object. 1046 // - Code aging of the BytecodeArray object.
1043 1047
1044 // Load accumulator, register file, bytecode offset, dispatch table into 1048 // Load accumulator, register file, bytecode offset, dispatch table into
1045 // registers. 1049 // registers.
1046 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); 1050 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex);
1047 __ add(kInterpreterRegisterFileRegister, fp, 1051 __ add(kInterpreterRegisterFileRegister, fp,
1048 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp)); 1052 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp));
1049 __ mov(kInterpreterBytecodeOffsetRegister, 1053 __ mov(kInterpreterBytecodeOffsetRegister,
1050 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag)); 1054 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag));
1051 __ mov(kInterpreterDispatchTableRegister, 1055 __ ldr(kInterpreterDispatchTableRegister,
1052 Operand(ExternalReference::interpreter_dispatch_table_address( 1056 MemOperand(fp, InterpreterFrameConstants::kDispatchTableFromFp));
1053 masm->isolate())));
1054 1057
1055 // Dispatch to the first bytecode handler for the function. 1058 // Dispatch to the first bytecode handler for the function.
1056 __ ldrb(r1, MemOperand(kInterpreterBytecodeArrayRegister, 1059 __ ldrb(r1, MemOperand(kInterpreterBytecodeArrayRegister,
1057 kInterpreterBytecodeOffsetRegister)); 1060 kInterpreterBytecodeOffsetRegister));
1058 __ ldr(ip, MemOperand(kInterpreterDispatchTableRegister, r1, LSL, 1061 __ ldr(ip, MemOperand(kInterpreterDispatchTableRegister, r1, LSL,
1059 kPointerSizeLog2)); 1062 kPointerSizeLog2));
1060 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging 1063 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging
1061 // and header removal. 1064 // and header removal.
1062 __ add(ip, ip, Operand(Code::kHeaderSize - kHeapObjectTag)); 1065 __ add(ip, ip, Operand(Code::kHeaderSize - kHeapObjectTag));
1063 __ Call(ip); 1066 __ Call(ip);
(...skipping 1618 matching lines...) Expand 10 before | Expand all | Expand 10 after
2682 } 2685 }
2683 } 2686 }
2684 2687
2685 2688
2686 #undef __ 2689 #undef __
2687 2690
2688 } // namespace internal 2691 } // namespace internal
2689 } // namespace v8 2692 } // namespace v8
2690 2693
2691 #endif // V8_TARGET_ARCH_ARM 2694 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm64/builtins-arm64.cc » ('j') | src/frames.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698