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

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

Issue 2284673002: Fix LookupCode for the DatePrototype_GetField builtin (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/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 1b643d437b3d5dbdace29e95ea2a8f375c0d8d91..fb0a49777e781d250e94518fa7153d596692571b 100644
--- a/src/builtins/arm/builtins-arm.cc
+++ b/src/builtins/arm/builtins-arm.cc
@@ -1867,6 +1867,16 @@ void Builtins::Generate_DatePrototype_GetField(MacroAssembler* masm,
__ Move(r0, Smi::FromInt(0));
__ EnterBuiltinFrame(cp, r1, r0);
__ CallRuntime(Runtime::kThrowNotDateError);
+
+ // It's far from obvious, but this final trailing instruction after the call
+ // is required for StackFrame::LookupCode to work correctly. To illustrate
+ // why: if call were the final instruction in the code object, then the pc
+ // (== return address) would point beyond the code object when the stack is
+ // traversed. When we then try to look up the code object through
+ // StackFrame::LookupCode, we actually return the next code object that
+ // happens to be on the same page in memory.
+ // TODO(jgruber): A proper fix for this would be nice.
+ __ nop();
}
}
« 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