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