JavaScriptCore:
[WebKit-https.git] / JavaScriptCore / ChangeLog
1 2006-04-04  Timothy Hatcher  <timothy@apple.com>
2
3         Reviewed by Darin.
4
5         The Debug and Release frameworks are now built with install paths relative to the build products directory.
6         This removes the need for other projects to build with -framework WebCore and -framework JavaScriptCore. 
7
8         * JavaScriptCore.xcodeproj/project.pbxproj:
9
10 2006-04-04  Eric Seidel  <eseidel@apple.com>
11
12         Reviewed by ggaren.
13
14         Fix win32 build.
15         Disable ASSERT redefinition warnings for now.
16
17         * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
18         * kxmlcore/Assertions.h:
19
20 2006-04-04  Bjrn Graf  <bjoern.graf@gmail.com>
21
22         Reviewed by ggaren & darin.  Landed by eseidel.
23
24         Integrate CURL version of gettimeofday
25         http://bugzilla.opendarwin.org/show_bug.cgi?id=7399
26         Disable crash report dialogs for testkjs.exe in Release mode
27         http://bugzilla.opendarwin.org/show_bug.cgi?id=8113
28
29         * kjs/testkjs.cpp:
30         (StopWatch::start):
31         (StopWatch::stop):
32         (StopWatch::getElapsedMS):
33         (main):
34         (kjsmain):
35
36 2006-04-04  Eric Seidel  <eseidel@apple.com>
37
38         Reviewed by mjs.
39
40         * kjs/number_object.cpp:
41         (NumberProtoFunc::callAsFunction): remove trunc() to fix win32.
42
43 2006-03-12  Maciej Stachowiak  <mjs@apple.com>
44
45         Reviewed by Darin.
46         
47         - fixed "toPrecision sometimes messes up the last digit on intel Macs"
48         http://bugzilla.opendarwin.org/show_bug.cgi?id=7748
49
50         * kjs/number_object.cpp:
51         (intPow10): Compute integer powers of 10 using exponentiation by squaring.
52         (NumberProtoFunc::callAsFunction): Use intPow10(n) in place of all pow(10.0, n),
53         plus a bit of refactoring.
54
55 2006-04-03  Darin Adler  <darin@apple.com>
56
57         - tweak config.h and Platform.h to try to get buildbot working
58           (making some small changes at the same time)
59
60         * kjs/config.h: Removed now-unneeded HAVE_ICU.
61         * kxmlcore/Platform.h: Tweak how platform gets set up. Move all the
62         USE stuff to the end.
63
64 2006-04-03  George Staikos   <staikos@opensource.apple.com>
65
66         Reviewed by Maciej.
67
68         Fix Win32 build breakage from previous commit, remove unused forward.
69
70 2006-04-03  George Staikos   <staikos@opensource.apple.com>
71
72         Reviewed by Maciej.
73
74         Implement a unicode abstraction layer to make JavaScriptCore much more
75         easily ported to other platforms without having to take in libicu.  Also
76         makes the unicode related code easier to understand.
77
78 2006-04-03  Timothy Hatcher  <timothy@apple.com>
79
80         Reviewed by Adele.
81
82         Fixes <rdar://problem/4498338> JavaScriptCore fails to compile for ppc64
83         Other 64 bit build fixes.
84
85         * kjs/collector.cpp:
86         (KJS::Collector::markOtherThreadConservatively): test for __DARWIN_UNIX03 and use __r1
87         * kjs/dtoa.cpp:
88         (Bigint::): cast PRIVATE_mem to unsigned to prevent warning
89         * bindings/jni/jni_utility.cpp:
90         (KJS::Bindings::getJavaVM): cast jniError to long to prevent format warning
91         (KJS::Bindings::getJNIEnv): cast jniError to long to prevent format warning
92         * bindings/runtime_root.cpp:
93         (KJS::Bindings::addNativeReference): cast CFDictionaryGetValue to unsigned long to prevent warning
94         (KJS::Bindings::removeNativeReference): cast CFDictionaryGetValue to unsigned long to prevent warning
95
96 2006-03-31  Darin Adler  <darin@apple.com>
97
98         Reviewed by Geoff.
99
100         - <rdar://problem/4395622> API: WebScriptObject.h incorrectly reports that -isSelectorExcludedFromWebScript returns NO by default
101
102         * bindings/objc/WebScriptObject.h: Fixed comment.
103
104 2006-03-31  Eric Seidel  <eseidel@apple.com>
105
106         Reviewed by mjs.
107
108         A bit more code cleanup.
109
110         * bindings/c/c_utility.cpp:
111         (KJS::Bindings::convertValueToNPVariant):
112         * bindings/objc/objc_runtime.mm:
113         (convertValueToObjcObject):
114         * bindings/objc/objc_utility.mm:
115         (KJS::Bindings::convertValueToObjcValue):
116         * kjs/function.cpp:
117         (KJS::GlobalFuncImp::callAsFunction):
118         * kjs/interpreter.cpp:
119         (KJS::ExecState::lexicalInterpreter):
120         * kjs/interpreter.h:
121         * kjs/operations.cpp:
122         (KJS::equal):
123
124 2006-03-30  Eric Seidel  <eseidel@apple.com>
125
126         Reviewed by anders.
127
128         Small code-style update.
129
130         * kjs/operations.cpp:
131         (KJS::isNaN):
132         (KJS::isInf):
133         (KJS::isPosInf):
134         (KJS::isNegInf):
135         (KJS::equal):
136         (KJS::strictEqual):
137         (KJS::relation):
138         (KJS::maxInt):
139         (KJS::minInt):
140         (KJS::add):
141         (KJS::mult):
142
143 2006-03-31  Anders Carlsson  <andersca@mac.com>
144
145         Reviewed by Maciej.
146
147         Make sure the GetterSetterImp objects are marked as well.
148         
149         * kjs/internal.cpp:
150         (KJS::GetterSetterImp::mark):
151         Call JSCell::mark().
152
153 2006-03-30  Eric Seidel  <eseidel@apple.com>
154
155         Reviewed by ggaren.
156
157         * kjs/nodes.h: Some various small style fixes.
158
159 2006-03-30  Eric Seidel  <eseidel@apple.com>
160
161         Reviewed by ggaren.
162
163         Clean-up style issues in node.h, remove redundant initializations.
164
165         * kjs/nodes.h:
166         (KJS::StatementNode::evaluate):
167         (KJS::ArrayNode::ArrayNode):
168         (KJS::ObjectLiteralNode::ObjectLiteralNode):
169         (KJS::ArgumentsNode::ArgumentsNode):
170         (KJS::NewExprNode::NewExprNode):
171         (KJS::CaseClauseNode::CaseClauseNode):
172         (KJS::FuncDeclNode::FuncDeclNode):
173
174 2006-03-30  Tim Omernick  <timo@apple.com>
175
176         Reviewed by Geoff.
177
178         <rdar://problem/4212626> REGRESSION: LIVECONNECT: JavaScript type for Java Strings is function,
179         not object
180
181         * bindings/runtime.h:
182         (KJS::Bindings::Instance::implementsCall):
183         New method.  Returns false by default.  Concrete subclasses can override this return true when
184         the bound object may be called as a function.
185         (KJS::Bindings::Instance::invokeDefaultMethod):
186         Since bound objects are no longer treated as functions by default, we can return jsUndefined()
187         here instead of in concrete subclasses that decide not to implement the default method
188         functionality.
189
190         * bindings/runtime_object.cpp:
191         (RuntimeObjectImp::implementsCall):
192         Don't assume that the bound object is a function; instead, let the object instance decide whether
193         it is callable.
194
195         * bindings/c/c_instance.h:
196         * bindings/c/c_instance.cpp:
197         (KJS::Bindings::CInstance::implementsCall):
198         The object is callable if its class has an invokeDefault function.
199
200         * bindings/objc/objc_instance.h:
201         * bindings/objc/objc_instance.mm:
202         (ObjcInstance::implementsCall):
203         The object is callable if the ObjC instance responds to -invokeDefaultMethodWithArguments:.
204
205         * bindings/jni/jni_instance.h:
206         * bindings/jni/jni_instance.cpp:
207         Moved bogus invokeDefaultMethod() to superclass.
208
209 2006-03-29  Geoffrey Garen  <ggaren@apple.com>
210
211         Reviewed by Darin.
212
213         - JavaScriptCore side of fix for <rdar://problem/4308243> 8F36 
214         Regression: crash in malloc_consolidate if you use a .PAC file
215
216         The crash was a result of threaded deallocation of thread-unsafe
217         objects. Pure JS objects are thread-safe because all JS execution
218         is synchronized through JSLock. However, JS objects that wrap WebCore 
219         objects are thread-unsafe because JS and WebCore execution are not 
220         synchronized.  That unsafety comes into play when the collector 
221         deallocates a JS object that wraps a WebCore object, thus causing the 
222         WebCore object to be deallocated.
223
224         The solution here is to have each JSCell know whether it is safe to
225         collect on a non-main thread, and to avoid collecting unsafe cells
226         when on a non-main thread.
227
228         We don't have a way to test PAC files yet, so there's no test
229         attached to this patch.
230
231         * kjs/collector.cpp:
232         (KJS::Collector::collect):
233         (1) Added the test "currentThreadIsMainThread || 
234         imp->m_destructorIsThreadSafe". 
235
236         * kjs/protect.h:
237         (KJS::gcProtectNullTolerant):
238         (KJS::gcUnprotectNullTolerant):
239         * kjs/value.h:
240         (KJS::JSCell::JSCell): The bools here must be bitfields, otherwise
241         m_destructorIsThreadSafe becomes another whole word, ruining the
242         collector optimizations we've made based on the size of a JSObject.
243         * kxmlcore/FastMalloc.cpp:
244         (KXMLCore::currentThreadIsMainThread):
245         (KXMLCore::fastMallocRegisterThread):
246         * kxmlcore/FastMalloc.h:
247
248 2006-03-28  Darin Adler  <darin@apple.com>
249
250         Reviewed by Geoff.
251
252         - change some code that resulted in init routines on Mac OS X -- if the framework has
253           init routines it will use memory and slow down applications that link with WebKit
254           even in cases where those applications don't use WebKit
255
256         * kjs/date_object.cpp: Changed constants that were derived by multiplying other constants
257         to use immediate numbers instead. Apparently, double constant expressions of the type we
258         had here are evaluated at load time.
259
260         * kjs/list.cpp: Can't use OwnArrayPtr in ListImp because of the global instances of
261         ListImp, so go back to using a plain old pointer.
262         (KJS::List::List): Set overflow to 0 when initializing ListImp.
263         (KJS::List::release): Replace a clear call with a delete and explicit set to 0.
264         (KJS::List::append): Use raw pointers, and do a delete [] instead of finessing it with
265         a swap of OwnArrayPtr.
266         (KJS::List::copyFrom): Remove now-unneeded get().
267         (KJS::List::copyTail): Ditto.
268
269         * kjs/ustring.cpp: Changed UString::Rep::empty initializer a bit so that it doesn't get
270         a static initializer routine. Had to get rid of one level of constant to get the compiler
271         to understand it could initialize without any code.
272
273         - added a build step that checks for init routines
274
275         * JavaScriptCore.xcodeproj/project.pbxproj: Deleted now-unused custom build rule that
276         was replaced by the generate-derived-sources script a while back. Added a custom build
277         phase that invokes the check-for-global-initializers script.
278
279 2006-03-28  Timothy Hatcher  <timothy@apple.com>
280
281         Reviewed by Eric.
282
283         fixes <rdar://problem/4458539> Unable to include Security(public) and WebKit(private) headers
284
285         * bindings/npapi.h: added #defines after the #ifndefs
286
287 2006-03-27  Maciej Stachowiak  <mjs@apple.com>
288
289         Reviewed by Anders.
290         
291         - fixed <rdar://problem/4489745> REGRESSION: Safari crashes at to display http://www.lgphilips-lcd.com/
292
293         * kjs/nodes.cpp:
294         (Node::deref): take into account the case where the extra refcount table was never created
295
296 2006-03-23  David Carson <dacarson@gmail.com>
297
298         Reviewed by Darin.
299         
300         - JSObject in LiveConnect not working.
301         http://bugzilla.opendarwin.org/show_bug.cgi?id=7917
302
303         * bindings/jni_jsobject.cpp:
304         (JavaJSObject::convertJObjectToValue): Was trying to retrieve the native pointer from the wrong base
305         class, and the GetFieldID was using the wrong signature.
306
307 2006-03-23  Darin Adler  <darin@apple.com>
308
309         Reviewed by Maciej.
310
311         - fix buildbot
312
313         * JavaScriptCore.xcodeproj/project.pbxproj: Change target name to JavaScriptCore (it was "include"!?).
314         Also add -Y 3 option for linker.
315
316 2006-03-23  Darin Adler  <darin@apple.com>
317
318         Reviewed by Maciej.
319
320         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7726
321           REGRESSION: orbitz calendar fails (JavaScript function serialization/parsing)
322
323         * kjs/object.h: Take function name, as well as source URL and line number, when
324         using the special overloaded construct for making functions.
325         * kjs/object.cpp: (KJS::JSObject::construct): Ditto.
326         * kjs/function_object.h: Ditto.
327         * kjs/function_object.cpp: (FunctionObjectImp::construct): Pass a name when
328         constructing the function rather than null. Use "anonymous" when making a
329         function using the default function constructor.
330
331         * kjs/nodes2string.cpp: (FuncDeclNode::streamTo): Put a line break just before
332         a function declaration.
333
334         - unrelated fix
335
336         * kxmlcore/HashMapPtrSpec.h: Add missing needed friend declaration.
337
338 2006-03-23  Darin Adler  <darin@apple.com>
339
340         Reviewed by Maciej.
341
342         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7805
343           LEAK: method name leaks in KJS::Bindings::CInstance::invokeMethod
344
345         * bindings/c/c_utility.h: Remove NPN_UTF16FromString declaration (not implemented).
346         * bindings/c/c_utility.cpp:
347         (KJS::Bindings::convertValueToNPVariant): Use DOUBLE_TO_NPVARIANT,
348         BOOLEAN_TO_NPVARIANT, VOID_TO_NPVARIANT, NULL_TO_NPVARIANT, and
349         OBJECT_TO_NPVARIANT. In the case of OBJECT, call _NPN_RetainObject in
350         one case and remove a _NPN_ReleaseObject in another because this
351         should return a retained value.
352         (KJS::Bindings::convertNPVariantToValue): Use NPVARIANT_TO_BOOLEAN,
353         NPVARIANT_TO_INT32, and NPVARIANT_TO_DOUBLE.
354
355         * bindings/c/c_runtime.h: Removed implementations of CMethod::name and
356         CField::name that called _NPN_UTF8FromIdentifier and hence leaked.
357         * bindings/c/c_runtime.cpp:
358         (KJS::Bindings::CMethod::name): Added. Returns the string from inside the
359         method object.
360         (KJS::Bindings::CField::name): Added. Returns the string from inside the
361         field object.
362         (KJS::Bindings::CField::valueFromInstance): Added call to _NPN_ReleaseVariantValue
363         on the result of getProperty after using it to fix a storage leak.
364         (KJS::Bindings::CField::setValueToInstance): Added call to _NPN_ReleaseVariantValue
365         after pasing a value to setProperty now that the conversion function does a retain.
366
367         * bindings/c/c_instance.cpp:
368         (KJS::Bindings::CInstance::invokeMethod): Changed to use Vector for a local
369         stack buffer. Removed special case for NPVARIANT_IS_VOID because the
370         convertNPVariantToValue function handles that properly.
371         (KJS::Bindings::CInstance::invokeDefaultMethod): Ditto.
372
373         * bindings/NP_jsobject.h: Formatting changes only.
374         * bindings/NP_jsobject.cpp:
375         (jsDeallocate): Changed parameter type so we don't need a function cast.
376         (_NPN_InvokeDefault): Use VOID_TO_NPVARIANT.
377         (_NPN_Invoke): Use NULL_TO_NPVARIANT and VOID_TO_NPVARIANT.
378         (_NPN_Evaluate): Use VOID_TO_NPVARIANT.
379         (_NPN_GetProperty): Use NULL_TO_NPVARIANT and VOID_TO_NPVARIANT.
380
381         * bindings/c/c_class.cpp: Formatting changes only.
382         * bindings/c/c_class.h: Formatting changes only.
383
384         * bindings/npruntime_priv.h: Removed obsolete and now-unused functions:
385         NPN_VariantIsVoid, NPN_VariantIsNull, NPN_VariantIsUndefined,
386         NPN_VariantIsBool, NPN_VariantIsInt32, NPN_VariantIsDouble,
387         NPN_VariantIsString, NPN_VariantIsObject, NPN_VariantToBool,
388         NPN_VariantToInt32, NPN_VariantToDouble, NPN_VariantToString,
389         NPN_VariantToStringCopy, NPN_VariantToObject, NPN_InitializeVariantAsVoid,
390         NPN_InitializeVariantAsNull, NPN_InitializeVariantAsUndefined,
391         NPN_InitializeVariantWithBool, NPN_InitializeVariantWithInt32,
392         NPN_InitializeVariantWithDouble, NPN_InitializeVariantWithString,
393         NPN_InitializeVariantWithObject, and NPN_InitializeVariantWithVariant.
394         * bindings/npruntime.cpp:
395         (getIntIdentifierDictionary): Don't bother creating custom callbacks for the
396         integer dictionary since the default behavior is fine for integers.
397
398 2006-03-23  Mark Rowe  <opendarwin.org@bdash.net.nz>
399
400         Reviewed and landed by Maciej.
401
402         - WebKit no longer builds with bison 2.1
403         http://bugzilla.opendarwin.org/show_bug.cgi?id=7923
404
405         * generate-derived-sources:  Handle generated header named either grammar.cpp.h
406         or grammar.hpp.
407
408 2006-03-22  Maciej Stachowiak  <mjs@apple.com>
409
410         - fix the build
411
412         * JavaScriptCore.xcodeproj/project.pbxproj:
413
414 2006-03-21  Maciej Stachowiak  <mjs@apple.com>
415
416         * kjs/generate-derived-sources: Set executable property.
417
418 2006-03-21  Maciej Stachowiak  <mjs@apple.com>
419
420         Reviewed by Darin.
421         
422         Ensure that generated source dependencies are handled properly, as follows:
423         
424         - Made an external script that generates the sources into a
425           DerivedSources dir in the build products directory.
426         - Added a new build target that builds all the generated sources
427           if needed. Sadly it has to be a target, not a phase for Xcode to notice changes.
428         - Added the DerivedSources dir in question to the include path.
429         - Added the new DerivedSources dir and its contents to the project as build-relative.
430         
431         * JavaScriptCore.xcodeproj/project.pbxproj:
432         * kjs/generate-derived-sources: Added. Based on the windows version - maybe someday they
433         can share more.
434
435 2006-03-11  Maciej Stachowiak  <mjs@apple.com>
436
437         Reviewed by Darin.
438         
439         - fixed "charAt layout test fails on intel macs; some NaNs are printed as -NaN"
440         http://bugzilla.opendarwin.org/show_bug.cgi?id=7745
441
442         * kjs/ustring.cpp:
443         (KJS::UString::from): Use "NaN" for all NaN values, regardless of sign.
444
445 2006-03-16  Maciej Stachowiak  <mjs@apple.com>
446
447         Reviewed by Darin.
448         
449         - tweaks to my change to redo KJS::Node refcounting
450
451         * kjs/nodes.cpp:
452         (Node::ref):
453         (Node::deref):
454         (Node::refcount):
455         (Node::clearNewNodes):
456         * kjs/nodes.h:
457
458 2006-03-16  Darin Adler  <darin@apple.com>
459
460         Reviewed by Maciej.
461
462         - fixed Vector so that you can pass a reference to something in the vector
463           to the append or insert functions
464
465         * kxmlcore/Vector.h:
466         (KXMLCore::Vector::expandCapacity): Added new overloads that take a pointer to adjust
467         and return the adjusted value of the pointer.
468         (KXMLCore::Vector::append): Pass a pointer when expanding the vector, and use it when
469         adding the new element. Makes the case where the element moves when the vector
470         is expanded work.
471         (KXMLCore::Vector::insert): Ditto.
472
473 2006-03-15  Eric Seidel  <eseidel@apple.com>
474
475         Reviewed by adele.
476
477         Build fix.
478
479         * kjs/date_object.cpp:
480         (KJS::DateProtoFunc::callAsFunction): use size() not "len()"
481
482 2006-03-15  Eric Seidel  <eseidel@apple.com>
483
484         Reviewed by mjs.
485
486         Fix CString copy constructor, fixes Date.parse("") on Win32.
487
488         * kjs/date_object.cpp:
489         (KJS::DateProtoFunc::callAsFunction):
490         * kjs/ustring.cpp:
491         (KJS::CString::CString):
492         (KJS::CString::operator=):
493
494 2006-03-13  Maciej Stachowiak  <mjs@apple.com>
495
496         Reviewed by Anders.
497         
498         - KJS::Node and KJS::StatementNode are bigger than they need to be
499         http://bugzilla.opendarwin.org/show_bug.cgi?id=7775
500
501         The memory usage of Node was reduced by 2 machine words per node:
502
503         - sourceURL was removed and only kept on FunctionBodyNode. The
504         source URL can only be distinct per function or top-level program node, 
505         and you always have one.
506         
507         - refcount was removed and kept in a separate hashtable when
508         greater than 1. newNodes set represents floating nodes with
509         refcount of 0. This helps because almost all nodes have a refcount of 1
510         for almost all of their lifetime.
511         
512         * bindings/runtime_method.cpp:
513         (RuntimeMethod::RuntimeMethod): Pass null body, added FIXME.
514         * kjs/Parser.cpp:
515         (KJS::clearNewNodes): New nodes are tracked in nodes.cpp now, but still clear
516         them at the appropriate time.
517         * kjs/context.h:
518         (KJS::ContextImp::currentBody): added; used to retrieve source URL and sid
519         for current code.
520         (KJS::ContextImp::pushIteration): moved here from LabelStack
521         (KJS::ContextImp::popIteration): ditto
522         (KJS::ContextImp::inIteration): ditto
523         (KJS::ContextImp::pushSwitch): ditto
524         (KJS::ContextImp::popSwitch): ditto
525         (KJS::ContextImp::inSwitch): ditto
526         * kjs/function.cpp:
527         (KJS::FunctionImp::FunctionImp): Add FunctionBodyNode* parameter.
528         (KJS::FunctionImp::callAsFunction): Pass body to ContextImp.
529         (KJS::FunctionImp::argumentsGetter): _context renamed to m_context.
530         (KJS::DeclaredFunctionImp::DeclaredFunctionImp): Pass body to superclass
531         constructor.
532         (KJS::GlobalFuncImp::callAsFunction): Pass progNode as body for ContextImp in
533         eval.
534         * kjs/function.h: Move body field from DeclaredFunctionImp to
535         FunctionImp.
536         * kjs/grammar.y: Change DBG; statements no longer have a sourceid.
537         * kjs/internal.cpp:
538         (KJS::ContextImp::ContextImp): Initialize new m_currentBody, m_iterationDepth
539         and m_switchDepth data members. New FunctionBodyNode* parameter - the
540         function body provides source URL and SourceId.
541         (KJS::InterpreterImp::mark): Use exception() function, not _exception directly.
542         (KJS::InterpreterImp::evaluate): Pass progNode to ContextImp constructor
543         to use as the body.
544         * kjs/internal.h:
545         (KJS::LabelStack::LabelStack): Remove iteration depth and switch depth;
546         statement label stacks don't need these and it bloats their size. Put them
547         in the ContextImp instead.
548         * kjs/interpreter.cpp:
549         (KJS::ExecState::lexicalInterpreter): Renamed _context to m_context.
550         * kjs/interpreter.h:
551         (KJS::ExecState::dynamicInterpreter): Renamed _context to m_context.
552         (KJS::ExecState::context): ditto
553         (KJS::ExecState::setException): Renamed _exception to m_exception
554         (KJS::ExecState::clearException): ditto
555         (KJS::ExecState::exception): ditto
556         (KJS::ExecState::hadException): ditto
557         (KJS::ExecState::ExecState): ditto both above renames
558         * kjs/nodes.cpp:
559         (Node::Node): Removed initialization of line, source URL and refcount. Add to
560         local newNodes set instead of involving parser.
561         (Node::ref): Instead of managing refcount directly, story refcount over 1 in a
562         HashCountedSet, and keep a separate HashSet of "floating" nodes with refcount
563         0.
564         (Node::deref): ditto
565         (Node::refcount): ditto
566         (Node::clearNewNodes): Destroy anything left in the new nodes set.
567         (currentSourceId): Inline helper to get sourceId from function body via context.
568         (currentSourceURL): ditto for sourceURL.
569         (Node::createErrorCompletion): use new helper
570         (Node::throwError): ditto
571         (Node::setExceptionDetailsIfNeeded): ditto
572         (StatementNode::StatementNode): remove initialization of l0 and sid, rename
573         l1 to m_lastLine.
574         (StatementNode::setLoc): Set own m_lastLine and Node's m_line.
575         (StatementNode::hitStatement): Get sid, first line, last line in the proper new ways.
576         (StatListNode::StatListNode): updated for setLoc changes
577         (BlockNode::BlockNode): ditto
578         (DoWhileNode::execute): excpect iteraton counts on ContextImp, not LabelStack
579         (WhileNode::execute): ditto
580         (ForNode::execute): ditto
581         (ForInNode::execute): ditto
582         (ContinueNode::execute): excpect inIteration on ContextImp, not LabelStack
583         (BreakNode::execute): excpect inIteration and inSwitch on ContextImp, not LabelStack
584         (SwitchNode::execute): expect switch counts on ContextImp, not LabelStack
585         (FunctionBodyNode::FunctionBodyNode): update for new setLoc
586         (FunctionBodyNode::processFuncDecl): reindent
587         (SourceElementsNode::SourceElementsNode): update for new setLoc
588         * kjs/nodes.h:
589         (KJS::Node::lineNo): Renamed _line to m_line
590         (KJS::StatementNode::firstLine): Use lineNo()
591         (KJS::StatementNode::lastLine): Renamed l1 to m_lastLine
592         (KJS::FunctionBodyNode::sourceId): added
593         (KJS::FunctionBodyNode::sourceURL): added
594         * kjs/testkjs.cpp:
595
596 2006-03-14  Geoffrey Garen  <ggaren@apple.com>
597
598         - Fixed <rdar://problem/4478239> string sort puts "closed" before 
599         "close"
600
601         Reviewed by Eric.
602
603         * kjs/ustring.cpp:
604         (KJS::compare): Inverted a < in order to treat the longer string as > 
605         the shorter string.
606
607 2006-03-12  Alexey Proskuryakov  <ap@nypop.com>
608
609         Reviewed by Maciej.
610
611         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7708
612         REGRESSION: Flash callback to JavaScript function not working.
613
614         Test: plugins/invoke.html
615
616         * bindings/c/c_utility.cpp:
617         (KJS::Bindings::convertUTF8ToUTF16): Return a correct string length.
618
619 2006-03-08  Eric Seidel  <eseidel@apple.com>
620
621         Reviewed by darin.
622
623         Partially fix JS on win32 by fixing hash table generation.
624
625         * kjs/create_hash_table: limit << results to 32 bits.
626         * kjs/testkjs.cpp:
627         (TestFunctionImp::callAsFunction):
628
629 2006-03-07  Darin Adler  <darin@apple.com>
630
631         * kxmlcore/Vector.h: Quick fix to try to get Windows compiling again.
632
633 2006-03-07  Darin Adler  <darin@apple.com>
634
635         Reviewed by Anders.
636
637         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7655
638           unwanted output while running layout tests
639
640         * kjs/lexer.cpp: (Lexer::lex): Turn off the "yylex: ERROR" message.
641         * kjs/regexp.cpp: (KJS::RegExp::RegExp): Remove the code to log errors from PCRE
642         to standard output. I think we should arrange for the error text to be in JavaScript
643         exceptions instead at some point.
644         * kxmlcore/Vector.h: Add a check for overflow so that we'll abort if we pass a
645         too-large size rather than allocating a buffer smaller than requested.
646
647 2006-03-06  David Carson <dacarson@gmail.com>
648
649         Reviewed by Darin, landed by ap.
650
651         - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=7582
652         c_utility.cpp contains CFString OS X platform-dependent code; should use ICU
653
654         Tested with test case from:
655         http://bugzilla.opendarwin.org/show_bug.cgi?id=5163
656
657         * bindings/c_utility.cpp
658         (convertUTF8ToUTF16): Changed to using Unicode converter from ICU, and manual Latin-1 conversion.
659         * icu/unicode/ucnv.h: Copied from WebCore.
660         * icu/unicode/ucnv_err.h: Ditto.
661         * icu/unicode/uenum.h: Ditto.
662
663 2006-03-05  Darin Adler  <darin@apple.com>
664
665         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Updated.
666
667 2006-03-06  Mitz Pettel  <opendarwin.org@mitzpettel.com>
668
669         Fix suggested by Alexey Proskuryakov <ap@nypop.com>, reviewed by Maciej and Hyatt.
670         
671         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7601
672           REGRESSION (r13089): Reproducible crash dereferencing a deallocated element on google image search
673
674         * kxmlcore/Platform.h: Corrected the define to enable USE(MULTIPLE_THREADS) on Mac OS X.
675
676 2006-03-05  Darin Adler  <darin@apple.com>
677
678         Reviewed by Maciej.
679
680         - http://bugzilla.opendarwin.org/show_bug.cgi?id=7616
681           get all references to KJS::Node out of internal.h
682
683         * JavaScriptCore.xcodeproj/project.pbxproj: Updated for file changes.
684
685         * kjs/Parser.cpp: Added.
686         * kjs/Parser.h: Added.
687
688         * kjs/internal.cpp: Removed the Parser class.
689         * kjs/internal.h: Ditto. Also removed unnecessary declarations of classes
690         not used in this header.
691
692         * kjs/nodes.h: Added an include of "Parser.h".
693         * kjs/function.h: Added a declaration of FunctionBodyNode.
694
695 2006-03-05  Geoffrey Garen  <ggaren@apple.com>
696
697         Reviewed by Maciej.
698
699         - JSC support for the fix for <rdar://problem/4467143> JavaScript 
700         enumeration of HTML element properties skips DOM node properties
701
702         * kjs/lookup.h: 
703         (1) Added the KJS_DEFINE_PROTOTYPE_WITH_PROTOTYPE macro. The 
704         class definiton macro needs to know about the prototype's prototype so 
705         that the class constructor properly sets it. 
706         (2) Removed the KJS_IMPLEMENT_PROTOTYPE_WITH_PARENT macro. The class
707         implementation macro does not need to know about the prototype's
708         prototype, since getOwnPropertySlot should only look in the current 
709         object's property map, and not its prototype's.
710
711 2006-03-05  Andrew Wellington  <proton@wiretapped.net>
712
713         Reviewed by Eric, landed by ap.
714         
715         - Remove unused breakpoint bool from StatementNodes. No test provided as
716         there is no functionality change.
717
718         * kjs/nodes.cpp:
719         (StatementNode::StatementNode):
720         * kjs/nodes.h:
721
722 2006-03-03  Geoffrey Garen  <ggaren@apple.com>
723
724         Reviewed by Darin.
725
726         - Fixed <rdar://problem/4465598> REGRESSION (TOT): Crash occurs at 
727         http://maps.google.com/?output=html ( KJS::Identifier::add(KJS::UString::Rep*)
728
729         This regression was caused by my fix for 4448098. I failed to account for the
730         deleted entry sentinel in the mehtod that saves the contents of a property map to 
731         the back/forward cache.
732
733         Manual test in WebCore/manual-tests/property-map-save-crash.html
734
735         * kjs/property_map.cpp:
736         (KJS::deletedSentinel): Use 1 instead of -1 to facilitate an easy bit mask
737         (KJS::isValid): New function: checks if a key is null or the deleted sentinel
738         (KJS::PropertyMap::~PropertyMap): Fixed up the branch logic here for readability
739         and a slight performance win
740         (KJS::PropertyMap::clear):
741         (KJS::PropertyMap::rehash):
742         (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList):
743         (KJS::PropertyMap::save): Check keys with isValid()
744
745 2006-03-02  Maciej Stachowiak  <mjs@apple.com>
746
747         - now fix mac build again
748
749         * kjs/identifier.cpp:
750
751 2006-03-02  Maciej Stachowiak  <mjs@apple.com>
752
753         Rubber stamped by Anders and Eric.
754
755         - add fpconst.cpp to win32 build, it is now needed
756
757         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
758         * kjs/fpconst.cpp:
759
760 2006-03-02  Maciej Stachowiak  <mjs@apple.com>
761
762         Reviewed by Eric.
763
764         - fix windows build, broken by my last patch
765
766         * kjs/JSImmediate.cpp:
767         * kjs/identifier.cpp:
768         * kxmlcore/FastMalloc.cpp:
769         * kxmlcore/Platform.h:
770
771 2006-03-01  Maciej Stachowiak  <mjs@apple.com>
772
773         Reviewed by Darin.
774         
775         - Set up new prototype macros and avoid using #if without defined() in JSC
776         
777         Added new PLATFORM macros and related, to make sure #if's all check if relevant macros
778         are defined, and to separate core OS-level dependencies from operating environment
779         dependencies so you can, e.g., build KDE on Mac or Windows.
780
781         * kxmlcore/Platform.h: Added.
782
783         - deploy them everywhere in JavaScriptCore
784         
785         * JavaScriptCore.xcodeproj/project.pbxproj:
786         * bindings/jni/jni_utility.cpp:
787         (KJS::Bindings::convertValueToJValue):
788         * bindings/objc/WebScriptObject.mm:
789         * bindings/objc/objc_instance.mm:
790         (ObjcInstance::end):
791         * bindings/softlinking.h:
792         * bindings/testbindings.mm:
793         (main):
794         * kjs/JSLock.cpp:
795         * kjs/collector.cpp:
796         (KJS::Collector::markCurrentThreadConservatively):
797         (KJS::Collector::markOtherThreadConservatively):
798         (KJS::Collector::markStackObjectsConservatively):
799         * kjs/config.h:
800         * kjs/date_object.cpp:
801         (gmtoffset):
802         (KJS::formatTime):
803         (KJS::DateProtoFunc::callAsFunction):
804         (KJS::DateObjectImp::construct):
805         (KJS::makeTime):
806         * kjs/dtoa.cpp:
807         * kjs/fpconst.cpp:
808         (KJS::sizeof):
809         (KJS::):
810         * kjs/grammar.y:
811         * kjs/identifier.cpp:
812         * kjs/internal.cpp:
813         * kjs/interpreter.cpp:
814         (KJS::Interpreter::evaluate):
815         (KJS::Interpreter::createLanguageInstanceForValue):
816         * kjs/interpreter.h:
817         * kjs/lookup.cpp:
818         * kjs/lookup.h:
819         * kjs/math_object.cpp:
820         * kjs/object.cpp:
821         * kjs/object.h:
822         * kjs/operations.cpp:
823         (KJS::isNaN):
824         (KJS::isInf):
825         (KJS::isPosInf):
826         (KJS::isNegInf):
827         * kjs/operations.h:
828         * kjs/regexp.cpp:
829         (KJS::RegExp::RegExp):
830         (KJS::RegExp::~RegExp):
831         (KJS::RegExp::match):
832         * kjs/regexp.h:
833         * kjs/testkjs.cpp:
834         (StopWatch::start):
835         (StopWatch::stop):
836         (StopWatch::getElapsedMS):
837         * kjs/ustring.cpp:
838         * kjs/ustring.h:
839         * kxmlcore/AlwaysInline.h:
840         * kxmlcore/Assertions.cpp:
841         * kxmlcore/Assertions.h:
842         * kxmlcore/FastMalloc.cpp:
843         (KXMLCore::):
844         * kxmlcore/FastMalloc.h:
845         * kxmlcore/FastMallocInternal.h:
846         * kxmlcore/HashTable.h:
847         * kxmlcore/TCPageMap.h:
848         * kxmlcore/TCSpinLock.h:
849         (TCMalloc_SpinLock::Lock):
850         (TCMalloc_SpinLock::Unlock):
851         (TCMalloc_SlowLock):
852         * kxmlcore/TCSystemAlloc.cpp:
853         (TCMalloc_SystemAlloc):
854         * os-win32/stdint.h:
855
856 2006-02-28  Geoffrey Garen  <ggaren@apple.com>
857
858         Reviewed by Darin.
859
860         - Fixed <rdar://problem/4448098> Switch PropertyMap deleted entry 
861         placeholder to -1 from UString::Rep::null
862
863         This turned out to be only a small speedup (.12%). That's within the 
864         margin of error for super accurate JS iBench, but Shark confirms the 
865         same, so I think it's worth landing.
866
867         FYI, I also confirmed that the single entry optimization in 
868         PropertyMap is a 3.2% speedup.
869
870         * kjs/property_map.cpp:
871         (KJS::PropertyMap::~PropertyMap):
872         (KJS::PropertyMap::clear):
873         (KJS::PropertyMap::put):
874         (KJS::PropertyMap::insert):
875         (KJS::PropertyMap::rehash):
876         (KJS::PropertyMap::remove):
877         (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList):
878         (KJS::PropertyMap::checkConsistency):
879         * kjs/property_map.h:
880         (KJS::PropertyMap::deletedSentinel):
881
882 2006-02-27  Eric Seidel  <eseidel@apple.com>
883
884         Rubber-stamped by darin.
885
886         Remove fpconst.cpp, unused on win32 and the cause of linker warnings.
887
888         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
889
890 2006-02-27  Eric Seidel  <eseidel@apple.com>
891
892         Reviewed by mjs.
893
894         Fix Assertions.cpp to compile on win32.
895
896         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
897         * kxmlcore/Assertions.cpp:
898
899 2006-02-27  Eric Seidel  <eseidel@apple.com>
900
901         Reviewed by mjs.
902
903         Made Assertions.cpp platform independent.
904         Moved mac-specific logging logic up into WebCore.
905         http://bugzilla.opendarwin.org/show_bug.cgi?id=7503
906
907         * JavaScriptCore.xcodeproj/project.pbxproj:
908         * kxmlcore/Assertions.cpp: Added.
909         * kxmlcore/Assertions.h:
910         * kxmlcore/Assertions.mm: Removed.
911
912 2006-02-27  Darin Adler  <darin@apple.com>
913
914         - fixed Mac Debug build, there was an unused parameter
915
916         * kxmlcore/FastMalloc.cpp: (KXMLCore::fastMallocRegisterThread):
917         Remove parameter name.
918
919         * kjs/debugger.h: Fixed comment.
920
921 2006-02-27  Eric Seidel  <eseidel@apple.com>
922
923         Reviewed by darin.
924
925         * kxmlcore/Vector.h:
926         (KXMLCore::deleteAllValues): fix unused variable warning
927
928 2006-02-21  Maciej Stachowiak  <mjs@apple.com>
929
930         Reviewed by Darin.
931         
932         - Turn off -Wno-unused-param for JavaScriptCore and get rid of unused params
933         http://bugzilla.opendarwin.org/show_bug.cgi?id=7384
934
935         * JavaScriptCore.xcodeproj/project.pbxproj:
936         * bindings/NP_jsobject.cpp:
937         (jsAllocate):
938         (_NPN_InvokeDefault):
939         (_NPN_Evaluate):
940         (_NPN_GetProperty):
941         (_NPN_SetProperty):
942         (_NPN_RemoveProperty):
943         (_NPN_HasProperty):
944         (_NPN_HasMethod):
945         * bindings/c/c_class.h:
946         (KJS::Bindings::CClass::constructorAt):
947         * bindings/c/c_utility.cpp:
948         (KJS::Bindings::convertNPVariantToValue):
949         * bindings/jni/jni_class.cpp:
950         (JavaClass::methodsNamed):
951         (JavaClass::fieldNamed):
952         * bindings/jni/jni_instance.cpp:
953         (JavaInstance::invokeDefaultMethod):
954         * bindings/jni/jni_jsobject.cpp:
955         * bindings/jni/jni_objc.mm:
956         (-[NSObject KJS::Bindings::]):
957         * bindings/objc/WebScriptObject.mm:
958         (+[WebUndefined allocWithZone:]):
959         (-[WebUndefined initWithCoder:]):
960         (-[WebUndefined encodeWithCoder:]):
961         (-[WebUndefined copyWithZone:]):
962         * bindings/objc/objc_class.h:
963         (KJS::Bindings::ObjcClass::constructorAt):
964         * bindings/objc/objc_class.mm:
965         (KJS::Bindings::ObjcClass::methodsNamed):
966         (KJS::Bindings::ObjcClass::fallbackObject):
967         * bindings/objc/objc_instance.mm:
968         (ObjcInstance::getValueOfUndefinedField):
969         * bindings/objc/objc_runtime.mm:
970         (ObjcFallbackObjectImp::getOwnPropertySlot):
971         (ObjcFallbackObjectImp::put):
972         (ObjcFallbackObjectImp::canPut):
973         (ObjcFallbackObjectImp::deleteProperty):
974         (ObjcFallbackObjectImp::toBoolean):
975         * bindings/runtime.cpp:
976         (KJS::Bindings::Instance::createLanguageInstanceForValue):
977         * bindings/runtime.h:
978         (KJS::Bindings::Instance::getValueOfUndefinedField):
979         (KJS::Bindings::Instance::setValueOfUndefinedField):
980         * bindings/runtime_array.cpp:
981         (RuntimeArray::lengthGetter):
982         (RuntimeArray::indexGetter):
983         (RuntimeArray::put):
984         (RuntimeArray::deleteProperty):
985         * bindings/runtime_method.cpp:
986         (RuntimeMethod::lengthGetter):
987         (RuntimeMethod::execute):
988         * bindings/runtime_object.cpp:
989         (RuntimeObjectImp::fallbackObjectGetter):
990         (RuntimeObjectImp::fieldGetter):
991         (RuntimeObjectImp::methodGetter):
992         (RuntimeObjectImp::put):
993         (RuntimeObjectImp::canPut):
994         (RuntimeObjectImp::deleteProperty):
995         (RuntimeObjectImp::defaultValue):
996         (RuntimeObjectImp::callAsFunction):
997         * bindings/runtime_root.cpp:
998         (performJavaScriptAccess):
999         * kjs/array_object.cpp:
1000         (ArrayInstance::lengthGetter):
1001         (ArrayInstance::getOwnPropertySlot):
1002         (ArrayPrototype::ArrayPrototype):
1003         (ArrayPrototype::getOwnPropertySlot):
1004         * kjs/bool_object.cpp:
1005         (BooleanObjectImp::BooleanObjectImp):
1006         * kjs/date_object.cpp:
1007         (KJS::DateObjectFuncImp::DateObjectFuncImp):
1008         (KJS::DateObjectFuncImp::callAsFunction):
1009         * kjs/error_object.cpp:
1010         (ErrorObjectImp::ErrorObjectImp):
1011         (NativeErrorPrototype::NativeErrorPrototype):
1012         (NativeErrorImp::NativeErrorImp):
1013         * kjs/function.cpp:
1014         (KJS::FunctionImp::argumentsGetter):
1015         (KJS::FunctionImp::lengthGetter):
1016         (KJS::Arguments::mappedIndexGetter):
1017         (KJS::ActivationImp::argumentsGetter):
1018         (KJS::ActivationImp::put):
1019         * kjs/function_object.cpp:
1020         (FunctionObjectImp::FunctionObjectImp):
1021         * kjs/internal.cpp:
1022         (KJS::GetterSetterImp::toPrimitive):
1023         (KJS::GetterSetterImp::toBoolean):
1024         * kjs/interpreter.cpp:
1025         (KJS::Interpreter::evaluate):
1026         * kjs/interpreter.h:
1027         (KJS::Interpreter::isGlobalObject):
1028         (KJS::Interpreter::interpreterForGlobalObject):
1029         (KJS::Interpreter::isSafeScript):
1030         * kjs/lexer.cpp:
1031         (Lexer::makeIdentifier):
1032         (Lexer::makeUString):
1033         * kjs/lookup.h:
1034         (KJS::staticFunctionGetter):
1035         (KJS::staticValueGetter):
1036         * kjs/nodes.cpp:
1037         (StatementNode::processFuncDecl):
1038         (PropertyNode::evaluate):
1039         (PropertyNameNode::evaluate):
1040         * kjs/number_object.cpp:
1041         (NumberObjectImp::NumberObjectImp):
1042         (NumberObjectImp::getOwnPropertySlot):
1043         * kjs/object.cpp:
1044         (KJS::JSObject::defineGetter):
1045         (KJS::JSObject::defineSetter):
1046         (KJS::JSObject::hasInstance):
1047         (KJS::JSObject::propertyIsEnumerable):
1048         * kjs/object_object.cpp:
1049         (ObjectObjectImp::ObjectObjectImp):
1050         * kjs/property_slot.cpp:
1051         (KJS::PropertySlot::undefinedGetter):
1052         (KJS::PropertySlot::functionGetter):
1053         * kjs/reference.cpp:
1054         (KJS::Reference::getPropertyName):
1055         * kjs/reference_list.cpp:
1056         (ReferenceListIterator::operator++):
1057         * kjs/regexp_object.cpp:
1058         (RegExpObjectImp::RegExpObjectImp):
1059         (RegExpObjectImp::getValueProperty):
1060         (RegExpObjectImp::putValueProperty):
1061         * kjs/string_object.cpp:
1062         (StringInstance::lengthGetter):
1063         (StringInstance::indexGetter):
1064         (StringPrototype::StringPrototype):
1065         * kxmlcore/Assertions.mm:
1066         * kxmlcore/FastMalloc.cpp:
1067         (KXMLCore::TCMalloc_PageHeap::CheckList):
1068         * kxmlcore/HashTable.h:
1069         (KXMLCore::HashTableConstIterator::checkValidity):
1070         (KXMLCore::IdentityHashTranslator::translate):
1071         * pcre/pcre_get.c:
1072         (pcre_get_stringnumber):
1073
1074 2006-02-23  Darin Adler  <darin@apple.com>
1075
1076         - try to fix buildbot failure
1077
1078         * bindings/c/c_utility.cpp: Touch this file, which seems to not have been
1079         recompiled after additional inlining was introduced (Xcode bug?).
1080
1081 2006-02-23  Geoffrey Garen  <ggaren@apple.com>
1082
1083         Reviewed by Darin, Maciej.
1084
1085         - Inline some functions suggested by Shark. 2.9% speedup on super
1086         accurate JS iBench.
1087
1088         http://bugzilla.opendarwin.org/show_bug.cgi?id=7411
1089         <rdar://problem/4448116>
1090
1091         * kjs/nodes.h:
1092         (KJS::ArgumentsNode::evaluateList):
1093         * kjs/object.cpp:
1094         * kjs/object.h:
1095         (KJS::ScopeChain::release):
1096         (KJS::JSObject::toPrimitive):
1097         * kjs/scope_chain.cpp:
1098         * kjs/ustring.cpp:
1099         * kjs/ustring.h:
1100         (KJS::UString::toArrayIndex):
1101         * kjs/value.cpp:
1102         * kjs/value.h:
1103         (KJS::JSValue::toObject):
1104         * kxmlcore/FastMalloc.cpp:
1105         (KXMLCore::TCMalloc_ThreadCache_FreeList::Push):
1106         (KXMLCore::TCMalloc_ThreadCache_FreeList::Pop):
1107
1108 2006-02-21  Eric Seidel  <eseidel@apple.com>
1109
1110         Added *.user to ignore list.
1111
1112 2006-02-21  Eric Seidel  <eseidel@apple.com>
1113
1114         Reviewed by ggaren.
1115
1116         Add grammarWrapper.cpp to work around visual studio bug plaguing buildbot.
1117
1118         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1119         * JavaScriptCore.vcproj/JavaScriptCore/grammarWrapper.cpp: Added.
1120
1121 2006-02-21  Eric Seidel  <eseidel@apple.com>
1122
1123         Reviewed by ggaren.
1124
1125         * kjs/testkjs.cpp: #if out timeval code on win32
1126
1127 2006-02-21  Michael Emmel  <mike.emmel@gmail.com>
1128
1129         Reviewed by Darin.
1130
1131         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7397
1132           TCPageMap.h would not compile for me because string.h was missing
1133
1134         * kxmlcore/TCPageMap.h: Added <string.h> include.
1135
1136 2006-02-21  Darin Adler  <darin@apple.com>
1137
1138         Reviewed by John Sullivan.
1139
1140         - http://bugzilla.opendarwin.org/show_bug.cgi?id=7404
1141           remove a bunch of extra implementsCall overrides
1142
1143         * JavaScriptCore.xcodeproj/project.pbxproj: Sorted files.
1144
1145         * kjs/internal.h: Made InternalFunctionImp::callAsFunction pure virtual so that
1146         we'll get a compile error if some derived class neglects to implement it.
1147
1148         * kjs/function.cpp: (KJS::FunctionImp::FunctionImp): Remove unneeded initialization
1149         of param, which is an OwnPtr so it gets initialized by default.
1150
1151         * bindings/runtime_method.cpp:
1152         * bindings/runtime_method.h:
1153         * kjs/array_object.cpp:
1154         * kjs/array_object.h:
1155         * kjs/bool_object.cpp:
1156         * kjs/bool_object.h:
1157         * kjs/date_object.cpp:
1158         * kjs/date_object.h:
1159         * kjs/error_object.cpp:
1160         * kjs/error_object.h:
1161         * kjs/function.cpp:
1162         * kjs/function.h:
1163         * kjs/function_object.cpp:
1164         * kjs/function_object.h:
1165         * kjs/math_object.cpp:
1166         * kjs/math_object.h:
1167         * kjs/number_object.cpp:
1168         * kjs/number_object.h:
1169         * kjs/object_object.cpp:
1170         * kjs/object_object.h:
1171         * kjs/regexp_object.cpp:
1172         * kjs/regexp_object.h:
1173         * kjs/string_object.cpp:
1174         * kjs/string_object.h:
1175         Removed many rendundant implementations of implementsCall from subclasses of
1176         InternalFunctionImp.
1177
1178 2006-02-21  Darin Adler  <darin@apple.com>
1179
1180         - fixed build
1181
1182         * kjs/internal.cpp: (KJS::InternalFunctionImp::implementsCall):
1183         Oops, fixed name.
1184
1185 2006-02-21  Darin Adler  <darin@apple.com>
1186
1187         Change suggested by Mitz.
1188
1189         - http://bugzilla.opendarwin.org/show_bug.cgi?id=7402
1190           REGRESSION: Methods do not execute
1191
1192         * kjs/internal.h: Add implementsHasCall to InternalFunctionImp.
1193         * kjs/internal.cpp: (KJS::InternalFunctionImp::implementsHasCall):
1194         Return true. All the classes derived from InternalFunctionImp need
1195         to return true from this -- later we can remove all the extra
1196         implementations too.
1197
1198 2006-02-21  Maciej Stachowiak  <mjs@apple.com>
1199
1200         - fix build breakage caused by last-minute change to my patch
1201
1202         * kjs/lookup.h:
1203
1204 2006-02-20  Maciej Stachowiak  <mjs@apple.com>
1205
1206         Reviewed by Geoff and Darin.
1207         
1208         Patch from Maks Orlovich, based on work by David Faure, hand-applied and 
1209         significantly reworked by me.
1210         
1211         - Patch: give internal function names (KJS merge)
1212         http://bugzilla.opendarwin.org/show_bug.cgi?id=6279
1213
1214         * tests/mozilla/expected.html: Updated for newly fixed test.
1215
1216         * kjs/array_object.cpp:
1217         (ArrayProtoFunc::ArrayProtoFunc):
1218         * kjs/array_object.h:
1219         * kjs/bool_object.cpp:
1220         (BooleanPrototype::BooleanPrototype):
1221         (BooleanProtoFunc::BooleanProtoFunc):
1222         * kjs/bool_object.h:
1223         * kjs/date_object.cpp:
1224         (KJS::DateProtoFunc::DateProtoFunc):
1225         (KJS::DateObjectImp::DateObjectImp):
1226         (KJS::DateObjectFuncImp::DateObjectFuncImp):
1227         * kjs/error_object.cpp:
1228         (ErrorPrototype::ErrorPrototype):
1229         (ErrorProtoFunc::ErrorProtoFunc):
1230         * kjs/error_object.h:
1231         * kjs/function.cpp:
1232         (KJS::FunctionImp::FunctionImp):
1233         (KJS::GlobalFuncImp::GlobalFuncImp):
1234         * kjs/function.h:
1235         * kjs/function_object.cpp:
1236         (FunctionPrototype::FunctionPrototype):
1237         (FunctionProtoFunc::FunctionProtoFunc):
1238         (FunctionProtoFunc::callAsFunction):
1239         * kjs/function_object.h:
1240         * kjs/internal.cpp:
1241         (KJS::InterpreterImp::initGlobalObject):
1242         (KJS::InternalFunctionImp::InternalFunctionImp):
1243         * kjs/internal.h:
1244         (KJS::InternalFunctionImp::functionName):
1245         * kjs/lookup.h:
1246         (KJS::staticFunctionGetter):
1247         (KJS::HashEntryFunction::HashEntryFunction):
1248         (KJS::HashEntryFunction::implementsCall):
1249         (KJS::HashEntryFunction::toBoolean):
1250         (KJS::HashEntryFunction::implementsHasInstance):
1251         (KJS::HashEntryFunction::hasInstance):
1252         * kjs/math_object.cpp:
1253         (MathFuncImp::MathFuncImp):
1254         * kjs/math_object.h:
1255         * kjs/number_object.cpp:
1256         (NumberPrototype::NumberPrototype):
1257         (NumberProtoFunc::NumberProtoFunc):
1258         * kjs/number_object.h:
1259         * kjs/object.cpp:
1260         (KJS::JSObject::putDirectFunction):
1261         (KJS::Error::create):
1262         * kjs/object.h:
1263         * kjs/object_object.cpp:
1264         (ObjectPrototype::ObjectPrototype):
1265         (ObjectProtoFunc::ObjectProtoFunc):
1266         * kjs/object_object.h:
1267         * kjs/regexp_object.cpp:
1268         (RegExpPrototype::RegExpPrototype):
1269         (RegExpProtoFunc::RegExpProtoFunc):
1270         * kjs/regexp_object.h:
1271         * kjs/string_object.cpp:
1272         (StringProtoFunc::StringProtoFunc):
1273         (StringObjectImp::StringObjectImp):
1274         (StringObjectFuncImp::StringObjectFuncImp):
1275         * kjs/string_object.h:
1276         
1277 2006-02-20  Geoffrey Garen  <ggaren@apple.com>
1278
1279         Reviewed by Darin, with help from Eric, Maciej.
1280
1281         - More changes to support super-accurate JS iBench. Doesn't work on 
1282         Windows. (Doesn't break Windows, either.) I've filed [http://bugzilla.
1283         opendarwin.org/show_bug.cgi?id= 7399] about that. 
1284
1285         * kjs/interpreter.cpp:
1286         (KJS::Interpreter::evaluate): Print line numbers with exception output
1287         * kjs/testkjs.cpp: Changed " *" to "* " because Eric says that's the 
1288         way we roll with .cpp files.
1289         (StopWatch::StopWatch): New class. Provides microsecond-accurate 
1290         timings.
1291         (StopWatch::~StopWatch):
1292         (StopWatch::start):
1293         (StopWatch::stop):
1294         (StopWatch::getElapsedMS):
1295         (TestFunctionImp::callAsFunction): Added missing return statement. 
1296         Fixed up "run" to use refactored helper functions. Removed bogus 
1297         return statement from "quit" case. Made "print" output to stdout 
1298         instead of stderr because that makes more sense, and PERL handles 
1299         stdout better.
1300         (main): Factored out KXMLCore unit tests. Removed custom exception 
1301         printing code because the interpreter prints exceptions for you. Added 
1302         a "delete" call for the GlobalImp we allocate.
1303         (testIsInteger): New function, result of refacotring.
1304         (createStringWithContentsOfFile): New function, result of refactoring. 
1305         Renamed "code" to "buffer" to match factored-out-ness.
1306
1307 2006-02-20  Eric Seidel  <eseidel@apple.com>
1308
1309         Reviewed by hyatt.
1310
1311         Fix "Copy ICU DLLs..." phase.
1312
1313         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1314         * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
1315
1316 2006-02-19  Darin Adler  <darin@apple.com>
1317
1318         - renamed ERROR to LOG_ERROR to fix build
1319           presumably Maciej had this change and forgot to land it
1320
1321         * kjs/collector.cpp: Removed now-unneeded #undef ERROR.
1322         * kxmlcore/Assertions.h: Renamed ERROR to LOG_ERROR.
1323         * kxmlcore/FastMalloc.cpp: Changed MESSAGE macro to use LOG_ERROR.
1324
1325 2006-02-18  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1326
1327         Test: fast/js/toString-exception.html
1328
1329         Reviewed by Maciej.
1330
1331         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7343
1332           REGRESSION: fast/js/toString-overrides.html fails when run multiple times
1333
1334         * kjs/array_object.cpp:
1335         (ArrayProtoFunc::callAsFunction): Remove the object from the visited elements set before
1336         returning an error.
1337
1338 2006-02-18  Darin Adler  <darin@apple.com>
1339
1340         Reviewed by Maciej.
1341
1342         - http://bugzilla.opendarwin.org/show_bug.cgi?id=7345
1343           add insert and remove to KXMLCore::Vector
1344
1345         * kxmlcore/Vector.h: Added "moveOverlapping", which is used in both
1346         insert and remove to slide elements within the vector. Also added
1347         "insert" and "remove" functions.
1348
1349 2006-02-16  Geoffrey Garen  <ggaren@apple.com>
1350
1351         Reviewed by John.
1352
1353         - Fixed <rdar://problem/4448534> TOT REGRESSION: crash in KJS::
1354         Bindings::Instance::deref when leaving page @ gigaom.com
1355
1356         * bindings/c/c_instance.cpp:
1357         (KJS::Bindings::CInstance::~CInstance): Since we cache the class object
1358         globally, we shouldn't delete it, so don't.
1359
1360 2006-02-16  Timothy Hatcher  <timothy@apple.com>
1361
1362         Added -Wno-deprecated-declarations to all the ObjC binding files to prevent deprecation
1363         warnings. Using <rdar://problem/4448350> to track this.
1364
1365         * JavaScriptCore.xcodeproj/project.pbxproj:
1366         * bindings/objc/objc_jsobject.h: Removed empty file.
1367         * bindings/objc/objc_jsobject.mm: Removed empty file.
1368
1369 2006-02-16  Tim Omernick  <timo@apple.com>
1370
1371         Reviewed by Geoff.
1372
1373         <rdar://problem/4428609> Flash Player 8.0.22 can crash Safari (and WebKit apps) with
1374         javascript disabled (7015)
1375
1376         * bindings/NP_jsobject.cpp:
1377         (_NPN_CreateNoScriptObject):
1378         Returns an NPObject which is not bound to a JavaScript object.  This kind of NPObject
1379         can be given to a plugin as the "window script object" when JavaScript is disabled.
1380         The object has a custom NPClass, NPNoScriptObjectClass, which has no defined methods.
1381         Because of this, none of the NPN_* functions called by the plugin on this "no script
1382         object" will cause entry into JavaScript code.
1383         (_NPN_InvokeDefault):
1384         Make sure the NPVariant is filled before returning from this function.  This never
1385         mattered before because we never reached this case, having only created NPObjects of
1386         the class NPScriptObjectClass.
1387         (_NPN_Invoke):
1388         ditto
1389         (_NPN_Evaluate):
1390         ditto
1391         (_NPN_GetProperty):
1392         ditto
1393
1394         * bindings/NP_jsobject.h:
1395         Declared _NPN_CreateNoScriptObject().
1396
1397 2006-02-16  Darin Adler  <darin@apple.com>
1398
1399         Reviewed by me, change by Peter Kuemmel.
1400
1401         * kjs/operations.cpp: (KJS::isNegInf): Fix Windows code, which was
1402         checking for positive infinity (rolling in fix from KDE side).
1403
1404 2006-02-15  Geoffrey Garen  <ggaren@apple.com>
1405
1406         Reviewed by Maciej, Eric.
1407
1408         - WebCore half of fix for <rdar://problem/4176077> CrashTracer: 6569
1409         crashes in DashboardClient at com.apple.JavaScriptCore:
1410         KJS::Bindings::ObjcFallbackObjectImp::type()
1411
1412         WebCore and JavaScriptCore weren't sharing Instance objects very
1413         nicely. I made them use RefPtrs, and sent them to bed without dessert.
1414
1415         * bindings/jni/jni_instance.cpp: Made _instance a RefPtr
1416         (JavaInstance::~JavaInstance):
1417         (JObjectWrapper::JObjectWrapper):
1418         * bindings/jni/jni_instance.h:
1419         (KJS::Bindings::JObjectWrapper::ref):
1420         (KJS::Bindings::JObjectWrapper::deref):
1421         * bindings/jni/jni_runtime.cpp: Made _array a RefPtr
1422         (JavaArray::~JavaArray):
1423         (JavaArray::JavaArray):
1424         * bindings/jni/jni_runtime.h:
1425         (KJS::Bindings::JavaArray::operator=):
1426         * bindings/objc/objc_runtime.h:
1427         - Prohibited copying because that would muss the ref count.
1428         - Prohibited construction without instance because an instance wrapper
1429         without an instance is almost certainly a bug.
1430         * bindings/objc/objc_runtime.mm:
1431         (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
1432         * bindings/runtime.cpp:
1433         (KJS::Bindings::Instance::Instance):
1434         (KJS::Bindings::Instance::createBindingForLanguageInstance):
1435         (KJS::Bindings::Instance::createRuntimeObject):
1436         * bindings/runtime.h:
1437         (KJS::Bindings::Instance::ref):
1438         (KJS::Bindings::Instance::deref):
1439         * bindings/runtime_object.cpp:
1440         (RuntimeObjectImp::RuntimeObjectImp):
1441         (RuntimeObjectImp::fallbackObjectGetter):
1442         (RuntimeObjectImp::fieldGetter):
1443         (RuntimeObjectImp::methodGetter):
1444         (RuntimeObjectImp::getOwnPropertySlot):
1445         (RuntimeObjectImp::put):
1446         (RuntimeObjectImp::canPut):
1447         * bindings/runtime_object.h: 
1448         - Removed ownsInstance data member because RefPtr takes care of 
1449         instance lifetime now. 
1450         - Prohibited copying because that would muss the ref count.
1451         - Prohibited construction without instance because an instance wrapper
1452         without an instance is almost certainly a bug.
1453         (KJS::RuntimeObjectImp::getInternalInstance):
1454
1455 2006-02-15  Geoffrey Garen  <ggaren@apple.com>
1456
1457         Reviewed by John.
1458
1459         - Applied the 4330457 change to CClass and ObjcClass as well.
1460
1461         Once plugins work in DumpRenderTree, running run-webkit-tests --leaks
1462         will catch this. 
1463
1464         This change isn't as critical because CClass and ObjcClass objects get 
1465         cached globally and never deleted, but it's good practice, in case we 
1466         ever do decide to delete CClass and ObjcClass objects.
1467
1468         This change requires prohibiting copying, because we don't do any 
1469         intelligent ref-counting -- when a Class is destroyed, it destroys its 
1470         methods and fields unconditionally. (Java classes already prohibited
1471         copying.)
1472
1473         * bindings/c/c_class.cpp:
1474         - Merged _commonInit and _commonDelete into constructor and destructor.
1475         (CClass::CClass):
1476         (CClass::~CClass):
1477         (CClass::methodsNamed): Added delete callbacks
1478         (CClass::fieldNamed): Added delete callbacks
1479         * bindings/c/c_class.h: Prohibited copying
1480         * bindings/c/c_instance.cpp: 
1481         (KJS::Bindings::CInstance::getClass): Changed to use the preferred 
1482         class factory method, to take advantage of the global cache.
1483
1484         [ Repeated changes applied to CClass for ObjcClass: ]
1485
1486         * bindings/objc/objc_class.h: 
1487         * bindings/objc/objc_class.mm:
1488         (KJS::Bindings::ObjcClass::ObjcClass):
1489         (KJS::Bindings::ObjcClass::~ObjcClass):
1490         (KJS::Bindings::ObjcClass::methodsNamed):
1491         (KJS::Bindings::ObjcClass::fieldNamed):
1492         * bindings/objc/objc_runtime.h:
1493         (KJS::Bindings::ObjcMethod::ObjcMethod): Initialized uninitialized
1494         variable to prevent bad CFRelease.
1495         (KJS::Bindings::ObjcMethod::~ObjcMethod): Removed erroneous ';' from
1496         if statement to prevent bad CFRelease.
1497         * bindings/objc/objc_runtime.cpp: Changed to use the preferred
1498         ObjectStructPtr, for clarity.
1499
1500 2006-02-14  Geoffrey Garen  <ggaren@apple.com>
1501
1502         Reviewed by John.
1503
1504         - Fixed <rdar://problem/4330457> CrashTracer: [REGRESSION] 3763 crashes
1505         in Safari at com.apple.JavaScriptCore: KJS::Bindings::JavaInstance::
1506         getClass const + 56
1507
1508         Once plugins work in DumpRenderTree, running run-webkit-tests --leaks
1509         will catch this. 
1510
1511         This was a memory leak in the bindings code. The leak was so extreme
1512         that it would cause Safari or the JVM to abort from lack of memory.
1513         Upon construction, Class objects create field and method objects, 
1514         storing them in CFDictionaries. The bug was that upon destruction, the 
1515         class objects released the dictionaries but didn't destroy the stored 
1516         objects.
1517
1518         The fix is to supply CFDictionary callbacks for destroying the values
1519         added to the dictionary. 
1520         
1521         * bindings/jni/jni_class.cpp: 
1522         (JavaClass::JavaClass): Added delete callbacks
1523         * bindings/runtime.cpp: Added definitions for delete callbacks
1524         (KJS::Bindings::deleteMethodList):
1525         (KJS::Bindings::deleteMethod):
1526         (KJS::Bindings::deleteField):
1527         * bindings/runtime.h: Added declarations for delete callbacks
1528
1529 2006-02-14  Timothy Hatcher  <timothy@apple.com>
1530
1531         Reviewed by Justin.
1532
1533         Fixed <rdar://problem/4415050> STD: WebCore build steps use echo -n, which will change
1534         behavior due to POSIX version of sh
1535
1536         * JavaScriptCore.xcodeproj/project.pbxproj: removed the use of echo -n, replaced with printf ""
1537
1538 2006-02-13   Dave Hyatt <hyatt@apple.com>
1539
1540         Fix Win32 bustage in JavaScriptCore.
1541
1542         Reviewed by darin
1543
1544         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1545         Add JSImmediate to the Win32 project.
1546
1547         * kjs/JSImmediate.h:
1548         (KJS::JSImmediate::fromDouble):
1549         (KJS::JSImmediate::toDouble):
1550         (KJS::JSImmediate::NanAsBits):
1551         (KJS::JSImmediate::oneAsBits):
1552         Win32 needs explicit returns after abort() for non-void functions.
1553
1554         * kjs/testkjs.cpp:
1555         (run):
1556         Win32 catches a bug in testkjs!  The "return 2" should actually
1557         have been a return false.
1558
1559         * kjs/value.h:
1560         The extern decls of NaN and Inf need to be const.
1561
1562 === JavaScriptCore-521.7 ===
1563
1564 2006-02-13  Timothy Hatcher  <timothy@apple.com>
1565
1566         Reviewed by Darin.
1567
1568         Replaced the old NS_DURING exception blocking with @try/@catch.
1569
1570         * JavaScriptCorePrefix.h: undef try and catch to workaround a C++ conflict
1571         * bindings/objc/objc_instance.mm:
1572         (ObjcInstance::invokeMethod):
1573         (ObjcInstance::invokeDefaultMethod):
1574         (ObjcInstance::setValueOfUndefinedField):
1575         (ObjcInstance::getValueOfUndefinedField):
1576         * bindings/objc/objc_runtime.mm:
1577         (ObjcField::valueFromInstance):
1578         (ObjcField::setValueToInstance):
1579         (ObjcArray::setValueAt):
1580         (ObjcArray::valueAt):
1581
1582 2006-02-13  Darin Adler  <darin@apple.com>
1583
1584         - fix a couple problems building on Windows, based on requests
1585           from Krzysztof Kowalczyk <kkowalczyk@gmail.com>
1586
1587         * kjs/JSImmediate.h: Change code using non-standard u_int32/64_t types
1588         to the standard uint32/64_t. Also removed curious "isIEEE()" function
1589         that checked the sizes of some types (and type sizes alone don't tell you if
1590         the floating point conforms to the IEEE-standard). Added missing include
1591         of <stdint.h>.
1592
1593         * kjs/property_slot.h: Added missing include of <assert.h>.
1594
1595 2006-02-12  Geoffrey Garen  <ggaren@apple.com>
1596
1597         Reviewed by darin.
1598
1599         Cleaned up testkjs, added new "run" functionality to allow scripting 
1600         tests from within JS. ("run" is a part of my new super-accurate
1601         JS iBench.)
1602
1603         No regressions in run-javascriptcore-tests.
1604
1605         * kjs/testkjs.cpp:
1606         (GlobalImp::className):
1607         (TestFunctionImp::):
1608         (TestFunctionImp::callAsFunction):
1609         (main):
1610         (run):
1611
1612 2006-02-11  Alexey Proskuryakov  <ap@nypop.com>
1613
1614         Reviewed by Darin.
1615
1616         - improve fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=5163
1617         RealPlayer.GetTitle() Crashes Safari/Dashboard
1618
1619         * bindings/c/c_utility.cpp: (KJS::Bindings::convertUTF8ToUTF16):
1620         Use kCFStringEncodingISOLatin1 rather than kCFStringEncodingWindowsLatin1, 
1621         because the latter encoding has holes, and conversion can still fail.
1622
1623 2006-02-10  Geoffrey Garen  <ggaren@apple.com>
1624
1625         Reviewed by Darin.
1626
1627         - Inlined RefPtr assignment operators. .7% performance win on 
1628         super-accurate JS iBench.
1629
1630         * kxmlcore/RefPtr.h:
1631         (KXMLCore::::operator):
1632
1633 2006-02-10  Geoffrey Garen  <ggaren@apple.com>
1634
1635         No review needed, just a build fix. This time for sure.
1636
1637         * kjs/JSType.h:
1638
1639 2006-02-10  Geoffrey Garen  <ggaren@apple.com>
1640
1641         Reviewed by eric.
1642         
1643         - Fixed build. As it goes without saying, I will not mention that I
1644         blame Kevin.
1645
1646         * JavaScriptCore.xcodeproj/project.pbxproj:
1647         * kjs/JSImmediate.cpp:
1648         (KJS::JSImmediate::toObject):
1649
1650 2006-02-09  Geoffrey Garen  <ggaren@apple.com>
1651
1652         Reviewed by mjs.
1653
1654         - Fixed <rdar://problem/4343730> Should switch ConstantValues (null, 
1655         undefined, true, false) from JS objects to immediate values similar to
1656         SimpleNumber
1657
1658         2.0% performance gain on my new super-accurate version of JS iBench.
1659         (I promise to land a version of it soon.)
1660
1661         The gist of the change:
1662         (1) The SimpleNumber class (simple_number.h) is now the JSImmediate
1663         class (JSImmediate.h/.cpp), and it handles not only numbers but also 
1664         null, undefined, true, and false. 
1665         (2) JSImmediate provides convenience methods for the bit masking
1666         necessary to encode and decode immediate values.
1667         (3) ConstantValues, BooleanImp, NullImp, and UndefinedImp are gone.
1668         (4) JSCell no longer implements functions like getBoolean, because
1669         only a JSImmediate can be a boolean.
1670         (5) JSImmediate no longer uses ALWAYS_INLINE because there's no need,
1671         and ALWAYS_INLINE is a non-portable option of last resort.
1672         (6) Type is now JSType, and it resides in its own file, JSType.h.
1673         Since I was there, I did some header include sorting as part of this
1674         change.
1675
1676         The rest pretty much explains itself.
1677
1678         * JavaScriptCore.xcodeproj/project.pbxproj: Removed simple_number.h,
1679         added JSImmediate.h/.cpp.
1680         * bindings/c/c_instance.cpp:
1681         (KJS::Bindings::CInstance::defaultValue):
1682         * bindings/c/c_instance.h:
1683         * bindings/c/c_utility.cpp:
1684         (KJS::Bindings::convertValueToNPVariant):
1685         * bindings/jni/jni_instance.cpp:
1686         (JavaInstance::defaultValue):
1687         * bindings/jni/jni_instance.h:
1688         * bindings/jni/jni_jsobject.cpp:
1689         (JavaJSObject::convertValueToJObject):
1690         * bindings/objc/WebScriptObject.mm:
1691         (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:]):
1692         Standardized calls to use getXXX instead of hand-rolling JSValue 
1693         functionality.
1694         * bindings/objc/objc_instance.h:
1695         * bindings/objc/objc_instance.mm:
1696         (ObjcInstance::getValueOfUndefinedField):
1697         (ObjcInstance::defaultValue):
1698         * bindings/objc/objc_runtime.h:
1699         * bindings/objc/objc_runtime.mm:
1700         (ObjcFallbackObjectImp::type):
1701         (ObjcFallbackObjectImp::defaultValue):
1702         * bindings/runtime.h:
1703         (KJS::Bindings::Instance::getValueOfUndefinedField):
1704         * bindings/runtime_object.cpp:
1705         (RuntimeObjectImp::defaultValue):
1706         * bindings/runtime_object.h:
1707         * kjs/JSImmediate.h: Added.
1708         (KJS::JSImmediate::isImmediate):
1709         (KJS::JSImmediate::isNumber):
1710         (KJS::JSImmediate::isBoolean):
1711         (KJS::JSImmediate::isUndefinedOrNull):
1712         (KJS::JSImmediate::fromDouble):
1713         (KJS::JSImmediate::toDouble):
1714         (KJS::JSImmediate::toBoolean):
1715         (KJS::JSImmediate::trueImmediate):
1716         (KJS::JSImmediate::falseImmediate):
1717         (KJS::JSImmediate::NaNImmediate):
1718         (KJS::JSImmediate::undefinedImmediate):
1719         (KJS::JSImmediate::nullImmediate):
1720         (KJS::JSImmediate::tag):
1721         (KJS::JSImmediate::unTag):
1722         (KJS::JSImmediate::getTag):
1723         (KJS::JSImmediate::):
1724         (KJS::JSImmediate::isIEEE):
1725         (KJS::JSImmediate::is32bit):
1726         (KJS::JSImmediate::is64bit):
1727         (KJS::JSImmediate::NanAsBits):
1728         (KJS::JSImmediate::zeroAsBits):
1729         (KJS::JSImmediate::oneAsBits):
1730         * kjs/JSLock.cpp:
1731         (KJS::JSLock::lock): Removed hack-o-rama to initialize ConstantValues.
1732         * kjs/JSType.h: Added.
1733         * kjs/collector.cpp:
1734         (KJS::Collector::protect):
1735         (KJS::Collector::unprotect):
1736         (KJS::Collector::collect):
1737         * kjs/internal.cpp:
1738         (KJS::StringImp::toPrimitive):
1739         (KJS::NumberImp::toPrimitive):
1740         (KJS::NumberImp::toBoolean):
1741         (KJS::GetterSetterImp::toPrimitive):
1742         * kjs/internal.h:
1743         (KJS::StringImp::type):
1744         (KJS::NumberImp::type):
1745         * kjs/object.cpp:
1746         (KJS::JSObject::type):
1747         (KJS::tryGetAndCallProperty): Replaced "Are you one of the six things
1748         I'm looking for?" test with "Are you not the one thing I'm not looking
1749         for" test.
1750         (KJS::JSObject::defaultValue):
1751         (KJS::JSObject::toPrimitive):
1752         * kjs/object.h:
1753         (KJS::GetterSetterImp::type):
1754         (KJS::JSValue::isObject):
1755         * kjs/operations.cpp:
1756         (KJS::equal):
1757         (KJS::strictEqual):
1758         (KJS::add):
1759         * kjs/reference.cpp:
1760         (KJS::Reference::deleteValue):
1761         * kjs/simple_number.h: Removed.
1762         * kjs/string_object.cpp:
1763         (StringInstance::getOwnPropertySlot): fixed indentation
1764         * kjs/value.cpp:
1765         (KJS::JSValue::toObject):
1766         (KJS::jsNumberCell): New function to quarantine a PIC branch -- allows
1767         us to inline jsNumber without adding PIC branches to callers.
1768         * kjs/value.h:
1769         (KJS::jsUndefined):
1770         (KJS::jsNull):
1771         (KJS::jsNaN):
1772         (KJS::jsBoolean):
1773         (KJS::jsNumber):
1774         (KJS::JSValue::downcast):
1775         (KJS::JSValue::isUndefinedOrNull):
1776         (KJS::JSValue::isBoolean):
1777         (KJS::JSValue::isNumber):
1778         (KJS::JSValue::isString):
1779         (KJS::JSValue::isObject):
1780         (KJS::JSValue::getBoolean):
1781         (KJS::JSValue::getNumber):
1782         (KJS::JSValue::getString):
1783         (KJS::JSValue::getObject):
1784         (KJS::JSValue::getUInt32):
1785         (KJS::JSValue::mark): Replaced !JSImmediate::is() test with assertion,
1786         resulting in a slight performance gain. Callers should always check
1787         !marked() before calling mark(), so it's impossible to call mark on
1788         a JSImmediate.
1789         (KJS::JSValue::marked):
1790         (KJS::JSValue::type):
1791         (KJS::JSValue::toPrimitive):
1792         (KJS::JSValue::toBoolean):
1793         (KJS::JSValue::toNumber):
1794         (KJS::JSValue::toString):
1795
1796 2006-02-06  Eric Seidel  <eseidel@apple.com>
1797
1798         Add svn:ignore properties for visual studio internals.
1799
1800 2006-02-06  Alexey Proskuryakov  <ap@nypop.com>
1801
1802         Reviewed by Darin.
1803
1804         - Refactor DateInstance to provide direct access to data. Several WIN32 modifications.
1805         http://bugzilla.opendarwin.org/show_bug.cgi?id=7107
1806
1807         - No tests added - only changed functionality on WIN32, which should be covered by 
1808         existing tests.
1809
1810         * kjs/date_object.cpp:
1811         (gmtoffset): On WIN32, use the recommended global (_timezone rather than timezone).
1812         Updated comments. 
1813         (KJS::timeZoneOffset): Removed, was basically the same as the above.
1814         (KJS::formatTime): Pass an UTC flag - UTC/local cannot be correctly selected on
1815         Windows based on struct tm itself.
1816         (KJS::DateInstance::getTime): Added.
1817         (KJS::DateInstance::getUTCTime): Added.
1818         (KJS::millisecondsToTM): Factored out from DateProtoFunc::callAsFunction().
1819         (KJS::DateObjectImp::callAsFunction): Use the new parameter to formatTime().
1820         (KJS::DateProtoFunc::callAsFunction): Updated for the other changes. The code for
1821         GetTimezoneOffset was incorrect on WIN32 - _daylight global has nothing to do
1822         with daylight savings time being in effect.
1823
1824         * kjs/date_object.h: Added prototypes for new functions.
1825
1826 2006-02-05  Maciej Stachowiak  <mjs@apple.com>
1827
1828         Reviewed by Anders.
1829         
1830         - fixed ~1100 KJS::Node leaked on layout tests
1831         http://bugzilla.opendarwin.org/show_bug.cgi?id=7097
1832
1833         * kjs/internal.cpp:
1834         (KJS::Parser::noteNodeCycle):
1835         (KJS::Parser::removeNodeCycle):
1836         (KJS::clearNewNodes):
1837         * kjs/internal.h:
1838         * kjs/nodes.cpp:
1839         (ElementNode::breakCycle):
1840         (PropertyListNode::breakCycle):
1841         (ArgumentListNode::breakCycle):
1842         (StatListNode::StatListNode):
1843         (StatListNode::breakCycle):
1844         (VarDeclListNode::breakCycle):
1845         (BlockNode::BlockNode):
1846         (ClauseListNode::breakCycle):
1847         (CaseBlockNode::CaseBlockNode):
1848         (ParameterNode::breakCycle):
1849         (SourceElementsNode::SourceElementsNode):
1850         (SourceElementsNode::breakCycle):
1851         * kjs/nodes.h:
1852         (KJS::Node::breakCycle):
1853         (KJS::ElementNode::ElementNode):
1854         (KJS::ArrayNode::ArrayNode):
1855         (KJS::PropertyListNode::PropertyListNode):
1856         (KJS::ObjectLiteralNode::ObjectLiteralNode):
1857         (KJS::ArgumentListNode::ArgumentListNode):
1858         (KJS::ArgumentsNode::ArgumentsNode):
1859         (KJS::VarDeclListNode::VarDeclListNode):
1860         (KJS::VarStatementNode::VarStatementNode):
1861         (KJS::ForNode::ForNode):
1862         (KJS::CaseClauseNode::CaseClauseNode):
1863         (KJS::ClauseListNode::ClauseListNode):
1864         (KJS::ParameterNode::ParameterNode):
1865         (KJS::FuncExprNode::FuncExprNode):
1866         (KJS::FuncDeclNode::FuncDeclNode):
1867
1868 2006-02-05  Maciej Stachowiak  <mjs@apple.com>
1869
1870         Reviewed by Hyatt.
1871         
1872         - fix default traits for classes to make sure default constructors get called
1873
1874         * kxmlcore/VectorTraits.h:
1875         (KXMLCore::):
1876
1877 2006-02-04  Darin Adler  <darin@apple.com>
1878
1879         Reviewed by Maciej.
1880
1881         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5210
1882           REGRESSION: for/in loop with var changes global variable instead of making local
1883
1884         Test: fast/js/for-in-var-scope.html
1885
1886         * kjs/nodes.cpp:
1887         (valueForReadModifyAssignment): Use ALWAYS_INLINE macro.
1888         (ForInNode::execute): Break out of the scope chain loop once we find and set the
1889         loop variable. We don't want to set multiple loop variables.
1890         (ForInNode::processVarDecls): Process the declaration of the loop variable.
1891
1892         - other cleanup
1893
1894         * kjs/object.cpp: (KJS::tryGetAndCallProperty): Use ALWAYS_INLINE macro.
1895         * kxmlcore/FastMalloc.cpp: Change to use ALWAYS_INLINE macro from AlwaysInline.h
1896         instead of defining it here a second time.
1897
1898 2006-02-04  Maciej Stachowiak  <mjs@apple.com>
1899
1900         Reviewed by Hyatt.
1901         
1902         - change JavaScript collector statistics calls to use HashCountedSet instead
1903         of CFSet; other misc cleanup
1904         http://bugzilla.opendarwin.org/show_bug.cgi?id=7072
1905         
1906         * kjs/collector.cpp:
1907         (KJS::Collector::numProtectedObjects): renamed from numReferencedObjects
1908         (KJS::typeName):
1909         (KJS::Collector::rootObjectTypeCounts): renamed from rootObjectClasses,
1910         use HashSet
1911         * kjs/collector.h:
1912         (KJS::Collector::isOutOfMemory): Renamed from outOfMemory.
1913         * kjs/nodes.cpp:
1914
1915 2006-02-03  Timothy Hatcher  <timothy@apple.com>
1916
1917         Reviewed by Justin.
1918
1919         Renamed configuration names to Debug, Release and Production.
1920
1921         * JavaScriptCore.xcodeproj/project.pbxproj:
1922
1923 2006-02-02  George Staikos <staikos@opensource.apple.com>
1924
1925         Reviewed by Maciej.
1926
1927         * kjs/lookup.h: Fix compile, merged from KDE.
1928
1929 2006-02-02  Darin Adler  <darin@apple.com>
1930
1931         Reviewed by Maciej.
1932
1933         - http://bugzilla.opendarwin.org/show_bug.cgi?id=7005
1934           add Noncopyable, OwnPtr, OwnArrayPtr to KXMLCore
1935
1936         * kxmlcore/Noncopyable.h: Added.
1937         * kxmlcore/OwnArrayPtr.h: Added.
1938         * kxmlcore/OwnPtr.h: Added.
1939
1940         * JavaScriptCore.xcodeproj/project.pbxproj: Added new files.
1941
1942         * kjs/function.h:
1943         * kjs/function.cpp: Use OwnPtr for Parameter pointers.
1944
1945         * kjs/internal.h: Use Noncopyable for LabelStack.
1946
1947         * kjs/list.cpp: Use OwnArrayPtr for overflow.
1948
1949         * kjs/property_map.h:
1950         * kjs/property_map.cpp: Use OwnArrayPtr for SavedProperties.
1951         Use Vector for some stack buffers.
1952
1953         * kjs/regexp_object.h:
1954         * kjs/regexp_object.cpp: Use OwnArrayPtr for lastOvector.
1955
1956 2006-01-31  Maciej Stachowiak  <mjs@apple.com>
1957
1958         Reviewed by Darin.
1959         
1960         - fixed leak of hundreds of thousands of JS parser nodes on the layout tests, and added an exit counter
1961         that would catch them
1962
1963         * kjs/nodes.cpp:
1964         (NodeCounter::~NodeCounter): Added debug-only node counter.
1965         (Node::Node):
1966         (Node::~Node):
1967         * kxmlcore/VectorTraits.h: Simple classes like RefPtr do in fact need destruction.
1968
1969 2006-01-31  Darin Adler  <darin@apple.com>
1970
1971         Reviewed by Maciej.
1972
1973         - added deleteAllValues for HashSet as well as HashMap
1974         - fixed conversion from const_iterator to iterator, which I broke a while back
1975
1976         * kxmlcore/HashMap.h: Updated copyright date.
1977         * kxmlcore/HashSet.h: (KXMLCore::deleteAllValues): Added.
1978         * kxmlcore/HashTable.h: (KXMLCore::HashTableIterator::operator const_iterator): Added.
1979
1980 2006-01-31  Tim Omernick  <timo@apple.com>
1981
1982         Reviewed by Geoff Garen.
1983
1984         * bindings/c/c_utility.cpp:
1985         (KJS::Bindings::convertUTF8ToUTF16):
1986         Fixed an invalid assertion that UTF8Chars is not NULL.  It is valid for it to be NULL as long as
1987         UTF8Length is 0.
1988         This fixes an assertion failure on TOT at <http://www.musicindiaonline.com/p/x/tJO0OOBME9.As1NMvHdW/>,
1989         where JavaScript is getting a NULL string back from some call on the Real Player plugin.
1990
1991 2006-01-30  Anders Carlsson  <andersca@mac.com>
1992
1993         Reviewed by Darin.
1994
1995         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6907
1996         REGRESSION: United.com menus messed up due to document.all/MSIE sniff
1997         
1998         * kjs/nodes.cpp:
1999         (typeStringForValue):
2000         Return "undefined" if the given object should masquerade as undefined.
2001         
2002         * kjs/object.h:
2003         (KJS::JSObject::masqueradeAsUndefined):
2004         Rename from isEqualToNull.
2005         
2006         * kjs/operations.cpp:
2007         (KJS::equal):
2008         Update for name change.
2009
2010 2006-01-29  Maciej Stachowiak  <mjs@apple.com>
2011
2012         Reviewed by Darin.
2013         
2014         - properly define Vector assignment operator; the private version was accidentally left
2015         in, and the template version is not enough to replace the default
2016
2017         * kxmlcore/Vector.h:
2018         (KXMLCore::Vector::operator=):
2019
2020 2006-01-29  Eric Seidel  <eseidel@apple.com>
2021
2022         Reviewed by darin.
2023
2024         Fix the build by applying a GCC-specific namespace hack.
2025
2026         * kjs/lookup.h:
2027
2028 2006-01-29  Eric Seidel <eseidel@apple.com>
2029
2030         Reviewed by hyatt.
2031
2032         Fix build on Win32.
2033
2034         * kjs/lookup.h: fixed ::cacheGlobalObject
2035         * kxmlcore/Vector.h:
2036         (KXMLCore::Vector::operator[]): use unsigned long
2037
2038 2006-01-29  Maciej Stachowiak  <mjs@apple.com>
2039
2040         Reviewed by Dave Hyatt.
2041
2042         * kxmlcore/Vector.h:
2043         (KXMLCore::Vector::operator[]): Add unsigned overload
2044
2045 2006-01-28  Darin Adler  <darin@apple.com>
2046
2047         Reviewed by John Sullivan.
2048
2049         - http://bugzilla.opendarwin.org/show_bug.cgi?id=6895
2050           include exception names in JavaScript form of DOM exception
2051
2052         * khtml/ecma/kjs_binding.cpp: (KJS::setDOMException): Include the name of the
2053         exception in the error message.
2054
2055 2006-01-28  Maciej Stachowiak  <mjs@apple.com>
2056
2057         Reviewed by Darin.
2058         
2059         - miscellaneous Vector improvements
2060
2061         * kxmlcore/Vector.h:
2062         (KXMLCore::Vector::at): Add range-checking asserts.
2063         (KXMLCore::Vector::first): Added as a convenience.
2064         (KXMLCore::Vector::last): Convenience for stack-style use.
2065         (KXMLCore::Vector::removeLast): ditto
2066
2067 2006-01-28  Darin Adler  <darin@apple.com>
2068
2069         Reviewed by John Sullivan
2070
2071         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6870
2072           REGRESSION: JavaScript Date constructor won't accept another Date object
2073
2074         Test: fast/js/date-constructor.html
2075
2076         * kjs/date_object.cpp: (KJS::DateObjectImp::construct):
2077         Added a special case for constructing one date from another (to avoid losing
2078         milliseconds, which are not in the text form, to match Firefox), and changed
2079         the base code to convert to primitive before checking for string to match
2080         the standard. Also corrected a couple silly things in the "construct from
2081         current time" code path (removed a floor that does no good, and changed
2082         the constant used to convert microseconds to milliseconds to be a 1000
2083         rather than "msPerSecond").
2084
2085 2006-01-28  Darin Adler  <darin@apple.com>
2086
2087         * kjs/create_hash_table: Added missing license.
2088
2089 2006-01-28  Maciej Stachowiak  <mjs@apple.com>
2090
2091         Reviewed by Dave Hyatt.
2092         
2093         - added a Vector class
2094         http://bugzilla.opendarwin.org/show_bug.cgi?id=6894
2095
2096         * JavaScriptCore.xcodeproj/project.pbxproj:
2097         * kjs/internal.cpp:
2098         (KJS::Parser::saveNewNode): Apply Vector.
2099         (KJS::clearNewNodes): ditto
2100         * kjs/number_object.cpp:
2101         (integer_part_noexp): ditto
2102         (char_sequence): ditto
2103         * kjs/ustring.cpp:
2104         (KJS::UString::UTF8String): ditto
2105         * kxmlcore/HashMap.h:
2106         (KXMLCore::deleteAllValues): Tweaked this to only apply to HashMap,
2107         other versions are useful for other containers.
2108         * kxmlcore/Vector.h: Added. Implemented a Vector class, which should
2109         be usable for all Array/QVector style purposes, and also as a stack buffer
2110         with oversize handling. Also some helper classes to make vector operations
2111         as efficient as possible for POD types and for simple non-PODs like RefPtr.
2112         (KXMLCore::):
2113         (KXMLCore::VectorTypeOperations::destruct):
2114         (KXMLCore::VectorTypeOperations::initialize):
2115         (KXMLCore::VectorTypeOperations::move):
2116         (KXMLCore::VectorTypeOperations::uninitializedCopy):
2117         (KXMLCore::VectorTypeOperations::uninitializedFill):
2118         (KXMLCore::VectorBuffer::VectorBuffer):
2119         (KXMLCore::VectorBuffer::~VectorBuffer):
2120         (KXMLCore::VectorBuffer::deallocateBuffer):
2121         (KXMLCore::VectorBuffer::inlineBuffer):
2122         (KXMLCore::Vector::Vector):
2123         (KXMLCore::Vector::~Vector):
2124         (KXMLCore::Vector::size):
2125         (KXMLCore::Vector::capacity):
2126         (KXMLCore::Vector::isEmpty):
2127         (KXMLCore::Vector::at):
2128         (KXMLCore::Vector::operator[]):
2129         (KXMLCore::Vector::data):
2130         (KXMLCore::Vector::operator T*):
2131         (KXMLCore::Vector::operator const T*):
2132         (KXMLCore::Vector::begin):
2133         (KXMLCore::Vector::end):
2134         (KXMLCore::Vector::clear):
2135         (KXMLCore::Vector::fill):
2136         (KXMLCore::Vector::operator=):
2137         (KXMLCore::::Vector):
2138         (KXMLCore::::operator):
2139         (KXMLCore::::fill):
2140         (KXMLCore::::expandCapacity):
2141         (KXMLCore::::resize):
2142         (KXMLCore::::reserveCapacity):
2143         (KXMLCore::::append):
2144         (KXMLCore::deleteAllValues):
2145         * kxmlcore/VectorTraits.h: Added.
2146         (KXMLCore::VectorTraits): Traits to enable making Vector efficient for
2147         simple types.
2148
2149 2006-01-28  Alexey Proskuryakov  <ap@nypop.com>
2150
2151         Reviewed by Darin.
2152
2153         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5163
2154         RealPlayer.GetTitle() Crashes Safari/Dashboard
2155
2156         * bindings/c/c_utility.cpp: (KJS::Bindings::convertUTF8ToUTF16):
2157         Fallback to kCFStringEncodingWindowsLatin1 if the passed buffer is not valid UTF-8, preventing crashes.
2158
2159 2006-01-25  George Staikos <staikos@opensource.apple.com>
2160
2161         Reviewed by Darin.
2162
2163         * kxmlcore/HashFunctions.h: Merge build fix from KDE.
2164
2165 2006-01-25  Darin Adler  <darin@apple.com>
2166
2167         - removed an unused source file
2168
2169         * kjs/pointer_hash.h: Removed.
2170         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Removed reference to pointer_hash.h.
2171
2172 2006-01-23  Anders Carlsson  <andersca@mac.com>
2173
2174         Reviewed by Maciej.
2175
2176         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6737
2177         KJS_DEFINE_PROTOTYPE should work outside of the KJS namespace
2178         
2179         * kjs/lookup.h:
2180         Prefix all KJS types with KJS:: in KJS_DEFINE_PROTOTYPE.
2181         
2182         (cacheGlobalObject):
2183         Move this out of the KJS namespace.
2184
2185 2006-01-23  Maciej Stachowiak  <mjs@apple.com>
2186
2187         Reviewed by Eric.
2188
2189         - renamed PointerHash to PtrHash
2190         - made PtrHash the default hash function for int and pointer types that aren't further specialized
2191         - added an AtomicStringImpl class to make it easier and more typesafe to identity hash atomic strings
2192         - did appropriate consequent cleanup (very few places now need to declare a hash function)
2193         http://bugzilla.opendarwin.org/show_bug.cgi?id=6752
2194         
2195         * kjs/array_object.cpp:
2196         (ArrayProtoFunc::callAsFunction): no need to mention PointerHash
2197         * kjs/collector.cpp: ditto
2198         * kjs/identifier.cpp:
2199         (KXMLCore::): declare DefaultHash the new way
2200         * kjs/internal.cpp: no need to mention PointerHash
2201         * kjs/ustring.h:
2202         * kxmlcore/HashCountedSet.h: change how we get the default hash to make it
2203         easier to specialize on PtrHash
2204         * kxmlcore/HashFunctions.h:
2205         (KXMLCore::): renamed PointerHash to PtrHash; changed DefaultHash so that it has
2206         a Hash typedef rather than being a hash function class itself; declared DefaultHash
2207         for int and partializy specialized for pointer types
2208         * kxmlcore/HashMapPtrSpec.h:
2209         (KXMLCore::PtrHashIteratorAdapter::PtrHashIteratorAdapter): Slight tweaks for new
2210         way of handling pointer hash
2211         (KXMLCore::PtrHashConstIteratorAdapter::PtrHashConstIteratorAdapter): ditto
2212         (KXMLCore::): ditto
2213         * kxmlcore/HashMap.h: ditto
2214         * kxmlcore/HashSet.h: ditto
2215
2216 2006-01-23  Maciej Stachowiak  <mjs@apple.com>
2217
2218         Reviewed by Tim Omernick.
2219         
2220         - use classes instead of free functions for extractors, this better matches how other
2221         things work and should avoid the need for hacky workarounds on other compilers
2222         http://bugzilla.opendarwin.org/show_bug.cgi?id=6748
2223
2224         * kjs/array_object.cpp:
2225         * kjs/identifier.cpp:
2226         * kjs/internal.cpp:
2227         * kxmlcore/HashMap.h:
2228         (KXMLCore::PairFirstExtractor::extract):
2229         * kxmlcore/HashMapPtrSpec.h:
2230         (KXMLCore::):
2231         * kxmlcore/HashSet.h:
2232         (KXMLCore::IdentityExtractor::extract):
2233         * kxmlcore/HashTable.h:
2234         (KXMLCore::addIterator):
2235         (KXMLCore::removeIterator):
2236         (KXMLCore::HashTable::add):
2237         (KXMLCore::HashTable::isEmptyBucket):
2238         (KXMLCore::HashTable::isDeletedBucket):
2239         (KXMLCore::HashTable::HashTable):
2240         (KXMLCore::HashTable::lookup):
2241         (KXMLCore::HashTable::add):
2242         (KXMLCore::HashTable::reinsert):
2243         (KXMLCore::HashTable::find):
2244         (KXMLCore::HashTable::contains):
2245         (KXMLCore::HashTable::remove):
2246         (KXMLCore::HashTable::allocateTable):
2247         (KXMLCore::HashTable::deallocateTable):
2248         (KXMLCore::HashTable::expand):
2249         (KXMLCore::HashTable::rehash):
2250         (KXMLCore::HashTable::clear):
2251         (KXMLCore::HashTable::swap):
2252         (KXMLCore::HashTable::operator):
2253         (KXMLCore::HashTable::checkTableConsistency):
2254         (KXMLCore::HashTable::checkTableConsistencyExceptSize):
2255         (KXMLCore::HashTable::invalidateIterators):
2256
2257 2006-01-23  Maciej Stachowiak  <mjs@apple.com>
2258
2259         Rubber stamped by Tim Hatcher.
2260         
2261         - renamed inert() operation on HashSet, HashCountedSet and HashTable to add()
2262         for consistency with HashMap
2263
2264         * kjs/array_object.cpp:
2265         (ArrayProtoFunc::callAsFunction):
2266         * kjs/collector.cpp:
2267         (KJS::Collector::protect):
2268         * kjs/identifier.cpp:
2269         (KJS::Identifier::add):
2270         * kxmlcore/HashCountedSet.h:
2271         (KXMLCore::::add):
2272         * kxmlcore/HashMap.h:
2273         (KXMLCore::::inlineAdd):
2274         * kxmlcore/HashSet.h:
2275         (KXMLCore::::add):
2276         * kxmlcore/HashTable.h:
2277         (KXMLCore::HashTable::add):
2278         (KXMLCore::::add):
2279         (KXMLCore::::HashTable):
2280
2281 2006-01-23  Justin Garcia  <justin.garcia@apple.com>
2282
2283         Reviewed by thatcher
2284         
2285         Turned on -O2 for B&I build.
2286
2287         * JavaScriptCore.xcodeproj/project.pbxproj:
2288
2289 2006-01-23  Maciej Stachowiak  <mjs@apple.com>
2290
2291         Reviewed by Tim Hatcher.
2292         
2293         - it's "Franklin Street", not "Franklin Steet"
2294
2295         * kjs/array_instance.h:
2296         * kjs/array_object.cpp:
2297         * kjs/array_object.h:
2298         * kjs/bool_object.cpp:
2299         * kjs/bool_object.h:
2300         * kjs/collector.cpp:
2301         * kjs/collector.h:
2302         * kjs/completion.h:
2303         * kjs/context.h:
2304         * kjs/date_object.cpp:
2305         * kjs/date_object.h:
2306         * kjs/debugger.cpp:
2307         * kjs/debugger.h:
2308         * kjs/dtoa.h:
2309         * kjs/error_object.cpp:
2310         * kjs/error_object.h:
2311         * kjs/function.cpp:
2312         * kjs/function.h:
2313         * kjs/function_object.cpp:
2314         * kjs/function_object.h:
2315         * kjs/grammar.y:
2316         * kjs/identifier.cpp:
2317         * kjs/identifier.h:
2318         * kjs/internal.cpp:
2319         * kjs/internal.h:
2320         * kjs/interpreter.cpp:
2321         * kjs/interpreter.h:
2322         * kjs/lexer.cpp:
2323         * kjs/lexer.h:
2324         * kjs/list.cpp:
2325         * kjs/list.h:
2326         * kjs/lookup.cpp:
2327         * kjs/lookup.h:
2328         * kjs/math_object.cpp:
2329         * kjs/math_object.h:
2330         * kjs/nodes.cpp:
2331         * kjs/nodes.h:
2332         * kjs/nodes2string.cpp:
2333         * kjs/number_object.cpp:
2334         * kjs/number_object.h:
2335         * kjs/object.cpp:
2336         * kjs/object.h:
2337         * kjs/object_object.cpp:
2338         * kjs/object_object.h:
2339         * kjs/operations.cpp:
2340         * kjs/operations.h:
2341         * kjs/property_map.cpp:
2342         * kjs/property_map.h:
2343         * kjs/property_slot.cpp:
2344         * kjs/property_slot.h:
2345         * kjs/reference.cpp:
2346         * kjs/reference.h:
2347         * kjs/reference_list.cpp:
2348         * kjs/reference_list.h:
2349         * kjs/regexp.cpp:
2350         * kjs/regexp.h:
2351         * kjs/regexp_object.cpp:
2352         * kjs/regexp_object.h:
2353         * kjs/scope_chain.cpp:
2354         * kjs/scope_chain.h:
2355         * kjs/simple_number.h:
2356         * kjs/string_object.cpp:
2357         * kjs/string_object.h:
2358         * kjs/testkjs.cpp:
2359         * kjs/types.h:
2360         * kjs/ustring.cpp:
2361         * kjs/ustring.h:
2362         * kjs/value.cpp:
2363         * kjs/value.h:
2364         * kxmlcore/AlwaysInline.h:
2365         * kxmlcore/ListRefPtr.h:
2366         * kxmlcore/PassRefPtr.h:
2367         * kxmlcore/RefPtr.h:
2368
2369 2006-01-23  Darin Adler  <darin@apple.com>
2370
2371         Reviewed by John Sullivan.
2372
2373         - change needed for fix to http://bugzilla.opendarwin.org/show_bug.cgi?id=6617
2374           REGRESSION: Crash in cloneChildNodes when clicking element
2375
2376         * kxmlcore/PassRefPtr.h: Fix assignment operator from RefPtr of a different
2377         type by calling get() instead of going directly at m_ptr.
2378         * kxmlcore/RefPtr.h: Ditto.
2379
2380         - other changes
2381
2382         * JavaScriptCore.xcodeproj/project.pbxproj: Xcode decided to change this file.
2383         It's just a resorted list of keys in a dictionary.
2384
2385         * kjs/fpconst.cpp: Wrap this file in #if __APPLE__ since the alternate version
2386         in internal.cpp is in #if !__APPLE__. This file is to give us the "no init
2387         routine" property we want to have on OS X.
2388
2389 2006-01-22  Maciej Stachowiak  <mjs@apple.com>
2390
2391         Reviewed by Darin.
2392
2393         - Set up Page class and invert Frame / WebCoreFrameBridge ownership
2394         http://bugzilla.opendarwin.org/show_bug.cgi?id=6577
2395
2396         * kjs/interpreter.h: make globalExec virtual so ScriptInterpreter can 
2397         override it
2398
2399 2006-01-23  George Staikos <staikos@opensource.apple.com>
2400
2401         Reviewed by Maciej and Darin.
2402
2403         * kxmlcore/Assertions.h: This file only works with __APPLE__ right now
2404         * kjs/interpreter.cpp: ditto
2405         * kjs/simple_number.h: Add assert.h and remove from config.h
2406         * kjs/array_object.cpp: Use relative paths for kxmlcore includes
2407         * kjs/testkjs.cpp: Use relative paths for kxmlcore includes
2408
2409 2006-01-23  George Staikos <staikos@opensource.apple.com>
2410
2411         Reviewed by Maciej.
2412
2413         * kjs/config.h: unbreak preprocessor change
2414
2415 2006-01-23  George Staikos <staikos@opensource.apple.com>
2416
2417         Approved by Maciej and Darin.
2418
2419         * kjs/:
2420         * kxmlcore/:
2421              Update FSF address in license to make merging easier
2422
2423 2006-01-22  George Staikos <staikos@opensource.apple.com>
2424
2425         Reviewed by Maciej.
2426
2427         * kjs/collector.cpp: merge major speedup from KDE on Linux
2428                              patch by Maks Orlovich, bug #6145
2429                              Also unify cpu detection
2430         * kjs/config.h: define simpler CPU macros
2431
2432 2006-01-22  George Staikos <staikos@opensource.apple.com>
2433
2434         Reviewed by Maciej.
2435
2436         * kjs/collector.cpp: merge FreeBSD compile fix from KDE
2437                              -> requires build magic for use
2438
2439 2006-01-21  George Staikos <staikos@opensource.apple.com>
2440
2441         Reviewed by Maciej.
2442
2443         * kjs/nodes2string.cpp
2444         * kjs/operations.h
2445         * kjs/debugger.h
2446           Fix pedantic compile with some gcc versions (Merge from KDE)
2447
2448         * kjs/create_hash_table:
2449           Fix build with Perl 5.8.0 (Merge from KDE)
2450
2451 2006-01-18  Darin Adler  <darin@apple.com>
2452
2453         Reviewed by Hyatt.
2454
2455         - hash table fixes needed for my WebCore changes
2456
2457         * kxmlcore/HashTable.h: (KXMLCore::HashTableConstIterator::operator=):
2458         Added a missing return statement.
2459
2460         * kxmlcore/HashTraits.h: Fix traits so they work properly for classes where you
2461         can't instantiate with a 0 by using traits rather than ? : to select the default
2462         emtpy value of hash table keys.
2463
2464         - small cleanup of "runtime" code left over from recent JavaScript crash fix
2465
2466         * bindings/runtime_root.h:
2467         (KJS::Bindings::RootObject::RootObject): No explicit initialization of _imp needed
2468         since it's now a ProtectedPtr.
2469         (KJS::Bindings::RootObject::setRootObjectImp): Remove old code that relied on the
2470         fact that _imp was 0 and replaced with use of ProtectedPtr.
2471         (KJS::Bindings::RootObject::rootObjectImp): Updated since _imp is a ProtectedPtr.
2472
2473 2006-01-17  Darin Adler  <darin@apple.com>
2474
2475         Reviewed by Anders.
2476
2477         - http://bugzilla.opendarwin.org/show_bug.cgi?id=6611
2478           add assertions to check correct use of hash table iterators
2479
2480         * kxmlcore/HashTable.h:
2481         (KXMLCore::addIterator): Added. Helper function that adds an iterator to the list
2482         maintained by the specified hash table.
2483         (KXMLCore::removeIterator): Added. Helper function that removes an iterator from
2484         the list maintained by the hash table it's in.
2485         (KXMLCore::HashTableConstIterator::HashTableConstIterator): Added a HashTable
2486         parameter, ignored when not debugging. Call addIterator.
2487         (KXMLCore::HashTableConstIterator::~HashTableConstIterator):
2488         (KXMLCore::HashTableConstIterator::operator=): Call removeIterator.
2489         (KXMLCore::HashTableConstIterator::operator*): Call checkValidity.
2490         (KXMLCore::HashTableConstIterator::operator->): Ditto.
2491         (KXMLCore::HashTableConstIterator::operator++): Ditto.
2492         (KXMLCore::HashTableConstIterator::operator==): Ditto.
2493         (KXMLCore::HashTableConstIterator::operator!=): Ditto.
2494         (KXMLCore::HashTableConstIterator::checkValidity): Checks that the hash table
2495         pointer is not 0 and if there are two iterators that both point at the same table.
2496         (KXMLCore::HashTableIterator::HashTableIterator): Changed to use the const iterator
2497         as an implementation detail, to avoid having two separate iterator implementations.
2498         (KXMLCore::HashTableIterator::operator*): Ditto.
2499         (KXMLCore::HashTableIterator::operator->): Ditto.
2500         (KXMLCore::HashTableIterator::operator++): Ditto.
2501         (KXMLCore::HashTableIterator::operator==): Ditto.
2502         (KXMLCore::HashTableIterator::operator!=): Ditto.
2503         (KXMLCore::HashTable::HashTable): Initialize pointer to head of iterators list.
2504         (KXMLCore::HashTable::~HashTable): Added call to invalidateIterators.
2505         (KXMLCore::HashTable::makeIterator): Pass this pointer.
2506         (KXMLCore::HashTable::makeConstIterator): Ditto.
2507         (KXMLCore::HashTable::insert): Call invalidateIterators, since this is a public
2508         entry point that modifies the hash table.
2509         (KXMLCore::HashTable::remove): Ditto.
2510         (KXMLCore::HashTable::clear): Ditto.
2511         (KXMLCore::HashTable::swap): Ditto.
2512         (KXMLCore::HashTable::invalidateIterators): Added. Walks the iterators list and
2513         clears out the table, next, and previous pointers in all of them, and then clears
2514         the head so we have an empty list.
2515         (KXMLCore::addIterator): Added. Adds the iterator the the linked list in the
2516         passed-in table, and points the iterator at the table.
2517         (KXMLCore::removeIterator): Added. Removes the iterator from the linked list in
2518         the passed-in table.
2519
2520         * kxmlcore/HashTraits.h: A bit of tweaking and formatting.
2521
2522 2006-01-17  Justin Garcia  <justin.garcia@apple.com>
2523
2524         Reviewed by eric
2525         
2526         Deployment builds now use -O2
2527
2528         * JavaScriptCore.xcodeproj/project.pbxproj:
2529
2530 2006-01-17  Darin Adler  <darin@apple.com>
2531
2532         Reviewed by Anders.
2533
2534         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6610
2535           change RefPtr so that it works when deref ends up deleting the RefPtr
2536
2537         * kxmlcore/PassRefPtr.h: Always set m_ptr before calling deref.
2538         * kxmlcore/RefPtr.h: Ditto.
2539
2540 2006-01-16  Geoffrey Garen  <ggaren@apple.com>
2541
2542         Reviewed by darin.
2543
2544         - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=6322
2545         DateProtoFuncImp::callAsFunction can crash due to lack of type checking
2546
2547         * kjs/date_object.cpp:
2548         (KJS::DateProtoFunc::callAsFunction): Type check calls to all methods. 
2549         This matches section 15.9.5 in the spec.
2550
2551 2006-01-16  Tim Omernick  <timo@apple.com>
2552
2553         Reviewed by John Sullivan.
2554
2555         JavaScriptCore part of <rdar://problem/4211707> NPAPI ref count behavior differs with Mozilla
2556
2557         * bindings/npruntime.cpp:
2558         (_NPN_ReleaseObject):
2559         Refactored part of this function out into _NPN_DeallocateObject.
2560         (_NPN_DeallocateObject):
2561         Forcibly deallocates the passed object, even if its refcount is
2562         greater than zero.
2563         
2564         * bindings/npruntime_impl.h:
2565         Declared _NPN_DeallocateObject().
2566
2567 2006-01-16  Darin Adler  <darin@apple.com>
2568
2569         Reviewed by Maciej.
2570
2571         - fix problem with ++, ==, and != on const iterators in
2572           HashMaps that are using the pointer specialization
2573
2574         * kxmlcore/HashMapPtrSpec.h:
2575         (KXMLCore::PointerHashConstIteratorAdapter::operator++): Change type to const_iterator.
2576         (KXMLCore::PointerHashConstIteratorAdapter::operator==): Ditto.
2577         (KXMLCore::PointerHashConstIteratorAdapter::operator!=): Ditto.
2578
2579 2006-01-15  Alexey Proskuryakov  <ap@nypop.com>
2580
2581         Reviewed by Anders.
2582
2583         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6561
2584         run-javascriptcore-tests doesn't work
2585
2586         * JavaScriptCore/tests/mozilla/Getopt/Mixed.pm: 
2587         Changed revision number to 1.8 (broken by svn migration).
2588
2589 2006-01-14  David Kilzer  <ddkilzer@kilzer.net>
2590
2591         Reviewed and landed by Anders.
2592
2593         * kjs/create_hash_table: Fixed comment typo.
2594
2595 2006-01-13  Maks Orlovich   <maksim@kde.org>
2596
2597         Mostly merging work by Peter Kelly. Reviewed by Maciej, landed by ap.
2598
2599         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6261
2600         Misc. array object fixes from KJS
2601
2602         * kjs/array_object.cpp: Don't treat 2^32-1 as a real array index property.
2603         (ArrayInstance::getOwnPropertySlot): Ditto.
2604         (ArrayInstance::deleteProperty): Ditto.
2605         (ArrayInstance::put): Ditto.
2606         (ArrayInstance::propList): Added a FIXME comment.
2607         (ArrayInstance::put): Throw exception on trying to set invalid array length.
2608         (ArrayProtoFunc::callAsFunction): Do not use a separator argument when doing toString/toLocalString.
2609         * kjs/array_object.h: Added MAX_ARRAY_INDEX.
2610
2611 2006-01-13  Darin Adler  <darin@apple.com>
2612
2613         - Replaced tabs with spaces in source files that had less than 10 lines with tabs.
2614         - Set allow-tabs Subversion property in source files that have more than 10 lines with tabs.
2615
2616 2006-01-13  Anders Carlsson  <andersca@mac.com>
2617
2618         Reviewed by Eric.
2619
2620         * kjs/create_hash_table:
2621         Use correct size variables.
2622
2623 2006-01-13  Anders Carlsson  <andersca@mac.com>
2624
2625         Reviewed by Darin.
2626
2627         * kjs/create_hash_table:
2628         Don't create an empty entry array, instead add a entry with all fields
2629         set to null and set the hash table size to 1.
2630         
2631         * kjs/lookup.cpp:
2632         (findEntry):
2633         Remove the hash table size check
2634
2635 2006-01-12  Anders Carlsson  <andersca@mac.com>
2636
2637         Reviewed by Maciej.
2638
2639         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6494
2640         Crash when assigning a new function to a DOMParser object
2641         
2642         * JavaScriptCore.xcodeproj/project.pbxproj:
2643         Move lookup.cpp before lookup.h
2644         
2645         * kjs/lookup.cpp:
2646         (findEntry):
2647         If the hash table is empty, return 0 early.
2648
2649 2006-01-12  George Staikos <staikos@kde.org>
2650
2651         Reviewed by Darin.
2652
2653         * kjs/interpreter.cpp:
2654         * kjs/testkjs.cpp:
2655         * kjs/interpreter.h:
2656         Add helper to interpreter to call the collector in order to facilitate
2657         visibility rules in KDE.
2658
2659 2006-01-12  George Staikos <staikos@kde.org>
2660
2661         Reviewed by Maciej.
2662
2663         * kjs/kjs.pro: Updates to build the whole thing on Linux at least.
2664
2665         * kxmlcore/HashTable.h: Add missing assert.h
2666
2667 2006-01-12  Darin Adler  <darin@apple.com>
2668
2669         Reviewed by Geoff.
2670
2671         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6505
2672           retire APPLE_CHANGES from JavaScriptCore
2673
2674         * JavaScriptCore.xcodeproj/project.pbxproj: Removed both
2675         APPLE_CHANGES and HAVE_CONFIG_H from all targets.
2676
2677         * README: Removed. This had obsolete information in it
2678         and it wasn't clear what to replace it with.
2679
2680         * kjs/collector.h: Removed an APPLE_CHANGES if around something
2681         that's not really platform-specific (although it does use a
2682         platform-specific API at the moment).
2683         * kjs/collector.cpp: Removed a mistaken comment.
2684
2685         * kjs/grammar.y:
2686         * kjs/internal.cpp:
2687         * kjs/object.h:
2688         * kjs/operations.cpp:
2689         * kjs/operations.h:
2690         * kjs/ustring.h:
2691         Use __APPLE__ instead of APPLE_CHANGES for code that should be
2692         used only on Mac OS X.
2693
2694         * kjs/interpreter.cpp: Removed APPLE_CHANGES ifdef around the include
2695         of the runtime.h header. Even though that header isn't needed at the
2696         moment on platforms other than Mac OS X, the conditional stuff should
2697         be in the header itself, not in this one client.
2698
2699         * kjs/math_object.cpp: (MathFuncImp::callAsFunction): Removed some
2700         code inside APPLE_CHANGES. I'm pretty sure this code isn't needed on
2701         any platform where pow is implemented corrrectly according to the IEEE
2702         standard. If it is needed on some, we can add it back with an appropriate
2703         #if for the platforms where it is needed.
2704
2705 2006-01-12  Justin Haygood  <justin@xiondigital.net>
2706
2707         Reviewed, tweaked, and landed by Darin.
2708
2709         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6416
2710           lexer.cpp, grammar.y protect include of config.h with "HAVE_CONFIG_H"
2711
2712         * kjs/dtoa.cpp: Removed HAVE_CONFIG_H, changed config.h to use
2713         quotes instead of angle brackets. Moved dtoa.h include to the top.
2714         Changed system header includes to use angle brackets instead of quotes.
2715         * kjs/grammar.y: Removed HAVE_CONFIG_H, changed config.h to use
2716         quotes instead of angle brackets.
2717         * kjs/lexer.cpp: Removed HAVE_CONFIG_H, changed config.h to use
2718         quotes instead of angle brackets. Moved lexer.h include to the top.
2719         * kjs/ustring.cpp: Removed HAVE_CONFIG_H, changed config.h to use
2720         quotes instead of angle brackets. Moved ustring.h include to the top.
2721
2722 2006-01-12  George Staikos <staikos@kde.org>
2723
2724         Reviewed by Maciej
2725
2726         - Import initial QMake file.  Doesn't fully work yet.
2727
2728 2006-01-11  Ricci Adams  <ricciadams@apple.com>
2729
2730         Reviewed by Maciej and Darin, landed by Darin.
2731
2732         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5939
2733           final comma in javascript object prevents parsing
2734
2735         * kjs/grammar.y: Added rule to allow trailing comma in
2736         object construction.
2737
2738 2006-01-11  Ricci Adams  <ricciadams@apple.com>
2739
2740         Reviewed by Geoff, landed by Darin.
2741
2742         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5308
2743           Number.toFixed doesn't include leading 0
2744
2745         * kjs/number_object.cpp: (NumberProtoFunc::callAsFunction):
2746         Fixed a "<" that should have been a "<=".
2747
2748 2006-01-11  Ricci Adams  <ricciadams@apple.com>
2749
2750         Reviewed by Geoff, landed by Darin.
2751
2752         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5307
2753           Number.toFixed doesn't round 0.5 up
2754
2755         * kjs/number_object.cpp: (NumberProtoFunc::callAsFunction):
2756         Fixed a ">" that should have been a ">=".
2757
2758 2006-01-11  Justin Haygood  <justin@xiondigital.net>
2759
2760         Reviewed and landed by Darin.
2761
2762         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6486
2763           JavaScriptCore should use system malloc on Windows
2764
2765         * kjs/config.h: Add USE_SYSTEM_MALLOC to the Win32 section.
2766
2767 2006-01-10  Darin Adler  <darin@apple.com>
2768
2769         * Makefile: Took out unneeded "export" line.
2770         * <many-files>: Changed a lot of flags (cleared bogus executable bits, set
2771           MIME types, other small corrections).
2772
2773 2006-01-09  Darin Adler  <darin@apple.com>
2774
2775         * Makefile.am: Removed.
2776
2777 2006-01-07  Anders Carlsson  <andersca@mac.com>
2778
2779         Reviewed by Maciej.
2780         
2781         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6373
2782         REGRESSION: JavaScript hang when comparing large array to null
2783         
2784         * kjs/object.h:
2785         (KJS::JSObject::isEqualToNull):
2786         Add new function which returns true if an object should be treated as null when
2787         doing comparisons.
2788         
2789         * kjs/operations.cpp:
2790         (KJS::equal):
2791         Use isEqualToNull.
2792
2793 2006-01-07  Alexey Proskuryakov  <ap@nypop.com>
2794
2795         Reviewed by Maciej.
2796
2797         - Fix WebCore development build
2798         http://bugzilla.opendarwin.org/show_bug.cgi?id=6408
2799
2800         * kxmlcore/Assertions.h: Use __VA_ARGS__ in variadic macros.
2801
2802 2006-01-06  Maciej Stachowiak  <mjs@apple.com>
2803
2804         Reviewed by Darin.
2805
2806         - miscellaneous changes for 4% speedup on the JavaScript iBench
2807         http://bugzilla.opendarwin.org/show_bug.cgi?id=6396
2808         
2809         Changes mostly thanks to Maks Orlovich, tweaked a little by me.
2810
2811         * kjs/create_hash_table: Use the same hash as the one used by Identifier.
2812         * kjs/function.cpp:
2813         (KJS::FunctionImp::processParameters): Use the new List::copyFrom
2814         (KJS::ActivationImp::ActivationImp): track variable while iterating
2815         * kjs/internal.cpp:
2816         (KJS::StringImp::toObject): create StringInstance directly
2817         * kjs/list.cpp:
2818         (KJS::List::copy): implement in terms of copyFrom
2819         (KJS::List::copyFrom): more efficient way to copy in another list
2820         * kjs/list.h:
2821         * kjs/lookup.cpp:
2822         (keysMatch): updated to work with identifier hash
2823         (findEntry): ditto
2824         (Lookup::findEntry): ditto
2825         (Lookup::find): ditto
2826         * kjs/lookup.h:
2827
2828 2006-01-06  Maciej Stachowiak  <mjs@apple.com>
2829
2830         - fix development build failure from the previous checkin
2831
2832         * kjs/function.cpp:
2833         (KJS::ActivationImp::put): Use prototype() accessor in assert.
2834
2835 2006-01-05  Maciej Stachowiak  <mjs@apple.com>
2836
2837         Reviewed by Eric.
2838
2839         - fix remaining performance regression from Getter/Setter change
2840         http://bugzilla.opendarwin.org/show_bug.cgi?id=6249
2841
2842         - Activation objects should not have __proto__ property
2843         http://bugzilla.opendarwin.org/show_bug.cgi?id=6395
2844
2845         * kjs/function.cpp:
2846         (KJS::ActivationImp::getOwnPropertySlot): Implement directly, thus
2847         skipping getter/setter handling and __proto__ handling, as well
2848         as inlining needed superclass stuff.
2849         (KJS::ActivationImp::put): Implement directly, skipping getter/setter,
2850         __proto__, and do canPut directly in PropertyMap::put since there's no
2851         static property table either.
2852         * kjs/function.h:
2853         * kjs/property_map.cpp:
2854         (KJS::PropertyMap::put): Allow optionally inlining canPut check.
2855         * kjs/property_map.h:
2856
2857 2006-01-04  Geoffrey Garen  <ggaren@apple.com>
2858
2859         Patch by kimmo.t.kinnunen@nokia.com, reviewed by darin, tweaked by me.
2860
2861         - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4921
2862         \u escape sequences in JavaScript identifiers
2863
2864         * kjs/function_object.cpp:
2865         (FunctionObjectImp::construct):
2866         * kjs/lexer.cpp:
2867         (Lexer::shift):
2868         (Lexer::lex):
2869         (Lexer::isWhiteSpace):
2870         (Lexer::isLineTerminator):
2871         (Lexer::isIdentStart):
2872         (Lexer::isIdentPart):
2873         (isDecimalDigit):
2874         (Lexer::scanRegExp):
2875         * kjs/lexer.h:
2876         (KJS::Lexer::):
2877
2878         * tests/mozilla/expected.html: Updated test results.
2879
2880 2005-12-30  Maciej Stachowiak  <mjs@apple.com>
2881
2882         No review, just test result update.
2883
2884         * tests/mozilla/expected.html: Updated for newly passing test from recent fixes.
2885
2886 2005-12-30  Anders Carlsson  <andersca@mac.com>
2887
2888         Reviewed by Maciej.
2889
2890         - Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6298
2891         Getter setter test is failing
2892                 
2893         * kjs/object.cpp:
2894         (KJS::JSObject::put):
2895         Rework the getter setter part. We now walk the prototype chain, checking for
2896         getter/setter properties and only take the slow path if any are found. 
2897
2898 2005-12-30  Maks Orlovich <maksim@kde.org>
2899
2900         Reviewed and committed by Maciej.
2901
2902         - Handle negative, FP numbers with non-10 radix in toString
2903         http://bugzilla.opendarwin.org/show_bug.cgi?id=6259
2904
2905         (Merged from KJS, original work by Harri Porten)
2906         
2907         * kjs/number_object.cpp:
2908         (NumberProtoFunc::callAsFunction): rewrote Number.toString(radix) to work with  
2909         negative numbers, floating point and very large numbers.
2910
2911 2005-12-29  Geoffrey Garen  <ggaren@apple.com>
2912
2913         Patch by Maks Orlovich, reviewed and landed by me.
2914
2915         - http://bugzilla.opendarwin.org/show_bug.cgi?id=6267
2916         Fix Number.prototype.toFixed/toExponential(undefined)
2917
2918         * kjs/number_object.cpp:
2919         (NumberProtoFunc::callAsFunction):
2920
2921 2005-12-29  Geoffrey Garen  <ggaren@apple.com>
2922
2923         Patch by Maks Orlovich, Reviewed and landed by me.
2924
2925         - http://bugzilla.opendarwin.org/show_bug.cgi?id=6266
2926         Minor object naming updates (to match Mozilla, KJS)
2927
2928         * kjs/number_object.cpp:
2929         * kjs/regexp_object.cpp:
2930
2931 2005-12-29  Geoffrey Garen  <ggaren@apple.com>
2932
2933         Patch by Maks Orlovich, reviewed by mjs.
2934
2935         This has 2 very minor fixes, covered by KJS testsuite:    
2936         1. Enumerates string indices in property list (with the same bug as array    
2937            object has in corresponding code). This is a mozilla emulation thing. 
2938         2. Permits properties with integer names in prototypes to be found    
2939
2940         * kjs/string_object.cpp:
2941         (StringInstance::getOwnPropertySlot):
2942         (StringInstanceImp::propList):
2943         * kjs/string_object.h:
2944
2945 2005-12-26  Geoffrey Garen  <ggaren@apple.com>
2946
2947         Reviewed by mjs.
2948
2949         - Fixed <rdar://problem/4364705> run-javascriptcore-tests crashes in 
2950         KJS::BlockNode::deref 
2951         AKA 
2952         http://bugzilla.opendarwin.org/show_bug.cgi?id=6233
2953         Reproducible stack-overflow crash in ~RefPtr<T> due to RefPtr<T> use in 
2954         linked lists
2955
2956         This patch does four things: 
2957         (1) Standardizes all our linked list nodes to use "next" as their next 
2958         pointers. 
2959         (2) Creates the ListRefPtr<T> class, a subclass of RefPtr<T> specialized
2960         to iteratively deref "next" pointers.
2961         (3) Standardizes our linked list nodes to use ListRefPtr<T> and 
2962         implement the releaseNext() function used by ~ListRefPtr<T>().
2963         (4) Adds to RefPtr<T> the release() method used by releaseNext().
2964
2965         - Modified existing mozilla test to ensure it would make deployment 
2966         builds crash as well.
2967
2968         * JavaScriptCore.xcodeproj/project.pbxproj:
2969         * kjs/nodes.cpp:
2970         (ElementNode::evaluate):
2971         (PropertyListNode::evaluate):
2972         (ArgumentListNode::evaluateList):
2973         (StatListNode::StatListNode):
2974         (StatListNode::execute):
2975         (StatListNode::processVarDecls):
2976         (VarDeclListNode::evaluate):
2977         (VarDeclListNode::processVarDecls):
2978         (VarStatementNode::execute):
2979         (VarStatementNode::processVarDecls):
2980         (BlockNode::BlockNode):
2981         (CaseClauseNode::evalStatements):
2982         (CaseClauseNode::processVarDecls):
2983         (ClauseListNode::processVarDecls):
2984         (CaseBlockNode::CaseBlockNode):
2985         (CaseBlockNode::evalBlock):
2986         (SourceElementsNode::SourceElementsNode):
2987         (SourceElementsNode::execute):
2988         (SourceElementsNode::processFuncDecl):
2989         (SourceElementsNode::processVarDecls):
2990         * kjs/nodes.h:
2991         (KJS::ElementNode::ElementNode):
2992         (KJS::ElementNode::releaseNext):
2993         (KJS::ArrayNode::ArrayNode):
2994         (KJS::PropertyListNode::PropertyListNode):
2995         (KJS::PropertyListNode::releaseNext):
2996         (KJS::ObjectLiteralNode::ObjectLiteralNode):
2997         (KJS::ArgumentListNode::ArgumentListNode):
2998         (KJS::ArgumentListNode::releaseNext):
2999         (KJS::ArgumentsNode::ArgumentsNode):
3000         (KJS::StatListNode::releaseNext):
3001         (KJS::VarDeclListNode::VarDeclListNode):
3002         (KJS::VarDeclListNode::releaseNext):
3003         (KJS::VarStatementNode::VarStatementNode):
3004         (KJS::ForNode::ForNode):
3005         (KJS::CaseClauseNode::CaseClauseNode):
3006         (KJS::ClauseListNode::ClauseListNode):
3007         (KJS::ClauseListNode::getClause):
3008         (KJS::ClauseListNode::getNext):
3009         (KJS::ClauseListNode::releaseNext):
3010         (KJS::ParameterNode::ParameterNode):
3011         (KJS::ParameterNode::releaseNext):
3012         (KJS::SourceElementsNode::releaseNext):
3013         * kjs/nodes2string.cpp:
3014         (ElementNode::streamTo):
3015         (PropertyListNode::streamTo):
3016         (ArgumentListNode::streamTo):
3017         (StatListNode::streamTo):
3018         (VarDeclListNode::streamTo):
3019         (VarStatementNode::streamTo):
3020         (CaseClauseNode::streamTo):
3021         (ClauseListNode::streamTo):
3022         (CaseBlockNode::streamTo):
3023         (SourceElementsNode::streamTo):
3024         * kxmlcore/ListRefPtr.h: Added.
3025         (KXMLCore::ListRefPtr::ListRefPtr):
3026         (KXMLCore::ListRefPtr::~ListRefPtr):
3027         (KXMLCore::ListRefPtr::operator=):
3028         * kxmlcore/RefPtr.h:
3029         (KXMLCore::RefPtr::release):
3030
3031 2005-12-29  Geoffrey Garen  <ggaren@apple.com>
3032
3033         Reviewed by mjs.
3034
3035         - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4026
3036         Math.random() not seeded.
3037
3038         Added call to sranddev() -- it executes the first time a process
3039         calls Math.random().
3040
3041         * kjs/math_object.cpp:
3042         (MathFuncImp::callAsFunction):
3043
3044 2005-12-29  Geoffrey Garen  <ggaren@apple.com>
3045
3046         Reviewed by darin.
3047
3048         - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=6265
3049         Name change regression: Java doesn't know what JavaJSObject is
3050
3051         Changed strings passed to Java back to original "JSObject".
3052
3053         * bindings/jni/jni_jsobject.cpp:
3054         (JavaJSObject::convertValueToJObject):
3055         (JavaJSObject::convertJObjectToValue):
3056
3057 2005-12-28  Anders Carlsson  <andersca@mac.com>
3058
3059         Reviewed by Maciej.
3060
3061         - The JSC part of http://bugzilla.opendarwin.org/show_bug.cgi?id=6268
3062         Add undetectable document.all
3063         
3064         * kjs/operations.cpp:
3065         (KJS::equal):
3066         When comparing an object with null or undefined, call toPrimitive with 
3067         NullType as the preferred type.
3068
3069 2005-12-27  Anders Carlsson  <andersca@mac.com>
3070
3071         Reviewed by Darin.
3072
3073         * kjs/array_object.cpp:
3074         (ArrayProtoFunc::callAsFunction):
3075         Implement filter and map. Also, make the existing
3076         array iteration functions not invoke the callback for
3077         non-existing properties, just as Mozilla does now.
3078         
3079         * kjs/array_object.h:
3080         (KJS::ArrayProtoFunc::):
3081         Add filter and map.
3082         
3083         * tests/mozilla/expected.html:
3084         Update, two 1.6 tests now pass.
3085
3086 2005-12-27  Maciej Stachowiak  <mjs@apple.com>
3087
3088         - updated test results for new JS 1.6 tests
3089
3090         * tests/mozilla/expected.html:
3091
3092 2005-12-27  Anders Carlsson  <andersca@mac.com>
3093
3094         Reviewed by Maciej.
3095
3096         Add Mozilla JS 1.6 tests.
3097         
3098         * tests/mozilla/js1_6/Array/browser.js: Added.
3099         * tests/mozilla/js1_6/Array/regress-290592.js: Added.
3100         * tests/mozilla/js1_6/Array/regress-304828.js: Added.
3101         * tests/mozilla/js1_6/Array/regress-305002.js: Added.
3102         * tests/mozilla/js1_6/Array/regress-310425-01.js: Added.
3103         * tests/mozilla/js1_6/Array/regress-310425-02.js: Added.
3104         * tests/mozilla/js1_6/Array/regress-320887.js: Added.
3105         * tests/mozilla/js1_6/Array/shell.js: Added.
3106         * tests/mozilla/js1_6/README: Added.
3107         * tests/mozilla/js1_6/Regress/browser.js: Added.
3108         * tests/mozilla/js1_6/Regress/regress-301574.js: Added.
3109         * tests/mozilla/js1_6/Regress/regress-309242.js: Added.
3110         * tests/mozilla/js1_6/Regress/regress-311157-01.js: Added.
3111         * tests/mozilla/js1_6/Regress/regress-311157-02.js: Added.
3112         * tests/mozilla/js1_6/Regress/regress-314887.js: Added.
3113         * tests/mozilla/js1_6/Regress/regress-320172.js: Added.
3114         * tests/mozilla/js1_6/Regress/shell.js: Added.
3115         * tests/mozilla/js1_6/String/browser.js: Added.
3116         * tests/mozilla/js1_6/String/regress-306591.js: Added.
3117         * tests/mozilla/js1_6/String/shell.js: Added.
3118         * tests/mozilla/js1_6/browser.js: Added.
3119         * tests/mozilla/js1_6/shell.js: Added.
3120         * tests/mozilla/js1_6/template.js: Added.
3121
3122 2005-12-27  Maks Orlovich <maksim@kde.org>
3123
3124         Reviewed and landed by Maciej.
3125
3126         - fixed 6234: Can delete array index property incorrectly.
3127         http://bugzilla.opendarwin.org/show_bug.cgi?id=6234
3128
3129         * kjs/array_object.cpp:
3130         (ArrayInstance::deleteProperty): use toArrayIndex instead of toUInt32 when
3131         looking for array properties.
3132
3133 2005-12-27  Anders Carlsson  <andersca@mac.com>
3134
3135         Reviewed by Maciej.
3136
3137         * kjs/object.cpp:
3138         (KJS::JSObject::defineSetter):
3139         Remove duplicate call to putDirect.
3140
3141 2005-12-26  Maciej Stachowiak  <mjs@apple.com>
3142
3143         Reviewed by Darin and Geoff.
3144
3145         Changes by me and Anders.
3146
3147         - mostly fixed REGRESSION: 5-10% performance regression on JS iBench from getter/setter change
3148         http://bugzilla.opendarwin.org/show_bug.cgi?id=6083
3149
3150         - also fixed some warnings reported by -Winline
3151         
3152         * JavaScriptCorePrefix.h: Move new and delete definitions higher so there
3153         aren't conflicts with use in standard C++ headers
3154         * kjs/object.cpp:
3155         (KJS::throwSetterError): Moved this piece of put into a seprate function
3156         to avoid the PIC branch.
3157         (KJS::JSObject::put): Use hasGetterSetterProperties to avoid expensive stuff
3158         when not needed. Also use GetterSetter properties attribute.
3159         (KJS::JSObject::deleteProperty): Recompute whether any properties are getter/setter
3160         properties any more, if this one was one.
3161         (KJS::JSObject::defineGetter): Let the PropertyMap know that it has getter/setter
3162         properties now (and use the new attribute).
3163         (KJS::JSObject::defineSetter): Ditto.
3164         (KJS::JSObject::fillGetterPropertySlot): Out-of-line helper for getOwnPropertySlot,
3165         to avoid global variable access in the hot code path.
3166         * kjs/object.h:
3167         (KJS::): Added GetterSetter attribute.
3168         (KJS::JSCell::isObject): Moved lower to be after inline methods it uses.
3169         (KJS::JSValue::isObject): ditto
3170         (KJS::JSObject::getOwnPropertySlot): try to avoid impact of getters and setters
3171         as much as possible in the case where they are not being used
3172         * kjs/property_map.cpp:
3173         (KJS::PropertyMap::containsGettersOrSetters): New method to help with this
3174         * kjs/property_map.h:
3175         (KJS::PropertyMap::hasGetterSetterProperties): Ditto
3176         (KJS::PropertyMap::setHasGetterSetterProperties): Ditto
3177         (KJS::PropertyMap::PropertyMap): Added a crazy hack to store the
3178         global "has getter/setter properties" flag in the property map
3179         single entry, to avoid making objects any bigger.
3180         * kjs/value.h: Moved some things to object.h to make -Winline happier
3181
3182 2005-12-24  Maciej Stachowiak  <mjs@apple.com>
3183
3184         Reviewed by Eric and Dave Hyatt.
3185
3186         - make even const PassRefPtrs give transfer of ownership semantics
3187         http://bugzilla.opendarwin.org/show_bug.cgi?id=6238
3188         
3189         This is a somewhat cheesy change. Having to use PassRefPtr_Ref creates ambiguities
3190         in assignment and copy construction. And this makes life way easier and removes
3191         the need for pass(). It is not really correct, but we pretty much never need a real
3192         const PassRefPtr, and this takes care of things for PassRefPtr temporaries.
3193         
3194         * kjs/identifier.cpp:
3195         (KJS::Identifier::add): No more need for pass()
3196         * kjs/property_map.cpp:
3197         (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList): No more need for pass()
3198         * kjs/ustring.cpp:
3199         (KJS::UString::Rep::create): Use adoptRef
3200         (KJS::UString::UString): No more need for pass
3201         (KJS::UString::append): No more need for pass
3202         (KJS::UString::substr): No more need for pass
3203         * kxmlcore/PassRefPtr.h: made m_ptr mutable (ugh)
3204         (KXMLCore::PassRefPtr::PassRefPtr): Take a const PassRefPtr reference
3205         (KXMLCore::PassRefPtr::release): Made this a const method (ugh)
3206         (KXMLCore::PassRefPtr::operator=): clean up appropriately
3207         (KXMLCore::adoptRef): Added this to use instead of PassRefPtr<T>::adopt, I think
3208         it makes the behavior more clear and it is less verbose.
3209         (KXMLCore::static_pointer_cast): use adoptRef
3210         (KXMLCore::const_pointer_cast): use adoptRef
3211         * kxmlcore/RefPtr.h:
3212         (KXMLCore::RefPtr::RefPtr): take const PassRefPtr&
3213         (KXMLCore::PassRefPtr::operator=): take const PassRefPtr&
3214
3215 2005-12-25  Eric Seidel  <eseidel@apple.com>
3216
3217         Reviewed by mjs.
3218
3219         Unbreak HashTableConstIterator++ by returning const_iterator
3220
3221         * kxmlcore/HashTable.h:
3222         (KXMLCore::HashTableConstIterator::operator++): use const_iterator
3223
3224 2005-12-25  Eric Seidel  <eseidel@apple.com>
3225
3226         Reviewed by mjs.
3227
3228         Un-break HashTable copy constructor.
3229
3230         * kxmlcore/HashTable.h:
3231         (KXMLCore::::HashTable): use const_iterator instead
3232
3233 2005-12-23  Maciej Stachowiak  <mjs@apple.com>
3234
3235         Reviewed by Eric.
3236
3237         - fixed "HashMap does not work with const pointer keys or values"
3238         http://bugzilla.opendarwin.org/show_bug.cgi?id=6222
3239         
3240         * kxmlcore/HashMapPtrSpec.h:
3241         (KXMLCore::HashMap): In all methods, explicitly cast all pointers
3242         to void * before passing to internal implementation. Use C-style
3243         casts instead of new-style casts, because the real solution would
3244         require a combo of reinterpret_cast anc const_cast.
3245
3246
3247 2005-12-23  Maciej Stachowiak  <mjs@apple.com>
3248
3249         - this time for sure
3250
3251         * kxmlcore/RefPtr.h:
3252         (KXMLCore::::swap):
3253
3254 2005-12-22  Maciej Stachowiak  <mjs@apple.com>
3255
3256         - fix build problem from last commit.
3257
3258         * kxmlcore/RefPtr.h:
3259         (KXMLCore::::swap):
3260
3261 2005-12-21  Maciej Stachowiak  <mjs@apple.com>
3262
3263         Reviewed by Darin.
3264
3265         - Make HashMap/HashSet support non-POD types
3266         http://bugzilla.opendarwin.org/show_bug.cgi?id=5332
3267
3268         The changes for support are relatively simple, but I also made extensive changes to
3269         avoid copying, so that there isn't refcount thrash when you put RefPtrs into a HashMap.
3270
3271         * kxmlcore/HashTable.h:
3272         (KXMLCore::swap): specialize swap for pairs, to swap elements individually,
3273         so that excess copies can be avoided.
3274         (KXMLCore::Mover::move): Template function to either copy or swap, used
3275         when transferring elements from old table to new.
3276         (KXMLCore::IdentityHashTranslator::hash): The old "converting lookup" templates
3277         that took two or three function parameters now take a class parameter, this is
3278         the class used to do a normal lookup.
3279         (KXMLCore::IdentityHashTranslator::equal): Ditto.
3280         (KXMLCore::IdentityHashTranslator::translate): Ditto. Translate now takes a reference
3281         to write into instead of returning a value to avoid redundant copies.
3282         (KXMLCore::HashTable::~HashTable): Use deallocateTable instead of freeing directly.
3283         (KXMLCore::HashTable::insert): Based on HashTranslator now instead of separate
3284         functions. Added a FIXME about a remaining rare excess copy.
3285         (KXMLCore::HashTable::isEmptyBucket): Use KeyTraits directly instead of unwrapping
3286         the key from Traits, to avoid creating and destroying pair, which copies.
3287         (KXMLCore::HashTable::isDeletedBucket): ditto
3288         (KXMLCore::HashTable::lookup): Use HashTranslator now instead of separate functions.
3289         (KXMLCore::HashTable::initializeBucket): Renamed from emptyBucket. Use placement new to
3290         work right for non-POD types.
3291         (KXMLCore::HashTable::deleteBucket): Use assignDeleted to avoid excess copies.
3292         (KXMLCore::HashTable::reinsert): use Mover template to copy or swap as appropriate
3293         (KXMLCore::HashTable::allocateTable): Initialize every bucket if calloc won't do.
3294         (KXMLCore::HashTable::deallocateTable): Destruct every bucket if needed.
3295         (KXMLCore::HashTable::rehash): Avoid copy before reinserting, so that swap can do its magic.
3296         (KXMLCore::HashTable::clear): use deallocateTable instead of freeing directly.
3297         (KXMLCore::HashTable::HashTable): be more dumb when copying to ensure that non-POD types
3298         work right
3299         * kxmlcore/HashFunctions.h:
3300         (KXMLCore::PointerHash): Specialize PointerHash for RefPtr
3301         * kxmlcore/HashMap.h:
3302         (KXMLCore::extractFirst): Return a reference not a full object to avoid
3303         copies.
3304         (KXMLCore::HashMapTranslator::hash): Use a special translator for insertion
3305         to defer making the pair as long as possible, thus avoiding needless copies.
3306         (KXMLCore::HashMapTranslator::equal): ditto
3307         (KXMLCore::HashMapTranslator::translate): ditto
3308         (KXMLCore::::inlineAdd): Shared by set and add to insert using HashMapTranslator
3309         (KXMLCore::::set): Use inlineAdd
3310         (KXMLCore::::add): Use inlineAdd
3311         * kxmlcore/HashMapPtrSpec.h:
3312         (KXMLCore::): Pass KeyTraits along
3313         * kxmlcore/HashSet.h:
3314         (KXMLCore::identityExtract): Return a reference not a full object to avoid copies.
3315         (KXMLCore::HashSetTranslatorAdapter::hash): Redo adapter stuff to work with
3316         the new HashTranslator approach.
3317         (KXMLCore::HashSetTranslatorAdapter::equal): ditto
3318         (KXMLCore::HashSetTranslatorAdapter::translate): ditto
3319         (KXMLCore::::insert): ditto
3320         * kxmlcore/HashTraits.h:
3321         (KXMLCore::GenericHashTraits): This is intended be used as a base class for
3322         customized traits: sensible defaults.
3323         (KXMLCore::): Use it a bunch
3324         (KXMLCore::assignDeleted): template function to allow pairs to be assigned the
3325         deleted value w/o excess copies.
3326         (KXMLCore::PairHashTraits::emptyValue): Updated
3327         (KXMLCore::PairHashTraits::deletedValue): Updated
3328         (KXMLCore::PairHashTraits::assignDeletedValue): part of assignDeleted hack
3329         (KXMLCore::DeletedValueAssigner::assignDeletedValue): Use template magic
3330         to either use use deletedValue or assignDeletedValue for the cases where we care.
3331         * kxmlcore/RefPtr.h:
3332         (KXMLCore::RefPtr::swap): Added swap method.
3333         (KXMLCore::swap): Added swap free function.
3334         * kjs/identifier.cpp:
3335         (KJS::CStringTranslator::hash): Use new HashTranslator class approach to
3336         alternate type based insertion.
3337         (KJS::CStringTranslator::equal): ditto
3338         (KJS::CStringTranslator::translate): ditto
3339         (KJS::Identifier::add): ditto
3340         (KJS::UCharBufferTranslator::hash): ditto
3341         (KJS::UCharBufferTranslator::equal): ditto
3342         (KJS::UCharBufferTranslator::translate): ditto
3343
3344         - irrelevant change:
3345         
3346         * kjs/array_object.cpp:
3347         (ArrayProtoFunc::callAsFunction): Removed a stray space.
3348
3349 2005-12-22  Anders Carlsson  <andersca@mac.com>
3350
3351         Reviewed by Eric and Darin.
3352
3353         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6196
3354         Would like to be able to define prototypes in headers
3355         
3356         * kjs/lookup.h:
3357         Move ClassName from KJS_DECLARE_PROTOTYPE to KJS_IMPLEMENT_PROTOTYPE.
3358         Also, namespace all macros by prefixing them with KJS_. 
3359
3360 2005-12-22  Darin Adler  <darin@apple.com>
3361
3362         Reviewed by Maciej.
3363
3364         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6191
3365           RefPtr/PassRefPtr have a leak issue, operator== issues
3366
3367         * kxmlcore/PassRefPtr.h:
3368         (KXMLCore::PassRefPtr::PassRefPtr): Remove non-template constructor that takes RefPtr
3369         since the constructor template that takes RefPtr should be sufficient. Add a constructor
3370         template that takes PassRefPtr&.
3371         (KXMLCore::PassRefPtr::adopt): Use PassRefPtr_Ref to avoid setting pointer first to
3372         0 and then to the pointer.
3373         (KXMLCore::PassRefPtr::operator=): Added template versions that take PassRefPtr& and
3374         RefPtr parameters.
3375         (KXMLCore::PassRefPtr::operator PassRefPtr<U>): Changed to fix leak -- old version
3376         would release and then ref.
3377         (KXMLCore::operator==): Make templates have two parameters so you can mix types.
3378         Also remove unneeded const in raw pointer versions.
3379         (KXMLCore::operator!=): Ditto.
3380
3381         * kxmlcore/RefPtr.h:
3382         (KXMLCore::RefPtr::RefPtr): Add constructor template that takes PassRefPtr.
3383         (KXMLCore::RefPtr::operator=): Add assignment operator templates that take
3384         RefPtr and PassRefPtr.
3385         (KXMLCore::operator==): Make templates have two parameters so you can mix types.
3386         Also remove unneeded const in raw pointer versions.
3387         (KXMLCore::operator!=): Ditto.
3388
3389 2005-12-21  Timothy Hatcher  <timothy@apple.com>
3390
3391         * JavaScriptCore.xcodeproj/project.pbxproj:
3392           Set tab width to 8, indent width to 4 and uses tabs to false per file.
3393
3394 2005-12-21  Geoffrey Garen  <ggaren@apple.com>
3395
3396         Reviewed by Darin.
3397
3398         Removed evil hack for determining if a type is an integer, replaced
3399         with template metaprogramming.
3400
3401         * JavaScriptCore.xcodeproj/project.pbxproj: Set tab size to 2 for
3402         testkjs.cpp
3403         * kjs/testkjs.cpp:
3404         (main): Inserted asserts to test IsInteger. FIXME: Move these to
3405         KXMLCore unit tests directory when we create one.
3406         * kxmlcore/HashTraits.h:
3407         (KXMLCore::): Added IsInteger class for querying types.
3408
3409 2005-12-20  Maciej Stachowiak  <mjs@apple.com>
3410
3411         Reviewed by Darin.
3412
3413         - made ALWAYS_INLINE declare things inline as well as __attribute__((always_inline))
3414         http://bugzilla.opendarwin.org/show_bug.cgi?id=6159
3415
3416         * kxmlcore/AlwaysInline.h:
3417
3418 2005-12-19  Maciej Stachowiak  <mjs@apple.com>
3419
3420         Reviewed by Darin.
3421
3422         - fixed a leak in the assignment operator from PassRefPtr to RefPtr
3423         http://bugzilla.opendarwin.org/show_bug.cgi?id=6158
3424
3425         * kxmlcore/RefPtr.h:
3426         (KXMLCore::RefPtr::operator=):
3427
3428         - fix problem with PassRefPtr that darin spotted - it lacked a copy constructor
3429         and therefore was using the default one, which can lead to excess derefs
3430
3431         I fixed this by adding a copy constructor from non-const
3432         reference, and by adding a template pass() function that you have
3433         to use when raw pointer or RefPtr are passed where PassRefPtr is
3434         expected.
3435
3436         * kjs/identifier.cpp:
3437         (KJS::Identifier::add): Changed to have PassRefPtr return type and
3438         pass() the results.
3439         * kjs/identifier.h:
3440         * kjs/property_map.cpp:
3441         (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList): Use pass()
3442         where required.
3443         * kjs/ustring.cpp:
3444         (KJS::UString::UString): Use pass() as needed.
3445         (KJS::UString::append): ditto
3446         (KJS::UString::substr): ditto
3447         * kjs/ustring.h:
3448         (KJS::UString::UString): Use initializer instead of assignment
3449         * kxmlcore/PassRefPtr.h:
3450         (KXMLCore::PassRefPtr::PassRefPtr): Added copy constructor
3451         (KXMLCore::pass): new template function to make it convenient to pass
3452         a PassRefPtr
3453
3454 2005-12-19  Geoffrey Garen  <ggaren@apple.com>
3455   
3456         Reviewed by Maciej.
3457
3458         Fixed <rdar://problem/4370397> Missing return statement in
3459         JSMethodNameToObjcMethodName.
3460
3461         JSMethodNameToObjcMethodName had a check for a name being too long, but
3462         the check was missing a return statement.
3463
3464         A lot of this code was confusing and some of it was wrong, so I fixed
3465         it up, added some asserts to catch this type of bug in the future, 
3466         changed some comments, and renamed some variables.
3467
3468         The two advantages of the new algorithm are (1) It makes writing past
3469         the end of the buffer virtually impossible because the test on the main
3470         loop is "while (not past end of buffer)" and (2) It's twice as fast
3471         because it doesn't call strlen. (There's no need to call strlen when
3472         we're walking the string ourselves.) 
3473         
3474         methodsNamed also supports arbitrary-length method names now. Just in 
3475         case the AppKit folks start getting REALLY verbose...
3476
3477         * bindings/objc/objc_class.mm:
3478         (KJS::Bindings::ObjcClass::methodsNamed):
3479         * bindings/objc/objc_utility.h:
3480         * bindings/objc/objc_utility.mm:
3481         (KJS::Bindings::JSMethodNameToObjcMethodName):
3482
3483 2005-12-19  Darin Adler  <darin@apple.com>
3484
3485         Originally done by both George Staikos and Alexey Proskuryakov.
3486
3487         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5706
3488           Sharedptr dependency can be removed
3489
3490         Our coding guidelines say "use 0 instead of NULL" and both RefPtr and
3491         PassRefPtr were using NULL, which required including a header that
3492         defines NULL.
3493
3494         * kxmlcore/PassRefPtr.h:
3495         (KXMLCore::PassRefPtr::PassRefPtr): Use 0 instead of NULL.
3496         (KXMLCore::PassRefPtr::operator!): Use ! instead of == NULL.
3497         * kxmlcore/RefPtr.h:
3498         (KXMLCore::RefPtr::RefPtr): Use 0 instead of NULL.
3499         (KXMLCore::RefPtr::operator!): Use ! instead of == NULL.
3500         Also did some reformatting.
3501
3502 2005-12-19  Darin Adler  <darin@apple.com>
3503
3504         Reviewed by Geoff Garen and Eric Seidel.
3505
3506         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=4923
3507           stop using <ostream> in WebCore, eliminating the <cmath> troubles it causes
3508
3509         * kjs/simple_number.h: Removed many unnecessary includes, including
3510         the <cmath> one to work around GCC library header bugs. We may have to
3511         add some includes elsewhere for platforms other than OS X, since our
3512         prefix header takes care of some things.
3513
3514         * kxmlcore/AlwaysInline.h: Added. Now clients that don't include
3515         simple_number.h can still get the ALWAYS_INLINE macro.