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

Side by Side Diff: src/ic.cc

Issue 167303005: Track field types. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments 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 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after
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);
1221 Map::GeneralizeRepresentation( 1224 Map::GeneralizeRepresentation(
1222 target, target->LastAdded(), 1225 target, target->LastAdded(),
1223 value->OptimalRepresentation(), FORCE_FIELD); 1226 field_representation, field_type, FORCE_FIELD);
1224 // Lookup the transition again since the transition tree may have changed 1227 // Lookup the transition again since the transition tree may have changed
1225 // entirely by the migration above. 1228 // entirely by the migration above.
1226 receiver->map()->LookupTransition(*holder, *name, lookup); 1229 receiver->map()->LookupTransition(*holder, *name, lookup);
1227 if (!lookup->IsTransition()) return false; 1230 if (!lookup->IsTransition()) return false;
1228 return ic->TryMarkMonomorphicPrototypeFailure(name); 1231 return ic->TryMarkMonomorphicPrototypeFailure(name);
1229 } 1232 }
1230 1233
1231 return true; 1234 return true;
1232 } 1235 }
1233 1236
(...skipping 1645 matching lines...) Expand 10 before | Expand all | Expand 10 after
2879 #undef ADDR 2882 #undef ADDR
2880 }; 2883 };
2881 2884
2882 2885
2883 Address IC::AddressFromUtilityId(IC::UtilityId id) { 2886 Address IC::AddressFromUtilityId(IC::UtilityId id) {
2884 return IC_utilities[id]; 2887 return IC_utilities[id];
2885 } 2888 }
2886 2889
2887 2890
2888 } } // namespace v8::internal 2891 } } // 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