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

Side by Side Diff: src/heap.cc

Issue 148153010: Synchronize with r15701. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 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/heap.h ('k') | src/heap-snapshot-generator.cc » ('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 3159 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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
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
OLDNEW
« no previous file with comments | « src/heap.h ('k') | src/heap-snapshot-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698