Index: src/objects.h |
=================================================================== |
--- src/objects.h (revision 830) |
+++ src/objects.h (working copy) |
@@ -1498,9 +1498,12 @@ |
// Setter and getter for elements. |
inline Object* get(int index); |
+ // Setter that uses write barrier. |
inline void set(int index, Object* value); |
- // Setter with barrier mode. |
+ // Setter that doesn't need write barrier). |
+ inline void set(int index, Smi* value); |
+ // Setter with explicit barrier mode. |
inline void set(int index, Object* value, WriteBarrierMode mode); |
// Setters for frequently used oddballs located in old space. |
@@ -2114,14 +2117,17 @@ |
CALL_IC, |
STORE_IC, |
KEYED_STORE_IC, |
+ // No more than eight kinds. The value currently encoded in three bits in |
+ // Flags. |
// Pseudo-kinds. |
+ REGEXP = BUILTIN, |
FIRST_IC_KIND = LOAD_IC, |
LAST_IC_KIND = KEYED_STORE_IC |
}; |
enum { |
- NUMBER_OF_KINDS = LAST_IC_KIND + 1 |
+ NUMBER_OF_KINDS = KEYED_STORE_IC + 1 |
Christian Plesner Hansen
2008/11/26 06:49:56
Should be LAST_IC_KIND
|
}; |
// A state indicates that inline cache in this Code object contains |
@@ -2272,7 +2278,6 @@ |
static const int kFlagsTypeMask = 0x000001C0; // 111000000 |
static const int kFlagsArgumentsCountMask = 0xFFFFFE00; |
- |
private: |
DISALLOW_IMPLICIT_CONSTRUCTORS(Code); |
}; |
@@ -2912,7 +2917,13 @@ |
// Regular expressions |
class JSRegExp: public JSObject { |
public: |
- enum Type { NOT_COMPILED, JSCRE, ATOM }; |
+ // Meaning of Type: |
+ // NOT_COMPILED: Initial value. No data has been stored in the JSRegExp yet. |
+ // JSCRE: A complex RegExp for JSCRE |
+ // ATOM: A simple string to match against using an indexOf operation. |
+ // IRREGEXP: Compiled with Irregexp. |
+ // IRREGEXP_NATIVE: Compiled to native code with Irregexp. |
+ enum Type { NOT_COMPILED, JSCRE, ATOM, IRREGEXP, IRREGEXP_NATIVE }; |
enum Flag { NONE = 0, GLOBAL = 1, IGNORE_CASE = 2, MULTILINE = 4 }; |
class Flags { |
@@ -2929,6 +2940,8 @@ |
DECL_ACCESSORS(data, Object) |
inline Type TypeTag(); |
+ inline Flags GetFlags(); |
+ inline String* Pattern(); |
inline Object* DataAt(int index); |
static inline JSRegExp* cast(Object* obj); |
@@ -2945,10 +2958,11 @@ |
static const int kTagIndex = 0; |
static const int kSourceIndex = kTagIndex + 1; |
static const int kFlagsIndex = kSourceIndex + 1; |
- // These two are the same since the same entry is shared for |
+ // These three are the same since the same entry is shared for |
// different purposes in different types of regexps. |
static const int kAtomPatternIndex = kFlagsIndex + 1; |
static const int kJscreDataIndex = kFlagsIndex + 1; |
+ static const int kIrregexpDataIndex = kFlagsIndex + 1; |
static const int kDataSize = kAtomPatternIndex + 1; |
}; |
@@ -3578,6 +3592,28 @@ |
}; |
+// A flat string reader provides random access to the contents of a |
+// string independent of the character width of the string. The handle |
+// must be valid as long as the reader is being used. |
+class FlatStringReader BASE_EMBEDDED { |
+ public: |
+ explicit FlatStringReader(Handle<String> str); |
+ explicit FlatStringReader(Vector<const char> input); |
+ ~FlatStringReader(); |
+ void RefreshState(); |
+ inline uc32 Get(int index); |
+ int length() { return length_; } |
+ static void PostGarbageCollectionProcessing(); |
+ private: |
+ String** str_; |
+ bool is_ascii_; |
+ int length_; |
+ const void* start_; |
+ FlatStringReader* prev_; |
+ static FlatStringReader* top_; |
+}; |
+ |
+ |
// Note that StringInputBuffers are not valid across a GC! To fix this |
// it would have to store a String Handle instead of a String* and |
// AsciiStringReadBlock would have to be modified to use memcpy. |