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

Unified Diff: src/bootstrapper.cc

Issue 1379323002: [runtime] Share constructor/non-constructor bound function maps. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 | « no previous file | src/contexts.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 a7754dba1a861935354ad2be18e793cb650e9f26..be2f58e8754783763333d37ecf6b88e172dc9454 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -766,10 +766,20 @@ void Genesis::CreateStrictModeFunctionMaps(Handle<JSFunction> empty) {
strict_function_map_writable_prototype_ =
CreateStrictFunctionMap(FUNCTION_WITH_WRITEABLE_PROTOTYPE, empty);
- // Special map for bound functions.
- Handle<Map> bound_function_map =
+ // Special map for non-constructor bound functions.
+ // TODO(bmeurer): Bound functions should not be represented as JSFunctions.
+ Handle<Map> bound_function_without_constructor_map =
CreateStrictFunctionMap(BOUND_FUNCTION, empty);
- native_context()->set_bound_function_map(*bound_function_map);
+ native_context()->set_bound_function_without_constructor_map(
+ *bound_function_without_constructor_map);
+
+ // Special map for constructor bound functions.
+ // TODO(bmeurer): Bound functions should not be represented as JSFunctions.
+ Handle<Map> bound_function_with_constructor_map =
+ Map::Copy(bound_function_without_constructor_map, "IsConstructor");
+ bound_function_with_constructor_map->set_is_constructor(true);
+ native_context()->set_bound_function_with_constructor_map(
+ *bound_function_with_constructor_map);
}
« no previous file with comments | « no previous file | src/contexts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698