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

Side by Side Diff: src/heap.cc

Issue 9190001: Backport @10366 to 3.6 Base URL: http://v8.googlecode.com/svn/branches/3.6/
Patch Set: '' Created 8 years, 11 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
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 2163 matching lines...) Expand 10 before | Expand all | Expand 10 after
2174 2174
2175 // Allocate the foreign for __proto__. 2175 // Allocate the foreign for __proto__.
2176 { MaybeObject* maybe_obj = 2176 { MaybeObject* maybe_obj =
2177 AllocateForeign((Address) &Accessors::ObjectPrototype); 2177 AllocateForeign((Address) &Accessors::ObjectPrototype);
2178 if (!maybe_obj->ToObject(&obj)) return false; 2178 if (!maybe_obj->ToObject(&obj)) return false;
2179 } 2179 }
2180 set_prototype_accessors(Foreign::cast(obj)); 2180 set_prototype_accessors(Foreign::cast(obj));
2181 2181
2182 // Allocate the code_stubs dictionary. The initial size is set to avoid 2182 // Allocate the code_stubs dictionary. The initial size is set to avoid
2183 // expanding the dictionary during bootstrapping. 2183 // expanding the dictionary during bootstrapping.
2184 { MaybeObject* maybe_obj = NumberDictionary::Allocate(128); 2184 { MaybeObject* maybe_obj = UnseededNumberDictionary::Allocate(128);
2185 if (!maybe_obj->ToObject(&obj)) return false; 2185 if (!maybe_obj->ToObject(&obj)) return false;
2186 } 2186 }
2187 set_code_stubs(NumberDictionary::cast(obj)); 2187 set_code_stubs(UnseededNumberDictionary::cast(obj));
2188 2188
2189 // Allocate the non_monomorphic_cache used in stub-cache.cc. The initial size 2189 // Allocate the non_monomorphic_cache used in stub-cache.cc. The initial size
2190 // is set to avoid expanding the dictionary during bootstrapping. 2190 // is set to avoid expanding the dictionary during bootstrapping.
2191 { MaybeObject* maybe_obj = NumberDictionary::Allocate(64); 2191 { MaybeObject* maybe_obj = UnseededNumberDictionary::Allocate(64);
2192 if (!maybe_obj->ToObject(&obj)) return false; 2192 if (!maybe_obj->ToObject(&obj)) return false;
2193 } 2193 }
2194 set_non_monomorphic_cache(NumberDictionary::cast(obj)); 2194 set_non_monomorphic_cache(UnseededNumberDictionary::cast(obj));
2195 2195
2196 { MaybeObject* maybe_obj = AllocatePolymorphicCodeCache(); 2196 { MaybeObject* maybe_obj = AllocatePolymorphicCodeCache();
2197 if (!maybe_obj->ToObject(&obj)) return false; 2197 if (!maybe_obj->ToObject(&obj)) return false;
2198 } 2198 }
2199 set_polymorphic_code_cache(PolymorphicCodeCache::cast(obj)); 2199 set_polymorphic_code_cache(PolymorphicCodeCache::cast(obj));
2200 2200
2201 set_instanceof_cache_function(Smi::FromInt(0)); 2201 set_instanceof_cache_function(Smi::FromInt(0));
2202 set_instanceof_cache_map(Smi::FromInt(0)); 2202 set_instanceof_cache_map(Smi::FromInt(0));
2203 set_instanceof_cache_answer(Smi::FromInt(0)); 2203 set_instanceof_cache_answer(Smi::FromInt(0));
2204 2204
(...skipping 3150 matching lines...) Expand 10 before | Expand all | Expand 10 after
5355 if (cell_space_ == NULL) return false; 5355 if (cell_space_ == NULL) return false;
5356 if (!cell_space_->Setup(NULL, 0)) return false; 5356 if (!cell_space_->Setup(NULL, 0)) return false;
5357 5357
5358 // The large object code space may contain code or data. We set the memory 5358 // The large object code space may contain code or data. We set the memory
5359 // to be non-executable here for safety, but this means we need to enable it 5359 // to be non-executable here for safety, but this means we need to enable it
5360 // explicitly when allocating large code objects. 5360 // explicitly when allocating large code objects.
5361 lo_space_ = new LargeObjectSpace(this, LO_SPACE); 5361 lo_space_ = new LargeObjectSpace(this, LO_SPACE);
5362 if (lo_space_ == NULL) return false; 5362 if (lo_space_ == NULL) return false;
5363 if (!lo_space_->Setup()) return false; 5363 if (!lo_space_->Setup()) return false;
5364 5364
5365 // Set up the seed that is used to randomize the string hash function. 5365 // Setup the seed that is used to randomize the string hash function.
Erik Corry 2012/01/19 15:35:00 AAAAArhg! :-)
5366 ASSERT(string_hash_seed() == 0); 5366 ASSERT(hash_seed() == 0);
5367 if (FLAG_randomize_string_hashes) { 5367 if (FLAG_randomize_hashes) {
5368 if (FLAG_string_hash_seed == 0) { 5368 if (FLAG_hash_seed == 0) {
5369 set_string_hash_seed( 5369 set_hash_seed(
5370 Smi::FromInt(V8::RandomPrivate(isolate()) & 0x3fffffff)); 5370 Smi::FromInt(V8::RandomPrivate(isolate()) & 0x3fffffff));
5371 } else { 5371 } else {
5372 set_string_hash_seed(Smi::FromInt(FLAG_string_hash_seed)); 5372 set_hash_seed(Smi::FromInt(FLAG_hash_seed));
5373 } 5373 }
5374 } 5374 }
5375 5375
5376 if (create_heap_objects) { 5376 if (create_heap_objects) {
5377 // Create initial maps. 5377 // Create initial maps.
5378 if (!CreateInitialMaps()) return false; 5378 if (!CreateInitialMaps()) return false;
5379 if (!CreateApiObjects()) return false; 5379 if (!CreateApiObjects()) return false;
5380 5380
5381 // Create initial objects 5381 // Create initial objects
5382 if (!CreateInitialObjects()) return false; 5382 if (!CreateInitialObjects()) return false;
(...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after
6286 } 6286 }
6287 6287
6288 6288
6289 void ExternalStringTable::TearDown() { 6289 void ExternalStringTable::TearDown() {
6290 new_space_strings_.Free(); 6290 new_space_strings_.Free();
6291 old_space_strings_.Free(); 6291 old_space_strings_.Free();
6292 } 6292 }
6293 6293
6294 6294
6295 } } // namespace v8::internal 6295 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698