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

Side by Side Diff: src/layout-descriptor-inl.h

Issue 1290743005: Make some foo.h headers usable without foo-inl.h header. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: As per offline comment. Created 5 years, 4 months 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/layout-descriptor.h ('k') | src/types.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 #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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 *layout_word_index = field_index / kNumberOfBits; 50 *layout_word_index = field_index / kNumberOfBits;
51 CHECK((!IsSmi() && (*layout_word_index < length())) || 51 CHECK((!IsSmi() && (*layout_word_index < length())) ||
52 (IsSmi() && (*layout_word_index < 1))); 52 (IsSmi() && (*layout_word_index < 1)));
53 53
54 *layout_bit_index = field_index % kNumberOfBits; 54 *layout_bit_index = field_index % kNumberOfBits;
55 return true; 55 return true;
56 } 56 }
57 57
58 58
59 LayoutDescriptor* LayoutDescriptor::SetRawData(int field_index) {
60 return SetTagged(field_index, false);
61 }
62
63
59 LayoutDescriptor* LayoutDescriptor::SetTagged(int field_index, bool tagged) { 64 LayoutDescriptor* LayoutDescriptor::SetTagged(int field_index, bool tagged) {
60 int layout_word_index; 65 int layout_word_index;
61 int layout_bit_index; 66 int layout_bit_index;
62 67
63 if (!GetIndexes(field_index, &layout_word_index, &layout_bit_index)) { 68 if (!GetIndexes(field_index, &layout_word_index, &layout_bit_index)) {
64 CHECK(false); 69 CHECK(false);
65 return this; 70 return this;
66 } 71 }
67 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;
68 73
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 // Object headers do not contain non-tagged fields. 247 // Object headers do not contain non-tagged fields.
243 if (offset_in_bytes < header_size_) return true; 248 if (offset_in_bytes < header_size_) return true;
244 int field_index = (offset_in_bytes - header_size_) / kPointerSize; 249 int field_index = (offset_in_bytes - header_size_) / kPointerSize;
245 250
246 return layout_descriptor_->IsTagged(field_index); 251 return layout_descriptor_->IsTagged(field_index);
247 } 252 }
248 } 253 }
249 } // namespace v8::internal 254 } // namespace v8::internal
250 255
251 #endif // V8_LAYOUT_DESCRIPTOR_INL_H_ 256 #endif // V8_LAYOUT_DESCRIPTOR_INL_H_
OLDNEW
« no previous file with comments | « src/layout-descriptor.h ('k') | src/types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698