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/compiler/type-hints.h" |
9 #include "src/handles.h" | 9 #include "src/handles.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 // The result of analyzing type hints. | 16 // The result of analyzing type hints. |
17 class TypeHintAnalysis final : public ZoneObject { | 17 class TypeHintAnalysis final : public ZoneObject { |
18 public: | 18 public: |
19 typedef ZoneMap<TypeFeedbackId, Handle<Code>> Infos; | 19 typedef ZoneMap<TypeFeedbackId, Handle<Code>> Infos; |
20 | 20 |
21 explicit TypeHintAnalysis(Infos const& infos) : infos_(infos) {} | 21 explicit TypeHintAnalysis(Infos const& infos, Zone* zone) |
| 22 : infos_(infos), zone_(zone) {} |
22 | 23 |
23 bool GetBinaryOperationHints(TypeFeedbackId id, | 24 bool GetBinaryOperationHints(TypeFeedbackId id, |
24 BinaryOperationHints* hints) const; | 25 BinaryOperationHints* hints) const; |
| 26 bool GetCompareOperationHints(TypeFeedbackId id, |
| 27 CompareOperationHints* hints) const; |
25 bool GetToBooleanHints(TypeFeedbackId id, ToBooleanHints* hints) const; | 28 bool GetToBooleanHints(TypeFeedbackId id, ToBooleanHints* hints) const; |
26 | 29 |
27 private: | 30 private: |
| 31 Zone* zone() const { return zone_; } |
| 32 |
28 Infos const infos_; | 33 Infos const infos_; |
| 34 Zone* zone_; |
29 }; | 35 }; |
30 | 36 |
31 | 37 |
32 // The class that performs type hint analysis on the fullcodegen code object. | 38 // The class that performs type hint analysis on the fullcodegen code object. |
33 class TypeHintAnalyzer final { | 39 class TypeHintAnalyzer final { |
34 public: | 40 public: |
35 explicit TypeHintAnalyzer(Zone* zone) : zone_(zone) {} | 41 explicit TypeHintAnalyzer(Zone* zone) : zone_(zone) {} |
36 | 42 |
37 TypeHintAnalysis* Analyze(Handle<Code> code); | 43 TypeHintAnalysis* Analyze(Handle<Code> code); |
38 | 44 |
39 private: | 45 private: |
40 Zone* zone() const { return zone_; } | 46 Zone* zone() const { return zone_; } |
41 | 47 |
42 Zone* const zone_; | 48 Zone* const zone_; |
43 | 49 |
44 DISALLOW_COPY_AND_ASSIGN(TypeHintAnalyzer); | 50 DISALLOW_COPY_AND_ASSIGN(TypeHintAnalyzer); |
45 }; | 51 }; |
46 | 52 |
47 } // namespace compiler | 53 } // namespace compiler |
48 } // namespace internal | 54 } // namespace internal |
49 } // namespace v8 | 55 } // namespace v8 |
50 | 56 |
51 #endif // V8_COMPILER_TYPE_HINT_ANALYZER_H_ | 57 #endif // V8_COMPILER_TYPE_HINT_ANALYZER_H_ |
OLD | NEW |