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