Index: src/builtins/ppc/builtins-ppc.cc |
diff --git a/src/builtins/ppc/builtins-ppc.cc b/src/builtins/ppc/builtins-ppc.cc |
index af1e624ca07f8a2a9e2d13eab015852dae0b23e8..756aeedf9104aa6cd43670b868c1d5337150e14b 100644 |
--- a/src/builtins/ppc/builtins-ppc.cc |
+++ b/src/builtins/ppc/builtins-ppc.cc |
@@ -1892,6 +1892,16 @@ void Builtins::Generate_DatePrototype_GetField(MacroAssembler* masm, |
__ LoadSmiLiteral(r3, Smi::FromInt(0)); |
__ EnterBuiltinFrame(cp, r4, r3); |
__ 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(); |
} |
} |