Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Side by Side Diff: src/crankshaft/compilation-phase.cc

Issue 1758773002: [crankshaft] Move CompilationPhase into separate file. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_cleanup-compiler-api-2
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/crankshaft/compilation-phase.h ('k') | src/crankshaft/hydrogen.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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 #include "src/crankshaft/compilation-phase.h"
6
7 #include "src/crankshaft/hydrogen.h"
8 #include "src/isolate.h"
9
10 namespace v8 {
11 namespace internal {
12
13 CompilationPhase::CompilationPhase(const char* name, CompilationInfo* info)
14 : name_(name), info_(info) {
15 if (FLAG_hydrogen_stats) {
16 info_zone_start_allocation_size_ = info->zone()->allocation_size();
17 timer_.Start();
18 }
19 }
20
21 CompilationPhase::~CompilationPhase() {
22 if (FLAG_hydrogen_stats) {
23 size_t size = zone()->allocation_size();
24 size += info_->zone()->allocation_size() - info_zone_start_allocation_size_;
25 isolate()->GetHStatistics()->SaveTiming(name_, timer_.Elapsed(), size);
26 }
27 }
28
29 bool CompilationPhase::ShouldProduceTraceOutput() const {
30 // Trace if the appropriate trace flag is set and the phase name's first
31 // character is in the FLAG_trace_phase command line parameter.
32 AllowHandleDereference allow_deref;
33 bool tracing_on =
34 info()->IsStub()
35 ? FLAG_trace_hydrogen_stubs
36 : (FLAG_trace_hydrogen &&
37 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter));
38 return (tracing_on &&
39 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) !=
40 NULL);
41 }
42
43 } // namespace internal
44 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/compilation-phase.h ('k') | src/crankshaft/hydrogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698