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

Side by Side Diff: src/full-codegen/arm64/full-codegen-arm64.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/full-codegen/arm/full-codegen-arm.cc ('k') | src/full-codegen/ia32/full-codegen-ia32.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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_ARM64 5 #if V8_TARGET_ARCH_ARM64
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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 186
187 if (info->scope()->num_heap_slots() > 0) { 187 if (info->scope()->num_heap_slots() > 0) {
188 // Argument to NewContext is the function, which is still in x1. 188 // Argument to NewContext is the function, which is still in x1.
189 Comment cmnt(masm_, "[ Allocate context"); 189 Comment cmnt(masm_, "[ Allocate context");
190 bool need_write_barrier = true; 190 bool need_write_barrier = true;
191 int slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; 191 int slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS;
192 if (info->scope()->is_script_scope()) { 192 if (info->scope()->is_script_scope()) {
193 __ Mov(x10, Operand(info->scope()->GetScopeInfo(info->isolate()))); 193 __ Mov(x10, Operand(info->scope()->GetScopeInfo(info->isolate())));
194 __ Push(x1, x10); 194 __ Push(x1, x10);
195 __ CallRuntime(Runtime::kNewScriptContext, 2); 195 __ CallRuntime(Runtime::kNewScriptContext, 2);
196 PrepareForBailoutForId(BailoutId::ScriptContext(), TOS_REG);
196 } else if (slots <= FastNewContextStub::kMaximumSlots) { 197 } else if (slots <= FastNewContextStub::kMaximumSlots) {
197 FastNewContextStub stub(isolate(), slots); 198 FastNewContextStub stub(isolate(), slots);
198 __ CallStub(&stub); 199 __ CallStub(&stub);
199 // Result of FastNewContextStub is always in new space. 200 // Result of FastNewContextStub is always in new space.
200 need_write_barrier = false; 201 need_write_barrier = false;
201 } else { 202 } else {
202 __ Push(x1); 203 __ Push(x1);
203 __ CallRuntime(Runtime::kNewFunctionContext, 1); 204 __ CallRuntime(Runtime::kNewFunctionContext, 1);
204 } 205 }
205 function_in_register_x1 = false; 206 function_in_register_x1 = false;
(...skipping 21 matching lines...) Expand all
227 x11, kLRHasBeenSaved, kDontSaveFPRegs); 228 x11, kLRHasBeenSaved, kDontSaveFPRegs);
228 } else if (FLAG_debug_code) { 229 } else if (FLAG_debug_code) {
229 Label done; 230 Label done;
230 __ JumpIfInNewSpace(cp, &done); 231 __ JumpIfInNewSpace(cp, &done);
231 __ Abort(kExpectedNewSpaceObject); 232 __ Abort(kExpectedNewSpaceObject);
232 __ bind(&done); 233 __ bind(&done);
233 } 234 }
234 } 235 }
235 } 236 }
236 } 237 }
238 PrepareForBailoutForId(BailoutId::FunctionContext(), NO_REGISTERS);
237 239
238 PrepareForBailoutForId(BailoutId::Prologue(), NO_REGISTERS);
239 // Function register is trashed in case we bailout here. But since that 240 // Function register is trashed in case we bailout here. But since that
240 // could happen only when we allocate a context the value of 241 // could happen only when we allocate a context the value of
241 // |function_in_register_x1| is correct. 242 // |function_in_register_x1| is correct.
242 243
243 // Possibly set up a local binding to the this function which is used in 244 // Possibly set up a local binding to the this function which is used in
244 // derived constructors with super calls. 245 // derived constructors with super calls.
245 Variable* this_function_var = scope()->this_function_var(); 246 Variable* this_function_var = scope()->this_function_var();
246 if (this_function_var != nullptr) { 247 if (this_function_var != nullptr) {
247 Comment cmnt(masm_, "[ This function"); 248 Comment cmnt(masm_, "[ This function");
248 if (!function_in_register_x1) { 249 if (!function_in_register_x1) {
(...skipping 4962 matching lines...) Expand 10 before | Expand all | Expand 10 after
5211 } 5212 }
5212 5213
5213 return INTERRUPT; 5214 return INTERRUPT;
5214 } 5215 }
5215 5216
5216 5217
5217 } // namespace internal 5218 } // namespace internal
5218 } // namespace v8 5219 } // namespace v8
5219 5220
5220 #endif // V8_TARGET_ARCH_ARM64 5221 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/full-codegen/arm/full-codegen-arm.cc ('k') | src/full-codegen/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698