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

Unified Diff: src/factory.cc

Issue 28311: Flattened the representation of compiled RegExp data. (Closed)
Patch Set: ... and it lints. Created 11 years, 10 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
« no previous file with comments | « src/factory.h ('k') | src/jsregexp.h » ('j') | src/jsregexp.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index ec52520272a2b5b9612d85958cc68c31d3f7d069..2cf411eae16b59b8ae41ab2b0b4dff39cb25e50c 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -826,12 +826,13 @@ Handle<Map> Factory::ObjectLiteralMapFromCache(Handle<Context> context,
}
-void Factory::SetRegExpData(Handle<JSRegExp> regexp,
- JSRegExp::Type type,
- Handle<String> source,
- JSRegExp::Flags flags,
- Handle<Object> data) {
- Handle<FixedArray> store = NewFixedArray(JSRegExp::kDataSize);
+void Factory::SetRegExpAtomData(Handle<JSRegExp> regexp,
+ JSRegExp::Type type,
+ Handle<String> source,
+ JSRegExp::Flags flags,
+ Handle<Object> data) {
+ Handle<FixedArray> store = NewFixedArray(JSRegExp::kAtomDataSize);
+
store->set(JSRegExp::kTagIndex, Smi::FromInt(type));
store->set(JSRegExp::kSourceIndex, *source);
store->set(JSRegExp::kFlagsIndex, Smi::FromInt(flags.value()));
@@ -839,6 +840,25 @@ void Factory::SetRegExpData(Handle<JSRegExp> regexp,
regexp->set_data(*store);
}
+void Factory::SetRegExpIrregexpData(Handle<JSRegExp> regexp,
+ JSRegExp::Type type,
+ Handle<String> source,
+ JSRegExp::Flags flags,
+ int capture_count) {
+ Handle<FixedArray> store = NewFixedArray(JSRegExp::kIrregexpDataSize);
+
+ store->set(JSRegExp::kTagIndex, Smi::FromInt(type));
+ store->set(JSRegExp::kSourceIndex, *source);
+ store->set(JSRegExp::kFlagsIndex, Smi::FromInt(flags.value()));
+ store->set(JSRegExp::kIrregexpASCIICodeIndex, Heap::the_hole_value());
+ store->set(JSRegExp::kIrregexpUC16CodeIndex, Heap::the_hole_value());
+ store->set(JSRegExp::kIrregexpMaxRegisterCountIndex, Smi::FromInt(0));
+ store->set(JSRegExp::kIrregexpCaptureCountIndex,
+ Smi::FromInt(capture_count));
+ regexp->set_data(*store);
+}
+
+
void Factory::ConfigureInstance(Handle<FunctionTemplateInfo> desc,
Handle<JSObject> instance,
« no previous file with comments | « src/factory.h ('k') | src/jsregexp.h » ('j') | src/jsregexp.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698