Ignore:
Timestamp:
Oct 27, 2014, 10:05:01 PM (11 years ago)
Author:
[email protected]
Message:

Simplified some JSObject methods for converting arrays to ArrayStorage shape.
<https://webkit.org/b/138119>

Reviewed by Filip Pizlo.

Currently, for each Undecided, Int32, Double, and Contiguous array shapes,
there are 3 JSObject methods to convert them to ArrayStorage shape:

ArrayStorage* convert<shape>ToArrayStorage(VM&, NonPropertyTransition, unsigned neededLength);
ArrayStorage* convert<shape>ToArrayStorage(VM&, NonPropertyTransition);
ArrayStorage* convert<shape>ToArrayStorage(VM&);

However, the neededLength that is passed is always m_butterfly->vectorLength().
Hence, the method that takes a neededLength is really not needed. This patch
removes this unneeded verbosity.

  • runtime/JSObject.cpp:

(JSC::JSObject::convertUndecidedToArrayStorage):
(JSC::JSObject::convertInt32ToArrayStorage):

  • Also reordered the placement of the DeferGC statement so this Int32 function will look more similar to the others.

(JSC::JSObject::convertDoubleToArrayStorage):
(JSC::JSObject::convertContiguousToArrayStorage):

  • runtime/JSObject.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSObject.h

    r173993 r175240  
    781781    ContiguousDoubles convertUndecidedToDouble(VM&);
    782782    ContiguousJSValues convertUndecidedToContiguous(VM&);
    783     ArrayStorage* convertUndecidedToArrayStorage(VM&, NonPropertyTransition, unsigned neededLength);
    784783    ArrayStorage* convertUndecidedToArrayStorage(VM&, NonPropertyTransition);
    785784    ArrayStorage* convertUndecidedToArrayStorage(VM&);
     
    787786    ContiguousDoubles convertInt32ToDouble(VM&);
    788787    ContiguousJSValues convertInt32ToContiguous(VM&);
    789     ArrayStorage* convertInt32ToArrayStorage(VM&, NonPropertyTransition, unsigned neededLength);
    790788    ArrayStorage* convertInt32ToArrayStorage(VM&, NonPropertyTransition);
    791789    ArrayStorage* convertInt32ToArrayStorage(VM&);
     
    793791    ContiguousJSValues convertDoubleToContiguous(VM&);
    794792    ContiguousJSValues rageConvertDoubleToContiguous(VM&);
    795     ArrayStorage* convertDoubleToArrayStorage(VM&, NonPropertyTransition, unsigned neededLength);
    796793    ArrayStorage* convertDoubleToArrayStorage(VM&, NonPropertyTransition);
    797794    ArrayStorage* convertDoubleToArrayStorage(VM&);
    798795       
    799     ArrayStorage* convertContiguousToArrayStorage(VM&, NonPropertyTransition, unsigned neededLength);
    800796    ArrayStorage* convertContiguousToArrayStorage(VM&, NonPropertyTransition);
    801797    ArrayStorage* convertContiguousToArrayStorage(VM&);
Note: See TracChangeset for help on using the changeset viewer.