Chromium Code Reviews| Index: src/ast/collect-eager-literals.h |
| diff --git a/src/ast/collect-eager-literals.h b/src/ast/collect-eager-literals.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..1fc66bc1e7214981c09a24566e20ea2bc429d575 |
| --- /dev/null |
| +++ b/src/ast/collect-eager-literals.h |
| @@ -0,0 +1,44 @@ |
| +// Copyright 2016 the V8 project authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef V8_AST_COLLECT_EAGER_LITERALS_H_ |
| +#define V8_AST_COLLECT_EAGER_LITERALS_H_ |
| + |
| +#include <set> |
| + |
| +#include "src/ast/ast-traversal-visitor.h" |
| +#include "src/base/macros.h" |
| + |
| +namespace v8 { |
| +namespace internal { |
| + |
| +class CompilationInfo; |
| +class ParseInfo; |
| + |
| +class CollectEagerLiterals final |
| + : public AstTraversalVisitor<CollectEagerLiterals> { |
| + public: |
| + explicit CollectEagerLiterals(CompilationInfo* info); |
|
Michael Starzinger
2016/10/17 13:16:03
nit: How would you feel about passing just the Par
|
| + ~CollectEagerLiterals(); |
| + |
| + const std::set<FunctionLiteral*>& eager_literals() const { |
| + return eager_literals_; |
| + } |
| + |
| + private: |
| + friend class AstTraversalVisitor<CollectEagerLiterals>; |
| + |
| + void VisitFunctionDeclaration(FunctionDeclaration* decl); |
| + void VisitFunctionLiteral(FunctionLiteral* fun); |
| + |
| + std::set<FunctionLiteral*> eager_literals_; |
| + ParseInfo* parse_info_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(CollectEagerLiterals); |
| +}; |
| + |
| +} // namespace internal |
| +} // namespace v8 |
| + |
| +#endif // V8_AST_COLLECT_EAGER_LITERALS_H_ |