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 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
911 OMIT_SMI_CHECK); | 911 OMIT_SMI_CHECK); |
912 | 912 |
913 int index = transition->instance_descriptors()->GetFieldIndex( | 913 int index = transition->instance_descriptors()->GetFieldIndex( |
914 transition->LastAdded()); | 914 transition->LastAdded()); |
915 | 915 |
916 // Adjust for the number of properties stored in the object. Even in the | 916 // Adjust for the number of properties stored in the object. Even in the |
917 // face of a transition we can use the old map here because the size of the | 917 // face of a transition we can use the old map here because the size of the |
918 // object and the number of in-object properties is not going to change. | 918 // object and the number of in-object properties is not going to change. |
919 index -= object->map()->inobject_properties(); | 919 index -= object->map()->inobject_properties(); |
920 | 920 |
| 921 SmiCheck smi_check = representation.IsTagged() |
| 922 ? INLINE_SMI_CHECK : OMIT_SMI_CHECK; |
921 // TODO(verwaest): Share this code as a code stub. | 923 // TODO(verwaest): Share this code as a code stub. |
922 if (index < 0) { | 924 if (index < 0) { |
923 // Set the property straight into the object. | 925 // Set the property straight into the object. |
924 int offset = object->map()->instance_size() + (index * kPointerSize); | 926 int offset = object->map()->instance_size() + (index * kPointerSize); |
925 if (FLAG_track_double_fields && representation.IsDouble()) { | 927 if (FLAG_track_double_fields && representation.IsDouble()) { |
926 __ mov(FieldOperand(receiver_reg, offset), storage_reg); | 928 __ mov(FieldOperand(receiver_reg, offset), storage_reg); |
927 } else { | 929 } else { |
928 __ mov(FieldOperand(receiver_reg, offset), value_reg); | 930 __ mov(FieldOperand(receiver_reg, offset), value_reg); |
929 } | 931 } |
930 | 932 |
931 if (!FLAG_track_fields || !representation.IsSmi()) { | 933 if (!FLAG_track_fields || !representation.IsSmi()) { |
932 // Update the write barrier for the array address. | 934 // Update the write barrier for the array address. |
933 // Pass the value being stored in the now unused name_reg. | 935 // Pass the value being stored in the now unused name_reg. |
934 if (!FLAG_track_double_fields || !representation.IsDouble()) { | 936 if (!FLAG_track_double_fields || !representation.IsDouble()) { |
935 __ mov(name_reg, value_reg); | 937 __ mov(name_reg, value_reg); |
936 } else { | 938 } else { |
937 ASSERT(storage_reg.is(name_reg)); | 939 ASSERT(storage_reg.is(name_reg)); |
938 } | 940 } |
939 __ RecordWriteField(receiver_reg, | 941 __ RecordWriteField(receiver_reg, |
940 offset, | 942 offset, |
941 name_reg, | 943 name_reg, |
942 scratch1, | 944 scratch1, |
943 kDontSaveFPRegs); | 945 kDontSaveFPRegs, |
| 946 EMIT_REMEMBERED_SET, |
| 947 smi_check); |
944 } | 948 } |
945 } else { | 949 } else { |
946 // Write to the properties array. | 950 // Write to the properties array. |
947 int offset = index * kPointerSize + FixedArray::kHeaderSize; | 951 int offset = index * kPointerSize + FixedArray::kHeaderSize; |
948 // Get the properties array (optimistically). | 952 // Get the properties array (optimistically). |
949 __ mov(scratch1, FieldOperand(receiver_reg, JSObject::kPropertiesOffset)); | 953 __ mov(scratch1, FieldOperand(receiver_reg, JSObject::kPropertiesOffset)); |
950 if (FLAG_track_double_fields && representation.IsDouble()) { | 954 if (FLAG_track_double_fields && representation.IsDouble()) { |
951 __ mov(FieldOperand(scratch1, offset), storage_reg); | 955 __ mov(FieldOperand(scratch1, offset), storage_reg); |
952 } else { | 956 } else { |
953 __ mov(FieldOperand(scratch1, offset), value_reg); | 957 __ mov(FieldOperand(scratch1, offset), value_reg); |
954 } | 958 } |
955 | 959 |
956 if (!FLAG_track_fields || !representation.IsSmi()) { | 960 if (!FLAG_track_fields || !representation.IsSmi()) { |
957 // Update the write barrier for the array address. | 961 // Update the write barrier for the array address. |
958 // Pass the value being stored in the now unused name_reg. | 962 // Pass the value being stored in the now unused name_reg. |
959 if (!FLAG_track_double_fields || !representation.IsDouble()) { | 963 if (!FLAG_track_double_fields || !representation.IsDouble()) { |
960 __ mov(name_reg, value_reg); | 964 __ mov(name_reg, value_reg); |
961 } else { | 965 } else { |
962 ASSERT(storage_reg.is(name_reg)); | 966 ASSERT(storage_reg.is(name_reg)); |
963 } | 967 } |
964 __ RecordWriteField(scratch1, | 968 __ RecordWriteField(scratch1, |
965 offset, | 969 offset, |
966 name_reg, | 970 name_reg, |
967 receiver_reg, | 971 receiver_reg, |
968 kDontSaveFPRegs); | 972 kDontSaveFPRegs, |
| 973 EMIT_REMEMBERED_SET, |
| 974 smi_check); |
969 } | 975 } |
970 } | 976 } |
971 | 977 |
972 // Return the value (register eax). | 978 // Return the value (register eax). |
973 ASSERT(value_reg.is(eax)); | 979 ASSERT(value_reg.is(eax)); |
974 __ ret(0); | 980 __ ret(0); |
975 } | 981 } |
976 | 982 |
977 | 983 |
978 // Both name_reg and receiver_reg are preserved on jumps to miss_label, | 984 // Both name_reg and receiver_reg are preserved on jumps to miss_label, |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1054 __ fstp_d(FieldOperand(scratch1, HeapNumber::kValueOffset)); | 1060 __ fstp_d(FieldOperand(scratch1, HeapNumber::kValueOffset)); |
1055 } | 1061 } |
1056 // Return the value (register eax). | 1062 // Return the value (register eax). |
1057 ASSERT(value_reg.is(eax)); | 1063 ASSERT(value_reg.is(eax)); |
1058 __ ret(0); | 1064 __ ret(0); |
1059 return; | 1065 return; |
1060 } | 1066 } |
1061 | 1067 |
1062 ASSERT(!FLAG_track_double_fields || !representation.IsDouble()); | 1068 ASSERT(!FLAG_track_double_fields || !representation.IsDouble()); |
1063 // TODO(verwaest): Share this code as a code stub. | 1069 // TODO(verwaest): Share this code as a code stub. |
| 1070 SmiCheck smi_check = representation.IsTagged() |
| 1071 ? INLINE_SMI_CHECK : OMIT_SMI_CHECK; |
1064 if (index < 0) { | 1072 if (index < 0) { |
1065 // Set the property straight into the object. | 1073 // Set the property straight into the object. |
1066 int offset = object->map()->instance_size() + (index * kPointerSize); | 1074 int offset = object->map()->instance_size() + (index * kPointerSize); |
1067 __ mov(FieldOperand(receiver_reg, offset), value_reg); | 1075 __ mov(FieldOperand(receiver_reg, offset), value_reg); |
1068 | 1076 |
1069 if (!FLAG_track_fields || !representation.IsSmi()) { | 1077 if (!FLAG_track_fields || !representation.IsSmi()) { |
1070 // Update the write barrier for the array address. | 1078 // Update the write barrier for the array address. |
1071 // Pass the value being stored in the now unused name_reg. | 1079 // Pass the value being stored in the now unused name_reg. |
1072 __ mov(name_reg, value_reg); | 1080 __ mov(name_reg, value_reg); |
1073 __ RecordWriteField(receiver_reg, | 1081 __ RecordWriteField(receiver_reg, |
1074 offset, | 1082 offset, |
1075 name_reg, | 1083 name_reg, |
1076 scratch1, | 1084 scratch1, |
1077 kDontSaveFPRegs); | 1085 kDontSaveFPRegs, |
| 1086 EMIT_REMEMBERED_SET, |
| 1087 smi_check); |
1078 } | 1088 } |
1079 } else { | 1089 } else { |
1080 // Write to the properties array. | 1090 // Write to the properties array. |
1081 int offset = index * kPointerSize + FixedArray::kHeaderSize; | 1091 int offset = index * kPointerSize + FixedArray::kHeaderSize; |
1082 // Get the properties array (optimistically). | 1092 // Get the properties array (optimistically). |
1083 __ mov(scratch1, FieldOperand(receiver_reg, JSObject::kPropertiesOffset)); | 1093 __ mov(scratch1, FieldOperand(receiver_reg, JSObject::kPropertiesOffset)); |
1084 __ mov(FieldOperand(scratch1, offset), value_reg); | 1094 __ mov(FieldOperand(scratch1, offset), value_reg); |
1085 | 1095 |
1086 if (!FLAG_track_fields || !representation.IsSmi()) { | 1096 if (!FLAG_track_fields || !representation.IsSmi()) { |
1087 // Update the write barrier for the array address. | 1097 // Update the write barrier for the array address. |
1088 // Pass the value being stored in the now unused name_reg. | 1098 // Pass the value being stored in the now unused name_reg. |
1089 __ mov(name_reg, value_reg); | 1099 __ mov(name_reg, value_reg); |
1090 __ RecordWriteField(scratch1, | 1100 __ RecordWriteField(scratch1, |
1091 offset, | 1101 offset, |
1092 name_reg, | 1102 name_reg, |
1093 receiver_reg, | 1103 receiver_reg, |
1094 kDontSaveFPRegs); | 1104 kDontSaveFPRegs, |
| 1105 EMIT_REMEMBERED_SET, |
| 1106 smi_check); |
1095 } | 1107 } |
1096 } | 1108 } |
1097 | 1109 |
1098 // Return the value (register eax). | 1110 // Return the value (register eax). |
1099 ASSERT(value_reg.is(eax)); | 1111 ASSERT(value_reg.is(eax)); |
1100 __ ret(0); | 1112 __ ret(0); |
1101 } | 1113 } |
1102 | 1114 |
1103 | 1115 |
1104 // Calls GenerateCheckPropertyCell for each global object in the prototype chain | 1116 // Calls GenerateCheckPropertyCell for each global object in the prototype chain |
(...skipping 2763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3868 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow); | 3880 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow); |
3869 } | 3881 } |
3870 } | 3882 } |
3871 | 3883 |
3872 | 3884 |
3873 #undef __ | 3885 #undef __ |
3874 | 3886 |
3875 } } // namespace v8::internal | 3887 } } // namespace v8::internal |
3876 | 3888 |
3877 #endif // V8_TARGET_ARCH_IA32 | 3889 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |