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

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

Issue 2180273002: [KeyedLoadIC] Support Smi "handlers" for element loads (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@keyed-load-ic-fieldindex
Patch Set: refactor according to review comments 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
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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 return result; 69 return result;
70 } 70 }
71 71
72 int GetKeyedLookupCacheIndex() const; 72 int GetKeyedLookupCacheIndex() const;
73 73
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 // For GetLoadByFieldOffset.
80 class FieldOffsetIsInobject : public BitField<bool, 1, 1> {};
81 class FieldOffsetIsDouble : public BitField<bool, 2, 1> {};
82 class FieldOffsetOffset : public BitField<int, 3, 27> {};
83 // Make sure we don't overflow into the sign bit.
84 STATIC_ASSERT(FieldOffsetOffset::kNext <= kSmiValueSize - 1);
85
86 private: 79 private:
87 FieldIndex(bool is_inobject, int local_index, bool is_double, 80 FieldIndex(bool is_inobject, int local_index, bool is_double,
88 int inobject_properties, int first_inobject_property_offset, 81 int inobject_properties, int first_inobject_property_offset,
89 bool is_hidden = false) { 82 bool is_hidden = false) {
90 DCHECK((first_inobject_property_offset & (kPointerSize - 1)) == 0); 83 DCHECK((first_inobject_property_offset & (kPointerSize - 1)) == 0);
91 bit_field_ = IsInObjectBits::encode(is_inobject) | 84 bit_field_ = IsInObjectBits::encode(is_inobject) |
92 IsDoubleBits::encode(is_double) | 85 IsDoubleBits::encode(is_double) |
93 FirstInobjectPropertyOffsetBits::encode(first_inobject_property_offset) | 86 FirstInobjectPropertyOffsetBits::encode(first_inobject_property_offset) |
94 IsHiddenField::encode(is_hidden) | 87 IsHiddenField::encode(is_hidden) |
95 IndexBits::encode(local_index) | 88 IndexBits::encode(local_index) |
(...skipping 23 matching lines...) Expand all
119 : public BitField<bool, FirstInobjectPropertyOffsetBits::kNext, 1> {}; 112 : public BitField<bool, FirstInobjectPropertyOffsetBits::kNext, 1> {};
120 STATIC_ASSERT(IsHiddenField::kNext <= 32); 113 STATIC_ASSERT(IsHiddenField::kNext <= 32);
121 114
122 int bit_field_; 115 int bit_field_;
123 }; 116 };
124 117
125 } // namespace internal 118 } // namespace internal
126 } // namespace v8 119 } // namespace v8
127 120
128 #endif 121 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698