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

Unified Diff: src/bootstrapper.cc

Issue 15690018: Handlify map allocation in Genesis::InstallInternalArray. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index d7b74f81408b37e1b22fadfb77c74ff12304f5c6..9277719b0fcbfab23de70e27aff41c957372b3de 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -1611,14 +1611,12 @@ Handle<JSFunction> Genesis::InstallInternalArray(
array_function->shared()->DontAdaptArguments();
- MaybeObject* maybe_map = array_function->initial_map()->Copy();
- Map* new_map;
- if (!maybe_map->To(&new_map)) return Handle<JSFunction>::null();
- new_map->set_elements_kind(elements_kind);
- array_function->set_initial_map(new_map);
+ Handle<Map> original_map(array_function->initial_map());
+ Handle<Map> initial_map = factory()->CopyMap(original_map);
+ initial_map->set_elements_kind(elements_kind);
+ array_function->set_initial_map(*initial_map);
// Make "length" magic on instances.
- Handle<Map> initial_map(array_function->initial_map());
Handle<DescriptorArray> array_descriptors(
factory()->NewDescriptorArray(0, 1));
DescriptorArray::WhitenessWitness witness(*array_descriptors);
@@ -1872,14 +1870,11 @@ bool Genesis::InstallNatives() {
{
Handle<JSFunction> array_function =
InstallInternalArray(builtins, "InternalArray", FAST_HOLEY_ELEMENTS);
- if (array_function.is_null()) return false;
native_context()->set_internal_array_function(*array_function);
}
{
- Handle<JSFunction> array_function =
- InstallInternalArray(builtins, "InternalPackedArray", FAST_ELEMENTS);
- if (array_function.is_null()) return false;
+ InstallInternalArray(builtins, "InternalPackedArray", FAST_ELEMENTS);
}
if (FLAG_disable_native_files) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698