| 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 2757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2768 Register result = ToRegister(instr->result()); | 2768 Register result = ToRegister(instr->result()); |
| 2769 // There are two words between the frame pointer and the last argument. | 2769 // There are two words between the frame pointer and the last argument. |
| 2770 // Subtracting from length accounts for one of them add one more. | 2770 // Subtracting from length accounts for one of them add one more. |
| 2771 __ sub(length, index); | 2771 __ sub(length, index); |
| 2772 __ mov(result, Operand(arguments, length, times_4, kPointerSize)); | 2772 __ mov(result, Operand(arguments, length, times_4, kPointerSize)); |
| 2773 } | 2773 } |
| 2774 | 2774 |
| 2775 | 2775 |
| 2776 void LCodeGen::DoLoadKeyedExternalArray(LLoadKeyed* instr) { | 2776 void LCodeGen::DoLoadKeyedExternalArray(LLoadKeyed* instr) { |
| 2777 ElementsKind elements_kind = instr->elements_kind(); | 2777 ElementsKind elements_kind = instr->elements_kind(); |
| 2778 if (ExternalArrayOpRequiresTemp<HLoadKeyed>(instr->hydrogen())) { | 2778 LOperand* key = instr->key(); |
| 2779 __ SmiUntag(ToRegister(instr->key())); | 2779 if (!key->IsConstantOperand() && |
| 2780 ExternalArrayOpRequiresTemp(instr->hydrogen()->key()->representation(), |
| 2781 elements_kind)) { |
| 2782 __ SmiUntag(ToRegister(key)); |
| 2780 } | 2783 } |
| 2781 Operand operand(BuildFastArrayOperand( | 2784 Operand operand(BuildFastArrayOperand( |
| 2782 instr->elements(), | 2785 instr->elements(), |
| 2783 instr->key(), | 2786 key, |
| 2784 instr->hydrogen()->key()->representation(), | 2787 instr->hydrogen()->key()->representation(), |
| 2785 elements_kind, | 2788 elements_kind, |
| 2786 0, | 2789 0, |
| 2787 instr->additional_index())); | 2790 instr->additional_index())); |
| 2788 if (elements_kind == EXTERNAL_FLOAT_ELEMENTS) { | 2791 if (elements_kind == EXTERNAL_FLOAT_ELEMENTS) { |
| 2789 XMMRegister result(ToDoubleRegister(instr->result())); | 2792 XMMRegister result(ToDoubleRegister(instr->result())); |
| 2790 __ movss(result, operand); | 2793 __ movss(result, operand); |
| 2791 __ cvtss2sd(result, result); | 2794 __ cvtss2sd(result, result); |
| 2792 } else if (elements_kind == EXTERNAL_DOUBLE_ELEMENTS) { | 2795 } else if (elements_kind == EXTERNAL_DOUBLE_ELEMENTS) { |
| 2793 __ movdbl(ToDoubleRegister(instr->result()), operand); | 2796 __ movdbl(ToDoubleRegister(instr->result()), operand); |
| (...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3843 DeoptimizeIf(below_equal, instr->environment()); | 3846 DeoptimizeIf(below_equal, instr->environment()); |
| 3844 } else { | 3847 } else { |
| 3845 __ cmp(ToRegister(instr->index()), ToOperand(instr->length())); | 3848 __ cmp(ToRegister(instr->index()), ToOperand(instr->length())); |
| 3846 DeoptimizeIf(above_equal, instr->environment()); | 3849 DeoptimizeIf(above_equal, instr->environment()); |
| 3847 } | 3850 } |
| 3848 } | 3851 } |
| 3849 | 3852 |
| 3850 | 3853 |
| 3851 void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) { | 3854 void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) { |
| 3852 ElementsKind elements_kind = instr->elements_kind(); | 3855 ElementsKind elements_kind = instr->elements_kind(); |
| 3853 if (ExternalArrayOpRequiresTemp<HStoreKeyed>(instr->hydrogen())) { | 3856 LOperand* key = instr->key(); |
| 3854 __ SmiUntag(ToRegister(instr->key())); | 3857 if (!key->IsConstantOperand() && |
| 3858 ExternalArrayOpRequiresTemp(instr->hydrogen()->key()->representation(), |
| 3859 elements_kind)) { |
| 3860 __ SmiUntag(ToRegister(key)); |
| 3855 } | 3861 } |
| 3856 Operand operand(BuildFastArrayOperand( | 3862 Operand operand(BuildFastArrayOperand( |
| 3857 instr->elements(), | 3863 instr->elements(), |
| 3858 instr->key(), | 3864 key, |
| 3859 instr->hydrogen()->key()->representation(), | 3865 instr->hydrogen()->key()->representation(), |
| 3860 elements_kind, | 3866 elements_kind, |
| 3861 0, | 3867 0, |
| 3862 instr->additional_index())); | 3868 instr->additional_index())); |
| 3863 if (elements_kind == EXTERNAL_FLOAT_ELEMENTS) { | 3869 if (elements_kind == EXTERNAL_FLOAT_ELEMENTS) { |
| 3864 __ cvtsd2ss(xmm0, ToDoubleRegister(instr->value())); | 3870 __ cvtsd2ss(xmm0, ToDoubleRegister(instr->value())); |
| 3865 __ movss(operand, xmm0); | 3871 __ movss(operand, xmm0); |
| 3866 } else if (elements_kind == EXTERNAL_DOUBLE_ELEMENTS) { | 3872 } else if (elements_kind == EXTERNAL_DOUBLE_ELEMENTS) { |
| 3867 __ movdbl(operand, ToDoubleRegister(instr->value())); | 3873 __ movdbl(operand, ToDoubleRegister(instr->value())); |
| 3868 } else { | 3874 } else { |
| (...skipping 1706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5575 FixedArray::kHeaderSize - kPointerSize)); | 5581 FixedArray::kHeaderSize - kPointerSize)); |
| 5576 __ bind(&done); | 5582 __ bind(&done); |
| 5577 } | 5583 } |
| 5578 | 5584 |
| 5579 | 5585 |
| 5580 #undef __ | 5586 #undef __ |
| 5581 | 5587 |
| 5582 } } // namespace v8::internal | 5588 } } // namespace v8::internal |
| 5583 | 5589 |
| 5584 #endif // V8_TARGET_ARCH_IA32 | 5590 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |