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

Side by Side Diff: src/full-codegen/ia32/full-codegen-ia32.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
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_IA32 5 #if V8_TARGET_ARCH_IA32
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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 // Possibly allocate a local context. 178 // Possibly allocate a local context.
179 if (info->scope()->num_heap_slots() > 0) { 179 if (info->scope()->num_heap_slots() > 0) {
180 Comment cmnt(masm_, "[ Allocate context"); 180 Comment cmnt(masm_, "[ Allocate context");
181 bool need_write_barrier = true; 181 bool need_write_barrier = true;
182 int slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; 182 int slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS;
183 // Argument to NewContext is the function, which is still in edi. 183 // Argument to NewContext is the function, which is still in edi.
184 if (info->scope()->is_script_scope()) { 184 if (info->scope()->is_script_scope()) {
185 __ push(edi); 185 __ push(edi);
186 __ Push(info->scope()->GetScopeInfo(info->isolate())); 186 __ Push(info->scope()->GetScopeInfo(info->isolate()));
187 __ CallRuntime(Runtime::kNewScriptContext, 2); 187 __ CallRuntime(Runtime::kNewScriptContext, 2);
188 PrepareForBailoutForId(BailoutId::ScriptContext(), TOS_REG);
188 } else if (slots <= FastNewContextStub::kMaximumSlots) { 189 } else if (slots <= FastNewContextStub::kMaximumSlots) {
189 FastNewContextStub stub(isolate(), slots); 190 FastNewContextStub stub(isolate(), slots);
190 __ CallStub(&stub); 191 __ CallStub(&stub);
191 // Result of FastNewContextStub is always in new space. 192 // Result of FastNewContextStub is always in new space.
192 need_write_barrier = false; 193 need_write_barrier = false;
193 } else { 194 } else {
194 __ push(edi); 195 __ push(edi);
195 __ CallRuntime(Runtime::kNewFunctionContext, 1); 196 __ CallRuntime(Runtime::kNewFunctionContext, 1);
196 } 197 }
197 function_in_register = false; 198 function_in_register = false;
(...skipping 24 matching lines...) Expand all
222 kDontSaveFPRegs); 223 kDontSaveFPRegs);
223 } else if (FLAG_debug_code) { 224 } else if (FLAG_debug_code) {
224 Label done; 225 Label done;
225 __ JumpIfInNewSpace(esi, eax, &done, Label::kNear); 226 __ JumpIfInNewSpace(esi, eax, &done, Label::kNear);
226 __ Abort(kExpectedNewSpaceObject); 227 __ Abort(kExpectedNewSpaceObject);
227 __ bind(&done); 228 __ bind(&done);
228 } 229 }
229 } 230 }
230 } 231 }
231 } 232 }
233 PrepareForBailoutForId(BailoutId::FunctionContext(), NO_REGISTERS);
232 234
233 PrepareForBailoutForId(BailoutId::Prologue(), NO_REGISTERS);
234 // Function register is trashed in case we bailout here. But since that 235 // Function register is trashed in case we bailout here. But since that
235 // could happen only when we allocate a context the value of 236 // could happen only when we allocate a context the value of
236 // |function_in_register| is correct. 237 // |function_in_register| is correct.
237 238
238 // Possibly set up a local binding to the this function which is used in 239 // Possibly set up a local binding to the this function which is used in
239 // derived constructors with super calls. 240 // derived constructors with super calls.
240 Variable* this_function_var = scope()->this_function_var(); 241 Variable* this_function_var = scope()->this_function_var();
241 if (this_function_var != nullptr) { 242 if (this_function_var != nullptr) {
242 Comment cmnt(masm_, "[ This function"); 243 Comment cmnt(masm_, "[ This function");
243 if (!function_in_register) { 244 if (!function_in_register) {
(...skipping 4851 matching lines...) Expand 10 before | Expand all | Expand 10 after
5095 Assembler::target_address_at(call_target_address, 5096 Assembler::target_address_at(call_target_address,
5096 unoptimized_code)); 5097 unoptimized_code));
5097 return OSR_AFTER_STACK_CHECK; 5098 return OSR_AFTER_STACK_CHECK;
5098 } 5099 }
5099 5100
5100 5101
5101 } // namespace internal 5102 } // namespace internal
5102 } // namespace v8 5103 } // namespace v8
5103 5104
5104 #endif // V8_TARGET_ARCH_IA32 5105 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/full-codegen/arm64/full-codegen-arm64.cc ('k') | src/full-codegen/mips/full-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698