Index: src/full-codegen/mips/full-codegen-mips.cc |
diff --git a/src/full-codegen/mips/full-codegen-mips.cc b/src/full-codegen/mips/full-codegen-mips.cc |
index d272e67ba514d599b44749f49d51dfac206b0e36..3a296a521c9930a99cd7f3904a6570be03612c52 100644 |
--- a/src/full-codegen/mips/full-codegen-mips.cc |
+++ b/src/full-codegen/mips/full-codegen-mips.cc |
@@ -190,7 +190,7 @@ void FullCodeGenerator::Generate() { |
} |
} |
- bool function_in_register = true; |
+ bool function_in_register_a1 = true; |
// Possibly allocate a local context. |
if (info->scope()->num_heap_slots() > 0) { |
@@ -211,7 +211,7 @@ void FullCodeGenerator::Generate() { |
__ push(a1); |
__ CallRuntime(Runtime::kNewFunctionContext, 1); |
} |
- function_in_register = false; |
+ function_in_register_a1 = false; |
// Context is returned in v0. It replaces the context passed to us. |
// It's saved in the stack and kept live in cp. |
__ mov(cp, v0); |
@@ -244,14 +244,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_a1| 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_a1) { |
__ lw(a1, 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, a1, a2, a3); |
} |
@@ -273,6 +278,7 @@ void FullCodeGenerator::Generate() { |
// Check the marker in the calling frame. |
__ bind(&check_frame_marker); |
__ lw(a1, MemOperand(a2, StandardFrameConstants::kMarkerOffset)); |
+ function_in_register_a1 = false; |
Label non_construct_frame, done; |
__ Branch(&non_construct_frame, ne, a1, |
@@ -304,6 +310,7 @@ void FullCodeGenerator::Generate() { |
__ li(a1, Operand(Smi::FromInt(rest_index))); |
__ li(a0, Operand(Smi::FromInt(language_mode()))); |
__ Push(a3, a2, a1, a0); |
+ function_in_register_a1 = false; |
RestParamAccessStub stub(isolate()); |
__ CallStub(&stub); |
@@ -315,7 +322,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_a1) { |
// Load this again, if it's used by the local context below. |
__ lw(a3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
} else { |