Changeset 143994 in webkit


Ignore:
Timestamp:
Feb 25, 2013 6:10:02 PM (11 years ago)
Author:
msaboff@apple.com
Message:

For JSVALUE32_64, maxOffsetRelativeToPatchedStorage() doesn't compute the maximum negative offset
https://bugs.webkit.org/show_bug.cgi?id=110828

Reviewed by Oliver Hunt.

  • runtime/JSObject.h:

(JSC::maxOffsetRelativeToPatchedStorage): Only add the OBJECT_OFFSETOF(tag) for positive offsets.
That way this function will return the offset farthest from 0 needed to access either the payload
or tag.

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r143986 r143994  
     12013-02-25  Michael Saboff  <msaboff@apple.com>
     2
     3        For JSVALUE32_64, maxOffsetRelativeToPatchedStorage() doesn't compute the maximum negative offset
     4        https://bugs.webkit.org/show_bug.cgi?id=110828
     5
     6        Reviewed by Oliver Hunt.
     7
     8        * runtime/JSObject.h:
     9        (JSC::maxOffsetRelativeToPatchedStorage): Only add the OBJECT_OFFSETOF(tag) for positive offsets.
     10        That way this function will return the offset farthest from 0 needed to access either the payload
     11        or tag.
     12
    1132013-02-25  Jeffrey Pfau  <jpfau@apple.com>
    214
  • trunk/Source/JavaScriptCore/runtime/JSObject.h

    r141154 r143994  
    14221422}
    14231423
    1424 // Returns the maximum offset a load instruction will encode.
     1424// Returns the maximum offset (away from zero) a load instruction will encode.
    14251425inline size_t maxOffsetRelativeToPatchedStorage(PropertyOffset offset)
    14261426{
     1427    ptrdiff_t addressOffset = static_cast<ptrdiff_t>(offsetRelativeToPatchedStorage(offset));
    14271428#if USE(JSVALUE32_64)
    1428     return offsetRelativeToPatchedStorage(offset)
    1429         + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag);
    1430 #else
    1431     return offsetRelativeToPatchedStorage(offset);
     1429    if (addressOffset >= 0)
     1430        return static_cast<size_t>(addressOffset) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag);
    14321431#endif
     1432    return static_cast<size_t>(addressOffset);
    14331433}
    14341434
Note: See TracChangeset for help on using the changeset viewer.