1 2008-08-06 Ariya Hidayat <ariya.hidayat@trolltech.com>
5 * wtf/RetainPtr.h: CoreFoundation only for PLATFORM(MAC)
7 2008-08-06 Ariya Hidayat <ariya.hidayat@trolltech.com>
11 * wtf/RetainPtr.h: CoreFoundation only for PLATFORM(MAC)
13 2008-08-06 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
15 Reviewed by Darin. Landed by Cameron.
17 Bug 20272: typo in JavaScriptCore
18 <https://bugs.webkit.org/show_bug.cgi?id=20272>
20 Correct the documentation for op_not. (typo)
24 (KJS::Machine::privateExecute):
26 2008-08-06 Cameron Zwarich <cwzwarich@webkit.org>
30 Bug 20286: Load constants all at once instead of using op_load
31 <https://bugs.webkit.org/show_bug.cgi?id=20286>
33 Load constants all at once into temporary registers instead of using
34 individual instances of op_load.
36 This is a 2.6% speedup on SunSpider.
40 (KJS::CodeBlock::dump):
41 (KJS::CodeBlock::mark):
43 * VM/CodeGenerator.cpp:
44 (KJS::CodeGenerator::CodeGenerator):
45 (KJS::CodeGenerator::newTemporary):
46 (KJS::CodeGenerator::addConstant):
47 (KJS::CodeGenerator::addUnexpectedConstant):
48 (KJS::CodeGenerator::emitLoad):
49 (KJS::CodeGenerator::emitUnexpectedLoad):
50 (KJS::CodeGenerator::emitNewError):
53 (KJS::slideRegisterWindowForCall):
54 (KJS::Machine::unwindCallFrame):
55 (KJS::Machine::throwException):
56 (KJS::Machine::execute):
57 (KJS::Machine::privateExecute):
61 (KJS::RegisterID::RegisterID):
62 (KJS::RegisterID::makeConstant):
63 (KJS::RegisterID::isTemporary):
66 (KJS::Parser::didFinishParsing):
71 (KJS::NullNode::emitCode):
72 (KJS::BooleanNode::emitCode):
73 (KJS::NumberNode::emitCode):
74 (KJS::StringNode::emitCode):
75 (KJS::ArrayNode::emitCode):
76 (KJS::DeleteResolveNode::emitCode):
77 (KJS::DeleteValueNode::emitCode):
78 (KJS::VoidNode::emitCode):
79 (KJS::ConstDeclNode::emitCodeSingle):
80 (KJS::ReturnNode::emitCode):
81 (KJS::ScopeNode::ScopeNode):
82 (KJS::ProgramNode::ProgramNode):
83 (KJS::ProgramNode::create):
84 (KJS::EvalNode::EvalNode):
85 (KJS::EvalNode::create):
86 (KJS::FunctionBodyNode::FunctionBodyNode):
87 (KJS::FunctionBodyNode::create):
88 (KJS::FunctionBodyNode::emitCode):
90 (KJS::ScopeNode::neededConstants):
92 2008-08-05 Maciej Stachowiak <mjs@apple.com>
96 - add fast path for immediates to % operator, as we have for many other math ops
98 This fixes handling for a 0 divisor relative to the last patch. Only an 0.2% speedup on SunSpider but
99 still a 1.4x win on Oliver's prime test.
102 (KJS::Machine::privateExecute):
104 2008-08-05 Cameron Zwarich <cwzwarich@uwaterloo.ca>
108 Bug 20293: Crash in JavaScript codegen for eval("const a;")
109 <https://bugs.webkit.org/show_bug.cgi?id=20293>
111 Correctly handle constant declarations in eval code with no initializer.
114 (KJS::ConstDeclNode::emitCodeSingle):
116 2008-08-05 Cameron Zwarich <cwzwarich@uwaterloo.ca>
120 Roll out r35555 because of correctness issues.
123 (KJS::Machine::privateExecute):
125 2008-08-05 Maciej Stachowiak <mjs@apple.com>
129 - add fast path for immediates to % operator, as we have for many other math ops
131 0.6% speedup on SunSpider. 1.4x speedup on a prime testing torture test that Oliver whipped up.
134 (KJS::Machine::privateExecute):
136 2008-07-31 Oliver Hunt <oliver@apple.com>
138 Reviewed by Cameron Zwarich.
140 Bug 19359: JavaScriptCore behaves differently from FF2/3 and IE when handling context in catch statement
141 <https://bugs.webkit.org/show_bug.cgi?id=19359>
143 Make our catch behave like Firefox and IE, we do this by using a StaticScopeObject
144 instead of a generic JSObject for the scope node. We still don't make use of the
145 fact that we have a static scope inside the catch block, so the internal performance
146 of the catch block is not improved, even though technically it would be possible to
150 (KJS::CodeBlock::dump):
151 * VM/CodeGenerator.cpp:
152 (KJS::CodeGenerator::emitPushNewScope):
153 * VM/CodeGenerator.h:
155 (KJS::createExceptionScope):
156 (KJS::Machine::privateExecute):
159 * kjs/JSStaticScopeObject.cpp:
160 (KJS::JSStaticScopeObject::toThisObject):
161 (KJS::JSStaticScopeObject::put):
162 * kjs/JSStaticScopeObject.h:
164 (KJS::TryNode::emitCode):
166 2008-08-02 Rob Gowin <robg@gowin.net>
168 Reviewed by Eric Seidel.
170 Added JavaScriptCore/API/WebKitAvailability to list of files in
171 javascriptcore_h_api.
175 2008-08-01 Alexey Proskuryakov <ap@webkit.org>
177 Rubber-stamped by Maciej.
179 Remove JSGlobalData::DataInstance. It was only needed when we had per-thread JSGlobalData
182 * kjs/JSGlobalData.h:
184 2008-07-31 Kevin Ollivier <kevino@theolliviers.com>
186 Second attempt at Windows/wx build fix. Instead of avoiding inclusion of windows.h,
187 use defines, etc. to avoid conflicts in each affected file. Also, change PLATFORM(WIN)
188 to PLATFORM(WIN_OS) so that other ports using Windows headers get the right impls.
190 * VM/SamplingTool.cpp:
193 2008-07-31 Anders Carlsson <andersca@apple.com>
200 * wtf/FastMalloc.cpp:
202 2008-07-31 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
206 Bug 20170: [Qt] missing namespace defines in JavaScriptCore.pro
207 <https://bugs.webkit.org/show_bug.cgi?id=20170>
209 * JavaScriptCore.pro: Added missing define.
211 2008-07-31 Alexey Proskuryakov <ap@webkit.org>
213 Rubber-stamped by Maciej.
215 Eliminate JSLock (it was already disabled, removing the stub implementaion and all
220 (JSCheckScriptSyntax):
222 * API/JSCallbackConstructor.cpp:
223 (KJS::constructJSCallback):
224 * API/JSCallbackFunction.cpp:
225 (KJS::JSCallbackFunction::call):
226 * API/JSCallbackObjectFunctions.h:
228 (KJS::::getOwnPropertySlot):
230 (KJS::::deleteProperty):
232 (KJS::::hasInstance):
234 (KJS::::getPropertyNames):
237 (KJS::::staticValueGetter):
238 (KJS::::callbackGetter):
239 * API/JSContextRef.cpp:
240 (JSGlobalContextCreateInGroup):
241 (JSGlobalContextRetain):
242 (JSGlobalContextRelease):
243 * API/JSObjectRef.cpp:
245 (JSObjectMakeFunctionWithCallback):
246 (JSObjectMakeConstructor):
247 (JSObjectMakeFunction):
248 (JSObjectHasProperty):
249 (JSObjectGetProperty):
250 (JSObjectSetProperty):
251 (JSObjectGetPropertyAtIndex):
252 (JSObjectSetPropertyAtIndex):
253 (JSObjectDeleteProperty):
254 (JSObjectCallAsFunction):
255 (JSObjectCallAsConstructor):
256 (JSObjectCopyPropertyNames):
257 (JSPropertyNameArrayRelease):
258 (JSPropertyNameAccumulatorAddName):
259 * API/JSStringRef.cpp:
261 * API/JSValueRef.cpp:
263 (JSValueIsInstanceOfConstructor):
267 (JSValueToStringCopy):
271 * ForwardingHeaders/JavaScriptCore/JSLock.h: Removed.
273 * JavaScriptCore.exp:
274 * JavaScriptCore.order:
275 * JavaScriptCore.pri:
276 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
277 * JavaScriptCore.xcodeproj/project.pbxproj:
278 * JavaScriptCoreSources.bkl:
279 * kjs/AllInOneFile.cpp:
280 * kjs/JSGlobalData.cpp:
281 (KJS::JSGlobalData::JSGlobalData):
282 * kjs/JSGlobalData.h:
283 * kjs/JSGlobalObject.cpp:
284 (KJS::JSGlobalObject::~JSGlobalObject):
285 (KJS::JSGlobalObject::init):
286 * kjs/JSLock.cpp: Removed.
287 * kjs/JSLock.h: Removed.
293 (KJS::Heap::heapAllocate):
294 (KJS::Heap::setGCProtectNeedsLocking):
295 (KJS::Heap::protect):
296 (KJS::Heap::unprotect):
297 (KJS::Heap::collect):
298 * kjs/identifier.cpp:
299 * kjs/interpreter.cpp:
300 (KJS::Interpreter::checkSyntax):
301 (KJS::Interpreter::evaluate):
303 2008-07-31 Alexey Proskuryakov <ap@webkit.org>
305 Rubber-stamped by Oliver Hunt.
307 Fix the Mac project to not display "test/" as part of file name for tests.
309 * JavaScriptCore.xcodeproj/project.pbxproj:
311 2008-07-31 Eric Seidel <eric@webkit.org>
313 Reviewed by Alexey Proskuryakov.
315 Rename USE(MULTIPLE_THREADS) to ENABLE(JSC_MULTIPLE_THREADS)
316 to better match the use/enable pattern (and better describe
317 the usage of the feature in question.)
319 I also fixed a couple other ENABLE_ macros to be pre-processor
320 definition override-able to match the rest of the ENABLE_ macros
321 since it seems to be our convention that build systems can set
322 ENABLE_ macros in Makefiles.
324 * kjs/InitializeThreading.cpp:
325 (KJS::initializeThreadingOnce):
326 * kjs/JSGlobalData.cpp:
327 (KJS::JSGlobalData::JSGlobalData):
328 (KJS::JSGlobalData::~JSGlobalData):
329 * kjs/MathObject.cpp:
333 (KJS::allocateBlock):
334 (KJS::Heap::markStackObjectsConservatively):
341 * wtf/FastMalloc.cpp:
343 * wtf/RefCountedLeakCounter.cpp:
345 2008-07-30 Eric Seidel <eric@webkit.org>
347 Reviewed by Mark Rowe.
349 Try to clean up our usage of USE(MULTIPLE_THREADS) vs. USE(PTHREADS) a little.
350 It looks like JSC assumes that if MULTIPLE_THREADS is defined, then pthreads will always be available
351 I'm not sure that's always the case for gtk, certainly not for Windows. We should eventually go back
352 and fix wtf/Threading.h to cover all these cases some day.
358 2008-07-30 Eric Seidel <eric@webkit.org>
362 MSVC warns when structs are called classes or vice versa.
363 Make all the source refer to JSGlobalData as a class.
365 * kjs/CommonIdentifiers.h:
366 * kjs/JSGlobalData.h:
370 2008-07-30 Alexey Proskuryakov <ap@webkit.org>
372 Reviewed by Geoff Garen.
374 Add consistency checks to UString to document and enforce its design.
377 (KJS::UString::Rep::create):
378 (KJS::UString::Rep::destroy):
379 (KJS::UString::Rep::checkConsistency):
380 (KJS::UString::expandCapacity):
381 (KJS::UString::expandPreCapacity):
382 (KJS::UString::UString):
383 (KJS::UString::spliceSubstringsWithSeparators):
384 (KJS::UString::append):
386 (KJS::UString::Rep::checkConsistency):
388 2008-07-30 Gavin Barraclough <barraclough@apple.com>
390 Reviewed by Geoff Garen.
392 Fixes for Windows and non-AllInOne file build with SamplingTool, plus review fixes.
394 * GNUmakefile.am: Adding SamplingTool.cpp to build.
395 * JavaScriptCore.exp: Export hooks to init & control SamplingTool.
396 * JavaScriptCore.pri: Adding SamplingTool.cpp to build.
397 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Adding SamplingTool.cpp to build.
398 * JavaScriptCore.xcodeproj/project.pbxproj: Adding SamplingTool.cpp to build.
399 * JavaScriptCoreSources.bkl: Adding SamplingTool.cpp to build.
400 * VM/Machine.cpp: MACHINE_SAMPLING_callingNativeFunction renamed MACHINE_SAMPLING_callingHostFunction
402 * VM/Opcode.cpp: SamplingTool moved to SamplingTool.cpp/.h, opcodeNames generated from FOR_EACH_OPCODE_ID.
404 * VM/SamplingTool.cpp: Added .cpp/.h for SamplingTool.
406 * kjs/Shell.cpp: Switched SAMPLING_TOOL_ENABLED to ENABLE_SAMPLING_TOOL.
407 * wtf/Platform.h: Added ENABLE_SAMPLING_TOOL config option.
408 * kjs/nodes.cpp: Header include to fix non-AllInOne builds.
410 2008-07-30 Ariya Hidayat <ariya.hidayat@trolltech.com>
412 Reviewed by Alexey Proskuryakov.
414 Fix compilation without multi-threading support.
419 2008-07-30 Anders Carlsson <andersca@apple.com>
421 Add WebKitAvailability.h forwarding header.
423 * ForwardingHeaders/JavaScriptCore/WebKitAvailability.h: Added.
425 2008-07-30 Anders Carlsson <andersca@apple.com>
429 * API/WebKitAvailability.h:
431 2008-07-30 Anders Carlsson <andersca@apple.com>
433 * API/WebKitAvailability.h:
434 Fix Windows (and other non-Mac builds).
436 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
437 Add WebKitAvailability.h to the project.
439 2008-07-30 Anders Carlsson <andersca@apple.com>
441 One step closer towards fixing the Windows build.
443 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
444 Make sure to copy WebKitAvailability.h
446 2008-07-29 Gavin Barraclough <barraclough@apple.com>
448 Reviewed by Geoff Garen.
450 Bug 20209: Atomize constant strings
451 <https://bugs.webkit.org/show_bug.cgi?id=20209>
453 Prevents significant performance degradation seen when a script contains multiple
454 identical strings that are used as keys to identify properties on objects.
456 No performance change on SunSpider.
458 * kjs/nodes.cpp: Atomize constant strings.
460 2008-07-30 Oliver Hunt <oliver@apple.com>
462 Reviewed by Alexey Proskuryakov.
464 <rdar://problem/6111648> JavaScript exceptions fail if the scope chain includes the global object
466 In an attempt to remove the branch I just added to KJS::depth I
467 used the existence of a Variable Object at a point in the scope
468 chain as an indicator of function or global scope activation.
469 However this assumption results in incorrect behaviour if the
470 global object is injected into the scope chain with 'with'.
475 2008-07-30 Alexey Proskuryakov <ap@webkit.org>
477 Reviewed by Geoff Garen.
479 Don't call JSGarbageCollect() on a released context.
481 * API/testapi.c: (main):
483 2008-07-29 Alexey Proskuryakov <ap@webkit.org>
485 Reviewed by Geoff Garen.
487 Implement JSContextGroup APIs to make concurrent execution possible for
488 JavaScriptCore clients.
490 This changes the behavior of JSGlobalContextCreate(), so that it now uses a private context
491 group for each context, making JSlock implicit locking unnecessary.
493 * API/JSContextRef.h:
494 * API/JSContextRef.cpp:
495 (JSContextGroupCreate):
496 (JSContextGroupRetain):
497 (JSContextGroupRelease):
498 (JSGlobalContextCreate):
499 (JSGlobalContextCreateInGroup):
500 (JSGlobalContextRelease):
502 Added new methods. JSGlobalContextCreate() calls JSGlobalContextCreateInGroup() now.
504 * API/APICast.h: (toJS): (toRef): Added converters for JSContextGroupRef.
505 * API/JSBase.cpp: (JSGarbageCollect): JSGarbageCollect(0) is now a no-op, and the passed in
506 context is actually used.
508 * API/JSBase.h: Aded a typedef for JSContextGroupRef. Updated documentation for
511 * JavaScriptCore.exp: Removed JSGlobalData::sharedInstance().
513 * kjs/JSGlobalData.cpp:
514 * kjs/JSGlobalData.h:
515 Removed support for JSGlobalData shared instance. JSGlobalData::isSharedInstance member
516 variable still remains, to be deleted in a followup patch.
518 * kjs/JSLock.cpp: (KJS::JSLock::JSLock): Disabled JSLock, to be deleted in a follow-up patch.
521 (KJS::Heap::markOtherThreadConservatively): Removed an assertion that referenced
522 JSGlobalData::sharedInstance.
524 * kjs/collector.h: Made Heap destructor public, so that JSContextRelease can use it.
526 2008-07-29 Alexey Proskuryakov <ap@webkit.org>
528 Reviewed by Geoff Garen.
530 Fix a leak of ThreadRegistrar objects.
532 As the heap is usually deleted when registered threads still exist, ThreadSpecific doesn't
533 have a chance to clean up per-thread object. Switched to native pthread calls, storing a
534 plain pointer that doesn't require cleanup.
537 (KJS::PlatformThread::PlatformThread):
538 (KJS::Heap::Thread::Thread):
541 (KJS::Heap::registerThread):
542 (KJS::Heap::unregisterThread):
545 2008-07-29 Alexey Proskuryakov <ap@webkit.org>
547 Reviewed by Sam Weinig.
549 https://bugs.webkit.org/show_bug.cgi?id=20169
550 Memory allocated with fastMalloc is freed with delete
552 * VM/JSPropertyNameIterator.cpp:
553 (KJS::JSPropertyNameIterator::invalidate): Free the array properly.
554 (KJS::JSPropertyNameIterator::~JSPropertyNameIterator): Delete the array by calling
557 2008-07-29 Mark Rowe <mrowe@apple.com>
559 Attempt to fix the Qt build.
561 * wtf/ThreadingQt.cpp: Add the extra argument to createThread.
563 2008-07-29 Adam Roben <aroben@apple.com>
565 Change Vector::find to return an index instead of an iterator
567 Indices are more natural than iterators when working with Vector.
569 Reviewed by John Sullivan.
572 (WTF::Vector::find): Changed to iterate the Vector manually and return
573 the index of the found item, rather than an iterator. When the item
574 could not be found, we return WTF::notFound.
576 2008-07-29 Adam Roben <aroben@apple.com>
580 * wtf/ThreadingWin.cpp:
581 (WTF::setThreadName): Move a misplaced assertion to here...
582 (WTF::createThread): ...from here.
584 2008-07-29 Adam Roben <aroben@apple.com>
586 Add support for setting thread names on Windows
588 These thread names make it much easier to identify particular threads
589 in Visual Studio's Threads panel.
591 WTF::createThread now takes a const char* representing the thread's
592 name. On Windows, we throw a special exception to set this string as
593 the thread's name. Other platforms do nothing with this name for now.
595 Reviewed by Anders Carlsson.
597 * JavaScriptCore.exp: Export the new version of createThread that
598 takes 3 arguments (the old one continues to be exported for backward
600 * wtf/Threading.h: Add a threadName argument to createThread.
602 * wtf/ThreadingGtk.cpp:
604 * wtf/ThreadingNone.cpp:
606 Updated for function signature change.
608 * wtf/ThreadingPthreads.cpp:
609 (WTF::createThread): Updated for function signature change. We keep
610 around the old 2-argument version of createThread for backward
613 * wtf/ThreadingWin.cpp:
614 (WTF::setThreadName): Added. This function's implementation came from
616 (WTF::initializeThreading): Set the name of the main thread.
617 (WTF::createThread): Call setThreadName. We keep around the old
618 2-argument version of createThread for backward compatibility.
620 2008-07-29 Alexey Proskuryakov <ap@webkit.org>
622 Reviewed by Oliver Hunt.
624 Store UString::Rep::isStatic bit in identifierTable pointer instead of reportedCost for
625 slightly nicer code and a 0.5% SunSpider improvement.
627 * API/JSClassRef.cpp:
628 (OpaqueJSClass::~OpaqueJSClass):
629 (OpaqueJSClassContextData::OpaqueJSClassContextData):
630 * API/JSStringRef.cpp:
632 * kjs/PropertyNameArray.cpp:
633 (KJS::PropertyNameArray::add):
634 * kjs/identifier.cpp:
635 (KJS::IdentifierTable::~IdentifierTable):
636 (KJS::IdentifierTable::add):
637 (KJS::Identifier::addSlowCase):
638 (KJS::Identifier::remove):
640 (KJS::Identifier::add):
643 (KJS::UString::Rep::create):
644 (KJS::UString::Rep::destroy):
646 (KJS::UString::Rep::identifierTable):
647 (KJS::UString::Rep::setIdentifierTable):
648 (KJS::UString::Rep::isStatic):
649 (KJS::UString::Rep::setStatic):
650 (KJS::UString::cost):
652 2008-07-28 Geoffrey Garen <ggaren@apple.com>
654 Reviewed by Sam Weinig.
656 Renamed "ConstructTypeNative" => "ConstructTypeHost".
658 2008-07-26 Mark Rowe <mrowe@apple.com>
660 Speculative fix for the wx build.
662 * JavaScriptCoreSources.bkl: Add JSStaticScopeObject.cpp to the list of source files.
664 2008-07-25 Oliver Hunt <oliver@apple.com>
668 Whoops, forgot to save style correction.
670 * kjs/JSStaticScopeObject.h:
672 2008-07-25 Oliver Hunt <oliver@apple.com>
674 Reviewed by Cameron Zwarich.
676 Bug 19718: Named anonymous functions are slow accessing global variables
677 <https://bugs.webkit.org/show_bug.cgi?id=19718>
679 To fix this we switch over to an activation-like scope object for
680 on which we attach the function name property, and add logic to
681 prevent cross scope assignment to read only properties.
684 * JavaScriptCore.pri:
685 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
686 * JavaScriptCore.xcodeproj/project.pbxproj:
687 * VM/CodeGenerator.cpp:
688 (KJS::CodeGenerator::findScopedProperty):
689 (KJS::CodeGenerator::emitResolve):
690 * VM/CodeGenerator.h:
691 * kjs/AllInOneFile.cpp:
692 * kjs/JSStaticScopeObject.cpp: Added.
693 (KJS::JSStaticScopeObject::putWithAttributes):
694 (KJS::JSStaticScopeObject::isDynamicScope):
695 (KJS::JSStaticScopeObject::~JSStaticScopeObject):
696 (KJS::JSStaticScopeObject::getOwnPropertySlot):
697 * kjs/JSStaticScopeObject.h: Added.
698 (KJS::JSStaticScopeObject::JSStaticScopeObjectData::JSStaticScopeObjectData):
699 (KJS::JSStaticScopeObject::JSStaticScopeObject):
701 (KJS::FunctionCallResolveNode::emitCode):
702 (KJS::PostfixResolveNode::emitCode):
703 (KJS::PrefixResolveNode::emitCode):
704 (KJS::ReadModifyResolveNode::emitCode):
705 (KJS::AssignResolveNode::emitCode):
706 (KJS::FuncExprNode::makeFunction):
708 2008-07-25 kevino <kevino@theolliviers.com>
710 wx build fix for Win.
712 On wx/Win, including windows.h in Threading.h causes multiply-defined symbol errors
713 for libjpeg and wx, and also wx needs to include windows.h itself first for wx
714 includes to work right. So until we can find a better solution to this problem,
715 on wx, we work around the need to include windows.h here.
719 2008-07-25 Adam Roben <aroben@apple.com>
723 * JavaScriptCore.vcproj/testapi/testapi.vcproj: Add API/ to the
726 2008-07-25 Simon Hausmann <hausmann@webkit.org>
728 Fix the build of jsc on Qt/Windows, make sure os-win32 is in the
729 include search path (added by WebKit.pri).
733 2008-07-25 Alexey Proskuryakov <ap@webkit.org>
735 Reviewed by Simon Hausmann.
737 Move JavaScriptCore API tests into a subdirectory of their own to avoid header name
738 conflicts and developer confusion.
740 * API/JSNode.c: Removed.
741 * API/JSNode.h: Removed.
742 * API/JSNodeList.c: Removed.
743 * API/JSNodeList.h: Removed.
744 * API/Node.c: Removed.
745 * API/Node.h: Removed.
746 * API/NodeList.c: Removed.
747 * API/NodeList.h: Removed.
748 * API/minidom.c: Removed.
749 * API/minidom.html: Removed.
750 * API/minidom.js: Removed.
751 * API/testapi.c: Removed.
752 * API/testapi.js: Removed.
754 * API/tests/JSNode.c: Copied from JavaScriptCore/API/JSNode.c.
755 * API/tests/JSNode.h: Copied from JavaScriptCore/API/JSNode.h.
756 * API/tests/JSNodeList.c: Copied from JavaScriptCore/API/JSNodeList.c.
757 * API/tests/JSNodeList.h: Copied from JavaScriptCore/API/JSNodeList.h.
758 * API/tests/Node.c: Copied from JavaScriptCore/API/Node.c.
759 * API/tests/Node.h: Copied from JavaScriptCore/API/Node.h.
760 * API/tests/NodeList.c: Copied from JavaScriptCore/API/NodeList.c.
761 * API/tests/NodeList.h: Copied from JavaScriptCore/API/NodeList.h.
762 * API/tests/minidom.c: Copied from JavaScriptCore/API/minidom.c.
763 * API/tests/minidom.html: Copied from JavaScriptCore/API/minidom.html.
764 * API/tests/minidom.js: Copied from JavaScriptCore/API/minidom.js.
765 * API/tests/testapi.c: Copied from JavaScriptCore/API/testapi.c.
766 * API/tests/testapi.js: Copied from JavaScriptCore/API/testapi.js.
768 * JavaScriptCore.vcproj/testapi/testapi.vcproj:
769 * JavaScriptCore.xcodeproj/project.pbxproj:
771 2008-07-25 Simon Hausmann <hausmann@webkit.org>
773 Prospective WX build fix, add JavaScriptCore/API to the include search
778 2008-07-25 Simon Hausmann <hausmann@webkit.org>
780 Rubber-stamped by Lars.
782 Fix the build on Windows. operator new for ArgList is implemented using fastMalloc()
783 but operator delete was not implemented. Unfortunately MSVC decides to call/reference
784 the function, so a simple implementation using fastFree() fixes the build.
787 (KJS::ArgList::operator delete):
789 2008-07-25 Simon Hausmann <hausmann@webkit.org>
791 Discussed with and rubber-stamped by Lars.
793 Fix the build system for the Qt port.
795 Recent JavaScriptCore changes require the addition of JavaScriptCore/API to the
796 include search path. With a build process that combines JavaScriptCore and
797 WebCore in one build process/Makefile the existance of
798 JavaScriptCore/API/Node.h and WebCore/dom/Node.h causes include conflicts.
800 This commit solves this by introducing a separate build of JavaScriptCore into
803 As a result of the split-up a race-condition due to broken dependencies of
804 regular source files to header files of generated sources showed up very
805 frequently when doing parallel builds (which the buildbot does). This commit at
806 the same time tries to address the dependency problem by making the
807 addExtraCompiler() function also generate a pseudo extra compiler that
808 represents the header file output, so that qmake is aware of the creation of
809 the header file for dependency calculation.
811 At the same time I removed a lot of cruft from the pro files to ease maintenance.
813 * JavaScriptCore.pri:
814 * JavaScriptCore.pro: Added.
817 2008-07-24 Geoffrey Garen <ggaren@apple.com>
819 Reviewed by Maciej Stachowiak.
821 Fixed a strict aliasing violation, which caused hash tables with floating
822 point keys not to find items that were indeed in the tables
823 (intermittently, and only in release builds, of course).
825 SunSpider reports no change.
827 This bug doesn't seem to affect any existing code, but it causes obvious
828 crashes in some new code I'm working on.
830 * wtf/HashFunctions.h:
831 (WTF::FloatHash::hash): Use a union when punning between a float / double
832 and an unsigned (bucket of bits). With strict aliasing enabled, unions
833 are the only safe way to do this kind of type punning.
835 * wtf/HashTable.h: When rehashing, ASSERT that the item we just added to
836 the table is indeed in the table. In the buggy case described above, this
839 2008-07-24 Oliver Hunt <oliver@apple.com>
841 Reviewed by Alexey Proskuryakov.
843 Bug 20142: REGRESSION(r35245): /=/ weirdness
844 <https://bugs.webkit.org/show_bug.cgi?id=20142>
846 When adding all the meta data needed for exception error messages
847 I accidentally clobbered the handling of regex beginning with /=.
851 2008-07-23 Alp Toker <alp@nuanti.com>
853 Build fix after r35293: Add API/ to the include path.
857 2008-07-23 Adam Roben <aroben@apple.com>
861 Build fix after r35293:
863 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add API/
866 Build fix after r35305:
872 Completely compile out all sampler-related code when
873 SAMPLING_TOOL_ENABLED is 0. The sampler code can't be compiled 1) on
874 non-AllInOne configurations due to circular header dependencies, and
875 2) on platforms that don't have a usleep() function, such as Windows.
877 2008-07-23 Oliver Hunt <oliver@apple.com>
879 Reviewed by Geoff Garen and Sam Weinig.
881 Improve switch performance.
883 Improve switch performance by converting to a hashmap based jump
884 table to avoid the sequence of dispatches that would otherwise be
885 needed. This results in a 9-19x performance win for string switches
886 based on ad hoc testing, and a 6x improvement for integer switch
887 statements. SunSpider reports a 1.2% progression.
890 (KJS::CodeBlock::dump):
891 (KJS::SimpleJumpTable::offsetForValue):
893 * VM/CodeGenerator.cpp:
894 (KJS::CodeGenerator::beginSwitch):
895 (KJS::prepareJumpTableForImmediateSwitch):
896 (KJS::prepareJumpTableForCharacterSwitch):
897 (KJS::prepareJumpTableForStringSwitch):
898 (KJS::CodeGenerator::endSwitch):
899 * VM/CodeGenerator.h:
901 (KJS::offsetForStringSwitch):
902 (KJS::Machine::privateExecute):
909 (KJS::processClauseList):
910 (KJS::CaseBlockNode::tryOptimisedSwitch):
911 (KJS::CaseBlockNode::emitCodeForBlock):
915 2008-07-23 Gavin Barraclough <barraclough@apple.com>
917 Reviewed by Geoff Garen.
919 Sampling tool to analyze cost of instruction execution and identify hot regions of JS code.
920 Enable Switches by setting SAMPLING_TOOL_ENABLED in Opcode.h.
922 * JavaScriptCore.exp: Export symbols for Shell.cpp.
923 * VM/Machine.cpp: Added sampling hooks.
924 * VM/Machine.h: Machine contains a pointer to a sampler, when sampling.
925 * VM/Opcode.cpp: Tool implementation.
926 * VM/Opcode.h: Tool declaration.
927 * kjs/Shell.cpp: Initialize the sampler, if enabled.
928 * kjs/nodes.cpp: Added sampling hooks.
930 2008-07-23 Gabor Loki <loki@inf.u-szeged.hu>
932 Bug 20097: [Qt] 20% Sunspider slow-down
934 <https://bugs.webkit.org/show_bug.cgi?id=20097>
936 Reviewed by Simon Hausmann.
938 * kjs/jsc.pro: Added missing NDEBUG define for release builds.
940 2008-07-23 Alexey Proskuryakov <ap@webkit.org>
942 Reviewed by Geoff Garen.
944 JSClassRef is created context-free, but gets infatuated with the first context it sees.
946 The implicit API contract is that JSClassRef can be used with any context on any thread.
947 This no longer worked, because UStrings in the class were turned into per-context
948 identifiers, and the cached JSObject prototype was tied to JSGlobalData, too.
950 * API/JSClassRef.h: Made a separate struct for context-dependent parts of OpaqueJSClass.
951 * API/JSClassRef.cpp:
952 (OpaqueJSClass::OpaqueJSClass): Updated for renames and changed member variable order.
953 (OpaqueJSClass::~OpaqueJSClass): Assert that string members are not identifiers.
954 (clearReferenceToPrototype): Update for the new reference location.
955 (OpaqueJSClassContextData::OpaqueJSClassContextData): Make a deep copy of all strings.
956 (OpaqueJSClass::contextData): Added a function that finds the per-context part of
957 OpaqueJSClass in JSGlobalData, or creates it if not found.
958 (OpaqueJSClass::className): Always make a deep copy. Callers of this function do not have
959 a way to access JSGlobalData, so a per-context copy could not be made.
960 (OpaqueJSClass::staticValues): Updated for new data location.
961 (OpaqueJSClass::staticFunctions): Ditto.
962 (OpaqueJSClass::prototype): Changed to take an internal type for consistency.
964 * kjs/JSGlobalData.cpp:
965 (KJS::JSGlobalData::JSGlobalData):
966 (KJS::JSGlobalData::~JSGlobalData):
967 * kjs/JSGlobalData.h:
968 Keep a HashMap to access per-context JSClass data given a pointr to the shared part.
970 * API/JSCallbackObjectFunctions.h:
972 (KJS::::getOwnPropertySlot):
974 (KJS::::deleteProperty):
975 (KJS::::getPropertyNames):
976 (KJS::::staticValueGetter):
977 (KJS::::staticFunctionGetter):j
978 Use function accessors instead of accessing OpaqueJSClass members directly.
980 * API/JSContextRef.cpp: (JSGlobalContextCreate): Updated for the change in
981 OpaqueJSClass::prototype() argument type.
983 * API/JSObjectRef.cpp:
984 (JSObjectMake): Updated for the change in OpaqueJSClass::prototype() argument type.
985 (JSObjectMakeConstructor): Ditto.
987 2008-07-23 Alexey Proskuryakov <ap@webkit.org>
991 * kjs/ArgList.h: (KJS::ArgList::operator new): removed an extraneous "ArgList::" inside the
994 2008-07-22 Geoffrey Garen <ggaren@apple.com>
996 Reviewed by Oliver Hunt and Sam Weinig.
998 Next step toward putting doubles in registers: Prepare the Register class
999 and its clients for registers that don't contain JSValue*s.
1001 This means a few things:
1003 1. Register::jsValue() clients, including ArgList clients, must now supply
1004 an ExecState* when accessing an entry in an ArgList, in case the entry
1005 will need to create a JSValue* on the fly.
1007 2. Register clients that definitely don't want to create a JSValue* on
1008 the fly now use different APIs: getJSValue() for clients that know
1009 the register contains a JSValue*, and v() for clients who just want a
1012 3. I had to change some headers around in order to resolve dependency
1013 problems created by using a Register in the ArgList header.
1015 SunSpider reports no change.
1017 2008-07-22 Gavin Barraclough <barraclough@apple.com>
1019 Reviewed by Alexey Proskuryakov.
1021 Prevent integer overflow when reallocating storage vector for arrays.
1023 Sunspider reports 1.005x as fast (no change expected).
1027 2008-07-21 Mark Rowe <mrowe@apple.com>
1029 Reviewed by Sam Weinig.
1031 <rdar://problem/6091287> Revamp the handling of CFBundleShortVersionString to be fixed at the major component of the version number.
1033 * Configurations/Version.xcconfig:
1036 2008-07-21 Adam Roben <aroben@apple.com>
1040 This is a convenience wrapper around std::find.
1042 Reviewed by Anders Carlsson.
1046 2008-07-19 Oliver Hunt <oliver@apple.com>
1048 Reviewed by Cameron Zwarich.
1050 Bug 20104: Exception in tables/mozilla_expected_failures/bugs/bug92868_1.html includes the equals operator in the quoted expression
1051 <https://bugs.webkit.org/show_bug.cgi?id=20104>
1053 To make this correct we make the dot and bracket assign nodes emit the information to indicate
1054 the failure range is the dot/bracket accessor.
1058 2008-07-18 Steve Falkenburg <sfalken@apple.com>
1062 * kjs/JSGlobalObjectFunctions.cpp:
1063 (KJS::isStrWhiteSpace):
1065 2008-07-18 Steve Falkenburg <sfalken@apple.com>
1070 (KJS::ThrowableExpressionData::ThrowableExpressionData):
1072 2008-07-18 Oliver Hunt <oliver@apple.com>
1074 Reviewed by Cameron Zwarich.
1076 Bug 18774: SQUIRRELFISH: print meaningful error messages <https://bugs.webkit.org/show_bug.cgi?id=18774>
1077 <rdar://problem/5769353> SQUIRRELFISH: JavaScript error messages are missing informative text
1079 Add support for decent error messages in JavaScript. This patch achieves this by providing
1080 ensuring the common errors and exceptions have messages that provide the text of expression
1081 that trigger the exception. In addition it attaches a number of properties to the exception
1082 object detailing where in the source the expression came from.
1084 * JavaScriptCore.exp:
1086 (KJS::CodeBlock::lineNumberForVPC):
1087 (KJS::CodeBlock::expressionRangeForVPC):
1088 Function to recover the expression range for an instruction
1089 that triggered an exception.
1091 (KJS::ExpressionRangeInfo::):
1092 (KJS::CodeBlock::CodeBlock):
1093 * VM/CodeGenerator.cpp:
1094 (KJS::CodeGenerator::emitCall):
1095 (KJS::CodeGenerator::emitCallEval):
1096 Emit call needed to be modified so to place the expression range info internally,
1097 as the CodeGenerator emits the arguments nodes itself, rather than the various call
1099 * VM/CodeGenerator.h:
1100 (KJS::CodeGenerator::emitExpressionInfo):
1101 Record the expression range info.
1102 * VM/ExceptionHelpers.cpp:
1103 (KJS::createErrorMessage):
1104 (KJS::createInvalidParamError):
1105 (KJS::createUndefinedVariableError):
1106 (KJS::createNotAConstructorError):
1107 (KJS::createNotAFunctionError):
1108 (KJS::createNotAnObjectErrorStub):
1109 (KJS::createNotAnObjectError):
1110 Rewrite all the code for the error messages so that they make use of the newly available
1112 * VM/ExceptionHelpers.h:
1114 (KJS::isNotObject): Now needs vPC and codeBlock
1115 (KJS::Machine::throwException):
1116 New logic to handle the NotAnObjectErrorStub and to handle the absurd "no default value" edge case
1117 (KJS::Machine::privateExecute):
1119 * kjs/DebuggerCallFrame.cpp:
1120 (KJS::DebuggerCallFrame::evaluate):
1122 (KJS::Error::create):
1124 * kjs/JSGlobalObjectFunctions.cpp:
1125 * kjs/JSImmediate.cpp:
1126 (KJS::JSImmediate::toObject):
1127 (KJS::JSImmediate::prototype):
1128 My changes to the JSNotAnObject constructor needed to be handled here.
1129 * kjs/JSNotAnObject.h:
1130 (KJS::JSNotAnObjectErrorStub::JSNotAnObjectErrorStub):
1131 (KJS::JSNotAnObjectErrorStub::isNull):
1132 (KJS::JSNotAnObjectErrorStub::isNotAnObjectErrorStub):
1133 Added a JSNotAnObjectErrorStub class to ease the handling of toObject failure exceptions,
1134 and potentially allow even more detailed error messages in future.
1137 (KJS::Parser::parse):
1138 * kjs/SourceRange.h:
1140 Large amounts of position propagation.
1142 (KJS::Lexer::Lexer):
1143 (KJS::Lexer::shift):
1145 The lexer needed a few changes to be able to correctly track token character positions.
1148 (KJS::ThrowableExpressionData::emitThrowError):
1149 (KJS::StatementNode::StatementNode):
1150 (KJS::ResolveNode::emitCode):
1151 (KJS::BracketAccessorNode::emitCode):
1152 (KJS::DotAccessorNode::emitCode):
1153 (KJS::NewExprNode::emitCode):
1154 (KJS::EvalFunctionCallNode::emitCode):
1155 (KJS::FunctionCallValueNode::emitCode):
1156 (KJS::FunctionCallResolveNode::emitCode):
1157 (KJS::FunctionCallBracketNode::emitCode):
1158 (KJS::FunctionCallDotNode::emitCode):
1159 (KJS::PostfixResolveNode::emitCode):
1160 (KJS::PostfixBracketNode::emitCode):
1161 (KJS::PostfixDotNode::emitCode):
1162 (KJS::DeleteResolveNode::emitCode):
1163 (KJS::DeleteBracketNode::emitCode):
1164 (KJS::DeleteDotNode::emitCode):
1165 (KJS::PrefixResolveNode::emitCode):
1166 (KJS::PrefixBracketNode::emitCode):
1167 (KJS::PrefixDotNode::emitCode):
1168 (KJS::ThrowableBinaryOpNode::emitCode):
1169 (KJS::ReadModifyResolveNode::emitCode):
1170 (KJS::AssignResolveNode::emitCode):
1171 (KJS::AssignDotNode::emitCode):
1172 (KJS::ReadModifyDotNode::emitCode):
1173 (KJS::AssignBracketNode::emitCode):
1174 (KJS::ReadModifyBracketNode::emitCode):
1175 (KJS::ForInNode::ForInNode):
1176 (KJS::ForInNode::emitCode):
1177 (KJS::WithNode::emitCode):
1178 (KJS::LabelNode::emitCode):
1179 (KJS::ThrowNode::emitCode):
1180 (KJS::ProgramNode::ProgramNode):
1181 (KJS::ProgramNode::create):
1182 (KJS::EvalNode::generateCode):
1183 (KJS::FunctionBodyNode::create):
1184 (KJS::FunctionBodyNode::generateCode):
1185 (KJS::ProgramNode::generateCode):
1186 All of these methods were handling the position information.
1187 Constructors and create methods were modified to store the information.
1188 All the emitCall implementations listed needed to be updated to actually
1189 record the position information we have so carefully collected.
1191 (KJS::ThrowableExpressionData::ThrowableExpressionData):
1192 (KJS::ThrowableExpressionData::setExceptionSourceRange):
1193 (KJS::ThrowableExpressionData::divot):
1194 (KJS::ThrowableExpressionData::startOffset):
1195 (KJS::ThrowableExpressionData::endOffset):
1196 (KJS::ThrowableSubExpressionData::ThrowableSubExpressionData):
1197 (KJS::ThrowableSubExpressionData::setSubexpressionInfo):
1198 (KJS::ThrowablePrefixedSubExpressionData::ThrowablePrefixedSubExpressionData):
1199 (KJS::ThrowablePrefixedSubExpressionData::setSubexpressionInfo):
1200 ThrowableExpressionData is just a uniform mechanism for storing the position
1202 (KJS::ResolveNode::):
1203 (KJS::PrePostResolveNode::):
1204 (KJS::ThrowableBinaryOpNode::):
1207 2008-07-18 Geoffrey Garen <ggaren@apple.com>
1209 Reviewed by Cameron Zwarich.
1213 "CallTypeNative" => "CallTypeHost"
1214 "code" => "byteCode"
1215 "generatedCode" => "generatedByteCode"
1217 2008-07-18 Geoffrey Garen <ggaren@apple.com>
1219 Reviewed by Oliver Hunt.
1221 Optimized <= for immediate number cases.
1223 SunSpider reports no overall change, but a 10% speedup on access-nsieve.
1225 2008-07-18 Mark Rowe <mrowe@apple.com>
1227 Rubber-stamped by Sam Weinig.
1229 Fix some casts added in a previous build fix to match the style used
1233 (KJS::Machine::initializeCallFrame):
1235 (KJS::Register::Register):
1237 2008-07-18 Landry Breuil <landry@openbsd.org>
1239 Bug 19975: [OpenBSD] Patches to enable build of WebKit
1241 <https://bugs.webkit.org/show_bug.cgi?id=19975>
1243 Reviewed by David Kilzer.
1245 Support for OpenBSD, mostly threading and libm tweaks.
1247 * kjs/collector.cpp: #include <pthread.h>
1248 (KJS::currentThreadStackBase): use pthread_stackseg_np() to get stack base
1249 * kjs/config.h: OpenBSD also provides <pthread_np.h>
1250 * wtf/MathExtras.h: #include <sys/types.h> and <machine/ieee.h>
1251 (isfinite), (signbit): as long as we don't have those functions provide fallback implementations
1252 * wtf/Platform.h: Add support for PLATFORM(OPENBSD) and PLATFORM(SPARC64) macro
1254 2008-07-17 Geoffrey Garen <ggaren@apple.com>
1256 Reviewed by Oliver Hunt.
1258 Next step toward putting doubles in registers: Store constant pool
1259 entries as registers, not JSValue*s.
1261 SunSpider reports no change.
1263 2008-07-17 Geoffrey Garen <ggaren@apple.com>
1265 Reviewed by John Sullivan and Oliver Hunt.
1267 A tiny bit of tidying in function call register allocation.
1269 This patch saves one register when invoking a function expression and/or
1270 a new expression that is stored in a temporary.
1272 Since it's just one register, I can't make a testcase for it.
1274 * VM/CodeGenerator.cpp:
1275 (KJS::CodeGenerator::emitCall): No need to ref the function we're calling
1276 or its base. We'd like the call frame to overlap with them, if possible.
1277 op_call will read the function and its base before writing the call frame,
1281 (KJS::NewExprNode::emitCode): No need to ref the function we're new-ing,
1282 for the same reasons stated above.
1284 (KJS::FunctionCallValueNode::emitCode): ditto
1286 2008-07-17 Steve Falkenburg <sfalken@apple.com>
1290 * kjs/InternalFunction.cpp:
1292 2008-07-17 Sam Weinig <sam@webkit.org>
1294 Roll out r35199 as it is causing failures on the PPC build.
1296 2008-07-17 Geoffrey Garen <ggaren@apple.com>
1298 Reviewed by David Kilzer.
1300 Fixed https://bugs.webkit.org/show_bug.cgi?id=20067
1301 Support function.name (Firefox extension)
1303 Pretty straight-forward.
1305 2008-07-17 Geoffrey Garen <ggaren@apple.com>
1307 Reviewed by Oliver Hunt.
1309 Fixed <rdar://problem/6081636> Functions calls use more temporary
1310 registers than necessary
1312 Holding a reference to the last statement result register caused each
1313 successive statement to output its result to an even higher register.
1315 Happily, statements don't actually need to return a result register
1316 at all. I hope to make this clearer in a future cleanup patch,
1317 but this change will fix the major bug for now.
1320 (KJS::statementListEmitCode):
1322 2008-07-17 Gavin Barraclough <barraclough@apple.com>
1324 Reviewed by Sam Weinig.
1326 Merge pre&post dot nodes to simplify the parse tree.
1327 Sunspider results show 0.6% progression (no performance change expected).
1332 * kjs/nodes2string.cpp:
1334 2008-07-17 Gavin Barraclough <barraclough@apple.com>
1336 Reviewed by Cameron Zwarich.
1338 Merge pre&post resolve nodes to simplify the parse tree.
1339 Sunspider results show no performance change.
1344 * kjs/nodes2string.cpp:
1346 2008-07-17 Gavin Barraclough <barraclough@apple.com>
1348 Reviewed by Cameron Zwarich.
1350 Merge logical nodes to simplify the parse tree.
1351 Sunspider results show 0.6% progression (no performance change expected).
1356 * kjs/nodes2string.cpp:
1358 2008-07-17 Ariya Hidayat <ariya.hidayat@trolltech.com>
1362 Fix MinGW build (broken in r35198) and simplify getLocalTime().
1365 (KJS::getLocalTime):
1367 2008-07-17 Gavin Barraclough <barraclough@apple.com>
1369 Reviewed by Sam Weinig.
1371 Merge pre&post bracket nodes to simplify the parse tree.
1372 Sunspider results show no performance change.
1377 * kjs/nodes2string.cpp:
1379 2008-07-17 Ariya Hidayat <ariya.hidayat@trolltech.com>
1383 Fix the 32-bit gcc builds, conversion from "long int" to Register is
1384 ambiguous. Explicitly choose the intptr_t constructor.
1387 (KJS::Machine::initializeCallFrame):
1389 (KJS::Register::Register):
1391 2008-07-16 Mark Rowe <mrowe@apple.com>
1393 Rubber-stamped by Geoff Garen.
1395 Fix JavaScript in 64-bit by using a pointer-sized integer
1396 type in the Register union. Also includes a rename of
1397 the intType constant to IntType.
1400 (KJS::Machine::initializeCallFrame):
1403 (KJS::Register::Register):
1405 2008-07-17 Geoffrey Garen <ggaren@apple.com>
1407 Reviewed by Oliver Hunt.
1409 First step toward putting doubles in registers: Turned Register into a
1410 proper abstraction layer. It is no longer possible to cast a Register
1411 to a JSValue*, or a Register& to a JSValue*&, or to access the union
1412 inside a Register directly.
1414 SunSpider reports no change.
1416 In support of this change, I had to make the following mechanical changes
1419 1. Clients now use explicit accessors to read data out of Registers, and
1420 implicit copy constructors to write data into registers.
1422 So, assignment that used to look like
1430 And access that used to look like
1438 2. I made generic flow control specific in opcodes that made their flow
1439 control generic by treating a Register& as a JSValue*&. This had the
1440 added benefit of removing some exception checking branches from immediate
1443 3. I beefed up PropertySlot to support storing a Register* in a property
1444 slot. For now, only JSVariableObject's symbolTableGet and symbolTablePut
1445 use this functionality, but I expect more clients to use it in the future.
1447 4. I changed ArgList to be a buffer of Registers, not JSValue*'s, and I
1448 changed ArgList iterator clients to iterate Registers, not JSValue*'s.
1450 2008-07-16 Ada Chan <adachan@apple.com>
1454 * kjs/JSGlobalObject.cpp:
1456 2008-07-16 Kevin McCullough <kmccullough@apple.com>
1458 Reviewed by Sam and Geoff.
1460 <rdar://problem/5958840> Navigating to another page while profiler is
1461 attached results in slow JavaScript for all time.
1463 - The UNLIKELY keeps this from being a sunspider performance regression.
1465 * kjs/JSGlobalObject.cpp:
1466 (KJS::JSGlobalObject::~JSGlobalObject): Stop the profiler associated
1467 with this exec state.
1469 2008-07-16 Sam Weinig <sam@webkit.org>
1471 Reviewed by Steve Falkenburg.
1473 Replace adopting UString constructor in favor of explicit
1474 static adopt method.
1476 * API/JSStringRefCF.cpp:
1477 (JSStringCreateWithCFString):
1478 * kjs/StringConstructor.cpp:
1479 (KJS::stringFromCharCode):
1480 * kjs/StringPrototype.cpp:
1481 (KJS::stringProtoFuncToLowerCase):
1482 (KJS::stringProtoFuncToUpperCase):
1483 (KJS::stringProtoFuncToLocaleLowerCase):
1484 (KJS::stringProtoFuncToLocaleUpperCase):
1486 (KJS::UString::adopt):
1488 (KJS::UString::UString):
1489 (KJS::UString::~UString):
1491 2008-07-16 Ariya Hidayat <ariya.hidayat@trolltech.com>
1495 http://trolltech.com/developer/task-tracker/index_html?method=entry&id=216179
1496 Fix potential crash (on Qt for Windows port) when performing JavaScript date
1500 (KJS::getLocalTime): For the Qt port, prefer to use Windows code, i.e.
1501 localtime_s() instead of localtime() since the latter might crash (on Windows)
1502 given a non-sensible, e.g. NaN, argument.
1504 2008-07-16 Alexey Proskuryakov <ap@webkit.org>
1506 Reviewed by Anders and Geoff.
1508 https://bugs.webkit.org/show_bug.cgi?id=20023
1509 Failed assertion in PropertyNameArray.cpp
1511 This is already tested by testapi.
1513 * API/JSObjectRef.cpp: (JSPropertyNameAccumulatorAddName): Add the string to identifier
1514 table to appease PropertyNameArray.
1516 2008-07-16 Alexey Proskuryakov <ap@webkit.org>
1520 Dereference identifiers when deleting a hash table (fixes leaks with private JSGlobalData
1523 * kjs/JSGlobalData.cpp: (KJS::JSGlobalData::~JSGlobalData):
1524 * kjs/lookup.cpp: (KJS::HashTable::deleteTable):
1526 * kjs/lexer.cpp: (KJS::Lexer::~Lexer)
1527 HashTable cannot have a destructor, because check-for-global-initializers complains about
1528 having a global constructor then.
1530 2008-07-16 Alexey Proskuryakov <ap@webkit.org>
1534 Check pthread_key_create return value.
1536 This check was helpful when debugging a crash in run-webkit-tests --threaded that happened
1537 because JSGlobalData objects were not deleted, and we were running out of pthread keys soon.
1538 It also looks useful for production builds.
1540 * wtf/ThreadSpecific.h: (WTF::::ThreadSpecific):
1542 2008-07-15 Kevin McCullough <kmccullough@apple.com>
1546 Rename pageGroupIdentifier to profileGroup to keep mention of a
1547 pageGroup out of JavaScriptCore.
1549 * kjs/JSGlobalObject.cpp:
1550 (KJS::JSGlobalObject::init):
1551 * kjs/JSGlobalObject.h:
1552 (KJS::JSGlobalObject::setProfileGroup):
1553 (KJS::JSGlobalObject::profileGroup):
1554 * profiler/ProfileGenerator.cpp:
1555 (KJS::ProfileGenerator::create):
1556 (KJS::ProfileGenerator::ProfileGenerator):
1557 * profiler/ProfileGenerator.h:
1558 (KJS::ProfileGenerator::profileGroup):
1559 * profiler/Profiler.cpp:
1560 (KJS::Profiler::startProfiling):
1561 (KJS::dispatchFunctionToProfiles):
1562 (KJS::Profiler::willExecute):
1563 (KJS::Profiler::didExecute):
1565 2008-07-14 Mark Rowe <mrowe@apple.com>
1567 Reviewed by Sam Weinig.
1569 Fix https://bugs.webkit.org/show_bug.cgi?id=20037
1570 Bug 20037: GCC 4.2 build broken due to strict aliasing violation.
1573 (KJS::UString::Rep::computeHash): Add a version of computeHash that takes a char* and explicit length.
1575 * profiler/CallIdentifier.h:
1576 (WTF::): Use new version of computeHash that takes a char* and explicit length to avoid unsafe aliasing.
1578 2008-07-14 David Hyatt <hyatt@apple.com>
1580 Fix a crashing bug in ListHashSet's -- operator. Make sure that end() can be -- by special-casing the null
1585 * wtf/ListHashSet.h:
1586 (WTF::ListHashSetConstIterator::operator--):
1588 2008-07-14 David Hyatt <hyatt@apple.com>
1590 Buidl fix. Make sure the second insertBefore method returns a value.
1592 * wtf/ListHashSet.h:
1593 (WTF::::insertBefore):
1595 2008-07-14 Adam Roben <aroben@apple.com>
1599 * JavaScriptCore.vcproj/jsc/jsc.vcproj: Added include/pthreads to the
1602 2008-07-14 Alexey Proskuryakov <ap@webkit.org>
1604 Reviewed by Kevin McCullough.
1606 Make JSGlobalData refcounted in preparation to adding a way to create contexts that share
1609 * JavaScriptCore.exp:
1610 * kjs/JSGlobalData.cpp:
1611 (KJS::JSGlobalData::create):
1612 * kjs/JSGlobalData.h:
1613 Made contructor private, and added a static create() method. Made the class inherit from
1616 * kjs/JSGlobalObject.h:
1617 (KJS::JSGlobalObject::globalData):
1618 JSGlobalData is now owned by JSGlobalObject (except for the shared one, and the common
1619 WebCore one, which are never deleted).
1621 * kjs/Shell.cpp: (main): Create JSGlobalData with create() method.
1623 2008-07-14 Simon Hausmann <hausmann@webkit.org>
1625 Fix the single-threaded build.
1627 * kjs/JSLock.cpp: Removed undeclared registerThread() function.
1628 * kjs/collector.cpp:
1629 (KJS::Heap::registerThread): Added dummy implementation.
1631 2008-07-14 Alexey Proskuryakov <ap@webkit.org>
1633 Reviewed by Geoff Garen.
1635 Eliminate per-thread JavaScript global data instance support and make arbitrary
1636 global data/global object combinations possible.
1638 * kjs/collector.cpp:
1639 (KJS::Heap::Heap): Store a JSGlobalData pointer instead of multiple pointers to its members.
1640 This allows for going from any JS object to its associated global data, currently used in
1641 JSGlobalObject constructor to initialize its JSGlobalData pointer.
1642 (KJS::Heap::registerThread): Changed thread registration data to be per-heap. Previously,
1643 only the shared heap could be used from multiple threads, so it was the only one that needed
1644 thread registration, but now this can happen to any heap.
1645 (KJS::Heap::unregisterThread): Ditto.
1646 (KJS::Heap::markStackObjectsConservatively): Adapt for the above changes.
1647 (KJS::Heap::setGCProtectNeedsLocking): Ditto.
1648 (KJS::Heap::protect): Ditto.
1649 (KJS::Heap::unprotect): Ditto.
1650 (KJS::Heap::collect): Ditto.
1651 (KJS::Heap::globalObjectCount): Use global object list associated with the current heap,
1652 not the late per-thread one.
1653 (KJS::Heap::protectedGlobalObjectCount): Ditto.
1656 (KJS::Heap::ThreadRegistrar): Added a helper object that unregisters a thread when it is
1660 (KJS::JSLock::JSLock):
1662 (KJS::JSLock::JSLock):
1663 Don't use JSLock to implicitly register threads. I've added registerThread() calls to most
1664 places that use JSLock - we cannot guarantee absolute safety unless we always mark all
1665 threads in the process, but these implicit registration calls should cover reasonable usage
1669 (JSEvaluateScript): Explicitly register the current thread.
1670 (JSCheckScriptSyntax): Explicitly register the current thread.
1671 (JSGarbageCollect): Changed to use the passed in context. Unfortunately, this creates a race
1672 condition for clients that pass an already released context to JSGarbageCollect - but it is
1673 unlikely to create real life problems.
1674 To maintain compatibility, the shared heap is collected if NULL is passed.
1676 * API/JSContextRef.cpp:
1677 (JSGlobalContextCreate): Use a new syntax for JSGlobalObject allocation.
1678 (JSGlobalContextRetain): Register the thread.
1679 (JSContextGetGlobalObject): Register the thread.
1681 * API/JSObjectRef.cpp:
1683 (JSObjectMakeFunctionWithCallback):
1684 (JSObjectMakeConstructor):
1685 (JSObjectMakeFunction):
1686 (JSObjectHasProperty):
1687 (JSObjectGetProperty):
1688 (JSObjectSetProperty):
1689 (JSObjectGetPropertyAtIndex):
1690 (JSObjectSetPropertyAtIndex):
1691 (JSObjectDeleteProperty):
1692 (JSObjectCallAsFunction):
1693 (JSObjectCallAsConstructor):
1694 (JSObjectCopyPropertyNames):
1695 (JSPropertyNameAccumulatorAddName):
1696 * API/JSValueRef.cpp:
1698 (JSValueIsInstanceOfConstructor):
1699 (JSValueMakeNumber):
1700 (JSValueMakeString):
1702 (JSValueToStringCopy):
1706 Register the thread.
1708 * API/JSStringRef.cpp: (JSStringRelease): Changed a comment to not mention per-thread contexts.
1710 * API/JSStringRefCF.cpp: Removed an unnecessary include of JSLock.h.
1712 * JavaScriptCore.exp: Export JSGlobalData constructor/destructor, now that anyone can have
1713 their own instances. Adapt to other changes, too.
1715 * JavaScriptCore.xcodeproj/project.pbxproj: Made ThreadSpecific.h private, as it is now
1716 included by collector.h and is thus needed in other projects.
1718 * kjs/InitializeThreading.cpp: (KJS::initializeThreadingOnce): Don't initialize per-thread
1719 global data, as it no longer exists.
1721 * kjs/JSGlobalData.cpp:
1722 (KJS::JSGlobalData::JSGlobalData):
1723 (KJS::JSGlobalData::~JSGlobalData):
1724 * kjs/JSGlobalData.h:
1725 Removed support for per-thread instance. Made constructor and destructor public.
1727 * kjs/JSGlobalObject.cpp: (KJS::JSGlobalObject::init): Get to now arbitrary JSGlobalData
1729 (KJS::JSGlobalObject::operator new): Changed ot take JSGlobalDatra pointer.
1730 * kjs/JSGlobalObject.h:
1735 Changed to maintain a custom JSGlobalData pointer instead of a per-thread one.
1737 2008-07-13 Ada Chan <adachan@apple.com>
1739 Windows build fix: Add wtf/RefCountedLeakCounter to the project.
1741 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
1743 2008-07-12 Jan Michael Alonzo <jmalonzo@webkit.org>
1745 Gtk, Qt and Wx build fix: Add wtf/RefCountedLeakCounter in the
1749 * JavaScriptCore.pri:
1750 * JavaScriptCoreSources.bkl:
1752 2008-07-11 Stephanie Lewis <slewis@apple.com>
1754 Reviewed by Darin Adler and Oliver Hunt.
1756 Refactor RefCounting Leak counting code into a common class.
1758 In order to export the symbols I needed to put the debug defines inside the function names
1760 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.
1762 * JavaScriptCore.exp:
1763 * JavaScriptCore.xcodeproj/project.pbxproj: add new class
1764 * kjs/nodes.cpp: remove old leak counting code
1765 * wtf/RefCountedLeakCounter.cpp: Added. create a common leak counting class
1766 * wtf/RefCountedLeakCounter.h: Added.
1768 2008-07-11 David Hyatt <hyatt@apple.com>
1770 Add an insertBefore method to ListHashSet to allow for insertions in the middle of the list (rather than just
1775 * wtf/ListHashSet.h:
1776 (WTF::::insertBefore):
1777 (WTF::::insertNodeBefore):
1779 2008-07-11 Sam Weinig <sam@webkit.org>
1781 Rubber-stamped by Darin Adler.
1783 Move call function to CallData.cpp and construct to ConstructData.cpp.
1786 * JavaScriptCore.pri:
1787 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1788 * JavaScriptCore.xcodeproj/project.pbxproj:
1789 * JavaScriptCoreSources.bkl:
1790 * kjs/AllInOneFile.cpp:
1791 * kjs/CallData.cpp: Copied from kjs/JSValue.cpp.
1792 * kjs/ConstructData.cpp: Copied from kjs/JSValue.cpp.
1795 2008-07-10 Mark Rowe <mrowe@apple.com>
1797 Reviewed by Sam Weinig.
1799 Define WEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST when building WebKit to ensure that no symbols end up with the weak_import attribute.
1801 * Configurations/Base.xcconfig:
1803 2008-07-10 Mark Rowe <mrowe@apple.com>
1805 Reviewed by Sam Weinig.
1807 Fix the Tiger build by omitting annotations from methods declared in categories when using old versions of GCC.
1809 * API/WebKitAvailability.h:
1811 2008-07-10 Kevin McCullough <kmccullough@apple.com>
1815 -Minor cleanup. Renamed callTree() to head() and no longer use m_head
1816 directly but instead keep it private and access via a method().
1818 * profiler/HeavyProfile.cpp:
1819 (KJS::HeavyProfile::HeavyProfile):
1820 (KJS::HeavyProfile::generateHeavyStructure):
1821 (KJS::HeavyProfile::addNode):
1822 * profiler/Profile.h:
1823 (KJS::Profile::head):
1824 * profiler/ProfileGenerator.cpp:
1825 (KJS::ProfileGenerator::ProfileGenerator):
1827 2008-07-10 Alexey Proskuryakov <ap@webkit.org>
1829 Reviewed by Mark Rowe.
1831 Eliminate CollectorHeapIntrospector.
1833 CollectorHeapIntrospector was added primarily in the hopes to improve leaks tool output,
1834 a result that it didn't deliver. Also, it helped by labeling JSC heap regions as reported by
1835 vmmap tool, but at the same time, it made them mislabeled as malloc'd ones - the correct
1836 way to label mapped regions is to use a VM tag.
1838 So, it makes more sense to remove it completely than to make it work with multiple heaps.
1840 * JavaScriptCore.exp:
1841 * JavaScriptCore.xcodeproj/project.pbxproj:
1842 * kjs/AllInOneFile.cpp:
1843 * kjs/InitializeThreading.cpp:
1844 (KJS::initializeThreading):
1845 * kjs/collector.cpp:
1847 * kjs/CollectorHeapIntrospector.cpp: Removed.
1848 * kjs/CollectorHeapIntrospector.h: Removed.
1850 2008-07-09 Kevin McCullough <kmccullough@apple.com>
1854 <rdar://problem/5951532> JSProfiler: Implement heavy (or bottom-up)
1856 - Implemented the time and call count portionof heavy. Now all that we
1859 * profiler/CallIdentifier.h: Removed an unused constructor.
1860 * profiler/HeavyProfile.cpp:
1861 (KJS::HeavyProfile::HeavyProfile): Set the initial time of the head
1862 node so that percentages work correctly.
1863 (KJS::HeavyProfile::mergeProfiles): Sum the times and call count of
1865 * profiler/ProfileNode.cpp: Set the intital values of time and call
1866 count when copying ProfileNodes.
1867 (KJS::ProfileNode::ProfileNode):
1869 2008-07-10 Jan Michael Alonzo <jmalonzo@webkit.org>
1873 * GNUmakefile.am: Add HeavyProfile.cpp
1875 2008-07-09 Mark Rowe <mrowe@apple.com>
1877 Reviewed by Geoff Garen.
1879 Don't warn about deprecated functions in production builds.
1881 * Configurations/Base.xcconfig:
1882 * Configurations/DebugRelease.xcconfig:
1884 2008-07-09 Darin Adler <darin@apple.com>
1886 * JavaScriptCore.pri: Fix Qt build by adding HeavyProfile.cpp.
1888 2008-07-09 Kevin Ollivier <kevino@theolliviers.com>
1890 wx biuld fix. Add HeavyProfile.cpp to build files.
1892 * JavaScriptCoreSources.bkl:
1894 2008-07-09 Kevin McCullough <kmccullough@apple.com>
1896 - Windows build fix.
1898 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1900 2008-07-09 Kevin McCullough <kmccullough@apple.com>
1904 * profiler/HeavyProfile.cpp:
1905 (KJS::HeavyProfile::mergeProfiles):
1907 2008-07-09 Kevin McCullough <kmccullough@apple.com>
1909 Reviewed by Geoff and Adam.
1911 <rdar://problem/5951532> JSProfiler: Implement Bottom-Up view (19228)
1912 - This is the plumbing for bottom-up, but does not include calculating
1913 time, mostly because I'm still undclear about what the end result should
1915 - This, obviously, does not include the UI to expose this in the
1918 * JavaScriptCore.xcodeproj/project.pbxproj:
1919 * profiler/CallIdentifier.h:
1920 (KJS::CallIdentifier::CallIdentifier):
1921 (WTF::): Added HashTraits for CallIdentifiers to be used by a HashMap.
1922 * profiler/HeavyProfile.cpp: Added.
1923 (KJS::HeavyProfile::HeavyProfile):
1924 (KJS::HeavyProfile::generateHeavyStructure):
1925 (KJS::HeavyProfile::addNode):
1926 (KJS::HeavyProfile::mergeProfiles):
1927 (KJS::HeavyProfile::addAncestorsAsChildren):
1928 * profiler/HeavyProfile.h: Added.
1929 (KJS::HeavyProfile::create):
1930 (KJS::HeavyProfile::heavyProfile):
1931 (KJS::HeavyProfile::treeProfile):
1932 * profiler/Profile.cpp: Removed old commented out includes.
1933 * profiler/Profile.h: The m_head is needed by the HeavyProfile so it
1934 is now protected as opposed to private.
1935 * profiler/ProfileNode.cpp:
1936 (KJS::ProfileNode::ProfileNode): Created a constructor to copy
1938 (KJS::ProfileNode::findChild): Added a null check to make HeavyProfile
1939 children finding easier and avoid a potential crasher.
1940 * profiler/ProfileNode.h: Mostly moved things around but also added some
1941 functionality needed by HeavyProfile.
1942 (KJS::ProfileNode::create):
1943 (KJS::ProfileNode::functionName):
1944 (KJS::ProfileNode::url):
1945 (KJS::ProfileNode::lineNumber):
1946 (KJS::ProfileNode::head):
1947 (KJS::ProfileNode::setHead):
1948 (KJS::ProfileNode::setNextSibling):
1949 (KJS::ProfileNode::actualTotalTime):
1950 (KJS::ProfileNode::actualSelfTime):
1951 * profiler/TreeProfile.cpp: Implemented the ability to get a
1953 (KJS::TreeProfile::heavyProfile):
1954 * profiler/TreeProfile.h:
1956 2008-07-08 Geoffrey Garen <ggaren@apple.com>
1958 Reviewed by Oliver Hunt.
1960 Added support for checking if an object has custom properties in its
1961 property map. WebCore uses this to optimize marking DOM wrappers.
1963 2008-07-08 Simon Hausmann <hausmann@webkit.org>
1965 Prospective Gtk/Wx build fixes, add ProfileGenerator.cpp to the build.
1968 * JavaScriptCoreSources.bkl:
1970 2008-07-08 Simon Hausmann <hausmann@webkit.org>
1972 Fix the Qt build, add ProfileGenerator.cpp to the build.
1974 * JavaScriptCore.pri:
1976 2008-07-07 David Kilzer <ddkilzer@apple.com>
1978 releaseFastMallocFreeMemory() should always be defined
1982 * JavaScriptCore.exp: Changed to export C++ binding for
1983 WTF::releaseFastMallocFreeMemory() instead of C binding for
1984 releaseFastMallocFreeMemory().
1985 * wtf/FastMalloc.cpp: Moved definitions of
1986 releaseFastMallocFreeMemory() to be in the WTF namespace
1987 regardless whether FORCE_SYSTEM_MALLOC is defined.
1988 * wtf/FastMalloc.h: Moved releaseFastMallocFreeMemory() from
1989 extern "C" binding to WTF::releaseFastMallocFreeMemory().
1991 2008-07-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1995 Bug 19926: URL causes crash within a minute
1996 <https://bugs.webkit.org/show_bug.cgi?id=19926>
1998 Add a check that lastGlobalObject is non-null in Machine::execute()
1999 before copying its globals to the current register file.
2001 In theory, it is possible to make a test case for this, but it will
2002 take a while to get it right.
2005 (KJS::Machine::execute):
2007 2008-07-07 Darin Adler <darin@apple.com>
2009 Rubber stamped by Adele.
2012 (KJS::Machine::privateExecute): Fix a typo in a comment.
2014 2008-07-07 Steve Falkenburg <sfalken@apple.com>
2018 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2019 * JavaScriptCore.vcproj/testapi/testapi.vcproj:
2021 2008-07-07 Kevin McCullough <kmccullough@apple.com>
2025 When the profiler is running it gathers information and creates a
2026 Profile. After it finishes the Profile can be sorted and have other
2027 data refinements run over it. Both of these were done in the same class
2028 before. Now I split the gathering operations into a new class called
2031 * JavaScriptCore.xcodeproj/project.pbxproj:
2032 * profiler/Profile.cpp: Removed code related to the gather stage of a
2034 (KJS::Profile::create):
2035 (KJS::Profile::Profile):
2036 * profiler/Profile.h: Ditto.
2037 (KJS::Profile::title):
2038 (KJS::Profile::callTree):
2039 (KJS::Profile::setHead):
2040 * profiler/ProfileGenerator.cpp: Added. This is the class that will
2041 handle the stage of creating a Profile. Once the Profile is finished
2042 being created, this class goes away.
2043 (KJS::ProfileGenerator::create):
2044 (KJS::ProfileGenerator::ProfileGenerator):
2045 (KJS::ProfileGenerator::title):
2046 (KJS::ProfileGenerator::willExecute):
2047 (KJS::ProfileGenerator::didExecute):
2048 (KJS::ProfileGenerator::stopProfiling):
2049 (KJS::ProfileGenerator::didFinishAllExecution):
2050 (KJS::ProfileGenerator::removeProfileStart):
2051 (KJS::ProfileGenerator::removeProfileEnd):
2052 * profiler/ProfileGenerator.h: Added.
2053 (KJS::ProfileGenerator::profile):
2054 (KJS::ProfileGenerator::originatingGlobalExec):
2055 (KJS::ProfileGenerator::pageGroupIdentifier):
2056 (KJS::ProfileGenerator::client):
2057 (KJS::ProfileGenerator::stoppedProfiling):
2058 * profiler/Profiler.cpp: Now operates with the ProfileGenerator instead
2060 (KJS::Profiler::startProfiling):
2061 (KJS::Profiler::stopProfiling):
2062 (KJS::Profiler::didFinishAllExecution): It is here that the Profile is
2063 handed off to its client and the Profile Generator is no longer needed.
2064 (KJS::dispatchFunctionToProfiles):
2065 (KJS::Profiler::willExecute):
2066 (KJS::Profiler::didExecute):
2067 * profiler/Profiler.h: Cleaned up the includes and subsequently the
2068 forward declarations. Also use the new ProfileGenerator.
2069 (KJS::ProfilerClient::~ProfilerClient):
2070 (KJS::Profiler::currentProfiles):
2071 * profiler/TreeProfile.cpp: Use Profile's new interface.
2072 (KJS::TreeProfile::create):
2073 (KJS::TreeProfile::TreeProfile):
2074 * profiler/TreeProfile.h:
2076 2008-07-07 Sam Weinig <sam@webkit.org>
2078 Reviewed by Cameron Zwarich.
2080 Third step in broad cleanup effort.
2082 [ File list elided ]
2084 2008-07-06 Sam Weinig <sam@webkit.org>
2086 Reviewed by Cameron Zwarich.
2088 Second step in broad cleanup effort.
2090 [ File list elided ]
2092 2008-07-05 Sam Weinig <sam@webkit.org>
2094 Reviewed by Cameron Zwarich.
2096 First step in broad cleanup effort.
2098 [ File list elided ]
2100 2008-07-05 Sam Weinig <sam@webkit.org>
2102 Rubber-stamped by Cameron Zwarich.
2104 Rename list.h/cpp to ArgList.h/cpp.
2107 * JavaScriptCore.pri:
2108 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2109 * JavaScriptCore.xcodeproj/project.pbxproj:
2110 * JavaScriptCoreSources.bkl:
2112 * kjs/AllInOneFile.cpp:
2113 * kjs/ArgList.cpp: Copied from JavaScriptCore/kjs/list.cpp.
2114 * kjs/ArgList.h: Copied from JavaScriptCore/kjs/list.h.
2115 * kjs/IndexToNameMap.cpp:
2116 * kjs/JSGlobalData.cpp:
2117 * kjs/JSGlobalData.h:
2119 * kjs/collector.cpp:
2120 * kjs/list.cpp: Removed.
2121 * kjs/list.h: Removed.
2123 2008-07-05 Sam Weinig <sam@webkit.org>
2125 Fix non-AllInOne builds again.
2127 * kjs/BooleanPrototype.cpp:
2128 * kjs/ErrorPrototype.cpp:
2129 * kjs/FunctionPrototype.cpp:
2130 * kjs/NumberPrototype.cpp:
2131 * kjs/ObjectPrototype.cpp:
2133 2008-07-05 Sam Weinig <sam@webkit.org>
2135 Fix build on case-sensitive build systems.
2137 * kjs/IndexToNameMap.cpp:
2139 2008-07-05 Sam Weinig <sam@webkit.org>
2143 * kjs/Arguments.cpp:
2144 * kjs/BooleanPrototype.cpp:
2145 * kjs/DateConstructor.cpp:
2146 * kjs/ErrorPrototype.cpp:
2147 * kjs/FunctionPrototype.cpp:
2148 * kjs/NumberPrototype.cpp:
2149 * kjs/ObjectPrototype.cpp:
2150 * kjs/RegExpPrototype.cpp:
2151 * kjs/StringConstructor.cpp:
2154 2008-07-05 Sam Weinig <sam@webkit.org>
2156 Fix non-AllInOne build.
2158 * kjs/JSGlobalObject.cpp:
2160 2008-07-05 Sam Weinig <sam@webkit.org>
2162 Rubber-stamped by Cameron Zwarich.
2164 Split Arguments, IndexToNameMap, PrototypeFunction, GlobalEvalFunction and
2165 the functions on the global object out of JSFunction.h/cpp.
2168 * JavaScriptCore.pri:
2169 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2170 * JavaScriptCore.xcodeproj/project.pbxproj:
2171 * JavaScriptCoreSources.bkl:
2173 * kjs/AllInOneFile.cpp:
2174 * kjs/Arguments.cpp: Copied from JavaScriptCore/kjs/JSFunction.cpp.
2175 * kjs/Arguments.h: Copied from JavaScriptCore/kjs/JSFunction.h.
2176 * kjs/GlobalEvalFunction.cpp: Copied from JavaScriptCore/kjs/JSFunction.cpp.
2177 * kjs/GlobalEvalFunction.h: Copied from JavaScriptCore/kjs/JSFunction.h.
2178 * kjs/IndexToNameMap.cpp: Copied from JavaScriptCore/kjs/JSFunction.cpp.
2179 * kjs/IndexToNameMap.h: Copied from JavaScriptCore/kjs/JSFunction.h.
2180 * kjs/JSActivation.cpp:
2181 * kjs/JSFunction.cpp:
2183 * kjs/JSGlobalObject.cpp:
2184 * kjs/JSGlobalObjectFunctions.cpp: Copied from JavaScriptCore/kjs/JSFunction.cpp.
2185 * kjs/JSGlobalObjectFunctions.h: Copied from JavaScriptCore/kjs/JSFunction.h.
2186 The functions on the global object should be in JSGlobalObject.cpp, but putting them there
2187 was a 0.5% regression.
2189 * kjs/PrototypeFunction.cpp: Copied from JavaScriptCore/kjs/JSFunction.cpp.
2190 * kjs/PrototypeFunction.h: Copied from JavaScriptCore/kjs/JSFunction.h.
2195 2008-07-04 Sam Weinig <sam@webkit.org>
2197 Really fix the mac build.
2199 * JavaScriptCore.xcodeproj/project.pbxproj:
2201 2008-07-04 Sam Weinig <sam@webkit.org>
2205 * JavaScriptCore.xcodeproj/project.pbxproj:
2207 2008-07-04 Sam Weinig <sam@webkit.org>
2209 Fix non-AllInOne builds.
2212 * kjs/GetterSetter.cpp:
2213 * kjs/JSImmediate.cpp:
2214 * kjs/operations.cpp:
2216 2008-07-04 Sam Weinig <sam@webkit.org>
2218 Rubber-stamped by Dan Bernstein.
2220 Split Error and GetterSetter out of JSObject.h.
2222 * API/JSCallbackObjectFunctions.h:
2224 * JavaScriptCore.pri:
2225 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2226 * JavaScriptCore.xcodeproj/project.pbxproj:
2227 * JavaScriptCoreSources.bkl:
2228 * kjs/AllInOneFile.cpp:
2229 * kjs/ClassInfo.h: Copied from JavaScriptCore/kjs/JSObject.h.
2230 * kjs/Error.cpp: Copied from JavaScriptCore/kjs/JSObject.cpp.
2231 * kjs/Error.h: Copied from JavaScriptCore/kjs/JSObject.h.
2232 * kjs/GetterSetter.cpp:
2233 * kjs/GetterSetter.h: Copied from JavaScriptCore/kjs/JSObject.h.
2238 2008-07-04 Simon Hausmann <hausmann@webkit.org>
2240 Fix the Wx build, added TreeProfile.cpp to the build.
2242 * JavaScriptCoreSources.bkl:
2244 2008-07-03 Mark Rowe <mrowe@apple.com>
2246 Reviewed by Oliver Hunt.
2248 Fix output path of recently-added script phase to reference the correct file.
2249 This prevents Xcode from running the script phase unnecessarily, which caused
2250 the generated header to be recreated and lead to AllInOneFile.cpp rebuilding.
2252 * JavaScriptCore.xcodeproj/project.pbxproj:
2254 2008-07-03 Mark Rowe <mrowe@apple.com>
2256 Follow-up to the 64-bit build fix. Use intptr_t rather than ssize_t as
2257 the latter is non-standard and does not exist on Windows.
2260 (KJS::JSLock::lockCount):
2261 (KJS::JSLock::lock):
2262 (KJS::JSLock::unlock):
2263 (KJS::JSLock::DropAllLocks::DropAllLocks):
2266 2008-07-02 Mark Rowe <mrowe@apple.com>
2268 Fix the 64-bit build. pthread_getspecific works with pointer-sized values,
2269 so use ssize_t rather than int to track the lock count to avoid warnings about
2270 truncating the result of pthread_getspecific.
2273 (KJS::JSLock::lockCount):
2274 (KJS::JSLock::lock):
2275 (KJS::JSLock::unlock):
2276 (KJS::JSLock::DropAllLocks::DropAllLocks):
2279 2008-07-03 Geoffrey Garen <ggaren@apple.com>
2281 Reviewed by Sam Weinig.
2283 Removed checking for the array get/put fast case from the array code.
2284 Callers who want the fast case should call getIndex and/or setIndex
2285 instead. (get_by_val and put_by_val already do this.)
2287 SunSpider reports no change overall, but a 1.4% speedup on fannkuch and
2288 a 3.6% speedup on nsieve.
2290 2008-07-03 Dan Bernstein <mitz@apple.com>
2294 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Added TreeProfile.{h,cpp}.
2296 2008-07-03 Dan Bernstein <mitz@apple.com>
2298 Reviewed by Anders Carlsson.
2303 (KJS::Machine::Machine):
2305 2008-07-03 Simon Hausmann <hausmann@webkit.org>
2307 Reviewed by Alexey Proskuryakov.
2309 Fix the non-threaded build.
2311 * kjs/JSGlobalData.cpp:
2312 (KJS::JSGlobalData::threadInstanceInternal):
2314 2008-07-03 Simon Hausmann <hausmann@webkit.org>
2316 Fix the Qt build, added TreeProfile to the build.
2318 * JavaScriptCore.pri:
2320 2008-07-02 Alexey Proskuryakov <ap@webkit.org>
2324 Don't create unnecessary JSGlobalData instances.
2326 * kjs/JSGlobalData.h:
2327 * kjs/JSGlobalData.cpp:
2328 (KJS::JSGlobalData::threadInstanceExists):
2329 (KJS::JSGlobalData::sharedInstanceExists):
2330 (KJS::JSGlobalData::threadInstance):
2331 (KJS::JSGlobalData::sharedInstance):
2332 (KJS::JSGlobalData::threadInstanceInternal):
2333 (KJS::JSGlobalData::sharedInstanceInternal):
2334 Added methods to query instance existence.
2336 * kjs/InitializeThreading.cpp:
2337 (KJS::initializeThreadingOnce):
2338 Initialize thread instance static in a new way.
2342 * kjs/collector.cpp:
2343 (KJS::Heap::collect):
2344 Check for instance existence before accessing it.
2346 2008-07-02 Geoffrey Garen <ggaren@apple.com>
2348 Reviewed by Cameron Zwarich.
2350 Fixed https://bugs.webkit.org/show_bug.cgi?id=19862
2351 REGRESSION (r34907): Gmail crashes in JavaScriptCore code while editing drafts
2353 I was never able to reproduce this issue, but Cameron could, and he says
2354 that this patch fixes it.
2356 The crash seems tied to a timer or event handler callback. In such a case,
2357 the sole reference to the global object may be in the current call frame,
2358 so we can't depend on the global object to mark the call frame area in
2361 The new GC marking rule is: the global object is not responsible for
2362 marking the whole register file -- it's just responsible for the globals
2363 section it's tied to. The heap is responsible for marking the call frame area.
2365 2008-07-02 Mark Rowe <mrowe@apple.com>
2367 Reviewed by Sam Weinig.
2369 Add the ability to trace JavaScriptCore garabge collections using dtrace.
2371 * JavaScriptCore.xcodeproj/project.pbxproj: Generate the dtrace probe header
2372 file when building on a new enough version of Mac OS X.
2373 * JavaScriptCorePrefix.h: Add our standard Mac OS X version detection macros.
2374 * kjs/Tracing.d: Declare three dtrace probes.
2375 * kjs/Tracing.h: Include the generated dtrace macros if dtrace is available,
2376 otherwise provide versions that do nothing.
2377 * kjs/collector.cpp:
2378 (KJS::Heap::collect): Fire dtrace probes when starting a collection, after the
2379 mark phase has completed, and when the collection is complete.
2380 * wtf/Platform.h: Define HAVE_DTRACE when building on a new enough version of Mac OS X.
2382 2008-07-02 Geoffrey Garen <ggaren@apple.com>
2384 Rubber stamped by Oliver Hunt.
2386 Reduced the max register file size from 8MB to 2MB.
2388 We still allow about 20,000 levels of recursion.
2390 2008-07-02 Alp Toker <alp@nuanti.com>
2392 Build fix for r34960. Add TreeProfile.cpp to build.
2396 2008-07-02 Geoffrey Garen <ggaren@apple.com>
2398 Reviewed by Oliver Hunt.
2400 Optimized a[n] get for cases when a is an array or a string. When a is
2401 an array, we optimize both get and put. When a is a string, we only
2402 optimize get, since you can't put to a string.
2404 SunSpider says 3.4% faster.
2406 2008-07-02 Kevin McCullough <kmccullough@apple.com>
2410 -Small cleanup in preparation for implementing Bottom-up.
2412 * profiler/CallIdentifier.h: Rename debug function to make it clear of
2413 its output and intention to be debug only.
2414 (KJS::CallIdentifier::operator const char* ): Implement in terms of
2416 (KJS::CallIdentifier::c_str):
2417 * profiler/ProfileNode.cpp: Impelment findChild() which will be needed
2418 by the bottom-up implementation.
2419 (KJS::ProfileNode::findChild):
2420 * profiler/ProfileNode.h: Added comments to make the collections of
2421 functions more clear.
2422 (KJS::ProfileNode::operator==):
2423 (KJS::ProfileNode::c_str):
2425 2008-07-02 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2429 Bug 19776: Number.toExponential() is incorrect for numbers between 0.1 and 1
2430 <https://bugs.webkit.org/show_bug.cgi?id=19776>
2432 Perform the sign check for the exponent on the actual exponent value,
2433 which is 1 less than the value of decimalPoint, instead of on the value
2434 of decimalPoint itself.
2436 * kjs/NumberPrototype.cpp:
2437 (KJS::exponentialPartToString):
2439 2008-07-02 Kevin McCullough <kmccullough@apple.com>
2443 <rdar://problem/5951532> JSProfiler: Implement Bottom-Up view (19228)
2444 - Subclass TreeProfile as I prepare for a HeavyProfile to be comming
2447 * JavaScriptCore.xcodeproj/project.pbxproj:
2448 * profiler/Profile.cpp: By default we create a TreeProfile.
2449 (KJS::Profile::create):
2450 * profiler/Profile.h: Changes to the Profile class to make it amenable
2451 to be inherited from.
2452 (KJS::Profile::~Profile):
2453 * profiler/TreeProfile.cpp: Added.
2454 (KJS::TreeProfile::create):
2455 (KJS::TreeProfile::TreeProfile):
2456 (KJS::TreeProfile::heavyProfile):
2457 * profiler/TreeProfile.h: Added.
2458 (KJS::TreeProfile::treeProfile):
2460 2008-07-02 Kevin McCullough <kmccullough@apple.com>
2464 Broke CallIdentifier out into its own file. I did this because it's
2465 going to grow a lot soon and I wanted this to be a separate patch.
2467 * JavaScriptCore.xcodeproj/project.pbxproj:
2468 * profiler/CallIdentifier.h: Added.
2469 (KJS::CallIdentifier::CallIdentifier):
2470 (KJS::CallIdentifier::operator==):
2471 (KJS::CallIdentifier::operator!=):
2472 (KJS::CallIdentifier::operator const char* ):
2473 (KJS::CallIdentifier::toString):
2474 * profiler/ProfileNode.h:
2476 2008-07-02 Simon Hausmann <hausmann@webkit.org>
2478 Build fix. Implemented missing functions for single-threaded build.
2481 (KJS::JSLock::JSLock):
2482 (KJS::JSLock::lock):
2483 (KJS::JSLock::unlock):
2484 (KJS::JSLock::DropAllLocks::DropAllLocks):
2486 2008-07-02 Alexey Proskuryakov <ap@webkit.org>
2488 Another non-AllInOne build fix.
2490 * kjs/JSGlobalObject.cpp: Include JSLock.h here, too.
2492 2008-07-02 Alexey Proskuryakov <ap@webkit.org>
2494 Non-AllInOne build fix.
2496 * kjs/interpreter.cpp: Include JSLock.h.
2498 2008-06-30 Alexey Proskuryakov <ap@webkit.org>
2502 Disable JSLock for per-thread contexts.
2504 No change on SunSpider.
2506 * kjs/JSGlobalData.h:
2507 * kjs/JSGlobalData.cpp:
2508 (KJS::JSGlobalData::JSGlobalData):
2509 (KJS::JSGlobalData::sharedInstance):
2510 Added isSharedInstance as a better way to tell whether the instance is shared (legacy).
2513 (KJS::createJSLockCount):
2514 (KJS::JSLock::lockCount):
2515 (KJS::setLockCount):
2516 (KJS::JSLock::JSLock):
2517 (KJS::JSLock::lock):
2518 (KJS::JSLock::unlock):
2519 (KJS::JSLock::currentThreadIsHoldingLock):
2520 (KJS::JSLock::DropAllLocks::DropAllLocks):
2521 (KJS::JSLock::DropAllLocks::~DropAllLocks):
2523 (KJS::JSLock::JSLock):
2524 (KJS::JSLock::~JSLock):
2525 Made JSLock and JSLock::DropAllLocks constructors take a parameter to decide whether to
2526 actually lock a mutex, or only to increment recursion count. We cannot turn it into no-op
2527 if we want to keep existing assertions working.
2528 Made recursion count per-thread, now that locks may not lock.
2531 (JSEvaluateScript): Take JSLock after casting JSContextRef to ExecState* (which doesn't need
2532 locking in any case), so that a decision whether to actually lock can be made.
2533 (JSCheckScriptSyntax): Ditto.
2534 (JSGarbageCollect): Only lock while collecting the shared heap, not the per-thread one.
2536 * API/JSObjectRef.cpp:
2537 (JSClassCreate): Don't lock, as there is no reason to.
2538 (JSClassRetain): Ditto.
2539 (JSClassRelease): Ditto.
2540 (JSPropertyNameArrayRetain): Ditto.
2541 (JSPropertyNameArrayRelease): Only lock while deleting the array, as that may touch
2543 (JSPropertyNameAccumulatorAddName): Adding a string also involves an identifier table
2544 lookup, and possibly modification.
2546 * API/JSStringRef.cpp:
2547 (JSStringCreateWithCharacters):
2548 (JSStringCreateWithUTF8CString):
2551 (JSStringGetUTF8CString):
2553 * API/JSStringRefCF.cpp:
2554 (JSStringCreateWithCFString):
2555 JSStringRef operations other than releasing do not need locking.
2557 * VM/Machine.cpp: Don't include unused JSLock.h.
2559 * kjs/CollectorHeapIntrospector.cpp: (KJS::CollectorHeapIntrospector::statistics):
2560 Don't take the lock for real, as heap introspection pauses the process anyway. It seems that
2561 the existing code could cause deadlocks.
2567 The test tool uses a per-thread context, so no real locking is required.
2570 (KJS::Heap::setGCProtectNeedsLocking): Optionally protect m_protectedValues access with a
2571 per-heap mutex. This is only needed for WebCore Database code, which violates the "no data
2572 migration between threads" by using ProtectedPtr on a background thread.
2573 (KJS::Heap::isShared): Keep a shared flag here, as well.
2576 (KJS::::ProtectedPtr):
2577 (KJS::::~ProtectedPtr):
2581 ProtectedPtr is ony used from WebCore, so it doesn't need to take JSLock. An assertion in
2582 Heap::protect/unprotect guards agains possible future unlocked uses of ProtectedPtr in JSC.
2584 * kjs/collector.cpp:
2585 (KJS::Heap::Heap): Initialize m_isShared.
2586 (KJS::Heap::~Heap): No need to lock for real during destruction, but must keep assertions
2588 (KJS::destroyRegisteredThread): Registered thread list is only accessed for shared heap,
2589 so locking is always needed here.
2590 (KJS::Heap::registerThread): Ditto.
2591 (KJS::Heap::markStackObjectsConservatively): Use m_isShared instead of comparing to a shared
2592 instance for a small speedup.
2593 (KJS::Heap::setGCProtectNeedsLocking): Create m_protectedValuesMutex. There is currently no
2594 way to undo this - and ideally, Database code will be fixed to lo longer require this quirk.
2595 (KJS::Heap::protect): Take m_protectedValuesMutex (if it exists) while accessing
2597 (KJS::Heap::unprotect): Ditto.
2598 (KJS::Heap::markProtectedObjects): Ditto.
2599 (KJS::Heap::protectedGlobalObjectCount): Ditto.
2600 (KJS::Heap::protectedObjectCount): Ditto.
2601 (KJS::Heap::protectedObjectTypeCounts): Ditto.
2605 Don't include JSLock.h, which is no longer used here. As a result, an explicit include had
2606 to be added to many files in JavaScriptGlue, WebCore and WebKit.
2608 * kjs/JSGlobalObject.cpp:
2609 (KJS::JSGlobalObject::init):
2610 * API/JSCallbackConstructor.cpp:
2611 (KJS::constructJSCallback):
2612 * API/JSCallbackFunction.cpp:
2613 (KJS::JSCallbackFunction::call):
2614 * API/JSCallbackObjectFunctions.h:
2616 (KJS::::getOwnPropertySlot):
2618 (KJS::::deleteProperty):
2620 (KJS::::hasInstance):
2622 (KJS::::getPropertyNames):
2625 (KJS::::staticValueGetter):
2626 (KJS::::callbackGetter):
2627 * API/JSContextRef.cpp:
2628 (JSGlobalContextCreate):
2629 (JSGlobalContextRetain):
2630 (JSGlobalContextRelease):
2631 * API/JSValueRef.cpp:
2633 (JSValueIsStrictEqual):
2634 (JSValueIsInstanceOfConstructor):
2635 (JSValueMakeNumber):
2636 (JSValueMakeString):
2638 (JSValueToStringCopy):
2642 * JavaScriptCore.exp:
2643 * kjs/PropertyNameArray.h:
2644 (KJS::PropertyNameArray::globalData):
2645 * kjs/interpreter.cpp:
2646 (KJS::Interpreter::checkSyntax):
2647 (KJS::Interpreter::evaluate):
2648 Pass a parameter to JSLock/JSLock::DropAllLocks to decide whether the lock needs to be taken.
2650 2008-07-01 Alexey Proskuryakov <ap@webkit.org>
2654 https://bugs.webkit.org/show_bug.cgi?id=19834
2655 Failed assertion in JavaScriptCore/VM/SegmentedVector.h:82
2657 Creating a global object with a custom prototype resets it twice (wasteful!).
2658 So, addStaticGlobals() was called twice, but JSGlobalObject::reset() didn't reset
2661 * kjs/JSGlobalObject.cpp: (KJS::JSGlobalObject::reset): Call setRegisterArray(0, 0).
2663 * kjs/JSVariableObject.h: Changed registerArray to OwnArrayPtr. Also, added private copy
2664 constructor and operator= to ensure that no one attempts to copy this object (for whatever
2665 reason, I couldn't make Noncopyable work).
2667 * kjs/JSGlobalObject.h: (KJS::JSGlobalObject::addStaticGlobals): Allocate registerArray
2670 * kjs/JSVariableObject.cpp:
2671 (KJS::JSVariableObject::copyRegisterArray): Allocate registerArray with new[].
2672 (KJS::JSVariableObject::setRegisterArray): Avoid hitting an assertion in OwnArrayPtr when
2673 "changing" the value from 0 to 0.
2675 2008-07-01 Geoffrey Garen <ggaren@apple.com>
2677 Reviewed by Oliver Hunt.
2679 Removed and/or reordered exception checks in array-style a[n] access.
2681 SunSpider says 1.4% faster.
2684 (KJS::Machine::privateExecute): No need to check for exceptions before
2685 calling toString, toNumber and/or get. If the call ends up being observable
2686 through toString, valueOf, or a getter, we short-circuit it there, instead.
2687 In the op_del_by_val case, I removed the incorrect comment without actually
2688 removing the code, since I didn't want to tempt the GCC fates!
2691 (KJS::callDefaultValueFunction): Added exception check to prevent
2692 toString and valueOf functions from observing execution after an exception
2693 has been thrown. This removes some of the burden of exception checking
2696 (KJS::JSObject::defaultValue): Removed redundant exception check here.
2698 * kjs/PropertySlot.cpp:
2699 (KJS::PropertySlot::functionGetter): Added exception check to prevent
2700 getter functions from observing execution after an exception has been
2701 thrown. This removes some of the burden of exception checking from the
2704 2008-07-01 Geoffrey Garen <ggaren@apple.com>
2706 Reviewed by Oliver Hunt.
2708 Optimized a[n] get and put for cases where n is an immediate unsigned
2711 SunSpider says 3.5% faster.
2713 2008-07-01 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2717 Bug 19844: JavaScript Switch statement modifies "this"
2718 <https://bugs.webkit.org/show_bug.cgi?id=19844>
2720 Use a temporary when generating code for switch clauses to avoid
2721 overwriting 'this' or a local variable.
2724 (KJS::CaseBlockNode::emitCodeForBlock):
2726 2008-07-01 Christian Dywan <christian@twotoasts.de>
2730 * kjs/list.cpp: Include "JSCell.h"
2732 2008-07-01 Kevin McCullough <kmccullough@apple.com>
2736 * JavaScriptCore.xcodeproj/project.pbxproj:
2738 2008-07-01 Dan Bernstein <mitz@apple.com>
2740 Reviewed by Anders Carlsson.
2742 - Mac release build fix
2744 * JavaScriptCore.exp:
2746 2008-07-01 Sam Weinig <sam@webkit.org>
2748 Try and fix mac builds.
2750 * JavaScriptCore.exp:
2752 2008-07-01 Sam Weinig <sam@webkit.org>
2754 Fix non-AllInOne builds.
2758 2008-07-01 Sam Weinig <sam@webkit.org>
2760 Reviewed by Darin Adler.
2762 Split JSCell and JSNumberCell class declarations out of JSValue.h
2765 * JavaScriptCore.pri:
2766 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2767 * JavaScriptCore.xcodeproj/project.pbxproj:
2768 * JavaScriptCoreSources.bkl:
2769 * VM/JSPropertyNameIterator.h:
2770 * kjs/AllInOneFile.cpp:
2771 * kjs/JSCell.cpp: Copied from JavaScriptCore/kjs/JSValue.cpp.
2772 * kjs/JSCell.h: Copied from JavaScriptCore/kjs/JSValue.h.
2773 (KJS::JSValue::getJSNumber):
2774 * kjs/JSNumberCell.cpp:
2775 * kjs/JSNumberCell.h: Copied from JavaScriptCore/kjs/JSValue.h.
2779 (KJS::jsOwnedString):
2781 (KJS::JSValue::toThisJSString):
2785 2008-07-01 Anders Carlsson <andersca@apple.com>
2789 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2790 * kjs/JSGlobalObject.h:
2791 (KJS::JSGlobalObject::addStaticGlobals):
2793 2008-07-01 Simon Hausmann <hausmann@webkit.org>
2795 Build fix, include OwnPtr.h.
2797 * kjs/RegExpConstructor.h:
2799 2008-06-30 Geoffrey Garen <ggaren@apple.com>
2801 Reviewed by Oliver Hunt.
2803 Fixed a global object leak caused by the switch to one register file.
2805 Don't unconditionally mark the register file, since that logically
2806 makes all global variables GC roots, even when their global object is
2807 no longer reachable.
2809 Instead, make the global object associated with the register file
2810 responsible for marking the register file.
2812 2008-06-30 Geoffrey Garen <ggaren@apple.com>
2814 Reviewed by Oliver Hunt.
2816 Removed the "registerBase" abstraction. Since the register file never
2817 reallocates, we can keep direct pointers into it, instead of
2818 <registerBase, offset> tuples.
2820 SunSpider says 0.8% faster.
2822 2008-06-30 Oliver Hunt <oliver@apple.com>
2824 Reviewed by NOBODY (build fix).
2826 Fix build by adding all (hopefully) the missing includes.
2828 * kjs/BooleanPrototype.cpp:
2829 * kjs/DateConstructor.cpp:
2830 * kjs/ErrorPrototype.cpp:
2831 * kjs/FunctionPrototype.cpp:
2832 * kjs/NativeErrorConstructor.cpp:
2833 * kjs/NumberPrototype.cpp:
2834 * kjs/ObjectPrototype.cpp:
2835 * kjs/RegExpConstructor.cpp:
2836 * kjs/StringConstructor.cpp:
2837 * kjs/StringPrototype.cpp:
2839 2008-06-30 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2843 Bug 19830: REGRESSION (r34883): Google Reader doesn't show up feed list on sidebar
2844 <https://bugs.webkit.org/show_bug.cgi?id=19830>
2846 Ensure that we do not eliminate a write to a local register when doing
2847 peephole optimizations.
2849 * VM/CodeGenerator.cpp:
2850 (KJS::CodeGenerator::emitJumpIfTrue):
2851 (KJS::CodeGenerator::emitJumpIfFalse):
2853 2008-06-30 Sam Weinig <sam@webkit.org>
2855 Rubber-stamped by Darin Alder.
2857 Split InternalFunction into its own header file.
2859 * API/JSCallbackFunction.h:
2860 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2861 * JavaScriptCore.xcodeproj/project.pbxproj:
2862 * kjs/ArrayConstructor.h:
2863 * kjs/BooleanConstructor.h:
2864 * kjs/DateConstructor.h:
2865 * kjs/ErrorConstructor.h:
2866 * kjs/FunctionConstructor.h:
2867 * kjs/FunctionPrototype.h:
2868 * kjs/InternalFunction.h: Copied from kjs/JSFunction.h.
2870 * kjs/NativeErrorConstructor.h:
2871 * kjs/NumberConstructor.h:
2872 * kjs/ObjectConstructor.h:
2873 * kjs/RegExpConstructor.h:
2874 * kjs/StringConstructor.h:
2875 * profiler/Profiler.cpp:
2877 2008-06-30 Sam Weinig <sam@webkit.org>
2879 Reviewed by Kevin McCullough.
2881 Remove empty files Instruction.cpp, LabelID.cpp, Register.cpp and RegisterID.cpp.
2884 * JavaScriptCore.pri:
2885 * JavaScriptCore.xcodeproj/project.pbxproj:
2886 * JavaScriptCoreSources.bkl:
2887 * VM/Instruction.cpp: Removed.
2888 * VM/LabelID.cpp: Removed.
2889 * VM/Register.cpp: Removed.
2890 * VM/RegisterID.cpp: Removed.
2892 2008-06-30 Sam Weinig <sam@webkit.org>
2894 Rubber-stamped (reluctantly) by Kevin McCullough.
2896 Rename date_object.h/cpp to DateInstance.h/cpp
2899 * JavaScriptCore.pri:
2900 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2901 * JavaScriptCore.xcodeproj/project.pbxproj:
2902 * JavaScriptCoreSources.bkl:
2903 * kjs/AllInOneFile.cpp:
2904 * kjs/DateConstructor.cpp:
2905 * kjs/DateInstance.cpp: Copied from kjs/date_object.cpp.
2906 * kjs/DateInstance.h: Copied from kjs/date_object.h.
2907 * kjs/DatePrototype.cpp:
2908 * kjs/DatePrototype.h:
2909 * kjs/date_object.cpp: Removed.
2910 * kjs/date_object.h: Removed.
2912 2008-06-30 Sam Weinig <sam@webkit.org>
2914 Rubber-stamped by Darin Adler.
2916 Remove internal.cpp and move its contents to there own .cpp files.
2919 * JavaScriptCore.pri:
2920 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2921 * JavaScriptCore.xcodeproj/project.pbxproj:
2922 * JavaScriptCoreSources.bkl:
2923 * kjs/AllInOneFile.cpp:
2924 * kjs/GetterSetter.cpp: Copied from kjs/internal.cpp.
2925 * kjs/InternalFunction.cpp: Copied from kjs/internal.cpp.
2926 * kjs/JSNumberCell.cpp: Copied from kjs/internal.cpp.
2927 * kjs/JSString.cpp: Copied from kjs/internal.cpp.
2929 * kjs/LabelStack.cpp: Copied from kjs/internal.cpp.
2930 * kjs/NumberConstructor.cpp:
2931 * kjs/NumberObject.cpp:
2932 (KJS::constructNumber):
2933 (KJS::constructNumberFromImmediateNumber):
2934 * kjs/internal.cpp: Removed.
2936 2008-06-30 Adam Roben <aroben@apple.com>
2938 Fix <rdar://5954749> Assertion failure due to HashTable's use of
2941 HashTable was passing &value to constructDeletedValue, which in
2942 classes like WebCore::COMPtr would cause an assertion. We now pass
2943 value by reference instead of by address so that the HashTraits
2944 implementations have more flexibility in constructing the deleted
2947 Reviewed by Ada Chan.
2949 * VM/CodeGenerator.h: Updated for changes to HashTraits.
2951 (WTF::::deleteBucket): Changed to pass bucket by reference instead of
2953 (WTF::::checkKey): Ditto.
2955 (WTF::): Updated HashTraits for HashTable change.
2957 2008-07-01 Alexey Proskuryakov <ap@webkit.org>
2959 Reviewed by Cameron Zwarich.
2961 Make RegisterFile really unmap memory on destruction.
2963 This fixes run-webkit-tests --threaded, which ran out of address space in a few seconds.
2965 * VM/RegisterFile.cpp: (KJS::RegisterFile::~RegisterFile): Unmap all the memory, not just
2968 * kjs/JSGlobalObject.h: Don't include RegisterFile.h, so that changes to it don't make
2969 half of WebCore rebuild.
2971 * VM/Machine.h: Don't forward declare RegisterFile, as RegisterFile.h is included already.
2973 * VM/RegisterFile.h: (KJS::RegisterFile::RegisterFile): Assert that the allocation succeeded.
2975 2008-06-30 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2977 Rubber-stamped by Oliver.
2979 Correct the documentation for op_put_by_index.
2982 (KJS::Machine::privateExecute):
2984 2008-06-29 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2988 Bug 19821: Merge the instruction pair (less, jfalse)
2989 <https://bugs.webkit.org/show_bug.cgi?id=19821>
2991 This is a 2.4% win on SunSpider. I needed to add an ALWAYS_INLINE
2992 intrinisc to CodeGenerator::rewindBinaryOp() to avoid a massive
2993 regression in regexp-dna.
2996 (KJS::CodeBlock::dump):
2997 * VM/CodeGenerator.cpp:
2998 (KJS::CodeGenerator::rewindBinaryOp):
2999 (KJS::CodeGenerator::emitJumpIfFalse):
3001 (KJS::Machine::privateExecute):
3006 2008-06-29 Sam Weinig <sam@webkit.org>
3008 Fix non-AllInOne builds.
3013 2008-06-29 Sam Weinig <sam@webkit.org>
3018 * kjs/DatePrototype.cpp:
3020 2008-06-29 Sam Weinig <sam@webkit.org>
3022 Rubber-stamped by Cameron Zwarich.
3024 Splits ErrorConstructor, ErrorPrototype, NativeErrorConstructor and
3025 NativeErrorPrototype out of error_object.h/cpp and renames it ErrorInstance.
3028 * JavaScriptCore.pri:
3029 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3030 * JavaScriptCore.xcodeproj/project.pbxproj:
3031 * JavaScriptCoreSources.bkl:
3032 * kjs/AllInOneFile.cpp:
3033 * kjs/ArrayConstructor.cpp:
3034 * kjs/ArrayPrototype.cpp:
3035 * kjs/BooleanPrototype.cpp:
3036 * kjs/DatePrototype.cpp:
3037 * kjs/ErrorConstructor.cpp: Copied from kjs/error_object.cpp.
3038 * kjs/ErrorConstructor.h: Copied from kjs/error_object.h.
3039 * kjs/ErrorInstance.cpp: Copied from kjs/error_object.cpp.
3040 * kjs/ErrorInstance.h: Copied from kjs/error_object.h.
3041 * kjs/ErrorPrototype.cpp: Copied from kjs/error_object.cpp.
3042 * kjs/ErrorPrototype.h: Copied from kjs/error_object.h.
3043 * kjs/JSGlobalObject.cpp:
3046 * kjs/NativeErrorConstructor.cpp: Copied from kjs/error_object.cpp.
3047 * kjs/NativeErrorConstructor.h: Copied from kjs/error_object.h.
3048 * kjs/NativeErrorPrototype.cpp: Copied from kjs/error_object.cpp.
3049 * kjs/NativeErrorPrototype.h: Copied from kjs/error_object.h.
3050 * kjs/NumberPrototype.cpp:
3051 * kjs/RegExpConstructor.cpp:
3052 * kjs/RegExpObject.cpp:
3053 * kjs/RegExpPrototype.cpp:
3054 * kjs/StringPrototype.cpp:
3055 * kjs/error_object.cpp: Removed.
3056 * kjs/error_object.h: Removed.
3059 2008-06-29 Sam Weinig <sam@webkit.org>
3061 Fix non-AllInOne build.
3063 * kjs/DateConstructor.cpp:
3067 2008-06-29 Sam Weinig <sam@webkit.org>
3069 Rubber-stamped by Oliver Hunt.
3071 Splits DateConstructor and DatePrototype out of date_object.h/cpp
3072 Moves shared Date code into DateMath.
3074 * DerivedSources.make:
3076 * JavaScriptCore.pri:
3077 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3078 * JavaScriptCore.xcodeproj/project.pbxproj:
3079 * JavaScriptCoreSources.bkl:
3080 * kjs/AllInOneFile.cpp:
3081 * kjs/DateConstructor.cpp: Copied from kjs/date_object.cpp.
3082 * kjs/DateConstructor.h: Copied from kjs/date_object.h.
3084 (KJS::ymdhmsToSeconds):
3086 (KJS::skipSpacesAndComments):
3091 (KJS::formatDateUTCVariant):
3095 * kjs/DatePrototype.cpp: Copied from kjs/date_object.cpp.
3096 * kjs/DatePrototype.h: Copied from kjs/date_object.h.
3097 * kjs/JSGlobalObject.cpp:
3099 * kjs/date_object.cpp:
3100 * kjs/date_object.h:
3103 2008-06-29 Jan Michael Alonzo <jmalonzo@webkit.org>
3105 Rubber-stamped by Cameron Zwarich
3107 Fix Gtk non-AllInOne build
3109 * GNUmakefile.am: include JSVariableObject.cpp
3110 * kjs/RegExpConstructor.cpp: include RegExpObject.h
3111 * kjs/RegExpObject.h: forward declare RegExpPrototype
3113 2008-06-28 Darin Adler <darin@apple.com>
3115 Reviewed by Sam and Cameron.
3117 - fix https://bugs.webkit.org/show_bug.cgi?id=19805
3118 Array.concat turns missing array elements into "undefined"
3120 Test: fast/js/array-holes.html
3122 * JavaScriptCore.exp: No longer export JSArray::getItem.
3124 * kjs/ArrayPrototype.cpp:
3125 (KJS::arrayProtoFuncConcat): Changed to use getProperty instead of
3126 JSArray::getItem -- need to handle properties from the prototype chain
3127 instead of ignoring them.
3129 * kjs/JSArray.cpp: Removed getItem.
3130 * kjs/JSArray.h: Ditto.
3132 2008-06-28 Darin Adler <darin@apple.com>
3134 Reviewed by Cameron.
3136 - https://bugs.webkit.org/show_bug.cgi?id=19804
3137 optimize access to arrays without "holes"
3139 SunSpider says 1.8% faster.
3142 (KJS::JSArray::JSArray): Initialize m_fastAccessCutoff when creating
3143 arrays. Also updated for new location of m_vectorLength.
3144 (KJS::JSArray::getItem): Updated for new location of m_vectorLength.
3145 (KJS::JSArray::getSlowCase): Added. Broke out the non-hot parts of
3146 getOwnPropertySlot to make the hot part faster.
3147 (KJS::JSArray::getOwnPropertySlot): Added a new faster case for
3148 indices lower than m_fastAccessCutoff. We can do theese with no
3149 additional checks or branches.
3150 (KJS::JSArray::put): Added a new faster case for indices lower than
3151 m_fastAccessCutoff. We can do theese with no additional checks or
3152 branches. Moved the maxArrayIndex handling out of this function.
3153 Added code to set m_fastAccessCutoff when the very last hole in
3154 an array is filled; this is how the cutoff gets set for most arrays.
3155 (KJS::JSArray::putSlowCase): Moved the rest of the put function logic
3156 in here, to make the hot part of the put function faster.
3157 (KJS::JSArray::deleteProperty): Added code to lower m_fastAccessCutoff
3158 when a delete makes a new hole in the array.
3159 (KJS::JSArray::getPropertyNames): Updated for new location of
3161 (KJS::JSArray::increaseVectorLength): Ditto.
3162 (KJS::JSArray::setLength): Added code to lower m_fastAccessCutoff
3163 when setLength makes the array smaller.
3164 (KJS::JSArray::mark): Updated for new location of m_vectorLength.
3165 (KJS::JSArray::sort): Ditto. Set m_fastAccessCutoff after moving
3166 all the holes to the end of the array.
3167 (KJS::JSArray::compactForSorting): Ditto.
3168 (KJS::JSArray::checkConsistency): Added consistency checks fro
3169 m_fastAccessCutoff and updated for the new location of m_vectorLength.
3171 * kjs/JSArray.h: Added declarations for slow case functions.
3172 Replaced m_vectorLength with m_fastAccessCutoff.
3174 2008-06-28 Cameron Zwarich <cwzwarich@uwaterloo.ca>
3178 When executing a native call, check for an exception before writing the
3182 (KJS::Machine::privateExecute):
3184 2008-06-28 Mark Rowe <mrowe@apple.com>
3186 Build fix. Flag headers as private or public as is appropriate.
3187 These settings were accidentally removed during some project file cleanup.
3189 * JavaScriptCore.xcodeproj/project.pbxproj:
3191 2008-06-28 Sam Weinig <sam@webkit.org>
3193 Rubber-stamped by Darin Adler.
3195 Splits RegExpConstructor and RegExpPrototype out of RegExpObject.h/cpp
3197 * DerivedSources.make:
3199 * JavaScriptCore.pri:
3200 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3201 * JavaScriptCore.xcodeproj/project.pbxproj:
3202 * JavaScriptCoreSources.bkl:
3204 * kjs/AllInOneFile.cpp:
3205 * kjs/JSGlobalObject.cpp:
3206 * kjs/RegExpConstructor.cpp: Copied from kjs/RegExpObject.cpp.
3207 * kjs/RegExpConstructor.h: Copied from kjs/RegExpObject.h.
3208 * kjs/RegExpObject.cpp:
3209 * kjs/RegExpObject.h:
3210 * kjs/RegExpPrototype.cpp: Copied from kjs/RegExpObject.cpp.
3211 * kjs/RegExpPrototype.h: Copied from kjs/RegExpObject.h.
3212 * kjs/StringPrototype.cpp:
3215 2008-06-28 Sam Weinig <sam@webkit.org>
3217 Fix non-AllInOne builds.
3219 * kjs/StringConstructor.cpp:
3221 2008-06-28 Sam Weinig <sam@webkit.org>
3223 Rubber-stamped by Darin Adler.
3225 Rename string_object.h/cpp to StringObject.h/cpp and split out StringObjectThatMasqueradesAsUndefined,
3226 StringConstructor and StringPrototype.
3228 * DerivedSources.make:
3230 * JavaScriptCore.pri:
3231 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3232 * JavaScriptCore.xcodeproj/project.pbxproj:
3233 * JavaScriptCoreSources.bkl:
3234 * kjs/AllInOneFile.cpp:
3235 * kjs/JSGlobalObject.cpp:
3236 * kjs/StringConstructor.cpp: Copied from JavaScriptCore/kjs/string_object.cpp.
3237 * kjs/StringConstructor.h: Copied from JavaScriptCore/kjs/string_object.h.
3238 * kjs/StringObject.cpp: Copied from JavaScriptCore/kjs/string_object.cpp.
3239 * kjs/StringObject.h: Copied from JavaScriptCore/kjs/string_object.h.
3240 * kjs/StringObjectThatMasqueradesAsUndefined.h: Copied from JavaScriptCore/kjs/string_object.h.
3241 * kjs/StringPrototype.cpp: Copied from JavaScriptCore/kjs/string_object.cpp.
3242 * kjs/StringPrototype.h: Copied from JavaScriptCore/kjs/string_object.h.
3244 * kjs/string_object.cpp: Removed.
3245 * kjs/string_object.h: Removed.
3247 2008-06-28 Jan Michael Alonzo <jmalonzo@webkit.org>
3249 Gtk build fix: JSVariableObject is now part of AllInOne
3253 2008-06-28 Darin Adler <darin@apple.com>
3257 - https://bugs.webkit.org/show_bug.cgi?id=19801
3258 add a feature so we can tell what regular expressions are taking time
3260 * pcre/pcre_compile.cpp:
3261 (jsRegExpCompile): Compile in the string if REGEXP_HISTOGRAM is on.
3263 * pcre/pcre_exec.cpp:
3264 (jsRegExpExecute): Add hook to time execution.
3265 (Histogram::~Histogram): Print a sorted list of what took time.
3266 (Histogram::add): Accumulate records of what took time.
3267 (HistogramTimeLogger::~HistogramTimeLogger): Hook that calls
3268 Histogram::add at the right moment and creates the global histogram
3271 * pcre/pcre_internal.h: Define REGEXP_HISTOGRAM.
3273 * pcre/pcre_tables.cpp: Added missing include of "config.h". Not needed
3274 any more, but an omissions an earlier version of this patch detected.
3275 * pcre/pcre_ucp_searchfuncs.cpp: Ditto.
3276 * pcre/pcre_xclass.cpp: Ditto.
3278 2008-06-28 Sam Weinig <sam@webkit.org>
3280 Try and fix the Windows build again.
3282 * kjs/RegExpObject.cpp:
3283 * kjs/date_object.cpp:
3284 * kjs/error_object.cpp:
3286 2008-06-28 Sam Weinig <sam@webkit.org>
3288 Rubber-stamped by Darin Adler.
3290 Remove unused StringConstructorFunction class.
3292 * kjs/string_object.h:
3294 2008-06-28 Sam Weinig <sam@webkit.org>
3298 * kjs/ArrayPrototype.cpp:
3299 * kjs/BooleanPrototype.cpp:
3300 * kjs/BooleanPrototype.h:
3301 * kjs/FunctionPrototype.cpp:
3302 * kjs/JSImmediate.cpp:
3304 * kjs/MathObject.cpp:
3305 * kjs/NumberPrototype.cpp:
3306 * kjs/NumberPrototype.h:
3307 * kjs/ObjectConstructor.cpp:
3308 * kjs/RegExpObject.h:
3309 * kjs/error_object.h:
3310 * kjs/string_object.cpp:
3312 2008-06-28 Sam Weinig <sam@webkit.org>
3314 Rubber-stamped by Oliver Hunt.
3316 Splits FunctionConstructor out of FunctionPrototype.h/cpp
3317 Splits NumberConstructor and NumberPrototype out of NumberObject.h/cpp
3318 Rename object_object.h/cpp to ObjectPrototype.h/cpp and split out ObjectConstructor.
3320 * API/JSCallbackConstructor.cpp:
3321 * API/JSClassRef.cpp:
3322 * API/JSObjectRef.cpp:
3323 * DerivedSources.make:
3325 * JavaScriptCore.pri:
3326 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3327 * JavaScriptCore.xcodeproj/project.pbxproj:
3328 * JavaScriptCoreSources.bkl:
3330 * kjs/AllInOneFile.cpp:
3331 * kjs/ArrayConstructor.cpp:
3332 * kjs/ArrayConstructor.h:
3333 * kjs/FunctionConstructor.cpp: Copied from JavaScriptCore/kjs/FunctionPrototype.cpp.
3334 * kjs/FunctionConstructor.h: Copied from JavaScriptCore/kjs/FunctionPrototype.h.
3335 * kjs/FunctionPrototype.cpp:
3336 * kjs/FunctionPrototype.h:
3337 * kjs/JSFunction.cpp:
3338 * kjs/JSGlobalObject.cpp:
3339 * kjs/JSImmediate.cpp:
3341 * kjs/NumberConstructor.cpp: Copied from JavaScriptCore/kjs/NumberObject.cpp.
3342 * kjs/NumberConstructor.h: Copied from JavaScriptCore/kjs/NumberObject.h.
3343 * kjs/NumberObject.cpp:
3344 * kjs/NumberObject.h:
3345 * kjs/NumberPrototype.cpp: Copied from JavaScriptCore/kjs/NumberObject.cpp.
3346 * kjs/NumberPrototype.h: Copied from JavaScriptCore/kjs/NumberObject.h.
3347 * kjs/ObjectConstructor.cpp: Copied from JavaScriptCore/kjs/object_object.cpp.
3348 * kjs/ObjectConstructor.h: Copied from JavaScriptCore/kjs/object_object.h.
3349 * kjs/ObjectPrototype.cpp: Copied from JavaScriptCore/kjs/object_object.cpp.
3350 * kjs/ObjectPrototype.h: Copied from JavaScriptCore/kjs/object_object.h.
3351 * kjs/RegExpObject.h:
3353 * kjs/error_object.h:
3356 * kjs/object_object.cpp: Removed.
3357 * kjs/object_object.h: Removed.
3358 * kjs/string_object.h:
3360 2008-06-28 Darin Adler <darin@apple.com>
3364 - fix https://bugs.webkit.org/show_bug.cgi?id=19796
3365 optimize expressions with ignored results (especially post-increment)
3367 SunSpider says 0.9% faster.
3369 * VM/CodeGenerator.h:
3370 (KJS::CodeGenerator::tempDestination): Create a new temporary for
3371 ignoredResult() too, just as we would for 0.
3372 (KJS::CodeGenerator::finalDestination): Use the temporary if the
3373 register passed in is ignoredResult() too, just as we would for 0.
3374 (KJS::CodeGenerator::destinationForAssignResult): Return 0 if the
3375 passed in register is ignoredResult(), just as we would for 0.
3376 (KJS::CodeGenerator::moveToDestinationIfNeeded): Return 0 if the
3377 register passed in is ignoredResult(). What matters is that we
3378 don't want to emit a move. The return value won't be looked at.
3379 (KJS::CodeGenerator::emitNode): Allow ignoredResult() and pass it
3380 through to the node's emitCode function.
3383 (KJS::ignoredResult): Added. Special value to indicate the result of
3384 a node will be ignored and need not be put in any register.
3387 (KJS::NullNode::emitCode): Do nothing if dst == ignoredResult().
3388 (KJS::BooleanNode::emitCode): Ditto.
3389 (KJS::NumberNode::emitCode): Ditto.
3390 (KJS::StringNode::emitCode): Ditto.
3391 (KJS::RegExpNode::emitCode): Ditto.
3392 (KJS::ThisNode::emitCode): Ditto.
3393 (KJS::ResolveNode::emitCode): Do nothing if dst == ignoredResult() and
3394 the identifier resolves to a local variable.
3395 (KJS::ObjectLiteralNode::emitCode): Do nothing if dst == ignoredResult()
3396 and the object is empty.
3397 (KJS::PostIncResolveNode::emitCode): If dst == ignoredResult(), then do
3398 nothing for the local constant case, and do a pre-increment in all the
3400 (KJS::PostDecResolveNode::emitCode): Ditto.
3401 (KJS::PostIncBracketNode::emitCode): Ditto.
3402 (KJS::PostDecBracketNode::emitCode): Ditto.
3403 (KJS::PostIncDotNode::emitCode): Ditto.
3404 (KJS::PostDecDotNode::emitCode): Ditto.
3405 (KJS::DeleteValueNode::emitCode): Pass ignoredResult() when evaluating
3407 (KJS::VoidNode::emitCode): Ditto.
3408 (KJS::TypeOfResolveNode::emitCode): If dst == ignoredResult(), do nothing
3409 if the identifier resolves to a local variable, and don't bother generating
3410 a typeof opcode in the other case.
3411 (KJS::TypeOfValueNode::emitCode): Ditto.
3412 (KJS::PreIncResolveNode::emitCode): Do nothing if dst == ignoredResult() and
3413 the identifier resolves to a local constant.
3414 (KJS::PreDecResolveNode::emitCode): Ditto.
3415 (KJS::AssignResolveNode::emitCode): Turn ignoredResult() into 0 in a couple
3416 places, because we need to put the result into a register so we can assign
3417 it. At other sites this is taken care of by functions like finalDestination.
3418 (KJS::CommaNode::emitCode): Pass ignoredResult() when evaluating the first
3420 (KJS::ForNode::emitCode): Pass ignoredResult() when evaluating the first and
3422 (KJS::ForInNode::emitCode): Pass ignoredResult() when evaluating the first
3425 2008-06-28 Darin Adler <darin@apple.com>
3429 - https://bugs.webkit.org/show_bug.cgi?id=19787
3430 create most arrays from values in registers rather than with multiple put operations
3432 SunSpider says 0.8% faster.
3435 (KJS::CodeBlock::dump): Added argv and argc parameters to new_array.
3437 (KJS::Machine::privateExecute): Ditto.
3439 * VM/CodeGenerator.cpp:
3440 (KJS::CodeGenerator::emitNewArray): Added.
3441 * VM/CodeGenerator.h: Added ElementNode* argument to emitNewArray.
3444 (KJS::ArrayNode::emitCode): Pass the ElementNode to emitNewArray so it can be
3445 initialized with as many elements as possible. If the array doesn't have any
3446 holes in it, that's all that's needed. If there are holes, then emit some separate
3447 put operations for the other values in the array and for the length as needed.
3449 * kjs/nodes.h: Added some accessors to ElementNode so the code generator can
3450 iterate through elements and generate code to evaluate them. Now ArrayNode does
3451 not need to be a friend. Also took out some unused PlacementNewAdoptType
3454 2008-06-28 Darin Adler <darin@apple.com>
3458 * kjs/nodes.h: Remove obsolete PlacementNewAdopt constructors.
3459 We no longer mutate the AST in place.
3461 2008-06-28 Jan Michael Alonzo <jmalonzo@webkit.org>
3463 Reviewed by Oliver Hunt.
3467 * VM/Machine.cpp: include stdio.h for printf
3469 2008-06-27 Sam Weinig <sam@webkit.org>
3471 Reviewed by Oliver Hunt.
3473 Fix platforms that don't use AllInOne.cpp
3475 * kjs/BooleanConstructor.h:
3476 * kjs/BooleanPrototype.h:
3477 * kjs/FunctionPrototype.cpp:
3479 2008-06-27 Sam Weinig <sam@webkit.org>
3481 Rubber-stamped by Oliver Hunt.
3483 Splits ArrayConstructor out of ArrayPrototype.h/cpp
3484 Splits BooleanConstructor and BooleanPrototype out of BooleanObject.h/cpp
3487 * JavaScriptCore.pri:
3488 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3489 * JavaScriptCore.xcodeproj/project.pbxproj:
3490 * JavaScriptCoreSources.bkl:
3492 * kjs/AllInOneFile.cpp:
3493 * kjs/ArrayConstructor.cpp: Copied from kjs/ArrayPrototype.cpp.
3494 * kjs/ArrayConstructor.h: Copied from kjs/ArrayPrototype.h.
3495 * kjs/ArrayPrototype.cpp:
3496 * kjs/ArrayPrototype.h:
3497 * kjs/BooleanConstructor.cpp: Copied from kjs/BooleanObject.cpp.
3498 * kjs/BooleanConstructor.h: Copied from kjs/BooleanObject.h.
3499 * kjs/BooleanObject.cpp:
3500 * kjs/BooleanObject.h:
3501 * kjs/BooleanPrototype.cpp: Copied from kjs/BooleanObject.cpp.
3502 * kjs/BooleanPrototype.h: Copied from kjs/BooleanObject.h.
3503 * kjs/CommonIdentifiers.h:
3504 * kjs/FunctionPrototype.cpp:
3506 * kjs/JSGlobalObject.cpp:
3507 * kjs/JSImmediate.cpp:
3511 * kjs/string_object.cpp:
3513 2008-06-27 Oliver Hunt <oliver@apple.com>
3517 Bug 18626: SQUIRRELFISH: support the "slow script" dialog <https://bugs.webkit.org/show_bug.cgi?id=18626>
3518 <rdar://problem/5973931> Slow script dialog needs to be reimplemented for squirrelfish
3520 Adds support for the slow script dialog in squirrelfish. This requires the addition
3521 of three new op codes, op_loop, op_loop_if_true, and op_loop_if_less which have the
3522 same behaviour as their simple jump equivalents but have an additional time out check.
3524 Additional assertions were added to other jump instructions to prevent accidentally
3525 creating loops with jump types that do not support time out checks.
3527 Sunspider does not report a regression, however this appears very sensitive to code
3528 layout and hardware, so i would expect up to a 1% regression on other systems.
3530 Part of this required moving the old timeout logic from JSGlobalObject and into Machine
3531 which is the cause of a number of the larger diff blocks.
3533 * JavaScriptCore.exp:
3535 (KJS::CodeBlock::dump):
3536 * VM/CodeGenerator.cpp:
3537 (KJS::CodeGenerator::emitJumpIfTrue):
3538 (KJS::CodeGenerator::emitJumpScopes):
3539 * VM/ExceptionHelpers.cpp:
3540 (KJS::InterruptedExecutionError::isWatchdogException):
3541 (KJS::createInterruptedExecutionException):
3542 * VM/ExceptionHelpers.h:
3545 (KJS::Machine::Machine):
3546 (KJS::Machine::throwException):
3547 (KJS::Machine::resetTimeoutCheck):
3548 (KJS::getCurrentTime):
3549 (KJS::Machine::checkTimeout):
3550 (KJS::Machine::privateExecute):
3552 (KJS::Machine::setTimeoutTime):
3553 (KJS::Machine::startTimeoutCheck):
3554 (KJS::Machine::stopTimeoutCheck):
3555 (KJS::Machine::initTimeout):