- 28 Mar, 2008 3 commits
-
-
ap@webkit.org authored
Fix a dtoa thread safety issue. WebCore can call kjs_strtod without holding JS lock, but we didn't have thread safety compiled in for dtoa. This is a 0.5% regression on SunSpider, which Sam Weinig has volunteered to cover with his recent improvement. * kjs/dtoa.cpp: (Bigint::Balloc): (Bigint::Bfree): Changed to use fastMalloc/fastDelete - they are much faster than the dtoa custom version was in the presence of locking (but somewhat slower in single-threaded case). (Bigint::pow5mult): Got rid of the dreaded double-checked locking anti-pattern (had to restructure the code to avoid significant performance implications). (Bigint::lshift): Rewrote to avoid an allocation, if possible. (Bigint::rv_alloc): (Bigint::kjs_freedtoa): (Bigint::kjs_dtoa): Check for USE(MULTIPLE_THREADS), not dtoa legacy MULTIPLE_THREADS. * kjs/InitializeThreading.cpp: Added. (KJS::initializeThreading): * kjs/InitializeThreading.h: Added. Initialize threading at KJS level, if enabled. * kjs/dtoa.h: Expose dtoa mutex for KJS::initializeThreading. * kjs/testkjs.cpp: (kjsmain): Call initializeThreading. * JavaScriptCore.exp: Export KJS::initializeThreading. * GNUmakefile.am: * JavaScriptCore.exp: * JavaScriptCore.pri: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCoreSources.bkl: * JavaScriptCore.xcodeproj/project.pbxproj: Added InitializeThreading.{h,cpp}. * wtf/Threading.h: Removed a using directive for WTF::initializeThreading - it is only to be called from KJS::initializeThreading, and having it in the global namespace is useless. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31404 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
beidson@apple.com authored
2008-03-28 Brady Eidson <beidson@apple.com> Reviewed by Darin Export Unicode/UTF8.h and convertUTF16ToUTF8() for more flexible conversion in WebCore * JavaScriptCore.exp: * JavaScriptCore.xcodeproj/project.pbxproj: WebCore: 2008-03-28 Brady Eidson <beidson@apple.com> Reviewed by Darin Using convertUTF16ToUTF8() from WTF, add a helper function that gives you a UTF8 SharedBuffer created from a String. * ForwardingHeaders/wtf/unicode/UTF8.h: Added. * platform/text/PlatformString.h: * platform/text/String.cpp: (WebCore::utf8Buffer): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31398 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
mrowe@apple.com authored
Reviewed by Mark Rowe. <rdar://problem/5826236> Regular expressions with large nested repetition counts can have their compiled length calculated incorrectly. * pcre/pcre_compile.cpp: (multiplyWithOverflowCheck): (calculateCompiledPatternLength): Check for overflow when dealing with nested repetition counts and bail with an error rather than returning incorrect results. 2008-03-27 Mark Rowe <mrowe@apple.com> Reviewed by Adam Roben. Tests for <rdar://problem/5826236> Regular expressions with large nested repetition counts can have their compiled length calculated incorrectly. * fast/js/regexp-overflow-expected.txt: * fast/js/resources/regexp-overflow.js: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31388 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
- 26 Mar, 2008 8 commits
-
-
mrowe@apple.com authored
Rubber-stamped by Brady Eidson. * Configurations/JavaScriptCore.xcconfig: * Configurations/WebCore.xcconfig: * Configurations/WebKit.xcconfig: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31353 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
aroben@apple.com authored
<http://bugs.webkit.org/show_bug.cgi?id=18060> Reviewed by Geoff Garen. Bug fix: * API/JSCallbackObjectFunctions.h: (KJS::JSCallbackObject<Base>::toString): Make the DropAllLocks instance only be in scope while calling convertToType. Test: * API/testapi.c: (MyObject_convertToType): Implement type conversion to string. * API/testapi.js: Add a test for type conversion to string. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31350 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
aroben@apple.com authored
* kjs/array_instance.cpp: Touched this. * wtf/HashFunctions.h: (WTF::intHash): Added 8- and 16-bit versions of intHash. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31343 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
aroben@apple.com authored
JavaScriptCore: Force JSC headers to be copied by touching a file * kjs/array_instance.cpp: (KJS::ArrayInstance::getPropertyNames): WebCore: Turn on SVG animation on Windows Also touched some files to force things to rebuild/regenerate. * WebCore.vcproj/WebCore.vcproj: Added ENABLE_SVG_ANIMATION. * WebCore.vcproj/build-generated-files.sh: Ditto. * bindings/scripts/CodeGenerator.pm: Touched. * config.h: Touched. * svg/svgtags.in: Touched. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31337 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
aroben@apple.com authored
Written with Darin. Added HashTable plumbing to support using wchar_t as a key type. * wtf/HashFunctions.h: * wtf/HashTraits.h: (WTF::): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31335 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
mjs@apple.com authored
Reviewed by Darin. - JSC part of fix for "SVG multichar glyph matching matches longest instead of first (affects Acid3 test 79)" http://bugs.webkit.org/show_bug.cgi?id=18118 * wtf/HashFunctions.h: (WTF::): * wtf/HashTraits.h: (WTF::): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31325 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
ap@webkit.org authored
Cache C string identifiers by address, not value, assuming that C strings can only be literals. 1% speedup on Acid3 test 26. * kjs/identifier.cpp: (KJS::literalIdentifierTable): (KJS::Identifier::add): Added a new table to cache UString::Reps created from C strings by address. Elements are never removed from this cache, as only predefined identifiers can get there. * kjs/identifier.h: (KJS::Identifier::Identifier): Added a warning. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
ap@webkit.org authored
An assertion was failing in function-toString-object-literals.html when parsing 1e-500. The condition existed before, and got uncovered by turning compiled-out dtoa checks into ASSERTs. The assertion was verifying that the caller wasn't constructing a Bigint from 0. This might have had some reason behind it originally, but I couldn't find any, and this doesn't look like a reasonable requirement. * kjs/dtoa.cpp: (d2b): Removed the assertion (two copies in different code paths). git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31318 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
- 25 Mar, 2008 5 commits
-
-
aroben@apple.com authored
JavaScriptCore: Fix Bug 18077: Integrate testapi.c into the Windows build <http://bugs.webkit.org/show_bug.cgi?id=18077> Reviewed by Steve Falkenburg. * JavaScriptCore.vcproj/testapi/testapi.vcproj: Added. WebCore: Add an UnusedParam.h forwarding header for use by testapi Reviewed by Steve Falkenburg. * ForwardingHeaders/wtf/UnusedParam.h: Added. WebKit/win: Fix Bug 18077: Integrate testapi.c into the Windows build <http://bugs.webkit.org/show_bug.cgi?id=18077> Reviewed by Steve Falkenburg. * WebKit.vcproj/WebKit.sln: Added testapi.vcproj to the solution. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31297 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
aroben@apple.com authored
Currently you must compile testapi.c as C++ code since MSVC does not support many C features that GCC does. Reviewed by Steve Falkenburg. * API/testapi.c: (nan): Added an implementation of this for MSVC. (assertEqualsAsUTF8String): Use malloc instead of dynamically-sized stack arrays. (assertEqualsAsCharactersPtr): Ditto. (print_callAsFunction): Ditto. (main): Ditto, and explicitly cast from UniChar* to JSChar*. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31296 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
aroben@apple.com authored
We can't remove the os-win32 directory yet because other ports (at least wx) are still relying on it. Reviewed by Steve Falkenburg. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: - Made all the include paths match the one for the Debug configuration (these got out of sync in r30797) - Removed os-win32 from the include path - Removed os-win32 from the directories we copy to $WebKitOutputDir. - Removed stdint.h from the project * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make: Delete the files that we may have previously copied from the os-win32 directory. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31295 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
ap@webkit.org authored
* kjs/dtoa.cpp: Include stdint.h. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31289 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
ap@webkit.org authored
Cleanup dtoa.cpp style. * kjs/dtoa.cpp: (Bigint::Balloc): (Bigint::Bfree): (Bigint::multadd): (Bigint::s2b): (Bigint::hi0bits): (Bigint::lo0bits): (Bigint::i2b): (Bigint::mult): (Bigint::pow5mult): (Bigint::lshift): (Bigint::cmp): (Bigint::diff): (Bigint::ulp): (Bigint::b2d): (Bigint::d2b): (Bigint::ratio): (Bigint::): (Bigint::match): (Bigint::hexnan): (Bigint::kjs_strtod): (Bigint::quorem): (Bigint::rv_alloc): (Bigint::nrv_alloc): (Bigint::kjs_freedtoa): (Bigint::kjs_dtoa): * kjs/dtoa.h: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31288 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
- 24 Mar, 2008 2 commits
-
-
darin@apple.com authored
Reviewed by Sam. - convert a JavaScript immediate number to a string more efficiently 2% speedup of Acid3 test 26 * kjs/JSImmediate.cpp: (KJS::JSImmediate::toString): Take advantage of the fact that all immediate numbers are integers, and use the faster UString function for formatting integers instead of the slower one that works for floating point. I think this is a leftover from when immediate numbers were floating point. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31270 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
weinig@apple.com authored
2008-03-23 Sam Weinig <sam@webkit.org> Reviewed by Darin Adler. Fix http://bugs.webkit.org/show_bug.cgi?id=18048 The "thisObject" parameter to JSEvaluateScript is not used properly Making passing a thisObject to JSEvaluateScript actually set the thisObject of the created ExecState. * API/testapi.c: (main): Add tests for setting the thisObject when calling JSEvaluateScript. * kjs/ExecState.cpp: (KJS::ExecState::ExecState): Assign the thisObject to m_thisValue and remove the comment. WebCore: 2008-03-24 Sam Weinig <sam@webkit.org> Reviewed by Darin Adler. Fix http://bugs.webkit.org/show_bug.cgi?id=18048 The "thisObject" parameter to JSEvaluateScript is not used properly * bindings/js/kjs_proxy.cpp: (WebCore::KJSProxy::evaluate): No need to pass a thisObject since we want the global object to be used. * bridge/jni/jni_jsobject.mm: (JavaJSObject::eval): To avoid any change to this function, don't pass a thisObject to keep the same behavior. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31267 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
- 22 Mar, 2008 1 commit
-
-
eric@webkit.org authored
Make testkjs flush stdout after printing. * JavaScriptCore.xcodeproj/project.pbxproj: * kjs/testkjs.cpp: (functionPrint): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31229 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
- 21 Mar, 2008 5 commits
-
-
oliver@apple.com authored
Reviewed by Maciej Added a method to JSVariableObject to allow us to inject DontDelete properties into the symbol table and localStorage. This results in a 0.4% progression in SunSpider, with a 8% gain in math-partial-sums. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31226 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
oliver@apple.com authored
Reviewed by Geoff Garen The problem was caused by JSObject::getPropertyAttributes not being aware of the JSVariableObject SymbolTable. The fix is to make getPropertyAttributes virtual and override in JSVariableObject. This does not produce any performance regression. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31225 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
ddkilzer@apple.com authored
Webkit does not build on linux powerpc <http://bugs.webkit.org/show_bug.cgi?id=17019> Reviewed by David Kilzer. * wtf/TCSpinLock.h: (TCMalloc_SpinLock::Unlock): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31216 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
zecke@webkit.org authored
2008-03-21 Rodney Dawes <dobey@wayofthemonkey.com> Reviewed by Holger. http://bugs.webkit.org/show_bug.cgi?id=17981 Add javascriptcore_cppflags to Programs_minidom_CPPFLAGS. * GNUmakefile.am: WebCore/ChaneLog: 2008-03-21 Rodney Dawes <dobey@wayofthemonkey.com> Reviewed by Holger. http://bugs.webkit.org/show_bug.cgi?id=17981 Remove WebCore/ForwardingHeaders from cppflags as it is not needed, and causes build problems with GTK+. * GNUmakefile.am: WebKitTools/ChangeLog: 2008-03-21 Rodney Dawes <dobey@wayofthemonkey.com> Reviewed by Holger. http://bugs.webkit.org/show_bug.cgi?id=17981 Add webcore and javascriptcore cppflags to programs' _CPPFLAGS. * GNUmakefile.am: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31214 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
ap@webkit.org authored
Consolidate static identifier initializers within CommonIdentifiers. No reliably measurable change on SunSpider; maybe a tiny improvement (within 0.2%). * kjs/CommonIdentifiers.h: Added static identifiers that were lazily initialized throughout the code. * kjs/date_object.cpp: (KJS::DateObjectImp::DateObjectImp): * kjs/function_object.cpp: (KJS::FunctionPrototype::FunctionPrototype): * kjs/object_object.cpp: (KJS::ObjectPrototype::ObjectPrototype): * kjs/regexp_object.cpp: (KJS::RegExpPrototype::RegExpPrototype): Use the values from CommonIdentifiers. * kjs/lookup.h: Caching the identifier in a static wasn't a win on SunSpider, removed it. * kjs/value.h: (KJS::jsNaN): We already have a shared NaN value, no need for a duplicate here. * wtf/MathExtras.h: (wtf_atan2): Having local variables for numeric_limits constants is good for readability, but there is no reason to keep them static. * JavaScriptCore.exp: Don't needlessly export JSGlobalObject::s_head. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31208 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
- 20 Mar, 2008 6 commits
-
-
oliver@apple.com authored
Reviewed by Maciej To avoid any extra branches when managing an inline ScopeChainNode in the ScopeChain the inline node gets inserted with a refcount of 2. This meant than when the ScopeChain was destroyed the ScopeChainNodes above the inline node would be leaked. We resolve this by manually popping the inline node in the FunctionExecState destructor. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31205 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
mrowe@apple.com authored
Ensure that the defines in FEATURE_DEFINES are sorted so that they will match the default settings of build-webkit. This will prevent the world from being rebuilt if you happen to switch between building in Xcode and with build-webkit on the command-line. Reviewed by Sam Weinig. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31195 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
ddkilzer@apple.com authored
Reviewed by David Kilzer. Fix http://bugs.webkit.org/show_bug.cgi?id=17923 Bug 17923: ARM platform endian defines inaccurate * wtf/Platform.h: Replaced !defined(__ARMEL__) check with !defined(__VFP_FP__) for PLATFORM(MIDDLE_ENDIAN) git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31176 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
mjs@apple.com authored
- fix build * JavaScriptCore.xcodeproj/project.pbxproj: install Activation.h as private git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31174 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
mjs@apple.com authored
Reviewed by Oliver. - reduce function call overhead for 1.014x speedup on SunSpider I moved some functions from ExecState.cpp to ExecStateInline.h and from JSGlobalObject.cpp to JSGlobalObject.h, and declared them inline; machine function call overhead for these was hurting JS funcion call overhead. * kjs/ExecState.cpp: * kjs/ExecStateInlines.h: Added. (KJS::ExecState::ExecState): (KJS::ExecState::~ExecState): (KJS::FunctionExecState::FunctionExecState): (KJS::FunctionExecState::~FunctionExecState): * kjs/JSGlobalObject.cpp: * kjs/JSGlobalObject.h: (KJS::JSGlobalObject::pushActivation): (KJS::JSGlobalObject::checkActivationCount): (KJS::JSGlobalObject::popActivation): * kjs/function.cpp: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31173 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
oliver@apple.com authored
Reviewed by Maciej Maciej suggested using an inline ScopeChainNode for functions that don't use eval or closures as they are unable to ever capture the scope chain. This gives us a 2.4% win in sunspider, a 15% win in controlflow-recursive, and big (>5%) wins in a number of other tests. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31172 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
- 19 Mar, 2008 5 commits
-
-
mrowe@apple.com authored
Reviewed by Sam Weinig. Fix release build. * kjs/JSGlobalObject.cpp: Add missing #include. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31168 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
weinig@apple.com authored
2008-03-19 Sam Weinig <sam@webkit.org> Reviewed by Anders Carlsson. Fix for <rdar://problem/5785694> Crash occurs at KJS::Collector::collect() when loading web clip widgets with a PAC file Make the activeExecStates stack per JSGlobalObject instead of static to ensure thread safety. * JavaScriptCore.exp: * kjs/ExecState.cpp: (KJS::InterpreterExecState::InterpreterExecState): (KJS::InterpreterExecState::~InterpreterExecState): (KJS::EvalExecState::EvalExecState): (KJS::EvalExecState::~EvalExecState): (KJS::FunctionExecState::FunctionExecState): (KJS::FunctionExecState::~FunctionExecState): * kjs/ExecState.h: (KJS::): * kjs/JSGlobalObject.cpp: (KJS::JSGlobalObject::mark): * kjs/JSGlobalObject.h: (KJS::JSGlobalObject::activeExecStates): * kjs/collector.cpp: (KJS::Collector::collect): (KJS::Collector::reportOutOfMemoryToAllExecStates): Iterate all JSGlobalObjects and report the OutOfMemory condition to all the ExecStates in each. WebCore: 2008-03-19 Sam Weinig <sam@webkit.org> Reviewed by Anders Carlsson. Fix for <rdar://problem/5785694> Crash occurs at KJS::Collector::collect() when loading web clip widgets with a PAC file Make the activeExecStates stack per JSGlobalObject instead of static to ensure thread safety. * bindings/objc/WebScriptObject.mm: (+[WebScriptObject throwException:]): Change to throw an exception on the current GlobalObject instead of the top of the static activeExecStates stack. (-[WebScriptObject setException:]): Change to use the top of the rootObjects GlobalObject instead of the top of the static activeExecStates stack. * bridge/c/c_instance.cpp: * bridge/c/c_instance.h: * bridge/jni/jni_instance.cpp: (JavaInstance::virtualBegin): (JavaInstance::virtualEnd): * bridge/jni/jni_instance.h: * bridge/objc/objc_instance.h: * bridge/objc/objc_instance.mm: (ObjcInstance::~ObjcInstance): (ObjcInstance::virtualBegin): (ObjcInstance::virtualEnd): * bridge/runtime.cpp: (KJS::Bindings::Instance::setDidExecuteFunction): (KJS::Bindings::Instance::didExecuteFunction): (KJS::Bindings::Instance::setCurrentGlobalObject): Added. (KJS::Bindings::Instance::currentGlobalObject): Added. (KJS::Bindings::Instance::begin): (KJS::Bindings::Instance::end): * bridge/runtime.h: (KJS::Bindings::Instance::virtualBegin): Renamed from begin(). (KJS::Bindings::Instance::virtualEnd): Renamed from end(). We now store the currently active globalObject everytime we cross the runtime object boundary. To do this, we take advantage of the existing begin/end methods that are called when crossing this boundary, making begin set the current globalObject and then call the old begin, now called virtualBegin. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31167 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
mrowe@apple.com authored
Reviewed by Maciej Stachowiak. Fix http://bugs.webkit.org/show_bug.cgi?id=17941 Bug 17941: C++-style comments in JavaScriptCore API * API/JSBase.h: Remove C++-style comments from public JavaScriptCore API, replacing with standard C90 block comments. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31150 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
mrowe@apple.com authored
Reviewed by Oliver Hunt. Fix http://bugs.webkit.org/show_bug.cgi?id=17939 Bug 17939: Crash decompiling "const a = 1, b;" * kjs/nodes2string.cpp: (KJS::ConstDeclNode::streamTo): Null-check the correct variable. 2008-03-19 Mark Rowe <mrowe@apple.com> Reviewed by Oliver Hunt. Test for http://bugs.webkit.org/show_bug.cgi?id=17939 Bug 17939: Crash decompiling "const a = 1, b;" * fast/js/function-toString-parentheses-expected.txt: * fast/js/resources/function-toString-parentheses.js: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31149 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
oliver@apple.com authored
http://bugs.webkit.org/show_bug.cgi?id=17929 Reviewed by Mark Rowe There were actually two bugs here. First we weren't correctly handling const nodes with multiple declarations. The second issue was caused by us not giving the correct precedence to the initialisers. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31148 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
- 18 Mar, 2008 5 commits
-
-
darin@apple.com authored
2008-03-18 Darin Adler <darin@apple.com> Reviewed by Maciej. - Speed up JavaScript built-in properties by changing the hash table to take advantage of the identifier objects 5% speedup for Acid3 test 26 * JavaScriptCore.exp: Updated. * kjs/create_hash_table: Compute size of hash table large enough so that there are no collisions, but don't generate the hash table. * kjs/identifier.h: Made the add function that returns a PassRefPtr public. * kjs/lexer.cpp: (KJS::Lexer::lex): Updated for change to HashTable interface. * kjs/lookup.cpp: (KJS::HashTable::changeKeysToIdentifiers): Added. Finds the identifier for each property so the equality comparision can be done with pointer comparision. * kjs/lookup.h: Made the key be a union of char* with UString::Rep* so it can hold identifiers. Added a keysAreIdentifiers flag to the HashTable. Changed the Lookup functions to be member functions of HashTable instead. * kjs/object.cpp: (KJS::JSObject::deleteProperty): Update for change to HashTable. (KJS::JSObject::findPropertyHashEntry): Ditto. (KJS::JSObject::getPropertyAttributes): Ditto. (KJS::JSObject::getPropertyNames): Ditto. WebCore: 2008-03-18 Darin Adler <darin@apple.com> Reviewed by Maciej. - Speed up JavaScript built-in properties by changing the hash table to take advantage of the identifier objects 5% speedup for Acid3 test 26 * bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::getOwnPropertySlot): Update for change to HashTable. (WebCore::JSDOMWindowBase::put): Ditto. * bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::customGetOwnPropertySlot): Ditto. * bindings/js/JSHTMLInputElementBase.cpp: (WebCore::JSHTMLInputElementBase::getOwnPropertySlot): Ditto. * bindings/js/JSHistoryCustom.cpp: (WebCore::JSHistory::customGetOwnPropertySlot): Ditto. * bindings/js/JSLocation.cpp: (WebCore::JSLocation::customGetOwnPropertySlot): Ditto. (WebCore::JSLocation::put): Ditto. * bindings/js/kjs_binding.cpp: (WebCore::nonCachingStaticFunctionGetter): Ditto. * bindings/scripts/CodeGeneratorJS.pm: Same changes as in the create_hash_table script. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31147 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
http://bugs.webkit.org/show_bug.cgi?id=17925http://bugs.webkit.org/show_bug.cgi?id=17927mrowe@apple.com authored
- Bug 17925: Crash in KJS::JSObject::put after setting this.__proto__ - Bug 17927: Hang after attempting to create circular __proto__ * kjs/object.cpp: (KJS::JSObject::put): Silently ignore attempts to set __proto__ to a non-object, non-null value. Return after setting the exception when an attempt to set a cyclic __proto__ is detected so that the cyclic value is not set. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31145 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
mjs@apple.com authored
Reviewed by Oliver. - inline ActivationImp::init for 0.8% SunSpider speedup * kjs/Activation.h: (KJS::ActivationImp::init): Moved here from function.cpp * kjs/function.cpp: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31136 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
hausmann@webkit.org authored
Including config.h like in the other .cpp files gets the #ifdeffery correct for rand_s. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31124 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
darin@apple.com authored
2008-03-17 Darin Adler <darin@apple.com> Reviewed by Maciej. JavaScriptCore changes to support a WebCore speedup. * JavaScriptCore.exp: Export the UString::Rep::computeHash function. * wtf/HashSet.h: Added a find and contains function that take a translator, like the add function. WebCore: 2008-03-17 Darin Adler <darin@apple.com> Reviewed by Maciej. - speed up document property fetching (eliminate the AtomicString objects made during document property lookup) 3% speedup for Acid3 test 26 * bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::getOwnPropertySlot): Use AtomicString::find to locate the AtomicString, only if already present. Also call the new faster versions of the hasNamedItem and hasElementWithId functions that don't ref/deref the AtomicStringImpl, get inlined, etc. * bindings/js/JSHTMLDocumentCustom.cpp: (WebCore::JSHTMLDocument::canGetItemsForName): Ditto. (WebCore::writeHelper): Use a Vector instead of a String to build up the string to avoid the bad performance of string append. * dom/Document.cpp: Tweaked code and comments a bit. Nothing substantive. * dom/Document.h: Added new hasElementWithId function that's faster than getElementById because it doesn't ref/deref the AtomicStringImpl*, gets inlined, doesn't have to handle the 0 case, and doesn't try to return the element pointer (just a boolean). * html/HTMLAppletElement.cpp: (WebCore::HTMLAppletElement::parseMappedAttribute): Use AtomicString consistently. Also renamed the data member for clarity. (WebCore::HTMLAppletElement::insertedIntoDocument): Ditto. (WebCore::HTMLAppletElement::removedFromDocument): Ditto. * html/HTMLAppletElement.h: Ditto. * html/HTMLDocument.cpp: (WebCore::addItemToMap): Use AtomicString instead of String. (WebCore::removeItemFromMap): Ditto. (WebCore::HTMLDocument::addNamedItem): Updated for member name change. (WebCore::HTMLDocument::removeNamedItem): Ditto. (WebCore::HTMLDocument::addExtraNamedItem): Ditto. (WebCore::HTMLDocument::removeExtraNamedItem): Ditto. (WebCore::HTMLDocument::clear): Added. Moved code here from the JavaScript bindings. If we're going to have an empty placeholder function, there's no reason to have it in the bindings instead of here. * html/HTMLDocument.h: Added clear. Changed the named item function arguments to AtomicString insted of String. Changed the NameCountMap to use AtomicStringImpl* instead of StringImpl*. Renamed the data members to add a m_ prefix and remove the needless doc prefix. Added hasNamedItem and hasExtraNamedItem functions that are inlined and faster than the old idiom because they doesn't ref/deref the AtomicStringImpl*, get inlined, and don't have to handle the 0 case. * html/HTMLDocument.idl: Removed the [Custom] attribute on clear and took it out of the JavaScript-specific section. * html/HTMLEmbedElement.cpp: (WebCore::HTMLEmbedElement::parseMappedAttribute): Use AtomicString consistently. Also renamed the data member for clarity. (WebCore::HTMLEmbedElement::insertedIntoDocument): Ditto. (WebCore::HTMLEmbedElement::removedFromDocument): Ditto. * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::insertedIntoDocument): Ditto. (WebCore::HTMLFormElement::removedFromDocument): Ditto. (WebCore::HTMLFormElement::parseMappedAttribute): Ditto. * html/HTMLFormElement.h: Ditto. * html/HTMLFrameElementBase.cpp: (WebCore::HTMLFrameElementBase::openURL): Renamed m_name to m_frameName for clarity, since the frame name is not the same as the name attribute. (WebCore::HTMLFrameElementBase::parseMappedAttribute): Ditto. (WebCore::HTMLFrameElementBase::setNameAndOpenURL): Ditto. * html/HTMLFrameElementBase.h: Ditto. * html/HTMLIFrameElement.cpp: (WebCore::HTMLIFrameElement::parseMappedAttribute): Use AtomicString consistently. Also renamed the data member for clarity. (WebCore::HTMLIFrameElement::insertedIntoDocument): Ditto. (WebCore::HTMLIFrameElement::removedFromDocument): Ditto. * html/HTMLIFrameElement.h: Ditto. * html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::parseMappedAttribute): Ditto. (WebCore::HTMLImageElement::insertedIntoDocument): Ditto. (WebCore::HTMLImageElement::removedFromDocument): Ditto. * html/HTMLImageElement.h: Ditto. * html/HTMLObjectElement.cpp: (WebCore::HTMLObjectElement::parseMappedAttribute): Ditto. (WebCore::HTMLObjectElement::insertedIntoDocument): Ditto. (WebCore::HTMLObjectElement::removedFromDocument): Ditto. (WebCore::HTMLObjectElement::updateDocNamedItem): Ditto. * html/HTMLObjectElement.h: Ditto. * html/HTMLParamElement.cpp: (WebCore::HTMLParamElement::isURLAttribute): Use equalIgnoringCase instead of callling lower(). * html/HTMLPlugInElement.h: Changed the type of m_name. The code that uses this is in HTMLAppletElement, HTMLEmbedElement, and HTMLObjectElement. * platform/text/AtomicString.cpp: (WebCore::equal): Moved to an inline so we can share this code between a few different functions. It could move to a header too if we want to use it elsewhere. (WebCore::UCharBufferTranslator::equal): Change to use inline. (WebCore::HashAndCharactersTranslator::hash): Added. (WebCore::HashAndCharactersTranslator::equal): Added. (WebCore::HashAndCharactersTranslator::translate): Added. (WebCore::AtomicString::add): Improved the Identifier and UString overloads to use the already-computed hash code instead of rehashing the string. (WebCore::AtomicString::find): Added. * platform/text/AtomicString.h: Added a find function so we can avoid allocating memory just to look up a string in an atomic string set or map. * platform/text/StringImpl.h: Added declarations needed for the AtomicString changes. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31122 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-