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