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

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

Issue 1895603002: [esnext] prototype runtime implementation for async functions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@AsyncFunction
Patch Set: majorly improve stack traces, get rid of self-spawning behaviour, create inner generator function Created 4 years, 8 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
Index: src/runtime/runtime-generator.cc
diff --git a/src/runtime/runtime-generator.cc b/src/runtime/runtime-generator.cc
index eeac3ad6b64b934b897387313139d88ccaa6eb4e..1a94cb45d04b6ae7382859f6c88c154f6d1e1d78 100644
--- a/src/runtime/runtime-generator.cc
+++ b/src/runtime/runtime-generator.cc
@@ -17,7 +17,8 @@ RUNTIME_FUNCTION(Runtime_CreateJSGeneratorObject) {
DCHECK(args.length() == 2);
CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
CONVERT_ARG_HANDLE_CHECKED(Object, receiver, 1);
- RUNTIME_ASSERT(function->shared()->is_generator());
+ RUNTIME_ASSERT(function->shared()->is_generator() ||
+ function->shared()->is_async());
Handle<JSGeneratorObject> generator =
isolate->factory()->NewJSGeneratorObject(function);
@@ -37,7 +38,8 @@ RUNTIME_FUNCTION(Runtime_SuspendJSGeneratorObject) {
JavaScriptFrameIterator stack_iterator(isolate);
JavaScriptFrame* frame = stack_iterator.frame();
- RUNTIME_ASSERT(frame->function()->shared()->is_generator());
+ RUNTIME_ASSERT(frame->function()->shared()->is_generator() ||
+ frame->function()->shared()->is_async());
DCHECK_EQ(frame->function(), generator_object->function());
DCHECK(frame->function()->shared()->is_compiled());
DCHECK(!frame->function()->IsOptimized());

Powered by Google App Engine
This is Rietveld 408576698