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

Unified Diff: src/ast.h

Issue 7830036: Optimize isFinite and isNaN. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Made the change general by moving putting it in the NUMBER_IS_FINITE macro. Created 9 years, 3 months 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 | « src/array.js ('k') | src/ast.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast.h
diff --git a/src/ast.h b/src/ast.h
index 3d53b5fb0e4c82708f3468a257ec79ecd24b0f54..e36eb9b32182e481fa8f91e749758e61e228c733 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -320,6 +320,20 @@ class Expression: public AstNode {
};
+/**
+ * A sentinel used during pre parsing that represents some expression
+ * that is a valid left hand side without having to actually build
+ * the expression.
+ */
+class ValidLeftHandSideSentinel: public Expression {
+ public:
+ explicit ValidLeftHandSideSentinel(Isolate* isolate) : Expression(isolate) {}
+ virtual bool IsValidLeftHandSide() { return true; }
+ virtual void Accept(AstVisitor* v) { UNREACHABLE(); }
+ virtual bool IsInlineable() const;
+};
+
+
class BreakableStatement: public Statement {
public:
enum Type {
@@ -1160,11 +1174,24 @@ class VariableProxy: public Expression {
bool is_this,
bool inside_with,
int position = RelocInfo::kNoPosition);
+ VariableProxy(Isolate* isolate, bool is_this);
friend class Scope;
};
+class VariableProxySentinel: public VariableProxy {
+ public:
+ virtual bool IsValidLeftHandSide() { return !is_this(); }
+
+ private:
+ VariableProxySentinel(Isolate* isolate, bool is_this)
+ : VariableProxy(isolate, is_this) { }
+
+ friend class AstSentinels;
+};
+
+
class Slot: public Expression {
public:
enum Type {
@@ -1322,6 +1349,36 @@ class Call: public Expression {
};
+class AstSentinels {
+ public:
+ ~AstSentinels() { }
+
+ // Returns a property singleton property access on 'this'. Used
+ // during preparsing.
+ Property* this_property() { return &this_property_; }
+ VariableProxySentinel* this_proxy() { return &this_proxy_; }
+ VariableProxySentinel* identifier_proxy() { return &identifier_proxy_; }
+ ValidLeftHandSideSentinel* valid_left_hand_side_sentinel() {
+ return &valid_left_hand_side_sentinel_;
+ }
+ Call* call_sentinel() { return &call_sentinel_; }
+ EmptyStatement* empty_statement() { return &empty_statement_; }
+
+ private:
+ AstSentinels();
+ VariableProxySentinel this_proxy_;
+ VariableProxySentinel identifier_proxy_;
+ ValidLeftHandSideSentinel valid_left_hand_side_sentinel_;
+ Property this_property_;
+ Call call_sentinel_;
+ EmptyStatement empty_statement_;
+
+ friend class Isolate;
+
+ DISALLOW_COPY_AND_ASSIGN(AstSentinels);
+};
+
+
class CallNew: public Expression {
public:
CallNew(Isolate* isolate,
« no previous file with comments | « src/array.js ('k') | src/ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698