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

Unified Diff: src/bootstrapper.cc

Issue 2375953002: [regexp] Port RegExp.prototype.exec to TurboFan (Closed)
Patch Set: Address comments Created 4 years, 3 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 | « BUILD.gn ('k') | src/builtins/builtins.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 2852e8f4152d9665d9d2eda137f2e12e6b7dff40..2adc56d9e21e68ca73533e1d334eefe186496c7c 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -1635,9 +1635,11 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
{ // -- R e g E x p
// Builtin functions for RegExp.prototype.
- Handle<JSFunction> regexp_fun = InstallFunction(
- global, "RegExp", JS_REGEXP_TYPE, JSRegExp::kSize,
- isolate->initial_object_prototype(), Builtins::kIllegal);
+ Handle<JSObject> prototype =
+ factory->NewJSObject(isolate->object_function(), TENURED);
+ Handle<JSFunction> regexp_fun =
+ InstallFunction(global, "RegExp", JS_REGEXP_TYPE, JSRegExp::kSize,
+ prototype, Builtins::kIllegal);
InstallWithIntrinsicDefaultProto(isolate, regexp_fun,
Context::REGEXP_FUNCTION_INDEX);
regexp_fun->shared()->SetConstructStub(
@@ -1663,6 +1665,15 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
initial_map->set_unused_property_fields(0);
initial_map->set_instance_size(initial_map->instance_size() +
num_fields * kPointerSize);
+
+ // RegExp.prototype setup.
+
+ // Install the "constructor" property on the {prototype}.
+ JSObject::AddProperty(prototype, factory->constructor_string(), regexp_fun,
+ DONT_ENUM);
+
+ SimpleInstallFunction(prototype, "exec", Builtins::kRegExpPrototypeExec, 1,
+ true, DONT_ENUM);
}
{ // -- E r r o r
« no previous file with comments | « BUILD.gn ('k') | src/builtins/builtins.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698