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