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

Unified Diff: src/builtins/arm/builtins-arm.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/builtins/arm64/builtins-arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/arm/builtins-arm.cc
diff --git a/src/builtins/arm/builtins-arm.cc b/src/builtins/arm/builtins-arm.cc
index 0ee3010ed9650a69589c042aed78247c72b298c9..1b643d437b3d5dbdace29e95ea2a8f375c0d8d91 100644
--- a/src/builtins/arm/builtins-arm.cc
+++ b/src/builtins/arm/builtins-arm.cc
@@ -1054,11 +1054,13 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
__ ldr(kInterpreterBytecodeArrayRegister,
FieldMemOperand(debug_info, DebugInfo::kDebugBytecodeArrayIndex), ne);
+ // Check whether we should continue to use the interpreter.
+ Label switch_to_different_code_kind;
+ __ ldr(r0, FieldMemOperand(r0, SharedFunctionInfo::kCodeOffset));
+ __ cmp(r0, Operand(masm->CodeObject())); // Self-reference to this code.
+ __ b(ne, &switch_to_different_code_kind);
+
// Check function data field is actually a BytecodeArray object.
- Label bytecode_array_not_present;
- __ CompareRoot(kInterpreterBytecodeArrayRegister,
- Heap::kUndefinedValueRootIndex);
- __ b(eq, &bytecode_array_not_present);
if (FLAG_debug_code) {
__ SmiTst(kInterpreterBytecodeArrayRegister);
__ Assert(ne, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry);
@@ -1122,10 +1124,10 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
LeaveInterpreterFrame(masm, r2);
__ Jump(lr);
- // 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);
__ ldr(r4, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset));
__ ldr(r4, FieldMemOperand(r4, SharedFunctionInfo::kCodeOffset));
« no previous file with comments | « no previous file | src/builtins/arm64/builtins-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698