track total size of static array and Unit/Class/Func
[hiphop-php.git] / hphp / runtime / base / request-injection-data-inl.h
blobd7a2e544b4ee8e4500c504b05fda258b01c2a43c
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_REQUEST_INJECTION_DATA_INL_H_
18 #error "Can only be included by request-injection-data.h"
19 #endif
21 namespace HPHP {
22 ////////////////////////////////////////////////////////////////////////////////
24 inline int RequestInjectionData::getTimeout() const {
25 return m_timer.m_timeoutSeconds;
28 inline int RequestInjectionData::getCPUTimeout() const {
29 return m_cpuTimer.m_timeoutSeconds;
33 * Returns the amount of seconds until user callback is invoked
35 inline int RequestInjectionData::getUserTimeout() const {
36 return m_userTimeoutTimer.m_timeoutSeconds;
39 inline bool RequestInjectionData::getJit() const {
40 return m_jit;
43 inline bool RequestInjectionData::isJittingDisabled() const {
44 return m_jittingDisabled;
47 inline void RequestInjectionData::setJittingDisabled(bool flag) {
48 m_jittingDisabled = flag;
51 inline bool RequestInjectionData::getJitFolding() const {
52 return m_jitFolding;
55 inline void RequestInjectionData::setJitFolding(bool flag) {
56 m_jitFolding = flag;
59 #define HC(Opt, ...) \
60 inline bool RequestInjectionData::getSuppressHAC##Opt##Notices() const { \
61 return m_suppressHAC##Opt; \
62 } \
63 inline void RequestInjectionData::setSuppressHAC##Opt##Notices(bool flag) { \
64 m_suppressHAC##Opt = flag; \
66 HAC_CHECK_OPTS
67 #undef HC
69 inline bool RequestInjectionData::getCoverage() const {
70 return m_coverage;
73 inline void RequestInjectionData::setCoverage(bool flag) {
74 m_coverage = flag;
75 updateJit();
78 inline bool RequestInjectionData::getDebuggerAttached() {
79 return m_debuggerAttached;
82 inline void RequestInjectionData::setDebuggerAttached(bool flag) {
83 m_debuggerAttached = flag;
84 updateJit();
87 inline size_t RequestInjectionData::getDebuggerStackDepth() const {
88 return m_activeLineBreaks.size();
91 inline bool RequestInjectionData::getDebuggerForceIntr() const {
92 return
93 m_debuggerIntr ||
94 // Force interrupts when over an active line.
95 getActiveLineBreak() != -1 ||
96 // Interrupts forced while stepping in.
97 m_debuggerStepIn ||
98 // Step out forces interrupts after we have exited the function.
99 m_debuggerStepOut == StepOutState::Out;
102 inline bool RequestInjectionData::getDebuggerIntr() const {
103 return m_debuggerIntr;
106 inline void RequestInjectionData::setDebuggerIntr(bool flag) {
107 m_debuggerIntr = flag;
108 updateJit();
111 inline bool RequestInjectionData::getDebuggerStepIn() const {
112 return m_debuggerStepIn;
115 inline void RequestInjectionData::setDebuggerStepIn(bool flag) {
116 m_debuggerStepIn = flag;
117 updateJit();
120 inline RequestInjectionData::StepOutState
121 RequestInjectionData::getDebuggerStepOut() const {
122 return m_debuggerStepOut;
125 inline void RequestInjectionData::setDebuggerStepOut(StepOutState state) {
126 m_debuggerStepOut = state;
127 updateJit();
130 inline bool RequestInjectionData::getDebuggerNext() const {
131 return m_debuggerNext;
134 inline void RequestInjectionData::setDebuggerNext(bool flag) {
135 m_debuggerNext = flag;
136 updateJit();
139 inline int RequestInjectionData::getDebuggerFlowDepth() const {
140 return m_debuggerFlowDepth;
143 inline void RequestInjectionData::setDebuggerFlowDepth(int depth) {
144 m_debuggerFlowDepth = depth;
147 inline int RequestInjectionData::getActiveLineBreak() const {
148 return m_activeLineBreaks.empty() ? -1 : m_activeLineBreaks.top();
151 inline void RequestInjectionData::clearActiveLineBreak() {
152 if (m_activeLineBreaks.empty()) return;
153 m_activeLineBreaks.top() = -1;
154 updateJit();
157 inline void RequestInjectionData::setActiveLineBreak(int line) {
158 assertx(line != -1);
159 if (m_activeLineBreaks.empty()) return;
160 m_activeLineBreaks.top() = line;
161 updateJit();
164 inline void RequestInjectionData::popActiveLineBreak() {
165 if (m_activeLineBreaks.empty()) return;
166 m_activeLineBreaks.pop();
167 updateJit();
170 inline void RequestInjectionData::pushActiveLineBreak() {
171 m_activeLineBreaks.push(-1);
172 updateJit();
175 inline const std::vector<std::string>&
176 RequestInjectionData::getIncludePaths() const {
177 return m_include_paths;
180 inline const std::string& RequestInjectionData::getDefaultMimeType() const {
181 return m_defaultMimeType;
184 inline int64_t RequestInjectionData::getErrorReportingLevel() {
185 return m_errorReportingLevel;
188 inline void RequestInjectionData::setErrorReportingLevel(int64_t level) {
189 m_errorReportingLevel = level;
192 inline int64_t RequestInjectionData::getMemoryLimitNumeric() const {
193 return m_maxMemoryNumeric;
196 inline const std::string& RequestInjectionData::getVariablesOrder() const {
197 return m_variablesOrder;
200 inline void RequestInjectionData::setVariablesOrder(const std::string& order) {
201 m_variablesOrder = order;
204 inline const std::string& RequestInjectionData::getRequestOrder() const {
205 return m_requestOrder;
208 inline void RequestInjectionData::setRequestOrder(const std::string& order) {
209 m_requestOrder = order;
212 inline int64_t RequestInjectionData::getSocketDefaultTimeout() const {
213 return m_socketDefaultTimeout;
216 inline const std::string& RequestInjectionData::getUserAgent() const {
217 return m_userAgent;
220 inline void RequestInjectionData::setUserAgent(const std::string& agent) {
221 m_userAgent = agent;
224 inline const std::string& RequestInjectionData::getTimeZone() const {
225 return m_timezone;
228 inline void RequestInjectionData::setTimeZone(const std::string& tz) {
229 m_timezone = tz;
232 inline void RequestInjectionData::setSafeFileAccess(bool b) {
233 m_safeFileAccess = b;
236 inline bool RequestInjectionData::hasSafeFileAccess() const {
237 return m_safeFileAccess;
240 inline bool RequestInjectionData::hasHtmlErrors() const {
241 return m_htmlErrors;
244 inline bool RequestInjectionData::logFunctionCalls() const {
245 return m_logFunctionCalls;
247 ////////////////////////////////////////////////////////////////////////////////