[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}
This commit is contained in:
caitpotter88 2016-06-13 10:19:47 -07:00 committed by Commit bot
parent ac1587bb86
commit 1a30866239
3 changed files with 21 additions and 3 deletions

View File

@ -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;

View File

@ -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) {

View File

@ -0,0 +1,14 @@
// 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] })();
})());