2010-12-30 Konstantin Tokarev <annulen@yandex.ru>
[WebKit-https.git] / JavaScriptCore / ChangeLog
1 2010-12-30  Konstantin Tokarev  <annulen@yandex.ru>
2
3         Reviewed by David Kilzer.
4
5         [Qt] Don't build wtf/TCSystemAlloc.cpp if --system-malloc option is
6         used
7         https://bugs.webkit.org/show_bug.cgi?id=51672
8
9         * wtf/wtf.pri: Replaced USE_SYSTEM_MALLOC with USE_SYSTEM_MALLOC=1
10
11 2010-12-30  Patrick Gansterer  <paroga@webkit.org>
12
13         Reviewed by Darin Adler.
14
15         Use OS(WINDOWS) instead of COMPILER(MSVC) in FastMalloc.cpp
16         https://bugs.webkit.org/show_bug.cgi?id=51743
17
18         Most of the ifdefs belong to windows and not to the MSVC compiler.
19
20         * wtf/FastMalloc.cpp:
21
22 2010-12-29  Gavin Barraclough  <barraclough@apple.com>
23
24         Reviewed by Sam Weinig.
25
26         Bug 51724 - In strict mode string literals should allow \0, but disallow \8 and \9.
27
28         * parser/Lexer.cpp:
29         (JSC::Lexer::parseString):
30
31 2010-12-29  Helder Correia  <helder@sencha.com>
32
33         Reviewed by Eric Seidel.
34
35         <VT> and <FF> are not valid JSON whitespace characters
36         https://bugs.webkit.org/show_bug.cgi?id=51671
37
38         Vertical Tab and Form Feed are not allowed white spaces by the JSON
39         RFC 4627: http://www.ietf.org/rfc/rfc4627.txt (2. JSON Grammar).
40
41         Tests: ietestcenter/Javascript/15.12.1.1-0-2.html
42                ietestcenter/Javascript/15.12.1.1-0-3.html
43
44         * runtime/LiteralParser.cpp:
45         (JSC::isJSONWhiteSpace):
46         (JSC::LiteralParser::Lexer::lex):
47
48 2010-12-28  Helder Correia  <helder@sencha.com>
49
50         Reviewed by Eric Seidel.
51
52         JSON.stringify must exist as a function taking 3 parameters
53         https://bugs.webkit.org/show_bug.cgi?id=51667
54
55         The reported function length is 1 instead.
56
57         Test: ietestcenter/Javascript/15.12.3-0-2.html
58
59         * runtime/JSONObject.cpp:
60
61 2010-12-28  Helder Correia  <helder@sencha.com>
62
63         Reviewed by Sam Weinig.
64
65         JSON.parse must exist as a function taking 2 parameters
66         https://bugs.webkit.org/show_bug.cgi?id=51666
67
68         Support for revivers was introduced in bug 26591, but the function
69         length has since remained unchanged.
70
71         Test: ietestcenter/Javascript/15.12.2-0-2.html
72
73         * runtime/JSONObject.cpp:
74
75 2010-12-27  Jake Helfert  <jake@jakeonthenet.com>
76
77         Reviewed and reworked by Darin Adler.
78
79         Building WebKit with Visual Studio 2010 fails due
80         to ambiguous assignment operator errors.
81         https://bugs.webkit.org/show_bug.cgi?id=51116
82
83         * wtf/NullPtr.h: Added a HAVE(NULLPTR) definition for use with
84         Platform.h HAVE macro, and included the Visual Studio 2010 compiler
85         as one of the ones that has nullptr.
86         * wtf/NullPtr.cpp: Updated condition to match.
87         
88         * wtf/PassOwnArrayPtr.h: Don't include the operator=(nullptr_t)
89         overload if we are compiling in loose mode and the compiler has
90         nullptr, because assignment of 0 will otherwise encounter
91         ambiguitity with this overload and the overload for loose mode
92         that takes a raw pointer. The conditional can be removed when we
93         get rid of loose mode.
94         * wtf/PassOwnPtr.h: Ditto.
95
96         * wtf/PassRefPtr.h: Don't include the operator=(nullptr_t) overload
97         if the compiler has nullptr, because assignment of 0 would be
98         ambiguous with the overload that takes a raw pointer. The conditional
99         can be removed if we ever decide we no longer need to support
100         assigning 0, but might need a way to catch that usage on older compilers.
101         * wtf/RefPtr.h: Ditto.
102         * wtf/RetainPtr.h: Ditto
103
104         * JavaScriptCore.xcodeproj/project.pbxproj: Added NullPtr.cpp,
105         accidentally omitted when the file was first added.
106
107 2010-12-26  Xan Lopez  <xlopez@igalia.com>
108
109         Reviewed by Eric Seidel.
110
111         [GTK] Add standalone target for JSC
112         https://bugs.webkit.org/show_bug.cgi?id=51607
113
114         * GNUmakefile.am: add convenience target to only build jsc and its
115         dependencies.
116
117 2010-12-24  Patrick Gansterer  <paroga@webkit.org>
118
119         Reviewed by Eric Seidel.
120
121         [WINCE] Add CPU(MIPS) detection
122         https://bugs.webkit.org/show_bug.cgi?id=51342
123
124         WinCE usually defines MIPS and _MIPS_.
125
126         * wtf/Platform.h:
127
128 2010-12-23  Gavin Barraclough  <barraclough@apple.com>
129
130         Reviewed by Sam Weinig.
131
132         Rename RegexCompiler.cpp to RegexPattern.cpp.
133         Implicitly call compileRegex from RegexPattern's constructor.
134
135         * Android.mk:
136         * CMakeLists.txt:
137         * GNUmakefile.am:
138         * JavaScriptCore.gypi:
139         * JavaScriptCore.pro:
140         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
141         * JavaScriptCore.xcodeproj/project.pbxproj:
142         * runtime/RegExp.cpp:
143         (JSC::RegExp::compile):
144         * yarr/RegexCompiler.cpp: Removed.
145         * yarr/RegexCompiler.h: Removed.
146         * yarr/RegexInterpreter.cpp:
147         * yarr/RegexJIT.cpp:
148         * yarr/RegexPattern.cpp: Copied from JavaScriptCore/yarr/RegexCompiler.cpp.
149         (JSC::Yarr::compileRegex):
150         (JSC::Yarr::RegexPattern::RegexPattern):
151         * yarr/RegexPattern.h:
152
153 2010-12-23  Patrick Gansterer  <paroga@webkit.org>
154
155         Unreviewed build fix for WinCE after r74360.
156
157         Move the OS(WINDOWS) section after the OS(WINCE) section
158         and add missing argument to the getStackMax call.
159
160         * wtf/StackBounds.cpp:
161         (WTF::StackBounds::initialize):
162
163 2010-12-22  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
164
165         Unreviewed build fix.
166
167         [Symbian] Make sure OSAllocatorSymbian builds
168
169         This patch only addresses the build problem.
170
171         https://bugs.webkit.org/show_bug.cgi?id=51128 tracks the full
172         (re)implementation of the Symbian allocator.
173
174         * wtf/OSAllocatorSymbian.cpp:
175         (WTF::OSAllocator::reserveUncommitted):
176         (WTF::OSAllocator::reserveAndCommit):
177         (WTF::OSAllocator::commit):
178
179 2010-12-22  Dan Bernstein  <mitz@apple.com>
180
181         Changed WebKitTools to Tools.
182
183         * JavaScriptCore.vcproj/JavaScriptCore.sln:
184
185 2010-12-22  Dan Bernstein  <mitz@apple.com>
186
187         Rubber-stamped by Mark Rowe.
188
189         Changed WebKitTools to Tools in script build phases.
190
191         * JavaScriptCore.xcodeproj/project.pbxproj:
192
193 2010-12-22  Andrei Popescu  <andreip@google.com>
194
195         Unreviewed build fix.
196
197         Fix Chromium Linux shared library build.
198         [Chromium] r74431 broke the Chromium Linux shared library build
199         https://bugs.webkit.org/show_bug.cgi?id=51462
200
201         * JavaScriptCore.gyp/JavaScriptCore.gyp:
202         * JavaScriptCore.gypi:
203
204 2010-12-21  Sheriff Bot  <webkit.review.bot@gmail.com>
205
206         Unreviewed, rolling out r74462.
207         http://trac.webkit.org/changeset/74462
208         https://bugs.webkit.org/show_bug.cgi?id=51449
209
210         broke chromium win (Requested by tonyg-cr on #webkit).
211
212         * JavaScriptCore.gypi:
213
214 2010-12-21  Tony Gentilcore  <tonyg@chromium.org>
215
216         Unreviewed build fix.
217
218         [chromium] Build fix after r74431
219         https://bugs.webkit.org/show_bug.cgi?id=51447
220
221         * JavaScriptCore.gypi:
222
223 2010-12-21  Gavin Barraclough  <barraclough@apple.com>
224
225         Windows build fix.
226
227         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
228
229 2010-12-21  Gavin Barraclough  <barraclough@apple.com>
230
231         Windows build fix.
232
233         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
234
235 2010-12-21  Gavin Barraclough  <barraclough@apple.com>
236
237         Speculative build fix.
238
239         * jit/ExecutableAllocator.cpp:
240         (JSC::ExecutableAllocator::underMemoryPressure):
241
242 2010-12-21  Gavin Barraclough  <barraclough@apple.com>
243
244         Reviewed by Oliver Hunt.
245
246         Bug 26276 - Need a mechanism to determine stack extent
247
248         This patch adds accurate stack size calculation for:
249             DARWIN, QNX, UNIX
250         We still need to fix:
251             WINDOWS, SOLARIS, OPENBSD, SYMBIAN, HAIKU, WINCE
252
253         * wtf/StackBounds.cpp:
254         (WTF::StackBounds::initialize):
255
256 2010-12-21  Gavin Barraclough  <barraclough@apple.com>
257
258          Reviewed by Geoff Garen.
259  
260         <rdar://problem/8765333> CRASH running out of executable memory, loading io9.com
261         https://bugs.webkit.org/show_bug.cgi?id=51443
262
263         The problem here is that each page uses a reasonable amount of memory, (~4Mb),
264         and that when miultiple pages are open we keep all JIT code for all functions
265         in all pages alive.
266
267         Add a check to detect high memory pressure situations in the executable allocator
268         (>50% of available memory allocated), and upon a top level entry into JSC (no code
269         running on the stack) in this situation throw away all JIT code.
270
271         * JavaScriptCore.exp:
272         * debugger/Debugger.cpp:
273         (JSC::Debugger::recompileAllJSFunctions): stop passing exec to recompile.
274         * jit/ExecutableAllocator.h:
275         * jit/ExecutableAllocatorFixedVMPool.cpp:
276         (JSC::ExecutablePool::systemAlloc): Count allocations.
277         (JSC::ExecutablePool::systemRelease): Count deallocations.
278         (JSC::ExecutablePool::underMemoryPressure): Check memory pressure.
279         * jit/ExecutableAllocatorPosix.cpp:
280         (JSC::ExecutablePool::underMemoryPressure): Stub out; only meaningful with FixedVMPool.
281         * jit/ExecutableAllocatorWin.cpp:
282         (JSC::ExecutablePool::underMemoryPressure): Stub out; only meaningful with FixedVMPool.
283         * runtime/Executable.cpp:
284         (JSC::FunctionExecutable::recompile): Remove ExecState argument to recompile.
285         * runtime/Executable.h:
286         * runtime/JSGlobalData.cpp:
287         (JSC::JSGlobalData::recompileAllJSFunctions): throws away all JIT code.
288         * runtime/JSGlobalData.h:
289         * runtime/JSGlobalObject.h:
290         (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope): add check / call to throw away.
291
292 2010-12-21  Gavin Barraclough  <barraclough@apple.com>
293
294         Reviewed by Geoff Garen.
295
296         <rdar://problem/8241425> JIT executable memory excessive usage due to regex caching
297         https://bugs.webkit.org/show_bug.cgi?id=51434
298
299         Reduce the amount of memory the RegExpCache can hold on to on iOS.
300         Currently the RegExpCache can hold 256 RegExp objects. If each falls into a separate
301         ExecutablePool, with a common size of 16Kb, this means we end up holding onto 4Mb of
302         memory. Firstly, we can reduce this by simply reducing the size of the cache to 32
303         entries. Secondly, we can use a separate set of ExecutablePools for JIT code generated
304         from RegExp objects. This helps in two ways (1) it increases the probability that
305         RegExps in the cache share the same pool, and (2) it means that a RegExp can't end
306         up holding on to a large ExecutablePool containing a translation of JS code.
307         (A RegExp could end up keeping a larger RegExp alive that happened to be sharing the
308         same pool, but large RegExp patterns are less common).
309
310         * runtime/JSGlobalData.h:
311         * runtime/RegExpCache.h:
312         * yarr/RegexJIT.cpp:
313         (JSC::Yarr::RegexGenerator::compile):
314
315 2010-12-21  Gavin Barraclough  <barraclough@apple.com>
316
317         Windows build fix.
318
319         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
320
321 2010-12-21  Gavin Barraclough  <barraclough@apple.com>
322
323         Eeeep! build fix!
324
325         * wtf/OSAllocator.h:
326         (WTF::OSAllocator::decommitAndRelease):
327
328 2010-12-21  Gavin Barraclough  <barraclough@apple.com>
329
330         Ooops, fixed typo in comment.
331
332         * wtf/OSAllocator.h:
333
334 2010-12-21  Geoffrey Garen  <ggaren@apple.com>
335
336         Reviewed by Gavin Barraclough & Oliver Hunt.
337
338         Added PageAllocationAligned, a cross-platform abstraction for memory allocations with arbitrary alignment requirements
339         https://bugs.webkit.org/show_bug.cgi?id=51359
340         
341         I think this patch fixes <rdar://problem/8107952> [5.0.1] WER crash in
342         Heap::allocateBlock (1902752929), and some other leaks and crashes as well.
343
344         * Android.mk:
345         * CMakeLists.txt:
346         * GNUmakefile.am:
347         * JavaScriptCore.gypi:
348         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
349         * JavaScriptCore.xcodeproj/project.pbxproj: Updated build files.
350
351         * runtime/AlignedMemoryAllocator.h: Removed. Supplanted by
352         PageAllocationAligned.
353
354         * runtime/Collector.cpp:
355         (JSC::Heap::destroy):
356         (JSC::Heap::allocateBlock):
357         (JSC::Heap::freeBlock):
358         (JSC::Heap::addWeakGCHandle):
359         * runtime/Collector.h: Switched from AlignedMemoryAllocator to
360         PageAllocationAligned.
361
362         * runtime/GCHandle.cpp:
363         * runtime/GCHandle.h: Ditto.
364
365         * wtf/PageAllocation.h:
366         (WTF::PageAllocation::PageAllocation): Removed aligned memory allocation
367         functions. Supplanted by PageAllocationAligned.
368
369         * wtf/PageAllocationAligned.cpp: Added.
370         (WTF::PageAllocationAligned::allocate):
371         (WTF::PageAllocationAligned::deallocate):
372         * wtf/PageAllocationAligned.h: Added.
373         (WTF::PageAllocationAligned::PageAllocationAligned): New cross-platform
374         class for doing aligned memory allocation. This class properly matches
375         allocation and deallocation library calls, fixing a long-standing bug
376         in PageAllocation.
377
378         * wtf/Platform.h: Removed some defunction VM platform defines.
379
380         * wtf/wtf.pri: Updated build files.
381
382 2010-12-21  Oliver Hunt  <oliver@apple.com>
383
384         Reviewed by Gavin Barraclough.
385
386         ASSERTION FAILED: base->index() == m_codeBlock->argumentsRegister() while loading taobao.com
387         https://bugs.webkit.org/show_bug.cgi?id=49006
388
389         This problem was caused by having a parameter named 'arguments'.
390         The fix is to treat parameters named 'arguments' as shadowing
391         the actual arguments property, and so logically turn the function
392         into one that doesn't "use" arguments.
393
394         This required a bit of fiddling in the parser to ensure we correctly
395         propagate the 'feature' of shadowing is set correctly.
396
397         * bytecompiler/BytecodeGenerator.cpp:
398         (JSC::BytecodeGenerator::createArgumentsIfNecessary):
399           Change assertion to an early return as we may now reference
400           a property named 'arguments' without being in a function that
401           has the ArgumentsFeature
402         * parser/JSParser.cpp:
403         (JSC::JSParser::Scope::Scope):
404         (JSC::JSParser::Scope::declareParameter):
405         (JSC::JSParser::Scope::shadowsArguments):
406         (JSC::JSParser::parseProgram):
407         (JSC::JSParser::parseFormalParameters):
408         (JSC::JSParser::parseFunctionInfo):
409         * parser/Nodes.h:
410         (JSC::ScopeNode::usesArguments):
411
412 2010-12-21  Daniel Bates  <dbates@rim.com>
413
414         Reviewed by Eric Seidel and Darin Adler.
415
416         Deallocate GregorianDateTime.timeZone (if allocated) when copying so that we don't leak memory.
417         https://bugs.webkit.org/show_bug.cgi?id=51367
418
419         Inspired by a patch by George Staikos.
420
421         * wtf/DateMath.cpp:
422         (JSC::msToGregorianDateTime): Modified to set timeZone to nullptr since timeZone is now
423         of type OwnPtrArray<char>.
424         * wtf/DateMath.h: Change timeZone to type OwnArrayPtr<char>; Removed destructor since it is no longer needed.
425         (JSC::GregorianDateTime::GregorianDateTime): Modified to use OwnPtrArray semantics for timeZone.
426         (JSC::GregorianDateTime::operator tm): Ditto.
427         (JSC::GregorianDateTime::copyFrom): Ditto.
428
429 2010-12-21  Sheriff Bot  <webkit.review.bot@gmail.com>
430
431         Unreviewed, rolling out r74402.
432         http://trac.webkit.org/changeset/74402
433         https://bugs.webkit.org/show_bug.cgi?id=51402
434
435         This patch broke the Windows 7 Release Layout Tests (Requested
436         by jessieberlin on #webkit).
437
438         * wtf/StackBounds.cpp:
439         (WTF::estimateStackBound):
440         (WTF::StackBounds::initialize):
441
442 2010-12-21  Peter Varga  <pvarga@inf.u-szeged.hu>
443
444         Reviewed by Csaba Osztrogonác.
445
446         Unify the name of parentheses in YARR: rename parenthesis to
447         parentheses.
448
449         * yarr/RegexCompiler.cpp:
450         (JSC::Yarr::RegexPatternConstructor::atomParenthesesEnd):
451
452 2010-12-21  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
453
454         Reviewed by Andreas Kling.
455
456         [Qt] Set BUILDING_QT__ consistently
457         https://bugs.webkit.org/show_bug.cgi?id=51341
458
459         * JavaScriptCore.pri: Remove the definition of BUILDING_QT__ as it
460         is already defined in WebKit.pri.
461
462 2010-12-20  Gavin Barraclough  <barraclough@apple.com>
463
464         Reviewed by Oliver Hunt.
465
466         Bug 26276 - Need a mechanism to determine stack extent
467
468         This patch adds accurate stack size calculation for:
469             DARWIN, WINDOWS, QNX, UNIX
470         We still need to fix:
471             SOLARIS, OPENBSD, SYMBIAN, HAIKU, WINCE
472
473         * wtf/StackBounds.cpp:
474         (WTF::StackBounds::initialize):
475
476 2010-12-20  Gavin Barraclough  <barraclough@apple.com>
477
478         PPC build fix; stop using std::swap on PageAllocation/PageReservation,
479         this was failing on some compilers since the lack of default construction
480         for the m_executable/m_writable fields meant the value being swapped may
481         not have been fully initialized.
482
483         * wtf/PageAllocation.h:
484         (WTF::PageAllocation::deallocate):
485         * wtf/PageBlock.h:
486         * wtf/PageReservation.h:
487         (WTF::PageReservation::deallocate):
488
489 2010-12-20  Oliver Hunt  <oliver@apple.com>
490
491         Reviewed by Geoffrey Garen.
492
493         |delete name| in strict mode code should be an early error
494         https://bugs.webkit.org/show_bug.cgi?id=50431
495
496         Disallow the |delete IDENTIFIER| production in strict mode, and removed
497         a bunch of now unnecessary code.
498
499         * parser/JSParser.cpp:
500         (JSC::JSParser::Scope::collectFreeVariables):
501         (JSC::jsParse):
502         (JSC::JSParser::parseProgram):
503         (JSC::JSParser::parseUnaryExpression):
504         * parser/JSParser.h:
505         * parser/Parser.cpp:
506         (JSC::Parser::parse):
507         * parser/Parser.h:
508         (JSC::Parser::parse):
509
510 2010-12-20  Gavin Barraclough  <barraclough@apple.com>
511
512         Reviewed by Olver Hunt.
513
514         Bug 51358 - Should check stack depth rather than using recursion limits in byte compilation
515
516         The current implementation of recursion limit checking is not safe on smaller stacks.
517         Switch to using a common mechanism, shared with the parser, to check recursion limits.
518
519         Make bytecompiler use StackBounds. Empirical testing shows emitStrcat to have the largest
520         footprint on the stack, at just under 1k on x86-64.  Given this, the default recursion
521         check (requiring 4k of available space to recurse) seems reasonable.
522
523         * bytecompiler/BytecodeGenerator.cpp:
524         (JSC::BytecodeGenerator::BytecodeGenerator):
525         * bytecompiler/BytecodeGenerator.h:
526         (JSC::BytecodeGenerator::emitNode):
527         (JSC::BytecodeGenerator::emitNodeInConditionContext):
528         * bytecompiler/NodesCodegen.cpp:
529         (JSC::BinaryOpNode::emitStrcat):
530
531 2010-12-20  Tony Gentilcore  <tonyg@chromium.org>
532
533         Unreviewed build fix.
534
535         Include pthread to fix chromium mac build (broken by r74360)
536         https://bugs.webkit.org/show_bug.cgi?id=51356
537
538         * wtf/StackBounds.cpp:
539
540 2010-12-20  Xan Lopez  <xlopez@igalia.com>
541
542         Reviewed by Gustavo Noronha.
543
544         * GNUmakefile.am: add missing files.
545
546 2010-12-18  Gavin Barraclough  <barraclough@apple.com>
547
548         Reviewed by Oliver Hunt.
549
550         Bug 26276 - Need a mechanism to determine stack extent
551
552         This patch adds a class 'StackBounds', to hold information about the machine stack.
553         The implementation of this class broadly adheres to the current implmentation of
554         stack limit checking, and as such does not solve the problem of determining stack
555         extent, but gives us a common place to do so.
556
557         Currently two mechanism are provided to determine the stack origin (the point the
558         stack is growing away from). currentThreadStackBase() in Collector provides a
559         more accurate determination of the stack origin, so use this to calculate
560         StackBounds::m_origin; WTFThreadData::approximatedStackStart is less accurate, and
561         as such can be removed.  Cache the StackBounds on WTFThreadData such that they
562         need only be determined once per thread, and for non-API contexts cache this
563         information in JSGlobalData, to save a thread-specific access.
564
565         For the time being retain the estimate of stack size used by JSC's parser
566         (128 * sizeof(void*) * 1024), with a view to replacing this with something more
567         accurate in the near future.
568
569         * parser/JSParser.cpp:
570         (JSC::JSParser::canRecurse):
571         (JSC::JSParser::JSParser):
572             Change to use StackBounds.
573         * runtime/Collector.cpp:
574         (JSC::Heap::registerThread):
575         (JSC::Heap::markCurrentThreadConservativelyInternal):
576             Change to use StackBounds, cached on JSGlobalData.
577         * runtime/JSGlobalData.cpp:
578         (JSC::JSGlobalData::JSGlobalData):
579         * runtime/JSGlobalData.h:
580         (JSC::JSGlobalData::stack):
581             Add a cached copy of StackBounds.
582         * wtf/StackBounds.cpp: Copied from JavaScriptCore/runtime/Collector.cpp.
583         (WTF::estimateStackBound):
584         (WTF::StackBounds::initialize):
585         (WTF::getStackMax):
586             Copy code from Collector.cpp to determine stack origin.
587         * wtf/StackBounds.h: Added.
588         (WTF::StackBounds::StackBounds):
589             No argument constructor; returns a null StackBounds.
590         (WTF::StackBounds::currentThreadStackBounds):
591             Returns a StackBounds object representing the stack limits
592             of the current thread.
593         (WTF::StackBounds::origin):
594             Returns to stack origin (the point the stack is growing away
595             from; the highest extent of the stack on machines where the
596             stack grows downwards.
597         (WTF::StackBounds::recursionLimit):
598             Returns a limit value that is 'a comfortable distance from
599             the end of the stack'. Our concept of this is currently 1 page
600             away from the end, however the default value may be tuned in
601             the future, and clients may override passing a larger delta;
602             should only be called on StackBounds object representing the
603             stack of the thread this method is called on (checked by
604             checkConsistency).
605         (WTF::StackBounds::recursionCheck):
606             Checks whether we are currently 'a comfortable distance from
607             the end of the stack'. Our concept of this is currently 1 page
608             away from the end, however the default value may be tuned in
609             the future, and clients may override passing a larger delta
610             to apply when checking, if they wish to do so. This method
611             should only be called on StackBounds object representing the
612             stack of the thread this method is called on (checked by
613             checkConsistency).
614         (WTF::StackBounds::current):
615             Approximate current stack position. On machines where the stack
616             is growing downwards this is the lowest address that might need
617             conservative collection.
618         (WTF::StackBounds::isGrowingDownward):
619             True for all platforms other than WINCE, which has to check.
620         (WTF::StackBounds::checkConsistency):
621             This is called in methods that shoulds only be operating on a
622             valid set of bounds; as such we expect m_origin != m_bounds
623             (i.e. stack size != zero) - we're really testing that this
624             object is not null (the constructor initializes both fields
625             to zero).  Also checks that current() is within the stack's
626             bounds.
627         * wtf/WTFThreadData.cpp:
628         (WTF::WTFThreadData::WTFThreadData):
629         * wtf/WTFThreadData.h:
630         (WTF::WTFThreadData::stack):
631             Add the StackBounds member variable.
632
633 2010-12-17  Geoffrey Garen  <ggaren@apple.com>
634
635         Reviewed by Sam Weinig.
636
637         Factored common page set management into a new PageBlock base class
638         https://bugs.webkit.org/show_bug.cgi?id=51285
639
640         * Android.mk:
641         * CMakeLists.txt:
642         * GNUmakefile.am:
643         * JavaScriptCore.gypi:
644         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
645         * JavaScriptCore.xcodeproj/project.pbxproj:
646         * interpreter/RegisterFile.h:
647         (JSC::RegisterFile::RegisterFile):
648         * jit/ExecutableAllocator.cpp:
649         (JSC::ExecutableAllocator::intializePageSize):
650         * wtf/PageAllocation.cpp: Removed.
651         * wtf/PageAllocation.h:
652         (WTF::PageAllocation::deallocate):
653         (WTF::PageAllocation::PageAllocation):
654         * wtf/PageReservation.h:
655         (WTF::PageReservation::commit):
656         (WTF::PageReservation::decommit):
657         (WTF::PageReservation::deallocate):
658         (WTF::PageReservation::PageReservation):
659         * wtf/wtf.pri:
660
661 2010-12-17  Michael Saboff  <msaboff@apple.com>
662
663         Reviewed by Oliver Hunt.
664
665         RegExp Jit'ed expression crashes clicking link on yelp.com
666         https://bugs.webkit.org/show_bug.cgi?id=51284
667
668         When transitioning between an non-repeating beginning of line
669         anchored expression and the remaining refactored repeating 
670         expression, we should not clear any residual datalabel in 
671         state's m_backtrack.  It will be resolved and cleared in subsequent
672         code when linkAlternativeBacktracks() is called for the repeating
673         alternative(s).
674
675         * yarr/RegexJIT.cpp:
676         (JSC::Yarr::RegexGenerator::BacktrackDestination::clear):
677         (JSC::Yarr::RegexGenerator::TermGenerationState::clearBacktrack):
678
679 2010-12-17  Dan Bernstein  <mitz@apple.com>
680
681         Rubber-stamped by Mark Rowe.
682
683         Updated for the renaming of WebKitTools to Tools
684
685         * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
686
687 2010-12-17  Ariya Hidayat  <ariya@sencha.com>
688
689         Reviewed by Oliver Hunt.
690
691         [JSC] parseAssignmentExpression should use TreeBuilder::CreatesAST
692         https://bugs.webkit.org/show_bug.cgi?id=51268
693
694         * parser/JSParser.cpp:
695         (JSC::JSParser::parseAssignmentExpression):
696
697 2010-12-17  Geoffrey Garen  <ggaren@apple.com>
698
699         Reviewed by Oliver Hunt.
700
701         Removed RChunk from PageAllocation/PageReservation, since it's now unused.
702         https://bugs.webkit.org/show_bug.cgi?id=51276
703
704         * wtf/PageAllocation.h:
705         (WTF::PageAllocation::PageAllocation):
706         * wtf/PageReservation.h:
707         (WTF::PageReservation::PageReservation):
708
709 2010-12-17  Oliver Hunt  <oliver@apple.com>
710
711         Reviewed by Gavin Barraclough.
712
713         Incorrect encoding of some constants in ARMv7 JIT
714         https://bugs.webkit.org/show_bug.cgi?id=51273
715         <rdar://problem/8650210>
716
717         When using immediate encoding 3 we need to write the byte
718         that holds a duplicated value.
719
720         * assembler/ARMv7Assembler.h:
721         (JSC::ARMThumbImmediate::makeEncodedImm):
722
723 2010-12-16  Evan Martin  <evan@chromium.org>
724
725         Reviewed by Darin Fisher.
726
727         [chromium] useless warnings when building on Windows
728         https://bugs.webkit.org/show_bug.cgi?id=50985
729
730         Disable some compiler warnings that aren't indicative of real problems.
731
732         * JavaScriptCore.gyp/JavaScriptCore.gyp:
733
734 2010-12-16  Pratik Solanki  <psolanki@apple.com>
735
736         Reviewed by Geoffrey Garen.
737
738         https://bugs.webkit.org/show_bug.cgi?id=51166
739         ExecutableAllocator::cacheFlush should call sys_cache_control
740
741         * jit/ExecutableAllocator.h:
742         (JSC::ExecutableAllocator::cacheFlush): Use the more correct and forward looking API -
743         sys_cache_control(kCacheFunctionPrepareForExecution,...).
744
745 2010-12-16  Ariya Hidayat  <ariya@sencha.com>
746
747         Reviewed by Andreas Kling.
748
749         [JSC] Const correctness in ASTBuilder and SyntaxChecker
750         https://bugs.webkit.org/show_bug.cgi?id=51141
751
752         * parser/ASTBuilder.h:
753         (JSC::ASTBuilder::getName):
754         (JSC::ASTBuilder::getType):
755         (JSC::ASTBuilder::isResolve):
756         * parser/SyntaxChecker.h:
757         (JSC::SyntaxChecker::operatorStackPop):
758
759 2010-12-15  Kenneth Russell  <kbr@google.com>
760
761         Reviewed by James Robinson.
762
763         Web Audio API: port FFTFrame to MKL
764         https://bugs.webkit.org/show_bug.cgi?id=50986
765
766         Fixed bug in log2 emulation function provided for Windows port of
767         Web Audio API.
768
769         * wtf/MathExtras.h:
770         (log2):
771
772 2010-12-14  Mark Rowe  <mrowe@apple.com>
773
774         Reviewed by Sam Weinig.
775
776         <http://webkit.org/b/51064> Reproducible crash inside WebCore::MediaPlayerPrivateQTKit::createQTMovie when loading <video>
777
778         * wtf/text/WTFString.h: Prevent String from being implicitly convertable to bool.
779         It was previously implicitly convertible to bool on Mac via operator NSString*,
780         but since that always has a non-zero return value it would give unexpected results.
781
782 2010-12-14  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
783
784         Reviewed by Eric Seidel.
785
786         [Qt] [Symbian] Do not use pkg-config on Symbian as it is not supported
787         https://bugs.webkit.org/show_bug.cgi?id=50231
788
789         Guard CONFIG+=link_pkgconfig with !symbian.
790
791         * jsc.pro:
792
793 2010-12-14  Cameron Zwarich  <zwarich@apple.com>
794
795         Not reviewed.
796
797         Revert accidental change disabling the JIT for most platforms.
798
799         * wtf/Platform.h:
800
801 2010-12-13  Cameron Zwarich  <zwarich@apple.com>
802
803         Reviewed by Eric Seidel.
804
805         Clang fails to build the JSC interpreter
806         https://bugs.webkit.org/show_bug.cgi?id=51016
807
808         Clang does not allow indirect gotos out of scopes with cleanup. GCC 4.2 allows
809         them, but it does not correctly generate the cleanup, causing a leak if the
810         cleanup decrements a reference count.
811
812         * interpreter/Interpreter.cpp:
813         (JSC::Interpreter::privateExecute): Put an Identifier into its own scope.
814
815 2010-12-14  Carlos Garcia Campos  <cgarcia@igalia.com>
816
817         Reviewed by Martin Robinson.
818
819         [GTK] Simplify context-menu handling code
820         https://bugs.webkit.org/show_bug.cgi?id=49658
821
822         * wtf/PlatformRefPtr.h: Add leakRef()
823
824 2010-12-13  Cameron Zwarich  <zwarich@apple.com>
825
826         Reviewed by Gavin Barraclough.
827
828         JavaScriptCore should not use "asm volatile" outside of a function
829         https://bugs.webkit.org/show_bug.cgi?id=50991
830
831         * jit/JITStubs.cpp: Remove the volatile keyword from asm statements.
832
833 2010-12-13  Steve Falkenburg  <sfalken@apple.com>
834
835         Windows production build fix.
836         Try copying ICU 4.6 in addition to 4.4 and 4.2.
837
838         * JavaScriptCore.vcproj/jsc/jscPostBuild.cmd:
839
840 2010-12-13  Michael Saboff  <msaboff@apple.com>
841
842         Reviewed by Oliver Hunt.
843
844         REGRESSION: mobileme mail viewing is broken
845         https://bugs.webkit.org/show_bug.cgi?id=50884
846
847         Fixed problem where simple parenthesis (those without capture and
848         with a fixed count) where not propagating backtrack to labels for 
849         nested parentheses.  Also added the nesting level for the parentheses 
850         state created in that case as well.
851
852         * yarr/RegexJIT.cpp:
853         (JSC::Yarr::RegexGenerator::BacktrackDestination::copyBacktrackToLabel):
854         (JSC::Yarr::RegexGenerator::TermGenerationState::isLastTerm):
855         (JSC::Yarr::RegexGenerator::ParenthesesTail::generateCode):
856         (JSC::Yarr::RegexGenerator::generateParenthesesSingle):
857
858 2010-12-13  Peter Varga  <pvarga@inf.u-szeged.hu>
859
860         Reviewed by Gavin Barraclough.
861
862         Reduce the size of the RegexStackSpaceForBackTrackInfoParentheses in YARR
863         https://bugs.webkit.org/show_bug.cgi?id=49385
864
865         Remove the BackTrackInfoParentheses struct prevBegin and prevEnd members.
866
867         * yarr/RegexInterpreter.cpp:
868         (JSC::Yarr::Interpreter::matchParentheses):
869         (JSC::Yarr::Interpreter::backtrackParentheses):
870         * yarr/RegexPattern.h:
871
872 2010-12-10  Michael Saboff  <msaboff@apple.com>
873
874         Reviewed by Gavin Barraclough.
875
876         REGRESSION Hang inside Yarr::RegexCodeBlock::execute when visiting
877         bugs.webkit.org
878         https://bugs.webkit.org/show_bug.cgi?id=50816
879
880         First nested parentheses of the second or greater alternative
881         where backtracking to the prior parentheses.  Changed the default
882         handling of initial parentheses for all alternatives to go back
883         to the immediate outer paren.
884
885         * yarr/RegexJIT.cpp:
886         (JSC::Yarr::RegexGenerator::GenerationState::addParenthesesTail):
887         (JSC::Yarr::RegexGenerator::TermGenerationState::TermGenerationState):
888         (JSC::Yarr::RegexGenerator::TermGenerationState::isLastTerm):
889         (JSC::Yarr::RegexGenerator::TermGenerationState::getTermIndex):
890         (JSC::Yarr::RegexGenerator::TermGenerationState::setParenthesesTail):
891         (JSC::Yarr::RegexGenerator::TermGenerationState::getParenthesesTail):
892         (JSC::Yarr::RegexGenerator::ParenthesesTail::ParenthesesTail):
893         (JSC::Yarr::RegexGenerator::ParenthesesTail::processBacktracks):
894         (JSC::Yarr::RegexGenerator::ParenthesesTail::generateCode):
895         (JSC::Yarr::RegexGenerator::generateParenthesesSingle):
896
897 2010-12-11  Patrick Gansterer  <paroga@webkit.org>
898
899         Reviewed by Darin Adler.
900
901         Add an overload to makeString for Vector<char>
902         https://bugs.webkit.org/show_bug.cgi?id=50123
903
904         Also cleanup StringTypeAdapter.
905
906         * wtf/text/StringConcatenate.h:
907
908 2010-12-10  Siddharth Mathur  <siddharth.mathur@nokia.com>
909
910         Reviewed by Eric Seidel.
911
912         [Qt] Build fix for Symbian: don't compile POSIX memory management implementation 
913         https://bugs.webkit.org/show_bug.cgi?id=50707
914
915         * wtf/wtf.pri:
916
917 2010-12-10  Steve Falkenburg  <sfalken@apple.com>
918
919         Windows production build fix.
920         
921         Don't stop if react-to-vsprops-changes.py exits with an error,
922         since this will occur in production builds.
923
924         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
925
926 2010-12-10  Brian Weinstein  <bweinstein@apple.com>
927
928         Reviewed by Adam Roben.
929
930         Turn on USE(CROSS_PLATFORM_CONTEXT_MENUS) for Windows.
931
932         * wtf/Platform.h:
933
934 2010-12-10  Martin Robinson  <mrobinson@igalia.com>
935
936         Unreviewed, rolling out r73703.
937         http://trac.webkit.org/changeset/73703
938         https://bugs.webkit.org/show_bug.cgi?id=49658
939
940         This patch is causing crashes on the GTK+ bots.
941
942         * wtf/PlatformRefPtr.h:
943
944 2010-12-10  Patrick Gansterer  <paroga@webkit.org>
945
946         Reviewed by Eric Seidel.
947
948         Cleanup StringWx.cpp
949         https://bugs.webkit.org/show_bug.cgi?id=50525
950
951         Use StringImpl::createUninitialized to avoid memcpy and fix style issues.
952
953         * wtf/wx/StringWx.cpp:
954         (WTF::String::String):
955
956 2010-12-10  Carlos Garcia Campos  <cgarcia@igalia.com>
957
958         Reviewed by Martin Robinson.
959
960         [GTK] Simplify context-menu handling code
961         https://bugs.webkit.org/show_bug.cgi?id=49658
962
963         * wtf/PlatformRefPtr.h:
964
965 2010-12-09  Michael Saboff  <msaboff@apple.com>
966
967         Reviewed by Gavin Barraclough.
968
969         REGRESSION (r73065?): A regex no longer works 
970         https://bugs.webkit.org/show_bug.cgi?id=50570
971
972         Changed the handling of adjacent parentheses backtracks in two ways.
973         First, only outer most paren backtracks default to back tracking
974         to the "next character" looping code.  Second, added a jump around 
975         backtracks that fall through to the next backtrack where the
976         second backtrack has some greedy processing before the backtracking
977         from outside the parentheses code.
978         Also cleaned up extraneous white spce, removing white space at the
979         end of or that makes up a whole line.
980
981         * yarr/RegexJIT.cpp:
982         (JSC::Yarr::RegexGenerator::GenerationState::GenerationState):
983         (JSC::Yarr::RegexGenerator::GenerationState::incrementParenNestingLevel):
984         (JSC::Yarr::RegexGenerator::GenerationState::decrementParenNestingLevel):
985         (JSC::Yarr::RegexGenerator::GenerationState::addParenthesesTail):
986         (JSC::Yarr::RegexGenerator::GenerationState::emitParenthesesTail):
987         (JSC::Yarr::RegexGenerator::ParenthesesTail::ParenthesesTail):
988         (JSC::Yarr::RegexGenerator::ParenthesesTail::setNextIteration):
989         (JSC::Yarr::RegexGenerator::ParenthesesTail::generateCode):
990         (JSC::Yarr::RegexGenerator::generateParenthesesSingle):
991
992 2010-12-09  Michael Saboff  <msaboff@apple.com>
993
994         Reviewed by Geoffrey Garen.
995
996         Addressed the "FIXME" issues in array sort for toString() methods that
997         mutate the array in either size or contents.  The change is to mark
998         the temporary array contents so that they are not garbage collected
999         and to make sure the array is large enough to hold the contents
1000         of the sorted temporary vector.
1001         https://bugs.webkit.org/show_bug.cgi?id=50718
1002
1003         * runtime/Collector.cpp:
1004         (JSC::Heap::addTempSortVector):
1005         (JSC::Heap::removeTempSortVector):
1006         (JSC::Heap::markTempSortVectors):
1007         (JSC::Heap::markRoots):
1008         * runtime/Collector.h:
1009         * runtime/JSArray.cpp:
1010         (JSC::JSArray::sort):
1011         * runtime/JSValue.h:
1012
1013 2010-12-09  Michael Saboff  <msaboff@apple.com>
1014
1015         Reviewed by Darin Adler.
1016
1017         Changed setting of backtrack labels to not overwrite a prior
1018         label.  Where losing prior labe which then reverted back to 
1019         next character label.
1020         https://bugs.webkit.org/show_bug.cgi?id=50579
1021
1022         * yarr/RegexJIT.cpp:
1023         (JSC::Yarr::RegexGenerator::BacktrackDestination::setBacktrackToLabel):
1024
1025 2010-12-08  Gavin Barraclough  <barraclough@apple.com>
1026
1027         Reviewed by Sam Weinig.
1028
1029         Permit Character Class Escape in CharacterRange in Character Class.
1030         https://bugs.webkit.org/show_bug.cgi?id=50483
1031         https://bugs.webkit.org/show_bug.cgi?id=50538
1032         https://bugs.webkit.org/show_bug.cgi?id=50654
1033         https://bugs.webkit.org/show_bug.cgi?id=50646
1034
1035         We recently tightened up our spec conformance in generating syntax
1036         error in these cases, however testing in the wild has shown this
1037         to be problematic. This reverts the previous change in allowing
1038         class escapes (e.g. \d) in ranges in character classes ([]), but
1039         does retain some closer conformance to the spec in only allowing
1040         ranges that would be permitted per the grammar rules in the spec
1041         (e.g. in /[\d-a-z]/ "a-z" cannot be considered as a range).
1042
1043         * yarr/RegexParser.h:
1044         (JSC::Yarr::Parser::CharacterClassParserDelegate::atomPatternCharacter):
1045         (JSC::Yarr::Parser::CharacterClassParserDelegate::atomBuiltInCharacterClass):
1046         (JSC::Yarr::Parser::parse):
1047
1048 2010-12-08  Geoffrey Garen  <ggaren@apple.com>
1049
1050         Reviewed by Sam Weinig.
1051
1052         Try to fix crash-on-launch seen on Windows builder.
1053
1054         * wtf/OSAllocatorWin.cpp:
1055         (WTF::OSAllocator::release): Disabled an ASSERT, because it checks for
1056         a bug that hasn't been fixed yet.
1057
1058 2010-12-08  Geoffrey Garen  <ggaren@apple.com>
1059
1060         Try to fix Windows build.
1061
1062         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Updated .def file.
1063
1064 2010-12-08  Geoffrey Garen  <ggaren@apple.com>
1065
1066         Try to fix Windows build.
1067
1068         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Updated .def
1069         file to remove a symbol -- the next build failure will say which symbol
1070         to add back.
1071
1072 2010-12-08  Geoffrey Garen  <ggaren@apple.com>
1073
1074         Try to fix Windows build.
1075
1076         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Updated .def file.
1077
1078 2010-12-08  Geoffrey Garen  <ggaren@apple.com>
1079
1080         Try to fix GTK Linux build.
1081
1082         * jit/ExecutableAllocator.cpp:
1083         (JSC::ExecutablePool::systemAlloc):
1084         * runtime/AlignedMemoryAllocator.h:
1085         (JSC::::AlignedMemoryAllocator): Updated for Usage enum moving to OSAllocator.
1086
1087 2010-12-07  Geoffrey Garen  <ggaren@apple.com>
1088
1089         Reviewed by Sam Weinig.
1090
1091         Migrated OS-specific allocation code from PageReservation and PageAllocation to OSAllocator
1092         https://bugs.webkit.org/show_bug.cgi?id=50653
1093
1094         * JavaScriptCore.exp: Updated for new function signature.
1095
1096         * interpreter/RegisterFile.h:
1097         (JSC::RegisterFile::RegisterFile):
1098         (JSC::RegisterFile::grow):
1099         * jit/ExecutableAllocatorFixedVMPool.cpp:
1100         (JSC::FixedVMPoolAllocator::reuse):
1101         (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator): Removed checkAllocatedOkay.
1102         OSAllocator is now the central location for verifying that allocation succeeds.
1103         This allowed me to remove some complicating cross-platform cruft.
1104
1105         * runtime/AlignedMemoryAllocator.h:
1106         (JSC::::allocate): Updated for code motion.
1107
1108         * wtf/OSAllocator.h: Added Usage, writable, and executable parameters, to
1109         support VM features required by clients of PageAllocation and PageReservation.
1110
1111         * wtf/OSAllocatorPosix.cpp:
1112         (WTF::OSAllocator::reserve):
1113         (WTF::OSAllocator::reserveAndCommit):
1114         (WTF::OSAllocator::commit): Moved PageAllocation support for randomizing
1115         executable memory here.
1116
1117         * wtf/OSAllocatorSymbian.cpp:
1118         (WTF::OSAllocator::reserve):
1119         (WTF::OSAllocator::reserveAndCommit):
1120         (WTF::OSAllocator::commit): Updated for new function signatures.
1121
1122         * wtf/OSAllocatorWin.cpp:
1123         (WTF::protection):
1124         (WTF::OSAllocator::reserve):
1125         (WTF::OSAllocator::reserveAndCommit):
1126         (WTF::OSAllocator::commit):
1127         (WTF::OSAllocator::release): Updated for new function signatures. Moved
1128         some protection-related and WINCE-related code from PageAllocation here.
1129
1130         * wtf/PageAllocation.cpp: Nixed cross-platform lastError abstraction, since
1131         it was only used by checkAllocatedOkay, which is now gone.
1132
1133         * wtf/PageAllocation.h:
1134         (WTF::PageAllocation::allocate):
1135         (WTF::PageAllocation::allocateAligned):
1136         (WTF::PageAllocation::deallocate):
1137         (WTF::PageAllocation::isPowerOfTwo):
1138         (WTF::PageAllocation::systemAllocateAligned): Removed system* functions,
1139         and replaced calls to them with calls to OSAllocator.
1140
1141         * wtf/PageReservation.h:
1142         (WTF::PageReservation::commit):
1143         (WTF::PageReservation::decommit):
1144         (WTF::PageReservation::reserve):
1145         (WTF::PageReservation::deallocate):
1146         (WTF::PageReservation::PageReservation): Ditto. Added m_writable and
1147         m_executable because these flags are now required when committing memory.
1148
1149 2010-12-08  Chris Rogers  <crogers@google.com>
1150
1151         Reviewed by Kenneth Russell.
1152
1153         Add web audio files to mac port Xcode projects
1154         https://bugs.webkit.org/show_bug.cgi?id=50721
1155
1156         * JavaScriptCore.xcodeproj/project.pbxproj:
1157
1158 2010-12-08  Oliver Hunt  <oliver@apple.com>
1159
1160         Reviewed by Gavin Barraclough.
1161
1162         Marking the active global object re-enters through markConservatively
1163         https://bugs.webkit.org/show_bug.cgi?id=50711
1164
1165         draining of the MarkStack is not allowed to be re-entrant, we got away
1166         with this simply due to the logic in MarkStack::drain implicitly handling
1167         changes that could be triggered by the re-entry.
1168
1169         Just to be safe this patch removes the re-entry through markConservatively
1170         so we don't accidentally introduce such an issue in future.  I've also
1171         added an assertion to catch such errors.
1172
1173         * runtime/Collector.cpp:
1174         (JSC::Heap::markConservatively):
1175         (JSC::Heap::markCurrentThreadConservativelyInternal):
1176         (JSC::Heap::markOtherThreadConservatively):
1177         * runtime/JSArray.h:
1178         (JSC::MarkStack::drain):
1179         * runtime/MarkStack.h:
1180         (JSC::MarkStack::MarkStack):
1181
1182 2010-12-08  Chris Marrin  <cmarrin@apple.com>
1183
1184         Reviewed by Simon Fraser.
1185
1186         Share code between Mac (CA) and Windows (CACF) GraphicsLayer implementations
1187         https://bugs.webkit.org/show_bug.cgi?id=49388
1188
1189         Added a WTF_PLATFORM_CA flag. Set when platform is MAC or IOS or (WINDOWS AND CG)
1190         which was decided was the best way to identify a build with CoreAnimation
1191
1192         * wtf/Platform.h:
1193
1194 2010-12-07  Anders Carlsson  <andersca@apple.com>
1195
1196         Build fix follow up build fix.
1197
1198         * pcre/pcre_ucp_searchfuncs.cpp:
1199         (jsc_pcre_ucp_othercase):
1200
1201 2010-12-07  Anders Carlsson  <andersca@apple.com>
1202
1203         Reviewed by Darin Adler.
1204
1205         Fix clang++ build
1206         https://bugs.webkit.org/show_bug.cgi?id=50645
1207
1208         Explicitly cast offset to int.
1209
1210         * pcre/pcre_ucp_searchfuncs.cpp:
1211         (jsc_pcre_ucp_othercase):
1212
1213 2010-12-07  Kenneth Russell  <kbr@google.com>
1214
1215         Reviewed by David Levin.
1216
1217         Fix compilation of core web audio files on Windows
1218         https://bugs.webkit.org/show_bug.cgi?id=50603
1219
1220         Added log2 definition to MathExtras.h on Windows platform.
1221
1222         * wtf/MathExtras.h:
1223         (log2):
1224
1225 2010-12-07  Antti Koivisto  <antti@apple.com>
1226
1227         Reviewed by Gavin Barraclough.
1228
1229         https://bugs.webkit.org/show_bug.cgi?id=50412
1230         http://www.wunderground.com/US/CA/Hayward.html causes big memory spike during page loading 
1231         
1232         Creating a substring caused the original string be flattened if it was in the rope form. This could use
1233         significant amount of memory by reducing buffer sharing between strings.
1234         
1235         Add a rope specific substring function that constructs the substring by reusing the rope fibers
1236         instead of flattening the rope.
1237         
1238         No change observed in SunSpider.
1239
1240         * runtime/JSString.cpp:
1241         (JSC::JSString::substringFromRope):
1242         * runtime/JSString.h:
1243         (JSC::jsSubstring):
1244         * runtime/StringPrototype.cpp:
1245         (JSC::stringProtoFuncSubstr):
1246         (JSC::stringProtoFuncSubstring):
1247
1248 2010-12-06  Geoffrey Garen  <ggaren@apple.com>
1249
1250         Reviewed by Gavin Barraclough.
1251
1252         Simplified some ASLR-related code in PageAllocation/Reservation
1253         https://bugs.webkit.org/show_bug.cgi?id=50599
1254         
1255         Removed reserveAt, allocateAt, and friends, since they all existed to
1256         serve one feature: ASLR for executable memory on x86_64 on Mac. Moved
1257         ASLR code down into systemAllocate -- now, any time you allocate
1258         executable memory on a supporting platform, the memory's location is
1259         randomized.
1260
1261         * jit/ExecutableAllocatorFixedVMPool.cpp:
1262         (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator): No need for the caller
1263         to randomize anything.
1264
1265         * wtf/PageAllocation.h:
1266         (WTF::PageAllocation::systemAllocate): Removed some *At() functions, and
1267         beefed up executable allocation with randomization.
1268
1269         * wtf/PageReservation.h:
1270         (WTF::PageReservation::systemReserve): Removed some *At() functions.
1271
1272 2010-12-06  Geoffrey Garen  <ggaren@apple.com>
1273
1274         Reviewed by Maciej Stachowiak.
1275
1276         reserveAndCommit doesn't commit on MADVISE_FREE_REUSE systems
1277         https://bugs.webkit.org/show_bug.cgi?id=50588
1278         
1279         * wtf/OSAllocatorPosix.cpp:
1280         (WTF::OSAllocator::reserve):
1281         (WTF::OSAllocator::reserveAndCommit):
1282         (WTF::OSAllocator::commit): Tightened up some comments. Changed
1283         reserveAndCommit to actually commit on MADVISE_FREE_REUSE systems.
1284
1285 2010-12-06  Patrick Gansterer  <paroga@webkit.org>
1286
1287         Reviewed by Andreas Kling.
1288
1289         [WINCE] Add build system
1290         https://bugs.webkit.org/show_bug.cgi?id=50522
1291
1292         * CMakeListsWinCE.txt: Added.
1293         * shell/CMakeListsWinCE.txt: Added.
1294         * wtf/CMakeListsWinCE.txt: Added.
1295
1296 2010-12-06  John Tantalo  <john.tantalo@gmail.com>
1297
1298         Reviewed by Geoffrey Garen.
1299
1300         jsc does not ignore shebang
1301         https://bugs.webkit.org/show_bug.cgi?id=49576
1302
1303         * jsc.cpp:
1304         (fillBufferWithContentsOfFile):
1305           - translate shebang into a valid JavaScript comment so the lexer ignores it
1306
1307 2010-12-05  Adam Roben  <aroben@apple.com>
1308
1309         Windows production build fix
1310
1311         Put spaces after trailing backslashes when setting
1312         %WebKitVSPropsRedirectionDir%. According to MSDN
1313         <http://msdn.microsoft.com/en-us/library/2kzfk8c7(v=VS.80).aspx>:
1314
1315            A backslash ( \ ) followed by a newline character is interpreted as
1316            a space in the command; use a backslash at the end of a line to
1317            continue a command onto the next line. NMAKE interprets the
1318            backslash literally if any other character, including a space or
1319            tab, follows the backslash.
1320
1321         * JavaScriptCore.vcproj/JavaScriptCore.make:
1322
1323 2010-12-04  Patrick Gansterer  <paroga@webkit.org>
1324
1325         Unreviewed, build fix after r69132.
1326
1327         * shell/CMakeLists.txt: Fix directory name (jsc -> shell).
1328
1329 2010-12-04  Xan Lopez  <xlopez@igalia.com>
1330
1331         Reviewed by Martin Robinson.
1332
1333         [GTK] Drop GdkDrawable usage, it's deprecated in GTK+3.x and we can use GdkWindow
1334         https://bugs.webkit.org/show_bug.cgi?id=50451
1335
1336         * wtf/gobject/GTypedefs.h: add GdkWindow defines.
1337
1338 2010-12-03  Gavin Barraclough  <barraclough@apple.com>
1339
1340         Rubber stamped by Oliver Hunt.
1341
1342         Bug 50509 - set* methods on MacroAssembler are awfully named.
1343
1344         Methods set32 and setTest32 compare 32-bit operands, and set a 32-bit results based on the comparison.
1345         set8 compares 32-bit operands, and sets an 8-bit result based on the comparison.
1346         setTest8 compares 8-bit operands, and sets a 32-bit result based on the comparison.
1347
1348         Rename to clarify.
1349
1350         set32 -> set32Compare32
1351         setTest32 -> set32Test32
1352         set8 -> set8Compare32
1353         setTest8 -> set32Test8
1354
1355         * assembler/MacroAssembler.h:
1356         (JSC::MacroAssembler::setPtr):
1357         * assembler/MacroAssemblerARM.h:
1358         (JSC::MacroAssemblerARM::set32Compare32):
1359         (JSC::MacroAssemblerARM::set8Compare32):
1360         (JSC::MacroAssemblerARM::set32Test32):
1361         (JSC::MacroAssemblerARM::set32Test8):
1362         * assembler/MacroAssemblerARMv7.h:
1363         (JSC::MacroAssemblerARMv7::set32Compare32):
1364         (JSC::MacroAssemblerARMv7::set8Compare32):
1365         (JSC::MacroAssemblerARMv7::set32Test32):
1366         (JSC::MacroAssemblerARMv7::set32Test8):
1367         * assembler/MacroAssemblerMIPS.h:
1368         (JSC::MacroAssemblerMIPS::set8Compare32):
1369         (JSC::MacroAssemblerMIPS::set32Compare32):
1370         (JSC::MacroAssemblerMIPS::set32Test8):
1371         (JSC::MacroAssemblerMIPS::set32Test32):
1372         * assembler/MacroAssemblerX86Common.h:
1373         (JSC::MacroAssemblerX86Common::set8Compare32):
1374         (JSC::MacroAssemblerX86Common::set32Compare32):
1375         (JSC::MacroAssemblerX86Common::set32Test8):
1376         (JSC::MacroAssemblerX86Common::set32Test32):
1377         * jit/JITOpcodes.cpp:
1378         (JSC::JIT::emit_op_eq):
1379         (JSC::JIT::emit_op_neq):
1380         (JSC::JIT::compileOpStrictEq):
1381         (JSC::JIT::emit_op_eq_null):
1382         (JSC::JIT::emit_op_neq_null):
1383         * jit/JITOpcodes32_64.cpp:
1384         (JSC::JIT::emit_op_eq):
1385         (JSC::JIT::emit_op_neq):
1386         (JSC::JIT::compileOpStrictEq):
1387         (JSC::JIT::emit_op_eq_null):
1388         (JSC::JIT::emit_op_neq_null):
1389
1390 2010-12-03  Oliver Hunt  <oliver@apple.com>
1391
1392         Reviewed by Geoff Garen.
1393
1394         Incorrect logic for returning memory at the end of linking.
1395         Reviewed by Geoff Garen.
1396
1397         At the end of linking we return any space at the end of the
1398         allocated executable region that was saved due to branch
1399         compaction.  This is currently by done by subtracting the
1400         different from the m_freePtr in the allocation pool.  This
1401         can be incorrect if your allocation was made from a new
1402         page that was not selected for subsequent allocations.
1403
1404         This patch corrects this behaviour by verifying that the
1405         memory being returned actually comes from the current
1406         allocation pool.
1407
1408         * assembler/LinkBuffer.h:
1409         (JSC::LinkBuffer::linkCode):
1410         * jit/ExecutableAllocator.h:
1411         (JSC::ExecutablePool::tryShrink):
1412
1413 2010-12-03  Michael Saboff  <msaboff@apple.com>
1414
1415         Reviewed by Gavin Barraclough
1416
1417         Changes to significantly reduce branches to branches in JIT'ed
1418         parentheses backtrack processing.  The changes include the following:
1419         - Taking the backtracking processing out of line and adding it as
1420           code at the end of the JIT'ed routine.
1421         - Allow backtracks to be direct via an indirect branch for an address
1422           pushed onto the stack.  If the use of an indirect branch is from a
1423           conditional jump, then we emit a trampoline at the end of the 
1424           routine.
1425         - Propogate backtracks instead of adding trampolines.  Backtracks are
1426           propogated to where they are used.  This change also eliminated 
1427           trampoline branch code that aren't used.
1428         - Added global expression state to keep track of parentheses tail
1429           code and indirect branches.
1430         Other changes made to support these changes.
1431         - Split invertOrCapture flag on Patterns to two separate flags.  Added
1432           getters for these flags.  Rippled these changes to both the JIT 
1433           and interpreter code.
1434         - Split BacktrackDestination out off TermGenerationState struct.
1435           This is done to hold references to a backtrack for later code
1436           generation.
1437         https://bugs.webkit.org/show_bug.cgi?id=50295
1438
1439         * assembler/ARMAssembler.h:
1440         (JSC::ARMAssembler::JmpDst::isSet):
1441         * assembler/ARMv7Assembler.h:
1442         (JSC::ARMv7Assembler::JmpDst::isSet):
1443         * assembler/AbstractMacroAssembler.h:
1444         (JSC::AbstractMacroAssembler::Label::isSet):
1445         (JSC::AbstractMacroAssembler::DataLabelPtr::isUsed):
1446         (JSC::AbstractMacroAssembler::DataLabelPtr::used):
1447         (JSC::AbstractMacroAssembler::JumpList::clear):
1448         * assembler/MIPSAssembler.h:
1449         (JSC::MIPSAssembler::JmpDst::isSet):
1450         * assembler/X86Assembler.h:
1451         (JSC::X86Assembler::JmpDst::isSet):
1452         * yarr/RegexCompiler.cpp:
1453         (JSC::Yarr::RegexPatternConstructor::atomParenthesesSubpatternBegin):
1454         (JSC::Yarr::RegexPatternConstructor::atomParentheticalAssertionBegin):
1455         (JSC::Yarr::RegexPatternConstructor::atomBackReference):
1456         (JSC::Yarr::RegexPatternConstructor::setupAlternativeBeginTerms):
1457         * yarr/RegexInterpreter.cpp:
1458         (JSC::Yarr::ByteCompiler::atomParenthesesOnceBegin):
1459         (JSC::Yarr::ByteCompiler::atomParenthesesTerminalBegin):
1460         (JSC::Yarr::ByteCompiler::atomParenthesesSubpatternBegin):
1461         (JSC::Yarr::ByteCompiler::atomParentheticalAssertionBegin):
1462         (JSC::Yarr::ByteCompiler::atomParentheticalAssertionEnd):
1463         (JSC::Yarr::ByteCompiler::atomParenthesesSubpatternEnd):
1464         (JSC::Yarr::ByteCompiler::atomParenthesesOnceEnd):
1465         (JSC::Yarr::ByteCompiler::atomParenthesesTerminalEnd):
1466         (JSC::Yarr::ByteCompiler::emitDisjunction):
1467         * yarr/RegexInterpreter.h:
1468         (JSC::Yarr::ByteTerm::ByteTerm):
1469         (JSC::Yarr::ByteTerm::BackReference):
1470         (JSC::Yarr::ByteTerm::invert):
1471         (JSC::Yarr::ByteTerm::capture):
1472         * yarr/RegexJIT.cpp:
1473         (JSC::Yarr::RegexGenerator::IndirectJumpEntry::IndirectJumpEntry):
1474         (JSC::Yarr::RegexGenerator::IndirectJumpEntry::addJump):
1475         (JSC::Yarr::RegexGenerator::GenerationState::GenerationState):
1476         (JSC::Yarr::RegexGenerator::GenerationState::addIndirectJumpEntry):
1477         (JSC::Yarr::RegexGenerator::GenerationState::emitIndirectJumpTable):
1478         (JSC::Yarr::RegexGenerator::GenerationState::addParenthesesTail):
1479         (JSC::Yarr::RegexGenerator::GenerationState::emitParenthesesTail):
1480         (JSC::Yarr::RegexGenerator::GenerationState::addJumpToNextInteration):
1481         (JSC::Yarr::RegexGenerator::GenerationState::addJumpsToNextInteration):
1482         (JSC::Yarr::RegexGenerator::GenerationState::addDataLabelToNextIteration):
1483         (JSC::Yarr::RegexGenerator::GenerationState::linkToNextIteration):
1484         (JSC::Yarr::RegexGenerator::BacktrackDestination::BacktrackDestination):
1485         (JSC::Yarr::RegexGenerator::BacktrackDestination::clear):
1486         (JSC::Yarr::RegexGenerator::BacktrackDestination::clearDataLabel):
1487         (JSC::Yarr::RegexGenerator::BacktrackDestination::haveDestination):
1488         (JSC::Yarr::RegexGenerator::BacktrackDestination::isStackOffset):
1489         (JSC::Yarr::RegexGenerator::BacktrackDestination::isLabel):
1490         (JSC::Yarr::RegexGenerator::BacktrackDestination::isJumpList):
1491         (JSC::Yarr::RegexGenerator::BacktrackDestination::haveDataLabel):
1492         (JSC::Yarr::RegexGenerator::BacktrackDestination::copyTarget):
1493         (JSC::Yarr::RegexGenerator::BacktrackDestination::copyTo):
1494         (JSC::Yarr::RegexGenerator::BacktrackDestination::addBacktrackJump):
1495         (JSC::Yarr::RegexGenerator::BacktrackDestination::setStackOffset):
1496         (JSC::Yarr::RegexGenerator::BacktrackDestination::setLabel):
1497         (JSC::Yarr::RegexGenerator::BacktrackDestination::setNextBacktrackLabel):
1498         (JSC::Yarr::RegexGenerator::BacktrackDestination::setBacktrackToLabel):
1499         (JSC::Yarr::RegexGenerator::BacktrackDestination::setBacktrackJumpList):
1500         (JSC::Yarr::RegexGenerator::BacktrackDestination::setBacktrackSourceLabel):
1501         (JSC::Yarr::RegexGenerator::BacktrackDestination::setDataLabel):
1502         (JSC::Yarr::RegexGenerator::BacktrackDestination::setSubDataLabelPtr):
1503         (JSC::Yarr::RegexGenerator::BacktrackDestination::linkToNextBacktrack):
1504         (JSC::Yarr::RegexGenerator::BacktrackDestination::getStackOffset):
1505         (JSC::Yarr::RegexGenerator::BacktrackDestination::getLabel):
1506         (JSC::Yarr::RegexGenerator::BacktrackDestination::getBacktrackJumps):
1507         (JSC::Yarr::RegexGenerator::BacktrackDestination::getDataLabel):
1508         (JSC::Yarr::RegexGenerator::BacktrackDestination::jumpToBacktrack):
1509         (JSC::Yarr::RegexGenerator::BacktrackDestination::linkDataLabelToHereIfExists):
1510         (JSC::Yarr::RegexGenerator::BacktrackDestination::plantJumpToBacktrackIfExists):
1511         (JSC::Yarr::RegexGenerator::BacktrackDestination::linkAlternativeBacktracks):
1512         (JSC::Yarr::RegexGenerator::BacktrackDestination::linkAlternativeBacktracksTo):
1513         (JSC::Yarr::RegexGenerator::TermGenerationState::TermGenerationState):
1514         (JSC::Yarr::RegexGenerator::TermGenerationState::resetAlternative):
1515         (JSC::Yarr::RegexGenerator::TermGenerationState::isLastAlternative):
1516         (JSC::Yarr::RegexGenerator::TermGenerationState::clearBacktrack):
1517         (JSC::Yarr::RegexGenerator::TermGenerationState::jumpToBacktrack):
1518         (JSC::Yarr::RegexGenerator::TermGenerationState::plantJumpToBacktrackIfExists):
1519         (JSC::Yarr::RegexGenerator::TermGenerationState::linkDataLabelToBacktrackIfExists):
1520         (JSC::Yarr::RegexGenerator::TermGenerationState::addBacktrackJump):
1521         (JSC::Yarr::RegexGenerator::TermGenerationState::setDataLabelPtr):
1522         (JSC::Yarr::RegexGenerator::TermGenerationState::setBackTrackStackOffset):
1523         (JSC::Yarr::RegexGenerator::TermGenerationState::setBacktrackLabel):
1524         (JSC::Yarr::RegexGenerator::TermGenerationState::linkAlternativeBacktracks):
1525         (JSC::Yarr::RegexGenerator::TermGenerationState::linkAlternativeBacktracksTo):
1526         (JSC::Yarr::RegexGenerator::TermGenerationState::setBacktrackLink):
1527         (JSC::Yarr::RegexGenerator::TermGenerationState::chainBacktracks):
1528         (JSC::Yarr::RegexGenerator::TermGenerationState::chainBacktrackJumps):
1529         (JSC::Yarr::RegexGenerator::TermGenerationState::getBacktrackDestination):
1530         (JSC::Yarr::RegexGenerator::TermGenerationState::propagateBacktrackingFrom):
1531         (JSC::Yarr::RegexGenerator::ParenthesesTail::ParenthesesTail):
1532         (JSC::Yarr::RegexGenerator::ParenthesesTail::processBacktracks):
1533         (JSC::Yarr::RegexGenerator::ParenthesesTail::setNextIteration):
1534         (JSC::Yarr::RegexGenerator::ParenthesesTail::generateCode):
1535         (JSC::Yarr::RegexGenerator::generateAssertionBOL):
1536         (JSC::Yarr::RegexGenerator::generateAssertionEOL):
1537         (JSC::Yarr::RegexGenerator::generateAssertionWordBoundary):
1538         (JSC::Yarr::RegexGenerator::generatePatternCharacterSingle):
1539         (JSC::Yarr::RegexGenerator::generatePatternCharacterPair):
1540         (JSC::Yarr::RegexGenerator::generatePatternCharacterFixed):
1541         (JSC::Yarr::RegexGenerator::generatePatternCharacterGreedy):
1542         (JSC::Yarr::RegexGenerator::generatePatternCharacterNonGreedy):
1543         (JSC::Yarr::RegexGenerator::generateCharacterClassSingle):
1544         (JSC::Yarr::RegexGenerator::generateCharacterClassFixed):
1545         (JSC::Yarr::RegexGenerator::generateCharacterClassGreedy):
1546         (JSC::Yarr::RegexGenerator::generateCharacterClassNonGreedy):
1547         (JSC::Yarr::RegexGenerator::generateParenthesesDisjunction):
1548         (JSC::Yarr::RegexGenerator::generateParenthesesSingle):
1549         (JSC::Yarr::RegexGenerator::generateParenthesesGreedyNoBacktrack):
1550         (JSC::Yarr::RegexGenerator::generateParentheticalAssertion):
1551         (JSC::Yarr::RegexGenerator::generateDisjunction):
1552         (JSC::Yarr::RegexGenerator::compile):
1553         * yarr/RegexPattern.h:
1554         (JSC::Yarr::PatternTerm::PatternTerm):
1555         (JSC::Yarr::PatternTerm::invert):
1556         (JSC::Yarr::PatternTerm::capture):
1557
1558 2010-12-03  Chris Rogers  <crogers@google.com>
1559
1560         Reviewed by Kenneth Russell.
1561
1562         First steps to adding web audio files to build systems
1563         https://bugs.webkit.org/show_bug.cgi?id=49952
1564
1565         * wtf/Complex.h:
1566
1567 2010-12-03  Patrick Gansterer  <paroga@webkit.org>
1568
1569         Reviewed by Andreas Kling.
1570
1571         Move StringWx.cpp into wtf directory
1572         https://bugs.webkit.org/show_bug.cgi?id=50060
1573
1574         * wtf/wx/StringWx.cpp: Renamed from WebCore/platform/text/wx/StringWx.cpp.
1575         (WTF::String::String):
1576
1577 2010-12-03  Patrick Gansterer  <paroga@webkit.org>
1578
1579         Reviewed by Andreas Kling.
1580
1581         Move StringBrew.cpp into wtf directory
1582         https://bugs.webkit.org/show_bug.cgi?id=50058
1583
1584         * wtf/brew/StringBrew.cpp: Renamed from WebCore/platform/text/brew/StringBrew.cpp.
1585         (WTF::String::String):
1586
1587 2010-12-03  Patrick Gansterer  <paroga@webkit.org>
1588
1589         Reviewed by Andreas Kling.
1590
1591         Move StringHaiku.cpp into wtf directory
1592         https://bugs.webkit.org/show_bug.cgi?id=50057
1593
1594         * wtf/haiku/StringHaiku.cpp: Renamed from WebCore/platform/text/haiku/StringHaiku.cpp.
1595         (WTF::String::String):
1596         (WTF::String::operator BString):
1597
1598 2010-12-02  Geoffrey Garen  <ggaren@apple.com>
1599
1600         Try to fix Windows build.
1601
1602         * runtime/GCActivityCallback.cpp:
1603         (JSC::DefaultGCActivityCallback::synchronize): Added a non-CF implementation.
1604
1605 2010-12-02  Geoffrey Garen  <ggaren@apple.com>
1606
1607         Reviewed by Gavin Barraclough.
1608
1609         Fixed <rdar://problem/8310571> CrashTracer: 60 crashes in Photo Booth at
1610         com.apple.JavaScriptCore: JSC::Heap::markRoots + 746
1611         
1612         * API/APIShims.h:
1613         (JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock): Call our new
1614         synchronize() function.
1615
1616         * runtime/Collector.cpp:
1617         (JSC::Heap::activityCallback):
1618         * runtime/Collector.h: Added an activityCallback() accessor, for the
1619         call above.
1620
1621         * runtime/GCActivityCallback.h:
1622         (JSC::GCActivityCallback::synchronize):
1623         * runtime/GCActivityCallbackCF.cpp:
1624         (JSC::DefaultGCActivityCallback::DefaultGCActivityCallback):
1625         (JSC::DefaultGCActivityCallback::~DefaultGCActivityCallback):
1626         (JSC::DefaultGCActivityCallback::operator()):
1627         (JSC::DefaultGCActivityCallback::synchronize): Track the run loop we're
1628         scheduled in. If we begin/resume execution within a new run loop, reschedule
1629         on it. This prevents a crash when using a lockless context group on
1630         multiple threads -- the crash would happen if the GC timer scheduled on
1631         thread A, then you continued execution on thread B, then the thread A
1632         timer fired.
1633
1634 2010-12-02  Darin Adler  <darin@apple.com>
1635
1636         * wtf/ASCIICType.h: Fix wrong type from last check-in.
1637
1638 2010-12-02  Darin Adler  <darin@apple.com>
1639
1640         Try to fix certain builds (Qt Windows).
1641
1642         * wtf/ASCIICType.h: Added an overload for unsigned because in obsolete
1643         versions of ICU, UChar32 can be a typedef for unsigned. Adding this
1644         overload should make us compatible with these old ICUs.
1645
1646 2010-12-02  Patrick Gansterer  <paroga@webkit.org>
1647
1648         Reviewed by Darin Adler.
1649
1650         Add AtomicString::fromUTF8
1651         https://bugs.webkit.org/show_bug.cgi?id=45594
1652
1653         Unicode::calculateStringHashFromUTF8 creates a StringHash out of UTF8 input data and
1654         calculates the required length for the UTF16 conversation in one step.
1655         This is then used in a specialized translator for the string table of AtomicString.
1656
1657         * JavaScriptCore.exp:
1658         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1659         * wtf/text/AtomicString.cpp:
1660         (WTF::CStringTranslator::equal):
1661         (WTF::HashAndUTF8CharactersTranslator::hash):
1662         (WTF::HashAndUTF8CharactersTranslator::equal):
1663         (WTF::HashAndUTF8CharactersTranslator::translate):
1664         (WTF::AtomicString::add):
1665         (WTF::AtomicString::addSlowCase):
1666         (WTF::AtomicString::find):
1667         (WTF::AtomicString::fromUTF8):
1668         * wtf/text/AtomicString.h:
1669         * wtf/text/StringImpl.h:
1670         * wtf/text/WTFString.h:
1671         * wtf/unicode/UTF8.cpp:
1672         (WTF::Unicode::readUTF8Sequence):
1673         (WTF::Unicode::convertUTF8ToUTF16):
1674         (WTF::Unicode::calculateStringHashFromUTF8):
1675         (WTF::Unicode::equalUTF16WithUTF8):
1676         * wtf/unicode/UTF8.h:
1677
1678 2010-12-02  Geoffrey Garen  <ggaren@apple.com>
1679
1680         Reviewed by Sam Weinig.
1681
1682         Added a little hardening to OSAllocator.
1683
1684         * wtf/OSAllocatorPosix.cpp:
1685         (WTF::OSAllocator::release):
1686         * wtf/OSAllocatorWin.cpp:
1687         (WTF::OSAllocator::reserve):
1688         (WTF::OSAllocator::reserveAndCommit):
1689         (WTF::OSAllocator::commit):
1690         (WTF::OSAllocator::decommit):
1691         (WTF::OSAllocator::release): CRASH() if the OS's virtual memory system
1692         reports an error.
1693
1694 2010-12-02  Csaba Osztrogonác  <ossy@webkit.org>
1695
1696         Reviewed by Geoffrey Garen.
1697
1698         [Qt] Make platform managing of OSAllocator better than r73106
1699         https://bugs.webkit.org/show_bug.cgi?id=50385
1700
1701         * wtf/OSAllocatorPosix.cpp: Remove platform specific guard.
1702         * wtf/OSAllocatorSymbian.cpp: Remove platform specific guard.
1703         * wtf/OSAllocatorWin.cpp: Remove platform specific guard.
1704         * wtf/wtf.pri: Add the correct platform specific source file instead of all of them.
1705
1706 2010-12-02  Patrick Gansterer  <paroga@webkit.org>
1707
1708         Reviewed by Andreas Kling.
1709
1710         [WINCE] Use GetTickCount() for srand()
1711         https://bugs.webkit.org/show_bug.cgi?id=50338
1712
1713         time() is not a native function on WinCE, so use GetTickCount() instead.
1714
1715         * wtf/RandomNumberSeed.h:
1716         (WTF::initializeRandomNumberGenerator):
1717
1718 2010-12-02  Norbert Leser  <norbert.leser@nokia.com>
1719
1720         Reviewed by Laszlo Gombos.
1721
1722         [Qt] [Symbian] Reintroduce compiler optimizations for JSC
1723         https://bugs.webkit.org/show_bug.cgi?id=50270
1724
1725         Add compiler optimization (symbian ARM target) which was lost after split from WebCore.
1726         Tested via Sunspider and V8 - both of which show significant performance improvement.
1727
1728         * JavaScriptCore.pro:
1729
1730 2010-12-02  Peter Varga  <pvarga@inf.u-szeged.hu>
1731
1732         Reviewed by Gavin Barraclough.
1733
1734         Move regex parsing and fallback handling to runtime/RegExp.cpp
1735         https://bugs.webkit.org/show_bug.cgi?id=50015
1736
1737         * runtime/RegExp.cpp:
1738         (JSC::RegExp::RegExp):
1739         (JSC::RegExp::create):
1740         (JSC::RegExp::compile):
1741         (JSC::RegExp::match):
1742         (JSC::RegExp::printTraceData):
1743         * runtime/RegExp.h:
1744         (JSC::RegExp::pattern):
1745         * yarr/RegexInterpreter.cpp:
1746         * yarr/RegexInterpreter.h:
1747         * yarr/RegexJIT.cpp:
1748         (JSC::Yarr::RegexGenerator::compile):
1749         (JSC::Yarr::jitCompileRegex):
1750         * yarr/RegexJIT.h:
1751         (JSC::Yarr::RegexCodeBlock::RegexCodeBlock):
1752         (JSC::Yarr::RegexCodeBlock::setFallBack):
1753         (JSC::Yarr::RegexCodeBlock::isFallBack):
1754         (JSC::Yarr::executeRegex):
1755
1756 2010-12-01  Geoffrey Garen  <ggaren@apple.com>
1757
1758         Try to fix the GTK build.
1759
1760         * GNUmakefile.am: Use a full path to OSAllocator*.cpp.
1761
1762 2010-12-01  Geoffrey Garen  <ggaren@apple.com>
1763
1764         Try to fix the EFL Linux build.
1765
1766         * CMakeListsEfl.txt: Added OSAllocator to the project.
1767
1768 2010-12-01  Geoffrey Garen  <ggaren@apple.com>
1769
1770         Try to fix the Qt build: Include all OS files for Qt's sake, and then
1771         use #ifdefs in the files to exclude things based on OS.
1772         
1773         This is a pretty bad way to manage platforms -- hopefully we can
1774         fix the Qt build system and move away from this in the future.
1775
1776         * wtf/OSAllocatorPosix.cpp:
1777         * wtf/OSAllocatorSymbian.cpp:
1778         * wtf/OSAllocatorWin.cpp:
1779         * wtf/wtf.pri:
1780
1781 2010-12-01  Geoffrey Garen  <ggaren@apple.com>
1782
1783         Try to fix the Chromium build.
1784         
1785         * JavaScriptCore.gypi: This is a Windows build file, so use OSAllocatorWin.cpp.
1786
1787 2010-12-01  Geoffrey Garen  <ggaren@apple.com>
1788
1789         Try to fix the GTK build.
1790
1791         * GNUmakefile.am: Added OSAllocator to another project.
1792
1793 2010-12-01  Geoffrey Garen  <ggaren@apple.com>
1794
1795         Try to fix the GTK Linux build.
1796
1797         * JavaScriptCore.gypi: Added OSAllocator to the project.
1798
1799 2010-12-01  Geoffrey Garen  <ggaren@apple.com>
1800
1801         Try to fix the Qt Linux build.
1802
1803         * wtf/OSAllocatorPosix.cpp: Use the right errno.h.
1804
1805 2010-12-01  Geoffrey Garen  <ggaren@apple.com>
1806
1807         Try to fix Windows build: export some more symbols.
1808
1809         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1810
1811 2010-12-01  Geoffrey Garen  <ggaren@apple.com>
1812
1813         Try to fix the Qt Linux build.
1814
1815         * wtf/wtf.pri: Use the POSIX OSAllocator for Qt Linux.
1816
1817 2010-12-01  Geoffrey Garen  <ggaren@apple.com>
1818
1819         Windows build fix: commit doesn't have a return value.
1820
1821         * wtf/OSAllocatorWin.cpp:
1822         (WTF::OSAllocator::commit):
1823
1824 2010-12-01  Geoffrey Garen  <ggaren@apple.com>
1825
1826         Build fix: Export some symbols.
1827
1828         * JavaScriptCore.exp:
1829
1830 2010-12-01  Geoffrey Garen  <ggaren@apple.com>
1831
1832         Build fix.
1833
1834         * JavaScriptCore.xcodeproj/project.pbxproj: Export OSAllocator.h as private
1835         so other projects can see it.
1836
1837         * wtf/OSAllocatorPosix.cpp: #include UnusedParam.h for UNUSED_PARAM.
1838
1839 2010-12-01  Geoffrey Garen  <ggaren@apple.com>
1840
1841         Reviewed by Sam Weinig.
1842
1843         Baby step toward a cross-platform virtual memory abstraction: created
1844         an all-static OSAllocator class and changed MarkStack to use it.
1845
1846         * JavaScriptCore.exp: These functions are inlined now.
1847
1848         * JavaScriptCore.vcproj/WTF/WTF.vcproj: Added OSAllocatorWin.cpp.
1849
1850         * JavaScriptCore.xcodeproj/project.pbxproj: Added OSAllocatorPosix.cpp.
1851
1852         * runtime/MarkStack.h:
1853         (JSC::MarkStack::allocateStack):
1854         (JSC::MarkStack::releaseStack): Use OSAllocator instead of rolling our
1855         own platform-specific code.
1856
1857         * runtime/MarkStackNone.cpp: Removed. Nothing used this.
1858
1859         * runtime/MarkStackPosix.cpp: 
1860         * runtime/MarkStackSymbian.cpp:
1861         * runtime/MarkStackWin.cpp: Removed custom platform-specific code, since
1862         we use the OSAllocator abstraction now.
1863
1864         * wtf/OSAllocator.h: Added.
1865         * wtf/OSAllocatorPosix.cpp: Added.
1866         (WTF::OSAllocator::reserve):
1867         (WTF::OSAllocator::reserveAndCommit):
1868         (WTF::OSAllocator::commit):
1869         (WTF::OSAllocator::decommit):
1870         (WTF::OSAllocator::release):
1871         * wtf/OSAllocatorSymbian.cpp: Added.
1872         (WTF::OSAllocator::reserve):
1873         (WTF::OSAllocator::reserveAndCommit):
1874         (WTF::OSAllocator::commit):
1875         (WTF::OSAllocator::decommit):
1876         (WTF::OSAllocator::release):
1877         * wtf/OSAllocatorWin.cpp: Added.
1878         (WTF::OSAllocator::reserve):
1879         (WTF::OSAllocator::reserveAndCommit):
1880         (WTF::OSAllocator::commit):
1881         (WTF::OSAllocator::decommit):
1882         (WTF::OSAllocator::release): The new OSAllocator abstraction.
1883
1884         * wtf/wtf.pri: Added OSAllocatorSymbian.cpp.
1885
1886 2010-12-01  Steve Falkenburg  <sfalken@apple.com>
1887
1888         Reviewed by Adam Roben.
1889
1890         WinCairo build should not use link-time code generation (LTCG)
1891         https://bugs.webkit.org/show_bug.cgi?id=50353
1892
1893         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1894         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
1895         * JavaScriptCore.vcproj/jsc/jsc.vcproj:
1896         * JavaScriptCore.vcproj/testapi/testapi.vcproj:
1897
1898 010-12-01  Steve Falkenburg  <sfalken@apple.com>
1899
1900         Reviewed by Adam Roben.
1901
1902         vcproj changes can't be applied cleanly by the Windows EWS bot
1903         https://bugs.webkit.org/show_bug.cgi?id=50328
1904
1905         * JavaScriptCore.vcproj/JavaScriptCore.sln: Modified property svn:eol-style.
1906         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Modified property svn:eol-style.
1907         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCF.vsprops: Added property svn:eol-style.
1908         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCFLite.vsprops: Added property svn:eol-style.
1909         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: Added property svn:eol-style.
1910         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj: Modified property svn:eol-style.
1911         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGeneratedCommon.vsprops: Added property svn:eol-style.
1912         * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln: Modified property svn:eol-style.
1913         * JavaScriptCore.vcproj/WTF/WTF.vcproj: Modified property svn:eol-style.
1914         * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops: Added property svn:eol-style.
1915         * JavaScriptCore.vcproj/jsc/jsc.vcproj: Modified property svn:eol-style.
1916         * JavaScriptCore.vcproj/jsc/jscCommon.vsprops: Added property svn:eol-style.
1917         * JavaScriptCore.vcproj/testapi/testapi.vcproj: Modified property svn:eol-style.
1918         * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops: Added property svn:eol-style.
1919
1920 2010-12-01  Gavin Barraclough  <barraclough@apple.com>
1921
1922         Reviewed by Sam Weinig.
1923
1924         Bug 50298 - /()()()()()()()()()(?:(\10a|b)(X|Y))+/.exec("bXXaYYaY") ASSERTs
1925
1926         For unmatched subpattens we previously used to set the subpattern end to -1,
1927         but now we only set the start value. E.g. consider the following:
1928             /a(b)?c/.exec("ac");
1929         Previously we would generate an internal results array of:
1930             [ 0, 2, -1, -1 ]
1931         Since fairly recently we have generated results of:
1932             [ 0, 2, -1, ??? ]
1933         (With the end index of the subpattern uninitialized).
1934
1935         Update these ASSERTs to account for this.
1936
1937         Also, when stripping out self-referencing backreferences, (e.g. /(\1)/) we
1938         were checking the wrong property on the pattern term. We should have been
1939         looking at term.parentheses.subpatternId, but instead were checking
1940         term.subpatternId. The latter is actually only the subpatternId for
1941         back reference terms. Rename this to backReferenceSubpatternId.
1942
1943         * yarr/RegexInterpreter.cpp:
1944         (JSC::Yarr::Interpreter::matchBackReference):
1945         (JSC::Yarr::Interpreter::backtrackBackReference):
1946
1947 2010-11-30  Gavin Barraclough  <barraclough@apple.com>
1948
1949         Rubber stamped by Sam Weinig.
1950
1951         Bug 50297 - \s in YARR should match BOMs.
1952
1953         From section 15.10.2.12 CharacterClassEscape contains:
1954
1955         The production CharacterClassEscape :: s evaluates by returning the set of characters containing the
1956         characters that are on the right-hand side of the WhiteSpace (7.2) or LineTerminator (7.3) productions.
1957
1958         Table 2 in section 7.2 contains:
1959
1960         \uFEFF Byte Order Mark <BOM>
1961
1962         * create_regex_tables:
1963             Add BOM to spaces table.
1964
1965 2010-11-30  Gavin Barraclough  <barraclough@apple.com>
1966
1967         Reviewed by Darin Adler.
1968
1969         Fixed review comments following bug #48101.
1970         Mostly typos, plus gave quantifyInfinite a symbolic name.
1971
1972         * yarr/RegexCompiler.cpp:
1973         (JSC::Yarr::RegexPatternConstructor::quantifyAtom):
1974         (JSC::Yarr::RegexPatternConstructor::checkForTerminalParentheses):
1975         * yarr/RegexInterpreter.cpp:
1976         (JSC::Yarr::Interpreter::backtrackParenthesesOnceEnd):
1977         (JSC::Yarr::Interpreter::matchParenthesesTerminalBegin):
1978         (JSC::Yarr::Interpreter::backtrackParenthesesTerminalBegin):
1979         (JSC::Yarr::Interpreter::backtrackParenthesesTerminalEnd):
1980         * yarr/RegexJIT.cpp:
1981         (JSC::Yarr::RegexGenerator::generatePatternCharacterGreedy):
1982         (JSC::Yarr::RegexGenerator::generatePatternCharacterNonGreedy):
1983         (JSC::Yarr::RegexGenerator::generateCharacterClassGreedy):
1984         * yarr/RegexParser.h:
1985         (JSC::Yarr::Parser::parseTokens):
1986         (JSC::Yarr::parse):
1987
1988 2010-11-30  Steve Falkenburg  <sfalken@apple.com>
1989
1990         Reviewed by Darin Adler.
1991
1992         WTF project missing build-stopping code from its pre-build event
1993         https://bugs.webkit.org/show_bug.cgi?id=50281
1994
1995         * JavaScriptCore.vcproj/WTF/WTFPreBuild.cmd:
1996
1997 2010-11-30  Patrick Gansterer  <paroga@webkit.org>
1998
1999         Reviewed by Darin Adler.
2000
2001         Cleanup UTF8.cpp
2002         https://bugs.webkit.org/show_bug.cgi?id=49581
2003
2004         Use macros and functions instead of range values directly.
2005
2006         * wtf/unicode/UTF8.cpp:
2007         (WTF::Unicode::inlineUTF8SequenceLength):
2008         (WTF::Unicode::UTF8SequenceLength):
2009         (WTF::Unicode::convertUTF16ToUTF8):
2010         (WTF::Unicode::readUTF8Sequence):
2011         (WTF::Unicode::convertUTF8ToUTF16):
2012         * wtf/unicode/UnicodeMacrosFromICU.h: Added U_IS_SUPPLEMENTARY macro.
2013
2014 2010-11-30  Geoffrey Garen  <ggaren@apple.com>
2015
2016         Reviewed by Gavin Barraclough.
2017
2018         Fixed a crash seen when using a PageAllocation to store itself.
2019
2020         * wtf/PageAllocation.h:
2021         (WTF::PageAllocation::systemDeallocate): Zero out m_base before unmapping
2022         it, in case unmapping m_base unmaps the PageAllocation.
2023
2024         * wtf/BumpPointerAllocator.h:
2025         (WTF::BumpPointerPool::destroy): Now this work-around isn't needed!
2026
2027 2010-11-30  Xan Lopez  <xlopez@igalia.com>
2028
2029         Reviewed by Darin Adler.
2030
2031         m_hasNonEnumerableProperties is never initialized in Structure
2032         https://bugs.webkit.org/show_bug.cgi?id=50266
2033
2034         * runtime/Structure.cpp:
2035         (JSC::Structure::Structure): initialize member variable.
2036
2037 2010-11-29  Steve Falkenburg  <sfalken@apple.com>
2038
2039         Windows build fix (part 1). Use correct environment variable syntax in cmd files.
2040
2041         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCorePostBuild.cmd:
2042         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCorePreBuild.cmd:
2043         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCorePreLink.cmd:
2044         * JavaScriptCore.vcproj/WTF/WTFPostBuild.cmd:
2045         * JavaScriptCore.vcproj/jsc/jscPostBuild.cmd:
2046         * JavaScriptCore.vcproj/jsc/jscPreBuild.cmd:
2047         * JavaScriptCore.vcproj/jsc/jscPreLink.cmd:
2048         * JavaScriptCore.vcproj/testapi/testapiPostBuild.cmd:
2049         * JavaScriptCore.vcproj/testapi/testapiPreBuild.cmd:
2050         * JavaScriptCore.vcproj/testapi/testapiPreLink.cmd:
2051
2052 2010-11-29  Dan Bernstein  <mitz@apple.com>
2053
2054         Reviewed by Darin Adler.
2055
2056         WTF support for <rdar://problem/8650085> adding word-prefix search options to the text search API.
2057         https://bugs.webkit.org/show_bug.cgi?id=50038
2058
2059         * wtf/unicode/UnicodeMacrosFromICU.h: Copied additional macros from icu/unicode/utf16.h.
2060
2061 2010-11-29  Steve Falkenburg  <sfalken@apple.com>
2062
2063         Reviewed by Darin Adler.
2064
2065         JavaScriptCore projects on Windows should use cmd files for build events
2066         https://bugs.webkit.org/show_bug.cgi?id=50193
2067
2068         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
2069         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCorePostBuild.cmd: Added.
2070         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCorePreBuild.cmd: Added.
2071         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCorePreLink.cmd: Added.
2072         * JavaScriptCore.vcproj/WTF/WTFPostBuild.cmd: Added property svn:eol-style.
2073         * JavaScriptCore.vcproj/WTF/WTFPreBuild.cmd: Added property svn:eol-style.
2074         * JavaScriptCore.vcproj/jsc/jscCommon.vsprops:
2075         * JavaScriptCore.vcproj/jsc/jscPostBuild.cmd: Added.
2076         * JavaScriptCore.vcproj/jsc/jscPreBuild.cmd: Added.
2077         * JavaScriptCore.vcproj/jsc/jscPreLink.cmd: Added.
2078         * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops:
2079         * JavaScriptCore.vcproj/testapi/testapiPostBuild.cmd: Added.
2080         * JavaScriptCore.vcproj/testapi/testapiPreBuild.cmd: Added.
2081         * JavaScriptCore.vcproj/testapi/testapiPreLink.cmd: Added.
2082
2083 2010-11-29  Dai Mikurube  <dmikurube@google.com>
2084
2085         Reviewed by Kent Tamura.
2086
2087         when empty, clicking "down" on outer-spin-button returns "max value"
2088         https://bugs.webkit.org/show_bug.cgi?id=45491
2089
2090         It is required to calculate UTC/DST offsets to retrieve the current local milliseconds for
2091         date/time type inputs. WTF::currentTimeMS() returns a UTC time, and WTF::getLocalTime()
2092         returns a struct tm, not milliseconds.
2093
2094         Calculating milliseconds from a struct tm is not simple since timegm() cannot be used in all
2095         environments. This calculation is already done in calculateUTCOffset(), and complicated.
2096         Duplicating this complicated calculation is unreasonable because of maintainability.
2097         To achieve this without duplication, we must call calculate{UTC|DST}Offset in some way.
2098
2099         * JavaScriptCore.exp:
2100         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2101         * wtf/DateMath.cpp: Changed calculateUTCOffset() and calculateDSTOffset() to external functions.
2102         (WTF::calculateUTCOffset):
2103         (WTF::calculateDSTOffset):
2104         * wtf/DateMath.h:
2105
2106 2010-11-29  Chris Rogers  <crogers@google.com>
2107
2108         Reviewed by Kenneth Russell.
2109
2110         Switch web audio code to use FloatPoint3D instead of Vector3
2111         https://bugs.webkit.org/show_bug.cgi?id=50186
2112
2113         * wtf/Vector3.h: Removed.
2114
2115 2010-11-29  Steve Falkenburg  <sfalken@apple.com>
2116
2117         Reviewed by Adam Roben.
2118
2119         Add a mechanism for Windows pre-build/pre-link/post-build events to be separated into individual cmd files
2120         https://bugs.webkit.org/show_bug.cgi?id=49858
2121
2122         We're migrating our prebuild/prelink/postbuild steps out of vcproj and vsprops files:
2123         - To simplify editing (editing vsprops build steps is confusing).
2124         - For more readable diffs.
2125
2126         * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops:
2127         * JavaScriptCore.vcproj/WTF/WTFPostBuild.cmd: Added.
2128         * JavaScriptCore.vcproj/WTF/WTFPreBuild.cmd: Added.
2129
2130 2010-11-29  Geoffrey Garen  <ggaren@apple.com>
2131
2132         Reviewed by Gavin Barraclough.
2133
2134         Improved accuracy of command-line SunSpider.
2135
2136         * jsc.cpp:
2137         (functionRun): Changed the "run" function to run a given test in
2138         its own global object. Previously, all tests ran in the same global
2139         object, which created name conflicts, and made globals from previous
2140         tests artificially survive into later tests.
2141         
2142         Also changed "run" to return the elapsed milliseconds when running a
2143         given test, for slightly more accurate numbers.
2144
2145         (functionCheckSyntax): Ditto on returning elapsed milliseconds.
2146
2147 2010-11-29  Darin Adler  <darin@apple.com>
2148
2149         Reviewed by Andreas Kling.
2150
2151         Remove a couple unneeded overflow checks
2152         https://bugs.webkit.org/show_bug.cgi?id=49816
2153
2154         * wtf/text/CString.cpp:
2155         (WTF::CString::init): Use an ASSERT instead of
2156         an overflow check with CRASH.
2157
2158 2010-11-29  Adam Roben  <aroben@apple.com>
2159
2160         Robustify react-to-vsprops-changes.py against changes to its location
2161         or the location of the .vsprops files
2162
2163         Suggested by John Sullivan.
2164
2165         * JavaScriptCore.vcproj/JavaScriptCore/react-to-vsprops-changes.py:
2166         Removed file_modification_times.
2167         (main): Use glob.glob to find the .vsprops files and assert that we found some.
2168
2169 2010-11-29  Adam Roben  <aroben@apple.com>
2170
2171         Touch wtf/Platform.h whenever any .vsprops file changes
2172
2173         This will cause all files to be recompiled, which will make changes to
2174         preprocessor macros (e.g., ENABLE_*) actually take effect.
2175
2176         Fixes <http://webkit.org/b/50167> Windows build fails when ENABLE_*
2177         macros are changed (because not enough files are rebuilt)
2178
2179         Reviewed by John Sullivan.
2180
2181         * JavaScriptCore.vcproj/JavaScriptCore/react-to-vsprops-changes.py:
2182         (main): Touch wtf/Platform.h if it's older than any .vsprops file. Also
2183         added some comments and logging to make it clearer what the script is
2184         doing and why.
2185
2186 2010-11-29  Adam Roben  <aroben@apple.com>
2187
2188         Update react-to-vsprops-changes.py after r72555
2189
2190         .vsprops files are no longer accessed relative to $WebKitLibrariesDir.
2191
2192         Fixes <http://webkit.org/b/50166> REGRESSION (r72555):
2193         react-to-vsprops-changes.py no longer works for people with a
2194         non-default $WebKitLibrariesDir
2195
2196         Reviewed by John Sullivan.
2197
2198         * JavaScriptCore.vcproj/JavaScriptCore/react-to-vsprops-changes.py:
2199         (main): Always look in WebKitLibraries/win for .vsprops files, not in
2200         $WebKitLibrariesDir.
2201
2202 2010-11-28  Gavin Barraclough  <barraclough@apple.com>
2203
2204         Reviewed by Sam Weinig.
2205
2206         Bug 48100 - YARR allows what seems like a bogus character-class range
2207
2208         Per ECMA-262 character classes containing character ranges containing
2209         character classes are invalid, eg:
2210             /[\d-x]/
2211             /[x-\d]/
2212             /[\d-\d]/
2213         These should throw a syntax error.
2214
2215         * yarr/RegexParser.h:
2216
2217 2010-11-27  Gavin Barraclough  <barraclough@apple.com>
2218
2219         Reviewed by Sam Weinig.
2220
2221         Bug 48101 - Yarr gives different results for /(?:a*?){2,}/
2222
2223         The test cases in the linked mozilla bug demonstrate a couple of
2224         problems in subpattern matching. These bugs lie in the optimized
2225         cases - for matching parentheses with a quantity count of 1, and
2226         for matching greedy quantified parentheses at the end of a regex
2227         (which do not backtrack).
2228
2229         In both of these cases we are failing to correctly handle empty
2230         matches. In the case of parentheses-single matches (quantity count
2231         one) we are failing to test for empty matches at all. In the case
2232         of terminal subpattern matches we do currently check, however there
2233         is a subtler bug here too. In the case of an empty match we will
2234         presently immediately fall through to the next alternative (or
2235         complete the regex match), whereas upon a failed match we should
2236         be backtracking into the failing alternative, to give it a chance
2237         to match further (e.g. consider /a??b?|a/.exec("ab") - upon first
2238         attempting to match the first alternative this will match the empty
2239         string - since a?? is non-greedy, however rather than moving on to
2240         the second alternative we should be re-matching the first one, at
2241         which point the non-greedy a?? will match, and as such the result
2242         should be "ab", not "a").
2243
2244         Terminal subpattern matching contains a second bug, too. The frame
2245         location values in the subpattern should be being allocated with
2246         the outer disjunction's frame (as we do for the parentheses-single
2247         optimization). Consider the following three regexes:
2248             /a*(?:b*)*c*/
2249             /a*(?:b*)c*/
2250             /a*(?:b*)*/
2251         Considering only the frame location required by the atoms a,b, and
2252         c, (ignoring space associated with the nested subpattern) the first
2253         regex (a normal subpattern match) requires a frame size of 2 for
2254         the outer disjunction, (to backtrack terms a & c), with each
2255         iteration of the subpattern requiring a frame of size 1 (in order
2256         to backtrack b). In the case of the second regex (where the
2257         parentheses-single optimization will kick in) the outer frame must
2258         be set up with a frame size of 3, since the outer frame will also
2259         be used when running the nested subpattern. We will currently only
2260         allocate a farme of size 1 for the outer disjuntion (to contain a),
2261         howver the frame size should be 2 (since the subpattern will be
2262         evaluated in the outer frame). In addition to failing to allocate
2263         frame space the frame offsets are also presently invalid - in the
2264         case of the last regex b's frame location will be set assuming it
2265         to be the first term in the frame, whereas in this case b lies
2266         after the term a, and should be taking a separate frame location.
2267
2268         In order to correctly allocate the frame for terminal subpattern
2269         matches we must move this optimization back up from the JIT into
2270         the compiler (and thus interpreter too), since this is where the
2271         frame allocation takes place.
2272
2273         * yarr/RegexCompiler.cpp:
2274         (JSC::Yarr::RegexPatternConstructor::setupAlternativeOffsets):
2275         (JSC::Yarr::RegexPatternConstructor::checkForTerminalParentheses):
2276         (JSC::Yarr::compileRegex):
2277         * yarr/RegexInterpreter.cpp:
2278         (JSC::Yarr::Interpreter::matchParenthesesOnceBegin):
2279         (JSC::Yarr::Interpreter::matchParenthesesOnceEnd):
2280         (JSC::Yarr::Interpreter::backtrackParenthesesOnceBegin):
2281         (JSC::Yarr::Interpreter::backtrackParenthesesOnceEnd):
2282         (JSC::Yarr::Interpreter::matchParenthesesTerminalBegin):
2283         (JSC::Yarr::Interpreter::matchParenthesesTerminalEnd):
2284         (JSC::Yarr::Interpreter::backtrackParenthesesTerminalBegin):
2285         (JSC::Yarr::Interpreter::backtrackParenthesesTerminalEnd):
2286         (JSC::Yarr::Interpreter::matchDisjunction):
2287         (JSC::Yarr::ByteCompiler::atomParenthesesOnceBegin):
2288         (JSC::Yarr::ByteCompiler::atomParenthesesTerminalBegin):
2289         (JSC::Yarr::ByteCompiler::atomParenthesesSubpatternBegin):
2290         (JSC::Yarr::ByteCompiler::atomParentheticalAssertionEnd):
2291         (JSC::Yarr::ByteCompiler::atomParenthesesSubpatternEnd):
2292         (JSC::Yarr::ByteCompiler::atomParenthesesOnceEnd):
2293         (JSC::Yarr::ByteCompiler::atomParenthesesTerminalEnd):
2294         (JSC::Yarr::ByteCompiler::emitDisjunction):
2295         * yarr/RegexInterpreter.h:
2296         * yarr/RegexJIT.cpp:
2297         (JSC::Yarr::RegexGenerator::generateParenthesesSingle):
2298         (JSC::Yarr::RegexGenerator::generateParenthesesGreedyNoBacktrack):
2299         (JSC::Yarr::RegexGenerator::generateTerm):
2300         * yarr/RegexPattern.h:
2301         (JSC::Yarr::PatternTerm::PatternTerm):
2302
2303 2010-11-24  Patrick Gansterer  <paroga@webkit.org>
2304
2305         Reviewed by Csaba Osztrogonác.
2306
2307         Remove Bakefile build system files
2308         https://bugs.webkit.org/show_bug.cgi?id=49983
2309
2310         r53757 only removed the content, but not the files.
2311         This patch removes that empty files.
2312
2313         * JavaScriptCoreSources.bkl: Removed.
2314         * jscore.bkl: Removed.
2315
2316 2010-11-24  Gabor Loki  <loki@webkit.org>
2317
2318         Reviewed by Csaba Osztrogonác.
2319
2320         Merge the usage of jumps and calls at ARM-JIT
2321         https://bugs.webkit.org/show_bug.cgi?id=50008
2322
2323         Those JmpSrc objects which represent jumps (not calls) should point to
2324         after the jump instruction.
2325
2326         * assembler/ARMAssembler.h:
2327         (JSC::ARMAssembler::blx):
2328         (JSC::ARMAssembler::loadBranchTarget):
2329         (JSC::ARMAssembler::getAbsoluteJumpAddress):
2330         (JSC::ARMAssembler::linkJump):
2331         (JSC::ARMAssembler::relinkJump):
2332         (JSC::ARMAssembler::linkCall):
2333         (JSC::ARMAssembler::relinkCall):
2334         (JSC::ARMAssembler::getRelocatedAddress):
2335         (JSC::ARMAssembler::getDifferenceBetweenLabels):
2336         (JSC::ARMAssembler::getCallReturnOffset):
2337         * assembler/MacroAssemblerARM.h:
2338         (JSC::MacroAssemblerARM::call):
2339
2340 2010-11-24  Carlos Garcia Campos  <cgarcia@igalia.com>
2341
2342         Reviewed by Xan Lopez.
2343
2344         [GTK] Optimize foldCase, toLower and toUpper methods in glib unicode backend
2345         https://bugs.webkit.org/show_bug.cgi?id=48625
2346
2347         GLib methods use UTF-8 strings, so we have to convert from UTF-16 to
2348         UTF-8 to perform the case operations and then convert back the result to
2349         UTF-16. GLib conversion methods return a new allocated string, so we
2350         have to memcpy the result into the destination buffer too. Using our
2351         own methods to convert between UTF-8 and UTF-16 from wtf/unicode/UTF8.h
2352         we don't need such memcpy, since they take an already allocated buffer
2353         rather than returning a new one. There's another optimization for the
2354         case when the destination buffer is not large enough. In that case,
2355         methods should return the expected destination buffer size and are
2356         called again with a new buffer. We can avoid the conversion to UTF-16 by
2357         pre-calculating the required size for the destination buffer.
2358
2359         * wtf/unicode/glib/UnicodeGLib.cpp:
2360         (WTF::Unicode::getUTF16LengthFromUTF8):
2361         (WTF::Unicode::convertCase):
2362         (WTF::Unicode::foldCase):
2363         (WTF::Unicode::toLower):
2364         (WTF::Unicode::toUpper):
2365
2366 2010-11-23  Patrick Gansterer  <paroga@webkit.org>
2367
2368         Reviewed by Sam Weinig.
2369
2370         Use WTF::StringHasher directly in JavaScriptCore
2371         https://bugs.webkit.org/show_bug.cgi?id=49893
2372
2373         * profiler/CallIdentifier.h:
2374         (JSC::CallIdentifier::Hash::hash):
2375         * runtime/Identifier.cpp:
2376         (JSC::IdentifierCStringTranslator::hash):
2377         (JSC::IdentifierUCharBufferTranslator::hash):
2378
2379 2010-11-22  Patrick Gansterer  <paroga@webkit.org>
2380
2381         Reviewed by Sam Weinig.
2382
2383         Add WTF::FixedArray::size()
2384         https://bugs.webkit.org/show_bug.cgi?id=49891
2385
2386         Add a method to get the size of a FixedArray.
2387
2388         * wtf/FixedArray.h:
2389         (WTF::FixedArray::size):
2390
2391 2010-11-22  Patrick Gansterer  <paroga@webkit.org>
2392
2393         Reviewed by Adam Roben.
2394
2395         [WINCE] Set correct preprocessor definitions
2396         https://bugs.webkit.org/show_bug.cgi?id=49887
2397
2398         * wtf/Platform.h:
2399
2400 2010-11-22  Adam Roben  <aroben@apple.com>
2401
2402         Use paths relative to $WebKitVSPropsRedirectionDir to access shared .vsprops files
2403
2404         Apple's Windows build allows placing header files and import libraries for WebKit's
2405         dependencies (CoreGraphics, CFNetwork, SQLite, etc.) outside the source tree via the
2406         $WebKitLibrariesDir environment variable. This is both required for production builds and
2407         convenient for Apple-internal developer builds. Apple's production builds also require that
2408         WebKit's shared .vsprops files be accessed relative to $WebKitLibrariesDir. In production
2409         builds, the files are copied into that directory tree by the
2410         WebKitLibraries/win/tools/WinTools.make file. In Apple-internal developer builds, the
2411         copying is done by
2412         JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make.
2413
2414         This .vsprops copying is problematic in one very important case: when a developer updates
2415         their source tree and then tries to build. Visual Studio only reads .vsprops files when a
2416         project is first loaded. So, when Visual Studio is first opened after the .vsprops files are
2417         updated, it reads in the old files that were already residing in $WebKitLibrariesDir. When a
2418         build is started, JavaScriptCoreGenerated.make copies the new .vsprops files into
2419         $WebKitLibrariesDir, but Visual Studio will not pick up the changes.  The rest of the build
2420         will proceed with out-of-date .vsprops files, which will likely result in a build failure.
2421
2422         To fix this, we now use normal relative paths to access the .vsprops files in the source
2423         tree rather than in $WebKitLibrariesDir, but prefix those paths with a new environment
2424         variable, $WebKitVSPropsRedirectionDir. In developer builds, this environment variable is
2425         unset, so the normal relative paths are used to read the .vsprops files out of the source
2426         tree directly. In production builds, this environment variable is set to a fake directory
2427         that will cause the .vsprops files in $WebKitLibrariesDir to be found when the relative path
2428         is resolved.
2429         
2430         For example, JavaScriptCore.vcproj uses this path for FeatureDefines.vsprops:
2431
2432         $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\FeatureDefines.vsprops
2433
2434         In developer builds, where $WebKitVSPropsRedirectionDir is unset, this will point to the
2435         files in WebKitLibraries\win\tools\vsprops in the source tree. In production builds,
2436         JavaScriptCore.make sets $WebKitVSPropsRedirectionDir to
2437         "$(SRCROOT)\AppleInternal\tools\vsprops\OpenSource\1\2\3\", so the full path for
2438         FeatureDefines.vsprops becomes:
2439
2440         $(SRCROOT)\AppleInternal\tools\vsprops\OpenSource\1\2\3\..\..\..\WebKitLibraries\win\tools\vsprops\FeatureDefines.vsprops
2441
2442         which resolves to:
2443
2444         $(SRCROOT)\AppleInternal\tools\vsprops\OpenSource\WebKitLibraries\win\tools\vsprops\FeatureDefines.vsprops
2445
2446         (We rely on the fact that Windows doesn't care whether the directories "1", "2", and "3"
2447         actually exist since they are matched by an equal number of ".." path components.)
2448
2449         Note that Visual Studio still won't pick up changes made to .vsprops files while Visual
2450         Studio is open, but that problem hasn't seemed to cause developers many headaches so far.
2451
2452         Fixes <http://webkit.org/b/49181> Windows build fails mysteriously when .vsprops files are
2453         updated
2454
2455         Reviewed by Dave Hyatt.
2456
2457         * JavaScriptCore.vcproj/JavaScriptCore.make: Set $WebKitVSPropsRedirectionDir so that
2458         production builds can find the .vsprops files.
2459
2460         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make: Stopy copying the
2461         .vsprops files. It isn't needed anymore.
2462
2463         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2464         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
2465         * JavaScriptCore.vcproj/jsc/jsc.vcproj:
2466         * JavaScriptCore.vcproj/testapi/testapi.vcproj:
2467         Changed to use paths relative to $WebKitVSPropsRedirectionDir to access shared .vsprops
2468         files.
2469
2470 2010-11-19  Peter Varga  <pvarga@inf.u-szeged.hu>
2471
2472         Reviewed by Gavin Barraclough.
2473
2474         YARR JIT should fallback to YARR Interpreter instead of PCRE.
2475         https://bugs.webkit.org/show_bug.cgi?id=46719
2476
2477         Remove the ENABLE_YARR macro and the option of matching regular
2478         expressions with PCRE from JavaScriptCore.
2479
2480         * runtime/JSGlobalData.h:
2481         * runtime/RegExp.cpp:
2482         (JSC::RegExp::compile):
2483         (JSC::RegExp::match):
2484         * tests/mozilla/expected.html:
2485         * wtf/Platform.h:
2486         * yarr/RegexCompiler.cpp:
2487         * yarr/RegexCompiler.h:
2488         * yarr/RegexInterpreter.cpp:
2489         (JSC::Yarr::byteCompileRegex):
2490         * yarr/RegexInterpreter.h:
2491         * yarr/RegexJIT.cpp:
2492         (JSC::Yarr::jitCompileRegex):
2493         * yarr/RegexJIT.h:
2494         (JSC::Yarr::RegexCodeBlock::RegexCodeBlock):
2495         (JSC::Yarr::RegexCodeBlock::~RegexCodeBlock):
2496         (JSC::Yarr::RegexCodeBlock::getFallback):
2497         (JSC::Yarr::RegexCodeBlock::isFallback):
2498         (JSC::Yarr::RegexCodeBlock::setFallback):
2499         (JSC::Yarr::executeRegex):
2500         * yarr/RegexParser.h:
2501         * yarr/RegexPattern.h:
2502
2503 2010-11-20  Kwang Yul Seo  <skyul@company100.net>
2504
2505         Reviewed by David Kilzer.
2506
2507         [BREWMP] Replace DBGPRINTF and DBGPRINTF_FATAL with dbg_Message
2508         https://bugs.webkit.org/show_bug.cgi?id=49520
2509
2510         DBGPRINTF and DBGPRINTF_FATAL macros are prohibited in Mod1. Use dbg_Message instead.
2511
2512         * wtf/Assertions.cpp:
2513         * wtf/Assertions.h:
2514
2515 2010-11-20  Gabor Loki  <loki@webkit.org>
2516
2517         Reviewed by Gavin Barraclough.
2518
2519         Support JIT_OPTIMIZE_MOD on Thumb-2
2520         https://bugs.webkit.org/show_bug.cgi?id=49432
2521
2522         Rewrite the soft modulo operation into macroassembler form, and move it
2523         to JSValue32_64 section.
2524         Add support for soft modulo on Thumb-2 JIT also.
2525
2526         * assembler/ARMv7Assembler.h:
2527         (JSC::ARMv7Assembler::clz):
2528         * assembler/MacroAssemblerARM.h:
2529         (JSC::MacroAssemblerARM::countLeadingZeros32):
2530         (JSC::MacroAssemblerARM::relativeTableJump):
2531         * assembler/MacroAssemblerARMv7.h:
2532         (JSC::MacroAssemblerARMv7::countLeadingZeros32):
2533         (JSC::MacroAssemblerARMv7::relativeTableJump):
2534         * jit/JITArithmetic.cpp:
2535         (JSC::JIT::emit_op_mod):
2536         * jit/JITOpcodes.cpp:
2537         (JSC::JIT::privateCompileCTIMachineTrampolines):
2538         * jit/JITOpcodes32_64.cpp:
2539         (JSC::JIT::softModulo):
2540         * jit/JITStubs.cpp:
2541         (JSC::JITThunks::JITThunks):
2542         * wtf/Platform.h:
2543
2544 2010-11-20  David Kilzer  <ddkilzer@apple.com>
2545
2546         <http://webkit.org/b/49848> Make it possible to display the last character of a secure text field unobscured
2547
2548         Reviewed by Darin Adler.
2549
2550         * JavaScriptCore.exp:
2551         * wtf/text/StringImpl.cpp:
2552         (WTF::StringImpl::secure): Added argument that controls whether
2553         the last character is obscured or not.  Implemented behavior.
2554         * wtf/text/StringImpl.h:
2555         (WTF::StringImpl::LastCharacterBehavior): Added enum.
2556         (WTF::StringImpl::secure): Updated method signature.
2557
2558 2010-11-19  William Chan  <willchan@chromium.org>
2559
2560         Reviewed by David Levin.
2561
2562         Add USE(CHROMIUM_NET)
2563
2564         Indicates the use of Chromium's network stack.  Chromium's network
2565         stack performs better when it has full view of all resource requests,
2566         so USE(CHROMIUM_NET) can be used to bypass throttles.
2567
2568         https://bugs.webkit.org/show_bug.cgi?id=49778
2569
2570         * wtf/Platform.h:
2571
2572 2010-11-19  Steve Falkenburg  <sfalken@apple.com>
2573
2574         Reviewed by Adam Roben.
2575
2576         Add Debug_Cairo_CFLite and Release_Cairo_CFLite configurations for all vcproj files
2577         https://bugs.webkit.org/show_bug.cgi?id=49819
2578
2579         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2580         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj:
2581         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
2582         * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops:
2583         * JavaScriptCore.vcproj/jsc/jsc.vcproj:
2584         * JavaScriptCore.vcproj/testapi/testapi.vcproj:
2585
2586 2010-11-19  Oliver Hunt  <oliver@apple.com>
2587
2588         Reviewed by Geoffrey Garen.
2589
2590         Don't check for constant registers when we can guarantee that the register won't be in the constant pool
2591         https://bugs.webkit.org/show_bug.cgi?id=49814
2592
2593         Add uncheckedR(int) to CallFrame, and replace all the uses of r() with uncheckedR()
2594         when we can guarantee that the register is not referring to a constant.
2595         This makes the interpreter about 0.5% faster, and makes the CallFrame initialisation
2596         logic correct when we're using a faked callframe (as in the case of the globalExec).
2597
2598         * bytecode/CodeBlock.cpp:
2599         (JSC::CodeBlock::createActivation):
2600         * debugger/DebuggerCallFrame.cpp:
2601         (JSC::DebuggerCallFrame::thisObject):
2602         * interpreter/CallFrame.h:
2603         (JSC::ExecState::uncheckedR):
2604         * interpreter/Interpreter.cpp:
2605         (JSC::Interpreter::resolve):
2606         (JSC::Interpreter::resolveSkip):
2607         (JSC::Interpreter::resolveGlobal):
2608         (JSC::Interpreter::resolveGlobalDynamic):
2609         (JSC::Interpreter::resolveBase):
2610         (JSC::Interpreter::resolveBaseAndProperty):
2611         (JSC::Interpreter::callEval):
2612         (JSC::Interpreter::unwindCallFrame):
2613         (JSC::Interpreter::throwException):
2614         (JSC::Interpreter::execute):
2615         (JSC::Interpreter::executeCall):
2616         (JSC::Interpreter::executeConstruct):
2617         (JSC::Interpreter::prepareForRepeatCall):
2618         (JSC::Interpreter::createExceptionScope):
2619         (JSC::Interpreter::privateExecute):
2620         * jit/JITStubs.cpp:
2621         (JSC::DEFINE_STUB_FUNCTION):
2622         * runtime/JSActivation.cpp:
2623         (JSC::JSActivation::argumentsGetter):
2624
2625 2010-11-19  Steve Falkenburg  <sfalken@apple.com>
2626
2627         Reviewed by Darin Adler.
2628
2629         Normalize Cairo/CFLite project/solution configuration names
2630         https://bugs.webkit.org/show_bug.cgi?id=49818
2631
2632         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2633         * JavaScriptCore.vcproj/jsc/jsc.vcproj:
2634         * JavaScriptCore.vcproj/testapi/testapi.vcproj:
2635
2636 2010-11-18  Steve Falkenburg  <sfalken@apple.com>
2637
2638         Reviewed by Adam Roben.
2639
2640         Windows vcproj configuration names should be normalized across projects
2641         https://bugs.webkit.org/show_bug.cgi?id=49776
2642
2643         * JavaScriptCore.vcproj/JavaScriptCore.sln:
2644         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj:
2645         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGeneratedCommon.vsprops: Added.
2646         * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln:
2647
2648 2010-11-19  Patrick Gansterer  <paroga@webkit.org>
2649
2650         Unreviewed, build fix after r72360.
2651
2652         * bytecode/CodeBlock.h:
2653         (JSC::CodeBlock::bytecodeOffset):
2654
2655 2010-11-18  Gavin Barraclough  <barraclough@apple.com>
2656
2657         Rubber stamped by Geoff Garen.
2658
2659         Bug 49577 - Function.prototype should be non-configurable
2660
2661         Ooops, Function.prototype should not be enumerable!
2662
2663         * runtime/JSFunction.cpp:
2664         (JSC::JSFunction::getOwnPropertySlot):
2665
2666 2010-11-18  Gavin Barraclough  <barraclough@apple.com>
2667
2668         Reviewed by Oliver Hunt.
2669
2670         Bug 49708 - Stop recompiling functions to regenerate exception info.
2671
2672         Instead only hold info as necessary – keep divot info is the inspector
2673         is enabled, line number info is debugging or profiling, and handler
2674         info for functions with try/catch.
2675
2676         * bytecode/CodeBlock.cpp:
2677         (JSC::CodeBlock::dumpStatistics):
2678         (JSC::CodeBlock::CodeBlock):
2679         (JSC::CodeBlock::lineNumberForBytecodeOffset):
2680         (JSC::CodeBlock::expressionRangeForBytecodeOffset):
2681         (JSC::CodeBlock::shrinkToFit):
2682         * bytecode/CodeBlock.h:
2683         (JSC::CodeBlock::bytecodeOffset):
2684         (JSC::CodeBlock::addExpressionInfo):
2685         (JSC::CodeBlock::addLineInfo):
2686         (JSC::CodeBlock::hasExpressionInfo):
2687         (JSC::CodeBlock::hasLineInfo):
2688         (JSC::CodeBlock::needsCallReturnIndices):
2689         (JSC::CodeBlock::callReturnIndexVector):
2690         * bytecode/SamplingTool.cpp:
2691         (JSC::SamplingTool::dump):
2692         * bytecompiler/BytecodeGenerator.cpp:
2693         (JSC::BytecodeGenerator::generate):
2694         (JSC::BytecodeGenerator::BytecodeGenerator):
2695         * bytecompiler/BytecodeGenerator.h:
2696         (JSC::BytecodeGenerator::emitNode):
2697         (JSC::BytecodeGenerator::emitNodeInConditionContext):
2698         (JSC::BytecodeGenerator::emitExpressionInfo):
2699         (JSC::BytecodeGenerator::addLineInfo):
2700         * interpreter/Interpreter.cpp:
2701         (JSC::Interpreter::unwindCallFrame):
2702         (JSC::appendSourceToError):
2703         (JSC::Interpreter::throwException):
2704         (JSC::Interpreter::privateExecute):
2705         (JSC::Interpreter::retrieveLastCaller):
2706         * interpreter/Interpreter.h:
2707         * jit/JIT.cpp:
2708         (JSC::JIT::privateCompile):
2709         * jit/JITStubs.cpp:
2710         (JSC::jitThrow):
2711         (JSC::DEFINE_STUB_FUNCTION):
2712         * runtime/Collector.cpp:
2713         (JSC::Heap::markRoots):
2714         * runtime/Executable.cpp:
2715         (JSC::EvalExecutable::compileInternal):
2716         (JSC::ProgramExecutable::compileInternal):
2717         (JSC::FunctionExecutable::compileForCallInternal):
2718         (JSC::FunctionExecutable::compileForConstructInternal):
2719         * runtime/Executable.h:
2720         * runtime/JSGlobalData.cpp:
2721         (JSC::JSGlobalData::JSGlobalData):
2722         * runtime/JSGlobalData.h:
2723         (JSC::JSGlobalData::usingAPI):
2724         * runtime/JSGlobalObject.h:
2725         (JSC::JSGlobalObject::supportsRichSourceInfo):
2726         (JSC::JSGlobalObject::globalData):
2727
2728 2010-11-18  Adam Roben  <aroben@apple.com>
2729
2730         Add a script to delete manifest-related files when they are older than
2731         any .vsprops file
2732
2733         Changes to .vsprops files can cause the manifest files to become
2734         invalid, and Visual Studio doesn't always figure out that it needs to
2735         rebuild them.
2736
2737         Reviewed by Sam Weinig.
2738
2739         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
2740         Call the new script.
2741
2742         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj:
2743         Added the new script.
2744
2745         * JavaScriptCore.vcproj/JavaScriptCore/react-to-vsprops-changes.py: Added.
2746         (file_modification_times): Generator to return the modification time of
2747         each file in a directory hierarchy.
2748         (main): Get the modification time of the newest vsprops file, then find
2749         all manifest-related files in the obj directory. Delete all
2750         manifest-related files that are older than the newest vsprops file.
2751
2752 2010-11-18  Mark Rowe  <mrowe@apple.com>
2753
2754         Rubber-stamped by Adam Roben.
2755
2756         <rdar://problem/8602509&8602717&8602724> Enable compaction support.
2757
2758         * Configurations/JavaScriptCore.xcconfig:
2759
2760 2010-11-18  Gavin Barraclough  <barraclough@apple.com>
2761
2762         Reviewed by Oliver Hunt.
2763
2764         Bug 49635 - Profiler implementation is fragile
2765
2766         The profile presently requires the exception handling mechanism to explicitly
2767         remove all stack frames that are exited during the exception unwind mechanism.
2768         This is fragile in a number of ways:
2769           * We have to change bytecode register allocation when compiling code to run
2770             when profiling, to preserve the callee function (this is also required to
2771             call did_call after the call has returned).
2772           * In the JIT we have to maintain additional data structures
2773             (CodeBlock::RareData::m_functionRegisterInfos) to map back to the register
2774             containing the callee.
2775           * In the interpreter we use 'magic values' to offset into the instruction
2776             stream to rediscover the register containing the function.
2777
2778         Instead, move profiling into the head and tail of functions.
2779           * This correctly accounts the cost of the call itself to the caller.
2780           * This allows us to access the callee function object from the callframe.
2781           * This means that at the point a call is made we can track the stack depth
2782             on the ProfileNode.
2783           * When unwinding we can simply report the depth at which the exception is
2784             being handled - all call frames above this level are freed.
2785
2786         * bytecode/CodeBlock.cpp:
2787         (JSC::CodeBlock::shrinkToFit):
2788         * bytecode/CodeBlock.h:
2789         (JSC::CodeBlock::bytecodeOffset):
2790         (JSC::CodeBlock::methodCallLinkInfo):
2791         * bytecompiler/BytecodeGenerator.cpp:
2792         (JSC::BytecodeGenerator::emitCall):
2793         (JSC::BytecodeGenerator::emitCallVarargs):
2794         * interpreter/Interpreter.cpp:
2795         (JSC::Interpreter::unwindCallFrame):
2796         (JSC::Interpreter::throwException):
2797         (JSC::Interpreter::execute):
2798         (JSC::Interpreter::executeCall):
2799         (JSC::Interpreter::executeConstruct):
2800         (JSC::Interpreter::privateExecute):
2801         * jit/JITStubs.cpp:
2802         (JSC::DEFINE_STUB_FUNCTION):
2803         * profiler/Profile.cpp:
2804         (JSC::Profile::Profile):
2805         * profiler/ProfileGenerator.cpp:
2806         (JSC::ProfileGenerator::addParentForConsoleStart):
2807         (JSC::ProfileGenerator::willExecute):
2808         (JSC::ProfileGenerator::didExecute):
2809         (JSC::ProfileGenerator::exceptionUnwind):
2810         (JSC::ProfileGenerator::stopProfiling):
2811         * profiler/ProfileGenerator.h:
2812         * profiler/ProfileNode.cpp:
2813         (JSC::ProfileNode::ProfileNode):
2814         (JSC::ProfileNode::willExecute):
2815         * profiler/ProfileNode.h:
2816         (JSC::ProfileNode::create):
2817         (JSC::ProfileNode::callerCallFrame):
2818         * profiler/Profiler.cpp:
2819         (JSC::dispatchFunctionToProfiles):
2820         (JSC::Profiler::_willExecute):
2821         (JSC::Profiler::_didExecute):
2822         (JSC::Profiler::exceptionUnwind):
2823         * profiler/Profiler.h:
2824
2825 2010-11-18  Steve Falkenburg  <sfalken@apple.com>
2826
2827         Reviewed by Adam Roben.
2828
2829         Remove leftover Windows Debug_Internal configurations
2830         https://bugs.webkit.org/show_bug.cgi?id=49758
2831
2832         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2833         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
2834         * JavaScriptCore.vcproj/jsc/jsc.vcproj:
2835         * JavaScriptCore.vcproj/testapi/testapi.vcproj:
2836
2837 2010-11-18  Chao-ying Fu  <fu@mips.com>
2838
2839         Reviewed by Csaba Osztrogonác.
2840
2841         Avoid increasing required alignment of target type warning
2842         https://bugs.webkit.org/show_bug.cgi?id=43963
2843
2844         * runtime/UString.h:
2845         (JSC::UStringHash::equal):
2846         * wtf/StdLibExtras.h:
2847
2848 2010-11-17  Sam Weinig  <sam@webkit.org>
2849
2850         Reviewed by Anders Carlsson.
2851
2852         Add stubbed out ScrollAnimator for the Mac
2853         https://bugs.webkit.org/show_bug.cgi?id=49678
2854
2855         * wtf/Platform.h: Enable SMOOTH_SCROLLING on the Mac, this has no
2856         change in behavior at the moment.
2857
2858 2010-11-17  David Kilzer  <ddkilzer@apple.com>
2859
2860         <http://webkit.org/b/49634> Make overflow guards in WTF::String::utf8 explicit
2861
2862         Reviewed by Darin Adler.
2863
2864         Add an explicit overflow check prior to allocating our buffer,
2865         rather than implicitly relying on the guard in convertUTF16ToUTF8.
2866
2867         * wtf/text/WTFString.cpp:
2868         (WTF::String::utf8):
2869
2870 2010-11-17  Sheriff Bot  <webkit.review.bot@gmail.com>
2871
2872         Unreviewed, rolling out r72197.
2873         http://trac.webkit.org/changeset/72197
2874         https://bugs.webkit.org/show_bug.cgi?id=49661
2875
2876         broke fast/regex/test1.html (Requested by stampho on #webkit).
2877
2878         * runtime/JSGlobalData.h:
2879         * runtime/RegExp.cpp:
2880         (JSC::RegExpRepresentation::~RegExpRepresentation):
2881         (JSC::RegExp::compile):
2882         (JSC::RegExp::match):
2883         * tests/mozilla/expected.html:
2884         * wtf/Platform.h:
2885         * yarr/RegexCompiler.cpp:
2886         * yarr/RegexCompiler.h:
2887         * yarr/RegexInterpreter.cpp:
2888         * yarr/RegexInterpreter.h:
2889         * yarr/RegexJIT.cpp:
2890         (JSC::Yarr::jitCompileRegex):
2891         * yarr/RegexJIT.h:
2892         (JSC::Yarr::RegexCodeBlock::RegexCodeBlock):
2893         (JSC::Yarr::RegexCodeBlock::~RegexCodeBlock):
2894         (JSC::Yarr::RegexCodeBlock::getFallback):
2895         (JSC::Yarr::RegexCodeBlock::setFallback):
2896         (JSC::Yarr::executeRegex):
2897         * yarr/RegexParser.h:
2898         * yarr/RegexPattern.h:
2899
2900 2010-11-17  Peter Varga  <pvarga@inf.u-szeged.hu>
2901
2902         Reviewed by Gavin Barraclough.
2903
2904         YARR JIT should fallback to YARR Interpreter instead of PCRE.
2905         https://bugs.webkit.org/show_bug.cgi?id=46719
2906
2907         Remove the ENABLE_YARR macro and the option of matching regular
2908         expressions with PCRE from JavaScriptCore.
2909
2910         * runtime/JSGlobalData.h:
2911         * runtime/RegExp.cpp:
2912         (JSC::RegExp::compile):
2913         (JSC::RegExp::match):
2914         * tests/mozilla/expected.html:
2915         * wtf/Platform.h:
2916         * yarr/RegexCompiler.cpp:
2917         * yarr/RegexCompiler.h:
2918         * yarr/RegexInterpreter.cpp:
2919         (JSC::Yarr::byteCompileRegex):
2920         * yarr/RegexInterpreter.h:
2921         * yarr/RegexJIT.cpp:
2922         (JSC::Yarr::jitCompileRegex):
2923         * yarr/RegexJIT.h:
2924         (JSC::Yarr::RegexCodeBlock::RegexCodeBlock):
2925         (JSC::Yarr::RegexCodeBlock::~RegexCodeBlock):
2926         (JSC::Yarr::RegexCodeBlock::getFallback):
2927         (JSC::Yarr::RegexCodeBlock::isFallback):
2928         (JSC::Yarr::RegexCodeBlock::setFallback):
2929         (JSC::Yarr::executeRegex):
2930         * yarr/RegexParser.h:
2931         * yarr/RegexPattern.h:
2932
2933 2010-11-17  Peter Varga  <pvarga@inf.u-szeged.hu>
2934
2935         Reviewed by Gavin Barraclough.
2936
2937         Extend YARR Interpreter with beginning character look-up optimization
2938         https://bugs.webkit.org/show_bug.cgi?id=45751
2939
2940         Add beginning character look-up optimization which sets the start
2941         index to the first possible successful pattern match.
2942         Extend YARR Interpreter with lookupForBeginChars function which
2943         implements the beginning character look-up optimization.
2944
2945         * yarr/RegexInterpreter.cpp:
2946         (JSC::Yarr::Interpreter::InputStream::readPair):
2947         (JSC::Yarr::Interpreter::InputStream::isNotAvailableInput):
2948         (JSC::Yarr::Interpreter::lookupForBeginChars):
2949         (JSC::Yarr::Interpreter::matchDisjunction):
2950         (JSC::Yarr::Interpreter::interpret):
2951         * yarr/RegexInterpreter.h:
2952         (JSC::Yarr::BytecodePattern::BytecodePattern):
2953
2954 2010-11-17  Alexis Menard  <alexis.menard@nokia.com>, Simon Hausmann  <simon.hausmann@nokia.com>
2955
2956         Reviewed by Kenneth Christiansen, Tor Arne Vestbø.
2957
2958         [Qt] Add support for use GStreamer with the Qt build
2959
2960         Enable the build/inclusion of the wtf/QObject convenience classes.
2961
2962         * JavaScriptCore.pri:
2963         * wtf/wtf.pri:
2964
2965 2010-11-17  Peter Varga  <pvarga@inf.u-szeged.hu>
2966
2967         Reviewed by Gavin Barraclough.
2968
2969         Collect the beginning characters in a RegExp pattern for look-up
2970         optimization
2971         https://bugs.webkit.org/show_bug.cgi?id=45748
2972
2973         Extend the YARR's parser with an algorithm which collects the potential
2974         beginning characters from a RegExp pattern for later look-up optimization.
2975
2976         * yarr/RegexCompiler.cpp:
2977         (JSC::Yarr::BeginCharHelper::BeginCharHelper):
2978         (JSC::Yarr::BeginCharHelper::addBeginChar):
2979         (JSC::Yarr::BeginCharHelper::merge):
2980         (JSC::Yarr::BeginCharHelper::addCharacter):
2981         (JSC::Yarr::BeginCharHelper::linkHotTerms):
2982         (JSC::Yarr::RegexPatternConstructor::RegexPatternConstructor):
2983         (JSC::Yarr::RegexPatternConstructor::addBeginTerm):
2984         (JSC::Yarr::RegexPatternConstructor::setupDisjunctionBeginTerms):
2985         (JSC::Yarr::RegexPatternConstructor::setupAlternativeBeginTerms):
2986         (JSC::Yarr::RegexPatternConstructor::setupBeginChars):
2987         (JSC::Yarr::compileRegex):
2988         * yarr/RegexPattern.h:
2989         (JSC::Yarr::TermChain::TermChain):
2990         (JSC::Yarr::BeginChar::BeginChar):
2991         (JSC::Yarr::RegexPattern::RegexPattern):
2992         (JSC::Yarr::RegexPattern::reset):
2993
2994 2010-11-17  Sheriff Bot  <webkit.review.bot@gmail.com>
2995
2996         Unreviewed, rolling out r72160.
2997         http://trac.webkit.org/changeset/72160
2998         https://bugs.webkit.org/show_bug.cgi?id=49646
2999
3000         Broke lots of fast/profiler tests, among others (Requested by
3001         aroben on #webkit).
3002
3003         * bytecode/CodeBlock.cpp:
3004         (JSC::CodeBlock::dump):
3005         (JSC::CodeBlock::functionRegisterForBytecodeOffset):
3006         (JSC::CodeBlock::shrinkToFit):
3007         * bytecode/CodeBlock.h:
3008         (JSC::CodeBlock::addFunctionRegisterInfo):
3009         * bytecode/Opcode.h:
3010         * bytecompiler/BytecodeGenerator.cpp:
3011         (JSC::BytecodeGenerator::BytecodeGenerator):
3012         (JSC::BytecodeGenerator::emitCall):
3013         (JSC::BytecodeGenerator::emitCallVarargs):
3014         (JSC::BytecodeGenerator::emitReturn):
3015         (JSC::BytecodeGenerator::emitConstruct):
3016         * bytecompiler/BytecodeGenerator.h:
3017         (JSC::CallArguments::profileHookRegister):
3018         * bytecompiler/NodesCodegen.cpp:
3019         (JSC::CallArguments::CallArguments):
3020         * interpreter/Interpreter.cpp:
3021         (JSC::Interpreter::unwindCallFrame):
3022         (JSC::Interpreter::throwException):
3023         (JSC::Interpreter::execute):
3024         (JSC::Interpreter::executeCall):
3025         (JSC::Interpreter::executeConstruct):
3026         (JSC::Interpreter::privateExecute):
3027         * jit/JIT.cpp:
3028         (JSC::JIT::privateCompileMainPass):
3029         * jit/JIT.h:
3030         * jit/JITOpcodes.cpp:
3031         (JSC::JIT::emit_op_profile_will_call):
3032         (JSC::JIT::emit_op_profile_did_call):
3033         * jit/JITOpcodes32_64.cpp:
3034         (JSC::JIT::emit_op_profile_will_call):
3035         (JSC::JIT::emit_op_profile_did_call):
3036         * jit/JITStubs.cpp:
3037         (JSC::DEFINE_STUB_FUNCTION):
3038         * jit/JITStubs.h:
3039         * profiler/Profile.cpp:
3040         (JSC::Profile::Profile):
3041         * profiler/ProfileGenerator.cpp:
3042         (JSC::ProfileGenerator::addParentForConsoleStart):
3043         (JSC::ProfileGenerator::willExecute):
3044         (JSC::ProfileGenerator::didExecute):
3045         (JSC::ProfileGenerator::stopProfiling):
3046         * profiler/ProfileGenerator.h:
3047         * profiler/ProfileNode.cpp:
3048         (JSC::ProfileNode::ProfileNode):
3049         (JSC::ProfileNode::willExecute):
3050         * profiler/ProfileNode.h:
3051         (JSC::ProfileNode::create):
3052         (JSC::ProfileNode::operator==):
3053         * profiler/Profiler.cpp:
3054         (JSC::dispatchFunctionToProfiles):
3055         (JSC::Profiler::willExecute):
3056         (JSC::Profiler::didExecute):
3057         * profiler/Profiler.h:
3058
3059 2010-11-16  Gavin Barraclough  <barraclough@apple.com>
3060
3061         Reviewed by Sam Weinig.
3062
3063         Bug 49635 - Profiler implementation is fragile
3064
3065         The profile presently requires the exception handling mechanism to explicitly
3066         remove all stack frames that are exited during the exception unwind mechanism.
3067         This is fragile in a number of ways:
3068           * We have to change bytecode register allocation when compiling code to run
3069             when profiling, to preserve the callee function (this is also required to
3070             call did_call after the call has returned).
3071           * In the JIT we have to maintain additional data structures
3072             (CodeBlock::RareData::m_functionRegisterInfos) to map back to the register
3073             containing the callee.
3074           * In the interpreter we use 'magic values' to offset into the instruction
3075             stream to rediscover the register containing the function.
3076
3077         Instead, move profiling into the head and tail of functions.
3078           * This correctly accounts the cost of the call itself to the caller.
3079           * This allows us to access the callee function object from the callframe.
3080           * This means that at the point a call is made we can track the stack depth
3081             on the ProfileNode.
3082           * When unwinding we can simply report the depth at which the exception is
3083             being handled - all call frames above this level are freed.
3084
3085         * JavaScriptCore.xcodeproj/project.pbxproj:
3086         * bytecode/CodeBlock.cpp:
3087         (JSC::CodeBlock::dump):
3088         (JSC::CodeBlock::shrinkToFit):
3089         * bytecode/CodeBlock.h:
3090         (JSC::CodeBlock::bytecodeOffset):
3091         (JSC::CodeBlock::methodCallLinkInfo):
3092         * bytecode/Opcode.h:
3093         * bytecompiler/BytecodeGenerator.cpp:
3094         (JSC::BytecodeGenerator::BytecodeGenerator):
3095         (JSC::BytecodeGenerator::emitCall):
3096         (JSC::BytecodeGenerator::emitCallVarargs):
3097         (JSC::BytecodeGenerator::emitReturn):
3098         (JSC::BytecodeGenerator::emitConstruct):
3099         * bytecompiler/BytecodeGenerator.h:
3100         (JSC::CallArguments::count):
3101         * bytecompiler/NodesCodegen.cpp:
3102         (JSC::CallArguments::CallArguments):
3103         * interpreter/Interpreter.cpp:
3104         (JSC::ProfileHostCall::ProfileHostCall):
3105         (JSC::ProfileHostCall::~ProfileHostCall):
3106         (JSC::Interpreter::unwindCallFrame):
3107         (JSC::Interpreter::throwException):
3108         (JSC::Interpreter::execute):
3109         (JSC::Interpreter::executeCall):
3110         (JSC::Interpreter::executeConstruct):
3111         (JSC::Interpreter::privateExecute):
3112         * jit/JIT.cpp:
3113         (JSC::JIT::privateCompileMainPass):
3114         * jit/JIT.h:
3115         * jit/JITOpcodes.cpp:
3116         (JSC::JIT::emit_op_profile_has_called):
3117         (JSC::JIT::emit_op_profile_will_return):
3118         * jit/JITOpcodes32_64.cpp:
3119         (JSC::JIT::emit_op_profile_has_called):
3120         (JSC::JIT::emit_op_profile_will_return):
3121         * jit/JITStubs.cpp:
3122         (JSC::DEFINE_STUB_FUNCTION):
3123         * jit/JITStubs.h:
3124         * profiler/Profile.cpp:
3125         (JSC::Profile::Profile):
3126         * profiler/ProfileGenerator.cpp:
3127         (JSC::ProfileGenerator::addParentForConsoleStart):
3128         (JSC::ProfileGenerator::willExecute):
3129         (JSC::ProfileGenerator::didExecute):
3130         (JSC::ProfileGenerator::exceptionUnwind):
3131         (JSC::ProfileGenerator::stopProfiling):
3132         * profiler/ProfileGenerator.h:
3133         * profiler/ProfileNode.cpp:
3134         (JSC::ProfileNode::ProfileNode):
3135         (JSC::ProfileNode::willExecute):
3136         * profiler/ProfileNode.h:
3137         (JSC::ProfileNode::create):
3138         (JSC::ProfileNode::operator==):
3139         (JSC::ProfileNode::exec):
3140         * profiler/Profiler.cpp:
3141         (JSC::dispatchFunctionToProfiles):
3142         (JSC::Profiler::hasCalled):
3143         (JSC::Profiler::willEvaluate):
3144         (JSC::Profiler::willReturn):
3145         (JSC::Profiler::didEvaluate):
3146         (JSC::Profiler::exceptionUnwind):
3147         * profiler/Profiler.h:
3148
3149 2010-11-16  Brian Weinstein  <bweinstein@apple.com>
3150
3151         Reviewed by Adam Roben and Steve Falkenburg.
3152
3153         Touch Platform.h to force a rebuild for Windows.
3154
3155         * wtf/Platform.h:
3156
3157 2010-11-16  Steve Falkenburg  <sfalken@apple.com>
3158
3159         Reviewed by Adam Roben.
3160
3161         Disable LTCG for Windows Release builds. Add new Release_LTCG configuration.
3162         https://bugs.webkit.org/show_bug.cgi?id=49632
3163
3164         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3165         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
3166         * JavaScriptCore.vcproj/jsc/jsc.vcproj:
3167         * JavaScriptCore.vcproj/testapi/testapi.vcproj:
3168
3169 2010-11-16  Peter Varga  <pvarga@inf.u-szeged.hu>
3170
3171         Reviewed by Gavin Barraclough.
3172
3173         The number of recursive match calls isn't limited in YARR Interpreter
3174         https://bugs.webkit.org/show_bug.cgi?id=47906
3175
3176         Check the number of the matchDisjunction recursive calls to avoid unbounded
3177         recursion.
3178         Now the matchDisjunction function returns JSRegExpResult instead of bool.
3179         The JSRegExpResult enum contains the result of matching or the error code
3180         of the failure (like HitLimit) which terminates the matching.
3181         The error codes are based on pcre's jsRegExpExecute error codes.
3182
3183         * yarr/RegexInterpreter.cpp:
3184         (JSC::Yarr::Interpreter::parenthesesDoBacktrack):
3185         (JSC::Yarr::Interpreter::matchParentheses):
3186         (JSC::Yarr::Interpreter::backtrackParentheses):
3187         (JSC::Yarr::Interpreter::matchDisjunction):
3188         (JSC::Yarr::Interpreter::matchNonZeroDisjunction):
3189         (JSC::Yarr::Interpreter::interpret):
3190         (JSC::Yarr::Interpreter::Interpreter):
3191         * yarr/RegexInterpreter.h:
3192
3193 2010-11-16  Brian Weinstein  <bweinstein@apple.com>
3194
3195         Rest of the Windows build fix.
3196
3197         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3198
3199 2010-11-16  Gavin Barraclough  <barraclough@apple.com>
3200
3201         Windows build fix pt 1.
3202
3203         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3204
3205 2010-11-16  Gavin Barraclough  <barraclough@apple.com>
3206
3207         Reviewed by Oliver Hunt.
3208
3209         https://bugs.webkit.org/show_bug.cgi?id=49606
3210
3211         The bug here is that we read the prototype from the RHS argument using a regular
3212         op_get_by_id before op_instanceof has checked that this is an object implementing
3213         HasInstance. This incorrect behaviour gives rise to further unnecessary complexity
3214         in the code base, since we have additional logic (implemented using the
3215         GetByIdExceptionInfo data structures on CodeBlock) to convert not an object errors
3216         from the get_by_id into invalid parameter errors. Having fixed this bug this code
3217         is all redundant, since in these cases the get_by_id will never have been reached.
3218
3219         * bytecode/CodeBlock.cpp:
3220         (JSC::CodeBlock::dump):
3221         (JSC::CodeBlock::shrinkToFit):
3222         * bytecode/CodeBlock.h:
3223         (JSC::CodeBlock::addExpressionInfo):
3224         * bytecode/Opcode.h:
3225         * bytecompiler/BytecodeGenerator.cpp:
3226         (JSC::BytecodeGenerator::BytecodeGenerator):
3227         (JSC::BytecodeGenerator::emitCheckHasInstance):
3228         * bytecompiler/BytecodeGenerator.h:
3229         * bytecompiler/NodesCodegen.cpp:
3230         (JSC::InstanceOfNode::emitBytecode):
3231         * interpreter/Interpreter.cpp:
3232         (JSC::Interpreter::throwException):
3233         (JSC::Interpreter::privateExecute):
3234         * jit/JIT.cpp:
3235         (JSC::JIT::privateCompileMainPass):
3236         (JSC::JIT::privateCompileSlowCases):
3237         * jit/JIT.h:
3238         * jit/JITOpcodes.cpp:
3239         (JSC::JIT::emit_op_check_has_instance):
3240         (JSC::JIT::emit_op_instanceof):
3241         (JSC::JIT::emitSlow_op_check_has_instance):
3242         (JSC::JIT::emitSlow_op_instanceof):
3243         * jit/JITOpcodes32_64.cpp:
3244         (JSC::JIT::emit_op_check_has_instance):
3245         (JSC::JIT::emit_op_instanceof):
3246         (JSC::JIT::emitSlow_op_check_has_instance):
3247         (JSC::JIT::emitSlow_op_instanceof):
3248         * jit/JITStubs.cpp:
3249         (JSC::DEFINE_STUB_FUNCTION):
3250         * jit/JITStubs.h:
3251         * runtime/ExceptionHelpers.cpp:
3252         (JSC::createInterruptedExecutionException):
3253         (JSC::createTerminatedExecutionException):
3254         (JSC::createUndefinedVariableError):
3255         (JSC::createNotAFunctionError):
3256         (JSC::createNotAnObjectError):
3257         * runtime/ExceptionHelpers.h:
3258         * runtime/JSGlobalData.cpp:
3259         (JSC::JSGlobalData::JSGlobalData):
3260         * runtime/JSGlobalData.h:
3261         * runtime/JSNotAnObject.cpp:
3262         (JSC::JSNotAnObject::toPrimitive):
3263         (JSC::JSNotAnObject::getPrimitiveNumber):
3264         (JSC::JSNotAnObject::toBoolean):
3265         (JSC::JSNotAnObject::toNumber):
3266         (JSC::JSNotAnObject::toString):
3267         (JSC::JSNotAnObject::toObject):
3268         (JSC::JSNotAnObject::getOwnPropertySlot):
3269         (JSC::JSNotAnObject::getOwnPropertyDescriptor):
3270         (JSC::JSNotAnObject::put):
3271         (JSC::JSNotAnObject::deleteProperty):
3272         (JSC::JSNotAnObject::getOwnPropertyNames):
3273         * runtime/JSNotAnObject.h:
3274         (JSC::JSNotAnObject::JSNotAnObject):
3275         * runtime/JSObject.h:
3276         (JSC::JSObject::isActivationObject):
3277         * runtime/JSValue.cpp:
3278         (JSC::JSValue::toObjectSlowCase):
3279         (JSC::JSValue::synthesizeObject):
3280         (JSC::JSValue::synthesizePrototype):
3281
3282 2010-11-15  Darin Adler  <darin@apple.com>
3283
3284         Reviewed by Sam Weinig.
3285
3286         Harden additional string functions against large lengths
3287         https://bugs.webkit.org/show_bug.cgi?id=49574
3288
3289         * wtf/text/CString.cpp:
3290         (WTF::CString::init): Check for length that is too large for CString.
3291         (WTF::CString::newUninitialized): Ditto.
3292         (WTF::CString::copyBufferIfNeeded): Fix types so the length stays
3293         in a size_t.
3294
3295         * wtf/text/WTFString.cpp:
3296         (WTF::String::append): Check for length that is too large.
3297
3298 2010-11-15  Gavin Barraclough  <barraclough@apple.com>
3299
3300         Reviewed by Sam Weinig.
3301
3302         Bug 49577 - Function.prototype should be non-configurable
3303
3304         JSC lazily allocates the prototype property of Function objects.
3305
3306         We check the prototype exists on 'get', but not on 'put'.
3307         If you 'put' without having first done a 'get' you can end up with a configurable
3308         prototype (prototype should only ever be non-configurable).
3309
3310         This is visible in a couple of ways:
3311           * 'delete' on the property may succeed. (the next access will result in a new,
3312           reset prototype object).
3313           * the prototype may be set to a getter.
3314
3315         * runtime/JSFunction.cpp:
3316         (JSC::JSFunction::getOwnPropertyNames):
3317             Reify the prototype property before allowing an enumerate including don't enum properties.
3318         (JSC::JSFunction::put):
3319             Reify the prototype property before any put to it.
3320
3321 2010-11-15  Gavin Barraclough  <barraclough@apple.com>
3322
3323         Reviewed by Geoff Garen.
3324
3325         Bug 49488 - Only add source specific information to exceptions in Interpreter::throwException
3326
3327         Three types of source location information are added to errors.
3328
3329         (1) Divot information.
3330
3331         This was added with the intention of using it to provide better source highlighting in the inspector.
3332         We may still want to do so, but we probably should not be exposing these values in a manner visible to
3333         user scripts – only through an internal C++ interface. The code adding divot properties to objects has
3334         been removed.
3335
3336         (2) Line number information.
3337
3338         Line number information is presently sometimes added at the point the exception is created, and sometimes
3339         added at the point the exception passes through throwException. Change this so that throwException has
3340         the sole responsibility for adding line number and source file information.
3341
3342         (3) Source snippets in the message of certain type errors (e.g. 'doc' in `Result of expression 'doc' [undefined] is not an object.`).
3343
3344         These messages are currently created at the point the exceptions is raised. Instead reformat the message
3345         such that the source snippet is located at the end (`Result of expression 'b1' [undefined] is not an object.`
3346         becomes `'undefined' is not an object (evaluating 'b1.property')`), and append these to the message at
3347         the in throw Exception. This presents a number of advantages:
3348           * we no longer need to have source location information to create these TypeErrors.
3349           * we can chose to append source location information in other error messages, including those where
3350             passing source location to the point of construction would be inconvenient.
3351           * we can chose in future to omit to append source location information when running in a non-debug mode.
3352
3353         This also cleans up some error output, e.g. removing double brackets ('[[]]') around objects in output,
3354         removing double periods (..) at end of lines, and adding slightly more context to some errors.
3355
3356         * bytecode/CodeBlock.cpp:
3357         (JSC::CodeBlock::expressionRangeForBytecodeOffset):
3358             - Separated called to access line and range information.
3359
3360         * bytecode/CodeBlock.h:
3361             - Separated called to access line and range information.
3362
3363         * interpreter/Interpreter.cpp:
3364         (JSC::Interpreter::resolve):
3365         (JSC::Interpreter::resolveSkip):
3366         (JSC::Interpreter::resolveGlobal):
3367         (JSC::Interpreter::resolveGlobalDynamic):
3368         (JSC::Interpreter::resolveBaseAndProperty):
3369         (JSC::isInvalidParamForIn):
3370         (JSC::isInvalidParamForInstanceOf):
3371             - Update parameters passed to error constructors.
3372         (JSC::appendSourceToError):
3373             - Update message property to add location information (previously added in createErrorMessage, in ExceptionHelpers)
3374         (JSC::Interpreter::throwException):
3375             - Updated to call appendSourceToError. 
3376         (JSC::Interpreter::privateExecute):
3377             - Update parameters passed to error constructors.
3378
3379         * jit/JITStubs.cpp:
3380         (JSC::DEFINE_STUB_FUNCTION):
3381             - Update parameters passed to error constructors.
3382
3383         * runtime/Error.cpp:
3384         (JSC::addErrorInfo):
3385         (JSC::hasErrorInfo):
3386             - Removed divot properties.
3387
3388         * runtime/Error.h:
3389             - Removed divot properties.
3390
3391         * runtime/ErrorInstance.cpp:
3392         (JSC::ErrorInstance::ErrorInstance):
3393             - Initialize new property.
3394
3395         * runtime/ErrorInstance.h:
3396         (JSC::ErrorInstance::appendSourceToMessage):
3397         (JSC::ErrorInstance::setAppendSourceToMessage):
3398         (JSC::ErrorInstance::clearAppendSourceToMessage):
3399             - Added flag to check for errors needing location information appending.
3400         (JSC::ErrorInstance::isErrorInstance):
3401             - Added virtual method to check for ErrorInstances.
3402
3403         * runtime/ExceptionHelpers.cpp:
3404         (JSC::createUndefinedVariableError):
3405         (JSC::createInvalidParamError):
3406         (JSC::createNotAConstructorError):
3407         (JSC::createNotAFunctionError):
3408         (JSC::createNotAnObjectError):
3409             - Update parameters passed to error constructors, stopped adding line number information early, changed TypeError messages.
3410
3411         * runtime/ExceptionHelpers.h:
3412             - Updated function signatures.
3413
3414         * runtime/JSFunction.cpp:
3415         (JSC::callHostFunctionAsConstructor):
3416             - Update parameters passed to error constructors.
3417
3418         * runtime/JSObject.h:
3419         (JSC::JSObject::isErrorInstance):
3420             - Added virtual method to check for ErrorInstances.
3421
3422 2010-11-12  Anders Carlsson  <andersca@apple.com>
3423
3424         Reviewed by Adam Roben.
3425
3426         CString(const char*) crashes when passed a null pointer
3427         https://bugs.webkit.org/show_bug.cgi?id=49450
3428
3429         * wtf/text/CString.cpp:
3430         (WTF::CString::CString):
3431         Return early if str is null.
3432
3433 2010-11-11  Gavin Barraclough  <barraclough@apple.com>
3434
3435         Reviewed by Oliver Hunt.
3436
3437         Bug 49420 - Clean up syntax/reference error throw.
3438
3439         Some errors detected at compile time are thrown at runtime. We currently do so using a op_new_error/op_throw bytecode pair.
3440         This is not ideal. op_throw is used for explicit user throw statements, and has different requirements in terms or meta data
3441         attached to the exception (controlled by the explicitThrow parameter passed to Interpreter::throwException). To work around
3442         this, op_new_error has to add the meta data at an early stage, which is unlike other VM exceptions being raised.
3443
3444         We can simplify this and bring into line with other exception behaviour by changing new_error from just allocating an
3445         Exception instance to also throwing it – but as a regular VM throw, correctly passing explicitThrow as false.
3446
3447         * JavaScriptCore.xcodeproj/project.pbxproj:
3448         * bytecode/CodeBlock.cpp:
3449         (JSC::CodeBlock::dump):
3450         (JSC::CodeBlock::expressionRangeForBytecodeOffset):
3451         * bytecode/Opcode.h:
3452         * bytecompiler/BytecodeGenerator.cpp:
3453         (JSC::BytecodeGenerator::emitThrowReferenceError):
3454         (JSC::BytecodeGenerator::emitThrowSyntaxError):
3455         (JSC::BytecodeGenerator::emitThrowExpressionTooDeepException):
3456         * bytecompiler/BytecodeGenerator.h:
3457         (JSC::BytecodeGenerator::emitNodeInConditionContext):
3458         * bytecompiler/NodesCodegen.cpp:
3459         (JSC::ThrowableExpressionData::emitThrowReferenceError):
3460         (JSC::ThrowableExpressionData::emitThrowSyntaxError):
3461         (JSC::RegExpNode::emitBytecode):
3462         (JSC::PostfixErrorNode::emitBytecode):
3463         (JSC::PrefixErrorNode::emitBytecode):
3464         (JSC::AssignErrorNode::emitBytecode):
3465         (JSC::ForInNode::emitBytecode):
3466         (JSC::ContinueNode::emitBytecode):
3467         (JSC::BreakNode::emitBytecode):
3468         (JSC::ReturnNode::emitBytecode):
3469         (JSC::LabelNode::emitBytecode):
3470         * interpreter/Interpreter.cpp:
3471         (JSC::Interpreter::privateExecute):
3472         * jit/JIT.cpp:
3473         (JSC::JIT::privateCompileMainPass):
3474         * jit/JIT.h:
3475         * jit/JITOpcodes.cpp:
3476         (JSC::JIT::emit_op_throw_reference_error):
3477         (JSC::JIT::emit_op_throw_syntax_error):
3478         * jit/JITOpcodes32_64.cpp:
3479         (JSC::JIT::emit_op_throw_reference_error):
3480         (JSC::JIT::emit_op_throw_syntax_error):
3481         * jit/JITStubs.cpp:
3482         (JSC::DEFINE_STUB_FUNCTION):
3483         * jit/JITStubs.h:
3484         * parser/Nodes.h:
3485
3486 2010-11-11  Darin Adler  <darin@apple.com>
3487
3488         Reviewed by Sam Weinig.
3489
3490         Harden some string functions against large lengths
3491         https://bugs.webkit.org/show_bug.cgi?id=49293
3492
3493         * wtf/text/StringImpl.cpp:
3494         (WTF::StringImpl::create): Fix incorrect use of PassRefPtr. Check for
3495         strlen results that are too large for StringImpl.
3496         (WTF::StringImpl::lower): Check for lengths that are too large for
3497         int32_t.
3498         (WTF::StringImpl::upper): Fix incorrect use of PassRefPtr. Check for
3499         lengths that are too large for int32_t.
3500         (WTF::StringImpl::secure): Fix incorect use of PassRefPtr. Use unsigned
3501         rather than int and int32_t so we can handle any length.
3502         (WTF::StringImpl::foldCase): Fix incorrect use of PassRefPtr. Check for
3503         lengths that are too large for int32_t.
3504         (WTF::StringImpl::find): Check for strlen results that are too large for
3505         StringImpl.
3506         (WTF::StringImpl::findIgnoringCase): Ditto.
3507         (WTF::StringImpl::replace): Fix incorrect use of PassRefPtr.
3508         (WTF::StringImpl::createWithTerminatingNullCharacter): Check before
3509         incrementing length.
3510
3511 2010-11-11  Dan Horák  <dan@danny.cz>
3512