stronger type system for rds::Link
[hiphop-php.git] / hphp / runtime / vm / jit / mcgen.cpp
blobd7f2249413f86ea75e0c8341034bea6cd9e15542
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 #include "hphp/runtime/vm/jit/mcgen.h"
19 #include "hphp/runtime/vm/jit/mcgen-prologue.h"
20 #include "hphp/runtime/vm/jit/mcgen-translate.h"
22 #include "hphp/runtime/vm/jit/debugger.h"
23 #include "hphp/runtime/vm/jit/func-prologue.h"
24 #include "hphp/runtime/vm/jit/prof-data.h"
25 #include "hphp/runtime/vm/jit/tc.h"
26 #include "hphp/runtime/vm/jit/trans-db.h"
27 #include "hphp/runtime/vm/jit/unique-stubs.h"
28 #include "hphp/runtime/vm/jit/unwind-itanium.h"
29 #include "hphp/runtime/vm/jit/vtune-jit.h"
30 #include "hphp/runtime/vm/jit/write-lease.h"
32 #include "hphp/runtime/vm/debug/debug.h"
34 #include "hphp/util/timer.h"
35 #include "hphp/util/trace.h"
37 TRACE_SET_MOD(mcg);
39 namespace HPHP { namespace jit {
41 TransEnv::~TransEnv() {}
43 namespace mcgen {
45 namespace {
47 int64_t s_startTime;
48 bool s_inited{false};
50 ////////////////////////////////////////////////////////////////////////////////
53 void processInit() {
54 TRACE(1, "mcgen startup\n");
56 g_unwind_rds.bind(rds::Mode::Normal);
58 Debug::initDebugInfo();
59 tc::processInit();
61 if (Trace::moduleEnabledRelease(Trace::printir) &&
62 !RuntimeOption::EvalJit) {
63 Trace::traceRelease("TRACE=printir is set but the jit isn't on. "
64 "Did you mean to run with -vEval.Jit=1?\n");
67 s_startTime = HPHP::Timer::GetCurrentTimeMicros();
68 initInstrInfo();
70 s_inited = true;
73 bool initialized() { return s_inited; }
75 int64_t jitInitTime() { return s_startTime; }
77 bool dumpTCAnnotation(const Func& func, TransKind transKind) {
78 return RuntimeOption::EvalDumpTCAnnotationsForAllTrans ||
79 (transKind == TransKind::Optimize && func.isHot());
82 }}}