2 +----------------------------------------------------------------------+
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2010-present 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 +----------------------------------------------------------------------+
19 #include "hphp/runtime/vm/jit/code-cache.h"
20 #include "hphp/runtime/vm/jit/state-vector.h"
21 #include "hphp/runtime/vm/jit/types.h"
22 #include "hphp/runtime/vm/jit/vasm-emit.h"
23 #include "hphp/runtime/vm/jit/vasm-reg.h"
24 #include "hphp/runtime/vm/jit/vasm-unit.h"
25 #include "hphp/runtime/vm/jit/vasm.h"
32 ///////////////////////////////////////////////////////////////////////////////
36 ///////////////////////////////////////////////////////////////////////////////
38 enum class SyncOptions
{
44 * State updated and tracked across vasm generation for individual instructions
48 explicit IRLS(const IRUnit
& unit
)
50 , labels(unit
, Vlabel())
55 * The unit being lowered to vasm.
60 * The vasm output streams.
62 * These may be updated during codegen of an instruction to point to new
69 * Vasm block labels, one for each HHIR block.
71 StateVector
<Block
,Vlabel
> labels
;
74 * Vlocs for each SSATmp used or defined in a reachable block.
76 StateVector
<SSATmp
,Vloc
> locs
;
80 * Estimate the cost of unit.
82 Vcost
computeIRUnitCost(const IRUnit
& unit
);
87 void optimize(Vunit
& unit
, CodeKind kind
, bool regAlloc
= true);
90 * Lower the given HHIR unit to a Vunit, then optimize, regalloc, and return
91 * the Vunit. Returns nullptr on failure.
93 std::unique_ptr
<Vunit
> lowerUnit(const IRUnit
&,
94 CodeKind kind
= CodeKind::Trace
,
95 bool regAlloc
= true) noexcept
;
97 ///////////////////////////////////////////////////////////////////////////////