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

Side by Side Diff: src/objects.h

Issue 1428203003: Use in-object fields instead of private symbols for regexp slots. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: using IS_REGEXP check Created 5 years, 1 month 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 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_OBJECTS_H_ 5 #ifndef V8_OBJECTS_H_
6 #define V8_OBJECTS_H_ 6 #define V8_OBJECTS_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
9 9
10 #include "src/allocation.h" 10 #include "src/allocation.h"
(...skipping 7699 matching lines...) Expand 10 before | Expand all | Expand 10 after
7710 bool is_ignore_case() { return (value_ & IGNORE_CASE) != 0; } 7710 bool is_ignore_case() { return (value_ & IGNORE_CASE) != 0; }
7711 bool is_multiline() { return (value_ & MULTILINE) != 0; } 7711 bool is_multiline() { return (value_ & MULTILINE) != 0; }
7712 bool is_sticky() { return (value_ & STICKY) != 0; } 7712 bool is_sticky() { return (value_ & STICKY) != 0; }
7713 bool is_unicode() { return (value_ & UNICODE_ESCAPES) != 0; } 7713 bool is_unicode() { return (value_ & UNICODE_ESCAPES) != 0; }
7714 uint32_t value() { return value_; } 7714 uint32_t value() { return value_; }
7715 private: 7715 private:
7716 uint32_t value_; 7716 uint32_t value_;
7717 }; 7717 };
7718 7718
7719 DECL_ACCESSORS(data, Object) 7719 DECL_ACCESSORS(data, Object)
7720 DECL_ACCESSORS(flags, Object)
7721 DECL_ACCESSORS(source, Object)
7720 7722
7721 inline Type TypeTag(); 7723 inline Type TypeTag();
7722 inline int CaptureCount(); 7724 inline int CaptureCount();
7723 inline Flags GetFlags(); 7725 inline Flags GetFlags();
7724 inline String* Pattern(); 7726 inline String* Pattern();
7725 inline Object* DataAt(int index); 7727 inline Object* DataAt(int index);
7726 // Set implementation data after the object has been prepared. 7728 // Set implementation data after the object has been prepared.
7727 inline void SetDataAt(int index, Object* value); 7729 inline void SetDataAt(int index, Object* value);
7728 7730
7729 static int code_index(bool is_latin1) { 7731 static int code_index(bool is_latin1) {
(...skipping 12 matching lines...) Expand all
7742 } 7744 }
7743 } 7745 }
7744 7746
7745 DECLARE_CAST(JSRegExp) 7747 DECLARE_CAST(JSRegExp)
7746 7748
7747 // Dispatched behavior. 7749 // Dispatched behavior.
7748 DECLARE_PRINTER(JSRegExp) 7750 DECLARE_PRINTER(JSRegExp)
7749 DECLARE_VERIFIER(JSRegExp) 7751 DECLARE_VERIFIER(JSRegExp)
7750 7752
7751 static const int kDataOffset = JSObject::kHeaderSize; 7753 static const int kDataOffset = JSObject::kHeaderSize;
7752 static const int kSize = kDataOffset + kPointerSize; 7754 static const int kSourceOffset = kDataOffset + kPointerSize;
7755 static const int kFlagsOffset = kSourceOffset + kPointerSize;
7756 static const int kSize = kFlagsOffset + kPointerSize;
7753 7757
7754 // Indices in the data array. 7758 // Indices in the data array.
7755 static const int kTagIndex = 0; 7759 static const int kTagIndex = 0;
7756 static const int kSourceIndex = kTagIndex + 1; 7760 static const int kSourceIndex = kTagIndex + 1;
7757 static const int kFlagsIndex = kSourceIndex + 1; 7761 static const int kFlagsIndex = kSourceIndex + 1;
7758 static const int kDataIndex = kFlagsIndex + 1; 7762 static const int kDataIndex = kFlagsIndex + 1;
7759 // The data fields are used in different ways depending on the 7763 // The data fields are used in different ways depending on the
7760 // value of the tag. 7764 // value of the tag.
7761 // Atom regexps (literal strings). 7765 // Atom regexps (literal strings).
7762 static const int kAtomPatternIndex = kDataIndex; 7766 static const int kAtomPatternIndex = kDataIndex;
(...skipping 28 matching lines...) Expand all
7791 static const int kDataTagOffset = 7795 static const int kDataTagOffset =
7792 FixedArray::kHeaderSize + kTagIndex * kPointerSize; 7796 FixedArray::kHeaderSize + kTagIndex * kPointerSize;
7793 static const int kDataOneByteCodeOffset = 7797 static const int kDataOneByteCodeOffset =
7794 FixedArray::kHeaderSize + kIrregexpLatin1CodeIndex * kPointerSize; 7798 FixedArray::kHeaderSize + kIrregexpLatin1CodeIndex * kPointerSize;
7795 static const int kDataUC16CodeOffset = 7799 static const int kDataUC16CodeOffset =
7796 FixedArray::kHeaderSize + kIrregexpUC16CodeIndex * kPointerSize; 7800 FixedArray::kHeaderSize + kIrregexpUC16CodeIndex * kPointerSize;
7797 static const int kIrregexpCaptureCountOffset = 7801 static const int kIrregexpCaptureCountOffset =
7798 FixedArray::kHeaderSize + kIrregexpCaptureCountIndex * kPointerSize; 7802 FixedArray::kHeaderSize + kIrregexpCaptureCountIndex * kPointerSize;
7799 7803
7800 // In-object fields. 7804 // In-object fields.
7801 static const int kSourceFieldIndex = 0; 7805 static const int kLastIndexFieldIndex = 0;
7802 static const int kFlagsFieldIndex = 1; 7806 static const int kInObjectFieldCount = 1;
7803 static const int kLastIndexFieldIndex = 2;
7804 static const int kInObjectFieldCount = 3;
7805 7807
7806 // The uninitialized value for a regexp code object. 7808 // The uninitialized value for a regexp code object.
7807 static const int kUninitializedValue = -1; 7809 static const int kUninitializedValue = -1;
7808 7810
7809 // The compilation error value for the regexp code object. The real error 7811 // The compilation error value for the regexp code object. The real error
7810 // object is in the saved code field. 7812 // object is in the saved code field.
7811 static const int kCompilationErrorValue = -2; 7813 static const int kCompilationErrorValue = -2;
7812 7814
7813 // When we store the sweep generation at which we moved the code from the 7815 // When we store the sweep generation at which we moved the code from the
7814 // code index to the saved code index we mask it of to be in the [0:255] 7816 // code index to the saved code index we mask it of to be in the [0:255]
(...skipping 2999 matching lines...) Expand 10 before | Expand all | Expand 10 after
10814 // (elements + properties) in the current level. 10816 // (elements + properties) in the current level.
10815 int levelLength_ = 0; 10817 int levelLength_ = 0;
10816 10818
10817 DISALLOW_COPY_AND_ASSIGN(KeyAccumulator); 10819 DISALLOW_COPY_AND_ASSIGN(KeyAccumulator);
10818 }; 10820 };
10819 10821
10820 } // NOLINT, false-positive due to second-order macros. 10822 } // NOLINT, false-positive due to second-order macros.
10821 } // NOLINT, false-positive due to second-order macros. 10823 } // NOLINT, false-positive due to second-order macros.
10822 10824
10823 #endif // V8_OBJECTS_H_ 10825 #endif // V8_OBJECTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698