Skip to content

Commit 3a1bc06

Browse files
committed
Revert "core: set PROVIDER type as Persistent class id"
This reverts commit 3c44100. Reverted for breaking node-heapdump[0]. AsyncWrap assigns a class id but does not set a v8::RetainedObjectInfo provider callback with v8::HeapProfiler::SetWrapperClassInfoProvider(). The result is a null pointer dereference when taking a heap snapshot. It can probably be solved by setting a generic provider callback inside the AsyncWrap constructor but that may have performance ramifications that need to be investigated first. I move to revert it for now. [0] https://github.com/bnoordhuis/node-heapdump PR-URL: #1827 Reviewed-By: Trevor Norris <trev.norris@gmail.com>
1 parent a77c330 commit 3a1bc06

File tree

3 files changed

+3
-11
lines changed

3 files changed

+3
-11
lines changed

src/async-wrap-inl.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ inline AsyncWrap::AsyncWrap(Environment* env,
1717
v8::Handle<v8::Object> object,
1818
ProviderType provider,
1919
AsyncWrap* parent)
20-
: BaseObject(env, object, provider),
21-
bits_(static_cast<uint32_t>(provider) << 1) {
20+
: BaseObject(env, object), bits_(static_cast<uint32_t>(provider) << 1) {
2221
// Check user controlled flag to see if the init callback should run.
2322
if (!env->using_asyncwrap())
2423
return;

src/base-object-inl.h

+1-6
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,10 @@
1010

1111
namespace node {
1212

13-
inline BaseObject::BaseObject(Environment* env,
14-
v8::Local<v8::Object> handle,
15-
const uint16_t class_id)
13+
inline BaseObject::BaseObject(Environment* env, v8::Local<v8::Object> handle)
1614
: handle_(env->isolate(), handle),
1715
env_(env) {
1816
CHECK_EQ(false, handle.IsEmpty());
19-
// Shift value 8 bits over to try avoiding conflict with anything else.
20-
if (class_id != 0)
21-
handle_.SetWrapperClassId(class_id << 8);
2217
}
2318

2419

src/base-object.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ class Environment;
99

1010
class BaseObject {
1111
public:
12-
BaseObject(Environment* env,
13-
v8::Local<v8::Object> handle,
14-
const uint16_t class_id = 0);
12+
BaseObject(Environment* env, v8::Local<v8::Object> handle);
1513
virtual ~BaseObject();
1614

1715
// Returns the wrapped object. Returns an empty handle when

0 commit comments

Comments
 (0)