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