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

Unified Diff: src/variables.h

Issue 669270: Remove unneeded variable usage analysis. (Closed)
Patch Set: Created 10 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/usage-analyzer.cc ('k') | src/variables.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/variables.h
diff --git a/src/variables.h b/src/variables.h
index ac7f2940dd67e9b073d4f076e67b8872b1dbf91f..1751f1285dd7dbaf1817411c8da3ccb1e182115b 100644
--- a/src/variables.h
+++ b/src/variables.h
@@ -33,35 +33,6 @@
namespace v8 {
namespace internal {
-class UseCount BASE_EMBEDDED {
- public:
- UseCount();
-
- // Inform the node of a "use". The weight can be used to indicate
- // heavier use, for instance if the variable is accessed inside a loop.
- void RecordRead(int weight);
- void RecordWrite(int weight);
- void RecordAccess(int weight); // records a read & write
- void RecordUses(UseCount* uses);
-
- int nreads() const { return nreads_; }
- int nwrites() const { return nwrites_; }
- int nuses() const { return nreads_ + nwrites_; }
-
- bool is_read() const { return nreads() > 0; }
- bool is_written() const { return nwrites() > 0; }
- bool is_used() const { return nuses() > 0; }
-
-#ifdef DEBUG
- void Print();
-#endif
-
- private:
- int nreads_;
- int nwrites_;
-};
-
-
// Variables and AST expression nodes can track their "type" to enable
// optimizations and removal of redundant checks when generating code.
@@ -168,8 +139,8 @@ class Variable: public ZoneObject {
bool is_accessed_from_inner_scope() const {
return is_accessed_from_inner_scope_;
}
- UseCount* var_uses() { return &var_uses_; }
- UseCount* obj_uses() { return &obj_uses_; }
+ bool is_used() { return is_used_; }
+ void set_is_used(bool flag) { is_used_ = flag; }
bool IsVariable(Handle<String> n) const {
return !is_this() && name().is_identical_to(n);
@@ -216,8 +187,7 @@ class Variable: public ZoneObject {
// Usage info.
bool is_accessed_from_inner_scope_; // set by variable resolver
- UseCount var_uses_; // uses of the variable value
- UseCount obj_uses_; // uses of the object the variable points to
+ bool is_used_;
// Static type information
StaticType type_;
« no previous file with comments | « src/usage-analyzer.cc ('k') | src/variables.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698