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

Side by Side Diff: src/factory.cc

Issue 779173010: Create optimized inline versions of Map and Set initialization (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Switch to StoreNamedField, shorten constant names Created 6 years 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 | « src/collection.js ('k') | src/hydrogen.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 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/factory.h" 5 #include "src/factory.h"
6 6
7 #include "src/allocation-site-scopes.h" 7 #include "src/allocation-site-scopes.h"
8 #include "src/base/bits.h" 8 #include "src/base/bits.h"
9 #include "src/conversions.h" 9 #include "src/conversions.h"
10 #include "src/isolate-inl.h" 10 #include "src/isolate-inl.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 DCHECK(small.total_count() > 0); 132 DCHECK(small.total_count() > 0);
133 DCHECK(extended.total_count() > 0); 133 DCHECK(extended.total_count() > 0);
134 CALL_HEAP_FUNCTION( 134 CALL_HEAP_FUNCTION(
135 isolate(), 135 isolate(),
136 isolate()->heap()->AllocateExtendedConstantPoolArray(small, extended), 136 isolate()->heap()->AllocateExtendedConstantPoolArray(small, extended),
137 ConstantPoolArray); 137 ConstantPoolArray);
138 } 138 }
139 139
140 140
141 Handle<OrderedHashSet> Factory::NewOrderedHashSet() { 141 Handle<OrderedHashSet> Factory::NewOrderedHashSet() {
142 return OrderedHashSet::Allocate(isolate(), 4); 142 return OrderedHashSet::Allocate(isolate(), OrderedHashSet::kMinCapacity);
143 } 143 }
144 144
145 145
146 Handle<OrderedHashMap> Factory::NewOrderedHashMap() { 146 Handle<OrderedHashMap> Factory::NewOrderedHashMap() {
147 return OrderedHashMap::Allocate(isolate(), 4); 147 return OrderedHashMap::Allocate(isolate(), OrderedHashMap::kMinCapacity);
148 } 148 }
149 149
150 150
151 Handle<AccessorPair> Factory::NewAccessorPair() { 151 Handle<AccessorPair> Factory::NewAccessorPair() {
152 Handle<AccessorPair> accessors = 152 Handle<AccessorPair> accessors =
153 Handle<AccessorPair>::cast(NewStruct(ACCESSOR_PAIR_TYPE)); 153 Handle<AccessorPair>::cast(NewStruct(ACCESSOR_PAIR_TYPE));
154 accessors->set_getter(*the_hole_value(), SKIP_WRITE_BARRIER); 154 accessors->set_getter(*the_hole_value(), SKIP_WRITE_BARRIER);
155 accessors->set_setter(*the_hole_value(), SKIP_WRITE_BARRIER); 155 accessors->set_setter(*the_hole_value(), SKIP_WRITE_BARRIER);
156 return accessors; 156 return accessors;
157 } 157 }
(...skipping 2363 matching lines...) Expand 10 before | Expand all | Expand 10 after
2521 return Handle<Object>::null(); 2521 return Handle<Object>::null();
2522 } 2522 }
2523 2523
2524 2524
2525 Handle<Object> Factory::ToBoolean(bool value) { 2525 Handle<Object> Factory::ToBoolean(bool value) {
2526 return value ? true_value() : false_value(); 2526 return value ? true_value() : false_value();
2527 } 2527 }
2528 2528
2529 2529
2530 } } // namespace v8::internal 2530 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/collection.js ('k') | src/hydrogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698