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

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

Issue 2265193002: PPC/s390: [interpreter] Fix self-healing with preserved bytecode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 3 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/ppc/builtins-ppc.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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_S390 5 #if V8_TARGET_ARCH_S390
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 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after
1074 FieldMemOperand(r2, SharedFunctionInfo::kDebugInfoOffset)); 1074 FieldMemOperand(r2, SharedFunctionInfo::kDebugInfoOffset));
1075 // Load original bytecode array or the debug copy. 1075 // Load original bytecode array or the debug copy.
1076 __ LoadP(kInterpreterBytecodeArrayRegister, 1076 __ LoadP(kInterpreterBytecodeArrayRegister,
1077 FieldMemOperand(r2, SharedFunctionInfo::kFunctionDataOffset)); 1077 FieldMemOperand(r2, SharedFunctionInfo::kFunctionDataOffset));
1078 __ CmpSmiLiteral(debug_info, DebugInfo::uninitialized(), r0); 1078 __ CmpSmiLiteral(debug_info, DebugInfo::uninitialized(), r0);
1079 __ beq(&array_done); 1079 __ beq(&array_done);
1080 __ LoadP(kInterpreterBytecodeArrayRegister, 1080 __ LoadP(kInterpreterBytecodeArrayRegister,
1081 FieldMemOperand(debug_info, DebugInfo::kDebugBytecodeArrayIndex)); 1081 FieldMemOperand(debug_info, DebugInfo::kDebugBytecodeArrayIndex));
1082 __ bind(&array_done); 1082 __ bind(&array_done);
1083 1083
1084 // Check whether we should continue to use the interpreter.
1085 Label switch_to_different_code_kind;
1086 __ LoadP(r2, FieldMemOperand(r2, SharedFunctionInfo::kCodeOffset));
1087 __ CmpP(r2, Operand(masm->CodeObject())); // Self-reference to this code.
1088 __ bne(&switch_to_different_code_kind);
1089
1084 // Check function data field is actually a BytecodeArray object. 1090 // Check function data field is actually a BytecodeArray object.
1085 Label bytecode_array_not_present;
1086 __ CompareRoot(kInterpreterBytecodeArrayRegister,
1087 Heap::kUndefinedValueRootIndex);
1088 __ beq(&bytecode_array_not_present);
1089
1090 if (FLAG_debug_code) { 1091 if (FLAG_debug_code) {
1091 __ TestIfSmi(kInterpreterBytecodeArrayRegister); 1092 __ TestIfSmi(kInterpreterBytecodeArrayRegister);
1092 __ Assert(ne, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry); 1093 __ Assert(ne, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry);
1093 __ CompareObjectType(kInterpreterBytecodeArrayRegister, r2, no_reg, 1094 __ CompareObjectType(kInterpreterBytecodeArrayRegister, r2, no_reg,
1094 BYTECODE_ARRAY_TYPE); 1095 BYTECODE_ARRAY_TYPE);
1095 __ Assert(eq, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry); 1096 __ Assert(eq, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry);
1096 } 1097 }
1097 1098
1098 // Load the initial bytecode offset. 1099 // Load the initial bytecode offset.
1099 __ mov(kInterpreterBytecodeOffsetRegister, 1100 __ mov(kInterpreterBytecodeOffsetRegister,
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
1145 __ ShiftLeftP(ip, r3, Operand(kPointerSizeLog2)); 1146 __ ShiftLeftP(ip, r3, Operand(kPointerSizeLog2));
1146 __ LoadP(ip, MemOperand(kInterpreterDispatchTableRegister, ip)); 1147 __ LoadP(ip, MemOperand(kInterpreterDispatchTableRegister, ip));
1147 __ Call(ip); 1148 __ Call(ip);
1148 1149
1149 masm->isolate()->heap()->SetInterpreterEntryReturnPCOffset(masm->pc_offset()); 1150 masm->isolate()->heap()->SetInterpreterEntryReturnPCOffset(masm->pc_offset());
1150 1151
1151 // The return value is in r2. 1152 // The return value is in r2.
1152 LeaveInterpreterFrame(masm, r4); 1153 LeaveInterpreterFrame(masm, r4);
1153 __ Ret(); 1154 __ Ret();
1154 1155
1155 // If the bytecode array is no longer present, then the underlying function 1156 // If the shared code is no longer this entry trampoline, then the underlying
1156 // has been switched to a different kind of code and we heal the closure by 1157 // function has been switched to a different kind of code and we heal the
1157 // switching the code entry field over to the new code object as well. 1158 // closure by switching the code entry field over to the new code as well.
1158 __ bind(&bytecode_array_not_present); 1159 __ bind(&switch_to_different_code_kind);
1159 __ LeaveFrame(StackFrame::JAVA_SCRIPT); 1160 __ LeaveFrame(StackFrame::JAVA_SCRIPT);
1160 __ LoadP(r6, FieldMemOperand(r3, JSFunction::kSharedFunctionInfoOffset)); 1161 __ LoadP(r6, FieldMemOperand(r3, JSFunction::kSharedFunctionInfoOffset));
1161 __ LoadP(r6, FieldMemOperand(r6, SharedFunctionInfo::kCodeOffset)); 1162 __ LoadP(r6, FieldMemOperand(r6, SharedFunctionInfo::kCodeOffset));
1162 __ AddP(r6, r6, Operand(Code::kHeaderSize - kHeapObjectTag)); 1163 __ AddP(r6, r6, Operand(Code::kHeaderSize - kHeapObjectTag));
1163 __ StoreP(r6, FieldMemOperand(r3, JSFunction::kCodeEntryOffset), r0); 1164 __ StoreP(r6, FieldMemOperand(r3, JSFunction::kCodeEntryOffset), r0);
1164 __ RecordWriteCodeEntryField(r3, r6, r7); 1165 __ RecordWriteCodeEntryField(r3, r6, r7);
1165 __ JumpToJSEntry(r6); 1166 __ JumpToJSEntry(r6);
1166 } 1167 }
1167 1168
1168 void Builtins::Generate_InterpreterMarkBaselineOnReturn(MacroAssembler* masm) { 1169 void Builtins::Generate_InterpreterMarkBaselineOnReturn(MacroAssembler* masm) {
(...skipping 1851 matching lines...) Expand 10 before | Expand all | Expand 10 after
3020 __ bkpt(0); 3021 __ bkpt(0);
3021 } 3022 }
3022 } 3023 }
3023 3024
3024 #undef __ 3025 #undef __
3025 3026
3026 } // namespace internal 3027 } // namespace internal
3027 } // namespace v8 3028 } // namespace v8
3028 3029
3029 #endif // V8_TARGET_ARCH_S390 3030 #endif // V8_TARGET_ARCH_S390
OLDNEW
« no previous file with comments | « src/builtins/ppc/builtins-ppc.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698