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