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

Side by Side Diff: src/bootstrapper.cc

Issue 2537483002: [regexp] Cache the correct initial prototype map (Closed)
Patch Set: Created 4 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/bootstrapper.h" 5 #include "src/bootstrapper.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api-natives.h" 8 #include "src/api-natives.h"
9 #include "src/base/ieee754.h" 9 #include "src/base/ieee754.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 1864 matching lines...) Expand 10 before | Expand all | Expand 10 after
1875 InstallFunction(prototype, fun, factory->search_symbol(), DONT_ENUM); 1875 InstallFunction(prototype, fun, factory->search_symbol(), DONT_ENUM);
1876 } 1876 }
1877 1877
1878 { 1878 {
1879 Handle<JSFunction> fun = SimpleCreateFunction( 1879 Handle<JSFunction> fun = SimpleCreateFunction(
1880 isolate, factory->InternalizeUtf8String("[Symbol.split]"), 1880 isolate, factory->InternalizeUtf8String("[Symbol.split]"),
1881 Builtins::kRegExpPrototypeSplit, 2, false); 1881 Builtins::kRegExpPrototypeSplit, 2, false);
1882 InstallFunction(prototype, fun, factory->split_symbol(), DONT_ENUM); 1882 InstallFunction(prototype, fun, factory->split_symbol(), DONT_ENUM);
1883 } 1883 }
1884 1884
1885 Handle<Map> prototype_map(prototype->map());
1886 Map::SetShouldBeFastPrototypeMap(prototype_map, true, isolate);
1887
1885 // Store the initial RegExp.prototype map. This is used in fast-path 1888 // Store the initial RegExp.prototype map. This is used in fast-path
1886 // checks. Do not alter the prototype after this point. 1889 // checks. Do not alter the prototype after this point.
1887 native_context()->set_regexp_prototype_map(prototype->map()); 1890 native_context()->set_regexp_prototype_map(*prototype_map);
1888 } 1891 }
1889 1892
1890 { 1893 {
1891 // RegExp getters and setters. 1894 // RegExp getters and setters.
1892 1895
1893 SimpleInstallGetter(regexp_fun, 1896 SimpleInstallGetter(regexp_fun,
1894 factory->InternalizeUtf8String("[Symbol.species]"), 1897 factory->InternalizeUtf8String("[Symbol.species]"),
1895 factory->species_symbol(), 1898 factory->species_symbol(),
1896 Builtins::kRegExpPrototypeSpeciesGetter, false); 1899 Builtins::kRegExpPrototypeSpeciesGetter, false);
1897 1900
(...skipping 2660 matching lines...) Expand 10 before | Expand all | Expand 10 after
4558 } 4561 }
4559 4562
4560 4563
4561 // Called when the top-level V8 mutex is destroyed. 4564 // Called when the top-level V8 mutex is destroyed.
4562 void Bootstrapper::FreeThreadResources() { 4565 void Bootstrapper::FreeThreadResources() {
4563 DCHECK(!IsActive()); 4566 DCHECK(!IsActive());
4564 } 4567 }
4565 4568
4566 } // namespace internal 4569 } // namespace internal
4567 } // namespace v8 4570 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698