| 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 4489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4500 __ mtc1(ToRegister(input), single_scratch); | 4500 __ mtc1(ToRegister(input), single_scratch); |
| 4501 } | 4501 } |
| 4502 __ cvt_d_w(ToDoubleRegister(output), single_scratch); | 4502 __ cvt_d_w(ToDoubleRegister(output), single_scratch); |
| 4503 } | 4503 } |
| 4504 | 4504 |
| 4505 | 4505 |
| 4506 void LCodeGen::DoUint32ToDouble(LUint32ToDouble* instr) { | 4506 void LCodeGen::DoUint32ToDouble(LUint32ToDouble* instr) { |
| 4507 LOperand* input = instr->value(); | 4507 LOperand* input = instr->value(); |
| 4508 LOperand* output = instr->result(); | 4508 LOperand* output = instr->result(); |
| 4509 | 4509 |
| 4510 FPURegister dbl_scratch = double_scratch0(); | 4510 __ Cvt_d_uw(ToDoubleRegister(output), ToRegister(input), f22); |
| 4511 __ mtc1(ToRegister(input), dbl_scratch); | |
| 4512 __ Cvt_d_uw(ToDoubleRegister(output), dbl_scratch, f22); | |
| 4513 } | 4511 } |
| 4514 | 4512 |
| 4515 | 4513 |
| 4516 void LCodeGen::DoNumberTagI(LNumberTagI* instr) { | 4514 void LCodeGen::DoNumberTagI(LNumberTagI* instr) { |
| 4517 class DeferredNumberTagI final : public LDeferredCode { | 4515 class DeferredNumberTagI final : public LDeferredCode { |
| 4518 public: | 4516 public: |
| 4519 DeferredNumberTagI(LCodeGen* codegen, LNumberTagI* instr) | 4517 DeferredNumberTagI(LCodeGen* codegen, LNumberTagI* instr) |
| 4520 : LDeferredCode(codegen), instr_(instr) { } | 4518 : LDeferredCode(codegen), instr_(instr) { } |
| 4521 void Generate() override { | 4519 void Generate() override { |
| 4522 codegen()->DoDeferredNumberTagIU(instr_, | 4520 codegen()->DoDeferredNumberTagIU(instr_, |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4587 // There was overflow, so bits 30 and 31 of the original integer | 4585 // There was overflow, so bits 30 and 31 of the original integer |
| 4588 // disagree. Try to allocate a heap number in new space and store | 4586 // disagree. Try to allocate a heap number in new space and store |
| 4589 // the value in there. If that fails, call the runtime system. | 4587 // the value in there. If that fails, call the runtime system. |
| 4590 if (dst.is(src)) { | 4588 if (dst.is(src)) { |
| 4591 __ SmiUntag(src, dst); | 4589 __ SmiUntag(src, dst); |
| 4592 __ Xor(src, src, Operand(0x80000000)); | 4590 __ Xor(src, src, Operand(0x80000000)); |
| 4593 } | 4591 } |
| 4594 __ mtc1(src, dbl_scratch); | 4592 __ mtc1(src, dbl_scratch); |
| 4595 __ cvt_d_w(dbl_scratch, dbl_scratch); | 4593 __ cvt_d_w(dbl_scratch, dbl_scratch); |
| 4596 } else { | 4594 } else { |
| 4597 __ mtc1(src, dbl_scratch); | 4595 __ Cvt_d_uw(dbl_scratch, src, f22); |
| 4598 __ Cvt_d_uw(dbl_scratch, dbl_scratch, f22); | |
| 4599 } | 4596 } |
| 4600 | 4597 |
| 4601 if (FLAG_inline_new) { | 4598 if (FLAG_inline_new) { |
| 4602 __ LoadRoot(tmp3, Heap::kHeapNumberMapRootIndex); | 4599 __ LoadRoot(tmp3, Heap::kHeapNumberMapRootIndex); |
| 4603 __ AllocateHeapNumber(dst, tmp1, tmp2, tmp3, &slow, DONT_TAG_RESULT); | 4600 __ AllocateHeapNumber(dst, tmp1, tmp2, tmp3, &slow, DONT_TAG_RESULT); |
| 4604 __ Branch(&done); | 4601 __ Branch(&done); |
| 4605 } | 4602 } |
| 4606 | 4603 |
| 4607 // Slow case: Call the runtime system to do the number allocation. | 4604 // Slow case: Call the runtime system to do the number allocation. |
| 4608 __ bind(&slow); | 4605 __ bind(&slow); |
| (...skipping 1156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5765 __ Push(at, ToRegister(instr->function())); | 5762 __ Push(at, ToRegister(instr->function())); |
| 5766 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5763 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 5767 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5764 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5768 } | 5765 } |
| 5769 | 5766 |
| 5770 | 5767 |
| 5771 #undef __ | 5768 #undef __ |
| 5772 | 5769 |
| 5773 } // namespace internal | 5770 } // namespace internal |
| 5774 } // namespace v8 | 5771 } // namespace v8 |
| OLD | NEW |