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

Unified Diff: src/bootstrapper.cc

Issue 2486193003: [typedarrays] Remove duplicate initial map creation (Closed)
Patch Set: Created 4 years, 1 month 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 143c00154c63b56304706f0c0515b93106b614d4..3eb097967d7558b6048be188fdc7324411b84fb8 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -2606,16 +2606,10 @@ void Genesis::InstallTypedArray(const char* name, ElementsKind elements_kind,
Handle<JSObject> prototype =
factory()->NewJSObject(isolate()->object_function(), TENURED);
- Handle<JSFunction> result =
- InstallFunction(global, name, JS_TYPED_ARRAY_TYPE, JSTypedArray::kSize,
- prototype, Builtins::kIllegal);
-
- Handle<Map> initial_map = isolate()->factory()->NewMap(
- JS_TYPED_ARRAY_TYPE,
- JSTypedArray::kSizeWithInternalFields,
- elements_kind);
- JSFunction::SetInitialMap(result, initial_map,
- handle(initial_map->prototype(), isolate()));
+ Handle<JSFunction> result = InstallFunction(
+ global, name, JS_TYPED_ARRAY_TYPE, JSTypedArray::kSizeWithInternalFields,
+ prototype, Builtins::kIllegal);
+ result->initial_map()->set_elements_kind(elements_kind);
CHECK(JSObject::SetPrototype(result, typed_array_function, false,
Object::DONT_THROW)
« 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