Commit 7a581fa2 authored by Deepti Gandluri's avatar Deepti Gandluri Committed by Commit Bot

Revert "[ignition] Be smarter about register allocation in VisitSuspend"

This reverts commit 98927ea5.

Reason for revert: Breaks Mac GC Stress bot.
https://uberchromegw.corp.google.com/i/client.v8/builders/V8%20Mac%20GC%20Stress/builds/13299/steps/Mjsunit/logs/for-await-of

Original change's description:
> [ignition] Be smarter about register allocation in VisitSuspend
> 
> Split BytecodeGenerator::VisitSuspend into two pieces, one for
> building the suspension code and one for resumption (these
> are split into separate Build methods for convenience).
> Each gets its own RegisterAllocationScope, which allows us to
> reduce the register file size of the empty generator by 1.
> 
> For consistency, rename VisitGeneratorPrologue() to
> BuildGeneratorPrologue() to match the names of the two
> newly-created methods.
> 
> Bug: v8:6379
> Change-Id: I08a617a44f99706cfff09bf86fb0a25a9cd6e032
> Reviewed-on: https://chromium-review.googlesource.com/503593
> Commit-Queue: Adam Klein <adamk@chromium.org>
> Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#45318}

TBR=rmcilroy@chromium.org,adamk@chromium.org,neis@chromium.org,kozyatinskiy@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Bug: v8:6379

