Commit 5cef3ddd authored by Leszek Swirski's avatar Leszek Swirski Committed by Commit Bot

[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/857463Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Reviewed-by: 's avatarAleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50748}
parent 9d7c40ea
...@@ -1025,12 +1025,15 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { ...@@ -1025,12 +1025,15 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
MemOperand(fp, InterpreterFrameConstants::kBytecodeOffsetFromFp)); MemOperand(fp, InterpreterFrameConstants::kBytecodeOffsetFromFp));
__ SmiUntag(kInterpreterBytecodeOffsetRegister); __ SmiUntag(kInterpreterBytecodeOffsetRegister);
// Check if we should return. // Check if we should return by testing for one of the returning bytecodes.
Label do_return; Label do_return;
__ ldrb(r1, MemOperand(kInterpreterBytecodeArrayRegister, __ ldrb(r1, MemOperand(kInterpreterBytecodeArrayRegister,
kInterpreterBytecodeOffsetRegister)); 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); __ b(&do_return, eq);
RETURN_BYTECODE_LIST(JUMP_IF_EQUAL)
#undef JUMP_IF_EQUAL
// Advance to the next bytecode and dispatch. // Advance to the next bytecode and dispatch.
AdvanceBytecodeOffset(masm, kInterpreterBytecodeArrayRegister, AdvanceBytecodeOffset(masm, kInterpreterBytecodeArrayRegister,
......
...@@ -1118,12 +1118,15 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { ...@@ -1118,12 +1118,15 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
MemOperand(fp, InterpreterFrameConstants::kBytecodeOffsetFromFp)); MemOperand(fp, InterpreterFrameConstants::kBytecodeOffsetFromFp));
__ SmiUntag(kInterpreterBytecodeOffsetRegister); __ SmiUntag(kInterpreterBytecodeOffsetRegister);
// Check if we should return. // Check if we should return by testing for one of the returning bytecodes.
Label do_return; Label do_return;
__ Ldrb(x1, MemOperand(kInterpreterBytecodeArrayRegister, __ Ldrb(x1, MemOperand(kInterpreterBytecodeArrayRegister,
kInterpreterBytecodeOffsetRegister)); 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); __ B(&do_return, eq);
RETURN_BYTECODE_LIST(JUMP_IF_EQUAL)
#undef JUMP_IF_EQUAL
// Advance to the next bytecode and dispatch. // Advance to the next bytecode and dispatch.
AdvanceBytecodeOffset(masm, kInterpreterBytecodeArrayRegister, AdvanceBytecodeOffset(masm, kInterpreterBytecodeArrayRegister,
......
...@@ -946,12 +946,15 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { ...@@ -946,12 +946,15 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
Operand(ebp, InterpreterFrameConstants::kBytecodeOffsetFromFp)); Operand(ebp, InterpreterFrameConstants::kBytecodeOffsetFromFp));
__ SmiUntag(kInterpreterBytecodeOffsetRegister); __ SmiUntag(kInterpreterBytecodeOffsetRegister);
// Check if we should return. // Check if we should return by testing for one of the returning bytecodes.
Label do_return; Label do_return;
__ movzx_b(ebx, Operand(kInterpreterBytecodeArrayRegister, __ movzx_b(ebx, Operand(kInterpreterBytecodeArrayRegister,
kInterpreterBytecodeOffsetRegister, times_1, 0)); 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); __ j(equal, &do_return, Label::kNear);
RETURN_BYTECODE_LIST(JUMP_IF_EQUAL)
#undef JUMP_IF_EQUAL
// Advance to the next bytecode and dispatch. // Advance to the next bytecode and dispatch.
AdvanceBytecodeOffset(masm, kInterpreterBytecodeArrayRegister, AdvanceBytecodeOffset(masm, kInterpreterBytecodeArrayRegister,
......
...@@ -1008,13 +1008,16 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { ...@@ -1008,13 +1008,16 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
MemOperand(fp, InterpreterFrameConstants::kBytecodeOffsetFromFp)); MemOperand(fp, InterpreterFrameConstants::kBytecodeOffsetFromFp));
__ SmiUntag(kInterpreterBytecodeOffsetRegister); __ SmiUntag(kInterpreterBytecodeOffsetRegister);
// Check if we should return. // Check if we should return by testing for one of the returning bytecodes.
Label do_return; Label do_return;
__ Addu(a1, kInterpreterBytecodeArrayRegister, __ Addu(a1, kInterpreterBytecodeArrayRegister,
kInterpreterBytecodeOffsetRegister); kInterpreterBytecodeOffsetRegister);
__ lbu(a1, MemOperand(a1)); __ lbu(a1, MemOperand(a1));
__ Branch(&do_return, eq, a1, #define JUMP_IF_EQUAL(NAME) \
Operand(static_cast<int>(interpreter::Bytecode::kReturn))); __ 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. // Advance to the next bytecode and dispatch.
AdvanceBytecodeOffset(masm, kInterpreterBytecodeArrayRegister, AdvanceBytecodeOffset(masm, kInterpreterBytecodeArrayRegister,
......
...@@ -1008,13 +1008,16 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { ...@@ -1008,13 +1008,16 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
MemOperand(fp, InterpreterFrameConstants::kBytecodeOffsetFromFp)); MemOperand(fp, InterpreterFrameConstants::kBytecodeOffsetFromFp));
__ SmiUntag(kInterpreterBytecodeOffsetRegister); __ SmiUntag(kInterpreterBytecodeOffsetRegister);
// Check if we should return. // Check if we should return by testing for one of the returning bytecodes.
Label do_return; Label do_return;
__ Daddu(a1, kInterpreterBytecodeArrayRegister, __ Daddu(a1, kInterpreterBytecodeArrayRegister,
kInterpreterBytecodeOffsetRegister); kInterpreterBytecodeOffsetRegister);
__ Lbu(a1, MemOperand(a1)); __ Lbu(a1, MemOperand(a1));
__ Branch(&do_return, eq, a1, #define JUMP_IF_EQUAL(NAME) \
Operand(static_cast<int>(interpreter::Bytecode::kReturn))); __ 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. // Advance to the next bytecode and dispatch.
AdvanceBytecodeOffset(masm, kInterpreterBytecodeArrayRegister, AdvanceBytecodeOffset(masm, kInterpreterBytecodeArrayRegister,
......
...@@ -1018,12 +1018,15 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { ...@@ -1018,12 +1018,15 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
__ SmiToInteger32(kInterpreterBytecodeOffsetRegister, __ SmiToInteger32(kInterpreterBytecodeOffsetRegister,
kInterpreterBytecodeOffsetRegister); kInterpreterBytecodeOffsetRegister);
// Check if we should return. // Check if we should return by testing for one of the returning bytecodes.
Label do_return; Label do_return;
__ movzxbp(rbx, Operand(kInterpreterBytecodeArrayRegister, __ movzxbp(rbx, Operand(kInterpreterBytecodeArrayRegister,
kInterpreterBytecodeOffsetRegister, times_1, 0)); 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); __ j(equal, &do_return, Label::kNear);
RETURN_BYTECODE_LIST(JUMP_IF_EQUAL)
#undef JUMP_IF_EQUAL
// Advance to the next bytecode and dispatch. // Advance to the next bytecode and dispatch.
AdvanceBytecodeOffset(masm, kInterpreterBytecodeArrayRegister, AdvanceBytecodeOffset(masm, kInterpreterBytecodeArrayRegister,
......
...@@ -2591,15 +2591,19 @@ void BytecodeGraphBuilder::VisitSetPendingMessage() { ...@@ -2591,15 +2591,19 @@ void BytecodeGraphBuilder::VisitSetPendingMessage() {
environment()->BindAccumulator(previous_message); environment()->BindAccumulator(previous_message);
} }
void BytecodeGraphBuilder::VisitReturn() { void BytecodeGraphBuilder::BuildReturn(const BytecodeLivenessState* liveness) {
BuildLoopExitsForFunctionExit(bytecode_analysis()->GetInLivenessFor( BuildLoopExitsForFunctionExit(liveness);
bytecode_iterator().current_offset()));
Node* pop_node = jsgraph()->ZeroConstant(); Node* pop_node = jsgraph()->ZeroConstant();
Node* control = Node* control =
NewNode(common()->Return(), pop_node, environment()->LookupAccumulator()); NewNode(common()->Return(), pop_node, environment()->LookupAccumulator());
MergeControlToLeaveFunction(control); MergeControlToLeaveFunction(control);
} }
void BytecodeGraphBuilder::VisitReturn() {
BuildReturn(bytecode_analysis()->GetInLivenessFor(
bytecode_iterator().current_offset()));
}
void BytecodeGraphBuilder::VisitDebugger() { void BytecodeGraphBuilder::VisitDebugger() {
PrepareEagerCheckpoint(); PrepareEagerCheckpoint();
Node* call = NewNode(javascript()->Debugger()); Node* call = NewNode(javascript()->Debugger());
...@@ -2727,6 +2731,11 @@ void BytecodeGraphBuilder::VisitSuspendGenerator() { ...@@ -2727,6 +2731,11 @@ void BytecodeGraphBuilder::VisitSuspendGenerator() {
MakeNode(javascript()->GeneratorStore(register_count), value_input_count, MakeNode(javascript()->GeneratorStore(register_count), value_input_count,
value_inputs, false); 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() { void BytecodeGraphBuilder::VisitRestoreGeneratorState() {
......
...@@ -268,6 +268,9 @@ class BytecodeGraphBuilder { ...@@ -268,6 +268,9 @@ class BytecodeGraphBuilder {
void BuildLoopExitsUntilLoop(int loop_offset, void BuildLoopExitsUntilLoop(int loop_offset,
const BytecodeLivenessState* liveness); 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. // Simulates entry and exit of exception handlers.
void ExitThenEnterExceptionHandlers(int current_offset); void ExitThenEnterExceptionHandlers(int current_offset);
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include "src/frames-inl.h" #include "src/frames-inl.h"
#include "src/global-handles.h" #include "src/global-handles.h"
#include "src/globals.h" #include "src/globals.h"
#include "src/interpreter/bytecode-array-accessor.h"
#include "src/interpreter/interpreter.h" #include "src/interpreter/interpreter.h"
#include "src/isolate-inl.h" #include "src/isolate-inl.h"
#include "src/log.h" #include "src/log.h"
...@@ -81,6 +82,18 @@ void BreakLocation::AllAtCurrentStatement( ...@@ -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, int BreakLocation::BreakIndexFromCodeOffset(Handle<DebugInfo> debug_info,
Handle<AbstractCode> abstract_code, Handle<AbstractCode> abstract_code,
int offset) { int offset) {
...@@ -120,10 +133,12 @@ debug::BreakLocationType BreakLocation::type() const { ...@@ -120,10 +133,12 @@ debug::BreakLocationType BreakLocation::type() const {
return debug::kCallBreakLocation; return debug::kCallBreakLocation;
case DEBUG_BREAK_SLOT_AT_RETURN: case DEBUG_BREAK_SLOT_AT_RETURN:
return debug::kReturnBreakLocation; return debug::kReturnBreakLocation;
// Externally, suspend breaks should look like normal breaks.
case DEBUG_BREAK_SLOT_AT_SUSPEND:
default: default:
return debug::kCommonBreakLocation; return debug::kCommonBreakLocation;
} }
return debug::kCommonBreakLocation;
} }
BreakIterator::BreakIterator(Handle<DebugInfo> debug_info) BreakIterator::BreakIterator(Handle<DebugInfo> debug_info)
...@@ -181,10 +196,18 @@ DebugBreakType BreakIterator::GetDebugBreakType() { ...@@ -181,10 +196,18 @@ DebugBreakType BreakIterator::GetDebugBreakType() {
interpreter::Bytecode bytecode = interpreter::Bytecode bytecode =
interpreter::Bytecodes::FromByte(bytecode_array->get(code_offset())); 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) { if (bytecode == interpreter::Bytecode::kDebugger) {
return DEBUGGER_STATEMENT; return DEBUGGER_STATEMENT;
} else if (bytecode == interpreter::Bytecode::kReturn) { } else if (bytecode == interpreter::Bytecode::kReturn) {
return DEBUG_BREAK_SLOT_AT_RETURN; return DEBUG_BREAK_SLOT_AT_RETURN;
} else if (bytecode == interpreter::Bytecode::kSuspendGenerator) {
return DEBUG_BREAK_SLOT_AT_SUSPEND;
} else if (interpreter::Bytecodes::IsCallOrConstruct(bytecode)) { } else if (interpreter::Bytecodes::IsCallOrConstruct(bytecode)) {
return DEBUG_BREAK_SLOT_AT_CALL; return DEBUG_BREAK_SLOT_AT_CALL;
} else if (source_position_iterator_.is_statement()) { } else if (source_position_iterator_.is_statement()) {
...@@ -225,7 +248,25 @@ void BreakIterator::ClearDebugBreak() { ...@@ -225,7 +248,25 @@ void BreakIterator::ClearDebugBreak() {
BreakLocation BreakIterator::GetBreakLocation() { BreakLocation BreakIterator::GetBreakLocation() {
Handle<AbstractCode> code( Handle<AbstractCode> code(
AbstractCode::cast(debug_info_->DebugBytecodeArray())); 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) { ...@@ -390,7 +431,7 @@ void Debug::Break(JavaScriptFrame* frame) {
// StepOut at not return position was requested and return break locations // StepOut at not return position was requested and return break locations
// were flooded with one shots. // were flooded with one shots.
if (thread_local_.fast_forward_to_return_) { if (thread_local_.fast_forward_to_return_) {
DCHECK(location.IsReturn()); DCHECK(location.IsReturnOrSuspend());
// We have to ignore recursive calls to function. // We have to ignore recursive calls to function.
if (current_frame_count > target_frame_count) return; if (current_frame_count > target_frame_count) return;
ClearStepping(); ClearStepping();
...@@ -412,6 +453,15 @@ void Debug::Break(JavaScriptFrame* frame) { ...@@ -412,6 +453,15 @@ void Debug::Break(JavaScriptFrame* frame) {
if (current_frame_count > target_frame_count) return; if (current_frame_count > target_frame_count) return;
// Fall through. // Fall through.
case StepIn: { 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); FrameSummary summary = FrameSummary::GetTop(frame);
step_break = step_break || location.IsReturn() || step_break = step_break || location.IsReturn() ||
current_frame_count != last_frame_count || current_frame_count != last_frame_count ||
...@@ -707,7 +757,7 @@ void Debug::FloodWithOneShot(Handle<SharedFunctionInfo> shared, ...@@ -707,7 +757,7 @@ void Debug::FloodWithOneShot(Handle<SharedFunctionInfo> shared,
// Flood the function with break points. // Flood the function with break points.
DCHECK(debug_info->HasDebugBytecodeArray()); DCHECK(debug_info->HasDebugBytecodeArray());
for (BreakIterator it(debug_info); !it.Done(); it.Next()) { 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(); it.SetDebugBreak();
} }
} }
...@@ -895,9 +945,9 @@ void Debug::PrepareStep(StepAction step_action) { ...@@ -895,9 +945,9 @@ void Debug::PrepareStep(StepAction step_action) {
BreakLocation location = BreakLocation::FromFrame(debug_info, js_frame); BreakLocation location = BreakLocation::FromFrame(debug_info, js_frame);
// Any step at a return is a step-out and we need to schedule DebugOnFunction // Any step at a return is a step-out, and a step-out at a suspend behaves
// call callback. // like a return.
if (location.IsReturn()) { if (location.IsReturn() || (location.IsSuspend() && step_action == StepOut)) {
// On StepOut we'll ignore our further calls to current function in // On StepOut we'll ignore our further calls to current function in
// PrepareStepIn callback. // PrepareStepIn callback.
if (last_step_action() == StepOut) { if (last_step_action() == StepOut) {
...@@ -906,6 +956,8 @@ void Debug::PrepareStep(StepAction step_action) { ...@@ -906,6 +956,8 @@ void Debug::PrepareStep(StepAction step_action) {
step_action = StepOut; step_action = StepOut;
thread_local_.last_step_action_ = StepIn; thread_local_.last_step_action_ = StepIn;
} }
// We need to schedule DebugOnFunction call callback
UpdateHookOnFunctionCall(); UpdateHookOnFunctionCall();
// A step-next in blackboxed function is a step-out. // A step-next in blackboxed function is a step-out.
...@@ -926,7 +978,7 @@ void Debug::PrepareStep(StepAction step_action) { ...@@ -926,7 +978,7 @@ void Debug::PrepareStep(StepAction step_action) {
// Clear last position info. For stepping out it does not matter. // Clear last position info. For stepping out it does not matter.
thread_local_.last_statement_position_ = kNoSourcePosition; thread_local_.last_statement_position_ = kNoSourcePosition;
thread_local_.last_frame_count_ = -1; 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 // At not return position we flood return positions with one shots and
// will repeat StepOut automatically at next break. // will repeat StepOut automatically at next break.
thread_local_.target_frame_count_ = current_frame_count; thread_local_.target_frame_count_ = current_frame_count;
...@@ -1184,19 +1236,6 @@ bool Debug::GetPossibleBreakpoints(Handle<Script> script, int start_position, ...@@ -1184,19 +1236,6 @@ bool Debug::GetPossibleBreakpoints(Handle<Script> script, int start_position,
UNREACHABLE(); 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 { class SharedFunctionInfoFinder {
public: public:
explicit SharedFunctionInfoFinder(int target_position) explicit SharedFunctionInfoFinder(int target_position)
......
...@@ -51,13 +51,13 @@ enum ExceptionBreakType { ...@@ -51,13 +51,13 @@ enum ExceptionBreakType {
BreakUncaughtException = 1 BreakUncaughtException = 1
}; };
enum DebugBreakType { enum DebugBreakType {
NOT_DEBUG_BREAK, NOT_DEBUG_BREAK,
DEBUGGER_STATEMENT, DEBUGGER_STATEMENT,
DEBUG_BREAK_SLOT, DEBUG_BREAK_SLOT,
DEBUG_BREAK_SLOT_AT_CALL, DEBUG_BREAK_SLOT_AT_CALL,
DEBUG_BREAK_SLOT_AT_RETURN, DEBUG_BREAK_SLOT_AT_RETURN,
DEBUG_BREAK_SLOT_AT_SUSPEND,
}; };
enum IgnoreBreakMode { enum IgnoreBreakMode {
...@@ -74,7 +74,11 @@ class BreakLocation { ...@@ -74,7 +74,11 @@ class BreakLocation {
JavaScriptFrame* frame, JavaScriptFrame* frame,
std::vector<BreakLocation>* result_out); 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 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 IsCall() const { return type_ == DEBUG_BREAK_SLOT_AT_CALL; }
inline bool IsDebugBreakSlot() const { return type_ >= DEBUG_BREAK_SLOT; } inline bool IsDebugBreakSlot() const { return type_ >= DEBUG_BREAK_SLOT; }
inline bool IsDebuggerStatement() const { inline bool IsDebuggerStatement() const {
...@@ -87,13 +91,17 @@ class BreakLocation { ...@@ -87,13 +91,17 @@ class BreakLocation {
debug::BreakLocationType type() const; debug::BreakLocationType type() const;
JSGeneratorObject* GetGeneratorObjectForSuspendedFrame(
JavaScriptFrame* frame) const;
private: private:
BreakLocation(Handle<AbstractCode> abstract_code, DebugBreakType type, 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), : abstract_code_(abstract_code),
code_offset_(code_offset), code_offset_(code_offset),
type_(type), type_(type),
position_(position) { position_(position),
generator_obj_reg_index_(generator_obj_reg_index) {
DCHECK_NE(NOT_DEBUG_BREAK, type_); DCHECK_NE(NOT_DEBUG_BREAK, type_);
} }
...@@ -108,6 +116,7 @@ class BreakLocation { ...@@ -108,6 +116,7 @@ class BreakLocation {
int code_offset_; int code_offset_;
DebugBreakType type_; DebugBreakType type_;
int position_; int position_;
int generator_obj_reg_index_;
friend class BreakIterator; friend class BreakIterator;
}; };
...@@ -256,8 +265,6 @@ class Debug { ...@@ -256,8 +265,6 @@ class Debug {
int end_position, bool restrict_to_function, int end_position, bool restrict_to_function,
std::vector<BreakLocation>* locations); std::vector<BreakLocation>* locations);
void RecordGenerator(Handle<JSGeneratorObject> generator_object);
void RunPromiseHook(PromiseHookType hook_type, Handle<JSPromise> promise, void RunPromiseHook(PromiseHookType hook_type, Handle<JSPromise> promise,
Handle<Object> parent); Handle<Object> parent);
......
...@@ -890,6 +890,11 @@ class InterpretedFrame : public JavaScriptFrame { ...@@ -890,6 +890,11 @@ class InterpretedFrame : public JavaScriptFrame {
static int GetBytecodeOffset(Address fp); static int GetBytecodeOffset(Address fp);
static InterpretedFrame* cast(StackFrame* frame) {
DCHECK(frame->is_interpreted());
return static_cast<InterpretedFrame*>(frame);
}
protected: protected:
inline explicit InterpretedFrame(StackFrameIteratorBase* iterator); inline explicit InterpretedFrame(StackFrameIteratorBase* iterator);
......
...@@ -158,6 +158,7 @@ void BytecodeArrayWriter::UpdateExitSeenInBlock(Bytecode bytecode) { ...@@ -158,6 +158,7 @@ void BytecodeArrayWriter::UpdateExitSeenInBlock(Bytecode bytecode) {
case Bytecode::kAbort: case Bytecode::kAbort:
case Bytecode::kJump: case Bytecode::kJump:
case Bytecode::kJumpConstant: case Bytecode::kJumpConstant:
case Bytecode::kSuspendGenerator:
exit_seen_in_block_ = true; exit_seen_in_block_ = true;
break; break;
default: default:
......
...@@ -2866,15 +2866,15 @@ void BytecodeGenerator::VisitCompoundAssignment(CompoundAssignment* expr) { ...@@ -2866,15 +2866,15 @@ void BytecodeGenerator::VisitCompoundAssignment(CompoundAssignment* expr) {
// Suspends the generator to resume at |suspend_id|, with output stored in the // 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. When the generator is resumed, the sent value is loaded in the
// accumulator. // accumulator.
void BytecodeGenerator::BuildSuspendPoint(int suspend_id) { void BytecodeGenerator::BuildSuspendPoint(int suspend_id,
Expression* suspend_expr) {
RegisterList registers = register_allocator()->AllLiveRegisters(); 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()->SuspendGenerator(generator_object(), registers, suspend_id);
builder()->SetReturnPosition(kNoSourcePosition, info()->literal());
builder()->Return(); // Hard return (ignore any finally blocks).
// Upon resume, we continue here. // Upon resume, we continue here.
builder()->Bind(generator_jump_table_, suspend_id); builder()->Bind(generator_jump_table_, suspend_id);
...@@ -2914,7 +2914,7 @@ void BytecodeGenerator::VisitYield(Yield* expr) { ...@@ -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 // At this point, the generator has been resumed, with the received value in
// the accumulator. // the accumulator.
...@@ -3110,7 +3110,8 @@ void BytecodeGenerator::VisitYieldStar(YieldStar* expr) { ...@@ -3110,7 +3110,8 @@ void BytecodeGenerator::VisitYieldStar(YieldStar* expr) {
// If there is no "throw" method, perform IteratorClose, and finally // If there is no "throw" method, perform IteratorClose, and finally
// throw a TypeError. // throw a TypeError.
no_throw_method.Bind(builder()); 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); builder()->CallRuntime(Runtime::kThrowThrowMethodMissing);
} }
...@@ -3119,7 +3120,7 @@ void BytecodeGenerator::VisitYieldStar(YieldStar* expr) { ...@@ -3119,7 +3120,7 @@ void BytecodeGenerator::VisitYieldStar(YieldStar* expr) {
if (iterator_type == IteratorType::kAsync) { if (iterator_type == IteratorType::kAsync) {
// Await the result of the method invocation. // 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. // Check that output is an object.
...@@ -3159,7 +3160,7 @@ void BytecodeGenerator::VisitYieldStar(YieldStar* expr) { ...@@ -3159,7 +3160,7 @@ void BytecodeGenerator::VisitYieldStar(YieldStar* expr) {
.CallRuntime(Runtime::kInlineAsyncGeneratorYield, args); .CallRuntime(Runtime::kInlineAsyncGeneratorYield, args);
} }
BuildSuspendPoint(expr->suspend_id()); BuildSuspendPoint(expr->suspend_id(), expr);
builder()->StoreAccumulatorInRegister(input); builder()->StoreAccumulatorInRegister(input);
builder() builder()
->CallRuntime(Runtime::kInlineGeneratorGetResumeMode, ->CallRuntime(Runtime::kInlineGeneratorGetResumeMode,
...@@ -3195,7 +3196,7 @@ void BytecodeGenerator::VisitYieldStar(YieldStar* expr) { ...@@ -3195,7 +3196,7 @@ void BytecodeGenerator::VisitYieldStar(YieldStar* expr) {
builder()->LoadAccumulatorWithRegister(output_value); 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 // Rather than HandlerTable::UNCAUGHT, async functions use
// HandlerTable::ASYNC_AWAIT to communicate that top-level exceptions are // HandlerTable::ASYNC_AWAIT to communicate that top-level exceptions are
// transformed into promise rejections. This is necessary to prevent emitting // transformed into promise rejections. This is necessary to prevent emitting
...@@ -3239,7 +3240,7 @@ void BytecodeGenerator::BuildAwait(int suspend_id) { ...@@ -3239,7 +3240,7 @@ void BytecodeGenerator::BuildAwait(int suspend_id) {
builder()->CallJSRuntime(await_builtin_context_index, args); builder()->CallJSRuntime(await_builtin_context_index, args);
} }
BuildSuspendPoint(suspend_id); BuildSuspendPoint(suspend_id, await_expr);
Register input = register_allocator()->NewRegister(); Register input = register_allocator()->NewRegister();
Register resume_mode = register_allocator()->NewRegister(); Register resume_mode = register_allocator()->NewRegister();
...@@ -3267,7 +3268,7 @@ void BytecodeGenerator::BuildAwait(int suspend_id) { ...@@ -3267,7 +3268,7 @@ void BytecodeGenerator::BuildAwait(int suspend_id) {
void BytecodeGenerator::VisitAwait(Await* expr) { void BytecodeGenerator::VisitAwait(Await* expr) {
builder()->SetExpressionPosition(expr); builder()->SetExpressionPosition(expr);
VisitForAccumulatorValue(expr->expression()); VisitForAccumulatorValue(expr->expression());
BuildAwait(expr->suspend_id()); BuildAwait(expr->suspend_id(), expr);
BuildIncrementBlockCoverageCounterIfEnabled(expr, BuildIncrementBlockCoverageCounterIfEnabled(expr,
SourceRangeKind::kContinuation); SourceRangeKind::kContinuation);
} }
...@@ -4154,7 +4155,7 @@ void BytecodeGenerator::BuildCallIteratorMethod(Register iterator, ...@@ -4154,7 +4155,7 @@ void BytecodeGenerator::BuildCallIteratorMethod(Register iterator,
} }
void BytecodeGenerator::BuildIteratorClose(const IteratorRecord& iterator, void BytecodeGenerator::BuildIteratorClose(const IteratorRecord& iterator,
int suspend_id) { int suspend_id, Expression* expr) {
RegisterAllocationScope register_scope(this); RegisterAllocationScope register_scope(this);
BytecodeLabels done(zone()); BytecodeLabels done(zone());
BytecodeLabel if_called; BytecodeLabel if_called;
...@@ -4166,7 +4167,8 @@ void BytecodeGenerator::BuildIteratorClose(const IteratorRecord& iterator, ...@@ -4166,7 +4167,8 @@ void BytecodeGenerator::BuildIteratorClose(const IteratorRecord& iterator,
if (iterator.type() == IteratorType::kAsync) { if (iterator.type() == IteratorType::kAsync) {
DCHECK_GE(suspend_id, 0); DCHECK_GE(suspend_id, 0);
BuildAwait(suspend_id); DCHECK_NOT_NULL(expr);
BuildAwait(suspend_id, expr);
} }
builder()->JumpIfJSReceiver(done.New()); builder()->JumpIfJSReceiver(done.New());
......
...@@ -146,9 +146,9 @@ class BytecodeGenerator final : public AstVisitor<BytecodeGenerator> { ...@@ -146,9 +146,9 @@ class BytecodeGenerator final : public AstVisitor<BytecodeGenerator> {
void BuildNewLocalWithContext(Scope* scope); void BuildNewLocalWithContext(Scope* scope);
void BuildGeneratorPrologue(); 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); void BuildGetIterator(Expression* iterable, IteratorType hint);
...@@ -164,7 +164,8 @@ class BytecodeGenerator final : public AstVisitor<BytecodeGenerator> { ...@@ -164,7 +164,8 @@ class BytecodeGenerator final : public AstVisitor<BytecodeGenerator> {
IteratorRecord BuildGetIteratorRecord(Expression* iterable, IteratorRecord BuildGetIteratorRecord(Expression* iterable,
IteratorType hint); IteratorType hint);
void BuildIteratorNext(const IteratorRecord& iterator, Register next_result); 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, void BuildCallIteratorMethod(Register iterator, const AstRawString* method,
RegisterList receiver_and_args, RegisterList receiver_and_args,
BytecodeLabel* if_called, BytecodeLabel* if_called,
......
...@@ -315,7 +315,7 @@ namespace interpreter { ...@@ -315,7 +315,7 @@ namespace interpreter {
\ \
/* Generators */ \ /* Generators */ \
V(RestoreGeneratorState, AccumulatorUse::kWrite, OperandType::kReg) \ V(RestoreGeneratorState, AccumulatorUse::kWrite, OperandType::kReg) \
V(SuspendGenerator, AccumulatorUse::kNone, OperandType::kReg, \ V(SuspendGenerator, AccumulatorUse::kRead, OperandType::kReg, \
OperandType::kRegList, OperandType::kRegCount, OperandType::kUImm) \ OperandType::kRegList, OperandType::kRegCount, OperandType::kUImm) \
V(ResumeGenerator, AccumulatorUse::kWrite, OperandType::kReg, \ V(ResumeGenerator, AccumulatorUse::kWrite, OperandType::kReg, \
OperandType::kRegOut, OperandType::kRegOutList, OperandType::kRegCount) \ OperandType::kRegOut, OperandType::kRegOutList, OperandType::kRegCount) \
...@@ -432,6 +432,10 @@ namespace interpreter { ...@@ -432,6 +432,10 @@ namespace interpreter {
JUMP_FORWARD_BYTECODE_LIST(V) \ JUMP_FORWARD_BYTECODE_LIST(V) \
V(JumpLoop) V(JumpLoop)
#define RETURN_BYTECODE_LIST(V) \
V(Return) \
V(SuspendGenerator)
// Enumeration of interpreter bytecodes. // Enumeration of interpreter bytecodes.
enum class Bytecode : uint8_t { enum class Bytecode : uint8_t {
#define DECLARE_BYTECODE(Name, ...) k##Name, #define DECLARE_BYTECODE(Name, ...) k##Name,
...@@ -613,11 +617,6 @@ class V8_EXPORT_PRIVATE Bytecodes final : public AllStatic { ...@@ -613,11 +617,6 @@ class V8_EXPORT_PRIVATE Bytecodes final : public AllStatic {
bytecode <= Bytecode::kJumpIfJSReceiver; 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, // Return true if |bytecode| is a jump without effects,
// e.g. any jump excluding those that include type coercion like // e.g. any jump excluding those that include type coercion like
// JumpIfTrueToBoolean. // JumpIfTrueToBoolean.
...@@ -681,9 +680,16 @@ class V8_EXPORT_PRIVATE Bytecodes final : public AllStatic { ...@@ -681,9 +680,16 @@ class V8_EXPORT_PRIVATE Bytecodes final : public AllStatic {
return true; 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. // Returns the number of values which |bytecode| returns.
static constexpr size_t ReturnCount(Bytecode bytecode) { 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|. // Returns the number of operands expected by |bytecode|.
......
...@@ -59,7 +59,7 @@ InterpreterAssembler::InterpreterAssembler(CodeAssemblerState* state, ...@@ -59,7 +59,7 @@ InterpreterAssembler::InterpreterAssembler(CodeAssemblerState* state,
// Save the bytecode offset immediately if bytecode will make a call along the // Save the bytecode offset immediately if bytecode will make a call along the
// critical path, or it is a return bytecode. // critical path, or it is a return bytecode.
if (Bytecodes::MakesCallAlongCriticalPath(bytecode) || if (Bytecodes::MakesCallAlongCriticalPath(bytecode) ||
bytecode_ == Bytecode::kReturn) { Bytecodes::Returns(bytecode)) {
SaveBytecodeOffset(); SaveBytecodeOffset();
} }
} }
......
...@@ -3078,22 +3078,10 @@ IGNITION_HANDLER(Illegal, InterpreterAssembler) { ...@@ -3078,22 +3078,10 @@ IGNITION_HANDLER(Illegal, InterpreterAssembler) {
// //
// Exports the register file and stores it into the generator. Also stores the // Exports the register file and stores it into the generator. Also stores the
// current context, |suspend_id|, and the current bytecode offset (for debugging // 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) { IGNITION_HANDLER(SuspendGenerator, InterpreterAssembler) {
Node* generator_reg = BytecodeOperandReg(0); Node* generator_reg = BytecodeOperandReg(0);
Node* generator = LoadRegister(generator_reg); 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 = Node* array =
LoadObjectField(generator, JSGeneratorObject::kRegisterFileOffset); LoadObjectField(generator, JSGeneratorObject::kRegisterFileOffset);
Node* context = GetContext(); Node* context = GetContext();
...@@ -3115,14 +3103,7 @@ IGNITION_HANDLER(SuspendGenerator, InterpreterAssembler) { ...@@ -3115,14 +3103,7 @@ IGNITION_HANDLER(SuspendGenerator, InterpreterAssembler) {
Node* offset = SmiTag(BytecodeOffset()); Node* offset = SmiTag(BytecodeOffset());
StoreObjectField(generator, JSGeneratorObject::kInputOrDebugPosOffset, StoreObjectField(generator, JSGeneratorObject::kInputOrDebugPosOffset,
offset); offset);
Dispatch(); Return(GetAccumulator());
BIND(&if_stepping);
{
Node* context = GetContext();
CallRuntime(Runtime::kDebugRecordGenerator, context, generator);
Goto(&ok);
}
} }
// RestoreGeneratorState <generator> // RestoreGeneratorState <generator>
......
...@@ -53,10 +53,11 @@ RUNTIME_FUNCTION_RETURN_PAIR(Runtime_DebugBreakOnBytecode) { ...@@ -53,10 +53,11 @@ RUNTIME_FUNCTION_RETURN_PAIR(Runtime_DebugBreakOnBytecode) {
BytecodeArray* bytecode_array = shared->bytecode_array(); BytecodeArray* bytecode_array = shared->bytecode_array();
int bytecode_offset = interpreted_frame->GetBytecodeOffset(); int bytecode_offset = interpreted_frame->GetBytecodeOffset();
Bytecode bytecode = Bytecodes::FromByte(bytecode_array->get(bytecode_offset)); Bytecode bytecode = Bytecodes::FromByte(bytecode_array->get(bytecode_offset));
if (bytecode == Bytecode::kReturn) { if (Bytecodes::Returns(bytecode)) {
// If we are returning, reset the bytecode array on the interpreted stack // If we are returning (or suspending), reset the bytecode array on the
// frame to the non-debug variant so that the interpreter entry trampoline // interpreted stack frame to the non-debug variant so that the interpreter
// sees the return bytecode rather than the DebugBreak. // entry trampoline sees the return/suspend bytecode rather than the
// DebugBreak.
interpreted_frame->PatchBytecodeArray(bytecode_array); interpreted_frame->PatchBytecodeArray(bytecode_array);
} }
...@@ -1836,15 +1837,6 @@ RUNTIME_FUNCTION(Runtime_DebugPrepareStepInSuspendedGenerator) { ...@@ -1836,15 +1837,6 @@ RUNTIME_FUNCTION(Runtime_DebugPrepareStepInSuspendedGenerator) {
return isolate->heap()->undefined_value(); 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) { RUNTIME_FUNCTION(Runtime_DebugPushPromise) {
DCHECK_EQ(1, args.length()); DCHECK_EQ(1, args.length());
HandleScope scope(isolate); HandleScope scope(isolate);
......
...@@ -186,7 +186,6 @@ namespace internal { ...@@ -186,7 +186,6 @@ namespace internal {
F(ScriptSourceLine, 2, 1) \ F(ScriptSourceLine, 2, 1) \
F(DebugOnFunctionCall, 1, 1) \ F(DebugOnFunctionCall, 1, 1) \
F(DebugPrepareStepInSuspendedGenerator, 0, 1) \ F(DebugPrepareStepInSuspendedGenerator, 0, 1) \
F(DebugRecordGenerator, 1, 1) \
F(DebugPushPromise, 1, 1) \ F(DebugPushPromise, 1, 1) \
F(DebugPopPromise, 0, 1) \ F(DebugPopPromise, 0, 1) \
F(DebugPromiseReject, 2, 1) \ F(DebugPromiseReject, 2, 1) \
......
...@@ -619,7 +619,7 @@ snippet: " ...@@ -619,7 +619,7 @@ snippet: "
" "
frame size: 20 frame size: 20
parameter count: 2 parameter count: 2
bytecode array length: 320 bytecode array length: 319
bytecodes: [ bytecodes: [
B(Ldar), R(3), B(Ldar), R(3),
B(JumpIfUndefined), U8(18), B(JumpIfUndefined), U8(18),
...@@ -641,7 +641,6 @@ bytecodes: [ ...@@ -641,7 +641,6 @@ bytecodes: [
B(Star), R(3), B(Star), R(3),
/* 11 E> */ B(StackCheck), /* 11 E> */ B(StackCheck),
/* 11 E> */ B(SuspendGenerator), R(3), R(0), U8(14), U8(0), /* 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(ResumeGenerator), R(3), R(12), R(0), U8(14),
B(Star), R(14), B(Star), R(14),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(3), U8(1), B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(3), U8(1),
...@@ -757,7 +756,7 @@ bytecodes: [ ...@@ -757,7 +756,7 @@ bytecodes: [
/* 55 S> */ B(Return), /* 55 S> */ B(Return),
] ]
constant pool: [ constant pool: [
Smi [37], Smi [36],
Smi [10], Smi [10],
Smi [7], Smi [7],
SYMBOL_TYPE, SYMBOL_TYPE,
...@@ -770,9 +769,9 @@ constant pool: [ ...@@ -770,9 +769,9 @@ constant pool: [
ONE_BYTE_INTERNALIZED_STRING_TYPE [""], ONE_BYTE_INTERNALIZED_STRING_TYPE [""],
] ]
handlers: [ handlers: [
[78, 196, 204], [77, 195, 203],
[81, 160, 162], [80, 159, 161],
[264, 274, 276], [263, 273, 275],
] ]
--- ---
...@@ -784,7 +783,7 @@ snippet: " ...@@ -784,7 +783,7 @@ snippet: "
" "
frame size: 19 frame size: 19
parameter count: 2 parameter count: 2
bytecode array length: 380 bytecode array length: 378
bytecodes: [ bytecodes: [
B(Ldar), R(2), B(Ldar), R(2),
B(JumpIfUndefined), U8(18), B(JumpIfUndefined), U8(18),
...@@ -806,7 +805,6 @@ bytecodes: [ ...@@ -806,7 +805,6 @@ bytecodes: [
B(Star), R(2), B(Star), R(2),
/* 11 E> */ B(StackCheck), /* 11 E> */ B(StackCheck),
/* 11 E> */ B(SuspendGenerator), R(2), R(0), U8(13), U8(0), /* 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(ResumeGenerator), R(2), R(11), R(0), U8(13),
B(Star), R(13), B(Star), R(13),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1), B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
...@@ -842,7 +840,7 @@ bytecodes: [ ...@@ -842,7 +840,7 @@ bytecodes: [
B(JumpIfFalse), U8(7), B(JumpIfFalse), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(6), U8(1), B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(6), U8(1),
B(LdaNamedProperty), R(6), U8(7), U8(8), 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(LdaNamedProperty), R(6), U8(8), U8(10),
B(Star), R(8), B(Star), R(8),
B(LdaSmi), I8(2), B(LdaSmi), I8(2),
...@@ -854,8 +852,7 @@ bytecodes: [ ...@@ -854,8 +852,7 @@ bytecodes: [
B(Star), R(18), B(Star), R(18),
B(Mov), R(0), R(17), B(Mov), R(0), R(17),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(17), U8(2), B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(17), U8(2),
B(SuspendGenerator), R(2), R(0), U8(17), U8(1), /* 40 E> */ B(SuspendGenerator), R(2), R(0), U8(17), U8(1),
/* 49 S> */ B(Return),
B(ResumeGenerator), R(2), R(11), R(0), U8(17), B(ResumeGenerator), R(2), R(11), R(0), U8(17),
B(Star), R(17), B(Star), R(17),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1), B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
...@@ -868,7 +865,7 @@ bytecodes: [ ...@@ -868,7 +865,7 @@ bytecodes: [
B(Jump), U8(58), B(Jump), U8(58),
B(LdaZero), B(LdaZero),
B(Star), R(7), B(Star), R(7),
B(JumpLoop), U8(100), I8(0), B(JumpLoop), U8(99), I8(0),
B(Jump), U8(36), B(Jump), U8(36),
B(Star), R(17), B(Star), R(17),
B(Ldar), R(closure), B(Ldar), R(closure),
...@@ -945,13 +942,13 @@ bytecodes: [ ...@@ -945,13 +942,13 @@ bytecodes: [
/* 49 S> */ B(Return), /* 49 S> */ B(Return),
] ]
constant pool: [ constant pool: [
Smi [37], Smi [36],
Smi [96], Smi [95],
Smi [10], Smi [10],
Smi [7], Smi [7],
SYMBOL_TYPE, SYMBOL_TYPE,
ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"], ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
Smi [69], Smi [68],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["done"], ONE_BYTE_INTERNALIZED_STRING_TYPE ["done"],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"], ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"],
Smi [15], Smi [15],
...@@ -964,9 +961,9 @@ constant pool: [ ...@@ -964,9 +961,9 @@ constant pool: [
Smi [9], Smi [9],
] ]
handlers: [ handlers: [
[78, 249, 257], [77, 247, 255],
[81, 213, 215], [80, 211, 213],
[318, 328, 330], [316, 326, 328],
] ]
--- ---
...@@ -1176,7 +1173,7 @@ snippet: " ...@@ -1176,7 +1173,7 @@ snippet: "
" "
frame size: 25 frame size: 25
parameter count: 2 parameter count: 2
bytecode array length: 459 bytecode array length: 458
bytecodes: [ bytecodes: [
B(Ldar), R(2), B(Ldar), R(2),
B(JumpIfUndefined), U8(18), B(JumpIfUndefined), U8(18),
...@@ -1228,7 +1225,7 @@ bytecodes: [ ...@@ -1228,7 +1225,7 @@ bytecodes: [
B(JumpIfFalse), U8(7), B(JumpIfFalse), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(6), U8(1), B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(6), U8(1),
B(LdaNamedProperty), R(6), U8(4), U8(8), 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(LdaNamedProperty), R(6), U8(5), U8(10),
B(Star), R(8), B(Star), R(8),
B(LdaSmi), I8(2), B(LdaSmi), I8(2),
...@@ -1240,8 +1237,7 @@ bytecodes: [ ...@@ -1240,8 +1237,7 @@ bytecodes: [
B(Mov), R(0), R(23), B(Mov), R(0), R(23),
B(Mov), R(11), R(24), B(Mov), R(11), R(24),
B(CallJSRuntime), U8(%async_function_await_uncaught), R(22), U8(3), B(CallJSRuntime), U8(%async_function_await_uncaught), R(22), U8(3),
B(SuspendGenerator), R(2), R(0), U8(22), U8(0), /* 45 E> */ B(SuspendGenerator), R(2), R(0), U8(22), U8(0),
/* 54 S> */ B(Return),
B(ResumeGenerator), R(2), R(12), R(0), U8(22), B(ResumeGenerator), R(2), R(12), R(0), U8(22),
B(Star), R(22), B(Star), R(22),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1), B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
...@@ -1253,7 +1249,7 @@ bytecodes: [ ...@@ -1253,7 +1249,7 @@ bytecodes: [
B(ReThrow), B(ReThrow),
B(LdaZero), B(LdaZero),
B(Star), R(7), B(Star), R(7),
B(JumpLoop), U8(98), I8(0), B(JumpLoop), U8(97), I8(0),
B(Jump), U8(40), B(Jump), U8(40),
B(Star), R(22), B(Star), R(22),
B(Ldar), R(closure), B(Ldar), R(closure),
...@@ -1382,7 +1378,7 @@ constant pool: [ ...@@ -1382,7 +1378,7 @@ constant pool: [
Smi [81], Smi [81],
SYMBOL_TYPE, SYMBOL_TYPE,
ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"], ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
Smi [72], Smi [71],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["done"], ONE_BYTE_INTERNALIZED_STRING_TYPE ["done"],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"], ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"],
ONE_BYTE_INTERNALIZED_STRING_TYPE [".catch"], ONE_BYTE_INTERNALIZED_STRING_TYPE [".catch"],
...@@ -1394,10 +1390,10 @@ constant pool: [ ...@@ -1394,10 +1390,10 @@ constant pool: [
Smi [9], Smi [9],
] ]
handlers: [ handlers: [
[54, 418, 426], [54, 417, 425],
[57, 376, 378], [57, 375, 377],
[63, 236, 244], [63, 235, 243],
[66, 196, 198], [66, 195, 197],
[304, 314, 316], [303, 313, 315],
] ]
...@@ -13,7 +13,7 @@ snippet: " ...@@ -13,7 +13,7 @@ snippet: "
" "
frame size: 4 frame size: 4
parameter count: 1 parameter count: 1
bytecode array length: 66 bytecode array length: 65
bytecodes: [ bytecodes: [
B(Ldar), R(0), B(Ldar), R(0),
B(JumpIfUndefined), U8(18), B(JumpIfUndefined), U8(18),
...@@ -31,7 +31,6 @@ bytecodes: [ ...@@ -31,7 +31,6 @@ bytecodes: [
B(Star), R(0), B(Star), R(0),
/* 11 E> */ B(StackCheck), /* 11 E> */ B(StackCheck),
/* 11 E> */ B(SuspendGenerator), R(0), R(0), U8(2), U8(0), /* 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(ResumeGenerator), R(0), R(1), R(0), U8(2),
B(Star), R(2), B(Star), R(2),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1), B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
...@@ -44,7 +43,7 @@ bytecodes: [ ...@@ -44,7 +43,7 @@ bytecodes: [
/* 16 S> */ B(Return), /* 16 S> */ B(Return),
] ]
constant pool: [ constant pool: [
Smi [29], Smi [28],
Smi [10], Smi [10],
Smi [7], Smi [7],
] ]
...@@ -58,7 +57,7 @@ snippet: " ...@@ -58,7 +57,7 @@ snippet: "
" "
frame size: 4 frame size: 4
parameter count: 1 parameter count: 1
bytecode array length: 104 bytecode array length: 102
bytecodes: [ bytecodes: [
B(Ldar), R(0), B(Ldar), R(0),
B(JumpIfUndefined), U8(18), B(JumpIfUndefined), U8(18),
...@@ -76,7 +75,6 @@ bytecodes: [ ...@@ -76,7 +75,6 @@ bytecodes: [
B(Star), R(0), B(Star), R(0),
/* 11 E> */ B(StackCheck), /* 11 E> */ B(StackCheck),
/* 11 E> */ B(SuspendGenerator), R(0), R(0), U8(2), U8(0), /* 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(ResumeGenerator), R(0), R(1), R(0), U8(2),
B(Star), R(2), B(Star), R(2),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1), B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
...@@ -90,8 +88,7 @@ bytecodes: [ ...@@ -90,8 +88,7 @@ bytecodes: [
B(LdaFalse), B(LdaFalse),
B(Star), R(3), B(Star), R(3),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(2), U8(2), B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(2), U8(2),
B(SuspendGenerator), R(0), R(0), U8(2), U8(1), /* 16 E> */ B(SuspendGenerator), R(0), R(0), U8(2), U8(1),
/* 25 S> */ B(Return),
B(ResumeGenerator), R(0), R(1), R(0), U8(2), B(ResumeGenerator), R(0), R(1), R(0), U8(2),
B(Star), R(2), B(Star), R(2),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1), B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
...@@ -104,8 +101,8 @@ bytecodes: [ ...@@ -104,8 +101,8 @@ bytecodes: [
/* 25 S> */ B(Return), /* 25 S> */ B(Return),
] ]
constant pool: [ constant pool: [
Smi [29], Smi [28],
Smi [67], Smi [65],
Smi [10], Smi [10],
Smi [7], Smi [7],
Smi [10], Smi [10],
...@@ -121,7 +118,7 @@ snippet: " ...@@ -121,7 +118,7 @@ snippet: "
" "
frame size: 18 frame size: 18
parameter count: 1 parameter count: 1
bytecode array length: 374 bytecode array length: 372
bytecodes: [ bytecodes: [
B(Ldar), R(2), B(Ldar), R(2),
B(JumpIfUndefined), U8(18), B(JumpIfUndefined), U8(18),
...@@ -139,7 +136,6 @@ bytecodes: [ ...@@ -139,7 +136,6 @@ bytecodes: [
B(Star), R(2), B(Star), R(2),
/* 11 E> */ B(StackCheck), /* 11 E> */ B(StackCheck),
/* 11 E> */ B(SuspendGenerator), R(2), R(0), U8(12), U8(0), /* 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(ResumeGenerator), R(2), R(11), R(0), U8(12),
B(Star), R(12), B(Star), R(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1), B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
...@@ -175,7 +171,7 @@ bytecodes: [ ...@@ -175,7 +171,7 @@ bytecodes: [
B(JumpIfFalse), U8(7), B(JumpIfFalse), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(6), U8(1), B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(6), U8(1),
B(LdaNamedProperty), R(6), U8(8), U8(9), 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(LdaNamedProperty), R(6), U8(9), U8(11),
B(Star), R(8), B(Star), R(8),
B(LdaSmi), I8(2), B(LdaSmi), I8(2),
...@@ -187,8 +183,7 @@ bytecodes: [ ...@@ -187,8 +183,7 @@ bytecodes: [
B(Star), R(17), B(Star), R(17),
B(Mov), R(0), R(16), B(Mov), R(0), R(16),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(16), U8(2), B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(16), U8(2),
B(SuspendGenerator), R(2), R(0), U8(16), U8(1), /* 36 E> */ B(SuspendGenerator), R(2), R(0), U8(16), U8(1),
/* 44 S> */ B(Return),
B(ResumeGenerator), R(2), R(11), R(0), U8(16), B(ResumeGenerator), R(2), R(11), R(0), U8(16),
B(Star), R(16), B(Star), R(16),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1), B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
...@@ -201,7 +196,7 @@ bytecodes: [ ...@@ -201,7 +196,7 @@ bytecodes: [
B(Jump), U8(58), B(Jump), U8(58),
B(LdaZero), B(LdaZero),
B(Star), R(7), B(Star), R(7),
B(JumpLoop), U8(100), I8(0), B(JumpLoop), U8(99), I8(0),
B(Jump), U8(36), B(Jump), U8(36),
B(Star), R(16), B(Star), R(16),
B(Ldar), R(closure), B(Ldar), R(closure),
...@@ -278,14 +273,14 @@ bytecodes: [ ...@@ -278,14 +273,14 @@ bytecodes: [
/* 44 S> */ B(Return), /* 44 S> */ B(Return),
] ]
constant pool: [ constant pool: [
Smi [29], Smi [28],
Smi [90], Smi [89],
Smi [10], Smi [10],
Smi [7], Smi [7],
TUPLE2_TYPE, TUPLE2_TYPE,
SYMBOL_TYPE, SYMBOL_TYPE,
ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"], ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
Smi [69], Smi [68],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["done"], ONE_BYTE_INTERNALIZED_STRING_TYPE ["done"],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"], ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"],
Smi [15], Smi [15],
...@@ -298,9 +293,9 @@ constant pool: [ ...@@ -298,9 +293,9 @@ constant pool: [
Smi [9], Smi [9],
] ]
handlers: [ handlers: [
[70, 243, 251], [69, 241, 249],
[73, 207, 209], [72, 205, 207],
[312, 322, 324], [310, 320, 322],
] ]
--- ---
...@@ -311,7 +306,7 @@ snippet: " ...@@ -311,7 +306,7 @@ snippet: "
" "
frame size: 10 frame size: 10
parameter count: 1 parameter count: 1
bytecode array length: 255 bytecode array length: 253
bytecodes: [ bytecodes: [
B(Ldar), R(0), B(Ldar), R(0),
B(JumpIfUndefined), U8(18), B(JumpIfUndefined), U8(18),
...@@ -329,7 +324,6 @@ bytecodes: [ ...@@ -329,7 +324,6 @@ bytecodes: [
B(Star), R(0), B(Star), R(0),
/* 38 E> */ B(StackCheck), /* 38 E> */ B(StackCheck),
/* 38 E> */ B(SuspendGenerator), R(0), R(0), U8(2), U8(0), /* 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(ResumeGenerator), R(0), R(1), R(0), U8(2),
B(Star), R(2), B(Star), R(2),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1), B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
...@@ -392,15 +386,14 @@ bytecodes: [ ...@@ -392,15 +386,14 @@ bytecodes: [
B(JumpIfJSReceiver), U8(7), B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(2), U8(1), B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(2), U8(1),
B(LdaNamedProperty), R(2), U8(12), U8(24), B(LdaNamedProperty), R(2), U8(12), U8(24),
B(JumpIfToBooleanTrue), U8(26), B(JumpIfToBooleanTrue), U8(25),
B(Ldar), R(2), B(Ldar), R(2),
B(SuspendGenerator), R(0), R(0), U8(9), U8(1), /* 43 E> */ B(SuspendGenerator), R(0), R(0), U8(9), U8(1),
/* 54 S> */ B(Return),
B(ResumeGenerator), R(0), R(1), R(0), U8(9), B(ResumeGenerator), R(0), R(1), R(0), U8(9),
B(Star), R(5), B(Star), R(5),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1), B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(Star), R(3), 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(LdaNamedProperty), R(2), U8(13), U8(26),
B(Star), R(4), B(Star), R(4),
B(LdaSmi), I8(1), B(LdaSmi), I8(1),
...@@ -412,14 +405,14 @@ bytecodes: [ ...@@ -412,14 +405,14 @@ bytecodes: [
/* 54 S> */ B(Return), /* 54 S> */ B(Return),
] ]
constant pool: [ constant pool: [
Smi [29], Smi [28],
Smi [91], Smi [90],
Smi [10], Smi [10],
Smi [7], Smi [7],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["g"], ONE_BYTE_INTERNALIZED_STRING_TYPE ["g"],
SYMBOL_TYPE, SYMBOL_TYPE,
ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"], ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
Smi [115], Smi [114],
Smi [11], Smi [11],
Smi [31], Smi [31],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["return"], ONE_BYTE_INTERNALIZED_STRING_TYPE ["return"],
......
...@@ -13,7 +13,7 @@ snippet: " ...@@ -13,7 +13,7 @@ snippet: "
" "
frame size: 6 frame size: 6
parameter count: 2 parameter count: 2
bytecode array length: 84 bytecode array length: 83
bytecodes: [ bytecodes: [
B(Ldar), R(0), B(Ldar), R(0),
B(JumpIfUndefined), U8(18), B(JumpIfUndefined), U8(18),
...@@ -36,7 +36,6 @@ bytecodes: [ ...@@ -36,7 +36,6 @@ bytecodes: [
B(Star), R(0), B(Star), R(0),
/* 0 E> */ B(StackCheck), /* 0 E> */ B(StackCheck),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(4), U8(0), /* 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(ResumeGenerator), R(0), R(2), R(0), U8(4),
B(Star), R(4), B(Star), R(4),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1), B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
...@@ -50,7 +49,7 @@ bytecodes: [ ...@@ -50,7 +49,7 @@ bytecodes: [
/* 13 S> */ B(Return), /* 13 S> */ B(Return),
] ]
constant pool: [ constant pool: [
Smi [43], Smi [42],
FIXED_ARRAY_TYPE, FIXED_ARRAY_TYPE,
Smi [10], Smi [10],
Smi [7], Smi [7],
...@@ -64,7 +63,7 @@ snippet: " ...@@ -64,7 +63,7 @@ snippet: "
" "
frame size: 6 frame size: 6
parameter count: 2 parameter count: 2
bytecode array length: 84 bytecode array length: 83
bytecodes: [ bytecodes: [
B(Ldar), R(0), B(Ldar), R(0),
B(JumpIfUndefined), U8(18), B(JumpIfUndefined), U8(18),
...@@ -87,7 +86,6 @@ bytecodes: [ ...@@ -87,7 +86,6 @@ bytecodes: [
B(Star), R(0), B(Star), R(0),
/* 0 E> */ B(StackCheck), /* 0 E> */ B(StackCheck),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(4), U8(0), /* 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(ResumeGenerator), R(0), R(2), R(0), U8(4),
B(Star), R(4), B(Star), R(4),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1), B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
...@@ -101,7 +99,7 @@ bytecodes: [ ...@@ -101,7 +99,7 @@ bytecodes: [
/* 24 S> */ B(Return), /* 24 S> */ B(Return),
] ]
constant pool: [ constant pool: [
Smi [43], Smi [42],
FIXED_ARRAY_TYPE, FIXED_ARRAY_TYPE,
Smi [10], Smi [10],
Smi [7], Smi [7],
...@@ -117,7 +115,7 @@ snippet: " ...@@ -117,7 +115,7 @@ snippet: "
" "
frame size: 7 frame size: 7
parameter count: 2 parameter count: 2
bytecode array length: 114 bytecode array length: 113
bytecodes: [ bytecodes: [
B(Ldar), R(1), B(Ldar), R(1),
B(JumpIfUndefined), U8(18), B(JumpIfUndefined), U8(18),
...@@ -140,7 +138,6 @@ bytecodes: [ ...@@ -140,7 +138,6 @@ bytecodes: [
B(Star), R(1), B(Star), R(1),
/* 0 E> */ B(StackCheck), /* 0 E> */ B(StackCheck),
/* 0 E> */ B(SuspendGenerator), R(1), R(0), U8(5), U8(0), /* 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(ResumeGenerator), R(1), R(3), R(0), U8(5),
B(Star), R(5), B(Star), R(5),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(1), U8(1), B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(1), U8(1),
...@@ -167,7 +164,7 @@ bytecodes: [ ...@@ -167,7 +164,7 @@ bytecodes: [
/* 64 S> */ B(Return), /* 64 S> */ B(Return),
] ]
constant pool: [ constant pool: [
Smi [43], Smi [42],
FIXED_ARRAY_TYPE, FIXED_ARRAY_TYPE,
Smi [10], Smi [10],
Smi [7], Smi [7],
...@@ -184,7 +181,7 @@ snippet: " ...@@ -184,7 +181,7 @@ snippet: "
" "
frame size: 7 frame size: 7
parameter count: 2 parameter count: 2
bytecode array length: 112 bytecode array length: 111
bytecodes: [ bytecodes: [
B(Ldar), R(1), B(Ldar), R(1),
B(JumpIfUndefined), U8(18), B(JumpIfUndefined), U8(18),
...@@ -207,7 +204,6 @@ bytecodes: [ ...@@ -207,7 +204,6 @@ bytecodes: [
B(Star), R(1), B(Star), R(1),
/* 0 E> */ B(StackCheck), /* 0 E> */ B(StackCheck),
/* 0 E> */ B(SuspendGenerator), R(1), R(0), U8(5), U8(0), /* 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(ResumeGenerator), R(1), R(3), R(0), U8(5),
B(Star), R(5), B(Star), R(5),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(1), U8(1), B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(1), U8(1),
...@@ -233,7 +229,7 @@ bytecodes: [ ...@@ -233,7 +229,7 @@ bytecodes: [
/* 49 S> */ B(Return), /* 49 S> */ B(Return),
] ]
constant pool: [ constant pool: [
Smi [43], Smi [42],
FIXED_ARRAY_TYPE, FIXED_ARRAY_TYPE,
Smi [10], Smi [10],
Smi [7], Smi [7],
...@@ -249,7 +245,7 @@ snippet: " ...@@ -249,7 +245,7 @@ snippet: "
" "
frame size: 7 frame size: 7
parameter count: 2 parameter count: 2
bytecode array length: 118 bytecode array length: 117
bytecodes: [ bytecodes: [
B(Ldar), R(1), B(Ldar), R(1),
B(JumpIfUndefined), U8(18), B(JumpIfUndefined), U8(18),
...@@ -275,7 +271,6 @@ bytecodes: [ ...@@ -275,7 +271,6 @@ bytecodes: [
/* 0 E> */ B(StackCheck), /* 0 E> */ B(StackCheck),
B(Ldar), R(1), B(Ldar), R(1),
/* 0 E> */ B(SuspendGenerator), R(1), R(0), U8(5), U8(0), /* 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(ResumeGenerator), R(1), R(3), R(0), U8(5),
B(Star), R(5), B(Star), R(5),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(1), U8(1), B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(1), U8(1),
...@@ -301,7 +296,7 @@ bytecodes: [ ...@@ -301,7 +296,7 @@ bytecodes: [
/* 49 S> */ B(Return), /* 49 S> */ B(Return),
] ]
constant pool: [ constant pool: [
Smi [49], Smi [48],
FIXED_ARRAY_TYPE, FIXED_ARRAY_TYPE,
Smi [10], Smi [10],
Smi [7], Smi [7],
...@@ -317,7 +312,7 @@ snippet: " ...@@ -317,7 +312,7 @@ snippet: "
" "
frame size: 7 frame size: 7
parameter count: 2 parameter count: 2
bytecode array length: 122 bytecode array length: 121
bytecodes: [ bytecodes: [
B(Ldar), R(1), B(Ldar), R(1),
B(JumpIfUndefined), U8(18), B(JumpIfUndefined), U8(18),
...@@ -343,7 +338,6 @@ bytecodes: [ ...@@ -343,7 +338,6 @@ bytecodes: [
/* 0 E> */ B(StackCheck), /* 0 E> */ B(StackCheck),
B(Ldar), R(1), B(Ldar), R(1),
/* 0 E> */ B(SuspendGenerator), R(1), R(0), U8(5), U8(0), /* 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(ResumeGenerator), R(1), R(3), R(0), U8(5),
B(Star), R(5), B(Star), R(5),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(1), U8(1), B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(1), U8(1),
...@@ -369,7 +363,7 @@ bytecodes: [ ...@@ -369,7 +363,7 @@ bytecodes: [
/* 51 S> */ B(Return), /* 51 S> */ B(Return),
] ]
constant pool: [ constant pool: [
Smi [49], Smi [48],
FIXED_ARRAY_TYPE, FIXED_ARRAY_TYPE,
Smi [10], Smi [10],
Smi [7], Smi [7],
...@@ -383,7 +377,7 @@ snippet: " ...@@ -383,7 +377,7 @@ snippet: "
" "
frame size: 6 frame size: 6
parameter count: 2 parameter count: 2
bytecode array length: 97 bytecode array length: 96
bytecodes: [ bytecodes: [
B(Ldar), R(0), B(Ldar), R(0),
B(JumpIfUndefined), U8(18), B(JumpIfUndefined), U8(18),
...@@ -409,7 +403,6 @@ bytecodes: [ ...@@ -409,7 +403,6 @@ bytecodes: [
/* 0 E> */ B(StackCheck), /* 0 E> */ B(StackCheck),
B(Ldar), R(0), B(Ldar), R(0),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(4), U8(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(ResumeGenerator), R(0), R(2), R(0), U8(4),
B(Star), R(4), B(Star), R(4),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1), B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
...@@ -425,7 +418,7 @@ bytecodes: [ ...@@ -425,7 +418,7 @@ bytecodes: [
/* 32 S> */ B(Return), /* 32 S> */ B(Return),
] ]
constant pool: [ constant pool: [
Smi [49], Smi [48],
FIXED_ARRAY_TYPE, FIXED_ARRAY_TYPE,
Smi [10], Smi [10],
Smi [7], Smi [7],
...@@ -440,7 +433,7 @@ snippet: " ...@@ -440,7 +433,7 @@ snippet: "
" "
frame size: 8 frame size: 8
parameter count: 2 parameter count: 2
bytecode array length: 118 bytecode array length: 117
bytecodes: [ bytecodes: [
B(Ldar), R(0), B(Ldar), R(0),
B(JumpIfUndefined), U8(18), B(JumpIfUndefined), U8(18),
...@@ -466,7 +459,6 @@ bytecodes: [ ...@@ -466,7 +459,6 @@ bytecodes: [
/* 0 E> */ B(StackCheck), /* 0 E> */ B(StackCheck),
B(Ldar), R(0), B(Ldar), R(0),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(4), U8(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(ResumeGenerator), R(0), R(2), R(0), U8(4),
B(Star), R(4), B(Star), R(4),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1), B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
...@@ -491,7 +483,7 @@ bytecodes: [ ...@@ -491,7 +483,7 @@ bytecodes: [
/* 26 S> */ B(Return), /* 26 S> */ B(Return),
] ]
constant pool: [ constant pool: [
Smi [49], Smi [48],
FIXED_ARRAY_TYPE, FIXED_ARRAY_TYPE,
Smi [10], Smi [10],
Smi [7], Smi [7],
...@@ -507,7 +499,7 @@ snippet: " ...@@ -507,7 +499,7 @@ snippet: "
" "
frame size: 6 frame size: 6
parameter count: 2 parameter count: 2
bytecode array length: 84 bytecode array length: 83
bytecodes: [ bytecodes: [
B(Ldar), R(0), B(Ldar), R(0),
B(JumpIfUndefined), U8(18), B(JumpIfUndefined), U8(18),
...@@ -530,7 +522,6 @@ bytecodes: [ ...@@ -530,7 +522,6 @@ bytecodes: [
B(Star), R(0), B(Star), R(0),
/* 0 E> */ B(StackCheck), /* 0 E> */ B(StackCheck),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(4), U8(0), /* 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(ResumeGenerator), R(0), R(2), R(0), U8(4),
B(Star), R(4), B(Star), R(4),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1), B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
...@@ -544,7 +535,7 @@ bytecodes: [ ...@@ -544,7 +535,7 @@ bytecodes: [
/* 30 S> */ B(Return), /* 30 S> */ B(Return),
] ]
constant pool: [ constant pool: [
Smi [43], Smi [42],
FIXED_ARRAY_TYPE, FIXED_ARRAY_TYPE,
Smi [10], Smi [10],
Smi [7], Smi [7],
...@@ -558,7 +549,7 @@ snippet: " ...@@ -558,7 +549,7 @@ snippet: "
" "
frame size: 6 frame size: 6
parameter count: 2 parameter count: 2
bytecode array length: 84 bytecode array length: 83
bytecodes: [ bytecodes: [
B(Ldar), R(0), B(Ldar), R(0),
B(JumpIfUndefined), U8(18), B(JumpIfUndefined), U8(18),
...@@ -581,7 +572,6 @@ bytecodes: [ ...@@ -581,7 +572,6 @@ bytecodes: [
B(Star), R(0), B(Star), R(0),
/* 0 E> */ B(StackCheck), /* 0 E> */ B(StackCheck),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(4), U8(0), /* 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(ResumeGenerator), R(0), R(2), R(0), U8(4),
B(Star), R(4), B(Star), R(4),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1), B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
...@@ -595,7 +585,7 @@ bytecodes: [ ...@@ -595,7 +585,7 @@ bytecodes: [
/* 19 S> */ B(Return), /* 19 S> */ B(Return),
] ]
constant pool: [ constant pool: [
Smi [43], Smi [42],
FIXED_ARRAY_TYPE, FIXED_ARRAY_TYPE,
Smi [10], Smi [10],
Smi [7], Smi [7],
...@@ -610,7 +600,7 @@ snippet: " ...@@ -610,7 +600,7 @@ snippet: "
" "
frame size: 9 frame size: 9
parameter count: 2 parameter count: 2
bytecode array length: 111 bytecode array length: 110
bytecodes: [ bytecodes: [
B(Ldar), R(0), B(Ldar), R(0),
B(JumpIfUndefined), U8(18), B(JumpIfUndefined), U8(18),
...@@ -638,7 +628,6 @@ bytecodes: [ ...@@ -638,7 +628,6 @@ bytecodes: [
/* 0 E> */ B(StackCheck), /* 0 E> */ B(StackCheck),
B(Ldar), R(0), B(Ldar), R(0),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(5), U8(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(ResumeGenerator), R(0), R(3), R(0), U8(5),
B(Star), R(5), B(Star), R(5),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1), B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
...@@ -656,7 +645,7 @@ bytecodes: [ ...@@ -656,7 +645,7 @@ bytecodes: [
/* 45 S> */ B(Return), /* 45 S> */ B(Return),
] ]
constant pool: [ constant pool: [
Smi [55], Smi [54],
FIXED_ARRAY_TYPE, FIXED_ARRAY_TYPE,
Smi [10], Smi [10],
Smi [7], Smi [7],
......
...@@ -272,7 +272,7 @@ snippet: " ...@@ -272,7 +272,7 @@ snippet: "
" "
frame size: 6 frame size: 6
parameter count: 1 parameter count: 1
bytecode array length: 89 bytecode array length: 88
bytecodes: [ bytecodes: [
B(Ldar), R(2), B(Ldar), R(2),
B(JumpIfUndefined), U8(18), B(JumpIfUndefined), U8(18),
...@@ -290,7 +290,6 @@ bytecodes: [ ...@@ -290,7 +290,6 @@ bytecodes: [
B(Star), R(2), B(Star), R(2),
/* 11 E> */ B(StackCheck), /* 11 E> */ B(StackCheck),
/* 11 E> */ B(SuspendGenerator), R(2), R(0), U8(4), U8(0), /* 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(ResumeGenerator), R(2), R(3), R(0), U8(4),
B(Star), R(4), B(Star), R(4),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1), B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
...@@ -314,7 +313,7 @@ bytecodes: [ ...@@ -314,7 +313,7 @@ bytecodes: [
/* 62 S> */ B(Return), /* 62 S> */ B(Return),
] ]
constant pool: [ constant pool: [
Smi [29], Smi [28],
Smi [10], Smi [10],
Smi [7], Smi [7],
] ]
...@@ -330,7 +329,7 @@ snippet: " ...@@ -330,7 +329,7 @@ snippet: "
" "
frame size: 5 frame size: 5
parameter count: 1 parameter count: 1
bytecode array length: 137 bytecode array length: 135
bytecodes: [ bytecodes: [
B(Ldar), R(1), B(Ldar), R(1),
B(JumpIfUndefined), U8(18), B(JumpIfUndefined), U8(18),
...@@ -348,7 +347,6 @@ bytecodes: [ ...@@ -348,7 +347,6 @@ bytecodes: [
B(Star), R(1), B(Star), R(1),
/* 11 E> */ B(StackCheck), /* 11 E> */ B(StackCheck),
/* 11 E> */ B(SuspendGenerator), R(1), R(0), U8(3), U8(0), /* 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(ResumeGenerator), R(1), R(2), R(0), U8(3),
B(Star), R(3), B(Star), R(3),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(1), U8(1), B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(1), U8(1),
...@@ -367,14 +365,13 @@ bytecodes: [ ...@@ -367,14 +365,13 @@ bytecodes: [
B(Abort), U8(15), B(Abort), U8(15),
/* 36 S> */ B(LdaSmi), I8(10), /* 36 S> */ B(LdaSmi), I8(10),
/* 36 E> */ B(TestLessThan), R(0), U8(0), /* 36 E> */ B(TestLessThan), R(0), U8(0),
B(JumpIfFalse), U8(49), B(JumpIfFalse), U8(48),
/* 18 E> */ B(StackCheck), /* 18 E> */ B(StackCheck),
/* 47 S> */ B(LdaFalse), /* 47 S> */ B(LdaFalse),
B(Star), R(4), B(Star), R(4),
B(Mov), R(0), R(3), B(Mov), R(0), R(3),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(3), U8(2), B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(3), U8(2),
B(SuspendGenerator), R(1), R(0), U8(3), U8(1), /* 47 E> */ B(SuspendGenerator), R(1), R(0), U8(3), U8(1),
/* 56 S> */ B(Return),
B(ResumeGenerator), R(1), R(2), R(0), U8(3), B(ResumeGenerator), R(1), R(2), R(0), U8(3),
B(Star), R(3), B(Star), R(3),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(1), U8(1), B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(1), U8(1),
...@@ -386,16 +383,16 @@ bytecodes: [ ...@@ -386,16 +383,16 @@ bytecodes: [
/* 44 S> */ B(Ldar), R(0), /* 44 S> */ B(Ldar), R(0),
B(Inc), U8(1), B(Inc), U8(1),
B(Star), R(0), B(Star), R(0),
B(JumpLoop), U8(65), I8(0), B(JumpLoop), U8(64), I8(0),
B(LdaUndefined), B(LdaUndefined),
/* 56 S> */ B(Return), /* 56 S> */ B(Return),
] ]
constant pool: [ constant pool: [
Smi [29], Smi [28],
Smi [53], Smi [52],
Smi [10], Smi [10],
Smi [7], Smi [7],
Smi [36], Smi [35],
Smi [10], Smi [10],
Smi [7], Smi [7],
] ]
...@@ -500,7 +497,7 @@ snippet: " ...@@ -500,7 +497,7 @@ snippet: "
" "
frame size: 12 frame size: 12
parameter count: 1 parameter count: 1
bytecode array length: 224 bytecode array length: 223
bytecodes: [ bytecodes: [
B(Ldar), R(1), B(Ldar), R(1),
B(JumpIfUndefined), U8(18), B(JumpIfUndefined), U8(18),
...@@ -531,14 +528,13 @@ bytecodes: [ ...@@ -531,14 +528,13 @@ bytecodes: [
B(Abort), U8(15), B(Abort), U8(15),
/* 41 S> */ B(LdaSmi), I8(10), /* 41 S> */ B(LdaSmi), I8(10),
/* 41 E> */ B(TestLessThan), R(0), U8(0), /* 41 E> */ B(TestLessThan), R(0), U8(0),
B(JumpIfFalse), U8(52), B(JumpIfFalse), U8(51),
/* 23 E> */ B(StackCheck), /* 23 E> */ B(StackCheck),
/* 52 S> */ B(Mov), R(1), R(8), /* 52 S> */ B(Mov), R(1), R(8),
B(Mov), R(0), R(9), B(Mov), R(0), R(9),
B(Mov), R(2), R(10), B(Mov), R(2), R(10),
B(CallJSRuntime), U8(%async_function_await_uncaught), R(8), U8(3), B(CallJSRuntime), U8(%async_function_await_uncaught), R(8), U8(3),
B(SuspendGenerator), R(1), R(0), U8(8), U8(0), /* 52 E> */ B(SuspendGenerator), R(1), R(0), U8(8), U8(0),
/* 61 S> */ B(Return),
B(ResumeGenerator), R(1), R(3), R(0), U8(8), B(ResumeGenerator), R(1), R(3), R(0), U8(8),
B(Star), R(8), B(Star), R(8),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(1), U8(1), B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(1), U8(1),
...@@ -551,7 +547,7 @@ bytecodes: [ ...@@ -551,7 +547,7 @@ bytecodes: [
/* 49 S> */ B(Ldar), R(0), /* 49 S> */ B(Ldar), R(0),
B(Inc), U8(1), B(Inc), U8(1),
B(Star), R(0), B(Star), R(0),
B(JumpLoop), U8(68), I8(0), B(JumpLoop), U8(67), I8(0),
B(LdaUndefined), B(LdaUndefined),
B(Star), R(9), B(Star), R(9),
B(Mov), R(2), R(8), B(Mov), R(2), R(8),
...@@ -605,14 +601,14 @@ bytecodes: [ ...@@ -605,14 +601,14 @@ bytecodes: [
] ]
constant pool: [ constant pool: [
Smi [38], Smi [38],
Smi [39], Smi [38],
ONE_BYTE_INTERNALIZED_STRING_TYPE [".catch"], ONE_BYTE_INTERNALIZED_STRING_TYPE [".catch"],
FIXED_ARRAY_TYPE, FIXED_ARRAY_TYPE,
Smi [6], Smi [6],
Smi [9], Smi [9],
] ]
handlers: [ handlers: [
[46, 183, 191], [46, 182, 190],
[49, 141, 143], [49, 140, 142],
] ]
...@@ -5,11 +5,11 @@ Running test: testBreakLocations ...@@ -5,11 +5,11 @@ Running test: testBreakLocations
function testFunction() { function testFunction() {
async function f1() { async function f1() {
for (let x = |_|0; x |_|< 1; ++|_|x) |_|await x; for (let x = |_|0; x |_|< 1; ++|_|x) |_|await x;
|_|return await Promise.|C|resolve(2); |_|return |_|await Promise.|C|resolve(2);
|R|} |R|}
async function f2() { 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();
|_|await |C|f1().|C|then(x => x |_|* 2|R|); |_|await |C|f1().|C|then(x => x |_|* 2|R|);
|_|await [1].|C|map(x => Promise.|C|resolve(x)|R|)[0]; |_|await [1].|C|map(x => Promise.|C|resolve(x)|R|)[0];
......
...@@ -152,7 +152,7 @@ function testSwitch() { ...@@ -152,7 +152,7 @@ function testSwitch() {
} }
|R|} |R|}
function* idMaker() { function* idMaker|_|() {
|_|yield 1; |_|yield 1;
|_|yield 2; |_|yield 2;
|_|yield 3; |_|yield 3;
...@@ -230,8 +230,8 @@ async function testPromiseAsyncWithCode() { ...@@ -230,8 +230,8 @@ async function testPromiseAsyncWithCode() {
|_|await p; |_|await p;
|R|} |R|}
|C|setTimeout(returnCall, 0); |C|setTimeout(returnCall, 0);
await |C|foo(); |_|await |C|foo();
await |C|foo(); |_|await |C|foo();
|C|nextTest(); |C|nextTest();
|R|} |R|}
|C|main(); |C|main();
...@@ -252,7 +252,7 @@ async function testPromiseComplex() { ...@@ -252,7 +252,7 @@ async function testPromiseComplex() {
|R|} |R|}
var x = |_|1; var x = |_|1;
var y = |_|2; 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(); |C|nextTest();
|R|} |R|}
|C|main(); |C|main();
......
...@@ -384,9 +384,16 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) { ...@@ -384,9 +384,16 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) {
.StoreModuleVariable(1, 42); .StoreModuleVariable(1, 42);
// Emit generator operations. // Emit generator operations.
builder.SuspendGenerator(reg, reg_list, 0) {
.RestoreGeneratorState(reg) // We have to skip over suspend because it returns and marks the remaining
.ResumeGenerator(reg, reg, reg_list); // 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. // Intrinsics handled by the interpreter.
builder.CallRuntime(Runtime::kInlineIsArray, reg_list); builder.CallRuntime(Runtime::kInlineIsArray, reg_list);
......
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