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

Unified Diff: src/objects-inl.h

Issue 8104: Regexp caching (Closed)
Patch Set: Created 12 years, 2 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-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index fe470c8980410ffb434a8adfd82bcaec855b282c..4fc61fad953a608f564244304a6acb5192ca47bc 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -2166,16 +2166,18 @@ ACCESSORS(JSArray, length, Object, kLengthOffset)
ACCESSORS(JSRegExp, data, Object, kDataOffset)
-ACCESSORS(JSRegExp, type, Object, kTypeOffset)
-JSRegExp::Type JSRegExp::type_tag() {
- return static_cast<JSRegExp::Type>(Smi::cast(type())->value());
+JSRegExp::Type JSRegExp::TypeTag() {
+ Object* data = this->data();
+ if (data->IsUndefined()) return JSRegExp::NOT_COMPILED;
+ Smi* smi = Smi::cast(FixedArray::cast(data)->get(kTagIndex));
+ return static_cast<JSRegExp::Type>(smi->value());
}
-void JSRegExp::set_type_tag(JSRegExp::Type value) {
- set_type(Smi::FromInt(value));
+Object* JSRegExp::DataAt(int index) {
+ return FixedArray::cast(data())->get(index);
Kasper Lund 2008/10/24 06:42:50 Maybe you should add an ASSERT that data isn't und
}
« src/objects-debug.cc ('K') | « src/objects-debug.cc ('k') | tools/test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698