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

Unified Diff: src/heap.cc

Issue 246743003: Dictionary::New() handlified. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/factory.cc ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index 858dbf4343ef64b74cd2324c310cfe04e7392928..c1e0c9b0243e0cb947b034df15adc461aea37dbb 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -2916,20 +2916,13 @@ bool Heap::CreateInitialObjects() {
}
hidden_string_ = String::cast(obj);
- // Allocate the code_stubs dictionary. The initial size is set to avoid
+ // Create the code_stubs dictionary. The initial size is set to avoid
// expanding the dictionary during bootstrapping.
- { MaybeObject* maybe_obj = UnseededNumberDictionary::Allocate(this, 128);
- if (!maybe_obj->ToObject(&obj)) return false;
- }
- set_code_stubs(UnseededNumberDictionary::cast(obj));
+ set_code_stubs(*UnseededNumberDictionary::New(isolate(), 128));
-
- // Allocate the non_monomorphic_cache used in stub-cache.cc. The initial size
+ // Create the non_monomorphic_cache used in stub-cache.cc. The initial size
// is set to avoid expanding the dictionary during bootstrapping.
- { MaybeObject* maybe_obj = UnseededNumberDictionary::Allocate(this, 64);
- if (!maybe_obj->ToObject(&obj)) return false;
- }
- set_non_monomorphic_cache(UnseededNumberDictionary::cast(obj));
+ set_non_monomorphic_cache(*UnseededNumberDictionary::New(isolate(), 64));
{ MaybeObject* maybe_obj = AllocatePolymorphicCodeCache();
if (!maybe_obj->ToObject(&obj)) return false;
@@ -3037,11 +3030,12 @@ bool Heap::CreateInitialObjects() {
Symbol::cast(obj)->set_is_private(true);
set_megamorphic_symbol(Symbol::cast(obj));
- { MaybeObject* maybe_obj = SeededNumberDictionary::Allocate(this, 0, TENURED);
- if (!maybe_obj->ToObject(&obj)) return false;
+ {
+ Handle<SeededNumberDictionary> dict =
+ SeededNumberDictionary::New(isolate(), 0, TENURED);
+ dict->set_requires_slow_elements();
+ set_empty_slow_element_dictionary(*dict);
}
- SeededNumberDictionary::cast(obj)->set_requires_slow_elements();
- set_empty_slow_element_dictionary(SeededNumberDictionary::cast(obj));
{ MaybeObject* maybe_obj = AllocateSymbol();
if (!maybe_obj->ToObject(&obj)) return false;
« no previous file with comments | « src/factory.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698