| 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 3159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3170 if (!maybe_obj->ToObject(&obj)) return false; | 3170 if (!maybe_obj->ToObject(&obj)) return false; |
| 3171 } | 3171 } |
| 3172 set_frozen_symbol(Symbol::cast(obj)); | 3172 set_frozen_symbol(Symbol::cast(obj)); |
| 3173 | 3173 |
| 3174 { MaybeObject* maybe_obj = SeededNumberDictionary::Allocate(this, 0, TENURED); | 3174 { MaybeObject* maybe_obj = SeededNumberDictionary::Allocate(this, 0, TENURED); |
| 3175 if (!maybe_obj->ToObject(&obj)) return false; | 3175 if (!maybe_obj->ToObject(&obj)) return false; |
| 3176 } | 3176 } |
| 3177 SeededNumberDictionary::cast(obj)->set_requires_slow_elements(); | 3177 SeededNumberDictionary::cast(obj)->set_requires_slow_elements(); |
| 3178 set_empty_slow_element_dictionary(SeededNumberDictionary::cast(obj)); | 3178 set_empty_slow_element_dictionary(SeededNumberDictionary::cast(obj)); |
| 3179 | 3179 |
| 3180 { MaybeObject* maybe_obj = AllocateSymbol(); |
| 3181 if (!maybe_obj->ToObject(&obj)) return false; |
| 3182 } |
| 3183 set_observed_symbol(Symbol::cast(obj)); |
| 3184 |
| 3180 // Handling of script id generation is in Factory::NewScript. | 3185 // Handling of script id generation is in Factory::NewScript. |
| 3181 set_last_script_id(Smi::FromInt(v8::Script::kNoScriptId)); | 3186 set_last_script_id(Smi::FromInt(v8::Script::kNoScriptId)); |
| 3182 | 3187 |
| 3183 // Initialize keyed lookup cache. | 3188 // Initialize keyed lookup cache. |
| 3184 isolate_->keyed_lookup_cache()->Clear(); | 3189 isolate_->keyed_lookup_cache()->Clear(); |
| 3185 | 3190 |
| 3186 // Initialize context slot cache. | 3191 // Initialize context slot cache. |
| 3187 isolate_->context_slot_cache()->Clear(); | 3192 isolate_->context_slot_cache()->Clear(); |
| 3188 | 3193 |
| 3189 // Initialize descriptor cache. | 3194 // Initialize descriptor cache. |
| (...skipping 1252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4442 // JSFunctions should be allocated using AllocateFunction to be | 4447 // JSFunctions should be allocated using AllocateFunction to be |
| 4443 // properly initialized. | 4448 // properly initialized. |
| 4444 ASSERT(map->instance_type() != JS_FUNCTION_TYPE); | 4449 ASSERT(map->instance_type() != JS_FUNCTION_TYPE); |
| 4445 | 4450 |
| 4446 // Both types of global objects should be allocated using | 4451 // Both types of global objects should be allocated using |
| 4447 // AllocateGlobalObject to be properly initialized. | 4452 // AllocateGlobalObject to be properly initialized. |
| 4448 ASSERT(map->instance_type() != JS_GLOBAL_OBJECT_TYPE); | 4453 ASSERT(map->instance_type() != JS_GLOBAL_OBJECT_TYPE); |
| 4449 ASSERT(map->instance_type() != JS_BUILTINS_OBJECT_TYPE); | 4454 ASSERT(map->instance_type() != JS_BUILTINS_OBJECT_TYPE); |
| 4450 | 4455 |
| 4451 // Allocate the backing storage for the properties. | 4456 // Allocate the backing storage for the properties. |
| 4452 int prop_size = | 4457 int prop_size = map->InitialPropertiesLength(); |
| 4453 map->pre_allocated_property_fields() + | |
| 4454 map->unused_property_fields() - | |
| 4455 map->inobject_properties(); | |
| 4456 ASSERT(prop_size >= 0); | 4458 ASSERT(prop_size >= 0); |
| 4457 Object* properties; | 4459 Object* properties; |
| 4458 { MaybeObject* maybe_properties = AllocateFixedArray(prop_size, pretenure); | 4460 { MaybeObject* maybe_properties = AllocateFixedArray(prop_size, pretenure); |
| 4459 if (!maybe_properties->ToObject(&properties)) return maybe_properties; | 4461 if (!maybe_properties->ToObject(&properties)) return maybe_properties; |
| 4460 } | 4462 } |
| 4461 | 4463 |
| 4462 // Allocate the JSObject. | 4464 // Allocate the JSObject. |
| 4463 AllocationSpace space = | 4465 AllocationSpace space = |
| 4464 (pretenure == TENURED) ? OLD_POINTER_SPACE : NEW_SPACE; | 4466 (pretenure == TENURED) ? OLD_POINTER_SPACE : NEW_SPACE; |
| 4465 if (map->instance_size() > Page::kMaxNonCodeHeapObjectSize) space = LO_SPACE; | 4467 if (map->instance_size() > Page::kMaxNonCodeHeapObjectSize) space = LO_SPACE; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 4482 // JSFunctions should be allocated using AllocateFunction to be | 4484 // JSFunctions should be allocated using AllocateFunction to be |
| 4483 // properly initialized. | 4485 // properly initialized. |
| 4484 ASSERT(map->instance_type() != JS_FUNCTION_TYPE); | 4486 ASSERT(map->instance_type() != JS_FUNCTION_TYPE); |
| 4485 | 4487 |
| 4486 // Both types of global objects should be allocated using | 4488 // Both types of global objects should be allocated using |
| 4487 // AllocateGlobalObject to be properly initialized. | 4489 // AllocateGlobalObject to be properly initialized. |
| 4488 ASSERT(map->instance_type() != JS_GLOBAL_OBJECT_TYPE); | 4490 ASSERT(map->instance_type() != JS_GLOBAL_OBJECT_TYPE); |
| 4489 ASSERT(map->instance_type() != JS_BUILTINS_OBJECT_TYPE); | 4491 ASSERT(map->instance_type() != JS_BUILTINS_OBJECT_TYPE); |
| 4490 | 4492 |
| 4491 // Allocate the backing storage for the properties. | 4493 // Allocate the backing storage for the properties. |
| 4492 int prop_size = | 4494 int prop_size = map->InitialPropertiesLength(); |
| 4493 map->pre_allocated_property_fields() + | |
| 4494 map->unused_property_fields() - | |
| 4495 map->inobject_properties(); | |
| 4496 ASSERT(prop_size >= 0); | 4495 ASSERT(prop_size >= 0); |
| 4497 Object* properties; | 4496 Object* properties; |
| 4498 { MaybeObject* maybe_properties = AllocateFixedArray(prop_size); | 4497 { MaybeObject* maybe_properties = AllocateFixedArray(prop_size); |
| 4499 if (!maybe_properties->ToObject(&properties)) return maybe_properties; | 4498 if (!maybe_properties->ToObject(&properties)) return maybe_properties; |
| 4500 } | 4499 } |
| 4501 | 4500 |
| 4502 // Allocate the JSObject. | 4501 // Allocate the JSObject. |
| 4503 AllocationSpace space = NEW_SPACE; | 4502 AllocationSpace space = NEW_SPACE; |
| 4504 if (map->instance_size() > Page::kMaxNonCodeHeapObjectSize) space = LO_SPACE; | 4503 if (map->instance_size() > Page::kMaxNonCodeHeapObjectSize) space = LO_SPACE; |
| 4505 Object* obj; | 4504 Object* obj; |
| (...skipping 3635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8141 if (FLAG_parallel_recompilation) { | 8140 if (FLAG_parallel_recompilation) { |
| 8142 heap_->relocation_mutex_->Lock(); | 8141 heap_->relocation_mutex_->Lock(); |
| 8143 #ifdef DEBUG | 8142 #ifdef DEBUG |
| 8144 heap_->relocation_mutex_locked_by_optimizer_thread_ = | 8143 heap_->relocation_mutex_locked_by_optimizer_thread_ = |
| 8145 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); | 8144 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); |
| 8146 #endif // DEBUG | 8145 #endif // DEBUG |
| 8147 } | 8146 } |
| 8148 } | 8147 } |
| 8149 | 8148 |
| 8150 } } // namespace v8::internal | 8149 } } // namespace v8::internal |
| OLD | NEW |