2 +----------------------------------------------------------------------+
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2010-2014 Facebook, Inc. (http://www.facebook.com) |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 3.01 of the PHP license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.php.net/license/3_01.txt |
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
17 #ifndef incl_HPHP_JIT_VASM_PRINT_H_
18 #define incl_HPHP_JIT_VASM_PRINT_H_
20 #include "hphp/runtime/vm/jit/vasm.h"
21 #include "hphp/runtime/vm/jit/vasm-reg.h"
27 namespace HPHP
{ namespace jit
{
28 ///////////////////////////////////////////////////////////////////////////////
33 ///////////////////////////////////////////////////////////////////////////////
35 std::string
show(Vreg r
);
36 std::string
show(Vptr p
);
37 std::string
show(const Vunit
& unit
);
38 std::string
show(const Vunit
& unit
, const Vinstr
& inst
);
40 // print a dot-compatible digraph of the blocks (without contents)
41 void printCfg(const Vunit
& unit
, const jit::vector
<Vlabel
>& blocks
);
42 void printCfg(std::ostream
& out
, const Vunit
& unit
,
43 const jit::vector
<Vlabel
>& blocks
);
45 // Tracing level constants.
46 constexpr int kInitialVasmLevel
= 1;
47 constexpr int kVasmImmsLevel
= 2;
48 constexpr int kVasmFusionLevel
= 2;
49 constexpr int kVasmCodeGenLevel
= 2;
50 constexpr int kVasmRegAllocLevel
= 3;
51 constexpr int kVasmCopyPropLevel
= 4;
52 constexpr int kVasmARMFoldLevel
= 4;
53 constexpr int kVasmJumpsLevel
= 4;
54 constexpr int kVasmExitsLevel
= 4;
55 constexpr int kVasmDCELevel
= 4;
56 constexpr int kVasmLowerLevel
= 4;
57 constexpr int kVasmUnreachableLevel
= 6;
59 // Print the cfg digraph followed by a vasm code listing, if the trace level is
61 void printUnit(int level
,
62 const std::string
& caption
,
65 void printInstrs(std::ostream
& out
,
67 const jit::vector
<Vinstr
>& code
);
70 extern const char* area_names
[];
72 ///////////////////////////////////////////////////////////////////////////////