OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 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 | 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_COMPILER_TYPE_HINT_ANALYZER_H_ | 5 #ifndef V8_COMPILER_TYPE_HINT_ANALYZER_H_ |
6 #define V8_COMPILER_TYPE_HINT_ANALYZER_H_ | 6 #define V8_COMPILER_TYPE_HINT_ANALYZER_H_ |
7 | 7 |
| 8 #include "src/compiler/type-hints.h" |
8 #include "src/handles.h" | 9 #include "src/handles.h" |
9 #include "src/utils.h" | |
10 #include "src/zone-containers.h" | 10 #include "src/zone-containers.h" |
11 | 11 |
12 namespace v8 { | 12 namespace v8 { |
13 namespace internal { | 13 namespace internal { |
14 namespace compiler { | 14 namespace compiler { |
15 | 15 |
16 // Forward declarations. | |
17 class BinaryOperationHints; | |
18 | |
19 | |
20 // The result of analyzing type hints. | 16 // The result of analyzing type hints. |
21 class TypeHintAnalysis final : public ZoneObject { | 17 class TypeHintAnalysis final : public ZoneObject { |
22 public: | 18 public: |
23 typedef ZoneMap<TypeFeedbackId, Handle<Code>> Infos; | 19 typedef ZoneMap<TypeFeedbackId, Handle<Code>> Infos; |
24 | 20 |
25 explicit TypeHintAnalysis(Infos const& infos) : infos_(infos) {} | 21 explicit TypeHintAnalysis(Infos const& infos) : infos_(infos) {} |
26 | 22 |
27 bool GetBinaryOperationHints(TypeFeedbackId id, | 23 bool GetBinaryOperationHints(TypeFeedbackId id, |
28 BinaryOperationHints* hints) const; | 24 BinaryOperationHints* hints) const; |
| 25 bool GetToBooleanHints(TypeFeedbackId id, ToBooleanHints* hints) const; |
29 | 26 |
30 private: | 27 private: |
31 Infos const infos_; | 28 Infos const infos_; |
32 }; | 29 }; |
33 | 30 |
34 | 31 |
35 // The class that performs type hint analysis on the fullcodegen code object. | 32 // The class that performs type hint analysis on the fullcodegen code object. |
36 class TypeHintAnalyzer final { | 33 class TypeHintAnalyzer final { |
37 public: | 34 public: |
38 explicit TypeHintAnalyzer(Zone* zone) : zone_(zone) {} | 35 explicit TypeHintAnalyzer(Zone* zone) : zone_(zone) {} |
39 | 36 |
40 TypeHintAnalysis* Analyze(Handle<Code> code); | 37 TypeHintAnalysis* Analyze(Handle<Code> code); |
41 | 38 |
42 private: | 39 private: |
43 Zone* zone() const { return zone_; } | 40 Zone* zone() const { return zone_; } |
44 | 41 |
45 Zone* const zone_; | 42 Zone* const zone_; |
46 | 43 |
47 DISALLOW_COPY_AND_ASSIGN(TypeHintAnalyzer); | 44 DISALLOW_COPY_AND_ASSIGN(TypeHintAnalyzer); |
48 }; | 45 }; |
49 | 46 |
50 } // namespace compiler | 47 } // namespace compiler |
51 } // namespace internal | 48 } // namespace internal |
52 } // namespace v8 | 49 } // namespace v8 |
53 | 50 |
54 #endif // V8_COMPILER_TYPE_HINT_ANALYZER_H_ | 51 #endif // V8_COMPILER_TYPE_HINT_ANALYZER_H_ |
OLD | NEW |