Sha256: 08a66a525caf3a7c0a377b1045d704dc8657c58f37555f967194ccef607ab1e8

Contents?: true

Size: 1.43 KB

Versions: 5

Compression:

Stored size: 1.43 KB

Contents

// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "src/crankshaft/compilation-phase.h"

#include "src/crankshaft/hydrogen.h"
#include "src/isolate.h"

namespace v8 {
namespace internal {

CompilationPhase::CompilationPhase(const char* name, CompilationInfo* info)
    : name_(name), info_(info), zone_(info->isolate()->allocator()) {
  if (FLAG_hydrogen_stats) {
    info_zone_start_allocation_size_ = info->zone()->allocation_size();
    timer_.Start();
  }
}

CompilationPhase::~CompilationPhase() {
  if (FLAG_hydrogen_stats) {
    size_t size = zone()->allocation_size();
    size += info_->zone()->allocation_size() - info_zone_start_allocation_size_;
    isolate()->GetHStatistics()->SaveTiming(name_, timer_.Elapsed(), size);
  }
}

bool CompilationPhase::ShouldProduceTraceOutput() const {
  // Trace if the appropriate trace flag is set and the phase name's first
  // character is in the FLAG_trace_phase command line parameter.
  AllowHandleDereference allow_deref;
  bool tracing_on =
      info()->IsStub()
          ? FLAG_trace_hydrogen_stubs
          : (FLAG_trace_hydrogen &&
             info()->shared_info()->PassesFilter(FLAG_trace_hydrogen_filter));
  return (tracing_on &&
          base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) !=
              NULL);
}

}  // namespace internal
}  // namespace v8

Version data entries

5 entries across 4 versions & 1 rubygems

Version Path
node-compiler-0.9.1 vendor/node/deps/v8/src/crankshaft/compilation-phase.cc
node-compiler-0.9.0 vendor/node-v7.2.1/deps/v8/src/crankshaft/compilation-phase.cc
node-compiler-0.8.0 vendor/node-v7.2.0/deps/v8/src/crankshaft/compilation-phase.cc
node-compiler-0.7.0 vendor/node-v6.9.1/deps/v8/src/crankshaft/compilation-phase.cc
node-compiler-0.7.0 vendor/node-v7.1.0/deps/v8/src/crankshaft/compilation-phase.cc