codemod 2010-2016 to 2010-present
[hiphop-php.git] / hphp / runtime / vm / jit / tc-record.h
blob483c9592781d35e9a81cb407000792f4680c9070
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_JIT_TC_RECORD_H_
18 #define incl_HPHP_JIT_TC_RECORD_H_
20 #include "hphp/runtime/vm/jit/srcdb.h"
21 #include "hphp/runtime/vm/jit/tc.h"
22 #include "hphp/runtime/vm/jit/types.h"
23 #include "hphp/util/data-block.h"
24 #include "hphp/util/growable-vector.h"
26 namespace HPHP {
28 struct Func;
29 struct SrcKey;
31 namespace jit {
33 struct CGMeta;
34 struct CodeCache;
35 struct TransEnv;
37 namespace tc {
40 * If live code relocation is enabled, record metadata for the current
41 * translation.
43 void recordRelocationMetaData(SrcKey sk, SrcRec& srcRec, const TransLoc& loc,
44 CGMeta& fixups);
47 * Record translation for gdb debugging of the tc.
49 void recordGdbTranslation(SrcKey sk, const Func* srcFunc, const CodeBlock& cb,
50 const TCA start, const TCA end, bool exit,
51 bool inPrologue);
54 * Record BC instruction ranges in the tc for the perf map.
56 void recordBCInstr(uint32_t op, const TCA addr, const TCA end, bool cold);
59 * Report jit warmup statistics to scribe via StructuredLog.
61 void reportJitMaturity(const CodeCache& code);
64 * Log statistics about a translation to scribe via StructuredLog.
66 void logTranslation(const TransEnv& env, const TransRange& range);
69 * Record smashed calls in the TC that may need to be re-smashed in the event
70 * that a prologue is reused-- additionally any information in ProfData will
71 * need to be erased before a translation with a call to a Proflogue is
72 * reclaimed.
74 void recordFuncCaller(const Func* func, TCA toSmash, bool immutable,
75 bool profiled, int numArgs);
78 * When a function is treadmilled its bytecode may no longer be available,
79 * keep a table of associated SrcRecs to be reclaimed as it will be impossible
80 * to walk the bytecode stream to search the SrcDB.
82 void recordFuncSrcRec(const Func* func, SrcRec* rec);
85 * Record a prologue associated with a function so that it may be reclaimed
86 * when the function is treadmilled.
88 void recordFuncPrologue(const Func* func, TransLoc loc);
90 }}}
92 #endif