Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Unified Diff: src/objects.h

Issue 43075: * Reapply revisions 1383, 1384, 1391, 1398, 1401, 1402,... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/objects.h
===================================================================
--- src/objects.h (revision 1489)
+++ src/objects.h (working copy)
@@ -2966,6 +2966,19 @@
};
// Regular expressions
+// The regular expression holds a single reference to a FixedArray in
+// the kDataOffset field.
+// The FixedArray contains the following data:
+// - tag : type of regexp implementation (not compiled yet, atom or irregexp)
+// - reference to the original source string
+// - reference to the original flag string
+// If it is an atom regexp
+// - a reference to a literal string to search for
+// If it is an irregexp regexp:
+// - a reference to code for ASCII inputs (bytecode or compiled).
+// - a reference to code for UC16 inputs (bytecode or compiled).
+// - max number of registers used by irregexp implementations.
+// - number of capture registers (output values) of the regexp.
class JSRegExp: public JSObject {
public:
// Meaning of Type:
@@ -2993,6 +3006,8 @@
inline Flags GetFlags();
inline String* Pattern();
inline Object* DataAt(int index);
+ // Set implementation data after the object has been prepared.
+ inline void SetDataAt(int index, Object* value);
static inline JSRegExp* cast(Object* obj);
@@ -3004,14 +3019,29 @@
static const int kDataOffset = JSObject::kHeaderSize;
static const int kSize = kDataOffset + kIntSize;
+ // Indices in the data array.
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
- // different purposes in different types of regexps.
- static const int kAtomPatternIndex = kFlagsIndex + 1;
- static const int kIrregexpDataIndex = kFlagsIndex + 1;
- static const int kDataSize = kAtomPatternIndex + 1;
+ static const int kDataIndex = kFlagsIndex + 1;
+ // The data fields are used in different ways depending on the
+ // value of the tag.
+ // Atom regexps (literal strings).
+ static const int kAtomPatternIndex = kDataIndex;
+
+ static const int kAtomDataSize = kAtomPatternIndex + 1;
+
+ // Irregexp compiled code or bytecode for ASCII.
+ static const int kIrregexpASCIICodeIndex = kDataIndex;
+ // Irregexp compiled code or bytecode for UC16.
+ static const int kIrregexpUC16CodeIndex = kDataIndex + 1;
+ // Maximal number of registers used by either ASCII or UC16.
+ // Only used to check that there is enough stack space
+ static const int kIrregexpMaxRegisterCountIndex = kDataIndex + 2;
+ // Number of captures in the compiled regexp.
+ static const int kIrregexpCaptureCountIndex = kDataIndex + 3;
+
+ static const int kIrregexpDataSize = kIrregexpCaptureCountIndex + 1;
};
@@ -3806,6 +3836,10 @@
// Casting.
static inline JSArray* cast(Object* obj);
+ // Uses handles. Ensures that the fixed array backing the JSArray has at
+ // least the stated size.
+ void EnsureSize(int minimum_size_of_backing_fixed_array);
+
// Dispatched behavior.
#ifdef DEBUG
void JSArrayPrint();

Powered by Google App Engine
This is Rietveld 408576698