OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef V8_EXPRESSION_TYPE_COLLECTOR_H_ |
| 6 #define V8_EXPRESSION_TYPE_COLLECTOR_H_ |
| 7 |
| 8 #include "src/ast-expression-visitor.h" |
| 9 |
| 10 namespace v8 { |
| 11 namespace internal { |
| 12 |
| 13 // A Visitor over a CompilationInfo's AST that collects |
| 14 // a human readable string summarizing structure and types. |
| 15 // Used for testing of the typing information attached to the |
| 16 // expression nodes of an AST. |
| 17 |
| 18 struct ExpressionTypeEntry { |
| 19 int depth; |
| 20 const char* kind; |
| 21 const AstRawString* name; |
| 22 Bounds bounds; |
| 23 }; |
| 24 |
| 25 class ExpressionTypeCollector : public AstExpressionVisitor { |
| 26 public: |
| 27 ExpressionTypeCollector(CompilationInfo* info, |
| 28 ZoneVector<ExpressionTypeEntry>* dst); |
| 29 void Run(); |
| 30 |
| 31 protected: |
| 32 void VisitExpression(Expression* expression); |
| 33 |
| 34 private: |
| 35 ZoneVector<ExpressionTypeEntry>* result_; |
| 36 }; |
| 37 } |
| 38 } // namespace v8::internal |
| 39 |
| 40 #endif // V8_EXPRESSION_TYPE_COLLECTOR_H_ |
OLD | NEW |