Rubber stamped by Mark Rowe.
[WebKit-https.git] / JavaScriptCore / ChangeLog
1 2007-12-08  Oliver Hunt  <oliver@apple.com>
2
3         Reviewed by Sam W.
4
5         Split the ENABLE_SVG_EXPERIMENTAL_FEATURES flag into separate flags.
6         
7         Fixes <rdar://problem/5620249> Must disable SVG animation
8         <rdar://problem/5612772> Disable SVG filters on Mac to match Windows behavior
9         
10         Minor config changes.
11
12         * Configurations/JavaScriptCore.xcconfig:
13         * JavaScriptCore.xcodeproj/project.pbxproj:
14
15 2007-12-07  Sam Weinig  <sam@webkit.org>
16
17         Reviewed by Darin.
18
19         - Rename isSafeScript to allowsAccessFrom.
20
21         * bindings/NP_jsobject.cpp:
22         (_isSafeScript):
23         * kjs/JSGlobalObject.h:
24         (KJS::JSGlobalObject::allowsAccessFrom): Reverse caller/argument of allowsAccessFrom to match
25         the new call.
26
27 2007-12-07  Geoffrey Garen  <ggaren@apple.com>
28
29         Reviewed by Sam Weinig.
30         
31         Refactored variable access optimization: Removed the assumption that
32         the FunctionBodyNode holds the symbol table.
33         
34 2007-12-07  Geoffrey Garen  <ggaren@apple.com>
35
36         Build fix: added #include.
37
38         * kjs/nodes.cpp:
39
40 2007-12-07  Geoffrey Garen  <ggaren@apple.com>
41
42         Build fix: added #include.
43
44         * kjs/interpreter.cpp:
45
46 2007-12-07  Geoffrey Garen  <ggaren@apple.com>
47
48         Build fix: added #include.
49
50         * kjs/grammar.y:
51
52 2007-12-07  Geoffrey Garen  <ggaren@apple.com>
53
54         Build fix: added #include.
55
56         * kjs/function_object.cpp:
57
58 2007-12-07  Geoffrey Garen  <ggaren@apple.com>
59
60         Reviewed by Sam Weinig.
61         
62         Fixed crash seen running layout tests.
63         
64         Reverted a change I made earlier today. Added a comment to try to
65         discourage myself from making this mistake a third time.
66
67         * kjs/function.cpp:
68         (KJS::ActivationImp::mark):
69         * kjs/function.h:
70         (KJS::ActivationImp::ActivationImpData::ActivationImpData):
71
72 2007-12-07  Geoffrey Garen  <ggaren@apple.com>
73
74         Reviewed by Sam Weinig.
75         
76         Refactored parsing of global code: Removed the assumption that 
77         ProgramNode inherits from FunctionBodyNode from the parser.
78
79         * kjs/Parser.cpp:
80         (KJS::Parser::parseProgram):
81         (KJS::Parser::parseFunctionBody):
82         (KJS::Parser::parse):
83         * kjs/Parser.h:
84         (KJS::Parser::didFinishParsing):
85         * kjs/function.cpp:
86         * kjs/grammar.y:
87         * kjs/nodes.h:
88
89 2007-12-07  Geoffrey Garen  <ggaren@apple.com>
90
91         Build fix: added JSVariableObject.cpp to the .pri file.
92
93         * JavaScriptCore.pri:
94
95 2007-12-07  Geoffrey Garen  <ggaren@apple.com>
96
97         Build fix: added #include.
98
99         * kjs/function.cpp:
100
101 2007-12-07  Steve Falkenburg  <sfalken@apple.com>
102
103         Re-named our B&I flag from BUILDBOT to PRODUCTION.
104
105         Reviewed by Sam Weinig.
106
107         * JavaScriptCore.vcproj/JavaScriptCore.make:
108         * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
109
110 2007-12-07  Geoffrey Garen  <ggaren@apple.com>
111
112         Build fix: removed stray name qualification.
113
114         * kjs/function.h:
115         (KJS::ActivationImp::ActivationImp):
116
117 2007-12-07  Geoffrey Garen  <ggaren@apple.com>
118
119         Build fix: moved functions with qualified names outside of class
120         declaration.
121
122         * kjs/JSVariableObject.h:
123         (KJS::JSVariableObject::symbolTableGet):
124         (KJS::JSVariableObject::symbolTablePut):
125
126 2007-12-07  Geoffrey Garen  <ggaren@apple.com>
127
128         Reviewed by Sam Weinig.
129
130         Next step in refactoring JSGlobalObject: Added JSVariableObject class,
131         and factored symbol-table-related code into it. (JSGlobalObject doesn't
132         use the symbol table code yet, though.)
133         
134         Layout and JS tests, and testapi, pass. SunSpider reports no regression.
135
136 2007-12-07  Darin Adler  <darin@apple.com>
137
138         Reviewed by Geoff.
139
140         - fix http://bugs.webkit.org/show_bug.cgi?id=16185
141           jsRegExpCompile should not add implicit non-capturing bracket
142
143         While this does not make SunSpider faster, it will make many regular
144         expressions a bit faster.
145
146         * pcre/pcre_compile.cpp: Moved CompileData struct in here from the
147         header since it's private to this file.
148         (compile_branch): Updated for function name change.
149         (compile_bracket): Renamed from compile_regex, since, for one thing,
150         this does not compile an entire regular expression.
151         (calculateCompiledPatternLengthAndFlags): Removed unused item_count
152         local variable. Renamed CompileData to cd instead of compile_block
153         to be consistent with other functions. Added code to set the
154         needOuterBracket flag if there's at least one "|" at the outer level.
155         (jsRegExpCompile): Renamed CompileData to cd instead of compile_block
156         to be consistent with other functions. Removed unneeded "size" field
157         from the compiled regular expression. If no outer bracket is needed,
158         then use compile_branch to compile the regular expression.
159
160         * pcre/pcre_internal.h: Removed the CompileData struct, which is now
161         private to pcre_compile.cpp. Removed the size member from JSRegExp.
162
163 2007-12-06  Kevin Ollivier  <kevino@theolliviers.com>
164
165         MSVC7 build fix due to a compiler bug with placement new and/or
166         templates and casting.
167
168         Reviewed by Darin Adler.
169
170         * wtf/Vector.h:
171         (WTF::::append):
172
173 2007-12-06  Darin Adler  <darin@apple.com>
174
175         Reviewed by Eric Seidel.
176
177         - fix http://bugs.webkit.org/show_bug.cgi?id=16321
178           new RegExp("[\u0097]{4,6}", "gmy") crashes in DEBUG builds
179           <rdar://problem/5632992>
180
181         Test: fast/js/regexp-oveflow.html
182
183         * pcre/pcre_compile.cpp:
184         (calculateCompiledPatternLengthAndFlags): In the case where a single character
185         character class is optimized to not use a character class at all, the preflight
186         code was not setting the lastitemlength variable.
187
188 2007-12-05  Mark Rowe  <mrowe@apple.com>
189
190         Qt Windows build fix.  Include the time-related headers in the correct place.
191
192         * kjs/JSGlobalObject.cpp:
193         * kjs/interpreter.cpp:
194
195 2007-12-05  Darin Adler  <darin@apple.com>
196
197         Not reviewed; just undoing a previous commit.
198
199         - remove earlier incorrect fix for http://bugs.webkit.org/show_bug.cgi?id=16220
200           <rdar://problem/5625221> Crash opening www.news.com (CNet)
201
202         The real bug was the backwards ?: in the compile function, which Geoff just
203         fixed. Rolling out the incorrect earlier fix.
204
205         * pcre/pcre_compile.cpp: (calculateCompiledPatternLengthAndFlags): Take out
206         the unneeded preflight change. The regression test proves this is still working
207         fine, so the bug remains fixed.
208
209 2007-12-01  Mark Rowe  <mrowe@apple.com>
210
211         Build fix.  Include headers before trying to use the things that they declare.
212
213         * kjs/JSImmediate.cpp:
214         * kjs/nodes.cpp:
215         * kjs/object.cpp:
216         * kjs/object_object.cpp:
217         * kjs/regexp_object.cpp:
218         * kjs/string_object.cpp:
219
220 2007-12-05  Geoffrey Garen  <ggaren@apple.com>
221
222         Build fix: added some #includes.
223
224         * kjs/JSImmediate.cpp:
225
226 2007-12-05  Geoffrey Garen  <ggaren@apple.com>
227
228         Build fix: added some #includes.
229
230         * kjs/JSGlobalObject.cpp:
231         * kjs/JSImmediate.cpp:
232
233 2007-12-05  Geoffrey Garen  <ggaren@apple.com>
234
235         Build fix: Fixed #include spelling.
236
237         * kjs/debugger.cpp:
238
239 2007-12-05  Geoffrey Garen  <ggaren@apple.com>
240
241         Build fix: added #include.
242
243         * kjs/debugger.cpp:
244
245 2007-12-05  Geoffrey Garen  <ggaren@apple.com>
246
247         Build fix: added a forward declaration.
248
249         * kjs/debugger.h:
250
251 2007-12-05  Geoffrey Garen  <ggaren@apple.com>
252
253         Build fix: added an #include.
254
255         * kjs/error_object.cpp:
256
257 2007-12-05  Geoffrey Garen  <ggaren@apple.com>
258
259         Build fix: added an #include.
260
261         * kjs/bool_object.cpp:
262
263 2007-12-05  Geoffrey Garen  <ggaren@apple.com>
264
265         Reviewed by Darin Adler.
266
267         Third step in refactoring JSGlobalObject: Moved data members and 
268         functions accessing data members from Interpreter to JSGlobalObject.
269         Changed Interpreter member functions to static functions.
270         
271         This resolves a bug in global object bootstrapping, where the global
272         ExecState could be used when uninitialized.
273         
274         This is a big change, but it's mostly code motion and renaming.
275         
276         Layout and JS tests, and testjsglue and testapi, pass. SunSpider reports
277         a .7% regression, but Shark sees no difference related to this patch,
278         and SunSpider reported a .7% speedup from an earlier step in this 
279         refactoring, so I think it's fair to call that a wash.
280
281 2007-12-05  Geoffrey Garen  <ggaren@apple.com>
282
283         Reviewed by Darin Adler. (Or vice versa.)
284         
285         Fixed ASSERT during run-javascriptcore-tests. (Darin just added the
286         ASSERT, but the bug wasn't new.)
287
288         * pcre/pcre_compile.cpp:
289         (compile_branch): The ?: operator here was backwards, causing us to
290         execute the loop too many times, adding stray KET opcodes to the
291         compiled regular expression.
292
293 2007-12-05  Kevin McCullough  <kmccullough@apple.com>
294
295         Reviewed by Geoff.
296
297         - Wait until local variable data is fully constructed before notifying the debugger of entering
298         or leaving a call frame.
299
300         * kjs/function.cpp:
301         (KJS::FunctionImp::callAsFunction):
302         * kjs/nodes.cpp:
303         (KJS::FunctionBodyNode::execute):
304
305 2007-12-05  Mark Rowe  <mrowe@apple.com>
306
307         Reviewed by Oliver.
308
309         Build fix for GCC 4.2. Cast via a union to avoid strict-aliasing issues.
310
311         * wtf/FastMalloc.cpp:
312         (WTF::):
313         (WTF::getPageHeap):
314
315 2007-12-05  Mark Rowe  <mrowe@apple.com>
316
317         Reviewed by Darin.
318
319         Fix testkjs in 64-bit.
320
321         When built for 64-bit the TCMalloc spin lock uses pthread mutexes rather than a custom spin lock
322         implemented in assembly.  If we fail to initialize the pthread mutex, attempts to lock or unlock
323         it will fail and trigger a call to abort.
324
325         * wtf/FastMalloc.cpp: Initialize the spin lock so that we can later lock and unlock it.
326         * wtf/TCSpinLock.h: Add an Init method to the optimised spin lock.
327
328 2007-12-04  Oliver Hunt  <oliver@apple.com>
329
330         Reviewed by NOBODY (Build fix).
331
332         Fix gtk build.
333
334         * wtf/TCSystemAlloc.cpp:
335
336 2007-12-03  Oliver Hunt  <oliver@apple.com>
337
338         Reviewed by Mark Rowe and Geoff Garen.
339
340         Merge TCMalloc r38
341
342         It also result in a performance progression between 0.5% and 
343         0.9% depending on the test, however most if not all of this 
344         gain will be consumed by the overhead involved in the later
345         change to release memory to the system.
346
347         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
348         * JavaScriptCore.xcodeproj/project.pbxproj:
349         * wtf/FastMalloc.cpp:
350         (WTF::KernelSupportsTLS):
351         (WTF::CheckIfKernelSupportsTLS):
352         (WTF::):
353         (WTF::ClassIndex):
354         (WTF::SLL_Next):
355         (WTF::SLL_SetNext):
356         (WTF::SLL_Push):
357         (WTF::SLL_Pop):
358         (WTF::SLL_PopRange):
359         (WTF::SLL_PushRange):
360         (WTF::SLL_Size):
361         (WTF::SizeClass):
362         (WTF::ByteSizeForClass):
363         (WTF::NumMoveSize):
364         (WTF::InitSizeClasses):
365         (WTF::AllocationSize):
366         (WTF::TCMalloc_PageHeap::GetSizeClassIfCached):
367         (WTF::TCMalloc_PageHeap::CacheSizeClass):
368         (WTF::TCMalloc_PageHeap::init):
369         (WTF::TCMalloc_PageHeap::New):
370         (WTF::TCMalloc_PageHeap::AllocLarge):
371         (WTF::TCMalloc_PageHeap::Carve):
372         (WTF::TCMalloc_PageHeap::Delete):
373         (WTF::TCMalloc_PageHeap::IncrementalScavenge):
374         (WTF::PagesToMB):
375         (WTF::TCMalloc_PageHeap::Dump):
376         (WTF::TCMalloc_PageHeap::GrowHeap):
377         (WTF::TCMalloc_PageHeap::Check):
378         (WTF::ReleaseFreeList):
379         (WTF::TCMalloc_PageHeap::ReleaseFreePages):
380         (WTF::TCMalloc_ThreadCache_FreeList::Push):
381         (WTF::TCMalloc_ThreadCache_FreeList::PushRange):
382         (WTF::TCMalloc_ThreadCache_FreeList::PopRange):
383         (WTF::TCMalloc_ThreadCache_FreeList::Pop):
384         (WTF::TCMalloc_Central_FreeList::length):
385         (WTF::TCMalloc_Central_FreeList::tc_length):
386         (WTF::TCMalloc_Central_FreeList::Init):
387         (WTF::TCMalloc_Central_FreeList::ReleaseListToSpans):
388         (WTF::TCMalloc_Central_FreeList::EvictRandomSizeClass):
389         (WTF::TCMalloc_Central_FreeList::MakeCacheSpace):
390         (WTF::TCMalloc_Central_FreeList::ShrinkCache):
391         (WTF::TCMalloc_Central_FreeList::InsertRange):
392         (WTF::TCMalloc_Central_FreeList::RemoveRange):
393         (WTF::TCMalloc_Central_FreeList::FetchFromSpansSafe):
394         (WTF::TCMalloc_Central_FreeList::Populate):
395         (WTF::TCMalloc_ThreadCache::Init):
396         (WTF::TCMalloc_ThreadCache::Cleanup):
397         (WTF::TCMalloc_ThreadCache::Allocate):
398         (WTF::TCMalloc_ThreadCache::Deallocate):
399         (WTF::TCMalloc_ThreadCache::FetchFromCentralCache):
400         (WTF::TCMalloc_ThreadCache::ReleaseToCentralCache):
401         (WTF::TCMalloc_ThreadCache::Scavenge):
402         (WTF::TCMalloc_ThreadCache::PickNextSample):
403         (WTF::TCMalloc_ThreadCache::NewHeap):
404         (WTF::TCMalloc_ThreadCache::GetThreadHeap):
405         (WTF::TCMalloc_ThreadCache::GetCache):
406         (WTF::TCMalloc_ThreadCache::GetCacheIfPresent):
407         (WTF::TCMalloc_ThreadCache::InitTSD):
408         (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
409         (WTF::TCMallocStats::ExtractStats):
410         (WTF::TCMallocStats::DumpStats):
411         (WTF::TCMallocStats::DumpStackTraces):
412         (WTF::TCMallocStats::TCMallocImplementation::MarkThreadIdle):
413         (WTF::TCMallocStats::TCMallocImplementation::ReleaseFreeMemory):
414         (WTF::TCMallocStats::TCMallocGuard::TCMallocGuard):
415         (WTF::TCMallocStats::TCMallocGuard::~TCMallocGuard):
416         (WTF::TCMallocStats::DoSampledAllocation):
417         (WTF::TCMallocStats::CheckCachedSizeClass):
418         (WTF::TCMallocStats::CheckedMallocResult):
419         (WTF::TCMallocStats::SpanToMallocResult):
420         (WTF::TCMallocStats::do_malloc):
421         (WTF::TCMallocStats::do_free):
422         (WTF::TCMallocStats::do_memalign):
423         (WTF::TCMallocStats::do_malloc_stats):
424         (WTF::TCMallocStats::do_mallopt):
425         (WTF::TCMallocStats::do_mallinfo):
426         (WTF::TCMallocStats::realloc):
427         (WTF::TCMallocStats::cpp_alloc):
428         (WTF::TCMallocStats::operator new):
429         (WTF::TCMallocStats::):
430         (WTF::TCMallocStats::operator new[]):
431         (WTF::TCMallocStats::malloc_stats):
432         (WTF::TCMallocStats::mallopt):
433         (WTF::TCMallocStats::mallinfo):
434         * wtf/TCPackedCache.h: Added.
435         (PackedCache::PackedCache):
436         (PackedCache::Put):
437         (PackedCache::Has):
438         (PackedCache::GetOrDefault):
439         (PackedCache::Clear):
440         (PackedCache::EntryToValue):
441         (PackedCache::EntryToUpper):
442         (PackedCache::KeyToUpper):
443         (PackedCache::UpperToPartialKey):
444         (PackedCache::Hash):
445         (PackedCache::KeyMatch):
446         * wtf/TCPageMap.h:
447         (TCMalloc_PageMap2::PreallocateMoreMemory):
448         * wtf/TCSystemAlloc.cpp:
449         (TCMalloc_SystemRelease):
450         * wtf/TCSystemAlloc.h:
451
452 2007-12-04  Anders Carlsson  <andersca@apple.com>
453
454         Reviewed by Sam.
455
456         Make isSafeScript const.
457         
458         * kjs/JSGlobalObject.h:
459         (KJS::JSGlobalObject::isSafeScript):
460
461 2007-12-04  Darin Adler  <darin@apple.com>
462
463         Reviewed by Geoff.
464
465         - fix first part of http://bugs.webkit.org/show_bug.cgi?id=16220
466           <rdar://problem/5625221> Crash opening www.news.com (CNet)
467
468         Test: fast/js/regexp-overflow.html
469
470         * pcre/pcre_compile.cpp:
471         (calculateCompiledPatternLengthAndFlags): Add room for the additional BRA/KET that
472         was generated in the compile code but not taken into account here.
473
474 2007-12-03  Darin Adler  <darin@apple.com>
475
476         Reviewed by Geoff.
477
478         - fix http://bugs.webkit.org/show_bug.cgi?id=15618
479           <rdar://problem/5619353> REGRESSION: Stack overflow/crash in KJS::equal (15618)
480
481         Test: fast/js/recursion-limit-equal.html
482
483         * kjs/operations.cpp: (KJS::equal): Check the exception from toPrimitive.
484
485 2007-12-03  Dan Bernstein  <mitz@apple.com>
486
487         - fix a copy-and-paste-o
488
489         * bindings/npruntime.cpp:
490         (_NPN_GetIntIdentifier):
491
492 2007-12-03  Dan Bernstein  <mitz@apple.com>
493
494         Reviewed by Darin Adler.
495
496         - fix an ASSERT when getIntIdentifier is called with 0 or -1
497
498         * bindings/npruntime.cpp:
499         (_NPN_GetIntIdentifier): We cannot use the hashmap for 0 and -1 since
500         they are the empty value and the deleted value. Instead, keep the
501         identifiers for those two integers in a static array.
502
503 2007-12-02  Darin Adler  <darin@apple.com>
504
505         Reviewed by Mitz.
506
507         - fix http://bugs.webkit.org/show_bug.cgi?id=15848
508           <rdar://problem/5619330> REGRESSION: Assertion failure viewing comments page on digg.com
509
510         Test: fast/js/sparse-array.html
511
512         * kjs/array_instance.cpp:
513         (KJS::ArrayInstance::inlineGetOwnPropertySlot): Check sparse array cutoff before looking
514         in hash map. Can't avoid the branch because we can't look for 0 in the hash.
515         (KJS::ArrayInstance::deleteProperty): Ditto.
516
517 2007-12-02  Geoffrey Garen  <ggaren@apple.com>
518
519         Build fix: added an #include.
520
521         * kjs/collector.cpp:
522
523 2007-12-02  Geoffrey Garen  <ggaren@apple.com>
524
525         Reviewed by Eric Seidel.
526
527         Second step in refactoring JSGlobalObject: moved virtual functions from
528         Interpreter to JSGlobalObject.
529         
530         Layout and JS tests pass. SunSpider reports a .7% speedup -- don't 
531         believe his lies.
532
533 2007-12-01  Alp Toker  <alp@atoker.com>
534
535         Reviewed by Adam Roben.
536
537         http://bugs.webkit.org/show_bug.cgi?id=16228
538         kJSClassDefinitionEmpty is not exported with JS_EXPORT
539
540         Add JS_EXPORT to kJSClassDefinitionEmpty.
541
542         Make the gcc compiler check take precedence over the WIN32||_WIN32
543         check to ensure that symbols are exported on Windows when using gcc.
544
545         Add a TODO referencing the bug about JS_EXPORT in the Win build
546         (http://bugs.webkit.org/show_bug.cgi?id=16227)
547
548         Don't define JS_EXPORT as 'extern' when the compiler is unknown since
549         it would result in the incorrect expansion:
550
551           extern extern const JSClassDefinition kJSClassDefinitionEmpty;
552
553         (This was something we inherited from CFBase.h that doesn't make sense
554         for JSBase.h)
555
556         * API/JSBase.h:
557         * API/JSObjectRef.h:
558
559 2007-11-30  Geoffrey Garen  <ggaren@apple.com>
560
561         Reviewed by Beth Dakin.
562         
563         Reversed the ownership relationship between Interpreter and JSGlobalObject.
564         Now, the JSGlobalObject owns the Interpreter, and top-level objects
565         that need the two to persist just protect the JSGlobalObject from GC.
566         
567         Global object bootstrapping looks a little odd right now, but it will
568         make much more sense soon, after further rounds of refactoring.
569
570         * bindings/runtime_root.h: Made this class inherit from RefCounted,
571         to avoid code duplication.
572
573         * kjs/collector.cpp:
574         (KJS::Collector::collect): No need to give special GC treatment to 
575         Interpreters, since we mark their global objects, which mark them.
576
577         * kjs/interpreter.cpp:
578         (KJS::Interpreter::mark): No need to mark our global object, since it
579         marks us.
580         * kjs/interpreter.h: Don't inherit from RefCounted -- JSGlobalObject 
581         owns us directly.
582
583         * kjs/testkjs.cpp: Modified to follow the new rules.
584         (createGlobalObject):
585         (runWithScripts):
586
587 2007-11-30  Brent Fulgham  <bfulgham@gmail.com>
588
589         Reviewed by Eric.
590
591         * ChangeLog:
592         * pcre/pcre_compile.cpp:
593         (compile_branch):
594
595 2007-11-30  Eric Seidel  <eric@webkit.org>
596
597         No review, build fix only.
598         
599         Fix uninitialized var warnings in release build.
600
601         * JavaScriptCore.xcodeproj/project.pbxproj:
602         * pcre/pcre_compile.cpp:
603         (compile_regex):
604
605 2007-11-30  Darin Adler  <darin@apple.com>
606
607         Reviewed by Adam Roben.
608
609         - fix http://bugs.webkit.org/show_bug.cgi?id=16207
610           JavaScript regular expressions should match UTF-16 code units rather than characters
611
612         SunSpider says this is 5.5% faster on the regexp test, 0.4% faste overall.
613
614         Test: fast/js/regexp-non-bmp.html
615
616         Renamed ANY_CHAR to NOT_NEWLINE to more-accurately reflect its meaning.
617
618         * pcre/pcre_compile.cpp:
619         (compile_branch): Removed calls to the UTF-16 character accessor functions, replacing
620         them with simple pointer dereferences in some cases, and no code at all in others.
621         (calculateCompiledPatternLengthAndFlags): Ditto.
622
623         * pcre/pcre_exec.cpp:
624         (match): Fixed indentation of some case labels (including all the BEGIN_OPCODE).
625         Removed calls to the UTF-16 character accessor functions, replacing them with simple
626         pointer dereferences in some cases, and no code at all in others. Also removed some
627         explicit UTF-16 support code in a few cases. Removed the unneeded "UTF-8" code path
628         in the ANY_CHAR repeat code, and in another case, eliminated the code to check against
629         end_subject in because it is already done outside the loop.
630         (jsRegExpExecute):
631
632         * pcre/pcre_internal.h: Removed all the UTF-16 helper functions.
633
634 2007-11-30  Eric Seidel  <eric@webkit.org>
635
636         Reviewed by darin.
637         
638         PCRE crashes under GuardMalloc
639         http://bugs.webkit.org/show_bug.cgi?id=16127
640         check against patternEnd to make sure we don't walk off the end of the string
641
642         * pcre/pcre_compile.cpp:
643         (compile_branch):
644         (calculateCompiledPatternLengthAndFlags):
645
646 2007-11-30  Eric Seidel  <eric@webkit.org>
647
648         Reviewed by Maciej.
649         
650         Fix layout test regressions caused by r28186
651         http://bugs.webkit.org/show_bug.cgi?id=16195
652         change first_byte and req_byte back to shorts instead of chars
653         (I think PCRE stuffs information in the high bits) 
654
655         * pcre/pcre_internal.h:
656
657 2007-11-29  Oliver Hunt  <oliver@apple.com>
658
659         Reviewed by Maciej and Darin.
660
661         Make the JS collector work with multiple threads 
662
663         Under heavy contention it was possible the GC to suspend other
664         threads inside the pthread spinlock, which could lead to the GC
665         thread blocking on the pthread spinlock itself.
666
667         We now determine and store each thread's stack base when it is
668         registered, thus removing the need for any calls to pthread_get_stackaddr_np
669         that needed the pthread spinlock.
670
671         * kjs/collector.cpp:
672         (KJS::Collector::Thread::Thread):
673         (KJS::Collector::registerThread):
674         (KJS::Collector::markOtherThreadConservatively):
675
676 2007-11-29  Adam Roben  <aroben@apple.com>
677
678         Windows build fix
679
680         Removed some unreachable code (ironically, the code was some
681         ASSERT_NOT_REACHED()s).
682
683         * pcre/pcre_compile.cpp:
684         (compile_branch):
685         * pcre/pcre_exec.cpp:
686         (match):
687
688 2007-11-29  Eric Seidel  <eric@webkit.org>
689
690         Reviewed by Mark Rowe.
691         
692         Fix for --guard crash of fast/js/regexp-charclass-crash introduced by r28151.
693
694         * pcre/pcre_compile.cpp:
695         (is_anchored):
696
697 2007-11-28  Mark Rowe  <mrowe@apple.com>
698
699         Gtk build fix.  Rubber-stamped by Eric.
700
701         * pcre/pcre_exec.cpp:
702         (match): Add braces around the body of the case statement to prevent
703         wanings about jumps across the initialization of a variable.
704
705 2007-11-29  Eric Seidel  <eric@webkit.org>
706
707         Reviewed by Mark Rowe.
708         
709         Attempt to fix non-mac builds after PCRE cleanup.
710
711         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
712         * JavaScriptCoreSources.bkl:
713         * pcre/pcre.pri:
714
715 2007-11-28  Eric Seidel  <eric@webkit.org>
716
717         Reviewed by Maciej.
718
719         Centralize code for subjectPtr adjustments using inlines, only ever check for a single trailing surrogate (as UTF16 only allows one), possibly fix PCRE bugs involving char classes and garbled UTF16 strings.
720
721         * pcre/pcre_exec.cpp:
722         (match):
723         (jsRegExpExecute):
724         * pcre/pcre_internal.h:
725         (getPreviousChar):
726         (movePtrToPreviousChar):
727         (movePtrToNextChar):
728         (movePtrToStartOfCurrentChar):
729
730 2007-11-28  Eric Seidel  <eric@webkit.org>
731
732         Reviewed by Maciej.
733
734         change getChar* functions to return result and push 'c' into local scopes for clarity
735
736         * pcre/pcre_compile.cpp:
737         (compile_branch):
738         (calculateCompiledPatternLengthAndFlags):
739         * pcre/pcre_exec.cpp:
740         (match):
741         * pcre/pcre_internal.h:
742         (getChar):
743         (getCharAndAdvance):
744         (getCharAndLength):
745         (getCharAndAdvanceIfSurrogate):
746
747 2007-11-28  Eric Seidel  <eric@webkit.org>
748
749         Reviewed by Sam.
750
751         Comment cleanup
752
753         * pcre/pcre_exec.cpp:
754         (match):
755
756 2007-11-26  Eric Seidel  <eric@webkit.org>
757
758         Reviewed by Sam.
759
760         Further cleanups to calculateCompiledPatternLengthAndFlags
761
762         * pcre/pcre_compile.cpp:
763         (calculateCompiledPatternLengthAndFlags):
764         * pcre/pcre_internal.h:
765
766 2007-11-26  Eric Seidel  <eric@webkit.org>
767
768         Reviewed by Sam.
769
770         Give consistent naming to the RegExp options/compile flags
771
772         * pcre/pcre_compile.cpp:
773         (compile_branch):
774         (is_anchored):
775         (find_firstassertedchar):
776         (printCompiledRegExp):
777         (jsRegExpCompile):
778         * pcre/pcre_exec.cpp:
779         (jsRegExpExecute):
780         * pcre/pcre_internal.h:
781
782 2007-11-26  Eric Seidel  <eric@webkit.org>
783
784         Reviewed by Sam.
785
786         Pull first_byte and req_byte optimizations out into separate static funtions, SunSpider reported this as a win.
787
788         * pcre/pcre_exec.cpp:
789         (tryFirstByteOptimization):
790         (tryRequiredByteOptimization):
791         (jsRegExpExecute):
792         * pcre/pcre_internal.h:
793
794 2007-11-26  Eric Seidel  <eric@webkit.org>
795
796         Reviewed by Maciej.
797
798         give PCRE_MULTILINE a better name: OptionMatchAcrossMultipleLines
799
800         * pcre/pcre_compile.cpp:
801         (compile_branch):
802         (is_anchored):
803         (printCompiledRegExp):
804         (jsRegExpCompile):
805         * pcre/pcre_exec.cpp:
806         (jsRegExpExecute):
807         * pcre/pcre_internal.h:
808
809 2007-11-26  Eric Seidel  <eric@webkit.org>
810
811         Reviewed by Oliver.
812
813         Deprecate jsRegExpExecute's offset-vector fallback code
814
815         * pcre/pcre_exec.cpp:
816         (jsRegExpExecute):
817
818 2007-11-26  Eric Seidel  <eric@webkit.org>
819
820         Reviewed by Maciej.
821
822         Make cur_is_word and prev_is_word locals, and change OP_ANY to OP_ANY_CHAR for clarity
823
824         * pcre/pcre_compile.cpp:
825         (find_fixedlength):
826         (compile_branch):
827         (canApplyFirstCharOptimization):
828         * pcre/pcre_exec.cpp:
829         (match):
830         * pcre/pcre_internal.h:
831
832 2007-11-26  Eric Seidel  <eric@webkit.org>
833
834         Reviewed by Mitz & Maciej.
835
836         Change _NC operators to use _IGNORING_CASE for clarity
837
838         * pcre/pcre_compile.cpp:
839         (find_fixedlength):
840         (compile_branch):
841         (find_firstassertedchar):
842         * pcre/pcre_exec.cpp:
843         (match):
844         * pcre/pcre_internal.h:
845
846 2007-11-26  Eric Seidel  <eric@webkit.org>
847
848         Reviewed by Mitz.
849
850         Remove branch from return
851
852         * pcre/pcre_compile.cpp:
853         (compile_branch):
854         * pcre/pcre_exec.cpp:
855         (match):
856
857 2007-11-26  Eric Seidel  <eric@webkit.org>
858
859         Reviewed by Maciej.
860
861         Add repeatInformationFromInstructionOffset inline
862
863         * pcre/pcre_exec.cpp:
864         (repeatInformationFromInstructionOffset):
865         (match):
866
867 2007-11-26  Eric Seidel  <eric@webkit.org>
868
869         Reviewed by Maciej.
870
871         Remove no longer used error code JSRegExpErrorMatchLimit
872
873         * kjs/regexp.cpp:
874         (KJS::RegExp::match):
875         * pcre/pcre.h:
876         * pcre/pcre_internal.h:
877
878 2007-11-26  Eric Seidel  <eric@webkit.org>
879
880         Reviewed by Sam.
881
882         Make i locally scoped for better code clarity
883
884         * pcre/pcre_exec.cpp:
885         (match):
886
887 2007-11-26  Eric Seidel  <eric@webkit.org>
888
889         Reviewed by Maciej.
890
891         Give subjectPtr and instructionPtr sane names, reduce size of MatchFrame for a 0.2% speedup.
892
893         * pcre/pcre_compile.cpp:
894         (compile_branch):
895         (calculateCompiledPatternLengthAndFlags):
896         * pcre/pcre_exec.cpp:
897         (match_ref):
898         (MatchStack::pushNewFrame):
899         (getUTF8CharAndIncrementLength):
900         (match):
901         * pcre/pcre_internal.h:
902         (getChar):
903         (getCharAndAdvance):
904         (getCharAndLength):
905         (getCharAndAdvanceIfSurrogate):
906         * pcre/pcre_xclass.cpp:
907         (getUTF8CharAndAdvancePointer):
908
909 2007-11-26  Eric Seidel  <eric@webkit.org>
910
911         Reviewed by Sam.
912
913         Small speedup (0.7%) by simplifying canUseStackBufferForNextFrame() check
914
915         * pcre/pcre_exec.cpp:
916         (MatchStack::MatchStack):
917         (MatchStack::popCurrentFrame):
918
919 2007-11-25  Eric Seidel  <eric@webkit.org>
920
921         Reviewed by Sam.
922
923         Lower MATCH_LIMIT_RECURSION to more sane levels to prevent hangs on run-javascriptcore-tests
924
925         * pcre/pcre_internal.h:
926
927 2007-11-25  Eric Seidel  <eric@webkit.org>
928
929         Reviewed by Maciej.
930
931         Remove match_is_group variable for another 5% speedup
932
933         * pcre/pcre_compile.cpp:
934         * pcre/pcre_exec.cpp:
935         (startNewGroup):
936         (match):
937
938 2007-11-28  Eric Seidel  <eric@webkit.org>
939
940         Reviewed by Sam.
941
942         Abstract frame variables into locals and args
943
944         * pcre/pcre_compile.cpp:
945         (compile_branch):
946         * pcre/pcre_exec.cpp:
947         (match):
948         * pcre/pcre_internal.h:
949
950 2007-11-28  Eric Seidel  <eric@webkit.org>
951
952         Reviewed by Sam.
953
954         Section off MatchData arguments into args struct
955
956         * pcre/pcre_exec.cpp:
957         (MatchStack::pushNewFrame):
958         (match):
959
960 2007-11-24  Eric Seidel  <eric@webkit.org>
961
962         Reviewed by Sam.
963
964         Remove redundant eptrblock struct
965
966         * pcre/pcre_exec.cpp:
967         (MatchStack::pushNewFrame):
968         (match):
969
970 2007-11-24  Eric Seidel  <eric@webkit.org>
971
972         Reviewed by Maciej.
973
974         Remove redundant match_call_count and move recursion check out of super-hot code path
975         SunSpider says this is at least an 8% speedup for regexp.
976
977         * pcre/pcre_exec.cpp:
978         (MatchStack::MatchStack):
979         (MatchStack::pushNewFrame):
980         (MatchStack::popCurrentFrame):
981         (MatchStack::popAllFrames):
982         (match):
983         (jsRegExpExecute):
984         * pcre/pcre_internal.h:
985
986 2007-11-24  Eric Seidel  <eric@webkit.org>
987
988         Reviewed by Sam.
989
990         Get rid of GETCHAR* macros, replacing them with better named inlines
991
992         * pcre/pcre_compile.cpp:
993         (compile_branch):
994         (calculateCompiledPatternLengthAndFlags):
995         * pcre/pcre_exec.cpp:
996         (match):
997         * pcre/pcre_internal.h:
998         (getCharAndAdvance):
999         (getCharAndLength):
1000         (getCharAndAdvanceIfSurrogate):
1001
1002 2007-11-24  Eric Seidel  <eric@webkit.org>
1003
1004         Reviewed by Sam.
1005
1006         Further cleanup GET/PUT inlines
1007
1008         * pcre/pcre_internal.h:
1009         (putOpcodeValueAtOffset):
1010         (getOpcodeValueAtOffset):
1011         (putOpcodeValueAtOffsetAndAdvance):
1012         (put2ByteOpcodeValueAtOffset):
1013         (get2ByteOpcodeValueAtOffset):
1014         (put2ByteOpcodeValueAtOffsetAndAdvance):
1015
1016 2007-11-24  Eric Seidel  <eric@webkit.org>
1017
1018         Reviewed by Sam.
1019
1020         Give GET, PUT better names, and add (poor) moveOpcodePtrPastAnyAlternateBranches
1021
1022         * pcre/pcre_compile.cpp:
1023         (firstSignificantOpCodeSkippingAssertions):
1024         (find_fixedlength):
1025         (complete_callout):
1026         (compile_branch):
1027         (compile_regex):
1028         (is_anchored):
1029         (canApplyFirstCharOptimization):
1030         (find_firstassertedchar):
1031         * pcre/pcre_exec.cpp:
1032         (match):
1033         * pcre/pcre_internal.h:
1034         (putOpcodeValueAtOffset):
1035         (getOpcodeValueAtOffset):
1036         (putOpcodeValueAtOffsetAndAdvance):
1037         (put2ByteOpcodeValueAtOffset):
1038         (get2ByteOpcodeValueAtOffset):
1039         (moveOpcodePtrPastAnyAlternateBranches):
1040         * pcre/pcre_ucp_searchfuncs.cpp:
1041         (_pcre_ucp_othercase):
1042
1043 2007-11-24  Eric Seidel  <eric@webkit.org>
1044
1045         Reviewed by Sam.
1046
1047         Add inlines for toLowerCase, isWordChar, isSpaceChar for further regexp speedup
1048
1049         * pcre/pcre_compile.cpp:
1050         (compile_branch):
1051         (jsRegExpCompile):
1052         * pcre/pcre_exec.cpp:
1053         (match):
1054         (jsRegExpExecute):
1055         * pcre/pcre_internal.h:
1056         (toLowerCase):
1057         (flipCase):
1058         (classBitmapForChar):
1059         (charTypeForChar):
1060         (isWordChar):
1061         (isSpaceChar):
1062         (CompileData::CompileData):
1063         * pcre/pcre_xclass.cpp:
1064         (_pcre_xclass):
1065
1066 2007-11-24  Eric Seidel  <eric@webkit.org>
1067
1068         Reviewed by Sam.
1069
1070         cleanup _pcre_ucp_othercase
1071
1072         * pcre/pcre_ucp_searchfuncs.cpp:
1073         (_pcre_ucp_othercase):
1074
1075 2007-11-24  Eric Seidel  <eric@webkit.org>
1076
1077         Reviewed by Maciej.
1078
1079         Use better variable names for case ignoring options
1080
1081         * pcre/pcre_compile.cpp:
1082         (compile_branch):
1083         (find_firstassertedchar):
1084         (printCompiledRegExp):
1085         (jsRegExpCompile):
1086         * pcre/pcre_exec.cpp:
1087         (match_ref):
1088         (match):
1089         (jsRegExpExecute):
1090         * pcre/pcre_internal.h:
1091
1092 2007-11-24  Eric Seidel  <eric@webkit.org>
1093
1094         Reviewed by Sam.
1095
1096         split first_significant_code into two simpler functions
1097
1098         * pcre/pcre_compile.cpp:
1099         (firstSignificantOpCode):
1100         (firstSignificantOpCodeSkippingAssertions):
1101         (is_anchored):
1102         (canApplyFirstCharOptimization):
1103         (find_firstassertedchar):
1104
1105 2007-11-24  Eric Seidel  <eric@webkit.org>
1106
1107         Reviewed by Sam.
1108
1109         clean up is_counted_repeat
1110
1111         * pcre/pcre_compile.cpp:
1112         (is_counted_repeat):
1113
1114 2007-11-24  Eric Seidel  <eric@webkit.org>
1115
1116         Reviewed by Sam.
1117
1118         clean up check_escape
1119
1120         * pcre/pcre_compile.cpp:
1121         (check_escape):
1122
1123 2007-11-24  Eric Seidel  <eric@webkit.org>
1124
1125         Reviewed by Sam.
1126
1127         Reformat find_fixedlength
1128
1129         * pcre/pcre_compile.cpp:
1130         (find_fixedlength):
1131
1132 2007-11-24  Eric Seidel  <eric@webkit.org>
1133
1134         Reviewed by Sam.
1135
1136         reformat is_anchored
1137
1138         * pcre/pcre_compile.cpp:
1139         (is_anchored):
1140
1141 2007-11-24  Eric Seidel  <eric@webkit.org>
1142
1143         Reviewed by Maciej.
1144
1145         Remove unused function could_be_empty_branch
1146
1147         * pcre/pcre_compile.cpp:
1148         (first_significant_code):
1149         (find_fixedlength):
1150         (compile_branch):
1151         (canApplyFirstCharOptimization):
1152
1153 2007-11-24  Eric Seidel  <eric@webkit.org>
1154
1155         Reviewed by Sam.
1156
1157         Pass around MatchData objects by reference
1158
1159         * pcre/pcre_exec.cpp:
1160         (pchars):
1161         (match_ref):
1162         (match):
1163         (jsRegExpExecute):
1164
1165 2007-11-24  Eric Seidel  <eric@webkit.org>
1166
1167         Reviewed by Sam.
1168
1169         give PCRE_STARTLINE a better name and rename match_data to MatchData
1170
1171         * pcre/pcre_compile.cpp:
1172         (compile_branch):
1173         (canApplyFirstCharOptimization):
1174         (find_firstassertedchar):
1175         (printCompiledRegExp):
1176         (jsRegExpCompile):
1177         * pcre/pcre_exec.cpp:
1178         (pchars):
1179         (jsRegExpExecute):
1180         * pcre/pcre_internal.h:
1181
1182 2007-11-24  Eric Seidel  <eric@webkit.org>
1183
1184         Reviewed by Sam.
1185
1186         Clean up find_firstassertedchar
1187
1188         * pcre/pcre_compile.cpp:
1189         (get_othercase_range):
1190         (find_firstassertedchar):
1191         (calculateCompiledPatternLengthAndFlags):
1192
1193 2007-11-24  Eric Seidel  <eric@webkit.org>
1194
1195         Reviewed by Tim Hatcher.
1196
1197         Pass around CompileData& instead of CompileData*
1198
1199         * pcre/pcre_compile.cpp:
1200         (compile_branch):
1201         (jsRegExpCompile):
1202
1203 2007-11-24  Eric Seidel  <eric@webkit.org>
1204
1205         Reviewed by Sam.
1206
1207         Clean up compile_branch, move _pcre_ord2utf8, and rename CompileData
1208
1209         * JavaScriptCore.xcodeproj/project.pbxproj:
1210         * pcre/pcre_compile.cpp:
1211         (_pcre_ord2utf8):
1212         (calculateCompiledPatternLengthAndFlags):
1213         (jsRegExpCompile):
1214         * pcre/pcre_internal.h:
1215         * pcre/pcre_ord2utf8.cpp: Removed.
1216
1217 2007-11-24  Eric Seidel  <eric@webkit.org>
1218
1219         Reviewed by Sam.
1220
1221         removing more macros
1222
1223         * pcre/pcre_compile.cpp:
1224         (could_be_empty_branch):
1225         (compile_branch):
1226         (calculateCompiledPatternLengthAndFlags):
1227         * pcre/pcre_exec.cpp:
1228         (match):
1229         (jsRegExpExecute):
1230         * pcre/pcre_internal.h:
1231         * pcre/pcre_xclass.cpp:
1232
1233 2007-11-24  Eric Seidel  <eric@webkit.org>
1234
1235         Reviewed by Maciej.
1236
1237         clean up formating in compile_branch
1238
1239         * pcre/pcre_compile.cpp:
1240         (compile_branch):
1241
1242 2007-11-24  Eric Seidel  <eric@webkit.org>
1243
1244         Reviewed by Sam.
1245
1246         Fix spacing for read_repeat_counts
1247
1248         * pcre/pcre_compile.cpp:
1249         (read_repeat_counts):
1250
1251 2007-11-24  Eric Seidel  <eric@webkit.org>
1252
1253         Reviewed by Sam.
1254
1255         Get rid of PCRE custom char types
1256
1257         * pcre/pcre_compile.cpp:
1258         (check_escape):
1259         (complete_callout):
1260         (compile_branch):
1261         (compile_regex):
1262         (calculateCompiledPatternLengthAndFlags):
1263         (jsRegExpCompile):
1264         * pcre/pcre_exec.cpp:
1265         (match_ref):
1266         (match):
1267         (jsRegExpExecute):
1268         * pcre/pcre_internal.h:
1269
1270 2007-11-24  Eric Seidel  <eric@webkit.org>
1271
1272         Reviewed by Sam.
1273
1274         reformat get_othercase_range
1275
1276         * pcre/pcre_compile.cpp:
1277         (get_othercase_range):
1278
1279 2007-11-24  Eric Seidel  <eric@webkit.org>
1280
1281         Reviewed by Maciej.
1282
1283         Remove register keyword and more cleanup
1284
1285         * pcre/pcre_compile.cpp:
1286         (find_fixedlength):
1287         (compile_branch):
1288         (is_anchored):
1289         (is_startline):
1290         (find_firstassertedchar):
1291         (calculateCompiledPatternLengthAndFlags):
1292         (jsRegExpCompile):
1293         * pcre/pcre_exec.cpp:
1294         (MatchStack::canUseStackBufferForNextFrame):
1295         (MatchStack::allocateNextFrame):
1296         (MatchStack::pushNewFrame):
1297         (MatchStack::frameIsStackAllocated):
1298         (MatchStack::popCurrentFrame):
1299         (MatchStack::unrollAnyHeapAllocatedFrames):
1300         (getUTF8CharAndIncrementLength):
1301         (match):
1302         (jsRegExpExecute):
1303         * pcre/pcre_internal.h:
1304         (PUT2INC):
1305         (isLeadingSurrogate):
1306         (isTrailingSurrogate):
1307         (decodeSurrogatePair):
1308         (getChar):
1309         * pcre/pcre_ord2utf8.cpp:
1310         (_pcre_ord2utf8):
1311         * pcre/pcre_xclass.cpp:
1312         (getUTF8CharAndAdvancePointer):
1313         (_pcre_xclass):
1314
1315 2007-11-24  Eric Seidel  <eric@webkit.org>
1316
1317         Reviewed by Maciej.
1318
1319         Clean up jsRegExpExecute
1320
1321         * pcre/pcre_compile.cpp:
1322         (returnError):
1323         (jsRegExpCompile):
1324         * pcre/pcre_exec.cpp:
1325         (jsRegExpExecute):
1326         * pcre/pcre_internal.h:
1327
1328 2007-11-29  Oliver Hunt  <oliver@apple.com>
1329
1330         Reviewed by Geoff.
1331
1332         Merging updated system alloc and spinlock code from r38 of TCMalloc.
1333
1334         This is needed as a precursor to the merge of TCMalloc proper.
1335
1336         * wtf/FastMalloc.cpp:
1337         (WTF::TCMalloc_PageHeap::GrowHeap):
1338         * wtf/TCSpinLock.h:
1339         (TCMalloc_SpinLock::TCMalloc_SpinLock):
1340         (TCMalloc_SpinLock::):
1341         (TCMalloc_SpinLock::Lock):
1342         (TCMalloc_SpinLock::Unlock):
1343         (TCMalloc_SpinLock::IsHeld):
1344         * wtf/TCSystemAlloc.cpp:
1345         (TrySbrk):
1346         (TryMmap):
1347         (TryVirtualAlloc):
1348         (TryDevMem):
1349         (TCMalloc_SystemAlloc):
1350         * wtf/TCSystemAlloc.h:
1351
1352 2007-11-28  Brady Eidson <beidson@apple.com>
1353
1354         Reviewed by Geoff
1355
1356         Add copyKeysToVector utility, mirroring copyValuesToVector
1357         Also change the copyValuesToVector implementation to be a little more attractive
1358
1359         * wtf/HashMap.h:
1360         (WTF::copyKeysToVector):
1361         (WTF::copyValuesToVector):
1362
1363 2007-11-27  Alp Toker  <alp@atoker.com>
1364
1365         Reviewed by Mark Rowe.
1366
1367         Add a list of public JavaScriptCore headers for installation.
1368
1369         This follows the convention used for the Qt and GTK+ header lists.
1370
1371         * headers.pri: Added.
1372
1373 2007-11-27  Alp Toker  <alp@atoker.com>
1374
1375         Prospective MSVC build fix.
1376
1377         Roll back dllexport/dllimport support for now.
1378
1379         * API/JSBase.h:
1380
1381 2007-11-27  Alp Toker  <alp@atoker.com>
1382
1383         Reviewed by Maciej.
1384
1385         http://bugs.webkit.org/show_bug.cgi?id=15569
1386         [gtk] GTK JavaScriptCore needs to export symbols for JSC API and WTF
1387
1388         Introduce JS_EXPORT to mark symbols to be exported as public API.
1389
1390         Export all public symbols in the JavaScriptCore C API.
1391
1392         This matches conventions for exporting symbols set by the CF and CG
1393         frameworks.
1394
1395         * API/JSBase.h:
1396         * API/JSContextRef.h:
1397         * API/JSObjectRef.h:
1398         * API/JSStringRef.h:
1399         * API/JSStringRefBSTR.h:
1400         * API/JSStringRefCF.h:
1401         * API/JSValueRef.h:
1402
1403 2007-11-27  Anders Carlsson  <andersca@apple.com>
1404
1405         Reviewed by Adam.
1406
1407         Make PropertyNameArray and ScopeChain COMEnumVariant friendly.
1408         
1409         * kjs/PropertyNameArray.cpp:
1410         (KJS::PropertyNameArray::swap):
1411         Implement PropertyNameArray::swap.
1412         
1413         * kjs/PropertyNameArray.h:
1414         Add ValueType typedef. Replace PropertyNameArrayIterator with 
1415         PropertyNameArray::const_iterator.
1416         
1417         * kjs/nodes.cpp:
1418         (KJS::ForInNode::execute):
1419         * kjs/scope_chain.cpp:
1420         (KJS::ScopeChain::print):
1421         Update for changes to PropertyNameArray.
1422         
1423         * kjs/scope_chain.h:
1424         Add const_iterator and ValueType typedef.
1425         
1426 2007-11-27  Anders Carlsson  <andersca@apple.com>
1427
1428         Reviewed by Darin.
1429
1430         Add a ValueType typedef.
1431         
1432         * wtf/Vector.h:
1433
1434 2007-11-26  Darin Adler  <darin@apple.com>
1435
1436         Reviewed by Mitz.
1437
1438         - fix http://bugs.webkit.org/show_bug.cgi?id=16096
1439           REGRESSION (r26653-r26699): Plaxo.com addressbook does not load in webkit nightlies
1440
1441         Test: fast/js/regexp-overflow.html
1442
1443         * pcre/pcre_compile.cpp: (calculateCompiledPatternLengthAndFlags):
1444         Removed a stray "ptr++" that I added by accident when merging the
1445         changes between PCRE 6.4 and 6.5. 
1446
1447 2007-11-26  Geoffrey Garen  <ggaren@apple.com>
1448
1449         Reviewed by Kevin McCullough.
1450         
1451         Fixed <rdar://problem/5597937> REGRESSION (r27126): Drosera does not 
1452         show variables (can't enumerate ActivationImp properties)
1453         
1454         Implemented a custom ActivationImp::getPropertyNames, since 
1455         ActivationImp now uses a custom property storage mechanism for local
1456         variables.
1457
1458         * kjs/function.cpp:
1459         (KJS::ActivationImp::getPropertyNames):
1460         * kjs/function.h:
1461
1462 2007-11-26  Alp Toker  <alp@atoker.com>
1463
1464         GTK+/Qt/Wx build fix for breakage introduced in r28039.
1465
1466         * ForwardingHeaders/JavaScriptCore/JSRetainPtr.h: Added.
1467
1468 2007-11-24  Laszlo Gombos  <laszlo.gombos@gmail.com>
1469
1470         Reviewed by Maciej Stachowiak.
1471
1472         Fix minor compiler warning (GCC 4.1.3)
1473
1474         * pcre/pcre_internal.h:
1475         * pcre/pcre_ucp_searchfuncs.cpp:
1476         (_pcre_ucp_othercase):
1477
1478 2007-11-25  Mark Rowe  <mrowe@apple.com>
1479
1480         Reviewed by Dan Bernstein.
1481
1482         Fix http://bugs.webkit.org/show_bug.cgi?id=16129
1483         Bug 16129: REGRESSION (r27761-r27811): malloc error while visiting http://mysit.es (crashes release build)
1484
1485         * pcre/pcre_compile.cpp: Change errorcode to be passed by reference so that any error code is propagated
1486         to our caller like they expect.
1487
1488 2007-11-23  Kevin Ollivier  <kevino@theolliviers.com>
1489
1490         MSVC7 build fix. (rand_s doesn't exist there)
1491
1492         Reviewed by Adam Roben.
1493
1494         * kjs/config.h:
1495         * wtf/MathExtras.h:
1496
1497 2007-11-23  Kevin Ollivier  <kevino@theolliviers.com>
1498
1499         wx build fix. Move WX_PYTHON logic into project build settings,
1500         add WebKitLibraries dirs on Win, and explicitly include JSCore 
1501         headers in testkjs rather than getting them from a template.
1502         (Include dir order of JSCore/WTF and ICU headers is important due  
1503         to wtf/unicode/utf8.h.)
1504
1505         * jscore.bkl:
1506
1507 2007-11-23  Simon Hausmann  <hausmann@webkit.org>
1508
1509         Reviewed by George Staikos <staikos@kde.org>.
1510
1511         Fix make (dist)clean on Windows.
1512         
1513         OBJECTS_DIR_WTR does not exist anymore, use GENERATED_SOURCES_DIR.
1514         
1515
1516         * JavaScriptCore.pri:
1517         * pcre/pcre.pri:
1518
1519 2007-11-22  Simon Hausmann  <hausmann@kde.org>
1520
1521         Reviewed by George.
1522
1523         Make the directory of where to put the generated sources configurable through the GENERATED_SOURCE_DIR variable
1524
1525         * JavaScriptCore.pri:
1526         * pcre/pcre.pri:
1527
1528 2007-11-22  Simon Hausmann  <hausmann@kde.org>
1529
1530         Reviewed by George.
1531
1532         Centralize the setup for all the extra compilers in a addExtraCompiler function.
1533         
1534         This allows adding a "generated_files" target that builds all generated files using "make generated_files".
1535         For the build inside Qt we do not generate actual rules for the extra compilers but instead
1536         do the variable substitution of compiler.output manually and add the generated sources to SOURCES.
1537
1538         * JavaScriptCore.pri:
1539         * pcre/pcre.pri:
1540
1541 2007-11-20  Mark Rowe  <mrowe@apple.com>
1542
1543         Reviewed by Tim Hatcher.
1544
1545         <rdar://problem/5602936> Need to resolve new GCC 4.2 warnings
1546
1547         Fix all warnings emitted by GCC 4.2 when building JavaScriptCore.  This allows builds with
1548         -Werror to succeed.  At present they will crash when executed due to code that is not safe
1549         under strict aliasing (<rdar://problem/5536806>).
1550
1551         * Configurations/Base.xcconfig: Remove the -Wno-long-double flag.
1552         * kjs/date_object.cpp:
1553         (KJS::formatTime): Test whether the stack-allocated string is empty rather than at a non-null address.
1554         * kjs/dtoa.cpp:
1555         (Bigint::): Tweak formatting to silence warnings.
1556         * pcre/pcre_exec.cpp:
1557         (match): Tweak formatting to silence warnings
1558         * wtf/Assertions.cpp: Add printf format attribute to functions that warrant it.
1559         * wtf/Assertions.h: Ditto.
1560
1561 2007-11-19  Kevin Ollivier  <kevino@theolliviers.com>
1562
1563         wx port build fix (wx headers include ctype functions).
1564
1565         * kjs/config.h:
1566
1567 2007-11-19  Kevin Ollivier  <kevino@theolliviers.com>
1568
1569         Remove outdated and unused Windows port files.
1570
1571         Reviewed by Adam Roben.
1572
1573         * Makefile.vc: Removed.
1574         * README-Win32.txt: Removed.
1575
1576 2007-11-18  Eric Seidel  <eric@webkit.org>
1577
1578         Reviewed by Oliver.
1579
1580         * tests/mozilla/jsDriver.pl: exit non-0 when user aborts test run
1581
1582 2007-11-17  Mark Rowe  <mrowe@apple.com>
1583
1584         Reviewed by Darin Adler.
1585
1586         Fix: <rdar://problem/5607032> REGRESSION: testapi exits with assertion failure in debug build
1587              <rdar://problem/5440659> JSGlobalContextCreate throws away globalObjectClass's prototype
1588              http://bugs.webkit.org/show_bug.cgi?id=16033
1589
1590         Split Interpreter's initialization into two distinct steps:  the creation of the global prototypes
1591         and constructors, and storing them on the global object.  This allows JSClassRef's passed to
1592         JSGlobalContextCreate to be instantiated with the correct prototype.
1593
1594         * API/JSCallbackObject.cpp: Assert at compile-time that the custom global object will fit in a collector cell.
1595         * API/JSCallbackObject.h:
1596         * API/JSCallbackObjectFunctions.h:
1597         (KJS::::JSCallbackObject):
1598         (KJS::::init):
1599         * API/JSContextRef.cpp:
1600         (JSGlobalContextCreate): Construct and set the interpreter's global object separately.  When globalObjectClass
1601         is passed we need to set the interpreter's global object before doing the JSCallbackObject's initialization to
1602         prevent any JSObjectInitializeCallback's being invoked before a global object is set.
1603         * API/testapi.c:
1604         (globalObject_initialize): Test the object passed in is correct and that it has the expected global properties.
1605         (globalObject_get):
1606         (globalObject_set):
1607         (main):
1608         * API/testapi.js: Test that any static properties exposed by the global object's custom class are found.
1609         * JavaScriptCore.exp:
1610         * bindings/testbindings.cpp:
1611         (main): Update for changes in Interpreter method signatures.
1612         * bindings/testbindings.mm:
1613         (main): Ditto.
1614         * kjs/ExecState.cpp:
1615         (KJS::ExecState::ExecState):
1616         (KJS::ExecState::mark):
1617         (KJS::ExecState::setGlobalObject):
1618         * kjs/ExecState.h: Rename scope to m_scopeChain.
1619         * kjs/interpreter.cpp:
1620         (KJS::Interpreter::Interpreter):
1621         (KJS::Interpreter::init):
1622         (KJS::Interpreter::globalObject):
1623         (KJS::Interpreter::setGlobalObject):
1624         (KJS::Interpreter::resetGlobalObjectProperties):
1625         (KJS::Interpreter::createObjectsForGlobalObjectProperties):
1626         (KJS::Interpreter::setGlobalObjectProperties): Switch to using putDirect to ensure that the global object's put method
1627         cannot interfere with setting of the global properties.  This prevents a user-written JSClassRef from attempting to
1628         call back into JavaScript from the initialization of the global object's members.
1629         * kjs/interpreter.h:
1630         * kjs/testkjs.cpp:
1631         (setupInterpreter): Update for changes in Interpreter method signatures.
1632
1633 2007-11-17  Mark Rowe  <mrowe@apple.com>
1634
1635         Reviewed by Sam Weinig.
1636
1637         Prevent testapi from reporting false leaks.  Clear out local variables pointing at
1638         JSObjectRefs to allow their values to be collected.
1639
1640         * API/testapi.c:
1641         (main):
1642
1643 2007-11-17  Mark Rowe  <mrowe@apple.com>
1644
1645         Reviewed by Sam Weinig.
1646
1647         Prevent testapi from crashing if testapi.js can not be found by nil-checking the result of createStringWithContentsOfFile.
1648
1649         * API/testapi.c:
1650         (main):
1651
1652 2007-11-17  Alp Toker  <alp@atoker.com>
1653
1654         Reviewed by Eric.
1655
1656         http://bugs.webkit.org/show_bug.cgi?id=16032
1657         JS minidom is not portable
1658
1659         Use a plain UTF-8 string instead of a CFString.
1660
1661         Print to stdout, not stderr like CFShow() would have done, since that
1662         behaviour seems unintentional.
1663
1664         * API/minidom.c:
1665         (main):
1666
1667 2007-11-17  Steve Falkenburg  <sfalken@apple.com>
1668
1669         Windows build fix.
1670
1671         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1672
1673 2007-11-16  Mark Rowe  <mrowe@apple.com>
1674
1675         Windows build fix.
1676
1677         * kjs/lexer.cpp:
1678         (KJS::Lexer::record8):
1679
1680 2007-11-16  Mark Rowe  <mrowe@apple.com>
1681
1682         Reviewed by Eric.
1683
1684         Replace strings, identifier, buffer8 and buffer16 members of Lexer with vectors.
1685         SunSpider claims this is a 0.7% speedup.
1686
1687         * kjs/lexer.cpp:
1688         (KJS::Lexer::Lexer):
1689         (KJS::Lexer::lex):
1690         (KJS::Lexer::record8):
1691         (KJS::Lexer::record16):
1692         (KJS::Lexer::scanRegExp):
1693         (KJS::Lexer::clear):
1694         (KJS::Lexer::makeIdentifier):
1695         (KJS::Lexer::makeUString):
1696         * kjs/lexer.h:
1697         * kjs/ustring.cpp:
1698         (KJS::UString::UString): Add a convenience constructor that takes a const Vector<UChar>&.
1699         * kjs/ustring.h:
1700
1701 2007-11-16  Adam Roben  <aroben@apple.com>
1702
1703         Windows build fix
1704
1705         * JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Add a new include path
1706         and ignore the int -> bool conversion warning.
1707
1708 2007-11-16  Alexey Proskuryakov  <ap@webkit.org>
1709
1710         Fix Windows debug build.
1711         Rubber-stamped by Eric
1712
1713         * pcre/pcre_exec.cpp: (match): Removed ASSERT_NOT_REACHED assertions that were making MSVC
1714         complain about unreachable code.
1715
1716 2007-11-15  Mark Rowe  <mrowe@apple.com>
1717
1718         Gtk build fix.
1719
1720         * kjs/Parser.cpp:
1721
1722 2007-11-15  Mark Rowe  <mrowe@apple.com>
1723
1724         Mac build and header search path sanity fix.
1725
1726         Reviewed by Sam Weinig and Tim Hatcher.
1727
1728         Move base setting for HEADER_SEARCH_PATHS into Base.xcconfig, and extend
1729         it in JavaScriptCore.xcconfig.  This removes the need to override it on a
1730         per-target basis inside the .xcodeproj file.
1731
1732         * Configurations/Base.xcconfig:
1733         * Configurations/JavaScriptCore.xcconfig:
1734         * JavaScriptCore.xcodeproj/project.pbxproj:
1735
1736 2007-11-15  Mark Rowe  <mrowe@apple.com>
1737
1738         Qt build fix.
1739
1740         * kjs/Parser.h:
1741
1742 2007-11-15  Geoffrey Garen  <ggaren@apple.com>
1743
1744         Reviewed by Eric Seidel.
1745
1746         Another round of grammar / parsing cleanup.
1747         
1748         1. Created distinct parser calls for parsing function bodies vs
1749         programs. This will help later with optimizing global variable access.
1750         
1751         2. Turned Parser into a singleton. Cleaned up Lexer's singleton 
1752         interface.
1753         
1754         3. Modified Lexer to free a little more memory when done lexing. (Added
1755         FIXMEs for similar issues that I didn't fix.)
1756         
1757         4. Changed Lexer::makeIdentifier and Lexer::makeUString to start 
1758         respecting the arguments passed to them. (No behavior change, but this
1759         problem could have caused serious problems for an unsuspecting user of
1760         these functions.)
1761         
1762         5. Removed KJS_DEBUG_MEM because it was bit-rotted.
1763         
1764         6. Removed Parser::prettyPrint because the same work was simpler to do
1765         at the call site.
1766         
1767         7. Some renames:
1768         
1769             "Parser::accept" => "Parser::didFinishParsing"
1770             "Parser::sid" => "Parser::m_sourceID"
1771             "Lexer::doneParsing" => "Lexer::clear"
1772             "sid" => "sourceId"
1773             "lineno" => "lineNo"
1774         
1775         * JavaScriptCore.exp:
1776         * kjs/Parser.cpp:
1777         (KJS::Parser::Parser):
1778         (KJS::Parser::parseProgram):
1779         (KJS::Parser::parseFunctionBody):
1780         (KJS::Parser::parse):
1781         (KJS::Parser::didFinishParsing):
1782         (KJS::parser):
1783         * kjs/Parser.h:
1784         (KJS::Parser::sourceId):
1785         * kjs/function.cpp:
1786         (KJS::GlobalFuncImp::callAsFunction):
1787         * kjs/function_object.cpp:
1788         (FunctionObjectImp::construct):
1789         * kjs/grammar.y:
1790         * kjs/interpreter.cpp:
1791         (KJS::Interpreter::checkSyntax):
1792         (KJS::Interpreter::evaluate):
1793         * kjs/interpreter.h:
1794         * kjs/lexer.cpp:
1795         (kjsyylex):
1796         (KJS::lexer):
1797         (KJS::Lexer::Lexer):
1798         (KJS::Lexer::~Lexer):
1799         (KJS::Lexer::scanRegExp):
1800         (KJS::Lexer::doneParsing):
1801         (KJS::Lexer::makeIdentifier):
1802         (KJS::Lexer::makeUString):
1803         * kjs/lexer.h:
1804         (KJS::Lexer::pattern):
1805         (KJS::Lexer::flags):
1806         (KJS::Lexer::sawError):
1807         * kjs/nodes.cpp:
1808         (KJS::Node::Node):
1809         (KJS::FunctionBodyNode::FunctionBodyNode):
1810         * kjs/nodes.h:
1811         * kjs/testkjs.cpp:
1812         (prettyPrintScript):
1813         (kjsmain):
1814         * kjs/ustring.cpp:
1815         * kjs/ustring.h:
1816
1817 2007-11-15  Oliver Hunt  <oliver@apple.com>
1818
1819         Reviewed by Darin.
1820
1821         <rdar://problem/5601548> REGRESSION: All SourceElements and their children leak after a syntax error
1822         
1823         Add a stub node to maintain the Vector of SourceElements until assignment.
1824
1825         * kjs/grammar.y:
1826         * kjs/nodes.h:
1827         (KJS::SourceElementsStub::SourceElementsStub):
1828         (KJS::SourceElementsStub::append):
1829         (KJS::SourceElementsStub::release):
1830         (KJS::SourceElementsStub::):
1831         (KJS::SourceElementsStub::precedence):
1832
1833 2007-11-15  Eric Seidel  <eric@webkit.org>
1834
1835         Reviewed by Sam.
1836
1837         Abstract most of RMATCH into MatchStack functions.
1838         
1839         SunSpider claims this, combined with the last 2 patches was a 1% speedup, 10% for dna-regexp.
1840
1841         * pcre/pcre_exec.cpp:
1842         (MatchStack::canUseStackBufferForNextFrame):
1843         (MatchStack::allocateNextFrame):
1844         (MatchStack::pushNewFrame):
1845         (MatchStack::frameIsStackAllocated):
1846         (MatchStack::popCurrentFrame):
1847         (MatchStack::unrollAnyHeapAllocatedFrames):
1848         (match):
1849
1850 2007-11-15  Eric Seidel  <eric@webkit.org>
1851
1852         Reviewed by Sam.
1853
1854         Remove RETURN_ERROR, add MatchStack
1855         
1856         * pcre/pcre_exec.cpp:
1857         (MatchStack::MatchStack):
1858         (MatchStack::unrollAnyHeapAllocatedFrames):
1859         (matchError):
1860         (match):
1861         
1862 2007-11-15  Eric Seidel  <eric@webkit.org>
1863
1864         Reviewed by Sam.
1865
1866         Clean up match function to match WebKit style
1867
1868         * JavaScriptCore.xcodeproj/project.pbxproj:
1869         * pcre/pcre_exec.cpp:
1870         (match):
1871
1872 2007-11-15  Steve Falkenburg  <sfalken@apple.com>
1873
1874         Windows build fix.
1875
1876         * JavaScriptCore.vcproj/JavaScriptCore.make:
1877
1878 2007-11-14  Alexey Proskuryakov  <ap@webkit.org>
1879
1880         Reviewed by Darin.
1881
1882         http://bugs.webkit.org/show_bug.cgi?id=15982
1883         Improve JSString UTF-8 decoding
1884
1885         * API/JSStringRef.cpp:
1886         (JSStringCreateWithUTF8CString): Use strict decoding, return 0 on error.
1887
1888         * wtf/unicode/UTF8.cpp:
1889         (WTF::Unicode::convertUTF16ToUTF8):
1890         (WTF::Unicode::convertUTF8ToUTF16):
1891         * wtf/unicode/UTF8.h:
1892         Made these function names start with a lower case letter.
1893
1894         * kjs/ustring.cpp: (KJS::UString::UTF8String): Updated for the above renaming.
1895
1896         * bindings/c/c_utility.cpp:
1897         (KJS::Bindings::convertUTF8ToUTF16WithLatin1Fallback): Renamed to highlight the difference
1898         from convertUTF8ToUTF16 in wtf/unicode.
1899         (KJS::Bindings::convertNPStringToUTF16): Updated for the above renaming.
1900         (KJS::Bindings::identifierFromNPIdentifier): Ditto.
1901         * bindings/c/c_utility.h: Made convertUTF8ToUTF16WithLatin1Fallback() a file static.
1902
1903 2007-11-14  Sam Weinig  <sam@webkit.org>
1904
1905         Rubber-stamped by Anders.
1906
1907         Fix the Xcode project file after it was messed up in r27402.
1908
1909         * JavaScriptCore.xcodeproj/project.pbxproj:
1910
1911 2007-11-14  Eric Seidel  <eric@webkit.org>
1912
1913         Reviewed by Oliver.
1914         
1915         More PCRE style cleanup.
1916
1917         * pcre/pcre_compile.cpp:
1918         (compile_regex):
1919
1920 2007-11-14  Adam Roben  <aroben@apple.com>
1921
1922         Clean up the bison conflict checking script
1923
1924         Reviewed by Geoff.
1925
1926         * DerivedSources.make:
1927
1928 2007-11-14  Eric Seidel  <eric@webkit.org>
1929
1930         Reviewed by Geoff.
1931
1932         Another round of PCRE cleanups: inlines
1933         
1934         SunSpider claims that this, combined with my previous PCRE cleanup were a 0.7% speedup, go figure.
1935
1936         * pcre/pcre_compile.cpp:
1937         (jsRegExpCompile):
1938         * pcre/pcre_exec.cpp:
1939         (match):
1940         (jsRegExpExecute):
1941         * pcre/pcre_internal.h:
1942         (PUT):
1943         (GET):
1944         (PUT2):
1945         (GET2):
1946         (isNewline):
1947
1948 2007-11-14  Eric Seidel  <eric@webkit.org>
1949
1950         Reviewed by Sam.
1951         
1952         Give PCRE a (small) bath.
1953         Fix some formating and break things off into separate functions
1954         http://bugs.webkit.org/show_bug.cgi?id=15993
1955
1956         * pcre/pcre_compile.cpp:
1957         (calculateCompiledPatternLengthAndFlags):
1958         (printCompiledRegExp):
1959         (returnError):
1960         (jsRegExpCompile):
1961         * pcre/pcre_internal.h:
1962         (compile_data::compile_data):
1963
1964 2007-11-14  Geoffrey Garen  <ggaren@apple.com>
1965
1966         Reviewed by Eric Seidel.
1967         
1968         Cleaned up the JavaScript grammar a bit.
1969         
1970         1. Changed BlockNode to always hold a child vector (which may be empty),
1971         eliminating a few NULL-check branches in the common execution case.
1972         
1973         2. Changed the Block production to correctly report its starting and 
1974         ending line numbers to the debugger. (It used to report its ending line
1975         as its starting line.) Also, removed duplicate line-reporting code
1976         inside the BlockNode constructor.
1977         
1978         3. Moved curly braces up from FunctionBody production into parent
1979         productions. (I had to move the line number reporting code, too, since
1980         it depends on the location of the curly braces.) This matches the ECMA
1981         spec more closely, and makes some future changes I plan easier.
1982         
1983         4. Fixed statementList* convenience functions to deal appropriately with
1984         empty Vectors.
1985
1986         SunSpider reports a small and statistically insignificant speedup.
1987
1988         * kjs/grammar.y:
1989         * kjs/nodes.cpp:
1990         (KJS::statementListPushFIFO):
1991         (KJS::statementListGetDeclarations):
1992         (KJS::statementListInitializeDeclarationStack):
1993         (KJS::statementListInitializeVariableAccessStack):
1994         (KJS::BlockNode::BlockNode):
1995         (KJS::BlockNode::optimizeVariableAccess):
1996         (KJS::BlockNode::getDeclarations):
1997         (KJS::BlockNode::execute):
1998         (KJS::FunctionBodyNode::initializeDeclarationStacks):
1999         (KJS::FunctionBodyNode::optimizeVariableAccess):
2000
2001 2007-11-13  Anders Carlsson  <andersca@apple.com>
2002
2003         Add RefCounted.h (And remove Shared.h)
2004         
2005         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
2006
2007 2007-11-13  Geoffrey Garen  <ggaren@apple.com>
2008
2009         Build fix.
2010
2011         * kjs/regexp.h:
2012
2013 2007-11-13  Geoffrey Garen  <ggaren@apple.com>
2014
2015         Reviewed by Anders Carlsson.
2016
2017         Renamed Shared to RefCounted.
2018
2019         * API/JSClassRef.h:
2020         * JavaScriptCore.xcodeproj/project.pbxproj:
2021         * kjs/interpreter.h:
2022         * kjs/regexp.h:
2023         * wtf/RefCounted.h: Copied from JavaScriptCore/wtf/Shared.h.
2024         (WTF::RefCounted::RefCounted):
2025         * wtf/Shared.h: Removed.
2026
2027 2007-11-13  Adam Roben  <aroben@apple.com>
2028
2029         Build fix
2030
2031         Reviewed by Geoff.
2032
2033         * kjs/regexp.h: Added a missing #include.
2034
2035 2007-11-13  Geoffrey Garen  <ggaren@apple.com>
2036
2037         Reviewed by Sam Weinig.
2038
2039         Moved Shared.h into wtf so it could be used in more places. Deployed
2040         Shared in places where JSCore previously had hand-rolled ref-counting
2041         classes.
2042
2043         * API/JSClassRef.cpp:
2044         (OpaqueJSClass::OpaqueJSClass):
2045         * API/JSClassRef.h:
2046         * API/JSObjectRef.cpp:
2047         (JSClassRetain):
2048         (JSClassRelease):
2049         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
2050         * JavaScriptCore.xcodeproj/project.pbxproj:
2051         * kjs/interpreter.cpp:
2052         (KJS::Interpreter::init):
2053         * kjs/interpreter.h:
2054         * kjs/regexp.cpp:
2055         (KJS::RegExp::RegExp):
2056         * kjs/regexp.h:
2057         * wtf/Shared.h: Copied from WebCore/platform/Shared.h.
2058
2059 2007-11-13  Eric Seidel  <eric@webkit.org>
2060
2061         Reviewed by Maciej.
2062
2063         Add an ASSERT to getTruncatedInt32 to enforce proper usage.
2064         Best part about this patch?  It doesn't break the web!
2065
2066         * kjs/JSImmediate.h:
2067         (KJS::JSImmediate::getTruncatedInt32):
2068         (KJS::JSImmediate::toDouble):
2069         (KJS::JSImmediate::getUInt32):
2070
2071 2007-11-13  Alexey Proskuryakov  <ap@webkit.org>
2072
2073         Windows build fix.
2074
2075         * bindings/c/c_utility.cpp:
2076         (KJS::Bindings::convertUTF8ToUTF16):
2077         * kjs/ustring.cpp:
2078         (KJS::UString::UTF8String):
2079         * wtf/unicode/UTF8.cpp:
2080         (WTF::Unicode::ConvertUTF8ToUTF16):
2081
2082 2007-11-13  Darin Adler  <darin@apple.com>
2083
2084         Reviewed by Geoff.
2085
2086         - fix http://bugs.webkit.org/show_bug.cgi?id=11231
2087           RegExp bug when handling newline characters
2088           and a number of other differences between PCRE behvior
2089           and JavaScript regular expressions:
2090
2091           + single-digit sequences like \4 should be treated as octal
2092             character constants, unless there is a sufficient number
2093             of brackets for them to be treated as backreferences
2094
2095           + \8 turns into the character "8", not a binary zero character
2096             followed by "8" (same for 9)
2097
2098           + only the first 3 digits should be considered part of an
2099             octal character constant (the old behavior was to decode
2100             an arbitrarily long sequence and then mask with 0xFF)
2101
2102           + if \x is followed by anything other than two valid hex digits,
2103             then it should simply be treated a the letter "x"; that includes
2104             not supporting the \x{41} syntax
2105
2106           + if \u is followed by anything less than four valid hex digits,
2107             then it should simply be treated a the letter "u"
2108
2109           + an extra "+" should be a syntax error, rather than being treated
2110             as the "possessive quantifier"
2111
2112           + if a "]" character appears immediately after a "[" character that
2113             starts a character class, then that's an empty character class,
2114             rather than being the start of a character class that includes a
2115             "]" character
2116
2117           + a "$" should not match a terminating newline; we could have gotten
2118             PCRE to handle this the way we wanted by passing an appropriate option
2119
2120         Test: fast/js/regexp-no-extensions.html
2121
2122         * pcre/pcre_compile.cpp:
2123         (check_escape): Check backreferences against bracount to catch both
2124         overflows and things that should be treated as octal. Rewrite octal
2125         loop to not go on indefinitely. Rewrite both hex loops to match and
2126         remove \x{} support.
2127         (compile_branch): Restructure loops so that we don't special-case a "]"
2128         at the beginning of a character class. Remove code that treated "+" as
2129         the possessive quantifier.
2130         (jsRegExpCompile): Change the "]" handling here too.
2131
2132         * pcre/pcre_exec.cpp: (match): Changed CIRC to match the DOLL implementation.
2133         Changed DOLL to remove handling of "terminating newline", a Perl concept
2134         which we don't need.
2135
2136         * tests/mozilla/expected.html: Two tests are fixed now:
2137         ecma_3/RegExp/regress-100199.js and ecma_3/RegExp/regress-188206.js.
2138         One test fails now: ecma_3/RegExp/perlstress-002.js -- our success before
2139         was due to a bug (we treated all 1-character numeric escapes as backreferences).
2140         The date tests also now both expect success -- whatever was making them fail
2141         before was probably due to the time being close to a DST shift; maybe we need
2142         to get rid of those tests.
2143
2144 2007-11-13  Darin Adler  <darin@apple.com>
2145
2146         * kjs/JSImmediate.h: (KJS::JSImmediate::getTruncatedInt32):
2147         Remove too-strong assert that was firing constantly and preventing even basic
2148         web browsing from working in a debug build. This function is used in many
2149         cases where the immediate value is not a number; the assertion could perhaps
2150         be added back later with a bit of reorganization.
2151
2152 2007-11-13  Alp Toker  <alp@atoker.com>
2153
2154         Build fix for breakage to non-Mac builds introduced in r27746.
2155
2156         * kjs/ustring.cpp:
2157
2158 2007-11-13  Eric Seidel  <eric@webkit.org>
2159
2160         Reviewed by Maciej.
2161
2162         Clean up evaluateToBoolean functions to use inlines instead of copy/paste code
2163
2164         * kjs/JSImmediate.h:
2165         * kjs/nodes.cpp:
2166         (KJS::GreaterNode::inlineEvaluateToBoolean):
2167         (KJS::GreaterNode::evaluate):
2168         (KJS::LessEqNode::inlineEvaluateToBoolean):
2169         (KJS::LessEqNode::evaluate):
2170         (KJS::GreaterEqNode::inlineEvaluateToBoolean):
2171         (KJS::GreaterEqNode::evaluate):
2172         (KJS::InNode::evaluateToBoolean):
2173         (KJS::EqualNode::inlineEvaluateToBoolean):
2174         (KJS::EqualNode::evaluate):
2175         (KJS::NotEqualNode::inlineEvaluateToBoolean):
2176         (KJS::NotEqualNode::evaluate):
2177         (KJS::StrictEqualNode::inlineEvaluateToBoolean):
2178         (KJS::StrictEqualNode::evaluate):
2179         (KJS::NotStrictEqualNode::inlineEvaluateToBoolean):
2180         (KJS::NotStrictEqualNode::evaluate):
2181         * kjs/nodes.h:
2182
2183 2007-11-12  Geoffrey Garen  <ggaren@apple.com>
2184
2185         Reviewed by Sam Weinig.
2186         
2187         Fixed http://bugs.webkit.org/show_bug.cgi?id=15958
2188         base64 spends 1.1% of total time checking for special Infinity case
2189         
2190         Use a fast character test instead of calling strncmp.
2191         
2192         1.1% speedup on string-base64. SunSpider reports a .4% speedup overall;
2193         Sharks reports only .1%. Who are you going to believe? Huh?
2194
2195         * kjs/ustring.cpp:
2196         (KJS::UString::toDouble):
2197
2198 2007-11-12  Eric Seidel  <eric@webkit.org>
2199
2200         Reviewed by Oliver.
2201
2202         Add evaluateToInt32 and evaluateUInt32 methods and deploy them.
2203         Fix a few missing evaluateToBoolean methods
2204         Deploy all evaluateTo* functions to more nodes to avoid slowdowns
2205         http://bugs.webkit.org/show_bug.cgi?id=15950
2206         
2207         SunSpider claims this is at least a 1.4% speedup.
2208
2209         * kjs/JSImmediate.h:
2210         (KJS::JSImmediate::getTruncatedInt32):
2211         (KJS::JSImmediate::toDouble):
2212         (KJS::JSImmediate::getUInt32):
2213         * kjs/nodes.cpp:
2214         (KJS::ExpressionNode::evaluateToNumber):
2215         (KJS::ExpressionNode::evaluateToInt32):
2216         (KJS::ExpressionNode::evaluateToUInt32):
2217         (KJS::NumberNode::evaluateToInt32):
2218         (KJS::NumberNode::evaluateToUInt32):
2219         (KJS::ImmediateNumberNode::evaluateToInt32):
2220         (KJS::ImmediateNumberNode::evaluateToUInt32):
2221         (KJS::ResolveNode::evaluate):
2222         (KJS::ResolveNode::evaluateToNumber):
2223         (KJS::ResolveNode::evaluateToBoolean):
2224         (KJS::ResolveNode::evaluateToInt32):
2225         (KJS::ResolveNode::evaluateToUInt32):
2226         (KJS::LocalVarAccessNode::evaluateToInt32):
2227         (KJS::LocalVarAccessNode::evaluateToUInt32):
2228         (KJS::BracketAccessorNode::evaluateToNumber):
2229         (KJS::BracketAccessorNode::evaluateToBoolean):
2230         (KJS::BracketAccessorNode::evaluateToInt32):
2231         (KJS::BracketAccessorNode::evaluateToUInt32):
2232         (KJS::DotAccessorNode::inlineEvaluate):
2233         (KJS::DotAccessorNode::evaluate):
2234         (KJS::DotAccessorNode::evaluateToNumber):
2235         (KJS::DotAccessorNode::evaluateToBoolean):
2236         (KJS::DotAccessorNode::evaluateToInt32):
2237         (KJS::DotAccessorNode::evaluateToUInt32):
2238         (KJS::NewExprNode::inlineEvaluate):
2239         (KJS::NewExprNode::evaluate):
2240         (KJS::NewExprNode::evaluateToNumber):
2241         (KJS::NewExprNode::evaluateToBoolean):
2242         (KJS::NewExprNode::evaluateToInt32):
2243         (KJS::NewExprNode::evaluateToUInt32):
2244         (KJS::FunctionCallResolveNode::inlineEvaluate):
2245         (KJS::FunctionCallResolveNode::evaluate):
2246         (KJS::FunctionCallResolveNode::evaluateToNumber):
2247         (KJS::FunctionCallResolveNode::evaluateToBoolean):
2248         (KJS::FunctionCallResolveNode::evaluateToInt32):
2249         (KJS::FunctionCallResolveNode::evaluateToUInt32):
2250         (KJS::LocalVarFunctionCallNode::evaluate):
2251         (KJS::LocalVarFunctionCallNode::evaluateToNumber):
2252         (KJS::LocalVarFunctionCallNode::evaluateToBoolean):
2253         (KJS::LocalVarFunctionCallNode::evaluateToInt32):
2254         (KJS::LocalVarFunctionCallNode::evaluateToUInt32):
2255         (KJS::FunctionCallDotNode::evaluate):
2256         (KJS::FunctionCallDotNode::evaluateToNumber):
2257         (KJS::FunctionCallDotNode::evaluateToBoolean):
2258         (KJS::FunctionCallDotNode::evaluateToInt32):
2259         (KJS::FunctionCallDotNode::evaluateToUInt32):
2260         (KJS::PostDecLocalVarNode::inlineEvaluateToNumber):
2261         (KJS::PostDecLocalVarNode::evaluateToNumber):
2262         (KJS::PostDecLocalVarNode::evaluateToBoolean):
2263         (KJS::PostDecLocalVarNode::evaluateToInt32):
2264         (KJS::PostDecLocalVarNode::evaluateToUInt32):
2265         (KJS::typeStringForValue):
2266         (KJS::UnaryPlusNode::evaluate):
2267         (KJS::UnaryPlusNode::evaluateToBoolean):
2268         (KJS::UnaryPlusNode::evaluateToNumber):
2269         (KJS::UnaryPlusNode::evaluateToInt32):
2270         (KJS::BitwiseNotNode::inlineEvaluateToInt32):
2271         (KJS::BitwiseNotNode::evaluate):
2272         (KJS::BitwiseNotNode::evaluateToNumber):
2273         (KJS::BitwiseNotNode::evaluateToBoolean):
2274         (KJS::BitwiseNotNode::evaluateToInt32):
2275         (KJS::MultNode::evaluateToBoolean):
2276         (KJS::MultNode::evaluateToInt32):
2277         (KJS::MultNode::evaluateToUInt32):
2278         (KJS::DivNode::evaluateToInt32):
2279         (KJS::DivNode::evaluateToUInt32):
2280         (KJS::ModNode::evaluateToBoolean):
2281         (KJS::ModNode::evaluateToInt32):
2282         (KJS::ModNode::evaluateToUInt32):
2283         (KJS::AddNode::evaluateToNumber):
2284         (KJS::AddNode::evaluateToInt32):
2285         (KJS::AddNode::evaluateToUInt32):
2286         (KJS::AddNumbersNode::evaluateToInt32):
2287         (KJS::AddNumbersNode::evaluateToUInt32):
2288         (KJS::SubNode::evaluateToInt32):
2289         (KJS::SubNode::evaluateToUInt32):
2290         (KJS::LeftShiftNode::inlineEvaluateToInt32):
2291         (KJS::LeftShiftNode::evaluate):
2292         (KJS::LeftShiftNode::evaluateToNumber):
2293         (KJS::LeftShiftNode::evaluateToInt32):
2294         (KJS::RightShiftNode::inlineEvaluateToInt32):
2295         (KJS::RightShiftNode::evaluate):
2296         (KJS::RightShiftNode::evaluateToNumber):
2297         (KJS::RightShiftNode::evaluateToInt32):
2298         (KJS::UnsignedRightShiftNode::inlineEvaluateToUInt32):
2299         (KJS::UnsignedRightShiftNode::evaluate):
2300         (KJS::UnsignedRightShiftNode::evaluateToNumber):
2301         (KJS::UnsignedRightShiftNode::evaluateToInt32):
2302         (KJS::LessNode::inlineEvaluateToBoolean):
2303         (KJS::LessNode::evaluate):
2304         (KJS::LessNode::evaluateToBoolean):
2305         (KJS::LessNumbersNode::inlineEvaluateToBoolean):
2306         (KJS::LessNumbersNode::evaluate):
2307         (KJS::LessNumbersNode::evaluateToBoolean):
2308         (KJS::LessStringsNode::inlineEvaluateToBoolean):
2309         (KJS::LessStringsNode::evaluate):
2310         (KJS::BitAndNode::evaluate):
2311         (KJS::BitAndNode::inlineEvaluateToInt32):
2312         (KJS::BitAndNode::evaluateToNumber):
2313         (KJS::BitAndNode::evaluateToBoolean):
2314         (KJS::BitAndNode::evaluateToInt32):
2315         (KJS::BitXOrNode::inlineEvaluateToInt32):
2316         (KJS::BitXOrNode::evaluate):
2317         (KJS::BitXOrNode::evaluateToNumber):
2318         (KJS::BitXOrNode::evaluateToBoolean):
2319         (KJS::BitXOrNode::evaluateToInt32):
2320         (KJS::BitOrNode::inlineEvaluateToInt32):
2321         (KJS::BitOrNode::evaluate):
2322         (KJS::BitOrNode::evaluateToNumber):
2323         (KJS::BitOrNode::evaluateToBoolean):
2324         (KJS::BitOrNode::evaluateToInt32):
2325         (KJS::ConditionalNode::evaluateToNumber):
2326         (KJS::ConditionalNode::evaluateToInt32):
2327         (KJS::ConditionalNode::evaluateToUInt32):
2328         (KJS::valueForReadModifyAssignment):
2329         (KJS::AssignExprNode::evaluate):
2330         (KJS::AssignExprNode::evaluateToBoolean):
2331         (KJS::AssignExprNode::evaluateToNumber):
2332         (KJS::AssignExprNode::evaluateToInt32):
2333         (KJS::VarDeclNode::handleSlowCase):
2334         * kjs/nodes.h:
2335         (KJS::FunctionCallResolveNode::precedence):
2336         (KJS::AddNode::precedence):
2337         (KJS::AddNode::):
2338         (KJS::LessNumbersNode::):
2339         (KJS::LessStringsNode::):
2340         * kjs/value.cpp:
2341         (KJS::JSValue::toInt32SlowCase):
2342         (KJS::JSValue::toUInt32SlowCase):
2343         * kjs/value.h:
2344         (KJS::JSValue::asCell):
2345         (KJS::JSValue::toInt32):
2346         (KJS::JSValue::toUInt32):
2347
2348 2007-11-12  Alexey Proskuryakov  <ap@webkit.org>
2349
2350         Reviewed by Darin.
2351
2352         http://bugs.webkit.org/show_bug.cgi?id=15953
2353         Add UTF-8 encoding/decoding to WTF
2354
2355         * kjs/ustring.h: Moved UTF8SequenceLength() and decodeUTF8Sequence() to wtf/unicode.
2356         * kjs/ustring.cpp: (KJS::UString::UTF8String): Changed this function to take a strict/lenient
2357         parameter. Callers are not interested in getting decoding results in strict mode, so 
2358         this allows for bailing out as soon as an error is seen.
2359
2360         * kjs/function.cpp:
2361         (KJS::encode): Updated for new UString::UTF8String() signature.
2362
2363         * API/JSStringRef.cpp:
2364         (JSStringCreateWithCharacters): Disambiguate UChar.
2365         (JSStringCreateWithUTF8CString): Actually use UTF-8 when creating the string!
2366         * bindings/c/c_utility.cpp: (KJS::Bindings::convertUTF8ToUTF16): Use ConvertUTF8ToUTF16().
2367
2368         * wtf/unicode/UTF8.cpp: Added.
2369         (WTF::Unicode::inlineUTF8SequenceLengthNonASCII):
2370         (WTF::Unicode::inlineUTF8SequenceLength):
2371         (WTF::Unicode::UTF8SequenceLength):
2372         (WTF::Unicode::decodeUTF8Sequence):
2373         (WTF::Unicode::):
2374         (WTF::Unicode::ConvertUTF16ToUTF8):
2375         (WTF::Unicode::isLegalUTF8):
2376         (WTF::Unicode::ConvertUTF8ToUTF16):
2377         * wtf/unicode/UTF8.h: Added.
2378         (WTF::Unicode::):
2379         Some code moved from ustring.h, some adapted from unicode.org sources.
2380
2381         * JavaScriptCore.exp:
2382         * JavaScriptCore.pri:
2383         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
2384         * JavaScriptCore.xcodeproj/project.pbxproj:
2385         * JavaScriptCoreSources.bkl:
2386         Added UTF8.{h,cpp}
2387
2388 2007-11-12  Josh Aas  <joshmoz@gmail.com>
2389
2390         Reviewed by Darin.
2391
2392         - http://bugs.webkit.org/show_bug.cgi?id=15946
2393           add NPPValue NPPVpluginDrawingModel (Mozilla bug 403418 compat)
2394
2395         * bindings/npapi.h:
2396
2397 2007-11-12  Darin Adler  <darin@apple.com>
2398
2399         Reviewed by Sam.
2400
2401         - http://bugs.webkit.org/show_bug.cgi?id=15951
2402           REGRESSION: assertion failure in regexp match() when running JS tests
2403
2404         Test: fast/js/regexp-many-brackets.html
2405
2406         * pcre/pcre_exec.cpp: (match): Added back accidentally-removed case for
2407         the BRANUMBER opcode.
2408
2409 2007-11-12  Darin Adler  <darin@apple.com>
2410
2411         Reviewed by Geoff.
2412
2413         - fix use of prefix and config.h, got rid of a few unneeded things in
2414           the PCRE code; no behavior changes
2415
2416         * API/JSBase.cpp: Added include of config.h.
2417         * API/JSCallbackConstructor.cpp: Ditto.
2418         * API/JSCallbackFunction.cpp: Ditto.
2419         * API/JSCallbackObject.cpp: Ditto.
2420         * API/JSClassRef.cpp: Ditto.
2421         * API/JSContextRef.cpp: Ditto.
2422         * API/JSObjectRef.cpp: Ditto.
2423         * API/JSStringRef.cpp: Ditto.
2424         * API/JSValueRef.cpp: Ditto.
2425
2426         * JavaScriptCorePrefix.h: Removed obsolete <ctype.h> workaround.
2427         Moved new/delete macros after includes, as they are in WebCore's prefix.
2428         Removed "config.h".
2429
2430         * pcre/dftables.cpp: (main): Changed back to not use a separate maketables
2431         function. This is needed for PCRE, but not helpful for our use. Also changed
2432         the tables to all be 128 entries long instead of 256, since only the first
2433         128 are ever used.
2434
2435         * pcre/pcre_compile.cpp: Added include of config.h. Eliminated digitab,
2436         which was only being used to check hex digits. Changed all uses of TRUE and
2437         FALSE to use the C++ true and false instead.
2438         (check_escape): Just the TRUE/FALSE thing.
2439         (is_counted_repeat): Ditto.
2440         (could_be_empty_branch): Ditto.
2441         (get_othercase_range): Ditto.
2442         (compile_branch): Ditto.
2443         (compile_regex): Ditto.
2444         (is_anchored): Ditto.
2445         (is_startline): Ditto.
2446         (find_firstassertedchar): Ditto.
2447         (jsRegExpCompile): Ditto.
2448
2449         * pcre/pcre_exec.cpp: Added include of config.h. Changed all uses of TRUE and
2450         FALSE to use the C++ true and false instead.
2451         (match_ref): Just the TRUE/FALSE thing.
2452         (match): Ditto. Removed some unneeded braces.
2453         (jsRegExpExecute): Just the TRUE/FALSE thing.
2454
2455         * pcre/pcre_internal.h: Moved the constants needed by dftables.cpp to the top
2456         of the file instead of the bottom, so they can be used. Also changed the table
2457         sizes to 128 instead of 256. Removed macro definitions of FALSE and TRUE.
2458         Set array sizes for all the const arrays. Changed _pcre_utf8_table1_size to
2459         be a macro instead of a extern int.
2460
2461         * pcre/pcre_maketables.cpp: Removed. It's all in dftables.cpp now.
2462
2463         * pcre/pcre_tables.cpp: Made table sizes explicit.
2464
2465         * pcre/pcre_xclass.cpp: Just the TRUE/FALSE thing.
2466
2467 2007-11-12  Adam Roben  <aroben@apple.com>
2468
2469         Build fix
2470
2471         * wtf/FastMalloc.h: Add missing using statement.
2472
2473 2007-11-11  Oliver Hunt  <oliver@apple.com>
2474
2475         Reviewed by Darin.
2476
2477         Add special fastZeroedMalloc function to replace a 
2478         number of fastCalloc calls where one argument was 1.
2479         
2480         This results in a 0.4% progression in SunSpider, more
2481         than making up for the earlier regression caused by 
2482         additional overflow checks.
2483
2484         * JavaScriptCore.exp:
2485         * kjs/array_instance.cpp:
2486         * kjs/property_map.cpp:
2487         * wtf/FastMalloc.cpp:
2488         * wtf/FastMalloc.h:
2489         * wtf/HashTable.h:
2490
2491 2007-11-11  Adam Roben  <aroben@apple.com>
2492
2493         Fix <rdar://5578982> ASSERT in HashTable::checkTableConsistencyExceptSize beneath WebNotificationCenter
2494
2495         The bug was due to a mismatch between HashMap::remove and
2496         HashTable::checkTableConsistency. HashMap::remove can delete the value
2497         stored in the HashTable (by derefing it), which is not normally
2498         allowed by HashTable. It's OK in this case because the value is about
2499         to be removed from the table, but HashTable wasn't aware of this.
2500
2501         HashMap::remove now performs the consistency check itself before
2502         derefing the value.
2503
2504         Darin noticed that the same bug would occur in HashSet, so I've fixed
2505         it there as well.
2506
2507         Reviewed by Darin.
2508
2509         * wtf/HashMap.h:
2510         (WTF::HashMap::remove): Perform the HashTable consistency check
2511         manually before calling deref.
2512         * wtf/HashSet.h:
2513         (WTF::HashSet::remove): Ditto.
2514         * wtf/HashTable.h: Made checkTableConsistency public so that HashMap
2515         and HashSet can call it.
2516         (WTF::HashTable::removeAndInvalidateWithoutEntryConsistencyCheck):
2517         Added.
2518         (WTF::HashTable::removeAndInvalidate): Added.
2519         (WTF::HashTable::remove):
2520         (WTF::HashTable::removeWithoutEntryConsistencyCheck): Added.
2521
2522 2007-11-11  Mark Rowe  <mrowe@apple.com>
2523
2524         Build fix.  Use the correct filename case.
2525
2526         * kjs/nodes.h:
2527
2528 2007-11-11  Geoffrey Garen  <ggaren@apple.com>
2529
2530         Reviewed by Sam Weinig.
2531         
2532         Fixed http://bugs.webkit.org/show_bug.cgi?id=15902
2533         15% of string-validate-input.js is spent compiling the same regular expression
2534         
2535         Store a compiled representation of the regular expression in the AST.
2536         
2537         Only a .2% SunSpider speedup overall, but a 10.6% speedup on 
2538         string-validate-input.js.
2539
2540         * kjs/nodes.cpp:
2541         (KJS::RegExpNode::evaluate):
2542         * kjs/nodes.h:
2543         (KJS::RegExpNode::):
2544         * kjs/nodes2string.cpp:
2545         (KJS::RegExpNode::streamTo):
2546         * kjs/regexp.cpp:
2547         (KJS::RegExp::flags):
2548         * kjs/regexp.h:
2549         (KJS::RegExp::pattern):
2550         * kjs/regexp_object.cpp:
2551         (KJS::RegExpObjectImp::construct):
2552         (KJS::RegExpObjectImp::createRegExpImp):
2553         * kjs/regexp_object.h:
2554
2555 2007-11-11  Oliver Hunt  <oliver@apple.com>
2556
2557         Reviewed by Eric.
2558
2559         Partial fix for <rdar://problem/5585334> numfuzz: integer overflows opening malformed SVG file in WebCore::ImageBuffer::create
2560
2561         Unfortunately this is a very slight regression, but is unavoidable.
2562
2563         * wtf/FastMalloc.cpp:
2564
2565 2007-11-10  Eric Seidel  <eric@webkit.org>
2566
2567         Reviewed by darin.
2568         
2569         Add simple type inferencing to the parser, and create custom
2570         AddNode and LessNode subclasses based on inferred types.
2571         http://bugs.webkit.org/show_bug.cgi?id=15884
2572         
2573         SunSpider claims this is at least a 0.5% speedup.
2574
2575         * JavaScriptCore.exp:
2576         * kjs/grammar.y:
2577         * kjs/internal.cpp:
2578         (KJS::NumberImp::getPrimitiveNumber):
2579         (KJS::GetterSetterImp::getPrimitiveNumber):
2580         * kjs/internal.h:
2581         * kjs/lexer.cpp:
2582         (KJS::Lexer::lex):
2583         * kjs/nodes.cpp:
2584         (KJS::Node::Node):
2585         (KJS::StringNode::evaluate):
2586         (KJS::StringNode::evaluateToNumber):
2587         (KJS::StringNode::evaluateToBoolean):
2588         (KJS::RegExpNode::evaluate):
2589         (KJS::UnaryPlusNode::optimizeVariableAccess):
2590         (KJS::AddNode::evaluate):
2591         (KJS::AddNode::evaluateToNumber):
2592         (KJS::AddNumbersNode::inlineEvaluateToNumber):
2593         (KJS::AddNumbersNode::evaluate):
2594         (KJS::AddNumbersNode::evaluateToNumber):
2595         (KJS::AddStringsNode::evaluate):
2596         (KJS::AddStringLeftNode::evaluate):
2597         (KJS::AddStringRightNode::evaluate):
2598         (KJS::lessThan):
2599         (KJS::lessThanEq):
2600         (KJS::LessNumbersNode::evaluate):
2601         (KJS::LessStringsNode::evaluate):
2602         * kjs/nodes.h:
2603         (KJS::ExpressionNode::):
2604         (KJS::RegExpNode::):
2605         (KJS::RegExpNode::precedence):
2606         (KJS::TypeOfResolveNode::):
2607         (KJS::LocalVarTypeOfNode::):
2608         (KJS::UnaryPlusNode::):
2609         (KJS::UnaryPlusNode::precedence):
2610         (KJS::AddNode::):
2611         (KJS::AddNode::precedence):
2612         (KJS::AddNumbersNode::):
2613         (KJS::AddStringLeftNode::):
2614         (KJS::AddStringRightNode::):
2615         (KJS::AddStringsNode::):
2616         (KJS::LessNode::):
2617         (KJS::LessNode::precedence):
2618         (KJS::LessNumbersNode::):
2619         (KJS::LessStringsNode::):
2620         * kjs/nodes2string.cpp:
2621         (KJS::StringNode::streamTo):
2622         * kjs/object.cpp:
2623         * kjs/object.h:
2624         * kjs/value.h:
2625         (KJS::JSValue::getPrimitiveNumber):
2626
2627 2007-11-11  Darin Adler  <darin@apple.com>
2628
2629         - try another way of fixing dftables builds -- refactor pcre_internal.h a bit
2630
2631         * pcre/pcre_internal.h: Make most of this header do nothing when DFTABLES is set.
2632         Later we can break it into two files.
2633
2634         * JavaScriptCore.vcproj/dftables/dftables.vcproj: Take out now-unneeded include paths.
2635         * pcre/dftables.cpp: Set DFTABLES. Use delete instead of free.
2636         * pcre/dftables.pro: Take out now-unneeded include paths.
2637         * pcre/pcre_maketables.cpp: Use new instead of malloc.
2638
2639 2007-11-11  Darin Adler  <darin@apple.com>
2640
2641         * pcre/dftables.pro: Try fixing Qt builds (I looked at qt-win) by adding
2642         another include path.
2643
2644 2007-11-11  Darin Adler  <darin@apple.com>
2645
2646         * JavaScriptCore.xcodeproj/project.pbxproj: Try fixing Mac Tiger builds
2647         by adding another include path.
2648
2649 2007-11-11  Darin Adler  <darin@apple.com>
2650
2651         Reviewed by Sam.
2652
2653         - http://bugs.webkit.org/show_bug.cgi?id=15924
2654           next round of changes to JSRegExp (formerly PCRE)
2655
2656         This is a combination of converting to C++, tweaking the API, and adding
2657         some additional optimizations.
2658
2659         Future steps will involve getting rid of the use of UTF-8 completely
2660         (we'll use UTF-16 exclusively instead), eliminating more source files,
2661         and some more speed-ups.
2662
2663         SunSpider says the current round is an 0.9% speed-up overall, and a
2664         5.3% speed-up for regexp.
2665
2666         * JavaScriptCore.exp: Updated for new entry points.
2667
2668         * JavaScriptCore.pri:
2669         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2670         * JavaScriptCore.vcproj/dftables/dftables.vcproj:
2671         * JavaScriptCore.xcodeproj/project.pbxproj:
2672         * JavaScriptCoreSources.bkl:
2673         * jscore.bkl:
2674         Updated for new source file names and ForwardingHeaders.
2675
2676         * kjs/regexp.cpp:
2677         (KJS::RegExp::RegExp): Changed to use the error message without calling
2678         strdup on it and to pass the new types and options.
2679         (KJS::RegExp::~RegExp): Removed the now-unneeded free of the error message.
2680         (KJS::RegExp::match): Pass the new types and options.
2681         * kjs/regexp.h: Update type of m_constructionError.
2682
2683         * pcre/AUTHORS: Update to reflect the status of the project -- we don't include
2684         the Google parts, and this isn't the PCRE library, per se.
2685         * pcre/COPYING: Ditto.
2686
2687         * pcre/dftables.cpp: Copied from JavaScriptCore/pcre/dftables.c.
2688         (main): Removed unneeded ctype_digit.
2689
2690         * pcre/pcre.h: Convert to C++, tweak API a bit. Use UChar instead of JSRegExpChar.
2691
2692         * pcre/pcre_compile.cpp: Copied from JavaScriptCore/pcre/pcre_compile.c.
2693         Moved a lot of private stuff used only within this file here from pcre_internal.h.
2694         Renumbered the error codes.
2695         (error_text): Use a single string with embedded nulls for the error text (I got
2696         this idea from newer versions of PCRE).
2697         (check_escape): Changed return type to be enum instead of int. Replaced ctype_digit
2698         uses with isASCIIDigit.
2699         (is_counted_repeat): Ditto.
2700         (read_repeat_counts): Ditto.
2701         (first_significant_code): Ditto.
2702         (find_fixedlength): Ditto.
2703         (could_be_empty_branch): Ditto.
2704         (compile_branch): Ditto. Also removed some code that handles changing options.
2705         JavaScript doesn't have any of the features that allow options to change.
2706         (compile_regex): Updated for change to options parameter.
2707         (is_anchored): Ditto.
2708         (find_firstassertedchar): Ditto.
2709         (jsRegExpCompile): Changed to take separate flags instead of an options int.
2710         Also changed to call new/delete instead of pcre_malloc/free.
2711         (jsRegExpFree): Ditto.
2712
2713         * pcre/pcre_exec.cpp: Copied from JavaScriptCore/pcre/pcre_exec.c.
2714         Added a case that uses computed goto for the opcode loop, but did not turn it on.
2715         Changed the RMATCH macro to handle returns more efficiently by putting the where
2716         pointer in the new frame instead of the old one, allowing us to branch to the
2717         return with a single statement. Switched to new/delete from pcre_malloc/free.
2718         Changed many RRETURN callers to not set the return value since it's already
2719         set correctly. Replaced the rrc variable with an is_match variable. Values other
2720         than "match" and "no match" are now handled differently. This allows us to remove
2721         the code to check for those cases in various rules.
2722         (match): All the case statements use a macro BEGIN_OPCODE instead. And all the
2723         continue statements, or break statements that break out of the outer case use
2724         a macro NEXT_OPCODE instead. Replaced a few if statements with assertions.
2725         (jsRegExpExecute): Use new/delete instead of pcre_malloc/free. Removed unused
2726         start_match field from the match block.
2727
2728         * pcre/pcre_internal.h: Moved the last few configuration macros from pcre-config.h
2729         in here. Removed various unused types. Converted from JSRegExpChar to UChar.
2730         Eliminated pcre_malloc/free. Replaced the opcode enum with a macro that can be
2731         used in multiple places. Unfortunately we lose the comments for each opcode; we
2732         should find a place to put those back. Removed ctype_digit.
2733
2734         * pcre/pcre_maketables.cpp: Copied from JavaScriptCore/pcre/pcre_maketables.c.
2735         (pcre_maketables): Got rid of the conditional code that allows this to be compiled
2736         in -- it's only used for dftables now (and soon may be obsolete entirely).
2737         Changed code for cbit_digit to not use isdigit, and took the "_" case out of the
2738         loop. Removed ctype_digit.
2739
2740         * pcre/pcre_ord2utf8.cpp: Copied from JavaScriptCore/pcre/pcre_ord2utf8.c.
2741
2742         * pcre/pcre_tables.cpp: Copied from JavaScriptCore/pcre/pcre_tables.c.
2743         Moved _pcre_OP_lengths out of here into pcre_exec.cpp.
2744
2745         * pcre/pcre_ucp_searchfuncs.cpp: Copied from JavaScriptCore/pcre/pcre_ucp_searchfuncs.c.
2746         Updated for other file name changes.
2747
2748         * pcre/pcre_xclass.cpp: Copied from JavaScriptCore/pcre/pcre_xclass.c.
2749
2750         * pcre/ucpinternal.h: Updated header.
2751
2752         * pcre/ucptable.cpp: Copied from JavaScriptCore/pcre/ucptable.c.
2753
2754         * wtf/ASCIICType.h: (WTF::isASCIIDigit): Removed a branch by changing from && to
2755         & for this operation. Also added an overload that takes an int because that's
2756         useful for PCRE. Later we could optimize for int and overload other functions in
2757         this file; stuck to this simple one for now.
2758
2759         * wtf/unicode/icu/UnicodeIcu.h: Removed unused isUpper.
2760         * wtf/unicode/qt4/UnicodeQt4.h: Ditto.
2761
2762         * pcre/LICENCE: Removed.
2763         * pcre/pcre-config.h: Removed.
2764         * wtf/FastMallocPCRE.cpp: Removed.
2765
2766         * pcre/dftables.c: Renamed to cpp.
2767         * pcre/pcre_compile.c: Ditto.
2768         * pcre/pcre_exec.c: Ditto.
2769         * pcre/pcre_maketables.c: Ditto.
2770         * pcre/pcre_ord2utf8.c: Ditto.
2771         * pcre/pcre_tables.c: Ditto.
2772         * pcre/pcre_ucp_searchfuncs.c: Ditto.
2773         * pcre/pcre_xclass.c: Ditto.
2774         * pcre/ucptable.c: Ditto.
2775
2776 2007-11-11  Eric Seidel  <eric@webkit.org>
2777
2778         Reviewed by Oliver.
2779
2780         Add KJS_CHECKEXCEPTIONBOOLEAN to match rest of nodes.cpp
2781
2782         * kjs/nodes.cpp:
2783         (KJS::ExpressionNode::evaluateToBoolean):
2784         (KJS::LessNode::evaluateToBoolean):
2785         (KJS::GreaterNode::evaluateToBoolean):
2786         (KJS::LessEqNode::evaluateToBoolean):
2787         (KJS::GreaterEqNode::evaluateToBoolean):
2788         (KJS::InstanceOfNode::evaluateToBoolean):
2789         (KJS::InNode::evaluateToBoolean):
2790         (KJS::EqualNode::evaluateToBoolean):
2791         (KJS::NotEqualNode::evaluateToBoolean):
2792         (KJS::StrictEqualNode::evaluateToBoolean):
2793         (KJS::NotStrictEqualNode::evaluateToBoolean):
2794         (KJS::LogicalAndNode::evaluateToBoolean):
2795         (KJS::LogicalOrNode::evaluateToBoolean):
2796         (KJS::ConditionalNode::evaluateToBoolean):
2797
2798 2007-11-10  Darin Adler  <darin@apple.com>
2799
2800         Reviewed by Sam.
2801
2802         - fix http://bugs.webkit.org/show_bug.cgi?id=15927
2803           REGRESSION(r27487): delete a.c followed by __defineGetter__("c", ...) incorrectly deletes another property
2804           and <rdar://problem/5586384> REGRESSION (r27487): Can't switch out of Edit HTML Source mode on Leopard Wiki
2805
2806         Test: fast/js/delete-then-put.html
2807
2808         * kjs/property_map.cpp:
2809         (KJS::PropertyMap::put): Added a missing "- 1"; code to find an empty slot was not working.
2810         (KJS::PropertyMap::checkConsistency): Added a missing range check that would have caught this
2811         problem before.
2812
2813         - roll out a last-minute change to my evaluateToBoolean patch that was incorrect.
2814
2815         * kjs/nodes.h: (KJS::ExprStatementNode::ExprStatementNode): Take out call to
2816         optimizeForUnnecessaryResult, since the result is used in some cases.
2817
2818 2007-11-10  Adam Roben  <aroben@apple.com>
2819
2820         Windows build fix
2821
2822         Roll out some changes that were (seemingly accidentally) checked in
2823         with r27664.
2824
2825         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2826
2827 2007-11-10  Darin Adler  <darin@apple.com>
2828
2829         Reviewed by Sam.
2830
2831         - http://bugs.webkit.org/show_bug.cgi?id=15915
2832           add an evaluation path for booleans like the one we have for numbers
2833
2834         Gives 1.1% on SunSpider.
2835
2836         * kjs/grammar.y: Create TrueNode and FalseNode instead of BooleanNode.
2837
2838         * kjs/nodes.h: Changed to use Noncopyable. Moved optimizeForUnnecessaryResult
2839         down from Node to ExpressionNode. Changed some classes to not inherit from
2840         ExpressionNode where not necessary, and removed unnneeded evaluate functions
2841         as well as evaluate functions that need not be virtual. Call the
2842         optimizeForUnnecessaryResult function on the start of a for loop too.
2843         * kjs/nodes.cpp:
2844         (KJS::ExpressionNode::evaluateToBoolean): Added.
2845         (KJS::FalseNode::evaluate): Added.
2846         (KJS::TrueNode::evaluate): Added.
2847         (KJS::NumberNode::evaluateToBoolean): Added.
2848         (KJS::StringNode::evaluateToBoolean): Added.
2849         (KJS::LocalVarAccessNode::evaluateToBoolean): Added.
2850         (KJS::BracketAccessorNode::evaluateToBoolean): Added.
2851         (KJS::LogicalNotNode::evaluate): Changed to call evaluateToBoolean.
2852         (KJS::LogicalNotNode::evaluateToBoolean): Added.
2853         (KJS::lessThan): Changed to return bool.
2854         (KJS::lessThanEq): Ditto.
2855         (KJS::LessNode::evaluate): Changed since lessThan returns bool.
2856         (KJS::LessNode::evaluateToBoolean): Added.
2857         (KJS::GreaterNode::evaluate): Changed since lessThanEq returns bool.
2858         (KJS::GreaterNode::evaluateToBoolean): Added.
2859         (KJS::LessEqNode::evaluate): Changed since lessThanEq returns bool.
2860         (KJS::LessEqNode::evaluateToBoolean): Added.
2861         (KJS::GreaterEqNode::evaluate): Changed since lessThan returns bool.
2862         (KJS::GreaterEqNode::evaluateToBoolean): Added.
2863         (KJS::InstanceOfNode::evaluateToBoolean): Added.
2864         (KJS::InNode::evaluateToBoolean): Added.
2865         (KJS::EqualNode::evaluateToBoolean): Added.
2866         (KJS::NotEqualNode::evaluateToBoolean): Added.
2867         (KJS::StrictEqualNode::evaluateToBoolean): Added.
2868         (KJS::NotStrictEqualNode::evaluateToBoolean): Added.
2869         (KJS::ConditionalNode::evaluate): Changed to call evaluateToBoolean.
2870         (KJS::IfNode::execute): Ditto.
2871         (KJS::DoWhileNode::execute): Ditto.
2872         (KJS::WhileNode::execute): Ditto.
2873         (KJS::ForNode::execute): Ditto.
2874
2875         * kjs/nodes2string.cpp:
2876         (KJS::FalseNode::streamTo): Added.
2877         (KJS::TrueNode::streamTo): Added.
2878
2879 2007-11-09  Adam Roben  <aroben@apple.com>
2880
2881         Windows build fix
2882
2883         Reviewed by Darin.
2884
2885         * kjs/value.h:
2886         (KJS::jsNumber): Add some explicit casts.
2887
2888 2007-11-08  Darin Adler  <darin@apple.com>
2889
2890         - fix build
2891
2892         * kjs/grammar.y:
2893         * kjs/nodes.h:
2894         * kjs/property_map.cpp:
2895
2896 2007-11-08  Darin Adler  <darin@apple.com>
2897
2898         - roll out accidentally-checked in changes
2899
2900         * kjs/nodes.cpp: Back to previous version.
2901         * kjs/nodes.h: Ditto.
2902         * kjs/grammar.y: Ditto.
2903
2904 2007-11-08  Darin Adler  <darin@apple.com>
2905
2906         Reviewed by Maciej.
2907
2908         - http://bugs.webkit.org/show_bug.cgi?id=15912
2909           fasta spends a lot of time in qsort
2910
2911         * kjs/property_map.cpp:
2912         (KJS::PropertyMap::getEnumerablePropertyNames):
2913         Use insertion sort instead of qsort for small sets of property names.
2914         We can probably do some even-better speedups of for/in, but this nets
2915         0.6% overall and 6.7% on fasta.
2916
2917 2007-11-08  Darin Adler  <darin@apple.com>
2918
2919         Reviewed by Maciej.
2920
2921         - http://bugs.webkit.org/show_bug.cgi?id=15906
2922           getting characters by indexing into a string is very slow
2923
2924         This fixes one source of the slowness -- the conversion to an unused
2925         Identifier as we call the get function from the slot -- but doesn't
2926         fix others, such as the fact that we have to allocate a new UString::Rep
2927         for every single character.
2928
2929         Speeds up string-base64 30%, and at least 0.5% overall.
2930         But does slow down access-fannkuch quite a bit. Might be worth
2931         revisiting in the future to see what we can do about that (although
2932         I did look at a profile for a while).
2933
2934         * kjs/property_slot.h: Add a new marker for "numeric" property slots;
2935         slots where we don't need to pass the identifier to the get function.
2936         (KJS::PropertySlot::getValue): Added code to call the numeric get function.
2937         (KJS::PropertySlot::setCustomNumeric): Added.
2938         * kjs/string_object.cpp:
2939         (KJS::StringInstance::indexGetter): Changed to use substr() instead
2940         of constructing a wholly new UString each time.
2941         (KJS::stringInstanceNumericPropertyGetter): Added. Like indexGetter, but
2942         takes advantage of setCustomNumeric to avoid creating an Identifier.
2943         (KJS::StringInstance::getOwnPropertySlot): Changed to use setCustomNumeric.
2944
2945 2007-11-08  Darin Adler  <darin@apple.com>
2946
2947         Reviewed by Oliver.
2948
2949         - http://bugs.webkit.org/show_bug.cgi?id=15904
2950           more speed-ups possible by tightening up int version of JSImmediate
2951
2952         1% improvement of SunSpider
2953
2954         * kjs/JSImmediate.h: Eliminate the now-unneeded FPBitValues struct template.
2955         (KJS::JSImmediate::from): Overload for most numeric types; many types can
2956         do fewer branches and checks.
2957         (KJS::JSImmediate::getUInt32): Removed unneeded check for undefined.
2958         (KJS::JSImmediate::getTruncatedInt32): Ditto.
2959         (KJS::JSImmediate::getTruncatedUInt32): Ditto. There's no difference any more
2960         between getUInt32 and getTruncatedUInt32, so that's worth a rename and merge later.
2961
2962         * kjs/grammar.y: Update since fromDouble is now just from.
2963         * kjs/nodes.h: Ditto.
2964
2965         * kjs/value.h: (KJS::jsNumber): Overload for most numeric types.
2966
2967 2007-11-08  Kevin Ollivier  <kevino@theolliviers.com>
2968
2969         Bakefiles for building JavaScriptCore, needed by wx port.
2970
2971         Reviewed by Mark Rowe.
2972
2973         * JavaScriptCoreSources.bkl: Added.
2974         * jscore.bkl: Added.
2975
2976 2007-11-08  Oliver Hunt  <oliver@apple.com>
2977
2978         Reviewed by Maciej.
2979
2980         Fix regression caused by earlier bitwise and optimisation.  1 & undefined != 1.
2981
2982         The implementation of JSImmediate::areBothImmediateNumbers relies on 
2983         (JSImmediate::getTag(immediate1) & JSImmediate::getTag(immediate2)) having 
2984         a unique result when both immediate values are numbers.
2985
2986         The regression was due to UndefinedType & NumberType returning NumberType (3 & 1).
2987         By swapping the value of NumberType and UndefinedType this ceases to be a problem.
2988
2989         * kjs/JSType.h:
2990         (KJS::):
2991
2992 2007-11-08  Darin Adler  <darin@apple.com>
2993
2994         - fix build
2995
2996         * kjs/nodes.h: Add missing parameter name.
2997
2998 2007-11-08  Eric Seidel  <eric@webkit.org>
2999
3000         Reviewed by darin.
3001
3002         Add ExpressionNode subclass of Node, use it.
3003
3004         * kjs/grammar.y:
3005         * kjs/nodes.cpp:
3006         (KJS::ForInNode::ForInNode):
3007         * kjs/nodes.h:
3008         (KJS::ExpressionNode::):
3009         (KJS::NullNode::):
3010         (KJS::NullNode::precedence):
3011         (KJS::BooleanNode::):
3012         (KJS::BooleanNode::precedence):
3013         (KJS::RegExpNode::):
3014         (KJS::RegExpNode::precedence):
3015         (KJS::ThisNode::):
3016         (KJS::ThisNode::precedence):
3017         (KJS::ResolveNode::):
3018         (KJS::ElementNode::):
3019         (KJS::ArrayNode::):
3020         (KJS::PropertyNode::):
3021         (KJS::PropertyNode::precedence):
3022         (KJS::PropertyNode::name):
3023         (KJS::PropertyListNode::):
3024         (KJS::ObjectLiteralNode::):
3025         (KJS::ObjectLiteralNode::precedence):
3026         (KJS::BracketAccessorNode::):
3027         (KJS::DotAccessorNode::):
3028         (KJS::DotAccessorNode::precedence):
3029         (KJS::ArgumentListNode::):
3030         (KJS::ArgumentsNode::):
3031         (KJS::NewExprNode::):
3032         (KJS::NewExprNode::precedence):
3033         (KJS::FunctionCallValueNode::):
3034         (KJS::FunctionCallValueNode::precedence):
3035         (KJS::FunctionCallResolveNode::):
3036         (KJS::FunctionCallBracketNode::):
3037         (KJS::FunctionCallBracketNode::precedence):
3038         (KJS::FunctionCallDotNode::):
3039         (KJS::FunctionCallDotNode::precedence):
3040         (KJS::PrePostResolveNode::):
3041         (KJS::PostfixBracketNode::):
3042         (KJS::PostfixBracketNode::precedence):
3043         (KJS::PostIncBracketNode::):
3044         (KJS::PostIncBracketNode::isIncrement):
3045         (KJS::PostDecBracketNode::):
3046         (KJS::PostDecBracketNode::isIncrement):
3047         (KJS::PostfixDotNode::):
3048         (KJS::PostfixDotNode::precedence):
3049         (KJS::PostIncDotNode::):
3050         (KJS::PostIncDotNode::isIncrement):
3051         (KJS::PostDecDotNode::):
3052         (KJS::PostDecDotNode::isIncrement):
3053         (KJS::PostfixErrorNode::):
3054         (KJS::PostfixErrorNode::precedence):
3055         (KJS::DeleteResolveNode::):
3056         (KJS::DeleteBracketNode::):
3057         (KJS::DeleteBracketNode::precedence):
3058         (KJS::DeleteDotNode::):
3059         (KJS::DeleteDotNode::precedence):
3060         (KJS::DeleteValueNode::):
3061         (KJS::DeleteValueNode::precedence):
3062         (KJS::VoidNode::):
3063         (KJS::VoidNode::precedence):
3064         (KJS::TypeOfResolveNode::):
3065         (KJS::TypeOfValueNode::):
3066         (KJS::PrefixBracketNode::):
3067         (KJS::PrefixBracketNode::precedence):
3068         (KJS::PreIncBracketNode::):
3069         (KJS::PreIncBracketNode::isIncrement):
3070         (KJS::PreDecBracketNode::):
3071         (KJS::PreDecBracketNode::isIncrement):
3072         (KJS::PrefixDotNode::):
3073         (KJS::PrefixDotNode::precedence):
3074         (KJS::PreIncDotNode::):
3075         (KJS::PreIncDotNode::isIncrement):
3076         (KJS::PreDecDotNode::):
3077         (KJS::PreDecDotNode::isIncrement):
3078         (KJS::PrefixErrorNode::):
3079         (KJS::PrefixErrorNode::precedence):
3080         (KJS::UnaryPlusNode::):
3081         (KJS::UnaryPlusNode::precedence):
3082         (KJS::NegateNode::):
3083         (KJS::NegateNode::precedence):
3084         (KJS::BitwiseNotNode::):
3085         (KJS::BitwiseNotNode::precedence):
3086         (KJS::LogicalNotNode::):
3087         (KJS::LogicalNotNode::precedence):
3088         (KJS::AddNode::):
3089         (KJS::AddNode::precedence):
3090         (KJS::LeftShiftNode::):
3091         (KJS::LeftShiftNode::precedence):
3092         (KJS::RightShiftNode::):
3093         (KJS::RightShiftNode::precedence):
3094         (KJS::UnsignedRightShiftNode::):
3095         (KJS::UnsignedRightShiftNode::precedence):
3096         (KJS::LessNode::):
3097         (KJS::LessNode::precedence):
3098         (KJS::GreaterNode::):
3099         (KJS::GreaterNode::precedence):
3100         (KJS::LessEqNode::):
3101         (KJS::LessEqNode::precedence):
3102         (KJS::GreaterEqNode::):
3103         (KJS::GreaterEqNode::precedence):
3104         (KJS::InstanceOfNode::):
3105         (KJS::InstanceOfNode::precedence):
3106         (KJS::InNode::):
3107         (KJS::InNode::precedence):
3108         (KJS::EqualNode::):
3109         (KJS::EqualNode::precedence):
3110         (KJS::NotEqualNode::):
3111         (KJS::NotEqualNode::precedence):
3112         (KJS::StrictEqualNode::):
3113         (KJS::StrictEqualNode::precedence):
3114         (KJS::NotStrictEqualNode::):
3115         (KJS::NotStrictEqualNode::precedence):
3116         (KJS::BitAndNode::):
3117         (KJS::BitAndNode::precedence):
3118         (KJS::BitOrNode::):
3119         (KJS::BitOrNode::precedence):
3120         (KJS::BitXOrNode::):
3121         (KJS::BitXOrNode::precedence):
3122         (KJS::LogicalAndNode::):
3123         (KJS::LogicalAndNode::precedence):
3124         (KJS::LogicalOrNode::):
3125         (KJS::LogicalOrNode::precedence):
3126         (KJS::ConditionalNode::):
3127         (KJS::ConditionalNode::precedence):
3128         (KJS::ReadModifyResolveNode::):
3129         (KJS::ReadModifyResolveNode::precedence):
3130         (KJS::AssignResolveNode::):
3131         (KJS::AssignResolveNode::precedence):
3132         (KJS::ReadModifyBracketNode::):
3133         (KJS::ReadModifyBracketNode::precedence):
3134         (KJS::AssignBracketNode::):
3135         (KJS::AssignBracketNode::precedence):
3136         (KJS::AssignDotNode::):
3137         (KJS::AssignDotNode::precedence):
3138         (KJS::ReadModifyDotNode::):
3139         (KJS::ReadModifyDotNode::precedence):
3140         (KJS::AssignErrorNode::):
3141         (KJS::AssignErrorNode::precedence):
3142         (KJS::CommaNode::):
3143         (KJS::CommaNode::precedence):
3144         (KJS::AssignExprNode::):
3145         (KJS::AssignExprNode::precedence):
3146         (KJS::ExprStatementNode::):
3147         (KJS::IfNode::):
3148         (KJS::DoWhileNode::):
3149         (KJS::WhileNode::):
3150         (KJS::ReturnNode::):
3151         (KJS::WithNode::):
3152         (KJS::ThrowNode::):
3153         (KJS::ParameterNode::):
3154         (KJS::CaseClauseNode::):
3155         (KJS::CaseClauseNode::precedence):
3156         (KJS::ClauseListNode::):
3157         (KJS::SwitchNode::):
3158
3159 2007-11-08  Oliver Hunt  <oliver@apple.com>
3160
3161         Reviewed by Sam.
3162
3163         Add a fast path for bitwise-and of two immediate numbers for a 0.7% improvement in SunSpider (4% bitop improvement).
3164
3165         This only improves bitwise-and performance, as the additional logic required 
3166         for similar code paths on or, xor, and shifting requires additional operations
3167         and branches that negate (and in certain cases, regress) any advantage we might
3168         otherwise receive.
3169
3170         This improves performance on all bitop tests, the cryptography tests, as well as 
3171         the string-base64 and string-unpack-code tests.  No significant degradation on 
3172         any other tests.
3173
3174         * kjs/JSImmediate.h:
3175         (KJS::JSImmediate::areBothImmediateNumbers):
3176         (KJS::JSImmediate::andImmediateNumbers):
3177         * kjs/nodes.cpp:
3178         (KJS::BitAndNode::evaluate):
3179         * kjs/value.h:
3180         (KJS::jsNumberFromAnd):
3181
3182 2007-11-08  Adam Roben  <aroben@apple.com>
3183
3184         Stop using KJS inside of MathExtras.h
3185
3186         Reviewed by Darin.
3187
3188         * wtf/MathExtras.h: Removed an unused header, and a now-unused
3189         forward-declaration.
3190         (wtf_atan2): Use std::numeric_limits intead of KJS.
3191
3192 2007-11-08  Sam Weinig  <sam@webkit.org>
3193
3194         Windows build fix.
3195
3196         * kjs/date_object.cpp:
3197         (KJS::DateProtoFuncToLocaleString::callAsFunction): Fix unused arg warning.
3198         (KJS::DateProtoFuncToLocaleDateString::callAsFunction): ditto
3199         (KJS::DateProtoFuncToLocaleTimeString::callAsFunction): ditto
3200
3201 2007-11-08  Mark Rowe  <mrowe@apple.com>
3202
3203         Gtk build fix.
3204
3205         * kjs/lookup.h: Add missing include.
3206
3207 2007-11-08  Sam Weinig  <sam@webkit.org>
3208
3209         Reviewed by Darin.
3210
3211         Convert JavaScript internal function objects to use one class per
3212         function.  This avoids a switch statement inside what used to be
3213         the shared function classes and will allow Shark to better analyze
3214         the code.
3215
3216         To make this switch, the value property of the HashEntry was changed
3217         to a union of an intptr_t (which is used to continue handle valueGetters)
3218         and function pointer which points to a static constructor for the
3219         individual new function objects.
3220
3221         SunSpider claims this is a 1.0% speedup.
3222
3223         * kjs/array_object.cpp:
3224         (KJS::ArrayPrototype::getOwnPropertySlot):
3225         (KJS::getProperty):
3226         (KJS::ArrayProtoFuncToString::callAsFunction):
3227         (KJS::ArrayProtoFuncToLocaleString::callAsFunction):
3228         (KJS::ArrayProtoFuncJoin::callAsFunction):
3229         (KJS::ArrayProtoFuncConcat::callAsFunction):
3230         (KJS::ArrayProtoFuncPop::callAsFunction):
3231         (KJS::ArrayProtoFuncPush::callAsFunction):
3232         (KJS::ArrayProtoFuncReverse::callAsFunction):
3233         (KJS::ArrayProtoFuncShift::callAsFunction):
3234         (KJS::ArrayProtoFuncSlice::callAsFunction):
3235         (KJS::ArrayProtoFuncSort::callAsFunction):
3236         (KJS::ArrayProtoFuncSplice::callAsFunction):
3237         (KJS::ArrayProtoFuncUnShift::callAsFunction):
3238         (KJS::ArrayProtoFuncFilter::callAsFunction):
3239         (KJS::ArrayProtoFuncMap::callAsFunction):
3240         (KJS::ArrayProtoFuncEvery::callAsFunction):
3241         (KJS::ArrayProtoFuncForEach::callAsFunction):
3242         (KJS::ArrayProtoFuncSome::callAsFunction):
3243         (KJS::ArrayProtoFuncIndexOf::callAsFunction):
3244         (KJS::ArrayProtoFuncLastIndexOf::callAsFunction):
3245         * kjs/array_object.h:
3246         (KJS::ArrayPrototype::classInfo):
3247         * kjs/create_hash_table:
3248         * kjs/date_object.cpp:
3249         (KJS::DatePrototype::getOwnPropertySlot):
3250         (KJS::DateProtoFuncToString::callAsFunction):
3251         (KJS::DateProtoFuncToUTCString::callAsFunction):
3252         (KJS::DateProtoFuncToDateString::callAsFunction):
3253         (KJS::DateProtoFuncToTimeString::callAsFunction):
3254         (KJS::DateProtoFuncToLocaleString::callAsFunction):
3255         (KJS::DateProtoFuncToLocaleDateString::callAsFunction):
3256         (KJS::DateProtoFuncToLocaleTimeString::callAsFunction):
3257         (KJS::DateProtoFuncValueOf::callAsFunction):
3258         (KJS::DateProtoFuncGetTime::callAsFunction):
3259         (KJS::DateProtoFuncGetFullYear::callAsFunction):
3260         (KJS::DateProtoFuncGetUTCFullYear::callAsFunction):
3261         (KJS::DateProtoFuncToGMTString::callAsFunction):
3262         (KJS::DateProtoFuncGetMonth::callAsFunction):
3263         (KJS::DateProtoFuncGetUTCMonth::callAsFunction):
3264         (KJS::DateProtoFuncGetDate::callAsFunction):
3265         (KJS::DateProtoFuncGetUTCDate::callAsFunction):
3266         (KJS::DateProtoFuncGetDay::callAsFunction):
3267         (KJS::DateProtoFuncGetUTCDay::callAsFunction):
3268         (KJS::DateProtoFuncGetHours::callAsFunction):
3269         (KJS::DateProtoFuncGetUTCHours::callAsFunction):
3270         (KJS::DateProtoFuncGetMinutes::callAsFunction):
3271         (KJS::DateProtoFuncGetUTCMinutes::callAsFunction):
3272         (KJS::DateProtoFuncGetSeconds::callAsFunction):
3273         (KJS::DateProtoFuncGetUTCSeconds::callAsFunction):
3274         (KJS::DateProtoFuncGetMilliSeconds::callAsFunction):
3275         (KJS::DateProtoFuncGetUTCMilliseconds::callAsFunction):
3276         (KJS::DateProtoFuncGetTimezoneOffset::callAsFunction):
3277         (KJS::DateProtoFuncSetTime::callAsFunction):
3278         (KJS::DateProtoFuncSetMilliSeconds::callAsFunction):
3279         (KJS::DateProtoFuncSetUTCMilliseconds::callAsFunction):
3280         (KJS::DateProtoFuncSetSeconds::callAsFunction):
3281         (KJS::DateProtoFuncSetUTCSeconds::callAsFunction):
3282         (KJS::DateProtoFuncSetMinutes::callAsFunction):
3283         (KJS::DateProtoFuncSetUTCMinutes::callAsFunction):
3284         (KJS::DateProtoFuncSetHours::callAsFunction):
3285         (KJS::DateProtoFuncSetUTCHours::callAsFunction):
3286         (KJS::DateProtoFuncSetDate::callAsFunction):
3287         (KJS::DateProtoFuncSetUTCDate::callAsFunction):
3288         (KJS::DateProtoFuncSetMonth::callAsFunction):
3289         (KJS::DateProtoFuncSetUTCMonth::callAsFunction):
3290         (KJS::DateProtoFuncSetFullYear::callAsFunction):
3291         (KJS::DateProtoFuncSetUTCFullYear::callAsFunction):
3292         (KJS::DateProtoFuncSetYear::callAsFunction):
3293         (KJS::DateProtoFuncGetYear::callAsFunction):
3294         * kjs/date_object.h:
3295         * kjs/lookup.cpp:
3296         (KJS::Lookup::find):
3297         * kjs/lookup.h:
3298         (KJS::HashEntry::):
3299         (KJS::staticFunctionGetter):
3300         (KJS::staticValueGetter):
3301         (KJS::getStaticPropertySlot):
3302         (KJS::getStaticFunctionSlot):
3303         (KJS::lookupPut):
3304         * kjs/math_object.cpp:
3305         (KJS::MathObjectImp::getOwnPropertySlot):
3306         (KJS::MathProtoFuncAbs::callAsFunction):
3307         (KJS::MathProtoFuncACos::callAsFunction):
3308         (KJS::MathProtoFuncASin::callAsFunction):
3309         (KJS::MathProtoFuncATan::callAsFunction):
3310         (KJS::MathProtoFuncATan2::callAsFunction):
3311         (KJS::MathProtoFuncCeil::callAsFunction):
3312         (KJS::MathProtoFuncCos::callAsFunction):
3313         (KJS::MathProtoFuncExp::callAsFunction):
3314         (KJS::MathProtoFuncFloor::callAsFunction):
3315         (KJS::MathProtoFuncLog::callAsFunction):
3316         (KJS::MathProtoFuncMax::callAsFunction):
3317         (KJS::MathProtoFuncMin::callAsFunction):
3318         (KJS::MathProtoFuncPow::callAsFunction):
3319         (KJS::MathProtoFuncRandom::callAsFunction):
3320         (KJS::MathProtoFuncRound::callAsFunction):
3321         (KJS::MathProtoFuncSin::callAsFunction):
3322         (KJS::MathProtoFuncSqrt::callAsFunction):
3323         (KJS::MathProtoFuncTan::callAsFunction):
3324         * kjs/math_object.h:
3325         (KJS::MathObjectImp::classInfo):
3326         (KJS::MathObjectImp::):
3327         * kjs/string_object.cpp:
3328         (KJS::StringPrototype::getOwnPropertySlot):
3329         (KJS::StringProtoFuncToString::callAsFunction):
3330         (KJS::StringProtoFuncValueOf::callAsFunction):
3331         (KJS::StringProtoFuncCharAt::callAsFunction):
3332         (KJS::StringProtoFuncCharCodeAt::callAsFunction):
3333         (KJS::StringProtoFuncConcat::callAsFunction):
3334         (KJS::StringProtoFuncIndexOf::callAsFunction):
3335         (KJS::StringProtoFuncLastIndexOf::callAsFunction):
3336         (KJS::StringProtoFuncMatch::callAsFunction):
3337         (KJS::StringProtoFuncSearch::callAsFunction):
3338         (KJS::StringProtoFuncReplace::callAsFunction):
3339         (KJS::StringProtoFuncSlice::callAsFunction):
3340         (KJS::StringProtoFuncSplit::callAsFunction):
3341         (KJS::StringProtoFuncSubstr::callAsFunction):
3342         (KJS::StringProtoFuncSubstring::callAsFunction):
3343         (KJS::StringProtoFuncToLowerCase::callAsFunction):
3344         (KJS::StringProtoFuncToUpperCase::callAsFunction):
3345         (KJS::StringProtoFuncToLocaleLowerCase::callAsFunction):
3346         (KJS::StringProtoFuncToLocaleUpperCase::callAsFunction):
3347         (KJS::StringProtoFuncLocaleCompare::callAsFunction):
3348         (KJS::StringProtoFuncBig::callAsFunction):
3349         (KJS::StringProtoFuncSmall::callAsFunction):
3350         (KJS::StringProtoFuncBlink::callAsFunction):
3351         (KJS::StringProtoFuncBold::callAsFunction):
3352         (KJS::StringProtoFuncFixed::callAsFunction):
3353         (KJS::StringProtoFuncItalics::callAsFunction):
3354         (KJS::StringProtoFuncStrike::callAsFunction):
3355         (KJS::StringProtoFuncSub::callAsFunction):
3356         (KJS::StringProtoFuncSup::callAsFunction):
3357         (KJS::StringProtoFuncFontcolor::callAsFunction):
3358         (KJS::StringProtoFuncFontsize::callAsFunction):
3359         (KJS::StringProtoFuncAnchor::callAsFunction):
3360         (KJS::StringProtoFuncLink::callAsFunction):
3361         * kjs/string_object.h:
3362
3363 2007-11-08  Adam Roben  <aroben@apple.com>
3364
3365         Windows build fix
3366
3367         Reviewed by Sam and Ada.
3368
3369         * wtf/MathExtras.h: Get rid of a circular #include dependency to fix
3370         the build.
3371
3372 2007-11-08  Adam Roben  <aroben@apple.com>
3373
3374         Fix a precedence warning on Windows
3375
3376         * kjs/JSImmediate.h:
3377         (KJS::JSImmediate::toBoolean):
3378
3379 2007-11-08  Mark Rowe  <mrowe@apple.com>
3380
3381         Build fix for JavaScriptGlue.
3382
3383         * wtf/MathExtras.h: Include stdlib.h for srand and RAND_MAX.
3384
3385 2007-11-08  Darin Adler  <darin@apple.com>
3386
3387         - Windows build fix
3388
3389         * kjs/JSImmediate.h: Include MathExtras.h rather than math.h since this file uses "signbit".
3390
3391 2007-11-08  Oliver Hunt  <oliver@apple.com>
3392
3393         Reviewed by Darin.
3394
3395         Replace the use of floats for immediate values with the use of integers for a 4.5% improvement in SunSpider.
3396
3397         Unfortunately this change results in NaN, +Inf, -Inf, and -0 being heap allocated now, but
3398         we should now have faster array access, faster immediate to double conversion, and the 
3399         potential to further improve bitwise operators in future.
3400
3401         This also removes the need for unions to avoid strict aliasing problems when extracting 
3402         a value from immediates.
3403
3404         * kjs/JSImmediate.h:
3405         (KJS::):
3406         (KJS::JSImmediate::trueImmediate):
3407         (KJS::JSImmediate::falseImmediate):
3408         (KJS::JSImmediate::undefinedImmediate):
3409         (KJS::JSImmediate::nullImmediate):
3410         (KJS::JSImmediate::toBoolean):
3411         * kjs/value.h:
3412         (KJS::jsNaN):
3413
3414 2007-11-07  Eric Seidel  <eric@webkit.org>
3415
3416         Reviewed by Darin and Oliver.
3417         
3418         Add evaluateToNumber parallel evaluation tree to speed up number operations.
3419         Make ImmediateNumberNode a subclass of NumberNode.
3420         Share evaluate logic between evaluate and evaluateToNumber using inline functions
3421         There is still a lot of improvement to be made here.
3422         
3423         SunSpider claims this is a 1.0% speedup overall (nbody 7.9%), base64 slowing 2.0%
3424         Given the huge win that this prepares us for with simple type inferencing I see the small
3425         regression in base64 being worth the substantial overall improvement.
3426
3427         * kjs/grammar.y:
3428         * kjs/nodes.cpp:
3429         (KJS::Node::evaluateToNumber):
3430         (KJS::NumberNode::evaluate):
3431         (KJS::NumberNode::evaluateToNumber):
3432         (KJS::StringNode::evaluateToNumber):
3433         (KJS::LocalVarAccessNode::inlineEvaluate):
3434         (KJS::LocalVarAccessNode::evaluate):
3435         (KJS::LocalVarAccessNode::evaluateToNumber):
3436         (KJS::BracketAccessorNode::inlineEvaluate):
3437         (KJS::BracketAccessorNode::evaluate):
3438         (KJS::BracketAccessorNode::evaluateToNumber):
3439         (KJS::NegateNode::evaluate):
3440         (KJS::NegateNode::evaluateToNumber):
3441         (KJS::MultNode::inlineEvaluateToNumber):
3442         (KJS::MultNode::evaluate):
3443         (KJS::MultNode::evaluateToNumber):
3444         (KJS::DivNode::inlineEvaluateToNumber):
3445         (KJS::DivNode::evaluate):
3446         (KJS::DivNode::evaluateToNumber):
3447         (KJS::ModNode::inlineEvaluateToNumber):
3448         (KJS::ModNode::evaluate):
3449         (KJS::ModNode::evaluateToNumber):
3450         (KJS::throwOutOfMemoryErrorToNumber):
3451         (KJS::addSlowCaseToNumber):
3452         (KJS::add):
3453         (KJS::addToNumber):
3454         (KJS::AddNode::evaluateToNumber):
3455         (KJS::SubNode::inlineEvaluateToNumber):
3456         (KJS::SubNode::evaluate):
3457         (KJS::SubNode::evaluateToNumber):
3458         (KJS::valueForReadModifyAssignment):
3459         (KJS::ReadModifyLocalVarNode::evaluate):
3460         (KJS::ReadModifyResolveNode::evaluate):
3461         (KJS::ReadModifyDotNode::evaluate):
3462         (KJS::ReadModifyBracketNode::evaluate):
3463         * kjs/nodes.h:
3464         (KJS::Node::):
3465         (KJS::NumberNode::):
3466         (KJS::ImmediateNumberNode::):
3467         (KJS::AddNode::precedence):
3468         * kjs/nodes2string.cpp:
3469         (KJS::NumberNode::streamTo):
3470
3471 2007-11-07  Mark Rowe  <mrowe@apple.com>
3472
3473         Reviewed by Eric.
3474
3475         Fix up initialization after being mangled in r27572, and remove the
3476         ternary expression as extraCost will always be zero for the numeric
3477         heap.
3478
3479         * kjs/collector.cpp:
3480         (KJS::Collector::heapAllocate):
3481
3482 2007-11-07  Mark Rowe  <mrowe@apple.com>
3483
3484         Gtk build fix.
3485
3486         * kjs/regexp_object.cpp:
3487
3488 2007-11-07  Geoffrey Garen  <ggaren@apple.com>
3489
3490         Reviewed by Beth Dakin.
3491         
3492         Eliminated a bogus (though compiled-out) branch in the collector.
3493
3494         * kjs/collector.cpp:
3495         (KJS::Collector::heapAllocate):
3496
3497 2007-11-06  Geoffrey Garen  <ggaren@apple.com>
3498
3499         Reviewed by Darin Adler.
3500         
3501         Fixed part of http://bugs.webkit.org/show_bug.cgi?id=15861 
3502         5.8% of string-validate-input.js is spent creating RegExpImps
3503
3504         Put RegExpImp properties into a static hashtable to avoid a slew of
3505         PropertyMap churn when creating a RegExpImp.
3506         
3507         Factored important bits of regular expression implementation out of
3508         RegExpImp (the JS object) and into RegExp (the PCRE wrapper class), 
3509         making RegExp a ref-counted class. (This will help later.)
3510
3511         Removed PCRE_POSIX support because I didn't quite know how to test it 
3512         and keep it working with these changes.
3513         
3514         1.1% SunSpider speedup. 5.8% speedup on string-validate-input.js.
3515
3516         * kjs/regexp.h: A few interface changes:
3517         1. Renamed "subpatterns()" => "numSubpatterns()"
3518         2. Made flag enumeration private and replaced it with public getters for
3519         specific flags.
3520         3. Made RegExp ref-counted so RegExps can be shared by RegExpImps.
3521         4. Made RegExp take a string of flags instead of an int, eliminating 
3522         duplicated flag parsing code elsewhere.
3523
3524         * kjs/regexp_object.cpp:
3525         (KJS::RegExpProtoFunc::callAsFunction): For RegExp.compile: 
3526         - Fixed a bug where compile(undefined) would throw an exception. 
3527         - Removed some now-redundant code.
3528         - Used RegExp sharing to eliminate an allocation and a bunch of 
3529         PropertyMap thrash. (Not a big win since compile is a deprecated 
3530         function. I mainly did this to test the plubming.)
3531
3532 2007-11-07  Simon Hausmann  <hausmann@kde.org>
3533
3534         Reviewed by nobody, Qt/Windows build fix.
3535
3536         JavaScriptCore.pri expects OBJECTS_DIR to be set, so set it in
3537         testkjs.pro, too, where it's included from.
3538
3539         * kjs/testkjs.pro:
3540
3541 2007-11-07  Simon Hausmann  <shausman@trolltech.com>
3542
3543         Reviewed by Lars.
3544
3545         Fix "nmake clean" for the Qt/Windows build by replacing tmp/ with a variable that ends with the correct type of slash/backslash depending on the choice of compiler/make tool.
3546
3547         * JavaScriptCore.pri:
3548         * pcre/pcre.pri:
3549
3550 2007-11-07  Lars Knoll  <lars@trolltech.com>
3551
3552         Reviewed by Simon.
3553
3554         fix umemcasecmp
3555         
3556         Pretty embarrassing bug. Has the potential to fix quite a few test failures.
3557
3558         * wtf/unicode/qt4/UnicodeQt4.h:
3559         (WTF::Unicode::umemcasecmp):
3560
3561 2007-11-06  Maciej Stachowiak  <mjs@apple.com>
3562
3563         Reviewed by Eric.        
3564         
3565         - only collect when the heap is full, unless we have lots of extra cost garbage
3566         
3567         1.1% SunSpider speedup.
3568         
3569         This shouldn't hit memory use much since the extra space in those
3570         blocks hangs around either way.
3571
3572         * kjs/collector.cpp:
3573         (KJS::Collector::heapAllocate):
3574         (KJS::Collector::collect): Fix logic error that reversed the sense of collect's 
3575         return value.
3576
3577 2007-11-06  Oliver Hunt  <oliver@apple.com>
3578
3579         Reviewed by Maciej.
3580
3581         Avoid unnecessarily boxing the result from post inc/decrement for 0.3% gain in sunspider
3582         
3583         We now convert the common 'for (...; ...; <var>++) ...' to the semantically identical
3584         'for (...; ...; ++<var>) ...'.
3585
3586         * kjs/nodes.cpp:
3587         (KJS::PostIncResolveNode::optimizeForUnnecessaryResult):
3588         (KJS::PostIncLocalVarNode::evaluate):
3589         (KJS::PostIncLocalVarNode::optimizeForUnnecessaryResult):
3590         (KJS::PostDecResolveNode::optimizeForUnnecessaryResult):
3591         (KJS::PostDecLocalVarNode::evaluate):
3592         (KJS::PostDecLocalVarNode::optimizeForUnnecessaryResult):
3593         * kjs/nodes.h:
3594         (KJS::PrePostResolveNode::):
3595         (KJS::PostIncResolveNode::):
3596         (KJS::PostIncLocalVarNode::):
3597         (KJS::PostDecResolveNode::):
3598         (KJS::PostDecLocalVarNode::):
3599         (KJS::PreIncResolveNode::):
3600         (KJS::PreDecResolveNode::):
3601         (KJS::ForNode::ForNode):
3602
3603 2007-11-06  Eric Seidel  <eric@webkit.org>
3604