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 3857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3868 } | 3868 } |
3869 | 3869 |
3870 | 3870 |
3871 void JSObject::MigrateInstance(Handle<JSObject> object) { | 3871 void JSObject::MigrateInstance(Handle<JSObject> object) { |
3872 // Converting any field to the most specific type will cause the | 3872 // Converting any field to the most specific type will cause the |
3873 // GeneralizeFieldRepresentation algorithm to create the most general existing | 3873 // GeneralizeFieldRepresentation algorithm to create the most general existing |
3874 // transition that matches the object. This achieves what is needed. | 3874 // transition that matches the object. This achieves what is needed. |
3875 Handle<Map> original_map(object->map()); | 3875 Handle<Map> original_map(object->map()); |
3876 GeneralizeFieldRepresentation( | 3876 GeneralizeFieldRepresentation( |
3877 object, 0, Representation::None(), ALLOW_AS_CONSTANT); | 3877 object, 0, Representation::None(), ALLOW_AS_CONSTANT); |
| 3878 original_map->set_has_migrated(true); |
3878 if (FLAG_trace_migration) { | 3879 if (FLAG_trace_migration) { |
3879 object->PrintInstanceMigration(stdout, *original_map, object->map()); | 3880 object->PrintInstanceMigration(stdout, *original_map, object->map()); |
3880 } | 3881 } |
3881 } | 3882 } |
3882 | 3883 |
3883 | 3884 |
3884 Handle<Object> JSObject::TryMigrateInstance(Handle<JSObject> object) { | 3885 Handle<Object> JSObject::TryMigrateInstance(Handle<JSObject> object) { |
3885 Map* new_map = object->map()->CurrentMapForDeprecated(); | 3886 Map* new_map = object->map()->CurrentMapForDeprecated(); |
3886 if (new_map == NULL) return Handle<Object>(); | 3887 if (new_map == NULL) return Handle<Object>(); |
3887 Handle<Map> original_map(object->map()); | 3888 Handle<Map> original_map(object->map()); |
(...skipping 12780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16668 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16669 #define ERROR_MESSAGES_TEXTS(C, T) T, |
16669 static const char* error_messages_[] = { | 16670 static const char* error_messages_[] = { |
16670 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16671 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
16671 }; | 16672 }; |
16672 #undef ERROR_MESSAGES_TEXTS | 16673 #undef ERROR_MESSAGES_TEXTS |
16673 return error_messages_[reason]; | 16674 return error_messages_[reason]; |
16674 } | 16675 } |
16675 | 16676 |
16676 | 16677 |
16677 } } // namespace v8::internal | 16678 } } // namespace v8::internal |
OLD | NEW |