Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Side by Side Diff: src/heap.cc

Issue 19207002: Reland deprecation of HAllocateObject in favor of HAllocate. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/flag-definitions.h ('k') | src/hydrogen.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 4431 matching lines...) Expand 10 before | Expand all | Expand 10 after
4442 // JSFunctions should be allocated using AllocateFunction to be 4442 // JSFunctions should be allocated using AllocateFunction to be
4443 // properly initialized. 4443 // properly initialized.
4444 ASSERT(map->instance_type() != JS_FUNCTION_TYPE); 4444 ASSERT(map->instance_type() != JS_FUNCTION_TYPE);
4445 4445
4446 // Both types of global objects should be allocated using 4446 // Both types of global objects should be allocated using
4447 // AllocateGlobalObject to be properly initialized. 4447 // AllocateGlobalObject to be properly initialized.
4448 ASSERT(map->instance_type() != JS_GLOBAL_OBJECT_TYPE); 4448 ASSERT(map->instance_type() != JS_GLOBAL_OBJECT_TYPE);
4449 ASSERT(map->instance_type() != JS_BUILTINS_OBJECT_TYPE); 4449 ASSERT(map->instance_type() != JS_BUILTINS_OBJECT_TYPE);
4450 4450
4451 // Allocate the backing storage for the properties. 4451 // Allocate the backing storage for the properties.
4452 int prop_size = 4452 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); 4453 ASSERT(prop_size >= 0);
4457 Object* properties; 4454 Object* properties;
4458 { MaybeObject* maybe_properties = AllocateFixedArray(prop_size, pretenure); 4455 { MaybeObject* maybe_properties = AllocateFixedArray(prop_size, pretenure);
4459 if (!maybe_properties->ToObject(&properties)) return maybe_properties; 4456 if (!maybe_properties->ToObject(&properties)) return maybe_properties;
4460 } 4457 }
4461 4458
4462 // Allocate the JSObject. 4459 // Allocate the JSObject.
4463 AllocationSpace space = 4460 AllocationSpace space =
4464 (pretenure == TENURED) ? OLD_POINTER_SPACE : NEW_SPACE; 4461 (pretenure == TENURED) ? OLD_POINTER_SPACE : NEW_SPACE;
4465 if (map->instance_size() > Page::kMaxNonCodeHeapObjectSize) space = LO_SPACE; 4462 if (map->instance_size() > Page::kMaxNonCodeHeapObjectSize) space = LO_SPACE;
(...skipping 16 matching lines...) Expand all
4482 // JSFunctions should be allocated using AllocateFunction to be 4479 // JSFunctions should be allocated using AllocateFunction to be
4483 // properly initialized. 4480 // properly initialized.
4484 ASSERT(map->instance_type() != JS_FUNCTION_TYPE); 4481 ASSERT(map->instance_type() != JS_FUNCTION_TYPE);
4485 4482
4486 // Both types of global objects should be allocated using 4483 // Both types of global objects should be allocated using
4487 // AllocateGlobalObject to be properly initialized. 4484 // AllocateGlobalObject to be properly initialized.
4488 ASSERT(map->instance_type() != JS_GLOBAL_OBJECT_TYPE); 4485 ASSERT(map->instance_type() != JS_GLOBAL_OBJECT_TYPE);
4489 ASSERT(map->instance_type() != JS_BUILTINS_OBJECT_TYPE); 4486 ASSERT(map->instance_type() != JS_BUILTINS_OBJECT_TYPE);
4490 4487
4491 // Allocate the backing storage for the properties. 4488 // Allocate the backing storage for the properties.
4492 int prop_size = 4489 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); 4490 ASSERT(prop_size >= 0);
4497 Object* properties; 4491 Object* properties;
4498 { MaybeObject* maybe_properties = AllocateFixedArray(prop_size); 4492 { MaybeObject* maybe_properties = AllocateFixedArray(prop_size);
4499 if (!maybe_properties->ToObject(&properties)) return maybe_properties; 4493 if (!maybe_properties->ToObject(&properties)) return maybe_properties;
4500 } 4494 }
4501 4495
4502 // Allocate the JSObject. 4496 // Allocate the JSObject.
4503 AllocationSpace space = NEW_SPACE; 4497 AllocationSpace space = NEW_SPACE;
4504 if (map->instance_size() > Page::kMaxNonCodeHeapObjectSize) space = LO_SPACE; 4498 if (map->instance_size() > Page::kMaxNonCodeHeapObjectSize) space = LO_SPACE;
4505 Object* obj; 4499 Object* obj;
(...skipping 3635 matching lines...) Expand 10 before | Expand all | Expand 10 after
8141 if (FLAG_parallel_recompilation) { 8135 if (FLAG_parallel_recompilation) {
8142 heap_->relocation_mutex_->Lock(); 8136 heap_->relocation_mutex_->Lock();
8143 #ifdef DEBUG 8137 #ifdef DEBUG
8144 heap_->relocation_mutex_locked_by_optimizer_thread_ = 8138 heap_->relocation_mutex_locked_by_optimizer_thread_ =
8145 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); 8139 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread();
8146 #endif // DEBUG 8140 #endif // DEBUG
8147 } 8141 }
8148 } 8142 }
8149 8143
8150 } } // namespace v8::internal 8144 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/flag-definitions.h ('k') | src/hydrogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698