Index: src/objects-inl.h |
=================================================================== |
--- src/objects-inl.h (revision 8501) |
+++ 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, SKIP_WRITE_BARRIER); |
+ } |
+} |
+ |
+ |
JSObject::ElementsKind JSObject::GetElementsKind() { |
ElementsKind kind = map()->elements_kind(); |
ASSERT((kind == FAST_ELEMENTS && |