| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_HYDROGEN_H_ | 5 #ifndef V8_HYDROGEN_H_ |
| 6 #define V8_HYDROGEN_H_ | 6 #define V8_HYDROGEN_H_ |
| 7 | 7 |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "src/accessors.h" | 10 #include "src/accessors.h" |
| (...skipping 2735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2746 public: | 2746 public: |
| 2747 HStatistics() | 2747 HStatistics() |
| 2748 : times_(5), | 2748 : times_(5), |
| 2749 names_(5), | 2749 names_(5), |
| 2750 sizes_(5), | 2750 sizes_(5), |
| 2751 total_size_(0), | 2751 total_size_(0), |
| 2752 source_size_(0) { } | 2752 source_size_(0) { } |
| 2753 | 2753 |
| 2754 void Initialize(CompilationInfo* info); | 2754 void Initialize(CompilationInfo* info); |
| 2755 void Print(); | 2755 void Print(); |
| 2756 void SaveTiming(const char* name, TimeDelta time, unsigned size); | 2756 void SaveTiming(const char* name, base::TimeDelta time, unsigned size); |
| 2757 | 2757 |
| 2758 void IncrementFullCodeGen(TimeDelta full_code_gen) { | 2758 void IncrementFullCodeGen(base::TimeDelta full_code_gen) { |
| 2759 full_code_gen_ += full_code_gen; | 2759 full_code_gen_ += full_code_gen; |
| 2760 } | 2760 } |
| 2761 | 2761 |
| 2762 void IncrementSubtotals(TimeDelta create_graph, | 2762 void IncrementSubtotals(base::TimeDelta create_graph, |
| 2763 TimeDelta optimize_graph, | 2763 base::TimeDelta optimize_graph, |
| 2764 TimeDelta generate_code) { | 2764 base::TimeDelta generate_code) { |
| 2765 create_graph_ += create_graph; | 2765 create_graph_ += create_graph; |
| 2766 optimize_graph_ += optimize_graph; | 2766 optimize_graph_ += optimize_graph; |
| 2767 generate_code_ += generate_code; | 2767 generate_code_ += generate_code; |
| 2768 } | 2768 } |
| 2769 | 2769 |
| 2770 private: | 2770 private: |
| 2771 List<TimeDelta> times_; | 2771 List<base::TimeDelta> times_; |
| 2772 List<const char*> names_; | 2772 List<const char*> names_; |
| 2773 List<unsigned> sizes_; | 2773 List<unsigned> sizes_; |
| 2774 TimeDelta create_graph_; | 2774 base::TimeDelta create_graph_; |
| 2775 TimeDelta optimize_graph_; | 2775 base::TimeDelta optimize_graph_; |
| 2776 TimeDelta generate_code_; | 2776 base::TimeDelta generate_code_; |
| 2777 unsigned total_size_; | 2777 unsigned total_size_; |
| 2778 TimeDelta full_code_gen_; | 2778 base::TimeDelta full_code_gen_; |
| 2779 double source_size_; | 2779 double source_size_; |
| 2780 }; | 2780 }; |
| 2781 | 2781 |
| 2782 | 2782 |
| 2783 class HPhase : public CompilationPhase { | 2783 class HPhase : public CompilationPhase { |
| 2784 public: | 2784 public: |
| 2785 HPhase(const char* name, HGraph* graph) | 2785 HPhase(const char* name, HGraph* graph) |
| 2786 : CompilationPhase(name, graph->info()), | 2786 : CompilationPhase(name, graph->info()), |
| 2787 graph_(graph) { } | 2787 graph_(graph) { } |
| 2788 ~HPhase(); | 2788 ~HPhase(); |
| 2789 | 2789 |
| 2790 protected: | 2790 protected: |
| 2791 HGraph* graph() const { return graph_; } | 2791 HGraph* graph() const { return graph_; } |
| 2792 | 2792 |
| 2793 private: | 2793 private: |
| 2794 HGraph* graph_; | 2794 HGraph* graph_; |
| 2795 | 2795 |
| 2796 DISALLOW_COPY_AND_ASSIGN(HPhase); | 2796 DISALLOW_COPY_AND_ASSIGN(HPhase); |
| 2797 }; | 2797 }; |
| 2798 | 2798 |
| 2799 | 2799 |
| 2800 class HTracer V8_FINAL : public Malloced { | 2800 class HTracer V8_FINAL : public Malloced { |
| 2801 public: | 2801 public: |
| 2802 explicit HTracer(int isolate_id) | 2802 explicit HTracer(int isolate_id) |
| 2803 : trace_(&string_allocator_), indent_(0) { | 2803 : trace_(&string_allocator_), indent_(0) { |
| 2804 if (FLAG_trace_hydrogen_file == NULL) { | 2804 if (FLAG_trace_hydrogen_file == NULL) { |
| 2805 SNPrintF(filename_, | 2805 SNPrintF(filename_, |
| 2806 "hydrogen-%d-%d.cfg", | 2806 "hydrogen-%d-%d.cfg", |
| 2807 OS::GetCurrentProcessId(), | 2807 base::OS::GetCurrentProcessId(), |
| 2808 isolate_id); | 2808 isolate_id); |
| 2809 } else { | 2809 } else { |
| 2810 StrNCpy(filename_, FLAG_trace_hydrogen_file, filename_.length()); | 2810 StrNCpy(filename_, FLAG_trace_hydrogen_file, filename_.length()); |
| 2811 } | 2811 } |
| 2812 WriteChars(filename_.start(), "", 0, false); | 2812 WriteChars(filename_.start(), "", 0, false); |
| 2813 } | 2813 } |
| 2814 | 2814 |
| 2815 void TraceCompilation(CompilationInfo* info); | 2815 void TraceCompilation(CompilationInfo* info); |
| 2816 void TraceHydrogen(const char* name, HGraph* graph); | 2816 void TraceHydrogen(const char* name, HGraph* graph); |
| 2817 void TraceLithium(const char* name, LChunk* chunk); | 2817 void TraceLithium(const char* name, LChunk* chunk); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2894 } | 2894 } |
| 2895 | 2895 |
| 2896 private: | 2896 private: |
| 2897 HGraphBuilder* builder_; | 2897 HGraphBuilder* builder_; |
| 2898 }; | 2898 }; |
| 2899 | 2899 |
| 2900 | 2900 |
| 2901 } } // namespace v8::internal | 2901 } } // namespace v8::internal |
| 2902 | 2902 |
| 2903 #endif // V8_HYDROGEN_H_ | 2903 #endif // V8_HYDROGEN_H_ |
| OLD | NEW |