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

Unified Diff: src/objects.h

Issue 1995453002: [stubs] Extend HasProperty stub with dictionary-mode and double-elements objects support. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Drive-by fix: replace Load()s with LoadObjectField()s Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/globals.h ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index 362944a71af701125f84525efc237e1bca2f682e..371c4854f6108949035c9af8df91575cba9a08fa 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -3189,6 +3189,8 @@ class HashTableBase : public FixedArray {
template <typename Derived, typename Shape, typename Key>
class HashTable : public HashTableBase {
public:
+ typedef Shape ShapeT;
+
// Wrapper methods
inline uint32_t Hash(Key key) {
if (Shape::UsesSeed) {
@@ -3475,6 +3477,9 @@ class Dictionary: public HashTable<Derived, Shape, Key> {
static Handle<Derived> EnsureCapacity(Handle<Derived> obj, int n, Key key);
#ifdef OBJECT_PRINT
+ // For our gdb macros, we should perhaps change these in the future.
+ void Print();
+
void Print(std::ostream& os); // NOLINT
#endif
// Returns the key (slow).
@@ -8567,6 +8572,10 @@ class Name: public HeapObject {
// Array index strings this short can keep their index in the hash field.
static const int kMaxCachedArrayIndexLength = 7;
+ // Maximum number of characters to consider when trying to convert a string
+ // value into an array index.
+ static const int kMaxArrayIndexSize = 10;
+
// For strings which are array indexes the hash value has the string length
// mixed into the hash, mainly to avoid a hash value of zero which would be
// the case for the string '0'. 24 bits are used for the array index value.
@@ -8574,7 +8583,8 @@ class Name: public HeapObject {
static const int kArrayIndexLengthBits =
kBitsPerInt - kArrayIndexValueBits - kNofHashBitFields;
- STATIC_ASSERT((kArrayIndexLengthBits > 0));
+ STATIC_ASSERT(kArrayIndexLengthBits > 0);
+ STATIC_ASSERT(kMaxArrayIndexSize < (1 << kArrayIndexLengthBits));
class ArrayIndexValueBits : public BitField<unsigned int, kNofHashBitFields,
kArrayIndexValueBits> {}; // NOLINT
@@ -8664,34 +8674,6 @@ class String: public Name {
public:
enum Encoding { ONE_BYTE_ENCODING, TWO_BYTE_ENCODING };
- // Array index strings this short can keep their index in the hash field.
- static const int kMaxCachedArrayIndexLength = 7;
-
- // For strings which are array indexes the hash value has the string length
- // mixed into the hash, mainly to avoid a hash value of zero which would be
- // the case for the string '0'. 24 bits are used for the array index value.
- static const int kArrayIndexValueBits = 24;
- static const int kArrayIndexLengthBits =
- kBitsPerInt - kArrayIndexValueBits - kNofHashBitFields;
-
- STATIC_ASSERT((kArrayIndexLengthBits > 0));
-
- class ArrayIndexValueBits : public BitField<unsigned int, kNofHashBitFields,
- kArrayIndexValueBits> {}; // NOLINT
- class ArrayIndexLengthBits : public BitField<unsigned int,
- kNofHashBitFields + kArrayIndexValueBits,
- kArrayIndexLengthBits> {}; // NOLINT
-
- // Check that kMaxCachedArrayIndexLength + 1 is a power of two so we
- // could use a mask to test if the length of string is less than or equal to
- // kMaxCachedArrayIndexLength.
- STATIC_ASSERT(IS_POWER_OF_TWO(kMaxCachedArrayIndexLength + 1));
-
- static const unsigned int kContainsCachedArrayIndexMask =
- (~static_cast<unsigned>(kMaxCachedArrayIndexLength)
- << ArrayIndexLengthBits::kShift) |
- kIsNotArrayIndexMask;
-
class SubStringRange {
public:
explicit inline SubStringRange(String* string, int first = 0,
@@ -8903,11 +8885,6 @@ class String: public Name {
static const int kLengthOffset = Name::kSize;
static const int kSize = kLengthOffset + kPointerSize;
- // Maximum number of characters to consider when trying to convert a string
- // value into an array index.
- static const int kMaxArrayIndexSize = 10;
- STATIC_ASSERT(kMaxArrayIndexSize < (1 << kArrayIndexLengthBits));
-
// Max char codes.
static const int32_t kMaxOneByteCharCode = unibrow::Latin1::kMaxChar;
static const uint32_t kMaxOneByteCharCodeU = unibrow::Latin1::kMaxChar;
« no previous file with comments | « src/globals.h ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698