Index: src/objects-inl.h |
=================================================================== |
--- src/objects-inl.h (revision 830) |
+++ src/objects-inl.h (working copy) |
@@ -279,6 +279,16 @@ |
} |
+uc32 FlatStringReader::Get(int index) { |
+ ASSERT(0 <= index && index <= length_); |
+ if (is_ascii_) { |
+ return static_cast<const byte*>(start_)[index]; |
+ } else { |
+ return static_cast<const uc16*>(start_)[index]; |
+ } |
+} |
+ |
+ |
bool Object::IsNumber() { |
return IsSmi() || IsHeapNumber(); |
} |
@@ -1142,6 +1152,13 @@ |
} |
+void FixedArray::set(int index, Smi* value) { |
+ ASSERT(reinterpret_cast<Object*>(value)->IsSmi()); |
+ int offset = kHeaderSize + index * kPointerSize; |
+ WRITE_FIELD(this, offset, value); |
+} |
+ |
+ |
void FixedArray::set(int index, Object* value) { |
ASSERT(index >= 0 && index < this->length()); |
int offset = kHeaderSize + index * kPointerSize; |
@@ -1747,6 +1764,7 @@ |
void Code::set_flags(Code::Flags flags) { |
+ STATIC_ASSERT(Code::NUMBER_OF_KINDS <= (kFlagsKindMask >> kFlagsKindShift)+1); |
// Make sure that all call stubs have an arguments count. |
ASSERT(ExtractKindFromFlags(flags) != CALL_IC || |
ExtractArgumentsCountFromFlags(flags) >= 0); |
@@ -2213,6 +2231,22 @@ |
} |
+JSRegExp::Flags JSRegExp::GetFlags() { |
+ ASSERT(this->data()->IsFixedArray()); |
+ Object* data = this->data(); |
+ Smi* smi = Smi::cast(FixedArray::cast(data)->get(kFlagsIndex)); |
+ return Flags(smi->value()); |
+} |
+ |
+ |
+String* JSRegExp::Pattern() { |
+ ASSERT(this->data()->IsFixedArray()); |
+ Object* data = this->data(); |
+ String* pattern= String::cast(FixedArray::cast(data)->get(kSourceIndex)); |
+ return pattern; |
+} |
+ |
+ |
Object* JSRegExp::DataAt(int index) { |
ASSERT(TypeTag() != NOT_COMPILED); |
return FixedArray::cast(data())->get(index); |