OLD | NEW |
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 "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/assert-scope.h" | 9 #include "src/assert-scope.h" |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 8016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8027 // - max number of registers used by irregexp implementations. | 8027 // - max number of registers used by irregexp implementations. |
8028 // - number of capture registers (output values) of the regexp. | 8028 // - number of capture registers (output values) of the regexp. |
8029 class JSRegExp: public JSObject { | 8029 class JSRegExp: public JSObject { |
8030 public: | 8030 public: |
8031 // Meaning of Type: | 8031 // Meaning of Type: |
8032 // NOT_COMPILED: Initial value. No data has been stored in the JSRegExp yet. | 8032 // NOT_COMPILED: Initial value. No data has been stored in the JSRegExp yet. |
8033 // ATOM: A simple string to match against using an indexOf operation. | 8033 // ATOM: A simple string to match against using an indexOf operation. |
8034 // IRREGEXP: Compiled with Irregexp. | 8034 // IRREGEXP: Compiled with Irregexp. |
8035 // IRREGEXP_NATIVE: Compiled to native code with Irregexp. | 8035 // IRREGEXP_NATIVE: Compiled to native code with Irregexp. |
8036 enum Type { NOT_COMPILED, ATOM, IRREGEXP }; | 8036 enum Type { NOT_COMPILED, ATOM, IRREGEXP }; |
8037 enum Flag { NONE = 0, GLOBAL = 1, IGNORE_CASE = 2, MULTILINE = 4 }; | 8037 enum Flag { |
| 8038 NONE = 0, |
| 8039 GLOBAL = 1, |
| 8040 IGNORE_CASE = 2, |
| 8041 MULTILINE = 4, |
| 8042 STICKY = 8 |
| 8043 }; |
8038 | 8044 |
8039 class Flags { | 8045 class Flags { |
8040 public: | 8046 public: |
8041 explicit Flags(uint32_t value) : value_(value) { } | 8047 explicit Flags(uint32_t value) : value_(value) { } |
8042 bool is_global() { return (value_ & GLOBAL) != 0; } | 8048 bool is_global() { return (value_ & GLOBAL) != 0; } |
8043 bool is_ignore_case() { return (value_ & IGNORE_CASE) != 0; } | 8049 bool is_ignore_case() { return (value_ & IGNORE_CASE) != 0; } |
8044 bool is_multiline() { return (value_ & MULTILINE) != 0; } | 8050 bool is_multiline() { return (value_ & MULTILINE) != 0; } |
| 8051 bool is_sticky() { return (value_ & STICKY) != 0; } |
8045 uint32_t value() { return value_; } | 8052 uint32_t value() { return value_; } |
8046 private: | 8053 private: |
8047 uint32_t value_; | 8054 uint32_t value_; |
8048 }; | 8055 }; |
8049 | 8056 |
8050 DECL_ACCESSORS(data, Object) | 8057 DECL_ACCESSORS(data, Object) |
8051 | 8058 |
8052 inline Type TypeTag(); | 8059 inline Type TypeTag(); |
8053 inline int CaptureCount(); | 8060 inline int CaptureCount(); |
8054 inline Flags GetFlags(); | 8061 inline Flags GetFlags(); |
(...skipping 3061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11116 } else { | 11123 } else { |
11117 value &= ~(1 << bit_position); | 11124 value &= ~(1 << bit_position); |
11118 } | 11125 } |
11119 return value; | 11126 return value; |
11120 } | 11127 } |
11121 }; | 11128 }; |
11122 | 11129 |
11123 } } // namespace v8::internal | 11130 } } // namespace v8::internal |
11124 | 11131 |
11125 #endif // V8_OBJECTS_H_ | 11132 #endif // V8_OBJECTS_H_ |
OLD | NEW |