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

Unified Diff: src/bootstrapper.cc

Issue 2786143004: [bootstrapper] Ensure RegExp constructor has fast properties. (Closed)
Patch Set: Fix test. 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 | « no previous file | test/mjsunit/regress/regress-5902.js » ('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 a1ffe77db635a8364deb7f1f96754eeba4348d5e..3d5c4d6f49d09bcc7bd8d25350b323fd4830d7cd 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -2437,6 +2437,15 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
native_context()->set_regexp_last_match_info(*last_match_info);
Handle<RegExpMatchInfo> internal_match_info = factory->NewRegExpMatchInfo();
native_context()->set_regexp_internal_match_info(*internal_match_info);
+
+ // Force the RegExp constructor to fast properties, so that we can use the
+ // fast paths for various things like
+ //
+ // x instanceof RegExp
+ //
+ // etc. We should probably come up with a more principled approach once
+ // the JavaScript builtins are gone.
+ JSObject::MigrateSlowToFast(regexp_fun, 0, "Bootstrapping");
}
{ // -- E r r o r
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-5902.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698