OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
783 // +/-Infinity into integer arrays basically undefined. For more | 783 // +/-Infinity into integer arrays basically undefined. For more |
784 // reproducible behavior, convert these to zero. | 784 // reproducible behavior, convert these to zero. |
785 __ fld_d(FieldOperand(rax, HeapNumber::kValueOffset)); | 785 __ fld_d(FieldOperand(rax, HeapNumber::kValueOffset)); |
786 __ movq(rdx, rax); // Save the value. | 786 __ movq(rdx, rax); // Save the value. |
787 __ movq(rcx, FieldOperand(rcx, ExternalArray::kExternalPointerOffset)); | 787 __ movq(rcx, FieldOperand(rcx, ExternalArray::kExternalPointerOffset)); |
788 // rbx: untagged index | 788 // rbx: untagged index |
789 // rcx: base pointer of external storage | 789 // rcx: base pointer of external storage |
790 // top of FPU stack: value | 790 // top of FPU stack: value |
791 if (array_type == kExternalFloatArray) { | 791 if (array_type == kExternalFloatArray) { |
792 __ fstp_s(Operand(rcx, rbx, times_4, 0)); | 792 __ fstp_s(Operand(rcx, rbx, times_4, 0)); |
| 793 __ movq(rax, rdx); // Return the original value. |
| 794 __ ret(0); |
793 } else { | 795 } else { |
794 // Need to perform float-to-int conversion. | 796 // Need to perform float-to-int conversion. |
795 // Test the top of the FP stack for NaN. | 797 // Test the top of the FP stack for NaN. |
796 Label is_nan; | 798 Label is_nan; |
797 __ fucomi(0); | 799 __ fucomi(0); |
798 __ j(parity_even, &is_nan); | 800 __ j(parity_even, &is_nan); |
799 | 801 |
800 __ push(rax); // Make room on stack | 802 __ push(rax); // Make room on stack |
801 __ fistp_d(Operand(rsp, 0)); | 803 __ fistp_d(Operand(rsp, 0)); |
802 __ pop(rax); | 804 __ pop(rax); |
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1325 | 1327 |
1326 // Cache miss: Jump to runtime. | 1328 // Cache miss: Jump to runtime. |
1327 Generate(masm, ExternalReference(IC_Utility(kStoreIC_Miss))); | 1329 Generate(masm, ExternalReference(IC_Utility(kStoreIC_Miss))); |
1328 } | 1330 } |
1329 | 1331 |
1330 | 1332 |
1331 #undef __ | 1333 #undef __ |
1332 | 1334 |
1333 | 1335 |
1334 } } // namespace v8::internal | 1336 } } // namespace v8::internal |
OLD | NEW |