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