64ad0681ea5c1902ea0952a0ce7e9eded5defe6d
[WebKit-https.git] / JavaScriptCore / ChangeLog
1 2010-12-01  Geoffrey Garen  <ggaren@apple.com>
2
3         Try to fix the GTK build.
4
5         * GNUmakefile.am: Added OSAllocator to another project.
6
7 2010-12-01  Geoffrey Garen  <ggaren@apple.com>
8
9         Try to fix the GTK Linux build.
10
11         * JavaScriptCore.gypi: Added OSAllocator to the project.
12
13 2010-12-01  Geoffrey Garen  <ggaren@apple.com>
14
15         Try to fix the Qt Linux build.
16
17         * wtf/OSAllocatorPosix.cpp: Use the right errno.h.
18
19 2010-12-01  Geoffrey Garen  <ggaren@apple.com>
20
21         Try to fix Windows build: export some more symbols.
22
23         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
24
25 2010-12-01  Geoffrey Garen  <ggaren@apple.com>
26
27         Try to fix the Qt Linux build.
28
29         * wtf/wtf.pri: Use the POSIX OSAllocator for Qt Linux.
30
31 2010-12-01  Geoffrey Garen  <ggaren@apple.com>
32
33         Windows build fix: commit doesn't have a return value.
34
35         * wtf/OSAllocatorWin.cpp:
36         (WTF::OSAllocator::commit):
37
38 2010-12-01  Geoffrey Garen  <ggaren@apple.com>
39
40         Build fix: Export some symbols.
41
42         * JavaScriptCore.exp:
43
44 2010-12-01  Geoffrey Garen  <ggaren@apple.com>
45
46         Build fix.
47
48         * JavaScriptCore.xcodeproj/project.pbxproj: Export OSAllocator.h as private
49         so other projects can see it.
50
51         * wtf/OSAllocatorPosix.cpp: #include UnusedParam.h for UNUSED_PARAM.
52
53 2010-12-01  Geoffrey Garen  <ggaren@apple.com>
54
55         Reviewed by Sam Weinig.
56
57         Baby step toward a cross-platform virtual memory abstraction: created
58         an all-static OSAllocator class and changed MarkStack to use it.
59
60         * JavaScriptCore.exp: These functions are inlined now.
61
62         * JavaScriptCore.vcproj/WTF/WTF.vcproj: Added OSAllocatorWin.cpp.
63
64         * JavaScriptCore.xcodeproj/project.pbxproj: Added OSAllocatorPosix.cpp.
65
66         * runtime/MarkStack.h:
67         (JSC::MarkStack::allocateStack):
68         (JSC::MarkStack::releaseStack): Use OSAllocator instead of rolling our
69         own platform-specific code.
70
71         * runtime/MarkStackNone.cpp: Removed. Nothing used this.
72
73         * runtime/MarkStackPosix.cpp: 
74         * runtime/MarkStackSymbian.cpp:
75         * runtime/MarkStackWin.cpp: Removed custom platform-specific code, since
76         we use the OSAllocator abstraction now.
77
78         * wtf/OSAllocator.h: Added.
79         * wtf/OSAllocatorPosix.cpp: Added.
80         (WTF::OSAllocator::reserve):
81         (WTF::OSAllocator::reserveAndCommit):
82         (WTF::OSAllocator::commit):
83         (WTF::OSAllocator::decommit):
84         (WTF::OSAllocator::release):
85         * wtf/OSAllocatorSymbian.cpp: Added.
86         (WTF::OSAllocator::reserve):
87         (WTF::OSAllocator::reserveAndCommit):
88         (WTF::OSAllocator::commit):
89         (WTF::OSAllocator::decommit):
90         (WTF::OSAllocator::release):
91         * wtf/OSAllocatorWin.cpp: Added.
92         (WTF::OSAllocator::reserve):
93         (WTF::OSAllocator::reserveAndCommit):
94         (WTF::OSAllocator::commit):
95         (WTF::OSAllocator::decommit):
96         (WTF::OSAllocator::release): The new OSAllocator abstraction.
97
98         * wtf/wtf.pri: Added OSAllocatorSymbian.cpp.
99
100 2010-12-01  Steve Falkenburg  <sfalken@apple.com>
101
102         Reviewed by Adam Roben.
103
104         WinCairo build should not use link-time code generation (LTCG)
105         https://bugs.webkit.org/show_bug.cgi?id=50353
106
107         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
108         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
109         * JavaScriptCore.vcproj/jsc/jsc.vcproj:
110         * JavaScriptCore.vcproj/testapi/testapi.vcproj:
111
112 010-12-01  Steve Falkenburg  <sfalken@apple.com>
113
114         Reviewed by Adam Roben.
115
116         vcproj changes can't be applied cleanly by the Windows EWS bot
117         https://bugs.webkit.org/show_bug.cgi?id=50328
118
119         * JavaScriptCore.vcproj/JavaScriptCore.sln: Modified property svn:eol-style.
120         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Modified property svn:eol-style.
121         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCF.vsprops: Added property svn:eol-style.
122         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCFLite.vsprops: Added property svn:eol-style.
123         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: Added property svn:eol-style.
124         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj: Modified property svn:eol-style.
125         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGeneratedCommon.vsprops: Added property svn:eol-style.
126         * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln: Modified property svn:eol-style.
127         * JavaScriptCore.vcproj/WTF/WTF.vcproj: Modified property svn:eol-style.
128         * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops: Added property svn:eol-style.
129         * JavaScriptCore.vcproj/jsc/jsc.vcproj: Modified property svn:eol-style.
130         * JavaScriptCore.vcproj/jsc/jscCommon.vsprops: Added property svn:eol-style.
131         * JavaScriptCore.vcproj/testapi/testapi.vcproj: Modified property svn:eol-style.
132         * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops: Added property svn:eol-style.
133
134 2010-12-01  Gavin Barraclough  <barraclough@apple.com>
135
136         Reviewed by Sam Weinig.
137
138         Bug 50298 - /()()()()()()()()()(?:(\10a|b)(X|Y))+/.exec("bXXaYYaY") ASSERTs
139
140         For unmatched subpattens we previously used to set the subpattern end to -1,
141         but now we only set the start value. E.g. consider the following:
142             /a(b)?c/.exec("ac");
143         Previously we would generate an internal results array of:
144             [ 0, 2, -1, -1 ]
145         Since fairly recently we have generated results of:
146             [ 0, 2, -1, ??? ]
147         (With the end index of the subpattern uninitialized).
148
149         Update these ASSERTs to account for this.
150
151         Also, when stripping out self-referencing backreferences, (e.g. /(\1)/) we
152         were checking the wrong property on the pattern term. We should have been
153         looking at term.parentheses.subpatternId, but instead were checking
154         term.subpatternId. The latter is actually only the subpatternId for
155         back reference terms. Rename this to backReferenceSubpatternId.
156
157         * yarr/RegexInterpreter.cpp:
158         (JSC::Yarr::Interpreter::matchBackReference):
159         (JSC::Yarr::Interpreter::backtrackBackReference):
160
161 2010-11-30  Gavin Barraclough  <barraclough@apple.com>
162
163         Rubber stamped by Sam Weinig.
164
165         Bug 50297 - \s in YARR should match BOMs.
166
167         From section 15.10.2.12 CharacterClassEscape contains:
168
169         The production CharacterClassEscape :: s evaluates by returning the set of characters containing the
170         characters that are on the right-hand side of the WhiteSpace (7.2) or LineTerminator (7.3) productions.
171
172         Table 2 in section 7.2 contains:
173
174         \uFEFF Byte Order Mark <BOM>
175
176         * create_regex_tables:
177             Add BOM to spaces table.
178
179 2010-11-30  Gavin Barraclough  <barraclough@apple.com>
180
181         Reviewed by Darin Adler.
182
183         Fixed review comments following bug #48101.
184         Mostly typos, plus gave quantifyInfinite a symbolic name.
185
186         * yarr/RegexCompiler.cpp:
187         (JSC::Yarr::RegexPatternConstructor::quantifyAtom):
188         (JSC::Yarr::RegexPatternConstructor::checkForTerminalParentheses):
189         * yarr/RegexInterpreter.cpp:
190         (JSC::Yarr::Interpreter::backtrackParenthesesOnceEnd):
191         (JSC::Yarr::Interpreter::matchParenthesesTerminalBegin):
192         (JSC::Yarr::Interpreter::backtrackParenthesesTerminalBegin):
193         (JSC::Yarr::Interpreter::backtrackParenthesesTerminalEnd):
194         * yarr/RegexJIT.cpp:
195         (JSC::Yarr::RegexGenerator::generatePatternCharacterGreedy):
196         (JSC::Yarr::RegexGenerator::generatePatternCharacterNonGreedy):
197         (JSC::Yarr::RegexGenerator::generateCharacterClassGreedy):
198         * yarr/RegexParser.h:
199         (JSC::Yarr::Parser::parseTokens):
200         (JSC::Yarr::parse):
201
202 2010-11-30  Steve Falkenburg  <sfalken@apple.com>
203
204         Reviewed by Darin Adler.
205
206         WTF project missing build-stopping code from its pre-build event
207         https://bugs.webkit.org/show_bug.cgi?id=50281
208
209         * JavaScriptCore.vcproj/WTF/WTFPreBuild.cmd:
210
211 2010-11-30  Patrick Gansterer  <paroga@webkit.org>
212
213         Reviewed by Darin Adler.
214
215         Cleanup UTF8.cpp
216         https://bugs.webkit.org/show_bug.cgi?id=49581
217
218         Use macros and functions instead of range values directly.
219
220         * wtf/unicode/UTF8.cpp:
221         (WTF::Unicode::inlineUTF8SequenceLength):
222         (WTF::Unicode::UTF8SequenceLength):
223         (WTF::Unicode::convertUTF16ToUTF8):
224         (WTF::Unicode::readUTF8Sequence):
225         (WTF::Unicode::convertUTF8ToUTF16):
226         * wtf/unicode/UnicodeMacrosFromICU.h: Added U_IS_SUPPLEMENTARY macro.
227
228 2010-11-30  Geoffrey Garen  <ggaren@apple.com>
229
230         Reviewed by Gavin Barraclough.
231
232         Fixed a crash seen when using a PageAllocation to store itself.
233
234         * wtf/PageAllocation.h:
235         (WTF::PageAllocation::systemDeallocate): Zero out m_base before unmapping
236         it, in case unmapping m_base unmaps the PageAllocation.
237
238         * wtf/BumpPointerAllocator.h:
239         (WTF::BumpPointerPool::destroy): Now this work-around isn't needed!
240
241 2010-11-30  Xan Lopez  <xlopez@igalia.com>
242
243         Reviewed by Darin Adler.
244
245         m_hasNonEnumerableProperties is never initialized in Structure
246         https://bugs.webkit.org/show_bug.cgi?id=50266
247
248         * runtime/Structure.cpp:
249         (JSC::Structure::Structure): initialize member variable.
250
251 2010-11-29  Steve Falkenburg  <sfalken@apple.com>
252
253         Windows build fix (part 1). Use correct environment variable syntax in cmd files.
254
255         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCorePostBuild.cmd:
256         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCorePreBuild.cmd:
257         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCorePreLink.cmd:
258         * JavaScriptCore.vcproj/WTF/WTFPostBuild.cmd:
259         * JavaScriptCore.vcproj/jsc/jscPostBuild.cmd:
260         * JavaScriptCore.vcproj/jsc/jscPreBuild.cmd:
261         * JavaScriptCore.vcproj/jsc/jscPreLink.cmd:
262         * JavaScriptCore.vcproj/testapi/testapiPostBuild.cmd:
263         * JavaScriptCore.vcproj/testapi/testapiPreBuild.cmd:
264         * JavaScriptCore.vcproj/testapi/testapiPreLink.cmd:
265
266 2010-11-29  Dan Bernstein  <mitz@apple.com>
267
268         Reviewed by Darin Adler.
269
270         WTF support for <rdar://problem/8650085> adding word-prefix search options to the text search API.
271         https://bugs.webkit.org/show_bug.cgi?id=50038
272
273         * wtf/unicode/UnicodeMacrosFromICU.h: Copied additional macros from icu/unicode/utf16.h.
274
275 2010-11-29  Steve Falkenburg  <sfalken@apple.com>
276
277         Reviewed by Darin Adler.
278
279         JavaScriptCore projects on Windows should use cmd files for build events
280         https://bugs.webkit.org/show_bug.cgi?id=50193
281
282         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
283         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCorePostBuild.cmd: Added.
284         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCorePreBuild.cmd: Added.
285         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCorePreLink.cmd: Added.
286         * JavaScriptCore.vcproj/WTF/WTFPostBuild.cmd: Added property svn:eol-style.
287         * JavaScriptCore.vcproj/WTF/WTFPreBuild.cmd: Added property svn:eol-style.
288         * JavaScriptCore.vcproj/jsc/jscCommon.vsprops:
289         * JavaScriptCore.vcproj/jsc/jscPostBuild.cmd: Added.
290         * JavaScriptCore.vcproj/jsc/jscPreBuild.cmd: Added.
291         * JavaScriptCore.vcproj/jsc/jscPreLink.cmd: Added.
292         * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops:
293         * JavaScriptCore.vcproj/testapi/testapiPostBuild.cmd: Added.
294         * JavaScriptCore.vcproj/testapi/testapiPreBuild.cmd: Added.
295         * JavaScriptCore.vcproj/testapi/testapiPreLink.cmd: Added.
296
297 2010-11-29  Dai Mikurube  <dmikurube@google.com>
298
299         Reviewed by Kent Tamura.
300
301         when empty, clicking "down" on outer-spin-button returns "max value"
302         https://bugs.webkit.org/show_bug.cgi?id=45491
303
304         It is required to calculate UTC/DST offsets to retrieve the current local milliseconds for
305         date/time type inputs. WTF::currentTimeMS() returns a UTC time, and WTF::getLocalTime()
306         returns a struct tm, not milliseconds.
307
308         Calculating milliseconds from a struct tm is not simple since timegm() cannot be used in all
309         environments. This calculation is already done in calculateUTCOffset(), and complicated.
310         Duplicating this complicated calculation is unreasonable because of maintainability.
311         To achieve this without duplication, we must call calculate{UTC|DST}Offset in some way.
312
313         * JavaScriptCore.exp:
314         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
315         * wtf/DateMath.cpp: Changed calculateUTCOffset() and calculateDSTOffset() to external functions.
316         (WTF::calculateUTCOffset):
317         (WTF::calculateDSTOffset):
318         * wtf/DateMath.h:
319
320 2010-11-29  Chris Rogers  <crogers@google.com>
321
322         Reviewed by Kenneth Russell.
323
324         Switch web audio code to use FloatPoint3D instead of Vector3
325         https://bugs.webkit.org/show_bug.cgi?id=50186
326
327         * wtf/Vector3.h: Removed.
328
329 2010-11-29  Steve Falkenburg  <sfalken@apple.com>
330
331         Reviewed by Adam Roben.
332
333         Add a mechanism for Windows pre-build/pre-link/post-build events to be separated into individual cmd files
334         https://bugs.webkit.org/show_bug.cgi?id=49858
335
336         We're migrating our prebuild/prelink/postbuild steps out of vcproj and vsprops files:
337         - To simplify editing (editing vsprops build steps is confusing).
338         - For more readable diffs.
339
340         * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops:
341         * JavaScriptCore.vcproj/WTF/WTFPostBuild.cmd: Added.
342         * JavaScriptCore.vcproj/WTF/WTFPreBuild.cmd: Added.
343
344 2010-11-29  Geoffrey Garen  <ggaren@apple.com>
345
346         Reviewed by Gavin Barraclough.
347
348         Improved accuracy of command-line SunSpider.
349
350         * jsc.cpp:
351         (functionRun): Changed the "run" function to run a given test in
352         its own global object. Previously, all tests ran in the same global
353         object, which created name conflicts, and made globals from previous
354         tests artificially survive into later tests.
355         
356         Also changed "run" to return the elapsed milliseconds when running a
357         given test, for slightly more accurate numbers.
358
359         (functionCheckSyntax): Ditto on returning elapsed milliseconds.
360
361 2010-11-29  Darin Adler  <darin@apple.com>
362
363         Reviewed by Andreas Kling.
364
365         Remove a couple unneeded overflow checks
366         https://bugs.webkit.org/show_bug.cgi?id=49816
367
368         * wtf/text/CString.cpp:
369         (WTF::CString::init): Use an ASSERT instead of
370         an overflow check with CRASH.
371
372 2010-11-29  Adam Roben  <aroben@apple.com>
373
374         Robustify react-to-vsprops-changes.py against changes to its location
375         or the location of the .vsprops files
376
377         Suggested by John Sullivan.
378
379         * JavaScriptCore.vcproj/JavaScriptCore/react-to-vsprops-changes.py:
380         Removed file_modification_times.
381         (main): Use glob.glob to find the .vsprops files and assert that we found some.
382
383 2010-11-29  Adam Roben  <aroben@apple.com>
384
385         Touch wtf/Platform.h whenever any .vsprops file changes
386
387         This will cause all files to be recompiled, which will make changes to
388         preprocessor macros (e.g., ENABLE_*) actually take effect.
389
390         Fixes <http://webkit.org/b/50167> Windows build fails when ENABLE_*
391         macros are changed (because not enough files are rebuilt)
392
393         Reviewed by John Sullivan.
394
395         * JavaScriptCore.vcproj/JavaScriptCore/react-to-vsprops-changes.py:
396         (main): Touch wtf/Platform.h if it's older than any .vsprops file. Also
397         added some comments and logging to make it clearer what the script is
398         doing and why.
399
400 2010-11-29  Adam Roben  <aroben@apple.com>
401
402         Update react-to-vsprops-changes.py after r72555
403
404         .vsprops files are no longer accessed relative to $WebKitLibrariesDir.
405
406         Fixes <http://webkit.org/b/50166> REGRESSION (r72555):
407         react-to-vsprops-changes.py no longer works for people with a
408         non-default $WebKitLibrariesDir
409
410         Reviewed by John Sullivan.
411
412         * JavaScriptCore.vcproj/JavaScriptCore/react-to-vsprops-changes.py:
413         (main): Always look in WebKitLibraries/win for .vsprops files, not in
414         $WebKitLibrariesDir.
415
416 2010-11-28  Gavin Barraclough  <barraclough@apple.com>
417
418         Reviewed by Sam Weinig.
419
420         Bug 48100 - YARR allows what seems like a bogus character-class range
421
422         Per ECMA-262 character classes containing character ranges containing
423         character classes are invalid, eg:
424             /[\d-x]/
425             /[x-\d]/
426             /[\d-\d]/
427         These should throw a syntax error.
428
429         * yarr/RegexParser.h:
430
431 2010-11-27  Gavin Barraclough  <barraclough@apple.com>
432
433         Reviewed by Sam Weinig.
434
435         Bug 48101 - Yarr gives different results for /(?:a*?){2,}/
436
437         The test cases in the linked mozilla bug demonstrate a couple of
438         problems in subpattern matching. These bugs lie in the optimized
439         cases - for matching parentheses with a quantity count of 1, and
440         for matching greedy quantified parentheses at the end of a regex
441         (which do not backtrack).
442
443         In both of these cases we are failing to correctly handle empty
444         matches. In the case of parentheses-single matches (quantity count
445         one) we are failing to test for empty matches at all. In the case
446         of terminal subpattern matches we do currently check, however there
447         is a subtler bug here too. In the case of an empty match we will
448         presently immediately fall through to the next alternative (or
449         complete the regex match), whereas upon a failed match we should
450         be backtracking into the failing alternative, to give it a chance
451         to match further (e.g. consider /a??b?|a/.exec("ab") - upon first
452         attempting to match the first alternative this will match the empty
453         string - since a?? is non-greedy, however rather than moving on to
454         the second alternative we should be re-matching the first one, at
455         which point the non-greedy a?? will match, and as such the result
456         should be "ab", not "a").
457
458         Terminal subpattern matching contains a second bug, too. The frame
459         location values in the subpattern should be being allocated with
460         the outer disjunction's frame (as we do for the parentheses-single
461         optimization). Consider the following three regexes:
462             /a*(?:b*)*c*/
463             /a*(?:b*)c*/
464             /a*(?:b*)*/
465         Considering only the frame location required by the atoms a,b, and
466         c, (ignoring space associated with the nested subpattern) the first
467         regex (a normal subpattern match) requires a frame size of 2 for
468         the outer disjunction, (to backtrack terms a & c), with each
469         iteration of the subpattern requiring a frame of size 1 (in order
470         to backtrack b). In the case of the second regex (where the
471         parentheses-single optimization will kick in) the outer frame must
472         be set up with a frame size of 3, since the outer frame will also
473         be used when running the nested subpattern. We will currently only
474         allocate a farme of size 1 for the outer disjuntion (to contain a),
475         howver the frame size should be 2 (since the subpattern will be
476         evaluated in the outer frame). In addition to failing to allocate
477         frame space the frame offsets are also presently invalid - in the
478         case of the last regex b's frame location will be set assuming it
479         to be the first term in the frame, whereas in this case b lies
480         after the term a, and should be taking a separate frame location.
481
482         In order to correctly allocate the frame for terminal subpattern
483         matches we must move this optimization back up from the JIT into
484         the compiler (and thus interpreter too), since this is where the
485         frame allocation takes place.
486
487         * yarr/RegexCompiler.cpp:
488         (JSC::Yarr::RegexPatternConstructor::setupAlternativeOffsets):
489         (JSC::Yarr::RegexPatternConstructor::checkForTerminalParentheses):
490         (JSC::Yarr::compileRegex):
491         * yarr/RegexInterpreter.cpp:
492         (JSC::Yarr::Interpreter::matchParenthesesOnceBegin):
493         (JSC::Yarr::Interpreter::matchParenthesesOnceEnd):
494         (JSC::Yarr::Interpreter::backtrackParenthesesOnceBegin):
495         (JSC::Yarr::Interpreter::backtrackParenthesesOnceEnd):
496         (JSC::Yarr::Interpreter::matchParenthesesTerminalBegin):
497         (JSC::Yarr::Interpreter::matchParenthesesTerminalEnd):
498         (JSC::Yarr::Interpreter::backtrackParenthesesTerminalBegin):
499         (JSC::Yarr::Interpreter::backtrackParenthesesTerminalEnd):
500         (JSC::Yarr::Interpreter::matchDisjunction):
501         (JSC::Yarr::ByteCompiler::atomParenthesesOnceBegin):
502         (JSC::Yarr::ByteCompiler::atomParenthesesTerminalBegin):
503         (JSC::Yarr::ByteCompiler::atomParenthesesSubpatternBegin):
504         (JSC::Yarr::ByteCompiler::atomParentheticalAssertionEnd):
505         (JSC::Yarr::ByteCompiler::atomParenthesesSubpatternEnd):
506         (JSC::Yarr::ByteCompiler::atomParenthesesOnceEnd):
507         (JSC::Yarr::ByteCompiler::atomParenthesesTerminalEnd):
508         (JSC::Yarr::ByteCompiler::emitDisjunction):
509         * yarr/RegexInterpreter.h:
510         * yarr/RegexJIT.cpp:
511         (JSC::Yarr::RegexGenerator::generateParenthesesSingle):
512         (JSC::Yarr::RegexGenerator::generateParenthesesGreedyNoBacktrack):
513         (JSC::Yarr::RegexGenerator::generateTerm):
514         * yarr/RegexPattern.h:
515         (JSC::Yarr::PatternTerm::PatternTerm):
516
517 2010-11-24  Patrick Gansterer  <paroga@webkit.org>
518
519         Reviewed by Csaba Osztrogonác.
520
521         Remove Bakefile build system files
522         https://bugs.webkit.org/show_bug.cgi?id=49983
523
524         r53757 only removed the content, but not the files.
525         This patch removes that empty files.
526
527         * JavaScriptCoreSources.bkl: Removed.
528         * jscore.bkl: Removed.
529
530 2010-11-24  Gabor Loki  <loki@webkit.org>
531
532         Reviewed by Csaba Osztrogonác.
533
534         Merge the usage of jumps and calls at ARM-JIT
535         https://bugs.webkit.org/show_bug.cgi?id=50008
536
537         Those JmpSrc objects which represent jumps (not calls) should point to
538         after the jump instruction.
539
540         * assembler/ARMAssembler.h:
541         (JSC::ARMAssembler::blx):
542         (JSC::ARMAssembler::loadBranchTarget):
543         (JSC::ARMAssembler::getAbsoluteJumpAddress):
544         (JSC::ARMAssembler::linkJump):
545         (JSC::ARMAssembler::relinkJump):
546         (JSC::ARMAssembler::linkCall):
547         (JSC::ARMAssembler::relinkCall):
548         (JSC::ARMAssembler::getRelocatedAddress):
549         (JSC::ARMAssembler::getDifferenceBetweenLabels):
550         (JSC::ARMAssembler::getCallReturnOffset):
551         * assembler/MacroAssemblerARM.h:
552         (JSC::MacroAssemblerARM::call):
553
554 2010-11-24  Carlos Garcia Campos  <cgarcia@igalia.com>
555
556         Reviewed by Xan Lopez.
557
558         [GTK] Optimize foldCase, toLower and toUpper methods in glib unicode backend
559         https://bugs.webkit.org/show_bug.cgi?id=48625
560
561         GLib methods use UTF-8 strings, so we have to convert from UTF-16 to
562         UTF-8 to perform the case operations and then convert back the result to
563         UTF-16. GLib conversion methods return a new allocated string, so we
564         have to memcpy the result into the destination buffer too. Using our
565         own methods to convert between UTF-8 and UTF-16 from wtf/unicode/UTF8.h
566         we don't need such memcpy, since they take an already allocated buffer
567         rather than returning a new one. There's another optimization for the
568         case when the destination buffer is not large enough. In that case,
569         methods should return the expected destination buffer size and are
570         called again with a new buffer. We can avoid the conversion to UTF-16 by
571         pre-calculating the required size for the destination buffer.
572
573         * wtf/unicode/glib/UnicodeGLib.cpp:
574         (WTF::Unicode::getUTF16LengthFromUTF8):
575         (WTF::Unicode::convertCase):
576         (WTF::Unicode::foldCase):
577         (WTF::Unicode::toLower):
578         (WTF::Unicode::toUpper):
579
580 2010-11-23  Patrick Gansterer  <paroga@webkit.org>
581
582         Reviewed by Sam Weinig.
583
584         Use WTF::StringHasher directly in JavaScriptCore
585         https://bugs.webkit.org/show_bug.cgi?id=49893
586
587         * profiler/CallIdentifier.h:
588         (JSC::CallIdentifier::Hash::hash):
589         * runtime/Identifier.cpp:
590         (JSC::IdentifierCStringTranslator::hash):
591         (JSC::IdentifierUCharBufferTranslator::hash):
592
593 2010-11-22  Patrick Gansterer  <paroga@webkit.org>
594
595         Reviewed by Sam Weinig.
596
597         Add WTF::FixedArray::size()
598         https://bugs.webkit.org/show_bug.cgi?id=49891
599
600         Add a method to get the size of a FixedArray.
601
602         * wtf/FixedArray.h:
603         (WTF::FixedArray::size):
604
605 2010-11-22  Patrick Gansterer  <paroga@webkit.org>
606
607         Reviewed by Adam Roben.
608
609         [WINCE] Set correct preprocessor definitions
610         https://bugs.webkit.org/show_bug.cgi?id=49887
611
612         * wtf/Platform.h:
613
614 2010-11-22  Adam Roben  <aroben@apple.com>
615
616         Use paths relative to $WebKitVSPropsRedirectionDir to access shared .vsprops files
617
618         Apple's Windows build allows placing header files and import libraries for WebKit's
619         dependencies (CoreGraphics, CFNetwork, SQLite, etc.) outside the source tree via the
620         $WebKitLibrariesDir environment variable. This is both required for production builds and
621         convenient for Apple-internal developer builds. Apple's production builds also require that
622         WebKit's shared .vsprops files be accessed relative to $WebKitLibrariesDir. In production
623         builds, the files are copied into that directory tree by the
624         WebKitLibraries/win/tools/WinTools.make file. In Apple-internal developer builds, the
625         copying is done by
626         JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make.
627
628         This .vsprops copying is problematic in one very important case: when a developer updates
629         their source tree and then tries to build. Visual Studio only reads .vsprops files when a
630         project is first loaded. So, when Visual Studio is first opened after the .vsprops files are
631         updated, it reads in the old files that were already residing in $WebKitLibrariesDir. When a
632         build is started, JavaScriptCoreGenerated.make copies the new .vsprops files into
633         $WebKitLibrariesDir, but Visual Studio will not pick up the changes.  The rest of the build
634         will proceed with out-of-date .vsprops files, which will likely result in a build failure.
635
636         To fix this, we now use normal relative paths to access the .vsprops files in the source
637         tree rather than in $WebKitLibrariesDir, but prefix those paths with a new environment
638         variable, $WebKitVSPropsRedirectionDir. In developer builds, this environment variable is
639         unset, so the normal relative paths are used to read the .vsprops files out of the source
640         tree directly. In production builds, this environment variable is set to a fake directory
641         that will cause the .vsprops files in $WebKitLibrariesDir to be found when the relative path
642         is resolved.
643         
644         For example, JavaScriptCore.vcproj uses this path for FeatureDefines.vsprops:
645
646         $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\FeatureDefines.vsprops
647
648         In developer builds, where $WebKitVSPropsRedirectionDir is unset, this will point to the
649         files in WebKitLibraries\win\tools\vsprops in the source tree. In production builds,
650         JavaScriptCore.make sets $WebKitVSPropsRedirectionDir to
651         "$(SRCROOT)\AppleInternal\tools\vsprops\OpenSource\1\2\3\", so the full path for
652         FeatureDefines.vsprops becomes:
653
654         $(SRCROOT)\AppleInternal\tools\vsprops\OpenSource\1\2\3\..\..\..\WebKitLibraries\win\tools\vsprops\FeatureDefines.vsprops
655
656         which resolves to:
657
658         $(SRCROOT)\AppleInternal\tools\vsprops\OpenSource\WebKitLibraries\win\tools\vsprops\FeatureDefines.vsprops
659
660         (We rely on the fact that Windows doesn't care whether the directories "1", "2", and "3"
661         actually exist since they are matched by an equal number of ".." path components.)
662
663         Note that Visual Studio still won't pick up changes made to .vsprops files while Visual
664         Studio is open, but that problem hasn't seemed to cause developers many headaches so far.
665
666         Fixes <http://webkit.org/b/49181> Windows build fails mysteriously when .vsprops files are
667         updated
668
669         Reviewed by Dave Hyatt.
670
671         * JavaScriptCore.vcproj/JavaScriptCore.make: Set $WebKitVSPropsRedirectionDir so that
672         production builds can find the .vsprops files.
673
674         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make: Stopy copying the
675         .vsprops files. It isn't needed anymore.
676
677         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
678         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
679         * JavaScriptCore.vcproj/jsc/jsc.vcproj:
680         * JavaScriptCore.vcproj/testapi/testapi.vcproj:
681         Changed to use paths relative to $WebKitVSPropsRedirectionDir to access shared .vsprops
682         files.
683
684 2010-11-19  Peter Varga  <pvarga@inf.u-szeged.hu>
685
686         Reviewed by Gavin Barraclough.
687
688         YARR JIT should fallback to YARR Interpreter instead of PCRE.
689         https://bugs.webkit.org/show_bug.cgi?id=46719
690
691         Remove the ENABLE_YARR macro and the option of matching regular
692         expressions with PCRE from JavaScriptCore.
693
694         * runtime/JSGlobalData.h:
695         * runtime/RegExp.cpp:
696         (JSC::RegExp::compile):
697         (JSC::RegExp::match):
698         * tests/mozilla/expected.html:
699         * wtf/Platform.h:
700         * yarr/RegexCompiler.cpp:
701         * yarr/RegexCompiler.h:
702         * yarr/RegexInterpreter.cpp:
703         (JSC::Yarr::byteCompileRegex):
704         * yarr/RegexInterpreter.h:
705         * yarr/RegexJIT.cpp:
706         (JSC::Yarr::jitCompileRegex):
707         * yarr/RegexJIT.h:
708         (JSC::Yarr::RegexCodeBlock::RegexCodeBlock):
709         (JSC::Yarr::RegexCodeBlock::~RegexCodeBlock):
710         (JSC::Yarr::RegexCodeBlock::getFallback):
711         (JSC::Yarr::RegexCodeBlock::isFallback):
712         (JSC::Yarr::RegexCodeBlock::setFallback):
713         (JSC::Yarr::executeRegex):
714         * yarr/RegexParser.h:
715         * yarr/RegexPattern.h:
716
717 2010-11-20  Kwang Yul Seo  <skyul@company100.net>
718
719         Reviewed by David Kilzer.
720
721         [BREWMP] Replace DBGPRINTF and DBGPRINTF_FATAL with dbg_Message
722         https://bugs.webkit.org/show_bug.cgi?id=49520
723
724         DBGPRINTF and DBGPRINTF_FATAL macros are prohibited in Mod1. Use dbg_Message instead.
725
726         * wtf/Assertions.cpp:
727         * wtf/Assertions.h:
728
729 2010-11-20  Gabor Loki  <loki@webkit.org>
730
731         Reviewed by Gavin Barraclough.
732
733         Support JIT_OPTIMIZE_MOD on Thumb-2
734         https://bugs.webkit.org/show_bug.cgi?id=49432
735
736         Rewrite the soft modulo operation into macroassembler form, and move it
737         to JSValue32_64 section.
738         Add support for soft modulo on Thumb-2 JIT also.
739
740         * assembler/ARMv7Assembler.h:
741         (JSC::ARMv7Assembler::clz):
742         * assembler/MacroAssemblerARM.h:
743         (JSC::MacroAssemblerARM::countLeadingZeros32):
744         (JSC::MacroAssemblerARM::relativeTableJump):
745         * assembler/MacroAssemblerARMv7.h:
746         (JSC::MacroAssemblerARMv7::countLeadingZeros32):
747         (JSC::MacroAssemblerARMv7::relativeTableJump):
748         * jit/JITArithmetic.cpp:
749         (JSC::JIT::emit_op_mod):
750         * jit/JITOpcodes.cpp:
751         (JSC::JIT::privateCompileCTIMachineTrampolines):
752         * jit/JITOpcodes32_64.cpp:
753         (JSC::JIT::softModulo):
754         * jit/JITStubs.cpp:
755         (JSC::JITThunks::JITThunks):
756         * wtf/Platform.h:
757
758 2010-11-20  David Kilzer  <ddkilzer@apple.com>
759
760         <http://webkit.org/b/49848> Make it possible to display the last character of a secure text field unobscured
761
762         Reviewed by Darin Adler.
763
764         * JavaScriptCore.exp:
765         * wtf/text/StringImpl.cpp:
766         (WTF::StringImpl::secure): Added argument that controls whether
767         the last character is obscured or not.  Implemented behavior.
768         * wtf/text/StringImpl.h:
769         (WTF::StringImpl::LastCharacterBehavior): Added enum.
770         (WTF::StringImpl::secure): Updated method signature.
771
772 2010-11-19  William Chan  <willchan@chromium.org>
773
774         Reviewed by David Levin.
775
776         Add USE(CHROMIUM_NET)
777
778         Indicates the use of Chromium's network stack.  Chromium's network
779         stack performs better when it has full view of all resource requests,
780         so USE(CHROMIUM_NET) can be used to bypass throttles.
781
782         https://bugs.webkit.org/show_bug.cgi?id=49778
783
784         * wtf/Platform.h:
785
786 2010-11-19  Steve Falkenburg  <sfalken@apple.com>
787
788         Reviewed by Adam Roben.
789
790         Add Debug_Cairo_CFLite and Release_Cairo_CFLite configurations for all vcproj files
791         https://bugs.webkit.org/show_bug.cgi?id=49819
792
793         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
794         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj:
795         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
796         * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops:
797         * JavaScriptCore.vcproj/jsc/jsc.vcproj:
798         * JavaScriptCore.vcproj/testapi/testapi.vcproj:
799
800 2010-11-19  Oliver Hunt  <oliver@apple.com>
801
802         Reviewed by Geoffrey Garen.
803
804         Don't check for constant registers when we can guarantee that the register won't be in the constant pool
805         https://bugs.webkit.org/show_bug.cgi?id=49814
806
807         Add uncheckedR(int) to CallFrame, and replace all the uses of r() with uncheckedR()
808         when we can guarantee that the register is not referring to a constant.
809         This makes the interpreter about 0.5% faster, and makes the CallFrame initialisation
810         logic correct when we're using a faked callframe (as in the case of the globalExec).
811
812         * bytecode/CodeBlock.cpp:
813         (JSC::CodeBlock::createActivation):
814         * debugger/DebuggerCallFrame.cpp:
815         (JSC::DebuggerCallFrame::thisObject):
816         * interpreter/CallFrame.h:
817         (JSC::ExecState::uncheckedR):
818         * interpreter/Interpreter.cpp:
819         (JSC::Interpreter::resolve):
820         (JSC::Interpreter::resolveSkip):
821         (JSC::Interpreter::resolveGlobal):
822         (JSC::Interpreter::resolveGlobalDynamic):
823         (JSC::Interpreter::resolveBase):
824         (JSC::Interpreter::resolveBaseAndProperty):
825         (JSC::Interpreter::callEval):
826         (JSC::Interpreter::unwindCallFrame):
827         (JSC::Interpreter::throwException):
828         (JSC::Interpreter::execute):
829         (JSC::Interpreter::executeCall):
830         (JSC::Interpreter::executeConstruct):
831         (JSC::Interpreter::prepareForRepeatCall):
832         (JSC::Interpreter::createExceptionScope):
833         (JSC::Interpreter::privateExecute):
834         * jit/JITStubs.cpp:
835         (JSC::DEFINE_STUB_FUNCTION):
836         * runtime/JSActivation.cpp:
837         (JSC::JSActivation::argumentsGetter):
838
839 2010-11-19  Steve Falkenburg  <sfalken@apple.com>
840
841         Reviewed by Darin Adler.
842
843         Normalize Cairo/CFLite project/solution configuration names
844         https://bugs.webkit.org/show_bug.cgi?id=49818
845
846         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
847         * JavaScriptCore.vcproj/jsc/jsc.vcproj:
848         * JavaScriptCore.vcproj/testapi/testapi.vcproj:
849
850 2010-11-18  Steve Falkenburg  <sfalken@apple.com>
851
852         Reviewed by Adam Roben.
853
854         Windows vcproj configuration names should be normalized across projects
855         https://bugs.webkit.org/show_bug.cgi?id=49776
856
857         * JavaScriptCore.vcproj/JavaScriptCore.sln:
858         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj:
859         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGeneratedCommon.vsprops: Added.
860         * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln:
861
862 2010-11-19  Patrick Gansterer  <paroga@webkit.org>
863
864         Unreviewed, build fix after r72360.
865
866         * bytecode/CodeBlock.h:
867         (JSC::CodeBlock::bytecodeOffset):
868
869 2010-11-18  Gavin Barraclough  <barraclough@apple.com>
870
871         Rubber stamped by Geoff Garen.
872
873         Bug 49577 - Function.prototype should be non-configurable
874
875         Ooops, Function.prototype should not be enumerable!
876
877         * runtime/JSFunction.cpp:
878         (JSC::JSFunction::getOwnPropertySlot):
879
880 2010-11-18  Gavin Barraclough  <barraclough@apple.com>
881
882         Reviewed by Oliver Hunt.
883
884         Bug 49708 - Stop recompiling functions to regenerate exception info.
885
886         Instead only hold info as necessary – keep divot info is the inspector
887         is enabled, line number info is debugging or profiling, and handler
888         info for functions with try/catch.
889
890         * bytecode/CodeBlock.cpp:
891         (JSC::CodeBlock::dumpStatistics):
892         (JSC::CodeBlock::CodeBlock):
893         (JSC::CodeBlock::lineNumberForBytecodeOffset):
894         (JSC::CodeBlock::expressionRangeForBytecodeOffset):
895         (JSC::CodeBlock::shrinkToFit):
896         * bytecode/CodeBlock.h:
897         (JSC::CodeBlock::bytecodeOffset):
898         (JSC::CodeBlock::addExpressionInfo):
899         (JSC::CodeBlock::addLineInfo):
900         (JSC::CodeBlock::hasExpressionInfo):
901         (JSC::CodeBlock::hasLineInfo):
902         (JSC::CodeBlock::needsCallReturnIndices):
903         (JSC::CodeBlock::callReturnIndexVector):
904         * bytecode/SamplingTool.cpp:
905         (JSC::SamplingTool::dump):
906         * bytecompiler/BytecodeGenerator.cpp:
907         (JSC::BytecodeGenerator::generate):
908         (JSC::BytecodeGenerator::BytecodeGenerator):
909         * bytecompiler/BytecodeGenerator.h:
910         (JSC::BytecodeGenerator::emitNode):
911         (JSC::BytecodeGenerator::emitNodeInConditionContext):
912         (JSC::BytecodeGenerator::emitExpressionInfo):
913         (JSC::BytecodeGenerator::addLineInfo):
914         * interpreter/Interpreter.cpp:
915         (JSC::Interpreter::unwindCallFrame):
916         (JSC::appendSourceToError):
917         (JSC::Interpreter::throwException):
918         (JSC::Interpreter::privateExecute):
919         (JSC::Interpreter::retrieveLastCaller):
920         * interpreter/Interpreter.h:
921         * jit/JIT.cpp:
922         (JSC::JIT::privateCompile):
923         * jit/JITStubs.cpp:
924         (JSC::jitThrow):
925         (JSC::DEFINE_STUB_FUNCTION):
926         * runtime/Collector.cpp:
927         (JSC::Heap::markRoots):
928         * runtime/Executable.cpp:
929         (JSC::EvalExecutable::compileInternal):
930         (JSC::ProgramExecutable::compileInternal):
931         (JSC::FunctionExecutable::compileForCallInternal):
932         (JSC::FunctionExecutable::compileForConstructInternal):
933         * runtime/Executable.h:
934         * runtime/JSGlobalData.cpp:
935         (JSC::JSGlobalData::JSGlobalData):
936         * runtime/JSGlobalData.h:
937         (JSC::JSGlobalData::usingAPI):
938         * runtime/JSGlobalObject.h:
939         (JSC::JSGlobalObject::supportsRichSourceInfo):
940         (JSC::JSGlobalObject::globalData):
941
942 2010-11-18  Adam Roben  <aroben@apple.com>
943
944         Add a script to delete manifest-related files when they are older than
945         any .vsprops file
946
947         Changes to .vsprops files can cause the manifest files to become
948         invalid, and Visual Studio doesn't always figure out that it needs to
949         rebuild them.
950
951         Reviewed by Sam Weinig.
952
953         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
954         Call the new script.
955
956         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj:
957         Added the new script.
958
959         * JavaScriptCore.vcproj/JavaScriptCore/react-to-vsprops-changes.py: Added.
960         (file_modification_times): Generator to return the modification time of
961         each file in a directory hierarchy.
962         (main): Get the modification time of the newest vsprops file, then find
963         all manifest-related files in the obj directory. Delete all
964         manifest-related files that are older than the newest vsprops file.
965
966 2010-11-18  Mark Rowe  <mrowe@apple.com>
967
968         Rubber-stamped by Adam Roben.
969
970         <rdar://problem/8602509&8602717&8602724> Enable compaction support.
971
972         * Configurations/JavaScriptCore.xcconfig:
973
974 2010-11-18  Gavin Barraclough  <barraclough@apple.com>
975
976         Reviewed by Oliver Hunt.
977
978         Bug 49635 - Profiler implementation is fragile
979
980         The profile presently requires the exception handling mechanism to explicitly
981         remove all stack frames that are exited during the exception unwind mechanism.
982         This is fragile in a number of ways:
983           * We have to change bytecode register allocation when compiling code to run
984             when profiling, to preserve the callee function (this is also required to
985             call did_call after the call has returned).
986           * In the JIT we have to maintain additional data structures
987             (CodeBlock::RareData::m_functionRegisterInfos) to map back to the register
988             containing the callee.
989           * In the interpreter we use 'magic values' to offset into the instruction
990             stream to rediscover the register containing the function.
991
992         Instead, move profiling into the head and tail of functions.
993           * This correctly accounts the cost of the call itself to the caller.
994           * This allows us to access the callee function object from the callframe.
995           * This means that at the point a call is made we can track the stack depth
996             on the ProfileNode.
997           * When unwinding we can simply report the depth at which the exception is
998             being handled - all call frames above this level are freed.
999
1000         * bytecode/CodeBlock.cpp:
1001         (JSC::CodeBlock::shrinkToFit):
1002         * bytecode/CodeBlock.h:
1003         (JSC::CodeBlock::bytecodeOffset):
1004         (JSC::CodeBlock::methodCallLinkInfo):
1005         * bytecompiler/BytecodeGenerator.cpp:
1006         (JSC::BytecodeGenerator::emitCall):
1007         (JSC::BytecodeGenerator::emitCallVarargs):
1008         * interpreter/Interpreter.cpp:
1009         (JSC::Interpreter::unwindCallFrame):
1010         (JSC::Interpreter::throwException):
1011         (JSC::Interpreter::execute):
1012         (JSC::Interpreter::executeCall):
1013         (JSC::Interpreter::executeConstruct):
1014         (JSC::Interpreter::privateExecute):
1015         * jit/JITStubs.cpp:
1016         (JSC::DEFINE_STUB_FUNCTION):
1017         * profiler/Profile.cpp:
1018         (JSC::Profile::Profile):
1019         * profiler/ProfileGenerator.cpp:
1020         (JSC::ProfileGenerator::addParentForConsoleStart):
1021         (JSC::ProfileGenerator::willExecute):
1022         (JSC::ProfileGenerator::didExecute):
1023         (JSC::ProfileGenerator::exceptionUnwind):
1024         (JSC::ProfileGenerator::stopProfiling):
1025         * profiler/ProfileGenerator.h:
1026         * profiler/ProfileNode.cpp:
1027         (JSC::ProfileNode::ProfileNode):
1028         (JSC::ProfileNode::willExecute):
1029         * profiler/ProfileNode.h:
1030         (JSC::ProfileNode::create):
1031         (JSC::ProfileNode::callerCallFrame):
1032         * profiler/Profiler.cpp:
1033         (JSC::dispatchFunctionToProfiles):
1034         (JSC::Profiler::_willExecute):
1035         (JSC::Profiler::_didExecute):
1036         (JSC::Profiler::exceptionUnwind):
1037         * profiler/Profiler.h:
1038
1039 2010-11-18  Steve Falkenburg  <sfalken@apple.com>
1040
1041         Reviewed by Adam Roben.
1042
1043         Remove leftover Windows Debug_Internal configurations
1044         https://bugs.webkit.org/show_bug.cgi?id=49758
1045
1046         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1047         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
1048         * JavaScriptCore.vcproj/jsc/jsc.vcproj:
1049         * JavaScriptCore.vcproj/testapi/testapi.vcproj:
1050
1051 2010-11-18  Chao-ying Fu  <fu@mips.com>
1052
1053         Reviewed by Csaba Osztrogonác.
1054
1055         Avoid increasing required alignment of target type warning
1056         https://bugs.webkit.org/show_bug.cgi?id=43963
1057
1058         * runtime/UString.h:
1059         (JSC::UStringHash::equal):
1060         * wtf/StdLibExtras.h:
1061
1062 2010-11-17  Sam Weinig  <sam@webkit.org>
1063
1064         Reviewed by Anders Carlsson.
1065
1066         Add stubbed out ScrollAnimator for the Mac
1067         https://bugs.webkit.org/show_bug.cgi?id=49678
1068
1069         * wtf/Platform.h: Enable SMOOTH_SCROLLING on the Mac, this has no
1070         change in behavior at the moment.
1071
1072 2010-11-17  David Kilzer  <ddkilzer@apple.com>
1073
1074         <http://webkit.org/b/49634> Make overflow guards in WTF::String::utf8 explicit
1075
1076         Reviewed by Darin Adler.
1077
1078         Add an explicit overflow check prior to allocating our buffer,
1079         rather than implicitly relying on the guard in convertUTF16ToUTF8.
1080
1081         * wtf/text/WTFString.cpp:
1082         (WTF::String::utf8):
1083
1084 2010-11-17  Sheriff Bot  <webkit.review.bot@gmail.com>
1085
1086         Unreviewed, rolling out r72197.
1087         http://trac.webkit.org/changeset/72197
1088         https://bugs.webkit.org/show_bug.cgi?id=49661
1089
1090         broke fast/regex/test1.html (Requested by stampho on #webkit).
1091
1092         * runtime/JSGlobalData.h:
1093         * runtime/RegExp.cpp:
1094         (JSC::RegExpRepresentation::~RegExpRepresentation):
1095         (JSC::RegExp::compile):
1096         (JSC::RegExp::match):
1097         * tests/mozilla/expected.html:
1098         * wtf/Platform.h:
1099         * yarr/RegexCompiler.cpp:
1100         * yarr/RegexCompiler.h:
1101         * yarr/RegexInterpreter.cpp:
1102         * yarr/RegexInterpreter.h:
1103         * yarr/RegexJIT.cpp:
1104         (JSC::Yarr::jitCompileRegex):
1105         * yarr/RegexJIT.h:
1106         (JSC::Yarr::RegexCodeBlock::RegexCodeBlock):
1107         (JSC::Yarr::RegexCodeBlock::~RegexCodeBlock):
1108         (JSC::Yarr::RegexCodeBlock::getFallback):
1109         (JSC::Yarr::RegexCodeBlock::setFallback):
1110         (JSC::Yarr::executeRegex):
1111         * yarr/RegexParser.h:
1112         * yarr/RegexPattern.h:
1113
1114 2010-11-17  Peter Varga  <pvarga@inf.u-szeged.hu>
1115
1116         Reviewed by Gavin Barraclough.
1117
1118         YARR JIT should fallback to YARR Interpreter instead of PCRE.
1119         https://bugs.webkit.org/show_bug.cgi?id=46719
1120
1121         Remove the ENABLE_YARR macro and the option of matching regular
1122         expressions with PCRE from JavaScriptCore.
1123
1124         * runtime/JSGlobalData.h:
1125         * runtime/RegExp.cpp:
1126         (JSC::RegExp::compile):
1127         (JSC::RegExp::match):
1128         * tests/mozilla/expected.html:
1129         * wtf/Platform.h:
1130         * yarr/RegexCompiler.cpp:
1131         * yarr/RegexCompiler.h:
1132         * yarr/RegexInterpreter.cpp:
1133         (JSC::Yarr::byteCompileRegex):
1134         * yarr/RegexInterpreter.h:
1135         * yarr/RegexJIT.cpp:
1136         (JSC::Yarr::jitCompileRegex):
1137         * yarr/RegexJIT.h:
1138         (JSC::Yarr::RegexCodeBlock::RegexCodeBlock):
1139         (JSC::Yarr::RegexCodeBlock::~RegexCodeBlock):
1140         (JSC::Yarr::RegexCodeBlock::getFallback):
1141         (JSC::Yarr::RegexCodeBlock::isFallback):
1142         (JSC::Yarr::RegexCodeBlock::setFallback):
1143         (JSC::Yarr::executeRegex):
1144         * yarr/RegexParser.h:
1145         * yarr/RegexPattern.h:
1146
1147 2010-11-17  Peter Varga  <pvarga@inf.u-szeged.hu>
1148
1149         Reviewed by Gavin Barraclough.
1150
1151         Extend YARR Interpreter with beginning character look-up optimization
1152         https://bugs.webkit.org/show_bug.cgi?id=45751
1153
1154         Add beginning character look-up optimization which sets the start
1155         index to the first possible successful pattern match.
1156         Extend YARR Interpreter with lookupForBeginChars function which
1157         implements the beginning character look-up optimization.
1158
1159         * yarr/RegexInterpreter.cpp:
1160         (JSC::Yarr::Interpreter::InputStream::readPair):
1161         (JSC::Yarr::Interpreter::InputStream::isNotAvailableInput):
1162         (JSC::Yarr::Interpreter::lookupForBeginChars):
1163         (JSC::Yarr::Interpreter::matchDisjunction):
1164         (JSC::Yarr::Interpreter::interpret):
1165         * yarr/RegexInterpreter.h:
1166         (JSC::Yarr::BytecodePattern::BytecodePattern):
1167
1168 2010-11-17  Alexis Menard  <alexis.menard@nokia.com>, Simon Hausmann  <simon.hausmann@nokia.com>
1169
1170         Reviewed by Kenneth Christiansen, Tor Arne Vestbø.
1171
1172         [Qt] Add support for use GStreamer with the Qt build
1173
1174         Enable the build/inclusion of the wtf/QObject convenience classes.
1175
1176         * JavaScriptCore.pri:
1177         * wtf/wtf.pri:
1178
1179 2010-11-17  Peter Varga  <pvarga@inf.u-szeged.hu>
1180
1181         Reviewed by Gavin Barraclough.
1182
1183         Collect the beginning characters in a RegExp pattern for look-up
1184         optimization
1185         https://bugs.webkit.org/show_bug.cgi?id=45748
1186
1187         Extend the YARR's parser with an algorithm which collects the potential
1188         beginning characters from a RegExp pattern for later look-up optimization.
1189
1190         * yarr/RegexCompiler.cpp:
1191         (JSC::Yarr::BeginCharHelper::BeginCharHelper):
1192         (JSC::Yarr::BeginCharHelper::addBeginChar):
1193         (JSC::Yarr::BeginCharHelper::merge):
1194         (JSC::Yarr::BeginCharHelper::addCharacter):
1195         (JSC::Yarr::BeginCharHelper::linkHotTerms):
1196         (JSC::Yarr::RegexPatternConstructor::RegexPatternConstructor):
1197         (JSC::Yarr::RegexPatternConstructor::addBeginTerm):
1198         (JSC::Yarr::RegexPatternConstructor::setupDisjunctionBeginTerms):
1199         (JSC::Yarr::RegexPatternConstructor::setupAlternativeBeginTerms):
1200         (JSC::Yarr::RegexPatternConstructor::setupBeginChars):
1201         (JSC::Yarr::compileRegex):
1202         * yarr/RegexPattern.h:
1203         (JSC::Yarr::TermChain::TermChain):
1204         (JSC::Yarr::BeginChar::BeginChar):
1205         (JSC::Yarr::RegexPattern::RegexPattern):
1206         (JSC::Yarr::RegexPattern::reset):
1207
1208 2010-11-17  Sheriff Bot  <webkit.review.bot@gmail.com>
1209
1210         Unreviewed, rolling out r72160.
1211         http://trac.webkit.org/changeset/72160
1212         https://bugs.webkit.org/show_bug.cgi?id=49646
1213
1214         Broke lots of fast/profiler tests, among others (Requested by
1215         aroben on #webkit).
1216
1217         * bytecode/CodeBlock.cpp:
1218         (JSC::CodeBlock::dump):
1219         (JSC::CodeBlock::functionRegisterForBytecodeOffset):
1220         (JSC::CodeBlock::shrinkToFit):
1221         * bytecode/CodeBlock.h:
1222         (JSC::CodeBlock::addFunctionRegisterInfo):
1223         * bytecode/Opcode.h:
1224         * bytecompiler/BytecodeGenerator.cpp:
1225         (JSC::BytecodeGenerator::BytecodeGenerator):
1226         (JSC::BytecodeGenerator::emitCall):
1227         (JSC::BytecodeGenerator::emitCallVarargs):
1228         (JSC::BytecodeGenerator::emitReturn):
1229         (JSC::BytecodeGenerator::emitConstruct):
1230         * bytecompiler/BytecodeGenerator.h:
1231         (JSC::CallArguments::profileHookRegister):
1232         * bytecompiler/NodesCodegen.cpp:
1233         (JSC::CallArguments::CallArguments):
1234         * interpreter/Interpreter.cpp:
1235         (JSC::Interpreter::unwindCallFrame):
1236         (JSC::Interpreter::throwException):
1237         (JSC::Interpreter::execute):
1238         (JSC::Interpreter::executeCall):
1239         (JSC::Interpreter::executeConstruct):
1240         (JSC::Interpreter::privateExecute):
1241         * jit/JIT.cpp:
1242         (JSC::JIT::privateCompileMainPass):
1243         * jit/JIT.h:
1244         * jit/JITOpcodes.cpp:
1245         (JSC::JIT::emit_op_profile_will_call):
1246         (JSC::JIT::emit_op_profile_did_call):
1247         * jit/JITOpcodes32_64.cpp:
1248         (JSC::JIT::emit_op_profile_will_call):
1249         (JSC::JIT::emit_op_profile_did_call):
1250         * jit/JITStubs.cpp:
1251         (JSC::DEFINE_STUB_FUNCTION):
1252         * jit/JITStubs.h:
1253         * profiler/Profile.cpp:
1254         (JSC::Profile::Profile):
1255         * profiler/ProfileGenerator.cpp:
1256         (JSC::ProfileGenerator::addParentForConsoleStart):
1257         (JSC::ProfileGenerator::willExecute):
1258         (JSC::ProfileGenerator::didExecute):
1259         (JSC::ProfileGenerator::stopProfiling):
1260         * profiler/ProfileGenerator.h:
1261         * profiler/ProfileNode.cpp:
1262         (JSC::ProfileNode::ProfileNode):
1263         (JSC::ProfileNode::willExecute):
1264         * profiler/ProfileNode.h:
1265         (JSC::ProfileNode::create):
1266         (JSC::ProfileNode::operator==):
1267         * profiler/Profiler.cpp:
1268         (JSC::dispatchFunctionToProfiles):
1269         (JSC::Profiler::willExecute):
1270         (JSC::Profiler::didExecute):
1271         * profiler/Profiler.h:
1272
1273 2010-11-16  Gavin Barraclough  <barraclough@apple.com>
1274
1275         Reviewed by Sam Weinig.
1276
1277         Bug 49635 - Profiler implementation is fragile
1278
1279         The profile presently requires the exception handling mechanism to explicitly
1280         remove all stack frames that are exited during the exception unwind mechanism.
1281         This is fragile in a number of ways:
1282           * We have to change bytecode register allocation when compiling code to run
1283             when profiling, to preserve the callee function (this is also required to
1284             call did_call after the call has returned).
1285           * In the JIT we have to maintain additional data structures
1286             (CodeBlock::RareData::m_functionRegisterInfos) to map back to the register
1287             containing the callee.
1288           * In the interpreter we use 'magic values' to offset into the instruction
1289             stream to rediscover the register containing the function.
1290
1291         Instead, move profiling into the head and tail of functions.
1292           * This correctly accounts the cost of the call itself to the caller.
1293           * This allows us to access the callee function object from the callframe.
1294           * This means that at the point a call is made we can track the stack depth
1295             on the ProfileNode.
1296           * When unwinding we can simply report the depth at which the exception is
1297             being handled - all call frames above this level are freed.
1298
1299         * JavaScriptCore.xcodeproj/project.pbxproj:
1300         * bytecode/CodeBlock.cpp:
1301         (JSC::CodeBlock::dump):
1302         (JSC::CodeBlock::shrinkToFit):
1303         * bytecode/CodeBlock.h:
1304         (JSC::CodeBlock::bytecodeOffset):
1305         (JSC::CodeBlock::methodCallLinkInfo):
1306         * bytecode/Opcode.h:
1307         * bytecompiler/BytecodeGenerator.cpp:
1308         (JSC::BytecodeGenerator::BytecodeGenerator):
1309         (JSC::BytecodeGenerator::emitCall):
1310         (JSC::BytecodeGenerator::emitCallVarargs):
1311         (JSC::BytecodeGenerator::emitReturn):
1312         (JSC::BytecodeGenerator::emitConstruct):
1313         * bytecompiler/BytecodeGenerator.h:
1314         (JSC::CallArguments::count):
1315         * bytecompiler/NodesCodegen.cpp:
1316         (JSC::CallArguments::CallArguments):
1317         * interpreter/Interpreter.cpp:
1318         (JSC::ProfileHostCall::ProfileHostCall):
1319         (JSC::ProfileHostCall::~ProfileHostCall):
1320         (JSC::Interpreter::unwindCallFrame):
1321         (JSC::Interpreter::throwException):
1322         (JSC::Interpreter::execute):
1323         (JSC::Interpreter::executeCall):
1324         (JSC::Interpreter::executeConstruct):
1325         (JSC::Interpreter::privateExecute):
1326         * jit/JIT.cpp:
1327         (JSC::JIT::privateCompileMainPass):
1328         * jit/JIT.h:
1329         * jit/JITOpcodes.cpp:
1330         (JSC::JIT::emit_op_profile_has_called):
1331         (JSC::JIT::emit_op_profile_will_return):
1332         * jit/JITOpcodes32_64.cpp:
1333         (JSC::JIT::emit_op_profile_has_called):
1334         (JSC::JIT::emit_op_profile_will_return):
1335         * jit/JITStubs.cpp:
1336         (JSC::DEFINE_STUB_FUNCTION):
1337         * jit/JITStubs.h:
1338         * profiler/Profile.cpp:
1339         (JSC::Profile::Profile):
1340         * profiler/ProfileGenerator.cpp:
1341         (JSC::ProfileGenerator::addParentForConsoleStart):
1342         (JSC::ProfileGenerator::willExecute):
1343         (JSC::ProfileGenerator::didExecute):
1344         (JSC::ProfileGenerator::exceptionUnwind):
1345         (JSC::ProfileGenerator::stopProfiling):
1346         * profiler/ProfileGenerator.h:
1347         * profiler/ProfileNode.cpp:
1348         (JSC::ProfileNode::ProfileNode):
1349         (JSC::ProfileNode::willExecute):
1350         * profiler/ProfileNode.h:
1351         (JSC::ProfileNode::create):
1352         (JSC::ProfileNode::operator==):
1353         (JSC::ProfileNode::exec):
1354         * profiler/Profiler.cpp:
1355         (JSC::dispatchFunctionToProfiles):
1356         (JSC::Profiler::hasCalled):
1357         (JSC::Profiler::willEvaluate):
1358         (JSC::Profiler::willReturn):
1359         (JSC::Profiler::didEvaluate):
1360         (JSC::Profiler::exceptionUnwind):
1361         * profiler/Profiler.h:
1362
1363 2010-11-16  Brian Weinstein  <bweinstein@apple.com>
1364
1365         Reviewed by Adam Roben and Steve Falkenburg.
1366
1367         Touch Platform.h to force a rebuild for Windows.
1368
1369         * wtf/Platform.h:
1370
1371 2010-11-16  Steve Falkenburg  <sfalken@apple.com>
1372
1373         Reviewed by Adam Roben.
1374
1375         Disable LTCG for Windows Release builds. Add new Release_LTCG configuration.
1376         https://bugs.webkit.org/show_bug.cgi?id=49632
1377
1378         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1379         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
1380         * JavaScriptCore.vcproj/jsc/jsc.vcproj:
1381         * JavaScriptCore.vcproj/testapi/testapi.vcproj:
1382
1383 2010-11-16  Peter Varga  <pvarga@inf.u-szeged.hu>
1384
1385         Reviewed by Gavin Barraclough.
1386
1387         The number of recursive match calls isn't limited in YARR Interpreter
1388         https://bugs.webkit.org/show_bug.cgi?id=47906
1389
1390         Check the number of the matchDisjunction recursive calls to avoid unbounded
1391         recursion.
1392         Now the matchDisjunction function returns JSRegExpResult instead of bool.
1393         The JSRegExpResult enum contains the result of matching or the error code
1394         of the failure (like HitLimit) which terminates the matching.
1395         The error codes are based on pcre's jsRegExpExecute error codes.
1396
1397         * yarr/RegexInterpreter.cpp:
1398         (JSC::Yarr::Interpreter::parenthesesDoBacktrack):
1399         (JSC::Yarr::Interpreter::matchParentheses):
1400         (JSC::Yarr::Interpreter::backtrackParentheses):
1401         (JSC::Yarr::Interpreter::matchDisjunction):
1402         (JSC::Yarr::Interpreter::matchNonZeroDisjunction):
1403         (JSC::Yarr::Interpreter::interpret):
1404         (JSC::Yarr::Interpreter::Interpreter):
1405         * yarr/RegexInterpreter.h:
1406
1407 2010-11-16  Brian Weinstein  <bweinstein@apple.com>
1408
1409         Rest of the Windows build fix.
1410
1411         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1412
1413 2010-11-16  Gavin Barraclough  <barraclough@apple.com>
1414
1415         Windows build fix pt 1.
1416
1417         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1418
1419 2010-11-16  Gavin Barraclough  <barraclough@apple.com>
1420
1421         Reviewed by Oliver Hunt.
1422
1423         https://bugs.webkit.org/show_bug.cgi?id=49606
1424
1425         The bug here is that we read the prototype from the RHS argument using a regular
1426         op_get_by_id before op_instanceof has checked that this is an object implementing
1427         HasInstance. This incorrect behaviour gives rise to further unnecessary complexity
1428         in the code base, since we have additional logic (implemented using the
1429         GetByIdExceptionInfo data structures on CodeBlock) to convert not an object errors
1430         from the get_by_id into invalid parameter errors. Having fixed this bug this code
1431         is all redundant, since in these cases the get_by_id will never have been reached.
1432
1433         * bytecode/CodeBlock.cpp:
1434         (JSC::CodeBlock::dump):
1435         (JSC::CodeBlock::shrinkToFit):
1436         * bytecode/CodeBlock.h:
1437         (JSC::CodeBlock::addExpressionInfo):
1438         * bytecode/Opcode.h:
1439         * bytecompiler/BytecodeGenerator.cpp:
1440         (JSC::BytecodeGenerator::BytecodeGenerator):
1441         (JSC::BytecodeGenerator::emitCheckHasInstance):
1442         * bytecompiler/BytecodeGenerator.h:
1443         * bytecompiler/NodesCodegen.cpp:
1444         (JSC::InstanceOfNode::emitBytecode):
1445         * interpreter/Interpreter.cpp:
1446         (JSC::Interpreter::throwException):
1447         (JSC::Interpreter::privateExecute):
1448         * jit/JIT.cpp:
1449         (JSC::JIT::privateCompileMainPass):
1450         (JSC::JIT::privateCompileSlowCases):
1451         * jit/JIT.h:
1452         * jit/JITOpcodes.cpp:
1453         (JSC::JIT::emit_op_check_has_instance):
1454         (JSC::JIT::emit_op_instanceof):
1455         (JSC::JIT::emitSlow_op_check_has_instance):
1456         (JSC::JIT::emitSlow_op_instanceof):
1457         * jit/JITOpcodes32_64.cpp:
1458         (JSC::JIT::emit_op_check_has_instance):
1459         (JSC::JIT::emit_op_instanceof):
1460         (JSC::JIT::emitSlow_op_check_has_instance):
1461         (JSC::JIT::emitSlow_op_instanceof):
1462         * jit/JITStubs.cpp:
1463         (JSC::DEFINE_STUB_FUNCTION):
1464         * jit/JITStubs.h:
1465         * runtime/ExceptionHelpers.cpp:
1466         (JSC::createInterruptedExecutionException):
1467         (JSC::createTerminatedExecutionException):
1468         (JSC::createUndefinedVariableError):
1469         (JSC::createNotAFunctionError):
1470         (JSC::createNotAnObjectError):
1471         * runtime/ExceptionHelpers.h:
1472         * runtime/JSGlobalData.cpp:
1473         (JSC::JSGlobalData::JSGlobalData):
1474         * runtime/JSGlobalData.h:
1475         * runtime/JSNotAnObject.cpp:
1476         (JSC::JSNotAnObject::toPrimitive):
1477         (JSC::JSNotAnObject::getPrimitiveNumber):
1478         (JSC::JSNotAnObject::toBoolean):
1479         (JSC::JSNotAnObject::toNumber):
1480         (JSC::JSNotAnObject::toString):
1481         (JSC::JSNotAnObject::toObject):
1482         (JSC::JSNotAnObject::getOwnPropertySlot):
1483         (JSC::JSNotAnObject::getOwnPropertyDescriptor):
1484         (JSC::JSNotAnObject::put):
1485         (JSC::JSNotAnObject::deleteProperty):
1486         (JSC::JSNotAnObject::getOwnPropertyNames):
1487         * runtime/JSNotAnObject.h:
1488         (JSC::JSNotAnObject::JSNotAnObject):
1489         * runtime/JSObject.h:
1490         (JSC::JSObject::isActivationObject):
1491         * runtime/JSValue.cpp:
1492         (JSC::JSValue::toObjectSlowCase):
1493         (JSC::JSValue::synthesizeObject):
1494         (JSC::JSValue::synthesizePrototype):
1495
1496 2010-11-15  Darin Adler  <darin@apple.com>
1497
1498         Reviewed by Sam Weinig.
1499
1500         Harden additional string functions against large lengths
1501         https://bugs.webkit.org/show_bug.cgi?id=49574
1502
1503         * wtf/text/CString.cpp:
1504         (WTF::CString::init): Check for length that is too large for CString.
1505         (WTF::CString::newUninitialized): Ditto.
1506         (WTF::CString::copyBufferIfNeeded): Fix types so the length stays
1507         in a size_t.
1508
1509         * wtf/text/WTFString.cpp:
1510         (WTF::String::append): Check for length that is too large.
1511
1512 2010-11-15  Gavin Barraclough  <barraclough@apple.com>
1513
1514         Reviewed by Sam Weinig.
1515
1516         Bug 49577 - Function.prototype should be non-configurable
1517
1518         JSC lazily allocates the prototype property of Function objects.
1519
1520         We check the prototype exists on 'get', but not on 'put'.
1521         If you 'put' without having first done a 'get' you can end up with a configurable
1522         prototype (prototype should only ever be non-configurable).
1523
1524         This is visible in a couple of ways:
1525           * 'delete' on the property may succeed. (the next access will result in a new,
1526           reset prototype object).
1527           * the prototype may be set to a getter.
1528
1529         * runtime/JSFunction.cpp:
1530         (JSC::JSFunction::getOwnPropertyNames):
1531             Reify the prototype property before allowing an enumerate including don't enum properties.
1532         (JSC::JSFunction::put):
1533             Reify the prototype property before any put to it.
1534
1535 2010-11-15  Gavin Barraclough  <barraclough@apple.com>
1536
1537         Reviewed by Geoff Garen.
1538
1539         Bug 49488 - Only add source specific information to exceptions in Interpreter::throwException
1540
1541         Three types of source location information are added to errors.
1542
1543         (1) Divot information.
1544
1545         This was added with the intention of using it to provide better source highlighting in the inspector.
1546         We may still want to do so, but we probably should not be exposing these values in a manner visible to
1547         user scripts – only through an internal C++ interface. The code adding divot properties to objects has
1548         been removed.
1549
1550         (2) Line number information.
1551
1552         Line number information is presently sometimes added at the point the exception is created, and sometimes
1553         added at the point the exception passes through throwException. Change this so that throwException has
1554         the sole responsibility for adding line number and source file information.
1555
1556         (3) Source snippets in the message of certain type errors (e.g. 'doc' in `Result of expression 'doc' [undefined] is not an object.`).
1557
1558         These messages are currently created at the point the exceptions is raised. Instead reformat the message
1559         such that the source snippet is located at the end (`Result of expression 'b1' [undefined] is not an object.`
1560         becomes `'undefined' is not an object (evaluating 'b1.property')`), and append these to the message at
1561         the in throw Exception. This presents a number of advantages:
1562           * we no longer need to have source location information to create these TypeErrors.
1563           * we can chose to append source location information in other error messages, including those where
1564             passing source location to the point of construction would be inconvenient.
1565           * we can chose in future to omit to append source location information when running in a non-debug mode.
1566
1567         This also cleans up some error output, e.g. removing double brackets ('[[]]') around objects in output,
1568         removing double periods (..) at end of lines, and adding slightly more context to some errors.
1569
1570         * bytecode/CodeBlock.cpp:
1571         (JSC::CodeBlock::expressionRangeForBytecodeOffset):
1572             - Separated called to access line and range information.
1573
1574         * bytecode/CodeBlock.h:
1575             - Separated called to access line and range information.
1576
1577         * interpreter/Interpreter.cpp:
1578         (JSC::Interpreter::resolve):
1579         (JSC::Interpreter::resolveSkip):
1580         (JSC::Interpreter::resolveGlobal):
1581         (JSC::Interpreter::resolveGlobalDynamic):
1582         (JSC::Interpreter::resolveBaseAndProperty):
1583         (JSC::isInvalidParamForIn):
1584         (JSC::isInvalidParamForInstanceOf):
1585             - Update parameters passed to error constructors.
1586         (JSC::appendSourceToError):
1587             - Update message property to add location information (previously added in createErrorMessage, in ExceptionHelpers)
1588         (JSC::Interpreter::throwException):
1589             - Updated to call appendSourceToError. 
1590         (JSC::Interpreter::privateExecute):
1591             - Update parameters passed to error constructors.
1592
1593         * jit/JITStubs.cpp:
1594         (JSC::DEFINE_STUB_FUNCTION):
1595             - Update parameters passed to error constructors.
1596
1597         * runtime/Error.cpp:
1598         (JSC::addErrorInfo):
1599         (JSC::hasErrorInfo):
1600             - Removed divot properties.
1601
1602         * runtime/Error.h:
1603             - Removed divot properties.
1604
1605         * runtime/ErrorInstance.cpp:
1606         (JSC::ErrorInstance::ErrorInstance):
1607             - Initialize new property.
1608
1609         * runtime/ErrorInstance.h:
1610         (JSC::ErrorInstance::appendSourceToMessage):
1611         (JSC::ErrorInstance::setAppendSourceToMessage):
1612         (JSC::ErrorInstance::clearAppendSourceToMessage):
1613             - Added flag to check for errors needing location information appending.
1614         (JSC::ErrorInstance::isErrorInstance):
1615             - Added virtual method to check for ErrorInstances.
1616
1617         * runtime/ExceptionHelpers.cpp:
1618         (JSC::createUndefinedVariableError):
1619         (JSC::createInvalidParamError):
1620         (JSC::createNotAConstructorError):
1621         (JSC::createNotAFunctionError):
1622         (JSC::createNotAnObjectError):
1623             - Update parameters passed to error constructors, stopped adding line number information early, changed TypeError messages.
1624
1625         * runtime/ExceptionHelpers.h:
1626             - Updated function signatures.
1627
1628         * runtime/JSFunction.cpp:
1629         (JSC::callHostFunctionAsConstructor):
1630             - Update parameters passed to error constructors.
1631
1632         * runtime/JSObject.h:
1633         (JSC::JSObject::isErrorInstance):
1634             - Added virtual method to check for ErrorInstances.
1635
1636 2010-11-12  Anders Carlsson  <andersca@apple.com>
1637
1638         Reviewed by Adam Roben.
1639
1640         CString(const char*) crashes when passed a null pointer
1641         https://bugs.webkit.org/show_bug.cgi?id=49450
1642
1643         * wtf/text/CString.cpp:
1644         (WTF::CString::CString):
1645         Return early if str is null.
1646
1647 2010-11-11  Gavin Barraclough  <barraclough@apple.com>
1648
1649         Reviewed by Oliver Hunt.
1650
1651         Bug 49420 - Clean up syntax/reference error throw.
1652
1653         Some errors detected at compile time are thrown at runtime. We currently do so using a op_new_error/op_throw bytecode pair.
1654         This is not ideal. op_throw is used for explicit user throw statements, and has different requirements in terms or meta data
1655         attached to the exception (controlled by the explicitThrow parameter passed to Interpreter::throwException). To work around
1656         this, op_new_error has to add the meta data at an early stage, which is unlike other VM exceptions being raised.
1657
1658         We can simplify this and bring into line with other exception behaviour by changing new_error from just allocating an
1659         Exception instance to also throwing it – but as a regular VM throw, correctly passing explicitThrow as false.
1660
1661         * JavaScriptCore.xcodeproj/project.pbxproj:
1662         * bytecode/CodeBlock.cpp:
1663         (JSC::CodeBlock::dump):
1664         (JSC::CodeBlock::expressionRangeForBytecodeOffset):
1665         * bytecode/Opcode.h:
1666         * bytecompiler/BytecodeGenerator.cpp:
1667         (JSC::BytecodeGenerator::emitThrowReferenceError):
1668         (JSC::BytecodeGenerator::emitThrowSyntaxError):
1669         (JSC::BytecodeGenerator::emitThrowExpressionTooDeepException):
1670         * bytecompiler/BytecodeGenerator.h:
1671         (JSC::BytecodeGenerator::emitNodeInConditionContext):
1672         * bytecompiler/NodesCodegen.cpp:
1673         (JSC::ThrowableExpressionData::emitThrowReferenceError):
1674         (JSC::ThrowableExpressionData::emitThrowSyntaxError):
1675         (JSC::RegExpNode::emitBytecode):
1676         (JSC::PostfixErrorNode::emitBytecode):
1677         (JSC::PrefixErrorNode::emitBytecode):
1678         (JSC::AssignErrorNode::emitBytecode):
1679         (JSC::ForInNode::emitBytecode):
1680         (JSC::ContinueNode::emitBytecode):
1681         (JSC::BreakNode::emitBytecode):
1682         (JSC::ReturnNode::emitBytecode):
1683         (JSC::LabelNode::emitBytecode):
1684         * interpreter/Interpreter.cpp:
1685         (JSC::Interpreter::privateExecute):
1686         * jit/JIT.cpp:
1687         (JSC::JIT::privateCompileMainPass):
1688         * jit/JIT.h:
1689         * jit/JITOpcodes.cpp:
1690         (JSC::JIT::emit_op_throw_reference_error):
1691         (JSC::JIT::emit_op_throw_syntax_error):
1692         * jit/JITOpcodes32_64.cpp:
1693         (JSC::JIT::emit_op_throw_reference_error):
1694         (JSC::JIT::emit_op_throw_syntax_error):
1695         * jit/JITStubs.cpp:
1696         (JSC::DEFINE_STUB_FUNCTION):
1697         * jit/JITStubs.h:
1698         * parser/Nodes.h:
1699
1700 2010-11-11  Darin Adler  <darin@apple.com>
1701
1702         Reviewed by Sam Weinig.
1703
1704         Harden some string functions against large lengths
1705         https://bugs.webkit.org/show_bug.cgi?id=49293
1706
1707         * wtf/text/StringImpl.cpp:
1708         (WTF::StringImpl::create): Fix incorrect use of PassRefPtr. Check for
1709         strlen results that are too large for StringImpl.
1710         (WTF::StringImpl::lower): Check for lengths that are too large for
1711         int32_t.
1712         (WTF::StringImpl::upper): Fix incorrect use of PassRefPtr. Check for
1713         lengths that are too large for int32_t.
1714         (WTF::StringImpl::secure): Fix incorect use of PassRefPtr. Use unsigned
1715         rather than int and int32_t so we can handle any length.
1716         (WTF::StringImpl::foldCase): Fix incorrect use of PassRefPtr. Check for
1717         lengths that are too large for int32_t.
1718         (WTF::StringImpl::find): Check for strlen results that are too large for
1719         StringImpl.
1720         (WTF::StringImpl::findIgnoringCase): Ditto.
1721         (WTF::StringImpl::replace): Fix incorrect use of PassRefPtr.
1722         (WTF::StringImpl::createWithTerminatingNullCharacter): Check before
1723         incrementing length.
1724
1725 2010-11-11  Dan Horák  <dan@danny.cz>
1726
1727         Reviewed by Andreas Kling.
1728
1729         Add support for the s390/s390x architectures, it's big-endian
1730         with s390 being 32-bit and s390x being 64-bit.
1731
1732         https://bugs.webkit.org/show_bug.cgi?id=34786
1733
1734         * wtf/Platform.h:
1735
1736 2010-11-10  Csaba Osztrogonác  <ossy@webkit.org>
1737
1738         Reviewed by David Hyatt.
1739
1740         HTML5 Ruby support should be mandatory feature
1741         https://bugs.webkit.org/show_bug.cgi?id=49272
1742
1743         Remove Ruby as optional feature.
1744
1745         * Configurations/FeatureDefines.xcconfig:
1746         * JavaScriptCorePrefix.h:: Touch it to avoid incremental build failure on Windows.
1747
1748 2010-11-10  Peter Rybin  <peter.rybin@gmail.com>
1749
1750         Reviewed by Adam Barth.
1751
1752         HTML parser should provide script column position within HTML document to JavaScript engine
1753         https://bugs.webkit.org/show_bug.cgi?id=45271
1754
1755         Adds TextPosition* classes -- a structure that stores line/column/generation
1756         level coordinates inside text document. Adds *BasedNumber classes -- typesafe int
1757         wrappers that emphasize whether int number is used as zero-based or
1758         one-based.
1759
1760         * GNUmakefile.am:
1761         * JavaScriptCore.gypi:
1762         * JavaScriptCore.xcodeproj/project.pbxproj:
1763         * wtf/text/TextPosition.h: Added.
1764         (WTF::TextPosition::TextPosition):
1765         (WTF::TextPosition::minimumPosition):
1766         (WTF::TextPosition::belowRangePosition):
1767         (WTF::ZeroBasedNumber::fromZeroBasedInt):
1768         (WTF::ZeroBasedNumber::ZeroBasedNumber):
1769         (WTF::ZeroBasedNumber::zeroBasedInt):
1770         (WTF::ZeroBasedNumber::base):
1771         (WTF::ZeroBasedNumber::belowBase):
1772         (WTF::OneBasedNumber::fromOneBasedInt):
1773         (WTF::OneBasedNumber::OneBasedNumber):
1774         (WTF::OneBasedNumber::oneBasedInt):
1775         (WTF::OneBasedNumber::convertAsZeroBasedInt):
1776         (WTF::OneBasedNumber::convertToZeroBased):
1777         (WTF::OneBasedNumber::base):
1778         (WTF::OneBasedNumber::belowBase):
1779         (WTF::toZeroBasedTextPosition):
1780         (WTF::toOneBasedTextPosition):
1781         (WTF::ZeroBasedNumber::convertToOneBased):
1782
1783 2010-11-09  Gabor Loki  <loki@webkit.org>
1784
1785         Reviewed by Gavin Barraclough.
1786
1787         ARM JIT asserts when loading http://reader.google.com in debug mode
1788         https://bugs.webkit.org/show_bug.cgi?id=48912
1789
1790         There are several cases when the uninterrupted sequence is larger than
1791         maximum required offset for pathing the same sequence. Eg.: if in a
1792         uninterrupted sequence the last macroassembler's instruction is a stub
1793         call, it emits store instruction(s) which should not be included in the
1794         calculation of length of uninterrupted sequence. So, the insnSpace and
1795         constSpace should be upper limit instead of hard limit.
1796
1797         * jit/JIT.h:
1798         * jit/JITInlineMethods.h:
1799         (JSC::JIT::endUninterruptedSequence):
1800
1801 2010-11-09  David Kilzer  <ddkilzer@apple.com>
1802
1803         <http://webkit.org/b/49279> Fix include statements for local headers
1804
1805         Reviewed by Gavin Barraclough.
1806
1807         Use "Foo.h" instead of <Foo.h> for local headers.
1808
1809         * assembler/AbstractMacroAssembler.h: Also fixed sort order.
1810         * assembler/CodeLocation.h:
1811         * yarr/RegexJIT.h:
1812         * yarr/RegexParser.h:
1813
1814 2010-11-08  Adam Roben  <aroben@apple.com>
1815
1816         Roll out r71532
1817
1818         It broke the build for Cygwin 1.7 installs. Cygwin 1.7's default
1819         .bashrc unsets %TEMP%, which broke copy-tools.cmd.
1820
1821         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
1822         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj:
1823         * JavaScriptCore.vcproj/JavaScriptCore/copy-tools.cmd: Removed.
1824         * JavaScriptCore.vcproj/JavaScriptCore/show-alert.js: Removed.
1825
1826 2010-11-08  Martin Robinson  <mrobinson@igalia.com>
1827
1828         Reviewed by Xan Lopez.
1829
1830         >=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'
1831         https://bugs.webkit.org/show_bug.cgi?id=49128
1832
1833         r59042 introduced a C++-style comment in Platform.h, which is often
1834         included in C source files. Change it to a C-style comment.
1835
1836         * wtf/Platform.h: Fix the C++-style comment.
1837
1838 2010-11-08  Adam Roben  <aroben@apple.com>
1839
1840         Show a message and cause the build to immediately fail when any
1841         .vsprops files are copied
1842
1843         When $WebKitLibrariesDir is set to a non-standard location, the
1844         .vsprops files have to be copied from WebKitLibraries/win to
1845         $WebKitLibrariesDir. When this happens, Visual Studio doesn't pick up
1846         changes to the .vsprops files until the next time it opens the solution
1847         file. Before this patch, the build would soldier on with the old
1848         .vsprops files, leading to strange build failures. Now we detect that
1849         the .vsprops files have been updated, display a message to the user
1850         telling them what to do, and make the build fail immediately.
1851
1852         Fixes <http://webkit.org/b/49181> Windows build fail mysteriously when
1853         .vsprops files are updated
1854
1855         Reviewed by Steve Falkenburg.
1856
1857         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
1858         Moved code to copy the tools directory to the new copy-tools.cmd
1859         script. Moved that after the command that writes the buildfailed file
1860         so the build will be considered a failure if copy-tools.cmd fails.
1861         Changed to write the project name into buildfailed like all our other
1862         projects do, so those other projects will know that the failure was due
1863         to this project.
1864
1865         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj:
1866         Added new scripts.
1867
1868         * JavaScriptCore.vcproj/JavaScriptCore/copy-tools.cmd: Added. Copies
1869         the tools directory to $WebKitLibrariesDir. If any files were copied,
1870         we display a message to the user and exit with error code 1 to cause
1871         the build to fail. In non-interactive builds, we just print the message
1872         to the build log. In interactive builds, we show the message in an
1873         alert.
1874
1875         * JavaScriptCore.vcproj/JavaScriptCore/show-alert.js: Added. Uses
1876         Windows Scripting Host to display a message in an alert.
1877
1878 2010-11-07  Sam Magnuson  <smagnuson@netflix.com>
1879
1880         Reviewed by Andreas Kling.
1881
1882         [Qt] make install does not cause JavaScriptCore to be built
1883         https://bugs.webkit.org/show_bug.cgi?id=49114
1884
1885         * JavaScriptCore.pro:
1886
1887 2010-11-05  Oliver Hunt  <oliver@apple.com>
1888
1889         Reviewed by Gavin Barraclough.
1890
1891         Website consistently crashing TOT in JIT::execute() on news.com.au
1892         https://bugs.webkit.org/show_bug.cgi?id=48954
1893
1894         The problem here was the strict pass of this conversion was loading the
1895         this structure into one register but doing the flags check off a different
1896         register.  This is clearly wrong.  I have been unable to trigger the crash
1897         with a reduction, but I've added an assertion to the this conversion to
1898         attempt to make it more readily catchable in future.
1899
1900         * jit/JITOpcodes.cpp:
1901         (JSC::JIT::emit_op_convert_this_strict):
1902         * jit/JITOpcodes32_64.cpp:
1903         (JSC::JIT::emit_op_convert_this_strict):
1904         * jit/JITStubs.cpp:
1905         (JSC::DEFINE_STUB_FUNCTION):
1906
1907 2010-11-04  Xan Lopez  <xlopez@igalia.com>
1908
1909         Reviewed by Adam Barth.
1910
1911         Use leakRef instead of releaseRef
1912         https://bugs.webkit.org/show_bug.cgi?id=48974
1913
1914         Use leakRef instead of the deprecated releaseRef. This was renamed
1915         some time ago because 'releaseRef' is too close to 'release',
1916         which does something completely different.
1917
1918 2010-11-04  Eric Seidel  <eric@webkit.org>
1919
1920         Reviewed by Gavin Barraclough.
1921
1922         REGRESSION(49798): Crash in HTMLObjectElement::parseMappedAttribute
1923         https://bugs.webkit.org/show_bug.cgi?id=48789
1924
1925         The contract for all String/AtomicString methods seems to be that it's
1926         safe to call them, even when the String is null (impl() returns 0).
1927         This contract was broken by r49798 (unintentionally) when optimizing
1928         for dromeo.
1929         This patch adds a null check to AtomicString::lower() fixing this
1930         crash and preventing future confusion.
1931
1932         * wtf/text/AtomicString.cpp:
1933         (WTF::AtomicString::lower):
1934
1935 2010-11-04  Adam Barth  <abarth@webkit.org>
1936
1937         Enabled ICCJPEG on Chromium Mac
1938         https://bugs.webkit.org/show_bug.cgi?id=48977
1939
1940         * wtf/Platform.h:
1941
1942 2010-11-03  Oliver Hunt  <oliver@apple.com>
1943
1944         Reviewed by Gavin Barraclough.
1945
1946         Crash in Function.prototype.call.apply
1947         https://bugs.webkit.org/show_bug.cgi?id=48485
1948
1949         The problem here was op_load_varargs failing to ensure that
1950         there was sufficient space for the entire callframe prior to
1951         op_call_varargs.  This meant that when we then re-entered the
1952         VM it was possible to stomp over an earlier portion of the
1953         stack, so causing sub-optimal behaviour.
1954
1955         * bytecode/Opcode.h:
1956         * bytecompiler/BytecodeGenerator.cpp:
1957         (JSC::BytecodeGenerator::emitLoadVarargs):
1958         * bytecompiler/BytecodeGenerator.h:
1959         * bytecompiler/NodesCodegen.cpp:
1960         (JSC::ApplyFunctionCallDotNode::emitBytecode):
1961         * jit/JIT.cpp:
1962         (JSC::JIT::privateCompile):
1963         * jit/JITOpcodes.cpp:
1964         (JSC::JIT::emit_op_load_varargs):
1965
1966 2010-11-03  Kenneth Russell  <kbr@google.com>
1967
1968         Reviewed by Chris Marrin.
1969
1970         Redesign extension mechanism in GraphicsContext3D
1971         https://bugs.webkit.org/show_bug.cgi?id=46894
1972
1973         * JavaScriptCore.exp:
1974          - Exposed String::split(const String&, Vector<String>).
1975
1976 2010-11-03  Adam Roben  <aroben@apple.com>
1977
1978         Bring WTF.vcproj up to date
1979
1980         * JavaScriptCore.vcproj/WTF/WTF.vcproj: Added filters for the text and
1981         unicode directories, added new files, removed old files.
1982
1983 2010-11-03  Gabor Loki  <loki@webkit.org>
1984
1985         Reviewed by Andreas Kling.
1986
1987         Remove unused initializeWeakRandomNumberGenerator
1988         https://bugs.webkit.org/show_bug.cgi?id=48899
1989
1990         WeakRandom class is used instead of weakRandomNumber and its initializer.
1991
1992         * wtf/RandomNumberSeed.h:
1993
1994 2010-11-03  Gabor Loki  <loki@webkit.org>
1995
1996         Reviewed by Geoffrey Garen.
1997
1998         Unused class: JSFastMath with JSValue64
1999         https://bugs.webkit.org/show_bug.cgi?id=48835
2000
2001         Remove unused JSFastMath class.
2002
2003         * runtime/JSImmediate.h:
2004
2005 2010-11-02  Adam Roben  <aroben@apple.com>
2006
2007         Windows build fix after r71127
2008
2009         MSVC isn't smart enough to figure out that the definition of the global
2010         nullptr variable isn't needed, so we provide one for it.
2011
2012         Fixes <http://webkit.org/b/48862> Windows build is broken due to
2013         undefined symbol nullptr
2014
2015         Reviewed by Anders Carlsson.
2016
2017         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Export nullptr.
2018
2019         * JavaScriptCore.vcproj/WTF/WTF.vcproj: Added NullPtr.cpp and let VS
2020         resort the files.
2021
2022         * wtf/NullPtr.cpp: Added.
2023
2024 2010-11-02  Martin Robinson  <mrobinson@igalia.com>
2025
2026         Reviewed by Xan Lopez.
2027
2028         Remove special handling of HashTableDeletedValue in PlatformRefPtr and manually manage memory that cannot be controlled by HashTraits
2029         https://bugs.webkit.org/show_bug.cgi?id=48841
2030
2031         Remove special handling of HashTableDeletedValue in PlatformRefPtr.
2032         This is better handled on a case-by-case basis, when HashTraits
2033         cannot account for it.
2034
2035         * wtf/PlatformRefPtr.h:
2036         (WTF::PlatformRefPtr::~PlatformRefPtr):
2037         (WTF::PlatformRefPtr::clear):
2038         (WTF::::operator):
2039
2040 2010-10-29  Oliver Hunt  <oliver@apple.com>
2041
2042         Reviewed by Gavin Barraclough.
2043
2044         REGRESSION: r69429-r69611: Crash in JSC::Interpreter::privateExecute
2045         https://bugs.webkit.org/show_bug.cgi?id=47573
2046
2047         I think the interpreter portion of this was introduced by
2048         an incorrect but silent merge when I updated prior to committing.
2049         The JIT change is basically just a correctness fix, but it is
2050         needed to prevent the testcase from asserting in debug builds.
2051
2052         The basic problem is incorrectly setting the activation object
2053         on an arguments object.  The crash was due to us setting a null
2054         activation in the interpreter, in the jit we were setting the
2055         activation of a strict mode arguments object.
2056
2057         * interpreter/Interpreter.cpp:
2058         (JSC::Interpreter::privateExecute):
2059         * jit/JITStubs.cpp:
2060         (JSC::DEFINE_STUB_FUNCTION):
2061         * wtf/Platform.h:
2062
2063 2010-10-29  Csaba Osztrogonác  <ossy@webkit.org>
2064
2065         Reviewed by Adam Roben and David Kilzer.
2066
2067         Fix and cleanup of build systems
2068         https://bugs.webkit.org/show_bug.cgi?id=48342
2069
2070         * Configurations/FeatureDefines.xcconfig: Add missing ENABLE_FULLSCREEN_API
2071
2072 2010-10-28  Kwang Yul Seo  <skyul@company100.net>
2073
2074         Reviewed by Darin Adler.
2075
2076         Include stddef.h unconditionally in Assertions.h
2077         https://bugs.webkit.org/show_bug.cgi?id=48573
2078
2079         There is no reason to have stddef.h include be MSVC-only.
2080
2081         * wtf/Assertions.h:
2082
2083 2010-10-28  Herczeg Zoltan  <zherczeg@webkit.org>
2084
2085         Rubber stamped by Csaba Osztrogonác.
2086
2087         Try to fix interpreter build.
2088
2089         Needed parentheses around assignment to avoid GCC warning after
2090         http://trac.webkit.org/changeset/70703
2091
2092         * interpreter/Interpreter.cpp:
2093         (JSC::Interpreter::privateExecute):
2094
2095 2010-10-28  Peter Varga  <pvarga@inf.u-szeged.hu>
2096
2097         Reviewed by Csaba Osztrogonác.
2098
2099         resetAssertionMatches() is an unused function in YARR Interpreter
2100         https://bugs.webkit.org/show_bug.cgi?id=48503
2101
2102         The resetAssertionMatches() function is removed from YARR Interpreter
2103         because it's never called.
2104
2105         * yarr/RegexInterpreter.cpp:
2106         (JSC::Yarr::Interpreter::resetMatches):
2107
2108 2010-10-28  Zoltan Herczeg  <zherczeg@webkit.org>
2109
2110         Reviewed by Andreas Kling.
2111
2112         Wrong instruction form for BKPT
2113         https://bugs.webkit.org/show_bug.cgi?id=48427
2114
2115         One '0' is missing from BKPT instruction.
2116         Thanks for Jacob Bramley for reporting this error.
2117
2118         * assembler/ARMAssembler.h:
2119
2120 2010-10-28  Xan Lopez  <xlopez@igalia.com>
2121
2122         Try to fix Snow Leopard build.
2123
2124         * jit/JITPropertyAccess.cpp:
2125         (JSC::JIT::testPrototype):
2126
2127 2010-10-28  Xan Lopez  <xlopez@igalia.com>
2128
2129         Reviewed by Oliver Hunt.
2130
2131         Do not have two different asCell APIs in JSValue
2132         https://bugs.webkit.org/show_bug.cgi?id=47979
2133
2134         Remove JSCell* asCell(JSValue) in favor of only using
2135         JSValue::asCell().
2136
2137         * API/APICast.h:
2138         (toRef):
2139         * jit/JITPropertyAccess32_64.cpp:
2140         (JSC::JIT::testPrototype):
2141         * jit/JITStubs.cpp:
2142         (JSC::JITThunks::tryCachePutByID):
2143         (JSC::JITThunks::tryCacheGetByID):
2144         (JSC::DEFINE_STUB_FUNCTION):
2145         * runtime/GetterSetter.h:
2146         (JSC::asGetterSetter):
2147         * runtime/JSByteArray.h:
2148         (JSC::asByteArray):
2149         * runtime/JSCell.h:
2150         (JSC::JSCell::getCallData):
2151         (JSC::JSCell::getConstructData):
2152         * runtime/JSString.h:
2153         (JSC::RopeBuilder::appendValueInConstructAndIncrementLength):
2154         (JSC::asString):
2155         * runtime/JSValue.h:
2156         * runtime/Operations.cpp:
2157         (JSC::jsIsObjectType):
2158         * runtime/Operations.h:
2159         (JSC::normalizePrototypeChain):
2160         * runtime/Protect.h:
2161         (JSC::gcProtect):
2162         (JSC::gcUnprotect):
2163
2164 2010-10-27  Chao-ying Fu  <fu@mips.com>
2165
2166         Reviewed by Oliver Hunt.
2167
2168         Support emit_op_mod() for MIPS on JSVALUE32_64
2169         https://bugs.webkit.org/show_bug.cgi?id=46511
2170
2171         This patch uses MIPS div instructions for op_mod to improve performance.
2172
2173         * jit/JITArithmetic32_64.cpp:
2174         (JSC::JIT::emit_op_mod):
2175
2176 2010-10-27  Brent Fulgham  <bfulgham@webkit.org>
2177
2178         Unreviewed build correction.
2179
2180         * wtf/Platform.h: Make sure ACCELERATED_COMPOSITING is
2181         turned off in the WinCairo port.  This isn't supported (yet.)
2182
2183 2010-10-27  Chris Rogers  <crogers@google.com>
2184
2185         Reviewed by Chris Marrin.
2186
2187         Add ENABLE_WEB_AUDIO feature enable flag (initially disabled) to build-webkit
2188         https://bugs.webkit.org/show_bug.cgi?id=48279
2189
2190         * Configurations/FeatureDefines.xcconfig:
2191
2192 2010-10-27  Brian Weinstein  <bweinstein@apple.com>
2193
2194         Windows build fix.
2195
2196         * jit/JITStubs.cpp:
2197         (JSC::jitThrow):
2198
2199 2010-10-27  Gavin Barraclough  <barraclough@apple.com>
2200
2201         Reviewed by Oliver Hunt.
2202
2203         Bug 48365 - Remove output parameters from JITStackFrame
2204
2205         The JIT stub functions presently use the stackframe to provide a couple of additional return values.
2206           * In the case of uncaught exceptions the exception value is returned on the stackframe.exception property.
2207           * In the case of caught exceptions the updated value for the callFrame register is returned on the stackframe.callFrame property.
2208
2209         Change exception returns such that exceptions are always returned on JSGlobalData::exception.
2210         Change op_catch such that the new CallFrame value is returned from op_throw / vm_throw in regT0.
2211
2212         * JavaScriptCore.xcodeproj/project.pbxproj:
2213         * debugger/Debugger.cpp:
2214         (JSC::evaluateInGlobalCallFrame):
2215         * debugger/DebuggerCallFrame.cpp:
2216         (JSC::DebuggerCallFrame::evaluate):
2217         * interpreter/CachedCall.h:
2218         (JSC::CachedCall::CachedCall):
2219         (JSC::CachedCall::call):
2220         * interpreter/CallFrame.h:
2221         (JSC::ExecState::exception):
2222         * interpreter/Interpreter.cpp:
2223         (JSC::Interpreter::callEval):
2224         (JSC::Interpreter::Interpreter):
2225         (JSC::Interpreter::execute):
2226         (JSC::Interpreter::executeCall):
2227         (JSC::Interpreter::executeConstruct):
2228         (JSC::Interpreter::prepareForRepeatCall):
2229         (JSC::Interpreter::privateExecute):
2230         * interpreter/Interpreter.h:
2231         * jit/JITCode.h:
2232         (JSC::JITCode::execute):
2233         * jit/JITOpcodes.cpp:
2234         (JSC::JIT::emit_op_catch):
2235         * jit/JITOpcodes32_64.cpp:
2236         (JSC::JIT::emit_op_catch):
2237         * jit/JITStubs.cpp:
2238         (JSC::ctiTrampoline):
2239         (JSC::jitThrow):
2240         (JSC::DEFINE_STUB_FUNCTION):
2241         * jit/JITStubs.h:
2242         * runtime/ArrayPrototype.cpp:
2243         (JSC::arrayProtoFuncFilter):
2244         (JSC::arrayProtoFuncMap):
2245         (JSC::arrayProtoFuncEvery):
2246         (JSC::arrayProtoFuncForEach):
2247         (JSC::arrayProtoFuncSome):
2248         (JSC::arrayProtoFuncReduce):
2249         (JSC::arrayProtoFuncReduceRight):
2250         * runtime/CallData.cpp:
2251         (JSC::call):
2252         * runtime/Completion.cpp:
2253         (JSC::evaluate):
2254         * runtime/ConstructData.cpp:
2255         (JSC::construct):
2256         * runtime/ExceptionHelpers.cpp:
2257         (JSC::createErrorForInvalidGlobalAssignment):
2258         (JSC::throwOutOfMemoryError):
2259         (JSC::throwStackOverflowError):
2260         * runtime/ExceptionHelpers.h:
2261         * runtime/JSArray.cpp:
2262         (JSC::JSArray::sort):
2263         * runtime/JSGlobalObjectFunctions.cpp:
2264         (JSC::globalFuncEval):
2265         * runtime/StringPrototype.cpp:
2266         (JSC::stringProtoFuncReplace):
2267
2268 2010-10-27  Gabor Loki  <loki@webkit.org>
2269
2270         Reviewed by Oliver Hunt.
2271
2272         https://bugs.webkit.org/show_bug.cgi?id=48060
2273         Speed up op_jeq_null and op_jneq_null.
2274
2275         For both opcodes the NullTag and UndefinedTag are checked to control the
2276         jump. These values can be simply checked by AboveOrEqual or Below
2277         condition if they are the two highest unsigned integers from JSValue's
2278         Tag field.
2279
2280         * jit/JITOpcodes32_64.cpp:
2281         (JSC::JIT::emit_op_jeq_null):
2282         (JSC::JIT::emit_op_jneq_null):
2283         * runtime/JSValue.h:
2284
2285 2010-10-25  Geoffrey Garen  <ggaren@apple.com>
2286
2287         Reviewed by Oliver Hunt.
2288
2289         https://bugs.webkit.org/show_bug.cgi?id=41948
2290         REGRESSION(r60392): Registerfile can be unwound too far following an exception
2291         
2292         SunSpider reports no change.
2293
2294         * interpreter/Interpreter.cpp:
2295         (JSC::Interpreter::throwException): Walk the stack to calculate the high
2296         water mark currently in use. It's not safe to assume that the current
2297         CallFrame's high water mark is the highest high water mark because
2298         calls do not always set up at the end of a CallFrame. A large caller
2299         CallFrame can encompass a small callee CallFrame.
2300
2301         * jit/JITOpcodes.cpp:
2302         (JSC::JIT::privateCompileCTINativeCall):
2303         * jit/JITOpcodes32_64.cpp:
2304         (JSC::JIT::privateCompileCTINativeCall): Make sure to set a 0 CodeBlock
2305         in the CallFrame of a host call, like the Interpreter does, instead of
2306         leaving the CodeBlock field uninitialized. The backtracing code requires
2307         a valid CodeBlock field in each CallFrame.
2308
2309 2010-10-27  Gabor Loki  <loki@webkit.org>
2310
2311         Reviewed by Csaba Osztrogonác.
2312
2313         Add cmn to branch32(reg, imm) on ARM
2314         https://bugs.webkit.org/show_bug.cgi?id=48062
2315
2316         The conditional comparison can be done with cmn if the imm value is
2317         negative and can fit into the cmn instruction.
2318
2319         * assembler/MacroAssemblerARM.h:
2320         (JSC::MacroAssemblerARM::branch32):
2321
2322 2010-10-26  Oliver Hunt  <oliver@apple.com>
2323
2324         Interpreter build fix.
2325
2326         * interpreter/Interpreter.cpp:
2327         (JSC::Interpreter::privateExecute):
2328
2329 2010-10-25  Oliver Hunt  <oliver@apple.com>
2330
2331         Reviewed by Gavin Barraclough.
2332
2333         Remove exec and globalData arguments from jsNumber
2334         https://bugs.webkit.org/show_bug.cgi?id=48270
2335
2336         Remove the now unused exec and globalData arguments from jsNumber
2337         and mechanically update all users of jsNumber.
2338
2339         * API/JSValueRef.cpp:
2340         (JSValueMakeNumber):
2341         * bytecompiler/BytecodeGenerator.cpp:
2342         (JSC::BytecodeGenerator::emitLoad):
2343         * bytecompiler/NodesCodegen.cpp:
2344         (JSC::ArrayNode::emitBytecode):
2345         * jit/JITArithmetic.cpp:
2346         (JSC::JIT::emit_op_mod):
2347         * jit/JITArithmetic32_64.cpp:
2348         (JSC::JIT::emit_op_mod):
2349         * jit/JITOpcodes.cpp:
2350         (JSC::JIT::emit_op_jfalse):
2351         (JSC::JIT::emit_op_jtrue):
2352         * jit/JITStubs.cpp:
2353         (JSC::DEFINE_STUB_FUNCTION):
2354         * jsc.cpp:
2355         (functionRun):
2356         * runtime/Arguments.cpp:
2357         (JSC::Arguments::getOwnPropertySlot):
2358         (JSC::Arguments::getOwnPropertyDescriptor):
2359         * runtime/ArrayConstructor.cpp:
2360         (JSC::ArrayConstructor::ArrayConstructor):
2361         * runtime/ArrayPrototype.cpp:
2362         (JSC::arrayProtoFuncPop):
2363         (JSC::arrayProtoFuncPush):
2364         (JSC::arrayProtoFuncShift):
2365         (JSC::arrayProtoFuncSplice):
2366         (JSC::arrayProtoFuncUnShift):
2367         (JSC::arrayProtoFuncFilter):
2368         (JSC::arrayProtoFuncMap):
2369         (JSC::arrayProtoFuncEvery):
2370         (JSC::arrayProtoFuncForEach):
2371         (JSC::arrayProtoFuncSome):
2372         (JSC::arrayProtoFuncReduce):
2373         (JSC::arrayProtoFuncReduceRight):
2374         (JSC::arrayProtoFuncIndexOf):
2375         (JSC::arrayProtoFuncLastIndexOf):
2376         * runtime/BooleanConstructor.cpp:
2377         (JSC::BooleanConstructor::BooleanConstructor):
2378         * runtime/CachedTranscendentalFunction.h:
2379         (JSC::CachedTranscendentalFunction::operator()):
2380         * runtime/DateConstructor.cpp:
2381         (JSC::DateConstructor::DateConstructor):
2382         (JSC::dateParse):
2383         (JSC::dateNow):
2384         (JSC::dateUTC):
2385         * runtime/DateInstance.cpp:
2386         (JSC::DateInstance::DateInstance):
2387         * runtime/DatePrototype.cpp:
2388         (JSC::dateProtoFuncGetFullYear):
2389         (JSC::dateProtoFuncGetUTCFullYear):
2390         (JSC::dateProtoFuncGetMonth):
2391         (JSC::dateProtoFuncGetUTCMonth):
2392         (JSC::dateProtoFuncGetDate):
2393         (JSC::dateProtoFuncGetUTCDate):
2394         (JSC::dateProtoFuncGetDay):
2395         (JSC::dateProtoFuncGetUTCDay):
2396         (JSC::dateProtoFuncGetHours):
2397         (JSC::dateProtoFuncGetUTCHours):
2398         (JSC::dateProtoFuncGetMinutes):
2399         (JSC::dateProtoFuncGetUTCMinutes):
2400         (JSC::dateProtoFuncGetSeconds):
2401         (JSC::dateProtoFuncGetUTCSeconds):
2402         (JSC::dateProtoFuncGetMilliSeconds):
2403         (JSC::dateProtoFuncGetUTCMilliseconds):
2404         (JSC::dateProtoFuncGetTimezoneOffset):
2405         (JSC::dateProtoFuncSetTime):
2406         (JSC::setNewValueFromTimeArgs):
2407         (JSC::setNewValueFromDateArgs):
2408         (JSC::dateProtoFuncSetYear):
2409         (JSC::dateProtoFuncGetYear):
2410         * runtime/Error.cpp:
2411         (JSC::addErrorSourceInfo):
2412         (JSC::addErrorDivotInfo):
2413         * runtime/ErrorConstructor.cpp:
2414         (JSC::ErrorConstructor::ErrorConstructor):
2415         * runtime/FunctionConstructor.cpp:
2416         (JSC::FunctionConstructor::FunctionConstructor):
2417         * runtime/FunctionPrototype.cpp:
2418         (JSC::FunctionPrototype::FunctionPrototype):
2419         * runtime/JSArray.cpp:
2420         (JSC::JSArray::getOwnPropertySlot):
2421         (JSC::JSArray::getOwnPropertyDescriptor):
2422         * runtime/JSByteArray.cpp:
2423         (JSC::JSByteArray::JSByteArray):
2424         * runtime/JSByteArray.h:
2425         (JSC::JSByteArray::getIndex):
2426         * runtime/JSFunction.cpp:
2427         (JSC::JSFunction::JSFunction):
2428         (JSC::JSFunction::lengthGetter):
2429         (JSC::JSFunction::getOwnPropertyDescriptor):
2430         * runtime/JSGlobalObject.cpp:
2431         (JSC::JSGlobalObject::reset):
2432         * runtime/JSGlobalObjectFunctions.cpp:
2433         (JSC::globalFuncParseInt):
2434         (JSC::globalFuncParseFloat):
2435         * runtime/JSNumberCell.h:
2436         (JSC::JSValue::JSValue):
2437         (JSC::jsNaN):
2438         (JSC::JSValue::toJSNumber):
2439         * runtime/JSONObject.cpp:
2440         (JSC::unwrapBoxedPrimitive):
2441         (JSC::PropertyNameForFunctionCall::value):
2442         (JSC::JSONStringify):
2443         * runtime/JSString.cpp:
2444         (JSC::JSString::getStringPropertyDescriptor):
2445         * runtime/JSString.h:
2446         (JSC::JSString::getStringPropertySlot):
2447         * runtime/JSValue.h:
2448         (JSC::jsDoubleNumber):
2449         (JSC::jsNumber):
2450         (JSC::jsNaN):
2451         (JSC::JSValue::JSValue):
2452         (JSC::JSValue::toJSNumber):
2453         * runtime/LiteralParser.cpp:
2454         (JSC::LiteralParser::parse):
2455         * runtime/MathObject.cpp:
2456         (JSC::MathObject::MathObject):
2457         (JSC::mathProtoFuncAbs):
2458         (JSC::mathProtoFuncACos):
2459         (JSC::mathProtoFuncASin):
2460         (JSC::mathProtoFuncATan):
2461         (JSC::mathProtoFuncATan2):
2462         (JSC::mathProtoFuncCeil):
2463         (JSC::mathProtoFuncCos):
2464         (JSC::mathProtoFuncExp):
2465         (JSC::mathProtoFuncFloor):
2466         (JSC::mathProtoFuncLog):
2467         (JSC::mathProtoFuncMax):
2468         (JSC::mathProtoFuncMin):
2469         (JSC::mathProtoFuncPow):
2470         (JSC::mathProtoFuncRandom):
2471         (JSC::mathProtoFuncRound):
2472         (JSC::mathProtoFuncSin):
2473         (JSC::mathProtoFuncSqrt):
2474         (JSC::mathProtoFuncTan):
2475         * runtime/NativeErrorConstructor.cpp:
2476         (JSC::NativeErrorConstructor::NativeErrorConstructor):
2477         * runtime/NumberConstructor.cpp:
2478         (JSC::NumberConstructor::NumberConstructor):
2479         (JSC::numberConstructorNaNValue):
2480         (JSC::numberConstructorNegInfinity):
2481         (JSC::numberConstructorPosInfinity):
2482         (JSC::numberConstructorMaxValue):
2483         (JSC::numberConstructorMinValue):
2484         (JSC::constructWithNumberConstructor):
2485         (JSC::callNumberConstructor):
2486         * runtime/NumberPrototype.cpp:
2487         (JSC::NumberPrototype::NumberPrototype):
2488         * runtime/ObjectConstructor.cpp:
2489         (JSC::ObjectConstructor::ObjectConstructor):
2490         * runtime/Operations.cpp:
2491         (JSC::jsAddSlowCase):
2492         * runtime/Operations.h:
2493         (JSC::jsAdd):
2494         * runtime/PrototypeFunction.cpp:
2495         (JSC::PrototypeFunction::PrototypeFunction):
2496         * runtime/RegExpConstructor.cpp:
2497         (JSC::RegExpConstructor::RegExpConstructor):
2498         (JSC::RegExpMatchesArray::fillArrayInstance):
2499         * runtime/RegExpObject.cpp:
2500         (JSC::regExpObjectLastIndex):
2501         * runtime/StringConstructor.cpp:
2502         (JSC::StringConstructor::StringConstructor):
2503         * runtime/StringPrototype.cpp:
2504         (JSC::StringPrototype::StringPrototype):
2505         (JSC::stringProtoFuncReplace):
2506         (JSC::stringProtoFuncCharCodeAt):
2507         (JSC::stringProtoFuncIndexOf):
2508         (JSC::stringProtoFuncLastIndexOf):
2509         (JSC::stringProtoFuncSearch):
2510         (JSC::stringProtoFuncLocaleCompare):
2511
2512 2010-10-25  David Tapuska  <dtapuska@rim.com>
2513
2514         Reviewed by David Kilzer.
2515
2516         Enable VFP if our compiler settings indicated we had a hardware
2517         VFP.
2518
2519         https://bugs.webkit.org/show_bug.cgi?id=46096
2520
2521         * assembler/MacroAssemblerARM.cpp:
2522         (JSC::isVFPPresent):
2523
2524 2010-10-25  Sheriff Bot  <webkit.review.bot@gmail.com>
2525
2526         Unreviewed, rolling out r70451.
2527         http://trac.webkit.org/changeset/70451
2528         https://bugs.webkit.org/show_bug.cgi?id=48249
2529
2530         Broke set-unloaded-frame-location.html under Qt (Requested by
2531         caseq on #webkit).
2532
2533         * GNUmakefile.am:
2534         * JavaScriptCore.gypi:
2535         * JavaScriptCore.xcodeproj/project.pbxproj:
2536         * wtf/text/TextPosition.h: Removed.
2537
2538 2010-10-25  Patrick Gansterer  <paroga@webkit.org>
2539
2540         Reviewed by David Kilzer.
2541
2542         Replace _countof with WTF_ARRAY_LENGTH
2543         https://bugs.webkit.org/show_bug.cgi?id=48229
2544
2545         * wtf/Platform.h:
2546
2547 2010-10-25  Peter Rybin  <peter.rybin@gmail.com>
2548
2549         Reviewed by Adam Barth.
2550
2551         HTML parser should provide script column position within HTML document to JavaScript engine
2552         https://bugs.webkit.org/show_bug.cgi?id=45271
2553
2554         Adds TextPosition* classes -- a structure that stores line/column/generation
2555         level coordinates inside text document. Adds *BasedNumber classes -- typesafe int
2556         wrappers that emphasize whether int number is used as zero-based or
2557         one-based.
2558
2559         * GNUmakefile.am:
2560         * JavaScriptCore.gypi:
2561         * JavaScriptCore.xcodeproj/project.pbxproj:
2562         * wtf/text/TextPosition.h: Added.
2563         (WTF::TextPosition::TextPosition):
2564         (WTF::TextPosition::minimumPosition):
2565         (WTF::TextPosition::belowRangePosition):
2566         (WTF::ZeroBasedNumber::fromZeroBasedInt):
2567         (WTF::ZeroBasedNumber::ZeroBasedNumber):
2568         (WTF::ZeroBasedNumber::zeroBasedInt):
2569         (WTF::ZeroBasedNumber::base):
2570         (WTF::ZeroBasedNumber::belowBase):
2571         (WTF::OneBasedNumber::fromOneBasedInt):
2572         (WTF::OneBasedNumber::OneBasedNumber):
2573         (WTF::OneBasedNumber::oneBasedInt):
2574         (WTF::OneBasedNumber::convertAsZeroBasedInt):
2575         (WTF::OneBasedNumber::convertToZeroBased):
2576         (WTF::OneBasedNumber::base):
2577         (WTF::OneBasedNumber::belowBase):
2578         (WTF::toZeroBasedTextPosition):
2579         (WTF::toOneBasedTextPosition):
2580         (WTF::ZeroBasedNumber::convertToOneBased):
2581
2582 2010-10-24  Kwang Yul Seo  <skyul@company100.net>
2583
2584         Reviewed by David Kilzer.
2585
2586         Check endianness with __BIG_ENDIAN in RVCT.
2587         https://bugs.webkit.org/show_bug.cgi?id=46122
2588
2589         RVCT defines __BIG_ENDIAN if compiling for a big-endian target.
2590
2591         * wtf/Platform.h:
2592
2593 2010-10-24  Dan Bernstein  <mitz@apple.com>
2594
2595         Rubber-stamped by Dave Kilzer.
2596
2597         Removed empty directories.
2598
2599         * JavaScriptCore: Removed.
2600         * JavaScriptCore/runtime: Removed.
2601
2602 2010-10-24  Patrick Gansterer  <paroga@webkit.org>
2603
2604         Unreviewed, fix typo of last build fix.
2605
2606         * wtf/DateMath.cpp:
2607
2608 2010-10-24  Patrick Gansterer  <paroga@webkit.org>
2609
2610         Unreviewed build fix for chromium.
2611
2612         * wtf/DateMath.cpp: Added missing include.
2613
2614 2010-10-24  Patrick Gansterer  <paroga@webkit.org>
2615
2616         Reviewed by David Kilzer.
2617
2618         Add WTF_ARRAY_LENGTH macro to WTF
2619         https://bugs.webkit.org/show_bug.cgi?id=32828
2620
2621         Unify the different implementations and usages.
2622
2623         * interpreter/Interpreter.cpp:
2624         (JSC::Interpreter::privateExecute):
2625         * runtime/DatePrototype.cpp:
2626         (JSC::formatLocaleDate):
2627         * runtime/JSGlobalObject.cpp:
2628         (JSC::JSGlobalObject::reset):
2629         * runtime/JSONObject.cpp:
2630         (JSC::Stringifier::appendQuotedString):
2631         (JSC::Stringifier::toJSON):
2632         (JSC::Stringifier::appendStringifiedValue):
2633         * runtime/UString.cpp:
2634         (JSC::UString::number):
2635         * wtf/DateMath.cpp:
2636         (WTF::parseDateFromNullTerminatedCharacters):
2637         * wtf/StdLibExtras.h:
2638
2639 2010-10-24  Dirk Schulze  <krit@webkit.org>
2640
2641         Reviewed by Nikolas Zimmermann.
2642
2643         Filter example Chiseled from SVG Wow! is slow
2644         https://bugs.webkit.org/show_bug.cgi?id=48174
2645
2646         Added 'using WTF::ByteArray;' at the end of ByteArray.h
2647
2648         * wtf/ByteArray.h:
2649
2650 2010-10-24  Patrick Gansterer  <paroga@webkit.org>
2651
2652         Reviewed by David Kilzer.
2653
2654         Inline WTF::bitwise_cast and fix style
2655         https://bugs.webkit.org/show_bug.cgi?id=48208
2656
2657         * wtf/StdLibExtras.h:
2658         (WTF::bitwise_cast):
2659         (WTF::bitCount):
2660
2661 2010-10-23  Xan Lopez  <xlopez@igalia.com>
2662
2663         Reviewed by Sam Weinig.
2664
2665         Unify globalData APIs
2666         https://bugs.webkit.org/show_bug.cgi?id=47969
2667
2668         Make JSGlobalObject::globalData return a reference and adapt
2669         callers. This unifies the API with the existing
2670         CallFrame::globalData, which also returns a reference.
2671
2672         * debugger/Debugger.cpp:
2673         (JSC::evaluateInGlobalCallFrame):
2674         * interpreter/CallFrame.h:
2675         * interpreter/Interpreter.cpp:
2676         (JSC::Interpreter::dumpRegisters):
2677         * jsc.cpp:
2678         (runWithScripts):
2679         * parser/JSParser.cpp:
2680         (JSC::jsParse):
2681         * parser/Parser.cpp:
2682         (JSC::Parser::parse):
2683         * parser/Parser.h:
2684         (JSC::Parser::parse):
2685         * runtime/Error.cpp:
2686         (JSC::createError):
2687         (JSC::createEvalError):
2688         (JSC::createRangeError):
2689         (JSC::createReferenceError):
2690         (JSC::createSyntaxError):
2691         (JSC::createTypeError):
2692         (JSC::createURIError):
2693         * runtime/FunctionConstructor.cpp:
2694         (JSC::constructFunction):
2695         * runtime/JSGlobalObject.cpp:
2696         (JSC::JSGlobalObject::~JSGlobalObject):
2697         (JSC::JSGlobalObject::markChildren):
2698         * runtime/JSGlobalObject.h:
2699         (JSC::JSGlobalObject::globalData):
2700
2701 2010-10-23  Dimitri Glazkov  <dglazkov@chromium.org>
2702
2703         Unreviewed, rolling out r70369.
2704         http://trac.webkit.org/changeset/70369
2705         https://bugs.webkit.org/show_bug.cgi?id=47974
2706
2707         Caused weird artifacts in expected results.
2708
2709         * wtf/Platform.h:
2710
2711 2010-10-23  Martin Robinson  <mrobinson@igalia.com>
2712
2713         Reviewed by Xan Lopez.
2714
2715         Crashes randomly in cairo_scaled_font_destroy
2716         https://bugs.webkit.org/show_bug.cgi?id=46794
2717
2718         Make PlatformRefPtr aware of hashTableDeletedValue. When PlatformRefPtr
2719         goes away this should probably be handled in the future via some special
2720         hooks in RefCounted (or its contained type).
2721
2722         * wtf/PlatformRefPtr.h:
2723         (WTF::PlatformRefPtr::~PlatformRefPtr):
2724         (WTF::PlatformRefPtr::clear):
2725         (WTF::::operator):
2726
2727 2010-10-22  Adam Roben  <aroben@apple.com>
2728
2729         Remove the QuartzCorePresent.h mechanism
2730
2731         This header was used to detect whether QuartzCore headers were present
2732         on the system. Everyone should have these headers now so we no longer
2733         need to detect.
2734
2735         Reviewed by Sam Weinig.
2736
2737         * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh: Remove
2738         code to generate QuartzCorePresent.h.
2739
2740         * wtf/Platform.h: Stop including QuartzCorePresent.h on Windows and
2741         collapse all USE_ACCELERATED_COMPOSITING settings into one #ifdef.
2742
2743 2010-10-22  Adam Barth  <abarth@webkit.org>
2744
2745         Unreviewed, rolling out r70290.
2746         http://trac.webkit.org/changeset/70290
2747         https://bugs.webkit.org/show_bug.cgi?id=48111
2748
2749         Undelete Android build files.
2750
2751         * Android.mk: Added.
2752
2753 2010-10-22  Zoltan Herczeg  <zherczeg@webkit.org>
2754
2755         Reviewed by Csaba Osztrogonác.
2756
2757         JSC interpreter regressions after r69940
2758         https://bugs.webkit.org/show_bug.cgi?id=47839
2759
2760         Wrong "if": It should test whether the result exists,
2761         and not the opposite. It is an interpreter bug, hence
2762         the bots does not capture it.
2763
2764         * interpreter/Interpreter.cpp:
2765         (JSC::Interpreter::resolveBase):
2766
2767 2010-10-21  Adam Barth  <abarth@webkit.org>
2768
2769         Reviewed by David Levin.
2770
2771         Remove Android build system
2772         https://bugs.webkit.org/show_bug.cgi?id=48111
2773
2774         * Android.mk: Removed.
2775
2776 2010-10-21  Kwang Yul Seo  <skyul@company100.net>
2777
2778         Reviewed by Kent Tamura.
2779
2780         [BREWMP] Add a String constructor which takes AECHAR*
2781         https://bugs.webkit.org/show_bug.cgi?id=45043
2782
2783         Add String(const AECHAR*) constructor for convenience.
2784
2785         * wtf/text/WTFString.h:
2786
2787 2010-10-21  Carlos Garcia Campos  <cgarcia@igalia.com>
2788
2789         Reviewed by Martin Robinson.
2790
2791         [GTK] Use GCharsetConverter instead of g_iconv in TextCodecGtk
2792         https://bugs.webkit.org/show_bug.cgi?id=47896
2793
2794         * wtf/gobject/GTypedefs.h:
2795
2796 2010-10-21  Adam Barth  <abarth@webkit.org>
2797
2798         Unreviewed, rolling out r70174.
2799         http://trac.webkit.org/changeset/70174
2800         https://bugs.webkit.org/show_bug.cgi?id=41948
2801
2802         This patch reverts a change that causes
2803         http/tests/xmlhttprequest/origin-whitelisting-removal.html to crash.
2804
2805         * interpreter/Interpreter.cpp:
2806         (JSC::Interpreter::throwException):
2807
2808 2010-10-20  Simon Fraser  <simon.fraser@apple.com>
2809
2810         Fix the EFL build.
2811
2812         * wtf/CMakeLists.txt:
2813
2814 2010-10-20  Simon Fraser  <simon.fraser@apple.com>
2815
2816         Fix Windows build: export needed symbols.
2817
2818         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2819
2820 2010-10-19  Simon Fraser  <simon.fraser@apple.com>
2821
2822         Reviewed by Gavin Barraclough.
2823
2824         https://bugs.webkit.org/show_bug.cgi?id=47851
2825         
2826         Add methods to DecimalNumber to return the buffer length
2827         required for decimal and exponential output.
2828         
2829         Make some of the DecimalNumber code non-inline (no
2830         effect on Sunspider), adding DecimalNumber.cpp to various
2831         build systems.
2832         
2833         Make some DecimalNumber methods 'const'.
2834
2835         * Android.mk:
2836         * Android.v8.wtf.mk:
2837         * GNUmakefile.am:
2838         * JavaScriptCore.exp:
2839         * JavaScriptCore.gypi:
2840         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
2841         * JavaScriptCore.xcodeproj/project.pbxproj:
2842         * runtime/NumberPrototype.cpp:
2843         (JSC::numberProtoFuncToExponential):
2844         (JSC::numberProtoFuncToFixed):
2845         (JSC::numberProtoFuncToPrecision):
2846         * wtf/DecimalNumber.cpp: Added.
2847         (WTF::DecimalNumber::bufferLengthForStringDecimal):
2848         (WTF::DecimalNumber::bufferLengthForStringExponential):
2849         (WTF::DecimalNumber::toStringDecimal):
2850         (WTF::DecimalNumber::toStringExponential):
2851         * wtf/DecimalNumber.h:
2852         (WTF::DecimalNumber::sign):
2853         (WTF::DecimalNumber::exponent):
2854         (WTF::DecimalNumber::significand):
2855         (WTF::DecimalNumber::precision):
2856         * wtf/dtoa.cpp:
2857         (WTF::dtoa):
2858         * wtf/dtoa.h:
2859         * wtf/wtf.pri:
2860
2861 2010-10-20  Sheriff Bot  <webkit.review.bot@gmail.com>
2862
2863         Unreviewed, rolling out r70165.
2864         http://trac.webkit.org/changeset/70165
2865         https://bugs.webkit.org/show_bug.cgi?id=48007
2866
2867         It broke tests on Qt bot (Requested by Ossy on #webkit).
2868
2869         * GNUmakefile.am:
2870         * JavaScriptCore.gypi:
2871         * JavaScriptCore.xcodeproj/project.pbxproj:
2872         * wtf/text/TextPosition.h: Removed.
2873
2874 2010-10-20  Brian Weinstein  <bweinstein@apple.com>
2875
2876         Reviewed by Adam Roben.
2877
2878         Fix the Windows build after r70165. Move the copying of JavaScript headers from JavaScriptCore's post-build
2879         step to JavaScriptCoreGenerated, so the copying is done even when a cpp file in JavaScriptCore is changed.
2880
2881         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
2882         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
2883
2884 2010-10-20  Dumitru Daniliuc  <dumi@chromium.org>
2885
2886         Unreviewed, fixing the Win build.
2887
2888         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
2889
2890 2010-10-20  Geoffrey Garen  <ggaren@apple.com>
2891
2892         Reviewed by Darin Adler.
2893         
2894         https://bugs.webkit.org/show_bug.cgi?id=41948
2895         REGRESSION(r60392): Registerfile can be unwound too far following an exception
2896
2897         * interpreter/Interpreter.cpp:
2898         (JSC::Interpreter::throwException): Walk the stack to calculate the high
2899         water mark currently in use. It's not safe to assume that the current
2900         CallFrame's high water mark is the highest high water mark because
2901         calls do not always set up at the end of a CallFrame. A large caller
2902         CallFrame can encompass a small callee CallFrame.
2903
2904 2010-10-20  Peter Rybin  <peter.rybin@gmail.com>
2905
2906         Reviewed by Adam Barth.
2907
2908         HTML parser should provide script column position within HTML document to JavaScript engine
2909         https://bugs.webkit.org/show_bug.cgi?id=45271
2910
2911         Adds TextPosition* classes -- a structure that stores line/column/generation
2912         level coordinates inside text document. Adds *BasedNumber classes -- typesafe int
2913         wrappers that emphasize whether int number is used as zero-based or
2914         one-based.
2915
2916         * GNUmakefile.am:
2917         * JavaScriptCore.gypi:
2918         * JavaScriptCore.xcodeproj/project.pbxproj:
2919         * wtf/text/TextPosition.h: Added.
2920         (WTF::TextPosition::TextPosition):
2921         (WTF::TextPosition::minimumPosition):
2922         (WTF::TextPosition::belowRangePosition):
2923         (WTF::ZeroBasedNumber::fromZeroBasedInt):
2924         (WTF::ZeroBasedNumber::ZeroBasedNumber):
2925         (WTF::ZeroBasedNumber::zeroBasedInt):
2926         (WTF::ZeroBasedNumber::base):
2927         (WTF::ZeroBasedNumber::belowBase):
2928         (WTF::OneBasedNumber::fromOneBasedInt):
2929         (WTF::OneBasedNumber::OneBasedNumber):
2930         (WTF::OneBasedNumber::oneBasedInt):
2931         (WTF::OneBasedNumber::convertAsZeroBasedInt):
2932         (WTF::OneBasedNumber::convertToZeroBased):
2933         (WTF::OneBasedNumber::base):
2934         (WTF::OneBasedNumber::belowBase):
2935         (WTF::toZeroBasedTextPosition):
2936         (WTF::toOneBasedTextPosition):
2937         (WTF::ZeroBasedNumber::convertToOneBased):
2938
2939 2010-10-19  Kwang Yul Seo  <skyul@company100.net>
2940
2941         Reviewed by David Kilzer.
2942
2943         [BREWMP] Turn off JIT for simulator build
2944         https://bugs.webkit.org/show_bug.cgi?id=47937
2945
2946         We don't need to test x86 JIT.
2947
2948         * wtf/Platform.h:
2949
2950 2010-10-19  Oliver Hunt  <oliver@apple.com>
2951
2952         Reviewed by Geoffrey Garen.
2953
2954         Remove support for JSVALUE32 from JSC
2955         https://bugs.webkit.org/show_bug.cgi?id=47948
2956
2957         Remove all the code for supporting JSVALUE32 from JSC.
2958
2959         * jit/JIT.cpp:
2960         (JSC::JIT::privateCompileMainPass):
2961         (JSC::JIT::privateCompileSlowCases):
2962         * jit/JIT.h:
2963         * jit/JITArithmetic.cpp:
2964         (JSC::JIT::emit_op_lshift):
2965         (JSC::JIT::emitSlow_op_lshift):
2966         (JSC::JIT::emit_op_rshift):
2967         (JSC::JIT::emitSlow_op_rshift):
2968         (JSC::JIT::emit_op_urshift):
2969         (JSC::JIT::emitSlow_op_urshift):
2970         (JSC::JIT::emit_op_jnless):
2971         (JSC::JIT::emitSlow_op_jnless):
2972         (JSC::JIT::emit_op_jless):
2973         (JSC::JIT::emitSlow_op_jless):
2974         (JSC::JIT::emit_op_jlesseq):
2975         (JSC::JIT::emitSlow_op_jlesseq):
2976         (JSC::JIT::emit_op_bitand):
2977         (JSC::JIT::emit_op_post_inc):
2978         (JSC::JIT::emit_op_post_dec):
2979         (JSC::JIT::emit_op_pre_inc):
2980         (JSC::JIT::emit_op_pre_dec):
2981         (JSC::JIT::emit_op_mod):
2982         (JSC::JIT::emitSlow_op_mod):
2983         * jit/JITCall.cpp:
2984         * jit/JITInlineMethods.h:
2985         (JSC::JIT::emitGetFromCallFrameHeaderPtr):
2986         (JSC::JIT::emitGetFromCallFrameHeader32):
2987         * jit/JITOpcodes.cpp:
2988         (JSC::JIT::emit_op_loop_if_lesseq):
2989         (JSC::JIT::emit_op_bitnot):
2990         (JSC::JIT::emit_op_next_pname):
2991         * jit/JITPropertyAccess.cpp:
2992         (JSC::JIT::emit_op_get_by_val):
2993         (JSC::JIT::emit_op_put_by_val):
2994         * jit/JITStubs.h:
2995         * jit/JSInterfaceJIT.h:
2996         * jit/SpecializedThunkJIT.h:
2997         (JSC::SpecializedThunkJIT::returnDouble):
2998         (JSC::SpecializedThunkJIT::tagReturnAsInt32):
2999         * jit/ThunkGenerators.cpp:
3000         (JSC::sqrtThunkGenerator):
3001         (JSC::powThunkGenerator):
3002         * runtime/Collector.cpp:
3003         (JSC::isPossibleCell):
3004         (JSC::typeName):
3005         * runtime/JSCell.h:
3006         * runtime/JSGlobalData.cpp:
3007         (JSC::JSGlobalData::JSGlobalData):
3008         * runtime/JSGlobalData.h:
3009         * runtime/JSGlobalObject.h:
3010         (JSC::Structure::prototypeForLookup):
3011         * runtime/JSImmediate.h:
3012         (JSC::reinterpretIntptrToDouble):
3013         (JSC::JSImmediate::isIntegerNumber):
3014         (JSC::JSImmediate::isDouble):
3015         (JSC::JSImmediate::areBothImmediateIntegerNumbers):
3016         (JSC::JSImmediate::makeDouble):
3017         (JSC::JSImmediate::doubleValue):
3018         (JSC::JSImmediate::toBoolean):
3019         (JSC::JSImmediate::fromNumberOutsideIntegerRange):
3020         (JSC::JSImmediate::from):
3021         (JSC::JSImmediate::toDouble):
3022         (JSC::JSFastMath::rightShiftImmediateNumbers):
3023         * runtime/JSNumberCell.cpp:
3024         * runtime/JSNumberCell.h:
3025         * runtime/JSObject.h:
3026         (JSC::JSObject::JSObject):
3027         * runtime/JSValue.h:
3028         * runtime/NumberObject.h:
3029         * wtf/Platform.h:
3030
3031 2010-10-19  Csaba Osztrogonác  <ossy@webkit.org>
3032
3033         Reviewed by Geoffrey Garen.
3034
3035         BytecodeGenerator::m_lastOpcodePosition must be initialized in all constructors
3036         https://bugs.webkit.org/show_bug.cgi?id=47920
3037
3038         * bytecompiler/BytecodeGenerator.cpp:
3039         (JSC::BytecodeGenerator::BytecodeGenerator): Add missing member initialization.
3040
3041 2010-10-19  Kwang Yul Seo  <skyul@company100.net>
3042
3043         Reviewed by David Kilzer.
3044
3045         RVCT fails to compile DateMath.cpp due to overloaded function pow
3046         https://bugs.webkit.org/show_bug.cgi?id=47844
3047
3048         Choose std::pow(double, double) among multiple overloaded pow functions
3049         to fix build for RVCT.
3050
3051         * wtf/DateMath.cpp:
3052         (WTF::parseES5DateFromNullTerminatedCharacters):
3053
3054 2010-10-19  Patrick Gansterer  <paroga@webkit.org>
3055
3056         Reviewed by David Kilzer.
3057
3058         Use UChar instead of wchar_t in UnicodeWinCE
3059         https://bugs.webkit.org/show_bug.cgi?id=47904
3060
3061         Make UnicodeWinCE more portable, so we can use it for other ports too.
3062
3063         * wtf/unicode/wince/UnicodeWinCE.cpp:
3064         (WTF::Unicode::toLower):
3065         (WTF::Unicode::toUpper):
3066         (WTF::Unicode::foldCase):
3067         (WTF::Unicode::isPrintableChar):
3068         (WTF::Unicode::isSpace):
3069         (WTF::Unicode::isLetter):
3070         (WTF::Unicode::isUpper):
3071         (WTF::Unicode::isLower):
3072         (WTF::Unicode::isDigit):
3073         (WTF::Unicode::isPunct):
3074         (WTF::Unicode::isAlphanumeric):
3075         (WTF::Unicode::toTitleCase):
3076         (WTF::Unicode::mirroredChar):
3077         (WTF::Unicode::digitValue):
3078         * wtf/unicode/wince/UnicodeWinCE.h:
3079         (WTF::Unicode::isSeparatorSpace):
3080         (WTF::Unicode::isHighSurrogate):
3081         (WTF::Unicode::isLowSurrogate):
3082         (WTF::Unicode::umemcasecmp):
3083         (WTF::Unicode::surrogateToUcs4):
3084
3085 2010-10-19  Patrick Gansterer  <paroga@webkit.org>
3086
3087         Reviewed by Andreas Kling.
3088
3089         Fix style of UnicodeWinCE
3090         https://bugs.webkit.org/show_bug.cgi?id=47818
3091
3092         * wtf/unicode/wince/UnicodeWinCE.cpp:
3093         (WTF::Unicode::toLower):
3094         (WTF::Unicode::toUpper):
3095         * wtf/unicode/wince/UnicodeWinCE.h:
3096
3097 2010-10-18  Xan Lopez  <xlopez@igalia.com>
3098
3099         Reviewed by Martin Robinson.
3100
3101         * GNUmakefile.am: add missing file.
3102
3103 2010-10-18  Oliver Hunt  <oliver@apple.com>
3104
3105         Reviewed by Sam Weinig.
3106
3107         Strict mode: Functions created with the function constructor don't implement strict mode semantics
3108         https://bugs.webkit.org/show_bug.cgi?id=47860
3109
3110         When creating the FunctionExecutable for a new function the function constructor
3111         was always passing false for whether or not a function was strict, rather than
3112         using the information from the freshly parsed function itself.
3113
3114         * runtime/Executable.cpp:
3115         (JSC::FunctionExecutable::fromGlobalCode):
3116
3117 2010-10-18  Oliver Hunt  <oliver@apple.com>
3118
3119         Reviewed by Darin Adler.
3120
3121         Strict mode: |this| should be undefined if it is not explicitly provided
3122         https://bugs.webkit.org/show_bug.cgi?id=47833
3123
3124         To make strict mode behave correctly we want to pass undefined instead of null
3125         as the default this value.  This has no impact on behaviour outside of strict
3126         mode as both values are replaced with the global object if necessary.
3127
3128         * bytecompiler/NodesCodegen.cpp:
3129         (JSC::FunctionCallValueNode::emitBytecode):
3130         (JSC::FunctionCallResolveNode::emitBytecode):
3131         (JSC::CallFunctionCallDotNode::emitBytecode):
3132         (JSC::ApplyFunctionCallDotNode::emitBytecode):
3133
3134
3135 2010-10-18  Darin Adler  <darin@apple.com>
3136
3137         Reviewed by Anders Carlsson.
3138
3139         Make a nullptr that works with OwnPtr and RefPtr
3140         https://bugs.webkit.org/show_bug.cgi?id=47756
3141
3142         * JavaScriptCore.xcodeproj/project.pbxproj: Added NullPtr.h.
3143
3144         * wtf/NullPtr.h: Added.
3145
3146         * wtf/OwnArrayPtr.h: Add an overload of = taking nullptr.
3147         * wtf/OwnPtr.h: Ditto.
3148         * wtf/PassOwnArrayPtr.h: Ditto.
3149         * wtf/PassOwnPtr.h: Ditto.
3150         * wtf/PassRefPtr.h: Ditto.
3151         * wtf/RefPtr.h: Ditto.
3152         * wtf/RetainPtr.h: Ditto.
3153
3154 2010-10-18  Oliver Hunt  <oliver@apple.com>
3155
3156         Reviewed by Sam Weinig.
3157
3158         Strict mode: JIT doesn't check for |this| being an immediate before dereferencing
3159         https://bugs.webkit.org/show_bug.cgi?id=47826
3160
3161         There's no guarantee that |this| will be a cell in a strict mode function, so
3162         don't claim that it is.
3163
3164         * bytecode/CodeBlock.h:
3165         (JSC::CodeBlock::isKnownNotImmediate):
3166
3167 2010-10-18  Zoltan Herczeg  <zherczeg@webkit.org>
3168
3169         Reviewed by Oliver Hunt.
3170
3171         if (0) throw "x" ; else { } throws parse error after r69906
3172         https://bugs.webkit.org/show_bug.cgi?id=47807
3173
3174         r69906 introduced a bug: the semicolon is not parsed after a throw
3175         expression anymore. Thus, the semicolon terminates the "if" parsing
3176         in the example above, and the else token results a parse error.
3177
3178         * parser/JSParser.cpp:
3179         (JSC::JSParser::parseThrowStatement):
3180
3181 2010-10-18  Peter Varga  <pvarga@inf.u-szeged.hu>
3182
3183         Reviewed by Andreas Kling.
3184
3185         Remove some unnecessary lines of code from Parser.cpp
3186         https://bugs.webkit.org/show_bug.cgi?id=47816
3187
3188         * parser/Parser.cpp:
3189
3190 2010-10-18  Xan Lopez  <xlopez@igalia.com>
3191
3192         Reviewed by Csaba Osztrogonác.
3193
3194         Build broken with JIT disabled
3195         https://bugs.webkit.org/show_bug.cgi?id=47801
3196
3197         This is a regression caused by r69940.
3198
3199         * interpreter/Interpreter.cpp:
3200         (JSC::Interpreter::resolveBase):
3201
3202 2010-10-18  Zoltan Horvath  <zoltan@webkit.org>
3203
3204         Reviewed by Darin Adler.
3205
3206         Change FastAllocBase implementation into a macro
3207         https://bugs.webkit.org/show_bug.cgi?id=42998
3208
3209         It was investigated in bug #33896 that inheriting classes from FastAllocBase 
3210         can result in objects getting larger which leads to memory regressions. 
3211         Using a macro instead of inheriting classes from FastAllocBase would solve the issue. 
3212
3213         * wtf/FastAllocBase.h: Add a WTF_MAKE_FAST_ALLOCATED macro
3214
3215 2010-10-17  Oliver Hunt  <oliver@apple.com>
3216
3217         Reviewed by Sam Weinig.
3218
3219         Strict mode: arguments is not valid as the base expression for pre- or post-fix expressions
3220         https://bugs.webkit.org/show_bug.cgi?id=47791
3221
3222         Simple fix, check for arguments in addition to eval.
3223
3224         * parser/JSParser.cpp:
3225         (JSC::JSParser::parseUnaryExpression):
3226
3227 2010-10-17  Oliver Hunt  <oliver@apple.com>
3228
3229         Reviewed by Sam Weinig.
3230
3231         Strict mode: Assignment that would create a global should be a late ReferenceError, not a syntax failure
3232         https://bugs.webkit.org/show_bug.cgi?id=47788
3233
3234         Fixing this required a couple of changes:
3235          * resolve_base now has a flag to indicate whether it is being used for a put in strict mode.
3236            this allows us to throw an exception when we're doing a completely generic resolve for
3237            assignment, and that assignment would create a new global.
3238          * There is a new opcode 'op_ensure_property_exists' that is used to determine whether
3239            the property being assigned to already exists on the global object.  This currently
3240            has no caching, but such caching could be added relatively trivially.  It is only used
3241            in the case where we know that a property will be placed on the global object, and
3242            we cannot verify that the property already exists.
3243
3244         In the jit we plant a call to cti_op_resolve_base_strict_put in the effected case rather
3245         than making op_resolve_base have an additional runtime branch.
3246
3247         There's also a new helper function to create the exception for the invalid assignment.
3248
3249         * bytecode/CodeBlock.cpp:
3250         (JSC::CodeBlock::dump):
3251         * bytecode/Opcode.h:
3252         * bytecompiler/BytecodeGenerator.cpp:
3253         (JSC::BytecodeGenerator::emitResolveBase):
3254         (JSC::BytecodeGenerator::emitResolveBaseForPut):
3255         * bytecompiler/BytecodeGenerator.h:
3256         * bytecompiler/NodesCodegen.cpp:
3257         (JSC::AssignResolveNode::emitBytecode):
3258         (JSC::ForInNode::emitBytecode):
3259         * interpreter/Interpreter.cpp:
3260         (JSC::Interpreter::resolveBase):
3261         (JSC::Interpreter::privateExecute):
3262         * jit/JIT.cpp:
3263         (JSC::JIT::privateCompileMainPass):
3264         * jit/JIT.h:
3265         * jit/JITOpcodes.cpp:
3266         (JSC::JIT::emit_op_resolve_base):
3267         (JSC::JIT::emit_op_ensure_property_exists):
3268         * jit/JITOpcodes32_64.cpp:
3269         (JSC::JIT::emit_op_resolve_base):
3270         (JSC::JIT::emit_op_ensure_property_exists):
3271         * jit/JITStubs.cpp:
3272         (JSC::DEFINE_STUB_FUNCTION):
3273         * jit/JITStubs.h:
3274         * parser/JSParser.cpp:
3275         (JSC::JSParser::parseProgram):
3276         * runtime/ExceptionHelpers.cpp:
3277         (JSC::createErrorForInvalidGlobalAssignment):
3278         * runtime/ExceptionHelpers.h:
3279         * runtime/Operations.h:
3280         (JSC::resolveBase):
3281
3282 2010-10-17  Simon Fraser  <simon.fraser@apple.com>
3283
3284         First part of fix for Windows build failure. Will wait for the
3285         next set of link errors to determine the mangled forms for dtoaRoundSF
3286         and dtoaRoundDP.
3287
3288         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3289
3290 2010-10-17  Simon Fraser  <simon.fraser@apple.com>
3291
3292         Reviewed by Nikolas Zimmermann.
3293
3294         Very large and small numbers fail to round-trip through CSS
3295         https://bugs.webkit.org/show_bug.cgi?id=20674
3296         
3297         New exports required to use DecimalNumber in WebCore.
3298
3299         * JavaScriptCore.exp:
3300         * JavaScriptCore.xcodeproj/project.pbxproj:
3301
3302 2010-10-16  Kyusun Kim  <maniagoon@company100.net>
3303
3304         Reviewed by Alexey Proskuryakov.
3305
3306         Add using declarations for currentTimeMS() and parseDateFromNullTerminatedCharacters()
3307         https://bugs.webkit.org/show_bug.cgi?id=47758
3308
3309         * wtf/CurrentTime.h:
3310         * wtf/DateMath.h:
3311
3312 2010-10-16  Patrick Gansterer  <paroga@webkit.org>
3313
3314         Reviewed by Adam Barth.
3315
3316         Rename StringHasherFunctions.h to StringHasher.h
3317         https://bugs.webkit.org/show_bug.cgi?id=47200
3318
3319         Now StringHasherFunctions.h only contains the StringHasher class, so rename it to the correct name.
3320
3321         * GNUmakefile.am:
3322         * JavaScriptCore.gypi:
3323         * JavaScriptCore.xcodeproj/project.pbxproj:
3324         * wtf/StringHashFunctions.h: Removed.
3325         * wtf/StringHasher.h: Copied from JavaScriptCore/wtf/StringHashFunctions.h.
3326         * wtf/text/StringHash.h:
3327         * wtf/text/StringImpl.h:
3328
3329 2010-10-15  Oliver Hunt  <oliver@apple.com>
3330
3331         Reviewed by Sam Weinig.
3332
3333         Automatic Semicolon Insertion incorrectly inserts semicolon after break, continue, and return followed by a newline
3334         https://bugs.webkit.org/show_bug.cgi?id=47762
3335
3336         The old YACC parser depended on the lexer for some classes of semicolon insertion.
3337         The new parser handles ASI entirely on its own so when the lexer inserts a semicolon
3338         on its own the net result is a spurious semicolon in the input stream.  This can result
3339         in incorrect parsing in some cases:
3340
3341         if (0)
3342             break
3343         ;else {}
3344
3345         Would result in a parse failure as the output from the lexer is essentially
3346
3347         if (0)
3348              break
3349         ;;else
3350
3351         So the second semicolon is interpreted as a empty statement, which terminates the if,
3352         making the else an error.
3353
3354
3355         * parser/JSParser.cpp:
3356         (JSC::JSParser::parseThrowStatement):
3357           Parsing of throw statement was wrong, and only worked due to the weird behaviour
3358           in the lexer
3359         * parser/Lexer.cpp:
3360         (JSC::Lexer::lex):
3361           Remove bogus semicolon insertion from the newline handling
3362
3363 2010-10-15  Nikolas Zimmermann  <nzimmermann@rim.com>
3364
3365         Reviewed by Dirk Schulze.
3366
3367         Replace some String::format() usages by StringConcatenate in WebKit
3368         https://bugs.webkit.org/show_bug.cgi?id=47714
3369
3370         * wtf/text/StringConcatenate.h: Add UChar specific StringTypeAdapter, to accept single UChars in makeString().
3371
3372 2010-10-15  Ilya Tikhonovsky  <loislo@chromium.org>
3373
3374         Unreviewed build fix for Debug Leopard which is failng to compile after r69842.
3375
3376         * yarr/RegexInterpreter.cpp:
3377         (JSC::Yarr::ByteCompiler::emitDisjunction):
3378
3379 2010-10-15  Peter Varga  <pvarga@inf.u-szeged.hu>
3380
3381         Reviewed by Gavin Barraclough.
3382
3383         The parenthetical assertion checking isn't working in some cases with YARR
3384         Interpreter
3385         https://bugs.webkit.org/show_bug.cgi?id=46893
3386
3387         Calculate the countToCheck value of a TypeParentheticalAssertion by
3388         subtracting the number of characters which follows
3389         a TypeParentheticalAssertion term with the number of characters which should
3390         be matched by terms which are contained
3391         in the TypeParentheticalAssertion term (minimumSize).
3392
3393         * yarr/RegexInterpreter.cpp:
3394         (JSC::Yarr::ByteCompiler::emitDisjunction):
3395
3396 2010-10-14  Nathan Vander Wilt  <nate@andyet.net>
3397
3398         Reviewed by Darin Adler.
3399
3400         Added parser for ECMAScript 5 standard date format, so Date.parse can handle RFC 3339 timestamps: https://bugs.webkit.org/show_bug.cgi?id=44632
3401
3402         * runtime/DateConversion.cpp:
3403         (JSC::parseDate):
3404         * wtf/DateMath.cpp:
3405         (WTF::ymdhmsToSeconds):
3406         (WTF::parseES5DateFromNullTerminatedCharacters):
3407         * wtf/DateMath.h:
3408
3409 2010-10-14  Nikolas Zimmermann  <nzimmermann@rim.com>
3410
3411         Reviewed by Gavin Barraclough.
3412
3413         Replace lots of String::format() usages by StringConcatenate
3414         https://bugs.webkit.org/show_bug.cgi?id=47664
3415
3416         Add StringTypeAdapter<char> to accept single characters for makeString().
3417
3418         * wtf/text/StringConcatenate.h:
3419         (WTF::makeString):
3420
3421 2010-10-14  David Goodwin  <david_goodwin@apple.com>
3422
3423         Reviewed by Darin Adler.
3424
3425         need way to measure size of JITed ARM code
3426         https://bugs.webkit.org/show_bug.cgi?id=47121
3427
3428         * assembler/LinkBuffer.h:
3429         (JSC::LinkBuffer::linkCode):
3430         (JSC::LinkBuffer::dumpLinkStats):
3431         (JSC::LinkBuffer::dumpCode):
3432
3433 2010-10-14  Peter Varga  <pvarga@inf.u-szeged.hu>
3434
3435         Reviewed by Gavin Barraclough.
3436
3437         The backreference checking isn't working in some cases with YARR Interpreter
3438         https://bugs.webkit.org/show_bug.cgi?id=46904
3439
3440         The Interpreter::matchBackReference() function returns true without matching
3441         when a backreference points to the same parentheses where it is.
3442
3443         * yarr/RegexInterpreter.cpp:
3444         (JSC::Yarr::Interpreter::matchBackReference):
3445
3446 2010-10-14  No'am Rosenthal  <noam.rosenthal@nokia.com>
3447
3448         Reviewed by Andreas Kling.
3449
3450         [Qt] Text breaking is slow: enable ICU as an opt-in
3451         https://bugs.webkit.org/show_bug.cgi?id=40332
3452
3453         Added a config flag that enables ICU as an opt-in instead of the Qt specific code.
3454         Because of the inclusion of ICU headers, some explicit casting was necessary in UnicodeQt4.h
3455
3456         * JavaScriptCore.pri:
3457         * wtf/unicode/qt4/UnicodeQt4.h:
3458         (WTF::Unicode::toLower):
3459         (WTF::Unicode::toUpper):
3460         (WTF::Unicode::toTitleCase):
3461         (WTF::Unicode::foldCase):
3462         (WTF::Unicode::isPrintableChar):
3463         (WTF::Unicode::isSeparatorSpace):
3464         (WTF::Unicode::isPunct):
3465         (WTF::Unicode::isLower):
3466         (WTF::Unicode::mirroredChar):
3467         (WTF::Unicode::combiningClass):
3468         (WTF::Unicode::direction):
3469         (WTF::Unicode::category):
3470
3471 2010-10-14  Anton Faern  <anton@bladehawke.com>
3472
3473         Reviewed by Csaba Osztrogonác.
3474
3475         https://bugs.webkit.org/show_bug.cgi?id=47658
3476         NetBSD was not included in the WTF_PLATFORM_FOO to WTF_OS_FOO
3477         change.  This means that OS(NETBSD) is also undefined.
3478
3479         * wtf/Platform.h: s/_PLATFORM_/_OS_/ for NetBSD
3480
3481 2010-10-13  David Goodwin  <david_goodwin@apple.com>
3482
3483         Reviewed by Oliver Hunt.
3484
3485         ARMv7 JIT should generated conditional branches when possible
3486         https://bugs.webkit.org/show_bug.cgi?id=47384
3487
3488         Use different jump padding sizes for conditional and unconditional
3489         jumps (12 bytes and 10 bytes respectively). This allows the JIT to
3490         include the IT instruction as part of the conditional jump sequence
3491         which in turn allows it to optimize away the IT using an ARMv7 
3492         conditional branch instruction. Use 2-byte B(T1) and 4-byte B(T3) for
3493         conditional branches when displacement is in range. Also use IT/B(T4)
3494         for conditional branch when displacement does not fit in B(T3).
3495
3496         For unconditional jump, instruction selection options are:
3497         B(T2), B(T4), MOVW/MOVT/BX. For conditional jump, instruction selection
3498         options are: B(T1), B(T3), IT/B(T4), ITTT/MOVW/MOVT/BX.
3499
3500         * assembler/ARMv7Assembler.cpp:
3501         * assembler/ARMv7Assembler.h:
3502         (JSC::ARMv7Assembler::JmpSrc::JmpSrc):
3503         (JSC::ARMv7Assembler::ifThenElse):
3504         (JSC::ARMv7Assembler::jumpSizeDelta):
3505         (JSC::ARMv7Assembler::canCompact):
3506         (JSC::ARMv7Assembler::computeJumpType):
3507         (JSC::ARMv7Assembler::link):
3508         (JSC::ARMv7Assembler::canBeJumpT1):
3509         (JSC::ARMv7Assembler::canBeJumpT3):
3510         (JSC::ARMv7Assembler::canBeJumpT4):
3511         (JSC::ARMv7Assembler::linkJumpT1):
3512         (JSC::ARMv7Assembler::linkJumpT3):
3513         (JSC::ARMv7Assembler::linkJumpT4):
3514         (JSC::ARMv7Assembler::linkConditionalJumpT4):
3515         (JSC::ARMv7Assembler::linkBX):
3516         (JSC::ARMv7Assembler::linkConditionalBX):
3517         (JSC::ARMv7Assembler::linkJumpAbsolute):
3518         * assembler/LinkBuffer.h:
3519         (JSC::LinkBuffer::linkCode):
3520         * assembler/MacroAssemblerARMv7.h:
3521         (JSC::MacroAssemblerARMv7::canCompact):
3522         (JSC::MacroAssemblerARMv7::computeJumpType):
3523         (JSC::MacroAssemblerARMv7::jumpSizeDelta):
3524         (JSC::MacroAssemblerARMv7::jump):
3525         (JSC::MacroAssemblerARMv7::nearCall):
3526         (JSC::MacroAssemblerARMv7::call):
3527         (JSC::MacroAssemblerARMv7::ret):
3528         (JSC::MacroAssemblerARMv7::tailRecursiveCall):
3529         (JSC::MacroAssemblerARMv7::makeJump):
3530         (JSC::MacroAssemblerARMv7::makeBranch):
3531
3532 2010-10-13  Fridrich Strba  <fridrich.strba@bluewin.ch>
3533
3534         Reviewed by Darin Adler.
3535
3536         Don't depend on Windows on sched_yield and sched.h
3537         https://bugs.webkit.org/show_bug.cgi?id=45543
3538
3539         sched.h is part of pthreads and sched_yield is implemented
3540         in pthreads-win32 as Sleep(0). This patch avoids a gratuitous
3541         dependency on pthreads-win32 in this file.
3542
3543         * wtf/TCSpinLock.h:
3544         (TCMalloc_SlowLock):
3545
3546 2010-10-13  Kwang Yul Seo  <skyul@company100.net>
3547
3548         Reviewed by Kent Tamura.
3549
3550         [BREWMP] Port unicode
3551         https://bugs.webkit.org/show_bug.cgi?id=45716
3552
3553         Brew MP port uses only the subset of ICU library to reduce the binary size.
3554         Follow the WinCE's implementation.
3555
3556         * wtf/Platform.h:
3557         * wtf/unicode/Unicode.h:
3558         * wtf/unicode/brew/UnicodeBrew.cpp: Added.
3559         (WTF::Unicode::toLower):
3560         (WTF::Unicode::toUpper):
3561         (WTF::Unicode::foldCase):
3562         (WTF::Unicode::isPrintableChar):
3563         (WTF::Unicode::isUpper):
3564         (WTF::Unicode::isLower):
3565         (WTF::Unicode::isDigit):
3566         (WTF::Unicode::isPunct):
3567         (WTF::Unicode::isAlphanumeric):
3568         (WTF::Unicode::toTitleCase):
3569         (WTF::Unicode::direction):
3570         (WTF::Unicode::category):
3571         (WTF::Unicode::decompositionType):
3572         (WTF::Unicode::combiningClass):
3573         (WTF::Unicode::mirroredChar):
3574         (WTF::Unicode::digitValue):
3575         (WTF::Unicode::isSpace):
3576         (WTF::Unicode::isLetter):
3577         * wtf/unicode/brew/UnicodeBrew.h: Added.
3578         (WTF::Unicode::isArabicChar):
3579         (WTF::Unicode::isSeparatorSpace):
3580         (WTF::Unicode::hasLineBreakingPropertyComplexContext):
3581         (WTF::Unicode::hasLineBreakingPropertyComplexContextOrIdeographic):
3582         (WTF::Unicode::umemcasecmp):
3583
3584 2010-10-13  Gavin Barraclough  <barraclough@apple.com>
3585
3586         Windows build fix.
3587
3588         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3589
3590 2010-10-13  Adam Barth  <abarth@webkit.org>
3591
3592         Reviewed by Maciej Stachowiak.
3593
3594         [WTFURL] Add URLQueryCanonicalizer
3595         https://bugs.webkit.org/show_bug.cgi?id=45088
3596
3597         This class canonicalizes the query component of URLs.  The main tricky
3598         bit there is the convertCharset function, which I've moved to a
3599         templated dependency.  There'll likely be more about that in future
3600         patches.
3601
3602         * JavaScriptCore.xcodeproj/project.pbxproj:
3603         * wtf/url/src/URLEscape.cpp: Added.
3604         * wtf/url/src/URLEscape.h: Added.
3605         (WTF::appendEscapedCharacter):
3606         * wtf/url/src/URLQueryCanonicalizer.h: Added.
3607         (WTF::URLQueryCanonicalizer::canonicalize):
3608         (WTF::URLQueryCanonicalizer::isAllASCII):
3609         (WTF::URLQueryCanonicalizer::appendRaw8BitQueryString):
3610         (WTF::URLQueryCanonicalizer::convertToQueryEncoding):
3611
3612 2010-10-13  Gavin Barraclough  <barraclough@apple.com>
3613
3614         Reviewed by Oliver Hunt.
3615
3616         Bug 43987 - Downloading using XHR is much slower than before
3617         Change StringBuilder to use overcapacity in a StringImpl, rather than a Vector.
3618         Fundamentally this should be the same (copies current contents to expand capacity,
3619         rather than using a rope), but this approach allows the intermadiate state of the
3620         String to be inspected in the buffer without copying to resolve.
3621
3622         * runtime/JSONObject.cpp:
3623         (JSC::Stringifier::appendQuotedString):
3624         (JSC::Stringifier::Holder::appendNextProperty):
3625             Renamed StringBuilder::size() -> length() (to match other String types).
3626
3627         * runtime/UStringBuilder.h:
3628         (JSC::UStringBuilder::append):
3629         (JSC::UStringBuilder::toUString):
3630             Update for changes in parent class, can just 'using' the append methods.
3631
3632         * wtf/text/StringBuilder.cpp: Added.
3633         (WTF::StringBuilder::reifyString):
3634         (WTF::StringBuilder::resize):
3635         (WTF::StringBuilder::reserveCapacity):
3636         (WTF::StringBuilder::allocateBuffer):
3637         (WTF::StringBuilder::appendUninitialized):
3638         (WTF::StringBuilder::append):
3639         (WTF::StringBuilder::shrinkToFit):
3640         * wtf/text/StringBuilder.h:
3641         (WTF::StringBuilder::StringBuilder):
3642         (WTF::StringBuilder::append):
3643         (WTF::StringBuilder::toString):
3644         (WTF::StringBuilder::toStringPreserveCapacity):
3645         (WTF::StringBuilder::length):
3646         (WTF::StringBuilder::isEmpty):
3647         (WTF::StringBuilder::operator[]):
3648         (WTF::StringBuilder::clear):
3649             Class updated to use overcapacity in a StringImpl, rather than a Vector.
3650
3651         * Android.mk:
3652         * Android.v8.wtf.mk:
3653         * GNUmakefile.am:
3654         * JavaScriptCore.exp:
3655         * JavaScriptCore.gypi:
3656         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
3657         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
3658         * JavaScriptCore.vcproj/jsc/jsc.vcproj:
3659         * JavaScriptCore.xcodeproj/project.pbxproj:
3660         * wtf/CMakeLists.txt:
3661         * wtf/wtf.pri:
3662
3663 2010-10-13  Adam Roben  <aroben@apple.com>
3664
3665         Export tryFastRealloc for WebKit2's benefit
3666
3667         Rubber-stamped by Anders Carlsson.
3668
3669         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Added
3670         tryFastRealloc. Removed RegExpObject::info, which is now exported via
3671         JS_EXPORTDATA.
3672
3673 2010-10-13  Adam Barth  <abarth@webkit.org>
3674
3675         Reviewed by Maciej Stachowiak.
3676
3677         [WTFURL] Add a mechanism for classifying types of characters
3678         https://bugs.webkit.org/show_bug.cgi?id=45085
3679
3680         Various characters have different escaping rules depending on where
3681         they are in URLs.  This patch adds a table containing that information.
3682
3683         * JavaScriptCore.xcodeproj/project.pbxproj:
3684         * wtf/url/src/URLCharacterTypes.cpp: Added.
3685         * wtf/url/src/URLCharacterTypes.h: Added.
3686         (WTF::URLCharacterTypes::isQueryChar):
3687         (WTF::URLCharacterTypes::isIPv4Char):
3688         (WTF::URLCharacterTypes::isHexChar):
3689         (WTF::URLCharacterTypes::isCharOfType):
3690
3691 2010-10-13  Xan Lopez  <xlopez@igalia.com>
3692
3693         Reviewed by Csaba Osztrogonác.
3694
3695         Missing parameters for bytecode dump of next_pname
3696         https://bugs.webkit.org/show_bug.cgi?id=47590
3697
3698         * bytecode/CodeBlock.cpp:
3699         (JSC::CodeBlock::dump): add missing parameters to the dump.
3700
3701 2010-10-13  Nikolas Zimmermann  <nzimmermann@rim.com>
3702
3703         Reviewed by Dirk Schulze.
3704
3705         Add wtf/text/StringConcatenate
3706         https://bugs.webkit.org/show_bug.cgi?id=47584
3707
3708         Move runtime/StringConcatenate.h to wtf/text, make it work for Strings too.
3709         Add a special runtime/UStringConcatenate.h class that inherits from StringConcatenate, and extends it for use with UString.
3710         Exactly the same design that has been followed while refactoring StringBuilder.
3711
3712         The UString variants can all be removed as soon as WTF::String & JSC::UString converge.
3713
3714         * GNUmakefile.am: Add wtf/text/StringConcatenate.h and runtime/UStringConcatenate.h.
3715         * JavaScriptCore.gypi: Ditto.
3716         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto.
3717         * JavaScriptCore.vcproj/WTF/WTF.vcproj: Ditto.
3718         * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
3719         * bytecode/CodeBlock.cpp: s/makeString/makeUString/
3720         (JSC::escapeQuotes):
3721         (JSC::valueToSourceString):
3722         (JSC::constantName):
3723         (JSC::idName):
3724         (JSC::CodeBlock::registerName):
3725         (JSC::regexpToSourceString):
3726         (JSC::regexpName):
3727         * bytecompiler/NodesCodegen.cpp: Ditto.
3728         (JSC::substitute):
3729         * profiler/Profiler.cpp: Ditto.
3730         (JSC::Profiler::createCallIdentifier):
3731         * runtime/ExceptionHelpers.cpp: Ditto.
3732         (JSC::createUndefinedVariableError):
3733         (JSC::createErrorMessage):
3734         (JSC::createInvalidParamError):
3735         * runtime/FunctionConstructor.cpp: Ditto.
3736         (JSC::constructFunction):
3737         * runtime/FunctionPrototype.cpp: Ditto.
3738         (JSC::insertSemicolonIfNeeded):
3739         * runtime/JSONObject.cpp: Ditto.
3740         (JSC::Stringifier::indent):
3741         * runtime/JSStringBuilder.h:
3742         (JSC::jsMakeNontrivialString):
3743         * runtime/RegExpConstructor.cpp: Ditto.
3744         (JSC::constructRegExp):
3745         * runtime/RegExpObject.cpp: Ditto.
3746         (JSC::RegExpObject::match):
3747         * runtime/RegExpPrototype.cpp: Ditto.
3748         (JSC::regExpProtoFuncCompile):
3749         * runtime/StringConcatenate.h: Removed.
3750         * runtime/UStringConcatenate.h: Added. Only contains the StringTypeAdapter<JSC::UString> code and the makeUString variants, the rest lives in wtf/text/StringConcatenate.h
3751         (JSC::makeUString):
3752         * wtf/text/StringConcatenate.h: Copied from runtime/StringConcatenate.h.
3753         (WTF::makeString):
3754
3755 2010-10-12  Gavin Barraclough  <barraclough@apple.com>
3756
3757         Windows build fix.
3758
3759         * wtf/text/StringBuilder.h:
3760         (WTF::StringBuilder::length):
3761
3762 2010-10-12  Nikolas Zimmermann  <nzimmermann@rim.com>
3763
3764         Reviewed by Gavin Barraclough.
3765
3766         Unify JSC::StringBuilder & WebCore::StringBuilder
3767         https://bugs.webkit.org/show_bug.cgi?id=47538
3768
3769         Move runtime/StringBuilder.h to wtf/text/StringBuilder.h. Rename build() to toString() and return a WTF::String().
3770         Move the append(const JSC::UString&) method into runtime/UStringBuilder.h.
3771         UStringBuilder inherits from StringBuilder.h and adds append(const JSC::UString&) and UString toUString() functionality.
3772
3773         No new code, just move code around.
3774
3775         * GNUmakefile.am: Add wtf/text/StringBuilder.h / runtime/UStringBuilder.h. Remove runtime/StringBuilder.h.
3776         * JavaScriptCore.gypi: Ditto.
3777         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto.
3778         * JavaScriptCore.vcproj/WTF/WTF.vcproj: Ditto.
3779         * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
3780         * runtime/Executable.cpp:
3781         (JSC::FunctionExecutable::paramString): Use UStringBuilder, instead of StringBuilder. Rename build() -> toUString().
3782         * runtime/FunctionConstructor.cpp:
3783         (JSC::constructFunction): Ditto.
3784         * runtime/JSGlobalObjectFunctions.cpp:
3785         (JSC::globalFuncUnescape): Ditto.
3786         * runtime/JSONObject.cpp:
3787         (JSC::Stringifier::stringify): Ditto.
3788         (JSC::Stringifier::appendQuotedString): Ditto.
3789         (JSC::Stringifier::appendStringifiedValue): Ditto.
3790         (JSC::Stringifier::startNewLine): Ditto.
3791         (JSC::Stringifier::Holder::appendNextProperty): Ditto.
3792         * runtime/LiteralParser.cpp:
3793         (JSC::LiteralParser::Lexer::lexString): Ditto.
3794         * runtime/NumberPrototype.cpp: Remove unneeded JSStringBuilder.h / StringBuilder.h include.
3795         * runtime/StringBuilder.h: Removed.
3796         * runtime/UStringBuilder.h: Added. Inherits from WTF::StringBuilder, extending it by two methods.
3797         (JSC::UStringBuilder::append): append(const JSC::UString&)
3798         (JSC::UStringBuilder::toUString):
3799         * wtf/text/StringBuilder.h: Copied from runtime/StringBuilder.h. Move JSC::UString parts into runtime/UStringBuilder.h
3800         (WTF::StringBuilder::append): Renamed m_buffer to buffer everywhere.
3801         (WTF::StringBuilder::isEmpty): Ditto (+ constify method). 
3802         (WTF::StringBuilder::reserveCapacity): Ditto.
3803         (WTF::StringBuilder::resize): Ditto.
3804         (WTF::StringBuilder::size): Ditto.
3805         (WTF::StringBuilder::operator[]): Ditto.
3806         (WTF::StringBuilder::toString): Ditto (+ renamed from build()). Returns a String, not an UString. The old build() method is now named toUString() and lives in UStringBuilder.
3807
3808 2010-10-12  Michael Saboff  <msaboff@apple.com>
3809
3810         Reviewed by Oliver Hunt.
3811
3812         Cleaned up the processing of replacements after regular expression
3813         processing, especially the case where there wasn't a match.
3814         Changed to use empty strings instead of computing a zero length sub
3815         string.
3816         https://bugs.webkit.org/show_bug.cgi?id=47506
3817
3818         * runtime/StringPrototype.cpp:
3819         (JSC::jsSpliceSubstringsWithSeparators):
3820         (JSC::stringProtoFuncReplace):
3821
3822 2010-10-11  Patrick Gansterer  <paroga@webkit.org>
3823
3824         Unreviewed.
3825
3826         Clang build fix after r69472.
3827         https://bugs.webkit.org/show_bug.cgi?id=46523
3828
3829         * wtf/text/StringHash.h:
3830
3831 2010-10-11  Oliver Hunt  <oliver@apple.com>
3832
3833         Undo last minute change to 32bit build.
3834
3835         * jit/JITOpcodes32_64.cpp:
3836         (JSC::JIT::emit_op_convert_this_strict):
3837
3838 2010-10-11  Brian Weinstein  <bweinstein@apple.com>
3839
3840         Build fix for Windows. Add a necessary export from r69516.
3841
3842         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3843
3844 2010-10-11  Oliver Hunt  <oliver@apple.com>
3845
3846         Fix interpreter build -- was broken by incorrect merge.
3847
3848         * interpreter/Interpreter.cpp:
3849         (JSC::Interpreter::privateExecute):
3850
3851 2010-10-01  Oliver Hunt  <oliver@apple.com>
3852
3853         Reviewed by Gavin Barraclough.
3854
3855         [ES5] Implement strict mode
3856         https://bugs.webkit.org/show_bug.cgi?id=10701
3857
3858         Initial strict mode implementation.  This is the simplest
3859         implementation that could possibly work and adds (hopefully)
3860         all of the restrictions required by strict mode.  There are
3861         a number of inefficiencies, especially in the handling of
3862         arguments and eval as smart implementations would make this
3863         patch more complicated.  
3864
3865         The SyntaxChecker AST builder has become somewhat more complex
3866         as strict mode does require more parse tree information to
3867         validate the syntax.
3868
3869         Summary of major changes to the parser:
3870             * We track when we enter strict mode (this may come as a surprise)
3871             * Strict mode actually requires a degree of AST knowledge to validate
3872               so the SyntaxChecker now produces values that can be used to distinguish
3873               "node" types.
3874             * We now track variables that are written to.  We do this to
3875               statically identify writes to global properties that don't exist
3876               and abort at that point.  This should actually make it possible
3877               to optimise some other cases in the future but for now it's
3878               purely for validity checking.  Currently writes are only tracked
3879               in strict mode code.
3880             * Labels are now tracked as it is now a syntax error to jump to a label
3881               that does not exist (or to use break, continue, or return in a context
3882               where they would be invalid).
3883
3884         Runtime changes:
3885             * In order to get correct hanlding of the Arguments object all
3886               strict mode functions that reference arguments create and tearoff
3887               the arguments object on entry.  This is not strictly necessary
3888               but was the least work necessary to get the correct behaviour.
3889             * PutPropertySlot now tracks whether it is being used for a strict
3890               mode write, and if so Object::put will throw when a write can't be
3891               completed.
3892             * StrictEvalActivation was added as an "activation" object for strict
3893               mode eval (so that strict eval does not introduce new variables into
3894               the containing scope).
3895
3896         * CMakeLists.txt:
3897         * GNUmakefile.am:
3898         * JavaScriptCore.exp:
3899         * JavaScriptCore.pro:
3900         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3901         * JavaScriptCore.xcodeproj/project.pbxproj:
3902         * bytecode/CodeBlock.cpp:
3903         (JSC::CodeBlock::dump):
3904         (JSC::CodeBlock::CodeBlock):
3905         (JSC::CodeBlock::reparseForExceptionInfoIfNecessary):
3906         * bytecode/CodeBlock.h:
3907         (JSC::CodeBlock::isStrictMode):
3908         * bytecode/EvalCodeCache.h:
3909         (JSC::EvalCodeCache::get):
3910         * bytecode/Opcode.h:
3911         * bytecompiler/BytecodeGenerator.cpp:
3912         (JSC::BytecodeGenerator::BytecodeGenerator):
3913         (JSC::BytecodeGenerator::createArgumentsIfNecessary):
3914         (JSC::BytecodeGenerator::emitReturn):
3915         * bytecompiler/BytecodeGenerator.h:
3916         (JSC::BytecodeGenerator::isStrictMode):
3917         (JSC::BytecodeGenerator::makeFunction):
3918         * debugger/Debugger.cpp:
3919         (JSC::evaluateInGlobalCallFrame):
3920         * debugger/DebuggerCallFrame.cpp:
3921         (JSC::DebuggerCallFrame::evaluate):
3922         * interpreter/Interpreter.cpp:
3923         (JSC::Interpreter::callEval):
3924         (JSC::Interpreter::unwindCallFrame):
3925         (JSC::Interpreter::execute):
3926         (JSC::Interpreter::privateExecute):
3927         * jit/JIT.cpp:
3928         (JSC::JIT::privateCompileMainPass):
3929         (JSC::JIT::privateCompileSlowCases):
3930         * jit/JIT.h:
3931         * jit/JITOpcodes.cpp:
3932         (JSC::JIT::emit_op_get_pnames):
3933         (JSC::JIT::emit_op_convert_this_strict):
3934         (JSC::JIT::emitSlow_op_convert_this_strict):
3935         * jit/JITOpcodes32_64.cpp:
3936         (JSC::JIT::emit_op_get_pnames):
3937         * jit/JITStubs.cpp:
3938         (JSC::DEFINE_STUB_FUNCTION):
3939         * jit/JITStubs.h:
3940         * parser/ASTBuilder.h:
3941         (JSC::ASTBuilder::createFunctionBody):
3942         (JSC::ASTBuilder::isResolve):
3943         * parser/JSParser.cpp:
3944         (JSC::JSParser::next):
3945         (JSC::JSParser::startLoop):
3946         (JSC::JSParser::endLoop):
3947         (JSC::JSParser::startSwitch):
3948         (JSC::JSParser::endSwitch):
3949         (JSC::JSParser::setStrictMode):
3950         (JSC::JSParser::strictMode):
3951         (JSC::JSParser::isValidStrictMode):
3952         (JSC::JSParser::declareParameter):
3953         (JSC::JSParser::breakIsValid):
3954         (JSC::JSParser::pushLabel):
3955         (JSC::JSParser::popLabel):
3956         (JSC::JSParser::hasLabel):
3957         (JSC::JSParser::DepthManager::DepthManager):
3958         (JSC::JSParser::DepthManager::~DepthManager):
3959         (JSC::JSParser::Scope::Scope):
3960         (JSC::JSParser::Scope::startSwitch):
3961         (JSC::JSParser::Scope::endSwitch):
3962         (JSC::JSParser::Scope::startLoop):
3963         (JSC::JSParser::Scope::endLoop):
3964         (JSC::JSParser::Scope::inLoop):
3965         (JSC::JSParser::Scope::breakIsValid):
3966         (JSC::JSParser::Scope::pushLabel):
3967         (JSC::JSParser::Scope::popLabel):
3968         (JSC::JSParser::Scope::hasLabel):
3969         (JSC::JSParser::Scope::isFunction):
3970         (JSC::JSParser::Scope::declareVariable):
3971         (JSC::JSParser::Scope::declareWrite):
3972         (JSC::JSParser::Scope::deleteProperty):
3973         (JSC::JSParser::Scope::declareParameter):
3974         (JSC::JSParser::Scope::setNeedsFullActivation):
3975         (JSC::JSParser::Scope::collectFreeVariables):
3976         (JSC::JSParser::Scope::getUncapturedWrittenVariables):
3977         (JSC::JSParser::Scope::getDeletedVariables):
3978         (JSC::JSParser::Scope::setStrictMode):
3979         (JSC::JSParser::Scope::strictMode):
3980         (JSC::JSParser::Scope::isValidStrictMode):
3981         (JSC::JSParser::pushScope):
3982         (JSC::JSParser::popScope):
3983         (JSC::JSParser::declareVariable):
3984         (JSC::JSParser::declareWrite):
3985         (JSC::JSParser::deleteProperty):
3986         (JSC::jsParse):
3987         (JSC::JSParser::JSParser):
3988         (JSC::JSParser::parseProgram):
3989         (JSC::JSParser::parseSourceElements):
3990         (JSC::JSParser::parseDoWhileStatement):
3991         (JSC::JSParser::parseWhileStatement):
3992         (JSC::JSParser::parseVarDeclarationList):
3993         (JSC::JSParser::parseConstDeclarationList):
3994         (JSC::JSParser::parseForStatement):
3995         (JSC::JSParser::parseBreakStatement):
3996         (JSC::JSParser::parseContinueStatement):
3997         (JSC::JSParser::parseReturnStatement):
3998         (JSC::JSParser::parseWithStatement):
3999         (JSC::JSParser::parseSwitchStatement):
4000         (JSC::JSParser::parseSwitchClauses):
4001         (JSC::JSParser::parseSwitchDefaultClause):
4002         (JSC::JSParser::parseTryStatement):
4003         (JSC::JSParser::parseBlockStatement):
4004         (JSC::JSParser::parseStatement):
4005         (JSC::JSParser::parseFormalParameters):
4006         (JSC::JSParser::parseFunctionBody):
4007         (JSC::JSParser::parseFunctionInfo):
4008         (JSC::JSParser::parseFunctionDeclaration):
4009         (JSC::JSParser::parseExpressionOrLabelStatement):
4010         (JSC::JSParser::parseIfStatement):
4011         (JSC::JSParser::parseExpression):
4012         (JSC::JSParser::parseAssignmentExpression):
4013         (JSC::JSParser::parseConditionalExpression):
4014         (JSC::JSParser::parseBinaryExpression):
4015         (JSC::JSParser::parseStrictObjectLiteral):
4016         (JSC::JSParser::parsePrimaryExpression):
4017         (JSC::JSParser::parseMemberExpression):
4018         (JSC::JSParser::parseUnaryExpression):
4019         * parser/JSParser.h:
4020         * parser/Lexer.cpp:
4021         (JSC::Lexer::parseString):
4022         (JSC::Lexer::lex):
4023         * parser/Lexer.h:
4024         (JSC::Lexer::isReparsing):
4025         * parser/Nodes.cpp:
4026         (JSC::ScopeNode::ScopeNode):
4027         (JSC::FunctionBodyNode::FunctionBodyNode):
4028         (JSC::FunctionBodyNode::create):
4029         * parser/Nodes.h:
4030         (JSC::ScopeNode::isStrictMode):
4031         * parser/Parser.cpp:
4032         (JSC::Parser::parse):
4033         * parser/Parser.h:
4034         (JSC::Parser::parse):
4035         * parser/SyntaxChecker.h:
4036         (JSC::SyntaxChecker::SyntaxChecker):
4037         (JSC::SyntaxChecker::makeFunctionCallNode):
4038         (JSC::SyntaxChecker::appendToComma):
4039         (JSC::SyntaxChecker::createCommaExpr):
4040         (JSC::SyntaxChecker::makeAssignNode):
4041         (JSC::SyntaxChecker::makePrefixNode):
4042         (JSC::SyntaxChecker::makePostfixNode):
4043         (JSC::SyntaxChecker::makeTypeOfNode):
4044         (JSC::SyntaxChecker::makeDeleteNode):
4045         (JSC::SyntaxChecker::makeNegateNode):
4046         (JSC::SyntaxChecker::makeBitwiseNotNode):
4047         (JSC::SyntaxChecker::createLogicalNot):
4048         (JSC::SyntaxChecker::createUnaryPlus):
4049         (JSC::SyntaxChecker::createVoid):
4050         (JSC::SyntaxChecker::thisExpr):
4051         (JSC::SyntaxChecker::createResolve):
4052         (JSC::SyntaxChecker::createObjectLiteral):
4053         (JSC::SyntaxChecker::createArray):
4054         (JSC::SyntaxChecker::createNumberExpr):
4055         (JSC::SyntaxChecker::createString):
4056         (JSC::SyntaxChecker::createBoolean):
4057         (JSC::SyntaxChecker::createNull):
4058         (JSC::SyntaxChecker::createBracketAccess):
4059         (JSC::SyntaxChecker::createDotAccess):
4060         (JSC::SyntaxChecker::createRegex):
4061         (JSC::SyntaxChecker::createNewExpr):
4062         (JSC::SyntaxChecker::createConditionalExpr):
4063         (JSC::SyntaxChecker::createAssignResolve):
4064         (JSC::SyntaxChecker::createFunctionExpr):
4065         (JSC::SyntaxChecker::createFunctionBody):
4066         (JSC::SyntaxChecker::appendBinaryExpressionInfo):
4067         (JSC::SyntaxChecker::operatorStackPop):
4068         * runtime/Arguments.cpp:
4069         (JSC::Arguments::createStrictModeCallerIfNecessary):
4070         (JSC::Arguments::createStrictModeCalleeIfNecessary):
4071         (JSC::Arguments::getOwnPropertySlot):
4072         (JSC::Arguments::getOwnPropertyDescriptor):
4073         (JSC::Arguments::put):
4074         (JSC::Arguments::deleteProperty):
4075         * runtime/Arguments.h:
4076         (JSC::Arguments::Arguments):
4077         * runtime/CommonIdentifiers.cpp:
4078         (JSC::CommonIdentifiers::CommonIdentifiers):
4079         * runtime/CommonIdentifiers.h:
4080         * runtime/Error.cpp:
4081         (JSC::StrictModeTypeErrorFunction::StrictModeTypeErrorFunction):
4082         (JSC::StrictModeTypeErrorFunction::constructThrowTypeError):
4083         (JSC::StrictModeTypeErrorFunction::getConstructData):
4084         (JSC::StrictModeTypeErrorFunction::callThrowTypeError):
4085         (JSC::StrictModeTypeErrorFunction::getCallData):
4086         (JSC::createTypeErrorFunction):
4087         * runtime/Error.h:
4088         * runtime/Executable.cpp:
4089         (JSC::EvalExecutable::EvalExecutable):
4090         (JSC::ProgramExecutable::ProgramExecutable):
4091         (JSC::FunctionExecutable::FunctionExecutable):
4092         (JSC::EvalExecutable::compileInternal):
4093         (JSC::ProgramExecutable::checkSyntax):
4094         (JSC::ProgramExecutable::compileInternal):
4095         (JSC::FunctionExecutable::compileForCallInternal):
4096         (JSC::FunctionExecutable::compileForConstructInternal):
4097         (JSC::FunctionExecutable::reparseExceptionInfo):
4098         (JSC::EvalExecutable::reparseExceptionInfo):
4099         (JSC::FunctionExecutable::fromGlobalCode):
4100         (JSC::ProgramExecutable::reparseExceptionInfo):
4101         * runtime/Executable.h:
4102         (JSC::ScriptExecutable::ScriptExecutable):
4103         (JSC::ScriptExecutable::isStrictMode):
4104         (JSC::EvalExecutable::create):
4105         (JSC::FunctionExecutable::create):
4106         * runtime/JSActivation.cpp:
4107         (JSC::JSActivation::toStrictThisObject):
4108         * runtime/JSActivation.h:
4109         * runtime/JSFunction.cpp:
4110         (JSC::createDescriptorForThrowingProperty):
4111         (JSC::JSFunction::getOwnPropertySlot):
4112         (JSC::JSFunction::getOwnPropertyDescriptor):
4113         (JSC::JSFunction::put):
4114         * runtime/JSGlobalData.cpp:
4115         (JSC::JSGlobalData::JSGlobalData):
4116         * runtime/JSGlobalData.h:
4117         * runtime/JSGlobalObject.cpp:
4118         (JSC::JSGlobalObject::reset):
4119         * runtime/JSGlobalObject.h:
4120         (JSC::JSGlobalObject::internalFunctionStructure):
4121         * runtime/JSGlobalObjectFunctions.cpp:
4122         (JSC::globalFuncEval):
4123         * runtime/JSObject.cpp:
4124         (JSC::JSObject::put):
4125         (JSC::JSObject::toStrictThisObject):
4126         (JSC::throwTypeError):
4127         * runtime/JSObject.h:
4128         (JSC::JSObject::isStrictModeFunction):
4129         (JSC::JSObject::putDirectInternal):
4130         (JSC::JSObject::putDirect):
4131         (JSC::JSValue::putDirect):
4132         (JSC::JSValue::toStrictThisObject):
4133         * runtime/JSStaticScopeObject.cpp:
4134         (JSC::JSStaticScopeObject::toStrictThisObject):
4135         * runtime/JSStaticScopeObject.h:
4136         * runtime/JSValue.h:
4137         * runtime/JSZombie.h:
4138         (JSC::JSZombie::toStrictThisObject):
4139         * runtime/PutPropertySlot.h:
4140         (JSC::PutPropertySlot::PutPropertySlot):
4141         (JSC::PutPropertySlot::isStrictMode):
4142         * runtime/StrictEvalActivation.cpp: Added.
4143         (JSC::StrictEvalActivation::StrictEvalActivation):
4144         (JSC::StrictEvalActivation::deleteProperty):
4145         (JSC::StrictEvalActivation::toThisObject):
4146         (JSC::StrictEvalActivation::toStrictThisObject):
4147         * runtime/StrictEvalActivation.h: Added.
4148
4149 2010-10-10  Patrick Gansterer  <paroga@webkit.org>
4150
4151         Unreviewed.
4152
4153         Windows build fix after r69472.