Commit a46528e8 authored by bmeurer@chromium.org's avatar bmeurer@chromium.org

Fix zone usage within LAllocator.

Previously all allocations in the register allocator were done on the
chunk (and graph) zone, even those that did not need to survive past
the register allocation. Now only allocations that need to survive
use the chunk zone, all other allocations use a separate zone local
to the LAllocator.

Depends on https://codereview.chromium.org/18022002

R=danno@chromium.org
BUG=

Review URL: https://codereview.chromium.org/17553004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15372 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 50b59eeb
......@@ -148,14 +148,13 @@ void UseIterator::Advance() {
void LAllocator::SetLiveRangeAssignedRegister(
LiveRange* range,
int reg,
RegisterKind register_kind,
Zone* zone) {
RegisterKind register_kind) {
if (register_kind == DOUBLE_REGISTERS) {
assigned_double_registers_->Add(reg);
} else {
assigned_registers_->Add(reg);
}
range->set_assigned_register(reg, register_kind, zone);
range->set_assigned_register(reg, register_kind, chunk()->zone());
}
......
This diff is collapsed.
......@@ -434,7 +434,7 @@ class LAllocator BASE_EMBEDDED {
LPlatformChunk* chunk() const { return chunk_; }
HGraph* graph() const { return graph_; }
Isolate* isolate() const { return graph_->isolate(); }
Zone* zone() const { return zone_; }
Zone* zone() { return &zone_; }
int GetVirtualRegister() {
if (next_virtual_register_ >= LUnallocated::kMaxVirtualRegisters) {
......@@ -570,8 +570,7 @@ class LAllocator BASE_EMBEDDED {
inline void SetLiveRangeAssignedRegister(LiveRange* range,
int reg,
RegisterKind register_kind,
Zone* zone);
RegisterKind register_kind);
// Return parallel move that should be used to connect ranges split at the
// given position.
......@@ -598,7 +597,7 @@ class LAllocator BASE_EMBEDDED {
inline LGap* GapAt(int index);
Zone* zone_;
Zone zone_;
LPlatformChunk* chunk_;
......@@ -647,13 +646,12 @@ class LAllocator BASE_EMBEDDED {
class LAllocatorPhase : public CompilationPhase {
public:
LAllocatorPhase(const char* name, LAllocator* allocator)
: CompilationPhase(name, allocator->graph()->info()),
allocator_(allocator) { }
LAllocatorPhase(const char* name, LAllocator* allocator);
~LAllocatorPhase();
private:
LAllocator* allocator_;
unsigned allocator_zone_start_allocation_size_;
DISALLOW_COPY_AND_ASSIGN(LAllocatorPhase);
};
......
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