Versioning
[WebKit-https.git] / JavaScriptCore / ChangeLog
1 === JavaScriptCore-521.13 ===
2         
3 2006-06-22  David Kilzer  <ddkilzer@kilzer.net>
4
5         Build fix.
6
7         http://bugzilla.opendarwin.org/show_bug.cgi?id=9539
8         Another case error preventing build
9
10         * API/APICast.h: Changed "UString.h" to "ustring.h".
11
12 2006-06-21  Geoffrey Garen  <ggaren@apple.com>
13
14         Fixed release build, fixed accidental infinite recursion due to
15         last minute global replace gone awry.
16         
17         * API/APICast.h:
18         (toRef):
19         * API/testapi.c:
20         (assertEqualsAsBoolean):
21         (assertEqualsAsNumber):
22         (assertEqualsAsUTF8String):
23         (assertEqualsAsCharactersPtr):
24         * JavaScriptCore.xcodeproj/project.pbxproj:
25
26 2006-06-21  Geoffrey Garen  <ggaren@apple.com>
27
28         Reviewed by Anders.
29         
30         - First cut at C API to JavaScript. Includes a unit test, 'testapi.c', 
31         and the outline of a test app, 'minidom.c'.
32         
33         Includes one change to JSC internals: Rename propList to getPropertyList and have it
34         take its target property list by reference so that subclasses can
35         add properties to the list before calling through to their superclasses.
36         
37         Also, I just ran prepare-ChangeLog in about 10 seconds, and I would like
38         to give a shout-out to that.
39         
40         * API/APICast.h: Added.
41         (toJS):
42         (toRef):
43         * API/JSBase.h: Added.
44         * API/JSCallbackObject.cpp: Added.
45         (KJS::):
46         (KJS::JSCallbackObject::JSCallbackObject):
47         (KJS::JSCallbackObject::~JSCallbackObject):
48         (KJS::JSCallbackObject::className):
49         (KJS::JSCallbackObject::getOwnPropertySlot):
50         (KJS::JSCallbackObject::put):
51         (KJS::JSCallbackObject::deleteProperty):
52         (KJS::JSCallbackObject::implementsConstruct):
53         (KJS::JSCallbackObject::construct):
54         (KJS::JSCallbackObject::implementsCall):
55         (KJS::JSCallbackObject::callAsFunction):
56         (KJS::JSCallbackObject::getPropertyList):
57         (KJS::JSCallbackObject::toBoolean):
58         (KJS::JSCallbackObject::toNumber):
59         (KJS::JSCallbackObject::toString):
60         (KJS::JSCallbackObject::setPrivate):
61         (KJS::JSCallbackObject::getPrivate):
62         (KJS::JSCallbackObject::cachedValueGetter):
63         (KJS::JSCallbackObject::callbackGetter):
64         * API/JSCallbackObject.h: Added.
65         (KJS::JSCallbackObject::classInfo):
66         * API/JSCharBufferRef.cpp: Added.
67         (JSStringMake):
68         (JSCharBufferCreate):
69         (JSCharBufferCreateUTF8):
70         (JSCharBufferRetain):
71         (JSCharBufferRelease):
72         (JSValueCopyStringValue):
73         (JSCharBufferGetLength):
74         (JSCharBufferGetCharactersPtr):
75         (JSCharBufferGetCharacters):
76         (JSCharBufferGetMaxLengthUTF8):
77         (JSCharBufferGetCharactersUTF8):
78         (JSCharBufferIsEqual):
79         (JSCharBufferIsEqualUTF8):
80         (JSCharBufferCreateWithCFString):
81         (CFStringCreateWithJSCharBuffer):
82         * API/JSCharBufferRef.h: Added.
83         * API/JSContextRef.cpp: Added.
84         (JSContextCreate):
85         (JSContextDestroy):
86         (JSContextGetGlobalObject):
87         (JSEvaluate):
88         (JSCheckSyntax):
89         (JSContextHasException):
90         (JSContextGetException):
91         (JSContextClearException):
92         (JSContextSetException):
93         * API/JSContextRef.h: Added.
94         * API/JSObjectRef.cpp: Added.
95         (JSValueToObject):
96         (JSObjectMake):
97         (JSFunctionMake):
98         (JSObjectGetDescription):
99         (JSObjectGetPrototype):
100         (JSObjectSetPrototype):
101         (JSObjectHasProperty):
102         (JSObjectGetProperty):
103         (JSObjectSetProperty):
104         (JSObjectDeleteProperty):
105         (JSObjectGetPrivate):
106         (JSObjectSetPrivate):
107         (JSObjectIsFunction):
108         (JSObjectCallAsFunction):
109         (JSObjectIsConstructor):
110         (JSObjectCallAsConstructor):
111         (__JSPropertyListEnumerator::__JSPropertyListEnumerator):
112         (JSObjectCreatePropertyEnumerator):
113         (JSPropertyEnumeratorGetNext):
114         (JSPropertyEnumeratorRetain):
115         (JSPropertyEnumeratorRelease):
116         (JSPropertyListAdd):
117         * API/JSObjectRef.h: Added.
118         * API/JSValueRef.cpp: Added.
119         (JSValueGetType):
120         (JSValueIsUndefined):
121         (JSValueIsNull):
122         (JSValueIsBoolean):
123         (JSValueIsNumber):
124         (JSValueIsString):
125         (JSValueIsObject):
126         (JSValueIsEqual):
127         (JSValueIsStrictEqual):
128         (JSUndefinedMake):
129         (JSNullMake):
130         (JSBooleanMake):
131         (JSNumberMake):
132         (JSValueToBoolean):
133         (JSValueToNumber):
134         (JSGCProtect):
135         (JSGCUnprotect):
136         (JSGCCollect):
137         * API/JSValueRef.h: Added.
138         * API/JavaScriptCore.h: Added.
139         * API/minidom.c: Added.
140         (main):
141         * API/minidom.html: Added.
142         * API/minidom.js: Added.
143         * API/testapi.c: Added.
144         (assertEqualsAsBoolean):
145         (assertEqualsAsNumber):
146         (assertEqualsAsUTF8String):
147         (assertEqualsAsCharactersPtr):
148         (assertEqualsAsCharacters):
149         (MyObject_initialize):
150         (MyObject_copyDescription):
151         (MyObject_hasProperty):
152         (MyObject_getProperty):
153         (MyObject_setProperty):
154         (MyObject_deleteProperty):
155         (MyObject_getPropertyList):
156         (MyObject_callAsFunction):
157         (MyObject_callAsConstructor):
158         (MyObject_convertToType):
159         (MyObject_finalize):
160         (print_callAsFunction):
161         (main):
162         (createStringWithContentsOfFile):
163         * API/testapi.js: Added.
164         * ChangeLog:
165         * JavaScriptCore.xcodeproj/project.pbxproj:
166         * bindings/npruntime_impl.h:
167         * kjs/array_instance.h:
168         * kjs/array_object.cpp:
169         (ArrayInstance::getPropertyList):
170         * kjs/interpreter.cpp:
171         (KJS::Interpreter::evaluate):
172         * kjs/nodes.cpp:
173         (ForInNode::execute):
174         * kjs/object.cpp:
175         (KJS::JSObject::put):
176         (KJS::JSObject::canPut):
177         (KJS::JSObject::deleteProperty):
178         (KJS::JSObject::propertyIsEnumerable):
179         (KJS::JSObject::getPropertyAttributes):
180         (KJS::JSObject::getPropertyList):
181         * kjs/object.h:
182         * kjs/property_map.cpp:
183         (KJS::PropertyMap::get):
184         * kjs/property_map.h:
185         * kjs/scope_chain.cpp:
186         (KJS::ScopeChain::print):
187         * kjs/string_object.cpp:
188         (StringInstance::getPropertyList):
189         * kjs/string_object.h:
190         * kjs/ustring.h:
191         (KJS::UString::Rep::ref):
192
193 2006-06-20  Timothy Hatcher  <timothy@apple.com>
194
195         Reviewed by Geoff.
196
197         Make sure we clear the exception before returning so
198         that future calls will not fail because of an earlier
199         exception state. Assert on entry that the WebScriptObject
200         is working with an ExecState that dose not have an exception. 
201         Document that evaluateWebScript and callWebScriptMethod return
202         WebUndefined when an exception is thrown.
203
204         * bindings/objc/WebScriptObject.h:
205         * bindings/objc/WebScriptObject.mm:
206         (-[WebScriptObject callWebScriptMethod:withArguments:]):
207         (-[WebScriptObject evaluateWebScript:]):
208         (-[WebScriptObject setValue:forKey:]):
209         (-[WebScriptObject valueForKey:]):
210         (-[WebScriptObject removeWebScriptKey:]):
211         (-[WebScriptObject webScriptValueAtIndex:]):
212         (-[WebScriptObject setWebScriptValueAtIndex:value:]):
213
214 2006-06-19  Anders Carlsson  <acarlsson@apple.com>
215
216         Reviewed by John.
217
218         * kjs/interpreter.cpp:
219         (KJS::TimeoutChecker::pauseTimeoutCheck):
220         (KJS::TimeoutChecker::resumeTimeoutCheck):
221         Fix argument order in setitimer calls.
222
223 2006-06-18  Anders Carlsson  <acarlsson@apple.com>
224
225         Reviewed by Geoff.
226
227         * kjs/interpreter.cpp:
228         (KJS::TimeoutChecker::pauseTimeoutCheck):
229         Do nothing if the timeout check hasn't been started.
230         
231         (KJS::TimeoutChecker::resumeTimeoutCheck):
232         Do nothing if the timeout check hasn't been started.
233         Use the right signal handler when unblocking.
234         
235         (KJS::Interpreter::handleTimeout):
236         pause/resume the timeout check around the call to
237         shouldInterruptScript().
238         
239 2006-06-16  Ben Goodger <beng@google.com>
240         
241         Reviewed by Maciej
242
243         http://bugzilla.opendarwin.org/show_bug.cgi?id=9491
244         Windows build breaks in interpreter.cpp 
245
246         * kjs/interpreter.cpp
247         (KJS::TimeoutChecker::pauseTimeoutCheck):
248         (KJS::TimeoutChecker::resumeTimeoutCheck):
249         Make sure to only assert equality with s_executingInterpreter when it 
250         is being used (i.e. when HAVE(SYS_TIME_H) == true)
251
252 2006-06-17  David Kilzer  <ddkilzer@kilzer.net>
253
254         Reviewed by darin.
255
256         http://bugzilla.opendarwin.org/show_bug.cgi?id=9477
257         REGRESSION: fast/dom/replaceChild.html crashes on WebKit ToT in debug build
258
259         * kjs/function.cpp:
260         (KJS::FunctionImp::callAsFunction): Refetch the debugger after executing the function
261         in case the WebFrame it was running in has since been destroyed.
262
263 2006-06-17  David Kilzer  <ddkilzer@kilzer.net>
264
265         Reviewed by ggaren.
266
267         http://bugzilla.opendarwin.org/show_bug.cgi?id=9476
268         REGRESSION: Reproducible crash after closing window after viewing
269         css2.1/t0803-c5501-imrgn-t-00-b-ag.html
270
271         * kjs/debugger.cpp:
272         (Debugger::detach): Call setDebugger(0) for all interpreters removed from
273         the 'attached to a debugger' list.
274
275 2006-06-17  Anders Carlsson  <acarlsson@apple.com>
276
277         Reviewed by Maciej and Geoff.
278
279         http://bugzilla.opendarwin.org/show_bug.cgi?id=7080
280         Provide some way to stop a JavaScript infinite loop
281         
282         * kjs/completion.h:
283         (KJS::):
284         Add Interrupted completion type.
285         
286         * kjs/function.cpp:
287         (KJS::FunctionImp::callAsFunction):
288         (KJS::GlobalFuncImp::callAsFunction):
289         Only set the exception on the new ExecState if the current one has had one.
290         
291         * kjs/interpreter.cpp:
292         (KJS::TimeoutChecker::startTimeoutCheck):
293         (KJS::TimeoutChecker::stopTimeoutCheck):
294         (KJS::TimeoutChecker::alarmHandler):
295         (KJS::TimeoutChecker::pauseTimeoutCheck):
296         (KJS::TimeoutChecker::resumeTimeoutCheck):
297         New TimeoutChecker class which handles setting Interpreter::m_timedOut flag after a given
298         period of time. This currently only works on Unix platforms where setitimer and signals are used.
299         
300         (KJS::Interpreter::Interpreter):
301         Initialize new member variables.
302         
303         (KJS::Interpreter::~Interpreter):
304         Destroy the timeout checker.
305         
306         (KJS::Interpreter::startTimeoutCheck):
307         (KJS::Interpreter::stopTimeoutCheck):
308         (KJS::Interpreter::pauseTimeoutCheck):
309         (KJS::Interpreter::resumeTimeoutCheck):
310         Call the timeout checker.
311         
312         (KJS::Interpreter::handleTimeout):
313         Called on timeout. Resets the m_timedOut flag and calls shouldInterruptScript.
314         
315         * kjs/interpreter.h:
316         (KJS::Interpreter::setTimeoutTime):
317         New function for setting the timeout time.
318         
319         (KJS::Interpreter::shouldInterruptScript):
320         New function. The idea is that this should be overridden by subclasses in order to for example
321         pop up a dialog asking the user if the script should be interrupted.
322         
323         (KJS::Interpreter::checkTimeout):
324         New function which checks the m_timedOut flag and calls handleTimeout if it's set.
325         
326         * kjs/nodes.cpp:
327         (DoWhileNode::execute):
328         (WhileNode::execute):
329         (ForNode::execute):
330         Call Interpreter::checkTimeout after each iteration of the loop.
331
332 2006-06-15  Timothy Hatcher  <timothy@apple.com>
333
334         Reviewed by Geoff and Darin.
335         
336         Prefer the DWARF debugging symbols format for use in Xcode 2.3.
337
338         * JavaScriptCore.xcodeproj/project.pbxproj:
339
340 2006-06-14  Geoffrey Garen  <ggaren@apple.com>
341
342         Reviewed by Beth.
343         
344         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=9438
345         Someone broke ToT: cannot build
346
347         * JavaScriptCore.xcodeproj/project.pbxproj:
348         * bindings/runtime_root.h: Changed "Interpreter.h" to "interpreter.h"
349
350 2006-06-12  Geoffrey Garen  <ggaren@apple.com>
351
352         build fix
353         
354         * bindings/objc/WebScriptObject.mm:
355         (+[WebScriptObject throwException:]): Restore assignment I accidentally
356         deleted in previous commit
357
358 2006-06-12  Geoffrey Garen  <ggaren@apple.com>
359
360         Reviewed by TimO, Maciej.
361         
362         - Merged InterpreterImp code into Interpreter, which implements
363         all interpreter functionality now. This is part of my continuing quest
364         to create an external notion of JS "execution context" that is unified and simple --
365         something to replace the mix of Context, ContextImp, ExecState, Interpreter,
366         InterpreterImp, and JSRun.
367         
368         All tests pass. Leaks test has not regressed from its baseline ~207 leaks
369         with ~3460 leaked nodes.
370
371         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
372         * JavaScriptCore.xcodeproj/project.pbxproj:
373         * bindings/NP_jsobject.cpp:
374         * bindings/objc/WebScriptObject.mm:
375         (+[WebScriptObject throwException:]):
376         * bindings/runtime_root.cpp:
377         * bindings/runtime_root.h:
378         * kjs/Context.cpp:
379         (KJS::Context::Context):
380         * kjs/ExecState.cpp: Added.
381         (KJS::ExecState::lexicalInterpreter):
382         * kjs/ExecState.h: Added.
383         (KJS::ExecState::dynamicInterpreter):
384         * kjs/SavedBuiltins.h: Added.
385         * kjs/bool_object.cpp:
386         (BooleanPrototype::BooleanPrototype):
387         * kjs/collector.cpp:
388         (KJS::Collector::collect):
389         (KJS::Collector::numInterpreters):
390         * kjs/context.h:
391         * kjs/debugger.cpp:
392         (Debugger::attach):
393         (Debugger::detach):
394         * kjs/function.cpp:
395         (KJS::FunctionImp::callAsFunction):
396         (KJS::GlobalFuncImp::callAsFunction):
397         * kjs/function_object.cpp:
398         (FunctionObjectImp::construct):
399         * kjs/internal.cpp:
400         * kjs/internal.h:
401         * kjs/interpreter.cpp:
402         (KJS::interpreterMap):
403         (KJS::Interpreter::Interpreter):
404         (KJS::Interpreter::init):
405         (KJS::Interpreter::~Interpreter):
406         (KJS::Interpreter::globalObject):
407         (KJS::Interpreter::initGlobalObject):
408         (KJS::Interpreter::globalExec):
409         (KJS::Interpreter::checkSyntax):
410         (KJS::Interpreter::evaluate):
411         (KJS::Interpreter::builtinObject):
412         (KJS::Interpreter::builtinFunction):
413         (KJS::Interpreter::builtinArray):
414         (KJS::Interpreter::builtinBoolean):
415         (KJS::Interpreter::builtinString):
416         (KJS::Interpreter::builtinNumber):
417         (KJS::Interpreter::builtinDate):
418         (KJS::Interpreter::builtinRegExp):
419         (KJS::Interpreter::builtinError):
420         (KJS::Interpreter::builtinObjectPrototype):
421         (KJS::Interpreter::builtinFunctionPrototype):
422         (KJS::Interpreter::builtinArrayPrototype):
423         (KJS::Interpreter::builtinBooleanPrototype):
424         (KJS::Interpreter::builtinStringPrototype):
425         (KJS::Interpreter::builtinNumberPrototype):
426         (KJS::Interpreter::builtinDatePrototype):
427         (KJS::Interpreter::builtinRegExpPrototype):
428         (KJS::Interpreter::builtinErrorPrototype):
429         (KJS::Interpreter::builtinEvalError):
430         (KJS::Interpreter::builtinRangeError):
431         (KJS::Interpreter::builtinReferenceError):
432         (KJS::Interpreter::builtinSyntaxError):
433         (KJS::Interpreter::builtinTypeError):
434         (KJS::Interpreter::builtinURIError):
435         (KJS::Interpreter::builtinEvalErrorPrototype):
436         (KJS::Interpreter::builtinRangeErrorPrototype):
437         (KJS::Interpreter::builtinReferenceErrorPrototype):
438         (KJS::Interpreter::builtinSyntaxErrorPrototype):
439         (KJS::Interpreter::builtinTypeErrorPrototype):
440         (KJS::Interpreter::builtinURIErrorPrototype):
441         (KJS::Interpreter::mark):
442         (KJS::Interpreter::interpreterWithGlobalObject):
443         (KJS::Interpreter::saveBuiltins):
444         (KJS::Interpreter::restoreBuiltins):
445         * kjs/interpreter.h:
446         (KJS::Interpreter::setCompatMode):
447         (KJS::Interpreter::compatMode):
448         (KJS::Interpreter::firstInterpreter):
449         (KJS::Interpreter::nextInterpreter):
450         (KJS::Interpreter::prevInterpreter):
451         (KJS::Interpreter::debugger):
452         (KJS::Interpreter::setDebugger):
453         (KJS::Interpreter::setContext):
454         (KJS::Interpreter::context):
455         * kjs/nodes.cpp:
456         (StatementNode::hitStatement):
457         (RegExpNode::evaluate):
458         * kjs/protect.h:
459
460 2006-06-12  Geoffrey Garen  <ggaren@apple.com>
461
462         Reviewed by Maciej.
463         
464         - Have *.lut.h files #include lookup.h to eliminate surprising header
465         include order dependency.
466
467         * DerivedSources.make:
468         * kjs/array_object.cpp:
469         * kjs/date_object.cpp:
470         * kjs/date_object.h:
471         (KJS::DateProtoFunc::):
472         * kjs/lexer.cpp:
473         * kjs/math_object.cpp:
474         * kjs/number_object.cpp:
475         * kjs/regexp_object.cpp:
476         * kjs/string_object.cpp:
477
478 2006-06-10  Geoffrey Garen  <ggaren@apple.com>
479
480         - http://bugzilla.opendarwin.org/show_bug.cgi?id=8515
481         Linux porting compile bug
482         
483         Fix by Mike Emmel, Reviewed by Darin.
484
485         * JavaScriptCoreSources.bkl:
486         * jscore.bkl:
487         * wtf/Platform.h:
488
489 2006-06-09  Geoffrey Garen  <ggaren@apple.com>
490
491         Build fix -- I think :).
492
493         * JavaScriptCore.xcodeproj/project.pbxproj:
494         * kjs/context.h:
495
496 2006-06-09  Geoffrey Garen  <ggaren@apple.com>
497
498         Reviewed by Eric (yay!).
499         
500         - Removed Context wrapper for ContextImp, renamed ContextImp to Context,
501         split Context into its own file -- Context.cpp -- renamed _var to m_var,
502         change ' *' to '* '.
503
504         * JavaScriptCore.xcodeproj/project.pbxproj:
505         * kjs/Context.cpp: Added.
506         (KJS::Context::Context):
507         (KJS::Context::~Context):
508         (KJS::Context::mark):
509         * kjs/context.h:
510         (KJS::Context::scopeChain):
511         (KJS::Context::variableObject):
512         (KJS::Context::setVariableObject):
513         (KJS::Context::thisValue):
514         (KJS::Context::callingContext):
515         (KJS::Context::activationObject):
516         (KJS::Context::currentBody):
517         (KJS::Context::function):
518         (KJS::Context::arguments):
519         (KJS::Context::pushScope):
520         (KJS::Context::seenLabels):
521         * kjs/function.cpp:
522         (KJS::FunctionImp::callAsFunction):
523         (KJS::FunctionImp::processParameters):
524         (KJS::FunctionImp::argumentsGetter):
525         (KJS::GlobalFuncImp::callAsFunction):
526         * kjs/internal.cpp:
527         (KJS::InterpreterImp::evaluate):
528         * kjs/internal.h:
529         (KJS::InterpreterImp::setContext):
530         (KJS::InterpreterImp::context):
531         * kjs/interpreter.cpp:
532         * kjs/interpreter.h:
533         (KJS::ExecState::context):
534         (KJS::ExecState::ExecState):
535         * kjs/nodes.cpp:
536         (currentSourceId):
537         (currentSourceURL):
538         (ThisNode::evaluate):
539         (ResolveNode::evaluate):
540         (FunctionCallResolveNode::evaluate):
541         (PostfixResolveNode::evaluate):
542         (DeleteResolveNode::evaluate):
543         (TypeOfResolveNode::evaluate):
544         (PrefixResolveNode::evaluate):
545         (AssignResolveNode::evaluate):
546         (VarDeclNode::evaluate):
547         (VarDeclNode::processVarDecls):
548         (DoWhileNode::execute):
549         (WhileNode::execute):
550         (ForNode::execute):
551         (ForInNode::execute):
552         (ContinueNode::execute):
553         (BreakNode::execute):
554         (ReturnNode::execute):
555         (WithNode::execute):
556         (SwitchNode::execute):
557         (LabelNode::execute):
558         (TryNode::execute):
559         (FuncDeclNode::processFuncDecl):
560         (FuncExprNode::evaluate):
561
562 2006-06-07  Geoffrey Garen  <ggaren@apple.com>
563
564         Removed API directory I prematurely/accidentally added.
565
566         * API: Removed.
567
568 2006-06-05  Mitz Pettel  <opendarwin.org@mitzpettel.com>
569
570         Reviewed and landed by Geoff.
571
572         - fix a regression in ecma_3/String/regress-104375.js
573
574         * kjs/string_object.cpp:
575         (substituteBackreferences): If a 2-digit back reference is out of range,
576         parse it as a 1-digit reference (followed by the other digit). This matches
577         Firefox's behavior.
578
579 2006-06-05  Geoffrey Garen  <ggaren@apple.com>
580
581         Reviewed By Maciej.
582         Darin already reviewed this change on the branch. See <rdar://problem/4317701>.
583         
584         - Fixed <rdar://problem/4291345> PCRE overflow in Safari JavaScriptCore
585
586         No test case because there's no behavior change.
587         
588         * pcre/pcre_compile.c:
589         (read_repeat_counts): Check for integer overflow / out of bounds
590
591 2006-06-05  Geoffrey Garen  <ggaren@apple.com>
592
593         Reviewed by aliu.
594
595         - Changed CString length from int to size_t. We sould probably do this
596         for UString, too. (Darin, if you're reading this: Maciej said so.)
597         
598         * kjs/function.cpp:
599         (KJS::encode):
600         * kjs/ustring.cpp:
601         (KJS::CString::CString):
602         (KJS::operator==):
603         * kjs/ustring.h:
604         (KJS::CString::size):
605
606 2006-06-04  Geoffrey Garen  <ggaren@apple.com>
607
608         Reviewed by Maciej.
609         
610         - http://bugzilla.opendarwin.org/show_bug.cgi?id=9304
611         Minor cleanup in JavaScriptCore
612
613         * kjs/value.h: Removed redundant declarations
614
615 2006-06-04  Darin Adler  <darin@apple.com>
616
617         Reviewed by Anders.
618
619         - changed deleteAllValues so it can work on "const" collections
620           Deleting the values affects the values, not the pointers in the
621           collection, so it's legitimate to do it to a const collection,
622           and a case of that actually came up in the XPath code.
623
624         * wtf/HashMap.h:
625         (WTF::deleteAllPairSeconds): Use const iterators.
626         (WTF::deleteAllValues): Take const HashMap reference as a parameter.
627         * wtf/HashSet.h:
628         (WTF::deleteAllValues): Take const HashSet reference as a parameter,
629         and use const iterators.
630         * wtf/Vector.h:
631         (WTF::deleteAllValues): Take const Vector reference as a parameter.
632
633         - added more functions that are present in <math.h> on some platforms,
634           but not on others; moved here from various files in WebCore
635
636         * wtf/MathExtras.h:
637         (isinf): Added.
638         (isnan): Added.
639         (lround): Added.
640         (lroundf): Tweaked.
641         (round): Added.
642         (roundf): Tweaked.
643         (signbit): Added.
644
645 2006-06-02  Mitz Pettel  <opendarwin.org@mitzpettel.com>
646
647         Reviewed by ggaren.
648
649         - http://bugzilla.opendarwin.org/show_bug.cgi?id=9234
650           Implement $&, $' and $` replacement codes in String.prototype.replace
651
652         Test: fast/js/string-replace-3.html
653
654         * kjs/string_object.cpp:
655         (substituteBackreferences): Added support for $& (matched substring),
656         $` (everything preceding matched substring), $' (everything following
657         matched substring) and 2-digit back references, and cleaned up a little.
658
659 2006-06-02 Adele Peterson  <adele@apple.com>
660
661         Reviewed by Darin.
662
663         Set incremental linking to no. This seems to fix a build problem I was seeing
664         where dftables couldn't find a dll. 
665
666         * JavaScriptCore.vcproj/dftables/dftables.vcproj:
667
668 2006-05-26  Steve Falkenburg  <sfalken@apple.com>
669
670         Build fixes/tweaks
671
672         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
673
674 === JavaScriptCore-521.11 ===
675
676 2006-05-24  Geoffrey Garen  <ggaren@apple.com>
677
678         Reviewed by mjs.
679         
680         - JSC half of fix for <rdar://problem/4557926> TOT REGRESSSION: Crash
681         occurs when attempting to view image in slideshow mode at
682         http://d.smugmug.com/gallery/581716 ( KJS::IfNode::execute
683         (KJS::ExecState*) + 312)
684
685         On alternate threads, DOMObjects remain in the
686         ScriptInterpreter's cache because they're not collected. So, they
687         need an opportunity to mark their children.
688         
689         I'm not particularly happy with this solution because it fails to
690         resolve many outstanding issues with the DOM object cache. Since none
691         of those issues is a crasher or a serious compatibility concern,
692         and since the behavior of other browsers is not much to go on in this
693         case, I've filed <rdar://problem/4561439> about that, and I'm moving on 
694         with my life.
695
696         * JavaScriptCore.xcodeproj/project.pbxproj:
697         * kjs/collector.cpp:
698         (KJS::Collector::collect):
699         * kjs/internal.cpp:
700         (KJS::InterpreterImp::mark):
701         * kjs/internal.h:
702         * kjs/interpreter.cpp:
703         (KJS::Interpreter::mark):
704         * kjs/interpreter.h:
705
706 === JavaScriptCore-521.10 ===
707
708 2006-05-22  Timothy Hatcher  <timothy@apple.com>
709
710         Reviewed by Eric, Kevin and Geoff.
711
712         Merge open source build fixes. <rdar://problem/4555500>
713
714         * kjs/collector.cpp: look at the rsp register in x86_64 
715         (KJS::Collector::markOtherThreadConservatively):
716         * wtf/Platform.h: add x86_64 to the platform list
717
718 2006-05-19  Anders Carlsson  <acarlsson@apple.com>
719
720         Reviewed by Geoff.
721
722         http://bugzilla.opendarwin.org/show_bug.cgi?id=8993
723         Support function declaration in case statements
724         
725         * kjs/grammar.y: Get rid of StatementList and use SourceElements instead.
726         
727         * kjs/nodes.cpp:
728         (CaseClauseNode::evalStatements):
729         (CaseClauseNode::processVarDecls):
730         (CaseClauseNode::processFuncDecl):
731         (ClauseListNode::processFuncDecl):
732         (CaseBlockNode::processFuncDecl):
733         (SwitchNode::processFuncDecl):
734         * kjs/nodes.h:
735         (KJS::CaseClauseNode::CaseClauseNode):
736         (KJS::ClauseListNode::ClauseListNode):
737         (KJS::ClauseListNode::getClause):
738         (KJS::ClauseListNode::getNext):
739         (KJS::ClauseListNode::releaseNext):
740         (KJS::SwitchNode::SwitchNode):
741         Add processFuncDecl for the relevant nodes.        
742
743         * kjs/nodes2string.cpp:
744         (CaseClauseNode::streamTo):
745         next got renamed to source.
746
747 2006-05-17  George Staikos <staikos@kde.org>
748
749         Reviewed by Maciej, Alexey, and Eric.
750
751         * pcre/pcre_compile.c:
752         * pcre/pcre_get.c:
753         * pcre/pcre_exec.c:
754         * wtf/UnusedParam.h:
755         Use /**/ in .c files to compile with non-C99 and non-GCC compilers.
756
757         * kjs/testkjs.cpp:
758         Change include to <wtf/HashTraits.h> from "HashTraits.h" to avoid -I
759
760         * wtf/unicode/qt4/UnicodeQt4.h:
761         Use correct parentheses and correct mask for utf-32 support.
762
763 2006-05-17  Alexey Proskuryakov  <ap@nypop.com>
764
765         Reviewed by Darin.
766
767         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8870
768         Crash typing in Yahoo auto-complete widget.
769
770         Test: fast/js/regexp-stack-overflow.html
771
772         * pcre/pcre-config.h: Define NO_RECURSE.
773
774 2006-05-16  George Staikos <staikos@kde.org>
775
776         Reviewed by Maciej.
777
778         Fix some warnings and strict compilation errors.
779
780         * kjs/nodes.cpp: 
781         * kjs/value.cpp: 
782
783 2006-05-15  Alexey Proskuryakov  <ap@nypop.com>
784
785         * make-generated-sources.sh: Changed to be executable and removed
786         text in the file generated by "svn diff".
787
788 2006-05-15  Geoffrey Garen  <ggaren@apple.com>
789
790         Reviewed by Maciej.
791
792         - Fixed <rdar://problem/4534904> please do not treat "debugger" as
793         a reserved word while parsing JavaScript (and other ECMA reserved
794         words) 
795
796         AKA 
797
798         http://bugzilla.opendarwin.org/show_bug.cgi?id=6179 
799         We treat "char" as a reserved word in JavaScript and firefox/IE do
800         not
801
802         (1) I unreserved most of the spec's "future reserved words" because 
803         they're not reserved in IE or FF. (Most, but not all, because IE
804         somewhat randomly *does* reserve a few of them.)
805         (2) I made 'debugger' a legitimate statement that acts like an empty
806         statement because FF and IE support it.
807         
808         * kjs/grammar.y:
809         * kjs/keywords.table:
810
811 2006-05-15  Tim Omernick  <timo@apple.com>
812
813         Reviewed by John Sullivan.
814
815         Part of <rdar://problem/4466508> Add 64-bit support to the Netscape Plugin API
816
817         Added to the Netscape Plugin API the concept of "plugin drawing models".  The drawing model
818         determines the kind of graphics context created by the browser for the plugin, as well as 
819         the Mac types of various Netscape Plugin API data structures.
820
821         There is a drawing model to represent the old QuickDraw-based API.  It is used by default
822         if QuickDraw is available on the system, unless the plugin specifies another drawing model.
823
824         The big change is the addition of the CoreGraphics drawing model.  A plugin may request this
825         drawing model to obtain access to a CGContextRef for drawing, instead of a QuickDraw CGrafPtr.
826
827         * bindings/npapi.h:
828         Define NP_NO_QUICKDRAW when compiling 64-bit; there is no 64-bit QuickDraw.
829         Added NPNVpluginDrawingModel, NPNVsupportsQuickDrawBool, and NPNVsupportsCoreGraphicsBool
830         variables.
831         Added NPDrawingModel enumeration.  Currently the only drawing models are QuickDraw and
832         CoreGraphics.
833         NPRegion's type now depends on the drawing model specified by the plugin.
834         NP_Port is now only defined when QuickDraw is available.
835         Added NP_CGContext, which is the type of the NPWindow's "window" member in CoreGraphics mode.
836
837 2006-05-13  Kevin M. Ollivier  <kevino@theolliviers.com>
838
839         Reviewed by Darin, landed by ap.
840
841         - http://bugzilla.opendarwin.org/show_bug.cgi?id=8528
842           Bakefiles (and generated Makefiles) for wx and gdk ports
843
844         * make-generated-sources.sh: 
845         Added script to configure environment to run DerivedSources.make
846         
847         * JavaScriptCoreSources.bkl:
848         Added JavaScriptCore sources list for Bakefile.
849         
850         * jscore.bkl:
851         Bakefile used to generate JavaScriptCore project files 
852         (currently only used by wx and gdk ports)
853
854 2006-05-09  Steve Falkenburg  <sfalken@apple.com>
855
856         Fix Windows build.
857         Minor fixes to WTF headers.
858         
859         Reviewed by kevin.
860
861         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Fix include dirs, paths to files. 
862         * JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Fix include dirs.
863         * wtf/Assertions.h: include Platform.h to get definition for COMPILER()
864         * wtf/Vector.h: include FastMalloc.h for definition of fastMalloc, fastFree
865
866 2006-05-09  Maciej Stachowiak  <mjs@apple.com>
867
868         Rubber stamped by Anders.
869         
870         - renamed kxmlcore to wtf
871         
872         kxmlcore --> wtf
873         KXMLCore --> WTF
874         KXC --> WTF
875
876         * JavaScriptCore.xcodeproj/project.pbxproj:
877         * bindings/c/c_instance.cpp:
878         * bindings/objc/WebScriptObject.mm:
879         * kjs/JSImmediate.h:
880         * kjs/Parser.cpp:
881         * kjs/Parser.h:
882         * kjs/array_object.cpp:
883         * kjs/collector.cpp:
884         (KJS::Collector::registerThread):
885         * kjs/collector.h:
886         * kjs/config.h:
887         * kjs/function.cpp:
888         (KJS::isStrWhiteSpace):
889         * kjs/function.h:
890         * kjs/identifier.cpp:
891         * kjs/internal.cpp:
892         * kjs/internal.h:
893         * kjs/lexer.cpp:
894         (Lexer::shift):
895         (Lexer::isWhiteSpace):
896         (Lexer::isIdentStart):
897         (Lexer::isIdentPart):
898         * kjs/lookup.cpp:
899         * kjs/nodes.cpp:
900         * kjs/nodes.h:
901         * kjs/number_object.cpp:
902         * kjs/object.h:
903         * kjs/property_map.cpp:
904         * kjs/property_map.h:
905         * kjs/string_object.cpp:
906         (StringProtoFunc::callAsFunction):
907         * kjs/testkjs.cpp:
908         (testIsInteger):
909         * kjs/ustring.cpp:
910         * kjs/ustring.h:
911         * kxmlcore: Removed.
912         * kxmlcore/AlwaysInline.h: Removed.
913         * kxmlcore/Assertions.cpp: Removed.
914         * kxmlcore/Assertions.h: Removed.
915         * kxmlcore/FastMalloc.cpp: Removed.
916         * kxmlcore/FastMalloc.h: Removed.
917         * kxmlcore/FastMallocInternal.h: Removed.
918         * kxmlcore/Forward.h: Removed.
919         * kxmlcore/HashCountedSet.h: Removed.
920         * kxmlcore/HashFunctions.h: Removed.
921         * kxmlcore/HashMap.h: Removed.
922         * kxmlcore/HashSet.h: Removed.
923         * kxmlcore/HashTable.cpp: Removed.
924         * kxmlcore/HashTable.h: Removed.
925         * kxmlcore/HashTraits.h: Removed.
926         * kxmlcore/ListRefPtr.h: Removed.
927         * kxmlcore/Noncopyable.h: Removed.
928         * kxmlcore/OwnArrayPtr.h: Removed.
929         * kxmlcore/OwnPtr.h: Removed.
930         * kxmlcore/PassRefPtr.h: Removed.
931         * kxmlcore/Platform.h: Removed.
932         * kxmlcore/RefPtr.h: Removed.
933         * kxmlcore/TCPageMap.h: Removed.
934         * kxmlcore/TCSpinLock.h: Removed.
935         * kxmlcore/TCSystemAlloc.cpp: Removed.
936         * kxmlcore/TCSystemAlloc.h: Removed.
937         * kxmlcore/UnusedParam.h: Removed.
938         * kxmlcore/Vector.h: Removed.
939         * kxmlcore/VectorTraits.h: Removed.
940         * kxmlcore/unicode: Removed.
941         * kxmlcore/unicode/Unicode.h: Removed.
942         * kxmlcore/unicode/UnicodeCategory.h: Removed.
943         * kxmlcore/unicode/icu: Removed.
944         * kxmlcore/unicode/icu/UnicodeIcu.h: Removed.
945         * kxmlcore/unicode/posix: Removed.
946         * kxmlcore/unicode/qt3: Removed.
947         * kxmlcore/unicode/qt4: Removed.
948         * kxmlcore/unicode/qt4/UnicodeQt4.h: Removed.
949         * pcre/pcre_get.c:
950         * wtf: Added.
951         * wtf/Assertions.cpp:
952         * wtf/Assertions.h:
953         * wtf/FastMalloc.cpp:
954         (WTF::TCMalloc_ThreadCache::Scavenge):
955         (WTF::do_malloc):
956         (WTF::do_free):
957         (WTF::TCMallocGuard::TCMallocGuard):
958         (WTF::malloc):
959         (WTF::free):
960         (WTF::calloc):
961         (WTF::cfree):
962         (WTF::realloc):
963         * wtf/FastMalloc.h:
964         * wtf/FastMallocInternal.h:
965         * wtf/Forward.h:
966         * wtf/HashCountedSet.h:
967         * wtf/HashFunctions.h:
968         * wtf/HashMap.h:
969         * wtf/HashSet.h:
970         * wtf/HashTable.cpp:
971         * wtf/HashTable.h:
972         * wtf/HashTraits.h:
973         * wtf/ListRefPtr.h:
974         * wtf/Noncopyable.h:
975         * wtf/OwnArrayPtr.h:
976         * wtf/OwnPtr.h:
977         * wtf/PassRefPtr.h:
978         * wtf/RefPtr.h:
979         * wtf/TCSystemAlloc.cpp:
980         (TCMalloc_SystemAlloc):
981         * wtf/Vector.h:
982         * wtf/VectorTraits.h:
983         * wtf/unicode/UnicodeCategory.h:
984         * wtf/unicode/icu/UnicodeIcu.h:
985
986 2006-05-08  Timothy Hatcher  <timothy@apple.com>
987
988         Reviewed by Tim O.
989
990         * bindings/npapi.h: do not define #pragma options align=mac68k if we are 64-bit
991
992 2006-05-07  Darin Adler  <darin@apple.com>
993
994         Reviewed and landed by Maciej.
995
996         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8765
997         Random crashes on TOT since the form state change
998         
999         I haven't figured out how to construct a test for this, but this does seem to fix the
1000         problem; Mitz mentioned that a double-destroy was occurring in these functions.
1001         
1002         * kxmlcore/HashMap.h: (KXMLCore::HashMap::remove): Use RefCounter::deref instead of calling
1003         ~ValueType, because ~ValueType often results in a double-destroy, since the HashTable also
1004         destroys the element based on the storage type. The RefCounter template correctly does work
1005         only in cases where ValueType and ValueStorageType differ and this class is what's used
1006         elsewhere for the same purpose; I somehow missed this case when optimizing HashMap.
1007         * kxmlcore/HashSet.h: (KXMLCore::HashSet::remove): Ditto.
1008         
1009 2006-05-05  Darin Adler  <darin@apple.com>
1010
1011         - http://bugzilla.opendarwin.org/show_bug.cgi?id=8722
1012           IE compatibility fix in date parsing
1013
1014         * kjs/date_object.cpp: (KJS::parseDate): Merged change that George Staikos provided
1015         from KDE 3.4.3 branch that allows day values of 0 and values that are > 1000.
1016
1017 2006-05-04  Anders Carlsson  <andersca@mac.com>
1018
1019         Reviewed by Maciej.
1020
1021         http://bugzilla.opendarwin.org/show_bug.cgi?id=8734
1022         Would like a Vector::append that takes another Vector
1023         
1024         * kxmlcore/Vector.h:
1025         (KXMLCore::::append):
1026         New function that takes another array.
1027
1028 2006-05-02  Steve Falkenburg  <sfalken@apple.com>
1029
1030         Reviewed by eric.
1031
1032         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: set NDEBUG for release build
1033         * kxmlcore/FastMalloc.cpp: Prevent USE_SYSTEM_MALLOC from being defined twice
1034
1035 2006-05-02  Anders Carlsson  <andersca@mac.com>
1036
1037         Reviewed by Maciej.
1038
1039         * kxmlcore/HashMap.h:
1040         (KXMLCore::::operator):
1041         Return *this
1042
1043 2006-05-01  Tim Omernick  <timo@apple.com>
1044
1045         Reviewed by Tim Hatcher.
1046
1047         <rdar://problem/4476875> Support printing for embedded Netscape plugins
1048
1049         * bindings/npapi.h:
1050         Fixed struct alignment problem in our npapi.h.  Structs must be 68k-aligned on both pre-Mac OS X
1051         and Mac OS X systems, as this is what plugins expect.
1052
1053 2006-05-01  Timothy Hatcher  <timothy@apple.com>
1054
1055         Reviewed by Maciej.
1056         
1057         <rdar://problem/4308243> 8F36 Regression: crash in malloc_consolidate if you use a .PAC file
1058
1059         The original fix missed the oversized cell case. Added a test for "currentThreadIsMainThread || 
1060         imp->m_destructorIsThreadSafe" where we collect oversized cells.
1061
1062         We don't have a way to test PAC files yet, so there's no test attached.
1063
1064         * kjs/collector.cpp:
1065         (KJS::Collector::collect): test the thread when we collect oversized cells
1066
1067 2006-05-01  Tim Omernick  <timo@apple.com>
1068
1069         Reviewed by Adele.
1070
1071         <rdar://problem/4526114> REGRESSION (two days ago): LOG() just prints @ for NSObject substitutions
1072
1073         * kxmlcore/Assertions.cpp:
1074         Changed sense of strstr("%@") check.  I already made the same fix to the WebBrowser assertions.
1075
1076 2006-04-28  Steve Falkenburg  <sfalken@apple.com>
1077
1078         Reviewed by kdecker
1079         
1080         Actually apply the change that was reviewed insted of checking it in with an #if 0 (oops).
1081
1082         * kjs/testkjs.cpp:
1083         (main): Suppress C runtime alerts
1084
1085 2006-04-28  Steve Falkenburg  <sfalken@apple.com>
1086
1087         Reviewed by kdecker
1088
1089         Suppress error reporting dialog that blocks Javascript tests from completing.
1090         
1091         Real error is due to an overflow in the date/time handling functions that needs
1092         to be addressed, but this will prevent the hang running the Javascript tests
1093         on the build bot (along with the related changes).
1094         
1095         * kjs/testkjs.cpp:
1096         (main): Suppress C runtime alerts
1097
1098 2006-04-27  Geoffrey Garen  <ggaren@apple.com>
1099
1100         Reviewed by Maciej
1101
1102         - Minor fixups I discovered while working on the autogenerator.
1103         
1104         * kjs/lookup.cpp:
1105         (findEntry): ASSERT that size is not 0, because otherwise we'll % by 0,
1106         compute a garbage address, and possibly crash.
1107         * kjs/lookup.h:
1108         (cacheGlobalObject): Don't enumerate cached objects -- ideally, they
1109         would be hidden entirely.
1110
1111 2006-04-21  Kevin M. Ollivier  <kevino@theolliviers.com>
1112
1113         Reviewed by Darin.
1114
1115         - http://bugzilla.opendarwin.org/show_bug.cgi?id=8507
1116           Compilation fixes for building on gcc 4.0.2, and without precomp headers
1117
1118         * kjs/operations.h:
1119         * kxmlcore/Assertions.cpp:
1120         * kxmlcore/FastMalloc.cpp:
1121         Added necessary headers to resolve compilation issues when not using
1122         precompiled headers.
1123         
1124         * kjs/value.h: Declare the JSCell class before friend declaration  
1125         to resolve compilation issues with gcc 4.0.2.
1126         
1127         * kxmlcore/Platform.h: Set Unicode support to use ICU on platforms
1128         other than KDE (previously only defined for Win and Mac OS)
1129                 
1130 2006-04-18  Eric Seidel  <eseidel@apple.com>
1131
1132         Reviewed by ggaren.
1133
1134         Fix "new Function()" to correctly use lexical scoping.
1135         Add ScopeChain::print() function for debugging.
1136         <rdar://problem/4067864> REGRESSION (125-407): JavaScript failure on PeopleSoft REN Server
1137
1138         * kjs/function_object.cpp:
1139         (FunctionObjectImp::construct):
1140         * kjs/scope_chain.cpp:
1141         (KJS::ScopeChain::print):
1142         * kjs/scope_chain.h:
1143
1144 2006-04-14  James G. Speth  <speth@end.com>
1145
1146         Reviewed by Timothy.
1147
1148         Bug 8389: support for Cocoa bindings - binding an NSTreeController to the WebView's DOM
1149         http://bugzilla.opendarwin.org/show_bug.cgi?id=8389
1150
1151         Adds a category to WebScriptObject with array accessors for KVC/KVO.
1152
1153         If super valueForKey: fails it will call valueForUndefinedKey:, which is
1154         important because it causes the right behavior to happen with bindings using
1155         the "Raises for Not Applicable Keys" flag and the "Not Applicable Placeholder"
1156
1157         * bindings/objc/WebScriptObject.mm:
1158         (-[WebScriptObject valueForKey:]):
1159         (-[WebScriptObject count]):
1160         (-[WebScriptObject objectAtIndex:]):
1161         (-[WebUndefined description]): return "undefined"
1162
1163 2006-04-13  Geoffrey Garen  <ggaren@apple.com>
1164
1165         Reviewed by Darin.
1166
1167         * kjs/internal.cpp:
1168         (KJS::InterpreterImp::initGlobalObject): Add the built-in object
1169         prototype to the end of the global object's prototype chain instead of
1170         just blowing away its existing prototype. We need to do this because
1171         the window object has a meaningful prototype now.
1172
1173 2006-04-13  Maciej Stachowiak  <mjs@apple.com>
1174
1175         Reviewed by Geoff.
1176         
1177         - fix testkjs to not show false-positive KJS::Node leaks in debug builds
1178
1179         * kjs/testkjs.cpp:
1180         (doIt):
1181         (kjsmain):
1182
1183 2006-04-11  Geoffrey Garen  <ggaren@apple.com>
1184
1185         Reviewed by Maciej.
1186
1187         Minor code cleanup -- passes all the JS tests.
1188
1189         * kjs/object_object.cpp:
1190         (ObjectObjectImp::construct):
1191         (ObjectObjectImp::callAsFunction):
1192
1193 2006-04-11  Darin Adler  <darin@apple.com>
1194
1195         - another attempt to fix Windows build -- Vector in Forward.h was not working
1196
1197         * kxmlcore/Forward.h: Remove Vector.
1198         * kxmlcore/Vector.h: Add back default arguments, remove include of
1199         Forward.h.
1200
1201 2006-04-11  Darin Adler  <darin@apple.com>
1202
1203         - try to fix Windows build -- HashForward.h was not working
1204
1205         * kxmlcore/HashForward.h: Removed.
1206
1207         * JavaScriptCore.xcodeproj/project.pbxproj: Remove HashForward.h.
1208         * kjs/collector.h: Remove use of HashForward.h.
1209         * kxmlcore/HashCountedSet.h: Remove include of HashForward.h, restore
1210         default arguments.
1211         * kxmlcore/HashMap.h: Ditto.
1212         * kxmlcore/HashSet.h: Ditto.
1213
1214 2006-04-11  David Harrison  <harrison@apple.com>
1215
1216         Reviewed by Darin.
1217
1218         - fixed clean build, broken by Darin's check-in
1219
1220         * kjs/date_object.cpp: Add needed include of lookup.h.
1221         * kjs/regexp_object.cpp: Move include of .lut.h file below other includes.
1222
1223 2006-04-10  Darin Adler  <darin@apple.com>
1224
1225         Rubber-stamped by John Sullivan.
1226
1227         - switched from a shell script to a makefile for generated files
1228         - removed lots of unneeded includes
1229         - added new Forward.h and HashForward.h headers that allow compiling with
1230           fewer unneeded templates
1231
1232         * DerivedSources.make: Added.
1233         * generate-derived-sources: Removed.
1234         * JavaScriptCore.xcodeproj/project.pbxproj: Added new files, changed to use
1235         DerivedSources.make.
1236
1237         * kxmlcore/Forward.h: Added.
1238         * kxmlcore/HashForward.h: Added.
1239
1240         * kxmlcore/HashCountedSet.h: Include HashForward for default args.
1241         * kxmlcore/HashMap.h: Ditto.
1242         * kxmlcore/HashSet.h: Ditto.
1243
1244         * kjs/object.h:
1245         * kjs/object.cpp:
1246         Moved KJS_MAX_STACK into the .cpp file.
1247
1248         * bindings/NP_jsobject.cpp:
1249         * bindings/c/c_instance.h:
1250         * bindings/jni/jni_class.h:
1251         * bindings/jni/jni_runtime.h:
1252         * bindings/jni/jni_utility.h:
1253         * bindings/objc/WebScriptObject.mm:
1254         * bindings/objc/WebScriptObjectPrivate.h:
1255         * bindings/objc/objc_class.h:
1256         * bindings/objc/objc_class.mm:
1257         * bindings/objc/objc_instance.h:
1258         * bindings/objc/objc_instance.mm:
1259         * bindings/objc/objc_runtime.mm:
1260         * bindings/objc/objc_utility.mm:
1261         * bindings/runtime.h:
1262         * bindings/runtime_array.cpp:
1263         * bindings/runtime_array.h:
1264         * bindings/runtime_method.cpp:
1265         * bindings/runtime_method.h:
1266         * bindings/runtime_object.cpp:
1267         * bindings/runtime_root.h:
1268         * kjs/JSImmediate.cpp:
1269         * kjs/Parser.h:
1270         * kjs/array_object.cpp:
1271         * kjs/array_object.h:
1272         * kjs/bool_object.cpp:
1273         * kjs/bool_object.h:
1274         * kjs/collector.h:
1275         * kjs/context.h:
1276         * kjs/debugger.cpp:
1277         * kjs/error_object.h:
1278         * kjs/function_object.h:
1279         * kjs/internal.h:
1280         * kjs/lexer.cpp:
1281         * kjs/math_object.cpp:
1282         * kjs/math_object.h:
1283         * kjs/nodes.cpp:
1284         * kjs/nodes.h:
1285         * kjs/number_object.cpp:
1286         * kjs/number_object.h:
1287         * kjs/object_object.cpp:
1288         * kjs/operations.cpp:
1289         * kjs/protected_reference.h:
1290         * kjs/reference.h:
1291         * kjs/reference_list.h:
1292         * kjs/regexp_object.h:
1293         * kjs/string_object.cpp:
1294         * kjs/string_object.h:
1295         * kjs/testkjs.cpp:
1296         * kjs/value.cpp:
1297         * kjs/value.h:
1298         * kxmlcore/HashTable.h:
1299         * kxmlcore/ListRefPtr.h:
1300         * kxmlcore/TCPageMap.h:
1301         * kxmlcore/Vector.h:
1302         Removed unneeded header includes.
1303
1304 2006-04-09  Geoffrey Garen  <ggaren@apple.com>
1305
1306         Reviewed by eric.
1307
1308         - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=8284
1309         prevent unnecessary entries in the "nodes with extra refs" hash table
1310
1311         This patch switches manually RefPtr exchange with use of
1312         RefPtr::release to ensure that a node's ref count never tops 1
1313         (in the normal case).
1314
1315         * kjs/nodes.cpp:
1316         (BlockNode::BlockNode):
1317         (CaseBlockNode::CaseBlockNode):
1318         * kjs/nodes.h:
1319         (KJS::ArrayNode::ArrayNode):
1320         (KJS::ObjectLiteralNode::ObjectLiteralNode):
1321         (KJS::ArgumentsNode::ArgumentsNode):
1322         (KJS::VarStatementNode::VarStatementNode):
1323         (KJS::ForNode::ForNode):
1324         (KJS::CaseClauseNode::CaseClauseNode):
1325         (KJS::FuncExprNode::FuncExprNode):
1326         (KJS::FuncDeclNode::FuncDeclNode):
1327
1328 2006-04-08  Alexey Proskuryakov  <ap@nypop.com>
1329
1330         Reviewed by Darin.
1331
1332         One more attempt - use reinterpret_cast, rather than static_cast.
1333
1334 2006-04-08  Alexey Proskuryakov  <ap@nypop.com>
1335
1336         Reviewed by Darin.
1337
1338         An attempt to fix Win32 build - ICU uses wchar_t on Windows, so we need a type cast.
1339
1340         * kxmlcore/unicode/icu/UnicodeIcu.h:
1341         (KXMLCore::Unicode::toLower):
1342         (KXMLCore::Unicode::toUpper):
1343
1344 2006-04-08  Alexey Proskuryakov  <ap@nypop.com>
1345
1346         Reviewed by Darin.
1347
1348         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8264
1349         toLowerCase and toUpperCase don't honor special mappings
1350
1351         Test: fast/js/string-capitalization.html
1352
1353         * JavaScriptCore.xcodeproj/project.pbxproj: Added KXMLCore::Unicode headers to the project.
1354         * icu/unicode/putil.h: Added (copied from WebCore).
1355         * icu/unicode/uiter.h: Ditto.
1356         * icu/unicode/ustring.h: Ditto.
1357         * kjs/string_object.cpp:
1358         (StringProtoFunc::callAsFunction): Use the new KXMLCore::Unicode::toUpper() and toLower().
1359         * kjs/ustring.cpp: Removed unused (and evil) UChar::toLower() and toUpper().
1360         * kjs/ustring.h: Ditto.
1361
1362         * kxmlcore/unicode/Unicode.h: Corrected capitalization of the word Unicode.
1363         * kxmlcore/unicode/UnicodeCategory.h: Renamed include guard macro to match file name.
1364
1365         * kxmlcore/unicode/icu/UnicodeIcu.h:
1366         (KXMLCore::Unicode::toLower): Work on strings, not individual characters. Use ICU root locale.
1367         (KXMLCore::Unicode::toUpper): Ditto.
1368         (KXMLCore::Unicode::isFormatChar): Use int32_t, which can hold a complete code point.
1369         (KXMLCore::Unicode::isSeparatorSpace): Ditto.
1370         (KXMLCore::Unicode::category): Ditto.
1371         * kxmlcore/unicode/qt4/UnicodeQt4.h:
1372         (KXMLCore::Unicode::toLower): Work on strings, not individual characters.
1373         (KXMLCore::Unicode::toUpper): Ditto.
1374         (KXMLCore::Unicode::isFormatChar): Use int32_t, which can hold a complete code point.
1375         (KXMLCore::Unicode::isSeparatorSpace): Ditto.
1376         (KXMLCore::Unicode::category): Ditto.
1377
1378         * tests/mozilla/ecma/String/15.5.4.12-1.js: Corrected expected results.
1379         * tests/mozilla/ecma/String/15.5.4.12-5.js: Corrected expected results.
1380
1381 2006-04-05  Darin Adler  <darin@apple.com>
1382
1383         - attempt to fix Windows build
1384
1385         * kxmlcore/HashMap.h: (KXMLCore::HashMap::remove): Use (*it). instead of it->.
1386         * kxmlcore/HashSet.h: (KXMLCore::HashSet::remove): Ditto.
1387
1388 2006-04-05  Darin Adler  <darin@apple.com>
1389
1390         - attempt to fix Windows build
1391
1392         * os-win32/stdint.h: Add int8_t, uint8_t, int64_t.
1393
1394 2006-04-05  Darin Adler  <darin@apple.com>
1395
1396         Reviewed by Maciej.
1397
1398         - fix memory leak introduced by the previous change
1399
1400         * kxmlcore/HashTable.h: Specialize NeedsRef so that it correctly returns true when
1401         the value in question is a pair where one of the pair needs a ref and the other
1402         of the pair does not.
1403
1404 2006-04-05  Darin Adler  <darin@apple.com>
1405
1406         Reviewed by Maciej.
1407
1408         - JavaScriptCore part of fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8049
1409           StringImpl hash traits deleted value creates an init routine for WebCore
1410           <rdar://problem/4442248> REGRESSION: WebCore has init routines (8049)
1411
1412         Change HashMap and HashSet implementation so they fold various types together.
1413         This allows us to implement maps and sets that use RefPtr<WebCore::StringImpl>
1414         and WebCore::String in terms of the underlying raw pointer type, and hence use
1415         -1 for the deleted value.
1416
1417         * kxmlcore/HashTraits.h: Added a new type to HashTraits, StorageTraits, which is a
1418         type to be used when storing a value that has the same layout as the type itself.
1419         This is used only for non-key cases. In the case of keys, the hash function must also
1420         be considered. Moved emptyValue out of GenericHashTraitsBase into GenericHashTraits.
1421         Added a new bool to HashTraits, needsRef, which indicates whether the type needs
1422         explicit reference counting. If the type itself has needsRef true, but the storage
1423         type has needsRef false, then the HashSet or HashMap has to handle the reference
1424         counting explicitly. Added hash trait specializations for all signed integer values
1425         that give -1 as the deleted value. Gave all integers StorageTraits of the canonical
1426         integer type of the same size so int and long will share code. Gave all pointers and
1427         RefPtrs StorageTraits of the appropriately sized integer type. Removed redundant
1428         TraitType and emptyValue definitions in the pointer specialization for HashTraits.
1429         Added PairBaseHashTraits, which doesn't try to set up needsDestruction and deletedValue.
1430         Useful for types where we don't want to force the existence of deletedValue, such as
1431         the type of a pair in a HashMap which is not the actual storage type. Removed an
1432         unneeded parameter from the DeletedValueAssigner template. Added HashKeyStorageTraits
1433         template, which determines what type can be used to store a given hash key type with
1434         a given hash function, and specialized it for pointers and RefPtr so that pointer
1435         hash tables share an underlying HashTable that uses IntHash.
1436
1437         * kxmlcore/HashTable.h: Added HashTableConstIteratorAdapter, HashTableIteratorAdapter,
1438         NeedsRef, RefCountManagerBase, RefCountManager, HashTableRefCountManagerBase, and
1439         HashTableRefCountManager. All are used by both HashSet and HashMap to handle hash
1440         tables where the type stored is not the same as the real value type.
1441         
1442         * kxmlcore/HashFunctions.h: Added a new struct named IntTypes that finds an
1443         integer type given a sizeof value. Renamed pointerHash to intHash and made it
1444         use overloading and take integer parameters. Added an IntHash struct which is
1445         a hash function that works for integers. Changed PtrHash to call IntHash with
1446         an appropriately sized integer. Made IntHash the default hash function for
1447         many integer types. Made PtrHash the default hash function for RefPtr as well
1448         as for raw pointers.
1449
1450         * kxmlcore/HashSet.h: Changed implementation to use a separate "storage type"
1451         derived from the new traits. The HashTable will use the storage type and all
1452         necessary translation and ref/deref is done at the HashSet level. Also reorganized
1453         the file so that the HashSet is at the top and has no inline implementation inside
1454         it so it's easy to read the interface to HashSet.
1455
1456         * kxmlcore/HashMap.h: Changed implementation to use a separate "storage type"
1457         derived from the new traits. The HashTable will use the storage type and all
1458         necessary translation and ref/deref is done at the HashMap level. Also reorganized
1459         the file so that the HashMap is at the top and has no inline implementation inside
1460         it so it's easy to read the interface to HashMap.
1461
1462         * kxmlcore/HashMapPtrSpec.h: Removed. Superceded by optimizations in HashMap itself.
1463
1464         * JavaScriptCore.xcodeproj/project.pbxproj: Remove HashMapPtrSpec.h, resort files,
1465         and also remove some unnecessary build settings from the aggregate target that
1466         generates derived sources.
1467         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto.
1468
1469 2006-04-04  Timothy Hatcher  <timothy@apple.com>
1470
1471         Reviewed by Darin.
1472
1473         The Debug and Release frameworks are now built with install paths relative to the build products directory.
1474         This removes the need for other projects to build with -framework WebCore and -framework JavaScriptCore. 
1475
1476         * JavaScriptCore.xcodeproj/project.pbxproj:
1477
1478 2006-04-04  Eric Seidel  <eseidel@apple.com>
1479
1480         Reviewed by ggaren.
1481
1482         Fix win32 build.
1483         Disable ASSERT redefinition warnings for now.
1484
1485         * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
1486         * kxmlcore/Assertions.h:
1487
1488 2006-04-04  Bjrn Graf  <bjoern.graf@gmail.com>
1489
1490         Reviewed by ggaren & darin.  Landed by eseidel.
1491
1492         Integrate CURL version of gettimeofday
1493         http://bugzilla.opendarwin.org/show_bug.cgi?id=7399
1494         Disable crash report dialogs for testkjs.exe in Release mode
1495         http://bugzilla.opendarwin.org/show_bug.cgi?id=8113
1496
1497         * kjs/testkjs.cpp:
1498         (StopWatch::start):
1499         (StopWatch::stop):
1500         (StopWatch::getElapsedMS):
1501         (main):
1502         (kjsmain):
1503
1504 2006-04-04  Eric Seidel  <eseidel@apple.com>
1505
1506         Reviewed by mjs.
1507
1508         * kjs/number_object.cpp:
1509         (NumberProtoFunc::callAsFunction): remove trunc() to fix win32.
1510
1511 2006-03-12  Maciej Stachowiak  <mjs@apple.com>
1512
1513         Reviewed by Darin.
1514         
1515         - fixed "toPrecision sometimes messes up the last digit on intel Macs"
1516         http://bugzilla.opendarwin.org/show_bug.cgi?id=7748
1517
1518         * kjs/number_object.cpp:
1519         (intPow10): Compute integer powers of 10 using exponentiation by squaring.
1520         (NumberProtoFunc::callAsFunction): Use intPow10(n) in place of all pow(10.0, n),
1521         plus a bit of refactoring.
1522
1523 2006-04-03  Darin Adler  <darin@apple.com>
1524
1525         - tweak config.h and Platform.h to try to get buildbot working
1526           (making some small changes at the same time)
1527
1528         * kjs/config.h: Removed now-unneeded HAVE_ICU.
1529         * kxmlcore/Platform.h: Tweak how platform gets set up. Move all the
1530         USE stuff to the end.
1531
1532 2006-04-03  George Staikos   <staikos@opensource.apple.com>
1533
1534         Reviewed by Maciej.
1535
1536         Fix Win32 build breakage from previous commit, remove unused forward.
1537
1538 2006-04-03  George Staikos   <staikos@opensource.apple.com>
1539
1540         Reviewed by Maciej.
1541
1542         Implement a unicode abstraction layer to make JavaScriptCore much more
1543         easily ported to other platforms without having to take in libicu.  Also
1544         makes the unicode related code easier to understand.
1545
1546 2006-04-03  Timothy Hatcher  <timothy@apple.com>
1547
1548         Reviewed by Adele.
1549
1550         Fixes <rdar://problem/4498338> JavaScriptCore fails to compile for ppc64
1551         Other 64 bit build fixes.
1552
1553         * kjs/collector.cpp:
1554         (KJS::Collector::markOtherThreadConservatively): test for __DARWIN_UNIX03 and use __r1
1555         * kjs/dtoa.cpp:
1556         (Bigint::): cast PRIVATE_mem to unsigned to prevent warning
1557         * bindings/jni/jni_utility.cpp:
1558         (KJS::Bindings::getJavaVM): cast jniError to long to prevent format warning
1559         (KJS::Bindings::getJNIEnv): cast jniError to long to prevent format warning
1560         * bindings/runtime_root.cpp:
1561         (KJS::Bindings::addNativeReference): cast CFDictionaryGetValue to unsigned long to prevent warning
1562         (KJS::Bindings::removeNativeReference): cast CFDictionaryGetValue to unsigned long to prevent warning
1563
1564 2006-03-31  Darin Adler  <darin@apple.com>
1565
1566         Reviewed by Geoff.
1567
1568         - <rdar://problem/4395622> API: WebScriptObject.h incorrectly reports that -isSelectorExcludedFromWebScript returns NO by default
1569
1570         * bindings/objc/WebScriptObject.h: Fixed comment.
1571
1572 2006-03-31  Eric Seidel  <eseidel@apple.com>
1573
1574         Reviewed by mjs.
1575
1576         A bit more code cleanup.
1577
1578         * bindings/c/c_utility.cpp:
1579         (KJS::Bindings::convertValueToNPVariant):
1580         * bindings/objc/objc_runtime.mm:
1581         (convertValueToObjcObject):
1582         * bindings/objc/objc_utility.mm:
1583         (KJS::Bindings::convertValueToObjcValue):
1584         * kjs/function.cpp:
1585         (KJS::GlobalFuncImp::callAsFunction):
1586         * kjs/interpreter.cpp:
1587         (KJS::ExecState::lexicalInterpreter):
1588         * kjs/interpreter.h:
1589         * kjs/operations.cpp:
1590         (KJS::equal):
1591
1592 2006-03-30  Eric Seidel  <eseidel@apple.com>
1593
1594         Reviewed by anders.
1595
1596         Small code-style update.
1597
1598         * kjs/operations.cpp:
1599         (KJS::isNaN):
1600         (KJS::isInf):
1601         (KJS::isPosInf):
1602         (KJS::isNegInf):
1603         (KJS::equal):
1604         (KJS::strictEqual):
1605         (KJS::relation):
1606         (KJS::maxInt):
1607         (KJS::minInt):
1608         (KJS::add):
1609         (KJS::mult):
1610
1611 2006-03-31  Anders Carlsson  <andersca@mac.com>
1612
1613         Reviewed by Maciej.
1614
1615         Make sure the GetterSetterImp objects are marked as well.
1616         
1617         * kjs/internal.cpp:
1618         (KJS::GetterSetterImp::mark):
1619         Call JSCell::mark().
1620
1621 2006-03-30  Eric Seidel  <eseidel@apple.com>
1622
1623         Reviewed by ggaren.
1624
1625         * kjs/nodes.h: Some various small style fixes.
1626
1627 2006-03-30  Eric Seidel  <eseidel@apple.com>
1628
1629         Reviewed by ggaren.
1630
1631         Clean-up style issues in node.h, remove redundant initializations.
1632
1633         * kjs/nodes.h:
1634         (KJS::StatementNode::evaluate):
1635         (KJS::ArrayNode::ArrayNode):
1636         (KJS::ObjectLiteralNode::ObjectLiteralNode):
1637         (KJS::ArgumentsNode::ArgumentsNode):
1638         (KJS::NewExprNode::NewExprNode):
1639         (KJS::CaseClauseNode::CaseClauseNode):
1640         (KJS::FuncDeclNode::FuncDeclNode):
1641
1642 2006-03-30  Tim Omernick  <timo@apple.com>
1643
1644         Reviewed by Geoff.
1645
1646         <rdar://problem/4212626> REGRESSION: LIVECONNECT: JavaScript type for Java Strings is function,
1647         not object
1648
1649         * bindings/runtime.h:
1650         (KJS::Bindings::Instance::implementsCall):
1651         New method.  Returns false by default.  Concrete subclasses can override this return true when
1652         the bound object may be called as a function.
1653         (KJS::Bindings::Instance::invokeDefaultMethod):
1654         Since bound objects are no longer treated as functions by default, we can return jsUndefined()
1655         here instead of in concrete subclasses that decide not to implement the default method
1656         functionality.
1657
1658         * bindings/runtime_object.cpp:
1659         (RuntimeObjectImp::implementsCall):
1660         Don't assume that the bound object is a function; instead, let the object instance decide whether
1661         it is callable.
1662
1663         * bindings/c/c_instance.h:
1664         * bindings/c/c_instance.cpp:
1665         (KJS::Bindings::CInstance::implementsCall):
1666         The object is callable if its class has an invokeDefault function.
1667
1668         * bindings/objc/objc_instance.h:
1669         * bindings/objc/objc_instance.mm:
1670         (ObjcInstance::implementsCall):
1671         The object is callable if the ObjC instance responds to -invokeDefaultMethodWithArguments:.
1672
1673         * bindings/jni/jni_instance.h:
1674         * bindings/jni/jni_instance.cpp:
1675         Moved bogus invokeDefaultMethod() to superclass.
1676
1677 2006-03-29  Geoffrey Garen  <ggaren@apple.com>
1678
1679         Reviewed by Darin.
1680
1681         - JavaScriptCore side of fix for <rdar://problem/4308243> 8F36 
1682         Regression: crash in malloc_consolidate if you use a .PAC file
1683
1684         The crash was a result of threaded deallocation of thread-unsafe
1685         objects. Pure JS objects are thread-safe because all JS execution
1686         is synchronized through JSLock. However, JS objects that wrap WebCore 
1687         objects are thread-unsafe because JS and WebCore execution are not 
1688         synchronized.  That unsafety comes into play when the collector 
1689         deallocates a JS object that wraps a WebCore object, thus causing the 
1690         WebCore object to be deallocated.
1691
1692         The solution here is to have each JSCell know whether it is safe to
1693         collect on a non-main thread, and to avoid collecting unsafe cells
1694         when on a non-main thread.
1695
1696         We don't have a way to test PAC files yet, so there's no test
1697         attached to this patch.
1698
1699         * kjs/collector.cpp:
1700         (KJS::Collector::collect):
1701         (1) Added the test "currentThreadIsMainThread || 
1702         imp->m_destructorIsThreadSafe". 
1703
1704         * kjs/protect.h:
1705         (KJS::gcProtectNullTolerant):
1706         (KJS::gcUnprotectNullTolerant):
1707         * kjs/value.h:
1708         (KJS::JSCell::JSCell): The bools here must be bitfields, otherwise
1709         m_destructorIsThreadSafe becomes another whole word, ruining the
1710         collector optimizations we've made based on the size of a JSObject.
1711         * kxmlcore/FastMalloc.cpp:
1712         (KXMLCore::currentThreadIsMainThread):
1713         (KXMLCore::fastMallocRegisterThread):
1714         * kxmlcore/FastMalloc.h:
1715
1716 2006-03-28  Darin Adler  <darin@apple.com>
1717
1718         Reviewed by Geoff.
1719
1720         - change some code that resulted in init routines on Mac OS X -- if the framework has
1721           init routines it will use memory and slow down applications that link with WebKit
1722           even in cases where those applications don't use WebKit
1723
1724         * kjs/date_object.cpp: Changed constants that were derived by multiplying other constants
1725         to use immediate numbers instead. Apparently, double constant expressions of the type we
1726         had here are evaluated at load time.
1727
1728         * kjs/list.cpp: Can't use OwnArrayPtr in ListImp because of the global instances of
1729         ListImp, so go back to using a plain old pointer.
1730         (KJS::List::List): Set overflow to 0 when initializing ListImp.
1731         (KJS::List::release): Replace a clear call with a delete and explicit set to 0.
1732         (KJS::List::append): Use raw pointers, and do a delete [] instead of finessing it with
1733         a swap of OwnArrayPtr.
1734         (KJS::List::copyFrom): Remove now-unneeded get().
1735         (KJS::List::copyTail): Ditto.
1736
1737         * kjs/ustring.cpp: Changed UString::Rep::empty initializer a bit so that it doesn't get
1738         a static initializer routine. Had to get rid of one level of constant to get the compiler
1739         to understand it could initialize without any code.
1740
1741         - added a build step that checks for init routines
1742
1743         * JavaScriptCore.xcodeproj/project.pbxproj: Deleted now-unused custom build rule that
1744         was replaced by the generate-derived-sources script a while back. Added a custom build
1745         phase that invokes the check-for-global-initializers script.
1746
1747 2006-03-28  Timothy Hatcher  <timothy@apple.com>
1748
1749         Reviewed by Eric.
1750
1751         fixes <rdar://problem/4458539> Unable to include Security(public) and WebKit(private) headers
1752
1753         * bindings/npapi.h: added #defines after the #ifndefs
1754
1755 2006-03-27  Maciej Stachowiak  <mjs@apple.com>
1756
1757         Reviewed by Anders.
1758         
1759         - fixed <rdar://problem/4489745> REGRESSION: Safari crashes at to display http://www.lgphilips-lcd.com/
1760
1761         * kjs/nodes.cpp:
1762         (Node::deref): take into account the case where the extra refcount table was never created
1763
1764 2006-03-23  David Carson <dacarson@gmail.com>
1765
1766         Reviewed by Darin.
1767         
1768         - JSObject in LiveConnect not working.
1769         http://bugzilla.opendarwin.org/show_bug.cgi?id=7917
1770
1771         * bindings/jni_jsobject.cpp:
1772         (JavaJSObject::convertJObjectToValue): Was trying to retrieve the native pointer from the wrong base
1773         class, and the GetFieldID was using the wrong signature.
1774
1775 2006-03-23  Darin Adler  <darin@apple.com>
1776
1777         Reviewed by Maciej.
1778
1779         - fix buildbot
1780
1781         * JavaScriptCore.xcodeproj/project.pbxproj: Change target name to JavaScriptCore (it was "include"!?).
1782         Also add -Y 3 option for linker.
1783
1784 2006-03-23  Darin Adler  <darin@apple.com>
1785
1786         Reviewed by Maciej.
1787
1788         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7726
1789           REGRESSION: orbitz calendar fails (JavaScript function serialization/parsing)
1790
1791         * kjs/object.h: Take function name, as well as source URL and line number, when
1792         using the special overloaded construct for making functions.
1793         * kjs/object.cpp: (KJS::JSObject::construct): Ditto.
1794         * kjs/function_object.h: Ditto.
1795         * kjs/function_object.cpp: (FunctionObjectImp::construct): Pass a name when
1796         constructing the function rather than null. Use "anonymous" when making a
1797         function using the default function constructor.
1798
1799         * kjs/nodes2string.cpp: (FuncDeclNode::streamTo): Put a line break just before
1800         a function declaration.
1801
1802         - unrelated fix
1803
1804         * kxmlcore/HashMapPtrSpec.h: Add missing needed friend declaration.
1805
1806 2006-03-23  Darin Adler  <darin@apple.com>
1807
1808         Reviewed by Maciej.
1809
1810         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7805
1811           LEAK: method name leaks in KJS::Bindings::CInstance::invokeMethod
1812
1813         * bindings/c/c_utility.h: Remove NPN_UTF16FromString declaration (not implemented).
1814         * bindings/c/c_utility.cpp:
1815         (KJS::Bindings::convertValueToNPVariant): Use DOUBLE_TO_NPVARIANT,
1816         BOOLEAN_TO_NPVARIANT, VOID_TO_NPVARIANT, NULL_TO_NPVARIANT, and
1817         OBJECT_TO_NPVARIANT. In the case of OBJECT, call _NPN_RetainObject in
1818         one case and remove a _NPN_ReleaseObject in another because this
1819         should return a retained value.
1820         (KJS::Bindings::convertNPVariantToValue): Use NPVARIANT_TO_BOOLEAN,
1821         NPVARIANT_TO_INT32, and NPVARIANT_TO_DOUBLE.
1822
1823         * bindings/c/c_runtime.h: Removed implementations of CMethod::name and
1824         CField::name that called _NPN_UTF8FromIdentifier and hence leaked.
1825         * bindings/c/c_runtime.cpp:
1826         (KJS::Bindings::CMethod::name): Added. Returns the string from inside the
1827         method object.
1828         (KJS::Bindings::CField::name): Added. Returns the string from inside the
1829         field object.
1830         (KJS::Bindings::CField::valueFromInstance): Added call to _NPN_ReleaseVariantValue
1831         on the result of getProperty after using it to fix a storage leak.
1832         (KJS::Bindings::CField::setValueToInstance): Added call to _NPN_ReleaseVariantValue
1833         after pasing a value to setProperty now that the conversion function does a retain.
1834
1835         * bindings/c/c_instance.cpp:
1836         (KJS::Bindings::CInstance::invokeMethod): Changed to use Vector for a local
1837         stack buffer. Removed special case for NPVARIANT_IS_VOID because the
1838         convertNPVariantToValue function handles that properly.
1839         (KJS::Bindings::CInstance::invokeDefaultMethod): Ditto.
1840
1841         * bindings/NP_jsobject.h: Formatting changes only.
1842         * bindings/NP_jsobject.cpp:
1843         (jsDeallocate): Changed parameter type so we don't need a function cast.
1844         (_NPN_InvokeDefault): Use VOID_TO_NPVARIANT.
1845         (_NPN_Invoke): Use NULL_TO_NPVARIANT and VOID_TO_NPVARIANT.
1846         (_NPN_Evaluate): Use VOID_TO_NPVARIANT.
1847         (_NPN_GetProperty): Use NULL_TO_NPVARIANT and VOID_TO_NPVARIANT.
1848
1849         * bindings/c/c_class.cpp: Formatting changes only.
1850         * bindings/c/c_class.h: Formatting changes only.
1851
1852         * bindings/npruntime_priv.h: Removed obsolete and now-unused functions:
1853         NPN_VariantIsVoid, NPN_VariantIsNull, NPN_VariantIsUndefined,
1854         NPN_VariantIsBool, NPN_VariantIsInt32, NPN_VariantIsDouble,
1855         NPN_VariantIsString, NPN_VariantIsObject, NPN_VariantToBool,
1856         NPN_VariantToInt32, NPN_VariantToDouble, NPN_VariantToString,
1857         NPN_VariantToStringCopy, NPN_VariantToObject, NPN_InitializeVariantAsVoid,
1858         NPN_InitializeVariantAsNull, NPN_InitializeVariantAsUndefined,
1859         NPN_InitializeVariantWithBool, NPN_InitializeVariantWithInt32,
1860         NPN_InitializeVariantWithDouble, NPN_InitializeVariantWithString,
1861         NPN_InitializeVariantWithObject, and NPN_InitializeVariantWithVariant.
1862         * bindings/npruntime.cpp:
1863         (getIntIdentifierDictionary): Don't bother creating custom callbacks for the
1864         integer dictionary since the default behavior is fine for integers.
1865
1866 2006-03-23  Mark Rowe  <opendarwin.org@bdash.net.nz>
1867
1868         Reviewed and landed by Maciej.
1869
1870         - WebKit no longer builds with bison 2.1
1871         http://bugzilla.opendarwin.org/show_bug.cgi?id=7923
1872
1873         * generate-derived-sources:  Handle generated header named either grammar.cpp.h
1874         or grammar.hpp.
1875
1876 2006-03-22  Maciej Stachowiak  <mjs@apple.com>
1877
1878         - fix the build
1879
1880         * JavaScriptCore.xcodeproj/project.pbxproj:
1881
1882 2006-03-21  Maciej Stachowiak  <mjs@apple.com>
1883
1884         * kjs/generate-derived-sources: Set executable property.
1885
1886 2006-03-21  Maciej Stachowiak  <mjs@apple.com>
1887
1888         Reviewed by Darin.
1889         
1890         Ensure that generated source dependencies are handled properly, as follows:
1891         
1892         - Made an external script that generates the sources into a
1893           DerivedSources dir in the build products directory.
1894         - Added a new build target that builds all the generated sources
1895           if needed. Sadly it has to be a target, not a phase for Xcode to notice changes.
1896         - Added the DerivedSources dir in question to the include path.
1897         - Added the new DerivedSources dir and its contents to the project as build-relative.
1898         
1899         * JavaScriptCore.xcodeproj/project.pbxproj:
1900         * kjs/generate-derived-sources: Added. Based on the windows version - maybe someday they
1901         can share more.
1902
1903 2006-03-11  Maciej Stachowiak  <mjs@apple.com>
1904
1905         Reviewed by Darin.
1906         
1907         - fixed "charAt layout test fails on intel macs; some NaNs are printed as -NaN"
1908         http://bugzilla.opendarwin.org/show_bug.cgi?id=7745
1909
1910         * kjs/ustring.cpp:
1911         (KJS::UString::from): Use "NaN" for all NaN values, regardless of sign.
1912
1913 2006-03-16  Maciej Stachowiak  <mjs@apple.com>
1914
1915         Reviewed by Darin.
1916         
1917         - tweaks to my change to redo KJS::Node refcounting
1918
1919         * kjs/nodes.cpp:
1920         (Node::ref):
1921         (Node::deref):
1922         (Node::refcount):
1923         (Node::clearNewNodes):
1924         * kjs/nodes.h:
1925
1926 2006-03-16  Darin Adler  <darin@apple.com>
1927
1928         Reviewed by Maciej.
1929
1930         - fixed Vector so that you can pass a reference to something in the vector
1931           to the append or insert functions
1932
1933         * kxmlcore/Vector.h:
1934         (KXMLCore::Vector::expandCapacity): Added new overloads that take a pointer to adjust
1935         and return the adjusted value of the pointer.
1936         (KXMLCore::Vector::append): Pass a pointer when expanding the vector, and use it when
1937         adding the new element. Makes the case where the element moves when the vector
1938         is expanded work.
1939         (KXMLCore::Vector::insert): Ditto.
1940
1941 2006-03-15  Eric Seidel  <eseidel@apple.com>
1942
1943         Reviewed by adele.
1944
1945         Build fix.
1946
1947         * kjs/date_object.cpp:
1948         (KJS::DateProtoFunc::callAsFunction): use size() not "len()"
1949
1950 2006-03-15  Eric Seidel  <eseidel@apple.com>
1951
1952         Reviewed by mjs.
1953
1954         Fix CString copy constructor, fixes Date.parse("") on Win32.
1955
1956         * kjs/date_object.cpp:
1957         (KJS::DateProtoFunc::callAsFunction):
1958         * kjs/ustring.cpp:
1959         (KJS::CString::CString):
1960         (KJS::CString::operator=):
1961
1962 2006-03-13  Maciej Stachowiak  <mjs@apple.com>
1963
1964         Reviewed by Anders.
1965         
1966         - KJS::Node and KJS::StatementNode are bigger than they need to be
1967         http://bugzilla.opendarwin.org/show_bug.cgi?id=7775
1968
1969         The memory usage of Node was reduced by 2 machine words per node:
1970
1971         - sourceURL was removed and only kept on FunctionBodyNode. The
1972         source URL can only be distinct per function or top-level program node, 
1973         and you always have one.
1974         
1975         - refcount was removed and kept in a separate hashtable when
1976         greater than 1. newNodes set represents floating nodes with
1977         refcount of 0. This helps because almost all nodes have a refcount of 1
1978         for almost all of their lifetime.
1979         
1980         * bindings/runtime_method.cpp:
1981         (RuntimeMethod::RuntimeMethod): Pass null body, added FIXME.
1982         * kjs/Parser.cpp:
1983         (KJS::clearNewNodes): New nodes are tracked in nodes.cpp now, but still clear
1984         them at the appropriate time.
1985         * kjs/context.h:
1986         (KJS::ContextImp::currentBody): added; used to retrieve source URL and sid
1987         for current code.
1988         (KJS::ContextImp::pushIteration): moved here from LabelStack
1989         (KJS::ContextImp::popIteration): ditto
1990         (KJS::ContextImp::inIteration): ditto
1991         (KJS::ContextImp::pushSwitch): ditto
1992         (KJS::ContextImp::popSwitch): ditto
1993         (KJS::ContextImp::inSwitch): ditto
1994         * kjs/function.cpp:
1995         (KJS::FunctionImp::FunctionImp): Add FunctionBodyNode* parameter.
1996         (KJS::FunctionImp::callAsFunction): Pass body to ContextImp.
1997         (KJS::FunctionImp::argumentsGetter): _context renamed to m_context.
1998         (KJS::DeclaredFunctionImp::DeclaredFunctionImp): Pass body to superclass
1999         constructor.
2000         (KJS::GlobalFuncImp::callAsFunction): Pass progNode as body for ContextImp in
2001         eval.
2002         * kjs/function.h: Move body field from DeclaredFunctionImp to
2003         FunctionImp.
2004         * kjs/grammar.y: Change DBG; statements no longer have a sourceid.
2005         * kjs/internal.cpp:
2006         (KJS::ContextImp::ContextImp): Initialize new m_currentBody, m_iterationDepth
2007         and m_switchDepth data members. New FunctionBodyNode* parameter - the
2008         function body provides source URL and SourceId.
2009         (KJS::InterpreterImp::mark): Use exception() function, not _exception directly.
2010         (KJS::InterpreterImp::evaluate): Pass progNode to ContextImp constructor
2011         to use as the body.
2012         * kjs/internal.h:
2013         (KJS::LabelStack::LabelStack): Remove iteration depth and switch depth;
2014         statement label stacks don't need these and it bloats their size. Put them
2015         in the ContextImp instead.
2016         * kjs/interpreter.cpp:
2017         (KJS::ExecState::lexicalInterpreter): Renamed _context to m_context.
2018         * kjs/interpreter.h:
2019         (KJS::ExecState::dynamicInterpreter): Renamed _context to m_context.
2020         (KJS::ExecState::context): ditto
2021         (KJS::ExecState::setException): Renamed _exception to m_exception
2022         (KJS::ExecState::clearException): ditto
2023         (KJS::ExecState::exception): ditto
2024         (KJS::ExecState::hadException): ditto
2025         (KJS::ExecState::ExecState): ditto both above renames
2026         * kjs/nodes.cpp:
2027         (Node::Node): Removed initialization of line, source URL and refcount. Add to
2028         local newNodes set instead of involving parser.
2029         (Node::ref): Instead of managing refcount directly, story refcount over 1 in a
2030         HashCountedSet, and keep a separate HashSet of "floating" nodes with refcount
2031         0.
2032         (Node::deref): ditto
2033         (Node::refcount): ditto
2034         (Node::clearNewNodes): Destroy anything left in the new nodes set.
2035         (currentSourceId): Inline helper to get sourceId from function body via context.
2036         (currentSourceURL): ditto for sourceURL.
2037         (Node::createErrorCompletion): use new helper
2038         (Node::throwError): ditto
2039         (Node::setExceptionDetailsIfNeeded): ditto
2040         (StatementNode::StatementNode): remove initialization of l0 and sid, rename
2041         l1 to m_lastLine.
2042         (StatementNode::setLoc): Set own m_lastLine and Node's m_line.
2043         (StatementNode::hitStatement): Get sid, first line, last line in the proper new ways.
2044         (StatListNode::StatListNode): updated for setLoc changes
2045         (BlockNode::BlockNode): ditto
2046         (DoWhileNode::execute): excpect iteraton counts on ContextImp, not LabelStack
2047         (WhileNode::execute): ditto
2048         (ForNode::execute): ditto
2049         (ForInNode::execute): ditto
2050         (ContinueNode::execute): excpect inIteration on ContextImp, not LabelStack
2051         (BreakNode::execute): excpect inIteration and inSwitch on ContextImp, not LabelStack
2052         (SwitchNode::execute): expect switch counts on ContextImp, not LabelStack
2053         (FunctionBodyNode::FunctionBodyNode): update for new setLoc
2054         (FunctionBodyNode::processFuncDecl): reindent
2055         (SourceElementsNode::SourceElementsNode): update for new setLoc
2056         * kjs/nodes.h:
2057         (KJS::Node::lineNo): Renamed _line to m_line
2058         (KJS::StatementNode::firstLine): Use lineNo()
2059         (KJS::StatementNode::lastLine): Renamed l1 to m_lastLine
2060         (KJS::FunctionBodyNode::sourceId): added
2061         (KJS::FunctionBodyNode::sourceURL): added
2062         * kjs/testkjs.cpp:
2063
2064 2006-03-14  Geoffrey Garen  <ggaren@apple.com>
2065
2066         - Fixed <rdar://problem/4478239> string sort puts "closed" before 
2067         "close"
2068
2069         Reviewed by Eric.
2070
2071         * kjs/ustring.cpp:
2072         (KJS::compare): Inverted a < in order to treat the longer string as > 
2073         the shorter string.
2074
2075 2006-03-12  Alexey Proskuryakov  <ap@nypop.com>
2076
2077         Reviewed by Maciej.
2078
2079         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7708
2080         REGRESSION: Flash callback to JavaScript function not working.
2081
2082         Test: plugins/invoke.html
2083
2084         * bindings/c/c_utility.cpp:
2085         (KJS::Bindings::convertUTF8ToUTF16): Return a correct string length.
2086
2087 2006-03-08  Eric Seidel  <eseidel@apple.com>
2088
2089         Reviewed by darin.
2090
2091         Partially fix JS on win32 by fixing hash table generation.
2092
2093         * kjs/create_hash_table: limit << results to 32 bits.
2094         * kjs/testkjs.cpp:
2095         (TestFunctionImp::callAsFunction):
2096
2097 2006-03-07  Darin Adler  <darin@apple.com>
2098
2099         * kxmlcore/Vector.h: Quick fix to try to get Windows compiling again.
2100
2101 2006-03-07  Darin Adler  <darin@apple.com>
2102
2103         Reviewed by Anders.
2104
2105         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7655
2106           unwanted output while running layout tests
2107
2108         * kjs/lexer.cpp: (Lexer::lex): Turn off the "yylex: ERROR" message.
2109         * kjs/regexp.cpp: (KJS::RegExp::RegExp): Remove the code to log errors from PCRE
2110         to standard output. I think we should arrange for the error text to be in JavaScript
2111         exceptions instead at some point.
2112         * kxmlcore/Vector.h: Add a check for overflow so that we'll abort if we pass a
2113         too-large size rather than allocating a buffer smaller than requested.
2114
2115 2006-03-06  David Carson <dacarson@gmail.com>
2116
2117         Reviewed by Darin, landed by ap.
2118
2119         - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=7582
2120         c_utility.cpp contains CFString OS X platform-dependent code; should use ICU
2121
2122         Tested with test case from:
2123         http://bugzilla.opendarwin.org/show_bug.cgi?id=5163
2124
2125         * bindings/c_utility.cpp
2126         (convertUTF8ToUTF16): Changed to using Unicode converter from ICU, and manual Latin-1 conversion.
2127         * icu/unicode/ucnv.h: Copied from WebCore.
2128         * icu/unicode/ucnv_err.h: Ditto.
2129         * icu/unicode/uenum.h: Ditto.
2130
2131 2006-03-05  Darin Adler  <darin@apple.com>
2132
2133         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Updated.
2134
2135 2006-03-06  Mitz Pettel  <opendarwin.org@mitzpettel.com>
2136
2137         Fix suggested by Alexey Proskuryakov <ap@nypop.com>, reviewed by Maciej and Hyatt.
2138         
2139         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7601
2140           REGRESSION (r13089): Reproducible crash dereferencing a deallocated element on google image search
2141
2142         * kxmlcore/Platform.h: Corrected the define to enable USE(MULTIPLE_THREADS) on Mac OS X.
2143
2144 2006-03-05  Darin Adler  <darin@apple.com>
2145
2146         Reviewed by Maciej.
2147
2148         - http://bugzilla.opendarwin.org/show_bug.cgi?id=7616
2149           get all references to KJS::Node out of internal.h
2150
2151         * JavaScriptCore.xcodeproj/project.pbxproj: Updated for file changes.
2152
2153         * kjs/Parser.cpp: Added.
2154         * kjs/Parser.h: Added.
2155
2156         * kjs/internal.cpp: Removed the Parser class.
2157         * kjs/internal.h: Ditto. Also removed unnecessary declarations of classes
2158         not used in this header.
2159
2160         * kjs/nodes.h: Added an include of "Parser.h".
2161         * kjs/function.h: Added a declaration of FunctionBodyNode.
2162
2163 2006-03-05  Geoffrey Garen  <ggaren@apple.com>
2164
2165         Reviewed by Maciej.
2166
2167         - JSC support for the fix for <rdar://problem/4467143> JavaScript 
2168         enumeration of HTML element properties skips DOM node properties
2169
2170         * kjs/lookup.h: 
2171         (1) Added the KJS_DEFINE_PROTOTYPE_WITH_PROTOTYPE macro. The 
2172         class definiton macro needs to know about the prototype's prototype so 
2173         that the class constructor properly sets it. 
2174         (2) Removed the KJS_IMPLEMENT_PROTOTYPE_WITH_PARENT macro. The class
2175         implementation macro does not need to know about the prototype's
2176         prototype, since getOwnPropertySlot should only look in the current 
2177         object's property map, and not its prototype's.
2178
2179 2006-03-05  Andrew Wellington  <proton@wiretapped.net>
2180
2181         Reviewed by Eric, landed by ap.
2182         
2183         - Remove unused breakpoint bool from StatementNodes. No test provided as
2184         there is no functionality change.
2185
2186         * kjs/nodes.cpp:
2187         (StatementNode::StatementNode):
2188         * kjs/nodes.h:
2189
2190 2006-03-03  Geoffrey Garen  <ggaren@apple.com>
2191
2192         Reviewed by Darin.
2193
2194         - Fixed <rdar://problem/4465598> REGRESSION (TOT): Crash occurs at 
2195         http://maps.google.com/?output=html ( KJS::Identifier::add(KJS::UString::Rep*)
2196
2197         This regression was caused by my fix for 4448098. I failed to account for the
2198         deleted entry sentinel in the mehtod that saves the contents of a property map to 
2199         the back/forward cache.
2200
2201         Manual test in WebCore/manual-tests/property-map-save-crash.html
2202
2203         * kjs/property_map.cpp:
2204         (KJS::deletedSentinel): Use 1 instead of -1 to facilitate an easy bit mask
2205         (KJS::isValid): New function: checks if a key is null or the deleted sentinel
2206         (KJS::PropertyMap::~PropertyMap): Fixed up the branch logic here for readability
2207         and a slight performance win
2208         (KJS::PropertyMap::clear):
2209         (KJS::PropertyMap::rehash):
2210         (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList):
2211         (KJS::PropertyMap::save): Check keys with isValid()
2212
2213 2006-03-02  Maciej Stachowiak  <mjs@apple.com>
2214
2215         - now fix mac build again
2216
2217         * kjs/identifier.cpp:
2218
2219 2006-03-02  Maciej Stachowiak  <mjs@apple.com>
2220
2221         Rubber stamped by Anders and Eric.
2222
2223         - add fpconst.cpp to win32 build, it is now needed
2224
2225         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2226         * kjs/fpconst.cpp:
2227
2228 2006-03-02  Maciej Stachowiak  <mjs@apple.com>
2229
2230         Reviewed by Eric.
2231
2232         - fix windows build, broken by my last patch
2233
2234         * kjs/JSImmediate.cpp:
2235         * kjs/identifier.cpp:
2236         * kxmlcore/FastMalloc.cpp:
2237         * kxmlcore/Platform.h:
2238
2239 2006-03-01  Maciej Stachowiak  <mjs@apple.com>
2240
2241         Reviewed by Darin.
2242         
2243         - Set up new prototype macros and avoid using #if without defined() in JSC
2244         
2245         Added new PLATFORM macros and related, to make sure #if's all check if relevant macros
2246         are defined, and to separate core OS-level dependencies from operating environment
2247         dependencies so you can, e.g., build KDE on Mac or Windows.
2248
2249         * kxmlcore/Platform.h: Added.
2250
2251         - deploy them everywhere in JavaScriptCore
2252         
2253         * JavaScriptCore.xcodeproj/project.pbxproj:
2254         * bindings/jni/jni_utility.cpp:
2255         (KJS::Bindings::convertValueToJValue):
2256         * bindings/objc/WebScriptObject.mm:
2257         * bindings/objc/objc_instance.mm:
2258         (ObjcInstance::end):
2259         * bindings/softlinking.h:
2260         * bindings/testbindings.mm:
2261         (main):
2262         * kjs/JSLock.cpp:
2263         * kjs/collector.cpp:
2264         (KJS::Collector::markCurrentThreadConservatively):
2265         (KJS::Collector::markOtherThreadConservatively):
2266         (KJS::Collector::markStackObjectsConservatively):
2267         * kjs/config.h:
2268         * kjs/date_object.cpp:
2269         (gmtoffset):
2270         (KJS::formatTime):
2271         (KJS::DateProtoFunc::callAsFunction):
2272         (KJS::DateObjectImp::construct):
2273         (KJS::makeTime):
2274         * kjs/dtoa.cpp:
2275         * kjs/fpconst.cpp:
2276         (KJS::sizeof):
2277         (KJS::):
2278         * kjs/grammar.y:
2279         * kjs/identifier.cpp:
2280         * kjs/internal.cpp:
2281         * kjs/interpreter.cpp:
2282         (KJS::Interpreter::evaluate):
2283         (KJS::Interpreter::createLanguageInstanceForValue):
2284         * kjs/interpreter.h:
2285         * kjs/lookup.cpp:
2286         * kjs/lookup.h:
2287         * kjs/math_object.cpp:
2288         * kjs/object.cpp:
2289         * kjs/object.h:
2290         * kjs/operations.cpp:
2291         (KJS::isNaN):
2292         (KJS::isInf):
2293         (KJS::isPosInf):
2294         (KJS::isNegInf):
2295         * kjs/operations.h:
2296         * kjs/regexp.cpp:
2297         (KJS::RegExp::RegExp):
2298         (KJS::RegExp::~RegExp):
2299         (KJS::RegExp::match):
2300         * kjs/regexp.h:
2301         * kjs/testkjs.cpp:
2302         (StopWatch::start):
2303         (StopWatch::stop):
2304         (StopWatch::getElapsedMS):
2305         * kjs/ustring.cpp:
2306         * kjs/ustring.h:
2307         * kxmlcore/AlwaysInline.h:
2308         * kxmlcore/Assertions.cpp:
2309         * kxmlcore/Assertions.h:
2310         * kxmlcore/FastMalloc.cpp:
2311         (KXMLCore::):
2312         * kxmlcore/FastMalloc.h:
2313         * kxmlcore/FastMallocInternal.h:
2314         * kxmlcore/HashTable.h:
2315         * kxmlcore/TCPageMap.h:
2316         * kxmlcore/TCSpinLock.h:
2317         (TCMalloc_SpinLock::Lock):
2318         (TCMalloc_SpinLock::Unlock):
2319         (TCMalloc_SlowLock):
2320         * kxmlcore/TCSystemAlloc.cpp:
2321         (TCMalloc_SystemAlloc):
2322         * os-win32/stdint.h:
2323
2324 2006-02-28  Geoffrey Garen  <ggaren@apple.com>
2325
2326         Reviewed by Darin.
2327
2328         - Fixed <rdar://problem/4448098> Switch PropertyMap deleted entry 
2329         placeholder to -1 from UString::Rep::null
2330
2331         This turned out to be only a small speedup (.12%). That's within the 
2332         margin of error for super accurate JS iBench, but Shark confirms the 
2333         same, so I think it's worth landing.
2334
2335         FYI, I also confirmed that the single entry optimization in 
2336         PropertyMap is a 3.2% speedup.
2337
2338         * kjs/property_map.cpp:
2339         (KJS::PropertyMap::~PropertyMap):
2340         (KJS::PropertyMap::clear):
2341         (KJS::PropertyMap::put):
2342         (KJS::PropertyMap::insert):
2343         (KJS::PropertyMap::rehash):
2344         (KJS::PropertyMap::remove):
2345         (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList):
2346         (KJS::PropertyMap::checkConsistency):
2347         * kjs/property_map.h:
2348         (KJS::PropertyMap::deletedSentinel):
2349
2350 2006-02-27  Eric Seidel  <eseidel@apple.com>
2351
2352         Rubber-stamped by darin.
2353
2354         Remove fpconst.cpp, unused on win32 and the cause of linker warnings.
2355
2356         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2357
2358 2006-02-27  Eric Seidel  <eseidel@apple.com>
2359
2360         Reviewed by mjs.
2361
2362         Fix Assertions.cpp to compile on win32.
2363
2364         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2365         * kxmlcore/Assertions.cpp:
2366
2367 2006-02-27  Eric Seidel  <eseidel@apple.com>
2368
2369         Reviewed by mjs.
2370
2371         Made Assertions.cpp platform independent.
2372         Moved mac-specific logging logic up into WebCore.
2373         http://bugzilla.opendarwin.org/show_bug.cgi?id=7503
2374
2375         * JavaScriptCore.xcodeproj/project.pbxproj:
2376         * kxmlcore/Assertions.cpp: Added.
2377         * kxmlcore/Assertions.h:
2378         * kxmlcore/Assertions.mm: Removed.
2379
2380 2006-02-27  Darin Adler  <darin@apple.com>
2381
2382         - fixed Mac Debug build, there was an unused parameter
2383
2384         * kxmlcore/FastMalloc.cpp: (KXMLCore::fastMallocRegisterThread):
2385         Remove parameter name.
2386
2387         * kjs/debugger.h: Fixed comment.
2388
2389 2006-02-27  Eric Seidel  <eseidel@apple.com>
2390
2391         Reviewed by darin.
2392
2393         * kxmlcore/Vector.h:
2394         (KXMLCore::deleteAllValues): fix unused variable warning
2395
2396 2006-02-21  Maciej Stachowiak  <mjs@apple.com>
2397
2398         Reviewed by Darin.
2399         
2400         - Turn off -Wno-unused-param for JavaScriptCore and get rid of unused params
2401         http://bugzilla.opendarwin.org/show_bug.cgi?id=7384
2402
2403         * JavaScriptCore.xcodeproj/project.pbxproj:
2404         * bindings/NP_jsobject.cpp:
2405         (jsAllocate):
2406         (_NPN_InvokeDefault):
2407         (_NPN_Evaluate):
2408         (_NPN_GetProperty):
2409         (_NPN_SetProperty):
2410         (_NPN_RemoveProperty):
2411         (_NPN_HasProperty):
2412         (_NPN_HasMethod):
2413         * bindings/c/c_class.h:
2414         (KJS::Bindings::CClass::constructorAt):
2415         * bindings/c/c_utility.cpp:
2416         (KJS::Bindings::convertNPVariantToValue):
2417         * bindings/jni/jni_class.cpp:
2418         (JavaClass::methodsNamed):
2419         (JavaClass::fieldNamed):
2420         * bindings/jni/jni_instance.cpp:
2421         (JavaInstance::invokeDefaultMethod):
2422         * bindings/jni/jni_jsobject.cpp:
2423         * bindings/jni/jni_objc.mm:
2424         (-[NSObject KJS::Bindings::]):
2425         * bindings/objc/WebScriptObject.mm:
2426         (+[WebUndefined allocWithZone:]):
2427         (-[WebUndefined initWithCoder:]):
2428         (-[WebUndefined encodeWithCoder:]):
2429         (-[WebUndefined copyWithZone:]):
2430         * bindings/objc/objc_class.h:
2431         (KJS::Bindings::ObjcClass::constructorAt):
2432         * bindings/objc/objc_class.mm:
2433         (KJS::Bindings::ObjcClass::methodsNamed):
2434         (KJS::Bindings::ObjcClass::fallbackObject):
2435         * bindings/objc/objc_instance.mm:
2436         (ObjcInstance::getValueOfUndefinedField):
2437         * bindings/objc/objc_runtime.mm:
2438         (ObjcFallbackObjectImp::getOwnPropertySlot):
2439         (ObjcFallbackObjectImp::put):
2440         (ObjcFallbackObjectImp::canPut):
2441         (ObjcFallbackObjectImp::deleteProperty):
2442         (ObjcFallbackObjectImp::toBoolean):
2443         * bindings/runtime.cpp:
2444         (KJS::Bindings::Instance::createLanguageInstanceForValue):
2445         * bindings/runtime.h:
2446         (KJS::Bindings::Instance::getValueOfUndefinedField):
2447         (KJS::Bindings::Instance::setValueOfUndefinedField):
2448         * bindings/runtime_array.cpp:
2449         (RuntimeArray::lengthGetter):
2450         (RuntimeArray::indexGetter):
2451         (RuntimeArray::put):
2452         (RuntimeArray::deleteProperty):
2453         * bindings/runtime_method.cpp:
2454         (RuntimeMethod::lengthGetter):
2455         (RuntimeMethod::execute):
2456         * bindings/runtime_object.cpp:
2457         (RuntimeObjectImp::fallbackObjectGetter):
2458         (RuntimeObjectImp::fieldGetter):
2459         (RuntimeObjectImp::methodGetter):
2460         (RuntimeObjectImp::put):
2461         (RuntimeObjectImp::canPut):
2462         (RuntimeObjectImp::deleteProperty):
2463         (RuntimeObjectImp::defaultValue):
2464         (RuntimeObjectImp::callAsFunction):
2465         * bindings/runtime_root.cpp:
2466         (performJavaScriptAccess):
2467         * kjs/array_object.cpp:
2468         (ArrayInstance::lengthGetter):
2469         (ArrayInstance::getOwnPropertySlot):
2470         (ArrayPrototype::ArrayPrototype):
2471         (ArrayPrototype::getOwnPropertySlot):
2472         * kjs/bool_object.cpp:
2473         (BooleanObjectImp::BooleanObjectImp):
2474         * kjs/date_object.cpp:
2475         (KJS::DateObjectFuncImp::DateObjectFuncImp):
2476         (KJS::DateObjectFuncImp::callAsFunction):
2477         * kjs/error_object.cpp:
2478         (ErrorObjectImp::ErrorObjectImp):
2479         (NativeErrorPrototype::NativeErrorPrototype):
2480         (NativeErrorImp::NativeErrorImp):
2481         * kjs/function.cpp:
2482         (KJS::FunctionImp::argumentsGetter):
2483         (KJS::FunctionImp::lengthGetter):
2484         (KJS::Arguments::mappedIndexGetter):
2485         (KJS::ActivationImp::argumentsGetter):
2486         (KJS::ActivationImp::put):
2487         * kjs/function_object.cpp:
2488         (FunctionObjectImp::FunctionObjectImp):
2489         * kjs/internal.cpp:
2490         (KJS::GetterSetterImp::toPrimitive):
2491         (KJS::GetterSetterImp::toBoolean):
2492         * kjs/interpreter.cpp:
2493         (KJS::Interpreter::evaluate):
2494         * kjs/interpreter.h:
2495         (KJS::Interpreter::isGlobalObject):
2496         (KJS::Interpreter::interpreterForGlobalObject):
2497         (KJS::Interpreter::isSafeScript):
2498         * kjs/lexer.cpp:
2499         (Lexer::makeIdentifier):
2500         (Lexer::makeUString):
2501         * kjs/lookup.h:
2502         (KJS::staticFunctionGetter):
2503         (KJS::staticValueGetter):
2504         * kjs/nodes.cpp:
2505         (StatementNode::processFuncDecl):
2506         (PropertyNode::evaluate):
2507         (PropertyNameNode::evaluate):
2508         * kjs/number_object.cpp:
2509         (NumberObjectImp::NumberObjectImp):
2510         (NumberObjectImp::getOwnPropertySlot):
2511         * kjs/object.cpp:
2512         (KJS::JSObject::defineGetter):
2513         (KJS::JSObject::defineSetter):
2514         (KJS::JSObject::hasInstance):
2515         (KJS::JSObject::propertyIsEnumerable):
2516         * kjs/object_object.cpp:
2517         (ObjectObjectImp::ObjectObjectImp):
2518         * kjs/property_slot.cpp:
2519         (KJS::PropertySlot::undefinedGetter):
2520         (KJS::PropertySlot::functionGetter):
2521         * kjs/reference.cpp:
2522         (KJS::Reference::getPropertyName):
2523         * kjs/reference_list.cpp:
2524         (ReferenceListIterator::operator++):
2525         * kjs/regexp_object.cpp:
2526         (RegExpObjectImp::RegExpObjectImp):
2527         (RegExpObjectImp::getValueProperty):
2528         (RegExpObjectImp::putValueProperty):
2529         * kjs/string_object.cpp:
2530         (StringInstance::lengthGetter):
2531         (StringInstance::indexGetter):
2532         (StringPrototype::StringPrototype):
2533         * kxmlcore/Assertions.mm:
2534         * kxmlcore/FastMalloc.cpp:
2535         (KXMLCore::TCMalloc_PageHeap::CheckList):
2536         * kxmlcore/HashTable.h:
2537         (KXMLCore::HashTableConstIterator::checkValidity):
2538         (KXMLCore::IdentityHashTranslator::translate):
2539         * pcre/pcre_get.c:
2540         (pcre_get_stringnumber):
2541
2542 2006-02-23  Darin Adler  <darin@apple.com>
2543
2544         - try to fix buildbot failure
2545
2546         * bindings/c/c_utility.cpp: Touch this file, which seems to not have been
2547         recompiled after additional inlining was introduced (Xcode bug?).
2548
2549 2006-02-23  Geoffrey Garen  <ggaren@apple.com>
2550
2551         Reviewed by Darin, Maciej.
2552
2553         - Inline some functions suggested by Shark. 2.9% speedup on super
2554         accurate JS iBench.
2555
2556         http://bugzilla.opendarwin.org/show_bug.cgi?id=7411
2557         <rdar://problem/4448116>
2558
2559         * kjs/nodes.h:
2560         (KJS::ArgumentsNode::evaluateList):
2561         * kjs/object.cpp:
2562         * kjs/object.h:
2563         (KJS::ScopeChain::release):
2564         (KJS::JSObject::toPrimitive):
2565         * kjs/scope_chain.cpp:
2566         * kjs/ustring.cpp:
2567         * kjs/ustring.h:
2568         (KJS::UString::toArrayIndex):
2569         * kjs/value.cpp:
2570         * kjs/value.h:
2571         (KJS::JSValue::toObject):
2572         * kxmlcore/FastMalloc.cpp:
2573         (KXMLCore::TCMalloc_ThreadCache_FreeList::Push):
2574         (KXMLCore::TCMalloc_ThreadCache_FreeList::Pop):
2575
2576 2006-02-21  Eric Seidel  <eseidel@apple.com>
2577
2578         Added *.user to ignore list.
2579
2580 2006-02-21  Eric Seidel  <eseidel@apple.com>
2581
2582         Reviewed by ggaren.
2583
2584         Add grammarWrapper.cpp to work around visual studio bug plaguing buildbot.
2585
2586         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2587         * JavaScriptCore.vcproj/JavaScriptCore/grammarWrapper.cpp: Added.
2588
2589 2006-02-21  Eric Seidel  <eseidel@apple.com>
2590
2591         Reviewed by ggaren.
2592
2593         * kjs/testkjs.cpp: #if out timeval code on win32
2594
2595 2006-02-21  Michael Emmel  <mike.emmel@gmail.com>
2596
2597         Reviewed by Darin.
2598
2599         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7397
2600           TCPageMap.h would not compile for me because string.h was missing
2601
2602         * kxmlcore/TCPageMap.h: Added <string.h> include.
2603
2604 2006-02-21  Darin Adler  <darin@apple.com>
2605
2606         Reviewed by John Sullivan.
2607
2608         - http://bugzilla.opendarwin.org/show_bug.cgi?id=7404
2609           remove a bunch of extra implementsCall overrides
2610
2611         * JavaScriptCore.xcodeproj/project.pbxproj: Sorted files.
2612
2613         * kjs/internal.h: Made InternalFunctionImp::callAsFunction pure virtual so that
2614         we'll get a compile error if some derived class neglects to implement it.
2615
2616         * kjs/function.cpp: (KJS::FunctionImp::FunctionImp): Remove unneeded initialization
2617         of param, which is an OwnPtr so it gets initialized by default.
2618
2619         * bindings/runtime_method.cpp:
2620         * bindings/runtime_method.h:
2621         * kjs/array_object.cpp:
2622         * kjs/array_object.h:
2623         * kjs/bool_object.cpp:
2624         * kjs/bool_object.h:
2625         * kjs/date_object.cpp:
2626         * kjs/date_object.h:
2627         * kjs/error_object.cpp:
2628         * kjs/error_object.h:
2629         * kjs/function.cpp:
2630         * kjs/function.h:
2631         * kjs/function_object.cpp:
2632         * kjs/function_object.h:
2633         * kjs/math_object.cpp:
2634         * kjs/math_object.h:
2635         * kjs/number_object.cpp:
2636         * kjs/number_object.h:
2637         * kjs/object_object.cpp:
2638         * kjs/object_object.h:
2639         * kjs/regexp_object.cpp:
2640         * kjs/regexp_object.h:
2641         * kjs/string_object.cpp:
2642         * kjs/string_object.h:
2643         Removed many rendundant implementations of implementsCall from subclasses of
2644         InternalFunctionImp.
2645
2646 2006-02-21  Darin Adler  <darin@apple.com>
2647
2648         - fixed build
2649
2650         * kjs/internal.cpp: (KJS::InternalFunctionImp::implementsCall):
2651         Oops, fixed name.
2652
2653 2006-02-21  Darin Adler  <darin@apple.com>
2654
2655         Change suggested by Mitz.
2656
2657         - http://bugzilla.opendarwin.org/show_bug.cgi?id=7402
2658           REGRESSION: Methods do not execute
2659
2660         * kjs/internal.h: Add implementsHasCall to InternalFunctionImp.
2661         * kjs/internal.cpp: (KJS::InternalFunctionImp::implementsHasCall):
2662         Return true. All the classes derived from InternalFunctionImp need
2663         to return true from this -- later we can remove all the extra
2664         implementations too.
2665
2666 2006-02-21  Maciej Stachowiak  <mjs@apple.com>
2667
2668         - fix build breakage caused by last-minute change to my patch
2669
2670         * kjs/lookup.h:
2671
2672 2006-02-20  Maciej Stachowiak  <mjs@apple.com>
2673
2674         Reviewed by Geoff and Darin.
2675         
2676         Patch from Maks Orlovich, based on work by David Faure, hand-applied and 
2677         significantly reworked by me.
2678         
2679         - Patch: give internal function names (KJS merge)
2680         http://bugzilla.opendarwin.org/show_bug.cgi?id=6279
2681
2682         * tests/mozilla/expected.html: Updated for newly fixed test.
2683
2684         * kjs/array_object.cpp:
2685         (ArrayProtoFunc::ArrayProtoFunc):
2686         * kjs/array_object.h:
2687         * kjs/bool_object.cpp:
2688         (BooleanPrototype::BooleanPrototype):
2689         (BooleanProtoFunc::BooleanProtoFunc):
2690         * kjs/bool_object.h:
2691         * kjs/date_object.cpp:
2692         (KJS::DateProtoFunc::DateProtoFunc):
2693         (KJS::DateObjectImp::DateObjectImp):
2694         (KJS::DateObjectFuncImp::DateObjectFuncImp):
2695         * kjs/error_object.cpp:
2696         (ErrorPrototype::ErrorPrototype):
2697         (ErrorProtoFunc::ErrorProtoFunc):
2698         * kjs/error_object.h:
2699         * kjs/function.cpp:
2700         (KJS::FunctionImp::FunctionImp):
2701         (KJS::GlobalFuncImp::GlobalFuncImp):
2702         * kjs/function.h:
2703         * kjs/function_object.cpp:
2704         (FunctionPrototype::FunctionPrototype):
2705         (FunctionProtoFunc::FunctionProtoFunc):
2706         (FunctionProtoFunc::callAsFunction):
2707         * kjs/function_object.h:
2708         * kjs/internal.cpp:
2709         (KJS::InterpreterImp::initGlobalObject):
2710         (KJS::InternalFunctionImp::InternalFunctionImp):
2711         * kjs/internal.h:
2712         (KJS::InternalFunctionImp::functionName):
2713         * kjs/lookup.h:
2714         (KJS::staticFunctionGetter):
2715         (KJS::HashEntryFunction::HashEntryFunction):
2716         (KJS::HashEntryFunction::implementsCall):
2717         (KJS::HashEntryFunction::toBoolean):
2718         (KJS::HashEntryFunction::implementsHasInstance):
2719         (KJS::HashEntryFunction::hasInstance):
2720         * kjs/math_object.cpp:
2721         (MathFuncImp::MathFuncImp):
2722         * kjs/math_object.h:
2723         * kjs/number_object.cpp:
2724         (NumberPrototype::NumberPrototype):
2725         (NumberProtoFunc::NumberProtoFunc):
2726         * kjs/number_object.h:
2727         * kjs/object.cpp:
2728         (KJS::JSObject::putDirectFunction):
2729         (KJS::Error::create):
2730         * kjs/object.h:
2731         * kjs/object_object.cpp:
2732         (ObjectPrototype::ObjectPrototype):
2733         (ObjectProtoFunc::ObjectProtoFunc):
2734         * kjs/object_object.h:
2735         * kjs/regexp_object.cpp:
2736         (RegExpPrototype::RegExpPrototype):
2737         (RegExpProtoFunc::RegExpProtoFunc):
2738         * kjs/regexp_object.h:
2739         * kjs/string_object.cpp:
2740         (StringProtoFunc::StringProtoFunc):
2741         (StringObjectImp::StringObjectImp):
2742         (StringObjectFuncImp::StringObjectFuncImp):
2743         * kjs/string_object.h:
2744         
2745 2006-02-20  Geoffrey Garen  <ggaren@apple.com>
2746
2747         Reviewed by Darin, with help from Eric, Maciej.
2748
2749         - More changes to support super-accurate JS iBench. Doesn't work on 
2750         Windows. (Doesn't break Windows, either.) I've filed [http://bugzilla.
2751         opendarwin.org/show_bug.cgi?id= 7399] about that. 
2752
2753         * kjs/interpreter.cpp:
2754         (KJS::Interpreter::evaluate): Print line numbers with exception output
2755         * kjs/testkjs.cpp: Changed " *" to "* " because Eric says that's the 
2756         way we roll with .cpp files.
2757         (StopWatch::StopWatch): New class. Provides microsecond-accurate 
2758         timings.
2759         (StopWatch::~StopWatch):
2760         (StopWatch::start):
2761         (StopWatch::stop):
2762         (StopWatch::getElapsedMS):
2763         (TestFunctionImp::callAsFunction): Added missing return statement. 
2764         Fixed up "run" to use refactored helper functions. Removed bogus 
2765         return statement from "quit" case. Made "print" output to stdout 
2766         instead of stderr because that makes more sense, and PERL handles 
2767         stdout better.
2768         (main): Factored out KXMLCore unit tests. Removed custom exception 
2769         printing code because the interpreter prints exceptions for you. Added 
2770         a "delete" call for the GlobalImp we allocate.
2771         (testIsInteger): New function, result of refacotring.
2772         (createStringWithContentsOfFile): New function, result of refactoring. 
2773         Renamed "code" to "buffer" to match factored-out-ness.
2774
2775 2006-02-20  Eric Seidel  <eseidel@apple.com>
2776
2777         Reviewed by hyatt.
2778
2779         Fix "Copy ICU DLLs..." phase.
2780
2781         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2782         * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
2783
2784 2006-02-19  Darin Adler  <darin@apple.com>
2785
2786         - renamed ERROR to LOG_ERROR to fix build
2787           presumably Maciej had this change and forgot to land it
2788
2789         * kjs/collector.cpp: Removed now-unneeded #undef ERROR.
2790         * kxmlcore/Assertions.h: Renamed ERROR to LOG_ERROR.
2791         * kxmlcore/FastMalloc.cpp: Changed MESSAGE macro to use LOG_ERROR.
2792
2793 2006-02-18  Mitz Pettel  <opendarwin.org@mitzpettel.com>
2794
2795         Test: fast/js/toString-exception.html
2796
2797         Reviewed by Maciej.
2798
2799         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7343
2800           REGRESSION: fast/js/toString-overrides.html fails when run multiple times
2801
2802         * kjs/array_object.cpp:
2803         (ArrayProtoFunc::callAsFunction): Remove the object from the visited elements set before
2804         returning an error.
2805
2806 2006-02-18  Darin Adler  <darin@apple.com>
2807
2808         Reviewed by Maciej.
2809
2810         - http://bugzilla.opendarwin.org/show_bug.cgi?id=7345
2811           add insert and remove to KXMLCore::Vector
2812
2813         * kxmlcore/Vector.h: Added "moveOverlapping", which is used in both
2814         insert and remove to slide elements within the vector. Also added
2815         "insert" and "remove" functions.
2816
2817 2006-02-16  Geoffrey Garen  <ggaren@apple.com>
2818
2819         Reviewed by John.
2820
2821         - Fixed <rdar://problem/4448534> TOT REGRESSION: crash in KJS::
2822         Bindings::Instance::deref when leaving page @ gigaom.com
2823
2824         * bindings/c/c_instance.cpp:
2825         (KJS::Bindings::CInstance::~CInstance): Since we cache the class object
2826         globally, we shouldn't delete it, so don't.
2827
2828 2006-02-16  Timothy Hatcher  <timothy@apple.com>
2829
2830         Added -Wno-deprecated-declarations to all the ObjC binding files to prevent deprecation
2831         warnings. Using <rdar://problem/4448350> to track this.
2832
2833         * JavaScriptCore.xcodeproj/project.pbxproj:
2834         * bindings/objc/objc_jsobject.h: Removed empty file.
2835         * bindings/objc/objc_jsobject.mm: Removed empty file.
2836
2837 2006-02-16  Tim Omernick  <timo@apple.com>
2838
2839         Reviewed by Geoff.
2840
2841         <rdar://problem/4428609> Flash Player 8.0.22 can crash Safari (and WebKit apps) with
2842         javascript disabled (7015)
2843
2844         * bindings/NP_jsobject.cpp:
2845         (_NPN_CreateNoScriptObject):
2846         Returns an NPObject which is not bound to a JavaScript object.  This kind of NPObject
2847         can be given to a plugin as the "window script object" when JavaScript is disabled.
2848         The object has a custom NPClass, NPNoScriptObjectClass, which has no defined methods.
2849         Because of this, none of the NPN_* functions called by the plugin on this "no script
2850         object" will cause entry into JavaScript code.
2851         (_NPN_InvokeDefault):
2852         Make sure the NPVariant is filled before returning from this function.  This never
2853         mattered before because we never reached this case, having only created NPObjects of
2854         the class NPScriptObjectClass.
2855         (_NPN_Invoke):
2856         ditto
2857         (_NPN_Evaluate):
2858         ditto
2859         (_NPN_GetProperty):
2860         ditto
2861
2862         * bindings/NP_jsobject.h:
2863         Declared _NPN_CreateNoScriptObject().
2864
2865 2006-02-16  Darin Adler  <darin@apple.com>
2866
2867         Reviewed by me, change by Peter Kuemmel.
2868
2869         * kjs/operations.cpp: (KJS::isNegInf): Fix Windows code, which was
2870         checking for positive infinity (rolling in fix from KDE side).
2871
2872 2006-02-15  Geoffrey Garen  <ggaren@apple.com>
2873
2874         Reviewed by Maciej, Eric.
2875
2876         - JavaScriptCore half of fix for <rdar://problem/4176077> CrashTracer: 6569
2877         crashes in DashboardClient at com.apple.JavaScriptCore:
2878         KJS::Bindings::ObjcFallbackObjectImp::type()
2879
2880         WebCore and JavaScriptCore weren't sharing Instance objects very
2881         nicely. I made them use RefPtrs, and sent them to bed without dessert.
2882
2883         * bindings/jni/jni_instance.cpp: Made _instance a RefPtr
2884         (JavaInstance::~JavaInstance):
2885         (JObjectWrapper::JObjectWrapper):
2886         * bindings/jni/jni_instance.h:
2887         (KJS::Bindings::JObjectWrapper::ref):
2888         (KJS::Bindings::JObjectWrapper::deref):
2889         * bindings/jni/jni_runtime.cpp: Made _array a RefPtr
2890         (JavaArray::~JavaArray):
2891         (JavaArray::JavaArray):
2892         * bindings/jni/jni_runtime.h:
2893         (KJS::Bindings::JavaArray::operator=):
2894         * bindings/objc/objc_runtime.h:
2895         - Prohibited copying because that would muss the ref count.
2896         - Prohibited construction without instance because an instance wrapper
2897         without an instance is almost certainly a bug.
2898         * bindings/objc/objc_runtime.mm:
2899         (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
2900         * bindings/runtime.cpp:
2901         (KJS::Bindings::Instance::Instance):
2902         (KJS::Bindings::Instance::createBindingForLanguageInstance):
2903         (KJS::Bindings::Instance::createRuntimeObject):
2904         * bindings/runtime.h:
2905         (KJS::Bindings::Instance::ref):
2906         (KJS::Bindings::Instance::deref):
2907         * bindings/runtime_object.cpp:
2908         (RuntimeObjectImp::RuntimeObjectImp):
2909         (RuntimeObjectImp::fallbackObjectGetter):
2910         (RuntimeObjectImp::fieldGetter):
2911         (RuntimeObjectImp::methodGetter):
2912         (RuntimeObjectImp::getOwnPropertySlot):
2913         (RuntimeObjectImp::put):
2914         (RuntimeObjectImp::canPut):
2915         * bindings/runtime_object.h: 
2916         - Removed ownsInstance data member because RefPtr takes care of 
2917         instance lifetime now. 
2918         - Prohibited copying because that would muss the ref count.
2919         - Prohibited construction without instance because an instance wrapper
2920         without an instance is almost certainly a bug.
2921         (KJS::RuntimeObjectImp::getInternalInstance):
2922
2923 2006-02-15  Geoffrey Garen  <ggaren@apple.com>
2924
2925         Reviewed by John.
2926
2927         - Applied the 4330457 change to CClass and ObjcClass as well.
2928
2929         Once plugins work in DumpRenderTree, running run-webkit-tests --leaks
2930         will catch this. 
2931
2932         This change isn't as critical because CClass and ObjcClass objects get 
2933         cached globally and never deleted, but it's good practice, in case we 
2934         ever do decide to delete CClass and ObjcClass objects.
2935
2936         This change requires prohibiting copying, because we don't do any 
2937         intelligent ref-counting -- when a Class is destroyed, it destroys its 
2938         methods and fields unconditionally. (Java classes already prohibited
2939         copying.)
2940
2941         * bindings/c/c_class.cpp:
2942         - Merged _commonInit and _commonDelete into constructor and destructor.
2943         (CClass::CClass):
2944         (CClass::~CClass):
2945         (CClass::methodsNamed): Added delete callbacks
2946         (CClass::fieldNamed): Added delete callbacks
2947         * bindings/c/c_class.h: Prohibited copying
2948         * bindings/c/c_instance.cpp: 
2949         (KJS::Bindings::CInstance::getClass): Changed to use the preferred 
2950         class factory method, to take advantage of the global cache.
2951
2952         [ Repeated changes applied to CClass for ObjcClass: ]
2953
2954         * bindings/objc/objc_class.h: 
2955         * bindings/objc/objc_class.mm:
2956         (KJS::Bindings::ObjcClass::ObjcClass):
2957         (KJS::Bindings::ObjcClass::~ObjcClass):
2958         (KJS::Bindings::ObjcClass::methodsNamed):
2959         (KJS::Bindings::ObjcClass::fieldNamed):
2960         * bindings/objc/objc_runtime.h:
2961         (KJS::Bindings::ObjcMethod::ObjcMethod): Initialized uninitialized
2962         variable to prevent bad CFRelease.
2963         (KJS::Bindings::ObjcMethod::~ObjcMethod): Removed erroneous ';' from
2964         if statement to prevent bad CFRelease.
2965         * bindings/objc/objc_runtime.cpp: Changed to use the preferred
2966         ObjectStructPtr, for clarity.
2967
2968 2006-02-14  Geoffrey Garen  <ggaren@apple.com>
2969
2970         Reviewed by John.
2971
2972         - Fixed <rdar://problem/4330457> CrashTracer: [REGRESSION] 3763 crashes
2973         in Safari at com.apple.JavaScriptCore: KJS::Bindings::JavaInstance::
2974         getClass const + 56
2975
2976         Once plugins work in DumpRenderTree, running run-webkit-tests --leaks
2977         will catch this. 
2978
2979         This was a memory leak in the bindings code. The leak was so extreme
2980         that it would cause Safari or the JVM to abort from lack of memory.
2981         Upon construction, Class objects create field and method objects, 
2982         storing them in CFDictionaries. The bug was that upon destruction, the 
2983         class objects released the dictionaries but didn't destroy the stored 
2984         objects.
2985
2986         The fix is to supply CFDictionary callbacks for destroying the values
2987         added to the dictionary. 
2988         
2989         * bindings/jni/jni_class.cpp: 
2990         (JavaClass::JavaClass): Added delete callbacks
2991         * bindings/runtime.cpp: Added definitions for delete callbacks
2992         (KJS::Bindings::deleteMethodList):
2993         (KJS::Bindings::deleteMethod):
2994         (KJS::Bindings::deleteField):
2995         * bindings/runtime.h: Added declarations for delete callbacks
2996
2997 2006-02-14  Timothy Hatcher  <timothy@apple.com>
2998
2999         Reviewed by Justin.
3000
3001         Fixed <rdar://problem/4415050> STD: WebCore build steps use echo -n, which will change
3002         behavior due to POSIX version of sh
3003
3004         * JavaScriptCore.xcodeproj/project.pbxproj: removed the use of echo -n, replaced with printf ""
3005
3006 2006-02-13   Dave Hyatt <hyatt@apple.com>
3007
3008         Fix Win32 bustage in JavaScriptCore.
3009
3010         Reviewed by darin
3011
3012         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3013         Add JSImmediate to the Win32 project.
3014
3015         * kjs/JSImmediate.h:
3016         (KJS::JSImmediate::fromDouble):
3017         (KJS::JSImmediate::toDouble):
3018         (KJS::JSImmediate::NanAsBits):
3019         (KJS::JSImmediate::oneAsBits):
3020         Win32 needs explicit returns after abort() for non-void functions.
3021
3022         * kjs/testkjs.cpp:
3023         (run):
3024         Win32 catches a bug in testkjs!  The "return 2" should actually
3025         have been a return false.
3026
3027         * kjs/value.h:
3028         The extern decls of NaN and Inf need to be const.
3029
3030 === JavaScriptCore-521.7 ===
3031
3032 2006-02-13  Timothy Hatcher  <timothy@apple.com>
3033
3034         Reviewed by Darin.
3035
3036         Replaced the old NS_DURING exception blocking with @try/@catch.
3037
3038         * JavaScriptCorePrefix.h: undef try and catch to workaround a C++ conflict
3039         * bindings/objc/objc_instance.mm:
3040         (ObjcInstance::invokeMethod):
3041         (ObjcInstance::invokeDefaultMethod):
3042         (ObjcInstance::setValueOfUndefinedField):
3043         (ObjcInstance::getValueOfUndefinedField):
3044         * bindings/objc/objc_runtime.mm:
3045         (ObjcField::valueFromInstance):
3046         (ObjcField::setValueToInstance):
3047         (ObjcArray::setValueAt):
3048         (ObjcArray::valueAt):
3049
3050 2006-02-13  Darin Adler  <darin@apple.com>
3051
3052         - fix a couple problems building on Windows, based on requests
3053           from Krzysztof Kowalczyk <kkowalczyk@gmail.com>
3054
3055         * kjs/JSImmediate.h: Change code using non-standard u_int32/64_t types
3056         to the standard uint32/64_t. Also removed curious "isIEEE()" function
3057         that checked the sizes of some types (and type sizes alone don't tell you if
3058         the floating point conforms to the IEEE-standard). Added missing include
3059         of <stdint.h>.
3060
3061         * kjs/property_slot.h: Added missing include of <assert.h>.
3062
3063 2006-02-12  Geoffrey Garen  <ggaren@apple.com>
3064
3065         Reviewed by darin.
3066
3067         Cleaned up testkjs, added new "run" functionality to allow scripting 
3068         tests from within JS. ("run" is a part of my new super-accurate
3069         JS iBench.)
3070
3071         No regressions in run-javascriptcore-tests.
3072
3073         * kjs/testkjs.cpp:
3074         (GlobalImp::className):
3075         (TestFunctionImp::):
3076         (TestFunctionImp::callAsFunction):
3077         (main):
3078         (run):
3079
3080 2006-02-11  Alexey Proskuryakov  <ap@nypop.com>
3081
3082         Reviewed by Darin.
3083
3084         - improve fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=5163
3085         RealPlayer.GetTitle() Crashes Safari/Dashboard
3086
3087         * bindings/c/c_utility.cpp: (KJS::Bindings::convertUTF8ToUTF16):
3088         Use kCFStringEncodingISOLatin1 rather than kCFStringEncodingWindowsLatin1, 
3089         because the latter encoding has holes, and conversion can still fail.
3090
3091 2006-02-10  Geoffrey Garen  <ggaren@apple.com>
3092
3093         Reviewed by Darin.
3094
3095         - Inlined RefPtr assignment operators. .7% performance win on 
3096         super-accurate JS iBench.
3097
3098         * kxmlcore/RefPtr.h:
3099         (KXMLCore::::operator):
3100
3101 2006-02-10  Geoffrey Garen  <ggaren@apple.com>
3102
3103         No review needed, just a build fix. This time for sure.
3104
3105         * kjs/JSType.h:
3106
3107 2006-02-10  Geoffrey Garen  <ggaren@apple.com>
3108
3109         Reviewed by eric.
3110         
3111         - Fixed build. As it goes without saying, I will not mention that I
3112         blame Kevin.
3113
3114         * JavaScriptCore.xcodeproj/project.pbxproj:
3115         * kjs/JSImmediate.cpp:
3116         (KJS::JSImmediate::toObject):
3117
3118 2006-02-09  Geoffrey Garen  <ggaren@apple.com>
3119
3120         Reviewed by mjs.
3121
3122         - Fixed <rdar://problem/4343730> Should switch ConstantValues (null, 
3123         undefined, true, false) from JS objects to immediate values similar to
3124         SimpleNumber
3125
3126         2.0% performance gain on my new super-accurate version of JS iBench.
3127         (I promise to land a version of it soon.)
3128
3129         The gist of the change:
3130         (1) The SimpleNumber class (simple_number.h) is now the JSImmediate
3131         class (JSImmediate.h/.cpp), and it handles not only numbers but also 
3132         null, undefined, true, and false. 
3133         (2) JSImmediate provides convenience methods for the bit masking
3134         necessary to encode and decode immediate values.
3135         (3) ConstantValues, BooleanImp, NullImp, and UndefinedImp are gone.
3136         (4) JSCell no longer implements functions like getBoolean, because
3137         only a JSImmediate can be a boolean.
3138         (5) JSImmediate no longer uses ALWAYS_INLINE because there's no need,
3139         and ALWAYS_INLINE is a non-portable option of last resort.
3140         (6) Type is now JSType, and it resides in its own file, JSType.h.
3141         Since I was there, I did some header include sorting as part of this
3142         change.
3143
3144         The rest pretty much explains itself.
3145
3146         * JavaScriptCore.xcodeproj/project.pbxproj: Removed simple_number.h,
3147         added JSImmediate.h/.cpp.
3148         * bindings/c/c_instance.cpp:
3149         (KJS::Bindings::CInstance::defaultValue):
3150         * bindings/c/c_instance.h:
3151         * bindings/c/c_utility.cpp:
3152         (KJS::Bindings::convertValueToNPVariant):
3153         * bindings/jni/jni_instance.cpp:
3154         (JavaInstance::defaultValue):
3155         * bindings/jni/jni_instance.h:
3156         * bindings/jni/jni_jsobject.cpp:
3157         (JavaJSObject::convertValueToJObject):
3158         * bindings/objc/WebScriptObject.mm:
3159         (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:]):
3160         Standardized calls to use getXXX instead of hand-rolling JSValue 
3161         functionality.
3162         * bindings/objc/objc_instance.h:
3163         * bindings/objc/objc_instance.mm:
3164         (ObjcInstance::getValueOfUndefinedField):
3165         (ObjcInstance::defaultValue):
3166         * bindings/objc/objc_runtime.h:
3167         * bindings/objc/objc_runtime.mm:
3168         (ObjcFallbackObjectImp::type):
3169         (ObjcFallbackObjectImp::defaultValue):
3170         * bindings/runtime.h:
3171         (KJS::Bindings::Instance::getValueOfUndefinedField):
3172         * bindings/runtime_object.cpp:
3173         (RuntimeObjectImp::defaultValue):
3174         * bindings/runtime_object.h:
3175         * kjs/JSImmediate.h: Added.
3176         (KJS::JSImmediate::isImmediate):
3177         (KJS::JSImmediate::isNumber):
3178         (KJS::JSImmediate::isBoolean):
3179         (KJS::JSImmediate::isUndefinedOrNull):
3180         (KJS::JSImmediate::fromDouble):
3181         (KJS::JSImmediate::toDouble):
3182         (KJS::JSImmediate::toBoolean):
3183         (KJS::JSImmediate::trueImmediate):
3184         (KJS::JSImmediate::falseImmediate):
3185         (KJS::JSImmediate::NaNImmediate):
3186         (KJS::JSImmediate::undefinedImmediate):
3187         (KJS::JSImmediate::nullImmediate):
3188         (KJS::JSImmediate::tag):
3189         (KJS::JSImmediate::unTag):
3190         (KJS::JSImmediate::getTag):
3191         (KJS::JSImmediate::):
3192         (KJS::JSImmediate::isIEEE):
3193         (KJS::JSImmediate::is32bit):
3194         (KJS::JSImmediate::is64bit):
3195         (KJS::JSImmediate::NanAsBits):
3196         (KJS::JSImmediate::zeroAsBits):
3197         (KJS::JSImmediate::oneAsBits):
3198         * kjs/JSLock.cpp:
3199         (KJS::JSLock::lock): Removed hack-o-rama to initialize ConstantValues.
3200         * kjs/JSType.h: Added.
3201         * kjs/collector.cpp:
3202         (KJS::Collector::protect):
3203         (KJS::Collector::unprotect):
3204         (KJS::Collector::collect):
3205         * kjs/internal.cpp:
3206         (KJS::StringImp::toPrimitive):
3207         (KJS::NumberImp::toPrimitive):
3208         (KJS::NumberImp::toBoolean):
3209         (KJS::GetterSetterImp::toPrimitive):
3210         * kjs/internal.h:
3211         (KJS::StringImp::type):
3212         (KJS::NumberImp::type):
3213         * kjs/object.cpp:
3214         (KJS::JSObject::type):
3215         (KJS::tryGetAndCallProperty): Replaced "Are you one of the six things
3216         I'm looking for?" test with "Are you not the one thing I'm not looking
3217         for" test.
3218         (KJS::JSObject::defaultValue):
3219         (KJS::JSObject::toPrimitive):
3220         * kjs/object.h:
3221         (KJS::GetterSetterImp::type):
3222         (KJS::JSValue::isObject):
3223         * kjs/operations.cpp:
3224         (KJS::equal):
3225         (KJS::strictEqual):
3226         (KJS::add):
3227         * kjs/reference.cpp:
3228         (KJS::Reference::deleteValue):
3229         * kjs/simple_number.h: Removed.
3230         * kjs/string_object.cpp:
3231         (StringInstance::getOwnPropertySlot): fixed indentation
3232         * kjs/value.cpp:
3233         (KJS::JSValue::toObject):
3234         (KJS::jsNumberCell): New function to quarantine a PIC branch -- allows
3235         us to inline jsNumber without adding PIC branches to callers.
3236         * kjs/value.h:
3237         (KJS::jsUndefined):
3238         (KJS::jsNull):
3239         (KJS::jsNaN):
3240         (KJS::jsBoolean):
3241         (KJS::jsNumber):
3242         (KJS::JSValue::downcast):
3243         (KJS::JSValue::isUndefinedOrNull):
3244         (KJS::JSValue::isBoolean):
3245         (KJS::JSValue::isNumber):
3246         (KJS::JSValue::isString):
3247         (KJS::JSValue::isObject):
3248         (KJS::JSValue::getBoolean):
3249         (KJS::JSValue::getNumber):
3250         (KJS::JSValue::getString):
3251         (KJS::JSValue::getObject):
3252         (KJS::JSValue::getUInt32):
3253         (KJS::JSValue::mark): Replaced !JSImmediate::is() test with assertion,
3254         resulting in a slight performance gain. Callers should always check
3255         !marked() before calling mark(), so it's impossible to call mark on
3256         a JSImmediate.
3257         (KJS::JSValue::marked):
3258         (KJS::JSValue::type):
3259         (KJS::JSValue::toPrimitive):
3260         (KJS::JSValue::toBoolean):
3261         (KJS::JSValue::toNumber):
3262         (KJS::JSValue::toString):
3263
3264 2006-02-06  Eric Seidel  <eseidel@apple.com>
3265
3266         Add svn:ignore properties for visual studio internals.
3267
3268 2006-02-06  Alexey Proskuryakov  <ap@nypop.com>
3269
3270         Reviewed by Darin.
3271
3272         - Refactor DateInstance to provide direct access to data. Several WIN32 modifications.
3273         http://bugzilla.opendarwin.org/show_bug.cgi?id=7107
3274
3275         - No tests added - only changed functionality on WIN32, which should be covered by 
3276         existing tests.
3277
3278         * kjs/date_object.cpp:
3279         (gmtoffset): On WIN32, use the recommended global (_timezone rather than timezone).
3280         Updated comments. 
3281         (KJS::timeZoneOffset): Removed, was basically the same as the above.
3282         (KJS::formatTime): Pass an UTC flag - UTC/local cannot be correctly selected on
3283         Windows based on struct tm itself.
3284         (KJS::DateInstance::getTime): Added.
3285         (KJS::DateInstance::getUTCTime): Added.
3286         (KJS::millisecondsToTM): Factored out from DateProtoFunc::callAsFunction().
3287         (KJS::DateObjectImp::callAsFunction): Use the new parameter to formatTime().
3288         (KJS::DateProtoFunc::callAsFunction): Updated for the other changes. The code for
3289         GetTimezoneOffset was incorrect on WIN32 - _daylight global has nothing to do
3290         with daylight savings time being in effect.
3291
3292         * kjs/date_object.h: Added prototypes for new functions.
3293
3294 2006-02-05  Maciej Stachowiak  <mjs@apple.com>
3295
3296         Reviewed by Anders.
3297         
3298         - fixed ~1100 KJS::Node leaked on layout tests
3299         http://bugzilla.opendarwin.org/show_bug.cgi?id=7097
3300
3301         * kjs/internal.cpp:
3302         (KJS::Parser::noteNodeCycle):
3303         (KJS::Parser::removeNodeCycle):
3304         (KJS::clearNewNodes):
3305         * kjs/internal.h:
3306         * kjs/nodes.cpp:
3307         (ElementNode::breakCycle):
3308         (PropertyListNode::breakCycle):
3309         (ArgumentListNode::breakCycle):
3310         (StatListNode::StatListNode):
3311         (StatListNode::breakCycle):
3312         (VarDeclListNode::breakCycle):
3313         (BlockNode::BlockNode):
3314         (ClauseListNode::breakCycle):
3315         (CaseBlockNode::CaseBlockNode):
3316         (ParameterNode::breakCycle):
3317         (SourceElementsNode::SourceElementsNode):
3318         (SourceElementsNode::breakCycle):
3319         * kjs/nodes.h:
3320         (KJS::Node::breakCycle):
3321         (KJS::ElementNode::ElementNode):
3322         (KJS::ArrayNode::ArrayNode):
3323         (KJS::PropertyListNode::PropertyListNode):
3324         (KJS::ObjectLiteralNode::ObjectLiteralNode):
3325         (KJS::ArgumentListNode::ArgumentListNode):
3326         (KJS::ArgumentsNode::ArgumentsNode):
3327         (KJS::VarDeclListNode::VarDeclListNode):
3328         (KJS::VarStatementNode::VarStatementNode):
3329         (KJS::ForNode::ForNode):
3330         (KJS::CaseClauseNode::CaseClauseNode):
3331         (KJS::ClauseListNode::ClauseListNode):
3332         (KJS::ParameterNode::ParameterNode):
3333         (KJS::FuncExprNode::FuncExprNode):
3334         (KJS::FuncDeclNode::FuncDeclNode):
3335
3336 2006-02-05  Maciej Stachowiak  <mjs@apple.com>
3337
3338         Reviewed by Hyatt.
3339         
3340         - fix default traits for classes to make sure default constructors get called
3341
3342         * kxmlcore/VectorTraits.h:
3343         (KXMLCore::):
3344
3345 2006-02-04  Darin Adler  <darin@apple.com>
3346
3347         Reviewed by Maciej.
3348
3349         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5210
3350           REGRESSION: for/in loop with var changes global variable instead of making local
3351
3352         Test: fast/js/for-in-var-scope.html
3353
3354         * kjs/nodes.cpp:
3355         (valueForReadModifyAssignment): Use ALWAYS_INLINE macro.
3356         (ForInNode::execute): Break out of the scope chain loop once we find and set the
3357         loop variable. We don't want to set multiple loop variables.
3358         (ForInNode::processVarDecls): Process the declaration of the loop variable.
3359
3360         - other cleanup
3361
3362         * kjs/object.cpp: (KJS::tryGetAndCallProperty): Use ALWAYS_INLINE macro.
3363         * kxmlcore/FastMalloc.cpp: Change to use ALWAYS_INLINE macro from AlwaysInline.h
3364         instead of defining it here a second time.
3365
3366 2006-02-04  Maciej Stachowiak  <mjs@apple.com>
3367
3368         Reviewed by Hyatt.
3369         
3370         - change JavaScript collector statistics calls to use HashCountedSet instead
3371         of CFSet; other misc cleanup
3372         http://bugzilla.opendarwin.org/show_bug.cgi?id=7072
3373         
3374         * kjs/collector.cpp:
3375         (KJS::Collector::numProtectedObjects): renamed from numReferencedObjects
3376         (KJS::typeName):
3377         (KJS::Collector::rootObjectTypeCounts): renamed from rootObjectClasses,
3378         use HashSet
3379         * kjs/collector.h:
3380         (KJS::Collector::isOutOfMemory): Renamed from outOfMemory.
3381         * kjs/nodes.cpp:
3382
3383 2006-02-03  Timothy Hatcher  <timothy@apple.com>
3384
3385         Reviewed by Justin.
3386
3387         Renamed configuration names to Debug, Release and Production.
3388
3389         * JavaScriptCore.xcodeproj/project.pbxproj:
3390
3391 2006-02-02  George Staikos <staikos@opensource.apple.com>
3392
3393         Reviewed by Maciej.
3394
3395         * kjs/lookup.h: Fix compile, merged from KDE.
3396
3397 2006-02-02  Darin Adler  <darin@apple.com>
3398
3399         Reviewed by Maciej.
3400
3401         - http://bugzilla.opendarwin.org/show_bug.cgi?id=7005
3402           add Noncopyable, OwnPtr, OwnArrayPtr to KXMLCore
3403
3404         * kxmlcore/Noncopyable.h: Added.
3405         * kxmlcore/OwnArrayPtr.h: Added.
3406         * kxmlcore/OwnPtr.h: Added.
3407
3408         * JavaScriptCore.xcodeproj/project.pbxproj: Added new files.
3409
3410         * kjs/function.h:
3411         * kjs/function.cpp: Use OwnPtr for Parameter pointers.
3412
3413         * kjs/internal.h: Use Noncopyable for LabelStack.
3414
3415         * kjs/list.cpp: Use OwnArrayPtr for overflow.
3416
3417         * kjs/property_map.h:
3418         * kjs/property_map.cpp: Use OwnArrayPtr for SavedProperties.
3419         Use Vector for some stack buffers.
3420
3421         * kjs/regexp_object.h:
3422         * kjs/regexp_object.cpp: Use OwnArrayPtr for lastOvector.
3423
3424 2006-01-31  Maciej Stachowiak  <mjs@apple.com>
3425
3426         Reviewed by Darin.
3427         
3428         - fixed leak of hundreds of thousands of JS parser nodes on the layout tests, and added an exit counter
3429         that would catch them
3430
3431         * kjs/nodes.cpp:
3432         (NodeCounter::~NodeCounter): Added debug-only node counter.
3433         (Node::Node):
3434         (Node::~Node):
3435         * kxmlcore/VectorTraits.h: Simple classes like RefPtr do in fact need destruction.
3436
3437 2006-01-31  Darin Adler  <darin@apple.com>
3438
3439         Reviewed by Maciej.
3440
3441         - added deleteAllValues for HashSet as well as HashMap
3442         - fixed conversion from const_iterator to iterator, which I broke a while back
3443
3444         * kxmlcore/HashMap.h: Updated copyright date.
3445         * kxmlcore/HashSet.h: (KXMLCore::deleteAllValues): Added.
3446         * kxmlcore/HashTable.h: (KXMLCore::HashTableIterator::operator const_iterator): Added.
3447
3448 2006-01-31  Tim Omernick  <timo@apple.com>
3449
3450         Reviewed by Geoff Garen.
3451
3452         * bindings/c/c_utility.cpp:
3453         (KJS::Bindings::convertUTF8ToUTF16):
3454         Fixed an invalid assertion that UTF8Chars is not NULL.  It is valid for it to be NULL as long as
3455         UTF8Length is 0.
3456         This fixes an assertion failure on TOT at <http://www.musicindiaonline.com/p/x/tJO0OOBME9.As1NMvHdW/>,
3457         where JavaScript is getting a NULL string back from some call on the Real Player plugin.
3458
3459 2006-01-30  Anders Carlsson  <andersca@mac.com>
3460
3461         Reviewed by Darin.
3462
3463         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6907
3464         REGRESSION: United.com menus messed up due to document.all/MSIE sniff
3465         
3466         * kjs/nodes.cpp:
3467         (typeStringForValue):
3468         Return "undefined" if the given object should masquerade as undefined.
3469         
3470         * kjs/object.h:
3471         (KJS::JSObject::masqueradeAsUndefined):
3472         Rename from isEqualToNull.
3473         
3474         * kjs/operations.cpp:
3475         (KJS::equal):
3476         Update for name change.
3477
3478 2006-01-29  Maciej Stachowiak  <mjs@apple.com>
3479
3480         Reviewed by Darin.
3481         
3482         - properly define Vector assignment operator; the private version was accidentally left
3483         in, and the template version is not enough to replace the default
3484
3485         * kxmlcore/Vector.h:
3486         (KXMLCore::Vector::operator=):
3487
3488 2006-01-29  Eric Seidel  <eseidel@apple.com>
3489
3490         Reviewed by darin.
3491
3492         Fix the build by applying a GCC-specific namespace hack.
3493
3494         * kjs/lookup.h:
3495
3496 2006-01-29  Eric Seidel <eseidel@apple.com>
3497
3498         Reviewed by hyatt.
3499
3500         Fix build on Win32.
3501
3502         * kjs/lookup.h: fixed ::cacheGlobalObject
3503         * kxmlcore/Vector.h:
3504         (KXMLCore::Vector::operator[]): use unsigned long
3505
3506 2006-01-29  Maciej Stachowiak  <mjs@apple.com>
3507
3508         Reviewed by Dave Hyatt.
3509
3510         * kxmlcore/Vector.h:
3511         (KXMLCore::Vector::operator[]): Add unsigned overload
3512
3513 2006-01-28  Darin Adler  <darin@apple.com>
3514
3515         Reviewed by John Sullivan.
3516
3517         - http://bugzilla.opendarwin.org/show_bug.cgi?id=6895
3518           include exception names in JavaScript form of DOM exception
3519
3520         * khtml/ecma/kjs_binding.cpp: (KJS::setDOMException): Include the name of the
3521         exception in the error message.
3522
3523 2006-01-28  Maciej Stachowiak  <mjs@apple.com>
3524
3525         Reviewed by Darin.
3526         
3527         - miscellaneous Vector improvements
3528
3529         * kxmlcore/Vector.h: