<commit_before>// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

library tracer;

import '../compiler_new.dart' as api;
import 'ssa/nodes.dart' as ssa show HGraph;
import 'ssa/ssa_tracer.dart' show HTracer;
import 'util/util.dart' show Indentation;
import 'world.dart' show JClosedWorld;

/// If non-null, we only trace methods whose name match the regexp defined by
/// the given pattern.
String get TRACE_FILTER_PATTERN => TRACE_FILTER_PATTERN_FROM_ENVIRONMENT == ''
    ? TRACE_FILTER_PATTERN_FOR_TEST
    : null;

const String TRACE_FILTER_PATTERN_FROM_ENVIRONMENT =
    // TODO(sigmund): remove `?? ''` once #40678 is backported.
    const String.fromEnvironment("DUMP_IR") ?? '';
String TRACE_FILTER_PATTERN_FOR_TEST;

/// Dumps the intermediate representation after each phase in a format
/// readable by IR Hydra.
class Tracer extends TracerUtil {
  final JClosedWorld closedWorld;
  bool traceActive = false;<commit_msg>[dart2js] Fix -DDUMP_IR<commit_after>// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

library tracer;

import '../compiler_new.dart' as api;
import 'ssa/nodes.dart' as ssa show HGraph;
import 'ssa/ssa_tracer.dart' show HTracer;
import 'util/util.dart' show Indentation;
import 'world.dart' show JClosedWorld;

/// If non-null, we only trace methods whose name match the regexp defined by
/// the given pattern.
String get TRACE_FILTER_PATTERN => TRACE_FILTER_PATTERN_FROM_ENVIRONMENT != ''
    ? TRACE_FILTER_PATTERN_FROM_ENVIRONMENT
    : TRACE_FILTER_PATTERN_FOR_TEST;

const String TRACE_FILTER_PATTERN_FROM_ENVIRONMENT =
    // TODO(sigmund): remove `?? ''` once #40678 is backported.
    const String.fromEnvironment("DUMP_IR") ?? '';
String TRACE_FILTER_PATTERN_FOR_TEST;

/// Dumps the intermediate representation after each phase in a format
/// readable by IR Hydra.
class Tracer extends TracerUtil {
  final JClosedWorld closedWorld;
  bool traceActive = false;
{'fraction_non_alphanumeric': 0.08903803131991052, 'fraction_numerical': 0.008501118568232663, 'mean_word_length': 4.400966183574879, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1534689', 'n_tokens_mistral': 733, 'n_tokens_neox': 692, 'n_words': 241}