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 1316933002: [es6] Initial steps towards a correct implementation of IsCallable. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase again. Created 5 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 | « src/array.js ('k') | src/builtins.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 65dbaebdba781312618fbb87c8c0c47fca7109ff..a8858b7d02a065818d25da83d6d5a8f7b4f146c5 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -488,6 +488,7 @@ Handle<Map> Genesis::CreateSloppyFunctionMap(FunctionMode function_mode) {
Handle<Map> map = factory()->NewMap(JS_FUNCTION_TYPE, JSFunction::kSize);
SetFunctionInstanceDescriptor(map, function_mode);
map->set_function_with_prototype(IsFunctionModeWithPrototype(function_mode));
+ map->set_is_callable();
return map;
}
@@ -727,6 +728,7 @@ Handle<Map> Genesis::CreateStrictFunctionMap(
Handle<Map> map = factory()->NewMap(JS_FUNCTION_TYPE, JSFunction::kSize);
SetStrictFunctionInstanceDescriptor(map, function_mode);
map->set_function_with_prototype(IsFunctionModeWithPrototype(function_mode));
+ map->set_is_callable();
Map::SetPrototype(map, empty_function);
return map;
}
@@ -738,6 +740,7 @@ Handle<Map> Genesis::CreateStrongFunctionMap(
SetStrongFunctionInstanceDescriptor(map);
map->set_function_with_prototype(is_constructor);
Map::SetPrototype(map, empty_function);
+ map->set_is_callable();
map->set_is_extensible(is_constructor);
map->set_is_strong();
return map;
@@ -1044,8 +1047,10 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> global_object,
Handle<JSObject> global(native_context()->global_object());
// Install global Function object
- InstallFunction(global, "Function", JS_FUNCTION_TYPE, JSFunction::kSize,
- empty_function, Builtins::kIllegal);
+ Handle<JSFunction> function_function =
+ InstallFunction(global, "Function", JS_FUNCTION_TYPE, JSFunction::kSize,
+ empty_function, Builtins::kIllegal);
+ function_function->initial_map()->set_is_callable();
{ // --- A r r a y ---
Handle<JSFunction> array_function =
@@ -2242,9 +2247,11 @@ bool Genesis::InstallNatives(ContextType context_type) {
static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY));
static const bool kUseStrictFunctionMap = true;
- InstallFunction(builtins, "GeneratorFunction", JS_FUNCTION_TYPE,
- JSFunction::kSize, generator_function_prototype,
- Builtins::kIllegal, kUseStrictFunctionMap);
+ Handle<JSFunction> generator_function_function =
+ InstallFunction(builtins, "GeneratorFunction", JS_FUNCTION_TYPE,
+ JSFunction::kSize, generator_function_prototype,
+ Builtins::kIllegal, kUseStrictFunctionMap);
+ generator_function_function->initial_map()->set_is_callable();
// Create maps for generator functions and their prototypes. Store those
// maps in the native context. The "prototype" property descriptor is
« no previous file with comments | « src/array.js ('k') | src/builtins.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698