1 2008-08-06 Ariya Hidayat <ariya.hidayat@trolltech.com>
5 * wtf/RetainPtr.h: CoreFoundation only for PLATFORM(MAC)
7 2008-08-06 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
9 Reviewed by Darin. Landed by Cameron.
11 Bug 20272: typo in JavaScriptCore
12 <https://bugs.webkit.org/show_bug.cgi?id=20272>
14 Correct the documentation for op_not. (typo)
18 (KJS::Machine::privateExecute):
20 2008-08-06 Cameron Zwarich <cwzwarich@webkit.org>
24 Bug 20286: Load constants all at once instead of using op_load
25 <https://bugs.webkit.org/show_bug.cgi?id=20286>
27 Load constants all at once into temporary registers instead of using
28 individual instances of op_load.
30 This is a 2.6% speedup on SunSpider.
34 (KJS::CodeBlock::dump):
35 (KJS::CodeBlock::mark):
37 * VM/CodeGenerator.cpp:
38 (KJS::CodeGenerator::CodeGenerator):
39 (KJS::CodeGenerator::newTemporary):
40 (KJS::CodeGenerator::addConstant):
41 (KJS::CodeGenerator::addUnexpectedConstant):
42 (KJS::CodeGenerator::emitLoad):
43 (KJS::CodeGenerator::emitUnexpectedLoad):
44 (KJS::CodeGenerator::emitNewError):
47 (KJS::slideRegisterWindowForCall):
48 (KJS::Machine::unwindCallFrame):
49 (KJS::Machine::throwException):
50 (KJS::Machine::execute):
51 (KJS::Machine::privateExecute):
55 (KJS::RegisterID::RegisterID):
56 (KJS::RegisterID::makeConstant):
57 (KJS::RegisterID::isTemporary):
60 (KJS::Parser::didFinishParsing):
65 (KJS::NullNode::emitCode):
66 (KJS::BooleanNode::emitCode):
67 (KJS::NumberNode::emitCode):
68 (KJS::StringNode::emitCode):
69 (KJS::ArrayNode::emitCode):
70 (KJS::DeleteResolveNode::emitCode):
71 (KJS::DeleteValueNode::emitCode):
72 (KJS::VoidNode::emitCode):
73 (KJS::ConstDeclNode::emitCodeSingle):
74 (KJS::ReturnNode::emitCode):
75 (KJS::ScopeNode::ScopeNode):
76 (KJS::ProgramNode::ProgramNode):
77 (KJS::ProgramNode::create):
78 (KJS::EvalNode::EvalNode):
79 (KJS::EvalNode::create):
80 (KJS::FunctionBodyNode::FunctionBodyNode):
81 (KJS::FunctionBodyNode::create):
82 (KJS::FunctionBodyNode::emitCode):
84 (KJS::ScopeNode::neededConstants):
86 2008-08-05 Maciej Stachowiak <mjs@apple.com>
90 - add fast path for immediates to % operator, as we have for many other math ops
92 This fixes handling for a 0 divisor relative to the last patch. Only an 0.2% speedup on SunSpider but
93 still a 1.4x win on Oliver's prime test.
96 (KJS::Machine::privateExecute):
98 2008-08-05 Cameron Zwarich <cwzwarich@uwaterloo.ca>
102 Bug 20293: Crash in JavaScript codegen for eval("const a;")
103 <https://bugs.webkit.org/show_bug.cgi?id=20293>
105 Correctly handle constant declarations in eval code with no initializer.
108 (KJS::ConstDeclNode::emitCodeSingle):
110 2008-08-05 Cameron Zwarich <cwzwarich@uwaterloo.ca>
114 Roll out r35555 because of correctness issues.
117 (KJS::Machine::privateExecute):
119 2008-08-05 Maciej Stachowiak <mjs@apple.com>
123 - add fast path for immediates to % operator, as we have for many other math ops
125 0.6% speedup on SunSpider. 1.4x speedup on a prime testing torture test that Oliver whipped up.
128 (KJS::Machine::privateExecute):
130 2008-07-31 Oliver Hunt <oliver@apple.com>
132 Reviewed by Cameron Zwarich.
134 Bug 19359: JavaScriptCore behaves differently from FF2/3 and IE when handling context in catch statement
135 <https://bugs.webkit.org/show_bug.cgi?id=19359>
137 Make our catch behave like Firefox and IE, we do this by using a StaticScopeObject
138 instead of a generic JSObject for the scope node. We still don't make use of the
139 fact that we have a static scope inside the catch block, so the internal performance
140 of the catch block is not improved, even though technically it would be possible to
144 (KJS::CodeBlock::dump):
145 * VM/CodeGenerator.cpp:
146 (KJS::CodeGenerator::emitPushNewScope):
147 * VM/CodeGenerator.h:
149 (KJS::createExceptionScope):
150 (KJS::Machine::privateExecute):
153 * kjs/JSStaticScopeObject.cpp:
154 (KJS::JSStaticScopeObject::toThisObject):
155 (KJS::JSStaticScopeObject::put):
156 * kjs/JSStaticScopeObject.h:
158 (KJS::TryNode::emitCode):
160 2008-08-02 Rob Gowin <robg@gowin.net>
162 Reviewed by Eric Seidel.
164 Added JavaScriptCore/API/WebKitAvailability to list of files in
165 javascriptcore_h_api.
169 2008-08-01 Alexey Proskuryakov <ap@webkit.org>
171 Rubber-stamped by Maciej.
173 Remove JSGlobalData::DataInstance. It was only needed when we had per-thread JSGlobalData
176 * kjs/JSGlobalData.h:
178 2008-07-31 Kevin Ollivier <kevino@theolliviers.com>
180 Second attempt at Windows/wx build fix. Instead of avoiding inclusion of windows.h,
181 use defines, etc. to avoid conflicts in each affected file. Also, change PLATFORM(WIN)
182 to PLATFORM(WIN_OS) so that other ports using Windows headers get the right impls.
184 * VM/SamplingTool.cpp:
187 2008-07-31 Anders Carlsson <andersca@apple.com>
194 * wtf/FastMalloc.cpp:
196 2008-07-31 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
200 Bug 20170: [Qt] missing namespace defines in JavaScriptCore.pro
201 <https://bugs.webkit.org/show_bug.cgi?id=20170>
203 * JavaScriptCore.pro: Added missing define.
205 2008-07-31 Alexey Proskuryakov <ap@webkit.org>
207 Rubber-stamped by Maciej.
209 Eliminate JSLock (it was already disabled, removing the stub implementaion and all
214 (JSCheckScriptSyntax):
216 * API/JSCallbackConstructor.cpp:
217 (KJS::constructJSCallback):
218 * API/JSCallbackFunction.cpp:
219 (KJS::JSCallbackFunction::call):
220 * API/JSCallbackObjectFunctions.h:
222 (KJS::::getOwnPropertySlot):
224 (KJS::::deleteProperty):
226 (KJS::::hasInstance):
228 (KJS::::getPropertyNames):
231 (KJS::::staticValueGetter):
232 (KJS::::callbackGetter):
233 * API/JSContextRef.cpp:
234 (JSGlobalContextCreateInGroup):
235 (JSGlobalContextRetain):
236 (JSGlobalContextRelease):
237 * API/JSObjectRef.cpp:
239 (JSObjectMakeFunctionWithCallback):
240 (JSObjectMakeConstructor):
241 (JSObjectMakeFunction):
242 (JSObjectHasProperty):
243 (JSObjectGetProperty):
244 (JSObjectSetProperty):
245 (JSObjectGetPropertyAtIndex):
246 (JSObjectSetPropertyAtIndex):
247 (JSObjectDeleteProperty):
248 (JSObjectCallAsFunction):
249 (JSObjectCallAsConstructor):
250 (JSObjectCopyPropertyNames):
251 (JSPropertyNameArrayRelease):
252 (JSPropertyNameAccumulatorAddName):
253 * API/JSStringRef.cpp:
255 * API/JSValueRef.cpp:
257 (JSValueIsInstanceOfConstructor):
261 (JSValueToStringCopy):
265 * ForwardingHeaders/JavaScriptCore/JSLock.h: Removed.
267 * JavaScriptCore.exp:
268 * JavaScriptCore.order:
269 * JavaScriptCore.pri:
270 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
271 * JavaScriptCore.xcodeproj/project.pbxproj:
272 * JavaScriptCoreSources.bkl:
273 * kjs/AllInOneFile.cpp:
274 * kjs/JSGlobalData.cpp:
275 (KJS::JSGlobalData::JSGlobalData):
276 * kjs/JSGlobalData.h:
277 * kjs/JSGlobalObject.cpp:
278 (KJS::JSGlobalObject::~JSGlobalObject):
279 (KJS::JSGlobalObject::init):
280 * kjs/JSLock.cpp: Removed.
281 * kjs/JSLock.h: Removed.
287 (KJS::Heap::heapAllocate):
288 (KJS::Heap::setGCProtectNeedsLocking):
289 (KJS::Heap::protect):
290 (KJS::Heap::unprotect):
291 (KJS::Heap::collect):
292 * kjs/identifier.cpp:
293 * kjs/interpreter.cpp:
294 (KJS::Interpreter::checkSyntax):
295 (KJS::Interpreter::evaluate):
297 2008-07-31 Alexey Proskuryakov <ap@webkit.org>
299 Rubber-stamped by Oliver Hunt.
301 Fix the Mac project to not display "test/" as part of file name for tests.
303 * JavaScriptCore.xcodeproj/project.pbxproj:
305 2008-07-31 Eric Seidel <eric@webkit.org>
307 Reviewed by Alexey Proskuryakov.
309 Rename USE(MULTIPLE_THREADS) to ENABLE(JSC_MULTIPLE_THREADS)
310 to better match the use/enable pattern (and better describe
311 the usage of the feature in question.)
313 I also fixed a couple other ENABLE_ macros to be pre-processor
314 definition override-able to match the rest of the ENABLE_ macros
315 since it seems to be our convention that build systems can set
316 ENABLE_ macros in Makefiles.
318 * kjs/InitializeThreading.cpp:
319 (KJS::initializeThreadingOnce):
320 * kjs/JSGlobalData.cpp:
321 (KJS::JSGlobalData::JSGlobalData):
322 (KJS::JSGlobalData::~JSGlobalData):
323 * kjs/MathObject.cpp:
327 (KJS::allocateBlock):
328 (KJS::Heap::markStackObjectsConservatively):
335 * wtf/FastMalloc.cpp:
337 * wtf/RefCountedLeakCounter.cpp:
339 2008-07-30 Eric Seidel <eric@webkit.org>
341 Reviewed by Mark Rowe.
343 Try to clean up our usage of USE(MULTIPLE_THREADS) vs. USE(PTHREADS) a little.
344 It looks like JSC assumes that if MULTIPLE_THREADS is defined, then pthreads will always be available
345 I'm not sure that's always the case for gtk, certainly not for Windows. We should eventually go back
346 and fix wtf/Threading.h to cover all these cases some day.
352 2008-07-30 Eric Seidel <eric@webkit.org>
356 MSVC warns when structs are called classes or vice versa.
357 Make all the source refer to JSGlobalData as a class.
359 * kjs/CommonIdentifiers.h:
360 * kjs/JSGlobalData.h:
364 2008-07-30 Alexey Proskuryakov <ap@webkit.org>
366 Reviewed by Geoff Garen.
368 Add consistency checks to UString to document and enforce its design.
371 (KJS::UString::Rep::create):
372 (KJS::UString::Rep::destroy):
373 (KJS::UString::Rep::checkConsistency):
374 (KJS::UString::expandCapacity):
375 (KJS::UString::expandPreCapacity):
376 (KJS::UString::UString):
377 (KJS::UString::spliceSubstringsWithSeparators):
378 (KJS::UString::append):
380 (KJS::UString::Rep::checkConsistency):
382 2008-07-30 Gavin Barraclough <barraclough@apple.com>
384 Reviewed by Geoff Garen.
386 Fixes for Windows and non-AllInOne file build with SamplingTool, plus review fixes.
388 * GNUmakefile.am: Adding SamplingTool.cpp to build.
389 * JavaScriptCore.exp: Export hooks to init & control SamplingTool.
390 * JavaScriptCore.pri: Adding SamplingTool.cpp to build.
391 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Adding SamplingTool.cpp to build.
392 * JavaScriptCore.xcodeproj/project.pbxproj: Adding SamplingTool.cpp to build.
393 * JavaScriptCoreSources.bkl: Adding SamplingTool.cpp to build.
394 * VM/Machine.cpp: MACHINE_SAMPLING_callingNativeFunction renamed MACHINE_SAMPLING_callingHostFunction
396 * VM/Opcode.cpp: SamplingTool moved to SamplingTool.cpp/.h, opcodeNames generated from FOR_EACH_OPCODE_ID.
398 * VM/SamplingTool.cpp: Added .cpp/.h for SamplingTool.
400 * kjs/Shell.cpp: Switched SAMPLING_TOOL_ENABLED to ENABLE_SAMPLING_TOOL.
401 * wtf/Platform.h: Added ENABLE_SAMPLING_TOOL config option.
402 * kjs/nodes.cpp: Header include to fix non-AllInOne builds.
404 2008-07-30 Ariya Hidayat <ariya.hidayat@trolltech.com>
406 Reviewed by Alexey Proskuryakov.
408 Fix compilation without multi-threading support.
413 2008-07-30 Anders Carlsson <andersca@apple.com>
415 Add WebKitAvailability.h forwarding header.
417 * ForwardingHeaders/JavaScriptCore/WebKitAvailability.h: Added.
419 2008-07-30 Anders Carlsson <andersca@apple.com>
423 * API/WebKitAvailability.h:
425 2008-07-30 Anders Carlsson <andersca@apple.com>
427 * API/WebKitAvailability.h:
428 Fix Windows (and other non-Mac builds).
430 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
431 Add WebKitAvailability.h to the project.
433 2008-07-30 Anders Carlsson <andersca@apple.com>
435 One step closer towards fixing the Windows build.
437 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
438 Make sure to copy WebKitAvailability.h
440 2008-07-29 Gavin Barraclough <barraclough@apple.com>
442 Reviewed by Geoff Garen.
444 Bug 20209: Atomize constant strings
445 <https://bugs.webkit.org/show_bug.cgi?id=20209>
447 Prevents significant performance degradation seen when a script contains multiple
448 identical strings that are used as keys to identify properties on objects.
450 No performance change on SunSpider.
452 * kjs/nodes.cpp: Atomize constant strings.
454 2008-07-30 Oliver Hunt <oliver@apple.com>
456 Reviewed by Alexey Proskuryakov.
458 <rdar://problem/6111648> JavaScript exceptions fail if the scope chain includes the global object
460 In an attempt to remove the branch I just added to KJS::depth I
461 used the existence of a Variable Object at a point in the scope
462 chain as an indicator of function or global scope activation.
463 However this assumption results in incorrect behaviour if the
464 global object is injected into the scope chain with 'with'.
469 2008-07-30 Alexey Proskuryakov <ap@webkit.org>
471 Reviewed by Geoff Garen.
473 Don't call JSGarbageCollect() on a released context.
475 * API/testapi.c: (main):
477 2008-07-29 Alexey Proskuryakov <ap@webkit.org>
479 Reviewed by Geoff Garen.
481 Implement JSContextGroup APIs to make concurrent execution possible for
482 JavaScriptCore clients.
484 This changes the behavior of JSGlobalContextCreate(), so that it now uses a private context
485 group for each context, making JSlock implicit locking unnecessary.
487 * API/JSContextRef.h:
488 * API/JSContextRef.cpp:
489 (JSContextGroupCreate):
490 (JSContextGroupRetain):
491 (JSContextGroupRelease):
492 (JSGlobalContextCreate):
493 (JSGlobalContextCreateInGroup):
494 (JSGlobalContextRelease):
496 Added new methods. JSGlobalContextCreate() calls JSGlobalContextCreateInGroup() now.
498 * API/APICast.h: (toJS): (toRef): Added converters for JSContextGroupRef.
499 * API/JSBase.cpp: (JSGarbageCollect): JSGarbageCollect(0) is now a no-op, and the passed in
500 context is actually used.
502 * API/JSBase.h: Aded a typedef for JSContextGroupRef. Updated documentation for
505 * JavaScriptCore.exp: Removed JSGlobalData::sharedInstance().
507 * kjs/JSGlobalData.cpp:
508 * kjs/JSGlobalData.h:
509 Removed support for JSGlobalData shared instance. JSGlobalData::isSharedInstance member
510 variable still remains, to be deleted in a followup patch.
512 * kjs/JSLock.cpp: (KJS::JSLock::JSLock): Disabled JSLock, to be deleted in a follow-up patch.
515 (KJS::Heap::markOtherThreadConservatively): Removed an assertion that referenced
516 JSGlobalData::sharedInstance.
518 * kjs/collector.h: Made Heap destructor public, so that JSContextRelease can use it.
520 2008-07-29 Alexey Proskuryakov <ap@webkit.org>
522 Reviewed by Geoff Garen.
524 Fix a leak of ThreadRegistrar objects.
526 As the heap is usually deleted when registered threads still exist, ThreadSpecific doesn't
527 have a chance to clean up per-thread object. Switched to native pthread calls, storing a
528 plain pointer that doesn't require cleanup.
531 (KJS::PlatformThread::PlatformThread):
532 (KJS::Heap::Thread::Thread):
535 (KJS::Heap::registerThread):
536 (KJS::Heap::unregisterThread):
539 2008-07-29 Alexey Proskuryakov <ap@webkit.org>
541 Reviewed by Sam Weinig.
543 https://bugs.webkit.org/show_bug.cgi?id=20169
544 Memory allocated with fastMalloc is freed with delete
546 * VM/JSPropertyNameIterator.cpp:
547 (KJS::JSPropertyNameIterator::invalidate): Free the array properly.
548 (KJS::JSPropertyNameIterator::~JSPropertyNameIterator): Delete the array by calling
551 2008-07-29 Mark Rowe <mrowe@apple.com>
553 Attempt to fix the Qt build.
555 * wtf/ThreadingQt.cpp: Add the extra argument to createThread.
557 2008-07-29 Adam Roben <aroben@apple.com>
559 Change Vector::find to return an index instead of an iterator
561 Indices are more natural than iterators when working with Vector.
563 Reviewed by John Sullivan.
566 (WTF::Vector::find): Changed to iterate the Vector manually and return
567 the index of the found item, rather than an iterator. When the item
568 could not be found, we return WTF::notFound.
570 2008-07-29 Adam Roben <aroben@apple.com>
574 * wtf/ThreadingWin.cpp:
575 (WTF::setThreadName): Move a misplaced assertion to here...
576 (WTF::createThread): ...from here.
578 2008-07-29 Adam Roben <aroben@apple.com>
580 Add support for setting thread names on Windows
582 These thread names make it much easier to identify particular threads
583 in Visual Studio's Threads panel.
585 WTF::createThread now takes a const char* representing the thread's
586 name. On Windows, we throw a special exception to set this string as
587 the thread's name. Other platforms do nothing with this name for now.
589 Reviewed by Anders Carlsson.
591 * JavaScriptCore.exp: Export the new version of createThread that
592 takes 3 arguments (the old one continues to be exported for backward
594 * wtf/Threading.h: Add a threadName argument to createThread.
596 * wtf/ThreadingGtk.cpp:
598 * wtf/ThreadingNone.cpp:
600 Updated for function signature change.
602 * wtf/ThreadingPthreads.cpp:
603 (WTF::createThread): Updated for function signature change. We keep
604 around the old 2-argument version of createThread for backward
607 * wtf/ThreadingWin.cpp:
608 (WTF::setThreadName): Added. This function's implementation came from
610 (WTF::initializeThreading): Set the name of the main thread.
611 (WTF::createThread): Call setThreadName. We keep around the old
612 2-argument version of createThread for backward compatibility.
614 2008-07-29 Alexey Proskuryakov <ap@webkit.org>
616 Reviewed by Oliver Hunt.
618 Store UString::Rep::isStatic bit in identifierTable pointer instead of reportedCost for
619 slightly nicer code and a 0.5% SunSpider improvement.
621 * API/JSClassRef.cpp:
622 (OpaqueJSClass::~OpaqueJSClass):
623 (OpaqueJSClassContextData::OpaqueJSClassContextData):
624 * API/JSStringRef.cpp:
626 * kjs/PropertyNameArray.cpp:
627 (KJS::PropertyNameArray::add):
628 * kjs/identifier.cpp:
629 (KJS::IdentifierTable::~IdentifierTable):
630 (KJS::IdentifierTable::add):
631 (KJS::Identifier::addSlowCase):
632 (KJS::Identifier::remove):
634 (KJS::Identifier::add):
637 (KJS::UString::Rep::create):
638 (KJS::UString::Rep::destroy):
640 (KJS::UString::Rep::identifierTable):
641 (KJS::UString::Rep::setIdentifierTable):
642 (KJS::UString::Rep::isStatic):
643 (KJS::UString::Rep::setStatic):
644 (KJS::UString::cost):
646 2008-07-28 Geoffrey Garen <ggaren@apple.com>
648 Reviewed by Sam Weinig.
650 Renamed "ConstructTypeNative" => "ConstructTypeHost".
652 2008-07-26 Mark Rowe <mrowe@apple.com>
654 Speculative fix for the wx build.
656 * JavaScriptCoreSources.bkl: Add JSStaticScopeObject.cpp to the list of source files.
658 2008-07-25 Oliver Hunt <oliver@apple.com>
662 Whoops, forgot to save style correction.
664 * kjs/JSStaticScopeObject.h:
666 2008-07-25 Oliver Hunt <oliver@apple.com>
668 Reviewed by Cameron Zwarich.
670 Bug 19718: Named anonymous functions are slow accessing global variables
671 <https://bugs.webkit.org/show_bug.cgi?id=19718>
673 To fix this we switch over to an activation-like scope object for
674 on which we attach the function name property, and add logic to
675 prevent cross scope assignment to read only properties.
678 * JavaScriptCore.pri:
679 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
680 * JavaScriptCore.xcodeproj/project.pbxproj:
681 * VM/CodeGenerator.cpp:
682 (KJS::CodeGenerator::findScopedProperty):
683 (KJS::CodeGenerator::emitResolve):
684 * VM/CodeGenerator.h:
685 * kjs/AllInOneFile.cpp:
686 * kjs/JSStaticScopeObject.cpp: Added.
687 (KJS::JSStaticScopeObject::putWithAttributes):
688 (KJS::JSStaticScopeObject::isDynamicScope):
689 (KJS::JSStaticScopeObject::~JSStaticScopeObject):
690 (KJS::JSStaticScopeObject::getOwnPropertySlot):
691 * kjs/JSStaticScopeObject.h: Added.
692 (KJS::JSStaticScopeObject::JSStaticScopeObjectData::JSStaticScopeObjectData):
693 (KJS::JSStaticScopeObject::JSStaticScopeObject):
695 (KJS::FunctionCallResolveNode::emitCode):
696 (KJS::PostfixResolveNode::emitCode):
697 (KJS::PrefixResolveNode::emitCode):
698 (KJS::ReadModifyResolveNode::emitCode):
699 (KJS::AssignResolveNode::emitCode):
700 (KJS::FuncExprNode::makeFunction):
702 2008-07-25 kevino <kevino@theolliviers.com>
704 wx build fix for Win.
706 On wx/Win, including windows.h in Threading.h causes multiply-defined symbol errors
707 for libjpeg and wx, and also wx needs to include windows.h itself first for wx
708 includes to work right. So until we can find a better solution to this problem,
709 on wx, we work around the need to include windows.h here.
713 2008-07-25 Adam Roben <aroben@apple.com>
717 * JavaScriptCore.vcproj/testapi/testapi.vcproj: Add API/ to the
720 2008-07-25 Simon Hausmann <hausmann@webkit.org>
722 Fix the build of jsc on Qt/Windows, make sure os-win32 is in the
723 include search path (added by WebKit.pri).
727 2008-07-25 Alexey Proskuryakov <ap@webkit.org>
729 Reviewed by Simon Hausmann.
731 Move JavaScriptCore API tests into a subdirectory of their own to avoid header name
732 conflicts and developer confusion.
734 * API/JSNode.c: Removed.
735 * API/JSNode.h: Removed.
736 * API/JSNodeList.c: Removed.
737 * API/JSNodeList.h: Removed.
738 * API/Node.c: Removed.
739 * API/Node.h: Removed.
740 * API/NodeList.c: Removed.
741 * API/NodeList.h: Removed.
742 * API/minidom.c: Removed.
743 * API/minidom.html: Removed.
744 * API/minidom.js: Removed.
745 * API/testapi.c: Removed.
746 * API/testapi.js: Removed.
748 * API/tests/JSNode.c: Copied from JavaScriptCore/API/JSNode.c.
749 * API/tests/JSNode.h: Copied from JavaScriptCore/API/JSNode.h.
750 * API/tests/JSNodeList.c: Copied from JavaScriptCore/API/JSNodeList.c.
751 * API/tests/JSNodeList.h: Copied from JavaScriptCore/API/JSNodeList.h.
752 * API/tests/Node.c: Copied from JavaScriptCore/API/Node.c.
753 * API/tests/Node.h: Copied from JavaScriptCore/API/Node.h.
754 * API/tests/NodeList.c: Copied from JavaScriptCore/API/NodeList.c.
755 * API/tests/NodeList.h: Copied from JavaScriptCore/API/NodeList.h.
756 * API/tests/minidom.c: Copied from JavaScriptCore/API/minidom.c.
757 * API/tests/minidom.html: Copied from JavaScriptCore/API/minidom.html.
758 * API/tests/minidom.js: Copied from JavaScriptCore/API/minidom.js.
759 * API/tests/testapi.c: Copied from JavaScriptCore/API/testapi.c.
760 * API/tests/testapi.js: Copied from JavaScriptCore/API/testapi.js.
762 * JavaScriptCore.vcproj/testapi/testapi.vcproj:
763 * JavaScriptCore.xcodeproj/project.pbxproj:
765 2008-07-25 Simon Hausmann <hausmann@webkit.org>
767 Prospective WX build fix, add JavaScriptCore/API to the include search
772 2008-07-25 Simon Hausmann <hausmann@webkit.org>
774 Rubber-stamped by Lars.
776 Fix the build on Windows. operator new for ArgList is implemented using fastMalloc()
777 but operator delete was not implemented. Unfortunately MSVC decides to call/reference
778 the function, so a simple implementation using fastFree() fixes the build.
781 (KJS::ArgList::operator delete):
783 2008-07-25 Simon Hausmann <hausmann@webkit.org>
785 Discussed with and rubber-stamped by Lars.
787 Fix the build system for the Qt port.
789 Recent JavaScriptCore changes require the addition of JavaScriptCore/API to the
790 include search path. With a build process that combines JavaScriptCore and
791 WebCore in one build process/Makefile the existance of
792 JavaScriptCore/API/Node.h and WebCore/dom/Node.h causes include conflicts.
794 This commit solves this by introducing a separate build of JavaScriptCore into
797 As a result of the split-up a race-condition due to broken dependencies of
798 regular source files to header files of generated sources showed up very
799 frequently when doing parallel builds (which the buildbot does). This commit at
800 the same time tries to address the dependency problem by making the
801 addExtraCompiler() function also generate a pseudo extra compiler that
802 represents the header file output, so that qmake is aware of the creation of
803 the header file for dependency calculation.
805 At the same time I removed a lot of cruft from the pro files to ease maintenance.
807 * JavaScriptCore.pri:
808 * JavaScriptCore.pro: Added.
811 2008-07-24 Geoffrey Garen <ggaren@apple.com>
813 Reviewed by Maciej Stachowiak.
815 Fixed a strict aliasing violation, which caused hash tables with floating
816 point keys not to find items that were indeed in the tables
817 (intermittently, and only in release builds, of course).
819 SunSpider reports no change.
821 This bug doesn't seem to affect any existing code, but it causes obvious
822 crashes in some new code I'm working on.
824 * wtf/HashFunctions.h:
825 (WTF::FloatHash::hash): Use a union when punning between a float / double
826 and an unsigned (bucket of bits). With strict aliasing enabled, unions
827 are the only safe way to do this kind of type punning.
829 * wtf/HashTable.h: When rehashing, ASSERT that the item we just added to
830 the table is indeed in the table. In the buggy case described above, this
833 2008-07-24 Oliver Hunt <oliver@apple.com>
835 Reviewed by Alexey Proskuryakov.
837 Bug 20142: REGRESSION(r35245): /=/ weirdness
838 <https://bugs.webkit.org/show_bug.cgi?id=20142>
840 When adding all the meta data needed for exception error messages
841 I accidentally clobbered the handling of regex beginning with /=.
845 2008-07-23 Alp Toker <alp@nuanti.com>
847 Build fix after r35293: Add API/ to the include path.
851 2008-07-23 Adam Roben <aroben@apple.com>
855 Build fix after r35293:
857 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add API/
860 Build fix after r35305:
866 Completely compile out all sampler-related code when
867 SAMPLING_TOOL_ENABLED is 0. The sampler code can't be compiled 1) on
868 non-AllInOne configurations due to circular header dependencies, and
869 2) on platforms that don't have a usleep() function, such as Windows.
871 2008-07-23 Oliver Hunt <oliver@apple.com>
873 Reviewed by Geoff Garen and Sam Weinig.
875 Improve switch performance.
877 Improve switch performance by converting to a hashmap based jump
878 table to avoid the sequence of dispatches that would otherwise be
879 needed. This results in a 9-19x performance win for string switches
880 based on ad hoc testing, and a 6x improvement for integer switch
881 statements. SunSpider reports a 1.2% progression.
884 (KJS::CodeBlock::dump):
885 (KJS::SimpleJumpTable::offsetForValue):
887 * VM/CodeGenerator.cpp:
888 (KJS::CodeGenerator::beginSwitch):
889 (KJS::prepareJumpTableForImmediateSwitch):
890 (KJS::prepareJumpTableForCharacterSwitch):
891 (KJS::prepareJumpTableForStringSwitch):
892 (KJS::CodeGenerator::endSwitch):
893 * VM/CodeGenerator.h:
895 (KJS::offsetForStringSwitch):
896 (KJS::Machine::privateExecute):
903 (KJS::processClauseList):
904 (KJS::CaseBlockNode::tryOptimisedSwitch):
905 (KJS::CaseBlockNode::emitCodeForBlock):
909 2008-07-23 Gavin Barraclough <barraclough@apple.com>
911 Reviewed by Geoff Garen.
913 Sampling tool to analyze cost of instruction execution and identify hot regions of JS code.
914 Enable Switches by setting SAMPLING_TOOL_ENABLED in Opcode.h.
916 * JavaScriptCore.exp: Export symbols for Shell.cpp.
917 * VM/Machine.cpp: Added sampling hooks.
918 * VM/Machine.h: Machine contains a pointer to a sampler, when sampling.
919 * VM/Opcode.cpp: Tool implementation.
920 * VM/Opcode.h: Tool declaration.
921 * kjs/Shell.cpp: Initialize the sampler, if enabled.
922 * kjs/nodes.cpp: Added sampling hooks.
924 2008-07-23 Gabor Loki <loki@inf.u-szeged.hu>
926 Bug 20097: [Qt] 20% Sunspider slow-down
928 <https://bugs.webkit.org/show_bug.cgi?id=20097>
930 Reviewed by Simon Hausmann.
932 * kjs/jsc.pro: Added missing NDEBUG define for release builds.
934 2008-07-23 Alexey Proskuryakov <ap@webkit.org>
936 Reviewed by Geoff Garen.
938 JSClassRef is created context-free, but gets infatuated with the first context it sees.
940 The implicit API contract is that JSClassRef can be used with any context on any thread.
941 This no longer worked, because UStrings in the class were turned into per-context
942 identifiers, and the cached JSObject prototype was tied to JSGlobalData, too.
944 * API/JSClassRef.h: Made a separate struct for context-dependent parts of OpaqueJSClass.
945 * API/JSClassRef.cpp:
946 (OpaqueJSClass::OpaqueJSClass): Updated for renames and changed member variable order.
947 (OpaqueJSClass::~OpaqueJSClass): Assert that string members are not identifiers.
948 (clearReferenceToPrototype): Update for the new reference location.
949 (OpaqueJSClassContextData::OpaqueJSClassContextData): Make a deep copy of all strings.
950 (OpaqueJSClass::contextData): Added a function that finds the per-context part of
951 OpaqueJSClass in JSGlobalData, or creates it if not found.
952 (OpaqueJSClass::className): Always make a deep copy. Callers of this function do not have
953 a way to access JSGlobalData, so a per-context copy could not be made.
954 (OpaqueJSClass::staticValues): Updated for new data location.
955 (OpaqueJSClass::staticFunctions): Ditto.
956 (OpaqueJSClass::prototype): Changed to take an internal type for consistency.
958 * kjs/JSGlobalData.cpp:
959 (KJS::JSGlobalData::JSGlobalData):
960 (KJS::JSGlobalData::~JSGlobalData):
961 * kjs/JSGlobalData.h:
962 Keep a HashMap to access per-context JSClass data given a pointr to the shared part.
964 * API/JSCallbackObjectFunctions.h:
966 (KJS::::getOwnPropertySlot):
968 (KJS::::deleteProperty):
969 (KJS::::getPropertyNames):
970 (KJS::::staticValueGetter):
971 (KJS::::staticFunctionGetter):j
972 Use function accessors instead of accessing OpaqueJSClass members directly.
974 * API/JSContextRef.cpp: (JSGlobalContextCreate): Updated for the change in
975 OpaqueJSClass::prototype() argument type.
977 * API/JSObjectRef.cpp:
978 (JSObjectMake): Updated for the change in OpaqueJSClass::prototype() argument type.
979 (JSObjectMakeConstructor): Ditto.
981 2008-07-23 Alexey Proskuryakov <ap@webkit.org>
985 * kjs/ArgList.h: (KJS::ArgList::operator new): removed an extraneous "ArgList::" inside the
988 2008-07-22 Geoffrey Garen <ggaren@apple.com>
990 Reviewed by Oliver Hunt and Sam Weinig.
992 Next step toward putting doubles in registers: Prepare the Register class
993 and its clients for registers that don't contain JSValue*s.
995 This means a few things:
997 1. Register::jsValue() clients, including ArgList clients, must now supply
998 an ExecState* when accessing an entry in an ArgList, in case the entry
999 will need to create a JSValue* on the fly.
1001 2. Register clients that definitely don't want to create a JSValue* on
1002 the fly now use different APIs: getJSValue() for clients that know
1003 the register contains a JSValue*, and v() for clients who just want a
1006 3. I had to change some headers around in order to resolve dependency
1007 problems created by using a Register in the ArgList header.
1009 SunSpider reports no change.
1011 2008-07-22 Gavin Barraclough <barraclough@apple.com>
1013 Reviewed by Alexey Proskuryakov.
1015 Prevent integer overflow when reallocating storage vector for arrays.
1017 Sunspider reports 1.005x as fast (no change expected).
1021 2008-07-21 Mark Rowe <mrowe@apple.com>
1023 Reviewed by Sam Weinig.
1025 <rdar://problem/6091287> Revamp the handling of CFBundleShortVersionString to be fixed at the major component of the version number.
1027 * Configurations/Version.xcconfig:
1030 2008-07-21 Adam Roben <aroben@apple.com>
1034 This is a convenience wrapper around std::find.
1036 Reviewed by Anders Carlsson.
1040 2008-07-19 Oliver Hunt <oliver@apple.com>
1042 Reviewed by Cameron Zwarich.
1044 Bug 20104: Exception in tables/mozilla_expected_failures/bugs/bug92868_1.html includes the equals operator in the quoted expression
1045 <https://bugs.webkit.org/show_bug.cgi?id=20104>
1047 To make this correct we make the dot and bracket assign nodes emit the information to indicate
1048 the failure range is the dot/bracket accessor.
1052 2008-07-18 Steve Falkenburg <sfalken@apple.com>
1056 * kjs/JSGlobalObjectFunctions.cpp:
1057 (KJS::isStrWhiteSpace):
1059 2008-07-18 Steve Falkenburg <sfalken@apple.com>
1064 (KJS::ThrowableExpressionData::ThrowableExpressionData):
1066 2008-07-18 Oliver Hunt <oliver@apple.com>
1068 Reviewed by Cameron Zwarich.
1070 Bug 18774: SQUIRRELFISH: print meaningful error messages <https://bugs.webkit.org/show_bug.cgi?id=18774>
1071 <rdar://problem/5769353> SQUIRRELFISH: JavaScript error messages are missing informative text
1073 Add support for decent error messages in JavaScript. This patch achieves this by providing
1074 ensuring the common errors and exceptions have messages that provide the text of expression
1075 that trigger the exception. In addition it attaches a number of properties to the exception
1076 object detailing where in the source the expression came from.
1078 * JavaScriptCore.exp:
1080 (KJS::CodeBlock::lineNumberForVPC):
1081 (KJS::CodeBlock::expressionRangeForVPC):
1082 Function to recover the expression range for an instruction
1083 that triggered an exception.
1085 (KJS::ExpressionRangeInfo::):
1086 (KJS::CodeBlock::CodeBlock):
1087 * VM/CodeGenerator.cpp:
1088 (KJS::CodeGenerator::emitCall):
1089 (KJS::CodeGenerator::emitCallEval):
1090 Emit call needed to be modified so to place the expression range info internally,
1091 as the CodeGenerator emits the arguments nodes itself, rather than the various call
1093 * VM/CodeGenerator.h:
1094 (KJS::CodeGenerator::emitExpressionInfo):
1095 Record the expression range info.
1096 * VM/ExceptionHelpers.cpp:
1097 (KJS::createErrorMessage):
1098 (KJS::createInvalidParamError):
1099 (KJS::createUndefinedVariableError):
1100 (KJS::createNotAConstructorError):
1101 (KJS::createNotAFunctionError):
1102 (KJS::createNotAnObjectErrorStub):
1103 (KJS::createNotAnObjectError):
1104 Rewrite all the code for the error messages so that they make use of the newly available
1106 * VM/ExceptionHelpers.h:
1108 (KJS::isNotObject): Now needs vPC and codeBlock
1109 (KJS::Machine::throwException):
1110 New logic to handle the NotAnObjectErrorStub and to handle the absurd "no default value" edge case
1111 (KJS::Machine::privateExecute):
1113 * kjs/DebuggerCallFrame.cpp:
1114 (KJS::DebuggerCallFrame::evaluate):
1116 (KJS::Error::create):
1118 * kjs/JSGlobalObjectFunctions.cpp:
1119 * kjs/JSImmediate.cpp:
1120 (KJS::JSImmediate::toObject):
1121 (KJS::JSImmediate::prototype):
1122 My changes to the JSNotAnObject constructor needed to be handled here.
1123 * kjs/JSNotAnObject.h:
1124 (KJS::JSNotAnObjectErrorStub::JSNotAnObjectErrorStub):
1125 (KJS::JSNotAnObjectErrorStub::isNull):
1126 (KJS::JSNotAnObjectErrorStub::isNotAnObjectErrorStub):
1127 Added a JSNotAnObjectErrorStub class to ease the handling of toObject failure exceptions,
1128 and potentially allow even more detailed error messages in future.
1131 (KJS::Parser::parse):
1132 * kjs/SourceRange.h:
1134 Large amounts of position propagation.
1136 (KJS::Lexer::Lexer):
1137 (KJS::Lexer::shift):
1139 The lexer needed a few changes to be able to correctly track token character positions.
1142 (KJS::ThrowableExpressionData::emitThrowError):
1143 (KJS::StatementNode::StatementNode):
1144 (KJS::ResolveNode::emitCode):
1145 (KJS::BracketAccessorNode::emitCode):
1146 (KJS::DotAccessorNode::emitCode):
1147 (KJS::NewExprNode::emitCode):
1148 (KJS::EvalFunctionCallNode::emitCode):
1149 (KJS::FunctionCallValueNode::emitCode):
1150 (KJS::FunctionCallResolveNode::emitCode):
1151 (KJS::FunctionCallBracketNode::emitCode):
1152 (KJS::FunctionCallDotNode::emitCode):
1153 (KJS::PostfixResolveNode::emitCode):
1154 (KJS::PostfixBracketNode::emitCode):
1155 (KJS::PostfixDotNode::emitCode):
1156 (KJS::DeleteResolveNode::emitCode):
1157 (KJS::DeleteBracketNode::emitCode):
1158 (KJS::DeleteDotNode::emitCode):
1159 (KJS::PrefixResolveNode::emitCode):
1160 (KJS::PrefixBracketNode::emitCode):
1161 (KJS::PrefixDotNode::emitCode):
1162 (KJS::ThrowableBinaryOpNode::emitCode):
1163 (KJS::ReadModifyResolveNode::emitCode):
1164 (KJS::AssignResolveNode::emitCode):
1165 (KJS::AssignDotNode::emitCode):
1166 (KJS::ReadModifyDotNode::emitCode):
1167 (KJS::AssignBracketNode::emitCode):
1168 (KJS::ReadModifyBracketNode::emitCode):
1169 (KJS::ForInNode::ForInNode):
1170 (KJS::ForInNode::emitCode):
1171 (KJS::WithNode::emitCode):
1172 (KJS::LabelNode::emitCode):
1173 (KJS::ThrowNode::emitCode):
1174 (KJS::ProgramNode::ProgramNode):
1175 (KJS::ProgramNode::create):
1176 (KJS::EvalNode::generateCode):
1177 (KJS::FunctionBodyNode::create):
1178 (KJS::FunctionBodyNode::generateCode):
1179 (KJS::ProgramNode::generateCode):
1180 All of these methods were handling the position information.
1181 Constructors and create methods were modified to store the information.
1182 All the emitCall implementations listed needed to be updated to actually
1183 record the position information we have so carefully collected.
1185 (KJS::ThrowableExpressionData::ThrowableExpressionData):
1186 (KJS::ThrowableExpressionData::setExceptionSourceRange):
1187 (KJS::ThrowableExpressionData::divot):
1188 (KJS::ThrowableExpressionData::startOffset):
1189 (KJS::ThrowableExpressionData::endOffset):
1190 (KJS::ThrowableSubExpressionData::ThrowableSubExpressionData):
1191 (KJS::ThrowableSubExpressionData::setSubexpressionInfo):
1192 (KJS::ThrowablePrefixedSubExpressionData::ThrowablePrefixedSubExpressionData):
1193 (KJS::ThrowablePrefixedSubExpressionData::setSubexpressionInfo):
1194 ThrowableExpressionData is just a uniform mechanism for storing the position
1196 (KJS::ResolveNode::):
1197 (KJS::PrePostResolveNode::):
1198 (KJS::ThrowableBinaryOpNode::):
1201 2008-07-18 Geoffrey Garen <ggaren@apple.com>
1203 Reviewed by Cameron Zwarich.
1207 "CallTypeNative" => "CallTypeHost"
1208 "code" => "byteCode"
1209 "generatedCode" => "generatedByteCode"
1211 2008-07-18 Geoffrey Garen <ggaren@apple.com>
1213 Reviewed by Oliver Hunt.
1215 Optimized <= for immediate number cases.
1217 SunSpider reports no overall change, but a 10% speedup on access-nsieve.
1219 2008-07-18 Mark Rowe <mrowe@apple.com>
1221 Rubber-stamped by Sam Weinig.
1223 Fix some casts added in a previous build fix to match the style used
1227 (KJS::Machine::initializeCallFrame):
1229 (KJS::Register::Register):
1231 2008-07-18 Landry Breuil <landry@openbsd.org>
1233 Bug 19975: [OpenBSD] Patches to enable build of WebKit
1235 <https://bugs.webkit.org/show_bug.cgi?id=19975>
1237 Reviewed by David Kilzer.
1239 Support for OpenBSD, mostly threading and libm tweaks.
1241 * kjs/collector.cpp: #include <pthread.h>
1242 (KJS::currentThreadStackBase): use pthread_stackseg_np() to get stack base
1243 * kjs/config.h: OpenBSD also provides <pthread_np.h>
1244 * wtf/MathExtras.h: #include <sys/types.h> and <machine/ieee.h>
1245 (isfinite), (signbit): as long as we don't have those functions provide fallback implementations
1246 * wtf/Platform.h: Add support for PLATFORM(OPENBSD) and PLATFORM(SPARC64) macro
1248 2008-07-17 Geoffrey Garen <ggaren@apple.com>
1250 Reviewed by Oliver Hunt.
1252 Next step toward putting doubles in registers: Store constant pool
1253 entries as registers, not JSValue*s.
1255 SunSpider reports no change.
1257 2008-07-17 Geoffrey Garen <ggaren@apple.com>
1259 Reviewed by John Sullivan and Oliver Hunt.
1261 A tiny bit of tidying in function call register allocation.
1263 This patch saves one register when invoking a function expression and/or
1264 a new expression that is stored in a temporary.
1266 Since it's just one register, I can't make a testcase for it.
1268 * VM/CodeGenerator.cpp:
1269 (KJS::CodeGenerator::emitCall): No need to ref the function we're calling
1270 or its base. We'd like the call frame to overlap with them, if possible.
1271 op_call will read the function and its base before writing the call frame,
1275 (KJS::NewExprNode::emitCode): No need to ref the function we're new-ing,
1276 for the same reasons stated above.
1278 (KJS::FunctionCallValueNode::emitCode): ditto
1280 2008-07-17 Steve Falkenburg <sfalken@apple.com>
1284 * kjs/InternalFunction.cpp:
1286 2008-07-17 Sam Weinig <sam@webkit.org>
1288 Roll out r35199 as it is causing failures on the PPC build.
1290 2008-07-17 Geoffrey Garen <ggaren@apple.com>
1292 Reviewed by David Kilzer.
1294 Fixed https://bugs.webkit.org/show_bug.cgi?id=20067
1295 Support function.name (Firefox extension)
1297 Pretty straight-forward.
1299 2008-07-17 Geoffrey Garen <ggaren@apple.com>
1301 Reviewed by Oliver Hunt.
1303 Fixed <rdar://problem/6081636> Functions calls use more temporary
1304 registers than necessary
1306 Holding a reference to the last statement result register caused each
1307 successive statement to output its result to an even higher register.
1309 Happily, statements don't actually need to return a result register
1310 at all. I hope to make this clearer in a future cleanup patch,
1311 but this change will fix the major bug for now.
1314 (KJS::statementListEmitCode):
1316 2008-07-17 Gavin Barraclough <barraclough@apple.com>
1318 Reviewed by Sam Weinig.
1320 Merge pre&post dot nodes to simplify the parse tree.
1321 Sunspider results show 0.6% progression (no performance change expected).
1326 * kjs/nodes2string.cpp:
1328 2008-07-17 Gavin Barraclough <barraclough@apple.com>
1330 Reviewed by Cameron Zwarich.
1332 Merge pre&post resolve nodes to simplify the parse tree.
1333 Sunspider results show no performance change.
1338 * kjs/nodes2string.cpp:
1340 2008-07-17 Gavin Barraclough <barraclough@apple.com>
1342 Reviewed by Cameron Zwarich.
1344 Merge logical nodes to simplify the parse tree.
1345 Sunspider results show 0.6% progression (no performance change expected).
1350 * kjs/nodes2string.cpp:
1352 2008-07-17 Ariya Hidayat <ariya.hidayat@trolltech.com>
1356 Fix MinGW build (broken in r35198) and simplify getLocalTime().
1359 (KJS::getLocalTime):
1361 2008-07-17 Gavin Barraclough <barraclough@apple.com>
1363 Reviewed by Sam Weinig.
1365 Merge pre&post bracket nodes to simplify the parse tree.
1366 Sunspider results show no performance change.
1371 * kjs/nodes2string.cpp:
1373 2008-07-17 Ariya Hidayat <ariya.hidayat@trolltech.com>
1377 Fix the 32-bit gcc builds, conversion from "long int" to Register is
1378 ambiguous. Explicitly choose the intptr_t constructor.
1381 (KJS::Machine::initializeCallFrame):
1383 (KJS::Register::Register):
1385 2008-07-16 Mark Rowe <mrowe@apple.com>
1387 Rubber-stamped by Geoff Garen.
1389 Fix JavaScript in 64-bit by using a pointer-sized integer
1390 type in the Register union. Also includes a rename of
1391 the intType constant to IntType.
1394 (KJS::Machine::initializeCallFrame):
1397 (KJS::Register::Register):
1399 2008-07-17 Geoffrey Garen <ggaren@apple.com>
1401 Reviewed by Oliver Hunt.
1403 First step toward putting doubles in registers: Turned Register into a
1404 proper abstraction layer. It is no longer possible to cast a Register
1405 to a JSValue*, or a Register& to a JSValue*&, or to access the union
1406 inside a Register directly.
1408 SunSpider reports no change.
1410 In support of this change, I had to make the following mechanical changes
1413 1. Clients now use explicit accessors to read data out of Registers, and
1414 implicit copy constructors to write data into registers.
1416 So, assignment that used to look like
1424 And access that used to look like
1432 2. I made generic flow control specific in opcodes that made their flow
1433 control generic by treating a Register& as a JSValue*&. This had the
1434 added benefit of removing some exception checking branches from immediate
1437 3. I beefed up PropertySlot to support storing a Register* in a property
1438 slot. For now, only JSVariableObject's symbolTableGet and symbolTablePut
1439 use this functionality, but I expect more clients to use it in the future.
1441 4. I changed ArgList to be a buffer of Registers, not JSValue*'s, and I
1442 changed ArgList iterator clients to iterate Registers, not JSValue*'s.
1444 2008-07-16 Ada Chan <adachan@apple.com>
1448 * kjs/JSGlobalObject.cpp:
1450 2008-07-16 Kevin McCullough <kmccullough@apple.com>
1452 Reviewed by Sam and Geoff.
1454 <rdar://problem/5958840> Navigating to another page while profiler is
1455 attached results in slow JavaScript for all time.
1457 - The UNLIKELY keeps this from being a sunspider performance regression.
1459 * kjs/JSGlobalObject.cpp:
1460 (KJS::JSGlobalObject::~JSGlobalObject): Stop the profiler associated
1461 with this exec state.
1463 2008-07-16 Sam Weinig <sam@webkit.org>
1465 Reviewed by Steve Falkenburg.
1467 Replace adopting UString constructor in favor of explicit
1468 static adopt method.
1470 * API/JSStringRefCF.cpp:
1471 (JSStringCreateWithCFString):
1472 * kjs/StringConstructor.cpp:
1473 (KJS::stringFromCharCode):
1474 * kjs/StringPrototype.cpp:
1475 (KJS::stringProtoFuncToLowerCase):
1476 (KJS::stringProtoFuncToUpperCase):
1477 (KJS::stringProtoFuncToLocaleLowerCase):
1478 (KJS::stringProtoFuncToLocaleUpperCase):
1480 (KJS::UString::adopt):
1482 (KJS::UString::UString):
1483 (KJS::UString::~UString):
1485 2008-07-16 Ariya Hidayat <ariya.hidayat@trolltech.com>
1489 http://trolltech.com/developer/task-tracker/index_html?method=entry&id=216179
1490 Fix potential crash (on Qt for Windows port) when performing JavaScript date
1494 (KJS::getLocalTime): For the Qt port, prefer to use Windows code, i.e.
1495 localtime_s() instead of localtime() since the latter might crash (on Windows)
1496 given a non-sensible, e.g. NaN, argument.
1498 2008-07-16 Alexey Proskuryakov <ap@webkit.org>
1500 Reviewed by Anders and Geoff.
1502 https://bugs.webkit.org/show_bug.cgi?id=20023
1503 Failed assertion in PropertyNameArray.cpp
1505 This is already tested by testapi.
1507 * API/JSObjectRef.cpp: (JSPropertyNameAccumulatorAddName): Add the string to identifier
1508 table to appease PropertyNameArray.
1510 2008-07-16 Alexey Proskuryakov <ap@webkit.org>
1514 Dereference identifiers when deleting a hash table (fixes leaks with private JSGlobalData
1517 * kjs/JSGlobalData.cpp: (KJS::JSGlobalData::~JSGlobalData):
1518 * kjs/lookup.cpp: (KJS::HashTable::deleteTable):
1520 * kjs/lexer.cpp: (KJS::Lexer::~Lexer)
1521 HashTable cannot have a destructor, because check-for-global-initializers complains about
1522 having a global constructor then.
1524 2008-07-16 Alexey Proskuryakov <ap@webkit.org>
1528 Check pthread_key_create return value.
1530 This check was helpful when debugging a crash in run-webkit-tests --threaded that happened
1531 because JSGlobalData objects were not deleted, and we were running out of pthread keys soon.
1532 It also looks useful for production builds.
1534 * wtf/ThreadSpecific.h: (WTF::::ThreadSpecific):
1536 2008-07-15 Kevin McCullough <kmccullough@apple.com>
1540 Rename pageGroupIdentifier to profileGroup to keep mention of a
1541 pageGroup out of JavaScriptCore.
1543 * kjs/JSGlobalObject.cpp:
1544 (KJS::JSGlobalObject::init):
1545 * kjs/JSGlobalObject.h:
1546 (KJS::JSGlobalObject::setProfileGroup):
1547 (KJS::JSGlobalObject::profileGroup):
1548 * profiler/ProfileGenerator.cpp:
1549 (KJS::ProfileGenerator::create):
1550 (KJS::ProfileGenerator::ProfileGenerator):
1551 * profiler/ProfileGenerator.h:
1552 (KJS::ProfileGenerator::profileGroup):
1553 * profiler/Profiler.cpp:
1554 (KJS::Profiler::startProfiling):
1555 (KJS::dispatchFunctionToProfiles):
1556 (KJS::Profiler::willExecute):
1557 (KJS::Profiler::didExecute):
1559 2008-07-14 Mark Rowe <mrowe@apple.com>
1561 Reviewed by Sam Weinig.
1563 Fix https://bugs.webkit.org/show_bug.cgi?id=20037
1564 Bug 20037: GCC 4.2 build broken due to strict aliasing violation.
1567 (KJS::UString::Rep::computeHash): Add a version of computeHash that takes a char* and explicit length.
1569 * profiler/CallIdentifier.h:
1570 (WTF::): Use new version of computeHash that takes a char* and explicit length to avoid unsafe aliasing.
1572 2008-07-14 David Hyatt <hyatt@apple.com>
1574 Fix a crashing bug in ListHashSet's -- operator. Make sure that end() can be -- by special-casing the null
1579 * wtf/ListHashSet.h:
1580 (WTF::ListHashSetConstIterator::operator--):
1582 2008-07-14 David Hyatt <hyatt@apple.com>
1584 Buidl fix. Make sure the second insertBefore method returns a value.
1586 * wtf/ListHashSet.h:
1587 (WTF::::insertBefore):
1589 2008-07-14 Adam Roben <aroben@apple.com>
1593 * JavaScriptCore.vcproj/jsc/jsc.vcproj: Added include/pthreads to the
1596 2008-07-14 Alexey Proskuryakov <ap@webkit.org>
1598 Reviewed by Kevin McCullough.
1600 Make JSGlobalData refcounted in preparation to adding a way to create contexts that share
1603 * JavaScriptCore.exp:
1604 * kjs/JSGlobalData.cpp:
1605 (KJS::JSGlobalData::create):
1606 * kjs/JSGlobalData.h:
1607 Made contructor private, and added a static create() method. Made the class inherit from
1610 * kjs/JSGlobalObject.h:
1611 (KJS::JSGlobalObject::globalData):
1612 JSGlobalData is now owned by JSGlobalObject (except for the shared one, and the common
1613 WebCore one, which are never deleted).
1615 * kjs/Shell.cpp: (main): Create JSGlobalData with create() method.
1617 2008-07-14 Simon Hausmann <hausmann@webkit.org>
1619 Fix the single-threaded build.
1621 * kjs/JSLock.cpp: Removed undeclared registerThread() function.
1622 * kjs/collector.cpp:
1623 (KJS::Heap::registerThread): Added dummy implementation.
1625 2008-07-14 Alexey Proskuryakov <ap@webkit.org>
1627 Reviewed by Geoff Garen.
1629 Eliminate per-thread JavaScript global data instance support and make arbitrary
1630 global data/global object combinations possible.
1632 * kjs/collector.cpp:
1633 (KJS::Heap::Heap): Store a JSGlobalData pointer instead of multiple pointers to its members.
1634 This allows for going from any JS object to its associated global data, currently used in
1635 JSGlobalObject constructor to initialize its JSGlobalData pointer.
1636 (KJS::Heap::registerThread): Changed thread registration data to be per-heap. Previously,
1637 only the shared heap could be used from multiple threads, so it was the only one that needed
1638 thread registration, but now this can happen to any heap.
1639 (KJS::Heap::unregisterThread): Ditto.
1640 (KJS::Heap::markStackObjectsConservatively): Adapt for the above changes.
1641 (KJS::Heap::setGCProtectNeedsLocking): Ditto.
1642 (KJS::Heap::protect): Ditto.
1643 (KJS::Heap::unprotect): Ditto.
1644 (KJS::Heap::collect): Ditto.
1645 (KJS::Heap::globalObjectCount): Use global object list associated with the current heap,
1646 not the late per-thread one.
1647 (KJS::Heap::protectedGlobalObjectCount): Ditto.
1650 (KJS::Heap::ThreadRegistrar): Added a helper object that unregisters a thread when it is
1654 (KJS::JSLock::JSLock):
1656 (KJS::JSLock::JSLock):
1657 Don't use JSLock to implicitly register threads. I've added registerThread() calls to most
1658 places that use JSLock - we cannot guarantee absolute safety unless we always mark all
1659 threads in the process, but these implicit registration calls should cover reasonable usage
1663 (JSEvaluateScript): Explicitly register the current thread.
1664 (JSCheckScriptSyntax): Explicitly register the current thread.
1665 (JSGarbageCollect): Changed to use the passed in context. Unfortunately, this creates a race
1666 condition for clients that pass an already released context to JSGarbageCollect - but it is
1667 unlikely to create real life problems.
1668 To maintain compatibility, the shared heap is collected if NULL is passed.
1670 * API/JSContextRef.cpp:
1671 (JSGlobalContextCreate): Use a new syntax for JSGlobalObject allocation.
1672 (JSGlobalContextRetain): Register the thread.
1673 (JSContextGetGlobalObject): Register the thread.
1675 * API/JSObjectRef.cpp:
1677 (JSObjectMakeFunctionWithCallback):
1678 (JSObjectMakeConstructor):
1679 (JSObjectMakeFunction):
1680 (JSObjectHasProperty):
1681 (JSObjectGetProperty):
1682 (JSObjectSetProperty):
1683 (JSObjectGetPropertyAtIndex):
1684 (JSObjectSetPropertyAtIndex):
1685 (JSObjectDeleteProperty):
1686 (JSObjectCallAsFunction):
1687 (JSObjectCallAsConstructor):
1688 (JSObjectCopyPropertyNames):
1689 (JSPropertyNameAccumulatorAddName):
1690 * API/JSValueRef.cpp:
1692 (JSValueIsInstanceOfConstructor):
1693 (JSValueMakeNumber):
1694 (JSValueMakeString):
1696 (JSValueToStringCopy):
1700 Register the thread.
1702 * API/JSStringRef.cpp: (JSStringRelease): Changed a comment to not mention per-thread contexts.
1704 * API/JSStringRefCF.cpp: Removed an unnecessary include of JSLock.h.
1706 * JavaScriptCore.exp: Export JSGlobalData constructor/destructor, now that anyone can have
1707 their own instances. Adapt to other changes, too.
1709 * JavaScriptCore.xcodeproj/project.pbxproj: Made ThreadSpecific.h private, as it is now
1710 included by collector.h and is thus needed in other projects.
1712 * kjs/InitializeThreading.cpp: (KJS::initializeThreadingOnce): Don't initialize per-thread
1713 global data, as it no longer exists.
1715 * kjs/JSGlobalData.cpp:
1716 (KJS::JSGlobalData::JSGlobalData):
1717 (KJS::JSGlobalData::~JSGlobalData):
1718 * kjs/JSGlobalData.h:
1719 Removed support for per-thread instance. Made constructor and destructor public.
1721 * kjs/JSGlobalObject.cpp: (KJS::JSGlobalObject::init): Get to now arbitrary JSGlobalData
1723 (KJS::JSGlobalObject::operator new): Changed ot take JSGlobalDatra pointer.
1724 * kjs/JSGlobalObject.h:
1729 Changed to maintain a custom JSGlobalData pointer instead of a per-thread one.
1731 2008-07-13 Ada Chan <adachan@apple.com>
1733 Windows build fix: Add wtf/RefCountedLeakCounter to the project.
1735 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
1737 2008-07-12 Jan Michael Alonzo <jmalonzo@webkit.org>
1739 Gtk, Qt and Wx build fix: Add wtf/RefCountedLeakCounter in the
1743 * JavaScriptCore.pri:
1744 * JavaScriptCoreSources.bkl:
1746 2008-07-11 Stephanie Lewis <slewis@apple.com>
1748 Reviewed by Darin Adler and Oliver Hunt.
1750 Refactor RefCounting Leak counting code into a common class.
1752 In order to export the symbols I needed to put the debug defines inside the function names
1754 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.
1756 * JavaScriptCore.exp:
1757 * JavaScriptCore.xcodeproj/project.pbxproj: add new class
1758 * kjs/nodes.cpp: remove old leak counting code
1759 * wtf/RefCountedLeakCounter.cpp: Added. create a common leak counting class
1760 * wtf/RefCountedLeakCounter.h: Added.
1762 2008-07-11 David Hyatt <hyatt@apple.com>
1764 Add an insertBefore method to ListHashSet to allow for insertions in the middle of the list (rather than just
1769 * wtf/ListHashSet.h:
1770 (WTF::::insertBefore):
1771 (WTF::::insertNodeBefore):
1773 2008-07-11 Sam Weinig <sam@webkit.org>
1775 Rubber-stamped by Darin Adler.
1777 Move call function to CallData.cpp and construct to ConstructData.cpp.
1780 * JavaScriptCore.pri:
1781 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1782 * JavaScriptCore.xcodeproj/project.pbxproj:
1783 * JavaScriptCoreSources.bkl:
1784 * kjs/AllInOneFile.cpp:
1785 * kjs/CallData.cpp: Copied from kjs/JSValue.cpp.
1786 * kjs/ConstructData.cpp: Copied from kjs/JSValue.cpp.
1789 2008-07-10 Mark Rowe <mrowe@apple.com>
1791 Reviewed by Sam Weinig.
1793 Define WEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST when building WebKit to ensure that no symbols end up with the weak_import attribute.
1795 * Configurations/Base.xcconfig:
1797 2008-07-10 Mark Rowe <mrowe@apple.com>
1799 Reviewed by Sam Weinig.
1801 Fix the Tiger build by omitting annotations from methods declared in categories when using old versions of GCC.
1803 * API/WebKitAvailability.h:
1805 2008-07-10 Kevin McCullough <kmccullough@apple.com>
1809 -Minor cleanup. Renamed callTree() to head() and no longer use m_head
1810 directly but instead keep it private and access via a method().
1812 * profiler/HeavyProfile.cpp:
1813 (KJS::HeavyProfile::HeavyProfile):
1814 (KJS::HeavyProfile::generateHeavyStructure):
1815 (KJS::HeavyProfile::addNode):
1816 * profiler/Profile.h:
1817 (KJS::Profile::head):
1818 * profiler/ProfileGenerator.cpp:
1819 (KJS::ProfileGenerator::ProfileGenerator):
1821 2008-07-10 Alexey Proskuryakov <ap@webkit.org>
1823 Reviewed by Mark Rowe.
1825 Eliminate CollectorHeapIntrospector.
1827 CollectorHeapIntrospector was added primarily in the hopes to improve leaks tool output,
1828 a result that it didn't deliver. Also, it helped by labeling JSC heap regions as reported by
1829 vmmap tool, but at the same time, it made them mislabeled as malloc'd ones - the correct
1830 way to label mapped regions is to use a VM tag.
1832 So, it makes more sense to remove it completely than to make it work with multiple heaps.
1834 * JavaScriptCore.exp:
1835 * JavaScriptCore.xcodeproj/project.pbxproj:
1836 * kjs/AllInOneFile.cpp:
1837 * kjs/InitializeThreading.cpp:
1838 (KJS::initializeThreading):
1839 * kjs/collector.cpp:
1841 * kjs/CollectorHeapIntrospector.cpp: Removed.
1842 * kjs/CollectorHeapIntrospector.h: Removed.
1844 2008-07-09 Kevin McCullough <kmccullough@apple.com>
1848 <rdar://problem/5951532> JSProfiler: Implement heavy (or bottom-up)
1850 - Implemented the time and call count portionof heavy. Now all that we
1853 * profiler/CallIdentifier.h: Removed an unused constructor.
1854 * profiler/HeavyProfile.cpp:
1855 (KJS::HeavyProfile::HeavyProfile): Set the initial time of the head
1856 node so that percentages work correctly.
1857 (KJS::HeavyProfile::mergeProfiles): Sum the times and call count of
1859 * profiler/ProfileNode.cpp: Set the intital values of time and call
1860 count when copying ProfileNodes.
1861 (KJS::ProfileNode::ProfileNode):
1863 2008-07-10 Jan Michael Alonzo <jmalonzo@webkit.org>
1867 * GNUmakefile.am: Add HeavyProfile.cpp
1869 2008-07-09 Mark Rowe <mrowe@apple.com>
1871 Reviewed by Geoff Garen.
1873 Don't warn about deprecated functions in production builds.
1875 * Configurations/Base.xcconfig:
1876 * Configurations/DebugRelease.xcconfig:
1878 2008-07-09 Darin Adler <darin@apple.com>
1880 * JavaScriptCore.pri: Fix Qt build by adding HeavyProfile.cpp.
1882 2008-07-09 Kevin Ollivier <kevino@theolliviers.com>
1884 wx biuld fix. Add HeavyProfile.cpp to build files.
1886 * JavaScriptCoreSources.bkl:
1888 2008-07-09 Kevin McCullough <kmccullough@apple.com>
1890 - Windows build fix.
1892 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1894 2008-07-09 Kevin McCullough <kmccullough@apple.com>
1898 * profiler/HeavyProfile.cpp:
1899 (KJS::HeavyProfile::mergeProfiles):
1901 2008-07-09 Kevin McCullough <kmccullough@apple.com>
1903 Reviewed by Geoff and Adam.
1905 <rdar://problem/5951532> JSProfiler: Implement Bottom-Up view (19228)
1906 - This is the plumbing for bottom-up, but does not include calculating
1907 time, mostly because I'm still undclear about what the end result should
1909 - This, obviously, does not include the UI to expose this in the
1912 * JavaScriptCore.xcodeproj/project.pbxproj:
1913 * profiler/CallIdentifier.h:
1914 (KJS::CallIdentifier::CallIdentifier):
1915 (WTF::): Added HashTraits for CallIdentifiers to be used by a HashMap.
1916 * profiler/HeavyProfile.cpp: Added.
1917 (KJS::HeavyProfile::HeavyProfile):
1918 (KJS::HeavyProfile::generateHeavyStructure):
1919 (KJS::HeavyProfile::addNode):
1920 (KJS::HeavyProfile::mergeProfiles):
1921 (KJS::HeavyProfile::addAncestorsAsChildren):
1922 * profiler/HeavyProfile.h: Added.
1923 (KJS::HeavyProfile::create):
1924 (KJS::HeavyProfile::heavyProfile):
1925 (KJS::HeavyProfile::treeProfile):
1926 * profiler/Profile.cpp: Removed old commented out includes.
1927 * profiler/Profile.h: The m_head is needed by the HeavyProfile so it
1928 is now protected as opposed to private.
1929 * profiler/ProfileNode.cpp:
1930 (KJS::ProfileNode::ProfileNode): Created a constructor to copy
1932 (KJS::ProfileNode::findChild): Added a null check to make HeavyProfile
1933 children finding easier and avoid a potential crasher.
1934 * profiler/ProfileNode.h: Mostly moved things around but also added some
1935 functionality needed by HeavyProfile.
1936 (KJS::ProfileNode::create):
1937 (KJS::ProfileNode::functionName):
1938 (KJS::ProfileNode::url):
1939 (KJS::ProfileNode::lineNumber):
1940 (KJS::ProfileNode::head):
1941 (KJS::ProfileNode::setHead):
1942 (KJS::ProfileNode::setNextSibling):
1943 (KJS::ProfileNode::actualTotalTime):
1944 (KJS::ProfileNode::actualSelfTime):
1945 * profiler/TreeProfile.cpp: Implemented the ability to get a
1947 (KJS::TreeProfile::heavyProfile):
1948 * profiler/TreeProfile.h:
1950 2008-07-08 Geoffrey Garen <ggaren@apple.com>
1952 Reviewed by Oliver Hunt.
1954 Added support for checking if an object has custom properties in its
1955 property map. WebCore uses this to optimize marking DOM wrappers.
1957 2008-07-08 Simon Hausmann <hausmann@webkit.org>
1959 Prospective Gtk/Wx build fixes, add ProfileGenerator.cpp to the build.
1962 * JavaScriptCoreSources.bkl:
1964 2008-07-08 Simon Hausmann <hausmann@webkit.org>
1966 Fix the Qt build, add ProfileGenerator.cpp to the build.
1968 * JavaScriptCore.pri:
1970 2008-07-07 David Kilzer <ddkilzer@apple.com>
1972 releaseFastMallocFreeMemory() should always be defined
1976 * JavaScriptCore.exp: Changed to export C++ binding for
1977 WTF::releaseFastMallocFreeMemory() instead of C binding for
1978 releaseFastMallocFreeMemory().
1979 * wtf/FastMalloc.cpp: Moved definitions of
1980 releaseFastMallocFreeMemory() to be in the WTF namespace
1981 regardless whether FORCE_SYSTEM_MALLOC is defined.
1982 * wtf/FastMalloc.h: Moved releaseFastMallocFreeMemory() from
1983 extern "C" binding to WTF::releaseFastMallocFreeMemory().
1985 2008-07-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1989 Bug 19926: URL causes crash within a minute
1990 <https://bugs.webkit.org/show_bug.cgi?id=19926>
1992 Add a check that lastGlobalObject is non-null in Machine::execute()
1993 before copying its globals to the current register file.
1995 In theory, it is possible to make a test case for this, but it will
1996 take a while to get it right.
1999 (KJS::Machine::execute):
2001 2008-07-07 Darin Adler <darin@apple.com>
2003 Rubber stamped by Adele.
2006 (KJS::Machine::privateExecute): Fix a typo in a comment.
2008 2008-07-07 Steve Falkenburg <sfalken@apple.com>
2012 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2013 * JavaScriptCore.vcproj/testapi/testapi.vcproj:
2015 2008-07-07 Kevin McCullough <kmccullough@apple.com>
2019 When the profiler is running it gathers information and creates a
2020 Profile. After it finishes the Profile can be sorted and have other
2021 data refinements run over it. Both of these were done in the same class
2022 before. Now I split the gathering operations into a new class called
2025 * JavaScriptCore.xcodeproj/project.pbxproj:
2026 * profiler/Profile.cpp: Removed code related to the gather stage of a
2028 (KJS::Profile::create):
2029 (KJS::Profile::Profile):
2030 * profiler/Profile.h: Ditto.
2031 (KJS::Profile::title):
2032 (KJS::Profile::callTree):
2033 (KJS::Profile::setHead):
2034 * profiler/ProfileGenerator.cpp: Added. This is the class that will
2035 handle the stage of creating a Profile. Once the Profile is finished
2036 being created, this class goes away.
2037 (KJS::ProfileGenerator::create):
2038 (KJS::ProfileGenerator::ProfileGenerator):
2039 (KJS::ProfileGenerator::title):
2040 (KJS::ProfileGenerator::willExecute):
2041 (KJS::ProfileGenerator::didExecute):
2042 (KJS::ProfileGenerator::stopProfiling):
2043 (KJS::ProfileGenerator::didFinishAllExecution):
2044 (KJS::ProfileGenerator::removeProfileStart):
2045 (KJS::ProfileGenerator::removeProfileEnd):
2046 * profiler/ProfileGenerator.h: Added.
2047 (KJS::ProfileGenerator::profile):
2048 (KJS::ProfileGenerator::originatingGlobalExec):
2049 (KJS::ProfileGenerator::pageGroupIdentifier):
2050 (KJS::ProfileGenerator::client):
2051 (KJS::ProfileGenerator::stoppedProfiling):
2052 * profiler/Profiler.cpp: Now operates with the ProfileGenerator instead
2054 (KJS::Profiler::startProfiling):
2055 (KJS::Profiler::stopProfiling):
2056 (KJS::Profiler::didFinishAllExecution): It is here that the Profile is
2057 handed off to its client and the Profile Generator is no longer needed.
2058 (KJS::dispatchFunctionToProfiles):
2059 (KJS::Profiler::willExecute):
2060 (KJS::Profiler::didExecute):
2061 * profiler/Profiler.h: Cleaned up the includes and subsequently the
2062 forward declarations. Also use the new ProfileGenerator.
2063 (KJS::ProfilerClient::~ProfilerClient):
2064 (KJS::Profiler::currentProfiles):
2065 * profiler/TreeProfile.cpp: Use Profile's new interface.
2066 (KJS::TreeProfile::create):
2067 (KJS::TreeProfile::TreeProfile):
2068 * profiler/TreeProfile.h:
2070 2008-07-07 Sam Weinig <sam@webkit.org>
2072 Reviewed by Cameron Zwarich.
2074 Third step in broad cleanup effort.
2076 [ File list elided ]
2078 2008-07-06 Sam Weinig <sam@webkit.org>
2080 Reviewed by Cameron Zwarich.
2082 Second step in broad cleanup effort.
2084 [ File list elided ]
2086 2008-07-05 Sam Weinig <sam@webkit.org>
2088 Reviewed by Cameron Zwarich.
2090 First step in broad cleanup effort.
2092 [ File list elided ]
2094 2008-07-05 Sam Weinig <sam@webkit.org>
2096 Rubber-stamped by Cameron Zwarich.
2098 Rename list.h/cpp to ArgList.h/cpp.
2101 * JavaScriptCore.pri:
2102 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2103 * JavaScriptCore.xcodeproj/project.pbxproj:
2104 * JavaScriptCoreSources.bkl:
2106 * kjs/AllInOneFile.cpp:
2107 * kjs/ArgList.cpp: Copied from JavaScriptCore/kjs/list.cpp.
2108 * kjs/ArgList.h: Copied from JavaScriptCore/kjs/list.h.
2109 * kjs/IndexToNameMap.cpp:
2110 * kjs/JSGlobalData.cpp:
2111 * kjs/JSGlobalData.h:
2113 * kjs/collector.cpp:
2114 * kjs/list.cpp: Removed.
2115 * kjs/list.h: Removed.
2117 2008-07-05 Sam Weinig <sam@webkit.org>
2119 Fix non-AllInOne builds again.
2121 * kjs/BooleanPrototype.cpp:
2122 * kjs/ErrorPrototype.cpp:
2123 * kjs/FunctionPrototype.cpp:
2124 * kjs/NumberPrototype.cpp:
2125 * kjs/ObjectPrototype.cpp:
2127 2008-07-05 Sam Weinig <sam@webkit.org>
2129 Fix build on case-sensitive build systems.
2131 * kjs/IndexToNameMap.cpp:
2133 2008-07-05 Sam Weinig <sam@webkit.org>
2137 * kjs/Arguments.cpp:
2138 * kjs/BooleanPrototype.cpp:
2139 * kjs/DateConstructor.cpp:
2140 * kjs/ErrorPrototype.cpp:
2141 * kjs/FunctionPrototype.cpp:
2142 * kjs/NumberPrototype.cpp:
2143 * kjs/ObjectPrototype.cpp:
2144 * kjs/RegExpPrototype.cpp:
2145 * kjs/StringConstructor.cpp:
2148 2008-07-05 Sam Weinig <sam@webkit.org>
2150 Fix non-AllInOne build.
2152 * kjs/JSGlobalObject.cpp:
2154 2008-07-05 Sam Weinig <sam@webkit.org>
2156 Rubber-stamped by Cameron Zwarich.
2158 Split Arguments, IndexToNameMap, PrototypeFunction, GlobalEvalFunction and
2159 the functions on the global object out of JSFunction.h/cpp.
2162 * JavaScriptCore.pri:
2163 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2164 * JavaScriptCore.xcodeproj/project.pbxproj:
2165 * JavaScriptCoreSources.bkl:
2167 * kjs/AllInOneFile.cpp:
2168 * kjs/Arguments.cpp: Copied from JavaScriptCore/kjs/JSFunction.cpp.
2169 * kjs/Arguments.h: Copied from JavaScriptCore/kjs/JSFunction.h.
2170 * kjs/GlobalEvalFunction.cpp: Copied from JavaScriptCore/kjs/JSFunction.cpp.
2171 * kjs/GlobalEvalFunction.h: Copied from JavaScriptCore/kjs/JSFunction.h.
2172 * kjs/IndexToNameMap.cpp: Copied from JavaScriptCore/kjs/JSFunction.cpp.
2173 * kjs/IndexToNameMap.h: Copied from JavaScriptCore/kjs/JSFunction.h.
2174 * kjs/JSActivation.cpp:
2175 * kjs/JSFunction.cpp:
2177 * kjs/JSGlobalObject.cpp:
2178 * kjs/JSGlobalObjectFunctions.cpp: Copied from JavaScriptCore/kjs/JSFunction.cpp.
2179 * kjs/JSGlobalObjectFunctions.h: Copied from JavaScriptCore/kjs/JSFunction.h.
2180 The functions on the global object should be in JSGlobalObject.cpp, but putting them there
2181 was a 0.5% regression.
2183 * kjs/PrototypeFunction.cpp: Copied from JavaScriptCore/kjs/JSFunction.cpp.
2184 * kjs/PrototypeFunction.h: Copied from JavaScriptCore/kjs/JSFunction.h.
2189 2008-07-04 Sam Weinig <sam@webkit.org>
2191 Really fix the mac build.
2193 * JavaScriptCore.xcodeproj/project.pbxproj:
2195 2008-07-04 Sam Weinig <sam@webkit.org>
2199 * JavaScriptCore.xcodeproj/project.pbxproj:
2201 2008-07-04 Sam Weinig <sam@webkit.org>
2203 Fix non-AllInOne builds.
2206 * kjs/GetterSetter.cpp:
2207 * kjs/JSImmediate.cpp:
2208 * kjs/operations.cpp:
2210 2008-07-04 Sam Weinig <sam@webkit.org>
2212 Rubber-stamped by Dan Bernstein.
2214 Split Error and GetterSetter out of JSObject.h.
2216 * API/JSCallbackObjectFunctions.h:
2218 * JavaScriptCore.pri:
2219 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2220 * JavaScriptCore.xcodeproj/project.pbxproj:
2221 * JavaScriptCoreSources.bkl:
2222 * kjs/AllInOneFile.cpp:
2223 * kjs/ClassInfo.h: Copied from JavaScriptCore/kjs/JSObject.h.
2224 * kjs/Error.cpp: Copied from JavaScriptCore/kjs/JSObject.cpp.
2225 * kjs/Error.h: Copied from JavaScriptCore/kjs/JSObject.h.
2226 * kjs/GetterSetter.cpp:
2227 * kjs/GetterSetter.h: Copied from JavaScriptCore/kjs/JSObject.h.
2232 2008-07-04 Simon Hausmann <hausmann@webkit.org>
2234 Fix the Wx build, added TreeProfile.cpp to the build.
2236 * JavaScriptCoreSources.bkl:
2238 2008-07-03 Mark Rowe <mrowe@apple.com>
2240 Reviewed by Oliver Hunt.
2242 Fix output path of recently-added script phase to reference the correct file.
2243 This prevents Xcode from running the script phase unnecessarily, which caused
2244 the generated header to be recreated and lead to AllInOneFile.cpp rebuilding.
2246 * JavaScriptCore.xcodeproj/project.pbxproj:
2248 2008-07-03 Mark Rowe <mrowe@apple.com>
2250 Follow-up to the 64-bit build fix. Use intptr_t rather than ssize_t as
2251 the latter is non-standard and does not exist on Windows.
2254 (KJS::JSLock::lockCount):
2255 (KJS::JSLock::lock):
2256 (KJS::JSLock::unlock):
2257 (KJS::JSLock::DropAllLocks::DropAllLocks):
2260 2008-07-02 Mark Rowe <mrowe@apple.com>
2262 Fix the 64-bit build. pthread_getspecific works with pointer-sized values,
2263 so use ssize_t rather than int to track the lock count to avoid warnings about
2264 truncating the result of pthread_getspecific.
2267 (KJS::JSLock::lockCount):
2268 (KJS::JSLock::lock):
2269 (KJS::JSLock::unlock):
2270 (KJS::JSLock::DropAllLocks::DropAllLocks):
2273 2008-07-03 Geoffrey Garen <ggaren@apple.com>
2275 Reviewed by Sam Weinig.
2277 Removed checking for the array get/put fast case from the array code.
2278 Callers who want the fast case should call getIndex and/or setIndex
2279 instead. (get_by_val and put_by_val already do this.)
2281 SunSpider reports no change overall, but a 1.4% speedup on fannkuch and
2282 a 3.6% speedup on nsieve.
2284 2008-07-03 Dan Bernstein <mitz@apple.com>
2288 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Added TreeProfile.{h,cpp}.
2290 2008-07-03 Dan Bernstein <mitz@apple.com>
2292 Reviewed by Anders Carlsson.
2297 (KJS::Machine::Machine):
2299 2008-07-03 Simon Hausmann <hausmann@webkit.org>
2301 Reviewed by Alexey Proskuryakov.
2303 Fix the non-threaded build.
2305 * kjs/JSGlobalData.cpp:
2306 (KJS::JSGlobalData::threadInstanceInternal):
2308 2008-07-03 Simon Hausmann <hausmann@webkit.org>
2310 Fix the Qt build, added TreeProfile to the build.
2312 * JavaScriptCore.pri:
2314 2008-07-02 Alexey Proskuryakov <ap@webkit.org>
2318 Don't create unnecessary JSGlobalData instances.
2320 * kjs/JSGlobalData.h:
2321 * kjs/JSGlobalData.cpp:
2322 (KJS::JSGlobalData::threadInstanceExists):
2323 (KJS::JSGlobalData::sharedInstanceExists):
2324 (KJS::JSGlobalData::threadInstance):
2325 (KJS::JSGlobalData::sharedInstance):
2326 (KJS::JSGlobalData::threadInstanceInternal):
2327 (KJS::JSGlobalData::sharedInstanceInternal):
2328 Added methods to query instance existence.
2330 * kjs/InitializeThreading.cpp:
2331 (KJS::initializeThreadingOnce):
2332 Initialize thread instance static in a new way.
2336 * kjs/collector.cpp:
2337 (KJS::Heap::collect):
2338 Check for instance existence before accessing it.
2340 2008-07-02 Geoffrey Garen <ggaren@apple.com>
2342 Reviewed by Cameron Zwarich.
2344 Fixed https://bugs.webkit.org/show_bug.cgi?id=19862
2345 REGRESSION (r34907): Gmail crashes in JavaScriptCore code while editing drafts
2347 I was never able to reproduce this issue, but Cameron could, and he says
2348 that this patch fixes it.
2350 The crash seems tied to a timer or event handler callback. In such a case,
2351 the sole reference to the global object may be in the current call frame,
2352 so we can't depend on the global object to mark the call frame area in
2355 The new GC marking rule is: the global object is not responsible for
2356 marking the whole register file -- it's just responsible for the globals
2357 section it's tied to. The heap is responsible for marking the call frame area.
2359 2008-07-02 Mark Rowe <mrowe@apple.com>
2361 Reviewed by Sam Weinig.
2363 Add the ability to trace JavaScriptCore garabge collections using dtrace.
2365 * JavaScriptCore.xcodeproj/project.pbxproj: Generate the dtrace probe header
2366 file when building on a new enough version of Mac OS X.
2367 * JavaScriptCorePrefix.h: Add our standard Mac OS X version detection macros.
2368 * kjs/Tracing.d: Declare three dtrace probes.
2369 * kjs/Tracing.h: Include the generated dtrace macros if dtrace is available,
2370 otherwise provide versions that do nothing.
2371 * kjs/collector.cpp:
2372 (KJS::Heap::collect): Fire dtrace probes when starting a collection, after the
2373 mark phase has completed, and when the collection is complete.
2374 * wtf/Platform.h: Define HAVE_DTRACE when building on a new enough version of Mac OS X.
2376 2008-07-02 Geoffrey Garen <ggaren@apple.com>
2378 Rubber stamped by Oliver Hunt.
2380 Reduced the max register file size from 8MB to 2MB.
2382 We still allow about 20,000 levels of recursion.
2384 2008-07-02 Alp Toker <alp@nuanti.com>
2386 Build fix for r34960. Add TreeProfile.cpp to build.
2390 2008-07-02 Geoffrey Garen <ggaren@apple.com>
2392 Reviewed by Oliver Hunt.
2394 Optimized a[n] get for cases when a is an array or a string. When a is
2395 an array, we optimize both get and put. When a is a string, we only
2396 optimize get, since you can't put to a string.
2398 SunSpider says 3.4% faster.
2400 2008-07-02 Kevin McCullough <kmccullough@apple.com>
2404 -Small cleanup in preparation for implementing Bottom-up.
2406 * profiler/CallIdentifier.h: Rename debug function to make it clear of
2407 its output and intention to be debug only.
2408 (KJS::CallIdentifier::operator const char* ): Implement in terms of
2410 (KJS::CallIdentifier::c_str):
2411 * profiler/ProfileNode.cpp: Impelment findChild() which will be needed
2412 by the bottom-up implementation.
2413 (KJS::ProfileNode::findChild):
2414 * profiler/ProfileNode.h: Added comments to make the collections of
2415 functions more clear.
2416 (KJS::ProfileNode::operator==):
2417 (KJS::ProfileNode::c_str):
2419 2008-07-02 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2423 Bug 19776: Number.toExponential() is incorrect for numbers between 0.1 and 1
2424 <https://bugs.webkit.org/show_bug.cgi?id=19776>
2426 Perform the sign check for the exponent on the actual exponent value,
2427 which is 1 less than the value of decimalPoint, instead of on the value
2428 of decimalPoint itself.
2430 * kjs/NumberPrototype.cpp:
2431 (KJS::exponentialPartToString):
2433 2008-07-02 Kevin McCullough <kmccullough@apple.com>
2437 <rdar://problem/5951532> JSProfiler: Implement Bottom-Up view (19228)
2438 - Subclass TreeProfile as I prepare for a HeavyProfile to be comming
2441 * JavaScriptCore.xcodeproj/project.pbxproj:
2442 * profiler/Profile.cpp: By default we create a TreeProfile.
2443 (KJS::Profile::create):
2444 * profiler/Profile.h: Changes to the Profile class to make it amenable
2445 to be inherited from.
2446 (KJS::Profile::~Profile):
2447 * profiler/TreeProfile.cpp: Added.
2448 (KJS::TreeProfile::create):
2449 (KJS::TreeProfile::TreeProfile):
2450 (KJS::TreeProfile::heavyProfile):
2451 * profiler/TreeProfile.h: Added.
2452 (KJS::TreeProfile::treeProfile):
2454 2008-07-02 Kevin McCullough <kmccullough@apple.com>
2458 Broke CallIdentifier out into its own file. I did this because it's
2459 going to grow a lot soon and I wanted this to be a separate patch.
2461 * JavaScriptCore.xcodeproj/project.pbxproj:
2462 * profiler/CallIdentifier.h: Added.
2463 (KJS::CallIdentifier::CallIdentifier):
2464 (KJS::CallIdentifier::operator==):
2465 (KJS::CallIdentifier::operator!=):
2466 (KJS::CallIdentifier::operator const char* ):
2467 (KJS::CallIdentifier::toString):
2468 * profiler/ProfileNode.h:
2470 2008-07-02 Simon Hausmann <hausmann@webkit.org>
2472 Build fix. Implemented missing functions for single-threaded build.
2475 (KJS::JSLock::JSLock):
2476 (KJS::JSLock::lock):
2477 (KJS::JSLock::unlock):
2478 (KJS::JSLock::DropAllLocks::DropAllLocks):
2480 2008-07-02 Alexey Proskuryakov <ap@webkit.org>
2482 Another non-AllInOne build fix.
2484 * kjs/JSGlobalObject.cpp: Include JSLock.h here, too.
2486 2008-07-02 Alexey Proskuryakov <ap@webkit.org>
2488 Non-AllInOne build fix.
2490 * kjs/interpreter.cpp: Include JSLock.h.
2492 2008-06-30 Alexey Proskuryakov <ap@webkit.org>
2496 Disable JSLock for per-thread contexts.
2498 No change on SunSpider.
2500 * kjs/JSGlobalData.h:
2501 * kjs/JSGlobalData.cpp:
2502 (KJS::JSGlobalData::JSGlobalData):
2503 (KJS::JSGlobalData::sharedInstance):
2504 Added isSharedInstance as a better way to tell whether the instance is shared (legacy).
2507 (KJS::createJSLockCount):
2508 (KJS::JSLock::lockCount):
2509 (KJS::setLockCount):
2510 (KJS::JSLock::JSLock):
2511 (KJS::JSLock::lock):
2512 (KJS::JSLock::unlock):
2513 (KJS::JSLock::currentThreadIsHoldingLock):
2514 (KJS::JSLock::DropAllLocks::DropAllLocks):
2515 (KJS::JSLock::DropAllLocks::~DropAllLocks):
2517 (KJS::JSLock::JSLock):
2518 (KJS::JSLock::~JSLock):
2519 Made JSLock and JSLock::DropAllLocks constructors take a parameter to decide whether to
2520 actually lock a mutex, or only to increment recursion count. We cannot turn it into no-op
2521 if we want to keep existing assertions working.
2522 Made recursion count per-thread, now that locks may not lock.
2525 (JSEvaluateScript): Take JSLock after casting JSContextRef to ExecState* (which doesn't need
2526 locking in any case), so that a decision whether to actually lock can be made.
2527 (JSCheckScriptSyntax): Ditto.
2528 (JSGarbageCollect): Only lock while collecting the shared heap, not the per-thread one.
2530 * API/JSObjectRef.cpp:
2531 (JSClassCreate): Don't lock, as there is no reason to.
2532 (JSClassRetain): Ditto.
2533 (JSClassRelease): Ditto.
2534 (JSPropertyNameArrayRetain): Ditto.
2535 (JSPropertyNameArrayRelease): Only lock while deleting the array, as that may touch
2537 (JSPropertyNameAccumulatorAddName): Adding a string also involves an identifier table
2538 lookup, and possibly modification.
2540 * API/JSStringRef.cpp:
2541 (JSStringCreateWithCharacters):
2542 (JSStringCreateWithUTF8CString):
2545 (JSStringGetUTF8CString):
2547 * API/JSStringRefCF.cpp:
2548 (JSStringCreateWithCFString):
2549 JSStringRef operations other than releasing do not need locking.
2551 * VM/Machine.cpp: Don't include unused JSLock.h.
2553 * kjs/CollectorHeapIntrospector.cpp: (KJS::CollectorHeapIntrospector::statistics):
2554 Don't take the lock for real, as heap introspection pauses the process anyway. It seems that
2555 the existing code could cause deadlocks.
2561 The test tool uses a per-thread context, so no real locking is required.
2564 (KJS::Heap::setGCProtectNeedsLocking): Optionally protect m_protectedValues access with a
2565 per-heap mutex. This is only needed for WebCore Database code, which violates the "no data
2566 migration between threads" by using ProtectedPtr on a background thread.
2567 (KJS::Heap::isShared): Keep a shared flag here, as well.
2570 (KJS::::ProtectedPtr):
2571 (KJS::::~ProtectedPtr):
2575 ProtectedPtr is ony used from WebCore, so it doesn't need to take JSLock. An assertion in
2576 Heap::protect/unprotect guards agains possible future unlocked uses of ProtectedPtr in JSC.
2578 * kjs/collector.cpp:
2579 (KJS::Heap::Heap): Initialize m_isShared.
2580 (KJS::Heap::~Heap): No need to lock for real during destruction, but must keep assertions
2582 (KJS::destroyRegisteredThread): Registered thread list is only accessed for shared heap,
2583 so locking is always needed here.
2584 (KJS::Heap::registerThread): Ditto.
2585 (KJS::Heap::markStackObjectsConservatively): Use m_isShared instead of comparing to a shared
2586 instance for a small speedup.
2587 (KJS::Heap::setGCProtectNeedsLocking): Create m_protectedValuesMutex. There is currently no
2588 way to undo this - and ideally, Database code will be fixed to lo longer require this quirk.
2589 (KJS::Heap::protect): Take m_protectedValuesMutex (if it exists) while accessing
2591 (KJS::Heap::unprotect): Ditto.
2592 (KJS::Heap::markProtectedObjects): Ditto.
2593 (KJS::Heap::protectedGlobalObjectCount): Ditto.
2594 (KJS::Heap::protectedObjectCount): Ditto.
2595 (KJS::Heap::protectedObjectTypeCounts): Ditto.
2599 Don't include JSLock.h, which is no longer used here. As a result, an explicit include had
2600 to be added to many files in JavaScriptGlue, WebCore and WebKit.
2602 * kjs/JSGlobalObject.cpp:
2603 (KJS::JSGlobalObject::init):
2604 * API/JSCallbackConstructor.cpp:
2605 (KJS::constructJSCallback):
2606 * API/JSCallbackFunction.cpp:
2607 (KJS::JSCallbackFunction::call):
2608 * API/JSCallbackObjectFunctions.h:
2610 (KJS::::getOwnPropertySlot):
2612 (KJS::::deleteProperty):
2614 (KJS::::hasInstance):
2616 (KJS::::getPropertyNames):
2619 (KJS::::staticValueGetter):
2620 (KJS::::callbackGetter):
2621 * API/JSContextRef.cpp:
2622 (JSGlobalContextCreate):
2623 (JSGlobalContextRetain):
2624 (JSGlobalContextRelease):
2625 * API/JSValueRef.cpp:
2627 (JSValueIsStrictEqual):
2628 (JSValueIsInstanceOfConstructor):
2629 (JSValueMakeNumber):
2630 (JSValueMakeString):
2632 (JSValueToStringCopy):
2636 * JavaScriptCore.exp:
2637 * kjs/PropertyNameArray.h:
2638 (KJS::PropertyNameArray::globalData):
2639 * kjs/interpreter.cpp:
2640 (KJS::Interpreter::checkSyntax):
2641 (KJS::Interpreter::evaluate):
2642 Pass a parameter to JSLock/JSLock::DropAllLocks to decide whether the lock needs to be taken.
2644 2008-07-01 Alexey Proskuryakov <ap@webkit.org>
2648 https://bugs.webkit.org/show_bug.cgi?id=19834
2649 Failed assertion in JavaScriptCore/VM/SegmentedVector.h:82
2651 Creating a global object with a custom prototype resets it twice (wasteful!).
2652 So, addStaticGlobals() was called twice, but JSGlobalObject::reset() didn't reset
2655 * kjs/JSGlobalObject.cpp: (KJS::JSGlobalObject::reset): Call setRegisterArray(0, 0).
2657 * kjs/JSVariableObject.h: Changed registerArray to OwnArrayPtr. Also, added private copy
2658 constructor and operator= to ensure that no one attempts to copy this object (for whatever
2659 reason, I couldn't make Noncopyable work).
2661 * kjs/JSGlobalObject.h: (KJS::JSGlobalObject::addStaticGlobals): Allocate registerArray
2664 * kjs/JSVariableObject.cpp:
2665 (KJS::JSVariableObject::copyRegisterArray): Allocate registerArray with new[].
2666 (KJS::JSVariableObject::setRegisterArray): Avoid hitting an assertion in OwnArrayPtr when
2667 "changing" the value from 0 to 0.
2669 2008-07-01 Geoffrey Garen <ggaren@apple.com>
2671 Reviewed by Oliver Hunt.
2673 Removed and/or reordered exception checks in array-style a[n] access.
2675 SunSpider says 1.4% faster.
2678 (KJS::Machine::privateExecute): No need to check for exceptions before
2679 calling toString, toNumber and/or get. If the call ends up being observable
2680 through toString, valueOf, or a getter, we short-circuit it there, instead.
2681 In the op_del_by_val case, I removed the incorrect comment without actually
2682 removing the code, since I didn't want to tempt the GCC fates!
2685 (KJS::callDefaultValueFunction): Added exception check to prevent
2686 toString and valueOf functions from observing execution after an exception
2687 has been thrown. This removes some of the burden of exception checking
2690 (KJS::JSObject::defaultValue): Removed redundant exception check here.
2692 * kjs/PropertySlot.cpp:
2693 (KJS::PropertySlot::functionGetter): Added exception check to prevent
2694 getter functions from observing execution after an exception has been
2695 thrown. This removes some of the burden of exception checking from the
2698 2008-07-01 Geoffrey Garen <ggaren@apple.com>
2700 Reviewed by Oliver Hunt.
2702 Optimized a[n] get and put for cases where n is an immediate unsigned
2705 SunSpider says 3.5% faster.
2707 2008-07-01 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2711 Bug 19844: JavaScript Switch statement modifies "this"
2712 <https://bugs.webkit.org/show_bug.cgi?id=19844>
2714 Use a temporary when generating code for switch clauses to avoid
2715 overwriting 'this' or a local variable.
2718 (KJS::CaseBlockNode::emitCodeForBlock):
2720 2008-07-01 Christian Dywan <christian@twotoasts.de>
2724 * kjs/list.cpp: Include "JSCell.h"
2726 2008-07-01 Kevin McCullough <kmccullough@apple.com>
2730 * JavaScriptCore.xcodeproj/project.pbxproj:
2732 2008-07-01 Dan Bernstein <mitz@apple.com>
2734 Reviewed by Anders Carlsson.
2736 - Mac release build fix
2738 * JavaScriptCore.exp:
2740 2008-07-01 Sam Weinig <sam@webkit.org>
2742 Try and fix mac builds.
2744 * JavaScriptCore.exp:
2746 2008-07-01 Sam Weinig <sam@webkit.org>
2748 Fix non-AllInOne builds.
2752 2008-07-01 Sam Weinig <sam@webkit.org>
2754 Reviewed by Darin Adler.
2756 Split JSCell and JSNumberCell class declarations out of JSValue.h
2759 * JavaScriptCore.pri:
2760 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2761 * JavaScriptCore.xcodeproj/project.pbxproj:
2762 * JavaScriptCoreSources.bkl:
2763 * VM/JSPropertyNameIterator.h:
2764 * kjs/AllInOneFile.cpp:
2765 * kjs/JSCell.cpp: Copied from JavaScriptCore/kjs/JSValue.cpp.
2766 * kjs/JSCell.h: Copied from JavaScriptCore/kjs/JSValue.h.
2767 (KJS::JSValue::getJSNumber):
2768 * kjs/JSNumberCell.cpp:
2769 * kjs/JSNumberCell.h: Copied from JavaScriptCore/kjs/JSValue.h.
2773 (KJS::jsOwnedString):
2775 (KJS::JSValue::toThisJSString):
2779 2008-07-01 Anders Carlsson <andersca@apple.com>
2783 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2784 * kjs/JSGlobalObject.h:
2785 (KJS::JSGlobalObject::addStaticGlobals):
2787 2008-07-01 Simon Hausmann <hausmann@webkit.org>
2789 Build fix, include OwnPtr.h.
2791 * kjs/RegExpConstructor.h:
2793 2008-06-30 Geoffrey Garen <ggaren@apple.com>
2795 Reviewed by Oliver Hunt.
2797 Fixed a global object leak caused by the switch to one register file.
2799 Don't unconditionally mark the register file, since that logically
2800 makes all global variables GC roots, even when their global object is
2801 no longer reachable.
2803 Instead, make the global object associated with the register file
2804 responsible for marking the register file.
2806 2008-06-30 Geoffrey Garen <ggaren@apple.com>
2808 Reviewed by Oliver Hunt.
2810 Removed the "registerBase" abstraction. Since the register file never
2811 reallocates, we can keep direct pointers into it, instead of
2812 <registerBase, offset> tuples.
2814 SunSpider says 0.8% faster.
2816 2008-06-30 Oliver Hunt <oliver@apple.com>
2818 Reviewed by NOBODY (build fix).
2820 Fix build by adding all (hopefully) the missing includes.
2822 * kjs/BooleanPrototype.cpp:
2823 * kjs/DateConstructor.cpp:
2824 * kjs/ErrorPrototype.cpp:
2825 * kjs/FunctionPrototype.cpp:
2826 * kjs/NativeErrorConstructor.cpp:
2827 * kjs/NumberPrototype.cpp:
2828 * kjs/ObjectPrototype.cpp:
2829 * kjs/RegExpConstructor.cpp:
2830 * kjs/StringConstructor.cpp:
2831 * kjs/StringPrototype.cpp:
2833 2008-06-30 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2837 Bug 19830: REGRESSION (r34883): Google Reader doesn't show up feed list on sidebar
2838 <https://bugs.webkit.org/show_bug.cgi?id=19830>
2840 Ensure that we do not eliminate a write to a local register when doing
2841 peephole optimizations.
2843 * VM/CodeGenerator.cpp:
2844 (KJS::CodeGenerator::emitJumpIfTrue):
2845 (KJS::CodeGenerator::emitJumpIfFalse):
2847 2008-06-30 Sam Weinig <sam@webkit.org>
2849 Rubber-stamped by Darin Alder.
2851 Split InternalFunction into its own header file.
2853 * API/JSCallbackFunction.h:
2854 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2855 * JavaScriptCore.xcodeproj/project.pbxproj:
2856 * kjs/ArrayConstructor.h:
2857 * kjs/BooleanConstructor.h:
2858 * kjs/DateConstructor.h:
2859 * kjs/ErrorConstructor.h:
2860 * kjs/FunctionConstructor.h:
2861 * kjs/FunctionPrototype.h:
2862 * kjs/InternalFunction.h: Copied from kjs/JSFunction.h.
2864 * kjs/NativeErrorConstructor.h:
2865 * kjs/NumberConstructor.h:
2866 * kjs/ObjectConstructor.h:
2867 * kjs/RegExpConstructor.h:
2868 * kjs/StringConstructor.h:
2869 * profiler/Profiler.cpp:
2871 2008-06-30 Sam Weinig <sam@webkit.org>
2873 Reviewed by Kevin McCullough.
2875 Remove empty files Instruction.cpp, LabelID.cpp, Register.cpp and RegisterID.cpp.
2878 * JavaScriptCore.pri:
2879 * JavaScriptCore.xcodeproj/project.pbxproj:
2880 * JavaScriptCoreSources.bkl:
2881 * VM/Instruction.cpp: Removed.
2882 * VM/LabelID.cpp: Removed.
2883 * VM/Register.cpp: Removed.
2884 * VM/RegisterID.cpp: Removed.
2886 2008-06-30 Sam Weinig <sam@webkit.org>
2888 Rubber-stamped (reluctantly) by Kevin McCullough.
2890 Rename date_object.h/cpp to DateInstance.h/cpp
2893 * JavaScriptCore.pri:
2894 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2895 * JavaScriptCore.xcodeproj/project.pbxproj:
2896 * JavaScriptCoreSources.bkl:
2897 * kjs/AllInOneFile.cpp:
2898 * kjs/DateConstructor.cpp:
2899 * kjs/DateInstance.cpp: Copied from kjs/date_object.cpp.
2900 * kjs/DateInstance.h: Copied from kjs/date_object.h.
2901 * kjs/DatePrototype.cpp:
2902 * kjs/DatePrototype.h:
2903 * kjs/date_object.cpp: Removed.
2904 * kjs/date_object.h: Removed.
2906 2008-06-30 Sam Weinig <sam@webkit.org>
2908 Rubber-stamped by Darin Adler.
2910 Remove internal.cpp and move its contents to there own .cpp files.
2913 * JavaScriptCore.pri:
2914 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2915 * JavaScriptCore.xcodeproj/project.pbxproj:
2916 * JavaScriptCoreSources.bkl:
2917 * kjs/AllInOneFile.cpp:
2918 * kjs/GetterSetter.cpp: Copied from kjs/internal.cpp.
2919 * kjs/InternalFunction.cpp: Copied from kjs/internal.cpp.
2920 * kjs/JSNumberCell.cpp: Copied from kjs/internal.cpp.
2921 * kjs/JSString.cpp: Copied from kjs/internal.cpp.
2923 * kjs/LabelStack.cpp: Copied from kjs/internal.cpp.
2924 * kjs/NumberConstructor.cpp:
2925 * kjs/NumberObject.cpp:
2926 (KJS::constructNumber):
2927 (KJS::constructNumberFromImmediateNumber):
2928 * kjs/internal.cpp: Removed.
2930 2008-06-30 Adam Roben <aroben@apple.com>
2932 Fix <rdar://5954749> Assertion failure due to HashTable's use of
2935 HashTable was passing &value to constructDeletedValue, which in
2936 classes like WebCore::COMPtr would cause an assertion. We now pass
2937 value by reference instead of by address so that the HashTraits
2938 implementations have more flexibility in constructing the deleted
2941 Reviewed by Ada Chan.
2943 * VM/CodeGenerator.h: Updated for changes to HashTraits.
2945 (WTF::::deleteBucket): Changed to pass bucket by reference instead of
2947 (WTF::::checkKey): Ditto.
2949 (WTF::): Updated HashTraits for HashTable change.
2951 2008-07-01 Alexey Proskuryakov <ap@webkit.org>
2953 Reviewed by Cameron Zwarich.
2955 Make RegisterFile really unmap memory on destruction.
2957 This fixes run-webkit-tests --threaded, which ran out of address space in a few seconds.
2959 * VM/RegisterFile.cpp: (KJS::RegisterFile::~RegisterFile): Unmap all the memory, not just
2962 * kjs/JSGlobalObject.h: Don't include RegisterFile.h, so that changes to it don't make
2963 half of WebCore rebuild.
2965 * VM/Machine.h: Don't forward declare RegisterFile, as RegisterFile.h is included already.
2967 * VM/RegisterFile.h: (KJS::RegisterFile::RegisterFile): Assert that the allocation succeeded.
2969 2008-06-30 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2971 Rubber-stamped by Oliver.
2973 Correct the documentation for op_put_by_index.
2976 (KJS::Machine::privateExecute):
2978 2008-06-29 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2982 Bug 19821: Merge the instruction pair (less, jfalse)
2983 <https://bugs.webkit.org/show_bug.cgi?id=19821>
2985 This is a 2.4% win on SunSpider. I needed to add an ALWAYS_INLINE
2986 intrinisc to CodeGenerator::rewindBinaryOp() to avoid a massive
2987 regression in regexp-dna.
2990 (KJS::CodeBlock::dump):
2991 * VM/CodeGenerator.cpp:
2992 (KJS::CodeGenerator::rewindBinaryOp):
2993 (KJS::CodeGenerator::emitJumpIfFalse):
2995 (KJS::Machine::privateExecute):
3000 2008-06-29 Sam Weinig <sam@webkit.org>
3002 Fix non-AllInOne builds.
3007 2008-06-29 Sam Weinig <sam@webkit.org>
3012 * kjs/DatePrototype.cpp:
3014 2008-06-29 Sam Weinig <sam@webkit.org>
3016 Rubber-stamped by Cameron Zwarich.
3018 Splits ErrorConstructor, ErrorPrototype, NativeErrorConstructor and
3019 NativeErrorPrototype out of error_object.h/cpp and renames it ErrorInstance.
3022 * JavaScriptCore.pri:
3023 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3024 * JavaScriptCore.xcodeproj/project.pbxproj:
3025 * JavaScriptCoreSources.bkl:
3026 * kjs/AllInOneFile.cpp:
3027 * kjs/ArrayConstructor.cpp:
3028 * kjs/ArrayPrototype.cpp:
3029 * kjs/BooleanPrototype.cpp:
3030 * kjs/DatePrototype.cpp:
3031 * kjs/ErrorConstructor.cpp: Copied from kjs/error_object.cpp.
3032 * kjs/ErrorConstructor.h: Copied from kjs/error_object.h.
3033 * kjs/ErrorInstance.cpp: Copied from kjs/error_object.cpp.
3034 * kjs/ErrorInstance.h: Copied from kjs/error_object.h.
3035 * kjs/ErrorPrototype.cpp: Copied from kjs/error_object.cpp.
3036 * kjs/ErrorPrototype.h: Copied from kjs/error_object.h.
3037 * kjs/JSGlobalObject.cpp:
3040 * kjs/NativeErrorConstructor.cpp: Copied from kjs/error_object.cpp.
3041 * kjs/NativeErrorConstructor.h: Copied from kjs/error_object.h.
3042 * kjs/NativeErrorPrototype.cpp: Copied from kjs/error_object.cpp.
3043 * kjs/NativeErrorPrototype.h: Copied from kjs/error_object.h.
3044 * kjs/NumberPrototype.cpp:
3045 * kjs/RegExpConstructor.cpp:
3046 * kjs/RegExpObject.cpp:
3047 * kjs/RegExpPrototype.cpp:
3048 * kjs/StringPrototype.cpp:
3049 * kjs/error_object.cpp: Removed.
3050 * kjs/error_object.h: Removed.
3053 2008-06-29 Sam Weinig <sam@webkit.org>
3055 Fix non-AllInOne build.
3057 * kjs/DateConstructor.cpp:
3061 2008-06-29 Sam Weinig <sam@webkit.org>
3063 Rubber-stamped by Oliver Hunt.
3065 Splits DateConstructor and DatePrototype out of date_object.h/cpp
3066 Moves shared Date code into DateMath.
3068 * DerivedSources.make:
3070 * JavaScriptCore.pri:
3071 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3072 * JavaScriptCore.xcodeproj/project.pbxproj:
3073 * JavaScriptCoreSources.bkl:
3074 * kjs/AllInOneFile.cpp:
3075 * kjs/DateConstructor.cpp: Copied from kjs/date_object.cpp.
3076 * kjs/DateConstructor.h: Copied from kjs/date_object.h.
3078 (KJS::ymdhmsToSeconds):
3080 (KJS::skipSpacesAndComments):
3085 (KJS::formatDateUTCVariant):
3089 * kjs/DatePrototype.cpp: Copied from kjs/date_object.cpp.
3090 * kjs/DatePrototype.h: Copied from kjs/date_object.h.
3091 * kjs/JSGlobalObject.cpp:
3093 * kjs/date_object.cpp:
3094 * kjs/date_object.h:
3097 2008-06-29 Jan Michael Alonzo <jmalonzo@webkit.org>
3099 Rubber-stamped by Cameron Zwarich
3101 Fix Gtk non-AllInOne build
3103 * GNUmakefile.am: include JSVariableObject.cpp
3104 * kjs/RegExpConstructor.cpp: include RegExpObject.h
3105 * kjs/RegExpObject.h: forward declare RegExpPrototype
3107 2008-06-28 Darin Adler <darin@apple.com>
3109 Reviewed by Sam and Cameron.
3111 - fix https://bugs.webkit.org/show_bug.cgi?id=19805
3112 Array.concat turns missing array elements into "undefined"
3114 Test: fast/js/array-holes.html
3116 * JavaScriptCore.exp: No longer export JSArray::getItem.
3118 * kjs/ArrayPrototype.cpp:
3119 (KJS::arrayProtoFuncConcat): Changed to use getProperty instead of
3120 JSArray::getItem -- need to handle properties from the prototype chain
3121 instead of ignoring them.
3123 * kjs/JSArray.cpp: Removed getItem.
3124 * kjs/JSArray.h: Ditto.
3126 2008-06-28 Darin Adler <darin@apple.com>
3128 Reviewed by Cameron.
3130 - https://bugs.webkit.org/show_bug.cgi?id=19804
3131 optimize access to arrays without "holes"
3133 SunSpider says 1.8% faster.
3136 (KJS::JSArray::JSArray): Initialize m_fastAccessCutoff when creating
3137 arrays. Also updated for new location of m_vectorLength.
3138 (KJS::JSArray::getItem): Updated for new location of m_vectorLength.
3139 (KJS::JSArray::getSlowCase): Added. Broke out the non-hot parts of
3140 getOwnPropertySlot to make the hot part faster.
3141 (KJS::JSArray::getOwnPropertySlot): Added a new faster case for
3142 indices lower than m_fastAccessCutoff. We can do theese with no
3143 additional checks or branches.
3144 (KJS::JSArray::put): Added a new faster case for indices lower than
3145 m_fastAccessCutoff. We can do theese with no additional checks or
3146 branches. Moved the maxArrayIndex handling out of this function.
3147 Added code to set m_fastAccessCutoff when the very last hole in
3148 an array is filled; this is how the cutoff gets set for most arrays.
3149 (KJS::JSArray::putSlowCase): Moved the rest of the put function logic
3150 in here, to make the hot part of the put function faster.
3151 (KJS::JSArray::deleteProperty): Added code to lower m_fastAccessCutoff
3152 when a delete makes a new hole in the array.
3153 (KJS::JSArray::getPropertyNames): Updated for new location of
3155 (KJS::JSArray::increaseVectorLength): Ditto.
3156 (KJS::JSArray::setLength): Added code to lower m_fastAccessCutoff
3157 when setLength makes the array smaller.
3158 (KJS::JSArray::mark): Updated for new location of m_vectorLength.
3159 (KJS::JSArray::sort): Ditto. Set m_fastAccessCutoff after moving
3160 all the holes to the end of the array.
3161 (KJS::JSArray::compactForSorting): Ditto.
3162 (KJS::JSArray::checkConsistency): Added consistency checks fro
3163 m_fastAccessCutoff and updated for the new location of m_vectorLength.
3165 * kjs/JSArray.h: Added declarations for slow case functions.
3166 Replaced m_vectorLength with m_fastAccessCutoff.
3168 2008-06-28 Cameron Zwarich <cwzwarich@uwaterloo.ca>
3172 When executing a native call, check for an exception before writing the
3176 (KJS::Machine::privateExecute):
3178 2008-06-28 Mark Rowe <mrowe@apple.com>
3180 Build fix. Flag headers as private or public as is appropriate.
3181 These settings were accidentally removed during some project file cleanup.
3183 * JavaScriptCore.xcodeproj/project.pbxproj:
3185 2008-06-28 Sam Weinig <sam@webkit.org>
3187 Rubber-stamped by Darin Adler.
3189 Splits RegExpConstructor and RegExpPrototype out of RegExpObject.h/cpp
3191 * DerivedSources.make:
3193 * JavaScriptCore.pri:
3194 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3195 * JavaScriptCore.xcodeproj/project.pbxproj:
3196 * JavaScriptCoreSources.bkl:
3198 * kjs/AllInOneFile.cpp:
3199 * kjs/JSGlobalObject.cpp:
3200 * kjs/RegExpConstructor.cpp: Copied from kjs/RegExpObject.cpp.
3201 * kjs/RegExpConstructor.h: Copied from kjs/RegExpObject.h.
3202 * kjs/RegExpObject.cpp:
3203 * kjs/RegExpObject.h:
3204 * kjs/RegExpPrototype.cpp: Copied from kjs/RegExpObject.cpp.
3205 * kjs/RegExpPrototype.h: Copied from kjs/RegExpObject.h.
3206 * kjs/StringPrototype.cpp:
3209 2008-06-28 Sam Weinig <sam@webkit.org>
3211 Fix non-AllInOne builds.
3213 * kjs/StringConstructor.cpp:
3215 2008-06-28 Sam Weinig <sam@webkit.org>
3217 Rubber-stamped by Darin Adler.
3219 Rename string_object.h/cpp to StringObject.h/cpp and split out StringObjectThatMasqueradesAsUndefined,
3220 StringConstructor and StringPrototype.
3222 * DerivedSources.make:
3224 * JavaScriptCore.pri:
3225 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3226 * JavaScriptCore.xcodeproj/project.pbxproj:
3227 * JavaScriptCoreSources.bkl:
3228 * kjs/AllInOneFile.cpp:
3229 * kjs/JSGlobalObject.cpp:
3230 * kjs/StringConstructor.cpp: Copied from JavaScriptCore/kjs/string_object.cpp.
3231 * kjs/StringConstructor.h: Copied from JavaScriptCore/kjs/string_object.h.
3232 * kjs/StringObject.cpp: Copied from JavaScriptCore/kjs/string_object.cpp.
3233 * kjs/StringObject.h: Copied from JavaScriptCore/kjs/string_object.h.
3234 * kjs/StringObjectThatMasqueradesAsUndefined.h: Copied from JavaScriptCore/kjs/string_object.h.
3235 * kjs/StringPrototype.cpp: Copied from JavaScriptCore/kjs/string_object.cpp.
3236 * kjs/StringPrototype.h: Copied from JavaScriptCore/kjs/string_object.h.
3238 * kjs/string_object.cpp: Removed.
3239 * kjs/string_object.h: Removed.
3241 2008-06-28 Jan Michael Alonzo <jmalonzo@webkit.org>
3243 Gtk build fix: JSVariableObject is now part of AllInOne
3247 2008-06-28 Darin Adler <darin@apple.com>
3251 - https://bugs.webkit.org/show_bug.cgi?id=19801
3252 add a feature so we can tell what regular expressions are taking time
3254 * pcre/pcre_compile.cpp:
3255 (jsRegExpCompile): Compile in the string if REGEXP_HISTOGRAM is on.
3257 * pcre/pcre_exec.cpp:
3258 (jsRegExpExecute): Add hook to time execution.
3259 (Histogram::~Histogram): Print a sorted list of what took time.
3260 (Histogram::add): Accumulate records of what took time.
3261 (HistogramTimeLogger::~HistogramTimeLogger): Hook that calls
3262 Histogram::add at the right moment and creates the global histogram
3265 * pcre/pcre_internal.h: Define REGEXP_HISTOGRAM.
3267 * pcre/pcre_tables.cpp: Added missing include of "config.h". Not needed
3268 any more, but an omissions an earlier version of this patch detected.
3269 * pcre/pcre_ucp_searchfuncs.cpp: Ditto.
3270 * pcre/pcre_xclass.cpp: Ditto.
3272 2008-06-28 Sam Weinig <sam@webkit.org>
3274 Try and fix the Windows build again.
3276 * kjs/RegExpObject.cpp:
3277 * kjs/date_object.cpp:
3278 * kjs/error_object.cpp:
3280 2008-06-28 Sam Weinig <sam@webkit.org>
3282 Rubber-stamped by Darin Adler.
3284 Remove unused StringConstructorFunction class.
3286 * kjs/string_object.h:
3288 2008-06-28 Sam Weinig <sam@webkit.org>
3292 * kjs/ArrayPrototype.cpp:
3293 * kjs/BooleanPrototype.cpp:
3294 * kjs/BooleanPrototype.h:
3295 * kjs/FunctionPrototype.cpp:
3296 * kjs/JSImmediate.cpp:
3298 * kjs/MathObject.cpp:
3299 * kjs/NumberPrototype.cpp:
3300 * kjs/NumberPrototype.h:
3301 * kjs/ObjectConstructor.cpp:
3302 * kjs/RegExpObject.h:
3303 * kjs/error_object.h:
3304 * kjs/string_object.cpp:
3306 2008-06-28 Sam Weinig <sam@webkit.org>
3308 Rubber-stamped by Oliver Hunt.
3310 Splits FunctionConstructor out of FunctionPrototype.h/cpp
3311 Splits NumberConstructor and NumberPrototype out of NumberObject.h/cpp
3312 Rename object_object.h/cpp to ObjectPrototype.h/cpp and split out ObjectConstructor.
3314 * API/JSCallbackConstructor.cpp:
3315 * API/JSClassRef.cpp:
3316 * API/JSObjectRef.cpp:
3317 * DerivedSources.make:
3319 * JavaScriptCore.pri:
3320 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3321 * JavaScriptCore.xcodeproj/project.pbxproj:
3322 * JavaScriptCoreSources.bkl:
3324 * kjs/AllInOneFile.cpp:
3325 * kjs/ArrayConstructor.cpp:
3326 * kjs/ArrayConstructor.h:
3327 * kjs/FunctionConstructor.cpp: Copied from JavaScriptCore/kjs/FunctionPrototype.cpp.
3328 * kjs/FunctionConstructor.h: Copied from JavaScriptCore/kjs/FunctionPrototype.h.
3329 * kjs/FunctionPrototype.cpp:
3330 * kjs/FunctionPrototype.h:
3331 * kjs/JSFunction.cpp:
3332 * kjs/JSGlobalObject.cpp:
3333 * kjs/JSImmediate.cpp:
3335 * kjs/NumberConstructor.cpp: Copied from JavaScriptCore/kjs/NumberObject.cpp.
3336 * kjs/NumberConstructor.h: Copied from JavaScriptCore/kjs/NumberObject.h.
3337 * kjs/NumberObject.cpp:
3338 * kjs/NumberObject.h:
3339 * kjs/NumberPrototype.cpp: Copied from JavaScriptCore/kjs/NumberObject.cpp.
3340 * kjs/NumberPrototype.h: Copied from JavaScriptCore/kjs/NumberObject.h.
3341 * kjs/ObjectConstructor.cpp: Copied from JavaScriptCore/kjs/object_object.cpp.
3342 * kjs/ObjectConstructor.h: Copied from JavaScriptCore/kjs/object_object.h.
3343 * kjs/ObjectPrototype.cpp: Copied from JavaScriptCore/kjs/object_object.cpp.
3344 * kjs/ObjectPrototype.h: Copied from JavaScriptCore/kjs/object_object.h.
3345 * kjs/RegExpObject.h:
3347 * kjs/error_object.h:
3350 * kjs/object_object.cpp: Removed.
3351 * kjs/object_object.h: Removed.
3352 * kjs/string_object.h:
3354 2008-06-28 Darin Adler <darin@apple.com>
3358 - fix https://bugs.webkit.org/show_bug.cgi?id=19796
3359 optimize expressions with ignored results (especially post-increment)
3361 SunSpider says 0.9% faster.
3363 * VM/CodeGenerator.h:
3364 (KJS::CodeGenerator::tempDestination): Create a new temporary for
3365 ignoredResult() too, just as we would for 0.
3366 (KJS::CodeGenerator::finalDestination): Use the temporary if the
3367 register passed in is ignoredResult() too, just as we would for 0.
3368 (KJS::CodeGenerator::destinationForAssignResult): Return 0 if the
3369 passed in register is ignoredResult(), just as we would for 0.
3370 (KJS::CodeGenerator::moveToDestinationIfNeeded): Return 0 if the
3371 register passed in is ignoredResult(). What matters is that we
3372 don't want to emit a move. The return value won't be looked at.
3373 (KJS::CodeGenerator::emitNode): Allow ignoredResult() and pass it
3374 through to the node's emitCode function.
3377 (KJS::ignoredResult): Added. Special value to indicate the result of
3378 a node will be ignored and need not be put in any register.
3381 (KJS::NullNode::emitCode): Do nothing if dst == ignoredResult().
3382 (KJS::BooleanNode::emitCode): Ditto.
3383 (KJS::NumberNode::emitCode): Ditto.
3384 (KJS::StringNode::emitCode): Ditto.
3385 (KJS::RegExpNode::emitCode): Ditto.
3386 (KJS::ThisNode::emitCode): Ditto.
3387 (KJS::ResolveNode::emitCode): Do nothing if dst == ignoredResult() and
3388 the identifier resolves to a local variable.
3389 (KJS::ObjectLiteralNode::emitCode): Do nothing if dst == ignoredResult()
3390 and the object is empty.
3391 (KJS::PostIncResolveNode::emitCode): If dst == ignoredResult(), then do
3392 nothing for the local constant case, and do a pre-increment in all the
3394 (KJS::PostDecResolveNode::emitCode): Ditto.
3395 (KJS::PostIncBracketNode::emitCode): Ditto.
3396 (KJS::PostDecBracketNode::emitCode): Ditto.
3397 (KJS::PostIncDotNode::emitCode): Ditto.
3398 (KJS::PostDecDotNode::emitCode): Ditto.
3399 (KJS::DeleteValueNode::emitCode): Pass ignoredResult() when evaluating
3401 (KJS::VoidNode::emitCode): Ditto.
3402 (KJS::TypeOfResolveNode::emitCode): If dst == ignoredResult(), do nothing
3403 if the identifier resolves to a local variable, and don't bother generating
3404 a typeof opcode in the other case.
3405 (KJS::TypeOfValueNode::emitCode): Ditto.
3406 (KJS::PreIncResolveNode::emitCode): Do nothing if dst == ignoredResult() and
3407 the identifier resolves to a local constant.
3408 (KJS::PreDecResolveNode::emitCode): Ditto.
3409 (KJS::AssignResolveNode::emitCode): Turn ignoredResult() into 0 in a couple
3410 places, because we need to put the result into a register so we can assign
3411 it. At other sites this is taken care of by functions like finalDestination.
3412 (KJS::CommaNode::emitCode): Pass ignoredResult() when evaluating the first
3414 (KJS::ForNode::emitCode): Pass ignoredResult() when evaluating the first and
3416 (KJS::ForInNode::emitCode): Pass ignoredResult() when evaluating the first
3419 2008-06-28 Darin Adler <darin@apple.com>
3423 - https://bugs.webkit.org/show_bug.cgi?id=19787
3424 create most arrays from values in registers rather than with multiple put operations
3426 SunSpider says 0.8% faster.
3429 (KJS::CodeBlock::dump): Added argv and argc parameters to new_array.
3431 (KJS::Machine::privateExecute): Ditto.
3433 * VM/CodeGenerator.cpp:
3434 (KJS::CodeGenerator::emitNewArray): Added.
3435 * VM/CodeGenerator.h: Added ElementNode* argument to emitNewArray.
3438 (KJS::ArrayNode::emitCode): Pass the ElementNode to emitNewArray so it can be
3439 initialized with as many elements as possible. If the array doesn't have any
3440 holes in it, that's all that's needed. If there are holes, then emit some separate
3441 put operations for the other values in the array and for the length as needed.
3443 * kjs/nodes.h: Added some accessors to ElementNode so the code generator can
3444 iterate through elements and generate code to evaluate them. Now ArrayNode does
3445 not need to be a friend. Also took out some unused PlacementNewAdoptType
3448 2008-06-28 Darin Adler <darin@apple.com>
3452 * kjs/nodes.h: Remove obsolete PlacementNewAdopt constructors.
3453 We no longer mutate the AST in place.
3455 2008-06-28 Jan Michael Alonzo <jmalonzo@webkit.org>
3457 Reviewed by Oliver Hunt.
3461 * VM/Machine.cpp: include stdio.h for printf
3463 2008-06-27 Sam Weinig <sam@webkit.org>
3465 Reviewed by Oliver Hunt.
3467 Fix platforms that don't use AllInOne.cpp
3469 * kjs/BooleanConstructor.h:
3470 * kjs/BooleanPrototype.h:
3471 * kjs/FunctionPrototype.cpp:
3473 2008-06-27 Sam Weinig <sam@webkit.org>
3475 Rubber-stamped by Oliver Hunt.
3477 Splits ArrayConstructor out of ArrayPrototype.h/cpp
3478 Splits BooleanConstructor and BooleanPrototype out of BooleanObject.h/cpp
3481 * JavaScriptCore.pri:
3482 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3483 * JavaScriptCore.xcodeproj/project.pbxproj:
3484 * JavaScriptCoreSources.bkl:
3486 * kjs/AllInOneFile.cpp:
3487 * kjs/ArrayConstructor.cpp: Copied from kjs/ArrayPrototype.cpp.
3488 * kjs/ArrayConstructor.h: Copied from kjs/ArrayPrototype.h.
3489 * kjs/ArrayPrototype.cpp:
3490 * kjs/ArrayPrototype.h:
3491 * kjs/BooleanConstructor.cpp: Copied from kjs/BooleanObject.cpp.
3492 * kjs/BooleanConstructor.h: Copied from kjs/BooleanObject.h.
3493 * kjs/BooleanObject.cpp:
3494 * kjs/BooleanObject.h:
3495 * kjs/BooleanPrototype.cpp: Copied from kjs/BooleanObject.cpp.
3496 * kjs/BooleanPrototype.h: Copied from kjs/BooleanObject.h.
3497 * kjs/CommonIdentifiers.h:
3498 * kjs/FunctionPrototype.cpp:
3500 * kjs/JSGlobalObject.cpp:
3501 * kjs/JSImmediate.cpp:
3505 * kjs/string_object.cpp:
3507 2008-06-27 Oliver Hunt <oliver@apple.com>
3511 Bug 18626: SQUIRRELFISH: support the "slow script" dialog <https://bugs.webkit.org/show_bug.cgi?id=18626>
3512 <rdar://problem/5973931> Slow script dialog needs to be reimplemented for squirrelfish
3514 Adds support for the slow script dialog in squirrelfish. This requires the addition
3515 of three new op codes, op_loop, op_loop_if_true, and op_loop_if_less which have the
3516 same behaviour as their simple jump equivalents but have an additional time out check.
3518 Additional assertions were added to other jump instructions to prevent accidentally
3519 creating loops with jump types that do not support time out checks.
3521 Sunspider does not report a regression, however this appears very sensitive to code
3522 layout and hardware, so i would expect up to a 1% regression on other systems.
3524 Part of this required moving the old timeout logic from JSGlobalObject and into Machine
3525 which is the cause of a number of the larger diff blocks.
3527 * JavaScriptCore.exp:
3529 (KJS::CodeBlock::dump):
3530 * VM/CodeGenerator.cpp:
3531 (KJS::CodeGenerator::emitJumpIfTrue):
3532 (KJS::CodeGenerator::emitJumpScopes):
3533 * VM/ExceptionHelpers.cpp:
3534 (KJS::InterruptedExecutionError::isWatchdogException):
3535 (KJS::createInterruptedExecutionException):
3536 * VM/ExceptionHelpers.h:
3539 (KJS::Machine::Machine):
3540 (KJS::Machine::throwException):
3541 (KJS::Machine::resetTimeoutCheck):
3542 (KJS::getCurrentTime):
3543 (KJS::Machine::checkTimeout):
3544 (KJS::Machine::privateExecute):
3546 (KJS::Machine::setTimeoutTime):
3547 (KJS::Machine::startTimeoutCheck):
3548 (KJS::Machine::stopTimeoutCheck):
3549 (KJS::Machine::initTimeout):