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

Side by Side Diff: src/objects.cc

Issue 50213003: Do deferred migration of maps after deoptimizing once. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2766 matching lines...) Expand 10 before | Expand all | Expand 10 after
2777 stdout, "", modify_index, descriptor, descriptors, 2777 stdout, "", modify_index, descriptor, descriptors,
2778 old_descriptors->GetDetails(modify_index).type() == CONSTANT && 2778 old_descriptors->GetDetails(modify_index).type() == CONSTANT &&
2779 store_mode == FORCE_FIELD, 2779 store_mode == FORCE_FIELD,
2780 old_representation, updated_representation); 2780 old_representation, updated_representation);
2781 } 2781 }
2782 2782
2783 // Add missing transitions. 2783 // Add missing transitions.
2784 Handle<Map> new_map = split_map; 2784 Handle<Map> new_map = split_map;
2785 for (; descriptor < descriptors; descriptor++) { 2785 for (; descriptor < descriptors; descriptor++) {
2786 new_map = Map::CopyInstallDescriptors(new_map, descriptor, new_descriptors); 2786 new_map = Map::CopyInstallDescriptors(new_map, descriptor, new_descriptors);
2787 new_map->set_migration_target(true);
2788 } 2787 }
2789 2788
2790 new_map->set_owns_descriptors(true); 2789 new_map->set_owns_descriptors(true);
2791 return new_map; 2790 return new_map;
2792 } 2791 }
2793 2792
2794 2793
2795 // Generalize the representation of all FIELD descriptors. 2794 // Generalize the representation of all FIELD descriptors.
2796 Handle<Map> Map::GeneralizeAllFieldRepresentations( 2795 Handle<Map> Map::GeneralizeAllFieldRepresentations(
2797 Handle<Map> map, 2796 Handle<Map> map,
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after
3868 } 3867 }
3869 3868
3870 3869
3871 void JSObject::MigrateInstance(Handle<JSObject> object) { 3870 void JSObject::MigrateInstance(Handle<JSObject> object) {
3872 // Converting any field to the most specific type will cause the 3871 // Converting any field to the most specific type will cause the
3873 // GeneralizeFieldRepresentation algorithm to create the most general existing 3872 // GeneralizeFieldRepresentation algorithm to create the most general existing
3874 // transition that matches the object. This achieves what is needed. 3873 // transition that matches the object. This achieves what is needed.
3875 Handle<Map> original_map(object->map()); 3874 Handle<Map> original_map(object->map());
3876 GeneralizeFieldRepresentation( 3875 GeneralizeFieldRepresentation(
3877 object, 0, Representation::None(), ALLOW_AS_CONSTANT); 3876 object, 0, Representation::None(), ALLOW_AS_CONSTANT);
3877 object->map()->set_migration_target(true);
3878 if (FLAG_trace_migration) { 3878 if (FLAG_trace_migration) {
3879 object->PrintInstanceMigration(stdout, *original_map, object->map()); 3879 object->PrintInstanceMigration(stdout, *original_map, object->map());
3880 } 3880 }
3881 } 3881 }
3882 3882
3883 3883
3884 Handle<Object> JSObject::TryMigrateInstance(Handle<JSObject> object) { 3884 Handle<Object> JSObject::TryMigrateInstance(Handle<JSObject> object) {
3885 Map* new_map = object->map()->CurrentMapForDeprecated(); 3885 Map* new_map = object->map()->CurrentMapForDeprecated();
3886 if (new_map == NULL) return Handle<Object>(); 3886 if (new_map == NULL) return Handle<Object>();
3887 Handle<Map> original_map(object->map()); 3887 Handle<Map> original_map(object->map());
(...skipping 12780 matching lines...) Expand 10 before | Expand all | Expand 10 after
16668 #define ERROR_MESSAGES_TEXTS(C, T) T, 16668 #define ERROR_MESSAGES_TEXTS(C, T) T,
16669 static const char* error_messages_[] = { 16669 static const char* error_messages_[] = {
16670 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 16670 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
16671 }; 16671 };
16672 #undef ERROR_MESSAGES_TEXTS 16672 #undef ERROR_MESSAGES_TEXTS
16673 return error_messages_[reason]; 16673 return error_messages_[reason];
16674 } 16674 }
16675 16675
16676 16676
16677 } } // namespace v8::internal 16677 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698