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