| Index: src/bootstrapper.cc
|
| diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
|
| index 013687d0fffda9522414bcc400937a416b9be356..3adc11e0f44202704da2c996b3ec0abec4d85975 100644
|
| --- a/src/bootstrapper.cc
|
| +++ b/src/bootstrapper.cc
|
| @@ -1685,7 +1685,6 @@ 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.
|
|
|
| @@ -1733,6 +1732,13 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
|
|
|
| {
|
| Handle<JSFunction> fun = SimpleCreateFunction(
|
| + isolate, factory->InternalizeUtf8String("[Symbol.replace]"),
|
| + Builtins::kRegExpPrototypeReplace, 2, true);
|
| + InstallFunction(prototype, fun, factory->replace_symbol(), DONT_ENUM);
|
| + }
|
| +
|
| + {
|
| + Handle<JSFunction> fun = SimpleCreateFunction(
|
| isolate, factory->InternalizeUtf8String("[Symbol.search]"),
|
| Builtins::kRegExpPrototypeSearch, 1, false);
|
| InstallFunction(prototype, fun, factory->search_symbol(), DONT_ENUM);
|
| @@ -1744,6 +1750,10 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
|
| Builtins::kRegExpPrototypeSplit, 2, false);
|
| InstallFunction(prototype, fun, factory->split_symbol(), DONT_ENUM);
|
| }
|
| +
|
| + // 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());
|
| }
|
|
|
| {
|
|
|