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

Unified Diff: src/objects-inl.h

Issue 12427: Merge regexp2000 back into bleeding_edge (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 1 month 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-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);

Powered by Google App Engine
This is Rietveld 408576698