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 3824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3835 } | 3835 } |
3836 | 3836 |
3837 | 3837 |
3838 void JSObject::MigrateInstance(Handle<JSObject> object) { | 3838 void JSObject::MigrateInstance(Handle<JSObject> object) { |
3839 // Converting any field to the most specific type will cause the | 3839 // Converting any field to the most specific type will cause the |
3840 // GeneralizeFieldRepresentation algorithm to create the most general existing | 3840 // GeneralizeFieldRepresentation algorithm to create the most general existing |
3841 // transition that matches the object. This achieves what is needed. | 3841 // transition that matches the object. This achieves what is needed. |
3842 Handle<Map> original_map(object->map()); | 3842 Handle<Map> original_map(object->map()); |
3843 GeneralizeFieldRepresentation( | 3843 GeneralizeFieldRepresentation( |
3844 object, 0, Representation::None(), ALLOW_AS_CONSTANT); | 3844 object, 0, Representation::None(), ALLOW_AS_CONSTANT); |
| 3845 original_map->set_has_migrated(true); |
3845 if (FLAG_trace_migration) { | 3846 if (FLAG_trace_migration) { |
3846 object->PrintInstanceMigration(stdout, *original_map, object->map()); | 3847 object->PrintInstanceMigration(stdout, *original_map, object->map()); |
3847 } | 3848 } |
3848 } | 3849 } |
3849 | 3850 |
3850 | 3851 |
3851 Handle<Object> JSObject::TryMigrateInstance(Handle<JSObject> object) { | 3852 Handle<Object> JSObject::TryMigrateInstance(Handle<JSObject> object) { |
3852 Map* new_map = object->map()->CurrentMapForDeprecated(); | 3853 Map* new_map = object->map()->CurrentMapForDeprecated(); |
3853 if (new_map == NULL) return Handle<Object>(); | 3854 if (new_map == NULL) return Handle<Object>(); |
3854 Handle<Map> original_map(object->map()); | 3855 Handle<Map> original_map(object->map()); |
(...skipping 12541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16396 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16397 #define ERROR_MESSAGES_TEXTS(C, T) T, |
16397 static const char* error_messages_[] = { | 16398 static const char* error_messages_[] = { |
16398 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16399 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
16399 }; | 16400 }; |
16400 #undef ERROR_MESSAGES_TEXTS | 16401 #undef ERROR_MESSAGES_TEXTS |
16401 return error_messages_[reason]; | 16402 return error_messages_[reason]; |
16402 } | 16403 } |
16403 | 16404 |
16404 | 16405 |
16405 } } // namespace v8::internal | 16406 } } // namespace v8::internal |
OLD | NEW |