| Index: src/lithium-allocator.h
|
| ===================================================================
|
| --- src/lithium-allocator.h (revision 6170)
|
| +++ src/lithium-allocator.h (working copy)
|
| @@ -30,6 +30,7 @@
|
|
|
| #include "v8.h"
|
|
|
| +#include "data-flow.h"
|
| #include "zone.h"
|
|
|
| namespace v8 {
|
| @@ -204,7 +205,6 @@
|
| MUST_HAVE_REGISTER,
|
| WRITABLE_REGISTER,
|
| SAME_AS_FIRST_INPUT,
|
| - SAME_AS_ANY_INPUT,
|
| IGNORE
|
| };
|
|
|
| @@ -275,7 +275,7 @@
|
| return policy() == WRITABLE_REGISTER || policy() == MUST_HAVE_REGISTER;
|
| }
|
| bool HasSameAsInputPolicy() const {
|
| - return policy() == SAME_AS_FIRST_INPUT || policy() == SAME_AS_ANY_INPUT;
|
| + return policy() == SAME_AS_FIRST_INPUT;
|
| }
|
| Policy policy() const { return PolicyField::decode(value_); }
|
| void set_policy(Policy policy) {
|
| @@ -754,6 +754,40 @@
|
| };
|
|
|
|
|
| +class GrowableBitVector BASE_EMBEDDED {
|
| + public:
|
| + GrowableBitVector() : bits_(NULL) { }
|
| +
|
| + bool Contains(int value) const {
|
| + if (!InBitsRange(value)) return false;
|
| + return bits_->Contains(value);
|
| + }
|
| +
|
| + void Add(int value) {
|
| + EnsureCapacity(value);
|
| + bits_->Add(value);
|
| + }
|
| +
|
| + private:
|
| + static const int kInitialLength = 1024;
|
| +
|
| + bool InBitsRange(int value) const {
|
| + return bits_ != NULL && bits_->length() > value;
|
| + }
|
| +
|
| + void EnsureCapacity(int value) {
|
| + if (InBitsRange(value)) return;
|
| + int new_length = bits_ == NULL ? kInitialLength : bits_->length();
|
| + while (new_length <= value) new_length *= 2;
|
| + BitVector* new_bits = new BitVector(new_length);
|
| + if (bits_ != NULL) new_bits->CopyFrom(*bits_);
|
| + bits_ = new_bits;
|
| + }
|
| +
|
| + BitVector* bits_;
|
| +};
|
| +
|
| +
|
| class LAllocator BASE_EMBEDDED {
|
| public:
|
| explicit LAllocator(int first_virtual_register, HGraph* graph)
|
| @@ -770,6 +804,7 @@
|
| inactive_live_ranges_(8),
|
| reusable_slots_(8),
|
| next_virtual_register_(first_virtual_register),
|
| + first_artificial_register_(first_virtual_register),
|
| mode_(NONE),
|
| num_registers_(-1),
|
| graph_(graph),
|
| @@ -972,6 +1007,8 @@
|
|
|
| // Next virtual register number to be assigned to temporaries.
|
| int next_virtual_register_;
|
| + int first_artificial_register_;
|
| + GrowableBitVector double_artificial_registers_;
|
|
|
| RegisterKind mode_;
|
| int num_registers_;
|
|
|