| 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 1480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1491 | 1491 |
| 1492 | 1492 |
| 1493 // FixedArray describes fixed sized arrays where element | 1493 // FixedArray describes fixed sized arrays where element |
| 1494 // type is Object*. | 1494 // type is Object*. |
| 1495 | 1495 |
| 1496 class FixedArray: public Array { | 1496 class FixedArray: public Array { |
| 1497 public: | 1497 public: |
| 1498 | 1498 |
| 1499 // Setter and getter for elements. | 1499 // Setter and getter for elements. |
| 1500 inline Object* get(int index); | 1500 inline Object* get(int index); |
| 1501 // Setter that uses write barrier. |
| 1501 inline void set(int index, Object* value); | 1502 inline void set(int index, Object* value); |
| 1502 | 1503 |
| 1503 // Setter with barrier mode. | 1504 // Setter that doesn't need write barrier). |
| 1505 inline void set(int index, Smi* value); |
| 1506 // Setter with explicit barrier mode. |
| 1504 inline void set(int index, Object* value, WriteBarrierMode mode); | 1507 inline void set(int index, Object* value, WriteBarrierMode mode); |
| 1505 | 1508 |
| 1506 // Setters for frequently used oddballs located in old space. | 1509 // Setters for frequently used oddballs located in old space. |
| 1507 inline void set_undefined(int index); | 1510 inline void set_undefined(int index); |
| 1508 inline void set_null(int index); | 1511 inline void set_null(int index); |
| 1509 inline void set_the_hole(int index); | 1512 inline void set_the_hole(int index); |
| 1510 | 1513 |
| 1511 // Copy operations. | 1514 // Copy operations. |
| 1512 inline Object* Copy(); | 1515 inline Object* Copy(); |
| 1513 Object* CopySize(int new_length); | 1516 Object* CopySize(int new_length); |
| (...skipping 1395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2909 DISALLOW_IMPLICIT_CONSTRUCTORS(JSValue); | 2912 DISALLOW_IMPLICIT_CONSTRUCTORS(JSValue); |
| 2910 }; | 2913 }; |
| 2911 | 2914 |
| 2912 // Regular expressions | 2915 // Regular expressions |
| 2913 class JSRegExp: public JSObject { | 2916 class JSRegExp: public JSObject { |
| 2914 public: | 2917 public: |
| 2915 // Meaning of Type: | 2918 // Meaning of Type: |
| 2916 // NOT_COMPILED: Initial value. No data has been stored in the JSRegExp yet. | 2919 // NOT_COMPILED: Initial value. No data has been stored in the JSRegExp yet. |
| 2917 // JSCRE: A complex RegExp for JSCRE | 2920 // JSCRE: A complex RegExp for JSCRE |
| 2918 // ATOM: A simple string to match against using an indexOf operation. | 2921 // ATOM: A simple string to match against using an indexOf operation. |
| 2919 enum Type { NOT_COMPILED, JSCRE, ATOM }; | 2922 // RE2K: Compiled with RegExp2000. |
| 2923 // RE2K_NATIVE: Compiled to native code with RegExp2000. |
| 2924 enum Type { NOT_COMPILED, JSCRE, ATOM, RE2K, RE2K_NATIVE }; |
| 2920 enum Flag { NONE = 0, GLOBAL = 1, IGNORE_CASE = 2, MULTILINE = 4 }; | 2925 enum Flag { NONE = 0, GLOBAL = 1, IGNORE_CASE = 2, MULTILINE = 4 }; |
| 2921 | 2926 |
| 2922 class Flags { | 2927 class Flags { |
| 2923 public: | 2928 public: |
| 2924 explicit Flags(uint32_t value) : value_(value) { } | 2929 explicit Flags(uint32_t value) : value_(value) { } |
| 2925 bool is_global() { return (value_ & GLOBAL) != 0; } | 2930 bool is_global() { return (value_ & GLOBAL) != 0; } |
| 2926 bool is_ignore_case() { return (value_ & IGNORE_CASE) != 0; } | 2931 bool is_ignore_case() { return (value_ & IGNORE_CASE) != 0; } |
| 2927 bool is_multiline() { return (value_ & MULTILINE) != 0; } | 2932 bool is_multiline() { return (value_ & MULTILINE) != 0; } |
| 2928 uint32_t value() { return value_; } | 2933 uint32_t value() { return value_; } |
| 2929 private: | 2934 private: |
| (...skipping 14 matching lines...) Expand all Loading... |
| 2944 void JSRegExpPrint(); | 2949 void JSRegExpPrint(); |
| 2945 void JSRegExpVerify(); | 2950 void JSRegExpVerify(); |
| 2946 #endif | 2951 #endif |
| 2947 | 2952 |
| 2948 static const int kDataOffset = JSObject::kHeaderSize; | 2953 static const int kDataOffset = JSObject::kHeaderSize; |
| 2949 static const int kSize = kDataOffset + kIntSize; | 2954 static const int kSize = kDataOffset + kIntSize; |
| 2950 | 2955 |
| 2951 static const int kTagIndex = 0; | 2956 static const int kTagIndex = 0; |
| 2952 static const int kSourceIndex = kTagIndex + 1; | 2957 static const int kSourceIndex = kTagIndex + 1; |
| 2953 static const int kFlagsIndex = kSourceIndex + 1; | 2958 static const int kFlagsIndex = kSourceIndex + 1; |
| 2954 // These two are the same since the same entry is shared for | 2959 // These three are the same since the same entry is shared for |
| 2955 // different purposes in different types of regexps. | 2960 // different purposes in different types of regexps. |
| 2956 static const int kAtomPatternIndex = kFlagsIndex + 1; | 2961 static const int kAtomPatternIndex = kFlagsIndex + 1; |
| 2957 static const int kJscreDataIndex = kFlagsIndex + 1; | 2962 static const int kJscreDataIndex = kFlagsIndex + 1; |
| 2963 static const int kRe2kDataIndex = kFlagsIndex + 1; |
| 2958 static const int kDataSize = kAtomPatternIndex + 1; | 2964 static const int kDataSize = kAtomPatternIndex + 1; |
| 2959 }; | 2965 }; |
| 2960 | 2966 |
| 2961 | 2967 |
| 2962 class CompilationCacheTable: public HashTable<0, 2> { | 2968 class CompilationCacheTable: public HashTable<0, 2> { |
| 2963 public: | 2969 public: |
| 2964 // Find cached value for a string key, otherwise return null. | 2970 // Find cached value for a string key, otherwise return null. |
| 2965 Object* Lookup(String* src); | 2971 Object* Lookup(String* src); |
| 2966 Object* LookupRegExp(String* source, JSRegExp::Flags flags); | 2972 Object* LookupRegExp(String* source, JSRegExp::Flags flags); |
| 2967 Object* Put(String* src, Object* value); | 2973 Object* Put(String* src, Object* value); |
| (...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4171 } else { | 4177 } else { |
| 4172 value &= ~(1 << bit_position); | 4178 value &= ~(1 << bit_position); |
| 4173 } | 4179 } |
| 4174 return value; | 4180 return value; |
| 4175 } | 4181 } |
| 4176 }; | 4182 }; |
| 4177 | 4183 |
| 4178 } } // namespace v8::internal | 4184 } } // namespace v8::internal |
| 4179 | 4185 |
| 4180 #endif // V8_OBJECTS_H_ | 4186 #endif // V8_OBJECTS_H_ |
| OLD | NEW |