[interpreter] Make IterationBody StackChecks implicit within JumpLoop

Since now the IterationBody StackChecks are implicit within JumpLoops,
we are able to eagerly deopt in them. If we do that, whenever we advance
to the next bytecode we don't have to advance to the next literal
bytecode, but instead "advance" in the sense of doing the JumpLoop.

Adding tests that test this advancing for wide and extra wide JumpLoops.

Also, marking JumpLoop as needing source positions since now it has
the ability of causing an interrupt.

Bug: v8:10149, v8:9960
Fixes: v8:10149
Change-Id: Ib0d9efdfb379e0dfbba7a7f67cba9262668813b0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2064226
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66809}
This commit is contained in:
Santiago Aboy Solanes 2020-03-20 11:13:04 +00:00 committed by Commit Bot
parent 2a1a7bf2c5
commit a447a44f31
40 changed files with 519 additions and 398 deletions

View File

@ -933,18 +933,27 @@ static void MaybeOptimizeCode(MacroAssembler* masm, Register feedback_vector,
// Advance the current bytecode offset. This simulates what all bytecode
// handlers do upon completion of the underlying operation. Will bail out to a
// label if the bytecode (without prefix) is a return bytecode.
// label if the bytecode (without prefix) is a return bytecode. Will not advance
// the bytecode offset if the current bytecode is a JumpLoop, instead just
// re-executing the JumpLoop to jump to the correct bytecode.
static void AdvanceBytecodeOffsetOrReturn(MacroAssembler* masm,
Register bytecode_array,
Register bytecode_offset,
Register bytecode, Register scratch1,
Label* if_return) {
Register scratch2, Label* if_return) {
Register bytecode_size_table = scratch1;
// The bytecode offset value will be increased by one in wide and extra wide
// cases. In the case of having a wide or extra wide JumpLoop bytecode, we
// will restore the original bytecode. In order to simplify the code, we have
// a backup of it.
Register original_bytecode_offset = scratch2;
DCHECK(!AreAliased(bytecode_array, bytecode_offset, bytecode_size_table,
bytecode));
bytecode, original_bytecode_offset));
__ Move(bytecode_size_table,
ExternalReference::bytecode_size_table_address());
__ Move(original_bytecode_offset, bytecode_offset);
// Check if the bytecode is a Wide or ExtraWide prefix bytecode.
Label process_bytecode;
@ -971,7 +980,7 @@ static void AdvanceBytecodeOffsetOrReturn(MacroAssembler* masm,
__ bind(&process_bytecode);
// Bailout to the return label if this is a return bytecode.
// Bailout to the return label if this is a return bytecode.
// Create cmp, cmpne, ..., cmpne to check for a return bytecode.
Condition flag = al;
@ -984,9 +993,22 @@ static void AdvanceBytecodeOffsetOrReturn(MacroAssembler* masm,
__ b(if_return, eq);
// If this is a JumpLoop, re-execute it to perform the jump to the beginning
// of the loop.
Label end, not_jump_loop;
__ cmp(bytecode, Operand(static_cast<int>(interpreter::Bytecode::kJumpLoop)));
__ b(ne, &not_jump_loop);
// We need to restore the original bytecode_offset since we might have
// increased it to skip the wide / extra-wide prefix bytecode.
__ Move(bytecode_offset, original_bytecode_offset);
__ b(&end);
__ bind(&not_jump_loop);
// Otherwise, load the size of the current bytecode and advance the offset.
__ ldr(scratch1, MemOperand(bytecode_size_table, bytecode, LSL, 2));
__ add(bytecode_offset, bytecode_offset, scratch1);
__ bind(&end);
}
// Generate code for entering a JS function with the interpreter.
@ -1158,7 +1180,7 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
__ ldrb(r1, MemOperand(kInterpreterBytecodeArrayRegister,
kInterpreterBytecodeOffsetRegister));
AdvanceBytecodeOffsetOrReturn(masm, kInterpreterBytecodeArrayRegister,
kInterpreterBytecodeOffsetRegister, r1, r2,
kInterpreterBytecodeOffsetRegister, r1, r2, r3,
&do_return);
__ jmp(&do_dispatch);
@ -1434,7 +1456,7 @@ void Builtins::Generate_InterpreterEnterBytecodeAdvance(MacroAssembler* masm) {
// Advance to the next bytecode.
Label if_return;
AdvanceBytecodeOffsetOrReturn(masm, kInterpreterBytecodeArrayRegister,
kInterpreterBytecodeOffsetRegister, r1, r2,
kInterpreterBytecodeOffsetRegister, r1, r2, r3,
&if_return);
__ bind(&enter_bytecode);

View File

@ -1058,17 +1058,26 @@ static void MaybeOptimizeCode(MacroAssembler* masm, Register feedback_vector,
// Advance the current bytecode offset. This simulates what all bytecode
// handlers do upon completion of the underlying operation. Will bail out to a
// label if the bytecode (without prefix) is a return bytecode.
// label if the bytecode (without prefix) is a return bytecode. Will not advance
// the bytecode offset if the current bytecode is a JumpLoop, instead just
// re-executing the JumpLoop to jump to the correct bytecode.
static void AdvanceBytecodeOffsetOrReturn(MacroAssembler* masm,
Register bytecode_array,
Register bytecode_offset,
Register bytecode, Register scratch1,
Label* if_return) {
Register scratch2, Label* if_return) {
Register bytecode_size_table = scratch1;
// The bytecode offset value will be increased by one in wide and extra wide
// cases. In the case of having a wide or extra wide JumpLoop bytecode, we
// will restore the original bytecode. In order to simplify the code, we have
// a backup of it.
Register original_bytecode_offset = scratch2;
DCHECK(!AreAliased(bytecode_array, bytecode_offset, bytecode_size_table,
bytecode));
bytecode, original_bytecode_offset));
__ Mov(bytecode_size_table, ExternalReference::bytecode_size_table_address());
__ Mov(original_bytecode_offset, bytecode_offset);
// Check if the bytecode is a Wide or ExtraWide prefix bytecode.
Label process_bytecode, extra_wide;
@ -1105,9 +1114,22 @@ static void AdvanceBytecodeOffsetOrReturn(MacroAssembler* masm,
RETURN_BYTECODE_LIST(JUMP_IF_EQUAL)
#undef JUMP_IF_EQUAL
// If this is a JumpLoop, re-execute it to perform the jump to the beginning
// of the loop.
Label end, not_jump_loop;
__ Cmp(bytecode, Operand(static_cast<int>(interpreter::Bytecode::kJumpLoop)));
__ B(ne, &not_jump_loop);
// We need to restore the original bytecode_offset since we might have
// increased it to skip the wide / extra-wide prefix bytecode.
__ Mov(bytecode_offset, original_bytecode_offset);
__ B(&end);
__ bind(&not_jump_loop);
// Otherwise, load the size of the current bytecode and advance the offset.
__ Ldr(scratch1.W(), MemOperand(bytecode_size_table, bytecode, LSL, 2));
__ Add(bytecode_offset, bytecode_offset, scratch1);
__ Bind(&end);
}
// Generate code for entering a JS function with the interpreter.
@ -1291,7 +1313,7 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
__ Ldrb(x1, MemOperand(kInterpreterBytecodeArrayRegister,
kInterpreterBytecodeOffsetRegister));
AdvanceBytecodeOffsetOrReturn(masm, kInterpreterBytecodeArrayRegister,
kInterpreterBytecodeOffsetRegister, x1, x2,
kInterpreterBytecodeOffsetRegister, x1, x2, x3,
&do_return);
__ B(&do_dispatch);
@ -1594,7 +1616,7 @@ void Builtins::Generate_InterpreterEnterBytecodeAdvance(MacroAssembler* masm) {
// Advance to the next bytecode.
Label if_return;
AdvanceBytecodeOffsetOrReturn(masm, kInterpreterBytecodeArrayRegister,
kInterpreterBytecodeOffsetRegister, x1, x2,
kInterpreterBytecodeOffsetRegister, x1, x2, x3,
&if_return);
__ bind(&enter_bytecode);

View File

@ -875,22 +875,30 @@ static void MaybeOptimizeCode(MacroAssembler* masm,
// Advance the current bytecode offset. This simulates what all bytecode
// handlers do upon completion of the underlying operation. Will bail out to a
// label if the bytecode (without prefix) is a return bytecode.
// label if the bytecode (without prefix) is a return bytecode. Will not advance
// the bytecode offset if the current bytecode is a JumpLoop, instead just
// re-executing the JumpLoop to jump to the correct bytecode.
static void AdvanceBytecodeOffsetOrReturn(MacroAssembler* masm,
Register bytecode_array,
Register bytecode_offset,
Register scratch1, Register scratch2,
Label* if_return) {
Register scratch3, Label* if_return) {
Register bytecode_size_table = scratch1;
Register bytecode = scratch2;
// The bytecode offset value will be increased by one in wide and extra wide
// cases. In the case of having a wide or extra wide JumpLoop bytecode, we
// will restore the original bytecode. In order to simplify the code, we have
// a backup of it.
Register original_bytecode_offset = scratch3;
DCHECK(!AreAliased(bytecode_array, bytecode_offset, bytecode_size_table,
bytecode));
bytecode, original_bytecode_offset));
__ Move(bytecode_size_table,
Immediate(ExternalReference::bytecode_size_table_address()));
// Load the current bytecode.
__ movzx_b(bytecode, Operand(kInterpreterBytecodeArrayRegister,
kInterpreterBytecodeOffsetRegister, times_1, 0));
__ movzx_b(bytecode, Operand(bytecode_array, bytecode_offset, times_1, 0));
__ Move(original_bytecode_offset, bytecode_offset);
// Check if the bytecode is a Wide or ExtraWide prefix bytecode.
Label process_bytecode, extra_wide;
@ -929,9 +937,24 @@ static void AdvanceBytecodeOffsetOrReturn(MacroAssembler* masm,
RETURN_BYTECODE_LIST(JUMP_IF_EQUAL)
#undef JUMP_IF_EQUAL
// If this is a JumpLoop, re-execute it to perform the jump to the beginning
// of the loop.
Label end, not_jump_loop;
__ cmp(bytecode,
Immediate(static_cast<int>(interpreter::Bytecode::kJumpLoop)));
__ j(not_equal, &not_jump_loop, Label::kNear);
// If this is a wide or extra wide JumpLoop, we need to restore the original
// bytecode_offset since we might have increased it to skip the wide /
// extra-wide prefix bytecode.
__ Move(bytecode_offset, original_bytecode_offset);
__ jmp(&end, Label::kNear);
__ bind(&not_jump_loop);
// Otherwise, load the size of the current bytecode and advance the offset.
__ add(bytecode_offset,
Operand(bytecode_size_table, bytecode, times_int_size, 0));
__ bind(&end);
}
// Generate code for entering a JS function with the interpreter.
@ -1079,7 +1102,7 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
// TODO(solanes): Merge with the real stack limit check above.
Label stack_check_interrupt, after_stack_check_interrupt;
CompareStackLimit(masm, esp, StackLimitKind::kInterruptStackLimit);
__ j(below, &stack_check_interrupt, Label::kNear);
__ j(below, &stack_check_interrupt);
__ bind(&after_stack_check_interrupt);
// The accumulator is already loaded with undefined.
@ -1114,12 +1137,16 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
// Either return, or advance to the next bytecode and dispatch.
Label do_return;
__ Push(eax);
AdvanceBytecodeOffsetOrReturn(masm, kInterpreterBytecodeArrayRegister,
kInterpreterBytecodeOffsetRegister, ecx,
kInterpreterDispatchTableRegister, &do_return);
kInterpreterDispatchTableRegister, eax,
&do_return);
__ Pop(eax);
__ jmp(&do_dispatch);
__ bind(&do_return);
__ Pop(eax);
// The return value is in eax.
LeaveInterpreterFrame(masm, edx, ecx);
__ ret(0);
@ -1493,9 +1520,11 @@ void Builtins::Generate_InterpreterEnterBytecodeAdvance(MacroAssembler* masm) {
// Advance to the next bytecode.
Label if_return;
__ Push(eax);
AdvanceBytecodeOffsetOrReturn(masm, kInterpreterBytecodeArrayRegister,
kInterpreterBytecodeOffsetRegister, ecx, esi,
&if_return);
eax, &if_return);
__ Pop(eax);
__ bind(&enter_bytecode);
// Convert new bytecode offset to a Smi and save in the stackframe.
@ -1516,6 +1545,7 @@ void Builtins::Generate_InterpreterEnterBytecodeAdvance(MacroAssembler* masm) {
// We should never take the if_return path.
__ bind(&if_return);
// No need to pop eax here since we will be aborting anyway.
__ Abort(AbortReason::kInvalidBytecodeAdvance);
}

View File

@ -1004,15 +1004,25 @@ static void TailCallOptimizedCodeSlot(MacroAssembler* masm,
// Advance the current bytecode offset. This simulates what all bytecode
// handlers do upon completion of the underlying operation. Will bail out to a
// label if the bytecode (without prefix) is a return bytecode.
// label if the bytecode (without prefix) is a return bytecode. Will not advance
// the bytecode offset if the current bytecode is a JumpLoop, instead just
// re-executing the JumpLoop to jump to the correct bytecode.
static void AdvanceBytecodeOffsetOrReturn(MacroAssembler* masm,
Register bytecode_array,
Register bytecode_offset,
Register bytecode, Register scratch1,
Label* if_return) {
Register scratch2, Label* if_return) {
Register bytecode_size_table = scratch1;
DCHECK(!AreAliased(bytecode_array, bytecode_offset, bytecode_size_table,
bytecode));
// The bytecode offset value will be increased by one in wide and extra wide
// cases. In the case of having a wide or extra wide JumpLoop bytecode, we
// will restore the original bytecode. In order to simplify the code, we have
// a backup of it.
Register original_bytecode_offset = scratch2;
DCHECK(!AreAliased(bytecode_array, bytecode_offset, bytecode,
bytecode_size_table, original_bytecode_offset));
__ movq(original_bytecode_offset, bytecode_offset);
__ Move(bytecode_size_table,
ExternalReference::bytecode_size_table_address());
@ -1054,9 +1064,23 @@ static void AdvanceBytecodeOffsetOrReturn(MacroAssembler* masm,
RETURN_BYTECODE_LIST(JUMP_IF_EQUAL)
#undef JUMP_IF_EQUAL
// If this is a JumpLoop, re-execute it to perform the jump to the beginning
// of the loop.
Label end, not_jump_loop;
__ cmpb(bytecode,
Immediate(static_cast<int>(interpreter::Bytecode::kJumpLoop)));
__ j(not_equal, &not_jump_loop, Label::kNear);
// We need to restore the original bytecode_offset since we might have
// increased it to skip the wide / extra-wide prefix bytecode.
__ movq(bytecode_offset, original_bytecode_offset);
__ jmp(&end, Label::kNear);
__ bind(&not_jump_loop);
// Otherwise, load the size of the current bytecode and advance the offset.
__ addl(bytecode_offset,
Operand(bytecode_size_table, bytecode, times_int_size, 0));
__ bind(&end);
}
// Generate code for entering a JS function with the interpreter.
@ -1201,7 +1225,7 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
// TODO(solanes): Merge with the real stack limit check above.
Label stack_check_interrupt, after_stack_check_interrupt;
__ cmpq(rsp, StackLimitAsOperand(masm, StackLimitKind::kInterruptStackLimit));
__ j(below, &stack_check_interrupt, Label::kNear);
__ j(below, &stack_check_interrupt);
__ bind(&after_stack_check_interrupt);
// The accumulator is already loaded with undefined.
@ -1236,7 +1260,7 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
kInterpreterBytecodeOffsetRegister, times_1, 0));
AdvanceBytecodeOffsetOrReturn(masm, kInterpreterBytecodeArrayRegister,
kInterpreterBytecodeOffsetRegister, rbx, rcx,
&do_return);
r11, &do_return);
__ jmp(&do_dispatch);
__ bind(&do_return);
@ -1575,7 +1599,7 @@ void Builtins::Generate_InterpreterEnterBytecodeAdvance(MacroAssembler* masm) {
Label if_return;
AdvanceBytecodeOffsetOrReturn(masm, kInterpreterBytecodeArrayRegister,
kInterpreterBytecodeOffsetRegister, rbx, rcx,
&if_return);
r11, &if_return);
__ bind(&enter_bytecode);
// Convert new bytecode offset to a Smi and save in the stackframe.

View File

@ -328,9 +328,7 @@ void BytecodeAnalysis::Analyze() {
if (bytecode == Bytecode::kSwitchOnGeneratorState) {
DCHECK_EQ(generator_switch_index, -1);
generator_switch_index = iterator.current_index();
}
if (bytecode == Bytecode::kJumpLoop) {
} else 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.
int loop_end = current_offset + iterator.current_bytecode_size();
@ -350,7 +348,16 @@ void BytecodeAnalysis::Analyze() {
if (analyze_liveness_) {
loop_end_index_queue_.push_back(iterator.current_index());
}
} else if (loop_stack_.size() > 1) {
}
// We have to pop from loop_stack_ if:
// 1) We entered the body of the loop
// 2) If we have a JumpLoop that jumps to itself (i.e an empty loop)
bool pop_current_loop = loop_stack_.size() > 1 &&
(bytecode != Bytecode::kJumpLoop ||
iterator.GetJumpTargetOffset() == current_offset);
if (pop_current_loop) {
LoopStackEntry& current_loop = loop_stack_.top();
LoopInfo* current_loop_info = current_loop.loop_info;
@ -553,10 +560,10 @@ void BytecodeAnalysis::Analyze() {
}
void BytecodeAnalysis::PushLoop(int loop_header, int loop_end) {
DCHECK(loop_header < loop_end);
DCHECK(loop_stack_.top().header_offset < loop_header);
DCHECK(end_to_header_.find(loop_end) == end_to_header_.end());
DCHECK(header_to_info_.find(loop_header) == header_to_info_.end());
DCHECK_LT(loop_header, loop_end);
DCHECK_LT(loop_stack_.top().header_offset, loop_header);
DCHECK_EQ(end_to_header_.find(loop_end), end_to_header_.end());
DCHECK_EQ(header_to_info_.find(loop_header), header_to_info_.end());
int parent_offset = loop_stack_.top().header_offset;

View File

@ -263,8 +263,10 @@ class BytecodeGraphBuilder {
// feedback. Returns kDisallowSpeculation if feedback is insufficient.
SpeculationMode GetSpeculationMode(int slot_id) const;
// Helper for building the implicit FunctionEntry StackCheck.
// Helpers for building the implicit FunctionEntry and IterationBody
// StackChecks.
void BuildFunctionEntryStackCheck();
void BuildIterationBodyStackCheck();
// Control flow plumbing.
void BuildJump();
@ -360,8 +362,6 @@ class BytecodeGraphBuilder {
currently_peeled_loop_offset_ = offset;
}
bool skip_first_stack_check() const { return skip_first_stack_check_; }
bool visited_first_stack_check() const { return visited_first_stack_check_; }
void set_visited_first_stack_check() { visited_first_stack_check_ = true; }
int current_exception_handler() const { return current_exception_handler_; }
void set_current_exception_handler(int index) {
current_exception_handler_ = index;
@ -400,7 +400,6 @@ class BytecodeGraphBuilder {
int currently_peeled_loop_offset_;
const bool skip_first_stack_check_;
bool visited_first_stack_check_ = false;
// Merge environments are snapshots of the environment at points where the
// control flow merges. This models a forward data flow propagation of all
@ -1224,8 +1223,6 @@ void BytecodeGraphBuilder::RemoveMergeEnvironmentsBeforeOffset(
}
void BytecodeGraphBuilder::BuildFunctionEntryStackCheck() {
DCHECK(!visited_first_stack_check());
set_visited_first_stack_check();
if (!skip_first_stack_check()) {
Node* node =
NewNode(javascript()->StackCheck(StackCheckKind::kJSFunctionEntry));
@ -1234,6 +1231,12 @@ void BytecodeGraphBuilder::BuildFunctionEntryStackCheck() {
}
}
void BytecodeGraphBuilder::BuildIterationBodyStackCheck() {
Node* node =
NewNode(javascript()->StackCheck(StackCheckKind::kJSIterationBody));
environment()->RecordAfterState(node, Environment::kAttachFrameState);
}
// We will iterate through the OSR loop, then its parent, and so on
// until we have reached the outmost loop containing the OSR loop. We do
// not generate nodes for anything before the outermost loop.
@ -3261,7 +3264,10 @@ void BytecodeGraphBuilder::VisitJumpIfUndefinedOrNullConstant() {
BuildJumpIfEqual(jsgraph()->NullConstant());
}
void BytecodeGraphBuilder::VisitJumpLoop() { BuildJump(); }
void BytecodeGraphBuilder::VisitJumpLoop() {
BuildIterationBodyStackCheck();
BuildJump();
}
void BytecodeGraphBuilder::BuildSwitchOnSmi(Node* condition) {
interpreter::JumpTableTargetOffsets offsets =
@ -3284,18 +3290,8 @@ void BytecodeGraphBuilder::VisitSwitchOnSmiNoFeedback() {
BuildSwitchOnSmi(acc_smi);
}
void BytecodeGraphBuilder::VisitStackCheck() {
// TODO(v8:9977): In OSR we don't generate a FunctionEntry. However, we visit
// the OSR bytecodes. These bytecodes will contain a JumpLoop which will have
// an IterationBody stack check. In Non-Osr we guarantee that we have visited
// the FunctionEntry StackCheck before visiting the IterationBody ones.
DCHECK(osr_ || visited_first_stack_check());
PrepareEagerCheckpoint();
Node* node =
NewNode(javascript()->StackCheck(StackCheckKind::kJSIterationBody));
environment()->RecordAfterState(node, Environment::kAttachFrameState);
}
// TODO(solanes): Remove this and all mentions of StackCheck.
void BytecodeGraphBuilder::VisitStackCheck() { UNREACHABLE(); }
void BytecodeGraphBuilder::VisitSetPendingMessage() {
Node* previous_message = NewNode(javascript()->LoadMessage());

View File

@ -479,6 +479,7 @@ bool BytecodeHasNoSideEffect(interpreter::Bytecode bytecode) {
case Bytecode::kForInContinue:
case Bytecode::kForInNext:
case Bytecode::kForInStep:
case Bytecode::kJumpLoop:
case Bytecode::kThrow:
case Bytecode::kReThrow:
case Bytecode::kThrowReferenceErrorIfHole:

View File

@ -1256,7 +1256,19 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfJSReceiver(
}
BytecodeArrayBuilder& BytecodeArrayBuilder::JumpLoop(
BytecodeLoopHeader* loop_header, int loop_depth) {
BytecodeLoopHeader* loop_header, int loop_depth, int position) {
if (position != kNoSourcePosition) {
// We need to attach a non-breakable source position to JumpLoop for its
// implicit stack check, so we simply add it as expression position. There
// can be a prior statement position from constructs like:
//
// do var x; while (false);
//
// A Nop could be inserted for empty statements, but since no code
// is associated with these positions, instead we force the jump loop's
// expression position which eliminates the empty statement's position.
latest_source_info_.ForceExpressionPosition(position);
}
OutputJumpLoop(loop_header, loop_depth);
return *this;
}

View File

@ -427,7 +427,7 @@ class V8_EXPORT_PRIVATE BytecodeArrayBuilder final {
BytecodeArrayBuilder& Jump(BytecodeLabel* label);
BytecodeArrayBuilder& JumpLoop(BytecodeLoopHeader* loop_header,
int loop_depth);
int loop_depth, int position);
BytecodeArrayBuilder& JumpIfTrue(ToBooleanMode mode, BytecodeLabel* label);
BytecodeArrayBuilder& JumpIfFalse(ToBooleanMode mode, BytecodeLabel* label);

View File

@ -68,8 +68,7 @@ class V8_EXPORT_PRIVATE BytecodeRegisterOptimizer final
if (Bytecodes::IsJump(bytecode) || Bytecodes::IsSwitch(bytecode) ||
bytecode == Bytecode::kDebugger ||
bytecode == Bytecode::kSuspendGenerator ||
bytecode == Bytecode::kResumeGenerator ||
bytecode == Bytecode::kStackCheck) {
bytecode == Bytecode::kResumeGenerator) {
// All state must be flushed before emitting
// - a jump bytecode (as the register equivalents at the jump target
// aren't known)

View File

@ -644,10 +644,11 @@ class V8_EXPORT_PRIVATE Bytecodes final : public AllStatic {
}
// Return true if |bytecode| is a jump without effects,
// e.g. any jump excluding those that include type coercion like
// JumpIfTrueToBoolean.
// e.g. any jump excluding those that include type coercion like
// JumpIfTrueToBoolean, and JumpLoop due to having an implicit StackCheck.
static constexpr bool IsJumpWithoutEffects(Bytecode bytecode) {
return IsJump(bytecode) && !IsJumpIfToBoolean(bytecode);
return IsJump(bytecode) && !IsJumpIfToBoolean(bytecode) &&
bytecode != Bytecode::kJumpLoop;
}
// Returns true if the bytecode is a switch.

View File

@ -77,13 +77,12 @@ void LoopBuilder::JumpToHeader(int loop_depth, LoopBuilder* const parent_loop) {
// they are a nested inner loop too, a Jump to its parent's JumpToHeader.
parent_loop->JumpToLoopEnd();
} else {
builder()->StackCheck(source_position_);
// Pass the proper loop nesting level to the backwards branch, to trigger
// on-stack replacement when armed for the given loop nesting depth.
int level = Min(loop_depth, AbstractCode::kMaxLoopNestingMarker - 1);
// Loop must have closed form, i.e. all loop elements are within the loop,
// the loop header precedes the body and next elements in the loop.
builder()->JumpLoop(&loop_header_, level);
builder()->JumpLoop(&loop_header_, level, source_position_);
}
}

View File

@ -2367,12 +2367,15 @@ IGNITION_HANDLER(JumpIfJSReceiverConstant, InterpreterAssembler) {
// JumpLoop <imm> <loop_depth>
//
// Jump by the number of bytes represented by the immediate operand |imm|. Also
// performs a loop nesting check and potentially triggers OSR in case the
// current OSR level matches (or exceeds) the specified |loop_depth|.
// performs a loop nesting check, a stack check, and potentially triggers OSR in
// case the current OSR level matches (or exceeds) the specified |loop_depth|.
IGNITION_HANDLER(JumpLoop, InterpreterAssembler) {
TNode<IntPtrT> relative_jump = Signed(BytecodeOperandUImmWord(0));
TNode<Int32T> loop_depth = BytecodeOperandImm(1);
TNode<Int8T> osr_level = LoadOsrNestingLevel();
TNode<Context> context = GetContext();
PerformStackCheck(context);
// Check if OSR points at the given {loop_depth} are armed by comparing it to
// the current {osr_level} loaded from the header of the BytecodeArray.
@ -2387,7 +2390,6 @@ IGNITION_HANDLER(JumpLoop, InterpreterAssembler) {
{
Callable callable = CodeFactory::InterpreterOnStackReplacement(isolate());
TNode<Code> target = HeapConstant(callable.code());
TNode<Context> context = GetContext();
CallStub(callable.descriptor(), target, context);
JumpBackward(relative_jump);
}

View File

@ -138,7 +138,7 @@ snippet: "
"
frame size: 6
parameter count: 1
bytecode array length: 75
bytecode array length: 74
bytecodes: [
/* 42 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(37),
B(Star), R(0),
@ -157,14 +157,13 @@ bytecodes: [
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(5), U8(1),
B(LdaNamedProperty), R(5), U8(4), U8(17),
B(JumpIfToBooleanTrue), U8(20),
B(JumpIfToBooleanTrue), U8(19),
B(LdaNamedProperty), R(5), U8(5), U8(8),
B(StaInArrayLiteral), R(2), R(1), U8(13),
B(Ldar), R(1),
B(Inc), U8(12),
B(Star), R(1),
B(StackCheck),
B(JumpLoop), U8(34), I8(0),
B(JumpLoop), U8(33), I8(0),
B(Ldar), R(2),
/* 71 S> */ B(Return),
]

View File

@ -210,7 +210,7 @@ snippet: "
"
frame size: 19
parameter count: 1
bytecode array length: 362
bytecode array length: 361
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(2),
B(Mov), R(closure), R(4),
@ -249,7 +249,7 @@ bytecodes: [
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(14), U8(1),
B(LdaNamedProperty), R(14), U8(6), U8(9),
B(JumpIfToBooleanTrue), U8(67),
B(JumpIfToBooleanTrue), U8(66),
B(LdaNamedProperty), R(14), U8(7), U8(11),
B(Star), R(14),
B(LdaFalse),
@ -271,10 +271,9 @@ bytecodes: [
B(LdaSmi), I8(1),
B(Star), R(11),
B(Mov), R(15), R(12),
B(Jump), U8(21),
B(Jump), U8(20),
B(Ldar), R(15),
/* 22 E> */ B(StackCheck),
B(JumpLoop), U8(84), I8(0),
/* 22 E> */ B(JumpLoop), U8(83), I8(0),
B(LdaSmi), I8(-1),
B(Star), R(12),
B(Star), R(11),
@ -383,16 +382,16 @@ constant pool: [
Smi [6],
Smi [9],
SCOPE_INFO_TYPE,
Smi [268],
Smi [267],
Smi [6],
Smi [9],
Smi [23],
]
handlers: [
[19, 316, 316],
[22, 282, 282],
[86, 173, 181],
[205, 238, 240],
[19, 315, 315],
[22, 281, 281],
[86, 172, 180],
[204, 237, 239],
]
---
@ -403,7 +402,7 @@ snippet: "
"
frame size: 17
parameter count: 1
bytecode array length: 464
bytecode array length: 463
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(5),
B(Mov), R(closure), R(1),
@ -471,7 +470,7 @@ bytecodes: [
B(LdaSmi), I8(1),
B(Star), R(1),
B(Mov), R(10), R(2),
B(Jump), U8(239),
B(Jump), U8(238),
B(LdaNamedProperty), R(7), U8(14), U8(20),
B(JumpIfUndefinedOrNull), U8(11),
B(Star), R(12),
@ -518,7 +517,7 @@ bytecodes: [
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(5), U8(1),
B(LdaNamedProperty), R(5), U8(15), U8(28),
B(JumpIfToBooleanTrue), U8(39),
B(JumpIfToBooleanTrue), U8(38),
B(LdaNamedProperty), R(5), U8(16), U8(30),
B(Star), R(15),
B(LdaFalse),
@ -530,8 +529,7 @@ bytecodes: [
B(Star), R(8),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(Star), R(6),
B(StackCheck),
B(JumpLoop), U8(237), I8(0),
B(JumpLoop), U8(236), I8(0),
B(LdaNamedProperty), R(5), U8(16), U8(32),
B(Star), R(7),
B(LdaSmi), I8(1),
@ -606,13 +604,13 @@ constant pool: [
ONE_BYTE_INTERNALIZED_STRING_TYPE ["done"],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"],
SCOPE_INFO_TYPE,
Smi [370],
Smi [369],
Smi [6],
Smi [9],
Smi [23],
]
handlers: [
[19, 418, 418],
[22, 384, 384],
[19, 417, 417],
[22, 383, 383],
]

View File

@ -59,7 +59,7 @@ snippet: "
"
frame size: 2
parameter count: 1
bytecode array length: 53
bytecode array length: 52
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star), R(0),
@ -67,7 +67,7 @@ bytecodes: [
B(Star), R(1),
/* 65 S> */ B(LdaSmi), I8(10),
/* 65 E> */ B(TestLessThan), R(0), U8(0),
B(JumpIfFalse), U8(38),
B(JumpIfFalse), U8(37),
/* 75 S> */ B(Ldar), R(1),
/* 81 E> */ B(MulSmi), I8(12), U8(1),
B(Star), R(1),
@ -81,9 +81,8 @@ bytecodes: [
/* 126 S> */ B(LdaSmi), I8(4),
/* 132 E> */ B(TestEqual), R(0), U8(4),
B(JumpIfFalse), U8(4),
/* 138 S> */ B(Jump), U8(6),
/* 56 E> */ B(StackCheck),
B(JumpLoop), U8(40), I8(0),
/* 138 S> */ B(Jump), U8(5),
/* 56 E> */ B(JumpLoop), U8(39), I8(0),
/* 147 S> */ B(Ldar), R(1),
/* 156 S> */ B(Return),
]
@ -107,7 +106,7 @@ snippet: "
"
frame size: 1
parameter count: 1
bytecode array length: 61
bytecode array length: 60
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star), R(0),
@ -118,11 +117,11 @@ bytecodes: [
/* 85 S> */ B(LdaSmi), I8(3),
/* 91 E> */ B(TestEqual), R(0), U8(1),
B(JumpIfFalse), U8(4),
/* 97 S> */ B(Jump), U8(40),
/* 97 S> */ B(Jump), U8(39),
/* 106 S> */ B(LdaSmi), I8(4),
/* 112 E> */ B(TestEqual), R(0), U8(2),
B(JumpIfFalse), U8(4),
/* 118 S> */ B(Jump), U8(31),
/* 118 S> */ B(Jump), U8(30),
/* 127 S> */ B(LdaSmi), I8(10),
/* 133 E> */ B(TestEqual), R(0), U8(3),
B(JumpIfFalse), U8(4),
@ -130,12 +129,11 @@ bytecodes: [
/* 152 S> */ B(LdaSmi), I8(5),
/* 158 E> */ B(TestEqual), R(0), U8(4),
B(JumpIfFalse), U8(4),
/* 164 S> */ B(Jump), U8(13),
/* 164 S> */ B(Jump), U8(12),
/* 173 S> */ B(Ldar), R(0),
/* 179 E> */ B(AddSmi), I8(1), U8(5),
B(Star), R(0),
/* 45 E> */ B(StackCheck),
B(JumpLoop), U8(52), I8(0),
/* 45 E> */ B(JumpLoop), U8(51), I8(0),
/* 186 S> */ B(Ldar), R(0),
/* 195 S> */ B(Return),
]
@ -159,7 +157,7 @@ snippet: "
"
frame size: 1
parameter count: 1
bytecode array length: 44
bytecode array length: 43
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star), R(0),
@ -177,9 +175,8 @@ bytecodes: [
/* 122 S> */ B(Ldar), R(0),
/* 128 E> */ B(AddSmi), I8(1), U8(3),
B(Star), R(0),
/* 135 S> */ B(Jump), U8(6),
/* 45 E> */ B(StackCheck),
B(JumpLoop), U8(35), I8(0),
/* 135 S> */ B(Jump), U8(5),
/* 45 E> */ B(JumpLoop), U8(34), I8(0),
/* 144 S> */ B(Ldar), R(0),
/* 153 S> */ B(Return),
]
@ -200,22 +197,21 @@ snippet: "
"
frame size: 2
parameter count: 1
bytecode array length: 33
bytecode array length: 32
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(10),
B(Star), R(0),
/* 54 S> */ B(LdaSmi), I8(1),
B(Star), R(1),
/* 64 S> */ B(Ldar), R(0),
B(JumpIfToBooleanFalse), U8(20),
B(JumpIfToBooleanFalse), U8(19),
/* 71 S> */ B(Ldar), R(1),
/* 77 E> */ B(MulSmi), I8(12), U8(0),
B(Star), R(1),
/* 85 S> */ B(Ldar), R(0),
/* 91 E> */ B(SubSmi), I8(1), U8(1),
B(Star), R(0),
/* 57 E> */ B(StackCheck),
B(JumpLoop), U8(19), I8(0),
/* 57 E> */ B(JumpLoop), U8(18), I8(0),
/* 98 S> */ B(Ldar), R(1),
/* 107 S> */ B(Return),
]
@ -237,7 +233,7 @@ snippet: "
"
frame size: 2
parameter count: 1
bytecode array length: 53
bytecode array length: 52
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star), R(0),
@ -249,7 +245,7 @@ bytecodes: [
/* 77 S> */ B(LdaSmi), I8(5),
/* 83 E> */ B(TestEqual), R(0), U8(1),
B(JumpIfFalse), U8(4),
/* 89 S> */ B(Jump), U8(29),
/* 89 S> */ B(Jump), U8(28),
/* 98 S> */ B(LdaSmi), I8(6),
/* 104 E> */ B(TestEqual), R(0), U8(2),
B(JumpIfFalse), U8(4),
@ -259,9 +255,8 @@ bytecodes: [
B(Star), R(0),
/* 144 S> */ B(LdaSmi), I8(10),
/* 144 E> */ B(TestLessThan), R(0), U8(4),
B(JumpIfFalse), U8(6),
/* 56 E> */ B(StackCheck),
B(JumpLoop), U8(40), I8(0),
B(JumpIfFalse), U8(5),
/* 56 E> */ B(JumpLoop), U8(39), I8(0),
/* 151 S> */ B(Ldar), R(1),
/* 160 S> */ B(Return),
]
@ -282,7 +277,7 @@ snippet: "
"
frame size: 2
parameter count: 1
bytecode array length: 31
bytecode array length: 30
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(10),
B(Star), R(0),
@ -294,9 +289,8 @@ bytecodes: [
/* 78 S> */ B(Ldar), R(0),
/* 84 E> */ B(SubSmi), I8(1), U8(1),
B(Star), R(0),
/* 98 S> */ B(JumpIfToBooleanFalse), U8(6),
/* 57 E> */ B(StackCheck),
B(JumpLoop), U8(17), I8(0),
/* 98 S> */ B(JumpIfToBooleanFalse), U8(5),
/* 57 E> */ B(JumpLoop), U8(16), I8(0),
/* 102 S> */ B(Ldar), R(1),
/* 111 S> */ B(Return),
]
@ -358,7 +352,7 @@ snippet: "
"
frame size: 2
parameter count: 1
bytecode array length: 46
bytecode array length: 45
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star), R(0),
@ -370,7 +364,7 @@ bytecodes: [
/* 77 S> */ B(LdaSmi), I8(5),
/* 83 E> */ B(TestEqual), R(0), U8(1),
B(JumpIfFalse), U8(4),
/* 89 S> */ B(Jump), U8(22),
/* 89 S> */ B(Jump), U8(21),
/* 98 S> */ B(Ldar), R(0),
/* 104 E> */ B(AddSmi), I8(1), U8(2),
B(Star), R(0),
@ -378,8 +372,7 @@ bytecodes: [
/* 117 E> */ B(TestEqual), R(0), U8(3),
B(JumpIfFalse), U8(4),
/* 123 S> */ B(Jump), U8(2),
/* 56 E> */ B(StackCheck),
B(JumpLoop), U8(33), I8(0),
/* 56 E> */ B(JumpLoop), U8(32), I8(0),
/* 149 S> */ B(Ldar), R(1),
/* 158 S> */ B(Return),
]
@ -399,14 +392,14 @@ snippet: "
"
frame size: 1
parameter count: 1
bytecode array length: 34
bytecode array length: 33
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star), R(0),
/* 58 S> */ B(LdaSmi), I8(1),
/* 64 E> */ B(TestEqual), R(0), U8(0),
B(JumpIfFalse), U8(4),
/* 70 S> */ B(Jump), U8(22),
/* 70 S> */ B(Jump), U8(21),
/* 79 S> */ B(LdaSmi), I8(2),
/* 85 E> */ B(TestEqual), R(0), U8(1),
B(JumpIfFalse), U8(4),
@ -414,8 +407,7 @@ bytecodes: [
/* 103 S> */ B(Ldar), R(0),
/* 109 E> */ B(AddSmi), I8(1), U8(2),
B(Star), R(0),
/* 45 E> */ B(StackCheck),
B(JumpLoop), U8(26), I8(0),
/* 45 E> */ B(JumpLoop), U8(25), I8(0),
B(LdaUndefined),
/* 116 S> */ B(Return),
]
@ -434,14 +426,14 @@ snippet: "
"
frame size: 1
parameter count: 1
bytecode array length: 34
bytecode array length: 33
bytecodes: [
/* 47 S> */ B(LdaZero),
B(Star), R(0),
/* 56 S> */ B(LdaSmi), I8(1),
/* 62 E> */ B(TestEqual), R(0), U8(0),
B(JumpIfFalse), U8(4),
/* 68 S> */ B(Jump), U8(22),
/* 68 S> */ B(Jump), U8(21),
/* 77 S> */ B(LdaSmi), I8(2),
/* 83 E> */ B(TestEqual), R(0), U8(1),
B(JumpIfFalse), U8(4),
@ -449,8 +441,7 @@ bytecodes: [
/* 101 S> */ B(Ldar), R(0),
/* 107 E> */ B(AddSmi), I8(1), U8(2),
B(Star), R(0),
/* 34 E> */ B(StackCheck),
B(JumpLoop), U8(26), I8(0),
/* 34 E> */ B(JumpLoop), U8(25), I8(0),
B(LdaUndefined),
/* 114 S> */ B(Return),
]
@ -469,14 +460,14 @@ snippet: "
"
frame size: 1
parameter count: 1
bytecode array length: 34
bytecode array length: 33
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star), R(0),
/* 68 S> */ B(LdaSmi), I8(1),
/* 74 E> */ B(TestEqual), R(0), U8(0),
B(JumpIfFalse), U8(4),
/* 80 S> */ B(Jump), U8(22),
/* 80 S> */ B(Jump), U8(21),
/* 89 S> */ B(LdaSmi), I8(2),
/* 95 E> */ B(TestEqual), R(0), U8(1),
B(JumpIfFalse), U8(4),
@ -484,8 +475,7 @@ bytecodes: [
/* 55 S> */ B(Ldar), R(0),
/* 59 E> */ B(AddSmi), I8(1), U8(2),
B(Star), R(0),
/* 45 E> */ B(StackCheck),
B(JumpLoop), U8(26), I8(0),
/* 45 E> */ B(JumpLoop), U8(25), I8(0),
B(LdaUndefined),
/* 113 S> */ B(Return),
]
@ -503,14 +493,14 @@ snippet: "
"
frame size: 1
parameter count: 1
bytecode array length: 34
bytecode array length: 33
bytecodes: [
/* 47 S> */ B(LdaZero),
B(Star), R(0),
/* 66 S> */ B(LdaSmi), I8(1),
/* 72 E> */ B(TestEqual), R(0), U8(0),
B(JumpIfFalse), U8(4),
/* 78 S> */ B(Jump), U8(22),
/* 78 S> */ B(Jump), U8(21),
/* 87 S> */ B(LdaSmi), I8(2),
/* 93 E> */ B(TestEqual), R(0), U8(1),
B(JumpIfFalse), U8(4),
@ -518,8 +508,7 @@ bytecodes: [
/* 53 S> */ B(Ldar), R(0),
/* 57 E> */ B(AddSmi), I8(1), U8(2),
B(Star), R(0),
/* 34 E> */ B(StackCheck),
B(JumpLoop), U8(26), I8(0),
/* 34 E> */ B(JumpLoop), U8(25), I8(0),
B(LdaUndefined),
/* 111 S> */ B(Return),
]
@ -538,7 +527,7 @@ snippet: "
"
frame size: 2
parameter count: 1
bytecode array length: 35
bytecode array length: 34
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star), R(0),
@ -546,7 +535,7 @@ bytecodes: [
B(Star), R(1),
/* 63 S> */ B(LdaSmi), I8(100),
/* 63 E> */ B(TestLessThan), R(1), U8(0),
B(JumpIfFalse), U8(22),
B(JumpIfFalse), U8(21),
/* 85 S> */ B(Ldar), R(0),
/* 91 E> */ B(AddSmi), I8(1), U8(1),
B(Star), R(0),
@ -554,8 +543,7 @@ bytecodes: [
/* 72 S> */ B(Ldar), R(1),
/* 76 E> */ B(AddSmi), I8(1), U8(2),
B(Star), R(1),
/* 45 E> */ B(StackCheck),
B(JumpLoop), U8(24), I8(0),
/* 45 E> */ B(JumpLoop), U8(23), I8(0),
B(LdaUndefined),
/* 110 S> */ B(Return),
]
@ -574,22 +562,21 @@ snippet: "
"
frame size: 2
parameter count: 1
bytecode array length: 32
bytecode array length: 31
bytecodes: [
/* 42 S> */ B(LdaSmi), I8(1),
B(Star), R(0),
/* 58 S> */ B(LdaSmi), I8(10),
B(Star), R(1),
/* 62 S> */ B(Ldar), R(1),
B(JumpIfToBooleanFalse), U8(19),
B(JumpIfToBooleanFalse), U8(18),
/* 74 S> */ B(Ldar), R(0),
/* 80 E> */ B(MulSmi), I8(12), U8(0),
B(Star), R(0),
/* 67 S> */ B(Ldar), R(1),
B(Dec), U8(1),
B(Star), R(1),
/* 45 E> */ B(StackCheck),
B(JumpLoop), U8(18), I8(0),
/* 45 E> */ B(JumpLoop), U8(17), I8(0),
/* 88 S> */ B(Ldar), R(0),
/* 97 S> */ B(Return),
]
@ -633,7 +620,7 @@ snippet: "
"
frame size: 2
parameter count: 1
bytecode array length: 35
bytecode array length: 34
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star), R(0),
@ -645,12 +632,11 @@ bytecodes: [
/* 89 S> */ B(LdaSmi), I8(20),
/* 95 E> */ B(TestEqual), R(0), U8(1),
B(JumpIfFalse), U8(4),
/* 102 S> */ B(Jump), U8(12),
/* 102 S> */ B(Jump), U8(11),
/* 69 S> */ B(Ldar), R(1),
B(Inc), U8(2),
B(Star), R(1),
/* 45 E> */ B(StackCheck),
B(JumpLoop), U8(23), I8(0),
/* 45 E> */ B(JumpLoop), U8(22), I8(0),
/* 112 S> */ B(Ldar), R(0),
/* 121 S> */ B(Return),
]
@ -673,12 +659,12 @@ snippet: "
"
frame size: 4
parameter count: 1
bytecode array length: 49
bytecode array length: 48
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star), R(0),
/* 52 S> */ B(Ldar), R(0),
B(JumpIfToBooleanFalse), U8(42),
B(JumpIfToBooleanFalse), U8(41),
B(CreateBlockContext), U8(0),
B(PushContext), R(3),
B(LdaTheHole),
@ -696,8 +682,7 @@ bytecodes: [
B(Inc), U8(0),
/* 127 E> */ B(StaCurrentContextSlot), U8(2),
B(PopContext), R(3),
/* 45 E> */ B(StackCheck),
B(JumpLoop), U8(41), I8(0),
/* 45 E> */ B(JumpLoop), U8(40), I8(0),
B(LdaUndefined),
/* 137 S> */ B(Return),
]

View File

@ -47,7 +47,7 @@ snippet: "
"
frame size: 4
parameter count: 1
bytecode array length: 68
bytecode array length: 66
bytecodes: [
/* 44 S> */ B(LdaZero),
B(Star), R(0),
@ -55,12 +55,12 @@ bytecodes: [
B(Star), R(1),
/* 76 S> */ B(LdaSmi), I8(10),
/* 76 E> */ B(TestLessThan), R(1), U8(0),
B(JumpIfFalse), U8(54),
B(JumpIfFalse), U8(52),
/* 106 S> */ B(LdaZero),
B(Star), R(2),
/* 111 S> */ B(LdaSmi), I8(3),
/* 111 E> */ B(TestLessThan), R(2), U8(1),
B(JumpIfFalse), U8(34),
B(JumpIfFalse), U8(33),
/* 129 S> */ B(Ldar), R(0),
B(Inc), U8(2),
B(Star), R(0),
@ -70,17 +70,15 @@ bytecodes: [
B(LdaSmi), I8(12),
/* 152 E> */ B(TestEqual), R(3), U8(4),
B(JumpIfFalse), U8(4),
/* 161 S> */ B(Jump), U8(22),
/* 161 S> */ B(Jump), U8(20),
/* 118 S> */ B(Ldar), R(2),
B(Inc), U8(5),
B(Star), R(2),
/* 93 E> */ B(StackCheck),
B(JumpLoop), U8(36), I8(1),
/* 93 E> */ B(JumpLoop), U8(35), I8(1),
/* 84 S> */ B(Ldar), R(1),
B(Inc), U8(6),
B(Star), R(1),
/* 58 E> */ B(StackCheck),
B(JumpLoop), U8(56), I8(0),
/* 58 E> */ B(JumpLoop), U8(54), I8(0),
/* 188 S> */ B(Ldar), R(0),
/* 199 S> */ B(Return),
]

View File

@ -65,7 +65,7 @@ snippet: "
"
frame size: 8
parameter count: 1
bytecode array length: 101
bytecode array length: 100
bytecodes: [
/* 34 S> */ B(LdaGlobal), U8(0), U8(0),
B(Star), R(0),
@ -89,14 +89,13 @@ bytecodes: [
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(7), U8(1),
B(LdaNamedProperty), R(7), U8(6), U8(21),
B(JumpIfToBooleanTrue), U8(20),
B(JumpIfToBooleanTrue), U8(19),
B(LdaNamedProperty), R(7), U8(7), U8(12),
B(StaInArrayLiteral), R(4), R(3), U8(17),
B(Ldar), R(3),
B(Inc), U8(16),
B(Star), R(3),
B(StackCheck),
B(JumpLoop), U8(34), I8(0),
B(JumpLoop), U8(33), I8(0),
B(LdaSmi), I8(4),
B(StaInArrayLiteral), R(4), R(3), U8(17),
B(Mov), R(4), R(3),

View File

@ -252,19 +252,18 @@ snippet: "
"
frame size: 2
parameter count: 1
bytecode array length: 22
bytecode array length: 21
bytecodes: [
/* 42 S> */ B(LdaUndefined),
B(Star), R(0),
/* 61 S> */ B(LdaZero),
B(Star), R(1),
/* 73 S> */ B(Ldar), R(0),
B(JumpIfUndefined), U8(12),
B(JumpIfUndefined), U8(11),
/* 92 S> */ B(Ldar), R(1),
B(Inc), U8(0),
B(Star), R(1),
/* 64 E> */ B(StackCheck),
B(JumpLoop), U8(11), I8(0),
/* 64 E> */ B(JumpLoop), U8(10), I8(0),
B(LdaUndefined),
/* 99 S> */ B(Return),
]

View File

@ -109,7 +109,7 @@ snippet: "
"
frame size: 15
parameter count: 1
bytecode array length: 253
bytecode array length: 252
bytecodes: [
/* 48 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(37),
B(Star), R(2),
@ -167,14 +167,13 @@ bytecodes: [
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(10), U8(1),
B(LdaNamedProperty), R(10), U8(2), U8(21),
B(JumpIfToBooleanTrue), U8(20),
B(JumpIfToBooleanTrue), U8(19),
B(LdaNamedProperty), R(10), U8(3), U8(7),
B(StaInArrayLiteral), R(11), R(12), U8(16),
B(Ldar), R(12),
B(Inc), U8(18),
B(Star), R(12),
B(StackCheck),
B(JumpLoop), U8(34), I8(0),
B(JumpLoop), U8(33), I8(0),
B(Mov), R(11), R(1),
B(LdaSmi), I8(-1),
B(Star), R(8),
@ -230,8 +229,8 @@ constant pool: [
ONE_BYTE_INTERNALIZED_STRING_TYPE [""],
]
handlers: [
[34, 163, 171],
[195, 228, 230],
[34, 162, 170],
[194, 227, 229],
]
---

View File

@ -16,7 +16,7 @@ snippet: "
"
frame size: 19
parameter count: 1
bytecode array length: 320
bytecode array length: 319
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(2),
B(Mov), R(closure), R(4),
@ -64,7 +64,7 @@ bytecodes: [
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(11), U8(1),
B(LdaNamedProperty), R(11), U8(6), U8(13),
B(JumpIfToBooleanTrue), U8(23),
B(JumpIfToBooleanTrue), U8(22),
B(LdaNamedProperty), R(11), U8(7), U8(15),
B(Star), R(11),
B(LdaFalse),
@ -72,8 +72,7 @@ bytecodes: [
B(Mov), R(11), R(1),
/* 38 S> */ B(Mov), R(1), R(3),
B(Ldar), R(11),
/* 23 E> */ B(StackCheck),
B(JumpLoop), U8(77), I8(0),
/* 23 E> */ B(JumpLoop), U8(76), I8(0),
B(LdaSmi), I8(-1),
B(Star), R(9),
B(Star), R(8),
@ -154,7 +153,7 @@ bytecodes: [
]
constant pool: [
Smi [95],
Smi [224],
Smi [223],
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
SYMBOL_TYPE,
SYMBOL_TYPE,
@ -166,9 +165,9 @@ constant pool: [
SCOPE_INFO_TYPE,
]
handlers: [
[19, 292, 292],
[74, 154, 162],
[186, 255, 257],
[19, 291, 291],
[74, 153, 161],
[185, 254, 256],
]
---
@ -356,7 +355,7 @@ snippet: "
"
frame size: 19
parameter count: 1
bytecode array length: 336
bytecode array length: 335
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(2),
B(Mov), R(closure), R(4),
@ -404,7 +403,7 @@ bytecodes: [
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(11), U8(1),
B(LdaNamedProperty), R(11), U8(6), U8(13),
B(JumpIfToBooleanTrue), U8(39),
B(JumpIfToBooleanTrue), U8(38),
B(LdaNamedProperty), R(11), U8(7), U8(15),
B(Star), R(11),
B(LdaFalse),
@ -418,9 +417,8 @@ bytecodes: [
/* 90 S> */ B(LdaSmi), I8(20),
/* 96 E> */ B(TestEqual), R(3), U8(18),
B(JumpIfFalse), U8(4),
/* 103 S> */ B(Jump), U8(6),
/* 23 E> */ B(StackCheck),
B(JumpLoop), U8(93), I8(0),
/* 103 S> */ B(Jump), U8(5),
/* 23 E> */ B(JumpLoop), U8(92), I8(0),
B(LdaSmi), I8(-1),
B(Star), R(9),
B(Star), R(8),
@ -501,7 +499,7 @@ bytecodes: [
]
constant pool: [
Smi [95],
Smi [240],
Smi [239],
ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
SYMBOL_TYPE,
SYMBOL_TYPE,
@ -513,9 +511,9 @@ constant pool: [
SCOPE_INFO_TYPE,
]
handlers: [
[19, 308, 308],
[74, 170, 178],
[202, 271, 273],
[19, 307, 307],
[74, 169, 177],
[201, 270, 272],
]
---

View File

@ -60,18 +60,18 @@ snippet: "
"
frame size: 8
parameter count: 1
bytecode array length: 43
bytecode array length: 42
bytecodes: [
/* 42 S> */ B(LdaConstant), U8(0),
B(Star), R(0),
/* 68 S> */ B(JumpIfUndefinedOrNull), U8(37),
/* 68 S> */ B(JumpIfUndefinedOrNull), U8(36),
B(ToObject), R(3),
B(ForInEnumerate), R(3),
B(ForInPrepare), R(4), U8(0),
B(LdaZero),
B(Star), R(7),
/* 63 S> */ B(ForInContinue), R(7), R(6),
B(JumpIfFalse), U8(22),
B(JumpIfFalse), U8(21),
B(ForInNext), R(3), R(7), R(4), U8(0),
B(JumpIfUndefined), U8(7),
B(Star), R(2),
@ -79,8 +79,7 @@ bytecodes: [
/* 82 S> */ B(Return),
B(ForInStep), R(7),
B(Star), R(7),
/* 54 E> */ B(StackCheck),
B(JumpLoop), U8(22), I8(0),
/* 54 E> */ B(JumpLoop), U8(21), I8(0),
B(LdaUndefined),
/* 85 S> */ B(Return),
]
@ -97,19 +96,19 @@ snippet: "
"
frame size: 9
parameter count: 1
bytecode array length: 55
bytecode array length: 54
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star), R(0),
/* 59 S> */ B(CreateArrayLiteral), U8(0), U8(1), U8(37),
B(JumpIfUndefinedOrNull), U8(46),
B(JumpIfUndefinedOrNull), U8(45),
B(ToObject), R(3),
B(ForInEnumerate), R(3),
B(ForInPrepare), R(4), U8(0),
B(LdaZero),
B(Star), R(7),
/* 54 S> */ B(ForInContinue), R(7), R(6),
B(JumpIfFalse), U8(31),
B(JumpIfFalse), U8(30),
B(ForInNext), R(3), R(7), R(4), U8(0),
B(JumpIfUndefined), U8(16),
B(Star), R(2),
@ -120,8 +119,7 @@ bytecodes: [
B(Star), R(0),
/* 72 E> */ B(ForInStep), R(7),
B(Star), R(7),
/* 45 E> */ B(StackCheck),
B(JumpLoop), U8(31), I8(0),
/* 45 E> */ B(JumpLoop), U8(30), I8(0),
B(LdaUndefined),
/* 80 S> */ B(Return),
]
@ -141,19 +139,19 @@ snippet: "
"
frame size: 7
parameter count: 1
bytecode array length: 82
bytecode array length: 81
bytecodes: [
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
B(Star), R(0),
/* 77 S> */ B(CreateArrayLiteral), U8(1), U8(2), U8(37),
B(JumpIfUndefinedOrNull), U8(70),
B(JumpIfUndefinedOrNull), U8(69),
B(ToObject), R(1),
B(ForInEnumerate), R(1),
B(ForInPrepare), R(2), U8(1),
B(LdaZero),
B(Star), R(5),
/* 68 S> */ B(ForInContinue), R(5), R(4),
B(JumpIfFalse), U8(55),
B(JumpIfFalse), U8(54),
B(ForInNext), R(1), R(5), R(2), U8(1),
B(JumpIfUndefined), U8(40),
B(Star), R(6),
@ -170,11 +168,10 @@ bytecodes: [
B(LdaSmi), I8(20),
/* 136 E> */ B(TestEqual), R(6), U8(8),
B(JumpIfFalse), U8(4),
/* 143 S> */ B(Jump), U8(10),
/* 143 S> */ B(Jump), U8(9),
B(ForInStep), R(5),
B(Star), R(5),
/* 62 E> */ B(StackCheck),
B(JumpLoop), U8(55), I8(0),
/* 62 E> */ B(JumpLoop), U8(54), I8(0),
B(LdaUndefined),
/* 152 S> */ B(Return),
]
@ -193,19 +190,19 @@ snippet: "
"
frame size: 9
parameter count: 1
bytecode array length: 61
bytecode array length: 60
bytecodes: [
/* 42 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(37),
B(Star), R(0),
/* 72 S> */ B(CreateArrayLiteral), U8(1), U8(2), U8(37),
B(JumpIfUndefinedOrNull), U8(49),
B(JumpIfUndefinedOrNull), U8(48),
B(ToObject), R(1),
B(ForInEnumerate), R(1),
B(ForInPrepare), R(2), U8(1),
B(LdaZero),
B(Star), R(5),
/* 65 S> */ B(ForInContinue), R(5), R(4),
B(JumpIfFalse), U8(34),
B(JumpIfFalse), U8(33),
B(ForInNext), R(1), R(5), R(2), U8(1),
B(JumpIfUndefined), U8(19),
B(Star), R(6),
@ -218,8 +215,7 @@ bytecodes: [
/* 95 S> */ B(Return),
B(ForInStep), R(5),
B(Star), R(5),
/* 59 E> */ B(StackCheck),
B(JumpLoop), U8(34), I8(0),
/* 59 E> */ B(JumpLoop), U8(33), I8(0),
B(LdaUndefined),
/* 98 S> */ B(Return),
]

View File

@ -11,7 +11,7 @@ snippet: "
"
frame size: 13
parameter count: 1
bytecode array length: 164
bytecode array length: 163
bytecodes: [
/* 48 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(37),
B(Star), R(4),
@ -31,7 +31,7 @@ bytecodes: [
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(8), U8(1),
B(LdaNamedProperty), R(8), U8(2), U8(9),
B(JumpIfToBooleanTrue), U8(23),
B(JumpIfToBooleanTrue), U8(22),
B(LdaNamedProperty), R(8), U8(3), U8(11),
B(Star), R(8),
B(LdaFalse),
@ -39,8 +39,7 @@ bytecodes: [
B(Mov), R(8), R(1),
/* 43 S> */ B(Mov), R(1), R(0),
B(Ldar), R(8),
/* 34 E> */ B(StackCheck),
B(JumpLoop), U8(40), I8(0),
/* 34 E> */ B(JumpLoop), U8(39), I8(0),
B(LdaSmi), I8(-1),
B(Star), R(6),
B(Star), R(5),
@ -95,8 +94,8 @@ constant pool: [
ONE_BYTE_INTERNALIZED_STRING_TYPE [""],
]
handlers: [
[31, 74, 82],
[106, 139, 141],
[31, 73, 81],
[105, 138, 140],
]
---
@ -208,7 +207,7 @@ snippet: "
"
frame size: 13
parameter count: 1
bytecode array length: 180
bytecode array length: 179
bytecodes: [
/* 48 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(37),
B(Star), R(4),
@ -228,7 +227,7 @@ bytecodes: [
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(8), U8(1),
B(LdaNamedProperty), R(8), U8(2), U8(9),
B(JumpIfToBooleanTrue), U8(39),
B(JumpIfToBooleanTrue), U8(38),
B(LdaNamedProperty), R(8), U8(3), U8(11),
B(Star), R(8),
B(LdaFalse),
@ -242,9 +241,8 @@ bytecodes: [
/* 91 S> */ B(LdaSmi), I8(20),
/* 97 E> */ B(TestEqual), R(0), U8(14),
B(JumpIfFalse), U8(4),
/* 104 S> */ B(Jump), U8(6),
/* 34 E> */ B(StackCheck),
B(JumpLoop), U8(56), I8(0),
/* 104 S> */ B(Jump), U8(5),
/* 34 E> */ B(JumpLoop), U8(55), I8(0),
B(LdaSmi), I8(-1),
B(Star), R(6),
B(Star), R(5),
@ -299,8 +297,8 @@ constant pool: [
ONE_BYTE_INTERNALIZED_STRING_TYPE [""],
]
handlers: [
[31, 90, 98],
[122, 155, 157],
[31, 89, 97],
[121, 154, 156],
]
---

View File

@ -15,7 +15,7 @@ snippet: "
"
frame size: 15
parameter count: 2
bytecode array length: 161
bytecode array length: 160
bytecodes: [
/* 34 S> */ B(GetIterator), R(arg0), U8(0), U8(2),
B(JumpIfJSReceiver), U8(7),
@ -33,7 +33,7 @@ bytecodes: [
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(10), U8(1),
B(LdaNamedProperty), R(10), U8(1), U8(8),
B(JumpIfToBooleanTrue), U8(26),
B(JumpIfToBooleanTrue), U8(25),
B(LdaNamedProperty), R(10), U8(2), U8(10),
B(Star), R(10),
B(LdaFalse),
@ -42,8 +42,7 @@ bytecodes: [
/* 29 S> */ B(Mov), R(0), R(2),
/* 49 S> */ B(Mov), R(2), R(3),
B(Ldar), R(10),
/* 20 E> */ B(StackCheck),
B(JumpLoop), U8(43), I8(0),
/* 20 E> */ B(JumpLoop), U8(42), I8(0),
B(LdaSmi), I8(-1),
B(Star), R(8),
B(Star), R(7),
@ -97,8 +96,8 @@ constant pool: [
ONE_BYTE_INTERNALIZED_STRING_TYPE [""],
]
handlers: [
[25, 71, 79],
[103, 136, 138],
[25, 70, 78],
[102, 135, 137],
]
---
@ -110,7 +109,7 @@ snippet: "
"
frame size: 20
parameter count: 2
bytecode array length: 245
bytecode array length: 244
bytecodes: [
/* 10 E> */ B(CreateFunctionContext), U8(0), U8(5),
B(PushContext), R(2),
@ -144,7 +143,7 @@ bytecodes: [
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(10), U8(1),
B(LdaNamedProperty), R(10), U8(3), U8(8),
B(JumpIfToBooleanTrue), U8(75),
B(JumpIfToBooleanTrue), U8(74),
B(LdaNamedProperty), R(10), U8(4), U8(10),
B(Star), R(10),
B(LdaFalse),
@ -174,8 +173,7 @@ bytecodes: [
/* 41 E> */ B(CallUndefinedReceiver1), R(12), R(13), U8(14),
B(PopContext), R(11),
B(Mov), R(0), R(10),
/* 20 E> */ B(StackCheck),
B(JumpLoop), U8(92), I8(0),
/* 20 E> */ B(JumpLoop), U8(91), I8(0),
B(LdaSmi), I8(-1),
B(Star), R(8),
B(Star), R(7),
@ -235,8 +233,8 @@ constant pool: [
ONE_BYTE_INTERNALIZED_STRING_TYPE [""],
]
handlers: [
[58, 153, 161],
[185, 218, 220],
[58, 152, 160],
[184, 217, 219],
]
---
@ -248,7 +246,7 @@ snippet: "
"
frame size: 14
parameter count: 2
bytecode array length: 178
bytecode array length: 177
bytecodes: [
/* 34 S> */ B(GetIterator), R(arg0), U8(0), U8(2),
B(JumpIfJSReceiver), U8(7),
@ -266,7 +264,7 @@ bytecodes: [
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(8), U8(1),
B(LdaNamedProperty), R(8), U8(1), U8(8),
B(JumpIfToBooleanTrue), U8(43),
B(JumpIfToBooleanTrue), U8(42),
B(LdaNamedProperty), R(8), U8(2), U8(10),
B(Star), R(8),
B(LdaFalse),
@ -283,8 +281,7 @@ bytecodes: [
/* 67 E> */ B(CallUndefinedReceiver0), R(10), U8(12),
B(PopContext), R(9),
B(Mov), R(0), R(8),
/* 20 E> */ B(StackCheck),
B(JumpLoop), U8(60), I8(0),
/* 20 E> */ B(JumpLoop), U8(59), I8(0),
B(LdaSmi), I8(-1),
B(Star), R(6),
B(Star), R(5),
@ -340,8 +337,8 @@ constant pool: [
ONE_BYTE_INTERNALIZED_STRING_TYPE [""],
]
handlers: [
[25, 88, 96],
[120, 153, 155],
[25, 87, 95],
[119, 152, 154],
]
---
@ -353,7 +350,7 @@ snippet: "
"
frame size: 17
parameter count: 2
bytecode array length: 172
bytecode array length: 171
bytecodes: [
/* 41 S> */ B(GetIterator), R(arg0), U8(0), U8(2),
B(JumpIfJSReceiver), U8(7),
@ -371,7 +368,7 @@ bytecodes: [
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(12), U8(1),
B(LdaNamedProperty), R(12), U8(1), U8(8),
B(JumpIfToBooleanTrue), U8(37),
B(JumpIfToBooleanTrue), U8(36),
B(LdaNamedProperty), R(12), U8(2), U8(10),
B(Star), R(12),
B(LdaFalse),
@ -384,8 +381,7 @@ bytecodes: [
/* 56 S> */ B(Ldar), R(4),
/* 58 E> */ B(Add), R(3), U8(16),
B(Star), R(5),
/* 20 E> */ B(StackCheck),
B(JumpLoop), U8(54), I8(0),
/* 20 E> */ B(JumpLoop), U8(53), I8(0),
B(LdaSmi), I8(-1),
B(Star), R(10),
B(Star), R(9),
@ -441,8 +437,8 @@ constant pool: [
ONE_BYTE_INTERNALIZED_STRING_TYPE [""],
]
handlers: [
[25, 82, 90],
[114, 147, 149],
[25, 81, 89],
[113, 146, 148],
]
---
@ -454,7 +450,7 @@ snippet: "
"
frame size: 16
parameter count: 2
bytecode array length: 202
bytecode array length: 201
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(Mov), R(closure), R(5),
@ -486,7 +482,7 @@ bytecodes: [
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(11), U8(1),
B(LdaNamedProperty), R(11), U8(4), U8(8),
B(JumpIfToBooleanTrue), U8(26),
B(JumpIfToBooleanTrue), U8(25),
B(LdaNamedProperty), R(11), U8(5), U8(10),
B(Star), R(11),
B(LdaFalse),
@ -495,8 +491,7 @@ bytecodes: [
/* 30 S> */ B(Mov), R(1), R(3),
/* 50 S> */ B(Mov), R(3), R(4),
B(Ldar), R(11),
/* 21 E> */ B(StackCheck),
B(JumpLoop), U8(43), I8(0),
/* 21 E> */ B(JumpLoop), U8(42), I8(0),
B(LdaSmi), I8(-1),
B(Star), R(9),
B(Star), R(8),
@ -553,8 +548,8 @@ constant pool: [
ONE_BYTE_INTERNALIZED_STRING_TYPE [""],
]
handlers: [
[66, 112, 120],
[144, 177, 179],
[66, 111, 119],
[143, 176, 178],
]
---
@ -566,7 +561,7 @@ snippet: "
"
frame size: 15
parameter count: 2
bytecode array length: 246
bytecode array length: 245
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(2),
B(Mov), R(closure), R(4),
@ -598,7 +593,7 @@ bytecodes: [
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(10), U8(1),
B(LdaNamedProperty), R(10), U8(5), U8(8),
B(JumpIfToBooleanTrue), U8(64),
B(JumpIfToBooleanTrue), U8(63),
B(LdaNamedProperty), R(10), U8(6), U8(10),
B(Star), R(10),
B(LdaFalse),
@ -619,10 +614,9 @@ bytecodes: [
B(LdaSmi), I8(1),
B(Star), R(7),
B(Mov), R(11), R(8),
B(Jump), U8(21),
B(Jump), U8(20),
B(Ldar), R(11),
/* 21 E> */ B(StackCheck),
B(JumpLoop), U8(81), I8(0),
/* 21 E> */ B(JumpLoop), U8(80), I8(0),
B(LdaSmi), I8(-1),
B(Star), R(8),
B(Star), R(7),
@ -686,8 +680,8 @@ constant pool: [
Smi [9],
]
handlers: [
[66, 150, 158],
[182, 215, 217],
[66, 149, 157],
[181, 214, 216],
]
---
@ -699,7 +693,7 @@ snippet: "
"
frame size: 17
parameter count: 2
bytecode array length: 216
bytecode array length: 215
bytecodes: [
B(Mov), R(closure), R(5),
B(Mov), R(this), R(6),
@ -722,7 +716,7 @@ bytecodes: [
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(12), U8(1),
B(LdaNamedProperty), R(12), U8(1), U8(8),
B(JumpIfToBooleanTrue), U8(26),
B(JumpIfToBooleanTrue), U8(25),
B(LdaNamedProperty), R(12), U8(2), U8(10),
B(Star), R(12),
B(LdaFalse),
@ -731,8 +725,7 @@ bytecodes: [
/* 35 S> */ B(Mov), R(1), R(3),
/* 55 S> */ B(Mov), R(3), R(4),
B(Ldar), R(12),
/* 26 E> */ B(StackCheck),
B(JumpLoop), U8(43), I8(0),
/* 26 E> */ B(JumpLoop), U8(42), I8(0),
B(LdaSmi), I8(-1),
B(Star), R(10),
B(Star), R(9),
@ -806,9 +799,9 @@ constant pool: [
SCOPE_INFO_TYPE,
]
handlers: [
[15, 188, 188],
[40, 86, 94],
[118, 151, 153],
[15, 187, 187],
[40, 85, 93],
[117, 150, 152],
]
---
@ -820,7 +813,7 @@ snippet: "
"
frame size: 16
parameter count: 2
bytecode array length: 252
bytecode array length: 251
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(Mov), R(closure), R(4),
@ -844,7 +837,7 @@ bytecodes: [
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(11), U8(1),
B(LdaNamedProperty), R(11), U8(2), U8(8),
B(JumpIfToBooleanTrue), U8(58),
B(JumpIfToBooleanTrue), U8(57),
B(LdaNamedProperty), R(11), U8(3), U8(10),
B(Star), R(11),
B(LdaFalse),
@ -865,8 +858,7 @@ bytecodes: [
B(Ldar), R(12),
B(ReThrow),
B(Ldar), R(12),
/* 26 E> */ B(StackCheck),
B(JumpLoop), U8(75), I8(0),
/* 26 E> */ B(JumpLoop), U8(74), I8(0),
B(LdaSmi), I8(-1),
B(Star), R(9),
B(Star), R(8),
@ -941,8 +933,8 @@ constant pool: [
SCOPE_INFO_TYPE,
]
handlers: [
[19, 224, 224],
[44, 122, 130],
[154, 187, 189],
[19, 223, 223],
[44, 121, 129],
[153, 186, 188],
]

View File

@ -98,7 +98,7 @@ snippet: "
"
frame size: 15
parameter count: 1
bytecode array length: 252
bytecode array length: 251
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(2),
B(Mov), R(closure), R(4),
@ -132,7 +132,7 @@ bytecodes: [
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(10), U8(1),
B(LdaNamedProperty), R(10), U8(6), U8(9),
B(JumpIfToBooleanTrue), U8(64),
B(JumpIfToBooleanTrue), U8(63),
B(LdaNamedProperty), R(10), U8(7), U8(11),
B(Star), R(10),
B(LdaFalse),
@ -153,10 +153,9 @@ bytecodes: [
B(LdaSmi), I8(1),
B(Star), R(7),
B(Mov), R(11), R(8),
B(Jump), U8(21),
B(Jump), U8(20),
B(Ldar), R(11),
/* 16 E> */ B(StackCheck),
B(JumpLoop), U8(81), I8(0),
/* 16 E> */ B(JumpLoop), U8(80), I8(0),
B(LdaSmi), I8(-1),
B(Star), R(8),
B(Star), R(7),
@ -221,8 +220,8 @@ constant pool: [
Smi [9],
]
handlers: [
[72, 156, 164],
[188, 221, 223],
[72, 155, 163],
[187, 220, 222],
]
---
@ -233,7 +232,7 @@ snippet: "
"
frame size: 7
parameter count: 1
bytecode array length: 205
bytecode array length: 204
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(2),
B(Mov), R(closure), R(1),
@ -292,15 +291,14 @@ bytecodes: [
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(1), U8(1),
B(LdaNamedProperty), R(1), U8(10), U8(24),
B(JumpIfToBooleanTrue), U8(25),
B(JumpIfToBooleanTrue), U8(24),
B(Ldar), R(1),
/* 43 E> */ B(SuspendGenerator), R(0), R(0), U8(6), U8(1),
B(ResumeGenerator), R(0), R(0), U8(6),
B(Star), R(4),
B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
B(Star), R(2),
B(StackCheck),
B(JumpLoop), U8(109), I8(0),
B(JumpLoop), U8(108), I8(0),
B(LdaNamedProperty), R(1), U8(11), U8(26),
B(Star), R(3),
B(LdaSmi), I8(1),

View File

@ -64,7 +64,7 @@ snippet: "
"
frame size: 3
parameter count: 1
bytecode array length: 68
bytecode array length: 67
bytecodes: [
/* 16 E> */ B(CreateMappedArguments),
B(Star), R(0),
@ -76,7 +76,7 @@ bytecodes: [
B(Star), R(1),
B(LdaSmi), I8(5),
/* 59 E> */ B(TestLessThan), R(1), U8(6),
B(JumpIfFalse), U8(43),
B(JumpIfFalse), U8(42),
/* 81 S> */ B(LdaGlobal), U8(0), U8(7),
B(Star), R(1),
B(LdaSmi), I8(2),
@ -90,8 +90,7 @@ bytecodes: [
/* 66 S> */ B(LdaGlobal), U8(1), U8(4),
B(Inc), U8(15),
/* 66 E> */ B(StaGlobal), U8(1), U8(2),
/* 45 E> */ B(StackCheck),
B(JumpLoop), U8(50), I8(0),
/* 45 E> */ B(JumpLoop), U8(49), I8(0),
/* 149 S> */ B(LdaNamedPropertyNoFeedback), R(0), U8(4),
/* 156 S> */ B(Return),
]
@ -122,7 +121,7 @@ snippet: "
"
frame size: 3
parameter count: 1
bytecode array length: 69
bytecode array length: 68
bytecodes: [
/* 16 E> */ B(CreateMappedArguments),
B(Star), R(0),
@ -134,7 +133,7 @@ bytecodes: [
B(Star), R(1),
B(LdaSmi), I8(4),
/* 68 E> */ B(TestGreaterThan), R(1), U8(6),
B(JumpIfFalse), U8(43),
B(JumpIfFalse), U8(42),
/* 85 S> */ B(LdaGlobal), U8(0), U8(7),
B(Star), R(1),
B(LdaSmi), I8(2),
@ -148,8 +147,7 @@ bytecodes: [
/* 128 S> */ B(LdaGlobal), U8(1), U8(4),
B(Dec), U8(15),
/* 129 E> */ B(StaGlobal), U8(1), U8(2),
/* 60 E> */ B(StackCheck),
B(JumpLoop), U8(50), I8(0),
/* 60 E> */ B(JumpLoop), U8(49), I8(0),
/* 168 S> */ B(LdaNamedPropertyNoFeedback), R(0), U8(4),
/* 175 S> */ B(Return),
]
@ -180,7 +178,7 @@ snippet: "
"
frame size: 3
parameter count: 1
bytecode array length: 69
bytecode array length: 68
bytecodes: [
/* 16 E> */ B(CreateMappedArguments),
B(Star), R(0),
@ -205,9 +203,8 @@ bytecodes: [
B(Star), R(1),
B(LdaSmi), I8(4),
/* 141 E> */ B(TestGreaterThan), R(1), U8(15),
B(JumpIfFalse), U8(6),
/* 60 E> */ B(StackCheck),
B(JumpLoop), U8(50), I8(0),
B(JumpIfFalse), U8(5),
/* 60 E> */ B(JumpLoop), U8(49), I8(0),
/* 171 S> */ B(LdaNamedPropertyNoFeedback), R(0), U8(4),
/* 178 S> */ B(Return),
]

View File

@ -90,7 +90,7 @@ snippet: "
"
frame size: 7
parameter count: 1
bytecode array length: 122
bytecode array length: 121
bytecodes: [
/* 30 E> */ B(CreateBlockContext), U8(0),
B(PushContext), R(1),
@ -123,14 +123,13 @@ bytecodes: [
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(6), U8(1),
B(LdaNamedProperty), R(6), U8(7), U8(17),
B(JumpIfToBooleanTrue), U8(20),
B(JumpIfToBooleanTrue), U8(19),
B(LdaNamedProperty), R(6), U8(8), U8(8),
B(StaInArrayLiteral), R(3), R(2), U8(13),
B(Ldar), R(2),
B(Inc), U8(12),
B(Star), R(2),
B(StackCheck),
B(JumpLoop), U8(34), I8(0),
B(JumpLoop), U8(33), I8(0),
B(LdaSmi), I8(4),
B(StaInArrayLiteral), R(3), R(2), U8(13),
B(Mov), R(3), R(2),

View File

@ -79,7 +79,7 @@ snippet: "
"
frame size: 4
parameter count: 1
bytecode array length: 119
bytecode array length: 118
bytecodes: [
/* 7 S> */ B(LdaConstant), U8(0),
B(Star), R(2),
@ -95,7 +95,7 @@ bytecodes: [
B(Star), R(1),
B(LdaSmi), I8(5),
/* 77 E> */ B(TestLessThan), R(1), U8(6),
B(JumpIfFalse), U8(83),
B(JumpIfFalse), U8(82),
/* 97 S> */ B(LdaGlobal), U8(1), U8(7),
B(Star), R(1),
/* 106 E> */ B(LdaGlobal), U8(1), U8(7),
@ -123,8 +123,7 @@ bytecodes: [
/* 84 S> */ B(LdaGlobal), U8(2), U8(4),
B(Inc), U8(19),
/* 84 E> */ B(StaGlobal), U8(2), U8(2),
/* 63 E> */ B(StackCheck),
B(JumpLoop), U8(90), I8(0),
/* 63 E> */ B(JumpLoop), U8(89), I8(0),
B(Ldar), R(0),
/* 171 S> */ B(Return),
]
@ -153,7 +152,7 @@ snippet: "
"
frame size: 4
parameter count: 1
bytecode array length: 108
bytecode array length: 107
bytecodes: [
/* 7 S> */ B(LdaConstant), U8(0),
B(Star), R(2),
@ -167,7 +166,7 @@ bytecodes: [
B(Star), R(1),
B(LdaZero),
/* 72 E> */ B(TestGreaterThan), R(1), U8(4),
B(JumpIfFalse), U8(77),
B(JumpIfFalse), U8(76),
/* 87 S> */ B(LdaGlobal), U8(1), U8(5),
B(Star), R(1),
/* 97 E> */ B(LdaGlobal), U8(1), U8(5),
@ -193,8 +192,7 @@ bytecodes: [
/* 130 E> */ B(StaNamedProperty), R(1), U8(4), U8(15),
B(Mov), R(2), R(0),
B(Ldar), R(2),
/* 63 E> */ B(StackCheck),
B(JumpLoop), U8(83), I8(0),
/* 63 E> */ B(JumpLoop), U8(82), I8(0),
B(Ldar), R(0),
/* 163 S> */ B(Return),
]
@ -223,7 +221,7 @@ snippet: "
"
frame size: 4
parameter count: 1
bytecode array length: 80
bytecode array length: 79
bytecodes: [
/* 7 S> */ B(LdaConstant), U8(0),
B(Star), R(2),
@ -252,9 +250,8 @@ bytecodes: [
B(Star), R(1),
B(LdaSmi), I8(10),
/* 133 E> */ B(TestLessThan), R(1), U8(15),
B(JumpIfFalse), U8(6),
/* 77 E> */ B(StackCheck),
B(JumpLoop), U8(50), I8(0),
B(JumpIfFalse), U8(5),
/* 77 E> */ B(JumpLoop), U8(49), I8(0),
B(Ldar), R(0),
/* 146 S> */ B(Return),
]

View File

@ -16,7 +16,7 @@ snippet: "
"
frame size: 1
parameter count: 1
bytecode array length: 27
bytecode array length: 26
bytecodes: [
/* 45 S> */ B(LdaSmi), I8(1),
B(Star), R(0),
@ -26,9 +26,8 @@ bytecodes: [
/* 86 S> */ B(LdaSmi), I8(10),
/* 95 E> */ B(TestGreaterThan), R(0), U8(1),
B(JumpIfFalse), U8(4),
/* 101 S> */ B(Jump), U8(6),
/* 48 E> */ B(StackCheck),
B(JumpLoop), U8(17), I8(0),
/* 101 S> */ B(Jump), U8(5),
/* 48 E> */ B(JumpLoop), U8(16), I8(0),
/* 110 S> */ B(Ldar), R(0),
/* 122 S> */ B(Return),
]

View File

@ -15,19 +15,18 @@ snippet: "
"
frame size: 2
parameter count: 1
bytecode array length: 25
bytecode array length: 24
bytecodes: [
/* 30 S> */ B(LdaZero),
B(Star), R(0),
/* 35 S> */ B(LdaSmi), I8(10),
/* 35 E> */ B(TestLessThan), R(0), U8(0),
B(JumpIfFalse), U8(15),
B(JumpIfFalse), U8(14),
/* 56 S> */ B(Mov), R(0), R(1),
/* 43 S> */ B(Ldar), R(1),
B(Inc), U8(1),
B(Star), R(0),
/* 17 E> */ B(StackCheck),
B(JumpLoop), U8(17), I8(0),
/* 17 E> */ B(JumpLoop), U8(16), I8(0),
B(LdaUndefined),
/* 61 S> */ B(Return),
]
@ -45,7 +44,7 @@ snippet: "
"
frame size: 15
parameter count: 1
bytecode array length: 164
bytecode array length: 162
bytecodes: [
/* 10 E> */ B(CreateFunctionContext), U8(0), U8(4),
B(PushContext), R(4),
@ -89,10 +88,10 @@ bytecodes: [
B(JumpIfFalse), U8(4),
B(Jump), U8(6),
B(PopContext), R(6),
B(Jump), U8(78),
B(Jump), U8(76),
B(LdaSmi), I8(1),
B(TestEqual), R(2), U8(3),
B(JumpIfFalse), U8(54),
B(JumpIfFalse), U8(53),
/* 48 S> */ B(LdaLookupGlobalSlot), U8(3), U8(4), U8(3),
B(Star), R(7),
B(LdaConstant), U8(4),
@ -113,16 +112,14 @@ bytecodes: [
B(Star), R(2),
B(LdaCurrentContextSlot), U8(2),
B(Star), R(0),
/* 17 E> */ B(StackCheck),
B(JumpLoop), U8(56), I8(1),
/* 17 E> */ B(JumpLoop), U8(55), I8(1),
B(LdaSmi), I8(1),
B(TestEqual), R(2), U8(8),
B(JumpIfFalse), U8(6),
B(PopContext), R(6),
B(Jump), U8(8),
B(Jump), U8(7),
B(PopContext), R(6),
B(StackCheck),
B(JumpLoop), U8(123), I8(0),
B(JumpLoop), U8(121), I8(0),
B(PopContext), R(5),
B(LdaUndefined),
/* 61 S> */ B(Return),
@ -146,7 +143,7 @@ snippet: "
"
frame size: 6
parameter count: 1
bytecode array length: 105
bytecode array length: 103
bytecodes: [
/* 30 S> */ B(LdaZero),
B(Star), R(3),
@ -177,10 +174,10 @@ bytecodes: [
B(JumpIfFalse), U8(4),
B(Jump), U8(6),
B(PopContext), R(4),
B(Jump), U8(46),
B(Jump), U8(44),
B(LdaSmi), I8(1),
B(TestEqual), R(2), U8(3),
B(JumpIfFalse), U8(22),
B(JumpIfFalse), U8(21),
/* 48 S> */ B(CreateClosure), U8(1), U8(0), U8(2),
B(Star), R(5),
/* 74 E> */ B(CallUndefinedReceiver0), R(5), U8(4),
@ -188,16 +185,14 @@ bytecodes: [
B(Star), R(2),
B(LdaCurrentContextSlot), U8(2),
B(Star), R(0),
/* 17 E> */ B(StackCheck),
B(JumpLoop), U8(24), I8(1),
/* 17 E> */ B(JumpLoop), U8(23), I8(1),
B(LdaSmi), I8(1),
B(TestEqual), R(2), U8(6),
B(JumpIfFalse), U8(6),
B(PopContext), R(4),
B(Jump), U8(8),
B(Jump), U8(7),
B(PopContext), R(4),
B(StackCheck),
B(JumpLoop), U8(91), I8(0),
B(JumpLoop), U8(89), I8(0),
B(LdaUndefined),
/* 80 S> */ B(Return),
]
@ -217,7 +212,7 @@ snippet: "
"
frame size: 4
parameter count: 1
bytecode array length: 43
bytecode array length: 42
bytecodes: [
/* 37 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
B(Star), R(3),
@ -227,15 +222,14 @@ bytecodes: [
B(Star), R(1),
/* 55 S> */ B(LdaZero),
/* 55 E> */ B(TestGreaterThan), R(1), U8(5),
B(JumpIfFalse), U8(19),
B(JumpIfFalse), U8(18),
/* 75 S> */ B(Ldar), R(1),
/* 77 E> */ B(Add), R(0), U8(6),
B(Star), R(2),
/* 62 S> */ B(Ldar), R(1),
B(Dec), U8(7),
B(Star), R(1),
/* 17 E> */ B(StackCheck),
B(JumpLoop), U8(20), I8(0),
/* 17 E> */ B(JumpLoop), U8(19), I8(0),
B(LdaUndefined),
/* 84 S> */ B(Return),
]
@ -256,7 +250,7 @@ snippet: "
"
frame size: 5
parameter count: 1
bytecode array length: 66
bytecode array length: 65
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(Mov), R(closure), R(3),
@ -276,13 +270,12 @@ bytecodes: [
B(Star), R(1),
/* 36 S> */ B(LdaSmi), I8(10),
/* 36 E> */ B(TestLessThan), R(1), U8(0),
B(JumpIfFalse), U8(15),
B(JumpIfFalse), U8(14),
/* 57 S> */ B(Mov), R(1), R(2),
/* 44 S> */ B(Ldar), R(2),
B(Inc), U8(1),
B(Star), R(1),
/* 18 E> */ B(StackCheck),
B(JumpLoop), U8(17), I8(0),
/* 18 E> */ B(JumpLoop), U8(16), I8(0),
B(LdaUndefined),
/* 62 S> */ B(Return),
]
@ -303,7 +296,7 @@ snippet: "
"
frame size: 4
parameter count: 1
bytecode array length: 98
bytecode array length: 97
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(2),
B(Mov), R(closure), R(2),
@ -323,7 +316,7 @@ bytecodes: [
B(Star), R(1),
/* 36 S> */ B(LdaSmi), I8(10),
/* 36 E> */ B(TestLessThan), R(1), U8(0),
B(JumpIfFalse), U8(47),
B(JumpIfFalse), U8(46),
/* 47 S> */ B(LdaFalse),
B(Star), R(3),
B(Mov), R(1), R(2),
@ -340,8 +333,7 @@ bytecodes: [
/* 44 S> */ B(Ldar), R(1),
B(Inc), U8(1),
B(Star), R(1),
/* 18 E> */ B(StackCheck),
B(JumpLoop), U8(49), I8(0),
/* 18 E> */ B(JumpLoop), U8(48), I8(0),
B(LdaUndefined),
/* 56 S> */ B(Return),
]
@ -365,7 +357,7 @@ snippet: "
"
frame size: 8
parameter count: 1
bytecode array length: 80
bytecode array length: 79
bytecodes: [
B(Mov), R(closure), R(3),
B(Mov), R(this), R(4),
@ -376,13 +368,12 @@ bytecodes: [
B(Star), R(1),
/* 41 S> */ B(LdaSmi), I8(10),
/* 41 E> */ B(TestLessThan), R(1), U8(0),
B(JumpIfFalse), U8(15),
B(JumpIfFalse), U8(14),
/* 62 S> */ B(Mov), R(1), R(2),
/* 49 S> */ B(Ldar), R(2),
B(Inc), U8(1),
B(Star), R(1),
/* 23 E> */ B(StackCheck),
B(JumpLoop), U8(17), I8(0),
/* 23 E> */ B(JumpLoop), U8(16), I8(0),
B(LdaUndefined),
B(Star), R(5),
B(LdaFalse),
@ -409,7 +400,7 @@ constant pool: [
SCOPE_INFO_TYPE,
]
handlers: [
[15, 52, 52],
[15, 51, 51],
]
---
@ -421,7 +412,7 @@ snippet: "
"
frame size: 7
parameter count: 1
bytecode array length: 116
bytecode array length: 115
bytecodes: [
B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
B(Mov), R(closure), R(2),
@ -433,7 +424,7 @@ bytecodes: [
B(Star), R(1),
/* 41 S> */ B(LdaSmi), I8(10),
/* 41 E> */ B(TestLessThan), R(1), U8(0),
B(JumpIfFalse), U8(47),
B(JumpIfFalse), U8(46),
/* 52 S> */ B(Mov), R(0), R(3),
B(Mov), R(1), R(4),
B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionAwaitUncaught), R(3), U8(2),
@ -450,8 +441,7 @@ bytecodes: [
/* 49 S> */ B(Ldar), R(1),
B(Inc), U8(1),
B(Star), R(1),
/* 23 E> */ B(StackCheck),
B(JumpLoop), U8(49), I8(0),
/* 23 E> */ B(JumpLoop), U8(48), I8(0),
B(LdaUndefined),
B(Star), R(4),
B(LdaTrue),
@ -479,6 +469,6 @@ constant pool: [
SCOPE_INFO_TYPE,
]
handlers: [
[19, 88, 88],
[19, 87, 87],
]

View File

@ -91,7 +91,7 @@ snippet: "
"
frame size: 11
parameter count: 1
bytecode array length: 119
bytecode array length: 118
bytecodes: [
/* 128 E> */ B(CreateRestParameter),
B(Star), R(3),
@ -120,14 +120,13 @@ bytecodes: [
B(JumpIfJSReceiver), U8(7),
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(10), U8(1),
B(LdaNamedProperty), R(10), U8(1), U8(16),
B(JumpIfToBooleanTrue), U8(20),
B(JumpIfToBooleanTrue), U8(19),
B(LdaNamedProperty), R(10), U8(2), U8(10),
B(StaInArrayLiteral), R(7), R(6), U8(1),
B(Ldar), R(6),
B(Inc), U8(3),
B(Star), R(6),
B(StackCheck),
B(JumpLoop), U8(34), I8(0),
B(JumpLoop), U8(33), I8(0),
B(LdaSmi), I8(1),
B(StaInArrayLiteral), R(7), R(6), U8(1),
B(Mov), R(5), R(6),

View File

@ -15,18 +15,17 @@ snippet: "
"
frame size: 1
parameter count: 1
bytecode array length: 24
bytecode array length: 23
bytecodes: [
/* 42 S> */ B(LdaZero),
B(Star), R(0),
/* 54 S> */ B(LdaSmi), I8(10),
/* 54 E> */ B(TestEqual), R(0), U8(0),
B(JumpIfTrue), U8(13),
B(JumpIfTrue), U8(12),
/* 65 S> */ B(Ldar), R(0),
/* 71 E> */ B(AddSmi), I8(10), U8(1),
B(Star), R(0),
/* 45 E> */ B(StackCheck),
B(JumpLoop), U8(15), I8(0),
/* 45 E> */ B(JumpLoop), U8(14), I8(0),
/* 79 S> */ B(Ldar), R(0),
/* 88 S> */ B(Return),
]
@ -45,7 +44,7 @@ snippet: "
"
frame size: 1
parameter count: 1
bytecode array length: 21
bytecode array length: 20
bytecodes: [
/* 42 S> */ B(LdaFalse),
B(Star), R(0),
@ -54,9 +53,8 @@ bytecodes: [
B(Star), R(0),
/* 74 S> */ B(LdaFalse),
/* 74 E> */ B(TestEqual), R(0), U8(0),
B(JumpIfFalse), U8(6),
/* 49 E> */ B(StackCheck),
B(JumpLoop), U8(12), I8(0),
B(JumpIfFalse), U8(5),
/* 49 E> */ B(JumpLoop), U8(11), I8(0),
/* 85 S> */ B(Ldar), R(0),
/* 94 S> */ B(Return),
]

View File

@ -2143,7 +2143,7 @@ snippet: "
"
frame size: 158
parameter count: 1
bytecode array length: 592
bytecode array length: 591
bytecodes: [
/* 43 S> */ B(LdaZero),
B(Star), R(0),
@ -2467,7 +2467,7 @@ bytecodes: [
B(Wide), B(Star), R16(128),
/* 2166 S> */ B(LdaSmi), I8(64),
/* 2166 E> */ B(Wide), B(TestLessThan), R16(128), U16(0),
B(JumpIfFalse), U8(31),
B(JumpIfFalse), U8(30),
/* 2183 S> */ B(Wide), B(Ldar), R16(128),
/* 2189 E> */ B(Add), R(1), U8(1),
B(Wide), B(Mov), R16(1), R16(157),
@ -2475,8 +2475,7 @@ bytecodes: [
/* 2176 S> */ B(Wide), B(Ldar), R16(128),
B(Inc), U8(2),
B(Wide), B(Star), R16(128),
/* 2146 E> */ B(StackCheck),
B(JumpLoop), U8(36), I8(0),
/* 2146 E> */ B(JumpLoop), U8(35), I8(0),
/* 2195 S> */ B(Wide), B(Ldar), R16(128),
/* 2207 S> */ B(Return),
]
@ -2650,7 +2649,7 @@ snippet: "
"
frame size: 163
parameter count: 1
bytecode array length: 623
bytecode array length: 622
bytecodes: [
/* 43 S> */ B(LdaZero),
B(Star), R(0),
@ -2971,14 +2970,14 @@ bytecodes: [
/* 2146 S> */ B(LdaZero),
B(Star), R(1),
/* 2162 S> */ B(Ldar), R(0),
B(JumpIfUndefinedOrNull), U8(72),
B(JumpIfUndefinedOrNull), U8(71),
B(Wide), B(ToObject), R16(157),
B(Wide), B(ForInEnumerate), R16(157),
B(Wide), B(ForInPrepare), R16(158), U16(0),
B(LdaZero),
B(Wide), B(Star), R16(161),
/* 2154 S> */ B(Wide), B(ForInContinue), R16(161), R16(160),
B(JumpIfFalse), U8(45),
B(JumpIfFalse), U8(44),
B(Wide), B(ForInNext), R16(157), R16(161), R16(158), U16(0),
B(JumpIfUndefined), U8(21),
B(Wide), B(Star), R16(128),
@ -2988,8 +2987,7 @@ bytecodes: [
B(Star), R(1),
/* 2172 E> */ B(Wide), B(ForInStep), R16(161),
B(Wide), B(Star), R16(161),
/* 2149 E> */ B(StackCheck),
B(JumpLoop), U8(48), I8(0),
/* 2149 E> */ B(JumpLoop), U8(47), I8(0),
/* 2181 S> */ B(Ldar), R(1),
/* 2191 S> */ B(Return),
]

View File

@ -1555,7 +1555,7 @@ TEST(InterpreterJumps) {
IncrementRegister(&builder, reg, 1, scratch, GetIndex(slot)).Jump(&label[1]);
SetRegister(&builder, reg, 2048, scratch).Bind(&label[0]);
IncrementRegister(&builder, reg, 2, scratch, GetIndex(slot1))
.JumpLoop(&loop_header, 0);
.JumpLoop(&loop_header, 0, 0);
SetRegister(&builder, reg, 4096, scratch).Bind(&label[1]);
IncrementRegister(&builder, reg, 4, scratch, GetIndex(slot2))
.LoadAccumulatorWithRegister(reg)

View File

@ -0,0 +1,2 @@
Check pause on OOM
reason: OOM

View File

@ -0,0 +1,39 @@
// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --max-old-space-size=16
let { session, contextGroup, Protocol } = InspectorTest.start('Check pause on OOM');
var script = `
var arr = [];
var stop = false;
function generateGarbage() {
while(!stop) {`
// Force the JumpLoop to be ExtraWide.
for (i = 0; i < 110; ++i) {
for (j = 0; j < 75; ++j) {
script += `arr.push(new Array(1000));`
script += `if (stop) { break; }`
}
}
script += `
}
}
//# sourceURL=test.js"`
contextGroup.addScript(script, 10, 26);
Protocol.Debugger.onPaused((message) => {
InspectorTest.log(`reason: ${message.params.reason}`);
Protocol.Debugger.evaluateOnCallFrame({
callFrameId: message.params.callFrames[0].callFrameId,
expression: 'arr = []; stop = true;'
}).then(() => Protocol.Debugger.resume());
});
Protocol.Debugger.enable();
Protocol.Runtime.evaluate({ expression: 'generateGarbage()' })
.then(InspectorTest.completeTest);

View File

@ -0,0 +1,2 @@
Check pause on OOM
reason: OOM

View File

@ -0,0 +1,37 @@
// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --max-old-space-size=16
let { session, contextGroup, Protocol } = InspectorTest.start('Check pause on OOM');
var script = `
var arr = [];
var stop = false;
function generateGarbage() {
while(!stop) {`
// Force the JumpLoop to be Wide.
for (i = 0; i < 37; ++i) {
script += `arr.push(new Array(1000));`
script += `if (stop) { break; }`
}
script += `
}
}
//# sourceURL=test.js"`
contextGroup.addScript(script, 10, 26);
Protocol.Debugger.onPaused((message) => {
InspectorTest.log(`reason: ${message.params.reason}`);
Protocol.Debugger.evaluateOnCallFrame({
callFrameId: message.params.callFrames[0].callFrameId,
expression: 'arr = []; stop = true;'
}).then(() => Protocol.Debugger.resume());
});
Protocol.Debugger.enable();
Protocol.Runtime.evaluate({ expression: 'generateGarbage()' })
.then(InspectorTest.completeTest);

View File

@ -257,9 +257,6 @@ TEST_F(BytecodeAnalysisTest, SimpleLoop) {
loop_builder.BindContinueTarget();
loop_builder.JumpToHeader(0, nullptr);
// TODO(solanes): Remove the liveness of the Stack Check once it is
// implicit.
expected_liveness.emplace_back("L.L.", "L.L.");
expected_liveness.emplace_back("L.L.", "L.L.");
}
@ -365,9 +362,6 @@ TEST_F(BytecodeAnalysisTest, DiamondInLoop) {
loop_builder.BindContinueTarget();
loop_builder.JumpToHeader(0, nullptr);
// TODO(solanes): Remove the liveness of the Stack Check once it is
// implicit.
expected_liveness.emplace_back("L...", "L...");
expected_liveness.emplace_back("L...", "L...");
}
@ -440,17 +434,11 @@ TEST_F(BytecodeAnalysisTest, KillingLoopInsideLoop) {
inner_loop_builder.BindContinueTarget();
inner_loop_builder.JumpToHeader(1, &loop_builder);
// TODO(solanes): Remove the liveness of the Stack Check once it is
// implicit.
expected_liveness.emplace_back(".L..", ".L..");
expected_liveness.emplace_back(".L..", ".L..");
}
loop_builder.BindContinueTarget();
loop_builder.JumpToHeader(0, nullptr);
// TODO(solanes): Remove the liveness of the Stack Check once it is
// implicit.
expected_liveness.emplace_back("LL..", "LL..");
expected_liveness.emplace_back("LL..", "LL..");
}

View File

@ -312,7 +312,7 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) {
.Bind(&after_jump10)
.JumpIfFalse(ToBooleanMode::kAlreadyBoolean, &after_jump11)
.Bind(&after_jump11)
.JumpLoop(&loop_header, 0)
.JumpLoop(&loop_header, 0, 0)
.Bind(&after_loop);
}
@ -710,12 +710,14 @@ TEST_F(BytecodeArrayBuilderTest, BackwardJumps) {
BytecodeLoopHeader loop_header;
builder.JumpIfNull(&after_loop)
.Bind(&loop_header)
.JumpLoop(&loop_header, 0)
.JumpLoop(&loop_header, 0, 0)
.Bind(&after_loop);
for (int i = 0; i < 42; i++) {
BytecodeLabel after_loop;
// Conditional jump to force the code after the JumpLoop to be live.
builder.JumpIfNull(&after_loop).JumpLoop(&loop_header, 0).Bind(&after_loop);
builder.JumpIfNull(&after_loop)
.JumpLoop(&loop_header, 0, 0)
.Bind(&after_loop);
}
// Add padding to force wide backwards jumps.
@ -723,7 +725,7 @@ TEST_F(BytecodeArrayBuilderTest, BackwardJumps) {
builder.Debugger();
}
builder.JumpLoop(&loop_header, 0);
builder.JumpLoop(&loop_header, 0, 0);
builder.Bind(&end);
builder.Return();