Rename RefcountProfile to IncRefProfile
[hiphop-php.git] / hphp / runtime / vm / jit / reg-algorithms.h
blob332372541f3a12ad0fbfe5b703a099f9b1ec4447
1 /*
2 +----------------------------------------------------------------------+
3 | HipHop for PHP |
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 +----------------------------------------------------------------------+
17 #ifndef incl_HPHP_VM_REGALGORITHMS_H_
18 #define incl_HPHP_VM_REGALGORITHMS_H_
20 #include <vector>
22 #include "hphp/runtime/vm/jit/containers.h"
23 #include "hphp/runtime/vm/jit/phys-reg.h"
24 #include "hphp/runtime/vm/jit/vasm-reg.h"
26 namespace HPHP { namespace jit {
27 ///////////////////////////////////////////////////////////////////////////////
29 struct Vunit;
31 ///////////////////////////////////////////////////////////////////////////////
34 * Compute a sequence of moves and swaps that will fill the dest registers in
35 * the moves map with their correct source values, even if some sources are
36 * also destinations. The moves map provides one source for each dest. rTmp
37 * will be used when necessary to break copy-cycles, so it is illegal to
38 * specify a source for rTmp (rTmp cannot be a destination). However, it is
39 * legal for rTmp to be a source for some other destination. Since rTmp cannot
40 * be a destination, it cannot be in a copy-cycle, so its value will be read
41 * before we deal with cycles.
44 struct VMoveInfo {
45 enum class Kind { Move, Xchg };
46 Kind m_kind;
47 Vreg m_src, m_dst;
50 struct MoveInfo {
51 enum class Kind { Move, Xchg };
52 Kind m_kind;
53 PhysReg m_src, m_dst;
56 using MovePlan = PhysReg::Map<PhysReg>;
57 jit::vector<VMoveInfo> doVregMoves(Vunit&, MovePlan& moves);
58 jit::vector<MoveInfo> doRegMoves(MovePlan& moves, PhysReg rTmp);
60 ///////////////////////////////////////////////////////////////////////////////
63 #endif