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

Unified Diff: src/variables.cc

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/variables.h ('k') | src/version.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/variables.cc
===================================================================
--- src/variables.cc (revision 3964)
+++ src/variables.cc (working copy)
@@ -35,57 +35,6 @@
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.
@@ -136,6 +85,12 @@
}
+bool Variable::IsStackAllocated() const {
+ Slot* s = slot();
+ return s != NULL && s->IsStackAllocated();
+}
+
+
Variable::Variable(Scope* scope,
Handle<String> name,
Mode mode,
@@ -148,6 +103,7 @@
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') | src/version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698