| 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 3597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3608 | 3608 |
| 3609 | 3609 |
| 3610 void LCodeGen::DoStoreKeyedFastDoubleElement( | 3610 void LCodeGen::DoStoreKeyedFastDoubleElement( |
| 3611 LStoreKeyedFastDoubleElement* instr) { | 3611 LStoreKeyedFastDoubleElement* instr) { |
| 3612 DwVfpRegister value = ToDoubleRegister(instr->value()); | 3612 DwVfpRegister value = ToDoubleRegister(instr->value()); |
| 3613 Register elements = ToRegister(instr->elements()); | 3613 Register elements = ToRegister(instr->elements()); |
| 3614 Register key = no_reg; | 3614 Register key = no_reg; |
| 3615 Register scratch = scratch0(); | 3615 Register scratch = scratch0(); |
| 3616 bool key_is_constant = instr->key()->IsConstantOperand(); | 3616 bool key_is_constant = instr->key()->IsConstantOperand(); |
| 3617 int constant_key = 0; | 3617 int constant_key = 0; |
| 3618 Label not_nan; | |
| 3619 | 3618 |
| 3620 // Calculate the effective address of the slot in the array to store the | 3619 // Calculate the effective address of the slot in the array to store the |
| 3621 // double value. | 3620 // double value. |
| 3622 if (key_is_constant) { | 3621 if (key_is_constant) { |
| 3623 constant_key = ToInteger32(LConstantOperand::cast(instr->key())); | 3622 constant_key = ToInteger32(LConstantOperand::cast(instr->key())); |
| 3624 if (constant_key & 0xF0000000) { | 3623 if (constant_key & 0xF0000000) { |
| 3625 Abort("array index constant value too big."); | 3624 Abort("array index constant value too big."); |
| 3626 } | 3625 } |
| 3627 } else { | 3626 } else { |
| 3628 key = ToRegister(instr->key()); | 3627 key = ToRegister(instr->key()); |
| 3629 } | 3628 } |
| 3630 int shift_size = ElementsKindToShiftSize(FAST_DOUBLE_ELEMENTS); | 3629 int shift_size = ElementsKindToShiftSize(FAST_DOUBLE_ELEMENTS); |
| 3631 Operand operand = key_is_constant | 3630 Operand operand = key_is_constant |
| 3632 ? Operand(constant_key * (1 << shift_size) + | 3631 ? Operand(constant_key * (1 << shift_size) + |
| 3633 FixedDoubleArray::kHeaderSize - kHeapObjectTag) | 3632 FixedDoubleArray::kHeaderSize - kHeapObjectTag) |
| 3634 : Operand(key, LSL, shift_size); | 3633 : Operand(key, LSL, shift_size); |
| 3635 __ add(scratch, elements, operand); | 3634 __ add(scratch, elements, operand); |
| 3636 if (!key_is_constant) { | 3635 if (!key_is_constant) { |
| 3637 __ add(scratch, scratch, | 3636 __ add(scratch, scratch, |
| 3638 Operand(FixedDoubleArray::kHeaderSize - kHeapObjectTag)); | 3637 Operand(FixedDoubleArray::kHeaderSize - kHeapObjectTag)); |
| 3639 } | 3638 } |
| 3640 | 3639 |
| 3641 // Check for NaN. All NaNs must be canonicalized. | 3640 if (instr->NeedsCanonicalization()) { |
| 3642 __ VFPCompareAndSetFlags(value, value); | 3641 // Check for NaN. All NaNs must be canonicalized. |
| 3642 __ VFPCompareAndSetFlags(value, value); |
| 3643 // Only load canonical NaN if the comparison above set the overflow. |
| 3644 __ Vmov(value, |
| 3645 FixedDoubleArray::canonical_not_the_hole_nan_as_double(), |
| 3646 vs); |
| 3647 } |
| 3643 | 3648 |
| 3644 // Only load canonical NaN if the comparison above set the overflow. | |
| 3645 __ Vmov(value, FixedDoubleArray::canonical_not_the_hole_nan_as_double(), vs); | |
| 3646 | |
| 3647 __ bind(¬_nan); | |
| 3648 __ vstr(value, scratch, 0); | 3649 __ vstr(value, scratch, 0); |
| 3649 } | 3650 } |
| 3650 | 3651 |
| 3651 | 3652 |
| 3652 void LCodeGen::DoStoreKeyedSpecializedArrayElement( | 3653 void LCodeGen::DoStoreKeyedSpecializedArrayElement( |
| 3653 LStoreKeyedSpecializedArrayElement* instr) { | 3654 LStoreKeyedSpecializedArrayElement* instr) { |
| 3654 | 3655 |
| 3655 Register external_pointer = ToRegister(instr->external_pointer()); | 3656 Register external_pointer = ToRegister(instr->external_pointer()); |
| 3656 Register key = no_reg; | 3657 Register key = no_reg; |
| 3657 ElementsKind elements_kind = instr->elements_kind(); | 3658 ElementsKind elements_kind = instr->elements_kind(); |
| (...skipping 1487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5145 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); | 5146 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); |
| 5146 __ ldr(result, FieldMemOperand(scratch, | 5147 __ ldr(result, FieldMemOperand(scratch, |
| 5147 FixedArray::kHeaderSize - kPointerSize)); | 5148 FixedArray::kHeaderSize - kPointerSize)); |
| 5148 __ bind(&done); | 5149 __ bind(&done); |
| 5149 } | 5150 } |
| 5150 | 5151 |
| 5151 | 5152 |
| 5152 #undef __ | 5153 #undef __ |
| 5153 | 5154 |
| 5154 } } // namespace v8::internal | 5155 } } // namespace v8::internal |
| OLD | NEW |