Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Side by Side Diff: src/ic.cc

Issue 238773002: Reland "Track field types.". (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Properly handlified... Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ia32/stub-cache-ia32.cc ('k') | src/json-parser.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after
1224 1224
1225 // If the value that's being stored does not fit in the field that the 1225 // If the value that's being stored does not fit in the field that the
1226 // instance would transition to, create a new transition that fits the value. 1226 // instance would transition to, create a new transition that fits the value.
1227 // This has to be done before generating the IC, since that IC will embed the 1227 // This has to be done before generating the IC, since that IC will embed the
1228 // transition target. 1228 // transition target.
1229 // Ensure the instance and its map were migrated before trying to update the 1229 // Ensure the instance and its map were migrated before trying to update the
1230 // transition target. 1230 // transition target.
1231 ASSERT(!receiver->map()->is_deprecated()); 1231 ASSERT(!receiver->map()->is_deprecated());
1232 if (!lookup->CanHoldValue(value)) { 1232 if (!lookup->CanHoldValue(value)) {
1233 Handle<Map> target(lookup->GetTransitionTarget()); 1233 Handle<Map> target(lookup->GetTransitionTarget());
1234 Representation field_representation = value->OptimalRepresentation();
1235 Handle<HeapType> field_type = value->OptimalType(
1236 lookup->isolate(), field_representation);
1234 Map::GeneralizeRepresentation( 1237 Map::GeneralizeRepresentation(
1235 target, target->LastAdded(), 1238 target, target->LastAdded(),
1236 value->OptimalRepresentation(), FORCE_FIELD); 1239 field_representation, field_type, FORCE_FIELD);
1237 // Lookup the transition again since the transition tree may have changed 1240 // Lookup the transition again since the transition tree may have changed
1238 // entirely by the migration above. 1241 // entirely by the migration above.
1239 receiver->map()->LookupTransition(*holder, *name, lookup); 1242 receiver->map()->LookupTransition(*holder, *name, lookup);
1240 if (!lookup->IsTransition()) return false; 1243 if (!lookup->IsTransition()) return false;
1241 return ic->TryMarkMonomorphicPrototypeFailure(name); 1244 return ic->TryMarkMonomorphicPrototypeFailure(name);
1242 } 1245 }
1243 1246
1244 return true; 1247 return true;
1245 } 1248 }
1246 1249
(...skipping 1696 matching lines...) Expand 10 before | Expand all | Expand 10 after
2943 #undef ADDR 2946 #undef ADDR
2944 }; 2947 };
2945 2948
2946 2949
2947 Address IC::AddressFromUtilityId(IC::UtilityId id) { 2950 Address IC::AddressFromUtilityId(IC::UtilityId id) {
2948 return IC_utilities[id]; 2951 return IC_utilities[id];
2949 } 2952 }
2950 2953
2951 2954
2952 } } // namespace v8::internal 2955 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/stub-cache-ia32.cc ('k') | src/json-parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698