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

Unified Diff: src/builtins/ppc/builtins-ppc.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, 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/builtins/s390/builtins-s390.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/ppc/builtins-ppc.cc
diff --git a/src/builtins/ppc/builtins-ppc.cc b/src/builtins/ppc/builtins-ppc.cc
index b799819dbdf71b5af1394eb4079d63761213bddb..af1e624ca07f8a2a9e2d13eab015852dae0b23e8 100644
--- a/src/builtins/ppc/builtins-ppc.cc
+++ b/src/builtins/ppc/builtins-ppc.cc
@@ -1077,11 +1077,14 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
FieldMemOperand(debug_info, DebugInfo::kDebugBytecodeArrayIndex));
__ bind(&array_done);
+ // Check whether we should continue to use the interpreter.
+ Label switch_to_different_code_kind;
+ __ LoadP(r3, FieldMemOperand(r3, SharedFunctionInfo::kCodeOffset));
+ __ mov(ip, Operand(masm->CodeObject())); // Self-reference to this code.
+ __ cmp(r3, ip);
+ __ bne(&switch_to_different_code_kind);
+
// Check function data field is actually a BytecodeArray object.
- Label bytecode_array_not_present;
- __ CompareRoot(kInterpreterBytecodeArrayRegister,
- Heap::kUndefinedValueRootIndex);
- __ beq(&bytecode_array_not_present);
if (FLAG_debug_code) {
__ TestIfSmi(kInterpreterBytecodeArrayRegister, r0);
@@ -1146,10 +1149,10 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
LeaveInterpreterFrame(masm, r5);
__ blr();
- // If the bytecode array is no longer present, then the underlying function
- // has been switched to a different kind of code and we heal the closure by
- // switching the code entry field over to the new code object as well.
- __ bind(&bytecode_array_not_present);
+ // If the shared code is no longer this entry trampoline, then the underlying
+ // function has been switched to a different kind of code and we heal the
+ // closure by switching the code entry field over to the new code as well.
+ __ bind(&switch_to_different_code_kind);
__ LeaveFrame(StackFrame::JAVA_SCRIPT);
__ LoadP(r7, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset));
__ LoadP(r7, FieldMemOperand(r7, SharedFunctionInfo::kCodeOffset));
« no previous file with comments | « no previous file | src/builtins/s390/builtins-s390.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698