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