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