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

Unified Diff: src/variables.cc

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/variables.h ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/variables.cc
diff --git a/src/variables.cc b/src/variables.cc
index 3bcd48a8b28d9956f43cd8721f85d86afd3e9255..d7c25320bcc1f9da6d1df3dbc00461f78948ae1d 100644
--- a/src/variables.cc
+++ b/src/variables.cc
@@ -35,57 +35,6 @@ namespace v8 {
namespace internal {
// ----------------------------------------------------------------------------
-// Implementation UseCount.
-
-UseCount::UseCount()
- : nreads_(0),
- nwrites_(0) {
-}
-
-
-void UseCount::RecordRead(int weight) {
- ASSERT(weight > 0);
- nreads_ += weight;
- // We must have a positive nreads_ here. Handle
- // any kind of overflow by setting nreads_ to
- // some large-ish value.
- if (nreads_ <= 0) nreads_ = 1000000;
- ASSERT(is_read() & is_used());
-}
-
-
-void UseCount::RecordWrite(int weight) {
- ASSERT(weight > 0);
- nwrites_ += weight;
- // We must have a positive nwrites_ here. Handle
- // any kind of overflow by setting nwrites_ to
- // some large-ish value.
- if (nwrites_ <= 0) nwrites_ = 1000000;
- ASSERT(is_written() && is_used());
-}
-
-
-void UseCount::RecordAccess(int weight) {
- RecordRead(weight);
- RecordWrite(weight);
-}
-
-
-void UseCount::RecordUses(UseCount* uses) {
- if (uses->nreads() > 0) RecordRead(uses->nreads());
- if (uses->nwrites() > 0) RecordWrite(uses->nwrites());
-}
-
-
-#ifdef DEBUG
-void UseCount::Print() {
- // PrintF("r = %d, w = %d", nreads_, nwrites_);
- PrintF("%du = %dr + %dw", nuses(), nreads(), nwrites());
-}
-#endif
-
-
-// ----------------------------------------------------------------------------
// Implementation StaticType.
@@ -148,6 +97,7 @@ Variable::Variable(Scope* scope,
kind_(kind),
local_if_not_shadowed_(NULL),
is_accessed_from_inner_scope_(false),
+ is_used_(false),
rewrite_(NULL) {
// names must be canonicalized for fast equality checks
ASSERT(name->IsSymbol());
« no previous file with comments | « src/variables.h ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698