diff options
author | Iain Merrick <husky@google.com> | 2010-09-13 16:35:48 +0100 |
---|---|---|
committer | Iain Merrick <husky@google.com> | 2010-09-16 12:10:42 +0100 |
commit | 5abb8606fa57c3ebfc8b3c3dbc3fa4a25d2ae306 (patch) | |
tree | ddce1aa5e3b6967a69691892e500897558ff8ab6 /JavaScriptCore | |
parent | 12bec63ec71e46baba27f0bd9bd9d8067683690a (diff) | |
download | external_webkit-5abb8606fa57c3ebfc8b3c3dbc3fa4a25d2ae306.zip external_webkit-5abb8606fa57c3ebfc8b3c3dbc3fa4a25d2ae306.tar.gz external_webkit-5abb8606fa57c3ebfc8b3c3dbc3fa4a25d2ae306.tar.bz2 |
Merge WebKit at r67178 : Initial merge by git.
Change-Id: I57e01163b6866cb029cdadf405a0394a3918bc18
Diffstat (limited to 'JavaScriptCore')
46 files changed, 1661 insertions, 266 deletions
diff --git a/JavaScriptCore/API/JSObjectRef.cpp b/JavaScriptCore/API/JSObjectRef.cpp index 5e0536f..8bd33d6 100644 --- a/JavaScriptCore/API/JSObjectRef.cpp +++ b/JavaScriptCore/API/JSObjectRef.cpp @@ -382,7 +382,7 @@ bool JSObjectSetPrivateProperty(JSContextRef ctx, JSObjectRef object, JSStringRe ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); JSObject* jsObject = toJS(object); - JSValue jsValue = toJS(exec, value); + JSValue jsValue = value ? toJS(exec, value) : JSValue(); Identifier name(propertyName->identifier(&exec->globalData())); if (jsObject->inherits(&JSCallbackObject<JSGlobalObject>::info)) { static_cast<JSCallbackObject<JSGlobalObject>*>(jsObject)->setPrivateProperty(name, jsValue); diff --git a/JavaScriptCore/API/tests/testapi.c b/JavaScriptCore/API/tests/testapi.c index 183abf5..1ecfc7e 100644 --- a/JavaScriptCore/API/tests/testapi.c +++ b/JavaScriptCore/API/tests/testapi.c @@ -933,17 +933,15 @@ int main(int argc, char* argv[]) JSStringRef privatePropertyName = JSStringCreateWithUTF8CString("privateProperty"); if (!JSObjectSetPrivateProperty(context, myObject, privatePropertyName, aHeapRef)) { printf("FAIL: Could not set private property.\n"); - failed = 1; - } else { + failed = 1; + } else printf("PASS: Set private property.\n"); - } aStackRef = 0; if (JSObjectSetPrivateProperty(context, aHeapRef, privatePropertyName, aHeapRef)) { printf("FAIL: JSObjectSetPrivateProperty should fail on non-API objects.\n"); - failed = 1; - } else { + failed = 1; + } else printf("PASS: Did not allow JSObjectSetPrivateProperty on a non-API object.\n"); - } if (JSObjectGetPrivateProperty(context, myObject, privatePropertyName) != aHeapRef) { printf("FAIL: Could not retrieve private property.\n"); failed = 1; @@ -954,15 +952,15 @@ int main(int argc, char* argv[]) failed = 1; } else printf("PASS: JSObjectGetPrivateProperty return NULL.\n"); - + if (JSObjectGetProperty(context, myObject, privatePropertyName, 0) == aHeapRef) { printf("FAIL: Accessed private property through ordinary property lookup.\n"); failed = 1; } else printf("PASS: Cannot access private property through ordinary property lookup.\n"); - + JSGarbageCollect(context); - + for (int i = 0; i < 10000; i++) JSObjectMake(context, 0, 0); @@ -973,7 +971,18 @@ int main(int argc, char* argv[]) } else printf("PASS: Private property does not appear to have been collected.\n"); JSStringRelease(lengthStr); - + + if (!JSObjectSetPrivateProperty(context, myObject, privatePropertyName, 0)) { + printf("FAIL: Could not set private property to NULL.\n"); + failed = 1; + } else + printf("PASS: Set private property to NULL.\n"); + if (JSObjectGetPrivateProperty(context, myObject, privatePropertyName)) { + printf("FAIL: Could not retrieve private property.\n"); + failed = 1; + } else + printf("PASS: Retrieved private property.\n"); + JSStringRef validJSON = JSStringCreateWithUTF8CString("{\"aProperty\":true}"); JSValueRef jsonObject = JSValueMakeFromJSONString(context, validJSON); JSStringRelease(validJSON); diff --git a/JavaScriptCore/CMakeListsEfl.txt b/JavaScriptCore/CMakeListsEfl.txt index 7897ea5..90ee22b 100644 --- a/JavaScriptCore/CMakeListsEfl.txt +++ b/JavaScriptCore/CMakeListsEfl.txt @@ -8,6 +8,12 @@ LIST(APPEND JavaScriptCore_LIBRARIES ${ICU_I18N_LIBRARIES} ) +IF (ENABLE_GLIB_SUPPORT) + LIST(APPEND JavaScriptCore_INCLUDE_DIRECTORIES + ${JAVASCRIPTCORE_DIR}/wtf/gobject + ) +ENDIF () + LIST(APPEND JavaScriptCore_LINK_FLAGS ${ECORE_LDFLAGS} ) diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog index 1cf4ccd..85860d8 100644 --- a/JavaScriptCore/ChangeLog +++ b/JavaScriptCore/ChangeLog @@ -1,3 +1,476 @@ +2010-09-09 Michael Saboff <msaboff@apple.com> + + Reviewed by Gavin Barraclough. + + Added a regular expression tracing facility. This tracing is connected + to jsc. Every compiled regular expression object is added to a list. + When the process exits, each regular expression dumps its pattern, + JIT address, number of times it was executed and the number of matches. + This tracing is controlled by the macro ENABLE_REGEXP_TRACING in + wtf/Platform.h. + https://bugs.webkit.org/show_bug.cgi?id=45401 + + * JavaScriptCore.exp: + * jsc.cpp: + (runWithScripts): + * runtime/JSGlobalData.cpp: + (JSC::JSGlobalData::JSGlobalData): + (JSC::JSGlobalData::~JSGlobalData): + (JSC::JSGlobalData::addRegExpToTrace): + (JSC::JSGlobalData::dumpRegExpTrace): + * runtime/JSGlobalData.h: + * runtime/RegExp.cpp: + (JSC::RegExp::RegExp): + (JSC::RegExp::create): + (JSC::RegExp::match): + * runtime/RegExp.h: + * wtf/Platform.h: + * yarr/RegexJIT.h: + (JSC::Yarr::RegexCodeBlock::getAddr): + +2010-09-09 John Therrell <jtherrell@apple.com> + + 32-bit build fix. + + * jit/ExecutableAllocator.cpp: + (JSC::ExecutableAllocator::committedByteCount): + +2010-09-09 John Therrell <jtherrell@apple.com> + + Reviewed by Alexey Proskuryakov. + + Added statistics sampling and reporting for JavaScriptCore's RegisterFile and ExecutableAllocator classes + https://bugs.webkit.org/show_bug.cgi?id=45134 + + Added thread-safe committed byte counting and reporting functionality to RegisterFile and + ExecutableAllocator. + + * JavaScriptCore.exp: + Exported new symbols to allow for WebKit to get statistics from JavaScriptCore classes. + + * interpreter/RegisterFile.cpp: + (JSC::registerFileStatisticsMutex): + Added function which returns a static Mutex used for locking during read/write access to + static committed byte count variable. + (JSC::RegisterFile::~RegisterFile): + Added call to addToStatistics since memory is decommitted here. + (JSC::RegisterFile::releaseExcessCapacity): + Added call to addToStatistics since memory is decommitted here. + (JSC::RegisterFile::initializeThreading): + Added function which calls registerFileStatisticsMutex(). + (JSC::RegisterFile::committedByteCount): + Added function which returns the current committed byte count for RegisterFile. + (JSC::RegisterFile::addToCommittedByteCount): + Added function which updates committed byte count. + + * interpreter/RegisterFile.h: + (JSC::RegisterFile::RegisterFile): + Added call to addToStatistics since memory is committed here. + (JSC::RegisterFile::grow): + Added call to addToStatistics since memory is committed here. + + * jit/ExecutableAllocator.h: + Added function prototype for public static function committedByteCount(). + + * jit/ExecutableAllocatorFixedVMPool.cpp: + (JSC::FixedVMPoolAllocator::release): + Added call to addToStatistics since memory is decommitted here. + (JSC::FixedVMPoolAllocator::reuse): + Added call to addToStatistics since memory is committed here. + (JSC::FixedVMPoolAllocator::addToCommittedByteCount): + Added function which updates committed byte count. + (JSC::ExecutableAllocator::committedByteCount): + Added function which returns the current committed byte count for ExecutableAllocator. + + * runtime/InitializeThreading.cpp: + (JSC::initializeThreadingOnce): + Added call to RegisterFile::initializeThreading. + +2010-09-09 Mark Rowe <mrowe@apple.com> + + Reviewed by Oliver Hunt. + + <http://webkit.org/b/45502> JSObjectSetPrivateProperty does not handle NULL values as it claims + + * API/JSObjectRef.cpp: + (JSObjectSetPrivateProperty): Don't call toJS if we have a NULL value as that will cause an assertion + failure. Instead map NULL directly to the null JSValue. + * API/tests/testapi.c: + (main): Add test coverage for the NULL value case. + +2010-09-09 Csaba Osztrogonác <ossy@webkit.org> + + Reviewed by Gavin Barraclough. + + [Qt] JSVALUE32_64 not works on Windows platform with MinGW compiler + https://bugs.webkit.org/show_bug.cgi?id=29268 + + * wtf/Platform.h: Enable JSVALUE32_64 for Qt/Windows/MinGW, because it works now. + +2010-09-08 Zoltan Herczeg <zherczeg@webkit.org> + + Reviewed by Darin Adler. + + Removing doneSemicolon label in the lexer + https://bugs.webkit.org/show_bug.cgi?id=45289 + + As a side effect of moving the multiline comment parsing + to a separate function, an opportunity raised to simplify + the single line comment parsing, and removing doneSemicolon + label. Slight performance increase on --parse-only + tests (from 32.8ms to 31.5ms) + + * parser/Lexer.cpp: + (JSC::Lexer::lex): + +2010-09-08 Xan Lopez <xlopez@igalia.com> + + Reviewed by Alexey Proskuryakov. + + Remove accessor for private member variable in JSParser + https://bugs.webkit.org/show_bug.cgi?id=45378 + + m_token is private to JSParser, so it does not seem to be useful + to have an accessor for it. On top of that, the file was both + using the accessor and directly accessing the member variable, + only one style should be used. + +2010-09-08 Csaba Osztrogonác <ossy@webkit.org> + + Reviewed by Oliver Hunt. + + [Qt] REGRESSION(63348): jsc is broken + https://bugs.webkit.org/show_bug.cgi?id=42818 + + Need fastcall conventions on Qt/Win/MinGW. + Based on patches of Gavin Barraclough: r63947 and r63948. + + * jit/JITStubs.cpp: + * jit/JITStubs.h: + +2010-09-08 Robert Hogan <robert@webkit.org> + + Reviewed by Antonio Gomes. + + Remove some unnecessary duplicate calls to string functions + + https://bugs.webkit.org/show_bug.cgi?id=45314 + + * wtf/text/WTFString.cpp: + (WTF::String::format): + +2010-09-08 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by Andreas Kling. + + Re-Disable JIT for MSVC 64bit to fix the build on this compiler. + https://bugs.webkit.org/show_bug.cgi?id=45382 + + It was enabled in the cleanup made in r64176, though it is still + not implemented. + + * wtf/Platform.h: + +2010-09-08 Martin Robinson <mrobinson@igalia.com> + + Reviewed by Xan Lopez. + + [GTK] Need a WebSocket implementation + https://bugs.webkit.org/show_bug.cgi?id=45197 + + Add a GIO-based WebSocket implementation. + + * wtf/gobject/GRefPtr.cpp: Added PlatformRefPtr support for GSource. + (WTF::refPlatformPtr): + (WTF::derefPlatformPtr): + * wtf/gobject/GRefPtr.h: Added new template specialization declarations. + * wtf/gobject/GTypedefs.h: Add some more GLib/GIO forward declarations. + +2010-08-30 Maciej Stachowiak <mjs@apple.com> + + Reviewed by Darin Adler. + + Handle MediaQueryExp memory management exclusively with smart pointers + https://bugs.webkit.org/show_bug.cgi?id=44874 + + Implemented a non-copying sort function to make it possible to sort a Vector + of OwnPtrs (which cannot be copied). This is required for the above. + + * wtf/NonCopyingSort.h: Added. + (WTF::nonCopyingSort): It's secretly heapsort. + (WTF::heapSort): heapsort implementation. + (WTF::siftDown): Helper function for heapsort. + (WTF::heapify): ditto + + Adjust build systems. + + * GNUmakefile.am: + * JavaScriptCore.gypi: + * JavaScriptCore.vcproj/WTF/WTF.vcproj: + * JavaScriptCore.xcodeproj/project.pbxproj: + +2010-09-08 Zoltan Herczeg <zherczeg@webkit.org> + + Reviewed by Darin Adler. + + Refactoring multiline comments in the lexer + https://bugs.webkit.org/show_bug.cgi?id=45289 + + MultiLine comment parsing is moved to a separate function. + + Slight performance increase on --parse-only tests (from 33.6ms to 32.8ms) + SunSpider reports no change (from 523.1ms to 521.2ms). + + * parser/Lexer.cpp: + (JSC::Lexer::parseMultilineComment): + (JSC::Lexer::lex): + * parser/Lexer.h: + +2010-09-07 James Robinson <jamesr@chromium.org> + + Compile fix attempt for windows. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + +2010-09-07 Mihai Parparita <mihaip@chromium.org> + + Reviewed by James Robinson. + + Fix Windows build after r66936 + https://bugs.webkit.org/show_bug.cgi?id=45348 + + Add symbol names that were missing from r66936. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + +2010-09-07 Mihai Parparita <mihaip@chromium.org> + + Reviewed by Oliver Hunt. + + pushState and replaceState do not clone RegExp objects correctly + https://bugs.webkit.org/show_bug.cgi?id=44718 + + Move internal representation of JSC::RegExp (which depends on wether + YARR and YARR_JIT is enabled) into RegExpRepresentation which can live + in the implementation only. This makes it feasible to use RegExp in + WebCore without bringing in all of YARR. + + * JavaScriptCore.exp: Export RegExp and RegExpObject functions that are + needed inside WebCore's JSC bindings. + * runtime/RegExp.cpp: + (JSC::RegExpRepresentation::~RegExpRepresentation): + (JSC::RegExp::RegExp): + (JSC::RegExp::~RegExp): + (JSC::RegExp::compile): + (JSC::RegExp::match): + * runtime/RegExp.h: + +2010-09-07 Anders Carlsson <andersca@apple.com> + + Reviewed by Darin Adler. + + <rdar://problem/8381749> -Wcast-align warning emitted when building with clang + + Remove the -Wcast-align-warning since it isn't really useful, and clang is more aggressive about warning than gcc. + + * Configurations/Base.xcconfig: + +2010-09-07 Zoltan Horvath <zoltan@webkit.org> + + Reviewed by Darin Adler. + + REGRESSION(66741): Undefined pthread macros + https://bugs.webkit.org/show_bug.cgi?id=45246 + + PTHREAD_MUTEX_NORMAL and PTHREAD_MUTEX_DEFAULT (introduced in r60487) are not defined on Linux, + but used in a statement. Add an additional check to test this. + + * wtf/FastMalloc.cpp: + (WTF::TCMalloc_PageHeap::initializeScavenger): + +2010-09-06 Oliver Hunt <oliver@apple.com> + + Windows build fix + +2010-09-05 Oliver Hunt <oliver@apple.com> + + Reviewed by Sam Weinig. + + SerializedScriptValue needs to use a flat storage mechanism + https://bugs.webkit.org/show_bug.cgi?id=45244 + + Export JSArray::put + + * JavaScriptCore.exp: + +2010-09-06 Chao-ying Fu <fu@mips.com> + + Reviewed by Oliver Hunt. + + Support JSVALUE32_64 on MIPS + https://bugs.webkit.org/show_bug.cgi?id=43999 + + Add missing functions to support JSVALUE32_64 on MIPS. + Remove JSVALUE32 as the default for MIPS. + + * assembler/MIPSAssembler.h: + (JSC::MIPSAssembler::divd): + (JSC::MIPSAssembler::mthc1): + (JSC::MIPSAssembler::cvtwd): + * assembler/MacroAssemblerMIPS.h: + (JSC::MacroAssemblerMIPS::neg32): + (JSC::MacroAssemblerMIPS::branchOr32): + (JSC::MacroAssemblerMIPS::set8): + (JSC::MacroAssemblerMIPS::loadDouble): + (JSC::MacroAssemblerMIPS::divDouble): + (JSC::MacroAssemblerMIPS::convertInt32ToDouble): + (JSC::MacroAssemblerMIPS::branchDouble): + (JSC::MacroAssemblerMIPS::branchConvertDoubleToInt32): + (JSC::MacroAssemblerMIPS::zeroDouble): + * jit/JIT.h: + * jit/JITOpcodes32_64.cpp: + (JSC::JIT::privateCompileCTINativeCall): + * jit/JITPropertyAccess32_64.cpp: + (JSC::JIT::privateCompilePutByIdTransition): + * jit/JITStubs.cpp: + (JSC::JITThunks::JITThunks): + * jit/JITStubs.h: + * wtf/Platform.h: + +2010-09-06 Robert Hogan <robert@webkit.org> + + Unreviewed, compile fix. + + Fix compile failure in r66843 + + Revert to original patch in bugzilla. Leave bug open for + discussion on potential removal of double utf8 conversion. + + https://bugs.webkit.org/show_bug.cgi?id=45240 + + * wtf/text/WTFString.cpp: + (WTF::String::format): + +2010-09-06 Robert Hogan <robert@webkit.org> + + Reviewed by Andreas Kling. + + [Qt] utf8 encoding of console() messages + + Unskip: + http/tests/security/xssAuditor/embed-tag-null-char.html + http/tests/security/xssAuditor/object-embed-tag-null-char.html + + Both tests failed because Qt's implementation of String::format() + is casting a utf8 result to String, which assumes latin1 in + its constructor. So instead of casting a QString to a String, use + StringImpl::create() instead. Unfortunately, this involves a lot + of extra casts but the end result is correct. + + https://bugs.webkit.org/show_bug.cgi?id=45240 + + * wtf/text/WTFString.cpp: + (WTF::String::format): + +2010-09-03 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=45135 + <rdar://problem/7823714> TCMalloc_PageHeap doesn't hold a mutex while manipulating shared data + + * wtf/FastMalloc.cpp: + (WTF::TCMalloc_PageHeap::initializeScavenger): Make sure to create a non-recursive mutex + regardless of platform default, so that we can assert that it's held (this is for platforms + that don't have libdispatch). + (WTF::TCMalloc_PageHeap::signalScavenger): Assert that the mutex is held, so we can look + at m_scavengeThreadActive. For platforms that have libdispatch, assert that pageheap_lock + is held. + (WTF::TCMalloc_PageHeap::periodicScavenge): Make sure that pageheap_lock is held before + manipulating m_scavengeThreadActive. Otherwise, there is an obvious race condition, and we + can make unbalanced calls to dispatch_resume(). + +2010-09-03 Lucas De Marchi <lucas.demarchi@profusion.mobi> + + Reviewed by Martin Robinson. + + [EFL] Regression (66531) Build break with Glib Support + https://bugs.webkit.org/show_bug.cgi?id=45011 + + Move GtkTypedefs.h to GTypedefs.h and let it inside gobject directory + since when glib is enabled, EFL port needs it, too. + + * CMakeListsEfl.txt: Include gobject directory to find new header + file. + * GNUmakefile.am: Ditto. + * wtf/CMakeListsEfl.txt: Ditto. + * wtf/Platform.h: Include header if port is EFL and glib support is + enabled. + * wtf/gtk/GtkTypedefs.h: Removed. + * wtf/gobject/GTypedefs.h: Added. Sections specific to GTK are now + guarded by PLATFORM(GTK). + +2010-09-03 Csaba Osztrogonác <ossy@webkit.org> + + Reviewed by Simon Hausmann. + + Fix warning in wtf/ByteArray.h + https://bugs.webkit.org/show_bug.cgi?id=44672 + + * wtf/ByteArray.h: Use maximal sized array for MSVC and unsized array for other compilers. + +2010-09-02 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + Actually parse a URL from ParsedURL + https://bugs.webkit.org/show_bug.cgi?id=45080 + + This patch only handles standard URLs. At some point we'll need to + distinguish between standard URLs and other kinds of URLs. + + * wtf/url/api/ParsedURL.cpp: + (WTF::ParsedURL::ParsedURL): + +2010-09-02 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + Add ParsedURL and URLString to WTFURL API + https://bugs.webkit.org/show_bug.cgi?id=45078 + + Currently there's no actual URL parsing going on, but this patch is a + start to sketching out the API. + + * JavaScriptCore.xcodeproj/project.pbxproj: + * wtf/url/api/ParsedURL.cpp: Added. + (WTF::ParsedURL::ParsedURL): + (WTF::ParsedURL::scheme): + (WTF::ParsedURL::username): + (WTF::ParsedURL::password): + (WTF::ParsedURL::host): + (WTF::ParsedURL::port): + (WTF::ParsedURL::path): + (WTF::ParsedURL::query): + (WTF::ParsedURL::fragment): + (WTF::ParsedURL::segment): + * wtf/url/api/ParsedURL.h: Added. + (WTF::ParsedURL::spec): + * wtf/url/api/URLString.h: Added. + (WTF::URLString::URLString): + (WTF::URLString::string): + +2010-09-02 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + Add WTFURL to the JavaScriptCore build on Mac + https://bugs.webkit.org/show_bug.cgi?id=45075 + + Building code is good. + + * JavaScriptCore.xcodeproj/project.pbxproj: + 2010-09-02 Alexey Proskuryakov <ap@apple.com> Reviewed by Oliver Hunt. diff --git a/JavaScriptCore/Configurations/Base.xcconfig b/JavaScriptCore/Configurations/Base.xcconfig index 72de2fe..09b6de1 100644 --- a/JavaScriptCore/Configurations/Base.xcconfig +++ b/JavaScriptCore/Configurations/Base.xcconfig @@ -57,14 +57,14 @@ VALID_ARCHS_macosx = i386 ppc x86_64 ppc64 $(ARCHS_UNIVERSAL_IPHONE_OS); WARNING_CFLAGS_BASE = -Wall -Wextra -Wcast-qual -Wchar-subscripts -Wextra-tokens -Wformat=2 -Winit-self -Wmissing-format-attribute -Wmissing-noreturn -Wpacked -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings; WARNING_CFLAGS = $(WARNING_CFLAGS_$(REAL_PLATFORM_NAME)); WARNING_CFLAGS_iphoneos = $(WARNING_CFLAGS_BASE) -Wshorten-64-to-32; -WARNING_CFLAGS_iphonesimulator = $(WARNING_CFLAGS_BASE) -Wcast-align -Wshorten-64-to-32; +WARNING_CFLAGS_iphonesimulator = $(WARNING_CFLAGS_BASE) -Wshorten-64-to-32; WARNING_CFLAGS_macosx = $(WARNING_CFLAGS_macosx_$(CURRENT_ARCH)); -WARNING_CFLAGS_macosx_ = $(WARNING_CFLAGS_BASE) -Wcast-align -Wshorten-64-to-32; -WARNING_CFLAGS_macosx_i386 = $(WARNING_CFLAGS_BASE) -Wcast-align -Wshorten-64-to-32; -WARNING_CFLAGS_macosx_ppc = $(WARNING_CFLAGS_BASE) -Wcast-align -Wshorten-64-to-32; +WARNING_CFLAGS_macosx_ = $(WARNING_CFLAGS_BASE) -Wshorten-64-to-32; +WARNING_CFLAGS_macosx_i386 = $(WARNING_CFLAGS_BASE) -Wshorten-64-to-32; +WARNING_CFLAGS_macosx_ppc = $(WARNING_CFLAGS_BASE) -Wshorten-64-to-32; // FIXME: JavaScriptCore 64-bit builds should build with -Wshorten-64-to-32 -WARNING_CFLAGS_macosx_ppc64 = $(WARNING_CFLAGS_BASE) -Wcast-align; -WARNING_CFLAGS_macosx_x86_64 = $(WARNING_CFLAGS_BASE) -Wcast-align; +WARNING_CFLAGS_macosx_ppc64 = $(WARNING_CFLAGS_BASE); +WARNING_CFLAGS_macosx_x86_64 = $(WARNING_CFLAGS_BASE); HEADER_SEARCH_PATHS = . icu $(HEADER_SEARCH_PATHS); diff --git a/JavaScriptCore/Configurations/Version.xcconfig b/JavaScriptCore/Configurations/Version.xcconfig index 29f35ef..673e234 100644 --- a/JavaScriptCore/Configurations/Version.xcconfig +++ b/JavaScriptCore/Configurations/Version.xcconfig @@ -22,7 +22,7 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. MAJOR_VERSION = 534; -MINOR_VERSION = 7; +MINOR_VERSION = 8; TINY_VERSION = 0; FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION); diff --git a/JavaScriptCore/GNUmakefile.am b/JavaScriptCore/GNUmakefile.am index b4c658e..dd2ba21 100644 --- a/JavaScriptCore/GNUmakefile.am +++ b/JavaScriptCore/GNUmakefile.am @@ -442,7 +442,7 @@ javascriptcore_sources += \ JavaScriptCore/wtf/gobject/GOwnPtr.h \ JavaScriptCore/wtf/gobject/GRefPtr.cpp \ JavaScriptCore/wtf/gobject/GRefPtr.h \ - JavaScriptCore/wtf/gtk/GtkTypedefs.h \ + JavaScriptCore/wtf/gobject/GTypedefs.h \ JavaScriptCore/wtf/gtk/MainThreadGtk.cpp \ JavaScriptCore/wtf/gtk/ThreadingGtk.cpp \ JavaScriptCore/wtf/HashCountedSet.h \ @@ -463,6 +463,7 @@ javascriptcore_sources += \ JavaScriptCore/wtf/MD5.cpp \ JavaScriptCore/wtf/MD5.h \ JavaScriptCore/wtf/MessageQueue.h \ + JavaScriptCore/wtf/NonCopyingSort.h \ JavaScriptCore/wtf/Noncopyable.h \ JavaScriptCore/wtf/NotFound.h \ JavaScriptCore/wtf/OwnArrayPtr.h \ diff --git a/JavaScriptCore/JavaScriptCore.exp b/JavaScriptCore/JavaScriptCore.exp index 30f5aa8..ee0bfb7 100644 --- a/JavaScriptCore/JavaScriptCore.exp +++ b/JavaScriptCore/JavaScriptCore.exp @@ -129,8 +129,10 @@ __ZN3JSC12JSGlobalData13startSamplingEv __ZN3JSC12JSGlobalData14dumpSampleDataEPNS_9ExecStateE __ZN3JSC12JSGlobalData14resetDateCacheEv __ZN3JSC12JSGlobalData14sharedInstanceEv +__ZN3JSC12JSGlobalData15dumpRegExpTraceEv __ZN3JSC12JSGlobalData6createENS_15ThreadStackTypeE __ZN3JSC12JSGlobalDataD1Ev +__ZN3JSC12RegisterFile18committedByteCountEv __ZN3JSC12SamplingTool5setupEv __ZN3JSC12SmallStrings17createEmptyStringEPNS_12JSGlobalDataE __ZN3JSC12SmallStrings27createSingleCharacterStringEPNS_12JSGlobalDataEh @@ -191,6 +193,7 @@ __ZN3JSC18PropertyDescriptor17defaultAttributesE __ZN3JSC18PropertyDescriptor21setAccessorDescriptorENS_7JSValueES1_j __ZN3JSC18PropertyDescriptor9setGetterENS_7JSValueE __ZN3JSC18PropertyDescriptor9setSetterENS_7JSValueE +__ZN3JSC19ExecutableAllocator18committedByteCountEv __ZN3JSC19initializeThreadingEv __ZN3JSC20MarkedArgumentBuffer10slowAppendENS_7JSValueE __ZN3JSC20createReferenceErrorEPNS_9ExecStateERKNS_7UStringE @@ -241,6 +244,7 @@ __ZN3JSC6JSLockC1EPNS_9ExecStateE __ZN3JSC6Parser5parseEPNS_12JSGlobalDataEPiPNS_7UStringE __ZN3JSC7JSArray12markChildrenERNS_9MarkStackE __ZN3JSC7JSArray15setSubclassDataEPv +__ZN3JSC7JSArray18getOwnPropertySlotEPNS_9ExecStateEjRNS_12PropertySlotE __ZN3JSC7JSArray4infoE __ZN3JSC7JSArray9setLengthEj __ZN3JSC7JSArrayC1EN3WTF17NonNullPassRefPtrINS_9StructureEEE @@ -480,6 +484,8 @@ __ZNK3JSC10JSFunction23isHostFunctionNonInlineEv __ZNK3JSC11Interpreter14retrieveCallerEPNS_9ExecStateEPNS_10JSFunctionE __ZNK3JSC11Interpreter18retrieveLastCallerEPNS_9ExecStateERiRlRNS_7UStringERNS_7JSValueE __ZNK3JSC12PropertySlot14functionGetterEPNS_9ExecStateE +__ZN3JSC12RegExpObject4infoE +__ZN3JSC12RegExpObjectC1EPNS_14JSGlobalObjectEN3WTF17NonNullPassRefPtrINS_9StructureEEENS4_INS_6RegExpEEE __ZNK3JSC14JSGlobalObject14isDynamicScopeERb __ZNK3JSC16InternalFunction9classInfoEv __ZNK3JSC16JSVariableObject16isVariableObjectEv @@ -510,6 +516,8 @@ __ZNK3JSC6JSCell9getStringEPNS_9ExecStateE __ZNK3JSC6JSCell9getStringEPNS_9ExecStateERNS_7UStringE __ZNK3JSC6JSCell9getUInt32ERj __ZNK3JSC6JSCell9toBooleanEPNS_9ExecStateE +__ZN3JSC6RegExp6createEPNS_12JSGlobalDataERKNS_7UStringES5_ +__ZN3JSC6RegExpD1Ev __ZNK3JSC7ArgList8getSliceEiRS0_ __ZNK3JSC7JSArray12subclassDataEv __ZNK3JSC7JSValue16toObjectSlowCaseEPNS_9ExecStateE diff --git a/JavaScriptCore/JavaScriptCore.gypi b/JavaScriptCore/JavaScriptCore.gypi index 12614d0..462960d 100644 --- a/JavaScriptCore/JavaScriptCore.gypi +++ b/JavaScriptCore/JavaScriptCore.gypi @@ -394,6 +394,7 @@ 'wtf/MallocZoneSupport.h', 'wtf/MathExtras.h', 'wtf/MessageQueue.h', + 'wtf/NonCopyingSort.h', 'wtf/Noncopyable.h', 'wtf/NotFound.h', 'wtf/OwnArrayPtr.h', diff --git a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def index cb9c820..7226326 100644 --- a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def +++ b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def @@ -17,10 +17,12 @@ EXPORTS ??0Mutex@WTF@@QAE@XZ ??0PrototypeFunction@JSC@@QAE@PAVExecState@1@PAVJSGlobalObject@1@V?$NonNullPassRefPtr@VStructure@JSC@@@WTF@@HABVIdentifier@1@P6I_J0@Z@Z ??0RefCountedLeakCounter@WTF@@QAE@PBD@Z + ??0RegExpObject@JSC@@QAE@PAVJSGlobalObject@1@V?$NonNullPassRefPtr@VStructure@JSC@@@WTF@@V?$NonNullPassRefPtr@VRegExp@JSC@@@4@@Z ??0StringObject@JSC@@QAE@PAVExecState@1@V?$NonNullPassRefPtr@VStructure@JSC@@@WTF@@ABVUString@1@@Z ??0Structure@JSC@@AAE@VJSValue@1@ABVTypeInfo@1@I@Z ??0ThreadCondition@WTF@@QAE@XZ ??0UString@JSC@@QAE@PBD@Z + ??0UString@JSC@@QAE@PBDI@Z ??0UString@JSC@@QAE@PB_WI@Z ??0WTFThreadData@WTF@@QAE@XZ ??1ClientData@JSGlobalData@JSC@@UAE@XZ @@ -31,6 +33,7 @@ EXPORTS ??1JSGlobalObject@JSC@@UAE@XZ ??1Mutex@WTF@@QAE@XZ ??1RefCountedLeakCounter@WTF@@QAE@XZ + ??1RegExp@JSC@@QAE@XZ ??1Structure@JSC@@QAE@XZ ??1ThreadCondition@WTF@@QAE@XZ ??1WTFThreadData@WTF@@QAE@XZ @@ -79,6 +82,7 @@ EXPORTS ?create@ByteArray@WTF@@SA?AV?$PassRefPtr@VByteArray@WTF@@@2@I@Z ?create@JSGlobalData@JSC@@SA?AV?$PassRefPtr@VJSGlobalData@JSC@@@WTF@@W4ThreadStackType@2@@Z ?create@OpaqueJSString@@SA?AV?$PassRefPtr@UOpaqueJSString@@@WTF@@ABVUString@JSC@@@Z + ?create@RegExp@JSC@@SA?AV?$PassRefPtr@VRegExp@JSC@@@WTF@@PAVJSGlobalData@2@ABVUString@2@1@Z ?createEmptyString@SmallStrings@JSC@@AAEXPAVJSGlobalData@2@@Z ?createError@JSC@@YAPAVJSObject@1@PAVExecState@1@ABVUString@1@@Z ?createInheritorID@JSObject@JSC@@AAEPAVStructure@2@XZ @@ -162,6 +166,7 @@ EXPORTS ?getOwnPropertyNames@JSObject@JSC@@UAEXPAVExecState@2@AAVPropertyNameArray@2@W4EnumerationMode@2@@Z ?getOwnPropertyNames@JSVariableObject@JSC@@UAEXPAVExecState@2@AAVPropertyNameArray@2@W4EnumerationMode@2@@Z ?getOwnPropertyNames@StringObject@JSC@@UAEXPAVExecState@2@AAVPropertyNameArray@2@W4EnumerationMode@2@@Z + ?getOwnPropertySlot@JSArray@JSC@@UAE_NPAVExecState@2@IAAVPropertySlot@2@@Z ?getOwnPropertySlot@JSCell@JSC@@EAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertySlot@2@@Z ?getOwnPropertySlot@JSCell@JSC@@EAE_NPAVExecState@2@IAAVPropertySlot@2@@Z ?getOwnPropertySlot@JSObject@JSC@@UAE_NPAVExecState@2@IAAVPropertySlot@2@@Z @@ -188,6 +193,7 @@ EXPORTS ?hasTransition@Structure@JSC@@QAE_NPAVStringImpl@WTF@@I@Z ?heap@Heap@JSC@@SAPAV12@VJSValue@2@@Z ?increment@RefCountedLeakCounter@WTF@@QAEXXZ + ?info@RegExpObject@JSC@@2UClassInfo@2@B ?init@AtomicString@WTF@@SAXXZ ?init@JSGlobalObject@JSC@@AAEXPAVJSObject@2@@Z ?initializeMainThread@WTF@@YAXXZ diff --git a/JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj b/JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj index 7bb2e2a..42a91eb 100644 --- a/JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj +++ b/JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj @@ -405,6 +405,10 @@ >
</File>
<File
+ RelativePath="..\..\wtf\NonCopyingSort.h"
+ >
+ </File>
+ <File
RelativePath="..\..\wtf\Noncopyable.h"
>
</File>
diff --git a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj index f9a547e..bee44b6 100644 --- a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj +++ b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj @@ -188,6 +188,7 @@ 6507D29E0E871E5E00D7D896 /* JSTypeInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 6507D2970E871E4A00D7D896 /* JSTypeInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; 655EB29B10CE2581001A990E /* NodesCodegen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 655EB29A10CE2581001A990E /* NodesCodegen.cpp */; }; 65DFC93308EA173A00F7300B /* HashTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65DFC92D08EA173A00F7300B /* HashTable.cpp */; }; + 65E1A3DF122B894500B26097 /* NonCopyingSort.h in Headers */ = {isa = PBXBuildFile; fileRef = 65E1A2F4122B880D00B26097 /* NonCopyingSort.h */; settings = {ATTRIBUTES = (Private, ); }; }; 65FDE49C0BDD1D4A00E80111 /* Assertions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65E217B808E7EECC0023E5F6 /* Assertions.cpp */; settings = {COMPILER_FLAGS = "-Wno-missing-format-attribute"; }; }; 7E4EE7090EBB7963005934AA /* StructureChain.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4EE7080EBB7963005934AA /* StructureChain.h */; settings = {ATTRIBUTES = (Private, ); }; }; 7E4EE70F0EBB7A5B005934AA /* StructureChain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E4EE70E0EBB7A5B005934AA /* StructureChain.cpp */; }; @@ -297,6 +298,15 @@ 969A079A0ED1D3AE00F1F681 /* Opcode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 969A07940ED1D3AE00F1F681 /* Opcode.cpp */; }; 969A079B0ED1D3AE00F1F681 /* Opcode.h in Headers */ = {isa = PBXBuildFile; fileRef = 969A07950ED1D3AE00F1F681 /* Opcode.h */; settings = {ATTRIBUTES = (Private, ); }; }; 96DD73790F9DA3100027FBCC /* VMTags.h in Headers */ = {isa = PBXBuildFile; fileRef = 96DD73780F9DA3100027FBCC /* VMTags.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 9714AF46122F28850092D9F5 /* URLSegments.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9714AF35122F27E70092D9F5 /* URLSegments.cpp */; }; + 9714AF4B122F289A0092D9F5 /* RawURLBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 9714AF31122F27E70092D9F5 /* RawURLBuffer.h */; }; + 9714AF4C122F289A0092D9F5 /* URLBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 9714AF32122F27E70092D9F5 /* URLBuffer.h */; }; + 9714AF4D122F289A0092D9F5 /* URLComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 9714AF33122F27E70092D9F5 /* URLComponent.h */; }; + 9714AF4E122F289A0092D9F5 /* URLParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 9714AF34122F27E70092D9F5 /* URLParser.h */; }; + 9714AF4F122F289A0092D9F5 /* URLSegments.h in Headers */ = {isa = PBXBuildFile; fileRef = 9714AF36122F27E70092D9F5 /* URLSegments.h */; }; + 9714AF5E122F32070092D9F5 /* ParsedURL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9714AF57122F31F50092D9F5 /* ParsedURL.cpp */; }; + 9714AF5F122F32070092D9F5 /* ParsedURL.h in Headers */ = {isa = PBXBuildFile; fileRef = 9714AF58122F31F50092D9F5 /* ParsedURL.h */; }; + 9714AF60122F32070092D9F5 /* URLString.h in Headers */ = {isa = PBXBuildFile; fileRef = 9714AF59122F31F50092D9F5 /* URLString.h */; }; 971EDEA61169E0D3005E4262 /* Terminator.h in Headers */ = {isa = PBXBuildFile; fileRef = 97F6903A1169DF7F00A6BB46 /* Terminator.h */; settings = {ATTRIBUTES = (Private, ); }; }; A1712B3B11C7B212007A5315 /* RegExpCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1712B3A11C7B212007A5315 /* RegExpCache.cpp */; }; A1712B3F11C7B228007A5315 /* RegExpCache.h in Headers */ = {isa = PBXBuildFile; fileRef = A1712B3E11C7B228007A5315 /* RegExpCache.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -766,6 +776,7 @@ 65DFC92D08EA173A00F7300B /* HashTable.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HashTable.cpp; sourceTree = "<group>"; tabWidth = 8; }; 65DFC92E08EA173A00F7300B /* HashTable.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = HashTable.h; sourceTree = "<group>"; tabWidth = 8; }; 65DFC92F08EA173A00F7300B /* HashTraits.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = HashTraits.h; sourceTree = "<group>"; tabWidth = 8; }; + 65E1A2F4122B880D00B26097 /* NonCopyingSort.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NonCopyingSort.h; sourceTree = "<group>"; }; 65E217B708E7EECC0023E5F6 /* Assertions.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = Assertions.h; sourceTree = "<group>"; tabWidth = 8; }; 65E217B808E7EECC0023E5F6 /* Assertions.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Assertions.cpp; sourceTree = "<group>"; tabWidth = 8; }; 65E217B908E7EECC0023E5F6 /* FastMalloc.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FastMalloc.cpp; sourceTree = "<group>"; tabWidth = 8; }; @@ -915,6 +926,15 @@ 969A07950ED1D3AE00F1F681 /* Opcode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Opcode.h; sourceTree = "<group>"; }; 969A09220ED1E09C00F1F681 /* Completion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Completion.cpp; sourceTree = "<group>"; }; 96DD73780F9DA3100027FBCC /* VMTags.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VMTags.h; sourceTree = "<group>"; }; + 9714AF31122F27E70092D9F5 /* RawURLBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RawURLBuffer.h; path = url/src/RawURLBuffer.h; sourceTree = "<group>"; }; + 9714AF32122F27E70092D9F5 /* URLBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = URLBuffer.h; path = url/src/URLBuffer.h; sourceTree = "<group>"; }; + 9714AF33122F27E70092D9F5 /* URLComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = URLComponent.h; path = url/src/URLComponent.h; sourceTree = "<group>"; }; + 9714AF34122F27E70092D9F5 /* URLParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = URLParser.h; path = url/src/URLParser.h; sourceTree = "<group>"; }; + 9714AF35122F27E70092D9F5 /* URLSegments.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = URLSegments.cpp; path = url/src/URLSegments.cpp; sourceTree = "<group>"; }; + 9714AF36122F27E70092D9F5 /* URLSegments.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = URLSegments.h; path = url/src/URLSegments.h; sourceTree = "<group>"; }; + 9714AF57122F31F50092D9F5 /* ParsedURL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ParsedURL.cpp; path = url/api/ParsedURL.cpp; sourceTree = "<group>"; }; + 9714AF58122F31F50092D9F5 /* ParsedURL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ParsedURL.h; path = url/api/ParsedURL.h; sourceTree = "<group>"; }; + 9714AF59122F31F50092D9F5 /* URLString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = URLString.h; path = url/api/URLString.h; sourceTree = "<group>"; }; 97F6903A1169DF7F00A6BB46 /* Terminator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Terminator.h; sourceTree = "<group>"; }; A1712B3A11C7B212007A5315 /* RegExpCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegExpCache.cpp; sourceTree = "<group>"; }; A1712B3E11C7B228007A5315 /* RegExpCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegExpCache.h; sourceTree = "<group>"; }; @@ -1426,6 +1446,7 @@ 65162EF108E6A21C007556CD /* wtf */ = { isa = PBXGroup; children = ( + 9714AF2F122F27C60092D9F5 /* url */, 06D358A00DAAD9C4003B174E /* mac */, 8656573E115BE35200291F40 /* text */, E195678D09E7CF1200B89D13 /* unicode */, @@ -1473,6 +1494,7 @@ 511FC4C7117EE23D00425272 /* MD5.cpp */, 511FC4CA117EE2A800425272 /* MD5.h */, E1EE798B0D6CA53D00FEA3BA /* MessageQueue.h */, + 65E1A2F4122B880D00B26097 /* NonCopyingSort.h */, 9303F5690991190000AD71B8 /* Noncopyable.h */, C0A2723F0E509F1E00E96E15 /* NotFound.h */, 9303F5A409911A5800AD71B8 /* OwnArrayPtr.h */, @@ -1902,6 +1924,38 @@ path = bytecode; sourceTree = "<group>"; }; + 9714AF2F122F27C60092D9F5 /* url */ = { + isa = PBXGroup; + children = ( + 9714AF56122F31DD0092D9F5 /* api */, + 9714AF30122F27D20092D9F5 /* src */, + ); + name = url; + sourceTree = "<group>"; + }; + 9714AF30122F27D20092D9F5 /* src */ = { + isa = PBXGroup; + children = ( + 9714AF31122F27E70092D9F5 /* RawURLBuffer.h */, + 9714AF32122F27E70092D9F5 /* URLBuffer.h */, + 9714AF33122F27E70092D9F5 /* URLComponent.h */, + 9714AF34122F27E70092D9F5 /* URLParser.h */, + 9714AF35122F27E70092D9F5 /* URLSegments.cpp */, + 9714AF36122F27E70092D9F5 /* URLSegments.h */, + ); + name = src; + sourceTree = "<group>"; + }; + 9714AF56122F31DD0092D9F5 /* api */ = { + isa = PBXGroup; + children = ( + 9714AF57122F31F50092D9F5 /* ParsedURL.cpp */, + 9714AF58122F31F50092D9F5 /* ParsedURL.h */, + 9714AF59122F31F50092D9F5 /* URLString.h */, + ); + name = api; + sourceTree = "<group>"; + }; E195678D09E7CF1200B89D13 /* unicode */ = { isa = PBXGroup; children = ( @@ -2115,6 +2169,7 @@ A76EE6590FAE59D5003F069A /* NativeFunctionWrapper.h in Headers */, 7EFF00640EC05A9A00AA7C93 /* NodeInfo.h in Headers */, BC18C43F0E16F5CD00B34460 /* Nodes.h in Headers */, + 65E1A3DF122B894500B26097 /* NonCopyingSort.h in Headers */, BC18C4400E16F5CD00B34460 /* Noncopyable.h in Headers */, C0A272630E50A06300E96E15 /* NotFound.h in Headers */, BC18C4410E16F5CD00B34460 /* NumberConstructor.h in Headers */, @@ -2245,6 +2300,13 @@ 862AF4B612239C7B0024E5B8 /* DecimalNumber.h in Headers */, BCFBE696122560E800309E9D /* PassOwnArrayPtr.h in Headers */, BCFBE698122561D200309E9D /* OwnArrayPtrCommon.h in Headers */, + 9714AF4B122F289A0092D9F5 /* RawURLBuffer.h in Headers */, + 9714AF4C122F289A0092D9F5 /* URLBuffer.h in Headers */, + 9714AF4D122F289A0092D9F5 /* URLComponent.h in Headers */, + 9714AF4E122F289A0092D9F5 /* URLParser.h in Headers */, + 9714AF4F122F289A0092D9F5 /* URLSegments.h in Headers */, + 9714AF5F122F32070092D9F5 /* ParsedURL.h in Headers */, + 9714AF60122F32070092D9F5 /* URLString.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2338,7 +2400,6 @@ isa = PBXProject; buildConfigurationList = 149C277108902AFE008A9EFC /* Build configuration list for PBXProject "JavaScriptCore" */; compatibilityVersion = "Xcode 2.4"; - developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( English, @@ -2697,6 +2758,8 @@ 8627E5EB11F1281900A313B5 /* PageAllocation.cpp in Sources */, DDE82AD71209D955005C1756 /* GCHandle.cpp in Sources */, A74DE1D0120B875600D40D5B /* ARMv7Assembler.cpp in Sources */, + 9714AF46122F28850092D9F5 /* URLSegments.cpp in Sources */, + 9714AF5E122F32070092D9F5 /* ParsedURL.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/JavaScriptCore/assembler/MIPSAssembler.h b/JavaScriptCore/assembler/MIPSAssembler.h index bc77f8d..f9e40c4 100644 --- a/JavaScriptCore/assembler/MIPSAssembler.h +++ b/JavaScriptCore/assembler/MIPSAssembler.h @@ -529,6 +529,12 @@ public: | (ft << OP_SH_FT)); } + void divd(FPRegisterID fd, FPRegisterID fs, FPRegisterID ft) + { + emitInst(0x46200003 | (fd << OP_SH_FD) | (fs << OP_SH_FS) + | (ft << OP_SH_FT)); + } + void lwc1(FPRegisterID ft, RegisterID rs, int offset) { emitInst(0xc4000000 | (ft << OP_SH_FT) | (rs << OP_SH_RS) @@ -560,6 +566,12 @@ public: copDelayNop(); } + void mthc1(RegisterID rt, FPRegisterID fs) + { + emitInst(0x44e00000 | (fs << OP_SH_FS) | (rt << OP_SH_RT)); + copDelayNop(); + } + void mfc1(RegisterID rt, FPRegisterID fs) { emitInst(0x44000000 | (fs << OP_SH_FS) | (rt << OP_SH_RT)); @@ -581,6 +593,11 @@ public: emitInst(0x46800021 | (fd << OP_SH_FD) | (fs << OP_SH_FS)); } + void cvtwd(FPRegisterID fd, FPRegisterID fs) + { + emitInst(0x46200024 | (fd << OP_SH_FD) | (fs << OP_SH_FS)); + } + void ceqd(FPRegisterID fs, FPRegisterID ft) { emitInst(0x46200032 | (fs << OP_SH_FS) | (ft << OP_SH_FT)); diff --git a/JavaScriptCore/assembler/MacroAssemblerMIPS.h b/JavaScriptCore/assembler/MacroAssemblerMIPS.h index 3bb9e75..3fb2549 100644 --- a/JavaScriptCore/assembler/MacroAssemblerMIPS.h +++ b/JavaScriptCore/assembler/MacroAssemblerMIPS.h @@ -281,6 +281,11 @@ public: } } + void neg32(RegisterID srcDest) + { + m_assembler.subu(srcDest, MIPSRegisters::zero, srcDest); + } + void not32(RegisterID srcDest) { m_assembler.nor(srcDest, srcDest, MIPSRegisters::zero); @@ -620,11 +625,6 @@ public: return label; } - Label loadPtrWithAddressOffsetPatch(Address address, RegisterID dest) - { - return loadPtrWithPatchToLEA(address, dest); - } - /* Need to use zero-extened load half-word for load16. */ void load16(ImplicitAddress address, RegisterID dest) { @@ -1302,6 +1302,27 @@ public: return branchSub32(cond, immTempRegister, dest); } + Jump branchOr32(Condition cond, RegisterID src, RegisterID dest) + { + ASSERT((cond == Signed) || (cond == Zero) || (cond == NonZero)); + if (cond == Signed) { + or32(src, dest); + // Check if dest is negative. + m_assembler.slt(cmpTempRegister, dest, MIPSRegisters::zero); + return branchNotEqual(cmpTempRegister, MIPSRegisters::zero); + } + if (cond == Zero) { + or32(src, dest); + return branchEqual(dest, MIPSRegisters::zero); + } + if (cond == NonZero) { + or32(src, dest); + return branchNotEqual(dest, MIPSRegisters::zero); + } + ASSERT(0); + return Jump(); + } + // Miscellaneous operations: void breakpoint() @@ -1351,6 +1372,17 @@ public: m_assembler.nop(); } + void set8(Condition cond, RegisterID left, RegisterID right, RegisterID dest) + { + set32(cond, left, right, dest); + } + + void set8(Condition cond, RegisterID left, Imm32 right, RegisterID dest) + { + move(right, immTempRegister); + set32(cond, left, immTempRegister, dest); + } + void set32(Condition cond, RegisterID left, RegisterID right, RegisterID dest) { if (cond == Equal || cond == Zero) { @@ -1546,6 +1578,28 @@ public: #endif } + void loadDouble(const void* address, FPRegisterID dest) + { +#if WTF_MIPS_ISA(1) + /* + li addrTemp, address + lwc1 dest, 0(addrTemp) + lwc1 dest+1, 4(addrTemp) + */ + move(ImmPtr(address), addrTempRegister); + m_assembler.lwc1(dest, addrTempRegister, 0); + m_assembler.lwc1(FPRegisterID(dest + 1), addrTempRegister, 4); +#else + /* + li addrTemp, address + ldc1 dest, 0(addrTemp) + */ + move(ImmPtr(address), addrTempRegister); + m_assembler.ldc1(dest, addrTempRegister, 0); +#endif + } + + void storeDouble(FPRegisterID src, ImplicitAddress address) { #if WTF_MIPS_ISA(1) @@ -1609,12 +1663,31 @@ public: m_assembler.muld(dest, dest, fpTempRegister); } + void divDouble(FPRegisterID src, FPRegisterID dest) + { + m_assembler.divd(dest, dest, src); + } + void convertInt32ToDouble(RegisterID src, FPRegisterID dest) { m_assembler.mtc1(src, fpTempRegister); m_assembler.cvtdw(dest, fpTempRegister); } + void convertInt32ToDouble(Address src, FPRegisterID dest) + { + load32(src, dataTempRegister); + m_assembler.mtc1(dataTempRegister, fpTempRegister); + m_assembler.cvtdw(dest, fpTempRegister); + } + + void convertInt32ToDouble(AbsoluteAddress src, FPRegisterID dest) + { + load32(src.m_ptr, dataTempRegister); + m_assembler.mtc1(dataTempRegister, fpTempRegister); + m_assembler.cvtdw(dest, fpTempRegister); + } + void insertRelaxationWords() { /* We need four words for relaxation. */ @@ -1667,7 +1740,7 @@ public: return branchTrue(); } if (cond == DoubleNotEqual) { - m_assembler.ceqd(left, right); + m_assembler.cueqd(left, right); return branchFalse(); // false } if (cond == DoubleGreaterThan) { @@ -1690,6 +1763,10 @@ public: m_assembler.cueqd(left, right); return branchTrue(); } + if (cond == DoubleNotEqualOrUnordered) { + m_assembler.ceqd(left, right); + return branchFalse(); // false + } if (cond == DoubleGreaterThanOrUnordered) { m_assembler.coled(left, right); return branchFalse(); // false @@ -1722,6 +1799,34 @@ public: return branch32(Equal, dest, Imm32(0x7fffffff)); } + // Convert 'src' to an integer, and places the resulting 'dest'. + // If the result is not representable as a 32 bit value, branch. + // May also branch for some values that are representable in 32 bits + // (specifically, in this case, 0). + void branchConvertDoubleToInt32(FPRegisterID src, RegisterID dest, JumpList& failureCases, FPRegisterID fpTemp) + { + m_assembler.cvtwd(fpTempRegister, src); + m_assembler.mfc1(dest, fpTempRegister); + + // If the result is zero, it might have been -0.0, and the double comparison won't catch this! + failureCases.append(branch32(Equal, dest, MIPSRegisters::zero)); + + // Convert the integer result back to float & compare to the original value - if not equal or unordered (NaN) then jump. + convertInt32ToDouble(dest, fpTemp); + failureCases.append(branchDouble(DoubleNotEqualOrUnordered, fpTemp, src)); + } + + void zeroDouble(FPRegisterID dest) + { +#if WTF_MIPS_ISA_REV(2) && WTF_MIPS_FP64 + m_assembler.mtc1(MIPSRegisters::zero, dest); + m_assembler.mthc1(MIPSRegisters::zero, dest); +#else + m_assembler.mtc1(MIPSRegisters::zero, dest); + m_assembler.mtc1(MIPSRegisters::zero, FPRegisterID(dest + 1)); +#endif + } + private: // If m_fixedWidth is true, we will generate a fixed number of instructions. // Otherwise, we can emit any number of instructions. diff --git a/JavaScriptCore/interpreter/RegisterFile.cpp b/JavaScriptCore/interpreter/RegisterFile.cpp index 4f5d1d5..4c37676 100644 --- a/JavaScriptCore/interpreter/RegisterFile.cpp +++ b/JavaScriptCore/interpreter/RegisterFile.cpp @@ -33,16 +33,26 @@ namespace JSC { +static size_t committedBytesCount = 0; + +static Mutex& registerFileStatisticsMutex() +{ + DEFINE_STATIC_LOCAL(Mutex, staticMutex, ()); + return staticMutex; +} + RegisterFile::~RegisterFile() { void* base = m_reservation.base(); m_reservation.decommit(base, reinterpret_cast<intptr_t>(m_commitEnd) - reinterpret_cast<intptr_t>(base)); + addToCommittedByteCount(-(reinterpret_cast<intptr_t>(m_commitEnd) - reinterpret_cast<intptr_t>(base))); m_reservation.deallocate(); } void RegisterFile::releaseExcessCapacity() { m_reservation.decommit(m_start, reinterpret_cast<intptr_t>(m_commitEnd) - reinterpret_cast<intptr_t>(m_start)); + addToCommittedByteCount(-(reinterpret_cast<intptr_t>(m_commitEnd) - reinterpret_cast<intptr_t>(m_start))); m_commitEnd = m_start; m_maxUsed = m_start; } @@ -62,4 +72,22 @@ JSGlobalObject* RegisterFile::globalObject() return m_globalObject.get(); } +void RegisterFile::initializeThreading() +{ + registerFileStatisticsMutex(); +} + +size_t RegisterFile::committedByteCount() +{ + MutexLocker locker(registerFileStatisticsMutex()); + return committedBytesCount; +} + +void RegisterFile::addToCommittedByteCount(long byteCount) +{ + MutexLocker locker(registerFileStatisticsMutex()); + ASSERT(static_cast<long>(committedBytesCount) + byteCount > -1); + committedBytesCount += byteCount; +} + } // namespace JSC diff --git a/JavaScriptCore/interpreter/RegisterFile.h b/JavaScriptCore/interpreter/RegisterFile.h index f3284ff..d9f6a2b 100644 --- a/JavaScriptCore/interpreter/RegisterFile.h +++ b/JavaScriptCore/interpreter/RegisterFile.h @@ -134,10 +134,13 @@ namespace JSC { void markGlobals(MarkStack& markStack, Heap* heap) { heap->markConservatively(markStack, lastGlobal(), m_start); } void markCallFrames(MarkStack& markStack, Heap* heap) { heap->markConservatively(markStack, m_start, m_end); } + static size_t committedByteCount(); + static void initializeThreading(); + private: void checkAllocatedOkay(bool okay); - void releaseExcessCapacity(); + void addToCommittedByteCount(long); size_t m_numGlobals; const size_t m_maxGlobals; Register* m_start; @@ -166,6 +169,7 @@ namespace JSC { checkAllocatedOkay(base); size_t committedSize = roundUpAllocationSize(maxGlobals * sizeof(Register), commitSize); checkAllocatedOkay(m_reservation.commit(base, committedSize)); + addToCommittedByteCount(static_cast<long>(committedSize)); m_commitEnd = reinterpret_cast_ptr<Register*>(reinterpret_cast<char*>(base) + committedSize); m_start = static_cast<Register*>(base) + maxGlobals; m_end = m_start; @@ -193,6 +197,7 @@ namespace JSC { if (newEnd > m_commitEnd) { size_t size = roundUpAllocationSize(reinterpret_cast<char*>(newEnd) - reinterpret_cast<char*>(m_commitEnd), commitSize); checkAllocatedOkay(m_reservation.commit(m_commitEnd, size)); + addToCommittedByteCount(static_cast<long>(size)); m_commitEnd = reinterpret_cast_ptr<Register*>(reinterpret_cast<char*>(m_commitEnd) + size); } diff --git a/JavaScriptCore/jit/ExecutableAllocator.cpp b/JavaScriptCore/jit/ExecutableAllocator.cpp index 4800613..8742eda 100644 --- a/JavaScriptCore/jit/ExecutableAllocator.cpp +++ b/JavaScriptCore/jit/ExecutableAllocator.cpp @@ -66,6 +66,11 @@ bool ExecutableAllocator::isValid() const { return true; } + +size_t ExecutableAllocator::committedByteCount() +{ + return 0; +} #endif diff --git a/JavaScriptCore/jit/ExecutableAllocator.h b/JavaScriptCore/jit/ExecutableAllocator.h index 576f889..f145404 100644 --- a/JavaScriptCore/jit/ExecutableAllocator.h +++ b/JavaScriptCore/jit/ExecutableAllocator.h @@ -297,6 +297,7 @@ public: #else #error "The cacheFlush support is missing on this platform." #endif + static size_t committedByteCount(); private: diff --git a/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp b/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp index b34204f..15247c2 100644 --- a/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp +++ b/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp @@ -54,6 +54,9 @@ using namespace WTF; namespace JSC { + +static size_t committedBytesCount = 0; +static SpinLock spinlock = SPINLOCK_INITIALIZER; // FreeListEntry describes a free chunk of memory, stored in the freeList. struct FreeListEntry { @@ -128,12 +131,14 @@ class FixedVMPoolAllocator void release(void* position, size_t size) { m_allocation.decommit(position, size); + addToCommittedByteCount(-static_cast<long>(size)); } void reuse(void* position, size_t size) { bool okay = m_allocation.commit(position, size); ASSERT_UNUSED(okay, okay); + addToCommittedByteCount(static_cast<long>(size)); } // All addition to the free list should go through this method, rather than @@ -415,6 +420,13 @@ private: } #endif + void addToCommittedByteCount(long byteCount) + { + ASSERT(spinlock.IsHeld()); + ASSERT(static_cast<long>(committedBytesCount) + byteCount > -1); + committedBytesCount += byteCount; + } + // Freed space from the most common sized allocations will be held in this list, ... const size_t m_commonSize; Vector<void*> m_commonSizedAllocations; @@ -428,14 +440,19 @@ private: PageReservation m_allocation; }; +size_t ExecutableAllocator::committedByteCount() +{ + SpinLockHolder lockHolder(&spinlock); + return committedBytesCount; +} + void ExecutableAllocator::intializePageSize() { ExecutableAllocator::pageSize = getpagesize(); } static FixedVMPoolAllocator* allocator = 0; -static SpinLock spinlock = SPINLOCK_INITIALIZER; - + bool ExecutableAllocator::isValid() const { SpinLockHolder lock_holder(&spinlock); diff --git a/JavaScriptCore/jit/JIT.h b/JavaScriptCore/jit/JIT.h index 7c03a47..6f1168b 100644 --- a/JavaScriptCore/jit/JIT.h +++ b/JavaScriptCore/jit/JIT.h @@ -448,6 +448,52 @@ namespace JSC { // sequencePutById static const int sequencePutByIdInstructionSpace = 36; static const int sequencePutByIdConstantSpace = 4; +#elif CPU(MIPS) +#if WTF_MIPS_ISA(1) + static const int patchOffsetPutByIdStructure = 16; + static const int patchOffsetPutByIdExternalLoad = 48; + static const int patchLengthPutByIdExternalLoad = 20; + static const int patchOffsetPutByIdPropertyMapOffset1 = 68; + static const int patchOffsetPutByIdPropertyMapOffset2 = 84; + static const int patchOffsetGetByIdStructure = 16; + static const int patchOffsetGetByIdBranchToSlowCase = 48; + static const int patchOffsetGetByIdExternalLoad = 48; + static const int patchLengthGetByIdExternalLoad = 20; + static const int patchOffsetGetByIdPropertyMapOffset1 = 68; + static const int patchOffsetGetByIdPropertyMapOffset2 = 88; + static const int patchOffsetGetByIdPutResult = 108; +#if ENABLE(OPCODE_SAMPLING) + #error "OPCODE_SAMPLING is not yet supported" +#else + static const int patchOffsetGetByIdSlowCaseCall = 44; +#endif + static const int patchOffsetOpCallCompareToJump = 32; + static const int patchOffsetMethodCheckProtoObj = 32; + static const int patchOffsetMethodCheckProtoStruct = 56; + static const int patchOffsetMethodCheckPutFunction = 88; +#else // WTF_MIPS_ISA(1) + static const int patchOffsetPutByIdStructure = 12; + static const int patchOffsetPutByIdExternalLoad = 44; + static const int patchLengthPutByIdExternalLoad = 16; + static const int patchOffsetPutByIdPropertyMapOffset1 = 60; + static const int patchOffsetPutByIdPropertyMapOffset2 = 76; + static const int patchOffsetGetByIdStructure = 12; + static const int patchOffsetGetByIdBranchToSlowCase = 44; + static const int patchOffsetGetByIdExternalLoad = 44; + static const int patchLengthGetByIdExternalLoad = 16; + static const int patchOffsetGetByIdPropertyMapOffset1 = 60; + static const int patchOffsetGetByIdPropertyMapOffset2 = 76; + static const int patchOffsetGetByIdPutResult = 92; +#if ENABLE(OPCODE_SAMPLING) + #error "OPCODE_SAMPLING is not yet supported" +#else + static const int patchOffsetGetByIdSlowCaseCall = 44; +#endif + static const int patchOffsetOpCallCompareToJump = 32; + static const int patchOffsetMethodCheckProtoObj = 32; + static const int patchOffsetMethodCheckProtoStruct = 52; + static const int patchOffsetMethodCheckPutFunction = 84; +#endif #else #error "JSVALUE32_64 not supported on this platform." #endif diff --git a/JavaScriptCore/jit/JITOpcodes32_64.cpp b/JavaScriptCore/jit/JITOpcodes32_64.cpp index 035325a..1ad19b7 100644 --- a/JavaScriptCore/jit/JITOpcodes32_64.cpp +++ b/JavaScriptCore/jit/JITOpcodes32_64.cpp @@ -244,6 +244,37 @@ JIT::Label JIT::privateCompileCTINativeCall(JSGlobalData* globalData, bool isCon restoreReturnAddressBeforeReturn(regT3); +#elif CPU(MIPS) + // Load caller frame's scope chain into this callframe so that whatever we call can + // get to its global data. + emitGetFromCallFrameHeaderPtr(RegisterFile::CallerFrame, regT0); + emitGetFromCallFrameHeaderPtr(RegisterFile::ScopeChain, regT1, regT0); + emitPutToCallFrameHeader(regT1, RegisterFile::ScopeChain); + + preserveReturnAddressAfterCall(regT3); // Callee preserved + emitPutToCallFrameHeader(regT3, RegisterFile::ReturnPC); + + // Calling convention: f(a0, a1, a2, a3); + // Host function signature: f(ExecState*); + + // Allocate stack space for 16 bytes (8-byte aligned) + // 16 bytes (unused) for 4 arguments + subPtr(Imm32(16), stackPointerRegister); + + // Setup arg0 + move(callFrameRegister, MIPSRegisters::a0); + + // Call + emitGetFromCallFrameHeaderPtr(RegisterFile::Callee, MIPSRegisters::a2); + loadPtr(Address(MIPSRegisters::a2, OBJECT_OFFSETOF(JSFunction, m_executable)), regT2); + move(regT0, callFrameRegister); // Eagerly restore caller frame register to avoid loading from stack. + call(Address(regT2, executableOffsetToFunction)); + + // Restore stack space + addPtr(Imm32(16), stackPointerRegister); + + restoreReturnAddressBeforeReturn(regT3); + #elif ENABLE(JIT_OPTIMIZE_NATIVE_CALL) #error "JIT_OPTIMIZE_NATIVE_CALL not yet supported on this platform." #else @@ -327,6 +358,39 @@ JIT::CodePtr JIT::privateCompileCTINativeCall(PassRefPtr<ExecutablePool> executa restoreReturnAddressBeforeReturn(regT3); +#elif CPU(MIPS) + // Load caller frame's scope chain into this callframe so that whatever we call can + // get to its global data. + emitGetFromCallFrameHeaderPtr(RegisterFile::CallerFrame, regT0); + emitGetFromCallFrameHeaderPtr(RegisterFile::ScopeChain, regT1, regT0); + emitPutToCallFrameHeader(regT1, RegisterFile::ScopeChain); + + preserveReturnAddressAfterCall(regT3); // Callee preserved + emitPutToCallFrameHeader(regT3, RegisterFile::ReturnPC); + + // Calling convention: f(a0, a1, a2, a3); + // Host function signature: f(ExecState*); + + // Allocate stack space for 16 bytes (8-byte aligned) + // 16 bytes (unused) for 4 arguments + subPtr(Imm32(16), stackPointerRegister); + + // Setup arg0 + move(callFrameRegister, MIPSRegisters::a0); + + // Call + emitGetFromCallFrameHeaderPtr(RegisterFile::Callee, MIPSRegisters::a2); + loadPtr(Address(MIPSRegisters::a2, OBJECT_OFFSETOF(JSFunction, m_executable)), regT2); + move(regT0, callFrameRegister); // Eagerly restore caller frame register to avoid loading from stack. + + // call the function + nativeCall = call(); + + // Restore stack space + addPtr(Imm32(16), stackPointerRegister); + + restoreReturnAddressBeforeReturn(regT3); + #elif ENABLE(JIT_OPTIMIZE_NATIVE_CALL) #error "JIT_OPTIMIZE_NATIVE_CALL not yet supported on this platform." #else diff --git a/JavaScriptCore/jit/JITPropertyAccess32_64.cpp b/JavaScriptCore/jit/JITPropertyAccess32_64.cpp index 31ecfed..f6280ef 100644 --- a/JavaScriptCore/jit/JITPropertyAccess32_64.cpp +++ b/JavaScriptCore/jit/JITPropertyAccess32_64.cpp @@ -640,8 +640,14 @@ void JIT::privateCompilePutByIdTransition(StructureStubInfo* stubInfo, Structure add32(Imm32(1), AbsoluteAddress(newStructure->addressOfCount())); storePtr(ImmPtr(newStructure), Address(regT0, OBJECT_OFFSETOF(JSCell, m_structure))); +#if CPU(MIPS) + // For MIPS, we don't add sizeof(void*) to the stack offset. + load32(Address(stackPointerRegister, OBJECT_OFFSETOF(JITStackFrame, args[2]) + OBJECT_OFFSETOF(JSValue, u.asBits.payload)), regT3); + load32(Address(stackPointerRegister, OBJECT_OFFSETOF(JITStackFrame, args[2]) + OBJECT_OFFSETOF(JSValue, u.asBits.tag)), regT2); +#else load32(Address(stackPointerRegister, OBJECT_OFFSETOF(JITStackFrame, args[2]) + sizeof(void*) + OBJECT_OFFSETOF(JSValue, u.asBits.payload)), regT3); load32(Address(stackPointerRegister, OBJECT_OFFSETOF(JITStackFrame, args[2]) + sizeof(void*) + OBJECT_OFFSETOF(JSValue, u.asBits.tag)), regT2); +#endif // Write the value compilePutDirectOffset(regT0, regT2, regT3, newStructure, cachedOffset); diff --git a/JavaScriptCore/jit/JITStubs.cpp b/JavaScriptCore/jit/JITStubs.cpp index e17c7cb..d5e55b4 100644 --- a/JavaScriptCore/jit/JITStubs.cpp +++ b/JavaScriptCore/jit/JITStubs.cpp @@ -80,8 +80,12 @@ namespace JSC { #if OS(LINUX) && CPU(X86_64) #define SYMBOL_STRING_RELOCATION(name) #name "@plt" +#elif OS(DARWIN) +#define SYMBOL_STRING_RELOCATION(name) "_" #name +#elif CPU(X86) && COMPILER(MINGW) +#define SYMBOL_STRING_RELOCATION(name) "@" #name "@4" #else -#define SYMBOL_STRING_RELOCATION(name) SYMBOL_STRING(name) +#define SYMBOL_STRING_RELOCATION(name) #name #endif #if OS(DARWIN) @@ -311,6 +315,21 @@ extern "C" { #define PRESERVEDR4_OFFSET 68 // See DEFINE_STUB_FUNCTION for more information. +#elif CPU(MIPS) + +#define PRESERVED_GP_OFFSET 60 +#define PRESERVED_S0_OFFSET 64 +#define PRESERVED_S1_OFFSET 68 +#define PRESERVED_S2_OFFSET 72 +#define PRESERVED_RETURN_ADDRESS_OFFSET 76 +#define THUNK_RETURN_ADDRESS_OFFSET 80 +#define REGISTER_FILE_OFFSET 84 +#define CALLFRAME_OFFSET 88 +#define EXCEPTION_OFFSET 92 +#define ENABLE_PROFILER_REFERENCE_OFFSET 96 +#define GLOBAL_DATA_OFFSET 100 +#define STACK_LENGTH 104 + #else #error "JIT not supported on this platform." #endif @@ -465,95 +484,18 @@ SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n" #elif CPU(MIPS) -asm volatile( -".text" "\n" -".align 2" "\n" -".set noreorder" "\n" -".set nomacro" "\n" -".set nomips16" "\n" -".globl " SYMBOL_STRING(ctiTrampoline) "\n" -".ent " SYMBOL_STRING(ctiTrampoline) "\n" -SYMBOL_STRING(ctiTrampoline) ":" "\n" - "addiu $29,$29,-72" "\n" - "sw $31,44($29)" "\n" - "sw $18,40($29)" "\n" - "sw $17,36($29)" "\n" - "sw $16,32($29)" "\n" -#if WTF_MIPS_PIC - "sw $28,28($29)" "\n" -#endif - "move $16,$6 # set callFrameRegister" "\n" - "li $17,512 # set timeoutCheckRegister" "\n" - "move $25,$4 # move executableAddress to t9" "\n" - "sw $5,52($29) # store registerFile to current stack" "\n" - "sw $6,56($29) # store callFrame to curent stack" "\n" - "sw $7,60($29) # store exception to current stack" "\n" - "lw $8,88($29) # load enableProfilerReference from previous stack" "\n" - "lw $9,92($29) # load globalData from previous stack" "\n" - "sw $8,64($29) # store enableProfilerReference to current stack" "\n" - "jalr $25" "\n" - "sw $9,68($29) # store globalData to current stack" "\n" - "lw $16,32($29)" "\n" - "lw $17,36($29)" "\n" - "lw $18,40($29)" "\n" - "lw $31,44($29)" "\n" - "jr $31" "\n" - "addiu $29,$29,72" "\n" -".set reorder" "\n" -".set macro" "\n" -".end " SYMBOL_STRING(ctiTrampoline) "\n" -); - -asm volatile( -".text" "\n" -".align 2" "\n" -".set noreorder" "\n" -".set nomacro" "\n" -".set nomips16" "\n" -".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n" -".ent " SYMBOL_STRING(ctiVMThrowTrampoline) "\n" -SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n" -#if WTF_MIPS_PIC - "lw $28,28($29)" "\n" -".set macro" "\n" - "la $25," SYMBOL_STRING(cti_vm_throw) "\n" -".set nomacro" "\n" - "bal " SYMBOL_STRING(cti_vm_throw) "\n" - "move $4,$29" "\n" -#else - "jal " SYMBOL_STRING(cti_vm_throw) "\n" - "move $4,$29" "\n" -#endif - "lw $16,32($29)" "\n" - "lw $17,36($29)" "\n" - "lw $18,40($29)" "\n" - "lw $31,44($29)" "\n" - "jr $31" "\n" - "addiu $29,$29,72" "\n" -".set reorder" "\n" -".set macro" "\n" -".end " SYMBOL_STRING(ctiVMThrowTrampoline) "\n" -); - -asm volatile( -".text" "\n" -".align 2" "\n" -".set noreorder" "\n" -".set nomacro" "\n" -".set nomips16" "\n" -".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n" -".ent " SYMBOL_STRING(ctiOpThrowNotCaught) "\n" -SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n" - "lw $16,32($29)" "\n" - "lw $17,36($29)" "\n" - "lw $18,40($29)" "\n" - "lw $31,44($29)" "\n" - "jr $31" "\n" - "addiu $29,$29,72" "\n" -".set reorder" "\n" -".set macro" "\n" -".end " SYMBOL_STRING(ctiOpThrowNotCaught) "\n" -); +#define PRESERVED_GP_OFFSET 28 +#define PRESERVED_S0_OFFSET 32 +#define PRESERVED_S1_OFFSET 36 +#define PRESERVED_S2_OFFSET 40 +#define PRESERVED_RETURN_ADDRESS_OFFSET 44 +#define THUNK_RETURN_ADDRESS_OFFSET 48 +#define REGISTER_FILE_OFFSET 52 +#define CALLFRAME_OFFSET 56 +#define EXCEPTION_OFFSET 60 +#define ENABLE_PROFILER_REFERENCE_OFFSET 64 +#define GLOBAL_DATA_OFFSET 68 +#define STACK_LENGTH 72 #elif COMPILER(MSVC) && CPU(X86) @@ -626,6 +568,98 @@ extern "C" { #endif // USE(JSVALUE32_64) +#if CPU(MIPS) +asm volatile( +".text" "\n" +".align 2" "\n" +".set noreorder" "\n" +".set nomacro" "\n" +".set nomips16" "\n" +".globl " SYMBOL_STRING(ctiTrampoline) "\n" +".ent " SYMBOL_STRING(ctiTrampoline) "\n" +SYMBOL_STRING(ctiTrampoline) ":" "\n" + "addiu $29,$29,-" STRINGIZE_VALUE_OF(STACK_LENGTH) "\n" + "sw $31," STRINGIZE_VALUE_OF(PRESERVED_RETURN_ADDRESS_OFFSET) "($29)" "\n" + "sw $18," STRINGIZE_VALUE_OF(PRESERVED_S2_OFFSET) "($29)" "\n" + "sw $17," STRINGIZE_VALUE_OF(PRESERVED_S1_OFFSET) "($29)" "\n" + "sw $16," STRINGIZE_VALUE_OF(PRESERVED_S0_OFFSET) "($29)" "\n" +#if WTF_MIPS_PIC + "sw $28," STRINGIZE_VALUE_OF(PRESERVED_GP_OFFSET) "($29)" "\n" +#endif + "move $16,$6 # set callFrameRegister" "\n" + "li $17,512 # set timeoutCheckRegister" "\n" + "move $25,$4 # move executableAddress to t9" "\n" + "sw $5," STRINGIZE_VALUE_OF(REGISTER_FILE_OFFSET) "($29) # store registerFile to current stack" "\n" + "sw $6," STRINGIZE_VALUE_OF(CALLFRAME_OFFSET) "($29) # store callFrame to curent stack" "\n" + "sw $7," STRINGIZE_VALUE_OF(EXCEPTION_OFFSET) "($29) # store exception to current stack" "\n" + "lw $8," STRINGIZE_VALUE_OF(STACK_LENGTH + 16) "($29) # load enableProfilerReference from previous stack" "\n" + "lw $9," STRINGIZE_VALUE_OF(STACK_LENGTH + 20) "($29) # load globalData from previous stack" "\n" + "sw $8," STRINGIZE_VALUE_OF(ENABLE_PROFILER_REFERENCE_OFFSET) "($29) # store enableProfilerReference to current stack" "\n" + "jalr $25" "\n" + "sw $9," STRINGIZE_VALUE_OF(GLOBAL_DATA_OFFSET) "($29) # store globalData to current stack" "\n" + "lw $16," STRINGIZE_VALUE_OF(PRESERVED_S0_OFFSET) "($29)" "\n" + "lw $17," STRINGIZE_VALUE_OF(PRESERVED_S1_OFFSET) "($29)" "\n" + "lw $18," STRINGIZE_VALUE_OF(PRESERVED_S2_OFFSET) "($29)" "\n" + "lw $31," STRINGIZE_VALUE_OF(PRESERVED_RETURN_ADDRESS_OFFSET) "($29)" "\n" + "jr $31" "\n" + "addiu $29,$29," STRINGIZE_VALUE_OF(STACK_LENGTH) "\n" +".set reorder" "\n" +".set macro" "\n" +".end " SYMBOL_STRING(ctiTrampoline) "\n" +); + +asm volatile( +".text" "\n" +".align 2" "\n" +".set noreorder" "\n" +".set nomacro" "\n" +".set nomips16" "\n" +".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n" +".ent " SYMBOL_STRING(ctiVMThrowTrampoline) "\n" +SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n" +#if WTF_MIPS_PIC + "lw $28," STRINGIZE_VALUE_OF(PRESERVED_GP_OFFSET) "($29)" "\n" +".set macro" "\n" + "la $25," SYMBOL_STRING(cti_vm_throw) "\n" +".set nomacro" "\n" + "bal " SYMBOL_STRING(cti_vm_throw) "\n" + "move $4,$29" "\n" +#else + "jal " SYMBOL_STRING(cti_vm_throw) "\n" + "move $4,$29" "\n" +#endif + "lw $16," STRINGIZE_VALUE_OF(PRESERVED_S0_OFFSET) "($29)" "\n" + "lw $17," STRINGIZE_VALUE_OF(PRESERVED_S1_OFFSET) "($29)" "\n" + "lw $18," STRINGIZE_VALUE_OF(PRESERVED_S2_OFFSET) "($29)" "\n" + "lw $31," STRINGIZE_VALUE_OF(PRESERVED_RETURN_ADDRESS_OFFSET) "($29)" "\n" + "jr $31" "\n" + "addiu $29,$29," STRINGIZE_VALUE_OF(STACK_LENGTH) "\n" +".set reorder" "\n" +".set macro" "\n" +".end " SYMBOL_STRING(ctiVMThrowTrampoline) "\n" +); + +asm volatile( +".text" "\n" +".align 2" "\n" +".set noreorder" "\n" +".set nomacro" "\n" +".set nomips16" "\n" +".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n" +".ent " SYMBOL_STRING(ctiOpThrowNotCaught) "\n" +SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n" + "lw $16," STRINGIZE_VALUE_OF(PRESERVED_S0_OFFSET) "($29)" "\n" + "lw $17," STRINGIZE_VALUE_OF(PRESERVED_S1_OFFSET) "($29)" "\n" + "lw $18," STRINGIZE_VALUE_OF(PRESERVED_S2_OFFSET) "($29)" "\n" + "lw $31," STRINGIZE_VALUE_OF(PRESERVED_RETURN_ADDRESS_OFFSET) "($29)" "\n" + "jr $31" "\n" + "addiu $29,$29," STRINGIZE_VALUE_OF(STACK_LENGTH) "\n" +".set reorder" "\n" +".set macro" "\n" +".end " SYMBOL_STRING(ctiOpThrowNotCaught) "\n" +); +#endif + #if COMPILER(GCC) && CPU(ARM_THUMB2) asm volatile( @@ -803,17 +837,17 @@ JITThunks::JITThunks(JSGlobalData* globalData) #elif CPU(MIPS) - ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedGP) == 28); - ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedS0) == 32); - ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedS1) == 36); - ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedS2) == 40); - ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedReturnAddress) == 44); - ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, thunkReturnAddress) == 48); - ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, registerFile) == 52); - ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, callFrame) == 56); - ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, exception) == 60); - ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, enabledProfilerReference) == 64); - ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, globalData) == 68); + ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedGP) == PRESERVED_GP_OFFSET); + ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedS0) == PRESERVED_S0_OFFSET); + ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedS1) == PRESERVED_S1_OFFSET); + ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedS2) == PRESERVED_S2_OFFSET); + ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, preservedReturnAddress) == PRESERVED_RETURN_ADDRESS_OFFSET); + ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, thunkReturnAddress) == THUNK_RETURN_ADDRESS_OFFSET); + ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, registerFile) == REGISTER_FILE_OFFSET); + ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, callFrame) == CALLFRAME_OFFSET); + ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, exception) == EXCEPTION_OFFSET); + ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, enabledProfilerReference) == ENABLE_PROFILER_REFERENCE_OFFSET); + ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, globalData) == GLOBAL_DATA_OFFSET); #endif } @@ -1086,14 +1120,14 @@ static NEVER_INLINE void throwStackOverflowError(CallFrame* callFrame, JSGlobalD ".globl " SYMBOL_STRING(cti_##op) "\n" \ ".ent " SYMBOL_STRING(cti_##op) "\n" \ SYMBOL_STRING(cti_##op) ":" "\n" \ - "lw $28,28($29)" "\n" \ - "sw $31,48($29)" "\n" \ + "lw $28," STRINGIZE_VALUE_OF(PRESERVED_GP_OFFSET) "($29)" "\n" \ + "sw $31," STRINGIZE_VALUE_OF(THUNK_RETURN_ADDRESS_OFFSET) "($29)" "\n" \ ".set macro" "\n" \ "la $25," SYMBOL_STRING(JITStubThunked_##op) "\n" \ ".set nomacro" "\n" \ "bal " SYMBOL_STRING(JITStubThunked_##op) "\n" \ "nop" "\n" \ - "lw $31,48($29)" "\n" \ + "lw $31," STRINGIZE_VALUE_OF(THUNK_RETURN_ADDRESS_OFFSET) "($29)" "\n" \ "jr $31" "\n" \ "nop" "\n" \ ".set reorder" "\n" \ @@ -1116,10 +1150,10 @@ static NEVER_INLINE void throwStackOverflowError(CallFrame* callFrame, JSGlobalD ".globl " SYMBOL_STRING(cti_##op) "\n" \ ".ent " SYMBOL_STRING(cti_##op) "\n" \ SYMBOL_STRING(cti_##op) ":" "\n" \ - "sw $31,48($29)" "\n" \ + "sw $31," STRINGIZE_VALUE_OF(THUNK_RETURN_ADDRESS_OFFSET) "($29)" "\n" \ "jal " SYMBOL_STRING(JITStubThunked_##op) "\n" \ "nop" "\n" \ - "lw $31,48($29)" "\n" \ + "lw $31," STRINGIZE_VALUE_OF(THUNK_RETURN_ADDRESS_OFFSET) "($29)" "\n" \ "jr $31" "\n" \ "nop" "\n" \ ".set reorder" "\n" \ diff --git a/JavaScriptCore/jit/JITStubs.h b/JavaScriptCore/jit/JITStubs.h index 4e73070..d3d7c53 100644 --- a/JavaScriptCore/jit/JITStubs.h +++ b/JavaScriptCore/jit/JITStubs.h @@ -204,9 +204,13 @@ namespace JSC { #endif // COMPILER(MSVC) #elif CPU(MIPS) struct JITStackFrame { - void* reserved; // Unused + JITStubArg reserved; // Unused JITStubArg args[6]; +#if USE(JSVALUE32_64) + void* padding; // Make the overall stack length 8-byte aligned. +#endif + void* preservedGP; // store GP when using PIC code void* preservedS0; void* preservedS1; @@ -235,12 +239,16 @@ namespace JSC { #define STUB_ARGS_DECLARATION void** args #define STUB_ARGS (args) -#if CPU(X86) && COMPILER(MSVC) -#define JIT_STUB __fastcall -#elif CPU(X86) && COMPILER(GCC) && !OS(WINDOWS) -#define JIT_STUB __attribute__ ((fastcall)) +#if CPU(X86) + #if COMPILER(MSVC) + #define JIT_STUB __fastcall + #elif COMPILER(GCC) + #define JIT_STUB __attribute__ ((fastcall)) + #else + #error "JIT_STUB function calls require fastcall conventions on x86, add appropriate directive/attribute here for your compiler!" + #endif #else -#define JIT_STUB + #define JIT_STUB #endif extern "C" void ctiVMThrowTrampoline(); diff --git a/JavaScriptCore/jsc.cpp b/JavaScriptCore/jsc.cpp index 8b535a9..d756a0c 100644 --- a/JavaScriptCore/jsc.cpp +++ b/JavaScriptCore/jsc.cpp @@ -408,6 +408,9 @@ static bool runWithScripts(GlobalObject* globalObject, const Vector<Script>& scr #if ENABLE(SAMPLING_COUNTERS) AbstractSamplingCounter::dump(); #endif +#if ENABLE(REGEXP_TRACING) + globalData->dumpRegExpTrace(); +#endif return success; } diff --git a/JavaScriptCore/parser/JSParser.cpp b/JavaScriptCore/parser/JSParser.cpp index 6852de1..820811e 100644 --- a/JavaScriptCore/parser/JSParser.cpp +++ b/JavaScriptCore/parser/JSParser.cpp @@ -85,11 +85,10 @@ private: bool m_oldAllowsIn; }; - const JSToken& token() { return m_token; } void next(Lexer::LexType lexType = Lexer::IdentifyReservedWords) { - m_lastLine = token().m_info.line; - m_lastTokenEnd = token().m_info.endOffset; + m_lastLine = m_token.m_info.line; + m_lastTokenEnd = m_token.m_info.endOffset; m_lexer->setLastLineNumber(m_lastLine); m_token.m_type = m_lexer->lex(&m_token.m_data, &m_token.m_info, lexType); m_tokenCount++; @@ -110,17 +109,17 @@ private: int tokenStart() { - return token().m_info.startOffset; + return m_token.m_info.startOffset; } int tokenLine() { - return token().m_info.line; + return m_token.m_info.line; } int tokenEnd() { - return token().m_info.endOffset; + return m_token.m_info.endOffset; } template <class TreeBuilder> TreeSourceElements parseSourceElements(TreeBuilder&); @@ -168,7 +167,7 @@ private: bool autoSemiColon() { - if (token().m_type == SEMICOLON) { + if (m_token.m_type == SEMICOLON) { next(); return true; } @@ -324,7 +323,7 @@ template <class TreeBuilder> TreeExpression JSParser::parseVarDeclarationList(Tr int varStart = tokenStart(); identStart = varStart; - const Identifier* name = token().m_data.ident; + const Identifier* name = m_token.m_data.ident; lastIdent = name; next(); bool hasInitializer = match(EQUAL); @@ -356,7 +355,7 @@ template <class TreeBuilder> TreeConstDeclList JSParser::parseConstDeclarationLi do { next(); matchOrFail(IDENT); - const Identifier* name = token().m_data.ident; + const Identifier* name = m_token.m_data.ident; next(); bool hasInitializer = match(EQUAL); context.addVar(name, DeclarationStacks::IsConstant | (hasInitializer ? DeclarationStacks::HasInitializer : 0)); @@ -482,7 +481,7 @@ template <class TreeBuilder> TreeStatement JSParser::parseBreakStatement(TreeBui if (autoSemiColon()) return context.createBreakStatement(startCol, endCol, startLine, endLine); matchOrFail(IDENT); - const Identifier* ident = token().m_data.ident; + const Identifier* ident = m_token.m_data.ident; endCol = tokenEnd(); endLine = tokenLine(); next(); @@ -502,7 +501,7 @@ template <class TreeBuilder> TreeStatement JSParser::parseContinueStatement(Tree if (autoSemiColon()) return context.createContinueStatement(startCol, endCol, startLine, endLine); matchOrFail(IDENT); - const Identifier* ident = token().m_data.ident; + const Identifier* ident = m_token.m_data.ident; endCol = tokenEnd(); endLine = tokenLine(); next(); @@ -654,7 +653,7 @@ template <class TreeBuilder> TreeStatement JSParser::parseTryStatement(TreeBuild next(); consumeOrFail(OPENPAREN); matchOrFail(IDENT); - ident = token().m_data.ident; + ident = m_token.m_data.ident; next(); consumeOrFail(CLOSEPAREN); matchOrFail(OPENBRACE); @@ -705,7 +704,7 @@ template <class TreeBuilder> TreeStatement JSParser::parseBlockStatement(TreeBui template <class TreeBuilder> TreeStatement JSParser::parseStatement(TreeBuilder& context) { failIfStackOverflow(); - switch (token().m_type) { + switch (m_token.m_type) { case OPENBRACE: return parseBlockStatement(context); case VAR: @@ -757,14 +756,14 @@ template <class TreeBuilder> TreeStatement JSParser::parseStatement(TreeBuilder& template <class TreeBuilder> TreeFormalParameterList JSParser::parseFormalParameters(TreeBuilder& context, bool& usesArguments) { matchOrFail(IDENT); - usesArguments = m_globalData->propertyNames->arguments == *token().m_data.ident; - TreeFormalParameterList list = context.createFormalParameterList(*token().m_data.ident); + usesArguments = m_globalData->propertyNames->arguments == *m_token.m_data.ident; + TreeFormalParameterList list = context.createFormalParameterList(*m_token.m_data.ident); TreeFormalParameterList tail = list; next(); while (match(COMMA)) { next(); matchOrFail(IDENT); - const Identifier* ident = token().m_data.ident; + const Identifier* ident = m_token.m_data.ident; next(); usesArguments = usesArguments || m_globalData->propertyNames->arguments == *ident; tail = context.createFormalParameterList(tail, *ident); @@ -784,7 +783,7 @@ template <class TreeBuilder> TreeFunctionBody JSParser::parseFunctionBody(TreeBu template <JSParser::FunctionRequirements requirements, class TreeBuilder> bool JSParser::parseFunctionInfo(TreeBuilder& context, const Identifier*& name, TreeFormalParameterList& parameters, TreeFunctionBody& body, int& openBracePos, int& closeBracePos, int& bodyStartLine) { if (match(IDENT)) { - name = token().m_data.ident; + name = m_token.m_data.ident; next(); } else if (requirements == FunctionNeedsName) return false; @@ -797,7 +796,7 @@ template <JSParser::FunctionRequirements requirements, class TreeBuilder> bool J consumeOrFail(CLOSEPAREN); matchOrFail(OPENBRACE); - openBracePos = token().m_data.intValue; + openBracePos = m_token.m_data.intValue; bodyStartLine = tokenLine(); next(); @@ -807,7 +806,7 @@ template <JSParser::FunctionRequirements requirements, class TreeBuilder> bool J context.setUsesArguments(body); matchOrFail(CLOSEBRACE); - closeBracePos = token().m_data.intValue; + closeBracePos = m_token.m_data.intValue; next(); return true; } @@ -837,7 +836,7 @@ template <class TreeBuilder> TreeStatement JSParser::parseExpressionOrLabelState */ int start = tokenStart(); int startLine = tokenLine(); - const Identifier* ident = token().m_data.ident; + const Identifier* ident = m_token.m_data.ident; int currentToken = m_tokenCount; TreeExpression expression = parseExpression(context); failIfFalse(expression); @@ -972,7 +971,7 @@ template <typename TreeBuilder> TreeExpression JSParser::parseAssignmentExpressi Operator op; bool hadAssignment = false; while (true) { - switch (token().m_type) { + switch (m_token.m_type) { case EQUAL: op = OpEqual; break; case PLUSEQUAL: op = OpPlusEq; break; case MINUSEQUAL: op = OpMinusEq; break; @@ -1051,11 +1050,11 @@ template <class TreeBuilder> TreeExpression JSParser::parseBinaryExpression(Tree failIfFalse(current); context.appendBinaryExpressionInfo(operandStackDepth, current, exprStart, lastTokenEnd(), lastTokenEnd(), initialAssignments != m_assignmentCount); - int precedence = isBinaryOperator(token().m_type); + int precedence = isBinaryOperator(m_token.m_type); if (!precedence) break; m_nonLHSCount++; - int operatorToken = token().m_type; + int operatorToken = m_token.m_type; next(); while (operatorStackDepth && context.operatorStackHasHigherPrecedence(operatorStackDepth, precedence)) { @@ -1086,12 +1085,12 @@ template <class TreeBuilder> TreeExpression JSParser::parseBinaryExpression(Tree template <bool complete, class TreeBuilder> TreeProperty JSParser::parseProperty(TreeBuilder& context) { bool wasIdent = false; - switch (token().m_type) { + switch (m_token.m_type) { namedProperty: case IDENT: wasIdent = true; case STRING: { - const Identifier* ident = token().m_data.ident; + const Identifier* ident = m_token.m_data.ident; next(Lexer::IgnoreReservedWords); if (match(COLON)) { next(); @@ -1118,7 +1117,7 @@ template <bool complete, class TreeBuilder> TreeProperty JSParser::parseProperty return context.template createGetterOrSetterProperty<complete>(type, accessorName, parameters, body, openBracePos, closeBracePos, bodyStartLine, m_lastLine); } case NUMBER: { - double propertyName = token().m_data.doubleValue; + double propertyName = m_token.m_data.doubleValue; next(); consumeOrFail(COLON); TreeExpression node = parseAssignmentExpression(context); @@ -1126,14 +1125,14 @@ template <bool complete, class TreeBuilder> TreeProperty JSParser::parseProperty return context.template createProperty<complete>(m_globalData, propertyName, node, PropertyNode::Constant); } default: - failIfFalse(token().m_type & KeywordTokenFlag); + failIfFalse(m_token.m_type & KeywordTokenFlag); goto namedProperty; } } template <class TreeBuilder> TreeExpression JSParser::parseObjectLiteral(TreeBuilder& context) { - int startOffset = token().m_data.intValue; + int startOffset = m_token.m_data.intValue; consumeOrFail(OPENBRACE); if (match(CLOSEBRACE)) { @@ -1260,7 +1259,7 @@ template <class TreeBuilder> TreeExpression JSParser::parseArrayLiteral(TreeBuil template <class TreeBuilder> TreeExpression JSParser::parsePrimaryExpression(TreeBuilder& context) { - switch (token().m_type) { + switch (m_token.m_type) { case OPENBRACE: return parseObjectLiteral(context); case OPENBRACKET: @@ -1280,17 +1279,17 @@ template <class TreeBuilder> TreeExpression JSParser::parsePrimaryExpression(Tre } case IDENT: { int start = tokenStart(); - const Identifier* ident = token().m_data.ident; + const Identifier* ident = m_token.m_data.ident; next(); return context.createResolve(ident, start); } case STRING: { - const Identifier* ident = token().m_data.ident; + const Identifier* ident = m_token.m_data.ident; next(); return context.createString(ident); } case NUMBER: { - double d = token().m_data.doubleValue; + double d = m_token.m_data.doubleValue; next(); return context.createNumberExpr(d); } @@ -1372,7 +1371,7 @@ template <class TreeBuilder> TreeExpression JSParser::parseMemberExpression(Tree failIfFalse(base); while (true) { - switch (token().m_type) { + switch (m_token.m_type) { case OPENBRACKET: { int expressionEnd = lastTokenEnd(); next(); @@ -1410,7 +1409,7 @@ template <class TreeBuilder> TreeExpression JSParser::parseMemberExpression(Tree int expressionEnd = lastTokenEnd(); next(Lexer::IgnoreReservedWords); matchOrFail(IDENT); - base = context.createDotAccess(base, *token().m_data.ident, expressionStart, expressionEnd, tokenEnd()); + base = context.createDotAccess(base, *m_token.m_data.ident, expressionStart, expressionEnd, tokenEnd()); next(); break; } @@ -1428,15 +1427,15 @@ template <class TreeBuilder> TreeExpression JSParser::parseUnaryExpression(TreeB { AllowInOverride allowInOverride(this); int tokenStackDepth = 0; - while (isUnaryOp(token().m_type)) { + while (isUnaryOp(m_token.m_type)) { m_nonLHSCount++; - context.appendUnaryToken(tokenStackDepth, token().m_type, tokenStart()); + context.appendUnaryToken(tokenStackDepth, m_token.m_type, tokenStart()); next(); } int subExprStart = tokenStart(); TreeExpression expr = parseMemberExpression(context); failIfFalse(expr); - switch (token().m_type) { + switch (m_token.m_type) { case PLUSPLUS: m_nonLHSCount++; expr = context.makePostfixNode(expr, OpPlusPlus, subExprStart, lastTokenEnd(), tokenEnd()); diff --git a/JavaScriptCore/parser/Lexer.cpp b/JavaScriptCore/parser/Lexer.cpp index 6c4db32..cc4321d 100644 --- a/JavaScriptCore/parser/Lexer.cpp +++ b/JavaScriptCore/parser/Lexer.cpp @@ -675,6 +675,27 @@ ALWAYS_INLINE bool Lexer::parseNumberAfterExponentIndicator() return true; } +ALWAYS_INLINE bool Lexer::parseMultilineComment() +{ + while (true) { + while (UNLIKELY(m_current == '*')) { + shift(); + if (m_current == '/') { + shift(); + return true; + } + } + + if (UNLIKELY(m_current == -1)) + return false; + + if (isLineTerminator(m_current)) + shiftLineTerminator(); + else + shift(); + } +} + JSTokenType Lexer::lex(JSTokenData* lvalp, JSTokenInfo* llocp, LexType lexType) { ASSERT(!m_error); @@ -835,7 +856,9 @@ start: } if (m_current == '*') { shift(); - goto inMultiLineComment; + if (parseMultilineComment()) + goto start; + goto returnError; } if (m_current == '=') { shift(); @@ -1002,7 +1025,8 @@ inNumberAfterDecimalPoint: m_terminator = true; if (lastTokenWasRestrKeyword()) { token = SEMICOLON; - goto doneSemicolon; + m_delimited = true; + goto returnToken; } goto start; case CharacterInvalid: @@ -1024,44 +1048,19 @@ inSingleLineComment: shiftLineTerminator(); m_atLineStart = true; m_terminator = true; - if (lastTokenWasRestrKeyword()) - goto doneSemicolon; - goto start; - -inMultiLineComment: - while (true) { - if (UNLIKELY(m_current == '*')) { - shift(); - if (m_current == '/') - break; - if (m_current == '*') - continue; - } - - if (UNLIKELY(m_current == -1)) - goto returnError; - - if (isLineTerminator(m_current)) - shiftLineTerminator(); - else - shift(); - } - shift(); - goto start; + if (!lastTokenWasRestrKeyword()) + goto start; -doneSemicolon: token = SEMICOLON; m_delimited = true; // Fall through into returnToken. -returnToken: { - int lineNumber = m_lineNumber; - llocp->line = lineNumber; +returnToken: + llocp->line = m_lineNumber; llocp->startOffset = startOffset; llocp->endOffset = currentOffset(); m_lastToken = token; return token; -} returnError: m_error = true; diff --git a/JavaScriptCore/parser/Lexer.h b/JavaScriptCore/parser/Lexer.h index da84a6b..e6c1efd 100644 --- a/JavaScriptCore/parser/Lexer.h +++ b/JavaScriptCore/parser/Lexer.h @@ -101,6 +101,7 @@ namespace JSC { ALWAYS_INLINE bool parseDecimal(double& returnValue); ALWAYS_INLINE void parseNumberAfterDecimalPoint(); ALWAYS_INLINE bool parseNumberAfterExponentIndicator(); + ALWAYS_INLINE bool parseMultilineComment(); static const size_t initialReadBufferCapacity = 32; diff --git a/JavaScriptCore/runtime/InitializeThreading.cpp b/JavaScriptCore/runtime/InitializeThreading.cpp index 33e8e68..08dddc1 100644 --- a/JavaScriptCore/runtime/InitializeThreading.cpp +++ b/JavaScriptCore/runtime/InitializeThreading.cpp @@ -58,6 +58,7 @@ static void initializeThreadingOnce() #if ENABLE(JSC_MULTIPLE_THREADS) s_dtoaP5Mutex = new Mutex; initializeDates(); + RegisterFile::initializeThreading(); #endif } diff --git a/JavaScriptCore/runtime/JSGlobalData.cpp b/JavaScriptCore/runtime/JSGlobalData.cpp index 97f9be5..5eaa59b 100644 --- a/JavaScriptCore/runtime/JSGlobalData.cpp +++ b/JavaScriptCore/runtime/JSGlobalData.cpp @@ -51,6 +51,10 @@ #include "Parser.h" #include "RegExpCache.h" #include <wtf/WTFThreadData.h> +#if ENABLE(REGEXP_TRACING) +#include "RegExp.h" +#endif + #if ENABLE(JSC_MULTIPLE_THREADS) #include <wtf/Threading.h> @@ -145,6 +149,9 @@ JSGlobalData::JSGlobalData(GlobalDataType globalDataType, ThreadStackType thread , cachedUTCOffset(NaN) , maxReentryDepth(threadStackType == ThreadStackTypeSmall ? MaxSmallThreadReentryDepth : MaxLargeThreadReentryDepth) , m_regExpCache(new RegExpCache(this)) +#if ENABLE(REGEXP_TRACING) + , m_rtTraceList(new RTTraceList()) +#endif #ifndef NDEBUG , exclusiveThread(0) #endif @@ -218,6 +225,9 @@ JSGlobalData::~JSGlobalData() delete clientData; delete m_regExpCache; +#if ENABLE(REGEXP_TRACING) + delete m_rtTraceList; +#endif } PassRefPtr<JSGlobalData> JSGlobalData::createContextGroup(ThreadStackType type) @@ -301,4 +311,38 @@ void JSGlobalData::dumpSampleData(ExecState* exec) interpreter->dumpSampleData(exec); } + +#if ENABLE(REGEXP_TRACING) +void JSGlobalData::addRegExpToTrace(PassRefPtr<RegExp> regExp) +{ + m_rtTraceList->add(regExp); +} + +void JSGlobalData::dumpRegExpTrace() +{ + // The first RegExp object is ignored. It is create by the RegExpPrototype ctor and not used. + RTTraceList::iterator iter = ++m_rtTraceList->begin(); + + if (iter != m_rtTraceList->end()) { + printf("\nRegExp Tracing\n"); + printf(" match() matches\n"); + printf("Regular Expression JIT Address calls found\n"); + printf("----------------------------------------+----------------+----------+----------\n"); + + unsigned reCount = 0; + + for (; iter != m_rtTraceList->end(); ++iter, ++reCount) + (*iter)->printTraceData(); + + printf("%d Regular Expressions\n", reCount); + } + + m_rtTraceList->clear(); +} +#else +void JSGlobalData::dumpRegExpTrace() +{ +} +#endif + } // namespace JSC diff --git a/JavaScriptCore/runtime/JSGlobalData.h b/JavaScriptCore/runtime/JSGlobalData.h index 43c4bab..8e2ed61 100644 --- a/JavaScriptCore/runtime/JSGlobalData.h +++ b/JavaScriptCore/runtime/JSGlobalData.h @@ -46,6 +46,9 @@ #include <wtf/HashMap.h> #include <wtf/RefCounted.h> #include <wtf/ThreadSpecific.h> +#if ENABLE(REGEXP_TRACING) +#include <wtf/ListHashSet.h> +#endif struct OpaqueJSClass; struct OpaqueJSClassContextData; @@ -64,6 +67,9 @@ namespace JSC { class Stringifier; class Structure; class UString; +#if ENABLE(REGEXP_TRACING) + class RegExp; +#endif struct HashTable; struct Instruction; @@ -222,6 +228,11 @@ namespace JSC { BumpPointerAllocator m_regexAllocator; #endif +#if ENABLE(REGEXP_TRACING) + typedef ListHashSet<RefPtr<RegExp> > RTTraceList; + RTTraceList* m_rtTraceList; +#endif + #ifndef NDEBUG ThreadIdentifier exclusiveThread; #endif @@ -234,6 +245,10 @@ namespace JSC { void stopSampling(); void dumpSampleData(ExecState* exec); RegExpCache* regExpCache() { return m_regExpCache; } +#if ENABLE(REGEXP_TRACING) + void addRegExpToTrace(PassRefPtr<RegExp> regExp); +#endif + void dumpRegExpTrace(); private: JSGlobalData(GlobalDataType, ThreadStackType); static JSGlobalData*& sharedInstanceInternal(); diff --git a/JavaScriptCore/runtime/RegExp.cpp b/JavaScriptCore/runtime/RegExp.cpp index 5ad9f3f..d4545cb 100644 --- a/JavaScriptCore/runtime/RegExp.cpp +++ b/JavaScriptCore/runtime/RegExp.cpp @@ -46,11 +46,33 @@ namespace JSC { +struct RegExpRepresentation { +#if ENABLE(YARR_JIT) + Yarr::RegexCodeBlock m_regExpJITCode; +#elif ENABLE(YARR) + OwnPtr<Yarr::BytecodePattern> m_regExpBytecode; +#else + JSRegExp* m_regExp; +#endif + +#if !ENABLE(YARR) + ~RegExpRepresentation() + { + jsRegExpFree(m_regExp); + } +#endif +}; + inline RegExp::RegExp(JSGlobalData* globalData, const UString& pattern, const UString& flags) : m_pattern(pattern) , m_flagBits(0) , m_constructionError(0) , m_numSubpatterns(0) +#if ENABLE(REGEXP_TRACING) + , m_rtMatchCallCount(0) + , m_rtMatchFoundCount(0) +#endif + , m_representation(adoptPtr(new RegExpRepresentation)) { // NOTE: The global flag is handled on a case-by-case basis by functions like // String::match and RegExpObject::match. @@ -65,16 +87,17 @@ inline RegExp::RegExp(JSGlobalData* globalData, const UString& pattern, const US compile(globalData); } -#if !ENABLE(YARR) RegExp::~RegExp() { - jsRegExpFree(m_regExp); } -#endif PassRefPtr<RegExp> RegExp::create(JSGlobalData* globalData, const UString& pattern, const UString& flags) { - return adoptRef(new RegExp(globalData, pattern, flags)); + RefPtr<RegExp> res = adoptRef(new RegExp(globalData, pattern, flags)); +#if ENABLE(REGEXP_TRACING) + globalData->addRegExpToTrace(res); +#endif + return res.release(); } #if ENABLE(YARR) @@ -82,9 +105,9 @@ PassRefPtr<RegExp> RegExp::create(JSGlobalData* globalData, const UString& patte void RegExp::compile(JSGlobalData* globalData) { #if ENABLE(YARR_JIT) - Yarr::jitCompileRegex(globalData, m_regExpJITCode, m_pattern, m_numSubpatterns, m_constructionError, ignoreCase(), multiline()); + Yarr::jitCompileRegex(globalData, m_representation->m_regExpJITCode, m_pattern, m_numSubpatterns, m_constructionError, ignoreCase(), multiline()); #else - m_regExpBytecode = Yarr::byteCompileRegex(m_pattern, m_numSubpatterns, m_constructionError, &globalData->m_regexAllocator, ignoreCase(), multiline()); + m_representation->m_regExpBytecode = Yarr::byteCompileRegex(m_pattern, m_numSubpatterns, m_constructionError, &globalData->m_regexAllocator, ignoreCase(), multiline()); #endif } @@ -94,14 +117,18 @@ int RegExp::match(const UString& s, int startOffset, Vector<int, 32>* ovector) startOffset = 0; if (ovector) ovector->resize(0); + +#if ENABLE(REGEXP_TRACING) + m_rtMatchCallCount++; +#endif if (static_cast<unsigned>(startOffset) > s.length() || s.isNull()) return -1; #if ENABLE(YARR_JIT) - if (!!m_regExpJITCode) { + if (!!m_representation->m_regExpJITCode) { #else - if (m_regExpBytecode) { + if (m_representation->m_regExpBytecode) { #endif int offsetVectorSize = (m_numSubpatterns + 1) * 3; // FIXME: should be 2 - but adding temporary fallback to pcre. int* offsetVector; @@ -119,9 +146,9 @@ int RegExp::match(const UString& s, int startOffset, Vector<int, 32>* ovector) offsetVector[j] = -1; #if ENABLE(YARR_JIT) - int result = Yarr::executeRegex(m_regExpJITCode, s.characters(), startOffset, s.length(), offsetVector, offsetVectorSize); + int result = Yarr::executeRegex(m_representation->m_regExpJITCode, s.characters(), startOffset, s.length(), offsetVector, offsetVectorSize); #else - int result = Yarr::interpretRegex(m_regExpBytecode.get(), s.characters(), startOffset, s.length(), offsetVector); + int result = Yarr::interpretRegex(m_representation->m_regExpBytecode.get(), s.characters(), startOffset, s.length(), offsetVector); #endif if (result < 0) { @@ -134,6 +161,11 @@ int RegExp::match(const UString& s, int startOffset, Vector<int, 32>* ovector) ovector->clear(); } +#if ENABLE(REGEXP_TRACING) + if (result != -1) + m_rtMatchFoundCount++; +#endif + return result; } @@ -144,14 +176,18 @@ int RegExp::match(const UString& s, int startOffset, Vector<int, 32>* ovector) void RegExp::compile(JSGlobalData*) { - m_regExp = 0; + m_representation->m_regExp = 0; JSRegExpIgnoreCaseOption ignoreCaseOption = ignoreCase() ? JSRegExpIgnoreCase : JSRegExpDoNotIgnoreCase; JSRegExpMultilineOption multilineOption = multiline() ? JSRegExpMultiline : JSRegExpSingleLine; - m_regExp = jsRegExpCompile(reinterpret_cast<const UChar*>(m_pattern.characters()), m_pattern.length(), ignoreCaseOption, multilineOption, &m_numSubpatterns, &m_constructionError); + m_representation->m_regExp = jsRegExpCompile(reinterpret_cast<const UChar*>(m_pattern.characters()), m_pattern.length(), ignoreCaseOption, multilineOption, &m_numSubpatterns, &m_constructionError); } int RegExp::match(const UString& s, int startOffset, Vector<int, 32>* ovector) { +#if ENABLE(REGEXP_TRACING) + m_rtMatchCallCount++; +#endif + if (startOffset < 0) startOffset = 0; if (ovector) @@ -160,7 +196,7 @@ int RegExp::match(const UString& s, int startOffset, Vector<int, 32>* ovector) if (static_cast<unsigned>(startOffset) > s.length() || s.isNull()) return -1; - if (m_regExp) { + if (m_representation->m_regExp) { // Set up the offset vector for the result. // First 2/3 used for result, the last third used by PCRE. int* offsetVector; @@ -175,7 +211,7 @@ int RegExp::match(const UString& s, int startOffset, Vector<int, 32>* ovector) offsetVector = ovector->data(); } - int numMatches = jsRegExpExecute(m_regExp, reinterpret_cast<const UChar*>(s.characters()), s.length(), startOffset, offsetVector, offsetVectorSize); + int numMatches = jsRegExpExecute(m_representation->m_regExp, reinterpret_cast<const UChar*>(s.characters()), s.length(), startOffset, offsetVector, offsetVectorSize); if (numMatches < 0) { #ifndef NDEBUG @@ -187,12 +223,45 @@ int RegExp::match(const UString& s, int startOffset, Vector<int, 32>* ovector) return -1; } +#if ENABLE(REGEXP_TRACING) + m_rtMatchFoundCount++; +#endif + return offsetVector[0]; } return -1; } - + #endif +#if ENABLE(REGEXP_TRACING) + void RegExp::printTraceData() + { + char formattedPattern[41]; + char rawPattern[41]; + + strncpy(rawPattern, m_pattern.utf8().data(), 40); + rawPattern[40]= '\0'; + + int pattLen = strlen(rawPattern); + + snprintf(formattedPattern, 41, (pattLen <= 38) ? "/%.38s/" : "/%.36s...", rawPattern); + +#if ENABLE(YARR_JIT) + Yarr::RegexCodeBlock& codeBlock = m_representation->m_regExpJITCode; + + char jitAddr[20]; + if (codeBlock.getFallback()) + sprintf(jitAddr, "fallback"); + else + sprintf(jitAddr, "0x%014lx", (uintptr_t)codeBlock.getAddr()); +#else + const char* jitAddr = "JIT Off"; +#endif + + printf("%-40.40s %16.16s %10d %10d\n", formattedPattern, jitAddr, m_rtMatchCallCount, m_rtMatchFoundCount); + } +#endif + } // namespace JSC diff --git a/JavaScriptCore/runtime/RegExp.h b/JavaScriptCore/runtime/RegExp.h index aadad6b..e6e2fbc 100644 --- a/JavaScriptCore/runtime/RegExp.h +++ b/JavaScriptCore/runtime/RegExp.h @@ -26,21 +26,16 @@ #include "ExecutableAllocator.h" #include <wtf/Forward.h> #include <wtf/RefCounted.h> -#include "yarr/RegexJIT.h" -#include "yarr/RegexInterpreter.h" - -struct JSRegExp; namespace JSC { + struct RegExpRepresentation; class JSGlobalData; class RegExp : public RefCounted<RegExp> { public: static PassRefPtr<RegExp> create(JSGlobalData* globalData, const UString& pattern, const UString& flags); -#if !ENABLE(YARR) ~RegExp(); -#endif bool global() const { return m_flagBits & Global; } bool ignoreCase() const { return m_flagBits & IgnoreCase; } @@ -53,6 +48,10 @@ namespace JSC { int match(const UString&, int startOffset, Vector<int, 32>* ovector = 0); unsigned numSubpatterns() const { return m_numSubpatterns; } + +#if ENABLE(REGEXP_TRACING) + void printTraceData(); +#endif private: RegExp(JSGlobalData* globalData, const UString& pattern, const UString& flags); @@ -65,14 +64,12 @@ namespace JSC { int m_flagBits; const char* m_constructionError; unsigned m_numSubpatterns; - -#if ENABLE(YARR_JIT) - Yarr::RegexCodeBlock m_regExpJITCode; -#elif ENABLE(YARR) - OwnPtr<Yarr::BytecodePattern> m_regExpBytecode; -#else - JSRegExp* m_regExp; +#if ENABLE(REGEXP_TRACING) + unsigned m_rtMatchCallCount; + unsigned m_rtMatchFoundCount; #endif + + OwnPtr<RegExpRepresentation> m_representation; }; } // namespace JSC diff --git a/JavaScriptCore/wtf/ByteArray.h b/JavaScriptCore/wtf/ByteArray.h index f5f5ded..f4d34a4 100644 --- a/JavaScriptCore/wtf/ByteArray.h +++ b/JavaScriptCore/wtf/ByteArray.h @@ -26,7 +26,9 @@ #ifndef ByteArray_h #define ByteArray_h +#include <limits.h> #include <wtf/PassRefPtr.h> +#include <wtf/Platform.h> #include <wtf/RefCounted.h> namespace WTF { @@ -86,7 +88,14 @@ namespace WTF { { } size_t m_size; - unsigned char m_data[sizeof(size_t)]; +// MSVC can't handle correctly unsized array. +// warning C4200: nonstandard extension used : zero-sized array in struct/union +// Cannot generate copy-ctor or copy-assignment operator when UDT contains a zero-sized array +#if COMPILER(MSVC) + unsigned char m_data[INT_MAX]; +#else + unsigned char m_data[]; +#endif }; } diff --git a/JavaScriptCore/wtf/CMakeListsEfl.txt b/JavaScriptCore/wtf/CMakeListsEfl.txt index 3cd3c8e..6a714ae 100644 --- a/JavaScriptCore/wtf/CMakeListsEfl.txt +++ b/JavaScriptCore/wtf/CMakeListsEfl.txt @@ -14,6 +14,10 @@ IF (ENABLE_GLIB_SUPPORT) gobject/GOwnPtr.cpp gobject/GRefPtr.cpp ) + + LIST(APPEND WTF_INCLUDE_DIRECTORIES + ${JAVASCRIPTCORE_DIR}/wtf/gobject + ) ENDIF () LIST(APPEND WTF_LIBRARIES diff --git a/JavaScriptCore/wtf/FastMalloc.cpp b/JavaScriptCore/wtf/FastMalloc.cpp index ee6b02c..0f240ff 100644 --- a/JavaScriptCore/wtf/FastMalloc.cpp +++ b/JavaScriptCore/wtf/FastMalloc.cpp @@ -1492,11 +1492,23 @@ void TCMalloc_PageHeap::init() void TCMalloc_PageHeap::initializeScavenger() { - pthread_mutex_init(&m_scavengeMutex, 0); - pthread_cond_init(&m_scavengeCondition, 0); - m_scavengeThreadActive = true; - pthread_t thread; - pthread_create(&thread, 0, runScavengerThread, this); + // Create a non-recursive mutex. +#if !defined(PTHREAD_MUTEX_NORMAL) || PTHREAD_MUTEX_NORMAL == PTHREAD_MUTEX_DEFAULT + pthread_mutex_init(&m_scavengeMutex, 0); +#else + pthread_mutexattr_t attr; + pthread_mutexattr_init(&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_NORMAL); + + pthread_mutex_init(&m_scavengeMutex, &attr); + + pthread_mutexattr_destroy(&attr); +#endif + + pthread_cond_init(&m_scavengeCondition, 0); + m_scavengeThreadActive = true; + pthread_t thread; + pthread_create(&thread, 0, runScavengerThread, this); } void* TCMalloc_PageHeap::runScavengerThread(void* context) @@ -1510,8 +1522,10 @@ void* TCMalloc_PageHeap::runScavengerThread(void* context) ALWAYS_INLINE void TCMalloc_PageHeap::signalScavenger() { - if (!m_scavengeThreadActive && shouldScavenge()) - pthread_cond_signal(&m_scavengeCondition); + // m_scavengeMutex should be held before accessing m_scavengeThreadActive. + ASSERT(pthread_mutex_trylock(m_scavengeMutex)); + if (!m_scavengeThreadActive && shouldScavenge()) + pthread_cond_signal(&m_scavengeCondition); } #else // !HAVE(DISPATCH_H) @@ -1528,10 +1542,11 @@ void TCMalloc_PageHeap::initializeScavenger() ALWAYS_INLINE void TCMalloc_PageHeap::signalScavenger() { - if (!m_scavengingScheduled && shouldScavenge()) { - m_scavengingScheduled = true; - dispatch_resume(m_scavengeTimer); - } + ASSERT(IsHeld(pageheap_lock)); + if (!m_scavengingScheduled && shouldScavenge()) { + m_scavengingScheduled = true; + dispatch_resume(m_scavengeTimer); + } } #endif @@ -2397,15 +2412,13 @@ void TCMalloc_PageHeap::scavengerThread() void TCMalloc_PageHeap::periodicScavenge() { - { SpinLockHolder h(&pageheap_lock); pageheap->scavenge(); - } - if (!shouldScavenge()) { - m_scavengingScheduled = false; - dispatch_suspend(m_scavengeTimer); - } + if (!shouldScavenge()) { + m_scavengingScheduled = false; + dispatch_suspend(m_scavengeTimer); + } } #endif // HAVE(DISPATCH_H) diff --git a/JavaScriptCore/wtf/NonCopyingSort.h b/JavaScriptCore/wtf/NonCopyingSort.h new file mode 100644 index 0000000..fd611bd --- /dev/null +++ b/JavaScriptCore/wtf/NonCopyingSort.h @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2010 Apple Inc. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef WTF_NonCopyingSort_h +#define WTF_NonCopyingSort_h + +namespace WTF { + +using std::swap; + +template<typename RandomAccessIterator, typename Predicate> +inline void siftDown(RandomAccessIterator array, ptrdiff_t start, ptrdiff_t end, Predicate compareLess) +{ + ptrdiff_t root = start; + + while (root * 2 + 1 <= end) { + ptrdiff_t child = root * 2 + 1; + if (child < end && compareLess(array[child], array[child + 1])) + child++; + + if (compareLess(array[root], array[child])) { + swap(array[root], array[child]); + root = child; + } else + return; + } +} + +template<typename RandomAccessIterator, typename Predicate> +inline void heapify(RandomAccessIterator array, ptrdiff_t count, Predicate compareLess) +{ + ptrdiff_t start = (count - 2) / 2; + + while (start >= 0) { + siftDown(array, start, count - 1, compareLess); + start--; + } +} + +template<typename RandomAccessIterator, typename Predicate> +void heapSort(RandomAccessIterator start, RandomAccessIterator end, Predicate compareLess) +{ + ptrdiff_t count = end - start; + heapify(start, count, compareLess); + + ptrdiff_t endIndex = count - 1; + while (endIndex > 0) { + swap(start[endIndex], start[0]); + siftDown(start, 0, endIndex - 1, compareLess); + endIndex--; + } +} + +template<typename RandomAccessIterator, typename Predicate> +inline void nonCopyingSort(RandomAccessIterator start, RandomAccessIterator end, Predicate compareLess) +{ + // heapsort happens to use only swaps, not copies, but the essential thing about + // this function is the fact that it does not copy, not the specific algorithm + heapSort(start, end, compareLess); +} + +} // namespace WTF + +using WTF::nonCopyingSort; + +#endif // WTF_NonCopyingSort_h diff --git a/JavaScriptCore/wtf/Platform.h b/JavaScriptCore/wtf/Platform.h index 4fc0a64..e77fe98 100644 --- a/JavaScriptCore/wtf/Platform.h +++ b/JavaScriptCore/wtf/Platform.h @@ -142,6 +142,7 @@ #define WTF_MIPS_ARCH_REV __mips_isa_rev #define WTF_MIPS_ISA_REV(v) (defined WTF_MIPS_ARCH_REV && WTF_MIPS_ARCH_REV == v) #define WTF_MIPS_DOUBLE_FLOAT (defined __mips_hard_float && !defined __mips_single_float) +#define WTF_MIPS_FP64 (defined __mips_fpr && __mips_fpr == 64) /* MIPS requires allocators to use aligned memory */ #define WTF_USE_ARENA_ALLOC_ALIGNMENT_INTEGER 1 #endif /* MIPS */ @@ -939,11 +940,7 @@ || CPU(SPARC64) \ || CPU(PPC64) #define WTF_USE_JSVALUE64 1 -#elif CPU(MIPS) || (CPU(ARM_TRADITIONAL) && COMPILER(MSVC)) -#define WTF_USE_JSVALUE32 1 -#elif OS(WINDOWS) && COMPILER(MINGW) -/* Using JSVALUE32_64 causes padding/alignement issues for JITStubArg -on MinGW. See https://bugs.webkit.org/show_bug.cgi?id=29268 */ +#elif CPU(ARM_TRADITIONAL) && COMPILER(MSVC) #define WTF_USE_JSVALUE32 1 #else #define WTF_USE_JSVALUE32_64 1 @@ -959,6 +956,11 @@ on MinGW. See https://bugs.webkit.org/show_bug.cgi?id=29268 */ #define ENABLE_JIT 0 #endif +/* JIT is not implemented for 64 bit on MSVC */ +#if !defined(ENABLE_JIT) && COMPILER(MSVC) && CPU(X86_64) +#define ENABLE_JIT 0 +#endif + /* The JIT is enabled by default on all x86, x64-64, ARM & MIPS platforms. */ #if !defined(ENABLE_JIT) \ && (CPU(X86) || CPU(X86_64) || CPU(ARM) || CPU(MIPS)) \ @@ -1016,6 +1018,9 @@ on MinGW. See https://bugs.webkit.org/show_bug.cgi?id=29268 */ #define ENABLE_COMPUTED_GOTO_INTERPRETER 1 #endif +/* Regular Expression Tracing - Set to 1 to trace RegExp's in jsc. Results dumped at exit */ +#define ENABLE_REGEXP_TRACING 0 + /* Yet Another Regex Runtime - turned on by default for JIT enabled ports. */ #if ENABLE(JIT) && !defined(ENABLE_YARR) && !defined(ENABLE_YARR_JIT) #define ENABLE_YARR 1 @@ -1133,8 +1138,8 @@ on MinGW. See https://bugs.webkit.org/show_bug.cgi?id=29268 */ #define ENABLE_BRANCH_COMPACTION 1 #endif -#if PLATFORM(GTK) -#include "GtkTypedefs.h" +#if PLATFORM(GTK) || (PLATFORM(EFL) && ENABLE(GLIB_SUPPORT)) +#include "GTypedefs.h" #endif #endif /* WTF_Platform_h */ diff --git a/JavaScriptCore/wtf/gobject/GRefPtr.cpp b/JavaScriptCore/wtf/gobject/GRefPtr.cpp index c16024c..14f7cf4 100644 --- a/JavaScriptCore/wtf/gobject/GRefPtr.cpp +++ b/JavaScriptCore/wtf/gobject/GRefPtr.cpp @@ -66,4 +66,17 @@ template <> void derefPlatformPtr(GVariant* ptr) #endif +template <> GSource* refPlatformPtr(GSource* ptr) +{ + if (ptr) + g_source_ref(ptr); + return ptr; +} + +template <> void derefPlatformPtr(GSource* ptr) +{ + if (ptr) + g_source_unref(ptr); +} + } // namespace WTF diff --git a/JavaScriptCore/wtf/gobject/GRefPtr.h b/JavaScriptCore/wtf/gobject/GRefPtr.h index 1ca55ce..ede0a7a 100644 --- a/JavaScriptCore/wtf/gobject/GRefPtr.h +++ b/JavaScriptCore/wtf/gobject/GRefPtr.h @@ -36,6 +36,8 @@ template <> GHashTable* refPlatformPtr(GHashTable* ptr); template <> void derefPlatformPtr(GHashTable* ptr); template <> GVariant* refPlatformPtr(GVariant* ptr); template <> void derefPlatformPtr(GVariant* ptr); +template <> GSource* refPlatformPtr(GSource* ptr); +template <> void derefPlatformPtr(GSource* ptr); template <typename T> inline T* refPlatformPtr(T* ptr) { diff --git a/JavaScriptCore/wtf/gtk/GtkTypedefs.h b/JavaScriptCore/wtf/gobject/GTypedefs.h index ee96f84..e79ba33 100644 --- a/JavaScriptCore/wtf/gtk/GtkTypedefs.h +++ b/JavaScriptCore/wtf/gobject/GTypedefs.h @@ -36,7 +36,8 @@ typedef unsigned long gulong; typedef unsigned short gushort; typedef void* gpointer; -typedef struct _cairo_surface cairo_surface_t; +typedef struct _GAsyncResult GAsyncResult; +typedef struct _GCancellable GCancellable; typedef struct _GCond GCond; typedef struct _GDir GDir; typedef struct _GdkAtom* GdkAtom; @@ -48,9 +49,22 @@ typedef struct _GdkPixbuf GdkPixbuf; typedef struct _GError GError; typedef struct _GFile GFile; typedef struct _GHashTable GHashTable; +typedef struct _GInputStream GInputStream; typedef struct _GList GList; typedef struct _GMutex GMutex; +typedef struct _GOutputStream GOutputStream; typedef struct _GPatternSpec GPatternSpec; +typedef struct _GSocketClient GSocketClient; +typedef struct _GSocketConnection GSocketConnection; +typedef struct _GSource GSource; +typedef struct _GVariant GVariant; +typedef union _GdkEvent GdkEvent; + +#if PLATFORM(CAIRO) +typedef struct _cairo_surface cairo_surface_t; +#endif + +#if PLATFORM(GTK) typedef struct _GtkAction GtkAction; typedef struct _GtkAdjustment GtkAdjustment; typedef struct _GtkBorder GtkBorder; @@ -65,8 +79,6 @@ typedef struct _GtkStyle GtkStyle; typedef struct _GtkTargetList GtkTargetList; typedef struct _GtkThemeParts GtkThemeParts; typedef struct _GtkWidget GtkWidget; -typedef struct _GVariant GVariant; -typedef union _GdkEvent GdkEvent; #ifdef GTK_API_VERSION_2 typedef struct _GdkRectangle GdkRectangle; @@ -77,4 +89,5 @@ typedef cairo_rectangle_int_t GdkRectangle; #endif +#endif #endif /* GtkTypedefs_h */ diff --git a/JavaScriptCore/wtf/text/WTFString.cpp b/JavaScriptCore/wtf/text/WTFString.cpp index a83dbba..9b53e81 100644 --- a/JavaScriptCore/wtf/text/WTFString.cpp +++ b/JavaScriptCore/wtf/text/WTFString.cpp @@ -335,7 +335,8 @@ String String::format(const char *format, ...) va_end(args); - return buffer; + QByteArray ba = buffer.toUtf8(); + return StringImpl::create(ba.constData(), ba.length()); #elif OS(WINCE) va_list args; diff --git a/JavaScriptCore/wtf/url/api/ParsedURL.cpp b/JavaScriptCore/wtf/url/api/ParsedURL.cpp new file mode 100644 index 0000000..abe0061 --- /dev/null +++ b/JavaScriptCore/wtf/url/api/ParsedURL.cpp @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2010 Google, Inc. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "ParsedURL.h" + +#include "URLComponent.h" +#include "URLParser.h" + +namespace WTF { + +ParsedURL::ParsedURL(const URLString& spec) + : m_spec(spec) +{ + // FIXME: Handle non-standard URLs. + if (spec.string().isEmpty()) + return; + URLParser<UChar>::parseStandardURL(spec.string().characters(), spec.string().length(), m_segments); +} + +String ParsedURL::scheme() const +{ + return segment(m_segments.scheme); +} + +String ParsedURL::username() const +{ + return segment(m_segments.username); +} + +String ParsedURL::password() const +{ + return segment(m_segments.password); +} + +String ParsedURL::host() const +{ + return segment(m_segments.host); +} + +String ParsedURL::port() const +{ + return segment(m_segments.port); +} + +String ParsedURL::path() const +{ + return segment(m_segments.path); +} + +String ParsedURL::query() const +{ + return segment(m_segments.query); +} + +String ParsedURL::fragment() const +{ + return segment(m_segments.fragment); +} + +String ParsedURL::segment(const URLComponent& component) const +{ + if (!component.isValid()) + return String(); + return m_spec.string().substring(component.begin(), component.length()); +} + +} diff --git a/JavaScriptCore/wtf/url/api/ParsedURL.h b/JavaScriptCore/wtf/url/api/ParsedURL.h new file mode 100644 index 0000000..ebc19b7 --- /dev/null +++ b/JavaScriptCore/wtf/url/api/ParsedURL.h @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2010 Google, Inc. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ParsedURL_h +#define ParsedURL_h + +#include "URLSegments.h" +#include "URLString.h" + +namespace WTF { + +class URLComponent; + +class ParsedURL { +public: + explicit ParsedURL(const URLString&); + + // FIXME: Add a method for parsing non-canonicalized URLs. + + String scheme() const; + String username() const; + String password() const; + String host() const; + String port() const; + String path() const; + String query() const; + String fragment() const; + + URLString spec() { return m_spec; } + +private: + inline String segment(const URLComponent&) const; + + URLString m_spec; + URLSegments m_segments; +}; + +} + +#endif diff --git a/JavaScriptCore/wtf/url/api/URLString.h b/JavaScriptCore/wtf/url/api/URLString.h new file mode 100644 index 0000000..7395d49 --- /dev/null +++ b/JavaScriptCore/wtf/url/api/URLString.h @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2010 Google, Inc. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef URLString_h +#define URLString_h + +#include "WTFString.h" + +namespace WTF { + +// URLString represents a string that's a canonicalized URL. +class URLString { +public: + URLString() { } + + const String& string() const { return m_string;} + +private: + friend class ParsedURL; + + // URLString can only be constructed by a ParsedURL. + explicit URLString(const String& string) + : m_string(string) + { + } + + String m_string; +}; + +} + +#endif + diff --git a/JavaScriptCore/yarr/RegexJIT.h b/JavaScriptCore/yarr/RegexJIT.h index 7f9c16e..5d587b2 100644 --- a/JavaScriptCore/yarr/RegexJIT.h +++ b/JavaScriptCore/yarr/RegexJIT.h @@ -73,6 +73,10 @@ public: { return reinterpret_cast<RegexJITCode>(m_ref.m_code.executableAddress())(input, start, length, output); } + +#if ENABLE(REGEXP_TRACING) + void *getAddr() { return m_ref.m_code.executableAddress(); } +#endif private: MacroAssembler::CodeRef m_ref; |