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

Unified Diff: src/bootstrapper.cc

Issue 1548623002: [runtime] Also migrate the Function and GeneratorFunction constructors to C++. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix message tests. Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/builtins.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 2c71e1395cecc344a3330c99726626f159d8ce98..34494122096da30dfc5919d15e74e71547e42136 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -1117,11 +1117,13 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
{ // --- F u n c t i o n ---
Handle<JSFunction> function_function =
InstallFunction(global, "Function", JS_FUNCTION_TYPE, JSFunction::kSize,
- empty_function, Builtins::kIllegal);
+ empty_function, Builtins::kFunctionConstructor);
function_function->set_prototype_or_initial_map(
*sloppy_function_map_writable_prototype_);
+ function_function->shared()->DontAdaptArguments();
function_function->shared()->set_construct_stub(
- *isolate->builtins()->JSBuiltinsConstructStub());
+ *isolate->builtins()->FunctionConstructor());
+ function_function->shared()->set_length(1);
InstallWithIntrinsicDefaultProto(isolate, function_function,
Context::FUNCTION_FUNCTION_INDEX);
@@ -1909,14 +1911,16 @@ void Bootstrapper::ExportFromRuntime(Isolate* isolate,
generator_function_prototype, NONE);
static const bool kUseStrictFunctionMap = true;
- Handle<JSFunction> generator_function_function =
- InstallFunction(container, "GeneratorFunction", JS_FUNCTION_TYPE,
- JSFunction::kSize, generator_function_prototype,
- Builtins::kIllegal, kUseStrictFunctionMap);
+ Handle<JSFunction> generator_function_function = InstallFunction(
+ container, "GeneratorFunction", JS_FUNCTION_TYPE, JSFunction::kSize,
+ generator_function_prototype, Builtins::kGeneratorFunctionConstructor,
+ kUseStrictFunctionMap);
generator_function_function->set_prototype_or_initial_map(
native_context->sloppy_generator_function_map());
+ generator_function_function->shared()->DontAdaptArguments();
generator_function_function->shared()->set_construct_stub(
- *isolate->builtins()->JSBuiltinsConstructStub());
+ *isolate->builtins()->GeneratorFunctionConstructor());
+ generator_function_function->shared()->set_length(1);
InstallWithIntrinsicDefaultProto(
isolate, generator_function_function,
Context::GENERATOR_FUNCTION_FUNCTION_INDEX);
« no previous file with comments | « no previous file | src/builtins.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698