| 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 4282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4293 // JSFunctions should be allocated using AllocateFunction to be | 4293 // JSFunctions should be allocated using AllocateFunction to be |
| 4294 // properly initialized. | 4294 // properly initialized. |
| 4295 ASSERT(map->instance_type() != JS_FUNCTION_TYPE); | 4295 ASSERT(map->instance_type() != JS_FUNCTION_TYPE); |
| 4296 | 4296 |
| 4297 // Both types of global objects should be allocated using | 4297 // Both types of global objects should be allocated using |
| 4298 // AllocateGlobalObject to be properly initialized. | 4298 // AllocateGlobalObject to be properly initialized. |
| 4299 ASSERT(map->instance_type() != JS_GLOBAL_OBJECT_TYPE); | 4299 ASSERT(map->instance_type() != JS_GLOBAL_OBJECT_TYPE); |
| 4300 ASSERT(map->instance_type() != JS_BUILTINS_OBJECT_TYPE); | 4300 ASSERT(map->instance_type() != JS_BUILTINS_OBJECT_TYPE); |
| 4301 | 4301 |
| 4302 // Allocate the backing storage for the properties. | 4302 // Allocate the backing storage for the properties. |
| 4303 int prop_size = | 4303 int prop_size = map->InitialPropertiesLength(); |
| 4304 map->pre_allocated_property_fields() + | |
| 4305 map->unused_property_fields() - | |
| 4306 map->inobject_properties(); | |
| 4307 ASSERT(prop_size >= 0); | 4304 ASSERT(prop_size >= 0); |
| 4308 Object* properties; | 4305 Object* properties; |
| 4309 { MaybeObject* maybe_properties = AllocateFixedArray(prop_size, pretenure); | 4306 { MaybeObject* maybe_properties = AllocateFixedArray(prop_size, pretenure); |
| 4310 if (!maybe_properties->ToObject(&properties)) return maybe_properties; | 4307 if (!maybe_properties->ToObject(&properties)) return maybe_properties; |
| 4311 } | 4308 } |
| 4312 | 4309 |
| 4313 // Allocate the JSObject. | 4310 // Allocate the JSObject. |
| 4314 AllocationSpace space = | 4311 AllocationSpace space = |
| 4315 (pretenure == TENURED) ? OLD_POINTER_SPACE : NEW_SPACE; | 4312 (pretenure == TENURED) ? OLD_POINTER_SPACE : NEW_SPACE; |
| 4316 if (map->instance_size() > Page::kMaxNonCodeHeapObjectSize) space = LO_SPACE; | 4313 if (map->instance_size() > Page::kMaxNonCodeHeapObjectSize) space = LO_SPACE; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 4333 // JSFunctions should be allocated using AllocateFunction to be | 4330 // JSFunctions should be allocated using AllocateFunction to be |
| 4334 // properly initialized. | 4331 // properly initialized. |
| 4335 ASSERT(map->instance_type() != JS_FUNCTION_TYPE); | 4332 ASSERT(map->instance_type() != JS_FUNCTION_TYPE); |
| 4336 | 4333 |
| 4337 // Both types of global objects should be allocated using | 4334 // Both types of global objects should be allocated using |
| 4338 // AllocateGlobalObject to be properly initialized. | 4335 // AllocateGlobalObject to be properly initialized. |
| 4339 ASSERT(map->instance_type() != JS_GLOBAL_OBJECT_TYPE); | 4336 ASSERT(map->instance_type() != JS_GLOBAL_OBJECT_TYPE); |
| 4340 ASSERT(map->instance_type() != JS_BUILTINS_OBJECT_TYPE); | 4337 ASSERT(map->instance_type() != JS_BUILTINS_OBJECT_TYPE); |
| 4341 | 4338 |
| 4342 // Allocate the backing storage for the properties. | 4339 // Allocate the backing storage for the properties. |
| 4343 int prop_size = | 4340 int prop_size = map->InitialPropertiesLength(); |
| 4344 map->pre_allocated_property_fields() + | |
| 4345 map->unused_property_fields() - | |
| 4346 map->inobject_properties(); | |
| 4347 ASSERT(prop_size >= 0); | 4341 ASSERT(prop_size >= 0); |
| 4348 Object* properties; | 4342 Object* properties; |
| 4349 { MaybeObject* maybe_properties = AllocateFixedArray(prop_size); | 4343 { MaybeObject* maybe_properties = AllocateFixedArray(prop_size); |
| 4350 if (!maybe_properties->ToObject(&properties)) return maybe_properties; | 4344 if (!maybe_properties->ToObject(&properties)) return maybe_properties; |
| 4351 } | 4345 } |
| 4352 | 4346 |
| 4353 // Allocate the JSObject. | 4347 // Allocate the JSObject. |
| 4354 AllocationSpace space = NEW_SPACE; | 4348 AllocationSpace space = NEW_SPACE; |
| 4355 if (map->instance_size() > Page::kMaxNonCodeHeapObjectSize) space = LO_SPACE; | 4349 if (map->instance_size() > Page::kMaxNonCodeHeapObjectSize) space = LO_SPACE; |
| 4356 Object* obj; | 4350 Object* obj; |
| (...skipping 3590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7947 if (FLAG_parallel_recompilation) { | 7941 if (FLAG_parallel_recompilation) { |
| 7948 heap_->relocation_mutex_->Lock(); | 7942 heap_->relocation_mutex_->Lock(); |
| 7949 #ifdef DEBUG | 7943 #ifdef DEBUG |
| 7950 heap_->relocation_mutex_locked_by_optimizer_thread_ = | 7944 heap_->relocation_mutex_locked_by_optimizer_thread_ = |
| 7951 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); | 7945 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); |
| 7952 #endif // DEBUG | 7946 #endif // DEBUG |
| 7953 } | 7947 } |
| 7954 } | 7948 } |
| 7955 | 7949 |
| 7956 } } // namespace v8::internal | 7950 } } // namespace v8::internal |
| OLD | NEW |