Index: src/interpreter/bytecode-array-builder.cc |
diff --git a/src/interpreter/bytecode-array-builder.cc b/src/interpreter/bytecode-array-builder.cc |
index a14b5f3f6f14102b173d23cde301a065e1182133..1b15fc666866589257a593c0a232cbc1c3437900 100644 |
--- a/src/interpreter/bytecode-array-builder.cc |
+++ b/src/interpreter/bytecode-array-builder.cc |
@@ -1603,63 +1603,6 @@ bool BytecodeArrayBuilder::FitsInReg16Operand(Register value) { |
return kMinInt16 <= value.index() && value.index() <= kMaxInt16; |
} |
- |
-TemporaryRegisterScope::TemporaryRegisterScope(BytecodeArrayBuilder* builder) |
- : builder_(builder), |
- allocated_(builder->zone()), |
- next_consecutive_register_(-1), |
- next_consecutive_count_(-1) {} |
- |
- |
-TemporaryRegisterScope::~TemporaryRegisterScope() { |
- for (auto i = allocated_.rbegin(); i != allocated_.rend(); i++) { |
- builder_->ReturnTemporaryRegister(*i); |
- } |
- allocated_.clear(); |
-} |
- |
- |
-Register TemporaryRegisterScope::NewRegister() { |
- int allocated = -1; |
- if (next_consecutive_count_ <= 0) { |
- allocated = builder_->BorrowTemporaryRegister(); |
- } else { |
- allocated = builder_->BorrowTemporaryRegisterNotInRange( |
- next_consecutive_register_, |
- next_consecutive_register_ + next_consecutive_count_ - 1); |
- } |
- allocated_.push_back(allocated); |
- return Register(allocated); |
-} |
- |
- |
-bool TemporaryRegisterScope::RegisterIsAllocatedInThisScope( |
- Register reg) const { |
- for (auto i = allocated_.begin(); i != allocated_.end(); i++) { |
- if (*i == reg.index()) return true; |
- } |
- return false; |
-} |
- |
- |
-void TemporaryRegisterScope::PrepareForConsecutiveAllocations(size_t count) { |
- if (static_cast<int>(count) > next_consecutive_count_) { |
- next_consecutive_register_ = |
- builder_->PrepareForConsecutiveTemporaryRegisters(count); |
- next_consecutive_count_ = static_cast<int>(count); |
- } |
-} |
- |
- |
-Register TemporaryRegisterScope::NextConsecutiveRegister() { |
- DCHECK_GE(next_consecutive_register_, 0); |
- DCHECK_GT(next_consecutive_count_, 0); |
- builder_->BorrowConsecutiveTemporaryRegister(next_consecutive_register_); |
- allocated_.push_back(next_consecutive_register_); |
- next_consecutive_count_--; |
- return Register(next_consecutive_register_++); |
-} |
- |
} // namespace interpreter |
} // namespace internal |
} // namespace v8 |