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

Unified Diff: src/js/generator.js

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 | « src/builtins.cc ('k') | src/js/v8natives.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/generator.js
diff --git a/src/js/generator.js b/src/js/generator.js
index 2f61b3f22cd1e232bc90ec5b0a36f750c574366d..7f43656ebcf5c1fb4cfb5eca311e8381082f5c33 100644
--- a/src/js/generator.js
+++ b/src/js/generator.js
@@ -15,12 +15,10 @@ var GeneratorFunctionPrototype = utils.ImportNow("GeneratorFunctionPrototype");
var GeneratorFunction = utils.ImportNow("GeneratorFunction");
var GlobalFunction = global.Function;
var MakeTypeError;
-var NewFunctionString;
var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol");
utils.Import(function(from) {
MakeTypeError = from.MakeTypeError;
- NewFunctionString = from.NewFunctionString;
});
// ----------------------------------------------------------------------------
@@ -78,19 +76,6 @@ function GeneratorObjectThrow(exn) {
}
}
-
-function GeneratorFunctionConstructor(arg1) { // length == 1
- var source = NewFunctionString(arguments, 'function*');
- var global_proxy = %GlobalProxy(GeneratorFunctionConstructor);
- // Compile the string in the constructor and not a helper so that errors
- // appear to come from here.
- var func = %_Call(%CompileString(source, true), global_proxy);
- // Set name-should-print-as-anonymous flag on the ShareFunctionInfo and
- // ensure that |func| uses correct initial map from |new.target| if
- // it's available.
- return %CompleteFunctionConstruction(func, GeneratorFunction, new.target);
-}
-
// ----------------------------------------------------------------------------
// Both Runtime_GeneratorNext and Runtime_GeneratorThrow are supported by
@@ -115,6 +100,5 @@ utils.InstallFunctions(GeneratorObjectPrototype,
%AddNamedProperty(GeneratorFunctionPrototype, "constructor",
GeneratorFunction, DONT_ENUM | READ_ONLY);
%InternalSetPrototype(GeneratorFunction, GlobalFunction);
-%SetCode(GeneratorFunction, GeneratorFunctionConstructor);
})
« no previous file with comments | « src/builtins.cc ('k') | src/js/v8natives.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698