Index: src/compiler/pipeline.cc |
diff --git a/src/compiler/pipeline.cc b/src/compiler/pipeline.cc |
index 5832905b9f64842a7f05800c899b539546f914b7..1a24bbd7c5c260c4b421e567e45d4335cf917e56 100644 |
--- a/src/compiler/pipeline.cc |
+++ b/src/compiler/pipeline.cc |
@@ -24,6 +24,7 @@ |
#include "src/compiler/machine-operator-reducer.h" |
#include "src/compiler/pipeline-statistics.h" |
#include "src/compiler/register-allocator.h" |
+#include "src/compiler/register-allocator-verifier.h" |
#include "src/compiler/schedule.h" |
#include "src/compiler/scheduler.h" |
#include "src/compiler/select-lowering.h" |
@@ -574,6 +575,8 @@ Handle<Code> Pipeline::GenerateCode(Linkage* linkage, PipelineData* data) { |
data->pipeline_statistics()->BeginPhaseKind("register allocation"); |
} |
+ SmartPointer<Zone> verifier_zone; |
+ RegisterAllocatorVerifier* verifier = NULL; |
Jarin
2014/11/12 08:13:35
I think it would be better if we could avoid the p
dcarney
2014/11/12 08:53:31
Done.
|
// Allocate registers. |
Frame frame; |
{ |
@@ -585,17 +588,18 @@ Handle<Code> Pipeline::GenerateCode(Linkage* linkage, PipelineData* data) { |
ZonePool::Scope zone_scope(data->zone_pool()); |
SmartArrayPointer<char> debug_name; |
- RegisterAllocator::VerificationType verification_type = |
- RegisterAllocator::kNoVerify; |
#ifdef DEBUG |
debug_name = GetDebugName(info()); |
- verification_type = RegisterAllocator::kVerifyAssignment; |
+ // Don't track usage for this zone in compiler stats. |
+ verifier_zone.Reset(new Zone(info()->isolate())); |
+ verifier = new (verifier_zone.get()) RegisterAllocatorVerifier( |
+ verifier_zone.get(), RegisterConfiguration::ArchDefault(), &sequence); |
#endif |
RegisterAllocator allocator(RegisterConfiguration::ArchDefault(), |
zone_scope.zone(), &frame, &sequence, |
debug_name.get()); |
- if (!allocator.Allocate(data->pipeline_statistics(), verification_type)) { |
+ if (!allocator.Allocate(data->pipeline_statistics())) { |
info()->AbortOptimization(kNotEnoughVirtualRegistersRegalloc); |
return Handle<Code>::null(); |
} |
@@ -613,6 +617,12 @@ Handle<Code> Pipeline::GenerateCode(Linkage* linkage, PipelineData* data) { |
<< printable; |
} |
+ if (verifier != NULL) { |
+ verifier->VerifyAssignment(); |
+ verifier->VerifyGapMoves(); |
+ verifier_zone.Reset(nullptr); |
+ } |
+ |
if (data->pipeline_statistics() != NULL) { |
data->pipeline_statistics()->BeginPhaseKind("code generation"); |
} |