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

Unified Diff: src/hydrogen-gvn.h

Issue 188543004: Track global cells as special side effects in GVN. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Cells cannot move. Created 6 years, 9 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/handles-inl.h ('k') | src/hydrogen-gvn.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-gvn.h
diff --git a/src/hydrogen-gvn.h b/src/hydrogen-gvn.h
index cb83354a7e16217311798a10b8d8cf90969a181f..d00dd055854941f345b27eb59cce1d4b0c3fd266 100644
--- a/src/hydrogen-gvn.h
+++ b/src/hydrogen-gvn.h
@@ -58,7 +58,6 @@ class SideEffects V8_FINAL {
bool ContainsAnyOf(SideEffects set) const { return (bits_ & set.bits_) != 0; }
void Add(SideEffects set) { bits_ |= set.bits_; }
void AddSpecial(int special) { bits_ |= MaskSpecial(special); }
- void AddAllSpecial() { bits_ |= ~static_cast<uint64_t>(0) << kNumberOfFlags; }
void RemoveFlag(GVNFlag flag) { bits_ &= ~MaskFlag(flag); }
void RemoveAll() { bits_ = 0; }
uint64_t ToIntegral() const { return bits_; }
@@ -79,21 +78,42 @@ class SideEffects V8_FINAL {
};
-// Tracks inobject field loads/stores in a fine grained fashion, and represents
-// them using the "special" dynamic side effects of the SideEffects class (see
-// above). This way unrelated inobject field stores don't prevent hoisting and
-// merging of inobject field loads.
+// Tracks global variable and inobject field loads/stores in a fine grained
+// fashion, and represents them using the "special" dynamic side effects of the
+// SideEffects class (see above). This way unrelated global variable/inobject
+// field stores don't prevent hoisting and merging of global variable/inobject
+// field loads.
class SideEffectsTracker V8_FINAL BASE_EMBEDDED {
public:
- SideEffectsTracker() : num_inobject_fields_(0) {}
+ SideEffectsTracker() : num_global_vars_(0), num_inobject_fields_(0) {}
SideEffects ComputeChanges(HInstruction* instr);
SideEffects ComputeDependsOn(HInstruction* instr);
void PrintSideEffectsTo(StringStream* stream, SideEffects side_effects) const;
private:
+ bool ComputeGlobalVar(Unique<Cell> cell, int* index);
bool ComputeInobjectField(HObjectAccess access, int* index);
- HObjectAccess inobject_fields_[SideEffects::kNumberOfSpecials];
+ static int GlobalVar(int index) {
+ ASSERT(index >= 0);
+ ASSERT(index < kNumberOfGlobalVars);
+ return index;
+ }
+ static int InobjectField(int index) {
+ ASSERT(index >= 0);
+ ASSERT(index < kNumberOfInobjectFields);
+ return index + kNumberOfGlobalVars;
+ }
+
+ // Track up to four global vars.
+ static const int kNumberOfGlobalVars = 4;
+ Unique<Cell> global_vars_[kNumberOfGlobalVars];
+ int num_global_vars_;
+
+ // Track up to n inobject fields.
+ static const int kNumberOfInobjectFields =
+ SideEffects::kNumberOfSpecials - kNumberOfGlobalVars;
+ HObjectAccess inobject_fields_[kNumberOfInobjectFields];
int num_inobject_fields_;
};
« no previous file with comments | « src/handles-inl.h ('k') | src/hydrogen-gvn.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698