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