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

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

Issue 2257143002: [interpreter] Fix self-healing with preserved bytecode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Added ports and test. Created 4 years, 4 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/builtins/mips/builtins-mips.cc ('k') | src/builtins/x64/builtins-x64.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_MIPS64 5 #if V8_TARGET_ARCH_MIPS64
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 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after
1030 Label load_debug_bytecode_array, bytecode_array_loaded; 1030 Label load_debug_bytecode_array, bytecode_array_loaded;
1031 Register debug_info = kInterpreterBytecodeArrayRegister; 1031 Register debug_info = kInterpreterBytecodeArrayRegister;
1032 DCHECK(!debug_info.is(a0)); 1032 DCHECK(!debug_info.is(a0));
1033 __ ld(debug_info, FieldMemOperand(a0, SharedFunctionInfo::kDebugInfoOffset)); 1033 __ ld(debug_info, FieldMemOperand(a0, SharedFunctionInfo::kDebugInfoOffset));
1034 __ Branch(&load_debug_bytecode_array, ne, debug_info, 1034 __ Branch(&load_debug_bytecode_array, ne, debug_info,
1035 Operand(DebugInfo::uninitialized())); 1035 Operand(DebugInfo::uninitialized()));
1036 __ ld(kInterpreterBytecodeArrayRegister, 1036 __ ld(kInterpreterBytecodeArrayRegister,
1037 FieldMemOperand(a0, SharedFunctionInfo::kFunctionDataOffset)); 1037 FieldMemOperand(a0, SharedFunctionInfo::kFunctionDataOffset));
1038 __ bind(&bytecode_array_loaded); 1038 __ bind(&bytecode_array_loaded);
1039 1039
1040 // Check whether we should continue to use the interpreter.
1041 Label switch_to_different_code_kind;
1042 __ ld(a0, FieldMemOperand(a0, SharedFunctionInfo::kCodeOffset));
1043 __ Branch(&switch_to_different_code_kind, ne, a0,
1044 Operand(masm->CodeObject())); // Self-reference to this code.
1045
1040 // Check function data field is actually a BytecodeArray object. 1046 // Check function data field is actually a BytecodeArray object.
1041 Label bytecode_array_not_present;
1042 __ JumpIfRoot(kInterpreterBytecodeArrayRegister,
1043 Heap::kUndefinedValueRootIndex, &bytecode_array_not_present);
1044 if (FLAG_debug_code) { 1047 if (FLAG_debug_code) {
1045 __ SmiTst(kInterpreterBytecodeArrayRegister, a4); 1048 __ SmiTst(kInterpreterBytecodeArrayRegister, a4);
1046 __ Assert(ne, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry, a4, 1049 __ Assert(ne, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry, a4,
1047 Operand(zero_reg)); 1050 Operand(zero_reg));
1048 __ GetObjectType(kInterpreterBytecodeArrayRegister, a4, a4); 1051 __ GetObjectType(kInterpreterBytecodeArrayRegister, a4, a4);
1049 __ Assert(eq, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry, a4, 1052 __ Assert(eq, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry, a4,
1050 Operand(BYTECODE_ARRAY_TYPE)); 1053 Operand(BYTECODE_ARRAY_TYPE));
1051 } 1054 }
1052 1055
1053 // Load initial bytecode offset. 1056 // Load initial bytecode offset.
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
1104 // The return value is in v0. 1107 // The return value is in v0.
1105 LeaveInterpreterFrame(masm, t0); 1108 LeaveInterpreterFrame(masm, t0);
1106 __ Jump(ra); 1109 __ Jump(ra);
1107 1110
1108 // Load debug copy of the bytecode array. 1111 // Load debug copy of the bytecode array.
1109 __ bind(&load_debug_bytecode_array); 1112 __ bind(&load_debug_bytecode_array);
1110 __ ld(kInterpreterBytecodeArrayRegister, 1113 __ ld(kInterpreterBytecodeArrayRegister,
1111 FieldMemOperand(debug_info, DebugInfo::kDebugBytecodeArrayIndex)); 1114 FieldMemOperand(debug_info, DebugInfo::kDebugBytecodeArrayIndex));
1112 __ Branch(&bytecode_array_loaded); 1115 __ Branch(&bytecode_array_loaded);
1113 1116
1114 // If the bytecode array is no longer present, then the underlying function 1117 // If the shared code is no longer this entry trampoline, then the underlying
1115 // has been switched to a different kind of code and we heal the closure by 1118 // function has been switched to a different kind of code and we heal the
1116 // switching the code entry field over to the new code object as well. 1119 // closure by switching the code entry field over to the new code as well.
1117 __ bind(&bytecode_array_not_present); 1120 __ bind(&switch_to_different_code_kind);
1118 __ LeaveFrame(StackFrame::JAVA_SCRIPT); 1121 __ LeaveFrame(StackFrame::JAVA_SCRIPT);
1119 __ ld(a4, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); 1122 __ ld(a4, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
1120 __ ld(a4, FieldMemOperand(a4, SharedFunctionInfo::kCodeOffset)); 1123 __ ld(a4, FieldMemOperand(a4, SharedFunctionInfo::kCodeOffset));
1121 __ Daddu(a4, a4, Operand(Code::kHeaderSize - kHeapObjectTag)); 1124 __ Daddu(a4, a4, Operand(Code::kHeaderSize - kHeapObjectTag));
1122 __ sd(a4, FieldMemOperand(a1, JSFunction::kCodeEntryOffset)); 1125 __ sd(a4, FieldMemOperand(a1, JSFunction::kCodeEntryOffset));
1123 __ RecordWriteCodeEntryField(a1, a4, a5); 1126 __ RecordWriteCodeEntryField(a1, a4, a5);
1124 __ Jump(a4); 1127 __ Jump(a4);
1125 } 1128 }
1126 1129
1127 void Builtins::Generate_InterpreterMarkBaselineOnReturn(MacroAssembler* masm) { 1130 void Builtins::Generate_InterpreterMarkBaselineOnReturn(MacroAssembler* masm) {
(...skipping 1869 matching lines...) Expand 10 before | Expand all | Expand 10 after
2997 __ break_(0xCC); 3000 __ break_(0xCC);
2998 } 3001 }
2999 } 3002 }
3000 3003
3001 #undef __ 3004 #undef __
3002 3005
3003 } // namespace internal 3006 } // namespace internal
3004 } // namespace v8 3007 } // namespace v8
3005 3008
3006 #endif // V8_TARGET_ARCH_MIPS64 3009 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/builtins/mips/builtins-mips.cc ('k') | src/builtins/x64/builtins-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698