Commit 1a308662 authored by caitpotter88's avatar caitpotter88 Committed by Commit bot

[interpreter] support async functions in Ignition

BUG=v8:4483, v8:4907, 618603
LOG=N
R=neis@chromium.org, yangguo@chromium.org, littledan@chromium.org

Review-Url: https://codereview.chromium.org/2051423003
Cr-Commit-Position: refs/heads/master@{#36938}
parent ac1587bb
......@@ -1024,6 +1024,10 @@ inline bool IsAsyncFunction(FunctionKind kind) {
return kind & FunctionKind::kAsyncFunction;
}
inline bool IsResumableFunction(FunctionKind kind) {
return IsGeneratorFunction(kind) || IsAsyncFunction(kind);
}
inline bool IsConciseMethod(FunctionKind kind) {
DCHECK(IsValidFunctionKind(kind));
return kind & FunctionKind::kConciseMethod;
......
......@@ -571,7 +571,7 @@ Handle<BytecodeArray> BytecodeGenerator::MakeBytecode() {
RegisterAllocationScope register_scope(this);
if (IsGeneratorFunction(info()->literal()->kind())) {
if (IsResumableFunction(info()->literal()->kind())) {
generator_state_ = register_allocator()->NewRegister();
VisitGeneratorPrologue();
}
......@@ -698,8 +698,8 @@ void BytecodeGenerator::VisitGeneratorPrologue() {
builder()->Bind(&regular_call);
// This is a regular call. Fall through to the ordinary function prologue,
// after which we will run into the generator object creation and the initial
// yield (both inserted by the parser).
// after which we will run into the generator object creation and other extra
// code inserted by the parser.
}
void BytecodeGenerator::VisitBlock(Block* stmt) {
......
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --harmony-async-await --ignition-generators
try {
} catch(e) {; }
function __f_7(expected, run) {
var __v_10 = run();
};
__f_7("[1,2,3]", () => (function() {
return (async () => {[...await arguments] })();
})());
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment