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

Unified Diff: src/bootstrapper.cc

Issue 1779123003: [compiler] Sidestep optimizing of generator resumers. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_interpreter-generators-disable-1
Patch Set: Rebased. Created 4 years, 9 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/bailout-reason.h ('k') | src/compiler.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 7e8dd58f496b58800ed37da24c19d22ce296eda2..bd04e59a6b5fe56f50c0e0270e32ccaa88b04eda 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -2745,6 +2745,37 @@ bool Genesis::InstallNatives(GlobalContextType context_type) {
InstallBuiltinFunctionIds();
+ // Also install builtin function ids to some generator object methods. These
+ // three methods use the three resume operations (Runtime_GeneratorNext,
+ // Runtime_GeneratorReturn, Runtime_GeneratorThrow) respectively. Those
+ // operations are not supported by Crankshaft, TurboFan, nor Ignition.
+ {
+ Handle<JSObject> generator_object_prototype(JSObject::cast(
+ native_context()->generator_object_prototype_map()->prototype()));
+
+ { // GeneratorObject.prototype.next
+ Handle<String> key = factory()->next_string();
+ Handle<JSFunction> function = Handle<JSFunction>::cast(
+ JSReceiver::GetProperty(generator_object_prototype, key)
+ .ToHandleChecked());
+ function->shared()->set_builtin_function_id(kGeneratorObjectNext);
+ }
+ { // GeneratorObject.prototype.return
+ Handle<String> key = factory()->NewStringFromAsciiChecked("return");
+ Handle<JSFunction> function = Handle<JSFunction>::cast(
+ JSReceiver::GetProperty(generator_object_prototype, key)
+ .ToHandleChecked());
+ function->shared()->set_builtin_function_id(kGeneratorObjectReturn);
+ }
+ { // GeneratorObject.prototype.throw
+ Handle<String> key = factory()->throw_string();
+ Handle<JSFunction> function = Handle<JSFunction>::cast(
+ JSReceiver::GetProperty(generator_object_prototype, key)
+ .ToHandleChecked());
+ function->shared()->set_builtin_function_id(kGeneratorObjectThrow);
+ }
+ }
+
// Create a map for accessor property descriptors (a variant of JSObject
// that predefines four properties get, set, configurable and enumerable).
{
« no previous file with comments | « src/bailout-reason.h ('k') | src/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698