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

Unified Diff: src/runtime/runtime-debug.cc

Issue 2898163002: Make non-Module generators only context allocate parameters. (Closed)
Patch Set: Rebase Created 3 years, 7 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/parsing/parser.cc ('k') | test/cctest/interpreter/bytecode_expectations/ForAwaitOf.golden » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-debug.cc
diff --git a/src/runtime/runtime-debug.cc b/src/runtime/runtime-debug.cc
index b65757b2de4957df4070fb4dee50359b995fec1b..c7a8f7f70fbd8114c93672259227059b523f9466 100644
--- a/src/runtime/runtime-debug.cc
+++ b/src/runtime/runtime-debug.cc
@@ -921,6 +921,11 @@ RUNTIME_FUNCTION(Runtime_GetGeneratorScopeCount) {
// Check arguments.
CONVERT_ARG_HANDLE_CHECKED(JSGeneratorObject, gen, 0);
+ // Only inspect suspended generator scopes.
+ if (!gen->is_suspended()) {
+ return Smi::kZero;
+ }
+
// Count the visible scopes.
int n = 0;
for (ScopeIterator it(isolate, gen); !it.Done(); it.Next()) {
@@ -942,6 +947,11 @@ RUNTIME_FUNCTION(Runtime_GetGeneratorScopeDetails) {
CONVERT_ARG_HANDLE_CHECKED(JSGeneratorObject, gen, 0);
CONVERT_NUMBER_CHECKED(int, index, Int32, args[1]);
+ // Only inspect suspended generator scopes.
+ if (!gen->is_suspended()) {
+ return isolate->heap()->undefined_value();
+ }
+
// Find the requested scope.
int n = 0;
ScopeIterator it(isolate, gen);
« no previous file with comments | « src/parsing/parser.cc ('k') | test/cctest/interpreter/bytecode_expectations/ForAwaitOf.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698