Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(409)

Unified Diff: Source/bindings/v8/V8DOMWrapper.h

Issue 314603003: Don't add extra 8 byte to DOM wrappers in non-oilpan builds (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/bindings/v8/V8DOMWrapper.h
diff --git a/Source/bindings/v8/V8DOMWrapper.h b/Source/bindings/v8/V8DOMWrapper.h
index adc97b7e3def75eb43946cddc7a2ec868f96c8ba..a8aee01666cb3a2aaf11d2b7788d709f6c43ce74 100644
--- a/Source/bindings/v8/V8DOMWrapper.h
+++ b/Source/bindings/v8/V8DOMWrapper.h
@@ -87,10 +87,17 @@ struct WrapperTypeInfo;
#else
ASSERT(wrapperTypeInfo->gcType == RefCountedObject || wrapperTypeInfo->gcType == WillBeGarbageCollectedObject);
#endif
+
+ // Clear out the last internal field, which is assumed to contain a valid persistent pointer value.
+ if (wrapperTypeInfo->gcType == GarbageCollectedObject) {
+ wrapper->SetAlignedPointerInInternalField(wrapper->InternalFieldCount() - 1, 0);
+ } else if (wrapperTypeInfo->gcType == WillBeGarbageCollectedObject) {
+#if ENABLE(OILPAN)
+ wrapper->SetAlignedPointerInInternalField(wrapper->InternalFieldCount() - 1, 0);
+#endif
+ }
wrapper->SetAlignedPointerInInternalField(v8DOMWrapperObjectIndex, object);
wrapper->SetAlignedPointerInInternalField(v8DOMWrapperTypeIndex, const_cast<WrapperTypeInfo*>(wrapperTypeInfo));
- // Clear out the last internal field, which is assumed to contain a valid persistent pointer value.
- wrapper->SetAlignedPointerInInternalField(wrapper->InternalFieldCount() - 1, 0);
}
inline void V8DOMWrapper::setNativeInfoWithPersistentHandle(v8::Handle<v8::Object> wrapper, const WrapperTypeInfo* wrapperTypeInfo, void* object, PersistentNode* handle)
« Source/bindings/templates/interface.h ('K') | « Source/bindings/tests/results/V8TestNode.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698