Add a JSScriptRef API to JSC so that we can allow API users to avoid the full cost...
authoroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Dec 2012 02:19:37 +0000 (02:19 +0000)
committeroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Dec 2012 02:19:37 +0000 (02:19 +0000)
commitffd06a3f1bd2367a0f95a7b160a5309ec63247c1
treea76579713021783813f366c1ebf847f56318941f
parent99e0be49b67f83b9494cf47256a6019d394bd5f7
Add a JSScriptRef API to JSC so that we can allow API users to avoid the full cost of reparsing everytime the execute a script.
https://bugs.webkit.org/show_bug.cgi?id=105340

Reviewed by Gavin Barraclough.

This patch adds a (currently private) API to allow users of the JSC API to create a JSScript object
that references a reusable version of the script that they wish to evaluate.  This can help us avoid
numeorus copies that are otherwise induced by our existing API and gives us an opaque object that we
can hang various caches off.  Currently this is simply a simple SourceProvider, but in future we may
be able to add more caching without requiring new/replacement APIs.

* API/JSScriptRef.cpp: Added.
* API/JSScriptRefPrivate.h: Added.
* API/tests/testapi.c:
  Add tests for new APIs.
* JavaScriptCore.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@138098 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/API/JSScriptRef.cpp [new file with mode: 0644]
Source/JavaScriptCore/API/JSScriptRefPrivate.h [new file with mode: 0644]
Source/JavaScriptCore/API/tests/testapi.c
Source/JavaScriptCore/CMakeLists.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/GNUmakefile.list.am
Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/Target.pri