| OLD | NEW |
| 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 Loading... |
| 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 if (instr->arity() > 0) { |
| 368 // We only need the allocation site for the case we have a length argument. | 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 | 369 // The case may bail out to the runtime, which will determine the correct |
| 370 // elements kind with the site. | 370 // elements kind with the site. |
| 371 __ Mov(x2, instr->hydrogen()->site()); | 371 __ Mov(x2, instr->hydrogen()->site()); |
| 372 } else { | 372 } else { |
| 373 __ LoadRoot(x2, Heap::kUndefinedValueRootIndex); | 373 __ LoadRoot(x2, Heap::kUndefinedValueRootIndex); |
| 374 } | 374 } |
| 375 | 375 |
| 376 | 376 |
| 377 ElementsKind kind = instr->hydrogen()->elements_kind(); | 377 ElementsKind kind = instr->hydrogen()->elements_kind(); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 398 override_mode); | 398 override_mode); |
| 399 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 399 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 400 __ B(&done); | 400 __ B(&done); |
| 401 __ Bind(&packed_case); | 401 __ Bind(&packed_case); |
| 402 } | 402 } |
| 403 | 403 |
| 404 ArraySingleArgumentConstructorStub stub(isolate(), kind, override_mode); | 404 ArraySingleArgumentConstructorStub stub(isolate(), kind, override_mode); |
| 405 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 405 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 406 __ Bind(&done); | 406 __ Bind(&done); |
| 407 } else { | 407 } else { |
| 408 ArrayNArgumentsConstructorStub stub(isolate(), kind, override_mode); | 408 ArrayNArgumentsConstructorStub stub(isolate()); |
| 409 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 409 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 410 } | 410 } |
| 411 RecordPushedArgumentsDelta(instr->hydrogen()->argument_delta()); | 411 RecordPushedArgumentsDelta(instr->hydrogen()->argument_delta()); |
| 412 | 412 |
| 413 DCHECK(ToRegister(instr->result()).is(x0)); | 413 DCHECK(ToRegister(instr->result()).is(x0)); |
| 414 } | 414 } |
| 415 | 415 |
| 416 | 416 |
| 417 void LCodeGen::CallRuntime(const Runtime::Function* function, | 417 void LCodeGen::CallRuntime(const Runtime::Function* function, |
| 418 int num_arguments, | 418 int num_arguments, |
| (...skipping 5331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5750 // Index is equal to negated out of object property index plus 1. | 5750 // Index is equal to negated out of object property index plus 1. |
| 5751 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); | 5751 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
| 5752 __ Ldr(result, FieldMemOperand(result, | 5752 __ Ldr(result, FieldMemOperand(result, |
| 5753 FixedArray::kHeaderSize - kPointerSize)); | 5753 FixedArray::kHeaderSize - kPointerSize)); |
| 5754 __ Bind(deferred->exit()); | 5754 __ Bind(deferred->exit()); |
| 5755 __ Bind(&done); | 5755 __ Bind(&done); |
| 5756 } | 5756 } |
| 5757 | 5757 |
| 5758 } // namespace internal | 5758 } // namespace internal |
| 5759 } // namespace v8 | 5759 } // namespace v8 |
| OLD | NEW |