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

Unified Diff: src/variables.h

Issue 844006: Merge changes up to V8 version 2.1.3 into the partial snapshots (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/partial_snapshots/
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/v8.h ('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
===================================================================
--- src/variables.h (revision 3964)
+++ src/variables.h (working copy)
@@ -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,13 +139,15 @@
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);
}
+ bool IsStackAllocated() const;
+
bool is_dynamic() const {
return (mode_ == DYNAMIC ||
mode_ == DYNAMIC_GLOBAL ||
@@ -216,8 +189,7 @@
// 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/v8.h ('k') | src/variables.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698