Changeset 186279 in webkit for trunk/Source/JavaScriptCore/API


Ignore:
Timestamp:
Jul 4, 2015, 12:42:18 PM (10 years ago)
Author:
Chris Dumez
Message:

Drop RefPtr::clear() method
https://bugs.webkit.org/show_bug.cgi?id=146556

Reviewed by Brady Eidson.

Source/JavaScriptCore:

Drop RefPtr::clear() method in favor of "= nullptr;" pattern.

Source/WebCore:

Drop RefPtr::clear() method in favor of "= nullptr;" pattern.

Source/WebKit:

Drop RefPtr::clear() method in favor of "= nullptr;" pattern.

Source/WebKit/mac:

Drop RefPtr::clear() method in favor of "= nullptr;" pattern.

Source/WebKit/win:

Drop RefPtr::clear() method in favor of "= nullptr;" pattern.

Source/WebKit2:

Drop RefPtr::clear() method in favor of "= nullptr;" pattern.

Source/WTF:

Drop RefPtr::clear() method in favor of "= nullptr;" pattern.
Also made the "= nullptr;" pattern as efficient as clear()
by providing a operator=(nullptr_t) overload. Local micro-
benchmarking showed that "= nullptr;" used to be ~1.7% slower
than clear().

Tools:

Drop RefPtr::clear() method in favor of "= nullptr;" pattern.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSValueRef.cpp

    r185259 r186279  
    423423    RefPtr<OpaqueJSString> stringRef(OpaqueJSString::create(jsValue.toString(exec)->value(exec)));
    424424    if (handleExceptionIfNeeded(exec, exception) == ExceptionStatus::DidThrow)
    425         stringRef.clear();
     425        stringRef = nullptr;
    426426    return stringRef.release().leakRef();
    427427}
Note: See TracChangeset for help on using the changeset viewer.