| 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 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1211 | 1211 |
| 1212 // If the value that's being stored does not fit in the field that the | 1212 // If the value that's being stored does not fit in the field that the |
| 1213 // instance would transition to, create a new transition that fits the value. | 1213 // instance would transition to, create a new transition that fits the value. |
| 1214 // This has to be done before generating the IC, since that IC will embed the | 1214 // This has to be done before generating the IC, since that IC will embed the |
| 1215 // transition target. | 1215 // transition target. |
| 1216 // Ensure the instance and its map were migrated before trying to update the | 1216 // Ensure the instance and its map were migrated before trying to update the |
| 1217 // transition target. | 1217 // transition target. |
| 1218 ASSERT(!receiver->map()->is_deprecated()); | 1218 ASSERT(!receiver->map()->is_deprecated()); |
| 1219 if (!lookup->CanHoldValue(value)) { | 1219 if (!lookup->CanHoldValue(value)) { |
| 1220 Handle<Map> target(lookup->GetTransitionTarget()); | 1220 Handle<Map> target(lookup->GetTransitionTarget()); |
| 1221 Representation field_representation = value->OptimalRepresentation(); | |
| 1222 Handle<HeapType> field_type = value->OptimalType( | |
| 1223 lookup->isolate(), field_representation); | |
| 1224 Map::GeneralizeRepresentation( | 1221 Map::GeneralizeRepresentation( |
| 1225 target, target->LastAdded(), | 1222 target, target->LastAdded(), |
| 1226 field_representation, field_type, FORCE_FIELD); | 1223 value->OptimalRepresentation(), FORCE_FIELD); |
| 1227 // Lookup the transition again since the transition tree may have changed | 1224 // Lookup the transition again since the transition tree may have changed |
| 1228 // entirely by the migration above. | 1225 // entirely by the migration above. |
| 1229 receiver->map()->LookupTransition(*holder, *name, lookup); | 1226 receiver->map()->LookupTransition(*holder, *name, lookup); |
| 1230 if (!lookup->IsTransition()) return false; | 1227 if (!lookup->IsTransition()) return false; |
| 1231 return ic->TryMarkMonomorphicPrototypeFailure(name); | 1228 return ic->TryMarkMonomorphicPrototypeFailure(name); |
| 1232 } | 1229 } |
| 1233 | 1230 |
| 1234 return true; | 1231 return true; |
| 1235 } | 1232 } |
| 1236 | 1233 |
| (...skipping 1645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2882 #undef ADDR | 2879 #undef ADDR |
| 2883 }; | 2880 }; |
| 2884 | 2881 |
| 2885 | 2882 |
| 2886 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 2883 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
| 2887 return IC_utilities[id]; | 2884 return IC_utilities[id]; |
| 2888 } | 2885 } |
| 2889 | 2886 |
| 2890 | 2887 |
| 2891 } } // namespace v8::internal | 2888 } } // namespace v8::internal |
| OLD | NEW |