1 // Copyright 2018 the V8 project authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef V8_OBJECTS_JS_REGEXP_STRING_ITERATOR_H_ 6 #define V8_OBJECTS_JS_REGEXP_STRING_ITERATOR_H_ 7 8 #include "src/objects.h" 9 10 // Has to be the last include (doesn't have include guards): 11 #include "src/objects/object-macros.h" 12 13 namespace v8 { 14 namespace internal { 15 16 class JSRegExpStringIterator : public JSObject { 17 public: 18 // [regexp]: the [[IteratingRegExp]] internal property. 19 DECL_ACCESSORS(iterating_regexp, Object) 20 21 // [string]: The [[IteratedString]] internal property. 22 DECL_ACCESSORS(iterating_string, String) 23 24 DECL_INT_ACCESSORS(flags) 25 26 // [boolean]: The [[Done]] internal property. 27 DECL_BOOLEAN_ACCESSORS(done) 28 29 // [boolean]: The [[Global]] internal property. 30 DECL_BOOLEAN_ACCESSORS(global) 31 32 // [boolean]: The [[Unicode]] internal property. 33 DECL_BOOLEAN_ACCESSORS(unicode) 34 35 DECL_CAST(JSRegExpStringIterator) 36 DECL_PRINTER(JSRegExpStringIterator) 37 DECL_VERIFIER(JSRegExpStringIterator) 38 39 static const int kIteratingRegExpOffset = JSObject::kHeaderSize; 40 static const int kIteratedStringOffset = 41 kIteratingRegExpOffset + kPointerSize; 42 static const int kFlagsOffset = kIteratedStringOffset + kPointerSize; 43 44 static const int kSize = kFlagsOffset + kPointerSize; 45 46 static const int kDoneBit = 0; 47 static const int kGlobalBit = 1; 48 static const int kUnicodeBit = 2; 49 50 private: 51 DISALLOW_IMPLICIT_CONSTRUCTORS(JSRegExpStringIterator); 52 }; 53 54 } // namespace internal 55 } // namespace v8 56 57 #include "src/objects/object-macros-undef.h" 58 59 #endif // V8_OBJECTS_JS_REGEXP_STRING_ITERATOR_H_ 60