From d27ab5aa5256effe839c5805e752ac6fd6a02d71 Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Wed, 14 May 2014 15:51:50 +0200 Subject: [PATCH] Bug 1009603: Automatically stop register allocation tracelogging on error; r=h4writer --- js/src/jit/Ion.cpp | 88 +++++++++++++++++++++++----------------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/js/src/jit/Ion.cpp b/js/src/jit/Ion.cpp index 6bb2b4e9e2c..e44ebf5fb61 100644 --- a/js/src/jit/Ion.cpp +++ b/js/src/jit/Ion.cpp @@ -1567,71 +1567,71 @@ GenerateLIR(MIRGenerator *mir) AllocationIntegrityState integrity(*lir); - TraceLogStartEvent(logger, TraceLogger::RegisterAllocation); + { + AutoTraceLog log(logger, TraceLogger::RegisterAllocation); - switch (mir->optimizationInfo().registerAllocator()) { - case RegisterAllocator_LSRA: { + switch (mir->optimizationInfo().registerAllocator()) { + case RegisterAllocator_LSRA: { #ifdef DEBUG - if (!integrity.record()) - return nullptr; + if (!integrity.record()) + return nullptr; #endif - LinearScanAllocator regalloc(mir, &lirgen, *lir); - if (!regalloc.go()) - return nullptr; + LinearScanAllocator regalloc(mir, &lirgen, *lir); + if (!regalloc.go()) + return nullptr; #ifdef DEBUG - if (!integrity.check(false)) - return nullptr; + if (!integrity.check(false)) + return nullptr; #endif - IonSpewPass("Allocate Registers [LSRA]", ®alloc); - break; - } + IonSpewPass("Allocate Registers [LSRA]", ®alloc); + break; + } - case RegisterAllocator_Backtracking: { + case RegisterAllocator_Backtracking: { #ifdef DEBUG - if (!integrity.record()) - return nullptr; + if (!integrity.record()) + return nullptr; #endif - BacktrackingAllocator regalloc(mir, &lirgen, *lir); - if (!regalloc.go()) - return nullptr; + BacktrackingAllocator regalloc(mir, &lirgen, *lir); + if (!regalloc.go()) + return nullptr; #ifdef DEBUG - if (!integrity.check(false)) - return nullptr; + if (!integrity.check(false)) + return nullptr; #endif - IonSpewPass("Allocate Registers [Backtracking]"); - break; - } + IonSpewPass("Allocate Registers [Backtracking]"); + break; + } - case RegisterAllocator_Stupid: { - // Use the integrity checker to populate safepoint information, so - // run it in all builds. - if (!integrity.record()) - return nullptr; + case RegisterAllocator_Stupid: { + // Use the integrity checker to populate safepoint information, so + // run it in all builds. + if (!integrity.record()) + return nullptr; - StupidAllocator regalloc(mir, &lirgen, *lir); - if (!regalloc.go()) - return nullptr; - if (!integrity.check(true)) - return nullptr; - IonSpewPass("Allocate Registers [Stupid]"); - break; - } + StupidAllocator regalloc(mir, &lirgen, *lir); + if (!regalloc.go()) + return nullptr; + if (!integrity.check(true)) + return nullptr; + IonSpewPass("Allocate Registers [Stupid]"); + break; + } - default: - MOZ_ASSUME_UNREACHABLE("Bad regalloc"); + default: + MOZ_ASSUME_UNREACHABLE("Bad regalloc"); + } + + if (mir->shouldCancel("Allocate Registers")) + return nullptr; } - if (mir->shouldCancel("Allocate Registers")) - return nullptr; - - TraceLogStopEvent(logger, TraceLogger::RegisterAllocation); - { AutoTraceLog log(logger, TraceLogger::UnsplitEdges); // Now that all optimization and register allocation is done, re-introduce