OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 3730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3741 // Could be NaN or Infinity. If fraction is not zero, it's NaN, otherwise | 3741 // Could be NaN or Infinity. If fraction is not zero, it's NaN, otherwise |
3742 // it's an Infinity, and the non-NaN code path applies. | 3742 // it's an Infinity, and the non-NaN code path applies. |
3743 __ j(greater, &is_nan, Label::kNear); | 3743 __ j(greater, &is_nan, Label::kNear); |
3744 __ cmpl(FieldOperand(rax, HeapNumber::kValueOffset), Immediate(0)); | 3744 __ cmpl(FieldOperand(rax, HeapNumber::kValueOffset), Immediate(0)); |
3745 __ j(zero, ¬_nan); | 3745 __ j(zero, ¬_nan); |
3746 __ bind(&is_nan); | 3746 __ bind(&is_nan); |
3747 // Convert all NaNs to the same canonical NaN value when they are stored in | 3747 // Convert all NaNs to the same canonical NaN value when they are stored in |
3748 // the double array. | 3748 // the double array. |
3749 ExternalReference canonical_nan_reference = | 3749 ExternalReference canonical_nan_reference = |
3750 ExternalReference::address_of_canonical_non_hole_nan(); | 3750 ExternalReference::address_of_canonical_non_hole_nan(); |
3751 __ Set(kScratchRegister, kCanonicalNonHoleNanInt64); | 3751 __ Set(kScratchRegister, BitCast<uint64_t>( |
| 3752 FixedDoubleArray::canonical_not_the_hole_nan_as_double())); |
3752 __ movq(xmm0, kScratchRegister); | 3753 __ movq(xmm0, kScratchRegister); |
3753 __ jmp(&have_double_value, Label::kNear); | 3754 __ jmp(&have_double_value, Label::kNear); |
3754 | 3755 |
3755 __ bind(&smi_value); | 3756 __ bind(&smi_value); |
3756 // Value is a smi. convert to a double and store. | 3757 // Value is a smi. convert to a double and store. |
3757 __ SmiToInteger32(rax, rax); | 3758 __ SmiToInteger32(rax, rax); |
3758 __ push(rax); | 3759 __ push(rax); |
3759 __ fild_s(Operand(rsp, 0)); | 3760 __ fild_s(Operand(rsp, 0)); |
3760 __ pop(rax); | 3761 __ pop(rax); |
3761 __ SmiToInteger32(rcx, rcx); | 3762 __ SmiToInteger32(rcx, rcx); |
3762 __ fstp_d(FieldOperand(rdi, rcx, times_8, FixedDoubleArray::kHeaderSize)); | 3763 __ fstp_d(FieldOperand(rdi, rcx, times_8, FixedDoubleArray::kHeaderSize)); |
3763 __ ret(0); | 3764 __ ret(0); |
3764 | 3765 |
3765 // Handle store cache miss, replacing the ic with the generic stub. | 3766 // Handle store cache miss, replacing the ic with the generic stub. |
3766 __ bind(&miss_force_generic); | 3767 __ bind(&miss_force_generic); |
3767 Handle<Code> ic_force_generic = | 3768 Handle<Code> ic_force_generic = |
3768 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); | 3769 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); |
3769 __ jmp(ic_force_generic, RelocInfo::CODE_TARGET); | 3770 __ jmp(ic_force_generic, RelocInfo::CODE_TARGET); |
3770 } | 3771 } |
3771 | 3772 |
3772 | 3773 |
3773 #undef __ | 3774 #undef __ |
3774 | 3775 |
3775 } } // namespace v8::internal | 3776 } } // namespace v8::internal |
3776 | 3777 |
3777 #endif // V8_TARGET_ARCH_X64 | 3778 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |