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 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1082 Register scratch1, | 1082 Register scratch1, |
1083 Register scratch2, | 1083 Register scratch2, |
1084 Register scratch3, | 1084 Register scratch3, |
1085 Object* value, | 1085 Object* value, |
1086 String* name, | 1086 String* name, |
1087 Label* miss) { | 1087 Label* miss) { |
1088 // Check that the receiver isn't a smi. | 1088 // Check that the receiver isn't a smi. |
1089 __ JumpIfSmi(receiver, miss); | 1089 __ JumpIfSmi(receiver, miss); |
1090 | 1090 |
1091 // Check that the maps haven't changed. | 1091 // Check that the maps haven't changed. |
1092 Register reg = | 1092 CheckPrototypes(object, receiver, holder, |
1093 CheckPrototypes(object, receiver, holder, | 1093 scratch1, scratch2, scratch3, name, miss); |
1094 scratch1, scratch2, scratch3, name, miss); | |
1095 | 1094 |
1096 // Return the constant value. | 1095 // Return the constant value. |
1097 __ Move(rax, Handle<Object>(value)); | 1096 __ Move(rax, Handle<Object>(value)); |
1098 __ ret(0); | 1097 __ ret(0); |
1099 } | 1098 } |
1100 | 1099 |
1101 | 1100 |
1102 void StubCompiler::GenerateLoadInterceptor(JSObject* object, | 1101 void StubCompiler::GenerateLoadInterceptor(JSObject* object, |
1103 JSObject* interceptor_holder, | 1102 JSObject* interceptor_holder, |
1104 LookupResult* lookup, | 1103 LookupResult* lookup, |
(...skipping 2634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3739 | 3738 |
3740 __ bind(&maybe_nan); | 3739 __ bind(&maybe_nan); |
3741 // Could be NaN or Infinity. If fraction is not zero, it's NaN, otherwise | 3740 // 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. | 3741 // it's an Infinity, and the non-NaN code path applies. |
3743 __ j(greater, &is_nan, Label::kNear); | 3742 __ j(greater, &is_nan, Label::kNear); |
3744 __ cmpl(FieldOperand(rax, HeapNumber::kValueOffset), Immediate(0)); | 3743 __ cmpl(FieldOperand(rax, HeapNumber::kValueOffset), Immediate(0)); |
3745 __ j(zero, ¬_nan); | 3744 __ j(zero, ¬_nan); |
3746 __ bind(&is_nan); | 3745 __ bind(&is_nan); |
3747 // Convert all NaNs to the same canonical NaN value when they are stored in | 3746 // Convert all NaNs to the same canonical NaN value when they are stored in |
3748 // the double array. | 3747 // the double array. |
3749 ExternalReference canonical_nan_reference = | |
3750 ExternalReference::address_of_canonical_non_hole_nan(); | |
3751 __ Set(kScratchRegister, BitCast<uint64_t>( | 3748 __ Set(kScratchRegister, BitCast<uint64_t>( |
3752 FixedDoubleArray::canonical_not_the_hole_nan_as_double())); | 3749 FixedDoubleArray::canonical_not_the_hole_nan_as_double())); |
3753 __ movq(xmm0, kScratchRegister); | 3750 __ movq(xmm0, kScratchRegister); |
3754 __ jmp(&have_double_value, Label::kNear); | 3751 __ jmp(&have_double_value, Label::kNear); |
3755 | 3752 |
3756 __ bind(&smi_value); | 3753 __ bind(&smi_value); |
3757 // Value is a smi. convert to a double and store. | 3754 // Value is a smi. convert to a double and store. |
3758 __ SmiToInteger32(rax, rax); | 3755 __ SmiToInteger32(rax, rax); |
3759 __ push(rax); | 3756 __ push(rax); |
3760 __ fild_s(Operand(rsp, 0)); | 3757 __ fild_s(Operand(rsp, 0)); |
3761 __ pop(rax); | 3758 __ pop(rax); |
3762 __ SmiToInteger32(rcx, rcx); | 3759 __ SmiToInteger32(rcx, rcx); |
3763 __ fstp_d(FieldOperand(rdi, rcx, times_8, FixedDoubleArray::kHeaderSize)); | 3760 __ fstp_d(FieldOperand(rdi, rcx, times_8, FixedDoubleArray::kHeaderSize)); |
3764 __ ret(0); | 3761 __ ret(0); |
3765 | 3762 |
3766 // Handle store cache miss, replacing the ic with the generic stub. | 3763 // Handle store cache miss, replacing the ic with the generic stub. |
3767 __ bind(&miss_force_generic); | 3764 __ bind(&miss_force_generic); |
3768 Handle<Code> ic_force_generic = | 3765 Handle<Code> ic_force_generic = |
3769 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); | 3766 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); |
3770 __ jmp(ic_force_generic, RelocInfo::CODE_TARGET); | 3767 __ jmp(ic_force_generic, RelocInfo::CODE_TARGET); |
3771 } | 3768 } |
3772 | 3769 |
3773 | 3770 |
3774 #undef __ | 3771 #undef __ |
3775 | 3772 |
3776 } } // namespace v8::internal | 3773 } } // namespace v8::internal |
3777 | 3774 |
3778 #endif // V8_TARGET_ARCH_X64 | 3775 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |