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 4008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4019 switch (lookup.type()) { | 4019 switch (lookup.type()) { |
4020 case NORMAL: { | 4020 case NORMAL: { |
4021 PropertyDetails details = PropertyDetails(attributes, NORMAL, 0); | 4021 PropertyDetails details = PropertyDetails(attributes, NORMAL, 0); |
4022 result = self->SetNormalizedProperty(*name, *value, details); | 4022 result = self->SetNormalizedProperty(*name, *value, details); |
4023 break; | 4023 break; |
4024 } | 4024 } |
4025 case FIELD: { | 4025 case FIELD: { |
4026 Representation representation = lookup.representation(); | 4026 Representation representation = lookup.representation(); |
4027 Representation value_representation = | 4027 Representation value_representation = |
4028 value->OptimalRepresentation(value_type); | 4028 value->OptimalRepresentation(value_type); |
| 4029 if (value_representation.IsNone()) break; |
4029 if (!value_representation.fits_into(representation)) { | 4030 if (!value_representation.fits_into(representation)) { |
4030 MaybeObject* maybe_failure = self->GeneralizeFieldRepresentation( | 4031 MaybeObject* maybe_failure = self->GeneralizeFieldRepresentation( |
4031 lookup.GetDescriptorIndex(), value_representation); | 4032 lookup.GetDescriptorIndex(), value_representation); |
4032 if (maybe_failure->IsFailure()) return maybe_failure; | 4033 if (maybe_failure->IsFailure()) return maybe_failure; |
4033 DescriptorArray* desc = self->map()->instance_descriptors(); | 4034 DescriptorArray* desc = self->map()->instance_descriptors(); |
4034 int descriptor = lookup.GetDescriptorIndex(); | 4035 int descriptor = lookup.GetDescriptorIndex(); |
4035 representation = desc->GetDetails(descriptor).representation(); | 4036 representation = desc->GetDetails(descriptor).representation(); |
4036 } | 4037 } |
4037 if (FLAG_track_double_fields && representation.IsDouble()) { | 4038 if (FLAG_track_double_fields && representation.IsDouble()) { |
4038 HeapNumber* storage = | 4039 HeapNumber* storage = |
(...skipping 11748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15787 | 15788 |
15788 | 15789 |
15789 void JSTypedArray::Neuter() { | 15790 void JSTypedArray::Neuter() { |
15790 set_byte_offset(Smi::FromInt(0)); | 15791 set_byte_offset(Smi::FromInt(0)); |
15791 set_byte_length(Smi::FromInt(0)); | 15792 set_byte_length(Smi::FromInt(0)); |
15792 set_length(Smi::FromInt(0)); | 15793 set_length(Smi::FromInt(0)); |
15793 set_elements(GetHeap()->EmptyExternalArrayForMap(map())); | 15794 set_elements(GetHeap()->EmptyExternalArrayForMap(map())); |
15794 } | 15795 } |
15795 | 15796 |
15796 } } // namespace v8::internal | 15797 } } // namespace v8::internal |
OLD | NEW |