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

Side by Side Diff: src/full-codegen/arm64/full-codegen-arm64.cc

Issue 1317383002: Crankshaft is now able to compile top level code even if there is a ScriptContext. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebasing Created 5 years, 3 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/compiler.h" 10 #include "src/compiler.h"
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 } else if (FLAG_debug_code) { 230 } else if (FLAG_debug_code) {
231 Label done; 231 Label done;
232 __ JumpIfInNewSpace(cp, &done); 232 __ JumpIfInNewSpace(cp, &done);
233 __ Abort(kExpectedNewSpaceObject); 233 __ Abort(kExpectedNewSpaceObject);
234 __ bind(&done); 234 __ bind(&done);
235 } 235 }
236 } 236 }
237 } 237 }
238 } 238 }
239 239
240 PrepareForBailoutForId(BailoutId::Prologue(), NO_REGISTERS);
241 // Function register is trashed in case we bailout here. But since that
242 // could happen only when we allocate a context the value of
243 // |function_in_register_x1| is correct.
244
240 // Possibly set up a local binding to the this function which is used in 245 // Possibly set up a local binding to the this function which is used in
241 // derived constructors with super calls. 246 // derived constructors with super calls.
242 Variable* this_function_var = scope()->this_function_var(); 247 Variable* this_function_var = scope()->this_function_var();
243 if (this_function_var != nullptr) { 248 if (this_function_var != nullptr) {
244 Comment cmnt(masm_, "[ This function"); 249 Comment cmnt(masm_, "[ This function");
245 if (!function_in_register_x1) { 250 if (!function_in_register_x1) {
246 __ Ldr(x1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); 251 __ Ldr(x1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
247 // The write barrier clobbers register again, keep is marked as such. 252 // The write barrier clobbers register again, keep it marked as such.
248 } 253 }
249 SetVar(this_function_var, x1, x0, x2); 254 SetVar(this_function_var, x1, x0, x2);
250 } 255 }
251 256
252 Variable* new_target_var = scope()->new_target_var(); 257 Variable* new_target_var = scope()->new_target_var();
253 if (new_target_var != nullptr) { 258 if (new_target_var != nullptr) {
254 Comment cmnt(masm_, "[ new.target"); 259 Comment cmnt(masm_, "[ new.target");
255 // Get the frame pointer for the calling frame. 260 // Get the frame pointer for the calling frame.
256 __ Ldr(x2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); 261 __ Ldr(x2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
257 262
258 Label check_frame_marker; 263 Label check_frame_marker;
259 __ Ldr(x1, MemOperand(x2, StandardFrameConstants::kContextOffset)); 264 __ Ldr(x1, MemOperand(x2, StandardFrameConstants::kContextOffset));
260 __ Cmp(x1, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)); 265 __ Cmp(x1, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR));
261 __ B(ne, &check_frame_marker); 266 __ B(ne, &check_frame_marker);
262 __ Ldr(x2, MemOperand(x2, StandardFrameConstants::kCallerFPOffset)); 267 __ Ldr(x2, MemOperand(x2, StandardFrameConstants::kCallerFPOffset));
263 __ Bind(&check_frame_marker); 268 __ Bind(&check_frame_marker);
264 __ Ldr(x1, MemOperand(x2, StandardFrameConstants::kMarkerOffset)); 269 __ Ldr(x1, MemOperand(x2, StandardFrameConstants::kMarkerOffset));
265 __ Cmp(x1, Smi::FromInt(StackFrame::CONSTRUCT)); 270 __ Cmp(x1, Smi::FromInt(StackFrame::CONSTRUCT));
271 function_in_register_x1 = false;
266 272
267 Label non_construct_frame, done; 273 Label non_construct_frame, done;
268 274
269 __ B(ne, &non_construct_frame); 275 __ B(ne, &non_construct_frame);
270 __ Ldr(x0, 276 __ Ldr(x0,
271 MemOperand(x2, ConstructFrameConstants::kOriginalConstructorOffset)); 277 MemOperand(x2, ConstructFrameConstants::kOriginalConstructorOffset));
272 __ B(&done); 278 __ B(&done);
273 279
274 __ Bind(&non_construct_frame); 280 __ Bind(&non_construct_frame);
275 __ LoadRoot(x0, Heap::kUndefinedValueRootIndex); 281 __ LoadRoot(x0, Heap::kUndefinedValueRootIndex);
(...skipping 10 matching lines...) Expand all
286 Comment cmnt(masm_, "[ Allocate rest parameter array"); 292 Comment cmnt(masm_, "[ Allocate rest parameter array");
287 293
288 int num_parameters = info->scope()->num_parameters(); 294 int num_parameters = info->scope()->num_parameters();
289 int offset = num_parameters * kPointerSize; 295 int offset = num_parameters * kPointerSize;
290 296
291 __ Add(x3, fp, StandardFrameConstants::kCallerSPOffset + offset); 297 __ Add(x3, fp, StandardFrameConstants::kCallerSPOffset + offset);
292 __ Mov(x2, Smi::FromInt(num_parameters)); 298 __ Mov(x2, Smi::FromInt(num_parameters));
293 __ Mov(x1, Smi::FromInt(rest_index)); 299 __ Mov(x1, Smi::FromInt(rest_index));
294 __ Mov(x0, Smi::FromInt(language_mode())); 300 __ Mov(x0, Smi::FromInt(language_mode()));
295 __ Push(x3, x2, x1, x0); 301 __ Push(x3, x2, x1, x0);
302 function_in_register_x1 = false;
296 303
297 RestParamAccessStub stub(isolate()); 304 RestParamAccessStub stub(isolate());
298 __ CallStub(&stub); 305 __ CallStub(&stub);
299 306
300 SetVar(rest_param, x0, x1, x2); 307 SetVar(rest_param, x0, x1, x2);
301 } 308 }
302 309
303 Variable* arguments = scope()->arguments(); 310 Variable* arguments = scope()->arguments();
304 if (arguments != NULL) { 311 if (arguments != NULL) {
305 // Function uses arguments object. 312 // Function uses arguments object.
(...skipping 5051 matching lines...) Expand 10 before | Expand all | Expand 10 after
5357 } 5364 }
5358 5365
5359 return INTERRUPT; 5366 return INTERRUPT;
5360 } 5367 }
5361 5368
5362 5369
5363 } // namespace internal 5370 } // namespace internal
5364 } // namespace v8 5371 } // namespace v8
5365 5372
5366 #endif // V8_TARGET_ARCH_ARM64 5373 #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