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

Side by Side Diff: src/full-codegen/mips/full-codegen-mips.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_MIPS 5 #if V8_TARGET_ARCH_MIPS
6 6
7 // Note on Mips implementation: 7 // Note on Mips implementation:
8 // 8 //
9 // The result_register() for mips is the 'v0' register, which is defined 9 // The result_register() for mips is the 'v0' register, which is defined
10 // by the ABI to contain function return values. However, the first 10 // by the ABI to contain function return values. However, the first
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 // Possibly allocate a local context. 193 // Possibly allocate a local context.
194 if (info->scope()->num_heap_slots() > 0) { 194 if (info->scope()->num_heap_slots() > 0) {
195 Comment cmnt(masm_, "[ Allocate context"); 195 Comment cmnt(masm_, "[ Allocate context");
196 // Argument to NewContext is the function, which is still in a1. 196 // Argument to NewContext is the function, which is still in a1.
197 bool need_write_barrier = true; 197 bool need_write_barrier = true;
198 int slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; 198 int slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS;
199 if (info->scope()->is_script_scope()) { 199 if (info->scope()->is_script_scope()) {
200 __ push(a1); 200 __ push(a1);
201 __ Push(info->scope()->GetScopeInfo(info->isolate())); 201 __ Push(info->scope()->GetScopeInfo(info->isolate()));
202 __ CallRuntime(Runtime::kNewScriptContext, 2); 202 __ CallRuntime(Runtime::kNewScriptContext, 2);
203 PrepareForBailoutForId(BailoutId::ScriptContext(), TOS_REG);
203 } else if (slots <= FastNewContextStub::kMaximumSlots) { 204 } else if (slots <= FastNewContextStub::kMaximumSlots) {
204 FastNewContextStub stub(isolate(), slots); 205 FastNewContextStub stub(isolate(), slots);
205 __ CallStub(&stub); 206 __ CallStub(&stub);
206 // Result of FastNewContextStub is always in new space. 207 // Result of FastNewContextStub is always in new space.
207 need_write_barrier = false; 208 need_write_barrier = false;
208 } else { 209 } else {
209 __ push(a1); 210 __ push(a1);
210 __ CallRuntime(Runtime::kNewFunctionContext, 1); 211 __ CallRuntime(Runtime::kNewFunctionContext, 1);
211 } 212 }
212 function_in_register_a1 = false; 213 function_in_register_a1 = false;
(...skipping 21 matching lines...) Expand all
234 cp, target.offset(), a0, a3, kRAHasBeenSaved, kDontSaveFPRegs); 235 cp, target.offset(), a0, a3, kRAHasBeenSaved, kDontSaveFPRegs);
235 } else if (FLAG_debug_code) { 236 } else if (FLAG_debug_code) {
236 Label done; 237 Label done;
237 __ JumpIfInNewSpace(cp, a0, &done); 238 __ JumpIfInNewSpace(cp, a0, &done);
238 __ Abort(kExpectedNewSpaceObject); 239 __ Abort(kExpectedNewSpaceObject);
239 __ bind(&done); 240 __ bind(&done);
240 } 241 }
241 } 242 }
242 } 243 }
243 } 244 }
245 PrepareForBailoutForId(BailoutId::FunctionContext(), NO_REGISTERS);
244 246
245 PrepareForBailoutForId(BailoutId::Prologue(), NO_REGISTERS);
246 // Function register is trashed in case we bailout here. But since that 247 // Function register is trashed in case we bailout here. But since that
247 // could happen only when we allocate a context the value of 248 // could happen only when we allocate a context the value of
248 // |function_in_register_a1| is correct. 249 // |function_in_register_a1| is correct.
249 250
250 // Possibly set up a local binding to the this function which is used in 251 // Possibly set up a local binding to the this function which is used in
251 // derived constructors with super calls. 252 // derived constructors with super calls.
252 Variable* this_function_var = scope()->this_function_var(); 253 Variable* this_function_var = scope()->this_function_var();
253 if (this_function_var != nullptr) { 254 if (this_function_var != nullptr) {
254 Comment cmnt(masm_, "[ This function"); 255 Comment cmnt(masm_, "[ This function");
255 if (!function_in_register_a1) { 256 if (!function_in_register_a1) {
(...skipping 4933 matching lines...) Expand 10 before | Expand all | Expand 10 after
5189 reinterpret_cast<uint32_t>( 5190 reinterpret_cast<uint32_t>(
5190 isolate->builtins()->OsrAfterStackCheck()->entry())); 5191 isolate->builtins()->OsrAfterStackCheck()->entry()));
5191 return OSR_AFTER_STACK_CHECK; 5192 return OSR_AFTER_STACK_CHECK;
5192 } 5193 }
5193 5194
5194 5195
5195 } // namespace internal 5196 } // namespace internal
5196 } // namespace v8 5197 } // namespace v8
5197 5198
5198 #endif // V8_TARGET_ARCH_MIPS 5199 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/full-codegen/ia32/full-codegen-ia32.cc ('k') | src/full-codegen/mips64/full-codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698