kill VM namespace
Now that HHVM is the default runtime, this namespace doesn't mean anything.
Esse commit está contido em:
@@ -7504,7 +7504,7 @@ Unit* hphp_compiler_parse(const char* code, int codeLen, const MD5& md5,
|
||||
if (const char* dot = strrchr(filename, '.')) {
|
||||
const char hhbc_ext[] = "hhas";
|
||||
if (!strcmp(dot + 1, hhbc_ext)) {
|
||||
return VM::assemble_file(filename, md5);
|
||||
return assemble_file(filename, md5);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,13 +47,6 @@ class HhbcExtClassInfo;
|
||||
namespace Compiler {
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
using VM::Func;
|
||||
using VM::Class;
|
||||
using VM::Unit;
|
||||
using VM::InvalidAbsoluteOffset;
|
||||
|
||||
using namespace VM;
|
||||
|
||||
// Forward declarations.
|
||||
class Label;
|
||||
class EmitterVisitor;
|
||||
|
||||
@@ -19,8 +19,6 @@
|
||||
|
||||
namespace HPHP { namespace Compiler {
|
||||
|
||||
using VM::FuncEmitter;
|
||||
using VM::UnitEmitter;
|
||||
|
||||
static void collapseJmp(Offset* offsetPtr, Opcode* instr, Opcode* start) {
|
||||
if (offsetPtr) {
|
||||
|
||||
@@ -43,13 +43,13 @@ class MetaInfoBuilder;
|
||||
|
||||
class Peephole {
|
||||
public:
|
||||
Peephole(VM::UnitEmitter& ue, MetaInfoBuilder& metaInfo);
|
||||
Peephole(UnitEmitter& ue, MetaInfoBuilder& metaInfo);
|
||||
|
||||
private:
|
||||
void buildFuncTargets(VM::FuncEmitter* fe);
|
||||
void buildFuncTargets(FuncEmitter* fe);
|
||||
void buildJumpTargets();
|
||||
|
||||
VM::UnitEmitter& m_ue;
|
||||
UnitEmitter& m_ue;
|
||||
hphp_hash_set<Offset> m_jumpTargets;
|
||||
};
|
||||
|
||||
|
||||
@@ -157,7 +157,7 @@ int compiler_main(int argc, char **argv) {
|
||||
try {
|
||||
Hdf empty;
|
||||
RuntimeOption::Load(empty);
|
||||
VM::initialize_repo();
|
||||
initialize_repo();
|
||||
|
||||
CompilerOptions po;
|
||||
#ifdef FACEBOOK
|
||||
|
||||
@@ -41,7 +41,7 @@ void free_global_variables_after_sweep() {
|
||||
|
||||
SystemGlobals* get_system_globals() { return get_global_variables(); }
|
||||
|
||||
VM::GlobalNameValueTableWrapper::GlobalNameValueTableWrapper(
|
||||
GlobalNameValueTableWrapper::GlobalNameValueTableWrapper(
|
||||
NameValueTable* tab) : NameValueTableWrapper(tab) {
|
||||
|
||||
VarNR arr(HphpArray::GetStaticEmptyArray());
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
#include <string>
|
||||
|
||||
namespace HPHP {
|
||||
namespace VM {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -98,7 +97,7 @@ void ProcessInit() {
|
||||
ClassInfo::SetHook(&vm_class_info_hook);
|
||||
|
||||
// ensure that nextTx64 and tx64 are set
|
||||
(void)VM::Transl::Translator::Get();
|
||||
(void)Transl::Translator::Get();
|
||||
|
||||
// Save the current options, and set things up so that
|
||||
// systemlib.php can be read from and stored in the
|
||||
@@ -194,4 +193,3 @@ void ProcessInit() {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,16 +26,14 @@ namespace HPHP {
|
||||
extern void (*g_vmProcessInit)();
|
||||
void hphp_process_init();
|
||||
|
||||
namespace VM {
|
||||
void ProcessInit();
|
||||
void initialize_repo();
|
||||
}
|
||||
void ProcessInit();
|
||||
void initialize_repo();
|
||||
|
||||
/*
|
||||
* This must be called before execute_program_impl in an hhvm build.
|
||||
*/
|
||||
inline void register_process_init() {
|
||||
g_vmProcessInit = &VM::ProcessInit;
|
||||
g_vmProcessInit = &ProcessInit;
|
||||
g_hphp_compiler_parse = &HPHP::Compiler::hphp_compiler_parse;
|
||||
g_hphp_build_native_func_unit = &HPHP::Compiler::
|
||||
hphp_build_native_func_unit;
|
||||
@@ -50,7 +48,7 @@ inline void register_process_init() {
|
||||
*/
|
||||
inline void init_for_unit_test() {
|
||||
register_process_init();
|
||||
VM::initialize_repo();
|
||||
initialize_repo();
|
||||
init_thread_locals();
|
||||
Hdf config;
|
||||
RuntimeOption::Load(config);
|
||||
|
||||
@@ -129,7 +129,7 @@ void ArrayData::release() {
|
||||
// reads
|
||||
|
||||
Object ArrayData::toObject() const {
|
||||
return VM::Instance::FromArray(const_cast<ArrayData *>(this));
|
||||
return Instance::FromArray(const_cast<ArrayData *>(this));
|
||||
}
|
||||
|
||||
bool ArrayData::isVectorData() const {
|
||||
|
||||
@@ -587,7 +587,7 @@ bool Iter::init(TypedValue* c1) {
|
||||
if (isIterator) {
|
||||
(void) new (&arr()) ArrayIter(obj, ArrayIter::transferOwner);
|
||||
} else {
|
||||
VM::Class* ctx = arGetContextClass(g_vmContext->getFP());
|
||||
Class* ctx = arGetContextClass(g_vmContext->getFP());
|
||||
CStrRef ctxStr = ctx ? ctx->nameRef() : null_string;
|
||||
Array iterArray(obj->o_toIterArray(ctxStr));
|
||||
ArrayData* ad = iterArray.getArrayData();
|
||||
@@ -637,7 +637,7 @@ bool Iter::minit(TypedValue* v1) {
|
||||
if (isIterator) {
|
||||
raise_error("An iterator cannot be used with foreach by reference");
|
||||
}
|
||||
VM::Class* ctx = arGetContextClass(g_vmContext->getFP());
|
||||
Class* ctx = arGetContextClass(g_vmContext->getFP());
|
||||
CStrRef ctxStr = ctx ? ctx->nameRef() : null_string;
|
||||
Array iterArray = obj->o_toIterArray(ctxStr, true);
|
||||
if (iterArray->empty()) {
|
||||
@@ -881,7 +881,7 @@ class FreeObj {
|
||||
* If exceptions are thrown, new_iter_object takes care of decRefing the object.
|
||||
*/
|
||||
HOT_FUNC
|
||||
int64_t new_iter_object(Iter* dest, ObjectData* obj, VM::Class* ctx,
|
||||
int64_t new_iter_object(Iter* dest, ObjectData* obj, Class* ctx,
|
||||
TypedValue* valOut, TypedValue* keyOut) {
|
||||
valOut = tvToCell(valOut);
|
||||
if (keyOut) {
|
||||
|
||||
@@ -471,7 +471,7 @@ bool interp_iter_next_m(Iter* it);
|
||||
int64_t new_iter_array(Iter* dest, ArrayData* arr, TypedValue* val);
|
||||
int64_t new_iter_array_key(Iter* dest, ArrayData* arr, TypedValue* val,
|
||||
TypedValue* key);
|
||||
int64_t new_iter_object(Iter* dest, ObjectData* obj, VM::Class* ctx,
|
||||
int64_t new_iter_object(Iter* dest, ObjectData* obj, Class* ctx,
|
||||
TypedValue* val, TypedValue* key);
|
||||
int64_t iter_next(Iter* dest, TypedValue* val);
|
||||
int64_t iter_next_key(Iter* dest, TypedValue* val, TypedValue* key);
|
||||
|
||||
@@ -1679,7 +1679,6 @@ CVarRef HphpArray::endRef() {
|
||||
|
||||
//=============================================================================
|
||||
// VM runtime support functions.
|
||||
namespace VM {
|
||||
|
||||
// Helpers for array_setm.
|
||||
ArrayData* nvCheckedSet(ArrayData* a, StringData* key, TypedValue* value,
|
||||
@@ -1893,8 +1892,6 @@ ArrayData* array_add(ArrayData* a1, ArrayData* a2) {
|
||||
return a1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -505,7 +505,6 @@ public:
|
||||
|
||||
//=============================================================================
|
||||
// VM runtime support functions.
|
||||
namespace VM {
|
||||
|
||||
enum ArrayGetFlags {
|
||||
DecRefKey = 1,
|
||||
@@ -545,7 +544,6 @@ uint64_t array_issetm_i(const void* hphpArray, int64_t key)
|
||||
FLATTEN;
|
||||
ArrayData* array_add(ArrayData* a1, ArrayData* a2);
|
||||
|
||||
}
|
||||
//=============================================================================
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -220,7 +220,7 @@ void HphpArray::asort(int sort_flags, bool ascending) {
|
||||
m_pos = ssize_t(0); \
|
||||
try { \
|
||||
ElmUCompare<acc_type> comp; \
|
||||
VM::Transl::CallerFrame cf; \
|
||||
Transl::CallerFrame cf; \
|
||||
CallCtx ctx; \
|
||||
vm_decode_function(cmp_function, cf(), false, ctx); \
|
||||
comp.ctx = &ctx; \
|
||||
|
||||
@@ -81,17 +81,17 @@ bool array_is_valid_callback(CArrRef arr) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const HPHP::VM::Func*
|
||||
const HPHP::Func*
|
||||
vm_decode_function(CVarRef function,
|
||||
ActRec* ar,
|
||||
bool forwarding,
|
||||
ObjectData*& this_,
|
||||
HPHP::VM::Class*& cls,
|
||||
HPHP::Class*& cls,
|
||||
StringData*& invName,
|
||||
bool warn /* = true */) {
|
||||
invName = nullptr;
|
||||
if (function.isString() || function.isArray()) {
|
||||
HPHP::VM::Class* ctx = nullptr;
|
||||
HPHP::Class* ctx = nullptr;
|
||||
if (ar) ctx = arGetContextClass(ar);
|
||||
// Decode the 'function' parameter into this_, cls, name, pos, and
|
||||
// nameContainsClass.
|
||||
@@ -160,7 +160,7 @@ vm_decode_function(CVarRef function,
|
||||
"is undefined", sclass->data(), name->data());
|
||||
}
|
||||
}
|
||||
cls = VM::Unit::loadClass(sclass.get());
|
||||
cls = Unit::loadClass(sclass.get());
|
||||
}
|
||||
if (!cls) {
|
||||
if (warn) {
|
||||
@@ -175,7 +175,7 @@ vm_decode_function(CVarRef function,
|
||||
}
|
||||
}
|
||||
|
||||
HPHP::VM::Class* cc = cls;
|
||||
HPHP::Class* cc = cls;
|
||||
if (nameContainsClass) {
|
||||
String c = name.substr(0, pos);
|
||||
name = name.substr(pos + 2);
|
||||
@@ -206,7 +206,7 @@ vm_decode_function(CVarRef function,
|
||||
}
|
||||
}
|
||||
} else {
|
||||
cc = VM::Unit::loadClass(c.get());
|
||||
cc = Unit::loadClass(c.get());
|
||||
}
|
||||
if (!cc) {
|
||||
if (warn) {
|
||||
@@ -231,7 +231,7 @@ vm_decode_function(CVarRef function,
|
||||
}
|
||||
}
|
||||
if (!cls) {
|
||||
HPHP::VM::Func* f = HPHP::VM::Unit::loadFunc(name.get());
|
||||
HPHP::Func* f = HPHP::Unit::loadFunc(name.get());
|
||||
if (!f) {
|
||||
if (warn) {
|
||||
throw_invalid_argument("function: method '%s' not found",
|
||||
@@ -244,7 +244,7 @@ vm_decode_function(CVarRef function,
|
||||
}
|
||||
assert(cls);
|
||||
CallType lookupType = this_ ? ObjMethod : ClsMethod;
|
||||
const HPHP::VM::Func* f =
|
||||
const HPHP::Func* f =
|
||||
g_vmContext->lookupMethodCtx(cc, name.get(), ctx, lookupType);
|
||||
if (f && (f->attrs() & AttrStatic)) {
|
||||
// If we found a method and its static, null out this_
|
||||
@@ -293,7 +293,7 @@ vm_decode_function(CVarRef function,
|
||||
// If we are doing a forwarding call and this_ is null, set cls
|
||||
// appropriately to propagate the current late bound class.
|
||||
if (!this_ && forwarding && ar) {
|
||||
HPHP::VM::Class* fwdCls = nullptr;
|
||||
HPHP::Class* fwdCls = nullptr;
|
||||
ObjectData* obj = ar->hasThis() ? ar->getThis() : nullptr;
|
||||
if (obj) {
|
||||
fwdCls = obj->getVMClass();
|
||||
@@ -312,7 +312,7 @@ vm_decode_function(CVarRef function,
|
||||
static StringData* invokeStr = StringData::GetStaticString("__invoke");
|
||||
this_ = function.asCObjRef().get();
|
||||
cls = nullptr;
|
||||
const HPHP::VM::Func *f = this_->getVMClass()->lookupMethod(invokeStr);
|
||||
const HPHP::Func *f = this_->getVMClass()->lookupMethod(invokeStr);
|
||||
if (f != nullptr &&
|
||||
((f->attrs() & AttrStatic) && !f->isClosureBody())) {
|
||||
// If __invoke is static, invoke it as such
|
||||
@@ -330,10 +330,10 @@ vm_decode_function(CVarRef function,
|
||||
Variant vm_call_user_func(CVarRef function, CArrRef params,
|
||||
bool forwarding /* = false */) {
|
||||
ObjectData* obj = nullptr;
|
||||
HPHP::VM::Class* cls = nullptr;
|
||||
HPHP::VM::Transl::CallerFrame cf;
|
||||
HPHP::Class* cls = nullptr;
|
||||
HPHP::Transl::CallerFrame cf;
|
||||
StringData* invName = nullptr;
|
||||
const HPHP::VM::Func* f = vm_decode_function(function, cf(), forwarding,
|
||||
const HPHP::Func* f = vm_decode_function(function, cf(), forwarding,
|
||||
obj, cls, invName);
|
||||
if (f == nullptr) {
|
||||
return uninit_null();
|
||||
@@ -346,7 +346,7 @@ Variant vm_call_user_func(CVarRef function, CArrRef params,
|
||||
|
||||
Variant invoke(CStrRef function, CArrRef params, strhash_t hash /* = -1 */,
|
||||
bool tryInterp /* = true */, bool fatal /* = true */) {
|
||||
VM::Func* func = VM::Unit::loadFunc(function.get());
|
||||
Func* func = Unit::loadFunc(function.get());
|
||||
if (func) {
|
||||
Variant ret;
|
||||
g_vmContext->invokeFunc(ret.asTypedValue(), func, params);
|
||||
@@ -363,12 +363,12 @@ Variant invoke(const char *function, CArrRef params, strhash_t hash /* = -1*/,
|
||||
|
||||
Variant invoke_static_method(CStrRef s, CStrRef method, CArrRef params,
|
||||
bool fatal /* = true */) {
|
||||
HPHP::VM::Class* class_ = VM::Unit::lookupClass(s.get());
|
||||
HPHP::Class* class_ = Unit::lookupClass(s.get());
|
||||
if (class_ == nullptr) {
|
||||
o_invoke_failed(s.data(), method.data(), fatal);
|
||||
return uninit_null();
|
||||
}
|
||||
const HPHP::VM::Func* f = class_->lookupMethod(method.get());
|
||||
const HPHP::Func* f = class_->lookupMethod(method.get());
|
||||
if (f == nullptr || !(f->attrs() & AttrStatic)) {
|
||||
o_invoke_failed(s.data(), method.data(), fatal);
|
||||
return uninit_null();
|
||||
@@ -1046,7 +1046,7 @@ bool invoke_file_impl(Variant &res, CStrRef path, bool once,
|
||||
bool initial;
|
||||
HPHP::Eval::PhpFile* efile =
|
||||
g_vmContext->lookupPhpFile(path.get(), currentDir, &initial);
|
||||
HPHP::VM::Unit* u = nullptr;
|
||||
HPHP::Unit* u = nullptr;
|
||||
if (efile) u = efile->unit();
|
||||
if (u == nullptr) {
|
||||
return false;
|
||||
@@ -1225,14 +1225,14 @@ class ClassExistsChecker {
|
||||
public:
|
||||
ClassExistsChecker() {}
|
||||
bool operator()(CStrRef name) const {
|
||||
return VM::Unit::lookupClass(name.get()) != nullptr;
|
||||
return Unit::lookupClass(name.get()) != nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
class ConstantExistsChecker {
|
||||
public:
|
||||
bool operator()(CStrRef name) const {
|
||||
return VM::Unit::lookupCns(name.get()) != nullptr;
|
||||
return Unit::lookupCns(name.get()) != nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1257,10 +1257,10 @@ AutoloadHandler::Result AutoloadHandler::loadFromMap(CStrRef name,
|
||||
}
|
||||
}
|
||||
try {
|
||||
VM::Transl::VMRegAnchor _;
|
||||
Transl::VMRegAnchor _;
|
||||
bool initial;
|
||||
VMExecutionContext* ec = g_vmContext;
|
||||
VM::Unit* u = ec->evalInclude(fName.get(), nullptr, &initial);
|
||||
Unit* u = ec->evalInclude(fName.get(), nullptr, &initial);
|
||||
if (u) {
|
||||
if (initial) {
|
||||
TypedValue retval;
|
||||
@@ -1306,7 +1306,7 @@ bool AutoloadHandler::autoloadType(CStrRef name) {
|
||||
return !m_map.isNull() &&
|
||||
loadFromMap(name, s_type, true,
|
||||
[] (CStrRef name) {
|
||||
return !!VM::Unit::GetNamedEntity(name.get())->getCachedNameDef();
|
||||
return !!Unit::GetNamedEntity(name.get())->getCachedNameDef();
|
||||
}
|
||||
) != Failure;
|
||||
}
|
||||
@@ -1362,7 +1362,7 @@ bool AutoloadHandler::invokeHandler(CStrRef className,
|
||||
autoloadException = ex;
|
||||
}
|
||||
}
|
||||
if (VM::Unit::lookupClass(className.get()) != nullptr) {
|
||||
if (Unit::lookupClass(className.get()) != nullptr) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1429,7 +1429,7 @@ String AutoloadHandler::getSignature(CVarRef handler) {
|
||||
}
|
||||
|
||||
bool function_exists(CStrRef function_name) {
|
||||
return HPHP::VM::Unit::lookupFunc(function_name.get()) != nullptr;
|
||||
return HPHP::Unit::lookupFunc(function_name.get()) != nullptr;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -353,12 +353,12 @@ bool array_is_valid_callback(CArrRef arr);
|
||||
Variant f_call_user_func_array(CVarRef function, CArrRef params,
|
||||
bool bound = false);
|
||||
|
||||
const HPHP::VM::Func*
|
||||
const HPHP::Func*
|
||||
vm_decode_function(CVarRef function,
|
||||
ActRec* ar,
|
||||
bool forwarding,
|
||||
ObjectData*& this_,
|
||||
HPHP::VM::Class*& cls,
|
||||
HPHP::Class*& cls,
|
||||
StringData*& invName,
|
||||
bool warn = true);
|
||||
|
||||
|
||||
@@ -242,10 +242,10 @@ void ClassInfo::InitializeSystemConstants() {
|
||||
for (ConstantMap::const_iterator it = scm.begin(); it != scm.end(); ++it) {
|
||||
ConstantInfo* ci = it->second;
|
||||
if (ci->isDynamic()) {
|
||||
VM::Unit::defDynamicSystemConstant(ci->name.get(), ci);
|
||||
Unit::defDynamicSystemConstant(ci->name.get(), ci);
|
||||
} else {
|
||||
Variant v = ci->getValue();
|
||||
bool DEBUG_ONLY res = VM::Unit::defCns(ci->name.get(),
|
||||
bool DEBUG_ONLY res = Unit::defCns(ci->name.get(),
|
||||
v.asTypedValue(), true);
|
||||
assert(res);
|
||||
}
|
||||
|
||||
@@ -139,8 +139,8 @@ VMExecutionContext::~VMExecutionContext() {
|
||||
delete m_lastLocFilter;
|
||||
|
||||
if (UNLIKELY(!m_preConsts.empty())) {
|
||||
VM::Transl::unmergePreConsts(m_preConsts, this);
|
||||
for (VM::PreConstVec::iterator i = m_preConsts.begin();
|
||||
Transl::unmergePreConsts(m_preConsts, this);
|
||||
for (PreConstVec::iterator i = m_preConsts.begin();
|
||||
i != m_preConsts.end(); ++i) {
|
||||
decRefStr(const_cast<StringData*>(i->name));
|
||||
}
|
||||
|
||||
@@ -44,13 +44,11 @@ namespace Eval {
|
||||
class PhpFile;
|
||||
}
|
||||
|
||||
namespace VM {
|
||||
class EventHook;
|
||||
namespace Transl {
|
||||
class Translator;
|
||||
}
|
||||
class PCFilter;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -130,7 +128,7 @@ class ClassInfoVM : public ClassInfo,
|
||||
UserAttributeVec m_userAttrVec;
|
||||
|
||||
public:
|
||||
friend class HPHP::VM::Class;
|
||||
friend class HPHP::Class;
|
||||
};
|
||||
|
||||
namespace MethodLookup {
|
||||
@@ -432,21 +430,21 @@ public:
|
||||
static void getElem(TypedValue* base, TypedValue* key, TypedValue* dest);
|
||||
template<bool isMethod>
|
||||
static c_Continuation* createContinuationHelper(
|
||||
const VM::Func* origFunc,
|
||||
const VM::Func* genFunc,
|
||||
const Func* origFunc,
|
||||
const Func* genFunc,
|
||||
ObjectData* thisPtr,
|
||||
ArrayData* args,
|
||||
VM::Class* frameStaticCls);
|
||||
Class* frameStaticCls);
|
||||
template<bool isMethod>
|
||||
static c_Continuation* createContinuation(ActRec* fp, bool getArgs,
|
||||
const VM::Func* origFunc,
|
||||
const VM::Func* genFunc);
|
||||
const Func* origFunc,
|
||||
const Func* genFunc);
|
||||
static c_Continuation* fillContinuationVars(
|
||||
ActRec* fp, const VM::Func* origFunc, const VM::Func* genFunc,
|
||||
ActRec* fp, const Func* origFunc, const Func* genFunc,
|
||||
c_Continuation* cont);
|
||||
static void unpackContVarEnvLinkage(ActRec* fp);
|
||||
static void packContVarEnvLinkage(ActRec* fp);
|
||||
void pushLocalsAndIterators(const HPHP::VM::Func* f, int nparams = 0);
|
||||
void pushLocalsAndIterators(const HPHP::Func* f, int nparams = 0);
|
||||
|
||||
private:
|
||||
enum VectorLeaveCode {
|
||||
@@ -459,13 +457,13 @@ private:
|
||||
TypedValue& tvScratch,
|
||||
TypedValue& tvLiteral,
|
||||
TypedValue& tvRef, TypedValue& tvRef2,
|
||||
VM::MemberCode& mcode, TypedValue*& curMember);
|
||||
MemberCode& mcode, TypedValue*& curMember);
|
||||
template <bool warn, bool saveResult, VectorLeaveCode mleave>
|
||||
void getHelperPre(PC& pc, unsigned& ndiscard,
|
||||
TypedValue*& base, TypedValue& tvScratch,
|
||||
TypedValue& tvLiteral,
|
||||
TypedValue& tvRef, TypedValue& tvRef2,
|
||||
VM::MemberCode& mcode, TypedValue*& curMember);
|
||||
MemberCode& mcode, TypedValue*& curMember);
|
||||
template <bool saveResult>
|
||||
void getHelperPost(unsigned ndiscard, TypedValue*& tvRet,
|
||||
TypedValue& tvScratch, TypedValue& tvRef,
|
||||
@@ -474,7 +472,7 @@ private:
|
||||
TypedValue*& base, TypedValue& tvScratch,
|
||||
TypedValue& tvLiteral,
|
||||
TypedValue& tvRef, TypedValue& tvRef2,
|
||||
VM::MemberCode& mcode, TypedValue*& curMember);
|
||||
MemberCode& mcode, TypedValue*& curMember);
|
||||
|
||||
template <bool warn, bool define, bool unset, bool reffy, unsigned mdepth,
|
||||
VectorLeaveCode mleave>
|
||||
@@ -482,11 +480,11 @@ private:
|
||||
TypedValue& tvScratch,
|
||||
TypedValue& tvLiteral,
|
||||
TypedValue& tvRef, TypedValue& tvRef2,
|
||||
VM::MemberCode& mcode, TypedValue*& curMember);
|
||||
MemberCode& mcode, TypedValue*& curMember);
|
||||
template <unsigned mdepth>
|
||||
void setHelperPost(unsigned ndiscard, TypedValue& tvRef,
|
||||
TypedValue& tvRef2);
|
||||
bool cellInstanceOf(TypedValue* c, const HPHP::VM::NamedEntity* s);
|
||||
bool cellInstanceOf(TypedValue* c, const HPHP::NamedEntity* s);
|
||||
bool initIterator(PC& pc, PC& origPc, Iter* it,
|
||||
Offset offset, Cell* c1);
|
||||
bool initIteratorM(PC& pc, PC& origPc, Iter* it,
|
||||
@@ -500,49 +498,49 @@ OPCODES
|
||||
void contSendImpl();
|
||||
void classExistsImpl(PC& pc, Attr typeAttr);
|
||||
void fPushObjMethodImpl(
|
||||
VM::Class* cls, StringData* name, ObjectData* obj, int numArgs);
|
||||
ActRec* fPushFuncImpl(const VM::Func* func, int numArgs);
|
||||
Class* cls, StringData* name, ObjectData* obj, int numArgs);
|
||||
ActRec* fPushFuncImpl(const Func* func, int numArgs);
|
||||
|
||||
public:
|
||||
typedef hphp_hash_map<const StringData*, ClassInfo::ConstantInfo*,
|
||||
string_data_hash, string_data_same> ConstInfoMap;
|
||||
ConstInfoMap m_constInfo;
|
||||
typedef hphp_hash_map<const HPHP::VM::Class*, HphpArray*,
|
||||
pointer_hash<HPHP::VM::Class> > ClsCnsDataMap;
|
||||
typedef hphp_hash_map<const HPHP::Class*, HphpArray*,
|
||||
pointer_hash<HPHP::Class> > ClsCnsDataMap;
|
||||
ClsCnsDataMap m_clsCnsData;
|
||||
typedef hphp_hash_map<const HPHP::VM::Class*, HPHP::VM::Class::PropInitVec*,
|
||||
pointer_hash<HPHP::VM::Class> > PropDataMap;
|
||||
typedef hphp_hash_map<const HPHP::Class*, HPHP::Class::PropInitVec*,
|
||||
pointer_hash<HPHP::Class> > PropDataMap;
|
||||
PropDataMap m_propData;
|
||||
typedef hphp_hash_map<const HPHP::VM::Class*, HphpArray*,
|
||||
pointer_hash<HPHP::VM::Class> > SPropDataMap;
|
||||
typedef hphp_hash_map<const HPHP::Class*, HphpArray*,
|
||||
pointer_hash<HPHP::Class> > SPropDataMap;
|
||||
SPropDataMap m_sPropData;
|
||||
typedef hphp_hash_map<const HPHP::VM::Func*, HphpArray*,
|
||||
pointer_hash<HPHP::VM::Func> > FuncStaticCtxMap;
|
||||
typedef hphp_hash_map<const HPHP::Func*, HphpArray*,
|
||||
pointer_hash<HPHP::Func> > FuncStaticCtxMap;
|
||||
FuncStaticCtxMap m_funcStaticCtx;
|
||||
|
||||
const HPHP::VM::Func* lookupMethodCtx(const HPHP::VM::Class* cls,
|
||||
const HPHP::Func* lookupMethodCtx(const HPHP::Class* cls,
|
||||
const StringData* methodName,
|
||||
HPHP::VM::Class* pctx,
|
||||
HPHP::Class* pctx,
|
||||
MethodLookup::CallType lookupType,
|
||||
bool raise = false);
|
||||
MethodLookup::LookupResult lookupObjMethod(const HPHP::VM::Func*& f,
|
||||
const HPHP::VM::Class* cls,
|
||||
MethodLookup::LookupResult lookupObjMethod(const HPHP::Func*& f,
|
||||
const HPHP::Class* cls,
|
||||
const StringData* methodName,
|
||||
bool raise = false);
|
||||
MethodLookup::LookupResult lookupClsMethod(const HPHP::VM::Func*& f,
|
||||
const HPHP::VM::Class* cls,
|
||||
MethodLookup::LookupResult lookupClsMethod(const HPHP::Func*& f,
|
||||
const HPHP::Class* cls,
|
||||
const StringData* methodName,
|
||||
ObjectData* this_,
|
||||
bool raise = false);
|
||||
MethodLookup::LookupResult lookupCtorMethod(const HPHP::VM::Func*& f,
|
||||
const HPHP::VM::Class* cls,
|
||||
MethodLookup::LookupResult lookupCtorMethod(const HPHP::Func*& f,
|
||||
const HPHP::Class* cls,
|
||||
bool raise = false);
|
||||
HPHP::ObjectData* createObject(StringData* clsName,
|
||||
CArrRef params,
|
||||
bool init = true);
|
||||
HPHP::ObjectData* createObjectOnly(StringData* clsName);
|
||||
|
||||
HphpArray* getFuncStaticCtx(const HPHP::VM::Func* f) {
|
||||
HphpArray* getFuncStaticCtx(const HPHP::Func* f) {
|
||||
FuncStaticCtxMap::iterator it = m_funcStaticCtx.find(f);
|
||||
if (it != m_funcStaticCtx.end()) {
|
||||
return it->second;
|
||||
@@ -553,19 +551,19 @@ public:
|
||||
return m_funcStaticCtx[f] = array;
|
||||
}
|
||||
|
||||
HphpArray* getClsCnsData(const HPHP::VM::Class* class_) const {
|
||||
HphpArray* getClsCnsData(const HPHP::Class* class_) const {
|
||||
ClsCnsDataMap::const_iterator it = m_clsCnsData.find(class_);
|
||||
if (it == m_clsCnsData.end()) {
|
||||
return nullptr;
|
||||
}
|
||||
return it->second;
|
||||
}
|
||||
void setClsCnsData(const HPHP::VM::Class* class_, HphpArray* clsCnsData) {
|
||||
void setClsCnsData(const HPHP::Class* class_, HphpArray* clsCnsData) {
|
||||
assert(getClsCnsData(class_) == nullptr);
|
||||
m_clsCnsData[class_] = clsCnsData;
|
||||
}
|
||||
|
||||
TypedValue* lookupClsCns(const HPHP::VM::NamedEntity* ne,
|
||||
TypedValue* lookupClsCns(const HPHP::NamedEntity* ne,
|
||||
const StringData* cls,
|
||||
const StringData* cns);
|
||||
|
||||
@@ -583,9 +581,9 @@ public:
|
||||
VarEnv* m_globalVarEnv;
|
||||
VarEnv* m_topVarEnv;
|
||||
|
||||
HPHP::VM::RenamedFuncDict m_renamedFuncs;
|
||||
HPHP::RenamedFuncDict m_renamedFuncs;
|
||||
EvaledFilesMap m_evaledFiles;
|
||||
typedef std::vector<HPHP::VM::Unit*> EvaledUnitsVec;
|
||||
typedef std::vector<HPHP::Unit*> EvaledUnitsVec;
|
||||
EvaledUnitsVec m_createdFuncs;
|
||||
|
||||
/*
|
||||
@@ -609,8 +607,8 @@ public:
|
||||
|
||||
ActRec* getStackFrame();
|
||||
ObjectData* getThis();
|
||||
VM::Class* getContextClass();
|
||||
VM::Class* getParentContextClass();
|
||||
Class* getContextClass();
|
||||
Class* getParentContextClass();
|
||||
CStrRef getContainingFileName();
|
||||
int getLine();
|
||||
Array getCallerInfo();
|
||||
@@ -619,17 +617,17 @@ public:
|
||||
void addRenameableFunctions(ArrayData* arr);
|
||||
HPHP::Eval::PhpFile* lookupPhpFile(
|
||||
StringData* path, const char* currentDir, bool* initial = nullptr);
|
||||
HPHP::VM::Unit* evalInclude(StringData* path,
|
||||
HPHP::Unit* evalInclude(StringData* path,
|
||||
const StringData* curUnitFilePath, bool* initial);
|
||||
HPHP::VM::Unit* evalIncludeRoot(StringData* path,
|
||||
HPHP::Unit* evalIncludeRoot(StringData* path,
|
||||
InclOpFlags flags, bool* initial);
|
||||
HPHP::Eval::PhpFile* lookupIncludeRoot(StringData* path,
|
||||
InclOpFlags flags, bool* initial,
|
||||
HPHP::VM::Unit* unit = 0);
|
||||
bool evalUnit(HPHP::VM::Unit* unit, bool local,
|
||||
HPHP::Unit* unit = 0);
|
||||
bool evalUnit(HPHP::Unit* unit, bool local,
|
||||
PC& pc, int funcType);
|
||||
void invokeUnit(TypedValue* retval, HPHP::VM::Unit* unit);
|
||||
HPHP::VM::Unit* compileEvalString(StringData* code);
|
||||
void invokeUnit(TypedValue* retval, HPHP::Unit* unit);
|
||||
HPHP::Unit* compileEvalString(StringData* code);
|
||||
CStrRef createFunction(CStrRef args, CStrRef code);
|
||||
void evalPHPDebugger(TypedValue* retval, StringData *code, int frame);
|
||||
void enterDebuggerDummyEnv();
|
||||
@@ -664,9 +662,9 @@ public:
|
||||
VarEnv* getVarEnv();
|
||||
void setVar(StringData* name, TypedValue* v, bool ref);
|
||||
Array getLocalDefinedVariables(int frame);
|
||||
HPHP::VM::InjectionTables* m_injTables;
|
||||
HPHP::VM::PCFilter* m_breakPointFilter;
|
||||
HPHP::VM::PCFilter* m_lastLocFilter;
|
||||
HPHP::InjectionTables* m_injTables;
|
||||
HPHP::PCFilter* m_breakPointFilter;
|
||||
HPHP::PCFilter* m_lastLocFilter;
|
||||
bool m_interpreting;
|
||||
bool m_dbgNoBreak;
|
||||
int switchMode(bool unwindBuiltin);
|
||||
@@ -681,14 +679,14 @@ private:
|
||||
void doFPushCuf(PC& pc, bool forward, bool safe);
|
||||
void unwindBuiltinFrame();
|
||||
template <bool forwarding>
|
||||
void pushClsMethodImpl(VM::Class* cls, StringData* name,
|
||||
void pushClsMethodImpl(Class* cls, StringData* name,
|
||||
ObjectData* obj, int numArgs);
|
||||
bool prepareFuncEntry(ActRec* ar, PC& pc);
|
||||
bool prepareArrayArgs(ActRec* ar, ArrayData* args);
|
||||
void recordCodeCoverage(PC pc);
|
||||
bool isReturnHelper(uintptr_t address);
|
||||
int m_coverPrevLine;
|
||||
HPHP::VM::Unit* m_coverPrevUnit;
|
||||
HPHP::Unit* m_coverPrevUnit;
|
||||
Array m_evaledArgs;
|
||||
public:
|
||||
void resetCoverageCounters();
|
||||
@@ -700,10 +698,10 @@ public:
|
||||
InvokePseudoMain = 2
|
||||
};
|
||||
void invokeFunc(TypedValue* retval,
|
||||
const HPHP::VM::Func* f,
|
||||
const HPHP::Func* f,
|
||||
CArrRef params,
|
||||
ObjectData* this_ = nullptr,
|
||||
HPHP::VM::Class* class_ = nullptr,
|
||||
HPHP::Class* class_ = nullptr,
|
||||
VarEnv* varEnv = nullptr,
|
||||
StringData* invName = nullptr,
|
||||
InvokeFlags flags = InvokeNormal);
|
||||
@@ -715,12 +713,12 @@ public:
|
||||
ctx.invName, InvokeIgnoreByRefErrors);
|
||||
}
|
||||
void invokeFuncFew(TypedValue* retval,
|
||||
const HPHP::VM::Func* f,
|
||||
const HPHP::Func* f,
|
||||
void* thisOrCls,
|
||||
StringData* invName,
|
||||
int argc, TypedValue* argv);
|
||||
void invokeFuncFew(TypedValue* retval,
|
||||
const HPHP::VM::Func* f,
|
||||
const HPHP::Func* f,
|
||||
void* thisOrCls,
|
||||
StringData* invName = nullptr) {
|
||||
invokeFuncFew(retval, f, thisOrCls, invName, 0, nullptr);
|
||||
@@ -733,7 +731,7 @@ public:
|
||||
ctx.cls ? (char*)ctx.cls + 1 : nullptr,
|
||||
ctx.invName, argc, argv);
|
||||
}
|
||||
void invokeContFunc(const HPHP::VM::Func* f,
|
||||
void invokeContFunc(const HPHP::Func* f,
|
||||
ObjectData* this_,
|
||||
TypedValue* param = nullptr);
|
||||
// VM ClassInfo support
|
||||
@@ -773,7 +771,7 @@ OPCODES
|
||||
void dispatchBB();
|
||||
|
||||
private:
|
||||
VM::PreConstVec m_preConsts;
|
||||
PreConstVec m_preConsts;
|
||||
static Mutex s_threadIdxLock;
|
||||
static hphp_hash_map<pid_t, int64_t> s_threadIdxMap;
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ extern const char *g_class_map[];
|
||||
/**
|
||||
* Returns a thread local global variable class pointer.
|
||||
*/
|
||||
typedef VM::GlobalNameValueTableWrapper GlobalVariables;
|
||||
typedef GlobalNameValueTableWrapper GlobalVariables;
|
||||
extern GlobalVariables *get_global_variables();
|
||||
extern void init_global_variables();
|
||||
extern void free_global_variables();
|
||||
@@ -65,7 +65,7 @@ extern Array get_global_state();
|
||||
/**
|
||||
* Returns a thread local global variable table pointer.
|
||||
*/
|
||||
typedef VM::GlobalNameValueTableWrapper SystemGlobals;
|
||||
typedef GlobalNameValueTableWrapper SystemGlobals;
|
||||
extern SystemGlobals *get_system_globals();
|
||||
|
||||
/**
|
||||
|
||||
@@ -38,18 +38,18 @@ StaticString s_call("__call");
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
UserFile::UserFile(VM::Class *cls, int options /*= 0 */,
|
||||
UserFile::UserFile(Class *cls, int options /*= 0 */,
|
||||
CVarRef context /*= null */) :
|
||||
m_cls(cls), m_options(options) {
|
||||
VM::Transl::VMRegAnchor _;
|
||||
const VM::Func *ctor;
|
||||
Transl::VMRegAnchor _;
|
||||
const Func *ctor;
|
||||
if (MethodLookup::MethodFoundWithThis !=
|
||||
g_vmContext->lookupCtorMethod(ctor, cls)) {
|
||||
throw InvalidArgumentException(0, "Unable to call %s's constructor",
|
||||
cls->name()->data());
|
||||
}
|
||||
|
||||
m_obj = VM::Instance::newInstance(cls);
|
||||
m_obj = Instance::newInstance(cls);
|
||||
m_obj.o_set("context", context);
|
||||
Variant ret;
|
||||
g_vmContext->invokeFuncFew(ret.asTypedValue(), ctor, m_obj.get());
|
||||
@@ -70,8 +70,8 @@ UserFile::UserFile(VM::Class *cls, int options /*= 0 */,
|
||||
UserFile::~UserFile() {
|
||||
}
|
||||
|
||||
const VM::Func* UserFile::lookupMethod(const StringData* name) {
|
||||
const VM::Func *f = m_cls->lookupMethod(name);
|
||||
const Func* UserFile::lookupMethod(const StringData* name) {
|
||||
const Func *f = m_cls->lookupMethod(name);
|
||||
if (!f) return nullptr;
|
||||
|
||||
if (f->attrs() & AttrStatic) {
|
||||
@@ -83,9 +83,9 @@ const VM::Func* UserFile::lookupMethod(const StringData* name) {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Variant UserFile::invoke(const VM::Func *func, CStrRef name,
|
||||
Variant UserFile::invoke(const Func *func, CStrRef name,
|
||||
CArrRef args, bool &success) {
|
||||
VM::Transl::VMRegAnchor _;
|
||||
Transl::VMRegAnchor _;
|
||||
|
||||
// Assume failure
|
||||
success = false;
|
||||
|
||||
@@ -26,7 +26,7 @@ class UserFile : public File {
|
||||
public:
|
||||
DECLARE_OBJECT_ALLOCATION(UserFile);
|
||||
|
||||
UserFile(VM::Class *cls, int options = 0, CVarRef context = uninit_null());
|
||||
UserFile(Class *cls, int options = 0, CVarRef context = uninit_null());
|
||||
virtual ~UserFile();
|
||||
|
||||
static StaticString s_class_name;
|
||||
@@ -57,29 +57,29 @@ public:
|
||||
virtual bool lock(int operation, bool &wouldBlock);
|
||||
|
||||
protected:
|
||||
VM::Class *m_cls;
|
||||
Class *m_cls;
|
||||
int m_options;
|
||||
Object m_obj;
|
||||
|
||||
Variant invoke(const VM::Func *func, CStrRef name, CArrRef args, bool &success);
|
||||
Variant invoke(const VM::Func *func, CStrRef name, CArrRef args) {
|
||||
Variant invoke(const Func *func, CStrRef name, CArrRef args, bool &success);
|
||||
Variant invoke(const Func *func, CStrRef name, CArrRef args) {
|
||||
bool success;
|
||||
return invoke(func, name, args, success);
|
||||
}
|
||||
|
||||
const VM::Func* lookupMethod(const StringData* name);
|
||||
const Func* lookupMethod(const StringData* name);
|
||||
|
||||
const VM::Func* m_StreamOpen;
|
||||
const VM::Func* m_StreamClose;
|
||||
const VM::Func* m_StreamRead;
|
||||
const VM::Func* m_StreamWrite;
|
||||
const VM::Func* m_StreamSeek;
|
||||
const VM::Func* m_StreamTell;
|
||||
const VM::Func* m_StreamEof;
|
||||
const VM::Func* m_StreamFlush;
|
||||
const VM::Func* m_StreamLock;
|
||||
const Func* m_StreamOpen;
|
||||
const Func* m_StreamClose;
|
||||
const Func* m_StreamRead;
|
||||
const Func* m_StreamWrite;
|
||||
const Func* m_StreamSeek;
|
||||
const Func* m_StreamTell;
|
||||
const Func* m_StreamEof;
|
||||
const Func* m_StreamFlush;
|
||||
const Func* m_StreamLock;
|
||||
|
||||
const VM::Func* m_Call;
|
||||
const Func* m_Call;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace HPHP {
|
||||
|
||||
UserStreamWrapper::UserStreamWrapper(CStrRef name, CStrRef clsname) :
|
||||
m_name(name) {
|
||||
m_cls = VM::Unit::loadClass(clsname.get());
|
||||
m_cls = Unit::loadClass(clsname.get());
|
||||
if (!m_cls) {
|
||||
throw InvalidArgumentException(0, "Undefined class '%s'", clsname.data());
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ class UserStreamWrapper : public Stream::Wrapper {
|
||||
int options, CVarRef context);
|
||||
private:
|
||||
String m_name;
|
||||
VM::Class *m_cls;
|
||||
Class *m_cls;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -27,9 +27,7 @@
|
||||
namespace HPHP {
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace VM {
|
||||
class Class;
|
||||
}
|
||||
|
||||
struct TypedValue;
|
||||
|
||||
@@ -44,7 +42,7 @@ union Value {
|
||||
StringData *pstr; // KindOfString, KindOfStaticString
|
||||
ArrayData *parr; // KindOfArray
|
||||
ObjectData *pobj; // KindOfObject
|
||||
VM::Class *pcls; // only in vm stack, no type tag.
|
||||
Class *pcls; // only in vm stack, no type tag.
|
||||
RefData *pref; // KindOfRef
|
||||
TypedValue *pind; // only for KindOfIndirect
|
||||
};
|
||||
|
||||
@@ -97,7 +97,7 @@ bool register_intercept(CStrRef name, CVarRef callback, CVarRef data) {
|
||||
return true;
|
||||
}
|
||||
|
||||
VM::EventHook::EnableIntercept();
|
||||
EventHook::EnableIntercept();
|
||||
|
||||
Array handler = CREATE_VECTOR2(callback, data);
|
||||
|
||||
@@ -195,7 +195,7 @@ void rename_function(CStrRef old_name, CStrRef new_name) {
|
||||
}
|
||||
|
||||
String get_renamed_function(CStrRef name) {
|
||||
HPHP::VM::Func* f = HPHP::VM::Unit::lookupFunc(name.get());
|
||||
HPHP::Func* f = HPHP::Unit::lookupFunc(name.get());
|
||||
if (f) {
|
||||
return f->nameRef();
|
||||
}
|
||||
|
||||
@@ -85,21 +85,21 @@ namespace HPHP {
|
||||
public: \
|
||||
static const char *GetClassName() { return #originalName; } \
|
||||
static StaticString s_class_name; \
|
||||
static HPHP::VM::Class* s_cls; \
|
||||
static HPHP::Class* s_cls; \
|
||||
|
||||
#define DECLARE_CLASS_COMMON_NO_ALLOCATION(cls, originalName) \
|
||||
public: \
|
||||
static void *ObjAllocatorInitSetup; \
|
||||
static const char *GetClassName() { return #originalName; } \
|
||||
static StaticString s_class_name; \
|
||||
static HPHP::VM::Class* s_cls; \
|
||||
static HPHP::Class* s_cls; \
|
||||
|
||||
#define DECLARE_CLASS_COMMON(cls, originalName) \
|
||||
DECLARE_OBJECT_ALLOCATION(c_##cls) \
|
||||
public: \
|
||||
static const char *GetClassName() { return #originalName; } \
|
||||
static StaticString s_class_name; \
|
||||
static HPHP::VM::Class* s_cls; \
|
||||
static HPHP::Class* s_cls; \
|
||||
|
||||
#define DECLARE_CLASS_NO_SWEEP(cls, originalName, parent) \
|
||||
DECLARE_CLASS_COMMON_NO_SWEEP(cls, originalName) \
|
||||
@@ -119,7 +119,7 @@ namespace HPHP {
|
||||
|
||||
#define IMPLEMENT_CLASS_COMMON(cls) \
|
||||
StaticString c_##cls::s_class_name(c_##cls::GetClassName()); \
|
||||
HPHP::VM::Class* c_##cls::s_cls = nullptr; \
|
||||
HPHP::Class* c_##cls::s_cls = nullptr; \
|
||||
|
||||
#define IMPLEMENT_CLASS(cls) \
|
||||
IMPLEMENT_CLASS_COMMON(cls) \
|
||||
|
||||
@@ -257,8 +257,8 @@ void *SmartAllocatorInitSetup() {
|
||||
RELEASEOBJ(NS, T, p); \
|
||||
return; \
|
||||
} \
|
||||
HPHP::VM::Instance* this_ = (HPHP::VM::Instance*)p; \
|
||||
HPHP::VM::Class* cls = this_->getVMClass(); \
|
||||
HPHP::Instance* this_ = (HPHP::Instance*)p; \
|
||||
HPHP::Class* cls = this_->getVMClass(); \
|
||||
size_t nProps = cls->numDeclProperties(); \
|
||||
size_t builtinPropSize = cls->builtinPropSize(); \
|
||||
TypedValue* propVec = \
|
||||
@@ -268,7 +268,7 @@ void *SmartAllocatorInitSetup() {
|
||||
TypedValue* prop = &propVec[i]; \
|
||||
tvRefcountedDecRef(prop); \
|
||||
} \
|
||||
DELETEOBJSZ(HPHP::VM::Instance::sizeForNProps(nProps) + \
|
||||
DELETEOBJSZ(HPHP::Instance::sizeForNProps(nProps) + \
|
||||
builtinPropSize)(this_); \
|
||||
}
|
||||
|
||||
|
||||
@@ -54,12 +54,12 @@ ObjectData::~ObjectData() {
|
||||
}
|
||||
}
|
||||
|
||||
HPHP::VM::Class*
|
||||
ObjectData::instanceof(const HPHP::VM::PreClass* pc) const {
|
||||
HPHP::Class*
|
||||
ObjectData::instanceof(const HPHP::PreClass* pc) const {
|
||||
return m_cls->classof(pc);
|
||||
}
|
||||
|
||||
bool ObjectData::instanceof(const HPHP::VM::Class* c) const {
|
||||
bool ObjectData::instanceof(const HPHP::Class* c) const {
|
||||
return m_cls->classof(c);
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ CStrRef ObjectData::o_getClassNameHook() const {
|
||||
|
||||
HOT_FUNC
|
||||
bool ObjectData::o_instanceof(CStrRef s) const {
|
||||
HPHP::VM::Class* cls = VM::Unit::lookupClass(s.get());
|
||||
HPHP::Class* cls = Unit::lookupClass(s.get());
|
||||
if (!cls) return false;
|
||||
return m_cls->classof(cls);
|
||||
}
|
||||
@@ -185,7 +185,7 @@ MutableArrayIter ObjectData::begin(Variant *key, Variant &val,
|
||||
}
|
||||
|
||||
void ObjectData::initProperties(int nProp) {
|
||||
if (!o_properties.get()) ((HPHP::VM::Instance*)this)->initDynProps(nProp);
|
||||
if (!o_properties.get()) ((HPHP::Instance*)this)->initDynProps(nProp);
|
||||
}
|
||||
|
||||
Variant* ObjectData::o_realProp(CStrRef propName, int flags,
|
||||
@@ -196,12 +196,12 @@ Variant* ObjectData::o_realProp(CStrRef propName, int flags,
|
||||
* behavior in cases where the named property is nonexistent or
|
||||
* inaccessible.
|
||||
*/
|
||||
HPHP::VM::Class* ctx = nullptr;
|
||||
HPHP::Class* ctx = nullptr;
|
||||
if (!context.empty()) {
|
||||
ctx = VM::Unit::lookupClass(context.get());
|
||||
ctx = Unit::lookupClass(context.get());
|
||||
}
|
||||
|
||||
HPHP::VM::Instance* thiz = (HPHP::VM::Instance*)(this); // sigh
|
||||
HPHP::Instance* thiz = (HPHP::Instance*)(this); // sigh
|
||||
bool visible, accessible, unset;
|
||||
TypedValue* ret = (flags & RealPropNoDynamic)
|
||||
? thiz->getDeclProp(ctx, propName.get(), visible,
|
||||
@@ -316,10 +316,10 @@ Variant ObjectData::o_setRef(CStrRef propName, CVarRef v, CStrRef context) {
|
||||
|
||||
HOT_FUNC
|
||||
void ObjectData::o_setArray(CArrRef properties) {
|
||||
auto thiz = static_cast<VM::Instance*>(this);
|
||||
auto thiz = static_cast<Instance*>(this);
|
||||
for (ArrayIter iter(properties); iter; ++iter) {
|
||||
String k = iter.first().toString();
|
||||
VM::Class* ctx = nullptr;
|
||||
Class* ctx = nullptr;
|
||||
// If the key begins with a NUL, it's a private or protected property. Read
|
||||
// the class name from between the two NUL bytes.
|
||||
if (!k.empty() && k.charAt(0) == '\0') {
|
||||
@@ -330,7 +330,7 @@ void ObjectData::o_setArray(CArrRef properties) {
|
||||
ctx = m_cls;
|
||||
} else {
|
||||
// Private.
|
||||
ctx = VM::Unit::lookupClass(cls.get());
|
||||
ctx = Unit::lookupClass(cls.get());
|
||||
if (!ctx) continue;
|
||||
}
|
||||
k = k.substr(subLen);
|
||||
@@ -354,13 +354,13 @@ void ObjectData::o_getArray(Array &props, bool pubOnly /* = false */) const {
|
||||
std::vector<bool> inserted(m_cls->numDeclProperties(), false);
|
||||
|
||||
// Iterate over declared properties and insert {mangled name --> prop} pairs.
|
||||
const VM::Class* cls = m_cls;
|
||||
auto thiz = static_cast<const VM::Instance*>(this);
|
||||
const Class* cls = m_cls;
|
||||
auto thiz = static_cast<const Instance*>(this);
|
||||
do {
|
||||
thiz->getProps(cls, pubOnly, cls->m_preClass.get(), props, inserted);
|
||||
const std::vector<VM::ClassPtr> &usedTraits = cls->m_usedTraits;
|
||||
const std::vector<ClassPtr> &usedTraits = cls->m_usedTraits;
|
||||
for (unsigned t = 0; t < usedTraits.size(); t++) {
|
||||
const VM::ClassPtr& trait = usedTraits[t];
|
||||
const ClassPtr& trait = usedTraits[t];
|
||||
thiz->getProps(cls, pubOnly, trait->m_preClass.get(), props, inserted);
|
||||
}
|
||||
cls = cls->m_parent.get();
|
||||
@@ -395,22 +395,22 @@ Array ObjectData::o_toIterArray(CStrRef context,
|
||||
size_t size = m_cls->m_declPropNumAccessible +
|
||||
(o_properties.get() ? o_properties.get()->size() : 0);
|
||||
HphpArray* retval = NEW(HphpArray)(size);
|
||||
VM::Class* ctx = nullptr;
|
||||
Class* ctx = nullptr;
|
||||
if (!context.empty()) {
|
||||
ctx = VM::Unit::lookupClass(context.get());
|
||||
ctx = Unit::lookupClass(context.get());
|
||||
}
|
||||
|
||||
// Get all declared properties first, bottom-to-top in the inheritance
|
||||
// hierarchy, in declaration order.
|
||||
const VM::Class* klass = m_cls;
|
||||
const Class* klass = m_cls;
|
||||
while (klass) {
|
||||
const VM::PreClass::Prop* props = klass->m_preClass->properties();
|
||||
const PreClass::Prop* props = klass->m_preClass->properties();
|
||||
const size_t numProps = klass->m_preClass->numProperties();
|
||||
|
||||
for (size_t i = 0; i < numProps; ++i) {
|
||||
auto key = const_cast<StringData*>(props[i].name());
|
||||
bool visible, accessible, unset;
|
||||
TypedValue* val = ((VM::Instance*)this)->getProp(
|
||||
TypedValue* val = ((Instance*)this)->getProp(
|
||||
ctx, key, visible, accessible, unset);
|
||||
if (accessible && val->m_type != KindOfUninit && !unset) {
|
||||
if (getRef) {
|
||||
@@ -616,7 +616,7 @@ void ObjectData::serializeImpl(VariableSerializer *serializer) const {
|
||||
if (UNLIKELY(handleSleep)) {
|
||||
assert(!isCollection());
|
||||
if (ret.isArray()) {
|
||||
auto thiz = (VM::Instance*)(this);
|
||||
auto thiz = (Instance*)(this);
|
||||
Array wanted = Array::Create();
|
||||
Array props = ret.toArray();
|
||||
for (ArrayIter iter(props); iter; ++iter) {
|
||||
@@ -692,7 +692,7 @@ void ObjectData::dump() const {
|
||||
}
|
||||
|
||||
ObjectData *ObjectData::clone() {
|
||||
HPHP::VM::Instance* instance = static_cast<HPHP::VM::Instance*>(this);
|
||||
HPHP::Instance* instance = static_cast<HPHP::Instance*>(this);
|
||||
return instance->cloneImpl();
|
||||
}
|
||||
|
||||
@@ -722,7 +722,7 @@ Variant ObjectData::t___get(Variant v_name) {
|
||||
|
||||
Variant ObjectData::offsetGet(Variant key) {
|
||||
assert(instanceof(SystemLib::s_ArrayAccessClass));
|
||||
const VM::Func* method = m_cls->lookupMethod(s_offsetGet.get());
|
||||
const Func* method = m_cls->lookupMethod(s_offsetGet.get());
|
||||
assert(method);
|
||||
if (!method) {
|
||||
return uninit_null();
|
||||
|
||||
@@ -35,10 +35,8 @@ class MutableArrayIter;
|
||||
|
||||
class HphpArray;
|
||||
class TypedValue;
|
||||
namespace VM {
|
||||
class PreClass;
|
||||
class Class;
|
||||
}
|
||||
class PreClass;
|
||||
class Class;
|
||||
|
||||
extern StaticString ssIterator;
|
||||
|
||||
@@ -79,7 +77,7 @@ class ObjectData : public CountableNF {
|
||||
RealPropExist = 16, // For property_exists
|
||||
};
|
||||
|
||||
ObjectData(bool noId, VM::Class* type)
|
||||
ObjectData(bool noId, Class* type)
|
||||
: o_attribute(0), m_cls(type) {
|
||||
assert(uintptr_t(this) % sizeof(TypedValue) == 0);
|
||||
if (!noId) {
|
||||
@@ -91,7 +89,7 @@ class ObjectData : public CountableNF {
|
||||
|
||||
virtual ~ObjectData(); // all PHP classes need virtual tables
|
||||
|
||||
VM::Class* getVMClass() const {
|
||||
Class* getVMClass() const {
|
||||
return m_cls;
|
||||
}
|
||||
static size_t getVMClassOffset() {
|
||||
@@ -99,8 +97,8 @@ class ObjectData : public CountableNF {
|
||||
return offsetof(ObjectData, m_cls);
|
||||
}
|
||||
static size_t attributeOff() { return offsetof(ObjectData, o_attribute); }
|
||||
VM::Class* instanceof(const VM::PreClass* pc) const;
|
||||
bool instanceof(const VM::Class* c) const;
|
||||
Class* instanceof(const PreClass* pc) const;
|
||||
bool instanceof(const Class* c) const;
|
||||
|
||||
bool isCollection() const {
|
||||
return getCollectionType() != Collection::InvalidType;
|
||||
@@ -234,7 +232,7 @@ class ObjectData : public CountableNF {
|
||||
} o_subclassData;
|
||||
|
||||
protected:
|
||||
VM::Class* m_cls;
|
||||
Class* m_cls;
|
||||
|
||||
protected:
|
||||
ArrNR o_properties; // dynamic properties (VM and hphpc)
|
||||
@@ -260,7 +258,7 @@ class ObjectData : public CountableNF {
|
||||
|
||||
template<> inline SmartPtr<ObjectData>::~SmartPtr() {}
|
||||
|
||||
typedef VM::GlobalNameValueTableWrapper GlobalVariables;
|
||||
typedef GlobalNameValueTableWrapper GlobalVariables;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Calculate item sizes for object allocators
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace HPHP {
|
||||
|
||||
extern InitFiniNode *extra_process_init, *extra_process_exit;
|
||||
|
||||
namespace VM { void initialize_repo(); }
|
||||
void initialize_repo();
|
||||
|
||||
/*
|
||||
* XXX: VM process initialization is handled through a function
|
||||
@@ -495,7 +495,7 @@ void execute_command_line_end(int xhprof, bool coverage, const char *program) {
|
||||
ThreadInfo *ti = ThreadInfo::s_threadInfo.getNoCheck();
|
||||
|
||||
if (RuntimeOption::EvalJit && RuntimeOption::EvalDumpTC) {
|
||||
HPHP::VM::Transl::tc_dump();
|
||||
HPHP::Transl::tc_dump();
|
||||
}
|
||||
|
||||
if (xhprof) {
|
||||
@@ -670,7 +670,7 @@ static int execute_program_impl(int argc, char **argv);
|
||||
int execute_program(int argc, char **argv) {
|
||||
int ret_code = -1;
|
||||
try {
|
||||
VM::initialize_repo();
|
||||
initialize_repo();
|
||||
init_thread_locals();
|
||||
ret_code = execute_program_impl(argc, argv);
|
||||
} catch (const Exception &e) {
|
||||
@@ -963,7 +963,7 @@ static int execute_program_impl(int argc, char **argv) {
|
||||
if (phpFile == nullptr) {
|
||||
throw FileOpenException(po.lint.c_str());
|
||||
}
|
||||
VM::Unit* unit = phpFile->unit();
|
||||
Unit* unit = phpFile->unit();
|
||||
const StringData* msg;
|
||||
int line;
|
||||
if (unit->compileTimeFatal(msg, line)) {
|
||||
@@ -1004,9 +1004,9 @@ static int execute_program_impl(int argc, char **argv) {
|
||||
prepare_args(new_argc, new_argv, po.args, po.file.c_str());
|
||||
|
||||
if (!po.file.empty()) {
|
||||
VM::Repo::setCliFile(po.file);
|
||||
Repo::setCliFile(po.file);
|
||||
} else if (new_argc >= 2) {
|
||||
VM::Repo::setCliFile(new_argv[1]);
|
||||
Repo::setCliFile(new_argv[1]);
|
||||
}
|
||||
|
||||
int ret = 0;
|
||||
@@ -1177,7 +1177,7 @@ void hphp_process_init() {
|
||||
apc_load(RuntimeOption::ApcLoadThread);
|
||||
RuntimeOption::SerializationSizeLimit = save;
|
||||
|
||||
VM::Transl::TargetCache::requestExit();
|
||||
Transl::TargetCache::requestExit();
|
||||
// Reset the preloaded g_context
|
||||
ExecutionContext *context = g_context.getNoCheck();
|
||||
context->~ExecutionContext();
|
||||
|
||||
@@ -31,7 +31,7 @@ int ResourceData::GetMaxResourceId() {
|
||||
}
|
||||
|
||||
ResourceData::ResourceData()
|
||||
: VM::Instance(SystemLib::s_resourceClass, true) {
|
||||
: Instance(SystemLib::s_resourceClass, true) {
|
||||
assert(!m_cls->callsCustomInstanceInit());
|
||||
int &pmax = *os_max_resource_id;
|
||||
if (pmax < 3) pmax = 3; // reserving 1, 2, 3 for STDIN, STDOUT, STDERR
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace HPHP {
|
||||
* Base class of all resources used by extensions for opaquely passing object
|
||||
* pointers.
|
||||
*/
|
||||
class ResourceData : public VM::Instance {
|
||||
class ResourceData : public Instance {
|
||||
public:
|
||||
ResourceData();
|
||||
virtual ~ResourceData();
|
||||
|
||||
@@ -555,9 +555,7 @@ static bool send_status(Transport *transport, ServerStats::Format format,
|
||||
return true;
|
||||
}
|
||||
|
||||
namespace VM {
|
||||
extern size_t hhbc_arena_capacity();
|
||||
}
|
||||
|
||||
bool AdminRequestHandler::handleCheckRequest(const std::string &cmd,
|
||||
Transport *transport) {
|
||||
@@ -588,8 +586,8 @@ bool AdminRequestHandler::handleCheckRequest(const std::string &cmd,
|
||||
ServerPtr server = HttpServer::Server->getPageServer();
|
||||
appendStat("load", server->getActiveWorker());
|
||||
appendStat("queued", server->getQueuedJobs());
|
||||
VM::Transl::Translator* tx = VM::Transl::Translator::Get();
|
||||
appendStat("hhbc-roarena-capac", VM::hhbc_arena_capacity());
|
||||
Transl::Translator* tx = Transl::Translator::Get();
|
||||
appendStat("hhbc-roarena-capac", hhbc_arena_capacity());
|
||||
appendStat("tc-size", tx->getCodeSize());
|
||||
appendStat("tc-stubsize", tx->getStubSize());
|
||||
appendStat("targetcache", tx->getTargetCacheSize());
|
||||
@@ -961,12 +959,12 @@ typedef std::map<int, PCInfo> InfoMap;
|
||||
bool AdminRequestHandler::handleVMRequest(const std::string &cmd,
|
||||
Transport *transport) {
|
||||
if (cmd == "vm-tcspace") {
|
||||
transport->sendString(VM::Transl::Translator::Get()->getUsage());
|
||||
transport->sendString(Transl::Translator::Get()->getUsage());
|
||||
return true;
|
||||
}
|
||||
if (cmd == "vm-preconsts") {
|
||||
InfoMap counts;
|
||||
using namespace HPHP::VM::Transl;
|
||||
using namespace HPHP::Transl;
|
||||
for (PreConstDepMap::iterator i = gPreConsts.begin(); i != gPreConsts.end();
|
||||
++i) {
|
||||
PreConstDep& dep = i->second;
|
||||
@@ -993,7 +991,7 @@ bool AdminRequestHandler::handleVMRequest(const std::string &cmd,
|
||||
return true;
|
||||
}
|
||||
if (cmd == "vm-dump-tc") {
|
||||
if (HPHP::VM::Transl::tc_dump()) {
|
||||
if (HPHP::Transl::tc_dump()) {
|
||||
transport->sendString("Done");
|
||||
} else {
|
||||
transport->sendString("Error dumping the translation cache");
|
||||
@@ -1002,7 +1000,7 @@ bool AdminRequestHandler::handleVMRequest(const std::string &cmd,
|
||||
}
|
||||
if (cmd == "vm-tcreset") {
|
||||
int64_t start = Timer::GetCurrentTimeMicros();
|
||||
if (HPHP::VM::Transl::tx64->replace()) {
|
||||
if (HPHP::Transl::tx64->replace()) {
|
||||
string msg;
|
||||
Util::string_printf(msg, "Done %ld ms",
|
||||
(Timer::GetCurrentTimeMicros() - start) / 1000);
|
||||
|
||||
@@ -184,7 +184,7 @@ void StatCache::Node::touchLocked(bool invalidate /* = true */) {
|
||||
++it) {
|
||||
if (invalidate && m_valid) {
|
||||
TRACE(1, "StatCache: invalidate path '%s'\n", it->first.c_str());
|
||||
HPHP::VM::invalidatePath(it->first);
|
||||
HPHP::invalidatePath(it->first);
|
||||
}
|
||||
if (removePaths) {
|
||||
m_statCache.removePath(it->first, this);
|
||||
@@ -197,7 +197,7 @@ void StatCache::Node::touchLocked(bool invalidate /* = true */) {
|
||||
NameMap::const_iterator it2 = m_paths.find(it->first);
|
||||
if (it2 == m_paths.end()) {
|
||||
TRACE(1, "StatCache: invalidate link path '%s'\n", it->first.c_str());
|
||||
HPHP::VM::invalidatePath(it->first);
|
||||
HPHP::invalidatePath(it->first);
|
||||
}
|
||||
}
|
||||
if (removePaths) {
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
namespace HPHP {
|
||||
namespace Stats {
|
||||
|
||||
using namespace HPHP::VM::Transl;
|
||||
using namespace HPHP::Transl;
|
||||
|
||||
TRACE_SET_MOD(stats);
|
||||
|
||||
|
||||
+10
-10
@@ -22,7 +22,7 @@
|
||||
|
||||
namespace HPHP {
|
||||
|
||||
namespace VM { namespace Transl { class X64Assembler; } }
|
||||
namespace Transl { class X64Assembler; }
|
||||
namespace Stats {
|
||||
|
||||
#include "runtime/vm/stats-opcodeDef.h"
|
||||
@@ -214,7 +214,7 @@ static inline void inc(StatCounter stat, int n = 1) {
|
||||
}
|
||||
|
||||
static inline StatCounter opcodeToStatCounter(Opcode opc) {
|
||||
assert(VM::OpLowInvalid == 0);
|
||||
assert(OpLowInvalid == 0);
|
||||
return StatCounter(Instr_InterpBBLowInvalid + STATS_PER_OPCODE * opc);
|
||||
}
|
||||
|
||||
@@ -223,34 +223,34 @@ static inline void incOp(Opcode opc) {
|
||||
}
|
||||
|
||||
static inline StatCounter opcodeToTranslStatCounter(Opcode opc) {
|
||||
assert(VM::OpLowInvalid == 0);
|
||||
assert(OpLowInvalid == 0);
|
||||
return StatCounter(Instr_TranslLowInvalid + STATS_PER_OPCODE * opc);
|
||||
}
|
||||
|
||||
static inline StatCounter opcodeToIRPreStatCounter(Opcode opc) {
|
||||
assert(VM::OpLowInvalid == 0);
|
||||
assert(OpLowInvalid == 0);
|
||||
return StatCounter(Instr_TranslIRPreLowInvalid + STATS_PER_OPCODE * opc);
|
||||
}
|
||||
|
||||
static inline StatCounter opcodeToIRPostStatCounter(Opcode opc) {
|
||||
assert(VM::OpLowInvalid == 0);
|
||||
assert(OpLowInvalid == 0);
|
||||
return StatCounter(Instr_TranslIRPostLowInvalid + STATS_PER_OPCODE * opc);
|
||||
}
|
||||
|
||||
// Both emitIncs use r10.
|
||||
extern void emitInc(VM::Transl::X64Assembler& a,
|
||||
extern void emitInc(Transl::X64Assembler& a,
|
||||
uint64_t* tl_table,
|
||||
uint index,
|
||||
int n = 1,
|
||||
VM::Transl::ConditionCode cc = VM::Transl::CC_None,
|
||||
Transl::ConditionCode cc = Transl::CC_None,
|
||||
bool force = false);
|
||||
inline void emitInc(VM::Transl::X64Assembler& a, StatCounter stat, int n = 1,
|
||||
VM::Transl::ConditionCode cc = VM::Transl::CC_None,
|
||||
inline void emitInc(Transl::X64Assembler& a, StatCounter stat, int n = 1,
|
||||
Transl::ConditionCode cc = Transl::CC_None,
|
||||
bool force = false) {
|
||||
emitInc(a, &tl_counters[0], stat, n, cc, force);
|
||||
}
|
||||
|
||||
extern void emitIncTranslOp(VM::Transl::X64Assembler& a, Opcode opc,
|
||||
extern void emitIncTranslOp(Transl::X64Assembler& a, Opcode opc,
|
||||
bool force = false);
|
||||
extern void init();
|
||||
extern void dump();
|
||||
|
||||
@@ -136,7 +136,7 @@ uint32_t StringData::DefCnsHandle(const StringData* cnsName, bool persistent) {
|
||||
StringDataMap::iterator it = s_stringDataMap->find(cnsName);
|
||||
assert(it != s_stringDataMap->end());
|
||||
if (!it->second) {
|
||||
VM::Transl::TargetCache::allocConstant(&it->second, persistent);
|
||||
Transl::TargetCache::allocConstant(&it->second, persistent);
|
||||
}
|
||||
return it->second;
|
||||
}
|
||||
@@ -144,13 +144,13 @@ uint32_t StringData::DefCnsHandle(const StringData* cnsName, bool persistent) {
|
||||
Array StringData::GetConstants() {
|
||||
// Return an array of all defined constants.
|
||||
assert(s_stringDataMap);
|
||||
Array a(VM::Transl::TargetCache::s_constants);
|
||||
Array a(Transl::TargetCache::s_constants);
|
||||
|
||||
for (StringDataMap::const_iterator it = s_stringDataMap->begin();
|
||||
it != s_stringDataMap->end(); ++it) {
|
||||
if (it->second) {
|
||||
TypedValue& tv =
|
||||
VM::Transl::TargetCache::handleToRef<TypedValue>(it->second);
|
||||
Transl::TargetCache::handleToRef<TypedValue>(it->second);
|
||||
if (tv.m_type != KindOfUninit) {
|
||||
StrNR key(const_cast<StringData*>(it->first));
|
||||
a.set(key, tvAsVariant(&tv), true);
|
||||
|
||||
@@ -53,7 +53,7 @@ ThreadInfo::ThreadInfo()
|
||||
m_pendingException = nullptr;
|
||||
m_coverage = new CodeCoverage();
|
||||
|
||||
VM::Transl::TargetCache::threadInit();
|
||||
Transl::TargetCache::threadInit();
|
||||
onSessionInit();
|
||||
|
||||
Lock lock(s_thread_info_mutex);
|
||||
@@ -66,7 +66,7 @@ ThreadInfo::~ThreadInfo() {
|
||||
Lock lock(s_thread_info_mutex);
|
||||
s_thread_infos.erase(this);
|
||||
delete m_coverage;
|
||||
VM::Transl::TargetCache::threadExit();
|
||||
Transl::TargetCache::threadExit();
|
||||
}
|
||||
|
||||
bool ThreadInfo::valid(ThreadInfo* info) {
|
||||
@@ -116,12 +116,12 @@ void ThreadInfo::setPendingException(Exception* e) {
|
||||
|
||||
void ThreadInfo::onSessionExit() {
|
||||
m_reqInjectionData.reset();
|
||||
VM::Transl::TargetCache::requestExit();
|
||||
Transl::TargetCache::requestExit();
|
||||
}
|
||||
|
||||
void RequestInjectionData::onSessionInit() {
|
||||
VM::Transl::TargetCache::requestInit();
|
||||
cflagsPtr = VM::Transl::TargetCache::conditionFlagsPtr();
|
||||
Transl::TargetCache::requestInit();
|
||||
cflagsPtr = Transl::TargetCache::conditionFlagsPtr();
|
||||
reset();
|
||||
started = time(0);
|
||||
}
|
||||
@@ -140,7 +140,7 @@ void RequestInjectionData::updateJit() {
|
||||
!(RuntimeOption::EvalJitDisabledByHphpd && m_debugger) &&
|
||||
!m_debuggerIntr &&
|
||||
!m_coverage &&
|
||||
!VM::shouldProfile();
|
||||
!shouldProfile();
|
||||
}
|
||||
|
||||
void RequestInjectionData::setMemExceededFlag() {
|
||||
|
||||
@@ -91,7 +91,7 @@ public:
|
||||
bool instanceof(CStrRef s) const {
|
||||
return m_px && m_px->o_instanceof(s);
|
||||
}
|
||||
bool instanceof(const VM::Class* cls) const {
|
||||
bool instanceof(const Class* cls) const {
|
||||
return m_px && m_px->instanceof(cls);
|
||||
}
|
||||
|
||||
|
||||
@@ -446,7 +446,7 @@ bool Variant::instanceof(CStrRef s) const {
|
||||
}
|
||||
|
||||
HOT_FUNC
|
||||
bool Variant::instanceof(VM::Class* cls) const {
|
||||
bool Variant::instanceof(Class* cls) const {
|
||||
if (m_type == KindOfObject) {
|
||||
assert(m_data.pobj);
|
||||
return m_data.pobj->instanceof(cls);
|
||||
@@ -3035,7 +3035,7 @@ void Variant::unserialize(VariableUnserializer *uns,
|
||||
throw Exception("Expected '{' but got '%c'", sep);
|
||||
}
|
||||
|
||||
VM::Class* cls = VM::Unit::loadClass(clsName.get());
|
||||
Class* cls = Unit::loadClass(clsName.get());
|
||||
Object obj;
|
||||
if (RuntimeOption::UnserializationWhitelistCheck &&
|
||||
!uns->isWhitelistedClass(clsName)) {
|
||||
@@ -3050,12 +3050,12 @@ void Variant::unserialize(VariableUnserializer *uns,
|
||||
}
|
||||
}
|
||||
if (cls) {
|
||||
obj = VM::Instance::newInstance(cls);
|
||||
obj = Instance::newInstance(cls);
|
||||
if (UNLIKELY(cls == c_Pair::s_cls && size != 2)) {
|
||||
throw Exception("Pair objects must have exactly 2 elements");
|
||||
}
|
||||
} else {
|
||||
obj = VM::Instance::newInstance(
|
||||
obj = Instance::newInstance(
|
||||
SystemLib::s___PHP_Incomplete_ClassClass);
|
||||
obj->o_set(s_PHP_Incomplete_Class_Name, clsName);
|
||||
}
|
||||
|
||||
@@ -487,7 +487,7 @@ class Variant : private TypedValue {
|
||||
}
|
||||
bool isResource() const;
|
||||
bool instanceof(CStrRef s) const;
|
||||
bool instanceof(VM::Class* cls) const;
|
||||
bool instanceof(Class* cls) const;
|
||||
|
||||
/**
|
||||
* Whether or not there are at least two variables that are strongly bound.
|
||||
|
||||
@@ -375,9 +375,7 @@ inline RefResult ref(Variant& v) {
|
||||
return *(RefResultValue*)&v;
|
||||
}
|
||||
|
||||
namespace VM {
|
||||
class Class;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// code injection classes
|
||||
@@ -460,13 +458,11 @@ public:
|
||||
void onSessionInit();
|
||||
};
|
||||
|
||||
namespace VM {
|
||||
class GlobalNameValueTableWrapper;
|
||||
}
|
||||
class ObjectAllocatorBase;
|
||||
class Profiler;
|
||||
class CodeCoverage;
|
||||
typedef VM::GlobalNameValueTableWrapper GlobalVariables;
|
||||
typedef GlobalNameValueTableWrapper GlobalVariables;
|
||||
|
||||
int object_alloc_size_to_index(size_t);
|
||||
size_t object_alloc_index_to_size(int);
|
||||
|
||||
@@ -80,7 +80,7 @@ InterruptSite::InterruptSite(bool hardBreakPoint, CVarRef e)
|
||||
m_line0(0), m_char0(0), m_line1(0), m_char1(0),
|
||||
m_unit(nullptr), m_valid(false), m_funcEntry(false) {
|
||||
TRACE(2, "InterruptSite::InterruptSite\n");
|
||||
VM::Transl::VMRegAnchor _;
|
||||
Transl::VMRegAnchor _;
|
||||
#define bail_on(c) if (c) { return; }
|
||||
VMExecutionContext* context = g_vmContext;
|
||||
ActRec *fp = context->getFP();
|
||||
@@ -113,7 +113,7 @@ InterruptSite::InterruptSite(bool hardBreakPoint, CVarRef e)
|
||||
|
||||
if (g_context->getDebuggerSmallStep()) {
|
||||
// get offset range for the pc only
|
||||
VM::OffsetRange range;
|
||||
OffsetRange range;
|
||||
if (m_unit->getOffsetRange(offset, range)) {
|
||||
m_offsetRangeVec.push_back(range);
|
||||
}
|
||||
@@ -835,13 +835,13 @@ bool BreakPointInfo::MatchClass(const char *fcls, const std::string &bcls,
|
||||
}
|
||||
|
||||
StackStringData sdBClsName(bcls.c_str());
|
||||
VM::Class* clsB = VM::Unit::lookupClass(&sdBClsName);
|
||||
Class* clsB = Unit::lookupClass(&sdBClsName);
|
||||
StackStringData sdFClsName(fcls);
|
||||
VM::Class* clsF = VM::Unit::lookupClass(&sdFClsName);
|
||||
Class* clsF = Unit::lookupClass(&sdFClsName);
|
||||
if (!clsB) return false;
|
||||
if (clsB == clsF) return true;
|
||||
StackStringData sdFuncName(func);
|
||||
VM::Func* f = clsB->lookupMethod(&sdFuncName);
|
||||
Func* f = clsB->lookupMethod(&sdFuncName);
|
||||
if (!f) return false;
|
||||
return (f->baseCls() == clsF);
|
||||
}
|
||||
|
||||
@@ -56,11 +56,11 @@ public:
|
||||
std::string &url() const { return m_url; }
|
||||
std::string desc() const;
|
||||
|
||||
const VM::SourceLoc *getSourceLoc() const { return &m_sourceLoc; }
|
||||
const VM::OffsetRangeVec& getCurOffsetRange() const {
|
||||
const SourceLoc *getSourceLoc() const { return &m_sourceLoc; }
|
||||
const OffsetRangeVec& getCurOffsetRange() const {
|
||||
return m_offsetRangeVec;
|
||||
}
|
||||
const VM::Unit* getUnit() const { return m_unit; }
|
||||
const Unit* getUnit() const { return m_unit; }
|
||||
|
||||
bool valid() const { return m_valid; }
|
||||
bool funcEntry() const { return m_funcEntry; }
|
||||
@@ -79,9 +79,9 @@ private:
|
||||
int32_t m_line1;
|
||||
int32_t m_char1;
|
||||
|
||||
VM::SourceLoc m_sourceLoc;
|
||||
VM::OffsetRangeVec m_offsetRangeVec;
|
||||
VM::Unit* m_unit;
|
||||
SourceLoc m_sourceLoc;
|
||||
OffsetRangeVec m_offsetRangeVec;
|
||||
Unit* m_unit;
|
||||
bool m_valid;
|
||||
bool m_funcEntry;
|
||||
};
|
||||
|
||||
@@ -68,8 +68,8 @@ void CmdEval::setClientOutput(DebuggerClient *client) {
|
||||
}
|
||||
|
||||
bool CmdEval::onServer(DebuggerProxy *proxy) {
|
||||
VM::PCFilter* locSave = g_vmContext->m_lastLocFilter;
|
||||
g_vmContext->m_lastLocFilter = new VM::PCFilter();
|
||||
PCFilter* locSave = g_vmContext->m_lastLocFilter;
|
||||
g_vmContext->m_lastLocFilter = new PCFilter();
|
||||
g_vmContext->setDebuggerBypassCheck(m_bypassAccessCheck);
|
||||
DebuggerProxy::ExecutePHP(m_body, m_output, !proxy->isLocal(), m_frame);
|
||||
g_vmContext->setDebuggerBypassCheck(false);
|
||||
|
||||
@@ -85,7 +85,7 @@ void CmdFlowControl::installLocationFilterForLine(InterruptSite *site) {
|
||||
if (g_vmContext->m_lastLocFilter) {
|
||||
g_vmContext->m_lastLocFilter->clear();
|
||||
} else {
|
||||
g_vmContext->m_lastLocFilter = new VM::PCFilter();
|
||||
g_vmContext->m_lastLocFilter = new PCFilter();
|
||||
}
|
||||
auto offsets = site->getCurOffsetRange();
|
||||
if (Trace::moduleEnabled(Trace::debugger, 5)) {
|
||||
|
||||
@@ -82,7 +82,7 @@ protected:
|
||||
int m_vmDepth;
|
||||
std::string m_loc; // last break's source location
|
||||
Offset m_stepOutOffset;
|
||||
HPHP::VM::Unit *m_stepOutUnit;
|
||||
HPHP::Unit *m_stepOutUnit;
|
||||
|
||||
private:
|
||||
int16_t m_count;
|
||||
|
||||
@@ -161,12 +161,12 @@ void CmdInstrument::readFromTable(DebuggerProxy *proxy) {
|
||||
return;
|
||||
}
|
||||
// Bytecode address
|
||||
VM::InjectionTableInt64* tablePC =
|
||||
proxy->getInjTables()->getInt64Table(VM::InstHookTypeBCPC);
|
||||
InjectionTableInt64* tablePC =
|
||||
proxy->getInjTables()->getInt64Table(InstHookTypeBCPC);
|
||||
if (tablePC) {
|
||||
for (VM::InjectionTableInt64::const_iterator it = tablePC->begin();
|
||||
for (InjectionTableInt64::const_iterator it = tablePC->begin();
|
||||
it != tablePC->end(); ++it) {
|
||||
const VM::Injection* inj = it->second;
|
||||
const Injection* inj = it->second;
|
||||
InstPointInfoPtr ipi(new InstPointInfo());
|
||||
ipi->m_valid = true;
|
||||
if (inj->m_desc) {
|
||||
@@ -178,12 +178,12 @@ void CmdInstrument::readFromTable(DebuggerProxy *proxy) {
|
||||
m_ips.push_back(ipi);
|
||||
}
|
||||
}
|
||||
VM::InjectionTableSD* tableFEntry =
|
||||
proxy->getInjTables()->getSDTable(VM::InstHookTypeFuncEntry);
|
||||
InjectionTableSD* tableFEntry =
|
||||
proxy->getInjTables()->getSDTable(InstHookTypeFuncEntry);
|
||||
if (tableFEntry) {
|
||||
for (VM::InjectionTableSD::const_iterator it = tableFEntry->begin();
|
||||
for (InjectionTableSD::const_iterator it = tableFEntry->begin();
|
||||
it != tableFEntry->end(); ++it) {
|
||||
const VM::Injection* inj = it->second;
|
||||
const Injection* inj = it->second;
|
||||
InstPointInfoPtr ipi(new InstPointInfo());
|
||||
ipi->m_valid = true;
|
||||
if (inj->m_desc) {
|
||||
@@ -198,15 +198,15 @@ void CmdInstrument::readFromTable(DebuggerProxy *proxy) {
|
||||
|
||||
void CmdInstrument::validateAndWriteToTable(DebuggerProxy *proxy) {
|
||||
if (!proxy->getInjTables()) {
|
||||
proxy->setInjTables(new VM::InjectionTables());
|
||||
proxy->setInjTables(new InjectionTables());
|
||||
}
|
||||
VM::InjectionTableInt64* tablePC = nullptr;
|
||||
VM::InjectionTableSD* tableFEntry = nullptr;
|
||||
InjectionTableInt64* tablePC = nullptr;
|
||||
InjectionTableSD* tableFEntry = nullptr;
|
||||
|
||||
for (int i = 0; i < (int)m_ips.size(); i++) {
|
||||
InstPointInfoPtr ipi = m_ips[i];
|
||||
const VM::Injection* inj =
|
||||
VM::InjectionCache::GetInjection(ipi->m_code, ipi->m_desc);
|
||||
const Injection* inj =
|
||||
InjectionCache::GetInjection(ipi->m_code, ipi->m_desc);
|
||||
if (!inj) { // error in the code
|
||||
continue;
|
||||
}
|
||||
@@ -218,24 +218,24 @@ void CmdInstrument::validateAndWriteToTable(DebuggerProxy *proxy) {
|
||||
continue;
|
||||
}
|
||||
if (tablePC == nullptr) {
|
||||
tablePC = new VM::InjectionTableInt64();
|
||||
tablePC = new InjectionTableInt64();
|
||||
}
|
||||
ipi->m_valid = true;
|
||||
(*tablePC)[(int64_t)pc] = inj;
|
||||
}
|
||||
if (ipi->m_locType == InstPointInfo::LocFuncEntry) {
|
||||
StackStringData sd(ipi->m_func.c_str(), ipi->m_func.size(), AttachLiteral);
|
||||
const StringData* sdCache = VM::InjectionCache::GetStringData(&sd);
|
||||
const StringData* sdCache = InjectionCache::GetStringData(&sd);
|
||||
if (tableFEntry == nullptr) {
|
||||
tableFEntry = new VM::InjectionTableSD();
|
||||
tableFEntry = new InjectionTableSD();
|
||||
}
|
||||
ipi->m_valid = true;
|
||||
(*tableFEntry)[sdCache] = inj;
|
||||
}
|
||||
}
|
||||
|
||||
proxy->getInjTables()->setInt64Table(VM::InstHookTypeBCPC, tablePC);
|
||||
proxy->getInjTables()->setSDTable(VM::InstHookTypeFuncEntry, tableFEntry);
|
||||
proxy->getInjTables()->setInt64Table(InstHookTypeBCPC, tablePC);
|
||||
proxy->getInjTables()->setSDTable(InstHookTypeFuncEntry, tableFEntry);
|
||||
|
||||
proxy->writeInjTablesToThread();
|
||||
}
|
||||
|
||||
@@ -374,8 +374,8 @@ void CmdPrint::setClientOutput(DebuggerClient *client) {
|
||||
}
|
||||
|
||||
bool CmdPrint::onServer(DebuggerProxy *proxy) {
|
||||
VM::PCFilter* locSave = g_vmContext->m_lastLocFilter;
|
||||
g_vmContext->m_lastLocFilter = new VM::PCFilter();
|
||||
PCFilter* locSave = g_vmContext->m_lastLocFilter;
|
||||
g_vmContext->m_lastLocFilter = new PCFilter();
|
||||
g_vmContext->setDebuggerBypassCheck(m_bypassAccessCheck);
|
||||
{
|
||||
EvalBreakControl eval(m_noBreak);
|
||||
|
||||
@@ -218,7 +218,7 @@ bool Debugger::InterruptException(CVarRef e) {
|
||||
if (RuntimeOption::EnableDebugger) {
|
||||
ThreadInfo *ti = ThreadInfo::s_threadInfo.getNoCheck();
|
||||
if (ti->m_reqInjectionData.getDebugger()) {
|
||||
HPHP::VM::Transl::VMRegAnchor _;
|
||||
HPHP::Transl::VMRegAnchor _;
|
||||
InterruptVMHook(ExceptionThrown, e);
|
||||
}
|
||||
}
|
||||
@@ -490,7 +490,7 @@ void Debugger::removeProxy(DebuggerProxyPtr proxy) {
|
||||
m_proxyMap.erase(dummySid);
|
||||
// Clear the debugger blacklist PC upon last detach if JIT is used
|
||||
if (RuntimeOption::EvalJit && countConnectedProxy() == 0) {
|
||||
VM::Transl::Translator::Get()->clearDbgBL();
|
||||
Transl::Translator::Get()->clearDbgBL();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -180,7 +180,7 @@ void DebuggerProxy::setBreakPoints(BreakPointInfoPtrVec &breakpoints) {
|
||||
}
|
||||
}
|
||||
}
|
||||
VM::phpSetBreakPointsInAllFiles(this); // Apply breakpoints to the code.
|
||||
phpSetBreakPointsInAllFiles(this); // Apply breakpoints to the code.
|
||||
}
|
||||
|
||||
void DebuggerProxy::getBreakPoints(BreakPointInfoPtrVec &breakpoints) {
|
||||
|
||||
@@ -106,8 +106,8 @@ public:
|
||||
void forceQuit();
|
||||
|
||||
// For instrumentation
|
||||
HPHP::VM::InjectionTables* getInjTables() const { return m_injTables; }
|
||||
void setInjTables(HPHP::VM::InjectionTables* tables) { m_injTables = tables;}
|
||||
HPHP::InjectionTables* getInjTables() const { return m_injTables; }
|
||||
void setInjTables(HPHP::InjectionTables* tables) { m_injTables = tables;}
|
||||
void readInjTablesFromThread();
|
||||
void writeInjTablesToThread();
|
||||
|
||||
@@ -153,7 +153,7 @@ private:
|
||||
int m_signum;
|
||||
|
||||
// For instrumentation
|
||||
HPHP::VM::InjectionTables* m_injTables;
|
||||
HPHP::InjectionTables* m_injTables;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -33,7 +33,7 @@ const uchar* InstPointInfo::lookupPC() {
|
||||
return nullptr;
|
||||
}
|
||||
PC pc = context->getPC();
|
||||
HPHP::VM::Unit *unit = fp->m_func->unit();
|
||||
HPHP::Unit *unit = fp->m_func->unit();
|
||||
if (!unit) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ std::set<string> FileRepository::s_names;
|
||||
|
||||
PhpFile::PhpFile(const string &fileName, const string &srcRoot,
|
||||
const string &relPath, const string &md5,
|
||||
HPHP::VM::Unit* unit)
|
||||
HPHP::Unit* unit)
|
||||
: m_refCount(0), m_id(0),
|
||||
m_profName(string("run_init::") + string(fileName)),
|
||||
m_fileName(fileName), m_srcRoot(srcRoot), m_relPath(relPath), m_md5(md5),
|
||||
@@ -55,7 +55,7 @@ PhpFile::~PhpFile() {
|
||||
if (m_unit != nullptr) {
|
||||
// Deleting a Unit can grab a low-ranked lock and we're probably
|
||||
// at a high rank right now
|
||||
VM::PendQ::defer(new VM::DeferredDeleter<VM::Unit>(m_unit));
|
||||
PendQ::defer(new DeferredDeleter<Unit>(m_unit));
|
||||
m_unit = nullptr;
|
||||
}
|
||||
}
|
||||
@@ -126,7 +126,7 @@ void FileRepository::onDelete(PhpFile *f) {
|
||||
delete f;
|
||||
}
|
||||
|
||||
void FileRepository::forEachUnit(VM::UnitVisitor& uit) {
|
||||
void FileRepository::forEachUnit(UnitVisitor& uit) {
|
||||
ReadLock lock(s_md5Lock);
|
||||
for (Md5FileMap::const_iterator it = s_md5Files.begin();
|
||||
it != s_md5Files.end(); ++it) {
|
||||
@@ -213,7 +213,7 @@ PhpFile *FileRepository::checkoutFile(StringData *rname,
|
||||
if (isNew) {
|
||||
acc->second = new PhpFileWrapper(s, ret);
|
||||
ret->incRef();
|
||||
ret->setId(VM::Transl::TargetCache::allocBit());
|
||||
ret->setId(Transl::TargetCache::allocBit());
|
||||
} else {
|
||||
PhpFile *f = acc->second->getPhpFile();
|
||||
if (f != ret) {
|
||||
@@ -246,7 +246,7 @@ bool FileRepository::findFile(const StringData *path, struct stat *s) {
|
||||
const StringData* spath = StringData::GetStaticString(path);
|
||||
UnitMd5Map::accessor acc;
|
||||
if (s_unitMd5Map.insert(acc, spath)) {
|
||||
bool present = VM::Repo::get().findFile(
|
||||
bool present = Repo::get().findFile(
|
||||
path->data(), SourceRootInfo::GetCurrentSourceRoot(), md5);
|
||||
acc->second.m_present = present;
|
||||
acc->second.m_unitMd5 = md5;
|
||||
@@ -373,7 +373,7 @@ bool FileRepository::readRepoMd5(const StringData *path,
|
||||
UnitMd5Map::accessor acc;
|
||||
path = StringData::GetStaticString(path);
|
||||
if (s_unitMd5Map.insert(acc, path)) {
|
||||
if (!VM::Repo::get().findFile(path->data(),
|
||||
if (!Repo::get().findFile(path->data(),
|
||||
SourceRootInfo::GetCurrentSourceRoot(),
|
||||
md5)) {
|
||||
acc->second.m_present = false;
|
||||
@@ -407,7 +407,7 @@ bool FileRepository::readFile(const StringData *name,
|
||||
PhpFile *FileRepository::readHhbc(const std::string &name,
|
||||
const FileInfo &fileInfo) {
|
||||
MD5 md5 = MD5(fileInfo.m_unitMd5.c_str());
|
||||
VM::Unit* u = VM::Repo::get().loadUnit(name, md5);
|
||||
Unit* u = Repo::get().loadUnit(name, md5);
|
||||
if (u != nullptr) {
|
||||
PhpFile *p = new PhpFile(name, fileInfo.m_srcRoot, fileInfo.m_relPath,
|
||||
fileInfo.m_md5, u);
|
||||
@@ -420,7 +420,7 @@ PhpFile *FileRepository::readHhbc(const std::string &name,
|
||||
PhpFile *FileRepository::parseFile(const std::string &name,
|
||||
const FileInfo &fileInfo) {
|
||||
MD5 md5 = MD5(fileInfo.m_unitMd5.c_str());
|
||||
VM::Unit* unit = compile_file(fileInfo.m_inputString->data(),
|
||||
Unit* unit = compile_file(fileInfo.m_inputString->data(),
|
||||
fileInfo.m_inputString->size(),
|
||||
md5, name.c_str());
|
||||
PhpFile *p = new PhpFile(name, fileInfo.m_srcRoot, fileInfo.m_relPath,
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include <runtime/base/string_util.h>
|
||||
|
||||
namespace HPHP {
|
||||
namespace VM {
|
||||
class Unit;
|
||||
|
||||
/* UnitVisitor: abstract interface for running code on each Unit. */
|
||||
@@ -37,7 +36,6 @@ public:
|
||||
virtual void operator()(Unit *u) = 0;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace HPHP {
|
||||
namespace Eval {
|
||||
@@ -55,7 +53,7 @@ class PhpFile {
|
||||
public:
|
||||
PhpFile(const std::string &fileName, const std::string &srcRoot,
|
||||
const std::string &relPath, const std::string &md5,
|
||||
HPHP::VM::Unit* unit);
|
||||
HPHP::Unit* unit);
|
||||
~PhpFile();
|
||||
void incRef();
|
||||
int decRef(int num = 1);
|
||||
@@ -66,7 +64,7 @@ public:
|
||||
const std::string &getSrcRoot() const { return m_srcRoot; }
|
||||
const std::string &getRelPath() const { return m_relPath; }
|
||||
const std::string &getMd5() const { return m_md5; }
|
||||
HPHP::VM::Unit* unit() const { return m_unit; }
|
||||
HPHP::Unit* unit() const { return m_unit; }
|
||||
int getId() const { return m_id; }
|
||||
void setId(int id);
|
||||
|
||||
@@ -78,7 +76,7 @@ private:
|
||||
std::string m_srcRoot;
|
||||
std::string m_relPath;
|
||||
std::string m_md5;
|
||||
HPHP::VM::Unit* m_unit;
|
||||
HPHP::Unit* m_unit;
|
||||
};
|
||||
|
||||
class PhpFileWrapper {
|
||||
@@ -157,7 +155,7 @@ public:
|
||||
static PhpFile *parseFile(const std::string &name, const FileInfo &fileInfo);
|
||||
static String translateFileName(StringData *file);
|
||||
static void onDelete(PhpFile *f);
|
||||
static void forEachUnit(VM::UnitVisitor& uit);
|
||||
static void forEachUnit(UnitVisitor& uit);
|
||||
static size_t getLoadedFiles();
|
||||
private:
|
||||
static ParsedFilesMap s_files;
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
namespace HPHP {
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
c_BlockableWaitHandle::c_BlockableWaitHandle(VM::Class* cb)
|
||||
c_BlockableWaitHandle::c_BlockableWaitHandle(Class* cb)
|
||||
: c_WaitableWaitHandle(cb), m_nextParent(nullptr) {
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace {
|
||||
StaticString s_continuation("Continuation");
|
||||
}
|
||||
|
||||
c_ContinuationWaitHandle::c_ContinuationWaitHandle(VM::Class* cb)
|
||||
c_ContinuationWaitHandle::c_ContinuationWaitHandle(Class* cb)
|
||||
: c_BlockableWaitHandle(cb), m_continuation(), m_child(), m_privData(),
|
||||
m_depth(0) {
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace {
|
||||
StaticString s_externalThreadEvent("<external-thread-event>");
|
||||
}
|
||||
|
||||
c_ExternalThreadEventWaitHandle::c_ExternalThreadEventWaitHandle(VM::Class *cb)
|
||||
c_ExternalThreadEventWaitHandle::c_ExternalThreadEventWaitHandle(Class *cb)
|
||||
: c_WaitableWaitHandle(cb) {
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace {
|
||||
}
|
||||
}
|
||||
|
||||
c_GenArrayWaitHandle::c_GenArrayWaitHandle(VM::Class* cb)
|
||||
c_GenArrayWaitHandle::c_GenArrayWaitHandle(Class* cb)
|
||||
: c_BlockableWaitHandle(cb), m_exception() {
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace {
|
||||
const int q_RescheduleWaitHandle$$QUEUE_DEFAULT = AsioContext::QUEUE_DEFAULT;
|
||||
const int q_RescheduleWaitHandle$$QUEUE_NO_PENDING_IO = AsioContext::QUEUE_NO_PENDING_IO;
|
||||
|
||||
c_RescheduleWaitHandle::c_RescheduleWaitHandle(VM::Class *cb)
|
||||
c_RescheduleWaitHandle::c_RescheduleWaitHandle(Class *cb)
|
||||
: c_WaitableWaitHandle(cb) {
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace {
|
||||
StaticString s_setResultToRef("<set-result-to-ref>");
|
||||
}
|
||||
|
||||
c_SetResultToRefWaitHandle::c_SetResultToRefWaitHandle(VM::Class* cb)
|
||||
c_SetResultToRefWaitHandle::c_SetResultToRefWaitHandle(Class* cb)
|
||||
: c_BlockableWaitHandle(cb), m_child(), m_ref() {
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace {
|
||||
StaticString s_staticException("<static-exception>");
|
||||
}
|
||||
|
||||
c_StaticExceptionWaitHandle::c_StaticExceptionWaitHandle(VM::Class* cb)
|
||||
c_StaticExceptionWaitHandle::c_StaticExceptionWaitHandle(Class* cb)
|
||||
: c_StaticWaitHandle(cb) {
|
||||
setState(STATE_FAILED);
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace {
|
||||
StaticString s_staticResult("<static-result>");
|
||||
}
|
||||
|
||||
c_StaticResultWaitHandle::c_StaticResultWaitHandle(VM::Class* cb)
|
||||
c_StaticResultWaitHandle::c_StaticResultWaitHandle(Class* cb)
|
||||
: c_StaticWaitHandle(cb) {
|
||||
setState(STATE_SUCCEEDED);
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
namespace HPHP {
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
c_StaticWaitHandle::c_StaticWaitHandle(VM::Class* cb)
|
||||
c_StaticWaitHandle::c_StaticWaitHandle(Class* cb)
|
||||
: c_WaitHandle(cb) {
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
namespace HPHP {
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
c_WaitHandle::c_WaitHandle(VM::Class* cb)
|
||||
c_WaitHandle::c_WaitHandle(Class* cb)
|
||||
: ExtObjectData(cb) {
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
namespace HPHP {
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
c_WaitableWaitHandle::c_WaitableWaitHandle(VM::Class* cb)
|
||||
c_WaitableWaitHandle::c_WaitableWaitHandle(Class* cb)
|
||||
: c_WaitHandle(cb)
|
||||
, m_creator(AsioSession::Get()->getCurrentWaitHandle())
|
||||
, m_firstParent(nullptr) {
|
||||
|
||||
@@ -63,7 +63,7 @@ const int64_t k_UCOL_STRENGTH = UCOL_STRENGTH;
|
||||
const int64_t k_UCOL_HIRAGANA_QUATERNARY_MODE = UCOL_HIRAGANA_QUATERNARY_MODE;
|
||||
const int64_t k_UCOL_NUMERIC_COLLATION = UCOL_NUMERIC_COLLATION;
|
||||
|
||||
using HPHP::VM::Transl::CallerFrame;
|
||||
using HPHP::Transl::CallerFrame;
|
||||
|
||||
#define getCheckedArrayRetType(input, fail, type) \
|
||||
Variant::TypedValueAccessor tva_##input = input.getTypedAccessor(); \
|
||||
|
||||
@@ -60,7 +60,7 @@ class c_WaitHandle : public ExtObjectData {
|
||||
DECLARE_CLASS(WaitHandle, WaitHandle, ObjectData)
|
||||
|
||||
// need to implement
|
||||
public: c_WaitHandle(VM::Class* cls = c_WaitHandle::s_cls);
|
||||
public: c_WaitHandle(Class* cls = c_WaitHandle::s_cls);
|
||||
public: ~c_WaitHandle();
|
||||
public: void t___construct();
|
||||
public: static void ti_setonjoincallback(CVarRef callback);
|
||||
@@ -113,7 +113,7 @@ class c_StaticWaitHandle : public c_WaitHandle {
|
||||
DECLARE_CLASS(StaticWaitHandle, StaticWaitHandle, WaitHandle)
|
||||
|
||||
// need to implement
|
||||
public: c_StaticWaitHandle(VM::Class* cls = c_StaticWaitHandle::s_cls);
|
||||
public: c_StaticWaitHandle(Class* cls = c_StaticWaitHandle::s_cls);
|
||||
public: ~c_StaticWaitHandle();
|
||||
public: void t___construct();
|
||||
|
||||
@@ -131,7 +131,7 @@ class c_StaticResultWaitHandle : public c_StaticWaitHandle {
|
||||
DECLARE_CLASS(StaticResultWaitHandle, StaticResultWaitHandle, StaticWaitHandle)
|
||||
|
||||
// need to implement
|
||||
public: c_StaticResultWaitHandle(VM::Class* cls = c_StaticResultWaitHandle::s_cls);
|
||||
public: c_StaticResultWaitHandle(Class* cls = c_StaticResultWaitHandle::s_cls);
|
||||
public: ~c_StaticResultWaitHandle();
|
||||
public: void t___construct();
|
||||
public: static Object ti_create(CVarRef result);
|
||||
@@ -153,7 +153,7 @@ class c_StaticExceptionWaitHandle : public c_StaticWaitHandle {
|
||||
DECLARE_CLASS(StaticExceptionWaitHandle, StaticExceptionWaitHandle, StaticWaitHandle)
|
||||
|
||||
// need to implement
|
||||
public: c_StaticExceptionWaitHandle(VM::Class* cls = c_StaticExceptionWaitHandle::s_cls);
|
||||
public: c_StaticExceptionWaitHandle(Class* cls = c_StaticExceptionWaitHandle::s_cls);
|
||||
public: ~c_StaticExceptionWaitHandle();
|
||||
public: void t___construct();
|
||||
public: static Object ti_create(CObjRef exception);
|
||||
@@ -179,7 +179,7 @@ class c_WaitableWaitHandle : public c_WaitHandle {
|
||||
DECLARE_CLASS(WaitableWaitHandle, WaitableWaitHandle, WaitHandle)
|
||||
|
||||
// need to implement
|
||||
public: c_WaitableWaitHandle(VM::Class* cls = c_WaitableWaitHandle::s_cls);
|
||||
public: c_WaitableWaitHandle(Class* cls = c_WaitableWaitHandle::s_cls);
|
||||
public: ~c_WaitableWaitHandle();
|
||||
public: void t___construct();
|
||||
public: int t_getcontextidx();
|
||||
@@ -230,7 +230,7 @@ class c_BlockableWaitHandle : public c_WaitableWaitHandle {
|
||||
DECLARE_CLASS(BlockableWaitHandle, BlockableWaitHandle, WaitableWaitHandle)
|
||||
|
||||
// need to implement
|
||||
public: c_BlockableWaitHandle(VM::Class* cls = c_BlockableWaitHandle::s_cls);
|
||||
public: c_BlockableWaitHandle(Class* cls = c_BlockableWaitHandle::s_cls);
|
||||
public: ~c_BlockableWaitHandle();
|
||||
public: void t___construct();
|
||||
|
||||
@@ -270,7 +270,7 @@ class c_ContinuationWaitHandle : public c_BlockableWaitHandle {
|
||||
DECLARE_CLASS(ContinuationWaitHandle, ContinuationWaitHandle, BlockableWaitHandle)
|
||||
|
||||
// need to implement
|
||||
public: c_ContinuationWaitHandle(VM::Class* cls = c_ContinuationWaitHandle::s_cls);
|
||||
public: c_ContinuationWaitHandle(Class* cls = c_ContinuationWaitHandle::s_cls);
|
||||
public: ~c_ContinuationWaitHandle();
|
||||
public: void t___construct();
|
||||
public: static void ti_setoncreatecallback(CVarRef callback);
|
||||
@@ -321,7 +321,7 @@ class c_GenArrayWaitHandle : public c_BlockableWaitHandle {
|
||||
DECLARE_CLASS(GenArrayWaitHandle, GenArrayWaitHandle, BlockableWaitHandle)
|
||||
|
||||
// need to implement
|
||||
public: c_GenArrayWaitHandle(VM::Class* cls = c_GenArrayWaitHandle::s_cls);
|
||||
public: c_GenArrayWaitHandle(Class* cls = c_GenArrayWaitHandle::s_cls);
|
||||
public: ~c_GenArrayWaitHandle();
|
||||
public: void t___construct();
|
||||
public: static void ti_setoncreatecallback(CVarRef callback);
|
||||
@@ -357,7 +357,7 @@ class c_SetResultToRefWaitHandle : public c_BlockableWaitHandle {
|
||||
DECLARE_CLASS(SetResultToRefWaitHandle, SetResultToRefWaitHandle, BlockableWaitHandle)
|
||||
|
||||
// need to implement
|
||||
public: c_SetResultToRefWaitHandle(VM::Class* cls = c_SetResultToRefWaitHandle::s_cls);
|
||||
public: c_SetResultToRefWaitHandle(Class* cls = c_SetResultToRefWaitHandle::s_cls);
|
||||
public: ~c_SetResultToRefWaitHandle();
|
||||
public: void t___construct();
|
||||
public: static void ti_setoncreatecallback(CVarRef callback);
|
||||
@@ -399,7 +399,7 @@ class c_RescheduleWaitHandle : public c_WaitableWaitHandle {
|
||||
DECLARE_CLASS(RescheduleWaitHandle, RescheduleWaitHandle, WaitableWaitHandle)
|
||||
|
||||
// need to implement
|
||||
public: c_RescheduleWaitHandle(VM::Class* cls = c_RescheduleWaitHandle::s_cls);
|
||||
public: c_RescheduleWaitHandle(Class* cls = c_RescheduleWaitHandle::s_cls);
|
||||
public: ~c_RescheduleWaitHandle();
|
||||
public: void t___construct();
|
||||
public: static Object ti_create(int queue, int priority);
|
||||
@@ -434,7 +434,7 @@ class c_ExternalThreadEventWaitHandle : public c_WaitableWaitHandle, public Swee
|
||||
DECLARE_CLASS(ExternalThreadEventWaitHandle, ExternalThreadEventWaitHandle, WaitableWaitHandle)
|
||||
|
||||
// need to implement
|
||||
public: c_ExternalThreadEventWaitHandle(VM::Class* cls = c_ExternalThreadEventWaitHandle::s_cls);
|
||||
public: c_ExternalThreadEventWaitHandle(Class* cls = c_ExternalThreadEventWaitHandle::s_cls);
|
||||
public: ~c_ExternalThreadEventWaitHandle();
|
||||
public: void t___construct();
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
|
||||
namespace HPHP {
|
||||
|
||||
using VM::Transl::CallerFrame;
|
||||
using VM::Transl::VMRegAnchor;
|
||||
using Transl::CallerFrame;
|
||||
using Transl::VMRegAnchor;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// helpers
|
||||
@@ -37,17 +37,17 @@ static String get_classname(CVarRef class_or_object) {
|
||||
}
|
||||
|
||||
static inline CStrRef ctxClassName() {
|
||||
VM::Class* ctx = g_vmContext->getContextClass();
|
||||
Class* ctx = g_vmContext->getContextClass();
|
||||
return ctx ? ctx->nameRef() : empty_string;
|
||||
}
|
||||
|
||||
static const VM::Class* get_cls(CVarRef class_or_object) {
|
||||
VM::Class* cls = NULL;
|
||||
static const Class* get_cls(CVarRef class_or_object) {
|
||||
Class* cls = NULL;
|
||||
if (class_or_object.is(KindOfObject)) {
|
||||
ObjectData* obj = class_or_object.toCObjRef().get();
|
||||
cls = obj->getVMClass();
|
||||
} else {
|
||||
cls = VM::Unit::loadClass(class_or_object.toString().get());
|
||||
cls = Unit::loadClass(class_or_object.toString().get());
|
||||
}
|
||||
return cls;
|
||||
}
|
||||
@@ -67,20 +67,20 @@ Array f_get_declared_traits() {
|
||||
}
|
||||
|
||||
bool f_class_exists(CStrRef class_name, bool autoload /* = true */) {
|
||||
return VM::Unit::classExists(class_name.get(), autoload, AttrNone);
|
||||
return Unit::classExists(class_name.get(), autoload, AttrNone);
|
||||
}
|
||||
|
||||
bool f_interface_exists(CStrRef interface_name, bool autoload /* = true */) {
|
||||
return VM::Unit::classExists(interface_name.get(), autoload,
|
||||
return Unit::classExists(interface_name.get(), autoload,
|
||||
AttrInterface);
|
||||
}
|
||||
|
||||
bool f_trait_exists(CStrRef trait_name, bool autoload /* = true */) {
|
||||
return VM::Unit::classExists(trait_name.get(), autoload, AttrTrait);
|
||||
return Unit::classExists(trait_name.get(), autoload, AttrTrait);
|
||||
}
|
||||
|
||||
Array f_get_class_methods(CVarRef class_or_object) {
|
||||
const VM::Class* cls = get_cls(class_or_object);
|
||||
const Class* cls = get_cls(class_or_object);
|
||||
if (!cls) return Array();
|
||||
VMRegAnchor _;
|
||||
|
||||
@@ -91,14 +91,14 @@ Array f_get_class_methods(CVarRef class_or_object) {
|
||||
}
|
||||
|
||||
Array vm_get_class_constants(CStrRef className) {
|
||||
HPHP::VM::Class* cls = HPHP::VM::Unit::loadClass(className.get());
|
||||
HPHP::Class* cls = HPHP::Unit::loadClass(className.get());
|
||||
if (cls == NULL) {
|
||||
return NEW(HphpArray)(0);
|
||||
}
|
||||
|
||||
size_t numConstants = cls->numConstants();
|
||||
HphpArray* retVal = NEW(HphpArray)(numConstants);
|
||||
const VM::Class::Const* consts = cls->constants();
|
||||
const Class::Const* consts = cls->constants();
|
||||
for (size_t i = 0; i < numConstants; i++) {
|
||||
// Note: hphpc doesn't include inherited constants in
|
||||
// get_class_constants(), so mimic that behavior
|
||||
@@ -121,29 +121,29 @@ Array f_get_class_constants(CStrRef class_name) {
|
||||
}
|
||||
|
||||
Array vm_get_class_vars(CStrRef className) {
|
||||
HPHP::VM::Class* cls = HPHP::VM::Unit::lookupClass(className.get());
|
||||
HPHP::Class* cls = HPHP::Unit::lookupClass(className.get());
|
||||
if (cls == NULL) {
|
||||
raise_error("Unknown class %s", className->data());
|
||||
}
|
||||
cls->initialize();
|
||||
|
||||
const VM::Class::SProp* sPropInfo = cls->staticProperties();
|
||||
const Class::SProp* sPropInfo = cls->staticProperties();
|
||||
const size_t numSProps = cls->numStaticProperties();
|
||||
const VM::Class::Prop* propInfo = cls->declProperties();
|
||||
const Class::Prop* propInfo = cls->declProperties();
|
||||
const size_t numDeclProps = cls->numDeclProperties();
|
||||
|
||||
// The class' instance property initialization template is in different
|
||||
// places, depending on whether it has any request-dependent initializers
|
||||
// (i.e. constants)
|
||||
const VM::Class::PropInitVec& declPropInitVec = cls->declPropInit();
|
||||
const VM::Class::PropInitVec* propVals = !cls->pinitVec().empty()
|
||||
const Class::PropInitVec& declPropInitVec = cls->declPropInit();
|
||||
const Class::PropInitVec* propVals = !cls->pinitVec().empty()
|
||||
? cls->getPropData() : &declPropInitVec;
|
||||
assert(propVals != NULL);
|
||||
assert(propVals->size() == numDeclProps);
|
||||
|
||||
// For visibility checks
|
||||
CallerFrame cf;
|
||||
HPHP::VM::Class* ctx = arGetContextClass(cf());
|
||||
HPHP::Class* ctx = arGetContextClass(cf());
|
||||
|
||||
HphpArray* ret = NEW(HphpArray)(numDeclProps + numSProps);
|
||||
|
||||
@@ -151,7 +151,7 @@ Array vm_get_class_vars(CStrRef className) {
|
||||
StringData* name = const_cast<StringData*>(propInfo[i].m_name);
|
||||
// Empty names are used for invisible/private parent properties; skip them
|
||||
assert(name->size() != 0);
|
||||
if (VM::Class::IsPropAccessible(propInfo[i], ctx)) {
|
||||
if (Class::IsPropAccessible(propInfo[i], ctx)) {
|
||||
const TypedValue* value = &((*propVals)[i]);
|
||||
ret->nvSet(name, value, false);
|
||||
}
|
||||
@@ -179,7 +179,7 @@ Variant f_get_class(CVarRef object /* = null_variant */) {
|
||||
// No arg passed.
|
||||
String ret;
|
||||
CallerFrame cf;
|
||||
HPHP::VM::Class* cls = arGetContextClassImpl<true>(cf());
|
||||
HPHP::Class* cls = arGetContextClassImpl<true>(cf());
|
||||
if (cls) {
|
||||
ret = CStrRef(cls->nameRef());
|
||||
}
|
||||
@@ -197,7 +197,7 @@ Variant f_get_class(CVarRef object /* = null_variant */) {
|
||||
Variant f_get_parent_class(CVarRef object /* = null_variant */) {
|
||||
if (!object.isInitialized()) {
|
||||
CallerFrame cf;
|
||||
HPHP::VM::Class* cls = arGetContextClass(cf());
|
||||
HPHP::Class* cls = arGetContextClass(cf());
|
||||
if (cls && cls->parent()) {
|
||||
return CStrRef(cls->parentRef());
|
||||
}
|
||||
@@ -213,7 +213,7 @@ Variant f_get_parent_class(CVarRef object /* = null_variant */) {
|
||||
return false;
|
||||
}
|
||||
|
||||
VM::Class* cls = VM::Unit::lookupClass(class_name.toString().get());
|
||||
Class* cls = Unit::lookupClass(class_name.toString().get());
|
||||
if (cls) {
|
||||
CStrRef parentClass = *(const String*)(&cls->parentRef());
|
||||
if (!parentClass.empty()) {
|
||||
@@ -229,10 +229,10 @@ static bool is_a_impl(CVarRef class_or_object, CStrRef class_name,
|
||||
return false;
|
||||
}
|
||||
|
||||
const VM::Class* cls = get_cls(class_or_object);
|
||||
const Class* cls = get_cls(class_or_object);
|
||||
if (!cls) return false;
|
||||
if (cls->attrs() & AttrTrait) return false;
|
||||
const VM::Class* other = VM::Unit::lookupClass(class_name.get());
|
||||
const Class* other = Unit::lookupClass(class_name.get());
|
||||
if (!other) return false;
|
||||
if (other->attrs() & AttrTrait) return false;
|
||||
if (other == cls) return !subclass_only;
|
||||
@@ -248,12 +248,12 @@ bool f_is_subclass_of(CVarRef class_or_object, CStrRef class_name, bool allow_st
|
||||
}
|
||||
|
||||
bool f_method_exists(CVarRef class_or_object, CStrRef method_name) {
|
||||
const VM::Class* cls = get_cls(class_or_object);
|
||||
const Class* cls = get_cls(class_or_object);
|
||||
if (!cls) return false;
|
||||
if (cls->lookupMethod(method_name.get()) != NULL) return true;
|
||||
if (cls->attrs() & AttrAbstract) {
|
||||
const VM::ClassSet& ifaces = cls->allInterfaces();
|
||||
for (VM::ClassSet::const_iterator it = ifaces.begin();
|
||||
const ClassSet& ifaces = cls->allInterfaces();
|
||||
for (ClassSet::const_iterator it = ifaces.begin();
|
||||
it != ifaces.end();
|
||||
++it) {
|
||||
if ((*it)->lookupMethod(method_name.get())) return true;
|
||||
@@ -275,7 +275,7 @@ Variant f_property_exists(CVarRef class_or_object, CStrRef property) {
|
||||
return Variant(Variant::nullInit);
|
||||
}
|
||||
|
||||
VM::Class* cls = VM::Unit::lookupClass(get_classname(class_or_object).get());
|
||||
Class* cls = Unit::lookupClass(get_classname(class_or_object).get());
|
||||
if (!cls) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
namespace HPHP {
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
c_Closure::c_Closure(VM::Class* cb) : ExtObjectData(cb),
|
||||
c_Closure::c_Closure(Class* cb) : ExtObjectData(cb),
|
||||
m_thisOrClass(nullptr), m_func(nullptr) {}
|
||||
c_Closure::~c_Closure() {
|
||||
// same as ar->hasThis()
|
||||
@@ -41,7 +41,7 @@ void c_Closure::t___construct() {
|
||||
*/
|
||||
c_Closure* c_Closure::init(int numArgs, ActRec* ar, TypedValue* sp) {
|
||||
static StringData* invokeName = StringData::GetStaticString("__invoke");
|
||||
VM::Func* invokeFunc = getVMClass()->lookupMethod(invokeName);
|
||||
Func* invokeFunc = getVMClass()->lookupMethod(invokeName);
|
||||
|
||||
if (invokeFunc->attrs() & AttrStatic) {
|
||||
// Only set the class for static closures
|
||||
@@ -56,7 +56,7 @@ c_Closure* c_Closure::init(int numArgs, ActRec* ar, TypedValue* sp) {
|
||||
}
|
||||
|
||||
// Change my __invoke's m_cls to be the same as my creator's
|
||||
VM::Class* scope = ar->m_func->cls();
|
||||
Class* scope = ar->m_func->cls();
|
||||
m_func = invokeFunc->cloneAndSetClass(scope);
|
||||
|
||||
// copy the props to instance variables
|
||||
@@ -94,7 +94,7 @@ HphpArray* c_Closure::getStaticLocals() {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
c_DummyClosure::c_DummyClosure(VM::Class* cb) :
|
||||
c_DummyClosure::c_DummyClosure(Class* cb) :
|
||||
ExtObjectData(cb) {
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ class c_Closure : public ExtObjectData {
|
||||
DECLARE_CLASS(Closure, Closure, ObjectData)
|
||||
|
||||
// need to implement
|
||||
public: c_Closure(VM::Class* cls = c_Closure::s_cls);
|
||||
public: c_Closure(Class* cls = c_Closure::s_cls);
|
||||
public: ~c_Closure();
|
||||
public: void t___construct();
|
||||
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
|
||||
c_Closure* init(int numArgs, ActRec* ar, TypedValue* sp);
|
||||
ObjectData* getThisOrClass() { return m_thisOrClass; }
|
||||
const VM::Func* getInvokeFunc() { return m_func; }
|
||||
const Func* getInvokeFunc() { return m_func; }
|
||||
HphpArray* getStaticLocals();
|
||||
TypedValue* getUseVars() { return propVec(); }
|
||||
int getNumUseVars() { return m_cls->numDeclProperties(); }
|
||||
@@ -60,7 +60,7 @@ protected:
|
||||
private:
|
||||
SmartPtr<HphpArray> m_VMStatics;
|
||||
ObjectData* m_thisOrClass;
|
||||
const VM::Func* m_func;
|
||||
const Func* m_func;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@@ -72,7 +72,7 @@ class c_DummyClosure : public ExtObjectData {
|
||||
DECLARE_CLASS(DummyClosure, DummyClosure, ObjectData)
|
||||
|
||||
// need to implement
|
||||
public: c_DummyClosure(VM::Class* cls = c_DummyClosure::s_cls);
|
||||
public: c_DummyClosure(Class* cls = c_DummyClosure::s_cls);
|
||||
public: ~c_DummyClosure();
|
||||
public: void t___construct();
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ static inline ArrayIter getArrayIterHelper(CVarRef v, size_t& sz) {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
c_Vector::c_Vector(VM::Class* cb) :
|
||||
c_Vector::c_Vector(Class* cb) :
|
||||
ExtObjectDataFlags<ObjectData::VectorAttrInit|
|
||||
ObjectData::UseGet|
|
||||
ObjectData::UseSet|
|
||||
@@ -824,7 +824,7 @@ void c_Vector::usort(CVarRef cmp_function) {
|
||||
}
|
||||
ElmUCompare<VectorValAccessor> comp;
|
||||
CallCtx ctx;
|
||||
VM::Transl::CallerFrame cf;
|
||||
Transl::CallerFrame cf;
|
||||
vm_decode_function(cmp_function, cf(), false, ctx);
|
||||
comp.ctx = &ctx;
|
||||
HPHP::Sort::sort(m_data, m_data + m_size, comp);
|
||||
@@ -940,7 +940,7 @@ void c_Vector::Unserialize(ObjectData* obj,
|
||||
}
|
||||
}
|
||||
|
||||
c_VectorIterator::c_VectorIterator(VM::Class* cb) :
|
||||
c_VectorIterator::c_VectorIterator(Class* cb) :
|
||||
ExtObjectData(cb) {
|
||||
}
|
||||
|
||||
@@ -987,7 +987,7 @@ void c_VectorIterator::t_rewind() {
|
||||
|
||||
static const char emptyMapSlot[sizeof(c_Map::Bucket)] = { 0 };
|
||||
|
||||
c_Map::c_Map(VM::Class* cb) :
|
||||
c_Map::c_Map(Class* cb) :
|
||||
ExtObjectDataFlags<ObjectData::MapAttrInit|
|
||||
ObjectData::UseGet|
|
||||
ObjectData::UseSet|
|
||||
@@ -2089,7 +2089,7 @@ do_unserialize:
|
||||
}
|
||||
}
|
||||
|
||||
c_MapIterator::c_MapIterator(VM::Class* cb) :
|
||||
c_MapIterator::c_MapIterator(Class* cb) :
|
||||
ExtObjectData(cb) {
|
||||
}
|
||||
|
||||
@@ -2160,7 +2160,7 @@ do { \
|
||||
|
||||
static const char emptyStableMapSlot[sizeof(c_StableMap::Bucket*)] = { 0 };
|
||||
|
||||
c_StableMap::c_StableMap(VM::Class* cb) :
|
||||
c_StableMap::c_StableMap(Class* cb) :
|
||||
ExtObjectDataFlags<ObjectData::StableMapAttrInit|
|
||||
ObjectData::UseGet|
|
||||
ObjectData::UseSet|
|
||||
@@ -3164,7 +3164,7 @@ void c_StableMap::ksort(int sort_flags, bool ascending) {
|
||||
preSort<acc_type>(buffer, acc_type(), false); \
|
||||
ElmUCompare<acc_type> comp; \
|
||||
CallCtx ctx; \
|
||||
VM::Transl::CallerFrame cf; \
|
||||
Transl::CallerFrame cf; \
|
||||
vm_decode_function(cmp_function, cf(), false, ctx); \
|
||||
comp.ctx = &ctx; \
|
||||
try { \
|
||||
@@ -3371,7 +3371,7 @@ do_unserialize:
|
||||
|
||||
#undef CONNECT_TO_GLOBAL_DLLIST
|
||||
|
||||
c_StableMapIterator::c_StableMapIterator(VM::Class* cb) :
|
||||
c_StableMapIterator::c_StableMapIterator(Class* cb) :
|
||||
ExtObjectData(cb) {
|
||||
}
|
||||
|
||||
@@ -3427,7 +3427,7 @@ void c_StableMapIterator::t_rewind() {
|
||||
|
||||
static const char emptySetSlot[sizeof(c_Set::Bucket)] = { 0 };
|
||||
|
||||
c_Set::c_Set(VM::Class* cb) :
|
||||
c_Set::c_Set(Class* cb) :
|
||||
ExtObjectDataFlags<ObjectData::SetAttrInit|
|
||||
ObjectData::UseGet|
|
||||
ObjectData::UseSet|
|
||||
@@ -4171,7 +4171,7 @@ void c_Set::Unserialize(ObjectData* obj,
|
||||
}
|
||||
}
|
||||
|
||||
c_SetIterator::c_SetIterator(VM::Class* cb) :
|
||||
c_SetIterator::c_SetIterator(Class* cb) :
|
||||
ExtObjectData(cb) {
|
||||
}
|
||||
|
||||
@@ -4218,7 +4218,7 @@ void c_SetIterator::t_rewind() {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
c_Pair::c_Pair(VM::Class* cb) :
|
||||
c_Pair::c_Pair(Class* cb) :
|
||||
ExtObjectDataFlags<ObjectData::PairAttrInit|
|
||||
ObjectData::UseGet|
|
||||
ObjectData::UseSet|
|
||||
@@ -4514,7 +4514,7 @@ void c_Pair::Unserialize(ObjectData* obj,
|
||||
tvAsVariant(&pair->elm1).unserialize(uns, Uns::ColValueMode);
|
||||
}
|
||||
|
||||
c_PairIterator::c_PairIterator(VM::Class* cb) :
|
||||
c_PairIterator::c_PairIterator(Class* cb) :
|
||||
ExtObjectData(cb) {
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ class c_Vector : public ExtObjectDataFlags<ObjectData::VectorAttrInit|
|
||||
DECLARE_CLASS(Vector, Vector, ObjectData)
|
||||
|
||||
public:
|
||||
explicit c_Vector(VM::Class* cls = c_Vector::s_cls);
|
||||
explicit c_Vector(Class* cls = c_Vector::s_cls);
|
||||
~c_Vector();
|
||||
void freeData();
|
||||
void t___construct(CVarRef iterable = null_variant);
|
||||
@@ -187,7 +187,7 @@ class c_VectorIterator : public ExtObjectData {
|
||||
DECLARE_CLASS(VectorIterator, VectorIterator, ObjectData)
|
||||
|
||||
public:
|
||||
explicit c_VectorIterator(VM::Class* cls = c_VectorIterator::s_cls);
|
||||
explicit c_VectorIterator(Class* cls = c_VectorIterator::s_cls);
|
||||
~c_VectorIterator();
|
||||
void t___construct();
|
||||
Variant t_current();
|
||||
@@ -217,7 +217,7 @@ class c_Map : public ExtObjectDataFlags<ObjectData::MapAttrInit|
|
||||
DECLARE_CLASS(Map, Map, ObjectData)
|
||||
|
||||
public:
|
||||
explicit c_Map(VM::Class* cls = c_Map::s_cls);
|
||||
explicit c_Map(Class* cls = c_Map::s_cls);
|
||||
~c_Map();
|
||||
void freeData();
|
||||
void t___construct(CVarRef iterable = null_variant);
|
||||
@@ -488,7 +488,7 @@ class c_MapIterator : public ExtObjectData {
|
||||
DECLARE_CLASS(MapIterator, MapIterator, ObjectData)
|
||||
|
||||
public:
|
||||
explicit c_MapIterator(VM::Class* cls = c_MapIterator::s_cls);
|
||||
explicit c_MapIterator(Class* cls = c_MapIterator::s_cls);
|
||||
~c_MapIterator();
|
||||
void t___construct();
|
||||
Variant t_current();
|
||||
@@ -518,7 +518,7 @@ class c_StableMap : public ExtObjectDataFlags<ObjectData::StableMapAttrInit|
|
||||
DECLARE_CLASS(StableMap, StableMap, ObjectData)
|
||||
|
||||
public:
|
||||
explicit c_StableMap(VM::Class* cls = c_StableMap::s_cls);
|
||||
explicit c_StableMap(Class* cls = c_StableMap::s_cls);
|
||||
~c_StableMap();
|
||||
void freeData();
|
||||
void t___construct(CVarRef iterable = null_variant);
|
||||
@@ -750,7 +750,7 @@ class c_StableMapIterator : public ExtObjectData {
|
||||
DECLARE_CLASS(StableMapIterator, StableMapIterator, ObjectData)
|
||||
|
||||
public:
|
||||
explicit c_StableMapIterator(VM::Class* cls = c_StableMapIterator::s_cls);
|
||||
explicit c_StableMapIterator(Class* cls = c_StableMapIterator::s_cls);
|
||||
~c_StableMapIterator();
|
||||
void t___construct();
|
||||
Variant t_current();
|
||||
@@ -782,7 +782,7 @@ class c_Set : public ExtObjectDataFlags<ObjectData::SetAttrInit|
|
||||
public:
|
||||
static const int32_t KindOfTombstone = -1;
|
||||
|
||||
explicit c_Set(VM::Class* cls = c_Set::s_cls);
|
||||
explicit c_Set(Class* cls = c_Set::s_cls);
|
||||
~c_Set();
|
||||
void freeData();
|
||||
void t___construct(CVarRef iterable = null_variant);
|
||||
@@ -973,7 +973,7 @@ class c_SetIterator : public ExtObjectData {
|
||||
DECLARE_CLASS(SetIterator, SetIterator, ObjectData)
|
||||
|
||||
public:
|
||||
explicit c_SetIterator(VM::Class* cls = c_SetIterator::s_cls);
|
||||
explicit c_SetIterator(Class* cls = c_SetIterator::s_cls);
|
||||
~c_SetIterator();
|
||||
void t___construct();
|
||||
Variant t_current();
|
||||
@@ -1003,7 +1003,7 @@ class c_Pair : public ExtObjectDataFlags<ObjectData::PairAttrInit|
|
||||
DECLARE_CLASS(Pair, Pair, ObjectData)
|
||||
|
||||
public:
|
||||
explicit c_Pair(VM::Class* cls = c_Pair::s_cls);
|
||||
explicit c_Pair(Class* cls = c_Pair::s_cls);
|
||||
~c_Pair();
|
||||
void t___construct();
|
||||
bool t_isempty();
|
||||
@@ -1115,7 +1115,7 @@ class c_PairIterator : public ExtObjectData {
|
||||
DECLARE_CLASS(PairIterator, PairIterator, ObjectData)
|
||||
|
||||
public:
|
||||
explicit c_PairIterator(VM::Class* cls = c_PairIterator::s_cls);
|
||||
explicit c_PairIterator(Class* cls = c_PairIterator::s_cls);
|
||||
~c_PairIterator();
|
||||
void t___construct();
|
||||
Variant t_current();
|
||||
|
||||
@@ -44,7 +44,7 @@ p_Continuation f_hphp_create_continuation(CStrRef clsname,
|
||||
|
||||
static StaticString s___cont__("__cont__");
|
||||
|
||||
c_Continuation::c_Continuation(VM::Class* cb) :
|
||||
c_Continuation::c_Continuation(Class* cb) :
|
||||
ExtObjectData(cb),
|
||||
m_index(-1LL),
|
||||
m_value(Variant::nullInit), m_received(Variant::nullInit),
|
||||
@@ -182,12 +182,12 @@ namespace {
|
||||
}
|
||||
|
||||
void c_Continuation::call_next() {
|
||||
const HPHP::VM::Func* func = m_cls->lookupMethod(s_next.get());
|
||||
const HPHP::Func* func = m_cls->lookupMethod(s_next.get());
|
||||
g_vmContext->invokeContFunc(func, this);
|
||||
}
|
||||
|
||||
void c_Continuation::call_send(TypedValue* v) {
|
||||
const HPHP::VM::Func* func = m_cls->lookupMethod(s_send.get());
|
||||
const HPHP::Func* func = m_cls->lookupMethod(s_send.get());
|
||||
g_vmContext->invokeContFunc(func, this, v);
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ void c_Continuation::call_raise(ObjectData* e) {
|
||||
assert(e);
|
||||
assert(e->instanceof(SystemLib::s_ExceptionClass));
|
||||
|
||||
const HPHP::VM::Func* func = m_cls->lookupMethod(s_raise.get());
|
||||
const HPHP::Func* func = m_cls->lookupMethod(s_raise.get());
|
||||
|
||||
TypedValue arg;
|
||||
arg.m_type = KindOfObject;
|
||||
@@ -206,7 +206,7 @@ void c_Continuation::call_raise(ObjectData* e) {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
c_DummyContinuation::c_DummyContinuation(VM::Class* cb) :
|
||||
c_DummyContinuation::c_DummyContinuation(Class* cb) :
|
||||
ExtObjectData(cb) {
|
||||
}
|
||||
|
||||
|
||||
@@ -42,15 +42,15 @@ class c_Continuation : public ExtObjectData {
|
||||
this_->m_vmFunc->numIterators()))(this_);
|
||||
}
|
||||
|
||||
explicit c_Continuation(VM::Class* cls = c_Continuation::s_cls);
|
||||
explicit c_Continuation(Class* cls = c_Continuation::s_cls);
|
||||
~c_Continuation();
|
||||
|
||||
public:
|
||||
void init(const VM::Func* vmFunc,
|
||||
void init(const Func* vmFunc,
|
||||
const StringData* origFuncName,
|
||||
ObjectData* thisPtr,
|
||||
ArrayData* args) noexcept {
|
||||
m_vmFunc = const_cast<VM::Func*>(vmFunc);
|
||||
m_vmFunc = const_cast<Func*>(vmFunc);
|
||||
assert(m_vmFunc);
|
||||
m_origFuncName = origFuncName;
|
||||
assert(m_origFuncName->isStatic());
|
||||
@@ -83,7 +83,7 @@ public:
|
||||
String t_getcalledclass();
|
||||
Variant t___clone();
|
||||
|
||||
static c_Continuation* alloc(VM::Class* cls, int nLocals, int nIters) {
|
||||
static c_Continuation* alloc(Class* cls, int nLocals, int nIters) {
|
||||
c_Continuation* cont =
|
||||
(c_Continuation*)ALLOCOBJSZ(sizeForLocalsAndIters(nLocals, nIters));
|
||||
new ((void *)cont) c_Continuation(cls);
|
||||
@@ -133,7 +133,7 @@ public:
|
||||
bool m_should_throw;
|
||||
|
||||
int m_localsOffset;
|
||||
VM::Func *m_vmFunc;
|
||||
Func *m_vmFunc;
|
||||
int64_t m_label;
|
||||
ActRec* m_arPtr;
|
||||
|
||||
@@ -165,7 +165,7 @@ class c_DummyContinuation : public ExtObjectData {
|
||||
DECLARE_CLASS(DummyContinuation, DummyContinuation, ObjectData)
|
||||
|
||||
// need to implement
|
||||
public: c_DummyContinuation(VM::Class* cls = c_DummyContinuation::s_cls);
|
||||
public: c_DummyContinuation(Class* cls = c_DummyContinuation::s_cls);
|
||||
public: ~c_DummyContinuation();
|
||||
public: void t___construct();
|
||||
public: Variant t_current();
|
||||
|
||||
@@ -54,7 +54,7 @@ const int64_t q_DateTimeZone$$PER_COUNTRY = 4096;
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// methods
|
||||
|
||||
c_DateTime::c_DateTime(VM::Class* cb) : ExtObjectData(cb) {
|
||||
c_DateTime::c_DateTime(Class* cb) : ExtObjectData(cb) {
|
||||
}
|
||||
|
||||
c_DateTime::~c_DateTime() {
|
||||
@@ -166,7 +166,7 @@ ObjectData *c_DateTime::clone() {
|
||||
return obj;
|
||||
}
|
||||
|
||||
c_DateTimeZone::c_DateTimeZone(VM::Class* cb) :
|
||||
c_DateTimeZone::c_DateTimeZone(Class* cb) :
|
||||
ExtObjectData(cb) {
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ ObjectData *c_DateTimeZone::clone() {
|
||||
return obj;
|
||||
}
|
||||
|
||||
c_DateInterval::c_DateInterval(VM::Class* cb) :
|
||||
c_DateInterval::c_DateInterval(Class* cb) :
|
||||
ExtObjectDataFlags<ObjectData::UseGet|ObjectData::UseSet>(cb) {
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ class c_DateTime : public ExtObjectData {
|
||||
DECLARE_CLASS(DateTime, DateTime, ObjectData)
|
||||
|
||||
// need to implement
|
||||
public: c_DateTime(VM::Class* cls = c_DateTime::s_cls);
|
||||
public: c_DateTime(Class* cls = c_DateTime::s_cls);
|
||||
public: ~c_DateTime();
|
||||
public: Object t_add(CObjRef interval);
|
||||
public: void t___construct(CStrRef time = "now",
|
||||
@@ -112,7 +112,7 @@ class c_DateTimeZone : public ExtObjectData {
|
||||
DECLARE_CLASS(DateTimeZone, DateTimeZone, ObjectData)
|
||||
|
||||
// need to implement
|
||||
public: c_DateTimeZone(VM::Class* cls = c_DateTimeZone::s_cls);
|
||||
public: c_DateTimeZone(Class* cls = c_DateTimeZone::s_cls);
|
||||
public: ~c_DateTimeZone();
|
||||
public: void t___construct(CStrRef timezone);
|
||||
public: Array t_getlocation();
|
||||
@@ -153,7 +153,7 @@ class c_DateInterval : public ExtObjectDataFlags<ObjectData::UseGet|ObjectData::
|
||||
DECLARE_CLASS(DateInterval, DateInterval, ObjectData)
|
||||
|
||||
// need to implement
|
||||
public: c_DateInterval(VM::Class* cls = c_DateInterval::s_cls);
|
||||
public: c_DateInterval(Class* cls = c_DateInterval::s_cls);
|
||||
public: ~c_DateInterval();
|
||||
public: void t___construct(CStrRef interval_spec);
|
||||
public: Variant t___get(Variant member);
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace HPHP {
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
using namespace Eval;
|
||||
using HPHP::VM::Transl::CallerFrame;
|
||||
using HPHP::Transl::CallerFrame;
|
||||
|
||||
const int64_t q_DebuggerClientCmdUser$$AUTO_COMPLETE_FILENAMES =
|
||||
DebuggerClient::AutoCompleteFileNames;
|
||||
@@ -157,7 +157,7 @@ Variant f_hphpd_client_ctrl(CStrRef name, CStrRef op) {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
c_DebuggerProxyCmdUser::c_DebuggerProxyCmdUser(VM::Class* cb) : ExtObjectData(cb) {
|
||||
c_DebuggerProxyCmdUser::c_DebuggerProxyCmdUser(Class* cb) : ExtObjectData(cb) {
|
||||
}
|
||||
|
||||
c_DebuggerProxyCmdUser::~c_DebuggerProxyCmdUser() {
|
||||
@@ -177,7 +177,7 @@ Variant c_DebuggerProxyCmdUser::t_send(CObjRef cmd) {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
c_DebuggerClientCmdUser::c_DebuggerClientCmdUser(VM::Class* cb) : ExtObjectData(cb) {
|
||||
c_DebuggerClientCmdUser::c_DebuggerClientCmdUser(Class* cb) : ExtObjectData(cb) {
|
||||
}
|
||||
|
||||
c_DebuggerClientCmdUser::~c_DebuggerClientCmdUser() {
|
||||
@@ -379,7 +379,7 @@ const int64_t q_DebuggerClient$$STATE_READY_FOR_COMMAND
|
||||
const int64_t q_DebuggerClient$$STATE_BUSY
|
||||
= DebuggerClient::StateBusy;
|
||||
|
||||
c_DebuggerClient::c_DebuggerClient(VM::Class* cb) : ExtObjectData(cb) {
|
||||
c_DebuggerClient::c_DebuggerClient(Class* cb) : ExtObjectData(cb) {
|
||||
m_client = NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ class c_DebuggerProxyCmdUser : public ExtObjectData {
|
||||
DECLARE_CLASS(DebuggerProxyCmdUser, DebuggerProxyCmdUser, ObjectData)
|
||||
|
||||
// need to implement
|
||||
public: c_DebuggerProxyCmdUser(VM::Class* cls = c_DebuggerProxyCmdUser::s_cls);
|
||||
public: c_DebuggerProxyCmdUser(Class* cls = c_DebuggerProxyCmdUser::s_cls);
|
||||
public: ~c_DebuggerProxyCmdUser();
|
||||
public: void t___construct();
|
||||
public: bool t_islocal();
|
||||
@@ -71,7 +71,7 @@ class c_DebuggerClientCmdUser : public ExtObjectData {
|
||||
DECLARE_CLASS(DebuggerClientCmdUser, DebuggerClientCmdUser, ObjectData)
|
||||
|
||||
// need to implement
|
||||
public: c_DebuggerClientCmdUser(VM::Class* cls = c_DebuggerClientCmdUser::s_cls);
|
||||
public: c_DebuggerClientCmdUser(Class* cls = c_DebuggerClientCmdUser::s_cls);
|
||||
public: ~c_DebuggerClientCmdUser();
|
||||
public: void t___construct();
|
||||
public: void t_quit();
|
||||
@@ -122,7 +122,7 @@ class c_DebuggerClient : public ExtObjectData, public Sweepable {
|
||||
DECLARE_CLASS(DebuggerClient, DebuggerClient, ObjectData)
|
||||
|
||||
// need to implement
|
||||
public: c_DebuggerClient(VM::Class* cls = c_DebuggerClient::s_cls);
|
||||
public: c_DebuggerClient(Class* cls = c_DebuggerClient::s_cls);
|
||||
public: ~c_DebuggerClient();
|
||||
public: void t___construct();
|
||||
public: int64_t t_getstate();
|
||||
|
||||
@@ -1904,7 +1904,7 @@ static PropertyAccessorMap domnode_properties_map
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
c_DOMNode::c_DOMNode(VM::Class* cb) :
|
||||
c_DOMNode::c_DOMNode(Class* cb) :
|
||||
ExtObjectDataFlags<ObjectData::UseGet|ObjectData::UseSet|ObjectData::UseIsset>(cb),m_node(NULL) {
|
||||
}
|
||||
|
||||
@@ -2462,7 +2462,7 @@ static PropertyAccessorMap domattr_properties_map
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
c_DOMAttr::c_DOMAttr(VM::Class* cb) : c_DOMNode(cb) {
|
||||
c_DOMAttr::c_DOMAttr(Class* cb) : c_DOMNode(cb) {
|
||||
}
|
||||
|
||||
c_DOMAttr::~c_DOMAttr() {
|
||||
@@ -2540,7 +2540,7 @@ static PropertyAccessorMap domcharacterdata_properties_map
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
c_DOMCharacterData::c_DOMCharacterData(VM::Class* cb) :
|
||||
c_DOMCharacterData::c_DOMCharacterData(Class* cb) :
|
||||
c_DOMNode(cb) {
|
||||
}
|
||||
|
||||
@@ -2698,7 +2698,7 @@ String c_DOMCharacterData::t_substringdata(int64_t offset, int64_t count) {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
c_DOMComment::c_DOMComment(VM::Class* cb) :
|
||||
c_DOMComment::c_DOMComment(Class* cb) :
|
||||
c_DOMCharacterData(cb) {
|
||||
}
|
||||
|
||||
@@ -2748,7 +2748,7 @@ static PropertyAccessorMap domtext_properties_map
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
c_DOMText::c_DOMText(VM::Class* cb) : c_DOMCharacterData(cb) {
|
||||
c_DOMText::c_DOMText(Class* cb) : c_DOMCharacterData(cb) {
|
||||
}
|
||||
|
||||
c_DOMText::~c_DOMText() {
|
||||
@@ -2818,7 +2818,7 @@ Variant c_DOMText::t_splittext(int64_t offset) {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
c_DOMCDATASection::c_DOMCDATASection(VM::Class* cb) :
|
||||
c_DOMCDATASection::c_DOMCDATASection(Class* cb) :
|
||||
c_DOMText(cb) {
|
||||
}
|
||||
|
||||
@@ -3009,7 +3009,7 @@ static PropertyAccessorMap domdocument_properties_map
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
c_DOMDocument::c_DOMDocument(VM::Class* cb) :
|
||||
c_DOMDocument::c_DOMDocument(Class* cb) :
|
||||
c_DOMNode(cb),
|
||||
m_formatoutput(false),
|
||||
m_validateonparse(false),
|
||||
@@ -3592,7 +3592,7 @@ Variant c_DOMDocument::t_xinclude(int64_t options /* = 0 */) {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
c_DOMDocumentFragment::c_DOMDocumentFragment(VM::Class* cb) :
|
||||
c_DOMDocumentFragment::c_DOMDocumentFragment(Class* cb) :
|
||||
c_DOMNode(cb) {
|
||||
}
|
||||
|
||||
@@ -3712,7 +3712,7 @@ static PropertyAccessorMap domdocumenttype_properties_map
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
c_DOMDocumentType::c_DOMDocumentType(VM::Class* cb) :
|
||||
c_DOMDocumentType::c_DOMDocumentType(Class* cb) :
|
||||
c_DOMNode(cb) {
|
||||
}
|
||||
|
||||
@@ -3766,7 +3766,7 @@ static PropertyAccessorMap domelement_properties_map
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
c_DOMElement::c_DOMElement(VM::Class* cb) : c_DOMNode(cb) {
|
||||
c_DOMElement::c_DOMElement(Class* cb) : c_DOMNode(cb) {
|
||||
}
|
||||
|
||||
c_DOMElement::~c_DOMElement() {
|
||||
@@ -4419,7 +4419,7 @@ static PropertyAccessorMap domentity_properties_map
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
c_DOMEntity::c_DOMEntity(VM::Class* cb) : c_DOMNode(cb) {
|
||||
c_DOMEntity::c_DOMEntity(Class* cb) : c_DOMNode(cb) {
|
||||
}
|
||||
|
||||
c_DOMEntity::~c_DOMEntity() {
|
||||
@@ -4443,7 +4443,7 @@ bool c_DOMEntity::t___isset(Variant name) {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
c_DOMEntityReference::c_DOMEntityReference(VM::Class* cb) :
|
||||
c_DOMEntityReference::c_DOMEntityReference(Class* cb) :
|
||||
c_DOMNode(cb) {
|
||||
}
|
||||
|
||||
@@ -4502,7 +4502,7 @@ static PropertyAccessorMap domnotation_properties_map
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
c_DOMNotation::c_DOMNotation(VM::Class* cb) :
|
||||
c_DOMNotation::c_DOMNotation(Class* cb) :
|
||||
c_DOMNode(cb) {
|
||||
}
|
||||
|
||||
@@ -4561,7 +4561,7 @@ static PropertyAccessorMap domprocessinginstruction_properties_map
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
c_DOMProcessingInstruction::c_DOMProcessingInstruction(VM::Class* cb) :
|
||||
c_DOMProcessingInstruction::c_DOMProcessingInstruction(Class* cb) :
|
||||
c_DOMNode(cb) {
|
||||
}
|
||||
|
||||
@@ -4632,7 +4632,7 @@ static PropertyAccessorMap domnamednodemap_properties_map
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
c_DOMNamedNodeMap::c_DOMNamedNodeMap(VM::Class* cb) :
|
||||
c_DOMNamedNodeMap::c_DOMNamedNodeMap(Class* cb) :
|
||||
ExtObjectDataFlags<ObjectData::UseGet|ObjectData::UseSet|
|
||||
ObjectData::UseIsset>(cb) {
|
||||
}
|
||||
@@ -4825,7 +4825,7 @@ static PropertyAccessorMap domnodelist_properties_map
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
c_DOMNodeList::c_DOMNodeList(VM::Class* cb) :
|
||||
c_DOMNodeList::c_DOMNodeList(Class* cb) :
|
||||
ExtObjectDataFlags<ObjectData::UseGet|ObjectData::UseSet|
|
||||
ObjectData::UseIsset>(cb) {
|
||||
}
|
||||
@@ -4906,7 +4906,7 @@ Variant c_DOMNodeList::t_getiterator() {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
c_DOMImplementation::c_DOMImplementation(VM::Class* cb)
|
||||
c_DOMImplementation::c_DOMImplementation(Class* cb)
|
||||
: ExtObjectData(cb) {
|
||||
}
|
||||
|
||||
@@ -5187,7 +5187,7 @@ static void dom_xpath_ext_function_object_php(xmlXPathParserContextPtr ctxt,
|
||||
dom_xpath_ext_function_php(ctxt, nargs, 2);
|
||||
}
|
||||
|
||||
c_DOMXPath::c_DOMXPath(VM::Class* cb) :
|
||||
c_DOMXPath::c_DOMXPath(Class* cb) :
|
||||
ExtObjectDataFlags<ObjectData::UseGet|ObjectData::UseSet|
|
||||
ObjectData::UseIsset>(cb),
|
||||
m_node(NULL), m_registerPhpFunctions(0) {
|
||||
@@ -5276,7 +5276,7 @@ Variant c_DOMXPath::t_registerphpfunctions(CVarRef funcs /* = null */) {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
c_DOMNodeIterator::c_DOMNodeIterator(VM::Class* cb) :
|
||||
c_DOMNodeIterator::c_DOMNodeIterator(Class* cb) :
|
||||
ExtObjectData(cb), m_objmap(NULL), m_iter(NULL), m_index(-1) {
|
||||
}
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ class c_DOMNode : public ExtObjectDataFlags<ObjectData::UseGet|ObjectData::UseSe
|
||||
DECLARE_CLASS(DOMNode, DOMNode, ObjectData)
|
||||
|
||||
// need to implement
|
||||
public: c_DOMNode(VM::Class* cls = c_DOMNode::s_cls);
|
||||
public: c_DOMNode(Class* cls = c_DOMNode::s_cls);
|
||||
public: ~c_DOMNode();
|
||||
public: void t___construct();
|
||||
public: Variant t_appendchild(CObjRef newnode);
|
||||
@@ -149,7 +149,7 @@ class c_DOMAttr : public c_DOMNode {
|
||||
DECLARE_CLASS(DOMAttr, DOMAttr, DOMNode)
|
||||
|
||||
// need to implement
|
||||
public: c_DOMAttr(VM::Class* cls = c_DOMAttr::s_cls);
|
||||
public: c_DOMAttr(Class* cls = c_DOMAttr::s_cls);
|
||||
public: ~c_DOMAttr();
|
||||
public: void t___construct(CStrRef name, CStrRef value = null_string);
|
||||
public: bool t_isid();
|
||||
@@ -170,7 +170,7 @@ class c_DOMCharacterData : public c_DOMNode {
|
||||
DECLARE_CLASS(DOMCharacterData, DOMCharacterData, DOMNode)
|
||||
|
||||
// need to implement
|
||||
public: c_DOMCharacterData(VM::Class* cls = c_DOMCharacterData::s_cls);
|
||||
public: c_DOMCharacterData(Class* cls = c_DOMCharacterData::s_cls);
|
||||
public: ~c_DOMCharacterData();
|
||||
public: void t___construct();
|
||||
public: bool t_appenddata(CStrRef arg);
|
||||
@@ -195,7 +195,7 @@ class c_DOMComment : public c_DOMCharacterData {
|
||||
DECLARE_CLASS(DOMComment, DOMComment, DOMCharacterData)
|
||||
|
||||
// need to implement
|
||||
public: c_DOMComment(VM::Class* cls = c_DOMComment::s_cls);
|
||||
public: c_DOMComment(Class* cls = c_DOMComment::s_cls);
|
||||
public: ~c_DOMComment();
|
||||
public: void t___construct(CStrRef value = null_string);
|
||||
|
||||
@@ -212,7 +212,7 @@ class c_DOMText : public c_DOMCharacterData {
|
||||
DECLARE_CLASS(DOMText, DOMText, DOMCharacterData)
|
||||
|
||||
// need to implement
|
||||
public: c_DOMText(VM::Class* cls = c_DOMText::s_cls);
|
||||
public: c_DOMText(Class* cls = c_DOMText::s_cls);
|
||||
public: ~c_DOMText();
|
||||
public: void t___construct(CStrRef value = null_string);
|
||||
public: bool t_iswhitespaceinelementcontent();
|
||||
@@ -234,7 +234,7 @@ class c_DOMCDATASection : public c_DOMText {
|
||||
DECLARE_CLASS(DOMCDATASection, DOMCDATASection, DOMText)
|
||||
|
||||
// need to implement
|
||||
public: c_DOMCDATASection(VM::Class* cls = c_DOMCDATASection::s_cls);
|
||||
public: c_DOMCDATASection(Class* cls = c_DOMCDATASection::s_cls);
|
||||
public: ~c_DOMCDATASection();
|
||||
public: void t___construct(CStrRef value);
|
||||
|
||||
@@ -251,7 +251,7 @@ class c_DOMDocument : public c_DOMNode, public Sweepable {
|
||||
DECLARE_CLASS(DOMDocument, DOMDocument, DOMNode)
|
||||
|
||||
// need to implement
|
||||
public: c_DOMDocument(VM::Class* cls = c_DOMDocument::s_cls);
|
||||
public: c_DOMDocument(Class* cls = c_DOMDocument::s_cls);
|
||||
public: ~c_DOMDocument();
|
||||
public: void t___construct(CStrRef version = null_string, CStrRef encoding = null_string);
|
||||
public: Variant t_createattribute(CStrRef name);
|
||||
@@ -313,7 +313,7 @@ class c_DOMDocumentFragment : public c_DOMNode {
|
||||
DECLARE_CLASS(DOMDocumentFragment, DOMDocumentFragment, DOMNode)
|
||||
|
||||
// need to implement
|
||||
public: c_DOMDocumentFragment(VM::Class* cls = c_DOMDocumentFragment::s_cls);
|
||||
public: c_DOMDocumentFragment(Class* cls = c_DOMDocumentFragment::s_cls);
|
||||
public: ~c_DOMDocumentFragment();
|
||||
public: void t___construct();
|
||||
public: bool t_appendxml(CStrRef data);
|
||||
@@ -331,7 +331,7 @@ class c_DOMDocumentType : public c_DOMNode {
|
||||
DECLARE_CLASS(DOMDocumentType, DOMDocumentType, DOMNode)
|
||||
|
||||
// need to implement
|
||||
public: c_DOMDocumentType(VM::Class* cls = c_DOMDocumentType::s_cls);
|
||||
public: c_DOMDocumentType(Class* cls = c_DOMDocumentType::s_cls);
|
||||
public: ~c_DOMDocumentType();
|
||||
public: void t___construct();
|
||||
public: Variant t___get(Variant name);
|
||||
@@ -351,7 +351,7 @@ class c_DOMElement : public c_DOMNode {
|
||||
DECLARE_CLASS(DOMElement, DOMElement, DOMNode)
|
||||
|
||||
// need to implement
|
||||
public: c_DOMElement(VM::Class* cls = c_DOMElement::s_cls);
|
||||
public: c_DOMElement(Class* cls = c_DOMElement::s_cls);
|
||||
public: ~c_DOMElement();
|
||||
public: void t___construct(CStrRef name, CStrRef value = null_string, CStrRef namespaceuri = null_string);
|
||||
public: String t_getattribute(CStrRef name);
|
||||
@@ -389,7 +389,7 @@ class c_DOMEntity : public c_DOMNode {
|
||||
DECLARE_CLASS(DOMEntity, DOMEntity, DOMNode)
|
||||
|
||||
// need to implement
|
||||
public: c_DOMEntity(VM::Class* cls = c_DOMEntity::s_cls);
|
||||
public: c_DOMEntity(Class* cls = c_DOMEntity::s_cls);
|
||||
public: ~c_DOMEntity();
|
||||
public: void t___construct();
|
||||
public: Variant t___get(Variant name);
|
||||
@@ -409,7 +409,7 @@ class c_DOMEntityReference : public c_DOMNode {
|
||||
DECLARE_CLASS(DOMEntityReference, DOMEntityReference, DOMNode)
|
||||
|
||||
// need to implement
|
||||
public: c_DOMEntityReference(VM::Class* cls = c_DOMEntityReference::s_cls);
|
||||
public: c_DOMEntityReference(Class* cls = c_DOMEntityReference::s_cls);
|
||||
public: ~c_DOMEntityReference();
|
||||
public: void t___construct(CStrRef name);
|
||||
|
||||
@@ -426,7 +426,7 @@ class c_DOMNotation : public c_DOMNode {
|
||||
DECLARE_CLASS(DOMNotation, DOMNotation, DOMNode)
|
||||
|
||||
// need to implement
|
||||
public: c_DOMNotation(VM::Class* cls = c_DOMNotation::s_cls);
|
||||
public: c_DOMNotation(Class* cls = c_DOMNotation::s_cls);
|
||||
public: ~c_DOMNotation();
|
||||
public: void t___construct();
|
||||
public: Variant t___get(Variant name);
|
||||
@@ -446,7 +446,7 @@ class c_DOMProcessingInstruction : public c_DOMNode {
|
||||
DECLARE_CLASS(DOMProcessingInstruction, DOMProcessingInstruction, DOMNode)
|
||||
|
||||
// need to implement
|
||||
public: c_DOMProcessingInstruction(VM::Class* cls = c_DOMProcessingInstruction::s_cls);
|
||||
public: c_DOMProcessingInstruction(Class* cls = c_DOMProcessingInstruction::s_cls);
|
||||
public: ~c_DOMProcessingInstruction();
|
||||
public: void t___construct(CStrRef name, CStrRef value = null_string);
|
||||
public: Variant t___get(Variant name);
|
||||
@@ -466,7 +466,7 @@ class c_DOMNodeIterator : public ExtObjectData, public Sweepable {
|
||||
DECLARE_CLASS(DOMNodeIterator, DOMNodeIterator, ObjectData)
|
||||
|
||||
// need to implement
|
||||
public: c_DOMNodeIterator(VM::Class* cls = c_DOMNodeIterator::s_cls);
|
||||
public: c_DOMNodeIterator(Class* cls = c_DOMNodeIterator::s_cls);
|
||||
public: ~c_DOMNodeIterator();
|
||||
public: void t___construct();
|
||||
public: Variant t_current();
|
||||
@@ -497,7 +497,7 @@ class c_DOMNamedNodeMap : public ExtObjectDataFlags<ObjectData::UseGet|ObjectDat
|
||||
DECLARE_CLASS(DOMNamedNodeMap, DOMNamedNodeMap, ObjectData)
|
||||
|
||||
// need to implement
|
||||
public: c_DOMNamedNodeMap(VM::Class* cls = c_DOMNamedNodeMap::s_cls);
|
||||
public: c_DOMNamedNodeMap(Class* cls = c_DOMNamedNodeMap::s_cls);
|
||||
public: ~c_DOMNamedNodeMap();
|
||||
public: void t___construct();
|
||||
public: Variant t_getnameditem(CStrRef name);
|
||||
@@ -521,7 +521,7 @@ class c_DOMNodeList : public ExtObjectDataFlags<ObjectData::UseGet|ObjectData::U
|
||||
DECLARE_CLASS(DOMNodeList, DOMNodeList, ObjectData)
|
||||
|
||||
// need to implement
|
||||
public: c_DOMNodeList(VM::Class* cls = c_DOMNodeList::s_cls);
|
||||
public: c_DOMNodeList(Class* cls = c_DOMNodeList::s_cls);
|
||||
public: ~c_DOMNodeList();
|
||||
public: void t___construct();
|
||||
public: Variant t_item(int64_t index);
|
||||
@@ -543,7 +543,7 @@ class c_DOMImplementation : public ExtObjectData {
|
||||
DECLARE_CLASS(DOMImplementation, DOMImplementation, ObjectData)
|
||||
|
||||
// need to implement
|
||||
public: c_DOMImplementation(VM::Class* cls = c_DOMImplementation::s_cls);
|
||||
public: c_DOMImplementation(Class* cls = c_DOMImplementation::s_cls);
|
||||
public: ~c_DOMImplementation();
|
||||
public: void t___construct();
|
||||
public: Variant t_createdocument(CStrRef namespaceuri = null_string, CStrRef qualifiedname = null_string, CObjRef doctypeobj = null_object);
|
||||
@@ -563,7 +563,7 @@ class c_DOMXPath : public ExtObjectDataFlags<ObjectData::UseGet|ObjectData::UseS
|
||||
DECLARE_CLASS(DOMXPath, DOMXPath, ObjectData)
|
||||
|
||||
// need to implement
|
||||
public: c_DOMXPath(VM::Class* cls = c_DOMXPath::s_cls);
|
||||
public: c_DOMXPath(Class* cls = c_DOMXPath::s_cls);
|
||||
public: ~c_DOMXPath();
|
||||
public: void t___construct(CVarRef doc);
|
||||
public: Variant t_evaluate(CStrRef expr, CObjRef context = null_object);
|
||||
|
||||
@@ -1635,12 +1635,12 @@ String f_fb_lazy_realpath(CStrRef filename) {
|
||||
}
|
||||
|
||||
String f_fb_gc_collect_cycles() {
|
||||
std::string s = VM::gc_collect_cycles();
|
||||
std::string s = gc_collect_cycles();
|
||||
return String(s);
|
||||
}
|
||||
|
||||
void f_fb_gc_detect_cycles(CStrRef filename) {
|
||||
VM::gc_detect_cycles(std::string(filename.c_str()));
|
||||
gc_detect_cycles(std::string(filename.c_str()));
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
namespace HPHP {
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
using HPHP::VM::Transl::CallerFrame;
|
||||
using HPHP::Transl::CallerFrame;
|
||||
|
||||
static const StaticString s_internal("internal");
|
||||
static const StaticString s_user("user");
|
||||
@@ -55,9 +55,9 @@ bool f_is_callable(CVarRef v, bool syntax /* = false */,
|
||||
if (LIKELY(!syntax)) {
|
||||
CallerFrame cf;
|
||||
ObjectData* obj = NULL;
|
||||
HPHP::VM::Class* cls = NULL;
|
||||
HPHP::Class* cls = NULL;
|
||||
StringData* invName = NULL;
|
||||
const HPHP::VM::Func* f = vm_decode_function(v, cf(), false, obj, cls,
|
||||
const HPHP::Func* f = vm_decode_function(v, cf(), false, obj, cls,
|
||||
invName, false);
|
||||
if (f == NULL) {
|
||||
ret = false;
|
||||
@@ -109,7 +109,7 @@ bool f_is_callable(CVarRef v, bool syntax /* = false */,
|
||||
ObjectData *d = Variant::GetObjectData(tv_func);
|
||||
static const StringData* sd__invoke
|
||||
= StringData::GetStaticString("__invoke");
|
||||
const VM::Func* invoke = d->getVMClass()->lookupMethod(sd__invoke);
|
||||
const Func* invoke = d->getVMClass()->lookupMethod(sd__invoke);
|
||||
if (name.isReferenced()) {
|
||||
if (d->instanceof(c_Closure::s_cls)) {
|
||||
// Hack to stop the mangled name from showing up
|
||||
|
||||
@@ -1519,7 +1519,7 @@ public:
|
||||
if (!RuntimeOption::EnableHotProfiler) {
|
||||
return;
|
||||
}
|
||||
HPHP::VM::EventHook::Enable();
|
||||
HPHP::EventHook::Enable();
|
||||
if (m_profiler == NULL) {
|
||||
switch (level) {
|
||||
case Simple:
|
||||
@@ -1629,9 +1629,9 @@ void f_fb_setprofile(CVarRef callback) {
|
||||
#endif
|
||||
g_vmContext->m_setprofileCallback = callback;
|
||||
if (callback.isNull()) {
|
||||
HPHP::VM::EventHook::Disable();
|
||||
HPHP::EventHook::Disable();
|
||||
} else {
|
||||
HPHP::VM::EventHook::Enable();
|
||||
HPHP::EventHook::Enable();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ static StaticString s_fromUCallback("fromUCallback");
|
||||
|
||||
#define THROW_UFAILURE(fname, uerr, ierr) throwFailure(uerr, #fname, ierr);
|
||||
|
||||
c_UConverter::c_UConverter(VM::Class* cb)
|
||||
c_UConverter::c_UConverter(Class* cb)
|
||||
: ExtObjectData(cb), m_src(NULL), m_dest(NULL) {
|
||||
m_error.code = U_ZERO_ERROR;
|
||||
m_error.custom_error_message = "";
|
||||
|
||||
@@ -85,7 +85,7 @@ class c_UConverter : public ExtObjectData {
|
||||
DECLARE_CLASS(UConverter, UConverter, ObjectData)
|
||||
|
||||
// need to implement
|
||||
public: c_UConverter(VM::Class* cls = c_UConverter::s_cls);
|
||||
public: c_UConverter(Class* cls = c_UConverter::s_cls);
|
||||
public: ~c_UConverter();
|
||||
public: void t___construct(CStrRef toEncoding = "utf-8",
|
||||
CStrRef fromEncoding = "utf-8");
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace HPHP {
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
IMPLEMENT_DEFAULT_EXTENSION(icu_ucsdet);
|
||||
|
||||
c_EncodingDetector::c_EncodingDetector(VM::Class* cb) :
|
||||
c_EncodingDetector::c_EncodingDetector(Class* cb) :
|
||||
ExtObjectData(cb) {
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
m_encoding_detector = ucsdet_open(&status);
|
||||
@@ -110,7 +110,7 @@ Array c_EncodingDetector::t_detectall() {
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
c_EncodingMatch::c_EncodingMatch(VM::Class* cb) :
|
||||
c_EncodingMatch::c_EncodingMatch(Class* cb) :
|
||||
ExtObjectData(cb), m_encoding_match(0) {
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ class c_EncodingDetector : public ExtObjectData {
|
||||
DECLARE_CLASS(EncodingDetector, EncodingDetector, ObjectData)
|
||||
|
||||
// need to implement
|
||||
public: c_EncodingDetector(VM::Class* cls = c_EncodingDetector::s_cls);
|
||||
public: c_EncodingDetector(Class* cls = c_EncodingDetector::s_cls);
|
||||
public: ~c_EncodingDetector();
|
||||
public: void t___construct();
|
||||
public: void t_settext(CStrRef text);
|
||||
@@ -67,7 +67,7 @@ class c_EncodingMatch : public ExtObjectData {
|
||||
DECLARE_CLASS(EncodingMatch, EncodingMatch, ObjectData)
|
||||
|
||||
// need to implement
|
||||
public: c_EncodingMatch(VM::Class* cls = c_EncodingMatch::s_cls);
|
||||
public: c_EncodingMatch(Class* cls = c_EncodingMatch::s_cls);
|
||||
public: ~c_EncodingMatch();
|
||||
public: void t___construct();
|
||||
public: bool t_isvalid();
|
||||
|
||||
@@ -36,7 +36,7 @@ const int64_t q_SpoofChecker$$INVISIBLE = USPOOF_INVISIBLE;
|
||||
const int64_t q_SpoofChecker$$CHAR_LIMIT = USPOOF_CHAR_LIMIT;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
c_SpoofChecker::c_SpoofChecker(VM::Class* cb) :
|
||||
c_SpoofChecker::c_SpoofChecker(Class* cb) :
|
||||
ExtObjectData(cb) {
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
m_spoof_checker = uspoof_open(&status);
|
||||
|
||||
@@ -49,7 +49,7 @@ class c_SpoofChecker : public ExtObjectData {
|
||||
DECLARE_CLASS(SpoofChecker, SpoofChecker, ObjectData)
|
||||
|
||||
// need to implement
|
||||
public: c_SpoofChecker(VM::Class* cls = c_SpoofChecker::s_cls);
|
||||
public: c_SpoofChecker(Class* cls = c_SpoofChecker::s_cls);
|
||||
public: ~c_SpoofChecker();
|
||||
public: void t___construct();
|
||||
public: bool t_issuspicious(CStrRef text, VRefParam issuesFound = uninit_null());
|
||||
|
||||
@@ -456,7 +456,7 @@ void ImageFromHTTP::completed() {
|
||||
|
||||
// PHP accessible classes/functions
|
||||
|
||||
c_ImageSprite::c_ImageSprite(VM::Class* cb) :
|
||||
c_ImageSprite::c_ImageSprite(Class* cb) :
|
||||
ExtObjectData(cb) {
|
||||
m_image_string_buffer = null_string;
|
||||
m_image = NULL;
|
||||
|
||||
@@ -37,7 +37,7 @@ class c_ImageSprite : public ExtObjectData, public Sweepable {
|
||||
DECLARE_CLASS(ImageSprite, ImageSprite, ObjectData)
|
||||
|
||||
// need to implement
|
||||
public: c_ImageSprite(VM::Class* cls = c_ImageSprite::s_cls);
|
||||
public: c_ImageSprite(Class* cls = c_ImageSprite::s_cls);
|
||||
public: ~c_ImageSprite();
|
||||
public: void t___construct();
|
||||
public: Object t_addfile(CStrRef file, CArrRef options = uninit_null());
|
||||
|
||||
@@ -88,7 +88,7 @@ const int64_t q_Collator$$UPPER_FIRST = UCOL_UPPER_FIRST;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
c_Collator::c_Collator(VM::Class* cb) :
|
||||
c_Collator::c_Collator(Class* cb) :
|
||||
ExtObjectData(cb), m_locale(), m_ucoll(NULL), m_errcode() {
|
||||
}
|
||||
|
||||
@@ -540,7 +540,7 @@ const int64_t q_Locale$$VALID_LOCALE = 1;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
c_Locale::c_Locale(VM::Class* cb) : ExtObjectData(cb) {
|
||||
c_Locale::c_Locale(Class* cb) : ExtObjectData(cb) {
|
||||
}
|
||||
|
||||
c_Locale::~c_Locale() {
|
||||
@@ -563,7 +563,7 @@ const int64_t q_Normalizer$$NFKC = UNORM_NFKC;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
c_Normalizer::c_Normalizer(VM::Class* cb) : ExtObjectData(cb) {
|
||||
c_Normalizer::c_Normalizer(Class* cb) : ExtObjectData(cb) {
|
||||
}
|
||||
|
||||
c_Normalizer::~c_Normalizer() {
|
||||
|
||||
@@ -82,7 +82,7 @@ class c_Collator : public ExtObjectData, public Sweepable {
|
||||
DECLARE_CLASS(Collator, Collator, ObjectData)
|
||||
|
||||
// need to implement
|
||||
public: c_Collator(VM::Class* cls = c_Collator::s_cls);
|
||||
public: c_Collator(Class* cls = c_Collator::s_cls);
|
||||
public: ~c_Collator();
|
||||
public: void t___construct(CStrRef locale);
|
||||
public: bool t_asort(VRefParam arr, int64_t sort_flag = q_Collator$$SORT_REGULAR);
|
||||
@@ -115,7 +115,7 @@ class c_Locale : public ExtObjectData {
|
||||
DECLARE_CLASS(Locale, Locale, ObjectData)
|
||||
|
||||
// need to implement
|
||||
public: c_Locale(VM::Class* cls = c_Locale::s_cls);
|
||||
public: c_Locale(Class* cls = c_Locale::s_cls);
|
||||
public: ~c_Locale();
|
||||
public: void t___construct();
|
||||
};
|
||||
@@ -138,7 +138,7 @@ class c_Normalizer : public ExtObjectData, public Sweepable {
|
||||
DECLARE_CLASS(Normalizer, Normalizer, ObjectData)
|
||||
|
||||
// need to implement
|
||||
public: c_Normalizer(VM::Class* cls = c_Normalizer::s_cls);
|
||||
public: c_Normalizer(Class* cls = c_Normalizer::s_cls);
|
||||
public: ~c_Normalizer();
|
||||
public: void t___construct();
|
||||
public: static Variant ti_isnormalized(CStrRef input, int64_t form = q_Normalizer$$FORM_C);
|
||||
|
||||
@@ -79,7 +79,7 @@ bool ini_on_update_hash_function(CStrRef value, void *p) {
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// methods
|
||||
|
||||
c_Memcache::c_Memcache(VM::Class* cb) :
|
||||
c_Memcache::c_Memcache(Class* cb) :
|
||||
ExtObjectData(cb), m_memcache(), m_compress_threshold(0),
|
||||
m_min_compress_savings(0.2) {
|
||||
memcached_create(&m_memcache);
|
||||
|
||||
@@ -55,7 +55,7 @@ class c_Memcache : public ExtObjectData, public Sweepable {
|
||||
DECLARE_CLASS(Memcache, Memcache, ObjectData)
|
||||
|
||||
// need to implement
|
||||
public: c_Memcache(VM::Class* cls = c_Memcache::s_cls);
|
||||
public: c_Memcache(Class* cls = c_Memcache::s_cls);
|
||||
public: ~c_Memcache();
|
||||
public: void t___construct();
|
||||
public: bool t_connect(CStrRef host, int port = 0, int timeout = 0, int timeoutms = 0);
|
||||
|
||||
@@ -179,7 +179,7 @@ public:
|
||||
}
|
||||
|
||||
|
||||
c_Memcached::c_Memcached(VM::Class* cb) :
|
||||
c_Memcached::c_Memcached(Class* cb) :
|
||||
ExtObjectData(cb) {
|
||||
}
|
||||
c_Memcached::~c_Memcached() {
|
||||
|
||||
@@ -91,7 +91,7 @@ class c_Memcached : public ExtObjectData, public Sweepable {
|
||||
DECLARE_CLASS(Memcached, Memcached, ObjectData)
|
||||
|
||||
// need to implement
|
||||
public: c_Memcached(VM::Class* cls = c_Memcached::s_cls);
|
||||
public: c_Memcached(Class* cls = c_Memcached::s_cls);
|
||||
public: ~c_Memcached();
|
||||
public: void t___construct(CStrRef persistent_id = null_string);
|
||||
public: bool t_add(CStrRef key, CVarRef value, int expiration = 0);
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
namespace HPHP {
|
||||
|
||||
using VM::Transl::CallerFrame;
|
||||
using Transl::CallerFrame;
|
||||
|
||||
// Make sure "tokenizer" gets added to the list of extensions
|
||||
IMPLEMENT_DEFAULT_EXTENSION(tokenizer);
|
||||
@@ -54,8 +54,8 @@ int64_t f_connection_timeout() {
|
||||
return f_connection_status() == k_CONNECTION_TIMEOUT;
|
||||
}
|
||||
|
||||
static VM::Class* getClassByName(const char* name, int len) {
|
||||
VM::Class* cls = nullptr;
|
||||
static Class* getClassByName(const char* name, int len) {
|
||||
Class* cls = nullptr;
|
||||
// translate "self" or "parent"
|
||||
if (len == 4 && !memcmp(name, "self", 4)) {
|
||||
cls = g_vmContext->getContextClass();
|
||||
@@ -84,7 +84,7 @@ static VM::Class* getClassByName(const char* name, int len) {
|
||||
}
|
||||
} else {
|
||||
String className(name, len, CopyString);
|
||||
cls = VM::Unit::loadClass(className.get());
|
||||
cls = Unit::loadClass(className.get());
|
||||
}
|
||||
return cls;
|
||||
}
|
||||
@@ -98,7 +98,7 @@ Variant f_constant(CStrRef name) {
|
||||
// class constant
|
||||
int classNameLen = colon - data;
|
||||
char *constantName = colon + 2;
|
||||
VM::Class* cls = getClassByName(data, classNameLen);
|
||||
Class* cls = getClassByName(data, classNameLen);
|
||||
if (cls) {
|
||||
String cnsName(constantName, data + len - constantName, CopyString);
|
||||
TypedValue* tv = cls->clsCnsGet(cnsName.get());
|
||||
@@ -109,7 +109,7 @@ Variant f_constant(CStrRef name) {
|
||||
raise_warning("Couldn't find constant %s", data);
|
||||
return uninit_null();
|
||||
} else {
|
||||
TypedValue* cns = VM::Unit::loadCns(name.get());
|
||||
TypedValue* cns = Unit::loadCns(name.get());
|
||||
if (cns) return tvAsVariant(cns);
|
||||
return uninit_null();
|
||||
}
|
||||
@@ -120,7 +120,7 @@ bool f_define(CStrRef name, CVarRef value,
|
||||
if (case_insensitive) {
|
||||
raise_warning(Strings::CONSTANTS_CASE_SENSITIVE);
|
||||
}
|
||||
return VM::Unit::defCns(name.get(), value.getTypedAccessor());
|
||||
return Unit::defCns(name.get(), value.getTypedAccessor());
|
||||
}
|
||||
|
||||
bool f_defined(CStrRef name, bool autoload /* = true */) {
|
||||
@@ -132,7 +132,7 @@ bool f_defined(CStrRef name, bool autoload /* = true */) {
|
||||
// class constant
|
||||
int classNameLen = colon - data;
|
||||
char *constantName = colon + 2;
|
||||
VM::Class* cls = getClassByName(data, classNameLen);
|
||||
Class* cls = getClassByName(data, classNameLen);
|
||||
if (cls) {
|
||||
String cnsName(constantName, data + len - constantName, CopyString);
|
||||
return cls->clsCnsGet(cnsName.get());
|
||||
@@ -140,8 +140,8 @@ bool f_defined(CStrRef name, bool autoload /* = true */) {
|
||||
return false;
|
||||
} else {
|
||||
return autoload ?
|
||||
VM::Unit::loadCns(name.get()) :
|
||||
VM::Unit::lookupCns(name.get());
|
||||
Unit::loadCns(name.get()) :
|
||||
Unit::lookupCns(name.get());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ Variant f_exit(CVarRef status /* = null_variant */) {
|
||||
|
||||
Variant f_eval(CStrRef code_str) {
|
||||
String prefixedCode = concat("<?php ", code_str);
|
||||
VM::Unit* unit = g_vmContext->compileEvalString(prefixedCode.get());
|
||||
Unit* unit = g_vmContext->compileEvalString(prefixedCode.get());
|
||||
TypedValue retVal;
|
||||
g_vmContext->invokeUnit(&retVal, unit);
|
||||
return tvAsVariant(&retVal);
|
||||
|
||||
Alguns arquivos não foram exibidos porque demasiados arquivos foram alterados neste diff Mostrar Mais
Referência em uma Nova Issue
Bloquear um usuário