OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_TYPING_H_ | 5 #ifndef V8_TYPING_H_ |
6 #define V8_TYPING_H_ | 6 #define V8_TYPING_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/ast.h" | 9 #include "src/ast.h" |
10 #include "src/effects.h" | 10 #include "src/effects.h" |
11 #include "src/scopes.h" | 11 #include "src/scopes.h" |
12 #include "src/type-info.h" | 12 #include "src/type-info.h" |
13 #include "src/types.h" | 13 #include "src/types.h" |
14 #include "src/zone.h" | 14 #include "src/zone.h" |
15 | 15 |
16 namespace v8 { | 16 namespace v8 { |
17 namespace internal { | 17 namespace internal { |
18 | 18 |
19 | 19 |
20 class AstTyper: public AstVisitor { | 20 class AstTyper: public AstVisitor { |
21 public: | 21 public: |
22 static void Run(CompilationInfo* info); | 22 explicit AstTyper(CompilationInfo* info); |
23 | 23 void Run(); |
24 void* operator new(size_t size, Zone* zone) { return zone->New(size); } | |
25 void operator delete(void* pointer, Zone* zone) { } | |
26 void operator delete(void* pointer) { } | |
27 | 24 |
28 DEFINE_AST_VISITOR_SUBCLASS_MEMBERS(); | 25 DEFINE_AST_VISITOR_SUBCLASS_MEMBERS(); |
29 | 26 |
30 private: | 27 private: |
31 explicit AstTyper(CompilationInfo* info); | |
32 | |
33 Effect ObservedOnStack(Object* value); | 28 Effect ObservedOnStack(Object* value); |
34 void ObserveTypesAtOsrEntry(IterationStatement* stmt); | 29 void ObserveTypesAtOsrEntry(IterationStatement* stmt); |
35 | 30 |
36 static const int kNoVar = INT_MIN; | 31 static const int kNoVar = INT_MIN; |
37 typedef v8::internal::Effects<int, kNoVar> Effects; | 32 typedef v8::internal::Effects<int, kNoVar> Effects; |
38 typedef v8::internal::NestedEffects<int, kNoVar> Store; | 33 typedef v8::internal::NestedEffects<int, kNoVar> Store; |
39 | 34 |
40 CompilationInfo* info_; | 35 CompilationInfo* info_; |
41 TypeFeedbackOracle oracle_; | 36 TypeFeedbackOracle oracle_; |
42 Store store_; | 37 Store store_; |
(...skipping 30 matching lines...) Expand all Loading... |
73 #define DECLARE_VISIT(type) virtual void Visit##type(type* node) override; | 68 #define DECLARE_VISIT(type) virtual void Visit##type(type* node) override; |
74 AST_NODE_LIST(DECLARE_VISIT) | 69 AST_NODE_LIST(DECLARE_VISIT) |
75 #undef DECLARE_VISIT | 70 #undef DECLARE_VISIT |
76 | 71 |
77 DISALLOW_COPY_AND_ASSIGN(AstTyper); | 72 DISALLOW_COPY_AND_ASSIGN(AstTyper); |
78 }; | 73 }; |
79 | 74 |
80 } } // namespace v8::internal | 75 } } // namespace v8::internal |
81 | 76 |
82 #endif // V8_TYPING_H_ | 77 #endif // V8_TYPING_H_ |
OLD | NEW |