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 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 break; | 435 break; |
436 } | 436 } |
437 | 437 |
438 // For integer array types: | 438 // For integer array types: |
439 // rax: value | 439 // rax: value |
440 // For floating-point array type: | 440 // For floating-point array type: |
441 // FP(0): value | 441 // FP(0): value |
442 | 442 |
443 if (array_type == kExternalIntArray || | 443 if (array_type == kExternalIntArray || |
444 array_type == kExternalUnsignedIntArray) { | 444 array_type == kExternalUnsignedIntArray) { |
445 | |
446 // For the Int and UnsignedInt array types, we need to see whether | 445 // For the Int and UnsignedInt array types, we need to see whether |
447 // the value can be represented in a Smi. If not, we need to convert | 446 // the value can be represented in a Smi. If not, we need to convert |
448 // it to a HeapNumber. | 447 // it to a HeapNumber. |
449 Label box_int; | 448 Label box_int; |
450 if (array_type == kExternalIntArray) { | 449 if (array_type == kExternalIntArray) { |
451 __ JumpIfNotValidSmiValue(rax, &box_int); | 450 __ JumpIfNotValidSmiValue(rax, &box_int); |
452 } else { | 451 } else { |
453 ASSERT_EQ(array_type, kExternalUnsignedIntArray); | 452 ASSERT_EQ(array_type, kExternalUnsignedIntArray); |
454 __ JumpIfUIntNotValidSmiValue(rax, &box_int); | 453 __ JumpIfUIntNotValidSmiValue(rax, &box_int); |
455 } | 454 } |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
791 // top of FPU stack: value | 790 // top of FPU stack: value |
792 if (array_type == kExternalFloatArray) { | 791 if (array_type == kExternalFloatArray) { |
793 __ fstp_s(Operand(rcx, rbx, times_4, 0)); | 792 __ fstp_s(Operand(rcx, rbx, times_4, 0)); |
794 } else { | 793 } else { |
795 // Need to perform float-to-int conversion. | 794 // Need to perform float-to-int conversion. |
796 // Test the top of the FP stack for NaN. | 795 // Test the top of the FP stack for NaN. |
797 Label is_nan; | 796 Label is_nan; |
798 __ fucomi(0); | 797 __ fucomi(0); |
799 __ j(parity_even, &is_nan); | 798 __ j(parity_even, &is_nan); |
800 | 799 |
801 __ push(rax); // Make room on stack | 800 __ push(rax); // Make room on stack |
802 __ fistp_d(Operand(rsp, 0)); | 801 __ fistp_d(Operand(rsp, 0)); |
803 __ pop(rax); | 802 __ pop(rax); |
804 // rax: untagged integer value | 803 // rax: untagged integer value |
805 switch (array_type) { | 804 switch (array_type) { |
806 case kExternalByteArray: | 805 case kExternalByteArray: |
807 case kExternalUnsignedByteArray: | 806 case kExternalUnsignedByteArray: |
808 __ movb(Operand(rcx, rbx, times_1, 0), rax); | 807 __ movb(Operand(rcx, rbx, times_1, 0), rax); |
809 break; | 808 break; |
810 case kExternalShortArray: | 809 case kExternalShortArray: |
811 case kExternalUnsignedShortArray: | 810 case kExternalUnsignedShortArray: |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1326 | 1325 |
1327 // Cache miss: Jump to runtime. | 1326 // Cache miss: Jump to runtime. |
1328 Generate(masm, ExternalReference(IC_Utility(kStoreIC_Miss))); | 1327 Generate(masm, ExternalReference(IC_Utility(kStoreIC_Miss))); |
1329 } | 1328 } |
1330 | 1329 |
1331 | 1330 |
1332 #undef __ | 1331 #undef __ |
1333 | 1332 |
1334 | 1333 |
1335 } } // namespace v8::internal | 1334 } } // namespace v8::internal |
OLD | NEW |