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 4343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4354 MaybeObject* Heap::AllocateJSGeneratorObject(JSFunction *function) { | 4354 MaybeObject* Heap::AllocateJSGeneratorObject(JSFunction *function) { |
4355 ASSERT(function->shared()->is_generator()); | 4355 ASSERT(function->shared()->is_generator()); |
4356 Map *map; | 4356 Map *map; |
4357 if (function->has_initial_map()) { | 4357 if (function->has_initial_map()) { |
4358 map = function->initial_map(); | 4358 map = function->initial_map(); |
4359 } else { | 4359 } else { |
4360 // Allocate the initial map if absent. | 4360 // Allocate the initial map if absent. |
4361 MaybeObject* maybe_map = AllocateInitialMap(function); | 4361 MaybeObject* maybe_map = AllocateInitialMap(function); |
4362 if (!maybe_map->To(&map)) return maybe_map; | 4362 if (!maybe_map->To(&map)) return maybe_map; |
4363 function->set_initial_map(map); | 4363 function->set_initial_map(map); |
| 4364 map->set_constructor(function); |
4364 } | 4365 } |
4365 ASSERT(map->instance_type() == JS_GENERATOR_OBJECT_TYPE); | 4366 ASSERT(map->instance_type() == JS_GENERATOR_OBJECT_TYPE); |
4366 return AllocateJSObjectFromMap(map); | 4367 return AllocateJSObjectFromMap(map); |
4367 } | 4368 } |
4368 | 4369 |
4369 | 4370 |
4370 MaybeObject* Heap::AllocateJSModule(Context* context, ScopeInfo* scope_info) { | 4371 MaybeObject* Heap::AllocateJSModule(Context* context, ScopeInfo* scope_info) { |
4371 // Allocate a fresh map. Modules do not have a prototype. | 4372 // Allocate a fresh map. Modules do not have a prototype. |
4372 Map* map; | 4373 Map* map; |
4373 MaybeObject* maybe_map = AllocateMap(JS_MODULE_TYPE, JSModule::kSize); | 4374 MaybeObject* maybe_map = AllocateMap(JS_MODULE_TYPE, JSModule::kSize); |
(...skipping 3486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7860 static_cast<int>(object_sizes_last_time_[index])); | 7861 static_cast<int>(object_sizes_last_time_[index])); |
7861 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) | 7862 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) |
7862 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 7863 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
7863 | 7864 |
7864 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 7865 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
7865 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 7866 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
7866 ClearObjectStats(); | 7867 ClearObjectStats(); |
7867 } | 7868 } |
7868 | 7869 |
7869 } } // namespace v8::internal | 7870 } } // namespace v8::internal |
OLD | NEW |