summaryrefslogtreecommitdiff
path: root/deps/v8/src/typing.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/typing.h')
-rw-r--r--deps/v8/src/typing.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/deps/v8/src/typing.h b/deps/v8/src/typing.h
index ceef984365..c942b00632 100644
--- a/deps/v8/src/typing.h
+++ b/deps/v8/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);