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

Unified Diff: src/full-codegen/arm/full-codegen-arm.cc

Issue 1317383002: Crankshaft is now able to compile top level code even if there is a ScriptContext. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebasing Created 5 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 | « src/contexts.cc ('k') | src/full-codegen/arm64/full-codegen-arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen/arm/full-codegen-arm.cc
diff --git a/src/full-codegen/arm/full-codegen-arm.cc b/src/full-codegen/arm/full-codegen-arm.cc
index c238860d0d2868f22fd90bc1d0538f5d455eaa31..8840ee57d45786a05eacc03fe5cb7065e1b4edf7 100644
--- a/src/full-codegen/arm/full-codegen-arm.cc
+++ b/src/full-codegen/arm/full-codegen-arm.cc
@@ -181,7 +181,7 @@ void FullCodeGenerator::Generate() {
}
}
- bool function_in_register = true;
+ bool function_in_register_r1 = true;
// Possibly allocate a local context.
if (info->scope()->num_heap_slots() > 0) {
@@ -202,7 +202,7 @@ void FullCodeGenerator::Generate() {
__ push(r1);
__ CallRuntime(Runtime::kNewFunctionContext, 1);
}
- function_in_register = false;
+ function_in_register_r1 = false;
// Context is returned in r0. It replaces the context passed to us.
// It's saved in the stack and kept live in cp.
__ mov(cp, r0);
@@ -235,14 +235,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_r1| 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_r1) {
__ ldr(r1, 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, r1, r0, r2);
}
@@ -258,6 +263,7 @@ void FullCodeGenerator::Generate() {
__ ldr(r1, MemOperand(r2, StandardFrameConstants::kMarkerOffset));
__ cmp(r1, Operand(Smi::FromInt(StackFrame::CONSTRUCT)));
Label non_construct_frame, done;
+ function_in_register_r1 = false;
__ b(ne, &non_construct_frame);
__ ldr(r0,
@@ -285,6 +291,7 @@ void FullCodeGenerator::Generate() {
__ mov(r1, Operand(Smi::FromInt(rest_index)));
__ mov(r0, Operand(Smi::FromInt(language_mode())));
__ Push(r3, r2, r1, r0);
+ function_in_register_r1 = false;
RestParamAccessStub stub(isolate());
__ CallStub(&stub);
@@ -296,7 +303,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_r1) {
// Load this again, if it's used by the local context below.
__ ldr(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
} else {
@@ -328,7 +335,6 @@ void FullCodeGenerator::Generate() {
SetVar(arguments, r0, r1, r2);
}
-
if (FLAG_trace) {
__ CallRuntime(Runtime::kTraceEnter, 0);
}
« no previous file with comments | « src/contexts.cc ('k') | src/full-codegen/arm64/full-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698