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 4621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4632 __ vmov(single_scratch, scratch); | 4632 __ vmov(single_scratch, scratch); |
4633 } else { | 4633 } else { |
4634 __ vmov(single_scratch, ToRegister(input)); | 4634 __ vmov(single_scratch, ToRegister(input)); |
4635 } | 4635 } |
4636 __ vcvt_f64_s32(ToDoubleRegister(output), single_scratch); | 4636 __ vcvt_f64_s32(ToDoubleRegister(output), single_scratch); |
4637 } | 4637 } |
4638 | 4638 |
4639 | 4639 |
4640 void LCodeGen::DoInteger32ToSmi(LInteger32ToSmi* instr) { | 4640 void LCodeGen::DoInteger32ToSmi(LInteger32ToSmi* instr) { |
4641 LOperand* input = instr->value(); | 4641 LOperand* input = instr->value(); |
4642 ASSERT(input->IsRegister()); | |
4643 LOperand* output = instr->result(); | 4642 LOperand* output = instr->result(); |
4644 ASSERT(output->IsRegister()); | |
4645 __ SmiTag(ToRegister(output), ToRegister(input), SetCC); | 4643 __ SmiTag(ToRegister(output), ToRegister(input), SetCC); |
4646 if (!instr->hydrogen()->value()->HasRange() || | 4644 if (!instr->hydrogen()->value()->HasRange() || |
4647 !instr->hydrogen()->value()->range()->IsInSmiRange()) { | 4645 !instr->hydrogen()->value()->range()->IsInSmiRange()) { |
4648 DeoptimizeIf(vs, instr->environment()); | 4646 DeoptimizeIf(vs, instr->environment()); |
4649 } | 4647 } |
4650 } | 4648 } |
4651 | 4649 |
4652 | 4650 |
4653 void LCodeGen::DoUint32ToDouble(LUint32ToDouble* instr) { | 4651 void LCodeGen::DoUint32ToDouble(LUint32ToDouble* instr) { |
4654 LOperand* input = instr->value(); | 4652 LOperand* input = instr->value(); |
4655 LOperand* output = instr->result(); | 4653 LOperand* output = instr->result(); |
4656 | 4654 |
4657 SwVfpRegister flt_scratch = double_scratch0().low(); | 4655 SwVfpRegister flt_scratch = double_scratch0().low(); |
4658 __ vmov(flt_scratch, ToRegister(input)); | 4656 __ vmov(flt_scratch, ToRegister(input)); |
4659 __ vcvt_f64_u32(ToDoubleRegister(output), flt_scratch); | 4657 __ vcvt_f64_u32(ToDoubleRegister(output), flt_scratch); |
4660 } | 4658 } |
4661 | 4659 |
4662 | 4660 |
| 4661 void LCodeGen::DoUint32ToSmi(LUint32ToSmi* instr) { |
| 4662 LOperand* input = instr->value(); |
| 4663 LOperand* output = instr->result(); |
| 4664 if (!instr->hydrogen()->value()->HasRange() || |
| 4665 !instr->hydrogen()->value()->range()->IsInSmiRange()) { |
| 4666 __ tst(ToRegister(input), Operand(0xc0000000)); |
| 4667 DeoptimizeIf(ne, instr->environment()); |
| 4668 } |
| 4669 __ SmiTag(ToRegister(output), ToRegister(input)); |
| 4670 } |
| 4671 |
| 4672 |
4663 void LCodeGen::DoNumberTagI(LNumberTagI* instr) { | 4673 void LCodeGen::DoNumberTagI(LNumberTagI* instr) { |
4664 class DeferredNumberTagI: public LDeferredCode { | 4674 class DeferredNumberTagI: public LDeferredCode { |
4665 public: | 4675 public: |
4666 DeferredNumberTagI(LCodeGen* codegen, LNumberTagI* instr) | 4676 DeferredNumberTagI(LCodeGen* codegen, LNumberTagI* instr) |
4667 : LDeferredCode(codegen), instr_(instr) { } | 4677 : LDeferredCode(codegen), instr_(instr) { } |
4668 virtual void Generate() { | 4678 virtual void Generate() { |
4669 codegen()->DoDeferredNumberTagI(instr_, | 4679 codegen()->DoDeferredNumberTagI(instr_, |
4670 instr_->value(), | 4680 instr_->value(), |
4671 SIGNED_INT32); | 4681 SIGNED_INT32); |
4672 } | 4682 } |
(...skipping 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5776 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5786 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
5777 __ ldr(result, FieldMemOperand(scratch, | 5787 __ ldr(result, FieldMemOperand(scratch, |
5778 FixedArray::kHeaderSize - kPointerSize)); | 5788 FixedArray::kHeaderSize - kPointerSize)); |
5779 __ bind(&done); | 5789 __ bind(&done); |
5780 } | 5790 } |
5781 | 5791 |
5782 | 5792 |
5783 #undef __ | 5793 #undef __ |
5784 | 5794 |
5785 } } // namespace v8::internal | 5795 } } // namespace v8::internal |
OLD | NEW |