Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Unified Diff: src/compiler/pipeline.cc

Issue 704193007: [turbofan] add gap move verifier (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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");
}

Powered by Google App Engine
This is Rietveld 408576698