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

Side by Side Diff: src/full-codegen/arm/full-codegen-arm.cc

Issue 1413933005: [turbofan] Fix bailout for script context creation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | src/full-codegen/arm64/full-codegen-arm64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if V8_TARGET_ARCH_ARM 5 #if V8_TARGET_ARCH_ARM
6 6
7 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/codegen.h" 9 #include "src/codegen.h"
10 #include "src/debug/debug.h" 10 #include "src/debug/debug.h"
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 // Possibly allocate a local context. 184 // Possibly allocate a local context.
185 if (info->scope()->num_heap_slots() > 0) { 185 if (info->scope()->num_heap_slots() > 0) {
186 // Argument to NewContext is the function, which is still in r1. 186 // Argument to NewContext is the function, which is still in r1.
187 Comment cmnt(masm_, "[ Allocate context"); 187 Comment cmnt(masm_, "[ Allocate context");
188 bool need_write_barrier = true; 188 bool need_write_barrier = true;
189 int slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; 189 int slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS;
190 if (info->scope()->is_script_scope()) { 190 if (info->scope()->is_script_scope()) {
191 __ push(r1); 191 __ push(r1);
192 __ Push(info->scope()->GetScopeInfo(info->isolate())); 192 __ Push(info->scope()->GetScopeInfo(info->isolate()));
193 __ CallRuntime(Runtime::kNewScriptContext, 2); 193 __ CallRuntime(Runtime::kNewScriptContext, 2);
194 PrepareForBailoutForId(BailoutId::ScriptContext(), TOS_REG);
194 } else if (slots <= FastNewContextStub::kMaximumSlots) { 195 } else if (slots <= FastNewContextStub::kMaximumSlots) {
195 FastNewContextStub stub(isolate(), slots); 196 FastNewContextStub stub(isolate(), slots);
196 __ CallStub(&stub); 197 __ CallStub(&stub);
197 // Result of FastNewContextStub is always in new space. 198 // Result of FastNewContextStub is always in new space.
198 need_write_barrier = false; 199 need_write_barrier = false;
199 } else { 200 } else {
200 __ push(r1); 201 __ push(r1);
201 __ CallRuntime(Runtime::kNewFunctionContext, 1); 202 __ CallRuntime(Runtime::kNewFunctionContext, 1);
202 } 203 }
203 function_in_register_r1 = false; 204 function_in_register_r1 = false;
(...skipping 21 matching lines...) Expand all
225 cp, target.offset(), r0, r3, kLRHasBeenSaved, kDontSaveFPRegs); 226 cp, target.offset(), r0, r3, kLRHasBeenSaved, kDontSaveFPRegs);
226 } else if (FLAG_debug_code) { 227 } else if (FLAG_debug_code) {
227 Label done; 228 Label done;
228 __ JumpIfInNewSpace(cp, r0, &done); 229 __ JumpIfInNewSpace(cp, r0, &done);
229 __ Abort(kExpectedNewSpaceObject); 230 __ Abort(kExpectedNewSpaceObject);
230 __ bind(&done); 231 __ bind(&done);
231 } 232 }
232 } 233 }
233 } 234 }
234 } 235 }
236 PrepareForBailoutForId(BailoutId::FunctionContext(), NO_REGISTERS);
235 237
236 PrepareForBailoutForId(BailoutId::Prologue(), NO_REGISTERS);
237 // Function register is trashed in case we bailout here. But since that 238 // Function register is trashed in case we bailout here. But since that
238 // could happen only when we allocate a context the value of 239 // could happen only when we allocate a context the value of
239 // |function_in_register_r1| is correct. 240 // |function_in_register_r1| is correct.
240 241
241 // Possibly set up a local binding to the this function which is used in 242 // Possibly set up a local binding to the this function which is used in
242 // derived constructors with super calls. 243 // derived constructors with super calls.
243 Variable* this_function_var = scope()->this_function_var(); 244 Variable* this_function_var = scope()->this_function_var();
244 if (this_function_var != nullptr) { 245 if (this_function_var != nullptr) {
245 Comment cmnt(masm_, "[ This function"); 246 Comment cmnt(masm_, "[ This function");
246 if (!function_in_register_r1) { 247 if (!function_in_register_r1) {
(...skipping 4977 matching lines...) Expand 10 before | Expand all | Expand 10 after
5224 DCHECK(interrupt_address == 5225 DCHECK(interrupt_address ==
5225 isolate->builtins()->OsrAfterStackCheck()->entry()); 5226 isolate->builtins()->OsrAfterStackCheck()->entry());
5226 return OSR_AFTER_STACK_CHECK; 5227 return OSR_AFTER_STACK_CHECK;
5227 } 5228 }
5228 5229
5229 5230
5230 } // namespace internal 5231 } // namespace internal
5231 } // namespace v8 5232 } // namespace v8
5232 5233
5233 #endif // V8_TARGET_ARCH_ARM 5234 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/compiler/ast-graph-builder.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