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

Side by Side Diff: src/heap.cc

Issue 160382: Avoid dictionary expansion during bootstrapping (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 4 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/handles.cc ('k') | src/objects.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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 1425 matching lines...) Expand 10 before | Expand all | Expand 10 after
1436 // that it will always be at the first entry in property descriptors. 1436 // that it will always be at the first entry in property descriptors.
1437 obj = AllocateSymbol(CStrVector(""), 0, String::kHashComputedMask); 1437 obj = AllocateSymbol(CStrVector(""), 0, String::kHashComputedMask);
1438 if (obj->IsFailure()) return false; 1438 if (obj->IsFailure()) return false;
1439 hidden_symbol_ = String::cast(obj); 1439 hidden_symbol_ = String::cast(obj);
1440 1440
1441 // Allocate the proxy for __proto__. 1441 // Allocate the proxy for __proto__.
1442 obj = AllocateProxy((Address) &Accessors::ObjectPrototype); 1442 obj = AllocateProxy((Address) &Accessors::ObjectPrototype);
1443 if (obj->IsFailure()) return false; 1443 if (obj->IsFailure()) return false;
1444 set_prototype_accessors(Proxy::cast(obj)); 1444 set_prototype_accessors(Proxy::cast(obj));
1445 1445
1446 // Allocate the code_stubs dictionary. 1446 // Allocate the code_stubs dictionary. The initial size is set to avoid
1447 obj = NumberDictionary::Allocate(4); 1447 // expanding the dictionary during bootstrapping.
1448 obj = NumberDictionary::Allocate(128);
1448 if (obj->IsFailure()) return false; 1449 if (obj->IsFailure()) return false;
1449 set_code_stubs(NumberDictionary::cast(obj)); 1450 set_code_stubs(NumberDictionary::cast(obj));
1450 1451
1451 // Allocate the non_monomorphic_cache used in stub-cache.cc 1452 // Allocate the non_monomorphic_cache used in stub-cache.cc. The initial size
1452 obj = NumberDictionary::Allocate(4); 1453 // is set to avoid expanding the dictionary during bootstrapping.
1454 obj = NumberDictionary::Allocate(64);
1453 if (obj->IsFailure()) return false; 1455 if (obj->IsFailure()) return false;
1454 set_non_monomorphic_cache(NumberDictionary::cast(obj)); 1456 set_non_monomorphic_cache(NumberDictionary::cast(obj));
1455 1457
1456 CreateFixedStubs(); 1458 CreateFixedStubs();
1457 1459
1458 // Allocate the number->string conversion cache 1460 // Allocate the number->string conversion cache
1459 obj = AllocateFixedArray(kNumberStringCacheSize * 2); 1461 obj = AllocateFixedArray(kNumberStringCacheSize * 2);
1460 if (obj->IsFailure()) return false; 1462 if (obj->IsFailure()) return false;
1461 set_number_string_cache(FixedArray::cast(obj)); 1463 set_number_string_cache(FixedArray::cast(obj));
1462 1464
(...skipping 2425 matching lines...) Expand 10 before | Expand all | Expand 10 after
3888 #ifdef DEBUG 3890 #ifdef DEBUG
3889 bool Heap::GarbageCollectionGreedyCheck() { 3891 bool Heap::GarbageCollectionGreedyCheck() {
3890 ASSERT(FLAG_gc_greedy); 3892 ASSERT(FLAG_gc_greedy);
3891 if (Bootstrapper::IsActive()) return true; 3893 if (Bootstrapper::IsActive()) return true;
3892 if (disallow_allocation_failure()) return true; 3894 if (disallow_allocation_failure()) return true;
3893 return CollectGarbage(0, NEW_SPACE); 3895 return CollectGarbage(0, NEW_SPACE);
3894 } 3896 }
3895 #endif 3897 #endif
3896 3898
3897 } } // namespace v8::internal 3899 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/handles.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698