Index: src/full-codegen/ppc/full-codegen-ppc.cc |
diff --git a/src/full-codegen/ppc/full-codegen-ppc.cc b/src/full-codegen/ppc/full-codegen-ppc.cc |
index abd41c4c803f9a9c7e06778c589a6a67255d6f04..4af5bc4ab8f5afe2a0ca747794ac6356d38867f6 100644 |
--- a/src/full-codegen/ppc/full-codegen-ppc.cc |
+++ b/src/full-codegen/ppc/full-codegen-ppc.cc |
@@ -186,7 +186,7 @@ void FullCodeGenerator::Generate() { |
} |
} |
- bool function_in_register = true; |
+ bool function_in_register_r4 = true; |
// Possibly allocate a local context. |
if (info->scope()->num_heap_slots() > 0) { |
@@ -207,7 +207,7 @@ void FullCodeGenerator::Generate() { |
__ push(r4); |
__ CallRuntime(Runtime::kNewFunctionContext, 1); |
} |
- function_in_register = false; |
+ function_in_register_r4 = false; |
// Context is returned in r3. It replaces the context passed to us. |
// It's saved in the stack and kept live in cp. |
__ mr(cp, r3); |
@@ -240,14 +240,19 @@ void FullCodeGenerator::Generate() { |
} |
} |
+ PrepareForBailoutForId(BailoutId::Prologue(), NO_REGISTERS); |
+ // Function register is trashed in case we bailout here. But since that |
+ // could happen only when we allocate a context the value of |
+ // |function_in_register_r4| is correct. |
+ |
// Possibly set up a local binding to the this function which is used in |
// derived constructors with super calls. |
Variable* this_function_var = scope()->this_function_var(); |
if (this_function_var != nullptr) { |
Comment cmnt(masm_, "[ This function"); |
- if (!function_in_register) { |
+ if (!function_in_register_r4) { |
__ LoadP(r4, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
- // The write barrier clobbers register again, keep is marked as such. |
+ // The write barrier clobbers register again, keep it marked as such. |
} |
SetVar(this_function_var, r4, r3, r5); |
} |
@@ -271,6 +276,7 @@ void FullCodeGenerator::Generate() { |
__ LoadP(r4, MemOperand(r5, StandardFrameConstants::kMarkerOffset)); |
__ CmpSmiLiteral(r4, Smi::FromInt(StackFrame::CONSTRUCT), r0); |
Label non_construct_frame, done; |
+ function_in_register_r4 = false; |
__ bne(&non_construct_frame); |
__ LoadP(r3, MemOperand( |
@@ -298,6 +304,7 @@ void FullCodeGenerator::Generate() { |
__ LoadSmiLiteral(r4, Smi::FromInt(rest_index)); |
__ LoadSmiLiteral(r3, Smi::FromInt(language_mode())); |
__ Push(r6, r5, r4, r3); |
+ function_in_register_r4 = false; |
RestParamAccessStub stub(isolate()); |
__ CallStub(&stub); |
@@ -309,7 +316,7 @@ void FullCodeGenerator::Generate() { |
if (arguments != NULL) { |
// Function uses arguments object. |
Comment cmnt(masm_, "[ Allocate arguments object"); |
- if (!function_in_register) { |
+ if (!function_in_register_r4) { |
// Load this again, if it's used by the local context below. |
__ LoadP(r6, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
} else { |