1 2008-08-06 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
3 Reviewed by Darin. Landed by Cameron.
5 Bug 20272: typo in JavaScriptCore
6 <https://bugs.webkit.org/show_bug.cgi?id=20272>
8 Correct the documentation for op_not. (typo)
12 (KJS::Machine::privateExecute):
14 2008-08-06 Cameron Zwarich <cwzwarich@webkit.org>
18 Bug 20286: Load constants all at once instead of using op_load
19 <https://bugs.webkit.org/show_bug.cgi?id=20286>
21 Load constants all at once into temporary registers instead of using
22 individual instances of op_load.
24 This is a 2.6% speedup on SunSpider.
28 (KJS::CodeBlock::dump):
29 (KJS::CodeBlock::mark):
31 * VM/CodeGenerator.cpp:
32 (KJS::CodeGenerator::CodeGenerator):
33 (KJS::CodeGenerator::newTemporary):
34 (KJS::CodeGenerator::addConstant):
35 (KJS::CodeGenerator::addUnexpectedConstant):
36 (KJS::CodeGenerator::emitLoad):
37 (KJS::CodeGenerator::emitUnexpectedLoad):
38 (KJS::CodeGenerator::emitNewError):
41 (KJS::slideRegisterWindowForCall):
42 (KJS::Machine::unwindCallFrame):
43 (KJS::Machine::throwException):
44 (KJS::Machine::execute):
45 (KJS::Machine::privateExecute):
49 (KJS::RegisterID::RegisterID):
50 (KJS::RegisterID::makeConstant):
51 (KJS::RegisterID::isTemporary):
54 (KJS::Parser::didFinishParsing):
59 (KJS::NullNode::emitCode):
60 (KJS::BooleanNode::emitCode):
61 (KJS::NumberNode::emitCode):
62 (KJS::StringNode::emitCode):
63 (KJS::ArrayNode::emitCode):
64 (KJS::DeleteResolveNode::emitCode):
65 (KJS::DeleteValueNode::emitCode):
66 (KJS::VoidNode::emitCode):
67 (KJS::ConstDeclNode::emitCodeSingle):
68 (KJS::ReturnNode::emitCode):
69 (KJS::ScopeNode::ScopeNode):
70 (KJS::ProgramNode::ProgramNode):
71 (KJS::ProgramNode::create):
72 (KJS::EvalNode::EvalNode):
73 (KJS::EvalNode::create):
74 (KJS::FunctionBodyNode::FunctionBodyNode):
75 (KJS::FunctionBodyNode::create):
76 (KJS::FunctionBodyNode::emitCode):
78 (KJS::ScopeNode::neededConstants):
80 2008-08-05 Maciej Stachowiak <mjs@apple.com>
84 - add fast path for immediates to % operator, as we have for many other math ops
86 This fixes handling for a 0 divisor relative to the last patch. Only an 0.2% speedup on SunSpider but
87 still a 1.4x win on Oliver's prime test.
90 (KJS::Machine::privateExecute):
92 2008-08-05 Cameron Zwarich <cwzwarich@uwaterloo.ca>
96 Bug 20293: Crash in JavaScript codegen for eval("const a;")
97 <https://bugs.webkit.org/show_bug.cgi?id=20293>
99 Correctly handle constant declarations in eval code with no initializer.
102 (KJS::ConstDeclNode::emitCodeSingle):
104 2008-08-05 Cameron Zwarich <cwzwarich@uwaterloo.ca>
108 Roll out r35555 because of correctness issues.
111 (KJS::Machine::privateExecute):
113 2008-08-05 Maciej Stachowiak <mjs@apple.com>
117 - add fast path for immediates to % operator, as we have for many other math ops
119 0.6% speedup on SunSpider. 1.4x speedup on a prime testing torture test that Oliver whipped up.
122 (KJS::Machine::privateExecute):
124 2008-07-31 Oliver Hunt <oliver@apple.com>
126 Reviewed by Cameron Zwarich.
128 Bug 19359: JavaScriptCore behaves differently from FF2/3 and IE when handling context in catch statement
129 <https://bugs.webkit.org/show_bug.cgi?id=19359>
131 Make our catch behave like Firefox and IE, we do this by using a StaticScopeObject
132 instead of a generic JSObject for the scope node. We still don't make use of the
133 fact that we have a static scope inside the catch block, so the internal performance
134 of the catch block is not improved, even though technically it would be possible to
138 (KJS::CodeBlock::dump):
139 * VM/CodeGenerator.cpp:
140 (KJS::CodeGenerator::emitPushNewScope):
141 * VM/CodeGenerator.h:
143 (KJS::createExceptionScope):
144 (KJS::Machine::privateExecute):
147 * kjs/JSStaticScopeObject.cpp:
148 (KJS::JSStaticScopeObject::toThisObject):
149 (KJS::JSStaticScopeObject::put):
150 * kjs/JSStaticScopeObject.h:
152 (KJS::TryNode::emitCode):
154 2008-08-02 Rob Gowin <robg@gowin.net>
156 Reviewed by Eric Seidel.
158 Added JavaScriptCore/API/WebKitAvailability to list of files in
159 javascriptcore_h_api.
163 2008-08-01 Alexey Proskuryakov <ap@webkit.org>
165 Rubber-stamped by Maciej.
167 Remove JSGlobalData::DataInstance. It was only needed when we had per-thread JSGlobalData
170 * kjs/JSGlobalData.h:
172 2008-07-31 Kevin Ollivier <kevino@theolliviers.com>
174 Second attempt at Windows/wx build fix. Instead of avoiding inclusion of windows.h,
175 use defines, etc. to avoid conflicts in each affected file. Also, change PLATFORM(WIN)
176 to PLATFORM(WIN_OS) so that other ports using Windows headers get the right impls.
178 * VM/SamplingTool.cpp:
181 2008-07-31 Anders Carlsson <andersca@apple.com>
188 * wtf/FastMalloc.cpp:
190 2008-07-31 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
194 Bug 20170: [Qt] missing namespace defines in JavaScriptCore.pro
195 <https://bugs.webkit.org/show_bug.cgi?id=20170>
197 * JavaScriptCore.pro: Added missing define.
199 2008-07-31 Alexey Proskuryakov <ap@webkit.org>
201 Rubber-stamped by Maciej.
203 Eliminate JSLock (it was already disabled, removing the stub implementaion and all
208 (JSCheckScriptSyntax):
210 * API/JSCallbackConstructor.cpp:
211 (KJS::constructJSCallback):
212 * API/JSCallbackFunction.cpp:
213 (KJS::JSCallbackFunction::call):
214 * API/JSCallbackObjectFunctions.h:
216 (KJS::::getOwnPropertySlot):
218 (KJS::::deleteProperty):
220 (KJS::::hasInstance):
222 (KJS::::getPropertyNames):
225 (KJS::::staticValueGetter):
226 (KJS::::callbackGetter):
227 * API/JSContextRef.cpp:
228 (JSGlobalContextCreateInGroup):
229 (JSGlobalContextRetain):
230 (JSGlobalContextRelease):
231 * API/JSObjectRef.cpp:
233 (JSObjectMakeFunctionWithCallback):
234 (JSObjectMakeConstructor):
235 (JSObjectMakeFunction):
236 (JSObjectHasProperty):
237 (JSObjectGetProperty):
238 (JSObjectSetProperty):
239 (JSObjectGetPropertyAtIndex):
240 (JSObjectSetPropertyAtIndex):
241 (JSObjectDeleteProperty):
242 (JSObjectCallAsFunction):
243 (JSObjectCallAsConstructor):
244 (JSObjectCopyPropertyNames):
245 (JSPropertyNameArrayRelease):
246 (JSPropertyNameAccumulatorAddName):
247 * API/JSStringRef.cpp:
249 * API/JSValueRef.cpp:
251 (JSValueIsInstanceOfConstructor):
255 (JSValueToStringCopy):
259 * ForwardingHeaders/JavaScriptCore/JSLock.h: Removed.
261 * JavaScriptCore.exp:
262 * JavaScriptCore.order:
263 * JavaScriptCore.pri:
264 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
265 * JavaScriptCore.xcodeproj/project.pbxproj:
266 * JavaScriptCoreSources.bkl:
267 * kjs/AllInOneFile.cpp:
268 * kjs/JSGlobalData.cpp:
269 (KJS::JSGlobalData::JSGlobalData):
270 * kjs/JSGlobalData.h:
271 * kjs/JSGlobalObject.cpp:
272 (KJS::JSGlobalObject::~JSGlobalObject):
273 (KJS::JSGlobalObject::init):
274 * kjs/JSLock.cpp: Removed.
275 * kjs/JSLock.h: Removed.
281 (KJS::Heap::heapAllocate):
282 (KJS::Heap::setGCProtectNeedsLocking):
283 (KJS::Heap::protect):
284 (KJS::Heap::unprotect):
285 (KJS::Heap::collect):
286 * kjs/identifier.cpp:
287 * kjs/interpreter.cpp:
288 (KJS::Interpreter::checkSyntax):
289 (KJS::Interpreter::evaluate):
291 2008-07-31 Alexey Proskuryakov <ap@webkit.org>
293 Rubber-stamped by Oliver Hunt.
295 Fix the Mac project to not display "test/" as part of file name for tests.
297 * JavaScriptCore.xcodeproj/project.pbxproj:
299 2008-07-31 Eric Seidel <eric@webkit.org>
301 Reviewed by Alexey Proskuryakov.
303 Rename USE(MULTIPLE_THREADS) to ENABLE(JSC_MULTIPLE_THREADS)
304 to better match the use/enable pattern (and better describe
305 the usage of the feature in question.)
307 I also fixed a couple other ENABLE_ macros to be pre-processor
308 definition override-able to match the rest of the ENABLE_ macros
309 since it seems to be our convention that build systems can set
310 ENABLE_ macros in Makefiles.
312 * kjs/InitializeThreading.cpp:
313 (KJS::initializeThreadingOnce):
314 * kjs/JSGlobalData.cpp:
315 (KJS::JSGlobalData::JSGlobalData):
316 (KJS::JSGlobalData::~JSGlobalData):
317 * kjs/MathObject.cpp:
321 (KJS::allocateBlock):
322 (KJS::Heap::markStackObjectsConservatively):
329 * wtf/FastMalloc.cpp:
331 * wtf/RefCountedLeakCounter.cpp:
333 2008-07-30 Eric Seidel <eric@webkit.org>
335 Reviewed by Mark Rowe.
337 Try to clean up our usage of USE(MULTIPLE_THREADS) vs. USE(PTHREADS) a little.
338 It looks like JSC assumes that if MULTIPLE_THREADS is defined, then pthreads will always be available
339 I'm not sure that's always the case for gtk, certainly not for Windows. We should eventually go back
340 and fix wtf/Threading.h to cover all these cases some day.
346 2008-07-30 Eric Seidel <eric@webkit.org>
350 MSVC warns when structs are called classes or vice versa.
351 Make all the source refer to JSGlobalData as a class.
353 * kjs/CommonIdentifiers.h:
354 * kjs/JSGlobalData.h:
358 2008-07-30 Alexey Proskuryakov <ap@webkit.org>
360 Reviewed by Geoff Garen.
362 Add consistency checks to UString to document and enforce its design.
365 (KJS::UString::Rep::create):
366 (KJS::UString::Rep::destroy):
367 (KJS::UString::Rep::checkConsistency):
368 (KJS::UString::expandCapacity):
369 (KJS::UString::expandPreCapacity):
370 (KJS::UString::UString):
371 (KJS::UString::spliceSubstringsWithSeparators):
372 (KJS::UString::append):
374 (KJS::UString::Rep::checkConsistency):
376 2008-07-30 Gavin Barraclough <barraclough@apple.com>
378 Reviewed by Geoff Garen.
380 Fixes for Windows and non-AllInOne file build with SamplingTool, plus review fixes.
382 * GNUmakefile.am: Adding SamplingTool.cpp to build.
383 * JavaScriptCore.exp: Export hooks to init & control SamplingTool.
384 * JavaScriptCore.pri: Adding SamplingTool.cpp to build.
385 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Adding SamplingTool.cpp to build.
386 * JavaScriptCore.xcodeproj/project.pbxproj: Adding SamplingTool.cpp to build.
387 * JavaScriptCoreSources.bkl: Adding SamplingTool.cpp to build.
388 * VM/Machine.cpp: MACHINE_SAMPLING_callingNativeFunction renamed MACHINE_SAMPLING_callingHostFunction
390 * VM/Opcode.cpp: SamplingTool moved to SamplingTool.cpp/.h, opcodeNames generated from FOR_EACH_OPCODE_ID.
392 * VM/SamplingTool.cpp: Added .cpp/.h for SamplingTool.
394 * kjs/Shell.cpp: Switched SAMPLING_TOOL_ENABLED to ENABLE_SAMPLING_TOOL.
395 * wtf/Platform.h: Added ENABLE_SAMPLING_TOOL config option.
396 * kjs/nodes.cpp: Header include to fix non-AllInOne builds.
398 2008-07-30 Ariya Hidayat <ariya.hidayat@trolltech.com>
400 Reviewed by Alexey Proskuryakov.
402 Fix compilation without multi-threading support.
407 2008-07-30 Anders Carlsson <andersca@apple.com>
409 Add WebKitAvailability.h forwarding header.
411 * ForwardingHeaders/JavaScriptCore/WebKitAvailability.h: Added.
413 2008-07-30 Anders Carlsson <andersca@apple.com>
417 * API/WebKitAvailability.h:
419 2008-07-30 Anders Carlsson <andersca@apple.com>
421 * API/WebKitAvailability.h:
422 Fix Windows (and other non-Mac builds).
424 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
425 Add WebKitAvailability.h to the project.
427 2008-07-30 Anders Carlsson <andersca@apple.com>
429 One step closer towards fixing the Windows build.
431 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
432 Make sure to copy WebKitAvailability.h
434 2008-07-29 Gavin Barraclough <barraclough@apple.com>
436 Reviewed by Geoff Garen.
438 Bug 20209: Atomize constant strings
439 <https://bugs.webkit.org/show_bug.cgi?id=20209>
441 Prevents significant performance degradation seen when a script contains multiple
442 identical strings that are used as keys to identify properties on objects.
444 No performance change on SunSpider.
446 * kjs/nodes.cpp: Atomize constant strings.
448 2008-07-30 Oliver Hunt <oliver@apple.com>
450 Reviewed by Alexey Proskuryakov.
452 <rdar://problem/6111648> JavaScript exceptions fail if the scope chain includes the global object
454 In an attempt to remove the branch I just added to KJS::depth I
455 used the existence of a Variable Object at a point in the scope
456 chain as an indicator of function or global scope activation.
457 However this assumption results in incorrect behaviour if the
458 global object is injected into the scope chain with 'with'.
463 2008-07-30 Alexey Proskuryakov <ap@webkit.org>
465 Reviewed by Geoff Garen.
467 Don't call JSGarbageCollect() on a released context.
469 * API/testapi.c: (main):
471 2008-07-29 Alexey Proskuryakov <ap@webkit.org>
473 Reviewed by Geoff Garen.
475 Implement JSContextGroup APIs to make concurrent execution possible for
476 JavaScriptCore clients.
478 This changes the behavior of JSGlobalContextCreate(), so that it now uses a private context
479 group for each context, making JSlock implicit locking unnecessary.
481 * API/JSContextRef.h:
482 * API/JSContextRef.cpp:
483 (JSContextGroupCreate):
484 (JSContextGroupRetain):
485 (JSContextGroupRelease):
486 (JSGlobalContextCreate):
487 (JSGlobalContextCreateInGroup):
488 (JSGlobalContextRelease):
490 Added new methods. JSGlobalContextCreate() calls JSGlobalContextCreateInGroup() now.
492 * API/APICast.h: (toJS): (toRef): Added converters for JSContextGroupRef.
493 * API/JSBase.cpp: (JSGarbageCollect): JSGarbageCollect(0) is now a no-op, and the passed in
494 context is actually used.
496 * API/JSBase.h: Aded a typedef for JSContextGroupRef. Updated documentation for
499 * JavaScriptCore.exp: Removed JSGlobalData::sharedInstance().
501 * kjs/JSGlobalData.cpp:
502 * kjs/JSGlobalData.h:
503 Removed support for JSGlobalData shared instance. JSGlobalData::isSharedInstance member
504 variable still remains, to be deleted in a followup patch.
506 * kjs/JSLock.cpp: (KJS::JSLock::JSLock): Disabled JSLock, to be deleted in a follow-up patch.
509 (KJS::Heap::markOtherThreadConservatively): Removed an assertion that referenced
510 JSGlobalData::sharedInstance.
512 * kjs/collector.h: Made Heap destructor public, so that JSContextRelease can use it.
514 2008-07-29 Alexey Proskuryakov <ap@webkit.org>
516 Reviewed by Geoff Garen.
518 Fix a leak of ThreadRegistrar objects.
520 As the heap is usually deleted when registered threads still exist, ThreadSpecific doesn't
521 have a chance to clean up per-thread object. Switched to native pthread calls, storing a
522 plain pointer that doesn't require cleanup.
525 (KJS::PlatformThread::PlatformThread):
526 (KJS::Heap::Thread::Thread):
529 (KJS::Heap::registerThread):
530 (KJS::Heap::unregisterThread):
533 2008-07-29 Alexey Proskuryakov <ap@webkit.org>
535 Reviewed by Sam Weinig.
537 https://bugs.webkit.org/show_bug.cgi?id=20169
538 Memory allocated with fastMalloc is freed with delete
540 * VM/JSPropertyNameIterator.cpp:
541 (KJS::JSPropertyNameIterator::invalidate): Free the array properly.
542 (KJS::JSPropertyNameIterator::~JSPropertyNameIterator): Delete the array by calling
545 2008-07-29 Mark Rowe <mrowe@apple.com>
547 Attempt to fix the Qt build.
549 * wtf/ThreadingQt.cpp: Add the extra argument to createThread.
551 2008-07-29 Adam Roben <aroben@apple.com>
553 Change Vector::find to return an index instead of an iterator
555 Indices are more natural than iterators when working with Vector.
557 Reviewed by John Sullivan.
560 (WTF::Vector::find): Changed to iterate the Vector manually and return
561 the index of the found item, rather than an iterator. When the item
562 could not be found, we return WTF::notFound.
564 2008-07-29 Adam Roben <aroben@apple.com>
568 * wtf/ThreadingWin.cpp:
569 (WTF::setThreadName): Move a misplaced assertion to here...
570 (WTF::createThread): ...from here.
572 2008-07-29 Adam Roben <aroben@apple.com>
574 Add support for setting thread names on Windows
576 These thread names make it much easier to identify particular threads
577 in Visual Studio's Threads panel.
579 WTF::createThread now takes a const char* representing the thread's
580 name. On Windows, we throw a special exception to set this string as
581 the thread's name. Other platforms do nothing with this name for now.
583 Reviewed by Anders Carlsson.
585 * JavaScriptCore.exp: Export the new version of createThread that
586 takes 3 arguments (the old one continues to be exported for backward
588 * wtf/Threading.h: Add a threadName argument to createThread.
590 * wtf/ThreadingGtk.cpp:
592 * wtf/ThreadingNone.cpp:
594 Updated for function signature change.
596 * wtf/ThreadingPthreads.cpp:
597 (WTF::createThread): Updated for function signature change. We keep
598 around the old 2-argument version of createThread for backward
601 * wtf/ThreadingWin.cpp:
602 (WTF::setThreadName): Added. This function's implementation came from
604 (WTF::initializeThreading): Set the name of the main thread.
605 (WTF::createThread): Call setThreadName. We keep around the old
606 2-argument version of createThread for backward compatibility.
608 2008-07-29 Alexey Proskuryakov <ap@webkit.org>
610 Reviewed by Oliver Hunt.
612 Store UString::Rep::isStatic bit in identifierTable pointer instead of reportedCost for
613 slightly nicer code and a 0.5% SunSpider improvement.
615 * API/JSClassRef.cpp:
616 (OpaqueJSClass::~OpaqueJSClass):
617 (OpaqueJSClassContextData::OpaqueJSClassContextData):
618 * API/JSStringRef.cpp:
620 * kjs/PropertyNameArray.cpp:
621 (KJS::PropertyNameArray::add):
622 * kjs/identifier.cpp:
623 (KJS::IdentifierTable::~IdentifierTable):
624 (KJS::IdentifierTable::add):
625 (KJS::Identifier::addSlowCase):
626 (KJS::Identifier::remove):
628 (KJS::Identifier::add):
631 (KJS::UString::Rep::create):
632 (KJS::UString::Rep::destroy):
634 (KJS::UString::Rep::identifierTable):
635 (KJS::UString::Rep::setIdentifierTable):
636 (KJS::UString::Rep::isStatic):
637 (KJS::UString::Rep::setStatic):
638 (KJS::UString::cost):
640 2008-07-28 Geoffrey Garen <ggaren@apple.com>
642 Reviewed by Sam Weinig.
644 Renamed "ConstructTypeNative" => "ConstructTypeHost".
646 2008-07-26 Mark Rowe <mrowe@apple.com>
648 Speculative fix for the wx build.
650 * JavaScriptCoreSources.bkl: Add JSStaticScopeObject.cpp to the list of source files.
652 2008-07-25 Oliver Hunt <oliver@apple.com>
656 Whoops, forgot to save style correction.
658 * kjs/JSStaticScopeObject.h:
660 2008-07-25 Oliver Hunt <oliver@apple.com>
662 Reviewed by Cameron Zwarich.
664 Bug 19718: Named anonymous functions are slow accessing global variables
665 <https://bugs.webkit.org/show_bug.cgi?id=19718>
667 To fix this we switch over to an activation-like scope object for
668 on which we attach the function name property, and add logic to
669 prevent cross scope assignment to read only properties.
672 * JavaScriptCore.pri:
673 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
674 * JavaScriptCore.xcodeproj/project.pbxproj:
675 * VM/CodeGenerator.cpp:
676 (KJS::CodeGenerator::findScopedProperty):
677 (KJS::CodeGenerator::emitResolve):
678 * VM/CodeGenerator.h:
679 * kjs/AllInOneFile.cpp:
680 * kjs/JSStaticScopeObject.cpp: Added.
681 (KJS::JSStaticScopeObject::putWithAttributes):
682 (KJS::JSStaticScopeObject::isDynamicScope):
683 (KJS::JSStaticScopeObject::~JSStaticScopeObject):
684 (KJS::JSStaticScopeObject::getOwnPropertySlot):
685 * kjs/JSStaticScopeObject.h: Added.
686 (KJS::JSStaticScopeObject::JSStaticScopeObjectData::JSStaticScopeObjectData):
687 (KJS::JSStaticScopeObject::JSStaticScopeObject):
689 (KJS::FunctionCallResolveNode::emitCode):
690 (KJS::PostfixResolveNode::emitCode):
691 (KJS::PrefixResolveNode::emitCode):
692 (KJS::ReadModifyResolveNode::emitCode):
693 (KJS::AssignResolveNode::emitCode):
694 (KJS::FuncExprNode::makeFunction):
696 2008-07-25 kevino <kevino@theolliviers.com>
698 wx build fix for Win.
700 On wx/Win, including windows.h in Threading.h causes multiply-defined symbol errors
701 for libjpeg and wx, and also wx needs to include windows.h itself first for wx
702 includes to work right. So until we can find a better solution to this problem,
703 on wx, we work around the need to include windows.h here.
707 2008-07-25 Adam Roben <aroben@apple.com>
711 * JavaScriptCore.vcproj/testapi/testapi.vcproj: Add API/ to the
714 2008-07-25 Simon Hausmann <hausmann@webkit.org>
716 Fix the build of jsc on Qt/Windows, make sure os-win32 is in the
717 include search path (added by WebKit.pri).
721 2008-07-25 Alexey Proskuryakov <ap@webkit.org>
723 Reviewed by Simon Hausmann.
725 Move JavaScriptCore API tests into a subdirectory of their own to avoid header name
726 conflicts and developer confusion.
728 * API/JSNode.c: Removed.
729 * API/JSNode.h: Removed.
730 * API/JSNodeList.c: Removed.
731 * API/JSNodeList.h: Removed.
732 * API/Node.c: Removed.
733 * API/Node.h: Removed.
734 * API/NodeList.c: Removed.
735 * API/NodeList.h: Removed.
736 * API/minidom.c: Removed.
737 * API/minidom.html: Removed.
738 * API/minidom.js: Removed.
739 * API/testapi.c: Removed.
740 * API/testapi.js: Removed.
742 * API/tests/JSNode.c: Copied from JavaScriptCore/API/JSNode.c.
743 * API/tests/JSNode.h: Copied from JavaScriptCore/API/JSNode.h.
744 * API/tests/JSNodeList.c: Copied from JavaScriptCore/API/JSNodeList.c.
745 * API/tests/JSNodeList.h: Copied from JavaScriptCore/API/JSNodeList.h.
746 * API/tests/Node.c: Copied from JavaScriptCore/API/Node.c.
747 * API/tests/Node.h: Copied from JavaScriptCore/API/Node.h.
748 * API/tests/NodeList.c: Copied from JavaScriptCore/API/NodeList.c.
749 * API/tests/NodeList.h: Copied from JavaScriptCore/API/NodeList.h.
750 * API/tests/minidom.c: Copied from JavaScriptCore/API/minidom.c.
751 * API/tests/minidom.html: Copied from JavaScriptCore/API/minidom.html.
752 * API/tests/minidom.js: Copied from JavaScriptCore/API/minidom.js.
753 * API/tests/testapi.c: Copied from JavaScriptCore/API/testapi.c.
754 * API/tests/testapi.js: Copied from JavaScriptCore/API/testapi.js.
756 * JavaScriptCore.vcproj/testapi/testapi.vcproj:
757 * JavaScriptCore.xcodeproj/project.pbxproj:
759 2008-07-25 Simon Hausmann <hausmann@webkit.org>
761 Prospective WX build fix, add JavaScriptCore/API to the include search
766 2008-07-25 Simon Hausmann <hausmann@webkit.org>
768 Rubber-stamped by Lars.
770 Fix the build on Windows. operator new for ArgList is implemented using fastMalloc()
771 but operator delete was not implemented. Unfortunately MSVC decides to call/reference
772 the function, so a simple implementation using fastFree() fixes the build.
775 (KJS::ArgList::operator delete):
777 2008-07-25 Simon Hausmann <hausmann@webkit.org>
779 Discussed with and rubber-stamped by Lars.
781 Fix the build system for the Qt port.
783 Recent JavaScriptCore changes require the addition of JavaScriptCore/API to the
784 include search path. With a build process that combines JavaScriptCore and
785 WebCore in one build process/Makefile the existance of
786 JavaScriptCore/API/Node.h and WebCore/dom/Node.h causes include conflicts.
788 This commit solves this by introducing a separate build of JavaScriptCore into
791 As a result of the split-up a race-condition due to broken dependencies of
792 regular source files to header files of generated sources showed up very
793 frequently when doing parallel builds (which the buildbot does). This commit at
794 the same time tries to address the dependency problem by making the
795 addExtraCompiler() function also generate a pseudo extra compiler that
796 represents the header file output, so that qmake is aware of the creation of
797 the header file for dependency calculation.
799 At the same time I removed a lot of cruft from the pro files to ease maintenance.
801 * JavaScriptCore.pri:
802 * JavaScriptCore.pro: Added.
805 2008-07-24 Geoffrey Garen <ggaren@apple.com>
807 Reviewed by Maciej Stachowiak.
809 Fixed a strict aliasing violation, which caused hash tables with floating
810 point keys not to find items that were indeed in the tables
811 (intermittently, and only in release builds, of course).
813 SunSpider reports no change.
815 This bug doesn't seem to affect any existing code, but it causes obvious
816 crashes in some new code I'm working on.
818 * wtf/HashFunctions.h:
819 (WTF::FloatHash::hash): Use a union when punning between a float / double
820 and an unsigned (bucket of bits). With strict aliasing enabled, unions
821 are the only safe way to do this kind of type punning.
823 * wtf/HashTable.h: When rehashing, ASSERT that the item we just added to
824 the table is indeed in the table. In the buggy case described above, this
827 2008-07-24 Oliver Hunt <oliver@apple.com>
829 Reviewed by Alexey Proskuryakov.
831 Bug 20142: REGRESSION(r35245): /=/ weirdness
832 <https://bugs.webkit.org/show_bug.cgi?id=20142>
834 When adding all the meta data needed for exception error messages
835 I accidentally clobbered the handling of regex beginning with /=.
839 2008-07-23 Alp Toker <alp@nuanti.com>
841 Build fix after r35293: Add API/ to the include path.
845 2008-07-23 Adam Roben <aroben@apple.com>
849 Build fix after r35293:
851 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add API/
854 Build fix after r35305:
860 Completely compile out all sampler-related code when
861 SAMPLING_TOOL_ENABLED is 0. The sampler code can't be compiled 1) on
862 non-AllInOne configurations due to circular header dependencies, and
863 2) on platforms that don't have a usleep() function, such as Windows.
865 2008-07-23 Oliver Hunt <oliver@apple.com>
867 Reviewed by Geoff Garen and Sam Weinig.
869 Improve switch performance.
871 Improve switch performance by converting to a hashmap based jump
872 table to avoid the sequence of dispatches that would otherwise be
873 needed. This results in a 9-19x performance win for string switches
874 based on ad hoc testing, and a 6x improvement for integer switch
875 statements. SunSpider reports a 1.2% progression.
878 (KJS::CodeBlock::dump):
879 (KJS::SimpleJumpTable::offsetForValue):
881 * VM/CodeGenerator.cpp:
882 (KJS::CodeGenerator::beginSwitch):
883 (KJS::prepareJumpTableForImmediateSwitch):
884 (KJS::prepareJumpTableForCharacterSwitch):
885 (KJS::prepareJumpTableForStringSwitch):
886 (KJS::CodeGenerator::endSwitch):
887 * VM/CodeGenerator.h:
889 (KJS::offsetForStringSwitch):
890 (KJS::Machine::privateExecute):
897 (KJS::processClauseList):
898 (KJS::CaseBlockNode::tryOptimisedSwitch):
899 (KJS::CaseBlockNode::emitCodeForBlock):
903 2008-07-23 Gavin Barraclough <barraclough@apple.com>
905 Reviewed by Geoff Garen.
907 Sampling tool to analyze cost of instruction execution and identify hot regions of JS code.
908 Enable Switches by setting SAMPLING_TOOL_ENABLED in Opcode.h.
910 * JavaScriptCore.exp: Export symbols for Shell.cpp.
911 * VM/Machine.cpp: Added sampling hooks.
912 * VM/Machine.h: Machine contains a pointer to a sampler, when sampling.
913 * VM/Opcode.cpp: Tool implementation.
914 * VM/Opcode.h: Tool declaration.
915 * kjs/Shell.cpp: Initialize the sampler, if enabled.
916 * kjs/nodes.cpp: Added sampling hooks.
918 2008-07-23 Gabor Loki <loki@inf.u-szeged.hu>
920 Bug 20097: [Qt] 20% Sunspider slow-down
922 <https://bugs.webkit.org/show_bug.cgi?id=20097>
924 Reviewed by Simon Hausmann.
926 * kjs/jsc.pro: Added missing NDEBUG define for release builds.
928 2008-07-23 Alexey Proskuryakov <ap@webkit.org>
930 Reviewed by Geoff Garen.
932 JSClassRef is created context-free, but gets infatuated with the first context it sees.
934 The implicit API contract is that JSClassRef can be used with any context on any thread.
935 This no longer worked, because UStrings in the class were turned into per-context
936 identifiers, and the cached JSObject prototype was tied to JSGlobalData, too.
938 * API/JSClassRef.h: Made a separate struct for context-dependent parts of OpaqueJSClass.
939 * API/JSClassRef.cpp:
940 (OpaqueJSClass::OpaqueJSClass): Updated for renames and changed member variable order.
941 (OpaqueJSClass::~OpaqueJSClass): Assert that string members are not identifiers.
942 (clearReferenceToPrototype): Update for the new reference location.
943 (OpaqueJSClassContextData::OpaqueJSClassContextData): Make a deep copy of all strings.
944 (OpaqueJSClass::contextData): Added a function that finds the per-context part of
945 OpaqueJSClass in JSGlobalData, or creates it if not found.
946 (OpaqueJSClass::className): Always make a deep copy. Callers of this function do not have
947 a way to access JSGlobalData, so a per-context copy could not be made.
948 (OpaqueJSClass::staticValues): Updated for new data location.
949 (OpaqueJSClass::staticFunctions): Ditto.
950 (OpaqueJSClass::prototype): Changed to take an internal type for consistency.
952 * kjs/JSGlobalData.cpp:
953 (KJS::JSGlobalData::JSGlobalData):
954 (KJS::JSGlobalData::~JSGlobalData):
955 * kjs/JSGlobalData.h:
956 Keep a HashMap to access per-context JSClass data given a pointr to the shared part.
958 * API/JSCallbackObjectFunctions.h:
960 (KJS::::getOwnPropertySlot):
962 (KJS::::deleteProperty):
963 (KJS::::getPropertyNames):
964 (KJS::::staticValueGetter):
965 (KJS::::staticFunctionGetter):j
966 Use function accessors instead of accessing OpaqueJSClass members directly.
968 * API/JSContextRef.cpp: (JSGlobalContextCreate): Updated for the change in
969 OpaqueJSClass::prototype() argument type.
971 * API/JSObjectRef.cpp:
972 (JSObjectMake): Updated for the change in OpaqueJSClass::prototype() argument type.
973 (JSObjectMakeConstructor): Ditto.
975 2008-07-23 Alexey Proskuryakov <ap@webkit.org>
979 * kjs/ArgList.h: (KJS::ArgList::operator new): removed an extraneous "ArgList::" inside the
982 2008-07-22 Geoffrey Garen <ggaren@apple.com>
984 Reviewed by Oliver Hunt and Sam Weinig.
986 Next step toward putting doubles in registers: Prepare the Register class
987 and its clients for registers that don't contain JSValue*s.
989 This means a few things:
991 1. Register::jsValue() clients, including ArgList clients, must now supply
992 an ExecState* when accessing an entry in an ArgList, in case the entry
993 will need to create a JSValue* on the fly.
995 2. Register clients that definitely don't want to create a JSValue* on
996 the fly now use different APIs: getJSValue() for clients that know
997 the register contains a JSValue*, and v() for clients who just want a
1000 3. I had to change some headers around in order to resolve dependency
1001 problems created by using a Register in the ArgList header.
1003 SunSpider reports no change.
1005 2008-07-22 Gavin Barraclough <barraclough@apple.com>
1007 Reviewed by Alexey Proskuryakov.
1009 Prevent integer overflow when reallocating storage vector for arrays.
1011 Sunspider reports 1.005x as fast (no change expected).
1015 2008-07-21 Mark Rowe <mrowe@apple.com>
1017 Reviewed by Sam Weinig.
1019 <rdar://problem/6091287> Revamp the handling of CFBundleShortVersionString to be fixed at the major component of the version number.
1021 * Configurations/Version.xcconfig:
1024 2008-07-21 Adam Roben <aroben@apple.com>
1028 This is a convenience wrapper around std::find.
1030 Reviewed by Anders Carlsson.
1034 2008-07-19 Oliver Hunt <oliver@apple.com>
1036 Reviewed by Cameron Zwarich.
1038 Bug 20104: Exception in tables/mozilla_expected_failures/bugs/bug92868_1.html includes the equals operator in the quoted expression
1039 <https://bugs.webkit.org/show_bug.cgi?id=20104>
1041 To make this correct we make the dot and bracket assign nodes emit the information to indicate
1042 the failure range is the dot/bracket accessor.
1046 2008-07-18 Steve Falkenburg <sfalken@apple.com>
1050 * kjs/JSGlobalObjectFunctions.cpp:
1051 (KJS::isStrWhiteSpace):
1053 2008-07-18 Steve Falkenburg <sfalken@apple.com>
1058 (KJS::ThrowableExpressionData::ThrowableExpressionData):
1060 2008-07-18 Oliver Hunt <oliver@apple.com>
1062 Reviewed by Cameron Zwarich.
1064 Bug 18774: SQUIRRELFISH: print meaningful error messages <https://bugs.webkit.org/show_bug.cgi?id=18774>
1065 <rdar://problem/5769353> SQUIRRELFISH: JavaScript error messages are missing informative text
1067 Add support for decent error messages in JavaScript. This patch achieves this by providing
1068 ensuring the common errors and exceptions have messages that provide the text of expression
1069 that trigger the exception. In addition it attaches a number of properties to the exception
1070 object detailing where in the source the expression came from.
1072 * JavaScriptCore.exp:
1074 (KJS::CodeBlock::lineNumberForVPC):
1075 (KJS::CodeBlock::expressionRangeForVPC):
1076 Function to recover the expression range for an instruction
1077 that triggered an exception.
1079 (KJS::ExpressionRangeInfo::):
1080 (KJS::CodeBlock::CodeBlock):
1081 * VM/CodeGenerator.cpp:
1082 (KJS::CodeGenerator::emitCall):
1083 (KJS::CodeGenerator::emitCallEval):
1084 Emit call needed to be modified so to place the expression range info internally,
1085 as the CodeGenerator emits the arguments nodes itself, rather than the various call
1087 * VM/CodeGenerator.h:
1088 (KJS::CodeGenerator::emitExpressionInfo):
1089 Record the expression range info.
1090 * VM/ExceptionHelpers.cpp:
1091 (KJS::createErrorMessage):
1092 (KJS::createInvalidParamError):
1093 (KJS::createUndefinedVariableError):
1094 (KJS::createNotAConstructorError):
1095 (KJS::createNotAFunctionError):
1096 (KJS::createNotAnObjectErrorStub):
1097 (KJS::createNotAnObjectError):
1098 Rewrite all the code for the error messages so that they make use of the newly available
1100 * VM/ExceptionHelpers.h:
1102 (KJS::isNotObject): Now needs vPC and codeBlock
1103 (KJS::Machine::throwException):
1104 New logic to handle the NotAnObjectErrorStub and to handle the absurd "no default value" edge case
1105 (KJS::Machine::privateExecute):
1107 * kjs/DebuggerCallFrame.cpp:
1108 (KJS::DebuggerCallFrame::evaluate):
1110 (KJS::Error::create):
1112 * kjs/JSGlobalObjectFunctions.cpp:
1113 * kjs/JSImmediate.cpp:
1114 (KJS::JSImmediate::toObject):
1115 (KJS::JSImmediate::prototype):
1116 My changes to the JSNotAnObject constructor needed to be handled here.
1117 * kjs/JSNotAnObject.h:
1118 (KJS::JSNotAnObjectErrorStub::JSNotAnObjectErrorStub):
1119 (KJS::JSNotAnObjectErrorStub::isNull):
1120 (KJS::JSNotAnObjectErrorStub::isNotAnObjectErrorStub):
1121 Added a JSNotAnObjectErrorStub class to ease the handling of toObject failure exceptions,
1122 and potentially allow even more detailed error messages in future.
1125 (KJS::Parser::parse):
1126 * kjs/SourceRange.h:
1128 Large amounts of position propagation.
1130 (KJS::Lexer::Lexer):
1131 (KJS::Lexer::shift):
1133 The lexer needed a few changes to be able to correctly track token character positions.
1136 (KJS::ThrowableExpressionData::emitThrowError):
1137 (KJS::StatementNode::StatementNode):
1138 (KJS::ResolveNode::emitCode):
1139 (KJS::BracketAccessorNode::emitCode):
1140 (KJS::DotAccessorNode::emitCode):
1141 (KJS::NewExprNode::emitCode):
1142 (KJS::EvalFunctionCallNode::emitCode):
1143 (KJS::FunctionCallValueNode::emitCode):
1144 (KJS::FunctionCallResolveNode::emitCode):
1145 (KJS::FunctionCallBracketNode::emitCode):
1146 (KJS::FunctionCallDotNode::emitCode):
1147 (KJS::PostfixResolveNode::emitCode):
1148 (KJS::PostfixBracketNode::emitCode):
1149 (KJS::PostfixDotNode::emitCode):
1150 (KJS::DeleteResolveNode::emitCode):
1151 (KJS::DeleteBracketNode::emitCode):
1152 (KJS::DeleteDotNode::emitCode):
1153 (KJS::PrefixResolveNode::emitCode):
1154 (KJS::PrefixBracketNode::emitCode):
1155 (KJS::PrefixDotNode::emitCode):
1156 (KJS::ThrowableBinaryOpNode::emitCode):
1157 (KJS::ReadModifyResolveNode::emitCode):
1158 (KJS::AssignResolveNode::emitCode):
1159 (KJS::AssignDotNode::emitCode):
1160 (KJS::ReadModifyDotNode::emitCode):
1161 (KJS::AssignBracketNode::emitCode):
1162 (KJS::ReadModifyBracketNode::emitCode):
1163 (KJS::ForInNode::ForInNode):
1164 (KJS::ForInNode::emitCode):
1165 (KJS::WithNode::emitCode):
1166 (KJS::LabelNode::emitCode):
1167 (KJS::ThrowNode::emitCode):
1168 (KJS::ProgramNode::ProgramNode):
1169 (KJS::ProgramNode::create):
1170 (KJS::EvalNode::generateCode):
1171 (KJS::FunctionBodyNode::create):
1172 (KJS::FunctionBodyNode::generateCode):
1173 (KJS::ProgramNode::generateCode):
1174 All of these methods were handling the position information.
1175 Constructors and create methods were modified to store the information.
1176 All the emitCall implementations listed needed to be updated to actually
1177 record the position information we have so carefully collected.
1179 (KJS::ThrowableExpressionData::ThrowableExpressionData):
1180 (KJS::ThrowableExpressionData::setExceptionSourceRange):
1181 (KJS::ThrowableExpressionData::divot):
1182 (KJS::ThrowableExpressionData::startOffset):
1183 (KJS::ThrowableExpressionData::endOffset):
1184 (KJS::ThrowableSubExpressionData::ThrowableSubExpressionData):
1185 (KJS::ThrowableSubExpressionData::setSubexpressionInfo):
1186 (KJS::ThrowablePrefixedSubExpressionData::ThrowablePrefixedSubExpressionData):
1187 (KJS::ThrowablePrefixedSubExpressionData::setSubexpressionInfo):
1188 ThrowableExpressionData is just a uniform mechanism for storing the position
1190 (KJS::ResolveNode::):
1191 (KJS::PrePostResolveNode::):
1192 (KJS::ThrowableBinaryOpNode::):
1195 2008-07-18 Geoffrey Garen <ggaren@apple.com>
1197 Reviewed by Cameron Zwarich.
1201 "CallTypeNative" => "CallTypeHost"
1202 "code" => "byteCode"
1203 "generatedCode" => "generatedByteCode"
1205 2008-07-18 Geoffrey Garen <ggaren@apple.com>
1207 Reviewed by Oliver Hunt.
1209 Optimized <= for immediate number cases.
1211 SunSpider reports no overall change, but a 10% speedup on access-nsieve.
1213 2008-07-18 Mark Rowe <mrowe@apple.com>
1215 Rubber-stamped by Sam Weinig.
1217 Fix some casts added in a previous build fix to match the style used
1221 (KJS::Machine::initializeCallFrame):
1223 (KJS::Register::Register):
1225 2008-07-18 Landry Breuil <landry@openbsd.org>
1227 Bug 19975: [OpenBSD] Patches to enable build of WebKit
1229 <https://bugs.webkit.org/show_bug.cgi?id=19975>
1231 Reviewed by David Kilzer.
1233 Support for OpenBSD, mostly threading and libm tweaks.
1235 * kjs/collector.cpp: #include <pthread.h>
1236 (KJS::currentThreadStackBase): use pthread_stackseg_np() to get stack base
1237 * kjs/config.h: OpenBSD also provides <pthread_np.h>
1238 * wtf/MathExtras.h: #include <sys/types.h> and <machine/ieee.h>
1239 (isfinite), (signbit): as long as we don't have those functions provide fallback implementations
1240 * wtf/Platform.h: Add support for PLATFORM(OPENBSD) and PLATFORM(SPARC64) macro
1242 2008-07-17 Geoffrey Garen <ggaren@apple.com>
1244 Reviewed by Oliver Hunt.
1246 Next step toward putting doubles in registers: Store constant pool
1247 entries as registers, not JSValue*s.
1249 SunSpider reports no change.
1251 2008-07-17 Geoffrey Garen <ggaren@apple.com>
1253 Reviewed by John Sullivan and Oliver Hunt.
1255 A tiny bit of tidying in function call register allocation.
1257 This patch saves one register when invoking a function expression and/or
1258 a new expression that is stored in a temporary.
1260 Since it's just one register, I can't make a testcase for it.
1262 * VM/CodeGenerator.cpp:
1263 (KJS::CodeGenerator::emitCall): No need to ref the function we're calling
1264 or its base. We'd like the call frame to overlap with them, if possible.
1265 op_call will read the function and its base before writing the call frame,
1269 (KJS::NewExprNode::emitCode): No need to ref the function we're new-ing,
1270 for the same reasons stated above.
1272 (KJS::FunctionCallValueNode::emitCode): ditto
1274 2008-07-17 Steve Falkenburg <sfalken@apple.com>
1278 * kjs/InternalFunction.cpp:
1280 2008-07-17 Sam Weinig <sam@webkit.org>
1282 Roll out r35199 as it is causing failures on the PPC build.
1284 2008-07-17 Geoffrey Garen <ggaren@apple.com>
1286 Reviewed by David Kilzer.
1288 Fixed https://bugs.webkit.org/show_bug.cgi?id=20067
1289 Support function.name (Firefox extension)
1291 Pretty straight-forward.
1293 2008-07-17 Geoffrey Garen <ggaren@apple.com>
1295 Reviewed by Oliver Hunt.
1297 Fixed <rdar://problem/6081636> Functions calls use more temporary
1298 registers than necessary
1300 Holding a reference to the last statement result register caused each
1301 successive statement to output its result to an even higher register.
1303 Happily, statements don't actually need to return a result register
1304 at all. I hope to make this clearer in a future cleanup patch,
1305 but this change will fix the major bug for now.
1308 (KJS::statementListEmitCode):
1310 2008-07-17 Gavin Barraclough <barraclough@apple.com>
1312 Reviewed by Sam Weinig.
1314 Merge pre&post dot nodes to simplify the parse tree.
1315 Sunspider results show 0.6% progression (no performance change expected).
1320 * kjs/nodes2string.cpp:
1322 2008-07-17 Gavin Barraclough <barraclough@apple.com>
1324 Reviewed by Cameron Zwarich.
1326 Merge pre&post resolve nodes to simplify the parse tree.
1327 Sunspider results show no performance change.
1332 * kjs/nodes2string.cpp:
1334 2008-07-17 Gavin Barraclough <barraclough@apple.com>
1336 Reviewed by Cameron Zwarich.
1338 Merge logical nodes to simplify the parse tree.
1339 Sunspider results show 0.6% progression (no performance change expected).
1344 * kjs/nodes2string.cpp:
1346 2008-07-17 Ariya Hidayat <ariya.hidayat@trolltech.com>
1350 Fix MinGW build (broken in r35198) and simplify getLocalTime().
1353 (KJS::getLocalTime):
1355 2008-07-17 Gavin Barraclough <barraclough@apple.com>
1357 Reviewed by Sam Weinig.
1359 Merge pre&post bracket nodes to simplify the parse tree.
1360 Sunspider results show no performance change.
1365 * kjs/nodes2string.cpp:
1367 2008-07-17 Ariya Hidayat <ariya.hidayat@trolltech.com>
1371 Fix the 32-bit gcc builds, conversion from "long int" to Register is
1372 ambiguous. Explicitly choose the intptr_t constructor.
1375 (KJS::Machine::initializeCallFrame):
1377 (KJS::Register::Register):
1379 2008-07-16 Mark Rowe <mrowe@apple.com>
1381 Rubber-stamped by Geoff Garen.
1383 Fix JavaScript in 64-bit by using a pointer-sized integer
1384 type in the Register union. Also includes a rename of
1385 the intType constant to IntType.
1388 (KJS::Machine::initializeCallFrame):
1391 (KJS::Register::Register):
1393 2008-07-17 Geoffrey Garen <ggaren@apple.com>
1395 Reviewed by Oliver Hunt.
1397 First step toward putting doubles in registers: Turned Register into a
1398 proper abstraction layer. It is no longer possible to cast a Register
1399 to a JSValue*, or a Register& to a JSValue*&, or to access the union
1400 inside a Register directly.
1402 SunSpider reports no change.
1404 In support of this change, I had to make the following mechanical changes
1407 1. Clients now use explicit accessors to read data out of Registers, and
1408 implicit copy constructors to write data into registers.
1410 So, assignment that used to look like
1418 And access that used to look like
1426 2. I made generic flow control specific in opcodes that made their flow
1427 control generic by treating a Register& as a JSValue*&. This had the
1428 added benefit of removing some exception checking branches from immediate
1431 3. I beefed up PropertySlot to support storing a Register* in a property
1432 slot. For now, only JSVariableObject's symbolTableGet and symbolTablePut
1433 use this functionality, but I expect more clients to use it in the future.
1435 4. I changed ArgList to be a buffer of Registers, not JSValue*'s, and I
1436 changed ArgList iterator clients to iterate Registers, not JSValue*'s.
1438 2008-07-16 Ada Chan <adachan@apple.com>
1442 * kjs/JSGlobalObject.cpp:
1444 2008-07-16 Kevin McCullough <kmccullough@apple.com>
1446 Reviewed by Sam and Geoff.
1448 <rdar://problem/5958840> Navigating to another page while profiler is
1449 attached results in slow JavaScript for all time.
1451 - The UNLIKELY keeps this from being a sunspider performance regression.
1453 * kjs/JSGlobalObject.cpp:
1454 (KJS::JSGlobalObject::~JSGlobalObject): Stop the profiler associated
1455 with this exec state.
1457 2008-07-16 Sam Weinig <sam@webkit.org>
1459 Reviewed by Steve Falkenburg.
1461 Replace adopting UString constructor in favor of explicit
1462 static adopt method.
1464 * API/JSStringRefCF.cpp:
1465 (JSStringCreateWithCFString):
1466 * kjs/StringConstructor.cpp:
1467 (KJS::stringFromCharCode):
1468 * kjs/StringPrototype.cpp:
1469 (KJS::stringProtoFuncToLowerCase):
1470 (KJS::stringProtoFuncToUpperCase):
1471 (KJS::stringProtoFuncToLocaleLowerCase):
1472 (KJS::stringProtoFuncToLocaleUpperCase):
1474 (KJS::UString::adopt):
1476 (KJS::UString::UString):
1477 (KJS::UString::~UString):
1479 2008-07-16 Ariya Hidayat <ariya.hidayat@trolltech.com>
1483 http://trolltech.com/developer/task-tracker/index_html?method=entry&id=216179
1484 Fix potential crash (on Qt for Windows port) when performing JavaScript date
1488 (KJS::getLocalTime): For the Qt port, prefer to use Windows code, i.e.
1489 localtime_s() instead of localtime() since the latter might crash (on Windows)
1490 given a non-sensible, e.g. NaN, argument.
1492 2008-07-16 Alexey Proskuryakov <ap@webkit.org>
1494 Reviewed by Anders and Geoff.
1496 https://bugs.webkit.org/show_bug.cgi?id=20023
1497 Failed assertion in PropertyNameArray.cpp
1499 This is already tested by testapi.
1501 * API/JSObjectRef.cpp: (JSPropertyNameAccumulatorAddName): Add the string to identifier
1502 table to appease PropertyNameArray.
1504 2008-07-16 Alexey Proskuryakov <ap@webkit.org>
1508 Dereference identifiers when deleting a hash table (fixes leaks with private JSGlobalData
1511 * kjs/JSGlobalData.cpp: (KJS::JSGlobalData::~JSGlobalData):
1512 * kjs/lookup.cpp: (KJS::HashTable::deleteTable):
1514 * kjs/lexer.cpp: (KJS::Lexer::~Lexer)
1515 HashTable cannot have a destructor, because check-for-global-initializers complains about
1516 having a global constructor then.
1518 2008-07-16 Alexey Proskuryakov <ap@webkit.org>
1522 Check pthread_key_create return value.
1524 This check was helpful when debugging a crash in run-webkit-tests --threaded that happened
1525 because JSGlobalData objects were not deleted, and we were running out of pthread keys soon.
1526 It also looks useful for production builds.
1528 * wtf/ThreadSpecific.h: (WTF::::ThreadSpecific):
1530 2008-07-15 Kevin McCullough <kmccullough@apple.com>
1534 Rename pageGroupIdentifier to profileGroup to keep mention of a
1535 pageGroup out of JavaScriptCore.
1537 * kjs/JSGlobalObject.cpp:
1538 (KJS::JSGlobalObject::init):
1539 * kjs/JSGlobalObject.h:
1540 (KJS::JSGlobalObject::setProfileGroup):
1541 (KJS::JSGlobalObject::profileGroup):
1542 * profiler/ProfileGenerator.cpp:
1543 (KJS::ProfileGenerator::create):
1544 (KJS::ProfileGenerator::ProfileGenerator):
1545 * profiler/ProfileGenerator.h:
1546 (KJS::ProfileGenerator::profileGroup):
1547 * profiler/Profiler.cpp:
1548 (KJS::Profiler::startProfiling):
1549 (KJS::dispatchFunctionToProfiles):
1550 (KJS::Profiler::willExecute):
1551 (KJS::Profiler::didExecute):
1553 2008-07-14 Mark Rowe <mrowe@apple.com>
1555 Reviewed by Sam Weinig.
1557 Fix https://bugs.webkit.org/show_bug.cgi?id=20037
1558 Bug 20037: GCC 4.2 build broken due to strict aliasing violation.
1561 (KJS::UString::Rep::computeHash): Add a version of computeHash that takes a char* and explicit length.
1563 * profiler/CallIdentifier.h:
1564 (WTF::): Use new version of computeHash that takes a char* and explicit length to avoid unsafe aliasing.
1566 2008-07-14 David Hyatt <hyatt@apple.com>
1568 Fix a crashing bug in ListHashSet's -- operator. Make sure that end() can be -- by special-casing the null
1573 * wtf/ListHashSet.h:
1574 (WTF::ListHashSetConstIterator::operator--):
1576 2008-07-14 David Hyatt <hyatt@apple.com>
1578 Buidl fix. Make sure the second insertBefore method returns a value.
1580 * wtf/ListHashSet.h:
1581 (WTF::::insertBefore):
1583 2008-07-14 Adam Roben <aroben@apple.com>
1587 * JavaScriptCore.vcproj/jsc/jsc.vcproj: Added include/pthreads to the
1590 2008-07-14 Alexey Proskuryakov <ap@webkit.org>
1592 Reviewed by Kevin McCullough.
1594 Make JSGlobalData refcounted in preparation to adding a way to create contexts that share
1597 * JavaScriptCore.exp:
1598 * kjs/JSGlobalData.cpp:
1599 (KJS::JSGlobalData::create):
1600 * kjs/JSGlobalData.h:
1601 Made contructor private, and added a static create() method. Made the class inherit from
1604 * kjs/JSGlobalObject.h:
1605 (KJS::JSGlobalObject::globalData):
1606 JSGlobalData is now owned by JSGlobalObject (except for the shared one, and the common
1607 WebCore one, which are never deleted).
1609 * kjs/Shell.cpp: (main): Create JSGlobalData with create() method.
1611 2008-07-14 Simon Hausmann <hausmann@webkit.org>
1613 Fix the single-threaded build.
1615 * kjs/JSLock.cpp: Removed undeclared registerThread() function.
1616 * kjs/collector.cpp:
1617 (KJS::Heap::registerThread): Added dummy implementation.
1619 2008-07-14 Alexey Proskuryakov <ap@webkit.org>
1621 Reviewed by Geoff Garen.
1623 Eliminate per-thread JavaScript global data instance support and make arbitrary
1624 global data/global object combinations possible.
1626 * kjs/collector.cpp:
1627 (KJS::Heap::Heap): Store a JSGlobalData pointer instead of multiple pointers to its members.
1628 This allows for going from any JS object to its associated global data, currently used in
1629 JSGlobalObject constructor to initialize its JSGlobalData pointer.
1630 (KJS::Heap::registerThread): Changed thread registration data to be per-heap. Previously,
1631 only the shared heap could be used from multiple threads, so it was the only one that needed
1632 thread registration, but now this can happen to any heap.
1633 (KJS::Heap::unregisterThread): Ditto.
1634 (KJS::Heap::markStackObjectsConservatively): Adapt for the above changes.
1635 (KJS::Heap::setGCProtectNeedsLocking): Ditto.
1636 (KJS::Heap::protect): Ditto.
1637 (KJS::Heap::unprotect): Ditto.
1638 (KJS::Heap::collect): Ditto.
1639 (KJS::Heap::globalObjectCount): Use global object list associated with the current heap,
1640 not the late per-thread one.
1641 (KJS::Heap::protectedGlobalObjectCount): Ditto.
1644 (KJS::Heap::ThreadRegistrar): Added a helper object that unregisters a thread when it is
1648 (KJS::JSLock::JSLock):
1650 (KJS::JSLock::JSLock):
1651 Don't use JSLock to implicitly register threads. I've added registerThread() calls to most
1652 places that use JSLock - we cannot guarantee absolute safety unless we always mark all
1653 threads in the process, but these implicit registration calls should cover reasonable usage
1657 (JSEvaluateScript): Explicitly register the current thread.
1658 (JSCheckScriptSyntax): Explicitly register the current thread.
1659 (JSGarbageCollect): Changed to use the passed in context. Unfortunately, this creates a race
1660 condition for clients that pass an already released context to JSGarbageCollect - but it is
1661 unlikely to create real life problems.
1662 To maintain compatibility, the shared heap is collected if NULL is passed.
1664 * API/JSContextRef.cpp:
1665 (JSGlobalContextCreate): Use a new syntax for JSGlobalObject allocation.
1666 (JSGlobalContextRetain): Register the thread.
1667 (JSContextGetGlobalObject): Register the thread.
1669 * API/JSObjectRef.cpp:
1671 (JSObjectMakeFunctionWithCallback):
1672 (JSObjectMakeConstructor):
1673 (JSObjectMakeFunction):
1674 (JSObjectHasProperty):
1675 (JSObjectGetProperty):
1676 (JSObjectSetProperty):
1677 (JSObjectGetPropertyAtIndex):
1678 (JSObjectSetPropertyAtIndex):
1679 (JSObjectDeleteProperty):
1680 (JSObjectCallAsFunction):
1681 (JSObjectCallAsConstructor):
1682 (JSObjectCopyPropertyNames):
1683 (JSPropertyNameAccumulatorAddName):
1684 * API/JSValueRef.cpp:
1686 (JSValueIsInstanceOfConstructor):
1687 (JSValueMakeNumber):
1688 (JSValueMakeString):
1690 (JSValueToStringCopy):
1694 Register the thread.
1696 * API/JSStringRef.cpp: (JSStringRelease): Changed a comment to not mention per-thread contexts.
1698 * API/JSStringRefCF.cpp: Removed an unnecessary include of JSLock.h.
1700 * JavaScriptCore.exp: Export JSGlobalData constructor/destructor, now that anyone can have
1701 their own instances. Adapt to other changes, too.
1703 * JavaScriptCore.xcodeproj/project.pbxproj: Made ThreadSpecific.h private, as it is now
1704 included by collector.h and is thus needed in other projects.
1706 * kjs/InitializeThreading.cpp: (KJS::initializeThreadingOnce): Don't initialize per-thread
1707 global data, as it no longer exists.
1709 * kjs/JSGlobalData.cpp:
1710 (KJS::JSGlobalData::JSGlobalData):
1711 (KJS::JSGlobalData::~JSGlobalData):
1712 * kjs/JSGlobalData.h:
1713 Removed support for per-thread instance. Made constructor and destructor public.
1715 * kjs/JSGlobalObject.cpp: (KJS::JSGlobalObject::init): Get to now arbitrary JSGlobalData
1717 (KJS::JSGlobalObject::operator new): Changed ot take JSGlobalDatra pointer.
1718 * kjs/JSGlobalObject.h:
1723 Changed to maintain a custom JSGlobalData pointer instead of a per-thread one.
1725 2008-07-13 Ada Chan <adachan@apple.com>
1727 Windows build fix: Add wtf/RefCountedLeakCounter to the project.
1729 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
1731 2008-07-12 Jan Michael Alonzo <jmalonzo@webkit.org>
1733 Gtk, Qt and Wx build fix: Add wtf/RefCountedLeakCounter in the
1737 * JavaScriptCore.pri:
1738 * JavaScriptCoreSources.bkl:
1740 2008-07-11 Stephanie Lewis <slewis@apple.com>
1742 Reviewed by Darin Adler and Oliver Hunt.
1744 Refactor RefCounting Leak counting code into a common class.
1746 In order to export the symbols I needed to put the debug defines inside the function names
1748 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.
1750 * JavaScriptCore.exp:
1751 * JavaScriptCore.xcodeproj/project.pbxproj: add new class
1752 * kjs/nodes.cpp: remove old leak counting code
1753 * wtf/RefCountedLeakCounter.cpp: Added. create a common leak counting class
1754 * wtf/RefCountedLeakCounter.h: Added.
1756 2008-07-11 David Hyatt <hyatt@apple.com>
1758 Add an insertBefore method to ListHashSet to allow for insertions in the middle of the list (rather than just
1763 * wtf/ListHashSet.h:
1764 (WTF::::insertBefore):
1765 (WTF::::insertNodeBefore):
1767 2008-07-11 Sam Weinig <sam@webkit.org>
1769 Rubber-stamped by Darin Adler.
1771 Move call function to CallData.cpp and construct to ConstructData.cpp.
1774 * JavaScriptCore.pri:
1775 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1776 * JavaScriptCore.xcodeproj/project.pbxproj:
1777 * JavaScriptCoreSources.bkl:
1778 * kjs/AllInOneFile.cpp:
1779 * kjs/CallData.cpp: Copied from kjs/JSValue.cpp.
1780 * kjs/ConstructData.cpp: Copied from kjs/JSValue.cpp.
1783 2008-07-10 Mark Rowe <mrowe@apple.com>
1785 Reviewed by Sam Weinig.
1787 Define WEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST when building WebKit to ensure that no symbols end up with the weak_import attribute.
1789 * Configurations/Base.xcconfig:
1791 2008-07-10 Mark Rowe <mrowe@apple.com>
1793 Reviewed by Sam Weinig.
1795 Fix the Tiger build by omitting annotations from methods declared in categories when using old versions of GCC.
1797 * API/WebKitAvailability.h:
1799 2008-07-10 Kevin McCullough <kmccullough@apple.com>
1803 -Minor cleanup. Renamed callTree() to head() and no longer use m_head
1804 directly but instead keep it private and access via a method().
1806 * profiler/HeavyProfile.cpp:
1807 (KJS::HeavyProfile::HeavyProfile):
1808 (KJS::HeavyProfile::generateHeavyStructure):
1809 (KJS::HeavyProfile::addNode):
1810 * profiler/Profile.h:
1811 (KJS::Profile::head):
1812 * profiler/ProfileGenerator.cpp:
1813 (KJS::ProfileGenerator::ProfileGenerator):
1815 2008-07-10 Alexey Proskuryakov <ap@webkit.org>
1817 Reviewed by Mark Rowe.
1819 Eliminate CollectorHeapIntrospector.
1821 CollectorHeapIntrospector was added primarily in the hopes to improve leaks tool output,
1822 a result that it didn't deliver. Also, it helped by labeling JSC heap regions as reported by
1823 vmmap tool, but at the same time, it made them mislabeled as malloc'd ones - the correct
1824 way to label mapped regions is to use a VM tag.
1826 So, it makes more sense to remove it completely than to make it work with multiple heaps.
1828 * JavaScriptCore.exp:
1829 * JavaScriptCore.xcodeproj/project.pbxproj:
1830 * kjs/AllInOneFile.cpp:
1831 * kjs/InitializeThreading.cpp:
1832 (KJS::initializeThreading):
1833 * kjs/collector.cpp:
1835 * kjs/CollectorHeapIntrospector.cpp: Removed.
1836 * kjs/CollectorHeapIntrospector.h: Removed.
1838 2008-07-09 Kevin McCullough <kmccullough@apple.com>
1842 <rdar://problem/5951532> JSProfiler: Implement heavy (or bottom-up)
1844 - Implemented the time and call count portionof heavy. Now all that we
1847 * profiler/CallIdentifier.h: Removed an unused constructor.
1848 * profiler/HeavyProfile.cpp:
1849 (KJS::HeavyProfile::HeavyProfile): Set the initial time of the head
1850 node so that percentages work correctly.
1851 (KJS::HeavyProfile::mergeProfiles): Sum the times and call count of
1853 * profiler/ProfileNode.cpp: Set the intital values of time and call
1854 count when copying ProfileNodes.
1855 (KJS::ProfileNode::ProfileNode):
1857 2008-07-10 Jan Michael Alonzo <jmalonzo@webkit.org>
1861 * GNUmakefile.am: Add HeavyProfile.cpp
1863 2008-07-09 Mark Rowe <mrowe@apple.com>
1865 Reviewed by Geoff Garen.
1867 Don't warn about deprecated functions in production builds.
1869 * Configurations/Base.xcconfig:
1870 * Configurations/DebugRelease.xcconfig:
1872 2008-07-09 Darin Adler <darin@apple.com>
1874 * JavaScriptCore.pri: Fix Qt build by adding HeavyProfile.cpp.
1876 2008-07-09 Kevin Ollivier <kevino@theolliviers.com>
1878 wx biuld fix. Add HeavyProfile.cpp to build files.
1880 * JavaScriptCoreSources.bkl:
1882 2008-07-09 Kevin McCullough <kmccullough@apple.com>
1884 - Windows build fix.
1886 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1888 2008-07-09 Kevin McCullough <kmccullough@apple.com>
1892 * profiler/HeavyProfile.cpp:
1893 (KJS::HeavyProfile::mergeProfiles):
1895 2008-07-09 Kevin McCullough <kmccullough@apple.com>
1897 Reviewed by Geoff and Adam.
1899 <rdar://problem/5951532> JSProfiler: Implement Bottom-Up view (19228)
1900 - This is the plumbing for bottom-up, but does not include calculating
1901 time, mostly because I'm still undclear about what the end result should
1903 - This, obviously, does not include the UI to expose this in the
1906 * JavaScriptCore.xcodeproj/project.pbxproj:
1907 * profiler/CallIdentifier.h:
1908 (KJS::CallIdentifier::CallIdentifier):
1909 (WTF::): Added HashTraits for CallIdentifiers to be used by a HashMap.
1910 * profiler/HeavyProfile.cpp: Added.
1911 (KJS::HeavyProfile::HeavyProfile):
1912 (KJS::HeavyProfile::generateHeavyStructure):
1913 (KJS::HeavyProfile::addNode):
1914 (KJS::HeavyProfile::mergeProfiles):
1915 (KJS::HeavyProfile::addAncestorsAsChildren):
1916 * profiler/HeavyProfile.h: Added.
1917 (KJS::HeavyProfile::create):
1918 (KJS::HeavyProfile::heavyProfile):
1919 (KJS::HeavyProfile::treeProfile):
1920 * profiler/Profile.cpp: Removed old commented out includes.
1921 * profiler/Profile.h: The m_head is needed by the HeavyProfile so it
1922 is now protected as opposed to private.
1923 * profiler/ProfileNode.cpp:
1924 (KJS::ProfileNode::ProfileNode): Created a constructor to copy
1926 (KJS::ProfileNode::findChild): Added a null check to make HeavyProfile
1927 children finding easier and avoid a potential crasher.
1928 * profiler/ProfileNode.h: Mostly moved things around but also added some
1929 functionality needed by HeavyProfile.
1930 (KJS::ProfileNode::create):
1931 (KJS::ProfileNode::functionName):
1932 (KJS::ProfileNode::url):
1933 (KJS::ProfileNode::lineNumber):
1934 (KJS::ProfileNode::head):
1935 (KJS::ProfileNode::setHead):
1936 (KJS::ProfileNode::setNextSibling):
1937 (KJS::ProfileNode::actualTotalTime):
1938 (KJS::ProfileNode::actualSelfTime):
1939 * profiler/TreeProfile.cpp: Implemented the ability to get a
1941 (KJS::TreeProfile::heavyProfile):
1942 * profiler/TreeProfile.h:
1944 2008-07-08 Geoffrey Garen <ggaren@apple.com>
1946 Reviewed by Oliver Hunt.
1948 Added support for checking if an object has custom properties in its
1949 property map. WebCore uses this to optimize marking DOM wrappers.
1951 2008-07-08 Simon Hausmann <hausmann@webkit.org>
1953 Prospective Gtk/Wx build fixes, add ProfileGenerator.cpp to the build.
1956 * JavaScriptCoreSources.bkl:
1958 2008-07-08 Simon Hausmann <hausmann@webkit.org>
1960 Fix the Qt build, add ProfileGenerator.cpp to the build.
1962 * JavaScriptCore.pri:
1964 2008-07-07 David Kilzer <ddkilzer@apple.com>
1966 releaseFastMallocFreeMemory() should always be defined
1970 * JavaScriptCore.exp: Changed to export C++ binding for
1971 WTF::releaseFastMallocFreeMemory() instead of C binding for
1972 releaseFastMallocFreeMemory().
1973 * wtf/FastMalloc.cpp: Moved definitions of
1974 releaseFastMallocFreeMemory() to be in the WTF namespace
1975 regardless whether FORCE_SYSTEM_MALLOC is defined.
1976 * wtf/FastMalloc.h: Moved releaseFastMallocFreeMemory() from
1977 extern "C" binding to WTF::releaseFastMallocFreeMemory().
1979 2008-07-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1983 Bug 19926: URL causes crash within a minute
1984 <https://bugs.webkit.org/show_bug.cgi?id=19926>
1986 Add a check that lastGlobalObject is non-null in Machine::execute()
1987 before copying its globals to the current register file.
1989 In theory, it is possible to make a test case for this, but it will
1990 take a while to get it right.
1993 (KJS::Machine::execute):
1995 2008-07-07 Darin Adler <darin@apple.com>
1997 Rubber stamped by Adele.
2000 (KJS::Machine::privateExecute): Fix a typo in a comment.
2002 2008-07-07 Steve Falkenburg <sfalken@apple.com>
2006 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2007 * JavaScriptCore.vcproj/testapi/testapi.vcproj:
2009 2008-07-07 Kevin McCullough <kmccullough@apple.com>
2013 When the profiler is running it gathers information and creates a
2014 Profile. After it finishes the Profile can be sorted and have other
2015 data refinements run over it. Both of these were done in the same class
2016 before. Now I split the gathering operations into a new class called
2019 * JavaScriptCore.xcodeproj/project.pbxproj:
2020 * profiler/Profile.cpp: Removed code related to the gather stage of a
2022 (KJS::Profile::create):
2023 (KJS::Profile::Profile):
2024 * profiler/Profile.h: Ditto.
2025 (KJS::Profile::title):
2026 (KJS::Profile::callTree):
2027 (KJS::Profile::setHead):
2028 * profiler/ProfileGenerator.cpp: Added. This is the class that will
2029 handle the stage of creating a Profile. Once the Profile is finished
2030 being created, this class goes away.
2031 (KJS::ProfileGenerator::create):
2032 (KJS::ProfileGenerator::ProfileGenerator):
2033 (KJS::ProfileGenerator::title):
2034 (KJS::ProfileGenerator::willExecute):
2035 (KJS::ProfileGenerator::didExecute):
2036 (KJS::ProfileGenerator::stopProfiling):
2037 (KJS::ProfileGenerator::didFinishAllExecution):
2038 (KJS::ProfileGenerator::removeProfileStart):
2039 (KJS::ProfileGenerator::removeProfileEnd):
2040 * profiler/ProfileGenerator.h: Added.
2041 (KJS::ProfileGenerator::profile):
2042 (KJS::ProfileGenerator::originatingGlobalExec):
2043 (KJS::ProfileGenerator::pageGroupIdentifier):
2044 (KJS::ProfileGenerator::client):
2045 (KJS::ProfileGenerator::stoppedProfiling):
2046 * profiler/Profiler.cpp: Now operates with the ProfileGenerator instead
2048 (KJS::Profiler::startProfiling):
2049 (KJS::Profiler::stopProfiling):
2050 (KJS::Profiler::didFinishAllExecution): It is here that the Profile is
2051 handed off to its client and the Profile Generator is no longer needed.
2052 (KJS::dispatchFunctionToProfiles):
2053 (KJS::Profiler::willExecute):
2054 (KJS::Profiler::didExecute):
2055 * profiler/Profiler.h: Cleaned up the includes and subsequently the
2056 forward declarations. Also use the new ProfileGenerator.
2057 (KJS::ProfilerClient::~ProfilerClient):
2058 (KJS::Profiler::currentProfiles):
2059 * profiler/TreeProfile.cpp: Use Profile's new interface.
2060 (KJS::TreeProfile::create):
2061 (KJS::TreeProfile::TreeProfile):
2062 * profiler/TreeProfile.h:
2064 2008-07-07 Sam Weinig <sam@webkit.org>
2066 Reviewed by Cameron Zwarich.
2068 Third step in broad cleanup effort.
2070 [ File list elided ]
2072 2008-07-06 Sam Weinig <sam@webkit.org>
2074 Reviewed by Cameron Zwarich.
2076 Second step in broad cleanup effort.
2078 [ File list elided ]
2080 2008-07-05 Sam Weinig <sam@webkit.org>
2082 Reviewed by Cameron Zwarich.
2084 First step in broad cleanup effort.
2086 [ File list elided ]
2088 2008-07-05 Sam Weinig <sam@webkit.org>
2090 Rubber-stamped by Cameron Zwarich.
2092 Rename list.h/cpp to ArgList.h/cpp.
2095 * JavaScriptCore.pri:
2096 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2097 * JavaScriptCore.xcodeproj/project.pbxproj:
2098 * JavaScriptCoreSources.bkl:
2100 * kjs/AllInOneFile.cpp:
2101 * kjs/ArgList.cpp: Copied from JavaScriptCore/kjs/list.cpp.
2102 * kjs/ArgList.h: Copied from JavaScriptCore/kjs/list.h.
2103 * kjs/IndexToNameMap.cpp:
2104 * kjs/JSGlobalData.cpp:
2105 * kjs/JSGlobalData.h:
2107 * kjs/collector.cpp:
2108 * kjs/list.cpp: Removed.
2109 * kjs/list.h: Removed.
2111 2008-07-05 Sam Weinig <sam@webkit.org>
2113 Fix non-AllInOne builds again.
2115 * kjs/BooleanPrototype.cpp:
2116 * kjs/ErrorPrototype.cpp:
2117 * kjs/FunctionPrototype.cpp:
2118 * kjs/NumberPrototype.cpp:
2119 * kjs/ObjectPrototype.cpp:
2121 2008-07-05 Sam Weinig <sam@webkit.org>
2123 Fix build on case-sensitive build systems.
2125 * kjs/IndexToNameMap.cpp:
2127 2008-07-05 Sam Weinig <sam@webkit.org>
2131 * kjs/Arguments.cpp:
2132 * kjs/BooleanPrototype.cpp:
2133 * kjs/DateConstructor.cpp:
2134 * kjs/ErrorPrototype.cpp:
2135 * kjs/FunctionPrototype.cpp:
2136 * kjs/NumberPrototype.cpp:
2137 * kjs/ObjectPrototype.cpp:
2138 * kjs/RegExpPrototype.cpp:
2139 * kjs/StringConstructor.cpp:
2142 2008-07-05 Sam Weinig <sam@webkit.org>
2144 Fix non-AllInOne build.
2146 * kjs/JSGlobalObject.cpp:
2148 2008-07-05 Sam Weinig <sam@webkit.org>
2150 Rubber-stamped by Cameron Zwarich.
2152 Split Arguments, IndexToNameMap, PrototypeFunction, GlobalEvalFunction and
2153 the functions on the global object out of JSFunction.h/cpp.
2156 * JavaScriptCore.pri:
2157 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2158 * JavaScriptCore.xcodeproj/project.pbxproj:
2159 * JavaScriptCoreSources.bkl:
2161 * kjs/AllInOneFile.cpp:
2162 * kjs/Arguments.cpp: Copied from JavaScriptCore/kjs/JSFunction.cpp.
2163 * kjs/Arguments.h: Copied from JavaScriptCore/kjs/JSFunction.h.
2164 * kjs/GlobalEvalFunction.cpp: Copied from JavaScriptCore/kjs/JSFunction.cpp.
2165 * kjs/GlobalEvalFunction.h: Copied from JavaScriptCore/kjs/JSFunction.h.
2166 * kjs/IndexToNameMap.cpp: Copied from JavaScriptCore/kjs/JSFunction.cpp.
2167 * kjs/IndexToNameMap.h: Copied from JavaScriptCore/kjs/JSFunction.h.
2168 * kjs/JSActivation.cpp:
2169 * kjs/JSFunction.cpp:
2171 * kjs/JSGlobalObject.cpp:
2172 * kjs/JSGlobalObjectFunctions.cpp: Copied from JavaScriptCore/kjs/JSFunction.cpp.
2173 * kjs/JSGlobalObjectFunctions.h: Copied from JavaScriptCore/kjs/JSFunction.h.
2174 The functions on the global object should be in JSGlobalObject.cpp, but putting them there
2175 was a 0.5% regression.
2177 * kjs/PrototypeFunction.cpp: Copied from JavaScriptCore/kjs/JSFunction.cpp.
2178 * kjs/PrototypeFunction.h: Copied from JavaScriptCore/kjs/JSFunction.h.
2183 2008-07-04 Sam Weinig <sam@webkit.org>
2185 Really fix the mac build.
2187 * JavaScriptCore.xcodeproj/project.pbxproj:
2189 2008-07-04 Sam Weinig <sam@webkit.org>
2193 * JavaScriptCore.xcodeproj/project.pbxproj:
2195 2008-07-04 Sam Weinig <sam@webkit.org>
2197 Fix non-AllInOne builds.
2200 * kjs/GetterSetter.cpp:
2201 * kjs/JSImmediate.cpp:
2202 * kjs/operations.cpp:
2204 2008-07-04 Sam Weinig <sam@webkit.org>
2206 Rubber-stamped by Dan Bernstein.
2208 Split Error and GetterSetter out of JSObject.h.
2210 * API/JSCallbackObjectFunctions.h:
2212 * JavaScriptCore.pri:
2213 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2214 * JavaScriptCore.xcodeproj/project.pbxproj:
2215 * JavaScriptCoreSources.bkl:
2216 * kjs/AllInOneFile.cpp:
2217 * kjs/ClassInfo.h: Copied from JavaScriptCore/kjs/JSObject.h.
2218 * kjs/Error.cpp: Copied from JavaScriptCore/kjs/JSObject.cpp.
2219 * kjs/Error.h: Copied from JavaScriptCore/kjs/JSObject.h.
2220 * kjs/GetterSetter.cpp:
2221 * kjs/GetterSetter.h: Copied from JavaScriptCore/kjs/JSObject.h.
2226 2008-07-04 Simon Hausmann <hausmann@webkit.org>
2228 Fix the Wx build, added TreeProfile.cpp to the build.
2230 * JavaScriptCoreSources.bkl:
2232 2008-07-03 Mark Rowe <mrowe@apple.com>
2234 Reviewed by Oliver Hunt.
2236 Fix output path of recently-added script phase to reference the correct file.
2237 This prevents Xcode from running the script phase unnecessarily, which caused
2238 the generated header to be recreated and lead to AllInOneFile.cpp rebuilding.
2240 * JavaScriptCore.xcodeproj/project.pbxproj:
2242 2008-07-03 Mark Rowe <mrowe@apple.com>
2244 Follow-up to the 64-bit build fix. Use intptr_t rather than ssize_t as
2245 the latter is non-standard and does not exist on Windows.
2248 (KJS::JSLock::lockCount):
2249 (KJS::JSLock::lock):
2250 (KJS::JSLock::unlock):
2251 (KJS::JSLock::DropAllLocks::DropAllLocks):
2254 2008-07-02 Mark Rowe <mrowe@apple.com>
2256 Fix the 64-bit build. pthread_getspecific works with pointer-sized values,
2257 so use ssize_t rather than int to track the lock count to avoid warnings about
2258 truncating the result of pthread_getspecific.
2261 (KJS::JSLock::lockCount):
2262 (KJS::JSLock::lock):
2263 (KJS::JSLock::unlock):
2264 (KJS::JSLock::DropAllLocks::DropAllLocks):
2267 2008-07-03 Geoffrey Garen <ggaren@apple.com>
2269 Reviewed by Sam Weinig.
2271 Removed checking for the array get/put fast case from the array code.
2272 Callers who want the fast case should call getIndex and/or setIndex
2273 instead. (get_by_val and put_by_val already do this.)
2275 SunSpider reports no change overall, but a 1.4% speedup on fannkuch and
2276 a 3.6% speedup on nsieve.
2278 2008-07-03 Dan Bernstein <mitz@apple.com>
2282 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Added TreeProfile.{h,cpp}.
2284 2008-07-03 Dan Bernstein <mitz@apple.com>
2286 Reviewed by Anders Carlsson.
2291 (KJS::Machine::Machine):
2293 2008-07-03 Simon Hausmann <hausmann@webkit.org>
2295 Reviewed by Alexey Proskuryakov.
2297 Fix the non-threaded build.
2299 * kjs/JSGlobalData.cpp:
2300 (KJS::JSGlobalData::threadInstanceInternal):
2302 2008-07-03 Simon Hausmann <hausmann@webkit.org>
2304 Fix the Qt build, added TreeProfile to the build.
2306 * JavaScriptCore.pri:
2308 2008-07-02 Alexey Proskuryakov <ap@webkit.org>
2312 Don't create unnecessary JSGlobalData instances.
2314 * kjs/JSGlobalData.h:
2315 * kjs/JSGlobalData.cpp:
2316 (KJS::JSGlobalData::threadInstanceExists):
2317 (KJS::JSGlobalData::sharedInstanceExists):
2318 (KJS::JSGlobalData::threadInstance):
2319 (KJS::JSGlobalData::sharedInstance):
2320 (KJS::JSGlobalData::threadInstanceInternal):
2321 (KJS::JSGlobalData::sharedInstanceInternal):
2322 Added methods to query instance existence.
2324 * kjs/InitializeThreading.cpp:
2325 (KJS::initializeThreadingOnce):
2326 Initialize thread instance static in a new way.
2330 * kjs/collector.cpp:
2331 (KJS::Heap::collect):
2332 Check for instance existence before accessing it.
2334 2008-07-02 Geoffrey Garen <ggaren@apple.com>
2336 Reviewed by Cameron Zwarich.
2338 Fixed https://bugs.webkit.org/show_bug.cgi?id=19862
2339 REGRESSION (r34907): Gmail crashes in JavaScriptCore code while editing drafts
2341 I was never able to reproduce this issue, but Cameron could, and he says
2342 that this patch fixes it.
2344 The crash seems tied to a timer or event handler callback. In such a case,
2345 the sole reference to the global object may be in the current call frame,
2346 so we can't depend on the global object to mark the call frame area in
2349 The new GC marking rule is: the global object is not responsible for
2350 marking the whole register file -- it's just responsible for the globals
2351 section it's tied to. The heap is responsible for marking the call frame area.
2353 2008-07-02 Mark Rowe <mrowe@apple.com>
2355 Reviewed by Sam Weinig.
2357 Add the ability to trace JavaScriptCore garabge collections using dtrace.
2359 * JavaScriptCore.xcodeproj/project.pbxproj: Generate the dtrace probe header
2360 file when building on a new enough version of Mac OS X.
2361 * JavaScriptCorePrefix.h: Add our standard Mac OS X version detection macros.
2362 * kjs/Tracing.d: Declare three dtrace probes.
2363 * kjs/Tracing.h: Include the generated dtrace macros if dtrace is available,
2364 otherwise provide versions that do nothing.
2365 * kjs/collector.cpp:
2366 (KJS::Heap::collect): Fire dtrace probes when starting a collection, after the
2367 mark phase has completed, and when the collection is complete.
2368 * wtf/Platform.h: Define HAVE_DTRACE when building on a new enough version of Mac OS X.
2370 2008-07-02 Geoffrey Garen <ggaren@apple.com>
2372 Rubber stamped by Oliver Hunt.
2374 Reduced the max register file size from 8MB to 2MB.
2376 We still allow about 20,000 levels of recursion.
2378 2008-07-02 Alp Toker <alp@nuanti.com>
2380 Build fix for r34960. Add TreeProfile.cpp to build.
2384 2008-07-02 Geoffrey Garen <ggaren@apple.com>
2386 Reviewed by Oliver Hunt.
2388 Optimized a[n] get for cases when a is an array or a string. When a is
2389 an array, we optimize both get and put. When a is a string, we only
2390 optimize get, since you can't put to a string.
2392 SunSpider says 3.4% faster.
2394 2008-07-02 Kevin McCullough <kmccullough@apple.com>
2398 -Small cleanup in preparation for implementing Bottom-up.
2400 * profiler/CallIdentifier.h: Rename debug function to make it clear of
2401 its output and intention to be debug only.
2402 (KJS::CallIdentifier::operator const char* ): Implement in terms of
2404 (KJS::CallIdentifier::c_str):
2405 * profiler/ProfileNode.cpp: Impelment findChild() which will be needed
2406 by the bottom-up implementation.
2407 (KJS::ProfileNode::findChild):
2408 * profiler/ProfileNode.h: Added comments to make the collections of
2409 functions more clear.
2410 (KJS::ProfileNode::operator==):
2411 (KJS::ProfileNode::c_str):
2413 2008-07-02 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2417 Bug 19776: Number.toExponential() is incorrect for numbers between 0.1 and 1
2418 <https://bugs.webkit.org/show_bug.cgi?id=19776>
2420 Perform the sign check for the exponent on the actual exponent value,
2421 which is 1 less than the value of decimalPoint, instead of on the value
2422 of decimalPoint itself.
2424 * kjs/NumberPrototype.cpp:
2425 (KJS::exponentialPartToString):
2427 2008-07-02 Kevin McCullough <kmccullough@apple.com>
2431 <rdar://problem/5951532> JSProfiler: Implement Bottom-Up view (19228)
2432 - Subclass TreeProfile as I prepare for a HeavyProfile to be comming
2435 * JavaScriptCore.xcodeproj/project.pbxproj:
2436 * profiler/Profile.cpp: By default we create a TreeProfile.
2437 (KJS::Profile::create):
2438 * profiler/Profile.h: Changes to the Profile class to make it amenable
2439 to be inherited from.
2440 (KJS::Profile::~Profile):
2441 * profiler/TreeProfile.cpp: Added.
2442 (KJS::TreeProfile::create):
2443 (KJS::TreeProfile::TreeProfile):
2444 (KJS::TreeProfile::heavyProfile):
2445 * profiler/TreeProfile.h: Added.
2446 (KJS::TreeProfile::treeProfile):
2448 2008-07-02 Kevin McCullough <kmccullough@apple.com>
2452 Broke CallIdentifier out into its own file. I did this because it's
2453 going to grow a lot soon and I wanted this to be a separate patch.
2455 * JavaScriptCore.xcodeproj/project.pbxproj:
2456 * profiler/CallIdentifier.h: Added.
2457 (KJS::CallIdentifier::CallIdentifier):
2458 (KJS::CallIdentifier::operator==):
2459 (KJS::CallIdentifier::operator!=):
2460 (KJS::CallIdentifier::operator const char* ):
2461 (KJS::CallIdentifier::toString):
2462 * profiler/ProfileNode.h:
2464 2008-07-02 Simon Hausmann <hausmann@webkit.org>
2466 Build fix. Implemented missing functions for single-threaded build.
2469 (KJS::JSLock::JSLock):
2470 (KJS::JSLock::lock):
2471 (KJS::JSLock::unlock):
2472 (KJS::JSLock::DropAllLocks::DropAllLocks):
2474 2008-07-02 Alexey Proskuryakov <ap@webkit.org>
2476 Another non-AllInOne build fix.
2478 * kjs/JSGlobalObject.cpp: Include JSLock.h here, too.
2480 2008-07-02 Alexey Proskuryakov <ap@webkit.org>
2482 Non-AllInOne build fix.
2484 * kjs/interpreter.cpp: Include JSLock.h.
2486 2008-06-30 Alexey Proskuryakov <ap@webkit.org>
2490 Disable JSLock for per-thread contexts.
2492 No change on SunSpider.
2494 * kjs/JSGlobalData.h:
2495 * kjs/JSGlobalData.cpp:
2496 (KJS::JSGlobalData::JSGlobalData):
2497 (KJS::JSGlobalData::sharedInstance):
2498 Added isSharedInstance as a better way to tell whether the instance is shared (legacy).
2501 (KJS::createJSLockCount):
2502 (KJS::JSLock::lockCount):
2503 (KJS::setLockCount):
2504 (KJS::JSLock::JSLock):
2505 (KJS::JSLock::lock):
2506 (KJS::JSLock::unlock):
2507 (KJS::JSLock::currentThreadIsHoldingLock):
2508 (KJS::JSLock::DropAllLocks::DropAllLocks):
2509 (KJS::JSLock::DropAllLocks::~DropAllLocks):
2511 (KJS::JSLock::JSLock):
2512 (KJS::JSLock::~JSLock):
2513 Made JSLock and JSLock::DropAllLocks constructors take a parameter to decide whether to
2514 actually lock a mutex, or only to increment recursion count. We cannot turn it into no-op
2515 if we want to keep existing assertions working.
2516 Made recursion count per-thread, now that locks may not lock.
2519 (JSEvaluateScript): Take JSLock after casting JSContextRef to ExecState* (which doesn't need
2520 locking in any case), so that a decision whether to actually lock can be made.
2521 (JSCheckScriptSyntax): Ditto.
2522 (JSGarbageCollect): Only lock while collecting the shared heap, not the per-thread one.
2524 * API/JSObjectRef.cpp:
2525 (JSClassCreate): Don't lock, as there is no reason to.
2526 (JSClassRetain): Ditto.
2527 (JSClassRelease): Ditto.
2528 (JSPropertyNameArrayRetain): Ditto.
2529 (JSPropertyNameArrayRelease): Only lock while deleting the array, as that may touch
2531 (JSPropertyNameAccumulatorAddName): Adding a string also involves an identifier table
2532 lookup, and possibly modification.
2534 * API/JSStringRef.cpp:
2535 (JSStringCreateWithCharacters):
2536 (JSStringCreateWithUTF8CString):
2539 (JSStringGetUTF8CString):
2541 * API/JSStringRefCF.cpp:
2542 (JSStringCreateWithCFString):
2543 JSStringRef operations other than releasing do not need locking.
2545 * VM/Machine.cpp: Don't include unused JSLock.h.
2547 * kjs/CollectorHeapIntrospector.cpp: (KJS::CollectorHeapIntrospector::statistics):
2548 Don't take the lock for real, as heap introspection pauses the process anyway. It seems that
2549 the existing code could cause deadlocks.
2555 The test tool uses a per-thread context, so no real locking is required.
2558 (KJS::Heap::setGCProtectNeedsLocking): Optionally protect m_protectedValues access with a
2559 per-heap mutex. This is only needed for WebCore Database code, which violates the "no data
2560 migration between threads" by using ProtectedPtr on a background thread.
2561 (KJS::Heap::isShared): Keep a shared flag here, as well.
2564 (KJS::::ProtectedPtr):
2565 (KJS::::~ProtectedPtr):
2569 ProtectedPtr is ony used from WebCore, so it doesn't need to take JSLock. An assertion in
2570 Heap::protect/unprotect guards agains possible future unlocked uses of ProtectedPtr in JSC.
2572 * kjs/collector.cpp:
2573 (KJS::Heap::Heap): Initialize m_isShared.
2574 (KJS::Heap::~Heap): No need to lock for real during destruction, but must keep assertions
2576 (KJS::destroyRegisteredThread): Registered thread list is only accessed for shared heap,
2577 so locking is always needed here.
2578 (KJS::Heap::registerThread): Ditto.
2579 (KJS::Heap::markStackObjectsConservatively): Use m_isShared instead of comparing to a shared
2580 instance for a small speedup.
2581 (KJS::Heap::setGCProtectNeedsLocking): Create m_protectedValuesMutex. There is currently no
2582 way to undo this - and ideally, Database code will be fixed to lo longer require this quirk.
2583 (KJS::Heap::protect): Take m_protectedValuesMutex (if it exists) while accessing
2585 (KJS::Heap::unprotect): Ditto.
2586 (KJS::Heap::markProtectedObjects): Ditto.
2587 (KJS::Heap::protectedGlobalObjectCount): Ditto.
2588 (KJS::Heap::protectedObjectCount): Ditto.
2589 (KJS::Heap::protectedObjectTypeCounts): Ditto.
2593 Don't include JSLock.h, which is no longer used here. As a result, an explicit include had
2594 to be added to many files in JavaScriptGlue, WebCore and WebKit.
2596 * kjs/JSGlobalObject.cpp:
2597 (KJS::JSGlobalObject::init):
2598 * API/JSCallbackConstructor.cpp:
2599 (KJS::constructJSCallback):
2600 * API/JSCallbackFunction.cpp:
2601 (KJS::JSCallbackFunction::call):
2602 * API/JSCallbackObjectFunctions.h:
2604 (KJS::::getOwnPropertySlot):
2606 (KJS::::deleteProperty):
2608 (KJS::::hasInstance):
2610 (KJS::::getPropertyNames):
2613 (KJS::::staticValueGetter):
2614 (KJS::::callbackGetter):
2615 * API/JSContextRef.cpp:
2616 (JSGlobalContextCreate):
2617 (JSGlobalContextRetain):
2618 (JSGlobalContextRelease):
2619 * API/JSValueRef.cpp:
2621 (JSValueIsStrictEqual):
2622 (JSValueIsInstanceOfConstructor):
2623 (JSValueMakeNumber):
2624 (JSValueMakeString):
2626 (JSValueToStringCopy):
2630 * JavaScriptCore.exp:
2631 * kjs/PropertyNameArray.h:
2632 (KJS::PropertyNameArray::globalData):
2633 * kjs/interpreter.cpp:
2634 (KJS::Interpreter::checkSyntax):
2635 (KJS::Interpreter::evaluate):
2636 Pass a parameter to JSLock/JSLock::DropAllLocks to decide whether the lock needs to be taken.
2638 2008-07-01 Alexey Proskuryakov <ap@webkit.org>
2642 https://bugs.webkit.org/show_bug.cgi?id=19834
2643 Failed assertion in JavaScriptCore/VM/SegmentedVector.h:82
2645 Creating a global object with a custom prototype resets it twice (wasteful!).
2646 So, addStaticGlobals() was called twice, but JSGlobalObject::reset() didn't reset
2649 * kjs/JSGlobalObject.cpp: (KJS::JSGlobalObject::reset): Call setRegisterArray(0, 0).
2651 * kjs/JSVariableObject.h: Changed registerArray to OwnArrayPtr. Also, added private copy
2652 constructor and operator= to ensure that no one attempts to copy this object (for whatever
2653 reason, I couldn't make Noncopyable work).
2655 * kjs/JSGlobalObject.h: (KJS::JSGlobalObject::addStaticGlobals): Allocate registerArray
2658 * kjs/JSVariableObject.cpp:
2659 (KJS::JSVariableObject::copyRegisterArray): Allocate registerArray with new[].
2660 (KJS::JSVariableObject::setRegisterArray): Avoid hitting an assertion in OwnArrayPtr when
2661 "changing" the value from 0 to 0.
2663 2008-07-01 Geoffrey Garen <ggaren@apple.com>
2665 Reviewed by Oliver Hunt.
2667 Removed and/or reordered exception checks in array-style a[n] access.
2669 SunSpider says 1.4% faster.
2672 (KJS::Machine::privateExecute): No need to check for exceptions before
2673 calling toString, toNumber and/or get. If the call ends up being observable
2674 through toString, valueOf, or a getter, we short-circuit it there, instead.
2675 In the op_del_by_val case, I removed the incorrect comment without actually
2676 removing the code, since I didn't want to tempt the GCC fates!
2679 (KJS::callDefaultValueFunction): Added exception check to prevent
2680 toString and valueOf functions from observing execution after an exception
2681 has been thrown. This removes some of the burden of exception checking
2684 (KJS::JSObject::defaultValue): Removed redundant exception check here.
2686 * kjs/PropertySlot.cpp:
2687 (KJS::PropertySlot::functionGetter): Added exception check to prevent
2688 getter functions from observing execution after an exception has been
2689 thrown. This removes some of the burden of exception checking from the
2692 2008-07-01 Geoffrey Garen <ggaren@apple.com>
2694 Reviewed by Oliver Hunt.
2696 Optimized a[n] get and put for cases where n is an immediate unsigned
2699 SunSpider says 3.5% faster.
2701 2008-07-01 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2705 Bug 19844: JavaScript Switch statement modifies "this"
2706 <https://bugs.webkit.org/show_bug.cgi?id=19844>
2708 Use a temporary when generating code for switch clauses to avoid
2709 overwriting 'this' or a local variable.
2712 (KJS::CaseBlockNode::emitCodeForBlock):
2714 2008-07-01 Christian Dywan <christian@twotoasts.de>
2718 * kjs/list.cpp: Include "JSCell.h"
2720 2008-07-01 Kevin McCullough <kmccullough@apple.com>
2724 * JavaScriptCore.xcodeproj/project.pbxproj:
2726 2008-07-01 Dan Bernstein <mitz@apple.com>
2728 Reviewed by Anders Carlsson.
2730 - Mac release build fix
2732 * JavaScriptCore.exp:
2734 2008-07-01 Sam Weinig <sam@webkit.org>
2736 Try and fix mac builds.
2738 * JavaScriptCore.exp:
2740 2008-07-01 Sam Weinig <sam@webkit.org>
2742 Fix non-AllInOne builds.
2746 2008-07-01 Sam Weinig <sam@webkit.org>
2748 Reviewed by Darin Adler.
2750 Split JSCell and JSNumberCell class declarations out of JSValue.h
2753 * JavaScriptCore.pri:
2754 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2755 * JavaScriptCore.xcodeproj/project.pbxproj:
2756 * JavaScriptCoreSources.bkl:
2757 * VM/JSPropertyNameIterator.h:
2758 * kjs/AllInOneFile.cpp:
2759 * kjs/JSCell.cpp: Copied from JavaScriptCore/kjs/JSValue.cpp.
2760 * kjs/JSCell.h: Copied from JavaScriptCore/kjs/JSValue.h.
2761 (KJS::JSValue::getJSNumber):
2762 * kjs/JSNumberCell.cpp:
2763 * kjs/JSNumberCell.h: Copied from JavaScriptCore/kjs/JSValue.h.
2767 (KJS::jsOwnedString):
2769 (KJS::JSValue::toThisJSString):
2773 2008-07-01 Anders Carlsson <andersca@apple.com>
2777 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2778 * kjs/JSGlobalObject.h:
2779 (KJS::JSGlobalObject::addStaticGlobals):
2781 2008-07-01 Simon Hausmann <hausmann@webkit.org>
2783 Build fix, include OwnPtr.h.
2785 * kjs/RegExpConstructor.h:
2787 2008-06-30 Geoffrey Garen <ggaren@apple.com>
2789 Reviewed by Oliver Hunt.
2791 Fixed a global object leak caused by the switch to one register file.
2793 Don't unconditionally mark the register file, since that logically
2794 makes all global variables GC roots, even when their global object is
2795 no longer reachable.
2797 Instead, make the global object associated with the register file
2798 responsible for marking the register file.
2800 2008-06-30 Geoffrey Garen <ggaren@apple.com>
2802 Reviewed by Oliver Hunt.
2804 Removed the "registerBase" abstraction. Since the register file never
2805 reallocates, we can keep direct pointers into it, instead of
2806 <registerBase, offset> tuples.
2808 SunSpider says 0.8% faster.
2810 2008-06-30 Oliver Hunt <oliver@apple.com>
2812 Reviewed by NOBODY (build fix).
2814 Fix build by adding all (hopefully) the missing includes.
2816 * kjs/BooleanPrototype.cpp:
2817 * kjs/DateConstructor.cpp:
2818 * kjs/ErrorPrototype.cpp:
2819 * kjs/FunctionPrototype.cpp:
2820 * kjs/NativeErrorConstructor.cpp:
2821 * kjs/NumberPrototype.cpp:
2822 * kjs/ObjectPrototype.cpp:
2823 * kjs/RegExpConstructor.cpp:
2824 * kjs/StringConstructor.cpp:
2825 * kjs/StringPrototype.cpp:
2827 2008-06-30 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2831 Bug 19830: REGRESSION (r34883): Google Reader doesn't show up feed list on sidebar
2832 <https://bugs.webkit.org/show_bug.cgi?id=19830>
2834 Ensure that we do not eliminate a write to a local register when doing
2835 peephole optimizations.
2837 * VM/CodeGenerator.cpp:
2838 (KJS::CodeGenerator::emitJumpIfTrue):
2839 (KJS::CodeGenerator::emitJumpIfFalse):
2841 2008-06-30 Sam Weinig <sam@webkit.org>
2843 Rubber-stamped by Darin Alder.
2845 Split InternalFunction into its own header file.
2847 * API/JSCallbackFunction.h:
2848 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2849 * JavaScriptCore.xcodeproj/project.pbxproj:
2850 * kjs/ArrayConstructor.h:
2851 * kjs/BooleanConstructor.h:
2852 * kjs/DateConstructor.h:
2853 * kjs/ErrorConstructor.h:
2854 * kjs/FunctionConstructor.h:
2855 * kjs/FunctionPrototype.h:
2856 * kjs/InternalFunction.h: Copied from kjs/JSFunction.h.
2858 * kjs/NativeErrorConstructor.h:
2859 * kjs/NumberConstructor.h:
2860 * kjs/ObjectConstructor.h:
2861 * kjs/RegExpConstructor.h:
2862 * kjs/StringConstructor.h:
2863 * profiler/Profiler.cpp:
2865 2008-06-30 Sam Weinig <sam@webkit.org>
2867 Reviewed by Kevin McCullough.
2869 Remove empty files Instruction.cpp, LabelID.cpp, Register.cpp and RegisterID.cpp.
2872 * JavaScriptCore.pri:
2873 * JavaScriptCore.xcodeproj/project.pbxproj:
2874 * JavaScriptCoreSources.bkl:
2875 * VM/Instruction.cpp: Removed.
2876 * VM/LabelID.cpp: Removed.
2877 * VM/Register.cpp: Removed.
2878 * VM/RegisterID.cpp: Removed.
2880 2008-06-30 Sam Weinig <sam@webkit.org>
2882 Rubber-stamped (reluctantly) by Kevin McCullough.
2884 Rename date_object.h/cpp to DateInstance.h/cpp
2887 * JavaScriptCore.pri:
2888 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2889 * JavaScriptCore.xcodeproj/project.pbxproj:
2890 * JavaScriptCoreSources.bkl:
2891 * kjs/AllInOneFile.cpp:
2892 * kjs/DateConstructor.cpp:
2893 * kjs/DateInstance.cpp: Copied from kjs/date_object.cpp.
2894 * kjs/DateInstance.h: Copied from kjs/date_object.h.
2895 * kjs/DatePrototype.cpp:
2896 * kjs/DatePrototype.h:
2897 * kjs/date_object.cpp: Removed.
2898 * kjs/date_object.h: Removed.
2900 2008-06-30 Sam Weinig <sam@webkit.org>
2902 Rubber-stamped by Darin Adler.
2904 Remove internal.cpp and move its contents to there own .cpp files.
2907 * JavaScriptCore.pri:
2908 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2909 * JavaScriptCore.xcodeproj/project.pbxproj:
2910 * JavaScriptCoreSources.bkl:
2911 * kjs/AllInOneFile.cpp:
2912 * kjs/GetterSetter.cpp: Copied from kjs/internal.cpp.
2913 * kjs/InternalFunction.cpp: Copied from kjs/internal.cpp.
2914 * kjs/JSNumberCell.cpp: Copied from kjs/internal.cpp.
2915 * kjs/JSString.cpp: Copied from kjs/internal.cpp.
2917 * kjs/LabelStack.cpp: Copied from kjs/internal.cpp.
2918 * kjs/NumberConstructor.cpp:
2919 * kjs/NumberObject.cpp:
2920 (KJS::constructNumber):
2921 (KJS::constructNumberFromImmediateNumber):
2922 * kjs/internal.cpp: Removed.
2924 2008-06-30 Adam Roben <aroben@apple.com>
2926 Fix <rdar://5954749> Assertion failure due to HashTable's use of
2929 HashTable was passing &value to constructDeletedValue, which in
2930 classes like WebCore::COMPtr would cause an assertion. We now pass
2931 value by reference instead of by address so that the HashTraits
2932 implementations have more flexibility in constructing the deleted
2935 Reviewed by Ada Chan.
2937 * VM/CodeGenerator.h: Updated for changes to HashTraits.
2939 (WTF::::deleteBucket): Changed to pass bucket by reference instead of
2941 (WTF::::checkKey): Ditto.
2943 (WTF::): Updated HashTraits for HashTable change.
2945 2008-07-01 Alexey Proskuryakov <ap@webkit.org>
2947 Reviewed by Cameron Zwarich.
2949 Make RegisterFile really unmap memory on destruction.
2951 This fixes run-webkit-tests --threaded, which ran out of address space in a few seconds.
2953 * VM/RegisterFile.cpp: (KJS::RegisterFile::~RegisterFile): Unmap all the memory, not just
2956 * kjs/JSGlobalObject.h: Don't include RegisterFile.h, so that changes to it don't make
2957 half of WebCore rebuild.
2959 * VM/Machine.h: Don't forward declare RegisterFile, as RegisterFile.h is included already.
2961 * VM/RegisterFile.h: (KJS::RegisterFile::RegisterFile): Assert that the allocation succeeded.
2963 2008-06-30 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2965 Rubber-stamped by Oliver.
2967 Correct the documentation for op_put_by_index.
2970 (KJS::Machine::privateExecute):
2972 2008-06-29 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2976 Bug 19821: Merge the instruction pair (less, jfalse)
2977 <https://bugs.webkit.org/show_bug.cgi?id=19821>
2979 This is a 2.4% win on SunSpider. I needed to add an ALWAYS_INLINE
2980 intrinisc to CodeGenerator::rewindBinaryOp() to avoid a massive
2981 regression in regexp-dna.
2984 (KJS::CodeBlock::dump):
2985 * VM/CodeGenerator.cpp:
2986 (KJS::CodeGenerator::rewindBinaryOp):
2987 (KJS::CodeGenerator::emitJumpIfFalse):
2989 (KJS::Machine::privateExecute):
2994 2008-06-29 Sam Weinig <sam@webkit.org>
2996 Fix non-AllInOne builds.
3001 2008-06-29 Sam Weinig <sam@webkit.org>
3006 * kjs/DatePrototype.cpp:
3008 2008-06-29 Sam Weinig <sam@webkit.org>
3010 Rubber-stamped by Cameron Zwarich.
3012 Splits ErrorConstructor, ErrorPrototype, NativeErrorConstructor and
3013 NativeErrorPrototype out of error_object.h/cpp and renames it ErrorInstance.
3016 * JavaScriptCore.pri:
3017 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3018 * JavaScriptCore.xcodeproj/project.pbxproj:
3019 * JavaScriptCoreSources.bkl:
3020 * kjs/AllInOneFile.cpp:
3021 * kjs/ArrayConstructor.cpp:
3022 * kjs/ArrayPrototype.cpp:
3023 * kjs/BooleanPrototype.cpp:
3024 * kjs/DatePrototype.cpp:
3025 * kjs/ErrorConstructor.cpp: Copied from kjs/error_object.cpp.
3026 * kjs/ErrorConstructor.h: Copied from kjs/error_object.h.
3027 * kjs/ErrorInstance.cpp: Copied from kjs/error_object.cpp.
3028 * kjs/ErrorInstance.h: Copied from kjs/error_object.h.
3029 * kjs/ErrorPrototype.cpp: Copied from kjs/error_object.cpp.
3030 * kjs/ErrorPrototype.h: Copied from kjs/error_object.h.
3031 * kjs/JSGlobalObject.cpp:
3034 * kjs/NativeErrorConstructor.cpp: Copied from kjs/error_object.cpp.
3035 * kjs/NativeErrorConstructor.h: Copied from kjs/error_object.h.
3036 * kjs/NativeErrorPrototype.cpp: Copied from kjs/error_object.cpp.
3037 * kjs/NativeErrorPrototype.h: Copied from kjs/error_object.h.
3038 * kjs/NumberPrototype.cpp:
3039 * kjs/RegExpConstructor.cpp:
3040 * kjs/RegExpObject.cpp:
3041 * kjs/RegExpPrototype.cpp:
3042 * kjs/StringPrototype.cpp:
3043 * kjs/error_object.cpp: Removed.
3044 * kjs/error_object.h: Removed.
3047 2008-06-29 Sam Weinig <sam@webkit.org>
3049 Fix non-AllInOne build.
3051 * kjs/DateConstructor.cpp:
3055 2008-06-29 Sam Weinig <sam@webkit.org>
3057 Rubber-stamped by Oliver Hunt.
3059 Splits DateConstructor and DatePrototype out of date_object.h/cpp
3060 Moves shared Date code into DateMath.
3062 * DerivedSources.make:
3064 * JavaScriptCore.pri:
3065 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3066 * JavaScriptCore.xcodeproj/project.pbxproj:
3067 * JavaScriptCoreSources.bkl:
3068 * kjs/AllInOneFile.cpp:
3069 * kjs/DateConstructor.cpp: Copied from kjs/date_object.cpp.
3070 * kjs/DateConstructor.h: Copied from kjs/date_object.h.
3072 (KJS::ymdhmsToSeconds):
3074 (KJS::skipSpacesAndComments):
3079 (KJS::formatDateUTCVariant):
3083 * kjs/DatePrototype.cpp: Copied from kjs/date_object.cpp.
3084 * kjs/DatePrototype.h: Copied from kjs/date_object.h.
3085 * kjs/JSGlobalObject.cpp:
3087 * kjs/date_object.cpp:
3088 * kjs/date_object.h:
3091 2008-06-29 Jan Michael Alonzo <jmalonzo@webkit.org>
3093 Rubber-stamped by Cameron Zwarich
3095 Fix Gtk non-AllInOne build
3097 * GNUmakefile.am: include JSVariableObject.cpp
3098 * kjs/RegExpConstructor.cpp: include RegExpObject.h
3099 * kjs/RegExpObject.h: forward declare RegExpPrototype
3101 2008-06-28 Darin Adler <darin@apple.com>
3103 Reviewed by Sam and Cameron.
3105 - fix https://bugs.webkit.org/show_bug.cgi?id=19805
3106 Array.concat turns missing array elements into "undefined"
3108 Test: fast/js/array-holes.html
3110 * JavaScriptCore.exp: No longer export JSArray::getItem.
3112 * kjs/ArrayPrototype.cpp:
3113 (KJS::arrayProtoFuncConcat): Changed to use getProperty instead of
3114 JSArray::getItem -- need to handle properties from the prototype chain
3115 instead of ignoring them.
3117 * kjs/JSArray.cpp: Removed getItem.
3118 * kjs/JSArray.h: Ditto.
3120 2008-06-28 Darin Adler <darin@apple.com>
3122 Reviewed by Cameron.
3124 - https://bugs.webkit.org/show_bug.cgi?id=19804
3125 optimize access to arrays without "holes"
3127 SunSpider says 1.8% faster.
3130 (KJS::JSArray::JSArray): Initialize m_fastAccessCutoff when creating
3131 arrays. Also updated for new location of m_vectorLength.
3132 (KJS::JSArray::getItem): Updated for new location of m_vectorLength.
3133 (KJS::JSArray::getSlowCase): Added. Broke out the non-hot parts of
3134 getOwnPropertySlot to make the hot part faster.
3135 (KJS::JSArray::getOwnPropertySlot): Added a new faster case for
3136 indices lower than m_fastAccessCutoff. We can do theese with no
3137 additional checks or branches.
3138 (KJS::JSArray::put): Added a new faster case for indices lower than
3139 m_fastAccessCutoff. We can do theese with no additional checks or
3140 branches. Moved the maxArrayIndex handling out of this function.
3141 Added code to set m_fastAccessCutoff when the very last hole in
3142 an array is filled; this is how the cutoff gets set for most arrays.
3143 (KJS::JSArray::putSlowCase): Moved the rest of the put function logic
3144 in here, to make the hot part of the put function faster.
3145 (KJS::JSArray::deleteProperty): Added code to lower m_fastAccessCutoff
3146 when a delete makes a new hole in the array.
3147 (KJS::JSArray::getPropertyNames): Updated for new location of
3149 (KJS::JSArray::increaseVectorLength): Ditto.
3150 (KJS::JSArray::setLength): Added code to lower m_fastAccessCutoff
3151 when setLength makes the array smaller.
3152 (KJS::JSArray::mark): Updated for new location of m_vectorLength.
3153 (KJS::JSArray::sort): Ditto. Set m_fastAccessCutoff after moving
3154 all the holes to the end of the array.
3155 (KJS::JSArray::compactForSorting): Ditto.
3156 (KJS::JSArray::checkConsistency): Added consistency checks fro
3157 m_fastAccessCutoff and updated for the new location of m_vectorLength.
3159 * kjs/JSArray.h: Added declarations for slow case functions.
3160 Replaced m_vectorLength with m_fastAccessCutoff.
3162 2008-06-28 Cameron Zwarich <cwzwarich@uwaterloo.ca>
3166 When executing a native call, check for an exception before writing the
3170 (KJS::Machine::privateExecute):
3172 2008-06-28 Mark Rowe <mrowe@apple.com>
3174 Build fix. Flag headers as private or public as is appropriate.
3175 These settings were accidentally removed during some project file cleanup.
3177 * JavaScriptCore.xcodeproj/project.pbxproj:
3179 2008-06-28 Sam Weinig <sam@webkit.org>
3181 Rubber-stamped by Darin Adler.
3183 Splits RegExpConstructor and RegExpPrototype out of RegExpObject.h/cpp
3185 * DerivedSources.make:
3187 * JavaScriptCore.pri:
3188 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3189 * JavaScriptCore.xcodeproj/project.pbxproj:
3190 * JavaScriptCoreSources.bkl:
3192 * kjs/AllInOneFile.cpp:
3193 * kjs/JSGlobalObject.cpp:
3194 * kjs/RegExpConstructor.cpp: Copied from kjs/RegExpObject.cpp.
3195 * kjs/RegExpConstructor.h: Copied from kjs/RegExpObject.h.
3196 * kjs/RegExpObject.cpp:
3197 * kjs/RegExpObject.h:
3198 * kjs/RegExpPrototype.cpp: Copied from kjs/RegExpObject.cpp.
3199 * kjs/RegExpPrototype.h: Copied from kjs/RegExpObject.h.
3200 * kjs/StringPrototype.cpp:
3203 2008-06-28 Sam Weinig <sam@webkit.org>
3205 Fix non-AllInOne builds.
3207 * kjs/StringConstructor.cpp:
3209 2008-06-28 Sam Weinig <sam@webkit.org>
3211 Rubber-stamped by Darin Adler.
3213 Rename string_object.h/cpp to StringObject.h/cpp and split out StringObjectThatMasqueradesAsUndefined,
3214 StringConstructor and StringPrototype.
3216 * DerivedSources.make:
3218 * JavaScriptCore.pri:
3219 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3220 * JavaScriptCore.xcodeproj/project.pbxproj:
3221 * JavaScriptCoreSources.bkl:
3222 * kjs/AllInOneFile.cpp:
3223 * kjs/JSGlobalObject.cpp:
3224 * kjs/StringConstructor.cpp: Copied from JavaScriptCore/kjs/string_object.cpp.
3225 * kjs/StringConstructor.h: Copied from JavaScriptCore/kjs/string_object.h.
3226 * kjs/StringObject.cpp: Copied from JavaScriptCore/kjs/string_object.cpp.
3227 * kjs/StringObject.h: Copied from JavaScriptCore/kjs/string_object.h.
3228 * kjs/StringObjectThatMasqueradesAsUndefined.h: Copied from JavaScriptCore/kjs/string_object.h.
3229 * kjs/StringPrototype.cpp: Copied from JavaScriptCore/kjs/string_object.cpp.
3230 * kjs/StringPrototype.h: Copied from JavaScriptCore/kjs/string_object.h.
3232 * kjs/string_object.cpp: Removed.
3233 * kjs/string_object.h: Removed.
3235 2008-06-28 Jan Michael Alonzo <jmalonzo@webkit.org>
3237 Gtk build fix: JSVariableObject is now part of AllInOne
3241 2008-06-28 Darin Adler <darin@apple.com>
3245 - https://bugs.webkit.org/show_bug.cgi?id=19801
3246 add a feature so we can tell what regular expressions are taking time
3248 * pcre/pcre_compile.cpp:
3249 (jsRegExpCompile): Compile in the string if REGEXP_HISTOGRAM is on.
3251 * pcre/pcre_exec.cpp:
3252 (jsRegExpExecute): Add hook to time execution.
3253 (Histogram::~Histogram): Print a sorted list of what took time.
3254 (Histogram::add): Accumulate records of what took time.
3255 (HistogramTimeLogger::~HistogramTimeLogger): Hook that calls
3256 Histogram::add at the right moment and creates the global histogram
3259 * pcre/pcre_internal.h: Define REGEXP_HISTOGRAM.
3261 * pcre/pcre_tables.cpp: Added missing include of "config.h". Not needed
3262 any more, but an omissions an earlier version of this patch detected.
3263 * pcre/pcre_ucp_searchfuncs.cpp: Ditto.
3264 * pcre/pcre_xclass.cpp: Ditto.
3266 2008-06-28 Sam Weinig <sam@webkit.org>
3268 Try and fix the Windows build again.
3270 * kjs/RegExpObject.cpp:
3271 * kjs/date_object.cpp:
3272 * kjs/error_object.cpp:
3274 2008-06-28 Sam Weinig <sam@webkit.org>
3276 Rubber-stamped by Darin Adler.
3278 Remove unused StringConstructorFunction class.
3280 * kjs/string_object.h:
3282 2008-06-28 Sam Weinig <sam@webkit.org>
3286 * kjs/ArrayPrototype.cpp:
3287 * kjs/BooleanPrototype.cpp:
3288 * kjs/BooleanPrototype.h:
3289 * kjs/FunctionPrototype.cpp:
3290 * kjs/JSImmediate.cpp:
3292 * kjs/MathObject.cpp:
3293 * kjs/NumberPrototype.cpp:
3294 * kjs/NumberPrototype.h:
3295 * kjs/ObjectConstructor.cpp:
3296 * kjs/RegExpObject.h:
3297 * kjs/error_object.h:
3298 * kjs/string_object.cpp:
3300 2008-06-28 Sam Weinig <sam@webkit.org>
3302 Rubber-stamped by Oliver Hunt.
3304 Splits FunctionConstructor out of FunctionPrototype.h/cpp
3305 Splits NumberConstructor and NumberPrototype out of NumberObject.h/cpp
3306 Rename object_object.h/cpp to ObjectPrototype.h/cpp and split out ObjectConstructor.
3308 * API/JSCallbackConstructor.cpp:
3309 * API/JSClassRef.cpp:
3310 * API/JSObjectRef.cpp:
3311 * DerivedSources.make:
3313 * JavaScriptCore.pri:
3314 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3315 * JavaScriptCore.xcodeproj/project.pbxproj:
3316 * JavaScriptCoreSources.bkl:
3318 * kjs/AllInOneFile.cpp:
3319 * kjs/ArrayConstructor.cpp:
3320 * kjs/ArrayConstructor.h:
3321 * kjs/FunctionConstructor.cpp: Copied from JavaScriptCore/kjs/FunctionPrototype.cpp.
3322 * kjs/FunctionConstructor.h: Copied from JavaScriptCore/kjs/FunctionPrototype.h.
3323 * kjs/FunctionPrototype.cpp:
3324 * kjs/FunctionPrototype.h:
3325 * kjs/JSFunction.cpp:
3326 * kjs/JSGlobalObject.cpp:
3327 * kjs/JSImmediate.cpp:
3329 * kjs/NumberConstructor.cpp: Copied from JavaScriptCore/kjs/NumberObject.cpp.
3330 * kjs/NumberConstructor.h: Copied from JavaScriptCore/kjs/NumberObject.h.
3331 * kjs/NumberObject.cpp:
3332 * kjs/NumberObject.h:
3333 * kjs/NumberPrototype.cpp: Copied from JavaScriptCore/kjs/NumberObject.cpp.
3334 * kjs/NumberPrototype.h: Copied from JavaScriptCore/kjs/NumberObject.h.
3335 * kjs/ObjectConstructor.cpp: Copied from JavaScriptCore/kjs/object_object.cpp.
3336 * kjs/ObjectConstructor.h: Copied from JavaScriptCore/kjs/object_object.h.
3337 * kjs/ObjectPrototype.cpp: Copied from JavaScriptCore/kjs/object_object.cpp.
3338 * kjs/ObjectPrototype.h: Copied from JavaScriptCore/kjs/object_object.h.
3339 * kjs/RegExpObject.h:
3341 * kjs/error_object.h:
3344 * kjs/object_object.cpp: Removed.
3345 * kjs/object_object.h: Removed.
3346 * kjs/string_object.h:
3348 2008-06-28 Darin Adler <darin@apple.com>
3352 - fix https://bugs.webkit.org/show_bug.cgi?id=19796
3353 optimize expressions with ignored results (especially post-increment)
3355 SunSpider says 0.9% faster.
3357 * VM/CodeGenerator.h:
3358 (KJS::CodeGenerator::tempDestination): Create a new temporary for
3359 ignoredResult() too, just as we would for 0.
3360 (KJS::CodeGenerator::finalDestination): Use the temporary if the
3361 register passed in is ignoredResult() too, just as we would for 0.
3362 (KJS::CodeGenerator::destinationForAssignResult): Return 0 if the
3363 passed in register is ignoredResult(), just as we would for 0.
3364 (KJS::CodeGenerator::moveToDestinationIfNeeded): Return 0 if the
3365 register passed in is ignoredResult(). What matters is that we
3366 don't want to emit a move. The return value won't be looked at.
3367 (KJS::CodeGenerator::emitNode): Allow ignoredResult() and pass it
3368 through to the node's emitCode function.
3371 (KJS::ignoredResult): Added. Special value to indicate the result of
3372 a node will be ignored and need not be put in any register.
3375 (KJS::NullNode::emitCode): Do nothing if dst == ignoredResult().
3376 (KJS::BooleanNode::emitCode): Ditto.
3377 (KJS::NumberNode::emitCode): Ditto.
3378 (KJS::StringNode::emitCode): Ditto.
3379 (KJS::RegExpNode::emitCode): Ditto.
3380 (KJS::ThisNode::emitCode): Ditto.
3381 (KJS::ResolveNode::emitCode): Do nothing if dst == ignoredResult() and
3382 the identifier resolves to a local variable.
3383 (KJS::ObjectLiteralNode::emitCode): Do nothing if dst == ignoredResult()
3384 and the object is empty.
3385 (KJS::PostIncResolveNode::emitCode): If dst == ignoredResult(), then do
3386 nothing for the local constant case, and do a pre-increment in all the
3388 (KJS::PostDecResolveNode::emitCode): Ditto.
3389 (KJS::PostIncBracketNode::emitCode): Ditto.
3390 (KJS::PostDecBracketNode::emitCode): Ditto.
3391 (KJS::PostIncDotNode::emitCode): Ditto.
3392 (KJS::PostDecDotNode::emitCode): Ditto.
3393 (KJS::DeleteValueNode::emitCode): Pass ignoredResult() when evaluating
3395 (KJS::VoidNode::emitCode): Ditto.
3396 (KJS::TypeOfResolveNode::emitCode): If dst == ignoredResult(), do nothing
3397 if the identifier resolves to a local variable, and don't bother generating
3398 a typeof opcode in the other case.
3399 (KJS::TypeOfValueNode::emitCode): Ditto.
3400 (KJS::PreIncResolveNode::emitCode): Do nothing if dst == ignoredResult() and
3401 the identifier resolves to a local constant.
3402 (KJS::PreDecResolveNode::emitCode): Ditto.
3403 (KJS::AssignResolveNode::emitCode): Turn ignoredResult() into 0 in a couple
3404 places, because we need to put the result into a register so we can assign
3405 it. At other sites this is taken care of by functions like finalDestination.
3406 (KJS::CommaNode::emitCode): Pass ignoredResult() when evaluating the first
3408 (KJS::ForNode::emitCode): Pass ignoredResult() when evaluating the first and
3410 (KJS::ForInNode::emitCode): Pass ignoredResult() when evaluating the first
3413 2008-06-28 Darin Adler <darin@apple.com>
3417 - https://bugs.webkit.org/show_bug.cgi?id=19787
3418 create most arrays from values in registers rather than with multiple put operations
3420 SunSpider says 0.8% faster.
3423 (KJS::CodeBlock::dump): Added argv and argc parameters to new_array.
3425 (KJS::Machine::privateExecute): Ditto.
3427 * VM/CodeGenerator.cpp:
3428 (KJS::CodeGenerator::emitNewArray): Added.
3429 * VM/CodeGenerator.h: Added ElementNode* argument to emitNewArray.
3432 (KJS::ArrayNode::emitCode): Pass the ElementNode to emitNewArray so it can be
3433 initialized with as many elements as possible. If the array doesn't have any
3434 holes in it, that's all that's needed. If there are holes, then emit some separate
3435 put operations for the other values in the array and for the length as needed.
3437 * kjs/nodes.h: Added some accessors to ElementNode so the code generator can
3438 iterate through elements and generate code to evaluate them. Now ArrayNode does
3439 not need to be a friend. Also took out some unused PlacementNewAdoptType
3442 2008-06-28 Darin Adler <darin@apple.com>
3446 * kjs/nodes.h: Remove obsolete PlacementNewAdopt constructors.
3447 We no longer mutate the AST in place.
3449 2008-06-28 Jan Michael Alonzo <jmalonzo@webkit.org>
3451 Reviewed by Oliver Hunt.
3455 * VM/Machine.cpp: include stdio.h for printf
3457 2008-06-27 Sam Weinig <sam@webkit.org>
3459 Reviewed by Oliver Hunt.
3461 Fix platforms that don't use AllInOne.cpp
3463 * kjs/BooleanConstructor.h:
3464 * kjs/BooleanPrototype.h:
3465 * kjs/FunctionPrototype.cpp:
3467 2008-06-27 Sam Weinig <sam@webkit.org>
3469 Rubber-stamped by Oliver Hunt.
3471 Splits ArrayConstructor out of ArrayPrototype.h/cpp
3472 Splits BooleanConstructor and BooleanPrototype out of BooleanObject.h/cpp
3475 * JavaScriptCore.pri:
3476 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3477 * JavaScriptCore.xcodeproj/project.pbxproj:
3478 * JavaScriptCoreSources.bkl:
3480 * kjs/AllInOneFile.cpp:
3481 * kjs/ArrayConstructor.cpp: Copied from kjs/ArrayPrototype.cpp.
3482 * kjs/ArrayConstructor.h: Copied from kjs/ArrayPrototype.h.
3483 * kjs/ArrayPrototype.cpp:
3484 * kjs/ArrayPrototype.h:
3485 * kjs/BooleanConstructor.cpp: Copied from kjs/BooleanObject.cpp.
3486 * kjs/BooleanConstructor.h: Copied from kjs/BooleanObject.h.
3487 * kjs/BooleanObject.cpp:
3488 * kjs/BooleanObject.h:
3489 * kjs/BooleanPrototype.cpp: Copied from kjs/BooleanObject.cpp.
3490 * kjs/BooleanPrototype.h: Copied from kjs/BooleanObject.h.
3491 * kjs/CommonIdentifiers.h:
3492 * kjs/FunctionPrototype.cpp:
3494 * kjs/JSGlobalObject.cpp:
3495 * kjs/JSImmediate.cpp:
3499 * kjs/string_object.cpp:
3501 2008-06-27 Oliver Hunt <oliver@apple.com>
3505 Bug 18626: SQUIRRELFISH: support the "slow script" dialog <https://bugs.webkit.org/show_bug.cgi?id=18626>
3506 <rdar://problem/5973931> Slow script dialog needs to be reimplemented for squirrelfish
3508 Adds support for the slow script dialog in squirrelfish. This requires the addition
3509 of three new op codes, op_loop, op_loop_if_true, and op_loop_if_less which have the
3510 same behaviour as their simple jump equivalents but have an additional time out check.
3512 Additional assertions were added to other jump instructions to prevent accidentally
3513 creating loops with jump types that do not support time out checks.
3515 Sunspider does not report a regression, however this appears very sensitive to code
3516 layout and hardware, so i would expect up to a 1% regression on other systems.
3518 Part of this required moving the old timeout logic from JSGlobalObject and into Machine
3519 which is the cause of a number of the larger diff blocks.
3521 * JavaScriptCore.exp:
3523 (KJS::CodeBlock::dump):
3524 * VM/CodeGenerator.cpp:
3525 (KJS::CodeGenerator::emitJumpIfTrue):
3526 (KJS::CodeGenerator::emitJumpScopes):
3527 * VM/ExceptionHelpers.cpp:
3528 (KJS::InterruptedExecutionError::isWatchdogException):
3529 (KJS::createInterruptedExecutionException):
3530 * VM/ExceptionHelpers.h:
3533 (KJS::Machine::Machine):
3534 (KJS::Machine::throwException):
3535 (KJS::Machine::resetTimeoutCheck):
3536 (KJS::getCurrentTime):
3537 (KJS::Machine::checkTimeout):
3538 (KJS::Machine::privateExecute):
3540 (KJS::Machine::setTimeoutTime):
3541 (KJS::Machine::startTimeoutCheck):
3542 (KJS::Machine::stopTimeoutCheck):
3543 (KJS::Machine::initTimeout):
3547 * kjs/JSGlobalObject.cpp:
3548 (KJS::JSGlobalObject::init):
3549 (KJS::JSGlobalObject::setTimeoutTime):
3550 (KJS::JSGlobalObject::startTimeoutCheck):