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

Unified Diff: src/hydrogen.h

Issue 11415173: Array bounds check elimination. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Refactoring (and fixing refactoring issues). Created 8 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
« no previous file with comments | « src/flag-definitions.h ('k') | src/hydrogen.cc » ('j') | src/hydrogen.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.h
diff --git a/src/hydrogen.h b/src/hydrogen.h
index 98b05d147a290d67e10cbe57daae8bc2f73b02ea..ca159f63337ecc018a7c55d85c58fd09ce541c6f 100644
--- a/src/hydrogen.h
+++ b/src/hydrogen.h
@@ -91,6 +91,8 @@ class HBasicBlock: public ZoneObject {
void set_last_instruction_index(int index) {
last_instruction_index_ = index;
}
+ bool is_osr_entry() { return is_osr_entry_; }
+ void set_osr_entry() { is_osr_entry_ = true; }
void AttachLoopInformation();
void DetachLoopInformation();
@@ -193,6 +195,7 @@ class HBasicBlock: public ZoneObject {
bool is_inline_return_target_;
bool is_deoptimizing_;
bool dominates_loop_successors_;
+ bool is_osr_entry_;
};
@@ -225,6 +228,9 @@ class HLoopInformation: public ZoneObject {
const ZoneList<HBasicBlock*>* back_edges() const { return &back_edges_; }
const ZoneList<HBasicBlock*>* blocks() const { return &blocks_; }
HBasicBlock* loop_header() const { return loop_header_; }
+ HBasicBlock* loop_pre_header() const {
+ return loop_header_->predecessors()->at(0);
+ }
HBasicBlock* GetLastBackEdge() const;
void RegisterBackEdge(HBasicBlock* block);
@@ -243,6 +249,8 @@ class HLoopInformation: public ZoneObject {
};
class BoundsCheckTable;
+class BoundsCheckValueInfoTable;
+class BoundsCheckRemovalBlockContext;
class HGraph: public ZoneObject {
public:
explicit HGraph(CompilationInfo* info);
@@ -271,6 +279,7 @@ class HGraph: public ZoneObject {
void AssignDominators();
void ReplaceCheckedValues();
void EliminateRedundantBoundsChecks();
+ void EliminateOrDehoistBoundsChecks();
void DehoistSimpleArrayIndexComputations();
void DeadCodeElimination();
void PropagateDeoptimizingMark();
@@ -290,6 +299,7 @@ class HGraph: public ZoneObject {
undefined_constant_.set(constant);
}
HConstant* GetConstantUndefined() const { return undefined_constant_.get(); }
+ HConstant* GetConstant0();
HConstant* GetConstant1();
HConstant* GetConstantMinus1();
HConstant* GetConstantTrue();
@@ -388,7 +398,11 @@ class HGraph: public ZoneObject {
void InferTypes(ZoneList<HValue*>* worklist);
void InitializeInferredTypes(int from_inclusive, int to_inclusive);
void CheckForBackEdge(HBasicBlock* block, HBasicBlock* successor);
- void EliminateRedundantBoundsChecks(HBasicBlock* bb, BoundsCheckTable* table);
+ void EliminateRedundantBoundsChecks(HBasicBlock* bb,
+ BoundsCheckTable* table);
+ void EliminateOrDehoistBoundsChecks(
+ HBasicBlock* bb,
+ BoundsCheckRemovalBlockContext* previous_context);
Isolate* isolate_;
int next_block_id_;
@@ -399,6 +413,7 @@ class HGraph: public ZoneObject {
ZoneList<HPhi*>* phi_list_;
ZoneList<HInstruction*>* uint32_instructions_;
SetOncePointer<HConstant> undefined_constant_;
+ SetOncePointer<HConstant> constant_0_;
SetOncePointer<HConstant> constant_1_;
SetOncePointer<HConstant> constant_minus1_;
SetOncePointer<HConstant> constant_true_;
« no previous file with comments | « src/flag-definitions.h ('k') | src/hydrogen.cc » ('j') | src/hydrogen.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698