Add sub-controls for Hack array compat runtime checks
[hiphop-php.git] / hphp / runtime / vm / jit / tc-relocate.h
blobb4b1b7d92bb53df1281c6bcfd89b2cdf4168aa49
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 +----------------------------------------------------------------------+
16 #ifndef incl_HPHP_TC_RELOCATE_H_
17 #define incl_HPHP_TC_RELOCATE_H_
19 #include <set>
20 #include <cstdio>
21 #include <vector>
23 #include "hphp/runtime/vm/jit/code-cache.h"
24 #include "hphp/runtime/vm/jit/srcdb.h"
25 #include "hphp/runtime/vm/srckey.h"
27 namespace HPHP {
29 struct CodeCache;
31 namespace jit {
33 struct AsmInfo;
34 struct IRUnit;
36 //////////////////////////////////////////////////////////////////////
38 namespace tc {
40 std::string perfRelocMapInfo(
41 TCA start, TCA end,
42 TCA coldStart, TCA coldEnd,
43 SrcKey sk, int argNum,
44 const GrowableVector<IncomingBranch> &incomingBranches,
45 CGMeta& fixups);
47 bool relocateNewTranslation(TransLoc& loc, CodeCache::View cache,
48 CGMeta& fixups,
49 TCA* adjust = nullptr);
52 * Relocate a new translation into a free region in the TC and update the
53 * TransLoc.
55 * Attempt to relocate the main, cold, and frozen portions of the translation
56 * loc into memory freed memory in the TC their respective code blocks. In
57 * addition, reusable stubs associated with this translation will be relocated
58 * to be outside of loc so that they can be managed separately.
60 void tryRelocateNewTranslation(SrcKey sk, TransLoc& loc,
61 CodeCache::View code, CGMeta& fixups);
63 //////////////////////////////////////////////////////////////////////
65 }}}
67 #endif