OLD | NEW |
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 #include "src/crankshaft/arm/lithium-codegen-arm.h" | 5 #include "src/crankshaft/arm/lithium-codegen-arm.h" |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/crankshaft/arm/lithium-gap-resolver-arm.h" | 10 #include "src/crankshaft/arm/lithium-gap-resolver-arm.h" |
(...skipping 4464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4475 // Slow case: Call the runtime system to do the number allocation. | 4475 // Slow case: Call the runtime system to do the number allocation. |
4476 __ bind(&slow); | 4476 __ bind(&slow); |
4477 { | 4477 { |
4478 // TODO(3095996): Put a valid pointer value in the stack slot where the | 4478 // TODO(3095996): Put a valid pointer value in the stack slot where the |
4479 // result register is stored, as this register is in the pointer map, but | 4479 // result register is stored, as this register is in the pointer map, but |
4480 // contains an integer value. | 4480 // contains an integer value. |
4481 __ mov(dst, Operand::Zero()); | 4481 __ mov(dst, Operand::Zero()); |
4482 | 4482 |
4483 // Preserve the value of all registers. | 4483 // Preserve the value of all registers. |
4484 PushSafepointRegistersScope scope(this); | 4484 PushSafepointRegistersScope scope(this); |
4485 | 4485 // Reset the context register. |
4486 // NumberTagI and NumberTagD use the context from the frame, rather than | 4486 if (!dst.is(cp)) { |
4487 // the environment's HContext or HInlinedContext value. | 4487 __ mov(cp, Operand::Zero()); |
4488 // They only call Runtime::kAllocateHeapNumber. | 4488 } |
4489 // The corresponding HChange instructions are added in a phase that does | |
4490 // not have easy access to the local context. | |
4491 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | |
4492 __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber); | 4489 __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber); |
4493 RecordSafepointWithRegisters( | 4490 RecordSafepointWithRegisters( |
4494 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); | 4491 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); |
4495 __ StoreToSafepointRegisterSlot(r0, dst); | 4492 __ StoreToSafepointRegisterSlot(r0, dst); |
4496 } | 4493 } |
4497 | 4494 |
4498 // Done. Put the value in dbl_scratch into the value of the allocated heap | 4495 // Done. Put the value in dbl_scratch into the value of the allocated heap |
4499 // number. | 4496 // number. |
4500 __ bind(&done); | 4497 __ bind(&done); |
4501 __ vstr(dbl_scratch, FieldMemOperand(dst, HeapNumber::kValueOffset)); | 4498 __ vstr(dbl_scratch, FieldMemOperand(dst, HeapNumber::kValueOffset)); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4533 | 4530 |
4534 | 4531 |
4535 void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) { | 4532 void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) { |
4536 // TODO(3095996): Get rid of this. For now, we need to make the | 4533 // TODO(3095996): Get rid of this. For now, we need to make the |
4537 // result register contain a valid pointer because it is already | 4534 // result register contain a valid pointer because it is already |
4538 // contained in the register pointer map. | 4535 // contained in the register pointer map. |
4539 Register reg = ToRegister(instr->result()); | 4536 Register reg = ToRegister(instr->result()); |
4540 __ mov(reg, Operand::Zero()); | 4537 __ mov(reg, Operand::Zero()); |
4541 | 4538 |
4542 PushSafepointRegistersScope scope(this); | 4539 PushSafepointRegistersScope scope(this); |
4543 // NumberTagI and NumberTagD use the context from the frame, rather than | 4540 // Reset the context register. |
4544 // the environment's HContext or HInlinedContext value. | 4541 if (!reg.is(cp)) { |
4545 // They only call Runtime::kAllocateHeapNumber. | 4542 __ mov(cp, Operand::Zero()); |
4546 // The corresponding HChange instructions are added in a phase that does | 4543 } |
4547 // not have easy access to the local context. | |
4548 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | |
4549 __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber); | 4544 __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber); |
4550 RecordSafepointWithRegisters( | 4545 RecordSafepointWithRegisters( |
4551 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); | 4546 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); |
4552 __ StoreToSafepointRegisterSlot(r0, reg); | 4547 __ StoreToSafepointRegisterSlot(r0, reg); |
4553 } | 4548 } |
4554 | 4549 |
4555 | 4550 |
4556 void LCodeGen::DoSmiTag(LSmiTag* instr) { | 4551 void LCodeGen::DoSmiTag(LSmiTag* instr) { |
4557 HChange* hchange = instr->hydrogen(); | 4552 HChange* hchange = instr->hydrogen(); |
4558 Register input = ToRegister(instr->value()); | 4553 Register input = ToRegister(instr->value()); |
(...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5534 __ ldr(result, FieldMemOperand(scratch, | 5529 __ ldr(result, FieldMemOperand(scratch, |
5535 FixedArray::kHeaderSize - kPointerSize)); | 5530 FixedArray::kHeaderSize - kPointerSize)); |
5536 __ bind(deferred->exit()); | 5531 __ bind(deferred->exit()); |
5537 __ bind(&done); | 5532 __ bind(&done); |
5538 } | 5533 } |
5539 | 5534 |
5540 #undef __ | 5535 #undef __ |
5541 | 5536 |
5542 } // namespace internal | 5537 } // namespace internal |
5543 } // namespace v8 | 5538 } // namespace v8 |
OLD | NEW |