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

Side by Side Diff: src/utils.h

Issue 2811333002: [builtins] HasOwnProperty: handle non-internalized string keys (Closed)
Patch Set: rebased (noop) Created 3 years, 8 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/objects/string-table.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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_UTILS_H_ 5 #ifndef V8_UTILS_H_
6 #define V8_UTILS_H_ 6 #define V8_UTILS_H_
7 7
8 #include <limits.h> 8 #include <limits.h>
9 #include <stdlib.h> 9 #include <stdlib.h>
10 #include <string.h> 10 #include <string.h>
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 static const U kOne = static_cast<U>(1U); 306 static const U kOne = static_cast<U>(1U);
307 static const U kMask = ((kOne << shift) << size) - (kOne << shift); 307 static const U kMask = ((kOne << shift) << size) - (kOne << shift);
308 static const U kShift = shift; 308 static const U kShift = shift;
309 static const U kSize = size; 309 static const U kSize = size;
310 static const U kNext = kShift + kSize; 310 static const U kNext = kShift + kSize;
311 311
312 // Value for the field with all bits set. 312 // Value for the field with all bits set.
313 static const T kMax = static_cast<T>((kOne << size) - 1); 313 static const T kMax = static_cast<T>((kOne << size) - 1);
314 314
315 // Tells whether the provided value fits into the bit field. 315 // Tells whether the provided value fits into the bit field.
316 static bool is_valid(T value) { 316 static constexpr bool is_valid(T value) {
317 return (static_cast<U>(value) & ~static_cast<U>(kMax)) == 0; 317 return (static_cast<U>(value) & ~static_cast<U>(kMax)) == 0;
318 } 318 }
319 319
320 // Returns a type U with the bit field value encoded. 320 // Returns a type U with the bit field value encoded.
321 static U encode(T value) { 321 static U encode(T value) {
322 DCHECK(is_valid(value)); 322 DCHECK(is_valid(value));
323 return static_cast<U>(value) << shift; 323 return static_cast<U>(value) << shift;
324 } 324 }
325 325
326 // Returns a type U with the bit field value updated. 326 // Returns a type U with the bit field value updated.
(...skipping 1395 matching lines...) Expand 10 before | Expand all | Expand 10 after
1722 private: 1722 private:
1723 T value_; 1723 T value_;
1724 ThreadedListZoneEntry<T>* next_; 1724 ThreadedListZoneEntry<T>* next_;
1725 DISALLOW_COPY_AND_ASSIGN(ThreadedListZoneEntry); 1725 DISALLOW_COPY_AND_ASSIGN(ThreadedListZoneEntry);
1726 }; 1726 };
1727 1727
1728 } // namespace internal 1728 } // namespace internal
1729 } // namespace v8 1729 } // namespace v8
1730 1730
1731 #endif // V8_UTILS_H_ 1731 #endif // V8_UTILS_H_
OLDNEW
« no previous file with comments | « src/objects/string-table.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698