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

Unified Diff: src/bootstrapper.cc

Issue 2415103002: [regexp] Turn last match info into a simple FixedArray (Closed)
Patch Set: Don't check instance type before map check Created 4 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
« no previous file with comments | « src/arm64/code-stubs-arm64.cc ('k') | src/builtins/builtins-regexp.cc » ('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 5c77aa4e95a8d2d22a112838e376cc1ee45039ba..30e9bec4f3ea6b4ace4fd05ce3eb75fd2956d432 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -1699,6 +1699,7 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
shared->set_instance_class_name(isolate->heap()->RegExp_string());
shared->DontAdaptArguments();
shared->set_length(2);
+
{
// RegExp.prototype setup.
@@ -1767,7 +1768,7 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
// Store the initial RegExp.prototype map. This is used in fast-path
// checks. Do not alter the prototype after this point.
- isolate->native_context()->set_regexp_prototype_map(prototype->map());
+ native_context()->set_regexp_prototype_map(prototype->map());
}
{
@@ -1873,8 +1874,15 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
function->shared()->set_internal_formal_parameter_count(2);
function->shared()->set_length(2);
function->shared()->set_native(true);
- isolate->native_context()->set(Context::REGEXP_INTERNAL_MATCH, *function);
+ native_context()->set(Context::REGEXP_INTERNAL_MATCH, *function);
}
+
+ // Create the last match info. One for external use, and one for internal
+ // use when we don't want to modify the externally visible match info.
+ Handle<RegExpMatchInfo> last_match_info = factory->NewRegExpMatchInfo();
+ 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);
}
{ // -- E r r o r
« no previous file with comments | « src/arm64/code-stubs-arm64.cc ('k') | src/builtins/builtins-regexp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698