1 2008-02-29 Brent Fulgham <bfulgham@gmail.com>
3 http://bugs.webkit.org/show_bug.cgi?id=17483
4 Implement scrollbars on Windows (Cairo)
6 Reviewed by Adam Roben.
10 2008-02-29 Adam Roben <aroben@apple.com>
12 Remove unused DebuggerImp::abort and DebuggerImp::aborted
14 Reviewed by Tim and Sam.
16 * kjs/function_object.cpp:
17 (KJS::FunctionObjectImp::construct):
19 (KJS::DebuggerImp::DebuggerImp):
21 (KJS::Node::handleException):
22 (KJS::FunctionBodyNodeWithDebuggerHooks::execute):
24 2008-02-28 Eric Christopher <echristo@apple.com>
26 Reviewed by Geoffrey Garen.
28 ** TOTAL **: 1.005x as fast 2867.6ms +/- 0.4% 2853.2ms +/- 0.3% significant
30 * kjs/nodes.cpp: Tell the compiler that exceptions are unexpected (for
31 the sake of branch prediction and code organization).
33 2008-02-27 Alexey Proskuryakov <ap@webkit.org>
35 Reviewed by Sam Weinig.
37 http://bugs.webkit.org/show_bug.cgi?id=17030
38 Small buffer overflow within initialization
40 * kjs/date_object.cpp:
41 (KJS::DateObjectFuncImp::callAsFunction):
43 Remove unnecessary and incorrect memset() calls - GregorianDateTime can initialize itself.
45 2008-02-25 Sam Weinig <sam@webkit.org>
47 Reviewed by Dan Bernstein.
49 - Add a variant of remove that takes a position and a length.
52 (WTF::Vector::remove):
54 2008-02-25 Mark Mentovai <mark@moxienet.com>
56 Reviewed by Mark Rowe.
58 Enable CollectorHeapIntrospector to build by itself, as well as in an AllInOneFile build.
59 http://bugs.webkit.org/show_bug.cgi?id=17538
61 * kjs/CollectorHeapIntrospector.cpp: Provide "using" declaration for
62 WTF::RemoteMemoryReader.
63 * kjs/collector.h: Move CollectorHeap declaration here...
64 * kjs/collector.cpp: ... from here.
66 2008-02-25 Darin Adler <darin@apple.com>
70 * JavaScriptCore.exp: Sort the contents of this file.
72 2008-02-25 Adam Roben <aroben@apple.com>
77 (functionQuit): Don't add a return statement after exit(0) for MSVC.
79 2008-02-24 Sam Weinig <sam@webkit.org>
81 Reviewed by Mark Rowe.
83 http://bugs.webkit.org/show_bug.cgi?id=17529
84 Add support for reading from stdin from testkjs
87 (GlobalObject::GlobalObject): Add readline function to global object.
88 (functionReadline): Added. Reads characters from stdin until a '\n' or
89 EOF is encountered. The input is returned as a String to the caller.
91 2008-02-24 Sam Weinig <sam@webkit.org>
93 Reviewed by Mark Rowe.
95 http://bugs.webkit.org/show_bug.cgi?id=17528
99 * JavaScriptCore.xcodeproj/project.pbxproj: Make the testkjs.cpp use 4 space indentation.
101 (StopWatch::getElapsedMS):
102 (GlobalObject::className):
103 (GlobalObject::GlobalObject):
104 Rename GlobalImp to GlobalObject and setup the global functions
105 in the GlobalObject's constructor. Also, use static functions for
106 the implementation so we can use the standard PrototypeFunction
107 class and remove TestFunctionImp.
108 (functionPrint): Move print() functionality here.
109 (functionDebug): Move debug() functionality here.
110 (functionGC): Move gc() functionality here.
111 (functionVersion): Move version() functionality here.
112 (functionRun): Move run() functionality here.
113 (functionLoad): Move load() functionality here.
114 (functionQuit): Move quit() functionality here.
115 (prettyPrintScript): Fix indentation.
116 (runWithScripts): Since all the functionality of createGlobalObject is
117 now in the GlobalObject constructor, just call new here.
118 (parseArguments): Fix indentation.
120 (fillBufferWithContentsOfFile): Ditto.
122 2008-02-24 Sam Weinig <sam@webkit.org>
124 Reviewed by Oliver Hunt and Mark Rowe.
126 http://bugs.webkit.org/show_bug.cgi?id=17505
127 Add support for getting command line arguments in testkjs
129 - This slightly changes the behavior of parsing arguments by requiring
130 a '-f' before all files.
133 (createGlobalObject): Add a global property called 'arguments' which
134 contains an array with the parsed arguments as strings.
135 (runWithScripts): Pass in the arguments vector so that it can be passed
136 to the global object.
137 (parseArguments): Change parsing rules to require a '-f' before any script
138 file. After all '-f' and '-p' arguments have been parsed, the remaining
139 are added to the arguments vector and exposed to the script. If there is a
140 chance of ambiguity (the user wants to pass the string '-f' to the script),
141 the string '--' can be used separate the options from the pass through
145 2008-02-24 Dan Bernstein <mitz@apple.com>
147 Reviewed by Darin Adler.
149 - fix http://bugs.webkit.org/show_bug.cgi?id=17511
150 REGRESSION: Reproducible crash in SegmentedSubstring::SegmentedSubstring(SegmentedSubstring const&)
153 (WTF::::expandCapacityIfNeeded): Fixed the case where m_start and m_end
154 are both zero but the buffer capacity is non-zero.
155 (WTF::::prepend): Added validity checks.
157 2008-02-23 Jan Michael Alonzo <jmalonzo@unpluggable.com>
159 Rubber stamped by Darin.
161 Add separator '\' after libJavaScriptCore_la_LIBADD and cleanup
162 whitespaces introduced in the previous commit.
166 2008-02-23 Jan Michael Alonzo <jmalonzo@unpluggable.com>
168 * GNUmakefile.am: Add GLOBALDEPS for testkjs and minidom.
170 2008-02-23 Darin Adler <darin@apple.com>
174 - http://bugs.webkit.org/show_bug.cgi?id=17496
175 make Deque use a circular array; add iterators
177 * wtf/Deque.h: Wrote an all-new version of this class that uses a circular
178 buffer. Growth policy is identical to vector. Added iterators.
180 * wtf/Vector.h: Made two small refinements while using this to implement
181 Deque: Made VectorBufferBase derive from Noncopyable, which would have
182 saved me some debugging time if it had been there. Renamed Impl and
183 m_impl to Buffer and m_buffer.
185 2008-02-23 Darin Adler <darin@apple.com>
189 - http://bugs.webkit.org/show_bug.cgi?id=17067
190 eliminate attributes parameter from JSObject::put for speed/clarity
192 * API/JSCallbackObject.h: Removed attribute arguments.
193 * API/JSCallbackObjectFunctions.h:
194 (KJS::JSCallbackObject<Base>::put): Ditto.
195 * API/JSObjectRef.cpp:
196 (JSObjectSetProperty): Use initializeVariable or putDirect when necessary
197 to set attribute values.
198 * JavaScriptCore.exp: Updated.
199 * bindings/objc/objc_runtime.h: Removed attribute arguments.
200 * bindings/objc/objc_runtime.mm:
201 (ObjcFallbackObjectImp::put): Ditto.
202 * bindings/runtime_array.cpp:
203 (RuntimeArray::put): Ditto.
204 * bindings/runtime_array.h: Ditto.
205 * bindings/runtime_object.cpp:
206 (RuntimeObjectImp::put): Ditto.
207 * bindings/runtime_object.h: Ditto. Also removed canPut which was only
208 called from one place in WebCore that can use hasProperty instead.
210 * kjs/Activation.h: Removed attribute argument from put and added the new
211 initializeVariable function that's used to put variables in variable objects.
212 Also made isActivationObject a const member.
214 * kjs/JSGlobalObject.cpp:
215 (KJS::JSGlobalObject::put): Removed attribute argument.
216 (KJS::JSGlobalObject::initializeVariable): Added. Used to give variables
217 their initial values, which can include the read-only property.
218 (KJS::JSGlobalObject::reset): Removed obsolete comments about flags.
219 Removed Internal flag, which is no longer needed.
220 * kjs/JSGlobalObject.h: More of the same.
222 * kjs/JSVariableObject.h: Added pure virtual initializeVariable function.
223 (KJS::JSVariableObject::symbolTablePut): Removed checkReadOnly flag; we always
225 (KJS::JSVariableObject::symbolTableInitializeVariable): Added.
227 * kjs/array_instance.cpp:
228 (KJS::ArrayInstance::put): Removed attribute argument.
229 * kjs/array_instance.h: Ditto.
232 (KJS::FunctionImp::put): Ditto.
233 (KJS::Arguments::put): Ditto.
234 (KJS::ActivationImp::put): Ditto.
235 (KJS::ActivationImp::initializeVariable): Added.
236 * kjs/function.h: Removed attribute arguments.
238 * kjs/function_object.cpp:
239 (KJS::FunctionObjectImp::construct): Removed Internal flag.
242 (KJS::lookupPut): Removed attributes argument. Also changed to use putDirect
243 instead of calling JSObject::put.
244 (KJS::cacheGlobalObject): Ditto.
247 (KJS::ConstDeclNode::handleSlowCase): Call initializeVariable to initialize
249 (KJS::ConstDeclNode::evaluateSingle): Ditto.
250 (KJS::TryNode::execute): Use putDirect to set up the new object.
251 (KJS::FunctionBodyNode::processDeclarations): Removed Internal.
252 (KJS::ProgramNode::processDeclarations): Ditto.
253 (KJS::EvalNode::processDeclarations): Call initializeVariable to initialize
254 the variables and functions.
255 (KJS::FuncDeclNode::makeFunction): Removed Internal.
256 (KJS::FuncExprNode::evaluate): Ditto.
258 * kjs/object.cpp: Removed canPut, which was only being used in one code path,
259 not the normal high speed one.
260 (KJS::JSObject::put): Removed attribute argument. Moved the logic from
261 canPut here, in the one code ath that was still using it.
262 * kjs/object.h: Removed Internal attribute, ad canPut function. Removed the
263 attributes argument to the put function. Made isActivationObject const.
265 * kjs/regexp_object.cpp:
266 (KJS::RegExpImp::put): Removed attributes argument.
267 (KJS::RegExpImp::putValueProperty): Ditto.
268 (KJS::RegExpObjectImp::put): Ditto.
269 (KJS::RegExpObjectImp::putValueProperty): Ditto.
270 * kjs/regexp_object.h: Ditto.
272 * kjs/string_object.cpp:
273 (KJS::StringInstance::put): Removed attributes argument.
274 * kjs/string_object.h: Ditto.
276 2008-02-23 Jan Michael Alonzo <jmalonzo@unpluggable.com>
278 Not reviewed, Gtk build fix.
282 2008-02-23 Alexey Proskuryakov <ap@webkit.org>
284 Windows build fix - move ThreadCondition implementation from WebCore to WTF.
286 * wtf/ThreadingWin.cpp:
287 (WTF::ThreadCondition::ThreadCondition):
288 (WTF::ThreadCondition::~ThreadCondition):
289 (WTF::ThreadCondition::wait):
290 (WTF::ThreadCondition::signal):
291 (WTF::ThreadCondition::broadcast):
293 2008-02-23 Alexey Proskuryakov <ap@webkit.org>
295 Touch some files, hoping that Windows build bot will create JSC headers.
297 * kjs/AllInOneFile.cpp:
298 * kjs/array_instance.cpp:
301 2008-02-23 Alexey Proskuryakov <ap@webkit.org>
303 Qt/Wx build fix - this file was still in a wrong namespace, too.
305 * wtf/ThreadingNone.cpp:
307 2008-02-23 Alexey Proskuryakov <ap@webkit.org>
309 More build fixing - fix mismatched braces.
311 * JavaScriptCore.pri:
313 2008-02-23 Alexey Proskuryakov <ap@webkit.org>
315 Wx and Gtk build fixes.
317 * JavaScriptCore.pri: Don't try to compile ThreadingPthreads.
318 * wtf/ThreadingGtk.cpp: Use a correct namespace.
320 2008-02-23 Alexey Proskuryakov <ap@webkit.org>
324 Move basic threading support from WebCore to WTF.
326 Added mutex protection to MessageQueue::killed() for paranoia sake.
329 * JavaScriptCore.exp:
330 * JavaScriptCore.pri:
331 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
332 * JavaScriptCore.xcodeproj/project.pbxproj:
333 * JavaScriptCoreSources.bkl:
334 * wtf/Locker.h: Copied from WebCore/platform/Locker.h.
335 * wtf/MessageQueue.h: Copied from WebCore/platform/MessageQueue.h.
337 * wtf/Threading.h: Copied from WebCore/platform/Threading.h.
338 * wtf/ThreadingGtk.cpp: Copied from WebCore/platform/gtk/ThreadingGtk.cpp.
339 (WebCore::createThread):
340 * wtf/ThreadingNone.cpp: Copied from WebCore/platform/ThreadingNone.cpp.
341 * wtf/ThreadingPthreads.cpp: Copied from WebCore/platform/pthreads/ThreadingPthreads.cpp.
343 * wtf/ThreadingWin.cpp: Copied from WebCore/platform/win/ThreadingWin.cpp.
346 (WTF::Mutex::~Mutex):
348 (WTF::Mutex::tryLock):
349 (WTF::Mutex::unlock):
351 2008-02-22 Geoffrey Garen <ggaren@apple.com>
353 Reviewed by Sam Weinig.
355 Partial fix for <rdar://problem/5744037> Gmail out of memory (17455)
357 I'm removing KJS_MEM_LIMIT for the following reasons:
359 - We have a few reports of KJS_MEM_LIMIT breaking important web
360 applications, like GMail and Google Reader. (For example, if you
361 simply open 12 GMail tabs, tab #12 will hit the limit.)
363 - Firefox has no discernable JS object count limit, so any limit, even
364 a large one, is a potential compatibility problem.
366 - KJS_MEM_LIMIT does not protect against malicious memory allocation,
367 since there are many ways to maliciously allocate memory without
368 increasing the JS object count.
370 - KJS_MEM_LIMIT is already mostly broken, since it only aborts the
371 script that breaches the limit, not any subsequent scripts.
373 - We've never gotten bug reports about websites that would have
374 benefited from an unbroken KJS_MEM_LIMIT. The initial check-in of
375 KJS_MEM_LIMIT (KJS revision 80061) doesn't mention a website that
378 - Any website that brings you anywhere close to crashing due to the
379 number of live JS objects will almost certainly put up the "slow
380 script" dialog at least 20 times beforehand.
383 (KJS::Collector::collect):
386 (KJS::TryNode::execute):
388 2008-02-22 Oliver Hunt <oliver@apple.com>
390 Reviewed by Alexey P.
392 <rdar://problem/5759327> REGRESSION: while(NaN) acts like while(true)
394 Fix yet another case where we incorrectly relied on implicit double
398 (KJS::PostDecLocalVarNode::evaluateToBoolean):
400 2008-02-20 Michael Knaup <michael.knaup@mac.com>
404 Fix for Bug 16753: date set methods with no args should result in NaN (Acid3 bug)
405 The set values result in NaN now when called with no args, NaN or +/- inf values.
406 The setYear, setFullYear and setUTCFullYear methods used on NaN dates work as
407 descripted in the standard.
409 * kjs/date_object.cpp:
410 (KJS::fillStructuresUsingTimeArgs):
411 (KJS::fillStructuresUsingDateArgs):
412 (KJS::setNewValueFromTimeArgs):
413 (KJS::setNewValueFromDateArgs):
414 (KJS::dateProtoFuncSetYear):
416 2008-02-19 Anders Carlsson <andersca@apple.com>
420 Change OpaqueJSClass and RootObject to start with a ref count of 1.
422 * API/JSClassRef.cpp:
423 (OpaqueJSClass::OpaqueJSClass):
424 (OpaqueJSClass::createNoAutomaticPrototype):
425 (OpaqueJSClass::create):
427 * API/JSObjectRef.cpp:
429 * bindings/runtime_root.cpp:
430 (KJS::Bindings::RootObject::create):
431 (KJS::Bindings::RootObject::RootObject):
433 2008-02-19 Darin Adler <darin@apple.com>
435 Rubber stamped by Anders.
437 - removed explicit initialization to 1 for RefCounted; that's now the default
440 (KJS::RegExp::RegExp): Removed RefCounted initializer.
442 2008-02-19 Darin Adler <darin@apple.com>
446 - next step for http://bugs.webkit.org/show_bug.cgi?id=17257
447 start ref counts at 1 instead of 0 for speed
450 (WTF::RefCounted::RefCounted): Have refcounts default to 1. This allows us to start
451 removing the explicit initialization of RefCounted from classes and eventually we
452 can remove the ability to have the initial count of 0 entirely.
454 2008-02-18 Samuel Weinig <sam@webkit.org>
456 Reviewed by Geoff Garen.
458 Fix for http://bugs.webkit.org/show_bug.cgi?id=17419
459 Remove CompatMode from JavaScriptCore as it is never set to anything other than NativeMode
461 * kjs/JSGlobalObject.cpp:
462 (KJS::JSGlobalObject::init):
463 * kjs/JSGlobalObject.h:
464 (KJS::JSGlobalObject::setDebugger):
465 * kjs/date_object.cpp:
466 (KJS::dateProtoFuncGetYear):
468 2008-02-18 Darin Adler <darin@apple.com>
473 (WTF::toASCIIHexValue): Added.
475 2008-02-17 Darin Adler <darin@apple.com>
477 * wtf/ListHashSet.h: (WTF::swap): Removed stray return statement.
479 2008-02-15 Adam Roben <aroben@apple.com>
481 Make JavaScriptCore's FEATURE_DEFINES match WebCore's
485 * Configurations/JavaScriptCore.xcconfig:
487 2008-02-14 Stephanie Lewis <slewis@apple.com>
493 * JavaScriptCore.order:
495 2008-02-14 Geoffrey Garen <ggaren@apple.com>
497 Reviewed by Sam Weinig.
499 Fixed <rdar://problem/5737835> nee http://bugs.webkit.org/show_bug.cgi?id=17329
500 Crash in JSGlobalObject::popActivation when inserting hyperlink in Wordpress (17329)
502 Don't reset the "activations" stack in JSGlobalObject::reset, since we
503 might be executing a script during the call to reset, and the script
504 needs to safely run to completion.
506 Instead, initialize the "activations" stack when the global object is
507 created, and subsequently rely on pushing and popping during normal
508 execution to maintain the stack's state.
510 * kjs/JSGlobalObject.cpp:
511 (KJS::JSGlobalObject::init):
512 (KJS::JSGlobalObject::reset):
514 2008-02-13 Bernhard Rosenkraenzer <bero@arklinux.org>
518 - http://bugs.webkit.org/show_bug.cgi?id=17339
519 JavaScriptCore does not build with gcc 4.3
521 * kjs/interpreter.cpp: Add include of <unistd.h>, since that's where
524 2008-02-13 Oliver Hunt <oliver@apple.com>
526 Reviewed by Alexey P.
528 <rdar://problem/5737003> REGRESSION (r27747): can't browse pictures on fastcupid.com
530 When converting numeric values to booleans we need to account for NaN
533 (KJS::MultNode::evaluateToBoolean):
534 (KJS::ModNode::evaluateToBoolean):
536 2008-02-08 Samuel Weinig <sam@webkit.org>
538 Reviewed by Brady Eidson.
540 <rdar://problem/5659216> REGRESSION: PLT 0.3% slower due to r28868 (caching ClassNodeList and NamedNodeList)
542 - Tweak the statements in isASCIISpace to account for the statistical distribution of
545 .4% speedup on my machine. Stephanie's machine shows this as .3% speedup.
550 2008-02-11 Sam Weinig <sam@webkit.org>
552 Reviewed by Anders Carlsson.
555 <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
556 <rdar://problem/5735443> Crash when setting the Window objects prototype to a custom Object and then calling a method on it
558 - Expose the native Object.prototype.toString implementation so that it can be used for cross-domain
561 * JavaScriptCore.exp:
562 * kjs/object_object.cpp:
563 * kjs/object_object.h:
565 2008-02-10 Darin Adler <darin@apple.com>
567 Rubber stamped by Eric.
570 (KJS::ExecState::takeException): Added.
572 2008-02-10 Darin Adler <darin@apple.com>
576 - http://bugs.webkit.org/show_bug.cgi?id=17256
577 eliminate default ref. count of 0 in RefCounted class
580 (WTF::RefCounted::RefCounted): Remove default of 0.
582 2008-02-10 Darin Adler <darin@apple.com>
586 - http://bugs.webkit.org/show_bug.cgi?id=17256
587 Make clients of RefCounted explicitly set the count to 0.
589 * API/JSClassRef.cpp:
590 (OpaqueJSClass::OpaqueJSClass):
591 * bindings/runtime_root.cpp:
592 (KJS::Bindings::RootObject::RootObject):
594 2008-02-09 Darin Adler <darin@apple.com>
598 - http://bugs.webkit.org/show_bug.cgi?id=17256
599 Change RegExp to start its ref count at 1, not 0
601 We'll want to do this to every RefCounted class, one at a time.
604 (KJS::RegExpNode::RegExpNode): Use RegExp::create instead of new RegExp.
606 (KJS::RegExp::RegExp): Marked inline, set initial ref count to 1.
607 (KJS::RegExp::create): Added. Calls new RegExp then adopts the initial ref.
608 * kjs/regexp.h: Reformatted. Made the constructors private. Added static
609 create functions that return objects already wrapped in PassRefPtr.
610 * kjs/regexp_object.cpp:
611 (KJS::regExpProtoFuncCompile): Use RegExp::create instead of new RegExp.
612 (KJS::RegExpObjectImp::construct): Ditto.
613 * kjs/string_object.cpp:
614 (KJS::stringProtoFuncMatch): Ditto.
615 (KJS::stringProtoFuncSearch): Ditto.
617 2008-02-08 Oliver Hunt <oliver@apple.com>
621 <rdar://problem/5731773> REGRESSION (r28973): Extraneous parentheses in function.toString()
622 https://bugs.webkit.org/show_bug.cgi?id=17214
624 Make a subclass of CommaNode to provide the correct precedence for each expression in
625 a variable declaration list.
629 (KJS::VarDeclCommaNode::):
631 2008-02-08 Darin Adler <darin@apple.com>
635 - fix http://bugs.webkit.org/show_bug.cgi?id=17247
636 Labelled continue/break can fail in some cases
638 Test: fast/js/continue-break-multiple-labels.html
641 (KJS::StatementNode::pushLabel): Made this virtual.
642 (KJS::LabelNode::pushLabel): Forward pushLabel calls to the statement inside.
644 2008-02-08 Darin Adler <darin@apple.com>
648 - fix http://bugs.webkit.org/show_bug.cgi?id=15003
649 Function.prototype.constructor should not be DontDelete/ReadOnly (Acid3 bug)
651 Test: fast/js/constructor-attributes.html
653 * kjs/JSGlobalObject.cpp:
654 (KJS::JSGlobalObject::reset): Remove unwanted attributes from "constructor".
655 * kjs/function_object.cpp:
656 (KJS::FunctionObjectImp::construct): Ditto.
658 (KJS::FuncDeclNode::makeFunction): Ditto.
659 (KJS::FuncExprNode::evaluate): Ditto.
661 2008-02-06 Geoffrey Garen <ggaren@apple.com>
663 Reviewed by Oliver Hunt.
665 Added an ASSERT to catch refCount underflow, since it caused a leak in
669 (WTF::RefCounted::deref):
671 2008-02-06 Geoffrey Garen <ggaren@apple.com>
673 Reviewed by Darin Adler.
675 PLT speedup related to <rdar://problem/5659272> REGRESSION: PLT .4%
676 slower due to r28884 (global variable symbol table optimization)
678 Tweaked RefCounted::deref() to be a little more efficient.
680 1% - 1.5% speedup on my machine. .7% speedup on Stephanie's machine.
683 (WTF::RefCounted::deref): Don't modify m_refCount if we're just going
684 to delete the object anyway. Also, use a simple == test, which might be
685 faster than <= on some hardware.
687 2008-02-06 Darin Adler <darin@apple.com>
691 - fix http://bugs.webkit.org/show_bug.cgi?id=17094
692 Array.prototype functions create length properties with DontEnum/DontDelete
694 Test results match Gecko with very few obscure exceptions that seem to be
697 Test: fast/js/array-functions-non-arrays.html
699 * kjs/array_object.cpp:
700 (KJS::arrayProtoFuncConcat): Removed DontEnum and DontDelete from the call
702 (KJS::arrayProtoFuncPop): Ditto. Also added missing call to deleteProperty,
703 which is not needed for real arrays, but is needed for non-arrays.
704 (KJS::arrayProtoFuncPush): Ditto.
705 (KJS::arrayProtoFuncShift): Ditto.
706 (KJS::arrayProtoFuncSlice): Ditto.
707 (KJS::arrayProtoFuncSort): Removed incorrect call to set length when
708 the array has no elements.
709 (KJS::arrayProtoFuncSplice): Removed DontEnum and DontDelete from the call
711 (KJS::arrayProtoFuncUnShift): Ditto. Also added a check for 0 arguments to
712 make behavior match the specification in that case.
714 (KJS::ArrayNode::evaluate): Removed DontEnum and DontDelete from the call
717 2008-02-06 Darin Adler <darin@apple.com>
721 - replace calls to put to set up properties with calls to putDirect, to
722 prepare for a future change where put won't take attributes any more,
723 and for a slight performance boost
725 * API/JSObjectRef.cpp:
726 (JSObjectMakeConstructor): Use putDirect instead of put.
727 * kjs/CommonIdentifiers.h: Removed lastIndex.
728 * kjs/JSGlobalObject.cpp:
729 (KJS::JSGlobalObject::reset): Use putDirect instead of put.
730 * kjs/array_object.cpp:
731 (KJS::arrayProtoFuncConcat): Took out extra call to get length (unused).
732 (KJS::ArrayObjectImp::ArrayObjectImp): Use putDirect instead of put.
733 * kjs/error_object.cpp:
734 (KJS::ErrorPrototype::ErrorPrototype): Use putDirect instead of put.
736 (KJS::Arguments::Arguments): Use putDirect instead of put.
737 (KJS::PrototypeFunction::PrototypeFunction): Use putDirect instead of put.
738 * kjs/function_object.cpp:
739 (KJS::FunctionObjectImp::construct): Use putDirect instead of put.
741 (KJS::FuncDeclNode::makeFunction): Use putDirect instead of put.
742 (KJS::FuncExprNode::evaluate): Use putDirect instead of put.
743 * kjs/regexp_object.cpp:
744 (KJS::regExpProtoFuncCompile): Use setLastIndex instead of put(lastIndex).
745 (KJS::RegExpImp::match): Get and set lastIndex by using m_lastIndex instead of
747 * kjs/regexp_object.h:
748 (KJS::RegExpImp::setLastIndex): Added.
749 * kjs/string_object.cpp:
750 (KJS::stringProtoFuncMatch): Use setLastIndex instead of put(lastIndex).
752 2008-02-05 Sam Weinig <sam@webkit.org>
754 Reviewed by Anders Carlsson.
756 Fix for http://bugs.webkit.org/show_bug.cgi?id=8080
757 NodeList (and other DOM lists) items are not enumeratable using for..in
759 * JavaScriptCore.exp:
761 2008-02-05 Mark Rowe <mrowe@apple.com>
763 Reviewed by Oliver Hunt.
765 Update versioning to support the mysterious future.
767 * Configurations/Version.xcconfig: Add SYSTEM_VERSION_PREFIX_1060.
769 2008-02-04 Cameron Zwarich <cwzwarich@uwaterloo.ca>
771 Reviewed by Oliver Hunt.
773 Fixes Bug 16889: REGRESSION (r29425): Canvas-based graphing calculator fails to run
774 Bug 17015: REGRESSION (r29414-29428): www.fox.com "shows" menu fails to render
775 Bug 17164: REGRESSION: JavaScript pop-up menu appears at wrong location when hovering image at http://news.chinatimes.com/
777 <http://bugs.webkit.org/show_bug.cgi?id=16889>
778 <rdar://problem/5696255>
780 <http://bugs.webkit.org/show_bug.cgi?id=17015>
782 <http://bugs.webkit.org/show_bug.cgi?id=17164>
783 <rdar://problem/5720947>
785 The ActivationImp tear-off (r29425) introduced a problem with ReadModify
786 nodes that first resolve a slot, call valueForReadModifyNode(), and then
787 store a value in the previously resolved slot. Since valueForReadModifyNode()
788 may cause a tear-off, the slot needs to be resolved again, but this was
789 not happening with the existing code.
792 (KJS::ReadModifyLocalVarNode::evaluate):
793 (KJS::ReadModifyResolveNode::evaluate):
795 2008-02-04 Cameron McCormack <cam@mcc.id.au>
797 Reviewed by Geoff Garen.
799 Remove some unneccesary UNUSED_PARAMs. Clarify ownership rule of return value of JSObjectCopyPropertyNames.
802 (JSNode_appendChild):
803 (JSNode_removeChild):
804 (JSNode_replaceChild):
805 (JSNode_getNodeType):
806 (JSNode_getFirstChild):
811 2008-02-04 Rodney Dawes <dobey@wayofthemonkey.com>
813 Reviewed by Alp Toker and Mark Rowe.
815 Fix http://bugs.webkit.org/show_bug.cgi?id=17175.
816 Bug 17175: Use of C++ compiler flags in CFLAGS
818 * GNUmakefile.am: Use global_cxxflags as well as global_cflags in CXXFLAGS.
820 2008-02-04 Alp Toker <alp@atoker.com>
822 Rubber-stamped by Mark Rowe.
824 Remove all trailing whitespace in the GTK+ port and related
829 2008-02-02 Darin Adler <darin@apple.com>
831 Reviewed by Geoff Garen.
833 PLT speedup related to <rdar://problem/5659272> REGRESSION: PLT .4%
834 slower due to r28884 (global variable symbol table optimization)
836 Geoff's theory is that the slowdown was due to copying hash tables when
837 putting things into the back/forward cache. If that's true, then this
838 should fix the problem.
840 (According to Geoff's measurements, in a PLT that exaggerates the
841 importance of symbol table saving during cached page creation, this
842 patch is a ~3X speedup in cached page creation, and a 9% speedup overall.)
844 * JavaScriptCore.exp: Updated.
846 * kjs/JSVariableObject.cpp:
847 (KJS::JSVariableObject::saveLocalStorage): Updated for changes to SavedProperty,
848 which has been revised to avoid initializing each SavedProperty twice when building
849 the array. Store the property names too, so we don't have to store the symbol table
850 separately. Do this by iterating the symbol table instead of the local storage vector.
851 (KJS::JSVariableObject::restoreLocalStorage): Ditto. Restore the symbol table as
852 well as the local storage vector.
854 * kjs/JSVariableObject.h: Removed save/restoreSymbolTable and do that work inside
855 save/restoreLocalStorage instead. Made restoreLocalStorage a non-const member function
856 that takes a const reference to a SavedProperties object.
858 * kjs/LocalStorage.h: Changed attributes to be unsigned instead of int to match
859 other declarations of attributes elsewhere.
861 * kjs/property_map.cpp:
862 (KJS::SavedProperties::SavedProperties): Updated for data member name change.
863 (KJS::PropertyMap::save): Updated for data member name change and to use the new
864 inline init function instead of setting the fields directly. This allows us to
865 skip initializing the SavedProperty objects when first allocating the array, and
866 just do it when we're actually setting up the individual elements.
867 (KJS::PropertyMap::restore): Updated for SavedProperty changes.
869 * kjs/property_map.h: Changed SavedProperty from a struct to a class. Set it up so
870 it does not get initialized at construction time to avoid initializing twice when
871 creating an array of SavedProperty. Removed the m_ prefixes from the members of
872 the SavedProperties struct. Generally we use m_ for class members and not struct.
874 2008-02-02 Tony Chang <idealisms@gmail.com>
876 Reviewed by darin. Landed by eseidel.
878 Add #define guards for WIN32_LEAN_AND_MEAN and _CRT_RAND_S.
881 * wtf/FastMalloc.cpp:
884 2008-01-28 Sam Weinig <sam@webkit.org>
886 Rubber-stamped by Darin Adler.
888 - Fix whitespace in nodes.h/cpp and nodes2string.cpp.
890 (NOTE: Specific changed functions elided for space and clarity)
893 * kjs/nodes2string.cpp:
895 2008-01-27 Sam Weinig <sam@webkit.org>
897 Reviewed by Oliver Hunt.
899 Patch for http://bugs.webkit.org/show_bug.cgi?id=17025
900 nodes.h/cpp has been rolling around in the mud - lets hose it down
902 - Rename member variables to use the m_ prefix.
904 (NOTE: Specific changed functions elided for space and clarity)
908 * kjs/nodes2string.cpp:
910 2008-01-27 Darin Adler <darin@apple.com>
914 - fix <rdar://problem/5657450> REGRESSION: const is broken
916 Test: fast/js/const.html
918 SunSpider said this was 0.3% slower. And I saw some Shark samples in
919 JSGlobalObject::put -- not a lot but a few. We may be able to regain the
920 speed, but for now we will take that small hit for correctness sake.
922 * kjs/JSGlobalObject.cpp:
923 (KJS::JSGlobalObject::put): Pass the checkReadOnly flag in to symbolTablePut
924 instead of passing attributes.
926 * kjs/JSVariableObject.h:
927 (KJS::JSVariableObject::symbolTablePut): Removed the code to set attributes
928 here, since we only set attributes when creating a property. Added the code
929 to check read-only here, since we need that to implement const!
932 (KJS::ActivationImp::put): Pass the checkReadOnly flag in to symbolTablePut
933 instead of passing attributes.
936 (KJS::isConstant): Added.
937 (KJS::PostIncResolveNode::optimizeVariableAccess): Create a PostIncConstNode
938 if optimizing for a local variable and the variable is constant.
939 (KJS::PostDecResolveNode::optimizeVariableAccess): Ditto. But PostDecConstNode.
940 (KJS::PreIncResolveNode::optimizeVariableAccess): Ditto. But PreIncConstNode.
941 (KJS::PreDecResolveNode::optimizeVariableAccess): Ditto. But PreDecConstNode.
942 (KJS::PreIncConstNode::evaluate): Return the value + 1.
943 (KJS::PreDecConstNode::evaluate): Return the value - 1.
944 (KJS::PostIncConstNode::evaluate): Return the value converted to a number.
945 (KJS::PostDecConstNode::evaluate): Ditto.
946 (KJS::ReadModifyResolveNode::optimizeVariableAccess): Create a ReadModifyConstNode
947 if optimizing for a local variable and the variable is constant.
948 (KJS::AssignResolveNode::optimizeVariableAccess): Ditto. But AssignConstNode.
949 (KJS::ScopeNode::optimizeVariableAccess): Pass the local storage to the
950 node optimizeVariableAccess functions, since that's where we need to look to
951 figure out if a variable is constant.
952 (KJS::FunctionBodyNode::processDeclarations): Moved the call to
953 optimizeVariableAccess until after localStorage is set up.
954 (KJS::ProgramNode::processDeclarations): Ditto.
956 * kjs/nodes.h: Fixed the IsConstant and HasInitializer values. They are used
957 as flag masks, so a value of 0 will not work for IsConstant. Changed the
958 first parameter to optimizeVariableAccess to be a const reference to a symbol
959 table and added a const reference to local storage. Added classes for const
960 versions of local variable access: PostIncConstNode, PostDecConstNode,
961 PreIncConstNode, PreDecConstNode, ReadModifyConstNode, and AssignConstNode.
964 (KJS::JSObject::put): Tweaked comments a bit, and changed the checkReadOnly
965 expression to match the form used at the two other call sites.
967 2008-01-27 Darin Adler <darin@apple.com>
971 - fix http://bugs.webkit.org/show_bug.cgi?id=16498
972 ''.constructor.toString() gives [function]
974 Test: fast/js/function-names.html
976 * kjs/array_object.cpp:
977 (KJS::ArrayObjectImp::ArrayObjectImp): Use the class name as the constructor's function name.
978 * kjs/bool_object.cpp:
979 (KJS::BooleanObjectImp::BooleanObjectImp): Ditto.
980 * kjs/date_object.cpp:
981 (KJS::DateObjectImp::DateObjectImp): Ditto.
982 * kjs/error_object.cpp:
983 (KJS::ErrorPrototype::ErrorPrototype): Make the error object be an Error.
984 (KJS::ErrorObjectImp::ErrorObjectImp): Use the class name as the constructor's function name.
985 (KJS::NativeErrorPrototype::NativeErrorPrototype): Take const UString&.
986 (KJS::NativeErrorImp::NativeErrorImp): Use the prototype's name as the constructor's function
988 * kjs/error_object.h: Change ErrorPrototype to inherit from ErrorInstance. Change the
989 NativeErrorImp constructor to take a NativeErrorPrototype pointer for its prototype.
990 * kjs/function.h: Removed unneeded constructor for internal functions without names.
991 We want to avoid those!
992 * kjs/function_object.cpp:
993 (KJS::functionProtoFuncToString): Removed code that writes out just [function] for functions
994 that have no names. There's no reason to do that.
995 (KJS::FunctionObjectImp::FunctionObjectImp): Use the class name as the constructor's
997 * kjs/internal.cpp: Removed the unused constructor.
998 * kjs/number_object.cpp:
999 (KJS::fractionalPartToString): Marked static for internal linkage.
1000 (KJS::exponentialPartToString): Ditto.
1001 (KJS::numberProtoFuncToPrecision): Removed an unneeded else.
1002 (KJS::NumberObjectImp::NumberObjectImp): Use the class name as the constructor's
1004 (KJS::NumberObjectImp::getValueProperty): Tweaked formatting.
1005 * kjs/object_object.cpp:
1006 (KJS::ObjectObjectImp::ObjectObjectImp): Use "Object" for the function name.
1007 * kjs/regexp_object.cpp:
1008 (KJS::RegExpObjectImp::RegExpObjectImp): Use "RegExp" for the function name.
1009 * kjs/string_object.cpp:
1010 (KJS::StringObjectImp::StringObjectImp): Use the class name as the constructor's
1013 2008-01-26 Darin Adler <darin@apple.com>
1017 - fix http://bugs.webkit.org/show_bug.cgi?id=17027
1018 Incorrect Function.toString behaviour with read/modify/write operators performed on negative numbers
1020 Test: fast/js/function-toString-parentheses.html
1022 The problem here was that a NumberNode with a negative number in it had the wrong
1023 precedence. It's not a primary expression, it's a unary operator with a primary
1024 expression after it.
1026 Once the precedence of NumberNode was fixed, the cases from bug 17020 were also
1027 fixed without trying to treat bracket nodes like dot nodes. That wasn't needed.
1028 The reason we handle numbers before dot nodes specially is that the dot is a
1029 legal character in a number. The same is not true of a bracket. Eventually we
1030 could get smarter, and only add the parentheses when there is actual ambiguity.
1031 There is none if the string form of the number already has a dot in it, or if
1032 it's a number with a alphabetic name like infinity or NAN.
1034 * kjs/nodes.h: Renamed back from ObjectAccess to DotExpr.
1035 (KJS::NumberNode::precedence): Return PrecUnary for negative numbers, since
1036 they serialize as a unary operator, not a primary expression.
1037 * kjs/nodes2string.cpp:
1038 (KJS::SourceStream::operator<<): Clear m_numberNeedsParens if this adds
1039 parens; one set is enough.
1040 (KJS::bracketNodeStreamTo): Remove unneeded special flag here. Normal
1041 operator precedence suffices.
1042 (KJS::NewExprNode::streamTo): Ditto.
1044 2008-01-26 Oliver Hunt <oliver@apple.com>
1046 Reviewed by Maciej and Darin.
1048 Fix for http://bugs.webkit.org/show_bug.cgi?id=17020
1049 Function.toString does not parenthesise numbers for the bracket accessor
1051 It turns out that logic was there for all of the dot accessor nodes to make numbers be
1052 parenthesised properly, so it was a trivial extension to extend that to the bracket nodes.
1053 I renamed the enum type to reflect the fact that it is now used for both dot and bracket
1056 * kjs/nodes2string.cpp:
1057 (KJS::bracketNodeStreamTo):
1058 (KJS::BracketAccessorNode::streamTo):
1060 2008-01-26 Oliver Hunt <oliver@apple.com>
1064 Fix Bug 17018: Incorrect code generated from Function.toString for get/setters in object literals
1066 Don't quote getter and setter names during output, as that is simply wrong.
1068 * kjs/nodes2string.cpp:
1069 (KJS::PropertyNode::streamTo):
1071 2008-01-26 Darin Adler <darin@apple.com>
1073 Reviewed by Eric Seidel.
1075 - http://bugs.webkit.org/show_bug.cgi?id=16860
1076 a bit of cleanup after the Activation optimization
1078 * JavaScriptCore.exp: Export the GlobalExecState constructor instead of
1079 the global flavor of the ExecState constructor. It'd probably be cleaner
1080 to not export either one, but JSGlobalObject inlines the code that
1081 constructs the ExecState. If we changed that, we could remove this export.
1083 * JavaScriptCore.xcodeproj/project.pbxproj: Re-sorted a few things and
1084 put the new source files into the kjs group rather than at the top level.
1086 * kjs/ExecState.cpp:
1087 (KJS::ExecState::ExecState): Marked inline and updated for data member
1088 name changes. This is now only for use for the derived classes. Also removed
1089 code that sets the unused m_savedExec data member for the global case. That
1090 data member is only used for the other two types.
1091 (KJS::ExecState::~ExecState): Marked inline and removed all the code.
1092 The derived class destructors now inclde the appropriate code.
1093 (KJS::ExecState::lexicalGlobalObject): Removed unneeded special case for
1094 an empty scope chain. The bottom function already returns 0 for that case,
1095 so the general case code handles it fine. Also changed to use data members
1096 directly rather than calling functions.
1097 (KJS::GlobalExecState::GlobalExecState): Added. Calls through to the base
1099 (KJS::GlobalExecState::~GlobalExecState): Added.
1100 (KJS::InterpreterExecState::InterpreterExecState): Added. Moved code to
1101 manipulate activeExecStates here since we don't want to have to check for the
1102 special case of globalExec.
1103 (KJS::InterpreterExecState::~InterpreterExecState): Added.
1104 (KJS::EvalExecState::EvalExecState): Added.
1105 (KJS::EvalExecState::~EvalExecState): Added.
1106 (KJS::FunctionExecState::FunctionExecState): Added.
1107 (KJS::FunctionExecState::~FunctionExecState): Added.
1109 * kjs/ExecState.h: Tweaked the header, includes, and declarations a bit.
1110 Made ExecState inherit from Noncopyable. Reformatted some comments and
1111 made them a bit more brief. Rearranged declarations a little bit and removed
1112 unused savedExec function. Changed seenLabels function to return a reference
1113 rather than a pointer. Made constructors and destructor protected, and also
1114 did the same with all data members. Renamed m_thisVal to m_thisValue and
1115 ls to m_labelStack. Added three new derived classes for each of the
1116 types of ExecState. The primary goal here was to remove a branch from the
1117 code in the destructor, but it's also clearer than overloading the arguments
1118 to the ExecState constructor.
1120 * kjs/JSGlobalObject.cpp:
1121 (KJS::getCurrentTime): Fixed formatting.
1122 (KJS::JSGlobalObject::pushActivation): Removed parentheses that don't make
1123 the expression clearer -- other similar sites didn't have these parentheses,
1124 even the one a couple lines earlier that sets stackEntry.
1125 (KJS::JSGlobalObject::tearOffActivation): Got rid of unneeded static_cast
1126 (I think I mentioned this during patch review) and used an early exit so that
1127 the entire contents of the function aren't nested inside an if statement.
1128 Also removed the check of codeType, instead checking Activation for 0.
1129 For now, I kept the codeType check, but inside an assertion.
1131 * kjs/JSGlobalObject.h: Changed type of globalExec to GlobalExecState.
1133 (KJS::FunctionImp::callAsFunction): Changed type to FunctionExecState.
1134 (KJS::GlobalFuncImp::callAsFunction): Changed type to EvalExecState.
1135 * kjs/interpreter.cpp:
1136 (KJS::Interpreter::evaluate): Changed type to GlobalExecState.
1139 (KJS::ContinueNode::execute): Changed code since seenLabels() returns a
1140 reference now instead of a pointer.
1141 (KJS::BreakNode::execute): Ditto.
1142 (KJS::LabelNode::execute): Ditto.
1144 2008-01-26 Sam Weinig <sam@webkit.org>
1146 Reviewed by Mark Rowe.
1148 Cleanup node2string a little.
1149 - Remove some unnecessary branching.
1150 - Factor out bracket and dot streaming into static inline functions.
1153 * kjs/nodes2string.cpp:
1154 (KJS::bracketNodeStreamTo):
1155 (KJS::dotNodeStreamTo):
1156 (KJS::FunctionCallBracketNode::streamTo):
1157 (KJS::FunctionCallDotNode::streamTo):
1158 (KJS::PostIncBracketNode::streamTo):
1159 (KJS::PostDecBracketNode::streamTo):
1160 (KJS::PostIncDotNode::streamTo):
1161 (KJS::PostDecDotNode::streamTo):
1162 (KJS::DeleteBracketNode::streamTo):
1163 (KJS::DeleteDotNode::streamTo):
1164 (KJS::PreIncBracketNode::streamTo):
1165 (KJS::PreDecBracketNode::streamTo):
1166 (KJS::PreIncDotNode::streamTo):
1167 (KJS::PreDecDotNode::streamTo):
1168 (KJS::ReadModifyBracketNode::streamTo):
1169 (KJS::AssignBracketNode::streamTo):
1170 (KJS::ReadModifyDotNode::streamTo):
1171 (KJS::AssignDotNode::streamTo):
1172 (KJS::WhileNode::streamTo):
1174 2008-01-26 Mark Rowe <mrowe@apple.com>
1176 Reviewed by Darin Adler.
1178 Fix http://bugs.webkit.org/show_bug.cgi?id=17001
1179 Bug 17001: Build error with Gtk port on Mac OS X
1181 If both XP_MACOSX and XP_UNIX are defined then X11.h and Carbon.h will both be included.
1182 These provide conflicting definitions for a type named 'Cursor'. As XP_UNIX is set by
1183 the build system when targeting X11, it doesn't make sense for XP_MACOSX to also be set
1186 * bindings/npapi.h: Don't define XP_MACOSX if XP_UNIX is defined.
1188 2008-01-26 Darin Adler <darin@apple.com>
1192 - fix http://bugs.webkit.org/show_bug.cgi?id=17013
1193 JSC can't round trip certain for-loops
1195 Test: fast/js/toString-for-var-decl.html
1197 * kjs/nodes.h: Added PlaceholderTrueNode so we can put nodes into
1198 for loops without injecting the word "true" into them (nice, but not
1199 the bug fix). Fixed ForNode constructor so expr1WasVarDecl is set
1200 only when there is an expression, since it's common for the actual
1201 variable declaration to be moved by the parser.
1203 * kjs/nodes2string.cpp:
1204 (KJS::PlaceholderTrueNode::streamTo): Added. Empty.
1206 2008-01-25 Oliver Hunt <oliver@apple.com>
1210 Fix for bug 17012: REGRESSION: JSC can't round trip an object literal
1212 Add logic to ensure that object literals and function expressions get
1213 parentheses when necessary.
1216 * kjs/nodes2string.cpp:
1217 (KJS::SourceStream::operator<<):
1219 2008-01-24 Steve Falkenburg <sfalken@apple.com>
1223 * JavaScriptCore.vcproj/JavaScriptCore.sln:
1225 2008-01-24 Steve Falkenburg <sfalken@apple.com>
1229 * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln:
1231 2008-01-24 Michael Goddard <michael.goddard@trolltech.com>
1235 Fix QDateTime to JS Date conversion.
1236 Several conversion errors (some UTC related, some month
1237 offset related) and the conversion distance for Date
1238 to DateTime conversion weights were fixed (it should never
1239 be better to convert a JS Number into a Date rather than
1242 * bindings/qt/qt_runtime.cpp:
1243 (KJS::Bindings::convertValueToQVariant):
1244 (KJS::Bindings::convertQVariantToValue):
1246 2008-01-24 Michael Goddard <michael.goddard@trolltech.com>
1250 Add support for calling QObjects.
1251 Add support for invokeDefaultMethod (via a call to
1252 a specific slot), and also allow using it as a
1253 constructor, like QtScript.
1256 * bindings/qt/qt_class.cpp:
1257 (KJS::Bindings::QtClass::fallbackObject):
1258 * bindings/qt/qt_instance.cpp:
1259 (KJS::Bindings::QtRuntimeObjectImp::construct):
1260 (KJS::Bindings::QtInstance::QtInstance):
1261 (KJS::Bindings::QtInstance::~QtInstance):
1262 (KJS::Bindings::QtInstance::implementsCall):
1263 (KJS::Bindings::QtInstance::invokeDefaultMethod):
1264 * bindings/qt/qt_instance.h:
1265 * bindings/qt/qt_runtime.cpp:
1266 (KJS::Bindings::findMethodIndex):
1267 (KJS::Bindings::QtRuntimeMetaMethod::QtRuntimeMetaMethod):
1268 (KJS::Bindings::QtRuntimeMetaMethod::callAsFunction):
1269 * bindings/qt/qt_runtime.h:
1271 2008-01-24 Michael Goddard <michael.goddard@trolltech.com>
1275 Code style cleanups.
1276 Add spaces before/after braces in inline function.
1278 * bindings/qt/qt_instance.h:
1280 2008-01-24 Michael Goddard <michael.goddard@trolltech.com>
1284 Code style cleanups.
1285 Remove spaces and unneeded declared parameter names.
1287 * bindings/qt/qt_instance.cpp:
1288 (KJS::Bindings::QtRuntimeObjectImp::removeFromCache):
1290 2008-01-24 Michael Goddard <michael.goddard@trolltech.com>
1294 Clear stale RuntimeObjectImps.
1295 Since other objects can have refs to the QtInstance,
1296 we can't rely on the QtInstance being deleted when the
1297 RuntimeObjectImp is invalidate or deleted. This
1298 could result in a stale JSObject being returned for
1301 * bindings/qt/qt_instance.cpp:
1302 (KJS::Bindings::QtRuntimeObjectImp::QtRuntimeObjectImp):
1303 (KJS::Bindings::QtRuntimeObjectImp::~QtRuntimeObjectImp):
1304 (KJS::Bindings::QtRuntimeObjectImp::invalidate):
1305 (KJS::Bindings::QtRuntimeObjectImp::removeFromCache):
1306 (KJS::Bindings::QtInstance::getRuntimeObject):
1307 * bindings/runtime.cpp:
1308 (KJS::Bindings::Instance::createRuntimeObject):
1309 * bindings/runtime.h:
1311 2008-01-23 Alp Toker <alp@atoker.com>
1313 Rubber-stamped by Mark Rowe.
1315 Remove whitespace after -I in automake include lists.
1319 2008-01-23 Michael Goddard <michael.goddard@trolltech.com>
1321 Reviewed by Lars Knoll <lars@trolltech.com>.
1323 Reworked the JavaScriptCore Qt bindings:
1325 * Add initial support for string and variant arrays, as well
1326 as sub QObjects in the JS bindings.
1328 * Don't expose fields marked as not scriptable by moc.
1330 * Add support for dynamic properties and accessing named
1331 QObject children of an object (like QtScript and older
1333 * Add support for custom toString methods.
1335 * Fine tune some bindings to be closer to QtScript.
1336 Make void functions return undefined, and empty/
1337 null QStrings return a zero length string.
1339 * Create framework for allowing more direct method calls.
1340 Since RuntimeMethod doesn't allow us to add additional
1341 methods/properties to a function, add these classes.
1342 Start prototyping object.signal.connect(...).
1344 * Add signal support to the Qt bindings.
1345 Allow connecting to signals (object.signal.connect(slot)),
1346 disconnecting, and emitting signals. Currently chooses
1347 the first signal that matches the name, so this will need
1350 * Add property names, and resolve signals closer to use.
1351 Enumerating properties now returns some of the Qt properties
1352 and signals. Slots and methods aren't quite present. Also,
1353 resolve signal connections etc. closer to the time of use, so
1354 we can do more dynamic resolution based on argument type etc.
1355 Still picks the first one with the same name, at the moment.
1357 * Make signature comparison code consistent.
1358 Use the same code for checking meta signatures in
1359 the method and fallback getters, and avoid a
1360 QByteArray construction when we can.
1362 * Fix minor memory leak, and handle pointers better.
1363 Delete the private object in the dtors, and use RefPtrs
1364 for holding Instances etc.
1366 * Handle method lookup better.
1367 Allow invocation time method lookup based on the arguments,
1368 which is closer to QtScript behaviour. Also, cache the
1369 method lists and delete them in the QtClass dtor (stops
1372 * Improve JS to Qt data type conversions.
1373 Add some support for Date & RegExp JS objects,
1374 and provide some metrics on the quality of the
1377 * A couple of fixes for autotest failures.
1378 Better support for converting lists, read/write only
1379 QMetaProperty support, modified slot search order...)
1381 * bindings/qt/qt_class.cpp:
1382 (KJS::Bindings::QtClass::QtClass):
1383 (KJS::Bindings::QtClass::~QtClass):
1384 (KJS::Bindings::QtClass::name):
1385 (KJS::Bindings::QtClass::fallbackObject):
1386 (KJS::Bindings::QtClass::methodsNamed):
1387 (KJS::Bindings::QtClass::fieldNamed):
1388 * bindings/qt/qt_class.h:
1389 * bindings/qt/qt_instance.cpp:
1390 (KJS::Bindings::QtInstance::QtInstance):
1391 (KJS::Bindings::QtInstance::~QtInstance):
1392 (KJS::Bindings::QtInstance::getRuntimeObject):
1393 (KJS::Bindings::QtInstance::getClass):
1394 (KJS::Bindings::QtInstance::implementsCall):
1395 (KJS::Bindings::QtInstance::getPropertyNames):
1396 (KJS::Bindings::QtInstance::invokeMethod):
1397 (KJS::Bindings::QtInstance::invokeDefaultMethod):
1398 (KJS::Bindings::QtInstance::stringValue):
1399 (KJS::Bindings::QtInstance::booleanValue):
1400 (KJS::Bindings::QtInstance::valueOf):
1401 (KJS::Bindings::QtField::name):
1402 (KJS::Bindings::QtField::valueFromInstance):
1403 (KJS::Bindings::QtField::setValueToInstance):
1404 * bindings/qt/qt_instance.h:
1405 (KJS::Bindings::QtInstance::getBindingLanguage):
1406 (KJS::Bindings::QtInstance::getObject):
1407 * bindings/qt/qt_runtime.cpp:
1408 (KJS::Bindings::QWKNoDebug::QWKNoDebug):
1409 (KJS::Bindings::QWKNoDebug::~QWKNoDebug):
1410 (KJS::Bindings::QWKNoDebug::operator<<):
1412 (KJS::Bindings::valueRealType):
1413 (KJS::Bindings::convertValueToQVariant):
1414 (KJS::Bindings::convertQVariantToValue):
1415 (KJS::Bindings::QtRuntimeMethod::QtRuntimeMethod):
1416 (KJS::Bindings::QtRuntimeMethod::~QtRuntimeMethod):
1417 (KJS::Bindings::QtRuntimeMethod::codeType):
1418 (KJS::Bindings::QtRuntimeMethod::execute):
1419 (KJS::Bindings::QtRuntimeMethodData::~QtRuntimeMethodData):
1420 (KJS::Bindings::QtRuntimeMetaMethodData::~QtRuntimeMetaMethodData):
1421 (KJS::Bindings::QtRuntimeConnectionMethodData::~QtRuntimeConnectionMethodData):
1422 (KJS::Bindings::QtMethodMatchType::):
1423 (KJS::Bindings::QtMethodMatchType::QtMethodMatchType):
1424 (KJS::Bindings::QtMethodMatchType::kind):
1425 (KJS::Bindings::QtMethodMatchType::isValid):
1426 (KJS::Bindings::QtMethodMatchType::isVariant):
1427 (KJS::Bindings::QtMethodMatchType::isMetaType):
1428 (KJS::Bindings::QtMethodMatchType::isUnresolved):
1429 (KJS::Bindings::QtMethodMatchType::isMetaEnum):
1430 (KJS::Bindings::QtMethodMatchType::enumeratorIndex):
1431 (KJS::Bindings::QtMethodMatchType::variant):
1432 (KJS::Bindings::QtMethodMatchType::metaType):
1433 (KJS::Bindings::QtMethodMatchType::metaEnum):
1434 (KJS::Bindings::QtMethodMatchType::unresolved):
1435 (KJS::Bindings::QtMethodMatchType::typeId):
1436 (KJS::Bindings::QtMethodMatchType::name):
1437 (KJS::Bindings::QtMethodMatchData::QtMethodMatchData):
1438 (KJS::Bindings::QtMethodMatchData::isValid):
1439 (KJS::Bindings::QtMethodMatchData::firstUnresolvedIndex):
1440 (KJS::Bindings::indexOfMetaEnum):
1441 (KJS::Bindings::findMethodIndex):
1442 (KJS::Bindings::findSignalIndex):
1443 (KJS::Bindings::QtRuntimeMetaMethod::QtRuntimeMetaMethod):
1444 (KJS::Bindings::QtRuntimeMetaMethod::mark):
1445 (KJS::Bindings::QtRuntimeMetaMethod::callAsFunction):
1446 (KJS::Bindings::QtRuntimeMetaMethod::getOwnPropertySlot):
1447 (KJS::Bindings::QtRuntimeMetaMethod::lengthGetter):
1448 (KJS::Bindings::QtRuntimeMetaMethod::connectGetter):
1449 (KJS::Bindings::QtRuntimeMetaMethod::disconnectGetter):
1450 (KJS::Bindings::QtRuntimeConnectionMethod::QtRuntimeConnectionMethod):
1451 (KJS::Bindings::QtRuntimeConnectionMethod::callAsFunction):
1452 (KJS::Bindings::QtRuntimeConnectionMethod::getOwnPropertySlot):
1453 (KJS::Bindings::QtRuntimeConnectionMethod::lengthGetter):
1454 (KJS::Bindings::QtConnectionObject::QtConnectionObject):
1455 (KJS::Bindings::QtConnectionObject::~QtConnectionObject):
1456 (KJS::Bindings::QtConnectionObject::metaObject):
1457 (KJS::Bindings::QtConnectionObject::qt_metacast):
1458 (KJS::Bindings::QtConnectionObject::qt_metacall):
1459 (KJS::Bindings::QtConnectionObject::execute):
1460 (KJS::Bindings::QtConnectionObject::match):
1461 (KJS::Bindings::::QtArray):
1462 (KJS::Bindings::::~QtArray):
1463 (KJS::Bindings::::rootObject):
1464 (KJS::Bindings::::setValueAt):
1465 (KJS::Bindings::::valueAt):
1466 * bindings/qt/qt_runtime.h:
1467 (KJS::Bindings::QtField::):
1468 (KJS::Bindings::QtField::QtField):
1469 (KJS::Bindings::QtField::fieldType):
1470 (KJS::Bindings::QtMethod::QtMethod):
1471 (KJS::Bindings::QtMethod::name):
1472 (KJS::Bindings::QtMethod::numParameters):
1473 (KJS::Bindings::QtArray::getLength):
1474 (KJS::Bindings::QtRuntimeMethod::d_func):
1475 (KJS::Bindings::QtRuntimeMetaMethod::d_func):
1476 (KJS::Bindings::QtRuntimeConnectionMethod::d_func):
1478 * bindings/runtime.cpp:
1479 (KJS::Bindings::Instance::createBindingForLanguageInstance):
1480 (KJS::Bindings::Instance::createRuntimeObject):
1481 (KJS::Bindings::Instance::reallyCreateRuntimeObject):
1482 * bindings/runtime.h:
1484 2008-01-22 Anders Carlsson <andersca@apple.com>
1486 Reviewed by Darin and Adam.
1488 <rdar://problem/5688975>
1489 div element on microsoft site has wrong left offset.
1491 Return true even if NPN_GetProperty returns null or undefined. This matches Firefox
1492 (and is what the Silverlight plug-in expects).
1494 * bindings/NP_jsobject.cpp:
1497 2008-01-21 Geoffrey Garen <ggaren@apple.com>
1499 Reviewed by Maciej Stachowiak.
1501 Fixed http://bugs.webkit.org/show_bug.cgi?id=16909
1502 REGRESSION: Amazon.com crash (ActivationImp)
1504 (and a bunch of other crashes)
1506 Plus, a .7% SunSpider speedup to boot.
1508 Replaced the buggy currentExec and savedExec mechanisms with an
1509 explicit ExecState stack.
1511 * kjs/collector.cpp:
1512 (KJS::Collector::collect): Explicitly mark the ExecState stack.
1514 (KJS::Collector::reportOutOfMemoryToAllExecStates): Slight change in
1515 behavior: We no longer throw an exception in any global ExecStates,
1516 since global ExecStates are more like pseudo-ExecStates, and aren't
1517 used for script execution. (It's unclear what would happen if you left
1518 an exception waiting around in a global ExecState, but it probably
1521 2008-01-21 Jan Michael Alonzo <jmalonzo@unpluggable.com>
1523 Reviewed by Alp Toker.
1525 http://bugs.webkit.org/show_bug.cgi?id=16955
1526 Get errors when cross-compile webkit-gtk
1528 * GNUmakefile.am: removed ICU_CFLAGS
1530 2008-01-18 Kevin McCullough <kmccullough@apple.com>
1536 2008-01-18 Kevin McCullough <kmccullough@apple.com>
1542 (KJS::UString::cost):
1544 2008-01-18 Kevin McCullough <kmccullough@apple.com>
1548 - Correctly report cost of appended strings to trigger GC.
1552 (KJS::UString::Rep::create):
1553 (KJS::UString::UString): Don't create unnecssary objects.
1554 (KJS::UString::cost): Report cost if necessary but also keep track of
1558 2008-01-18 Simon Hausmann <hausmann@webkit.org>
1562 Fix return type conversions from Qt slots to JS values.
1564 This also fixes fast/dom/open-and-close-by-DOM.html, which called
1565 layoutTestController.windowCount().
1567 When constructing the QVariant that holds the return type we cannot
1568 use the QVarian(Type) constuctor as that will create a null variant.
1569 We have to use the QVariant(Type, void *) constructor instead, just
1570 like in QMetaObject::read() for example.
1573 * bindings/qt/qt_instance.cpp:
1574 (KJS::Bindings::QtInstance::getRuntimeObject):
1576 2008-01-18 Prasanth Ullattil <prasanth.ullattil@trolltech.com>
1578 Reviewed by Simon Hausmann <hausmann@webkit.org>.
1580 Fix compilation on Win64(2): Implemented currentThreadStackBase on X86-64 on Windows
1583 * kjs/collector.cpp:
1584 (KJS::Collector::heapAllocate):
1586 2008-01-18 Prasanth Ullattil <prasanth.ullattil@trolltech.com>
1588 Reviewed by Simon Hausmann <hausmann@webkit.org>.
1590 Fix compilation on Win64(1): Define WTF_PLATFORM_X86_64 correctly on Win64.
1595 2008-01-17 Antti Koivisto <antti@apple.com>
1599 * kjs/regexp_object.cpp:
1600 (KJS::regExpProtoFuncToString):
1602 2008-01-16 Sam Weinig <sam@webkit.org>
1606 Fix for http://bugs.webkit.org/show_bug.cgi?id=16901
1607 Convert remaining JS function objects to use the new PrototypeFunction class
1609 - Moves Boolean, Function, RegExp, Number, Object and Global functions to their
1610 own static function implementations so that they can be used with the
1611 PrototypeFunction class. SunSpider says this is 1.003x as fast.
1613 * kjs/JSGlobalObject.cpp:
1614 (KJS::JSGlobalObject::reset):
1615 * kjs/array_object.h:
1616 * kjs/bool_object.cpp:
1617 (KJS::BooleanInstance::BooleanInstance):
1618 (KJS::BooleanPrototype::BooleanPrototype):
1619 (KJS::booleanProtoFuncToString):
1620 (KJS::booleanProtoFuncValueOf):
1621 (KJS::BooleanObjectImp::BooleanObjectImp):
1622 (KJS::BooleanObjectImp::implementsConstruct):
1623 (KJS::BooleanObjectImp::construct):
1624 (KJS::BooleanObjectImp::callAsFunction):
1625 * kjs/bool_object.h:
1626 (KJS::BooleanInstance::classInfo):
1627 * kjs/error_object.cpp:
1628 (KJS::ErrorPrototype::ErrorPrototype):
1629 (KJS::errorProtoFuncToString):
1630 * kjs/error_object.h:
1632 (KJS::globalFuncEval):
1633 (KJS::globalFuncParseInt):
1634 (KJS::globalFuncParseFloat):
1635 (KJS::globalFuncIsNaN):
1636 (KJS::globalFuncIsFinite):
1637 (KJS::globalFuncDecodeURI):
1638 (KJS::globalFuncDecodeURIComponent):
1639 (KJS::globalFuncEncodeURI):
1640 (KJS::globalFuncEncodeURIComponent):
1641 (KJS::globalFuncEscape):
1642 (KJS::globalFuncUnEscape):
1643 (KJS::globalFuncKJSPrint):
1644 (KJS::PrototypeFunction::PrototypeFunction):
1646 * kjs/function_object.cpp:
1647 (KJS::FunctionPrototype::FunctionPrototype):
1648 (KJS::functionProtoFuncToString):
1649 (KJS::functionProtoFuncApply):
1650 (KJS::functionProtoFuncCall):
1651 * kjs/function_object.h:
1652 * kjs/number_object.cpp:
1653 (KJS::NumberPrototype::NumberPrototype):
1654 (KJS::numberProtoFuncToString):
1655 (KJS::numberProtoFuncToLocaleString):
1656 (KJS::numberProtoFuncValueOf):
1657 (KJS::numberProtoFuncToFixed):
1658 (KJS::numberProtoFuncToExponential):
1659 (KJS::numberProtoFuncToPrecision):
1660 * kjs/number_object.h:
1661 (KJS::NumberInstance::classInfo):
1662 (KJS::NumberObjectImp::classInfo):
1663 (KJS::NumberObjectImp::):
1664 * kjs/object_object.cpp:
1665 (KJS::ObjectPrototype::ObjectPrototype):
1666 (KJS::objectProtoFuncValueOf):
1667 (KJS::objectProtoFuncHasOwnProperty):
1668 (KJS::objectProtoFuncIsPrototypeOf):
1669 (KJS::objectProtoFuncDefineGetter):
1670 (KJS::objectProtoFuncDefineSetter):
1671 (KJS::objectProtoFuncLookupGetter):
1672 (KJS::objectProtoFuncLookupSetter):
1673 (KJS::objectProtoFuncPropertyIsEnumerable):
1674 (KJS::objectProtoFuncToLocaleString):
1675 (KJS::objectProtoFuncToString):
1676 * kjs/object_object.h:
1677 * kjs/regexp_object.cpp:
1678 (KJS::RegExpPrototype::RegExpPrototype):
1679 (KJS::regExpProtoFuncTest):
1680 (KJS::regExpProtoFuncExec):
1681 (KJS::regExpProtoFuncCompile):
1682 (KJS::regExpProtoFuncToString):
1683 * kjs/regexp_object.h:
1685 2008-01-16 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1687 Reviewed by Maciej & Darin.
1689 Fixes Bug 16868: Gmail crash
1690 and Bug 16871: Crash when loading apple.com/startpage
1692 <http://bugs.webkit.org/show_bug.cgi?id=16868>
1693 <rdar://problem/5686108>
1695 <http://bugs.webkit.org/show_bug.cgi?id=16871>
1696 <rdar://problem/5686670>
1698 Adds ActivationImp tear-off for cross-window eval() and fixes an
1699 existing garbage collection issue exposed by the ActivationImp tear-off
1700 patch (r29425) that can occur when an ExecState's m_callingExec is
1701 different than its m_savedExec.
1703 * kjs/ExecState.cpp:
1704 (KJS::ExecState::mark):
1706 (KJS::GlobalFuncImp::callAsFunction):
1708 2008-01-16 Sam Weinig <sam@webkit.org>
1712 Clean up MathObjectImp, it needed a little scrubbing.
1714 * kjs/math_object.cpp:
1715 (KJS::MathObjectImp::MathObjectImp):
1716 (KJS::MathObjectImp::getOwnPropertySlot):
1717 (KJS::MathObjectImp::getValueProperty):
1718 (KJS::mathProtoFuncACos):
1719 (KJS::mathProtoFuncASin):
1720 (KJS::mathProtoFuncATan):
1721 (KJS::mathProtoFuncATan2):
1722 (KJS::mathProtoFuncCos):
1723 (KJS::mathProtoFuncExp):
1724 (KJS::mathProtoFuncLog):
1725 (KJS::mathProtoFuncSin):
1726 (KJS::mathProtoFuncSqrt):
1727 (KJS::mathProtoFuncTan):
1728 * kjs/math_object.h:
1729 (KJS::MathObjectImp::classInfo):
1730 (KJS::MathObjectImp::):
1732 2008-01-16 Sam Weinig <sam@webkit.org>
1734 Reviewed by Geoffrey Garen.
1736 Rename Lexer variable bol to atLineStart.
1739 (KJS::Lexer::Lexer):
1740 (KJS::Lexer::setCode):
1741 (KJS::Lexer::nextLine):
1745 2008-01-16 Sam Weinig <sam@webkit.org>
1747 Reviewed by Geoffrey Garen and Anders Carlsson.
1749 Remove uses of KJS_PURE_ECMA as we don't ever build with it defined,
1750 and we have many features that are not included in the ECMA spec.
1753 (KJS::Lexer::Lexer):
1754 (KJS::Lexer::setCode):
1755 (KJS::Lexer::nextLine):
1758 * kjs/string_object.cpp:
1759 * kjs/string_object.h:
1761 2008-01-15 Sam Weinig <sam@webkit.org>
1763 Reviewed by Geoffrey Garen.
1765 Fix <rdar://problem/5595552> r27608 introduced a 20% increase in JS binary size, 4% increase in WebCore binary size
1767 - This changes the way JS functions that use Lookup tables are handled. Instead of using
1768 one class per function, which allowed specialization of the virtual callAsFunction
1769 method, we now use one class, PrototypeFunction, which takes a pointer to a static
1770 function to use as the implementation. This significantly decreases the binary size
1771 of JavaScriptCore (about 145k on an Intel only build) while still keeping some of the
1772 speedup r27608 garnered (SunSpider says this is 1.005x as slow, which should leave some
1773 wiggle room from the original 1% speedup) and keeps the functions implementations in separate
1774 functions to help with optimizations.
1776 * JavaScriptCore.exp:
1777 * JavaScriptCore.xcodeproj/project.pbxproj:
1778 * kjs/array_object.cpp:
1779 (KJS::arrayProtoFuncToString):
1780 (KJS::arrayProtoFuncToLocaleString):
1781 (KJS::arrayProtoFuncJoin):
1782 (KJS::arrayProtoFuncConcat):
1783 (KJS::arrayProtoFuncPop):
1784 (KJS::arrayProtoFuncPush):
1785 (KJS::arrayProtoFuncReverse):
1786 (KJS::arrayProtoFuncShift):
1787 (KJS::arrayProtoFuncSlice):
1788 (KJS::arrayProtoFuncSort):
1789 (KJS::arrayProtoFuncSplice):
1790 (KJS::arrayProtoFuncUnShift):
1791 (KJS::arrayProtoFuncFilter):
1792 (KJS::arrayProtoFuncMap):
1793 (KJS::arrayProtoFuncEvery):
1794 (KJS::arrayProtoFuncForEach):
1795 (KJS::arrayProtoFuncSome):
1796 (KJS::arrayProtoFuncIndexOf):
1797 (KJS::arrayProtoFuncLastIndexOf):
1798 * kjs/array_object.h:
1799 * kjs/date_object.cpp:
1800 (KJS::DatePrototype::getOwnPropertySlot):
1801 (KJS::dateProtoFuncToString):
1802 (KJS::dateProtoFuncToUTCString):
1803 (KJS::dateProtoFuncToDateString):
1804 (KJS::dateProtoFuncToTimeString):
1805 (KJS::dateProtoFuncToLocaleString):
1806 (KJS::dateProtoFuncToLocaleDateString):
1807 (KJS::dateProtoFuncToLocaleTimeString):
1808 (KJS::dateProtoFuncValueOf):
1809 (KJS::dateProtoFuncGetTime):
1810 (KJS::dateProtoFuncGetFullYear):
1811 (KJS::dateProtoFuncGetUTCFullYear):
1812 (KJS::dateProtoFuncToGMTString):
1813 (KJS::dateProtoFuncGetMonth):
1814 (KJS::dateProtoFuncGetUTCMonth):
1815 (KJS::dateProtoFuncGetDate):
1816 (KJS::dateProtoFuncGetUTCDate):
1817 (KJS::dateProtoFuncGetDay):
1818 (KJS::dateProtoFuncGetUTCDay):
1819 (KJS::dateProtoFuncGetHours):
1820 (KJS::dateProtoFuncGetUTCHours):
1821 (KJS::dateProtoFuncGetMinutes):
1822 (KJS::dateProtoFuncGetUTCMinutes):
1823 (KJS::dateProtoFuncGetSeconds):
1824 (KJS::dateProtoFuncGetUTCSeconds):
1825 (KJS::dateProtoFuncGetMilliSeconds):
1826 (KJS::dateProtoFuncGetUTCMilliseconds):
1827 (KJS::dateProtoFuncGetTimezoneOffset):
1828 (KJS::dateProtoFuncSetTime):
1829 (KJS::dateProtoFuncSetMilliSeconds):
1830 (KJS::dateProtoFuncSetUTCMilliseconds):
1831 (KJS::dateProtoFuncSetSeconds):
1832 (KJS::dateProtoFuncSetUTCSeconds):
1833 (KJS::dateProtoFuncSetMinutes):
1834 (KJS::dateProtoFuncSetUTCMinutes):
1835 (KJS::dateProtoFuncSetHours):
1836 (KJS::dateProtoFuncSetUTCHours):
1837 (KJS::dateProtoFuncSetDate):
1838 (KJS::dateProtoFuncSetUTCDate):
1839 (KJS::dateProtoFuncSetMonth):
1840 (KJS::dateProtoFuncSetUTCMonth):
1841 (KJS::dateProtoFuncSetFullYear):
1842 (KJS::dateProtoFuncSetUTCFullYear):
1843 (KJS::dateProtoFuncSetYear):
1844 (KJS::dateProtoFuncGetYear):
1845 * kjs/date_object.h:
1847 (KJS::PrototypeFunction::PrototypeFunction):
1848 (KJS::PrototypeFunction::callAsFunction):
1852 (KJS::staticFunctionGetter):
1853 * kjs/math_object.cpp:
1854 (KJS::mathProtoFuncAbs):
1855 (KJS::mathProtoFuncACos):
1856 (KJS::mathProtoFuncASin):
1857 (KJS::mathProtoFuncATan):
1858 (KJS::mathProtoFuncATan2):
1859 (KJS::mathProtoFuncCeil):
1860 (KJS::mathProtoFuncCos):
1861 (KJS::mathProtoFuncExp):
1862 (KJS::mathProtoFuncFloor):
1863 (KJS::mathProtoFuncLog):
1864 (KJS::mathProtoFuncMax):
1865 (KJS::mathProtoFuncMin):
1866 (KJS::mathProtoFuncPow):
1867 (KJS::mathProtoFuncRandom):
1868 (KJS::mathProtoFuncRound):
1869 (KJS::mathProtoFuncSin):
1870 (KJS::mathProtoFuncSqrt):
1871 (KJS::mathProtoFuncTan):
1872 * kjs/math_object.h:
1873 * kjs/string_object.cpp:
1874 (KJS::stringProtoFuncToString):
1875 (KJS::stringProtoFuncValueOf):
1876 (KJS::stringProtoFuncCharAt):
1877 (KJS::stringProtoFuncCharCodeAt):
1878 (KJS::stringProtoFuncConcat):
1879 (KJS::stringProtoFuncIndexOf):
1880 (KJS::stringProtoFuncLastIndexOf):
1881 (KJS::stringProtoFuncMatch):
1882 (KJS::stringProtoFuncSearch):
1883 (KJS::stringProtoFuncReplace):
1884 (KJS::stringProtoFuncSlice):
1885 (KJS::stringProtoFuncSplit):
1886 (KJS::stringProtoFuncSubstr):
1887 (KJS::stringProtoFuncSubstring):
1888 (KJS::stringProtoFuncToLowerCase):
1889 (KJS::stringProtoFuncToUpperCase):
1890 (KJS::stringProtoFuncToLocaleLowerCase):
1891 (KJS::stringProtoFuncToLocaleUpperCase):
1892 (KJS::stringProtoFuncLocaleCompare):
1893 (KJS::stringProtoFuncBig):
1894 (KJS::stringProtoFuncSmall):
1895 (KJS::stringProtoFuncBlink):
1896 (KJS::stringProtoFuncBold):
1897 (KJS::stringProtoFuncFixed):
1898 (KJS::stringProtoFuncItalics):
1899 (KJS::stringProtoFuncStrike):
1900 (KJS::stringProtoFuncSub):
1901 (KJS::stringProtoFuncSup):
1902 (KJS::stringProtoFuncFontcolor):
1903 (KJS::stringProtoFuncFontsize):
1904 (KJS::stringProtoFuncAnchor):
1905 (KJS::stringProtoFuncLink):
1906 * kjs/string_object.h:
1908 2008-01-15 Geoffrey Garen <ggaren@apple.com>
1910 Reviewed by Adam Roben.
1912 Some tweaks to our headerdoc, suggested by David Gatwood on the docs
1916 * API/JSObjectRef.h:
1917 * API/JSStringRef.h:
1920 2008-01-15 Alp Toker <alp@atoker.com>
1922 Rubber-stamped by Anders.
1924 Make the HTTP backend configurable in the GTK+ port. curl is currently
1927 * wtf/Platform.h: Don't hard-code WTF_USE_CURL for GTK
1929 2008-01-15 Sam Weinig <sam@webkit.org>
1931 Reviewed by Beth Dakin.
1933 Remove unneeded variable.
1935 * kjs/string_object.cpp:
1936 (KJS::StringProtoFuncSubstr::callAsFunction):
1938 2008-01-14 Steve Falkenburg <sfalken@apple.com>
1940 Use shared vsprops for most vcproj properties.
1944 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add missing Debug_Internal config.
1945 * JavaScriptCore.vcproj/WTF/WTF.vcproj: Add missing Debug_Internal config.
1946 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
1948 2008-01-14 Adam Roben <aroben@apple.com>
1950 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Added
1951 some headers that were missing from the vcproj so their contents will
1952 be included in Find in Files.
1954 2008-01-14 Adam Roben <aroben@apple.com>
1956 Fix Bug 16871: Crash when loading apple.com/startpage
1958 <http://bugs.webkit.org/show_bug.cgi?id=16871>
1959 <rdar://problem/5686670>
1961 Patch written by Darin, reviewed by me.
1963 * kjs/ExecState.cpp:
1964 (KJS::ExecState::mark): Call ActivationImp::markChildren if our
1965 m_activation is on the stack. This is what ScopeChain::mark also does,
1966 but apparently in some cases it's possible for an ExecState's
1967 ActivationImp to not be in any ScopeChain.
1969 2008-01-14 Kevin McCullough <kmccullough@apple.com>
1973 -<rdar://problem/5622667> REGRESSION (Leopard-ToT): Endless loading loop
1974 trying to view techreport.com comments
1975 - We need to set values in the map, because if they are already in the
1976 map they will not be reset when we use add().
1978 * kjs/array_instance.cpp:
1979 (KJS::ArrayInstance::put):
1981 2008-01-14 Darin Adler <darin@apple.com>
1985 - re-speed-up the page load test (my StringImpl change slowed it down)
1988 (WTF::RefCounted::RefCounted): Allow derived classes to start with a reference
1989 count other than 0. Eventually everyone will want to start with a 1. This is a
1990 staged change. For now, there's a default of 0, and you can specify 1. Later,
1991 there will be no default and everyone will have to specify. And then later, there
1992 will be a default of 1. Eventually, we can take away even the option of starting
1996 (WTF::Vector::Vector): Sped up creation of non-empty vectors by removing the
1997 overhead of first constructing something empty and then calling resize.
1998 (WTF::Vector::clear): Sped up the common case of calling clear on an empty
1999 vector by adding a check for that case.
2000 (WTF::Vector::releaseBuffer): Marked this function inline and removed a branch
2001 in the case of vectors with no inline capacity (normal vectors) by leaving out
2002 the code to copy the inline buffer in that case.
2004 2008-01-14 Alexey Proskuryakov <ap@webkit.org>
2006 Reviewed by David Kilzer.
2008 http://bugs.webkit.org/show_bug.cgi?id=16787
2009 array.splice() with 1 element not working
2011 Test: fast/js/array-splice.html
2013 * kjs/array_object.cpp:
2014 (KJS::ArrayProtoFuncSplice::callAsFunction): Implement this Mozilla extension, and fix
2015 some other edge cases.
2017 2008-01-13 Steve Falkenburg <sfalken@apple.com>
2019 Share common files across projects.
2022 Debug: common.vsprops, debug.vsprops
2023 Debug_Internal: common.vsprops, debug.vsprops, debug_internal.vsprops
2024 Release: common.vsprops, release.vsprops
2026 Shared properties can go into common.vsprops, shared debug settings can go into debug.vsprops.
2027 debug_internal.vsprops will be mostly empty except for file path prefix modifiers.
2029 Reviewed by Adam Roben.
2031 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2032 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
2033 * JavaScriptCore.vcproj/debug.vsprops: Removed.
2034 * JavaScriptCore.vcproj/debug_internal.vsprops: Removed.
2035 * JavaScriptCore.vcproj/release.vsprops: Removed.
2036 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
2038 2008-01-13 Marius Bugge Monsen <mbm@trolltech.com>
2040 Contributions and review by Adriaan de Groot,
2041 Simon Hausmann, Eric Seidel, and Darin Adler.
2043 - http://bugs.webkit.org/show_bug.cgi?id=16590
2044 Compilation fixes for Solaris.
2047 (KJS::GregorianDateTime::GregorianDateTime): Use the WIN_OS code path
2048 for SOLARIS too, presumably because Solaris also lacks the tm_gtoff and tm_zone
2050 (KJS::GregorianDateTime::operator tm): Ditto.
2052 * kjs/collector.cpp:
2053 (KJS::currentThreadStackBase): Use thr_stksegment on Solaris.
2056 (isfinite): Implement for Solaris.
2058 (signbit): Ditto. But this one is wrong, so I added a FIXME.
2060 * wtf/Platform.h: Define PLATFORM(SOLARIS) when "sun" or "__sun" is defined.
2062 2008-01-13 Michael Goddard <michael.goddard@trolltech.com>
2064 Reviewed by Anders Carlsson.
2066 Add binding language type to Instance.
2067 Allows runtime determination of the type of an
2068 Instance, to allow safe casting. Doesn't actually
2069 add any safe casting yet, though.
2071 Add a helper function to get an Instance from a JSObject*.
2072 Given an object and the expected binding language, see if
2073 the JSObject actually wraps an Instance of the given type
2074 and return it. Otherwise return 0.
2076 Move RuntimeObjectImp creations into Instance.
2077 Make the ctor protected, and Instance a friend class, so
2078 that all creation of RuntimeObjectImps goes through
2081 Remove copy ctor/assignment operator for QtInstance.
2082 Instance itself is Noncopyable, so QtInstance doesn't
2085 Add caching for QtInstance and associated RuntimeObjectImps.
2086 Push any dealings with QtLanguage bindings into QtInstance,
2087 and cache them there, rather than in the Instance layer. Add
2088 a QtRuntimeObjectImp to help with caching.
2090 * JavaScriptCore.exp:
2091 * bindings/c/c_instance.h:
2092 * bindings/jni/jni_instance.h:
2093 * bindings/objc/objc_instance.h:
2094 * bindings/qt/qt_instance.cpp:
2095 (KJS::Bindings::QtRuntimeObjectImp::QtRuntimeObjectImp):
2096 (KJS::Bindings::QtRuntimeObjectImp::~QtRuntimeObjectImp):
2097 (KJS::Bindings::QtRuntimeObjectImp::invalidate):
2098 (KJS::Bindings::QtRuntimeObjectImp::removeFromCache):
2099 (KJS::Bindings::QtInstance::QtInstance):
2100 (KJS::Bindings::QtInstance::~QtInstance):
2101 (KJS::Bindings::QtInstance::getQtInstance):
2102 (KJS::Bindings::QtInstance::getRuntimeObject):
2103 * bindings/qt/qt_instance.h:
2104 (KJS::Bindings::QtInstance::getBindingLanguage):
2105 * bindings/runtime.cpp:
2106 (KJS::Bindings::Instance::createBindingForLanguageInstance):
2107 (KJS::Bindings::Instance::createRuntimeObject):
2108 (KJS::Bindings::Instance::getInstance):
2109 * bindings/runtime.h:
2110 * bindings/runtime_object.h:
2111 (KJS::RuntimeObjectImp::getInternalInstance):
2113 2008-01-12 Alp Toker <alp@atoker.com>
2115 Reviewed by Mark Rowe.
2117 Hide non-public symbols in GTK+/autotools release builds.
2121 2008-01-12 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2123 Reviewed by Mark Rowe.
2125 Fix http://bugs.webkit.org/show_bug.cgi?id=16852
2126 Fixes leaking of ActivationStackNode objects.
2128 * kjs/JSGlobalObject.cpp:
2129 (KJS::JSGlobalObject::deleteActivationStack):
2130 (KJS::JSGlobalObject::~JSGlobalObject):
2131 (KJS::JSGlobalObject::init):
2132 (KJS::JSGlobalObject::reset):
2133 * kjs/JSGlobalObject.h:
2135 2008-01-12 Darin Adler <darin@apple.com>
2137 - try to fix Qt Windows build
2139 * pcre/dftables: Remove reliance on the list form of Perl pipes.
2141 2008-01-12 Darin Adler <darin@apple.com>
2143 - try to fix Qt build
2145 * kjs/function.cpp: Added include of scope_chain_mark.h.
2146 * kjs/scope_chain_mark.h: Added multiple-include guards.
2148 2008-01-12 Mark Rowe <mrowe@apple.com>
2150 Another Windows build fix.
2154 2008-01-12 Mark Rowe <mrowe@apple.com>
2156 Attempted Windows build fix. Use struct consistently when forward-declaring
2157 ActivationStackNode and StackActivation.
2160 * kjs/JSGlobalObject.h:
2162 2008-01-12 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2166 Fixes a problem with the ActivationImp tear-off patch (r29425) where
2167 some of the calls to JSGlobalObject::tearOffActivation() were using
2168 the wrong test to determine whether it should leave a relic behind.
2171 (KJS::FunctionImp::argumentsGetter):
2172 (KJS::ActivationImp::getOwnPropertySlot):
2174 2008-01-11 Geoffrey Garen <ggaren@apple.com>
2176 Reviewed by Oliver Hunt.
2178 Fixed <rdar://problem/5665251> REGRESSION (r28880-r28886): Global
2179 variable access (16644)
2181 This bug was caused by var declarations shadowing built-in properties of
2184 To match Firefox, we've decided that var declarations will never shadow
2185 built-in properties of the global object or its prototypes. We used to
2186 behave more like IE, which allows shadowing, but walking that line got
2187 us into trouble with websites that sent us down the Firefox codepath.
2189 * kjs/JSVariableObject.h:
2190 (KJS::JSVariableObject::symbolTableGet): New code to support calling
2191 hasProperty before the variable object is fully initialized (so you
2192 can call it during initialization).
2195 (KJS::ProgramNode::initializeSymbolTable): Always do a full hasProperty
2196 check when looking for duplicates, not getDirect, since it only checks
2197 the property map, and not hasOwnProperty, since it doesn't check
2199 (KJS::EvalNode::processDeclarations): ditto
2201 * kjs/property_slot.h:
2202 (KJS::PropertySlot::ungettableGetter): Best function name evar.
2204 2008-01-11 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2208 Optimized ActivationImp allocation, so that activation records are now
2209 first allocated on an explicitly managed stack and only heap allocated
2210 when necessary. Roughly a 5% improvement on SunSpider, and a larger
2211 improvement on benchmarks that use more function calls.
2213 * JavaScriptCore.xcodeproj/project.pbxproj:
2214 * kjs/Activation.h: Added.
2215 (KJS::ActivationImp::ActivationData::ActivationData):
2216 (KJS::ActivationImp::ActivationImp):
2217 (KJS::ActivationImp::classInfo):
2218 (KJS::ActivationImp::isActivationObject):
2219 (KJS::ActivationImp::isOnStack):
2220 (KJS::ActivationImp::d):
2221 (KJS::StackActivation::StackActivation):
2222 * kjs/ExecState.cpp:
2223 (KJS::ExecState::ExecState):
2224 (KJS::ExecState::~ExecState):
2226 (KJS::ExecState::replaceScopeChainTop):
2227 (KJS::ExecState::setActivationObject):
2228 (KJS::ExecState::setLocalStorage):
2229 * kjs/JSGlobalObject.cpp:
2230 (KJS::JSGlobalObject::reset):
2231 (KJS::JSGlobalObject::pushActivation):
2232 (KJS::JSGlobalObject::checkActivationCount):
2233 (KJS::JSGlobalObject::popActivationHelper):
2234 (KJS::JSGlobalObject::popActivation):
2235 (KJS::JSGlobalObject::tearOffActivation):
2236 * kjs/JSGlobalObject.h:
2237 * kjs/JSVariableObject.h:
2238 (KJS::JSVariableObject::JSVariableObjectData::JSVariableObjectData):
2239 (KJS::JSVariableObject::JSVariableObject):
2241 (KJS::FunctionImp::argumentsGetter):
2242 (KJS::ActivationImp::ActivationImp):
2243 (KJS::ActivationImp::~ActivationImp):
2244 (KJS::ActivationImp::init):
2245 (KJS::ActivationImp::getOwnPropertySlot):
2246 (KJS::ActivationImp::markHelper):
2247 (KJS::ActivationImp::mark):
2248 (KJS::ActivationImp::ActivationData::ActivationData):
2249 (KJS::GlobalFuncImp::callAsFunction):
2252 (KJS::PostIncResolveNode::evaluate):
2253 (KJS::PostDecResolveNode::evaluate):
2254 (KJS::PreIncResolveNode::evaluate):
2255 (KJS::PreDecResolveNode::evaluate):
2256 (KJS::ReadModifyResolveNode::evaluate):
2257 (KJS::AssignResolveNode::evaluate):
2258 (KJS::WithNode::execute):
2259 (KJS::TryNode::execute):
2260 (KJS::FunctionBodyNode::processDeclarations):
2261 (KJS::FuncExprNode::evaluate):
2263 * kjs/scope_chain.h:
2264 (KJS::ScopeChain::replace):
2265 * kjs/scope_chain_mark.h: Added.
2266 (KJS::ScopeChain::mark):
2268 2008-01-11 Simon Hausmann <hausmann@webkit.org>
2270 Reviewed by Mark Rowe.
2272 Fix the (clean) qmake build. For generating chartables.c we don't
2273 depend on a separate input source file anymore, the dftables perl
2274 script is enough. So use that instead as value for the .input
2275 variable, to ensure that qmake also generates a rule to call dftables.
2279 2008-01-10 Geoffrey Garen <ggaren@apple.com>
2281 Reviewed by John Sullivan.
2283 Fixed some world leak reports:
2284 * <rdar://problem/5669436> PLT complains about world leak of 1 JavaScript
2285 Interpreter after running cvs-base suite
2287 * <rdar://problem/5669423> PLT complains about world leak if browser
2288 window is open when PLT starts
2290 * kjs/collector.h: Added the ability to distinguish between global
2291 objects and GC-protected global objects, since we only consider the
2292 latter to be world leaks.
2293 * kjs/collector.cpp:
2295 2008-01-11 Mark Rowe <mrowe@apple.com>
2297 Silence qmake warning about ctgen lacking input.
2299 Rubber-stamped by Alp Toker.
2303 2008-01-10 David Kilzer <ddkilzer@apple.com>
2305 dftables should be rewritten as a script
2307 <http://bugs.webkit.org/show_bug.cgi?id=16818>
2308 <rdar://problem/5681463>
2312 Rewrote the dftables utility in Perl. Attempted to switch all
2313 build systems to call the script directly instead of building
2314 a binary first. Only the Xcode build was able to be tested.
2316 * DerivedSources.make: Added pcre directory to VPATH and changed
2317 to invoke dftables directly.
2318 * GNUmakefile.am: Removed build information and changed to invoke
2320 * JavaScriptCore.vcproj/JavaScriptCore.sln: Removed reference to
2322 * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln: Ditto.
2323 * JavaScriptCore.vcproj/dftables: Removed.
2324 * JavaScriptCore.vcproj/dftables/dftables.vcproj: Removed.
2325 * JavaScriptCore.xcodeproj/project.pbxproj: Removed dftables target.
2326 * jscore.bkl: Removed dftables executable definition.
2327 * pcre/dftables: Copied from JavaScriptCore/pcre/dftables.cpp.
2328 * pcre/dftables.cpp: Removed.
2329 * pcre/dftables.pro: Removed.
2330 * pcre/pcre.pri: Removed references to dftables.cpp and changed to
2331 invoke dftables directly.
2333 2008-01-10 Dan Bernstein <mitz@apple.com>
2335 Reviewed by Darin Adler.
2337 - fix http://bugs.webkit.org/show_bug.cgi?id=16782
2338 <rdar://problem/5675331> REGRESSION(r29266): Reproducible crash in fast/replaced/image-map.html
2340 The crash resulted from a native object (DumpRenderTree's
2341 EventSender) causing its wrapper to be invalidated (by clicking a
2342 link that replaced the document in the window) and consequently
2343 deallocated. The fix is to use RefPtrs to protect the native object
2344 from deletion by self-invalidation.
2346 * bindings/runtime_method.cpp:
2347 (RuntimeMethod::callAsFunction):
2348 * bindings/runtime_object.cpp:
2349 (RuntimeObjectImp::fallbackObjectGetter):
2350 (RuntimeObjectImp::fieldGetter):
2351 (RuntimeObjectImp::methodGetter):
2352 (RuntimeObjectImp::put):
2353 (RuntimeObjectImp::defaultValue):
2354 (RuntimeObjectImp::callAsFunction):
2356 2008-01-07 Mark Rowe <mrowe@apple.com>
2358 Reviewed by Maciej Stachowiak.
2360 Turn testIsInteger assertions into compile-time asserts and move them into HashTraits.h
2366 2008-01-07 Nikolas Zimmermann <zimmermann@kde.org>
2370 Enable SVG_FONTS by default.
2372 * Configurations/JavaScriptCore.xcconfig:
2374 2008-01-07 Darin Adler <darin@apple.com>
2376 Rubber stamped by David Kilzer.
2378 - get rid of empty fpconst.cpp
2380 * GNUmakefile.am: Remove fpconst.cpp.
2381 * JavaScriptCore.pri: Ditto.
2382 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto.
2383 * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
2384 * JavaScriptCoreSources.bkl: Ditto.
2386 * kjs/fpconst.cpp: Removed.
2388 2008-01-07 Darin Adler <darin@apple.com>
2390 Reviewed by David Kilzer.
2392 - fix alignment problem with NaN and Inf globals
2394 * kjs/fpconst.cpp: Move the contents of this file from here back to
2395 value.cpp. The reason this was in a separate file is that the DARWIN
2396 version of this used a declaration of the globals with a different
2397 type to avoid creating "init routines". That's no longer necessary for
2398 DARWIN and was never necessary for the non-DARWIN code path.
2399 To make this patch easy to merge, I didn't actually delete this file
2400 yet. We'll do that in a separate changeset.
2402 * kjs/value.cpp: If C99's NAN and INFINITY are present, then use them,
2403 othrewise use the union trick from fpconst.cpp. I think it would be
2404 better to eliminate KJS::NaN and KJS::Inf and just use NAN and INFINITY
2405 directly or std::numeric_limits<double>::quiet_nan() and
2406 std::numeric_limits<double>::infinity(). But when I tried that, it
2407 slowed down SunSpider. Someone else could do that cleanup if they
2408 could do it without slowing down the engine.
2410 2008-01-07 Adam Roben <aroben@apple.com>
2414 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Added
2415 JavaScript.h to the project.
2416 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
2417 Copy JavaScript.h to WEBKITOUTPUTDIR.
2419 2008-01-07 Timothy Hatcher <timothy@apple.com>
2430 * API/JavaScriptCore.h:
2432 * JavaScriptCore.xcodeproj/project.pbxproj:
2434 2008-01-07 Alp Toker <alp@atoker.com>
2438 http://bugs.webkit.org/show_bug.cgi?id=16029
2439 JavaScriptCore.h is not suitable for platforms other than Mac OS X
2441 Introduce a new JavaScriptCore/JavaScript.h public API header. This
2442 should be used by all new portable code using the JavaScriptCore API.
2444 JavaScriptCore/JavaScriptCore.h will remain for compatibility with
2445 existing applications that depend on it including JSStringRefCF.h
2446 which isn't portable.
2448 Also add minidom to the GTK+/autotools build since we can now support
2449 it on all platforms.
2453 * API/JavaScript.h: Added.
2454 * API/JavaScriptCore.h:
2455 * ForwardingHeaders/JavaScriptCore/JavaScript.h: Added.
2457 * JavaScriptCore.xcodeproj/project.pbxproj:
2459 2008-01-06 Eric Seidel <eric@webkit.org>
2463 Abstract all DateObject.set* functions in preparation for fixing:
2464 http://bugs.webkit.org/show_bug.cgi?id=16753
2466 SunSpider had random changes here and there but was overall a wash.
2468 * kjs/date_object.cpp:
2469 (KJS::fillStructuresUsingTimeArgs):
2470 (KJS::setNewValueFromTimeArgs):
2471 (KJS::setNewValueFromDateArgs):
2472 (KJS::DateProtoFuncSetMilliSeconds::callAsFunction):
2473 (KJS::DateProtoFuncSetUTCMilliseconds::callAsFunction):
2474 (KJS::DateProtoFuncSetSeconds::callAsFunction):
2475 (KJS::DateProtoFuncSetUTCSeconds::callAsFunction):
2476 (KJS::DateProtoFuncSetMinutes::callAsFunction):
2477 (KJS::DateProtoFuncSetUTCMinutes::callAsFunction):
2478 (KJS::DateProtoFuncSetHours::callAsFunction):
2479 (KJS::DateProtoFuncSetUTCHours::callAsFunction):
2480 (KJS::DateProtoFuncSetDate::callAsFunction):
2481 (KJS::DateProtoFuncSetUTCDate::callAsFunction):
2482 (KJS::DateProtoFuncSetMonth::callAsFunction):
2483 (KJS::DateProtoFuncSetUTCMonth::callAsFunction):
2484 (KJS::DateProtoFuncSetFullYear::callAsFunction):
2485 (KJS::DateProtoFuncSetUTCFullYear::callAsFunction):
2487 2008-01-06 Nikolas Zimmermann <zimmermann@kde.org>
2491 Add new helper function isArabicChar - SVG Fonts support needs it.
2493 * wtf/unicode/icu/UnicodeIcu.h:
2494 (WTF::Unicode::isArabicChar):
2495 * wtf/unicode/qt4/UnicodeQt4.h:
2496 (WTF::Unicode::isArabicChar):
2498 2008-01-06 Alp Toker <alp@atoker.com>
2500 Reviewed by Mark Rowe.
2502 Use $(EXEEXT) to account for the .exe extension in the GTK+ Windows
2503 build. (This is already done correctly in DerivedSources.make.) Issue
2504 noticed by Mikkel when building in Cygwin.
2506 Add a missing slash. This was a hack from the qmake build system that
2507 isn't necessary with autotools.
2511 2008-01-05 Darin Adler <darin@apple.com>
2513 * API/JSRetainPtr.h: One more file that needed the change below.
2515 2008-01-05 Darin Adler <darin@apple.com>
2517 * wtf/OwnPtr.h: OwnPtr needs the same fix as RefPtr below.
2519 2008-01-05 Adam Roben <aroben@apple.com>
2525 * wtf/RetainPtr.h: Use PtrType instead of T* because of the
2526 RemovePointer magic.
2528 2008-01-05 Darin Adler <darin@apple.com>
2530 Rubber stamped by Maciej Stachowiak.
2532 - cut down own PIC branches by using a pointer-to-member-data instead of a
2533 pointer-to-member-function in WTF smart pointers
2535 * wtf/OwnArrayPtr.h:
2540 Use a pointer to the m_ptr member instead of the get member.
2541 The GCC compiler generates better code for this idiom.
2543 2008-01-05 Henry Mason <hmason@mac.com>
2545 Reviewed by Maciej Stachowiak.
2547 http://bugs.webkit.org/show_bug.cgi?id=16738
2548 Bug 16738: Collector block offset could be stored as an cell offset instead of a byte offset
2550 Gives a 0.4% SunSpider boost and prettier code.
2552 * kjs/collector.cpp: Switched to cell offsets from byte offsets
2553 (KJS::Collector::heapAllocate):
2554 (KJS::Collector::sweep):
2556 2008-01-04 Mark Rowe <mrowe@apple.com>
2558 Reviewed by Maciej Stachowiak.
2560 Have the two malloc zones print useful diagnostics if their free method are unexpectedly invoked.
2561 Due to <rdar://problem/5671357> this can happen if an application attempts to free a pointer that
2562 was not allocated by any registered malloc zone on the system.
2564 * kjs/CollectorHeapIntrospector.h:
2565 * wtf/FastMalloc.cpp:
2567 2008-01-04 Alp Toker <alp@atoker.com>
2569 GTK+ autotools build fix. Terminate empty rules.
2573 2008-01-03 Simon Hausmann <hausmann@webkit.org>
2575 Reviewed by Mark Rowe.
2577 Fix compilation with gcc 4.3: limits.h is needed for INT_MAX.
2579 * pcre/pcre_exec.cpp:
2581 2008-01-03 Darin Adler <darin@apple.com>
2583 * tests/mozilla/expected.html: The fix for bug 16696 also fixed a test
2584 case, ecma_3/RegExp/perlstress-002.js, so updated results to expect
2585 that test to succeed.
2587 2008-01-02 Darin Adler <darin@apple.com>
2591 - fix http://bugs.webkit.org/show_bug.cgi?id=16696
2592 JSCRE fails fails to match Acid3 regexp
2594 Test: fast/regex/early-acid3-86.html
2596 The problem was with the cutoff point between backreferences and octal
2597 escape sequences. We need to determine the cutoff point by counting the
2598 total number of capturing brackets, which requires an extra pass through
2599 the expression when compiling it.
2601 * pcre/pcre_compile.cpp:
2602 (CompileData::CompileData): Added numCapturingBrackets. Removed some
2604 (compileBranch): Use numCapturingBrackets when calling checkEscape.
2605 (calculateCompiledPatternLength): Use numCapturingBrackets when calling
2606 checkEscape, and also store the bracket count at the end of the compile.
2607 (jsRegExpCompile): Call calculateCompiledPatternLength twice -- once to
2608 count the number of brackets and then a second time to calculate the length.
2610 2008-01-02 Darin Adler <darin@apple.com>
2614 - fix http://bugs.webkit.org/show_bug.cgi?id=16696
2615 JSCRE fails fails to match Acid3 regexp
2617 Test: fast/regex/early-acid3-86.html
2619 The problem was with the cutoff point between backreferences and octal
2620 escape sequences. We need to determine the cutoff point by counting the
2621 total number of capturing brackets, which requires an extra pass through
2622 the expression when compiling it.
2624 * pcre/pcre_compile.cpp:
2625 (CompileData::CompileData): Added numCapturingBrackets. Removed some
2627 (compileBranch): Use numCapturingBrackets when calling checkEscape.
2628 (calculateCompiledPatternLength): Use numCapturingBrackets when calling
2629 checkEscape, and also store the bracket count at the end of the compile.
2630 (jsRegExpCompile): Call calculateCompiledPatternLength twice -- once to
2631 count the number of brackets and then a second time to calculate the length.
2633 2008-01-02 David Kilzer <ddkilzer@webkit.org>
2635 Reviewed and landed by Darin.
2638 (KJS::DoWhileNode::execute): Added a missing return.
2640 2008-01-02 Darin Adler <darin@apple.com>
2642 - try to fix Qt build
2644 * wtf/unicode/qt4/UnicodeQt4.h:
2645 (WTF::Unicode::foldCase): Add some missing const.
2647 2008-01-02 Alice Liu <alice.liu@apple.com>
2649 Reviewed by Sam Weinig.
2651 need to export ASCIICType.h for use in DRT
2653 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
2655 (WTF::isASCIIUpper):
2657 2008-01-02 Sam Weinig <sam@webkit.org>
2659 Reviewed by Beth Dakin.
2661 Cleanup error_object.h/cpp.
2663 * kjs/JSGlobalObject.cpp:
2664 (KJS::JSGlobalObject::reset):
2665 * kjs/error_object.cpp:
2667 (KJS::ErrorInstance::ErrorInstance):
2668 (KJS::ErrorPrototype::ErrorPrototype):
2669 (KJS::ErrorProtoFuncToString::ErrorProtoFuncToString):
2670 (KJS::ErrorProtoFuncToString::callAsFunction):
2671 (KJS::ErrorObjectImp::ErrorObjectImp):
2672 (KJS::ErrorObjectImp::implementsConstruct):
2673 (KJS::ErrorObjectImp::construct):
2674 (KJS::ErrorObjectImp::callAsFunction):
2675 (KJS::NativeErrorPrototype::NativeErrorPrototype):
2676 (KJS::NativeErrorImp::NativeErrorImp):
2677 (KJS::NativeErrorImp::implementsConstruct):
2678 (KJS::NativeErrorImp::construct):
2679 (KJS::NativeErrorImp::callAsFunction):
2680 (KJS::NativeErrorImp::mark):
2681 * kjs/error_object.h:
2682 (KJS::ErrorInstance::classInfo):
2683 (KJS::NativeErrorImp::classInfo):
2685 2008-01-02 Mark Rowe <mrowe@apple.com>
2687 Rubber-stamped by Alp Toker.
2689 * GNUmakefile.am: Add missing dependency on grammar.y.
2691 2008-01-01 Darin Adler <darin@apple.com>
2695 - fix for http://bugs.webkit.org/show_bug.cgi?id=16695
2696 JSC allows non-identifier codepoints in identifiers (affects Acid3)
2698 Test: fast/js/kde/parse.html
2701 (KJS::Lexer::lex): Added additional states to distinguish Unicode escapes at the
2702 start of identifiers from ones inside identifiers. Rejected characters that don't pass
2703 the isIdentStart and isIdentPart tests.
2704 (KJS::Lexer::convertUnicode): Removed incorrect FIXME comment.
2706 * kjs/lexer.h: Added new states to distinguish \u escapes at the start of identifiers
2707 from \u escapes inside identifiers.
2709 2008-01-01 Darin Adler <darin@apple.com>
2711 - rolled scope chain optimization out; it was breaking the world
2713 2008-01-01 Darin Adler <darin@apple.com>
2717 - http://bugs.webkit.org/show_bug.cgi?id=16685
2718 eliminate List::empty() to cut down on PIC branches
2720 Also included one other speed-up -- remove the call to reserveCapacity from
2721 FunctionBodyNode::processDeclarations in all but the most unusual cases.
2723 Together these make SunSpider 1.016x as fast.
2725 * JavaScriptCore.exp: Updated.
2726 * kjs/ExecState.cpp:
2727 (KJS::globalEmptyList): Added. Called only when creating global ExecState
2729 (KJS::ExecState::ExecState): Broke constructor up into three separate functions,
2730 for the three separate node types. Also went through each of the three and
2731 streamlined as much as possible, removing dead code. This prevents us from having
2732 to access the global in the function body version of the constructor.
2734 * kjs/ExecState.h: Added emptyList(). Replaced the constructor with a set of
2735 three that are specific to the different node types that can create new execution
2738 * kjs/array_object.cpp:
2739 (KJS::ArrayProtoFuncToLocaleString::callAsFunction): Use exec->emptyList() instead
2741 (KJS::ArrayProtoFuncConcat::callAsFunction): Ditto.
2742 (KJS::ArrayProtoFuncSlice::callAsFunction): Ditto.
2743 (KJS::ArrayProtoFuncSplice::callAsFunction): Ditto.
2744 (KJS::ArrayProtoFuncFilter::callAsFunction): Ditto.
2746 (KJS::FunctionImp::callAsFunction): Updated to call new ExecState constructor.
2747 (KJS::GlobalFuncImp::callAsFunction): Ditto (for eval).
2748 * kjs/function_object.cpp:
2749 (FunctionObjectImp::construct): Use exec->emptyList() instead of List::empty().
2751 * kjs/list.cpp: Removed List::empty.
2752 * kjs/list.h: Ditto.
2755 (KJS::ElementNode::evaluate): Use exec->emptyList() instead of List::empty().
2756 (KJS::ArrayNode::evaluate): Ditto.
2757 (KJS::ObjectLiteralNode::evaluate): Ditto.
2758 (KJS::PropertyListNode::evaluate): Ditto.
2759 (KJS::FunctionBodyNode::processDeclarations): Another speed-up. Check the capacity
2760 before calling reserveCapacity, because it doesn't get inlined the local storage
2761 vector is almost always big enough -- saving the function call overhead is a big
2763 (KJS::FuncDeclNode::makeFunction): Use exec->emptyList() instead of List::empty().
2764 (KJS::FuncExprNode::evaluate): Ditto.
2766 (KJS::tryGetAndCallProperty): Ditto.
2767 * kjs/property_slot.cpp:
2768 (KJS::PropertySlot::functionGetter): Ditto.
2769 * kjs/string_object.cpp:
2770 (KJS::StringProtoFuncSplit::callAsFunction): Ditto.
2772 2008-01-01 Darin Adler <darin@apple.com>
2776 - fix http://bugs.webkit.org/show_bug.cgi?id=16648
2777 REGRESSION (r28165): Yuku.com navigation prints "jsRegExpExecute failed with result -2"
2778 <rdar://problem/5646486> REGRESSION (r28165): Layout test fast/regex/test1 fails intermittently
2780 Fixes 34 failing test cases in the fast/regex/test1.html test.
2782 Restored the stack which prevents infinite loops for brackets that match the empty
2783 string; it had been removed as an optimization.
2785 Unfortunately, restoring this stack causes the regular expression test in SunSpider
2786 to be 1.095x as slow and the overall test to be 1.004x as slow. Maybe we can find
2787 a correct optimization to restore the speed!
2789 It's possible the original change was on the right track but just off by one.
2791 * pcre/pcre_exec.cpp: Add back eptrblock, but name it BracketChainNode.
2792 (MatchStack::pushNewFrame): Add back the logic needed here.
2793 (startNewGroup): Ditto.
2796 2008-01-01 Darin Adler <darin@apple.com>
2800 - http://bugs.webkit.org/show_bug.cgi?id=16683
2801 speed up function calls by making ScopeChain::push cheaper
2803 This gives a 1.019x speedup on SunSpider.
2805 After doing this, I realized this probably will be obsolete when the optimization
2806 to avoid creating an activation object is done. When we do that one we should check
2807 if rolling this out will speed things up, since this does add overhead at the time
2808 you copy the scope chain.
2810 * kjs/object.h: Removed the ScopeChain::release function. It was
2811 marked inline, and called in exactly one place, so moved it there.
2812 No idea why it was in this header file!
2814 * kjs/scope_chain.cpp: Removed the overload of the ScopeChain::push
2815 function that takes another ScopeChain. It was unused. I think we used
2816 it over in WebCore at one point, but not any more.
2818 * kjs/scope_chain.h: Changed ScopeChainNode into a struct rather than
2819 a class, got rid of its constructor so we can have one that's uninitialized,
2820 and moved the refCount into a derived struct, ScopeChainHeapNode. Made _node
2821 mutable so it can be changed in the moveToHeap function. Changed the copy
2822 constructor and assignment operator to call moveToHeap, since the top node
2823 can't be shared when it's embedded in another ScopeChain object. Updated
2824 functions as needed to handle the case where the first object isn't on the
2825 heap or to add casts for cases where it's guaranteed to be. Changed the push
2826 function to always put the new node into the ScopeChain object; it will get
2827 put onto the heap when needed later.
2829 2008-01-01 Geoffrey Garen <ggaren@apple.com>
2831 Reviewed by Darin Adler.
2833 Fixed slight logic error in reserveCapacity, where we would reallocate
2834 the storage buffer unnecessarily.
2837 (WTF::::reserveCapacity): No need to grow the buffer if newCapacity is
2838 equal to capacity().
2840 2008-01-01 Darin Adler <darin@apple.com>
2844 - http://bugs.webkit.org/show_bug.cgi?id=16684
2845 eliminate debugger overhead from function body execution
2847 Speeds SunSpider up 1.003x. That's a small amount, but measurable.
2849 * JavaScriptCore.exp: Updated.
2851 (KJS::Parser::parse): Create the node with a static member function named create() instead
2852 of using new explicitly.
2854 * kjs/grammar.y: Changed calls to new FunctionBodyNode to use FunctionBodyNode::create().
2857 (KJS::ProgramNode::create): Added. Calls new.
2858 (KJS::EvalNode::create): Ditto.
2859 (KJS::FunctionBodyNode::create): Ditto, but creates FunctionBodyNodeWithDebuggerHooks
2860 when a debugger is present.
2861 (KJS::FunctionBodyNode::execute): Removed debugger hooks.
2862 (KJS::FunctionBodyNodeWithDebuggerHooks::FunctionBodyNodeWithDebuggerHooks): Added.
2863 (KJS::FunctionBodyNodeWithDebuggerHooks::execute): Calls the debugger, then the code,
2864 then the debugger again.
2866 * kjs/nodes.h: Added create functions, made the constructors private and protected.
2868 2007-12-30 Eric Seidel <eric@webkit.org>
2872 More small cleanup to array_object.cpp
2874 * kjs/array_object.cpp:
2875 (KJS::ArrayProtoFuncToString::callAsFunction):
2876 (KJS::ArrayProtoFuncToLocaleString::callAsFunction):
2877 (KJS::ArrayProtoFuncJoin::callAsFunction):
2878 (KJS::ArrayProtoFuncConcat::callAsFunction):
2879 (KJS::ArrayProtoFuncReverse::callAsFunction):
2880 (KJS::ArrayProtoFuncShift::callAsFunction):
2881 (KJS::ArrayProtoFuncSlice::callAsFunction):
2882 (KJS::ArrayProtoFuncSort::callAsFunction):
2883 (KJS::ArrayProtoFuncSplice::callAsFunction):
2884 (KJS::ArrayProtoFuncUnShift::callAsFunction):
2885 (KJS::ArrayProtoFuncFilter::callAsFunction):
2886 (KJS::ArrayProtoFuncMap::callAsFunction):
2887 (KJS::ArrayProtoFuncEvery::callAsFunction):
2889 2007-12-30 Eric Seidel <eric@webkit.org>
2893 Apply wkstyle to array_object.cpp
2895 * kjs/array_object.cpp:
2896 (KJS::ArrayPrototype::ArrayPrototype):
2897 (KJS::ArrayPrototype::getOwnPropertySlot):
2898 (KJS::ArrayProtoFuncConcat::callAsFunction):
2899 (KJS::ArrayProtoFuncPop::callAsFunction):
2900 (KJS::ArrayProtoFuncReverse::callAsFunction):
2901 (KJS::ArrayProtoFuncShift::callAsFunction):
2902 (KJS::ArrayProtoFuncSlice::callAsFunction):
2903 (KJS::ArrayProtoFuncSort::callAsFunction):
2904 (KJS::ArrayProtoFuncSplice::callAsFunction):
2905 (KJS::ArrayProtoFuncUnShift::callAsFunction):
2906 (KJS::ArrayProtoFuncFilter::callAsFunction):
2907 (KJS::ArrayProtoFuncMap::callAsFunction):
2908 (KJS::ArrayProtoFuncEvery::callAsFunction):
2909 (KJS::ArrayProtoFuncLastIndexOf::callAsFunction):
2910 (KJS::ArrayObjectImp::ArrayObjectImp):
2911 (KJS::ArrayObjectImp::implementsConstruct):
2912 (KJS::ArrayObjectImp::construct):
2913 (KJS::ArrayObjectImp::callAsFunction):
2915 2007-12-30 Eric Seidel <eric@webkit.org>
2919 Remove maxInt/minInt, replacing with std:max/min<int>()
2921 * kjs/array_object.cpp:
2922 (KJS::ArrayProtoFuncSplice::callAsFunction):
2923 * kjs/operations.cpp:
2926 2007-12-30 Eric Seidel <eric@webkit.org>
2930 Update Number.toString to properly throw exceptions.
2931 Cleanup code in Number.toString implementation.
2933 * kjs/number_object.cpp:
2934 (KJS::numberToString):
2936 (KJS::Error::create): Remove bogus debug lines.
2938 2007-12-28 Eric Seidel <eric@webkit.org>
2942 ASSERT when debugging via Drosera due to missed var lookup optimization.
2943 http://bugs.webkit.org/show_bug.cgi?id=16634
2945 No test case possible.
2948 (KJS::BreakpointCheckStatement::optimizeVariableAccess):
2951 2007-12-28 Eric Seidel <eric@webkit.org>
2955 Fix (-0).toFixed() and re-factor a little
2956 Fix (-0).toExponential() and printing of trailing 0s in toExponential
2957 Fix toPrecision(nan) handling
2958 http://bugs.webkit.org/show_bug.cgi?id=16640
2960 * kjs/number_object.cpp:
2961 (KJS::numberToFixed):
2962 (KJS::fractionalPartToString):
2963 (KJS::numberToExponential):
2964 (KJS::numberToPrecision):
2966 2007-12-28 Eric Seidel <eric@webkit.org>
2970 More changes to make number code readable
2972 * kjs/number_object.cpp:
2973 (KJS::integer_part_noexp):
2974 (KJS::numberToFixed):
2975 (KJS::numberToExponential):
2977 2007-12-28 Eric Seidel <eric@webkit.org>
2981 More small cleanups to toPrecision
2983 * kjs/number_object.cpp:
2984 (KJS::numberToPrecision):
2986 2007-12-28 Eric Seidel <eric@webkit.org>
2990 More small attempts to make number code readable
2992 * kjs/number_object.cpp:
2993 (KJS::exponentialPartToString):
2994 (KJS::numberToExponential):
2995 (KJS::numberToPrecision):
2997 2007-12-28 Eric Seidel <eric@webkit.org>
3001 Break out callAsFunction implementations into static functions
3003 * kjs/number_object.cpp:
3004 (KJS::numberToString):
3005 (KJS::numberToFixed):
3006 (KJS::numberToExponential):
3007 (KJS::numberToPrecision):
3008 (KJS::NumberProtoFunc::callAsFunction):
3010 2007-12-28 Eric Seidel <eric@webkit.org>
3014 Apply wkstyle/astyle and fix placement of *
3016 * kjs/number_object.cpp:
3018 (KJS::NumberInstance::NumberInstance):
3019 (KJS::NumberPrototype::NumberPrototype):
3020 (KJS::NumberProtoFunc::NumberProtoFunc):
3021 (KJS::integer_part_noexp):
3023 (KJS::NumberProtoFunc::callAsFunction):
3024 (KJS::NumberObjectImp::NumberObjectImp):
3025 (KJS::NumberObjectImp::getOwnPropertySlot):
3026 (KJS::NumberObjectImp::getValueProperty):
3027 (KJS::NumberObjectImp::implementsConstruct):
3028 (KJS::NumberObjectImp::construct):
3029 (KJS::NumberObjectImp::callAsFunction):
3031 (KJS::JSObject::put):
3033 2007-12-27 Eric Seidel <eric@webkit.org>
3037 ASSERT in JavaScriptCore while viewing WICD test case
3038 http://bugs.webkit.org/show_bug.cgi?id=16626
3041 (KJS::ForInNode::execute): move KJS_CHECK_EXCEPTION to proper place
3043 2007-12-26 Jan Michael Alonzo <jmalonzo@unpluggable.com>
3045 Reviewed by Alp Toker.
3047 http://bugs.webkit.org/show_bug.cgi?id=16390
3048 Use autotools or GNU make as the build system for the GTK port
3050 * GNUmakefile.am: Added.
3052 2007-12-25 Maciej Stachowiak <mjs@apple.com>
3056 - Remove unnecessary redundant check from property setting
3057 http://bugs.webkit.org/show_bug.cgi?id=16602
3059 1.3% speedup on SunSpider.
3062 (KJS::JSObject::put): Don't do canPut check when not needed; let
3063 the PropertyMap handle it.
3064 (KJS::JSObject::canPut): Don't check the static property
3065 table. lookupPut does that already.
3067 2007-12-24 Alp Toker <alp@atoker.com>
3069 Fix builds that don't use AllInOneFile.cpp following breakage
3070 introduced in r28973.
3074 2007-12-24 Maciej Stachowiak <mjs@apple.com>
3078 - Optimize variable declarations
3079 http://bugs.webkit.org/show_bug.cgi?id=16585
3081 3.5% speedup on SunSpider.
3083 var statements now result in either assignments or empty statements.
3085 This allows a couple of optimization opportunities:
3086 - No need to branch at runtime to check if there is an initializer
3087 - EmptyStatementNodes can be removed entirely (also done in this patch)
3088 - Assignment expressions get properly optimized for local variables
3090 This patch also includes some code cleanup:
3091 - Most of the old VarStatement/VarDecl logic is now only used for const declarations,
3092 thus it is renamed appropriately
3093 - AssignExprNode is gone
3095 * JavaScriptCore.exp:
3099 (KJS::SourceElements::append):
3100 (KJS::ConstDeclNode::ConstDeclNode):
3101 (KJS::ConstDeclNode::optimizeVariableAccess):
3102 (KJS::ConstDeclNode::handleSlowCase):
3103 (KJS::ConstDeclNode::evaluateSingle):
3104 (KJS::ConstDeclNode::evaluate):
3105 (KJS::ConstStatementNode::optimizeVariableAccess):
3106 (KJS::ConstStatementNode::execute):
3107 (KJS::VarStatementNode::optimizeVariableAccess):
3108 (KJS::VarStatementNode::execute):
3109 (KJS::ForInNode::ForInNode):
3110 (KJS::ForInNode::optimizeVariableAccess):
3111 (KJS::ForInNode::execute):
3112 (KJS::FunctionBodyNode::initializeSymbolTable):
3113 (KJS::ProgramNode::initializeSymbolTable):
3114 (KJS::FunctionBodyNode::processDeclarations):
3115 (KJS::ProgramNode::processDeclarations):
3116 (KJS::EvalNode::processDeclarations):
3118 (KJS::DeclarationStacks::):
3119 (KJS::StatementNode::):
3120 (KJS::ConstDeclNode::):
3121 (KJS::ConstStatementNode::):
3122 (KJS::EmptyStatementNode::):
3123 (KJS::VarStatementNode::):
3125 * kjs/nodes2string.cpp:
3126 (KJS::ConstDeclNode::streamTo):
3127 (KJS::ConstStatementNode::streamTo):
3128 (KJS::ScopeNode::streamTo):
3129 (KJS::VarStatementNode::streamTo):
3130 (KJS::ForNode::streamTo):
3131 (KJS::ForInNode::streamTo):
3133 2007-12-21 Mark Rowe <mrowe@apple.com>
3135 Reviewed by Oliver Hunt.
3137 * JavaScriptCore.exp: Remove unused symbol to prevent a weak external symbol
3138 being generated in JavaScriptCore.framework.
3140 2007-12-21 Darin Adler <darin@apple.com>
3142 Requested by Maciej.
3144 * kjs/nodes.h: Use the new NEVER_INLINE here and eliminate the old
3145 KJS_NO_INLINE. We don't want to have two, and we figured it was better
3146 to keep the one that's in WTF.
3148 2007-12-21 Darin Adler <darin@apple.com>
3152 - http://bugs.webkit.org/show_bug.cgi?id=16561
3153 remove debugger overhead from non-debugged JavaScript execution
3155 1.022x as fast on SunSpider.
3157 * JavaScriptCore.exp: Updated.
3159 * kjs/NodeInfo.h: Renamed SourceElementsStub to SourceElements,
3160 since that more accurately describes the role of this object, which
3161 is a reference-counted wrapper for a Vector.
3164 (KJS::Parser::didFinishParsing): Changed parameter type to SourceElements,
3165 and use plain assignment instead of set.
3166 * kjs/Parser.h: Changed parameter type of didFinishParsing to a
3167 SourceElements. Also changed m_sourceElements; we now use a RefPtr instead
3168 of an OwnPtr as well.
3170 * kjs/grammar.y: Got rid of all the calls to release() on SourceElements.
3171 That's now handed inside the constructors for various node types, since we now
3172 use vector swapping instead.
3175 (KJS::Node::rethrowException): Added NEVER_INLINE, because this was getting inlined
3176 and we want exception handling out of the normal code flow.
3177 (KJS::SourceElements::append): Moved here from the header. This now handles
3178 creating a BreakpointCheckStatement for each statement in the debugger case.
3179 That way we can get breakpoint handling without having it in every execute function.
3180 (KJS::BreakpointCheckStatement::BreakpointCheckStatement): Added.
3181 (KJS::BreakpointCheckStatement::execute): Added. Contains the code that was formerly
3182 in the StatementNode::hitStatement function and the KJS_BREAKPOINT macro.
3183 (KJS::BreakpointCheckStatement::streamTo): Added.
3184 (KJS::ArgumentListNode::evaluateList): Use KJS_CHECKEXCEPTIONVOID since the return
3186 (KJS::VarStatementNode::execute): Removed KJS_BREAKPOINT.
3187 (KJS::BlockNode::BlockNode): Changed parameter type to SourceElements.
3188 Changed code to use release since the class now contains a vector rather than
3190 (KJS::BlockNode::optimizeVariableAccess): Updated since member is now a vector
3191 rather than a vector pointer.
3192 (KJS::BlockNode::execute): Ditto.
3193 (KJS::ExprStatementNode::execute): Removed KJS_BREAKPOINT.
3194 (KJS::IfNode::execute): Ditto.
3195 (KJS::IfElseNode::execute): Ditto.
3196 (KJS::DoWhileNode::execute): Ditto.
3197 (KJS::WhileNode::execute): Ditto.
3198 (KJS::ContinueNode::execute): Ditto.
3199 (KJS::BreakNode::execute): Ditto.
3200 (KJS::ReturnNode::execute): Ditto.
3201 (KJS::WithNode::execute): Ditto.
3202 (KJS::CaseClauseNode::optimizeVariableAccess): Updated since member is now a vector
3203 rather than a vector pointer.
3204 (KJS::CaseClauseNode::executeStatements): Ditto.
3205 (KJS::SwitchNode::execute): Removed KJS_BREAKPOINT.
3206 (KJS::ThrowNode::execute): Ditto.
3207 (KJS::TryNode::execute): Ditto.
3208 (KJS::ScopeNode::ScopeNode): Changed parameter type to SourceElements.
3209 (KJS::ProgramNode::ProgramNode): Ditto.
3210 (KJS::EvalNode::EvalNode): Ditto.
3211 (KJS::FunctionBodyNode::FunctionBodyNode): Ditto.
3212 (KJS::ScopeNode::optimizeVariableAccess): Updated since member is now a vector
3213 rather than a vector pointer.
3215 * kjs/nodes.h: Removed hitStatement. Renamed SourceElements to StatementVector.
3216 Renamed SourceElementsStub to SourceElements and made it derive from
3217 ParserRefCounted rather than from Node, hold a vector rather than a pointer to
3218 a vector, and changed the release function to swap with another vector rather
3219 than the pointer idiom. Updated BlockNode and CaseClauseNode to hold actual
3220 vectors instead of pointers to vectors. Added BreakpointCheckStatement.
3222 * kjs/nodes2string.cpp:
3223 (KJS::statementListStreamTo): Changed to work on a vector instead of a pointer
3225 (KJS::BlockNode::streamTo): Ditto.
3226 (KJS::CaseClauseNode::streamTo): Ditto.
3228 * wtf/AlwaysInline.h: Added NEVER_INLINE.
3229 * wtf/PassRefPtr.h: Tweaked formatting. Added clear() function that matches the
3230 ones in OwnPtr and auto_ptr.
3231 * wtf/RefPtr.h: Ditto.
3233 2007-12-21 Darin Adler <darin@apple.com>
3235 - fix broken regression tests
3237 The broken tests were fast/js/do-while-expression-value.html and
3238 fast/js/while-expression-value.html.
3240 * kjs/nodes.cpp: Check in the correct version of this file. I had accidentally landed
3241 an old version of my patch for bug 16471.
3242 (KJS::statementListExecute): The logic here was backwards. Have to set the value
3243 even for non-normal execution results.
3245 2007-12-20 Alexey Proskuryakov <ap@webkit.org>
3249 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Copy npruntime_internal.h
3252 2007-12-20 Eric Seidel <eric@webkit.org>
3256 Split IfNode into IfNode and IfElseNode for speedup.
3257 http://bugs.webkit.org/show_bug.cgi?id=16470
3259 SunSpider claims this is 1.003x as fast as before.
3260 (This required running with --runs 15 to get consistent enough results to tell!)
3264 (KJS::IfNode::optimizeVariableAccess):
3265 (KJS::IfNode::execute):
3266 (KJS::IfNode::getDeclarations):
3267 (KJS::IfElseNode::optimizeVariableAccess):
3268 (KJS::IfElseNode::execute):
3269 (KJS::IfElseNode::getDeclarations):
3272 (KJS::IfElseNode::):
3273 * kjs/nodes2string.cpp:
3274 (KJS::IfNode::streamTo):
3275 (KJS::IfElseNode::streamTo):
3277 2007-12-20 Darin Adler <darin@apple.com>
3282 (WTF::operator==): Added.
3283 (WTF::operator!=): Added.
3285 2007-12-20 Geoffrey Garen <ggaren@apple.com>
3287 Reviewed by Oliver Hunt.
3289 AST optimization: Avoid NULL-checking ForNode's child nodes.
3291 0.6% speedup on SunSpider.
3293 This is a proof of concept patch that demonstrates how to optimize
3294 grammar productions with optional components, like
3296 for (optional; optional; optional) {
3300 The parser emits NULL for an optional component that is not present.
3302 Instead of checking for a NULL child at execution time, a node that
3303 expects an optional component to be present more often than not checks
3304 for a NULL child at construction time, and substitutes a viable
3305 alternative node in its place.
3307 (We'd like the parser to start emitting NULL a lot more once we teach
3308 it to emit NULL for certain no-op productions like EmptyStatement and
3309 VariableStatement, so, as a foundation, it's important for nodes with
3310 NULL optional components to be fast.)
3313 (KJS::Parser::didFinishParsing): Check for NULL SourceElements. Also,
3314 moved didFinishParsing into the .cpp file because adding a branch while
3315 it was in the header file caused a substantial and inexplicable
3316 performance regression. (Did I mention that GCC is crazy?)
3321 (KJS::BlockNode::BlockNode): Check for NULL SourceElements.
3322 (KJS::ForNode::optimizeVariableAccess): No need to check for NULL here.
3323 (KJS::ForNode::execute): No need to check for NULL here.
3325 (KJS::ForNode::): Check for NULL SourceElements. Substitute a TrueNode
3326 because it's semantically harmless, and it evaluates to boolean in an
3329 2007-12-20 Oliver Hunt <oliver@apple.com>
3333 Slight logic reordering in JSImmediate::from(double)
3335 This gives a 0.6% improvement in SunSpider.
3337 * kjs/JSImmediate.h:
3338 (KJS::JSImmediate::from):
3340 2007-12-20 Eric Seidel <eric@webkit.org>
3344 Fix major Array regression introduced by 28899.
3346 SunSpider claims this is at least 1.37x as fast as pre-regression. :)
3348 * kjs/array_instance.cpp: make Arrays fast again!
3350 2007-12-20 Eric Seidel <eric@webkit.org>
3352 Reviewed by Geoff, then re-rubber-stamped by Geoff after final search/replace and testing.
3354 Small reworking of Date code for 4% speedup on Date tests (0.2% overall)
3355 http://bugs.webkit.org/show_bug.cgi?id=16537
3357 Make msToYear human-readable
3358 Make msToDayInMonth slightly more readable and avoid recalculating msToYear
3359 Remove use of isInLeapYear to avoid calling msToYear
3360 Remove dayInYear call by changing msToDayInMonth to dayInMonthFromDayInYear
3361 Remove more duplicate calls to dayInYear and getUTCOffset for further speedup
3364 (KJS::daysFrom1970ToYear):
3366 (KJS::monthFromDayInYear):
3368 (KJS::dayInMonthFromDayInYear):
3369 (KJS::dateToDayInYear):
3370 (KJS::getDSTOffsetSimple):
3371 (KJS::getDSTOffset):
3372 (KJS::gregorianDateTimeToMS):
3373 (KJS::msToGregorianDateTime):
3375 2007-12-20 Rodney Dawes <dobey@wayofthemonkey.com>
3377 Reviewed by Darin Adler.
3379 Proxy includes of npruntime.h or npapi.h through npruntime_internal.h
3380 Include stdio.h in npapi.h for the use of FILE with XP_UNIX defined
3381 This is for building with X11, as some type and enum names conflict
3382 with #define names in X11 headers.
3383 http://bugs.webkit.org/show_bug.cgi?id=15669
3385 * JavaScriptCore.xcodeproj/project.pbxproj:
3386 * bindings/NP_jsobject.h:
3388 * bindings/npruntime.cpp:
3389 * bindings/npruntime_impl.h:
3390 * bindings/npruntime_priv.h:
3391 * bindings/npruntime_internal.h:
3392 * bindings/testbindings.cpp:
3393 * bindings/c/c_class.h:
3394 * bindings/c/c_runtime.h:
3395 * bindings/c/c_utility.h:
3397 2007-12-20 Darin Adler <darin@apple.com>
3399 - re-fix http://bugs.webkit.org/show_bug.cgi?id=16471
3400 Completions need to be smaller (or not exist at all)
3402 Same patch as last time with the test failures problem fixed.
3405 (KJS::GlobalFuncImp::callAsFunction): Make sure to check the completion
3406 type from newExec to see if the execute raised an exception.
3408 2007-12-20 Darin Adler <darin@apple.com>
3410 - roll out that last change -- it was causing test failures;
3411 I'll check it back in after fixing them
3413 2007-12-20 Darin Adler <darin@apple.com>
3417 - http://bugs.webkit.org/show_bug.cgi?id=16471
3418 Completions need to be smaller (or not exist at all)
3420 SuSpider shows 2.4% speedup.
3422 Stop using completions in the execution engine.
3423 Instead, the completion type and label target are both
3424 stored in the ExecState.
3426 * API/JSContextRef.cpp: Removed unneeded include of "completion.h".
3427 * bindings/runtime_method.cpp: Removed unused execute function.
3428 * bindings/runtime_method.h: Ditto.
3430 * kjs/ExecState.h: Added completionType, breakOrContinueTarget,
3431 setCompletionType, setNormalCompletion, setBreakCompletion,
3432 setContinueCompletion, setReturnValueCompletion, setThrowCompletion,
3433 setInterruptedCompletion, m_completionType, and m_breakOrContinueTarget.
3435 * kjs/completion.h: Removed constructor and getter for target
3436 for break and continue from Completion. This class is now only
3437 used for the public API to Interpreter and such.
3439 * kjs/date_object.h: Removed unused execute function.
3442 (KJS::FunctionImp::callAsFunction): Removed some unneeded
3443 exception processing. Updated to call the new execute function
3444 and to get the completion type from the ExecState. Merged in
3445 the execute function, which repeated some of the same logic and
3446 was called only from here.
3447 (KJS::GlobalFuncImp::callAsFunction): More of the same for eval.
3448 * kjs/function.h: Removed execute.
3450 * kjs/interpreter.cpp:
3451 (KJS::Interpreter::evaluate): Added code to convert the result of
3452 execut into a Completion.
3455 (KJS::Node::setErrorCompletion): Renamed from createErrorCompletion.
3456 Now sets the completion type in the ExecState.
3457 (KJS::Node::rethrowException): Now sets the completion type in the
3459 (KJS::StatementNode::hitStatement): Now sets the completion type in
3461 (KJS::VarStatementNode::execute): Updated to put completion type in
3462 the ExecState instead of a Completion object.
3463 (KJS::statementListExecute): Ditto. Also changed the for loop to use
3464 indices instead of iterators.
3465 (KJS::BlockNode::execute): Updated return type.
3466 (KJS::EmptyStatementNode::execute): Updated to put completion type in
3467 the ExecState instead of a Completion object.
3468 (KJS::ExprStatementNode::execute): Ditto.
3469 (KJS::IfNode::execute): Ditto.
3470 (KJS::DoWhileNode::execute): Ditto. Also streamlined the logic a little
3471 to make the normal case a little faster and moved the end outside the
3472 loop so that "break" can do a break.
3473 (KJS::WhileNode::execute): Ditto.
3474 (KJS::ForNode::execute): Ditto.
3475 (KJS::ForInNode::execute): Ditto.
3476 (KJS::ContinueNode::execute): Updated to put completion type in
3477 the ExecState instead of a Completion object.
3478 (KJS::BreakNode::execute): Ditto.
3479 (KJS::ReturnNode::execute): Ditto.
3480 (KJS::WithNode::execute): Ditto.
3481 (KJS::CaseClauseNode::executeStatements): Ditto. Also renamed to have
3482 execute in its name to reflect the fact that it's a member of the same
3483 family of functions.
3484 (KJS::CaseBlockNode::executeBlock): Ditto.
3485 (KJS::SwitchNode::execute): Ditto.
3486 (KJS::LabelNode::execute): Ditto.
3487 (KJS::ThrowNode::execute): Ditto.
3488 (KJS::TryNode::execute): Ditto.
3489 (KJS::ProgramNode::execute): Ditto.
3490 (KJS::EvalNode::execute): Ditto.
3491 (KJS::FunctionBodyNode::execute): Ditto.
3492 (KJS::FuncDeclNode::execute): Ditto.
3494 * kjs/nodes.h: Renamed setErrorCompletion to createErrorCompletion, made
3495 hitStatement protected, changed return value of execute to a JSValue,
3496 renamed evalStatements to executeStatements, and evalBlock to executeBlock.
3498 * kjs/number_object.h: Removed unused execute function.
3500 2007-12-20 Geoffrey Garen <ggaren@apple.com>
3505 (KJS::ProgramNode::processDeclarations):
3507 2007-12-20 Geoffrey Garen <ggaren@apple.com>
3509 Linux build fix: config.h has to come first.
3511 * kjs/error_object.cpp:
3513 2007-12-19 Geoffrey Garen <ggaren@apple.com>