diff --git a/hphp/idl/asio.idl.json b/hphp/idl/asio.idl.json index 605eaf383..6a288f2f7 100644 --- a/hphp/idl/asio.idl.json +++ b/hphp/idl/asio.idl.json @@ -398,19 +398,6 @@ }, "args": [ ] - }, - { - "name": "getStackTrace", - "desc": "Get stack trace of this wait handle", - "flags": [ - "HasDocComment" - ], - "return": { - "type": "VariantVec", - "desc": "An array of WaitableWaitHandles representing full stack trace, starting with this wait handle" - }, - "args": [ - ] } ], "consts": [ diff --git a/hphp/runtime/ext/asio/waitable_wait_handle.cpp b/hphp/runtime/ext/asio/waitable_wait_handle.cpp index 161fdffe1..0416a80c4 100644 --- a/hphp/runtime/ext/asio/waitable_wait_handle.cpp +++ b/hphp/runtime/ext/asio/waitable_wait_handle.cpp @@ -83,58 +83,6 @@ Array c_WaitableWaitHandle::t_getparents() { return result; } -Array c_WaitableWaitHandle::t_getstacktrace() { - // no parent data available if finished - if (isFinished()) { - return Array::Create(); - } - - /** - * At this point, we have an unfinished wait handle and by definition, all - * recursive parents are unfinished as well. Let's walk thru them up the - * stack and populate the output array. One particularly tricky case is to - * correctly follow cross-context boundaries. Sometimes, a wait handle - * originally created in the parent context gets imported and following - * its original parents may skip one or more context boundaries. To avoid - * this, only parents from the same context are considered. A condition - * where no such parent exists indicates a wait handle that was join()-ed - * from the parent context. - */ - AsioSession* session = AsioSession::Get(); - Array result = Array::Create(this); - c_WaitableWaitHandle* curr = this; - - while (true) { - // find parent in the same context (context may be null) - context_idx_t ctx_idx = curr->getContextIdx(); - curr = curr->getParentInContext(ctx_idx); - - // continue up the stack within the same context - if (curr) { - result.append(curr); - continue; - } - - // the whole dependency chain is outside of context - if (!ctx_idx) { - return result; - } - - // cross the boundary; keep crossing until non-empty context is found - do { - --ctx_idx; - result.append(null_variant); - } while (ctx_idx && !(curr = session->getContext(ctx_idx)->getCurrent())); - - // all contexts processed - if (!ctx_idx) { - return result; - } - - result.append(curr); - } -} - c_BlockableWaitHandle* c_WaitableWaitHandle::addParent(c_BlockableWaitHandle* parent) { c_BlockableWaitHandle* prev = m_firstParent; m_firstParent = parent; @@ -179,16 +127,6 @@ void c_WaitableWaitHandle::setException(ObjectData* exception) { } } -c_BlockableWaitHandle* c_WaitableWaitHandle::getParentInContext(context_idx_t ctx_idx) { - c_BlockableWaitHandle* parent = m_firstParent; - - while (parent && parent->getContextIdx() != ctx_idx) { - parent = parent->getNextParent(); - } - - return parent; -} - // throws on context depth level overflows and cross-context cycles void c_WaitableWaitHandle::join() { AsioSession* session = AsioSession::Get(); diff --git a/hphp/runtime/ext/ext_asio.h b/hphp/runtime/ext/ext_asio.h index d7a140f59..dc49b2a24 100644 --- a/hphp/runtime/ext/ext_asio.h +++ b/hphp/runtime/ext/ext_asio.h @@ -192,7 +192,6 @@ class c_WaitableWaitHandle : public c_WaitHandle { public: int t_getcontextidx(); public: Object t_getcreator(); public: Array t_getparents(); - public: Array t_getstacktrace(); public: @@ -213,7 +212,6 @@ class c_WaitableWaitHandle : public c_WaitHandle { bool isInContext() { return getContextIdx(); } c_BlockableWaitHandle* getFirstParent() { return m_firstParent; } - c_BlockableWaitHandle* getParentInContext(context_idx_t ctx_idx); virtual c_WaitableWaitHandle* getChild(); bool hasCycle(c_WaitableWaitHandle* start); diff --git a/hphp/system/class_map.cpp b/hphp/system/class_map.cpp index 2adf9f3c6..a42003fe3 100644 --- a/hphp/system/class_map.cpp +++ b/hphp/system/class_map.cpp @@ -24828,11 +24828,6 @@ const char *g_class_map[] = { (const char *)0x20 /* KindOfArray */, NULL, NULL, NULL, - (const char *)0x10006040, "getStackTrace", "", (const char*)0, (const char*)0, - "/**\n * ( excerpt from\n * http://php.net/manual/en/waitablewaithandle.getstacktrace.php )\n *\n * Get stack trace of this wait handle\n *\n * @return vector An array of WaitableWaitHandles representing full\n * stack trace, starting with this wait handle\n */", - (const char *)0x20 /* KindOfArray */, NULL, - NULL, - NULL, NULL, NULL, NULL,