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

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

Powered by Google App Engine
This is Rietveld 408576698