| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 1 // Copyright 2012 the V8 project authors. All rights reserved.7 |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 4502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4513 __ mtc1(ToRegister(input), single_scratch); | 4513 __ mtc1(ToRegister(input), single_scratch); |
| 4514 } | 4514 } |
| 4515 __ cvt_d_w(ToDoubleRegister(output), single_scratch); | 4515 __ cvt_d_w(ToDoubleRegister(output), single_scratch); |
| 4516 } | 4516 } |
| 4517 | 4517 |
| 4518 | 4518 |
| 4519 void LCodeGen::DoUint32ToDouble(LUint32ToDouble* instr) { | 4519 void LCodeGen::DoUint32ToDouble(LUint32ToDouble* instr) { |
| 4520 LOperand* input = instr->value(); | 4520 LOperand* input = instr->value(); |
| 4521 LOperand* output = instr->result(); | 4521 LOperand* output = instr->result(); |
| 4522 | 4522 |
| 4523 FPURegister dbl_scratch = double_scratch0(); | 4523 __ Cvt_d_uw(ToDoubleRegister(output), ToRegister(input), f22); |
| 4524 __ mtc1(ToRegister(input), dbl_scratch); | |
| 4525 __ Cvt_d_uw(ToDoubleRegister(output), dbl_scratch, f22); | |
| 4526 } | 4524 } |
| 4527 | 4525 |
| 4528 | 4526 |
| 4529 void LCodeGen::DoNumberTagI(LNumberTagI* instr) { | 4527 void LCodeGen::DoNumberTagI(LNumberTagI* instr) { |
| 4530 class DeferredNumberTagI final : public LDeferredCode { | 4528 class DeferredNumberTagI final : public LDeferredCode { |
| 4531 public: | 4529 public: |
| 4532 DeferredNumberTagI(LCodeGen* codegen, LNumberTagI* instr) | 4530 DeferredNumberTagI(LCodeGen* codegen, LNumberTagI* instr) |
| 4533 : LDeferredCode(codegen), instr_(instr) { } | 4531 : LDeferredCode(codegen), instr_(instr) { } |
| 4534 void Generate() override { | 4532 void Generate() override { |
| 4535 codegen()->DoDeferredNumberTagIU(instr_, | 4533 codegen()->DoDeferredNumberTagIU(instr_, |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4600 // There was overflow, so bits 30 and 31 of the original integer | 4598 // There was overflow, so bits 30 and 31 of the original integer |
| 4601 // disagree. Try to allocate a heap number in new space and store | 4599 // disagree. Try to allocate a heap number in new space and store |
| 4602 // the value in there. If that fails, call the runtime system. | 4600 // the value in there. If that fails, call the runtime system. |
| 4603 if (dst.is(src)) { | 4601 if (dst.is(src)) { |
| 4604 __ SmiUntag(src, dst); | 4602 __ SmiUntag(src, dst); |
| 4605 __ Xor(src, src, Operand(0x80000000)); | 4603 __ Xor(src, src, Operand(0x80000000)); |
| 4606 } | 4604 } |
| 4607 __ mtc1(src, dbl_scratch); | 4605 __ mtc1(src, dbl_scratch); |
| 4608 __ cvt_d_w(dbl_scratch, dbl_scratch); | 4606 __ cvt_d_w(dbl_scratch, dbl_scratch); |
| 4609 } else { | 4607 } else { |
| 4610 __ mtc1(src, dbl_scratch); | 4608 __ Cvt_d_uw(dbl_scratch, src, f22); |
| 4611 __ Cvt_d_uw(dbl_scratch, dbl_scratch, f22); | |
| 4612 } | 4609 } |
| 4613 | 4610 |
| 4614 if (FLAG_inline_new) { | 4611 if (FLAG_inline_new) { |
| 4615 __ LoadRoot(tmp3, Heap::kHeapNumberMapRootIndex); | 4612 __ LoadRoot(tmp3, Heap::kHeapNumberMapRootIndex); |
| 4616 __ AllocateHeapNumber(dst, tmp1, tmp2, tmp3, &slow, DONT_TAG_RESULT); | 4613 __ AllocateHeapNumber(dst, tmp1, tmp2, tmp3, &slow, DONT_TAG_RESULT); |
| 4617 __ Branch(&done); | 4614 __ Branch(&done); |
| 4618 } | 4615 } |
| 4619 | 4616 |
| 4620 // Slow case: Call the runtime system to do the number allocation. | 4617 // Slow case: Call the runtime system to do the number allocation. |
| 4621 __ bind(&slow); | 4618 __ bind(&slow); |
| (...skipping 1209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5831 __ Push(at, ToRegister(instr->function())); | 5828 __ Push(at, ToRegister(instr->function())); |
| 5832 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5829 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 5833 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5830 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5834 } | 5831 } |
| 5835 | 5832 |
| 5836 | 5833 |
| 5837 #undef __ | 5834 #undef __ |
| 5838 | 5835 |
| 5839 } // namespace internal | 5836 } // namespace internal |
| 5840 } // namespace v8 | 5837 } // namespace v8 |
| OLD | NEW |