| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 3891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3902 if (!value->FitsRepresentation(representation)) { | 3902 if (!value->FitsRepresentation(representation)) { |
| 3903 MaybeObject* maybe_map = transition_map->GeneralizeRepresentation( | 3903 MaybeObject* maybe_map = transition_map->GeneralizeRepresentation( |
| 3904 descriptor, value->OptimalRepresentation()); | 3904 descriptor, value->OptimalRepresentation()); |
| 3905 if (!maybe_map->To(&transition_map)) return maybe_map; | 3905 if (!maybe_map->To(&transition_map)) return maybe_map; |
| 3906 Object* back = transition_map->GetBackPointer(); | 3906 Object* back = transition_map->GetBackPointer(); |
| 3907 if (back->IsMap()) { | 3907 if (back->IsMap()) { |
| 3908 MaybeObject* maybe_failure = | 3908 MaybeObject* maybe_failure = |
| 3909 lookup->holder()->MigrateToMap(Map::cast(back)); | 3909 lookup->holder()->MigrateToMap(Map::cast(back)); |
| 3910 if (maybe_failure->IsFailure()) return maybe_failure; | 3910 if (maybe_failure->IsFailure()) return maybe_failure; |
| 3911 } | 3911 } |
| 3912 DescriptorArray* desc = transition_map->instance_descriptors(); | 3912 descriptors = transition_map->instance_descriptors(); |
| 3913 int descriptor = transition_map->LastAdded(); | 3913 representation = |
| 3914 representation = desc->GetDetails(descriptor).representation(); | 3914 descriptors->GetDetails(descriptor).representation(); |
| 3915 } | 3915 } |
| 3916 int field_index = descriptors->GetFieldIndex(descriptor); | 3916 int field_index = descriptors->GetFieldIndex(descriptor); |
| 3917 result = lookup->holder()->AddFastPropertyUsingMap( | 3917 result = lookup->holder()->AddFastPropertyUsingMap( |
| 3918 transition_map, *name, *value, field_index, representation); | 3918 transition_map, *name, *value, field_index, representation); |
| 3919 } else { | 3919 } else { |
| 3920 result = lookup->holder()->ConvertDescriptorToField( | 3920 result = lookup->holder()->ConvertDescriptorToField( |
| 3921 *name, *value, attributes); | 3921 *name, *value, attributes); |
| 3922 } | 3922 } |
| 3923 } else if (details.type() == CALLBACKS) { | 3923 } else if (details.type() == CALLBACKS) { |
| 3924 result = lookup->holder()->ConvertDescriptorToField( | 3924 result = lookup->holder()->ConvertDescriptorToField( |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4110 value->OptimalRepresentation(value_type); | 4110 value->OptimalRepresentation(value_type); |
| 4111 if (!value_representation.fits_into(representation)) { | 4111 if (!value_representation.fits_into(representation)) { |
| 4112 MaybeObject* maybe_map = transition_map->GeneralizeRepresentation( | 4112 MaybeObject* maybe_map = transition_map->GeneralizeRepresentation( |
| 4113 descriptor, value_representation); | 4113 descriptor, value_representation); |
| 4114 if (!maybe_map->To(&transition_map)) return maybe_map; | 4114 if (!maybe_map->To(&transition_map)) return maybe_map; |
| 4115 Object* back = transition_map->GetBackPointer(); | 4115 Object* back = transition_map->GetBackPointer(); |
| 4116 if (back->IsMap()) { | 4116 if (back->IsMap()) { |
| 4117 MaybeObject* maybe_failure = self->MigrateToMap(Map::cast(back)); | 4117 MaybeObject* maybe_failure = self->MigrateToMap(Map::cast(back)); |
| 4118 if (maybe_failure->IsFailure()) return maybe_failure; | 4118 if (maybe_failure->IsFailure()) return maybe_failure; |
| 4119 } | 4119 } |
| 4120 DescriptorArray* desc = transition_map->instance_descriptors(); | 4120 descriptors = transition_map->instance_descriptors(); |
| 4121 int descriptor = transition_map->LastAdded(); | 4121 representation = |
| 4122 representation = desc->GetDetails(descriptor).representation(); | 4122 descriptors->GetDetails(descriptor).representation(); |
| 4123 } | 4123 } |
| 4124 int field_index = descriptors->GetFieldIndex(descriptor); | 4124 int field_index = descriptors->GetFieldIndex(descriptor); |
| 4125 result = self->AddFastPropertyUsingMap( | 4125 result = self->AddFastPropertyUsingMap( |
| 4126 transition_map, *name, *value, field_index, representation); | 4126 transition_map, *name, *value, field_index, representation); |
| 4127 } else { | 4127 } else { |
| 4128 result = self->ConvertDescriptorToField(*name, *value, attributes); | 4128 result = self->ConvertDescriptorToField(*name, *value, attributes); |
| 4129 } | 4129 } |
| 4130 } else if (details.type() == CALLBACKS) { | 4130 } else if (details.type() == CALLBACKS) { |
| 4131 result = self->ConvertDescriptorToField(*name, *value, attributes); | 4131 result = self->ConvertDescriptorToField(*name, *value, attributes); |
| 4132 } else { | 4132 } else { |
| (...skipping 11844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15977 #define ERROR_MESSAGES_TEXTS(C, T) T, | 15977 #define ERROR_MESSAGES_TEXTS(C, T) T, |
| 15978 static const char* error_messages_[] = { | 15978 static const char* error_messages_[] = { |
| 15979 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 15979 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
| 15980 }; | 15980 }; |
| 15981 #undef ERROR_MESSAGES_TEXTS | 15981 #undef ERROR_MESSAGES_TEXTS |
| 15982 return error_messages_[reason]; | 15982 return error_messages_[reason]; |
| 15983 } | 15983 } |
| 15984 | 15984 |
| 15985 | 15985 |
| 15986 } } // namespace v8::internal | 15986 } } // namespace v8::internal |
| OLD | NEW |