1 2008-08-06 Tor Arne Vestbø <tavestbo@trolltech.com>
7 2008-08-06 Ariya Hidayat <ariya.hidayat@trolltech.com>
11 * wtf/RetainPtr.h: CoreFoundation only for PLATFORM(MAC)
13 2008-08-06 Ariya Hidayat <ariya.hidayat@trolltech.com>
17 * wtf/RetainPtr.h: CoreFoundation only for PLATFORM(MAC)
19 2008-08-06 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
21 Reviewed by Darin. Landed by Cameron.
23 Bug 20272: typo in JavaScriptCore
24 <https://bugs.webkit.org/show_bug.cgi?id=20272>
26 Correct the documentation for op_not. (typo)
30 (KJS::Machine::privateExecute):
32 2008-08-06 Cameron Zwarich <cwzwarich@webkit.org>
36 Bug 20286: Load constants all at once instead of using op_load
37 <https://bugs.webkit.org/show_bug.cgi?id=20286>
39 Load constants all at once into temporary registers instead of using
40 individual instances of op_load.
42 This is a 2.6% speedup on SunSpider.
46 (KJS::CodeBlock::dump):
47 (KJS::CodeBlock::mark):
49 * VM/CodeGenerator.cpp:
50 (KJS::CodeGenerator::CodeGenerator):
51 (KJS::CodeGenerator::newTemporary):
52 (KJS::CodeGenerator::addConstant):
53 (KJS::CodeGenerator::addUnexpectedConstant):
54 (KJS::CodeGenerator::emitLoad):
55 (KJS::CodeGenerator::emitUnexpectedLoad):
56 (KJS::CodeGenerator::emitNewError):
59 (KJS::slideRegisterWindowForCall):
60 (KJS::Machine::unwindCallFrame):
61 (KJS::Machine::throwException):
62 (KJS::Machine::execute):
63 (KJS::Machine::privateExecute):
67 (KJS::RegisterID::RegisterID):
68 (KJS::RegisterID::makeConstant):
69 (KJS::RegisterID::isTemporary):
72 (KJS::Parser::didFinishParsing):
77 (KJS::NullNode::emitCode):
78 (KJS::BooleanNode::emitCode):
79 (KJS::NumberNode::emitCode):
80 (KJS::StringNode::emitCode):
81 (KJS::ArrayNode::emitCode):
82 (KJS::DeleteResolveNode::emitCode):
83 (KJS::DeleteValueNode::emitCode):
84 (KJS::VoidNode::emitCode):
85 (KJS::ConstDeclNode::emitCodeSingle):
86 (KJS::ReturnNode::emitCode):
87 (KJS::ScopeNode::ScopeNode):
88 (KJS::ProgramNode::ProgramNode):
89 (KJS::ProgramNode::create):
90 (KJS::EvalNode::EvalNode):
91 (KJS::EvalNode::create):
92 (KJS::FunctionBodyNode::FunctionBodyNode):
93 (KJS::FunctionBodyNode::create):
94 (KJS::FunctionBodyNode::emitCode):
96 (KJS::ScopeNode::neededConstants):
98 2008-08-05 Maciej Stachowiak <mjs@apple.com>
102 - add fast path for immediates to % operator, as we have for many other math ops
104 This fixes handling for a 0 divisor relative to the last patch. Only an 0.2% speedup on SunSpider but
105 still a 1.4x win on Oliver's prime test.
108 (KJS::Machine::privateExecute):
110 2008-08-05 Cameron Zwarich <cwzwarich@uwaterloo.ca>
114 Bug 20293: Crash in JavaScript codegen for eval("const a;")
115 <https://bugs.webkit.org/show_bug.cgi?id=20293>
117 Correctly handle constant declarations in eval code with no initializer.
120 (KJS::ConstDeclNode::emitCodeSingle):
122 2008-08-05 Cameron Zwarich <cwzwarich@uwaterloo.ca>
126 Roll out r35555 because of correctness issues.
129 (KJS::Machine::privateExecute):
131 2008-08-05 Maciej Stachowiak <mjs@apple.com>
135 - add fast path for immediates to % operator, as we have for many other math ops
137 0.6% speedup on SunSpider. 1.4x speedup on a prime testing torture test that Oliver whipped up.
140 (KJS::Machine::privateExecute):
142 2008-07-31 Oliver Hunt <oliver@apple.com>
144 Reviewed by Cameron Zwarich.
146 Bug 19359: JavaScriptCore behaves differently from FF2/3 and IE when handling context in catch statement
147 <https://bugs.webkit.org/show_bug.cgi?id=19359>
149 Make our catch behave like Firefox and IE, we do this by using a StaticScopeObject
150 instead of a generic JSObject for the scope node. We still don't make use of the
151 fact that we have a static scope inside the catch block, so the internal performance
152 of the catch block is not improved, even though technically it would be possible to
156 (KJS::CodeBlock::dump):
157 * VM/CodeGenerator.cpp:
158 (KJS::CodeGenerator::emitPushNewScope):
159 * VM/CodeGenerator.h:
161 (KJS::createExceptionScope):
162 (KJS::Machine::privateExecute):
165 * kjs/JSStaticScopeObject.cpp:
166 (KJS::JSStaticScopeObject::toThisObject):
167 (KJS::JSStaticScopeObject::put):
168 * kjs/JSStaticScopeObject.h:
170 (KJS::TryNode::emitCode):
172 2008-08-02 Rob Gowin <robg@gowin.net>
174 Reviewed by Eric Seidel.
176 Added JavaScriptCore/API/WebKitAvailability to list of files in
177 javascriptcore_h_api.
181 2008-08-01 Alexey Proskuryakov <ap@webkit.org>
183 Rubber-stamped by Maciej.
185 Remove JSGlobalData::DataInstance. It was only needed when we had per-thread JSGlobalData
188 * kjs/JSGlobalData.h:
190 2008-07-31 Kevin Ollivier <kevino@theolliviers.com>
192 Second attempt at Windows/wx build fix. Instead of avoiding inclusion of windows.h,
193 use defines, etc. to avoid conflicts in each affected file. Also, change PLATFORM(WIN)
194 to PLATFORM(WIN_OS) so that other ports using Windows headers get the right impls.
196 * VM/SamplingTool.cpp:
199 2008-07-31 Anders Carlsson <andersca@apple.com>
206 * wtf/FastMalloc.cpp:
208 2008-07-31 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
212 Bug 20170: [Qt] missing namespace defines in JavaScriptCore.pro
213 <https://bugs.webkit.org/show_bug.cgi?id=20170>
215 * JavaScriptCore.pro: Added missing define.
217 2008-07-31 Alexey Proskuryakov <ap@webkit.org>
219 Rubber-stamped by Maciej.
221 Eliminate JSLock (it was already disabled, removing the stub implementaion and all
226 (JSCheckScriptSyntax):
228 * API/JSCallbackConstructor.cpp:
229 (KJS::constructJSCallback):
230 * API/JSCallbackFunction.cpp:
231 (KJS::JSCallbackFunction::call):
232 * API/JSCallbackObjectFunctions.h:
234 (KJS::::getOwnPropertySlot):
236 (KJS::::deleteProperty):
238 (KJS::::hasInstance):
240 (KJS::::getPropertyNames):
243 (KJS::::staticValueGetter):
244 (KJS::::callbackGetter):
245 * API/JSContextRef.cpp:
246 (JSGlobalContextCreateInGroup):
247 (JSGlobalContextRetain):
248 (JSGlobalContextRelease):
249 * API/JSObjectRef.cpp:
251 (JSObjectMakeFunctionWithCallback):
252 (JSObjectMakeConstructor):
253 (JSObjectMakeFunction):
254 (JSObjectHasProperty):
255 (JSObjectGetProperty):
256 (JSObjectSetProperty):
257 (JSObjectGetPropertyAtIndex):
258 (JSObjectSetPropertyAtIndex):
259 (JSObjectDeleteProperty):
260 (JSObjectCallAsFunction):
261 (JSObjectCallAsConstructor):
262 (JSObjectCopyPropertyNames):
263 (JSPropertyNameArrayRelease):
264 (JSPropertyNameAccumulatorAddName):
265 * API/JSStringRef.cpp:
267 * API/JSValueRef.cpp:
269 (JSValueIsInstanceOfConstructor):
273 (JSValueToStringCopy):
277 * ForwardingHeaders/JavaScriptCore/JSLock.h: Removed.
279 * JavaScriptCore.exp:
280 * JavaScriptCore.order:
281 * JavaScriptCore.pri:
282 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
283 * JavaScriptCore.xcodeproj/project.pbxproj:
284 * JavaScriptCoreSources.bkl:
285 * kjs/AllInOneFile.cpp:
286 * kjs/JSGlobalData.cpp:
287 (KJS::JSGlobalData::JSGlobalData):
288 * kjs/JSGlobalData.h:
289 * kjs/JSGlobalObject.cpp:
290 (KJS::JSGlobalObject::~JSGlobalObject):
291 (KJS::JSGlobalObject::init):
292 * kjs/JSLock.cpp: Removed.
293 * kjs/JSLock.h: Removed.
299 (KJS::Heap::heapAllocate):
300 (KJS::Heap::setGCProtectNeedsLocking):
301 (KJS::Heap::protect):
302 (KJS::Heap::unprotect):
303 (KJS::Heap::collect):
304 * kjs/identifier.cpp:
305 * kjs/interpreter.cpp:
306 (KJS::Interpreter::checkSyntax):
307 (KJS::Interpreter::evaluate):
309 2008-07-31 Alexey Proskuryakov <ap@webkit.org>
311 Rubber-stamped by Oliver Hunt.
313 Fix the Mac project to not display "test/" as part of file name for tests.
315 * JavaScriptCore.xcodeproj/project.pbxproj:
317 2008-07-31 Eric Seidel <eric@webkit.org>
319 Reviewed by Alexey Proskuryakov.
321 Rename USE(MULTIPLE_THREADS) to ENABLE(JSC_MULTIPLE_THREADS)
322 to better match the use/enable pattern (and better describe
323 the usage of the feature in question.)
325 I also fixed a couple other ENABLE_ macros to be pre-processor
326 definition override-able to match the rest of the ENABLE_ macros
327 since it seems to be our convention that build systems can set
328 ENABLE_ macros in Makefiles.
330 * kjs/InitializeThreading.cpp:
331 (KJS::initializeThreadingOnce):
332 * kjs/JSGlobalData.cpp:
333 (KJS::JSGlobalData::JSGlobalData):
334 (KJS::JSGlobalData::~JSGlobalData):
335 * kjs/MathObject.cpp:
339 (KJS::allocateBlock):
340 (KJS::Heap::markStackObjectsConservatively):
347 * wtf/FastMalloc.cpp:
349 * wtf/RefCountedLeakCounter.cpp:
351 2008-07-30 Eric Seidel <eric@webkit.org>
353 Reviewed by Mark Rowe.
355 Try to clean up our usage of USE(MULTIPLE_THREADS) vs. USE(PTHREADS) a little.
356 It looks like JSC assumes that if MULTIPLE_THREADS is defined, then pthreads will always be available
357 I'm not sure that's always the case for gtk, certainly not for Windows. We should eventually go back
358 and fix wtf/Threading.h to cover all these cases some day.
364 2008-07-30 Eric Seidel <eric@webkit.org>
368 MSVC warns when structs are called classes or vice versa.
369 Make all the source refer to JSGlobalData as a class.
371 * kjs/CommonIdentifiers.h:
372 * kjs/JSGlobalData.h:
376 2008-07-30 Alexey Proskuryakov <ap@webkit.org>
378 Reviewed by Geoff Garen.
380 Add consistency checks to UString to document and enforce its design.
383 (KJS::UString::Rep::create):
384 (KJS::UString::Rep::destroy):
385 (KJS::UString::Rep::checkConsistency):
386 (KJS::UString::expandCapacity):
387 (KJS::UString::expandPreCapacity):
388 (KJS::UString::UString):
389 (KJS::UString::spliceSubstringsWithSeparators):
390 (KJS::UString::append):
392 (KJS::UString::Rep::checkConsistency):
394 2008-07-30 Gavin Barraclough <barraclough@apple.com>
396 Reviewed by Geoff Garen.
398 Fixes for Windows and non-AllInOne file build with SamplingTool, plus review fixes.
400 * GNUmakefile.am: Adding SamplingTool.cpp to build.
401 * JavaScriptCore.exp: Export hooks to init & control SamplingTool.
402 * JavaScriptCore.pri: Adding SamplingTool.cpp to build.
403 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Adding SamplingTool.cpp to build.
404 * JavaScriptCore.xcodeproj/project.pbxproj: Adding SamplingTool.cpp to build.
405 * JavaScriptCoreSources.bkl: Adding SamplingTool.cpp to build.
406 * VM/Machine.cpp: MACHINE_SAMPLING_callingNativeFunction renamed MACHINE_SAMPLING_callingHostFunction
408 * VM/Opcode.cpp: SamplingTool moved to SamplingTool.cpp/.h, opcodeNames generated from FOR_EACH_OPCODE_ID.
410 * VM/SamplingTool.cpp: Added .cpp/.h for SamplingTool.
412 * kjs/Shell.cpp: Switched SAMPLING_TOOL_ENABLED to ENABLE_SAMPLING_TOOL.
413 * wtf/Platform.h: Added ENABLE_SAMPLING_TOOL config option.
414 * kjs/nodes.cpp: Header include to fix non-AllInOne builds.
416 2008-07-30 Ariya Hidayat <ariya.hidayat@trolltech.com>
418 Reviewed by Alexey Proskuryakov.
420 Fix compilation without multi-threading support.
425 2008-07-30 Anders Carlsson <andersca@apple.com>
427 Add WebKitAvailability.h forwarding header.
429 * ForwardingHeaders/JavaScriptCore/WebKitAvailability.h: Added.
431 2008-07-30 Anders Carlsson <andersca@apple.com>
435 * API/WebKitAvailability.h:
437 2008-07-30 Anders Carlsson <andersca@apple.com>
439 * API/WebKitAvailability.h:
440 Fix Windows (and other non-Mac builds).
442 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
443 Add WebKitAvailability.h to the project.
445 2008-07-30 Anders Carlsson <andersca@apple.com>
447 One step closer towards fixing the Windows build.
449 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
450 Make sure to copy WebKitAvailability.h
452 2008-07-29 Gavin Barraclough <barraclough@apple.com>
454 Reviewed by Geoff Garen.
456 Bug 20209: Atomize constant strings
457 <https://bugs.webkit.org/show_bug.cgi?id=20209>
459 Prevents significant performance degradation seen when a script contains multiple
460 identical strings that are used as keys to identify properties on objects.
462 No performance change on SunSpider.
464 * kjs/nodes.cpp: Atomize constant strings.
466 2008-07-30 Oliver Hunt <oliver@apple.com>
468 Reviewed by Alexey Proskuryakov.
470 <rdar://problem/6111648> JavaScript exceptions fail if the scope chain includes the global object
472 In an attempt to remove the branch I just added to KJS::depth I
473 used the existence of a Variable Object at a point in the scope
474 chain as an indicator of function or global scope activation.
475 However this assumption results in incorrect behaviour if the
476 global object is injected into the scope chain with 'with'.
481 2008-07-30 Alexey Proskuryakov <ap@webkit.org>
483 Reviewed by Geoff Garen.
485 Don't call JSGarbageCollect() on a released context.
487 * API/testapi.c: (main):
489 2008-07-29 Alexey Proskuryakov <ap@webkit.org>
491 Reviewed by Geoff Garen.
493 Implement JSContextGroup APIs to make concurrent execution possible for
494 JavaScriptCore clients.
496 This changes the behavior of JSGlobalContextCreate(), so that it now uses a private context
497 group for each context, making JSlock implicit locking unnecessary.
499 * API/JSContextRef.h:
500 * API/JSContextRef.cpp:
501 (JSContextGroupCreate):
502 (JSContextGroupRetain):
503 (JSContextGroupRelease):
504 (JSGlobalContextCreate):
505 (JSGlobalContextCreateInGroup):
506 (JSGlobalContextRelease):
508 Added new methods. JSGlobalContextCreate() calls JSGlobalContextCreateInGroup() now.
510 * API/APICast.h: (toJS): (toRef): Added converters for JSContextGroupRef.
511 * API/JSBase.cpp: (JSGarbageCollect): JSGarbageCollect(0) is now a no-op, and the passed in
512 context is actually used.
514 * API/JSBase.h: Aded a typedef for JSContextGroupRef. Updated documentation for
517 * JavaScriptCore.exp: Removed JSGlobalData::sharedInstance().
519 * kjs/JSGlobalData.cpp:
520 * kjs/JSGlobalData.h:
521 Removed support for JSGlobalData shared instance. JSGlobalData::isSharedInstance member
522 variable still remains, to be deleted in a followup patch.
524 * kjs/JSLock.cpp: (KJS::JSLock::JSLock): Disabled JSLock, to be deleted in a follow-up patch.
527 (KJS::Heap::markOtherThreadConservatively): Removed an assertion that referenced
528 JSGlobalData::sharedInstance.
530 * kjs/collector.h: Made Heap destructor public, so that JSContextRelease can use it.
532 2008-07-29 Alexey Proskuryakov <ap@webkit.org>
534 Reviewed by Geoff Garen.
536 Fix a leak of ThreadRegistrar objects.
538 As the heap is usually deleted when registered threads still exist, ThreadSpecific doesn't
539 have a chance to clean up per-thread object. Switched to native pthread calls, storing a
540 plain pointer that doesn't require cleanup.
543 (KJS::PlatformThread::PlatformThread):
544 (KJS::Heap::Thread::Thread):
547 (KJS::Heap::registerThread):
548 (KJS::Heap::unregisterThread):
551 2008-07-29 Alexey Proskuryakov <ap@webkit.org>
553 Reviewed by Sam Weinig.
555 https://bugs.webkit.org/show_bug.cgi?id=20169
556 Memory allocated with fastMalloc is freed with delete
558 * VM/JSPropertyNameIterator.cpp:
559 (KJS::JSPropertyNameIterator::invalidate): Free the array properly.
560 (KJS::JSPropertyNameIterator::~JSPropertyNameIterator): Delete the array by calling
563 2008-07-29 Mark Rowe <mrowe@apple.com>
565 Attempt to fix the Qt build.
567 * wtf/ThreadingQt.cpp: Add the extra argument to createThread.
569 2008-07-29 Adam Roben <aroben@apple.com>
571 Change Vector::find to return an index instead of an iterator
573 Indices are more natural than iterators when working with Vector.
575 Reviewed by John Sullivan.
578 (WTF::Vector::find): Changed to iterate the Vector manually and return
579 the index of the found item, rather than an iterator. When the item
580 could not be found, we return WTF::notFound.
582 2008-07-29 Adam Roben <aroben@apple.com>
586 * wtf/ThreadingWin.cpp:
587 (WTF::setThreadName): Move a misplaced assertion to here...
588 (WTF::createThread): ...from here.
590 2008-07-29 Adam Roben <aroben@apple.com>
592 Add support for setting thread names on Windows
594 These thread names make it much easier to identify particular threads
595 in Visual Studio's Threads panel.
597 WTF::createThread now takes a const char* representing the thread's
598 name. On Windows, we throw a special exception to set this string as
599 the thread's name. Other platforms do nothing with this name for now.
601 Reviewed by Anders Carlsson.
603 * JavaScriptCore.exp: Export the new version of createThread that
604 takes 3 arguments (the old one continues to be exported for backward
606 * wtf/Threading.h: Add a threadName argument to createThread.
608 * wtf/ThreadingGtk.cpp:
610 * wtf/ThreadingNone.cpp:
612 Updated for function signature change.
614 * wtf/ThreadingPthreads.cpp:
615 (WTF::createThread): Updated for function signature change. We keep
616 around the old 2-argument version of createThread for backward
619 * wtf/ThreadingWin.cpp:
620 (WTF::setThreadName): Added. This function's implementation came from
622 (WTF::initializeThreading): Set the name of the main thread.
623 (WTF::createThread): Call setThreadName. We keep around the old
624 2-argument version of createThread for backward compatibility.
626 2008-07-29 Alexey Proskuryakov <ap@webkit.org>
628 Reviewed by Oliver Hunt.
630 Store UString::Rep::isStatic bit in identifierTable pointer instead of reportedCost for
631 slightly nicer code and a 0.5% SunSpider improvement.
633 * API/JSClassRef.cpp:
634 (OpaqueJSClass::~OpaqueJSClass):
635 (OpaqueJSClassContextData::OpaqueJSClassContextData):
636 * API/JSStringRef.cpp:
638 * kjs/PropertyNameArray.cpp:
639 (KJS::PropertyNameArray::add):
640 * kjs/identifier.cpp:
641 (KJS::IdentifierTable::~IdentifierTable):
642 (KJS::IdentifierTable::add):
643 (KJS::Identifier::addSlowCase):
644 (KJS::Identifier::remove):
646 (KJS::Identifier::add):
649 (KJS::UString::Rep::create):
650 (KJS::UString::Rep::destroy):
652 (KJS::UString::Rep::identifierTable):
653 (KJS::UString::Rep::setIdentifierTable):
654 (KJS::UString::Rep::isStatic):
655 (KJS::UString::Rep::setStatic):
656 (KJS::UString::cost):
658 2008-07-28 Geoffrey Garen <ggaren@apple.com>
660 Reviewed by Sam Weinig.
662 Renamed "ConstructTypeNative" => "ConstructTypeHost".
664 2008-07-26 Mark Rowe <mrowe@apple.com>
666 Speculative fix for the wx build.
668 * JavaScriptCoreSources.bkl: Add JSStaticScopeObject.cpp to the list of source files.
670 2008-07-25 Oliver Hunt <oliver@apple.com>
674 Whoops, forgot to save style correction.
676 * kjs/JSStaticScopeObject.h:
678 2008-07-25 Oliver Hunt <oliver@apple.com>
680 Reviewed by Cameron Zwarich.
682 Bug 19718: Named anonymous functions are slow accessing global variables
683 <https://bugs.webkit.org/show_bug.cgi?id=19718>
685 To fix this we switch over to an activation-like scope object for
686 on which we attach the function name property, and add logic to
687 prevent cross scope assignment to read only properties.
690 * JavaScriptCore.pri:
691 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
692 * JavaScriptCore.xcodeproj/project.pbxproj:
693 * VM/CodeGenerator.cpp:
694 (KJS::CodeGenerator::findScopedProperty):
695 (KJS::CodeGenerator::emitResolve):
696 * VM/CodeGenerator.h:
697 * kjs/AllInOneFile.cpp:
698 * kjs/JSStaticScopeObject.cpp: Added.
699 (KJS::JSStaticScopeObject::putWithAttributes):
700 (KJS::JSStaticScopeObject::isDynamicScope):
701 (KJS::JSStaticScopeObject::~JSStaticScopeObject):
702 (KJS::JSStaticScopeObject::getOwnPropertySlot):
703 * kjs/JSStaticScopeObject.h: Added.
704 (KJS::JSStaticScopeObject::JSStaticScopeObjectData::JSStaticScopeObjectData):
705 (KJS::JSStaticScopeObject::JSStaticScopeObject):
707 (KJS::FunctionCallResolveNode::emitCode):
708 (KJS::PostfixResolveNode::emitCode):
709 (KJS::PrefixResolveNode::emitCode):
710 (KJS::ReadModifyResolveNode::emitCode):
711 (KJS::AssignResolveNode::emitCode):
712 (KJS::FuncExprNode::makeFunction):
714 2008-07-25 kevino <kevino@theolliviers.com>
716 wx build fix for Win.
718 On wx/Win, including windows.h in Threading.h causes multiply-defined symbol errors
719 for libjpeg and wx, and also wx needs to include windows.h itself first for wx
720 includes to work right. So until we can find a better solution to this problem,
721 on wx, we work around the need to include windows.h here.
725 2008-07-25 Adam Roben <aroben@apple.com>
729 * JavaScriptCore.vcproj/testapi/testapi.vcproj: Add API/ to the
732 2008-07-25 Simon Hausmann <hausmann@webkit.org>
734 Fix the build of jsc on Qt/Windows, make sure os-win32 is in the
735 include search path (added by WebKit.pri).
739 2008-07-25 Alexey Proskuryakov <ap@webkit.org>
741 Reviewed by Simon Hausmann.
743 Move JavaScriptCore API tests into a subdirectory of their own to avoid header name
744 conflicts and developer confusion.
746 * API/JSNode.c: Removed.
747 * API/JSNode.h: Removed.
748 * API/JSNodeList.c: Removed.
749 * API/JSNodeList.h: Removed.
750 * API/Node.c: Removed.
751 * API/Node.h: Removed.
752 * API/NodeList.c: Removed.
753 * API/NodeList.h: Removed.
754 * API/minidom.c: Removed.
755 * API/minidom.html: Removed.
756 * API/minidom.js: Removed.
757 * API/testapi.c: Removed.
758 * API/testapi.js: Removed.
760 * API/tests/JSNode.c: Copied from JavaScriptCore/API/JSNode.c.
761 * API/tests/JSNode.h: Copied from JavaScriptCore/API/JSNode.h.
762 * API/tests/JSNodeList.c: Copied from JavaScriptCore/API/JSNodeList.c.
763 * API/tests/JSNodeList.h: Copied from JavaScriptCore/API/JSNodeList.h.
764 * API/tests/Node.c: Copied from JavaScriptCore/API/Node.c.
765 * API/tests/Node.h: Copied from JavaScriptCore/API/Node.h.
766 * API/tests/NodeList.c: Copied from JavaScriptCore/API/NodeList.c.
767 * API/tests/NodeList.h: Copied from JavaScriptCore/API/NodeList.h.
768 * API/tests/minidom.c: Copied from JavaScriptCore/API/minidom.c.
769 * API/tests/minidom.html: Copied from JavaScriptCore/API/minidom.html.
770 * API/tests/minidom.js: Copied from JavaScriptCore/API/minidom.js.
771 * API/tests/testapi.c: Copied from JavaScriptCore/API/testapi.c.
772 * API/tests/testapi.js: Copied from JavaScriptCore/API/testapi.js.
774 * JavaScriptCore.vcproj/testapi/testapi.vcproj:
775 * JavaScriptCore.xcodeproj/project.pbxproj:
777 2008-07-25 Simon Hausmann <hausmann@webkit.org>
779 Prospective WX build fix, add JavaScriptCore/API to the include search
784 2008-07-25 Simon Hausmann <hausmann@webkit.org>
786 Rubber-stamped by Lars.
788 Fix the build on Windows. operator new for ArgList is implemented using fastMalloc()
789 but operator delete was not implemented. Unfortunately MSVC decides to call/reference
790 the function, so a simple implementation using fastFree() fixes the build.
793 (KJS::ArgList::operator delete):
795 2008-07-25 Simon Hausmann <hausmann@webkit.org>
797 Discussed with and rubber-stamped by Lars.
799 Fix the build system for the Qt port.
801 Recent JavaScriptCore changes require the addition of JavaScriptCore/API to the
802 include search path. With a build process that combines JavaScriptCore and
803 WebCore in one build process/Makefile the existance of
804 JavaScriptCore/API/Node.h and WebCore/dom/Node.h causes include conflicts.
806 This commit solves this by introducing a separate build of JavaScriptCore into
809 As a result of the split-up a race-condition due to broken dependencies of
810 regular source files to header files of generated sources showed up very
811 frequently when doing parallel builds (which the buildbot does). This commit at
812 the same time tries to address the dependency problem by making the
813 addExtraCompiler() function also generate a pseudo extra compiler that
814 represents the header file output, so that qmake is aware of the creation of
815 the header file for dependency calculation.
817 At the same time I removed a lot of cruft from the pro files to ease maintenance.
819 * JavaScriptCore.pri:
820 * JavaScriptCore.pro: Added.
823 2008-07-24 Geoffrey Garen <ggaren@apple.com>
825 Reviewed by Maciej Stachowiak.
827 Fixed a strict aliasing violation, which caused hash tables with floating
828 point keys not to find items that were indeed in the tables
829 (intermittently, and only in release builds, of course).
831 SunSpider reports no change.
833 This bug doesn't seem to affect any existing code, but it causes obvious
834 crashes in some new code I'm working on.
836 * wtf/HashFunctions.h:
837 (WTF::FloatHash::hash): Use a union when punning between a float / double
838 and an unsigned (bucket of bits). With strict aliasing enabled, unions
839 are the only safe way to do this kind of type punning.
841 * wtf/HashTable.h: When rehashing, ASSERT that the item we just added to
842 the table is indeed in the table. In the buggy case described above, this
845 2008-07-24 Oliver Hunt <oliver@apple.com>
847 Reviewed by Alexey Proskuryakov.
849 Bug 20142: REGRESSION(r35245): /=/ weirdness
850 <https://bugs.webkit.org/show_bug.cgi?id=20142>
852 When adding all the meta data needed for exception error messages
853 I accidentally clobbered the handling of regex beginning with /=.
857 2008-07-23 Alp Toker <alp@nuanti.com>
859 Build fix after r35293: Add API/ to the include path.
863 2008-07-23 Adam Roben <aroben@apple.com>
867 Build fix after r35293:
869 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add API/
872 Build fix after r35305:
878 Completely compile out all sampler-related code when
879 SAMPLING_TOOL_ENABLED is 0. The sampler code can't be compiled 1) on
880 non-AllInOne configurations due to circular header dependencies, and
881 2) on platforms that don't have a usleep() function, such as Windows.
883 2008-07-23 Oliver Hunt <oliver@apple.com>
885 Reviewed by Geoff Garen and Sam Weinig.
887 Improve switch performance.
889 Improve switch performance by converting to a hashmap based jump
890 table to avoid the sequence of dispatches that would otherwise be
891 needed. This results in a 9-19x performance win for string switches
892 based on ad hoc testing, and a 6x improvement for integer switch
893 statements. SunSpider reports a 1.2% progression.
896 (KJS::CodeBlock::dump):
897 (KJS::SimpleJumpTable::offsetForValue):
899 * VM/CodeGenerator.cpp:
900 (KJS::CodeGenerator::beginSwitch):
901 (KJS::prepareJumpTableForImmediateSwitch):
902 (KJS::prepareJumpTableForCharacterSwitch):
903 (KJS::prepareJumpTableForStringSwitch):
904 (KJS::CodeGenerator::endSwitch):
905 * VM/CodeGenerator.h:
907 (KJS::offsetForStringSwitch):
908 (KJS::Machine::privateExecute):
915 (KJS::processClauseList):
916 (KJS::CaseBlockNode::tryOptimisedSwitch):
917 (KJS::CaseBlockNode::emitCodeForBlock):
921 2008-07-23 Gavin Barraclough <barraclough@apple.com>
923 Reviewed by Geoff Garen.
925 Sampling tool to analyze cost of instruction execution and identify hot regions of JS code.
926 Enable Switches by setting SAMPLING_TOOL_ENABLED in Opcode.h.
928 * JavaScriptCore.exp: Export symbols for Shell.cpp.
929 * VM/Machine.cpp: Added sampling hooks.
930 * VM/Machine.h: Machine contains a pointer to a sampler, when sampling.
931 * VM/Opcode.cpp: Tool implementation.
932 * VM/Opcode.h: Tool declaration.
933 * kjs/Shell.cpp: Initialize the sampler, if enabled.
934 * kjs/nodes.cpp: Added sampling hooks.
936 2008-07-23 Gabor Loki <loki@inf.u-szeged.hu>
938 Bug 20097: [Qt] 20% Sunspider slow-down
940 <https://bugs.webkit.org/show_bug.cgi?id=20097>
942 Reviewed by Simon Hausmann.
944 * kjs/jsc.pro: Added missing NDEBUG define for release builds.
946 2008-07-23 Alexey Proskuryakov <ap@webkit.org>
948 Reviewed by Geoff Garen.
950 JSClassRef is created context-free, but gets infatuated with the first context it sees.
952 The implicit API contract is that JSClassRef can be used with any context on any thread.
953 This no longer worked, because UStrings in the class were turned into per-context
954 identifiers, and the cached JSObject prototype was tied to JSGlobalData, too.
956 * API/JSClassRef.h: Made a separate struct for context-dependent parts of OpaqueJSClass.
957 * API/JSClassRef.cpp:
958 (OpaqueJSClass::OpaqueJSClass): Updated for renames and changed member variable order.
959 (OpaqueJSClass::~OpaqueJSClass): Assert that string members are not identifiers.
960 (clearReferenceToPrototype): Update for the new reference location.
961 (OpaqueJSClassContextData::OpaqueJSClassContextData): Make a deep copy of all strings.
962 (OpaqueJSClass::contextData): Added a function that finds the per-context part of
963 OpaqueJSClass in JSGlobalData, or creates it if not found.
964 (OpaqueJSClass::className): Always make a deep copy. Callers of this function do not have
965 a way to access JSGlobalData, so a per-context copy could not be made.
966 (OpaqueJSClass::staticValues): Updated for new data location.
967 (OpaqueJSClass::staticFunctions): Ditto.
968 (OpaqueJSClass::prototype): Changed to take an internal type for consistency.
970 * kjs/JSGlobalData.cpp:
971 (KJS::JSGlobalData::JSGlobalData):
972 (KJS::JSGlobalData::~JSGlobalData):
973 * kjs/JSGlobalData.h:
974 Keep a HashMap to access per-context JSClass data given a pointr to the shared part.
976 * API/JSCallbackObjectFunctions.h:
978 (KJS::::getOwnPropertySlot):
980 (KJS::::deleteProperty):
981 (KJS::::getPropertyNames):
982 (KJS::::staticValueGetter):
983 (KJS::::staticFunctionGetter):j
984 Use function accessors instead of accessing OpaqueJSClass members directly.
986 * API/JSContextRef.cpp: (JSGlobalContextCreate): Updated for the change in
987 OpaqueJSClass::prototype() argument type.
989 * API/JSObjectRef.cpp:
990 (JSObjectMake): Updated for the change in OpaqueJSClass::prototype() argument type.
991 (JSObjectMakeConstructor): Ditto.
993 2008-07-23 Alexey Proskuryakov <ap@webkit.org>
997 * kjs/ArgList.h: (KJS::ArgList::operator new): removed an extraneous "ArgList::" inside the
1000 2008-07-22 Geoffrey Garen <ggaren@apple.com>
1002 Reviewed by Oliver Hunt and Sam Weinig.
1004 Next step toward putting doubles in registers: Prepare the Register class
1005 and its clients for registers that don't contain JSValue*s.
1007 This means a few things:
1009 1. Register::jsValue() clients, including ArgList clients, must now supply
1010 an ExecState* when accessing an entry in an ArgList, in case the entry
1011 will need to create a JSValue* on the fly.
1013 2. Register clients that definitely don't want to create a JSValue* on
1014 the fly now use different APIs: getJSValue() for clients that know
1015 the register contains a JSValue*, and v() for clients who just want a
1018 3. I had to change some headers around in order to resolve dependency
1019 problems created by using a Register in the ArgList header.
1021 SunSpider reports no change.
1023 2008-07-22 Gavin Barraclough <barraclough@apple.com>
1025 Reviewed by Alexey Proskuryakov.
1027 Prevent integer overflow when reallocating storage vector for arrays.
1029 Sunspider reports 1.005x as fast (no change expected).
1033 2008-07-21 Mark Rowe <mrowe@apple.com>
1035 Reviewed by Sam Weinig.
1037 <rdar://problem/6091287> Revamp the handling of CFBundleShortVersionString to be fixed at the major component of the version number.
1039 * Configurations/Version.xcconfig:
1042 2008-07-21 Adam Roben <aroben@apple.com>
1046 This is a convenience wrapper around std::find.
1048 Reviewed by Anders Carlsson.
1052 2008-07-19 Oliver Hunt <oliver@apple.com>
1054 Reviewed by Cameron Zwarich.
1056 Bug 20104: Exception in tables/mozilla_expected_failures/bugs/bug92868_1.html includes the equals operator in the quoted expression
1057 <https://bugs.webkit.org/show_bug.cgi?id=20104>
1059 To make this correct we make the dot and bracket assign nodes emit the information to indicate
1060 the failure range is the dot/bracket accessor.
1064 2008-07-18 Steve Falkenburg <sfalken@apple.com>
1068 * kjs/JSGlobalObjectFunctions.cpp:
1069 (KJS::isStrWhiteSpace):
1071 2008-07-18 Steve Falkenburg <sfalken@apple.com>
1076 (KJS::ThrowableExpressionData::ThrowableExpressionData):
1078 2008-07-18 Oliver Hunt <oliver@apple.com>
1080 Reviewed by Cameron Zwarich.
1082 Bug 18774: SQUIRRELFISH: print meaningful error messages <https://bugs.webkit.org/show_bug.cgi?id=18774>
1083 <rdar://problem/5769353> SQUIRRELFISH: JavaScript error messages are missing informative text
1085 Add support for decent error messages in JavaScript. This patch achieves this by providing
1086 ensuring the common errors and exceptions have messages that provide the text of expression
1087 that trigger the exception. In addition it attaches a number of properties to the exception
1088 object detailing where in the source the expression came from.
1090 * JavaScriptCore.exp:
1092 (KJS::CodeBlock::lineNumberForVPC):
1093 (KJS::CodeBlock::expressionRangeForVPC):
1094 Function to recover the expression range for an instruction
1095 that triggered an exception.
1097 (KJS::ExpressionRangeInfo::):
1098 (KJS::CodeBlock::CodeBlock):
1099 * VM/CodeGenerator.cpp:
1100 (KJS::CodeGenerator::emitCall):
1101 (KJS::CodeGenerator::emitCallEval):
1102 Emit call needed to be modified so to place the expression range info internally,
1103 as the CodeGenerator emits the arguments nodes itself, rather than the various call
1105 * VM/CodeGenerator.h:
1106 (KJS::CodeGenerator::emitExpressionInfo):
1107 Record the expression range info.
1108 * VM/ExceptionHelpers.cpp:
1109 (KJS::createErrorMessage):
1110 (KJS::createInvalidParamError):
1111 (KJS::createUndefinedVariableError):
1112 (KJS::createNotAConstructorError):
1113 (KJS::createNotAFunctionError):
1114 (KJS::createNotAnObjectErrorStub):
1115 (KJS::createNotAnObjectError):
1116 Rewrite all the code for the error messages so that they make use of the newly available
1118 * VM/ExceptionHelpers.h:
1120 (KJS::isNotObject): Now needs vPC and codeBlock
1121 (KJS::Machine::throwException):
1122 New logic to handle the NotAnObjectErrorStub and to handle the absurd "no default value" edge case
1123 (KJS::Machine::privateExecute):
1125 * kjs/DebuggerCallFrame.cpp:
1126 (KJS::DebuggerCallFrame::evaluate):
1128 (KJS::Error::create):
1130 * kjs/JSGlobalObjectFunctions.cpp:
1131 * kjs/JSImmediate.cpp:
1132 (KJS::JSImmediate::toObject):
1133 (KJS::JSImmediate::prototype):
1134 My changes to the JSNotAnObject constructor needed to be handled here.
1135 * kjs/JSNotAnObject.h:
1136 (KJS::JSNotAnObjectErrorStub::JSNotAnObjectErrorStub):
1137 (KJS::JSNotAnObjectErrorStub::isNull):
1138 (KJS::JSNotAnObjectErrorStub::isNotAnObjectErrorStub):
1139 Added a JSNotAnObjectErrorStub class to ease the handling of toObject failure exceptions,
1140 and potentially allow even more detailed error messages in future.
1143 (KJS::Parser::parse):
1144 * kjs/SourceRange.h:
1146 Large amounts of position propagation.
1148 (KJS::Lexer::Lexer):
1149 (KJS::Lexer::shift):
1151 The lexer needed a few changes to be able to correctly track token character positions.
1154 (KJS::ThrowableExpressionData::emitThrowError):
1155 (KJS::StatementNode::StatementNode):
1156 (KJS::ResolveNode::emitCode):
1157 (KJS::BracketAccessorNode::emitCode):
1158 (KJS::DotAccessorNode::emitCode):
1159 (KJS::NewExprNode::emitCode):
1160 (KJS::EvalFunctionCallNode::emitCode):
1161 (KJS::FunctionCallValueNode::emitCode):
1162 (KJS::FunctionCallResolveNode::emitCode):
1163 (KJS::FunctionCallBracketNode::emitCode):
1164 (KJS::FunctionCallDotNode::emitCode):
1165 (KJS::PostfixResolveNode::emitCode):
1166 (KJS::PostfixBracketNode::emitCode):
1167 (KJS::PostfixDotNode::emitCode):
1168 (KJS::DeleteResolveNode::emitCode):
1169 (KJS::DeleteBracketNode::emitCode):
1170 (KJS::DeleteDotNode::emitCode):
1171 (KJS::PrefixResolveNode::emitCode):
1172 (KJS::PrefixBracketNode::emitCode):
1173 (KJS::PrefixDotNode::emitCode):
1174 (KJS::ThrowableBinaryOpNode::emitCode):
1175 (KJS::ReadModifyResolveNode::emitCode):
1176 (KJS::AssignResolveNode::emitCode):
1177 (KJS::AssignDotNode::emitCode):
1178 (KJS::ReadModifyDotNode::emitCode):
1179 (KJS::AssignBracketNode::emitCode):
1180 (KJS::ReadModifyBracketNode::emitCode):
1181 (KJS::ForInNode::ForInNode):
1182 (KJS::ForInNode::emitCode):
1183 (KJS::WithNode::emitCode):
1184 (KJS::LabelNode::emitCode):
1185 (KJS::ThrowNode::emitCode):
1186 (KJS::ProgramNode::ProgramNode):
1187 (KJS::ProgramNode::create):
1188 (KJS::EvalNode::generateCode):
1189 (KJS::FunctionBodyNode::create):
1190 (KJS::FunctionBodyNode::generateCode):
1191 (KJS::ProgramNode::generateCode):
1192 All of these methods were handling the position information.
1193 Constructors and create methods were modified to store the information.
1194 All the emitCall implementations listed needed to be updated to actually
1195 record the position information we have so carefully collected.
1197 (KJS::ThrowableExpressionData::ThrowableExpressionData):
1198 (KJS::ThrowableExpressionData::setExceptionSourceRange):
1199 (KJS::ThrowableExpressionData::divot):
1200 (KJS::ThrowableExpressionData::startOffset):
1201 (KJS::ThrowableExpressionData::endOffset):
1202 (KJS::ThrowableSubExpressionData::ThrowableSubExpressionData):
1203 (KJS::ThrowableSubExpressionData::setSubexpressionInfo):
1204 (KJS::ThrowablePrefixedSubExpressionData::ThrowablePrefixedSubExpressionData):
1205 (KJS::ThrowablePrefixedSubExpressionData::setSubexpressionInfo):
1206 ThrowableExpressionData is just a uniform mechanism for storing the position
1208 (KJS::ResolveNode::):
1209 (KJS::PrePostResolveNode::):
1210 (KJS::ThrowableBinaryOpNode::):
1213 2008-07-18 Geoffrey Garen <ggaren@apple.com>
1215 Reviewed by Cameron Zwarich.
1219 "CallTypeNative" => "CallTypeHost"
1220 "code" => "byteCode"
1221 "generatedCode" => "generatedByteCode"
1223 2008-07-18 Geoffrey Garen <ggaren@apple.com>
1225 Reviewed by Oliver Hunt.
1227 Optimized <= for immediate number cases.
1229 SunSpider reports no overall change, but a 10% speedup on access-nsieve.
1231 2008-07-18 Mark Rowe <mrowe@apple.com>
1233 Rubber-stamped by Sam Weinig.
1235 Fix some casts added in a previous build fix to match the style used
1239 (KJS::Machine::initializeCallFrame):
1241 (KJS::Register::Register):
1243 2008-07-18 Landry Breuil <landry@openbsd.org>
1245 Bug 19975: [OpenBSD] Patches to enable build of WebKit
1247 <https://bugs.webkit.org/show_bug.cgi?id=19975>
1249 Reviewed by David Kilzer.
1251 Support for OpenBSD, mostly threading and libm tweaks.
1253 * kjs/collector.cpp: #include <pthread.h>
1254 (KJS::currentThreadStackBase): use pthread_stackseg_np() to get stack base
1255 * kjs/config.h: OpenBSD also provides <pthread_np.h>
1256 * wtf/MathExtras.h: #include <sys/types.h> and <machine/ieee.h>
1257 (isfinite), (signbit): as long as we don't have those functions provide fallback implementations
1258 * wtf/Platform.h: Add support for PLATFORM(OPENBSD) and PLATFORM(SPARC64) macro
1260 2008-07-17 Geoffrey Garen <ggaren@apple.com>
1262 Reviewed by Oliver Hunt.
1264 Next step toward putting doubles in registers: Store constant pool
1265 entries as registers, not JSValue*s.
1267 SunSpider reports no change.
1269 2008-07-17 Geoffrey Garen <ggaren@apple.com>
1271 Reviewed by John Sullivan and Oliver Hunt.
1273 A tiny bit of tidying in function call register allocation.
1275 This patch saves one register when invoking a function expression and/or
1276 a new expression that is stored in a temporary.
1278 Since it's just one register, I can't make a testcase for it.
1280 * VM/CodeGenerator.cpp:
1281 (KJS::CodeGenerator::emitCall): No need to ref the function we're calling
1282 or its base. We'd like the call frame to overlap with them, if possible.
1283 op_call will read the function and its base before writing the call frame,
1287 (KJS::NewExprNode::emitCode): No need to ref the function we're new-ing,
1288 for the same reasons stated above.
1290 (KJS::FunctionCallValueNode::emitCode): ditto
1292 2008-07-17 Steve Falkenburg <sfalken@apple.com>
1296 * kjs/InternalFunction.cpp:
1298 2008-07-17 Sam Weinig <sam@webkit.org>
1300 Roll out r35199 as it is causing failures on the PPC build.
1302 2008-07-17 Geoffrey Garen <ggaren@apple.com>
1304 Reviewed by David Kilzer.
1306 Fixed https://bugs.webkit.org/show_bug.cgi?id=20067
1307 Support function.name (Firefox extension)
1309 Pretty straight-forward.
1311 2008-07-17 Geoffrey Garen <ggaren@apple.com>
1313 Reviewed by Oliver Hunt.
1315 Fixed <rdar://problem/6081636> Functions calls use more temporary
1316 registers than necessary
1318 Holding a reference to the last statement result register caused each
1319 successive statement to output its result to an even higher register.
1321 Happily, statements don't actually need to return a result register
1322 at all. I hope to make this clearer in a future cleanup patch,
1323 but this change will fix the major bug for now.
1326 (KJS::statementListEmitCode):
1328 2008-07-17 Gavin Barraclough <barraclough@apple.com>
1330 Reviewed by Sam Weinig.
1332 Merge pre&post dot nodes to simplify the parse tree.
1333 Sunspider results show 0.6% progression (no performance change expected).
1338 * kjs/nodes2string.cpp:
1340 2008-07-17 Gavin Barraclough <barraclough@apple.com>
1342 Reviewed by Cameron Zwarich.
1344 Merge pre&post resolve nodes to simplify the parse tree.
1345 Sunspider results show no performance change.
1350 * kjs/nodes2string.cpp:
1352 2008-07-17 Gavin Barraclough <barraclough@apple.com>
1354 Reviewed by Cameron Zwarich.
1356 Merge logical nodes to simplify the parse tree.
1357 Sunspider results show 0.6% progression (no performance change expected).
1362 * kjs/nodes2string.cpp:
1364 2008-07-17 Ariya Hidayat <ariya.hidayat@trolltech.com>
1368 Fix MinGW build (broken in r35198) and simplify getLocalTime().
1371 (KJS::getLocalTime):
1373 2008-07-17 Gavin Barraclough <barraclough@apple.com>
1375 Reviewed by Sam Weinig.
1377 Merge pre&post bracket nodes to simplify the parse tree.
1378 Sunspider results show no performance change.
1383 * kjs/nodes2string.cpp:
1385 2008-07-17 Ariya Hidayat <ariya.hidayat@trolltech.com>
1389 Fix the 32-bit gcc builds, conversion from "long int" to Register is
1390 ambiguous. Explicitly choose the intptr_t constructor.
1393 (KJS::Machine::initializeCallFrame):
1395 (KJS::Register::Register):
1397 2008-07-16 Mark Rowe <mrowe@apple.com>
1399 Rubber-stamped by Geoff Garen.
1401 Fix JavaScript in 64-bit by using a pointer-sized integer
1402 type in the Register union. Also includes a rename of
1403 the intType constant to IntType.
1406 (KJS::Machine::initializeCallFrame):
1409 (KJS::Register::Register):
1411 2008-07-17 Geoffrey Garen <ggaren@apple.com>
1413 Reviewed by Oliver Hunt.
1415 First step toward putting doubles in registers: Turned Register into a
1416 proper abstraction layer. It is no longer possible to cast a Register
1417 to a JSValue*, or a Register& to a JSValue*&, or to access the union
1418 inside a Register directly.
1420 SunSpider reports no change.
1422 In support of this change, I had to make the following mechanical changes
1425 1. Clients now use explicit accessors to read data out of Registers, and
1426 implicit copy constructors to write data into registers.
1428 So, assignment that used to look like
1436 And access that used to look like
1444 2. I made generic flow control specific in opcodes that made their flow
1445 control generic by treating a Register& as a JSValue*&. This had the
1446 added benefit of removing some exception checking branches from immediate
1449 3. I beefed up PropertySlot to support storing a Register* in a property
1450 slot. For now, only JSVariableObject's symbolTableGet and symbolTablePut
1451 use this functionality, but I expect more clients to use it in the future.
1453 4. I changed ArgList to be a buffer of Registers, not JSValue*'s, and I
1454 changed ArgList iterator clients to iterate Registers, not JSValue*'s.
1456 2008-07-16 Ada Chan <adachan@apple.com>
1460 * kjs/JSGlobalObject.cpp:
1462 2008-07-16 Kevin McCullough <kmccullough@apple.com>
1464 Reviewed by Sam and Geoff.
1466 <rdar://problem/5958840> Navigating to another page while profiler is
1467 attached results in slow JavaScript for all time.
1469 - The UNLIKELY keeps this from being a sunspider performance regression.
1471 * kjs/JSGlobalObject.cpp:
1472 (KJS::JSGlobalObject::~JSGlobalObject): Stop the profiler associated
1473 with this exec state.
1475 2008-07-16 Sam Weinig <sam@webkit.org>
1477 Reviewed by Steve Falkenburg.
1479 Replace adopting UString constructor in favor of explicit
1480 static adopt method.
1482 * API/JSStringRefCF.cpp:
1483 (JSStringCreateWithCFString):
1484 * kjs/StringConstructor.cpp:
1485 (KJS::stringFromCharCode):
1486 * kjs/StringPrototype.cpp:
1487 (KJS::stringProtoFuncToLowerCase):
1488 (KJS::stringProtoFuncToUpperCase):
1489 (KJS::stringProtoFuncToLocaleLowerCase):
1490 (KJS::stringProtoFuncToLocaleUpperCase):
1492 (KJS::UString::adopt):
1494 (KJS::UString::UString):
1495 (KJS::UString::~UString):
1497 2008-07-16 Ariya Hidayat <ariya.hidayat@trolltech.com>
1501 http://trolltech.com/developer/task-tracker/index_html?method=entry&id=216179
1502 Fix potential crash (on Qt for Windows port) when performing JavaScript date
1506 (KJS::getLocalTime): For the Qt port, prefer to use Windows code, i.e.
1507 localtime_s() instead of localtime() since the latter might crash (on Windows)
1508 given a non-sensible, e.g. NaN, argument.
1510 2008-07-16 Alexey Proskuryakov <ap@webkit.org>
1512 Reviewed by Anders and Geoff.
1514 https://bugs.webkit.org/show_bug.cgi?id=20023
1515 Failed assertion in PropertyNameArray.cpp
1517 This is already tested by testapi.
1519 * API/JSObjectRef.cpp: (JSPropertyNameAccumulatorAddName): Add the string to identifier
1520 table to appease PropertyNameArray.
1522 2008-07-16 Alexey Proskuryakov <ap@webkit.org>
1526 Dereference identifiers when deleting a hash table (fixes leaks with private JSGlobalData
1529 * kjs/JSGlobalData.cpp: (KJS::JSGlobalData::~JSGlobalData):
1530 * kjs/lookup.cpp: (KJS::HashTable::deleteTable):
1532 * kjs/lexer.cpp: (KJS::Lexer::~Lexer)
1533 HashTable cannot have a destructor, because check-for-global-initializers complains about
1534 having a global constructor then.
1536 2008-07-16 Alexey Proskuryakov <ap@webkit.org>
1540 Check pthread_key_create return value.
1542 This check was helpful when debugging a crash in run-webkit-tests --threaded that happened
1543 because JSGlobalData objects were not deleted, and we were running out of pthread keys soon.
1544 It also looks useful for production builds.
1546 * wtf/ThreadSpecific.h: (WTF::::ThreadSpecific):
1548 2008-07-15 Kevin McCullough <kmccullough@apple.com>
1552 Rename pageGroupIdentifier to profileGroup to keep mention of a
1553 pageGroup out of JavaScriptCore.
1555 * kjs/JSGlobalObject.cpp:
1556 (KJS::JSGlobalObject::init):
1557 * kjs/JSGlobalObject.h:
1558 (KJS::JSGlobalObject::setProfileGroup):
1559 (KJS::JSGlobalObject::profileGroup):
1560 * profiler/ProfileGenerator.cpp:
1561 (KJS::ProfileGenerator::create):
1562 (KJS::ProfileGenerator::ProfileGenerator):
1563 * profiler/ProfileGenerator.h:
1564 (KJS::ProfileGenerator::profileGroup):
1565 * profiler/Profiler.cpp:
1566 (KJS::Profiler::startProfiling):
1567 (KJS::dispatchFunctionToProfiles):
1568 (KJS::Profiler::willExecute):
1569 (KJS::Profiler::didExecute):
1571 2008-07-14 Mark Rowe <mrowe@apple.com>
1573 Reviewed by Sam Weinig.
1575 Fix https://bugs.webkit.org/show_bug.cgi?id=20037
1576 Bug 20037: GCC 4.2 build broken due to strict aliasing violation.
1579 (KJS::UString::Rep::computeHash): Add a version of computeHash that takes a char* and explicit length.
1581 * profiler/CallIdentifier.h:
1582 (WTF::): Use new version of computeHash that takes a char* and explicit length to avoid unsafe aliasing.
1584 2008-07-14 David Hyatt <hyatt@apple.com>
1586 Fix a crashing bug in ListHashSet's -- operator. Make sure that end() can be -- by special-casing the null
1591 * wtf/ListHashSet.h:
1592 (WTF::ListHashSetConstIterator::operator--):
1594 2008-07-14 David Hyatt <hyatt@apple.com>
1596 Buidl fix. Make sure the second insertBefore method returns a value.
1598 * wtf/ListHashSet.h:
1599 (WTF::::insertBefore):
1601 2008-07-14 Adam Roben <aroben@apple.com>
1605 * JavaScriptCore.vcproj/jsc/jsc.vcproj: Added include/pthreads to the
1608 2008-07-14 Alexey Proskuryakov <ap@webkit.org>
1610 Reviewed by Kevin McCullough.
1612 Make JSGlobalData refcounted in preparation to adding a way to create contexts that share
1615 * JavaScriptCore.exp:
1616 * kjs/JSGlobalData.cpp:
1617 (KJS::JSGlobalData::create):
1618 * kjs/JSGlobalData.h:
1619 Made contructor private, and added a static create() method. Made the class inherit from
1622 * kjs/JSGlobalObject.h:
1623 (KJS::JSGlobalObject::globalData):
1624 JSGlobalData is now owned by JSGlobalObject (except for the shared one, and the common
1625 WebCore one, which are never deleted).
1627 * kjs/Shell.cpp: (main): Create JSGlobalData with create() method.
1629 2008-07-14 Simon Hausmann <hausmann@webkit.org>
1631 Fix the single-threaded build.
1633 * kjs/JSLock.cpp: Removed undeclared registerThread() function.
1634 * kjs/collector.cpp:
1635 (KJS::Heap::registerThread): Added dummy implementation.
1637 2008-07-14 Alexey Proskuryakov <ap@webkit.org>
1639 Reviewed by Geoff Garen.
1641 Eliminate per-thread JavaScript global data instance support and make arbitrary
1642 global data/global object combinations possible.
1644 * kjs/collector.cpp:
1645 (KJS::Heap::Heap): Store a JSGlobalData pointer instead of multiple pointers to its members.
1646 This allows for going from any JS object to its associated global data, currently used in
1647 JSGlobalObject constructor to initialize its JSGlobalData pointer.
1648 (KJS::Heap::registerThread): Changed thread registration data to be per-heap. Previously,
1649 only the shared heap could be used from multiple threads, so it was the only one that needed
1650 thread registration, but now this can happen to any heap.
1651 (KJS::Heap::unregisterThread): Ditto.
1652 (KJS::Heap::markStackObjectsConservatively): Adapt for the above changes.
1653 (KJS::Heap::setGCProtectNeedsLocking): Ditto.
1654 (KJS::Heap::protect): Ditto.
1655 (KJS::Heap::unprotect): Ditto.
1656 (KJS::Heap::collect): Ditto.
1657 (KJS::Heap::globalObjectCount): Use global object list associated with the current heap,
1658 not the late per-thread one.
1659 (KJS::Heap::protectedGlobalObjectCount): Ditto.
1662 (KJS::Heap::ThreadRegistrar): Added a helper object that unregisters a thread when it is
1666 (KJS::JSLock::JSLock):
1668 (KJS::JSLock::JSLock):
1669 Don't use JSLock to implicitly register threads. I've added registerThread() calls to most
1670 places that use JSLock - we cannot guarantee absolute safety unless we always mark all
1671 threads in the process, but these implicit registration calls should cover reasonable usage
1675 (JSEvaluateScript): Explicitly register the current thread.
1676 (JSCheckScriptSyntax): Explicitly register the current thread.
1677 (JSGarbageCollect): Changed to use the passed in context. Unfortunately, this creates a race
1678 condition for clients that pass an already released context to JSGarbageCollect - but it is
1679 unlikely to create real life problems.
1680 To maintain compatibility, the shared heap is collected if NULL is passed.
1682 * API/JSContextRef.cpp:
1683 (JSGlobalContextCreate): Use a new syntax for JSGlobalObject allocation.
1684 (JSGlobalContextRetain): Register the thread.
1685 (JSContextGetGlobalObject): Register the thread.
1687 * API/JSObjectRef.cpp:
1689 (JSObjectMakeFunctionWithCallback):
1690 (JSObjectMakeConstructor):
1691 (JSObjectMakeFunction):
1692 (JSObjectHasProperty):
1693 (JSObjectGetProperty):
1694 (JSObjectSetProperty):
1695 (JSObjectGetPropertyAtIndex):
1696 (JSObjectSetPropertyAtIndex):
1697 (JSObjectDeleteProperty):
1698 (JSObjectCallAsFunction):
1699 (JSObjectCallAsConstructor):
1700 (JSObjectCopyPropertyNames):
1701 (JSPropertyNameAccumulatorAddName):
1702 * API/JSValueRef.cpp:
1704 (JSValueIsInstanceOfConstructor):
1705 (JSValueMakeNumber):
1706 (JSValueMakeString):
1708 (JSValueToStringCopy):
1712 Register the thread.
1714 * API/JSStringRef.cpp: (JSStringRelease): Changed a comment to not mention per-thread contexts.
1716 * API/JSStringRefCF.cpp: Removed an unnecessary include of JSLock.h.
1718 * JavaScriptCore.exp: Export JSGlobalData constructor/destructor, now that anyone can have
1719 their own instances. Adapt to other changes, too.
1721 * JavaScriptCore.xcodeproj/project.pbxproj: Made ThreadSpecific.h private, as it is now
1722 included by collector.h and is thus needed in other projects.
1724 * kjs/InitializeThreading.cpp: (KJS::initializeThreadingOnce): Don't initialize per-thread
1725 global data, as it no longer exists.
1727 * kjs/JSGlobalData.cpp:
1728 (KJS::JSGlobalData::JSGlobalData):
1729 (KJS::JSGlobalData::~JSGlobalData):
1730 * kjs/JSGlobalData.h:
1731 Removed support for per-thread instance. Made constructor and destructor public.
1733 * kjs/JSGlobalObject.cpp: (KJS::JSGlobalObject::init): Get to now arbitrary JSGlobalData
1735 (KJS::JSGlobalObject::operator new): Changed ot take JSGlobalDatra pointer.
1736 * kjs/JSGlobalObject.h:
1741 Changed to maintain a custom JSGlobalData pointer instead of a per-thread one.
1743 2008-07-13 Ada Chan <adachan@apple.com>
1745 Windows build fix: Add wtf/RefCountedLeakCounter to the project.
1747 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
1749 2008-07-12 Jan Michael Alonzo <jmalonzo@webkit.org>
1751 Gtk, Qt and Wx build fix: Add wtf/RefCountedLeakCounter in the
1755 * JavaScriptCore.pri:
1756 * JavaScriptCoreSources.bkl:
1758 2008-07-11 Stephanie Lewis <slewis@apple.com>
1760 Reviewed by Darin Adler and Oliver Hunt.
1762 Refactor RefCounting Leak counting code into a common class.
1764 In order to export the symbols I needed to put the debug defines inside the function names
1766 Before we had a separate channel for each Logging each Leak type. Since the leak channels were only used in one location, and only at quit for simplicity I combined them all into one leak channel.
1768 * JavaScriptCore.exp:
1769 * JavaScriptCore.xcodeproj/project.pbxproj: add new class
1770 * kjs/nodes.cpp: remove old leak counting code
1771 * wtf/RefCountedLeakCounter.cpp: Added. create a common leak counting class
1772 * wtf/RefCountedLeakCounter.h: Added.
1774 2008-07-11 David Hyatt <hyatt@apple.com>
1776 Add an insertBefore method to ListHashSet to allow for insertions in the middle of the list (rather than just
1781 * wtf/ListHashSet.h:
1782 (WTF::::insertBefore):
1783 (WTF::::insertNodeBefore):
1785 2008-07-11 Sam Weinig <sam@webkit.org>
1787 Rubber-stamped by Darin Adler.
1789 Move call function to CallData.cpp and construct to ConstructData.cpp.
1792 * JavaScriptCore.pri:
1793 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1794 * JavaScriptCore.xcodeproj/project.pbxproj:
1795 * JavaScriptCoreSources.bkl:
1796 * kjs/AllInOneFile.cpp:
1797 * kjs/CallData.cpp: Copied from kjs/JSValue.cpp.
1798 * kjs/ConstructData.cpp: Copied from kjs/JSValue.cpp.
1801 2008-07-10 Mark Rowe <mrowe@apple.com>
1803 Reviewed by Sam Weinig.
1805 Define WEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST when building WebKit to ensure that no symbols end up with the weak_import attribute.
1807 * Configurations/Base.xcconfig:
1809 2008-07-10 Mark Rowe <mrowe@apple.com>
1811 Reviewed by Sam Weinig.
1813 Fix the Tiger build by omitting annotations from methods declared in categories when using old versions of GCC.
1815 * API/WebKitAvailability.h:
1817 2008-07-10 Kevin McCullough <kmccullough@apple.com>
1821 -Minor cleanup. Renamed callTree() to head() and no longer use m_head
1822 directly but instead keep it private and access via a method().
1824 * profiler/HeavyProfile.cpp:
1825 (KJS::HeavyProfile::HeavyProfile):
1826 (KJS::HeavyProfile::generateHeavyStructure):
1827 (KJS::HeavyProfile::addNode):
1828 * profiler/Profile.h:
1829 (KJS::Profile::head):
1830 * profiler/ProfileGenerator.cpp:
1831 (KJS::ProfileGenerator::ProfileGenerator):
1833 2008-07-10 Alexey Proskuryakov <ap@webkit.org>
1835 Reviewed by Mark Rowe.
1837 Eliminate CollectorHeapIntrospector.
1839 CollectorHeapIntrospector was added primarily in the hopes to improve leaks tool output,
1840 a result that it didn't deliver. Also, it helped by labeling JSC heap regions as reported by
1841 vmmap tool, but at the same time, it made them mislabeled as malloc'd ones - the correct
1842 way to label mapped regions is to use a VM tag.
1844 So, it makes more sense to remove it completely than to make it work with multiple heaps.
1846 * JavaScriptCore.exp:
1847 * JavaScriptCore.xcodeproj/project.pbxproj:
1848 * kjs/AllInOneFile.cpp:
1849 * kjs/InitializeThreading.cpp:
1850 (KJS::initializeThreading):
1851 * kjs/collector.cpp:
1853 * kjs/CollectorHeapIntrospector.cpp: Removed.
1854 * kjs/CollectorHeapIntrospector.h: Removed.
1856 2008-07-09 Kevin McCullough <kmccullough@apple.com>
1860 <rdar://problem/5951532> JSProfiler: Implement heavy (or bottom-up)
1862 - Implemented the time and call count portionof heavy. Now all that we
1865 * profiler/CallIdentifier.h: Removed an unused constructor.
1866 * profiler/HeavyProfile.cpp:
1867 (KJS::HeavyProfile::HeavyProfile): Set the initial time of the head
1868 node so that percentages work correctly.
1869 (KJS::HeavyProfile::mergeProfiles): Sum the times and call count of
1871 * profiler/ProfileNode.cpp: Set the intital values of time and call
1872 count when copying ProfileNodes.
1873 (KJS::ProfileNode::ProfileNode):
1875 2008-07-10 Jan Michael Alonzo <jmalonzo@webkit.org>
1879 * GNUmakefile.am: Add HeavyProfile.cpp
1881 2008-07-09 Mark Rowe <mrowe@apple.com>
1883 Reviewed by Geoff Garen.
1885 Don't warn about deprecated functions in production builds.
1887 * Configurations/Base.xcconfig:
1888 * Configurations/DebugRelease.xcconfig:
1890 2008-07-09 Darin Adler <darin@apple.com>
1892 * JavaScriptCore.pri: Fix Qt build by adding HeavyProfile.cpp.
1894 2008-07-09 Kevin Ollivier <kevino@theolliviers.com>
1896 wx biuld fix. Add HeavyProfile.cpp to build files.
1898 * JavaScriptCoreSources.bkl:
1900 2008-07-09 Kevin McCullough <kmccullough@apple.com>
1902 - Windows build fix.
1904 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1906 2008-07-09 Kevin McCullough <kmccullough@apple.com>
1910 * profiler/HeavyProfile.cpp:
1911 (KJS::HeavyProfile::mergeProfiles):
1913 2008-07-09 Kevin McCullough <kmccullough@apple.com>
1915 Reviewed by Geoff and Adam.
1917 <rdar://problem/5951532> JSProfiler: Implement Bottom-Up view (19228)
1918 - This is the plumbing for bottom-up, but does not include calculating
1919 time, mostly because I'm still undclear about what the end result should
1921 - This, obviously, does not include the UI to expose this in the
1924 * JavaScriptCore.xcodeproj/project.pbxproj:
1925 * profiler/CallIdentifier.h:
1926 (KJS::CallIdentifier::CallIdentifier):
1927 (WTF::): Added HashTraits for CallIdentifiers to be used by a HashMap.
1928 * profiler/HeavyProfile.cpp: Added.
1929 (KJS::HeavyProfile::HeavyProfile):
1930 (KJS::HeavyProfile::generateHeavyStructure):
1931 (KJS::HeavyProfile::addNode):
1932 (KJS::HeavyProfile::mergeProfiles):
1933 (KJS::HeavyProfile::addAncestorsAsChildren):
1934 * profiler/HeavyProfile.h: Added.
1935 (KJS::HeavyProfile::create):
1936 (KJS::HeavyProfile::heavyProfile):
1937 (KJS::HeavyProfile::treeProfile):
1938 * profiler/Profile.cpp: Removed old commented out includes.
1939 * profiler/Profile.h: The m_head is needed by the HeavyProfile so it
1940 is now protected as opposed to private.
1941 * profiler/ProfileNode.cpp:
1942 (KJS::ProfileNode::ProfileNode): Created a constructor to copy
1944 (KJS::ProfileNode::findChild): Added a null check to make HeavyProfile
1945 children finding easier and avoid a potential crasher.
1946 * profiler/ProfileNode.h: Mostly moved things around but also added some
1947 functionality needed by HeavyProfile.
1948 (KJS::ProfileNode::create):
1949 (KJS::ProfileNode::functionName):
1950 (KJS::ProfileNode::url):
1951 (KJS::ProfileNode::lineNumber):
1952 (KJS::ProfileNode::head):
1953 (KJS::ProfileNode::setHead):
1954 (KJS::ProfileNode::setNextSibling):
1955 (KJS::ProfileNode::actualTotalTime):
1956 (KJS::ProfileNode::actualSelfTime):
1957 * profiler/TreeProfile.cpp: Implemented the ability to get a
1959 (KJS::TreeProfile::heavyProfile):
1960 * profiler/TreeProfile.h:
1962 2008-07-08 Geoffrey Garen <ggaren@apple.com>
1964 Reviewed by Oliver Hunt.
1966 Added support for checking if an object has custom properties in its
1967 property map. WebCore uses this to optimize marking DOM wrappers.
1969 2008-07-08 Simon Hausmann <hausmann@webkit.org>
1971 Prospective Gtk/Wx build fixes, add ProfileGenerator.cpp to the build.
1974 * JavaScriptCoreSources.bkl:
1976 2008-07-08 Simon Hausmann <hausmann@webkit.org>
1978 Fix the Qt build, add ProfileGenerator.cpp to the build.
1980 * JavaScriptCore.pri:
1982 2008-07-07 David Kilzer <ddkilzer@apple.com>
1984 releaseFastMallocFreeMemory() should always be defined
1988 * JavaScriptCore.exp: Changed to export C++ binding for
1989 WTF::releaseFastMallocFreeMemory() instead of C binding for
1990 releaseFastMallocFreeMemory().
1991 * wtf/FastMalloc.cpp: Moved definitions of
1992 releaseFastMallocFreeMemory() to be in the WTF namespace
1993 regardless whether FORCE_SYSTEM_MALLOC is defined.
1994 * wtf/FastMalloc.h: Moved releaseFastMallocFreeMemory() from
1995 extern "C" binding to WTF::releaseFastMallocFreeMemory().
1997 2008-07-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2001 Bug 19926: URL causes crash within a minute
2002 <https://bugs.webkit.org/show_bug.cgi?id=19926>
2004 Add a check that lastGlobalObject is non-null in Machine::execute()
2005 before copying its globals to the current register file.
2007 In theory, it is possible to make a test case for this, but it will
2008 take a while to get it right.
2011 (KJS::Machine::execute):
2013 2008-07-07 Darin Adler <darin@apple.com>
2015 Rubber stamped by Adele.
2018 (KJS::Machine::privateExecute): Fix a typo in a comment.
2020 2008-07-07 Steve Falkenburg <sfalken@apple.com>
2024 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2025 * JavaScriptCore.vcproj/testapi/testapi.vcproj:
2027 2008-07-07 Kevin McCullough <kmccullough@apple.com>
2031 When the profiler is running it gathers information and creates a
2032 Profile. After it finishes the Profile can be sorted and have other
2033 data refinements run over it. Both of these were done in the same class
2034 before. Now I split the gathering operations into a new class called
2037 * JavaScriptCore.xcodeproj/project.pbxproj:
2038 * profiler/Profile.cpp: Removed code related to the gather stage of a
2040 (KJS::Profile::create):
2041 (KJS::Profile::Profile):
2042 * profiler/Profile.h: Ditto.
2043 (KJS::Profile::title):
2044 (KJS::Profile::callTree):
2045 (KJS::Profile::setHead):
2046 * profiler/ProfileGenerator.cpp: Added. This is the class that will
2047 handle the stage of creating a Profile. Once the Profile is finished
2048 being created, this class goes away.
2049 (KJS::ProfileGenerator::create):
2050 (KJS::ProfileGenerator::ProfileGenerator):
2051 (KJS::ProfileGenerator::title):
2052 (KJS::ProfileGenerator::willExecute):
2053 (KJS::ProfileGenerator::didExecute):
2054 (KJS::ProfileGenerator::stopProfiling):
2055 (KJS::ProfileGenerator::didFinishAllExecution):
2056 (KJS::ProfileGenerator::removeProfileStart):
2057 (KJS::ProfileGenerator::removeProfileEnd):
2058 * profiler/ProfileGenerator.h: Added.
2059 (KJS::ProfileGenerator::profile):
2060 (KJS::ProfileGenerator::originatingGlobalExec):
2061 (KJS::ProfileGenerator::pageGroupIdentifier):
2062 (KJS::ProfileGenerator::client):
2063 (KJS::ProfileGenerator::stoppedProfiling):
2064 * profiler/Profiler.cpp: Now operates with the ProfileGenerator instead
2066 (KJS::Profiler::startProfiling):
2067 (KJS::Profiler::stopProfiling):
2068 (KJS::Profiler::didFinishAllExecution): It is here that the Profile is
2069 handed off to its client and the Profile Generator is no longer needed.
2070 (KJS::dispatchFunctionToProfiles):
2071 (KJS::Profiler::willExecute):
2072 (KJS::Profiler::didExecute):
2073 * profiler/Profiler.h: Cleaned up the includes and subsequently the
2074 forward declarations. Also use the new ProfileGenerator.
2075 (KJS::ProfilerClient::~ProfilerClient):
2076 (KJS::Profiler::currentProfiles):
2077 * profiler/TreeProfile.cpp: Use Profile's new interface.
2078 (KJS::TreeProfile::create):
2079 (KJS::TreeProfile::TreeProfile):
2080 * profiler/TreeProfile.h:
2082 2008-07-07 Sam Weinig <sam@webkit.org>
2084 Reviewed by Cameron Zwarich.
2086 Third step in broad cleanup effort.
2088 [ File list elided ]
2090 2008-07-06 Sam Weinig <sam@webkit.org>
2092 Reviewed by Cameron Zwarich.
2094 Second step in broad cleanup effort.
2096 [ File list elided ]
2098 2008-07-05 Sam Weinig <sam@webkit.org>
2100 Reviewed by Cameron Zwarich.
2102 First step in broad cleanup effort.
2104 [ File list elided ]
2106 2008-07-05 Sam Weinig <sam@webkit.org>
2108 Rubber-stamped by Cameron Zwarich.
2110 Rename list.h/cpp to ArgList.h/cpp.
2113 * JavaScriptCore.pri:
2114 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2115 * JavaScriptCore.xcodeproj/project.pbxproj:
2116 * JavaScriptCoreSources.bkl:
2118 * kjs/AllInOneFile.cpp:
2119 * kjs/ArgList.cpp: Copied from JavaScriptCore/kjs/list.cpp.
2120 * kjs/ArgList.h: Copied from JavaScriptCore/kjs/list.h.
2121 * kjs/IndexToNameMap.cpp:
2122 * kjs/JSGlobalData.cpp:
2123 * kjs/JSGlobalData.h:
2125 * kjs/collector.cpp:
2126 * kjs/list.cpp: Removed.
2127 * kjs/list.h: Removed.
2129 2008-07-05 Sam Weinig <sam@webkit.org>
2131 Fix non-AllInOne builds again.
2133 * kjs/BooleanPrototype.cpp:
2134 * kjs/ErrorPrototype.cpp:
2135 * kjs/FunctionPrototype.cpp:
2136 * kjs/NumberPrototype.cpp:
2137 * kjs/ObjectPrototype.cpp:
2139 2008-07-05 Sam Weinig <sam@webkit.org>
2141 Fix build on case-sensitive build systems.
2143 * kjs/IndexToNameMap.cpp:
2145 2008-07-05 Sam Weinig <sam@webkit.org>
2149 * kjs/Arguments.cpp:
2150 * kjs/BooleanPrototype.cpp:
2151 * kjs/DateConstructor.cpp:
2152 * kjs/ErrorPrototype.cpp:
2153 * kjs/FunctionPrototype.cpp:
2154 * kjs/NumberPrototype.cpp:
2155 * kjs/ObjectPrototype.cpp:
2156 * kjs/RegExpPrototype.cpp:
2157 * kjs/StringConstructor.cpp:
2160 2008-07-05 Sam Weinig <sam@webkit.org>
2162 Fix non-AllInOne build.
2164 * kjs/JSGlobalObject.cpp:
2166 2008-07-05 Sam Weinig <sam@webkit.org>
2168 Rubber-stamped by Cameron Zwarich.
2170 Split Arguments, IndexToNameMap, PrototypeFunction, GlobalEvalFunction and
2171 the functions on the global object out of JSFunction.h/cpp.
2174 * JavaScriptCore.pri:
2175 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2176 * JavaScriptCore.xcodeproj/project.pbxproj:
2177 * JavaScriptCoreSources.bkl:
2179 * kjs/AllInOneFile.cpp:
2180 * kjs/Arguments.cpp: Copied from JavaScriptCore/kjs/JSFunction.cpp.
2181 * kjs/Arguments.h: Copied from JavaScriptCore/kjs/JSFunction.h.
2182 * kjs/GlobalEvalFunction.cpp: Copied from JavaScriptCore/kjs/JSFunction.cpp.
2183 * kjs/GlobalEvalFunction.h: Copied from JavaScriptCore/kjs/JSFunction.h.
2184 * kjs/IndexToNameMap.cpp: Copied from JavaScriptCore/kjs/JSFunction.cpp.
2185 * kjs/IndexToNameMap.h: Copied from JavaScriptCore/kjs/JSFunction.h.
2186 * kjs/JSActivation.cpp:
2187 * kjs/JSFunction.cpp:
2189 * kjs/JSGlobalObject.cpp:
2190 * kjs/JSGlobalObjectFunctions.cpp: Copied from JavaScriptCore/kjs/JSFunction.cpp.
2191 * kjs/JSGlobalObjectFunctions.h: Copied from JavaScriptCore/kjs/JSFunction.h.
2192 The functions on the global object should be in JSGlobalObject.cpp, but putting them there
2193 was a 0.5% regression.
2195 * kjs/PrototypeFunction.cpp: Copied from JavaScriptCore/kjs/JSFunction.cpp.
2196 * kjs/PrototypeFunction.h: Copied from JavaScriptCore/kjs/JSFunction.h.
2201 2008-07-04 Sam Weinig <sam@webkit.org>
2203 Really fix the mac build.
2205 * JavaScriptCore.xcodeproj/project.pbxproj:
2207 2008-07-04 Sam Weinig <sam@webkit.org>
2211 * JavaScriptCore.xcodeproj/project.pbxproj:
2213 2008-07-04 Sam Weinig <sam@webkit.org>
2215 Fix non-AllInOne builds.
2218 * kjs/GetterSetter.cpp:
2219 * kjs/JSImmediate.cpp:
2220 * kjs/operations.cpp:
2222 2008-07-04 Sam Weinig <sam@webkit.org>
2224 Rubber-stamped by Dan Bernstein.
2226 Split Error and GetterSetter out of JSObject.h.
2228 * API/JSCallbackObjectFunctions.h:
2230 * JavaScriptCore.pri:
2231 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2232 * JavaScriptCore.xcodeproj/project.pbxproj:
2233 * JavaScriptCoreSources.bkl:
2234 * kjs/AllInOneFile.cpp:
2235 * kjs/ClassInfo.h: Copied from JavaScriptCore/kjs/JSObject.h.
2236 * kjs/Error.cpp: Copied from JavaScriptCore/kjs/JSObject.cpp.
2237 * kjs/Error.h: Copied from JavaScriptCore/kjs/JSObject.h.
2238 * kjs/GetterSetter.cpp:
2239 * kjs/GetterSetter.h: Copied from JavaScriptCore/kjs/JSObject.h.
2244 2008-07-04 Simon Hausmann <hausmann@webkit.org>
2246 Fix the Wx build, added TreeProfile.cpp to the build.
2248 * JavaScriptCoreSources.bkl:
2250 2008-07-03 Mark Rowe <mrowe@apple.com>
2252 Reviewed by Oliver Hunt.
2254 Fix output path of recently-added script phase to reference the correct file.
2255 This prevents Xcode from running the script phase unnecessarily, which caused
2256 the generated header to be recreated and lead to AllInOneFile.cpp rebuilding.
2258 * JavaScriptCore.xcodeproj/project.pbxproj:
2260 2008-07-03 Mark Rowe <mrowe@apple.com>
2262 Follow-up to the 64-bit build fix. Use intptr_t rather than ssize_t as
2263 the latter is non-standard and does not exist on Windows.
2266 (KJS::JSLock::lockCount):
2267 (KJS::JSLock::lock):
2268 (KJS::JSLock::unlock):
2269 (KJS::JSLock::DropAllLocks::DropAllLocks):
2272 2008-07-02 Mark Rowe <mrowe@apple.com>
2274 Fix the 64-bit build. pthread_getspecific works with pointer-sized values,
2275 so use ssize_t rather than int to track the lock count to avoid warnings about
2276 truncating the result of pthread_getspecific.
2279 (KJS::JSLock::lockCount):
2280 (KJS::JSLock::lock):
2281 (KJS::JSLock::unlock):
2282 (KJS::JSLock::DropAllLocks::DropAllLocks):
2285 2008-07-03 Geoffrey Garen <ggaren@apple.com>
2287 Reviewed by Sam Weinig.
2289 Removed checking for the array get/put fast case from the array code.
2290 Callers who want the fast case should call getIndex and/or setIndex
2291 instead. (get_by_val and put_by_val already do this.)
2293 SunSpider reports no change overall, but a 1.4% speedup on fannkuch and
2294 a 3.6% speedup on nsieve.
2296 2008-07-03 Dan Bernstein <mitz@apple.com>
2300 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Added TreeProfile.{h,cpp}.
2302 2008-07-03 Dan Bernstein <mitz@apple.com>
2304 Reviewed by Anders Carlsson.
2309 (KJS::Machine::Machine):
2311 2008-07-03 Simon Hausmann <hausmann@webkit.org>
2313 Reviewed by Alexey Proskuryakov.
2315 Fix the non-threaded build.
2317 * kjs/JSGlobalData.cpp:
2318 (KJS::JSGlobalData::threadInstanceInternal):
2320 2008-07-03 Simon Hausmann <hausmann@webkit.org>
2322 Fix the Qt build, added TreeProfile to the build.
2324 * JavaScriptCore.pri:
2326 2008-07-02 Alexey Proskuryakov <ap@webkit.org>
2330 Don't create unnecessary JSGlobalData instances.
2332 * kjs/JSGlobalData.h:
2333 * kjs/JSGlobalData.cpp:
2334 (KJS::JSGlobalData::threadInstanceExists):
2335 (KJS::JSGlobalData::sharedInstanceExists):
2336 (KJS::JSGlobalData::threadInstance):
2337 (KJS::JSGlobalData::sharedInstance):
2338 (KJS::JSGlobalData::threadInstanceInternal):
2339 (KJS::JSGlobalData::sharedInstanceInternal):
2340 Added methods to query instance existence.
2342 * kjs/InitializeThreading.cpp:
2343 (KJS::initializeThreadingOnce):
2344 Initialize thread instance static in a new way.
2348 * kjs/collector.cpp:
2349 (KJS::Heap::collect):
2350 Check for instance existence before accessing it.
2352 2008-07-02 Geoffrey Garen <ggaren@apple.com>
2354 Reviewed by Cameron Zwarich.
2356 Fixed https://bugs.webkit.org/show_bug.cgi?id=19862
2357 REGRESSION (r34907): Gmail crashes in JavaScriptCore code while editing drafts
2359 I was never able to reproduce this issue, but Cameron could, and he says
2360 that this patch fixes it.
2362 The crash seems tied to a timer or event handler callback. In such a case,
2363 the sole reference to the global object may be in the current call frame,
2364 so we can't depend on the global object to mark the call frame area in
2367 The new GC marking rule is: the global object is not responsible for
2368 marking the whole register file -- it's just responsible for the globals
2369 section it's tied to. The heap is responsible for marking the call frame area.
2371 2008-07-02 Mark Rowe <mrowe@apple.com>
2373 Reviewed by Sam Weinig.
2375 Add the ability to trace JavaScriptCore garabge collections using dtrace.
2377 * JavaScriptCore.xcodeproj/project.pbxproj: Generate the dtrace probe header
2378 file when building on a new enough version of Mac OS X.
2379 * JavaScriptCorePrefix.h: Add our standard Mac OS X version detection macros.
2380 * kjs/Tracing.d: Declare three dtrace probes.
2381 * kjs/Tracing.h: Include the generated dtrace macros if dtrace is available,
2382 otherwise provide versions that do nothing.
2383 * kjs/collector.cpp:
2384 (KJS::Heap::collect): Fire dtrace probes when starting a collection, after the
2385 mark phase has completed, and when the collection is complete.
2386 * wtf/Platform.h: Define HAVE_DTRACE when building on a new enough version of Mac OS X.
2388 2008-07-02 Geoffrey Garen <ggaren@apple.com>
2390 Rubber stamped by Oliver Hunt.
2392 Reduced the max register file size from 8MB to 2MB.
2394 We still allow about 20,000 levels of recursion.
2396 2008-07-02 Alp Toker <alp@nuanti.com>
2398 Build fix for r34960. Add TreeProfile.cpp to build.
2402 2008-07-02 Geoffrey Garen <ggaren@apple.com>
2404 Reviewed by Oliver Hunt.
2406 Optimized a[n] get for cases when a is an array or a string. When a is
2407 an array, we optimize both get and put. When a is a string, we only
2408 optimize get, since you can't put to a string.
2410 SunSpider says 3.4% faster.
2412 2008-07-02 Kevin McCullough <kmccullough@apple.com>
2416 -Small cleanup in preparation for implementing Bottom-up.
2418 * profiler/CallIdentifier.h: Rename debug function to make it clear of
2419 its output and intention to be debug only.
2420 (KJS::CallIdentifier::operator const char* ): Implement in terms of
2422 (KJS::CallIdentifier::c_str):
2423 * profiler/ProfileNode.cpp: Impelment findChild() which will be needed
2424 by the bottom-up implementation.
2425 (KJS::ProfileNode::findChild):
2426 * profiler/ProfileNode.h: Added comments to make the collections of
2427 functions more clear.
2428 (KJS::ProfileNode::operator==):
2429 (KJS::ProfileNode::c_str):
2431 2008-07-02 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2435 Bug 19776: Number.toExponential() is incorrect for numbers between 0.1 and 1
2436 <https://bugs.webkit.org/show_bug.cgi?id=19776>
2438 Perform the sign check for the exponent on the actual exponent value,
2439 which is 1 less than the value of decimalPoint, instead of on the value
2440 of decimalPoint itself.
2442 * kjs/NumberPrototype.cpp:
2443 (KJS::exponentialPartToString):
2445 2008-07-02 Kevin McCullough <kmccullough@apple.com>
2449 <rdar://problem/5951532> JSProfiler: Implement Bottom-Up view (19228)
2450 - Subclass TreeProfile as I prepare for a HeavyProfile to be comming
2453 * JavaScriptCore.xcodeproj/project.pbxproj:
2454 * profiler/Profile.cpp: By default we create a TreeProfile.
2455 (KJS::Profile::create):
2456 * profiler/Profile.h: Changes to the Profile class to make it amenable
2457 to be inherited from.
2458 (KJS::Profile::~Profile):
2459 * profiler/TreeProfile.cpp: Added.
2460 (KJS::TreeProfile::create):
2461 (KJS::TreeProfile::TreeProfile):
2462 (KJS::TreeProfile::heavyProfile):
2463 * profiler/TreeProfile.h: Added.
2464 (KJS::TreeProfile::treeProfile):
2466 2008-07-02 Kevin McCullough <kmccullough@apple.com>
2470 Broke CallIdentifier out into its own file. I did this because it's
2471 going to grow a lot soon and I wanted this to be a separate patch.
2473 * JavaScriptCore.xcodeproj/project.pbxproj:
2474 * profiler/CallIdentifier.h: Added.
2475 (KJS::CallIdentifier::CallIdentifier):
2476 (KJS::CallIdentifier::operator==):
2477 (KJS::CallIdentifier::operator!=):
2478 (KJS::CallIdentifier::operator const char* ):
2479 (KJS::CallIdentifier::toString):
2480 * profiler/ProfileNode.h:
2482 2008-07-02 Simon Hausmann <hausmann@webkit.org>
2484 Build fix. Implemented missing functions for single-threaded build.
2487 (KJS::JSLock::JSLock):
2488 (KJS::JSLock::lock):
2489 (KJS::JSLock::unlock):
2490 (KJS::JSLock::DropAllLocks::DropAllLocks):
2492 2008-07-02 Alexey Proskuryakov <ap@webkit.org>
2494 Another non-AllInOne build fix.
2496 * kjs/JSGlobalObject.cpp: Include JSLock.h here, too.
2498 2008-07-02 Alexey Proskuryakov <ap@webkit.org>
2500 Non-AllInOne build fix.
2502 * kjs/interpreter.cpp: Include JSLock.h.
2504 2008-06-30 Alexey Proskuryakov <ap@webkit.org>
2508 Disable JSLock for per-thread contexts.
2510 No change on SunSpider.
2512 * kjs/JSGlobalData.h:
2513 * kjs/JSGlobalData.cpp:
2514 (KJS::JSGlobalData::JSGlobalData):
2515 (KJS::JSGlobalData::sharedInstance):
2516 Added isSharedInstance as a better way to tell whether the instance is shared (legacy).
2519 (KJS::createJSLockCount):
2520 (KJS::JSLock::lockCount):
2521 (KJS::setLockCount):
2522 (KJS::JSLock::JSLock):
2523 (KJS::JSLock::lock):
2524 (KJS::JSLock::unlock):
2525 (KJS::JSLock::currentThreadIsHoldingLock):
2526 (KJS::JSLock::DropAllLocks::DropAllLocks):
2527 (KJS::JSLock::DropAllLocks::~DropAllLocks):
2529 (KJS::JSLock::JSLock):
2530 (KJS::JSLock::~JSLock):
2531 Made JSLock and JSLock::DropAllLocks constructors take a parameter to decide whether to
2532 actually lock a mutex, or only to increment recursion count. We cannot turn it into no-op
2533 if we want to keep existing assertions working.
2534 Made recursion count per-thread, now that locks may not lock.
2537 (JSEvaluateScript): Take JSLock after casting JSContextRef to ExecState* (which doesn't need
2538 locking in any case), so that a decision whether to actually lock can be made.
2539 (JSCheckScriptSyntax): Ditto.
2540 (JSGarbageCollect): Only lock while collecting the shared heap, not the per-thread one.
2542 * API/JSObjectRef.cpp:
2543 (JSClassCreate): Don't lock, as there is no reason to.
2544 (JSClassRetain): Ditto.
2545 (JSClassRelease): Ditto.
2546 (JSPropertyNameArrayRetain): Ditto.
2547 (JSPropertyNameArrayRelease): Only lock while deleting the array, as that may touch
2549 (JSPropertyNameAccumulatorAddName): Adding a string also involves an identifier table
2550 lookup, and possibly modification.
2552 * API/JSStringRef.cpp:
2553 (JSStringCreateWithCharacters):
2554 (JSStringCreateWithUTF8CString):
2557 (JSStringGetUTF8CString):
2559 * API/JSStringRefCF.cpp:
2560 (JSStringCreateWithCFString):
2561 JSStringRef operations other than releasing do not need locking.
2563 * VM/Machine.cpp: Don't include unused JSLock.h.
2565 * kjs/CollectorHeapIntrospector.cpp: (KJS::CollectorHeapIntrospector::statistics):
2566 Don't take the lock for real, as heap introspection pauses the process anyway. It seems that
2567 the existing code could cause deadlocks.
2573 The test tool uses a per-thread context, so no real locking is required.
2576 (KJS::Heap::setGCProtectNeedsLocking): Optionally protect m_protectedValues access with a
2577 per-heap mutex. This is only needed for WebCore Database code, which violates the "no data
2578 migration between threads" by using ProtectedPtr on a background thread.
2579 (KJS::Heap::isShared): Keep a shared flag here, as well.
2582 (KJS::::ProtectedPtr):
2583 (KJS::::~ProtectedPtr):
2587 ProtectedPtr is ony used from WebCore, so it doesn't need to take JSLock. An assertion in
2588 Heap::protect/unprotect guards agains possible future unlocked uses of ProtectedPtr in JSC.
2590 * kjs/collector.cpp:
2591 (KJS::Heap::Heap): Initialize m_isShared.
2592 (KJS::Heap::~Heap): No need to lock for real during destruction, but must keep assertions
2594 (KJS::destroyRegisteredThread): Registered thread list is only accessed for shared heap,
2595 so locking is always needed here.
2596 (KJS::Heap::registerThread): Ditto.
2597 (KJS::Heap::markStackObjectsConservatively): Use m_isShared instead of comparing to a shared
2598 instance for a small speedup.
2599 (KJS::Heap::setGCProtectNeedsLocking): Create m_protectedValuesMutex. There is currently no
2600 way to undo this - and ideally, Database code will be fixed to lo longer require this quirk.
2601 (KJS::Heap::protect): Take m_protectedValuesMutex (if it exists) while accessing
2603 (KJS::Heap::unprotect): Ditto.
2604 (KJS::Heap::markProtectedObjects): Ditto.
2605 (KJS::Heap::protectedGlobalObjectCount): Ditto.
2606 (KJS::Heap::protectedObjectCount): Ditto.
2607 (KJS::Heap::protectedObjectTypeCounts): Ditto.
2611 Don't include JSLock.h, which is no longer used here. As a result, an explicit include had
2612 to be added to many files in JavaScriptGlue, WebCore and WebKit.
2614 * kjs/JSGlobalObject.cpp:
2615 (KJS::JSGlobalObject::init):
2616 * API/JSCallbackConstructor.cpp:
2617 (KJS::constructJSCallback):
2618 * API/JSCallbackFunction.cpp:
2619 (KJS::JSCallbackFunction::call):
2620 * API/JSCallbackObjectFunctions.h:
2622 (KJS::::getOwnPropertySlot):
2624 (KJS::::deleteProperty):
2626 (KJS::::hasInstance):
2628 (KJS::::getPropertyNames):
2631 (KJS::::staticValueGetter):
2632 (KJS::::callbackGetter):
2633 * API/JSContextRef.cpp:
2634 (JSGlobalContextCreate):
2635 (JSGlobalContextRetain):
2636 (JSGlobalContextRelease):
2637 * API/JSValueRef.cpp:
2639 (JSValueIsStrictEqual):
2640 (JSValueIsInstanceOfConstructor):
2641 (JSValueMakeNumber):
2642 (JSValueMakeString):
2644 (JSValueToStringCopy):
2648 * JavaScriptCore.exp:
2649 * kjs/PropertyNameArray.h:
2650 (KJS::PropertyNameArray::globalData):
2651 * kjs/interpreter.cpp:
2652 (KJS::Interpreter::checkSyntax):
2653 (KJS::Interpreter::evaluate):
2654 Pass a parameter to JSLock/JSLock::DropAllLocks to decide whether the lock needs to be taken.
2656 2008-07-01 Alexey Proskuryakov <ap@webkit.org>
2660 https://bugs.webkit.org/show_bug.cgi?id=19834
2661 Failed assertion in JavaScriptCore/VM/SegmentedVector.h:82
2663 Creating a global object with a custom prototype resets it twice (wasteful!).
2664 So, addStaticGlobals() was called twice, but JSGlobalObject::reset() didn't reset
2667 * kjs/JSGlobalObject.cpp: (KJS::JSGlobalObject::reset): Call setRegisterArray(0, 0).
2669 * kjs/JSVariableObject.h: Changed registerArray to OwnArrayPtr. Also, added private copy
2670 constructor and operator= to ensure that no one attempts to copy this object (for whatever
2671 reason, I couldn't make Noncopyable work).
2673 * kjs/JSGlobalObject.h: (KJS::JSGlobalObject::addStaticGlobals): Allocate registerArray
2676 * kjs/JSVariableObject.cpp:
2677 (KJS::JSVariableObject::copyRegisterArray): Allocate registerArray with new[].
2678 (KJS::JSVariableObject::setRegisterArray): Avoid hitting an assertion in OwnArrayPtr when
2679 "changing" the value from 0 to 0.
2681 2008-07-01 Geoffrey Garen <ggaren@apple.com>
2683 Reviewed by Oliver Hunt.
2685 Removed and/or reordered exception checks in array-style a[n] access.
2687 SunSpider says 1.4% faster.
2690 (KJS::Machine::privateExecute): No need to check for exceptions before
2691 calling toString, toNumber and/or get. If the call ends up being observable
2692 through toString, valueOf, or a getter, we short-circuit it there, instead.
2693 In the op_del_by_val case, I removed the incorrect comment without actually
2694 removing the code, since I didn't want to tempt the GCC fates!
2697 (KJS::callDefaultValueFunction): Added exception check to prevent
2698 toString and valueOf functions from observing execution after an exception
2699 has been thrown. This removes some of the burden of exception checking
2702 (KJS::JSObject::defaultValue): Removed redundant exception check here.
2704 * kjs/PropertySlot.cpp:
2705 (KJS::PropertySlot::functionGetter): Added exception check to prevent
2706 getter functions from observing execution after an exception has been
2707 thrown. This removes some of the burden of exception checking from the
2710 2008-07-01 Geoffrey Garen <ggaren@apple.com>
2712 Reviewed by Oliver Hunt.
2714 Optimized a[n] get and put for cases where n is an immediate unsigned
2717 SunSpider says 3.5% faster.
2719 2008-07-01 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2723 Bug 19844: JavaScript Switch statement modifies "this"
2724 <https://bugs.webkit.org/show_bug.cgi?id=19844>
2726 Use a temporary when generating code for switch clauses to avoid
2727 overwriting 'this' or a local variable.
2730 (KJS::CaseBlockNode::emitCodeForBlock):
2732 2008-07-01 Christian Dywan <christian@twotoasts.de>
2736 * kjs/list.cpp: Include "JSCell.h"
2738 2008-07-01 Kevin McCullough <kmccullough@apple.com>
2742 * JavaScriptCore.xcodeproj/project.pbxproj:
2744 2008-07-01 Dan Bernstein <mitz@apple.com>
2746 Reviewed by Anders Carlsson.
2748 - Mac release build fix
2750 * JavaScriptCore.exp:
2752 2008-07-01 Sam Weinig <sam@webkit.org>
2754 Try and fix mac builds.
2756 * JavaScriptCore.exp:
2758 2008-07-01 Sam Weinig <sam@webkit.org>
2760 Fix non-AllInOne builds.
2764 2008-07-01 Sam Weinig <sam@webkit.org>
2766 Reviewed by Darin Adler.
2768 Split JSCell and JSNumberCell class declarations out of JSValue.h
2771 * JavaScriptCore.pri:
2772 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2773 * JavaScriptCore.xcodeproj/project.pbxproj:
2774 * JavaScriptCoreSources.bkl:
2775 * VM/JSPropertyNameIterator.h:
2776 * kjs/AllInOneFile.cpp:
2777 * kjs/JSCell.cpp: Copied from JavaScriptCore/kjs/JSValue.cpp.
2778 * kjs/JSCell.h: Copied from JavaScriptCore/kjs/JSValue.h.
2779 (KJS::JSValue::getJSNumber):
2780 * kjs/JSNumberCell.cpp:
2781 * kjs/JSNumberCell.h: Copied from JavaScriptCore/kjs/JSValue.h.
2785 (KJS::jsOwnedString):
2787 (KJS::JSValue::toThisJSString):
2791 2008-07-01 Anders Carlsson <andersca@apple.com>
2795 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2796 * kjs/JSGlobalObject.h:
2797 (KJS::JSGlobalObject::addStaticGlobals):
2799 2008-07-01 Simon Hausmann <hausmann@webkit.org>
2801 Build fix, include OwnPtr.h.
2803 * kjs/RegExpConstructor.h:
2805 2008-06-30 Geoffrey Garen <ggaren@apple.com>
2807 Reviewed by Oliver Hunt.
2809 Fixed a global object leak caused by the switch to one register file.
2811 Don't unconditionally mark the register file, since that logically
2812 makes all global variables GC roots, even when their global object is
2813 no longer reachable.
2815 Instead, make the global object associated with the register file
2816 responsible for marking the register file.
2818 2008-06-30 Geoffrey Garen <ggaren@apple.com>
2820 Reviewed by Oliver Hunt.
2822 Removed the "registerBase" abstraction. Since the register file never
2823 reallocates, we can keep direct pointers into it, instead of
2824 <registerBase, offset> tuples.
2826 SunSpider says 0.8% faster.
2828 2008-06-30 Oliver Hunt <oliver@apple.com>
2830 Reviewed by NOBODY (build fix).
2832 Fix build by adding all (hopefully) the missing includes.
2834 * kjs/BooleanPrototype.cpp:
2835 * kjs/DateConstructor.cpp:
2836 * kjs/ErrorPrototype.cpp:
2837 * kjs/FunctionPrototype.cpp:
2838 * kjs/NativeErrorConstructor.cpp:
2839 * kjs/NumberPrototype.cpp:
2840 * kjs/ObjectPrototype.cpp:
2841 * kjs/RegExpConstructor.cpp:
2842 * kjs/StringConstructor.cpp:
2843 * kjs/StringPrototype.cpp:
2845 2008-06-30 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2849 Bug 19830: REGRESSION (r34883): Google Reader doesn't show up feed list on sidebar
2850 <https://bugs.webkit.org/show_bug.cgi?id=19830>
2852 Ensure that we do not eliminate a write to a local register when doing
2853 peephole optimizations.
2855 * VM/CodeGenerator.cpp:
2856 (KJS::CodeGenerator::emitJumpIfTrue):
2857 (KJS::CodeGenerator::emitJumpIfFalse):
2859 2008-06-30 Sam Weinig <sam@webkit.org>
2861 Rubber-stamped by Darin Alder.
2863 Split InternalFunction into its own header file.
2865 * API/JSCallbackFunction.h:
2866 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2867 * JavaScriptCore.xcodeproj/project.pbxproj:
2868 * kjs/ArrayConstructor.h:
2869 * kjs/BooleanConstructor.h:
2870 * kjs/DateConstructor.h:
2871 * kjs/ErrorConstructor.h:
2872 * kjs/FunctionConstructor.h:
2873 * kjs/FunctionPrototype.h:
2874 * kjs/InternalFunction.h: Copied from kjs/JSFunction.h.
2876 * kjs/NativeErrorConstructor.h:
2877 * kjs/NumberConstructor.h:
2878 * kjs/ObjectConstructor.h:
2879 * kjs/RegExpConstructor.h:
2880 * kjs/StringConstructor.h:
2881 * profiler/Profiler.cpp:
2883 2008-06-30 Sam Weinig <sam@webkit.org>
2885 Reviewed by Kevin McCullough.
2887 Remove empty files Instruction.cpp, LabelID.cpp, Register.cpp and RegisterID.cpp.
2890 * JavaScriptCore.pri:
2891 * JavaScriptCore.xcodeproj/project.pbxproj:
2892 * JavaScriptCoreSources.bkl:
2893 * VM/Instruction.cpp: Removed.
2894 * VM/LabelID.cpp: Removed.
2895 * VM/Register.cpp: Removed.
2896 * VM/RegisterID.cpp: Removed.
2898 2008-06-30 Sam Weinig <sam@webkit.org>
2900 Rubber-stamped (reluctantly) by Kevin McCullough.
2902 Rename date_object.h/cpp to DateInstance.h/cpp
2905 * JavaScriptCore.pri:
2906 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2907 * JavaScriptCore.xcodeproj/project.pbxproj:
2908 * JavaScriptCoreSources.bkl:
2909 * kjs/AllInOneFile.cpp:
2910 * kjs/DateConstructor.cpp:
2911 * kjs/DateInstance.cpp: Copied from kjs/date_object.cpp.
2912 * kjs/DateInstance.h: Copied from kjs/date_object.h.
2913 * kjs/DatePrototype.cpp:
2914 * kjs/DatePrototype.h:
2915 * kjs/date_object.cpp: Removed.
2916 * kjs/date_object.h: Removed.
2918 2008-06-30 Sam Weinig <sam@webkit.org>
2920 Rubber-stamped by Darin Adler.
2922 Remove internal.cpp and move its contents to there own .cpp files.
2925 * JavaScriptCore.pri:
2926 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2927 * JavaScriptCore.xcodeproj/project.pbxproj:
2928 * JavaScriptCoreSources.bkl:
2929 * kjs/AllInOneFile.cpp:
2930 * kjs/GetterSetter.cpp: Copied from kjs/internal.cpp.
2931 * kjs/InternalFunction.cpp: Copied from kjs/internal.cpp.
2932 * kjs/JSNumberCell.cpp: Copied from kjs/internal.cpp.
2933 * kjs/JSString.cpp: Copied from kjs/internal.cpp.
2935 * kjs/LabelStack.cpp: Copied from kjs/internal.cpp.
2936 * kjs/NumberConstructor.cpp:
2937 * kjs/NumberObject.cpp:
2938 (KJS::constructNumber):
2939 (KJS::constructNumberFromImmediateNumber):
2940 * kjs/internal.cpp: Removed.
2942 2008-06-30 Adam Roben <aroben@apple.com>
2944 Fix <rdar://5954749> Assertion failure due to HashTable's use of
2947 HashTable was passing &value to constructDeletedValue, which in
2948 classes like WebCore::COMPtr would cause an assertion. We now pass
2949 value by reference instead of by address so that the HashTraits
2950 implementations have more flexibility in constructing the deleted
2953 Reviewed by Ada Chan.
2955 * VM/CodeGenerator.h: Updated for changes to HashTraits.
2957 (WTF::::deleteBucket): Changed to pass bucket by reference instead of
2959 (WTF::::checkKey): Ditto.
2961 (WTF::): Updated HashTraits for HashTable change.
2963 2008-07-01 Alexey Proskuryakov <ap@webkit.org>
2965 Reviewed by Cameron Zwarich.
2967 Make RegisterFile really unmap memory on destruction.
2969 This fixes run-webkit-tests --threaded, which ran out of address space in a few seconds.
2971 * VM/RegisterFile.cpp: (KJS::RegisterFile::~RegisterFile): Unmap all the memory, not just
2974 * kjs/JSGlobalObject.h: Don't include RegisterFile.h, so that changes to it don't make
2975 half of WebCore rebuild.
2977 * VM/Machine.h: Don't forward declare RegisterFile, as RegisterFile.h is included already.
2979 * VM/RegisterFile.h: (KJS::RegisterFile::RegisterFile): Assert that the allocation succeeded.
2981 2008-06-30 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2983 Rubber-stamped by Oliver.
2985 Correct the documentation for op_put_by_index.
2988 (KJS::Machine::privateExecute):
2990 2008-06-29 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2994 Bug 19821: Merge the instruction pair (less, jfalse)
2995 <https://bugs.webkit.org/show_bug.cgi?id=19821>
2997 This is a 2.4% win on SunSpider. I needed to add an ALWAYS_INLINE
2998 intrinisc to CodeGenerator::rewindBinaryOp() to avoid a massive
2999 regression in regexp-dna.
3002 (KJS::CodeBlock::dump):
3003 * VM/CodeGenerator.cpp:
3004 (KJS::CodeGenerator::rewindBinaryOp):
3005 (KJS::CodeGenerator::emitJumpIfFalse):
3007 (KJS::Machine::privateExecute):
3012 2008-06-29 Sam Weinig <sam@webkit.org>
3014 Fix non-AllInOne builds.
3019 2008-06-29 Sam Weinig <sam@webkit.org>
3024 * kjs/DatePrototype.cpp:
3026 2008-06-29 Sam Weinig <sam@webkit.org>
3028 Rubber-stamped by Cameron Zwarich.
3030 Splits ErrorConstructor, ErrorPrototype, NativeErrorConstructor and
3031 NativeErrorPrototype out of error_object.h/cpp and renames it ErrorInstance.
3034 * JavaScriptCore.pri:
3035 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3036 * JavaScriptCore.xcodeproj/project.pbxproj:
3037 * JavaScriptCoreSources.bkl:
3038 * kjs/AllInOneFile.cpp:
3039 * kjs/ArrayConstructor.cpp:
3040 * kjs/ArrayPrototype.cpp:
3041 * kjs/BooleanPrototype.cpp:
3042 * kjs/DatePrototype.cpp:
3043 * kjs/ErrorConstructor.cpp: Copied from kjs/error_object.cpp.
3044 * kjs/ErrorConstructor.h: Copied from kjs/error_object.h.
3045 * kjs/ErrorInstance.cpp: Copied from kjs/error_object.cpp.
3046 * kjs/ErrorInstance.h: Copied from kjs/error_object.h.
3047 * kjs/ErrorPrototype.cpp: Copied from kjs/error_object.cpp.
3048 * kjs/ErrorPrototype.h: Copied from kjs/error_object.h.
3049 * kjs/JSGlobalObject.cpp:
3052 * kjs/NativeErrorConstructor.cpp: Copied from kjs/error_object.cpp.
3053 * kjs/NativeErrorConstructor.h: Copied from kjs/error_object.h.
3054 * kjs/NativeErrorPrototype.cpp: Copied from kjs/error_object.cpp.
3055 * kjs/NativeErrorPrototype.h: Copied from kjs/error_object.h.
3056 * kjs/NumberPrototype.cpp:
3057 * kjs/RegExpConstructor.cpp:
3058 * kjs/RegExpObject.cpp:
3059 * kjs/RegExpPrototype.cpp:
3060 * kjs/StringPrototype.cpp:
3061 * kjs/error_object.cpp: Removed.
3062 * kjs/error_object.h: Removed.
3065 2008-06-29 Sam Weinig <sam@webkit.org>
3067 Fix non-AllInOne build.
3069 * kjs/DateConstructor.cpp:
3073 2008-06-29 Sam Weinig <sam@webkit.org>
3075 Rubber-stamped by Oliver Hunt.
3077 Splits DateConstructor and DatePrototype out of date_object.h/cpp
3078 Moves shared Date code into DateMath.
3080 * DerivedSources.make:
3082 * JavaScriptCore.pri:
3083 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3084 * JavaScriptCore.xcodeproj/project.pbxproj:
3085 * JavaScriptCoreSources.bkl:
3086 * kjs/AllInOneFile.cpp:
3087 * kjs/DateConstructor.cpp: Copied from kjs/date_object.cpp.
3088 * kjs/DateConstructor.h: Copied from kjs/date_object.h.
3090 (KJS::ymdhmsToSeconds):
3092 (KJS::skipSpacesAndComments):
3097 (KJS::formatDateUTCVariant):
3101 * kjs/DatePrototype.cpp: Copied from kjs/date_object.cpp.
3102 * kjs/DatePrototype.h: Copied from kjs/date_object.h.
3103 * kjs/JSGlobalObject.cpp:
3105 * kjs/date_object.cpp:
3106 * kjs/date_object.h:
3109 2008-06-29 Jan Michael Alonzo <jmalonzo@webkit.org>
3111 Rubber-stamped by Cameron Zwarich
3113 Fix Gtk non-AllInOne build
3115 * GNUmakefile.am: include JSVariableObject.cpp
3116 * kjs/RegExpConstructor.cpp: include RegExpObject.h
3117 * kjs/RegExpObject.h: forward declare RegExpPrototype
3119 2008-06-28 Darin Adler <darin@apple.com>
3121 Reviewed by Sam and Cameron.
3123 - fix https://bugs.webkit.org/show_bug.cgi?id=19805
3124 Array.concat turns missing array elements into "undefined"
3126 Test: fast/js/array-holes.html
3128 * JavaScriptCore.exp: No longer export JSArray::getItem.
3130 * kjs/ArrayPrototype.cpp:
3131 (KJS::arrayProtoFuncConcat): Changed to use getProperty instead of
3132 JSArray::getItem -- need to handle properties from the prototype chain
3133 instead of ignoring them.
3135 * kjs/JSArray.cpp: Removed getItem.
3136 * kjs/JSArray.h: Ditto.
3138 2008-06-28 Darin Adler <darin@apple.com>
3140 Reviewed by Cameron.
3142 - https://bugs.webkit.org/show_bug.cgi?id=19804
3143 optimize access to arrays without "holes"
3145 SunSpider says 1.8% faster.
3148 (KJS::JSArray::JSArray): Initialize m_fastAccessCutoff when creating
3149 arrays. Also updated for new location of m_vectorLength.
3150 (KJS::JSArray::getItem): Updated for new location of m_vectorLength.
3151 (KJS::JSArray::getSlowCase): Added. Broke out the non-hot parts of
3152 getOwnPropertySlot to make the hot part faster.
3153 (KJS::JSArray::getOwnPropertySlot): Added a new faster case for
3154 indices lower than m_fastAccessCutoff. We can do theese with no
3155 additional checks or branches.
3156 (KJS::JSArray::put): Added a new faster case for indices lower than
3157 m_fastAccessCutoff. We can do theese with no additional checks or
3158 branches. Moved the maxArrayIndex handling out of this function.
3159 Added code to set m_fastAccessCutoff when the very last hole in
3160 an array is filled; this is how the cutoff gets set for most arrays.
3161 (KJS::JSArray::putSlowCase): Moved the rest of the put function logic
3162 in here, to make the hot part of the put function faster.
3163 (KJS::JSArray::deleteProperty): Added code to lower m_fastAccessCutoff
3164 when a delete makes a new hole in the array.
3165 (KJS::JSArray::getPropertyNames): Updated for new location of
3167 (KJS::JSArray::increaseVectorLength): Ditto.
3168 (KJS::JSArray::setLength): Added code to lower m_fastAccessCutoff
3169 when setLength makes the array smaller.
3170 (KJS::JSArray::mark): Updated for new location of m_vectorLength.
3171 (KJS::JSArray::sort): Ditto. Set m_fastAccessCutoff after moving
3172 all the holes to the end of the array.
3173 (KJS::JSArray::compactForSorting): Ditto.
3174 (KJS::JSArray::checkConsistency): Added consistency checks fro
3175 m_fastAccessCutoff and updated for the new location of m_vectorLength.
3177 * kjs/JSArray.h: Added declarations for slow case functions.
3178 Replaced m_vectorLength with m_fastAccessCutoff.
3180 2008-06-28 Cameron Zwarich <cwzwarich@uwaterloo.ca>
3184 When executing a native call, check for an exception before writing the
3188 (KJS::Machine::privateExecute):
3190 2008-06-28 Mark Rowe <mrowe@apple.com>
3192 Build fix. Flag headers as private or public as is appropriate.
3193 These settings were accidentally removed during some project file cleanup.
3195 * JavaScriptCore.xcodeproj/project.pbxproj:
3197 2008-06-28 Sam Weinig <sam@webkit.org>
3199 Rubber-stamped by Darin Adler.
3201 Splits RegExpConstructor and RegExpPrototype out of RegExpObject.h/cpp
3203 * DerivedSources.make:
3205 * JavaScriptCore.pri:
3206 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3207 * JavaScriptCore.xcodeproj/project.pbxproj:
3208 * JavaScriptCoreSources.bkl:
3210 * kjs/AllInOneFile.cpp:
3211 * kjs/JSGlobalObject.cpp:
3212 * kjs/RegExpConstructor.cpp: Copied from kjs/RegExpObject.cpp.
3213 * kjs/RegExpConstructor.h: Copied from kjs/RegExpObject.h.
3214 * kjs/RegExpObject.cpp:
3215 * kjs/RegExpObject.h:
3216 * kjs/RegExpPrototype.cpp: Copied from kjs/RegExpObject.cpp.
3217 * kjs/RegExpPrototype.h: Copied from kjs/RegExpObject.h.
3218 * kjs/StringPrototype.cpp:
3221 2008-06-28 Sam Weinig <sam@webkit.org>
3223 Fix non-AllInOne builds.
3225 * kjs/StringConstructor.cpp:
3227 2008-06-28 Sam Weinig <sam@webkit.org>
3229 Rubber-stamped by Darin Adler.
3231 Rename string_object.h/cpp to StringObject.h/cpp and split out StringObjectThatMasqueradesAsUndefined,
3232 StringConstructor and StringPrototype.
3234 * DerivedSources.make:
3236 * JavaScriptCore.pri:
3237 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3238 * JavaScriptCore.xcodeproj/project.pbxproj:
3239 * JavaScriptCoreSources.bkl:
3240 * kjs/AllInOneFile.cpp:
3241 * kjs/JSGlobalObject.cpp:
3242 * kjs/StringConstructor.cpp: Copied from JavaScriptCore/kjs/string_object.cpp.
3243 * kjs/StringConstructor.h: Copied from JavaScriptCore/kjs/string_object.h.
3244 * kjs/StringObject.cpp: Copied from JavaScriptCore/kjs/string_object.cpp.
3245 * kjs/StringObject.h: Copied from JavaScriptCore/kjs/string_object.h.
3246 * kjs/StringObjectThatMasqueradesAsUndefined.h: Copied from JavaScriptCore/kjs/string_object.h.
3247 * kjs/StringPrototype.cpp: Copied from JavaScriptCore/kjs/string_object.cpp.
3248 * kjs/StringPrototype.h: Copied from JavaScriptCore/kjs/string_object.h.
3250 * kjs/string_object.cpp: Removed.
3251 * kjs/string_object.h: Removed.
3253 2008-06-28 Jan Michael Alonzo <jmalonzo@webkit.org>
3255 Gtk build fix: JSVariableObject is now part of AllInOne
3259 2008-06-28 Darin Adler <darin@apple.com>
3263 - https://bugs.webkit.org/show_bug.cgi?id=19801
3264 add a feature so we can tell what regular expressions are taking time
3266 * pcre/pcre_compile.cpp:
3267 (jsRegExpCompile): Compile in the string if REGEXP_HISTOGRAM is on.
3269 * pcre/pcre_exec.cpp:
3270 (jsRegExpExecute): Add hook to time execution.
3271 (Histogram::~Histogram): Print a sorted list of what took time.
3272 (Histogram::add): Accumulate records of what took time.
3273 (HistogramTimeLogger::~HistogramTimeLogger): Hook that calls
3274 Histogram::add at the right moment and creates the global histogram
3277 * pcre/pcre_internal.h: Define REGEXP_HISTOGRAM.
3279 * pcre/pcre_tables.cpp: Added missing include of "config.h". Not needed
3280 any more, but an omissions an earlier version of this patch detected.
3281 * pcre/pcre_ucp_searchfuncs.cpp: Ditto.
3282 * pcre/pcre_xclass.cpp: Ditto.
3284 2008-06-28 Sam Weinig <sam@webkit.org>
3286 Try and fix the Windows build again.
3288 * kjs/RegExpObject.cpp:
3289 * kjs/date_object.cpp:
3290 * kjs/error_object.cpp:
3292 2008-06-28 Sam Weinig <sam@webkit.org>
3294 Rubber-stamped by Darin Adler.
3296 Remove unused StringConstructorFunction class.
3298 * kjs/string_object.h:
3300 2008-06-28 Sam Weinig <sam@webkit.org>
3304 * kjs/ArrayPrototype.cpp:
3305 * kjs/BooleanPrototype.cpp:
3306 * kjs/BooleanPrototype.h:
3307 * kjs/FunctionPrototype.cpp:
3308 * kjs/JSImmediate.cpp:
3310 * kjs/MathObject.cpp:
3311 * kjs/NumberPrototype.cpp:
3312 * kjs/NumberPrototype.h:
3313 * kjs/ObjectConstructor.cpp:
3314 * kjs/RegExpObject.h:
3315 * kjs/error_object.h:
3316 * kjs/string_object.cpp:
3318 2008-06-28 Sam Weinig <sam@webkit.org>
3320 Rubber-stamped by Oliver Hunt.
3322 Splits FunctionConstructor out of FunctionPrototype.h/cpp
3323 Splits NumberConstructor and NumberPrototype out of NumberObject.h/cpp
3324 Rename object_object.h/cpp to ObjectPrototype.h/cpp and split out ObjectConstructor.
3326 * API/JSCallbackConstructor.cpp:
3327 * API/JSClassRef.cpp:
3328 * API/JSObjectRef.cpp:
3329 * DerivedSources.make:
3331 * JavaScriptCore.pri:
3332 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3333 * JavaScriptCore.xcodeproj/project.pbxproj:
3334 * JavaScriptCoreSources.bkl:
3336 * kjs/AllInOneFile.cpp:
3337 * kjs/ArrayConstructor.cpp:
3338 * kjs/ArrayConstructor.h:
3339 * kjs/FunctionConstructor.cpp: Copied from JavaScriptCore/kjs/FunctionPrototype.cpp.
3340 * kjs/FunctionConstructor.h: Copied from JavaScriptCore/kjs/FunctionPrototype.h.
3341 * kjs/FunctionPrototype.cpp:
3342 * kjs/FunctionPrototype.h:
3343 * kjs/JSFunction.cpp:
3344 * kjs/JSGlobalObject.cpp:
3345 * kjs/JSImmediate.cpp:
3347 * kjs/NumberConstructor.cpp: Copied from JavaScriptCore/kjs/NumberObject.cpp.
3348 * kjs/NumberConstructor.h: Copied from JavaScriptCore/kjs/NumberObject.h.
3349 * kjs/NumberObject.cpp:
3350 * kjs/NumberObject.h:
3351 * kjs/NumberPrototype.cpp: Copied from JavaScriptCore/kjs/NumberObject.cpp.
3352 * kjs/NumberPrototype.h: Copied from JavaScriptCore/kjs/NumberObject.h.
3353 * kjs/ObjectConstructor.cpp: Copied from JavaScriptCore/kjs/object_object.cpp.
3354 * kjs/ObjectConstructor.h: Copied from JavaScriptCore/kjs/object_object.h.
3355 * kjs/ObjectPrototype.cpp: Copied from JavaScriptCore/kjs/object_object.cpp.
3356 * kjs/ObjectPrototype.h: Copied from JavaScriptCore/kjs/object_object.h.
3357 * kjs/RegExpObject.h:
3359 * kjs/error_object.h:
3362 * kjs/object_object.cpp: Removed.
3363 * kjs/object_object.h: Removed.
3364 * kjs/string_object.h:
3366 2008-06-28 Darin Adler <darin@apple.com>
3370 - fix https://bugs.webkit.org/show_bug.cgi?id=19796
3371 optimize expressions with ignored results (especially post-increment)
3373 SunSpider says 0.9% faster.
3375 * VM/CodeGenerator.h:
3376 (KJS::CodeGenerator::tempDestination): Create a new temporary for
3377 ignoredResult() too, just as we would for 0.
3378 (KJS::CodeGenerator::finalDestination): Use the temporary if the
3379 register passed in is ignoredResult() too, just as we would for 0.
3380 (KJS::CodeGenerator::destinationForAssignResult): Return 0 if the
3381 passed in register is ignoredResult(), just as we would for 0.
3382 (KJS::CodeGenerator::moveToDestinationIfNeeded): Return 0 if the
3383 register passed in is ignoredResult(). What matters is that we
3384 don't want to emit a move. The return value won't be looked at.
3385 (KJS::CodeGenerator::emitNode): Allow ignoredResult() and pass it
3386 through to the node's emitCode function.
3389 (KJS::ignoredResult): Added. Special value to indicate the result of
3390 a node will be ignored and need not be put in any register.
3393 (KJS::NullNode::emitCode): Do nothing if dst == ignoredResult().
3394 (KJS::BooleanNode::emitCode): Ditto.
3395 (KJS::NumberNode::emitCode): Ditto.
3396 (KJS::StringNode::emitCode): Ditto.
3397 (KJS::RegExpNode::emitCode): Ditto.
3398 (KJS::ThisNode::emitCode): Ditto.
3399 (KJS::ResolveNode::emitCode): Do nothing if dst == ignoredResult() and
3400 the identifier resolves to a local variable.
3401 (KJS::ObjectLiteralNode::emitCode): Do nothing if dst == ignoredResult()
3402 and the object is empty.
3403 (KJS::PostIncResolveNode::emitCode): If dst == ignoredResult(), then do
3404 nothing for the local constant case, and do a pre-increment in all the
3406 (KJS::PostDecResolveNode::emitCode): Ditto.
3407 (KJS::PostIncBracketNode::emitCode): Ditto.
3408 (KJS::PostDecBracketNode::emitCode): Ditto.
3409 (KJS::PostIncDotNode::emitCode): Ditto.
3410 (KJS::PostDecDotNode::emitCode): Ditto.
3411 (KJS::DeleteValueNode::emitCode): Pass ignoredResult() when evaluating
3413 (KJS::VoidNode::emitCode): Ditto.
3414 (KJS::TypeOfResolveNode::emitCode): If dst == ignoredResult(), do nothing
3415 if the identifier resolves to a local variable, and don't bother generating
3416 a typeof opcode in the other case.
3417 (KJS::TypeOfValueNode::emitCode): Ditto.
3418 (KJS::PreIncResolveNode::emitCode): Do nothing if dst == ignoredResult() and
3419 the identifier resolves to a local constant.
3420 (KJS::PreDecResolveNode::emitCode): Ditto.
3421 (KJS::AssignResolveNode::emitCode): Turn ignoredResult() into 0 in a couple
3422 places, because we need to put the result into a register so we can assign
3423 it. At other sites this is taken care of by functions like finalDestination.
3424 (KJS::CommaNode::emitCode): Pass ignoredResult() when evaluating the first
3426 (KJS::ForNode::emitCode): Pass ignoredResult() when evaluating the first and
3428 (KJS::ForInNode::emitCode): Pass ignoredResult() when evaluating the first
3431 2008-06-28 Darin Adler <darin@apple.com>
3435 - https://bugs.webkit.org/show_bug.cgi?id=19787
3436 create most arrays from values in registers rather than with multiple put operations
3438 SunSpider says 0.8% faster.
3441 (KJS::CodeBlock::dump): Added argv and argc parameters to new_array.
3443 (KJS::Machine::privateExecute): Ditto.
3445 * VM/CodeGenerator.cpp:
3446 (KJS::CodeGenerator::emitNewArray): Added.
3447 * VM/CodeGenerator.h: Added ElementNode* argument to emitNewArray.
3450 (KJS::ArrayNode::emitCode): Pass the ElementNode to emitNewArray so it can be
3451 initialized with as many elements as possible. If the array doesn't have any
3452 holes in it, that's all that's needed. If there are holes, then emit some separate
3453 put operations for the other values in the array and for the length as needed.
3455 * kjs/nodes.h: Added some accessors to ElementNode so the code generator can
3456 iterate through elements and generate code to evaluate them. Now ArrayNode does
3457 not need to be a friend. Also took out some unused PlacementNewAdoptType
3460 2008-06-28 Darin Adler <darin@apple.com>
3464 * kjs/nodes.h: Remove obsolete PlacementNewAdopt constructors.
3465 We no longer mutate the AST in place.
3467 2008-06-28 Jan Michael Alonzo <jmalonzo@webkit.org>
3469 Reviewed by Oliver Hunt.
3473 * VM/Machine.cpp: include stdio.h for printf
3475 2008-06-27 Sam Weinig <sam@webkit.org>
3477 Reviewed by Oliver Hunt.
3479 Fix platforms that don't use AllInOne.cpp
3481 * kjs/BooleanConstructor.h:
3482 * kjs/BooleanPrototype.h:
3483 * kjs/FunctionPrototype.cpp:
3485 2008-06-27 Sam Weinig <sam@webkit.org>
3487 Rubber-stamped by Oliver Hunt.
3489 Splits ArrayConstructor out of ArrayPrototype.h/cpp
3490 Splits BooleanConstructor and BooleanPrototype out of BooleanObject.h/cpp
3493 * JavaScriptCore.pri:
3494 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3495 * JavaScriptCore.xcodeproj/project.pbxproj:
3496 * JavaScriptCoreSources.bkl:
3498 * kjs/AllInOneFile.cpp:
3499 * kjs/ArrayConstructor.cpp: Copied from kjs/ArrayPrototype.cpp.
3500 * kjs/ArrayConstructor.h: Copied from kjs/ArrayPrototype.h.
3501 * kjs/ArrayPrototype.cpp:
3502 * kjs/ArrayPrototype.h:
3503 * kjs/BooleanConstructor.cpp: Copied from kjs/BooleanObject.cpp.
3504 * kjs/BooleanConstructor.h: Copied from kjs/BooleanObject.h.
3505 * kjs/BooleanObject.cpp:
3506 * kjs/BooleanObject.h:
3507 * kjs/BooleanPrototype.cpp: Copied from kjs/BooleanObject.cpp.
3508 * kjs/BooleanPrototype.h: Copied from kjs/BooleanObject.h.
3509 * kjs/CommonIdentifiers.h:
3510 * kjs/FunctionPrototype.cpp:
3512 * kjs/JSGlobalObject.cpp:
3513 * kjs/JSImmediate.cpp:
3517 * kjs/string_object.cpp:
3519 2008-06-27 Oliver Hunt <oliver@apple.com>
3523 Bug 18626: SQUIRRELFISH: support the "slow script" dialog <https://bugs.webkit.org/show_bug.cgi?id=18626>
3524 <rdar://problem/5973931> Slow script dialog needs to be reimplemented for squirrelfish
3526 Adds support for the slow script dialog in squirrelfish. This requires the addition
3527 of three new op codes, op_loop, op_loop_if_true, and op_loop_if_less which have the
3528 same behaviour as their simple jump equivalents but have an additional time out check.
3530 Additional assertions were added to other jump instructions to prevent accidentally
3531 creating loops with jump types that do not support time out checks.
3533 Sunspider does not report a regression, however this appears very sensitive to code
3534 layout and hardware, so i would expect up to a 1% regression on other systems.
3536 Part of this required moving the old timeout logic from JSGlobalObject and into Machine
3537 which is the cause of a number of the larger diff blocks.
3539 * JavaScriptCore.exp:
3541 (KJS::CodeBlock::dump):
3542 * VM/CodeGenerator.cpp:
3543 (KJS::CodeGenerator::emitJumpIfTrue):
3544 (KJS::CodeGenerator::emitJumpScopes):
3545 * VM/ExceptionHelpers.cpp:
3546 (KJS::InterruptedExecutionError::isWatchdogException):
3547 (KJS::createInterruptedExecutionException):
3548 * VM/ExceptionHelpers.h:
3551 (KJS::Machine::Machine):
3552 (KJS::Machine::throwException):