Index: src/objects-inl.h |
=================================================================== |
--- src/objects-inl.h (revision 8431) |
+++ src/objects-inl.h (working copy) |
@@ -3850,6 +3850,12 @@ |
} |
+JSRegExp::Type JSRegExp::TypeTagUnchecked() { |
+ Smi* smi = Smi::cast(DataAtUnchecked(kTagIndex)); |
+ return static_cast<JSRegExp::Type>(smi->value()); |
+} |
+ |
+ |
int JSRegExp::CaptureCount() { |
switch (TypeTag()) { |
case ATOM: |
@@ -3885,6 +3891,13 @@ |
} |
+Object* JSRegExp::DataAtUnchecked(int index) { |
+ FixedArray* fa = reinterpret_cast<FixedArray*>(data()); |
+ int offset = FixedArray::kHeaderSize + index * kPointerSize; |
+ return READ_FIELD(fa, offset); |
+} |
+ |
+ |
void JSRegExp::SetDataAt(int index, Object* value) { |
ASSERT(TypeTag() != NOT_COMPILED); |
ASSERT(index >= kDataIndex); // Only implementation data can be set this way. |
@@ -3892,6 +3905,17 @@ |
} |
+void JSRegExp::SetDataAtUnchecked(int index, Object* value, Heap* heap) { |
+ ASSERT(index >= kDataIndex); // Only implementation data can be set this way. |
+ FixedArray* fa = reinterpret_cast<FixedArray*>(data()); |
+ if (value->IsSmi()) { |
+ fa->set_unchecked(index, Smi::cast(value)); |
+ } else { |
+ fa->set_unchecked(heap, index, value, UPDATE_WRITE_BARRIER); |
Erik Corry
2011/06/30 18:48:25
I think this is OK, but I would like to ask Slava.
Rico
2011/07/01 05:58:09
Done.
|
+ } |
+} |
+ |
+ |
JSObject::ElementsKind JSObject::GetElementsKind() { |
ElementsKind kind = map()->elements_kind(); |
ASSERT((kind == FAST_ELEMENTS && |