Changeset 59067 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
May 10, 2010, 12:02:34 AM (15 years ago)
Author:
[email protected]
Message:

2010-05-09 Fumitoshi Ukai <[email protected]>

Reviewed by Eric Seidel.

JavaScriptCore/wtf/MD5.h: checksum should take a reference to output.
https://bugs.webkit.org/show_bug.cgi?id=38723

  • JavaScriptCore.exp:
  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  • wtf/MD5.cpp: (WTF::expectMD5): Fix for checksum change. (WTF::MD5::checksum): Take a reference to output, instead of returning the result by value, to reduce coping for performance.
  • wtf/MD5.h:
Location:
trunk/JavaScriptCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r59065 r59067  
     12010-05-09  Fumitoshi Ukai  <[email protected]>
     2
     3        Reviewed by Eric Seidel.
     4
     5        JavaScriptCore/wtf/MD5.h: checksum should take a reference to output.
     6        https://bugs.webkit.org/show_bug.cgi?id=38723
     7
     8        * JavaScriptCore.exp:
     9        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
     10        * wtf/MD5.cpp:
     11        (WTF::expectMD5):
     12          Fix for checksum change.
     13        (WTF::MD5::checksum):
     14          Take a reference to output, instead of returning the result by value, to reduce coping for performance.
     15        * wtf/MD5.h:
     16
    1172010-05-09  Oliver Hunt  <[email protected]>
    218
  • trunk/JavaScriptCore/JavaScriptCore.exp

    r58986 r59067  
    350350__ZN3WTF39initializeMainThreadToProcessMainThreadEv
    351351__ZN3WTF3MD58addBytesEPKhm
    352 __ZN3WTF3MD58checksumEv
     352__ZN3WTF3MD58checksumERNS_6VectorIhLm16EEE
    353353__ZN3WTF3MD5C1Ev
    354354__ZN3WTF5Mutex4lockEv
  • trunk/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def

    r59001 r59067  
    9090    ?checkCurrentIdentifierTable@Identifier@JSC@@CAXPAVJSGlobalData@2@@Z
    9191    ?checkSyntax@JSC@@YA?AVCompletion@1@PAVExecState@1@ABVSourceCode@1@@Z
    92     ?checksum@MD5@WTF@@QAE?AV?$Vector@E$0BA@@2@XZ
     92    ?checksum@MD5@WTF@@QAEXAAV?$Vector@E$0BA@@2@@Z
    9393    ?classInfo@InternalFunction@JSC@@UBEPBUClassInfo@2@XZ
    9494    ?classInfo@JSCell@JSC@@UBEPBUClassInfo@2@XZ
  • trunk/JavaScriptCore/wtf/MD5.cpp

    r58138 r59067  
    6868    MD5 md5;
    6969    md5.addBytes(reinterpret_cast<const uint8_t*>(input.data()), input.length());
    70     Vector<uint8_t, 16> digest = md5.checksum();
     70    Vector<uint8_t, 16> digest;
     71    md5.checksum(digest);
    7172    char* buf = 0;
    7273    CString actual = CString::newUninitialized(32, buf);
     
    257258}
    258259
    259 Vector<uint8_t, 16> MD5::checksum()
     260void MD5::checksum(Vector<uint8_t, 16>& digest)
    260261{
    261262    // Compute number of bytes mod 64
     
    292293    MD5Transform(m_buf, reinterpret_cast<uint32_t*>(m_in));
    293294    reverseBytes(reinterpret_cast<uint8_t*>(m_buf), 4);
    294     Vector<uint8_t, 16> digest;
     295
     296    // Now, m_buf contains checksum result.
     297    if (!digest.isEmpty())
     298        digest.clear();
    295299    digest.append(reinterpret_cast<uint8_t*>(m_buf), 16);
    296300
     
    299303    memset(m_bits, 0, sizeof(m_bits));
    300304    memset(m_in, 0, sizeof(m_in));
    301     return digest;
    302305}
    303306
  • trunk/JavaScriptCore/wtf/MD5.h

    r58136 r59067  
    4747
    4848    // checksum has a side effect of resetting the state of the object.
    49     Vector<uint8_t, 16> checksum();
     49    void checksum(Vector<uint8_t, 16>&);
    5050
    5151private:
Note: See TracChangeset for help on using the changeset viewer.