OLD | NEW |
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 4141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4152 MaybeObject* maybe_global = Allocate(map, OLD_POINTER_SPACE); | 4152 MaybeObject* maybe_global = Allocate(map, OLD_POINTER_SPACE); |
4153 if (!maybe_global->To(&global)) return maybe_global; | 4153 if (!maybe_global->To(&global)) return maybe_global; |
4154 | 4154 |
4155 InitializeJSObjectFromMap(global, dictionary, map); | 4155 InitializeJSObjectFromMap(global, dictionary, map); |
4156 | 4156 |
4157 // Create a new map for the global object. | 4157 // Create a new map for the global object. |
4158 Map* new_map; | 4158 Map* new_map; |
4159 MaybeObject* maybe_map = map->CopyDropDescriptors(); | 4159 MaybeObject* maybe_map = map->CopyDropDescriptors(); |
4160 if (!maybe_map->To(&new_map)) return maybe_map; | 4160 if (!maybe_map->To(&new_map)) return maybe_map; |
4161 | 4161 |
4162 ASSERT(new_map->LastAdded() == Map::kNoneAdded); | |
4163 | |
4164 // Set up the global object as a normalized object. | 4162 // Set up the global object as a normalized object. |
4165 global->set_map(new_map); | 4163 global->set_map(new_map); |
4166 global->set_properties(dictionary); | 4164 global->set_properties(dictionary); |
4167 | 4165 |
4168 // Make sure result is a global object with properties in dictionary. | 4166 // Make sure result is a global object with properties in dictionary. |
4169 ASSERT(global->IsGlobalObject()); | 4167 ASSERT(global->IsGlobalObject()); |
4170 ASSERT(!global->HasFastProperties()); | 4168 ASSERT(!global->HasFastProperties()); |
4171 return global; | 4169 return global; |
4172 } | 4170 } |
4173 | 4171 |
(...skipping 3057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7231 static_cast<int>(object_sizes_last_time_[index])); | 7229 static_cast<int>(object_sizes_last_time_[index])); |
7232 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) | 7230 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) |
7233 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 7231 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
7234 | 7232 |
7235 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 7233 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
7236 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 7234 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
7237 ClearObjectStats(); | 7235 ClearObjectStats(); |
7238 } | 7236 } |
7239 | 7237 |
7240 } } // namespace v8::internal | 7238 } } // namespace v8::internal |
OLD | NEW |