| Index: src/lithium.h
|
| diff --git a/src/lithium.h b/src/lithium.h
|
| index 650bae69235a3205aa1edeebd5f8c484bf3c3713..b975d6de526c14e1a30bc61c3c491f2a4eccb956 100644
|
| --- a/src/lithium.h
|
| +++ b/src/lithium.h
|
| @@ -35,7 +35,7 @@ class LOperand : public ZoneObject {
|
| DOUBLE_REGISTER
|
| };
|
|
|
| - LOperand() : value_(KindField::encode(INVALID)) { }
|
| + LOperand() : value_(KindField::encode(INVALID)), parent_linstr_(NULL) { }
|
|
|
| Kind kind() const { return KindField::decode(value_); }
|
| int index() const { return static_cast<int>(value_) >> kKindFieldWidth; }
|
| @@ -47,6 +47,9 @@ class LOperand : public ZoneObject {
|
| #undef LITHIUM_OPERAND_PREDICATE
|
| bool Equals(LOperand* other) const { return value_ == other->value_; }
|
|
|
| + bool IsInMemory() const { return IsStackSlot() || IsDoubleStackSlot(); }
|
| + bool IsInRegister() const { return IsRegister() || IsDoubleRegister(); }
|
| +
|
| void PrintTo(StringStream* stream);
|
| void ConvertTo(Kind kind, int index) {
|
| value_ = KindField::encode(kind);
|
| @@ -54,6 +57,9 @@ class LOperand : public ZoneObject {
|
| ASSERT(this->index() == index);
|
| }
|
|
|
| + void set_parent_linstr(LInstruction* instr) { parent_linstr_ = instr; }
|
| + LInstruction* parent_linstr() const { return parent_linstr_; }
|
| +
|
| // Calls SetUpCache()/TearDownCache() for each subclass.
|
| static void SetUpCaches();
|
| static void TearDownCaches();
|
| @@ -62,9 +68,12 @@ class LOperand : public ZoneObject {
|
| static const int kKindFieldWidth = 3;
|
| class KindField : public BitField<Kind, 0, kKindFieldWidth> { };
|
|
|
| - LOperand(Kind kind, int index) { ConvertTo(kind, index); }
|
| + LOperand(Kind kind, int index) : parent_linstr_(NULL) {
|
| + ConvertTo(kind, index);
|
| + }
|
|
|
| unsigned value_;
|
| + LInstruction* parent_linstr_;
|
| };
|
|
|
|
|
| @@ -131,6 +140,7 @@ class LUnallocated : public LOperand {
|
| LUnallocated* CopyUnconstrained(Zone* zone) {
|
| LUnallocated* result = new(zone) LUnallocated(ANY);
|
| result->set_virtual_register(virtual_register());
|
| + result->set_parent_linstr(parent_linstr());
|
| return result;
|
| }
|
|
|
| @@ -287,6 +297,8 @@ class LMoveOperands V8_FINAL BASE_EMBEDDED {
|
| return destination_ != NULL && destination_->IsIgnored();
|
| }
|
|
|
| + bool UsesRegeneration() const;
|
| +
|
| // We clear both operands to indicate move that's been eliminated.
|
| void Eliminate() { source_ = destination_ = NULL; }
|
| bool IsEliminated() const {
|
| @@ -303,9 +315,10 @@ class LMoveOperands V8_FINAL BASE_EMBEDDED {
|
| template<LOperand::Kind kOperandKind, int kNumCachedOperands>
|
| class LSubKindOperand V8_FINAL : public LOperand {
|
| public:
|
| - static LSubKindOperand* Create(int index, Zone* zone) {
|
| + static LSubKindOperand* Create(int index, Zone* zone,
|
| + bool allow_use_cache = true) {
|
| ASSERT(index >= 0);
|
| - if (index < kNumCachedOperands) return &cache[index];
|
| + if (allow_use_cache && (index < kNumCachedOperands)) return &cache[index];
|
| return new(zone) LSubKindOperand(index);
|
| }
|
|
|
|
|