| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 return true; | 55 return true; |
| 56 } | 56 } |
| 57 | 57 |
| 58 | 58 |
| 59 LayoutDescriptor* LayoutDescriptor::SetRawData(int field_index) { | 59 LayoutDescriptor* LayoutDescriptor::SetRawData(int field_index) { |
| 60 return SetTagged(field_index, false); | 60 return SetTagged(field_index, false); |
| 61 } | 61 } |
| 62 | 62 |
| 63 | 63 |
| 64 LayoutDescriptor* LayoutDescriptor::SetTagged(int field_index, bool tagged) { | 64 LayoutDescriptor* LayoutDescriptor::SetTagged(int field_index, bool tagged) { |
| 65 int layout_word_index; | 65 int layout_word_index = 0; |
| 66 int layout_bit_index; | 66 int layout_bit_index = 0; |
| 67 | 67 |
| 68 if (!GetIndexes(field_index, &layout_word_index, &layout_bit_index)) { | 68 if (!GetIndexes(field_index, &layout_word_index, &layout_bit_index)) { |
| 69 CHECK(false); | 69 CHECK(false); |
| 70 return this; | 70 return this; |
| 71 } | 71 } |
| 72 uint32_t layout_mask = static_cast<uint32_t>(1) << layout_bit_index; | 72 uint32_t layout_mask = static_cast<uint32_t>(1) << layout_bit_index; |
| 73 | 73 |
| 74 if (IsSlowLayout()) { | 74 if (IsSlowLayout()) { |
| 75 uint32_t value = get_scalar(layout_word_index); | 75 uint32_t value = get_scalar(layout_word_index); |
| 76 if (tagged) { | 76 if (tagged) { |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 // Object headers do not contain non-tagged fields. | 247 // Object headers do not contain non-tagged fields. |
| 248 if (offset_in_bytes < header_size_) return true; | 248 if (offset_in_bytes < header_size_) return true; |
| 249 int field_index = (offset_in_bytes - header_size_) / kPointerSize; | 249 int field_index = (offset_in_bytes - header_size_) / kPointerSize; |
| 250 | 250 |
| 251 return layout_descriptor_->IsTagged(field_index); | 251 return layout_descriptor_->IsTagged(field_index); |
| 252 } | 252 } |
| 253 } // namespace internal | 253 } // namespace internal |
| 254 } // namespace v8 | 254 } // namespace v8 |
| 255 | 255 |
| 256 #endif // V8_LAYOUT_DESCRIPTOR_INL_H_ | 256 #endif // V8_LAYOUT_DESCRIPTOR_INL_H_ |
| OLD | NEW |