Change-Id: I787fc3811c4f33a8021cf9170d43a74ed9b55d1c
Reviewed-on: https://chromium-review.googlesource.com/506548Reviewed-by: 's avatarDeepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45319}
parent 98927ea5
......@@ -2388,13 +2388,12 @@ void BytecodeGenerator::VisitAssignment(Assignment* expr) {
}
}
void BytecodeGenerator::BuildGeneratorSuspend(Suspend* expr,
Register generator) {
RegisterAllocationScope register_scope(this);
void BytecodeGenerator::VisitSuspend(Suspend* expr) {
builder()->SetExpressionPosition(expr);
Register value = VisitForRegisterValue(expr->expression());
Register generator = VisitForRegisterValue(expr->generator_object());
// Save context, registers, and state. Then return.
builder()
->LoadLiteral(Smi::FromInt(expr->suspend_id()))
......@@ -2417,85 +2416,79 @@ void BytecodeGenerator::BuildGeneratorSuspend(Suspend* expr,
builder()->LoadAccumulatorWithRegister(value);
}
builder()->Return(); // Hard return (ignore any finally blocks).
}
void BytecodeGenerator::BuildGeneratorResume(Suspend* expr,
Register generator) {
RegisterAllocationScope register_scope(this);
builder()->Bind(generator_jump_table_, static_cast<int>(expr->suspend_id()));
// Upon resume, we continue here.
// Update state to indicate that we have finished resuming. Loop headers
// rely on this.
builder()
->LoadLiteral(Smi::FromInt(JSGeneratorObject::kGeneratorExecuting))
.StoreAccumulatorInRegister(generator_state_);
{
RegisterAllocationScope register_scope(this);
Register input = register_allocator()->NewRegister();
// Update state to indicate that we have finished resuming. Loop headers
// rely on this.
builder()
->LoadLiteral(Smi::FromInt(JSGeneratorObject::kGeneratorExecuting))
.StoreAccumulatorInRegister(generator_state_);
// When resuming an Async Generator from an Await expression, the sent
// value is in the [[await_input_or_debug_pos]] slot. Otherwise, the sent
// value is in the [[input_or_debug_pos]] slot.
Runtime::FunctionId get_generator_input =
expr->is_async_generator() && expr->is_await()
? Runtime::kInlineAsyncGeneratorGetAwaitInputOrDebugPos
: Runtime::kInlineGeneratorGetInputOrDebugPos;
Register input = register_allocator()->NewRegister();
DCHECK(generator.is_valid());
builder()
->CallRuntime(get_generator_input, generator)
.StoreAccumulatorInRegister(input);
// When resuming an Async Generator from an Await expression, the sent
// value is in the [[await_input_or_debug_pos]] slot. Otherwise, the sent
// value is in the [[input_or_debug_pos]] slot.
Runtime::FunctionId get_generator_input =
expr->is_async_generator() && expr->is_await()
? Runtime::kInlineAsyncGeneratorGetAwaitInputOrDebugPos
: Runtime::kInlineGeneratorGetInputOrDebugPos;
Register resume_mode = register_allocator()->NewRegister();
builder()
->CallRuntime(Runtime::kInlineGeneratorGetResumeMode, generator)
.StoreAccumulatorInRegister(resume_mode);
DCHECK(generator.is_valid());
builder()
->CallRuntime(get_generator_input, generator)
.StoreAccumulatorInRegister(input);
// Now dispatch on resume mode.
Register resume_mode = register_allocator()->NewRegister();
builder()
->CallRuntime(Runtime::kInlineGeneratorGetResumeMode, generator)
.StoreAccumulatorInRegister(resume_mode);
BytecodeLabel resume_with_next;
BytecodeLabel resume_with_throw;
// Now dispatch on resume mode.
builder()
->LoadLiteral(Smi::FromInt(JSGeneratorObject::kNext))
.CompareOperation(Token::EQ_STRICT, resume_mode)
.JumpIfTrue(ToBooleanMode::kAlreadyBoolean, &resume_with_next)
.LoadLiteral(Smi::FromInt(JSGeneratorObject::kThrow))
.CompareOperation(Token::EQ_STRICT, resume_mode)
.JumpIfTrue(ToBooleanMode::kAlreadyBoolean, &resume_with_throw);
// Fall through for resuming with return.
if (expr->is_async_generator()) {
// Async generator methods will produce the iter result object.
builder()->LoadAccumulatorWithRegister(input);
execution_control()->AsyncReturnAccumulator();
} else {
RegisterList args = register_allocator()->NewRegisterList(2);
builder()
->MoveRegister(input, args[0])
.LoadTrue()
.StoreAccumulatorInRegister(args[1])
.CallRuntime(Runtime::kInlineCreateIterResultObject, args);
execution_control()->ReturnAccumulator();
}
BytecodeLabel resume_with_next;
BytecodeLabel resume_with_throw;
builder()->Bind(&resume_with_throw);
builder()->SetExpressionPosition(expr);
builder()->LoadAccumulatorWithRegister(input);
if (expr->rethrow_on_exception()) {
builder()->ReThrow();
} else {
builder()->Throw();
}
builder()
->LoadLiteral(Smi::FromInt(JSGeneratorObject::kNext))
.CompareOperation(Token::EQ_STRICT, resume_mode)
.JumpIfTrue(ToBooleanMode::kAlreadyBoolean, &resume_with_next)
.LoadLiteral(Smi::FromInt(JSGeneratorObject::kThrow))
.CompareOperation(Token::EQ_STRICT, resume_mode)
.JumpIfTrue(ToBooleanMode::kAlreadyBoolean, &resume_with_throw);
// Fall through for resuming with return.
if (expr->is_async_generator()) {
// Async generator methods will produce the iter result object.
builder()->LoadAccumulatorWithRegister(input);
execution_control()->AsyncReturnAccumulator();
} else {
RegisterList args = register_allocator()->NewRegisterList(2);
builder()
->MoveRegister(input, args[0])
.LoadTrue()
.StoreAccumulatorInRegister(args[1])
.CallRuntime(Runtime::kInlineCreateIterResultObject, args);
execution_control()->ReturnAccumulator();
}
builder()->Bind(&resume_with_next);
builder()->LoadAccumulatorWithRegister(input);
}
builder()->Bind(&resume_with_throw);
builder()->SetExpressionPosition(expr);
builder()->LoadAccumulatorWithRegister(input);
if (expr->rethrow_on_exception()) {
builder()->ReThrow();
} else {
builder()->Throw();
}
void BytecodeGenerator::VisitSuspend(Suspend* expr) {
Register generator = VisitForRegisterValue(expr->generator_object());
BuildGeneratorSuspend(expr, generator);
builder()->Bind(generator_jump_table_, static_cast<int>(expr->suspend_id()));
// Upon resume, we continue here.
BuildGeneratorResume(expr, generator);
builder()->Bind(&resume_with_next);
builder()->LoadAccumulatorWithRegister(input);
}
}
void BytecodeGenerator::VisitThrow(Throw* expr) {
......
......@@ -135,8 +135,6 @@ class BytecodeGenerator final : public AstVisitor<BytecodeGenerator> {
void BuildNewLocalWithContext(Scope* scope);
void BuildGeneratorPrologue();
void BuildGeneratorSuspend(Suspend* expr, Register generator);
void BuildGeneratorResume(Suspend* expr, Register generator);
void VisitArgumentsObject(Variable* variable);
void VisitRestArgumentsArray(Variable* rest);
......
......@@ -677,30 +677,30 @@ bytecodes: [
B(LdaImmutableCurrentContextSlot), U8(5),
B(Star), R(10),
B(LdaZero),
/* 11 E> */ B(SuspendGenerator), R(9), U8(0),
B(Ldar), R(10),
/* 11 E> */ B(SuspendGenerator), R(10), U8(0),
B(Ldar), R(9),
/* 55 S> */ B(Return),
B(LdaSmi), I8(-2),
B(Star), R(4),
B(CallRuntime), U16(Runtime::k_GeneratorGetInputOrDebugPos), R(9), U8(1),
B(Star), R(10),
B(CallRuntime), U16(Runtime::k_GeneratorGetResumeMode), R(9), U8(1),
B(CallRuntime), U16(Runtime::k_GeneratorGetInputOrDebugPos), R(10), U8(1),
B(Star), R(11),
B(CallRuntime), U16(Runtime::k_GeneratorGetResumeMode), R(10), U8(1),
B(Star), R(12),
B(LdaZero),
B(TestEqualStrictNoFeedback), R(11),
B(TestEqualStrictNoFeedback), R(12),
B(JumpIfTrue), U8(28),
B(LdaSmi), I8(2),
B(TestEqualStrictNoFeedback), R(11),
B(TestEqualStrictNoFeedback), R(12),
B(JumpIfTrue), U8(19),
B(LdaTrue),
B(Star), R(13),
B(Mov), R(10), R(12),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(12), U8(2),
B(Star), R(14),
B(Mov), R(11), R(13),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(13), U8(2),
B(Star), R(7),
B(LdaZero),
B(Star), R(6),
B(JumpConstant), U8(13),
B(Ldar), R(10),
B(Ldar), R(11),
/* 11 E> */ B(Throw),
B(Ldar), R(closure),
B(CreateBlockContext), U8(1),
......@@ -939,7 +939,7 @@ snippet: "
}
f([1, 2, 3]);
"
frame size: 17
frame size: 18
parameter count: 2
bytecode array length: 740
bytecodes: [
......@@ -970,30 +970,30 @@ bytecodes: [
B(LdaImmutableCurrentContextSlot), U8(5),
B(Star), R(9),
B(LdaZero),
/* 11 E> */ B(SuspendGenerator), R(8), U8(0),
B(Ldar), R(9),
/* 11 E> */ B(SuspendGenerator), R(9), U8(0),
B(Ldar), R(8),
/* 49 S> */ B(Return),
B(LdaSmi), I8(-2),
B(Star), R(3),
B(CallRuntime), U16(Runtime::k_GeneratorGetInputOrDebugPos), R(8), U8(1),
B(Star), R(9),
B(CallRuntime), U16(Runtime::k_GeneratorGetResumeMode), R(8), U8(1),
B(CallRuntime), U16(Runtime::k_GeneratorGetInputOrDebugPos), R(9), U8(1),
B(Star), R(10),
B(CallRuntime), U16(Runtime::k_GeneratorGetResumeMode), R(9), U8(1),
B(Star), R(11),
B(LdaZero),
B(TestEqualStrictNoFeedback), R(10),
B(TestEqualStrictNoFeedback), R(11),
B(JumpIfTrue), U8(28),
B(LdaSmi), I8(2),
B(TestEqualStrictNoFeedback), R(10),
B(TestEqualStrictNoFeedback), R(11),
B(JumpIfTrue), U8(19),
B(LdaTrue),
B(Star), R(12),
B(Mov), R(9), R(11),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(11), U8(2),
B(Star), R(13),
B(Mov), R(10), R(12),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(12), U8(2),
B(Star), R(6),
B(LdaZero),
B(Star), R(5),
B(JumpConstant), U8(14),
B(Ldar), R(9),
B(Ldar), R(10),
/* 11 E> */ B(Throw),
B(Ldar), R(closure),
B(CreateBlockContext), U8(2),
......@@ -1053,34 +1053,34 @@ bytecodes: [
B(StaCurrentContextSlot), U8(4),
B(LdaContextSlot), R(1), U8(6), U8(0),
B(StaCurrentContextSlot), U8(4),
/* 40 S> */ B(LdaImmutableContextSlot), R(1), U8(5), U8(0),
/* 40 S> */ B(LdaImmutableCurrentContextSlot), U8(4),
B(Star), R(12),
B(LdaImmutableCurrentContextSlot), U8(4),
B(Star), R(13),
B(LdaFalse),
B(Star), R(14),
/* 46 E> */ B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(13), U8(2),
B(Star), R(13),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(12), U8(2),
B(Star), R(12),
B(LdaImmutableContextSlot), R(1), U8(5), U8(0),
B(Star), R(13),
B(LdaSmi), I8(1),
B(SuspendGenerator), R(12), U8(0),
B(Ldar), R(13),
B(SuspendGenerator), R(13), U8(0),
B(Ldar), R(12),
/* 49 S> */ B(Return),
B(LdaSmi), I8(-2),
B(Star), R(3),
B(CallRuntime), U16(Runtime::k_GeneratorGetInputOrDebugPos), R(12), U8(1),
B(Star), R(13),
B(CallRuntime), U16(Runtime::k_GeneratorGetResumeMode), R(12), U8(1),
B(CallRuntime), U16(Runtime::k_GeneratorGetInputOrDebugPos), R(13), U8(1),
B(Star), R(14),
B(CallRuntime), U16(Runtime::k_GeneratorGetResumeMode), R(13), U8(1),
B(Star), R(15),
B(LdaZero),
B(TestEqualStrictNoFeedback), R(14),
B(TestEqualStrictNoFeedback), R(15),
B(JumpIfTrue), U8(40),
B(LdaSmi), I8(2),
B(TestEqualStrictNoFeedback), R(14),
B(TestEqualStrictNoFeedback), R(15),
B(JumpIfTrue), U8(31),
B(LdaTrue),
B(Star), R(16),
B(Mov), R(13), R(15),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(15), U8(2),
B(Star), R(17),
B(Mov), R(14), R(16),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(16), U8(2),
B(PopContext), R(2),
B(PopContext), R(2),
B(PopContext), R(2),
......@@ -1091,7 +1091,7 @@ bytecodes: [
B(LdaZero),
B(Star), R(8),
B(Jump), U8(71),
B(Ldar), R(13),
B(Ldar), R(14),
/* 40 E> */ B(Throw),
B(PopContext), R(2),
B(LdaZero),
......@@ -1565,7 +1565,7 @@ snippet: "
}
f([1, 2, 3]);
"
frame size: 18
frame size: 19
parameter count: 2
bytecode array length: 765
bytecodes: [
......@@ -1654,41 +1654,41 @@ bytecodes: [
B(StaCurrentContextSlot), U8(4),
B(LdaContextSlot), R(1), U8(8), U8(0),
B(StaCurrentContextSlot), U8(4),
/* 45 S> */ B(LdaImmutableContextSlot), R(1), U8(5), U8(0),
B(Star), R(13),
/* 51 S> */ B(LdaImmutableCurrentContextSlot), U8(4),
B(StaContextSlot), R(1), U8(6), U8(0),
/* 45 S> */ B(LdaUndefined),
B(Star), R(14),
B(Star), R(13),
B(LdaImmutableContextSlot), R(1), U8(5), U8(0),
B(Star), R(15),
B(Star), R(14),
B(LdaContextSlot), R(1), U8(6), U8(0),
B(Star), R(16),
B(Star), R(15),
B(LdaContextSlot), R(1), U8(7), U8(0),
B(Star), R(17),
B(CallJSRuntime), U8(%async_function_await_uncaught), R(14), U8(4),
B(Star), R(16),
B(CallJSRuntime), U8(%async_function_await_uncaught), R(13), U8(4),
B(LdaContextSlot), R(1), U8(7), U8(0),
B(Star), R(13),
B(LdaImmutableContextSlot), R(1), U8(5), U8(0),
B(Star), R(14),
B(LdaZero),
B(SuspendGenerator), R(13), U8(2),
B(Ldar), R(14),
B(SuspendGenerator), R(14), U8(2),
B(Ldar), R(13),
/* 54 S> */ B(Return),
B(LdaSmi), I8(-2),
B(Star), R(3),
B(CallRuntime), U16(Runtime::k_GeneratorGetInputOrDebugPos), R(13), U8(1),
B(Star), R(14),
B(CallRuntime), U16(Runtime::k_GeneratorGetResumeMode), R(13), U8(1),
B(CallRuntime), U16(Runtime::k_GeneratorGetInputOrDebugPos), R(14), U8(1),
B(Star), R(15),
B(CallRuntime), U16(Runtime::k_GeneratorGetResumeMode), R(14), U8(1),
B(Star), R(16),
B(LdaZero),
B(TestEqualStrictNoFeedback), R(15),
B(TestEqualStrictNoFeedback), R(16),
B(JumpIfTrue), U8(40),
B(LdaSmi), I8(2),
B(TestEqualStrictNoFeedback), R(15),
B(TestEqualStrictNoFeedback), R(16),
B(JumpIfTrue), U8(31),
B(LdaTrue),
B(Star), R(17),
B(Mov), R(14), R(16),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(16), U8(2),
B(Star), R(18),
B(Mov), R(15), R(17),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(17), U8(2),
B(PopContext), R(2),
B(PopContext), R(2),
B(PopContext), R(2),
......@@ -1699,7 +1699,7 @@ bytecodes: [
B(LdaZero),
B(Star), R(9),
B(Jump), U8(75),
B(Ldar), R(14),
B(Ldar), R(15),
B(ReThrow),
B(PopContext), R(2),
B(LdaZero),
......
......@@ -271,7 +271,7 @@ snippet: "
}
f();
"
frame size: 14
frame size: 15
parameter count: 1
bytecode array length: 350
bytecodes: [
......@@ -300,30 +300,30 @@ bytecodes: [
B(LdaImmutableCurrentContextSlot), U8(4),
B(Star), R(10),
B(LdaZero),
/* 11 E> */ B(SuspendGenerator), R(9), U8(0),
B(Ldar), R(10),
/* 11 E> */ B(SuspendGenerator), R(10), U8(0),
B(Ldar), R(9),
/* 62 S> */ B(Return),
B(LdaSmi), I8(-2),
B(Star), R(4),
B(CallRuntime), U16(Runtime::k_GeneratorGetInputOrDebugPos), R(9), U8(1),
B(Star), R(10),
B(CallRuntime), U16(Runtime::k_GeneratorGetResumeMode), R(9), U8(1),
B(CallRuntime), U16(Runtime::k_GeneratorGetInputOrDebugPos), R(10), U8(1),
B(Star), R(11),
B(CallRuntime), U16(Runtime::k_GeneratorGetResumeMode), R(10), U8(1),
B(Star), R(12),
B(LdaZero),
B(TestEqualStrictNoFeedback), R(11),
B(TestEqualStrictNoFeedback), R(12),
B(JumpIfTrue), U8(28),
B(LdaSmi), I8(2),
B(TestEqualStrictNoFeedback), R(11),
B(TestEqualStrictNoFeedback), R(12),
B(JumpIfTrue), U8(19),
B(LdaTrue),
B(Star), R(13),
B(Mov), R(10), R(12),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(12), U8(2),
B(Star), R(14),
B(Mov), R(11), R(13),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(13), U8(2),
B(Star), R(7),
B(LdaZero),
B(Star), R(6),
B(Jump), U8(193),
B(Ldar), R(10),
B(Ldar), R(11),
/* 11 E> */ B(Throw),
B(Ldar), R(closure),
B(CreateBlockContext), U8(1),
......@@ -453,7 +453,7 @@ snippet: "
}
f();
"
frame size: 13
frame size: 14
parameter count: 1
bytecode array length: 469
bytecodes: [
......@@ -482,30 +482,30 @@ bytecodes: [
B(LdaImmutableCurrentContextSlot), U8(4),
B(Star), R(9),
B(LdaZero),
/* 11 E> */ B(SuspendGenerator), R(8), U8(0),
B(Ldar), R(9),
/* 11 E> */ B(SuspendGenerator), R(9), U8(0),
B(Ldar), R(8),
/* 56 S> */ B(Return),
B(LdaSmi), I8(-2),
B(Star), R(3),
B(CallRuntime), U16(Runtime::k_GeneratorGetInputOrDebugPos), R(8), U8(1),
B(Star), R(9),
B(CallRuntime), U16(Runtime::k_GeneratorGetResumeMode), R(8), U8(1),
B(CallRuntime), U16(Runtime::k_GeneratorGetInputOrDebugPos), R(9), U8(1),
B(Star), R(10),
B(CallRuntime), U16(Runtime::k_GeneratorGetResumeMode), R(9), U8(1),
B(Star), R(11),
B(LdaZero),
B(TestEqualStrictNoFeedback), R(10),
B(TestEqualStrictNoFeedback), R(11),
B(JumpIfTrue), U8(28),
B(LdaSmi), I8(2),
B(TestEqualStrictNoFeedback), R(10),
B(TestEqualStrictNoFeedback), R(11),
B(JumpIfTrue), U8(19),
B(LdaTrue),
B(Star), R(12),
B(Mov), R(9), R(11),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(11), U8(2),
B(Star), R(13),
B(Mov), R(10), R(12),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(12), U8(2),
B(Star), R(6),
B(LdaZero),
B(Star), R(5),
B(JumpConstant), U8(6),
B(Ldar), R(9),
B(Ldar), R(10),
/* 11 E> */ B(Throw),
B(Ldar), R(closure),
B(CreateBlockContext), U8(2),
......@@ -569,34 +569,34 @@ bytecodes: [
B(TestEqual), R(8), U8(6),
B(JumpIfFalse), U8(102),
/* 18 E> */ B(StackCheck),
/* 47 S> */ B(LdaImmutableContextSlot), R(1), U8(4), U8(0),
/* 47 S> */ B(LdaCurrentContextSlot), U8(4),
B(Star), R(8),
B(LdaCurrentContextSlot), U8(4),
B(Star), R(9),
B(LdaFalse),
B(Star), R(10),
/* 53 E> */ B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(9), U8(2),
B(Star), R(9),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(8), U8(2),
B(Star), R(8),
B(LdaImmutableContextSlot), R(1), U8(4), U8(0),
B(Star), R(9),
B(LdaSmi), I8(1),
B(SuspendGenerator), R(8), U8(0),
B(Ldar), R(9),
B(SuspendGenerator), R(9), U8(0),
B(Ldar), R(8),
/* 56 S> */ B(Return),
B(LdaSmi), I8(-2),
B(Star), R(3),
B(CallRuntime), U16(Runtime::k_GeneratorGetInputOrDebugPos), R(8), U8(1),
B(Star), R(9),
B(CallRuntime), U16(Runtime::k_GeneratorGetResumeMode), R(8), U8(1),
B(CallRuntime), U16(Runtime::k_GeneratorGetInputOrDebugPos), R(9), U8(1),
B(Star), R(10),
B(CallRuntime), U16(Runtime::k_GeneratorGetResumeMode), R(9), U8(1),
B(Star), R(11),
B(LdaZero),
B(TestEqualStrictNoFeedback), R(10),
B(TestEqualStrictNoFeedback), R(11),
B(JumpIfTrue), U8(37),
B(LdaSmi), I8(2),
B(TestEqualStrictNoFeedback), R(10),
B(TestEqualStrictNoFeedback), R(11),
B(JumpIfTrue), U8(28),
B(LdaTrue),
B(Star), R(12),
B(Mov), R(9), R(11),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(11), U8(2),
B(Star), R(13),
B(Mov), R(10), R(12),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(12), U8(2),
B(PopContext), R(2),
B(PopContext), R(2),
B(PopContext), R(1),
......@@ -605,7 +605,7 @@ bytecodes: [
B(LdaSmi), I8(1),
B(Star), R(5),
B(Jump), U8(73),
B(Ldar), R(9),
B(Ldar), R(10),
/* 47 E> */ B(Throw),
B(LdaZero),
B(StaContextSlot), R(1), U8(7), U8(0),
......@@ -862,7 +862,7 @@ snippet: "
}
f();
"
frame size: 14
frame size: 15
parameter count: 1
bytecode array length: 508
bytecodes: [
......@@ -953,41 +953,41 @@ bytecodes: [
B(TestEqual), R(9), U8(6),
B(JumpIfFalse), U8(128),
/* 23 E> */ B(StackCheck),
/* 52 S> */ B(LdaImmutableContextSlot), R(1), U8(4), U8(0),
B(Star), R(9),
/* 58 S> */ B(LdaCurrentContextSlot), U8(4),
B(StaContextSlot), R(1), U8(5), U8(0),
/* 52 S> */ B(LdaUndefined),
B(Star), R(10),
B(Star), R(9),
B(LdaImmutableContextSlot), R(1), U8(4), U8(0),
B(Star), R(11),
B(Star), R(10),
B(LdaContextSlot), R(1), U8(5), U8(0),
B(Star), R(12),
B(Star), R(11),
B(LdaContextSlot), R(1), U8(6), U8(0),
B(Star), R(13),
B(CallJSRuntime), U8(%async_function_await_uncaught), R(10), U8(4),
B(Star), R(12),
B(CallJSRuntime), U8(%async_function_await_uncaught), R(9), U8(4),
B(LdaContextSlot), R(1), U8(6), U8(0),
B(Star), R(9),
B(LdaImmutableContextSlot), R(1), U8(4), U8(0),
B(Star), R(10),
B(LdaZero),
B(SuspendGenerator), R(9), U8(2),
B(Ldar), R(10),
B(SuspendGenerator), R(10), U8(2),
B(Ldar), R(9),
/* 61 S> */ B(Return),
B(LdaSmi), I8(-2),
B(Star), R(3),
B(CallRuntime), U16(Runtime::k_GeneratorGetInputOrDebugPos), R(9), U8(1),
B(Star), R(10),
B(CallRuntime), U16(Runtime::k_GeneratorGetResumeMode), R(9), U8(1),
B(CallRuntime), U16(Runtime::k_GeneratorGetInputOrDebugPos), R(10), U8(1),
B(Star), R(11),
B(CallRuntime), U16(Runtime::k_GeneratorGetResumeMode), R(10), U8(1),
B(Star), R(12),
B(LdaZero),
B(TestEqualStrictNoFeedback), R(11),
B(TestEqualStrictNoFeedback), R(12),
B(JumpIfTrue), U8(40),
B(LdaSmi), I8(2),
B(TestEqualStrictNoFeedback), R(11),
B(TestEqualStrictNoFeedback), R(12),
B(JumpIfTrue), U8(31),
B(LdaTrue),
B(Star), R(13),
B(Mov), R(10), R(12),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(12), U8(2),
B(Star), R(14),
B(Mov), R(11), R(13),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(13), U8(2),
B(PopContext), R(2),
B(PopContext), R(2),
B(PopContext), R(1),
......@@ -998,7 +998,7 @@ bytecodes: [
B(LdaZero),
B(Star), R(5),
B(Jump), U8(136),
B(Ldar), R(10),
B(Ldar), R(11),
B(ReThrow),
B(LdaZero),
B(StaContextSlot), R(1), U8(9), U8(0),
......
......@@ -204,17 +204,17 @@ function testClasses() {
|R|}
async function asyncFoo() {
|_|await Promise.|C|resolve().|C|then(v => v |_|* 2|R|);
|_|await Promise.resolve().then(v => v |_|* 2|R|);
|C|return42();
|_|await |C|asyncBoo();
|R|}
async function asyncBoo() {
|_|await Promise.|C|resolve();
|_|await Promise.resolve();
|R|}
async function testAsyncAwait() {
|_|await |C|asyncFoo();
|_|await asyncFoo();
|_|await |C|awaitBoo();
|R|}
......@@ -247,7 +247,7 @@ async function testPromiseComplex() {
var testPromise = |C|new Promise(resolve => nextTest |_|= resolve|R|);
async function main() {
async function foo() {
|_|await Promise.|C|resolve();
|_|await Promise.resolve();
|_|return 42;
|R|}
var x = |_|1;
......
......@@ -798,21 +798,11 @@ break at:
Running test: testAsyncAwait
break at:
async function testAsyncAwait() {
#await asyncFoo();
await awaitBoo();
break at:
async function testAsyncAwait() {
await #asyncFoo();
await awaitBoo();
break at:
async function asyncFoo() {
#await Promise.resolve().then(v => v * 2);
return42();
break at:
async function asyncFoo() {
await Promise.resolve().#then(v => v * 2);
......@@ -843,11 +833,6 @@ break at:
#}
break at:
async function asyncBoo() {
#await Promise.resolve();
}
break at:
async function asyncBoo() {
await Promise.#resolve();
......@@ -885,11 +870,6 @@ break at:
#setTimeout(returnCall, 0);
await foo();
break at:
setTimeout(returnCall, 0);
#await foo();
await foo();
break at:
setTimeout(returnCall, 0);
await #foo();
......@@ -915,11 +895,6 @@ break at:
#setTimeout(resolveNested, 0);
await p;
break at:
setTimeout(resolveNested, 0);
#await p;
}
break at:
setTimeout(resolveNested, 0);
await #p;
......@@ -950,11 +925,6 @@ break at:
#setTimeout(resolveNested, 0);
await p;
break at:
setTimeout(resolveNested, 0);
#await p;
}
break at:
setTimeout(resolveNested, 0);
await #p;
......@@ -1082,11 +1052,6 @@ break at:
returnFunction(emptyFunction(), x++, --y, x => 2 * x, returnCall())().a = await #foo((a => 2 *a)(5));
nextTest();
break at:
async function foo() {
#await Promise.resolve();
return 42;
break at:
async function foo() {
await Promise.#resolve();
......
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