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