Files
sdk/runtime/vm/compiler/backend/il_printer.h
T
Alexander Markov f6d6766920 [VM] Restore disassembler in flutter/profile (dart/release) mode
This CL restores disassembler in precompiled mode after it was removed
in 8cb752f73b.
Without disassembler observatory is not able to show assembly code
in 'flutter run --profile' mode.

This CL also pulls BufferFormatter out of il_printer.h/.cc as it is also
used in disassembler.

Change-Id: I098ddb8d8f5a2426028c1f467d58e5c2d6a82d21
Reviewed-on: https://dart-review.googlesource.com/7486
Reviewed-by: Zach Anderson <zra@google.com>
2017-09-21 16:07:02 +00:00

66 lines
2.4 KiB
C++

// Copyright (c) 2012, 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.
#ifndef RUNTIME_VM_COMPILER_BACKEND_IL_PRINTER_H_
#define RUNTIME_VM_COMPILER_BACKEND_IL_PRINTER_H_
#include "platform/text_buffer.h"
#include "vm/compiler/backend/flow_graph.h"
#include "vm/compiler/backend/il.h"
namespace dart {
class ParsedFunction;
// Graph printing.
class FlowGraphPrinter : public ValueObject {
public:
static const intptr_t kPrintAll = -1;
explicit FlowGraphPrinter(const FlowGraph& flow_graph,
bool print_locations = false)
: function_(flow_graph.function()),
block_order_(flow_graph.reverse_postorder()),
print_locations_(print_locations) {}
// Print the instructions in a block terminated by newlines. Add "goto N"
// to the end of the block if it ends with an unconditional jump to
// another block and that block is not next in reverse postorder.
void PrintBlocks();
void PrintInstruction(Instruction* instr);
static void PrintOneInstruction(Instruction* instr, bool print_locations);
static void PrintTypeCheck(const ParsedFunction& parsed_function,
TokenPosition token_pos,
Value* value,
const AbstractType& dst_type,
const String& dst_name,
bool eliminated);
static void PrintBlock(BlockEntryInstr* block, bool print_locations);
static void PrintGraph(const char* phase, FlowGraph* flow_graph);
// Debugging helper function. If 'num_checks_to_print' is not specified
// all checks will be printed.
static void PrintICData(const ICData& ic_data,
intptr_t num_checks_to_print = kPrintAll);
// Debugging helper function. If 'num_checks_to_print' is not specified
// all checks will be printed.
static void PrintCidRangeData(const CallTargets& ic_data,
intptr_t num_checks_to_print = kPrintAll);
static bool ShouldPrint(const Function& function);
static bool PassesFilter(const char* filter, const Function& function);
private:
const Function& function_;
const GrowableArray<BlockEntryInstr*>& block_order_;
const bool print_locations_;
};
} // namespace dart
#endif // RUNTIME_VM_COMPILER_BACKEND_IL_PRINTER_H_