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

Unified Diff: dart/runtime/vm/scopes.h

Issue 59073003: Version 0.8.10.4 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 1 month 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 | « dart/runtime/vm/raw_object_snapshot.cc ('k') | dart/runtime/vm/scopes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/runtime/vm/scopes.h
===================================================================
--- dart/runtime/vm/scopes.h (revision 29808)
+++ dart/runtime/vm/scopes.h (working copy)
@@ -117,6 +117,21 @@
};
+class NameReference : public ZoneAllocated {
+ public:
+ NameReference(intptr_t token_pos, const String& name)
+ : token_pos_(token_pos),
+ name_(name) {
+ }
+ const String& name() const { return name_; }
+ intptr_t token_pos() const { return token_pos_; }
+ void set_token_pos(intptr_t value) { token_pos_ = value; }
+ private:
+ intptr_t token_pos_;
+ const String& name_;
+};
+
+
class SourceLabel : public ZoneAllocated {
public:
enum Kind {
@@ -306,6 +321,12 @@
// this local scope.
int NumCapturedVariables() const;
+ // Add a reference to the given name into this scope and the enclosing
+ // scopes that do not have a local variable declaration for this name
+ // already.
+ void AddReferencedName(intptr_t token_pos, const String& name);
+ intptr_t PreviousReferencePos(const String& name) const;
+
// Allocate both captured and non-captured variables declared in this scope
// and in its children scopes of the same function level. Allocating means
// assigning a frame slot index or a context slot index.
@@ -354,6 +375,8 @@
void CollectLocalVariables(GrowableArray<VarDesc>* vars, int16_t* scope_id);
+ NameReference* FindReference(const String& name) const;
+
static const int kUnitializedContextLevel = INT_MIN;
LocalScope* parent_;
LocalScope* child_;
@@ -367,6 +390,10 @@
GrowableArray<LocalVariable*> variables_;
GrowableArray<SourceLabel*> labels_;
+ // List of names referenced in this scope and its children that
+ // are not resolved to local variables.
+ GrowableArray<NameReference*> referenced_;
+
DISALLOW_COPY_AND_ASSIGN(LocalScope);
};
« no previous file with comments | « dart/runtime/vm/raw_object_snapshot.cc ('k') | dart/runtime/vm/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698