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/mips64/lithium-codegen-mips64.h" | 5 #include "src/crankshaft/mips64/lithium-codegen-mips64.h" |
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/crankshaft/hydrogen-osr.h" | 9 #include "src/crankshaft/hydrogen-osr.h" |
10 #include "src/crankshaft/mips64/lithium-gap-resolver-mips64.h" | 10 #include "src/crankshaft/mips64/lithium-gap-resolver-mips64.h" |
(...skipping 4608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4619 | 4619 |
4620 // Slow case: Call the runtime system to do the number allocation. | 4620 // Slow case: Call the runtime system to do the number allocation. |
4621 __ bind(&slow); | 4621 __ bind(&slow); |
4622 { | 4622 { |
4623 // TODO(3095996): Put a valid pointer value in the stack slot where the | 4623 // TODO(3095996): Put a valid pointer value in the stack slot where the |
4624 // result register is stored, as this register is in the pointer map, but | 4624 // result register is stored, as this register is in the pointer map, but |
4625 // contains an integer value. | 4625 // contains an integer value. |
4626 __ mov(dst, zero_reg); | 4626 __ mov(dst, zero_reg); |
4627 // Preserve the value of all registers. | 4627 // Preserve the value of all registers. |
4628 PushSafepointRegistersScope scope(this); | 4628 PushSafepointRegistersScope scope(this); |
4629 | 4629 // Reset the context register. |
4630 // NumberTagI and NumberTagD use the context from the frame, rather than | 4630 if (!dst.is(cp)) { |
4631 // the environment's HContext or HInlinedContext value. | 4631 __ mov(cp, zero_reg); |
4632 // They only call Runtime::kAllocateHeapNumber. | 4632 } |
4633 // The corresponding HChange instructions are added in a phase that does | |
4634 // not have easy access to the local context. | |
4635 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | |
4636 __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber); | 4633 __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber); |
4637 RecordSafepointWithRegisters( | 4634 RecordSafepointWithRegisters( |
4638 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); | 4635 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); |
4639 __ StoreToSafepointRegisterSlot(v0, dst); | 4636 __ StoreToSafepointRegisterSlot(v0, dst); |
4640 } | 4637 } |
4641 | 4638 |
4642 // Done. Put the value in dbl_scratch into the value of the allocated heap | 4639 // Done. Put the value in dbl_scratch into the value of the allocated heap |
4643 // number. | 4640 // number. |
4644 __ bind(&done); | 4641 __ bind(&done); |
4645 __ sdc1(dbl_scratch, FieldMemOperand(dst, HeapNumber::kValueOffset)); | 4642 __ sdc1(dbl_scratch, FieldMemOperand(dst, HeapNumber::kValueOffset)); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4678 | 4675 |
4679 | 4676 |
4680 void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) { | 4677 void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) { |
4681 // TODO(3095996): Get rid of this. For now, we need to make the | 4678 // TODO(3095996): Get rid of this. For now, we need to make the |
4682 // result register contain a valid pointer because it is already | 4679 // result register contain a valid pointer because it is already |
4683 // contained in the register pointer map. | 4680 // contained in the register pointer map. |
4684 Register reg = ToRegister(instr->result()); | 4681 Register reg = ToRegister(instr->result()); |
4685 __ mov(reg, zero_reg); | 4682 __ mov(reg, zero_reg); |
4686 | 4683 |
4687 PushSafepointRegistersScope scope(this); | 4684 PushSafepointRegistersScope scope(this); |
4688 // NumberTagI and NumberTagD use the context from the frame, rather than | 4685 // Reset the context register. |
4689 // the environment's HContext or HInlinedContext value. | 4686 if (!reg.is(cp)) { |
4690 // They only call Runtime::kAllocateHeapNumber. | 4687 __ mov(cp, zero_reg); |
4691 // The corresponding HChange instructions are added in a phase that does | 4688 } |
4692 // not have easy access to the local context. | |
4693 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | |
4694 __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber); | 4689 __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber); |
4695 RecordSafepointWithRegisters( | 4690 RecordSafepointWithRegisters( |
4696 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); | 4691 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); |
4697 __ StoreToSafepointRegisterSlot(v0, reg); | 4692 __ StoreToSafepointRegisterSlot(v0, reg); |
4698 } | 4693 } |
4699 | 4694 |
4700 | 4695 |
4701 void LCodeGen::DoSmiTag(LSmiTag* instr) { | 4696 void LCodeGen::DoSmiTag(LSmiTag* instr) { |
4702 HChange* hchange = instr->hydrogen(); | 4697 HChange* hchange = instr->hydrogen(); |
4703 Register input = ToRegister(instr->value()); | 4698 Register input = ToRegister(instr->value()); |
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5734 __ ld(result, FieldMemOperand(scratch, | 5729 __ ld(result, FieldMemOperand(scratch, |
5735 FixedArray::kHeaderSize - kPointerSize)); | 5730 FixedArray::kHeaderSize - kPointerSize)); |
5736 __ bind(deferred->exit()); | 5731 __ bind(deferred->exit()); |
5737 __ bind(&done); | 5732 __ bind(&done); |
5738 } | 5733 } |
5739 | 5734 |
5740 #undef __ | 5735 #undef __ |
5741 | 5736 |
5742 } // namespace internal | 5737 } // namespace internal |
5743 } // namespace v8 | 5738 } // namespace v8 |
OLD | NEW |