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

Side by Side Diff: src/field-index.h

Issue 2227703003: Reland "[KeyedLoadIC] Support Smi "handlers" for element loads" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: add DCHECK Created 4 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/code-stub-assembler.cc ('k') | src/field-index-inl.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_FIELD_INDEX_H_ 5 #ifndef V8_FIELD_INDEX_H_
6 #define V8_FIELD_INDEX_H_ 6 #define V8_FIELD_INDEX_H_
7 7
8 #include "src/property-details.h" 8 #include "src/property-details.h"
9 #include "src/utils.h" 9 #include "src/utils.h"
10 10
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 int GetFieldAccessStubKey() const { 74 int GetFieldAccessStubKey() const {
75 return bit_field_ & 75 return bit_field_ &
76 (IsInObjectBits::kMask | IsDoubleBits::kMask | IndexBits::kMask); 76 (IsInObjectBits::kMask | IsDoubleBits::kMask | IndexBits::kMask);
77 } 77 }
78 78
79 bool operator==(FieldIndex const& other) const { 79 bool operator==(FieldIndex const& other) const {
80 return bit_field_ == other.bit_field_; 80 return bit_field_ == other.bit_field_;
81 } 81 }
82 bool operator!=(FieldIndex const& other) const { return !(*this == other); } 82 bool operator!=(FieldIndex const& other) const { return !(*this == other); }
83 83
84 // For GetLoadByFieldOffset.
85 class FieldOffsetIsInobject : public BitField<bool, 1, 1> {};
86 class FieldOffsetIsDouble : public BitField<bool, 2, 1> {};
87 class FieldOffsetOffset : public BitField<int, 3, 27> {};
88 // Make sure we don't overflow into the sign bit.
89 STATIC_ASSERT(FieldOffsetOffset::kNext <= kSmiValueSize - 1);
90
91 private: 84 private:
92 FieldIndex(bool is_inobject, int local_index, bool is_double, 85 FieldIndex(bool is_inobject, int local_index, bool is_double,
93 int inobject_properties, int first_inobject_property_offset, 86 int inobject_properties, int first_inobject_property_offset,
94 bool is_hidden = false) { 87 bool is_hidden = false) {
95 DCHECK((first_inobject_property_offset & (kPointerSize - 1)) == 0); 88 DCHECK((first_inobject_property_offset & (kPointerSize - 1)) == 0);
96 bit_field_ = IsInObjectBits::encode(is_inobject) | 89 bit_field_ = IsInObjectBits::encode(is_inobject) |
97 IsDoubleBits::encode(is_double) | 90 IsDoubleBits::encode(is_double) |
98 FirstInobjectPropertyOffsetBits::encode(first_inobject_property_offset) | 91 FirstInobjectPropertyOffsetBits::encode(first_inobject_property_offset) |
99 IsHiddenField::encode(is_hidden) | 92 IsHiddenField::encode(is_hidden) |
100 IndexBits::encode(local_index) | 93 IndexBits::encode(local_index) |
(...skipping 23 matching lines...) Expand all
124 : public BitField<bool, FirstInobjectPropertyOffsetBits::kNext, 1> {}; 117 : public BitField<bool, FirstInobjectPropertyOffsetBits::kNext, 1> {};
125 STATIC_ASSERT(IsHiddenField::kNext <= 32); 118 STATIC_ASSERT(IsHiddenField::kNext <= 32);
126 119
127 int bit_field_; 120 int bit_field_;
128 }; 121 };
129 122
130 } // namespace internal 123 } // namespace internal
131 } // namespace v8 124 } // namespace v8
132 125
133 #endif 126 #endif
OLDNEW
« no previous file with comments | « src/code-stub-assembler.cc ('k') | src/field-index-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698