Commit 5e8f8d4e authored by oth's avatar oth Committed by Commit bot

[interpreter] Bytecode register optimizer.

Online optimization stage for reducing redundant transfers between registers.

BUG=V8:4280
LOG=N

Review-Url: https://codereview.chromium.org/1997653002
Cr-Commit-Position: refs/heads/master@{#36551}
parent bcf520ef
...@@ -1238,6 +1238,8 @@ v8_source_set("v8_base") { ...@@ -1238,6 +1238,8 @@ v8_source_set("v8_base") {
"src/interpreter/bytecode-pipeline.h", "src/interpreter/bytecode-pipeline.h",
"src/interpreter/bytecode-register-allocator.cc", "src/interpreter/bytecode-register-allocator.cc",
"src/interpreter/bytecode-register-allocator.h", "src/interpreter/bytecode-register-allocator.h",
"src/interpreter/bytecode-register-optimizer.cc",
"src/interpreter/bytecode-register-optimizer.h",
"src/interpreter/bytecode-traits.h", "src/interpreter/bytecode-traits.h",
"src/interpreter/bytecodes.cc", "src/interpreter/bytecodes.cc",
"src/interpreter/bytecodes.h", "src/interpreter/bytecodes.h",
......
...@@ -303,6 +303,7 @@ DEFINE_BOOL(ignition_generators, false, ...@@ -303,6 +303,7 @@ DEFINE_BOOL(ignition_generators, false,
"enable experimental ignition support for generators") "enable experimental ignition support for generators")
DEFINE_STRING(ignition_filter, "*", "filter for ignition interpreter") DEFINE_STRING(ignition_filter, "*", "filter for ignition interpreter")
DEFINE_BOOL(ignition_peephole, true, "use ignition peephole optimizer") DEFINE_BOOL(ignition_peephole, true, "use ignition peephole optimizer")
DEFINE_BOOL(ignition_reo, true, "use ignition register equivalence optimizer")
DEFINE_BOOL(print_bytecode, false, DEFINE_BOOL(print_bytecode, false,
"print bytecode generated by ignition interpreter") "print bytecode generated by ignition interpreter")
DEFINE_BOOL(trace_ignition, false, DEFINE_BOOL(trace_ignition, false,
......
...@@ -325,6 +325,8 @@ class InterpreterFrameConstants : public AllStatic { ...@@ -325,6 +325,8 @@ class InterpreterFrameConstants : public AllStatic {
// FP-relative. // FP-relative.
static const int kLastParamFromFp = StandardFrameConstants::kCallerSPOffset; static const int kLastParamFromFp = StandardFrameConstants::kCallerSPOffset;
static const int kCallerPCOffsetFromFp =
StandardFrameConstants::kCallerPCOffset;
static const int kNewTargetFromFp = static const int kNewTargetFromFp =
-StandardFrameConstants::kFixedFrameSizeFromFp - 1 * kPointerSize; -StandardFrameConstants::kFixedFrameSizeFromFp - 1 * kPointerSize;
static const int kBytecodeArrayFromFp = static const int kBytecodeArrayFromFp =
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "src/compiler.h" #include "src/compiler.h"
#include "src/interpreter/bytecode-array-writer.h" #include "src/interpreter/bytecode-array-writer.h"
#include "src/interpreter/bytecode-peephole-optimizer.h" #include "src/interpreter/bytecode-peephole-optimizer.h"
#include "src/interpreter/bytecode-register-optimizer.h"
#include "src/interpreter/interpreter-intrinsics.h" #include "src/interpreter/interpreter-intrinsics.h"
namespace v8 { namespace v8 {
...@@ -40,6 +41,11 @@ BytecodeArrayBuilder::BytecodeArrayBuilder(Isolate* isolate, Zone* zone, ...@@ -40,6 +41,11 @@ BytecodeArrayBuilder::BytecodeArrayBuilder(Isolate* isolate, Zone* zone,
BytecodePeepholeOptimizer(&constant_array_builder_, pipeline_); BytecodePeepholeOptimizer(&constant_array_builder_, pipeline_);
} }
if (FLAG_ignition_reo) {
pipeline_ = new (zone) BytecodeRegisterOptimizer(
zone, &temporary_allocator_, parameter_count, pipeline_);
}
return_position_ = return_position_ =
literal ? std::max(literal->start_position(), literal->end_position() - 1) literal ? std::max(literal->start_position(), literal->end_position() - 1)
: RelocInfo::kNoPosition; : RelocInfo::kNoPosition;
......
...@@ -54,10 +54,12 @@ void BytecodeArrayWriter::EmitBytecode(const BytecodeNode* const node) { ...@@ -54,10 +54,12 @@ void BytecodeArrayWriter::EmitBytecode(const BytecodeNode* const node) {
int register_operand_bitmap = Bytecodes::GetRegisterOperandBitmap(bytecode); int register_operand_bitmap = Bytecodes::GetRegisterOperandBitmap(bytecode);
const uint32_t* const operands = node->operands(); const uint32_t* const operands = node->operands();
const OperandSize* operand_sizes =
Bytecodes::GetOperandSizes(bytecode, operand_scale);
const OperandType* operand_types = Bytecodes::GetOperandTypes(bytecode); const OperandType* operand_types = Bytecodes::GetOperandTypes(bytecode);
for (int i = 0; operand_types[i] != OperandType::kNone; ++i) { for (int i = 0; operand_types[i] != OperandType::kNone; ++i) {
OperandType operand_type = operand_types[i]; OperandType operand_type = operand_types[i];
switch (Bytecodes::SizeOfOperand(operand_type, operand_scale)) { switch (operand_sizes[i]) {
case OperandSize::kNone: case OperandSize::kNone:
UNREACHABLE(); UNREACHABLE();
break; break;
......
...@@ -12,6 +12,8 @@ namespace internal { ...@@ -12,6 +12,8 @@ namespace internal {
namespace interpreter { namespace interpreter {
void BytecodeSourceInfo::Update(const BytecodeSourceInfo& entry) { void BytecodeSourceInfo::Update(const BytecodeSourceInfo& entry) {
if (!entry.is_valid()) return;
if (!is_valid() || (entry.is_statement() && !is_statement()) || if (!is_valid() || (entry.is_statement() && !is_statement()) ||
(entry.is_statement() && is_statement() && (entry.is_statement() && is_statement() &&
entry.source_position() > source_position())) { entry.source_position() > source_position())) {
...@@ -75,6 +77,15 @@ BytecodeNode::BytecodeNode(Bytecode bytecode, uint32_t operand0, ...@@ -75,6 +77,15 @@ BytecodeNode::BytecodeNode(Bytecode bytecode, uint32_t operand0,
operand_scale_ = operand_scale; operand_scale_ = operand_scale;
} }
BytecodeNode::BytecodeNode(const BytecodeNode& other) {
memcpy(this, &other, sizeof(other));
}
BytecodeNode& BytecodeNode::operator=(const BytecodeNode& other) {
memcpy(this, &other, sizeof(other));
return *this;
}
void BytecodeNode::set_bytecode(Bytecode bytecode) { void BytecodeNode::set_bytecode(Bytecode bytecode) {
DCHECK_EQ(Bytecodes::NumberOfOperands(bytecode), 0); DCHECK_EQ(Bytecodes::NumberOfOperands(bytecode), 0);
bytecode_ = bytecode; bytecode_ = bytecode;
......
...@@ -88,6 +88,9 @@ class BytecodeNode final : ZoneObject { ...@@ -88,6 +88,9 @@ class BytecodeNode final : ZoneObject {
uint32_t operand2, uint32_t operand3, uint32_t operand2, uint32_t operand3,
OperandScale operand_scale); OperandScale operand_scale);
BytecodeNode(const BytecodeNode& other);
BytecodeNode& operator=(const BytecodeNode& other);
void set_bytecode(Bytecode bytecode); void set_bytecode(Bytecode bytecode);
void set_bytecode(Bytecode bytecode, uint32_t operand0, void set_bytecode(Bytecode bytecode, uint32_t operand0,
OperandScale operand_scale); OperandScale operand_scale);
...@@ -117,6 +120,9 @@ class BytecodeNode final : ZoneObject { ...@@ -117,6 +120,9 @@ class BytecodeNode final : ZoneObject {
int operand_count() const { return Bytecodes::NumberOfOperands(bytecode_); } int operand_count() const { return Bytecodes::NumberOfOperands(bytecode_); }
OperandScale operand_scale() const { return operand_scale_; } OperandScale operand_scale() const { return operand_scale_; }
void set_operand_scale(OperandScale operand_scale) {
operand_scale_ = operand_scale;
}
const BytecodeSourceInfo& source_info() const { return source_info_; } const BytecodeSourceInfo& source_info() const { return source_info_; }
BytecodeSourceInfo& source_info() { return source_info_; } BytecodeSourceInfo& source_info() { return source_info_; }
......
...@@ -14,7 +14,8 @@ TemporaryRegisterAllocator::TemporaryRegisterAllocator(Zone* zone, ...@@ -14,7 +14,8 @@ TemporaryRegisterAllocator::TemporaryRegisterAllocator(Zone* zone,
int allocation_base) int allocation_base)
: free_temporaries_(zone), : free_temporaries_(zone),
allocation_base_(allocation_base), allocation_base_(allocation_base),
allocation_count_(0) {} allocation_count_(0),
observer_(nullptr) {}
Register TemporaryRegisterAllocator::first_temporary_register() const { Register TemporaryRegisterAllocator::first_temporary_register() const {
DCHECK(allocation_count() > 0); DCHECK(allocation_count() > 0);
...@@ -26,6 +27,12 @@ Register TemporaryRegisterAllocator::last_temporary_register() const { ...@@ -26,6 +27,12 @@ Register TemporaryRegisterAllocator::last_temporary_register() const {
return Register(allocation_base() + allocation_count() - 1); return Register(allocation_base() + allocation_count() - 1);
} }
void TemporaryRegisterAllocator::set_observer(
TemporaryRegisterObserver* observer) {
DCHECK(observer_ == nullptr);
observer_ = observer;
}
int TemporaryRegisterAllocator::AllocateTemporaryRegister() { int TemporaryRegisterAllocator::AllocateTemporaryRegister() {
allocation_count_ += 1; allocation_count_ += 1;
return allocation_base() + allocation_count() - 1; return allocation_base() + allocation_count() - 1;
...@@ -140,6 +147,9 @@ void TemporaryRegisterAllocator::BorrowConsecutiveTemporaryRegister( ...@@ -140,6 +147,9 @@ void TemporaryRegisterAllocator::BorrowConsecutiveTemporaryRegister(
void TemporaryRegisterAllocator::ReturnTemporaryRegister(int reg_index) { void TemporaryRegisterAllocator::ReturnTemporaryRegister(int reg_index) {
DCHECK(free_temporaries_.find(reg_index) == free_temporaries_.end()); DCHECK(free_temporaries_.find(reg_index) == free_temporaries_.end());
free_temporaries_.insert(reg_index); free_temporaries_.insert(reg_index);
if (observer_) {
observer_->TemporaryRegisterFreeEvent(Register(reg_index));
}
} }
BytecodeRegisterAllocator::BytecodeRegisterAllocator( BytecodeRegisterAllocator::BytecodeRegisterAllocator(
...@@ -156,7 +166,6 @@ BytecodeRegisterAllocator::~BytecodeRegisterAllocator() { ...@@ -156,7 +166,6 @@ BytecodeRegisterAllocator::~BytecodeRegisterAllocator() {
allocated_.clear(); allocated_.clear();
} }
Register BytecodeRegisterAllocator::NewRegister() { Register BytecodeRegisterAllocator::NewRegister() {
int allocated = -1; int allocated = -1;
if (next_consecutive_count_ <= 0) { if (next_consecutive_count_ <= 0) {
...@@ -170,7 +179,6 @@ Register BytecodeRegisterAllocator::NewRegister() { ...@@ -170,7 +179,6 @@ Register BytecodeRegisterAllocator::NewRegister() {
return Register(allocated); return Register(allocated);
} }
bool BytecodeRegisterAllocator::RegisterIsAllocatedInThisScope( bool BytecodeRegisterAllocator::RegisterIsAllocatedInThisScope(
Register reg) const { Register reg) const {
for (auto i = allocated_.begin(); i != allocated_.end(); i++) { for (auto i = allocated_.begin(); i != allocated_.end(); i++) {
...@@ -179,7 +187,6 @@ bool BytecodeRegisterAllocator::RegisterIsAllocatedInThisScope( ...@@ -179,7 +187,6 @@ bool BytecodeRegisterAllocator::RegisterIsAllocatedInThisScope(
return false; return false;
} }
void BytecodeRegisterAllocator::PrepareForConsecutiveAllocations(size_t count) { void BytecodeRegisterAllocator::PrepareForConsecutiveAllocations(size_t count) {
if (static_cast<int>(count) > next_consecutive_count_) { if (static_cast<int>(count) > next_consecutive_count_) {
next_consecutive_register_ = next_consecutive_register_ =
...@@ -188,7 +195,6 @@ void BytecodeRegisterAllocator::PrepareForConsecutiveAllocations(size_t count) { ...@@ -188,7 +195,6 @@ void BytecodeRegisterAllocator::PrepareForConsecutiveAllocations(size_t count) {
} }
} }
Register BytecodeRegisterAllocator::NextConsecutiveRegister() { Register BytecodeRegisterAllocator::NextConsecutiveRegister() {
DCHECK_GE(next_consecutive_register_, 0); DCHECK_GE(next_consecutive_register_, 0);
DCHECK_GT(next_consecutive_count_, 0); DCHECK_GT(next_consecutive_count_, 0);
......
...@@ -14,6 +14,7 @@ namespace interpreter { ...@@ -14,6 +14,7 @@ namespace interpreter {
class BytecodeArrayBuilder; class BytecodeArrayBuilder;
class Register; class Register;
class TemporaryRegisterObserver;
class TemporaryRegisterAllocator final { class TemporaryRegisterAllocator final {
public: public:
...@@ -54,6 +55,9 @@ class TemporaryRegisterAllocator final { ...@@ -54,6 +55,9 @@ class TemporaryRegisterAllocator final {
// Returns the number of temporary register allocations made. // Returns the number of temporary register allocations made.
int allocation_count() const { return allocation_count_; } int allocation_count() const { return allocation_count_; }
// Sets an observer for temporary register events.
void set_observer(TemporaryRegisterObserver* observer);
private: private:
// Allocate a temporary register. // Allocate a temporary register.
int AllocateTemporaryRegister(); int AllocateTemporaryRegister();
...@@ -61,10 +65,17 @@ class TemporaryRegisterAllocator final { ...@@ -61,10 +65,17 @@ class TemporaryRegisterAllocator final {
ZoneSet<int> free_temporaries_; ZoneSet<int> free_temporaries_;
int allocation_base_; int allocation_base_;
int allocation_count_; int allocation_count_;
TemporaryRegisterObserver* observer_;
DISALLOW_COPY_AND_ASSIGN(TemporaryRegisterAllocator); DISALLOW_COPY_AND_ASSIGN(TemporaryRegisterAllocator);
}; };
class TemporaryRegisterObserver {
public:
virtual ~TemporaryRegisterObserver() {}
virtual void TemporaryRegisterFreeEvent(Register reg) = 0;
};
// A class that allows the instantiator to allocate temporary registers that are // A class that allows the instantiator to allocate temporary registers that are
// cleaned up when scope is closed. // cleaned up when scope is closed.
class BytecodeRegisterAllocator final { class BytecodeRegisterAllocator final {
......
This diff is collapsed.
// 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.
#ifndef V8_INTERPRETER_BYTECODE_REGISTER_OPTIMIZER_H_
#define V8_INTERPRETER_BYTECODE_REGISTER_OPTIMIZER_H_
#include "src/interpreter/bytecode-pipeline.h"
namespace v8 {
namespace internal {
namespace interpreter {
// An optimization stage for eliminating unnecessary transfers between
// registers. The bytecode generator uses temporary registers
// liberally for correctness and convenience and this stage removes
// transfers that are not required and preserves correctness.
class BytecodeRegisterOptimizer final : public BytecodePipelineStage,
public TemporaryRegisterObserver,
public ZoneObject {
public:
BytecodeRegisterOptimizer(Zone* zone,
TemporaryRegisterAllocator* register_allocator,
int parameter_count,
BytecodePipelineStage* next_stage);
virtual ~BytecodeRegisterOptimizer() {}
// BytecodePipelineStage interface.
size_t FlushForOffset() override;
void FlushBasicBlock() override;
void Write(BytecodeNode* node) override;
private:
const uint32_t kInvalidEquivalenceId = kMaxUInt32;
class RegisterInfo;
// TemporaryRegisterObserver interface.
void TemporaryRegisterFreeEvent(Register reg) override;
// Helpers for BytecodePipelineStage interface.
void FlushState();
void WriteToNextStage(BytecodeNode* node) const;
void WriteToNextStage(BytecodeNode* node,
const BytecodeSourceInfo& output_info) const;
// Update internal state for register transfer from |input| to
// |output| using |source_info| as source position information if
// any bytecodes are emitted due to transfer.
void RegisterTransfer(RegisterInfo* input, RegisterInfo* output,
const BytecodeSourceInfo& source_info);
// Emit a register transfer bytecode from |input| to |output|.
void OutputRegisterTransfer(
RegisterInfo* input, RegisterInfo* output,
const BytecodeSourceInfo& source_info = BytecodeSourceInfo());
// Emits a Nop to preserve source position information in the
// bytecode pipeline.
void EmitNopForSourceInfo(const BytecodeSourceInfo& source_info) const;
// Handlers for bytecode nodes for register to register transfers.
void DoLdar(const BytecodeNode* const node);
void DoMov(const BytecodeNode* const node);
void DoStar(const BytecodeNode* const node);
// Operand processing methods for bytecodes other than those
// performing register to register transfers.
void PrepareOperands(BytecodeNode* const node);
void PrepareAccumulator(BytecodeNode* const node);
void PrepareRegisterOperands(BytecodeNode* const node);
void PrepareRegisterOutputOperand(RegisterInfo* reg_info);
void PrepareRegisterRangeOutputOperand(Register start, int count);
void PrepareRegisterInputOperand(BytecodeNode* const node, Register reg,
int operand_index);
void PrepareRegisterRangeInputOperand(Register start, int count);
Register GetEquivalentRegisterForInputOperand(Register reg);
static Register GetRegisterInputOperand(int index, Bytecode bytecode,
const uint32_t* operands,
int operand_count);
static Register GetRegisterOutputOperand(int index, Bytecode bytecode,
const uint32_t* operands,
int operand_count);
void CreateMaterializedEquivalent(RegisterInfo* info);
RegisterInfo* GetMaterializedEquivalent(RegisterInfo* info);
RegisterInfo* GetMaterializedEquivalentNotAccumulator(RegisterInfo* info);
void Materialize(RegisterInfo* info);
// Methods for finding and creating metadata for each register.
RegisterInfo* GetOrCreateRegisterInfo(Register reg);
RegisterInfo* GetRegisterInfo(Register reg);
RegisterInfo* NewRegisterInfo(Register reg);
void GrowRegisterMap(Register reg);
bool RegisterIsTemporary(Register reg) const {
return reg >= temporary_base_;
}
bool RegisterIsObservable(Register reg) const {
return reg != accumulator_ && !RegisterIsTemporary(reg);
}
static Register OperandToRegister(uint32_t operand) {
return Register::FromOperand(static_cast<int32_t>(operand));
}
size_t GetRegisterInfoTableIndex(Register reg) const {
return static_cast<size_t>(reg.index() + register_info_table_offset_);
}
Register RegisterFromRegisterInfoTableIndex(size_t index) const {
return Register(static_cast<int>(index) - register_info_table_offset_);
}
uint32_t NextEquivalenceId() {
equivalence_id_++;
CHECK_NE(equivalence_id_, kInvalidEquivalenceId);
return equivalence_id_;
}
Zone* zone() { return zone_; }
const Register accumulator_;
RegisterInfo* accumulator_info_;
const Register temporary_base_;
// Direct mapping to register info.
ZoneVector<RegisterInfo*> register_info_table_;
int register_info_table_offset_;
// Counter for equivalence sets identifiers.
int equivalence_id_;
BytecodePipelineStage* next_stage_;
bool flushed_;
Zone* zone_;
DISALLOW_COPY_AND_ASSIGN(BytecodeRegisterOptimizer);
};
} // namespace interpreter
} // namespace internal
} // namespace v8
#endif // V8_INTERPRETER_BYTECODE_REGISTER_OPTIMIZER_H_
...@@ -89,7 +89,7 @@ struct BytecodeTraits<accumulator_use, operand_0, operand_1, operand_2, ...@@ -89,7 +89,7 @@ struct BytecodeTraits<accumulator_use, operand_0, operand_1, operand_2,
return operand_types; return operand_types;
} }
static OperandSize GetOperandSize(int i, OperandScale operand_scale) { static const OperandSize* GetOperandSizes(OperandScale operand_scale) {
switch (operand_scale) { switch (operand_scale) {
#define CASE(Name, _) \ #define CASE(Name, _) \
case OperandScale::k##Name: { \ case OperandScale::k##Name: { \
...@@ -99,14 +99,13 @@ struct BytecodeTraits<accumulator_use, operand_0, operand_1, operand_2, ...@@ -99,14 +99,13 @@ struct BytecodeTraits<accumulator_use, operand_0, operand_1, operand_2,
OperandScaler<operand_2, OperandScale::k##Name>::kOperandSize, \ OperandScaler<operand_2, OperandScale::k##Name>::kOperandSize, \
OperandScaler<operand_3, OperandScale::k##Name>::kOperandSize, \ OperandScaler<operand_3, OperandScale::k##Name>::kOperandSize, \
}; \ }; \
DCHECK_LT(static_cast<size_t>(i), arraysize(kOperandSizes)); \ return kOperandSizes; \
return kOperandSizes[i]; \
} }
OPERAND_SCALE_LIST(CASE) OPERAND_SCALE_LIST(CASE)
#undef CASE #undef CASE
} }
UNREACHABLE(); UNREACHABLE();
return OperandSize::kNone; return nullptr;
} }
template <OperandType ot> template <OperandType ot>
...@@ -145,7 +144,7 @@ struct BytecodeTraits<accumulator_use, operand_0, operand_1, operand_2> { ...@@ -145,7 +144,7 @@ struct BytecodeTraits<accumulator_use, operand_0, operand_1, operand_2> {
return operand_types; return operand_types;
} }
static OperandSize GetOperandSize(int i, OperandScale operand_scale) { static const OperandSize* GetOperandSizes(OperandScale operand_scale) {
switch (operand_scale) { switch (operand_scale) {
#define CASE(Name, _) \ #define CASE(Name, _) \
case OperandScale::k##Name: { \ case OperandScale::k##Name: { \
...@@ -154,14 +153,13 @@ struct BytecodeTraits<accumulator_use, operand_0, operand_1, operand_2> { ...@@ -154,14 +153,13 @@ struct BytecodeTraits<accumulator_use, operand_0, operand_1, operand_2> {
OperandScaler<operand_1, OperandScale::k##Name>::kOperandSize, \ OperandScaler<operand_1, OperandScale::k##Name>::kOperandSize, \
OperandScaler<operand_2, OperandScale::k##Name>::kOperandSize, \ OperandScaler<operand_2, OperandScale::k##Name>::kOperandSize, \
}; \ }; \
DCHECK_LT(static_cast<size_t>(i), arraysize(kOperandSizes)); \ return kOperandSizes; \
return kOperandSizes[i]; \
} }
OPERAND_SCALE_LIST(CASE) OPERAND_SCALE_LIST(CASE)
#undef CASE #undef CASE
} }
UNREACHABLE(); UNREACHABLE();
return OperandSize::kNone; return nullptr;
} }
template <OperandType ot> template <OperandType ot>
...@@ -196,7 +194,7 @@ struct BytecodeTraits<accumulator_use, operand_0, operand_1> { ...@@ -196,7 +194,7 @@ struct BytecodeTraits<accumulator_use, operand_0, operand_1> {
return operand_types; return operand_types;
} }
static OperandSize GetOperandSize(int i, OperandScale operand_scale) { static const OperandSize* GetOperandSizes(OperandScale operand_scale) {
switch (operand_scale) { switch (operand_scale) {
#define CASE(Name, _) \ #define CASE(Name, _) \
case OperandScale::k##Name: { \ case OperandScale::k##Name: { \
...@@ -204,14 +202,13 @@ struct BytecodeTraits<accumulator_use, operand_0, operand_1> { ...@@ -204,14 +202,13 @@ struct BytecodeTraits<accumulator_use, operand_0, operand_1> {
OperandScaler<operand_0, OperandScale::k##Name>::kOperandSize, \ OperandScaler<operand_0, OperandScale::k##Name>::kOperandSize, \
OperandScaler<operand_1, OperandScale::k##Name>::kOperandSize, \ OperandScaler<operand_1, OperandScale::k##Name>::kOperandSize, \
}; \ }; \
DCHECK_LT(static_cast<size_t>(i), arraysize(kOperandSizes)); \ return kOperandSizes; \
return kOperandSizes[i]; \
} }
OPERAND_SCALE_LIST(CASE) OPERAND_SCALE_LIST(CASE)
#undef CASE #undef CASE
} }
UNREACHABLE(); UNREACHABLE();
return OperandSize::kNone; return nullptr;
} }
template <OperandType ot> template <OperandType ot>
...@@ -241,21 +238,20 @@ struct BytecodeTraits<accumulator_use, operand_0> { ...@@ -241,21 +238,20 @@ struct BytecodeTraits<accumulator_use, operand_0> {
return operand_types; return operand_types;
} }
static OperandSize GetOperandSize(int i, OperandScale operand_scale) { static const OperandSize* GetOperandSizes(OperandScale operand_scale) {
switch (operand_scale) { switch (operand_scale) {
#define CASE(Name, _) \ #define CASE(Name, _) \
case OperandScale::k##Name: { \ case OperandScale::k##Name: { \
static const OperandSize kOperandSizes[] = { \ static const OperandSize kOperandSizes[] = { \
OperandScaler<operand_0, OperandScale::k##Name>::kOperandSize, \ OperandScaler<operand_0, OperandScale::k##Name>::kOperandSize, \
}; \ }; \
DCHECK_LT(static_cast<size_t>(i), arraysize(kOperandSizes)); \ return kOperandSizes; \
return kOperandSizes[i]; \
} }
OPERAND_SCALE_LIST(CASE) OPERAND_SCALE_LIST(CASE)
#undef CASE #undef CASE
} }
UNREACHABLE(); UNREACHABLE();
return OperandSize::kNone; return nullptr;
} }
template <OperandType ot> template <OperandType ot>
...@@ -282,9 +278,8 @@ struct BytecodeTraits<accumulator_use> { ...@@ -282,9 +278,8 @@ struct BytecodeTraits<accumulator_use> {
return operand_types; return operand_types;
} }
static OperandSize GetOperandSize(int i, OperandScale operand_scale) { static const OperandSize* GetOperandSizes(OperandScale operand_scale) {
UNREACHABLE(); return nullptr;
return OperandSize::kNone;
} }
template <OperandType ot> template <OperandType ot>
......
...@@ -301,16 +301,23 @@ const OperandType* Bytecodes::GetOperandTypes(Bytecode bytecode) { ...@@ -301,16 +301,23 @@ const OperandType* Bytecodes::GetOperandTypes(Bytecode bytecode) {
// static // static
OperandSize Bytecodes::GetOperandSize(Bytecode bytecode, int i, OperandSize Bytecodes::GetOperandSize(Bytecode bytecode, int i,
OperandScale operand_scale) { OperandScale operand_scale) {
DCHECK_LT(i, NumberOfOperands(bytecode));
return GetOperandSizes(bytecode, operand_scale)[i];
}
// static
const OperandSize* Bytecodes::GetOperandSizes(Bytecode bytecode,
OperandScale operand_scale) {
DCHECK(bytecode <= Bytecode::kLast); DCHECK(bytecode <= Bytecode::kLast);
switch (bytecode) { switch (bytecode) {
#define CASE(Name, ...) \ #define CASE(Name, ...) \
case Bytecode::k##Name: \ case Bytecode::k##Name: \
return BytecodeTraits<__VA_ARGS__>::GetOperandSize(i, operand_scale); return BytecodeTraits<__VA_ARGS__>::GetOperandSizes(operand_scale);
BYTECODE_LIST(CASE) BYTECODE_LIST(CASE)
#undef CASE #undef CASE
} }
UNREACHABLE(); UNREACHABLE();
return OperandSize::kNone; return nullptr;
} }
// static // static
...@@ -619,6 +626,33 @@ OperandSize Bytecodes::SizeForUnsignedOperand(size_t value) { ...@@ -619,6 +626,33 @@ OperandSize Bytecodes::SizeForUnsignedOperand(size_t value) {
} }
} }
OperandScale Bytecodes::OperandSizesToScale(OperandSize size0) {
OperandScale operand_scale = static_cast<OperandScale>(size0);
DCHECK(operand_scale == OperandScale::kSingle ||
operand_scale == OperandScale::kDouble ||
operand_scale == OperandScale::kQuadruple);
return operand_scale;
}
OperandScale Bytecodes::OperandSizesToScale(OperandSize size0,
OperandSize size1) {
OperandSize operand_size = std::max(size0, size1);
// Operand sizes have been scaled before calling this function.
// Currently all scalable operands are byte sized at
// OperandScale::kSingle.
STATIC_ASSERT(static_cast<int>(OperandSize::kByte) ==
static_cast<int>(OperandScale::kSingle) &&
static_cast<int>(OperandSize::kShort) ==
static_cast<int>(OperandScale::kDouble) &&
static_cast<int>(OperandSize::kQuad) ==
static_cast<int>(OperandScale::kQuadruple));
OperandScale operand_scale = static_cast<OperandScale>(operand_size);
DCHECK(operand_scale == OperandScale::kSingle ||
operand_scale == OperandScale::kDouble ||
operand_scale == OperandScale::kQuadruple);
return operand_scale;
}
OperandScale Bytecodes::OperandSizesToScale(OperandSize size0, OperandScale Bytecodes::OperandSizesToScale(OperandSize size0,
OperandSize size1, OperandSize size1,
OperandSize size2, OperandSize size2,
...@@ -830,6 +864,10 @@ static const int kBytecodeOffsetRegisterIndex = ...@@ -830,6 +864,10 @@ static const int kBytecodeOffsetRegisterIndex =
(InterpreterFrameConstants::kRegisterFileFromFp - (InterpreterFrameConstants::kRegisterFileFromFp -
InterpreterFrameConstants::kBytecodeOffsetFromFp) / InterpreterFrameConstants::kBytecodeOffsetFromFp) /
kPointerSize; kPointerSize;
static const int kCallerPCOffsetRegisterIndex =
(InterpreterFrameConstants::kRegisterFileFromFp -
InterpreterFrameConstants::kCallerPCOffsetFromFp) /
kPointerSize;
Register Register::FromParameterIndex(int index, int parameter_count) { Register Register::FromParameterIndex(int index, int parameter_count) {
DCHECK_GE(index, 0); DCHECK_GE(index, 0);
...@@ -882,6 +920,11 @@ bool Register::is_bytecode_offset() const { ...@@ -882,6 +920,11 @@ bool Register::is_bytecode_offset() const {
return index() == kBytecodeOffsetRegisterIndex; return index() == kBytecodeOffsetRegisterIndex;
} }
// static
Register Register::virtual_accumulator() {
return Register(kCallerPCOffsetRegisterIndex);
}
OperandSize Register::SizeOfOperand() const { OperandSize Register::SizeOfOperand() const {
int32_t operand = ToOperand(); int32_t operand = ToOperand();
if (operand >= kMinInt8 && operand <= kMaxInt8) { if (operand >= kMinInt8 && operand <= kMaxInt8) {
......
...@@ -387,6 +387,11 @@ class Register final { ...@@ -387,6 +387,11 @@ class Register final {
static Register bytecode_offset(); static Register bytecode_offset();
bool is_bytecode_offset() const; bool is_bytecode_offset() const;
// Returns a register that can be used to represent the accumulator
// within code in the interpreter, but should never be emitted in
// bytecode.
static Register virtual_accumulator();
OperandSize SizeOfOperand() const; OperandSize SizeOfOperand() const;
int32_t ToOperand() const { return kRegisterFileStartOffset - index_; } int32_t ToOperand() const { return kRegisterFileStartOffset - index_; }
...@@ -505,6 +510,10 @@ class Bytecodes { ...@@ -505,6 +510,10 @@ class Bytecodes {
static OperandSize GetOperandSize(Bytecode bytecode, int i, static OperandSize GetOperandSize(Bytecode bytecode, int i,
OperandScale operand_scale); OperandScale operand_scale);
// Returns a pointer to an array of the operand sizes for |bytecode|.
static const OperandSize* GetOperandSizes(Bytecode bytecode,
OperandScale operand_scale);
// Returns the offset of the i-th operand of |bytecode| relative to the start // Returns the offset of the i-th operand of |bytecode| relative to the start
// of the bytecode. // of the bytecode.
static int GetOperandOffset(Bytecode bytecode, int i, static int GetOperandOffset(Bytecode bytecode, int i,
...@@ -642,9 +651,10 @@ class Bytecodes { ...@@ -642,9 +651,10 @@ class Bytecodes {
// Return the OperandScale required for bytecode emission of // Return the OperandScale required for bytecode emission of
// operand sizes. // operand sizes.
static OperandScale OperandSizesToScale(OperandSize size0);
static OperandScale OperandSizesToScale(OperandSize size0, OperandSize size1);
static OperandScale OperandSizesToScale( static OperandScale OperandSizesToScale(
OperandSize size0, OperandSize size1 = OperandSize::kByte, OperandSize size0, OperandSize size1, OperandSize size2,
OperandSize size2 = OperandSize::kByte,
OperandSize size3 = OperandSize::kByte); OperandSize size3 = OperandSize::kByte);
private: private:
......
...@@ -904,6 +904,8 @@ ...@@ -904,6 +904,8 @@
'interpreter/bytecode-pipeline.h', 'interpreter/bytecode-pipeline.h',
'interpreter/bytecode-register-allocator.cc', 'interpreter/bytecode-register-allocator.cc',
'interpreter/bytecode-register-allocator.h', 'interpreter/bytecode-register-allocator.h',
'interpreter/bytecode-register-optimizer.cc',
'interpreter/bytecode-register-optimizer.h',
'interpreter/bytecode-generator.cc', 'interpreter/bytecode-generator.cc',
'interpreter/bytecode-generator.h', 'interpreter/bytecode-generator.h',
'interpreter/bytecode-traits.h', 'interpreter/bytecode-traits.h',
......
...@@ -29,9 +29,9 @@ handlers: [ ...@@ -29,9 +29,9 @@ handlers: [
snippet: " snippet: "
var a = 1; return [ a, a + 1 ]; var a = 1; return [ a, a + 1 ];
" "
frame size: 4 frame size: 3
parameter count: 1 parameter count: 1
bytecode array length: 39 bytecode array length: 35
bytecodes: [ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(1), /* 42 S> */ B(LdaSmi), U8(1),
...@@ -44,10 +44,8 @@ bytecodes: [ ...@@ -44,10 +44,8 @@ bytecodes: [
B(StaKeyedPropertySloppy), R(2), R(1), U8(1), B(StaKeyedPropertySloppy), R(2), R(1), U8(1),
B(LdaSmi), U8(1), B(LdaSmi), U8(1),
B(Star), R(1), B(Star), R(1),
/* 57 E> */ B(Ldar), R(0), /* 57 E> */ B(LdaSmi), U8(1),
B(Star), R(3), B(Add), R(0),
B(LdaSmi), U8(1),
B(Add), R(3),
B(StaKeyedPropertySloppy), R(2), R(1), U8(1), B(StaKeyedPropertySloppy), R(2), R(1), U8(1),
B(Ldar), R(2), B(Ldar), R(2),
/* 66 S> */ B(Return), /* 66 S> */ B(Return),
...@@ -80,9 +78,9 @@ handlers: [ ...@@ -80,9 +78,9 @@ handlers: [
snippet: " snippet: "
var a = 1; return [ [ a, 2 ], [ a + 2 ] ]; var a = 1; return [ [ a, 2 ], [ a + 2 ] ];
" "
frame size: 6 frame size: 5
parameter count: 1 parameter count: 1
bytecode array length: 69 bytecode array length: 65
bytecodes: [ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(1), /* 42 S> */ B(LdaSmi), U8(1),
...@@ -105,10 +103,8 @@ bytecodes: [ ...@@ -105,10 +103,8 @@ bytecodes: [
B(Star), R(4), B(Star), R(4),
B(LdaZero), B(LdaZero),
B(Star), R(3), B(Star), R(3),
/* 66 E> */ B(Ldar), R(0), /* 66 E> */ B(LdaSmi), U8(2),
B(Star), R(5), B(Add), R(0),
B(LdaSmi), U8(2),
B(Add), R(5),
B(StaKeyedPropertySloppy), R(4), R(3), U8(3), B(StaKeyedPropertySloppy), R(4), R(3), U8(3),
B(Ldar), R(4), B(Ldar), R(4),
B(StaKeyedPropertySloppy), R(2), R(1), U8(5), B(StaKeyedPropertySloppy), R(2), R(1), U8(5),
......
...@@ -68,13 +68,13 @@ snippet: " ...@@ -68,13 +68,13 @@ snippet: "
" "
frame size: 3 frame size: 3
parameter count: 1 parameter count: 1
bytecode array length: 25 bytecode array length: 26
bytecodes: [ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(55), /* 42 S> */ B(LdaSmi), U8(55),
B(Star), R(0), B(Star), R(0),
/* 46 S> */ B(Star), R(1), /* 46 S> */ B(LdaSmi), U8(100),
B(LdaSmi), U8(100), B(Mov), R(0), R(1),
/* 57 E> */ B(Star), R(0), /* 57 E> */ B(Star), R(0),
B(Add), R(1), B(Add), R(1),
B(Star), R(2), B(Star), R(2),
...@@ -99,16 +99,14 @@ snippet: " ...@@ -99,16 +99,14 @@ snippet: "
" "
frame size: 3 frame size: 3
parameter count: 1 parameter count: 1
bytecode array length: 33 bytecode array length: 29
bytecodes: [ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(55), /* 42 S> */ B(LdaSmi), U8(55),
B(Star), R(0), B(Star), R(0),
/* 46 S> */ B(LdaSmi), U8(56), /* 46 S> */ B(LdaSmi), U8(56),
/* 53 E> */ B(Star), R(0), /* 53 E> */ B(Star), R(0),
B(Star), R(1), /* 61 E> */ B(Sub), R(0),
/* 61 E> */ B(Ldar), R(0),
B(Sub), R(1),
B(Star), R(2), B(Star), R(2),
B(LdaSmi), U8(57), B(LdaSmi), U8(57),
/* 68 E> */ B(Star), R(0), /* 68 E> */ B(Star), R(0),
...@@ -134,13 +132,13 @@ snippet: " ...@@ -134,13 +132,13 @@ snippet: "
" "
frame size: 4 frame size: 4
parameter count: 1 parameter count: 1
bytecode array length: 33 bytecode array length: 34
bytecodes: [ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(55), /* 42 S> */ B(LdaSmi), U8(55),
B(Star), R(0), B(Star), R(0),
/* 76 S> */ B(Star), R(2), /* 76 S> */ B(LdaSmi), U8(1),
B(LdaSmi), U8(1), B(Mov), R(0), R(2),
/* 61 E> */ B(Star), R(0), /* 61 E> */ B(Star), R(0),
B(Add), R(2), B(Add), R(2),
B(Star), R(3), B(Star), R(3),
...@@ -168,13 +166,13 @@ snippet: " ...@@ -168,13 +166,13 @@ snippet: "
" "
frame size: 3 frame size: 3
parameter count: 1 parameter count: 1
bytecode array length: 33 bytecode array length: 34
bytecodes: [ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(55), /* 42 S> */ B(LdaSmi), U8(55),
B(Star), R(0), B(Star), R(0),
/* 76 S> */ B(Star), R(1), /* 76 S> */ B(LdaSmi), U8(1),
B(LdaSmi), U8(1), B(Mov), R(0), R(1),
/* 61 E> */ B(Star), R(0), /* 61 E> */ B(Star), R(0),
B(Add), R(1), B(Add), R(1),
B(Star), R(2), B(Star), R(2),
...@@ -201,23 +199,20 @@ snippet: " ...@@ -201,23 +199,20 @@ snippet: "
" "
frame size: 5 frame size: 5
parameter count: 1 parameter count: 1
bytecode array length: 70 bytecode array length: 65
bytecodes: [ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(10), /* 42 S> */ B(LdaSmi), U8(10),
B(Star), R(0), B(Star), R(0),
/* 50 S> */ B(LdaSmi), U8(20), /* 50 S> */ B(LdaSmi), U8(20),
B(Star), R(1), B(Star), R(1),
/* 54 S> */ B(Ldar), R(0), /* 54 S> */ B(LdaSmi), U8(1),
B(Star), R(2), B(Mov), R(0), R(2),
B(LdaSmi), U8(1),
/* 68 E> */ B(Star), R(0), /* 68 E> */ B(Star), R(0),
B(Add), R(2), B(Add), R(2),
B(Star), R(3), B(Star), R(3),
/* 76 E> */ B(Ldar), R(0), /* 76 E> */ B(LdaSmi), U8(1),
B(Star), R(2), B(Add), R(0),
B(LdaSmi), U8(1),
B(Add), R(2),
B(Star), R(4), B(Star), R(4),
B(LdaSmi), U8(2), B(LdaSmi), U8(2),
/* 88 E> */ B(Star), R(1), /* 88 E> */ B(Star), R(1),
......
...@@ -11,18 +11,16 @@ wrap: yes ...@@ -11,18 +11,16 @@ wrap: yes
snippet: " snippet: "
var a = 1; if (a || a < 0) { return 1; } var a = 1; if (a || a < 0) { return 1; }
" "
frame size: 2 frame size: 1
parameter count: 1 parameter count: 1
bytecode array length: 21 bytecode array length: 17
bytecodes: [ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(1), /* 42 S> */ B(LdaSmi), U8(1),
B(Star), R(0), B(Star), R(0),
/* 45 S> */ B(JumpIfToBooleanTrue), U8(9), /* 45 S> */ B(JumpIfToBooleanTrue), U8(5),
/* 54 E> */ B(Ldar), R(0), /* 54 E> */ B(LdaZero),
B(Star), R(1), /* 56 E> */ B(TestLessThan), R(0),
B(LdaZero),
/* 56 E> */ B(TestLessThan), R(1),
B(JumpIfToBooleanFalse), U8(5), B(JumpIfToBooleanFalse), U8(5),
/* 63 S> */ B(LdaSmi), U8(1), /* 63 S> */ B(LdaSmi), U8(1),
/* 75 S> */ B(Return), /* 75 S> */ B(Return),
...@@ -38,18 +36,16 @@ handlers: [ ...@@ -38,18 +36,16 @@ handlers: [
snippet: " snippet: "
var a = 1; if (a && a < 0) { return 1; } var a = 1; if (a && a < 0) { return 1; }
" "
frame size: 2 frame size: 1
parameter count: 1 parameter count: 1
bytecode array length: 21 bytecode array length: 17
bytecodes: [ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(1), /* 42 S> */ B(LdaSmi), U8(1),
B(Star), R(0), B(Star), R(0),
/* 45 S> */ B(JumpIfToBooleanFalse), U8(9), /* 45 S> */ B(JumpIfToBooleanFalse), U8(5),
/* 54 E> */ B(Ldar), R(0), /* 54 E> */ B(LdaZero),
B(Star), R(1), /* 56 E> */ B(TestLessThan), R(0),
B(LdaZero),
/* 56 E> */ B(TestLessThan), R(1),
B(JumpIfToBooleanFalse), U8(5), B(JumpIfToBooleanFalse), U8(5),
/* 63 S> */ B(LdaSmi), U8(1), /* 63 S> */ B(LdaSmi), U8(1),
/* 75 S> */ B(Return), /* 75 S> */ B(Return),
...@@ -65,18 +61,16 @@ handlers: [ ...@@ -65,18 +61,16 @@ handlers: [
snippet: " snippet: "
var a = 1; a = (a || a < 0) ? 2 : 3; var a = 1; a = (a || a < 0) ? 2 : 3;
" "
frame size: 2 frame size: 1
parameter count: 1 parameter count: 1
bytecode array length: 26 bytecode array length: 22
bytecodes: [ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(1), /* 42 S> */ B(LdaSmi), U8(1),
B(Star), R(0), B(Star), R(0),
/* 45 S> */ B(JumpIfToBooleanTrue), U8(9), /* 45 S> */ B(JumpIfToBooleanTrue), U8(5),
/* 55 E> */ B(Ldar), R(0), /* 55 E> */ B(LdaZero),
B(Star), R(1), /* 57 E> */ B(TestLessThan), R(0),
B(LdaZero),
/* 57 E> */ B(TestLessThan), R(1),
B(JumpIfToBooleanFalse), U8(6), B(JumpIfToBooleanFalse), U8(6),
B(LdaSmi), U8(2), B(LdaSmi), U8(2),
B(Jump), U8(4), B(Jump), U8(4),
......
...@@ -17,16 +17,15 @@ snippet: " ...@@ -17,16 +17,15 @@ snippet: "
} }
return x; return x;
" "
frame size: 2 frame size: 1
parameter count: 1 parameter count: 1
bytecode array length: 17 bytecode array length: 15
bytecodes: [ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaZero), /* 42 S> */ B(LdaZero),
B(Star), R(0), B(Star), R(0),
/* 56 S> */ B(Star), R(1), /* 56 S> */ B(LdaSmi), U8(1),
B(LdaSmi), U8(1), B(Add), R(0),
B(Add), R(1),
B(Star), R(0), B(Star), R(0),
/* 69 S> */ B(Jump), U8(2), /* 69 S> */ B(Jump), U8(2),
/* 97 S> */ B(Ldar), R(0), /* 97 S> */ B(Ldar), R(0),
...@@ -52,34 +51,29 @@ snippet: " ...@@ -52,34 +51,29 @@ snippet: "
" "
frame size: 5 frame size: 5
parameter count: 1 parameter count: 1
bytecode array length: 72 bytecode array length: 61
bytecodes: [ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 44 S> */ B(LdaZero), /* 44 S> */ B(LdaZero),
B(Star), R(0), B(Star), R(0),
/* 71 S> */ B(LdaZero), /* 71 S> */ B(LdaZero),
/* 71 E> */ B(Star), R(1), /* 71 E> */ B(Star), R(1),
/* 76 S> */ B(Ldar), R(1), /* 76 S> */ B(LdaSmi), U8(10),
B(Star), R(3), /* 76 E> */ B(TestLessThan), R(1),
B(LdaSmi), U8(10), B(JumpIfFalse), U8(47),
/* 76 E> */ B(TestLessThan), R(3),
B(JumpIfFalse), U8(54),
/* 58 E> */ B(StackCheck), /* 58 E> */ B(StackCheck),
/* 106 S> */ B(LdaZero), /* 106 S> */ B(LdaZero),
/* 106 E> */ B(Star), R(2), /* 106 E> */ B(Star), R(2),
/* 111 S> */ B(Ldar), R(2), /* 111 S> */ B(LdaSmi), U8(3),
B(Star), R(3), /* 111 E> */ B(TestLessThan), R(2),
B(LdaSmi), U8(3), B(JumpIfFalse), U8(30),
/* 111 E> */ B(TestLessThan), R(3),
B(JumpIfFalse), U8(33),
/* 93 E> */ B(StackCheck), /* 93 E> */ B(StackCheck),
/* 129 S> */ B(Ldar), R(0), /* 129 S> */ B(Ldar), R(0),
B(Inc), B(Inc),
B(Star), R(0), B(Star), R(0),
/* 142 S> */ B(Ldar), R(1), /* 142 S> */ B(Nop),
B(Star), R(3),
/* 150 E> */ B(Ldar), R(2), /* 150 E> */ B(Ldar), R(2),
B(Add), R(3), B(Add), R(1),
B(Star), R(4), B(Star), R(4),
B(LdaSmi), U8(12), B(LdaSmi), U8(12),
/* 152 E> */ B(TestEqual), R(4), /* 152 E> */ B(TestEqual), R(4),
...@@ -88,11 +82,11 @@ bytecodes: [ ...@@ -88,11 +82,11 @@ bytecodes: [
/* 118 S> */ B(Ldar), R(2), /* 118 S> */ B(Ldar), R(2),
B(Inc), B(Inc),
/* 118 E> */ B(Star), R(2), /* 118 E> */ B(Star), R(2),
B(Jump), U8(-39), B(Jump), U8(-32),
/* 84 S> */ B(Ldar), R(1), /* 84 S> */ B(Ldar), R(1),
B(Inc), B(Inc),
/* 84 E> */ B(Star), R(1), /* 84 E> */ B(Star), R(1),
B(Jump), U8(-60), B(Jump), U8(-49),
/* 188 S> */ B(Ldar), R(0), /* 188 S> */ B(Ldar), R(0),
/* 200 S> */ B(Return), /* 200 S> */ B(Return),
] ]
...@@ -111,13 +105,12 @@ snippet: " ...@@ -111,13 +105,12 @@ snippet: "
" "
frame size: 5 frame size: 5
parameter count: 1 parameter count: 1
bytecode array length: 51 bytecode array length: 50
bytecodes: [ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
B(LdaConstant), U8(0), B(LdaConstant), U8(0),
B(Star), R(3), B(Star), R(3),
B(Ldar), R(closure), B(Mov), R(closure), R(4),
B(Star), R(4),
B(CallRuntime), U16(Runtime::kPushBlockContext), R(3), U8(2), B(CallRuntime), U16(Runtime::kPushBlockContext), R(3), U8(2),
B(PushContext), R(2), B(PushContext), R(2),
B(LdaTheHole), B(LdaTheHole),
...@@ -160,7 +153,7 @@ snippet: " ...@@ -160,7 +153,7 @@ snippet: "
" "
frame size: 6 frame size: 6
parameter count: 1 parameter count: 1
bytecode array length: 131 bytecode array length: 130
bytecodes: [ bytecodes: [
B(CallRuntime), U16(Runtime::kNewFunctionContext), R(closure), U8(1), B(CallRuntime), U16(Runtime::kNewFunctionContext), R(closure), U8(1),
B(PushContext), R(2), B(PushContext), R(2),
...@@ -171,8 +164,7 @@ bytecodes: [ ...@@ -171,8 +164,7 @@ bytecodes: [
/* 42 E> */ B(StaContextSlot), R(context), U8(4), /* 42 E> */ B(StaContextSlot), R(context), U8(4),
B(LdaConstant), U8(0), B(LdaConstant), U8(0),
B(Star), R(4), B(Star), R(4),
B(Ldar), R(closure), B(Mov), R(closure), R(5),
B(Star), R(5),
B(CallRuntime), U16(Runtime::kPushBlockContext), R(4), U8(2), B(CallRuntime), U16(Runtime::kPushBlockContext), R(4), U8(2),
B(PushContext), R(3), B(PushContext), R(3),
B(LdaTheHole), B(LdaTheHole),
......
...@@ -31,15 +31,15 @@ bytecodes: [ ...@@ -31,15 +31,15 @@ bytecodes: [
B(CallRuntimeForPair), U16(Runtime::kLoadLookupSlotForCall), R(3), U8(1), R(1), B(CallRuntimeForPair), U16(Runtime::kLoadLookupSlotForCall), R(3), U8(1), R(1),
B(LdaConstant), U8(3), B(LdaConstant), U8(3),
B(Star), R(3), B(Star), R(3),
B(Mov), R(1), R(4),
B(Mov), R(3), R(5),
B(Mov), R(closure), R(6),
B(LdaZero), B(LdaZero),
B(Star), R(7), B(Star), R(7),
B(LdaSmi), U8(30), B(LdaSmi), U8(30),
B(Star), R(8), B(Star), R(8),
B(LdaSmi), U8(52), B(LdaSmi), U8(52),
B(Star), R(9), B(Star), R(9),
B(Mov), R(1), R(4),
B(Mov), R(3), R(5),
B(Mov), R(closure), R(6),
B(CallRuntime), U16(Runtime::kResolvePossiblyDirectEval), R(4), U8(6), B(CallRuntime), U16(Runtime::kResolvePossiblyDirectEval), R(4), U8(6),
B(Star), R(1), B(Star), R(1),
/* 52 E> */ B(Call), R(1), R(2), U8(2), U8(0), /* 52 E> */ B(Call), R(1), R(2), U8(2), U8(0),
......
...@@ -32,14 +32,12 @@ snippet: " ...@@ -32,14 +32,12 @@ snippet: "
function f(a) { return %IsArray(a) } function f(a) { return %IsArray(a) }
f(undefined); f(undefined);
" "
frame size: 1 frame size: 0
parameter count: 2 parameter count: 2
bytecode array length: 11 bytecode array length: 7
bytecodes: [ bytecodes: [
/* 10 E> */ B(StackCheck), /* 10 E> */ B(StackCheck),
/* 16 S> */ B(Ldar), R(arg0), /* 16 S> */ B(CallRuntime), U16(Runtime::kIsArray), R(arg0), U8(1),
B(Star), R(0),
B(CallRuntime), U16(Runtime::kIsArray), R(0), U8(1),
/* 35 S> */ B(Return), /* 35 S> */ B(Return),
] ]
constant pool: [ constant pool: [
......
...@@ -24,14 +24,13 @@ snippet: " ...@@ -24,14 +24,13 @@ snippet: "
" "
frame size: 7 frame size: 7
parameter count: 1 parameter count: 1
bytecode array length: 56 bytecode array length: 55
bytecodes: [ bytecodes: [
B(Ldar), R(closure), B(Mov), R(closure), R(0),
B(Star), R(0),
/* 99 E> */ B(StackCheck), /* 99 E> */ B(StackCheck),
/* 104 S> */ B(Ldar), R(this), /* 104 S> */ B(Nop),
B(Star), R(3), /* 111 E> */ B(Ldar), R(closure),
/* 111 E> */ B(Ldar), R(0), B(Mov), R(this), R(3),
B(JumpIfNotHole), U8(11), B(JumpIfNotHole), U8(11),
B(LdaConstant), U8(0), B(LdaConstant), U8(0),
B(Star), R(6), B(Star), R(6),
...@@ -75,14 +74,13 @@ snippet: " ...@@ -75,14 +74,13 @@ snippet: "
" "
frame size: 6 frame size: 6
parameter count: 1 parameter count: 1
bytecode array length: 78 bytecode array length: 77
bytecodes: [ bytecodes: [
B(Ldar), R(closure), B(Mov), R(closure), R(0),
B(Star), R(0),
/* 125 E> */ B(StackCheck), /* 125 E> */ B(StackCheck),
/* 130 S> */ B(Ldar), R(this), /* 130 S> */ B(Nop),
B(Star), R(1), /* 130 E> */ B(Ldar), R(closure),
/* 130 E> */ B(Ldar), R(0), B(Mov), R(this), R(1),
B(JumpIfNotHole), U8(11), B(JumpIfNotHole), U8(11),
B(LdaConstant), U8(0), B(LdaConstant), U8(0),
B(Star), R(5), B(Star), R(5),
...@@ -95,9 +93,9 @@ bytecodes: [ ...@@ -95,9 +93,9 @@ bytecodes: [
B(LdaSmi), U8(2), B(LdaSmi), U8(2),
/* 138 E> */ B(Star), R(4), /* 138 E> */ B(Star), R(4),
B(CallRuntime), U16(Runtime::kStoreToSuper_Strict), R(1), U8(4), B(CallRuntime), U16(Runtime::kStoreToSuper_Strict), R(1), U8(4),
/* 143 S> */ B(Ldar), R(this), /* 143 S> */ B(Nop),
B(Star), R(1),
/* 150 E> */ B(Ldar), R(0), /* 150 E> */ B(Ldar), R(0),
B(Mov), R(this), R(1),
B(JumpIfNotHole), U8(11), B(JumpIfNotHole), U8(11),
B(LdaConstant), U8(0), B(LdaConstant), U8(0),
B(Star), R(4), B(Star), R(4),
...@@ -133,14 +131,12 @@ snippet: " ...@@ -133,14 +131,12 @@ snippet: "
" "
frame size: 5 frame size: 5
parameter count: 1 parameter count: 1
bytecode array length: 106 bytecode array length: 105
bytecodes: [ bytecodes: [
B(Ldar), R(closure), B(Mov), R(closure), R(1),
B(Star), R(1), B(Mov), R(new_target), R(0),
B(Ldar), R(new_target),
B(Star), R(0),
/* 113 E> */ B(StackCheck), /* 113 E> */ B(StackCheck),
/* 118 S> */ B(Ldar), R(1), /* 118 S> */ B(Ldar), R(closure),
B(JumpIfNotHole), U8(11), B(JumpIfNotHole), U8(11),
B(LdaConstant), U8(0), B(LdaConstant), U8(0),
B(Star), R(3), B(Star), R(3),
...@@ -163,9 +159,9 @@ bytecodes: [ ...@@ -163,9 +159,9 @@ bytecodes: [
B(LdaConstant), U8(2), B(LdaConstant), U8(2),
B(Star), R(3), B(Star), R(3),
B(CallRuntime), U16(Runtime::kThrowReferenceError), R(3), U8(1), B(CallRuntime), U16(Runtime::kThrowReferenceError), R(3), U8(1),
B(Ldar), R(2), B(Mov), R(2), R(this),
B(Star), R(this), /* 128 S> */ B(Ldar), R(this),
/* 128 S> */ B(JumpIfNotHole), U8(11), B(JumpIfNotHole), U8(11),
B(LdaConstant), U8(2), B(LdaConstant), U8(2),
B(Star), R(2), B(Star), R(2),
B(CallRuntime), U16(Runtime::kThrowReferenceError), R(2), U8(1), B(CallRuntime), U16(Runtime::kThrowReferenceError), R(2), U8(1),
...@@ -203,14 +199,12 @@ snippet: " ...@@ -203,14 +199,12 @@ snippet: "
" "
frame size: 4 frame size: 4
parameter count: 1 parameter count: 1
bytecode array length: 102 bytecode array length: 101
bytecodes: [ bytecodes: [
B(Ldar), R(closure), B(Mov), R(closure), R(1),
B(Star), R(1), B(Mov), R(new_target), R(0),
B(Ldar), R(new_target),
B(Star), R(0),
/* 112 E> */ B(StackCheck), /* 112 E> */ B(StackCheck),
/* 117 S> */ B(Ldar), R(1), /* 117 S> */ B(Ldar), R(closure),
B(JumpIfNotHole), U8(11), B(JumpIfNotHole), U8(11),
B(LdaConstant), U8(0), B(LdaConstant), U8(0),
B(Star), R(3), B(Star), R(3),
...@@ -231,9 +225,9 @@ bytecodes: [ ...@@ -231,9 +225,9 @@ bytecodes: [
B(LdaConstant), U8(2), B(LdaConstant), U8(2),
B(Star), R(3), B(Star), R(3),
B(CallRuntime), U16(Runtime::kThrowReferenceError), R(3), U8(1), B(CallRuntime), U16(Runtime::kThrowReferenceError), R(3), U8(1),
B(Ldar), R(2), B(Mov), R(2), R(this),
B(Star), R(this), /* 126 S> */ B(Ldar), R(this),
/* 126 S> */ B(JumpIfNotHole), U8(11), B(JumpIfNotHole), U8(11),
B(LdaConstant), U8(2), B(LdaConstant), U8(2),
B(Star), R(2), B(Star), R(2),
B(CallRuntime), U16(Runtime::kThrowReferenceError), R(2), U8(1), B(CallRuntime), U16(Runtime::kThrowReferenceError), R(2), U8(1),
......
...@@ -16,7 +16,7 @@ snippet: " ...@@ -16,7 +16,7 @@ snippet: "
" "
frame size: 9 frame size: 9
parameter count: 1 parameter count: 1
bytecode array length: 74 bytecode array length: 72
bytecodes: [ bytecodes: [
B(LdaTheHole), B(LdaTheHole),
B(Star), R(1), B(Star), R(1),
...@@ -34,8 +34,6 @@ bytecodes: [ ...@@ -34,8 +34,6 @@ bytecodes: [
B(CallRuntime), U16(Runtime::kDefineClass), R(2), U8(4), B(CallRuntime), U16(Runtime::kDefineClass), R(2), U8(4),
B(Star), R(2), B(Star), R(2),
B(LdrNamedProperty), R(2), U8(1), U8(1), R(3), B(LdrNamedProperty), R(2), U8(1), U8(1), R(3),
B(Ldar), R(3),
B(Mov), R(3), R(4),
B(LdaConstant), U8(2), B(LdaConstant), U8(2),
B(Star), R(5), B(Star), R(5),
B(CreateClosure), U8(3), U8(0), B(CreateClosure), U8(3), U8(0),
...@@ -44,6 +42,7 @@ bytecodes: [ ...@@ -44,6 +42,7 @@ bytecodes: [
B(Star), R(7), B(Star), R(7),
B(LdaZero), B(LdaZero),
B(Star), R(8), B(Star), R(8),
B(Mov), R(3), R(4),
B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(4), U8(5), B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(4), U8(5),
B(CallRuntime), U16(Runtime::kToFastProperties), R(2), U8(1), B(CallRuntime), U16(Runtime::kToFastProperties), R(2), U8(1),
B(Star), R(0), B(Star), R(0),
...@@ -69,7 +68,7 @@ snippet: " ...@@ -69,7 +68,7 @@ snippet: "
" "
frame size: 9 frame size: 9
parameter count: 1 parameter count: 1
bytecode array length: 74 bytecode array length: 72
bytecodes: [ bytecodes: [
B(LdaTheHole), B(LdaTheHole),
B(Star), R(1), B(Star), R(1),
...@@ -87,8 +86,6 @@ bytecodes: [ ...@@ -87,8 +86,6 @@ bytecodes: [
B(CallRuntime), U16(Runtime::kDefineClass), R(2), U8(4), B(CallRuntime), U16(Runtime::kDefineClass), R(2), U8(4),
B(Star), R(2), B(Star), R(2),
B(LdrNamedProperty), R(2), U8(1), U8(1), R(3), B(LdrNamedProperty), R(2), U8(1), U8(1), R(3),
B(Ldar), R(3),
B(Mov), R(3), R(4),
B(LdaConstant), U8(2), B(LdaConstant), U8(2),
B(Star), R(5), B(Star), R(5),
B(CreateClosure), U8(3), U8(0), B(CreateClosure), U8(3), U8(0),
...@@ -97,6 +94,7 @@ bytecodes: [ ...@@ -97,6 +94,7 @@ bytecodes: [
B(Star), R(7), B(Star), R(7),
B(LdaZero), B(LdaZero),
B(Star), R(8), B(Star), R(8),
B(Mov), R(3), R(4),
B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(4), U8(5), B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(4), U8(5),
B(CallRuntime), U16(Runtime::kToFastProperties), R(2), U8(1), B(CallRuntime), U16(Runtime::kToFastProperties), R(2), U8(1),
B(Star), R(0), B(Star), R(0),
...@@ -124,7 +122,7 @@ snippet: " ...@@ -124,7 +122,7 @@ snippet: "
" "
frame size: 10 frame size: 10
parameter count: 1 parameter count: 1
bytecode array length: 128 bytecode array length: 126
bytecodes: [ bytecodes: [
B(CallRuntime), U16(Runtime::kNewFunctionContext), R(closure), U8(1), B(CallRuntime), U16(Runtime::kNewFunctionContext), R(closure), U8(1),
B(PushContext), R(2), B(PushContext), R(2),
...@@ -148,8 +146,6 @@ bytecodes: [ ...@@ -148,8 +146,6 @@ bytecodes: [
B(CallRuntime), U16(Runtime::kDefineClass), R(3), U8(4), B(CallRuntime), U16(Runtime::kDefineClass), R(3), U8(4),
B(Star), R(3), B(Star), R(3),
B(LdrNamedProperty), R(3), U8(3), U8(1), R(4), B(LdrNamedProperty), R(3), U8(3), U8(1), R(4),
B(Ldar), R(4),
B(Mov), R(4), R(5),
/* 75 E> */ B(LdaContextSlot), R(context), U8(4), /* 75 E> */ B(LdaContextSlot), R(context), U8(4),
B(ToName), B(ToName),
B(Star), R(6), B(Star), R(6),
...@@ -159,14 +155,15 @@ bytecodes: [ ...@@ -159,14 +155,15 @@ bytecodes: [
B(Star), R(8), B(Star), R(8),
B(LdaSmi), U8(1), B(LdaSmi), U8(1),
B(Star), R(9), B(Star), R(9),
B(Mov), R(4), R(5),
B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(5), U8(5), B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(5), U8(5),
B(Mov), R(3), R(5),
/* 106 E> */ B(LdaContextSlot), R(context), U8(5), /* 106 E> */ B(LdaContextSlot), R(context), U8(5),
B(ToName), B(ToName),
B(Star), R(6), B(Star), R(6),
B(LdaConstant), U8(3), B(LdaConstant), U8(3),
B(TestEqualStrict), R(6), B(TestEqualStrict), R(6),
B(JumpIfFalse), U8(7), B(Mov), R(3), R(5),
B(JumpIfToBooleanFalse), U8(7),
B(CallRuntime), U16(Runtime::kThrowStaticPrototypeError), R(0), U8(0), B(CallRuntime), U16(Runtime::kThrowStaticPrototypeError), R(0), U8(0),
B(CreateClosure), U8(5), U8(0), B(CreateClosure), U8(5), U8(0),
B(Star), R(7), B(Star), R(7),
......
...@@ -13,14 +13,14 @@ snippet: " ...@@ -13,14 +13,14 @@ snippet: "
" "
frame size: 2 frame size: 2
parameter count: 1 parameter count: 1
bytecode array length: 15 bytecode array length: 16
bytecodes: [ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(1), /* 42 S> */ B(LdaSmi), U8(1),
B(Star), R(0), B(Star), R(0),
/* 45 S> */ B(Star), R(1), /* 45 S> */ B(LdaSmi), U8(2),
B(LdaSmi), U8(2), B(Add), R(0),
B(Add), R(1), B(Mov), R(0), R(1),
/* 47 E> */ B(Star), R(0), /* 47 E> */ B(Star), R(0),
B(LdaUndefined), B(LdaUndefined),
/* 53 S> */ B(Return), /* 53 S> */ B(Return),
...@@ -36,14 +36,14 @@ snippet: " ...@@ -36,14 +36,14 @@ snippet: "
" "
frame size: 2 frame size: 2
parameter count: 1 parameter count: 1
bytecode array length: 15 bytecode array length: 16
bytecodes: [ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(1), /* 42 S> */ B(LdaSmi), U8(1),
B(Star), R(0), B(Star), R(0),
/* 45 S> */ B(Star), R(1), /* 45 S> */ B(LdaSmi), U8(2),
B(LdaSmi), U8(2), B(Div), R(0),
B(Div), R(1), B(Mov), R(0), R(1),
/* 47 E> */ B(Star), R(0), /* 47 E> */ B(Star), R(0),
B(LdaUndefined), B(LdaUndefined),
/* 53 S> */ B(Return), /* 53 S> */ B(Return),
...@@ -59,17 +59,16 @@ snippet: " ...@@ -59,17 +59,16 @@ snippet: "
" "
frame size: 3 frame size: 3
parameter count: 1 parameter count: 1
bytecode array length: 26 bytecode array length: 24
bytecodes: [ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1), /* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
B(Star), R(1), B(Star), R(1),
B(Star), R(0), B(Star), R(0),
/* 54 S> */ B(Star), R(1), /* 54 S> */ B(LdrNamedProperty), R(0), U8(1), U8(1), R(2),
B(LdrNamedProperty), R(1), U8(1), U8(1), R(2),
B(LdaSmi), U8(2), B(LdaSmi), U8(2),
B(Mul), R(2), B(Mul), R(2),
/* 61 E> */ B(StaNamedPropertySloppy), R(1), U8(1), U8(3), /* 61 E> */ B(StaNamedPropertySloppy), R(0), U8(1), U8(3),
B(LdaUndefined), B(LdaUndefined),
/* 67 S> */ B(Return), /* 67 S> */ B(Return),
] ]
...@@ -86,19 +85,18 @@ snippet: " ...@@ -86,19 +85,18 @@ snippet: "
" "
frame size: 4 frame size: 4
parameter count: 1 parameter count: 1
bytecode array length: 29 bytecode array length: 27
bytecodes: [ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1), /* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
B(Star), R(1), B(Star), R(1),
B(Star), R(0), B(Star), R(0),
/* 52 S> */ B(Star), R(1), /* 52 S> */ B(LdaSmi), U8(1),
B(LdaSmi), U8(1),
B(Star), R(2), B(Star), R(2),
B(LdrKeyedProperty), R(1), U8(1), R(3), B(LdrKeyedProperty), R(0), U8(1), R(3),
B(LdaSmi), U8(2), B(LdaSmi), U8(2),
B(BitwiseXor), R(3), B(BitwiseXor), R(3),
/* 57 E> */ B(StaKeyedPropertySloppy), R(1), R(2), U8(3), /* 57 E> */ B(StaKeyedPropertySloppy), R(0), R(2), U8(3),
B(LdaUndefined), B(LdaUndefined),
/* 63 S> */ B(Return), /* 63 S> */ B(Return),
] ]
......
...@@ -59,7 +59,7 @@ snippet: " ...@@ -59,7 +59,7 @@ snippet: "
" "
frame size: 3 frame size: 3
parameter count: 1 parameter count: 1
bytecode array length: 32 bytecode array length: 33
bytecodes: [ bytecodes: [
B(LdaTheHole), B(LdaTheHole),
B(Star), R(0), B(Star), R(0),
...@@ -72,8 +72,8 @@ bytecodes: [ ...@@ -72,8 +72,8 @@ bytecodes: [
B(Star), R(2), B(Star), R(2),
B(CallRuntime), U16(Runtime::kThrowReferenceError), R(2), U8(1), B(CallRuntime), U16(Runtime::kThrowReferenceError), R(2), U8(1),
B(CallRuntime), U16(Runtime::kThrowConstAssignError), R(0), U8(0), B(CallRuntime), U16(Runtime::kThrowConstAssignError), R(0), U8(0),
B(Ldar), R(1), B(Mov), R(1), R(0),
B(Star), R(0), B(Ldar), R(0),
B(LdaUndefined), B(LdaUndefined),
/* 55 S> */ B(Return), /* 55 S> */ B(Return),
] ]
...@@ -89,7 +89,7 @@ snippet: " ...@@ -89,7 +89,7 @@ snippet: "
" "
frame size: 3 frame size: 3
parameter count: 1 parameter count: 1
bytecode array length: 36 bytecode array length: 35
bytecodes: [ bytecodes: [
B(LdaTheHole), B(LdaTheHole),
B(Star), R(0), B(Star), R(0),
...@@ -104,8 +104,7 @@ bytecodes: [ ...@@ -104,8 +104,7 @@ bytecodes: [
B(Star), R(2), B(Star), R(2),
B(CallRuntime), U16(Runtime::kThrowReferenceError), R(2), U8(1), B(CallRuntime), U16(Runtime::kThrowReferenceError), R(2), U8(1),
B(CallRuntime), U16(Runtime::kThrowConstAssignError), R(0), U8(0), B(CallRuntime), U16(Runtime::kThrowConstAssignError), R(0), U8(0),
B(Ldar), R(1), B(Mov), R(1), R(0),
B(Star), R(0),
B(LdaUndefined), B(LdaUndefined),
/* 56 S> */ B(Return), /* 56 S> */ B(Return),
] ]
......
...@@ -105,7 +105,7 @@ snippet: " ...@@ -105,7 +105,7 @@ snippet: "
" "
frame size: 4 frame size: 4
parameter count: 1 parameter count: 1
bytecode array length: 47 bytecode array length: 46
bytecodes: [ bytecodes: [
B(CallRuntime), U16(Runtime::kNewFunctionContext), R(closure), U8(1), B(CallRuntime), U16(Runtime::kNewFunctionContext), R(closure), U8(1),
B(PushContext), R(0), B(PushContext), R(0),
...@@ -116,8 +116,7 @@ bytecodes: [ ...@@ -116,8 +116,7 @@ bytecodes: [
/* 56 E> */ B(StaContextSlot), R(context), U8(4), /* 56 E> */ B(StaContextSlot), R(context), U8(4),
B(LdaConstant), U8(0), B(LdaConstant), U8(0),
B(Star), R(2), B(Star), R(2),
B(Ldar), R(closure), B(Mov), R(closure), R(3),
B(Star), R(3),
B(CallRuntime), U16(Runtime::kPushBlockContext), R(2), U8(2), B(CallRuntime), U16(Runtime::kPushBlockContext), R(2), U8(2),
B(PushContext), R(1), B(PushContext), R(1),
B(LdaTheHole), B(LdaTheHole),
......
...@@ -99,18 +99,17 @@ snippet: " ...@@ -99,18 +99,17 @@ snippet: "
" "
frame size: 3 frame size: 3
parameter count: 1 parameter count: 1
bytecode array length: 26 bytecode array length: 24
bytecodes: [ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1), /* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
B(Star), R(1), B(Star), R(1),
B(Star), R(0), B(Star), R(0),
/* 54 S> */ B(Star), R(1), /* 54 S> */ B(LdaNamedProperty), R(0), U8(1), U8(1),
B(LdaNamedProperty), R(1), U8(1), U8(1),
B(ToNumber), B(ToNumber),
B(Star), R(2), B(Star), R(2),
B(Inc), B(Inc),
/* 66 E> */ B(StaNamedPropertySloppy), R(1), U8(1), U8(3), /* 66 E> */ B(StaNamedPropertySloppy), R(0), U8(1), U8(3),
B(Ldar), R(2), B(Ldar), R(2),
/* 70 S> */ B(Return), /* 70 S> */ B(Return),
] ]
...@@ -127,16 +126,15 @@ snippet: " ...@@ -127,16 +126,15 @@ snippet: "
" "
frame size: 2 frame size: 2
parameter count: 1 parameter count: 1
bytecode array length: 21 bytecode array length: 19
bytecodes: [ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1), /* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
B(Star), R(1), B(Star), R(1),
B(Star), R(0), B(Star), R(0),
/* 54 S> */ B(Star), R(1), /* 54 S> */ B(LdaNamedProperty), R(0), U8(1), U8(1),
B(LdaNamedProperty), R(1), U8(1), U8(1),
B(Dec), B(Dec),
/* 65 E> */ B(StaNamedPropertySloppy), R(1), U8(1), U8(3), /* 65 E> */ B(StaNamedPropertySloppy), R(0), U8(1), U8(3),
/* 70 S> */ B(Return), /* 70 S> */ B(Return),
] ]
constant pool: [ constant pool: [
...@@ -152,7 +150,7 @@ snippet: " ...@@ -152,7 +150,7 @@ snippet: "
" "
frame size: 5 frame size: 5
parameter count: 1 parameter count: 1
bytecode array length: 33 bytecode array length: 30
bytecodes: [ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 45 S> */ B(LdaConstant), U8(0), /* 45 S> */ B(LdaConstant), U8(0),
...@@ -160,14 +158,13 @@ bytecodes: [ ...@@ -160,14 +158,13 @@ bytecodes: [
/* 60 S> */ B(CreateObjectLiteral), U8(1), U8(0), U8(1), /* 60 S> */ B(CreateObjectLiteral), U8(1), U8(0), U8(1),
B(Star), R(2), B(Star), R(2),
B(Star), R(1), B(Star), R(1),
/* 72 S> */ B(Star), R(2), /* 72 S> */ B(Nop),
/* 81 E> */ B(Ldar), R(0), /* 81 E> */ B(Ldar), R(0),
B(Star), R(3), B(LdaKeyedProperty), R(1), U8(1),
B(LdaKeyedProperty), R(2), U8(1),
B(ToNumber), B(ToNumber),
B(Star), R(4), B(Star), R(4),
B(Dec), B(Dec),
/* 86 E> */ B(StaKeyedPropertySloppy), R(2), R(3), U8(3), /* 86 E> */ B(StaKeyedPropertySloppy), R(1), R(0), U8(3),
B(Ldar), R(4), B(Ldar), R(4),
/* 90 S> */ B(Return), /* 90 S> */ B(Return),
] ]
...@@ -182,9 +179,9 @@ handlers: [ ...@@ -182,9 +179,9 @@ handlers: [
snippet: " snippet: "
var name = 'var'; var a = { val: 1 }; return ++a[name]; var name = 'var'; var a = { val: 1 }; return ++a[name];
" "
frame size: 4 frame size: 3
parameter count: 1 parameter count: 1
bytecode array length: 28 bytecode array length: 25
bytecodes: [ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 45 S> */ B(LdaConstant), U8(0), /* 45 S> */ B(LdaConstant), U8(0),
...@@ -192,12 +189,11 @@ bytecodes: [ ...@@ -192,12 +189,11 @@ bytecodes: [
/* 60 S> */ B(CreateObjectLiteral), U8(1), U8(0), U8(1), /* 60 S> */ B(CreateObjectLiteral), U8(1), U8(0), U8(1),
B(Star), R(2), B(Star), R(2),
B(Star), R(1), B(Star), R(1),
/* 72 S> */ B(Star), R(2), /* 72 S> */ B(Nop),
/* 83 E> */ B(Ldar), R(0), /* 83 E> */ B(Ldar), R(0),
B(Star), R(3), B(LdaKeyedProperty), R(1), U8(1),
B(LdaKeyedProperty), R(2), U8(1),
B(Inc), B(Inc),
/* 87 E> */ B(StaKeyedPropertySloppy), R(2), R(3), U8(3), /* 87 E> */ B(StaKeyedPropertySloppy), R(1), R(0), U8(3),
/* 90 S> */ B(Return), /* 90 S> */ B(Return),
] ]
constant pool: [ constant pool: [
...@@ -268,21 +264,20 @@ snippet: " ...@@ -268,21 +264,20 @@ snippet: "
" "
frame size: 4 frame size: 4
parameter count: 1 parameter count: 1
bytecode array length: 28 bytecode array length: 26
bytecodes: [ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 44 S> */ B(LdaSmi), U8(1), /* 44 S> */ B(LdaSmi), U8(1),
B(Star), R(0), B(Star), R(0),
/* 55 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(3), /* 55 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(3),
B(Star), R(1), B(Star), R(1),
/* 63 S> */ B(Star), R(2), /* 63 S> */ B(Ldar), R(0),
B(Ldar), R(0),
B(ToNumber), B(ToNumber),
B(Star), R(3), B(Star), R(3),
B(Inc), B(Inc),
/* 75 E> */ B(Star), R(0), /* 75 E> */ B(Star), R(0),
B(LdaSmi), U8(2), B(LdaSmi), U8(2),
/* 79 E> */ B(StaKeyedPropertySloppy), R(2), R(3), U8(1), /* 79 E> */ B(StaKeyedPropertySloppy), R(1), R(3), U8(1),
/* 84 S> */ B(Return), /* 84 S> */ B(Return),
] ]
constant pool: [ constant pool: [
......
...@@ -15,12 +15,12 @@ snippet: " ...@@ -15,12 +15,12 @@ snippet: "
" "
frame size: 1 frame size: 1
parameter count: 1 parameter count: 1
bytecode array length: 7 bytecode array length: 6
bytecodes: [ bytecodes: [
B(CreateMappedArguments), B(CreateMappedArguments),
B(Star), R(0), B(Star), R(0),
/* 10 E> */ B(StackCheck), /* 10 E> */ B(StackCheck),
/* 15 S> */ B(Ldar), R(0), /* 15 S> */ B(Nop),
/* 33 S> */ B(Return), /* 33 S> */ B(Return),
] ]
constant pool: [ constant pool: [
...@@ -33,17 +33,16 @@ snippet: " ...@@ -33,17 +33,16 @@ snippet: "
function f() { return arguments[0]; } function f() { return arguments[0]; }
f(); f();
" "
frame size: 2 frame size: 1
parameter count: 1 parameter count: 1
bytecode array length: 13 bytecode array length: 10
bytecodes: [ bytecodes: [
B(CreateMappedArguments), B(CreateMappedArguments),
B(Star), R(0), B(Star), R(0),
/* 10 E> */ B(StackCheck), /* 10 E> */ B(StackCheck),
/* 15 S> */ B(Ldar), R(0), /* 15 S> */ B(Nop),
B(Star), R(1),
/* 31 E> */ B(LdaZero), /* 31 E> */ B(LdaZero),
B(LdaKeyedProperty), R(1), U8(1), B(LdaKeyedProperty), R(0), U8(1),
/* 36 S> */ B(Return), /* 36 S> */ B(Return),
] ]
constant pool: [ constant pool: [
...@@ -58,12 +57,12 @@ snippet: " ...@@ -58,12 +57,12 @@ snippet: "
" "
frame size: 1 frame size: 1
parameter count: 1 parameter count: 1
bytecode array length: 7 bytecode array length: 6
bytecodes: [ bytecodes: [
B(CreateUnmappedArguments), B(CreateUnmappedArguments),
B(Star), R(0), B(Star), R(0),
/* 10 E> */ B(StackCheck), /* 10 E> */ B(StackCheck),
/* 29 S> */ B(Ldar), R(0), /* 29 S> */ B(Nop),
/* 47 S> */ B(Return), /* 47 S> */ B(Return),
] ]
constant pool: [ constant pool: [
...@@ -76,9 +75,9 @@ snippet: " ...@@ -76,9 +75,9 @@ snippet: "
function f(a) { return arguments[0]; } function f(a) { return arguments[0]; }
f(); f();
" "
frame size: 3 frame size: 2
parameter count: 2 parameter count: 2
bytecode array length: 25 bytecode array length: 22
bytecodes: [ bytecodes: [
B(CallRuntime), U16(Runtime::kNewFunctionContext), R(closure), U8(1), B(CallRuntime), U16(Runtime::kNewFunctionContext), R(closure), U8(1),
B(PushContext), R(1), B(PushContext), R(1),
...@@ -87,10 +86,9 @@ bytecodes: [ ...@@ -87,10 +86,9 @@ bytecodes: [
B(CreateMappedArguments), B(CreateMappedArguments),
B(Star), R(0), B(Star), R(0),
/* 10 E> */ B(StackCheck), /* 10 E> */ B(StackCheck),
/* 16 S> */ B(Ldar), R(0), /* 16 S> */ B(Nop),
B(Star), R(2),
/* 32 E> */ B(LdaZero), /* 32 E> */ B(LdaZero),
B(LdaKeyedProperty), R(2), U8(1), B(LdaKeyedProperty), R(0), U8(1),
/* 37 S> */ B(Return), /* 37 S> */ B(Return),
] ]
constant pool: [ constant pool: [
...@@ -105,7 +103,7 @@ snippet: " ...@@ -105,7 +103,7 @@ snippet: "
" "
frame size: 2 frame size: 2
parameter count: 4 parameter count: 4
bytecode array length: 29 bytecode array length: 28
bytecodes: [ bytecodes: [
B(CallRuntime), U16(Runtime::kNewFunctionContext), R(closure), U8(1), B(CallRuntime), U16(Runtime::kNewFunctionContext), R(closure), U8(1),
B(PushContext), R(1), B(PushContext), R(1),
...@@ -118,7 +116,7 @@ bytecodes: [ ...@@ -118,7 +116,7 @@ bytecodes: [
B(CreateMappedArguments), B(CreateMappedArguments),
B(Star), R(0), B(Star), R(0),
/* 10 E> */ B(StackCheck), /* 10 E> */ B(StackCheck),
/* 22 S> */ B(Ldar), R(0), /* 22 S> */ B(Nop),
/* 40 S> */ B(Return), /* 40 S> */ B(Return),
] ]
constant pool: [ constant pool: [
...@@ -133,12 +131,12 @@ snippet: " ...@@ -133,12 +131,12 @@ snippet: "
" "
frame size: 1 frame size: 1
parameter count: 4 parameter count: 4
bytecode array length: 7 bytecode array length: 6
bytecodes: [ bytecodes: [
B(CreateUnmappedArguments), B(CreateUnmappedArguments),
B(Star), R(0), B(Star), R(0),
/* 10 E> */ B(StackCheck), /* 10 E> */ B(StackCheck),
/* 36 S> */ B(Ldar), R(0), /* 36 S> */ B(Nop),
/* 54 S> */ B(Return), /* 54 S> */ B(Return),
] ]
constant pool: [ constant pool: [
......
...@@ -15,12 +15,12 @@ snippet: " ...@@ -15,12 +15,12 @@ snippet: "
" "
frame size: 1 frame size: 1
parameter count: 1 parameter count: 1
bytecode array length: 7 bytecode array length: 6
bytecodes: [ bytecodes: [
B(CreateRestParameter), B(CreateRestParameter),
B(Star), R(0), B(Star), R(0),
/* 10 E> */ B(StackCheck), /* 10 E> */ B(StackCheck),
/* 26 S> */ B(Ldar), R(0), /* 26 S> */ B(Nop),
/* 43 S> */ B(Return), /* 43 S> */ B(Return),
] ]
constant pool: [ constant pool: [
...@@ -35,15 +35,14 @@ snippet: " ...@@ -35,15 +35,14 @@ snippet: "
" "
frame size: 2 frame size: 2
parameter count: 2 parameter count: 2
bytecode array length: 14 bytecode array length: 13
bytecodes: [ bytecodes: [
B(CreateRestParameter), B(CreateRestParameter),
B(Star), R(0), B(Star), R(0),
B(LdaTheHole), B(LdaTheHole),
B(Star), R(1), B(Star), R(1),
/* 10 E> */ B(StackCheck), /* 10 E> */ B(StackCheck),
B(Ldar), R(arg0), B(Mov), R(arg0), R(1),
B(Star), R(1),
/* 29 S> */ B(Ldar), R(0), /* 29 S> */ B(Ldar), R(0),
/* 46 S> */ B(Return), /* 46 S> */ B(Return),
] ]
...@@ -57,21 +56,19 @@ snippet: " ...@@ -57,21 +56,19 @@ snippet: "
function f(a, ...restArgs) { return restArgs[0]; } function f(a, ...restArgs) { return restArgs[0]; }
f(); f();
" "
frame size: 3 frame size: 2
parameter count: 2 parameter count: 2
bytecode array length: 20 bytecode array length: 16
bytecodes: [ bytecodes: [
B(CreateRestParameter), B(CreateRestParameter),
B(Star), R(0), B(Star), R(0),
B(LdaTheHole), B(LdaTheHole),
B(Star), R(1), B(Star), R(1),
/* 10 E> */ B(StackCheck), /* 10 E> */ B(StackCheck),
B(Ldar), R(arg0), B(Mov), R(arg0), R(1),
B(Star), R(1), /* 29 S> */ B(Nop),
/* 29 S> */ B(Ldar), R(0),
B(Star), R(2),
/* 44 E> */ B(LdaZero), /* 44 E> */ B(LdaZero),
B(LdaKeyedProperty), R(2), U8(1), B(LdaKeyedProperty), R(0), U8(1),
/* 49 S> */ B(Return), /* 49 S> */ B(Return),
] ]
constant pool: [ constant pool: [
...@@ -86,7 +83,7 @@ snippet: " ...@@ -86,7 +83,7 @@ snippet: "
" "
frame size: 5 frame size: 5
parameter count: 2 parameter count: 2
bytecode array length: 34 bytecode array length: 29
bytecodes: [ bytecodes: [
B(CreateUnmappedArguments), B(CreateUnmappedArguments),
B(Star), R(0), B(Star), R(0),
...@@ -95,16 +92,14 @@ bytecodes: [ ...@@ -95,16 +92,14 @@ bytecodes: [
B(LdaTheHole), B(LdaTheHole),
B(Star), R(2), B(Star), R(2),
/* 10 E> */ B(StackCheck), /* 10 E> */ B(StackCheck),
B(Ldar), R(arg0), B(Mov), R(arg0), R(2),
B(Star), R(2), /* 29 S> */ B(Nop),
/* 29 S> */ B(Ldar), R(1),
B(Star), R(3),
/* 44 E> */ B(LdaZero), /* 44 E> */ B(LdaZero),
B(LdrKeyedProperty), R(3), U8(1), R(4), B(LdrKeyedProperty), R(1), U8(1), R(4),
/* 50 E> */ B(Ldar), R(0), B(Ldar), R(4),
B(Star), R(3), /* 50 E> */ B(Nop),
/* 59 E> */ B(LdaZero), /* 59 E> */ B(LdaZero),
B(LdaKeyedProperty), R(3), U8(3), B(LdaKeyedProperty), R(0), U8(3),
B(Add), R(4), B(Add), R(4),
/* 64 S> */ B(Return), /* 64 S> */ B(Return),
] ]
......
...@@ -13,15 +13,14 @@ snippet: " ...@@ -13,15 +13,14 @@ snippet: "
" "
frame size: 2 frame size: 2
parameter count: 1 parameter count: 1
bytecode array length: 16 bytecode array length: 14
bytecodes: [ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1), /* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
B(Star), R(1), B(Star), R(1),
B(Star), R(0), B(Star), R(0),
/* 56 S> */ B(Star), R(1), /* 56 S> */ B(LdaConstant), U8(1),
B(LdaConstant), U8(1), B(DeletePropertySloppy), R(0),
B(DeletePropertySloppy), R(1),
/* 75 S> */ B(Return), /* 75 S> */ B(Return),
] ]
constant pool: [ constant pool: [
...@@ -37,15 +36,14 @@ snippet: " ...@@ -37,15 +36,14 @@ snippet: "
" "
frame size: 2 frame size: 2
parameter count: 1 parameter count: 1
bytecode array length: 16 bytecode array length: 14
bytecodes: [ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 56 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1), /* 56 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
B(Star), R(1), B(Star), R(1),
B(Star), R(0), B(Star), R(0),
/* 70 S> */ B(Star), R(1), /* 70 S> */ B(LdaConstant), U8(1),
B(LdaConstant), U8(1), B(DeletePropertyStrict), R(0),
B(DeletePropertyStrict), R(1),
/* 89 S> */ B(Return), /* 89 S> */ B(Return),
] ]
constant pool: [ constant pool: [
...@@ -61,15 +59,14 @@ snippet: " ...@@ -61,15 +59,14 @@ snippet: "
" "
frame size: 2 frame size: 2
parameter count: 1 parameter count: 1
bytecode array length: 16 bytecode array length: 14
bytecodes: [ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1), /* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
B(Star), R(1), B(Star), R(1),
B(Star), R(0), B(Star), R(0),
/* 56 S> */ B(Star), R(1), /* 56 S> */ B(LdaSmi), U8(2),
B(LdaSmi), U8(2), B(DeletePropertySloppy), R(0),
B(DeletePropertySloppy), R(1),
/* 76 S> */ B(Return), /* 76 S> */ B(Return),
] ]
constant pool: [ constant pool: [
......
...@@ -14,12 +14,12 @@ snippet: " ...@@ -14,12 +14,12 @@ snippet: "
" "
frame size: 2 frame size: 2
parameter count: 1 parameter count: 1
bytecode array length: 7 bytecode array length: 8
bytecodes: [ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 42 S> */ B(Ldar), R(0), /* 42 S> */ B(Nop),
B(Star), R(1), B(Mov), R(0), R(1),
/* 50 S> */ B(Nop), /* 50 S> */ B(Ldar), R(1),
/* 60 S> */ B(Return), /* 60 S> */ B(Return),
] ]
constant pool: [ constant pool: [
...@@ -66,8 +66,8 @@ bytecodes: [ ...@@ -66,8 +66,8 @@ bytecodes: [
/* 71 E> */ B(Star), R(1), /* 71 E> */ B(Star), R(1),
B(Star), R(0), B(Star), R(0),
/* 74 S> */ B(Jump), U8(12), /* 74 S> */ B(Jump), U8(12),
/* 64 E> */ B(Ldar), R(0), /* 64 E> */ B(Nop),
B(Star), R(1), B(Mov), R(0), R(1),
/* 84 S> */ B(LdaSmi), U8(20), /* 84 S> */ B(LdaSmi), U8(20),
/* 86 E> */ B(Star), R(1), /* 86 E> */ B(Star), R(1),
B(Jump), U8(-20), B(Jump), U8(-20),
......
...@@ -29,15 +29,15 @@ bytecodes: [ ...@@ -29,15 +29,15 @@ bytecodes: [
B(CallRuntimeForPair), U16(Runtime::kLoadLookupSlotForCall), R(3), U8(1), R(1), B(CallRuntimeForPair), U16(Runtime::kLoadLookupSlotForCall), R(3), U8(1), R(1),
B(LdaConstant), U8(1), B(LdaConstant), U8(1),
B(Star), R(3), B(Star), R(3),
B(Mov), R(1), R(4),
B(Mov), R(3), R(5),
B(Mov), R(closure), R(6),
B(LdaZero), B(LdaZero),
B(Star), R(7), B(Star), R(7),
B(LdaSmi), U8(30), B(LdaSmi), U8(30),
B(Star), R(8), B(Star), R(8),
B(LdaSmi), U8(41), B(LdaSmi), U8(41),
B(Star), R(9), B(Star), R(9),
B(Mov), R(1), R(4),
B(Mov), R(3), R(5),
B(Mov), R(closure), R(6),
B(CallRuntime), U16(Runtime::kResolvePossiblyDirectEval), R(4), U8(6), B(CallRuntime), U16(Runtime::kResolvePossiblyDirectEval), R(4), U8(6),
B(Star), R(1), B(Star), R(1),
/* 41 E> */ B(Call), R(1), R(2), U8(2), U8(0), /* 41 E> */ B(Call), R(1), R(2), U8(2), U8(0),
......
...@@ -65,31 +65,30 @@ snippet: " ...@@ -65,31 +65,30 @@ snippet: "
" "
frame size: 8 frame size: 8
parameter count: 1 parameter count: 1
bytecode array length: 46 bytecode array length: 44
bytecodes: [ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaConstant), U8(0), /* 42 S> */ B(LdaConstant), U8(0),
B(Star), R(1), B(Star), R(1),
/* 68 S> */ B(JumpIfUndefined), U8(39), /* 68 S> */ B(JumpIfUndefined), U8(37),
B(JumpIfNull), U8(37), B(JumpIfNull), U8(35),
B(ToObject), B(ToObject),
B(Star), R(3),
B(ForInPrepare), R(4), B(ForInPrepare), R(4),
B(Star), R(3),
B(LdaZero), B(LdaZero),
B(Star), R(7), B(Star), R(7),
/* 63 S> */ B(ForInDone), R(7), R(6), /* 63 S> */ B(ForInDone), R(7), R(6),
B(JumpIfTrue), U8(24), B(JumpIfTrue), U8(22),
B(ForInNext), R(3), R(7), R(4), U8(1), B(ForInNext), R(3), R(7), R(4), U8(1),
B(JumpIfUndefined), U8(11), B(JumpIfUndefined), U8(9),
B(Star), R(0), B(Star), R(0),
/* 54 E> */ B(StackCheck), /* 54 E> */ B(StackCheck),
B(Ldar), R(0),
B(Star), R(2), B(Star), R(2),
/* 73 S> */ B(Nop), /* 73 S> */ B(Nop),
/* 85 S> */ B(Return), /* 85 S> */ B(Return),
B(ForInStep), R(7), B(ForInStep), R(7),
B(Star), R(7), B(Star), R(7),
B(Jump), U8(-25), B(Jump), U8(-23),
B(LdaUndefined), B(LdaUndefined),
/* 85 S> */ B(Return), /* 85 S> */ B(Return),
] ]
...@@ -106,35 +105,34 @@ snippet: " ...@@ -106,35 +105,34 @@ snippet: "
" "
frame size: 9 frame size: 9
parameter count: 1 parameter count: 1
bytecode array length: 57 bytecode array length: 55
bytecodes: [ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaZero), /* 42 S> */ B(LdaZero),
B(Star), R(1), B(Star), R(1),
/* 59 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(3), /* 59 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(3),
B(JumpIfUndefined), U8(47), B(JumpIfUndefined), U8(45),
B(JumpIfNull), U8(45), B(JumpIfNull), U8(43),
B(ToObject), B(ToObject),
B(Star), R(3),
B(ForInPrepare), R(4), B(ForInPrepare), R(4),
B(Star), R(3),
B(LdaZero), B(LdaZero),
B(Star), R(7), B(Star), R(7),
/* 54 S> */ B(ForInDone), R(7), R(6), /* 54 S> */ B(ForInDone), R(7), R(6),
B(JumpIfTrue), U8(32), B(JumpIfTrue), U8(30),
B(ForInNext), R(3), R(7), R(4), U8(1), B(ForInNext), R(3), R(7), R(4), U8(1),
B(JumpIfUndefined), U8(19), B(JumpIfUndefined), U8(17),
B(Star), R(0), B(Star), R(0),
/* 45 E> */ B(StackCheck), /* 45 E> */ B(StackCheck),
B(Ldar), R(0),
B(Star), R(2), B(Star), R(2),
/* 70 S> */ B(Ldar), R(1), /* 70 S> */ B(Nop),
B(Star), R(8), /* 75 E> */ B(Ldar), R(0),
/* 75 E> */ B(Ldar), R(2), B(Add), R(1),
B(Add), R(8), B(Mov), R(1), R(8),
/* 72 E> */ B(Star), R(1), /* 72 E> */ B(Star), R(1),
B(ForInStep), R(7), B(ForInStep), R(7),
B(Star), R(7), B(Star), R(7),
B(Jump), U8(-33), B(Jump), U8(-31),
B(LdaUndefined), B(LdaUndefined),
/* 80 S> */ B(Return), /* 80 S> */ B(Return),
] ]
...@@ -154,47 +152,43 @@ snippet: " ...@@ -154,47 +152,43 @@ snippet: "
" "
frame size: 8 frame size: 8
parameter count: 1 parameter count: 1
bytecode array length: 92 bytecode array length: 82
bytecodes: [ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1), /* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
B(Star), R(1), B(Star), R(1),
B(Star), R(0), B(Star), R(0),
/* 77 S> */ B(CreateArrayLiteral), U8(1), U8(1), U8(3), /* 77 S> */ B(CreateArrayLiteral), U8(1), U8(1), U8(3),
B(JumpIfUndefined), U8(77), B(JumpIfUndefined), U8(67),
B(JumpIfNull), U8(75), B(JumpIfNull), U8(65),
B(ToObject), B(ToObject),
B(Star), R(1),
B(ForInPrepare), R(2), B(ForInPrepare), R(2),
B(Star), R(1),
B(LdaZero), B(LdaZero),
B(Star), R(5), B(Star), R(5),
/* 68 S> */ B(ForInDone), R(5), R(4), /* 68 S> */ B(ForInDone), R(5), R(4),
B(JumpIfTrue), U8(62), B(JumpIfTrue), U8(52),
B(ForInNext), R(1), R(5), R(2), U8(9), B(ForInNext), R(1), R(5), R(2), U8(9),
B(JumpIfUndefined), U8(49), B(JumpIfUndefined), U8(39),
B(Star), R(6), B(Star), R(6),
/* 67 E> */ B(Ldar), R(0), /* 67 E> */ B(Ldar), R(6),
B(Star), R(7), B(StaNamedPropertySloppy), R(0), U8(2), U8(7),
B(Ldar), R(6),
B(StaNamedPropertySloppy), R(7), U8(2), U8(7),
/* 62 E> */ B(StackCheck), /* 62 E> */ B(StackCheck),
/* 95 S> */ B(Ldar), R(0), /* 95 S> */ B(Nop),
B(Star), R(6), /* 100 E> */ B(LdrNamedProperty), R(0), U8(2), U8(3), R(7),
/* 100 E> */ B(LdrNamedProperty), R(6), U8(2), U8(3), R(7),
B(LdaSmi), U8(10), B(LdaSmi), U8(10),
/* 106 E> */ B(TestEqual), R(7), /* 106 E> */ B(TestEqual), R(7),
B(JumpIfFalse), U8(4), B(JumpIfFalse), U8(4),
/* 113 S> */ B(Jump), U8(19), /* 113 S> */ B(Jump), U8(16),
/* 125 S> */ B(Ldar), R(0), /* 125 S> */ B(Nop),
B(Star), R(6), /* 130 E> */ B(LdrNamedProperty), R(0), U8(2), U8(5), R(7),
/* 130 E> */ B(LdrNamedProperty), R(6), U8(2), U8(5), R(7),
B(LdaSmi), U8(20), B(LdaSmi), U8(20),
/* 136 E> */ B(TestEqual), R(7), /* 136 E> */ B(TestEqual), R(7),
B(JumpIfFalse), U8(4), B(JumpIfFalse), U8(4),
/* 143 S> */ B(Jump), U8(8), /* 143 S> */ B(Jump), U8(8),
B(ForInStep), R(5), B(ForInStep), R(5),
B(Star), R(5), B(Star), R(5),
B(Jump), U8(-63), B(Jump), U8(-53),
B(LdaUndefined), B(LdaUndefined),
/* 152 S> */ B(Return), /* 152 S> */ B(Return),
] ]
...@@ -213,39 +207,36 @@ snippet: " ...@@ -213,39 +207,36 @@ snippet: "
" "
frame size: 9 frame size: 9
parameter count: 1 parameter count: 1
bytecode array length: 69 bytecode array length: 62
bytecodes: [ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 42 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(3), /* 42 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(3),
B(Star), R(0), B(Star), R(0),
/* 72 S> */ B(CreateArrayLiteral), U8(1), U8(1), U8(3), /* 72 S> */ B(CreateArrayLiteral), U8(1), U8(1), U8(3),
B(JumpIfUndefined), U8(56), B(JumpIfUndefined), U8(49),
B(JumpIfNull), U8(54), B(JumpIfNull), U8(47),
B(ToObject), B(ToObject),
B(Star), R(1),
B(ForInPrepare), R(2), B(ForInPrepare), R(2),
B(Star), R(1),
B(LdaZero), B(LdaZero),
B(Star), R(5), B(Star), R(5),
/* 65 S> */ B(ForInDone), R(5), R(4), /* 65 S> */ B(ForInDone), R(5), R(4),
B(JumpIfTrue), U8(41), B(JumpIfTrue), U8(34),
B(ForInNext), R(1), R(5), R(2), U8(7), B(ForInNext), R(1), R(5), R(2), U8(7),
B(JumpIfUndefined), U8(28), B(JumpIfUndefined), U8(21),
B(Star), R(6), B(Star), R(6),
/* 64 E> */ B(Ldar), R(0), /* 64 E> */ B(LdaZero),
B(Star), R(7),
B(LdaZero),
B(Star), R(8), B(Star), R(8),
B(Ldar), R(6), B(Ldar), R(6),
B(StaKeyedPropertySloppy), R(7), R(8), U8(5), B(StaKeyedPropertySloppy), R(0), R(8), U8(5),
/* 59 E> */ B(StackCheck), /* 59 E> */ B(StackCheck),
/* 83 S> */ B(Ldar), R(0), /* 83 S> */ B(Nop),
B(Star), R(6),
/* 91 E> */ B(LdaSmi), U8(3), /* 91 E> */ B(LdaSmi), U8(3),
B(LdaKeyedProperty), R(6), U8(3), B(LdaKeyedProperty), R(0), U8(3),
/* 98 S> */ B(Return), /* 98 S> */ B(Return),
B(ForInStep), R(5), B(ForInStep), R(5),
B(Star), R(5), B(Star), R(5),
B(Jump), U8(-42), B(Jump), U8(-35),
B(LdaUndefined), B(LdaUndefined),
/* 98 S> */ B(Return), /* 98 S> */ B(Return),
] ]
......
...@@ -329,7 +329,7 @@ snippet: " ...@@ -329,7 +329,7 @@ snippet: "
" "
frame size: 3 frame size: 3
parameter count: 1 parameter count: 1
bytecode array length: 1422 bytecode array length: 1410
bytecodes: [ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaConstant), U8(0), /* 42 S> */ B(LdaConstant), U8(0),
...@@ -958,22 +958,16 @@ bytecodes: [ ...@@ -958,22 +958,16 @@ bytecodes: [
B(Star), R(0), B(Star), R(0),
/* 4103 S> */ B(LdaZero), /* 4103 S> */ B(LdaZero),
/* 4103 E> */ B(Star), R(1), /* 4103 E> */ B(Star), R(1),
/* 4108 S> */ B(Ldar), R(1), /* 4108 S> */ B(LdaSmi), U8(3),
B(Star), R(2), /* 4108 E> */ B(TestLessThan), R(1),
B(LdaSmi), U8(3), B(Wide), B(JumpIfFalse), U16(38),
/* 4108 E> */ B(TestLessThan), R(2),
B(Wide), B(JumpIfFalse), U16(46),
/* 4090 E> */ B(StackCheck), /* 4090 E> */ B(StackCheck),
/* 4122 S> */ B(Ldar), R(1), /* 4122 S> */ B(LdaSmi), U8(1),
B(Star), R(2), /* 4128 E> */ B(TestEqual), R(1),
B(LdaSmi), U8(1),
/* 4128 E> */ B(TestEqual), R(2),
B(Wide), B(JumpIfFalse), U16(7), B(Wide), B(JumpIfFalse), U16(7),
/* 4134 S> */ B(Wide), B(Jump), U16(19), /* 4134 S> */ B(Wide), B(Jump), U16(15),
/* 4146 S> */ B(Ldar), R(1), /* 4146 S> */ B(LdaSmi), U8(2),
B(Star), R(2), /* 4152 E> */ B(TestEqual), R(1),
B(LdaSmi), U8(2),
/* 4152 E> */ B(TestEqual), R(2),
B(Wide), B(JumpIfFalse), U16(7), B(Wide), B(JumpIfFalse), U16(7),
/* 4158 S> */ B(Wide), B(Jump), U16(13), /* 4158 S> */ B(Wide), B(Jump), U16(13),
/* 4114 S> */ B(Ldar), R(1), /* 4114 S> */ B(Ldar), R(1),
...@@ -981,7 +975,7 @@ bytecodes: [ ...@@ -981,7 +975,7 @@ bytecodes: [
B(Star), R(2), B(Star), R(2),
B(Inc), B(Inc),
/* 4114 E> */ B(Star), R(1), /* 4114 E> */ B(Star), R(1),
B(Jump), U8(-53), B(Jump), U8(-41),
/* 4167 S> */ B(LdaSmi), U8(3), /* 4167 S> */ B(LdaSmi), U8(3),
/* 4177 S> */ B(Return), /* 4177 S> */ B(Return),
] ]
......
...@@ -59,7 +59,7 @@ snippet: " ...@@ -59,7 +59,7 @@ snippet: "
" "
frame size: 3 frame size: 3
parameter count: 1 parameter count: 1
bytecode array length: 27 bytecode array length: 28
bytecodes: [ bytecodes: [
B(LdaTheHole), B(LdaTheHole),
B(Star), R(0), B(Star), R(0),
...@@ -71,8 +71,8 @@ bytecodes: [ ...@@ -71,8 +71,8 @@ bytecodes: [
B(LdaConstant), U8(0), B(LdaConstant), U8(0),
B(Star), R(2), B(Star), R(2),
B(CallRuntime), U16(Runtime::kThrowReferenceError), R(2), U8(1), B(CallRuntime), U16(Runtime::kThrowReferenceError), R(2), U8(1),
B(Ldar), R(1), B(Mov), R(1), R(0),
B(Star), R(0), B(Ldar), R(0),
B(LdaUndefined), B(LdaUndefined),
/* 52 S> */ B(Return), /* 52 S> */ B(Return),
] ]
...@@ -88,7 +88,7 @@ snippet: " ...@@ -88,7 +88,7 @@ snippet: "
" "
frame size: 3 frame size: 3
parameter count: 1 parameter count: 1
bytecode array length: 31 bytecode array length: 30
bytecodes: [ bytecodes: [
B(LdaTheHole), B(LdaTheHole),
B(Star), R(0), B(Star), R(0),
...@@ -102,8 +102,7 @@ bytecodes: [ ...@@ -102,8 +102,7 @@ bytecodes: [
B(LdaConstant), U8(0), B(LdaConstant), U8(0),
B(Star), R(2), B(Star), R(2),
B(CallRuntime), U16(Runtime::kThrowReferenceError), R(2), U8(1), B(CallRuntime), U16(Runtime::kThrowReferenceError), R(2), U8(1),
B(Ldar), R(1), B(Mov), R(1), R(0),
B(Star), R(0),
B(LdaUndefined), B(LdaUndefined),
/* 54 S> */ B(Return), /* 54 S> */ B(Return),
] ]
......
...@@ -31,16 +31,15 @@ handlers: [ ...@@ -31,16 +31,15 @@ handlers: [
snippet: " snippet: "
var x = 0; return (x == 1) || 3; var x = 0; return (x == 1) || 3;
" "
frame size: 2 frame size: 1
parameter count: 1 parameter count: 1
bytecode array length: 15 bytecode array length: 13
bytecodes: [ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaZero), /* 42 S> */ B(LdaZero),
B(Star), R(0), B(Star), R(0),
/* 45 S> */ B(Star), R(1), /* 45 S> */ B(LdaSmi), U8(1),
B(LdaSmi), U8(1), /* 55 E> */ B(TestEqual), R(0),
/* 55 E> */ B(TestEqual), R(1),
B(JumpIfTrue), U8(4), B(JumpIfTrue), U8(4),
B(LdaSmi), U8(3), B(LdaSmi), U8(3),
/* 67 S> */ B(Return), /* 67 S> */ B(Return),
...@@ -74,16 +73,15 @@ handlers: [ ...@@ -74,16 +73,15 @@ handlers: [
snippet: " snippet: "
var x = 0; return (x == 0) && 3; var x = 0; return (x == 0) && 3;
" "
frame size: 2 frame size: 1
parameter count: 1 parameter count: 1
bytecode array length: 14 bytecode array length: 12
bytecodes: [ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaZero), /* 42 S> */ B(LdaZero),
B(Star), R(0), B(Star), R(0),
/* 45 S> */ B(Star), R(1), /* 45 S> */ B(LdaZero),
B(LdaZero), /* 55 E> */ B(TestEqual), R(0),
/* 55 E> */ B(TestEqual), R(1),
B(JumpIfFalse), U8(4), B(JumpIfFalse), U8(4),
B(LdaSmi), U8(3), B(LdaSmi), U8(3),
/* 67 S> */ B(Return), /* 67 S> */ B(Return),
...@@ -119,7 +117,7 @@ snippet: " ...@@ -119,7 +117,7 @@ snippet: "
" "
frame size: 3 frame size: 3
parameter count: 1 parameter count: 1
bytecode array length: 30 bytecode array length: 27
bytecodes: [ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(2), /* 42 S> */ B(LdaSmi), U8(2),
...@@ -129,10 +127,10 @@ bytecodes: [ ...@@ -129,10 +127,10 @@ bytecodes: [
/* 56 S> */ B(LdaSmi), U8(4), /* 56 S> */ B(LdaSmi), U8(4),
B(Star), R(2), B(Star), R(2),
/* 59 S> */ B(Ldar), R(0), /* 59 S> */ B(Ldar), R(0),
B(JumpIfToBooleanTrue), U8(14), B(JumpIfToBooleanTrue), U8(11),
/* 72 E> */ B(Ldar), R(0), /* 72 E> */ B(Nop),
/* 75 E> */ B(Ldar), R(1), /* 75 E> */ B(Nop),
/* 78 E> */ B(Ldar), R(0), /* 78 E> */ B(Nop),
/* 81 E> */ B(LdaSmi), U8(5), /* 81 E> */ B(LdaSmi), U8(5),
/* 86 E> */ B(Star), R(2), /* 86 E> */ B(Star), R(2),
B(LdaSmi), U8(3), B(LdaSmi), U8(3),
...@@ -551,9 +549,9 @@ snippet: " ...@@ -551,9 +549,9 @@ snippet: "
a = 1, b = 2, a = 1, b = 2,
a = 1, b = 2, 3); a = 1, b = 2, 3);
" "
frame size: 4 frame size: 3
parameter count: 1 parameter count: 1
bytecode array length: 282 bytecode array length: 278
bytecodes: [ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(1), /* 42 S> */ B(LdaSmi), U8(1),
...@@ -562,10 +560,8 @@ bytecodes: [ ...@@ -562,10 +560,8 @@ bytecodes: [
B(Star), R(1), B(Star), R(1),
/* 60 S> */ B(LdaSmi), U8(3), /* 60 S> */ B(LdaSmi), U8(3),
B(Star), R(2), B(Star), R(2),
/* 63 S> */ B(Ldar), R(0), /* 63 S> */ B(LdaSmi), U8(3),
B(Star), R(3), /* 73 E> */ B(TestGreaterThan), R(0),
B(LdaSmi), U8(3),
/* 73 E> */ B(TestGreaterThan), R(3),
B(JumpIfTrueConstant), U8(0), B(JumpIfTrueConstant), U8(0),
B(LdaSmi), U8(1), B(LdaSmi), U8(1),
/* 87 E> */ B(Star), R(1), /* 87 E> */ B(Star), R(1),
...@@ -740,9 +736,9 @@ snippet: " ...@@ -740,9 +736,9 @@ snippet: "
a = 1, b = 2, a = 1, b = 2,
a = 1, b = 2, 3); a = 1, b = 2, 3);
" "
frame size: 4 frame size: 3
parameter count: 1 parameter count: 1
bytecode array length: 281 bytecode array length: 277
bytecodes: [ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaZero), /* 42 S> */ B(LdaZero),
...@@ -751,10 +747,8 @@ bytecodes: [ ...@@ -751,10 +747,8 @@ bytecodes: [
B(Star), R(1), B(Star), R(1),
/* 60 S> */ B(LdaSmi), U8(3), /* 60 S> */ B(LdaSmi), U8(3),
B(Star), R(2), B(Star), R(2),
/* 63 S> */ B(Ldar), R(0), /* 63 S> */ B(LdaSmi), U8(5),
B(Star), R(3), /* 73 E> */ B(TestLessThan), R(0),
B(LdaSmi), U8(5),
/* 73 E> */ B(TestLessThan), R(3),
B(JumpIfFalseConstant), U8(0), B(JumpIfFalseConstant), U8(0),
B(LdaSmi), U8(1), B(LdaSmi), U8(1),
/* 87 E> */ B(Star), R(1), /* 87 E> */ B(Star), R(1),
......
...@@ -14,7 +14,7 @@ snippet: " ...@@ -14,7 +14,7 @@ snippet: "
" "
frame size: 5 frame size: 5
parameter count: 1 parameter count: 1
bytecode array length: 44 bytecode array length: 43
bytecodes: [ bytecodes: [
B(LdaConstant), U8(0), B(LdaConstant), U8(0),
B(Star), R(1), B(Star), R(1),
...@@ -30,8 +30,7 @@ bytecodes: [ ...@@ -30,8 +30,7 @@ bytecodes: [
B(Star), R(4), B(Star), R(4),
B(CreateClosure), U8(3), U8(0), B(CreateClosure), U8(3), U8(0),
B(StaNamedPropertySloppy), R(4), U8(4), U8(3), B(StaNamedPropertySloppy), R(4), U8(4), U8(3),
B(Ldar), R(4), B(Mov), R(4), R(3),
B(Star), R(3),
B(CallRuntime), U16(Runtime::kInitializeVarGlobal), R(1), U8(3), B(CallRuntime), U16(Runtime::kInitializeVarGlobal), R(1), U8(3),
B(LdaUndefined), B(LdaUndefined),
/* 33 S> */ B(Return), /* 33 S> */ B(Return),
......
This diff is collapsed.
This diff is collapsed.
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