diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2011-10-13 17:45:02 -0700 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2011-10-13 17:45:02 -0700 |
commit | 33b5f2f7799081eafe04df3278aad40fd4ae3b55 (patch) | |
tree | 46e2840438240411375d3f12f5172c42aa571f95 /deps/v8/src/ast.h | |
parent | 59a5262041dce0760b1f960a900eca8b8ca1138f (diff) | |
download | node-33b5f2f7799081eafe04df3278aad40fd4ae3b55.tar.gz |
Upgrade V8 to 3.7.0
Diffstat (limited to 'deps/v8/src/ast.h')
-rw-r--r-- | deps/v8/src/ast.h | 41 |
1 files changed, 14 insertions, 27 deletions
diff --git a/deps/v8/src/ast.h b/deps/v8/src/ast.h index b56205f9a..0efc4835c 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, |