| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 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 4632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4643 __ vmov(single_scratch, scratch); | 4643 __ vmov(single_scratch, scratch); |
| 4644 } else { | 4644 } else { |
| 4645 __ vmov(single_scratch, ToRegister(input)); | 4645 __ vmov(single_scratch, ToRegister(input)); |
| 4646 } | 4646 } |
| 4647 __ vcvt_f64_s32(ToDoubleRegister(output), single_scratch); | 4647 __ vcvt_f64_s32(ToDoubleRegister(output), single_scratch); |
| 4648 } | 4648 } |
| 4649 | 4649 |
| 4650 | 4650 |
| 4651 void LCodeGen::DoInteger32ToSmi(LInteger32ToSmi* instr) { | 4651 void LCodeGen::DoInteger32ToSmi(LInteger32ToSmi* instr) { |
| 4652 LOperand* input = instr->value(); | 4652 LOperand* input = instr->value(); |
| 4653 ASSERT(input->IsRegister()); | |
| 4654 LOperand* output = instr->result(); | 4653 LOperand* output = instr->result(); |
| 4655 ASSERT(output->IsRegister()); | |
| 4656 __ SmiTag(ToRegister(output), ToRegister(input), SetCC); | 4654 __ SmiTag(ToRegister(output), ToRegister(input), SetCC); |
| 4657 if (!instr->hydrogen()->value()->HasRange() || | 4655 if (!instr->hydrogen()->value()->HasRange() || |
| 4658 !instr->hydrogen()->value()->range()->IsInSmiRange()) { | 4656 !instr->hydrogen()->value()->range()->IsInSmiRange()) { |
| 4659 DeoptimizeIf(vs, instr->environment()); | 4657 DeoptimizeIf(vs, instr->environment()); |
| 4660 } | 4658 } |
| 4661 } | 4659 } |
| 4662 | 4660 |
| 4663 | 4661 |
| 4664 void LCodeGen::DoUint32ToDouble(LUint32ToDouble* instr) { | 4662 void LCodeGen::DoUint32ToDouble(LUint32ToDouble* instr) { |
| 4665 LOperand* input = instr->value(); | 4663 LOperand* input = instr->value(); |
| 4666 LOperand* output = instr->result(); | 4664 LOperand* output = instr->result(); |
| 4667 | 4665 |
| 4668 SwVfpRegister flt_scratch = double_scratch0().low(); | 4666 SwVfpRegister flt_scratch = double_scratch0().low(); |
| 4669 __ vmov(flt_scratch, ToRegister(input)); | 4667 __ vmov(flt_scratch, ToRegister(input)); |
| 4670 __ vcvt_f64_u32(ToDoubleRegister(output), flt_scratch); | 4668 __ vcvt_f64_u32(ToDoubleRegister(output), flt_scratch); |
| 4671 } | 4669 } |
| 4672 | 4670 |
| 4673 | 4671 |
| 4672 void LCodeGen::DoUint32ToSmi(LUint32ToSmi* instr) { |
| 4673 LOperand* input = instr->value(); |
| 4674 LOperand* output = instr->result(); |
| 4675 if (!instr->hydrogen()->value()->HasRange() || |
| 4676 !instr->hydrogen()->value()->range()->IsInSmiRange()) { |
| 4677 __ tst(ToRegister(input), Operand(0xc0000000)); |
| 4678 DeoptimizeIf(ne, instr->environment()); |
| 4679 } |
| 4680 __ SmiTag(ToRegister(output), ToRegister(input)); |
| 4681 } |
| 4682 |
| 4683 |
| 4674 void LCodeGen::DoNumberTagI(LNumberTagI* instr) { | 4684 void LCodeGen::DoNumberTagI(LNumberTagI* instr) { |
| 4675 class DeferredNumberTagI V8_FINAL : public LDeferredCode { | 4685 class DeferredNumberTagI V8_FINAL : public LDeferredCode { |
| 4676 public: | 4686 public: |
| 4677 DeferredNumberTagI(LCodeGen* codegen, LNumberTagI* instr) | 4687 DeferredNumberTagI(LCodeGen* codegen, LNumberTagI* instr) |
| 4678 : LDeferredCode(codegen), instr_(instr) { } | 4688 : LDeferredCode(codegen), instr_(instr) { } |
| 4679 virtual void Generate() V8_OVERRIDE { | 4689 virtual void Generate() V8_OVERRIDE { |
| 4680 codegen()->DoDeferredNumberTagI(instr_, | 4690 codegen()->DoDeferredNumberTagI(instr_, |
| 4681 instr_->value(), | 4691 instr_->value(), |
| 4682 SIGNED_INT32); | 4692 SIGNED_INT32); |
| 4683 } | 4693 } |
| (...skipping 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5816 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5826 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
| 5817 __ ldr(result, FieldMemOperand(scratch, | 5827 __ ldr(result, FieldMemOperand(scratch, |
| 5818 FixedArray::kHeaderSize - kPointerSize)); | 5828 FixedArray::kHeaderSize - kPointerSize)); |
| 5819 __ bind(&done); | 5829 __ bind(&done); |
| 5820 } | 5830 } |
| 5821 | 5831 |
| 5822 | 5832 |
| 5823 #undef __ | 5833 #undef __ |
| 5824 | 5834 |
| 5825 } } // namespace v8::internal | 5835 } } // namespace v8::internal |
| OLD | NEW |