Commit e43fbde7 authored by oth's avatar oth Committed by Commit bot

[Interpreter] Preserve source positions in peephole optimizer.

The original peephole optimizer logic in the BytecodeArrayBuilder did
not respect source positions as it was written before there were
bytecode source positions. This led to some minor differences to
FCG and was problematic when combined with pending bytecode
optimizations. This change makes the new peephole optimizer fully
respect source positions.

BUG=v8:4280
LOG=N

Review-Url: https://codereview.chromium.org/1998203002
Cr-Commit-Position: refs/heads/master@{#36439}
parent 8d5d9e18
......@@ -94,7 +94,8 @@ bool BytecodePeepholeOptimizer::LastBytecodePutsNameInAccumulator() const {
GetConstantForIndexOperand(&last_, 0)->IsName()));
}
void BytecodePeepholeOptimizer::UpdateCurrentBytecode(BytecodeNode* current) {
void BytecodePeepholeOptimizer::UpdateLastAndCurrentBytecodes(
BytecodeNode* current) {
if (Bytecodes::IsJumpIfToBoolean(current->bytecode()) &&
Bytecodes::WritesBooleanToAccumulator(last_.bytecode())) {
// Conditional jumps with boolean conditions are emitted in
......@@ -111,6 +112,18 @@ void BytecodePeepholeOptimizer::UpdateCurrentBytecode(BytecodeNode* current) {
// put a boolean value in the accumulator.
current->set_bytecode(Bytecode::kLogicalNot);
}
if (current->source_info().is_statement() &&
last_.source_info().is_expression() &&
Bytecodes::IsWithoutExternalSideEffects(last_.bytecode())) {
// The last bytecode has been marked as expression. It has no
// external effects so can't throw and the current bytecode is a
// source position. Remove the expression position on the last
// bytecode to open up potential peephole optimizations and to
// save the memory and perf cost of storing the unneeded
// expression position.
last_.source_info().set_invalid();
}
}
bool BytecodePeepholeOptimizer::CanElideCurrent(
......@@ -134,6 +147,44 @@ bool BytecodePeepholeOptimizer::CanElideCurrent(
}
}
bool BytecodePeepholeOptimizer::CanElideLastBasedOnSourcePosition(
const BytecodeNode* const current) const {
//
// The rules for allowing the elision of the last bytecode based
// on source position are:
//
// C U R R E N T
// +--------+--------+--------+
// | None | Expr | Stmt |
// L +--------+--------+--------+--------+
// | None | YES | YES | YES |
// A +--------+--------+--------+--------+
// | Expr | YES | MAYBE | MAYBE |
// S +--------+--------+--------+--------+
// | Stmt | YES | NO | NO |
// T +--------+--------+--------+--------+
//
// The goal is not lose any statement positions and not lose useful
// expression positions. Whenever the last bytecode is elided it's
// source position information is applied to the current node
// updating it if necessary.
//
//
// The last bytecode can be elided for the MAYBE cases if the last
// bytecode is known not to throw. If it throws, the system would
// not have correct stack trace information. The appropriate check
// for this would be Bytecodes::IsWithoutExternalSideEffects(), which
// is checked in BytecodePeepholeOptimizer::UpdateLastAndCurrentBytecodes()
// to keep the check here simple.
//
// In rare cases, bytecode generation produces consecutive bytecodes
// with the same expression positions. In principle, the latter of
// these can be elided, but would make this function more expensive.
//
return (!last_.source_info().is_valid() ||
!current->source_info().is_valid());
}
bool BytecodePeepholeOptimizer::CanElideLast(
const BytecodeNode* const current) const {
if (!last_is_discardable_) {
......@@ -141,8 +192,7 @@ bool BytecodePeepholeOptimizer::CanElideLast(
}
if (last_.bytecode() == Bytecode::kNop) {
// Nop are placeholders for holding source position information
// and can be elided.
// Nop are placeholders for holding source position information.
return true;
} else if (Bytecodes::IsAccumulatorLoadWithoutEffects(current->bytecode()) &&
Bytecodes::IsAccumulatorLoadWithoutEffects(last_.bytecode())) {
......@@ -156,18 +206,16 @@ bool BytecodePeepholeOptimizer::CanElideLast(
}
BytecodeNode* BytecodePeepholeOptimizer::Optimize(BytecodeNode* current) {
UpdateCurrentBytecode(current);
UpdateLastAndCurrentBytecodes(current);
if (CanElideCurrent(current)) {
if (current->source_info().is_valid()) {
current->set_bytecode(Bytecode::kNop);
} else {
current = nullptr;
}
} else if (CanElideLast(current)) {
if (last_.source_info().is_valid()) {
} else if (CanElideLast(current) &&
CanElideLastBasedOnSourcePosition(current)) {
current->source_info().Update(last_.source_info());
}
InvalidateLast();
}
return current;
......
......@@ -29,9 +29,11 @@ class BytecodePeepholeOptimizer final : public BytecodePipelineStage,
private:
BytecodeNode* Optimize(BytecodeNode* current);
void UpdateCurrentBytecode(BytecodeNode* const current);
void UpdateLastAndCurrentBytecodes(BytecodeNode* const current);
bool CanElideCurrent(const BytecodeNode* const current) const;
bool CanElideLast(const BytecodeNode* const current) const;
bool CanElideLastBasedOnSourcePosition(
const BytecodeNode* const current) const;
void InvalidateLast();
bool LastIsValid() const;
......
......@@ -12,7 +12,6 @@ namespace internal {
namespace interpreter {
void BytecodeSourceInfo::Update(const BytecodeSourceInfo& entry) {
DCHECK(entry.is_valid());
if (!is_valid() || (entry.is_statement() && !is_statement()) ||
(entry.is_statement() && is_statement() &&
entry.source_position() > source_position())) {
......@@ -116,7 +115,7 @@ void BytecodeNode::Print(std::ostream& os) const {
os.copyfmt(saved_state);
if (source_info_.is_valid()) {
os << source_info_;
os << ' ' << source_info_;
}
os << '\n';
#else
......
......@@ -52,6 +52,7 @@ class BytecodeSourceInfo final {
}
bool is_statement() const { return is_valid() && is_statement_; }
bool is_expression() const { return is_valid() && !is_statement_; }
bool is_valid() const { return source_position_ != kUninitializedPosition; }
void set_invalid() { source_position_ = kUninitializedPosition; }
......
......@@ -488,6 +488,15 @@ bool Bytecodes::IsPrefixScalingBytecode(Bytecode bytecode) {
}
}
// static
bool Bytecodes::IsWithoutExternalSideEffects(Bytecode bytecode) {
// These bytecodes only manipulate interpreter frame state and will
// never throw.
return (IsAccumulatorLoadWithoutEffects(bytecode) || IsLdarOrStar(bytecode) ||
bytecode == Bytecode::kMov || bytecode == Bytecode::kNop ||
IsJump(bytecode));
}
// static
bool Bytecodes::IsJumpOrReturn(Bytecode bytecode) {
return bytecode == Bytecode::kReturn || IsJump(bytecode);
......
......@@ -565,6 +565,10 @@ class Bytecodes {
// Returns true if the bytecode is a scaling prefix bytecode.
static bool IsPrefixScalingBytecode(Bytecode bytecode);
// Returns true if the bytecode has no effects outside the current
// interpreter frame.
static bool IsWithoutExternalSideEffects(Bytecode bytecode);
// Returns true if |operand_type| is any type of register operand.
static bool IsRegisterOperandType(OperandType operand_type);
......
......@@ -35,7 +35,7 @@ bytecode array length: 39
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(1),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 45 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(3),
B(Star), R(2),
B(LdaZero),
......@@ -86,7 +86,7 @@ bytecode array length: 69
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(1),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 45 S> */ B(CreateArrayLiteral), U8(0), U8(2), U8(2),
B(Star), R(2),
B(LdaZero),
......
......@@ -18,9 +18,9 @@ bytecode array length: 25
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaZero),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 49 S> */ B(LdaSmi), U8(1),
/* 49 E> */ B(Star), R(1),
B(Star), R(1),
/* 52 S> */ B(LdaSmi), U8(2),
/* 62 E> */ B(Star), R(0),
B(LdaSmi), U8(3),
......@@ -28,7 +28,7 @@ bytecodes: [
B(LdaSmi), U8(4),
/* 76 E> */ B(Star), R(0),
B(LdaSmi), U8(5),
/* 83 E> */ B(Star), R(1),
B(Star), R(1),
/* 89 S> */ B(Return),
]
constant pool: [
......@@ -44,14 +44,15 @@ snippet: "
"
frame size: 2
parameter count: 1
bytecode array length: 12
bytecode array length: 13
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(55),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 57 S> */ B(LdaSmi), U8(100),
/* 57 E> */ B(Star), R(0),
/* 57 E> */ B(Star), R(1),
B(Star), R(1),
/* 65 S> */ B(Nop),
/* 75 S> */ B(Return),
]
constant pool: [
......@@ -67,11 +68,11 @@ snippet: "
"
frame size: 3
parameter count: 1
bytecode array length: 24
bytecode array length: 25
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(55),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 46 S> */ B(Star), R(1),
B(LdaSmi), U8(100),
/* 57 E> */ B(Star), R(0),
......@@ -80,7 +81,8 @@ bytecodes: [
B(LdaSmi), U8(101),
/* 69 E> */ B(Star), R(0),
B(Add), R(2),
/* 48 E> */ B(Star), R(0),
B(Star), R(0),
/* 77 S> */ B(Nop),
/* 87 S> */ B(Return),
]
constant pool: [
......@@ -97,11 +99,11 @@ snippet: "
"
frame size: 3
parameter count: 1
bytecode array length: 32
bytecode array length: 33
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(55),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 46 S> */ B(LdaSmi), U8(56),
/* 53 E> */ B(Star), R(0),
B(Star), R(1),
......@@ -111,11 +113,12 @@ bytecodes: [
B(LdaSmi), U8(57),
/* 68 E> */ B(Star), R(0),
B(Add), R(2),
/* 48 E> */ B(Star), R(0),
B(Star), R(0),
/* 75 S> */ B(ToNumber),
B(Star), R(1),
B(Inc),
/* 76 E> */ B(Star), R(0),
B(Star), R(0),
/* 80 S> */ B(Nop),
/* 90 S> */ B(Return),
]
constant pool: [
......@@ -131,11 +134,11 @@ snippet: "
"
frame size: 4
parameter count: 1
bytecode array length: 32
bytecode array length: 33
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(55),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 76 S> */ B(Star), R(2),
B(LdaSmi), U8(1),
/* 61 E> */ B(Star), R(0),
......@@ -148,7 +151,8 @@ bytecodes: [
B(LdaSmi), U8(3),
/* 81 E> */ B(Star), R(0),
B(Add), R(2),
/* 76 E> */ B(Star), R(1),
B(Star), R(1),
/* 87 S> */ B(Nop),
/* 97 S> */ B(Return),
]
constant pool: [
......@@ -164,11 +168,11 @@ snippet: "
"
frame size: 3
parameter count: 1
bytecode array length: 32
bytecode array length: 33
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(55),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 76 S> */ B(Star), R(1),
B(LdaSmi), U8(1),
/* 61 E> */ B(Star), R(0),
......@@ -181,7 +185,8 @@ bytecodes: [
B(LdaSmi), U8(3),
/* 81 E> */ B(Star), R(0),
B(Add), R(1),
/* 76 E> */ B(Star), R(0),
B(Star), R(0),
/* 87 S> */ B(Nop),
/* 97 S> */ B(Return),
]
constant pool: [
......@@ -200,9 +205,9 @@ bytecode array length: 70
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(10),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 50 S> */ B(LdaSmi), U8(20),
/* 50 E> */ B(Star), R(1),
B(Star), R(1),
/* 54 S> */ B(Ldar), R(0),
B(Star), R(2),
B(LdaSmi), U8(1),
......@@ -251,7 +256,7 @@ bytecode array length: 37
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(17),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 46 S> */ B(LdaSmi), U8(1),
B(Star), R(1),
/* 57 E> */ B(Ldar), R(0),
......
......@@ -17,7 +17,7 @@ bytecode array length: 21
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(1),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 45 S> */ B(JumpIfToBooleanTrue), U8(9),
/* 54 E> */ B(Ldar), R(0),
B(Star), R(1),
......@@ -44,7 +44,7 @@ bytecode array length: 21
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(1),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 45 S> */ B(JumpIfToBooleanFalse), U8(9),
/* 54 E> */ B(Ldar), R(0),
B(Star), R(1),
......@@ -71,7 +71,7 @@ bytecode array length: 26
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(1),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 45 S> */ B(JumpIfToBooleanTrue), U8(9),
/* 55 E> */ B(Ldar), R(0),
B(Star), R(1),
......
......@@ -15,11 +15,12 @@ snippet: "
"
frame size: 1
parameter count: 1
bytecode array length: 5
bytecode array length: 6
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaZero),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 88 S> */ B(Nop),
/* 98 S> */ B(Return),
]
constant pool: [
......@@ -37,11 +38,12 @@ snippet: "
"
frame size: 1
parameter count: 1
bytecode array length: 5
bytecode array length: 6
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaZero),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 77 S> */ B(Nop),
/* 87 S> */ B(Return),
]
constant pool: [
......@@ -67,7 +69,7 @@ bytecode array length: 66
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaZero),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 53 S> */ B(LdaSmi), U8(1),
/* 53 E> */ B(Star), R(1),
/* 65 S> */ B(Ldar), R(0),
......@@ -80,12 +82,12 @@ bytecodes: [
B(Star), R(2),
B(LdaSmi), U8(12),
B(Mul), R(2),
/* 77 E> */ B(Star), R(1),
B(Star), R(1),
/* 89 S> */ B(Ldar), R(0),
B(Star), R(2),
B(LdaSmi), U8(1),
B(Add), R(2),
/* 91 E> */ B(Star), R(0),
B(Star), R(0),
/* 102 S> */ B(Star), R(2),
B(LdaSmi), U8(3),
/* 108 E> */ B(TestEqual), R(2),
......@@ -214,7 +216,7 @@ bytecodes: [
B(Star), R(1),
B(LdaSmi), U8(1),
B(Add), R(1),
/* 124 E> */ B(Star), R(0),
B(Star), R(0),
/* 135 S> */ B(Jump), U8(4),
B(Jump), U8(-48),
/* 144 S> */ B(Ldar), R(0),
......@@ -241,7 +243,7 @@ bytecode array length: 39
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(10),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 54 S> */ B(LdaSmi), U8(1),
/* 54 E> */ B(Star), R(1),
/* 64 S> */ B(Ldar), R(0),
......@@ -251,7 +253,7 @@ bytecodes: [
B(Star), R(2),
B(LdaSmi), U8(12),
B(Mul), R(2),
/* 73 E> */ B(Star), R(1),
B(Star), R(1),
/* 85 S> */ B(Ldar), R(0),
B(Star), R(2),
B(LdaSmi), U8(1),
......@@ -283,7 +285,7 @@ bytecode array length: 66
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaZero),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 53 S> */ B(LdaSmi), U8(1),
/* 53 E> */ B(Star), R(1),
/* 56 E> */ B(StackCheck),
......@@ -291,7 +293,7 @@ bytecodes: [
B(Star), R(2),
B(LdaSmi), U8(10),
B(Mul), R(2),
/* 65 E> */ B(Star), R(1),
B(Star), R(1),
/* 77 S> */ B(Ldar), R(0),
B(Star), R(2),
B(LdaSmi), U8(5),
......@@ -338,7 +340,7 @@ bytecode array length: 37
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(10),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 54 S> */ B(LdaSmi), U8(1),
/* 54 E> */ B(Star), R(1),
/* 57 E> */ B(StackCheck),
......@@ -346,7 +348,7 @@ bytecodes: [
B(Star), R(2),
B(LdaSmi), U8(12),
B(Mul), R(2),
/* 66 E> */ B(Star), R(1),
B(Star), R(1),
/* 78 S> */ B(Ldar), R(0),
B(Star), R(2),
B(LdaSmi), U8(1),
......@@ -379,7 +381,7 @@ bytecode array length: 54
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaZero),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 53 S> */ B(LdaSmi), U8(1),
/* 53 E> */ B(Star), R(1),
/* 56 E> */ B(StackCheck),
......@@ -387,7 +389,7 @@ bytecodes: [
B(Star), R(2),
B(LdaSmi), U8(10),
B(Mul), R(2),
/* 65 E> */ B(Star), R(1),
B(Star), R(1),
/* 77 S> */ B(Ldar), R(0),
B(Star), R(2),
B(LdaSmi), U8(5),
......@@ -398,7 +400,7 @@ bytecodes: [
B(Star), R(2),
B(LdaSmi), U8(1),
B(Add), R(2),
/* 100 E> */ B(Star), R(0),
B(Star), R(0),
/* 111 S> */ B(Star), R(2),
B(LdaSmi), U8(6),
/* 117 E> */ B(TestEqual), R(2),
......@@ -429,7 +431,7 @@ bytecode array length: 56
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaZero),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 53 S> */ B(LdaSmi), U8(1),
/* 53 E> */ B(Star), R(1),
/* 56 E> */ B(StackCheck),
......@@ -437,7 +439,7 @@ bytecodes: [
B(Star), R(2),
B(LdaSmi), U8(10),
B(Mul), R(2),
/* 65 E> */ B(Star), R(1),
B(Star), R(1),
/* 77 S> */ B(Ldar), R(0),
B(Star), R(2),
B(LdaSmi), U8(5),
......@@ -448,7 +450,7 @@ bytecodes: [
B(Star), R(2),
B(LdaSmi), U8(1),
B(Add), R(2),
/* 100 E> */ B(Star), R(0),
B(Star), R(0),
/* 111 S> */ B(Star), R(2),
B(LdaSmi), U8(6),
/* 117 E> */ B(TestEqual), R(2),
......@@ -645,7 +647,7 @@ bytecode array length: 44
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaZero),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 58 S> */ B(LdaZero),
/* 58 E> */ B(Star), R(1),
/* 63 S> */ B(Ldar), R(1),
......@@ -658,7 +660,7 @@ bytecodes: [
B(Star), R(2),
B(LdaSmi), U8(1),
B(Add), R(2),
/* 87 E> */ B(Star), R(0),
B(Star), R(0),
/* 98 S> */ B(Jump), U8(2),
/* 72 S> */ B(Ldar), R(1),
B(Star), R(2),
......@@ -688,7 +690,7 @@ bytecode array length: 34
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(1),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 58 S> */ B(LdaSmi), U8(10),
/* 58 E> */ B(Star), R(1),
/* 62 S> */ B(Ldar), R(1),
......@@ -725,9 +727,9 @@ bytecode array length: 10
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaZero),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 58 S> */ B(LdaZero),
/* 58 E> */ B(Star), R(1),
B(Star), R(1),
/* 91 S> */ B(Ldar), R(0),
/* 101 S> */ B(Return),
]
......@@ -751,7 +753,7 @@ bytecode array length: 38
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaZero),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 58 S> */ B(LdaZero),
/* 58 E> */ B(Star), R(1),
/* 45 E> */ B(StackCheck),
......@@ -759,7 +761,7 @@ bytecodes: [
B(Star), R(2),
B(LdaSmi), U8(1),
B(Add), R(2),
/* 78 E> */ B(Star), R(0),
B(Star), R(0),
/* 89 S> */ B(Star), R(2),
B(LdaSmi), U8(20),
/* 95 E> */ B(TestEqual), R(2),
......
......@@ -23,11 +23,11 @@ bytecode array length: 17
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaZero),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 56 S> */ B(Star), R(1),
B(LdaSmi), U8(1),
B(Add), R(1),
/* 58 E> */ B(Star), R(0),
B(Star), R(0),
/* 69 S> */ B(Jump), U8(2),
/* 97 S> */ B(Ldar), R(0),
/* 107 S> */ B(Return),
......@@ -56,7 +56,7 @@ bytecode array length: 72
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 44 S> */ B(LdaZero),
/* 44 E> */ B(Star), R(0),
B(Star), R(0),
/* 71 S> */ B(LdaZero),
/* 71 E> */ B(Star), R(1),
/* 76 S> */ B(Ldar), R(1),
......@@ -75,7 +75,7 @@ bytecodes: [
/* 93 E> */ B(StackCheck),
/* 129 S> */ B(Ldar), R(0),
B(Inc),
/* 131 E> */ B(Star), R(0),
B(Star), R(0),
/* 142 S> */ B(Ldar), R(1),
B(Star), R(3),
/* 150 E> */ B(Ldar), R(2),
......
......@@ -223,7 +223,7 @@ bytecodes: [
B(Star), R(4),
B(CallRuntime), U16(Runtime::kToFastProperties), R(3), U8(1),
B(Star), R(0),
/* 49 E> */ B(Star), R(1),
B(Star), R(1),
/* 87 S> */ B(JumpIfNotHole), U8(11),
B(LdaConstant), U8(2),
B(Star), R(4),
......
......@@ -17,7 +17,7 @@ bytecode array length: 15
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(1),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 45 S> */ B(Star), R(1),
B(LdaSmi), U8(2),
B(Add), R(1),
......@@ -40,7 +40,7 @@ bytecode array length: 15
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(1),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 45 S> */ B(Star), R(1),
B(LdaSmi), U8(2),
B(Div), R(1),
......@@ -64,7 +64,7 @@ bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
B(Star), R(1),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 54 S> */ B(Star), R(1),
B(LoadIC), R(1), U8(1), U8(1),
B(Star), R(2),
......@@ -92,7 +92,7 @@ bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
B(Star), R(1),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 52 S> */ B(Star), R(1),
B(LdaSmi), U8(1),
B(Star), R(2),
......
......@@ -40,7 +40,7 @@ bytecodes: [
B(Star), R(0),
/* 30 E> */ B(StackCheck),
/* 44 S> */ B(LdaSmi), U8(10),
/* 44 E> */ B(Star), R(0),
B(Star), R(0),
/* 48 S> */ B(JumpIfNotHole), U8(11),
B(LdaConstant), U8(0),
B(Star), R(1),
......@@ -74,7 +74,7 @@ bytecodes: [
B(CallRuntime), U16(Runtime::kThrowConstAssignError), R(0), U8(0),
B(Ldar), R(1),
B(Star), R(0),
/* 48 E> */ B(LdaUndefined),
B(LdaUndefined),
/* 55 S> */ B(Return),
]
constant pool: [
......@@ -95,7 +95,7 @@ bytecodes: [
B(Star), R(0),
/* 30 E> */ B(StackCheck),
/* 44 S> */ B(LdaSmi), U8(10),
/* 44 E> */ B(Star), R(0),
B(Star), R(0),
/* 48 S> */ B(LdaSmi), U8(20),
/* 50 E> */ B(Star), R(1),
B(Ldar), R(0),
......
......@@ -46,7 +46,7 @@ bytecodes: [
B(StaContextSlot), R(context), U8(4),
/* 10 E> */ B(StackCheck),
/* 27 S> */ B(CreateClosure), U8(0), U8(0),
/* 27 E> */ B(Star), R(0),
B(Star), R(0),
/* 53 S> */ B(LdaContextSlot), R(context), U8(4),
/* 66 S> */ B(Return),
]
......
......@@ -17,9 +17,9 @@ bytecode array length: 9
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(1),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 45 S> */ B(Inc),
/* 54 E> */ B(Star), R(0),
B(Star), R(0),
/* 57 S> */ B(Return),
]
constant pool: [
......@@ -37,7 +37,7 @@ bytecode array length: 14
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(1),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 45 S> */ B(ToNumber),
B(Star), R(1),
B(Inc),
......@@ -60,9 +60,9 @@ bytecode array length: 9
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(1),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 45 S> */ B(Dec),
/* 54 E> */ B(Star), R(0),
B(Star), R(0),
/* 57 S> */ B(Return),
]
constant pool: [
......@@ -80,7 +80,7 @@ bytecode array length: 14
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(1),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 45 S> */ B(ToNumber),
B(Star), R(1),
B(Dec),
......@@ -104,7 +104,7 @@ bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
B(Star), R(1),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 54 S> */ B(Star), R(1),
B(LoadIC), R(1), U8(1), U8(1),
B(ToNumber),
......@@ -132,7 +132,7 @@ bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
B(Star), R(1),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 54 S> */ B(Star), R(1),
B(LoadIC), R(1), U8(1), U8(1),
B(Dec),
......@@ -156,10 +156,10 @@ bytecode array length: 33
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 45 S> */ B(LdaConstant), U8(0),
/* 45 E> */ B(Star), R(0),
B(Star), R(0),
/* 60 S> */ B(CreateObjectLiteral), U8(1), U8(0), U8(1),
B(Star), R(2),
/* 60 E> */ B(Star), R(1),
B(Star), R(1),
/* 72 S> */ B(Star), R(2),
/* 81 E> */ B(Ldar), R(0),
B(Star), R(3),
......@@ -188,10 +188,10 @@ bytecode array length: 28
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 45 S> */ B(LdaConstant), U8(0),
/* 45 E> */ B(Star), R(0),
B(Star), R(0),
/* 60 S> */ B(CreateObjectLiteral), U8(1), U8(0), U8(1),
B(Star), R(2),
/* 60 E> */ B(Star), R(1),
B(Star), R(1),
/* 72 S> */ B(Star), R(2),
/* 83 E> */ B(Ldar), R(0),
B(Star), R(3),
......@@ -221,7 +221,7 @@ bytecodes: [
/* 42 S> */ B(LdaSmi), U8(1),
/* 42 E> */ B(StaContextSlot), R(context), U8(4),
/* 53 S> */ B(CreateClosure), U8(0), U8(0),
/* 53 E> */ B(Star), R(0),
B(Star), R(0),
/* 78 S> */ B(LdaContextSlot), R(context), U8(4),
B(Inc),
/* 87 E> */ B(StaContextSlot), R(context), U8(4),
......@@ -247,7 +247,7 @@ bytecodes: [
/* 42 S> */ B(LdaSmi), U8(1),
/* 42 E> */ B(StaContextSlot), R(context), U8(4),
/* 53 S> */ B(CreateClosure), U8(0), U8(0),
/* 53 E> */ B(Star), R(0),
B(Star), R(0),
/* 78 S> */ B(LdaContextSlot), R(context), U8(4),
B(ToNumber),
B(Star), R(2),
......@@ -272,9 +272,9 @@ bytecode array length: 28
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 44 S> */ B(LdaSmi), U8(1),
/* 44 E> */ B(Star), R(0),
B(Star), R(0),
/* 55 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(3),
/* 55 E> */ B(Star), R(1),
B(Star), R(1),
/* 63 S> */ B(Star), R(2),
B(Ldar), R(0),
B(ToNumber),
......
......@@ -70,7 +70,7 @@ bytecode array length: 13
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(1),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 45 S> */ B(JumpIfToBooleanFalse), U8(5),
/* 54 S> */ B(LdaSmi), U8(1),
/* 77 S> */ B(Return),
......
......@@ -18,7 +18,7 @@ bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
B(Star), R(1),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 56 S> */ B(Star), R(1),
B(LdaConstant), U8(1),
B(DeletePropertySloppy), R(1),
......@@ -42,7 +42,7 @@ bytecodes: [
/* 30 E> */ B(StackCheck),
/* 56 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
B(Star), R(1),
/* 56 E> */ B(Star), R(0),
B(Star), R(0),
/* 70 S> */ B(Star), R(1),
B(LdaConstant), U8(1),
B(DeletePropertyStrict), R(1),
......@@ -66,7 +66,7 @@ bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
B(Star), R(1),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 56 S> */ B(Star), R(1),
B(LdaSmi), U8(2),
B(DeletePropertySloppy), R(1),
......@@ -88,7 +88,7 @@ bytecode array length: 7
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(10),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 46 S> */ B(LdaFalse),
/* 63 S> */ B(Return),
]
......
......@@ -14,11 +14,12 @@ snippet: "
"
frame size: 2
parameter count: 1
bytecode array length: 6
bytecode array length: 7
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(Ldar), R(0),
/* 42 E> */ B(Star), R(1),
B(Star), R(1),
/* 50 S> */ B(Nop),
/* 60 S> */ B(Return),
]
constant pool: [
......@@ -32,14 +33,16 @@ snippet: "
"
frame size: 3
parameter count: 1
bytecode array length: 11
bytecode array length: 13
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 55 S> */ B(LdaSmi), U8(100),
/* 55 E> */ B(Star), R(1),
B(Star), R(1),
/* 42 S> */ B(LdaUndefined),
B(Star), R(0),
/* 42 E> */ B(Star), R(2),
/* 42 E> */ B(Nop),
B(Star), R(2),
/* 63 S> */ B(Nop),
/* 73 S> */ B(Return),
]
constant pool: [
......@@ -58,13 +61,13 @@ bytecodes: [
/* 30 E> */ B(StackCheck),
/* 34 E> */ B(StackCheck),
/* 56 S> */ B(LdaSmi), U8(10),
/* 56 E> */ B(Star), R(1),
B(Star), R(1),
/* 69 S> */ B(Inc),
/* 71 E> */ B(Star), R(1),
B(Star), R(0),
/* 74 S> */ B(Jump), U8(12),
/* 64 E> */ B(Ldar), R(0),
/* 62 E> */ B(Star), R(1),
B(Star), R(1),
/* 84 S> */ B(LdaSmi), U8(20),
/* 86 E> */ B(Star), R(1),
B(Jump), U8(-20),
......
......@@ -65,30 +65,31 @@ snippet: "
"
frame size: 8
parameter count: 1
bytecode array length: 45
bytecode array length: 46
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaConstant), U8(0),
/* 42 E> */ B(Star), R(1),
/* 68 S> */ B(JumpIfUndefined), U8(38),
B(JumpIfNull), U8(36),
B(Star), R(1),
/* 68 S> */ B(JumpIfUndefined), U8(39),
B(JumpIfNull), U8(37),
B(ToObject),
B(Star), R(3),
B(ForInPrepare), R(4),
B(LdaZero),
B(Star), R(7),
/* 63 S> */ B(ForInDone), R(7), R(6),
B(JumpIfTrue), U8(23),
B(JumpIfTrue), U8(24),
B(ForInNext), R(3), R(7), R(4), U8(1),
B(JumpIfUndefined), U8(10),
B(JumpIfUndefined), U8(11),
B(Star), R(0),
/* 54 E> */ B(StackCheck),
B(Ldar), R(0),
B(Star), R(2),
/* 73 S> */ B(Nop),
/* 85 S> */ B(Return),
B(ForInStep), R(7),
B(Star), R(7),
B(Jump), U8(-24),
B(Jump), U8(-25),
B(LdaUndefined),
/* 85 S> */ B(Return),
]
......@@ -109,7 +110,7 @@ bytecode array length: 57
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaZero),
/* 42 E> */ B(Star), R(1),
B(Star), R(1),
/* 59 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(3),
B(JumpIfUndefined), U8(47),
B(JumpIfNull), U8(45),
......@@ -158,7 +159,7 @@ bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
B(Star), R(1),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 77 S> */ B(CreateArrayLiteral), U8(1), U8(1), U8(3),
B(JumpIfUndefined), U8(79),
B(JumpIfNull), U8(77),
......@@ -218,7 +219,7 @@ bytecode array length: 69
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(3),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 72 S> */ B(CreateArrayLiteral), U8(1), U8(1), U8(3),
B(JumpIfUndefined), U8(56),
B(JumpIfNull), U8(54),
......
......@@ -34,7 +34,7 @@ bytecode array length: 12
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(Wide), B(LdaSmi), U16(1234),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 48 S> */ B(Wide), B(LdaSmi), U16(5678),
/* 61 S> */ B(Return),
]
......@@ -53,7 +53,7 @@ bytecode array length: 12
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(Wide), B(LdaSmi), U16(1234),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 48 S> */ B(Wide), B(LdaSmi), U16(1234),
/* 61 S> */ B(Return),
]
......
......@@ -40,7 +40,7 @@ bytecodes: [
B(Star), R(0),
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(10),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 46 S> */ B(JumpIfNotHole), U8(11),
B(LdaConstant), U8(0),
B(Star), R(1),
......@@ -73,7 +73,7 @@ bytecodes: [
B(CallRuntime), U16(Runtime::kThrowReferenceError), R(2), U8(1),
B(Ldar), R(1),
B(Star), R(0),
/* 45 E> */ B(LdaUndefined),
B(LdaUndefined),
/* 52 S> */ B(Return),
]
constant pool: [
......@@ -94,7 +94,7 @@ bytecodes: [
B(Star), R(0),
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(10),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 46 S> */ B(LdaSmi), U8(20),
/* 48 E> */ B(Star), R(1),
B(Ldar), R(0),
......
......@@ -17,7 +17,7 @@ bytecode array length: 9
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaZero),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 45 S> */ B(JumpIfToBooleanTrue), U8(4),
B(LdaSmi), U8(3),
/* 60 S> */ B(Return),
......@@ -37,7 +37,7 @@ bytecode array length: 15
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaZero),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 45 S> */ B(Star), R(1),
B(LdaSmi), U8(1),
/* 55 E> */ B(TestEqual), R(1),
......@@ -60,7 +60,7 @@ bytecode array length: 9
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaZero),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 45 S> */ B(JumpIfToBooleanFalse), U8(4),
B(LdaSmi), U8(3),
/* 60 S> */ B(Return),
......@@ -80,7 +80,7 @@ bytecode array length: 14
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaZero),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 45 S> */ B(Star), R(1),
B(LdaZero),
/* 55 E> */ B(TestEqual), R(1),
......@@ -103,7 +103,7 @@ bytecode array length: 9
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaZero),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 45 S> */ B(JumpIfToBooleanTrue), U8(4),
B(LdaSmi), U8(3),
/* 68 S> */ B(Return),
......@@ -119,17 +119,20 @@ snippet: "
"
frame size: 3
parameter count: 1
bytecode array length: 24
bytecode array length: 30
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(2),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 49 S> */ B(LdaSmi), U8(3),
/* 49 E> */ B(Star), R(1),
B(Star), R(1),
/* 56 S> */ B(LdaSmi), U8(4),
/* 56 E> */ B(Star), R(2),
B(Star), R(2),
/* 59 S> */ B(Ldar), R(0),
B(JumpIfToBooleanTrue), U8(8),
B(JumpIfToBooleanTrue), U8(14),
/* 72 E> */ B(Ldar), R(0),
/* 75 E> */ B(Ldar), R(1),
/* 78 E> */ B(Ldar), R(0),
/* 81 E> */ B(LdaSmi), U8(5),
/* 86 E> */ B(Star), R(2),
B(LdaSmi), U8(3),
......@@ -182,11 +185,11 @@ bytecode array length: 276
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(1),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 53 S> */ B(LdaSmi), U8(2),
/* 53 E> */ B(Star), R(1),
B(Star), R(1),
/* 60 S> */ B(LdaSmi), U8(3),
/* 60 E> */ B(Star), R(2),
B(Star), R(2),
/* 63 S> */ B(Ldar), R(0),
B(JumpIfToBooleanTrueConstant), U8(0),
B(LdaSmi), U8(1),
......@@ -368,11 +371,11 @@ bytecode array length: 275
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaZero),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 53 S> */ B(LdaSmi), U8(2),
/* 53 E> */ B(Star), R(1),
B(Star), R(1),
/* 60 S> */ B(LdaSmi), U8(3),
/* 60 E> */ B(Star), R(2),
B(Star), R(2),
/* 63 S> */ B(Ldar), R(0),
B(JumpIfToBooleanFalseConstant), U8(0),
B(LdaSmi), U8(1),
......@@ -554,11 +557,11 @@ bytecode array length: 282
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(1),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 53 S> */ B(LdaSmi), U8(2),
/* 53 E> */ B(Star), R(1),
B(Star), R(1),
/* 60 S> */ B(LdaSmi), U8(3),
/* 60 E> */ B(Star), R(2),
B(Star), R(2),
/* 63 S> */ B(Ldar), R(0),
B(Star), R(3),
B(LdaSmi), U8(3),
......@@ -743,11 +746,11 @@ bytecode array length: 281
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaZero),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 53 S> */ B(LdaSmi), U8(2),
/* 53 E> */ B(Star), R(1),
B(Star), R(1),
/* 60 S> */ B(LdaSmi), U8(3),
/* 60 E> */ B(Star), R(2),
B(Star), R(2),
/* 63 S> */ B(Ldar), R(0),
B(Star), R(3),
B(LdaSmi), U8(5),
......@@ -934,7 +937,7 @@ bytecode array length: 15
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(1),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 45 S> */ B(JumpIfToBooleanFalse), U8(4),
B(LdaSmi), U8(3),
B(JumpIfToBooleanTrue), U8(3),
......
......@@ -55,7 +55,7 @@ bytecode array length: 20
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(1),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 45 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
B(Star), R(1),
/* 75 E> */ B(Ldar), R(0),
......@@ -80,7 +80,7 @@ bytecode array length: 26
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(1),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 45 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
B(Star), R(1),
/* 59 E> */ B(Ldar), R(0),
......@@ -253,7 +253,7 @@ bytecode array length: 33
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(1),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 45 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
B(Star), R(1),
B(Mov), R(1), R(2),
......@@ -307,7 +307,7 @@ bytecode array length: 37
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaConstant), U8(0),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 50 S> */ B(CreateObjectLiteral), U8(1), U8(0), U8(35),
B(Star), R(1),
B(Mov), R(1), R(2),
......@@ -341,7 +341,7 @@ bytecode array length: 43
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaConstant), U8(0),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 50 S> */ B(CreateObjectLiteral), U8(1), U8(0), U8(1),
B(Star), R(1),
/* 64 E> */ B(Ldar), R(0),
......@@ -378,7 +378,7 @@ bytecode array length: 53
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaConstant), U8(0),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 50 S> */ B(CreateObjectLiteral), U8(1), U8(1), U8(35),
B(Star), R(1),
B(Mov), R(1), R(2),
......@@ -417,7 +417,7 @@ bytecode array length: 77
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaConstant), U8(0),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 50 S> */ B(CreateObjectLiteral), U8(1), U8(0), U8(35),
B(Star), R(1),
B(Mov), R(1), R(2),
......
......@@ -13,11 +13,12 @@ snippet: "
"
frame size: 1
parameter count: 1
bytecode array length: 5
bytecode array length: 6
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaZero),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 45 S> */ B(Nop),
/* 55 S> */ B(Return),
]
constant pool: [
......@@ -35,7 +36,7 @@ bytecode array length: 11
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaZero),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 45 S> */ B(Star), R(1),
B(LdaSmi), U8(3),
B(Add), R(1),
......@@ -56,7 +57,7 @@ bytecode array length: 11
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaZero),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 45 S> */ B(Star), R(1),
B(LdaSmi), U8(3),
B(Sub), R(1),
......@@ -77,7 +78,7 @@ bytecode array length: 12
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(4),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 45 S> */ B(Star), R(1),
B(LdaSmi), U8(3),
B(Mul), R(1),
......@@ -98,7 +99,7 @@ bytecode array length: 12
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(4),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 45 S> */ B(Star), R(1),
B(LdaSmi), U8(3),
B(Div), R(1),
......@@ -119,7 +120,7 @@ bytecode array length: 12
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(4),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 45 S> */ B(Star), R(1),
B(LdaSmi), U8(3),
B(Mod), R(1),
......@@ -140,7 +141,7 @@ bytecode array length: 12
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(1),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 45 S> */ B(Star), R(1),
B(LdaSmi), U8(2),
B(BitwiseOr), R(1),
......@@ -161,7 +162,7 @@ bytecode array length: 12
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(1),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 45 S> */ B(Star), R(1),
B(LdaSmi), U8(2),
B(BitwiseXor), R(1),
......@@ -182,7 +183,7 @@ bytecode array length: 12
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(1),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 45 S> */ B(Star), R(1),
B(LdaSmi), U8(2),
B(BitwiseAnd), R(1),
......@@ -203,7 +204,7 @@ bytecode array length: 12
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(10),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 46 S> */ B(Star), R(1),
B(LdaSmi), U8(3),
B(ShiftLeft), R(1),
......@@ -224,7 +225,7 @@ bytecode array length: 12
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(10),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 46 S> */ B(Star), R(1),
B(LdaSmi), U8(3),
B(ShiftRight), R(1),
......@@ -245,7 +246,7 @@ bytecode array length: 12
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(10),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 46 S> */ B(Star), R(1),
B(LdaSmi), U8(3),
B(ShiftRightLogical), R(1),
......@@ -266,7 +267,7 @@ bytecode array length: 7
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaZero),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 45 S> */ B(LdaSmi), U8(3),
/* 60 S> */ B(Return),
]
......
......@@ -28,7 +28,7 @@ bytecodes: [
B(Star), R(1),
/* 78 E> */ B(Ldar), R(0),
B(Add), R(1),
/* 69 E> */ B(Star), R(0),
B(Star), R(0),
/* 86 S> */ B(Star), R(1),
B(LdaSmi), U8(10),
/* 95 E> */ B(TestGreaterThan), R(1),
......@@ -64,7 +64,7 @@ bytecodes: [
B(Star), R(1),
/* 69 E> */ B(Ldar), R(0),
B(Add), R(1),
/* 60 E> */ B(Star), R(0),
B(Star), R(0),
/* 77 S> */ B(Star), R(1),
B(LdaSmi), U8(10),
/* 86 E> */ B(TestGreaterThan), R(1),
......@@ -86,15 +86,16 @@ snippet: "
"
frame size: 2
parameter count: 1
bytecode array length: 14
bytecode array length: 15
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 45 S> */ B(LdaSmi), U8(1),
/* 45 E> */ B(Star), R(0),
B(Star), R(0),
/* 50 S> */ B(Star), R(1),
/* 64 E> */ B(Ldar), R(0),
B(Add), R(1),
/* 55 E> */ B(Star), R(0),
B(Star), R(0),
/* 72 S> */ B(Nop),
/* 85 S> */ B(Return),
]
constant pool: [
......
......@@ -35,7 +35,7 @@ bytecode array length: 8
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaConstant), U8(0),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 58 S> */ B(LdaConstant), U8(1),
/* 82 S> */ B(Return),
]
......@@ -56,7 +56,7 @@ bytecode array length: 8
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaConstant), U8(0),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 57 S> */ B(LdaConstant), U8(0),
/* 79 S> */ B(Return),
]
......
......@@ -37,11 +37,12 @@ snippet: "
"
frame size: 1
parameter count: 1
bytecode array length: 6
bytecode array length: 7
bytecodes: [
/* 21 E> */ B(StackCheck),
B(Ldar), R(closure),
B(Star), R(0),
/* 26 S> */ B(Nop),
/* 36 S> */ B(Return),
]
constant pool: [
......
......@@ -52,7 +52,7 @@ bytecode array length: 12
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(1),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 45 S> */ B(JumpIfToBooleanFalse), U8(5),
/* 54 S> */ B(LdaConstant), U8(0),
/* 54 E> */ B(Throw),
......
......@@ -22,7 +22,7 @@ bytecode array length: 7
bytecodes: [
/* 10 E> */ B(StackCheck),
/* 24 S> */ B(LdaSmi), U8(13),
/* 24 E> */ B(Star), R(0),
B(Star), R(0),
/* 29 S> */ B(TypeOf),
/* 47 S> */ B(Return),
]
......
......@@ -86,7 +86,7 @@ bytecode array length: 13
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(101),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 47 S> */ B(Star), R(1),
B(LdaSmi), U8(3),
B(Mul), R(1),
......@@ -106,11 +106,11 @@ snippet: "
"
frame size: 4
parameter count: 1
bytecode array length: 23
bytecode array length: 24
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(Wide), B(LdaSmi), U16(1234),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 56 S> */ B(Star), R(2),
/* 66 E> */ B(Ldar), R(0),
B(Mul), R(2),
......@@ -118,7 +118,8 @@ bytecodes: [
B(LdaSmi), U8(1),
B(Sub), R(3),
B(LdaUndefined),
/* 56 E> */ B(Star), R(1),
B(Star), R(1),
/* 74 S> */ B(Nop),
/* 84 S> */ B(Return),
]
constant pool: [
......@@ -137,7 +138,7 @@ bytecode array length: 12
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(13),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 46 S> */ B(Star), R(1),
B(LdaSmi), U8(-1),
B(BitwiseXor), R(1),
......@@ -159,7 +160,7 @@ bytecode array length: 12
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(13),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 46 S> */ B(Star), R(1),
B(LdaSmi), U8(1),
B(Mul), R(1),
......@@ -181,7 +182,7 @@ bytecode array length: 12
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(13),
/* 42 E> */ B(Star), R(0),
B(Star), R(0),
/* 46 S> */ B(Star), R(1),
B(LdaSmi), U8(-1),
B(Mul), R(1),
......
......@@ -171,11 +171,12 @@ snippet: "
"
frame size: 157
parameter count: 1
bytecode array length: 8
bytecode array length: 9
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 1494 S> */ B(Wide), B(Ldar), R16(127),
/* 1497 E> */ B(Star), R(0),
B(Star), R(0),
/* 1505 S> */ B(Nop),
/* 1516 S> */ B(Return),
]
constant pool: [
......@@ -347,11 +348,12 @@ snippet: "
"
frame size: 157
parameter count: 1
bytecode array length: 10
bytecode array length: 11
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 1494 S> */ B(Wide), B(Ldar), R16(126),
/* 1499 E> */ B(Wide), B(Star), R16(127),
B(Wide), B(Star), R16(127),
/* 1507 S> */ B(Nop),
/* 1520 S> */ B(Return),
]
constant pool: [
......@@ -711,7 +713,7 @@ bytecode array length: 48
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 1503 S> */ B(LdaZero),
/* 1503 E> */ B(Star), R(0),
B(Star), R(0),
/* 1506 S> */ B(Wide), B(Ldar), R16(129),
B(Wide), B(Star), R16(157),
B(LdaSmi), U8(3),
......@@ -903,9 +905,9 @@ bytecode array length: 66
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 1503 S> */ B(LdaZero),
/* 1503 E> */ B(Star), R(0),
B(Star), R(0),
/* 1515 S> */ B(LdaZero),
/* 1515 E> */ B(Star), R(1),
B(Star), R(1),
/* 1523 S> */ B(LdaZero),
/* 1528 E> */ B(Wide), B(Star), R16(128),
/* 1538 S> */ B(Wide), B(Ldar), R16(128),
......@@ -1102,9 +1104,9 @@ bytecode array length: 84
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 1503 S> */ B(Wide), B(LdaSmi), U16(1234),
/* 1503 E> */ B(Star), R(0),
B(Star), R(0),
/* 1518 S> */ B(LdaZero),
/* 1518 E> */ B(Star), R(1),
B(Star), R(1),
/* 1534 S> */ B(Ldar), R(0),
B(JumpIfUndefined), U8(69),
B(JumpIfNull), U8(67),
......@@ -1309,13 +1311,13 @@ bytecodes: [
/* 1509 E> */ B(Ldar), R(63),
B(Wide), B(Star), R16(158),
B(Wide), B(CallRuntime), U16(Runtime::kAdd), R16(157), U16(2),
/* 1497 E> */ B(Star), R(0),
B(Star), R(0),
/* 1515 S> */ B(Ldar), R(27),
B(Wide), B(Star), R16(157),
/* 1530 E> */ B(Wide), B(Ldar), R16(143),
B(Wide), B(Star), R16(158),
B(Wide), B(CallRuntime), U16(Runtime::kAdd), R16(157), U16(2),
/* 1518 E> */ B(Star), R(1),
B(Star), R(1),
/* 1537 S> */ B(CallRuntime), U16(Runtime::kTheHole), R(0), U8(0),
/* 1549 S> */ B(Ldar), R(1),
/* 1560 S> */ B(Return),
......
// Copyright 2016 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: --no-ignition --expose-debug-as debug
Debug = debug.Debug
var exception = null;
var break_count = 0;
function listener(event, exec_state, event_data, data) {
if (event != Debug.DebugEvent.Break) return;
try {
print(event_data.sourceLineText());
var column = event_data.sourceColumn();
assertTrue(event_data.sourceLineText().indexOf(
`Break ${break_count++}. ${column}.`) > 0);
exec_state.prepareStep(Debug.StepAction.StepIn);
} catch (e) {
print(e + e.stack);
exception = e;
}
};
function f() {
var a = 1; // Break 2. 10.
return a; // Break 3. 2.
} // Break 4. 0.
Debug.setListener(listener);
debugger; // Break 0. 0.
f(); // Break 1. 0.
Debug.setListener(null); // Break 5. 0.
assertNull(exception);
assertEquals(6, break_count);
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --ignition --expose-debug-as debug
// Flags: --expose-debug-as debug
Debug = debug.Debug
......@@ -25,17 +25,13 @@ function listener(event, exec_state, event_data, data) {
function f() {
var a = 1; // Break 2. 10.
// This return statement emits no bytecode instruction for the evaluation of
// the to-be-returned expression. Therefore we cannot set a break location
// before the statement and a second break location immediately before
// returning to the caller.
return a;
} // Break 3. 0.
return a; // Break 3. 2.
} // Break 4. 0.
Debug.setListener(listener);
debugger; // Break 0. 0.
f(); // Break 1. 0.
Debug.setListener(null); // Break 4. 0.
Debug.setListener(null); // Break 5. 0.
assertNull(exception);
assertEquals(5, break_count);
assertEquals(6, break_count);
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