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

Unified Diff: src/hydrogen.cc

Issue 6321007: Disable aggressive optimizations on the last optimization attempt. (Closed)
Patch Set: Review fixes Created 9 years, 11 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 | « src/hydrogen.h ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 7aa66fd619c1f48a774d54feab2f1b829c67f332..da41ef94dc36e9e8e2f8a694d3126e664831ff3b 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -687,6 +687,11 @@ HGraph::HGraph(CompilationInfo* info)
}
+bool HGraph::AllowAggressiveOptimizations() const {
+ return info()->shared_info()->opt_count() + 1 < Compiler::kDefaultMaxOptCount;
+}
+
+
Handle<Code> HGraph::Compile() {
int values = GetMaximumValueID();
if (values > LAllocator::max_initial_value_ids()) {
@@ -1453,8 +1458,12 @@ void HGlobalValueNumberer::ProcessLoopBlock(HBasicBlock* block,
// about code that was never executed.
bool HGlobalValueNumberer::ShouldMove(HInstruction* instr,
HBasicBlock* loop_header) {
- if (!instr->IsChange() &&
- FLAG_aggressive_loop_invariant_motion) return true;
+ if (FLAG_aggressive_loop_invariant_motion &&
+ !instr->IsChange() &&
+ (!instr->IsCheckInstruction() ||
+ graph_->AllowAggressiveOptimizations())) {
+ return true;
+ }
HBasicBlock* block = instr->block();
bool result = true;
if (block != loop_header) {
« no previous file with comments | « src/hydrogen.h ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698