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