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

Unified Diff: src/bootstrapper.cc

Issue 2780173002: [regexp] Add support for dotAll flag (Closed)
Patch Set: Address comments Created 3 years, 9 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/assembler.cc ('k') | src/builtins/builtins-definitions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index be025b40870f9ff4b64d0d37e4012e9acafa47ac..8c5a438fcea1d49d548789ee69cdb244a920c1f6 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -4001,6 +4001,22 @@ void Genesis::InitializeGlobal_harmony_promise_finally() {
}
}
+void Genesis::InitializeGlobal_harmony_regexp_dotall() {
+ if (!FLAG_harmony_regexp_dotall) return;
+
+ Handle<JSFunction> constructor(native_context()->regexp_function());
+ Handle<JSObject> prototype(JSObject::cast(constructor->instance_prototype()));
+
+ SimpleInstallGetter(prototype, isolate()->factory()->dotAll_string(),
+ Builtins::kRegExpPrototypeDotAllGetter, true);
+
+ // The regexp prototype map has changed because we added a property
+ // to it, so we update the saved map.
+ Handle<Map> prototype_map(prototype->map());
+ Map::SetShouldBeFastPrototypeMap(prototype_map, true, isolate());
+ native_context()->set_regexp_prototype_map(*prototype_map);
+}
+
#ifdef V8_I18N_SUPPORT
void Genesis::InitializeGlobal_datetime_format_to_parts() {
if (!FLAG_datetime_format_to_parts) return;
« no previous file with comments | « src/assembler.cc ('k') | src/builtins/builtins-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698