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

Side by Side Diff: src/hydrogen.cc

Issue 17568015: New array bounds check elimination pass (focused on induction variables and bitwise operations). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Actually removed a method, and applied a small fix. Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 4233 matching lines...) Expand 10 before | Expand all | Expand 10 after
4244 new_offset); 4244 new_offset);
4245 if (!result) return false; 4245 if (!result) return false;
4246 lower_check_->ReplaceAllUsesWith(lower_check_->index()); 4246 lower_check_->ReplaceAllUsesWith(lower_check_->index());
4247 lower_check_->SetOperandAt(0, added_lower_index_); 4247 lower_check_->SetOperandAt(0, added_lower_index_);
4248 } 4248 }
4249 } else { 4249 } else {
4250 ASSERT(false); 4250 ASSERT(false);
4251 } 4251 }
4252 4252
4253 if (!keep_new_check) { 4253 if (!keep_new_check) {
4254 BasicBlock()->graph()->isolate()->counters()->
4255 bounds_checks_covered()->Increment();
4254 new_check->DeleteAndReplaceWith(new_check->ActualValue()); 4256 new_check->DeleteAndReplaceWith(new_check->ActualValue());
4255 } 4257 }
4256 4258
4257 return true; 4259 return true;
4258 } 4260 }
4259 4261
4260 void RemoveZeroOperations() { 4262 void RemoveZeroOperations() {
4261 RemoveZeroAdd(&added_lower_index_, &added_lower_offset_); 4263 RemoveZeroAdd(&added_lower_index_, &added_lower_offset_);
4262 RemoveZeroAdd(&added_upper_index_, &added_upper_offset_); 4264 RemoveZeroAdd(&added_upper_index_, &added_upper_offset_);
4263 } 4265 }
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
4441 table->Delete(data->Key()); 4443 table->Delete(data->Key());
4442 } 4444 }
4443 } 4445 }
4444 } 4446 }
4445 4447
4446 4448
4447 void HGraph::EliminateRedundantBoundsChecks() { 4449 void HGraph::EliminateRedundantBoundsChecks() {
4448 HPhase phase("H_Eliminate bounds checks", this); 4450 HPhase phase("H_Eliminate bounds checks", this);
4449 BoundsCheckTable checks_table(zone()); 4451 BoundsCheckTable checks_table(zone());
4450 EliminateRedundantBoundsChecks(entry_block(), &checks_table); 4452 EliminateRedundantBoundsChecks(entry_block(), &checks_table);
4453 if (FLAG_abcd_ivars) {
titzer 2013/07/11 16:39:10 Indentation
Massi 2013/07/12 08:20:24 Done.
4454 EliminateRedundantBoundsChecksUsingInductionVariables();
4455 }
4451 } 4456 }
4452 4457
4453 4458
4454 static void DehoistArrayIndex(ArrayInstructionInterface* array_operation) { 4459 static void DehoistArrayIndex(ArrayInstructionInterface* array_operation) {
4455 HValue* index = array_operation->GetKey()->ActualValue(); 4460 HValue* index = array_operation->GetKey()->ActualValue();
4456 if (!index->representation().IsSmiOrInteger32()) return; 4461 if (!index->representation().IsSmiOrInteger32()) return;
4457 4462
4458 HConstant* constant; 4463 HConstant* constant;
4459 HValue* subexpression; 4464 HValue* subexpression;
4460 int32_t sign; 4465 int32_t sign;
(...skipping 7192 matching lines...) Expand 10 before | Expand all | Expand 10 after
11653 } 11658 }
11654 } 11659 }
11655 11660
11656 #ifdef DEBUG 11661 #ifdef DEBUG
11657 if (graph_ != NULL) graph_->Verify(false); // No full verify. 11662 if (graph_ != NULL) graph_->Verify(false); // No full verify.
11658 if (allocator_ != NULL) allocator_->Verify(); 11663 if (allocator_ != NULL) allocator_->Verify();
11659 #endif 11664 #endif
11660 } 11665 }
11661 11666
11662 } } // namespace v8::internal 11667 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698