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