Index: src/typing.h |
diff --git a/src/typing.h b/src/typing.h |
index ceef9843650a190e091943f02fc3c3a1546620ce..c942b0063278708d4c4828652ebd7d9365943717 100644 |
--- a/src/typing.h |
+++ b/src/typing.h |
@@ -35,6 +35,7 @@ |
#include "compiler.h" |
#include "type-info.h" |
#include "types.h" |
+#include "effects.h" |
#include "zone.h" |
#include "scopes.h" |
@@ -57,8 +58,13 @@ class AstTyper: public AstVisitor { |
private: |
explicit AstTyper(CompilationInfo* info); |
+ static const int kNoVar = INT_MIN; |
+ typedef v8::internal::Effects<int, kNoVar> Effects; |
+ typedef v8::internal::NestedEffects<int, kNoVar> Store; |
+ |
CompilationInfo* info_; |
TypeFeedbackOracle oracle_; |
+ Store store_; |
TypeFeedbackOracle* oracle() { return &oracle_; } |
Zone* zone() const { return info_->zone(); } |
@@ -70,6 +76,17 @@ class AstTyper: public AstVisitor { |
e->set_bounds(Bounds::NarrowLower(e->bounds(), t, isolate_)); |
} |
+ Effects EnterEffects() { |
+ store_ = store_.Push(); |
+ return store_.Top(); |
+ } |
+ void ExitEffects() { store_ = store_.Pop(); } |
+ |
+ int variable_index(Variable* var) { |
+ return var->IsStackLocal() ? var->index() : |
+ var->IsParameter() ? -var->index() : kNoVar; |
+ } |
+ |
void VisitDeclarations(ZoneList<Declaration*>* declarations); |
void VisitStatements(ZoneList<Statement*>* statements); |