Changeset 42571 in webkit for trunk/JavaScriptCore/runtime/JSArray.cpp
- Timestamp:
- Apr 16, 2009, 12:24:59 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/JSArray.cpp
r42337 r42571 25 25 26 26 #include "ArrayPrototype.h" 27 #include "CachedCall.h" 27 28 #include "PropertyNameArray.h" 28 29 #include <wtf/AVLTree.h> 29 30 #include <wtf/Assertions.h> 31 #include <wtf/OwnPtr.h> 30 32 #include <Operations.h> 31 33 … … 746 748 const CallData* m_compareCallData; 747 749 JSValuePtr m_globalThisValue; 750 OwnPtr<CachedCall> m_cachedCall; 748 751 749 752 handle get_less(handle h) { return m_nodes[h].lt & 0x7FFFFFFF; } … … 781 784 return 1; 782 785 783 ArgList arguments; 784 arguments.append(va); 785 arguments.append(vb); 786 double compareResult = call(m_exec, m_compareFunction, m_compareCallType, *m_compareCallData, m_globalThisValue, arguments).toNumber(m_exec); 786 double compareResult; 787 if (m_cachedCall) { 788 m_cachedCall->setThis(m_globalThisValue); 789 m_cachedCall->setArgument(0, va); 790 m_cachedCall->setArgument(1, vb); 791 compareResult = m_cachedCall->call().toNumber(m_exec); 792 } else { 793 ArgList arguments; 794 arguments.append(va); 795 arguments.append(vb); 796 compareResult = call(m_exec, m_compareFunction, m_compareCallType, *m_compareCallData, m_globalThisValue, arguments).toNumber(m_exec); 797 } 787 798 return (compareResult < 0) ? -1 : 1; // Not passing equality through, because we need to store all values, even if equivalent. 788 799 } … … 818 829 tree.abstractor().m_globalThisValue = exec->globalThisValue(); 819 830 tree.abstractor().m_nodes.resize(usedVectorLength + (m_storage->m_sparseValueMap ? m_storage->m_sparseValueMap->size() : 0)); 831 832 if (callType == CallTypeJS) 833 tree.abstractor().m_cachedCall.set(new CachedCall(exec, asFunction(compareFunction), 2, exec->exceptionSlot())); 820 834 821 835 if (!tree.abstractor().m_nodes.begin()) {
Note:
See TracChangeset
for help on using the changeset viewer.