author | Bobby Holley <bobbyholley@gmail.com> |
Fri, 25 Nov 2011 17:09:07 -0800 | |
changeset 82436 | 2c2730b0cbf7750957e63041fb7b5de3a290c3f6 |
parent 82435 | c1bc4c0988143a2d8933b43018fb6ce7747c4871 |
child 82437 | 89e610a1014c7bd13b00a4ba73ccc07e83f262ca |
push id | 519 |
push user | akeybl@mozilla.com |
push date | Wed, 01 Feb 2012 00:38:35 +0000 |
treeherder | mozilla-beta@788ea1ef610b [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | mrbkap |
bugs | 692342 |
milestone | 11.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/js/xpconnect/src/XPCWrappedNative.cpp +++ b/js/xpconnect/src/XPCWrappedNative.cpp @@ -2744,33 +2744,24 @@ CallMethodHelper::ConvertDependentParam( } else { datum_type = type; } // Specify the correct storage/calling semantics. if (paramInfo.IsIndirect()) dp->SetIndirect(); - // Flag cleanup as necessary for each type. - if (isArray) { - // Case 1 - Arrays. - if (datum_type.IsPointer()) - dp->SetValNeedsCleanup(); - - } else if (isSizedString) { - // Case 2 - Sized strings. + // We have 3 possible type of dependent parameters: Arrays, Sized Strings, + // and iid_is Interface pointers. The latter two always need cleanup, and + // arrays need cleanup for all non-arithmetic types. Since the latter two + // cases also happen to be non-arithmetic, we can just inspect datum_type + // here. + if (!datum_type.IsArithmetic()) dp->SetValNeedsCleanup(); - } else { - // Case 3 - Dependent interface pointer. - NS_ABORT_IF_FALSE(type.TagPart() == nsXPTType::T_INTERFACE_IS, - "Unknown dependent type."); - dp->SetValNeedsCleanup(); - } - // Even if there's nothing to convert, we still need to examine the // JSObject container for out-params. If it's null or otherwise invalid, // we want to know before the call, rather than after. // // This is a no-op for 'in' params. jsval src; if (!GetOutParamSource(i, &src)) return JS_FALSE;