Ignore:
Timestamp:
Jan 5, 2009, 3:57:09 PM (17 years ago)
Author:
[email protected]
Message:

CanvasPixelArray performance is too slow
<https://bugs.webkit.org/show_bug.cgi?id=23123>

Reviewed by Gavin Barraclough

JavaScriptCore:
The fix to this is to devirtualise get and put in a manner similar to
JSString and JSArray. To do this I've added a ByteArray implementation
and JSByteArray wrapper to JSC. We can then do vptr comparisons to
devirtualise the calls.

This devirtualisation improves performance by 1.5-2x in my somewhat ad
hoc tests.

WebCore:
Remove the WebCore CanvasPixelArray implementation and replace
CPA usage with JSC::ByteArray. Replace the JSCanvasPixelArray
wrapper with an explicitly instantiated JSByteArray put on the
JSImageData object as an ordinary ReadOnly, DontDelete property.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r39487 r39625  
    159159                A766B44F0EE8DCD1009518CA /* ExecutableAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = A7B48DB50EE74CFC00DCBDB6 /* ExecutableAllocator.h */; settings = {ATTRIBUTES = (Private, ); }; };
    160160                A782F1A50EEC9FA20036273F /* ExecutableAllocatorPosix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A782F1A40EEC9FA20036273F /* ExecutableAllocatorPosix.cpp */; };
     161                A791EE5B0F11D90C00AE1F68 /* ByteArray.h in Headers */ = {isa = PBXBuildFile; fileRef = A791EE590F11D90C00AE1F68 /* ByteArray.h */; settings = {ATTRIBUTES = (Private, ); }; };
     162                A791EE5C0F11D90C00AE1F68 /* ByteArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A791EE5A0F11D90C00AE1F68 /* ByteArray.cpp */; };
     163                A791EF280F11E07900AE1F68 /* JSByteArray.h in Headers */ = {isa = PBXBuildFile; fileRef = A791EF260F11E07900AE1F68 /* JSByteArray.h */; settings = {ATTRIBUTES = (Private, ); }; };
     164                A791EF290F11E07900AE1F68 /* JSByteArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A791EF270F11E07900AE1F68 /* JSByteArray.cpp */; };
    161165                A7B48F490EE8936F00DCBDB6 /* ExecutableAllocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7B48DB60EE74CFC00DCBDB6 /* ExecutableAllocator.cpp */; };
    162166                BC02E90D0E1839DB000F9297 /* ErrorConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC02E9050E1839DB000F9297 /* ErrorConstructor.h */; };
     
    646650                A727FF660DA3053B00E548D7 /* JSPropertyNameIterator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPropertyNameIterator.cpp; sourceTree = "<group>"; };
    647651                A782F1A40EEC9FA20036273F /* ExecutableAllocatorPosix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExecutableAllocatorPosix.cpp; sourceTree = "<group>"; };
     652                A791EE590F11D90C00AE1F68 /* ByteArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ByteArray.h; sourceTree = "<group>"; };
     653                A791EE5A0F11D90C00AE1F68 /* ByteArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ByteArray.cpp; sourceTree = "<group>"; };
     654                A791EF260F11E07900AE1F68 /* JSByteArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSByteArray.h; sourceTree = "<group>"; };
     655                A791EF270F11E07900AE1F68 /* JSByteArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSByteArray.cpp; sourceTree = "<group>"; };
    648656                A7B48DB50EE74CFC00DCBDB6 /* ExecutableAllocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExecutableAllocator.h; sourceTree = "<group>"; };
    649657                A7B48DB60EE74CFC00DCBDB6 /* ExecutableAllocator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExecutableAllocator.cpp; sourceTree = "<group>"; };
     
    13381346                                F692A8850255597D01FF60F7 /* UString.cpp */,
    13391347                                F692A8860255597D01FF60F7 /* UString.h */,
     1348                                A791EE590F11D90C00AE1F68 /* ByteArray.h */,
     1349                                A791EE5A0F11D90C00AE1F68 /* ByteArray.cpp */,
     1350                                A791EF260F11E07900AE1F68 /* JSByteArray.h */,
     1351                                A791EF270F11E07900AE1F68 /* JSByteArray.cpp */,
    13401352                        );
    13411353                        path = runtime;
     
    16761688                                BC18C44E0E16F5CD00B34460 /* pcre_internal.h in Headers */,
    16771689                                BC18C4720E16F5CD00B34460 /* ucpinternal.h in Headers */,
     1690                                A791EE5B0F11D90C00AE1F68 /* ByteArray.h in Headers */,
     1691                                A791EF280F11E07900AE1F68 /* JSByteArray.h in Headers */,
    16781692                        );
    16791693                        runOnlyForDeploymentPostprocessing = 0;
     
    20242038                                93E26BD408B1514100F85226 /* pcre_xclass.cpp in Sources */,
    20252039                                5D6A566B0F05995500266145 /* Threading.cpp in Sources */,
     2040                                A791EE5C0F11D90C00AE1F68 /* ByteArray.cpp in Sources */,
     2041                                A791EF290F11E07900AE1F68 /* JSByteArray.cpp in Sources */,
    20262042                        );
    20272043                        runOnlyForDeploymentPostprocessing = 0;
Note: See TracChangeset for help on using the changeset viewer.