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

Side by Side Diff: src/ast.h

Issue 669240: - Remove function boilerplate objects and use SharedFunctionInfos in... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Committed Created 10 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/arm/full-codegen-arm.cc ('k') | src/ast.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 V(DoWhileStatement) \ 66 V(DoWhileStatement) \
67 V(WhileStatement) \ 67 V(WhileStatement) \
68 V(ForStatement) \ 68 V(ForStatement) \
69 V(ForInStatement) \ 69 V(ForInStatement) \
70 V(TryCatchStatement) \ 70 V(TryCatchStatement) \
71 V(TryFinallyStatement) \ 71 V(TryFinallyStatement) \
72 V(DebuggerStatement) 72 V(DebuggerStatement)
73 73
74 #define EXPRESSION_NODE_LIST(V) \ 74 #define EXPRESSION_NODE_LIST(V) \
75 V(FunctionLiteral) \ 75 V(FunctionLiteral) \
76 V(FunctionBoilerplateLiteral) \ 76 V(SharedFunctionInfoLiteral) \
77 V(Conditional) \ 77 V(Conditional) \
78 V(Slot) \ 78 V(Slot) \
79 V(VariableProxy) \ 79 V(VariableProxy) \
80 V(Literal) \ 80 V(Literal) \
81 V(RegExpLiteral) \ 81 V(RegExpLiteral) \
82 V(ObjectLiteral) \ 82 V(ObjectLiteral) \
83 V(ArrayLiteral) \ 83 V(ArrayLiteral) \
84 V(CatchExtensionObject) \ 84 V(CatchExtensionObject) \
85 V(Assignment) \ 85 V(Assignment) \
86 V(Throw) \ 86 V(Throw) \
(...skipping 1552 matching lines...) Expand 10 before | Expand all | Expand 10 after
1639 bool is_expression_; 1639 bool is_expression_;
1640 int function_token_position_; 1640 int function_token_position_;
1641 Handle<String> inferred_name_; 1641 Handle<String> inferred_name_;
1642 bool try_full_codegen_; 1642 bool try_full_codegen_;
1643 #ifdef DEBUG 1643 #ifdef DEBUG
1644 bool already_compiled_; 1644 bool already_compiled_;
1645 #endif 1645 #endif
1646 }; 1646 };
1647 1647
1648 1648
1649 class FunctionBoilerplateLiteral: public Expression { 1649 class SharedFunctionInfoLiteral: public Expression {
1650 public: 1650 public:
1651 explicit FunctionBoilerplateLiteral(Handle<JSFunction> boilerplate) 1651 explicit SharedFunctionInfoLiteral(
1652 : boilerplate_(boilerplate) { 1652 Handle<SharedFunctionInfo> shared_function_info)
1653 ASSERT(boilerplate->IsBoilerplate()); 1653 : shared_function_info_(shared_function_info) { }
1654
1655 Handle<SharedFunctionInfo> shared_function_info() const {
1656 return shared_function_info_;
1654 } 1657 }
1655 1658
1656 Handle<JSFunction> boilerplate() const { return boilerplate_; }
1657
1658 virtual bool IsLeaf() { return true; } 1659 virtual bool IsLeaf() { return true; }
1659 1660
1660 virtual void Accept(AstVisitor* v); 1661 virtual void Accept(AstVisitor* v);
1661 1662
1662 virtual bool IsPrimitive(); 1663 virtual bool IsPrimitive();
1663 1664
1664 private: 1665 private:
1665 Handle<JSFunction> boilerplate_; 1666 Handle<SharedFunctionInfo> shared_function_info_;
1666 }; 1667 };
1667 1668
1668 1669
1669 class ThisFunction: public Expression { 1670 class ThisFunction: public Expression {
1670 public: 1671 public:
1671 virtual void Accept(AstVisitor* v); 1672 virtual void Accept(AstVisitor* v);
1672 virtual bool IsLeaf() { return true; } 1673 virtual bool IsLeaf() { return true; }
1673 virtual bool IsPrimitive(); 1674 virtual bool IsPrimitive();
1674 }; 1675 };
1675 1676
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
2083 2084
2084 // Holds the result of copying an expression. 2085 // Holds the result of copying an expression.
2085 Expression* expr_; 2086 Expression* expr_;
2086 // Holds the result of copying a statement. 2087 // Holds the result of copying a statement.
2087 Statement* stmt_; 2088 Statement* stmt_;
2088 }; 2089 };
2089 2090
2090 } } // namespace v8::internal 2091 } } // namespace v8::internal
2091 2092
2092 #endif // V8_AST_H_ 2093 #endif // V8_AST_H_
OLDNEW
« no previous file with comments | « src/arm/full-codegen-arm.cc ('k') | src/ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698