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 4718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4729 __ cvt_d_w(ToDoubleRegister(output), single_scratch); | 4729 __ cvt_d_w(ToDoubleRegister(output), single_scratch); |
4730 } | 4730 } |
4731 | 4731 |
4732 | 4732 |
4733 void LCodeGen::DoUint32ToDouble(LUint32ToDouble* instr) { | 4733 void LCodeGen::DoUint32ToDouble(LUint32ToDouble* instr) { |
4734 LOperand* input = instr->value(); | 4734 LOperand* input = instr->value(); |
4735 LOperand* output = instr->result(); | 4735 LOperand* output = instr->result(); |
4736 | 4736 |
4737 FPURegister dbl_scratch = double_scratch0(); | 4737 FPURegister dbl_scratch = double_scratch0(); |
4738 __ mtc1(ToRegister(input), dbl_scratch); | 4738 __ mtc1(ToRegister(input), dbl_scratch); |
4739 __ Cvt_d_uw(ToDoubleRegister(output), dbl_scratch, f22); // TODO(plind): f22? | 4739 __ Cvt_d_uw(ToDoubleRegister(output), dbl_scratch); |
4740 } | 4740 } |
4741 | 4741 |
4742 | 4742 |
4743 void LCodeGen::DoNumberTagU(LNumberTagU* instr) { | 4743 void LCodeGen::DoNumberTagU(LNumberTagU* instr) { |
4744 class DeferredNumberTagU final : public LDeferredCode { | 4744 class DeferredNumberTagU final : public LDeferredCode { |
4745 public: | 4745 public: |
4746 DeferredNumberTagU(LCodeGen* codegen, LNumberTagU* instr) | 4746 DeferredNumberTagU(LCodeGen* codegen, LNumberTagU* instr) |
4747 : LDeferredCode(codegen), instr_(instr) { } | 4747 : LDeferredCode(codegen), instr_(instr) { } |
4748 void Generate() override { | 4748 void Generate() override { |
4749 codegen()->DoDeferredNumberTagIU(instr_, | 4749 codegen()->DoDeferredNumberTagIU(instr_, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4786 // disagree. Try to allocate a heap number in new space and store | 4786 // disagree. Try to allocate a heap number in new space and store |
4787 // the value in there. If that fails, call the runtime system. | 4787 // the value in there. If that fails, call the runtime system. |
4788 if (dst.is(src)) { | 4788 if (dst.is(src)) { |
4789 __ SmiUntag(src, dst); | 4789 __ SmiUntag(src, dst); |
4790 __ Xor(src, src, Operand(0x80000000)); | 4790 __ Xor(src, src, Operand(0x80000000)); |
4791 } | 4791 } |
4792 __ mtc1(src, dbl_scratch); | 4792 __ mtc1(src, dbl_scratch); |
4793 __ cvt_d_w(dbl_scratch, dbl_scratch); | 4793 __ cvt_d_w(dbl_scratch, dbl_scratch); |
4794 } else { | 4794 } else { |
4795 __ mtc1(src, dbl_scratch); | 4795 __ mtc1(src, dbl_scratch); |
4796 __ Cvt_d_uw(dbl_scratch, dbl_scratch, f22); | 4796 __ Cvt_d_uw(dbl_scratch, dbl_scratch); |
4797 } | 4797 } |
4798 | 4798 |
4799 if (FLAG_inline_new) { | 4799 if (FLAG_inline_new) { |
4800 __ LoadRoot(tmp3, Heap::kHeapNumberMapRootIndex); | 4800 __ LoadRoot(tmp3, Heap::kHeapNumberMapRootIndex); |
4801 __ AllocateHeapNumber(dst, tmp1, tmp2, tmp3, &slow, TAG_RESULT); | 4801 __ AllocateHeapNumber(dst, tmp1, tmp2, tmp3, &slow, TAG_RESULT); |
4802 __ Branch(&done); | 4802 __ Branch(&done); |
4803 } | 4803 } |
4804 | 4804 |
4805 // Slow case: Call the runtime system to do the number allocation. | 4805 // Slow case: Call the runtime system to do the number allocation. |
4806 __ bind(&slow); | 4806 __ bind(&slow); |
(...skipping 1206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6013 __ Push(at, ToRegister(instr->function())); | 6013 __ Push(at, ToRegister(instr->function())); |
6014 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6014 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6015 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6015 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6016 } | 6016 } |
6017 | 6017 |
6018 | 6018 |
6019 #undef __ | 6019 #undef __ |
6020 | 6020 |
6021 } // namespace internal | 6021 } // namespace internal |
6022 } // namespace v8 | 6022 } // namespace v8 |
OLD | NEW |