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