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

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

Issue 1528913003: [Interpreter] Add basic deoptimization support from TurboFan to Ignition. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@int_deopt_1
Patch Set: Add MIPS port and fix comment Created 5 years 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/arm/builtins-arm.cc ('k') | src/builtins.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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_ARM64 5 #if V8_TARGET_ARCH_ARM64
6 6
7 #include "src/arm64/frames-arm64.h" 7 #include "src/arm64/frames-arm64.h"
8 #include "src/codegen.h" 8 #include "src/codegen.h"
9 #include "src/debug/debug.h" 9 #include "src/debug/debug.h"
10 #include "src/deoptimizer.h" 10 #include "src/deoptimizer.h"
(...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after
898 __ LeaveFrame(StackFrame::JAVA_SCRIPT); 898 __ LeaveFrame(StackFrame::JAVA_SCRIPT);
899 899
900 // Drop receiver + arguments and return. 900 // Drop receiver + arguments and return.
901 __ Ldr(w1, FieldMemOperand(kInterpreterBytecodeArrayRegister, 901 __ Ldr(w1, FieldMemOperand(kInterpreterBytecodeArrayRegister,
902 BytecodeArray::kParameterSizeOffset)); 902 BytecodeArray::kParameterSizeOffset));
903 __ Drop(x1, 1); 903 __ Drop(x1, 1);
904 __ Ret(); 904 __ Ret();
905 } 905 }
906 906
907 907
908 static void Generate_InterpreterNotifyDeoptimizedHelper(
909 MacroAssembler* masm, Deoptimizer::BailoutType type) {
910 // Enter an internal frame.
911 {
912 FrameScope scope(masm, StackFrame::INTERNAL);
913 __ Push(kInterpreterAccumulatorRegister); // Save accumulator register.
914
915 // Pass the deoptimization type to the runtime system.
916 __ Mov(x1, Operand(Smi::FromInt(static_cast<int>(type))));
917 __ Push(x1);
918 __ CallRuntime(Runtime::kNotifyDeoptimized, 1);
919
920 __ Pop(kInterpreterAccumulatorRegister); // Restore accumulator register.
921 // Tear down internal frame.
922 }
923
924 // Drop state (we don't use these for interpreter deopts) and push PC at top
925 // of stack (to simulate initial call to bytecode handler in interpreter entry
926 // trampoline).
927 __ Pop(x1);
928 __ Drop(1);
929 __ Push(x1);
930
931 // Initialize register file register and dispatch table register.
932 __ Add(kInterpreterRegisterFileRegister, fp,
933 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp));
934 __ LoadRoot(kInterpreterDispatchTableRegister,
935 Heap::kInterpreterTableRootIndex);
936 __ Add(kInterpreterDispatchTableRegister, kInterpreterDispatchTableRegister,
937 Operand(FixedArray::kHeaderSize - kHeapObjectTag));
938
939
940 // Get the context from the frame.
941 // TODO(rmcilroy): Update interpreter frame to expect current context at the
942 // context slot instead of the function context.
943 __ Ldr(kContextRegister,
944 MemOperand(kInterpreterRegisterFileRegister,
945 InterpreterFrameConstants::kContextFromRegisterPointer));
946
947 // Get the bytecode array pointer from the frame.
948 __ Ldr(x1,
949 MemOperand(kInterpreterRegisterFileRegister,
950 InterpreterFrameConstants::kFunctionFromRegisterPointer));
951 __ Ldr(x1, FieldMemOperand(x1, JSFunction::kSharedFunctionInfoOffset));
952 __ Ldr(kInterpreterBytecodeArrayRegister,
953 FieldMemOperand(x1, SharedFunctionInfo::kFunctionDataOffset));
954
955 if (FLAG_debug_code) {
956 // Check function data field is actually a BytecodeArray object.
957 __ AssertNotSmi(kInterpreterBytecodeArrayRegister,
958 kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry);
959 __ CompareObjectType(kInterpreterBytecodeArrayRegister, x1, x1,
960 BYTECODE_ARRAY_TYPE);
961 __ Assert(eq, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry);
962 }
963
964 // Get the target bytecode offset from the frame.
965 __ Ldr(kInterpreterBytecodeOffsetRegister,
966 MemOperand(
967 kInterpreterRegisterFileRegister,
968 InterpreterFrameConstants::kBytecodeOffsetFromRegisterPointer));
969 __ SmiUntag(kInterpreterBytecodeOffsetRegister);
970
971 // Dispatch to the target bytecode.
972 __ Ldrb(x1, MemOperand(kInterpreterBytecodeArrayRegister,
973 kInterpreterBytecodeOffsetRegister));
974 __ Mov(x1, Operand(x1, LSL, kPointerSizeLog2));
975 __ Ldr(ip0, MemOperand(kInterpreterDispatchTableRegister, x1));
976 __ Add(ip0, ip0, Operand(Code::kHeaderSize - kHeapObjectTag));
977 __ Jump(ip0);
978 }
979
980
981 void Builtins::Generate_InterpreterNotifyDeoptimized(MacroAssembler* masm) {
982 Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::EAGER);
983 }
984
985
986 void Builtins::Generate_InterpreterNotifySoftDeoptimized(MacroAssembler* masm) {
987 Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::SOFT);
988 }
989
990
991 void Builtins::Generate_InterpreterNotifyLazyDeoptimized(MacroAssembler* masm) {
992 Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::LAZY);
993 }
994
995
908 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { 996 void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
909 CallRuntimePassFunction(masm, Runtime::kCompileLazy); 997 CallRuntimePassFunction(masm, Runtime::kCompileLazy);
910 GenerateTailCallToReturnedCode(masm); 998 GenerateTailCallToReturnedCode(masm);
911 } 999 }
912 1000
913 1001
914 void Builtins::Generate_CompileOptimized(MacroAssembler* masm) { 1002 void Builtins::Generate_CompileOptimized(MacroAssembler* masm) {
915 CallRuntimePassFunction(masm, Runtime::kCompileOptimized_NotConcurrent); 1003 CallRuntimePassFunction(masm, Runtime::kCompileOptimized_NotConcurrent);
916 GenerateTailCallToReturnedCode(masm); 1004 GenerateTailCallToReturnedCode(masm);
917 } 1005 }
(...skipping 1247 matching lines...) Expand 10 before | Expand all | Expand 10 after
2165 } 2253 }
2166 } 2254 }
2167 2255
2168 2256
2169 #undef __ 2257 #undef __
2170 2258
2171 } // namespace internal 2259 } // namespace internal
2172 } // namespace v8 2260 } // namespace v8
2173 2261
2174 #endif // V8_TARGET_ARCH_ARM 2262 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/builtins-arm.cc ('k') | src/builtins.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698