1 2008-03-17 Oliver Hunt <oliver@apple.com>
5 Optimise multi-scope function call resolution
7 Refactor multiscope variable resolution and use to add
8 optimised FunctionCallResolveNode subclasses.
10 2.6% gain in sunspider performance, *25%* gain in controlflow-recursive
13 (KJS::getSymbolTableEntry):
14 (KJS::ResolveNode::optimizeVariableAccess):
15 (KJS::getNonLocalSymbol):
16 (KJS::ExpressionNode::resolveAndCall):
17 (KJS::FunctionCallResolveNode::optimizeVariableAccess):
18 (KJS::FunctionCallResolveNode::inlineEvaluate):
19 (KJS::ScopedVarFunctionCallNode::inlineEvaluate):
20 (KJS::ScopedVarFunctionCallNode::evaluate):
21 (KJS::ScopedVarFunctionCallNode::evaluateToNumber):
22 (KJS::ScopedVarFunctionCallNode::evaluateToBoolean):
23 (KJS::ScopedVarFunctionCallNode::evaluateToInt32):
24 (KJS::ScopedVarFunctionCallNode::evaluateToUInt32):
25 (KJS::NonLocalVarFunctionCallNode::inlineEvaluate):
26 (KJS::NonLocalVarFunctionCallNode::evaluate):
27 (KJS::NonLocalVarFunctionCallNode::evaluateToNumber):
28 (KJS::NonLocalVarFunctionCallNode::evaluateToBoolean):
29 (KJS::NonLocalVarFunctionCallNode::evaluateToInt32):
30 (KJS::NonLocalVarFunctionCallNode::evaluateToUInt32):
32 (KJS::ScopedVarFunctionCallNode::):
33 (KJS::NonLocalVarFunctionCallNode::):
35 2008-03-17 David Kilzer <ddkilzer@apple.com>
37 Don't define PLATFORM(MIDDLE_ENDIAN) on little endian ARM.
41 See <http://bugs.webkit.org/show_bug.cgi?id=15416#c13>.
43 * wtf/Platform.h: Added check for !defined(__ARMEL__) when defining
44 PLATFORM(MIDDLE_ENDIAN).
46 2008-03-17 Oliver Hunt <oliver@apple.com>
48 Reviewed by Geoff, Darin and Weinig.
50 Add fast multi-level scope lookup
52 Add logic and AST nodes to provide rapid variable resolution across
53 static scope boundaries. This also adds logic that allows us to skip
54 any static scopes that do not contain the variable to be resolved.
56 This results in a ~2.5% speedup in SunSpider, and gives a 25-30% speedup
57 in some simple and ad hoc closure and global variable access tests.
61 * kjs/JSGlobalObject.cpp:
62 * kjs/JSGlobalObject.h:
63 * kjs/JSVariableObject.cpp:
64 * kjs/JSVariableObject.h:
66 (KJS::ActivationImp::isDynamicScope):
68 (KJS::ResolveNode::optimizeVariableAccess):
69 (KJS::ScopedVarAccessNode::inlineEvaluate):
70 (KJS::ScopedVarAccessNode::evaluate):
71 (KJS::ScopedVarAccessNode::evaluateToNumber):
72 (KJS::ScopedVarAccessNode::evaluateToBoolean):
73 (KJS::ScopedVarAccessNode::evaluateToInt32):
74 (KJS::ScopedVarAccessNode::evaluateToUInt32):
75 (KJS::NonLocalVarAccessNode::inlineEvaluate):
76 (KJS::NonLocalVarAccessNode::evaluate):
77 (KJS::NonLocalVarAccessNode::evaluateToNumber):
78 (KJS::NonLocalVarAccessNode::evaluateToBoolean):
79 (KJS::NonLocalVarAccessNode::evaluateToInt32):
80 (KJS::NonLocalVarAccessNode::evaluateToUInt32):
81 (KJS::IfElseNode::optimizeVariableAccess):
82 (KJS::ScopeNode::optimizeVariableAccess):
84 (KJS::ScopedVarAccessNode::):
85 (KJS::NonLocalVarAccessNode::):
88 2008-03-16 weihongzeng <weihong.zeng@hotmail.com>
90 Reviewed by Darin Adler.
92 http://bugs.webkit.org/show_bug.cgi?id=15416
93 Add support for mixed-endian processors
95 * kjs/dtoa.cpp: Add IEEE_ARM, triggered by PLATFORM(MIDDLE_ENDIAN).
97 2008-03-16 Kevin Ollivier <kevino@theolliviers.com>
99 Rubber stamped by Darin.
101 Add set-webkit-configuration support for wx port, and centralize
102 build dir location setting.
104 http://bugs.webkit.org/show_bug.cgi?id=17790
108 2008-03-14 Steve Falkenburg <sfalken@apple.com>
112 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
114 2008-03-14 Oliver Hunt <oliver@apple.com>
118 Add logic to track whether a function uses a locally scoped eval or requires a closure
120 Now that we limit eval we can track those uses of eval that operate
121 in the local scope and functions that require a closure. We track
122 this information during initial parsing to avoid yet another tree
125 * JavaScriptCore.exp:
128 (KJS::Parser::didFinishParsing):
130 (KJS::Parser::parse):
133 (KJS::ScopeNode::ScopeNode):
134 (KJS::ProgramNode::ProgramNode):
135 (KJS::ProgramNode::create):
136 (KJS::EvalNode::EvalNode):
137 (KJS::EvalNode::create):
138 (KJS::FunctionBodyNode::FunctionBodyNode):
139 (KJS::FunctionBodyNode::create):
142 (KJS::ScopeNode::usesEval):
143 (KJS::ScopeNode::needsClosure):
145 2008-03-14 Geoffrey Garen <ggaren@apple.com>
147 Reviewed by Beth Dakin.
149 Fixed another problem with Vector::shrinkCapacity.
151 moveOverlapping isn't good enough for the case where the buffer hasn't
152 changed, because it still destroys the contents of the buffer.
155 (WTF::::shrinkCapacity): Changed to explicitly check whether the call
156 to allocateBuffer produced a new buffer. If it didn't, there's no need
159 2008-03-14 Geoffrey Garen <ggaren@apple.com>
161 Reviewed by Beth Dakin.
163 Fixed a few problems with Vector::shrinkCapacity that I noticed in testing.
166 (WTF::VectorBufferBase::deallocateBuffer): Clear our m_buffer pointer
167 when we deallocate m_buffer, in case we're not asked to reallocate a new
168 buffer. (Otherwise, we would use a stale m_buffer if we were asked to
169 perform any operations after shrinkCapacity was called.)
171 (WTF::VectorBuffer::allocateBuffer): Made VectorBuffer with inline
172 capacity aware that calls to allocateBuffer might be shrinks, rather
173 than grows, so we shouldn't allocate a new buffer on the heap unless
174 our inline buffer is too small.
176 (WTF::::shrinkCapacity): Call resize() instead of just setting m_size,
177 so destructors run. Call resize before reallocating the buffer to make
178 sure that we still have access to the objects we need to destroy. Call
179 moveOverlapping instead of move, since a call to allocateBuffer on an
180 inline buffer may produce identical storage.
182 2008-03-14 Alexey Proskuryakov <ap@webkit.org>
186 Get rid of a localime() call on platforms that have better alternatives.
188 * kjs/DateMath.h: Added getLocalTime();
192 (KJS::getDSTOffsetSimple):
193 Implementation moved from getDSTOffsetSimple().
195 * kjs/date_object.cpp:
196 (KJS::DateObjectImp::callAsFunction): Switched to getLocalTime().
198 2008-03-14 David D. Kilzer <ddkilzer@apple.com>
200 Unify concept of enabling the Mac Java bridge.
202 Reviewed by Darin and Anders.
204 * wtf/Platform.h: Define ENABLE_MAC_JAVA_BRIDGE here.
206 2008-03-13 Mark Mentovai <mark@moxienet.com>
208 Reviewed by eseidel. Landed by eseidel.
210 * wtf/FastMalloc.cpp: #include <wtf/HashSet.h> outside of any
213 2008-03-13 Mark Mentovai <mark@moxienet.com>
215 Reviewed by eseidel. Landed by eseidel.
217 * pcre/pcre_exec.cpp: Fix misnamed variable, allowing -DDEBUG build
219 * wtf/ThreadingPthreads.cpp: #include <sys/time.h> for gettimeofday
222 2008-03-13 Steve Falkenburg <sfalken@apple.com>
226 Disable PGO for normal release builds.
227 Added work-in-progress Release_PGOInstrument/Release_PGOOptimize targets.
229 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
231 2008-03-13 Beth Dakin <bdakin@apple.com>
235 Adding new functionality to Vector. Currently all of the shrink and
236 resize functions on Vector only shrink the size of the Vector, not
237 the capacity. For the Vector to take up as little memory as
238 possible, though, it is necessary to be able to shrink the capacity
239 as well. So this patch adds that functionality.
241 I need this for a speed up I am working on, and Geoff wants to use
242 it in a speed up he is working on also, so he asked me to commit it
246 (WTF::VectorBufferBase::allocateBuffer):
247 (WTF::::shrinkCapacity):
249 2008-03-13 Simon Hausmann <hausmann@webkit.org>
251 Reviewed by Adam Roben.
253 Attempt at fixing the Qt/Windows build bot. Quote using double-quotes
254 instead of single quotes.
258 2008-03-12 Steve Falkenburg <sfalken@apple.com>
262 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
264 2008-03-12 Alp Toker <alp@atoker.com>
266 Another autotools testkjs build fix attempt.
270 2008-03-12 Alp Toker <alp@atoker.com>
272 Attempt to fix the autotools testkjs build on systems with
273 non-standard include paths.
277 2008-03-11 Alexey Proskuryakov <ap@webkit.org>
281 <rdar://problem/5787743> REGRESSION: Crash at WTF::Collator::CreateCollator() running fast/js/kde/StringObject.html on Windows
283 * wtf/unicode/icu/CollatorICU.cpp:
284 (WTF::Collator::createCollator): Check for null (== user default) m_locale before calling strcmp.
286 2008-03-11 Steve Falkenburg <sfalken@apple.com>
288 Disable LTCG/PGO for grammar.cpp and nodes.cpp.
289 PGO on these files causes us to hang.
291 Copy newer vsprops files from relative WebKitLibraries path to environment variable based path.
295 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
296 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
298 2008-03-10 Darin Adler <darin@apple.com>
302 * kjs/function.cpp: (KJS::decode): Initialize variable.
304 2008-03-10 Brent Fulgham <bfulgham@gmail.com>
310 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
311 Set the PATH to include Cygwin before running touch.
313 2008-03-10 Eric Seidel <eric@webkit.org>
315 Build fix for JSC on windows.
317 * API/JSStringRefCF.cpp:
318 (JSStringCreateWithCFString):
321 * kjs/nodes2string.cpp:
322 (KJS::escapeStringForPrettyPrinting):
324 2008-03-10 Eric Seidel <eric@webkit.org>
326 No review, build fix only.
328 Attempt to fix the windows build?
330 * kjs/ustring.h: change unsigned short to UChar
332 2008-03-10 Eric Seidel <eric@webkit.org>
336 Remove KJS::UChar, use ::UChar instead
337 http://bugs.webkit.org/show_bug.cgi?id=17017
339 * API/JSStringRef.cpp:
340 (JSStringCreateWithCharacters):
341 (JSStringCreateWithUTF8CString):
342 * API/JSStringRefCF.cpp:
343 (JSStringCreateWithCFString):
344 * JavaScriptCore.exp:
350 (KJS::globalFuncEscape):
351 (KJS::globalFuncUnescape):
352 * kjs/function_object.cpp:
353 (KJS::FunctionObjectImp::construct):
354 * kjs/identifier.cpp:
355 (KJS::Identifier::equal):
356 (KJS::CStringTranslator::translate):
359 (KJS::Lexer::setCode):
362 (KJS::Lexer::convertUnicode):
363 (KJS::Lexer::makeIdentifier):
366 * kjs/nodes2string.cpp:
367 (KJS::escapeStringForPrettyPrinting):
368 (KJS::SourceStream::operator<<):
370 (KJS::RegExp::RegExp):
371 (KJS::RegExp::match):
372 * kjs/string_object.cpp:
373 (KJS::substituteBackreferences):
374 (KJS::stringProtoFuncCharCodeAt):
375 (KJS::stringProtoFuncToLowerCase):
376 (KJS::stringProtoFuncToUpperCase):
377 (KJS::stringProtoFuncToLocaleLowerCase):
378 (KJS::stringProtoFuncToLocaleUpperCase):
380 (KJS::UString::Rep::computeHash):
381 (KJS::UString::UString):
382 (KJS::UString::append):
383 (KJS::UString::ascii):
384 (KJS::UString::operator=):
385 (KJS::UString::is8Bit):
386 (KJS::UString::toStrictUInt32):
387 (KJS::UString::find):
391 (KJS::UString::UTF8String):
395 2008-03-09 Steve Falkenburg <sfalken@apple.com>
397 Stop Windows build if an error occurs in a prior project.
399 Rubber stamped by Darin.
401 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
402 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
403 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
404 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
406 2008-03-09 J¸rg Billeter <j@bitron.ch>
408 Reviewed by Alp Toker.
410 Conditionalise ICU for Unicode in the GTK+ port.
414 2008-03-07 David D. Kilzer <ddkilzer@apple.com>
416 Unify concept of enabling Netscape Plug-in API (NPAPI).
420 * wtf/Platform.h: Define ENABLE_NETSCAPE_PLUGIN_API here.
422 2008-03-07 Geoffrey Garen <ggaren@apple.com>
424 Reviewed by Darin Adler.
426 Fixed <rdar://problem/5689093> Stricter (ES4) eval semantics
430 - "eval(s)" is treated as an operator that gives the ES3 eval behavior.
431 ... but only if there is no overriding declaration of "eval" in scope.
432 - All other invocations treat eval as a function that evaluates a
433 script in the context of its "this" object.
434 ... but if its "this" object is not the global object it was
435 originally associated with, eval throws an exception.
437 Because only expressions of the form "eval(s)" have access to local
438 scope, the compiler can now statically determine whether a function
439 needs local scope to be dynamic.
441 * kjs/nodes.h: Added FunctionCallEvalNode. It works just like
442 FuncationCallResolveNode, except it statically indicates that the node
443 may execute eval in the ES3 way.
445 * kjs/nodes2string.cpp:
447 * tests/mozilla/expected.html: This patch happens to fix a Mozilla JS
448 test, but it's a bit of a pyrrhic victory. The test intends to test
449 Mozilla's generic API for calling eval on any object, but, in reality,
450 we only support calling eval on the global object.
452 2008-03-06 Steve Falkenburg <sfalken@apple.com>
456 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
458 2008-03-06 Steve Falkenburg <sfalken@apple.com>
462 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
464 2008-03-06 Alp Toker <alp@atoker.com>
466 Fix the build fix in r30845 to support out-of-tree builds.
470 2008-03-06 Steve Falkenburg <sfalken@apple.com>
474 * wtf/ThreadingWin.cpp:
475 (WTF::ThreadCondition::timedWait):
477 2008-03-06 Darin Adler <darin@apple.com>
479 - another small step towards fixing the Qt build
481 * JavaScriptCore.pri: Remove more references to the now-obsolete bindings directory.
483 2008-03-06 Darin Adler <darin@apple.com>
485 - a small step towards fixing the Qt build
487 * JavaScriptCore.pri: Remove references to files no longer present in JavaScriptCore/bindings.
489 2008-03-06 Brady Eidson <beidson@apple.com>
493 * wtf/ThreadingGtk.cpp:
494 (WTF::ThreadCondition::timedWait):
496 2008-03-06 Alexey Proskuryakov <ap@webkit.org>
500 * wtf/unicode/icu/CollatorICU.cpp:
501 (WTF::Collator::userDefault): Put ICU workaround under both PLATFORM(DARWIN) and
502 PLATFORM(CF) checks, so that each port can decide if it wants to use CF on Mac for it.
504 2008-03-06 Brady Eidson <beidson@apple.com>
508 Add a timedWait() method to ThreadCondition
510 * JavaScriptCore.exp:
514 * wtf/ThreadingGtk.cpp:
515 (WTF::ThreadCondition::timedWait):
517 * wtf/ThreadingNone.cpp:
518 (WTF::ThreadCondition::timedWait):
520 * wtf/ThreadingPthreads.cpp:
521 (WTF::ThreadCondition::timedWait):
523 * wtf/ThreadingWin.cpp:
524 (WTF::ThreadCondition::timedWait): Needs implementation
526 2008-03-06 Alexey Proskuryakov <ap@webkit.org>
530 * jscore.bkl: Add the wtf/unicode directory.
531 * wtf/unicode/CollatorDefault.cpp:
532 (WTF::Collator::userDefault): Use a constructor that does exist.
533 * wtf/unicode/icu/CollatorICU.cpp: Mac build fix for case-sensitive file systems.
535 2008-03-06 Darin Adler <darin@apple.com>
537 - try to fix the Qt build
539 * JavaScriptCore.pri: Add the wtf/unicode directory.
541 2008-03-06 Darin Adler <darin@apple.com>
543 - try to fix the GTK build
545 * GNUmakefile.am: Add a -I for the wtf/unicode directory.
547 2008-03-06 Darin Adler <darin@apple.com>
549 - try to fix the Mac build
551 * icu/unicode/parseerr.h: Copied from ../WebCore/icu/unicode/parseerr.h.
552 * icu/unicode/ucol.h: Copied from ../WebCore/icu/unicode/ucol.h.
553 * icu/unicode/uloc.h: Copied from ../WebCore/icu/unicode/uloc.h.
554 * icu/unicode/unorm.h: Copied from ../WebCore/icu/unicode/unorm.h.
555 * icu/unicode/uset.h: Copied from ../WebCore/icu/unicode/uset.h.
557 2008-03-06 Alexey Proskuryakov <ap@webkit.org>
561 <rdar://problem/5687269> Need to create a Collator abstraction for WebCore and JavaScriptCore
564 (WTF::initializeThreading):
565 * wtf/ThreadingGtk.cpp:
566 (WTF::initializeThreading):
567 * wtf/ThreadingNone.cpp:
568 * wtf/ThreadingPthreads.cpp:
569 * wtf/ThreadingWin.cpp:
570 Added AtomicallyInitializedStatic.
572 * kjs/string_object.cpp: (KJS::localeCompare): Changed to use Collator.
575 * JavaScriptCore.exp:
576 * JavaScriptCore.pri:
577 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
578 * JavaScriptCore.xcodeproj/project.pbxproj:
579 * JavaScriptCoreSources.bkl:
580 Added new fiiles to projects.
582 * wtf/unicode/Collator.h: Added.
584 * wtf/unicode/CollatorDefault.cpp: Added.
585 (WTF::Collator::Collator):
586 (WTF::Collator::~Collator):
587 (WTF::Collator::setOrderLowerFirst):
588 (WTF::Collator::collate):
589 * wtf/unicode/icu/CollatorICU.cpp: Added.
590 (WTF::cachedCollatorMutex):
591 (WTF::Collator::Collator):
592 (WTF::Collator::~Collator):
593 (WTF::Collator::setOrderLowerFirst):
594 (WTF::Collator::collate):
595 (WTF::Collator::createCollator):
596 (WTF::Collator::releaseCollator):
598 2008-03-05 Kevin Ollivier <kevino@theolliviers.com>
600 Fix the wx build after the bindings move.
602 * JavaScriptCoreSources.bkl:
605 2008-03-05 Alp Toker <alp@atoker.com>
607 GTK+ build fix for breakage introduced in r30800.
609 Track moved bridge sources from JavaScriptCore to WebCore.
613 2008-03-05 Brent Fulgham <bfulgham@gmail.com>
615 Reviewed by Adam Roben.
617 Remove definition of WTF_USE_SAFARI_THEME from wtf/Platform.h
618 because the PLATFORM(CG) flag is not set until config.h has
619 already included this file.
621 * wtf/Platform.h: Remove useless definition of WTF_USE_SAFARI_THEME
623 2008-03-05 Brady Eidson <beidson@apple.com>
625 Reviewed by Alexey and Mark Rowe
627 Fix for <rdar://problem/5778247> - Reproducible crash on storage/execute-sql-args.html
629 DatabaseThread::unscheduleDatabaseTasks() manually filters through a MessageQueue,
630 removing particular items for Databases that were shutting down.
632 This filtering operation is not atomic, and therefore causes a race condition with the
633 MessageQueue waking up and reading from the message queue.
635 The end result was an attempt to dereference a null DatabaseTask. Timing-wise, this never
636 seemed to happen in a debug build, otherwise an assertion would've caught it. Replacing that
637 assertion with a crash in a release build is what revealed this bug.
639 * wtf/MessageQueue.h:
640 (WTF::::waitForMessage): Tweak the waiting logic to check the queue's empty state then go back
641 to sleep if the queue was empty - checking m_killed each time it wakes up.
643 2008-03-05 David D. Kilzer <ddkilzer@apple.com>
645 Remove unused header includes from interpreter.cpp.
649 * kjs/interpreter.cpp: Remove unused header includes.
651 2008-03-05 Anders Carlsson <andersca@apple.com>
659 2008-03-05 Anders Carlsson <andersca@apple.com>
661 Don't build bindings/ anymore.
663 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
665 2008-03-05 Anders Carlsson <andersca@apple.com>
669 Don't build JavaScriptCore/bindings.
671 * JavaScriptCore.exp:
672 Export a couple of new functions.
674 * JavaScriptCore.xcodeproj/project.pbxproj:
678 No need to define HAVE_JNI anymore.
680 * kjs/interpreter.cpp:
681 Remove unnecessary include.
683 2008-03-05 David D. Kilzer <ddkilzer@apple.com>
685 Allow override of default script file name using command-line argument.
690 (main): Allow first command-line argument to override the default script
691 file name of "minidom.js".
693 (main): Allow first command-line argument to override the default script
694 file name of "testapi.js".
696 2008-03-04 Mark Rowe <mrowe@apple.com>
700 * JavaScriptCore.exp: Add new symbol to exports file.
702 2008-03-03 Oliver Hunt <oliver@apple.com>
706 Make ForInNode check for the timeout interrupt
709 (KJS::ForInNode::execute):
711 2008-03-02 Brent Fulgham <bfulgham@gmail.com>
713 Reviewed by Alp Toker.
715 http://bugs.webkit.org/show_bug.cgi?id=17415
716 GTK Build (using autotools) on Mac OS (DarwinPorts) Fails
718 Add -lstdc++ to link flags for minidom program. This corrects
719 a build error for the GTK+ on Mac OS.
723 2008-03-01 Mark Rowe <mrowe@apple.com>
725 Reviewed by Tim Hatcher.
727 Update Xcode configuration to support building debug and release from the mysterious future.
729 * Configurations/Base.xcconfig:
730 * Configurations/DebugRelease.xcconfig:
732 2008-02-29 Brent Fulgham <bfulgham@gmail.com>
734 http://bugs.webkit.org/show_bug.cgi?id=17483
735 Implement scrollbars on Windows (Cairo)
737 Reviewed by Adam Roben.
741 2008-02-29 Adam Roben <aroben@apple.com>
743 Remove unused DebuggerImp::abort and DebuggerImp::aborted
745 Reviewed by Tim and Sam.
747 * kjs/function_object.cpp:
748 (KJS::FunctionObjectImp::construct):
750 (KJS::DebuggerImp::DebuggerImp):
752 (KJS::Node::handleException):
753 (KJS::FunctionBodyNodeWithDebuggerHooks::execute):
755 2008-02-28 Eric Christopher <echristo@apple.com>
757 Reviewed by Geoffrey Garen.
759 ** TOTAL **: 1.005x as fast 2867.6ms +/- 0.4% 2853.2ms +/- 0.3% significant
761 * kjs/nodes.cpp: Tell the compiler that exceptions are unexpected (for
762 the sake of branch prediction and code organization).
764 2008-02-27 Alexey Proskuryakov <ap@webkit.org>
766 Reviewed by Sam Weinig.
768 http://bugs.webkit.org/show_bug.cgi?id=17030
769 Small buffer overflow within initialization
771 * kjs/date_object.cpp:
772 (KJS::DateObjectFuncImp::callAsFunction):
774 Remove unnecessary and incorrect memset() calls - GregorianDateTime can initialize itself.
776 2008-02-25 Sam Weinig <sam@webkit.org>
778 Reviewed by Dan Bernstein.
780 - Add a variant of remove that takes a position and a length.
783 (WTF::Vector::remove):
785 2008-02-25 Mark Mentovai <mark@moxienet.com>
787 Reviewed by Mark Rowe.
789 Enable CollectorHeapIntrospector to build by itself, as well as in an AllInOneFile build.
790 http://bugs.webkit.org/show_bug.cgi?id=17538
792 * kjs/CollectorHeapIntrospector.cpp: Provide "using" declaration for
793 WTF::RemoteMemoryReader.
794 * kjs/collector.h: Move CollectorHeap declaration here...
795 * kjs/collector.cpp: ... from here.
797 2008-02-25 Darin Adler <darin@apple.com>
801 * JavaScriptCore.exp: Sort the contents of this file.
803 2008-02-25 Adam Roben <aroben@apple.com>
808 (functionQuit): Don't add a return statement after exit(0) for MSVC.
810 2008-02-24 Sam Weinig <sam@webkit.org>
812 Reviewed by Mark Rowe.
814 http://bugs.webkit.org/show_bug.cgi?id=17529
815 Add support for reading from stdin from testkjs
818 (GlobalObject::GlobalObject): Add readline function to global object.
819 (functionReadline): Added. Reads characters from stdin until a '\n' or
820 EOF is encountered. The input is returned as a String to the caller.
822 2008-02-24 Sam Weinig <sam@webkit.org>
824 Reviewed by Mark Rowe.
826 http://bugs.webkit.org/show_bug.cgi?id=17528
829 * JavaScriptCore.exp:
830 * JavaScriptCore.xcodeproj/project.pbxproj: Make the testkjs.cpp use 4 space indentation.
832 (StopWatch::getElapsedMS):
833 (GlobalObject::className):
834 (GlobalObject::GlobalObject):
835 Rename GlobalImp to GlobalObject and setup the global functions
836 in the GlobalObject's constructor. Also, use static functions for
837 the implementation so we can use the standard PrototypeFunction
838 class and remove TestFunctionImp.
839 (functionPrint): Move print() functionality here.
840 (functionDebug): Move debug() functionality here.
841 (functionGC): Move gc() functionality here.
842 (functionVersion): Move version() functionality here.
843 (functionRun): Move run() functionality here.
844 (functionLoad): Move load() functionality here.
845 (functionQuit): Move quit() functionality here.
846 (prettyPrintScript): Fix indentation.
847 (runWithScripts): Since all the functionality of createGlobalObject is
848 now in the GlobalObject constructor, just call new here.
849 (parseArguments): Fix indentation.
851 (fillBufferWithContentsOfFile): Ditto.
853 2008-02-24 Sam Weinig <sam@webkit.org>
855 Reviewed by Oliver Hunt and Mark Rowe.
857 http://bugs.webkit.org/show_bug.cgi?id=17505
858 Add support for getting command line arguments in testkjs
860 - This slightly changes the behavior of parsing arguments by requiring
861 a '-f' before all files.
864 (createGlobalObject): Add a global property called 'arguments' which
865 contains an array with the parsed arguments as strings.
866 (runWithScripts): Pass in the arguments vector so that it can be passed
867 to the global object.
868 (parseArguments): Change parsing rules to require a '-f' before any script
869 file. After all '-f' and '-p' arguments have been parsed, the remaining
870 are added to the arguments vector and exposed to the script. If there is a
871 chance of ambiguity (the user wants to pass the string '-f' to the script),
872 the string '--' can be used separate the options from the pass through
876 2008-02-24 Dan Bernstein <mitz@apple.com>
878 Reviewed by Darin Adler.
880 - fix http://bugs.webkit.org/show_bug.cgi?id=17511
881 REGRESSION: Reproducible crash in SegmentedSubstring::SegmentedSubstring(SegmentedSubstring const&)
884 (WTF::::expandCapacityIfNeeded): Fixed the case where m_start and m_end
885 are both zero but the buffer capacity is non-zero.
886 (WTF::::prepend): Added validity checks.
888 2008-02-23 Jan Michael Alonzo <jmalonzo@unpluggable.com>
890 Rubber stamped by Darin.
892 Add separator '\' after libJavaScriptCore_la_LIBADD and cleanup
893 whitespaces introduced in the previous commit.
897 2008-02-23 Jan Michael Alonzo <jmalonzo@unpluggable.com>
899 * GNUmakefile.am: Add GLOBALDEPS for testkjs and minidom.
901 2008-02-23 Darin Adler <darin@apple.com>
905 - http://bugs.webkit.org/show_bug.cgi?id=17496
906 make Deque use a circular array; add iterators
908 * wtf/Deque.h: Wrote an all-new version of this class that uses a circular
909 buffer. Growth policy is identical to vector. Added iterators.
911 * wtf/Vector.h: Made two small refinements while using this to implement
912 Deque: Made VectorBufferBase derive from Noncopyable, which would have
913 saved me some debugging time if it had been there. Renamed Impl and
914 m_impl to Buffer and m_buffer.
916 2008-02-23 Darin Adler <darin@apple.com>
920 - http://bugs.webkit.org/show_bug.cgi?id=17067
921 eliminate attributes parameter from JSObject::put for speed/clarity
923 * API/JSCallbackObject.h: Removed attribute arguments.
924 * API/JSCallbackObjectFunctions.h:
925 (KJS::JSCallbackObject<Base>::put): Ditto.
926 * API/JSObjectRef.cpp:
927 (JSObjectSetProperty): Use initializeVariable or putDirect when necessary
928 to set attribute values.
929 * JavaScriptCore.exp: Updated.
930 * bindings/objc/objc_runtime.h: Removed attribute arguments.
931 * bindings/objc/objc_runtime.mm:
932 (ObjcFallbackObjectImp::put): Ditto.
933 * bindings/runtime_array.cpp:
934 (RuntimeArray::put): Ditto.
935 * bindings/runtime_array.h: Ditto.
936 * bindings/runtime_object.cpp:
937 (RuntimeObjectImp::put): Ditto.
938 * bindings/runtime_object.h: Ditto. Also removed canPut which was only
939 called from one place in WebCore that can use hasProperty instead.
941 * kjs/Activation.h: Removed attribute argument from put and added the new
942 initializeVariable function that's used to put variables in variable objects.
943 Also made isActivationObject a const member.
945 * kjs/JSGlobalObject.cpp:
946 (KJS::JSGlobalObject::put): Removed attribute argument.
947 (KJS::JSGlobalObject::initializeVariable): Added. Used to give variables
948 their initial values, which can include the read-only property.
949 (KJS::JSGlobalObject::reset): Removed obsolete comments about flags.
950 Removed Internal flag, which is no longer needed.
951 * kjs/JSGlobalObject.h: More of the same.
953 * kjs/JSVariableObject.h: Added pure virtual initializeVariable function.
954 (KJS::JSVariableObject::symbolTablePut): Removed checkReadOnly flag; we always
956 (KJS::JSVariableObject::symbolTableInitializeVariable): Added.
958 * kjs/array_instance.cpp:
959 (KJS::ArrayInstance::put): Removed attribute argument.
960 * kjs/array_instance.h: Ditto.
963 (KJS::FunctionImp::put): Ditto.
964 (KJS::Arguments::put): Ditto.
965 (KJS::ActivationImp::put): Ditto.
966 (KJS::ActivationImp::initializeVariable): Added.
967 * kjs/function.h: Removed attribute arguments.
969 * kjs/function_object.cpp:
970 (KJS::FunctionObjectImp::construct): Removed Internal flag.
973 (KJS::lookupPut): Removed attributes argument. Also changed to use putDirect
974 instead of calling JSObject::put.
975 (KJS::cacheGlobalObject): Ditto.
978 (KJS::ConstDeclNode::handleSlowCase): Call initializeVariable to initialize
980 (KJS::ConstDeclNode::evaluateSingle): Ditto.
981 (KJS::TryNode::execute): Use putDirect to set up the new object.
982 (KJS::FunctionBodyNode::processDeclarations): Removed Internal.
983 (KJS::ProgramNode::processDeclarations): Ditto.
984 (KJS::EvalNode::processDeclarations): Call initializeVariable to initialize
985 the variables and functions.
986 (KJS::FuncDeclNode::makeFunction): Removed Internal.
987 (KJS::FuncExprNode::evaluate): Ditto.
989 * kjs/object.cpp: Removed canPut, which was only being used in one code path,
990 not the normal high speed one.
991 (KJS::JSObject::put): Removed attribute argument. Moved the logic from
992 canPut here, in the one code ath that was still using it.
993 * kjs/object.h: Removed Internal attribute, ad canPut function. Removed the
994 attributes argument to the put function. Made isActivationObject const.
996 * kjs/regexp_object.cpp:
997 (KJS::RegExpImp::put): Removed attributes argument.
998 (KJS::RegExpImp::putValueProperty): Ditto.
999 (KJS::RegExpObjectImp::put): Ditto.
1000 (KJS::RegExpObjectImp::putValueProperty): Ditto.
1001 * kjs/regexp_object.h: Ditto.
1003 * kjs/string_object.cpp:
1004 (KJS::StringInstance::put): Removed attributes argument.
1005 * kjs/string_object.h: Ditto.
1007 2008-02-23 Jan Michael Alonzo <jmalonzo@unpluggable.com>
1009 Not reviewed, Gtk build fix.
1013 2008-02-23 Alexey Proskuryakov <ap@webkit.org>
1015 Windows build fix - move ThreadCondition implementation from WebCore to WTF.
1017 * wtf/ThreadingWin.cpp:
1018 (WTF::ThreadCondition::ThreadCondition):
1019 (WTF::ThreadCondition::~ThreadCondition):
1020 (WTF::ThreadCondition::wait):
1021 (WTF::ThreadCondition::signal):
1022 (WTF::ThreadCondition::broadcast):
1024 2008-02-23 Alexey Proskuryakov <ap@webkit.org>
1026 Touch some files, hoping that Windows build bot will create JSC headers.
1028 * kjs/AllInOneFile.cpp:
1029 * kjs/array_instance.cpp:
1030 * wtf/HashTable.cpp:
1032 2008-02-23 Alexey Proskuryakov <ap@webkit.org>
1034 Qt/Wx build fix - this file was still in a wrong namespace, too.
1036 * wtf/ThreadingNone.cpp:
1038 2008-02-23 Alexey Proskuryakov <ap@webkit.org>
1040 More build fixing - fix mismatched braces.
1042 * JavaScriptCore.pri:
1044 2008-02-23 Alexey Proskuryakov <ap@webkit.org>
1046 Wx and Gtk build fixes.
1048 * JavaScriptCore.pri: Don't try to compile ThreadingPthreads.
1049 * wtf/ThreadingGtk.cpp: Use a correct namespace.
1051 2008-02-23 Alexey Proskuryakov <ap@webkit.org>
1055 Move basic threading support from WebCore to WTF.
1057 Added mutex protection to MessageQueue::killed() for paranoia sake.
1060 * JavaScriptCore.exp:
1061 * JavaScriptCore.pri:
1062 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
1063 * JavaScriptCore.xcodeproj/project.pbxproj:
1064 * JavaScriptCoreSources.bkl:
1065 * wtf/Locker.h: Copied from WebCore/platform/Locker.h.
1066 * wtf/MessageQueue.h: Copied from WebCore/platform/MessageQueue.h.
1068 * wtf/Threading.h: Copied from WebCore/platform/Threading.h.
1069 * wtf/ThreadingGtk.cpp: Copied from WebCore/platform/gtk/ThreadingGtk.cpp.
1070 (WebCore::createThread):
1071 * wtf/ThreadingNone.cpp: Copied from WebCore/platform/ThreadingNone.cpp.
1072 * wtf/ThreadingPthreads.cpp: Copied from WebCore/platform/pthreads/ThreadingPthreads.cpp.
1073 (WTF::createThread):
1074 * wtf/ThreadingWin.cpp: Copied from WebCore/platform/win/ThreadingWin.cpp.
1075 (WTF::createThread):
1076 (WTF::Mutex::Mutex):
1077 (WTF::Mutex::~Mutex):
1079 (WTF::Mutex::tryLock):
1080 (WTF::Mutex::unlock):
1082 2008-02-22 Geoffrey Garen <ggaren@apple.com>
1084 Reviewed by Sam Weinig.
1086 Partial fix for <rdar://problem/5744037> Gmail out of memory (17455)
1088 I'm removing KJS_MEM_LIMIT for the following reasons:
1090 - We have a few reports of KJS_MEM_LIMIT breaking important web
1091 applications, like GMail and Google Reader. (For example, if you
1092 simply open 12 GMail tabs, tab #12 will hit the limit.)
1094 - Firefox has no discernable JS object count limit, so any limit, even
1095 a large one, is a potential compatibility problem.
1097 - KJS_MEM_LIMIT does not protect against malicious memory allocation,
1098 since there are many ways to maliciously allocate memory without
1099 increasing the JS object count.
1101 - KJS_MEM_LIMIT is already mostly broken, since it only aborts the
1102 script that breaches the limit, not any subsequent scripts.
1104 - We've never gotten bug reports about websites that would have
1105 benefited from an unbroken KJS_MEM_LIMIT. The initial check-in of
1106 KJS_MEM_LIMIT (KJS revision 80061) doesn't mention a website that
1109 - Any website that brings you anywhere close to crashing due to the
1110 number of live JS objects will almost certainly put up the "slow
1111 script" dialog at least 20 times beforehand.
1113 * kjs/collector.cpp:
1114 (KJS::Collector::collect):
1117 (KJS::TryNode::execute):
1119 2008-02-22 Oliver Hunt <oliver@apple.com>
1121 Reviewed by Alexey P.
1123 <rdar://problem/5759327> REGRESSION: while(NaN) acts like while(true)
1125 Fix yet another case where we incorrectly relied on implicit double
1129 (KJS::PostDecLocalVarNode::evaluateToBoolean):
1131 2008-02-20 Michael Knaup <michael.knaup@mac.com>
1135 Fix for Bug 16753: date set methods with no args should result in NaN (Acid3 bug)
1136 The set values result in NaN now when called with no args, NaN or +/- inf values.
1137 The setYear, setFullYear and setUTCFullYear methods used on NaN dates work as
1138 descripted in the standard.
1140 * kjs/date_object.cpp:
1141 (KJS::fillStructuresUsingTimeArgs):
1142 (KJS::fillStructuresUsingDateArgs):
1143 (KJS::setNewValueFromTimeArgs):
1144 (KJS::setNewValueFromDateArgs):
1145 (KJS::dateProtoFuncSetYear):
1147 2008-02-19 Anders Carlsson <andersca@apple.com>
1151 Change OpaqueJSClass and RootObject to start with a ref count of 1.
1153 * API/JSClassRef.cpp:
1154 (OpaqueJSClass::OpaqueJSClass):
1155 (OpaqueJSClass::createNoAutomaticPrototype):
1156 (OpaqueJSClass::create):
1158 * API/JSObjectRef.cpp:
1160 * bindings/runtime_root.cpp:
1161 (KJS::Bindings::RootObject::create):
1162 (KJS::Bindings::RootObject::RootObject):
1164 2008-02-19 Darin Adler <darin@apple.com>
1166 Rubber stamped by Anders.
1168 - removed explicit initialization to 1 for RefCounted; that's now the default
1171 (KJS::RegExp::RegExp): Removed RefCounted initializer.
1173 2008-02-19 Darin Adler <darin@apple.com>
1177 - next step for http://bugs.webkit.org/show_bug.cgi?id=17257
1178 start ref counts at 1 instead of 0 for speed
1181 (WTF::RefCounted::RefCounted): Have refcounts default to 1. This allows us to start
1182 removing the explicit initialization of RefCounted from classes and eventually we
1183 can remove the ability to have the initial count of 0 entirely.
1185 2008-02-18 Samuel Weinig <sam@webkit.org>
1187 Reviewed by Geoff Garen.
1189 Fix for http://bugs.webkit.org/show_bug.cgi?id=17419
1190 Remove CompatMode from JavaScriptCore as it is never set to anything other than NativeMode
1192 * kjs/JSGlobalObject.cpp:
1193 (KJS::JSGlobalObject::init):
1194 * kjs/JSGlobalObject.h:
1195 (KJS::JSGlobalObject::setDebugger):
1196 * kjs/date_object.cpp:
1197 (KJS::dateProtoFuncGetYear):
1199 2008-02-18 Darin Adler <darin@apple.com>
1204 (WTF::toASCIIHexValue): Added.
1206 2008-02-17 Darin Adler <darin@apple.com>
1208 * wtf/ListHashSet.h: (WTF::swap): Removed stray return statement.
1210 2008-02-15 Adam Roben <aroben@apple.com>
1212 Make JavaScriptCore's FEATURE_DEFINES match WebCore's
1216 * Configurations/JavaScriptCore.xcconfig:
1218 2008-02-14 Stephanie Lewis <slewis@apple.com>
1224 * JavaScriptCore.order:
1226 2008-02-14 Geoffrey Garen <ggaren@apple.com>
1228 Reviewed by Sam Weinig.
1230 Fixed <rdar://problem/5737835> nee http://bugs.webkit.org/show_bug.cgi?id=17329
1231 Crash in JSGlobalObject::popActivation when inserting hyperlink in Wordpress (17329)
1233 Don't reset the "activations" stack in JSGlobalObject::reset, since we
1234 might be executing a script during the call to reset, and the script
1235 needs to safely run to completion.
1237 Instead, initialize the "activations" stack when the global object is
1238 created, and subsequently rely on pushing and popping during normal
1239 execution to maintain the stack's state.
1241 * kjs/JSGlobalObject.cpp:
1242 (KJS::JSGlobalObject::init):
1243 (KJS::JSGlobalObject::reset):
1245 2008-02-13 Bernhard Rosenkraenzer <bero@arklinux.org>
1249 - http://bugs.webkit.org/show_bug.cgi?id=17339
1250 JavaScriptCore does not build with gcc 4.3
1252 * kjs/interpreter.cpp: Add include of <unistd.h>, since that's where
1253 getpid() comes from.
1255 2008-02-13 Oliver Hunt <oliver@apple.com>
1257 Reviewed by Alexey P.
1259 <rdar://problem/5737003> REGRESSION (r27747): can't browse pictures on fastcupid.com
1261 When converting numeric values to booleans we need to account for NaN
1264 (KJS::MultNode::evaluateToBoolean):
1265 (KJS::ModNode::evaluateToBoolean):
1267 2008-02-08 Samuel Weinig <sam@webkit.org>
1269 Reviewed by Brady Eidson.
1271 <rdar://problem/5659216> REGRESSION: PLT 0.3% slower due to r28868 (caching ClassNodeList and NamedNodeList)
1273 - Tweak the statements in isASCIISpace to account for the statistical distribution of
1276 .4% speedup on my machine. Stephanie's machine shows this as .3% speedup.
1279 (WTF::isASCIISpace):
1281 2008-02-11 Sam Weinig <sam@webkit.org>
1283 Reviewed by Anders Carlsson.
1286 <rdar://problem/5735497> Match Firefox's cross-domain model more accurately by return the built-in version of functions even if they have been overridden
1287 <rdar://problem/5735443> Crash when setting the Window objects prototype to a custom Object and then calling a method on it
1289 - Expose the native Object.prototype.toString implementation so that it can be used for cross-domain
1292 * JavaScriptCore.exp:
1293 * kjs/object_object.cpp:
1294 * kjs/object_object.h:
1296 2008-02-10 Darin Adler <darin@apple.com>
1298 Rubber stamped by Eric.
1301 (KJS::ExecState::takeException): Added.
1303 2008-02-10 Darin Adler <darin@apple.com>
1307 - http://bugs.webkit.org/show_bug.cgi?id=17256
1308 eliminate default ref. count of 0 in RefCounted class
1311 (WTF::RefCounted::RefCounted): Remove default of 0.
1313 2008-02-10 Darin Adler <darin@apple.com>
1317 - http://bugs.webkit.org/show_bug.cgi?id=17256
1318 Make clients of RefCounted explicitly set the count to 0.
1320 * API/JSClassRef.cpp:
1321 (OpaqueJSClass::OpaqueJSClass):
1322 * bindings/runtime_root.cpp:
1323 (KJS::Bindings::RootObject::RootObject):
1325 2008-02-09 Darin Adler <darin@apple.com>
1329 - http://bugs.webkit.org/show_bug.cgi?id=17256
1330 Change RegExp to start its ref count at 1, not 0
1332 We'll want to do this to every RefCounted class, one at a time.
1335 (KJS::RegExpNode::RegExpNode): Use RegExp::create instead of new RegExp.
1337 (KJS::RegExp::RegExp): Marked inline, set initial ref count to 1.
1338 (KJS::RegExp::create): Added. Calls new RegExp then adopts the initial ref.
1339 * kjs/regexp.h: Reformatted. Made the constructors private. Added static
1340 create functions that return objects already wrapped in PassRefPtr.
1341 * kjs/regexp_object.cpp:
1342 (KJS::regExpProtoFuncCompile): Use RegExp::create instead of new RegExp.
1343 (KJS::RegExpObjectImp::construct): Ditto.
1344 * kjs/string_object.cpp:
1345 (KJS::stringProtoFuncMatch): Ditto.
1346 (KJS::stringProtoFuncSearch): Ditto.
1348 2008-02-08 Oliver Hunt <oliver@apple.com>
1352 <rdar://problem/5731773> REGRESSION (r28973): Extraneous parentheses in function.toString()
1353 https://bugs.webkit.org/show_bug.cgi?id=17214
1355 Make a subclass of CommaNode to provide the correct precedence for each expression in
1356 a variable declaration list.
1360 (KJS::VarDeclCommaNode::):
1362 2008-02-08 Darin Adler <darin@apple.com>
1366 - fix http://bugs.webkit.org/show_bug.cgi?id=17247
1367 Labelled continue/break can fail in some cases
1369 Test: fast/js/continue-break-multiple-labels.html
1372 (KJS::StatementNode::pushLabel): Made this virtual.
1373 (KJS::LabelNode::pushLabel): Forward pushLabel calls to the statement inside.
1375 2008-02-08 Darin Adler <darin@apple.com>
1379 - fix http://bugs.webkit.org/show_bug.cgi?id=15003
1380 Function.prototype.constructor should not be DontDelete/ReadOnly (Acid3 bug)
1382 Test: fast/js/constructor-attributes.html
1384 * kjs/JSGlobalObject.cpp:
1385 (KJS::JSGlobalObject::reset): Remove unwanted attributes from "constructor".
1386 * kjs/function_object.cpp:
1387 (KJS::FunctionObjectImp::construct): Ditto.
1389 (KJS::FuncDeclNode::makeFunction): Ditto.
1390 (KJS::FuncExprNode::evaluate): Ditto.
1392 2008-02-06 Geoffrey Garen <ggaren@apple.com>
1394 Reviewed by Oliver Hunt.
1396 Added an ASSERT to catch refCount underflow, since it caused a leak in
1400 (WTF::RefCounted::deref):
1402 2008-02-06 Geoffrey Garen <ggaren@apple.com>
1404 Reviewed by Darin Adler.
1406 PLT speedup related to <rdar://problem/5659272> REGRESSION: PLT .4%
1407 slower due to r28884 (global variable symbol table optimization)
1409 Tweaked RefCounted::deref() to be a little more efficient.
1411 1% - 1.5% speedup on my machine. .7% speedup on Stephanie's machine.
1414 (WTF::RefCounted::deref): Don't modify m_refCount if we're just going
1415 to delete the object anyway. Also, use a simple == test, which might be
1416 faster than <= on some hardware.
1418 2008-02-06 Darin Adler <darin@apple.com>
1422 - fix http://bugs.webkit.org/show_bug.cgi?id=17094
1423 Array.prototype functions create length properties with DontEnum/DontDelete
1425 Test results match Gecko with very few obscure exceptions that seem to be
1428 Test: fast/js/array-functions-non-arrays.html
1430 * kjs/array_object.cpp:
1431 (KJS::arrayProtoFuncConcat): Removed DontEnum and DontDelete from the call
1433 (KJS::arrayProtoFuncPop): Ditto. Also added missing call to deleteProperty,
1434 which is not needed for real arrays, but is needed for non-arrays.
1435 (KJS::arrayProtoFuncPush): Ditto.
1436 (KJS::arrayProtoFuncShift): Ditto.
1437 (KJS::arrayProtoFuncSlice): Ditto.
1438 (KJS::arrayProtoFuncSort): Removed incorrect call to set length when
1439 the array has no elements.
1440 (KJS::arrayProtoFuncSplice): Removed DontEnum and DontDelete from the call
1442 (KJS::arrayProtoFuncUnShift): Ditto. Also added a check for 0 arguments to
1443 make behavior match the specification in that case.
1445 (KJS::ArrayNode::evaluate): Removed DontEnum and DontDelete from the call
1448 2008-02-06 Darin Adler <darin@apple.com>
1452 - replace calls to put to set up properties with calls to putDirect, to
1453 prepare for a future change where put won't take attributes any more,
1454 and for a slight performance boost
1456 * API/JSObjectRef.cpp:
1457 (JSObjectMakeConstructor): Use putDirect instead of put.
1458 * kjs/CommonIdentifiers.h: Removed lastIndex.
1459 * kjs/JSGlobalObject.cpp:
1460 (KJS::JSGlobalObject::reset): Use putDirect instead of put.
1461 * kjs/array_object.cpp:
1462 (KJS::arrayProtoFuncConcat): Took out extra call to get length (unused).
1463 (KJS::ArrayObjectImp::ArrayObjectImp): Use putDirect instead of put.
1464 * kjs/error_object.cpp:
1465 (KJS::ErrorPrototype::ErrorPrototype): Use putDirect instead of put.
1467 (KJS::Arguments::Arguments): Use putDirect instead of put.
1468 (KJS::PrototypeFunction::PrototypeFunction): Use putDirect instead of put.
1469 * kjs/function_object.cpp:
1470 (KJS::FunctionObjectImp::construct): Use putDirect instead of put.
1472 (KJS::FuncDeclNode::makeFunction): Use putDirect instead of put.
1473 (KJS::FuncExprNode::evaluate): Use putDirect instead of put.
1474 * kjs/regexp_object.cpp:
1475 (KJS::regExpProtoFuncCompile): Use setLastIndex instead of put(lastIndex).
1476 (KJS::RegExpImp::match): Get and set lastIndex by using m_lastIndex instead of
1477 calling get and put.
1478 * kjs/regexp_object.h:
1479 (KJS::RegExpImp::setLastIndex): Added.
1480 * kjs/string_object.cpp:
1481 (KJS::stringProtoFuncMatch): Use setLastIndex instead of put(lastIndex).
1483 2008-02-05 Sam Weinig <sam@webkit.org>
1485 Reviewed by Anders Carlsson.
1487 Fix for http://bugs.webkit.org/show_bug.cgi?id=8080
1488 NodeList (and other DOM lists) items are not enumeratable using for..in
1490 * JavaScriptCore.exp:
1492 2008-02-05 Mark Rowe <mrowe@apple.com>
1494 Reviewed by Oliver Hunt.
1496 Update versioning to support the mysterious future.
1498 * Configurations/Version.xcconfig: Add SYSTEM_VERSION_PREFIX_1060.
1500 2008-02-04 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1502 Reviewed by Oliver Hunt.
1504 Fixes Bug 16889: REGRESSION (r29425): Canvas-based graphing calculator fails to run
1505 Bug 17015: REGRESSION (r29414-29428): www.fox.com "shows" menu fails to render
1506 Bug 17164: REGRESSION: JavaScript pop-up menu appears at wrong location when hovering image at http://news.chinatimes.com/
1508 <http://bugs.webkit.org/show_bug.cgi?id=16889>
1509 <rdar://problem/5696255>
1511 <http://bugs.webkit.org/show_bug.cgi?id=17015>
1513 <http://bugs.webkit.org/show_bug.cgi?id=17164>
1514 <rdar://problem/5720947>
1516 The ActivationImp tear-off (r29425) introduced a problem with ReadModify
1517 nodes that first resolve a slot, call valueForReadModifyNode(), and then
1518 store a value in the previously resolved slot. Since valueForReadModifyNode()
1519 may cause a tear-off, the slot needs to be resolved again, but this was
1520 not happening with the existing code.
1523 (KJS::ReadModifyLocalVarNode::evaluate):
1524 (KJS::ReadModifyResolveNode::evaluate):
1526 2008-02-04 Cameron McCormack <cam@mcc.id.au>
1528 Reviewed by Geoff Garen.
1530 Remove some unneccesary UNUSED_PARAMs. Clarify ownership rule of return value of JSObjectCopyPropertyNames.
1533 (JSNode_appendChild):
1534 (JSNode_removeChild):
1535 (JSNode_replaceChild):
1536 (JSNode_getNodeType):
1537 (JSNode_getFirstChild):
1539 (JSNodeList_length):
1540 * API/JSObjectRef.h:
1542 2008-02-04 Rodney Dawes <dobey@wayofthemonkey.com>
1544 Reviewed by Alp Toker and Mark Rowe.
1546 Fix http://bugs.webkit.org/show_bug.cgi?id=17175.
1547 Bug 17175: Use of C++ compiler flags in CFLAGS
1549 * GNUmakefile.am: Use global_cxxflags as well as global_cflags in CXXFLAGS.
1551 2008-02-04 Alp Toker <alp@atoker.com>
1553 Rubber-stamped by Mark Rowe.
1555 Remove all trailing whitespace in the GTK+ port and related
1560 2008-02-02 Darin Adler <darin@apple.com>
1562 Reviewed by Geoff Garen.
1564 PLT speedup related to <rdar://problem/5659272> REGRESSION: PLT .4%
1565 slower due to r28884 (global variable symbol table optimization)
1567 Geoff's theory is that the slowdown was due to copying hash tables when
1568 putting things into the back/forward cache. If that's true, then this
1569 should fix the problem.
1571 (According to Geoff's measurements, in a PLT that exaggerates the
1572 importance of symbol table saving during cached page creation, this
1573 patch is a ~3X speedup in cached page creation, and a 9% speedup overall.)
1575 * JavaScriptCore.exp: Updated.
1577 * kjs/JSVariableObject.cpp:
1578 (KJS::JSVariableObject::saveLocalStorage): Updated for changes to SavedProperty,
1579 which has been revised to avoid initializing each SavedProperty twice when building
1580 the array. Store the property names too, so we don't have to store the symbol table
1581 separately. Do this by iterating the symbol table instead of the local storage vector.
1582 (KJS::JSVariableObject::restoreLocalStorage): Ditto. Restore the symbol table as
1583 well as the local storage vector.
1585 * kjs/JSVariableObject.h: Removed save/restoreSymbolTable and do that work inside
1586 save/restoreLocalStorage instead. Made restoreLocalStorage a non-const member function
1587 that takes a const reference to a SavedProperties object.
1589 * kjs/LocalStorage.h: Changed attributes to be unsigned instead of int to match
1590 other declarations of attributes elsewhere.
1592 * kjs/property_map.cpp:
1593 (KJS::SavedProperties::SavedProperties): Updated for data member name change.
1594 (KJS::PropertyMap::save): Updated for data member name change and to use the new
1595 inline init function instead of setting the fields directly. This allows us to
1596 skip initializing the SavedProperty objects when first allocating the array, and
1597 just do it when we're actually setting up the individual elements.
1598 (KJS::PropertyMap::restore): Updated for SavedProperty changes.
1600 * kjs/property_map.h: Changed SavedProperty from a struct to a class. Set it up so
1601 it does not get initialized at construction time to avoid initializing twice when
1602 creating an array of SavedProperty. Removed the m_ prefixes from the members of
1603 the SavedProperties struct. Generally we use m_ for class members and not struct.
1605 2008-02-02 Tony Chang <idealisms@gmail.com>
1607 Reviewed by darin. Landed by eseidel.
1609 Add #define guards for WIN32_LEAN_AND_MEAN and _CRT_RAND_S.
1612 * wtf/FastMalloc.cpp:
1615 2008-01-28 Sam Weinig <sam@webkit.org>
1617 Rubber-stamped by Darin Adler.
1619 - Fix whitespace in nodes.h/cpp and nodes2string.cpp.
1621 (NOTE: Specific changed functions elided for space and clarity)
1624 * kjs/nodes2string.cpp:
1626 2008-01-27 Sam Weinig <sam@webkit.org>
1628 Reviewed by Oliver Hunt.
1630 Patch for http://bugs.webkit.org/show_bug.cgi?id=17025
1631 nodes.h/cpp has been rolling around in the mud - lets hose it down
1633 - Rename member variables to use the m_ prefix.
1635 (NOTE: Specific changed functions elided for space and clarity)
1639 * kjs/nodes2string.cpp:
1641 2008-01-27 Darin Adler <darin@apple.com>
1645 - fix <rdar://problem/5657450> REGRESSION: const is broken
1647 Test: fast/js/const.html
1649 SunSpider said this was 0.3% slower. And I saw some Shark samples in
1650 JSGlobalObject::put -- not a lot but a few. We may be able to regain the
1651 speed, but for now we will take that small hit for correctness sake.
1653 * kjs/JSGlobalObject.cpp:
1654 (KJS::JSGlobalObject::put): Pass the checkReadOnly flag in to symbolTablePut
1655 instead of passing attributes.
1657 * kjs/JSVariableObject.h:
1658 (KJS::JSVariableObject::symbolTablePut): Removed the code to set attributes
1659 here, since we only set attributes when creating a property. Added the code
1660 to check read-only here, since we need that to implement const!
1663 (KJS::ActivationImp::put): Pass the checkReadOnly flag in to symbolTablePut
1664 instead of passing attributes.
1667 (KJS::isConstant): Added.
1668 (KJS::PostIncResolveNode::optimizeVariableAccess): Create a PostIncConstNode
1669 if optimizing for a local variable and the variable is constant.
1670 (KJS::PostDecResolveNode::optimizeVariableAccess): Ditto. But PostDecConstNode.
1671 (KJS::PreIncResolveNode::optimizeVariableAccess): Ditto. But PreIncConstNode.
1672 (KJS::PreDecResolveNode::optimizeVariableAccess): Ditto. But PreDecConstNode.
1673 (KJS::PreIncConstNode::evaluate): Return the value + 1.
1674 (KJS::PreDecConstNode::evaluate): Return the value - 1.
1675 (KJS::PostIncConstNode::evaluate): Return the value converted to a number.
1676 (KJS::PostDecConstNode::evaluate): Ditto.
1677 (KJS::ReadModifyResolveNode::optimizeVariableAccess): Create a ReadModifyConstNode
1678 if optimizing for a local variable and the variable is constant.
1679 (KJS::AssignResolveNode::optimizeVariableAccess): Ditto. But AssignConstNode.
1680 (KJS::ScopeNode::optimizeVariableAccess): Pass the local storage to the
1681 node optimizeVariableAccess functions, since that's where we need to look to
1682 figure out if a variable is constant.
1683 (KJS::FunctionBodyNode::processDeclarations): Moved the call to
1684 optimizeVariableAccess until after localStorage is set up.
1685 (KJS::ProgramNode::processDeclarations): Ditto.
1687 * kjs/nodes.h: Fixed the IsConstant and HasInitializer values. They are used
1688 as flag masks, so a value of 0 will not work for IsConstant. Changed the
1689 first parameter to optimizeVariableAccess to be a const reference to a symbol
1690 table and added a const reference to local storage. Added classes for const
1691 versions of local variable access: PostIncConstNode, PostDecConstNode,
1692 PreIncConstNode, PreDecConstNode, ReadModifyConstNode, and AssignConstNode.
1695 (KJS::JSObject::put): Tweaked comments a bit, and changed the checkReadOnly
1696 expression to match the form used at the two other call sites.
1698 2008-01-27 Darin Adler <darin@apple.com>
1702 - fix http://bugs.webkit.org/show_bug.cgi?id=16498
1703 ''.constructor.toString() gives [function]
1705 Test: fast/js/function-names.html
1707 * kjs/array_object.cpp:
1708 (KJS::ArrayObjectImp::ArrayObjectImp): Use the class name as the constructor's function name.
1709 * kjs/bool_object.cpp:
1710 (KJS::BooleanObjectImp::BooleanObjectImp): Ditto.
1711 * kjs/date_object.cpp:
1712 (KJS::DateObjectImp::DateObjectImp): Ditto.
1713 * kjs/error_object.cpp:
1714 (KJS::ErrorPrototype::ErrorPrototype): Make the error object be an Error.
1715 (KJS::ErrorObjectImp::ErrorObjectImp): Use the class name as the constructor's function name.
1716 (KJS::NativeErrorPrototype::NativeErrorPrototype): Take const UString&.
1717 (KJS::NativeErrorImp::NativeErrorImp): Use the prototype's name as the constructor's function
1719 * kjs/error_object.h: Change ErrorPrototype to inherit from ErrorInstance. Change the
1720 NativeErrorImp constructor to take a NativeErrorPrototype pointer for its prototype.
1721 * kjs/function.h: Removed unneeded constructor for internal functions without names.
1722 We want to avoid those!
1723 * kjs/function_object.cpp:
1724 (KJS::functionProtoFuncToString): Removed code that writes out just [function] for functions
1725 that have no names. There's no reason to do that.
1726 (KJS::FunctionObjectImp::FunctionObjectImp): Use the class name as the constructor's
1728 * kjs/internal.cpp: Removed the unused constructor.
1729 * kjs/number_object.cpp:
1730 (KJS::fractionalPartToString): Marked static for internal linkage.
1731 (KJS::exponentialPartToString): Ditto.
1732 (KJS::numberProtoFuncToPrecision): Removed an unneeded else.
1733 (KJS::NumberObjectImp::NumberObjectImp): Use the class name as the constructor's
1735 (KJS::NumberObjectImp::getValueProperty): Tweaked formatting.
1736 * kjs/object_object.cpp:
1737 (KJS::ObjectObjectImp::ObjectObjectImp): Use "Object" for the function name.
1738 * kjs/regexp_object.cpp:
1739 (KJS::RegExpObjectImp::RegExpObjectImp): Use "RegExp" for the function name.
1740 * kjs/string_object.cpp:
1741 (KJS::StringObjectImp::StringObjectImp): Use the class name as the constructor's
1744 2008-01-26 Darin Adler <darin@apple.com>
1748 - fix http://bugs.webkit.org/show_bug.cgi?id=17027
1749 Incorrect Function.toString behaviour with read/modify/write operators performed on negative numbers
1751 Test: fast/js/function-toString-parentheses.html
1753 The problem here was that a NumberNode with a negative number in it had the wrong
1754 precedence. It's not a primary expression, it's a unary operator with a primary
1755 expression after it.
1757 Once the precedence of NumberNode was fixed, the cases from bug 17020 were also
1758 fixed without trying to treat bracket nodes like dot nodes. That wasn't needed.
1759 The reason we handle numbers before dot nodes specially is that the dot is a
1760 legal character in a number. The same is not true of a bracket. Eventually we
1761 could get smarter, and only add the parentheses when there is actual ambiguity.
1762 There is none if the string form of the number already has a dot in it, or if
1763 it's a number with a alphabetic name like infinity or NAN.
1765 * kjs/nodes.h: Renamed back from ObjectAccess to DotExpr.
1766 (KJS::NumberNode::precedence): Return PrecUnary for negative numbers, since
1767 they serialize as a unary operator, not a primary expression.
1768 * kjs/nodes2string.cpp:
1769 (KJS::SourceStream::operator<<): Clear m_numberNeedsParens if this adds
1770 parens; one set is enough.
1771 (KJS::bracketNodeStreamTo): Remove unneeded special flag here. Normal
1772 operator precedence suffices.
1773 (KJS::NewExprNode::streamTo): Ditto.
1775 2008-01-26 Oliver Hunt <oliver@apple.com>
1777 Reviewed by Maciej and Darin.
1779 Fix for http://bugs.webkit.org/show_bug.cgi?id=17020
1780 Function.toString does not parenthesise numbers for the bracket accessor
1782 It turns out that logic was there for all of the dot accessor nodes to make numbers be
1783 parenthesised properly, so it was a trivial extension to extend that to the bracket nodes.
1784 I renamed the enum type to reflect the fact that it is now used for both dot and bracket
1787 * kjs/nodes2string.cpp:
1788 (KJS::bracketNodeStreamTo):
1789 (KJS::BracketAccessorNode::streamTo):
1791 2008-01-26 Oliver Hunt <oliver@apple.com>
1795 Fix Bug 17018: Incorrect code generated from Function.toString for get/setters in object literals
1797 Don't quote getter and setter names during output, as that is simply wrong.
1799 * kjs/nodes2string.cpp:
1800 (KJS::PropertyNode::streamTo):
1802 2008-01-26 Darin Adler <darin@apple.com>
1804 Reviewed by Eric Seidel.
1806 - http://bugs.webkit.org/show_bug.cgi?id=16860
1807 a bit of cleanup after the Activation optimization
1809 * JavaScriptCore.exp: Export the GlobalExecState constructor instead of
1810 the global flavor of the ExecState constructor. It'd probably be cleaner
1811 to not export either one, but JSGlobalObject inlines the code that
1812 constructs the ExecState. If we changed that, we could remove this export.
1814 * JavaScriptCore.xcodeproj/project.pbxproj: Re-sorted a few things and
1815 put the new source files into the kjs group rather than at the top level.
1817 * kjs/ExecState.cpp:
1818 (KJS::ExecState::ExecState): Marked inline and updated for data member
1819 name changes. This is now only for use for the derived classes. Also removed
1820 code that sets the unused m_savedExec data member for the global case. That
1821 data member is only used for the other two types.
1822 (KJS::ExecState::~ExecState): Marked inline and removed all the code.
1823 The derived class destructors now inclde the appropriate code.
1824 (KJS::ExecState::lexicalGlobalObject): Removed unneeded special case for
1825 an empty scope chain. The bottom function already returns 0 for that case,
1826 so the general case code handles it fine. Also changed to use data members
1827 directly rather than calling functions.
1828 (KJS::GlobalExecState::GlobalExecState): Added. Calls through to the base
1830 (KJS::GlobalExecState::~GlobalExecState): Added.
1831 (KJS::InterpreterExecState::InterpreterExecState): Added. Moved code to
1832 manipulate activeExecStates here since we don't want to have to check for the
1833 special case of globalExec.
1834 (KJS::InterpreterExecState::~InterpreterExecState): Added.
1835 (KJS::EvalExecState::EvalExecState): Added.
1836 (KJS::EvalExecState::~EvalExecState): Added.
1837 (KJS::FunctionExecState::FunctionExecState): Added.
1838 (KJS::FunctionExecState::~FunctionExecState): Added.
1840 * kjs/ExecState.h: Tweaked the header, includes, and declarations a bit.
1841 Made ExecState inherit from Noncopyable. Reformatted some comments and
1842 made them a bit more brief. Rearranged declarations a little bit and removed
1843 unused savedExec function. Changed seenLabels function to return a reference
1844 rather than a pointer. Made constructors and destructor protected, and also
1845 did the same with all data members. Renamed m_thisVal to m_thisValue and
1846 ls to m_labelStack. Added three new derived classes for each of the
1847 types of ExecState. The primary goal here was to remove a branch from the
1848 code in the destructor, but it's also clearer than overloading the arguments
1849 to the ExecState constructor.
1851 * kjs/JSGlobalObject.cpp:
1852 (KJS::getCurrentTime): Fixed formatting.
1853 (KJS::JSGlobalObject::pushActivation): Removed parentheses that don't make
1854 the expression clearer -- other similar sites didn't have these parentheses,
1855 even the one a couple lines earlier that sets stackEntry.
1856 (KJS::JSGlobalObject::tearOffActivation): Got rid of unneeded static_cast
1857 (I think I mentioned this during patch review) and used an early exit so that
1858 the entire contents of the function aren't nested inside an if statement.
1859 Also removed the check of codeType, instead checking Activation for 0.
1860 For now, I kept the codeType check, but inside an assertion.
1862 * kjs/JSGlobalObject.h: Changed type of globalExec to GlobalExecState.
1864 (KJS::FunctionImp::callAsFunction): Changed type to FunctionExecState.
1865 (KJS::GlobalFuncImp::callAsFunction): Changed type to EvalExecState.
1866 * kjs/interpreter.cpp:
1867 (KJS::Interpreter::evaluate): Changed type to GlobalExecState.
1870 (KJS::ContinueNode::execute): Changed code since seenLabels() returns a
1871 reference now instead of a pointer.
1872 (KJS::BreakNode::execute): Ditto.
1873 (KJS::LabelNode::execute): Ditto.
1875 2008-01-26 Sam Weinig <sam@webkit.org>
1877 Reviewed by Mark Rowe.
1879 Cleanup node2string a little.
1880 - Remove some unnecessary branching.
1881 - Factor out bracket and dot streaming into static inline functions.
1884 * kjs/nodes2string.cpp:
1885 (KJS::bracketNodeStreamTo):
1886 (KJS::dotNodeStreamTo):
1887 (KJS::FunctionCallBracketNode::streamTo):
1888 (KJS::FunctionCallDotNode::streamTo):
1889 (KJS::PostIncBracketNode::streamTo):
1890 (KJS::PostDecBracketNode::streamTo):
1891 (KJS::PostIncDotNode::streamTo):
1892 (KJS::PostDecDotNode::streamTo):
1893 (KJS::DeleteBracketNode::streamTo):
1894 (KJS::DeleteDotNode::streamTo):
1895 (KJS::PreIncBracketNode::streamTo):
1896 (KJS::PreDecBracketNode::streamTo):
1897 (KJS::PreIncDotNode::streamTo):
1898 (KJS::PreDecDotNode::streamTo):
1899 (KJS::ReadModifyBracketNode::streamTo):
1900 (KJS::AssignBracketNode::streamTo):
1901 (KJS::ReadModifyDotNode::streamTo):
1902 (KJS::AssignDotNode::streamTo):
1903 (KJS::WhileNode::streamTo):
1905 2008-01-26 Mark Rowe <mrowe@apple.com>
1907 Reviewed by Darin Adler.
1909 Fix http://bugs.webkit.org/show_bug.cgi?id=17001
1910 Bug 17001: Build error with Gtk port on Mac OS X
1912 If both XP_MACOSX and XP_UNIX are defined then X11.h and Carbon.h will both be included.
1913 These provide conflicting definitions for a type named 'Cursor'. As XP_UNIX is set by
1914 the build system when targeting X11, it doesn't make sense for XP_MACOSX to also be set
1917 * bindings/npapi.h: Don't define XP_MACOSX if XP_UNIX is defined.
1919 2008-01-26 Darin Adler <darin@apple.com>
1923 - fix http://bugs.webkit.org/show_bug.cgi?id=17013
1924 JSC can't round trip certain for-loops
1926 Test: fast/js/toString-for-var-decl.html
1928 * kjs/nodes.h: Added PlaceholderTrueNode so we can put nodes into
1929 for loops without injecting the word "true" into them (nice, but not
1930 the bug fix). Fixed ForNode constructor so expr1WasVarDecl is set
1931 only when there is an expression, since it's common for the actual
1932 variable declaration to be moved by the parser.
1934 * kjs/nodes2string.cpp:
1935 (KJS::PlaceholderTrueNode::streamTo): Added. Empty.
1937 2008-01-25 Oliver Hunt <oliver@apple.com>
1941 Fix for bug 17012: REGRESSION: JSC can't round trip an object literal
1943 Add logic to ensure that object literals and function expressions get
1944 parentheses when necessary.
1947 * kjs/nodes2string.cpp:
1948 (KJS::SourceStream::operator<<):
1950 2008-01-24 Steve Falkenburg <sfalken@apple.com>
1954 * JavaScriptCore.vcproj/JavaScriptCore.sln:
1956 2008-01-24 Steve Falkenburg <sfalken@apple.com>
1960 * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln:
1962 2008-01-24 Michael Goddard <michael.goddard@trolltech.com>
1966 Fix QDateTime to JS Date conversion.
1967 Several conversion errors (some UTC related, some month
1968 offset related) and the conversion distance for Date
1969 to DateTime conversion weights were fixed (it should never
1970 be better to convert a JS Number into a Date rather than
1973 * bindings/qt/qt_runtime.cpp:
1974 (KJS::Bindings::convertValueToQVariant):
1975 (KJS::Bindings::convertQVariantToValue):
1977 2008-01-24 Michael Goddard <michael.goddard@trolltech.com>
1981 Add support for calling QObjects.
1982 Add support for invokeDefaultMethod (via a call to
1983 a specific slot), and also allow using it as a
1984 constructor, like QtScript.
1987 * bindings/qt/qt_class.cpp:
1988 (KJS::Bindings::QtClass::fallbackObject):
1989 * bindings/qt/qt_instance.cpp:
1990 (KJS::Bindings::QtRuntimeObjectImp::construct):
1991 (KJS::Bindings::QtInstance::QtInstance):
1992 (KJS::Bindings::QtInstance::~QtInstance):
1993 (KJS::Bindings::QtInstance::implementsCall):
1994 (KJS::Bindings::QtInstance::invokeDefaultMethod):
1995 * bindings/qt/qt_instance.h:
1996 * bindings/qt/qt_runtime.cpp:
1997 (KJS::Bindings::findMethodIndex):
1998 (KJS::Bindings::QtRuntimeMetaMethod::QtRuntimeMetaMethod):
1999 (KJS::Bindings::QtRuntimeMetaMethod::callAsFunction):
2000 * bindings/qt/qt_runtime.h:
2002 2008-01-24 Michael Goddard <michael.goddard@trolltech.com>
2006 Code style cleanups.
2007 Add spaces before/after braces in inline function.
2009 * bindings/qt/qt_instance.h:
2011 2008-01-24 Michael Goddard <michael.goddard@trolltech.com>
2015 Code style cleanups.
2016 Remove spaces and unneeded declared parameter names.
2018 * bindings/qt/qt_instance.cpp:
2019 (KJS::Bindings::QtRuntimeObjectImp::removeFromCache):
2021 2008-01-24 Michael Goddard <michael.goddard@trolltech.com>
2025 Clear stale RuntimeObjectImps.
2026 Since other objects can have refs to the QtInstance,
2027 we can't rely on the QtInstance being deleted when the
2028 RuntimeObjectImp is invalidate or deleted. This
2029 could result in a stale JSObject being returned for
2032 * bindings/qt/qt_instance.cpp:
2033 (KJS::Bindings::QtRuntimeObjectImp::QtRuntimeObjectImp):
2034 (KJS::Bindings::QtRuntimeObjectImp::~QtRuntimeObjectImp):
2035 (KJS::Bindings::QtRuntimeObjectImp::invalidate):
2036 (KJS::Bindings::QtRuntimeObjectImp::removeFromCache):
2037 (KJS::Bindings::QtInstance::getRuntimeObject):
2038 * bindings/runtime.cpp:
2039 (KJS::Bindings::Instance::createRuntimeObject):
2040 * bindings/runtime.h:
2042 2008-01-23 Alp Toker <alp@atoker.com>
2044 Rubber-stamped by Mark Rowe.
2046 Remove whitespace after -I in automake include lists.
2050 2008-01-23 Michael Goddard <michael.goddard@trolltech.com>
2052 Reviewed by Lars Knoll <lars@trolltech.com>.
2054 Reworked the JavaScriptCore Qt bindings:
2056 * Add initial support for string and variant arrays, as well
2057 as sub QObjects in the JS bindings.
2059 * Don't expose fields marked as not scriptable by moc.
2061 * Add support for dynamic properties and accessing named
2062 QObject children of an object (like QtScript and older
2064 * Add support for custom toString methods.
2066 * Fine tune some bindings to be closer to QtScript.
2067 Make void functions return undefined, and empty/
2068 null QStrings return a zero length string.
2070 * Create framework for allowing more direct method calls.
2071 Since RuntimeMethod doesn't allow us to add additional
2072 methods/properties to a function, add these classes.
2073 Start prototyping object.signal.connect(...).
2075 * Add signal support to the Qt bindings.
2076 Allow connecting to signals (object.signal.connect(slot)),
2077 disconnecting, and emitting signals. Currently chooses
2078 the first signal that matches the name, so this will need
2081 * Add property names, and resolve signals closer to use.
2082 Enumerating properties now returns some of the Qt properties
2083 and signals. Slots and methods aren't quite present. Also,
2084 resolve signal connections etc. closer to the time of use, so
2085 we can do more dynamic resolution based on argument type etc.
2086 Still picks the first one with the same name, at the moment.
2088 * Make signature comparison code consistent.
2089 Use the same code for checking meta signatures in
2090 the method and fallback getters, and avoid a
2091 QByteArray construction when we can.
2093 * Fix minor memory leak, and handle pointers better.
2094 Delete the private object in the dtors, and use RefPtrs
2095 for holding Instances etc.
2097 * Handle method lookup better.
2098 Allow invocation time method lookup based on the arguments,
2099 which is closer to QtScript behaviour. Also, cache the
2100 method lists and delete them in the QtClass dtor (stops
2103 * Improve JS to Qt data type conversions.
2104 Add some support for Date & RegExp JS objects,
2105 and provide some metrics on the quality of the
2108 * A couple of fixes for autotest failures.
2109 Better support for converting lists, read/write only
2110 QMetaProperty support, modified slot search order...)
2112 * bindings/qt/qt_class.cpp:
2113 (KJS::Bindings::QtClass::QtClass):
2114 (KJS::Bindings::QtClass::~QtClass):
2115 (KJS::Bindings::QtClass::name):
2116 (KJS::Bindings::QtClass::fallbackObject):
2117 (KJS::Bindings::QtClass::methodsNamed):
2118 (KJS::Bindings::QtClass::fieldNamed):
2119 * bindings/qt/qt_class.h:
2120 * bindings/qt/qt_instance.cpp:
2121 (KJS::Bindings::QtInstance::QtInstance):
2122 (KJS::Bindings::QtInstance::~QtInstance):
2123 (KJS::Bindings::QtInstance::getRuntimeObject):
2124 (KJS::Bindings::QtInstance::getClass):
2125 (KJS::Bindings::QtInstance::implementsCall):
2126 (KJS::Bindings::QtInstance::getPropertyNames):
2127 (KJS::Bindings::QtInstance::invokeMethod):
2128 (KJS::Bindings::QtInstance::invokeDefaultMethod):
2129 (KJS::Bindings::QtInstance::stringValue):
2130 (KJS::Bindings::QtInstance::booleanValue):
2131 (KJS::Bindings::QtInstance::valueOf):
2132 (KJS::Bindings::QtField::name):
2133 (KJS::Bindings::QtField::valueFromInstance):
2134 (KJS::Bindings::QtField::setValueToInstance):
2135 * bindings/qt/qt_instance.h:
2136 (KJS::Bindings::QtInstance::getBindingLanguage):
2137 (KJS::Bindings::QtInstance::getObject):
2138 * bindings/qt/qt_runtime.cpp:
2139 (KJS::Bindings::QWKNoDebug::QWKNoDebug):
2140 (KJS::Bindings::QWKNoDebug::~QWKNoDebug):
2141 (KJS::Bindings::QWKNoDebug::operator<<):
2143 (KJS::Bindings::valueRealType):
2144 (KJS::Bindings::convertValueToQVariant):
2145 (KJS::Bindings::convertQVariantToValue):
2146 (KJS::Bindings::QtRuntimeMethod::QtRuntimeMethod):
2147 (KJS::Bindings::QtRuntimeMethod::~QtRuntimeMethod):
2148 (KJS::Bindings::QtRuntimeMethod::codeType):
2149 (KJS::Bindings::QtRuntimeMethod::execute):
2150 (KJS::Bindings::QtRuntimeMethodData::~QtRuntimeMethodData):
2151 (KJS::Bindings::QtRuntimeMetaMethodData::~QtRuntimeMetaMethodData):
2152 (KJS::Bindings::QtRuntimeConnectionMethodData::~QtRuntimeConnectionMethodData):
2153 (KJS::Bindings::QtMethodMatchType::):
2154 (KJS::Bindings::QtMethodMatchType::QtMethodMatchType):
2155 (KJS::Bindings::QtMethodMatchType::kind):
2156 (KJS::Bindings::QtMethodMatchType::isValid):
2157 (KJS::Bindings::QtMethodMatchType::isVariant):
2158 (KJS::Bindings::QtMethodMatchType::isMetaType):
2159 (KJS::Bindings::QtMethodMatchType::isUnresolved):
2160 (KJS::Bindings::QtMethodMatchType::isMetaEnum):
2161 (KJS::Bindings::QtMethodMatchType::enumeratorIndex):
2162 (KJS::Bindings::QtMethodMatchType::variant):
2163 (KJS::Bindings::QtMethodMatchType::metaType):
2164 (KJS::Bindings::QtMethodMatchType::metaEnum):
2165 (KJS::Bindings::QtMethodMatchType::unresolved):
2166 (KJS::Bindings::QtMethodMatchType::typeId):
2167 (KJS::Bindings::QtMethodMatchType::name):
2168 (KJS::Bindings::QtMethodMatchData::QtMethodMatchData):
2169 (KJS::Bindings::QtMethodMatchData::isValid):
2170 (KJS::Bindings::QtMethodMatchData::firstUnresolvedIndex):
2171 (KJS::Bindings::indexOfMetaEnum):
2172 (KJS::Bindings::findMethodIndex):
2173 (KJS::Bindings::findSignalIndex):
2174 (KJS::Bindings::QtRuntimeMetaMethod::QtRuntimeMetaMethod):
2175 (KJS::Bindings::QtRuntimeMetaMethod::mark):
2176 (KJS::Bindings::QtRuntimeMetaMethod::callAsFunction):
2177 (KJS::Bindings::QtRuntimeMetaMethod::getOwnPropertySlot):
2178 (KJS::Bindings::QtRuntimeMetaMethod::lengthGetter):
2179 (KJS::Bindings::QtRuntimeMetaMethod::connectGetter):
2180 (KJS::Bindings::QtRuntimeMetaMethod::disconnectGetter):
2181 (KJS::Bindings::QtRuntimeConnectionMethod::QtRuntimeConnectionMethod):
2182 (KJS::Bindings::QtRuntimeConnectionMethod::callAsFunction):
2183 (KJS::Bindings::QtRuntimeConnectionMethod::getOwnPropertySlot):
2184 (KJS::Bindings::QtRuntimeConnectionMethod::lengthGetter):
2185 (KJS::Bindings::QtConnectionObject::QtConnectionObject):
2186 (KJS::Bindings::QtConnectionObject::~QtConnectionObject):
2187 (KJS::Bindings::QtConnectionObject::metaObject):
2188 (KJS::Bindings::QtConnectionObject::qt_metacast):
2189 (KJS::Bindings::QtConnectionObject::qt_metacall):
2190 (KJS::Bindings::QtConnectionObject::execute):
2191 (KJS::Bindings::QtConnectionObject::match):
2192 (KJS::Bindings::::QtArray):
2193 (KJS::Bindings::::~QtArray):
2194 (KJS::Bindings::::rootObject):
2195 (KJS::Bindings::::setValueAt):
2196 (KJS::Bindings::::valueAt):
2197 * bindings/qt/qt_runtime.h:
2198 (KJS::Bindings::QtField::):
2199 (KJS::Bindings::QtField::QtField):
2200 (KJS::Bindings::QtField::fieldType):
2201 (KJS::Bindings::QtMethod::QtMethod):
2202 (KJS::Bindings::QtMethod::name):
2203 (KJS::Bindings::QtMethod::numParameters):
2204 (KJS::Bindings::QtArray::getLength):
2205 (KJS::Bindings::QtRuntimeMethod::d_func):
2206 (KJS::Bindings::QtRuntimeMetaMethod::d_func):
2207 (KJS::Bindings::QtRuntimeConnectionMethod::d_func):
2209 * bindings/runtime.cpp:
2210 (KJS::Bindings::Instance::createBindingForLanguageInstance):
2211 (KJS::Bindings::Instance::createRuntimeObject):
2212 (KJS::Bindings::Instance::reallyCreateRuntimeObject):
2213 * bindings/runtime.h:
2215 2008-01-22 Anders Carlsson <andersca@apple.com>
2217 Reviewed by Darin and Adam.
2219 <rdar://problem/5688975>
2220 div element on microsoft site has wrong left offset.
2222 Return true even if NPN_GetProperty returns null or undefined. This matches Firefox
2223 (and is what the Silverlight plug-in expects).
2225 * bindings/NP_jsobject.cpp:
2228 2008-01-21 Geoffrey Garen <ggaren@apple.com>
2230 Reviewed by Maciej Stachowiak.
2232 Fixed http://bugs.webkit.org/show_bug.cgi?id=16909
2233 REGRESSION: Amazon.com crash (ActivationImp)
2235 (and a bunch of other crashes)
2237 Plus, a .7% SunSpider speedup to boot.
2239 Replaced the buggy currentExec and savedExec mechanisms with an
2240 explicit ExecState stack.
2242 * kjs/collector.cpp:
2243 (KJS::Collector::collect): Explicitly mark the ExecState stack.
2245 (KJS::Collector::reportOutOfMemoryToAllExecStates): Slight change in
2246 behavior: We no longer throw an exception in any global ExecStates,
2247 since global ExecStates are more like pseudo-ExecStates, and aren't
2248 used for script execution. (It's unclear what would happen if you left
2249 an exception waiting around in a global ExecState, but it probably
2252 2008-01-21 Jan Michael Alonzo <jmalonzo@unpluggable.com>
2254 Reviewed by Alp Toker.
2256 http://bugs.webkit.org/show_bug.cgi?id=16955
2257 Get errors when cross-compile webkit-gtk
2259 * GNUmakefile.am: removed ICU_CFLAGS
2261 2008-01-18 Kevin McCullough <kmccullough@apple.com>
2267 2008-01-18 Kevin McCullough <kmccullough@apple.com>
2273 (KJS::UString::cost):
2275 2008-01-18 Kevin McCullough <kmccullough@apple.com>
2279 - Correctly report cost of appended strings to trigger GC.
2283 (KJS::UString::Rep::create):
2284 (KJS::UString::UString): Don't create unnecssary objects.
2285 (KJS::UString::cost): Report cost if necessary but also keep track of
2289 2008-01-18 Simon Hausmann <hausmann@webkit.org>
2293 Fix return type conversions from Qt slots to JS values.
2295 This also fixes fast/dom/open-and-close-by-DOM.html, which called
2296 layoutTestController.windowCount().
2298 When constructing the QVariant that holds the return type we cannot
2299 use the QVarian(Type) constuctor as that will create a null variant.
2300 We have to use the QVariant(Type, void *) constructor instead, just
2301 like in QMetaObject::read() for example.
2304 * bindings/qt/qt_instance.cpp:
2305 (KJS::Bindings::QtInstance::getRuntimeObject):
2307 2008-01-18 Prasanth Ullattil <prasanth.ullattil@trolltech.com>
2309 Reviewed by Simon Hausmann <hausmann@webkit.org>.
2311 Fix compilation on Win64(2): Implemented currentThreadStackBase on X86-64 on Windows
2314 * kjs/collector.cpp:
2315 (KJS::Collector::heapAllocate):
2317 2008-01-18 Prasanth Ullattil <prasanth.ullattil@trolltech.com>
2319 Reviewed by Simon Hausmann <hausmann@webkit.org>.
2321 Fix compilation on Win64(1): Define WTF_PLATFORM_X86_64 correctly on Win64.
2326 2008-01-17 Antti Koivisto <antti@apple.com>
2330 * kjs/regexp_object.cpp:
2331 (KJS::regExpProtoFuncToString):
2333 2008-01-16 Sam Weinig <sam@webkit.org>
2337 Fix for http://bugs.webkit.org/show_bug.cgi?id=16901
2338 Convert remaining JS function objects to use the new PrototypeFunction class
2340 - Moves Boolean, Function, RegExp, Number, Object and Global functions to their
2341 own static function implementations so that they can be used with the
2342 PrototypeFunction class. SunSpider says this is 1.003x as fast.
2344 * kjs/JSGlobalObject.cpp:
2345 (KJS::JSGlobalObject::reset):
2346 * kjs/array_object.h:
2347 * kjs/bool_object.cpp:
2348 (KJS::BooleanInstance::BooleanInstance):
2349 (KJS::BooleanPrototype::BooleanPrototype):
2350 (KJS::booleanProtoFuncToString):
2351 (KJS::booleanProtoFuncValueOf):
2352 (KJS::BooleanObjectImp::BooleanObjectImp):
2353 (KJS::BooleanObjectImp::implementsConstruct):
2354 (KJS::BooleanObjectImp::construct):
2355 (KJS::BooleanObjectImp::callAsFunction):
2356 * kjs/bool_object.h:
2357 (KJS::BooleanInstance::classInfo):
2358 * kjs/error_object.cpp:
2359 (KJS::ErrorPrototype::ErrorPrototype):
2360 (KJS::errorProtoFuncToString):
2361 * kjs/error_object.h:
2363 (KJS::globalFuncEval):
2364 (KJS::globalFuncParseInt):
2365 (KJS::globalFuncParseFloat):
2366 (KJS::globalFuncIsNaN):
2367 (KJS::globalFuncIsFinite):
2368 (KJS::globalFuncDecodeURI):
2369 (KJS::globalFuncDecodeURIComponent):
2370 (KJS::globalFuncEncodeURI):
2371 (KJS::globalFuncEncodeURIComponent):
2372 (KJS::globalFuncEscape):
2373 (KJS::globalFuncUnEscape):
2374 (KJS::globalFuncKJSPrint):
2375 (KJS::PrototypeFunction::PrototypeFunction):
2377 * kjs/function_object.cpp:
2378 (KJS::FunctionPrototype::FunctionPrototype):
2379 (KJS::functionProtoFuncToString):
2380 (KJS::functionProtoFuncApply):
2381 (KJS::functionProtoFuncCall):
2382 * kjs/function_object.h:
2383 * kjs/number_object.cpp:
2384 (KJS::NumberPrototype::NumberPrototype):
2385 (KJS::numberProtoFuncToString):
2386 (KJS::numberProtoFuncToLocaleString):
2387 (KJS::numberProtoFuncValueOf):
2388 (KJS::numberProtoFuncToFixed):
2389 (KJS::numberProtoFuncToExponential):
2390 (KJS::numberProtoFuncToPrecision):
2391 * kjs/number_object.h:
2392 (KJS::NumberInstance::classInfo):
2393 (KJS::NumberObjectImp::classInfo):
2394 (KJS::NumberObjectImp::):
2395 * kjs/object_object.cpp:
2396 (KJS::ObjectPrototype::ObjectPrototype):
2397 (KJS::objectProtoFuncValueOf):
2398 (KJS::objectProtoFuncHasOwnProperty):
2399 (KJS::objectProtoFuncIsPrototypeOf):
2400 (KJS::objectProtoFuncDefineGetter):
2401 (KJS::objectProtoFuncDefineSetter):
2402 (KJS::objectProtoFuncLookupGetter):
2403 (KJS::objectProtoFuncLookupSetter):
2404 (KJS::objectProtoFuncPropertyIsEnumerable):
2405 (KJS::objectProtoFuncToLocaleString):
2406 (KJS::objectProtoFuncToString):
2407 * kjs/object_object.h:
2408 * kjs/regexp_object.cpp:
2409 (KJS::RegExpPrototype::RegExpPrototype):
2410 (KJS::regExpProtoFuncTest):
2411 (KJS::regExpProtoFuncExec):
2412 (KJS::regExpProtoFuncCompile):
2413 (KJS::regExpProtoFuncToString):
2414 * kjs/regexp_object.h:
2416 2008-01-16 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2418 Reviewed by Maciej & Darin.
2420 Fixes Bug 16868: Gmail crash
2421 and Bug 16871: Crash when loading apple.com/startpage
2423 <http://bugs.webkit.org/show_bug.cgi?id=16868>
2424 <rdar://problem/5686108>
2426 <http://bugs.webkit.org/show_bug.cgi?id=16871>
2427 <rdar://problem/5686670>
2429 Adds ActivationImp tear-off for cross-window eval() and fixes an
2430 existing garbage collection issue exposed by the ActivationImp tear-off
2431 patch (r29425) that can occur when an ExecState's m_callingExec is
2432 different than its m_savedExec.
2434 * kjs/ExecState.cpp:
2435 (KJS::ExecState::mark):
2437 (KJS::GlobalFuncImp::callAsFunction):
2439 2008-01-16 Sam Weinig <sam@webkit.org>
2443 Clean up MathObjectImp, it needed a little scrubbing.
2445 * kjs/math_object.cpp:
2446 (KJS::MathObjectImp::MathObjectImp):
2447 (KJS::MathObjectImp::getOwnPropertySlot):
2448 (KJS::MathObjectImp::getValueProperty):
2449 (KJS::mathProtoFuncACos):
2450 (KJS::mathProtoFuncASin):
2451 (KJS::mathProtoFuncATan):
2452 (KJS::mathProtoFuncATan2):
2453 (KJS::mathProtoFuncCos):
2454 (KJS::mathProtoFuncExp):
2455 (KJS::mathProtoFuncLog):
2456 (KJS::mathProtoFuncSin):
2457 (KJS::mathProtoFuncSqrt):
2458 (KJS::mathProtoFuncTan):
2459 * kjs/math_object.h:
2460 (KJS::MathObjectImp::classInfo):
2461 (KJS::MathObjectImp::):
2463 2008-01-16 Sam Weinig <sam@webkit.org>
2465 Reviewed by Geoffrey Garen.
2467 Rename Lexer variable bol to atLineStart.
2470 (KJS::Lexer::Lexer):
2471 (KJS::Lexer::setCode):
2472 (KJS::Lexer::nextLine):
2476 2008-01-16 Sam Weinig <sam@webkit.org>
2478 Reviewed by Geoffrey Garen and Anders Carlsson.
2480 Remove uses of KJS_PURE_ECMA as we don't ever build with it defined,
2481 and we have many features that are not included in the ECMA spec.
2484 (KJS::Lexer::Lexer):
2485 (KJS::Lexer::setCode):
2486 (KJS::Lexer::nextLine):
2489 * kjs/string_object.cpp:
2490 * kjs/string_object.h:
2492 2008-01-15 Sam Weinig <sam@webkit.org>
2494 Reviewed by Geoffrey Garen.
2496 Fix <rdar://problem/5595552> r27608 introduced a 20% increase in JS binary size, 4% increase in WebCore binary size
2498 - This changes the way JS functions that use Lookup tables are handled. Instead of using
2499 one class per function, which allowed specialization of the virtual callAsFunction
2500 method, we now use one class, PrototypeFunction, which takes a pointer to a static
2501 function to use as the implementation. This significantly decreases the binary size
2502 of JavaScriptCore (about 145k on an Intel only build) while still keeping some of the
2503 speedup r27608 garnered (SunSpider says this is 1.005x as slow, which should leave some
2504 wiggle room from the original 1% speedup) and keeps the functions implementations in separate
2505 functions to help with optimizations.
2507 * JavaScriptCore.exp:
2508 * JavaScriptCore.xcodeproj/project.pbxproj:
2509 * kjs/array_object.cpp:
2510 (KJS::arrayProtoFuncToString):
2511 (KJS::arrayProtoFuncToLocaleString):
2512 (KJS::arrayProtoFuncJoin):
2513 (KJS::arrayProtoFuncConcat):
2514 (KJS::arrayProtoFuncPop):
2515 (KJS::arrayProtoFuncPush):
2516 (KJS::arrayProtoFuncReverse):
2517 (KJS::arrayProtoFuncShift):
2518 (KJS::arrayProtoFuncSlice):
2519 (KJS::arrayProtoFuncSort):
2520 (KJS::arrayProtoFuncSplice):
2521 (KJS::arrayProtoFuncUnShift):
2522 (KJS::arrayProtoFuncFilter):
2523 (KJS::arrayProtoFuncMap):
2524 (KJS::arrayProtoFuncEvery):
2525 (KJS::arrayProtoFuncForEach):
2526 (KJS::arrayProtoFuncSome):
2527 (KJS::arrayProtoFuncIndexOf):
2528 (KJS::arrayProtoFuncLastIndexOf):
2529 * kjs/array_object.h:
2530 * kjs/date_object.cpp:
2531 (KJS::DatePrototype::getOwnPropertySlot):
2532 (KJS::dateProtoFuncToString):
2533 (KJS::dateProtoFuncToUTCString):
2534 (KJS::dateProtoFuncToDateString):
2535 (KJS::dateProtoFuncToTimeString):
2536 (KJS::dateProtoFuncToLocaleString):
2537 (KJS::dateProtoFuncToLocaleDateString):
2538 (KJS::dateProtoFuncToLocaleTimeString):
2539 (KJS::dateProtoFuncValueOf):
2540 (KJS::dateProtoFuncGetTime):
2541 (KJS::dateProtoFuncGetFullYear):
2542 (KJS::dateProtoFuncGetUTCFullYear):
2543 (KJS::dateProtoFuncToGMTString):
2544 (KJS::dateProtoFuncGetMonth):
2545 (KJS::dateProtoFuncGetUTCMonth):
2546 (KJS::dateProtoFuncGetDate):
2547 (KJS::dateProtoFuncGetUTCDate):
2548 (KJS::dateProtoFuncGetDay):
2549 (KJS::dateProtoFuncGetUTCDay):
2550 (KJS::dateProtoFuncGetHours):
2551 (KJS::dateProtoFuncGetUTCHours):
2552 (KJS::dateProtoFuncGetMinutes):
2553 (KJS::dateProtoFuncGetUTCMinutes):
2554 (KJS::dateProtoFuncGetSeconds):
2555 (KJS::dateProtoFuncGetUTCSeconds):
2556 (KJS::dateProtoFuncGetMilliSeconds):
2557 (KJS::dateProtoFuncGetUTCMilliseconds):
2558 (KJS::dateProtoFuncGetTimezoneOffset):
2559 (KJS::dateProtoFuncSetTime):
2560 (KJS::dateProtoFuncSetMilliSeconds):
2561 (KJS::dateProtoFuncSetUTCMilliseconds):
2562 (KJS::dateProtoFuncSetSeconds):
2563 (KJS::dateProtoFuncSetUTCSeconds):
2564 (KJS::dateProtoFuncSetMinutes):
2565 (KJS::dateProtoFuncSetUTCMinutes):
2566 (KJS::dateProtoFuncSetHours):
2567 (KJS::dateProtoFuncSetUTCHours):
2568 (KJS::dateProtoFuncSetDate):
2569 (KJS::dateProtoFuncSetUTCDate):
2570 (KJS::dateProtoFuncSetMonth):
2571 (KJS::dateProtoFuncSetUTCMonth):
2572 (KJS::dateProtoFuncSetFullYear):
2573 (KJS::dateProtoFuncSetUTCFullYear):
2574 (KJS::dateProtoFuncSetYear):
2575 (KJS::dateProtoFuncGetYear):
2576 * kjs/date_object.h:
2578 (KJS::PrototypeFunction::PrototypeFunction):
2579 (KJS::PrototypeFunction::callAsFunction):
2583 (KJS::staticFunctionGetter):
2584 * kjs/math_object.cpp:
2585 (KJS::mathProtoFuncAbs):
2586 (KJS::mathProtoFuncACos):
2587 (KJS::mathProtoFuncASin):
2588 (KJS::mathProtoFuncATan):
2589 (KJS::mathProtoFuncATan2):
2590 (KJS::mathProtoFuncCeil):
2591 (KJS::mathProtoFuncCos):
2592 (KJS::mathProtoFuncExp):
2593 (KJS::mathProtoFuncFloor):
2594 (KJS::mathProtoFuncLog):
2595 (KJS::mathProtoFuncMax):
2596 (KJS::mathProtoFuncMin):
2597 (KJS::mathProtoFuncPow):
2598 (KJS::mathProtoFuncRandom):
2599 (KJS::mathProtoFuncRound):
2600 (KJS::mathProtoFuncSin):
2601 (KJS::mathProtoFuncSqrt):
2602 (KJS::mathProtoFuncTan):
2603 * kjs/math_object.h:
2604 * kjs/string_object.cpp:
2605 (KJS::stringProtoFuncToString):
2606 (KJS::stringProtoFuncValueOf):
2607 (KJS::stringProtoFuncCharAt):
2608 (KJS::stringProtoFuncCharCodeAt):
2609 (KJS::stringProtoFuncConcat):
2610 (KJS::stringProtoFuncIndexOf):
2611 (KJS::stringProtoFuncLastIndexOf):
2612 (KJS::stringProtoFuncMatch):
2613 (KJS::stringProtoFuncSearch):
2614 (KJS::stringProtoFuncReplace):
2615 (KJS::stringProtoFuncSlice):
2616 (KJS::stringProtoFuncSplit):
2617 (KJS::stringProtoFuncSubstr):
2618 (KJS::stringProtoFuncSubstring):
2619 (KJS::stringProtoFuncToLowerCase):
2620 (KJS::stringProtoFuncToUpperCase):
2621 (KJS::stringProtoFuncToLocaleLowerCase):
2622 (KJS::stringProtoFuncToLocaleUpperCase):
2623 (KJS::stringProtoFuncLocaleCompare):
2624 (KJS::stringProtoFuncBig):
2625 (KJS::stringProtoFuncSmall):
2626 (KJS::stringProtoFuncBlink):
2627 (KJS::stringProtoFuncBold):
2628 (KJS::stringProtoFuncFixed):
2629 (KJS::stringProtoFuncItalics):
2630 (KJS::stringProtoFuncStrike):
2631 (KJS::stringProtoFuncSub):
2632 (KJS::stringProtoFuncSup):
2633 (KJS::stringProtoFuncFontcolor):
2634 (KJS::stringProtoFuncFontsize):
2635 (KJS::stringProtoFuncAnchor):
2636 (KJS::stringProtoFuncLink):
2637 * kjs/string_object.h:
2639 2008-01-15 Geoffrey Garen <ggaren@apple.com>
2641 Reviewed by Adam Roben.
2643 Some tweaks to our headerdoc, suggested by David Gatwood on the docs
2647 * API/JSObjectRef.h:
2648 * API/JSStringRef.h:
2651 2008-01-15 Alp Toker <alp@atoker.com>
2653 Rubber-stamped by Anders.
2655 Make the HTTP backend configurable in the GTK+ port. curl is currently
2658 * wtf/Platform.h: Don't hard-code WTF_USE_CURL for GTK
2660 2008-01-15 Sam Weinig <sam@webkit.org>
2662 Reviewed by Beth Dakin.
2664 Remove unneeded variable.
2666 * kjs/string_object.cpp:
2667 (KJS::StringProtoFuncSubstr::callAsFunction):
2669 2008-01-14 Steve Falkenburg <sfalken@apple.com>
2671 Use shared vsprops for most vcproj properties.
2675 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add missing Debug_Internal config.
2676 * JavaScriptCore.vcproj/WTF/WTF.vcproj: Add missing Debug_Internal config.
2677 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
2679 2008-01-14 Adam Roben <aroben@apple.com>
2681 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Added
2682 some headers that were missing from the vcproj so their contents will
2683 be included in Find in Files.
2685 2008-01-14 Adam Roben <aroben@apple.com>
2687 Fix Bug 16871: Crash when loading apple.com/startpage
2689 <http://bugs.webkit.org/show_bug.cgi?id=16871>
2690 <rdar://problem/5686670>
2692 Patch written by Darin, reviewed by me.
2694 * kjs/ExecState.cpp:
2695 (KJS::ExecState::mark): Call ActivationImp::markChildren if our
2696 m_activation is on the stack. This is what ScopeChain::mark also does,
2697 but apparently in some cases it's possible for an ExecState's
2698 ActivationImp to not be in any ScopeChain.
2700 2008-01-14 Kevin McCullough <kmccullough@apple.com>
2704 -<rdar://problem/5622667> REGRESSION (Leopard-ToT): Endless loading loop
2705 trying to view techreport.com comments
2706 - We need to set values in the map, because if they are already in the
2707 map they will not be reset when we use add().
2709 * kjs/array_instance.cpp:
2710 (KJS::ArrayInstance::put):
2712 2008-01-14 Darin Adler <darin@apple.com>
2716 - re-speed-up the page load test (my StringImpl change slowed it down)
2719 (WTF::RefCounted::RefCounted): Allow derived classes to start with a reference
2720 count other than 0. Eventually everyone will want to start with a 1. This is a
2721 staged change. For now, there's a default of 0, and you can specify 1. Later,
2722 there will be no default and everyone will have to specify. And then later, there
2723 will be a default of 1. Eventually, we can take away even the option of starting
2727 (WTF::Vector::Vector): Sped up creation of non-empty vectors by removing the
2728 overhead of first constructing something empty and then calling resize.
2729 (WTF::Vector::clear): Sped up the common case of calling clear on an empty
2730 vector by adding a check for that case.
2731 (WTF::Vector::releaseBuffer): Marked this function inline and removed a branch
2732 in the case of vectors with no inline capacity (normal vectors) by leaving out
2733 the code to copy the inline buffer in that case.
2735 2008-01-14 Alexey Proskuryakov <ap@webkit.org>
2737 Reviewed by David Kilzer.
2739 http://bugs.webkit.org/show_bug.cgi?id=16787
2740 array.splice() with 1 element not working
2742 Test: fast/js/array-splice.html
2744 * kjs/array_object.cpp:
2745 (KJS::ArrayProtoFuncSplice::callAsFunction): Implement this Mozilla extension, and fix
2746 some other edge cases.
2748 2008-01-13 Steve Falkenburg <sfalken@apple.com>
2750 Share common files across projects.
2753 Debug: common.vsprops, debug.vsprops
2754 Debug_Internal: common.vsprops, debug.vsprops, debug_internal.vsprops
2755 Release: common.vsprops, release.vsprops
2757 Shared properties can go into common.vsprops, shared debug settings can go into debug.vsprops.
2758 debug_internal.vsprops will be mostly empty except for file path prefix modifiers.
2760 Reviewed by Adam Roben.
2762 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2763 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
2764 * JavaScriptCore.vcproj/debug.vsprops: Removed.
2765 * JavaScriptCore.vcproj/debug_internal.vsprops: Removed.
2766 * JavaScriptCore.vcproj/release.vsprops: Removed.
2767 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
2769 2008-01-13 Marius Bugge Monsen <mbm@trolltech.com>
2771 Contributions and review by Adriaan de Groot,
2772 Simon Hausmann, Eric Seidel, and Darin Adler.
2774 - http://bugs.webkit.org/show_bug.cgi?id=16590
2775 Compilation fixes for Solaris.
2778 (KJS::GregorianDateTime::GregorianDateTime): Use the WIN_OS code path
2779 for SOLARIS too, presumably because Solaris also lacks the tm_gtoff and tm_zone
2781 (KJS::GregorianDateTime::operator tm): Ditto.
2783 * kjs/collector.cpp:
2784 (KJS::currentThreadStackBase): Use thr_stksegment on Solaris.
2787 (isfinite): Implement for Solaris.
2789 (signbit): Ditto. But this one is wrong, so I added a FIXME.
2791 * wtf/Platform.h: Define PLATFORM(SOLARIS) when "sun" or "__sun" is defined.
2793 2008-01-13 Michael Goddard <michael.goddard@trolltech.com>
2795 Reviewed by Anders Carlsson.
2797 Add binding language type to Instance.
2798 Allows runtime determination of the type of an
2799 Instance, to allow safe casting. Doesn't actually
2800 add any safe casting yet, though.
2802 Add a helper function to get an Instance from a JSObject*.
2803 Given an object and the expected binding language, see if
2804 the JSObject actually wraps an Instance of the given type
2805 and return it. Otherwise return 0.
2807 Move RuntimeObjectImp creations into Instance.
2808 Make the ctor protected, and Instance a friend class, so
2809 that all creation of RuntimeObjectImps goes through
2812 Remove copy ctor/assignment operator for QtInstance.
2813 Instance itself is Noncopyable, so QtInstance doesn't
2816 Add caching for QtInstance and associated RuntimeObjectImps.
2817 Push any dealings with QtLanguage bindings into QtInstance,
2818 and cache them there, rather than in the Instance layer. Add
2819 a QtRuntimeObjectImp to help with caching.
2821 * JavaScriptCore.exp:
2822 * bindings/c/c_instance.h:
2823 * bindings/jni/jni_instance.h:
2824 * bindings/objc/objc_instance.h:
2825 * bindings/qt/qt_instance.cpp:
2826 (KJS::Bindings::QtRuntimeObjectImp::QtRuntimeObjectImp):
2827 (KJS::Bindings::QtRuntimeObjectImp::~QtRuntimeObjectImp):
2828 (KJS::Bindings::QtRuntimeObjectImp::invalidate):
2829 (KJS::Bindings::QtRuntimeObjectImp::removeFromCache):
2830 (KJS::Bindings::QtInstance::QtInstance):
2831 (KJS::Bindings::QtInstance::~QtInstance):
2832 (KJS::Bindings::QtInstance::getQtInstance):
2833 (KJS::Bindings::QtInstance::getRuntimeObject):
2834 * bindings/qt/qt_instance.h:
2835 (KJS::Bindings::QtInstance::getBindingLanguage):
2836 * bindings/runtime.cpp:
2837 (KJS::Bindings::Instance::createBindingForLanguageInstance):
2838 (KJS::Bindings::Instance::createRuntimeObject):
2839 (KJS::Bindings::Instance::getInstance):
2840 * bindings/runtime.h:
2841 * bindings/runtime_object.h:
2842 (KJS::RuntimeObjectImp::getInternalInstance):
2844 2008-01-12 Alp Toker <alp@atoker.com>
2846 Reviewed by Mark Rowe.
2848 Hide non-public symbols in GTK+/autotools release builds.
2852 2008-01-12 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2854 Reviewed by Mark Rowe.
2856 Fix http://bugs.webkit.org/show_bug.cgi?id=16852
2857 Fixes leaking of ActivationStackNode objects.
2859 * kjs/JSGlobalObject.cpp:
2860 (KJS::JSGlobalObject::deleteActivationStack):
2861 (KJS::JSGlobalObject::~JSGlobalObject):
2862 (KJS::JSGlobalObject::init):
2863 (KJS::JSGlobalObject::reset):
2864 * kjs/JSGlobalObject.h:
2866 2008-01-12 Darin Adler <darin@apple.com>
2868 - try to fix Qt Windows build
2870 * pcre/dftables: Remove reliance on the list form of Perl pipes.
2872 2008-01-12 Darin Adler <darin@apple.com>
2874 - try to fix Qt build
2876 * kjs/function.cpp: Added include of scope_chain_mark.h.
2877 * kjs/scope_chain_mark.h: Added multiple-include guards.
2879 2008-01-12 Mark Rowe <mrowe@apple.com>
2881 Another Windows build fix.
2885 2008-01-12 Mark Rowe <mrowe@apple.com>
2887 Attempted Windows build fix. Use struct consistently when forward-declaring
2888 ActivationStackNode and StackActivation.
2891 * kjs/JSGlobalObject.h:
2893 2008-01-12 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2897 Fixes a problem with the ActivationImp tear-off patch (r29425) where
2898 some of the calls to JSGlobalObject::tearOffActivation() were using
2899 the wrong test to determine whether it should leave a relic behind.
2902 (KJS::FunctionImp::argumentsGetter):
2903 (KJS::ActivationImp::getOwnPropertySlot):
2905 2008-01-11 Geoffrey Garen <ggaren@apple.com>
2907 Reviewed by Oliver Hunt.
2909 Fixed <rdar://problem/5665251> REGRESSION (r28880-r28886): Global
2910 variable access (16644)
2912 This bug was caused by var declarations shadowing built-in properties of
2915 To match Firefox, we've decided that var declarations will never shadow
2916 built-in properties of the global object or its prototypes. We used to
2917 behave more like IE, which allows shadowing, but walking that line got
2918 us into trouble with websites that sent us down the Firefox codepath.
2920 * kjs/JSVariableObject.h:
2921 (KJS::JSVariableObject::symbolTableGet): New code to support calling
2922 hasProperty before the variable object is fully initialized (so you
2923 can call it during initialization).
2926 (KJS::ProgramNode::initializeSymbolTable): Always do a full hasProperty
2927 check when looking for duplicates, not getDirect, since it only checks
2928 the property map, and not hasOwnProperty, since it doesn't check
2930 (KJS::EvalNode::processDeclarations): ditto
2932 * kjs/property_slot.h:
2933 (KJS::PropertySlot::ungettableGetter): Best function name evar.
2935 2008-01-11 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2939 Optimized ActivationImp allocation, so that activation records are now
2940 first allocated on an explicitly managed stack and only heap allocated
2941 when necessary. Roughly a 5% improvement on SunSpider, and a larger
2942 improvement on benchmarks that use more function calls.
2944 * JavaScriptCore.xcodeproj/project.pbxproj:
2945 * kjs/Activation.h: Added.
2946 (KJS::ActivationImp::ActivationData::ActivationData):
2947 (KJS::ActivationImp::ActivationImp):
2948 (KJS::ActivationImp::classInfo):
2949 (KJS::ActivationImp::isActivationObject):
2950 (KJS::ActivationImp::isOnStack):
2951 (KJS::ActivationImp::d):
2952 (KJS::StackActivation::StackActivation):
2953 * kjs/ExecState.cpp:
2954 (KJS::ExecState::ExecState):
2955 (KJS::ExecState::~ExecState):
2957 (KJS::ExecState::replaceScopeChainTop):
2958 (KJS::ExecState::setActivationObject):
2959 (KJS::ExecState::setLocalStorage):
2960 * kjs/JSGlobalObject.cpp:
2961 (KJS::JSGlobalObject::reset):
2962 (KJS::JSGlobalObject::pushActivation):
2963 (KJS::JSGlobalObject::checkActivationCount):
2964 (KJS::JSGlobalObject::popActivationHelper):
2965 (KJS::JSGlobalObject::popActivation):
2966 (KJS::JSGlobalObject::tearOffActivation):
2967 * kjs/JSGlobalObject.h:
2968 * kjs/JSVariableObject.h:
2969 (KJS::JSVariableObject::JSVariableObjectData::JSVariableObjectData):
2970 (KJS::JSVariableObject::JSVariableObject):
2972 (KJS::FunctionImp::argumentsGetter):
2973 (KJS::ActivationImp::ActivationImp):
2974 (KJS::ActivationImp::~ActivationImp):
2975 (KJS::ActivationImp::init):
2976 (KJS::ActivationImp::getOwnPropertySlot):
2977 (KJS::ActivationImp::markHelper):
2978 (KJS::ActivationImp::mark):
2979 (KJS::ActivationImp::ActivationData::ActivationData):
2980 (KJS::GlobalFuncImp::callAsFunction):
2983 (KJS::PostIncResolveNode::evaluate):
2984 (KJS::PostDecResolveNode::evaluate):
2985 (KJS::PreIncResolveNode::evaluate):
2986 (KJS::PreDecResolveNode::evaluate):
2987 (KJS::ReadModifyResolveNode::evaluate):
2988 (KJS::AssignResolveNode::evaluate):
2989 (KJS::WithNode::execute):
2990 (KJS::TryNode::execute):
2991 (KJS::FunctionBodyNode::processDeclarations):
2992 (KJS::FuncExprNode::evaluate):
2994 * kjs/scope_chain.h:
2995 (KJS::ScopeChain::replace):
2996 * kjs/scope_chain_mark.h: Added.
2997 (KJS::ScopeChain::mark):
2999 2008-01-11 Simon Hausmann <hausmann@webkit.org>
3001 Reviewed by Mark Rowe.
3003 Fix the (clean) qmake build. For generating chartables.c we don't
3004 depend on a separate input source file anymore, the dftables perl
3005 script is enough. So use that instead as value for the .input
3006 variable, to ensure that qmake also generates a rule to call dftables.
3010 2008-01-10 Geoffrey Garen <ggaren@apple.com>
3012 Reviewed by John Sullivan.
3014 Fixed some world leak reports:
3015 * <rdar://problem/5669436> PLT complains about world leak of 1 JavaScript
3016 Interpreter after running cvs-base suite
3018 * <rdar://problem/5669423> PLT complains about world leak if browser
3019 window is open when PLT starts
3021 * kjs/collector.h: Added the ability to distinguish between global
3022 objects and GC-protected global objects, since we only consider the
3023 latter to be world leaks.
3024 * kjs/collector.cpp:
3026 2008-01-11 Mark Rowe <mrowe@apple.com>
3028 Silence qmake warning about ctgen lacking input.
3030 Rubber-stamped by Alp Toker.
3034 2008-01-10 David Kilzer <ddkilzer@apple.com>
3036 dftables should be rewritten as a script
3038 <http://bugs.webkit.org/show_bug.cgi?id=16818>
3039 <rdar://problem/5681463>
3043 Rewrote the dftables utility in Perl. Attempted to switch all
3044 build systems to call the script directly instead of building
3045 a binary first. Only the Xcode build was able to be tested.
3047 * DerivedSources.make: Added pcre directory to VPATH and changed
3048 to invoke dftables directly.
3049 * GNUmakefile.am: Removed build information and changed to invoke
3051 * JavaScriptCore.vcproj/JavaScriptCore.sln: Removed reference to
3053 * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln: Ditto.
3054 * JavaScriptCore.vcproj/dftables: Removed.
3055 * JavaScriptCore.vcproj/dftables/dftables.vcproj: Removed.
3056 * JavaScriptCore.xcodeproj/project.pbxproj: Removed dftables target.
3057 * jscore.bkl: Removed dftables executable definition.
3058 * pcre/dftables: Copied from JavaScriptCore/pcre/dftables.cpp.
3059 * pcre/dftables.cpp: Removed.
3060 * pcre/dftables.pro: Removed.
3061 * pcre/pcre.pri: Removed references to dftables.cpp and changed to
3062 invoke dftables directly.
3064 2008-01-10 Dan Bernstein <mitz@apple.com>
3066 Reviewed by Darin Adler.
3068 - fix http://bugs.webkit.org/show_bug.cgi?id=16782
3069 <rdar://problem/5675331> REGRESSION(r29266): Reproducible crash in fast/replaced/image-map.html
3071 The crash resulted from a native object (DumpRenderTree's
3072 EventSender) causing its wrapper to be invalidated (by clicking a
3073 link that replaced the document in the window) and consequently
3074 deallocated. The fix is to use RefPtrs to protect the native object
3075 from deletion by self-invalidation.
3077 * bindings/runtime_method.cpp:
3078 (RuntimeMethod::callAsFunction):
3079 * bindings/runtime_object.cpp:
3080 (RuntimeObjectImp::fallbackObjectGetter):
3081 (RuntimeObjectImp::fieldGetter):
3082 (RuntimeObjectImp::methodGetter):
3083 (RuntimeObjectImp::put):
3084 (RuntimeObjectImp::defaultValue):
3085 (RuntimeObjectImp::callAsFunction):
3087 2008-01-07 Mark Rowe <mrowe@apple.com>
3089 Reviewed by Maciej Stachowiak.
3091 Turn testIsInteger assertions into compile-time asserts and move them into HashTraits.h
3097 2008-01-07 Nikolas Zimmermann <zimmermann@kde.org>
3101 Enable SVG_FONTS by default.
3103 * Configurations/JavaScriptCore.xcconfig:
3105 2008-01-07 Darin Adler <darin@apple.com>
3107 Rubber stamped by David Kilzer.
3109 - get rid of empty fpconst.cpp
3111 * GNUmakefile.am: Remove fpconst.cpp.
3112 * JavaScriptCore.pri: Ditto.
3113 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto.
3114 * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
3115 * JavaScriptCoreSources.bkl: Ditto.
3117 * kjs/fpconst.cpp: Removed.
3119 2008-01-07 Darin Adler <darin@apple.com>
3121 Reviewed by David Kilzer.
3123 - fix alignment problem with NaN and Inf globals
3125 * kjs/fpconst.cpp: Move the contents of this file from here back to
3126 value.cpp. The reason this was in a separate file is that the DARWIN
3127 version of this used a declaration of the globals with a different
3128 type to avoid creating "init routines". That's no longer necessary for
3129 DARWIN and was never necessary for the non-DARWIN code path.
3130 To make this patch easy to merge, I didn't actually delete this file
3131 yet. We'll do that in a separate changeset.
3133 * kjs/value.cpp: If C99's NAN and INFINITY are present, then use them,
3134 othrewise use the union trick from fpconst.cpp. I think it would be
3135 better to eliminate KJS::NaN and KJS::Inf and just use NAN and INFINITY
3136 directly or std::numeric_limits<double>::quiet_nan() and
3137 std::numeric_limits<double>::infinity(). But when I tried that, it
3138 slowed down SunSpider. Someone else could do that cleanup if they
3139 could do it without slowing down the engine.
3141 2008-01-07 Adam Roben <aroben@apple.com>
3145 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Added
3146 JavaScript.h to the project.
3147 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
3148 Copy JavaScript.h to WEBKITOUTPUTDIR.
3150 2008-01-07 Timothy Hatcher <timothy@apple.com>
3161 * API/JavaScriptCore.h:
3163 * JavaScriptCore.xcodeproj/project.pbxproj:
3165 2008-01-07 Alp Toker <alp@atoker.com>
3169 http://bugs.webkit.org/show_bug.cgi?id=16029
3170 JavaScriptCore.h is not suitable for platforms other than Mac OS X
3172 Introduce a new JavaScriptCore/JavaScript.h public API header. This
3173 should be used by all new portable code using the JavaScriptCore API.
3175 JavaScriptCore/JavaScriptCore.h will remain for compatibility with
3176 existing applications that depend on it including JSStringRefCF.h
3177 which isn't portable.
3179 Also add minidom to the GTK+/autotools build since we can now support
3180 it on all platforms.
3184 * API/JavaScript.h: Added.
3185 * API/JavaScriptCore.h:
3186 * ForwardingHeaders/JavaScriptCore/JavaScript.h: Added.
3188 * JavaScriptCore.xcodeproj/project.pbxproj:
3190 2008-01-06 Eric Seidel <eric@webkit.org>
3194 Abstract all DateObject.set* functions in preparation for fixing:
3195 http://bugs.webkit.org/show_bug.cgi?id=16753
3197 SunSpider had random changes here and there but was overall a wash.
3199 * kjs/date_object.cpp:
3200 (KJS::fillStructuresUsingTimeArgs):
3201 (KJS::setNewValueFromTimeArgs):
3202 (KJS::setNewValueFromDateArgs):
3203 (KJS::DateProtoFuncSetMilliSeconds::callAsFunction):
3204 (KJS::DateProtoFuncSetUTCMilliseconds::callAsFunction):
3205 (KJS::DateProtoFuncSetSeconds::callAsFunction):
3206 (KJS::DateProtoFuncSetUTCSeconds::callAsFunction):
3207 (KJS::DateProtoFuncSetMinutes::callAsFunction):
3208 (KJS::DateProtoFuncSetUTCMinutes::callAsFunction):
3209 (KJS::DateProtoFuncSetHours::callAsFunction):
3210 (KJS::DateProtoFuncSetUTCHours::callAsFunction):
3211 (KJS::DateProtoFuncSetDate::callAsFunction):
3212 (KJS::DateProtoFuncSetUTCDate::callAsFunction):
3213 (KJS::DateProtoFuncSetMonth::callAsFunction):
3214 (KJS::DateProtoFuncSetUTCMonth::callAsFunction):
3215 (KJS::DateProtoFuncSetFullYear::callAsFunction):
3216 (KJS::DateProtoFuncSetUTCFullYear::callAsFunction):
3218 2008-01-06 Nikolas Zimmermann <zimmermann@kde.org>
3222 Add new helper function isArabicChar - SVG Fonts support needs it.
3224 * wtf/unicode/icu/UnicodeIcu.h:
3225 (WTF::Unicode::isArabicChar):
3226 * wtf/unicode/qt4/UnicodeQt4.h:
3227 (WTF::Unicode::isArabicChar):
3229 2008-01-06 Alp Toker <alp@atoker.com>
3231 Reviewed by Mark Rowe.
3233 Use $(EXEEXT) to account for the .exe extension in the GTK+ Windows
3234 build. (This is already done correctly in DerivedSources.make.) Issue
3235 noticed by Mikkel when building in Cygwin.
3237 Add a missing slash. This was a hack from the qmake build system that
3238 isn't necessary with autotools.
3242 2008-01-05 Darin Adler <darin@apple.com>
3244 * API/JSRetainPtr.h: One more file that needed the change below.
3246 2008-01-05 Darin Adler <darin@apple.com>
3248 * wtf/OwnPtr.h: OwnPtr needs the same fix as RefPtr below.
3250 2008-01-05 Adam Roben <aroben@apple.com>
3256 * wtf/RetainPtr.h: Use PtrType instead of T* because of the
3257 RemovePointer magic.
3259 2008-01-05 Darin Adler <darin@apple.com>
3261 Rubber stamped by Maciej Stachowiak.
3263 - cut down own PIC branches by using a pointer-to-member-data instead of a
3264 pointer-to-member-function in WTF smart pointers
3266 * wtf/OwnArrayPtr.h:
3271 Use a pointer to the m_ptr member instead of the get member.
3272 The GCC compiler generates better code for this idiom.
3274 2008-01-05 Henry Mason <hmason@mac.com>
3276 Reviewed by Maciej Stachowiak.
3278 http://bugs.webkit.org/show_bug.cgi?id=16738
3279 Bug 16738: Collector block offset could be stored as an cell offset instead of a byte offset
3281 Gives a 0.4% SunSpider boost and prettier code.
3283 * kjs/collector.cpp: Switched to cell offsets from byte offsets
3284 (KJS::Collector::heapAllocate):
3285 (KJS::Collector::sweep):
3287 2008-01-04 Mark Rowe <mrowe@apple.com>
3289 Reviewed by Maciej Stachowiak.
3291 Have the two malloc zones print useful diagnostics if their free method are unexpectedly invoked.
3292 Due to <rdar://problem/5671357> this can happen if an application attempts to free a pointer that
3293 was not allocated by any registered malloc zone on the system.
3295 * kjs/CollectorHeapIntrospector.h:
3296 * wtf/FastMalloc.cpp:
3298 2008-01-04 Alp Toker <alp@atoker.com>
3300 GTK+ autotools build fix. Terminate empty rules.
3304 2008-01-03 Simon Hausmann <hausmann@webkit.org>
3306 Reviewed by Mark Rowe.
3308 Fix compilation with gcc 4.3: limits.h is needed for INT_MAX.
3310 * pcre/pcre_exec.cpp:
3312 2008-01-03 Darin Adler <darin@apple.com>
3314 * tests/mozilla/expected.html: The fix for bug 16696 also fixed a test
3315 case, ecma_3/RegExp/perlstress-002.js, so updated results to expect
3316 that test to succeed.
3318 2008-01-02 Darin Adler <darin@apple.com>
3322 - fix http://bugs.webkit.org/show_bug.cgi?id=16696
3323 JSCRE fails fails to match Acid3 regexp
3325 Test: fast/regex/early-acid3-86.html
3327 The problem was with the cutoff point between backreferences and octal
3328 escape sequences. We need to determine the cutoff point by counting the
3329 total number of capturing brackets, which requires an extra pass through
3330 the expression when compiling it.
3332 * pcre/pcre_compile.cpp:
3333 (CompileData::CompileData): Added numCapturingBrackets. Removed some
3335 (compileBranch): Use numCapturingBrackets when calling checkEscape.
3336 (calculateCompiledPatternLength): Use numCapturingBrackets when calling
3337 checkEscape, and also store the bracket count at the end of the compile.
3338 (jsRegExpCompile): Call calculateCompiledPatternLength twice -- once to
3339 count the number of brackets and then a second time to calculate the length.
3341 2008-01-02 Darin Adler <darin@apple.com>
3345 - fix http://bugs.webkit.org/show_bug.cgi?id=16696
3346 JSCRE fails fails to match Acid3 regexp
3348 Test: fast/regex/early-acid3-86.html
3350 The problem was with the cutoff point between backreferences and octal
3351 escape sequences. We need to determine the cutoff point by counting the
3352 total number of capturing brackets, which requires an extra pass through
3353 the expression when compiling it.
3355 * pcre/pcre_compile.cpp:
3356 (CompileData::CompileData): Added numCapturingBrackets. Removed some
3358 (compileBranch): Use numCapturingBrackets when calling checkEscape.
3359 (calculateCompiledPatternLength): Use numCapturingBrackets when calling
3360 checkEscape, and also store the bracket count at the end of the compile.
3361 (jsRegExpCompile): Call calculateCompiledPatternLength twice -- once to
3362 count the number of brackets and then a second time to calculate the length.
3364 2008-01-02 David Kilzer <ddkilzer@webkit.org>
3366 Reviewed and landed by Darin.
3369 (KJS::DoWhileNode::execute): Added a missing return.
3371 2008-01-02 Darin Adler <darin@apple.com>
3373 - try to fix Qt build
3375 * wtf/unicode/qt4/UnicodeQt4.h:
3376 (WTF::Unicode::foldCase): Add some missing const.
3378 2008-01-02 Alice Liu <alice.liu@apple.com>
3380 Reviewed by Sam Weinig.
3382 need to export ASCIICType.h for use in DRT
3384 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
3386 (WTF::isASCIIUpper):
3388 2008-01-02 Sam Weinig <sam@webkit.org>
3390 Reviewed by Beth Dakin.
3392 Cleanup error_object.h/cpp.
3394 * kjs/JSGlobalObject.cpp:
3395 (KJS::JSGlobalObject::reset):
3396 * kjs/error_object.cpp:
3398 (KJS::ErrorInstance::ErrorInstance):
3399 (KJS::ErrorPrototype::ErrorPrototype):
3400 (KJS::ErrorProtoFuncToString::ErrorProtoFuncToString):
3401 (KJS::ErrorProtoFuncToString::callAsFunction):
3402 (KJS::ErrorObjectImp::ErrorObjectImp):
3403 (KJS::ErrorObjectImp::implementsConstruct):
3404 (KJS::ErrorObjectImp::construct):
3405 (KJS::ErrorObjectImp::callAsFunction):
3406 (KJS::NativeErrorPrototype::NativeErrorPrototype):
3407 (KJS::NativeErrorImp::NativeErrorImp):
3408 (KJS::NativeErrorImp::implementsConstruct):
3409 (KJS::NativeErrorImp::construct):
3410 (KJS::NativeErrorImp::callAsFunction):
3411 (KJS::NativeErrorImp::mark):
3412 * kjs/error_object.h:
3413 (KJS::ErrorInstance::classInfo):
3414 (KJS::NativeErrorImp::classInfo):
3416 2008-01-02 Mark Rowe <mrowe@apple.com>
3418 Rubber-stamped by Alp Toker.
3420 * GNUmakefile.am: Add missing dependency on grammar.y.
3422 2008-01-01 Darin Adler <darin@apple.com>
3426 - fix for http://bugs.webkit.org/show_bug.cgi?id=16695
3427 JSC allows non-identifier codepoints in identifiers (affects Acid3)
3429 Test: fast/js/kde/parse.html
3432 (KJS::Lexer::lex): Added additional states to distinguish Unicode escapes at the
3433 start of identifiers from ones inside identifiers. Rejected characters that don't pass
3434 the isIdentStart and isIdentPart tests.
3435 (KJS::Lexer::convertUnicode): Removed incorrect FIXME comment.
3437 * kjs/lexer.h: Added new states to distinguish \u escapes at the start of identifiers
3438 from \u escapes inside identifiers.
3440 2008-01-01 Darin Adler <darin@apple.com>
3442 - rolled scope chain optimization out; it was breaking the world
3444 2008-01-01 Darin Adler <darin@apple.com>
3448 - http://bugs.webkit.org/show_bug.cgi?id=16685
3449 eliminate List::empty() to cut down on PIC branches
3451 Also included one other speed-up -- remove the call to reserveCapacity from
3452 FunctionBodyNode::processDeclarations in all but the most unusual cases.
3454 Together these make SunSpider 1.016x as fast.
3456 * JavaScriptCore.exp: Updated.
3457 * kjs/ExecState.cpp:
3458 (KJS::globalEmptyList): Added. Called only when creating global ExecState
3460 (KJS::ExecState::ExecState): Broke constructor up into three separate functions,
3461 for the three separate node types. Also went through each of the three and
3462 streamlined as much as possible, removing dead code. This prevents us from having
3463 to access the global in the function body version of the constructor.
3465 * kjs/ExecState.h: Added emptyList(). Replaced the constructor with a set of
3466 three that are specific to the different node types that can create new execution
3469 * kjs/array_object.cpp:
3470 (KJS::ArrayProtoFuncToLocaleString::callAsFunction): Use exec->emptyList() instead
3472 (KJS::ArrayProtoFuncConcat::callAsFunction): Ditto.
3473 (KJS::ArrayProtoFuncSlice::callAsFunction): Ditto.
3474 (KJS::ArrayProtoFuncSplice::callAsFunction): Ditto.
3475 (KJS::ArrayProtoFuncFilter::callAsFunction): Ditto.
3477 (KJS::FunctionImp::callAsFunction): Updated to call new ExecState constructor.
3478 (KJS::GlobalFuncImp::callAsFunction): Ditto (for eval).
3479 * kjs/function_object.cpp:
3480 (FunctionObjectImp::construct): Use exec->emptyList() instead of List::empty().
3482 * kjs/list.cpp: Removed List::empty.
3483 * kjs/list.h: Ditto.
3486 (KJS::ElementNode::evaluate): Use exec->emptyList() instead of List::empty().
3487 (KJS::ArrayNode::evaluate): Ditto.
3488 (KJS::ObjectLiteralNode::evaluate): Ditto.
3489 (KJS::PropertyListNode::evaluate): Ditto.
3490 (KJS::FunctionBodyNode::processDeclarations): Another speed-up. Check the capacity
3491 before calling reserveCapacity, because it doesn't get inlined the local storage
3492 vector is almost always big enough -- saving the function call overhead is a big
3494 (KJS::FuncDeclNode::makeFunction): Use exec->emptyList() instead of List::empty().
3495 (KJS::FuncExprNode::evaluate): Ditto.
3497 (KJS::tryGetAndCallProperty): Ditto.
3498 * kjs/property_slot.cpp:
3499 (KJS::PropertySlot::functionGetter): Ditto.
3500 * kjs/string_object.cpp:
3501 (KJS::StringProtoFuncSplit::callAsFunction): Ditto.
3503 2008-01-01 Darin Adler <darin@apple.com>
3507 - fix http://bugs.webkit.org/show_bug.cgi?id=16648
3508 REGRESSION (r28165): Yuku.com navigation prints "jsRegExpExecute failed with result -2"
3509 <rdar://problem/5646486> REGRESSION (r28165): Layout test fast/regex/test1 fails intermittently
3511 Fixes 34 failing test cases in the fast/regex/test1.html test.
3513 Restored the stack which prevents infinite loops for brackets that match the empty
3514 string; it had been removed as an optimization.
3516 Unfortunately, restoring this stack causes the regular expression test in SunSpider
3517 to be 1.095x as slow and the overall test to be 1.004x as slow. Maybe we can find
3518 a correct optimization to restore the speed!
3520 It's possible the original change was on the right track but just off by one.
3522 * pcre/pcre_exec.cpp: Add back eptrblock, but name it BracketChainNode.
3523 (MatchStack::pushNewFrame): Add back the logic needed here.
3524 (startNewGroup): Ditto.
3527 2008-01-01 Darin Adler <darin@apple.com>
3531 - http://bugs.webkit.org/show_bug.cgi?id=16683
3532 speed up function calls by making ScopeChain::push cheaper
3534 This gives a 1.019x speedup on SunSpider.
3536 After doing this, I realized this probably will be obsolete when the optimization
3537 to avoid creating an activation object is done. When we do that one we should check
3538 if rolling this out will speed things up, since this does add overhead at the time
3539 you copy the scope chain.
3541 * kjs/object.h: Removed the ScopeChain::release function. It was
3542 marked inline, and called in exactly&nbs