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

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: rebase 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
« no previous file with comments | « src/js/string.js ('k') | src/objects-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 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 7707 matching lines...) Expand 10 before | Expand all | Expand 10 after
7718 bool is_ignore_case() { return (value_ & IGNORE_CASE) != 0; } 7718 bool is_ignore_case() { return (value_ & IGNORE_CASE) != 0; }
7719 bool is_multiline() { return (value_ & MULTILINE) != 0; } 7719 bool is_multiline() { return (value_ & MULTILINE) != 0; }
7720 bool is_sticky() { return (value_ & STICKY) != 0; } 7720 bool is_sticky() { return (value_ & STICKY) != 0; }
7721 bool is_unicode() { return (value_ & UNICODE_ESCAPES) != 0; } 7721 bool is_unicode() { return (value_ & UNICODE_ESCAPES) != 0; }
7722 uint32_t value() { return value_; } 7722 uint32_t value() { return value_; }
7723 private: 7723 private:
7724 uint32_t value_; 7724 uint32_t value_;
7725 }; 7725 };
7726 7726
7727 DECL_ACCESSORS(data, Object) 7727 DECL_ACCESSORS(data, Object)
7728 DECL_ACCESSORS(flags, Object)
7729 DECL_ACCESSORS(source, Object)
7728 7730
7729 inline Type TypeTag(); 7731 inline Type TypeTag();
7730 inline int CaptureCount(); 7732 inline int CaptureCount();
7731 inline Flags GetFlags(); 7733 inline Flags GetFlags();
7732 inline String* Pattern(); 7734 inline String* Pattern();
7733 inline Object* DataAt(int index); 7735 inline Object* DataAt(int index);
7734 // Set implementation data after the object has been prepared. 7736 // Set implementation data after the object has been prepared.
7735 inline void SetDataAt(int index, Object* value); 7737 inline void SetDataAt(int index, Object* value);
7736 7738
7737 static int code_index(bool is_latin1) { 7739 static int code_index(bool is_latin1) {
(...skipping 12 matching lines...) Expand all
7750 } 7752 }
7751 } 7753 }
7752 7754
7753 DECLARE_CAST(JSRegExp) 7755 DECLARE_CAST(JSRegExp)
7754 7756
7755 // Dispatched behavior. 7757 // Dispatched behavior.
7756 DECLARE_PRINTER(JSRegExp) 7758 DECLARE_PRINTER(JSRegExp)
7757 DECLARE_VERIFIER(JSRegExp) 7759 DECLARE_VERIFIER(JSRegExp)
7758 7760
7759 static const int kDataOffset = JSObject::kHeaderSize; 7761 static const int kDataOffset = JSObject::kHeaderSize;
7760 static const int kSize = kDataOffset + kPointerSize; 7762 static const int kSourceOffset = kDataOffset + kPointerSize;
7763 static const int kFlagsOffset = kSourceOffset + kPointerSize;
7764 static const int kSize = kFlagsOffset + kPointerSize;
7761 7765
7762 // Indices in the data array. 7766 // Indices in the data array.
7763 static const int kTagIndex = 0; 7767 static const int kTagIndex = 0;
7764 static const int kSourceIndex = kTagIndex + 1; 7768 static const int kSourceIndex = kTagIndex + 1;
7765 static const int kFlagsIndex = kSourceIndex + 1; 7769 static const int kFlagsIndex = kSourceIndex + 1;
7766 static const int kDataIndex = kFlagsIndex + 1; 7770 static const int kDataIndex = kFlagsIndex + 1;
7767 // The data fields are used in different ways depending on the 7771 // The data fields are used in different ways depending on the
7768 // value of the tag. 7772 // value of the tag.
7769 // Atom regexps (literal strings). 7773 // Atom regexps (literal strings).
7770 static const int kAtomPatternIndex = kDataIndex; 7774 static const int kAtomPatternIndex = kDataIndex;
(...skipping 28 matching lines...) Expand all
7799 static const int kDataTagOffset = 7803 static const int kDataTagOffset =
7800 FixedArray::kHeaderSize + kTagIndex * kPointerSize; 7804 FixedArray::kHeaderSize + kTagIndex * kPointerSize;
7801 static const int kDataOneByteCodeOffset = 7805 static const int kDataOneByteCodeOffset =
7802 FixedArray::kHeaderSize + kIrregexpLatin1CodeIndex * kPointerSize; 7806 FixedArray::kHeaderSize + kIrregexpLatin1CodeIndex * kPointerSize;
7803 static const int kDataUC16CodeOffset = 7807 static const int kDataUC16CodeOffset =
7804 FixedArray::kHeaderSize + kIrregexpUC16CodeIndex * kPointerSize; 7808 FixedArray::kHeaderSize + kIrregexpUC16CodeIndex * kPointerSize;
7805 static const int kIrregexpCaptureCountOffset = 7809 static const int kIrregexpCaptureCountOffset =
7806 FixedArray::kHeaderSize + kIrregexpCaptureCountIndex * kPointerSize; 7810 FixedArray::kHeaderSize + kIrregexpCaptureCountIndex * kPointerSize;
7807 7811
7808 // In-object fields. 7812 // In-object fields.
7809 static const int kSourceFieldIndex = 0; 7813 static const int kLastIndexFieldIndex = 0;
7810 static const int kFlagsFieldIndex = 1; 7814 static const int kInObjectFieldCount = 1;
7811 static const int kLastIndexFieldIndex = 2;
7812 static const int kInObjectFieldCount = 3;
7813 7815
7814 // The uninitialized value for a regexp code object. 7816 // The uninitialized value for a regexp code object.
7815 static const int kUninitializedValue = -1; 7817 static const int kUninitializedValue = -1;
7816 7818
7817 // The compilation error value for the regexp code object. The real error 7819 // The compilation error value for the regexp code object. The real error
7818 // object is in the saved code field. 7820 // object is in the saved code field.
7819 static const int kCompilationErrorValue = -2; 7821 static const int kCompilationErrorValue = -2;
7820 7822
7821 // When we store the sweep generation at which we moved the code from the 7823 // When we store the sweep generation at which we moved the code from the
7822 // code index to the saved code index we mask it of to be in the [0:255] 7824 // code index to the saved code index we mask it of to be in the [0:255]
(...skipping 2934 matching lines...) Expand 10 before | Expand all | Expand 10 after
10757 } 10759 }
10758 return value; 10760 return value;
10759 } 10761 }
10760 }; 10762 };
10761 10763
10762 10764
10763 } // NOLINT, false-positive due to second-order macros. 10765 } // NOLINT, false-positive due to second-order macros.
10764 } // NOLINT, false-positive due to second-order macros. 10766 } // NOLINT, false-positive due to second-order macros.
10765 10767
10766 #endif // V8_OBJECTS_H_ 10768 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/js/string.js ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698