| 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 #ifndef V8_LAYOUT_DESCRIPTOR_INL_H_ | 5 #ifndef V8_LAYOUT_DESCRIPTOR_INL_H_ |
| 6 #define V8_LAYOUT_DESCRIPTOR_INL_H_ | 6 #define V8_LAYOUT_DESCRIPTOR_INL_H_ |
| 7 | 7 |
| 8 #include "src/layout-descriptor.h" | 8 #include "src/layout-descriptor.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 } | 146 } |
| 147 return LayoutDescriptor::cast(object); | 147 return LayoutDescriptor::cast(object); |
| 148 } | 148 } |
| 149 | 149 |
| 150 | 150 |
| 151 // InobjectPropertiesHelper is a helper class for querying whether inobject | 151 // InobjectPropertiesHelper is a helper class for querying whether inobject |
| 152 // property at offset is Double or not. | 152 // property at offset is Double or not. |
| 153 InobjectPropertiesHelper::InobjectPropertiesHelper(Map* map) | 153 InobjectPropertiesHelper::InobjectPropertiesHelper(Map* map) |
| 154 : all_fields_tagged_(true), | 154 : all_fields_tagged_(true), |
| 155 header_size_(0), | 155 header_size_(0), |
| 156 inobject_properties_count_(0), | |
| 157 layout_descriptor_(LayoutDescriptor::FastPointerLayout()) { | 156 layout_descriptor_(LayoutDescriptor::FastPointerLayout()) { |
| 158 if (!FLAG_unbox_double_fields) return; | 157 if (!FLAG_unbox_double_fields) return; |
| 159 | 158 |
| 160 layout_descriptor_ = map->layout_descriptor_gc_safe(); | 159 layout_descriptor_ = map->layout_descriptor_gc_safe(); |
| 161 if (layout_descriptor_->IsFastPointerLayout()) { | 160 if (layout_descriptor_->IsFastPointerLayout()) { |
| 162 return; | 161 return; |
| 163 } | 162 } |
| 164 | 163 |
| 165 int inobject_properties = map->inobject_properties(); | 164 int inobject_properties = map->inobject_properties(); |
| 166 DCHECK(inobject_properties > 0); | 165 DCHECK(inobject_properties > 0); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 177 // Object headers do not contain non-tagged fields. | 176 // Object headers do not contain non-tagged fields. |
| 178 if (offset_in_bytes < header_size_) return true; | 177 if (offset_in_bytes < header_size_) return true; |
| 179 int field_index = (offset_in_bytes - header_size_) / kPointerSize; | 178 int field_index = (offset_in_bytes - header_size_) / kPointerSize; |
| 180 | 179 |
| 181 return layout_descriptor_->IsTagged(field_index); | 180 return layout_descriptor_->IsTagged(field_index); |
| 182 } | 181 } |
| 183 } | 182 } |
| 184 } // namespace v8::internal | 183 } // namespace v8::internal |
| 185 | 184 |
| 186 #endif // V8_LAYOUT_DESCRIPTOR_INL_H_ | 185 #endif // V8_LAYOUT_DESCRIPTOR_INL_H_ |
| OLD | NEW |