1 2008-08-06 Cameron Zwarich <cwzwarich@webkit.org>
5 Bug 20286: Load constants all at once instead of using op_load
6 <https://bugs.webkit.org/show_bug.cgi?id=20286>
8 Load constants all at once into temporary registers instead of using
9 individual instances of op_load.
11 This is a 2.6% speedup on SunSpider.
15 (KJS::CodeBlock::dump):
16 (KJS::CodeBlock::mark):
18 * VM/CodeGenerator.cpp:
19 (KJS::CodeGenerator::CodeGenerator):
20 (KJS::CodeGenerator::newTemporary):
21 (KJS::CodeGenerator::addConstant):
22 (KJS::CodeGenerator::addUnexpectedConstant):
23 (KJS::CodeGenerator::emitLoad):
24 (KJS::CodeGenerator::emitUnexpectedLoad):
25 (KJS::CodeGenerator::emitNewError):
28 (KJS::slideRegisterWindowForCall):
29 (KJS::Machine::unwindCallFrame):
30 (KJS::Machine::throwException):
31 (KJS::Machine::execute):
32 (KJS::Machine::privateExecute):
36 (KJS::RegisterID::RegisterID):
37 (KJS::RegisterID::makeConstant):
38 (KJS::RegisterID::isTemporary):
41 (KJS::Parser::didFinishParsing):
46 (KJS::NullNode::emitCode):
47 (KJS::BooleanNode::emitCode):
48 (KJS::NumberNode::emitCode):
49 (KJS::StringNode::emitCode):
50 (KJS::ArrayNode::emitCode):
51 (KJS::DeleteResolveNode::emitCode):
52 (KJS::DeleteValueNode::emitCode):
53 (KJS::VoidNode::emitCode):
54 (KJS::ConstDeclNode::emitCodeSingle):
55 (KJS::ReturnNode::emitCode):
56 (KJS::ScopeNode::ScopeNode):
57 (KJS::ProgramNode::ProgramNode):
58 (KJS::ProgramNode::create):
59 (KJS::EvalNode::EvalNode):
60 (KJS::EvalNode::create):
61 (KJS::FunctionBodyNode::FunctionBodyNode):
62 (KJS::FunctionBodyNode::create):
63 (KJS::FunctionBodyNode::emitCode):
65 (KJS::ScopeNode::neededConstants):
67 2008-08-05 Maciej Stachowiak <mjs@apple.com>
71 - add fast path for immediates to % operator, as we have for many other math ops
73 This fixes handling for a 0 divisor relative to the last patch. Only an 0.2% speedup on SunSpider but
74 still a 1.4x win on Oliver's prime test.
77 (KJS::Machine::privateExecute):
79 2008-08-05 Cameron Zwarich <cwzwarich@uwaterloo.ca>
83 Bug 20293: Crash in JavaScript codegen for eval("const a;")
84 <https://bugs.webkit.org/show_bug.cgi?id=20293>
86 Correctly handle constant declarations in eval code with no initializer.
89 (KJS::ConstDeclNode::emitCodeSingle):
91 2008-08-05 Cameron Zwarich <cwzwarich@uwaterloo.ca>
95 Roll out r35555 because of correctness issues.
98 (KJS::Machine::privateExecute):
100 2008-08-05 Maciej Stachowiak <mjs@apple.com>
104 - add fast path for immediates to % operator, as we have for many other math ops
106 0.6% speedup on SunSpider. 1.4x speedup on a prime testing torture test that Oliver whipped up.
109 (KJS::Machine::privateExecute):
111 2008-07-31 Oliver Hunt <oliver@apple.com>
113 Reviewed by Cameron Zwarich.
115 Bug 19359: JavaScriptCore behaves differently from FF2/3 and IE when handling context in catch statement
116 <https://bugs.webkit.org/show_bug.cgi?id=19359>
118 Make our catch behave like Firefox and IE, we do this by using a StaticScopeObject
119 instead of a generic JSObject for the scope node. We still don't make use of the
120 fact that we have a static scope inside the catch block, so the internal performance
121 of the catch block is not improved, even though technically it would be possible to
125 (KJS::CodeBlock::dump):
126 * VM/CodeGenerator.cpp:
127 (KJS::CodeGenerator::emitPushNewScope):
128 * VM/CodeGenerator.h:
130 (KJS::createExceptionScope):
131 (KJS::Machine::privateExecute):
134 * kjs/JSStaticScopeObject.cpp:
135 (KJS::JSStaticScopeObject::toThisObject):
136 (KJS::JSStaticScopeObject::put):
137 * kjs/JSStaticScopeObject.h:
139 (KJS::TryNode::emitCode):
141 2008-08-02 Rob Gowin <robg@gowin.net>
143 Reviewed by Eric Seidel.
145 Added JavaScriptCore/API/WebKitAvailability to list of files in
146 javascriptcore_h_api.
150 2008-08-01 Alexey Proskuryakov <ap@webkit.org>
152 Rubber-stamped by Maciej.
154 Remove JSGlobalData::DataInstance. It was only needed when we had per-thread JSGlobalData
157 * kjs/JSGlobalData.h:
159 2008-07-31 Kevin Ollivier <kevino@theolliviers.com>
161 Second attempt at Windows/wx build fix. Instead of avoiding inclusion of windows.h,
162 use defines, etc. to avoid conflicts in each affected file. Also, change PLATFORM(WIN)
163 to PLATFORM(WIN_OS) so that other ports using Windows headers get the right impls.
165 * VM/SamplingTool.cpp:
168 2008-07-31 Anders Carlsson <andersca@apple.com>
175 * wtf/FastMalloc.cpp:
177 2008-07-31 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
181 Bug 20170: [Qt] missing namespace defines in JavaScriptCore.pro
182 <https://bugs.webkit.org/show_bug.cgi?id=20170>
184 * JavaScriptCore.pro: Added missing define.
186 2008-07-31 Alexey Proskuryakov <ap@webkit.org>
188 Rubber-stamped by Maciej.
190 Eliminate JSLock (it was already disabled, removing the stub implementaion and all
195 (JSCheckScriptSyntax):
197 * API/JSCallbackConstructor.cpp:
198 (KJS::constructJSCallback):
199 * API/JSCallbackFunction.cpp:
200 (KJS::JSCallbackFunction::call):
201 * API/JSCallbackObjectFunctions.h:
203 (KJS::::getOwnPropertySlot):
205 (KJS::::deleteProperty):
207 (KJS::::hasInstance):
209 (KJS::::getPropertyNames):
212 (KJS::::staticValueGetter):
213 (KJS::::callbackGetter):
214 * API/JSContextRef.cpp:
215 (JSGlobalContextCreateInGroup):
216 (JSGlobalContextRetain):
217 (JSGlobalContextRelease):
218 * API/JSObjectRef.cpp:
220 (JSObjectMakeFunctionWithCallback):
221 (JSObjectMakeConstructor):
222 (JSObjectMakeFunction):
223 (JSObjectHasProperty):
224 (JSObjectGetProperty):
225 (JSObjectSetProperty):
226 (JSObjectGetPropertyAtIndex):
227 (JSObjectSetPropertyAtIndex):
228 (JSObjectDeleteProperty):
229 (JSObjectCallAsFunction):
230 (JSObjectCallAsConstructor):
231 (JSObjectCopyPropertyNames):
232 (JSPropertyNameArrayRelease):
233 (JSPropertyNameAccumulatorAddName):
234 * API/JSStringRef.cpp:
236 * API/JSValueRef.cpp:
238 (JSValueIsInstanceOfConstructor):
242 (JSValueToStringCopy):
246 * ForwardingHeaders/JavaScriptCore/JSLock.h: Removed.
248 * JavaScriptCore.exp:
249 * JavaScriptCore.order:
250 * JavaScriptCore.pri:
251 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
252 * JavaScriptCore.xcodeproj/project.pbxproj:
253 * JavaScriptCoreSources.bkl:
254 * kjs/AllInOneFile.cpp:
255 * kjs/JSGlobalData.cpp:
256 (KJS::JSGlobalData::JSGlobalData):
257 * kjs/JSGlobalData.h:
258 * kjs/JSGlobalObject.cpp:
259 (KJS::JSGlobalObject::~JSGlobalObject):
260 (KJS::JSGlobalObject::init):
261 * kjs/JSLock.cpp: Removed.
262 * kjs/JSLock.h: Removed.
268 (KJS::Heap::heapAllocate):
269 (KJS::Heap::setGCProtectNeedsLocking):
270 (KJS::Heap::protect):
271 (KJS::Heap::unprotect):
272 (KJS::Heap::collect):
273 * kjs/identifier.cpp:
274 * kjs/interpreter.cpp:
275 (KJS::Interpreter::checkSyntax):
276 (KJS::Interpreter::evaluate):
278 2008-07-31 Alexey Proskuryakov <ap@webkit.org>
280 Rubber-stamped by Oliver Hunt.
282 Fix the Mac project to not display "test/" as part of file name for tests.
284 * JavaScriptCore.xcodeproj/project.pbxproj:
286 2008-07-31 Eric Seidel <eric@webkit.org>
288 Reviewed by Alexey Proskuryakov.
290 Rename USE(MULTIPLE_THREADS) to ENABLE(JSC_MULTIPLE_THREADS)
291 to better match the use/enable pattern (and better describe
292 the usage of the feature in question.)
294 I also fixed a couple other ENABLE_ macros to be pre-processor
295 definition override-able to match the rest of the ENABLE_ macros
296 since it seems to be our convention that build systems can set
297 ENABLE_ macros in Makefiles.
299 * kjs/InitializeThreading.cpp:
300 (KJS::initializeThreadingOnce):
301 * kjs/JSGlobalData.cpp:
302 (KJS::JSGlobalData::JSGlobalData):
303 (KJS::JSGlobalData::~JSGlobalData):
304 * kjs/MathObject.cpp:
308 (KJS::allocateBlock):
309 (KJS::Heap::markStackObjectsConservatively):
316 * wtf/FastMalloc.cpp:
318 * wtf/RefCountedLeakCounter.cpp:
320 2008-07-30 Eric Seidel <eric@webkit.org>
322 Reviewed by Mark Rowe.
324 Try to clean up our usage of USE(MULTIPLE_THREADS) vs. USE(PTHREADS) a little.
325 It looks like JSC assumes that if MULTIPLE_THREADS is defined, then pthreads will always be available
326 I'm not sure that's always the case for gtk, certainly not for Windows. We should eventually go back
327 and fix wtf/Threading.h to cover all these cases some day.
333 2008-07-30 Eric Seidel <eric@webkit.org>
337 MSVC warns when structs are called classes or vice versa.
338 Make all the source refer to JSGlobalData as a class.
340 * kjs/CommonIdentifiers.h:
341 * kjs/JSGlobalData.h:
345 2008-07-30 Alexey Proskuryakov <ap@webkit.org>
347 Reviewed by Geoff Garen.
349 Add consistency checks to UString to document and enforce its design.
352 (KJS::UString::Rep::create):
353 (KJS::UString::Rep::destroy):
354 (KJS::UString::Rep::checkConsistency):
355 (KJS::UString::expandCapacity):
356 (KJS::UString::expandPreCapacity):
357 (KJS::UString::UString):
358 (KJS::UString::spliceSubstringsWithSeparators):
359 (KJS::UString::append):
361 (KJS::UString::Rep::checkConsistency):
363 2008-07-30 Gavin Barraclough <barraclough@apple.com>
365 Reviewed by Geoff Garen.
367 Fixes for Windows and non-AllInOne file build with SamplingTool, plus review fixes.
369 * GNUmakefile.am: Adding SamplingTool.cpp to build.
370 * JavaScriptCore.exp: Export hooks to init & control SamplingTool.
371 * JavaScriptCore.pri: Adding SamplingTool.cpp to build.
372 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Adding SamplingTool.cpp to build.
373 * JavaScriptCore.xcodeproj/project.pbxproj: Adding SamplingTool.cpp to build.
374 * JavaScriptCoreSources.bkl: Adding SamplingTool.cpp to build.
375 * VM/Machine.cpp: MACHINE_SAMPLING_callingNativeFunction renamed MACHINE_SAMPLING_callingHostFunction
377 * VM/Opcode.cpp: SamplingTool moved to SamplingTool.cpp/.h, opcodeNames generated from FOR_EACH_OPCODE_ID.
379 * VM/SamplingTool.cpp: Added .cpp/.h for SamplingTool.
381 * kjs/Shell.cpp: Switched SAMPLING_TOOL_ENABLED to ENABLE_SAMPLING_TOOL.
382 * wtf/Platform.h: Added ENABLE_SAMPLING_TOOL config option.
383 * kjs/nodes.cpp: Header include to fix non-AllInOne builds.
385 2008-07-30 Ariya Hidayat <ariya.hidayat@trolltech.com>
387 Reviewed by Alexey Proskuryakov.
389 Fix compilation without multi-threading support.
394 2008-07-30 Anders Carlsson <andersca@apple.com>
396 Add WebKitAvailability.h forwarding header.
398 * ForwardingHeaders/JavaScriptCore/WebKitAvailability.h: Added.
400 2008-07-30 Anders Carlsson <andersca@apple.com>
404 * API/WebKitAvailability.h:
406 2008-07-30 Anders Carlsson <andersca@apple.com>
408 * API/WebKitAvailability.h:
409 Fix Windows (and other non-Mac builds).
411 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
412 Add WebKitAvailability.h to the project.
414 2008-07-30 Anders Carlsson <andersca@apple.com>
416 One step closer towards fixing the Windows build.
418 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
419 Make sure to copy WebKitAvailability.h
421 2008-07-29 Gavin Barraclough <barraclough@apple.com>
423 Reviewed by Geoff Garen.
425 Bug 20209: Atomize constant strings
426 <https://bugs.webkit.org/show_bug.cgi?id=20209>
428 Prevents significant performance degradation seen when a script contains multiple
429 identical strings that are used as keys to identify properties on objects.
431 No performance change on SunSpider.
433 * kjs/nodes.cpp: Atomize constant strings.
435 2008-07-30 Oliver Hunt <oliver@apple.com>
437 Reviewed by Alexey Proskuryakov.
439 <rdar://problem/6111648> JavaScript exceptions fail if the scope chain includes the global object
441 In an attempt to remove the branch I just added to KJS::depth I
442 used the existence of a Variable Object at a point in the scope
443 chain as an indicator of function or global scope activation.
444 However this assumption results in incorrect behaviour if the
445 global object is injected into the scope chain with 'with'.
450 2008-07-30 Alexey Proskuryakov <ap@webkit.org>
452 Reviewed by Geoff Garen.
454 Don't call JSGarbageCollect() on a released context.
456 * API/testapi.c: (main):
458 2008-07-29 Alexey Proskuryakov <ap@webkit.org>
460 Reviewed by Geoff Garen.
462 Implement JSContextGroup APIs to make concurrent execution possible for
463 JavaScriptCore clients.
465 This changes the behavior of JSGlobalContextCreate(), so that it now uses a private context
466 group for each context, making JSlock implicit locking unnecessary.
468 * API/JSContextRef.h:
469 * API/JSContextRef.cpp:
470 (JSContextGroupCreate):
471 (JSContextGroupRetain):
472 (JSContextGroupRelease):
473 (JSGlobalContextCreate):
474 (JSGlobalContextCreateInGroup):
475 (JSGlobalContextRelease):
477 Added new methods. JSGlobalContextCreate() calls JSGlobalContextCreateInGroup() now.
479 * API/APICast.h: (toJS): (toRef): Added converters for JSContextGroupRef.
480 * API/JSBase.cpp: (JSGarbageCollect): JSGarbageCollect(0) is now a no-op, and the passed in
481 context is actually used.
483 * API/JSBase.h: Aded a typedef for JSContextGroupRef. Updated documentation for
486 * JavaScriptCore.exp: Removed JSGlobalData::sharedInstance().
488 * kjs/JSGlobalData.cpp:
489 * kjs/JSGlobalData.h:
490 Removed support for JSGlobalData shared instance. JSGlobalData::isSharedInstance member
491 variable still remains, to be deleted in a followup patch.
493 * kjs/JSLock.cpp: (KJS::JSLock::JSLock): Disabled JSLock, to be deleted in a follow-up patch.
496 (KJS::Heap::markOtherThreadConservatively): Removed an assertion that referenced
497 JSGlobalData::sharedInstance.
499 * kjs/collector.h: Made Heap destructor public, so that JSContextRelease can use it.
501 2008-07-29 Alexey Proskuryakov <ap@webkit.org>
503 Reviewed by Geoff Garen.
505 Fix a leak of ThreadRegistrar objects.
507 As the heap is usually deleted when registered threads still exist, ThreadSpecific doesn't
508 have a chance to clean up per-thread object. Switched to native pthread calls, storing a
509 plain pointer that doesn't require cleanup.
512 (KJS::PlatformThread::PlatformThread):
513 (KJS::Heap::Thread::Thread):
516 (KJS::Heap::registerThread):
517 (KJS::Heap::unregisterThread):
520 2008-07-29 Alexey Proskuryakov <ap@webkit.org>
522 Reviewed by Sam Weinig.
524 https://bugs.webkit.org/show_bug.cgi?id=20169
525 Memory allocated with fastMalloc is freed with delete
527 * VM/JSPropertyNameIterator.cpp:
528 (KJS::JSPropertyNameIterator::invalidate): Free the array properly.
529 (KJS::JSPropertyNameIterator::~JSPropertyNameIterator): Delete the array by calling
532 2008-07-29 Mark Rowe <mrowe@apple.com>
534 Attempt to fix the Qt build.
536 * wtf/ThreadingQt.cpp: Add the extra argument to createThread.
538 2008-07-29 Adam Roben <aroben@apple.com>
540 Change Vector::find to return an index instead of an iterator
542 Indices are more natural than iterators when working with Vector.
544 Reviewed by John Sullivan.
547 (WTF::Vector::find): Changed to iterate the Vector manually and return
548 the index of the found item, rather than an iterator. When the item
549 could not be found, we return WTF::notFound.
551 2008-07-29 Adam Roben <aroben@apple.com>
555 * wtf/ThreadingWin.cpp:
556 (WTF::setThreadName): Move a misplaced assertion to here...
557 (WTF::createThread): ...from here.
559 2008-07-29 Adam Roben <aroben@apple.com>
561 Add support for setting thread names on Windows
563 These thread names make it much easier to identify particular threads
564 in Visual Studio's Threads panel.
566 WTF::createThread now takes a const char* representing the thread's
567 name. On Windows, we throw a special exception to set this string as
568 the thread's name. Other platforms do nothing with this name for now.
570 Reviewed by Anders Carlsson.
572 * JavaScriptCore.exp: Export the new version of createThread that
573 takes 3 arguments (the old one continues to be exported for backward
575 * wtf/Threading.h: Add a threadName argument to createThread.
577 * wtf/ThreadingGtk.cpp:
579 * wtf/ThreadingNone.cpp:
581 Updated for function signature change.
583 * wtf/ThreadingPthreads.cpp:
584 (WTF::createThread): Updated for function signature change. We keep
585 around the old 2-argument version of createThread for backward
588 * wtf/ThreadingWin.cpp:
589 (WTF::setThreadName): Added. This function's implementation came from
591 (WTF::initializeThreading): Set the name of the main thread.
592 (WTF::createThread): Call setThreadName. We keep around the old
593 2-argument version of createThread for backward compatibility.
595 2008-07-29 Alexey Proskuryakov <ap@webkit.org>
597 Reviewed by Oliver Hunt.
599 Store UString::Rep::isStatic bit in identifierTable pointer instead of reportedCost for
600 slightly nicer code and a 0.5% SunSpider improvement.
602 * API/JSClassRef.cpp:
603 (OpaqueJSClass::~OpaqueJSClass):
604 (OpaqueJSClassContextData::OpaqueJSClassContextData):
605 * API/JSStringRef.cpp:
607 * kjs/PropertyNameArray.cpp:
608 (KJS::PropertyNameArray::add):
609 * kjs/identifier.cpp:
610 (KJS::IdentifierTable::~IdentifierTable):
611 (KJS::IdentifierTable::add):
612 (KJS::Identifier::addSlowCase):
613 (KJS::Identifier::remove):
615 (KJS::Identifier::add):
618 (KJS::UString::Rep::create):
619 (KJS::UString::Rep::destroy):
621 (KJS::UString::Rep::identifierTable):
622 (KJS::UString::Rep::setIdentifierTable):
623 (KJS::UString::Rep::isStatic):
624 (KJS::UString::Rep::setStatic):
625 (KJS::UString::cost):
627 2008-07-28 Geoffrey Garen <ggaren@apple.com>
629 Reviewed by Sam Weinig.
631 Renamed "ConstructTypeNative" => "ConstructTypeHost".
633 2008-07-26 Mark Rowe <mrowe@apple.com>
635 Speculative fix for the wx build.
637 * JavaScriptCoreSources.bkl: Add JSStaticScopeObject.cpp to the list of source files.
639 2008-07-25 Oliver Hunt <oliver@apple.com>
643 Whoops, forgot to save style correction.
645 * kjs/JSStaticScopeObject.h:
647 2008-07-25 Oliver Hunt <oliver@apple.com>
649 Reviewed by Cameron Zwarich.
651 Bug 19718: Named anonymous functions are slow accessing global variables
652 <https://bugs.webkit.org/show_bug.cgi?id=19718>
654 To fix this we switch over to an activation-like scope object for
655 on which we attach the function name property, and add logic to
656 prevent cross scope assignment to read only properties.
659 * JavaScriptCore.pri:
660 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
661 * JavaScriptCore.xcodeproj/project.pbxproj:
662 * VM/CodeGenerator.cpp:
663 (KJS::CodeGenerator::findScopedProperty):
664 (KJS::CodeGenerator::emitResolve):
665 * VM/CodeGenerator.h:
666 * kjs/AllInOneFile.cpp:
667 * kjs/JSStaticScopeObject.cpp: Added.
668 (KJS::JSStaticScopeObject::putWithAttributes):
669 (KJS::JSStaticScopeObject::isDynamicScope):
670 (KJS::JSStaticScopeObject::~JSStaticScopeObject):
671 (KJS::JSStaticScopeObject::getOwnPropertySlot):
672 * kjs/JSStaticScopeObject.h: Added.
673 (KJS::JSStaticScopeObject::JSStaticScopeObjectData::JSStaticScopeObjectData):
674 (KJS::JSStaticScopeObject::JSStaticScopeObject):
676 (KJS::FunctionCallResolveNode::emitCode):
677 (KJS::PostfixResolveNode::emitCode):
678 (KJS::PrefixResolveNode::emitCode):
679 (KJS::ReadModifyResolveNode::emitCode):
680 (KJS::AssignResolveNode::emitCode):
681 (KJS::FuncExprNode::makeFunction):
683 2008-07-25 kevino <kevino@theolliviers.com>
685 wx build fix for Win.
687 On wx/Win, including windows.h in Threading.h causes multiply-defined symbol errors
688 for libjpeg and wx, and also wx needs to include windows.h itself first for wx
689 includes to work right. So until we can find a better solution to this problem,
690 on wx, we work around the need to include windows.h here.
694 2008-07-25 Adam Roben <aroben@apple.com>
698 * JavaScriptCore.vcproj/testapi/testapi.vcproj: Add API/ to the
701 2008-07-25 Simon Hausmann <hausmann@webkit.org>
703 Fix the build of jsc on Qt/Windows, make sure os-win32 is in the
704 include search path (added by WebKit.pri).
708 2008-07-25 Alexey Proskuryakov <ap@webkit.org>
710 Reviewed by Simon Hausmann.
712 Move JavaScriptCore API tests into a subdirectory of their own to avoid header name
713 conflicts and developer confusion.
715 * API/JSNode.c: Removed.
716 * API/JSNode.h: Removed.
717 * API/JSNodeList.c: Removed.
718 * API/JSNodeList.h: Removed.
719 * API/Node.c: Removed.
720 * API/Node.h: Removed.
721 * API/NodeList.c: Removed.
722 * API/NodeList.h: Removed.
723 * API/minidom.c: Removed.
724 * API/minidom.html: Removed.
725 * API/minidom.js: Removed.
726 * API/testapi.c: Removed.
727 * API/testapi.js: Removed.
729 * API/tests/JSNode.c: Copied from JavaScriptCore/API/JSNode.c.
730 * API/tests/JSNode.h: Copied from JavaScriptCore/API/JSNode.h.
731 * API/tests/JSNodeList.c: Copied from JavaScriptCore/API/JSNodeList.c.
732 * API/tests/JSNodeList.h: Copied from JavaScriptCore/API/JSNodeList.h.
733 * API/tests/Node.c: Copied from JavaScriptCore/API/Node.c.
734 * API/tests/Node.h: Copied from JavaScriptCore/API/Node.h.
735 * API/tests/NodeList.c: Copied from JavaScriptCore/API/NodeList.c.
736 * API/tests/NodeList.h: Copied from JavaScriptCore/API/NodeList.h.
737 * API/tests/minidom.c: Copied from JavaScriptCore/API/minidom.c.
738 * API/tests/minidom.html: Copied from JavaScriptCore/API/minidom.html.
739 * API/tests/minidom.js: Copied from JavaScriptCore/API/minidom.js.
740 * API/tests/testapi.c: Copied from JavaScriptCore/API/testapi.c.
741 * API/tests/testapi.js: Copied from JavaScriptCore/API/testapi.js.
743 * JavaScriptCore.vcproj/testapi/testapi.vcproj:
744 * JavaScriptCore.xcodeproj/project.pbxproj:
746 2008-07-25 Simon Hausmann <hausmann@webkit.org>
748 Prospective WX build fix, add JavaScriptCore/API to the include search
753 2008-07-25 Simon Hausmann <hausmann@webkit.org>
755 Rubber-stamped by Lars.
757 Fix the build on Windows. operator new for ArgList is implemented using fastMalloc()
758 but operator delete was not implemented. Unfortunately MSVC decides to call/reference
759 the function, so a simple implementation using fastFree() fixes the build.
762 (KJS::ArgList::operator delete):
764 2008-07-25 Simon Hausmann <hausmann@webkit.org>
766 Discussed with and rubber-stamped by Lars.
768 Fix the build system for the Qt port.
770 Recent JavaScriptCore changes require the addition of JavaScriptCore/API to the
771 include search path. With a build process that combines JavaScriptCore and
772 WebCore in one build process/Makefile the existance of
773 JavaScriptCore/API/Node.h and WebCore/dom/Node.h causes include conflicts.
775 This commit solves this by introducing a separate build of JavaScriptCore into
778 As a result of the split-up a race-condition due to broken dependencies of
779 regular source files to header files of generated sources showed up very
780 frequently when doing parallel builds (which the buildbot does). This commit at
781 the same time tries to address the dependency problem by making the
782 addExtraCompiler() function also generate a pseudo extra compiler that
783 represents the header file output, so that qmake is aware of the creation of
784 the header file for dependency calculation.
786 At the same time I removed a lot of cruft from the pro files to ease maintenance.
788 * JavaScriptCore.pri:
789 * JavaScriptCore.pro: Added.
792 2008-07-24 Geoffrey Garen <ggaren@apple.com>
794 Reviewed by Maciej Stachowiak.
796 Fixed a strict aliasing violation, which caused hash tables with floating
797 point keys not to find items that were indeed in the tables
798 (intermittently, and only in release builds, of course).
800 SunSpider reports no change.
802 This bug doesn't seem to affect any existing code, but it causes obvious
803 crashes in some new code I'm working on.
805 * wtf/HashFunctions.h:
806 (WTF::FloatHash::hash): Use a union when punning between a float / double
807 and an unsigned (bucket of bits). With strict aliasing enabled, unions
808 are the only safe way to do this kind of type punning.
810 * wtf/HashTable.h: When rehashing, ASSERT that the item we just added to
811 the table is indeed in the table. In the buggy case described above, this
814 2008-07-24 Oliver Hunt <oliver@apple.com>
816 Reviewed by Alexey Proskuryakov.
818 Bug 20142: REGRESSION(r35245): /=/ weirdness
819 <https://bugs.webkit.org/show_bug.cgi?id=20142>
821 When adding all the meta data needed for exception error messages
822 I accidentally clobbered the handling of regex beginning with /=.
826 2008-07-23 Alp Toker <alp@nuanti.com>
828 Build fix after r35293: Add API/ to the include path.
832 2008-07-23 Adam Roben <aroben@apple.com>
836 Build fix after r35293:
838 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add API/
841 Build fix after r35305:
847 Completely compile out all sampler-related code when
848 SAMPLING_TOOL_ENABLED is 0. The sampler code can't be compiled 1) on
849 non-AllInOne configurations due to circular header dependencies, and
850 2) on platforms that don't have a usleep() function, such as Windows.
852 2008-07-23 Oliver Hunt <oliver@apple.com>
854 Reviewed by Geoff Garen and Sam Weinig.
856 Improve switch performance.
858 Improve switch performance by converting to a hashmap based jump
859 table to avoid the sequence of dispatches that would otherwise be
860 needed. This results in a 9-19x performance win for string switches
861 based on ad hoc testing, and a 6x improvement for integer switch
862 statements. SunSpider reports a 1.2% progression.
865 (KJS::CodeBlock::dump):
866 (KJS::SimpleJumpTable::offsetForValue):
868 * VM/CodeGenerator.cpp:
869 (KJS::CodeGenerator::beginSwitch):
870 (KJS::prepareJumpTableForImmediateSwitch):
871 (KJS::prepareJumpTableForCharacterSwitch):
872 (KJS::prepareJumpTableForStringSwitch):
873 (KJS::CodeGenerator::endSwitch):
874 * VM/CodeGenerator.h:
876 (KJS::offsetForStringSwitch):
877 (KJS::Machine::privateExecute):
884 (KJS::processClauseList):
885 (KJS::CaseBlockNode::tryOptimisedSwitch):
886 (KJS::CaseBlockNode::emitCodeForBlock):
890 2008-07-23 Gavin Barraclough <barraclough@apple.com>
892 Reviewed by Geoff Garen.
894 Sampling tool to analyze cost of instruction execution and identify hot regions of JS code.
895 Enable Switches by setting SAMPLING_TOOL_ENABLED in Opcode.h.
897 * JavaScriptCore.exp: Export symbols for Shell.cpp.
898 * VM/Machine.cpp: Added sampling hooks.
899 * VM/Machine.h: Machine contains a pointer to a sampler, when sampling.
900 * VM/Opcode.cpp: Tool implementation.
901 * VM/Opcode.h: Tool declaration.
902 * kjs/Shell.cpp: Initialize the sampler, if enabled.
903 * kjs/nodes.cpp: Added sampling hooks.
905 2008-07-23 Gabor Loki <loki@inf.u-szeged.hu>
907 Bug 20097: [Qt] 20% Sunspider slow-down
909 <https://bugs.webkit.org/show_bug.cgi?id=20097>
911 Reviewed by Simon Hausmann.
913 * kjs/jsc.pro: Added missing NDEBUG define for release builds.
915 2008-07-23 Alexey Proskuryakov <ap@webkit.org>
917 Reviewed by Geoff Garen.
919 JSClassRef is created context-free, but gets infatuated with the first context it sees.
921 The implicit API contract is that JSClassRef can be used with any context on any thread.
922 This no longer worked, because UStrings in the class were turned into per-context
923 identifiers, and the cached JSObject prototype was tied to JSGlobalData, too.
925 * API/JSClassRef.h: Made a separate struct for context-dependent parts of OpaqueJSClass.
926 * API/JSClassRef.cpp:
927 (OpaqueJSClass::OpaqueJSClass): Updated for renames and changed member variable order.
928 (OpaqueJSClass::~OpaqueJSClass): Assert that string members are not identifiers.
929 (clearReferenceToPrototype): Update for the new reference location.
930 (OpaqueJSClassContextData::OpaqueJSClassContextData): Make a deep copy of all strings.
931 (OpaqueJSClass::contextData): Added a function that finds the per-context part of
932 OpaqueJSClass in JSGlobalData, or creates it if not found.
933 (OpaqueJSClass::className): Always make a deep copy. Callers of this function do not have
934 a way to access JSGlobalData, so a per-context copy could not be made.
935 (OpaqueJSClass::staticValues): Updated for new data location.
936 (OpaqueJSClass::staticFunctions): Ditto.
937 (OpaqueJSClass::prototype): Changed to take an internal type for consistency.
939 * kjs/JSGlobalData.cpp:
940 (KJS::JSGlobalData::JSGlobalData):
941 (KJS::JSGlobalData::~JSGlobalData):
942 * kjs/JSGlobalData.h:
943 Keep a HashMap to access per-context JSClass data given a pointr to the shared part.
945 * API/JSCallbackObjectFunctions.h:
947 (KJS::::getOwnPropertySlot):
949 (KJS::::deleteProperty):
950 (KJS::::getPropertyNames):
951 (KJS::::staticValueGetter):
952 (KJS::::staticFunctionGetter):j
953 Use function accessors instead of accessing OpaqueJSClass members directly.
955 * API/JSContextRef.cpp: (JSGlobalContextCreate): Updated for the change in
956 OpaqueJSClass::prototype() argument type.
958 * API/JSObjectRef.cpp:
959 (JSObjectMake): Updated for the change in OpaqueJSClass::prototype() argument type.
960 (JSObjectMakeConstructor): Ditto.
962 2008-07-23 Alexey Proskuryakov <ap@webkit.org>
966 * kjs/ArgList.h: (KJS::ArgList::operator new): removed an extraneous "ArgList::" inside the
969 2008-07-22 Geoffrey Garen <ggaren@apple.com>
971 Reviewed by Oliver Hunt and Sam Weinig.
973 Next step toward putting doubles in registers: Prepare the Register class
974 and its clients for registers that don't contain JSValue*s.
976 This means a few things:
978 1. Register::jsValue() clients, including ArgList clients, must now supply
979 an ExecState* when accessing an entry in an ArgList, in case the entry
980 will need to create a JSValue* on the fly.
982 2. Register clients that definitely don't want to create a JSValue* on
983 the fly now use different APIs: getJSValue() for clients that know
984 the register contains a JSValue*, and v() for clients who just want a
987 3. I had to change some headers around in order to resolve dependency
988 problems created by using a Register in the ArgList header.
990 SunSpider reports no change.
992 2008-07-22 Gavin Barraclough <barraclough@apple.com>
994 Reviewed by Alexey Proskuryakov.
996 Prevent integer overflow when reallocating storage vector for arrays.
998 Sunspider reports 1.005x as fast (no change expected).
1002 2008-07-21 Mark Rowe <mrowe@apple.com>
1004 Reviewed by Sam Weinig.
1006 <rdar://problem/6091287> Revamp the handling of CFBundleShortVersionString to be fixed at the major component of the version number.
1008 * Configurations/Version.xcconfig:
1011 2008-07-21 Adam Roben <aroben@apple.com>
1015 This is a convenience wrapper around std::find.
1017 Reviewed by Anders Carlsson.
1021 2008-07-19 Oliver Hunt <oliver@apple.com>
1023 Reviewed by Cameron Zwarich.
1025 Bug 20104: Exception in tables/mozilla_expected_failures/bugs/bug92868_1.html includes the equals operator in the quoted expression
1026 <https://bugs.webkit.org/show_bug.cgi?id=20104>
1028 To make this correct we make the dot and bracket assign nodes emit the information to indicate
1029 the failure range is the dot/bracket accessor.
1033 2008-07-18 Steve Falkenburg <sfalken@apple.com>
1037 * kjs/JSGlobalObjectFunctions.cpp:
1038 (KJS::isStrWhiteSpace):
1040 2008-07-18 Steve Falkenburg <sfalken@apple.com>
1045 (KJS::ThrowableExpressionData::ThrowableExpressionData):
1047 2008-07-18 Oliver Hunt <oliver@apple.com>
1049 Reviewed by Cameron Zwarich.
1051 Bug 18774: SQUIRRELFISH: print meaningful error messages <https://bugs.webkit.org/show_bug.cgi?id=18774>
1052 <rdar://problem/5769353> SQUIRRELFISH: JavaScript error messages are missing informative text
1054 Add support for decent error messages in JavaScript. This patch achieves this by providing
1055 ensuring the common errors and exceptions have messages that provide the text of expression
1056 that trigger the exception. In addition it attaches a number of properties to the exception
1057 object detailing where in the source the expression came from.
1059 * JavaScriptCore.exp:
1061 (KJS::CodeBlock::lineNumberForVPC):
1062 (KJS::CodeBlock::expressionRangeForVPC):
1063 Function to recover the expression range for an instruction
1064 that triggered an exception.
1066 (KJS::ExpressionRangeInfo::):
1067 (KJS::CodeBlock::CodeBlock):
1068 * VM/CodeGenerator.cpp:
1069 (KJS::CodeGenerator::emitCall):
1070 (KJS::CodeGenerator::emitCallEval):
1071 Emit call needed to be modified so to place the expression range info internally,
1072 as the CodeGenerator emits the arguments nodes itself, rather than the various call
1074 * VM/CodeGenerator.h:
1075 (KJS::CodeGenerator::emitExpressionInfo):
1076 Record the expression range info.
1077 * VM/ExceptionHelpers.cpp:
1078 (KJS::createErrorMessage):
1079 (KJS::createInvalidParamError):
1080 (KJS::createUndefinedVariableError):
1081 (KJS::createNotAConstructorError):
1082 (KJS::createNotAFunctionError):
1083 (KJS::createNotAnObjectErrorStub):
1084 (KJS::createNotAnObjectError):
1085 Rewrite all the code for the error messages so that they make use of the newly available
1087 * VM/ExceptionHelpers.h:
1089 (KJS::isNotObject): Now needs vPC and codeBlock
1090 (KJS::Machine::throwException):
1091 New logic to handle the NotAnObjectErrorStub and to handle the absurd "no default value" edge case
1092 (KJS::Machine::privateExecute):
1094 * kjs/DebuggerCallFrame.cpp:
1095 (KJS::DebuggerCallFrame::evaluate):
1097 (KJS::Error::create):
1099 * kjs/JSGlobalObjectFunctions.cpp:
1100 * kjs/JSImmediate.cpp:
1101 (KJS::JSImmediate::toObject):
1102 (KJS::JSImmediate::prototype):
1103 My changes to the JSNotAnObject constructor needed to be handled here.
1104 * kjs/JSNotAnObject.h:
1105 (KJS::JSNotAnObjectErrorStub::JSNotAnObjectErrorStub):
1106 (KJS::JSNotAnObjectErrorStub::isNull):
1107 (KJS::JSNotAnObjectErrorStub::isNotAnObjectErrorStub):
1108 Added a JSNotAnObjectErrorStub class to ease the handling of toObject failure exceptions,
1109 and potentially allow even more detailed error messages in future.
1112 (KJS::Parser::parse):
1113 * kjs/SourceRange.h:
1115 Large amounts of position propagation.
1117 (KJS::Lexer::Lexer):
1118 (KJS::Lexer::shift):
1120 The lexer needed a few changes to be able to correctly track token character positions.
1123 (KJS::ThrowableExpressionData::emitThrowError):
1124 (KJS::StatementNode::StatementNode):
1125 (KJS::ResolveNode::emitCode):
1126 (KJS::BracketAccessorNode::emitCode):
1127 (KJS::DotAccessorNode::emitCode):
1128 (KJS::NewExprNode::emitCode):
1129 (KJS::EvalFunctionCallNode::emitCode):
1130 (KJS::FunctionCallValueNode::emitCode):
1131 (KJS::FunctionCallResolveNode::emitCode):
1132 (KJS::FunctionCallBracketNode::emitCode):
1133 (KJS::FunctionCallDotNode::emitCode):
1134 (KJS::PostfixResolveNode::emitCode):
1135 (KJS::PostfixBracketNode::emitCode):
1136 (KJS::PostfixDotNode::emitCode):
1137 (KJS::DeleteResolveNode::emitCode):
1138 (KJS::DeleteBracketNode::emitCode):
1139 (KJS::DeleteDotNode::emitCode):
1140 (KJS::PrefixResolveNode::emitCode):
1141 (KJS::PrefixBracketNode::emitCode):
1142 (KJS::PrefixDotNode::emitCode):
1143 (KJS::ThrowableBinaryOpNode::emitCode):
1144 (KJS::ReadModifyResolveNode::emitCode):
1145 (KJS::AssignResolveNode::emitCode):
1146 (KJS::AssignDotNode::emitCode):
1147 (KJS::ReadModifyDotNode::emitCode):
1148 (KJS::AssignBracketNode::emitCode):
1149 (KJS::ReadModifyBracketNode::emitCode):
1150 (KJS::ForInNode::ForInNode):
1151 (KJS::ForInNode::emitCode):
1152 (KJS::WithNode::emitCode):
1153 (KJS::LabelNode::emitCode):
1154 (KJS::ThrowNode::emitCode):
1155 (KJS::ProgramNode::ProgramNode):
1156 (KJS::ProgramNode::create):
1157 (KJS::EvalNode::generateCode):
1158 (KJS::FunctionBodyNode::create):
1159 (KJS::FunctionBodyNode::generateCode):
1160 (KJS::ProgramNode::generateCode):
1161 All of these methods were handling the position information.
1162 Constructors and create methods were modified to store the information.
1163 All the emitCall implementations listed needed to be updated to actually
1164 record the position information we have so carefully collected.
1166 (KJS::ThrowableExpressionData::ThrowableExpressionData):
1167 (KJS::ThrowableExpressionData::setExceptionSourceRange):
1168 (KJS::ThrowableExpressionData::divot):
1169 (KJS::ThrowableExpressionData::startOffset):
1170 (KJS::ThrowableExpressionData::endOffset):
1171 (KJS::ThrowableSubExpressionData::ThrowableSubExpressionData):
1172 (KJS::ThrowableSubExpressionData::setSubexpressionInfo):
1173 (KJS::ThrowablePrefixedSubExpressionData::ThrowablePrefixedSubExpressionData):
1174 (KJS::ThrowablePrefixedSubExpressionData::setSubexpressionInfo):
1175 ThrowableExpressionData is just a uniform mechanism for storing the position
1177 (KJS::ResolveNode::):
1178 (KJS::PrePostResolveNode::):
1179 (KJS::ThrowableBinaryOpNode::):
1182 2008-07-18 Geoffrey Garen <ggaren@apple.com>
1184 Reviewed by Cameron Zwarich.
1188 "CallTypeNative" => "CallTypeHost"
1189 "code" => "byteCode"
1190 "generatedCode" => "generatedByteCode"
1192 2008-07-18 Geoffrey Garen <ggaren@apple.com>
1194 Reviewed by Oliver Hunt.
1196 Optimized <= for immediate number cases.
1198 SunSpider reports no overall change, but a 10% speedup on access-nsieve.
1200 2008-07-18 Mark Rowe <mrowe@apple.com>
1202 Rubber-stamped by Sam Weinig.
1204 Fix some casts added in a previous build fix to match the style used
1208 (KJS::Machine::initializeCallFrame):
1210 (KJS::Register::Register):
1212 2008-07-18 Landry Breuil <landry@openbsd.org>
1214 Bug 19975: [OpenBSD] Patches to enable build of WebKit
1216 <https://bugs.webkit.org/show_bug.cgi?id=19975>
1218 Reviewed by David Kilzer.
1220 Support for OpenBSD, mostly threading and libm tweaks.
1222 * kjs/collector.cpp: #include <pthread.h>
1223 (KJS::currentThreadStackBase): use pthread_stackseg_np() to get stack base
1224 * kjs/config.h: OpenBSD also provides <pthread_np.h>
1225 * wtf/MathExtras.h: #include <sys/types.h> and <machine/ieee.h>
1226 (isfinite), (signbit): as long as we don't have those functions provide fallback implementations
1227 * wtf/Platform.h: Add support for PLATFORM(OPENBSD) and PLATFORM(SPARC64) macro
1229 2008-07-17 Geoffrey Garen <ggaren@apple.com>
1231 Reviewed by Oliver Hunt.
1233 Next step toward putting doubles in registers: Store constant pool
1234 entries as registers, not JSValue*s.
1236 SunSpider reports no change.
1238 2008-07-17 Geoffrey Garen <ggaren@apple.com>
1240 Reviewed by John Sullivan and Oliver Hunt.
1242 A tiny bit of tidying in function call register allocation.
1244 This patch saves one register when invoking a function expression and/or
1245 a new expression that is stored in a temporary.
1247 Since it's just one register, I can't make a testcase for it.
1249 * VM/CodeGenerator.cpp:
1250 (KJS::CodeGenerator::emitCall): No need to ref the function we're calling
1251 or its base. We'd like the call frame to overlap with them, if possible.
1252 op_call will read the function and its base before writing the call frame,
1256 (KJS::NewExprNode::emitCode): No need to ref the function we're new-ing,
1257 for the same reasons stated above.
1259 (KJS::FunctionCallValueNode::emitCode): ditto
1261 2008-07-17 Steve Falkenburg <sfalken@apple.com>
1265 * kjs/InternalFunction.cpp:
1267 2008-07-17 Sam Weinig <sam@webkit.org>
1269 Roll out r35199 as it is causing failures on the PPC build.
1271 2008-07-17 Geoffrey Garen <ggaren@apple.com>
1273 Reviewed by David Kilzer.
1275 Fixed https://bugs.webkit.org/show_bug.cgi?id=20067
1276 Support function.name (Firefox extension)
1278 Pretty straight-forward.
1280 2008-07-17 Geoffrey Garen <ggaren@apple.com>
1282 Reviewed by Oliver Hunt.
1284 Fixed <rdar://problem/6081636> Functions calls use more temporary
1285 registers than necessary
1287 Holding a reference to the last statement result register caused each
1288 successive statement to output its result to an even higher register.
1290 Happily, statements don't actually need to return a result register
1291 at all. I hope to make this clearer in a future cleanup patch,
1292 but this change will fix the major bug for now.
1295 (KJS::statementListEmitCode):
1297 2008-07-17 Gavin Barraclough <barraclough@apple.com>
1299 Reviewed by Sam Weinig.
1301 Merge pre&post dot nodes to simplify the parse tree.
1302 Sunspider results show 0.6% progression (no performance change expected).
1307 * kjs/nodes2string.cpp:
1309 2008-07-17 Gavin Barraclough <barraclough@apple.com>
1311 Reviewed by Cameron Zwarich.
1313 Merge pre&post resolve nodes to simplify the parse tree.
1314 Sunspider results show no performance change.
1319 * kjs/nodes2string.cpp:
1321 2008-07-17 Gavin Barraclough <barraclough@apple.com>
1323 Reviewed by Cameron Zwarich.
1325 Merge logical nodes to simplify the parse tree.
1326 Sunspider results show 0.6% progression (no performance change expected).
1331 * kjs/nodes2string.cpp:
1333 2008-07-17 Ariya Hidayat <ariya.hidayat@trolltech.com>
1337 Fix MinGW build (broken in r35198) and simplify getLocalTime().
1340 (KJS::getLocalTime):
1342 2008-07-17 Gavin Barraclough <barraclough@apple.com>
1344 Reviewed by Sam Weinig.
1346 Merge pre&post bracket nodes to simplify the parse tree.
1347 Sunspider results show no performance change.
1352 * kjs/nodes2string.cpp:
1354 2008-07-17 Ariya Hidayat <ariya.hidayat@trolltech.com>
1358 Fix the 32-bit gcc builds, conversion from "long int" to Register is
1359 ambiguous. Explicitly choose the intptr_t constructor.
1362 (KJS::Machine::initializeCallFrame):
1364 (KJS::Register::Register):
1366 2008-07-16 Mark Rowe <mrowe@apple.com>
1368 Rubber-stamped by Geoff Garen.
1370 Fix JavaScript in 64-bit by using a pointer-sized integer
1371 type in the Register union. Also includes a rename of
1372 the intType constant to IntType.
1375 (KJS::Machine::initializeCallFrame):
1378 (KJS::Register::Register):
1380 2008-07-17 Geoffrey Garen <ggaren@apple.com>
1382 Reviewed by Oliver Hunt.
1384 First step toward putting doubles in registers: Turned Register into a
1385 proper abstraction layer. It is no longer possible to cast a Register
1386 to a JSValue*, or a Register& to a JSValue*&, or to access the union
1387 inside a Register directly.
1389 SunSpider reports no change.
1391 In support of this change, I had to make the following mechanical changes
1394 1. Clients now use explicit accessors to read data out of Registers, and
1395 implicit copy constructors to write data into registers.
1397 So, assignment that used to look like
1405 And access that used to look like
1413 2. I made generic flow control specific in opcodes that made their flow
1414 control generic by treating a Register& as a JSValue*&. This had the
1415 added benefit of removing some exception checking branches from immediate
1418 3. I beefed up PropertySlot to support storing a Register* in a property
1419 slot. For now, only JSVariableObject's symbolTableGet and symbolTablePut
1420 use this functionality, but I expect more clients to use it in the future.
1422 4. I changed ArgList to be a buffer of Registers, not JSValue*'s, and I
1423 changed ArgList iterator clients to iterate Registers, not JSValue*'s.
1425 2008-07-16 Ada Chan <adachan@apple.com>
1429 * kjs/JSGlobalObject.cpp:
1431 2008-07-16 Kevin McCullough <kmccullough@apple.com>
1433 Reviewed by Sam and Geoff.
1435 <rdar://problem/5958840> Navigating to another page while profiler is
1436 attached results in slow JavaScript for all time.
1438 - The UNLIKELY keeps this from being a sunspider performance regression.
1440 * kjs/JSGlobalObject.cpp:
1441 (KJS::JSGlobalObject::~JSGlobalObject): Stop the profiler associated
1442 with this exec state.
1444 2008-07-16 Sam Weinig <sam@webkit.org>
1446 Reviewed by Steve Falkenburg.
1448 Replace adopting UString constructor in favor of explicit
1449 static adopt method.
1451 * API/JSStringRefCF.cpp:
1452 (JSStringCreateWithCFString):
1453 * kjs/StringConstructor.cpp:
1454 (KJS::stringFromCharCode):
1455 * kjs/StringPrototype.cpp:
1456 (KJS::stringProtoFuncToLowerCase):
1457 (KJS::stringProtoFuncToUpperCase):
1458 (KJS::stringProtoFuncToLocaleLowerCase):
1459 (KJS::stringProtoFuncToLocaleUpperCase):
1461 (KJS::UString::adopt):
1463 (KJS::UString::UString):
1464 (KJS::UString::~UString):
1466 2008-07-16 Ariya Hidayat <ariya.hidayat@trolltech.com>
1470 http://trolltech.com/developer/task-tracker/index_html?method=entry&id=216179
1471 Fix potential crash (on Qt for Windows port) when performing JavaScript date
1475 (KJS::getLocalTime): For the Qt port, prefer to use Windows code, i.e.
1476 localtime_s() instead of localtime() since the latter might crash (on Windows)
1477 given a non-sensible, e.g. NaN, argument.
1479 2008-07-16 Alexey Proskuryakov <ap@webkit.org>
1481 Reviewed by Anders and Geoff.
1483 https://bugs.webkit.org/show_bug.cgi?id=20023
1484 Failed assertion in PropertyNameArray.cpp
1486 This is already tested by testapi.
1488 * API/JSObjectRef.cpp: (JSPropertyNameAccumulatorAddName): Add the string to identifier
1489 table to appease PropertyNameArray.
1491 2008-07-16 Alexey Proskuryakov <ap@webkit.org>
1495 Dereference identifiers when deleting a hash table (fixes leaks with private JSGlobalData
1498 * kjs/JSGlobalData.cpp: (KJS::JSGlobalData::~JSGlobalData):
1499 * kjs/lookup.cpp: (KJS::HashTable::deleteTable):
1501 * kjs/lexer.cpp: (KJS::Lexer::~Lexer)
1502 HashTable cannot have a destructor, because check-for-global-initializers complains about
1503 having a global constructor then.
1505 2008-07-16 Alexey Proskuryakov <ap@webkit.org>
1509 Check pthread_key_create return value.
1511 This check was helpful when debugging a crash in run-webkit-tests --threaded that happened
1512 because JSGlobalData objects were not deleted, and we were running out of pthread keys soon.
1513 It also looks useful for production builds.
1515 * wtf/ThreadSpecific.h: (WTF::::ThreadSpecific):
1517 2008-07-15 Kevin McCullough <kmccullough@apple.com>
1521 Rename pageGroupIdentifier to profileGroup to keep mention of a
1522 pageGroup out of JavaScriptCore.
1524 * kjs/JSGlobalObject.cpp:
1525 (KJS::JSGlobalObject::init):
1526 * kjs/JSGlobalObject.h:
1527 (KJS::JSGlobalObject::setProfileGroup):
1528 (KJS::JSGlobalObject::profileGroup):
1529 * profiler/ProfileGenerator.cpp:
1530 (KJS::ProfileGenerator::create):
1531 (KJS::ProfileGenerator::ProfileGenerator):
1532 * profiler/ProfileGenerator.h:
1533 (KJS::ProfileGenerator::profileGroup):
1534 * profiler/Profiler.cpp:
1535 (KJS::Profiler::startProfiling):
1536 (KJS::dispatchFunctionToProfiles):
1537 (KJS::Profiler::willExecute):
1538 (KJS::Profiler::didExecute):
1540 2008-07-14 Mark Rowe <mrowe@apple.com>
1542 Reviewed by Sam Weinig.
1544 Fix https://bugs.webkit.org/show_bug.cgi?id=20037
1545 Bug 20037: GCC 4.2 build broken due to strict aliasing violation.
1548 (KJS::UString::Rep::computeHash): Add a version of computeHash that takes a char* and explicit length.
1550 * profiler/CallIdentifier.h:
1551 (WTF::): Use new version of computeHash that takes a char* and explicit length to avoid unsafe aliasing.
1553 2008-07-14 David Hyatt <hyatt@apple.com>
1555 Fix a crashing bug in ListHashSet's -- operator. Make sure that end() can be -- by special-casing the null
1560 * wtf/ListHashSet.h:
1561 (WTF::ListHashSetConstIterator::operator--):
1563 2008-07-14 David Hyatt <hyatt@apple.com>
1565 Buidl fix. Make sure the second insertBefore method returns a value.
1567 * wtf/ListHashSet.h:
1568 (WTF::::insertBefore):
1570 2008-07-14 Adam Roben <aroben@apple.com>
1574 * JavaScriptCore.vcproj/jsc/jsc.vcproj: Added include/pthreads to the
1577 2008-07-14 Alexey Proskuryakov <ap@webkit.org>
1579 Reviewed by Kevin McCullough.
1581 Make JSGlobalData refcounted in preparation to adding a way to create contexts that share
1584 * JavaScriptCore.exp:
1585 * kjs/JSGlobalData.cpp:
1586 (KJS::JSGlobalData::create):
1587 * kjs/JSGlobalData.h:
1588 Made contructor private, and added a static create() method. Made the class inherit from
1591 * kjs/JSGlobalObject.h:
1592 (KJS::JSGlobalObject::globalData):
1593 JSGlobalData is now owned by JSGlobalObject (except for the shared one, and the common
1594 WebCore one, which are never deleted).
1596 * kjs/Shell.cpp: (main): Create JSGlobalData with create() method.
1598 2008-07-14 Simon Hausmann <hausmann@webkit.org>
1600 Fix the single-threaded build.
1602 * kjs/JSLock.cpp: Removed undeclared registerThread() function.
1603 * kjs/collector.cpp:
1604 (KJS::Heap::registerThread): Added dummy implementation.
1606 2008-07-14 Alexey Proskuryakov <ap@webkit.org>
1608 Reviewed by Geoff Garen.
1610 Eliminate per-thread JavaScript global data instance support and make arbitrary
1611 global data/global object combinations possible.
1613 * kjs/collector.cpp:
1614 (KJS::Heap::Heap): Store a JSGlobalData pointer instead of multiple pointers to its members.
1615 This allows for going from any JS object to its associated global data, currently used in
1616 JSGlobalObject constructor to initialize its JSGlobalData pointer.
1617 (KJS::Heap::registerThread): Changed thread registration data to be per-heap. Previously,
1618 only the shared heap could be used from multiple threads, so it was the only one that needed
1619 thread registration, but now this can happen to any heap.
1620 (KJS::Heap::unregisterThread): Ditto.
1621 (KJS::Heap::markStackObjectsConservatively): Adapt for the above changes.
1622 (KJS::Heap::setGCProtectNeedsLocking): Ditto.
1623 (KJS::Heap::protect): Ditto.
1624 (KJS::Heap::unprotect): Ditto.
1625 (KJS::Heap::collect): Ditto.
1626 (KJS::Heap::globalObjectCount): Use global object list associated with the current heap,
1627 not the late per-thread one.
1628 (KJS::Heap::protectedGlobalObjectCount): Ditto.
1631 (KJS::Heap::ThreadRegistrar): Added a helper object that unregisters a thread when it is
1635 (KJS::JSLock::JSLock):
1637 (KJS::JSLock::JSLock):
1638 Don't use JSLock to implicitly register threads. I've added registerThread() calls to most
1639 places that use JSLock - we cannot guarantee absolute safety unless we always mark all
1640 threads in the process, but these implicit registration calls should cover reasonable usage
1644 (JSEvaluateScript): Explicitly register the current thread.
1645 (JSCheckScriptSyntax): Explicitly register the current thread.
1646 (JSGarbageCollect): Changed to use the passed in context. Unfortunately, this creates a race
1647 condition for clients that pass an already released context to JSGarbageCollect - but it is
1648 unlikely to create real life problems.
1649 To maintain compatibility, the shared heap is collected if NULL is passed.
1651 * API/JSContextRef.cpp:
1652 (JSGlobalContextCreate): Use a new syntax for JSGlobalObject allocation.
1653 (JSGlobalContextRetain): Register the thread.
1654 (JSContextGetGlobalObject): Register the thread.
1656 * API/JSObjectRef.cpp:
1658 (JSObjectMakeFunctionWithCallback):
1659 (JSObjectMakeConstructor):
1660 (JSObjectMakeFunction):
1661 (JSObjectHasProperty):
1662 (JSObjectGetProperty):
1663 (JSObjectSetProperty):
1664 (JSObjectGetPropertyAtIndex):
1665 (JSObjectSetPropertyAtIndex):
1666 (JSObjectDeleteProperty):
1667 (JSObjectCallAsFunction):
1668 (JSObjectCallAsConstructor):
1669 (JSObjectCopyPropertyNames):
1670 (JSPropertyNameAccumulatorAddName):
1671 * API/JSValueRef.cpp:
1673 (JSValueIsInstanceOfConstructor):
1674 (JSValueMakeNumber):
1675 (JSValueMakeString):
1677 (JSValueToStringCopy):
1681 Register the thread.
1683 * API/JSStringRef.cpp: (JSStringRelease): Changed a comment to not mention per-thread contexts.
1685 * API/JSStringRefCF.cpp: Removed an unnecessary include of JSLock.h.
1687 * JavaScriptCore.exp: Export JSGlobalData constructor/destructor, now that anyone can have
1688 their own instances. Adapt to other changes, too.
1690 * JavaScriptCore.xcodeproj/project.pbxproj: Made ThreadSpecific.h private, as it is now
1691 included by collector.h and is thus needed in other projects.
1693 * kjs/InitializeThreading.cpp: (KJS::initializeThreadingOnce): Don't initialize per-thread
1694 global data, as it no longer exists.
1696 * kjs/JSGlobalData.cpp:
1697 (KJS::JSGlobalData::JSGlobalData):
1698 (KJS::JSGlobalData::~JSGlobalData):
1699 * kjs/JSGlobalData.h:
1700 Removed support for per-thread instance. Made constructor and destructor public.
1702 * kjs/JSGlobalObject.cpp: (KJS::JSGlobalObject::init): Get to now arbitrary JSGlobalData
1704 (KJS::JSGlobalObject::operator new): Changed ot take JSGlobalDatra pointer.
1705 * kjs/JSGlobalObject.h:
1710 Changed to maintain a custom JSGlobalData pointer instead of a per-thread one.
1712 2008-07-13 Ada Chan <adachan@apple.com>
1714 Windows build fix: Add wtf/RefCountedLeakCounter to the project.
1716 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
1718 2008-07-12 Jan Michael Alonzo <jmalonzo@webkit.org>
1720 Gtk, Qt and Wx build fix: Add wtf/RefCountedLeakCounter in the
1724 * JavaScriptCore.pri:
1725 * JavaScriptCoreSources.bkl:
1727 2008-07-11 Stephanie Lewis <slewis@apple.com>
1729 Reviewed by Darin Adler and Oliver Hunt.
1731 Refactor RefCounting Leak counting code into a common class.
1733 In order to export the symbols I needed to put the debug defines inside the function names
1735 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.
1737 * JavaScriptCore.exp:
1738 * JavaScriptCore.xcodeproj/project.pbxproj: add new class
1739 * kjs/nodes.cpp: remove old leak counting code
1740 * wtf/RefCountedLeakCounter.cpp: Added. create a common leak counting class
1741 * wtf/RefCountedLeakCounter.h: Added.
1743 2008-07-11 David Hyatt <hyatt@apple.com>
1745 Add an insertBefore method to ListHashSet to allow for insertions in the middle of the list (rather than just
1750 * wtf/ListHashSet.h:
1751 (WTF::::insertBefore):
1752 (WTF::::insertNodeBefore):
1754 2008-07-11 Sam Weinig <sam@webkit.org>
1756 Rubber-stamped by Darin Adler.
1758 Move call function to CallData.cpp and construct to ConstructData.cpp.
1761 * JavaScriptCore.pri:
1762 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1763 * JavaScriptCore.xcodeproj/project.pbxproj:
1764 * JavaScriptCoreSources.bkl:
1765 * kjs/AllInOneFile.cpp:
1766 * kjs/CallData.cpp: Copied from kjs/JSValue.cpp.
1767 * kjs/ConstructData.cpp: Copied from kjs/JSValue.cpp.
1770 2008-07-10 Mark Rowe <mrowe@apple.com>
1772 Reviewed by Sam Weinig.
1774 Define WEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST when building WebKit to ensure that no symbols end up with the weak_import attribute.
1776 * Configurations/Base.xcconfig:
1778 2008-07-10 Mark Rowe <mrowe@apple.com>
1780 Reviewed by Sam Weinig.
1782 Fix the Tiger build by omitting annotations from methods declared in categories when using old versions of GCC.
1784 * API/WebKitAvailability.h:
1786 2008-07-10 Kevin McCullough <kmccullough@apple.com>
1790 -Minor cleanup. Renamed callTree() to head() and no longer use m_head
1791 directly but instead keep it private and access via a method().
1793 * profiler/HeavyProfile.cpp:
1794 (KJS::HeavyProfile::HeavyProfile):
1795 (KJS::HeavyProfile::generateHeavyStructure):
1796 (KJS::HeavyProfile::addNode):
1797 * profiler/Profile.h:
1798 (KJS::Profile::head):
1799 * profiler/ProfileGenerator.cpp:
1800 (KJS::ProfileGenerator::ProfileGenerator):
1802 2008-07-10 Alexey Proskuryakov <ap@webkit.org>
1804 Reviewed by Mark Rowe.
1806 Eliminate CollectorHeapIntrospector.
1808 CollectorHeapIntrospector was added primarily in the hopes to improve leaks tool output,
1809 a result that it didn't deliver. Also, it helped by labeling JSC heap regions as reported by
1810 vmmap tool, but at the same time, it made them mislabeled as malloc'd ones - the correct
1811 way to label mapped regions is to use a VM tag.
1813 So, it makes more sense to remove it completely than to make it work with multiple heaps.
1815 * JavaScriptCore.exp:
1816 * JavaScriptCore.xcodeproj/project.pbxproj:
1817 * kjs/AllInOneFile.cpp:
1818 * kjs/InitializeThreading.cpp:
1819 (KJS::initializeThreading):
1820 * kjs/collector.cpp:
1822 * kjs/CollectorHeapIntrospector.cpp: Removed.
1823 * kjs/CollectorHeapIntrospector.h: Removed.
1825 2008-07-09 Kevin McCullough <kmccullough@apple.com>
1829 <rdar://problem/5951532> JSProfiler: Implement heavy (or bottom-up)
1831 - Implemented the time and call count portionof heavy. Now all that we
1834 * profiler/CallIdentifier.h: Removed an unused constructor.
1835 * profiler/HeavyProfile.cpp:
1836 (KJS::HeavyProfile::HeavyProfile): Set the initial time of the head
1837 node so that percentages work correctly.
1838 (KJS::HeavyProfile::mergeProfiles): Sum the times and call count of
1840 * profiler/ProfileNode.cpp: Set the intital values of time and call
1841 count when copying ProfileNodes.
1842 (KJS::ProfileNode::ProfileNode):
1844 2008-07-10 Jan Michael Alonzo <jmalonzo@webkit.org>
1848 * GNUmakefile.am: Add HeavyProfile.cpp
1850 2008-07-09 Mark Rowe <mrowe@apple.com>
1852 Reviewed by Geoff Garen.
1854 Don't warn about deprecated functions in production builds.
1856 * Configurations/Base.xcconfig:
1857 * Configurations/DebugRelease.xcconfig:
1859 2008-07-09 Darin Adler <darin@apple.com>
1861 * JavaScriptCore.pri: Fix Qt build by adding HeavyProfile.cpp.
1863 2008-07-09 Kevin Ollivier <kevino@theolliviers.com>
1865 wx biuld fix. Add HeavyProfile.cpp to build files.
1867 * JavaScriptCoreSources.bkl:
1869 2008-07-09 Kevin McCullough <kmccullough@apple.com>
1871 - Windows build fix.
1873 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1875 2008-07-09 Kevin McCullough <kmccullough@apple.com>
1879 * profiler/HeavyProfile.cpp:
1880 (KJS::HeavyProfile::mergeProfiles):
1882 2008-07-09 Kevin McCullough <kmccullough@apple.com>
1884 Reviewed by Geoff and Adam.
1886 <rdar://problem/5951532> JSProfiler: Implement Bottom-Up view (19228)
1887 - This is the plumbing for bottom-up, but does not include calculating
1888 time, mostly because I'm still undclear about what the end result should
1890 - This, obviously, does not include the UI to expose this in the
1893 * JavaScriptCore.xcodeproj/project.pbxproj:
1894 * profiler/CallIdentifier.h:
1895 (KJS::CallIdentifier::CallIdentifier):
1896 (WTF::): Added HashTraits for CallIdentifiers to be used by a HashMap.
1897 * profiler/HeavyProfile.cpp: Added.
1898 (KJS::HeavyProfile::HeavyProfile):
1899 (KJS::HeavyProfile::generateHeavyStructure):
1900 (KJS::HeavyProfile::addNode):
1901 (KJS::HeavyProfile::mergeProfiles):
1902 (KJS::HeavyProfile::addAncestorsAsChildren):
1903 * profiler/HeavyProfile.h: Added.
1904 (KJS::HeavyProfile::create):
1905 (KJS::HeavyProfile::heavyProfile):
1906 (KJS::HeavyProfile::treeProfile):
1907 * profiler/Profile.cpp: Removed old commented out includes.
1908 * profiler/Profile.h: The m_head is needed by the HeavyProfile so it
1909 is now protected as opposed to private.
1910 * profiler/ProfileNode.cpp:
1911 (KJS::ProfileNode::ProfileNode): Created a constructor to copy
1913 (KJS::ProfileNode::findChild): Added a null check to make HeavyProfile
1914 children finding easier and avoid a potential crasher.
1915 * profiler/ProfileNode.h: Mostly moved things around but also added some
1916 functionality needed by HeavyProfile.
1917 (KJS::ProfileNode::create):
1918 (KJS::ProfileNode::functionName):
1919 (KJS::ProfileNode::url):
1920 (KJS::ProfileNode::lineNumber):
1921 (KJS::ProfileNode::head):
1922 (KJS::ProfileNode::setHead):
1923 (KJS::ProfileNode::setNextSibling):
1924 (KJS::ProfileNode::actualTotalTime):
1925 (KJS::ProfileNode::actualSelfTime):
1926 * profiler/TreeProfile.cpp: Implemented the ability to get a
1928 (KJS::TreeProfile::heavyProfile):
1929 * profiler/TreeProfile.h:
1931 2008-07-08 Geoffrey Garen <ggaren@apple.com>
1933 Reviewed by Oliver Hunt.
1935 Added support for checking if an object has custom properties in its
1936 property map. WebCore uses this to optimize marking DOM wrappers.
1938 2008-07-08 Simon Hausmann <hausmann@webkit.org>
1940 Prospective Gtk/Wx build fixes, add ProfileGenerator.cpp to the build.
1943 * JavaScriptCoreSources.bkl:
1945 2008-07-08 Simon Hausmann <hausmann@webkit.org>
1947 Fix the Qt build, add ProfileGenerator.cpp to the build.
1949 * JavaScriptCore.pri:
1951 2008-07-07 David Kilzer <ddkilzer@apple.com>
1953 releaseFastMallocFreeMemory() should always be defined
1957 * JavaScriptCore.exp: Changed to export C++ binding for
1958 WTF::releaseFastMallocFreeMemory() instead of C binding for
1959 releaseFastMallocFreeMemory().
1960 * wtf/FastMalloc.cpp: Moved definitions of
1961 releaseFastMallocFreeMemory() to be in the WTF namespace
1962 regardless whether FORCE_SYSTEM_MALLOC is defined.
1963 * wtf/FastMalloc.h: Moved releaseFastMallocFreeMemory() from
1964 extern "C" binding to WTF::releaseFastMallocFreeMemory().
1966 2008-07-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1970 Bug 19926: URL causes crash within a minute
1971 <https://bugs.webkit.org/show_bug.cgi?id=19926>
1973 Add a check that lastGlobalObject is non-null in Machine::execute()
1974 before copying its globals to the current register file.
1976 In theory, it is possible to make a test case for this, but it will
1977 take a while to get it right.
1980 (KJS::Machine::execute):
1982 2008-07-07 Darin Adler <darin@apple.com>
1984 Rubber stamped by Adele.
1987 (KJS::Machine::privateExecute): Fix a typo in a comment.
1989 2008-07-07 Steve Falkenburg <sfalken@apple.com>
1993 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1994 * JavaScriptCore.vcproj/testapi/testapi.vcproj:
1996 2008-07-07 Kevin McCullough <kmccullough@apple.com>
2000 When the profiler is running it gathers information and creates a
2001 Profile. After it finishes the Profile can be sorted and have other
2002 data refinements run over it. Both of these were done in the same class
2003 before. Now I split the gathering operations into a new class called
2006 * JavaScriptCore.xcodeproj/project.pbxproj:
2007 * profiler/Profile.cpp: Removed code related to the gather stage of a
2009 (KJS::Profile::create):
2010 (KJS::Profile::Profile):
2011 * profiler/Profile.h: Ditto.
2012 (KJS::Profile::title):
2013 (KJS::Profile::callTree):
2014 (KJS::Profile::setHead):
2015 * profiler/ProfileGenerator.cpp: Added. This is the class that will
2016 handle the stage of creating a Profile. Once the Profile is finished
2017 being created, this class goes away.
2018 (KJS::ProfileGenerator::create):
2019 (KJS::ProfileGenerator::ProfileGenerator):
2020 (KJS::ProfileGenerator::title):
2021 (KJS::ProfileGenerator::willExecute):
2022 (KJS::ProfileGenerator::didExecute):
2023 (KJS::ProfileGenerator::stopProfiling):
2024 (KJS::ProfileGenerator::didFinishAllExecution):
2025 (KJS::ProfileGenerator::removeProfileStart):
2026 (KJS::ProfileGenerator::removeProfileEnd):
2027 * profiler/ProfileGenerator.h: Added.
2028 (KJS::ProfileGenerator::profile):
2029 (KJS::ProfileGenerator::originatingGlobalExec):
2030 (KJS::ProfileGenerator::pageGroupIdentifier):
2031 (KJS::ProfileGenerator::client):
2032 (KJS::ProfileGenerator::stoppedProfiling):
2033 * profiler/Profiler.cpp: Now operates with the ProfileGenerator instead
2035 (KJS::Profiler::startProfiling):
2036 (KJS::Profiler::stopProfiling):
2037 (KJS::Profiler::didFinishAllExecution): It is here that the Profile is
2038 handed off to its client and the Profile Generator is no longer needed.
2039 (KJS::dispatchFunctionToProfiles):
2040 (KJS::Profiler::willExecute):
2041 (KJS::Profiler::didExecute):
2042 * profiler/Profiler.h: Cleaned up the includes and subsequently the
2043 forward declarations. Also use the new ProfileGenerator.
2044 (KJS::ProfilerClient::~ProfilerClient):
2045 (KJS::Profiler::currentProfiles):
2046 * profiler/TreeProfile.cpp: Use Profile's new interface.
2047 (KJS::TreeProfile::create):
2048 (KJS::TreeProfile::TreeProfile):
2049 * profiler/TreeProfile.h:
2051 2008-07-07 Sam Weinig <sam@webkit.org>
2053 Reviewed by Cameron Zwarich.
2055 Third step in broad cleanup effort.
2057 [ File list elided ]
2059 2008-07-06 Sam Weinig <sam@webkit.org>
2061 Reviewed by Cameron Zwarich.
2063 Second step in broad cleanup effort.
2065 [ File list elided ]
2067 2008-07-05 Sam Weinig <sam@webkit.org>
2069 Reviewed by Cameron Zwarich.
2071 First step in broad cleanup effort.
2073 [ File list elided ]
2075 2008-07-05 Sam Weinig <sam@webkit.org>
2077 Rubber-stamped by Cameron Zwarich.
2079 Rename list.h/cpp to ArgList.h/cpp.
2082 * JavaScriptCore.pri:
2083 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2084 * JavaScriptCore.xcodeproj/project.pbxproj:
2085 * JavaScriptCoreSources.bkl:
2087 * kjs/AllInOneFile.cpp:
2088 * kjs/ArgList.cpp: Copied from JavaScriptCore/kjs/list.cpp.
2089 * kjs/ArgList.h: Copied from JavaScriptCore/kjs/list.h.
2090 * kjs/IndexToNameMap.cpp:
2091 * kjs/JSGlobalData.cpp:
2092 * kjs/JSGlobalData.h:
2094 * kjs/collector.cpp:
2095 * kjs/list.cpp: Removed.
2096 * kjs/list.h: Removed.
2098 2008-07-05 Sam Weinig <sam@webkit.org>
2100 Fix non-AllInOne builds again.
2102 * kjs/BooleanPrototype.cpp:
2103 * kjs/ErrorPrototype.cpp:
2104 * kjs/FunctionPrototype.cpp:
2105 * kjs/NumberPrototype.cpp:
2106 * kjs/ObjectPrototype.cpp:
2108 2008-07-05 Sam Weinig <sam@webkit.org>
2110 Fix build on case-sensitive build systems.
2112 * kjs/IndexToNameMap.cpp:
2114 2008-07-05 Sam Weinig <sam@webkit.org>
2118 * kjs/Arguments.cpp:
2119 * kjs/BooleanPrototype.cpp:
2120 * kjs/DateConstructor.cpp:
2121 * kjs/ErrorPrototype.cpp:
2122 * kjs/FunctionPrototype.cpp:
2123 * kjs/NumberPrototype.cpp:
2124 * kjs/ObjectPrototype.cpp:
2125 * kjs/RegExpPrototype.cpp:
2126 * kjs/StringConstructor.cpp:
2129 2008-07-05 Sam Weinig <sam@webkit.org>
2131 Fix non-AllInOne build.
2133 * kjs/JSGlobalObject.cpp:
2135 2008-07-05 Sam Weinig <sam@webkit.org>
2137 Rubber-stamped by Cameron Zwarich.
2139 Split Arguments, IndexToNameMap, PrototypeFunction, GlobalEvalFunction and
2140 the functions on the global object out of JSFunction.h/cpp.
2143 * JavaScriptCore.pri:
2144 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2145 * JavaScriptCore.xcodeproj/project.pbxproj:
2146 * JavaScriptCoreSources.bkl:
2148 * kjs/AllInOneFile.cpp:
2149 * kjs/Arguments.cpp: Copied from JavaScriptCore/kjs/JSFunction.cpp.
2150 * kjs/Arguments.h: Copied from JavaScriptCore/kjs/JSFunction.h.
2151 * kjs/GlobalEvalFunction.cpp: Copied from JavaScriptCore/kjs/JSFunction.cpp.
2152 * kjs/GlobalEvalFunction.h: Copied from JavaScriptCore/kjs/JSFunction.h.
2153 * kjs/IndexToNameMap.cpp: Copied from JavaScriptCore/kjs/JSFunction.cpp.
2154 * kjs/IndexToNameMap.h: Copied from JavaScriptCore/kjs/JSFunction.h.
2155 * kjs/JSActivation.cpp:
2156 * kjs/JSFunction.cpp:
2158 * kjs/JSGlobalObject.cpp:
2159 * kjs/JSGlobalObjectFunctions.cpp: Copied from JavaScriptCore/kjs/JSFunction.cpp.
2160 * kjs/JSGlobalObjectFunctions.h: Copied from JavaScriptCore/kjs/JSFunction.h.
2161 The functions on the global object should be in JSGlobalObject.cpp, but putting them there
2162 was a 0.5% regression.
2164 * kjs/PrototypeFunction.cpp: Copied from JavaScriptCore/kjs/JSFunction.cpp.
2165 * kjs/PrototypeFunction.h: Copied from JavaScriptCore/kjs/JSFunction.h.
2170 2008-07-04 Sam Weinig <sam@webkit.org>
2172 Really fix the mac build.
2174 * JavaScriptCore.xcodeproj/project.pbxproj:
2176 2008-07-04 Sam Weinig <sam@webkit.org>
2180 * JavaScriptCore.xcodeproj/project.pbxproj:
2182 2008-07-04 Sam Weinig <sam@webkit.org>
2184 Fix non-AllInOne builds.
2187 * kjs/GetterSetter.cpp:
2188 * kjs/JSImmediate.cpp:
2189 * kjs/operations.cpp:
2191 2008-07-04 Sam Weinig <sam@webkit.org>
2193 Rubber-stamped by Dan Bernstein.
2195 Split Error and GetterSetter out of JSObject.h.
2197 * API/JSCallbackObjectFunctions.h:
2199 * JavaScriptCore.pri:
2200 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2201 * JavaScriptCore.xcodeproj/project.pbxproj:
2202 * JavaScriptCoreSources.bkl:
2203 * kjs/AllInOneFile.cpp:
2204 * kjs/ClassInfo.h: Copied from JavaScriptCore/kjs/JSObject.h.
2205 * kjs/Error.cpp: Copied from JavaScriptCore/kjs/JSObject.cpp.
2206 * kjs/Error.h: Copied from JavaScriptCore/kjs/JSObject.h.
2207 * kjs/GetterSetter.cpp:
2208 * kjs/GetterSetter.h: Copied from JavaScriptCore/kjs/JSObject.h.
2213 2008-07-04 Simon Hausmann <hausmann@webkit.org>
2215 Fix the Wx build, added TreeProfile.cpp to the build.
2217 * JavaScriptCoreSources.bkl:
2219 2008-07-03 Mark Rowe <mrowe@apple.com>
2221 Reviewed by Oliver Hunt.
2223 Fix output path of recently-added script phase to reference the correct file.
2224 This prevents Xcode from running the script phase unnecessarily, which caused
2225 the generated header to be recreated and lead to AllInOneFile.cpp rebuilding.
2227 * JavaScriptCore.xcodeproj/project.pbxproj:
2229 2008-07-03 Mark Rowe <mrowe@apple.com>
2231 Follow-up to the 64-bit build fix. Use intptr_t rather than ssize_t as
2232 the latter is non-standard and does not exist on Windows.
2235 (KJS::JSLock::lockCount):
2236 (KJS::JSLock::lock):
2237 (KJS::JSLock::unlock):
2238 (KJS::JSLock::DropAllLocks::DropAllLocks):
2241 2008-07-02 Mark Rowe <mrowe@apple.com>
2243 Fix the 64-bit build. pthread_getspecific works with pointer-sized values,
2244 so use ssize_t rather than int to track the lock count to avoid warnings about
2245 truncating the result of pthread_getspecific.
2248 (KJS::JSLock::lockCount):
2249 (KJS::JSLock::lock):
2250 (KJS::JSLock::unlock):
2251 (KJS::JSLock::DropAllLocks::DropAllLocks):
2254 2008-07-03 Geoffrey Garen <ggaren@apple.com>
2256 Reviewed by Sam Weinig.
2258 Removed checking for the array get/put fast case from the array code.
2259 Callers who want the fast case should call getIndex and/or setIndex
2260 instead. (get_by_val and put_by_val already do this.)
2262 SunSpider reports no change overall, but a 1.4% speedup on fannkuch and
2263 a 3.6% speedup on nsieve.
2265 2008-07-03 Dan Bernstein <mitz@apple.com>
2269 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Added TreeProfile.{h,cpp}.
2271 2008-07-03 Dan Bernstein <mitz@apple.com>
2273 Reviewed by Anders Carlsson.
2278 (KJS::Machine::Machine):
2280 2008-07-03 Simon Hausmann <hausmann@webkit.org>
2282 Reviewed by Alexey Proskuryakov.
2284 Fix the non-threaded build.
2286 * kjs/JSGlobalData.cpp:
2287 (KJS::JSGlobalData::threadInstanceInternal):
2289 2008-07-03 Simon Hausmann <hausmann@webkit.org>
2291 Fix the Qt build, added TreeProfile to the build.
2293 * JavaScriptCore.pri:
2295 2008-07-02 Alexey Proskuryakov <ap@webkit.org>
2299 Don't create unnecessary JSGlobalData instances.
2301 * kjs/JSGlobalData.h:
2302 * kjs/JSGlobalData.cpp:
2303 (KJS::JSGlobalData::threadInstanceExists):
2304 (KJS::JSGlobalData::sharedInstanceExists):
2305 (KJS::JSGlobalData::threadInstance):
2306 (KJS::JSGlobalData::sharedInstance):
2307 (KJS::JSGlobalData::threadInstanceInternal):
2308 (KJS::JSGlobalData::sharedInstanceInternal):
2309 Added methods to query instance existence.
2311 * kjs/InitializeThreading.cpp:
2312 (KJS::initializeThreadingOnce):
2313 Initialize thread instance static in a new way.
2317 * kjs/collector.cpp:
2318 (KJS::Heap::collect):
2319 Check for instance existence before accessing it.
2321 2008-07-02 Geoffrey Garen <ggaren@apple.com>
2323 Reviewed by Cameron Zwarich.
2325 Fixed https://bugs.webkit.org/show_bug.cgi?id=19862
2326 REGRESSION (r34907): Gmail crashes in JavaScriptCore code while editing drafts
2328 I was never able to reproduce this issue, but Cameron could, and he says
2329 that this patch fixes it.
2331 The crash seems tied to a timer or event handler callback. In such a case,
2332 the sole reference to the global object may be in the current call frame,
2333 so we can't depend on the global object to mark the call frame area in
2336 The new GC marking rule is: the global object is not responsible for
2337 marking the whole register file -- it's just responsible for the globals
2338 section it's tied to. The heap is responsible for marking the call frame area.
2340 2008-07-02 Mark Rowe <mrowe@apple.com>
2342 Reviewed by Sam Weinig.
2344 Add the ability to trace JavaScriptCore garabge collections using dtrace.
2346 * JavaScriptCore.xcodeproj/project.pbxproj: Generate the dtrace probe header
2347 file when building on a new enough version of Mac OS X.
2348 * JavaScriptCorePrefix.h: Add our standard Mac OS X version detection macros.
2349 * kjs/Tracing.d: Declare three dtrace probes.
2350 * kjs/Tracing.h: Include the generated dtrace macros if dtrace is available,
2351 otherwise provide versions that do nothing.
2352 * kjs/collector.cpp:
2353 (KJS::Heap::collect): Fire dtrace probes when starting a collection, after the
2354 mark phase has completed, and when the collection is complete.
2355 * wtf/Platform.h: Define HAVE_DTRACE when building on a new enough version of Mac OS X.
2357 2008-07-02 Geoffrey Garen <ggaren@apple.com>
2359 Rubber stamped by Oliver Hunt.
2361 Reduced the max register file size from 8MB to 2MB.
2363 We still allow about 20,000 levels of recursion.
2365 2008-07-02 Alp Toker <alp@nuanti.com>
2367 Build fix for r34960. Add TreeProfile.cpp to build.
2371 2008-07-02 Geoffrey Garen <ggaren@apple.com>
2373 Reviewed by Oliver Hunt.
2375 Optimized a[n] get for cases when a is an array or a string. When a is
2376 an array, we optimize both get and put. When a is a string, we only
2377 optimize get, since you can't put to a string.
2379 SunSpider says 3.4% faster.
2381 2008-07-02 Kevin McCullough <kmccullough@apple.com>
2385 -Small cleanup in preparation for implementing Bottom-up.
2387 * profiler/CallIdentifier.h: Rename debug function to make it clear of
2388 its output and intention to be debug only.
2389 (KJS::CallIdentifier::operator const char* ): Implement in terms of
2391 (KJS::CallIdentifier::c_str):
2392 * profiler/ProfileNode.cpp: Impelment findChild() which will be needed
2393 by the bottom-up implementation.
2394 (KJS::ProfileNode::findChild):
2395 * profiler/ProfileNode.h: Added comments to make the collections of
2396 functions more clear.
2397 (KJS::ProfileNode::operator==):
2398 (KJS::ProfileNode::c_str):
2400 2008-07-02 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2404 Bug 19776: Number.toExponential() is incorrect for numbers between 0.1 and 1
2405 <https://bugs.webkit.org/show_bug.cgi?id=19776>
2407 Perform the sign check for the exponent on the actual exponent value,
2408 which is 1 less than the value of decimalPoint, instead of on the value
2409 of decimalPoint itself.
2411 * kjs/NumberPrototype.cpp:
2412 (KJS::exponentialPartToString):
2414 2008-07-02 Kevin McCullough <kmccullough@apple.com>
2418 <rdar://problem/5951532> JSProfiler: Implement Bottom-Up view (19228)
2419 - Subclass TreeProfile as I prepare for a HeavyProfile to be comming
2422 * JavaScriptCore.xcodeproj/project.pbxproj:
2423 * profiler/Profile.cpp: By default we create a TreeProfile.
2424 (KJS::Profile::create):
2425 * profiler/Profile.h: Changes to the Profile class to make it amenable
2426 to be inherited from.
2427 (KJS::Profile::~Profile):
2428 * profiler/TreeProfile.cpp: Added.
2429 (KJS::TreeProfile::create):
2430 (KJS::TreeProfile::TreeProfile):
2431 (KJS::TreeProfile::heavyProfile):
2432 * profiler/TreeProfile.h: Added.
2433 (KJS::TreeProfile::treeProfile):
2435 2008-07-02 Kevin McCullough <kmccullough@apple.com>
2439 Broke CallIdentifier out into its own file. I did this because it's
2440 going to grow a lot soon and I wanted this to be a separate patch.
2442 * JavaScriptCore.xcodeproj/project.pbxproj:
2443 * profiler/CallIdentifier.h: Added.
2444 (KJS::CallIdentifier::CallIdentifier):
2445 (KJS::CallIdentifier::operator==):
2446 (KJS::CallIdentifier::operator!=):
2447 (KJS::CallIdentifier::operator const char* ):
2448 (KJS::CallIdentifier::toString):
2449 * profiler/ProfileNode.h:
2451 2008-07-02 Simon Hausmann <hausmann@webkit.org>
2453 Build fix. Implemented missing functions for single-threaded build.
2456 (KJS::JSLock::JSLock):
2457 (KJS::JSLock::lock):
2458 (KJS::JSLock::unlock):
2459 (KJS::JSLock::DropAllLocks::DropAllLocks):
2461 2008-07-02 Alexey Proskuryakov <ap@webkit.org>
2463 Another non-AllInOne build fix.
2465 * kjs/JSGlobalObject.cpp: Include JSLock.h here, too.
2467 2008-07-02 Alexey Proskuryakov <ap@webkit.org>
2469 Non-AllInOne build fix.
2471 * kjs/interpreter.cpp: Include JSLock.h.
2473 2008-06-30 Alexey Proskuryakov <ap@webkit.org>
2477 Disable JSLock for per-thread contexts.
2479 No change on SunSpider.
2481 * kjs/JSGlobalData.h:
2482 * kjs/JSGlobalData.cpp:
2483 (KJS::JSGlobalData::JSGlobalData):
2484 (KJS::JSGlobalData::sharedInstance):
2485 Added isSharedInstance as a better way to tell whether the instance is shared (legacy).
2488 (KJS::createJSLockCount):
2489 (KJS::JSLock::lockCount):
2490 (KJS::setLockCount):
2491 (KJS::JSLock::JSLock):
2492 (KJS::JSLock::lock):
2493 (KJS::JSLock::unlock):
2494 (KJS::JSLock::currentThreadIsHoldingLock):
2495 (KJS::JSLock::DropAllLocks::DropAllLocks):
2496 (KJS::JSLock::DropAllLocks::~DropAllLocks):
2498 (KJS::JSLock::JSLock):
2499 (KJS::JSLock::~JSLock):
2500 Made JSLock and JSLock::DropAllLocks constructors take a parameter to decide whether to
2501 actually lock a mutex, or only to increment recursion count. We cannot turn it into no-op
2502 if we want to keep existing assertions working.
2503 Made recursion count per-thread, now that locks may not lock.
2506 (JSEvaluateScript): Take JSLock after casting JSContextRef to ExecState* (which doesn't need
2507 locking in any case), so that a decision whether to actually lock can be made.
2508 (JSCheckScriptSyntax): Ditto.
2509 (JSGarbageCollect): Only lock while collecting the shared heap, not the per-thread one.
2511 * API/JSObjectRef.cpp:
2512 (JSClassCreate): Don't lock, as there is no reason to.
2513 (JSClassRetain): Ditto.
2514 (JSClassRelease): Ditto.
2515 (JSPropertyNameArrayRetain): Ditto.
2516 (JSPropertyNameArrayRelease): Only lock while deleting the array, as that may touch
2518 (JSPropertyNameAccumulatorAddName): Adding a string also involves an identifier table
2519 lookup, and possibly modification.
2521 * API/JSStringRef.cpp:
2522 (JSStringCreateWithCharacters):
2523 (JSStringCreateWithUTF8CString):
2526 (JSStringGetUTF8CString):
2528 * API/JSStringRefCF.cpp:
2529 (JSStringCreateWithCFString):
2530 JSStringRef operations other than releasing do not need locking.
2532 * VM/Machine.cpp: Don't include unused JSLock.h.
2534 * kjs/CollectorHeapIntrospector.cpp: (KJS::CollectorHeapIntrospector::statistics):
2535 Don't take the lock for real, as heap introspection pauses the process anyway. It seems that
2536 the existing code could cause deadlocks.
2542 The test tool uses a per-thread context, so no real locking is required.
2545 (KJS::Heap::setGCProtectNeedsLocking): Optionally protect m_protectedValues access with a
2546 per-heap mutex. This is only needed for WebCore Database code, which violates the "no data
2547 migration between threads" by using ProtectedPtr on a background thread.
2548 (KJS::Heap::isShared): Keep a shared flag here, as well.
2551 (KJS::::ProtectedPtr):
2552 (KJS::::~ProtectedPtr):
2556 ProtectedPtr is ony used from WebCore, so it doesn't need to take JSLock. An assertion in
2557 Heap::protect/unprotect guards agains possible future unlocked uses of ProtectedPtr in JSC.
2559 * kjs/collector.cpp:
2560 (KJS::Heap::Heap): Initialize m_isShared.
2561 (KJS::Heap::~Heap): No need to lock for real during destruction, but must keep assertions
2563 (KJS::destroyRegisteredThread): Registered thread list is only accessed for shared heap,
2564 so locking is always needed here.
2565 (KJS::Heap::registerThread): Ditto.
2566 (KJS::Heap::markStackObjectsConservatively): Use m_isShared instead of comparing to a shared
2567 instance for a small speedup.
2568 (KJS::Heap::setGCProtectNeedsLocking): Create m_protectedValuesMutex. There is currently no
2569 way to undo this - and ideally, Database code will be fixed to lo longer require this quirk.
2570 (KJS::Heap::protect): Take m_protectedValuesMutex (if it exists) while accessing
2572 (KJS::Heap::unprotect): Ditto.
2573 (KJS::Heap::markProtectedObjects): Ditto.
2574 (KJS::Heap::protectedGlobalObjectCount): Ditto.
2575 (KJS::Heap::protectedObjectCount): Ditto.
2576 (KJS::Heap::protectedObjectTypeCounts): Ditto.
2580 Don't include JSLock.h, which is no longer used here. As a result, an explicit include had
2581 to be added to many files in JavaScriptGlue, WebCore and WebKit.
2583 * kjs/JSGlobalObject.cpp:
2584 (KJS::JSGlobalObject::init):
2585 * API/JSCallbackConstructor.cpp:
2586 (KJS::constructJSCallback):
2587 * API/JSCallbackFunction.cpp:
2588 (KJS::JSCallbackFunction::call):
2589 * API/JSCallbackObjectFunctions.h:
2591 (KJS::::getOwnPropertySlot):
2593 (KJS::::deleteProperty):
2595 (KJS::::hasInstance):
2597 (KJS::::getPropertyNames):
2600 (KJS::::staticValueGetter):
2601 (KJS::::callbackGetter):
2602 * API/JSContextRef.cpp:
2603 (JSGlobalContextCreate):
2604 (JSGlobalContextRetain):
2605 (JSGlobalContextRelease):
2606 * API/JSValueRef.cpp:
2608 (JSValueIsStrictEqual):
2609 (JSValueIsInstanceOfConstructor):
2610 (JSValueMakeNumber):
2611 (JSValueMakeString):
2613 (JSValueToStringCopy):
2617 * JavaScriptCore.exp:
2618 * kjs/PropertyNameArray.h:
2619 (KJS::PropertyNameArray::globalData):
2620 * kjs/interpreter.cpp:
2621 (KJS::Interpreter::checkSyntax):
2622 (KJS::Interpreter::evaluate):
2623 Pass a parameter to JSLock/JSLock::DropAllLocks to decide whether the lock needs to be taken.
2625 2008-07-01 Alexey Proskuryakov <ap@webkit.org>
2629 https://bugs.webkit.org/show_bug.cgi?id=19834
2630 Failed assertion in JavaScriptCore/VM/SegmentedVector.h:82
2632 Creating a global object with a custom prototype resets it twice (wasteful!).
2633 So, addStaticGlobals() was called twice, but JSGlobalObject::reset() didn't reset
2636 * kjs/JSGlobalObject.cpp: (KJS::JSGlobalObject::reset): Call setRegisterArray(0, 0).
2638 * kjs/JSVariableObject.h: Changed registerArray to OwnArrayPtr. Also, added private copy
2639 constructor and operator= to ensure that no one attempts to copy this object (for whatever
2640 reason, I couldn't make Noncopyable work).
2642 * kjs/JSGlobalObject.h: (KJS::JSGlobalObject::addStaticGlobals): Allocate registerArray
2645 * kjs/JSVariableObject.cpp:
2646 (KJS::JSVariableObject::copyRegisterArray): Allocate registerArray with new[].
2647 (KJS::JSVariableObject::setRegisterArray): Avoid hitting an assertion in OwnArrayPtr when
2648 "changing" the value from 0 to 0.
2650 2008-07-01 Geoffrey Garen <ggaren@apple.com>
2652 Reviewed by Oliver Hunt.
2654 Removed and/or reordered exception checks in array-style a[n] access.
2656 SunSpider says 1.4% faster.
2659 (KJS::Machine::privateExecute): No need to check for exceptions before
2660 calling toString, toNumber and/or get. If the call ends up being observable
2661 through toString, valueOf, or a getter, we short-circuit it there, instead.
2662 In the op_del_by_val case, I removed the incorrect comment without actually
2663 removing the code, since I didn't want to tempt the GCC fates!
2666 (KJS::callDefaultValueFunction): Added exception check to prevent
2667 toString and valueOf functions from observing execution after an exception
2668 has been thrown. This removes some of the burden of exception checking
2671 (KJS::JSObject::defaultValue): Removed redundant exception check here.
2673 * kjs/PropertySlot.cpp:
2674 (KJS::PropertySlot::functionGetter): Added exception check to prevent
2675 getter functions from observing execution after an exception has been
2676 thrown. This removes some of the burden of exception checking from the
2679 2008-07-01 Geoffrey Garen <ggaren@apple.com>
2681 Reviewed by Oliver Hunt.
2683 Optimized a[n] get and put for cases where n is an immediate unsigned
2686 SunSpider says 3.5% faster.
2688 2008-07-01 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2692 Bug 19844: JavaScript Switch statement modifies "this"
2693 <https://bugs.webkit.org/show_bug.cgi?id=19844>
2695 Use a temporary when generating code for switch clauses to avoid
2696 overwriting 'this' or a local variable.
2699 (KJS::CaseBlockNode::emitCodeForBlock):
2701 2008-07-01 Christian Dywan <christian@twotoasts.de>
2705 * kjs/list.cpp: Include "JSCell.h"
2707 2008-07-01 Kevin McCullough <kmccullough@apple.com>
2711 * JavaScriptCore.xcodeproj/project.pbxproj:
2713 2008-07-01 Dan Bernstein <mitz@apple.com>
2715 Reviewed by Anders Carlsson.
2717 - Mac release build fix
2719 * JavaScriptCore.exp:
2721 2008-07-01 Sam Weinig <sam@webkit.org>
2723 Try and fix mac builds.
2725 * JavaScriptCore.exp:
2727 2008-07-01 Sam Weinig <sam@webkit.org>
2729 Fix non-AllInOne builds.
2733 2008-07-01 Sam Weinig <sam@webkit.org>
2735 Reviewed by Darin Adler.
2737 Split JSCell and JSNumberCell class declarations out of JSValue.h
2740 * JavaScriptCore.pri:
2741 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2742 * JavaScriptCore.xcodeproj/project.pbxproj:
2743 * JavaScriptCoreSources.bkl:
2744 * VM/JSPropertyNameIterator.h:
2745 * kjs/AllInOneFile.cpp:
2746 * kjs/JSCell.cpp: Copied from JavaScriptCore/kjs/JSValue.cpp.
2747 * kjs/JSCell.h: Copied from JavaScriptCore/kjs/JSValue.h.
2748 (KJS::JSValue::getJSNumber):
2749 * kjs/JSNumberCell.cpp:
2750 * kjs/JSNumberCell.h: Copied from JavaScriptCore/kjs/JSValue.h.
2754 (KJS::jsOwnedString):
2756 (KJS::JSValue::toThisJSString):
2760 2008-07-01 Anders Carlsson <andersca@apple.com>
2764 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2765 * kjs/JSGlobalObject.h:
2766 (KJS::JSGlobalObject::addStaticGlobals):
2768 2008-07-01 Simon Hausmann <hausmann@webkit.org>
2770 Build fix, include OwnPtr.h.
2772 * kjs/RegExpConstructor.h:
2774 2008-06-30 Geoffrey Garen <ggaren@apple.com>
2776 Reviewed by Oliver Hunt.
2778 Fixed a global object leak caused by the switch to one register file.
2780 Don't unconditionally mark the register file, since that logically
2781 makes all global variables GC roots, even when their global object is
2782 no longer reachable.
2784 Instead, make the global object associated with the register file
2785 responsible for marking the register file.
2787 2008-06-30 Geoffrey Garen <ggaren@apple.com>
2789 Reviewed by Oliver Hunt.
2791 Removed the "registerBase" abstraction. Since the register file never
2792 reallocates, we can keep direct pointers into it, instead of
2793 <registerBase, offset> tuples.
2795 SunSpider says 0.8% faster.
2797 2008-06-30 Oliver Hunt <oliver@apple.com>
2799 Reviewed by NOBODY (build fix).
2801 Fix build by adding all (hopefully) the missing includes.
2803 * kjs/BooleanPrototype.cpp:
2804 * kjs/DateConstructor.cpp:
2805 * kjs/ErrorPrototype.cpp:
2806 * kjs/FunctionPrototype.cpp:
2807 * kjs/NativeErrorConstructor.cpp:
2808 * kjs/NumberPrototype.cpp:
2809 * kjs/ObjectPrototype.cpp:
2810 * kjs/RegExpConstructor.cpp:
2811 * kjs/StringConstructor.cpp:
2812 * kjs/StringPrototype.cpp:
2814 2008-06-30 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2818 Bug 19830: REGRESSION (r34883): Google Reader doesn't show up feed list on sidebar
2819 <https://bugs.webkit.org/show_bug.cgi?id=19830>
2821 Ensure that we do not eliminate a write to a local register when doing
2822 peephole optimizations.
2824 * VM/CodeGenerator.cpp:
2825 (KJS::CodeGenerator::emitJumpIfTrue):
2826 (KJS::CodeGenerator::emitJumpIfFalse):
2828 2008-06-30 Sam Weinig <sam@webkit.org>
2830 Rubber-stamped by Darin Alder.
2832 Split InternalFunction into its own header file.
2834 * API/JSCallbackFunction.h:
2835 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2836 * JavaScriptCore.xcodeproj/project.pbxproj:
2837 * kjs/ArrayConstructor.h:
2838 * kjs/BooleanConstructor.h:
2839 * kjs/DateConstructor.h:
2840 * kjs/ErrorConstructor.h:
2841 * kjs/FunctionConstructor.h:
2842 * kjs/FunctionPrototype.h:
2843 * kjs/InternalFunction.h: Copied from kjs/JSFunction.h.
2845 * kjs/NativeErrorConstructor.h:
2846 * kjs/NumberConstructor.h:
2847 * kjs/ObjectConstructor.h:
2848 * kjs/RegExpConstructor.h:
2849 * kjs/StringConstructor.h:
2850 * profiler/Profiler.cpp:
2852 2008-06-30 Sam Weinig <sam@webkit.org>
2854 Reviewed by Kevin McCullough.
2856 Remove empty files Instruction.cpp, LabelID.cpp, Register.cpp and RegisterID.cpp.
2859 * JavaScriptCore.pri:
2860 * JavaScriptCore.xcodeproj/project.pbxproj:
2861 * JavaScriptCoreSources.bkl:
2862 * VM/Instruction.cpp: Removed.
2863 * VM/LabelID.cpp: Removed.
2864 * VM/Register.cpp: Removed.
2865 * VM/RegisterID.cpp: Removed.
2867 2008-06-30 Sam Weinig <sam@webkit.org>
2869 Rubber-stamped (reluctantly) by Kevin McCullough.
2871 Rename date_object.h/cpp to DateInstance.h/cpp
2874 * JavaScriptCore.pri:
2875 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2876 * JavaScriptCore.xcodeproj/project.pbxproj:
2877 * JavaScriptCoreSources.bkl:
2878 * kjs/AllInOneFile.cpp:
2879 * kjs/DateConstructor.cpp:
2880 * kjs/DateInstance.cpp: Copied from kjs/date_object.cpp.
2881 * kjs/DateInstance.h: Copied from kjs/date_object.h.
2882 * kjs/DatePrototype.cpp:
2883 * kjs/DatePrototype.h:
2884 * kjs/date_object.cpp: Removed.
2885 * kjs/date_object.h: Removed.
2887 2008-06-30 Sam Weinig <sam@webkit.org>
2889 Rubber-stamped by Darin Adler.
2891 Remove internal.cpp and move its contents to there own .cpp files.
2894 * JavaScriptCore.pri:
2895 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2896 * JavaScriptCore.xcodeproj/project.pbxproj:
2897 * JavaScriptCoreSources.bkl:
2898 * kjs/AllInOneFile.cpp:
2899 * kjs/GetterSetter.cpp: Copied from kjs/internal.cpp.
2900 * kjs/InternalFunction.cpp: Copied from kjs/internal.cpp.
2901 * kjs/JSNumberCell.cpp: Copied from kjs/internal.cpp.
2902 * kjs/JSString.cpp: Copied from kjs/internal.cpp.
2904 * kjs/LabelStack.cpp: Copied from kjs/internal.cpp.
2905 * kjs/NumberConstructor.cpp:
2906 * kjs/NumberObject.cpp:
2907 (KJS::constructNumber):
2908 (KJS::constructNumberFromImmediateNumber):
2909 * kjs/internal.cpp: Removed.
2911 2008-06-30 Adam Roben <aroben@apple.com>
2913 Fix <rdar://5954749> Assertion failure due to HashTable's use of
2916 HashTable was passing &value to constructDeletedValue, which in
2917 classes like WebCore::COMPtr would cause an assertion. We now pass
2918 value by reference instead of by address so that the HashTraits
2919 implementations have more flexibility in constructing the deleted
2922 Reviewed by Ada Chan.
2924 * VM/CodeGenerator.h: Updated for changes to HashTraits.
2926 (WTF::::deleteBucket): Changed to pass bucket by reference instead of
2928 (WTF::::checkKey): Ditto.
2930 (WTF::): Updated HashTraits for HashTable change.
2932 2008-07-01 Alexey Proskuryakov <ap@webkit.org>
2934 Reviewed by Cameron Zwarich.
2936 Make RegisterFile really unmap memory on destruction.
2938 This fixes run-webkit-tests --threaded, which ran out of address space in a few seconds.
2940 * VM/RegisterFile.cpp: (KJS::RegisterFile::~RegisterFile): Unmap all the memory, not just
2943 * kjs/JSGlobalObject.h: Don't include RegisterFile.h, so that changes to it don't make
2944 half of WebCore rebuild.
2946 * VM/Machine.h: Don't forward declare RegisterFile, as RegisterFile.h is included already.
2948 * VM/RegisterFile.h: (KJS::RegisterFile::RegisterFile): Assert that the allocation succeeded.
2950 2008-06-30 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2952 Rubber-stamped by Oliver.
2954 Correct the documentation for op_put_by_index.
2957 (KJS::Machine::privateExecute):
2959 2008-06-29 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2963 Bug 19821: Merge the instruction pair (less, jfalse)
2964 <https://bugs.webkit.org/show_bug.cgi?id=19821>
2966 This is a 2.4% win on SunSpider. I needed to add an ALWAYS_INLINE
2967 intrinisc to CodeGenerator::rewindBinaryOp() to avoid a massive
2968 regression in regexp-dna.
2971 (KJS::CodeBlock::dump):
2972 * VM/CodeGenerator.cpp:
2973 (KJS::CodeGenerator::rewindBinaryOp):
2974 (KJS::CodeGenerator::emitJumpIfFalse):
2976 (KJS::Machine::privateExecute):
2981 2008-06-29 Sam Weinig <sam@webkit.org>
2983 Fix non-AllInOne builds.
2988 2008-06-29 Sam Weinig <sam@webkit.org>
2993 * kjs/DatePrototype.cpp:
2995 2008-06-29 Sam Weinig <sam@webkit.org>
2997 Rubber-stamped by Cameron Zwarich.
2999 Splits ErrorConstructor, ErrorPrototype, NativeErrorConstructor and
3000 NativeErrorPrototype out of error_object.h/cpp and renames it ErrorInstance.
3003 * JavaScriptCore.pri:
3004 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3005 * JavaScriptCore.xcodeproj/project.pbxproj:
3006 * JavaScriptCoreSources.bkl:
3007 * kjs/AllInOneFile.cpp:
3008 * kjs/ArrayConstructor.cpp:
3009 * kjs/ArrayPrototype.cpp:
3010 * kjs/BooleanPrototype.cpp:
3011 * kjs/DatePrototype.cpp:
3012 * kjs/ErrorConstructor.cpp: Copied from kjs/error_object.cpp.
3013 * kjs/ErrorConstructor.h: Copied from kjs/error_object.h.
3014 * kjs/ErrorInstance.cpp: Copied from kjs/error_object.cpp.
3015 * kjs/ErrorInstance.h: Copied from kjs/error_object.h.
3016 * kjs/ErrorPrototype.cpp: Copied from kjs/error_object.cpp.
3017 * kjs/ErrorPrototype.h: Copied from kjs/error_object.h.
3018 * kjs/JSGlobalObject.cpp:
3021 * kjs/NativeErrorConstructor.cpp: Copied from kjs/error_object.cpp.
3022 * kjs/NativeErrorConstructor.h: Copied from kjs/error_object.h.
3023 * kjs/NativeErrorPrototype.cpp: Copied from kjs/error_object.cpp.
3024 * kjs/NativeErrorPrototype.h: Copied from kjs/error_object.h.
3025 * kjs/NumberPrototype.cpp:
3026 * kjs/RegExpConstructor.cpp:
3027 * kjs/RegExpObject.cpp:
3028 * kjs/RegExpPrototype.cpp:
3029 * kjs/StringPrototype.cpp:
3030 * kjs/error_object.cpp: Removed.
3031 * kjs/error_object.h: Removed.
3034 2008-06-29 Sam Weinig <sam@webkit.org>
3036 Fix non-AllInOne build.
3038 * kjs/DateConstructor.cpp:
3042 2008-06-29 Sam Weinig <sam@webkit.org>
3044 Rubber-stamped by Oliver Hunt.
3046 Splits DateConstructor and DatePrototype out of date_object.h/cpp
3047 Moves shared Date code into DateMath.
3049 * DerivedSources.make:
3051 * JavaScriptCore.pri:
3052 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3053 * JavaScriptCore.xcodeproj/project.pbxproj:
3054 * JavaScriptCoreSources.bkl:
3055 * kjs/AllInOneFile.cpp:
3056 * kjs/DateConstructor.cpp: Copied from kjs/date_object.cpp.
3057 * kjs/DateConstructor.h: Copied from kjs/date_object.h.
3059 (KJS::ymdhmsToSeconds):
3061 (KJS::skipSpacesAndComments):
3066 (KJS::formatDateUTCVariant):
3070 * kjs/DatePrototype.cpp: Copied from kjs/date_object.cpp.
3071 * kjs/DatePrototype.h: Copied from kjs/date_object.h.
3072 * kjs/JSGlobalObject.cpp:
3074 * kjs/date_object.cpp:
3075 * kjs/date_object.h:
3078 2008-06-29 Jan Michael Alonzo <jmalonzo@webkit.org>
3080 Rubber-stamped by Cameron Zwarich
3082 Fix Gtk non-AllInOne build
3084 * GNUmakefile.am: include JSVariableObject.cpp
3085 * kjs/RegExpConstructor.cpp: include RegExpObject.h
3086 * kjs/RegExpObject.h: forward declare RegExpPrototype
3088 2008-06-28 Darin Adler <darin@apple.com>
3090 Reviewed by Sam and Cameron.
3092 - fix https://bugs.webkit.org/show_bug.cgi?id=19805
3093 Array.concat turns missing array elements into "undefined"
3095 Test: fast/js/array-holes.html
3097 * JavaScriptCore.exp: No longer export JSArray::getItem.
3099 * kjs/ArrayPrototype.cpp:
3100 (KJS::arrayProtoFuncConcat): Changed to use getProperty instead of
3101 JSArray::getItem -- need to handle properties from the prototype chain
3102 instead of ignoring them.
3104 * kjs/JSArray.cpp: Removed getItem.
3105 * kjs/JSArray.h: Ditto.
3107 2008-06-28 Darin Adler <darin@apple.com>
3109 Reviewed by Cameron.
3111 - https://bugs.webkit.org/show_bug.cgi?id=19804
3112 optimize access to arrays without "holes"
3114 SunSpider says 1.8% faster.
3117 (KJS::JSArray::JSArray): Initialize m_fastAccessCutoff when creating
3118 arrays. Also updated for new location of m_vectorLength.
3119 (KJS::JSArray::getItem): Updated for new location of m_vectorLength.
3120 (KJS::JSArray::getSlowCase): Added. Broke out the non-hot parts of
3121 getOwnPropertySlot to make the hot part faster.
3122 (KJS::JSArray::getOwnPropertySlot): Added a new faster case for
3123 indices lower than m_fastAccessCutoff. We can do theese with no
3124 additional checks or branches.
3125 (KJS::JSArray::put): Added a new faster case for indices lower than
3126 m_fastAccessCutoff. We can do theese with no additional checks or
3127 branches. Moved the maxArrayIndex handling out of this function.
3128 Added code to set m_fastAccessCutoff when the very last hole in
3129 an array is filled; this is how the cutoff gets set for most arrays.
3130 (KJS::JSArray::putSlowCase): Moved the rest of the put function logic
3131 in here, to make the hot part of the put function faster.
3132 (KJS::JSArray::deleteProperty): Added code to lower m_fastAccessCutoff
3133 when a delete makes a new hole in the array.
3134 (KJS::JSArray::getPropertyNames): Updated for new location of
3136 (KJS::JSArray::increaseVectorLength): Ditto.
3137 (KJS::JSArray::setLength): Added code to lower m_fastAccessCutoff
3138 when setLength makes the array smaller.
3139 (KJS::JSArray::mark): Updated for new location of m_vectorLength.
3140 (KJS::JSArray::sort): Ditto. Set m_fastAccessCutoff after moving
3141 all the holes to the end of the array.
3142 (KJS::JSArray::compactForSorting): Ditto.
3143 (KJS::JSArray::checkConsistency): Added consistency checks fro
3144 m_fastAccessCutoff and updated for the new location of m_vectorLength.
3146 * kjs/JSArray.h: Added declarations for slow case functions.
3147 Replaced m_vectorLength with m_fastAccessCutoff.
3149 2008-06-28 Cameron Zwarich <cwzwarich@uwaterloo.ca>
3153 When executing a native call, check for an exception before writing the
3157 (KJS::Machine::privateExecute):
3159 2008-06-28 Mark Rowe <mrowe@apple.com>
3161 Build fix. Flag headers as private or public as is appropriate.
3162 These settings were accidentally removed during some project file cleanup.
3164 * JavaScriptCore.xcodeproj/project.pbxproj:
3166 2008-06-28 Sam Weinig <sam@webkit.org>
3168 Rubber-stamped by Darin Adler.
3170 Splits RegExpConstructor and RegExpPrototype out of RegExpObject.h/cpp
3172 * DerivedSources.make:
3174 * JavaScriptCore.pri:
3175 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3176 * JavaScriptCore.xcodeproj/project.pbxproj:
3177 * JavaScriptCoreSources.bkl:
3179 * kjs/AllInOneFile.cpp:
3180 * kjs/JSGlobalObject.cpp:
3181 * kjs/RegExpConstructor.cpp: Copied from kjs/RegExpObject.cpp.
3182 * kjs/RegExpConstructor.h: Copied from kjs/RegExpObject.h.
3183 * kjs/RegExpObject.cpp:
3184 * kjs/RegExpObject.h:
3185 * kjs/RegExpPrototype.cpp: Copied from kjs/RegExpObject.cpp.
3186 * kjs/RegExpPrototype.h: Copied from kjs/RegExpObject.h.
3187 * kjs/StringPrototype.cpp:
3190 2008-06-28 Sam Weinig <sam@webkit.org>
3192 Fix non-AllInOne builds.
3194 * kjs/StringConstructor.cpp:
3196 2008-06-28 Sam Weinig <sam@webkit.org>
3198 Rubber-stamped by Darin Adler.
3200 Rename string_object.h/cpp to StringObject.h/cpp and split out StringObjectThatMasqueradesAsUndefined,
3201 StringConstructor and StringPrototype.
3203 * DerivedSources.make:
3205 * JavaScriptCore.pri:
3206 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3207 * JavaScriptCore.xcodeproj/project.pbxproj:
3208 * JavaScriptCoreSources.bkl:
3209 * kjs/AllInOneFile.cpp:
3210 * kjs/JSGlobalObject.cpp:
3211 * kjs/StringConstructor.cpp: Copied from JavaScriptCore/kjs/string_object.cpp.
3212 * kjs/StringConstructor.h: Copied from JavaScriptCore/kjs/string_object.h.
3213 * kjs/StringObject.cpp: Copied from JavaScriptCore/kjs/string_object.cpp.
3214 * kjs/StringObject.h: Copied from JavaScriptCore/kjs/string_object.h.
3215 * kjs/StringObjectThatMasqueradesAsUndefined.h: Copied from JavaScriptCore/kjs/string_object.h.
3216 * kjs/StringPrototype.cpp: Copied from JavaScriptCore/kjs/string_object.cpp.
3217 * kjs/StringPrototype.h: Copied from JavaScriptCore/kjs/string_object.h.
3219 * kjs/string_object.cpp: Removed.
3220 * kjs/string_object.h: Removed.
3222 2008-06-28 Jan Michael Alonzo <jmalonzo@webkit.org>
3224 Gtk build fix: JSVariableObject is now part of AllInOne
3228 2008-06-28 Darin Adler <darin@apple.com>
3232 - https://bugs.webkit.org/show_bug.cgi?id=19801
3233 add a feature so we can tell what regular expressions are taking time
3235 * pcre/pcre_compile.cpp:
3236 (jsRegExpCompile): Compile in the string if REGEXP_HISTOGRAM is on.
3238 * pcre/pcre_exec.cpp:
3239 (jsRegExpExecute): Add hook to time execution.
3240 (Histogram::~Histogram): Print a sorted list of what took time.
3241 (Histogram::add): Accumulate records of what took time.
3242 (HistogramTimeLogger::~HistogramTimeLogger): Hook that calls
3243 Histogram::add at the right moment and creates the global histogram
3246 * pcre/pcre_internal.h: Define REGEXP_HISTOGRAM.
3248 * pcre/pcre_tables.cpp: Added missing include of "config.h". Not needed
3249 any more, but an omissions an earlier version of this patch detected.
3250 * pcre/pcre_ucp_searchfuncs.cpp: Ditto.
3251 * pcre/pcre_xclass.cpp: Ditto.
3253 2008-06-28 Sam Weinig <sam@webkit.org>
3255 Try and fix the Windows build again.
3257 * kjs/RegExpObject.cpp:
3258 * kjs/date_object.cpp:
3259 * kjs/error_object.cpp:
3261 2008-06-28 Sam Weinig <sam@webkit.org>
3263 Rubber-stamped by Darin Adler.
3265 Remove unused StringConstructorFunction class.
3267 * kjs/string_object.h:
3269 2008-06-28 Sam Weinig <sam@webkit.org>
3273 * kjs/ArrayPrototype.cpp:
3274 * kjs/BooleanPrototype.cpp:
3275 * kjs/BooleanPrototype.h:
3276 * kjs/FunctionPrototype.cpp:
3277 * kjs/JSImmediate.cpp:
3279 * kjs/MathObject.cpp:
3280 * kjs/NumberPrototype.cpp:
3281 * kjs/NumberPrototype.h:
3282 * kjs/ObjectConstructor.cpp:
3283 * kjs/RegExpObject.h:
3284 * kjs/error_object.h:
3285 * kjs/string_object.cpp:
3287 2008-06-28 Sam Weinig <sam@webkit.org>
3289 Rubber-stamped by Oliver Hunt.
3291 Splits FunctionConstructor out of FunctionPrototype.h/cpp
3292 Splits NumberConstructor and NumberPrototype out of NumberObject.h/cpp
3293 Rename object_object.h/cpp to ObjectPrototype.h/cpp and split out ObjectConstructor.
3295 * API/JSCallbackConstructor.cpp:
3296 * API/JSClassRef.cpp:
3297 * API/JSObjectRef.cpp:
3298 * DerivedSources.make:
3300 * JavaScriptCore.pri:
3301 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3302 * JavaScriptCore.xcodeproj/project.pbxproj:
3303 * JavaScriptCoreSources.bkl:
3305 * kjs/AllInOneFile.cpp:
3306 * kjs/ArrayConstructor.cpp:
3307 * kjs/ArrayConstructor.h:
3308 * kjs/FunctionConstructor.cpp: Copied from JavaScriptCore/kjs/FunctionPrototype.cpp.
3309 * kjs/FunctionConstructor.h: Copied from JavaScriptCore/kjs/FunctionPrototype.h.
3310 * kjs/FunctionPrototype.cpp:
3311 * kjs/FunctionPrototype.h:
3312 * kjs/JSFunction.cpp:
3313 * kjs/JSGlobalObject.cpp:
3314 * kjs/JSImmediate.cpp:
3316 * kjs/NumberConstructor.cpp: Copied from JavaScriptCore/kjs/NumberObject.cpp.
3317 * kjs/NumberConstructor.h: Copied from JavaScriptCore/kjs/NumberObject.h.
3318 * kjs/NumberObject.cpp:
3319 * kjs/NumberObject.h:
3320 * kjs/NumberPrototype.cpp: Copied from JavaScriptCore/kjs/NumberObject.cpp.
3321 * kjs/NumberPrototype.h: Copied from JavaScriptCore/kjs/NumberObject.h.
3322 * kjs/ObjectConstructor.cpp: Copied from JavaScriptCore/kjs/object_object.cpp.
3323 * kjs/ObjectConstructor.h: Copied from JavaScriptCore/kjs/object_object.h.
3324 * kjs/ObjectPrototype.cpp: Copied from JavaScriptCore/kjs/object_object.cpp.
3325 * kjs/ObjectPrototype.h: Copied from JavaScriptCore/kjs/object_object.h.
3326 * kjs/RegExpObject.h:
3328 * kjs/error_object.h:
3331 * kjs/object_object.cpp: Removed.
3332 * kjs/object_object.h: Removed.
3333 * kjs/string_object.h:
3335 2008-06-28 Darin Adler <darin@apple.com>
3339 - fix https://bugs.webkit.org/show_bug.cgi?id=19796
3340 optimize expressions with ignored results (especially post-increment)
3342 SunSpider says 0.9% faster.
3344 * VM/CodeGenerator.h:
3345 (KJS::CodeGenerator::tempDestination): Create a new temporary for
3346 ignoredResult() too, just as we would for 0.
3347 (KJS::CodeGenerator::finalDestination): Use the temporary if the
3348 register passed in is ignoredResult() too, just as we would for 0.
3349 (KJS::CodeGenerator::destinationForAssignResult): Return 0 if the
3350 passed in register is ignoredResult(), just as we would for 0.
3351 (KJS::CodeGenerator::moveToDestinationIfNeeded): Return 0 if the
3352 register passed in is ignoredResult(). What matters is that we
3353 don't want to emit a move. The return value won't be looked at.
3354 (KJS::CodeGenerator::emitNode): Allow ignoredResult() and pass it
3355 through to the node's emitCode function.
3358 (KJS::ignoredResult): Added. Special value to indicate the result of
3359 a node will be ignored and need not be put in any register.
3362 (KJS::NullNode::emitCode): Do nothing if dst == ignoredResult().
3363 (KJS::BooleanNode::emitCode): Ditto.
3364 (KJS::NumberNode::emitCode): Ditto.
3365 (KJS::StringNode::emitCode): Ditto.
3366 (KJS::RegExpNode::emitCode): Ditto.
3367 (KJS::ThisNode::emitCode): Ditto.
3368 (KJS::ResolveNode::emitCode): Do nothing if dst == ignoredResult() and
3369 the identifier resolves to a local variable.
3370 (KJS::ObjectLiteralNode::emitCode): Do nothing if dst == ignoredResult()
3371 and the object is empty.
3372 (KJS::PostIncResolveNode::emitCode): If dst == ignoredResult(), then do
3373 nothing for the local constant case, and do a pre-increment in all the
3375 (KJS::PostDecResolveNode::emitCode): Ditto.
3376 (KJS::PostIncBracketNode::emitCode): Ditto.
3377 (KJS::PostDecBracketNode::emitCode): Ditto.
3378 (KJS::PostIncDotNode::emitCode): Ditto.
3379 (KJS::PostDecDotNode::emitCode): Ditto.
3380 (KJS::DeleteValueNode::emitCode): Pass ignoredResult() when evaluating
3382 (KJS::VoidNode::emitCode): Ditto.
3383 (KJS::TypeOfResolveNode::emitCode): If dst == ignoredResult(), do nothing
3384 if the identifier resolves to a local variable, and don't bother generating
3385 a typeof opcode in the other case.
3386 (KJS::TypeOfValueNode::emitCode): Ditto.
3387 (KJS::PreIncResolveNode::emitCode): Do nothing if dst == ignoredResult() and
3388 the identifier resolves to a local constant.
3389 (KJS::PreDecResolveNode::emitCode): Ditto.
3390 (KJS::AssignResolveNode::emitCode): Turn ignoredResult() into 0 in a couple
3391 places, because we need to put the result into a register so we can assign
3392 it. At other sites this is taken care of by functions like finalDestination.
3393 (KJS::CommaNode::emitCode): Pass ignoredResult() when evaluating the first
3395 (KJS::ForNode::emitCode): Pass ignoredResult() when evaluating the first and
3397 (KJS::ForInNode::emitCode): Pass ignoredResult() when evaluating the first
3400 2008-06-28 Darin Adler <darin@apple.com>
3404 - https://bugs.webkit.org/show_bug.cgi?id=19787
3405 create most arrays from values in registers rather than with multiple put operations
3407 SunSpider says 0.8% faster.
3410 (KJS::CodeBlock::dump): Added argv and argc parameters to new_array.
3412 (KJS::Machine::privateExecute): Ditto.
3414 * VM/CodeGenerator.cpp:
3415 (KJS::CodeGenerator::emitNewArray): Added.
3416 * VM/CodeGenerator.h: Added ElementNode* argument to emitNewArray.
3419 (KJS::ArrayNode::emitCode): Pass the ElementNode to emitNewArray so it can be
3420 initialized with as many elements as possible. If the array doesn't have any
3421 holes in it, that's all that's needed. If there are holes, then emit some separate
3422 put operations for the other values in the array and for the length as needed.
3424 * kjs/nodes.h: Added some accessors to ElementNode so the code generator can
3425 iterate through elements and generate code to evaluate them. Now ArrayNode does
3426 not need to be a friend. Also took out some unused PlacementNewAdoptType
3429 2008-06-28 Darin Adler <darin@apple.com>
3433 * kjs/nodes.h: Remove obsolete PlacementNewAdopt constructors.
3434 We no longer mutate the AST in place.
3436 2008-06-28 Jan Michael Alonzo <jmalonzo@webkit.org>
3438 Reviewed by Oliver Hunt.
3442 * VM/Machine.cpp: include stdio.h for printf
3444 2008-06-27 Sam Weinig <sam@webkit.org>
3446 Reviewed by Oliver Hunt.
3448 Fix platforms that don't use AllInOne.cpp
3450 * kjs/BooleanConstructor.h:
3451 * kjs/BooleanPrototype.h:
3452 * kjs/FunctionPrototype.cpp:
3454 2008-06-27 Sam Weinig <sam@webkit.org>
3456 Rubber-stamped by Oliver Hunt.
3458 Splits ArrayConstructor out of ArrayPrototype.h/cpp
3459 Splits BooleanConstructor and BooleanPrototype out of BooleanObject.h/cpp
3462 * JavaScriptCore.pri:
3463 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3464 * JavaScriptCore.xcodeproj/project.pbxproj:
3465 * JavaScriptCoreSources.bkl:
3467 * kjs/AllInOneFile.cpp:
3468 * kjs/ArrayConstructor.cpp: Copied from kjs/ArrayPrototype.cpp.
3469 * kjs/ArrayConstructor.h: Copied from kjs/ArrayPrototype.h.
3470 * kjs/ArrayPrototype.cpp:
3471 * kjs/ArrayPrototype.h:
3472 * kjs/BooleanConstructor.cpp: Copied from kjs/BooleanObject.cpp.
3473 * kjs/BooleanConstructor.h: Copied from kjs/BooleanObject.h.
3474 * kjs/BooleanObject.cpp:
3475 * kjs/BooleanObject.h:
3476 * kjs/BooleanPrototype.cpp: Copied from kjs/BooleanObject.cpp.
3477 * kjs/BooleanPrototype.h: Copied from kjs/BooleanObject.h.
3478 * kjs/CommonIdentifiers.h:
3479 * kjs/FunctionPrototype.cpp:
3481 * kjs/JSGlobalObject.cpp:
3482 * kjs/JSImmediate.cpp:
3486 * kjs/string_object.cpp:
3488 2008-06-27 Oliver Hunt <oliver@apple.com>
3492 Bug 18626: SQUIRRELFISH: support the "slow script" dialog <https://bugs.webkit.org/show_bug.cgi?id=18626>
3493 <rdar://problem/5973931> Slow script dialog needs to be reimplemented for squirrelfish
3495 Adds support for the slow script dialog in squirrelfish. This requires the addition
3496 of three new op codes, op_loop, op_loop_if_true, and op_loop_if_less which have the
3497 same behaviour as their simple jump equivalents but have an additional time out check.
3499 Additional assertions were added to other jump instructions to prevent accidentally
3500 creating loops with jump types that do not support time out checks.
3502 Sunspider does not report a regression, however this appears very sensitive to code
3503 layout and hardware, so i would expect up to a 1% regression on other systems.
3505 Part of this required moving the old timeout logic from JSGlobalObject and into Machine
3506 which is the cause of a number of the larger diff blocks.
3508 * JavaScriptCore.exp:
3510 (KJS::CodeBlock::dump):
3511 * VM/CodeGenerator.cpp:
3512 (KJS::CodeGenerator::emitJumpIfTrue):
3513 (KJS::CodeGenerator::emitJumpScopes):
3514 * VM/ExceptionHelpers.cpp:
3515 (KJS::InterruptedExecutionError::isWatchdogException):
3516 (KJS::createInterruptedExecutionException):
3517 * VM/ExceptionHelpers.h:
3520 (KJS::Machine::Machine):
3521 (KJS::Machine::throwException):
3522 (KJS::Machine::resetTimeoutCheck):
3523 (KJS::getCurrentTime):
3524 (KJS::Machine::checkTimeout):
3525 (KJS::Machine::privateExecute):
3527 (KJS::Machine::setTimeoutTime):
3528 (KJS::Machine::startTimeoutCheck):
3529 (KJS::Machine::stopTimeoutCheck):
3530 (KJS::Machine::initTimeout):
3534 * kjs/JSGlobalObject.cpp:
3535 (KJS::JSGlobalObject::init):
3536 (KJS::JSGlobalObject::setTimeoutTime):
3537 (KJS::JSGlobalObject::startTimeoutCheck):
3538 * kjs/JSGlobalObject.h:
3540 * kjs/interpreter.cpp:
3541 (KJS::Interpreter::evaluate):
3543 2008-06-27 Jan Michael Alonzo <jmalonzo@webkit.org>
3545 Gtk and Qt build fix: Remove RegisterFileStack from the build
3549 * JavaScriptCore.pri:
3551 2008-06-27 Adele Peterson <adele@apple.com>
3557 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3558 * VM/RegisterFile.h:
3559 (KJS::RegisterFile::RegisterFile):
3560 * kjs/JSGlobalObject.cpp:
3561 * kjs/collector.cpp:
3563 2008-06-27 Geoffrey Garen <ggaren@apple.com>
3565 Reviewed by Oliver Hunt.
3567 One RegisterFile to rule them all!
3569 SunSpider reports a 0.2% speedup.
3571 This patch removes the RegisterFileStack abstraction and replaces it with
3572 a single register file that
3574 (a) allocates a fixed storage area, including a fixed area for global
3575 vars, so that no operation may cause the register file to reallocate
3579 (b) swaps between global storage areas when executing code in different
3582 This patch also changes the layout of the register file so that all call
3583 frames, including call frames for global code, get a header. This is
3584 required to support re-entrant global code. It also just makes things simpler.
3586 * VM/CodeGenerator.cpp:
3587 (KJS::CodeGenerator::addGlobalVar): New function. Differs from addVar in
3590 (a) global vars don't contribute to a CodeBlock's numLocals count, since
3591 global storage is fixed and allocated at startup
3595 (b) references to global vars get shifted to elide intermediate stack
3596 between "r" and the global storage area.
3599 (KJS::Machine::dumpRegisters): Updated this function to match the new
3600 register file layout, and added the ability to dump exact identifiers
3601 for the different parts of a call frame.
3603 (KJS::Machine::unwindCallFrame): Updated this function to match the new
3604 register file layout.
3606 (KJS::Machine::execute): Updated this function to initialize a call frame
3607 header for global code, and to swap global storage areas when switching
3608 to execution in a new global object.
3610 (KJS::Machine::privateExecute): Got rid of "safeForReentry" and re-reading
3611 of registerBase because the register file is always safe for reentry now,
3612 and registerBase never changes.
3614 * VM/Machine.h: Moved the call frame header enum from Machine to RegisterFile,
3615 to resolve a header dependency problem (a good sign that the enum belonged
3616 in RegisterFile all along!)
3618 * VM/RegisterFile.cpp:
3619 * VM/RegisterFile.h: Changed RegisterFile to mmap a fixed size register
3620 area. This allows us to avoid re-allocting the register file later on.
3621 Instead, we rely on the OS to allocate physical pages to the register
3624 * VM/RegisterFileStack.cpp: Removed. Tada!
3625 * VM/RegisterFileStack.h: Removed. Tada!
3627 * kjs/DebuggerCallFrame.cpp: Updated this class to match the new
3628 register file layout, greatly simplifying it in the process.
3630 * kjs/JSActivation.h:
3631 * kjs/JSActivation.cpp: Moved some of this logic up to JSVariableObject,
3632 since the global object now needs to be able to tear off its registers
3633 just like the activation object.
3635 * kjs/JSFunction.cpp: No need to fiddle with the register file anymore.
3637 * kjs/JSGlobalObject.h:
3638 * kjs/JSGlobalObject.cpp: Updated JSGlobalObject to support moving its
3639 global storage area into and out of the register file.
3641 * kjs/PropertySlot.cpp: No need to fiddle with the register file anymore.
3643 * kjs/collector.cpp: Renamed markStackObjectConservatively to
3644 markConservatively, since we don't just mark stack objects this way.
3646 Also, added code to mark the machine's register file.
3648 * kjs/config.h: Moved some platforms #defines from here...
3649 * wtf/Platform.h: ...to here, to support mmap/VirtualAlloc detection
3652 2008-06-26 Mark Rowe <mrowe@apple.com>
3654 Speculative fix for the Windows build.
3656 * kjs/JSImmediate.cpp:
3658 2008-06-26 Mark Rowe <mrowe@apple.com>
3660 Reviewed by Darin Adler and Geoff Garen.
3662 Fix the malloc zone introspection functions so that malloc_zone_statistics does not give
3663 bogus output in an application that uses JavaScriptCore.
3665 * kjs/CollectorHeapIntrospector.cpp:
3666 (KJS::CollectorHeapIntrospector::statistics): Return statistics about memory allocated by the collector.
3667 * kjs/CollectorHeapIntrospector.h:
3668 * wtf/FastMalloc.cpp: Zero out the statistics. FastMalloc doesn't track this information at present.
3669 Returning zero for all values is preferable to returning bogus data.
3671 2008-06-26 Darin Adler <darin@apple.com>
3675 - https://bugs.webkit.org/show_bug.cgi?id=19721
3676 speed up JavaScriptCore by not wrapping strings in objects just
3677 to call functions on them
3679 - optimize UString append and the replace function a bit
3681 SunSpider says 1.8% faster.
3683 * JavaScriptCore.exp: Updated.
3685 * VM/JSPropertyNameIterator.cpp: Added include of JSString.h, now needed
3686 because jsString returns a JSString*.
3689 (KJS::Machine::privateExecute): Removed the toObject call from native
3690 function calls. Also removed code to put the this value into a register.
3692 * kjs/BooleanObject.cpp:
3693 (KJS::booleanProtoFuncToString): Rewrite to handle false and true
3696 * kjs/FunctionPrototype.cpp:
3697 (KJS::constructFunction): Use single-character append rather than building
3698 a string for each character.
3699 * kjs/JSFunction.cpp:
3700 (KJS::globalFuncUnescape): Ditto.
3702 * kjs/JSImmediate.cpp:
3703 (KJS::JSImmediate::prototype): Added. Gets the appropriate prototype for
3704 use with an immediate value. To be used instead of toObject when doing a
3705 get on an immediate value.
3706 * kjs/JSImmediate.h: Added prototype.
3709 (KJS::JSObject::toString): Tweaked formatting.
3712 (KJS::JSValue::get): Use prototype instead of toObject to avoid creating
3713 an object wrapper just to search for properties. This also saves an
3714 unnecessary hash table lookup since the object wrappers themselves don't
3715 have any properties.
3717 * kjs/JSString.h: Added toThisString and toThisJSString.
3720 (KJS::JSCell::toThisString): Added.
3721 (KJS::JSCell::toThisJSString): Added.
3722 (KJS::JSCell::getJSNumber): Added.
3723 (KJS::jsString): Changed return type to JSString*.
3724 (KJS::jsOwnedString): Ditto.
3727 (KJS::JSValue::toThisString): Added.
3728 (KJS::JSValue::toThisJSString): Added.
3729 (KJS::JSValue::getJSNumber): Added.
3731 * kjs/NumberObject.cpp:
3732 (KJS::NumberObject::getJSNumber): Added.
3733 (KJS::integer_part_noexp): Append C string directly rather than first
3734 turning it into a UString.
3735 (KJS::numberProtoFuncToString): Use getJSNumber to check if the value
3736 is a number rather than isObject(&NumberObject::info). This works for
3737 immediate numbers, number cells, and NumberObject instances.
3738 (KJS::numberProtoFuncToLocaleString): Ditto.
3739 (KJS::numberProtoFuncValueOf): Ditto.
3740 (KJS::numberProtoFuncToFixed): Ditto.
3741 (KJS::numberProtoFuncToExponential): Ditto.
3742 (KJS::numberProtoFuncToPrecision): Ditto.
3743 * kjs/NumberObject.h: Added getJSNumber.
3745 * kjs/PropertySlot.cpp: Tweaked comment.
3748 (KJS::JSString::toThisString): Added.
3749 (KJS::JSString::toThisJSString): Added.
3750 (KJS::JSString::getOwnPropertySlot): Changed code that searches the
3751 prototype chain to start with the string prototype and not create a
3753 (KJS::JSNumberCell::toThisString): Added.
3754 (KJS::JSNumberCell::getJSNumber): Added.
3757 (KJS::staticFunctionGetter): Moved here, because there's no point in
3758 having a function that's only used for a function pointer be inline.
3759 (KJS::setUpStaticFunctionSlot): New function for getStaticFunctionSlot.
3762 (KJS::staticValueGetter): Don't mark this inline. It doesn't make sense
3763 to have a function that's only used for a function pointer be inline.
3764 (KJS::getStaticFunctionSlot): Changed to get properties from the parent
3765 first before doing any handling of functions. This is the fastest way
3766 to return the function once the initial setup is done.
3768 * kjs/string_object.cpp:
3769 (KJS::StringObject::getPropertyNames): Call value() instead of getString(),
3770 avoiding an unnecessary virtual function call (the call to the type()
3771 function in the implementation of the isString() function).
3772 (KJS::StringObject::toString): Added.
3773 (KJS::StringObject::toThisString): Added.
3774 (KJS::StringObject::toThisJSString): Added.
3775 (KJS::substituteBackreferences): Rewrote to use a appending algorithm
3776 instead of a the old one that tried to replace in place.
3777 (KJS::stringProtoFuncReplace): Merged this function and the replace function.
3778 Replaced the hand-rolled dynamic arrays for source ranges and replacements
3780 (KJS::stringProtoFuncToString): Handle JSString as well as StringObject.
3781 Removed the separate valueOf implementation, since it can just share this.
3782 (KJS::stringProtoFuncCharAt): Use toThisString, which handles JSString as
3783 well as StringObject, and is slightly more efficient than the old code too.
3784 (KJS::stringProtoFuncCharCodeAt): Ditto.
3785 (KJS::stringProtoFuncConcat): Ditto.
3786 (KJS::stringProtoFuncIndexOf): Ditto.
3787 (KJS::stringProtoFuncLastIndexOf): Ditto.
3788 (KJS::stringProtoFuncMatch): Ditto.
3789 (KJS::stringProtoFuncSearch): Ditto.
3790 (KJS::stringProtoFuncSlice): Ditto.
3791 (KJS::stringProtoFuncSplit): Ditto.
3792 (KJS::stringProtoFuncSubstr): Ditto.
3793 (KJS::stringProtoFuncSubstring): Ditto.
3794 (KJS::stringProtoFuncToLowerCase): Use toThisJSString.
3795 (KJS::stringProtoFuncToUpperCase): Ditto.
3796 (KJS::stringProtoFuncToLocaleLowerCase): Ditto.
3797 (KJS::stringProtoFuncToLocaleUpperCase): Ditto.
3798 (KJS::stringProtoFuncLocaleCompare): Ditto.
3799 (KJS::stringProtoFuncBig): Use toThisString.
3800 (KJS::stringProtoFuncSmall): Ditto.
3801 (KJS::stringProtoFuncBlink): Ditto.
3802 (KJS::stringProtoFuncBold): Ditto.
3803 (KJS::stringProtoFuncFixed): Ditto.
3804 (KJS::stringProtoFuncItalics): Ditto.
3805 (KJS::stringProtoFuncStrike): Ditto.
3806 (KJS::stringProtoFuncSub): Ditto.
3807 (KJS::stringProtoFuncSup): Ditto.
3808 (KJS::stringProtoFuncFontcolor): Ditto.
3809 (KJS::stringProtoFuncFontsize): Ditto.
3810 (KJS::stringProtoFuncAnchor): Ditto.
3811 (KJS::stringProtoFuncLink): Ditto.
3813 * kjs/string_object.h: Added toString, toThisString, and toThisJSString.
3816 (KJS::UString::append): Added a version that takes a character pointer and
3817 size, so we don't have to create a UString just to append to another UString.
3820 2008-06-26 Alexey Proskuryakov <ap@webkit.org>
3824 Make JSGlobalData per-thread.
3826 No change on SunSpider total.
3828 * wtf/ThreadSpecific.h: Re-enabled the actual implementation.
3830 * kjs/JSGlobalObject.cpp:
3831 (KJS::JSGlobalObject::~JSGlobalObject): Re-added a JSLock-related assertion. We'll probably
3832 want to preserve these somehow to keep legacy behavior in working condition.
3833 (KJS::JSGlobalObject::init): Initialize globalData pointer earlier, so that it is ready
3834 when updating JSGlobalObject linked list.
3836 * kjs/JSGlobalObject.h: (KJS::JSGlobalObject::head): Changed head() to be non-static, and
3837 to use JSGlobalData associated with the current object.
3839 * kjs/InitializeThreading.cpp: (KJS::initializeThreadingOnce): Removed a no longer needed
3840 Heap::registerAsMainThread() call.
3842 * kjs/JSGlobalData.h: Removed a lying lie comment - parserObjectExtraRefCounts is not
3843 transient, and while newParserObjects may conceptually be such, there is still some node
3844 manipulation going on outside Parser::parse which touches it.
3846 * kjs/JSGlobalData.cpp:
3847 (KJS::JSGlobalData::~JSGlobalData): Delete recently added members.
3848 (KJS::JSGlobalData::sharedInstance): Actually use a separate instance.
3850 * kjs/collector.cpp:
3852 (KJS::Heap::~Heap): Added a destructor, which unconditionally deletes everything.
3853 (KJS::Heap::sweep): Removed code related to "collect on main thread only" logic.
3854 (KJS::Heap::collect): Ditto.
3855 (KJS::Heap::globalObjectCount): Explicitly use per-thread instance of JSGlobalObject linked
3856 list now that JSGlobalObject::head() is not static. Curently, WebCoreStatistics methods only
3857 work with the main thread currently anyway.
3858 (KJS::Heap::protectedGlobalObjectCount): Ditto.
3860 * kjs/collector.h: Removed code related to "collect on main thread only" logic.
3862 * JavaScriptCore.exp: Removed Heap::collectOnMainThreadOnly.
3864 2008-06-26 Alexey Proskuryakov <ap@webkit.org>
3868 https://bugs.webkit.org/show_bug.cgi?id=19767
3869 REGRESSION: Crash in sort() when visiting http://www.onnyturf.com/subway/
3871 * kjs/JSArray.cpp: (KJS::AVLTreeAbstractorForArrayCompare::set_balance_factor):
3872 Made changing balance factor from -1 to +1 work correctly.
3874 * wtf/AVLTree.h: (KJS::AVLTreeDefaultBSet::operator[]): Added an assertion that catches
3875 this slightly earlier.
3877 2008-06-25 Timothy Hatcher <timothy@apple.com>
3879 Fixes an ASSERT in the profiler when starting multiple profiles
3880 with the same name inside the same function/program.
3882 Reviewed by Kevin McCullough.
3884 * profiler/Profile.cpp:
3885 (KJS::Profile::Profile): Initialize m_stoppedCallDepth to zero.
3886 (KJS::Profile::stopProfiling): Set the current node to the parent,
3887 because we are in a call that will not get a didExecute call.
3888 (KJS::Profile::removeProfile): Increment m_stoppedCallDepth to
3889 account for didExecute not being called for profile.
3890 (KJS::Profile::willExecute): Increment m_stoppedCallDepth if stopped.
3891 (KJS::Profile::didExecute): Decrement m_stoppedCallDepth if stopped and
3892 greater than zero, and return early.
3893 * profiler/Profile.h: Added stoppedProfiling().
3894 * profiler/Profiler.cpp:
3895 (KJS::Profiler::findProfile): Removed.
3896 (KJS::Profiler::startProfiling): Don't return early for stopped profiles.
3897 (KJS::Profiler::stopProfiling): Skipp stopped profiles.
3898 (KJS::Profiler::didFinishAllExecution): Code clean-up.
3899 * profiler/Profiler.h: Removed findProfile.
3901 2008-06-25 Cameron Zwarich <cwzwarich@uwaterloo.ca>
3903 Reviewed by Alexey Proskuryakov.
3905 Attempt to fix Windows debug build. The compiler gives a warning when
3906 Structured Exception Handling and destructors are used in the same
3907 function. Using manual locking and unlocking instead of constructors
3908 and destructors should fix the warning.
3913 2008-06-25 Alexey Proskuryakov <ap@webkit.org>
3915 Forgot to address a review comment about better names for tracked objects, doing it now.
3917 * kjs/JSGlobalData.cpp:
3918 (KJS::JSGlobalData::JSGlobalData):
3919 * kjs/JSGlobalData.h:
3921 (KJS::ParserRefCounted::ParserRefCounted):
3922 (KJS::ParserRefCounted::ref):
3923 (KJS::ParserRefCounted::deref):
3924 (KJS::ParserRefCounted::hasOneRef):
3925 (KJS::ParserRefCounted::deleteNewObjects):
3927 2008-06-25 Alexey Proskuryakov <ap@webkit.org>
3931 Remove more threadInstance() calls.
3933 * kjs/JSFunction.cpp:
3934 (KJS::JSFunction::getParameterName):
3935 (KJS::IndexToNameMap::unMap):
3936 (KJS::Arguments::deleteProperty):
3938 Access nullIdentifier without going to thread specific storage.
3940 * JavaScriptCore.exp:
3941 * kjs/JSGlobalData.cpp:
3942 (KJS::JSGlobalData::JSGlobalData):
3943 * kjs/JSGlobalData.h:
3945 (KJS::Parser::parse):
3947 (KJS::ParserRefCountedData::ParserRefCountedData):
3948 (KJS::Parser::parse):
3951 (KJS::ParserRefCounted::ParserRefCounted):
3952 (KJS::ParserRefCounted::ref):
3953 (KJS::ParserRefCounted::deref):
3954 (KJS::ParserRefCounted::hasOneRef):
3955 (KJS::ParserRefCounted::deleteNewObjects):
3957 (KJS::StatementNode::StatementNode):
3958 (KJS::BreakpointCheckStatement::BreakpointCheckStatement):
3959 (KJS::ConstDeclNode::ConstDeclNode):
3960 (KJS::BlockNode::BlockNode):
3961 (KJS::ForInNode::ForInNode):
3962 (KJS::ScopeNode::ScopeNode):
3963 (KJS::ProgramNode::ProgramNode):
3964 (KJS::ProgramNode::create):
3965 (KJS::EvalNode::EvalNode):
3966 (KJS::EvalNode::create):
3967 (KJS::FunctionBodyNode::FunctionBodyNode):
3968 (KJS::FunctionBodyNode::create):
3970 (KJS::ExpressionNode::):
3972 (KJS::BooleanNode::):
3973 (KJS::NumberNode::):
3974 (KJS::ImmediateNumberNode::):
3975 (KJS::StringNode::):
3976 (KJS::RegExpNode::):
3978 (KJS::ResolveNode::):
3979 (KJS::ElementNode::):
3981 (KJS::PropertyNode::):
3982 (KJS::PropertyListNode::):
3983 (KJS::ObjectLiteralNode::):
3984 (KJS::BracketAccessorNode::):
3985 (KJS::DotAccessorNode::):
3986 (KJS::ArgumentListNode::):
3987 (KJS::ArgumentsNode::):
3988 (KJS::NewExprNode::):
3989 (KJS::EvalFunctionCallNode::):
3990 (KJS::FunctionCallValueNode::):
3991 (KJS::FunctionCallResolveNode::):
3992 (KJS::FunctionCallBracketNode::):
3993 (KJS::FunctionCallDotNode::):
3994 (KJS::PrePostResolveNode::):
3995 (KJS::PostIncResolveNode::):
3996 (KJS::PostDecResolveNode::):
3997 (KJS::PostfixBracketNode::):
3998 (KJS::PostIncBracketNode::):
3999 (KJS::PostDecBracketNode::):
4000 (KJS::PostfixDotNode::):
4001 (KJS::PostIncDotNode::):
4002 (KJS::PostDecDotNode::):
4003 (KJS::PostfixErrorNode::):
4004 (KJS::DeleteResolveNode::):
4005 (KJS::DeleteBracketNode::):
4006 (KJS::DeleteDotNode::):
4007 (KJS::DeleteValueNode::):
4009 (KJS::TypeOfResolveNode::):
4010 (KJS::TypeOfValueNode::):
4011 (KJS::PreIncResolveNode::):
4012 (KJS::PreDecResolveNode::):
4013 (KJS::PrefixBracketNode::):
4014 (KJS::PreIncBracketNode::):
4015 (KJS::PreDecBracketNode::):
4016 (KJS::PrefixDotNode::):
4017 (KJS::PreIncDotNode::):
4018 (KJS::PreDecDotNode::):
4019 (KJS::PrefixErrorNode::):
4020 (KJS::UnaryOpNode::UnaryOpNode):
4021 (KJS::UnaryPlusNode::):
4022 (KJS::NegateNode::):
4023 (KJS::BitwiseNotNode::):
4024 (KJS::LogicalNotNode::):
4025 (KJS::BinaryOpNode::BinaryOpNode):
4026 (KJS::ReverseBinaryOpNode::ReverseBinaryOpNode):
4032 (KJS::LeftShiftNode::):
4033 (KJS::RightShiftNode::):
4034 (KJS::UnsignedRightShiftNode::):
4036 (KJS::GreaterNode::):
4037 (KJS::LessEqNode::):
4038 (KJS::GreaterEqNode::):
4039 (KJS::InstanceOfNode::):
4042 (KJS::NotEqualNode::):
4043 (KJS::StrictEqualNode::):
4044 (KJS::NotStrictEqualNode::):
4045 (KJS::BitAndNode::):
4047 (KJS::BitXOrNode::):
4048 (KJS::LogicalAndNode::):
4049 (KJS::LogicalOrNode::):
4050 (KJS::ConditionalNode::):
4051 (KJS::ReadModifyResolveNode::):
4052 (KJS::AssignResolveNode::):
4053 (KJS::ReadModifyBracketNode::):
4054 (KJS::AssignBracketNode::):
4055 (KJS::AssignDotNode::):
4056 (KJS::ReadModifyDotNode::):
4057 (KJS::AssignErrorNode::):
4059 (KJS::VarDeclCommaNode::):
4060 (KJS::ConstStatementNode::):
4061 (KJS::SourceElements::SourceElements):
4062 (KJS::EmptyStatementNode::):
4063 (KJS::DebuggerStatementNode::):
4064 (KJS::ExprStatementNode::):
4065 (KJS::VarStatementNode::):
4067 (KJS::IfElseNode::):
4068 (KJS::DoWhileNode::):
4071 (KJS::ContinueNode::):
4073 (KJS::ReturnNode::):
4078 (KJS::ParameterNode::):
4079 (KJS::FuncExprNode::):
4080 (KJS::FuncDeclNode::):
4081 (KJS::CaseClauseNode::):
4082 (KJS::ClauseListNode::):
4083 (KJS::CaseBlockNode::):
4084 (KJS::SwitchNode::):
4085 Changed ParserRefCounted to hold a JSGlobalData pointer, and used it to replace
4086 threadInstance calls.
4088 2008-06-24 Cameron Zwarich <cwzwarich@uwaterloo.ca>
4090 Reviewed by Alexey Proskuryakov.
4092 Make the JavaScript shell collect the heap from main() instead of
4093 jscmain() to suppress leak messages in debug builds.
4099 2008-06-24 Cameron Zwarich <cwzwarich@uwaterloo.ca>
4103 Make the conversion of the pair (less, jtrue) to jless use register
4104 reference counting information for safety instead of requiring callers
4105 to decide whether it is safe.
4107 No changes on SunSpider codegen.
4109 * VM/CodeGenerator.cpp:
4110 (KJS::CodeGenerator::emitJumpIfTrue):
4111 * VM/CodeGenerator.h:
4113 (KJS::DoWhileNode::emitCode):
4114 (KJS::WhileNode::emitCode):
4115 (KJS::ForNode::emitCode):
4116 (KJS::CaseBlockNode::emitCodeForBlock):
4118 2008-06-24 Kevin McCullough <kmccullough@apple.com>
4122 <rdar://problem/6031594> JSProfiler: Profiler goes into an infinite
4124 <rdar://problem/6031603> JSProfiler: Profiler asserts in debug and
4125 give the wrong times in release
4127 Fixed two issues found by Tim in the same test.
4129 * profiler/Profile.cpp:
4130 (KJS::Profile::removeProfileStart): No longer take profile's time from
4131 all ancestors, but instead attribute it to its parent. Also add an
4132 Assert to ensure we only delete the child we mean to.
4133 (KJS::Profile::removeProfileEnd): Ditto for profileEnd.
4134 (KJS::Profile::didExecute): Cleaned up the execution order and correctly
4135 attribute all of the parent's time to the new node.
4136 * profiler/ProfileNode.cpp: If this node does not have a startTime it
4137 should not get a giant total time, but instead be 0.
4138 (KJS::ProfileNode::endAndRecordCall):
4139 * profiler/ProfileNode.h:
4140 (KJS::ProfileNode::removeChild): Should reset the sibling pointers since
4141 one of them has been removed.
4143 2008-06-24 Darin Adler <darin@apple.com>
4145 Reviewed by Cameron.
4147 - fix https://bugs.webkit.org/show_bug.cgi?id=19739
4148 REGRESSION: fast/js/property-getters-and-setters.html fails
4151 (KJS::JSObject::put): Remove an untested optimization I checked in by accident.
4152 The two loops up the prototype chain both need to start from this; instead the
4153 second loop was starting where the first loop left off.
4155 2008-06-24 Steve Falkenburg <sfalken@apple.com>
4161 2008-06-24 Joerg Bornemann <joerg.bornemann@trolltech.com>