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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/bootstrapper.h" 5 #include "src/bootstrapper.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api-natives.h" 8 #include "src/api-natives.h"
9 #include "src/base/ieee754.h" 9 #include "src/base/ieee754.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 2588 matching lines...) Expand 10 before | Expand all | Expand 10 after
2599 Handle<JSFunction>* fun) { 2599 Handle<JSFunction>* fun) {
2600 Handle<JSObject> global = Handle<JSObject>(native_context()->global_object()); 2600 Handle<JSObject> global = Handle<JSObject>(native_context()->global_object());
2601 2601
2602 Handle<JSObject> typed_array_prototype = 2602 Handle<JSObject> typed_array_prototype =
2603 Handle<JSObject>(isolate()->typed_array_prototype()); 2603 Handle<JSObject>(isolate()->typed_array_prototype());
2604 Handle<JSFunction> typed_array_function = 2604 Handle<JSFunction> typed_array_function =
2605 Handle<JSFunction>(isolate()->typed_array_function()); 2605 Handle<JSFunction>(isolate()->typed_array_function());
2606 2606
2607 Handle<JSObject> prototype = 2607 Handle<JSObject> prototype =
2608 factory()->NewJSObject(isolate()->object_function(), TENURED); 2608 factory()->NewJSObject(isolate()->object_function(), TENURED);
2609 Handle<JSFunction> result = 2609 Handle<JSFunction> result = InstallFunction(
2610 InstallFunction(global, name, JS_TYPED_ARRAY_TYPE, JSTypedArray::kSize, 2610 global, name, JS_TYPED_ARRAY_TYPE, JSTypedArray::kSizeWithInternalFields,
2611 prototype, Builtins::kIllegal); 2611 prototype, Builtins::kIllegal);
2612 2612 result->initial_map()->set_elements_kind(elements_kind);
2613 Handle<Map> initial_map = isolate()->factory()->NewMap(
2614 JS_TYPED_ARRAY_TYPE,
2615 JSTypedArray::kSizeWithInternalFields,
2616 elements_kind);
2617 JSFunction::SetInitialMap(result, initial_map,
2618 handle(initial_map->prototype(), isolate()));
2619 2613
2620 CHECK(JSObject::SetPrototype(result, typed_array_function, false, 2614 CHECK(JSObject::SetPrototype(result, typed_array_function, false,
2621 Object::DONT_THROW) 2615 Object::DONT_THROW)
2622 .FromJust()); 2616 .FromJust());
2623 2617
2624 CHECK(JSObject::SetPrototype(prototype, typed_array_prototype, false, 2618 CHECK(JSObject::SetPrototype(prototype, typed_array_prototype, false,
2625 Object::DONT_THROW) 2619 Object::DONT_THROW)
2626 .FromJust()); 2620 .FromJust());
2627 *fun = result; 2621 *fun = result;
2628 } 2622 }
(...skipping 1911 matching lines...) Expand 10 before | Expand all | Expand 10 after
4540 } 4534 }
4541 4535
4542 4536
4543 // Called when the top-level V8 mutex is destroyed. 4537 // Called when the top-level V8 mutex is destroyed.
4544 void Bootstrapper::FreeThreadResources() { 4538 void Bootstrapper::FreeThreadResources() {
4545 DCHECK(!IsActive()); 4539 DCHECK(!IsActive());
4546 } 4540 }
4547 4541
4548 } // namespace internal 4542 } // namespace internal
4549 } // namespace v8 4543 } // namespace v8
OLDNEW
« 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