summaryrefslogtreecommitdiff
path: root/deps/v8/src/ast.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/ast.h')
-rw-r--r--deps/v8/src/ast.h41
1 files changed, 14 insertions, 27 deletions
diff --git a/deps/v8/src/ast.h b/deps/v8/src/ast.h
index b56205f9a6..0efc4835c4 100644
--- a/deps/v8/src/ast.h
+++ b/deps/v8/src/ast.h
@@ -90,7 +90,6 @@ namespace internal {
V(CountOperation) \
V(BinaryOperation) \
V(CompareOperation) \
- V(CompareToNull) \
V(ThisFunction)
#define AST_NODE_LIST(V) \
@@ -289,6 +288,12 @@ class Expression: public AstNode {
// True iff the expression is a literal represented as a smi.
virtual bool IsSmiLiteral() { return false; }
+ // True iff the expression is a string literal.
+ virtual bool IsStringLiteral() { return false; }
+
+ // True iff the expression is the null literal.
+ virtual bool IsNullLiteral() { return false; }
+
// Type feedback information for assignments and properties.
virtual bool IsMonomorphic() {
UNREACHABLE();
@@ -393,31 +398,29 @@ class Block: public BreakableStatement {
class Declaration: public AstNode {
public:
Declaration(VariableProxy* proxy,
- Variable::Mode mode,
+ VariableMode mode,
FunctionLiteral* fun,
Scope* scope)
: proxy_(proxy),
mode_(mode),
fun_(fun),
scope_(scope) {
- ASSERT(mode == Variable::VAR ||
- mode == Variable::CONST ||
- mode == Variable::LET);
+ ASSERT(mode == VAR || mode == CONST || mode == LET);
// At the moment there are no "const functions"'s in JavaScript...
- ASSERT(fun == NULL || mode == Variable::VAR || mode == Variable::LET);
+ ASSERT(fun == NULL || mode == VAR || mode == LET);
}
DECLARE_NODE_TYPE(Declaration)
VariableProxy* proxy() const { return proxy_; }
- Variable::Mode mode() const { return mode_; }
+ VariableMode mode() const { return mode_; }
FunctionLiteral* fun() const { return fun_; } // may be NULL
virtual bool IsInlineable() const;
Scope* scope() const { return scope_; }
private:
VariableProxy* proxy_;
- Variable::Mode mode_;
+ VariableMode mode_;
FunctionLiteral* fun_;
// Nested scope from which the declaration originated.
@@ -891,6 +894,8 @@ class Literal: public Expression {
virtual bool IsTrivial() { return true; }
virtual bool IsSmiLiteral() { return handle_->IsSmi(); }
+ virtual bool IsStringLiteral() { return handle_->IsString(); }
+ virtual bool IsNullLiteral() { return handle_->IsNull(); }
// Check if this literal is identical to the other literal.
bool IsIdenticalTo(const Literal* other) const {
@@ -1465,6 +1470,7 @@ class CompareOperation: public Expression {
// Match special cases.
bool IsLiteralCompareTypeof(Expression** expr, Handle<String>* check);
bool IsLiteralCompareUndefined(Expression** expr);
+ bool IsLiteralCompareNull(Expression** expr);
private:
Token::Value op_;
@@ -1477,25 +1483,6 @@ class CompareOperation: public Expression {
};
-class CompareToNull: public Expression {
- public:
- CompareToNull(Isolate* isolate, bool is_strict, Expression* expression)
- : Expression(isolate), is_strict_(is_strict), expression_(expression) { }
-
- DECLARE_NODE_TYPE(CompareToNull)
-
- virtual bool IsInlineable() const;
-
- bool is_strict() const { return is_strict_; }
- Token::Value op() const { return is_strict_ ? Token::EQ_STRICT : Token::EQ; }
- Expression* expression() const { return expression_; }
-
- private:
- bool is_strict_;
- Expression* expression_;
-};
-
-
class Conditional: public Expression {
public:
Conditional(Isolate* isolate,