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

Unified Diff: src/builtins/x87/builtins-x87.cc

Issue 2273503003: X87: [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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/x87/builtins-x87.cc
diff --git a/src/builtins/x87/builtins-x87.cc b/src/builtins/x87/builtins-x87.cc
index bb7dc8380b5a3f762e253b2a27eebf1207d7b0fe..9c46f20ff68e83313fca7e4e4f93c9f7dd6d1948 100644
--- a/src/builtins/x87/builtins-x87.cc
+++ b/src/builtins/x87/builtins-x87.cc
@@ -585,11 +585,13 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
FieldOperand(eax, SharedFunctionInfo::kFunctionDataOffset));
__ bind(&bytecode_array_loaded);
+ // Check whether we should continue to use the interpreter.
+ Label switch_to_different_code_kind;
+ __ Move(ecx, masm->CodeObject()); // Self-reference to this code.
+ __ cmp(ecx, FieldOperand(eax, SharedFunctionInfo::kCodeOffset));
+ __ j(not_equal, &switch_to_different_code_kind);
+
// Check function data field is actually a BytecodeArray object.
- Label bytecode_array_not_present;
- __ CompareRoot(kInterpreterBytecodeArrayRegister,
- Heap::kUndefinedValueRootIndex);
- __ j(equal, &bytecode_array_not_present);
if (FLAG_debug_code) {
__ AssertNotSmi(kInterpreterBytecodeArrayRegister);
__ CmpObjectType(kInterpreterBytecodeArrayRegister, BYTECODE_ARRAY_TYPE,
@@ -661,10 +663,10 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
FieldOperand(debug_info, DebugInfo::kDebugBytecodeArrayIndex));
__ jmp(&bytecode_array_loaded);
- // 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);
__ pop(edx); // Callee's new target.
__ pop(edi); // Callee's JS function.
__ pop(esi); // Callee's context.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698