OLD | NEW |
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/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/conversions.h" | 10 #include "src/conversions.h" |
(...skipping 1583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1594 DCHECK(map->is_dictionary_map()); | 1594 DCHECK(map->is_dictionary_map()); |
1595 | 1595 |
1596 // Make sure no field properties are described in the initial map. | 1596 // Make sure no field properties are described in the initial map. |
1597 // This guarantees us that normalizing the properties does not | 1597 // This guarantees us that normalizing the properties does not |
1598 // require us to change property values to PropertyCells. | 1598 // require us to change property values to PropertyCells. |
1599 DCHECK(map->NextFreePropertyIndex() == 0); | 1599 DCHECK(map->NextFreePropertyIndex() == 0); |
1600 | 1600 |
1601 // Make sure we don't have a ton of pre-allocated slots in the | 1601 // Make sure we don't have a ton of pre-allocated slots in the |
1602 // global objects. They will be unused once we normalize the object. | 1602 // global objects. They will be unused once we normalize the object. |
1603 DCHECK(map->unused_property_fields() == 0); | 1603 DCHECK(map->unused_property_fields() == 0); |
1604 DCHECK(map->inobject_properties() == 0); | 1604 DCHECK(map->GetInObjectProperties() == 0); |
1605 | 1605 |
1606 // Initial size of the backing store to avoid resize of the storage during | 1606 // Initial size of the backing store to avoid resize of the storage during |
1607 // bootstrapping. The size differs between the JS global object ad the | 1607 // bootstrapping. The size differs between the JS global object ad the |
1608 // builtins object. | 1608 // builtins object. |
1609 int initial_size = map->instance_type() == JS_GLOBAL_OBJECT_TYPE ? 64 : 512; | 1609 int initial_size = map->instance_type() == JS_GLOBAL_OBJECT_TYPE ? 64 : 512; |
1610 | 1610 |
1611 // Allocate a dictionary object for backing storage. | 1611 // Allocate a dictionary object for backing storage. |
1612 int at_least_space_for = map->NumberOfOwnDescriptors() * 2 + initial_size; | 1612 int at_least_space_for = map->NumberOfOwnDescriptors() * 2 + initial_size; |
1613 Handle<GlobalDictionary> dictionary = | 1613 Handle<GlobalDictionary> dictionary = |
1614 GlobalDictionary::New(isolate(), at_least_space_for); | 1614 GlobalDictionary::New(isolate(), at_least_space_for); |
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2472 } | 2472 } |
2473 | 2473 |
2474 | 2474 |
2475 Handle<Object> Factory::ToBoolean(bool value) { | 2475 Handle<Object> Factory::ToBoolean(bool value) { |
2476 return value ? true_value() : false_value(); | 2476 return value ? true_value() : false_value(); |
2477 } | 2477 } |
2478 | 2478 |
2479 | 2479 |
2480 } // namespace internal | 2480 } // namespace internal |
2481 } // namespace v8 | 2481 } // namespace v8 |
OLD | NEW |