| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 2897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2908 static const int kValueOffset = JSObject::kHeaderSize; | 2908 static const int kValueOffset = JSObject::kHeaderSize; |
| 2909 static const int kSize = kValueOffset + kPointerSize; | 2909 static const int kSize = kValueOffset + kPointerSize; |
| 2910 | 2910 |
| 2911 private: | 2911 private: |
| 2912 DISALLOW_IMPLICIT_CONSTRUCTORS(JSValue); | 2912 DISALLOW_IMPLICIT_CONSTRUCTORS(JSValue); |
| 2913 }; | 2913 }; |
| 2914 | 2914 |
| 2915 // Regular expressions | 2915 // Regular expressions |
| 2916 class JSRegExp: public JSObject { | 2916 class JSRegExp: public JSObject { |
| 2917 public: | 2917 public: |
| 2918 // Meaning of Type: |
| 2919 // NOT_COMPILED: Initial value. No data has been stored in the JSRegExp yet. |
| 2920 // JSCRE: A complex RegExp for JSCRE |
| 2921 // ATOM: A simple string to match against using an indexOf operation. |
| 2918 enum Type { NOT_COMPILED, JSCRE, ATOM }; | 2922 enum Type { NOT_COMPILED, JSCRE, ATOM }; |
| 2919 enum Flag { NONE = 0, GLOBAL = 1, IGNORE_CASE = 2, MULTILINE = 4 }; | 2923 enum Flag { NONE = 0, GLOBAL = 1, IGNORE_CASE = 2, MULTILINE = 4 }; |
| 2920 | 2924 |
| 2921 class Flags { | 2925 class Flags { |
| 2922 public: | 2926 public: |
| 2923 explicit Flags(uint32_t value) : value_(value) { } | 2927 explicit Flags(uint32_t value) : value_(value) { } |
| 2924 bool is_global() { return (value_ & GLOBAL) != 0; } | 2928 bool is_global() { return (value_ & GLOBAL) != 0; } |
| 2925 bool is_ignore_case() { return (value_ & IGNORE_CASE) != 0; } | 2929 bool is_ignore_case() { return (value_ & IGNORE_CASE) != 0; } |
| 2926 bool is_multiline() { return (value_ & MULTILINE) != 0; } | 2930 bool is_multiline() { return (value_ & MULTILINE) != 0; } |
| 2927 uint32_t value() { return value_; } | 2931 uint32_t value() { return value_; } |
| 2928 private: | 2932 private: |
| 2929 uint32_t value_; | 2933 uint32_t value_; |
| 2930 }; | 2934 }; |
| 2931 | 2935 |
| 2932 DECL_ACCESSORS(data, Object) | 2936 DECL_ACCESSORS(data, Object) |
| 2933 | 2937 |
| 2934 inline Type TypeTag(); | 2938 inline Type TypeTag(); |
| 2939 inline Flags GetFlags(); |
| 2940 inline String* Pattern(); |
| 2935 inline Object* DataAt(int index); | 2941 inline Object* DataAt(int index); |
| 2936 | 2942 |
| 2937 static inline JSRegExp* cast(Object* obj); | 2943 static inline JSRegExp* cast(Object* obj); |
| 2938 | 2944 |
| 2939 // Dispatched behavior. | 2945 // Dispatched behavior. |
| 2940 #ifdef DEBUG | 2946 #ifdef DEBUG |
| 2941 void JSRegExpPrint(); | 2947 void JSRegExpPrint(); |
| 2942 void JSRegExpVerify(); | 2948 void JSRegExpVerify(); |
| 2943 #endif | 2949 #endif |
| 2944 | 2950 |
| (...skipping 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4133 } else { | 4139 } else { |
| 4134 value &= ~(1 << bit_position); | 4140 value &= ~(1 << bit_position); |
| 4135 } | 4141 } |
| 4136 return value; | 4142 return value; |
| 4137 } | 4143 } |
| 4138 }; | 4144 }; |
| 4139 | 4145 |
| 4140 } } // namespace v8::internal | 4146 } } // namespace v8::internal |
| 4141 | 4147 |
| 4142 #endif // V8_OBJECTS_H_ | 4148 #endif // V8_OBJECTS_H_ |
| OLD | NEW |