Use RATs from HHBBC in init_use_vars
[hiphop-php.git] / hphp / runtime / vm / repo-global-data.h
bloba9065350a4620e0427dab08f650517f813a4b76d
1 /*
2 +----------------------------------------------------------------------+
3 | HipHop for PHP |
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2010-2013 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_REPO_GLOBAL_DATA_H_
17 #define incl_HPHP_REPO_GLOBAL_DATA_H_
19 #include "hphp/runtime/vm/repo.h"
20 #include "hphp/runtime/base/repo-auth-type-array.h"
22 namespace HPHP {
24 //////////////////////////////////////////////////////////////////////
27 * Global repo metadata.
29 * Only used in RepoAuthoritative mode. See loadGlobalData().
31 struct Repo::GlobalData {
33 * Indicates whether a repo was compiled using HHBBC.
35 bool UsedHHBBC = false;
38 * Indicates whether a repo was compiled with HardTypeHints.
40 * If so, we disallow recovering from the E_RECOVERABLE_ERROR we
41 * raise if you violate a parameter typehint, because doing so
42 * would allow violating assumptions from the optimizer.
44 bool HardTypeHints = false;
47 * Indicates whether a repo was compiled with HardPrivatePropInference.
49 bool HardPrivatePropInference = false;
52 * A table of array type information for various array types found
53 * in the repo. This is only used in authoritative repos.
55 ArrayTypeTable arrayTypeTable;
58 * Indicates whether the repo was compiled with DisallowDynamicVarEnvFuncs. If
59 * so, we assume that '$f()' doesn't read or write over locals (that
60 * haven't been passed).
62 bool DisallowDynamicVarEnvFuncs = false;
65 * Indicates whether a repo was compiled with HardReturnTypeHints.
67 * If so, we disallow recovering from the E_RECOVERABLE_ERROR we
68 * raise if you violate a return typehint, because doing so would
69 * allow violating assumptions from the optimizer.
71 bool HardReturnTypeHints = false;
74 * Indicates whether the repo was compiled with PHP7 integer semantics. This
75 * slightly changes the way certain arithmetic operations are evaluated, in
76 * small enough ways that don't warrant new bytecodes, but in ways that do
77 * affect everything from hphpc's constant folding up through the JIT, and
78 * so need to be kept consistent.
80 bool PHP7_IntSemantics = false;
83 * Indicates that generators should be autoprimed and not require an initial
84 * call to next() before calling other generator functions.
86 bool AutoprimeGenerators = true;
88 template<class SerDe> void serde(SerDe& sd) {
89 sd(UsedHHBBC)
90 (HardTypeHints)
91 (HardPrivatePropInference)
92 (arrayTypeTable)
93 (DisallowDynamicVarEnvFuncs)
94 (HardReturnTypeHints)
95 (PHP7_IntSemantics)
96 (AutoprimeGenerators)
101 //////////////////////////////////////////////////////////////////////
106 #endif