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

Side by Side Diff: src/crankshaft/arm64/lithium-codegen-arm64.cc

Issue 2024253002: [stubs] Remove N-argument Hydrogen-based Array constructor stub (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix arm64 Created 4 years, 6 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 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 #include "src/crankshaft/arm64/lithium-codegen-arm64.h" 5 #include "src/crankshaft/arm64/lithium-codegen-arm64.h"
6 6
7 #include "src/arm64/frames-arm64.h" 7 #include "src/arm64/frames-arm64.h"
8 #include "src/base/bits.h" 8 #include "src/base/bits.h"
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 } 357 }
358 } 358 }
359 359
360 360
361 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { 361 void LCodeGen::DoCallNewArray(LCallNewArray* instr) {
362 DCHECK(instr->IsMarkedAsCall()); 362 DCHECK(instr->IsMarkedAsCall());
363 DCHECK(ToRegister(instr->context()).is(cp)); 363 DCHECK(ToRegister(instr->context()).is(cp));
364 DCHECK(ToRegister(instr->constructor()).is(x1)); 364 DCHECK(ToRegister(instr->constructor()).is(x1));
365 365
366 __ Mov(x0, Operand(instr->arity())); 366 __ Mov(x0, Operand(instr->arity()));
367 if (instr->arity() == 1) { 367 __ Mov(x2, instr->hydrogen()->site());
368 // We only need the allocation site for the case we have a length argument.
369 // The case may bail out to the runtime, which will determine the correct
370 // elements kind with the site.
371 __ Mov(x2, instr->hydrogen()->site());
372 } else {
373 __ LoadRoot(x2, Heap::kUndefinedValueRootIndex);
374 }
375
376 368
377 ElementsKind kind = instr->hydrogen()->elements_kind(); 369 ElementsKind kind = instr->hydrogen()->elements_kind();
378 AllocationSiteOverrideMode override_mode = 370 AllocationSiteOverrideMode override_mode =
379 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) 371 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE)
380 ? DISABLE_ALLOCATION_SITES 372 ? DISABLE_ALLOCATION_SITES
381 : DONT_OVERRIDE; 373 : DONT_OVERRIDE;
382 374
383 if (instr->arity() == 0) { 375 if (instr->arity() == 0) {
384 ArrayNoArgumentConstructorStub stub(isolate(), kind, override_mode); 376 ArrayNoArgumentConstructorStub stub(isolate(), kind, override_mode);
385 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); 377 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
(...skipping 12 matching lines...) Expand all
398 override_mode); 390 override_mode);
399 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); 391 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
400 __ B(&done); 392 __ B(&done);
401 __ Bind(&packed_case); 393 __ Bind(&packed_case);
402 } 394 }
403 395
404 ArraySingleArgumentConstructorStub stub(isolate(), kind, override_mode); 396 ArraySingleArgumentConstructorStub stub(isolate(), kind, override_mode);
405 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); 397 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
406 __ Bind(&done); 398 __ Bind(&done);
407 } else { 399 } else {
408 ArrayNArgumentsConstructorStub stub(isolate(), kind, override_mode); 400 ArrayNArgumentsConstructorStub stub(isolate());
409 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); 401 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
410 } 402 }
411 RecordPushedArgumentsDelta(instr->hydrogen()->argument_delta()); 403 RecordPushedArgumentsDelta(instr->hydrogen()->argument_delta());
412 404
413 DCHECK(ToRegister(instr->result()).is(x0)); 405 DCHECK(ToRegister(instr->result()).is(x0));
414 } 406 }
415 407
416 408
417 void LCodeGen::CallRuntime(const Runtime::Function* function, 409 void LCodeGen::CallRuntime(const Runtime::Function* function,
418 int num_arguments, 410 int num_arguments,
(...skipping 5331 matching lines...) Expand 10 before | Expand all | Expand 10 after
5750 // Index is equal to negated out of object property index plus 1. 5742 // Index is equal to negated out of object property index plus 1.
5751 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); 5743 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2));
5752 __ Ldr(result, FieldMemOperand(result, 5744 __ Ldr(result, FieldMemOperand(result,
5753 FixedArray::kHeaderSize - kPointerSize)); 5745 FixedArray::kHeaderSize - kPointerSize));
5754 __ Bind(deferred->exit()); 5746 __ Bind(deferred->exit());
5755 __ Bind(&done); 5747 __ Bind(&done);
5756 } 5748 }
5757 5749
5758 } // namespace internal 5750 } // namespace internal
5759 } // namespace v8 5751 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698