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