Commit c869d40d authored by Leszek Swirski's avatar Leszek Swirski Committed by Commit Bot

[ignition] Single-switch generator bytecode

Currently, yields and awaits inside loops compile to bytecode which
switches to the top of the loop header, and switch again once inside the
loop. This is to make loops reducible.

This replaces this switching logic with a single switch bytecode that
directly jumps to the bytecode being resumed. Among other things, this
allows us to no longer maintain the generator state after the switch at
the top of the function, and avoid having to track loop suspend counts.

TurboFan still needs to have reducible loops, so we now insert loop
header switches during bytecode graph building, for suspends that are
discovered to be inside loops during bytecode analysis. We do, however,
do some environment magic across loop headers since we know that we will
continue switching if and only if we reached that loop header via a
generator resume. This allows us to generate fewer phis and tighten
liveness.

Change-Id: Id2720ce1d6955be9a48178322cc209b3a4b8d385
Reviewed-on: https://chromium-review.googlesource.com/866734
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50804}
parent 51a58ac4
......@@ -61,6 +61,22 @@ bool BytecodeLoopAssignments::ContainsLocal(int index) const {
return bit_vector_->Contains(parameter_count_ + index);
}
ResumeJumpTarget::ResumeJumpTarget(int suspend_id, int target_offset,
int final_target_offset)
: suspend_id_(suspend_id),
target_offset_(target_offset),
final_target_offset_(final_target_offset) {}
ResumeJumpTarget ResumeJumpTarget::Leaf(int suspend_id, int target_offset) {
return ResumeJumpTarget(suspend_id, target_offset, target_offset);
}
ResumeJumpTarget ResumeJumpTarget::AtLoopHeader(int loop_header_offset,
const ResumeJumpTarget& next) {
return ResumeJumpTarget(next.suspend_id(), loop_header_offset,
next.target_offset());
}
BytecodeAnalysis::BytecodeAnalysis(Handle<BytecodeArray> bytecode_array,
Zone* zone, bool do_liveness_analysis)
: bytecode_array_(bytecode_array),
......@@ -68,6 +84,7 @@ BytecodeAnalysis::BytecodeAnalysis(Handle<BytecodeArray> bytecode_array,
zone_(zone),
loop_stack_(zone),
loop_end_index_queue_(zone),
resume_jump_targets_(zone),
end_to_header_(zone),
header_to_info_(zone),
osr_entry_point_(-1),
......@@ -243,6 +260,18 @@ void UpdateOutLiveness(Bytecode bytecode, BytecodeLivenessState& out_liveness,
}
}
void UpdateLiveness(Bytecode bytecode, BytecodeLiveness& liveness,
BytecodeLivenessState** next_bytecode_in_liveness,
const interpreter::BytecodeArrayAccessor& accessor,
const BytecodeLivenessMap& liveness_map) {
UpdateOutLiveness(bytecode, *liveness.out, *next_bytecode_in_liveness,
accessor, liveness_map);
liveness.in->CopyFrom(*liveness.out);
UpdateInLiveness(bytecode, *liveness.in, accessor);
*next_bytecode_in_liveness = liveness.in;
}
void UpdateAssignments(Bytecode bytecode, BytecodeLoopAssignments& assignments,
const interpreter::BytecodeArrayAccessor& accessor) {
int num_operands = Bytecodes::NumberOfOperands(bytecode);
......@@ -282,14 +311,21 @@ void BytecodeAnalysis::Analyze(BailoutId osr_bailout_id) {
BytecodeLivenessState* next_bytecode_in_liveness = nullptr;
int osr_loop_end_offset =
osr_bailout_id.IsNone() ? -1 : osr_bailout_id.ToInt();
bool is_osr = !osr_bailout_id.IsNone();
int osr_loop_end_offset = is_osr ? osr_bailout_id.ToInt() : -1;
int generator_switch_index = -1;
interpreter::BytecodeArrayRandomIterator iterator(bytecode_array(), zone());
for (iterator.GoToEnd(); iterator.IsValid(); --iterator) {
Bytecode bytecode = iterator.current_bytecode();
int current_offset = iterator.current_offset();
if (bytecode == Bytecode::kSwitchOnGeneratorState) {
DCHECK_EQ(generator_switch_index, -1);
generator_switch_index = iterator.current_index();
}
if (bytecode == Bytecode::kJumpLoop) {
// Every byte up to and including the last byte within the backwards jump
// instruction is considered part of the loop, set loop end accordingly.
......@@ -320,31 +356,84 @@ void BytecodeAnalysis::Analyze(BailoutId osr_bailout_id) {
// information we currently have.
UpdateAssignments(bytecode, current_loop_info->assignments(), iterator);
// Update suspend counts for this loop, though only if not OSR.
if (!is_osr && bytecode == Bytecode::kSuspendGenerator) {
int suspend_id = iterator.GetUnsignedImmediateOperand(3);
int resume_offset = current_offset + iterator.current_bytecode_size();
current_loop_info->AddResumeTarget(
ResumeJumpTarget::Leaf(suspend_id, resume_offset));
}
// If we've reached the header of the loop, pop it off the stack.
if (current_offset == current_loop.header_offset) {
loop_stack_.pop();
if (loop_stack_.size() > 1) {
// Propagate inner loop assignments to outer loop.
loop_stack_.top().loop_info->assignments().Union(
// If there is still an outer loop, propagate inner loop assignments.
LoopInfo* parent_loop_info = loop_stack_.top().loop_info;
parent_loop_info->assignments().Union(
current_loop_info->assignments());
// Also, propagate resume targets. Instead of jumping to the target
// itself, the outer loop will jump to this loop header for any
// targets that are inside the current loop, so that this loop stays
// reducible. Hence, a nested loop of the form:
//
// switch (#1 -> suspend1, #2 -> suspend2)
// loop {
// suspend1: suspend #1
// loop {
// suspend2: suspend #2
// }
// }
//
// becomes:
//
// switch (#1 -> loop1, #2 -> loop1)
// loop1: loop {
// switch (#1 -> suspend1, #2 -> loop2)
// suspend1: suspend #1
// loop2: loop {
// switch (#2 -> suspend2)
// suspend2: suspend #2
// }
// }
for (const auto& target : current_loop_info->resume_jump_targets()) {
parent_loop_info->AddResumeTarget(
ResumeJumpTarget::AtLoopHeader(current_offset, target));
}
} else {
// Otherwise, just propagate inner loop suspends to top-level.
for (const auto& target : current_loop_info->resume_jump_targets()) {
resume_jump_targets_.push_back(
ResumeJumpTarget::AtLoopHeader(current_offset, target));
}
}
}
} else if (!is_osr && bytecode == Bytecode::kSuspendGenerator) {
// If we're not in a loop, we still need to look for suspends.
// TODO(leszeks): It would be nice to de-duplicate this with the in-loop
// case
int suspend_id = iterator.GetUnsignedImmediateOperand(3);
int resume_offset = current_offset + iterator.current_bytecode_size();
resume_jump_targets_.push_back(
ResumeJumpTarget::Leaf(suspend_id, resume_offset));
}
if (do_liveness_analysis_) {
BytecodeLiveness& liveness = liveness_map_.InitializeLiveness(
current_offset, bytecode_array()->register_count(), zone());
UpdateOutLiveness(bytecode, *liveness.out, next_bytecode_in_liveness,
iterator, liveness_map_);
liveness.in->CopyFrom(*liveness.out);
UpdateInLiveness(bytecode, *liveness.in, iterator);
next_bytecode_in_liveness = liveness.in;
UpdateLiveness(bytecode, liveness, &next_bytecode_in_liveness, iterator,
liveness_map_);
}
}
DCHECK_EQ(loop_stack_.size(), 1u);
DCHECK_EQ(loop_stack_.top().header_offset, -1);
DCHECK(ResumeJumpTargetsAreValid());
if (!do_liveness_analysis_) return;
// At this point, every bytecode has a valid in and out liveness, except for
......@@ -395,16 +484,11 @@ void BytecodeAnalysis::Analyze(BailoutId osr_bailout_id) {
--iterator;
for (; iterator.current_offset() > header_offset; --iterator) {
Bytecode bytecode = iterator.current_bytecode();
int current_offset = iterator.current_offset();
BytecodeLiveness& liveness = liveness_map_.GetLiveness(current_offset);
UpdateOutLiveness(bytecode, *liveness.out, next_bytecode_in_liveness,
iterator, liveness_map_);
liveness.in->CopyFrom(*liveness.out);
UpdateInLiveness(bytecode, *liveness.in, iterator);
next_bytecode_in_liveness = liveness.in;
UpdateLiveness(bytecode, liveness, &next_bytecode_in_liveness, iterator,
liveness_map_);
}
// Now we are at the loop header. Since the in-liveness of the header
// can't change, we need only to update the out-liveness.
......@@ -412,6 +496,47 @@ void BytecodeAnalysis::Analyze(BailoutId osr_bailout_id) {
next_bytecode_in_liveness, iterator, liveness_map_);
}
// Process the generator switch statement separately, once the loops are done.
// This has to be a separate pass because the generator switch can jump into
// the middle of loops (and is the only kind of jump that can jump across a
// loop header).
if (generator_switch_index != -1) {
iterator.GoToIndex(generator_switch_index);
DCHECK_EQ(iterator.current_bytecode(), Bytecode::kSwitchOnGeneratorState);
int current_offset = iterator.current_offset();
BytecodeLiveness& switch_liveness =
liveness_map_.GetLiveness(current_offset);
bool any_changed = false;
for (const auto& entry : iterator.GetJumpTableTargetOffsets()) {
if (switch_liveness.out->UnionIsChanged(
*liveness_map_.GetInLiveness(entry.target_offset))) {
any_changed = true;
}
}
// If the switch liveness changed, we have to propagate it up the remaining
// bytecodes before it.
if (any_changed) {
switch_liveness.in->CopyFrom(*switch_liveness.out);
UpdateInLiveness(Bytecode::kSwitchOnGeneratorState, *switch_liveness.in,
iterator);
next_bytecode_in_liveness = switch_liveness.in;
for (--iterator; iterator.IsValid(); --iterator) {
Bytecode bytecode = iterator.current_bytecode();
int current_offset = iterator.current_offset();
BytecodeLiveness& liveness = liveness_map_.GetLiveness(current_offset);
// There shouldn't be any more loops.
DCHECK_NE(bytecode, Bytecode::kJumpLoop);
UpdateLiveness(bytecode, liveness, &next_bytecode_in_liveness, iterator,
liveness_map_);
}
}
}
DCHECK(LivenessIsValid());
}
......@@ -518,6 +643,154 @@ std::ostream& BytecodeAnalysis::PrintLivenessTo(std::ostream& os) const {
}
#if DEBUG
bool BytecodeAnalysis::ResumeJumpTargetsAreValid() {
bool valid = true;
// Find the generator switch.
interpreter::BytecodeArrayRandomIterator iterator(bytecode_array(), zone());
for (iterator.GoToStart(); iterator.IsValid(); ++iterator) {
if (iterator.current_bytecode() == Bytecode::kSwitchOnGeneratorState) {
break;
}
}
// If the iterator is invalid, we've reached the end without finding the
// generator switch. Similarly, if we are OSR-ing, we're not resuming, so we
// need no jump targets. So, ensure there are no jump targets and exit.
if (!iterator.IsValid() || HasOsrEntryPoint()) {
// Check top-level.
if (!resume_jump_targets().empty()) {
PrintF(stderr,
"Found %zu top-level resume targets but no resume switch\n",
resume_jump_targets().size());
valid = false;
}
// Check loops.
for (const std::pair<int, LoopInfo>& loop_info : header_to_info_) {
if (!loop_info.second.resume_jump_targets().empty()) {
PrintF(stderr,
"Found %zu resume targets at loop at offset %d, but no resume "
"switch\n",
loop_info.second.resume_jump_targets().size(), loop_info.first);
valid = false;
}
}
return valid;
}
// Otherwise, we've found the resume switch. Check that the top level jumps
// only to leaves and loop headers, then check that each loop header handles
// all the unresolved jumps, also jumping only to leaves and inner loop
// headers.
// First collect all required suspend ids.
std::map<int, int> unresolved_suspend_ids;
for (const interpreter::JumpTableTargetOffset& offset :
iterator.GetJumpTableTargetOffsets()) {
int suspend_id = offset.case_value;
int resume_offset = offset.target_offset;
unresolved_suspend_ids[suspend_id] = resume_offset;
}
// Check top-level.
if (!ResumeJumpTargetLeavesResolveSuspendIds(-1, resume_jump_targets(),
&unresolved_suspend_ids)) {
valid = false;
}
// Check loops.
for (const std::pair<int, LoopInfo>& loop_info : header_to_info_) {
if (!ResumeJumpTargetLeavesResolveSuspendIds(
loop_info.first, loop_info.second.resume_jump_targets(),
&unresolved_suspend_ids)) {
valid = false;
}
}
// Check that everything is resolved.
if (!unresolved_suspend_ids.empty()) {
PrintF(stderr,
"Found suspend ids that are not resolved by a final leaf resume "
"jump:\n");
for (const std::pair<int, int>& target : unresolved_suspend_ids) {
PrintF(stderr, " %d -> %d\n", target.first, target.second);
}
valid = false;
}
return valid;
}
bool BytecodeAnalysis::ResumeJumpTargetLeavesResolveSuspendIds(
int parent_offset, const ZoneVector<ResumeJumpTarget>& resume_jump_targets,
std::map<int, int>* unresolved_suspend_ids) {
bool valid = true;
for (const ResumeJumpTarget& target : resume_jump_targets) {
std::map<int, int>::iterator it =
unresolved_suspend_ids->find(target.suspend_id());
if (it == unresolved_suspend_ids->end()) {
PrintF(
stderr,
"No unresolved suspend found for resume target with suspend id %d\n",
target.suspend_id());
valid = false;
continue;
}
int expected_target = it->second;
if (target.is_leaf()) {
// Leaves should have the expected target as their target.
if (target.target_offset() != expected_target) {
PrintF(
stderr,
"Expected leaf resume target for id %d to have target offset %d, "
"but had %d\n",
target.suspend_id(), expected_target, target.target_offset());
valid = false;
} else {
// Make sure we're resuming to a Resume bytecode
interpreter::BytecodeArrayAccessor assessor(bytecode_array(),
target.target_offset());
if (assessor.current_bytecode() != Bytecode::kResumeGenerator) {
PrintF(stderr,
"Expected resume target for id %d, offset %d, to be "
"ResumeGenerator, but found %s\n",
target.suspend_id(), target.target_offset(),
Bytecodes::ToString(assessor.current_bytecode()));
valid = false;
}
}
// We've resolved this suspend id, so erase it to make sure we don't
// resolve it twice.
unresolved_suspend_ids->erase(it);
} else {
// Non-leaves should have a direct inner loop header as their target.
if (!IsLoopHeader(target.target_offset())) {
PrintF(stderr,
"Expected non-leaf resume target for id %d to have a loop "
"header at target offset %d\n",
target.suspend_id(), target.target_offset());
valid = false;
} else {
LoopInfo loop_info = GetLoopInfoFor(target.target_offset());
if (loop_info.parent_offset() != parent_offset) {
PrintF(stderr,
"Expected non-leaf resume target for id %d to have a direct "
"inner loop at target offset %d\n",
target.suspend_id(), target.target_offset());
valid = false;
}
// If the target loop is a valid inner loop, we'll check its validity
// when we analyze its resume targets.
}
}
}
return valid;
}
bool BytecodeAnalysis::LivenessIsValid() {
interpreter::BytecodeArrayRandomIterator iterator(bytecode_array(), zone());
......
......@@ -39,15 +39,49 @@ class V8_EXPORT_PRIVATE BytecodeLoopAssignments {
BitVector* bit_vector_;
};
// Jump targets for resuming a suspended generator.
class V8_EXPORT_PRIVATE ResumeJumpTarget {
public:
// Create a resume jump target representing an actual resume.
static ResumeJumpTarget Leaf(int suspend_id, int target_offset);
// Create a resume jump target at a loop header, which will have another
// resume jump after the loop header is crossed.
static ResumeJumpTarget AtLoopHeader(int loop_header_offset,
const ResumeJumpTarget& next);
int suspend_id() const { return suspend_id_; }
int target_offset() const { return target_offset_; }
bool is_leaf() const { return target_offset_ == final_target_offset_; }
private:
// The suspend id of the resume.
int suspend_id_;
// The target offset of this resume jump.
int target_offset_;
// The final offset of this resume, which may be across multiple jumps.
int final_target_offset_;
ResumeJumpTarget(int suspend_id, int target_offset, int final_target_offset);
};
struct V8_EXPORT_PRIVATE LoopInfo {
public:
LoopInfo(int parent_offset, int parameter_count, int register_count,
Zone* zone)
: parent_offset_(parent_offset),
assignments_(parameter_count, register_count, zone) {}
assignments_(parameter_count, register_count, zone),
resume_jump_targets_(zone) {}
int parent_offset() const { return parent_offset_; }
const ZoneVector<ResumeJumpTarget>& resume_jump_targets() const {
return resume_jump_targets_;
}
void AddResumeTarget(const ResumeJumpTarget& target) {
resume_jump_targets_.push_back(target);
}
BytecodeLoopAssignments& assignments() { return assignments_; }
const BytecodeLoopAssignments& assignments() const { return assignments_; }
......@@ -55,6 +89,7 @@ struct V8_EXPORT_PRIVATE LoopInfo {
// The offset to the parent loop, or -1 if there is no parent.
int parent_offset_;
BytecodeLoopAssignments assignments_;
ZoneVector<ResumeJumpTarget> resume_jump_targets_;
};
class V8_EXPORT_PRIVATE BytecodeAnalysis BASE_EMBEDDED {
......@@ -78,10 +113,16 @@ class V8_EXPORT_PRIVATE BytecodeAnalysis BASE_EMBEDDED {
// Get the loop info of the loop header at {header_offset}.
const LoopInfo& GetLoopInfoFor(int header_offset) const;
// Get the top-level resume jump targets.
const ZoneVector<ResumeJumpTarget>& resume_jump_targets() const {
return resume_jump_targets_;
}
// True if the current analysis has an OSR entry point.
bool HasOsrEntryPoint() const { return osr_entry_point_ != -1; }
int osr_entry_point() const { return osr_entry_point_; }
// Gets the in-liveness for the bytecode at {offset}.
const BytecodeLivenessState* GetInLivenessFor(int offset) const;
......@@ -99,6 +140,12 @@ class V8_EXPORT_PRIVATE BytecodeAnalysis BASE_EMBEDDED {
void PushLoop(int loop_header, int loop_end);
#if DEBUG
bool ResumeJumpTargetsAreValid();
bool ResumeJumpTargetLeavesResolveSuspendIds(
int parent_offset,
const ZoneVector<ResumeJumpTarget>& resume_jump_targets,
std::map<int, int>* unresolved_suspend_ids);
bool LivenessIsValid();
#endif
......@@ -112,6 +159,7 @@ class V8_EXPORT_PRIVATE BytecodeAnalysis BASE_EMBEDDED {
ZoneStack<LoopStackEntry> loop_stack_;
ZoneVector<int> loop_end_index_queue_;
ZoneVector<ResumeJumpTarget> resume_jump_targets_;
ZoneMap<int, int> end_to_header_;
ZoneMap<int, LoopInfo> header_to_info_;
......
......@@ -9,6 +9,7 @@
#include "src/compiler/access-builder.h"
#include "src/compiler/compiler-source-position-table.h"
#include "src/compiler/linkage.h"
#include "src/compiler/node-matchers.h"
#include "src/compiler/operator-properties.h"
#include "src/compiler/simplified-operator.h"
#include "src/interpreter/bytecodes.h"
......@@ -40,6 +41,7 @@ class BytecodeGraphBuilder::Environment : public ZoneObject {
Node* LookupAccumulator() const;
Node* LookupRegister(interpreter::Register the_register) const;
Node* LookupGeneratorState() const;
void BindAccumulator(Node* node,
FrameStateAttachmentMode mode = kDontAttachFrameState);
......@@ -48,6 +50,7 @@ class BytecodeGraphBuilder::Environment : public ZoneObject {
void BindRegistersToProjections(
interpreter::Register first_reg, Node* node,
FrameStateAttachmentMode mode = kDontAttachFrameState);
void BindGeneratorState(Node* node);
void RecordAfterState(Node* node,
FrameStateAttachmentMode mode = kDontAttachFrameState);
......@@ -108,6 +111,7 @@ class BytecodeGraphBuilder::Environment : public ZoneObject {
Node* effect_dependency_;
NodeVector values_;
Node* parameters_state_values_;
Node* generator_state_;
int register_base_;
int accumulator_base_;
};
......@@ -138,7 +142,8 @@ BytecodeGraphBuilder::Environment::Environment(
control_dependency_(control_dependency),
effect_dependency_(control_dependency),
values_(builder->local_zone()),
parameters_state_values_(nullptr) {
parameters_state_values_(nullptr),
generator_state_(nullptr) {
// The layout of values_ is:
//
// [receiver] [parameters] [registers] [accumulator]
......@@ -191,6 +196,7 @@ BytecodeGraphBuilder::Environment::Environment(
effect_dependency_(other->effect_dependency_),
values_(other->zone()),
parameters_state_values_(other->parameters_state_values_),
generator_state_(other->generator_state_),
register_base_(other->register_base_),
accumulator_base_(other->accumulator_base_) {
values_ = other->values_;
......@@ -210,6 +216,10 @@ Node* BytecodeGraphBuilder::Environment::LookupAccumulator() const {
return values()->at(accumulator_base_);
}
Node* BytecodeGraphBuilder::Environment::LookupGeneratorState() const {
DCHECK_NOT_NULL(generator_state_);
return generator_state_;
}
Node* BytecodeGraphBuilder::Environment::LookupRegister(
interpreter::Register the_register) const {
......@@ -231,6 +241,10 @@ void BytecodeGraphBuilder::Environment::BindAccumulator(
values()->at(accumulator_base_) = node;
}
void BytecodeGraphBuilder::Environment::BindGeneratorState(Node* node) {
generator_state_ = node;
}
void BytecodeGraphBuilder::Environment::BindRegister(
interpreter::Register the_register, Node* node,
FrameStateAttachmentMode mode) {
......@@ -291,9 +305,18 @@ void BytecodeGraphBuilder::Environment::Merge(
for (int i = 0; i < register_count(); i++) {
int index = register_base() + i;
if (liveness == nullptr || liveness->RegisterIsLive(i)) {
DCHECK_NE(values_[index], builder()->jsgraph()->OptimizedOutConstant());
DCHECK_NE(other->values_[index],
builder()->jsgraph()->OptimizedOutConstant());
#if DEBUG
// We only do these DCHECKs when we are not in the resume path of a
// generator -- this is, when either there is no generator state at all,
// or the generator state is not the constant "executing" value.
if (generator_state_ == nullptr ||
NumberMatcher(generator_state_)
.Is(JSGeneratorObject::kGeneratorExecuting)) {
DCHECK_NE(values_[index], builder()->jsgraph()->OptimizedOutConstant());
DCHECK_NE(other->values_[index],
builder()->jsgraph()->OptimizedOutConstant());
}
#endif
values_[index] =
builder()->MergeValue(values_[index], other->values_[index], control);
......@@ -315,6 +338,12 @@ void BytecodeGraphBuilder::Environment::Merge(
} else {
values_[accumulator_base()] = builder()->jsgraph()->OptimizedOutConstant();
}
if (generator_state_ != nullptr) {
DCHECK_NOT_NULL(other->generator_state_);
generator_state_ = builder()->MergeValue(generator_state_,
other->generator_state_, control);
}
}
void BytecodeGraphBuilder::Environment::PrepareForLoop(
......@@ -345,6 +374,10 @@ void BytecodeGraphBuilder::Environment::PrepareForLoop(
// The accumulator should not be live on entry.
DCHECK_IMPLIES(liveness != nullptr, !liveness->AccumulatorIsLive());
if (generator_state_ != nullptr) {
generator_state_ = builder()->NewPhi(1, generator_state_, control);
}
// Connect to the loop end.
Node* terminate = builder()->graph()->NewNode(
builder()->common()->Terminate(), effect, control);
......@@ -423,6 +456,11 @@ void BytecodeGraphBuilder::Environment::PrepareForLoopExit(
values_[accumulator_base()], loop_exit);
values_[accumulator_base()] = rename;
}
if (generator_state_ != nullptr) {
generator_state_ = graph()->NewNode(common()->LoopExitValue(),
generator_state_, loop_exit);
}
}
void BytecodeGraphBuilder::Environment::UpdateStateValues(Node** state_values,
......@@ -498,6 +536,7 @@ BytecodeGraphBuilder::BytecodeGraphBuilder(
currently_peeled_loop_offset_(-1),
stack_check_(stack_check),
merge_environments_(local_zone),
generator_merge_environments_(local_zone),
exception_handlers_(local_zone),
current_exception_handler_(0),
input_buffer_size_(0),
......@@ -847,6 +886,11 @@ void BytecodeGraphBuilder::VisitBytecodes() {
bytecode_analysis.PrintLivenessTo(of);
}
if (!bytecode_analysis.resume_jump_targets().empty()) {
environment()->BindGeneratorState(
jsgraph()->SmiConstant(JSGeneratorObject::kGeneratorExecuting));
}
if (bytecode_analysis.HasOsrEntryPoint()) {
// We peel the OSR loop and any outer loop containing it except that we
// leave the nodes corresponding to the whole outermost loop (including
......@@ -2738,26 +2782,69 @@ void BytecodeGraphBuilder::VisitSuspendGenerator() {
bytecode_iterator().current_offset()));
}
void BytecodeGraphBuilder::VisitRestoreGeneratorState() {
Node* generator = environment()->LookupRegister(
bytecode_iterator().GetRegisterOperand(0));
void BytecodeGraphBuilder::BuildSwitchOnGeneratorState(
const ZoneVector<ResumeJumpTarget>& resume_jump_targets,
bool allow_fallthrough_on_executing) {
Node* generator_state = environment()->LookupGeneratorState();
int extra_cases = allow_fallthrough_on_executing ? 2 : 1;
NewSwitch(generator_state,
static_cast<int>(resume_jump_targets.size() + extra_cases));
for (const ResumeJumpTarget& target : resume_jump_targets) {
SubEnvironment sub_environment(this);
NewIfValue(target.suspend_id());
if (target.is_leaf()) {
// Mark that we are resuming executing.
environment()->BindGeneratorState(
jsgraph()->SmiConstant(JSGeneratorObject::kGeneratorExecuting));
}
// Jump to the target offset, whether it's a loop header or the resume.
MergeIntoSuccessorEnvironment(target.target_offset());
}
{
SubEnvironment sub_environment(this);
// We should never hit the default case (assuming generator state cannot be
// corrupted), so abort if we do.
// TODO(leszeks): Maybe only check this in debug mode, and otherwise use
// the default to represent one of the cases above/fallthrough below?
NewIfDefault();
NewNode(simplified()->RuntimeAbort(AbortReason::kInvalidJumpTableIndex));
Node* control = NewNode(common()->Throw());
MergeControlToLeaveFunction(control);
}
if (allow_fallthrough_on_executing) {
// If we are executing (rather than resuming), and we allow it, just fall
// through to the actual loop body.
NewIfValue(JSGeneratorObject::kGeneratorExecuting);
} else {
// Otherwise, this environment is dead.
set_environment(nullptr);
}
}
void BytecodeGraphBuilder::VisitSwitchOnGeneratorState() {
Node* generator =
environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0));
Node* state =
Node* generator_state =
NewNode(javascript()->GeneratorRestoreContinuation(), generator);
environment()->BindAccumulator(state, Environment::kAttachFrameState);
environment()->BindGeneratorState(generator_state);
BuildSwitchOnGeneratorState(bytecode_analysis()->resume_jump_targets(),
false);
}
void BytecodeGraphBuilder::VisitResumeGenerator() {
Node* generator =
environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0));
interpreter::Register generator_state_reg =
bytecode_iterator().GetRegisterOperand(1);
interpreter::Register first_reg = bytecode_iterator().GetRegisterOperand(2);
interpreter::Register first_reg = bytecode_iterator().GetRegisterOperand(1);
// We assume we are restoring registers starting fromm index 0.
CHECK_EQ(0, first_reg.index());
int register_count =
static_cast<int>(bytecode_iterator().GetRegisterCountOperand(3));
static_cast<int>(bytecode_iterator().GetRegisterCountOperand(2));
// Bijection between registers and array indices must match that used in
// InterpreterAssembler::ExportRegisterFile.
......@@ -2766,11 +2853,6 @@ void BytecodeGraphBuilder::VisitResumeGenerator() {
environment()->BindRegister(interpreter::Register(i), value);
}
// We're no longer resuming, so update the state register.
environment()->BindRegister(
generator_state_reg,
jsgraph()->SmiConstant(JSGeneratorObject::kGeneratorExecuting));
// Update the accumulator with the generator's input_or_debug_pos.
Node* input_or_debug_pos =
NewNode(javascript()->GeneratorRestoreInputOrDebugPos(), generator);
......@@ -2812,12 +2894,29 @@ void BytecodeGraphBuilder::BuildLoopHeaderEnvironment(int current_offset) {
const BytecodeLivenessState* liveness =
bytecode_analysis()->GetInLivenessFor(current_offset);
const auto& resume_jump_targets = loop_info.resume_jump_targets();
bool generate_suspend_switch = !resume_jump_targets.empty();
// Add loop header.
environment()->PrepareForLoop(loop_info.assignments(), liveness);
// Store a copy of the environment so we can connect merged back edge inputs
// to the loop header.
merge_environments_[current_offset] = environment()->Copy();
// If this loop contains resumes, create a new switch just after the loop
// for those resumes.
if (generate_suspend_switch) {
BuildSwitchOnGeneratorState(loop_info.resume_jump_targets(), true);
// TODO(leszeks): At this point we know we are executing rather than
// resuming, so we should be able to prune off the phis in the environment
// related to the resume path.
// Set the generator state to a known constant.
environment()->BindGeneratorState(
jsgraph()->SmiConstant(JSGeneratorObject::kGeneratorExecuting));
}
}
}
......
......@@ -252,6 +252,9 @@ class BytecodeGraphBuilder {
void BuildJumpIfJSReceiver();
void BuildSwitchOnSmi(Node* condition);
void BuildSwitchOnGeneratorState(
const ZoneVector<ResumeJumpTarget>& resume_jump_targets,
bool allow_fallthrough_on_executing);
// Simulates control flow by forward-propagating environments.
void MergeIntoSuccessorEnvironment(int target_offset);
......@@ -382,9 +385,18 @@ class BytecodeGraphBuilder {
// Merge environments are snapshots of the environment at points where the
// control flow merges. This models a forward data flow propagation of all
// values from all predecessors of the merge in question.
// values from all predecessors of the merge in question. They are indexed by
// the bytecode offset
ZoneMap<int, Environment*> merge_environments_;
// Generator merge environments are snapshots of the current resume
// environment, tracing back through loop headers to the resume switch of a
// generator. They allow us to model a single resume jump as several switch
// statements across loop headers, keeping those loop headers reducible,
// without having to merge the "executing" environments of the generator into
// the "resuming" ones. They are indexed by the suspend id of the resume.
ZoneMap<int, Environment*> generator_merge_environments_;
// Exception handlers currently entered by the iteration.
ZoneStack<ExceptionHandler> exception_handlers_;
int current_exception_handler_;
......
......@@ -742,7 +742,7 @@ class V8_EXPORT_PRIVATE JSOperatorBuilder final
// Used to implement Ignition's SuspendGenerator bytecode.
const Operator* GeneratorStore(int register_count);
// Used to implement Ignition's RestoreGeneratorState bytecode.
// Used to implement Ignition's SwitchOnGeneratorState bytecode.
const Operator* GeneratorRestoreContinuation();
// Used to implement Ignition's ResumeGenerator bytecode.
const Operator* GeneratorRestoreRegister(int index);
......
......@@ -206,12 +206,18 @@ int BytecodeArrayAccessor::GetJumpTargetOffset() const {
JumpTableTargetOffsets BytecodeArrayAccessor::GetJumpTableTargetOffsets()
const {
DCHECK_EQ(current_bytecode(), Bytecode::kSwitchOnSmiNoFeedback);
uint32_t table_start = GetIndexOperand(0);
uint32_t table_size = GetUnsignedImmediateOperand(1);
int32_t case_value_base = GetImmediateOperand(2);
uint32_t table_start, table_size;
int32_t case_value_base;
if (current_bytecode() == Bytecode::kSwitchOnGeneratorState) {
table_start = GetIndexOperand(1);
table_size = GetUnsignedImmediateOperand(2);
case_value_base = 0;
} else {
DCHECK_EQ(current_bytecode(), Bytecode::kSwitchOnSmiNoFeedback);
table_start = GetIndexOperand(0);
table_size = GetUnsignedImmediateOperand(1);
case_value_base = GetImmediateOperand(2);
}
return JumpTableTargetOffsets(this, table_start, table_size, case_value_base);
}
......
......@@ -1271,16 +1271,19 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::SuspendGenerator(
return *this;
}
BytecodeArrayBuilder& BytecodeArrayBuilder::RestoreGeneratorState(
Register generator) {
OutputRestoreGeneratorState(generator);
BytecodeArrayBuilder& BytecodeArrayBuilder::SwitchOnGeneratorState(
Register generator, BytecodeJumpTable* jump_table) {
DCHECK_EQ(jump_table->case_value_base(), 0);
BytecodeNode node(CreateSwitchOnGeneratorStateNode(
generator, jump_table->constant_pool_index(), jump_table->size()));
WriteSwitch(&node, jump_table);
LeaveBasicBlock();
return *this;
}
BytecodeArrayBuilder& BytecodeArrayBuilder::ResumeGenerator(
Register generator, Register generator_state, RegisterList registers) {
OutputResumeGenerator(generator, generator_state, registers,
registers.register_count());
Register generator, RegisterList registers) {
OutputResumeGenerator(generator, registers, registers.register_count());
return *this;
}
......
......@@ -430,9 +430,9 @@ class V8_EXPORT_PRIVATE BytecodeArrayBuilder final {
BytecodeArrayBuilder& SuspendGenerator(Register generator,
RegisterList registers,
int suspend_id);
BytecodeArrayBuilder& RestoreGeneratorState(Register generator);
BytecodeArrayBuilder& SwitchOnGeneratorState(Register generator,
BytecodeJumpTable* jump_table);
BytecodeArrayBuilder& ResumeGenerator(Register generator,
Register generator_state,
RegisterList registers);
// Exception handling.
......
......@@ -159,6 +159,7 @@ void BytecodeArrayWriter::UpdateExitSeenInBlock(Bytecode bytecode) {
case Bytecode::kJump:
case Bytecode::kJumpConstant:
case Bytecode::kSuspendGenerator:
case Bytecode::kSwitchOnGeneratorState:
exit_seen_in_block_ = true;
break;
default:
......
......@@ -878,7 +878,6 @@ BytecodeGenerator::BytecodeGenerator(
execution_result_(nullptr),
incoming_new_target_or_generator_(),
generator_jump_table_(nullptr),
generator_state_(),
loop_depth_(0),
catch_prediction_(HandlerTable::UNCAUGHT) {
DCHECK_EQ(closure_scope(), closure_scope()->GetClosureScope());
......@@ -1091,8 +1090,6 @@ void BytecodeGenerator::GenerateBytecodeBody() {
void BytecodeGenerator::AllocateTopLevelRegisters() {
if (info()->literal()->CanSuspend()) {
// Allocate a register for generator_state_.
generator_state_ = register_allocator()->NewRegister();
// Either directly use generator_object_var or allocate a new register for
// the incoming generator object.
Variable* generator_object_var = closure_scope()->generator_object_var();
......@@ -1124,39 +1121,11 @@ void BytecodeGenerator::VisitIterationHeader(IterationStatement* stmt,
void BytecodeGenerator::VisitIterationHeader(int first_suspend_id,
int suspend_count,
LoopBuilder* loop_builder) {
// Recall that suspend_count is always zero inside ordinary (i.e.
// non-generator) functions.
if (suspend_count == 0) {
loop_builder->LoopHeader();
} else {
loop_builder->LoopHeaderInGenerator(&generator_jump_table_,
first_suspend_id, suspend_count);
// Perform state dispatch on the generator state, assuming this is a resume.
builder()
->LoadAccumulatorWithRegister(generator_state_)
.SwitchOnSmiNoFeedback(generator_jump_table_);
// We fall through when the generator state is not in the jump table. If we
// are not resuming, we want to fall through to the loop body.
// TODO(leszeks): Only generate this test for debug builds, we can skip it
// entirely in release assuming that the generator states is always valid.
BytecodeLabel not_resuming;
builder()
->LoadLiteral(Smi::FromInt(JSGeneratorObject::kGeneratorExecuting))
.CompareOperation(Token::Value::EQ_STRICT, generator_state_)
.JumpIfTrue(ToBooleanMode::kAlreadyBoolean, &not_resuming);
// Otherwise this is an error.
builder()->Abort(AbortReason::kInvalidJumpTableIndex);
builder()->Bind(&not_resuming);
}
loop_builder->LoopHeader();
}
void BytecodeGenerator::BuildGeneratorPrologue() {
DCHECK_GT(info()->literal()->suspend_count(), 0);
DCHECK(generator_state_.is_valid());
DCHECK(generator_object().is_valid());
generator_jump_table_ =
builder()->AllocateJumpTable(info()->literal()->suspend_count(), 0);
......@@ -1174,19 +1143,12 @@ void BytecodeGenerator::BuildGeneratorPrologue() {
builder()
->CallRuntime(Runtime::kInlineGeneratorGetContext, generator_object())
.PushContext(generator_context)
.RestoreGeneratorState(generator_object())
.StoreAccumulatorInRegister(generator_state_)
.SwitchOnSmiNoFeedback(generator_jump_table_);
.SwitchOnGeneratorState(generator_object(), generator_jump_table_);
// The switch is guaranteed to jump (or abort), so there is no fall-through.
}
// We fall through when the generator state is not in the jump table.
// TODO(leszeks): Only generate this for debug builds.
builder()->Abort(AbortReason::kInvalidJumpTableIndex);
// This is a regular call.
builder()
->Bind(&regular_call)
.LoadLiteral(Smi::FromInt(JSGeneratorObject::kGeneratorExecuting))
.StoreAccumulatorInRegister(generator_state_);
builder()->Bind(&regular_call);
// Now fall through to the ordinary function prologue, after which we will run
// into the generator object creation and other extra code inserted by the
// parser.
......@@ -2878,10 +2840,9 @@ void BytecodeGenerator::BuildSuspendPoint(int suspend_id,
// Upon resume, we continue here.
builder()->Bind(generator_jump_table_, suspend_id);
// Clobbers all registers, updating the state to indicate that we have
// finished resuming and setting the accumulator to the [[input_or_debug_pos]]
// slot of the generator object.
builder()->ResumeGenerator(generator_object(), generator_state_, registers);
// Clobbers all registers and sets the accumulator to the
// [[input_or_debug_pos]] slot of the generator object.
builder()->ResumeGenerator(generator_object(), registers);
}
void BytecodeGenerator::VisitYield(Yield* expr) {
......
......@@ -345,7 +345,6 @@ class BytecodeGenerator final : public AstVisitor<BytecodeGenerator> {
Register incoming_new_target_or_generator_;
BytecodeJumpTable* generator_jump_table_;
Register generator_state_;
int loop_depth_;
HandlerTable::CatchPrediction catch_prediction_;
......
......@@ -314,11 +314,12 @@ namespace interpreter {
V(ThrowSuperAlreadyCalledIfNotHole, AccumulatorUse::kRead) \
\
/* Generators */ \
V(RestoreGeneratorState, AccumulatorUse::kWrite, OperandType::kReg) \
V(SwitchOnGeneratorState, AccumulatorUse::kNone, OperandType::kReg, \
OperandType::kIdx, OperandType::kUImm) \
V(SuspendGenerator, AccumulatorUse::kRead, OperandType::kReg, \
OperandType::kRegList, OperandType::kRegCount, OperandType::kUImm) \
V(ResumeGenerator, AccumulatorUse::kWrite, OperandType::kReg, \
OperandType::kRegOut, OperandType::kRegOutList, OperandType::kRegCount) \
OperandType::kRegOutList, OperandType::kRegCount) \
\
/* Debugger */ \
V(Debugger, AccumulatorUse::kNone) \
......@@ -626,7 +627,8 @@ class V8_EXPORT_PRIVATE Bytecodes final : public AllStatic {
// Returns true if the bytecode is a switch.
static constexpr bool IsSwitch(Bytecode bytecode) {
return bytecode == Bytecode::kSwitchOnSmiNoFeedback;
return bytecode == Bytecode::kSwitchOnSmiNoFeedback ||
bytecode == Bytecode::kSwitchOnGeneratorState;
}
// Returns true if |bytecode| has no effects. These bytecodes only manipulate
......
......@@ -3108,38 +3108,53 @@ IGNITION_HANDLER(SuspendGenerator, InterpreterAssembler) {
Return(GetAccumulator());
}
// RestoreGeneratorState <generator>
// SwitchOnGeneratorState <generator> <table_start> <table_length>
//
// Loads the generator's state and stores it in the accumulator,
// before overwriting it with kGeneratorExecuting.
IGNITION_HANDLER(RestoreGeneratorState, InterpreterAssembler) {
// Loads the |generator|'s state and stores it in the accumulator, before
// overwriting it with kGeneratorExecuting. Then, jumps to the appropriate
// resume bytecode, by looking up the generator state in a jump table in the
// constant pool, starting at |table_start|, and of length |table_length|.
IGNITION_HANDLER(SwitchOnGeneratorState, InterpreterAssembler) {
Node* generator_reg = BytecodeOperandReg(0);
Node* generator = LoadRegister(generator_reg);
Node* old_state =
Node* state =
LoadObjectField(generator, JSGeneratorObject::kContinuationOffset);
Node* new_state = Int32Constant(JSGeneratorObject::kGeneratorExecuting);
Node* new_state = SmiConstant(JSGeneratorObject::kGeneratorExecuting);
StoreObjectField(generator, JSGeneratorObject::kContinuationOffset,
SmiTag(new_state));
SetAccumulator(old_state);
new_state);
Dispatch();
Node* table_start = BytecodeOperandIdx(1);
// TODO(leszeks): table_length is only used for a CSA_ASSERT, we don't
// actually need it otherwise.
Node* table_length = BytecodeOperandUImmWord(2);
// The state must be a Smi.
CSA_ASSERT(this, TaggedIsSmi(state));
Node* case_value = SmiUntag(state);
CSA_ASSERT(this, IntPtrGreaterThanOrEqual(case_value, IntPtrConstant(0)));
CSA_ASSERT(this, IntPtrLessThan(case_value, table_length));
USE(table_length);
Node* entry = IntPtrAdd(table_start, case_value);
Node* relative_jump = LoadAndUntagConstantPoolEntry(entry);
Jump(relative_jump);
}
// ResumeGenerator <generator> <generator_state> <first output
// register> <register count>
// ResumeGenerator <generator> <first output register> <register count>
//
// Imports the register file stored in the generator and marks the generator
// state as executing.
IGNITION_HANDLER(ResumeGenerator, InterpreterAssembler) {
Node* generator_reg = BytecodeOperandReg(0);
Node* generator_state_reg = BytecodeOperandReg(1);
// Bytecode operand 2 is the start register. It should always be 0, so let's
// Bytecode operand 1 is the start register. It should always be 0, so let's
// ignore it.
CSA_ASSERT(this, WordEqual(BytecodeOperandReg(2),
CSA_ASSERT(this, WordEqual(BytecodeOperandReg(1),
IntPtrConstant(Register(0).ToOperand())));
// Bytecode operand 3 is the number of registers to store to the generator.
Node* register_count = ChangeUint32ToWord(BytecodeOperandCount(3));
// Bytecode operand 2 is the number of registers to store to the generator.
Node* register_count = ChangeUint32ToWord(BytecodeOperandCount(2));
Node* generator = LoadRegister(generator_reg);
......@@ -3147,11 +3162,6 @@ IGNITION_HANDLER(ResumeGenerator, InterpreterAssembler) {
LoadObjectField(generator, JSGeneratorObject::kRegisterFileOffset),
register_count);
// Since we're resuming, update the generator state to indicate that the
// generator is now executing.
StoreRegister(SmiConstant(JSGeneratorObject::kGeneratorExecuting),
generator_state_reg);
// Return the generator's input_or_debug_pos in the accumulator.
SetAccumulator(
LoadObjectField(generator, JSGeneratorObject::kInputOrDebugPosOffset));
......
......@@ -12,107 +12,102 @@ snippet: "
async function* f() { }
f();
"
frame size: 9
frame size: 8
parameter count: 1
bytecode array length: 214
bytecode array length: 202
bytecodes: [
B(Ldar), R(0),
B(JumpIfUndefined), U8(18),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(0), U8(1),
B(PushContext), R(2),
B(RestoreGeneratorState), R(0),
B(Star), R(1),
B(SwitchOnSmiNoFeedback), U8(0), U8(2), I8(0),
B(Abort), U8(15),
B(LdaSmi), I8(-2),
B(Star), R(1),
B(Mov), R(closure), R(2),
B(Mov), R(this), R(3),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(2), U8(2),
B(PushContext), R(1),
B(SwitchOnGeneratorState), R(0), U8(0), U8(2),
B(Mov), R(closure), R(1),
B(Mov), R(this), R(2),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(1), U8(2),
B(Star), R(0),
/* 17 E> */ B(StackCheck),
B(Mov), R(context), R(3),
B(Mov), R(context), R(4),
B(Mov), R(context), R(5),
B(Ldar), R(0),
/* 17 E> */ B(SuspendGenerator), R(0), R(0), U8(6), U8(0),
B(ResumeGenerator), R(0), R(1), R(0), U8(6),
B(Star), R(6),
/* 17 E> */ B(SuspendGenerator), R(0), R(0), U8(5), U8(0),
B(ResumeGenerator), R(0), R(0), U8(5),
B(Star), R(5),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(6),
B(Ldar), R(5),
/* 17 E> */ B(Throw),
B(LdaZero),
B(Star), R(2),
B(Mov), R(6), R(3),
B(Jump), U8(99),
B(Star), R(1),
B(Mov), R(5), R(2),
B(Jump), U8(98),
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),
B(ResumeGenerator), R(0), R(1), R(0), U8(6),
B(Star), R(6),
B(Mov), R(0), R(5),
B(CallJSRuntime), U8(%async_generator_await_uncaught), R(5), U8(2),
B(SuspendGenerator), R(0), R(0), U8(5), U8(1),
B(ResumeGenerator), R(0), R(0), U8(5),
B(Star), R(5),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(Star), R(7),
B(Star), R(6),
B(LdaZero),
B(TestEqualStrictNoFeedback), R(7),
B(TestEqualStrictNoFeedback), R(6),
B(JumpIfTrue), U8(5),
B(Ldar), R(6),
B(Ldar), R(5),
B(ReThrow),
B(LdaZero),
B(Star), R(2),
B(Mov), R(6), R(3),
B(Star), R(1),
B(Mov), R(5), R(2),
B(Jump), U8(55),
B(Jump), U8(39),
B(Star), R(6),
B(Ldar), R(closure),
B(CreateCatchContext), R(6), U8(4), U8(5),
B(Star), R(5),
B(Ldar), R(closure),
B(CreateCatchContext), R(5), U8(4), U8(5),
B(Star), R(4),
B(LdaTheHole),
B(SetPendingMessage),
B(Ldar), R(5),
B(PushContext), R(6),
B(Ldar), R(4),
B(PushContext), R(5),
B(LdaImmutableCurrentContextSlot), U8(4),
B(Star), R(8),
B(Mov), R(0), R(7),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorReject), R(7), U8(2),
B(PopContext), R(6),
B(Star), R(3),
B(LdaSmi), I8(1),
B(Star), R(7),
B(Mov), R(0), R(6),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorReject), R(6), U8(2),
B(PopContext), R(5),
B(Star), R(2),
B(LdaSmi), I8(1),
B(Star), R(1),
B(Jump), U8(16),
B(LdaSmi), I8(-1),
B(Star), R(3),
B(Star), R(2),
B(Star), R(1),
B(Jump), U8(8),
B(Star), R(3),
B(LdaSmi), I8(2),
B(Star), R(2),
B(LdaSmi), I8(2),
B(Star), R(1),
B(LdaTheHole),
B(SetPendingMessage),
B(Star), R(4),
B(Star), R(3),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(0), U8(1),
B(Ldar), R(4),
B(Ldar), R(3),
B(SetPendingMessage),
B(Ldar), R(2),
B(Ldar), R(1),
B(SwitchOnSmiNoFeedback), U8(6), U8(3), I8(0),
B(Jump), U8(22),
B(LdaTrue),
B(Star), R(7),
B(Mov), R(0), R(5),
B(Mov), R(3), R(6),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorResolve), R(5), U8(3),
B(Star), R(6),
B(Mov), R(0), R(4),
B(Mov), R(2), R(5),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorResolve), R(4), U8(3),
/* 22 S> */ B(Return),
B(Ldar), R(3),
B(Ldar), R(2),
/* 22 S> */ B(Return),
B(Ldar), R(3),
B(Ldar), R(2),
B(ReThrow),
B(LdaUndefined),
/* 22 S> */ B(Return),
]
constant pool: [
Smi [36],
Smi [77],
Smi [30],
Smi [70],
Smi [15],
Smi [7],
ONE_BYTE_INTERNALIZED_STRING_TYPE [".catch"],
......@@ -122,8 +117,8 @@ constant pool: [
Smi [23],
]
handlers: [
[40, 159, 167],
[43, 120, 122],
[30, 147, 155],
[33, 108, 110],
]
---
......@@ -131,125 +126,120 @@ snippet: "
async function* f() { yield 42 }
f();
"
frame size: 9
frame size: 8
parameter count: 1
bytecode array length: 259
bytecode array length: 246
bytecodes: [
B(Ldar), R(0),
B(JumpIfUndefined), U8(18),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(0), U8(1),
B(PushContext), R(2),
B(RestoreGeneratorState), R(0),
B(Star), R(1),
B(SwitchOnSmiNoFeedback), U8(0), U8(3), I8(0),
B(Abort), U8(15),
B(LdaSmi), I8(-2),
B(Star), R(1),
B(Mov), R(closure), R(2),
B(Mov), R(this), R(3),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(2), U8(2),
B(PushContext), R(1),
B(SwitchOnGeneratorState), R(0), U8(0), U8(3),
B(Mov), R(closure), R(1),
B(Mov), R(this), R(2),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(1), U8(2),
B(Star), R(0),
/* 17 E> */ B(StackCheck),
B(Mov), R(context), R(3),
B(Mov), R(context), R(4),
B(Mov), R(context), R(5),
B(Ldar), R(0),
/* 17 E> */ B(SuspendGenerator), R(0), R(0), U8(6), U8(0),
B(ResumeGenerator), R(0), R(1), R(0), U8(6),
B(Star), R(6),
/* 17 E> */ B(SuspendGenerator), R(0), R(0), U8(5), U8(0),
B(ResumeGenerator), R(0), R(0), U8(5),
B(Star), R(5),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(3), U8(2), I8(0),
B(Ldar), R(6),
B(Ldar), R(5),
/* 17 E> */ B(Throw),
B(LdaZero),
B(Star), R(2),
B(Mov), R(6), R(3),
B(Jump), U8(144),
B(Star), R(1),
B(Mov), R(5), R(2),
B(Jump), U8(142),
/* 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),
/* 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(LdaFalse),
B(Star), R(7),
B(Mov), R(0), R(5),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorYield), R(5), U8(3),
/* 22 E> */ B(SuspendGenerator), R(0), R(0), U8(5), U8(1),
B(ResumeGenerator), R(0), R(0), U8(5),
B(Star), R(5),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(5), U8(2), I8(0),
B(Ldar), R(6),
B(Ldar), R(5),
/* 22 E> */ B(Throw),
B(LdaZero),
B(Star), R(2),
B(Mov), R(6), R(3),
B(Jump), U8(99),
B(Star), R(1),
B(Mov), R(5), R(2),
B(Jump), U8(98),
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),
B(ResumeGenerator), R(0), R(1), R(0), U8(6),
B(Star), R(6),
B(Mov), R(0), R(5),
B(CallJSRuntime), U8(%async_generator_await_uncaught), R(5), U8(2),
B(SuspendGenerator), R(0), R(0), U8(5), U8(2),
B(ResumeGenerator), R(0), R(0), U8(5),
B(Star), R(5),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(Star), R(7),
B(Star), R(6),
B(LdaZero),
B(TestEqualStrictNoFeedback), R(7),
B(TestEqualStrictNoFeedback), R(6),
B(JumpIfTrue), U8(5),
B(Ldar), R(6),
B(Ldar), R(5),
B(ReThrow),
B(LdaZero),
B(Star), R(2),
B(Mov), R(6), R(3),
B(Star), R(1),
B(Mov), R(5), R(2),
B(Jump), U8(55),
B(Jump), U8(39),
B(Star), R(6),
B(Ldar), R(closure),
B(CreateCatchContext), R(6), U8(7), U8(8),
B(Star), R(5),
B(Ldar), R(closure),
B(CreateCatchContext), R(5), U8(7), U8(8),
B(Star), R(4),
B(LdaTheHole),
B(SetPendingMessage),
B(Ldar), R(5),
B(PushContext), R(6),
B(Ldar), R(4),
B(PushContext), R(5),
B(LdaImmutableCurrentContextSlot), U8(4),
B(Star), R(8),
B(Mov), R(0), R(7),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorReject), R(7), U8(2),
B(PopContext), R(6),
B(Star), R(3),
B(LdaSmi), I8(1),
B(Star), R(7),
B(Mov), R(0), R(6),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorReject), R(6), U8(2),
B(PopContext), R(5),
B(Star), R(2),
B(LdaSmi), I8(1),
B(Star), R(1),
B(Jump), U8(16),
B(LdaSmi), I8(-1),
B(Star), R(3),
B(Star), R(2),
B(Star), R(1),
B(Jump), U8(8),
B(Star), R(3),
B(LdaSmi), I8(2),
B(Star), R(2),
B(LdaSmi), I8(2),
B(Star), R(1),
B(LdaTheHole),
B(SetPendingMessage),
B(Star), R(4),
B(Star), R(3),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(0), U8(1),
B(Ldar), R(4),
B(Ldar), R(3),
B(SetPendingMessage),
B(Ldar), R(2),
B(Ldar), R(1),
B(SwitchOnSmiNoFeedback), U8(9), U8(3), I8(0),
B(Jump), U8(22),
B(LdaTrue),
B(Star), R(7),
B(Mov), R(0), R(5),
B(Mov), R(3), R(6),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorResolve), R(5), U8(3),
B(Star), R(6),
B(Mov), R(0), R(4),
B(Mov), R(2), R(5),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorResolve), R(4), U8(3),
/* 31 S> */ B(Return),
B(Ldar), R(3),
B(Ldar), R(2),
/* 31 S> */ B(Return),
B(Ldar), R(3),
B(Ldar), R(2),
B(ReThrow),
B(LdaUndefined),
/* 31 S> */ B(Return),
]
constant pool: [
Smi [36],
Smi [81],
Smi [122],
Smi [30],
Smi [74],
Smi [114],
Smi [15],
Smi [7],
Smi [15],
......@@ -261,8 +251,8 @@ constant pool: [
Smi [23],
]
handlers: [
[40, 204, 212],
[43, 165, 167],
[30, 191, 199],
[33, 152, 154],
]
---
......@@ -270,68 +260,57 @@ snippet: "
async function* f() { for (let x of [42]) yield x }
f();
"
frame size: 23
frame size: 22
parameter count: 1
bytecode array length: 533
bytecode array length: 506
bytecodes: [
B(Ldar), R(2),
B(JumpIfUndefined), U8(18),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(2), U8(1),
B(PushContext), R(12),
B(RestoreGeneratorState), R(2),
B(Star), R(11),
B(SwitchOnSmiNoFeedback), U8(0), U8(3), I8(0),
B(Abort), U8(15),
B(LdaSmi), I8(-2),
B(Star), R(11),
B(Mov), R(closure), R(12),
B(Mov), R(this), R(13),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(12), U8(2),
B(PushContext), R(11),
B(SwitchOnGeneratorState), R(2), U8(0), U8(3),
B(Mov), R(closure), R(11),
B(Mov), R(this), R(12),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(11), U8(2),
B(Star), R(2),
/* 17 E> */ B(StackCheck),
B(Mov), R(context), R(13),
B(Mov), R(context), R(14),
B(Mov), R(context), R(15),
B(Ldar), R(2),
/* 17 E> */ B(SuspendGenerator), R(2), R(0), U8(16), U8(0),
B(ResumeGenerator), R(2), R(11), R(0), U8(16),
B(Star), R(16),
/* 17 E> */ B(SuspendGenerator), R(2), R(0), U8(15), U8(0),
B(ResumeGenerator), R(2), R(0), U8(15),
B(Star), R(15),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
B(SwitchOnSmiNoFeedback), U8(3), U8(2), I8(0),
B(Ldar), R(16),
B(Ldar), R(15),
/* 17 E> */ B(Throw),
B(LdaZero),
B(Star), R(12),
B(Mov), R(16), R(13),
B(JumpConstant), U8(20),
B(Star), R(11),
B(Mov), R(15), R(12),
B(JumpConstant), U8(19),
B(LdaZero),
B(Star), R(7),
B(Mov), R(context), R(17),
B(Mov), R(context), R(18),
B(Mov), R(context), R(19),
/* 36 S> */ B(CreateArrayLiteral), U8(5), U8(0), U8(37),
B(Star), R(19),
B(LdaNamedProperty), R(19), U8(6), U8(1),
B(Star), R(20),
B(LdaNamedProperty), R(20), U8(6), U8(1),
B(Star), R(21),
B(CallProperty0), R(21), R(20), U8(3),
B(CallProperty0), R(20), R(19), U8(3),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowSymbolIteratorInvalid), R(0), U8(0),
B(Star), R(4),
/* 36 E> */ B(LdaNamedProperty), R(4), U8(7), U8(5),
B(Star), R(5),
B(Ldar), R(11),
B(SwitchOnSmiNoFeedback), U8(8), U8(1), I8(1),
B(LdaSmi), I8(-2),
B(TestEqualStrictNoFeedback), R(11),
B(JumpIfTrue), U8(4),
B(Abort), U8(15),
/* 31 S> */ B(CallProperty0), R(5), R(4), U8(7),
B(Star), R(6),
/* 31 E> */ B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(6), U8(1),
B(ToBooleanLogicalNot),
B(JumpIfFalse), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(6), U8(1),
B(LdaNamedProperty), R(6), U8(9), U8(9),
B(JumpIfToBooleanTrue), U8(69),
B(LdaNamedProperty), R(6), U8(10), U8(11),
B(LdaNamedProperty), R(6), U8(8), U8(9),
B(JumpIfToBooleanTrue), U8(68),
B(LdaNamedProperty), R(6), U8(9), U8(11),
B(Star), R(8),
B(LdaSmi), I8(2),
B(Star), R(7),
......@@ -339,56 +318,56 @@ bytecodes: [
/* 22 E> */ B(StackCheck),
B(Mov), R(3), R(0),
/* 42 S> */ B(LdaFalse),
B(Star), R(22),
B(Mov), R(2), R(20),
B(Mov), R(0), R(21),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorYield), R(20), U8(3),
/* 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(Star), R(21),
B(Mov), R(2), R(19),
B(Mov), R(0), R(20),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorYield), R(19), U8(3),
/* 42 E> */ B(SuspendGenerator), R(2), R(0), U8(19), U8(1),
B(ResumeGenerator), R(2), R(0), U8(19),
B(Star), R(19),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
B(SwitchOnSmiNoFeedback), U8(11), U8(2), I8(0),
B(Ldar), R(20),
B(SwitchOnSmiNoFeedback), U8(10), U8(2), I8(0),
B(Ldar), R(19),
/* 42 E> */ B(Throw),
B(LdaZero),
B(Star), R(16),
B(Mov), R(20), R(17),
B(Star), R(15),
B(Mov), R(19), R(16),
B(Jump), U8(62),
B(LdaZero),
B(Star), R(7),
B(JumpLoop), U8(102), I8(0),
B(JumpLoop), U8(87), I8(0),
B(Jump), U8(40),
B(Star), R(20),
B(Ldar), R(closure),
B(CreateCatchContext), R(20), U8(13), U8(14),
B(Star), R(19),
B(Ldar), R(closure),
B(CreateCatchContext), R(19), U8(12), U8(13),
B(Star), R(18),
B(LdaTheHole),
B(SetPendingMessage),
B(Ldar), R(19),
B(PushContext), R(20),
B(Ldar), R(18),
B(PushContext), R(19),
B(LdaSmi), I8(2),
B(TestEqualStrict), R(7), U8(13),
B(JumpIfFalse), U8(6),
B(LdaSmi), I8(1),
B(Star), R(7),
B(LdaImmutableCurrentContextSlot), U8(4),
B(Star), R(21),
B(CallRuntime), U16(Runtime::kReThrow), R(21), U8(1),
B(PopContext), R(20),
B(Star), R(20),
B(CallRuntime), U16(Runtime::kReThrow), R(20), U8(1),
B(PopContext), R(19),
B(LdaSmi), I8(-1),
B(Star), R(17),
B(Star), R(16),
B(Star), R(15),
B(Jump), U8(8),
B(Star), R(17),
B(LdaSmi), I8(1),
B(Star), R(16),
B(LdaSmi), I8(1),
B(Star), R(15),
B(LdaTheHole),
B(SetPendingMessage),
B(Star), R(18),
B(Star), R(17),
B(LdaZero),
B(TestEqualStrict), R(7), U8(14),
B(JumpIfTrue), U8(90),
B(LdaNamedProperty), R(4), U8(15), U8(15),
B(LdaNamedProperty), R(4), U8(14), U8(15),
B(Star), R(9),
B(TestUndetectable),
B(JumpIfFalse), U8(4),
......@@ -401,114 +380,113 @@ bytecodes: [
B(JumpIfFalse), U8(4),
B(Jump), U8(18),
B(Wide), B(LdaSmi), I16(144),
B(Star), R(18),
B(LdaConstant), U8(15),
B(Star), R(19),
B(LdaConstant), U8(16),
B(Star), R(20),
B(CallRuntime), U16(Runtime::kNewTypeError), R(19), U8(2),
B(CallRuntime), U16(Runtime::kNewTypeError), R(18), U8(2),
B(Throw),
B(Mov), R(context), R(19),
B(Mov), R(9), R(20),
B(Mov), R(4), R(21),
B(InvokeIntrinsic), U8(Runtime::k_Call), R(20), U8(2),
B(Mov), R(context), R(18),
B(Mov), R(9), R(19),
B(Mov), R(4), R(20),
B(InvokeIntrinsic), U8(Runtime::k_Call), R(19), U8(2),
B(Jump), U8(6),
B(LdaTheHole),
B(SetPendingMessage),
B(Ldar), R(19),
B(Ldar), R(18),
B(Jump), U8(27),
B(Mov), R(9), R(19),
B(Mov), R(4), R(20),
B(InvokeIntrinsic), U8(Runtime::k_Call), R(19), U8(2),
B(Mov), R(9), R(18),
B(Mov), R(4), R(19),
B(InvokeIntrinsic), U8(Runtime::k_Call), R(18), U8(2),
B(Star), R(10),
B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(10), U8(1),
B(JumpIfToBooleanFalse), U8(4),
B(Jump), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(10), U8(1),
B(Ldar), R(18),
B(Ldar), R(17),
B(SetPendingMessage),
B(Ldar), R(16),
B(SwitchOnSmiNoFeedback), U8(17), U8(2), I8(0),
B(Ldar), R(15),
B(SwitchOnSmiNoFeedback), U8(16), U8(2), I8(0),
B(Jump), U8(13),
B(LdaZero),
B(Star), R(12),
B(Mov), R(17), R(13),
B(Jump), U8(102),
B(Ldar), R(17),
B(Star), R(11),
B(Mov), R(16), R(12),
B(Jump), U8(101),
B(Ldar), R(16),
B(ReThrow),
B(LdaUndefined),
B(Star), R(17),
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),
B(ResumeGenerator), R(2), R(11), R(0), U8(16),
B(Star), R(16),
B(Mov), R(2), R(15),
B(CallJSRuntime), U8(%async_generator_await_uncaught), R(15), U8(2),
B(SuspendGenerator), R(2), R(0), U8(15), U8(2),
B(ResumeGenerator), R(2), R(0), U8(15),
B(Star), R(15),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
B(Star), R(17),
B(Star), R(16),
B(LdaZero),
B(TestEqualStrictNoFeedback), R(17),
B(TestEqualStrictNoFeedback), R(16),
B(JumpIfTrue), U8(5),
B(Ldar), R(16),
B(Ldar), R(15),
B(ReThrow),
B(LdaZero),
B(Star), R(12),
B(Mov), R(16), R(13),
B(Star), R(11),
B(Mov), R(15), R(12),
B(Jump), U8(55),
B(Jump), U8(39),
B(Star), R(16),
B(Ldar), R(closure),
B(CreateCatchContext), R(16), U8(13), U8(19),
B(Star), R(15),
B(Ldar), R(closure),
B(CreateCatchContext), R(15), U8(12), U8(18),
B(Star), R(14),
B(LdaTheHole),
B(SetPendingMessage),
B(Ldar), R(15),
B(PushContext), R(16),
B(Ldar), R(14),
B(PushContext), R(15),
B(LdaImmutableCurrentContextSlot), U8(4),
B(Star), R(18),
B(Mov), R(2), R(17),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorReject), R(17), U8(2),
B(PopContext), R(16),
B(Star), R(13),
B(LdaSmi), I8(1),
B(Star), R(17),
B(Mov), R(2), R(16),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorReject), R(16), U8(2),
B(PopContext), R(15),
B(Star), R(12),
B(LdaSmi), I8(1),
B(Star), R(11),
B(Jump), U8(16),
B(LdaSmi), I8(-1),
B(Star), R(13),
B(Star), R(12),
B(Star), R(11),
B(Jump), U8(8),
B(Star), R(13),
B(LdaSmi), I8(2),
B(Star), R(12),
B(LdaSmi), I8(2),
B(Star), R(11),
B(LdaTheHole),
B(SetPendingMessage),
B(Star), R(14),
B(Star), R(13),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(2), U8(1),
B(Ldar), R(14),
B(Ldar), R(13),
B(SetPendingMessage),
B(Ldar), R(12),
B(SwitchOnSmiNoFeedback), U8(21), U8(3), I8(0),
B(Ldar), R(11),
B(SwitchOnSmiNoFeedback), U8(20), U8(3), I8(0),
B(Jump), U8(22),
B(LdaTrue),
B(Star), R(17),
B(Mov), R(2), R(15),
B(Mov), R(13), R(16),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorResolve), R(15), U8(3),
B(Star), R(16),
B(Mov), R(2), R(14),
B(Mov), R(12), R(15),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorResolve), R(14), U8(3),
/* 50 S> */ B(Return),
B(Ldar), R(13),
B(Ldar), R(12),
/* 50 S> */ B(Return),
B(Ldar), R(13),
B(Ldar), R(12),
B(ReThrow),
B(LdaUndefined),
/* 50 S> */ B(Return),
]
constant pool: [
Smi [36],
Smi [102],
Smi [396],
Smi [30],
Smi [154],
Smi [374],
Smi [15],
Smi [7],
TUPLE2_TYPE,
SYMBOL_TYPE,
ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
Smi [71],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["done"],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"],
Smi [15],
......@@ -520,17 +498,17 @@ constant pool: [
Smi [6],
Smi [14],
FIXED_ARRAY_TYPE,
Smi [418],
Smi [402],
Smi [6],
Smi [20],
Smi [23],
]
handlers: [
[40, 478, 486],
[43, 439, 441],
[82, 261, 269],
[85, 221, 223],
[330, 340, 342],
[30, 451, 459],
[33, 412, 414],
[71, 235, 243],
[74, 195, 197],
[304, 314, 316],
]
---
......@@ -539,232 +517,218 @@ snippet: "
async function* f() { yield* g() }
f();
"
frame size: 18
frame size: 17
parameter count: 1
bytecode array length: 521
bytecode array length: 492
bytecodes: [
B(Ldar), R(0),
B(JumpIfUndefined), U8(18),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(0), U8(1),
B(PushContext), R(2),
B(RestoreGeneratorState), R(0),
B(Star), R(1),
B(SwitchOnSmiNoFeedback), U8(0), U8(5), I8(0),
B(Abort), U8(15),
B(LdaSmi), I8(-2),
B(Star), R(1),
B(Mov), R(closure), R(2),
B(Mov), R(this), R(3),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(2), U8(2),
B(PushContext), R(1),
B(SwitchOnGeneratorState), R(0), U8(0), U8(5),
B(Mov), R(closure), R(1),
B(Mov), R(this), R(2),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(1), U8(2),
B(Star), R(0),
/* 44 E> */ B(StackCheck),
B(Mov), R(context), R(3),
B(Mov), R(context), R(4),
B(Mov), R(context), R(5),
B(Ldar), R(0),
/* 44 E> */ B(SuspendGenerator), R(0), R(0), U8(6), U8(0),
B(ResumeGenerator), R(0), R(1), R(0), U8(6),
B(Star), R(6),
/* 44 E> */ B(SuspendGenerator), R(0), R(0), U8(5), U8(0),
B(ResumeGenerator), R(0), R(0), U8(5),
B(Star), R(5),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(5), U8(2), I8(0),
B(Ldar), R(6),
B(Ldar), R(5),
/* 44 E> */ B(Throw),
B(LdaZero),
B(Star), R(2),
B(Mov), R(6), R(3),
B(JumpConstant), U8(22),
B(Star), R(1),
B(Mov), R(5), R(2),
B(JumpConstant), U8(19),
/* 49 S> */ B(LdaGlobal), U8(7), U8(0),
B(Star), R(13),
/* 56 E> */ B(CallUndefinedReceiver0), R(13), U8(2),
B(Star), R(11),
B(LdaNamedProperty), R(11), U8(8), U8(4),
B(Star), R(12),
/* 56 E> */ B(CallUndefinedReceiver0), R(12), U8(2),
B(Star), R(10),
B(LdaNamedProperty), R(10), U8(8), U8(4),
B(JumpIfUndefined), U8(17),
B(JumpIfNull), U8(15),
B(Star), R(12),
B(CallProperty0), R(12), R(11), U8(6),
B(Star), R(11),
B(CallProperty0), R(11), R(10), U8(6),
B(JumpIfJSReceiver), U8(23),
B(CallRuntime), U16(Runtime::kThrowSymbolAsyncIteratorInvalid), R(0), U8(0),
B(LdaNamedProperty), R(11), U8(9), U8(8),
B(Star), R(12),
B(CallProperty0), R(12), R(11), U8(10),
B(Star), R(12),
B(InvokeIntrinsic), U8(Runtime::k_CreateAsyncFromSyncIterator), R(12), U8(1),
B(Star), R(8),
B(LdaNamedProperty), R(8), U8(10), U8(12),
B(Star), R(10),
B(LdaUndefined),
B(LdaNamedProperty), R(10), U8(9), U8(8),
B(Star), R(11),
B(CallProperty0), R(11), R(10), U8(10),
B(Star), R(11),
B(InvokeIntrinsic), U8(Runtime::k_CreateAsyncFromSyncIterator), R(11), U8(1),
B(Star), R(7),
B(LdaNamedProperty), R(7), U8(10), U8(12),
B(Star), R(9),
B(LdaUndefined),
B(Star), R(8),
B(LdaZero),
B(Star), R(7),
B(Ldar), R(1),
B(SwitchOnSmiNoFeedback), U8(11), U8(3), I8(1),
B(LdaSmi), I8(-2),
B(TestEqualStrictNoFeedback), R(1),
B(JumpIfTrue), U8(4),
B(Abort), U8(15),
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(111),
B(LdaNamedProperty), R(8), U8(16), U8(16),
B(Star), R(6),
B(Ldar), R(6),
B(SwitchOnSmiNoFeedback), U8(11), U8(2), I8(1),
B(CallProperty1), R(9), R(7), R(8), U8(14),
B(Jump), U8(110),
B(LdaNamedProperty), R(7), U8(13), 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(94),
B(Star), R(12),
B(CallProperty1), R(12), R(7), R(8), U8(18),
B(Jump), U8(93),
B(LdaZero),
B(Star), R(2),
B(Mov), R(9), R(3),
B(JumpConstant), U8(23),
B(LdaNamedProperty), R(8), U8(17), U8(20),
B(Star), R(1),
B(Mov), R(8), R(2),
B(JumpConstant), U8(20),
B(LdaNamedProperty), R(7), U8(14), U8(20),
B(JumpIfUndefined), U8(13),
B(JumpIfNull), U8(11),
B(Star), R(13),
B(CallProperty1), R(13), R(8), R(9), U8(22),
B(Jump), U8(69),
B(LdaNamedProperty), R(8), U8(16), U8(24),
B(JumpIfUndefined), U8(58),
B(JumpIfNull), U8(56),
B(Star), R(13),
B(CallProperty0), R(13), R(8), U8(26),
B(Star), R(12),
B(CallProperty1), R(12), R(7), R(8), U8(22),
B(Jump), U8(68),
B(LdaNamedProperty), R(7), U8(13), U8(24),
B(JumpIfUndefined), U8(57),
B(JumpIfNull), U8(55),
B(Star), R(12),
B(CallProperty0), R(12), R(7), 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),
/* 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(Mov), R(0), R(12),
B(CallJSRuntime), U8(%async_generator_await_uncaught), R(12), U8(2),
/* 49 E> */ B(SuspendGenerator), R(0), R(0), U8(12), U8(2),
B(ResumeGenerator), R(0), R(0), U8(12),
B(Star), R(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(Star), R(14),
B(Star), R(13),
B(LdaZero),
B(TestEqualStrictNoFeedback), R(14),
B(TestEqualStrictNoFeedback), R(13),
B(JumpIfTrue), U8(5),
B(Ldar), R(13),
B(Ldar), R(12),
B(ReThrow),
B(Ldar), R(13),
B(Ldar), R(12),
B(JumpIfJSReceiver), U8(9),
B(Star), R(15),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(15), U8(1),
B(CallRuntime), U16(Runtime::kThrowThrowMethodMissing), R(0), U8(0),
B(Star), R(14),
B(Mov), R(0), R(13),
B(CallJSRuntime), U8(%async_generator_await_uncaught), R(13), U8(2),
/* 49 E> */ B(SuspendGenerator), R(0), R(0), U8(13), U8(3),
B(ResumeGenerator), R(0), R(1), R(0), U8(13),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(14), U8(1),
B(CallRuntime), U16(Runtime::kThrowThrowMethodMissing), R(0), U8(0),
B(Star), R(13),
B(Mov), R(0), R(12),
B(CallJSRuntime), U8(%async_generator_await_uncaught), R(12), U8(2),
/* 49 E> */ B(SuspendGenerator), R(0), R(0), U8(12), U8(3),
B(ResumeGenerator), R(0), R(0), U8(12),
B(Star), R(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(Star), R(14),
B(Star), R(13),
B(LdaZero),
B(TestEqualStrictNoFeedback), R(14),
B(TestEqualStrictNoFeedback), R(13),
B(JumpIfTrue), U8(5),
B(Ldar), R(13),
B(Ldar), R(12),
B(ReThrow),
B(Ldar), R(13),
B(Mov), R(13), R(6),
B(Ldar), R(12),
B(Mov), R(12), R(5),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(6), U8(1),
B(LdaNamedProperty), R(6), U8(18), U8(28),
B(JumpIfToBooleanTrue), U8(39),
B(LdaNamedProperty), R(6), U8(19), U8(30),
B(Star), R(16),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(5), U8(1),
B(LdaNamedProperty), R(5), U8(15), U8(28),
B(JumpIfToBooleanTrue), U8(38),
B(LdaNamedProperty), R(5), U8(16), U8(30),
B(Star), R(15),
B(LdaFalse),
B(Star), R(17),
B(Mov), R(0), R(15),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorYield), R(15), U8(3),
/* 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(Star), R(16),
B(Mov), R(0), R(14),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorYield), R(14), U8(3),
/* 49 E> */ B(SuspendGenerator), R(0), R(0), U8(14), U8(1),
B(ResumeGenerator), R(0), R(0), U8(14),
B(Star), R(8),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(Star), R(6),
B(JumpLoop), U8(206), I8(0),
B(LdaNamedProperty), R(5), U8(16), U8(32),
B(Star), R(7),
B(JumpLoop), U8(223), I8(0),
B(LdaNamedProperty), R(6), U8(19), U8(32),
B(Star), R(8),
B(LdaSmi), I8(1),
B(TestEqualStrictNoFeedback), R(7),
B(TestEqualStrictNoFeedback), R(6),
B(JumpIfFalse), U8(10),
B(LdaZero),
B(Star), R(2),
B(Mov), R(8), R(3),
B(Jump), U8(99),
B(Star), R(1),
B(Mov), R(7), R(2),
B(Jump), U8(98),
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),
B(ResumeGenerator), R(0), R(1), R(0), U8(6),
B(Star), R(6),
B(Mov), R(0), R(5),
B(CallJSRuntime), U8(%async_generator_await_uncaught), R(5), U8(2),
B(SuspendGenerator), R(0), R(0), U8(5), U8(4),
B(ResumeGenerator), R(0), R(0), U8(5),
B(Star), R(5),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(Star), R(7),
B(Star), R(6),
B(LdaZero),
B(TestEqualStrictNoFeedback), R(7),
B(TestEqualStrictNoFeedback), R(6),
B(JumpIfTrue), U8(5),
B(Ldar), R(6),
B(Ldar), R(5),
B(ReThrow),
B(LdaZero),
B(Star), R(2),
B(Mov), R(6), R(3),
B(Star), R(1),
B(Mov), R(5), R(2),
B(Jump), U8(55),
B(Jump), U8(39),
B(Star), R(6),
B(Ldar), R(closure),
B(CreateCatchContext), R(6), U8(20), U8(21),
B(Star), R(5),
B(Ldar), R(closure),
B(CreateCatchContext), R(5), U8(17), U8(18),
B(Star), R(4),
B(LdaTheHole),
B(SetPendingMessage),
B(Ldar), R(5),
B(PushContext), R(6),
B(Ldar), R(4),
B(PushContext), R(5),
B(LdaImmutableCurrentContextSlot), U8(4),
B(Star), R(8),
B(Mov), R(0), R(7),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorReject), R(7), U8(2),
B(PopContext), R(6),
B(Star), R(3),
B(LdaSmi), I8(1),
B(Star), R(7),
B(Mov), R(0), R(6),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorReject), R(6), U8(2),
B(PopContext), R(5),
B(Star), R(2),
B(LdaSmi), I8(1),
B(Star), R(1),
B(Jump), U8(16),
B(LdaSmi), I8(-1),
B(Star), R(3),
B(Star), R(2),
B(Star), R(1),
B(Jump), U8(8),
B(Star), R(3),
B(LdaSmi), I8(2),
B(Star), R(2),
B(LdaSmi), I8(2),
B(Star), R(1),
B(LdaTheHole),
B(SetPendingMessage),
B(Star), R(4),
B(Star), R(3),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorClose), R(0), U8(1),
B(Ldar), R(4),
B(Ldar), R(3),
B(SetPendingMessage),
B(Ldar), R(2),
B(SwitchOnSmiNoFeedback), U8(24), U8(3), I8(0),
B(Ldar), R(1),
B(SwitchOnSmiNoFeedback), U8(21), U8(3), I8(0),
B(Jump), U8(22),
B(LdaTrue),
B(Star), R(7),
B(Mov), R(0), R(5),
B(Mov), R(3), R(6),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorResolve), R(5), U8(3),
B(Star), R(6),
B(Mov), R(0), R(4),
B(Mov), R(2), R(5),
B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorResolve), R(4), U8(3),
/* 60 S> */ B(Return),
B(Ldar), R(3),
B(Ldar), R(2),
/* 60 S> */ B(Return),
B(Ldar), R(3),
B(Ldar), R(2),
B(ReThrow),
B(LdaUndefined),
/* 60 S> */ B(Return),
]
constant pool: [
Smi [36],
Smi [123],
Smi [123],
Smi [123],
Smi [384],
Smi [30],
Smi [310],
Smi [201],
Smi [251],
Smi [360],
Smi [15],
Smi [7],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["g"],
SYMBOL_TYPE,
SYMBOL_TYPE,
ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
Smi [208],
Smi [97],
Smi [148],
Smi [11],
Smi [36],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["return"],
......@@ -773,14 +737,14 @@ constant pool: [
ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"],
ONE_BYTE_INTERNALIZED_STRING_TYPE [".catch"],
FIXED_ARRAY_TYPE,
Smi [406],
Smi [293],
Smi [388],
Smi [289],
Smi [6],
Smi [20],
Smi [23],
]
handlers: [
[40, 466, 474],
[43, 427, 429],
[30, 437, 445],
[33, 398, 400],
]
......@@ -14,79 +14,68 @@ snippet: "
}
f();
"
frame size: 24
frame size: 23
parameter count: 1
bytecode array length: 551
bytecode array length: 524
bytecodes: [
B(Ldar), R(2),
B(JumpIfUndefined), U8(18),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(2), U8(1),
B(PushContext), R(13),
B(RestoreGeneratorState), R(2),
B(Star), R(12),
B(SwitchOnSmiNoFeedback), U8(0), U8(3), I8(0),
B(Abort), U8(15),
B(LdaSmi), I8(-2),
B(Star), R(12),
B(Mov), R(closure), R(13),
B(Mov), R(this), R(14),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(13), U8(2),
B(PushContext), R(12),
B(SwitchOnGeneratorState), R(2), U8(0), U8(3),
B(Mov), R(closure), R(12),
B(Mov), R(this), R(13),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(12), U8(2),
B(Star), R(2),
/* 16 E> */ B(StackCheck),
B(CallJSRuntime), U8(%async_function_promise_create), R(0), U8(0),
B(Star), R(11),
B(Mov), R(context), R(14),
B(Mov), R(context), R(15),
B(Mov), R(context), R(16),
B(LdaZero),
B(Star), R(7),
B(Mov), R(context), R(18),
B(Mov), R(context), R(19),
B(Mov), R(context), R(20),
/* 43 S> */ B(CreateArrayLiteral), U8(3), U8(0), U8(37),
B(Star), R(21),
B(LdaNamedProperty), R(21), U8(4), U8(1),
B(Star), R(20),
B(LdaNamedProperty), R(20), U8(4), U8(1),
B(JumpIfUndefined), U8(17),
B(JumpIfNull), U8(15),
B(Star), R(22),
B(CallProperty0), R(22), R(21), U8(3),
B(Star), R(21),
B(CallProperty0), R(21), R(20), U8(3),
B(JumpIfJSReceiver), U8(23),
B(CallRuntime), U16(Runtime::kThrowSymbolAsyncIteratorInvalid), R(0), U8(0),
B(LdaNamedProperty), R(21), U8(5), U8(5),
B(Star), R(22),
B(CallProperty0), R(22), R(21), U8(7),
B(Star), R(22),
B(InvokeIntrinsic), U8(Runtime::k_CreateAsyncFromSyncIterator), R(22), U8(1),
B(LdaNamedProperty), R(20), U8(5), U8(5),
B(Star), R(21),
B(CallProperty0), R(21), R(20), U8(7),
B(Star), R(21),
B(InvokeIntrinsic), U8(Runtime::k_CreateAsyncFromSyncIterator), R(21), U8(1),
B(Star), R(4),
/* 43 E> */ B(LdaNamedProperty), R(4), U8(6), U8(9),
B(Star), R(5),
B(Ldar), R(12),
B(SwitchOnSmiNoFeedback), U8(7), U8(1), I8(0),
B(LdaSmi), I8(-2),
B(TestEqualStrictNoFeedback), R(12),
B(JumpIfTrue), U8(4),
B(Abort), U8(15),
/* 40 S> */ B(CallProperty0), R(5), R(4), U8(11),
B(Star), R(22),
B(Mov), R(2), R(21),
B(Mov), R(11), R(23),
B(CallJSRuntime), U8(%async_function_await_uncaught), R(21), U8(3),
/* 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(Mov), R(2), R(20),
B(Mov), R(11), R(22),
B(CallJSRuntime), U8(%async_function_await_uncaught), R(20), U8(3),
/* 40 E> */ B(SuspendGenerator), R(2), R(0), U8(20), U8(0),
B(ResumeGenerator), R(2), R(0), U8(20),
B(Star), R(20),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
B(Star), R(22),
B(Star), R(21),
B(LdaZero),
B(TestEqualStrictNoFeedback), R(22),
B(TestEqualStrictNoFeedback), R(21),
B(JumpIfTrue), U8(5),
B(Ldar), R(21),
B(Ldar), R(20),
B(ReThrow),
B(Mov), R(21), R(6),
/* 40 E> */ B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(21), U8(1),
B(Mov), R(20), R(6),
/* 40 E> */ B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(20), U8(1),
B(ToBooleanLogicalNot),
B(JumpIfFalse), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(6), U8(1),
B(LdaNamedProperty), R(6), U8(8), U8(13),
B(LdaNamedProperty), R(6), U8(7), U8(13),
B(JumpIfToBooleanTrue), U8(25),
B(LdaNamedProperty), R(6), U8(9), U8(15),
B(LdaNamedProperty), R(6), U8(8), U8(15),
B(Star), R(8),
B(LdaSmi), I8(2),
B(Star), R(7),
......@@ -95,89 +84,66 @@ bytecodes: [
B(Mov), R(3), R(0),
B(LdaZero),
B(Star), R(7),
B(JumpLoop), U8(97), I8(0),
B(JumpLoop), U8(82), I8(0),
B(Jump), U8(40),
B(Star), R(21),
B(Ldar), R(closure),
B(CreateCatchContext), R(21), U8(10), U8(11),
B(Star), R(20),
B(Ldar), R(closure),
B(CreateCatchContext), R(20), U8(9), U8(10),
B(Star), R(19),
B(LdaTheHole),
B(SetPendingMessage),
B(Ldar), R(20),
B(PushContext), R(21),
B(Ldar), R(19),
B(PushContext), R(20),
B(LdaSmi), I8(2),
B(TestEqualStrict), R(7), U8(17),
B(JumpIfFalse), U8(6),
B(LdaSmi), I8(1),
B(Star), R(7),
B(LdaImmutableCurrentContextSlot), U8(4),
B(Star), R(22),
B(CallRuntime), U16(Runtime::kReThrow), R(22), U8(1),
B(PopContext), R(21),
B(Star), R(21),
B(CallRuntime), U16(Runtime::kReThrow), R(21), U8(1),
B(PopContext), R(20),
B(LdaSmi), I8(-1),
B(Star), R(18),
B(Star), R(17),
B(Star), R(16),
B(Jump), U8(7),
B(Star), R(18),
B(LdaZero),
B(Star), R(17),
B(LdaZero),
B(Star), R(16),
B(LdaTheHole),
B(SetPendingMessage),
B(Star), R(19),
B(Star), R(18),
B(LdaZero),
B(TestEqualStrict), R(7), U8(18),
B(JumpIfTrue), U8(169),
B(LdaNamedProperty), R(4), U8(12), U8(19),
B(JumpIfTrue), U8(167),
B(LdaNamedProperty), R(4), U8(11), U8(19),
B(Star), R(9),
B(TestUndetectable),
B(JumpIfFalse), U8(4),
B(Jump), U8(158),
B(Jump), U8(156),
B(LdaSmi), I8(1),
B(TestEqualStrict), R(7), U8(21),
B(JumpIfFalse), U8(87),
B(JumpIfFalse), U8(86),
B(Ldar), R(9),
B(TestTypeOf), U8(6),
B(JumpIfFalse), U8(4),
B(Jump), U8(18),
B(Wide), B(LdaSmi), I16(144),
B(Star), R(19),
B(LdaConstant), U8(12),
B(Star), R(20),
B(LdaConstant), U8(13),
B(Star), R(21),
B(CallRuntime), U16(Runtime::kNewTypeError), R(20), U8(2),
B(CallRuntime), U16(Runtime::kNewTypeError), R(19), U8(2),
B(Throw),
B(Mov), R(context), R(20),
B(Mov), R(9), R(21),
B(Mov), R(4), R(22),
B(InvokeIntrinsic), U8(Runtime::k_Call), R(21), U8(2),
B(Star), R(22),
B(Mov), R(2), R(21),
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),
B(ResumeGenerator), R(2), R(12), R(0), U8(21),
B(Star), R(21),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
B(Star), R(22),
B(LdaZero),
B(TestEqualStrictNoFeedback), R(22),
B(JumpIfTrue), U8(5),
B(Ldar), R(21),
B(ReThrow),
B(Ldar), R(21),
B(Jump), U8(6),
B(LdaTheHole),
B(SetPendingMessage),
B(Ldar), R(20),
B(Jump), U8(66),
B(Mov), R(context), R(19),
B(Mov), R(9), R(20),
B(Mov), R(4), R(21),
B(InvokeIntrinsic), U8(Runtime::k_Call), R(20), U8(2),
B(Star), R(21),
B(Mov), R(2), R(20),
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),
B(ResumeGenerator), R(2), R(12), R(0), U8(20),
B(CallJSRuntime), U8(%async_function_await_caught), R(20), U8(3),
B(SuspendGenerator), R(2), R(0), U8(20), U8(1),
B(ResumeGenerator), R(2), R(0), U8(20),
B(Star), R(20),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
B(Star), R(21),
......@@ -186,78 +152,100 @@ bytecodes: [
B(JumpIfTrue), U8(5),
B(Ldar), R(20),
B(ReThrow),
B(Mov), R(20), R(10),
B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(20), U8(1),
B(Ldar), R(20),
B(Jump), U8(6),
B(LdaTheHole),
B(SetPendingMessage),
B(Ldar), R(19),
B(Jump), U8(65),
B(Mov), R(9), R(19),
B(Mov), R(4), R(20),
B(InvokeIntrinsic), U8(Runtime::k_Call), R(19), U8(2),
B(Star), R(20),
B(Mov), R(2), R(19),
B(Mov), R(11), R(21),
B(CallJSRuntime), U8(%async_function_await_uncaught), R(19), U8(3),
B(SuspendGenerator), R(2), R(0), U8(19), U8(2),
B(ResumeGenerator), R(2), R(0), U8(19),
B(Star), R(19),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
B(Star), R(20),
B(LdaZero),
B(TestEqualStrictNoFeedback), R(20),
B(JumpIfTrue), U8(5),
B(Ldar), R(19),
B(ReThrow),
B(Mov), R(19), R(10),
B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(19), U8(1),
B(JumpIfToBooleanFalse), U8(4),
B(Jump), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(10), U8(1),
B(Ldar), R(19),
B(Ldar), R(18),
B(SetPendingMessage),
B(LdaZero),
B(TestEqualStrictNoFeedback), R(17),
B(TestEqualStrictNoFeedback), R(16),
B(JumpIfFalse), U8(5),
B(Ldar), R(18),
B(Ldar), R(17),
B(ReThrow),
B(LdaUndefined),
B(Star), R(18),
B(Mov), R(11), R(17),
B(CallJSRuntime), U8(%promise_resolve), R(17), U8(2),
B(Star), R(17),
B(Mov), R(11), R(16),
B(CallJSRuntime), U8(%promise_resolve), R(16), U8(2),
B(LdaZero),
B(Star), R(13),
B(Mov), R(11), R(14),
B(Star), R(12),
B(Mov), R(11), R(13),
B(Jump), U8(58),
B(Jump), U8(42),
B(Star), R(17),
B(Ldar), R(closure),
B(CreateCatchContext), R(17), U8(10), U8(14),
B(Star), R(16),
B(Ldar), R(closure),
B(CreateCatchContext), R(16), U8(9), U8(13),
B(Star), R(15),
B(LdaTheHole),
B(SetPendingMessage),
B(Ldar), R(16),
B(PushContext), R(17),
B(Ldar), R(15),
B(PushContext), R(16),
B(LdaImmutableCurrentContextSlot), U8(4),
B(Star), R(19),
B(Star), R(18),
B(LdaFalse),
B(Star), R(20),
B(Mov), R(11), R(18),
B(CallJSRuntime), U8(%promise_internal_reject), R(18), U8(3),
B(PopContext), R(17),
B(Star), R(19),
B(Mov), R(11), R(17),
B(CallJSRuntime), U8(%promise_internal_reject), R(17), U8(3),
B(PopContext), R(16),
B(LdaZero),
B(Star), R(13),
B(Mov), R(11), R(14),
B(Star), R(12),
B(Mov), R(11), R(13),
B(Jump), U8(16),
B(LdaSmi), I8(-1),
B(Star), R(14),
B(Star), R(13),
B(Star), R(12),
B(Jump), U8(8),
B(Star), R(14),
B(LdaSmi), I8(1),
B(Star), R(13),
B(LdaSmi), I8(1),
B(Star), R(12),
B(LdaTheHole),
B(SetPendingMessage),
B(Star), R(15),
B(Star), R(14),
B(CallJSRuntime), U8(%async_function_promise_release), R(11), U8(1),
B(Ldar), R(15),
B(Ldar), R(14),
B(SetPendingMessage),
B(Ldar), R(13),
B(SwitchOnSmiNoFeedback), U8(15), U8(2), I8(0),
B(Ldar), R(12),
B(SwitchOnSmiNoFeedback), U8(14), U8(2), I8(0),
B(Jump), U8(8),
B(Ldar), R(14),
B(Ldar), R(13),
/* 57 S> */ B(Return),
B(Ldar), R(14),
B(Ldar), R(13),
B(ReThrow),
B(LdaUndefined),
/* 57 S> */ B(Return),
]
constant pool: [
Smi [95],
Smi [330],
Smi [388],
Smi [110],
Smi [309],
Smi [366],
TUPLE2_TYPE,
SYMBOL_TYPE,
SYMBOL_TYPE,
ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
Smi [33],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["done"],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"],
ONE_BYTE_INTERNALIZED_STRING_TYPE [".catch"],
......@@ -269,11 +257,11 @@ constant pool: [
Smi [9],
]
handlers: [
[46, 510, 518],
[49, 468, 470],
[55, 249, 257],
[58, 209, 211],
[317, 367, 369],
[36, 483, 491],
[39, 441, 443],
[45, 224, 232],
[48, 184, 186],
[292, 341, 343],
]
---
......@@ -283,79 +271,68 @@ snippet: "
}
f();
"
frame size: 24
frame size: 23
parameter count: 1
bytecode array length: 580
bytecode array length: 553
bytecodes: [
B(Ldar), R(2),
B(JumpIfUndefined), U8(18),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(2), U8(1),
B(PushContext), R(13),
B(RestoreGeneratorState), R(2),
B(Star), R(12),
B(SwitchOnSmiNoFeedback), U8(0), U8(3), I8(0),
B(Abort), U8(15),
B(LdaSmi), I8(-2),
B(Star), R(12),
B(Mov), R(closure), R(13),
B(Mov), R(this), R(14),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(13), U8(2),
B(PushContext), R(12),
B(SwitchOnGeneratorState), R(2), U8(0), U8(3),
B(Mov), R(closure), R(12),
B(Mov), R(this), R(13),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(12), U8(2),
B(Star), R(2),
/* 16 E> */ B(StackCheck),
B(CallJSRuntime), U8(%async_function_promise_create), R(0), U8(0),
B(Star), R(11),
B(Mov), R(context), R(14),
B(Mov), R(context), R(15),
B(Mov), R(context), R(16),
B(LdaZero),
B(Star), R(7),
B(Mov), R(context), R(18),
B(Mov), R(context), R(19),
B(Mov), R(context), R(20),
/* 43 S> */ B(CreateArrayLiteral), U8(3), U8(0), U8(37),
B(Star), R(21),
B(LdaNamedProperty), R(21), U8(4), U8(1),
B(Star), R(20),
B(LdaNamedProperty), R(20), U8(4), U8(1),
B(JumpIfUndefined), U8(17),
B(JumpIfNull), U8(15),
B(Star), R(22),
B(CallProperty0), R(22), R(21), U8(3),
B(Star), R(21),
B(CallProperty0), R(21), R(20), U8(3),
B(JumpIfJSReceiver), U8(23),
B(CallRuntime), U16(Runtime::kThrowSymbolAsyncIteratorInvalid), R(0), U8(0),
B(LdaNamedProperty), R(21), U8(5), U8(5),
B(Star), R(22),
B(CallProperty0), R(22), R(21), U8(7),
B(Star), R(22),
B(InvokeIntrinsic), U8(Runtime::k_CreateAsyncFromSyncIterator), R(22), U8(1),
B(LdaNamedProperty), R(20), U8(5), U8(5),
B(Star), R(21),
B(CallProperty0), R(21), R(20), U8(7),
B(Star), R(21),
B(InvokeIntrinsic), U8(Runtime::k_CreateAsyncFromSyncIterator), R(21), U8(1),
B(Star), R(4),
/* 43 E> */ B(LdaNamedProperty), R(4), U8(6), U8(9),
B(Star), R(5),
B(Ldar), R(12),
B(SwitchOnSmiNoFeedback), U8(7), U8(1), I8(0),
B(LdaSmi), I8(-2),
B(TestEqualStrictNoFeedback), R(12),
B(JumpIfTrue), U8(4),
B(Abort), U8(15),
/* 40 S> */ B(CallProperty0), R(5), R(4), U8(11),
B(Star), R(22),
B(Mov), R(2), R(21),
B(Mov), R(11), R(23),
B(CallJSRuntime), U8(%async_function_await_uncaught), R(21), U8(3),
/* 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(Mov), R(2), R(20),
B(Mov), R(11), R(22),
B(CallJSRuntime), U8(%async_function_await_uncaught), R(20), U8(3),
/* 40 E> */ B(SuspendGenerator), R(2), R(0), U8(20), U8(0),
B(ResumeGenerator), R(2), R(0), U8(20),
B(Star), R(20),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
B(Star), R(22),
B(Star), R(21),
B(LdaZero),
B(TestEqualStrictNoFeedback), R(22),
B(TestEqualStrictNoFeedback), R(21),
B(JumpIfTrue), U8(5),
B(Ldar), R(21),
B(Ldar), R(20),
B(ReThrow),
B(Mov), R(21), R(6),
/* 40 E> */ B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(21), U8(1),
B(Mov), R(20), R(6),
/* 40 E> */ B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(20), U8(1),
B(ToBooleanLogicalNot),
B(JumpIfFalse), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(6), U8(1),
B(LdaNamedProperty), R(6), U8(8), U8(13),
B(LdaNamedProperty), R(6), U8(7), U8(13),
B(JumpIfToBooleanTrue), U8(27),
B(LdaNamedProperty), R(6), U8(9), U8(15),
B(LdaNamedProperty), R(6), U8(8), U8(15),
B(Star), R(8),
B(LdaSmi), I8(2),
B(Star), R(7),
......@@ -363,91 +340,68 @@ bytecodes: [
/* 23 E> */ B(StackCheck),
B(Mov), R(3), R(0),
/* 56 S> */ B(LdaZero),
B(Star), R(17),
B(Mov), R(8), R(18),
B(Star), R(16),
B(Mov), R(8), R(17),
B(Jump), U8(56),
B(Jump), U8(40),
B(Star), R(21),
B(Ldar), R(closure),
B(CreateCatchContext), R(21), U8(10), U8(11),
B(Star), R(20),
B(Ldar), R(closure),
B(CreateCatchContext), R(20), U8(9), U8(10),
B(Star), R(19),
B(LdaTheHole),
B(SetPendingMessage),
B(Ldar), R(20),
B(PushContext), R(21),
B(Ldar), R(19),
B(PushContext), R(20),
B(LdaSmi), I8(2),
B(TestEqualStrict), R(7), U8(17),
B(JumpIfFalse), U8(6),
B(LdaSmi), I8(1),
B(Star), R(7),
B(LdaImmutableCurrentContextSlot), U8(4),
B(Star), R(22),
B(CallRuntime), U16(Runtime::kReThrow), R(22), U8(1),
B(PopContext), R(21),
B(Star), R(21),
B(CallRuntime), U16(Runtime::kReThrow), R(21), U8(1),
B(PopContext), R(20),
B(LdaSmi), I8(-1),
B(Star), R(18),
B(Star), R(17),
B(Star), R(16),
B(Jump), U8(8),
B(Star), R(18),
B(LdaSmi), I8(1),
B(Star), R(17),
B(LdaSmi), I8(1),
B(Star), R(16),
B(LdaTheHole),
B(SetPendingMessage),
B(Star), R(19),
B(Star), R(18),
B(LdaZero),
B(TestEqualStrict), R(7), U8(18),
B(JumpIfTrue), U8(169),
B(LdaNamedProperty), R(4), U8(12), U8(19),
B(JumpIfTrue), U8(167),
B(LdaNamedProperty), R(4), U8(11), U8(19),
B(Star), R(9),
B(TestUndetectable),
B(JumpIfFalse), U8(4),
B(Jump), U8(158),
B(Jump), U8(156),
B(LdaSmi), I8(1),
B(TestEqualStrict), R(7), U8(21),
B(JumpIfFalse), U8(87),
B(JumpIfFalse), U8(86),
B(Ldar), R(9),
B(TestTypeOf), U8(6),
B(JumpIfFalse), U8(4),
B(Jump), U8(18),
B(Wide), B(LdaSmi), I16(144),
B(Star), R(19),
B(LdaConstant), U8(12),
B(Star), R(20),
B(LdaConstant), U8(13),
B(Star), R(21),
B(CallRuntime), U16(Runtime::kNewTypeError), R(20), U8(2),
B(CallRuntime), U16(Runtime::kNewTypeError), R(19), U8(2),
B(Throw),
B(Mov), R(context), R(20),
B(Mov), R(9), R(21),
B(Mov), R(4), R(22),
B(InvokeIntrinsic), U8(Runtime::k_Call), R(21), U8(2),
B(Star), R(22),
B(Mov), R(2), R(21),
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),
B(ResumeGenerator), R(2), R(12), R(0), U8(21),
B(Star), R(21),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
B(Star), R(22),
B(LdaZero),
B(TestEqualStrictNoFeedback), R(22),
B(JumpIfTrue), U8(5),
B(Ldar), R(21),
B(ReThrow),
B(Ldar), R(21),
B(Jump), U8(6),
B(LdaTheHole),
B(SetPendingMessage),
B(Ldar), R(20),
B(Jump), U8(66),
B(Mov), R(context), R(19),
B(Mov), R(9), R(20),
B(Mov), R(4), R(21),
B(InvokeIntrinsic), U8(Runtime::k_Call), R(20), U8(2),
B(Star), R(21),
B(Mov), R(2), R(20),
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),
B(ResumeGenerator), R(2), R(12), R(0), U8(20),
B(CallJSRuntime), U8(%async_function_await_caught), R(20), U8(3),
B(SuspendGenerator), R(2), R(0), U8(20), U8(1),
B(ResumeGenerator), R(2), R(0), U8(20),
B(Star), R(20),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
B(Star), R(21),
......@@ -456,87 +410,109 @@ bytecodes: [
B(JumpIfTrue), U8(5),
B(Ldar), R(20),
B(ReThrow),
B(Mov), R(20), R(10),
B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(20), U8(1),
B(Ldar), R(20),
B(Jump), U8(6),
B(LdaTheHole),
B(SetPendingMessage),
B(Ldar), R(19),
B(Jump), U8(65),
B(Mov), R(9), R(19),
B(Mov), R(4), R(20),
B(InvokeIntrinsic), U8(Runtime::k_Call), R(19), U8(2),
B(Star), R(20),
B(Mov), R(2), R(19),
B(Mov), R(11), R(21),
B(CallJSRuntime), U8(%async_function_await_uncaught), R(19), U8(3),
B(SuspendGenerator), R(2), R(0), U8(19), U8(2),
B(ResumeGenerator), R(2), R(0), U8(19),
B(Star), R(19),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
B(Star), R(20),
B(LdaZero),
B(TestEqualStrictNoFeedback), R(20),
B(JumpIfTrue), U8(5),
B(Ldar), R(19),
B(ReThrow),
B(Mov), R(19), R(10),
B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(19), U8(1),
B(JumpIfToBooleanFalse), U8(4),
B(Jump), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(10), U8(1),
B(Ldar), R(19),
B(Ldar), R(18),
B(SetPendingMessage),
B(Ldar), R(17),
B(SwitchOnSmiNoFeedback), U8(14), U8(2), I8(0),
B(Ldar), R(16),
B(SwitchOnSmiNoFeedback), U8(13), U8(2), I8(0),
B(Jump), U8(13),
B(LdaZero),
B(Star), R(13),
B(Mov), R(18), R(14),
B(Star), R(12),
B(Mov), R(17), R(13),
B(Jump), U8(81),
B(Ldar), R(18),
B(Ldar), R(17),
B(ReThrow),
B(LdaUndefined),
B(Star), R(18),
B(Mov), R(11), R(17),
B(CallJSRuntime), U8(%promise_resolve), R(17), U8(2),
B(Star), R(17),
B(Mov), R(11), R(16),
B(CallJSRuntime), U8(%promise_resolve), R(16), U8(2),
B(LdaSmi), I8(1),
B(Star), R(13),
B(Mov), R(11), R(14),
B(Star), R(12),
B(Mov), R(11), R(13),
B(Jump), U8(59),
B(Jump), U8(43),
B(Star), R(17),
B(Ldar), R(closure),
B(CreateCatchContext), R(17), U8(10), U8(16),
B(Star), R(16),
B(Ldar), R(closure),
B(CreateCatchContext), R(16), U8(9), U8(15),
B(Star), R(15),
B(LdaTheHole),
B(SetPendingMessage),
B(Ldar), R(16),
B(PushContext), R(17),
B(Ldar), R(15),
B(PushContext), R(16),
B(LdaImmutableCurrentContextSlot), U8(4),
B(Star), R(19),
B(Star), R(18),
B(LdaFalse),
B(Star), R(20),
B(Mov), R(11), R(18),
B(CallJSRuntime), U8(%promise_internal_reject), R(18), U8(3),
B(PopContext), R(17),
B(Star), R(19),
B(Mov), R(11), R(17),
B(CallJSRuntime), U8(%promise_internal_reject), R(17), U8(3),
B(PopContext), R(16),
B(LdaSmi), I8(1),
B(Star), R(13),
B(Mov), R(11), R(14),
B(Star), R(12),
B(Mov), R(11), R(13),
B(Jump), U8(16),
B(LdaSmi), I8(-1),
B(Star), R(14),
B(Star), R(13),
B(Star), R(12),
B(Jump), U8(8),
B(Star), R(14),
B(LdaSmi), I8(2),
B(Star), R(13),
B(LdaSmi), I8(2),
B(Star), R(12),
B(LdaTheHole),
B(SetPendingMessage),
B(Star), R(15),
B(Star), R(14),
B(CallJSRuntime), U8(%async_function_promise_release), R(11), U8(1),
B(Ldar), R(15),
B(Ldar), R(14),
B(SetPendingMessage),
B(Ldar), R(13),
B(SwitchOnSmiNoFeedback), U8(17), U8(3), I8(0),
B(Ldar), R(12),
B(SwitchOnSmiNoFeedback), U8(16), U8(3), I8(0),
B(Jump), U8(21),
B(Mov), R(11), R(16),
B(Mov), R(14), R(17),
B(CallJSRuntime), U8(%promise_resolve), R(16), U8(2),
B(Mov), R(11), R(15),
B(Mov), R(13), R(16),
B(CallJSRuntime), U8(%promise_resolve), R(15), U8(2),
B(Ldar), R(11),
/* 68 S> */ B(Return),
B(Ldar), R(14),
B(Ldar), R(13),
/* 68 S> */ B(Return),
B(Ldar), R(14),
B(Ldar), R(13),
B(ReThrow),
B(LdaUndefined),
/* 68 S> */ B(Return),
]
constant pool: [
Smi [95],
Smi [333],
Smi [391],
Smi [110],
Smi [312],
Smi [369],
TUPLE2_TYPE,
SYMBOL_TYPE,
SYMBOL_TYPE,
ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
Smi [33],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["done"],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"],
ONE_BYTE_INTERNALIZED_STRING_TYPE [".catch"],
......@@ -551,11 +527,11 @@ constant pool: [
Smi [22],
]
handlers: [
[46, 526, 534],
[49, 483, 485],
[55, 251, 259],
[58, 211, 213],
[320, 370, 372],
[36, 499, 507],
[39, 456, 458],
[45, 226, 234],
[48, 186, 188],
[295, 344, 346],
]
---
......@@ -568,79 +544,68 @@ snippet: "
}
f();
"
frame size: 24
frame size: 23
parameter count: 1
bytecode array length: 569
bytecode array length: 542
bytecodes: [
B(Ldar), R(2),
B(JumpIfUndefined), U8(18),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(2), U8(1),
B(PushContext), R(13),
B(RestoreGeneratorState), R(2),
B(Star), R(12),
B(SwitchOnSmiNoFeedback), U8(0), U8(3), I8(0),
B(Abort), U8(15),
B(LdaSmi), I8(-2),
B(Star), R(12),
B(Mov), R(closure), R(13),
B(Mov), R(this), R(14),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(13), U8(2),
B(PushContext), R(12),
B(SwitchOnGeneratorState), R(2), U8(0), U8(3),
B(Mov), R(closure), R(12),
B(Mov), R(this), R(13),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(12), U8(2),
B(Star), R(2),
/* 16 E> */ B(StackCheck),
B(CallJSRuntime), U8(%async_function_promise_create), R(0), U8(0),
B(Star), R(11),
B(Mov), R(context), R(14),
B(Mov), R(context), R(15),
B(Mov), R(context), R(16),
B(LdaZero),
B(Star), R(7),
B(Mov), R(context), R(18),
B(Mov), R(context), R(19),
B(Mov), R(context), R(20),
/* 43 S> */ B(CreateArrayLiteral), U8(3), U8(0), U8(37),
B(Star), R(21),
B(LdaNamedProperty), R(21), U8(4), U8(1),
B(Star), R(20),
B(LdaNamedProperty), R(20), U8(4), U8(1),
B(JumpIfUndefined), U8(17),
B(JumpIfNull), U8(15),
B(Star), R(22),
B(CallProperty0), R(22), R(21), U8(3),
B(Star), R(21),
B(CallProperty0), R(21), R(20), U8(3),
B(JumpIfJSReceiver), U8(23),
B(CallRuntime), U16(Runtime::kThrowSymbolAsyncIteratorInvalid), R(0), U8(0),
B(LdaNamedProperty), R(21), U8(5), U8(5),
B(Star), R(22),
B(CallProperty0), R(22), R(21), U8(7),
B(Star), R(22),
B(InvokeIntrinsic), U8(Runtime::k_CreateAsyncFromSyncIterator), R(22), U8(1),
B(LdaNamedProperty), R(20), U8(5), U8(5),
B(Star), R(21),
B(CallProperty0), R(21), R(20), U8(7),
B(Star), R(21),
B(InvokeIntrinsic), U8(Runtime::k_CreateAsyncFromSyncIterator), R(21), U8(1),
B(Star), R(4),
/* 43 E> */ B(LdaNamedProperty), R(4), U8(6), U8(9),
B(Star), R(5),
B(Ldar), R(12),
B(SwitchOnSmiNoFeedback), U8(7), U8(1), I8(0),
B(LdaSmi), I8(-2),
B(TestEqualStrictNoFeedback), R(12),
B(JumpIfTrue), U8(4),
B(Abort), U8(15),
/* 40 S> */ B(CallProperty0), R(5), R(4), U8(11),
B(Star), R(22),
B(Mov), R(2), R(21),
B(Mov), R(11), R(23),
B(CallJSRuntime), U8(%async_function_await_uncaught), R(21), U8(3),
/* 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(Mov), R(2), R(20),
B(Mov), R(11), R(22),
B(CallJSRuntime), U8(%async_function_await_uncaught), R(20), U8(3),
/* 40 E> */ B(SuspendGenerator), R(2), R(0), U8(20), U8(0),
B(ResumeGenerator), R(2), R(0), U8(20),
B(Star), R(20),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
B(Star), R(22),
B(Star), R(21),
B(LdaZero),
B(TestEqualStrictNoFeedback), R(22),
B(TestEqualStrictNoFeedback), R(21),
B(JumpIfTrue), U8(5),
B(Ldar), R(21),
B(Ldar), R(20),
B(ReThrow),
B(Mov), R(21), R(6),
/* 40 E> */ B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(21), U8(1),
B(Mov), R(20), R(6),
/* 40 E> */ B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(20), U8(1),
B(ToBooleanLogicalNot),
B(JumpIfFalse), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(6), U8(1),
B(LdaNamedProperty), R(6), U8(8), U8(13),
B(LdaNamedProperty), R(6), U8(7), U8(13),
B(JumpIfToBooleanTrue), U8(43),
B(LdaNamedProperty), R(6), U8(9), U8(15),
B(LdaNamedProperty), R(6), U8(8), U8(15),
B(Star), R(8),
B(LdaSmi), I8(2),
B(Star), R(7),
......@@ -657,89 +622,66 @@ bytecodes: [
/* 103 S> */ B(Jump), U8(8),
B(LdaZero),
B(Star), R(7),
B(JumpLoop), U8(115), I8(0),
B(JumpLoop), U8(100), I8(0),
B(Jump), U8(40),
B(Star), R(21),
B(Ldar), R(closure),
B(CreateCatchContext), R(21), U8(10), U8(11),
B(Star), R(20),
B(Ldar), R(closure),
B(CreateCatchContext), R(20), U8(9), U8(10),
B(Star), R(19),
B(LdaTheHole),
B(SetPendingMessage),
B(Ldar), R(20),
B(PushContext), R(21),
B(Ldar), R(19),
B(PushContext), R(20),
B(LdaSmi), I8(2),
B(TestEqualStrict), R(7), U8(19),
B(JumpIfFalse), U8(6),
B(LdaSmi), I8(1),
B(Star), R(7),
B(LdaImmutableCurrentContextSlot), U8(4),
B(Star), R(22),
B(CallRuntime), U16(Runtime::kReThrow), R(22), U8(1),
B(PopContext), R(21),
B(Star), R(21),
B(CallRuntime), U16(Runtime::kReThrow), R(21), U8(1),
B(PopContext), R(20),
B(LdaSmi), I8(-1),
B(Star), R(18),
B(Star), R(17),
B(Star), R(16),
B(Jump), U8(7),
B(Star), R(18),
B(LdaZero),
B(Star), R(17),
B(LdaZero),
B(Star), R(16),
B(LdaTheHole),
B(SetPendingMessage),
B(Star), R(19),
B(Star), R(18),
B(LdaZero),
B(TestEqualStrict), R(7), U8(20),
B(JumpIfTrue), U8(169),
B(LdaNamedProperty), R(4), U8(12), U8(21),
B(JumpIfTrue), U8(167),
B(LdaNamedProperty), R(4), U8(11), U8(21),
B(Star), R(9),
B(TestUndetectable),
B(JumpIfFalse), U8(4),
B(Jump), U8(158),
B(Jump), U8(156),
B(LdaSmi), I8(1),
B(TestEqualStrict), R(7), U8(23),
B(JumpIfFalse), U8(87),
B(JumpIfFalse), U8(86),
B(Ldar), R(9),
B(TestTypeOf), U8(6),
B(JumpIfFalse), U8(4),
B(Jump), U8(18),
B(Wide), B(LdaSmi), I16(144),
B(Star), R(19),
B(LdaConstant), U8(12),
B(Star), R(20),
B(LdaConstant), U8(13),
B(Star), R(21),
B(CallRuntime), U16(Runtime::kNewTypeError), R(20), U8(2),
B(CallRuntime), U16(Runtime::kNewTypeError), R(19), U8(2),
B(Throw),
B(Mov), R(context), R(20),
B(Mov), R(9), R(21),
B(Mov), R(4), R(22),
B(InvokeIntrinsic), U8(Runtime::k_Call), R(21), U8(2),
B(Star), R(22),
B(Mov), R(2), R(21),
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),
B(ResumeGenerator), R(2), R(12), R(0), U8(21),
B(Star), R(21),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
B(Star), R(22),
B(LdaZero),
B(TestEqualStrictNoFeedback), R(22),
B(JumpIfTrue), U8(5),
B(Ldar), R(21),
B(ReThrow),
B(Ldar), R(21),
B(Jump), U8(6),
B(LdaTheHole),
B(SetPendingMessage),
B(Ldar), R(20),
B(Jump), U8(66),
B(Mov), R(context), R(19),
B(Mov), R(9), R(20),
B(Mov), R(4), R(21),
B(InvokeIntrinsic), U8(Runtime::k_Call), R(20), U8(2),
B(Star), R(21),
B(Mov), R(2), R(20),
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),
B(ResumeGenerator), R(2), R(12), R(0), U8(20),
B(CallJSRuntime), U8(%async_function_await_caught), R(20), U8(3),
B(SuspendGenerator), R(2), R(0), U8(20), U8(1),
B(ResumeGenerator), R(2), R(0), U8(20),
B(Star), R(20),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
B(Star), R(21),
......@@ -748,78 +690,100 @@ bytecodes: [
B(JumpIfTrue), U8(5),
B(Ldar), R(20),
B(ReThrow),
B(Mov), R(20), R(10),
B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(20), U8(1),
B(Ldar), R(20),
B(Jump), U8(6),
B(LdaTheHole),
B(SetPendingMessage),
B(Ldar), R(19),
B(Jump), U8(65),
B(Mov), R(9), R(19),
B(Mov), R(4), R(20),
B(InvokeIntrinsic), U8(Runtime::k_Call), R(19), U8(2),
B(Star), R(20),
B(Mov), R(2), R(19),
B(Mov), R(11), R(21),
B(CallJSRuntime), U8(%async_function_await_uncaught), R(19), U8(3),
B(SuspendGenerator), R(2), R(0), U8(19), U8(2),
B(ResumeGenerator), R(2), R(0), U8(19),
B(Star), R(19),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
B(Star), R(20),
B(LdaZero),
B(TestEqualStrictNoFeedback), R(20),
B(JumpIfTrue), U8(5),
B(Ldar), R(19),
B(ReThrow),
B(Mov), R(19), R(10),
B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(19), U8(1),
B(JumpIfToBooleanFalse), U8(4),
B(Jump), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(10), U8(1),
B(Ldar), R(19),
B(Ldar), R(18),
B(SetPendingMessage),
B(LdaZero),
B(TestEqualStrictNoFeedback), R(17),
B(TestEqualStrictNoFeedback), R(16),
B(JumpIfFalse), U8(5),
B(Ldar), R(18),
B(Ldar), R(17),
B(ReThrow),
B(LdaUndefined),
B(Star), R(18),
B(Mov), R(11), R(17),
B(CallJSRuntime), U8(%promise_resolve), R(17), U8(2),
B(Star), R(17),
B(Mov), R(11), R(16),
B(CallJSRuntime), U8(%promise_resolve), R(16), U8(2),
B(LdaZero),
B(Star), R(13),
B(Mov), R(11), R(14),
B(Star), R(12),
B(Mov), R(11), R(13),
B(Jump), U8(58),
B(Jump), U8(42),
B(Star), R(17),
B(Ldar), R(closure),
B(CreateCatchContext), R(17), U8(10), U8(14),
B(Star), R(16),
B(Ldar), R(closure),
B(CreateCatchContext), R(16), U8(9), U8(13),
B(Star), R(15),
B(LdaTheHole),
B(SetPendingMessage),
B(Ldar), R(16),
B(PushContext), R(17),
B(Ldar), R(15),
B(PushContext), R(16),
B(LdaImmutableCurrentContextSlot), U8(4),
B(Star), R(19),
B(Star), R(18),
B(LdaFalse),
B(Star), R(20),
B(Mov), R(11), R(18),
B(CallJSRuntime), U8(%promise_internal_reject), R(18), U8(3),
B(PopContext), R(17),
B(Star), R(19),
B(Mov), R(11), R(17),
B(CallJSRuntime), U8(%promise_internal_reject), R(17), U8(3),
B(PopContext), R(16),
B(LdaZero),
B(Star), R(13),
B(Mov), R(11), R(14),
B(Star), R(12),
B(Mov), R(11), R(13),
B(Jump), U8(16),
B(LdaSmi), I8(-1),
B(Star), R(14),
B(Star), R(13),
B(Star), R(12),
B(Jump), U8(8),
B(Star), R(14),
B(LdaSmi), I8(1),
B(Star), R(13),
B(LdaSmi), I8(1),
B(Star), R(12),
B(LdaTheHole),
B(SetPendingMessage),
B(Star), R(15),
B(Star), R(14),
B(CallJSRuntime), U8(%async_function_promise_release), R(11), U8(1),
B(Ldar), R(15),
B(Ldar), R(14),
B(SetPendingMessage),
B(Ldar), R(13),
B(SwitchOnSmiNoFeedback), U8(15), U8(2), I8(0),
B(Ldar), R(12),
B(SwitchOnSmiNoFeedback), U8(14), U8(2), I8(0),
B(Jump), U8(8),
B(Ldar), R(14),
B(Ldar), R(13),
/* 114 S> */ B(Return),
B(Ldar), R(14),
B(Ldar), R(13),
B(ReThrow),
B(LdaUndefined),
/* 114 S> */ B(Return),
]
constant pool: [
Smi [95],
Smi [348],
Smi [406],
Smi [110],
Smi [327],
Smi [384],
TUPLE2_TYPE,
SYMBOL_TYPE,
SYMBOL_TYPE,
ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
Smi [33],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["done"],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"],
ONE_BYTE_INTERNALIZED_STRING_TYPE [".catch"],
......@@ -831,11 +795,11 @@ constant pool: [
Smi [9],
]
handlers: [
[46, 528, 536],
[49, 486, 488],
[55, 267, 275],
[58, 227, 229],
[335, 385, 387],
[36, 501, 509],
[39, 459, 461],
[45, 242, 250],
[48, 202, 204],
[310, 359, 361],
]
---
......
......@@ -617,47 +617,42 @@ snippet: "
}
f([1, 2, 3]);
"
frame size: 20
frame size: 19
parameter count: 2
bytecode array length: 319
bytecode array length: 308
bytecodes: [
B(Ldar), R(3),
B(JumpIfUndefined), U8(18),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(3), U8(1),
B(PushContext), R(13),
B(RestoreGeneratorState), R(3),
B(Star), R(12),
B(SwitchOnSmiNoFeedback), U8(0), U8(1), I8(0),
B(Abort), U8(15),
B(LdaSmi), I8(-2),
B(Star), R(12),
B(PushContext), R(12),
B(SwitchOnGeneratorState), R(3), U8(0), U8(1),
B(CreateFunctionContext), U8(1),
B(PushContext), R(13),
B(PushContext), R(12),
B(Ldar), R(arg0),
B(StaCurrentContextSlot), U8(4),
B(Mov), R(closure), R(14),
B(Mov), R(this), R(15),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(14), U8(2),
B(Mov), R(closure), R(13),
B(Mov), R(this), R(14),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(13), U8(2),
B(Star), R(3),
/* 11 E> */ B(StackCheck),
/* 11 E> */ B(SuspendGenerator), R(3), R(0), U8(14), U8(0),
B(ResumeGenerator), R(3), R(12), R(0), U8(14),
B(Star), R(14),
/* 11 E> */ B(SuspendGenerator), R(3), R(0), U8(13), U8(0),
B(ResumeGenerator), R(3), R(0), U8(13),
B(Star), R(13),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(3), U8(1),
B(SwitchOnSmiNoFeedback), U8(1), U8(2), I8(0),
B(Ldar), R(14),
B(Ldar), R(13),
/* 11 E> */ B(Throw),
B(Ldar), R(14),
B(Ldar), R(13),
/* 55 S> */ B(Return),
B(LdaZero),
B(Star), R(8),
B(Mov), R(context), R(15),
B(Mov), R(context), R(16),
B(Mov), R(context), R(17),
/* 35 S> */ B(LdaImmutableCurrentContextSlot), U8(4),
B(Star), R(17),
B(LdaNamedProperty), R(17), U8(3), U8(0),
B(Star), R(18),
B(LdaNamedProperty), R(18), U8(3), U8(0),
B(Star), R(19),
B(CallProperty0), R(19), R(18), U8(2),
B(CallProperty0), R(18), R(17), U8(2),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowSymbolIteratorInvalid), R(0), U8(0),
B(Star), R(5),
......@@ -683,30 +678,30 @@ bytecodes: [
B(Star), R(8),
B(JumpLoop), U8(47), I8(0),
B(Jump), U8(36),
B(Star), R(18),
B(Ldar), R(closure),
/* 50 E> */ B(CreateCatchContext), R(18), U8(7), U8(8),
B(PushContext), R(18),
B(Star), R(17),
B(Ldar), R(closure),
/* 50 E> */ B(CreateCatchContext), R(17), U8(7), U8(8),
B(PushContext), R(17),
B(Star), R(16),
B(LdaSmi), I8(2),
B(TestEqualStrict), R(8), U8(12),
B(JumpIfFalse), U8(6),
B(LdaSmi), I8(1),
B(Star), R(8),
B(LdaImmutableCurrentContextSlot), U8(4),
B(Star), R(19),
B(CallRuntime), U16(Runtime::kReThrow), R(19), U8(1),
B(PopContext), R(18),
B(Star), R(18),
B(CallRuntime), U16(Runtime::kReThrow), R(18), U8(1),
B(PopContext), R(17),
B(LdaSmi), I8(-1),
B(Star), R(15),
B(Star), R(14),
B(Star), R(13),
B(Jump), U8(7),
B(Star), R(15),
B(LdaZero),
B(Star), R(14),
B(LdaZero),
B(Star), R(13),
B(LdaTheHole),
B(SetPendingMessage),
B(Star), R(16),
B(Star), R(15),
B(LdaZero),
B(TestEqualStrict), R(8), U8(13),
B(JumpIfTrue), U8(90),
......@@ -723,40 +718,40 @@ bytecodes: [
B(JumpIfFalse), U8(4),
B(Jump), U8(18),
B(Wide), B(LdaSmi), I16(144),
B(Star), R(17),
B(Star), R(16),
B(LdaConstant), U8(10),
B(Star), R(18),
B(CallRuntime), U16(Runtime::kNewTypeError), R(17), U8(2),
B(Star), R(17),
B(CallRuntime), U16(Runtime::kNewTypeError), R(16), U8(2),
B(Throw),
B(Mov), R(context), R(17),
B(Mov), R(10), R(18),
B(Mov), R(5), R(19),
B(InvokeIntrinsic), U8(Runtime::k_Call), R(18), U8(2),
B(Mov), R(context), R(16),
B(Mov), R(10), R(17),
B(Mov), R(5), R(18),
B(InvokeIntrinsic), U8(Runtime::k_Call), R(17), U8(2),
B(Jump), U8(6),
B(LdaTheHole),
B(SetPendingMessage),
B(Ldar), R(17),
B(Ldar), R(16),
B(Jump), U8(27),
B(Mov), R(10), R(17),
B(Mov), R(5), R(18),
B(InvokeIntrinsic), U8(Runtime::k_Call), R(17), U8(2),
B(Mov), R(10), R(16),
B(Mov), R(5), R(17),
B(InvokeIntrinsic), U8(Runtime::k_Call), R(16), U8(2),
B(Star), R(11),
B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(11), U8(1),
B(JumpIfToBooleanFalse), U8(4),
B(Jump), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(11), U8(1),
B(Ldar), R(16),
B(Ldar), R(15),
B(SetPendingMessage),
B(LdaZero),
B(TestEqualStrictNoFeedback), R(14),
B(TestEqualStrictNoFeedback), R(13),
B(JumpIfFalse), U8(5),
B(Ldar), R(15),
B(Ldar), R(14),
B(ReThrow),
B(LdaUndefined),
/* 55 S> */ B(Return),
]
constant pool: [
Smi [36],
Smi [30],
Smi [10],
Smi [7],
SYMBOL_TYPE,
......@@ -769,9 +764,9 @@ constant pool: [
ONE_BYTE_INTERNALIZED_STRING_TYPE [""],
]
handlers: [
[77, 195, 203],
[80, 159, 161],
[263, 273, 275],
[66, 184, 192],
[69, 148, 150],
[252, 262, 264],
]
---
......@@ -781,67 +776,56 @@ snippet: "
}
f([1, 2, 3]);
"
frame size: 19
frame size: 18
parameter count: 2
bytecode array length: 378
bytecode array length: 352
bytecodes: [
B(Ldar), R(2),
B(JumpIfUndefined), U8(18),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(2), U8(1),
B(PushContext), R(12),
B(RestoreGeneratorState), R(2),
B(Star), R(11),
B(SwitchOnSmiNoFeedback), U8(0), U8(2), I8(0),
B(Abort), U8(15),
B(LdaSmi), I8(-2),
B(Star), R(11),
B(PushContext), R(11),
B(SwitchOnGeneratorState), R(2), U8(0), U8(2),
B(CreateFunctionContext), U8(1),
B(PushContext), R(12),
B(PushContext), R(11),
B(Ldar), R(arg0),
B(StaCurrentContextSlot), U8(4),
B(Mov), R(closure), R(13),
B(Mov), R(this), R(14),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(13), U8(2),
B(Mov), R(closure), R(12),
B(Mov), R(this), R(13),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(12), U8(2),
B(Star), R(2),
/* 11 E> */ B(StackCheck),
/* 11 E> */ B(SuspendGenerator), R(2), R(0), U8(13), U8(0),
B(ResumeGenerator), R(2), R(11), R(0), U8(13),
B(Star), R(13),
/* 11 E> */ B(SuspendGenerator), R(2), R(0), U8(12), U8(0),
B(ResumeGenerator), R(2), R(0), U8(12),
B(Star), R(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(13),
B(Ldar), R(12),
/* 11 E> */ B(Throw),
B(Ldar), R(13),
B(Ldar), R(12),
/* 49 S> */ B(Return),
B(LdaZero),
B(Star), R(7),
B(Mov), R(context), R(14),
B(Mov), R(context), R(15),
B(Mov), R(context), R(16),
/* 35 S> */ B(LdaImmutableCurrentContextSlot), U8(4),
B(Star), R(16),
B(LdaNamedProperty), R(16), U8(4), U8(0),
B(Star), R(17),
B(LdaNamedProperty), R(17), U8(4), U8(0),
B(Star), R(18),
B(CallProperty0), R(18), R(17), U8(2),
B(CallProperty0), R(17), R(16), U8(2),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowSymbolIteratorInvalid), R(0), U8(0),
B(Star), R(4),
/* 35 E> */ B(LdaNamedProperty), R(4), U8(5), U8(4),
B(Star), R(5),
B(Ldar), R(11),
B(SwitchOnSmiNoFeedback), U8(6), U8(1), I8(1),
B(LdaSmi), I8(-2),
B(TestEqualStrictNoFeedback), R(11),
B(JumpIfTrue), U8(4),
B(Abort), U8(15),
/* 30 S> */ B(CallProperty0), R(5), R(4), U8(6),
B(Star), R(6),
/* 30 E> */ B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(6), U8(1),
B(ToBooleanLogicalNot),
B(JumpIfFalse), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(6), U8(1),
B(LdaNamedProperty), R(6), U8(7), U8(8),
B(JumpIfToBooleanTrue), U8(66),
B(LdaNamedProperty), R(6), U8(8), U8(10),
B(LdaNamedProperty), R(6), U8(6), U8(8),
B(JumpIfToBooleanTrue), U8(65),
B(LdaNamedProperty), R(6), U8(7), U8(10),
B(Star), R(8),
B(LdaSmi), I8(2),
B(Star), R(7),
......@@ -849,52 +833,52 @@ bytecodes: [
/* 21 E> */ B(StackCheck),
B(Mov), R(3), R(0),
/* 40 S> */ B(LdaFalse),
B(Star), R(18),
B(Mov), R(0), R(17),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(17), U8(2),
/* 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(Mov), R(0), R(16),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(16), U8(2),
/* 40 E> */ B(SuspendGenerator), R(2), R(0), U8(16), U8(1),
B(ResumeGenerator), R(2), R(0), U8(16),
B(Star), R(16),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
B(SwitchOnSmiNoFeedback), U8(9), U8(2), I8(0),
B(Ldar), R(17),
B(SwitchOnSmiNoFeedback), U8(8), U8(2), I8(0),
B(Ldar), R(16),
/* 40 E> */ B(Throw),
B(LdaZero),
B(Star), R(13),
B(Mov), R(17), R(14),
B(Star), R(12),
B(Mov), R(16), R(13),
B(Jump), U8(58),
B(LdaZero),
B(Star), R(7),
B(JumpLoop), U8(99), I8(0),
B(JumpLoop), U8(84), I8(0),
B(Jump), U8(36),
B(Star), R(17),
B(Ldar), R(closure),
B(CreateCatchContext), R(17), U8(11), U8(12),
B(PushContext), R(17),
B(Star), R(16),
B(Ldar), R(closure),
B(CreateCatchContext), R(16), U8(10), U8(11),
B(PushContext), R(16),
B(Star), R(15),
B(LdaSmi), I8(2),
B(TestEqualStrict), R(7), U8(12),
B(JumpIfFalse), U8(6),
B(LdaSmi), I8(1),
B(Star), R(7),
B(LdaImmutableCurrentContextSlot), U8(4),
B(Star), R(18),
B(CallRuntime), U16(Runtime::kReThrow), R(18), U8(1),
B(PopContext), R(17),
B(Star), R(17),
B(CallRuntime), U16(Runtime::kReThrow), R(17), U8(1),
B(PopContext), R(16),
B(LdaSmi), I8(-1),
B(Star), R(14),
B(Star), R(13),
B(Star), R(12),
B(Jump), U8(8),
B(Star), R(14),
B(LdaSmi), I8(1),
B(Star), R(13),
B(LdaSmi), I8(1),
B(Star), R(12),
B(LdaTheHole),
B(SetPendingMessage),
B(Star), R(15),
B(Star), R(14),
B(LdaZero),
B(TestEqualStrict), R(7), U8(13),
B(JumpIfTrue), U8(90),
B(LdaNamedProperty), R(4), U8(13), U8(14),
B(LdaNamedProperty), R(4), U8(12), U8(14),
B(Star), R(9),
B(TestUndetectable),
B(JumpIfFalse), U8(4),
......@@ -907,48 +891,47 @@ bytecodes: [
B(JumpIfFalse), U8(4),
B(Jump), U8(18),
B(Wide), B(LdaSmi), I16(144),
B(Star), R(15),
B(LdaConstant), U8(13),
B(Star), R(16),
B(LdaConstant), U8(14),
B(Star), R(17),
B(CallRuntime), U16(Runtime::kNewTypeError), R(16), U8(2),
B(CallRuntime), U16(Runtime::kNewTypeError), R(15), U8(2),
B(Throw),
B(Mov), R(context), R(16),
B(Mov), R(9), R(17),
B(Mov), R(4), R(18),
B(InvokeIntrinsic), U8(Runtime::k_Call), R(17), U8(2),
B(Mov), R(context), R(15),
B(Mov), R(9), R(16),
B(Mov), R(4), R(17),
B(InvokeIntrinsic), U8(Runtime::k_Call), R(16), U8(2),
B(Jump), U8(6),
B(LdaTheHole),
B(SetPendingMessage),
B(Ldar), R(16),
B(Ldar), R(15),
B(Jump), U8(27),
B(Mov), R(9), R(16),
B(Mov), R(4), R(17),
B(InvokeIntrinsic), U8(Runtime::k_Call), R(16), U8(2),
B(Mov), R(9), R(15),
B(Mov), R(4), R(16),
B(InvokeIntrinsic), U8(Runtime::k_Call), R(15), U8(2),
B(Star), R(10),
B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(10), U8(1),
B(JumpIfToBooleanFalse), U8(4),
B(Jump), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(10), U8(1),
B(Ldar), R(15),
B(Ldar), R(14),
B(SetPendingMessage),
B(Ldar), R(13),
B(SwitchOnSmiNoFeedback), U8(15), U8(2), I8(0),
B(Ldar), R(12),
B(SwitchOnSmiNoFeedback), U8(14), U8(2), I8(0),
B(Jump), U8(8),
B(Ldar), R(14),
B(Ldar), R(13),
/* 49 S> */ B(Return),
B(Ldar), R(14),
B(Ldar), R(13),
B(ReThrow),
B(LdaUndefined),
/* 49 S> */ B(Return),
]
constant pool: [
Smi [36],
Smi [95],
Smi [30],
Smi [144],
Smi [10],
Smi [7],
SYMBOL_TYPE,
ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
Smi [68],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["done"],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"],
Smi [15],
......@@ -961,9 +944,9 @@ constant pool: [
Smi [9],
]
handlers: [
[77, 247, 255],
[80, 211, 213],
[316, 326, 328],
[66, 221, 229],
[69, 185, 187],
[290, 300, 302],
]
---
......@@ -1171,117 +1154,106 @@ snippet: "
}
f([1, 2, 3]);
"
frame size: 25
frame size: 24
parameter count: 2
bytecode array length: 458
bytecode array length: 433
bytecodes: [
B(Ldar), R(2),
B(JumpIfUndefined), U8(18),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(2), U8(1),
B(PushContext), R(13),
B(RestoreGeneratorState), R(2),
B(Star), R(12),
B(SwitchOnSmiNoFeedback), U8(0), U8(1), I8(0),
B(Abort), U8(15),
B(LdaSmi), I8(-2),
B(Star), R(12),
B(PushContext), R(12),
B(SwitchOnGeneratorState), R(2), U8(0), U8(1),
B(CreateFunctionContext), U8(1),
B(PushContext), R(13),
B(PushContext), R(12),
B(Ldar), R(arg0),
B(StaCurrentContextSlot), U8(4),
B(Mov), R(closure), R(14),
B(Mov), R(this), R(15),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(14), U8(2),
B(Mov), R(closure), R(13),
B(Mov), R(this), R(14),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(13), U8(2),
B(Star), R(2),
/* 16 E> */ B(StackCheck),
B(CallJSRuntime), U8(%async_function_promise_create), R(0), U8(0),
B(Star), R(11),
B(Mov), R(context), R(15),
B(Mov), R(context), R(16),
B(Mov), R(context), R(17),
B(LdaZero),
B(Star), R(7),
B(Mov), R(context), R(19),
B(Mov), R(context), R(20),
B(Mov), R(context), R(21),
/* 40 S> */ B(LdaImmutableCurrentContextSlot), U8(4),
B(Star), R(21),
B(LdaNamedProperty), R(21), U8(1), U8(0),
B(Star), R(22),
B(LdaNamedProperty), R(22), U8(1), U8(0),
B(Star), R(23),
B(CallProperty0), R(23), R(22), U8(2),
B(CallProperty0), R(22), R(21), U8(2),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowSymbolIteratorInvalid), R(0), U8(0),
B(Star), R(4),
/* 40 E> */ B(LdaNamedProperty), R(4), U8(2), U8(4),
B(Star), R(5),
B(Ldar), R(12),
B(SwitchOnSmiNoFeedback), U8(3), U8(1), I8(0),
B(LdaSmi), I8(-2),
B(TestEqualStrictNoFeedback), R(12),
B(JumpIfTrue), U8(4),
B(Abort), U8(15),
/* 35 S> */ B(CallProperty0), R(5), R(4), U8(6),
B(Star), R(6),
/* 35 E> */ B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(6), U8(1),
B(ToBooleanLogicalNot),
B(JumpIfFalse), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(6), U8(1),
B(LdaNamedProperty), R(6), U8(4), U8(8),
B(JumpIfToBooleanTrue), U8(64),
B(LdaNamedProperty), R(6), U8(5), U8(10),
B(LdaNamedProperty), R(6), U8(3), U8(8),
B(JumpIfToBooleanTrue), U8(63),
B(LdaNamedProperty), R(6), U8(4), U8(10),
B(Star), R(8),
B(LdaSmi), I8(2),
B(Star), R(7),
B(Mov), R(8), R(3),
/* 26 E> */ B(StackCheck),
B(Mov), R(3), R(0),
/* 45 S> */ B(Mov), R(2), R(22),
B(Mov), R(0), R(23),
B(Mov), R(11), R(24),
B(CallJSRuntime), U8(%async_function_await_uncaught), R(22), U8(3),
/* 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),
/* 45 S> */ B(Mov), R(2), R(21),
B(Mov), R(0), R(22),
B(Mov), R(11), R(23),
B(CallJSRuntime), U8(%async_function_await_uncaught), R(21), U8(3),
/* 45 E> */ B(SuspendGenerator), R(2), R(0), U8(21), U8(0),
B(ResumeGenerator), R(2), R(0), U8(21),
B(Star), R(21),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
B(Star), R(23),
B(Star), R(22),
B(LdaZero),
B(TestEqualStrictNoFeedback), R(23),
B(TestEqualStrictNoFeedback), R(22),
B(JumpIfTrue), U8(5),
B(Ldar), R(22),
B(Ldar), R(21),
B(ReThrow),
B(LdaZero),
B(Star), R(7),
B(JumpLoop), U8(97), I8(0),
B(JumpLoop), U8(82), I8(0),
B(Jump), U8(40),
B(Star), R(22),
B(Ldar), R(closure),
B(CreateCatchContext), R(22), U8(6), U8(7),
B(Star), R(21),
B(Ldar), R(closure),
B(CreateCatchContext), R(21), U8(5), U8(6),
B(Star), R(20),
B(LdaTheHole),
B(SetPendingMessage),
B(Ldar), R(21),
B(PushContext), R(22),
B(Ldar), R(20),
B(PushContext), R(21),
B(LdaSmi), I8(2),
B(TestEqualStrict), R(7), U8(12),
B(JumpIfFalse), U8(6),
B(LdaSmi), I8(1),
B(Star), R(7),
B(LdaImmutableCurrentContextSlot), U8(4),
B(Star), R(23),
B(CallRuntime), U16(Runtime::kReThrow), R(23), U8(1),
B(PopContext), R(22),
B(Star), R(22),
B(CallRuntime), U16(Runtime::kReThrow), R(22), U8(1),
B(PopContext), R(21),
B(LdaSmi), I8(-1),
B(Star), R(19),
B(Star), R(18),
B(Star), R(17),
B(Jump), U8(7),
B(Star), R(19),
B(LdaZero),
B(Star), R(18),
B(LdaZero),
B(Star), R(17),
B(LdaTheHole),
B(SetPendingMessage),
B(Star), R(20),
B(Star), R(19),
B(LdaZero),
B(TestEqualStrict), R(7), U8(13),
B(JumpIfTrue), U8(90),
B(LdaNamedProperty), R(4), U8(8), U8(14),
B(LdaNamedProperty), R(4), U8(7), U8(14),
B(Star), R(9),
B(TestUndetectable),
B(JumpIfFalse), U8(4),
......@@ -1294,91 +1266,90 @@ bytecodes: [
B(JumpIfFalse), U8(4),
B(Jump), U8(18),
B(Wide), B(LdaSmi), I16(144),
B(Star), R(20),
B(LdaConstant), U8(8),
B(Star), R(21),
B(LdaConstant), U8(9),
B(Star), R(22),
B(CallRuntime), U16(Runtime::kNewTypeError), R(21), U8(2),
B(CallRuntime), U16(Runtime::kNewTypeError), R(20), U8(2),
B(Throw),
B(Mov), R(context), R(21),
B(Mov), R(9), R(22),
B(Mov), R(4), R(23),
B(InvokeIntrinsic), U8(Runtime::k_Call), R(22), U8(2),
B(Mov), R(context), R(20),
B(Mov), R(9), R(21),
B(Mov), R(4), R(22),
B(InvokeIntrinsic), U8(Runtime::k_Call), R(21), U8(2),
B(Jump), U8(6),
B(LdaTheHole),
B(SetPendingMessage),
B(Ldar), R(21),
B(Ldar), R(20),
B(Jump), U8(27),
B(Mov), R(9), R(21),
B(Mov), R(4), R(22),
B(InvokeIntrinsic), U8(Runtime::k_Call), R(21), U8(2),
B(Mov), R(9), R(20),
B(Mov), R(4), R(21),
B(InvokeIntrinsic), U8(Runtime::k_Call), R(20), U8(2),
B(Star), R(10),
B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(10), U8(1),
B(JumpIfToBooleanFalse), U8(4),
B(Jump), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(10), U8(1),
B(Ldar), R(20),
B(Ldar), R(19),
B(SetPendingMessage),
B(LdaZero),
B(TestEqualStrictNoFeedback), R(18),
B(TestEqualStrictNoFeedback), R(17),
B(JumpIfFalse), U8(5),
B(Ldar), R(19),
B(Ldar), R(18),
B(ReThrow),
B(LdaUndefined),
B(Star), R(19),
B(Mov), R(11), R(18),
B(CallJSRuntime), U8(%promise_resolve), R(18), U8(2),
B(Star), R(18),
B(Mov), R(11), R(17),
B(CallJSRuntime), U8(%promise_resolve), R(17), U8(2),
B(LdaZero),
B(Star), R(14),
B(Mov), R(11), R(15),
B(Star), R(13),
B(Mov), R(11), R(14),
B(Jump), U8(58),
B(Jump), U8(42),
B(Star), R(18),
B(Ldar), R(closure),
B(CreateCatchContext), R(18), U8(6), U8(10),
B(Star), R(17),
B(Ldar), R(closure),
B(CreateCatchContext), R(17), U8(5), U8(9),
B(Star), R(16),
B(LdaTheHole),
B(SetPendingMessage),
B(Ldar), R(17),
B(PushContext), R(18),
B(Ldar), R(16),
B(PushContext), R(17),
B(LdaImmutableCurrentContextSlot), U8(4),
B(Star), R(20),
B(Star), R(19),
B(LdaFalse),
B(Star), R(21),
B(Mov), R(11), R(19),
B(CallJSRuntime), U8(%promise_internal_reject), R(19), U8(3),
B(PopContext), R(18),
B(Star), R(20),
B(Mov), R(11), R(18),
B(CallJSRuntime), U8(%promise_internal_reject), R(18), U8(3),
B(PopContext), R(17),
B(LdaZero),
B(Star), R(14),
B(Mov), R(11), R(15),
B(Star), R(13),
B(Mov), R(11), R(14),
B(Jump), U8(16),
B(LdaSmi), I8(-1),
B(Star), R(15),
B(Star), R(14),
B(Star), R(13),
B(Jump), U8(8),
B(Star), R(15),
B(LdaSmi), I8(1),
B(Star), R(14),
B(LdaSmi), I8(1),
B(Star), R(13),
B(LdaTheHole),
B(SetPendingMessage),
B(Star), R(16),
B(Star), R(15),
B(CallJSRuntime), U8(%async_function_promise_release), R(11), U8(1),
B(Ldar), R(16),
B(Ldar), R(15),
B(SetPendingMessage),
B(Ldar), R(14),
B(SwitchOnSmiNoFeedback), U8(11), U8(2), I8(0),
B(Ldar), R(13),
B(SwitchOnSmiNoFeedback), U8(10), U8(2), I8(0),
B(Jump), U8(8),
B(Ldar), R(15),
B(Ldar), R(14),
/* 54 S> */ B(Return),
B(Ldar), R(15),
B(Ldar), R(14),
B(ReThrow),
B(LdaUndefined),
/* 54 S> */ B(Return),
]
constant pool: [
Smi [81],
Smi [134],
SYMBOL_TYPE,
ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
Smi [71],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["done"],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"],
ONE_BYTE_INTERNALIZED_STRING_TYPE [".catch"],
......@@ -1390,10 +1361,10 @@ constant pool: [
Smi [9],
]
handlers: [
[54, 417, 425],
[57, 375, 377],
[63, 235, 243],
[66, 195, 197],
[303, 313, 315],
[44, 392, 400],
[47, 350, 352],
[53, 210, 218],
[56, 170, 172],
[278, 288, 290],
]
......@@ -11,39 +11,34 @@ snippet: "
function* f() { }
f();
"
frame size: 4
frame size: 3
parameter count: 1
bytecode array length: 65
bytecode array length: 54
bytecodes: [
B(Ldar), R(0),
B(JumpIfUndefined), U8(18),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(0), U8(1),
B(PushContext), R(2),
B(RestoreGeneratorState), R(0),
B(Star), R(1),
B(SwitchOnSmiNoFeedback), U8(0), U8(1), I8(0),
B(Abort), U8(15),
B(LdaSmi), I8(-2),
B(Star), R(1),
B(Mov), R(closure), R(2),
B(Mov), R(this), R(3),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(2), U8(2),
B(PushContext), R(1),
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(Mov), R(closure), R(1),
B(Mov), R(this), R(2),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(1), U8(2),
B(Star), R(0),
/* 11 E> */ B(StackCheck),
/* 11 E> */ B(SuspendGenerator), R(0), R(0), U8(2), U8(0),
B(ResumeGenerator), R(0), R(1), R(0), U8(2),
B(Star), R(2),
/* 11 E> */ B(SuspendGenerator), R(0), R(0), U8(1), U8(0),
B(ResumeGenerator), R(0), R(0), U8(1),
B(Star), R(1),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(1), U8(2), I8(0),
B(Ldar), R(2),
B(Ldar), R(1),
/* 11 E> */ B(Throw),
B(Ldar), R(2),
B(Ldar), R(1),
/* 16 S> */ B(Return),
B(LdaUndefined),
/* 16 S> */ B(Return),
]
constant pool: [
Smi [28],
Smi [22],
Smi [10],
Smi [7],
]
......@@ -55,54 +50,49 @@ snippet: "
function* f() { yield 42 }
f();
"
frame size: 4
frame size: 3
parameter count: 1
bytecode array length: 102
bytecode array length: 90
bytecodes: [
B(Ldar), R(0),
B(JumpIfUndefined), U8(18),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(0), U8(1),
B(PushContext), R(2),
B(RestoreGeneratorState), R(0),
B(Star), R(1),
B(SwitchOnSmiNoFeedback), U8(0), U8(2), I8(0),
B(Abort), U8(15),
B(LdaSmi), I8(-2),
B(Star), R(1),
B(Mov), R(closure), R(2),
B(Mov), R(this), R(3),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(2), U8(2),
B(PushContext), R(1),
B(SwitchOnGeneratorState), R(0), U8(0), U8(2),
B(Mov), R(closure), R(1),
B(Mov), R(this), R(2),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(1), U8(2),
B(Star), R(0),
/* 11 E> */ B(StackCheck),
/* 11 E> */ B(SuspendGenerator), R(0), R(0), U8(2), U8(0),
B(ResumeGenerator), R(0), R(1), R(0), U8(2),
B(Star), R(2),
/* 11 E> */ B(SuspendGenerator), R(0), R(0), U8(1), U8(0),
B(ResumeGenerator), R(0), R(0), U8(1),
B(Star), R(1),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(2),
B(Ldar), R(1),
/* 11 E> */ B(Throw),
B(Ldar), R(2),
B(Ldar), R(1),
/* 25 S> */ B(Return),
/* 16 S> */ B(LdaSmi), I8(42),
B(Star), R(2),
B(Star), R(1),
B(LdaFalse),
B(Star), R(3),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(2), U8(2),
/* 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_CreateIterResultObject), R(1), U8(2),
/* 16 E> */ B(SuspendGenerator), R(0), R(0), U8(1), U8(1),
B(ResumeGenerator), R(0), R(0), U8(1),
B(Star), R(1),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(4), U8(2), I8(0),
B(Ldar), R(2),
B(Ldar), R(1),
/* 16 E> */ B(Throw),
B(Ldar), R(2),
B(Ldar), R(1),
/* 25 S> */ B(Return),
B(LdaUndefined),
/* 25 S> */ B(Return),
]
constant pool: [
Smi [28],
Smi [65],
Smi [22],
Smi [58],
Smi [10],
Smi [7],
Smi [10],
......@@ -116,63 +106,52 @@ snippet: "
function* f() { for (let x of [42]) yield x }
f();
"
frame size: 18
frame size: 17
parameter count: 1
bytecode array length: 372
bytecode array length: 346
bytecodes: [
B(Ldar), R(2),
B(JumpIfUndefined), U8(18),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(2), U8(1),
B(PushContext), R(12),
B(RestoreGeneratorState), R(2),
B(Star), R(11),
B(SwitchOnSmiNoFeedback), U8(0), U8(2), I8(0),
B(Abort), U8(15),
B(LdaSmi), I8(-2),
B(Star), R(11),
B(Mov), R(closure), R(12),
B(Mov), R(this), R(13),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(12), U8(2),
B(PushContext), R(11),
B(SwitchOnGeneratorState), R(2), U8(0), U8(2),
B(Mov), R(closure), R(11),
B(Mov), R(this), R(12),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(11), U8(2),
B(Star), R(2),
/* 11 E> */ B(StackCheck),
/* 11 E> */ B(SuspendGenerator), R(2), R(0), U8(12), U8(0),
B(ResumeGenerator), R(2), R(11), R(0), U8(12),
B(Star), R(12),
/* 11 E> */ B(SuspendGenerator), R(2), R(0), U8(11), U8(0),
B(ResumeGenerator), R(2), R(0), U8(11),
B(Star), R(11),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(12),
B(Ldar), R(11),
/* 11 E> */ B(Throw),
B(Ldar), R(12),
B(Ldar), R(11),
/* 44 S> */ B(Return),
B(LdaZero),
B(Star), R(7),
B(Mov), R(context), R(13),
B(Mov), R(context), R(14),
B(Mov), R(context), R(15),
/* 30 S> */ B(CreateArrayLiteral), U8(4), U8(0), U8(37),
B(Star), R(15),
B(LdaNamedProperty), R(15), U8(5), U8(1),
B(Star), R(16),
B(LdaNamedProperty), R(16), U8(5), U8(1),
B(Star), R(17),
B(CallProperty0), R(17), R(16), U8(3),
B(CallProperty0), R(16), R(15), U8(3),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowSymbolIteratorInvalid), R(0), U8(0),
B(Star), R(4),
/* 30 E> */ B(LdaNamedProperty), R(4), U8(6), U8(5),
B(Star), R(5),
B(Ldar), R(11),
B(SwitchOnSmiNoFeedback), U8(7), U8(1), I8(1),
B(LdaSmi), I8(-2),
B(TestEqualStrictNoFeedback), R(11),
B(JumpIfTrue), U8(4),
B(Abort), U8(15),
/* 25 S> */ B(CallProperty0), R(5), R(4), U8(7),
B(Star), R(6),
/* 25 E> */ B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(6), U8(1),
B(ToBooleanLogicalNot),
B(JumpIfFalse), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(6), U8(1),
B(LdaNamedProperty), R(6), U8(8), U8(9),
B(JumpIfToBooleanTrue), U8(66),
B(LdaNamedProperty), R(6), U8(9), U8(11),
B(LdaNamedProperty), R(6), U8(7), U8(9),
B(JumpIfToBooleanTrue), U8(65),
B(LdaNamedProperty), R(6), U8(8), U8(11),
B(Star), R(8),
B(LdaSmi), I8(2),
B(Star), R(7),
......@@ -180,52 +159,52 @@ bytecodes: [
/* 16 E> */ B(StackCheck),
B(Mov), R(3), R(0),
/* 36 S> */ B(LdaFalse),
B(Star), R(17),
B(Mov), R(0), R(16),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(16), U8(2),
/* 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(Mov), R(0), R(15),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(15), U8(2),
/* 36 E> */ B(SuspendGenerator), R(2), R(0), U8(15), U8(1),
B(ResumeGenerator), R(2), R(0), U8(15),
B(Star), R(15),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
B(SwitchOnSmiNoFeedback), U8(10), U8(2), I8(0),
B(Ldar), R(16),
B(SwitchOnSmiNoFeedback), U8(9), U8(2), I8(0),
B(Ldar), R(15),
/* 36 E> */ B(Throw),
B(LdaZero),
B(Star), R(12),
B(Mov), R(16), R(13),
B(Star), R(11),
B(Mov), R(15), R(12),
B(Jump), U8(58),
B(LdaZero),
B(Star), R(7),
B(JumpLoop), U8(99), I8(0),
B(JumpLoop), U8(84), I8(0),
B(Jump), U8(36),
B(Star), R(16),
B(Ldar), R(closure),
B(CreateCatchContext), R(16), U8(12), U8(13),
B(PushContext), R(16),
B(Star), R(15),
B(Ldar), R(closure),
B(CreateCatchContext), R(15), U8(11), U8(12),
B(PushContext), R(15),
B(Star), R(14),
B(LdaSmi), I8(2),
B(TestEqualStrict), R(7), U8(13),
B(JumpIfFalse), U8(6),
B(LdaSmi), I8(1),
B(Star), R(7),
B(LdaImmutableCurrentContextSlot), U8(4),
B(Star), R(17),
B(CallRuntime), U16(Runtime::kReThrow), R(17), U8(1),
B(PopContext), R(16),
B(Star), R(16),
B(CallRuntime), U16(Runtime::kReThrow), R(16), U8(1),
B(PopContext), R(15),
B(LdaSmi), I8(-1),
B(Star), R(13),
B(Star), R(12),
B(Star), R(11),
B(Jump), U8(8),
B(Star), R(13),
B(LdaSmi), I8(1),
B(Star), R(12),
B(LdaSmi), I8(1),
B(Star), R(11),
B(LdaTheHole),
B(SetPendingMessage),
B(Star), R(14),
B(Star), R(13),
B(LdaZero),
B(TestEqualStrict), R(7), U8(14),
B(JumpIfTrue), U8(90),
B(LdaNamedProperty), R(4), U8(14), U8(15),
B(LdaNamedProperty), R(4), U8(13), U8(15),
B(Star), R(9),
B(TestUndetectable),
B(JumpIfFalse), U8(4),
......@@ -238,49 +217,48 @@ bytecodes: [
B(JumpIfFalse), U8(4),
B(Jump), U8(18),
B(Wide), B(LdaSmi), I16(144),
B(Star), R(14),
B(LdaConstant), U8(14),
B(Star), R(15),
B(LdaConstant), U8(15),
B(Star), R(16),
B(CallRuntime), U16(Runtime::kNewTypeError), R(15), U8(2),
B(CallRuntime), U16(Runtime::kNewTypeError), R(14), U8(2),
B(Throw),
B(Mov), R(context), R(15),
B(Mov), R(9), R(16),
B(Mov), R(4), R(17),
B(InvokeIntrinsic), U8(Runtime::k_Call), R(16), U8(2),
B(Mov), R(context), R(14),
B(Mov), R(9), R(15),
B(Mov), R(4), R(16),
B(InvokeIntrinsic), U8(Runtime::k_Call), R(15), U8(2),
B(Jump), U8(6),
B(LdaTheHole),
B(SetPendingMessage),
B(Ldar), R(15),
B(Ldar), R(14),
B(Jump), U8(27),
B(Mov), R(9), R(15),
B(Mov), R(4), R(16),
B(InvokeIntrinsic), U8(Runtime::k_Call), R(15), U8(2),
B(Mov), R(9), R(14),
B(Mov), R(4), R(15),
B(InvokeIntrinsic), U8(Runtime::k_Call), R(14), U8(2),
B(Star), R(10),
B(InvokeIntrinsic), U8(Runtime::k_IsJSReceiver), R(10), U8(1),
B(JumpIfToBooleanFalse), U8(4),
B(Jump), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(10), U8(1),
B(Ldar), R(14),
B(Ldar), R(13),
B(SetPendingMessage),
B(Ldar), R(12),
B(SwitchOnSmiNoFeedback), U8(16), U8(2), I8(0),
B(Ldar), R(11),
B(SwitchOnSmiNoFeedback), U8(15), U8(2), I8(0),
B(Jump), U8(8),
B(Ldar), R(13),
B(Ldar), R(12),
/* 44 S> */ B(Return),
B(Ldar), R(13),
B(Ldar), R(12),
B(ReThrow),
B(LdaUndefined),
/* 44 S> */ B(Return),
]
constant pool: [
Smi [28],
Smi [89],
Smi [22],
Smi [138],
Smi [10],
Smi [7],
TUPLE2_TYPE,
SYMBOL_TYPE,
ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
Smi [68],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["done"],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"],
Smi [15],
......@@ -293,9 +271,9 @@ constant pool: [
Smi [9],
]
handlers: [
[69, 241, 249],
[72, 205, 207],
[310, 320, 322],
[58, 215, 223],
[61, 179, 181],
[284, 294, 296],
]
---
......@@ -304,115 +282,103 @@ snippet: "
function* f() { yield* g() }
f();
"
frame size: 10
frame size: 9
parameter count: 1
bytecode array length: 253
bytecode array length: 227
bytecodes: [
B(Ldar), R(0),
B(JumpIfUndefined), U8(18),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(0), U8(1),
B(PushContext), R(2),
B(RestoreGeneratorState), R(0),
B(Star), R(1),
B(SwitchOnSmiNoFeedback), U8(0), U8(2), I8(0),
B(Abort), U8(15),
B(LdaSmi), I8(-2),
B(Star), R(1),
B(Mov), R(closure), R(2),
B(Mov), R(this), R(3),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(2), U8(2),
B(PushContext), R(1),
B(SwitchOnGeneratorState), R(0), U8(0), U8(2),
B(Mov), R(closure), R(1),
B(Mov), R(this), R(2),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(1), U8(2),
B(Star), R(0),
/* 38 E> */ B(StackCheck),
/* 38 E> */ B(SuspendGenerator), R(0), R(0), U8(2), U8(0),
B(ResumeGenerator), R(0), R(1), R(0), U8(2),
B(Star), R(2),
/* 38 E> */ B(SuspendGenerator), R(0), R(0), U8(1), U8(0),
B(ResumeGenerator), R(0), R(0), U8(1),
B(Star), R(1),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(2),
B(Ldar), R(1),
/* 38 E> */ B(Throw),
B(Ldar), R(2),
B(Ldar), R(1),
/* 54 S> */ B(Return),
/* 43 S> */ B(LdaGlobal), U8(4), U8(0),
B(Star), R(9),
/* 50 E> */ B(CallUndefinedReceiver0), R(9), U8(2),
B(Star), R(7),
B(LdaNamedProperty), R(7), U8(5), U8(4),
B(Star), R(8),
B(CallProperty0), R(8), R(7), U8(6),
/* 50 E> */ B(CallUndefinedReceiver0), R(8), U8(2),
B(Star), R(6),
B(LdaNamedProperty), R(6), U8(5), U8(4),
B(Star), R(7),
B(CallProperty0), R(7), R(6), U8(6),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowSymbolIteratorInvalid), R(0), U8(0),
B(Star), R(4),
B(LdaNamedProperty), R(4), U8(6), U8(8),
B(Star), R(6),
B(LdaUndefined),
B(Star), R(3),
B(LdaNamedProperty), R(3), U8(6), U8(8),
B(Star), R(5),
B(LdaUndefined),
B(Star), R(4),
B(LdaZero),
B(Star), R(3),
B(Ldar), R(1),
B(SwitchOnSmiNoFeedback), U8(7), U8(1), I8(1),
B(LdaSmi), I8(-2),
B(TestEqualStrictNoFeedback), R(1),
B(JumpIfTrue), U8(4),
B(Abort), U8(15),
B(Ldar), R(3),
B(SwitchOnSmiNoFeedback), U8(8), U8(2), I8(1),
B(CallProperty1), R(6), R(4), R(5), U8(10),
B(Star), R(2),
B(Ldar), R(2),
B(SwitchOnSmiNoFeedback), U8(7), U8(2), I8(1),
B(CallProperty1), R(5), R(3), R(4), U8(10),
B(Jump), U8(69),
B(LdaNamedProperty), R(4), U8(10), U8(12),
B(LdaNamedProperty), R(3), U8(9), U8(12),
B(JumpIfUndefined), U8(13),
B(JumpIfNull), U8(11),
B(Star), R(9),
B(CallProperty1), R(9), R(4), R(5), U8(14),
B(Star), R(8),
B(CallProperty1), R(8), R(3), R(4), U8(14),
B(Jump), U8(52),
B(Ldar), R(5),
B(Ldar), R(4),
/* 54 S> */ B(Return),
B(LdaNamedProperty), R(4), U8(11), U8(16),
B(LdaNamedProperty), R(3), U8(10), U8(16),
B(JumpIfUndefined), U8(13),
B(JumpIfNull), U8(11),
B(Star), R(9),
B(CallProperty1), R(9), R(4), R(5), U8(18),
B(Star), R(8),
B(CallProperty1), R(8), R(3), R(4), U8(18),
B(Jump), U8(32),
B(LdaNamedProperty), R(4), U8(10), U8(20),
B(LdaNamedProperty), R(3), U8(9), U8(20),
B(JumpIfUndefined), U8(21),
B(JumpIfNull), U8(19),
B(Star), R(9),
B(CallProperty0), R(9), R(4), U8(22),
B(Star), R(8),
B(CallProperty0), R(8), R(3), U8(22),
B(Jump), U8(2),
B(JumpIfJSReceiver), U8(9),
B(Star), R(9),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(9), U8(1),
B(Star), R(8),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(8), U8(1),
B(CallRuntime), U16(Runtime::kThrowThrowMethodMissing), R(0), U8(0),
B(Star), R(2),
B(Star), R(1),
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(2), U8(1),
B(LdaNamedProperty), R(2), U8(12), U8(24),
B(JumpIfToBooleanTrue), U8(25),
B(Ldar), R(2),
/* 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(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(1), U8(1),
B(LdaNamedProperty), R(1), U8(11), U8(24),
B(JumpIfToBooleanTrue), U8(24),
B(Ldar), R(1),
/* 43 E> */ B(SuspendGenerator), R(0), R(0), U8(8), U8(1),
B(ResumeGenerator), R(0), R(0), U8(8),
B(Star), R(4),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(Star), R(2),
B(JumpLoop), U8(114), I8(0),
B(LdaNamedProperty), R(1), U8(12), U8(26),
B(Star), R(3),
B(JumpLoop), U8(129), I8(0),
B(LdaNamedProperty), R(2), U8(13), U8(26),
B(Star), R(4),
B(LdaSmi), I8(1),
B(TestEqualStrictNoFeedback), R(3),
B(TestEqualStrictNoFeedback), R(2),
B(JumpIfFalse), U8(5),
B(Ldar), R(4),
B(Ldar), R(3),
/* 54 S> */ B(Return),
B(LdaUndefined),
/* 54 S> */ B(Return),
]
constant pool: [
Smi [28],
Smi [90],
Smi [22],
Smi [185],
Smi [10],
Smi [7],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["g"],
SYMBOL_TYPE,
ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
Smi [114],
Smi [11],
Smi [31],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["return"],
......
......@@ -11,45 +11,40 @@ top level: yes
snippet: "
import \"bar\";
"
frame size: 6
frame size: 5
parameter count: 2
bytecode array length: 83
bytecode array length: 72
bytecodes: [
B(Ldar), R(0),
B(JumpIfUndefined), U8(18),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(0), U8(1),
B(PushContext), R(3),
B(RestoreGeneratorState), R(0),
B(Star), R(2),
B(SwitchOnSmiNoFeedback), U8(0), U8(1), I8(0),
B(Abort), U8(15),
B(LdaSmi), I8(-2),
B(Star), R(2),
B(PushContext), R(2),
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(LdaConstant), U8(1),
B(Star), R(5),
B(Mov), R(arg0), R(3),
B(Mov), R(closure), R(4),
B(CallRuntime), U16(Runtime::kPushModuleContext), R(3), U8(3),
B(PushContext), R(3),
B(Mov), R(this), R(5),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(4), U8(2),
B(Star), R(4),
B(Mov), R(arg0), R(2),
B(Mov), R(closure), R(3),
B(CallRuntime), U16(Runtime::kPushModuleContext), R(2), U8(3),
B(PushContext), R(2),
B(Mov), R(this), R(4),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(3), U8(2),
B(Star), R(0),
/* 0 E> */ B(StackCheck),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(4), U8(0),
B(ResumeGenerator), R(0), R(2), R(0), U8(4),
B(Star), R(4),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(3), U8(0),
B(ResumeGenerator), R(0), R(0), U8(3),
B(Star), R(3),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(4),
B(Ldar), R(3),
/* 0 E> */ B(Throw),
B(Ldar), R(4),
B(Ldar), R(3),
/* 13 S> */ B(Return),
B(Mov), R(4), R(1),
B(Mov), R(3), R(1),
B(Ldar), R(1),
/* 13 S> */ B(Return),
]
constant pool: [
Smi [42],
Smi [36],
FIXED_ARRAY_TYPE,
Smi [10],
Smi [7],
......@@ -61,45 +56,40 @@ handlers: [
snippet: "
import {foo} from \"bar\";
"
frame size: 6
frame size: 5
parameter count: 2
bytecode array length: 83
bytecode array length: 72
bytecodes: [
B(Ldar), R(0),
B(JumpIfUndefined), U8(18),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(0), U8(1),
B(PushContext), R(3),
B(RestoreGeneratorState), R(0),
B(Star), R(2),
B(SwitchOnSmiNoFeedback), U8(0), U8(1), I8(0),
B(Abort), U8(15),
B(LdaSmi), I8(-2),
B(Star), R(2),
B(PushContext), R(2),
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(LdaConstant), U8(1),
B(Star), R(5),
B(Mov), R(arg0), R(3),
B(Mov), R(closure), R(4),
B(CallRuntime), U16(Runtime::kPushModuleContext), R(3), U8(3),
B(PushContext), R(3),
B(Mov), R(this), R(5),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(4), U8(2),
B(Star), R(4),
B(Mov), R(arg0), R(2),
B(Mov), R(closure), R(3),
B(CallRuntime), U16(Runtime::kPushModuleContext), R(2), U8(3),
B(PushContext), R(2),
B(Mov), R(this), R(4),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(3), U8(2),
B(Star), R(0),
/* 0 E> */ B(StackCheck),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(4), U8(0),
B(ResumeGenerator), R(0), R(2), R(0), U8(4),
B(Star), R(4),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(3), U8(0),
B(ResumeGenerator), R(0), R(0), U8(3),
B(Star), R(3),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(4),
B(Ldar), R(3),
/* 0 E> */ B(Throw),
B(Ldar), R(4),
B(Ldar), R(3),
/* 24 S> */ B(Return),
B(Mov), R(4), R(1),
B(Mov), R(3), R(1),
B(Ldar), R(1),
/* 24 S> */ B(Return),
]
constant pool: [
Smi [42],
Smi [36],
FIXED_ARRAY_TYPE,
Smi [10],
Smi [7],
......@@ -113,58 +103,53 @@ snippet: "
goo(42);
{ let x; { goo(42) } };
"
frame size: 7
frame size: 6
parameter count: 2
bytecode array length: 113
bytecode array length: 102
bytecodes: [
B(Ldar), R(1),
B(JumpIfUndefined), U8(18),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(1), U8(1),
B(PushContext), R(4),
B(RestoreGeneratorState), R(1),
B(Star), R(3),
B(SwitchOnSmiNoFeedback), U8(0), U8(1), I8(0),
B(Abort), U8(15),
B(LdaSmi), I8(-2),
B(Star), R(3),
B(PushContext), R(3),
B(SwitchOnGeneratorState), R(1), U8(0), U8(1),
B(LdaConstant), U8(1),
B(Star), R(6),
B(Mov), R(arg0), R(4),
B(Mov), R(closure), R(5),
B(CallRuntime), U16(Runtime::kPushModuleContext), R(4), U8(3),
B(PushContext), R(4),
B(Mov), R(this), R(6),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(5), U8(2),
B(Star), R(5),
B(Mov), R(arg0), R(3),
B(Mov), R(closure), R(4),
B(CallRuntime), U16(Runtime::kPushModuleContext), R(3), U8(3),
B(PushContext), R(3),
B(Mov), R(this), R(5),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(4), U8(2),
B(Star), R(1),
/* 0 E> */ B(StackCheck),
/* 0 E> */ B(SuspendGenerator), R(1), R(0), U8(5), U8(0),
B(ResumeGenerator), R(1), R(3), R(0), U8(5),
B(Star), R(5),
/* 0 E> */ B(SuspendGenerator), R(1), R(0), U8(4), U8(0),
B(ResumeGenerator), R(1), R(0), U8(4),
B(Star), R(4),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(1), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(5),
B(Ldar), R(4),
/* 0 E> */ B(Throw),
B(Ldar), R(5),
B(Ldar), R(4),
/* 64 S> */ B(Return),
/* 32 S> */ B(LdaModuleVariable), I8(-1), U8(0),
B(ThrowReferenceErrorIfHole), U8(4),
B(Star), R(5),
B(Star), R(4),
B(LdaSmi), I8(42),
B(Star), R(6),
/* 32 E> */ B(CallUndefinedReceiver1), R(5), R(6), U8(0),
B(Star), R(5),
/* 32 E> */ B(CallUndefinedReceiver1), R(4), R(5), U8(0),
/* 47 S> */ B(LdaUndefined),
B(Star), R(0),
/* 52 S> */ B(LdaModuleVariable), I8(-1), U8(0),
B(ThrowReferenceErrorIfHole), U8(4),
B(Star), R(5),
B(Star), R(4),
B(LdaSmi), I8(42),
B(Star), R(6),
/* 52 E> */ B(CallUndefinedReceiver1), R(5), R(6), U8(2),
B(Star), R(5),
/* 52 E> */ B(CallUndefinedReceiver1), R(4), R(5), U8(2),
B(Star), R(2),
/* 64 S> */ B(Return),
]
constant pool: [
Smi [42],
Smi [36],
FIXED_ARRAY_TYPE,
Smi [10],
Smi [7],
......@@ -179,38 +164,33 @@ snippet: "
foo++;
{ let x; { foo++ } };
"
frame size: 7
frame size: 6
parameter count: 2
bytecode array length: 111
bytecode array length: 100
bytecodes: [
B(Ldar), R(1),
B(JumpIfUndefined), U8(18),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(1), U8(1),
B(PushContext), R(4),
B(RestoreGeneratorState), R(1),
B(Star), R(3),
B(SwitchOnSmiNoFeedback), U8(0), U8(1), I8(0),
B(Abort), U8(15),
B(LdaSmi), I8(-2),
B(Star), R(3),
B(PushContext), R(3),
B(SwitchOnGeneratorState), R(1), U8(0), U8(1),
B(LdaConstant), U8(1),
B(Star), R(6),
B(Mov), R(arg0), R(4),
B(Mov), R(closure), R(5),
B(CallRuntime), U16(Runtime::kPushModuleContext), R(4), U8(3),
B(PushContext), R(4),
B(Mov), R(this), R(6),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(5), U8(2),
B(Star), R(5),
B(Mov), R(arg0), R(3),
B(Mov), R(closure), R(4),
B(CallRuntime), U16(Runtime::kPushModuleContext), R(3), U8(3),
B(PushContext), R(3),
B(Mov), R(this), R(5),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(4), U8(2),
B(Star), R(1),
/* 0 E> */ B(StackCheck),
/* 0 E> */ B(SuspendGenerator), R(1), R(0), U8(5), U8(0),
B(ResumeGenerator), R(1), R(3), R(0), U8(5),
B(Star), R(5),
/* 0 E> */ B(SuspendGenerator), R(1), R(0), U8(4), U8(0),
B(ResumeGenerator), R(1), R(0), U8(4),
B(Star), R(4),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(1), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(5),
B(Ldar), R(4),
/* 0 E> */ B(Throw),
B(Ldar), R(5),
B(Ldar), R(4),
/* 49 S> */ B(Return),
/* 17 S> */ B(LdaSmi), I8(42),
/* 17 E> */ B(StaModuleVariable), I8(1), U8(0),
......@@ -221,15 +201,15 @@ bytecodes: [
B(Star), R(0),
/* 39 S> */ B(LdaModuleVariable), I8(1), U8(0),
B(ToNumeric), U8(1),
B(Star), R(5),
B(Star), R(4),
B(Inc), U8(1),
/* 42 E> */ B(StaModuleVariable), I8(1), U8(0),
B(Mov), R(5), R(2),
B(Mov), R(4), R(2),
B(Ldar), R(2),
/* 49 S> */ B(Return),
]
constant pool: [
Smi [42],
Smi [36],
FIXED_ARRAY_TYPE,
Smi [10],
Smi [7],
......@@ -243,41 +223,36 @@ snippet: "
foo++;
{ let x; { foo++ } };
"
frame size: 7
frame size: 6
parameter count: 2
bytecode array length: 117
bytecode array length: 106
bytecodes: [
B(Ldar), R(1),
B(JumpIfUndefined), U8(18),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(1), U8(1),
B(PushContext), R(4),
B(RestoreGeneratorState), R(1),
B(Star), R(3),
B(SwitchOnSmiNoFeedback), U8(0), U8(1), I8(0),
B(Abort), U8(15),
B(LdaSmi), I8(-2),
B(Star), R(3),
B(PushContext), R(3),
B(SwitchOnGeneratorState), R(1), U8(0), U8(1),
B(LdaConstant), U8(1),
B(Star), R(6),
B(Mov), R(arg0), R(4),
B(Mov), R(closure), R(5),
B(CallRuntime), U16(Runtime::kPushModuleContext), R(4), U8(3),
B(PushContext), R(4),
B(Mov), R(this), R(6),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(5), U8(2),
B(Star), R(5),
B(Mov), R(arg0), R(3),
B(Mov), R(closure), R(4),
B(CallRuntime), U16(Runtime::kPushModuleContext), R(3), U8(3),
B(PushContext), R(3),
B(Mov), R(this), R(5),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(4), U8(2),
B(Star), R(1),
B(LdaTheHole),
B(StaModuleVariable), I8(1), U8(0),
/* 0 E> */ B(StackCheck),
B(Ldar), R(1),
/* 0 E> */ B(SuspendGenerator), R(1), R(0), U8(5), U8(0),
B(ResumeGenerator), R(1), R(3), R(0), U8(5),
B(Star), R(5),
/* 0 E> */ B(SuspendGenerator), R(1), R(0), U8(4), U8(0),
B(ResumeGenerator), R(1), R(0), U8(4),
B(Star), R(4),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(1), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(5),
B(Ldar), R(4),
/* 0 E> */ B(Throw),
B(Ldar), R(5),
B(Ldar), R(4),
/* 49 S> */ B(Return),
/* 17 S> */ B(LdaSmi), I8(42),
/* 17 E> */ B(StaModuleVariable), I8(1), U8(0),
......@@ -288,15 +263,15 @@ bytecodes: [
B(Star), R(0),
/* 39 S> */ B(LdaModuleVariable), I8(1), U8(0),
B(ToNumeric), U8(1),
B(Star), R(5),
B(Star), R(4),
B(Inc), U8(1),
/* 42 E> */ B(StaModuleVariable), I8(1), U8(0),
B(Mov), R(5), R(2),
B(Mov), R(4), R(2),
B(Ldar), R(2),
/* 49 S> */ B(Return),
]
constant pool: [
Smi [48],
Smi [42],
FIXED_ARRAY_TYPE,
Smi [10],
Smi [7],
......@@ -310,41 +285,36 @@ snippet: "
foo++;
{ let x; { foo++ } };
"
frame size: 7
frame size: 6
parameter count: 2
bytecode array length: 121
bytecode array length: 110
bytecodes: [
B(Ldar), R(1),
B(JumpIfUndefined), U8(18),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(1), U8(1),
B(PushContext), R(4),
B(RestoreGeneratorState), R(1),
B(Star), R(3),
B(SwitchOnSmiNoFeedback), U8(0), U8(1), I8(0),
B(Abort), U8(15),
B(LdaSmi), I8(-2),
B(Star), R(3),
B(PushContext), R(3),
B(SwitchOnGeneratorState), R(1), U8(0), U8(1),
B(LdaConstant), U8(1),
B(Star), R(6),
B(Mov), R(arg0), R(4),
B(Mov), R(closure), R(5),
B(CallRuntime), U16(Runtime::kPushModuleContext), R(4), U8(3),
B(PushContext), R(4),
B(Mov), R(this), R(6),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(5), U8(2),
B(Star), R(5),
B(Mov), R(arg0), R(3),
B(Mov), R(closure), R(4),
B(CallRuntime), U16(Runtime::kPushModuleContext), R(3), U8(3),
B(PushContext), R(3),
B(Mov), R(this), R(5),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(4), U8(2),
B(Star), R(1),
B(LdaTheHole),
B(StaModuleVariable), I8(1), U8(0),
/* 0 E> */ B(StackCheck),
B(Ldar), R(1),
/* 0 E> */ B(SuspendGenerator), R(1), R(0), U8(5), U8(0),
B(ResumeGenerator), R(1), R(3), R(0), U8(5),
B(Star), R(5),
/* 0 E> */ B(SuspendGenerator), R(1), R(0), U8(4), U8(0),
B(ResumeGenerator), R(1), R(0), U8(4),
B(Star), R(4),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(1), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(5),
B(Ldar), R(4),
/* 0 E> */ B(Throw),
B(Ldar), R(5),
B(Ldar), R(4),
/* 51 S> */ B(Return),
/* 19 S> */ B(LdaSmi), I8(42),
/* 19 E> */ B(StaModuleVariable), I8(1), U8(0),
......@@ -355,15 +325,15 @@ bytecodes: [
B(Star), R(0),
/* 41 S> */ B(LdaModuleVariable), I8(1), U8(0),
B(ToNumeric), U8(1),
B(Star), R(5),
B(Star), R(4),
B(Inc), U8(1),
/* 44 E> */ B(CallRuntime), U16(Runtime::kThrowConstAssignError), R(0), U8(0),
B(Mov), R(5), R(2),
B(Mov), R(4), R(2),
B(Ldar), R(2),
/* 51 S> */ B(Return),
]
constant pool: [
Smi [48],
Smi [42],
FIXED_ARRAY_TYPE,
Smi [10],
Smi [7],
......@@ -375,50 +345,45 @@ handlers: [
snippet: "
export default (function () {});
"
frame size: 6
frame size: 5
parameter count: 2
bytecode array length: 96
bytecode array length: 85
bytecodes: [
B(Ldar), R(0),
B(JumpIfUndefined), U8(18),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(0), U8(1),
B(PushContext), R(3),
B(RestoreGeneratorState), R(0),
B(Star), R(2),
B(SwitchOnSmiNoFeedback), U8(0), U8(1), I8(0),
B(Abort), U8(15),
B(LdaSmi), I8(-2),
B(Star), R(2),
B(PushContext), R(2),
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(LdaConstant), U8(1),
B(Star), R(5),
B(Mov), R(arg0), R(3),
B(Mov), R(closure), R(4),
B(CallRuntime), U16(Runtime::kPushModuleContext), R(3), U8(3),
B(PushContext), R(3),
B(Mov), R(this), R(5),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(4), U8(2),
B(Star), R(4),
B(Mov), R(arg0), R(2),
B(Mov), R(closure), R(3),
B(CallRuntime), U16(Runtime::kPushModuleContext), R(2), U8(3),
B(PushContext), R(2),
B(Mov), R(this), R(4),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(3), U8(2),
B(Star), R(0),
B(LdaTheHole),
B(StaModuleVariable), I8(1), U8(0),
/* 0 E> */ B(StackCheck),
B(Ldar), R(0),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(4), U8(0),
B(ResumeGenerator), R(0), R(2), R(0), U8(4),
B(Star), R(4),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(3), U8(0),
B(ResumeGenerator), R(0), R(0), U8(3),
B(Star), R(3),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(4),
B(Ldar), R(3),
/* 0 E> */ B(Throw),
B(Ldar), R(4),
B(Ldar), R(3),
/* 32 S> */ B(Return),
B(Mov), R(4), R(1),
B(Mov), R(3), R(1),
B(CreateClosure), U8(4), U8(0), U8(0),
B(StaModuleVariable), I8(1), U8(0),
B(Ldar), R(1),
/* 32 S> */ B(Return),
]
constant pool: [
Smi [48],
Smi [42],
FIXED_ARRAY_TYPE,
Smi [10],
Smi [7],
......@@ -431,59 +396,54 @@ handlers: [
snippet: "
export default (class {});
"
frame size: 8
frame size: 7
parameter count: 2
bytecode array length: 117
bytecode array length: 106
bytecodes: [
B(Ldar), R(0),
B(JumpIfUndefined), U8(18),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(0), U8(1),
B(PushContext), R(3),
B(RestoreGeneratorState), R(0),
B(Star), R(2),
B(SwitchOnSmiNoFeedback), U8(0), U8(1), I8(0),
B(Abort), U8(15),
B(LdaSmi), I8(-2),
B(Star), R(2),
B(PushContext), R(2),
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(LdaConstant), U8(1),
B(Star), R(5),
B(Mov), R(arg0), R(3),
B(Mov), R(closure), R(4),
B(CallRuntime), U16(Runtime::kPushModuleContext), R(3), U8(3),
B(PushContext), R(3),
B(Mov), R(this), R(5),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(4), U8(2),
B(Star), R(4),
B(Mov), R(arg0), R(2),
B(Mov), R(closure), R(3),
B(CallRuntime), U16(Runtime::kPushModuleContext), R(2), U8(3),
B(PushContext), R(2),
B(Mov), R(this), R(4),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(3), U8(2),
B(Star), R(0),
B(LdaTheHole),
B(StaModuleVariable), I8(1), U8(0),
/* 0 E> */ B(StackCheck),
B(Ldar), R(0),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(4), U8(0),
B(ResumeGenerator), R(0), R(2), R(0), U8(4),
B(Star), R(4),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(3), U8(0),
B(ResumeGenerator), R(0), R(0), U8(3),
B(Star), R(3),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(4),
B(Ldar), R(3),
/* 0 E> */ B(Throw),
B(Ldar), R(4),
B(Ldar), R(3),
/* 26 S> */ B(Return),
B(Mov), R(4), R(1),
B(Mov), R(3), R(1),
B(LdaTheHole),
B(Star), R(7),
B(Star), R(6),
B(CreateClosure), U8(5), U8(0), U8(0),
B(Star), R(4),
B(Star), R(3),
B(LdaConstant), U8(4),
B(Star), R(5),
B(Mov), R(4), R(6),
B(CallRuntime), U16(Runtime::kDefineClass), R(5), U8(3),
B(Star), R(5),
B(Ldar), R(6),
B(Star), R(4),
B(Mov), R(3), R(5),
B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(3),
B(Star), R(4),
B(Ldar), R(5),
B(StaModuleVariable), I8(1), U8(0),
B(Ldar), R(1),
/* 26 S> */ B(Return),
]
constant pool: [
Smi [48],
Smi [42],
FIXED_ARRAY_TYPE,
Smi [10],
Smi [7],
......@@ -497,45 +457,40 @@ handlers: [
snippet: "
export {foo as goo} from \"bar\"
"
frame size: 6
frame size: 5
parameter count: 2
bytecode array length: 83
bytecode array length: 72
bytecodes: [
B(Ldar), R(0),
B(JumpIfUndefined), U8(18),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(0), U8(1),
B(PushContext), R(3),
B(RestoreGeneratorState), R(0),
B(Star), R(2),
B(SwitchOnSmiNoFeedback), U8(0), U8(1), I8(0),
B(Abort), U8(15),
B(LdaSmi), I8(-2),
B(Star), R(2),
B(PushContext), R(2),
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(LdaConstant), U8(1),
B(Star), R(5),
B(Mov), R(arg0), R(3),
B(Mov), R(closure), R(4),
B(CallRuntime), U16(Runtime::kPushModuleContext), R(3), U8(3),
B(PushContext), R(3),
B(Mov), R(this), R(5),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(4), U8(2),
B(Star), R(4),
B(Mov), R(arg0), R(2),
B(Mov), R(closure), R(3),
B(CallRuntime), U16(Runtime::kPushModuleContext), R(2), U8(3),
B(PushContext), R(2),
B(Mov), R(this), R(4),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(3), U8(2),
B(Star), R(0),
/* 0 E> */ B(StackCheck),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(4), U8(0),
B(ResumeGenerator), R(0), R(2), R(0), U8(4),
B(Star), R(4),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(3), U8(0),
B(ResumeGenerator), R(0), R(0), U8(3),
B(Star), R(3),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(4),
B(Ldar), R(3),
/* 0 E> */ B(Throw),
B(Ldar), R(4),
B(Ldar), R(3),
/* 30 S> */ B(Return),
B(Mov), R(4), R(1),
B(Mov), R(3), R(1),
B(Ldar), R(1),
/* 30 S> */ B(Return),
]
constant pool: [
Smi [42],
Smi [36],
FIXED_ARRAY_TYPE,
Smi [10],
Smi [7],
......@@ -547,45 +502,40 @@ handlers: [
snippet: "
export * from \"bar\"
"
frame size: 6
frame size: 5
parameter count: 2
bytecode array length: 83
bytecode array length: 72
bytecodes: [
B(Ldar), R(0),
B(JumpIfUndefined), U8(18),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(0), U8(1),
B(PushContext), R(3),
B(RestoreGeneratorState), R(0),
B(Star), R(2),
B(SwitchOnSmiNoFeedback), U8(0), U8(1), I8(0),
B(Abort), U8(15),
B(LdaSmi), I8(-2),
B(Star), R(2),
B(PushContext), R(2),
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(LdaConstant), U8(1),
B(Star), R(5),
B(Mov), R(arg0), R(3),
B(Mov), R(closure), R(4),
B(CallRuntime), U16(Runtime::kPushModuleContext), R(3), U8(3),
B(PushContext), R(3),
B(Mov), R(this), R(5),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(4), U8(2),
B(Star), R(4),
B(Mov), R(arg0), R(2),
B(Mov), R(closure), R(3),
B(CallRuntime), U16(Runtime::kPushModuleContext), R(2), U8(3),
B(PushContext), R(2),
B(Mov), R(this), R(4),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(3), U8(2),
B(Star), R(0),
/* 0 E> */ B(StackCheck),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(4), U8(0),
B(ResumeGenerator), R(0), R(2), R(0), U8(4),
B(Star), R(4),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(3), U8(0),
B(ResumeGenerator), R(0), R(0), U8(3),
B(Star), R(3),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(4),
B(Ldar), R(3),
/* 0 E> */ B(Throw),
B(Ldar), R(4),
B(Ldar), R(3),
/* 19 S> */ B(Return),
B(Mov), R(4), R(1),
B(Mov), R(3), R(1),
B(Ldar), R(1),
/* 19 S> */ B(Return),
]
constant pool: [
Smi [42],
Smi [36],
FIXED_ARRAY_TYPE,
Smi [10],
Smi [7],
......@@ -598,54 +548,49 @@ snippet: "
import * as foo from \"bar\"
foo.f(foo, foo.x);
"
frame size: 9
frame size: 8
parameter count: 2
bytecode array length: 110
bytecode array length: 99
bytecodes: [
B(Ldar), R(0),
B(JumpIfUndefined), U8(18),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(0), U8(1),
B(PushContext), R(4),
B(RestoreGeneratorState), R(0),
B(Star), R(3),
B(SwitchOnSmiNoFeedback), U8(0), U8(1), I8(0),
B(Abort), U8(15),
B(LdaSmi), I8(-2),
B(Star), R(3),
B(PushContext), R(3),
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(LdaConstant), U8(1),
B(Star), R(6),
B(Mov), R(arg0), R(4),
B(Mov), R(closure), R(5),
B(CallRuntime), U16(Runtime::kPushModuleContext), R(4), U8(3),
B(PushContext), R(4),
B(Mov), R(this), R(6),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(5), U8(2),
B(Star), R(5),
B(Mov), R(arg0), R(3),
B(Mov), R(closure), R(4),
B(CallRuntime), U16(Runtime::kPushModuleContext), R(3), U8(3),
B(PushContext), R(3),
B(Mov), R(this), R(5),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(4), U8(2),
B(Star), R(0),
B(LdaZero),
B(Star), R(5),
B(CallRuntime), U16(Runtime::kGetModuleNamespace), R(5), U8(1),
B(Star), R(4),
B(CallRuntime), U16(Runtime::kGetModuleNamespace), R(4), U8(1),
B(Star), R(1),
/* 0 E> */ B(StackCheck),
B(Ldar), R(0),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(5), U8(0),
B(ResumeGenerator), R(0), R(3), R(0), U8(5),
B(Star), R(5),
/* 0 E> */ B(SuspendGenerator), R(0), R(0), U8(4), U8(0),
B(ResumeGenerator), R(0), R(0), U8(4),
B(Star), R(4),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(5),
B(Ldar), R(4),
/* 0 E> */ B(Throw),
B(Ldar), R(5),
B(Ldar), R(4),
/* 45 S> */ B(Return),
/* 31 S> */ B(LdaNamedProperty), R(1), U8(4), U8(0),
B(Star), R(5),
B(Star), R(4),
/* 42 E> */ B(LdaNamedProperty), R(1), U8(5), U8(2),
B(Star), R(8),
/* 31 E> */ B(CallProperty2), R(5), R(1), R(1), R(8), U8(4),
B(Star), R(7),
/* 31 E> */ B(CallProperty2), R(4), R(1), R(1), R(7), U8(4),
B(Star), R(2),
/* 45 S> */ B(Return),
]
constant pool: [
Smi [54],
Smi [48],
FIXED_ARRAY_TYPE,
Smi [10],
Smi [7],
......
......@@ -270,33 +270,28 @@ snippet: "
}
f();
"
frame size: 6
frame size: 5
parameter count: 1
bytecode array length: 88
bytecode array length: 77
bytecodes: [
B(Ldar), R(2),
B(JumpIfUndefined), U8(18),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(2), U8(1),
B(PushContext), R(4),
B(RestoreGeneratorState), R(2),
B(Star), R(3),
B(SwitchOnSmiNoFeedback), U8(0), U8(1), I8(0),
B(Abort), U8(15),
B(LdaSmi), I8(-2),
B(Star), R(3),
B(Mov), R(closure), R(4),
B(Mov), R(this), R(5),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(4), U8(2),
B(PushContext), R(3),
B(SwitchOnGeneratorState), R(2), U8(0), U8(1),
B(Mov), R(closure), R(3),
B(Mov), R(this), R(4),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(3), U8(2),
B(Star), R(2),
/* 11 E> */ B(StackCheck),
/* 11 E> */ B(SuspendGenerator), R(2), R(0), U8(4), U8(0),
B(ResumeGenerator), R(2), R(3), R(0), U8(4),
B(Star), R(4),
/* 11 E> */ B(SuspendGenerator), R(2), R(0), U8(3), U8(0),
B(ResumeGenerator), R(2), R(0), U8(3),
B(Star), R(3),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(2), U8(1),
B(SwitchOnSmiNoFeedback), U8(1), U8(2), I8(0),
B(Ldar), R(4),
B(Ldar), R(3),
/* 11 E> */ B(Throw),
B(Ldar), R(4),
B(Ldar), R(3),
/* 62 S> */ B(Return),
/* 31 S> */ B(LdaZero),
B(Star), R(1),
......@@ -313,7 +308,7 @@ bytecodes: [
/* 62 S> */ B(Return),
]
constant pool: [
Smi [28],
Smi [22],
Smi [10],
Smi [7],
]
......@@ -327,72 +322,60 @@ snippet: "
}
f();
"
frame size: 5
frame size: 4
parameter count: 1
bytecode array length: 135
bytecode array length: 109
bytecodes: [
B(Ldar), R(1),
B(JumpIfUndefined), U8(18),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(1), U8(1),
B(PushContext), R(3),
B(RestoreGeneratorState), R(1),
B(Star), R(2),
B(SwitchOnSmiNoFeedback), U8(0), U8(2), I8(0),
B(Abort), U8(15),
B(LdaSmi), I8(-2),
B(Star), R(2),
B(Mov), R(closure), R(3),
B(Mov), R(this), R(4),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(3), U8(2),
B(PushContext), R(2),
B(SwitchOnGeneratorState), R(1), U8(0), U8(2),
B(Mov), R(closure), R(2),
B(Mov), R(this), R(3),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(2), U8(2),
B(Star), R(1),
/* 11 E> */ B(StackCheck),
/* 11 E> */ B(SuspendGenerator), R(1), R(0), U8(3), U8(0),
B(ResumeGenerator), R(1), R(2), R(0), U8(3),
B(Star), R(3),
/* 11 E> */ B(SuspendGenerator), R(1), R(0), U8(2), U8(0),
B(ResumeGenerator), R(1), R(0), U8(2),
B(Star), R(2),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(1), U8(1),
B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
B(Ldar), R(3),
B(Ldar), R(2),
/* 11 E> */ B(Throw),
B(Ldar), R(3),
B(Ldar), R(2),
/* 56 S> */ B(Return),
/* 31 S> */ B(LdaZero),
B(Star), R(0),
B(Ldar), R(2),
B(SwitchOnSmiNoFeedback), U8(4), U8(1), I8(1),
B(LdaSmi), I8(-2),
/* 31 E> */ B(TestEqualStrictNoFeedback), R(2),
B(JumpIfTrue), U8(4),
B(Abort), U8(15),
/* 36 S> */ B(LdaSmi), I8(10),
/* 36 E> */ B(TestLessThan), R(0), U8(0),
B(JumpIfFalse), U8(48),
B(JumpIfFalse), U8(47),
/* 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),
/* 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(Mov), R(0), R(2),
B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(2), U8(2),
/* 47 E> */ B(SuspendGenerator), R(1), R(0), U8(2), U8(1),
B(ResumeGenerator), R(1), R(0), U8(2),
B(Star), R(2),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(1), U8(1),
B(SwitchOnSmiNoFeedback), U8(5), U8(2), I8(0),
B(Ldar), R(3),
B(SwitchOnSmiNoFeedback), U8(4), U8(2), I8(0),
B(Ldar), R(2),
/* 47 E> */ B(Throw),
B(Ldar), R(3),
B(Ldar), R(2),
/* 56 S> */ B(Return),
/* 44 S> */ B(Ldar), R(0),
B(Inc), U8(1),
B(Star), R(0),
B(JumpLoop), U8(64), I8(0),
B(JumpLoop), U8(49), I8(0),
B(LdaUndefined),
/* 56 S> */ B(Return),
]
constant pool: [
Smi [28],
Smi [52],
Smi [22],
Smi [68],
Smi [10],
Smi [7],
Smi [35],
Smi [10],
Smi [7],
]
......@@ -495,120 +478,108 @@ snippet: "
}
f();
"
frame size: 12
frame size: 11
parameter count: 1
bytecode array length: 223
bytecode array length: 198
bytecodes: [
B(Ldar), R(1),
B(JumpIfUndefined), U8(18),
B(JumpIfUndefined), U8(12),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetContext), R(1), U8(1),
B(PushContext), R(4),
B(RestoreGeneratorState), R(1),
B(Star), R(3),
B(SwitchOnSmiNoFeedback), U8(0), U8(1), I8(0),
B(Abort), U8(15),
B(LdaSmi), I8(-2),
B(Star), R(3),
B(Mov), R(closure), R(4),
B(Mov), R(this), R(5),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(4), U8(2),
B(PushContext), R(3),
B(SwitchOnGeneratorState), R(1), U8(0), U8(1),
B(Mov), R(closure), R(3),
B(Mov), R(this), R(4),
B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(3), U8(2),
B(Star), R(1),
/* 16 E> */ B(StackCheck),
B(CallJSRuntime), U8(%async_function_promise_create), R(0), U8(0),
B(Star), R(2),
B(Mov), R(context), R(5),
B(Mov), R(context), R(6),
B(Mov), R(context), R(7),
/* 36 S> */ B(LdaZero),
B(Star), R(0),
B(Ldar), R(3),
B(SwitchOnSmiNoFeedback), U8(1), U8(1), I8(0),
B(LdaSmi), I8(-2),
/* 36 E> */ B(TestEqualStrictNoFeedback), R(3),
B(JumpIfTrue), U8(4),
B(Abort), U8(15),
/* 41 S> */ B(LdaSmi), I8(10),
/* 41 E> */ B(TestLessThan), R(0), U8(0),
B(JumpIfFalse), U8(51),
B(JumpIfFalse), U8(50),
/* 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),
/* 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),
/* 52 S> */ B(Mov), R(1), R(7),
B(Mov), R(0), R(8),
B(Mov), R(2), R(9),
B(CallJSRuntime), U8(%async_function_await_uncaught), R(7), U8(3),
/* 52 E> */ B(SuspendGenerator), R(1), R(0), U8(7), U8(0),
B(ResumeGenerator), R(1), R(0), U8(7),
B(Star), R(7),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(1), U8(1),
B(Star), R(9),
B(Star), R(8),
B(LdaZero),
B(TestEqualStrictNoFeedback), R(9),
B(TestEqualStrictNoFeedback), R(8),
B(JumpIfTrue), U8(5),
B(Ldar), R(8),
B(Ldar), R(7),
B(ReThrow),
/* 49 S> */ B(Ldar), R(0),
B(Inc), U8(1),
B(Star), R(0),
B(JumpLoop), U8(67), I8(0),
B(JumpLoop), U8(52), I8(0),
B(LdaUndefined),
B(Star), R(9),
B(Mov), R(2), R(8),
/* 49 E> */ B(CallJSRuntime), U8(%promise_resolve), R(8), U8(2),
B(Star), R(8),
B(Mov), R(2), R(7),
/* 49 E> */ B(CallJSRuntime), U8(%promise_resolve), R(7), U8(2),
B(LdaZero),
B(Star), R(4),
B(Mov), R(2), R(5),
B(Star), R(3),
B(Mov), R(2), R(4),
B(Jump), U8(58),
B(Jump), U8(42),
B(Star), R(8),
B(Ldar), R(closure),
B(CreateCatchContext), R(8), U8(2), U8(3),
B(Star), R(7),
B(Ldar), R(closure),
B(CreateCatchContext), R(7), U8(1), U8(2),
B(Star), R(6),
B(LdaTheHole),
B(SetPendingMessage),
B(Ldar), R(7),
B(PushContext), R(8),
B(Ldar), R(6),
B(PushContext), R(7),
B(LdaImmutableCurrentContextSlot), U8(4),
B(Star), R(10),
B(Star), R(9),
B(LdaFalse),
B(Star), R(11),
B(Mov), R(2), R(9),
B(CallJSRuntime), U8(%promise_internal_reject), R(9), U8(3),
B(PopContext), R(8),
B(Star), R(10),
B(Mov), R(2), R(8),
B(CallJSRuntime), U8(%promise_internal_reject), R(8), U8(3),
B(PopContext), R(7),
B(LdaZero),
B(Star), R(4),
B(Mov), R(2), R(5),
B(Star), R(3),
B(Mov), R(2), R(4),
B(Jump), U8(16),
B(LdaSmi), I8(-1),
B(Star), R(5),
B(Star), R(4),
B(Star), R(3),
B(Jump), U8(8),
B(Star), R(5),
B(LdaSmi), I8(1),
B(Star), R(4),
B(LdaSmi), I8(1),
B(Star), R(3),
B(LdaTheHole),
B(SetPendingMessage),
B(Star), R(6),
B(Star), R(5),
B(CallJSRuntime), U8(%async_function_promise_release), R(2), U8(1),
B(Ldar), R(6),
B(Ldar), R(5),
B(SetPendingMessage),
B(Ldar), R(4),
B(SwitchOnSmiNoFeedback), U8(4), U8(2), I8(0),
B(Ldar), R(3),
B(SwitchOnSmiNoFeedback), U8(3), U8(2), I8(0),
B(Jump), U8(8),
B(Ldar), R(5),
B(Ldar), R(4),
/* 61 S> */ B(Return),
B(Ldar), R(5),
B(Ldar), R(4),
B(ReThrow),
B(LdaUndefined),
/* 61 S> */ B(Return),
]
constant pool: [
Smi [38],
Smi [38],
Smi [58],
ONE_BYTE_INTERNALIZED_STRING_TYPE [".catch"],
FIXED_ARRAY_TYPE,
Smi [6],
Smi [9],
]
handlers: [
[46, 182, 190],
[49, 140, 142],
[36, 157, 165],
[39, 115, 117],
]
......@@ -391,9 +391,10 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) {
builder.JumpIfTrue(ToBooleanMode::kAlreadyBoolean, &after_suspend)
.SuspendGenerator(reg, reg_list, 0)
.Bind(&after_suspend)
.RestoreGeneratorState(reg)
.ResumeGenerator(reg, reg, reg_list);
.ResumeGenerator(reg, reg_list);
}
BytecodeJumpTable* gen_jump_table = builder.AllocateJumpTable(1, 0);
builder.SwitchOnGeneratorState(reg, gen_jump_table).Bind(gen_jump_table, 0);
// Intrinsics handled by the interpreter.
builder.CallRuntime(Runtime::kInlineIsArray, reg_list);
......@@ -445,6 +446,7 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) {
operand_scale = Bytecodes::PrefixBytecodeToOperandScale(final_bytecode);
prefix_offset = 1;
code = the_array->get(i + 1);
scorecard[code] += 1;
final_bytecode = Bytecodes::FromByte(code);
}
i += prefix_offset + Bytecodes::Size(final_bytecode, operand_scale);
......@@ -464,7 +466,7 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) {
#define CHECK_BYTECODE_PRESENT(Name, ...) \
/* Check Bytecode is marked in scorecard, unless it's a debug break */ \
if (!Bytecodes::IsDebugBreak(Bytecode::k##Name)) { \
CHECK_GE(scorecard[Bytecodes::ToByte(Bytecode::k##Name)], 1); \
EXPECT_GE(scorecard[Bytecodes::ToByte(Bytecode::k##Name)], 1); \
}
BYTECODE_LIST(CHECK_BYTECODE_PRESENT)
#undef CHECK_BYTECODE_PRESENT
......
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