2011-01-24 Peter Varga <pvarga@inf.u-szeged.hu>
[WebKit.git] / Source / JavaScriptCore / ChangeLog
1 2011-01-24  Peter Varga  <pvarga@webkit.org>
2
3         Reviewed by Oliver Hunt.
4
5         Optimize regex patterns which contain empty alternatives
6         https://bugs.webkit.org/show_bug.cgi?id=51395
7
8         Eliminate the empty alternatives from the regex pattern and convert it to do
9         the matching in an easier way.
10
11         * yarr/YarrPattern.cpp:
12         (JSC::Yarr::YarrPatternConstructor::atomParenthesesEnd):
13
14 2011-01-24  Andras Becsi  <abecsi@webkit.org>
15
16         Reviewed by Csaba Osztrogonác.
17
18         [Qt] Move project files into Source
19         https://bugs.webkit.org/show_bug.cgi?id=52891
20
21         * JavaScriptCore.pri:
22         * JavaScriptCore.pro:
23         * jsc.pro:
24
25 2011-01-23  Mark Rowe  <mrowe@apple.com>
26
27         Follow-up to r76477.
28
29         Fix the scripts that detect problematic code such as static initializers
30         and destructors, weak vtables, inappropriate files in the framework wrappers,
31         and public headers including private headers. These had all been broken
32         since the projects were moved in to the Source directory as the paths to the
33         scripts were not updated at that time.
34
35         * JavaScriptCore.xcodeproj/project.pbxproj:
36
37 2011-01-23  Patrick Gansterer  <paroga@webkit.org>
38
39         Reviewed by Darin Adler.
40
41         Use WTF::StringHasher in WebCore
42         https://bugs.webkit.org/show_bug.cgi?id=52934
43
44         Add an additional function to calculate the hash
45         of data with a runtimedependent size.
46
47         * wtf/StringHasher.h:
48         (WTF::StringHasher::createBlobHash):
49
50 2011-01-23  Patrick Gansterer  <paroga@webkit.org>
51
52         Reviewed by David Kilzer.
53
54         Fix comment in String::ascii()
55         https://bugs.webkit.org/show_bug.cgi?id=52980
56
57         * wtf/text/WTFString.cpp:
58         (WTF::String::ascii):
59
60 2011-01-23  Patrick Gansterer  <paroga@webkit.org>
61
62         Reviewed by David Kilzer.
63
64         Add String::containsOnlyLatin1()
65         https://bugs.webkit.org/show_bug.cgi?id=52979
66
67         * wtf/text/WTFString.h:
68         (WTF::String::containsOnlyLatin1):
69         (WTF::charactersAreAllLatin1):
70
71 2011-01-23  Patrick Gansterer  <paroga@webkit.org>
72
73         Reviewed by Oliver Hunt.
74
75         Remove obsolete JSVALUE32 code
76         https://bugs.webkit.org/show_bug.cgi?id=52948
77
78         r70111 removed support for JSVALUE32.
79         ARM, MIPS and X86 support JSVALUE32_64 only.
80
81         * jit/JITStubs.cpp:
82
83 2011-01-22  Geoffrey Garen  <ggaren@apple.com>
84
85         Reviewed by Dan Bernstein.
86
87         ASSERT running run-webkit-tests --threaded.
88         https://bugs.webkit.org/show_bug.cgi?id=52971
89         
90         SunSpider and v8 report no change.
91
92         * runtime/ConservativeSet.cpp:
93         (JSC::ConservativeSet::grow):
94         (JSC::ConservativeSet::add):
95         * runtime/ConservativeSet.h: Tweaked the inline capacity to 128, and
96         the growth policy to 2X, to make SunSpider and v8 happy.
97         (JSC::ConservativeSet::ConservativeSet):
98         (JSC::ConservativeSet::~ConservativeSet):
99         (JSC::ConservativeSet::mark): Use OSAllocator directly, instead of malloc.
100         Malloc is forbidden during a multi-threaded mark phase because it can
101         cause deadlock.
102
103 2011-01-22  Geoffrey Garen  <ggaren@apple.com>
104
105         Reviewed by Geoffrey Garen.
106
107         Rubber-stamped by Maciej Stachowiak.
108
109         A few of Maciej's review suggestions for my last patch.
110         https://bugs.webkit.org/show_bug.cgi?id=52946        
111
112         SunSpider reports no change.
113
114         * Android.mk:
115         * CMakeLists.txt:
116         * GNUmakefile.am:
117         * JavaScriptCore.gypi:
118         * JavaScriptCore.pro:
119         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
120         * JavaScriptCore.xcodeproj/project.pbxproj: Updated build systems.
121
122         * runtime/ConservativeSet.cpp: Added.
123         (JSC::isPointerAligned):
124         (JSC::ConservativeSet::add):
125         * runtime/ConservativeSet.h: Added.
126         (JSC::ConservativeSet::ConservativeSet):
127         (JSC::ConservativeSet::mark): Split ConservativeSet out into its own
128         file, and moved the conservative check into ConservativeSet::add, making
129         ConservativeSet's responsibility clearer.
130
131         * runtime/Heap.cpp:
132         (JSC::Heap::markRoots):
133         * runtime/MachineStackMarker.cpp:
134         (JSC::MachineStackMarker::markCurrentThreadConservativelyInternal):
135         (JSC::MachineStackMarker::markOtherThreadConservatively):
136         * runtime/MachineStackMarker.h:
137         * runtime/MarkStack.h: Updated for changes above.
138
139 2011-01-22  Patrick Gansterer  <paroga@webkit.org>
140
141         Unreviewed WinCE build fix for r76430.
142
143         * runtime/MachineStackMarker.cpp:
144         (JSC::swapIfBackwards):
145
146 2011-01-21  Geoffrey Garen  <ggaren@apple.com>
147
148         Reviewed by Beth Dakin.
149
150         Reorganized MarkedSpace, making many of its functions private.
151
152         * runtime/JSCell.h:
153         (JSC::JSCell::Heap::heap):
154         * runtime/MarkedSpace.h:
155         (JSC::MarkedSpace::globalData):
156         (JSC::MarkedSpace::heap):
157
158 2011-01-21  Geoffrey Garen  <ggaren@apple.com>
159
160         Try to fix build: moved helper function out of #ifdef.
161
162         * runtime/MachineStackMarker.cpp:
163         (JSC::swapIfBackwards):
164
165 2011-01-21  Geoffrey Garen  <ggaren@apple.com>
166
167         Rubber-stamped by Maciej Stachowiak.
168
169         A few of Maciej's review suggestions for my last patch.
170         https://bugs.webkit.org/show_bug.cgi?id=52946        
171
172         SunSpider reports no change.
173
174         * runtime/MachineStackMarker.cpp:
175         (JSC::swapIfBackwards): Added a helper function for handling platforms
176         where the stack can grow in any direction.
177
178         (JSC::MachineStackMarker::markCurrentThreadConservativelyInternal):
179         (JSC::MachineStackMarker::markOtherThreadConservatively): Use the helper
180         function.
181
182         (JSC::isPointerAligned): Use "!" instead of "==0" because a robot told me to.
183
184         (JSC::MachineStackMarker::markConservatively): Changed to use a more
185         standard looping idiom, and to use the helper function above.
186
187         * runtime/MarkedSpace.h:
188         (JSC::MarkedSpace::isCellAligned): Use "!" instead of "==0" because a robot told me to.
189
190 2011-01-21  Geoffrey Garen  <ggaren@apple.com>
191
192         Reviewed by Maciej Stachowiak.
193
194         Cleaned up some conservative marking code.
195         https://bugs.webkit.org/show_bug.cgi?id=52946
196         
197         SunSpider reports no change.
198
199         * interpreter/RegisterFile.h: No need for a special marking function,
200         since we already expose a start() and end().
201
202         * runtime/Heap.cpp:
203         (JSC::Heap::registerFile):
204         (JSC::Heap::markRoots):
205         * runtime/Heap.h:
206         (JSC::Heap::contains): Migrated markConservatively() to the machine stack
207         marker class. Now, Heap just provides a contains() function, which the
208         machine stack marker uses for checking whether a pointer points into the heap.
209
210         * runtime/MachineStackMarker.cpp:
211         (JSC::MachineStackMarker::markCurrentThreadConservativelyInternal):
212         (JSC::MachineStackMarker::markOtherThreadConservatively):
213         (JSC::isPointerAligned):
214         (JSC::MachineStackMarker::markConservatively):
215         * runtime/MachineStackMarker.h: Move the conservative marking code here.
216
217         * runtime/MarkStack.h:
218         (JSC::ConservativeSet::add):
219         (JSC::ConservativeSet::mark): Changed to using a vector instead of hash
220         set. Vector seems to be a bit faster, and it generates smaller code.
221
222         * runtime/MarkedSpace.cpp:
223         (JSC::MarkedSpace::containsSlowCase):
224         * runtime/MarkedSpace.h:
225         (JSC::MarkedSpace::isCellAligned):
226         (JSC::MarkedSpace::isPossibleCell):
227         (JSC::MarkedSpace::contains): Kept the code for determining whether a
228         pointer pointed into marked space, and moved the code for marking
229         a set of conservative pointers into the machine stack marker.
230
231         * wtf/HashSet.h:
232         (WTF::::add): Added two missing inlines that I noticed while testing
233         vector vs hash set.
234
235 2011-01-21  Mark Rowe  <mrowe@apple.com>
236
237         Reviewed by Sam Weinig.
238
239         Work around a Clang bug <rdar://problem/8876150> that leads to it incorrectly emitting an access
240         control warning when a client tries to use operator bool exposed above via "using PageBlock::operator bool".
241
242         * wtf/PageAllocation.h:
243         (WTF::PageAllocation::operator bool):
244         * wtf/PageReservation.h:
245         (WTF::PageReservation::operator bool):
246
247 2011-01-21  Michael Saboff  <msaboff@apple.com>
248
249         Reviewed by Oliver Hunt.
250
251         [RegexFuzz] Hang with forward assertion
252         https://bugs.webkit.org/show_bug.cgi?id=52825
253         <rdar://problem/8894332>
254
255         The backtrackTo label from the first term in a list of terms is
256         being overwritten by processing of subsequent terms.  Changed
257         copyBacktrackToLabel() to check for an existing bcaktrackTo label
258         before copying and renamed it to propagateBacktrackToLabel() since
259         it no longer copies.
260
261         * yarr/YarrJIT.cpp:
262         (JSC::Yarr::YarrGenerator::BacktrackDestination::propagateBacktrackToLabel):
263         (JSC::Yarr::YarrGenerator::generateParenthesesSingle):
264
265 2011-01-21  Geoffrey Garen  <ggaren@apple.com>
266
267         Reviewed by Sam Weinig.
268
269         Moved the mark stack from global data to the heap, since it pertains
270         to the heap, and not the virtual machine as a whole.
271         https://bugs.webkit.org/show_bug.cgi?id=52930
272         
273         SunSpider reports no change.
274
275         * runtime/Heap.cpp:
276         (JSC::Heap::Heap):
277         (JSC::Heap::markRoots):
278         * runtime/Heap.h:
279         * runtime/JSGlobalData.cpp:
280         (JSC::JSGlobalData::JSGlobalData):
281         * runtime/JSGlobalData.h:
282
283 2011-01-21  Peter Gal  <galpeter@inf.u-szeged.hu>
284
285         Reviewed by Darin Adler.
286
287         REGRESSION(r76177): All JavaScriptCore tests fail on ARM
288         https://bugs.webkit.org/show_bug.cgi?id=52814
289
290         Get the approximateByteSize value before releasing the OwnPtr.
291
292         * parser/JSParser.cpp:
293         (JSC::JSParser::parseFunctionInfo):
294
295 2011-01-21  Xan Lopez  <xlopez@igalia.com>
296
297         Reviewed by Martin Robinson.
298
299         Remove unnecessary <stdio.h> include
300         https://bugs.webkit.org/show_bug.cgi?id=52884
301
302         * jit/JIT.cpp: remove unnecessary include.
303
304 2011-01-20  Ryosuke Niwa  <rniwa@webkit.org>
305
306         Reviewed by Maciej Stachowiak.
307
308         Added OwnPtrCommon.h because OwnArrayPtr::set calls deleteOwnedPtr.
309
310         * wtf/OwnArrayPtr.h:
311
312 2011-01-20  Patrick Gansterer  <paroga@webkit.org>
313
314         Reviewed by Oliver Hunt.
315
316         [WINCE] Remove obsolete JSVALUE32 code
317         https://bugs.webkit.org/show_bug.cgi?id=52450
318
319         Remove the "offset hack" in create_jit_stubs, since we
320         only support JSVALUE32_64 in the meantime.
321
322         * create_jit_stubs: Removed offset argument
323         * jit/JITStubs.cpp:
324
325 2011-01-20  Geoffrey Garen  <ggaren@apple.com>
326
327         Reviewed by Oliver Hunt.
328
329         When marking conservatively, guard against reviving dead objects.
330         https://bugs.webkit.org/show_bug.cgi?id=52840
331         
332         SunSpider and v8 say no change.
333
334         * interpreter/RegisterFile.h:
335         (JSC::RegisterFile::markCallFrames): Updated to use the ConservativeSet API.
336
337         * runtime/Heap.cpp:
338         (JSC::Heap::recordExtraCost): No need to guard against conservative
339         marking reviving dead objects anymore, since the conservative marking
340         mechanism guards against this now.
341
342         (JSC::Heap::markConservatively):
343         (JSC::Heap::markProtectedObjects):
344         (JSC::Heap::markTempSortVectors): Don't drain the mark stack inside a
345         marking function. We want to establish a separation of concerns between
346         visiting roots and draining the mark stack.
347
348         (JSC::Heap::markRoots): Gather the set of conservative references before
349         clearning mark bits, because conservative marking now uses the mark bits
350         to determine if a reference is valid, and avoid reviving dead objects.
351
352         (JSC::Heap::collectAllGarbage): No need to guard against conservative
353         marking reviving dead objects anymore, since the conservative marking
354         mechanism guards against this now.
355
356         * runtime/Heap.h: Updated to use the ConservativeSet API.
357
358         * runtime/MachineStackMarker.cpp:
359         (JSC::MachineStackMarker::markCurrentThreadConservativelyInternal):
360         (JSC::MachineStackMarker::markCurrentThreadConservatively):
361         (JSC::MachineStackMarker::markOtherThreadConservatively):
362         (JSC::MachineStackMarker::markMachineStackConservatively):
363         * runtime/MachineStackMarker.h: Ditto.
364
365         * runtime/MarkStack.h:
366         (JSC::ConservativeSet::add):
367         (JSC::ConservativeSet::mark): Added ConservativeSet, for gathering the
368         set of conservative references. This is different from MarkStack, since
369         we don't mark the set until it is completely gathered.
370
371         * runtime/MarkedSpace.cpp:
372         (JSC::MarkedSpace::freeBlock):
373         (JSC::MarkedSpace::resizeBlocks):
374         (JSC::MarkedSpace::markConservatively):
375         * runtime/MarkedSpace.h: When marking conservatively, guard against
376         reviving dead objects.
377
378 2011-01-20  Siddharth Mathur  <siddharth.mathur@nokia.com>
379
380         Reviewed by Geoffrey Garen.
381
382         [Symbian] Fix StackBounds::initialize()
383         https://bugs.webkit.org/show_bug.cgi?id=52842
384
385         * wtf/StackBounds.cpp:
386         (WTF::StackBounds::initialize): Use TThreadStackInfo.iLimit for stack limit
387
388 2011-01-20  Michael Saboff  <msaboff@apple.com>
389
390         Reviewed by Oliver Hunt.
391
392         <rdar://problem/8890203> [RegexFuzz] Crash in generated code (52773)
393         https://bugs.webkit.org/show_bug.cgi?id=52773
394
395         Fixed case where an existing DataLabelPtr is overwritten.  The
396         replacing DataLabelPtr is now resolved immediately in
397         linkDataLabelToBacktrackIfExists().  Cleanup - eliminated bool
398         return value for the routine as it was never used.
399
400         * yarr/YarrJIT.cpp:
401         (JSC::Yarr::YarrGenerator::TermGenerationState::linkDataLabelToBacktrackIfExists):
402
403 2011-01-20  Andras Becsi  <abecsi@webkit.org>
404
405         Reviewed by Csaba Osztrogonác.
406
407         [Qt][WK2] WebKit2 enabled build fails to link
408
409         Work around undefined reference linking issues until the buildsystem gets redesigned.
410         These issues first occured in minimal builds (see BUG 50519).
411
412         * JavaScriptCore.pri: link as whole-archive for WebKit2 builds
413
414 2011-01-20  Zoltan Horvath  <zoltan@webkit.org>
415
416         Reviewed by Csaba Osztrogonác.
417
418         Refactoring of the custom allocation framework
419         https://bugs.webkit.org/show_bug.cgi?id=49897
420
421         Inheriting from FastAllocBase can result in objects getting larger (bug #33896, #46589).
422         The modification replaces Noncopyable and FastAllocBase classes and these inherits with their
423         equivalent macro implementation at the necessary places.
424
425         * wtf/FastAllocBase.h: Turn FastAllocBase's implementation into a macro.
426
427 2011-01-20  Mark Rowe  <mrowe@apple.com>
428
429         Reviewed by Maciej Stachowiak.
430
431         Follow-up to r75766 / <rdar://problem/5469576>.
432
433         We were failing to initialize the key, causing all sorts of unexpected behavior.
434
435         * wtf/FastMalloc.cpp:
436         (WTF::setThreadHeap):
437         (WTF::TCMalloc_ThreadCache::GetThreadHeap):
438         (WTF::TCMalloc_ThreadCache::InitTSD): Ensure that the key is initialized.
439
440 2011-01-18  Geoffrey Garen  <ggaren@apple.com>
441
442         Reviewed by Darin Adler.
443
444         Rolled back in r76078, with crash fixed.
445         https://bugs.webkit.org/show_bug.cgi?id=52668
446         
447         * runtime/JSGlobalObject.cpp:
448         (JSC::JSGlobalObject::markChildren): Account for the fact that the global
449         object moves its variables into and out of the register file. While out
450         of the register file, the symbol table's size is not an accurate count
451         for the size of the register array, since the BytecodeGenerator might
452         be compiling, adding items to the symbol table.
453         
454 2011-01-18  Darin Adler  <darin@apple.com>
455
456         Reviewed by Geoffrey Garen.
457
458         Stack overflow when converting an Error object to string
459         https://bugs.webkit.org/show_bug.cgi?id=46410
460
461         * Android.mk: Added StringRecursionChecker.cpp and
462         StringRecursionChecker.h.
463         * CMakeLists.txt: Ditto.
464         * GNUmakefile.am: Ditto.
465         * JavaScriptCore.gypi: Ditto.
466         * JavaScriptCore.pro: Ditto.
467         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto.
468         * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
469
470         * runtime/ArrayPrototype.cpp:
471         (JSC::arrayProtoFuncToString): Use StringRecursionChecker instead
472         of the older hand-written code to do the same thing.
473         (JSC::arrayProtoFuncToLocaleString): Ditto.
474         (JSC::arrayProtoFuncJoin): Ditto.
475
476         * runtime/ErrorPrototype.cpp:
477         (JSC::errorProtoFuncToString): Use StringRecursionChecker.
478
479         * runtime/JSGlobalData.h: Renamed arrayVisitedElements to
480         stringRecursionCheckVisitedObjects.
481
482         * runtime/RegExpPrototype.cpp:
483         (JSC::regExpProtoFuncToString): Use StringRecursionChecker.
484
485         * runtime/StringRecursionChecker.cpp: Added.
486         * runtime/StringRecursionChecker.h: Added.
487
488 2011-01-19  Oliver Hunt  <oliver@apple.com>
489
490         Reviewed by Gavin Barraclough.
491
492         Remove non-spec support for callable RegExp
493         https://bugs.webkit.org/show_bug.cgi?id=28285
494
495         Remove support for callable regexps.  If it breaks sites we can
496         just roll this out.
497
498         * runtime/RegExpObject.cpp:
499         * runtime/RegExpObject.h:
500         * tests/mozilla/expected.html: update results.
501
502 2011-01-19  Antti Koivisto  <antti@apple.com>
503
504         Reviewed by Oliver Hunt.
505
506         Cache function offsets to speed up javascript parsing
507         https://bugs.webkit.org/show_bug.cgi?id=52622
508         
509         Use cache to save function offsets and some other info.
510         This avoids quite a bit of work when reparsing the source.
511
512         * parser/ASTBuilder.h:
513         * parser/JSParser.cpp:
514         (JSC::JSParser::CachedFunctionInfo::CachedFunctionInfo):
515         (JSC::JSParser::CachedFunctionInfo::approximateByteSize):
516         (JSC::JSParser::CachedFunctionInfo::closeBraceToken):
517         (JSC::JSParser::Scope::copyCapturedVariablesToVector):
518         (JSC::JSParser::Scope::saveFunctionInfo):
519         (JSC::JSParser::Scope::restoreFunctionInfo):
520         (JSC::JSParser::findCachedFunctionInfo):
521         (JSC::JSParser::JSParser):
522         (JSC::JSParser::parseProgram):
523         (JSC::JSParser::parseFunctionInfo):
524         * parser/Lexer.h:
525         (JSC::Lexer::setOffset):
526         (JSC::Lexer::setLineNumber):
527         (JSC::Lexer::sourceProvider):
528         * parser/SourceProvider.h:
529         (JSC::SourceProviderCache::SourceProviderCache):
530         (JSC::SourceProviderCache::~SourceProviderCache):
531         (JSC::SourceProviderCache::byteSize):
532         (JSC::SourceProviderCache::add):
533         (JSC::SourceProviderCache::get):
534         (JSC::SourceProvider::SourceProvider):
535         (JSC::SourceProvider::~SourceProvider):
536         (JSC::SourceProvider::cache):
537         (JSC::SourceProvider::notifyCacheSizeChanged):
538         (JSC::SourceProvider::cacheSizeChanged):
539         * parser/SyntaxChecker.h:
540
541 2011-01-19  Mark Rowe  <mrowe@apple.com>
542
543         Reviewed by Darin Adler.
544
545         Follow-up to r75766 / <rdar://problem/5469576>.
546
547         * DerivedSources.make: Evaluate the SDKROOT variable correctly.
548
549 2011-01-19  Oliver Hunt  <oliver@apple.com>
550
551         Reviewed by Gavin Barraclough.
552
553         [jsfunfuzz] Defining a function called __proto__ inside an eval triggers an assertion
554         https://bugs.webkit.org/show_bug.cgi?id=52672
555
556         Rather than coming up with a somewhat convoluted mechanism to ensure that
557         developers can override the global objects prototype with a function named
558         __proto__ and expect it to work, we just disallow it at the syntax level.
559
560         * parser/JSParser.cpp:
561         (JSC::JSParser::parseFunctionInfo):
562
563 2011-01-19  Michael Saboff  <msaboff@apple.com>
564
565         Reviewed by Darin Adler.
566
567         <rdar://problem/8882994> Regression: Simple nested backtrack hangs
568         https://bugs.webkit.org/show_bug.cgi?id=52675
569
570         The changeset (r76076) for https://bugs.webkit.org/show_bug.cgi?id=52540
571         broke simple backtracking in some cases.  Reworked that change to 
572         link both jumps and labels.
573
574         * yarr/YarrJIT.cpp:
575         (JSC::Yarr::YarrGenerator::BacktrackDestination::hasBacktrackToLabel):
576         (JSC::Yarr::YarrGenerator::TermGenerationState::propagateBacktrackingFrom):
577         (JSC::Yarr::YarrGenerator::generateParenthesesSingle):
578
579 2011-01-19  Pavel Podivilov  <podivilov@chromium.org>
580
581         Reviewed by Yury Semikhatsky.
582
583         Web Inspector: [JSC] scripts have incorrect starting line (always 1).
584         https://bugs.webkit.org/show_bug.cgi?id=52721
585
586         * debugger/Debugger.cpp:
587         (JSC::Debugger::recompileAllJSFunctions):
588         * debugger/Debugger.h:
589         * parser/Parser.h:
590         (JSC::Parser::parse):
591         * parser/SourceCode.h:
592         (JSC::SourceCode::SourceCode):
593         * parser/SourceProvider.h:
594         (JSC::SourceProvider::startPosition):
595
596 2011-01-19  Csaba Osztrogonác  <ossy@webkit.org>
597
598         Reviewed by Laszlo Gombos and Tor Arne Vestbø.
599
600         [Qt] Remove unnecessary "../Source" from paths
601         after moving source files into Source is finished.
602
603         * JavaScriptCore.pri:
604
605 2011-01-19  Benjamin Kalman  <kalman@chromium.org>
606
607         Reviewed by Darin Adler.
608
609         Don't return void from void function String::split
610         https://bugs.webkit.org/show_bug.cgi?id=52684
611
612         * wtf/text/WTFString.cpp:
613         (WTF::String::split):
614
615 2011-01-18  Kenneth Russell  <kbr@google.com>
616
617         Unreviewed, rolling out r76078.
618         http://trac.webkit.org/changeset/76078
619         https://bugs.webkit.org/show_bug.cgi?id=52668
620
621         Caused crashes of fast/canvas/webgl/constants.html,
622         fast/canvas/webgl/gl-enum-tests.html, and possibly other layout
623         test crashes in Release mode. WebGL crashes were observed with
624         "run-webkit-tests fast/canvas/webgl". It was necessary to run
625         multiple tests to provoke the crash.
626
627         * interpreter/RegisterFile.h:
628         (JSC::RegisterFile::markGlobals):
629         * runtime/JSActivation.cpp:
630         (JSC::JSActivation::markChildren):
631         * runtime/JSGlobalObject.cpp:
632         (JSC::JSGlobalObject::markChildren):
633
634 2011-01-18  Oliver Hunt  <oliver@apple.com>
635
636         Reviewed by Gavin Barraclough.
637
638         [jsfunfuzz] Assertion asking activation for arguments when arguments is overridden
639         https://bugs.webkit.org/show_bug.cgi?id=52690
640
641         Clean up code to retrieve arguments from activation and function objects.
642         Remove the incorrect assertion from JSActivation's argumentsGetter.
643
644         * interpreter/Interpreter.cpp:
645         (JSC::Interpreter::retrieveArguments):
646         * runtime/JSActivation.cpp:
647         (JSC::JSActivation::argumentsGetter):
648
649 2011-01-18  Geoffrey Garen  <ggaren@apple.com>
650
651         Reviewed by Darin Adler.
652
653         Removed RegisterFile::markGlobals because it was obtuse, and it
654         unnecessarily relied on conservative marking.
655         https://bugs.webkit.org/show_bug.cgi?id=52668
656
657         * interpreter/RegisterFile.h: Removed markGlobals.
658
659         * runtime/JSActivation.cpp:
660         (JSC::JSActivation::markChildren): Added a comment explaning why some
661         JSActivations don't always mark their registers arrays.
662
663         * runtime/JSGlobalObject.cpp:
664         (JSC::JSGlobalObject::markChildren): Instead of calling markGlobals, mark
665         the registers array directly.
666
667 2011-01-18  Michael Saboff  <msaboff@apple.com>
668
669         Reviewed by Oliver Hunt.
670
671         <rdar://problem/8875432> Regression: Some text-only e-mails cause hang beneath RegExp::match (52540)
672         https://bugs.webkit.org/show_bug.cgi?id=52540
673         https://bugs.webkit.org/show_bug.cgi?id=52662
674
675         Directly use backtrack label with parentheses nested under a
676         non-capturing parentheses.  Also linked current parentheses
677         tail code object for possible parens nested within a non-capturing
678         parentheses.
679
680         * yarr/YarrJIT.cpp:
681         (JSC::Yarr::YarrGenerator::BacktrackDestination::linkBacktrackToLabel):
682         (JSC::Yarr::YarrGenerator::generateParenthesesSingle):
683
684 2011-01-18  Daniel Bates  <dbates@rim.com>
685
686         Reviewed by Gavin Barraclough.
687
688         Only use moving memory model assumption in ExecutableAllocator::intializePageSize() for Symbian OS
689         https://bugs.webkit.org/show_bug.cgi?id=52517
690
691         Patch by David Tapuska
692
693         Currently, we compile code with respect to the Symbian-specific moving memory model
694         assumption for all ARMv5 or lower architectures. Instead, we should only compile
695         such code when building for Symbian OS on those architectures because this model
696         is Symbian-specific.
697
698         * jit/ExecutableAllocator.cpp:
699         (JSC::ExecutableAllocator::intializePageSize):
700
701 2011-01-18  Dimitry Andric  <dim@freebsd.org>
702
703         Reviewed by Andreas Kling.
704
705         Fix linking JavaScriptCore on FreeBSD/amd64
706         https://bugs.webkit.org/show_bug.cgi?id=52591
707
708         Linking of JavaScriptCore on FreeBSD/amd64 fails, for the same reason as
709         in bug 28422: cti_vm_throw needs a "@plt" suffix, otherwise the linker
710         complains about the relocation type.
711
712         * jit/JITStubs.cpp: use @plt suffix on x86_64 platforms, for both Linux
713         and FreeBSD.
714
715 2011-01-18  Oliver Hunt  <oliver@apple.com>
716
717         Reviewed by Antti Koivisto.
718
719         [jsfunfuzz] Assertion in codegen for array of NaN constants
720         https://bugs.webkit.org/show_bug.cgi?id=52643
721
722         Don't cache NaN literals in the code generator, as NaN doesn't compare
723         as equal to itself it causes problems when rehashing the number cache.
724
725         * bytecompiler/BytecodeGenerator.cpp:
726         (JSC::BytecodeGenerator::emitLoad):
727
728 2011-01-17  Jarred Nicholls  <jarred@sencha.com>
729
730         Reviewed by Csaba Osztrogonác.
731
732         REGRESSION(r75709): Return value of fscanf() shouldn't be ignored.
733         https://bugs.webkit.org/show_bug.cgi?id=52585
734         
735         gcc 4.4.4+ has warn_unused_value attribute on fscanf, so we should check
736         the return value to get around the gcc warning
737
738         * jit/ExecutableAllocatorFixedVMPool.cpp:
739         (JSC::maybeModifyVMPoolSize):
740
741 2011-01-17  Michael Saboff  <msaboff@apple.com>
742
743         Reviewed by Oliver Hunt.
744
745         [regexfuzz] Crash running regex with lookahead
746         https://bugs.webkit.org/show_bug.cgi?id=52548
747
748         Eliminated agressive chaining of backtracks.  This code was overwriting
749         already valid backtrack information.
750
751         * yarr/YarrJIT.cpp:
752         (JSC::Yarr::YarrGenerator::ParenthesesTail::processBacktracks):
753
754 2011-01-17  Tony Gentilcore  <tonyg@chromium.org>
755
756         Reviewed by Alexey Proskuryakov.
757
758         Fix some headers with missing or misspelled #ifndef guards
759         https://bugs.webkit.org/show_bug.cgi?id=52545
760
761         * wtf/RefPtrHashMap.h:
762
763 2011-01-17  Dan Bernstein  <mitz@apple.com>
764
765         Rubber-stamped by Mark Rowe.
766
767         Update xcodeproj svn:ignore to include xcuserdata.
768
769         * JavaScriptCore.xcodeproj: Modified property svn:ignore.
770
771 2011-01-16  Adam Barth  <abarth@webkit.org>
772
773         Rubber-stamped by Eric Seidel.
774
775         Move WebKit into Source
776         https://bugs.webkit.org/show_bug.cgi?id=52530
777
778         * JavaScriptCore.gyp/JavaScriptCore.gyp:
779
780 2011-01-16  Oliver Hunt  <oliver@apple.com>
781
782         Reviewed by Sam Weinig.
783
784         [jsfunfuzz] Parser doesn't correctly validate for-loop syntax
785         https://bugs.webkit.org/show_bug.cgi?id=52516
786
787         Ensure that we always check for a semicolon after encountering
788         multiple declarations in the initialiser portion of a for-loop.
789
790         * parser/JSParser.cpp:
791         (JSC::JSParser::parseForStatement):
792
793 2011-01-16  Oliver Hunt  <oliver@apple.com>
794
795         Reviewed by Geoffrey Garen.
796
797         Strict mode restrictions on arguments and eval usage aren't complete
798         https://bugs.webkit.org/show_bug.cgi?id=52528
799
800         Fix a few bugs in strict mode where we incorrect allow mutation of
801         arguments and eval in the parser.
802
803         Alas the "optimisation" used by the syntax checker for validating
804         binary and unary expressions was too aggressive: we do actually need
805         a stack for operations and operands although it needn't be as complete
806         as that used for the full AST builder.
807
808         Also disallow assignment to arguments in all cases as allowing arguments
809         to be assignable is always an error in strict mode, regardless of context.
810
811         * parser/ASTBuilder.h:
812         (JSC::ASTBuilder::BinaryExprContext::BinaryExprContext):
813         (JSC::ASTBuilder::UnaryExprContext::UnaryExprContext):
814         * parser/JSParser.cpp:
815         (JSC::JSParser::parseAssignmentExpression):
816         (JSC::JSParser::parseBinaryExpression):
817         (JSC::JSParser::parseUnaryExpression):
818         * parser/SyntaxChecker.h:
819         (JSC::SyntaxChecker::BinaryExprContext::BinaryExprContext):
820         (JSC::SyntaxChecker::BinaryExprContext::~BinaryExprContext):
821         (JSC::SyntaxChecker::UnaryExprContext::UnaryExprContext):
822         (JSC::SyntaxChecker::UnaryExprContext::~UnaryExprContext):
823         (JSC::SyntaxChecker::appendBinaryExpressionInfo):
824         (JSC::SyntaxChecker::operatorStackPop):
825
826 2011-01-15  Geoffrey Garen  <ggaren@apple.com>
827
828         Reviewed by Oliver Hunt.
829
830         Rolled back in r75886.
831         https://bugs.webkit.org/show_bug.cgi?id=52527
832         
833         r75886 broke the GTK Linux bot because Linux was -- quite surprisingly --
834         set up to use the constants for embedded devices.
835
836         * jit/ExecutableAllocatorFixedVMPool.cpp:
837         (JSC::maybeModifyVMPoolSize): Separated Linux constants from embedded
838         constants.
839
840 2011-01-15  Sheriff Bot  <webkit.review.bot@gmail.com>
841
842         Unreviewed, rolling out r75886.
843         http://trac.webkit.org/changeset/75886
844         https://bugs.webkit.org/show_bug.cgi?id=52526
845
846         "Broke GTK+ 64bit" (Requested by xan_ on #webkit).
847
848         * jit/ExecutableAllocatorFixedVMPool.cpp:
849
850 2011-01-15  Geoffrey Garen  <ggaren@apple.com>
851
852         Reviewed by Sam Weinig.
853
854         <rdar://problem/8870429> Shrink the executable pool on embedded devices
855
856         * jit/ExecutableAllocatorFixedVMPool.cpp: Dropped the pool size from 32MB
857         to 16MB.
858
859 2011-01-15  Oliver Hunt  <oliver@apple.com>
860
861         Reviewed by Maciej Stachowiak.
862
863         Incorrect behavior changing attributes of an accessor
864         https://bugs.webkit.org/show_bug.cgi?id=52515
865
866         defineProperty doesn't correctly handle changing attributes of an accessor
867         property.  This is because we don't pass the full descriptor to the 
868         putDescriptor helper function, which means we have insufficient information
869         to do the right thing. Once that's passed the correct behavior is relatively
870         simple to implement.
871
872         * runtime/JSObject.cpp:
873         (JSC::putDescriptor):
874         (JSC::JSObject::defineOwnProperty):
875
876 2011-01-14  Oliver Hunt  <oliver@apple.com>
877
878         Reviewed by Maciej Stachowiak.
879
880         [jsfunfuzz] Incorrect handling of consecutive duplicate labels
881         https://bugs.webkit.org/show_bug.cgi?id=52505
882
883         Compare StringImpl*'s instead of Identifier*'s when looking for duplicate
884         labels.
885
886         * parser/JSParser.cpp:
887         (JSC::JSParser::parseExpressionOrLabelStatement):
888
889 2011-01-14  Simon Fraser  <simon.fraser@apple.com>
890
891         No review.
892         
893         Initialize m_operationInProgress after r75855.
894
895         * runtime/Heap.cpp:
896         (JSC::Heap::Heap):
897
898 2011-01-14  Geoffrey Garen  <ggaren@apple.com>
899
900         Reverted accidentally committed code from my last checkin.
901
902         * runtime/Heap.cpp:
903         (JSC::Heap::markRoots):
904
905 2011-01-14  Geoffrey Garen  <ggaren@apple.com>
906
907         Reviewed by Sam Weinig.
908         
909         Try to fix the GTK bot.
910
911         * runtime/Heap.cpp:
912         (JSC::Heap::Heap):
913         (JSC::Heap::markRoots): Kids, remember to initialize your data members.
914         Knowing is half the battle.
915
916 2011-01-14  Oliver Hunt  <oliver@apple.com>
917
918         Reviewed by Stephanie Lewis.
919
920         [jsfunfuzz] We should be clearing the lexers temporary character buffers when switching to strict mode
921         https://bugs.webkit.org/show_bug.cgi?id=52501
922
923         Clear the temporary character buffers used for reading escaped characters and
924         numbers.
925
926         * parser/Lexer.h:
927         (JSC::Lexer::setOffset):
928
929 2011-01-14  Geoffrey Garen  <ggaren@apple.com>
930
931         Try to fix non-Dtrace builds: #include Tracing.h instead of TracingDtrace.h.
932
933         * runtime/Heap.cpp:
934
935 2011-01-13  Geoffrey Garen  <ggaren@apple.com>
936
937         Reviewed by Oliver Hunt.
938
939         Split out a MarkedSpace strategy object from Heap.
940         https://bugs.webkit.org/show_bug.cgi?id=52421
941         
942         SunSpider reports no change.
943
944         * Android.mk:
945         * CMakeLists.txt:
946         * GNUmakefile.am:
947         * JavaScriptCore.gypi:
948         * JavaScriptCore.pro:
949         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
950         * JavaScriptCore.xcodeproj/project.pbxproj: Updated our 7 build systems. Which is cool.
951
952         * runtime/Heap.cpp:
953         (JSC::Heap::Heap):
954         (JSC::Heap::destroy):
955         (JSC::Heap::recordExtraCost):
956         (JSC::Heap::allocate):
957         (JSC::Heap::markConservatively):
958         (JSC::Heap::markRoots):
959         (JSC::Heap::objectCount):
960         (JSC::Heap::statistics):
961         (JSC::Heap::size):
962         (JSC::Heap::isBusy):
963         (JSC::Heap::collectAllGarbage):
964         (JSC::Heap::primaryHeapBegin):
965         (JSC::Heap::primaryHeapEnd):
966         * runtime/Heap.h:
967         (JSC::Heap::globalData):
968         (JSC::Heap::markedSpace):
969         (JSC::Heap::isCellMarked):
970         (JSC::Heap::checkMarkCell):
971         (JSC::Heap::markCell): Moved all code pertaining to managing chunks of
972         collector memory out of this class. Heap now just delegates to MarkedSpace.
973
974         * runtime/JSCell.h:
975         (JSC::JSCell::Heap::heap): Updated for MarkedSpace delegation.
976
977         * runtime/JSValue.h: Moved the ValueStringPair typedef to help with #includes.
978
979         * runtime/MarkedSpace.cpp: Copied from runtime/Heap.cpp.
980         (JSC::MarkedSpace::MarkedSpace):
981         (JSC::MarkedSpace::destroy):
982         (JSC::MarkedSpace::allocateBlock):
983         (JSC::MarkedSpace::freeBlock):
984         (JSC::MarkedSpace::allocate):
985         (JSC::MarkedSpace::resizeBlocks):
986         (JSC::MarkedSpace::growBlocks):
987         (JSC::MarkedSpace::shrinkBlocks):
988         (JSC::MarkedSpace::markConservatively):
989         (JSC::MarkedSpace::clearMarkBits):
990         (JSC::MarkedSpace::markedCells):
991         (JSC::MarkedSpace::sweep):
992         (JSC::MarkedSpace::objectCount):
993         (JSC::MarkedSpace::addToStatistics):
994         (JSC::MarkedSpace::statistics):
995         (JSC::MarkedSpace::size):
996         (JSC::MarkedSpace::reset):
997         (JSC::MarkedSpace::primaryHeapBegin):
998         (JSC::MarkedSpace::primaryHeapEnd):
999         * runtime/MarkedSpace.h: Copied from runtime/Heap.h.
1000         (JSC::MarkedSpace::globalData):
1001         (JSC::MarkedSpace::didShrink):
1002         (JSC::MarkedSpace::cellBlock):
1003         (JSC::MarkedSpace::cellOffset):
1004         (JSC::MarkedSpace::isCellMarked):
1005         (JSC::MarkedSpace::checkMarkCell):
1006         (JSC::MarkedSpace::markCell): Moved all code pertaining to managing chunks of
1007         collector memory into this class.
1008
1009         * runtime/MemoryStatistics.cpp:
1010         (JSC::heapStatistics):
1011         * runtime/MemoryStatistics.h: Updated for MarkedSpace delegation.
1012
1013 2011-01-14  Oliver Hunt  <oliver@apple.com>
1014
1015         Reviewed by Gavin Barraclough.
1016
1017         [jsfunfuzz] parser doesn't enforce continue restrictions correctly.
1018         https://bugs.webkit.org/show_bug.cgi?id=52493
1019
1020         This patch reworks handling of break, continue and label statements
1021         to correctly handle all the valid and invalid cases.  Previously certain
1022         errors would be missed by the parser in strict mode, but the bytecode 
1023         generator needed to handle those cases for non-strict code so nothing
1024         failed, it simply became non-standard behaviour.
1025
1026         Now that we treat break and continue errors as early faults in non-strict
1027         mode as well that safety net has been removed so the parser bugs result in
1028         crashes at codegen time.
1029
1030         * parser/JSParser.cpp:
1031         (JSC::JSParser::ScopeLabelInfo::ScopeLabelInfo):
1032         (JSC::JSParser::next):
1033         (JSC::JSParser::nextTokenIsColon):
1034         (JSC::JSParser::continueIsValid):
1035             Continue is only valid in loops so we can't use breakIsValid()
1036         (JSC::JSParser::pushLabel):
1037             We now track whether the label is for a loop (and is therefore a
1038             valid target for continue.
1039         (JSC::JSParser::popLabel):
1040         (JSC::JSParser::getLabel):
1041             Replace hasLabel with getLabel so that we can validate the target
1042             when parsing continue statements.
1043         (JSC::JSParser::Scope::continueIsValid):
1044         (JSC::JSParser::Scope::pushLabel):
1045         (JSC::JSParser::Scope::getLabel):
1046         (JSC::JSParser::JSParser):
1047         (JSC::JSParser::parseBreakStatement):
1048         (JSC::JSParser::parseContinueStatement):
1049         (JSC::LabelInfo::LabelInfo):
1050         (JSC::JSParser::parseExpressionOrLabelStatement):
1051             Consecutive labels now get handled iteratively so that we can determine
1052             whether they're valid targets for continue.
1053         * parser/Lexer.cpp:
1054         (JSC::Lexer::nextTokenIsColon):
1055         * parser/Lexer.h:
1056         (JSC::Lexer::setOffset):
1057
1058 2011-01-14  Patrick Gansterer  <paroga@webkit.org>
1059
1060         Reviewed by Adam Roben.
1061
1062         Use the Windows thread pool instead of an extra thread for FastMalloc scavenging
1063         https://bugs.webkit.org/show_bug.cgi?id=45186
1064
1065         * wtf/FastMalloc.cpp:
1066         (WTF::TCMalloc_PageHeap::scheduleScavenger): Added missing this pointer to CreateTimerQueueTimer().
1067
1068 2011-01-14  Patrick Gansterer  <paroga@webkit.org>
1069
1070         Reviewed by Adam Roben.
1071
1072         Use the Windows thread pool instead of an extra thread for FastMalloc scavenging
1073         https://bugs.webkit.org/show_bug.cgi?id=45186
1074
1075         r75819 accidentally changed the initial state of the scavenge timer.
1076
1077         * wtf/FastMalloc.cpp:
1078         (WTF::TCMalloc_PageHeap::initializeScavenger): Changed initial state of m_scavengingSuspended to true.
1079
1080 2011-01-14  Patrick Gansterer  <paroga@webkit.org>
1081
1082         Unreviewed Windows Release build fix.
1083
1084         * wtf/FastMalloc.cpp:
1085         (WTF::TCMalloc_PageHeap::scavengerTimerFired):
1086
1087 2011-01-14  Patrick Gansterer  <paroga@webkit.org>
1088
1089         Unreviewed Windows Release build fix.
1090
1091         * wtf/FastMalloc.cpp:
1092         (WTF::TCMalloc_PageHeap::scavengerTimerFired):
1093
1094 2011-01-14  Patrick Gansterer  <paroga@webkit.org>
1095
1096         Reviewed by Adam Roben.
1097
1098         Use the Windows thread pool instead of an extra thread for FastMalloc scavenging
1099         https://bugs.webkit.org/show_bug.cgi?id=45186
1100
1101         Use CreateTimerQueueTimer() to start periodicScavenge() and stop it with DeleteTimerQueueTimer().
1102
1103         * wtf/FastMalloc.cpp:
1104         (WTF::TCMalloc_PageHeap::initializeScavenger):
1105         (WTF::TCMalloc_PageHeap::isScavengerSuspended):
1106         (WTF::TCMalloc_PageHeap::scheduleScavenger):
1107         (WTF::TCMalloc_PageHeap::rescheduleScavenger):
1108         (WTF::TCMalloc_PageHeap::suspendScavenger):
1109         (WTF::scavengerTimerFired):
1110         (WTF::TCMalloc_PageHeap::periodicScavenge):
1111         (WTF::TCMalloc_PageHeap::signalScavenger):
1112
1113 2011-01-14  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
1114
1115         Reviewed by Kenneth Rohde Christiansen.
1116
1117         Align import/export directives
1118         https://bugs.webkit.org/show_bug.cgi?id=52208
1119
1120         * API/JSBase.h: Align import/export directives with
1121         WebKit2/Shared/API/c/WKBase.h
1122
1123 2011-01-14  Michael Saboff  <msaboff@apple.com>
1124
1125         Reviewed by Oliver Hunt.
1126
1127         Incorrect backtracking for nested alternatives
1128         https://bugs.webkit.org/show_bug.cgi?id=52387
1129
1130         In the process of propigating a datalabel it wasn't getting connected
1131         to a destination when the destination was an indirect jump.  Added
1132         code to recognize a direct backtrack destination that was an indirect
1133         jump and added mechanism to associate DataLabelPtrs with indirect
1134         jump entries.
1135         Removed dead method
1136         BacktrackDestination::linkDataLabelToHereIfExists()
1137
1138         * yarr/YarrJIT.cpp:
1139         (JSC::Yarr::YarrGenerator::IndirectJumpEntry::IndirectJumpEntry):
1140         (JSC::Yarr::YarrGenerator::IndirectJumpEntry::addDataLabel):
1141         (JSC::Yarr::YarrGenerator::GenerationState::addIndirectJumpEntry):
1142         (JSC::Yarr::YarrGenerator::GenerationState::emitIndirectJumpTable):
1143         Changes to link indirect jumps with DataLabelPtr's.
1144         (JSC::Yarr::YarrGenerator::BacktrackDestination::clearSubDataLabelPtr):
1145         (JSC::Yarr::YarrGenerator::TermGenerationState::linkDataLabelToBacktrackIfExists): 
1146         Updated to handle immediate linking of indirect jumps to
1147         DataLabelPtr.
1148         (JSC::Yarr::YarrGenerator::generateParenthesesDisjunction): Changed to
1149         reflect updated linkDataLabelToBacktrackIfExists().
1150
1151 2011-01-14  Pavel Podivilov  <podivilov@chromium.org>
1152
1153         Reviewed by Yury Semikhatsky.
1154
1155         Web Inspector: provide script column offset to frontend.
1156         https://bugs.webkit.org/show_bug.cgi?id=52377
1157
1158         * parser/SourceCode.h:
1159         (JSC::SourceCode::SourceCode):
1160         (JSC::SourceCode::firstColumn):
1161
1162 2011-01-13  Darin Adler  <darin@apple.com>
1163
1164         Reviewed by Geoff Garen.
1165
1166         <rdar://problem/5469576> Use __PTK_FRAMEWORK_JAVASCRIPTCORE_KEY0 if available.
1167
1168         * DerivedSources.make: Create a header file, HeaderDetection.h, that tells
1169         us whether pthread_machdep.h is available.
1170         * wtf/FastMalloc.cpp: If __PTK_FRAMEWORK_JAVASCRIPTCORE_KEY0 is available, then
1171         don't do the pthread_getspecific_function_pointer trick.
1172         (WTF::setThreadHeap): Ditto, but set thread-specific data.
1173         (WTF::TCMalloc_ThreadCache::GetThreadHeap): Ditto, but get rather than set.
1174
1175 2011-01-13  Xan Lopez  <xlopez@igalia.com>
1176
1177         Reviewed by Gavin Barraclough.
1178
1179         JIT requires VM overcommit (particularly on x86-64), Linux does not by default support this without swap?
1180         https://bugs.webkit.org/show_bug.cgi?id=42756
1181
1182         The FixedVMPool Allocator does not work well on systems where
1183         allocating very large amounts of memory upfront is not reasonable,
1184         like Linux without overcommit enabled. As a workaround, on Linux,
1185         default to the values used in embedded environments (in the MB
1186         range), and only jump to the GB range if we detect at runtime that
1187         overcommit is enabled. Should fix crashes on Linux/x86_64 with
1188         less than 3 or 4GB of RAM.
1189
1190         * jit/ExecutableAllocatorFixedVMPool.cpp:
1191         (JSC::FixedVMPoolAllocator::free): use new variables for VM pool
1192         size and coalesce limit.
1193         (JSC::ExecutableAllocator::isValid): swap the variables from
1194         embedded to generic values at runtime, on linux, if overcommit is
1195         enabled.
1196         (JSC::ExecutableAllocator::underMemoryPressure): use new variables
1197         for VM pool size and coalesce limit.
1198
1199 2011-01-12  Xan Lopez  <xlopez@igalia.com>
1200
1201         Reviewed by Martin Robinson.
1202
1203         Add new Yarr.h header to the list file.
1204
1205         * GNUmakefile.am: ditto.
1206
1207 2011-01-12  Martin Robinson  <mrobinson@igalia.com>
1208
1209         Missing Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h in WebKitGtk tarball
1210         https://bugs.webkit.org/show_bug.cgi?id=52299
1211
1212         * GNUmakefile.am: Fix the GTK+ build on ARMv7 by including missing source
1213         files in the source list.
1214
1215 2011-01-12  Peter Varga  <pvarga@webkit.org>
1216
1217         Reviewed by Gavin Barraclough.
1218
1219         Add Yarr.h to YARR
1220         https://bugs.webkit.org/show_bug.cgi?id=51021
1221
1222         Move other common constants and functions from YARR's different files
1223         to Yarr.h.
1224         Use Yarr.h header instead of including other YARR headers where it
1225         is possible.
1226
1227         * JavaScriptCore.gypi:
1228         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1229         * JavaScriptCore.xcodeproj/project.pbxproj:
1230         * runtime/RegExp.cpp:
1231         * yarr/Yarr.h: Added.
1232         * yarr/YarrInterpreter.cpp:
1233         * yarr/YarrInterpreter.h:
1234         * yarr/YarrJIT.cpp:
1235         (JSC::Yarr::jitCompile):
1236         (JSC::Yarr::execute):
1237         * yarr/YarrJIT.h:
1238         * yarr/YarrParser.h:
1239         * yarr/YarrPattern.cpp:
1240         (JSC::Yarr::YarrPattern::compile):
1241         (JSC::Yarr::YarrPattern::YarrPattern):
1242         * yarr/YarrPattern.h:
1243
1244 2011-01-12  Sheriff Bot  <webkit.review.bot@gmail.com>
1245
1246         Unreviewed, rolling out r75595.
1247         http://trac.webkit.org/changeset/75595
1248         https://bugs.webkit.org/show_bug.cgi?id=52286
1249
1250         It broke fast/regex/pcre-test-1.html (Requested by Ossy on
1251         #webkit).
1252
1253         * JavaScriptCore.gypi:
1254         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1255         * JavaScriptCore.xcodeproj/project.pbxproj:
1256         * runtime/RegExp.cpp:
1257         * yarr/Yarr.h: Removed.
1258         * yarr/YarrInterpreter.cpp:
1259         * yarr/YarrInterpreter.h:
1260         * yarr/YarrJIT.cpp:
1261         (JSC::Yarr::jitCompile):
1262         * yarr/YarrJIT.h:
1263         (JSC::Yarr::execute):
1264         * yarr/YarrParser.h:
1265         * yarr/YarrPattern.cpp:
1266         (JSC::Yarr::compile):
1267         (JSC::Yarr::YarrPattern::YarrPattern):
1268         * yarr/YarrPattern.h:
1269
1270 2011-01-12  Peter Varga  <pvarga@webkit.org>
1271
1272         Reviewed by Gavin Barraclough.
1273
1274         Add Yarr.h to YARR
1275         https://bugs.webkit.org/show_bug.cgi?id=51021
1276
1277         Move other common constants and functions from YARR's different files
1278         to Yarr.h.
1279         Use Yarr.h header instead of including other YARR headers where it
1280         is possible.
1281
1282         * JavaScriptCore.gypi:
1283         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1284         * JavaScriptCore.xcodeproj/project.pbxproj:
1285         * runtime/RegExp.cpp:
1286         * yarr/Yarr.h: Added.
1287         * yarr/YarrInterpreter.cpp:
1288         * yarr/YarrInterpreter.h:
1289         * yarr/YarrJIT.cpp:
1290         (JSC::Yarr::jitCompile):
1291         (JSC::Yarr::execute):
1292         * yarr/YarrJIT.h:
1293         * yarr/YarrParser.h:
1294         * yarr/YarrPattern.cpp:
1295         (JSC::Yarr::YarrPattern::compile):
1296         (JSC::Yarr::YarrPattern::YarrPattern):
1297         * yarr/YarrPattern.h:
1298
1299 2011-01-11  Michael Saboff  <msaboff@apple.com>
1300
1301         Reviewed by Geoffrey Garen.
1302
1303         Missing call to popTempSortVector() for exception case in JSArray::sort.
1304         https://bugs.webkit.org/show_bug.cgi?id=50718
1305
1306         Fix to patch of 50718 that added pushTempSortVector() and 
1307         popTempSortVector() to JSArray::sort() to mark elements during sort.
1308         Need to add popTempSortVector() for the return case if toString()
1309         had an exception.
1310
1311         * runtime/JSArray.cpp:
1312         (JSC::JSArray::sort): Added popTempSortVector()
1313
1314 2011-01-11  Xan Lopez  <xlopez@igalia.com>
1315
1316         Reviewed by Darin Adler.
1317
1318         Microoptimization in ~JSString
1319         https://bugs.webkit.org/show_bug.cgi?id=52222
1320
1321         The case where m_fibers is 0 seems to be the most common one
1322         (almost 1/2 of the time, followed at some distance by m_fibers = 1
1323         in 1/4 of the cases in a typical SunSpider execution). We can save
1324         one comparison in this common case by doing a bit of refactoring
1325         in the JSString destructor; overall a 0.3% progression, but only
1326         the string tests show improvement.
1327
1328         * runtime/JSString.h:
1329         (JSC::RopeBuilder::~JSString):
1330
1331 2011-01-10  Michael Saboff  <msaboff@apple.com>
1332
1333         Reviewed by Geoffrey Garen.
1334
1335         ASSERTION Failure in JSC::binaryChop
1336         https://bugs.webkit.org/show_bug.cgi?id=25614
1337
1338         Changed JITStubs::cti_register_file_check() to use the current stack's
1339         return PC to find the bytecode for handling the exception in the prior
1340         frame.  Also added the appropriate arrity check routine call to the
1341         JIT to bytecode vector (m_callReturnIndexVector) in the CodeBlock.
1342
1343         * jit/JIT.cpp:
1344         (JSC::JIT::privateCompile): Changed the arrity check call location
1345         so that it gets added to the m_calls list so that it's included in
1346         CodeBlock::m_callReturnIndexVector.
1347         * jit/JITStubs.cpp:
1348         (JSC::DEFINE_STUB_FUNCTION): Use the current call frame's return PC.
1349
1350 2011-01-10  Daniel Bates  <dbates@rim.com>
1351
1352         Reviewed by Martin Robinson.
1353
1354         Remove extraneous COMPILER(GCC) condition when checking GCC_VERSION_AT_LEAST()
1355         https://bugs.webkit.org/show_bug.cgi?id=52178
1356
1357         It is sufficient to test GCC_VERSION_AT_LEAST() instead of both COMPILER(GCC) and
1358         GCC_VERSION_AT_LEAST(). Notice GCC_VERSION_AT_LEAST() is defined to be 0 when we
1359         are not compiling with GCC.
1360
1361         Fixes style issues at the callsites (i.e. replace comma with comma-space in
1362         macro function argument list). Also, makes a spelling correction in a comment.
1363
1364         * jit/ExecutableAllocator.h:
1365         (JSC::ExecutableAllocator::cacheFlush):
1366         * wtf/Platform.h:
1367
1368 2011-01-10  Geoffrey Garen  <ggaren@apple.com>
1369
1370         Build fix: removed some uses of nextNumber that I missed last time.
1371
1372         * runtime/Heap.cpp:
1373         (JSC::Heap::reset):
1374         (JSC::Heap::collectAllGarbage):
1375
1376 2011-01-10  Daniel Bates  <dbates@rim.com>
1377
1378         Reviewed by Darin Adler.
1379
1380         Use __builtin_expect when compiling using RVCT in GNU mode
1381         https://bugs.webkit.org/show_bug.cgi?id=51866
1382
1383         We should only use __builtin_expect if we are compiling with GCC or RVCT 3 or higher in GNU mode
1384         as pointed out by Siddharth Mathur per <http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0202h/Cjabddedbde.html>.
1385
1386         * wtf/AlwaysInline.h:
1387         * wtf/Platform.h: Removed define WTF_COMPILER_RVCT4_OR_GREATER. Instead added macro
1388         function RVCT_VERSION_AT_LEAST so that we can test for an arbitrary minimum RVCT
1389         version.
1390
1391 2011-01-10  Geoffrey Garen  <ggaren@apple.com>
1392
1393         Reviewed by Oliver Hunt.
1394
1395         Moved Collector.* => Heap.*, since the file contains a class named "Heap".
1396
1397         * API/JSCallbackObject.cpp:
1398         * Android.mk:
1399         * CMakeLists.txt:
1400         * GNUmakefile.am:
1401         * JavaScriptCore.gypi:
1402         * JavaScriptCore.pro:
1403         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1404         * JavaScriptCore.xcodeproj/project.pbxproj:
1405         * interpreter/Interpreter.cpp:
1406         * interpreter/RegisterFile.h:
1407         * jit/JITStubs.cpp:
1408         * runtime/Collector.cpp: Removed.
1409         * runtime/Collector.h: Removed.
1410         * runtime/CollectorHeapIterator.h:
1411         * runtime/GCActivityCallbackCF.cpp:
1412         * runtime/Heap.cpp: Copied from JavaScriptCore/runtime/Collector.cpp.
1413         * runtime/Heap.h: Copied from JavaScriptCore/runtime/Collector.h.
1414         * runtime/InitializeThreading.cpp:
1415         * runtime/JSCell.h:
1416         * runtime/JSGlobalData.cpp:
1417         * runtime/JSGlobalData.h:
1418         * runtime/JSLock.cpp:
1419         * runtime/JSNumberCell.h:
1420         * runtime/MachineStackMarker.cpp:
1421         * runtime/MemoryStatistics.h:
1422         * runtime/Protect.h:
1423         * runtime/UString.cpp:
1424         * runtime/WeakGCMap.h:
1425         * runtime/WeakGCPtr.h:
1426
1427 2011-01-10  Xan Lopez  <xlopez@igalia.com>
1428
1429         Reviewed by Gavin Barraclough.
1430
1431         Remove unused isString() case in JSString::toPrimitiveString()
1432         https://bugs.webkit.org/show_bug.cgi?id=52167
1433
1434         We never call toPrimitiveString() with strings, so remove the
1435         check and add an ASSERT ensuring this never happens. 0.7% overall
1436         progression in sunspider, since one of the call sites is very hot.
1437
1438         * runtime/JSString.h:
1439         (JSC::JSValue::toPrimitiveString):
1440
1441 2011-01-10  Peter Varga  <pvarga@inf.u-szeged.hu>
1442
1443         Reviewed by Gavin Barraclough.
1444
1445         Rename the existing YARR files and classes
1446         https://bugs.webkit.org/show_bug.cgi?id=51872
1447
1448         Replace the "Regex" prefix with "Yarr" in the name of YARR files and classes.
1449
1450         * Android.mk:
1451         * CMakeLists.txt:
1452         * GNUmakefile.am:
1453         * JavaScriptCore.gypi:
1454         * JavaScriptCore.pro:
1455         * JavaScriptCore.xcodeproj/project.pbxproj:
1456         * runtime/RegExp.cpp:
1457         (JSC::RegExp::compile):
1458         (JSC::RegExp::match):
1459         (JSC::RegExp::printTraceData):
1460         * yarr/YarrInterpreter.cpp: Renamed from Source/JavaScriptCore/yarr/RegexInterpreter.cpp.
1461         (JSC::Yarr::Interpreter::appendParenthesesDisjunctionContext):
1462         (JSC::Yarr::Interpreter::popParenthesesDisjunctionContext):
1463         (JSC::Yarr::Interpreter::DisjunctionContext::DisjunctionContext):
1464         (JSC::Yarr::Interpreter::DisjunctionContext::operator new):
1465         (JSC::Yarr::Interpreter::allocDisjunctionContext):
1466         (JSC::Yarr::Interpreter::freeDisjunctionContext):
1467         (JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::ParenthesesDisjunctionContext):
1468         (JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::operator new):
1469         (JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::restoreOutput):
1470         (JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::getDisjunctionContext):
1471         (JSC::Yarr::Interpreter::allocParenthesesDisjunctionContext):
1472         (JSC::Yarr::Interpreter::freeParenthesesDisjunctionContext):
1473         (JSC::Yarr::Interpreter::InputStream::InputStream):
1474         (JSC::Yarr::Interpreter::InputStream::next):
1475         (JSC::Yarr::Interpreter::InputStream::rewind):
1476         (JSC::Yarr::Interpreter::InputStream::read):
1477         (JSC::Yarr::Interpreter::InputStream::readPair):
1478         (JSC::Yarr::Interpreter::InputStream::readChecked):
1479         (JSC::Yarr::Interpreter::InputStream::reread):
1480         (JSC::Yarr::Interpreter::InputStream::prev):
1481         (JSC::Yarr::Interpreter::InputStream::getPos):
1482         (JSC::Yarr::Interpreter::InputStream::setPos):
1483         (JSC::Yarr::Interpreter::InputStream::atStart):
1484         (JSC::Yarr::Interpreter::InputStream::atEnd):
1485         (JSC::Yarr::Interpreter::InputStream::checkInput):
1486         (JSC::Yarr::Interpreter::InputStream::uncheckInput):
1487         (JSC::Yarr::Interpreter::InputStream::isNotAvailableInput):
1488         (JSC::Yarr::Interpreter::testCharacterClass):
1489         (JSC::Yarr::Interpreter::checkCharacter):
1490         (JSC::Yarr::Interpreter::checkCasedCharacter):
1491         (JSC::Yarr::Interpreter::checkCharacterClass):
1492         (JSC::Yarr::Interpreter::tryConsumeBackReference):
1493         (JSC::Yarr::Interpreter::matchAssertionBOL):
1494         (JSC::Yarr::Interpreter::matchAssertionEOL):
1495         (JSC::Yarr::Interpreter::matchAssertionWordBoundary):
1496         (JSC::Yarr::Interpreter::backtrackPatternCharacter):
1497         (JSC::Yarr::Interpreter::backtrackPatternCasedCharacter):
1498         (JSC::Yarr::Interpreter::matchCharacterClass):
1499         (JSC::Yarr::Interpreter::backtrackCharacterClass):
1500         (JSC::Yarr::Interpreter::matchBackReference):
1501         (JSC::Yarr::Interpreter::backtrackBackReference):
1502         (JSC::Yarr::Interpreter::recordParenthesesMatch):
1503         (JSC::Yarr::Interpreter::resetMatches):
1504         (JSC::Yarr::Interpreter::parenthesesDoBacktrack):
1505         (JSC::Yarr::Interpreter::matchParenthesesOnceBegin):
1506         (JSC::Yarr::Interpreter::matchParenthesesOnceEnd):
1507         (JSC::Yarr::Interpreter::backtrackParenthesesOnceBegin):
1508         (JSC::Yarr::Interpreter::backtrackParenthesesOnceEnd):
1509         (JSC::Yarr::Interpreter::matchParenthesesTerminalBegin):
1510         (JSC::Yarr::Interpreter::matchParenthesesTerminalEnd):
1511         (JSC::Yarr::Interpreter::backtrackParenthesesTerminalBegin):
1512         (JSC::Yarr::Interpreter::backtrackParenthesesTerminalEnd):
1513         (JSC::Yarr::Interpreter::matchParentheticalAssertionBegin):
1514         (JSC::Yarr::Interpreter::matchParentheticalAssertionEnd):
1515         (JSC::Yarr::Interpreter::backtrackParentheticalAssertionBegin):
1516         (JSC::Yarr::Interpreter::backtrackParentheticalAssertionEnd):
1517         (JSC::Yarr::Interpreter::matchParentheses):
1518         (JSC::Yarr::Interpreter::backtrackParentheses):
1519         (JSC::Yarr::Interpreter::lookupForBeginChars):
1520         (JSC::Yarr::Interpreter::matchDisjunction):
1521         (JSC::Yarr::Interpreter::matchNonZeroDisjunction):
1522         (JSC::Yarr::Interpreter::interpret):
1523         (JSC::Yarr::Interpreter::Interpreter):
1524         (JSC::Yarr::ByteCompiler::ParenthesesStackEntry::ParenthesesStackEntry):
1525         (JSC::Yarr::ByteCompiler::ByteCompiler):
1526         (JSC::Yarr::ByteCompiler::compile):
1527         (JSC::Yarr::ByteCompiler::checkInput):
1528         (JSC::Yarr::ByteCompiler::assertionBOL):
1529         (JSC::Yarr::ByteCompiler::assertionEOL):
1530         (JSC::Yarr::ByteCompiler::assertionWordBoundary):
1531         (JSC::Yarr::ByteCompiler::atomPatternCharacter):
1532         (JSC::Yarr::ByteCompiler::atomCharacterClass):
1533         (JSC::Yarr::ByteCompiler::atomBackReference):
1534         (JSC::Yarr::ByteCompiler::atomParenthesesOnceBegin):
1535         (JSC::Yarr::ByteCompiler::atomParenthesesTerminalBegin):
1536         (JSC::Yarr::ByteCompiler::atomParenthesesSubpatternBegin):
1537         (JSC::Yarr::ByteCompiler::atomParentheticalAssertionBegin):
1538         (JSC::Yarr::ByteCompiler::atomParentheticalAssertionEnd):
1539         (JSC::Yarr::ByteCompiler::popParenthesesStack):
1540         (JSC::Yarr::ByteCompiler::dumpDisjunction):
1541         (JSC::Yarr::ByteCompiler::closeAlternative):
1542         (JSC::Yarr::ByteCompiler::closeBodyAlternative):
1543         (JSC::Yarr::ByteCompiler::atomParenthesesSubpatternEnd):
1544         (JSC::Yarr::ByteCompiler::atomParenthesesOnceEnd):
1545         (JSC::Yarr::ByteCompiler::atomParenthesesTerminalEnd):
1546         (JSC::Yarr::ByteCompiler::regexBegin):
1547         (JSC::Yarr::ByteCompiler::regexEnd):
1548         (JSC::Yarr::ByteCompiler::alternativeBodyDisjunction):
1549         (JSC::Yarr::ByteCompiler::alternativeDisjunction):
1550         (JSC::Yarr::ByteCompiler::emitDisjunction):
1551         (JSC::Yarr::byteCompile):
1552         (JSC::Yarr::interpret):
1553         * yarr/YarrInterpreter.h: Renamed from Source/JavaScriptCore/yarr/RegexInterpreter.h.
1554         (JSC::Yarr::ByteTerm::ByteTerm):
1555         (JSC::Yarr::ByteTerm::BOL):
1556         (JSC::Yarr::ByteTerm::CheckInput):
1557         (JSC::Yarr::ByteTerm::EOL):
1558         (JSC::Yarr::ByteTerm::WordBoundary):
1559         (JSC::Yarr::ByteTerm::BackReference):
1560         (JSC::Yarr::ByteTerm::BodyAlternativeBegin):
1561         (JSC::Yarr::ByteTerm::BodyAlternativeDisjunction):
1562         (JSC::Yarr::ByteTerm::BodyAlternativeEnd):
1563         (JSC::Yarr::ByteTerm::AlternativeBegin):
1564         (JSC::Yarr::ByteTerm::AlternativeDisjunction):
1565         (JSC::Yarr::ByteTerm::AlternativeEnd):
1566         (JSC::Yarr::ByteTerm::SubpatternBegin):
1567         (JSC::Yarr::ByteTerm::SubpatternEnd):
1568         (JSC::Yarr::ByteTerm::invert):
1569         (JSC::Yarr::ByteTerm::capture):
1570         (JSC::Yarr::ByteDisjunction::ByteDisjunction):
1571         (JSC::Yarr::BytecodePattern::BytecodePattern):
1572         (JSC::Yarr::BytecodePattern::~BytecodePattern):
1573         * yarr/YarrJIT.cpp: Renamed from Source/JavaScriptCore/yarr/RegexJIT.cpp.
1574         (JSC::Yarr::YarrGenerator::optimizeAlternative):
1575         (JSC::Yarr::YarrGenerator::matchCharacterClassRange):
1576         (JSC::Yarr::YarrGenerator::matchCharacterClass):
1577         (JSC::Yarr::YarrGenerator::jumpIfNoAvailableInput):
1578         (JSC::Yarr::YarrGenerator::jumpIfAvailableInput):
1579         (JSC::Yarr::YarrGenerator::checkInput):
1580         (JSC::Yarr::YarrGenerator::atEndOfInput):
1581         (JSC::Yarr::YarrGenerator::notAtEndOfInput):
1582         (JSC::Yarr::YarrGenerator::jumpIfCharEquals):
1583         (JSC::Yarr::YarrGenerator::jumpIfCharNotEquals):
1584         (JSC::Yarr::YarrGenerator::readCharacter):
1585         (JSC::Yarr::YarrGenerator::storeToFrame):
1586         (JSC::Yarr::YarrGenerator::storeToFrameWithPatch):
1587         (JSC::Yarr::YarrGenerator::loadFromFrame):
1588         (JSC::Yarr::YarrGenerator::loadFromFrameAndJump):
1589         (JSC::Yarr::YarrGenerator::IndirectJumpEntry::IndirectJumpEntry):
1590         (JSC::Yarr::YarrGenerator::IndirectJumpEntry::addJump):
1591         (JSC::Yarr::YarrGenerator::AlternativeBacktrackRecord::AlternativeBacktrackRecord):
1592         (JSC::Yarr::YarrGenerator::GenerationState::GenerationState):
1593         (JSC::Yarr::YarrGenerator::GenerationState::addIndirectJumpEntry):
1594         (JSC::Yarr::YarrGenerator::GenerationState::emitIndirectJumpTable):
1595         (JSC::Yarr::YarrGenerator::GenerationState::incrementParenNestingLevel):
1596         (JSC::Yarr::YarrGenerator::GenerationState::decrementParenNestingLevel):
1597         (JSC::Yarr::YarrGenerator::GenerationState::addParenthesesTail):
1598         (JSC::Yarr::YarrGenerator::GenerationState::emitParenthesesTail):
1599         (JSC::Yarr::YarrGenerator::GenerationState::addJumpToNextInteration):
1600         (JSC::Yarr::YarrGenerator::GenerationState::addJumpsToNextInteration):
1601         (JSC::Yarr::YarrGenerator::GenerationState::addDataLabelToNextIteration):
1602         (JSC::Yarr::YarrGenerator::GenerationState::linkToNextIteration):
1603         (JSC::Yarr::YarrGenerator::BacktrackDestination::BacktrackDestination):
1604         (JSC::Yarr::YarrGenerator::BacktrackDestination::clear):
1605         (JSC::Yarr::YarrGenerator::BacktrackDestination::clearDataLabel):
1606         (JSC::Yarr::YarrGenerator::BacktrackDestination::hasDestination):
1607         (JSC::Yarr::YarrGenerator::BacktrackDestination::isStackOffset):
1608         (JSC::Yarr::YarrGenerator::BacktrackDestination::isLabel):
1609         (JSC::Yarr::YarrGenerator::BacktrackDestination::isJumpList):
1610         (JSC::Yarr::YarrGenerator::BacktrackDestination::hasDataLabel):
1611         (JSC::Yarr::YarrGenerator::BacktrackDestination::copyTarget):
1612         (JSC::Yarr::YarrGenerator::BacktrackDestination::copyTo):
1613         (JSC::Yarr::YarrGenerator::BacktrackDestination::addBacktrackJump):
1614         (JSC::Yarr::YarrGenerator::BacktrackDestination::setStackOffset):
1615         (JSC::Yarr::YarrGenerator::BacktrackDestination::setLabel):
1616         (JSC::Yarr::YarrGenerator::BacktrackDestination::setNextBacktrackLabel):
1617         (JSC::Yarr::YarrGenerator::BacktrackDestination::copyBacktrackToLabel):
1618         (JSC::Yarr::YarrGenerator::BacktrackDestination::setBacktrackToLabel):
1619         (JSC::Yarr::YarrGenerator::BacktrackDestination::setBacktrackJumpList):
1620         (JSC::Yarr::YarrGenerator::BacktrackDestination::setBacktrackSourceLabel):
1621         (JSC::Yarr::YarrGenerator::BacktrackDestination::setDataLabel):
1622         (JSC::Yarr::YarrGenerator::BacktrackDestination::setSubDataLabelPtr):
1623         (JSC::Yarr::YarrGenerator::BacktrackDestination::linkToNextBacktrack):
1624         (JSC::Yarr::YarrGenerator::BacktrackDestination::getStackOffset):
1625         (JSC::Yarr::YarrGenerator::BacktrackDestination::getLabel):
1626         (JSC::Yarr::YarrGenerator::BacktrackDestination::getBacktrackJumps):
1627         (JSC::Yarr::YarrGenerator::BacktrackDestination::getDataLabel):
1628         (JSC::Yarr::YarrGenerator::BacktrackDestination::jumpToBacktrack):
1629         (JSC::Yarr::YarrGenerator::BacktrackDestination::linkDataLabelToHereIfExists):
1630         (JSC::Yarr::YarrGenerator::BacktrackDestination::plantJumpToBacktrackIfExists):
1631         (JSC::Yarr::YarrGenerator::BacktrackDestination::linkAlternativeBacktracks):
1632         (JSC::Yarr::YarrGenerator::BacktrackDestination::linkAlternativeBacktracksTo):
1633         (JSC::Yarr::YarrGenerator::TermGenerationState::TermGenerationState):
1634         (JSC::Yarr::YarrGenerator::TermGenerationState::resetAlternative):
1635         (JSC::Yarr::YarrGenerator::TermGenerationState::alternativeValid):
1636         (JSC::Yarr::YarrGenerator::TermGenerationState::nextAlternative):
1637         (JSC::Yarr::YarrGenerator::TermGenerationState::alternative):
1638         (JSC::Yarr::YarrGenerator::TermGenerationState::isLastAlternative):
1639         (JSC::Yarr::YarrGenerator::TermGenerationState::resetTerm):
1640         (JSC::Yarr::YarrGenerator::TermGenerationState::termValid):
1641         (JSC::Yarr::YarrGenerator::TermGenerationState::nextTerm):
1642         (JSC::Yarr::YarrGenerator::TermGenerationState::term):
1643         (JSC::Yarr::YarrGenerator::TermGenerationState::isLastTerm):
1644         (JSC::Yarr::YarrGenerator::TermGenerationState::getSubParenNum):
1645         (JSC::Yarr::YarrGenerator::TermGenerationState::isMainDisjunction):
1646         (JSC::Yarr::YarrGenerator::TermGenerationState::setParenthesesTail):
1647         (JSC::Yarr::YarrGenerator::TermGenerationState::getParenthesesTail):
1648         (JSC::Yarr::YarrGenerator::TermGenerationState::lookaheadTerm):
1649         (JSC::Yarr::YarrGenerator::TermGenerationState::isSinglePatternCharacterLookaheadTerm):
1650         (JSC::Yarr::YarrGenerator::TermGenerationState::inputOffset):
1651         (JSC::Yarr::YarrGenerator::TermGenerationState::clearBacktrack):
1652         (JSC::Yarr::YarrGenerator::TermGenerationState::jumpToBacktrack):
1653         (JSC::Yarr::YarrGenerator::TermGenerationState::plantJumpToBacktrackIfExists):
1654         (JSC::Yarr::YarrGenerator::TermGenerationState::linkDataLabelToBacktrackIfExists):
1655         (JSC::Yarr::YarrGenerator::TermGenerationState::addBacktrackJump):
1656         (JSC::Yarr::YarrGenerator::TermGenerationState::setBacktrackDataLabel):
1657         (JSC::Yarr::YarrGenerator::TermGenerationState::setBackTrackStackOffset):
1658         (JSC::Yarr::YarrGenerator::TermGenerationState::setBacktrackLabel):
1659         (JSC::Yarr::YarrGenerator::TermGenerationState::linkAlternativeBacktracks):
1660         (JSC::Yarr::YarrGenerator::TermGenerationState::linkAlternativeBacktracksTo):
1661         (JSC::Yarr::YarrGenerator::TermGenerationState::setBacktrackLink):
1662         (JSC::Yarr::YarrGenerator::TermGenerationState::chainBacktracks):
1663         (JSC::Yarr::YarrGenerator::TermGenerationState::chainBacktrackJumps):
1664         (JSC::Yarr::YarrGenerator::TermGenerationState::getBacktrackDestination):
1665         (JSC::Yarr::YarrGenerator::TermGenerationState::propagateBacktrackingFrom):
1666         (JSC::Yarr::YarrGenerator::ParenthesesTail::ParenthesesTail):
1667         (JSC::Yarr::YarrGenerator::ParenthesesTail::processBacktracks):
1668         (JSC::Yarr::YarrGenerator::ParenthesesTail::setNextIteration):
1669         (JSC::Yarr::YarrGenerator::ParenthesesTail::addAfterParenJump):
1670         (JSC::Yarr::YarrGenerator::ParenthesesTail::generateCode):
1671         (JSC::Yarr::YarrGenerator::generateAssertionBOL):
1672         (JSC::Yarr::YarrGenerator::generateAssertionEOL):
1673         (JSC::Yarr::YarrGenerator::matchAssertionWordchar):
1674         (JSC::Yarr::YarrGenerator::generateAssertionWordBoundary):
1675         (JSC::Yarr::YarrGenerator::generatePatternCharacterSingle):
1676         (JSC::Yarr::YarrGenerator::generatePatternCharacterPair):
1677         (JSC::Yarr::YarrGenerator::generatePatternCharacterFixed):
1678         (JSC::Yarr::YarrGenerator::generatePatternCharacterGreedy):
1679         (JSC::Yarr::YarrGenerator::generatePatternCharacterNonGreedy):
1680         (JSC::Yarr::YarrGenerator::generateCharacterClassSingle):
1681         (JSC::Yarr::YarrGenerator::generateCharacterClassFixed):
1682         (JSC::Yarr::YarrGenerator::generateCharacterClassGreedy):
1683         (JSC::Yarr::YarrGenerator::generateCharacterClassNonGreedy):
1684         (JSC::Yarr::YarrGenerator::generateParenthesesDisjunction):
1685         (JSC::Yarr::YarrGenerator::generateParenthesesSingle):
1686         (JSC::Yarr::YarrGenerator::generateParenthesesGreedyNoBacktrack):
1687         (JSC::Yarr::YarrGenerator::generateParentheticalAssertion):
1688         (JSC::Yarr::YarrGenerator::generateTerm):
1689         (JSC::Yarr::YarrGenerator::generateDisjunction):
1690         (JSC::Yarr::YarrGenerator::generateEnter):
1691         (JSC::Yarr::YarrGenerator::generateReturn):
1692         (JSC::Yarr::YarrGenerator::YarrGenerator):
1693         (JSC::Yarr::YarrGenerator::generate):
1694         (JSC::Yarr::YarrGenerator::compile):
1695         (JSC::Yarr::jitCompile):
1696         * yarr/YarrJIT.h: Renamed from Source/JavaScriptCore/yarr/RegexJIT.h.
1697         (JSC::Yarr::YarrCodeBlock::YarrCodeBlock):
1698         (JSC::Yarr::YarrCodeBlock::~YarrCodeBlock):
1699         (JSC::Yarr::YarrCodeBlock::setFallBack):
1700         (JSC::Yarr::YarrCodeBlock::isFallBack):
1701         (JSC::Yarr::YarrCodeBlock::set):
1702         (JSC::Yarr::YarrCodeBlock::execute):
1703         (JSC::Yarr::YarrCodeBlock::getAddr):
1704         (JSC::Yarr::execute):
1705         * yarr/YarrParser.h: Renamed from Source/JavaScriptCore/yarr/RegexParser.h.
1706         (JSC::Yarr::Parser::CharacterClassParserDelegate::CharacterClassParserDelegate):
1707         (JSC::Yarr::Parser::CharacterClassParserDelegate::begin):
1708         (JSC::Yarr::Parser::CharacterClassParserDelegate::atomPatternCharacter):
1709         (JSC::Yarr::Parser::CharacterClassParserDelegate::atomBuiltInCharacterClass):
1710         (JSC::Yarr::Parser::CharacterClassParserDelegate::end):
1711         (JSC::Yarr::Parser::CharacterClassParserDelegate::assertionWordBoundary):
1712         (JSC::Yarr::Parser::CharacterClassParserDelegate::atomBackReference):
1713         (JSC::Yarr::Parser::Parser):
1714         (JSC::Yarr::Parser::parseEscape):
1715         (JSC::Yarr::Parser::parseAtomEscape):
1716         (JSC::Yarr::Parser::parseCharacterClassEscape):
1717         (JSC::Yarr::Parser::parseCharacterClass):
1718         (JSC::Yarr::Parser::parseParenthesesBegin):
1719         (JSC::Yarr::Parser::parseParenthesesEnd):
1720         (JSC::Yarr::Parser::parseQuantifier):
1721         (JSC::Yarr::Parser::parseTokens):
1722         (JSC::Yarr::Parser::parse):
1723         (JSC::Yarr::Parser::saveState):
1724         (JSC::Yarr::Parser::restoreState):
1725         (JSC::Yarr::Parser::atEndOfPattern):
1726         (JSC::Yarr::Parser::peek):
1727         (JSC::Yarr::Parser::peekIsDigit):
1728         (JSC::Yarr::Parser::peekDigit):
1729         (JSC::Yarr::Parser::consume):
1730         (JSC::Yarr::Parser::consumeDigit):
1731         (JSC::Yarr::Parser::consumeNumber):
1732         (JSC::Yarr::Parser::consumeOctal):
1733         (JSC::Yarr::Parser::tryConsume):
1734         (JSC::Yarr::Parser::tryConsumeHex):
1735         (JSC::Yarr::parse):
1736         * yarr/YarrPattern.cpp: Renamed from Source/JavaScriptCore/yarr/RegexPattern.cpp.
1737         (JSC::Yarr::CharacterClassConstructor::CharacterClassConstructor):
1738         (JSC::Yarr::CharacterClassConstructor::reset):
1739         (JSC::Yarr::CharacterClassConstructor::append):
1740         (JSC::Yarr::CharacterClassConstructor::putChar):
1741         (JSC::Yarr::CharacterClassConstructor::isUnicodeUpper):
1742         (JSC::Yarr::CharacterClassConstructor::isUnicodeLower):
1743         (JSC::Yarr::CharacterClassConstructor::putRange):
1744         (JSC::Yarr::CharacterClassConstructor::charClass):
1745         (JSC::Yarr::CharacterClassConstructor::addSorted):
1746         (JSC::Yarr::CharacterClassConstructor::addSortedRange):
1747         (JSC::Yarr::BeginCharHelper::BeginCharHelper):
1748         (JSC::Yarr::BeginCharHelper::addBeginChar):
1749         (JSC::Yarr::BeginCharHelper::merge):
1750         (JSC::Yarr::BeginCharHelper::addCharacter):
1751         (JSC::Yarr::BeginCharHelper::linkHotTerms):
1752         (JSC::Yarr::YarrPatternConstructor::YarrPatternConstructor):
1753         (JSC::Yarr::YarrPatternConstructor::~YarrPatternConstructor):
1754         (JSC::Yarr::YarrPatternConstructor::reset):
1755         (JSC::Yarr::YarrPatternConstructor::assertionBOL):
1756         (JSC::Yarr::YarrPatternConstructor::assertionEOL):
1757         (JSC::Yarr::YarrPatternConstructor::assertionWordBoundary):
1758         (JSC::Yarr::YarrPatternConstructor::atomPatternCharacter):
1759         (JSC::Yarr::YarrPatternConstructor::atomBuiltInCharacterClass):
1760         (JSC::Yarr::YarrPatternConstructor::atomCharacterClassBegin):
1761         (JSC::Yarr::YarrPatternConstructor::atomCharacterClassAtom):
1762         (JSC::Yarr::YarrPatternConstructor::atomCharacterClassRange):
1763         (JSC::Yarr::YarrPatternConstructor::atomCharacterClassBuiltIn):
1764         (JSC::Yarr::YarrPatternConstructor::atomCharacterClassEnd):
1765         (JSC::Yarr::YarrPatternConstructor::atomParenthesesSubpatternBegin):
1766         (JSC::Yarr::YarrPatternConstructor::atomParentheticalAssertionBegin):
1767         (JSC::Yarr::YarrPatternConstructor::atomParenthesesEnd):
1768         (JSC::Yarr::YarrPatternConstructor::atomBackReference):
1769         (JSC::Yarr::YarrPatternConstructor::copyDisjunction):
1770         (JSC::Yarr::YarrPatternConstructor::copyTerm):
1771         (JSC::Yarr::YarrPatternConstructor::quantifyAtom):
1772         (JSC::Yarr::YarrPatternConstructor::disjunction):
1773         (JSC::Yarr::YarrPatternConstructor::regexBegin):
1774         (JSC::Yarr::YarrPatternConstructor::regexEnd):
1775         (JSC::Yarr::YarrPatternConstructor::regexError):
1776         (JSC::Yarr::YarrPatternConstructor::setupAlternativeOffsets):
1777         (JSC::Yarr::YarrPatternConstructor::setupDisjunctionOffsets):
1778         (JSC::Yarr::YarrPatternConstructor::setupOffsets):
1779         (JSC::Yarr::YarrPatternConstructor::checkForTerminalParentheses):
1780         (JSC::Yarr::YarrPatternConstructor::optimizeBOL):
1781         (JSC::Yarr::YarrPatternConstructor::addBeginTerm):
1782         (JSC::Yarr::YarrPatternConstructor::setupDisjunctionBeginTerms):
1783         (JSC::Yarr::YarrPatternConstructor::setupAlternativeBeginTerms):
1784         (JSC::Yarr::YarrPatternConstructor::setupBeginChars):
1785         (JSC::Yarr::compile):
1786         (JSC::Yarr::YarrPattern::YarrPattern):
1787         * yarr/YarrPattern.h: Renamed from Source/JavaScriptCore/yarr/RegexPattern.h.
1788         (JSC::Yarr::CharacterRange::CharacterRange):
1789         (JSC::Yarr::CharacterClassTable::create):
1790         (JSC::Yarr::CharacterClassTable::CharacterClassTable):
1791         (JSC::Yarr::CharacterClass::CharacterClass):
1792         (JSC::Yarr::PatternTerm::PatternTerm):
1793         (JSC::Yarr::PatternTerm::ForwardReference):
1794         (JSC::Yarr::PatternTerm::BOL):
1795         (JSC::Yarr::PatternTerm::EOL):
1796         (JSC::Yarr::PatternTerm::WordBoundary):
1797         (JSC::Yarr::PatternTerm::invert):
1798         (JSC::Yarr::PatternTerm::capture):
1799         (JSC::Yarr::PatternTerm::quantify):
1800         (JSC::Yarr::PatternAlternative::PatternAlternative):
1801         (JSC::Yarr::PatternAlternative::lastTerm):
1802         (JSC::Yarr::PatternAlternative::removeLastTerm):
1803         (JSC::Yarr::PatternAlternative::setOnceThrough):
1804         (JSC::Yarr::PatternAlternative::onceThrough):
1805         (JSC::Yarr::PatternDisjunction::PatternDisjunction):
1806         (JSC::Yarr::PatternDisjunction::~PatternDisjunction):
1807         (JSC::Yarr::PatternDisjunction::addNewAlternative):
1808         (JSC::Yarr::TermChain::TermChain):
1809         (JSC::Yarr::BeginChar::BeginChar):
1810         (JSC::Yarr::YarrPattern::~YarrPattern):
1811         (JSC::Yarr::YarrPattern::reset):
1812         (JSC::Yarr::YarrPattern::containsIllegalBackReference):
1813         (JSC::Yarr::YarrPattern::newlineCharacterClass):
1814         (JSC::Yarr::YarrPattern::digitsCharacterClass):
1815         (JSC::Yarr::YarrPattern::spacesCharacterClass):
1816         (JSC::Yarr::YarrPattern::wordcharCharacterClass):
1817         (JSC::Yarr::YarrPattern::nondigitsCharacterClass):
1818         (JSC::Yarr::YarrPattern::nonspacesCharacterClass):
1819         (JSC::Yarr::YarrPattern::nonwordcharCharacterClass):
1820
1821 2011-01-10  Gavin Barraclough  <barraclough@apple.com>
1822
1823         Windows build fix.
1824
1825         * parser/SyntaxChecker.h:
1826
1827 2011-01-10  Dave Tapuska  <dtapuska@rim.com>
1828
1829         Reviewed by Gavin Barraclough.
1830
1831         Add CTI ASM versions for RVCT ARM THUMB2 mode.
1832
1833         https://bugs.webkit.org/show_bug.cgi?id=52154
1834
1835         * jit/JITStubs.cpp:
1836         (JSC::ctiTrampoline):
1837         (JSC::ctiVMThrowTrampoline):
1838         (JSC::ctiOpThrowNotCaught):
1839
1840 2011-01-10  Gavin Barraclough  <barraclough@apple.com>
1841
1842         Qt build fix.
1843
1844         * JavaScriptCore.pro:
1845
1846 2011-01-10  Gavin Barraclough  <barraclough@apple.com>
1847
1848         Reviewed by Oliver Hunt.
1849
1850         Bug 52079 - Syntax errors should be early errors.
1851
1852         From chapter 16 the spec:
1853             An implementation must report most errors at the time the relevant ECMAScript language construct is
1854             evaluated. An early error is an error that can be detected and reported prior to the evaluation of
1855             any construct in the Program containing the error. An implementation must report early errors in a
1856             Program prior to the first evaluation of that Program. Early errors in eval code are reported at
1857             the time eval is called but prior to evaluation of any construct within the eval code. All errors
1858             that are not early errors are runtime errors.
1859
1860             An implementation must treat any instance of the following kinds of errors as an early error:
1861                 * Any syntax error."
1862
1863         * JavaScriptCore.xcodeproj/project.pbxproj:
1864             Added new files.
1865         * bytecode/CodeBlock.cpp:
1866             Removed op_throw_syntax_error.
1867         * bytecode/Opcode.h:
1868             Removed op_throw_syntax_error.
1869         * bytecompiler/BytecodeGenerator.cpp:
1870         (JSC::BytecodeGenerator::generate):
1871             If m_expressionTooDeep then throw a runtime error.
1872         (JSC::BytecodeGenerator::BytecodeGenerator):
1873             Initialize m_expressionTooDeep.
1874         (JSC::BytecodeGenerator::emitThrowExpressionTooDeepException):
1875             Sets m_expressionTooDeep.
1876         * bytecompiler/BytecodeGenerator.h:
1877             Added m_expressionTooDeep, removed emitThrowSyntaxError.
1878         * bytecompiler/NodesCodegen.cpp:
1879         (JSC::RegExpNode::emitBytecode):
1880         (JSC::ContinueNode::emitBytecode):
1881         (JSC::BreakNode::emitBytecode):
1882         (JSC::ReturnNode::emitBytecode):
1883         (JSC::LabelNode::emitBytecode):
1884             Conditions that threw syntax error are now handled during parsing;
1885             during bytecompilation these are now just ASSERTs.
1886         * interpreter/Interpreter.cpp:
1887         (JSC::Interpreter::privateExecute):
1888         * jit/JIT.cpp:
1889         (JSC::JIT::privateCompileMainPass):
1890         * jit/JIT.h:
1891         * jit/JITOpcodes.cpp:
1892         * jit/JITOpcodes32_64.cpp:
1893         * jit/JITStubs.cpp:
1894         * jit/JITStubs.h:
1895             Removed op_throw_syntax_error.
1896         * parser/ASTBuilder.h:
1897         (JSC::ASTBuilder::createRegExp):
1898             Renamed; added syntax check.
1899         * parser/JSParser.cpp:
1900         (JSC::JSParser::breakIsValid):
1901         (JSC::JSParser::hasLabel):
1902         (JSC::JSParser::Scope::Scope):
1903         (JSC::JSParser::Scope::setIsFunction):
1904         (JSC::JSParser::Scope::isFunctionBoundary):
1905         (JSC::JSParser::ScopeRef::hasContainingScope):
1906         (JSC::JSParser::ScopeRef::containingScope):
1907         (JSC::JSParser::AutoPopScopeRef::AutoPopScopeRef):
1908         (JSC::JSParser::AutoPopScopeRef::~AutoPopScopeRef):
1909         (JSC::JSParser::AutoPopScopeRef::setPopped):
1910         (JSC::JSParser::popScopeInternal):
1911         (JSC::JSParser::popScope):
1912         (JSC::jsParse):
1913         (JSC::JSParser::JSParser):
1914         (JSC::JSParser::parseProgram):
1915         (JSC::JSParser::parseBreakStatement):
1916         (JSC::JSParser::parseContinueStatement):
1917         (JSC::JSParser::parseReturnStatement):
1918         (JSC::JSParser::parseTryStatement):
1919         (JSC::JSParser::parseFunctionInfo):
1920         (JSC::JSParser::parseExpressionOrLabelStatement):
1921         (JSC::JSParser::parsePrimaryExpression):
1922         * parser/JSParser.h:
1923         * parser/Nodes.h:
1924         * parser/Parser.cpp:
1925         (JSC::Parser::parse):
1926         * parser/SyntaxChecker.h:
1927         (JSC::SyntaxChecker::createRegExp):
1928             Renamed; added syntax check.
1929         * runtime/ExceptionHelpers.cpp:
1930         (JSC::createOutOfMemoryError):
1931         (JSC::throwOutOfMemoryError):
1932         * runtime/ExceptionHelpers.h:
1933             Broke out createOutOfMemoryError.
1934         * runtime/Executable.cpp:
1935         (JSC::EvalExecutable::compileInternal):
1936         (JSC::ProgramExecutable::compileInternal):
1937         (JSC::FunctionExecutable::compileForCallInternal):
1938         (JSC::FunctionExecutable::compileForConstructInternal):
1939             Add check for exception after bytecode generation.
1940         * runtime/RegExpConstructor.cpp:
1941         (JSC::constructRegExp):
1942         * runtime/RegExpPrototype.cpp:
1943         (JSC::regExpProtoFuncCompile):
1944             RegExp error prefixes not included in error string.
1945         * yarr/RegexParser.h:
1946         (JSC::Yarr::Parser::parse):
1947             Removed regexBegin/regexEnd/regexError.
1948         * yarr/RegexPattern.cpp:
1949         (JSC::Yarr::RegexPatternConstructor::regexBegin):
1950             Removed regexEnd/regexError.
1951         (JSC::Yarr::compileRegex):
1952             Add call to regexBegin (no longer called from the parser).
1953         * yarr/YarrSyntaxChecker.cpp: Added.
1954         (JSC::Yarr::SyntaxChecker::assertionBOL):
1955         (JSC::Yarr::SyntaxChecker::assertionEOL):
1956         (JSC::Yarr::SyntaxChecker::assertionWordBoundary):
1957         (JSC::Yarr::SyntaxChecker::atomPatternCharacter):
1958         (JSC::Yarr::SyntaxChecker::atomBuiltInCharacterClass):
1959         (JSC::Yarr::SyntaxChecker::atomCharacterClassBegin):
1960         (JSC::Yarr::SyntaxChecker::atomCharacterClassAtom):
1961         (JSC::Yarr::SyntaxChecker::atomCharacterClassRange):
1962         (JSC::Yarr::SyntaxChecker::atomCharacterClassBuiltIn):
1963         (JSC::Yarr::SyntaxChecker::atomCharacterClassEnd):
1964         (JSC::Yarr::SyntaxChecker::atomParenthesesSubpatternBegin):
1965         (JSC::Yarr::SyntaxChecker::atomParentheticalAssertionBegin):
1966         (JSC::Yarr::SyntaxChecker::atomParenthesesEnd):
1967         (JSC::Yarr::SyntaxChecker::atomBackReference):
1968         (JSC::Yarr::SyntaxChecker::quantifyAtom):
1969         (JSC::Yarr::SyntaxChecker::disjunction):
1970         (JSC::Yarr::checkSyntax):
1971         * yarr/YarrSyntaxChecker.h: Added.
1972             Check RegExp syntax.
1973
1974 2011-01-10  Adam Roben  <aroben@apple.com>
1975
1976         Roll out r75289
1977
1978         It was causing assertion failures. See <http://webkit.org/b/52156>.
1979
1980         * wtf/StackBounds.cpp:
1981         (WTF::StackBounds::initialize):
1982
1983 2011-01-08  Patrick Gansterer  <paroga@webkit.org>
1984
1985         Reviewed by Darin Adler.
1986
1987         Unify string table adding in AtomicString
1988         https://bugs.webkit.org/show_bug.cgi?id=51927
1989
1990         Move code for adding a string into a separate function.
1991         This removes multiple occurrence of the same logic.
1992
1993         * wtf/text/AtomicString.cpp:
1994         (WTF::addToStringTable): Added.
1995         (WTF::AtomicString::add): Use addToStringTable().
1996         (WTF::AtomicString::fromUTF8): Ditto.
1997
1998 2011-01-07  Geoffrey Garen  <ggaren@apple.com>
1999
2000         Reviewed by Gavin Barraclough.
2001
2002         Split machine stack marking functions into their own class (MachineStackMarker)
2003         https://bugs.webkit.org/show_bug.cgi?id=52088
2004
2005         * API/APIShims.h:
2006         (JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock): Moved registerThread()
2007         call behind an #ifdef because we shouldn't be registering threads at all
2008         if we don't support usage on multiple threads.
2009
2010         * Android.mk:
2011         * CMakeLists.txt:
2012         * GNUmakefile.am:
2013         * JavaScriptCore.gypi:
2014         * JavaScriptCore.pro:
2015         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2016         * JavaScriptCore.xcodeproj/project.pbxproj: Updated projects.
2017
2018         * runtime/Collector.cpp:
2019         (JSC::Heap::Heap):
2020         (JSC::Heap::destroy):
2021         (JSC::Heap::markRoots):
2022         * runtime/Collector.h:
2023         (JSC::Heap::machineStackMarker): Moved code to machineStackMarker.
2024
2025         * runtime/JSGlobalData.h:
2026         (JSC::JSGlobalData::makeUsableFromMultipleThreads): Removed an unnecessary
2027         level of indirection, to make Heap less of a God class.
2028
2029         * runtime/MachineStackMarker.h: Copied from Source/JavaScriptCore/runtime/Collector.h.
2030         * runtime/MachineStackMarker.cpp: Copied from Source/JavaScriptCore/runtime/Collector.cpp.
2031         (JSC::MachineStackMarker::MachineStackMarker):
2032         (JSC::MachineStackMarker::~MachineStackMarker):
2033         (JSC::MachineStackMarker::makeUsableFromMultipleThreads):
2034         (JSC::MachineStackMarker::registerThread):
2035         (JSC::MachineStackMarker::unregisterThread):
2036         (JSC::MachineStackMarker::markCurrentThreadConservativelyInternal):
2037         (JSC::MachineStackMarker::markCurrentThreadConservatively):
2038         (JSC::MachineStackMarker::markOtherThreadConservatively):
2039         (JSC::MachineStackMarker::markMachineStackConservatively): Moved code from Heap.
2040
2041 2011-01-07  Gavin Barraclough  <barraclough@apple.com>
2042
2043         Reviewed by Geoff Garen.
2044
2045         Bug 26276 - Need a mechanism to determine stack extent on WINDOWS, SOLARIS, OPENBSD, SYMBIAN, HAIKU, WINCE platforms
2046
2047         Fix for win32.  The base of the stack is stored in the "deallocation stack" field of the
2048         Thread Information Block - see: http://en.wikipedia.org/wiki/Win32_Thread_Information_Block
2049         for more information!
2050
2051         * wtf/StackBounds.cpp:
2052         (WTF::StackBounds::initialize):
2053
2054 2011-01-07  Adam Roben  <aroben@apple.com>
2055
2056         Update react-to-vsprops-changes.py after r74855
2057
2058         * JavaScriptCore.vcproj/JavaScriptCore/react-to-vsprops-changes.py:
2059
2060 2011-01-07  Carlos Garcia Campos  <cgarcia@igalia.com>
2061
2062         Reviewed by Martin Robinson.
2063
2064         [GTK] Port scrollbar painting to GtkStyleContext
2065         https://bugs.webkit.org/show_bug.cgi?id=52051
2066
2067         * wtf/gobject/GTypedefs.h: Add GtkStyleContext forward
2068         declaration.
2069
2070 2011-01-07  Daniel Bates  <dbates@rim.com>
2071
2072         Reviewed by Martin Robinson.
2073
2074         Enable PCRE computed gotos when compiling with RCVT 4.0 or greater in GNU mode
2075         https://bugs.webkit.org/show_bug.cgi?id=52034
2076
2077         Derived from a patch by Eli Fidler.
2078
2079         RVCT 4 or greater in GNU mode supports the computed goto GNU language extension
2080         as per <http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0348c/ch03s07s12.html>.
2081
2082         * pcre/pcre_exec.cpp: Modified to check for feature, HAVE(COMPUTED_GOTO), instead
2083         of hardcoding the GCC compiler.
2084         * wtf/Platform.h: Define WTF_COMPILER_RVCT4_OR_GREATER if __ARMCC_VERSION >= 400000.
2085
2086 2011-01-06  Gavin Barraclough  <barraclough@apple.com>
2087
2088         Reviewed by Geoff Garen.
2089
2090         Bug 52035 - Unregistering DOMWrapperWorlds is unsafe
2091
2092         The method DOMWrapperWorld::unregisterWorld() effectively calls the DOMWrapperWorld's
2093         destructor early, in order to release wrappers once we know we no longer intend to use them.
2094         Whilst it is okay to have a method to throw away wrappers (assuming we know we're willing to
2095         lose any state stored on them) it is not okay to deregister the world from the JSGlobalData.
2096         A sequence of events that triggers the bug would look like this:
2097
2098         (1) Create a DOMWrapperWorld.
2099         (2) Register a timer in the world.
2100         (3) Call unregisterWorld() on the world.
2101         (4) Timer goes off, code is executed in the world, creates a Node not attached to a Document.
2102         (5) We attempt to lookup a wrapper map for the world on the JSGlobalData, but because we've
2103             called forgetWorld() none exists.
2104         (6) Attempt to add a wrapper to a NULL map.
2105
2106         Fix the problem by not removing the JSGlobalData's wrapper map until the world really goes away.
2107
2108         * runtime/WeakGCMap.h:
2109         (JSC::WeakGCMap::clear):
2110
2111 2011-01-06  Gavin Barraclough  <barraclough@apple.com>
2112
2113         Reviewed by Darin Adler.
2114
2115         Bug 52021 - zeroDouble broken on ARMv7
2116
2117         The bug here is that zeroDouble was working incorrectly,
2118         leading to op_loop_if_true failing - specifically in the
2119         case where the value being checked is 0.0 encoded as a
2120         double (rather than an integer immediate).
2121
2122         Additionally this patch removes a redundant duplicate compare
2123         in some (many) case.
2124
2125         * assembler/ARMv7Assembler.h:
2126         (JSC::ARMv7Assembler::vcmp_F64):
2127         (JSC::ARMv7Assembler::vcmpz_F64):
2128         * assembler/MacroAssemblerARM.h:
2129         (JSC::MacroAssemblerARM::branchDoubleNonZero):
2130         (JSC::MacroAssemblerARM::branchDoubleZeroOrNaN):
2131         * assembler/MacroAssemblerARMv7.h:
2132         (JSC::MacroAssemblerARMv7::branchDouble):
2133         (JSC::MacroAssemblerARMv7::branchDoubleNonZero):
2134         (JSC::MacroAssemblerARMv7::branchDoubleZeroOrNaN):
2135         (JSC::MacroAssemblerARMv7::compare32):
2136         * assembler/MacroAssemblerMIPS.h:
2137         (JSC::MacroAssemblerMIPS::branchDoubleNonZero):
2138         (JSC::MacroAssemblerMIPS::branchDoubleZeroOrNaN):
2139         * assembler/MacroAssemblerX86Common.h:
2140         (JSC::MacroAssemblerX86Common::branchDoubleNonZero):
2141         (JSC::MacroAssemblerX86Common::branchDoubleZeroOrNaN):
2142         * jit/JITOpcodes32_64.cpp:
2143         (JSC::JIT::emit_op_jfalse):
2144         (JSC::JIT::emit_op_jtrue):
2145
2146 2011-01-06  Michael Saboff  <msaboff@apple.com>
2147
2148         Reviewed by Gavin Barraclough.
2149
2150         Added debug code to compare the results of JIT regexp with 
2151         interpreted regexp and displays discrepencies.  This debug code is
2152         controlled by the ENABLE_YARR_JIT_DEBUG macro in wtf/Platform.h and
2153         is only valid if ENABLE_YARR_JIT is enabled.
2154
2155         Fixed a discovered problem in RegExp::printTraceData, changing
2156         m_pattern to the getter pattern().
2157         Also deleted an extraneous semicolon.
2158
2159         Enhancement: Add Regexp Debug Compare between JIT and Interpreter
2160         https://bugs.webkit.org/show_bug.cgi?id=51834
2161
2162         * runtime/RegExp.cpp:
2163         (JSC::RegExp::compile):
2164         (JSC::RegExp::match):
2165         (JSC::RegExp::printTraceData):
2166         * wtf/Platform.h:
2167
2168 2011-01-06  Patrick Gansterer  <paroga@webkit.org>
2169
2170         Reviewed by Eric Seidel.
2171
2172         [WINCE] Remove JSC::g_stackBase
2173         https://bugs.webkit.org/show_bug.cgi?id=51779
2174
2175         * wtf/StackBounds.cpp:
2176
2177 2011-01-06  Joone Hur  <joone.hur@collabora.co.uk>
2178
2179         Reviewed by Eric Seidel.
2180
2181         WML Parser should treat line/column number in a consistent way
2182         https://bugs.webkit.org/show_bug.cgi?id=51601
2183
2184         Add the equality operators to TextPosition class.
2185
2186         * wtf/text/TextPosition.h:
2187         (WTF::TextPosition::operator==): Added.
2188         (WTF::TextPosition::operator!=): Added.
2189         (WTF::TextPosition::belowRangePosition): Use belowBase() instead of base().
2190         (WTF::ZeroBasedNumber::operator==): Added.
2191         (WTF::ZeroBasedNumber::operator!=): Added.
2192         (WTF::OneBasedNumber::operator==): Added.
2193         (WTF::OneBasedNumber::operator!=): Added.
2194
2195 2011-01-06  Patrick Gansterer  <paroga@webkit.org>
2196
2197         Reviewed by Gavin Barraclough.
2198
2199         [WINCE] Determine stack extent
2200         https://bugs.webkit.org/show_bug.cgi?id=26276
2201
2202         Scan the stack for writeable pages and use the limits.
2203
2204         * wtf/StackBounds.cpp:
2205         (WTF::detectGrowingDownward):
2206         (WTF::isPageWritable):
2207         (WTF::getLowerStackBound):
2208         (WTF::getUpperStackBound):
2209         (WTF::StackBounds::initialize):
2210
2211 2011-01-05  Steve Falkenburg  <sfalken@apple.com>
2212
2213         Windows build fix.
2214
2215         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: Revert change to additional library search path needed to find ICU.
2216
2217 2011-01-05  Steve Falkenburg  <sfalken@apple.com>
2218
2219         Reviewed by Darin Adler.
2220
2221         Debug and Release builds on Windows clobber each other
2222         https://bugs.webkit.org/show_bug.cgi?id=49185
2223         
2224         Changes the structure of WebKitBuild build products directory so we
2225         completely separate each build configuration into independent directories.
2226         
2227         Although we previously had per-configuration directories for obj, this change adds
2228         per-configuration directories for bin, lib, obj, and include. Each configuration's
2229         build products are stored within a directory inside of WebKitBuild.
2230         
2231         Most use of $(WebKitOutputDir) in the build files has been replaced by $(ConfigurationBuildDir),
2232         defined in common.vsprops to be $(WebKitOutputDir)\$(ConfigurationName).
2233         
2234         For PGO, $(ConfigurationBuildDir) points to the same directory (Release_PGO) to allow
2235         for proper operation of the instrumentation/optimization scripts.
2236
2237         * JavaScriptCore.vcproj/JavaScriptCore.make:
2238         * JavaScriptCore.vcproj/JavaScriptCore.sln:
2239         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2240         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
2241         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
2242         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj:
2243         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGeneratedCommon.vsprops:
2244         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCorePGOOptimize.vsprops: Added.
2245         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCorePostBuild.cmd:
2246         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCorePreBuild.cmd:
2247         * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
2248         * JavaScriptCore.vcproj/JavaScriptCore/react-to-vsprops-changes.py:
2249         * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln:
2250         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
2251         * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops:
2252         * JavaScriptCore.vcproj/WTF/WTFPostBuild.cmd:
2253         * JavaScriptCore.vcproj/WTF/WTFPreBuild.cmd:
2254         * JavaScriptCore.vcproj/jsc/jsc.vcproj:
2255         * JavaScriptCore.vcproj/jsc/jscCommon.vsprops:
2256         * JavaScriptCore.vcproj/jsc/jscPostBuild.cmd:
2257         * JavaScriptCore.vcproj/jsc/jscPreBuild.cmd:
2258         * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops:
2259         * JavaScriptCore.vcproj/testapi/testapiPostBuild.cmd:
2260         * JavaScriptCore.vcproj/testapi/testapiPreBuild.cmd:
2261
2262 2011-01-05  Brent Fulgham  <bfulgham@webkit.org>
2263
2264         Unreviewed build fix.
2265
2266         * wtf/Encoder.h: Add <stdint.h> include for systems that
2267         do not natively know about uint8_t, etc.
2268
2269 2011-01-05  Patrick Gansterer  <paroga@webkit.org>
2270
2271         Reviewed by Andreas Kling.
2272
2273         [CMake] Fix the usage of SOURCE_GROUP
2274         https://bugs.webkit.org/show_bug.cgi?id=51739
2275
2276         * CMakeLists.txt:
2277
2278 2011-01-05  Andras Becsi  <abecsi@webkit.org>
2279
2280         Reviewed by Csaba Osztrogonác.
2281
2282         [Qt][V8] Fix the build after recent changes.
2283
2284         * pcre/pcre.pri: Correct the path after Source was introduced.
2285
2286 2011-01-04  Steve Falkenburg  <sfalken@apple.com>
2287
2288         Build fix. Update path to FindSafari after source code reorganization.
2289
2290         * JavaScriptCore.vcproj/JavaScriptCore.sln:
2291
2292 2011-01-04  Daniel Bates  <dbates@rim.com>
2293
2294         Fix the Android build after changeset 74975 <http://trac.webkit.org/changeset/74975>
2295         (https://bugs.webkit.org/show_bug.cgi?id=51855).
2296
2297         * wtf/ThreadingPthreads.cpp: Add include of PassOwnPtr.h.
2298         (WTF::runThreadWithRegistration): Use -> instead of . to dereference pointer.
2299
2300 2011-01-04  Martin Robinson  <mrobinson@igalia.com>
2301
2302         Try to fix the EFL build.
2303
2304         * wtf/CMakeLists.txt: Remove PlatformRefPtr from the CMake source list.
2305
2306 2011-01-04  James Robinson  <jamesr@chromium.org>
2307
2308         Reviewed by Darin Adler.
2309
2310         StackBounds initialization in WTFThreadData should be guarded by #if USE(JSC)
2311         https://bugs.webkit.org/show_bug.cgi?id=51881
2312
2313         The StackBounds class is only used by JavaScriptCore.
2314
2315         * wtf/WTFThreadData.cpp:
2316         (WTF::WTFThreadData::WTFThreadData):
2317         * wtf/WTFThreadData.h:
2318         (WTF::WTFThreadData::resetCurrentIdentifierTable):
2319
2320 2011-01-03  Martin Robinson  <mrobinson@igalia.com>
2321
2322         Reviewed by Darin Adler.
2323
2324         Remove the last non-GObject usage of PlatformRefPtr and move the code to GRefPtr
2325         https://bugs.webkit.org/show_bug.cgi?id=51846
2326
2327         * GNUmakefile.am: Remove PlatformRefPtr.h from the sources list.
2328         * JavaScriptCore.vcproj/WTF/WTF.vcproj: Ditto.
2329         * jit/ExecutableAllocator.h: Change references to PlatformRefPtr to RefPtr.
2330         (JSC::ExecutableAllocator::cacheFlush): Ditto.
2331         * wtf/PlatformRefPtr.h: Removed.
2332         * wtf/RandomNumber.cpp: Change references to PlatformRefPtr to RefPtr.
2333         (WTF::randomNumber): Ditto.
2334         * wtf/brew/RefPtrBrew.h: Ditto.
2335         (WTF::refIfNotNull): Added.
2336         (WTF::derefIfNotNull): Added.
2337         * wtf/brew/ShellBrew.h: Change references to PlatformRefPtr to RefPtr.
2338         (WTF::createRefPtrInstance): Modified to return a RefPtr.
2339         * wtf/gobject/GRefPtr.cpp: 
2340         (WTF::refGPtr): Moved from PlatformRefPtr here.
2341         (WTF::derefGPtr): Ditto.
2342         * wtf/gobject/GRefPtr.h: Ditto.
2343         (WTF::GRefPtr::GRefPtr): Ditto.
2344         (WTF::GRefPtr::~GRefPtr): Ditto.
2345         (WTF::GRefPtr::clear): Ditto.
2346         (WTF::GRefPtr::isHashTableDeletedValue): Ditto.
2347         (WTF::GRefPtr::get): Ditto.
2348         (WTF::GRefPtr::operator*): Ditto.
2349         (WTF::GRefPtr::operator->): Ditto.
2350         (WTF::GRefPtr::operator!): Ditto.
2351         (WTF::GRefPtr::operator UnspecifiedBoolType): Ditto.
2352         (WTF::GRefPtr::hashTableDeletedValue): Ditto.
2353         (WTF::::operator): Ditto.
2354         (WTF::::swap): Ditto.
2355         (WTF::swap): Ditto.
2356         (WTF::operator==): Ditto.
2357         (WTF::operator!=): Ditto.
2358         (WTF::static_pointer_cast): Ditto.
2359         (WTF::const_pointer_cast): Ditto.
2360         (WTF::getPtr): Ditto.
2361         (WTF::adoptGRef): Ditto.
2362         (WTF::refGPtr): Ditto.
2363         (WTF::derefGPtr): Ditto.
2364
2365 2011-01-04  Daniel Bates  <dbates@rim.com>
2366
2367         Reviewed by Adam Roben.
2368
2369         LEAK: Deallocate instance of ThreadFunctionInvocation if thread creation fails
2370         https://bugs.webkit.org/show_bug.cgi?id=51860
2371
2372         * wtf/ThreadingWin.cpp:
2373         (WTF::createThreadInternal):
2374
2375 2011-01-04  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
2376
2377         Reviewed by Ariya Hidayat.
2378
2379         [Qt][Symbian] Make sure that WebKit headers are included before platform headers on Symbian
2380         https://bugs.webkit.org/show_bug.cgi?id=31273
2381
2382         On Symbian PREPEND_INCLUDEPATH is the best way to make sure that WebKit headers
2383         are included before platform headers. On all other platforms continue to use
2384         INCLUDEPATH (as before). This is a continuation of r65877.
2385
2386         No new tests as there is no new functionality.
2387
2388         * JavaScriptCore.pri:
2389
2390 2011-01-04  Darin Adler  <darin@apple.com>
2391
2392         Try to fix Windows build.
2393
2394         * wtf/ThreadingWin.cpp: Added include of PassOwnPtr.h. Fixed paragraphing
2395         of conditional includes.
2396         (WTF::wtfThreadEntryPoint): Use -> instead of . to dereference pointer.
2397         (WTF::createThreadInternal): Tweaked #if to not need separate macro.
2398
2399 2011-01-04  Daniel Bates  <dbates@rim.com>
2400
2401         Reviewed by Adam Roben.
2402
2403         Extract ThreadFunctionInvocation into separate file and share between Apple Windows and Android
2404         https://bugs.webkit.org/show_bug.cgi?id=51855
2405
2406         Both the Apple Windows and Android ports implement a similar adapter structure,
2407         called ThreadFunctionInvocation and ThreadData respectively, as part of
2408         their thread creation process. Instead, we should share such an adapter
2409         structure and remove duplicate code.
2410
2411         * JavaScriptCore.gypi: Added header wtf/ThreadFunctionInvocation.h.
2412         * wtf/ThreadFunctionInvocation.h: Added.
2413         (WTF::ThreadFunctionInvocation::ThreadFunctionInvocation):
2414         * wtf/ThreadingPthreads.cpp: Removed Android-specific structure ThreadData; Instead, use ThreadFunctionInvocation.
2415         (WTF::runThreadWithRegistration):
2416         (WTF::createThreadInternal): 
2417         * wtf/ThreadingWin.cpp: Moved structure ThreadFunctionInvocation to its own file so that
2418         it can be shared with the Android implementation of createThreadInternal().
2419         (WTF::wtfThreadEntryPoint): Use OwnPtr to hold passed instance of ThreadFunctionInvocation.
2420
2421 2011-01-04  Daniel Bates  <dbates@rim.com>
2422
2423         Reviewed by Darin Adler.
2424
2425         Use __builtin_expect when compiling using RVCT in GNU mode
2426         https://bugs.webkit.org/show_bug.cgi?id=51866
2427
2428         Derived from a patch by Dave Tapuska.
2429
2430         * wtf/AlwaysInline.h:
2431
2432 2011-01-03  Darin Adler  <darin@apple.com>
2433
2434         Reviewed by Brady Eidson.
2435
2436         * wtf/Forward.h: Added Decoder and Encoder.
2437
2438 2011-01-03  Brady Eidson  <beidson@apple.com>
2439
2440         Reviewed by Darin Adler.
2441
2442         Add Encode/Decode machinery Darin and I plan to work with for back/forward stuff in WebKit2.
2443
2444         Starting out with a pure virtual interface to be implemented in WK2, but we might change that later.
2445
2446         * GNUmakefile.am:
2447         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
2448         * JavaScriptCore.xcodeproj/project.pbxproj:
2449         * wtf/CMakeLists.txt:
2450
2451         * wtf/Decoder.h: Added.
2452         * wtf/Encoder.h: Added.
2453
2454 2011-01-03  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
2455
2456         Unreviewed build fix.
2457
2458         [Qt] Add NullPtr.cpp introduced in r71155 to the Qt build system.
2459
2460         This fix is required for builds where HAVE(NULLPTR) is false
2461         (e.g. some MSVC and Symbian builds).
2462
2463         * wtf/wtf.pri:
2464
2465 2011-01-02  Dan Bernstein  <mitz@apple.com>
2466
2467         Rubber-stamped by Simon Fraser.
2468
2469         <rdar://problem/8812159> Update copyright strings
2470
2471         * Info.plist:
2472
2473 2011-01-02  Csaba Osztrogonác  <ossy@webkit.org>
2474
2475         Fix GTK+ build after r74855.
2476
2477         Reviewed by Xan Lopez.
2478
2479         * GNUmakefile.am: Fix include pathes.
2480
2481 2011-01-02  Adam Barth  <abarth@webkit.org>
2482
2483         One more .. missing in the Qt build.
2484
2485         * jsc.pro:
2486
2487 2011-01-02  Xan Lopez  <xlopez@igalia.com>
2488
2489         Fix GTK+ build.
2490
2491         * GNUmakefile.am: add -I$(srcdir)/Source to the JSC cppflags so
2492         that anyone can include its headers without adding the prefix
2493         'Source/'.
2494
2495 2011-01-02  Carl Lobo  <carllobo@gmail.com>
2496
2497         Reviewed by Adam Barth.
2498
2499         Fix Windows Build for non-production where VSPropsRedirectionDir is not defined.
2500         https://bugs.webkit.org/show_bug.cgi?id=51797
2501
2502         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2503         * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
2504         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
2505         * JavaScriptCore.vcproj/jsc/jsc.vcproj:
2506         * JavaScriptCore.vcproj/testapi/testapi.vcproj:
2507
2508 2011-01-01  Adam Barth  <abarth@webkit.org>
2509
2510         Fix relative include paths in an attempt to fix the Qt build.
2511
2512         * JavaScriptCore.pri:
2513         * JavaScriptCore.pro:
2514
2515 2011-01-01  Adam Barth  <abarth@webkit.org>
2516
2517         Another speculative build fix for GTK.
2518
2519         * GNUmakefile.am:
2520
2521 2011-01-01  Adam Barth  <abarth@webkit.org>
2522
2523         Speculative build fix for GTK.  Update the paths in GNUmakefile to
2524         include "Source".
2525
2526         * GNUmakefile.am:
2527
2528 2011-01-01  Adam Barth  <abarth@webkit.org>
2529
2530         Update relative paths in JavaScriptCore.gyp to account for the extra
2531         level of directories.
2532
2533         * JavaScriptCore.gyp/JavaScriptCore.gyp:
2534
2535 2010-12-31  Patrick Gansterer  <paroga@webkit.org>
2536
2537         Reviewed by Darin Adler.
2538
2539         Add a fast case for ASCII strings in HashAndUTF8CharactersTranslator::equal
2540         https://bugs.webkit.org/show_bug.cgi?id=50517
2541
2542         This change shows about 2% performance win on the xml-parser benchmark.
2543
2544         * wtf/text/AtomicString.cpp:
2545         (WTF::HashAndUTF8CharactersTranslator::equal):
2546
2547 2010-12-30  Patrick Gansterer  <paroga@webkit.org>
2548
2549         Reviewed by Ariya Hidayat.
2550
2551         [CMake] Add WTF_HEADERS
2552         https://bugs.webkit.org/show_bug.cgi?id=51741
2553
2554         Add the WTF headers to show them in Visual Studio.
2555
2556         * wtf/CMakeLists.txt:
2557         * wtf/CMakeListsWinCE.txt:
2558
2559 2010-12-30  Konstantin Tokarev  <annulen@yandex.ru>
2560
2561         Reviewed by David Kilzer.
2562
2563         [Qt] Don't build wtf/TCSystemAlloc.cpp if --system-malloc option is
2564         used
2565         https://bugs.webkit.org/show_bug.cgi?id=51672
2566
2567         * wtf/wtf.pri: Replaced USE_SYSTEM_MALLOC with USE_SYSTEM_MALLOC=1
2568
2569 2010-12-30  Patrick Gansterer  <paroga@webkit.org>
2570
2571         Reviewed by Darin Adler.
2572
2573         Use OS(WINDOWS) instead of COMPILER(MSVC) in FastMalloc.cpp
2574         https://bugs.webkit.org/show_bug.cgi?id=51743
2575
2576         Most of the ifdefs belong to windows and not to the MSVC compiler.
2577
2578         * wtf/FastMalloc.cpp:
2579
2580 2010-12-29  Gavin Barraclough  <barraclough@apple.com>
2581
2582         Reviewed by Sam Weinig.
2583
2584         Bug 51724 - In strict mode string literals should allow \0, but disallow \8 and \9.
2585
2586         * parser/Lexer.cpp:
2587         (JSC::Lexer::parseString):
2588
2589 2010-12-29  Helder Correia  <helder@sencha.com>
2590
2591         Reviewed by Eric Seidel.
2592
2593         <VT> and <FF> are not valid JSON whitespace characters
2594         https://bugs.webkit.org/show_bug.cgi?id=51671
2595
2596         Vertical Tab and Form Feed are not allowed white spaces by the JSON
2597         RFC 4627: http://www.ietf.org/rfc/rfc4627.txt (2. JSON Grammar).
2598
2599         Tests: ietestcenter/Javascript/15.12.1.1-0-2.html
2600                ietestcenter/Javascript/15.12.1.1-0-3.html
2601
2602         * runtime/LiteralParser.cpp:
2603         (JSC::isJSONWhiteSpace):
2604         (JSC::LiteralParser::Lexer::lex):
2605
2606 2010-12-28  Helder Correia  <helder@sencha.com>
2607
2608         Reviewed by Eric Seidel.
2609
2610         JSON.stringify must exist as a function taking 3 parameters
2611         https://bugs.webkit.org/show_bug.cgi?id=51667
2612
2613         The reported function length is 1 instead.
2614
2615         Test: ietestcenter/Javascript/15.12.3-0-2.html
2616
2617         * runtime/JSONObject.cpp:
2618
2619 2010-12-28  Helder Correia  <helder@sencha.com>
2620
2621         Reviewed by Sam Weinig.
2622
2623         JSON.parse must exist as a function taking 2 parameters
2624         https://bugs.webkit.org/show_bug.cgi?id=51666
2625
2626         Support for revivers was introduced in bug 26591, but the function
2627         length has since remained unchanged.
2628
2629         Test: ietestcenter/Javascript/15.12.2-0-2.html
2630
2631         * runtime/JSONObject.cpp:
2632
2633 2010-12-27  Jake Helfert  <jake@jakeonthenet.com>
2634
2635         Reviewed and reworked by Darin Adler.
2636
2637         Building WebKit with Visual Studio 2010 fails due
2638         to ambiguous assignment operator errors.
2639         https://bugs.webkit.org/show_bug.cgi?id=51116
2640
2641         * wtf/NullPtr.h: Added a HAVE(NULLPTR) definition for use with
2642         Platform.h HAVE macro, and included the Visual Studio 2010 compiler
2643         as one of the ones that has nullptr.
2644         * wtf/NullPtr.cpp: Updated condition to match.
2645         
2646         * wtf/PassOwnArrayPtr.h: Don't include the operator=(nullptr_t)
2647         overload if we are compiling in loose mode and the compiler has
2648         nullptr, because assignment of 0 will otherwise encounter
2649         ambiguitity with this overload and the overload for loose mode
2650         that takes a raw pointer. The conditional can be removed when we
2651         get rid of loose mode.
2652         * wtf/PassOwnPtr.h: Ditto.
2653
2654         * wtf/PassRefPtr.h: Don't include the operator=(nullptr_t) overload
2655         if the compiler has nullptr, because assignment of 0 would be
2656         ambiguous with the overload that takes a raw pointer. The conditional
2657         can be removed if we ever decide we no longer need to support
2658         assigning 0, but might need a way to catch that usage on older compilers.
2659         * wtf/RefPtr.h: Ditto.
2660         * wtf/RetainPtr.h: Ditto
2661
2662         * JavaScriptCore.xcodeproj/project.pbxproj: Added NullPtr.cpp,
2663         accidentally omitted when the file was first added.
2664
2665 2010-12-26  Xan Lopez  <xlopez@igalia.com>
2666
2667         Reviewed by Eric Seidel.
2668
2669         [GTK] Add standalone target for JSC
2670         https://bugs.webkit.org/show_bug.cgi?id=51607
2671
2672         * GNUmakefile.am: add convenience target to only build jsc and its
2673         dependencies.
2674
2675 2010-12-24  Patrick Gansterer  <paroga@webkit.org>
2676
2677         Reviewed by Eric Seidel.
2678
2679         [WINCE] Add CPU(MIPS) detection
2680         https://bugs.webkit.org/show_bug.cgi?id=51342
2681
2682         WinCE usually defines MIPS and _MIPS_.
2683
2684         * wtf/Platform.h:
2685
2686 2010-12-23  Gavin Barraclough  <barraclough@apple.com>
2687
2688         Reviewed by Sam Weinig.
2689
2690         Rename RegexCompiler.cpp to RegexPattern.cpp.
2691         Implicitly call compileRegex from RegexPattern's constructor.
2692
2693         * Android.mk:
2694         * CMakeLists.txt:
2695         * GNUmakefile.am:
2696         * JavaScriptCore.gypi:
2697         * JavaScriptCore.pro:
2698         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2699         * JavaScriptCore.xcodeproj/project.pbxproj:
2700         * runtime/RegExp.cpp:
2701         (JSC::RegExp::compile):
2702         * yarr/RegexCompiler.cpp: Removed.
2703         * yarr/RegexCompiler.h: Removed.
2704         * yarr/RegexInterpreter.cpp:
2705         * yarr/RegexJIT.cpp:
2706         * yarr/RegexPattern.cpp: Copied from JavaScriptCore/yarr/RegexCompiler.cpp.
2707         (JSC::Yarr::compileRegex):
2708         (JSC::Yarr::RegexPattern::RegexPattern):
2709         * yarr/RegexPattern.h:
2710
2711 2010-12-23  Patrick Gansterer  <paroga@webkit.org>
2712
2713         Unreviewed build fix for WinCE after r74360.
2714
2715         Move the OS(WINDOWS) section after the OS(WINCE) section
2716         and add missing argument to the getStackMax call.
2717
2718         * wtf/StackBounds.cpp:
2719         (WTF::StackBounds::initialize):
2720
2721 2010-12-22  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
2722
2723         Unreviewed build fix.
2724
2725         [Symbian] Make sure OSAllocatorSymbian builds
2726
2727         This patch only addresses the build problem.
2728
2729         https://bugs.webkit.org/show_bug.cgi?id=51128 tracks the full
2730         (re)implementation of the Symbian allocator.
2731
2732         * wtf/OSAllocatorSymbian.cpp:
2733         (WTF::OSAllocator::reserveUncommitted):
2734         (WTF::OSAllocator::reserveAndCommit):
2735         (WTF::OSAllocator::commit):
2736
2737 2010-12-22  Dan Bernstein  <mitz@apple.com>
2738
2739         Changed WebKitTools to Tools.
2740
2741         * JavaScriptCore.vcproj/JavaScriptCore.sln:
2742
2743 2010-12-22  Dan Bernstein  <mitz@apple.com>
2744
2745         Rubber-stamped by Mark Rowe.
2746
2747         Changed WebKitTools to Tools in script build phases.
2748
2749         * JavaScriptCore.xcodeproj/project.pbxproj:
2750
2751 2010-12-22  Andrei Popescu  <andreip@google.com>
2752
2753         Unreviewed build fix.
2754
2755         Fix Chromium Linux shared library build.
2756         [Chromium] r74431 broke the Chromium Linux shared library build
2757         https://bugs.webkit.org/show_bug.cgi?id=51462
2758
2759         * JavaScriptCore.gyp/JavaScriptCore.gyp:
2760         * JavaScriptCore.gypi:
2761
2762 2010-12-21  Sheriff Bot  <webkit.review.bot@gmail.com>
2763
2764         Unreviewed, rolling out r74462.
2765         http://trac.webkit.org/changeset/74462
2766         https://bugs.webkit.org/show_bug.cgi?id=51449
2767
2768         broke chromium win (Requested by tonyg-cr on #webkit).
2769
2770         * JavaScriptCore.gypi:
2771
2772 2010-12-21  Tony Gentilcore  <tonyg@chromium.org>
2773
2774         Unreviewed build fix.
2775
2776         [chromium] Build fix after r74431
2777         https://bugs.webkit.org/show_bug.cgi?id=51447
2778
2779         * JavaScriptCore.gypi:
2780
2781 2010-12-21  Gavin Barraclough  <barraclough@apple.com>
2782
2783         Windows build fix.
2784
2785         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2786
2787 2010-12-21  Gavin Barraclough  <barraclough@apple.com>
2788
2789         Windows build fix.
2790
2791         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2792
2793 2010-12-21  Gavin Barraclough  <barraclough@apple.com>
2794
2795         Speculative build fix.
2796
2797         * jit/ExecutableAllocator.cpp:
2798         (JSC::ExecutableAllocator::underMemoryPressure):
2799
2800 2010-12-21  Gavin Barraclough  <barraclough@apple.com>
2801
2802         Reviewed by Oliver Hunt.
2803
2804         Bug 26276 - Need a mechanism to determine stack extent
2805
2806         This patch adds accurate stack size calculation for:
2807             DARWIN, QNX, UNIX
2808         We still need to fix:
2809             WINDOWS, SOLARIS, OPENBSD, SYMBIAN, HAIKU, WINCE
2810
2811         * wtf/StackBounds.cpp:
2812         (WTF::StackBounds::initialize):
2813
2814 2010-12-21  Gavin Barraclough  <barraclough@apple.com>
2815
2816          Reviewed by Geoff Garen.
2817  
2818         <rdar://problem/8765333> CRASH running out of executable memory, loading io9.com
2819         https://bugs.webkit.org/show_bug.cgi?id=51443
2820
2821         The problem here is that each page uses a reasonable amount of memory, (~4Mb),
2822         and that when miultiple pages are open we keep all JIT code for all functions
2823         in all pages alive.
2824
2825         Add a check to detect high memory pressure situations in the executable allocator
2826         (>50% of available memory allocated), and upon a top level entry into JSC (no code
2827         running on the stack) in this situation throw away all JIT code.
2828
2829         * JavaScriptCore.exp:
2830         * debugger/Debugger.cpp:
2831         (JSC::Debugger::recompileAllJSFunctions): stop passing exec to recompile.
2832         * jit/ExecutableAllocator.h:
2833         * jit/ExecutableAllocatorFixedVMPool.cpp:
2834         (JSC::ExecutablePool::systemAlloc): Count allocations.
2835         (JSC::ExecutablePool::systemRelease): Count deallocations.
2836         (JSC::ExecutablePool::underMemoryPressure): Check memory pressure.
2837         * jit/ExecutableAllocatorPosix.cpp:
2838         (JSC::ExecutablePool::underMemoryPressure): Stub out; only meaningful with FixedVMPool.
2839         * jit/ExecutableAllocatorWin.cpp:
2840         (JSC::ExecutablePool::underMemoryPressure): Stub out; only meaningful with FixedVMPool.
2841         * runtime/Executable.cpp:
2842         (JSC::FunctionExecutable::recompile): Remove ExecState argument to recompile.
2843         * runtime/Executable.h:
2844         * runtime/JSGlobalData.cpp:
2845         (JSC::JSGlobalData::recompileAllJSFunctions): throws away all JIT code.
2846         * runtime/JSGlobalData.h:
2847         * runtime/JSGlobalObject.h:
2848         (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope): add check / call to throw away.
2849
2850 2010-12-21  Gavin Barraclough  <barraclough@apple.com>
2851
2852         Reviewed by Geoff Garen.
2853
2854         <rdar://problem/8241425> JIT executable memory excessive usage due to regex caching
2855         https://bugs.webkit.org/show_bug.cgi?id=51434
2856
2857         Reduce the amount of memory the RegExpCache can hold on to on iOS.
2858         Currently the RegExpCache can hold 256 RegExp objects. If each falls into a separate
2859         ExecutablePool, with a common size of 16Kb, this means we end up holding onto 4Mb of
2860         memory. Firstly, we can reduce this by simply reducing the size of the cache to 32
2861         entries. Secondly, we can use a separate set of ExecutablePools for JIT code generated
2862         from RegExp objects. This helps in two ways (1) it increases the probability that
2863         RegExps in the cache share the same pool, and (2) it means that a RegExp can't end
2864         up holding on to a large ExecutablePool containing a translation of JS code.
2865         (A RegExp could end up keeping a larger RegExp alive that happened to be sharing the
2866         same pool, but large RegExp patterns are less common).
2867
2868         * runtime/JSGlobalData.h:
2869         * runtime/RegExpCache.h:
2870         * yarr/RegexJIT.cpp:
2871         (JSC::Yarr::RegexGenerator::compile):
2872
2873 2010-12-21  Gavin Barraclough  <barraclough@apple.com>
2874
2875         Windows build fix.
2876
2877         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2878
2879 2010-12-21  Gavin Barraclough  <barraclough@apple.com>
2880
2881         Eeeep! build fix!
2882
2883         * wtf/OSAllocator.h:
2884         (WTF::OSAllocator::decommitAndRelease):
2885
2886 2010-12-21  Gavin Barraclough  <barraclough@apple.com>
2887
2888         Ooops, fixed typo in comment.
2889
2890         * wtf/OSAllocator.h:
2891
2892 2010-12-21  Geoffrey Garen  <ggaren@apple.com>
2893
2894         Reviewed by Gavin Barraclough & Oliver Hunt.
2895
2896         Added PageAllocationAligned, a cross-platform abstraction for memory allocations with arbitrary alignment requirements
2897         https://bugs.webkit.org/show_bug.cgi?id=51359
2898         
2899         I think this patch fixes <rdar://problem/8107952> [5.0.1] WER crash in
2900         Heap::allocateBlock (1902752929), and some other leaks and crashes as well.
2901
2902         * Android.mk:
2903         * CMakeLists.txt:
2904         * GNUmakefile.am:
2905         * JavaScriptCore.gypi:
2906         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
2907         * JavaScriptCore.xcodeproj/project.pbxproj: Updated build files.
2908
2909         * runtime/AlignedMemoryAllocator.h: Removed. Supplanted by
2910         PageAllocationAligned.
2911
2912         * runtime/Collector.cpp:
2913         (JSC::Heap::destroy):
2914         (JSC::Heap::allocateBlock):
2915         (JSC::Heap::freeBlock):
2916         (JSC::Heap::addWeakGCHandle):
2917         * runtime/Collector.h: Switched from AlignedMemoryAllocator to
2918         PageAllocationAligned.
2919
2920         * runtime/GCHandle.cpp:
2921         * runtime/GCHandle.h: Ditto.
2922
2923         * wtf/PageAllocation.h:
2924         (WTF::PageAllocation::PageAllocation): Removed aligned memory allocation
2925         functions. Supplanted by PageAllocationAligned.
2926
2927         * wtf/PageAllocationAligned.cpp: Added.
2928         (WTF::PageAllocationAligned::allocate):
2929         (WTF::PageAllocationAligned::deallocate):
2930         * wtf/PageAllocationAligned.h: Added.
2931         (WTF::PageAllocationAligned::PageAllocationAligned): New cross-platform
2932         class for doing aligned memory allocation. This class properly matches
2933         allocation and deallocation library calls, fixing a long-standing bug
2934         in PageAllocation.
2935
2936         * wtf/Platform.h: Removed some defunction VM platform defines.
2937
2938         * wtf/wtf.pri: Updated build files.
2939
2940 2010-12-21  Oliver Hunt  <oliver@apple.com>
2941
2942         Reviewed by Gavin Barraclough.
2943
2944         ASSERTION FAILED: base->index() == m_codeBlock->argumentsRegister() while loading taobao.com
2945         https://bugs.webkit.org/show_bug.cgi?id=49006
2946
2947         This problem was caused by having a parameter named 'arguments'.
2948         The fix is to treat parameters named 'arguments' as shadowing
2949         the actual arguments property, and so logically turn the function
2950         into one that doesn't "use" arguments.
2951
2952         This required a bit of fiddling in the parser to ensure we correctly
2953         propagate the 'feature' of shadowing is set correctly.
2954
2955         * bytecompiler/BytecodeGenerator.cpp:
2956         (JSC::BytecodeGenerator::createArgumentsIfNecessary):
2957           Change assertion to an early return as we may now reference
2958           a property named 'arguments' without being in a function that
2959           has the ArgumentsFeature
2960         * parser/JSParser.cpp:
2961         (JSC::JSParser::Scope::Scope):
2962         (JSC::JSParser::Scope::declareParameter):
2963         (JSC::JSParser::Scope::shadowsArguments):
2964         (JSC::JSParser::parseProgram):
2965         (JSC::JSParser::parseFormalParameters):
2966         (JSC::JSParser::parseFunctionInfo):
2967         * parser/Nodes.h:
2968         (JSC::ScopeNode::usesArguments):
2969
2970 2010-12-21  Daniel Bates  <dbates@rim.com>
2971
2972         Reviewed by Eric Seidel and Darin Adler.
2973
2974         Deallocate GregorianDateTime.timeZone (if allocated) when copying so that we don't leak memory.
2975         https://bugs.webkit.org/show_bug.cgi?id=51367
2976
2977         Inspired by a patch by George Staikos.
2978
2979         * wtf/DateMath.cpp:
2980         (JSC::msToGregorianDateTime): Modified to set timeZone to nullptr since timeZone is now
2981         of type OwnPtrArray<char>.
2982         * wtf/DateMath.h: Change timeZone to type OwnArrayPtr<char>; Removed destructor since it is no longer needed.
2983         (JSC::GregorianDateTime::GregorianDateTime): Modified to use OwnPtrArray semantics for timeZone.
2984         (JSC::GregorianDateTime::operator tm): Ditto.
2985         (JSC::GregorianDateTime::copyFrom): Ditto.
2986
2987 2010-12-21  Sheriff Bot  <webkit.review.bot@gmail.com>
2988
2989         Unreviewed, rolling out r74402.
2990         http://trac.webkit.org/changeset/74402
2991         https://bugs.webkit.org/show_bug.cgi?id=51402
2992
2993         This patch broke the Windows 7 Release Layout Tests (Requested
2994         by jessieberlin on #webkit).
2995
2996         * wtf/StackBounds.cpp:
2997         (WTF::estimateStackBound):
2998         (WTF::StackBounds::initialize):
2999
3000 2010-12-21  Peter Varga  <pvarga@inf.u-szeged.hu>
3001
3002         Reviewed by Csaba Osztrogonác.
3003
3004         Unify the name of parentheses in YARR: rename parenthesis to
3005         parentheses.
3006
3007         * yarr/RegexCompiler.cpp:
3008         (JSC::Yarr::RegexPatternConstructor::atomParenthesesEnd):
3009
3010 2010-12-21  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
3011
3012         Reviewed by Andreas Kling.
3013
3014         [Qt] Set BUILDING_QT__ consistently
3015         https://bugs.webkit.org/show_bug.cgi?id=51341
3016
3017         * JavaScriptCore.pri: Remove the definition of BUILDING_QT__ as it
3018         is already defined in WebKit.pri.
3019
3020 2010-12-20  Gavin Barraclough  <barraclough@apple.com>
3021
3022         Reviewed by Oliver Hunt.
3023
3024         Bug 26276 - Need a mechanism to determine stack extent
3025
3026         This patch adds accurate stack size calculation for:
3027             DARWIN, WINDOWS, QNX, UNIX
3028         We still need to fix:
3029             SOLARIS, OPENBSD, SYMBIAN, HAIKU, WINCE
3030
3031         * wtf/StackBounds.cpp:
3032         (WTF::StackBounds::initialize):
3033
3034 2010-12-20  Gavin Barraclough  <barraclough@apple.com>
3035
3036         PPC build fix; stop using std::swap on PageAllocation/PageReservation,
3037         this was failing on some compilers since the lack of default construction
3038         for the m_executable/m_writable fields meant the value being swapped may
3039         not have been fully initialized.
3040
3041         * wtf/PageAllocation.h:
3042         (WTF::PageAllocation::deallocate):
3043         * wtf/PageBlock.h:
3044         * wtf/PageReservation.h:
3045         (WTF::PageReservation::deallocate):
3046
3047 2010-12-20  Oliver Hunt  <oliver@apple.com>
3048
3049         Reviewed by Geoffrey Garen.
3050
3051         |delete name| in strict mode code should be an early error
3052         https://bugs.webkit.org/show_bug.cgi?id=50431
3053
3054         Disallow the |delete IDENTIFIER| production in strict mode, and removed
3055         a bunch of now unnecessary code.
3056
3057         * parser/JSParser.cpp:
3058         (JSC::JSParser::Scope::collectFreeVariables):
3059         (JSC::jsParse):
3060         (JSC::JSParser::parseProgram):
3061         (JSC::JSParser::parseUnaryExpression):
3062         * parser/JSParser.h:
3063         * parser/Parser.cpp:
3064         (JSC::Parser::parse):
3065         * parser/Parser.h:
3066         (JSC::Parser::parse):
3067
3068 2010-12-20  Gavin Barraclough  <barraclough@apple.com>
3069
3070         Reviewed by Olver Hunt.
3071
3072         Bug 51358 - Should check stack depth rather than using recursion limits in byte compilation
3073
3074         The current implementation of recursion limit checking is not safe on smaller stacks.
3075         Switch to using a common mechanism, shared with the parser, to check recursion limits.
3076
3077         Make bytecompiler use StackBounds. Empirical testing shows emitStrcat to have the largest
3078         footprint on the stack, at just under 1k on x86-64.  Given this, the default recursion
3079         check (requiring 4k of available space to recurse) seems reasonable.
3080
3081         * bytecompiler/BytecodeGenerator.cpp:
3082         (JSC::BytecodeGenerator::BytecodeGenerator):
3083         * bytecompiler/BytecodeGenerator.h:
3084         (JSC::BytecodeGenerator::emitNode):
3085         (JSC::BytecodeGenerator::emitNodeInConditionContext):
3086         * bytecompiler/NodesCodegen.cpp:
3087         (JSC::BinaryOpNode::emitStrcat):
3088
3089 2010-12-20  Tony Gentilcore  <tonyg@chromium.org>
3090
3091         Unreviewed build fix.
3092
3093         Include pthread to fix chromium mac build (broken by r74360)
3094         https://bugs.webkit.org/show_bug.cgi?id=51356
3095
3096         * wtf/StackBounds.cpp:
3097
3098 2010-12-20  Xan Lopez  <xlopez@igalia.com>
3099
3100         Reviewed by Gustavo Noronha.
3101
3102         * GNUmakefile.am: add missing files.
3103
3104 2010-12-18  Gavin Barraclough  <barraclough@apple.com>
3105
3106         Reviewed by Oliver Hunt.
3107
3108         Bug 26276 - Need a mechanism to determine stack extent
3109
3110         This patch adds a class 'StackBounds', to hold information about the machine stack.
3111         The implementation of this class broadly adheres to the current implmentation of
3112         stack limit checking, and as such does not solve the problem of determining stack
3113         extent, but gives us a common place to do so.
3114
3115         Currently two mechanism are provided to determine the stack origin (the point the
3116         stack is growing away from). currentThreadStackBase() in Collector provides a
3117         more accurate determination of the stack origin, so use this to calculate
3118         StackBounds::m_origin; WTFThreadData::approximatedStackStart is less accurate, and
3119         as such can be removed.  Cache the StackBounds on WTFThreadData such that they
3120         need only be determined once per thread, and for non-API contexts cache this
3121         information in JSGlobalData, to save a thread-specific access.
3122
3123         For the time being retain the estimate of stack size used by JSC's parser
3124         (128 * sizeof(void*) * 1024), with a view to replacing this with something more
3125         accurate in the near future.
3126
3127         * parser/JSParser.cpp:
3128         (JSC::JSParser::canRecurse):
3129         (JSC::JSParser::JSParser):
3130             Change to use StackBounds.
3131         * runtime/Collector.cpp:
3132         (JSC::Heap::registerThread):
3133         (JSC::Heap::markCurrentThreadConservativelyInternal):
3134             Change to use StackBounds, cached on JSGlobalData.
3135         * runtime/JSGlobalData.cpp:
3136         (JSC::JSGlobalData::JSGlobalData):
3137         * runtime/JSGlobalData.h:
3138         (JSC::JSGlobalData::stack):
3139             Add a cached copy of StackBounds.
3140         * wtf/StackBounds.cpp: Copied from JavaScriptCore/runtime/Collector.cpp.
3141         (WTF::estimateStackBound):
3142         (WTF::StackBounds::initialize):
3143         (WTF::getStackMax):
3144             Copy code from Collector.cpp to determine stack origin.
3145         * wtf/StackBounds.h: Added.
3146         (WTF::StackBounds::StackBounds):
3147             No argument constructor; returns a null StackBounds.
3148         (WTF::StackBounds::currentThreadStackBounds):
3149             Returns a StackBounds object representing the stack limits
3150             of the current thread.
3151         (WTF::StackBounds::origin):
3152             Returns to stack origin (the point the stack is growing away
3153             from; the highest extent of the stack on machines where the
3154             stack grows downwards.
3155         (WTF::StackBounds::recursionLimit):
3156             Returns a limit value that is 'a comfortable distance from
3157             the end of the stack'. Our concept of this is currently 1 page
3158             away from the end, however the default value may be tuned in
3159             the future, and clients may override passing a larger delta;
3160             should only be called on StackBounds object representing the
3161             stack of the thread this method is called on (checked by
3162             checkConsistency).
3163         (WTF::StackBounds::recursionCheck):
3164             Checks whether we are currently 'a comfortable distance from
3165             the end of the stack'. Our concept of this is currently 1 page
3166             away from the end, however the default value may be tuned in
3167             the future, and clients may override passing a larger delta
3168             to apply when checking, if they wish to do so. This method
3169             should only be called on StackBounds object representing the
3170             stack of the thread this method is called on (checked by
3171             checkConsistency).
3172         (WTF::StackBounds::current):
3173             Approximate current stack position. On machines where the stack
3174             is growing downwards this is the lowest address that might need
3175             conservative collection.
3176         (WTF::StackBounds::isGrowingDownward):
3177             True for all platforms other than WINCE, which has to check.
3178         (WTF::StackBounds::checkConsistency):
3179             This is called in methods that shoulds only be operating on a
3180             valid set of bounds; as such we expect m_origin != m_bounds
3181             (i.e. stack size != zero) - we're really testing that this
3182             object is not null (the constructor initializes both fields
3183             to zero).  Also checks that current() is within the stack's
3184             bounds.
3185         * wtf/WTFThreadData.cpp:
3186         (WTF::WTFThreadData::WTFThreadData):
3187         * wtf/WTFThreadData.h:
3188         (WTF::WTFThreadData::stack):
3189             Add the StackBounds member variable.
3190
3191 2010-12-17  Geoffrey Garen  <ggaren@apple.com>
3192
3193         Reviewed by Sam Weinig.
3194
3195         Factored common page set management into a new PageBlock base class
3196         https://bugs.webkit.org/show_bug.cgi?id=51285
3197
3198         * Android.mk:
3199         * CMakeLists.txt:
3200         * GNUmakefile.am:
3201         * JavaScriptCore.gypi:
3202         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
3203         * JavaScriptCore.xcodeproj/project.pbxproj:
3204         * interpreter/RegisterFile.h:
3205         (JSC::RegisterFile::RegisterFile):
3206         * jit/ExecutableAllocator.cpp:
3207         (JSC::ExecutableAllocator::intializePageSize):
3208         * wtf/PageAllocation.cpp: Removed.
3209         * wtf/PageAllocation.h:
3210         (WTF::PageAllocation::deallocate):
3211         (WTF::PageAllocation::PageAllocation):
3212         * wtf/PageReservation.h:
3213         (WTF::PageReservation::commit):
3214         (WTF::PageReservation::decommit):
3215         (WTF::PageReservation::deallocate):
3216         (WTF::PageReservation::PageReservation):
3217         * wtf/wtf.pri:
3218
3219 2010-12-17  Michael Saboff  <msaboff@apple.com>
3220
3221         Reviewed by Oliver Hunt.
3222
3223         RegExp Jit'ed expression crashes clicking link on yelp.com
3224         https://bugs.webkit.org/show_bug.cgi?id=51284
3225
3226         When transitioning between an non-repeating beginning of line
3227         anchored expression and the remaining refactored repeating 
3228         expression, we should not clear any residual datalabel in 
3229         state's m_backtrack.  It will be resolved and cleared in subsequent
3230         code when linkAlternativeBacktracks() is called for the repeating
3231         alternative(s).
3232
3233         * yarr/RegexJIT.cpp:
3234         (JSC::Yarr::RegexGenerator::BacktrackDestination::clear):
3235         (JSC::Yarr::RegexGenerator::TermGenerationState::clearBacktrack):
3236
3237 2010-12-17  Dan Bernstein  <mitz@apple.com>
3238
3239         Rubber-stamped by Mark Rowe.
3240
3241         Updated for the renaming of WebKitTools to Tools
3242
3243         * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
3244
3245 2010-12-17  Ariya Hidayat  <ariya@sencha.com>
3246
3247         Reviewed by Oliver Hunt.
3248
3249         [JSC] parseAssignmentExpression should use TreeBuilder::CreatesAST
3250         https://bugs.webkit.org/show_bug.cgi?id=51268
3251
3252         * parser/JSParser.cpp:
3253         (JSC::JSParser::parseAssignmentExpression):
3254
3255 2010-12-17  Geoffrey Garen  <ggaren@apple.com>
3256
3257         Reviewed by Oliver Hunt.
3258
3259         Removed RChunk from PageAllocation/PageReservation, since it's now unused.
3260         https://bugs.webkit.org/show_bug.cgi?id=51276
3261
3262         * wtf/PageAllocation.h:
3263         (WTF::PageAllocation::PageAllocation):
3264         * wtf/PageReservation.h:
3265         (WTF::PageReservation::PageReservation):
3266
3267 2010-12-17  Oliver Hunt  <oliver@apple.com>
3268
3269         Reviewed by Gavin Barraclough.
3270
3271         Incorrect encoding of some constants in ARMv7 JIT
3272         https://bugs.webkit.org/show_bug.cgi?id=51273
3273         <rdar://problem/8650210>
3274
3275         When using immediate encoding 3 we need to write the byte
3276         that holds a duplicated value.
3277
3278         * assembler/ARMv7Assembler.h:
3279         (JSC::ARMThumbImmediate::makeEncodedImm):
3280
3281 2010-12-16  Evan Martin  <evan@chromium.org>
3282
3283         Reviewed by Darin Fisher.
3284
3285         [chromium] useless warnings when building on Windows
3286         https://bugs.webkit.org/show_bug.cgi?id=50985
3287
3288         Disable some compiler warnings that aren't indicative of real problems.
3289
3290         * JavaScriptCore.gyp/JavaScriptCore.gyp:
3291
3292 2010-12-16  Pratik Solanki  <psolanki@apple.com>
3293
3294         Reviewed by Geoffrey Garen.
3295
3296         https://bugs.webkit.org/show_bug.cgi?id=51166
3297         ExecutableAllocator::cacheFlush should call sys_cache_control
3298
3299         * jit/ExecutableAllocator.h:
3300         (JSC::ExecutableAllocator::cacheFlush): Use the more correct and forward looking API -
3301         sys_cache_control(kCacheFunctionPrepareForExecution,...).
3302
3303 2010-12-16  Ariya Hidayat  <ariya@sencha.com>
3304
3305         Reviewed by Andreas Kling.
3306
3307         [JSC] Const correctness in ASTBuilder and SyntaxChecker
3308         https://bugs.webkit.org/show_bug.cgi?id=51141
3309
3310         * parser/ASTBuilder.h:
3311         (JSC::ASTBuilder::getName):
3312         (JSC::ASTBuilder::getType):
3313         (JSC::ASTBuilder::isResolve):
3314         * parser/SyntaxChecker.h:
3315         (JSC::SyntaxChecker::operatorStackPop):
3316
3317 2010-12-15  Kenneth Russell  <kbr@google.com>
3318
3319         Reviewed by James Robinson.
3320
3321         Web Audio API: port FFTFrame to MKL
3322         https://bugs.webkit.org/show_bug.cgi?id=50986
3323
3324         Fixed bug in log2 emulation function provided for Windows port of
3325         Web Audio API.
3326
3327         * wtf/MathExtras.h:
3328         (log2):
3329
3330 2010-12-14  Mark Rowe  <mrowe@apple.com>
3331
3332         Reviewed by Sam Weinig.
3333
3334         <http://webkit.org/b/51064> Reproducible crash inside WebCore::MediaPlayerPrivateQTKit::createQTMovie when loading <video>
3335
3336         * wtf/text/WTFString.h: Prevent String from being implicitly convertable to bool.
3337         It was previously implicitly convertible to bool on Mac via operator NSString*,
3338         but since that always has a non-zero return value it would give unexpected results.
3339
3340 2010-12-14  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
3341
3342         Reviewed by Eric Seidel.
3343
3344         [Qt] [Symbian] Do not use pkg-config on Symbian as it is not supported
3345         https://bugs.webkit.org/show_bug.cgi?id=50231
3346
3347         Guard CONFIG+=link_pkgconfig with !symbian.
3348
3349         * jsc.pro:
3350
3351 2010-12-14  Cameron Zwarich  <zwarich@apple.com>
3352
3353         Not reviewed.
3354
3355         Revert accidental change disabling the JIT for most platforms.
3356
3357         * wtf/Platform.h:
3358
3359 2010-12-13  Cameron Zwarich  <zwarich@apple.com>
3360
3361         Reviewed by Eric Seidel.
3362
3363         Clang fails to build the JSC interpreter
3364         https://bugs.webkit.org/show_bug.cgi?id=51016
3365
3366         Clang does not allow indirect gotos out of scopes with cleanup. GCC 4.2 allows
3367         them, but it does not correctly generate the cleanup, causing a leak if the
3368         cleanup decrements a reference count.
3369
3370         * interpreter/Interpreter.cpp:
3371         (JSC::Interpreter::privateExecute): Put an Identifier into its own scope.
3372
3373 2010-12-14  Carlos Garcia Campos  <cgarcia@igalia.com>
3374
3375         Reviewed by Martin Robinson.
3376
3377         [GTK] Simplify context-menu handling code
3378         https://bugs.webkit.org/show_bug.cgi?id=49658
3379
3380         * wtf/PlatformRefPtr.h: Add leakRef()
3381
3382 2010-12-13  Cameron Zwarich  <zwarich@apple.com>
3383
3384         Reviewed by Gavin Barraclough.
3385
3386         JavaScriptCore should not use "asm volatile" outside of a function
3387         https://bugs.webkit.org/show_bug.cgi?id=50991
3388
3389         * jit/JITStubs.cpp: Remove the volatile keyword from asm statements.
3390
3391 2010-12-13  Steve Falkenburg  <sfalken@apple.com>
3392
3393         Windows production build fix.
3394         Try copying ICU 4.6 in addition to 4.4 and 4.2.
3395
3396         * JavaScriptCore.vcproj/jsc/jscPostBuild.cmd:
3397
3398 2010-12-13  Michael Saboff  <msaboff@apple.com>
3399
3400         Reviewed by Oliver Hunt.
3401
3402         REGRESSION: mobileme mail viewing is broken
3403         https://bugs.webkit.org/show_bug.cgi?id=50884
3404
3405         Fixed problem where simple parenthesis (those without capture and
3406         with a fixed count) where not propagating backtrack to labels for 
3407         nested parentheses.  Also added the nesting level for the parentheses 
3408         state created in that case as well.
3409
3410         * yarr/RegexJIT.cpp:
3411         (JSC::Yarr::RegexGenerator::BacktrackDestination::copyBacktrackToLabel):
3412         (JSC::Yarr::RegexGenerator::TermGenerationState::isLastTerm):
3413         (JSC::Yarr::RegexGenerator::ParenthesesTail::generateCode):
3414         (JSC::Yarr::RegexGenerator::generateParenthesesSingle):
3415
3416 2010-12-13  Peter Varga  <pvarga@inf.u-szeged.hu>
3417
3418         Reviewed by Gavin Barraclough.
3419
3420         Reduce the size of the RegexStackSpaceForBackTrackInfoParentheses in YARR
3421         https://bugs.webkit.org/show_bug.cgi?id=49385
3422
3423         Remove the BackTrackInfoParentheses struct prevBegin and prevEnd members.
3424
3425         * yarr/RegexInterpreter.cpp:
3426         (JSC::Yarr::Interpreter::matchParentheses):
3427         (JSC::Yarr::Interpreter::backtrackParentheses):
3428         * yarr/RegexPattern.h:
3429
3430 2010-12-10  Michael Saboff  <msaboff@apple.com>
3431
3432         Reviewed by Gavin Barraclough.
3433
3434         REGRESSION Hang inside Yarr::RegexCodeBlock::execute when visiting
3435         bugs.webkit.org
3436         https://bugs.webkit.org/show_bug.cgi?id=50816
3437
3438         First nested parentheses of the second or greater alternative
3439         where backtracking to the prior parentheses.  Changed the default
3440         handling of initial parentheses for all alternatives to go back
3441         to the immediate outer paren.
3442
3443         * yarr/RegexJIT.cpp:
3444         (JSC::Yarr::RegexGenerator::GenerationState::addParenthesesTail):
3445         (JSC::Yarr::RegexGenerator::TermGenerationState::TermGenerationState):
3446         (JSC::Yarr::RegexGenerator::TermGenerationState::isLastTerm):
3447         (JSC::Yarr::RegexGenerator::TermGenerationState::getTermIndex):
3448         (JSC::Yarr::RegexGenerator::TermGenerationState::setParenthesesTail):
3449         (JSC::Yarr::RegexGenerator::TermGenerationState::getParenthesesTail):
3450         (JSC::Yarr::RegexGenerator::ParenthesesTail::ParenthesesTail):
3451         (JSC::Yarr::RegexGenerator::ParenthesesTail::processBacktracks):
3452         (JSC::Yarr::RegexGenerator::ParenthesesTail::generateCode):
3453         (JSC::Yarr::RegexGenerator::generateParenthesesSingle):
3454
3455 2010-12-11  Patrick Gansterer  <paroga@webkit.org>
3456
3457         Reviewed by Darin Adler.
3458
3459         Add an overload to makeString for Vector<char>
3460         https://bugs.webkit.org/show_bug.cgi?id=50123
3461
3462         Also cleanup StringTypeAdapter.
3463
3464         * wtf/text/StringConcatenate.h:
3465
3466 2010-12-10  Siddharth Mathur  <siddharth.mathur@nokia.com>
3467
3468         Reviewed by Eric Seidel.
3469
3470         [Qt] Build fix for Symbian: don't compile POSIX memory management implementation 
3471         https://bugs.webkit.org/show_bug.cgi?id=50707
3472
3473         * wtf/wtf.pri:
3474
3475 2010-12-10  Steve Falkenburg  <sfalken@apple.com>
3476
3477         Windows production build fix.
3478         
3479         Don't stop if react-to-vsprops-changes.py exits with an error,
3480         since this will occur in production builds.
3481
3482         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
3483
3484 2010-12-10  Brian Weinstein  <bweinstein@apple.com>
3485
3486         Reviewed by Adam Roben.
3487
3488         Turn on USE(CROSS_PLATFORM_CONTEXT_MENUS) for Windows.
3489
3490         * wtf/Platform.h:
3491
3492 2010-12-10  Martin Robinson  <mrobinson@igalia.com>
3493
3494         Unreviewed, rolling out r73703.
3495         http://trac.webkit.org/changeset/73703
3496         https://bugs.webkit.org/show_bug.cgi?id=49658
3497
3498         This patch is causing crashes on the GTK+ bots.
3499
3500         * wtf/PlatformRefPtr.h:
3501
3502 2010-12-10  Patrick Gansterer  <paroga@webkit.org>
3503
3504         Reviewed by Eric Seidel.
3505
3506         Cleanup StringWx.cpp
3507         https://bugs.webkit.org/show_bug.cgi?id=50525
3508
3509         Use StringImpl::createUninitialized to avoid memcpy and fix style issues.
3510
3511         * wtf/wx/StringWx.cpp:
3512         (WTF::String::String):
3513
3514 2010-12-10  Carlos Garcia Campos  <cgarcia@igalia.com>
3515
3516         Reviewed by Martin Robinson.
3517
3518         [GTK] Simplify context-menu handling code
3519         https://bugs.webkit.org/show_bug.cgi?id=49658
3520
3521         * wtf/PlatformRefPtr.h:
3522
3523 2010-12-09  Michael Saboff  <msaboff@apple.com>
3524
3525         Reviewed by Gavin Barraclough.
3526
3527         REGRESSION (r73065?): A regex no longer works 
3528         https://bugs.webkit.org/show_bug.cgi?id=50570
3529
3530         Changed the handling of adjacent parentheses backtracks in two ways.
3531         First, only outer most paren backtracks default to back tracking
3532         to the "next character" looping code.  Second, added a jump around 
3533         backtracks that fall through to the next backtrack where the
3534         second backtrack has some greedy processing before the backtracking
3535         from outside the parentheses code.
3536 &nb