| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/heap/heap.h" | 5 #include "src/heap/heap.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/api.h" | 8 #include "src/api.h" |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/base/once.h" | 10 #include "src/base/once.h" |
| (...skipping 2019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2030 SKIP_WRITE_BARRIER); | 2030 SKIP_WRITE_BARRIER); |
| 2031 map->set_weak_cell_cache(Smi::FromInt(0)); | 2031 map->set_weak_cell_cache(Smi::FromInt(0)); |
| 2032 map->set_raw_transitions(Smi::FromInt(0)); | 2032 map->set_raw_transitions(Smi::FromInt(0)); |
| 2033 map->set_unused_property_fields(0); | 2033 map->set_unused_property_fields(0); |
| 2034 map->set_instance_descriptors(empty_descriptor_array()); | 2034 map->set_instance_descriptors(empty_descriptor_array()); |
| 2035 if (FLAG_unbox_double_fields) { | 2035 if (FLAG_unbox_double_fields) { |
| 2036 map->set_layout_descriptor(LayoutDescriptor::FastPointerLayout()); | 2036 map->set_layout_descriptor(LayoutDescriptor::FastPointerLayout()); |
| 2037 } | 2037 } |
| 2038 // Must be called only after |instance_type|, |instance_size| and | 2038 // Must be called only after |instance_type|, |instance_size| and |
| 2039 // |layout_descriptor| are set. | 2039 // |layout_descriptor| are set. |
| 2040 map->set_visitor_id(StaticVisitorBase::GetVisitorId(map)); | 2040 map->set_visitor_id(Heap::GetStaticVisitorIdForMap(map)); |
| 2041 map->set_bit_field(0); | 2041 map->set_bit_field(0); |
| 2042 map->set_bit_field2(1 << Map::kIsExtensible); | 2042 map->set_bit_field2(1 << Map::kIsExtensible); |
| 2043 int bit_field3 = Map::EnumLengthBits::encode(kInvalidEnumCacheSentinel) | | 2043 int bit_field3 = Map::EnumLengthBits::encode(kInvalidEnumCacheSentinel) | |
| 2044 Map::OwnsDescriptors::encode(true) | | 2044 Map::OwnsDescriptors::encode(true) | |
| 2045 Map::Counter::encode(Map::kRetainingCounterStart); | 2045 Map::Counter::encode(Map::kRetainingCounterStart); |
| 2046 map->set_bit_field3(bit_field3); | 2046 map->set_bit_field3(bit_field3); |
| 2047 map->set_elements_kind(elements_kind); | 2047 map->set_elements_kind(elements_kind); |
| 2048 | 2048 |
| 2049 return map; | 2049 return map; |
| 2050 } | 2050 } |
| (...skipping 4046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6097 Code::kFirstCodeAge: \ | 6097 Code::kFirstCodeAge: \ |
| 6098 *object_type = "CODE_TYPE"; \ | 6098 *object_type = "CODE_TYPE"; \ |
| 6099 *object_sub_type = "CODE_AGE/" #name; \ | 6099 *object_sub_type = "CODE_AGE/" #name; \ |
| 6100 return true; | 6100 return true; |
| 6101 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) | 6101 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) |
| 6102 #undef COMPARE_AND_RETURN_NAME | 6102 #undef COMPARE_AND_RETURN_NAME |
| 6103 } | 6103 } |
| 6104 return false; | 6104 return false; |
| 6105 } | 6105 } |
| 6106 | 6106 |
| 6107 |
| 6108 // static |
| 6109 int Heap::GetStaticVisitorIdForMap(Map* map) { |
| 6110 return StaticVisitorBase::GetVisitorId(map); |
| 6111 } |
| 6112 |
| 6107 } // namespace internal | 6113 } // namespace internal |
| 6108 } // namespace v8 | 6114 } // namespace v8 |
| OLD | NEW |