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

Side by Side Diff: src/objects.h

Issue 736003002: Correctly escape RegExp source. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@regexpref
Patch Set: Created 6 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 7912 matching lines...) Expand 10 before | Expand all | Expand 10 after
7923 static const int kDataTagOffset = 7923 static const int kDataTagOffset =
7924 FixedArray::kHeaderSize + kTagIndex * kPointerSize; 7924 FixedArray::kHeaderSize + kTagIndex * kPointerSize;
7925 static const int kDataOneByteCodeOffset = 7925 static const int kDataOneByteCodeOffset =
7926 FixedArray::kHeaderSize + kIrregexpLatin1CodeIndex * kPointerSize; 7926 FixedArray::kHeaderSize + kIrregexpLatin1CodeIndex * kPointerSize;
7927 static const int kDataUC16CodeOffset = 7927 static const int kDataUC16CodeOffset =
7928 FixedArray::kHeaderSize + kIrregexpUC16CodeIndex * kPointerSize; 7928 FixedArray::kHeaderSize + kIrregexpUC16CodeIndex * kPointerSize;
7929 static const int kIrregexpCaptureCountOffset = 7929 static const int kIrregexpCaptureCountOffset =
7930 FixedArray::kHeaderSize + kIrregexpCaptureCountIndex * kPointerSize; 7930 FixedArray::kHeaderSize + kIrregexpCaptureCountIndex * kPointerSize;
7931 7931
7932 // In-object fields. 7932 // In-object fields.
7933 static const int kSourceFieldIndex = 0; 7933 static const int kGlobalFieldIndex = 0;
7934 static const int kGlobalFieldIndex = 1; 7934 static const int kIgnoreCaseFieldIndex = 1;
7935 static const int kIgnoreCaseFieldIndex = 2; 7935 static const int kMultilineFieldIndex = 2;
7936 static const int kMultilineFieldIndex = 3; 7936 static const int kLastIndexFieldIndex = 3;
7937 static const int kLastIndexFieldIndex = 4; 7937 static const int kInObjectFieldCount = 4;
7938 static const int kInObjectFieldCount = 5;
7939 7938
7940 // The uninitialized value for a regexp code object. 7939 // The uninitialized value for a regexp code object.
7941 static const int kUninitializedValue = -1; 7940 static const int kUninitializedValue = -1;
7942 7941
7943 // The compilation error value for the regexp code object. The real error 7942 // The compilation error value for the regexp code object. The real error
7944 // object is in the saved code field. 7943 // object is in the saved code field.
7945 static const int kCompilationErrorValue = -2; 7944 static const int kCompilationErrorValue = -2;
7946 7945
7947 // When we store the sweep generation at which we moved the code from the 7946 // When we store the sweep generation at which we moved the code from the
7948 // code index to the saved code index we mask it of to be in the [0:255] 7947 // code index to the saved code index we mask it of to be in the [0:255]
(...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after
8809 union { 8808 union {
8810 const uint8_t* onebyte_start; 8809 const uint8_t* onebyte_start;
8811 const uc16* twobyte_start; 8810 const uc16* twobyte_start;
8812 }; 8811 };
8813 int length_; 8812 int length_;
8814 State state_; 8813 State state_;
8815 8814
8816 friend class String; 8815 friend class String;
8817 }; 8816 };
8818 8817
8818 template <typename Char>
8819 Vector<const Char> GetCharVector();
8820
8819 // Get and set the length of the string. 8821 // Get and set the length of the string.
8820 inline int length() const; 8822 inline int length() const;
8821 inline void set_length(int value); 8823 inline void set_length(int value);
8822 8824
8823 // Get and set the length of the string using acquire loads and release 8825 // Get and set the length of the string using acquire loads and release
8824 // stores. 8826 // stores.
8825 inline int synchronized_length() const; 8827 inline int synchronized_length() const;
8826 inline void synchronized_set_length(int value); 8828 inline void synchronized_set_length(int value);
8827 8829
8828 // Returns whether this string has only one-byte chars, i.e. all of them can 8830 // Returns whether this string has only one-byte chars, i.e. all of them can
(...skipping 2145 matching lines...) Expand 10 before | Expand all | Expand 10 after
10974 } else { 10976 } else {
10975 value &= ~(1 << bit_position); 10977 value &= ~(1 << bit_position);
10976 } 10978 }
10977 return value; 10979 return value;
10978 } 10980 }
10979 }; 10981 };
10980 10982
10981 } } // namespace v8::internal 10983 } } // namespace v8::internal
10982 10984
10983 #endif // V8_OBJECTS_H_ 10985 #endif // V8_OBJECTS_H_
OLDNEW
« src/accessors.cc ('K') | « src/json-stringifier.h ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698