[ignition] Make SuspendGenerator return

Instead of requiring the pattern that a SuspendGenerator must be
followed by a Return, make SuspendGenerator return directly. This can,
in the future, simplify some of the reasoning around generator suspends.

Change-Id: I94c0156a89dc0e1c0bc306bc57acf766f3b4deb5
Reviewed-on: https://chromium-review.googlesource.com/857463
Reviewed-by: Georg Neis <neis@chromium.org>
Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50748}
This commit is contained in:
Leszek Swirski 2018-01-16 10:25:57 +00:00 committed by Commit Bot
parent 9d7c40ea76
commit 5cef3ddd5f
28 changed files with 366 additions and 344 deletions

View File

@ -1025,12 +1025,15 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
MemOperand(fp, InterpreterFrameConstants::kBytecodeOffsetFromFp));
__ SmiUntag(kInterpreterBytecodeOffsetRegister);
// Check if we should return.
// Check if we should return by testing for one of the returning bytecodes.
Label do_return;
__ ldrb(r1, MemOperand(kInterpreterBytecodeArrayRegister,
kInterpreterBytecodeOffsetRegister));
__ cmp(r1, Operand(static_cast<int>(interpreter::Bytecode::kReturn)));
#define JUMP_IF_EQUAL(NAME) \
__ cmp(r1, Operand(static_cast<int>(interpreter::Bytecode::k##NAME))); \
__ b(&do_return, eq);
RETURN_BYTECODE_LIST(JUMP_IF_EQUAL)
#undef JUMP_IF_EQUAL
// Advance to the next bytecode and dispatch.
AdvanceBytecodeOffset(masm, kInterpreterBytecodeArrayRegister,

View File

@ -1118,12 +1118,15 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
MemOperand(fp, InterpreterFrameConstants::kBytecodeOffsetFromFp));
__ SmiUntag(kInterpreterBytecodeOffsetRegister);
// Check if we should return.
// Check if we should return by testing for one of the returning bytecodes.
Label do_return;
__ Ldrb(x1, MemOperand(kInterpreterBytecodeArrayRegister,
kInterpreterBytecodeOffsetRegister));
__ Cmp(x1, Operand(static_cast<int>(interpreter::Bytecode::kReturn)));
#define JUMP_IF_EQUAL(NAME) \
__ Cmp(x1, Operand(static_cast<int>(interpreter::Bytecode::k##NAME))); \
__ B(&do_return, eq);
RETURN_BYTECODE_LIST(JUMP_IF_EQUAL)
#undef JUMP_IF_EQUAL
// Advance to the next bytecode and dispatch.
AdvanceBytecodeOffset(masm, kInterpreterBytecodeArrayRegister,

View File

@ -946,12 +946,15 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
Operand(ebp, InterpreterFrameConstants::kBytecodeOffsetFromFp));
__ SmiUntag(kInterpreterBytecodeOffsetRegister);
// Check if we should return.
// Check if we should return by testing for one of the returning bytecodes.
Label do_return;
__ movzx_b(ebx, Operand(kInterpreterBytecodeArrayRegister,
kInterpreterBytecodeOffsetRegister, times_1, 0));
__ cmpb(ebx, Immediate(static_cast<int>(interpreter::Bytecode::kReturn)));
#define JUMP_IF_EQUAL(NAME) \
__ cmpb(ebx, Immediate(static_cast<int>(interpreter::Bytecode::k##NAME))); \
__ j(equal, &do_return, Label::kNear);
RETURN_BYTECODE_LIST(JUMP_IF_EQUAL)
#undef JUMP_IF_EQUAL
// Advance to the next bytecode and dispatch.
AdvanceBytecodeOffset(masm, kInterpreterBytecodeArrayRegister,

View File

@ -1008,13 +1008,16 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
MemOperand(fp, InterpreterFrameConstants::kBytecodeOffsetFromFp));
__ SmiUntag(kInterpreterBytecodeOffsetRegister);
// Check if we should return.
// Check if we should return by testing for one of the returning bytecodes.
Label do_return;
__ Addu(a1, kInterpreterBytecodeArrayRegister,
kInterpreterBytecodeOffsetRegister);
__ lbu(a1, MemOperand(a1));
__ Branch(&do_return, eq, a1,
Operand(static_cast<int>(interpreter::Bytecode::kReturn)));
#define JUMP_IF_EQUAL(NAME) \
__ Branch(&do_return, eq, a1, \
Operand(static_cast<int>(interpreter::Bytecode::k##NAME)));
RETURN_BYTECODE_LIST(JUMP_IF_EQUAL)
#undef JUMP_IF_EQUAL
// Advance to the next bytecode and dispatch.
AdvanceBytecodeOffset(masm, kInterpreterBytecodeArrayRegister,

View File

@ -1008,13 +1008,16 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
MemOperand(fp, InterpreterFrameConstants::kBytecodeOffsetFromFp));
__ SmiUntag(kInterpreterBytecodeOffsetRegister);
// Check if we should return.
// Check if we should return by testing for one of the returning bytecodes.
Label do_return;
__ Daddu(a1, kInterpreterBytecodeArrayRegister,
kInterpreterBytecodeOffsetRegister);
__ Lbu(a1, MemOperand(a1));
__ Branch(&do_return, eq, a1,
Operand(static_cast<int>(interpreter::Bytecode::kReturn)));
#define JUMP_IF_EQUAL(NAME) \
__ Branch(&do_return, eq, a1, \
Operand(static_cast<int>(interpreter::Bytecode::k##NAME)));
RETURN_BYTECODE_LIST(JUMP_IF_EQUAL)
#undef JUMP_IF_EQUAL
// Advance to the next bytecode and dispatch.
AdvanceBytecodeOffset(masm, kInterpreterBytecodeArrayRegister,

View File

@ -1018,12 +1018,15 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
__ SmiToInteger32(kInterpreterBytecodeOffsetRegister,
kInterpreterBytecodeOffsetRegister);
// Check if we should return.
// Check if we should return by testing for one of the returning bytecodes.
Label do_return;
__ movzxbp(rbx, Operand(kInterpreterBytecodeArrayRegister,
kInterpreterBytecodeOffsetRegister, times_1, 0));
__ cmpb(rbx, Immediate(static_cast<int>(interpreter::Bytecode::kReturn)));
#define JUMP_IF_EQUAL(NAME) \
__ cmpb(rbx, Immediate(static_cast<int>(interpreter::Bytecode::k##NAME))); \
__ j(equal, &do_return, Label::kNear);
RETURN_BYTECODE_LIST(JUMP_IF_EQUAL)
#undef JUMP_IF_EQUAL
// Advance to the next bytecode and dispatch.
AdvanceBytecodeOffset(masm, kInterpreterBytecodeArrayRegister,

View File

@ -2591,15 +2591,19 @@ void BytecodeGraphBuilder::VisitSetPendingMessage() {
environment()->BindAccumulator(previous_message);
}
void BytecodeGraphBuilder::VisitReturn() {
BuildLoopExitsForFunctionExit(bytecode_analysis()->GetInLivenessFor(
bytecode_iterator().current_offset()));
void BytecodeGraphBuilder::BuildReturn(const BytecodeLivenessState* liveness) {
BuildLoopExitsForFunctionExit(liveness);
Node* pop_node = jsgraph()->ZeroConstant();
Node* control =
NewNode(common()->Return(), pop_node, environment()->LookupAccumulator());
MergeControlToLeaveFunction(control);
}
void BytecodeGraphBuilder::VisitReturn() {
BuildReturn(bytecode_analysis()->GetInLivenessFor(
bytecode_iterator().current_offset()));
}
void BytecodeGraphBuilder::VisitDebugger() {
PrepareEagerCheckpoint();
Node* call = NewNode(javascript()->Debugger());
@ -2727,6 +2731,11 @@ void BytecodeGraphBuilder::VisitSuspendGenerator() {
MakeNode(javascript()->GeneratorStore(register_count), value_input_count,
value_inputs, false);
// TODO(leszeks): This over-approximates the liveness at exit, only the
// accumulator should be live by this point.
BuildReturn(bytecode_analysis()->GetInLivenessFor(
bytecode_iterator().current_offset()));
}
void BytecodeGraphBuilder::VisitRestoreGeneratorState() {

View File

@ -268,6 +268,9 @@ class BytecodeGraphBuilder {
void BuildLoopExitsUntilLoop(int loop_offset,
const BytecodeLivenessState* liveness);
// Helper for building a return (from an actual return or a suspend).
void BuildReturn(const BytecodeLivenessState* liveness);
// Simulates entry and exit of exception handlers.
void ExitThenEnterExceptionHandlers(int current_offset);

View File

@ -21,6 +21,7 @@
#include "src/frames-inl.h"
#include "src/global-handles.h"
#include "src/globals.h"
#include "src/interpreter/bytecode-array-accessor.h"
#include "src/interpreter/interpreter.h"
#include "src/isolate-inl.h"
#include "src/log.h"
@ -81,6 +82,18 @@ void BreakLocation::AllAtCurrentStatement(
}
}
JSGeneratorObject* BreakLocation::GetGeneratorObjectForSuspendedFrame(
JavaScriptFrame* frame) const {
DCHECK(IsSuspend());
DCHECK_GE(generator_obj_reg_index_, 0);
Object* generator_obj =
InterpretedFrame::cast(frame)->ReadInterpreterRegister(
generator_obj_reg_index_);
return JSGeneratorObject::cast(generator_obj);
}
int BreakLocation::BreakIndexFromCodeOffset(Handle<DebugInfo> debug_info,
Handle<AbstractCode> abstract_code,
int offset) {
@ -120,10 +133,12 @@ debug::BreakLocationType BreakLocation::type() const {
return debug::kCallBreakLocation;
case DEBUG_BREAK_SLOT_AT_RETURN:
return debug::kReturnBreakLocation;
// Externally, suspend breaks should look like normal breaks.
case DEBUG_BREAK_SLOT_AT_SUSPEND:
default:
return debug::kCommonBreakLocation;
}
return debug::kCommonBreakLocation;
}
BreakIterator::BreakIterator(Handle<DebugInfo> debug_info)
@ -181,10 +196,18 @@ DebugBreakType BreakIterator::GetDebugBreakType() {
interpreter::Bytecode bytecode =
interpreter::Bytecodes::FromByte(bytecode_array->get(code_offset()));
// Make sure we read the actual bytecode, not a prefix scaling bytecode.
if (interpreter::Bytecodes::IsPrefixScalingBytecode(bytecode)) {
bytecode = interpreter::Bytecodes::FromByte(
bytecode_array->get(code_offset() + 1));
}
if (bytecode == interpreter::Bytecode::kDebugger) {
return DEBUGGER_STATEMENT;
} else if (bytecode == interpreter::Bytecode::kReturn) {
return DEBUG_BREAK_SLOT_AT_RETURN;
} else if (bytecode == interpreter::Bytecode::kSuspendGenerator) {
return DEBUG_BREAK_SLOT_AT_SUSPEND;
} else if (interpreter::Bytecodes::IsCallOrConstruct(bytecode)) {
return DEBUG_BREAK_SLOT_AT_CALL;
} else if (source_position_iterator_.is_statement()) {
@ -225,7 +248,25 @@ void BreakIterator::ClearDebugBreak() {
BreakLocation BreakIterator::GetBreakLocation() {
Handle<AbstractCode> code(
AbstractCode::cast(debug_info_->DebugBytecodeArray()));
return BreakLocation(code, GetDebugBreakType(), code_offset(), position_);
DebugBreakType type = GetDebugBreakType();
int generator_object_reg_index = -1;
if (type == DEBUG_BREAK_SLOT_AT_SUSPEND) {
// For suspend break, we'll need the generator object to be able to step
// over the suspend as if it didn't return. We get the interpreter register
// index that holds the generator object by reading it directly off the
// bytecode array, and we'll read the actual generator object off the
// interpreter stack frame in GetGeneratorObjectForSuspendedFrame.
BytecodeArray* bytecode_array = debug_info_->OriginalBytecodeArray();
interpreter::BytecodeArrayAccessor accessor(handle(bytecode_array),
code_offset());
DCHECK_EQ(accessor.current_bytecode(),
interpreter::Bytecode::kSuspendGenerator);
interpreter::Register generator_obj_reg = accessor.GetRegisterOperand(0);
generator_object_reg_index = generator_obj_reg.index();
}
return BreakLocation(code, type, code_offset(), position_,
generator_object_reg_index);
}
@ -390,7 +431,7 @@ void Debug::Break(JavaScriptFrame* frame) {
// StepOut at not return position was requested and return break locations
// were flooded with one shots.
if (thread_local_.fast_forward_to_return_) {
DCHECK(location.IsReturn());
DCHECK(location.IsReturnOrSuspend());
// We have to ignore recursive calls to function.
if (current_frame_count > target_frame_count) return;
ClearStepping();
@ -412,6 +453,15 @@ void Debug::Break(JavaScriptFrame* frame) {
if (current_frame_count > target_frame_count) return;
// Fall through.
case StepIn: {
// Special case "next" and "in" for generators that are about to suspend.
if (location.IsSuspend()) {
DCHECK(!has_suspended_generator());
thread_local_.suspended_generator_ =
location.GetGeneratorObjectForSuspendedFrame(frame);
ClearStepping();
return;
}
FrameSummary summary = FrameSummary::GetTop(frame);
step_break = step_break || location.IsReturn() ||
current_frame_count != last_frame_count ||
@ -707,7 +757,7 @@ void Debug::FloodWithOneShot(Handle<SharedFunctionInfo> shared,
// Flood the function with break points.
DCHECK(debug_info->HasDebugBytecodeArray());
for (BreakIterator it(debug_info); !it.Done(); it.Next()) {
if (returns_only && !it.GetBreakLocation().IsReturn()) continue;
if (returns_only && !it.GetBreakLocation().IsReturnOrSuspend()) continue;
it.SetDebugBreak();
}
}
@ -895,9 +945,9 @@ void Debug::PrepareStep(StepAction step_action) {
BreakLocation location = BreakLocation::FromFrame(debug_info, js_frame);
// Any step at a return is a step-out and we need to schedule DebugOnFunction
// call callback.
if (location.IsReturn()) {
// Any step at a return is a step-out, and a step-out at a suspend behaves
// like a return.
if (location.IsReturn() || (location.IsSuspend() && step_action == StepOut)) {
// On StepOut we'll ignore our further calls to current function in
// PrepareStepIn callback.
if (last_step_action() == StepOut) {
@ -906,6 +956,8 @@ void Debug::PrepareStep(StepAction step_action) {
step_action = StepOut;
thread_local_.last_step_action_ = StepIn;
}
// We need to schedule DebugOnFunction call callback
UpdateHookOnFunctionCall();
// A step-next in blackboxed function is a step-out.
@ -926,7 +978,7 @@ void Debug::PrepareStep(StepAction step_action) {
// Clear last position info. For stepping out it does not matter.
thread_local_.last_statement_position_ = kNoSourcePosition;
thread_local_.last_frame_count_ = -1;
if (!location.IsReturn() && !IsBlackboxed(shared)) {
if (!location.IsReturnOrSuspend() && !IsBlackboxed(shared)) {
// At not return position we flood return positions with one shots and
// will repeat StepOut automatically at next break.
thread_local_.target_frame_count_ = current_frame_count;
@ -1184,19 +1236,6 @@ bool Debug::GetPossibleBreakpoints(Handle<Script> script, int start_position,
UNREACHABLE();
}
void Debug::RecordGenerator(Handle<JSGeneratorObject> generator_object) {
if (last_step_action() <= StepOut) return;
if (last_step_action() == StepNext) {
// Only consider this generator a step-next target if not stepping in.
if (thread_local_.target_frame_count_ < CurrentFrameCount()) return;
}
DCHECK(!has_suspended_generator());
thread_local_.suspended_generator_ = *generator_object;
ClearStepping();
}
class SharedFunctionInfoFinder {
public:
explicit SharedFunctionInfoFinder(int target_position)

View File

@ -51,13 +51,13 @@ enum ExceptionBreakType {
BreakUncaughtException = 1
};
enum DebugBreakType {
NOT_DEBUG_BREAK,
DEBUGGER_STATEMENT,
DEBUG_BREAK_SLOT,
DEBUG_BREAK_SLOT_AT_CALL,
DEBUG_BREAK_SLOT_AT_RETURN,
DEBUG_BREAK_SLOT_AT_SUSPEND,
};
enum IgnoreBreakMode {
@ -74,7 +74,11 @@ class BreakLocation {
JavaScriptFrame* frame,
std::vector<BreakLocation>* result_out);
inline bool IsSuspend() const { return type_ == DEBUG_BREAK_SLOT_AT_SUSPEND; }
inline bool IsReturn() const { return type_ == DEBUG_BREAK_SLOT_AT_RETURN; }
inline bool IsReturnOrSuspend() const {
return type_ >= DEBUG_BREAK_SLOT_AT_RETURN;
}
inline bool IsCall() const { return type_ == DEBUG_BREAK_SLOT_AT_CALL; }
inline bool IsDebugBreakSlot() const { return type_ >= DEBUG_BREAK_SLOT; }
inline bool IsDebuggerStatement() const {
@ -87,13 +91,17 @@ class BreakLocation {
debug::BreakLocationType type() const;
JSGeneratorObject* GetGeneratorObjectForSuspendedFrame(
JavaScriptFrame* frame) const;
private:
BreakLocation(Handle<AbstractCode> abstract_code, DebugBreakType type,
int code_offset, int position)
int code_offset, int position, int generator_obj_reg_index)
: abstract_code_(abstract_code),
code_offset_(code_offset),
type_(type),
position_(position) {
position_(position),
generator_obj_reg_index_(generator_obj_reg_index) {
DCHECK_NE(NOT_DEBUG_BREAK, type_);
}
@ -108,6 +116,7 @@ class BreakLocation {
int code_offset_;
DebugBreakType type_;
int position_;
int generator_obj_reg_index_;
friend class BreakIterator;
};
@ -256,8 +265,6 @@ class Debug {
int end_position, bool restrict_to_function,
std::vector<BreakLocation>* locations);
void RecordGenerator(Handle<JSGeneratorObject> generator_object);
void RunPromiseHook(PromiseHookType hook_type, Handle<JSPromise> promise,
Handle<Object> parent);

View File

@ -890,6 +890,11 @@ class InterpretedFrame : public JavaScriptFrame {
static int GetBytecodeOffset(Address fp);
static InterpretedFrame* cast(StackFrame* frame) {
DCHECK(frame->is_interpreted());
return static_cast<InterpretedFrame*>(frame);
}
protected:
inline explicit InterpretedFrame(StackFrameIteratorBase* iterator);

View File

@ -158,6 +158,7 @@ void BytecodeArrayWriter::UpdateExitSeenInBlock(Bytecode bytecode) {
case Bytecode::kAbort:
case Bytecode::kJump:
case Bytecode::kJumpConstant:
case Bytecode::kSuspendGenerator:
exit_seen_in_block_ = true;
break;
default:

View File

@ -2866,15 +2866,15 @@ void BytecodeGenerator::VisitCompoundAssignment(CompoundAssignment* expr) {
// Suspends the generator to resume at |suspend_id|, with output stored in the
// accumulator. When the generator is resumed, the sent value is loaded in the
// accumulator.
void BytecodeGenerator::BuildSuspendPoint(int suspend_id) {
void BytecodeGenerator::BuildSuspendPoint(int suspend_id,
Expression* suspend_expr) {
RegisterList registers = register_allocator()->AllLiveRegisters();
// Save context, registers, and state. Then return.
// Save context, registers, and state. This bytecode then returns the value
// in the accumulator.
builder()->SetExpressionPosition(suspend_expr);
builder()->SuspendGenerator(generator_object(), registers, suspend_id);
builder()->SetReturnPosition(kNoSourcePosition, info()->literal());
builder()->Return(); // Hard return (ignore any finally blocks).
// Upon resume, we continue here.
builder()->Bind(generator_jump_table_, suspend_id);
@ -2914,7 +2914,7 @@ void BytecodeGenerator::VisitYield(Yield* expr) {
}
}
BuildSuspendPoint(expr->suspend_id());
BuildSuspendPoint(expr->suspend_id(), expr);
// At this point, the generator has been resumed, with the received value in
// the accumulator.
@ -3110,7 +3110,8 @@ void BytecodeGenerator::VisitYieldStar(YieldStar* expr) {
// If there is no "throw" method, perform IteratorClose, and finally
// throw a TypeError.
no_throw_method.Bind(builder());
BuildIteratorClose(iterator, expr->await_iterator_close_suspend_id());
BuildIteratorClose(iterator, expr->await_iterator_close_suspend_id(),
expr);
builder()->CallRuntime(Runtime::kThrowThrowMethodMissing);
}
@ -3119,7 +3120,7 @@ void BytecodeGenerator::VisitYieldStar(YieldStar* expr) {
if (iterator_type == IteratorType::kAsync) {
// Await the result of the method invocation.
BuildAwait(expr->await_delegated_iterator_output_suspend_id());
BuildAwait(expr->await_delegated_iterator_output_suspend_id(), expr);
}
// Check that output is an object.
@ -3159,7 +3160,7 @@ void BytecodeGenerator::VisitYieldStar(YieldStar* expr) {
.CallRuntime(Runtime::kInlineAsyncGeneratorYield, args);
}
BuildSuspendPoint(expr->suspend_id());
BuildSuspendPoint(expr->suspend_id(), expr);
builder()->StoreAccumulatorInRegister(input);
builder()
->CallRuntime(Runtime::kInlineGeneratorGetResumeMode,
@ -3195,7 +3196,7 @@ void BytecodeGenerator::VisitYieldStar(YieldStar* expr) {
builder()->LoadAccumulatorWithRegister(output_value);
}
void BytecodeGenerator::BuildAwait(int suspend_id) {
void BytecodeGenerator::BuildAwait(int suspend_id, Expression* await_expr) {
// Rather than HandlerTable::UNCAUGHT, async functions use
// HandlerTable::ASYNC_AWAIT to communicate that top-level exceptions are
// transformed into promise rejections. This is necessary to prevent emitting
@ -3239,7 +3240,7 @@ void BytecodeGenerator::BuildAwait(int suspend_id) {
builder()->CallJSRuntime(await_builtin_context_index, args);
}
BuildSuspendPoint(suspend_id);
BuildSuspendPoint(suspend_id, await_expr);
Register input = register_allocator()->NewRegister();
Register resume_mode = register_allocator()->NewRegister();
@ -3267,7 +3268,7 @@ void BytecodeGenerator::BuildAwait(int suspend_id) {
void BytecodeGenerator::VisitAwait(Await* expr) {
builder()->SetExpressionPosition(expr);
VisitForAccumulatorValue(expr->expression());
BuildAwait(expr->suspend_id());
BuildAwait(expr->suspend_id(), expr);
BuildIncrementBlockCoverageCounterIfEnabled(expr,
SourceRangeKind::kContinuation);
}
@ -4154,7 +4155,7 @@ void BytecodeGenerator::BuildCallIteratorMethod(Register iterator,
}
void BytecodeGenerator::BuildIteratorClose(const IteratorRecord& iterator,
int suspend_id) {
int suspend_id, Expression* expr) {
RegisterAllocationScope register_scope(this);
BytecodeLabels done(zone());
BytecodeLabel if_called;
@ -4166,7 +4167,8 @@ void BytecodeGenerator::BuildIteratorClose(const IteratorRecord& iterator,
if (iterator.type() == IteratorType::kAsync) {
DCHECK_GE(suspend_id, 0);
BuildAwait(suspend_id);
DCHECK_NOT_NULL(expr);
BuildAwait(suspend_id, expr);
}
builder()->JumpIfJSReceiver(done.New());

View File

@ -146,9 +146,9 @@ class BytecodeGenerator final : public AstVisitor<BytecodeGenerator> {
void BuildNewLocalWithContext(Scope* scope);
void BuildGeneratorPrologue();
void BuildSuspendPoint(int suspend_id);
void BuildSuspendPoint(int suspend_id, Expression* suspend_expr);
void BuildAwait(int suspend_id);
void BuildAwait(int suspend_id, Expression* await_expr);
void BuildGetIterator(Expression* iterable, IteratorType hint);
@ -164,7 +164,8 @@ class BytecodeGenerator final : public AstVisitor<BytecodeGenerator> {
IteratorRecord BuildGetIteratorRecord(Expression* iterable,
IteratorType hint);
void BuildIteratorNext(const IteratorRecord& iterator, Register next_result);
void BuildIteratorClose(const IteratorRecord& iterator, int suspend_id = -1);
void BuildIteratorClose(const IteratorRecord& iterator, int suspend_id = -1,
Expression* expr = nullptr);
void BuildCallIteratorMethod(Register iterator, const AstRawString* method,
RegisterList receiver_and_args,
BytecodeLabel* if_called,

View File

@ -315,7 +315,7 @@ namespace interpreter {
\
/* Generators */ \
V(RestoreGeneratorState, AccumulatorUse::kWrite, OperandType::kReg) \
V(SuspendGenerator, AccumulatorUse::kNone, OperandType::kReg, \
V(SuspendGenerator, AccumulatorUse::kRead, OperandType::kReg, \
OperandType::kRegList, OperandType::kRegCount, OperandType::kUImm) \
V(ResumeGenerator, AccumulatorUse::kWrite, OperandType::kReg, \
OperandType::kRegOut, OperandType::kRegOutList, OperandType::kRegCount) \
@ -432,6 +432,10 @@ namespace interpreter {
JUMP_FORWARD_BYTECODE_LIST(V) \
V(JumpLoop)
#define RETURN_BYTECODE_LIST(V) \
V(Return) \
V(SuspendGenerator)
// Enumeration of interpreter bytecodes.
enum class Bytecode : uint8_t {
#define DECLARE_BYTECODE(Name, ...) k##Name,
@ -613,11 +617,6 @@ class V8_EXPORT_PRIVATE Bytecodes final : public AllStatic {
bytecode <= Bytecode::kJumpIfJSReceiver;
}
// Returns true if the bytecode is a conditional jump, a jump, or a return.
static constexpr bool IsJumpOrReturn(Bytecode bytecode) {
return bytecode == Bytecode::kReturn || IsJump(bytecode);
}
// Return true if |bytecode| is a jump without effects,
// e.g. any jump excluding those that include type coercion like
// JumpIfTrueToBoolean.
@ -681,9 +680,16 @@ class V8_EXPORT_PRIVATE Bytecodes final : public AllStatic {
return true;
}
// Returns true if the bytecode returns.
static constexpr bool Returns(Bytecode bytecode) {
#define OR_BYTECODE(NAME) || bytecode == Bytecode::k##NAME
return false RETURN_BYTECODE_LIST(OR_BYTECODE);
#undef OR_BYTECODE
}
// Returns the number of values which |bytecode| returns.
static constexpr size_t ReturnCount(Bytecode bytecode) {
return bytecode == Bytecode::kReturn ? 1 : 0;
return Returns(bytecode) ? 1 : 0;
}
// Returns the number of operands expected by |bytecode|.

View File

@ -59,7 +59,7 @@ InterpreterAssembler::InterpreterAssembler(CodeAssemblerState* state,
// Save the bytecode offset immediately if bytecode will make a call along the
// critical path, or it is a return bytecode.
if (Bytecodes::MakesCallAlongCriticalPath(bytecode) ||
bytecode_ == Bytecode::kReturn) {
Bytecodes::Returns(bytecode)) {
SaveBytecodeOffset();
}
}

View File

@ -3078,22 +3078,10 @@ IGNITION_HANDLER(Illegal, InterpreterAssembler) {
//
// Exports the register file and stores it into the generator. Also stores the
// current context, |suspend_id|, and the current bytecode offset (for debugging
// purposes) into the generator.
// purposes) into the generator. Then, returns the value in the accumulator.
IGNITION_HANDLER(SuspendGenerator, InterpreterAssembler) {
Node* generator_reg = BytecodeOperandReg(0);
Node* generator = LoadRegister(generator_reg);
Label if_stepping(this, Label::kDeferred), ok(this);
Node* step_action_address = ExternalConstant(
ExternalReference::debug_last_step_action_address(isolate()));
Node* step_action = Load(MachineType::Int8(), step_action_address);
STATIC_ASSERT(StepIn > StepNext);
STATIC_ASSERT(LastStepAction == StepIn);
Node* step_next = Int32Constant(StepNext);
Branch(Int32LessThanOrEqual(step_next, step_action), &if_stepping, &ok);
BIND(&ok);
Node* array =
LoadObjectField(generator, JSGeneratorObject::kRegisterFileOffset);
Node* context = GetContext();
@ -3115,14 +3103,7 @@ IGNITION_HANDLER(SuspendGenerator, InterpreterAssembler) {
Node* offset = SmiTag(BytecodeOffset());
StoreObjectField(generator, JSGeneratorObject::kInputOrDebugPosOffset,
offset);
Dispatch();
BIND(&if_stepping);
{
Node* context = GetContext();
CallRuntime(Runtime::kDebugRecordGenerator, context, generator);
Goto(&ok);
}
Return(GetAccumulator());
}
// RestoreGeneratorState <generator>

View File

@ -53,10 +53,11 @@ RUNTIME_FUNCTION_RETURN_PAIR(Runtime_DebugBreakOnBytecode) {
BytecodeArray* bytecode_array = shared->bytecode_array();
int bytecode_offset = interpreted_frame->GetBytecodeOffset();
Bytecode bytecode = Bytecodes::FromByte(bytecode_array->get(bytecode_offset));
if (bytecode == Bytecode::kReturn) {
// If we are returning, reset the bytecode array on the interpreted stack
// frame to the non-debug variant so that the interpreter entry trampoline
// sees the return bytecode rather than the DebugBreak.
if (Bytecodes::Returns(bytecode)) {
// If we are returning (or suspending), reset the bytecode array on the
// interpreted stack frame to the non-debug variant so that the interpreter
// entry trampoline sees the return/suspend bytecode rather than the
// DebugBreak.
interpreted_frame->PatchBytecodeArray(bytecode_array);
}
@ -1836,15 +1837,6 @@ RUNTIME_FUNCTION(Runtime_DebugPrepareStepInSuspendedGenerator) {
return isolate->heap()->undefined_value();
}
RUNTIME_FUNCTION(Runtime_DebugRecordGenerator) {
HandleScope scope(isolate);
DCHECK_EQ(1, args.length());
CONVERT_ARG_HANDLE_CHECKED(JSGeneratorObject, generator, 0);
CHECK(isolate->debug()->last_step_action() >= StepNext);
isolate->debug()->RecordGenerator(generator);
return isolate->heap()->undefined_value();
}
RUNTIME_FUNCTION(Runtime_DebugPushPromise) {
DCHECK_EQ(1, args.length());
HandleScope scope(isolate);

View File

@ -186,7 +186,6 @@ namespace internal {
F(ScriptSourceLine, 2, 1) \
F(DebugOnFunctionCall, 1, 1) \
F(DebugPrepareStepInSuspendedGenerator, 0, 1) \
F(DebugRecordGenerator, 1, 1) \
F(DebugPushPromise, 1, 1) \
F(DebugPopPromise, 0, 1) \
F(DebugPromiseReject, 2, 1) \

View File

@ -14,7 +14,7 @@ snippet: "
"
frame size: 9
parameter count: 1
bytecode array length: 216
bytecode array length: 214
bytecodes: [
B(Ldar), R(0),
B(JumpIfUndefined), U8(18),
@ -35,7 +35,6 @@ bytecodes: [
B(Mov), R(context), R(5),
B(Ldar), R(0),
/* 17 E> */ B(SuspendGenerator), R(0), R(0), U8(6), U8(0),
/* 22 S> */ B(Return),
B(ResumeGenerator), R(0), R(1), R(0), U8(6),
B(Star), R(6),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
@ -45,13 +44,12 @@ bytecodes: [
B(LdaZero),
B(Star), R(2),
B(Mov), R(6), R(3),
B(Jump), U8(100),
B(Jump), U8(99),
B(LdaUndefined),
B(Star), R(7),
B(Mov), R(0), R(6),
B(CallJSRuntime), U8(%async_generator_await_uncaught), R(6), U8(2),
B(SuspendGenerator), R(0), R(0), U8(6), U8(1),
/* 22 S> */ B(Return),
B(ResumeGenerator), R(0), R(1), R(0), U8(6),
B(Star), R(6),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
@ -113,8 +111,8 @@ bytecodes: [
/* 22 S> */ B(Return),
]
constant pool: [
Smi [37],
Smi [79],
Smi [36],
Smi [77],
Smi [15],
Smi [7],
ONE_BYTE_INTERNALIZED_STRING_TYPE [".catch"],
@ -124,8 +122,8 @@ constant pool: [
Smi [23],
]
handlers: [
[40, 161, 169],
[43, 122, 124],
[40, 159, 167],
[43, 120, 122],
]
---
@ -135,7 +133,7 @@ snippet: "
"
frame size: 9
parameter count: 1
bytecode array length: 262
bytecode array length: 259
bytecodes: [
B(Ldar), R(0),
B(JumpIfUndefined), U8(18),
@ -156,7 +154,6 @@ bytecodes: [
B(Mov), R(context), R(5),
B(Ldar), R(0),
/* 17 E> */ B(SuspendGenerator), R(0), R(0), U8(6), U8(0),
/* 31 S> */ B(Return),
B(ResumeGenerator), R(0), R(1), R(0), U8(6),
B(Star), R(6),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
@ -166,15 +163,14 @@ bytecodes: [
B(LdaZero),
B(Star), R(2),
B(Mov), R(6), R(3),
B(Jump), U8(146),
B(Jump), U8(144),
/* 22 S> */ B(LdaSmi), I8(42),
B(Star), R(7),
B(LdaFalse),
B(Star), R(8),
B(Mov), R(0), R(6),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorYield), R(6), U8(3),
B(SuspendGenerator), R(0), R(0), U8(6), U8(1),
/* 31 S> */ B(Return),
/* 22 E> */ B(SuspendGenerator), R(0), R(0), U8(6), U8(1),
B(ResumeGenerator), R(0), R(1), R(0), U8(6),
B(Star), R(6),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
@ -184,13 +180,12 @@ bytecodes: [
B(LdaZero),
B(Star), R(2),
B(Mov), R(6), R(3),
B(Jump), U8(100),
B(Jump), U8(99),
B(LdaUndefined),
B(Star), R(7),
B(Mov), R(0), R(6),
B(CallJSRuntime), U8(%async_generator_await_uncaught), R(6), U8(2),
B(SuspendGenerator), R(0), R(0), U8(6), U8(2),
/* 31 S> */ B(Return),
B(ResumeGenerator), R(0), R(1), R(0), U8(6),
B(Star), R(6),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
@ -252,9 +247,9 @@ bytecodes: [
/* 31 S> */ B(Return),
]
constant pool: [
Smi [37],
Smi [83],
Smi [125],
Smi [36],
Smi [81],
Smi [122],
Smi [15],
Smi [7],
Smi [15],
@ -266,8 +261,8 @@ constant pool: [
Smi [23],
]
handlers: [
[40, 207, 215],
[43, 168, 170],
[40, 204, 212],
[43, 165, 167],
]
---
@ -277,7 +272,7 @@ snippet: "
"
frame size: 23
parameter count: 1
bytecode array length: 536
bytecode array length: 533
bytecodes: [
B(Ldar), R(2),
B(JumpIfUndefined), U8(18),
@ -298,7 +293,6 @@ bytecodes: [
B(Mov), R(context), R(15),
B(Ldar), R(2),
/* 17 E> */ B(SuspendGenerator), R(2), R(0), U8(16), U8(0),
/* 50 S> */ B(Return),
B(ResumeGenerator), R(2), R(11), R(0), U8(16),
B(Star), R(16),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
@ -336,7 +330,7 @@ bytecodes: [
B(JumpIfFalse), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(6), U8(1),
B(LdaNamedProperty), R(6), U8(9), U8(9),
B(JumpIfToBooleanTrue), U8(70),
B(JumpIfToBooleanTrue), U8(69),
B(LdaNamedProperty), R(6), U8(10), U8(11),
B(Star), R(8),
B(LdaSmi), I8(2),
@ -349,8 +343,7 @@ bytecodes: [
B(Mov), R(2), R(20),
B(Mov), R(0), R(21),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorYield), R(20), U8(3),
B(SuspendGenerator), R(2), R(0), U8(20), U8(1),
/* 50 S> */ B(Return),
/* 42 E> */ B(SuspendGenerator), R(2), R(0), U8(20), U8(1),
B(ResumeGenerator), R(2), R(11), R(0), U8(20),
B(Star), R(20),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
@ -363,7 +356,7 @@ bytecodes: [
B(Jump), U8(62),
B(LdaZero),
B(Star), R(7),
B(JumpLoop), U8(103), I8(0),
B(JumpLoop), U8(102), I8(0),
B(Jump), U8(40),
B(Star), R(20),
B(Ldar), R(closure),
@ -438,7 +431,7 @@ bytecodes: [
B(LdaZero),
B(Star), R(12),
B(Mov), R(17), R(13),
B(Jump), U8(103),
B(Jump), U8(102),
B(Ldar), R(17),
B(ReThrow),
B(LdaUndefined),
@ -446,7 +439,6 @@ bytecodes: [
B(Mov), R(2), R(16),
B(CallJSRuntime), U8(%async_generator_await_uncaught), R(16), U8(2),
B(SuspendGenerator), R(2), R(0), U8(16), U8(2),
/* 50 S> */ B(Return),
B(ResumeGenerator), R(2), R(11), R(0), U8(16),
B(Star), R(16),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
@ -508,15 +500,15 @@ bytecodes: [
/* 50 S> */ B(Return),
]
constant pool: [
Smi [37],
Smi [103],
Smi [399],
Smi [36],
Smi [102],
Smi [396],
Smi [15],
Smi [7],
TUPLE2_TYPE,
SYMBOL_TYPE,
ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
Smi [72],
Smi [71],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["done"],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"],
Smi [15],
@ -528,17 +520,17 @@ constant pool: [
Smi [6],
Smi [14],
FIXED_ARRAY_TYPE,
Smi [420],
Smi [418],
Smi [6],
Smi [20],
Smi [23],
]
handlers: [
[40, 481, 489],
[43, 442, 444],
[83, 263, 271],
[86, 223, 225],
[332, 342, 344],
[40, 478, 486],
[43, 439, 441],
[82, 261, 269],
[85, 221, 223],
[330, 340, 342],
]
---
@ -549,7 +541,7 @@ snippet: "
"
frame size: 18
parameter count: 1
bytecode array length: 526
bytecode array length: 521
bytecodes: [
B(Ldar), R(0),
B(JumpIfUndefined), U8(18),
@ -570,7 +562,6 @@ bytecodes: [
B(Mov), R(context), R(5),
B(Ldar), R(0),
/* 44 E> */ B(SuspendGenerator), R(0), R(0), U8(6), U8(0),
/* 60 S> */ B(Return),
B(ResumeGenerator), R(0), R(1), R(0), U8(6),
B(Star), R(6),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
@ -613,13 +604,13 @@ bytecodes: [
B(Ldar), R(7),
B(SwitchOnSmiNoFeedback), U8(14), U8(2), I8(1),
B(CallProperty1), R(10), R(8), R(9), U8(14),
B(Jump), U8(112),
B(Jump), U8(111),
B(LdaNamedProperty), R(8), U8(16), U8(16),
B(JumpIfUndefined), U8(13),
B(JumpIfNull), U8(11),
B(Star), R(13),
B(CallProperty1), R(13), R(8), R(9), U8(18),
B(Jump), U8(95),
B(Jump), U8(94),
B(LdaZero),
B(Star), R(2),
B(Mov), R(9), R(3),
@ -629,18 +620,17 @@ bytecodes: [
B(JumpIfNull), U8(11),
B(Star), R(13),
B(CallProperty1), R(13), R(8), R(9), U8(22),
B(Jump), U8(70),
B(Jump), U8(69),
B(LdaNamedProperty), R(8), U8(16), U8(24),
B(JumpIfUndefined), U8(59),
B(JumpIfNull), U8(57),
B(JumpIfUndefined), U8(58),
B(JumpIfNull), U8(56),
B(Star), R(13),
B(CallProperty0), R(13), R(8), U8(26),
B(Jump), U8(2),
B(Star), R(14),
B(Mov), R(0), R(13),
B(CallJSRuntime), U8(%async_generator_await_uncaught), R(13), U8(2),
B(SuspendGenerator), R(0), R(0), U8(13), U8(2),
/* 60 S> */ B(Return),
/* 49 E> */ B(SuspendGenerator), R(0), R(0), U8(13), U8(2),
B(ResumeGenerator), R(0), R(1), R(0), U8(13),
B(Star), R(13),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
@ -658,8 +648,7 @@ bytecodes: [
B(Star), R(14),
B(Mov), R(0), R(13),
B(CallJSRuntime), U8(%async_generator_await_uncaught), R(13), U8(2),
B(SuspendGenerator), R(0), R(0), U8(13), U8(3),
/* 60 S> */ B(Return),
/* 49 E> */ B(SuspendGenerator), R(0), R(0), U8(13), U8(3),
B(ResumeGenerator), R(0), R(1), R(0), U8(13),
B(Star), R(13),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
@ -674,20 +663,19 @@ bytecodes: [
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(6), U8(1),
B(LdaNamedProperty), R(6), U8(18), U8(28),
B(JumpIfToBooleanTrue), U8(40),
B(JumpIfToBooleanTrue), U8(39),
B(LdaNamedProperty), R(6), U8(19), U8(30),
B(Star), R(16),
B(LdaFalse),
B(Star), R(17),
B(Mov), R(0), R(15),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorYield), R(15), U8(3),
B(SuspendGenerator), R(0), R(0), U8(15), U8(1),
/* 60 S> */ B(Return),
/* 49 E> */ B(SuspendGenerator), R(0), R(0), U8(15), U8(1),
B(ResumeGenerator), R(0), R(1), R(0), U8(15),
B(Star), R(9),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(Star), R(7),
B(JumpLoop), U8(226), I8(0),
B(JumpLoop), U8(223), I8(0),
B(LdaNamedProperty), R(6), U8(19), U8(32),
B(Star), R(8),
B(LdaSmi), I8(1),
@ -696,13 +684,12 @@ bytecodes: [
B(LdaZero),
B(Star), R(2),
B(Mov), R(8), R(3),
B(Jump), U8(100),
B(Jump), U8(99),
B(LdaUndefined),
B(Star), R(7),
B(Mov), R(0), R(6),
B(CallJSRuntime), U8(%async_generator_await_uncaught), R(6), U8(2),
B(SuspendGenerator), R(0), R(0), U8(6), U8(4),
/* 60 S> */ B(Return),
B(ResumeGenerator), R(0), R(1), R(0), U8(6),
B(Star), R(6),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
@ -764,20 +751,20 @@ bytecodes: [
/* 60 S> */ B(Return),
]
constant pool: [
Smi [37],
Smi [124],
Smi [124],
Smi [124],
Smi [389],
Smi [36],
Smi [123],
Smi [123],
Smi [123],
Smi [384],
Smi [15],
Smi [7],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["g"],
SYMBOL_TYPE,
SYMBOL_TYPE,
ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
Smi [211],
Smi [98],
Smi [150],
Smi [208],
Smi [97],
Smi [148],
Smi [11],
Smi [36],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["return"],
@ -786,14 +773,14 @@ constant pool: [
ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"],
ONE_BYTE_INTERNALIZED_STRING_TYPE [".catch"],
FIXED_ARRAY_TYPE,
Smi [410],
Smi [297],
Smi [406],
Smi [293],
Smi [6],
Smi [20],
Smi [23],
]
handlers: [
[40, 471, 479],
[43, 432, 434],
[40, 466, 474],
[43, 427, 429],
]

View File

@ -16,7 +16,7 @@ snippet: "
"
frame size: 24
parameter count: 1
bytecode array length: 554
bytecode array length: 551
bytecodes: [
B(Ldar), R(2),
B(JumpIfUndefined), U8(18),
@ -69,8 +69,7 @@ bytecodes: [
B(Mov), R(2), R(21),
B(Mov), R(11), R(23),
B(CallJSRuntime), U8(%async_function_await_uncaught), R(21), U8(3),
B(SuspendGenerator), R(2), R(0), U8(21), U8(0),
/* 57 S> */ B(Return),
/* 40 E> */ B(SuspendGenerator), R(2), R(0), U8(21), U8(0),
B(ResumeGenerator), R(2), R(12), R(0), U8(21),
B(Star), R(21),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
@ -96,7 +95,7 @@ bytecodes: [
B(Mov), R(3), R(0),
B(LdaZero),
B(Star), R(7),
B(JumpLoop), U8(98), I8(0),
B(JumpLoop), U8(97), I8(0),
B(Jump), U8(40),
B(Star), R(21),
B(Ldar), R(closure),
@ -127,15 +126,15 @@ bytecodes: [
B(Star), R(19),
B(LdaZero),
B(TestEqualStrict), R(7), U8(18),
B(JumpIfTrue), U8(171),
B(JumpIfTrue), U8(169),
B(LdaNamedProperty), R(4), U8(12), U8(19),
B(Star), R(9),
B(TestUndetectable),
B(JumpIfFalse), U8(4),
B(Jump), U8(160),
B(Jump), U8(158),
B(LdaSmi), I8(1),
B(TestEqualStrict), R(7), U8(21),
B(JumpIfFalse), U8(88),
B(JumpIfFalse), U8(87),
B(Ldar), R(9),
B(TestTypeOf), U8(6),
B(JumpIfFalse), U8(4),
@ -155,7 +154,6 @@ bytecodes: [
B(Mov), R(11), R(23),
B(CallJSRuntime), U8(%async_function_await_caught), R(21), U8(3),
B(SuspendGenerator), R(2), R(0), U8(21), U8(1),
/* 57 S> */ B(Return),
B(ResumeGenerator), R(2), R(12), R(0), U8(21),
B(Star), R(21),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
@ -170,7 +168,7 @@ bytecodes: [
B(LdaTheHole),
B(SetPendingMessage),
B(Ldar), R(20),
B(Jump), U8(67),
B(Jump), U8(66),
B(Mov), R(9), R(20),
B(Mov), R(4), R(21),
B(InvokeIntrinsic), U8(Runtime::k_Call), R(20), U8(2),
@ -179,7 +177,6 @@ bytecodes: [
B(Mov), R(11), R(22),
B(CallJSRuntime), U8(%async_function_await_uncaught), R(20), U8(3),
B(SuspendGenerator), R(2), R(0), U8(20), U8(2),
/* 57 S> */ B(Return),
B(ResumeGenerator), R(2), R(12), R(0), U8(20),
B(Star), R(20),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
@ -254,13 +251,13 @@ bytecodes: [
]
constant pool: [
Smi [95],
Smi [332],
Smi [391],
Smi [330],
Smi [388],
TUPLE2_TYPE,
SYMBOL_TYPE,
SYMBOL_TYPE,
ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
Smi [34],
Smi [33],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["done"],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"],
ONE_BYTE_INTERNALIZED_STRING_TYPE [".catch"],
@ -272,11 +269,11 @@ constant pool: [
Smi [9],
]
handlers: [
[46, 513, 521],
[49, 471, 473],
[55, 250, 258],
[58, 210, 212],
[318, 369, 371],
[46, 510, 518],
[49, 468, 470],
[55, 249, 257],
[58, 209, 211],
[317, 367, 369],
]
---
@ -288,7 +285,7 @@ snippet: "
"
frame size: 24
parameter count: 1
bytecode array length: 583
bytecode array length: 580
bytecodes: [
B(Ldar), R(2),
B(JumpIfUndefined), U8(18),
@ -341,8 +338,7 @@ bytecodes: [
B(Mov), R(2), R(21),
B(Mov), R(11), R(23),
B(CallJSRuntime), U8(%async_function_await_uncaught), R(21), U8(3),
B(SuspendGenerator), R(2), R(0), U8(21), U8(0),
/* 68 S> */ B(Return),
/* 40 E> */ B(SuspendGenerator), R(2), R(0), U8(21), U8(0),
B(ResumeGenerator), R(2), R(12), R(0), U8(21),
B(Star), R(21),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
@ -400,15 +396,15 @@ bytecodes: [
B(Star), R(19),
B(LdaZero),
B(TestEqualStrict), R(7), U8(18),
B(JumpIfTrue), U8(171),
B(JumpIfTrue), U8(169),
B(LdaNamedProperty), R(4), U8(12), U8(19),
B(Star), R(9),
B(TestUndetectable),
B(JumpIfFalse), U8(4),
B(Jump), U8(160),
B(Jump), U8(158),
B(LdaSmi), I8(1),
B(TestEqualStrict), R(7), U8(21),
B(JumpIfFalse), U8(88),
B(JumpIfFalse), U8(87),
B(Ldar), R(9),
B(TestTypeOf), U8(6),
B(JumpIfFalse), U8(4),
@ -428,7 +424,6 @@ bytecodes: [
B(Mov), R(11), R(23),
B(CallJSRuntime), U8(%async_function_await_caught), R(21), U8(3),
B(SuspendGenerator), R(2), R(0), U8(21), U8(1),
/* 68 S> */ B(Return),
B(ResumeGenerator), R(2), R(12), R(0), U8(21),
B(Star), R(21),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
@ -443,7 +438,7 @@ bytecodes: [
B(LdaTheHole),
B(SetPendingMessage),
B(Ldar), R(20),
B(Jump), U8(67),
B(Jump), U8(66),
B(Mov), R(9), R(20),
B(Mov), R(4), R(21),
B(InvokeIntrinsic), U8(Runtime::k_Call), R(20), U8(2),
@ -452,7 +447,6 @@ bytecodes: [
B(Mov), R(11), R(22),
B(CallJSRuntime), U8(%async_function_await_uncaught), R(20), U8(3),
B(SuspendGenerator), R(2), R(0), U8(20), U8(2),
/* 68 S> */ B(Return),
B(ResumeGenerator), R(2), R(12), R(0), U8(20),
B(Star), R(20),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
@ -536,13 +530,13 @@ bytecodes: [
]
constant pool: [
Smi [95],
Smi [335],
Smi [394],
Smi [333],
Smi [391],
TUPLE2_TYPE,
SYMBOL_TYPE,
SYMBOL_TYPE,
ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
Smi [34],
Smi [33],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["done"],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"],
ONE_BYTE_INTERNALIZED_STRING_TYPE [".catch"],
@ -557,11 +551,11 @@ constant pool: [
Smi [22],
]
handlers: [
[46, 529, 537],
[49, 486, 488],
[55, 252, 260],
[58, 212, 214],
[321, 372, 374],
[46, 526, 534],
[49, 483, 485],
[55, 251, 259],
[58, 211, 213],
[320, 370, 372],
]
---
@ -576,7 +570,7 @@ snippet: "
"
frame size: 24
parameter count: 1
bytecode array length: 572
bytecode array length: 569
bytecodes: [
B(Ldar), R(2),
B(JumpIfUndefined), U8(18),
@ -629,8 +623,7 @@ bytecodes: [
B(Mov), R(2), R(21),
B(Mov), R(11), R(23),
B(CallJSRuntime), U8(%async_function_await_uncaught), R(21), U8(3),
B(SuspendGenerator), R(2), R(0), U8(21), U8(0),
/* 114 S> */ B(Return),
/* 40 E> */ B(SuspendGenerator), R(2), R(0), U8(21), U8(0),
B(ResumeGenerator), R(2), R(12), R(0), U8(21),
B(Star), R(21),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
@ -664,7 +657,7 @@ bytecodes: [
/* 103 S> */ B(Jump), U8(8),
B(LdaZero),
B(Star), R(7),
B(JumpLoop), U8(116), I8(0),
B(JumpLoop), U8(115), I8(0),
B(Jump), U8(40),
B(Star), R(21),
B(Ldar), R(closure),
@ -695,15 +688,15 @@ bytecodes: [
B(Star), R(19),
B(LdaZero),
B(TestEqualStrict), R(7), U8(20),
B(JumpIfTrue), U8(171),
B(JumpIfTrue), U8(169),
B(LdaNamedProperty), R(4), U8(12), U8(21),
B(Star), R(9),
B(TestUndetectable),
B(JumpIfFalse), U8(4),
B(Jump), U8(160),
B(Jump), U8(158),
B(LdaSmi), I8(1),
B(TestEqualStrict), R(7), U8(23),
B(JumpIfFalse), U8(88),
B(JumpIfFalse), U8(87),
B(Ldar), R(9),
B(TestTypeOf), U8(6),
B(JumpIfFalse), U8(4),
@ -723,7 +716,6 @@ bytecodes: [
B(Mov), R(11), R(23),
B(CallJSRuntime), U8(%async_function_await_caught), R(21), U8(3),
B(SuspendGenerator), R(2), R(0), U8(21), U8(1),
/* 114 S> */ B(Return),
B(ResumeGenerator), R(2), R(12), R(0), U8(21),
B(Star), R(21),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
@ -738,7 +730,7 @@ bytecodes: [
B(LdaTheHole),
B(SetPendingMessage),
B(Ldar), R(20),
B(Jump), U8(67),
B(Jump), U8(66),
B(Mov), R(9), R(20),
B(Mov), R(4), R(21),
B(InvokeIntrinsic), U8(Runtime::k_Call), R(20), U8(2),
@ -747,7 +739,6 @@ bytecodes: [
B(Mov), R(11), R(22),
B(CallJSRuntime), U8(%async_function_await_uncaught), R(20), U8(3),
B(SuspendGenerator), R(2), R(0), U8(20), U8(2),
/* 114 S> */ B(Return),
B(ResumeGenerator), R(2), R(12), R(0), U8(20),
B(Star), R(20),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
@ -822,13 +813,13 @@ bytecodes: [
]
constant pool: [
Smi [95],
Smi [350],
Smi [409],
Smi [348],
Smi [406],
TUPLE2_TYPE,
SYMBOL_TYPE,
SYMBOL_TYPE,
ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
Smi [34],
Smi [33],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["done"],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"],
ONE_BYTE_INTERNALIZED_STRING_TYPE [".catch"],
@ -840,11 +831,11 @@ constant pool: [
Smi [9],
]
handlers: [
[46, 531, 539],
[49, 489, 491],
[55, 268, 276],
[58, 228, 230],
[336, 387, 389],
[46, 528, 536],
[49, 486, 488],
[55, 267, 275],
[58, 227, 229],
[335, 385, 387],
]
---

View File

@ -619,7 +619,7 @@ snippet: "
"
frame size: 20
parameter count: 2
bytecode array length: 320
bytecode array length: 319
bytecodes: [
B(Ldar), R(3),
B(JumpIfUndefined), U8(18),
@ -641,7 +641,6 @@ bytecodes: [
B(Star), R(3),
/* 11 E> */ B(StackCheck),
/* 11 E> */ B(SuspendGenerator), R(3), R(0), U8(14), U8(0),
/* 55 S> */ B(Return),
B(ResumeGenerator), R(3), R(12), R(0), U8(14),
B(Star), R(14),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(3), U8(1),
@ -757,7 +756,7 @@ bytecodes: [
/* 55 S> */ B(Return),
]
constant pool: [
Smi [37],
Smi [36],
Smi [10],
Smi [7],
SYMBOL_TYPE,
@ -770,9 +769,9 @@ constant pool: [
ONE_BYTE_INTERNALIZED_STRING_TYPE [""],
]
handlers: [
[78, 196, 204],
[81, 160, 162],
[264, 274, 276],
[77, 195, 203],
[80, 159, 161],
[263, 273, 275],
]
---
@ -784,7 +783,7 @@ snippet: "
"
frame size: 19
parameter count: 2
bytecode array length: 380
bytecode array length: 378
bytecodes: [
B(Ldar), R(2),
B(JumpIfUndefined), U8(18),
@ -806,7 +805,6 @@ bytecodes: [
B(Star), R(2),
/* 11 E> */ B(StackCheck),
/* 11 E> */ B(SuspendGenerator), R(2), R(0), U8(13), U8(0),
/* 49 S> */ B(Return),
B(ResumeGenerator), R(2), R(11), R(0), U8(13),
B(Star), R(13),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
@ -842,7 +840,7 @@ bytecodes: [
B(JumpIfFalse), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(6), U8(1),
B(LdaNamedProperty), R(6), U8(7), U8(8),
B(JumpIfToBooleanTrue), U8(67),
B(JumpIfToBooleanTrue), U8(66),
B(LdaNamedProperty), R(6), U8(8), U8(10),
B(Star), R(8),
B(LdaSmi), I8(2),
@ -854,8 +852,7 @@ bytecodes: [
B(Star), R(18),
B(Mov), R(0), R(17),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(17), U8(2),
B(SuspendGenerator), R(2), R(0), U8(17), U8(1),
/* 49 S> */ B(Return),
/* 40 E> */ B(SuspendGenerator), R(2), R(0), U8(17), U8(1),
B(ResumeGenerator), R(2), R(11), R(0), U8(17),
B(Star), R(17),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
@ -868,7 +865,7 @@ bytecodes: [
B(Jump), U8(58),
B(LdaZero),
B(Star), R(7),
B(JumpLoop), U8(100), I8(0),
B(JumpLoop), U8(99), I8(0),
B(Jump), U8(36),
B(Star), R(17),
B(Ldar), R(closure),
@ -945,13 +942,13 @@ bytecodes: [
/* 49 S> */ B(Return),
]
constant pool: [
Smi [37],
Smi [96],
Smi [36],
Smi [95],
Smi [10],
Smi [7],
SYMBOL_TYPE,
ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
Smi [69],
Smi [68],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["done"],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"],
Smi [15],
@ -964,9 +961,9 @@ constant pool: [
Smi [9],
]
handlers: [
[78, 249, 257],
[81, 213, 215],
[318, 328, 330],
[77, 247, 255],
[80, 211, 213],
[316, 326, 328],
]
---
@ -1176,7 +1173,7 @@ snippet: "
"
frame size: 25
parameter count: 2
bytecode array length: 459
bytecode array length: 458
bytecodes: [
B(Ldar), R(2),
B(JumpIfUndefined), U8(18),
@ -1228,7 +1225,7 @@ bytecodes: [
B(JumpIfFalse), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(6), U8(1),
B(LdaNamedProperty), R(6), U8(4), U8(8),
B(JumpIfToBooleanTrue), U8(65),
B(JumpIfToBooleanTrue), U8(64),
B(LdaNamedProperty), R(6), U8(5), U8(10),
B(Star), R(8),
B(LdaSmi), I8(2),
@ -1240,8 +1237,7 @@ bytecodes: [
B(Mov), R(0), R(23),
B(Mov), R(11), R(24),
B(CallJSRuntime), U8(%async_function_await_uncaught), R(22), U8(3),
B(SuspendGenerator), R(2), R(0), U8(22), U8(0),
/* 54 S> */ B(Return),
/* 45 E> */ B(SuspendGenerator), R(2), R(0), U8(22), U8(0),
B(ResumeGenerator), R(2), R(12), R(0), U8(22),
B(Star), R(22),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
@ -1253,7 +1249,7 @@ bytecodes: [
B(ReThrow),
B(LdaZero),
B(Star), R(7),
B(JumpLoop), U8(98), I8(0),
B(JumpLoop), U8(97), I8(0),
B(Jump), U8(40),
B(Star), R(22),
B(Ldar), R(closure),
@ -1382,7 +1378,7 @@ constant pool: [
Smi [81],
SYMBOL_TYPE,
ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
Smi [72],
Smi [71],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["done"],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"],
ONE_BYTE_INTERNALIZED_STRING_TYPE [".catch"],
@ -1394,10 +1390,10 @@ constant pool: [
Smi [9],
]
handlers: [
[54, 418, 426],
[57, 376, 378],
[63, 236, 244],
[66, 196, 198],
[304, 314, 316],
[54, 417, 425],
[57, 375, 377],
[63, 235, 243],
[66, 195, 197],
[303, 313, 315],
]

View File

@ -13,7 +13,7 @@ snippet: "
"
frame size: 4
parameter count: 1
bytecode array length: 66
bytecode array length: 65
bytecodes: [
B(Ldar), R(0),
B(JumpIfUndefined), U8(18),
@ -31,7 +31,6 @@ bytecodes: [
B(Star), R(0),
/* 11 E> */ B(StackCheck),
/* 11 E> */ B(SuspendGenerator), R(0), R(0), U8(2), U8(0),
/* 16 S> */ B(Return),
B(ResumeGenerator), R(0), R(1), R(0), U8(2),
B(Star), R(2),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
@ -44,7 +43,7 @@ bytecodes: [
/* 16 S> */ B(Return),
]
constant pool: [
Smi [29],
Smi [28],
Smi [10],
Smi [7],
]
@ -58,7 +57,7 @@ snippet: "
"
frame size: 4
parameter count: 1
bytecode array length: 104
bytecode array length: 102
bytecodes: [
B(Ldar), R(0),
B(JumpIfUndefined), U8(18),
@ -76,7 +75,6 @@ bytecodes: [
B(Star), R(0),
/* 11 E> */ B(StackCheck),
/* 11 E> */ B(SuspendGenerator), R(0), R(0), U8(2), U8(0),
/* 25 S> */ B(Return),
B(ResumeGenerator), R(0), R(1), R(0), U8(2),
B(Star), R(2),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
@ -90,8 +88,7 @@ bytecodes: [
B(LdaFalse),
B(Star), R(3),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(2), U8(2),
B(SuspendGenerator), R(0), R(0), U8(2), U8(1),
/* 25 S> */ B(Return),
/* 16 E> */ B(SuspendGenerator), R(0), R(0), U8(2), U8(1),
B(ResumeGenerator), R(0), R(1), R(0), U8(2),
B(Star), R(2),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
@ -104,8 +101,8 @@ bytecodes: [
/* 25 S> */ B(Return),
]
constant pool: [
Smi [29],
Smi [67],
Smi [28],
Smi [65],
Smi [10],
Smi [7],
Smi [10],
@ -121,7 +118,7 @@ snippet: "
"
frame size: 18
parameter count: 1
bytecode array length: 374
bytecode array length: 372
bytecodes: [
B(Ldar), R(2),
B(JumpIfUndefined), U8(18),
@ -139,7 +136,6 @@ bytecodes: [
B(Star), R(2),
/* 11 E> */ B(StackCheck),
/* 11 E> */ B(SuspendGenerator), R(2), R(0), U8(12), U8(0),
/* 44 S> */ B(Return),
B(ResumeGenerator), R(2), R(11), R(0), U8(12),
B(Star), R(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
@ -175,7 +171,7 @@ bytecodes: [
B(JumpIfFalse), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(6), U8(1),
B(LdaNamedProperty), R(6), U8(8), U8(9),
B(JumpIfToBooleanTrue), U8(67),
B(JumpIfToBooleanTrue), U8(66),
B(LdaNamedProperty), R(6), U8(9), U8(11),
B(Star), R(8),
B(LdaSmi), I8(2),
@ -187,8 +183,7 @@ bytecodes: [
B(Star), R(17),
B(Mov), R(0), R(16),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(16), U8(2),
B(SuspendGenerator), R(2), R(0), U8(16), U8(1),
/* 44 S> */ B(Return),
/* 36 E> */ B(SuspendGenerator), R(2), R(0), U8(16), U8(1),
B(ResumeGenerator), R(2), R(11), R(0), U8(16),
B(Star), R(16),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
@ -201,7 +196,7 @@ bytecodes: [
B(Jump), U8(58),
B(LdaZero),
B(Star), R(7),
B(JumpLoop), U8(100), I8(0),
B(JumpLoop), U8(99), I8(0),
B(Jump), U8(36),
B(Star), R(16),
B(Ldar), R(closure),
@ -278,14 +273,14 @@ bytecodes: [
/* 44 S> */ B(Return),
]
constant pool: [
Smi [29],
Smi [90],
Smi [28],
Smi [89],
Smi [10],
Smi [7],
TUPLE2_TYPE,
SYMBOL_TYPE,
ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
Smi [69],
Smi [68],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["done"],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"],
Smi [15],
@ -298,9 +293,9 @@ constant pool: [
Smi [9],
]
handlers: [
[70, 243, 251],
[73, 207, 209],
[312, 322, 324],
[69, 241, 249],
[72, 205, 207],
[310, 320, 322],
]
---
@ -311,7 +306,7 @@ snippet: "
"
frame size: 10
parameter count: 1
bytecode array length: 255
bytecode array length: 253
bytecodes: [
B(Ldar), R(0),
B(JumpIfUndefined), U8(18),
@ -329,7 +324,6 @@ bytecodes: [
B(Star), R(0),
/* 38 E> */ B(StackCheck),
/* 38 E> */ B(SuspendGenerator), R(0), R(0), U8(2), U8(0),
/* 54 S> */ B(Return),
B(ResumeGenerator), R(0), R(1), R(0), U8(2),
B(Star), R(2),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
@ -392,15 +386,14 @@ bytecodes: [
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(2), U8(1),
B(LdaNamedProperty), R(2), U8(12), U8(24),
B(JumpIfToBooleanTrue), U8(26),
B(JumpIfToBooleanTrue), U8(25),
B(Ldar), R(2),
B(SuspendGenerator), R(0), R(0), U8(9), U8(1),
/* 54 S> */ B(Return),
/* 43 E> */ B(SuspendGenerator), R(0), R(0), U8(9), U8(1),
B(ResumeGenerator), R(0), R(1), R(0), U8(9),
B(Star), R(5),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(Star), R(3),
B(JumpLoop), U8(130), I8(0),
B(JumpLoop), U8(129), I8(0),
B(LdaNamedProperty), R(2), U8(13), U8(26),
B(Star), R(4),
B(LdaSmi), I8(1),
@ -412,14 +405,14 @@ bytecodes: [
/* 54 S> */ B(Return),
]
constant pool: [
Smi [29],
Smi [91],
Smi [28],
Smi [90],
Smi [10],
Smi [7],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["g"],
SYMBOL_TYPE,
ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
Smi [115],
Smi [114],
Smi [11],
Smi [31],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["return"],

View File

@ -13,7 +13,7 @@ snippet: "
"
frame size: 6
parameter count: 2
bytecode array length: 84
bytecode array length: 83
bytecodes: [
B(Ldar), R(0),
B(JumpIfUndefined), U8(18),
@ -36,7 +36,6 @@ bytecodes: [
B(Star), R(0),
/* 0 E> */ B(StackCheck),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(4), U8(0),
/* 13 S> */ B(Return),
B(ResumeGenerator), R(0), R(2), R(0), U8(4),
B(Star), R(4),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
@ -50,7 +49,7 @@ bytecodes: [
/* 13 S> */ B(Return),
]
constant pool: [
Smi [43],
Smi [42],
FIXED_ARRAY_TYPE,
Smi [10],
Smi [7],
@ -64,7 +63,7 @@ snippet: "
"
frame size: 6
parameter count: 2
bytecode array length: 84
bytecode array length: 83
bytecodes: [
B(Ldar), R(0),
B(JumpIfUndefined), U8(18),
@ -87,7 +86,6 @@ bytecodes: [
B(Star), R(0),
/* 0 E> */ B(StackCheck),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(4), U8(0),
/* 24 S> */ B(Return),
B(ResumeGenerator), R(0), R(2), R(0), U8(4),
B(Star), R(4),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
@ -101,7 +99,7 @@ bytecodes: [
/* 24 S> */ B(Return),
]
constant pool: [
Smi [43],
Smi [42],
FIXED_ARRAY_TYPE,
Smi [10],
Smi [7],
@ -117,7 +115,7 @@ snippet: "
"
frame size: 7
parameter count: 2
bytecode array length: 114
bytecode array length: 113
bytecodes: [
B(Ldar), R(1),
B(JumpIfUndefined), U8(18),
@ -140,7 +138,6 @@ bytecodes: [
B(Star), R(1),
/* 0 E> */ B(StackCheck),
/* 0 E> */ B(SuspendGenerator), R(1), R(0), U8(5), U8(0),
/* 64 S> */ B(Return),
B(ResumeGenerator), R(1), R(3), R(0), U8(5),
B(Star), R(5),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(1), U8(1),
@ -167,7 +164,7 @@ bytecodes: [
/* 64 S> */ B(Return),
]
constant pool: [
Smi [43],
Smi [42],
FIXED_ARRAY_TYPE,
Smi [10],
Smi [7],
@ -184,7 +181,7 @@ snippet: "
"
frame size: 7
parameter count: 2
bytecode array length: 112
bytecode array length: 111
bytecodes: [
B(Ldar), R(1),
B(JumpIfUndefined), U8(18),
@ -207,7 +204,6 @@ bytecodes: [
B(Star), R(1),
/* 0 E> */ B(StackCheck),
/* 0 E> */ B(SuspendGenerator), R(1), R(0), U8(5), U8(0),
/* 49 S> */ B(Return),
B(ResumeGenerator), R(1), R(3), R(0), U8(5),
B(Star), R(5),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(1), U8(1),
@ -233,7 +229,7 @@ bytecodes: [
/* 49 S> */ B(Return),
]
constant pool: [
Smi [43],
Smi [42],
FIXED_ARRAY_TYPE,
Smi [10],
Smi [7],
@ -249,7 +245,7 @@ snippet: "
"
frame size: 7
parameter count: 2
bytecode array length: 118
bytecode array length: 117
bytecodes: [
B(Ldar), R(1),
B(JumpIfUndefined), U8(18),
@ -275,7 +271,6 @@ bytecodes: [
/* 0 E> */ B(StackCheck),
B(Ldar), R(1),
/* 0 E> */ B(SuspendGenerator), R(1), R(0), U8(5), U8(0),
/* 49 S> */ B(Return),
B(ResumeGenerator), R(1), R(3), R(0), U8(5),
B(Star), R(5),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(1), U8(1),
@ -301,7 +296,7 @@ bytecodes: [
/* 49 S> */ B(Return),
]
constant pool: [
Smi [49],
Smi [48],
FIXED_ARRAY_TYPE,
Smi [10],
Smi [7],
@ -317,7 +312,7 @@ snippet: "
"
frame size: 7
parameter count: 2
bytecode array length: 122
bytecode array length: 121
bytecodes: [
B(Ldar), R(1),
B(JumpIfUndefined), U8(18),
@ -343,7 +338,6 @@ bytecodes: [
/* 0 E> */ B(StackCheck),
B(Ldar), R(1),
/* 0 E> */ B(SuspendGenerator), R(1), R(0), U8(5), U8(0),
/* 51 S> */ B(Return),
B(ResumeGenerator), R(1), R(3), R(0), U8(5),
B(Star), R(5),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(1), U8(1),
@ -369,7 +363,7 @@ bytecodes: [
/* 51 S> */ B(Return),
]
constant pool: [
Smi [49],
Smi [48],
FIXED_ARRAY_TYPE,
Smi [10],
Smi [7],
@ -383,7 +377,7 @@ snippet: "
"
frame size: 6
parameter count: 2
bytecode array length: 97
bytecode array length: 96
bytecodes: [
B(Ldar), R(0),
B(JumpIfUndefined), U8(18),
@ -409,7 +403,6 @@ bytecodes: [
/* 0 E> */ B(StackCheck),
B(Ldar), R(0),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(4), U8(0),
/* 32 S> */ B(Return),
B(ResumeGenerator), R(0), R(2), R(0), U8(4),
B(Star), R(4),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
@ -425,7 +418,7 @@ bytecodes: [
/* 32 S> */ B(Return),
]
constant pool: [
Smi [49],
Smi [48],
FIXED_ARRAY_TYPE,
Smi [10],
Smi [7],
@ -440,7 +433,7 @@ snippet: "
"
frame size: 8
parameter count: 2
bytecode array length: 118
bytecode array length: 117
bytecodes: [
B(Ldar), R(0),
B(JumpIfUndefined), U8(18),
@ -466,7 +459,6 @@ bytecodes: [
/* 0 E> */ B(StackCheck),
B(Ldar), R(0),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(4), U8(0),
/* 26 S> */ B(Return),
B(ResumeGenerator), R(0), R(2), R(0), U8(4),
B(Star), R(4),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
@ -491,7 +483,7 @@ bytecodes: [
/* 26 S> */ B(Return),
]
constant pool: [
Smi [49],
Smi [48],
FIXED_ARRAY_TYPE,
Smi [10],
Smi [7],
@ -507,7 +499,7 @@ snippet: "
"
frame size: 6
parameter count: 2
bytecode array length: 84
bytecode array length: 83
bytecodes: [
B(Ldar), R(0),
B(JumpIfUndefined), U8(18),
@ -530,7 +522,6 @@ bytecodes: [
B(Star), R(0),
/* 0 E> */ B(StackCheck),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(4), U8(0),
/* 30 S> */ B(Return),
B(ResumeGenerator), R(0), R(2), R(0), U8(4),
B(Star), R(4),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
@ -544,7 +535,7 @@ bytecodes: [
/* 30 S> */ B(Return),
]
constant pool: [
Smi [43],
Smi [42],
FIXED_ARRAY_TYPE,
Smi [10],
Smi [7],
@ -558,7 +549,7 @@ snippet: "
"
frame size: 6
parameter count: 2
bytecode array length: 84
bytecode array length: 83
bytecodes: [
B(Ldar), R(0),
B(JumpIfUndefined), U8(18),
@ -581,7 +572,6 @@ bytecodes: [
B(Star), R(0),
/* 0 E> */ B(StackCheck),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(4), U8(0),
/* 19 S> */ B(Return),
B(ResumeGenerator), R(0), R(2), R(0), U8(4),
B(Star), R(4),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
@ -595,7 +585,7 @@ bytecodes: [
/* 19 S> */ B(Return),
]
constant pool: [
Smi [43],
Smi [42],
FIXED_ARRAY_TYPE,
Smi [10],
Smi [7],
@ -610,7 +600,7 @@ snippet: "
"
frame size: 9
parameter count: 2
bytecode array length: 111
bytecode array length: 110
bytecodes: [
B(Ldar), R(0),
B(JumpIfUndefined), U8(18),
@ -638,7 +628,6 @@ bytecodes: [
/* 0 E> */ B(StackCheck),
B(Ldar), R(0),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(5), U8(0),
/* 45 S> */ B(Return),
B(ResumeGenerator), R(0), R(3), R(0), U8(5),
B(Star), R(5),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
@ -656,7 +645,7 @@ bytecodes: [
/* 45 S> */ B(Return),
]
constant pool: [
Smi [55],
Smi [54],
FIXED_ARRAY_TYPE,
Smi [10],
Smi [7],

View File

@ -272,7 +272,7 @@ snippet: "
"
frame size: 6
parameter count: 1
bytecode array length: 89
bytecode array length: 88
bytecodes: [
B(Ldar), R(2),
B(JumpIfUndefined), U8(18),
@ -290,7 +290,6 @@ bytecodes: [
B(Star), R(2),
/* 11 E> */ B(StackCheck),
/* 11 E> */ B(SuspendGenerator), R(2), R(0), U8(4), U8(0),
/* 62 S> */ B(Return),
B(ResumeGenerator), R(2), R(3), R(0), U8(4),
B(Star), R(4),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
@ -314,7 +313,7 @@ bytecodes: [
/* 62 S> */ B(Return),
]
constant pool: [
Smi [29],
Smi [28],
Smi [10],
Smi [7],
]
@ -330,7 +329,7 @@ snippet: "
"
frame size: 5
parameter count: 1
bytecode array length: 137
bytecode array length: 135
bytecodes: [
B(Ldar), R(1),
B(JumpIfUndefined), U8(18),
@ -348,7 +347,6 @@ bytecodes: [
B(Star), R(1),
/* 11 E> */ B(StackCheck),
/* 11 E> */ B(SuspendGenerator), R(1), R(0), U8(3), U8(0),
/* 56 S> */ B(Return),
B(ResumeGenerator), R(1), R(2), R(0), U8(3),
B(Star), R(3),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(1), U8(1),
@ -367,14 +365,13 @@ bytecodes: [
B(Abort), U8(15),
/* 36 S> */ B(LdaSmi), I8(10),
/* 36 E> */ B(TestLessThan), R(0), U8(0),
B(JumpIfFalse), U8(49),
B(JumpIfFalse), U8(48),
/* 18 E> */ B(StackCheck),
/* 47 S> */ B(LdaFalse),
B(Star), R(4),
B(Mov), R(0), R(3),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(3), U8(2),
B(SuspendGenerator), R(1), R(0), U8(3), U8(1),
/* 56 S> */ B(Return),
/* 47 E> */ B(SuspendGenerator), R(1), R(0), U8(3), U8(1),
B(ResumeGenerator), R(1), R(2), R(0), U8(3),
B(Star), R(3),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(1), U8(1),
@ -386,16 +383,16 @@ bytecodes: [
/* 44 S> */ B(Ldar), R(0),
B(Inc), U8(1),
B(Star), R(0),
B(JumpLoop), U8(65), I8(0),
B(JumpLoop), U8(64), I8(0),
B(LdaUndefined),
/* 56 S> */ B(Return),
]
constant pool: [
Smi [29],
Smi [53],
Smi [28],
Smi [52],
Smi [10],
Smi [7],
Smi [36],
Smi [35],
Smi [10],
Smi [7],
]
@ -500,7 +497,7 @@ snippet: "
"
frame size: 12
parameter count: 1
bytecode array length: 224
bytecode array length: 223
bytecodes: [
B(Ldar), R(1),
B(JumpIfUndefined), U8(18),
@ -531,14 +528,13 @@ bytecodes: [
B(Abort), U8(15),
/* 41 S> */ B(LdaSmi), I8(10),
/* 41 E> */ B(TestLessThan), R(0), U8(0),
B(JumpIfFalse), U8(52),
B(JumpIfFalse), U8(51),
/* 23 E> */ B(StackCheck),
/* 52 S> */ B(Mov), R(1), R(8),
B(Mov), R(0), R(9),
B(Mov), R(2), R(10),
B(CallJSRuntime), U8(%async_function_await_uncaught), R(8), U8(3),
B(SuspendGenerator), R(1), R(0), U8(8), U8(0),
/* 61 S> */ B(Return),
/* 52 E> */ B(SuspendGenerator), R(1), R(0), U8(8), U8(0),
B(ResumeGenerator), R(1), R(3), R(0), U8(8),
B(Star), R(8),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(1), U8(1),
@ -551,7 +547,7 @@ bytecodes: [
/* 49 S> */ B(Ldar), R(0),
B(Inc), U8(1),
B(Star), R(0),
B(JumpLoop), U8(68), I8(0),
B(JumpLoop), U8(67), I8(0),
B(LdaUndefined),
B(Star), R(9),
B(Mov), R(2), R(8),
@ -605,14 +601,14 @@ bytecodes: [
]
constant pool: [
Smi [38],
Smi [39],
Smi [38],
ONE_BYTE_INTERNALIZED_STRING_TYPE [".catch"],
FIXED_ARRAY_TYPE,
Smi [6],
Smi [9],
]
handlers: [
[46, 183, 191],
[49, 141, 143],
[46, 182, 190],
[49, 140, 142],
]

View File

@ -5,11 +5,11 @@ Running test: testBreakLocations
function testFunction() {
async function f1() {
for (let x = |_|0; x |_|< 1; ++|_|x) |_|await x;
|_|return await Promise.|C|resolve(2);
|_|return |_|await Promise.|C|resolve(2);
|R|}
async function f2() {
let r = |_|await |C|f1() + await |C|f1();
let r = |_|await |C|f1() + |_|await |C|f1();
|_|await |C|f1();
|_|await |C|f1().|C|then(x => x |_|* 2|R|);
|_|await [1].|C|map(x => Promise.|C|resolve(x)|R|)[0];

View File

@ -152,7 +152,7 @@ function testSwitch() {
}
|R|}
function* idMaker() {
function* idMaker|_|() {
|_|yield 1;
|_|yield 2;
|_|yield 3;
@ -230,8 +230,8 @@ async function testPromiseAsyncWithCode() {
|_|await p;
|R|}
|C|setTimeout(returnCall, 0);
await |C|foo();
await |C|foo();
|_|await |C|foo();
|_|await |C|foo();
|C|nextTest();
|R|}
|C|main();
@ -252,7 +252,7 @@ async function testPromiseComplex() {
|R|}
var x = |_|1;
var y = |_|2;
|C|returnFunction(|C|emptyFunction(), x++, --y, x => 2 |_|* x|R|, |C|returnCall())|C|().a = await |C|foo((a => 2 |_|*a|R|)|C|(5));
|C|returnFunction(|C|emptyFunction(), x++, --y, x => 2 |_|* x|R|, |C|returnCall())|C|().a = |_|await |C|foo((a => 2 |_|*a|R|)|C|(5));
|C|nextTest();
|R|}
|C|main();

View File

@ -384,9 +384,16 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) {
.StoreModuleVariable(1, 42);
// Emit generator operations.
builder.SuspendGenerator(reg, reg_list, 0)
.RestoreGeneratorState(reg)
.ResumeGenerator(reg, reg, reg_list);
{
// We have to skip over suspend because it returns and marks the remaining
// bytecode dead.
BytecodeLabel after_suspend;
builder.JumpIfTrue(ToBooleanMode::kAlreadyBoolean, &after_suspend)
.SuspendGenerator(reg, reg_list, 0)
.Bind(&after_suspend)
.RestoreGeneratorState(reg)
.ResumeGenerator(reg, reg, reg_list);
}
// Intrinsics handled by the interpreter.
builder.CallRuntime(Runtime::kInlineIsArray, reg_list);