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