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

Unified Diff: src/hydrogen-bch.cc

Issue 23553002: Minor cleanups, hopefully fixing an issue with VC's /Ze option on the way. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-bch.cc
diff --git a/src/hydrogen-bch.cc b/src/hydrogen-bch.cc
index 137d6295477f320bd6cd54327d97813a0f7b2405..a0a0fee7105388cddc9462cfc4d5106b8ddbf540 100644
--- a/src/hydrogen-bch.cc
+++ b/src/hydrogen-bch.cc
@@ -102,10 +102,11 @@ class InductionVariableBlocksTable BASE_EMBEDDED {
int current_dominated_block_;
};
- HGraph* graph() { return graph_; }
- HBasicBlock* loop_header() { return loop_header_; }
- Element* at(int index) { return &(elements_.at(index)); }
- Element* at(HBasicBlock* block) { return at(block->block_id()); }
+ HGraph* graph() const { return graph_; }
+ Counters* counters() const { return graph()->isolate()->counters(); }
+ HBasicBlock* loop_header() const { return loop_header_; }
+ Element* at(int index) const { return &(elements_.at(index)); }
+ Element* at(HBasicBlock* block) const { return at(block->block_id()); }
void AddCheckAt(HBasicBlock* block) {
at(block->block_id())->set_has_check();
@@ -258,23 +259,17 @@ class InductionVariableBlocksTable BASE_EMBEDDED {
// all checks are done on constants: if all check are done against the same
// constant limit we will use that instead of the induction limit.
bool has_upper_constant_limit = true;
- InductionVariableData::InductionVariableCheck* current_check = check;
int32_t upper_constant_limit =
- current_check != NULL && current_check->HasUpperLimit() ?
- current_check->upper_limit() : 0;
- while (current_check != NULL) {
- if (check->HasUpperLimit()) {
- if (check->upper_limit() != upper_constant_limit) {
- has_upper_constant_limit = false;
- }
- } else {
- has_upper_constant_limit = false;
- }
-
- current_check->check()->block()->graph()->isolate()->counters()->
- bounds_checks_eliminated()->Increment();
+ check != NULL && check->HasUpperLimit() ? check->upper_limit() : 0;
+ for (InductionVariableData::InductionVariableCheck* current_check = check;
+ current_check != NULL;
+ current_check = current_check->next()) {
+ has_upper_constant_limit =
+ has_upper_constant_limit &&
+ check->HasUpperLimit() &&
+ check->upper_limit() == upper_constant_limit;
+ counters()->bounds_checks_eliminated()->Increment();
current_check->check()->set_skip_check();
- current_check = current_check->next();
}
// Choose the appropriate limit.
@@ -303,8 +298,7 @@ class InductionVariableBlocksTable BASE_EMBEDDED {
zone, context, limit, check->check()->length());
hoisted_check->InsertBefore(pre_header->end());
hoisted_check->set_allow_equality(true);
- hoisted_check->block()->graph()->isolate()->counters()->
- bounds_checks_hoisted()->Increment();
+ counters()->bounds_checks_hoisted()->Increment();
}
void CollectInductionVariableData(HBasicBlock* bb) {
@@ -341,8 +335,7 @@ class InductionVariableBlocksTable BASE_EMBEDDED {
// TODO(mmassi): skip OSR values for check->length().
if (check->length() == data->limit() ||
check->length() == data->additional_upper_limit()) {
- check->block()->graph()->isolate()->counters()->
- bounds_checks_eliminated()->Increment();
+ counters()->bounds_checks_eliminated()->Increment();
check->set_skip_check();
continue;
}
@@ -407,4 +400,3 @@ void HBoundsCheckHoistingPhase::HoistRedundantBoundsChecks() {
}
} } // namespace v8::internal
-
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698