Bug #: 4932
[WebKit-https.git] / JavaScriptCore / ChangeLog
1 2005-09-11  Eric Seidel  <eseidel@apple.com>
2
3         No review requested, build fix affects only SVG.
4
5         * JavaScriptCore.xcodeproj/project.pbxproj: Fixed JSC+SVG
6         Fixed JavaScriptCore+SVG after PCRE 6.1 merger.
7         http://bugzilla.opendarwin.org/show_bug.cgi?id=4932
8
9 2005-09-10  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
10
11         Reviewed and landed by Darin.
12
13         * Makefile.vc: Added.
14         * README-Win32.txt: Added.
15
16 2005-09-10  Darin Adler  <darin@apple.com>
17
18         - fixed compilation for WebCore (another try)
19
20         * kjs/simple_number.h: Added more "using" lines.
21
22 2005-09-10  Darin Adler  <darin@apple.com>
23
24         - fixed compilation for WebCore
25
26         * kjs/simple_number.h: Have to include <cmath> here to work around a bug in the GCC
27         standard C++ library headers.
28
29 2005-09-10  Darin Adler  <darin@apple.com>
30
31         Windows changes by Krzysztof Kowalczyk <kkowalczyk@gmail.com>.
32
33         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4870
34           win portability: fix IS_NEGATIVE_ZERO macro in simple_number.h
35
36         * kjs/simple_number.h:
37         (KJS::isNegativeZero): Added. Inline function. Has a case for Windows that
38         uses _fpclass and a case for other platforms that uses signbit.
39         (KJS::SimpleNumber::fits): Use inline isNegativeZero instead of macro IS_NEGATIVE_ZERO.
40
41         * kjs/internal.cpp: Remove definition of now-unneeded negZero global.
42
43         * kjs/value.cpp: Touched the file because Xcode didn't know it needed to
44         recompile it.
45
46         - improved test engine
47
48         * tests/mozilla/jsDriver.pl: Sort tests in numeric order instead of using
49         a plain-ASCII sort; now test 33 will be after test 5 in any given set of
50         numbered tests.
51
52 2005-09-08  Darin Adler  <darin@apple.com>
53
54         - fixed overloaded versions of throwError so that they substitute *all* 
55           expected parameters into the message string -- some versions used to
56           skip parameters, resulting in "%s" being printed in the error message.
57         
58         Reviewed by Geoff.
59
60         * kjs/nodes.h: Updated declarations to use "const &" and not to name parameters
61         * kjs/nodes.cpp: (Node::throwError): Updated to match above and add one missing
62         call to substitute.
63
64 2005-09-08  Darin Adler  <darin@apple.com>
65
66         Reviewed by Geoff.
67
68         - updated to PCRE 6.1
69
70         The original PCRE 6.1 sources are checked into the tree with the tag
71         "pcre-6-1" for reference. What we're checking in right now is the original
72         plus our changes to make it support UTF-16 and at least one other tweak
73         (vertical tab considered whitespace). Our work to get our changes was
74         done on "pcre-6-1-branch", with an anchor at "pcre-6-1-anchor" so you can
75         see the evolution of the UTF-16 changes.
76         
77         Note also that there was one small change made here that's not on the branch
78         in pcre_compile.c.
79
80         * Info.plist: Updated the part of the copyright message that's about PCRE.
81
82         * JavaScriptCore.xcodeproj/project.pbxproj: Added new PCRE source files,
83         removed obsolete ones.
84
85         * pcre/AUTHORS: Updated to PCRE 6.1. Includes credits for Apple's UTF-16
86         changes, but not the credits for Google's C++ wrapper, since we don't include that.
87         * pcre/COPYING: Updated to PCRE 6.1.
88         * pcre/LICENCE: Ditto.
89         * pcre/dftables.c: Ditto.
90         * pcre/pcre-config.h: Ditto.
91         * pcre/pcre.h: Ditto.
92
93         * pcre/pcre_compile.c: Added for PCRE 6.1.
94         * pcre/pcre_config.c: Ditto.
95         * pcre/pcre_exec.c: Ditto.
96         * pcre/pcre_fullinfo.c: Ditto.
97         * pcre/pcre_get.c: Ditto.
98         * pcre/pcre_globals.c: Ditto.
99         * pcre/pcre_info.c: Ditto.
100         * pcre/pcre_internal.h: Ditto.
101         * pcre/pcre_maketables.c: Ditto.
102         * pcre/pcre_ord2utf8.c: Ditto.
103         * pcre/pcre_printint.c: Ditto.
104         * pcre/pcre_refcount.c: Ditto.
105         * pcre/pcre_study.c: Ditto.
106         * pcre/pcre_tables.c: Ditto.
107         * pcre/pcre_try_flipped.c: Ditto.
108         * pcre/pcre_ucp_findchar.c: Ditto.
109         * pcre/pcre_version.c: Ditto.
110         * pcre/pcre_xclass.c: Ditto.
111         * pcre/ucp.h: Ditto.
112         * pcre/ucp_findchar.c: Ditto.
113         * pcre/ucpinternal.h: Ditto.
114         * pcre/ucptable.c: Ditto.
115
116         * pcre/get.c: Removed.
117         * pcre/internal.h: Removed.
118         * pcre/maketables.c: Removed.
119         * pcre/pcre.c: Removed.
120         * pcre/study.c: Removed.
121
122 2005-09-07  Geoffrey Garen  <ggaren@apple.com>
123
124         -fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4781
125         Date.setMonth fails with big values due to overflow
126
127         Reviewed by darin.
128
129         * kjs/date_object.cpp:
130         (timetUsingCF): for consistency, changed return statement to invalidDate instead of LONG_MAX
131         (KJS::fillStructuresUsingTimeArgs): modified for readability
132         (KJS::fillStructuresUsingDateArgs): new function analogous to fillStructuresUsingTimeArgs
133         (KJS::DateProtoFuncImp::callAsFunction): modified to use fillStructuresUsingDateArgs
134         (KJS::DateObjectImp::construct): moved variable declaration to proper scope
135         (KJS::DateObjectFuncImp::callAsFunction): moved variable declaration to proper scope
136
137 2005-09-07  Geoffrey Garen  <ggaren@apple.com>
138         -updated expected test results to reflect fix for 
139         http://bugzilla.opendarwin.org/show_bug.cgi?id=4698
140         kjs does not allow named functions in function expressions
141  
142         * tests/mozilla/expected.html:
143
144 2005-09-04  Darin Adler  <darin@apple.com>
145
146         * kjs/identifier.cpp: Fix comment, add missing include.
147         (Follow-on to changes from yesterday.)
148
149 2005-09-03  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
150
151         Reviewed, tweaked and landed by Darin.
152
153         - another try at some of the Windows compilation fixes
154           should fix these bugs: 4546, 4831, 4834, 4643, 4830, 4832, 4833, 4835
155
156         * kjs/collector.cpp: Add missing <setjmp.h> include.
157         * kjs/date_object.cpp: Fix broken copysign macro.
158         * kjs/dtoa.cpp: Move macro definitions down after all header includes.
159         * kjs/fast_malloc.cpp: Add missing <assert.h> and <stddef.h> includes.
160         * kjs/function.cpp: Remove broken isxdigit definition.
161         * kjs/grammar.y: Add a missing semicolon (and remove an excess one).
162         * kjs/identifier.cpp: Turn off AVOID_STATIC_CONSTRUCTORS because the placement new syntax
163         doesn't seem to work in Visual C++ (I'm surprised to hear that, by the way).
164         * kjs/value.h: Made ValueImp's destructor virtual because otherwise pointers to ValueImp
165         on the stack aren't right for garbage collection on Windows (don't think it works that
166         way with gcc's virtual table scheme, but it's a harmless change).
167
168 2005-09-03  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
169
170         Reviewed, tweaked and landed by Darin.
171
172         - some Windows compilation fixes, hoping to fix the problems reported in these bugs:
173           4627, 4629, 4630, 4631, 4632, 4633, 4634, 4635, 4636, 4637, 4639, 4640, 4641, 4644, 4645
174
175         * kjs/collector.cpp: Include <windows.h> on WIN32. Put thread-related code inside
176         KJS_MULTIPLE_THREADS #if directives.
177         (KJS::Collector::markCurrentThreadConservatively): Use NT_TIB to find the stack base on Win32.
178
179         * kjs/config.h: Define HAVE_SYS_TIMEB_H for Win32.
180
181         * kjs/date_object.cpp: Add include of <limits.h>. Add definitions of strncasecmp, isfinite, and
182         copysign for Win32.
183         (KJS::KRFCDate_parseDate): Move "errno = 0" line down closer to the first call to strol -- I believe
184         that on Win32 there's some other call before that setting errno.
185
186         * kjs/date_object.h: Remove unneeded include of <sys/time.h>.
187
188         * kjs/dtoa.cpp: Add an undef of strtod, needed on Win32.
189
190         * kjs/fast_malloc.cpp: Put #if !WIN32 around some customization that's not appropriate on Win32.
191         (KJS::region_list_append): Add a missing cast so this Win32-specific function compiles in C++.
192         (KJS::sbrk): Change parameter type to match the declaration.
193
194         * kjs/function.cpp: (isxdigit): Define a locale-independent isxdigit on Win32.
195
196         * kjs/function.h: Remove unneeded friend class Function for FunctionImp.
197
198         * kjs/identifier.cpp: Took out the APPLE_CHANGES from around the AVOID_STATIC_CONSTRUCTORS
199         define. We ultimately intend to phase out APPLE_CHANGES entirely. Also fix the
200         non-AVOID_STATIC_CONSTRUCTORS code path.
201
202         * kjs/internal.cpp: Remove uneeded include of <strings.h>, which was confused with <string.h>!
203         Add a Win32 implementation of copysign. Put the threads code inside KJS_MULTIPLE_THREADS.
204
205         * kjs/internal.h: Define a KJS_MULTIPLE_THREADS macro on non-Win32 only. Later we can make this
206         specific to Mac OS X if we like.
207
208         * kjs/interpreter_map.cpp: Add missing include of <stdlib.h>.
209
210         * kjs/list.cpp:
211         (KJS::ListImp::markValues): Use std::min instead of MIN.
212         (KJS::List::copy): Ditto.
213         (KJS::List::copyTail): Ditto.
214
215         * kjs/math_object.cpp: (signbit): Add a Win32 implementation of signbit.
216
217         * kjs/nodes.cpp: (Node::finalCheck): Use unsigned instead of uint.
218         Put the use of always_inline inside __GNUC__.
219
220         * kjs/number_object.cpp: (NumberProtoFuncImp::callAsFunction): Use "10.0" instead of "10"
221         inside all the calls to pow to avoid ambiguity caused by overloading of pow on Win32, seen
222         when passing an int rather than a double or float.
223
224         * kjs/operations.cpp:
225         (KJS::isInf): Add Win32 implementation.
226         (KJS::isPosInf): Add Win32 implementation.
227         (KJS::isNegInf): Add Win32 implementation.
228
229         * kjs/regexp.cpp: Use unsigned instead of uint.
230         * kjs/regexp.h: Ditto.
231         * kjs/regexp_object.cpp: Ditto.
232         * kjs/regexp_object.h: Ditto.
233
234 2005-09-02  Beth Dakin  <bdakin@apple.com>
235
236         Fix for <rdar://problem/4235531> Denver Regression: Safari crash in KWQStringData::makeUnicode
237         The other half of the fix is in WebCore.
238
239         Fix written by Maciej and Darin.
240         Reviewed by me/Maciej
241
242         As Maciej said in Radar: These problems was caused by a conflict between some of our custom 
243         allocators, causing them to return null. Symptom is typically a null pointer dereference in 
244         a place where it might be expected an allocation has just occurred.
245
246         * kjs/fast_malloc.cpp:  Added #define for MORECORE_CONTIGUOUS, MORECORE_CANNOT_TRIM, 
247                                 and MALLOC_FAILURE_ACTION.
248
249 2005-08-31  Geoffrey Garen  <ggaren@apple.com>
250
251         -rolled in fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=4698
252         kjs does not allow named functions in function expressions
253         
254         Fix by Arthur Langereis.
255         
256         Reviewed by darin.
257         
258         * kjs/grammar.y:
259         * kjs/nodes.cpp:
260         (FuncExprNode::evaluate):
261         * kjs/nodes.h:
262         (KJS::FuncExprNode::FuncExprNode):
263
264         Test cases added:
265
266         * layout-tests/fast/js/named-function-expression-expected.txt: Added.
267         * layout-tests/fast/js/named-function-expression.html: Added.
268         
269 2005-08-31  Justin Haygood  <justin@xiondigital.net>
270
271         Reviewed, tweaked, and landed by Darin.
272
273         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4085
274         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4087
275         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4096
276           Some fixes for compiling on windows.
277
278         * kjs/config.h: Added a WIN32 case in here, with suitable defines.
279         (To be tweaked as necessary.)
280         * kjs/function.cpp: Took out APPLE_CHANGES around use of ICU.
281         * kjs/operations.cpp: Removed some bogus code that always set HAVE_FLOAT_H.
282
283 2005-08-30  Darin Adler  <darin@apple.com>
284
285         Reviewed by John Sullivan.
286
287         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4758
288           unify SharedPtr in WebCore and JavaScriptCore
289
290         * kjs/shared_ptr.h: Updated namespace to KXMLCore instead of kxhmlcore.
291         Made a few small improvements to use local variables a bit more and added
292         an "operator int" to reduce the chance that we'll convert a SharedPtr to
293         an int by accident. Also made the == operators normal functions rather than
294         friend functions, added a couple of comemnts.
295
296         * kjs/function.h: Updated for namespace change.
297         * kjs/function.cpp: Ditto.
298         * kjs/function_object.cpp: Ditto.
299         * kjs/internal.h: Ditto.
300         * kjs/internal.cpp: Ditto.
301         * kjs/nodes.h: Ditto.
302         * kjs/nodes2string.cpp: Ditto.
303
304 2005-08-26  Maciej Stachowiak  <mjs@apple.com>
305
306         Reviewed by John.
307
308         <rdar://problem/4224911> many many leaks in kjsyyparse with malformed Javascript        
309
310         Record all nodes that are created during parsing, and delete any
311         that are left floating with a refcount of 0.
312         
313         * kjs/internal.cpp:
314         (KJS::Parser::saveNewNode):
315         (KJS::clearNewNodes):
316         (KJS::Parser::parse):
317         * kjs/internal.h:
318         * kjs/nodes.cpp:
319         (Node::Node):
320         * kjs/nodes.h:
321         (KJS::Node::refcount):
322
323 2005-08-26  Maciej Stachowiak  <mjs@apple.com>
324
325         Reviewed by John.
326
327         - fixed <rdar://problem/4232452> many many leaks in kjsyyparse on some well-formed JavaScript (can repro on sony.com, webkit tests)
328         
329         Fixed by changing the refcounting scheme for nodes. Instead of each node implementing a custom ref and
330         deref for all its children (and being responsible for deleting them), nodes use a smart pointer to
331         hold their children, and smart pointers are used outside the node tree as well. This change mostly
332         removes code.
333         
334         * JavaScriptCore.xcodeproj/project.pbxproj:
335         * kjs/function.cpp:
336         (KJS::DeclaredFunctionImp::DeclaredFunctionImp):
337         (KJS::GlobalFuncImp::callAsFunction):
338         * kjs/function.h:
339         * kjs/function_object.cpp:
340         (FunctionObjectImp::construct):
341         * kjs/grammar.y:
342         * kjs/internal.cpp:
343         (KJS::Parser::parse):
344         (KJS::Parser::accept):
345         (KJS::InterpreterImp::checkSyntax):
346         (KJS::InterpreterImp::evaluate):
347         * kjs/internal.h:
348         * kjs/nodes.cpp:
349         (Node::Node):
350         (Node::~Node):
351         (ElementNode::evaluate):
352         (PropertyValueNode::evaluate):
353         (ArgumentListNode::evaluateList):
354         (NewExprNode::evaluate):
355         (FunctionCallValueNode::evaluate):
356         (FunctionCallBracketNode::evaluate):
357         (FunctionCallDotNode::evaluate):
358         (RelationalNode::evaluate):
359         (StatListNode::execute):
360         (StatListNode::processVarDecls):
361         (VarDeclListNode::evaluate):
362         (VarDeclListNode::processVarDecls):
363         (ForInNode::ForInNode):
364         (ClauseListNode::processVarDecls):
365         (CaseBlockNode::evalBlock):
366         (FuncDeclNode::processFuncDecl):
367         (FuncExprNode::evaluate):
368         (SourceElementsNode::execute):
369         (SourceElementsNode::processFuncDecl):
370         (SourceElementsNode::processVarDecls):
371         * kjs/nodes.h:
372         (KJS::Node::ref):
373         (KJS::Node::deref):
374         (KJS::NumberNode::NumberNode):
375         (KJS::GroupNode::GroupNode):
376         (KJS::ElementNode::ElementNode):
377         (KJS::ArrayNode::ArrayNode):
378         (KJS::PropertyValueNode::PropertyValueNode):
379         (KJS::ObjectLiteralNode::ObjectLiteralNode):
380         (KJS::BracketAccessorNode::BracketAccessorNode):
381         (KJS::DotAccessorNode::DotAccessorNode):
382         (KJS::ArgumentListNode::ArgumentListNode):
383         (KJS::ArgumentsNode::ArgumentsNode):
384         (KJS::NewExprNode::NewExprNode):
385         (KJS::FunctionCallValueNode::FunctionCallValueNode):
386         (KJS::FunctionCallResolveNode::FunctionCallResolveNode):
387         (KJS::FunctionCallBracketNode::FunctionCallBracketNode):
388         (KJS::FunctionCallDotNode::FunctionCallDotNode):
389         (KJS::PostfixNode::PostfixNode):
390         (KJS::DeleteNode::DeleteNode):
391         (KJS::VoidNode::VoidNode):
392         (KJS::TypeOfNode::TypeOfNode):
393         (KJS::PrefixNode::PrefixNode):
394         (KJS::UnaryPlusNode::UnaryPlusNode):
395         (KJS::NegateNode::NegateNode):
396         (KJS::BitwiseNotNode::BitwiseNotNode):
397         (KJS::LogicalNotNode::LogicalNotNode):
398         (KJS::MultNode::MultNode):
399         (KJS::AddNode::AddNode):
400         (KJS::ShiftNode::ShiftNode):
401         (KJS::RelationalNode::RelationalNode):
402         (KJS::EqualNode::EqualNode):
403         (KJS::BitOperNode::BitOperNode):
404         (KJS::BinaryLogicalNode::BinaryLogicalNode):
405         (KJS::ConditionalNode::ConditionalNode):
406         (KJS::AssignResolveNode::AssignResolveNode):
407         (KJS::AssignBracketNode::AssignBracketNode):
408         (KJS::AssignDotNode::AssignDotNode):
409         (KJS::CommaNode::CommaNode):
410         (KJS::AssignExprNode::AssignExprNode):
411         (KJS::VarDeclListNode::VarDeclListNode):
412         (KJS::VarStatementNode::VarStatementNode):
413         (KJS::ExprStatementNode::ExprStatementNode):
414         (KJS::IfNode::IfNode):
415         (KJS::DoWhileNode::DoWhileNode):
416         (KJS::WhileNode::WhileNode):
417         (KJS::ForNode::ForNode):
418         (KJS::ReturnNode::ReturnNode):
419         (KJS::WithNode::WithNode):
420         (KJS::CaseClauseNode::CaseClauseNode):
421         (KJS::ClauseListNode::ClauseListNode):
422         (KJS::ClauseListNode::clause):
423         (KJS::ClauseListNode::next):
424         (KJS::SwitchNode::SwitchNode):
425         (KJS::LabelNode::LabelNode):
426         (KJS::ThrowNode::ThrowNode):
427         (KJS::CatchNode::CatchNode):
428         (KJS::FinallyNode::FinallyNode):
429         (KJS::TryNode::TryNode):
430         (KJS::ParameterNode::ParameterNode):
431         (KJS::ParameterNode::nextParam):
432         (KJS::FuncDeclNode::FuncDeclNode):
433         (KJS::FuncExprNode::FuncExprNode):
434         * kjs/nodes2string.cpp:
435         (KJS::SourceStream::operator<<):
436         (ElementNode::streamTo):
437         (PropertyValueNode::streamTo):
438         (ArgumentListNode::streamTo):
439         (StatListNode::streamTo):
440         (VarDeclListNode::streamTo):
441         (CaseBlockNode::streamTo):
442         (ParameterNode::streamTo):
443         (SourceElementsNode::streamTo):
444         * kjs/shared_ptr.h: Added.
445         (kxmlcore::SharedPtr::SharedPtr):
446         (kxmlcore::SharedPtr::~SharedPtr):
447         (kxmlcore::SharedPtr::isNull):
448         (kxmlcore::SharedPtr::notNull):
449         (kxmlcore::SharedPtr::reset):
450         (kxmlcore::SharedPtr::get):
451         (kxmlcore::SharedPtr::operator*):
452         (kxmlcore::SharedPtr::operator->):
453         (kxmlcore::SharedPtr::operator!):
454         (kxmlcore::SharedPtr::operator bool):
455         (kxmlcore::SharedPtr::operator==):
456         (kxmlcore::::operator):
457         (kxmlcore::operator!=):
458         (kxmlcore::static_pointer_cast):
459         (kxmlcore::const_pointer_cast):
460
461 2005-08-26  Geoff Garen  <ggaren@apple.com>
462
463         Reviewed by John.
464         Landed by Darin.
465
466         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4664
467           TOT Crash from backwards null check in WebScriptObject.mm
468
469         * bindings/objc/WebScriptObject.mm:
470         (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:]):
471         Remove bogus !.
472
473 2005-08-25  Darin Adler  <darin@apple.com>
474
475         Reviewed by John Sullivan.
476
477         - rename KJS::UString::string() to KJS::UString::domString()
478         - rename KJS::Identifier::string() to KJS::Identifier::domString()
479
480         * kjs/identifier.h: Renamed.
481         * kjs/ustring.h: Ditto.
482
483 2005-08-19  Darin Adler  <darin@apple.com>
484
485         Reviewed by Maciej.
486
487         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4435
488           speed up JavaScript by tweaking the Identifier class
489
490         * kjs/identifier.h: Add a new global nullIdentifier and make Identifier::null a function
491         that returns it.
492         * kjs/identifier.cpp: (KJS::Identifier::init): Initialize a global for the null identifier
493         as well as all the other globals for special identifiers.
494
495         * kjs/ustring.h: (KJS::UString::UString): Make this empty constructor inline.
496         * kjs/ustring.cpp: Remove the old non-inline version.
497
498 2005-08-19  Mitz Pettel  <opendarwin.org@mitzpettel.com>
499
500         Reviewed by Maciej.
501         Revised and landed by Darin.
502
503         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4474
504           REGRESSION: Crash when using in-place operator on uninitialized array element
505
506         * kjs/nodes.cpp:
507         (AssignResolveNode::evaluate): Remove unneeded "isSet" assertion.
508         (AssignBracketNode::evaluate): Replace code that tested "isSet" with code that
509         tests the return value of getPropertySlot.
510
511         * kjs/property_slot.h: Removed unneeded "isSet" function. Property slots are
512         either uninitialized or set. There's no "initialized and not set" state.
513
514 2005-08-18  Adele Peterson  <adele@apple.com>
515
516         Checked "Inline Functions Hidden" box
517
518         * JavaScriptCore.xcodeproj/project.pbxproj:
519
520 2005-08-16  Darin Adler  <darin@apple.com>
521
522         Reviewed by Geoff.
523
524         - fixed crash in one of the JavaScript tests (introduced by my throwError change)
525
526         * kjs/nodes.cpp: (Node::setExceptionDetailsIfNeeded): Check if the exception is an
527         object before setting the file and line number properties on it. Something to think
528         about in the future -- do we really want to do this on any object that's thrown?
529         How about limiting it to error objects that were created by the JavaScript engine?
530
531         - changed kjs_fast_malloc so we don't have two conflicting versions of the same function
532
533         * kjs/fast_malloc.h: Took out all the ifdefs from this header.
534         * kjs/fast_malloc.cpp: Added non-NDEBUG versions of the functions that just call
535         the system malloc, and put the NDEBUG versions in an #else.
536
537 2005-08-16  Darin Adler  <darin@apple.com>
538
539         Reviewed by Geoff.
540
541         - clean up exported symbols that are not in a "KJS" namespace
542
543         * bindings/NP_jsobject.cpp: (identiferFromNPIdentifier): Marked this function static
544         so it no longer has external linkage.
545         * bindings/c/c_utility.h: Put all this stuff inside the KJS namespace.
546         * bindings/c/c_utility.cpp: Also marked some globals static so they don't have external
547         linkage; not as important given the namespace.
548         * bindings/npruntime.cpp: Marked functions static so they no longer have internal linkage.
549         Also removed unused _NPN_SetExceptionWithUTF8 function (not in header, had C++ linkage!).
550
551         * bindings/jni/jni_utility.cpp: (KJS::Bindings::getJavaVM): Call KJS_GetCreatedJavaVMs
552         using the soft linking header, instead of calling the JNI call. This allows processes
553         to link both JavaScriptCore and JavaVM without a symbol conflict.
554         * bindings/softlinking.c:
555         (loadFramework): Marked this function static so it no longer has external linkage.
556         (getFunctionPointer): Ditto.
557         (KJS_GetCreatedJavaVMs): Renamed this so it has a KJS prefix.
558
559         * JavaScriptCore.xcodeproj/project.pbxproj: Added softlinking.h.
560         * bindings/softlinking.h: Added.
561
562         * kjs/nodes2string.cpp: (streamAssignmentOperatorTo): Marked this function static so it
563         no longer has external linkage.
564
565 2005-08-15  Darin Adler  <darin@apple.com>
566
567         Reviewed by Geoff.
568
569         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4437
570           clean up error creation with new throwError function
571
572         * bindings/NP_jsobject.cpp:
573         (_NPN_SetException):
574         * bindings/jni/jni_instance.cpp:
575         (JavaInstance::invokeMethod):
576         * bindings/jni/jni_runtime.cpp:
577         (JavaField::dispatchValueFromInstance):
578         (JavaField::dispatchSetValueToInstance):
579         * bindings/objc/WebScriptObject.mm:
580         (-[WebScriptObject _initializeWithObjectImp:originExecutionContext:executionContext:]):
581         (-[WebScriptObject _initWithObjectImp:originExecutionContext:executionContext:]):
582         (+[WebScriptObject throwException:]):
583         (-[WebScriptObject setException:]):
584         (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:]):
585         * bindings/objc/objc_class.h:
586         (KJS::Bindings::ObjcClass::~ObjcClass):
587         (KJS::Bindings::ObjcClass::ObjcClass):
588         (KJS::Bindings::ObjcClass::operator=):
589         (KJS::Bindings::ObjcClass::constructorAt):
590         (KJS::Bindings::ObjcClass::numConstructors):
591         * bindings/objc/objc_header.h:
592         * bindings/objc/objc_runtime.h:
593         (KJS::Bindings::ObjcField::~ObjcField):
594         (KJS::Bindings::ObjcField::ObjcField):
595         (KJS::Bindings::ObjcField::operator=):
596         (KJS::Bindings::ObjcMethod::ObjcMethod):
597         (KJS::Bindings::ObjcMethod::~ObjcMethod):
598         (KJS::Bindings::ObjcMethod::operator=):
599         * bindings/objc/objc_runtime.mm:
600         (ObjcField::valueFromInstance):
601         (ObjcField::setValueToInstance):
602         (ObjcArray::setValueAt):
603         (ObjcArray::valueAt):
604         * bindings/objc/objc_utility.h:
605         * bindings/objc/objc_utility.mm:
606         (KJS::Bindings::JSMethodNameToObjCMethodName):
607         (KJS::Bindings::convertValueToObjcValue):
608         (KJS::Bindings::convertNSStringToString):
609         (KJS::Bindings::convertObjcValueToValue):
610         (KJS::Bindings::objcValueTypeForType):
611         (KJS::Bindings::createObjcInstanceForValue):
612         (KJS::Bindings::throwError):
613         * bindings/runtime.h:
614         (KJS::Bindings::Parameter::~Parameter):
615         (KJS::Bindings::Method::~Method):
616         (KJS::Bindings::Instance::Instance):
617         (KJS::Bindings::Instance::begin):
618         (KJS::Bindings::Instance::end):
619         (KJS::Bindings::Instance::getValueOfUndefinedField):
620         (KJS::Bindings::Instance::supportsSetValueOfUndefinedField):
621         (KJS::Bindings::Instance::setValueOfUndefinedField):
622         (KJS::Bindings::Instance::valueOf):
623         * bindings/runtime_array.cpp:
624         (RuntimeArrayImp::put):
625         * bindings/runtime_object.h:
626         (KJS::RuntimeObjectImp::setInternalInstance):
627         (KJS::RuntimeObjectImp::getInternalInstance):
628         * kjs/array_object.cpp:
629         (getProperty):
630         (ArrayProtoFuncImp::callAsFunction):
631         (ArrayObjectImp::construct):
632         * kjs/bool_object.cpp:
633         (BooleanProtoFuncImp::callAsFunction):
634         * kjs/date_object.cpp:
635         (KJS::DateProtoFuncImp::callAsFunction):
636         * kjs/function.cpp:
637         (KJS::decode):
638         (KJS::GlobalFuncImp::callAsFunction):
639         * kjs/function_object.cpp:
640         (FunctionProtoFuncImp::callAsFunction):
641         (FunctionObjectImp::construct):
642         * kjs/internal.cpp:
643         (KJS::UndefinedImp::toObject):
644         (KJS::NullImp::toObject):
645         (KJS::InterpreterImp::evaluate):
646         (KJS::InternalFunctionImp::hasInstance):
647         * kjs/nodes.cpp:
648         (Node::throwError):
649         (substitute):
650         (Node::setExceptionDetailsIfNeeded):
651         (undefinedVariableError):
652         (ProgramNode::ProgramNode):
653         * kjs/number_object.cpp:
654         (NumberProtoFuncImp::callAsFunction):
655         * kjs/object.cpp:
656         (KJS::ObjectImp::call):
657         (KJS::ObjectImp::defaultValue):
658         (KJS::Error::create):
659         (KJS::throwError):
660         * kjs/object.h:
661         (KJS::ObjectImp::clearProperties):
662         (KJS::ObjectImp::getPropertySlot):
663         (KJS::ObjectImp::getOwnPropertySlot):
664         * kjs/object_object.cpp:
665         (ObjectProtoFuncImp::callAsFunction):
666         * kjs/reference.cpp:
667         (KJS::Reference::getBase):
668         (KJS::Reference::getValue):
669         (KJS::Reference::putValue):
670         (KJS::Reference::deleteValue):
671         * kjs/regexp_object.cpp:
672         (RegExpProtoFuncImp::callAsFunction):
673         (RegExpObjectImp::construct):
674         * kjs/string_object.cpp:
675         (StringProtoFuncImp::callAsFunction):
676
677 2005-08-15  Anders Carlsson  <andersca@mac.com>
678
679         Reviewed by Darin.
680
681         * tests/mozilla/ecma_3/Date/15.9.5.5.js:
682         Remove the code which tests that Date.toLocaleString should be parsable
683         by Date.parse. That is not true according to the spec.
684
685 2005-08-15  Darin Adler  <darin@apple.com>
686
687         Reviewed by Geoff.
688
689         * kjs/collector.cpp: (KJS::Collector::allocate): Use a local instead of a global in one
690         more place; slight speedup.
691
692 2005-08-14  Darin Adler  <darin@apple.com>
693
694         Reviewed by Maciej.
695
696         - fixed crash observed on one of the Apple-only layout tests
697
698         * kjs/property_map.cpp: (KJS::PropertyMap::mark): Change code to understand that deleted
699         entries have a value of NULL, so the deleted sentinel count doesn't need to be included
700         in the count of things to mark since we're ignoring the keys.
701
702 2005-08-14  Darin Adler  <darin@apple.com>
703
704         Reviewed by Maciej.
705
706         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4421
707           speed up JavaScript by inlining some label stack functions
708
709         * kjs/internal.h: Removed the copy constructor and assignment operator for LabelStack.
710         They were unused, and the implementations had bugs; I removed them rather than fixing them.
711         Also removed the clear function, since that was only needed to help the assignment operator
712         share code with the destructor, and was not efficient enough for the destructor.
713         (KJS::LabelStack::~LabelStack): Made this inline. Also used an efficient implementation
714         that's nice and fast when the stack is empty, better than the old clear() function which
715         used to keep updating and refetching "tos" each time through the loop.
716         (KJS::LabelStack::pop): Made this inline.
717
718         * kjs/internal.cpp: Deleted the now-inline functions and the obsolete functions. Also
719         deleted a commented-out line of code.
720
721 2005-08-14  Darin Adler  <darin@apple.com>
722
723         Reviewed by Maciej.
724
725         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4419
726           speed up JavaScript by improving KJS::List
727
728         my measurements show an improvement of 1% on iBench JavaScript
729
730         * kjs/list.cpp: Rearrange list to make the values and free list share the same storage,
731         which saves 4 bytes per list. Also remove the pointers used only on the heap from the
732         lists that are in the pool, which saves 8 bytes per list. Moving the free list pointer
733         closer to the start of the list object also speeds up access to the free list. New
734         "HeapListImp" struct is used only for the lists on the heap.
735         (KJS::List::markProtectedLists): Shadowed global variable in local and updated for the
736         new terminology ("heap" instead of "outside pool").
737         (KJS::allocateListImp): Updated for new terminology.
738         (KJS::List::release): Moved the code from deallocateListImp in here -- it wasn't being
739         inlined and didn't need to be in a separate function.
740
741 2005-08-14  Darin Adler  <darin@apple.com>
742
743         Reviewed by Maciej.
744
745         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4417
746           speed up JavaScript with some small changes to the property map code
747
748         my measurements show an improvement of 2% on iBench JavaScript
749
750         * kjs/property_map.h: (KJS::PropertyMap::PropertyMap): Made the default constructor inline.
751         * kjs/property_map.cpp:
752         (KJS::PropertyMap::~PropertyMap): Changed loop to exit early once we know we've processed
753         all the hash table entries, based on the count.
754         (KJS::PropertyMap::mark): Ditto.
755
756         * kjs/object.h: Made an arbitrary change here to force recompiling so we pick up changes to
757         property_map.h. Works around what seems to be an Xcode header dependency bug.
758
759 2005-08-14  Darin Adler  <darin@apple.com>
760
761         Reviewed by Maciej.
762
763         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4416
764           speed up JavaScript with some improvements to the garbage collector
765
766         my measurements show an improvement of 2% on iBench JavaScript
767
768         * kjs/collector.cpp:
769         (KJS::Collector::allocate): Use local variables to shadow globals instead of repeatedly
770         going at global variables. Tighten up loop implementations to make the common case fast.
771         (KJS::Collector::markStackObjectsConservatively): Use local variables to shadow globals.
772         Used a goto to eliminate a boolean since it was showing up in the profile.
773         (KJS::Collector::markProtectedObjects): Iterate through the table using pointer rather
774         than an index since the profile showed that generating better code.
775         (KJS::Collector::collect): Added a special case for blocks where all cells are used,
776         Use local variables to shadow globals. Eliminated a boolean by computing it another
777         way (checking to see if the number of live objects changed). Also used local variables
778         to shadow fields in the current cell when sweeping.
779         (KJS::Collector::numReferencedObjects): Use AllocatedValueImp instead of ValueImp
780         in one place -- means we get faster versions of various functions that don't worry
781         about SimpleNumber.
782         (KJS::className): Ditto.
783         (KJS::Collector::rootObjectClasses): Ditto.
784
785 2005-08-14  Darin Adler  <darin@apple.com>
786
787         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4344
788           REGRESSION: JavaScript crash when going back from viewing a thread (NULL protoype)
789
790         * kjs/error_object.cpp: (NativeErrorImp::NativeErrorImp): Set proto in a more
791         straightforward way. The old code set the proto to 0 and then to the correct value.
792         This showed up as a "false positive" when searching for places that set prototype
793         to NULL/0 so I fixed it.
794
795         * kjs/function_object.cpp: (FunctionPrototypeImp::FunctionPrototypeImp): Change to
796         not pass an explicit "0" to the base class (InternalFunctionImp) constructor.
797
798         * kjs/internal.h: Added a default constructor for InternalFunctionImp.
799         * kjs/internal.cpp: (KJS::InternalFunctionImp::InternalFunctionImp): Added the
800         default constructor (empty body, just calls base class's default constructor).
801
802         * kjs/object.h:
803         (KJS::ObjectImp::ObjectImp): Add an assertion to catch NULL prototypes earlier
804         in Development builds.
805         (KJS::ObjectImp::setPrototype): Ditto.
806
807 2005-08-12  Maciej Stachowiak  <mjs@apple.com>
808
809         Reviewed by John.
810
811         - two simple speed improvements for a 3% speed gain
812         
813         * JavaScriptCore.xcodeproj/project.pbxproj: turn on -fstrict-aliasing
814
815         * kjs/scope_chain.h:
816         (KJS::ScopeChainIterator::ScopeChainIterator): Add a scope chain iterator
817         so you can walk a scope chain without having to make a copy that you then mutate.
818         (KJS::ScopeChainIterator::operator*): standard iterator operation
819         (KJS::ScopeChainIterator::operator->): ditto
820         (KJS::ScopeChainIterator::operator++): ditto
821         (KJS::ScopeChainIterator::operator==): ditto
822         (KJS::ScopeChainIterator::operator!=): ditto
823         (KJS::ScopeChain::begin): Iterator for the top of the scope chain
824         (KJS::ScopeChain::end): Iterator for one past the bottom (i.e. null)
825         * kjs/nodes.cpp:
826         (ResolveNode::evaluate): Use scope chain iterator instead of copying
827         a scope chain and then modifying the copy
828         (ResolveNode::evaluateReference): ditto
829         (FunctionCallResolveNode::evaluate): ditto
830         (AssignResolveNode::evaluate): ditto
831
832 2005-08-12  Maciej Stachowiak  <mjs@apple.com>
833
834         Patch from Anders Carlsson, reviewed by me.
835
836         * kjs/nodes.h: Fix build breakage.
837
838 2005-08-12  Maciej Stachowiak  <mjs@apple.com>
839
840         Reviewed by hyatt.
841
842         - refactor function calls, 3% speedup on JS iBench.
843
844         * kjs/grammar.y:
845         * kjs/nodes.cpp:
846         (Node::throwError): Added new useful variants.
847         (FunctionCallValueNode::evaluate): New node to handle calls on expressions
848         that are strictly values, not references.
849         (FunctionCallValueNode::ref):  ditto
850         (FunctionCallValueNode::deref): ditto
851         (FunctionCallResolveNode::evaluate): New node to handle calls on identifier
852         expressions, so that they are looked up in the scope chain.
853         (FunctionCallResolveNode::ref): ditto
854         (FunctionCallResolveNode::deref): ditto
855         (FunctionCallBracketNode::evaluate): New node to handle calls on bracket
856         dereferences, so that the expression before brackets is used as the this
857         object.
858         (FunctionCallBracketNode::ref): ditto
859         (FunctionCallBracketNode::deref): ditto
860         (FunctionCallDotNode::evaluate): New node to handle calls on dot
861         dereferences, so that the expression before the dot is used as the this
862         object.
863         (FunctionCallDotNode::ref): ditto
864         (FunctionCallDotNode::deref): ditto
865         (dotExprNotAnObjectString): helper function to avoid global variable access.
866         (dotExprDoesNotAllowCallsString): ditto
867         * kjs/nodes.h: Declared new classes.
868         * kjs/nodes2string.cpp:
869         (FunctionCallValueNode::streamTo): Added - serializes the appropriate function call
870         (FunctionCallResolveNode::streamTo): ditto
871         (FunctionCallBracketNode::streamTo): ditto
872         (FunctionCallParenBracketNode::streamTo): ditto
873         (FunctionCallDotNode::streamTo): ditto
874         (FunctionCallParenDotNode::streamTo): ditto
875         * kjs/object.h:
876         (KJS::ObjectImp::isActivation): Change how activation objects are
877         detected in the scope chain, a virtual function is cheaper than the
878         old inheritance test.
879         * kjs/function.h:
880         (KJS::ActivationImp::isActivation): Ditto.
881
882 2005-08-11  Maciej Stachowiak  <mjs@apple.com>
883
884         - added missing file from earlier checkin
885
886         * kjs/grammar_types.h: Added.
887         (KJS::makeNodePair):
888         (KJS::makeNodeWithIdent):
889
890 2005-08-11  Maciej Stachowiak  <mjs@apple.com>
891
892         Reviewed by Geoff.
893
894         * kjs/date_object.cpp:
895         (timetUsingCF): Fix one of the date tests my making the CF version of mktime
896         have the same quirk about the DST field as the real mktime.
897         * tests/mozilla/expected.html: Updated for newly fixed test.
898
899 2005-08-11  Maciej Stachowiak  <mjs@apple.com>
900
901         - updated for one of the tests that Darin incidentally fixed.
902
903         * tests/mozilla/expected.html:
904
905 2005-08-10  Maciej Stachowiak  <mjs@apple.com>
906
907         Reviewed by Geoff.
908
909         Refactor assignment grammar to avoid Reference type, and to later
910         be able to take advantage of writeable PropertySlots, when those
911         are added. I also fixed a minor bug, turning a function to a
912         string lost parentheses, I made sure they are printed at least
913         where semantically significant.
914         
915         Test cases: see WebCore
916         
917         * kjs/grammar.y: Change grammar so that assignment expressions are parsed
918         directly to nodes that know how to set the kind of location being assigned, instead
919         of having a generic assign node that counts on evaluateReference.
920         * kjs/lexer.cpp: Include grammar_types.h.
921         * kjs/nodes.cpp:
922         (BracketAccessorNode): Renamed from AccessorNode1 for clarity.
923         (DotAccessorNode): Renamed from AccessorNode2 for clarity.
924         (combineForAssignment): Inline function for doing the proper kind of
925         operation for various update assignments like += or *=.
926         (AssignResolveNode): Node that handles assignment to a bare identifier.
927         (AssignDotNode): Node that handles assignments of the form EXPR . IDENT = EXPR
928         (AssignBracketNode): EXPR [ IDENT ] = EXPR
929         * kjs/nodes.h: Updated for declarations/renames of new classes.
930         * kjs/nodes2string.cpp:
931         (GroupNode::streamTo): Fixed to print parens around the expression.
932         (BracketAccessorNode::streamTo): Renamed.
933         (DotAccessorNode::streamTo): Renamed.
934         (AssignResolveNode::streamTo): Added.
935         (AssignBracketNode::streamTo): Added.
936         (AssignDotNode::streamTo): Added.
937         (streamAssignmentOperatorTo): helper function for the above
938         * kjs/property_slot.h:
939         (KJS::PropertySlot::isSet): Made this const.
940
941 2005-08-10  Adele Peterson  <adele@apple.com>
942
943         Bumping version to 420+
944
945         * Info.plist:
946
947 2005-08-10  Geoffrey Garen  <ggaren@apple.com>
948
949         -fixed <rdar://problem/4151132> REGRESSION: Some applet liveconnect calls 
950         throws privilege exception.
951         
952         Reviewed by richard and mjs.
953
954         -I removed the global static JavaClass cache, since it violated Java
955         security to cache classes between websites and applets.
956         
957         * bindings/jni/jni_class.cpp: 
958             -removed global static cache dictionary
959             -instance constructor and destructor now do the work that used to 
960             be done by static factory methods
961             -removed obsolete functions
962         (JavaClass::JavaClass):
963         (JavaClass::~JavaClass):
964         * bindings/jni/jni_class.h:
965             -removed obsolete function declarations
966             -made copying private since it's unused and it's also not clear
967             excatly how copying would work with Java security
968             -made default construction private since it's meaningless
969         * bindings/jni/jni_instance.cpp:
970             -removed obsolete functions
971         (JavaInstance::~JavaInstance):
972         (JavaInstance::getClass):
973         * bindings/jni/jni_instance.h:
974            -made copying private since it's unused and it's also not clear
975             excatly how copying would work with Java security
976             -made default construction private since it's meaningless
977
978 2005-08-08  Geoffrey Garen  <ggaren@apple.com>
979
980         -fixed crash caused by fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=4313
981         
982         - exceptionDescription now gets explicitly initialized to NULL in all
983         the places listed below -- our wrapper classes used to take care of this 
984         automagically
985         
986         * bindings/jni/jni_instance.cpp:
987         (JavaInstance::invokeMethod):
988         * bindings/jni/jni_runtime.cpp:
989         (JavaField::dispatchValueFromInstance):
990         (JavaField::dispatchSetValueToInstance):
991
992 2005-08-08  Darin Adler  <darin@apple.com>
993
994         Reviewed by John Sullivan.
995
996         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4325
997           Mozilla Date tests have an unnecessary loop that runs 1970 times before each test
998
999         * tests/mozilla/ecma/shell.js: Added TIME_YEAR_0 constant.
1000
1001         * tests/mozilla/ecma/Date/15.9.5.10-1.js: Removed the loop and changed code to use the constant.
1002         * tests/mozilla/ecma/Date/15.9.5.10-10.js: Ditto.
1003         * tests/mozilla/ecma/Date/15.9.5.10-11.js: Ditto.
1004         * tests/mozilla/ecma/Date/15.9.5.10-12.js: Ditto.
1005         * tests/mozilla/ecma/Date/15.9.5.10-13.js: Ditto.
1006         * tests/mozilla/ecma/Date/15.9.5.10-2.js: Ditto.
1007         * tests/mozilla/ecma/Date/15.9.5.10-3.js: Ditto.
1008         * tests/mozilla/ecma/Date/15.9.5.10-4.js: Ditto.
1009         * tests/mozilla/ecma/Date/15.9.5.10-5.js: Ditto.
1010         * tests/mozilla/ecma/Date/15.9.5.10-6.js: Ditto.
1011         * tests/mozilla/ecma/Date/15.9.5.10-7.js: Ditto.
1012         * tests/mozilla/ecma/Date/15.9.5.10-8.js: Ditto.
1013         * tests/mozilla/ecma/Date/15.9.5.10-9.js: Ditto.
1014         * tests/mozilla/ecma/Date/15.9.5.11-2.js: Ditto.
1015         * tests/mozilla/ecma/Date/15.9.5.12-1.js: Ditto.
1016         * tests/mozilla/ecma/Date/15.9.5.12-2.js: Ditto.
1017         * tests/mozilla/ecma/Date/15.9.5.12-3.js: Ditto.
1018         * tests/mozilla/ecma/Date/15.9.5.12-4.js: Ditto.
1019         * tests/mozilla/ecma/Date/15.9.5.12-5.js: Ditto.
1020         * tests/mozilla/ecma/Date/15.9.5.12-6.js: Ditto.
1021         * tests/mozilla/ecma/Date/15.9.5.12-7.js: Ditto.
1022         * tests/mozilla/ecma/Date/15.9.5.12-8.js: Ditto.
1023         * tests/mozilla/ecma/Date/15.9.5.13-2.js: Ditto.
1024         * tests/mozilla/ecma/Date/15.9.5.13-8.js: Ditto.
1025         * tests/mozilla/ecma/Date/15.9.5.14.js: Ditto.
1026         * tests/mozilla/ecma/Date/15.9.5.15.js: Ditto.
1027         * tests/mozilla/ecma/Date/15.9.5.16.js: Ditto.
1028         * tests/mozilla/ecma/Date/15.9.5.17.js: Ditto.
1029         * tests/mozilla/ecma/Date/15.9.5.18.js: Ditto.
1030         * tests/mozilla/ecma/Date/15.9.5.19.js: Ditto.
1031         * tests/mozilla/ecma/Date/15.9.5.20.js: Ditto.
1032         * tests/mozilla/ecma/Date/15.9.5.21-1.js: Ditto.
1033         * tests/mozilla/ecma/Date/15.9.5.21-2.js: Ditto.
1034         * tests/mozilla/ecma/Date/15.9.5.21-3.js: Ditto.
1035         * tests/mozilla/ecma/Date/15.9.5.21-4.js: Ditto.
1036         * tests/mozilla/ecma/Date/15.9.5.21-5.js: Ditto.
1037         * tests/mozilla/ecma/Date/15.9.5.21-6.js: Ditto.
1038         * tests/mozilla/ecma/Date/15.9.5.21-7.js: Ditto.
1039         * tests/mozilla/ecma/Date/15.9.5.21-8.js: Ditto.
1040         * tests/mozilla/ecma/Date/15.9.5.22-1.js: Ditto.
1041         * tests/mozilla/ecma/Date/15.9.5.22-2.js: Ditto.
1042         * tests/mozilla/ecma/Date/15.9.5.22-3.js: Ditto.
1043         * tests/mozilla/ecma/Date/15.9.5.22-4.js: Ditto.
1044         * tests/mozilla/ecma/Date/15.9.5.22-5.js: Ditto.
1045         * tests/mozilla/ecma/Date/15.9.5.22-6.js: Ditto.
1046         * tests/mozilla/ecma/Date/15.9.5.22-7.js: Ditto.
1047         * tests/mozilla/ecma/Date/15.9.5.22-8.js: Ditto.
1048         * tests/mozilla/ecma/Date/15.9.5.23-4.js: Ditto.
1049         * tests/mozilla/ecma/Date/15.9.5.23-5.js: Ditto.
1050         * tests/mozilla/ecma/Date/15.9.5.23-6.js: Ditto.
1051         * tests/mozilla/ecma/Date/15.9.5.23-7.js: Ditto.
1052         * tests/mozilla/ecma/Date/15.9.5.23-8.js: Ditto.
1053         * tests/mozilla/ecma/Date/15.9.5.23-9.js: Ditto.
1054         * tests/mozilla/ecma/Date/15.9.5.5.js: Ditto.
1055         * tests/mozilla/ecma/Date/15.9.5.6.js: Ditto.
1056         * tests/mozilla/ecma/Date/15.9.5.7.js: Ditto.
1057         * tests/mozilla/ecma/Date/15.9.5.8.js: Ditto.
1058         * tests/mozilla/ecma/Date/15.9.5.9.js: Ditto.
1059
1060 2005-08-08  Darin Adler  <darin@apple.com>
1061
1062         - forgot to delete an obsolete file
1063
1064         * kjs/object_wrapper.h: Deleted.
1065
1066 2005-08-07  Darin Adler  <darin@apple.com>
1067
1068         - fixed two problems compiling with gcc 4.0
1069
1070         * kjs/array_object.cpp: (ArrayProtoFuncImp::callAsFunction): Initialized a
1071         variable to quiet an erroneous warning.
1072         * kjs/date_object.cpp: (KJS::makeTime): Removed extraneous KJS:: prefix.
1073
1074 2005-08-07  Darin Adler  <darin@apple.com>
1075
1076         Rubber stamped by Maciej.
1077
1078         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4313
1079           eliminate KJS::Value and KJS::Object smart pointer wrappers (for simplicity and speed)
1080
1081         * JavaScriptCore.xcodeproj/project.pbxproj: Removed object_wrapper.h.
1082
1083         Global replaces and other wonderful stuff.
1084
1085         * bindings/NP_jsobject.cpp:
1086         (_NPN_Invoke):
1087         (_NPN_Evaluate):
1088         (_NPN_GetProperty):
1089         (_NPN_SetProperty):
1090         (_NPN_HasMethod):
1091         (_NPN_SetException):
1092         * bindings/c/c_instance.cpp:
1093         (KJS::Bindings::CInstance::CInstance):
1094         (KJS::Bindings::CInstance::invokeMethod):
1095         (KJS::Bindings::CInstance::invokeDefaultMethod):
1096         (KJS::Bindings::CInstance::defaultValue):
1097         (KJS::Bindings::CInstance::stringValue):
1098         (KJS::Bindings::CInstance::numberValue):
1099         (KJS::Bindings::CInstance::booleanValue):
1100         (KJS::Bindings::CInstance::valueOf):
1101         * bindings/c/c_instance.h:
1102         * bindings/c/c_runtime.cpp:
1103         (CField::valueFromInstance):
1104         (CField::setValueToInstance):
1105         * bindings/c/c_runtime.h:
1106         * bindings/c/c_utility.cpp:
1107         (convertNPStringToUTF16):
1108         (convertUTF8ToUTF16):
1109         (coerceValueToNPVariantStringType):
1110         (convertValueToNPVariant):
1111         (convertNPVariantToValue):
1112         * bindings/c/c_utility.h:
1113         * bindings/jni/jni_instance.cpp:
1114         (JavaInstance::stringValue):
1115         (JavaInstance::numberValue):
1116         (JavaInstance::booleanValue):
1117         (JavaInstance::invokeMethod):
1118         (JavaInstance::invokeDefaultMethod):
1119         (JavaInstance::defaultValue):
1120         (JavaInstance::valueOf):
1121         * bindings/jni/jni_instance.h:
1122         * bindings/jni/jni_jsobject.cpp:
1123         (JSObject::invoke):
1124         (JSObject::call):
1125         (JSObject::eval):
1126         (JSObject::getMember):
1127         (JSObject::getSlot):
1128         (JSObject::toString):
1129         (JSObject::convertValueToJObject):
1130         (JSObject::convertJObjectToValue):
1131         (JSObject::listFromJArray):
1132         * bindings/jni/jni_jsobject.h:
1133         * bindings/jni/jni_objc.mm:
1134         (KJS::Bindings::dispatchJNICall):
1135         * bindings/jni/jni_runtime.cpp:
1136         (JavaArray::convertJObjectToArray):
1137         (JavaField::dispatchValueFromInstance):
1138         (JavaField::valueFromInstance):
1139         (JavaField::dispatchSetValueToInstance):
1140         (JavaField::setValueToInstance):
1141         (JavaArray::setValueAt):
1142         (JavaArray::valueAt):
1143         * bindings/jni/jni_runtime.h:
1144         (KJS::Bindings::JavaString::ustring):
1145         * bindings/jni/jni_utility.cpp:
1146         (KJS::Bindings::getJavaVM):
1147         (KJS::Bindings::getJNIEnv):
1148         (KJS::Bindings::getMethodID):
1149         (KJS::Bindings::callJNIVoidMethod):
1150         (KJS::Bindings::callJNIObjectMethod):
1151         (KJS::Bindings::callJNIBooleanMethod):
1152         (KJS::Bindings::callJNIStaticBooleanMethod):
1153         (KJS::Bindings::callJNIByteMethod):
1154         (KJS::Bindings::callJNICharMethod):
1155         (KJS::Bindings::callJNIShortMethod):
1156         (KJS::Bindings::callJNIIntMethod):
1157         (KJS::Bindings::callJNILongMethod):
1158         (KJS::Bindings::callJNIFloatMethod):
1159         (KJS::Bindings::callJNIDoubleMethod):
1160         (KJS::Bindings::callJNIVoidMethodA):
1161         (KJS::Bindings::callJNIObjectMethodA):
1162         (KJS::Bindings::callJNIByteMethodA):
1163         (KJS::Bindings::callJNICharMethodA):
1164         (KJS::Bindings::callJNIShortMethodA):
1165         (KJS::Bindings::callJNIIntMethodA):
1166         (KJS::Bindings::callJNILongMethodA):
1167         (KJS::Bindings::callJNIFloatMethodA):
1168         (KJS::Bindings::callJNIDoubleMethodA):
1169         (KJS::Bindings::callJNIBooleanMethodA):
1170         (KJS::Bindings::callJNIVoidMethodIDA):
1171         (KJS::Bindings::callJNIObjectMethodIDA):
1172         (KJS::Bindings::callJNIByteMethodIDA):
1173         (KJS::Bindings::callJNICharMethodIDA):
1174         (KJS::Bindings::callJNIShortMethodIDA):
1175         (KJS::Bindings::callJNIIntMethodIDA):
1176         (KJS::Bindings::callJNILongMethodIDA):
1177         (KJS::Bindings::callJNIFloatMethodIDA):
1178         (KJS::Bindings::callJNIDoubleMethodIDA):
1179         (KJS::Bindings::callJNIBooleanMethodIDA):
1180         (KJS::Bindings::getCharactersFromJString):
1181         (KJS::Bindings::releaseCharactersForJString):
1182         (KJS::Bindings::getCharactersFromJStringInEnv):
1183         (KJS::Bindings::releaseCharactersForJStringInEnv):
1184         (KJS::Bindings::getUCharactersFromJStringInEnv):
1185         (KJS::Bindings::releaseUCharactersForJStringInEnv):
1186         (KJS::Bindings::JNITypeFromClassName):
1187         (KJS::Bindings::signatureFromPrimitiveType):
1188         (KJS::Bindings::JNITypeFromPrimitiveType):
1189         (KJS::Bindings::getJNIField):
1190         (KJS::Bindings::convertValueToJValue):
1191         * bindings/jni/jni_utility.h:
1192         * bindings/objc/WebScriptObject.mm:
1193         (_didExecute):
1194         (-[WebScriptObject _initializeWithObjectImp:originExecutionContext:Bindings::executionContext:Bindings::]):
1195         (-[WebScriptObject _initWithObjectImp:originExecutionContext:Bindings::executionContext:Bindings::]):
1196         (-[WebScriptObject _imp]):
1197         (-[WebScriptObject _executionContext]):
1198         (-[WebScriptObject _setExecutionContext:]):
1199         (-[WebScriptObject _originExecutionContext]):
1200         (-[WebScriptObject _setOriginExecutionContext:]):
1201         (+[WebScriptObject throwException:]):
1202         (listFromNSArray):
1203         (-[WebScriptObject callWebScriptMethod:withArguments:]):
1204         (-[WebScriptObject evaluateWebScript:]):
1205         (-[WebScriptObject setValue:forKey:]):
1206         (-[WebScriptObject valueForKey:]):
1207         (-[WebScriptObject removeWebScriptKey:]):
1208         (-[WebScriptObject stringRepresentation]):
1209         (-[WebScriptObject webScriptValueAtIndex:]):
1210         (-[WebScriptObject setException:]):
1211         (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:Bindings::]):
1212         * bindings/objc/WebScriptObjectPrivate.h:
1213         * bindings/objc/objc_class.h:
1214         * bindings/objc/objc_class.mm:
1215         (KJS::Bindings::ObjcClass::fallbackObject):
1216         * bindings/objc/objc_instance.h:
1217         * bindings/objc/objc_instance.mm:
1218         (ObjcInstance::invokeMethod):
1219         (ObjcInstance::invokeDefaultMethod):
1220         (ObjcInstance::setValueOfField):
1221         (ObjcInstance::setValueOfUndefinedField):
1222         (ObjcInstance::getValueOfField):
1223         (ObjcInstance::getValueOfUndefinedField):
1224         (ObjcInstance::defaultValue):
1225         (ObjcInstance::stringValue):
1226         (ObjcInstance::numberValue):
1227         (ObjcInstance::booleanValue):
1228         (ObjcInstance::valueOf):
1229         * bindings/objc/objc_runtime.h:
1230         * bindings/objc/objc_runtime.mm:
1231         (ObjcField::valueFromInstance):
1232         (convertValueToObjcObject):
1233         (ObjcField::setValueToInstance):
1234         (ObjcArray::setValueAt):
1235         (ObjcArray::valueAt):
1236         (ObjcFallbackObjectImp::put):
1237         (ObjcFallbackObjectImp::callAsFunction):
1238         (ObjcFallbackObjectImp::defaultValue):
1239         * bindings/objc/objc_utility.h:
1240         * bindings/objc/objc_utility.mm:
1241         (Bindings::JSMethodNameToObjCMethodName):
1242         (Bindings::convertValueToObjcValue):
1243         (Bindings::convertNSStringToString):
1244         (Bindings::convertObjcValueToValue):
1245         (Bindings::objcValueTypeForType):
1246         (Bindings::createObjcInstanceForValue):
1247         * bindings/runtime.cpp:
1248         (Instance::getValueOfField):
1249         (Instance::setValueOfField):
1250         (Instance::createRuntimeObject):
1251         (Instance::createLanguageInstanceForValue):
1252         * bindings/runtime.h:
1253         (KJS::Bindings::Constructor::~Constructor):
1254         (KJS::Bindings::Field::~Field):
1255         (KJS::Bindings::MethodList::MethodList):
1256         (KJS::Bindings::Class::fallbackObject):
1257         (KJS::Bindings::Class::~Class):
1258         (KJS::Bindings::Instance::Instance):
1259         (KJS::Bindings::Instance::getValueOfUndefinedField):
1260         (KJS::Bindings::Instance::supportsSetValueOfUndefinedField):
1261         (KJS::Bindings::Instance::setValueOfUndefinedField):
1262         (KJS::Bindings::Instance::valueOf):
1263         (KJS::Bindings::Instance::setExecutionContext):
1264         (KJS::Bindings::Instance::~Instance):
1265         (KJS::Bindings::Array::~Array):
1266         * bindings/runtime_array.cpp:
1267         (RuntimeArrayImp::RuntimeArrayImp):
1268         (RuntimeArrayImp::lengthGetter):
1269         (RuntimeArrayImp::indexGetter):
1270         (RuntimeArrayImp::put):
1271         * bindings/runtime_array.h:
1272         * bindings/runtime_method.cpp:
1273         (RuntimeMethodImp::lengthGetter):
1274         (RuntimeMethodImp::callAsFunction):
1275         * bindings/runtime_method.h:
1276         * bindings/runtime_object.cpp:
1277         (RuntimeObjectImp::fallbackObjectGetter):
1278         (RuntimeObjectImp::fieldGetter):
1279         (RuntimeObjectImp::methodGetter):
1280         (RuntimeObjectImp::getOwnPropertySlot):
1281         (RuntimeObjectImp::put):
1282         (RuntimeObjectImp::defaultValue):
1283         (RuntimeObjectImp::callAsFunction):
1284         * bindings/runtime_object.h:
1285         * kjs/array_instance.h:
1286         * kjs/array_object.cpp:
1287         (ArrayInstanceImp::ArrayInstanceImp):
1288         (ArrayInstanceImp::lengthGetter):
1289         (ArrayInstanceImp::getOwnPropertySlot):
1290         (ArrayInstanceImp::put):
1291         (ArrayInstanceImp::propList):
1292         (ArrayInstanceImp::setLength):
1293         (compareByStringForQSort):
1294         (compareWithCompareFunctionForQSort):
1295         (ArrayInstanceImp::sort):
1296         (ArrayInstanceImp::pushUndefinedObjectsToEnd):
1297         (ArrayPrototypeImp::ArrayPrototypeImp):
1298         (ArrayProtoFuncImp::ArrayProtoFuncImp):
1299         (ArrayProtoFuncImp::callAsFunction):
1300         (ArrayObjectImp::ArrayObjectImp):
1301         (ArrayObjectImp::construct):
1302         (ArrayObjectImp::callAsFunction):
1303         * kjs/array_object.h:
1304         * kjs/bool_object.cpp:
1305         (BooleanPrototypeImp::BooleanPrototypeImp):
1306         (BooleanProtoFuncImp::BooleanProtoFuncImp):
1307         (BooleanProtoFuncImp::callAsFunction):
1308         (BooleanObjectImp::BooleanObjectImp):
1309         (BooleanObjectImp::construct):
1310         (BooleanObjectImp::callAsFunction):
1311         * kjs/bool_object.h:
1312         * kjs/collector.cpp:
1313         (KJS::Collector::markStackObjectsConservatively):
1314         (KJS::Collector::collect):
1315         (KJS::className):
1316         * kjs/completion.h:
1317         (KJS::Completion::Completion):
1318         (KJS::Completion::value):
1319         (KJS::Completion::isValueCompletion):
1320         * kjs/context.h:
1321         (KJS::ContextImp::variableObject):
1322         (KJS::ContextImp::setVariableObject):
1323         (KJS::ContextImp::thisValue):
1324         (KJS::ContextImp::activationObject):
1325         (KJS::ContextImp::pushScope):
1326         * kjs/date_object.cpp:
1327         (formatLocaleDate):
1328         (KJS::timeFromArgs):
1329         (KJS::DatePrototypeImp::DatePrototypeImp):
1330         (KJS::DateProtoFuncImp::DateProtoFuncImp):
1331         (KJS::DateProtoFuncImp::callAsFunction):
1332         (KJS::DateObjectImp::DateObjectImp):
1333         (KJS::DateObjectImp::construct):
1334         (KJS::DateObjectImp::callAsFunction):
1335         (KJS::DateObjectFuncImp::DateObjectFuncImp):
1336         (KJS::DateObjectFuncImp::callAsFunction):
1337         (KJS::parseDate):
1338         (KJS::KRFCDate_parseDate):
1339         (KJS::timeClip):
1340         * kjs/date_object.h:
1341         * kjs/debugger.cpp:
1342         (Debugger::exception):
1343         (Debugger::callEvent):
1344         (Debugger::returnEvent):
1345         * kjs/debugger.h:
1346         * kjs/error_object.cpp:
1347         (ErrorPrototypeImp::ErrorPrototypeImp):
1348         (ErrorProtoFuncImp::ErrorProtoFuncImp):
1349         (ErrorProtoFuncImp::callAsFunction):
1350         (ErrorObjectImp::ErrorObjectImp):
1351         (ErrorObjectImp::construct):
1352         (ErrorObjectImp::callAsFunction):
1353         (NativeErrorPrototypeImp::NativeErrorPrototypeImp):
1354         (NativeErrorImp::NativeErrorImp):
1355         (NativeErrorImp::construct):
1356         (NativeErrorImp::callAsFunction):
1357         * kjs/error_object.h:
1358         * kjs/function.cpp:
1359         (KJS::FunctionImp::FunctionImp):
1360         (KJS::FunctionImp::callAsFunction):
1361         (KJS::FunctionImp::processParameters):
1362         (KJS::FunctionImp::argumentsGetter):
1363         (KJS::FunctionImp::lengthGetter):
1364         (KJS::FunctionImp::put):
1365         (KJS::DeclaredFunctionImp::DeclaredFunctionImp):
1366         (KJS::DeclaredFunctionImp::construct):
1367         (KJS::ArgumentsImp::ArgumentsImp):
1368         (KJS::ArgumentsImp::mappedIndexGetter):
1369         (KJS::ArgumentsImp::put):
1370         (KJS::ActivationImp::argumentsGetter):
1371         (KJS::GlobalFuncImp::GlobalFuncImp):
1372         (KJS::encode):
1373         (KJS::decode):
1374         (KJS::GlobalFuncImp::callAsFunction):
1375         * kjs/function.h:
1376         * kjs/function_object.cpp:
1377         (FunctionPrototypeImp::FunctionPrototypeImp):
1378         (FunctionPrototypeImp::callAsFunction):
1379         (FunctionProtoFuncImp::FunctionProtoFuncImp):
1380         (FunctionProtoFuncImp::callAsFunction):
1381         (FunctionObjectImp::FunctionObjectImp):
1382         (FunctionObjectImp::construct):
1383         (FunctionObjectImp::callAsFunction):
1384         * kjs/function_object.h:
1385         * kjs/internal.cpp:
1386         (KJS::UndefinedImp::toPrimitive):
1387         (KJS::UndefinedImp::toObject):
1388         (KJS::NullImp::toPrimitive):
1389         (KJS::NullImp::toObject):
1390         (KJS::BooleanImp::toPrimitive):
1391         (KJS::BooleanImp::toObject):
1392         (KJS::StringImp::toPrimitive):
1393         (KJS::StringImp::toObject):
1394         (KJS::NumberImp::toPrimitive):
1395         (KJS::NumberImp::toObject):
1396         (KJS::NumberImp::getUInt32):
1397         (KJS::LabelStack::push):
1398         (KJS::ContextImp::ContextImp):
1399         (KJS::InterpreterImp::globalInit):
1400         (KJS::InterpreterImp::globalClear):
1401         (KJS::InterpreterImp::InterpreterImp):
1402         (KJS::InterpreterImp::initGlobalObject):
1403         (KJS::InterpreterImp::clear):
1404         (KJS::InterpreterImp::mark):
1405         (KJS::InterpreterImp::evaluate):
1406         (KJS::InternalFunctionImp::hasInstance):
1407         (KJS::roundValue):
1408         (KJS::printInfo):
1409         * kjs/internal.h:
1410         (KJS::InterpreterImp::builtinObject):
1411         (KJS::InterpreterImp::builtinFunction):
1412         (KJS::InterpreterImp::builtinArray):
1413         (KJS::InterpreterImp::builtinBoolean):
1414         (KJS::InterpreterImp::builtinString):
1415         (KJS::InterpreterImp::builtinNumber):
1416         (KJS::InterpreterImp::builtinDate):
1417         (KJS::InterpreterImp::builtinRegExp):
1418         (KJS::InterpreterImp::builtinError):
1419         (KJS::InterpreterImp::builtinObjectPrototype):
1420         (KJS::InterpreterImp::builtinFunctionPrototype):
1421         (KJS::InterpreterImp::builtinArrayPrototype):
1422         (KJS::InterpreterImp::builtinBooleanPrototype):
1423         (KJS::InterpreterImp::builtinStringPrototype):
1424         (KJS::InterpreterImp::builtinNumberPrototype):
1425         (KJS::InterpreterImp::builtinDatePrototype):
1426         (KJS::InterpreterImp::builtinRegExpPrototype):
1427         (KJS::InterpreterImp::builtinErrorPrototype):
1428         (KJS::InterpreterImp::builtinEvalError):
1429         (KJS::InterpreterImp::builtinRangeError):
1430         (KJS::InterpreterImp::builtinReferenceError):
1431         (KJS::InterpreterImp::builtinSyntaxError):
1432         (KJS::InterpreterImp::builtinTypeError):
1433         (KJS::InterpreterImp::builtinURIError):
1434         (KJS::InterpreterImp::builtinEvalErrorPrototype):
1435         (KJS::InterpreterImp::builtinRangeErrorPrototype):
1436         (KJS::InterpreterImp::builtinReferenceErrorPrototype):
1437         (KJS::InterpreterImp::builtinSyntaxErrorPrototype):
1438         (KJS::InterpreterImp::builtinTypeErrorPrototype):
1439         (KJS::InterpreterImp::builtinURIErrorPrototype):
1440         * kjs/interpreter.cpp:
1441         (Context::variableObject):
1442         (Context::thisValue):
1443         (Interpreter::Interpreter):
1444         (Interpreter::globalObject):
1445         (Interpreter::evaluate):
1446         (Interpreter::builtinObject):
1447         (Interpreter::builtinFunction):
1448         (Interpreter::builtinArray):
1449         (Interpreter::builtinBoolean):
1450         (Interpreter::builtinString):
1451         (Interpreter::builtinNumber):
1452         (Interpreter::builtinDate):
1453         (Interpreter::builtinRegExp):
1454         (Interpreter::builtinError):
1455         (Interpreter::builtinObjectPrototype):
1456         (Interpreter::builtinFunctionPrototype):
1457         (Interpreter::builtinArrayPrototype):
1458         (Interpreter::builtinBooleanPrototype):
1459         (Interpreter::builtinStringPrototype):
1460         (Interpreter::builtinNumberPrototype):
1461         (Interpreter::builtinDatePrototype):
1462         (Interpreter::builtinRegExpPrototype):
1463         (Interpreter::builtinErrorPrototype):
1464         (Interpreter::builtinEvalError):
1465         (Interpreter::builtinRangeError):
1466         (Interpreter::builtinReferenceError):
1467         (Interpreter::builtinSyntaxError):
1468         (Interpreter::builtinTypeError):
1469         (Interpreter::builtinURIError):
1470         (Interpreter::builtinEvalErrorPrototype):
1471         (Interpreter::builtinRangeErrorPrototype):
1472         (Interpreter::builtinReferenceErrorPrototype):
1473         (Interpreter::builtinSyntaxErrorPrototype):
1474         (Interpreter::builtinTypeErrorPrototype):
1475         (Interpreter::builtinURIErrorPrototype):
1476         (Interpreter::createLanguageInstanceForValue):
1477         * kjs/interpreter.h:
1478         (KJS::Interpreter::isGlobalObject):
1479         (KJS::ExecState::setException):
1480         (KJS::ExecState::clearException):
1481         (KJS::ExecState::exception):
1482         (KJS::ExecState::hadException):
1483         (KJS::ExecState::ExecState):
1484         * kjs/list.cpp:
1485         (KJS::List::at):
1486         * kjs/list.h:
1487         (KJS::List::operator[]):
1488         (KJS::ListIterator::operator->):
1489         (KJS::ListIterator::operator*):
1490         (KJS::ListIterator::operator++):
1491         (KJS::ListIterator::operator--):
1492         * kjs/lookup.h:
1493         (KJS::staticFunctionGetter):
1494         (KJS::staticValueGetter):
1495         (KJS::lookupPut):
1496         (KJS::cacheGlobalObject):
1497         * kjs/math_object.cpp:
1498         (MathObjectImp::getValueProperty):
1499         (MathFuncImp::MathFuncImp):
1500         (MathFuncImp::callAsFunction):
1501         * kjs/math_object.h:
1502         * kjs/nodes.cpp:
1503         (Node::evaluateReference):
1504         (Node::throwError):
1505         (Node::setExceptionDetailsIfNeeded):
1506         (NullNode::evaluate):
1507         (BooleanNode::evaluate):
1508         (NumberNode::evaluate):
1509         (StringNode::evaluate):
1510         (RegExpNode::evaluate):
1511         (ThisNode::evaluate):
1512         (ResolveNode::evaluate):
1513         (ResolveNode::evaluateReference):
1514         (GroupNode::evaluate):
1515         (ElementNode::evaluate):
1516         (ArrayNode::evaluate):
1517         (ObjectLiteralNode::evaluate):
1518         (PropertyValueNode::evaluate):
1519         (PropertyNode::evaluate):
1520         (AccessorNode1::evaluate):
1521         (AccessorNode1::evaluateReference):
1522         (AccessorNode2::evaluate):
1523         (AccessorNode2::evaluateReference):
1524         (ArgumentListNode::evaluate):
1525         (ArgumentListNode::evaluateList):
1526         (ArgumentsNode::evaluate):
1527         (NewExprNode::evaluate):
1528         (FunctionCallNode::evaluate):
1529         (PostfixNode::evaluate):
1530         (DeleteNode::evaluate):
1531         (VoidNode::evaluate):
1532         (TypeOfNode::evaluate):
1533         (PrefixNode::evaluate):
1534         (UnaryPlusNode::evaluate):
1535         (NegateNode::evaluate):
1536         (BitwiseNotNode::evaluate):
1537         (LogicalNotNode::evaluate):
1538         (MultNode::evaluate):
1539         (AddNode::evaluate):
1540         (ShiftNode::evaluate):
1541         (RelationalNode::evaluate):
1542         (EqualNode::evaluate):
1543         (BitOperNode::evaluate):
1544         (BinaryLogicalNode::evaluate):
1545         (ConditionalNode::evaluate):
1546         (AssignNode::evaluate):
1547         (CommaNode::evaluate):
1548         (StatListNode::execute):
1549         (AssignExprNode::evaluate):
1550         (VarDeclNode::evaluate):
1551         (VarDeclNode::processVarDecls):
1552         (VarDeclListNode::evaluate):
1553         (ExprStatementNode::execute):
1554         (IfNode::execute):
1555         (DoWhileNode::execute):
1556         (WhileNode::execute):
1557         (ForNode::execute):
1558         (ForInNode::execute):
1559         (ContinueNode::execute):
1560         (BreakNode::execute):
1561         (ReturnNode::execute):
1562         (WithNode::execute):
1563         (CaseClauseNode::evaluate):
1564         (ClauseListNode::evaluate):
1565         (CaseBlockNode::evaluate):
1566         (CaseBlockNode::evalBlock):
1567         (SwitchNode::execute):
1568         (ThrowNode::execute):
1569         (CatchNode::execute):
1570         (TryNode::execute):
1571         (ParameterNode::evaluate):
1572         (FuncDeclNode::processFuncDecl):
1573         (FuncExprNode::evaluate):
1574         (SourceElementsNode::execute):
1575         * kjs/nodes.h:
1576         (KJS::StatementNode::evaluate):
1577         * kjs/number_object.cpp:
1578         (NumberPrototypeImp::NumberPrototypeImp):
1579         (NumberProtoFuncImp::NumberProtoFuncImp):
1580         (NumberProtoFuncImp::callAsFunction):
1581         (NumberObjectImp::NumberObjectImp):
1582         (NumberObjectImp::getValueProperty):
1583         (NumberObjectImp::construct):
1584         (NumberObjectImp::callAsFunction):
1585         * kjs/number_object.h:
1586         * kjs/object.cpp:
1587         (KJS::ObjectImp::call):
1588         (KJS::ObjectImp::mark):
1589         (KJS::ObjectImp::classInfo):
1590         (KJS::ObjectImp::get):
1591         (KJS::ObjectImp::getProperty):
1592         (KJS::ObjectImp::getPropertySlot):
1593         (KJS::ObjectImp::put):
1594         (KJS::ObjectImp::hasOwnProperty):
1595         (KJS::ObjectImp::defaultValue):
1596         (KJS::ObjectImp::findPropertyHashEntry):
1597         (KJS::ObjectImp::construct):
1598         (KJS::ObjectImp::callAsFunction):
1599         (KJS::ObjectImp::hasInstance):
1600         (KJS::ObjectImp::propList):
1601         (KJS::ObjectImp::toPrimitive):
1602         (KJS::ObjectImp::toNumber):
1603         (KJS::ObjectImp::toString):
1604         (KJS::ObjectImp::toObject):
1605         (KJS::ObjectImp::putDirect):
1606         (KJS::Error::create):
1607         (KJS::error):
1608         * kjs/object.h:
1609         (KJS::):
1610         (KJS::ObjectImp::getPropertySlot):
1611         (KJS::AllocatedValueImp::isObject):
1612         (KJS::ObjectImp::ObjectImp):
1613         (KJS::ObjectImp::internalValue):
1614         (KJS::ObjectImp::setInternalValue):
1615         (KJS::ObjectImp::prototype):
1616         (KJS::ObjectImp::setPrototype):
1617         (KJS::ObjectImp::inherits):
1618         * kjs/object_object.cpp:
1619         (ObjectPrototypeImp::ObjectPrototypeImp):
1620         (ObjectProtoFuncImp::ObjectProtoFuncImp):
1621         (ObjectProtoFuncImp::callAsFunction):
1622         (ObjectObjectImp::ObjectObjectImp):
1623         (ObjectObjectImp::construct):
1624         (ObjectObjectImp::callAsFunction):
1625         * kjs/object_object.h:
1626         * kjs/operations.cpp:
1627         (KJS::equal):
1628         (KJS::strictEqual):
1629         (KJS::relation):
1630         (KJS::add):
1631         (KJS::mult):
1632         * kjs/operations.h:
1633         * kjs/property_map.cpp:
1634         (KJS::PropertyMap::mark):
1635         (KJS::PropertyMap::addEnumerablesToReferenceList):
1636         (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList):
1637         (KJS::PropertyMap::save):
1638         (KJS::PropertyMap::restore):
1639         * kjs/property_map.h:
1640         * kjs/property_slot.cpp:
1641         (KJS::PropertySlot::undefinedGetter):
1642         * kjs/property_slot.h:
1643         (KJS::PropertySlot::getValue):
1644         * kjs/protect.h:
1645         (KJS::gcUnprotectNullTolerant):
1646         (KJS::ProtectedValue::ProtectedValue):
1647         (KJS::ProtectedValue::~ProtectedValue):
1648         (KJS::ProtectedValue::operator=):
1649         (KJS::ProtectedValue::operator ValueImp *):
1650         (KJS::ProtectedValue::operator->):
1651         * kjs/protected_object.h:
1652         (KJS::ProtectedObject::ProtectedObject):
1653         (KJS::ProtectedObject::operator=):
1654         (KJS::ProtectedObject::operator ValueImp *):
1655         (KJS::ProtectedObject::operator ObjectImp *):
1656         (KJS::ProtectedObject::operator->):
1657         (KJS::ProtectedReference::ProtectedReference):
1658         (KJS::ProtectedReference::~ProtectedReference):
1659         (KJS::ProtectedReference::operator=):
1660         * kjs/protected_values.cpp:
1661         (KJS::ProtectedValues::getProtectCount):
1662         (KJS::ProtectedValues::increaseProtectCount):
1663         (KJS::ProtectedValues::insert):
1664         (KJS::ProtectedValues::decreaseProtectCount):
1665         * kjs/protected_values.h:
1666         * kjs/reference.cpp:
1667         (KJS::Reference::Reference):
1668         (KJS::Reference::makeValueReference):
1669         (KJS::Reference::getBase):
1670         (KJS::Reference::getValue):
1671         (KJS::Reference::putValue):
1672         (KJS::Reference::deleteValue):
1673         * kjs/reference.h:
1674         (KJS::Reference::baseIfMutable):
1675         * kjs/regexp_object.cpp:
1676         (RegExpPrototypeImp::RegExpPrototypeImp):
1677         (RegExpProtoFuncImp::RegExpProtoFuncImp):
1678         (RegExpProtoFuncImp::callAsFunction):
1679         (RegExpObjectImp::RegExpObjectImp):
1680         (RegExpObjectImp::arrayOfMatches):
1681         (RegExpObjectImp::backrefGetter):
1682         (RegExpObjectImp::construct):
1683         (RegExpObjectImp::callAsFunction):
1684         * kjs/regexp_object.h:
1685         * kjs/string_object.cpp:
1686         (StringInstanceImp::lengthGetter):
1687         (StringInstanceImp::indexGetter):
1688         (StringInstanceImp::getOwnPropertySlot):
1689         (StringInstanceImp::put):
1690         (StringPrototypeImp::StringPrototypeImp):
1691         (StringProtoFuncImp::StringProtoFuncImp):
1692         (regExpIsGlobal):
1693         (replace):
1694         (StringProtoFuncImp::callAsFunction):
1695         (StringObjectImp::StringObjectImp):
1696         (StringObjectImp::construct):
1697         (StringObjectImp::callAsFunction):
1698         (StringObjectFuncImp::StringObjectFuncImp):
1699         (StringObjectFuncImp::callAsFunction):
1700         * kjs/string_object.h:
1701         * kjs/testkjs.cpp:
1702         (TestFunctionImp::callAsFunction):
1703         (VersionFunctionImp::callAsFunction):
1704         (main):
1705         * kjs/value.cpp:
1706         (KJS::AllocatedValueImp::operator new):
1707         (KJS::AllocatedValueImp::getUInt32):
1708         (KJS::ValueImp::toInteger):
1709         (KJS::ValueImp::toInt32):
1710         (KJS::ValueImp::toUInt32):
1711         (KJS::ValueImp::toUInt16):
1712         (KJS::ValueImp::toObject):
1713         (KJS::AllocatedValueImp::getBoolean):
1714         (KJS::AllocatedValueImp::getNumber):
1715         (KJS::AllocatedValueImp::getString):
1716         (KJS::AllocatedValueImp::getObject):
1717         (KJS::jsString):
1718         (KJS::jsNumber):
1719         (KJS::ConstantValues::init):
1720         (KJS::ConstantValues::clear):
1721         (KJS::ConstantValues::mark):
1722         * kjs/value.h:
1723         (KJS::):
1724         (KJS::jsUndefined):
1725         (KJS::jsNull):
1726         (KJS::jsBoolean):
1727         (KJS::jsNaN):
1728         (KJS::ValueImp::ValueImp):
1729         (KJS::ValueImp::~ValueImp):
1730         (KJS::AllocatedValueImp::AllocatedValueImp):
1731         (KJS::AllocatedValueImp::~AllocatedValueImp):
1732         (KJS::AllocatedValueImp::isBoolean):
1733         (KJS::AllocatedValueImp::isNumber):
1734         (KJS::AllocatedValueImp::isString):
1735         (KJS::AllocatedValueImp::isObject):
1736         (KJS::AllocatedValueImp::marked):
1737         (KJS::AllocatedValueImp::mark):
1738         (KJS::ValueImp::downcast):
1739         (KJS::ValueImp::isUndefined):
1740         (KJS::ValueImp::isNull):
1741         (KJS::ValueImp::isUndefinedOrNull):
1742         (KJS::ValueImp::isBoolean):
1743         (KJS::ValueImp::isNumber):
1744         (KJS::ValueImp::isString):
1745         (KJS::ValueImp::isObject):
1746         (KJS::ValueImp::getBoolean):
1747         (KJS::ValueImp::getNumber):
1748         (KJS::ValueImp::getString):
1749         (KJS::ValueImp::getObject):
1750         (KJS::ValueImp::getUInt32):
1751         (KJS::ValueImp::mark):
1752         (KJS::ValueImp::marked):
1753         (KJS::ValueImp::type):
1754         (KJS::ValueImp::toPrimitive):
1755         (KJS::ValueImp::toBoolean):
1756         (KJS::ValueImp::toNumber):
1757         (KJS::ValueImp::toString):
1758         (KJS::jsZero):
1759         (KJS::jsOne):
1760         (KJS::jsTwo):
1761         (KJS::Undefined):
1762         (KJS::Null):
1763         (KJS::Boolean):
1764         (KJS::Number):
1765         (KJS::String):
1766
1767 2005-08-06  Maciej Stachowiak  <mjs@apple.com>
1768
1769         Reviewed by Darin.
1770
1771         Change over to the new PropertySlot mechanism for property
1772         lookup. This allows the elimination of hasOwnProperty
1773         methods. Also did some of the performance tuning enabled by this
1774         (but not yet all the possible improvements for function calls,
1775         assignment, ++, and so forth). And also much code cleanup.
1776
1777         Net result is about a 2% speedup on the JS iBench.
1778         
1779         Also redid Geoff's fix for the chrashing applet by avoiding a NULL
1780         prototype in the bindings code and using the default of Null()
1781         instead.
1782         
1783         * JavaScriptCore.xcodeproj/project.pbxproj:
1784         * bindings/objc/objc_runtime.h:
1785         * bindings/objc/objc_runtime.mm:
1786         (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
1787         (ObjcFallbackObjectImp::getOwnPropertySlot):
1788         * bindings/runtime_array.cpp:
1789         (RuntimeArrayImp::lengthGetter):
1790         (RuntimeArrayImp::indexGetter):
1791         (RuntimeArrayImp::getOwnPropertySlot):
1792         * bindings/runtime_array.h:
1793         * bindings/runtime_method.cpp:
1794         (RuntimeMethodImp::lengthGetter):
1795         (RuntimeMethodImp::getOwnPropertySlot):
1796         * bindings/runtime_method.h:
1797         * bindings/runtime_object.cpp:
1798         (RuntimeObjectImp::RuntimeObjectImp):
1799         (RuntimeObjectImp::fallbackObjectGetter):
1800         (RuntimeObjectImp::fieldGetter):
1801         (RuntimeObjectImp::methodGetter):
1802         (RuntimeObjectImp::getOwnPropertySlot):
1803         * bindings/runtime_object.h:
1804         * bindings/runtime_root.h:
1805         * kjs/array_instance.h:
1806         * kjs/array_object.cpp:
1807         (ArrayInstanceImp::lengthGetter):
1808         (ArrayInstanceImp::getOwnPropertySlot):
1809         (ArrayPrototypeImp::getOwnPropertySlot):
1810         * kjs/array_object.h:
1811         * kjs/date_object.cpp:
1812         (DatePrototypeImp::getOwnPropertySlot):
1813         * kjs/date_object.h:
1814         * kjs/function.cpp:
1815         (KJS::FunctionImp::argumentsGetter):
1816         (KJS::FunctionImp::lengthGetter):
1817         (KJS::FunctionImp::getOwnPropertySlot):
1818         (KJS::FunctionImp::put):
1819         (KJS::FunctionImp::deleteProperty):
1820         (KJS::ArgumentsImp::mappedIndexGetter):
1821         (KJS::ArgumentsImp::getOwnPropertySlot):
1822         (KJS::ActivationImp::argumentsGetter):
1823         (KJS::ActivationImp::getArgumentsGetter):
1824         (KJS::ActivationImp::getOwnPropertySlot):
1825         (KJS::ActivationImp::deleteProperty):
1826         * kjs/function.h:
1827         * kjs/internal.cpp:
1828         (InterpreterImp::InterpreterImp):
1829         (InterpreterImp::initGlobalObject):
1830         (InterpreterImp::~InterpreterImp):
1831         (InterpreterImp::evaluate):
1832         * kjs/internal.h:
1833         (KJS::InterpreterImp::globalExec):
1834         * kjs/interpreter.cpp:
1835         (Interpreter::Interpreter):
1836         (Interpreter::createLanguageInstanceForValue):
1837         * kjs/interpreter.h:
1838         (KJS::Interpreter::argumentsIdentifier):
1839         (KJS::Interpreter::specialPrototypeIdentifier):
1840         * kjs/lookup.h:
1841         (KJS::staticFunctionGetter):
1842         (KJS::staticValueGetter):
1843         (KJS::getStaticPropertySlot):
1844         (KJS::getStaticFunctionSlot):
1845         (KJS::getStaticValueSlot):
1846         * kjs/math_object.cpp:
1847         (MathObjectImp::getOwnPropertySlot):
1848         * kjs/math_object.h:
1849         * kjs/nodes.cpp:
1850         (ResolveNode::evaluate):
1851         (ResolveNode::evaluateReference):
1852         (AccessorNode1::evaluate):
1853         (AccessorNode2::evaluate):
1854         * kjs/number_object.cpp:
1855         (NumberObjectImp::getOwnPropertySlot):
1856         * kjs/number_object.h:
1857         * kjs/object.cpp:
1858         (KJS::ObjectImp::get):
1859         (KJS::ObjectImp::getProperty):
1860         (KJS::ObjectImp::getPropertySlot):
1861         (KJS::ObjectImp::getOwnPropertySlot):
1862         (KJS::ObjectImp::put):
1863         (KJS::ObjectImp::hasProperty):
1864         (KJS::ObjectImp::hasOwnProperty):
1865         * kjs/object.h:
1866         (KJS::ObjectImp::getDirectLocation):
1867         (KJS::ObjectImp::getPropertySlot):
1868         (KJS::ObjectImp::getOwnPropertySlot):
1869         * kjs/object_wrapper.h: Added.
1870         (KJS::):
1871         (KJS::Object::Object):
1872         (KJS::Object::operator ObjectImp *):
1873         * kjs/property_map.cpp:
1874         (KJS::PropertyMap::getLocation):
1875         * kjs/property_map.h:
1876         * kjs/property_slot.cpp: Added.
1877         (KJS::PropertySlot::undefinedGetter):
1878         * kjs/property_slot.h: Added.
1879         (KJS::PropertySlot::isSet):
1880         (KJS::PropertySlot::getValue):
1881         (KJS::PropertySlot::setValueSlot):
1882         (KJS::PropertySlot::setStaticEntry):
1883         (KJS::PropertySlot::setCustom):
1884         (KJS::PropertySlot::setCustomIndex):
1885         (KJS::PropertySlot::setUndefined):
1886         (KJS::PropertySlot::slotBase):
1887         (KJS::PropertySlot::staticEntry):
1888         (KJS::PropertySlot::index):
1889         (KJS::PropertySlot::):
1890         * kjs/protect.h:
1891         * kjs/protected_object.h: Added.
1892         (KJS::ProtectedObject::ProtectedObject):
1893         (KJS::ProtectedObject::~ProtectedObject):
1894         (KJS::ProtectedObject::operator=):
1895         (KJS::ProtectedReference::ProtectedReference):
1896         (KJS::ProtectedReference::~ProtectedReference):
1897         (KJS::ProtectedReference::operator=):
1898         * kjs/reference.h:
1899         * kjs/reference_list.cpp:
1900         * kjs/regexp_object.cpp:
1901         (RegExpObjectImp::backrefGetter):
1902         (RegExpObjectImp::getOwnPropertySlot):
1903         * kjs/regexp_object.h:
1904         * kjs/string_object.cpp:
1905         (StringInstanceImp::lengthGetter):
1906         (StringInstanceImp::indexGetter):
1907         (StringInstanceImp::getOwnPropertySlot):
1908         (StringPrototypeImp::getOwnPropertySlot):
1909         * kjs/string_object.h:
1910
1911 2005-08-05  Adele Peterson  <adele@apple.com>
1912
1913         Reviewed by Darin.
1914
1915         * JavaScriptCore.xcodeproj/project.pbxproj: Unchecked 'statics are thread safe' option.
1916
1917 2005-08-05  Geoffrey Garen  <ggaren@apple.com>
1918
1919         -fixed <rdar://problem/4207220> REGRESSION (DENVER): Crash occurs 
1920         after clicking on Hangman applet
1921
1922         Reviewed by darin.
1923
1924         * kjs/object.cpp:
1925         (KJS::ObjectImp::hasProperty): added check for null prototype.
1926
1927         FIXME: The long-term plan is to make runtime objects use JS Null()
1928         instead of null pointers, which will allow us to eliminate null
1929         checks, improving performance.
1930
1931 2005-08-05  Geoffrey Garen  <ggaren@apple.com>
1932
1933         Fix by darin, reviewed by me.
1934         
1935         - rolled in fix for: <rdar://problem/4161606> JavaScript regular 
1936         expressions with certain ranges of Unicode characters cause a crash
1937
1938         Test cases added:
1939
1940         * layout-tests/fast/js/regexp-big-unicode-ranges-expected.txt: Added.
1941         * layout-tests/fast/js/regexp-big-unicode-ranges.html: Added.
1942
1943         * pcre/pcre.c:
1944         (compile_branch): added checks for characters > 255
1945
1946 2005-08-04  Maciej Stachowiak  <mjs@apple.com>
1947
1948         - updated expected test results now that we no longer exlude the
1949         date tests (apparently this was overlooked)
1950
1951         * tests/mozilla/expected.html:
1952
1953 2005-07-31  Darin Adler  <darin@apple.com>
1954
1955         Reviewed by Maciej.
1956
1957         - remove uses of Mac-OS-X-specific MAX macro
1958         - remove one of the many excess "APPLE_CHANGES" ifdefs
1959
1960         * kjs/collector.cpp: (KJS::Collector::allocate): Use std::max instead of MAX.
1961         * kjs/property_map.cpp: (KJS::PropertyMap::rehash): Ditto.
1962         * kjs/ustring.cpp:
1963         (KJS::UChar::toLower): Take out non-ICU code path.
1964         (KJS::UChar::toUpper): Ditto.
1965         (KJS::UString::spliceSubstringsWithSeparators): Use std::max instead of MAX.
1966
1967 2005-07-27  Geoffrey Garen  <ggaren@apple.com>
1968
1969         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4147
1970         Array.toString() and toLocaleString() improvements from KDE KJS
1971         (rolled in KDE changes)
1972
1973         Test cases added:
1974
1975         * layout-tests/fast/js/toString-overrides-expected.txt: Added.
1976         * layout-tests/fast/js/toString-overrides.html: Added.
1977         
1978         * kjs/array_object.cpp:
1979         (ArrayProtoFuncImp::call):
1980
1981 2005-07-27  Maciej Stachowiak  <mjs@apple.com>
1982
1983         Changes by Michael Kahl, reviewed by me.
1984
1985         - fixed <rdar://problem/4194278> Need better debugging support in JavaScriptCore
1986         
1987         * JavaScriptCore.xcodeproj/project.pbxproj:
1988         * kjs/debugger.cpp:
1989         (KJS::AttachedInterpreter::AttachedInterpreter):
1990         (KJS::AttachedInterpreter::~AttachedInterpreter):
1991         (Debugger::~Debugger):
1992         (Debugger::attach):
1993         (Debugger::detach):
1994         (Debugger::sourceParsed):
1995         * kjs/debugger.h:
1996         * kjs/function.cpp:
1997         (KJS::FunctionImp::call):
1998         (KJS::GlobalFuncImp::call):
1999         * kjs/function_object.cpp:
2000         (FunctionObjectImp::construct):
2001         * kjs/grammar.y:
2002         * kjs/internal.cpp:
2003         (Parser::parse):
2004         (InterpreterImp::evaluate):
2005         * kjs/internal.h:
2006         (KJS::InterpreterImp::setDebugger):
2007         * kjs/interpreter.cpp:
2008         * kjs/interpreter.h:
2009         (KJS::Interpreter::imp):
2010         * kjs/nodes.cpp:
2011
2012 2005-07-27  Geoffrey Garen  <ggaren@apple.com>
2013
2014         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3381
2015         Date.prototype.setDate() incorrect for values >=128
2016         
2017         - Test cases added:
2018
2019         * layout-tests/fast/js/date-big-setdate-expected.txt: Added.
2020         * layout-tests/fast/js/date-big-setdate.html: Added.
2021
2022         Reviewed by darin.
2023
2024         * kjs/date_object.cpp:
2025         (DateProtoFuncImp::call):
2026
2027 2005-07-27  Geoffrey Garen  <ggaren@apple.com>
2028
2029         -rolled in patch by Carsten Guenther <cguenther@gmail.com>
2030         for http://bugzilla.opendarwin.org/show_bug.cgi?id=3759
2031         Date object enhancements
2032         
2033         Test cases added:
2034
2035         * layout-tests/fast/js/date-preserve-milliseconds-expected.txt: Added.
2036         * layout-tests/fast/js/date-preserve-milliseconds.html: Added.
2037
2038         Reviewed by darin.
2039
2040         * kjs/date_object.cpp:
2041         (timeFromArgs):
2042         (DateProtoFuncImp::call):
2043         (DateObjectImp::construct):
2044         (DateObjectFuncImp::call):
2045         (KJS::makeTime):
2046         * kjs/date_object.h:
2047         * tests/mozilla/expected.html:
2048
2049 2005-07-26  Justin Garcia  <justin.garcia@apple.com>
2050
2051         Added a forward declaration to fix gcc4 build error
2052
2053         * kjs/function.h:
2054
2055 2005-07-25  Geoffrey Garen  <ggaren@apple.com>
2056         - fixed mistake in my last checkin -- the expected results included
2057         results from a patch that hasn't landed yet.
2058         
2059         * tests/mozilla/expected.html:
2060
2061 2005-07-25  Maciej Stachowiak  <mjs@apple.com>
2062
2063         - fix mistake in last change that leads to assertion failure in the Development build
2064
2065         * kjs/lookup.h:
2066         (KJS::lookupGetOwnValue):
2067
2068 2005-07-24  Maciej Stachowiak  <mjs@apple.com>
2069
2070         Reviewed by Darin.
2071
2072         - http://bugzilla.opendarwin.org/show_bug.cgi?id=4124
2073         (change JavaScript property access to avoid double lookup)
2074
2075         - 10% speedup on JavaScript iBench
2076         - 5% speedup on 24fun BenchJS benchmark
2077
2078         Changed all get methods to getOwnProperty - they are no longer
2079         responsible for prototype lookup, and determine if the property
2080         was found as a side efect. 
2081
2082         get() is now a nonvirtual ObjectImp method which calls the virtual
2083         getOwnProperty and walks the prototype chain. A few selected
2084         methods were inlined.
2085
2086         Changed ResolveNode::evaluate plus some other places to use
2087         getProperty which does get() and hasProperty() in one lookup.
2088
2089         Also miscellaneous code cleanup.
2090         
2091         * bindings/objc/objc_runtime.h:
2092         * bindings/objc/objc_runtime.mm:
2093         (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
2094         (ObjcFallbackObjectImp::getOwnProperty):
2095         * bindings/runtime_array.cpp:
2096         (RuntimeArrayImp::RuntimeArrayImp):
2097         (RuntimeArrayImp::getOwnProperty):
2098         * bindings/runtime_array.h:
2099         * bindings/runtime_method.cpp:
2100         (RuntimeMethodImp::getOwnProperty):
2101         * bindings/runtime_method.h:
2102         * bindings/runtime_object.cpp:
2103         (RuntimeObjectImp::getOwnProperty):
2104         * bindings/runtime_object.h:
2105         * kjs/array_instance.h:
2106         * kjs/array_object.cpp:
2107         (ArrayInstanceImp::getOwnProperty):
2108         (ArrayPrototypeImp::getOwnProperty):
2109         (ArrayProtoFuncImp::call):
2110         * kjs/array_object.h:
2111         * kjs/date_object.cpp:
2112         (DatePrototypeImp::getOwnProperty):
2113         * kjs/date_object.h:
2114         * kjs/function.cpp:
2115         (KJS::FunctionImp::getOwnProperty):
2116         (KJS::ArgumentsImp::getOwnProperty):
2117         (KJS::ActivationImp::getOwnProperty):
2118         * kjs/function.h:
2119         * kjs/lookup.h:
2120         (KJS::lookupGetOwnProperty):
2121         (KJS::lookupGetOwnFunction):
2122         (KJS::lookupGetOwnValue):
2123         * kjs/math_object.cpp:
2124         (MathObjectImp::getOwnProperty):
2125         (MathObjectImp::getValueProperty):
2126         * kjs/math_object.h:
2127         * kjs/nodes.cpp:
2128         (ResolveNode::evaluate):
2129         * kjs/number_object.cpp:
2130         (NumberObjectImp::getOwnProperty):
2131         * kjs/number_object.h:
2132         * kjs/object.cpp:
2133         (KJS::ObjectImp::get):
2134         (KJS::ObjectImp::getOwnProperty):
2135         (KJS::ObjectImp::getProperty):
2136         * kjs/object.h:
2137         (KJS::ObjectImp::getProperty):
2138         (KJS::ObjectImp::getOwnProperty):
2139         * kjs/object_object.cpp:
2140         (ObjectProtoFuncImp::call):
2141         * kjs/regexp_object.cpp:
2142         (RegExpObjectImp::getOwnProperty):
2143         * kjs/regexp_object.h:
2144         * kjs/string_object.cpp:
2145         (StringInstanceImp::getOwnProperty):
2146         (StringPrototypeImp::getOwnProperty):
2147         * kjs/string_object.h:
2148
2149 2005-07-25  Geoffrey Garen  <ggaren@apple.com>
2150
2151         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3971
2152         JS test suite depends on JS 1.2 behavior
2153         
2154         Reviewed by darin.
2155
2156         * tests/mozilla/js1_2/Array/tostring_1.js: now tests only for JS 1.5 behavior
2157         * tests/mozilla/js1_2/Array/tostring_2.js: ditto
2158         * tests/mozilla/expected.html:
2159
2160 2005-07-24  Justin Garcia  <justin.garcia@apple.com>
2161
2162         Reviewed by kevin.
2163
2164         Fixes make clean problem introduced in xcode2.1 transition
2165
2166         * Makefile.am:
2167
2168 2005-07-22  Geoffrey Garen  <ggaren@apple.com>
2169
2170         Reviewed by darin.
2171
2172         * kjs/date_object.cpp: DatePrototypeImp now identifies itself as a
2173         child class of DateInstanceImp -- this enables calls to Date.ValueOf().
2174         
2175         fixes: ecma/Date/15.9.5.js (once we enable the date tests).
2176
2177 2005-07-22  Geoffrey Garen  <ggaren@apple.com>
2178
2179         
2180         Reviewed by darin.
2181
2182         * tests/mozilla/jsDriver.pl: now takes the path to testkjs as a command-line argument
2183         * tests/mozilla/run-mozilla-tests: Removed.
2184
2185 2005-07-21  Geoffrey Garen  <ggaren@apple.com>
2186
2187         * JavaScriptCore.xcodeproj/.cvsignore: Added.
2188
2189 2005-07-21  Geoffrey Garen  <ggaren@apple.com>
2190
2191         * JavaScriptCore.pbproj/project.pbxproj: Removed.
2192         * JavaScriptCore.xcodeproj/ggaren.pbxuser: Added.
2193         * JavaScriptCore.xcodeproj/ggaren.perspective: Added.
2194         * JavaScriptCore.xcodeproj/project.pbxproj: Added.
2195         * Makefile.am:
2196
2197 2005-07-20  Maciej Stachowiak  <mjs@apple.com>
2198
2199         Patch from Trey Matteson <trey@usa.net>, reviewed by me.
2200
2201         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3956
2202         some of WebKit builds with symbols, some doesn't
2203         
2204         * JavaScriptCore.pbproj/project.pbxproj: Generate symbols even for
2205         Deployment.
2206
2207 2005-07-19  Geoffrey Garen  <ggaren@apple.com>
2208
2209         -fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3991
2210         JSC doesn't implement Array.prototype.toLocaleString()
2211
2212         -test failure: ecma_3/Array/15.4.4.3-1.js
2213
2214         Reviewed by mjs.
2215
2216         * kjs/array_object.cpp:
2217         (ArrayProtoFuncImp::call): now searches for toString and
2218         toLocaleString overrides in the array's elements
2219
2220         * tests/mozilla/expected.html: failures are under 100! woohoo!
2221
2222 2005-07-19  Darin Adler  <darin@apple.com>
2223
2224         - fixed the build
2225
2226         * kjs/lookup.h: (KJS::lookupPut): Remove bogus const; was preventing WebCore from
2227         compiling (not sure why this didn't affect my other build machine).
2228
2229         - one other tiny tweak (so sue me)
2230
2231         * bindings/runtime_root.cpp: Remove unneeded declaration.
2232
2233 2005-07-19  Darin Adler  <darin@apple.com>
2234
2235         Reviewed by Geoff Garen.
2236
2237         - eliminated try wrappers for get/put/call since we don't use C++ exceptions any more
2238
2239         * kjs/lookup.h: Changed tryCall in IMPLEMENT_PROTOFUNC here to call. It doesn't make
2240         sense for this macro to use the name tryCall anyway, since that's specific to how
2241         WebCore used this, so this is good anyway. On the other hand, it might be a problem
2242         for KDOM or KSVG, in which case we'll need another macro for them, since JavaScriptCore
2243         should presumably not have the C++ exception support.
2244
2245 2005-07-18  Geoffrey Garen  <ggaren@apple.com>
2246
2247         -fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4008
2248         Error objects report incorrect length
2249         
2250         Reviewed by darin.
2251
2252         * kjs/error_object.cpp: Error objects now include a length property
2253         (ErrorObjectImp::ErrorObjectImp):
2254
2255         * tests/mozilla/expected.html: updated expected results to reflect fix
2256         * tests/mozilla/js1_5/Exceptions/regress-123002.js: test now expects 
2257         ecma compliant results
2258
2259 2005-07-15  Geoffrey Garen  <ggaren@apple.com>
2260
2261         -rolled in KDE fixes for http://bugzilla.opendarwin.org/show_bug.cgi?id=3601
2262         Error instance type info
2263         
2264         Reviewed by mjs.
2265
2266         * kjs/error_object.cpp:
2267         - Created ErrorInstanceImp class for Error() objects. 
2268         - Changed parent object for Native Errors to "Function" (matches
2269         ECMA spec).
2270         (ErrorInstanceImp::ErrorInstanceImp):
2271         (ErrorProtoFuncImp::call):
2272         (ErrorObjectImp::construct):
2273         (NativeErrorImp::construct):
2274
2275         * kjs/error_object.h:
2276         (KJS::ErrorInstanceImp::classInfo):
2277         * kjs/object.h: made comment more informative about ClassInfo
2278
2279         * tests/mozilla/expected.html:
2280
2281 2005-07-14  Geoffrey Garen  <ggaren@apple.com>
2282
2283         - fixed: JS test suite expects an out of memory error
2284         that our memory efficiency avoids
2285         
2286         Reviewed by mjs.
2287
2288         * tests/mozilla/js1_5/Array/regress-157652.js:
2289         test now expects normal execution
2290         
2291         * tests/mozilla/expected.html:
2292
2293 2005-07-14  Geoffrey Garen  <ggaren@apple.com>
2294         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4006
2295         testkjs doesn't implement gc()
2296         
2297         - test failure:
2298         ecma_3/Function/regress-104584.js
2299         
2300         Reviewed by mjs.
2301
2302         * kjs/interpreter.cpp:
2303         (Interpreter::finalCheck): removed misleading while && comment
2304
2305         * kjs/testkjs.cpp: added "gc" function to global object
2306         (TestFunctionImp::):
2307         (TestFunctionImp::call):
2308         (main):
2309
2310         * tests/mozilla/expected.html:
2311
2312 2005-07-14  Geoffrey Garen  <ggaren@apple.com>
2313
2314         -rolled in patches for http://bugzilla.opendarwin.org/show_bug.cgi?id=3945
2315         [PATCH] Safe merges of comments and other trivialities from KDE's kjs
2316         
2317         -patch by Martijn Klingens <klingens@kde.org>
2318         
2319         * kjs/array_instance.h:
2320         * kjs/array_object.cpp:
2321         * kjs/array_object.h:
2322         * kjs/bool_object.cpp:
2323         * kjs/bool_object.h:
2324         * kjs/collector.cpp:
2325         * kjs/collector.h:
2326         * kjs/completion.h:
2327         * kjs/context.h:
2328         * kjs/date_object.cpp:
2329         * kjs/date_object.h:
2330         * kjs/debugger.cpp:
2331         * kjs/debugger.h:
2332         * kjs/dtoa.h:
2333         * kjs/error_object.cpp:
2334         * kjs/error_object.h:
2335         * kjs/function.cpp:
2336         * kjs/function.h:
2337         * kjs/function_object.cpp:
2338         * kjs/function_object.h:
2339         * kjs/grammar.y:
2340         * kjs/identifier.cpp:
2341         * kjs/identifier.h:
2342         * kjs/internal.cpp:
2343         * kjs/internal.h:
2344         * kjs/interpreter.cpp:
2345         * kjs/interpreter.h:
2346         * kjs/interpreter_map.cpp:
2347         * kjs/interpreter_map.h:
2348         * kjs/lexer.cpp:
2349         * kjs/lexer.h:
2350         * kjs/list.cpp:
2351         * kjs/list.h:
2352         * kjs/lookup.cpp:
2353         * kjs/lookup.h:
2354         * kjs/math_object.cpp:
2355         * kjs/math_object.h:
2356         * kjs/nodes.cpp:
2357         * kjs/nodes.h:
2358         * kjs/nodes2string.cpp:
2359         * kjs/number_object.cpp:
2360         * kjs/number_object.h:
2361         * kjs/object.cpp:
2362         * kjs/object.h:
2363         * kjs/object_object.cpp:
2364         * kjs/object_object.h:
2365         * kjs/operations.cpp:
2366         * kjs/operations.h:
2367         * kjs/property_map.cpp:
2368         * kjs/property_map.h:
2369         * kjs/reference.cpp:
2370         * kjs/reference.h:
2371         * kjs/reference_list.cpp:
2372         * kjs/reference_list.h:
2373         * kjs/regexp.cpp:
2374         * kjs/regexp.h:
2375         * kjs/regexp_object.cpp:
2376         * kjs/regexp_object.h:
2377         * kjs/scope_chain.cpp:
2378         * kjs/scope_chain.h:
2379         * kjs/simple_number.h:
2380         * kjs/string_object.cpp:
2381         * kjs/string_object.h:
2382         * kjs/testkjs.cpp:
2383         * kjs/types.h:
2384         * kjs/ustring.cpp:
2385         * kjs/ustring.h:
2386         * kjs/value.cpp:
2387         * kjs/value.h:
2388
2389 2005-07-14  Geoffrey Garen  <ggaren@apple.com>
2390
2391         -fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3970
2392         throw statements fail inside eval statements
2393         
2394         Reviewed by mjs.
2395
2396         * kjs/function.cpp:
2397         (KJS::GlobalFuncImp::call):
2398         Big change since I fixed the tabbing. The important part is:
2399         if (c.complType() == Throw)
2400           exec->setException(c.value());
2401
2402         * kjs/nodes.cpp:
2403         (ThrowNode::execute): removed duplicate KJS_CHECKEXCEPTION
2404         (TryNode::execute): 
2405         try now clears the exception state before the finally block executes,
2406         and checks the state after the block executes, so that exceptions in
2407         finally code get caught.
2408
2409         * tests/mozilla/expected.html:
2410
2411 2005-07-14  Geoffrey Garen  <ggaren@apple.com>
2412         
2413         -landed fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=3412
2414         Object.prototype is missing toLocaleString
2415
2416         - patch by Mark Rowe (bdash) <opendarwin.org@bdash.net.nz>
2417         
2418         -layout test info in webcore changelog
2419
2420         Reviewed by mjs.
2421
2422         * kjs/object_object.cpp:
2423         (ObjectPrototypeImp::ObjectPrototypeImp):
2424         (ObjectProtoFuncImp::call):
2425         * kjs/object_object.h:
2426         (KJS::ObjectProtoFuncImp::):
2427
2428 2005-07-12  Geoffrey Garen  <ggaren@apple.com>
2429
2430         Reviewed by mjs.
2431
2432         * kjs/function.cpp:
2433         (KJS::IndexToNameMap::operator[]): fixed infinite recursion
2434         bug in last checkin
2435
2436 2005-07-12  Geoffrey Garen  <ggaren@apple.com>
2437
2438         -fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3881
2439         arguments object should share values with function parameters
2440
2441         Reviewed by mjs.
2442
2443         ArgumentsImp now uses a simple hash lookup to share values
2444         with the activation object.
2445
2446         * kjs/function.cpp:
2447         (KJS::FunctionImp::getParameterName):
2448         (KJS::IndexToNameMap::IndexToNameMap):
2449         (KJS::IndexToNameMap::~IndexToNameMap):
2450         (KJS::IndexToNameMap::isMapped):
2451         (KJS::IndexToNameMap::unMap):
2452         (KJS::IndexToNameMap::operator[]):
2453         (KJS::ArgumentsImp::ArgumentsImp):
2454         (KJS::ArgumentsImp::mark):
2455         (KJS::ArgumentsImp::get):
2456         (KJS::ArgumentsImp::put):
2457         (KJS::ArgumentsImp::deleteProperty):
2458         (KJS::ArgumentsImp::hasOwnProperty):
2459         (KJS::ActivationImp::createArgumentsObject):
2460         * kjs/function.h:
2461         * tests/mozilla/expected.html: updated results
2462
2463 2005-07-09  Maciej Stachowiak  <mjs@apple.com>
2464
2465         - backing out my earlier collector change, it causes a performance regression in TOT
2466
2467         * kjs/collector.cpp:
2468         (KJS::Collector::allocate):
2469
2470 2005-07-08  Eric Seidel  <eseidel@apple.com>
2471
2472         Reviewed by mjs/hyatt (only in concept).
2473
2474         * JavaScriptCore.pbproj/project.pbxproj: Added JavaScriptCore+SVG
2475         Turns on RTTI support for JavaScriptCore.framework when
2476         building the JavaScriptCore+SVG target.  This is needed as
2477         kdom (part of WebCore+SVG) requires RTTI for the time being.
2478
2479 2005-07-08  Maciej Stachowiak  <mjs@apple.com>
2480
2481         Reviewed by hyatt.
2482
2483         - When there are many live objects, GC less often, to try to make
2484         GC cost proportional to garbage, not proportional to total memory used.
2485
2486         * kjs/collector.cpp:
2487         (KJS::Collector::allocate):
2488
2489 2005-07-08  Vicki Murley  <vicki@apple.com>
2490
2491         Fix from Carsten Guenther, reviewed by Maciej
2492
2493         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3644 (Error string representation)
2494
2495         Switch from "-" to ":" in error strings.
2496
2497         * kjs/error_object.cpp:
2498         (ErrorProtoFuncImp::call):
2499         * tests/mozilla/expected.html:
2500
2501 2005-07-08  Geoffrey Garen  <ggaren@apple.com>
2502
2503         -rolled in patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=3878
2504         arguments object should be an object not an array
2505
2506         Reviewed by mjs.
2507
2508         * kjs/function.cpp:
2509         (KJS::ArgumentsImp::ArgumentsImp): now manually handles initialization
2510         we used to get for free by inheriting from ArrayInstanceImp
2511         * kjs/function.h: ArgumentsImp now inherits from ObjectImp
2512         * tests/mozilla/expected.html: updated expected test results
2513
2514 2005-07-07  Eric Seidel  <eseidel@apple.com>
2515
2516         Reviewed by mjs.
2517
2518         * kjs/grammar.y: removed #define YYMAXDEPTH 0 for bison 2.0
2519         http://bugzilla.opendarwin.org/show_bug.cgi?id=3882
2520
2521 2005-07-03  Maciej Stachowiak  <mjs@apple.com>
2522
2523         Original patch from Mark Rowe <opendarwin.org@bdash.net.nz>, reviewed by me.
2524         Fixes to patch by me, reviewed by John Sullivan.
2525
2526         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3293
2527
2528         Test cases added:
2529         * tests/mozilla/expected.html: Two tests newly pass.
2530
2531         * bindings/objc/objc_runtime.h:
2532         * bindings/objc/objc_runtime.mm:
2533         (ObjcFallbackObjectImp::hasOwnProperty):
2534         * bindings/runtime_array.cpp:
2535         (RuntimeArrayImp::hasOwnProperty):
2536         * bindings/runtime_array.h:
2537         * bindings/runtime_object.cpp:
2538         (RuntimeObjectImp::hasOwnProperty):
2539         * bindings/runtime_object.h:
2540         * kjs/array_instance.h:
2541         * kjs/array_object.cpp:
2542         (ArrayInstanceImp::hasOwnProperty):
2543         * kjs/function.cpp:
2544         (KJS::FunctionImp::hasOwnProperty):
2545         (KJS::ActivationImp::hasOwnProperty):
2546         * kjs/function.h:
2547         * kjs/lookup.h:
2548         * kjs/object.cpp:
2549         (KJS::ObjectImp::hasProperty):
2550         (KJS::ObjectImp::hasOwnProperty):
2551         * kjs/object.h:
2552         (KJS::Object::hasOwnProperty):
2553         * kjs/object_object.cpp:
2554         (ObjectPrototypeImp::ObjectPrototypeImp):
2555         (ObjectProtoFuncImp::call):
2556         * kjs/object_object.h:
2557         (KJS::ObjectProtoFuncImp::):
2558         * kjs/string_object.cpp:
2559         (StringInstanceImp::hasOwnProperty):
2560         * kjs/string_object.h:
2561
2562 2005-07-01  Geoffrey Garen  <ggaren@apple.com>
2563
2564         -landed patch by Eric Seidel <macdome@opendarwin.org>
2565         
2566         -for http://bugzilla.opendarwin.org/show_bug.cgi?id=3657
2567         GroundWork:  Moving some functions from khtml->jsc following kjs TOT
2568         
2569         - no layout test necessary yet - only groundwork
2570
2571         Reviewed by darin.
2572
2573         * kjs/lookup.h:
2574         (KJS::cacheGlobalObject):
2575
2576 2005-07-01  Geoffrey Garen  <ggaren@apple.com>
2577
2578         -landed patch by Carsten Guenther <cguenther@gmail.com>
2579
2580         -fixes http://bugzilla.opendarwin.org/show_bug.cgi?id=3477
2581         some US-centric date formats not parsed by JavaScript (clock at news8austin.com)
2582
2583         -relevant tests:
2584                mozilla/ecma_3/Date/15.9.5.5.js 
2585                layout-tests/fast/js/date-parse-test.html
2586
2587         Reviewed by darin.
2588
2589         * kjs/date_object.cpp:
2590         (formatLocaleDate):
2591         (day):
2592         (dayFromYear):
2593         (daysInYear):
2594         (timeFromYear):
2595         (yearFromTime):
2596         (weekDay):
2597         (timeZoneOffset):
2598         (DateProtoFuncImp::call):
2599         (DateObjectImp::construct):
2600         (KJS::parseDate):
2601         (ymdhms_to_seconds):
2602         (KJS::makeTime):
2603         (findMonth):
2604         (KJS::KRFCDate_parseDate):
2605         * kjs/date_object.h:
2606         * tests/mozilla/expected.html: updated expected results to reflect fix
2607
2608 2005-07-01  Geoffrey Garen  <ggaren@apple.com>
2609
2610         -fixed <rdar://problem/4168186> JavaScript fails to throw exceptions 
2611         for invalid return statements
2612         
2613         relevant tests:
2614             ecma/Statements/12.9-1-n.js
2615             ecma_2/Exceptions/lexical-052.js
2616             ecma_2/Exceptions/statement-009.js
2617
2618         Reviewed by sullivan.
2619
2620         * kjs/nodes.cpp:
2621         (ReturnNode::execute): now throws exception if return is not inside
2622         a function.
2623
2624         * tests/mozilla/expected.html: updated to reflect fix
2625
2626 2005-07-01  Geoffrey Garen  <ggaren@apple.com>
2627
2628         Reviewed by sullivan.
2629
2630         * tests/mozilla/expected.html: Updated test results for last fix.
2631
2632 2005-07-01  Geoffrey Garen  <ggaren@apple.com>
2633
2634         -fixed <rdar://problem/4168161> JavaScript fails to throw an exception 
2635         for invalid function calls
2636         
2637         Reviewed by sullivan.
2638
2639         Relevant mozilla test: ecma_3/Exceptions/regress-95101.js 
2640
2641         * kjs/nodes.cpp:
2642         (FunctionCallNode::evaluate): evaluate now checks for an exception
2643         after resolving a function name (in case the function is undefined)
2644
2645 2005-07-01  Eric Seidel  <eseidel@apple.com>
2646
2647         Reviewed by darin.
2648
2649         * kjs/interpreter.h:
2650         (KJS::Context::curStmtFirstLine): stub for compatibility with KDE
2651         * kjs/value.h:
2652         (KJS::Value::isValid): compatibility with KDE
2653         http://bugzilla.opendarwin.org/show_bug.cgi?id=3687
2654
2655 2005-07-01  Eric Seidel  <eseidel@apple.com>
2656
2657         Reviewed by darin.
2658
2659         * kjs/create_hash_table: rolled in changes from KDE, including
2660         -n <namespace> support from KDOM and support for newer comments
2661         http://bugzilla.opendarwin.org/show_bug.cgi?id=3771
2662
2663 2005-06-30  Geoffrey Garen  <ggaren@apple.com>
2664
2665         -rolled in KDE fix to <rdar://problem/4167660> JavaScript fails to 
2666         throw exceptions for invalid break/continue statements
2667
2668         No layout tests because it's already covered by the Mozilla suite
2669
2670         Reviewed by mjs.
2671
2672         * kjs/internal.h: LabelStack now tracks where you are relative to
2673         switch and iteration (loop) statements
2674         
2675         (KJS::LabelStack::LabelStack):
2676         (KJS::LabelStack::pushIteration):
2677         (KJS::LabelStack::popIteration):
2678         (KJS::LabelStack::inIteration):
2679         (KJS::LabelStack::pushSwitch):
2680         (KJS::LabelStack::popSwitch):
2681         (KJS::LabelStack::inSwitch):
2682
2683         * kjs/nodes.cpp: 
2684         These files were updated to use the new LabelStack:
2685         (DoWhileNode::execute): 
2686         (WhileNode::execute):
2687         (ForNode::execute):
2688         (ForInNode::execute):
2689         (SwitchNode::execute):
2690         
2691         These files were updated to throw exceptions for invalid
2692         break/continue statements:
2693         (BreakNode::execute): 
2694         (ContinueNode::execute):
2695
2696         * tests/mozilla/expected.html: Updated expected results to reflect fix
2697
2698 2005-06-30  Kevin Decker  <kdecker@apple.com>
2699
2700         Reviewed by rjw.
2701
2702         fixed: <rdar://problem/4166838> failed assertion in`Interpreter::lockCount() > 0
2703
2704         no layout test added; this is in the bindings code.
2705
2706         * bindings/objc/WebScriptObject.mm:
2707         (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]): make sure to lock and unlock the interpreter around allocations. 
2708
2709 2005-06-29  Geoffrey Garen  <ggaren@apple.com>
2710
2711         Patch by Francisco Tolmasky <tolmasky@gmail.com>
2712
2713         - fixes http://bugzilla.opendarwin.org/show_bug.cgi?id=3667
2714         Core JavaScript 1.5 Reference:Objects:Array:forEach
2715
2716         See WebCore Changelog for layout tests added.
2717
2718         Reviewed by darin.
2719
2720         * kjs/array_object.cpp:
2721         (ArrayProtoFuncImp::call):
2722         * kjs/array_object.h:
2723         (KJS::ArrayProtoFuncImp::):
2724
2725 2005-06-29  Geoffrey Garen  <ggaren@apple.com>
2726
2727         Patch contributed by Oliver Hunt <ojh16@student.canterbury.ac.nz>
2728
2729         -fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3743
2730         Incorrect error message given for certain calls
2731
2732         See WebCore Changelog for layout test added.
2733
2734         Reviewed by mjs.
2735
2736         * kjs/object.cpp:
2737         (KJS::ObjectImp::defaultValue):
2738
2739 2005-06-29  Geoffrey Garen  <ggaren@apple.com>
2740
2741         Rolling out date patch from 6-28-05 because it breaks 
2742         fast/js/date-parse-test
2743
2744         * kjs/date_object.cpp:
2745         (formatLocaleDate):
2746         (DateProtoFuncImp::call):
2747         (DateObjectImp::construct):
2748         (KJS::parseDate):
2749         (ymdhms_to_seconds):
2750         (isSpaceOrTab):
2751         (KJS::KRFCDate_parseDate):
2752         * kjs/date_object.h:
2753         * tests/mozilla/expected.html:
2754
2755 2005-06-29  Geoffrey Garen  <ggaren@apple.com>
2756
2757         Reviewed by Darin.
2758
2759         -fixes http://bugzilla.opendarwin.org/show_bug.cgi?id=3750
2760         build fails with KJS_VERBOSE set
2761
2762         * kjs/nodes.cpp: changed debug print statement to use UString
2763         (VarDeclNode::evaluate):
2764         * kjs/reference.cpp: ditto
2765         (KJS::Reference::putValue):
2766
2767 2005-06-28  Geoffrey Garen  <ggaren@apple.com>
2768
2769         Patch contributed by Carsten Guenther <cguenther@gmail.com>.
2770
2771         -fixes http://bugzilla.opendarwin.org/show_bug.cgi?id=3477
2772         some US-centric date formats not parsed by JavaScript (clock at news8austin.com)
2773
2774         Reviewed by darin.
2775
2776         * kjs/date_object.cpp:
2777         (formatLocaleDate):
2778         (day):
2779         (dayFromYear):
2780         (daysInYear):
2781         (timeFromYear):
2782         (yearFromTime):
2783         (weekDay):
2784         (timeZoneOffset):
2785         (DateProtoFuncImp::call):
2786         (DateObjectImp::construct):
2787         (KJS::parseDate):
2788         (ymdhms_to_seconds):
2789         (KJS::makeTime):
2790         (findMonth):
2791         (KJS::KRFCDate_parseDate):
2792         * kjs/date_object.h:
2793         * tests/mozilla/expected.html: updated expected test results to reflect fix
2794
2795 2005-06-26  Maciej Stachowiak  <mjs@apple.com>
2796
2797         Reviewed by Darin.
2798
2799         - replace hash functions  with better ones
2800
2801         * JavaScriptCore.pbproj/project.pbxproj: Add new file to build.
2802         * kjs/interpreter_map.cpp:
2803         (KJS::InterpreterMap::computeHash): Use shared pointer hash.
2804         * kjs/pointer_hash.h: Added.
2805         (KJS::pointerHash): Pointer hash based on 32-bit mix and 64-bit mix hashes.
2806         * kjs/protected_values.cpp:
2807         (KJS::ProtectedValues::computeHash): Use shared pointer hash.
2808         * kjs/ustring.cpp:
2809         (KJS::UString::Rep::computeHash): Use SuperFastHash algorithm.
2810
2811 2005-06-22  Darin Adler  <darin@apple.com>
2812
2813         Change by Anders Carlsson.
2814         Reviewed by me.
2815
2816         - fixed <http://bugzilla.opendarwin.org/show_bug.cgi?id=3294>
2817           String.prototype.replace() fails with function as second param
2818
2819         * kjs/string_object.cpp: (replace): Added code to handle functions.
2820
2821         * tests/mozilla/expected.html: Updated since ecma_3/RegExp/regress-209067.js is fixed now.
2822
2823         * tests/mozilla/run-mozilla-tests: Fix a minor coding style issue that leads to a warning each
2824         time we run the tests.
2825
2826 2005-06-21  Adele Peterson  <adele@apple.com>
2827
2828         rolling out fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=3293, since it caused layout test failures.
2829         fast/forms/element-by-name
2830         fast/loader/loadInProgress
2831
2832         * ChangeLog:
2833         * bindings/objc/objc_runtime.h:
2834         * bindings/objc/objc_runtime.mm:
2835         (ObjcFallbackObjectImp::hasProperty):
2836         * bindings/runtime_array.cpp:
2837         (RuntimeArrayImp::hasProperty):
2838         * bindings/runtime_array.h:
2839         * bindings/runtime_object.cpp:
2840         (RuntimeObjectImp::hasProperty):
2841         * bindings/runtime_object.h:
2842         * kjs/array_instance.h:
2843         * kjs/array_object.cpp:
2844         (ArrayInstanceImp::hasProperty):
2845         * kjs/function.cpp:
2846         (KJS::FunctionImp::hasProperty):
2847         (KJS::ActivationImp::hasProperty):
2848         * kjs/function.h:
2849         * kjs/object.cpp:
2850         (KJS::ObjectImp::hasProperty):
2851         * kjs/object.h:
2852         * kjs/object_object.cpp:
2853         (ObjectPrototypeImp::ObjectPrototypeImp):
2854         (ObjectProtoFuncImp::call):
2855         * kjs/object_object.h:
2856         (KJS::ObjectProtoFuncImp::):
2857         * kjs/string_object.cpp:
2858         (StringInstanceImp::hasProperty):
2859         * kjs/string_object.h:
2860         * tests/mozilla/expected.html:
2861
2862 2005-06-21  Darin Adler  <darin@apple.com>
2863
2864         * JavaScriptCore.pbproj/project.pbxproj: Switched to a build rule rather than a build phase for
2865         .y files -- this gets rid of the problem where modifying the .y file would not cause sufficient
2866         compilation.
2867
2868         * kjs/grammar_wrapper.cpp: Removed.
2869
2870 2005-06-21  Adele Peterson  <adele@apple.com>
2871
2872         Patch from Anders Carlsson <andersca@mac.com>, reviewed by Darin.
2873
2874         Fixed: <http://bugzilla.opendarwin.org/show_bug.cgi?id=3450>
2875         <rdar://problem/3881901> String.replace() method not working when regex pattern contains {n, m}
2876
2877         * pcre/pcre.c: (pcre_compile): Remember the last char length so it can be subtracted correctly if needed.
2878
2879 2005-06-21  Geoffrey Garen  <ggaren@apple.com>
2880
2881         - fixed <rdar://problem/4155532> 'delete' succeeds on functions
2882         - fixed <rdar://problem/4155049> javascript function named as "opener" doesn't get called because of window.opener property
2883         
2884         Reviewed by cblu.
2885
2886         * kjs/nodes.cpp:
2887         (FuncDeclNode::processFuncDecl): Functions now have DontDelete and Internal attributes set when appropriate.
2888
2889         Test cases:
2890         * tests/mozilla/expected.html: Updated for one new success.
2891         - see also test case added in WebCore.
2892
2893 2005-06-20  Maciej Stachowiak  <mjs@apple.com>
2894
2895         Reviewed by Darin(first pass) and Hyatt.
2896
2897         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3576
2898         (roll in support for "const" keyword from KDE tree)
2899         - make processVarDecls handle deletability of variables declared
2900         in an eval block the same as evaluate would
2901         - make eval() call processVarDecls - needed to match mozilla and
2902         to make the second change testable
2903
2904         I started with the KDE implementation of const but I ended up changing it a bit
2905         to avoid the use of a global variable. Now instead of the global variable it distinguishes
2906         const and var at the grammar level so the appropriate node can know the right kind of
2907         declaration.
2908
2909         Test cases:
2910         * tests/mozilla/expected.html: Updated for one new test that is
2911         failing - we used to bail on it entirely because it checks for
2912         const support before starting.
2913         - see also test cases added in WebCore
2914
2915         * kjs/grammar.y: Add rules for const declarations.
2916         * kjs/keywords.table: Add const keyword.
2917         * kjs/nodes.cpp:
2918         (VarDeclNode::VarDeclNode): Add parameter.
2919         (VarDeclNode::evaluate): Add const support.
2920         (VarDeclNode::processVarDecls): Add const support.
2921         (VarStatementNode::execute): Irrelevant change.
2922         (ForInNode::ForInNode): Tell our variable node that it's a variable.
2923         * kjs/nodes.h:
2924         (KJS::VarDeclNode::): Add declaration of type enum, extra constructor parameter.
2925         (KJS::VarStatementNode::VarStatementNode): Irrelevant change.
2926         * kjs/function.cpp:
2927         (KJS::GlobalFuncImp::call): Process var decls before evaluating.
2928
2929 2005-06-20  Maciej Stachowiak  <mjs@apple.com>
2930
2931         Patch from Mark Rowe <opendarwin.org@bdash.net.nz>, reviewed by me.
2932
2933         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3293
2934         
2935         Test cases added: 
2936         * tests/mozilla/expected.html: Updated for two fixed tests.
2937         - also added a layout test
2938
2939         * bindings/objc/objc_runtime.h:
2940         * bindings/objc/objc_runtime.mm:
2941         (ObjcFallbackObjectImp::hasOwnProperty):
2942         * bindings/runtime_array.cpp:
2943         (RuntimeArrayImp::hasOwnProperty):
2944         * bindings/runtime_array.h:
2945         * bindings/runtime_object.cpp:
2946         (RuntimeObjectImp::hasOwnProperty):
2947         * bindings/runtime_object.h:
2948         * kjs/array_instance.h:
2949         * kjs/array_object.cpp:
2950         (ArrayInstanceImp::hasOwnProperty):
2951         * kjs/function.cpp:
2952         (KJS::FunctionImp::hasOwnProperty):
2953         (KJS::ActivationImp::hasOwnProperty):
2954         * kjs/function.h:
2955         * kjs/object.cpp:
2956         (KJS::ObjectImp::hasProperty):
2957         (KJS::ObjectImp::hasOwnProperty):
2958         * kjs/object.h:
2959         (KJS::Object::hasOwnProperty):
2960         * kjs/object_object.cpp:
2961         (ObjectPrototypeImp::ObjectPrototypeImp):
2962         (ObjectProtoFuncImp::call):
2963         * kjs/object_object.h:
2964         (KJS::ObjectProtoFuncImp::):
2965         * kjs/string_object.cpp:
2966         (StringInstanceImp::hasOwnProperty):
2967         * kjs/string_object.h:
2968
2969 2005-06-18  Darin Adler  <darin@apple.com>
2970
2971         Reviewed by Eric Seidel.
2972
2973         * pcre/get.c: (pcre_get_substring): Fix some computations so this works for UTF-16.
2974         This is unused in the current JavaScriptCore, but still good to fix.
2975
2976 2005-06-18  Darin Adler  <darin@apple.com>
2977
2978         Change by Finlay Dobbie.
2979         Reviewed by me.
2980
2981         - fixed <http://bugzilla.opendarwin.org/show_bug.cgi?id=3331>
2982           10.3.9 Build Failure: NSString may not respond to `+stringWithCString:encoding:'
2983
2984         * bindings/objc/WebScriptObject.mm: (-[WebScriptObject stringRepresentation]):
2985         Undo change we did a while back to work around the gcc 3.3 compiler error.
2986         It no longer seems to happen, and the workaround code was 10.4-specific.
2987
2988 2005-06-16  Geoffrey Garen  <ggaren@apple.com>
2989
2990         Fixed: <rdar://problem/4151759> 'delete' fails on variables declared inside 'eval' statements.
2991
2992         Reviewed by cblu.
2993
2994         * kjs/context.h:
2995         (KJS::ContextImp::codeType): Added code type accessor for execution context objects.
2996         * kjs/internal.cpp:
2997         (ContextImp::ContextImp): Reflects change to ContextImp::codeType.
2998         * kjs/nodes.cpp:
2999         (VarDeclNode::evaluate): Added separate code path for variable declarations inside 'eval' statements.
3000         * tests/mozilla/expected.html: Updated expected test results to reflect fix.
3001
3002 2005-06-14  Geoffrey Garen  <ggaren@apple.com>
3003
3004         Updated expected.html to reflect fix to <rdar://problem/4147745>.
3005
3006         Reviewed by cblu.
3007
3008         * tests/mozilla/expected.html:
3009
3010 2005-06-14  Geoffrey Garen  <ggaren@apple.com>
3011
3012         Fixed: <rdar://problem/4147745> JavaScript discards locally defined "arguments" property
3013
3014         No layout tests added because this change fixes existing tests:
3015         ecma/ExecutionContexts/10.1.6.js
3016         ecma_3/Function/regress-94506.js
3017         js1_4/Functions/function-001.js
3018
3019         Reviewed by cblu.
3020
3021         * kjs/function.cpp:
3022         (KJS::ActivationImp::get): get now checks for an "arguments" property defined in the local variable object
3023         before trying to return the built-in arguments array.
3024         
3025         * kjs/function.h: ActivationImp::put no longer overrides ObjectImp::put
3026
3027 2005-06-10  Darin Adler  <darin@apple.com>
3028
3029         Change by Mark Rowe <opendarwin.org@bdash.net.nz>.
3030         Reviewed by me.
3031
3032         - further improvements to exception file/line number fix
3033
3034         * kjs/nodes.h: Added setExceptionDetailsIfNeeded function.
3035         * kjs/nodes.cpp: Updated macros to call the new setExceptionDetailsIfNeeded function.
3036         (Node::setExceptionDetailsIfNeeded): Added.
3037
3038 2005-06-09  Darin Adler  <darin@apple.com>
3039
3040         Change by Mark Rowe <opendarwin.org@bdash.net.nz>
3041         Reviewed by me.
3042
3043         * kjs/nodes.cpp: Get rid of unneeded this->.
3044
3045 2005-06-08  Maciej Stachowiak  <mjs@apple.com>
3046
3047         Change by Mark Rowe <opendarwin.org@bdash.net.nz>
3048         Reviewed by me.
3049
3050         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3327
3051         (Exception When Setting Style to Invalid Value Lacks Line/File Information)
3052
3053         * kjs/nodes.cpp: Include source file and line number when making exception in
3054         KJS_CHECKEXCEPTIONVALUE.
3055
3056 2005-06-07  Darin Adler  <darin@apple.com>
3057
3058         Change by Toby Peterson <toby@opendarwin.org>.
3059         Reviewed by me.
3060
3061         * JavaScriptCore.pbproj/project.pbxproj: Allow bison 2.0, which generates the file
3062         with a different name.
3063
3064 2005-06-07  Darin Adler  <darin@apple.com>
3065
3066         Change by Toby Peterson <toby@opendarwin.org>.
3067         Reviewed by me.
3068
3069         * kjs/grammar.y: Remove bogus extra line from grammar.y. Toby got this change from KDE KJS.
3070
3071 2005-06-06  Darin Adler  <darin@apple.com>
3072
3073         * tests/mozilla/run-mozilla-tests: Wrote a perl version of this so we don't require
3074         the "jst" tool to run the tests.
3075
3076 2005-06-04  Darin Adler  <darin@apple.com>
3077
3078         Reviewed by Maciej.
3079
3080         - add libicu headers
3081
3082         * JavaScriptCore.pbproj/project.pbxproj: Added icu directory to header search path.
3083
3084         * icu/README: Added.
3085         * icu/unicode/platform.h: Added.
3086         * icu/unicode/uchar.h: Added.
3087         * icu/unicode/uconfig.h: Added.
3088         * icu/unicode/umachine.h: Added.
3089         * icu/unicode/urename.h: Added.
3090         * icu/unicode/utf.h: Added.
3091         * icu/unicode/utf16.h: Added.
3092         * icu/unicode/utf8.h: Added.
3093         * icu/unicode/utf_old.h: Added.
3094         * icu/unicode/utypes.h: Added.
3095         * icu/unicode/uversion.h: Added.
3096
3097 2005-05-19  Darin Adler  <darin@apple.com>
3098
3099         Reviewed by Maciej.
3100         
3101         - turned off exceptions and RTTI; seems to cut JavaScriptCore code size by about 22%
3102
3103         * JavaScriptCore.pbproj/project.pbxproj: Turn off exceptions and RTTI for both
3104         the framework and testkjs tool.
3105
3106 2005-05-18  Darin Adler  <darin@apple.com>
3107
3108         Reviewed by Maciej.
3109
3110         - got rid of code that depended on RTTI
3111
3112         * kjs/collector.cpp:
3113         (KJS::className): Added. Gets class name in a KJS way, rather than a C++ RTTI way.
3114         (KJS::Collector::rootObjectClasses): Use className instead of typeid names.
3115
3116 2005-05-18  Darin Adler  <darin@apple.com>
3117
3118         Reviewed by Maciej.
3119
3120         - fix a failure seen in the Mozilla JavaScript tests where a live object was garbage-collected
3121           when the only reference to it was in an argList on the stack
3122
3123         * kjs/list.h: Moved the operator= function into the .cpp file since it's too big to be
3124         a good choice to inline.
3125         * kjs/list.cpp: (KJS::List::operator=): Moved this formerly-inline function into a separate
3126         file and added missing code to update valueRefCount. It's the latter that fixes the bug.
3127
3128 2005-05-16  Darin Adler  <darin@apple.com>
3129
3130         Reviewed by Adele.
3131
3132         - fixed issues preventing us from compiling with newer versions of gcc 4.0
3133
3134         * kjs/ustring.cpp:
3135         (KJS::operator==): Remove redundant and illegal KJS:: prefix on this function's definition.
3136         (KJS::operator<): Ditto.
3137         (KJS::compare): Ditto.
3138
3139 2005-05-09  Darin Adler  <darin@apple.com>
3140
3141         Reviewed by John.
3142
3143         - turn on conservative GC unconditionally and start on SPI changes to
3144           eliminate the now-unneeded smart pointers since we don't ref count any more
3145
3146         * kjs/value.h: Removed macros to turn conservative GC on and off.
3147         Removed ref and deref functions.
3148         (KJS::ValueImp::ValueImp): Removed non-conservative-GC code path.
3149         (KJS::ValueImp::isUndefined): Added. New SPI to make it easier to deal with ValueImp directly.
3150         (KJS::ValueImp::isNull): Ditto.
3151         (KJS::ValueImp::isBoolean): Ditto.
3152         (KJS::ValueImp::isNumber): Ditto.
3153         (KJS::ValueImp::isString): Ditto.
3154         (KJS::ValueImp::isObject): Ditto.
3155         (KJS::Value::Value): Removed non-conservative-GC code path and made constructor no
3156         longer explicit so we can quietly create Value wrappers from ValueImp *; inexpensive with
3157         conservative GC and eases the transition.
3158         (KJS::Value::operator ValueImp *): Added. Quietly creates ValueImp * from Value.
3159         (KJS::ValueImp::marked): Removed non-conservative-GC code path.
3160
3161         * kjs/value.cpp:
3162         (KJS::ValueImp::mark): Removed non-conservative-GC code path.
3163         (KJS::ValueImp::isUndefinedOrNull): Added. New SPI to make it easier to deal with ValueImp directly.
3164         (KJS::ValueImp::isBoolean): Ditto.
3165         (KJS::ValueImp::isNumber): Ditto.
3166         (KJS::ValueImp::isString): Ditto.
3167         (KJS::ValueImp::asString): Ditto.
3168         (KJS::ValueImp::isObject): Ditto.
3169         (KJS::undefined): Ditto.
3170         (KJS::null): Ditto.
3171         (KJS::boolean): Ditto.
3172         (KJS::string): Ditto.
3173         (KJS::zero): Ditto.
3174         (KJS::one): Ditto.
3175         (KJS::two): Ditto.
3176         (KJS::number): Ditto.
3177
3178         * kjs/object.h: Made constructor no longer explicit so we can quietly create Object
3179         wrappers from ObjectImp *; inexpensive with conservative GC and eases the transition.
3180         (KJS::Object::operator ObjectImp *): Added. Quietly creates ObjectImp * from Object.
3181         (KJS::ValueImp::isObject): Added. Implementation of new object-related ValueImp function.
3182         (KJS::ValueImp::asObject): Ditto.
3183
3184         * kjs/object.cpp:
3185         (KJS::ObjectImp::setInternalValue): Remove non-conservative-GC code path.
3186         (KJS::ObjectImp::putDirect): Ditto.
3187         (KJS::error): Added. Function in the new SPI style to create an error object.
3188
3189         * kjs/internal.h: Added the new number-constructing functions as friends of NumberImp.
3190         There may be a more elegant way to do this later; what's important now is the new SPI.
3191
3192         * kjs/collector.h:  Remove non-conservative-GC code path and also take out some
3193         unneeded APPLE_CHANGES.
3194
3195         * bindings/runtime_root.cpp:
3196         (KJS::Bindings::addNativeReference): Remove non-conservative-GC code path.
3197         (KJS::Bindings::removeNativeReference): Ditto.
3198         (RootObject::removeAllNativeReferences): Ditto.
3199         * bindings/runtime_root.h:
3200         (KJS::Bindings::RootObject::~RootObject): Ditto.
3201         (KJS::Bindings::RootObject::setRootObjectImp): Ditto.
3202         * kjs/collector.cpp:
3203         (KJS::Collector::allocate): Ditto.
3204         (KJS::Collector::collect): Ditto.
3205         (KJS::Collector::numGCNotAllowedObjects): Ditto.
3206         (KJS::Collector::numReferencedObjects): Ditto.
3207         (KJS::Collector::rootObjectClasses): Ditto.
3208         * kjs/internal.cpp:
3209         (NumberImp::create): Ditto.
3210         (InterpreterImp::globalInit): Ditto.
3211         (InterpreterImp::globalClear): Ditto.
3212         * kjs/list.cpp:
3213         (KJS::List::markProtectedLists): Ditto.
3214         (KJS::List::clear): Ditto.
3215         (KJS::List::append): Ditto.
3216         * kjs/list.h:
3217         (KJS::List::List): Ditto.
3218         (KJS::List::deref): Ditto.
3219         (KJS::List::operator=): Ditto.
3220         * kjs/protect.h:
3221         (KJS::gcProtect): Ditto.
3222         (KJS::gcUnprotect): Ditto.
3223
3224 2005-05-09  Chris Blumenberg  <cblu@apple.com>
3225
3226         Workaround gcc 3.3 internal compiler errors.
3227
3228         Reviewed by darin.
3229
3230         * bindings/objc/WebScriptObject.mm:
3231         (-[WebScriptObject stringRepresentation]): call [NSString stringWithCString:encoding] rather than using @""
3232
3233 2005-05-09  Darin Adler  <darin@apple.com>
3234
3235         * Makefile.am: Don't set up PBXIntermediatesDirectory explicitly;
3236         Not needed to make builds work, spews undesirable error messages too.
3237
3238 2005-05-06  Darin Adler  <darin@apple.com>
3239
3240         Reviewed by Maciej.
3241
3242         - make building multiple trees with make work better
3243
3244         * Makefile.am: Set up Xcode build directory before invoking xcodebuild.
3245
3246 2005-05-04  Maciej Stachowiak  <mjs@apple.com>
3247
3248         Reviewed by Darin.
3249
3250         <rdar://problem/4086570> Crash in JavaScriptCore with RSS Visualizer
3251         
3252         * kjs/internal.cpp:
3253         (InterpreterImp::mark): mark staticNaN, it is usually protected by the Number
3254         prototype but there is a small window where it can get collected.
3255
3256 2005-05-04  Darin Adler  <darin@apple.com>
3257
3258         Reviewed by Dave Hyatt.
3259
3260         - another gcc-4.0-related fix
3261
3262         * bindings/runtime_root.h: Take off extra namespace prefixes that apparently cause problems
3263         compiling with gcc 4.0, although I have not observed the problems.
3264
3265 2005-05-04  Darin Adler  <darin@apple.com>
3266
3267         Reviewed by Dave Hyatt.
3268
3269         - fixed build rules to match other projects
3270
3271         * JavaScriptCore.pbproj/project.pbxproj: Set deployment target to 10.3 in the build styles.
3272         When built without a build style (by Apple B&I) we want to get the target from the
3273         environment. But when built with a build style (by Safari engineers and others), we want
3274         to use 10.3.
3275
3276         * Makefile.am: Took out extra parameters that make command-line building different from
3277         Xcode building. Now that this is fixed, you should not get a full rebuild if you switch
3278         from command line to Xcode or back.
3279
3280 2005-05-04  Maciej Stachowiak  <mjs@apple.com>
3281
3282         - revert presumably accidental change to mozilla JS test expected results, this
3283         was making the tests fail.
3284
3285         * tests/mozilla/expected.html:
3286
3287 2005-05-03  Richard Williamson   <rjw@apple.com>
3288
3289         Fixed <rdar://problem/4102644> Crash in LiveConnect below KJS::Bindings::JavaInstance::stringValue() const
3290
3291         Correctly handle accessing nil objects from a Java object array.
3292
3293         Reviewed by John.
3294
3295         * bindings/jni/jni_runtime.cpp:
3296         (JavaArray::valueAt):
3297
3298 2005-05-01  Darin Adler  <darin@apple.com>
3299
3300         - move to Xcode native targets and stop checking in generated files
3301
3302         * JavaScriptCore.pbproj/project.pbxproj: Updated to use native targets and generate all the generated
3303         files, so we don't have to check them in any more.
3304         * Info.plist: Added. Native targets use a separate file for this.
3305
3306         * Makefile.am: Removed pcre and kjs SUBDIRS. Also removed code that deleted the embedded copy of this
3307         framework, since we haven't been embedding it for some time.
3308
3309         * kjs/grammar_wrapper.cpp: Added. Shell used to compile grammar.cpp since we can't add a generated file
3310         easily to the list of files to be compiled.
3311
3312         * kjs/.cvsignore: Removed.
3313         * kjs/Makefile.am: Removed.
3314         * kjs/array_object.lut.h: Removed.
3315         * kjs/date_object.lut.h: Removed.
3316         * kjs/grammar.cpp: Removed.
3317         * kjs/grammar.cpp.h: Removed.
3318         * kjs/grammar.h: Removed.
3319         * kjs/lexer.lut.h: Removed.
3320         * kjs/math_object.lut.h: Removed.
3321         * kjs/number_object.lut.h: Removed.
3322         * kjs/string_object.lut.h: Removed.
3323         * pcre/.cvsignore: Removed.
3324         * pcre/Makefile.am: Removed.
3325         * pcre/chartables.c: Removed.
3326
3327 2005-04-28  Darin Adler  <darin@apple.com>
3328
3329         Reviewed by Dave Harrison.
3330
3331         - fixed problems preventing us from compiling with gcc 4.0
3332
3333         * JavaScriptCore.pbproj/project.pbxproj: Removed -Wmissing-prototypes from
3334         WARNING_CPLUSPLUSFLAGS since it's now a C-only warning.
3335
3336         * bindings/jni/jni_jsobject.cpp:
3337         (JSObject::getSlot): Changed some %d to %ld where the parameters where long ints.
3338         (JSObject::setSlot): Ditto.
3339         * bindings/jni/jni_utility.cpp:
3340         (KJS::Bindings::getJavaVM): Ditto.
3341         (KJS::Bindings::getJNIEnv): Ditto.
3342         * bindings/objc/objc_utility.mm: Fixed include of <JavascriptCore/internal.h> that needed the
3343         letter "S" capitalized.
3344         * kjs/bool_object.cpp: (BooleanProtoFuncImp::call): Rearranged how this function returns to
3345         avoid incorrect gcc 4.0 warning.
3346         * kjs/collector.cpp: (KJS::Collector::markStackObjectsConservatively): Changed code to check
3347         the alignment of the passed-in pointers to only require pointer-level alignment, not 8-byte alignment.
3348         Prevents a crash on garbage collect when compiled with gcc 4.0.
3349         * kjs/nodes.cpp:
3350         (WhileNode::execute): Added a redundant return after an infinite loop to work around incorrect gcc 4.0 warning.
3351         (ForNode::execute): Ditto.
3352         (SwitchNode::execute):Rearranged how this function returns to avoid incorrect gcc 4.0 warning.
3353         (LabelNode::execute): Ditto.
3354         * kjs/string_object.cpp: (replace): Ditto.
3355
3356 2005-04-26  Richard Williamson   <rjw@apple.com>
3357
3358         Fixed <rdar://problem/4098713> Scripting API is incompatible with Mozilla
3359         
3360         We were incompatible with Mozilla's implementation of the scripting APIs in
3361         two ways:
3362
3363         Their NPN_SetException has the following signature:
3364
3365             void NPN_SetException(NPObject *npobj, const NPUTF8 *message);
3366
3367         ours has:
3368
3369             void NPN_SetException (NPObject * npobj, const NPString *message);
3370
3371         Also, they expect the string returned from NPN_UTF8FromIdentifier() to be freed by caller.
3372         We do not.
3373
3374         I changed both behaviors to match Mozilla.
3375
3376         Reviewed by Chris.
3377
3378         * bindings/NP_jsobject.cpp:
3379         (_NPN_SetException):
3380         * bindings/npruntime.cpp:
3381         (_NPN_UTF8FromIdentifier):
3382         (_NPN_IntFromIdentifier):
3383         (_NPN_SetExceptionWithUTF8):
3384         * bindings/npruntime.h:
3385         * bindings/npruntime_impl.h:
3386
3387 2005-04-26  Maciej Stachowiak  <mjs@apple.com>
3388
3389         Reviewed by Chris.
3390
3391         <rdar://problem/4092136> reproducible crash in KJS::kjs_fast_realloc loading maps.google.com
3392         
3393         * kjs/string_object.cpp:
3394         (StringObjectFuncImp::call): Allocate adopted ustring buffer properly.
3395
3396 2005-04-22  Darin Adler  <darin@apple.com>
3397
3398         Reviewed by Maciej.
3399
3400         * kjs/ustring.cpp: (KJS::UString::UTF8String): Fix off-by-one error in surrogate pair logic.
3401
3402 2005-04-22  Darin Adler  <darin@apple.com>
3403
3404         Reviewed by John.
3405
3406         - fixed <rdar://problem/4090046> JavaScript throw statement causes parse error when no semicolon is present
3407
3408         * kjs/grammar.y: Added an additional rule for throw like the ones we have for all the other semicolon rules.
3409         Not sure why we missed this one earlier.
3410
3411         * kjs/grammar.cpp: Regenerated.
3412
3413 === JavaScriptCore-412.1 ===
3414
3415 2005-04-20  Darin Adler  <darin@apple.com>
3416
3417         Reviewed by Maciej.
3418
3419         - speedups, total 12% on JavaScript iBench
3420
3421         I ran the benchmark under Shark and followed its advice a lot, mainly.
3422
3423         * kjs/collector.cpp:
3424         (KJS::Collector::allocate): Take out special case for 0; costing speed but unexercised.
3425         Use numLiveObjectsAtLastCollect instead of numAllocationsSinceLastCollect so we don't
3426         have to bump it each time we call allocate. Put numLiveObjects into a local variable to
3427         cut down on global variable accesses. Make "next" cell pointer be a byte offset rather
3428         than a pointer so we don't need a special case for NULL. Allow freeList to point to some
3429         bogus item when the entire block is full rather than going out of our way to make it
3430         point to NULL.
3431         (KJS::Collector::markProtectedObjects): Get table size and pointer into locals outside
3432         the loop to avoid re-loading them over and over again.
3433         (KJS::Collector::collect): Put numLiveObjects into a local variable to cut down on global
3434         variable accesses. Make "next" cell pointer be a byte offset as above. Put numLiveObjects
3435         into a local variable to cut down on global variable accesses. Set numLiveObjectsAtLastCollect
3436         rather than numAllocationsSinceLastCollect.
3437         (KJS::Collector::numReferencedObjects): Get table size and pointer into locals outside
3438         the loop to avoid re-loading them over and over again.
3439         (KJS::Collector::rootObjectClasses): Ditto.
3440
3441         * kjs/internal.h: Make Value be a friend of NumberImp so it can construct number objects
3442         directly, avoiding the conversion from Number to Value.
3443
3444         * kjs/internal.cpp: (StringImp::toObject): Don't use Object::dynamicCast, because we know
3445         the thing is an object and we don't want to do all the extra work; just cast directly.
3446
3447         * kjs/list.cpp: (KJS::List::List): Construct valueRefCount in a way that avoids the need for
3448         a branch -- in the hot case this just meant avoiding checking a variable we just set to false.
3449
3450         * kjs/lookup.cpp: (keysMatch): Marked this inline.
3451
3452         * kjs/nodes.cpp: Disabled KJS_BREAKPOINT, to avoid calling hitStatement all the time.
3453         (BooleanNode::evaluate): Make a Value directly, rather than making a Boolean which is converted
3454         into a Value.
3455         (NumberNode::evaluate): Ditto.
3456         (StringNode::evaluate): Ditto.
3457         (ArrayNode::evaluate): Ditto.
3458         (FunctionCallNode::evaluate): Use new inline baseIfMutable to avoid unnecessary getBase function.
3459         Also just use a pointer for func, rather than an Object.
3460         (PostfixNode::evaluate): Change code so that it doesn't make an excess Number, and so that it
3461         passes a "known to be integer" boolean in, often avoiding a conversion from floating point to
3462         integer and back.
3463         (DeleteNode::evaluate): Make a Value directly.
3464         (TypeOfNode::evaluate): Use new inline baseIfMutable and make Value directly.
3465         (PrefixNode::evaluate): Change code so that it doesn't make an excess Number, and so that it
3466         passes a "known to be integer" boolean in, often avoiding a conversion from floating point to
3467         integer and back.
3468         (UnaryPlusNode::evaluate): Make a Value directly.
3469         (NegateNode::evaluate): Change code so that it doesn't make an excess Number, and so that it
3470         passes a "known to be integer" boolean in, often avoiding a conversion from floating point to
3471         integer and back.
3472         (BitwiseNotNode::evaluate): Make a Value directly.
3473         (LogicalNotNode::evaluate): Ditto.
3474         (ShiftNode::evaluate): Don't convert to a double before making a Value.
3475         (RelationalNode::evaluate): Make a Value directly.
3476         (EqualNode::evaluate): Ditto.
3477         (BitOperNode::evaluate): Ditto.
3478         (AssignNode::evaluate): Make a Value directly. Change code so that it passes a "known to be integer"
3479         boolean in, often avoiding a conversion from floating point to integer and back.
3480         (VarDeclNode::evaluate): Make a Value directly.
3481         (ForNode::execute): Remove unused local variable.
3482
3483         * kjs/operations.h:
3484         (KJS::isNaN): Inlined.
3485         (KJS::isInf): Ditto.
3486         (KJS::isPosInf): Ditto.
3487         (KJS::isNegInf): Ditto.
3488
3489         * kjs/operations.cpp: Change isNaN, isInf, isPosInf, and isNegInf to be inlines.
3490         (KJS::equal): Rewrite to avoid creating values and recursing back into the function.
3491         (KJS::relation): Rearranged code so that we don't need explicit isNaN checks.
3492         (KJS::add): Changed code to make Value directly, and so that it passes a "known to be integer"
3493         boolean in, often avoiding a conversion from floating point to integer and back.
3494         (KJS::mult): Ditto.
3495
3496         * kjs/property_map.cpp:
3497         (KJS::PropertyMap::~PropertyMap): Get size and entries pointer outside loop to avoid
3498         re-getting them inside the loop.
3499         (KJS::PropertyMap::clear): Ditto. Clear value pointer in addition to key, so we can just
3500         look at the value pointer in the mark function.
3501         (KJS::PropertyMap::get): Get sizeMask and entries pointer outside loop to avoid
3502         re-getting them inside the loop.
3503        &n