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

Unified Diff: runtime/vm/flow_graph.cc

Issue 11014013: Added slow_assert macro and flag for slow development assertions in the VM. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 months 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: runtime/vm/flow_graph.cc
diff --git a/runtime/vm/flow_graph.cc b/runtime/vm/flow_graph.cc
index d434d610ebed6c587bd311253424cd663142f8e5..d0bf4d4a2c9adcaeb56542e89e6389486fe60cff 100644
--- a/runtime/vm/flow_graph.cc
+++ b/runtime/vm/flow_graph.cc
@@ -4,6 +4,7 @@
#include "vm/flow_graph.h"
+#include "vm/assert.h"
#include "vm/bit_vector.h"
#include "vm/flow_graph_builder.h"
#include "vm/intermediate_language.h"
@@ -133,14 +134,14 @@ static void ValidateUseListsInInstruction(Instruction* instr) {
for (intptr_t i = 0; i < instr->InputCount(); ++i) {
Value* use = instr->InputAt(i);
ASSERT(use->use_index() == i);
- ASSERT(1 == MembershipCount(use, use->definition()->input_use_list()));
+ SLOW_ASSERT(1 == MembershipCount(use, use->definition()->input_use_list()));
siva 2012/10/01 23:35:40 It sounds like this needs to be ASSERT(VerifyMembe
}
if (instr->env() != NULL) {
intptr_t use_index = 0;
for (Environment::DeepIterator it(instr->env()); !it.Done(); it.Advance()) {
Value* use = it.CurrentValue();
ASSERT(use->use_index() == use_index++);
- ASSERT(1 == MembershipCount(use, use->definition()->env_use_list()));
+ SLOW_ASSERT(1 == MembershipCount(use, use->definition()->env_use_list()));
}
}
Definition* defn = instr->AsDefinition();
@@ -203,8 +204,7 @@ static void RecordInputUses(Instruction* instr) {
ASSERT(use->instruction() == NULL);
ASSERT(use->use_index() == -1);
ASSERT(use->next_use() == NULL);
- DEBUG_ASSERT(0 == MembershipCount(use,
- use->definition()->input_use_list()));
+ SLOW_ASSERT(0 == MembershipCount(use, use->definition()->input_use_list()));
use->set_instruction(instr);
use->set_use_index(i);
use->AddToInputUseList();
@@ -221,7 +221,7 @@ static void RecordEnvUses(Instruction* instr) {
ASSERT(use->instruction() == NULL);
ASSERT(use->use_index() == -1);
ASSERT(use->next_use() == NULL);
- DEBUG_ASSERT(0 == MembershipCount(use, use->definition()->env_use_list()));
+ SLOW_ASSERT(0 == MembershipCount(use, use->definition()->env_use_list()));
use->set_instruction(instr);
use->set_use_index(use_index++);
use->AddToEnvUseList();
@@ -264,8 +264,8 @@ static void ComputeUseListsRecursive(BlockEntryInstr* block) {
ASSERT(use->instruction() == NULL);
ASSERT(use->use_index() == -1);
ASSERT(use->next_use() == NULL);
- DEBUG_ASSERT(0 == MembershipCount(use,
- use->definition()->input_use_list()));
+ SLOW_ASSERT(0 == MembershipCount(use,
+ use->definition()->input_use_list()));
use->set_instruction(phi);
use->set_use_index(pred_index);
use->AddToInputUseList();
@@ -282,7 +282,7 @@ void FlowGraph::ComputeUseLists() {
ClearUseLists((*graph_entry_->initial_definitions())[i]);
}
ComputeUseListsRecursive(graph_entry_);
- DEBUG_ASSERT(ValidateUseLists());
+ SLOW_ASSERT(ValidateUseLists());
siva 2012/10/01 23:35:40 Ditto comment, this would be ASSERT(ValidateUseLis
}

Powered by Google App Engine
This is Rietveld 408576698