1 // Copyright 2016 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_CRANKSHAFT_COMPILATION_PHASE_H_ 6 #define V8_CRANKSHAFT_COMPILATION_PHASE_H_ 7 8 #include "src/allocation.h" 9 #include "src/base/platform/elapsed-timer.h" 10 #include "src/compilation-info.h" 11 #include "src/zone/zone.h" 12 13 namespace v8 { 14 namespace internal { 15 16 class CompilationPhase BASE_EMBEDDED { 17 public: 18 CompilationPhase(const char* name, CompilationInfo* info); 19 ~CompilationPhase(); 20 21 protected: 22 bool ShouldProduceTraceOutput() const; 23 name()24 const char* name() const { return name_; } info()25 CompilationInfo* info() const { return info_; } isolate()26 Isolate* isolate() const { return info()->isolate(); } zone()27 Zone* zone() { return &zone_; } 28 29 private: 30 const char* name_; 31 CompilationInfo* info_; 32 Zone zone_; 33 size_t info_zone_start_allocation_size_; 34 base::ElapsedTimer timer_; 35 36 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); 37 }; 38 39 } // namespace internal 40 } // namespace v8 41 42 #endif // V8_CRANKSHAFT_COMPILATION_PHASE_H_ 43