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 4171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4182 | 4182 |
4183 // Initial size of the backing store to avoid resize of the storage during | 4183 // Initial size of the backing store to avoid resize of the storage during |
4184 // bootstrapping. The size differs between the JS global object ad the | 4184 // bootstrapping. The size differs between the JS global object ad the |
4185 // builtins object. | 4185 // builtins object. |
4186 int initial_size = map->instance_type() == JS_GLOBAL_OBJECT_TYPE ? 64 : 512; | 4186 int initial_size = map->instance_type() == JS_GLOBAL_OBJECT_TYPE ? 64 : 512; |
4187 | 4187 |
4188 // Allocate a dictionary object for backing storage. | 4188 // Allocate a dictionary object for backing storage. |
4189 StringDictionary* dictionary; | 4189 StringDictionary* dictionary; |
4190 MaybeObject* maybe_dictionary = | 4190 MaybeObject* maybe_dictionary = |
4191 StringDictionary::Allocate( | 4191 StringDictionary::Allocate( |
4192 map->NumberOfDescribedProperties() * 2 + initial_size); | 4192 map->NumberOfOwnDescriptors() * 2 + initial_size); |
4193 if (!maybe_dictionary->To(&dictionary)) return maybe_dictionary; | 4193 if (!maybe_dictionary->To(&dictionary)) return maybe_dictionary; |
4194 | 4194 |
4195 // The global object might be created from an object template with accessors. | 4195 // The global object might be created from an object template with accessors. |
4196 // Fill these accessors into the dictionary. | 4196 // Fill these accessors into the dictionary. |
4197 DescriptorArray* descs = map->instance_descriptors(); | 4197 DescriptorArray* descs = map->instance_descriptors(); |
4198 for (int i = 0; i < descs->number_of_descriptors(); i++) { | 4198 for (int i = 0; i < descs->number_of_descriptors(); i++) { |
4199 PropertyDetails details = descs->GetDetails(i); | 4199 PropertyDetails details = descs->GetDetails(i); |
4200 ASSERT(details.type() == CALLBACKS); // Only accessors are expected. | 4200 ASSERT(details.type() == CALLBACKS); // Only accessors are expected. |
4201 PropertyDetails d = PropertyDetails(details.attributes(), | 4201 PropertyDetails d = PropertyDetails(details.attributes(), |
4202 CALLBACKS, | 4202 CALLBACKS, |
(...skipping 3117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7320 static_cast<int>(object_sizes_last_time_[index])); | 7320 static_cast<int>(object_sizes_last_time_[index])); |
7321 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) | 7321 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) |
7322 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 7322 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
7323 | 7323 |
7324 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 7324 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
7325 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 7325 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
7326 ClearObjectStats(); | 7326 ClearObjectStats(); |
7327 } | 7327 } |
7328 | 7328 |
7329 } } // namespace v8::internal | 7329 } } // namespace v8::internal |
OLD | NEW |