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

Side by Side Diff: src/full-codegen/ppc/full-codegen-ppc.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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_PPC 5 #if V8_TARGET_ARCH_PPC
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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 // Possibly allocate a local context. 189 // Possibly allocate a local context.
190 if (info->scope()->num_heap_slots() > 0) { 190 if (info->scope()->num_heap_slots() > 0) {
191 // Argument to NewContext is the function, which is still in r4. 191 // Argument to NewContext is the function, which is still in r4.
192 Comment cmnt(masm_, "[ Allocate context"); 192 Comment cmnt(masm_, "[ Allocate context");
193 bool need_write_barrier = true; 193 bool need_write_barrier = true;
194 int slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; 194 int slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS;
195 if (info->scope()->is_script_scope()) { 195 if (info->scope()->is_script_scope()) {
196 __ push(r4); 196 __ push(r4);
197 __ Push(info->scope()->GetScopeInfo(info->isolate())); 197 __ Push(info->scope()->GetScopeInfo(info->isolate()));
198 __ CallRuntime(Runtime::kNewScriptContext, 2); 198 __ CallRuntime(Runtime::kNewScriptContext, 2);
199 PrepareForBailoutForId(BailoutId::ScriptContext(), TOS_REG);
199 } else if (slots <= FastNewContextStub::kMaximumSlots) { 200 } else if (slots <= FastNewContextStub::kMaximumSlots) {
200 FastNewContextStub stub(isolate(), slots); 201 FastNewContextStub stub(isolate(), slots);
201 __ CallStub(&stub); 202 __ CallStub(&stub);
202 // Result of FastNewContextStub is always in new space. 203 // Result of FastNewContextStub is always in new space.
203 need_write_barrier = false; 204 need_write_barrier = false;
204 } else { 205 } else {
205 __ push(r4); 206 __ push(r4);
206 __ CallRuntime(Runtime::kNewFunctionContext, 1); 207 __ CallRuntime(Runtime::kNewFunctionContext, 1);
207 } 208 }
208 function_in_register_r4 = false; 209 function_in_register_r4 = false;
(...skipping 21 matching lines...) Expand all
230 kLRHasBeenSaved, kDontSaveFPRegs); 231 kLRHasBeenSaved, kDontSaveFPRegs);
231 } else if (FLAG_debug_code) { 232 } else if (FLAG_debug_code) {
232 Label done; 233 Label done;
233 __ JumpIfInNewSpace(cp, r3, &done); 234 __ JumpIfInNewSpace(cp, r3, &done);
234 __ Abort(kExpectedNewSpaceObject); 235 __ Abort(kExpectedNewSpaceObject);
235 __ bind(&done); 236 __ bind(&done);
236 } 237 }
237 } 238 }
238 } 239 }
239 } 240 }
241 PrepareForBailoutForId(BailoutId::FunctionContext(), NO_REGISTERS);
240 242
241 PrepareForBailoutForId(BailoutId::Prologue(), NO_REGISTERS);
242 // Function register is trashed in case we bailout here. But since that 243 // Function register is trashed in case we bailout here. But since that
243 // could happen only when we allocate a context the value of 244 // could happen only when we allocate a context the value of
244 // |function_in_register_r4| is correct. 245 // |function_in_register_r4| is correct.
245 246
246 // Possibly set up a local binding to the this function which is used in 247 // Possibly set up a local binding to the this function which is used in
247 // derived constructors with super calls. 248 // derived constructors with super calls.
248 Variable* this_function_var = scope()->this_function_var(); 249 Variable* this_function_var = scope()->this_function_var();
249 if (this_function_var != nullptr) { 250 if (this_function_var != nullptr) {
250 Comment cmnt(masm_, "[ This function"); 251 Comment cmnt(masm_, "[ This function");
251 if (!function_in_register_r4) { 252 if (!function_in_register_r4) {
(...skipping 4923 matching lines...) Expand 10 before | Expand all | Expand 10 after
5175 return ON_STACK_REPLACEMENT; 5176 return ON_STACK_REPLACEMENT;
5176 } 5177 }
5177 5178
5178 DCHECK(interrupt_address == 5179 DCHECK(interrupt_address ==
5179 isolate->builtins()->OsrAfterStackCheck()->entry()); 5180 isolate->builtins()->OsrAfterStackCheck()->entry());
5180 return OSR_AFTER_STACK_CHECK; 5181 return OSR_AFTER_STACK_CHECK;
5181 } 5182 }
5182 } // namespace internal 5183 } // namespace internal
5183 } // namespace v8 5184 } // namespace v8
5184 #endif // V8_TARGET_ARCH_PPC 5185 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « src/full-codegen/mips64/full-codegen-mips64.cc ('k') | src/full-codegen/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698