Lift a lot of stuff out of HPHP::VM.
This is a partial step towards merging the HPHP::VM namespace up into its parent. To keep it reviewable/mergeable I'm not doing everything at once here, but most of the code I've touched seems improved. I've drawn an invisible line around the jit, Unit and its cohort (Class, Func, PreClass, etc.); we'll get back to them soon.
Esse commit está contido em:
@@ -531,8 +531,6 @@ MArrayIter::~MArrayIter() {
|
||||
}
|
||||
}
|
||||
|
||||
namespace VM {
|
||||
|
||||
bool Iter::init(TypedValue* c1) {
|
||||
assert(c1->m_type != KindOfRef);
|
||||
bool hasElems = true;
|
||||
@@ -553,7 +551,7 @@ bool Iter::init(TypedValue* c1) {
|
||||
if (isIterator) {
|
||||
(void) new (&arr()) ArrayIter(obj, ArrayIter::transferOwner);
|
||||
} else {
|
||||
Class* ctx = arGetContextClass(g_vmContext->getFP());
|
||||
VM::Class* ctx = arGetContextClass(g_vmContext->getFP());
|
||||
CStrRef ctxStr = ctx ? ctx->nameRef() : null_string;
|
||||
Array iterArray(obj->o_toIterArray(ctxStr));
|
||||
ArrayData* ad = iterArray.getArrayData();
|
||||
@@ -603,7 +601,7 @@ bool Iter::minit(TypedValue* v1) {
|
||||
if (isIterator) {
|
||||
raise_error("An iterator cannot be used with foreach by reference");
|
||||
}
|
||||
Class* ctx = arGetContextClass(g_vmContext->getFP());
|
||||
VM::Class* ctx = arGetContextClass(g_vmContext->getFP());
|
||||
CStrRef ctxStr = ctx ? ctx->nameRef() : null_string;
|
||||
Array iterArray = obj->o_toIterArray(ctxStr, true);
|
||||
if (iterArray->empty()) {
|
||||
@@ -847,7 +845,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, Class* ctx,
|
||||
int64_t new_iter_object(Iter* dest, ObjectData* obj, VM::Class* ctx,
|
||||
TypedValue* valOut, TypedValue* keyOut) {
|
||||
valOut = tvToCell(valOut);
|
||||
if (keyOut) {
|
||||
@@ -1055,7 +1053,5 @@ cold:
|
||||
return iter_next_cold(iter, valOut, keyOut);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
}
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário