2009-07-20 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
[WebKit-https.git] / JavaScriptCore / ChangeLog
1 2009-07-20  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
2
3         Reviewed by Darin Adler.
4
5         Allow custom memory allocation control in JavaScriptCore's RegexPattern.h
6         https://bugs.webkit.org/show_bug.cgi?id=27343
7
8         Inherits RegexPattern.h's structs (which have been instantiated by operator new) from FastAllocBase:
9
10         CharacterClass (new call: JavaScriptCore/yarr/RegexCompiler.cpp:144)
11         PatternAlternative (new call: JavaScriptCore/yarr/RegexPattern.h:221) 
12         PatternDisjunction (new call: JavaScriptCore/yarr/RegexCompiler.cpp:446)
13
14         * yarr/RegexPattern.h:
15
16 2009-07-20  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
17
18         Reviewed by Darin Adler.
19
20         Allow custom memory allocation control for JavaScriptCore's MatchFrame struct
21         https://bugs.webkit.org/show_bug.cgi?id=27344
22
23         Inherits MatchFrame struct from FastAllocBase because it has
24         been instantiated by 'new' JavaScriptCore/pcre/pcre_exec.cpp:359.
25
26         * pcre/pcre_exec.cpp:
27
28 2009-07-20  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
29
30         Reviewed by Holger Freyther.
31
32         Remove some outdated S60 platform specific code
33         https://bugs.webkit.org/show_bug.cgi?id=27423
34
35         * wtf/Platform.h:
36
37 2009-07-20  Csaba Osztrogonac  <oszi@inf.u-szeged.hu>
38
39         Reviewed by Simon Hausmann.
40
41         Qt build fix with MSVC and MinGW.
42
43         * jsc.pro: Make sure jsc is a console application, and turn off
44         exceptions and stl support to fix the build.
45
46 2009-07-20  Xan Lopez  <xlopez@igalia.com>
47
48         Reviewed by Gustavo Noronha.
49
50         Do not use C++-style comments in preprocessor directives.
51
52         GCC does not like this in some configurations, using C-style
53         comments is safer.
54
55         * wtf/Platform.h:
56
57 2009-07-17  Peter Kasting  <pkasting@google.com>
58
59         Reviewed by Steve Falkenburg.
60
61         https://bugs.webkit.org/show_bug.cgi?id=27323
62         Only add Cygwin to the path when it isn't already there.  This avoids
63         causing problems for people who purposefully have non-Cygwin versions of
64         executables like svn in front of the Cygwin ones in their paths.
65
66         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
67         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj:
68         * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops:
69         * JavaScriptCore.vcproj/jsc/jscCommon.vsprops:
70         * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops:
71
72 2009-07-17  Gabor Loki  <loki@inf.u-szeged.hu>
73
74         Reviewed by Gavin Barraclough.
75
76         Add YARR support for generic ARM platforms (disabled by default).
77         https://bugs.webkit.org/show_bug.cgi?id=24986
78
79         Add generic ARM port for MacroAssembler. It supports the whole
80         MacroAssembler functionality except floating point.
81
82         The class JmpSrc is extended with a flag which enables to patch
83         the jump destination offset during execution. This feature is
84         required for generic ARM port.
85
86         Signed off by Zoltan Herczeg <zherczeg@inf.u-szeged.hu>
87         Signed off by Gabor Loki <loki@inf.u-szeged.hu>
88
89         * JavaScriptCore.pri:
90         * assembler/ARMAssembler.cpp: Added.
91         (JSC::ARMAssembler::getLdrImmAddress):
92         (JSC::ARMAssembler::linkBranch):
93         (JSC::ARMAssembler::patchConstantPoolLoad):
94         (JSC::ARMAssembler::getOp2):
95         (JSC::ARMAssembler::genInt):
96         (JSC::ARMAssembler::getImm):
97         (JSC::ARMAssembler::moveImm):
98         (JSC::ARMAssembler::dataTransfer32):
99         (JSC::ARMAssembler::baseIndexTransfer32):
100         (JSC::ARMAssembler::executableCopy):
101         * assembler/ARMAssembler.h: Added.
102         (JSC::ARM::):
103         (JSC::ARMAssembler::ARMAssembler):
104         (JSC::ARMAssembler::):
105         (JSC::ARMAssembler::JmpSrc::JmpSrc):
106         (JSC::ARMAssembler::JmpSrc::enableLatePatch):
107         (JSC::ARMAssembler::JmpDst::JmpDst):
108         (JSC::ARMAssembler::JmpDst::isUsed):
109         (JSC::ARMAssembler::JmpDst::used):
110         (JSC::ARMAssembler::emitInst):
111         (JSC::ARMAssembler::and_r):
112         (JSC::ARMAssembler::ands_r):
113         (JSC::ARMAssembler::eor_r):
114         (JSC::ARMAssembler::eors_r):
115         (JSC::ARMAssembler::sub_r):
116         (JSC::ARMAssembler::subs_r):
117         (JSC::ARMAssembler::rsb_r):
118         (JSC::ARMAssembler::rsbs_r):
119         (JSC::ARMAssembler::add_r):
120         (JSC::ARMAssembler::adds_r):
121         (JSC::ARMAssembler::adc_r):
122         (JSC::ARMAssembler::adcs_r):
123         (JSC::ARMAssembler::sbc_r):
124         (JSC::ARMAssembler::sbcs_r):
125         (JSC::ARMAssembler::rsc_r):
126         (JSC::ARMAssembler::rscs_r):
127         (JSC::ARMAssembler::tst_r):
128         (JSC::ARMAssembler::teq_r):
129         (JSC::ARMAssembler::cmp_r):
130         (JSC::ARMAssembler::orr_r):
131         (JSC::ARMAssembler::orrs_r):
132         (JSC::ARMAssembler::mov_r):
133         (JSC::ARMAssembler::movs_r):
134         (JSC::ARMAssembler::bic_r):
135         (JSC::ARMAssembler::bics_r):
136         (JSC::ARMAssembler::mvn_r):
137         (JSC::ARMAssembler::mvns_r):
138         (JSC::ARMAssembler::mul_r):
139         (JSC::ARMAssembler::muls_r):
140         (JSC::ARMAssembler::mull_r):
141         (JSC::ARMAssembler::ldr_imm):
142         (JSC::ARMAssembler::ldr_un_imm):
143         (JSC::ARMAssembler::dtr_u):
144         (JSC::ARMAssembler::dtr_ur):
145         (JSC::ARMAssembler::dtr_d):
146         (JSC::ARMAssembler::dtr_dr):
147         (JSC::ARMAssembler::ldrh_r):
148         (JSC::ARMAssembler::ldrh_d):
149         (JSC::ARMAssembler::ldrh_u):
150         (JSC::ARMAssembler::strh_r):
151         (JSC::ARMAssembler::push_r):
152         (JSC::ARMAssembler::pop_r):
153         (JSC::ARMAssembler::poke_r):
154         (JSC::ARMAssembler::peek_r):
155         (JSC::ARMAssembler::clz_r):
156         (JSC::ARMAssembler::bkpt):
157         (JSC::ARMAssembler::lsl):
158         (JSC::ARMAssembler::lsr):
159         (JSC::ARMAssembler::asr):
160         (JSC::ARMAssembler::lsl_r):
161         (JSC::ARMAssembler::lsr_r):
162         (JSC::ARMAssembler::asr_r):
163         (JSC::ARMAssembler::size):
164         (JSC::ARMAssembler::ensureSpace):
165         (JSC::ARMAssembler::label):
166         (JSC::ARMAssembler::align):
167         (JSC::ARMAssembler::jmp):
168         (JSC::ARMAssembler::patchPointerInternal):
169         (JSC::ARMAssembler::patchConstantPoolLoad):
170         (JSC::ARMAssembler::patchPointer):
171         (JSC::ARMAssembler::repatchInt32):
172         (JSC::ARMAssembler::repatchPointer):
173         (JSC::ARMAssembler::repatchLoadPtrToLEA):
174         (JSC::ARMAssembler::linkJump):
175         (JSC::ARMAssembler::relinkJump):
176         (JSC::ARMAssembler::linkCall):
177         (JSC::ARMAssembler::relinkCall):
178         (JSC::ARMAssembler::getRelocatedAddress):
179         (JSC::ARMAssembler::getDifferenceBetweenLabels):
180         (JSC::ARMAssembler::getCallReturnOffset):
181         (JSC::ARMAssembler::getOp2Byte):
182         (JSC::ARMAssembler::placeConstantPoolBarrier):
183         (JSC::ARMAssembler::RM):
184         (JSC::ARMAssembler::RS):
185         (JSC::ARMAssembler::RD):
186         (JSC::ARMAssembler::RN):
187         (JSC::ARMAssembler::getConditionalField):
188         * assembler/ARMv7Assembler.h:
189         (JSC::ARMv7Assembler::JmpSrc::enableLatePatch):
190         * assembler/AbstractMacroAssembler.h:
191         (JSC::AbstractMacroAssembler::Call::enableLatePatch):
192         (JSC::AbstractMacroAssembler::Jump::enableLatePatch):
193         * assembler/MacroAssembler.h:
194         * assembler/MacroAssemblerARM.h: Added.
195         (JSC::MacroAssemblerARM::):
196         (JSC::MacroAssemblerARM::add32):
197         (JSC::MacroAssemblerARM::and32):
198         (JSC::MacroAssemblerARM::lshift32):
199         (JSC::MacroAssemblerARM::mul32):
200         (JSC::MacroAssemblerARM::not32):
201         (JSC::MacroAssemblerARM::or32):
202         (JSC::MacroAssemblerARM::rshift32):
203         (JSC::MacroAssemblerARM::sub32):
204         (JSC::MacroAssemblerARM::xor32):
205         (JSC::MacroAssemblerARM::load32):
206         (JSC::MacroAssemblerARM::load32WithAddressOffsetPatch):
207         (JSC::MacroAssemblerARM::loadPtrWithPatchToLEA):
208         (JSC::MacroAssemblerARM::load16):
209         (JSC::MacroAssemblerARM::store32WithAddressOffsetPatch):
210         (JSC::MacroAssemblerARM::store32):
211         (JSC::MacroAssemblerARM::pop):
212         (JSC::MacroAssemblerARM::push):
213         (JSC::MacroAssemblerARM::move):
214         (JSC::MacroAssemblerARM::swap):
215         (JSC::MacroAssemblerARM::signExtend32ToPtr):
216         (JSC::MacroAssemblerARM::zeroExtend32ToPtr):
217         (JSC::MacroAssemblerARM::branch32):
218         (JSC::MacroAssemblerARM::branch16):
219         (JSC::MacroAssemblerARM::branchTest32):
220         (JSC::MacroAssemblerARM::jump):
221         (JSC::MacroAssemblerARM::branchAdd32):
222         (JSC::MacroAssemblerARM::mull32):
223         (JSC::MacroAssemblerARM::branchMul32):
224         (JSC::MacroAssemblerARM::branchSub32):
225         (JSC::MacroAssemblerARM::breakpoint):
226         (JSC::MacroAssemblerARM::nearCall):
227         (JSC::MacroAssemblerARM::call):
228         (JSC::MacroAssemblerARM::ret):
229         (JSC::MacroAssemblerARM::set32):
230         (JSC::MacroAssemblerARM::setTest32):
231         (JSC::MacroAssemblerARM::tailRecursiveCall):
232         (JSC::MacroAssemblerARM::makeTailRecursiveCall):
233         (JSC::MacroAssemblerARM::moveWithPatch):
234         (JSC::MacroAssemblerARM::branchPtrWithPatch):
235         (JSC::MacroAssemblerARM::storePtrWithPatch):
236         (JSC::MacroAssemblerARM::supportsFloatingPoint):
237         (JSC::MacroAssemblerARM::supportsFloatingPointTruncate):
238         (JSC::MacroAssemblerARM::loadDouble):
239         (JSC::MacroAssemblerARM::storeDouble):
240         (JSC::MacroAssemblerARM::addDouble):
241         (JSC::MacroAssemblerARM::subDouble):
242         (JSC::MacroAssemblerARM::mulDouble):
243         (JSC::MacroAssemblerARM::convertInt32ToDouble):
244         (JSC::MacroAssemblerARM::branchDouble):
245         (JSC::MacroAssemblerARM::branchTruncateDoubleToInt32):
246         (JSC::MacroAssemblerARM::ARMCondition):
247         (JSC::MacroAssemblerARM::prepareCall):
248         (JSC::MacroAssemblerARM::call32):
249         * assembler/X86Assembler.h:
250         (JSC::X86Assembler::JmpSrc::enableLatePatch):
251         * jit/ExecutableAllocator.h:
252         (JSC::ExecutableAllocator::cacheFlush):
253         * wtf/Platform.h:
254         * yarr/RegexJIT.cpp:
255         (JSC::Yarr::RegexGenerator::generateEnter):
256         (JSC::Yarr::RegexGenerator::generateReturn):
257
258 2009-07-17  Gabor Loki  <loki@inf.u-szeged.hu>
259
260         Reviewed by Gavin Barraclough.
261
262         Extend AssemblerBuffer with constant pool handling mechanism.
263         https://bugs.webkit.org/show_bug.cgi?id=24986
264
265         Add a platform independed constant pool framework.
266         This pool can store 32 or 64 bits values which is enough to hold
267         any integer, pointer or double constant.
268
269         * assembler/AssemblerBuffer.h:
270         (JSC::AssemblerBuffer::putIntUnchecked):
271         (JSC::AssemblerBuffer::putInt64Unchecked):
272         (JSC::AssemblerBuffer::append):
273         (JSC::AssemblerBuffer::grow):
274         * assembler/AssemblerBufferWithConstantPool.h: Added.
275         (JSC::):
276
277 2009-07-17  Eric Roman  <eroman@chromium.org>
278
279         Reviewed by Darin Adler.
280
281         Build fix for non-Darwin.
282         Add a guard for inclusion of RetainPtr.h which includes CoreFoundation.h
283
284         https://bugs.webkit.org/show_bug.cgi?id=27382
285
286         * wtf/unicode/icu/CollatorICU.cpp:
287
288 2009-07-17  Alexey Proskuryakov  <ap@webkit.org>
289
290         Reviewed by John Sullivan.
291
292         Get user default collation order via a CFLocale API when available.
293
294         * wtf/unicode/icu/CollatorICU.cpp: (WTF::Collator::userDefault):
295
296 2009-07-17  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
297
298         Reviewed by Simon Hausmann.
299
300         [Qt] Fix the include path for the Symbian port
301         https://bugs.webkit.org/show_bug.cgi?id=27358
302
303         * JavaScriptCore.pri:
304
305 2009-07-17  Csaba Osztrogonac  <oszi@inf.u-szeged.hu>
306
307         Reviewed by David Levin.
308
309         Build fix on platforms don't have MMAP.
310         https://bugs.webkit.org/show_bug.cgi?id=27365
311
312         * interpreter/RegisterFile.h: Including stdio.h irrespectively of HAVE(MMAP)
313
314 2009-07-16  Fumitoshi Ukai  <ukai@chromium.org>
315
316         Reviewed by David Levin.
317
318         Add --web-sockets flag and ENABLE_WEB_SOCKETS define.
319         https://bugs.webkit.org/show_bug.cgi?id=27206
320         
321         Add ENABLE_WEB_SOCKETS
322
323         * Configurations/FeatureDefines.xcconfig: add ENABLE_WEB_SOCKETS
324
325 2009-07-16  Maxime Simon  <simon.maxime@gmail.com>
326
327         Reviewed by Eric Seidel.
328
329         Added Haiku-specific files for JavaScriptCore.
330         https://bugs.webkit.org/show_bug.cgi?id=26620
331
332         * wtf/haiku/MainThreadHaiku.cpp: Added.
333         (WTF::initializeMainThreadPlatform):
334         (WTF::scheduleDispatchFunctionsOnMainThread):
335
336 2009-07-16  Gavin Barraclough  <barraclough@apple.com>
337
338         RS by Oliver Hunt.
339
340         Revert r45969, this fix does not appear to be valid.
341         https://bugs.webkit.org/show_bug.cgi?id=27077
342
343         * bytecode/CodeBlock.cpp:
344         (JSC::CodeBlock::~CodeBlock):
345         (JSC::CodeBlock::unlinkCallers):
346         * jit/JIT.cpp:
347         * jit/JIT.h:
348
349 2009-07-16  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
350
351         Reviewed by Oliver Hunt.
352
353         Allow custom memory allocation control in ExceptionInfo and RareData struct
354         https://bugs.webkit.org/show_bug.cgi?id=27336
355
356         Inherits ExceptionInfo and RareData struct from FastAllocBase because these
357         have been instantiated by 'new' in JavaScriptCore/bytecode/CodeBlock.cpp:1289 and
358         in JavaScriptCore/bytecode/CodeBlock.h:453.
359
360         Remove unnecessary WTF:: namespace from CodeBlock inheritance.
361  
362         * bytecode/CodeBlock.h:
363
364 2009-07-16  Mark Rowe  <mrowe@apple.com>
365
366         Rubber-stamped by Geoff Garen.
367
368         Fix FeatureDefines.xcconfig to not be out of sync with the rest of the world.
369
370         * Configurations/FeatureDefines.xcconfig:
371
372 2009-07-16  Yong Li  <yong.li@torchmobile.com>
373
374          Reviewed by George Staikos.
375
376          https://bugs.webkit.org/show_bug.cgi?id=27320
377          _countof is only included in CE6; for CE5 we need to define it ourself
378
379          * wtf/Platform.h:
380
381 2009-07-16  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
382
383         Reviewed by Oliver Hunt.
384
385         Workers + garbage collector: weird crashes
386         https://bugs.webkit.org/show_bug.cgi?id=27077
387
388         We need to unlink cached method call sites when a function is destroyed.
389
390         * JavaScriptCore.xcodeproj/project.pbxproj:
391         * bytecode/CodeBlock.cpp:
392         (JSC::CodeBlock::~CodeBlock):
393         (JSC::CodeBlock::unlinkCallers):
394         * jit/JIT.cpp:
395         (JSC::JIT::unlinkMethodCall):
396         * jit/JIT.h:
397
398 2009-07-15  Steve Falkenburg  <sfalken@apple.com>
399
400         Windows Build fix.
401
402         Visual Studio reset our intermediate directory on us.
403         This sets it back.
404         
405         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
406         * JavaScriptCore.vcproj/testapi/testapi.vcproj:
407
408 2009-07-15  Kwang Yul Seo  <skyul@company100.net>
409
410         Reviewed by Eric Seidel.
411
412         https://bugs.webkit.org/show_bug.cgi?id=26794
413         Make Yacc-generated parsers to use fastMalloc/fastFree.
414         
415         Define YYMALLOC and YYFREE to fastMalloc and fastFree
416         respectively.
417
418         * parser/Grammar.y:
419
420 2009-07-15  Darin Adler  <darin@apple.com>
421
422         Fix a build for a particular Apple configuration.
423
424         * wtf/FastAllocBase.h: Change include to use "" style for
425         including another wtf header. This is the style we use for
426         including other public headers in the same directory.
427
428 2009-07-15  George Staikos  <george.staikos@torchmobile.com>
429
430         Reviewed by Adam Treat.
431
432         https://bugs.webkit.org/show_bug.cgi?id=27303
433         Implement createThreadInternal for WinCE.
434         Contains changes by George Staikos <george.staikos@torchmobile.com> and Joe Mason <joe.mason@torchmobile.com>
435
436         * wtf/ThreadingWin.cpp:
437         (WTF::createThreadInternal):
438
439 2009-07-15  Joe Mason  <joe.mason@torchmobile.com>
440
441          Reviewed by George Staikos.
442
443          https://bugs.webkit.org/show_bug.cgi?id=27298
444          Platform defines for WINCE.
445          Contains changes by Yong Li <yong.li@torchmobile.com>,
446          George Staikos <george.staikos@torchmobile.com> and Joe Mason <joe.mason@torchmobile.com>
447
448          * wtf/Platform.h:
449
450 2009-07-15  Yong Li  <yong.li@torchmobile.com>
451
452          Reviewed by Adam Treat.
453
454          https://bugs.webkit.org/show_bug.cgi?id=27306
455          Use RegisterClass instead of RegisterClassEx on WinCE.
456
457          * wtf/win/MainThreadWin.cpp:
458          (WTF::initializeMainThreadPlatform):
459
460 2009-07-15  Yong Li  <yong.li@torchmobile.com>
461
462          Reviewed by George Staikos.
463
464          https://bugs.webkit.org/show_bug.cgi?id=27301
465          Use OutputDebugStringW on WinCE since OutputDebugStringA is not supported
466          Originally written by Yong Li <yong.li@torchmobile.com> and refactored by
467          Joe Mason <joe.mason@torchmobile.com>
468
469          * wtf/Assertions.cpp: vprintf_stderr_common
470
471 2009-07-15  Yong Li  <yong.li@torchmobile.com>
472
473          Reviewed by George Staikos.
474
475          https://bugs.webkit.org/show_bug.cgi?id=27020
476          msToGregorianDateTime should set utcOffset to 0 when outputIsUTC is false
477
478          * wtf/DateMath.cpp:
479          (WTF::gregorianDateTimeToMS):
480
481 2009-07-15  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
482
483         Reviewed by Simon Hausmann.
484
485         [Qt] Cleanup - Remove obsolete code from the make system
486         https://bugs.webkit.org/show_bug.cgi?id=27299
487
488         * JavaScriptCore.pro:
489         * jsc.pro:
490
491 2009-07-07  Norbert Leser  <norbert.leser@nokia.com>
492
493         Reviewed by Simon Hausmann.
494
495         https://bugs.webkit.org/show_bug.cgi?id=27056
496
497         Alternate bool operator for codewarrior compiler (WINSCW).
498         Compiler (latest b482) reports error for UnspecifiedBoolType construct:
499         "illegal explicit conversion from 'WTF::OwnArrayPtr<JSC::Register>' to 'bool'"
500
501         Same fix as in r38391.
502
503         * JavaScriptCore/wtf/OwnArrayPtr.h:
504
505 2009-07-15  Norbert Leser  <norbert.leser@nokia.com>
506
507         Reviewed by Darin Adler.
508
509         Qualify include path with wtf to fix compilation
510         on Symbian.
511         https://bugs.webkit.org/show_bug.cgi?id=27055
512
513         * interpreter/Interpreter.h:
514
515 2009-07-15  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
516
517         Reviewed by Dave Kilzer.
518
519         Turn off non-portable date manipulations for SYMBIAN
520         https://bugs.webkit.org/show_bug.cgi?id=27064
521
522         Introduce HAVE(TM_GMTOFF), HAVE(TM_ZONE) and HAVE(TIMEGM) guards 
523         and place the rules for controlling the guards in Platform.h.
524         Turn off these newly introduced guards for SYMBIAN.
525
526         * wtf/DateMath.cpp:
527         (WTF::calculateUTCOffset):
528         * wtf/DateMath.h:
529         (WTF::GregorianDateTime::GregorianDateTime):
530         (WTF::GregorianDateTime::operator tm):
531         * wtf/Platform.h:
532
533 2009-07-15  Norbert Leser  <norbert.leser@nokia.com>
534
535         Reviewed by Simon Hausmann.
536
537         Undef ASSERT on Symbian, to avoid excessive warnings
538         https://bugs.webkit.org/show_bug.cgi?id=27052
539
540         * wtf/Assertions.h:
541
542 2009-07-15  Oliver Hunt  <oliver@apple.com>
543
544         Reviewed by Simon Hausmann.
545
546         REGRESSION: fast/js/postfix-syntax.html fails with interpreter
547         https://bugs.webkit.org/show_bug.cgi?id=27294
548
549         When postfix operators operating on locals assign to the same local
550         the order of operations has to be to store the incremented value, then
551         store the unmodified number.  Rather than implementing this subtle
552         semantic in the interpreter I've just made the logic explicit in the
553         bytecode generator, so x=x++ effectively becomes x=ToNumber(x) (for a
554         local var x).
555
556         * parser/Nodes.cpp:
557         (JSC::emitPostIncOrDec):
558
559 2009-07-15  Oliver Hunt  <oliver@apple.com>
560
561         Reviewed by Simon Hausmann.
562
563         REGRESSION(43559): fast/js/kde/arguments-scope.html fails with interpreter
564         https://bugs.webkit.org/show_bug.cgi?id=27259
565
566         The interpreter was incorrectly basing its need to create the arguments object
567         based on the presence of the callframe's argument reference rather than the local
568         arguments reference.  Based on this it then overrode the local variable reference.
569
570         * interpreter/Interpreter.cpp:
571         (JSC::Interpreter::privateExecute):
572
573 2009-07-14  Steve Falkenburg  <sfalken@apple.com>
574
575         Reorganize JavaScriptCore headers into:
576         API: include/JavaScriptCore/
577         Private: include/private/JavaScriptCore/
578
579         Reviewed by Darin Adler.
580
581         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
582         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
583         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
584         * JavaScriptCore.vcproj/testapi/testapi.vcproj:
585         * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops:
586
587 2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
588
589         Reviewed by Darin Adler.
590
591         Change JSCell's superclass to NoncopyableCustomAllocated
592         https://bugs.webkit.org/show_bug.cgi?id=27248
593
594         JSCell class customizes operator new, since Noncopyable will be 
595         inherited from FastAllocBase, NoncopyableCustomAllocated has 
596         to be used.
597
598         * runtime/JSCell.h:
599
600 2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
601
602         Reviewed by Darin Adler.
603
604         Change all Noncopyable inheriting visibility to public.
605         https://bugs.webkit.org/show_bug.cgi?id=27225
606
607         Change all Noncopyable inheriting visibility to public because
608         it is needed to the custom allocation framework (bug #20422).
609
610         * bytecode/SamplingTool.h:
611         * bytecompiler/RegisterID.h:
612         * interpreter/CachedCall.h:
613         * interpreter/RegisterFile.h:
614         * parser/Lexer.h:
615         * parser/Parser.h:
616         * runtime/ArgList.h:
617         * runtime/BatchedTransitionOptimizer.h:
618         * runtime/Collector.h:
619         * runtime/CommonIdentifiers.h:
620         * runtime/JSCell.h:
621         * runtime/JSGlobalObject.h:
622         * runtime/JSLock.h:
623         * runtime/JSONObject.cpp:
624         * runtime/SmallStrings.cpp:
625         * runtime/SmallStrings.h:
626         * wtf/CrossThreadRefCounted.h:
627         * wtf/GOwnPtr.h:
628         * wtf/Locker.h:
629         * wtf/MessageQueue.h:
630         * wtf/OwnArrayPtr.h:
631         * wtf/OwnFastMallocPtr.h:
632         * wtf/OwnPtr.h:
633         * wtf/RefCounted.h:
634         * wtf/ThreadSpecific.h:
635         * wtf/Threading.h:
636         * wtf/Vector.h:
637         * wtf/unicode/Collator.h:
638
639 2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
640
641         Reviewed by Darin Adler.
642
643         Change ParserArenaRefCounted's superclass to RefCountedCustomAllocated
644         https://bugs.webkit.org/show_bug.cgi?id=27249
645
646         ParserArenaDeletable customizes operator new, to avoid double inheritance
647         ParserArenaDeletable's superclass has been changed to RefCountedCustomAllocated.
648
649         * parser/Nodes.h:
650
651 2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
652
653         Reviewed by Darin Adler.
654
655         Add RefCountedCustomAllocated to RefCounted.h
656         https://bugs.webkit.org/show_bug.cgi?id=27232
657
658         Some class which are inherited from RefCounted customize
659         operator new, but RefCounted is inherited from Noncopyable
660         which will be inherited from FastAllocBase. To avoid
661         conflicts Noncopyable inheriting was moved down to RefCounted
662         and to avoid double inheritance this class has been added.
663
664         * wtf/RefCounted.h:
665         (WTF::RefCountedCustomAllocated::deref):
666         (WTF::RefCountedCustomAllocated::~RefCountedCustomAllocated):
667
668 2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
669
670         Reviewed by Darin Adler.
671
672         Add NoncopyableCustomAllocated to Noncopyable.h.
673         https://bugs.webkit.org/show_bug.cgi?id=27228
674         
675         Some classes which inherited from Noncopyable overrides operator new
676         since Noncopyable'll be inherited from FastAllocBase, Noncopyable.h 
677         needs to be extended with this new class to support the overriding. 
678
679         * wtf/Noncopyable.h:
680         (WTFNoncopyable::NoncopyableCustomAllocated::NoncopyableCustomAllocated):
681         (WTFNoncopyable::NoncopyableCustomAllocated::~NoncopyableCustomAllocated):
682
683 2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
684
685         Reviewed by Darin Adler.
686
687         Allow custom memory allocation control for JavaScriptCore's IdentifierTable class
688         https://bugs.webkit.org/show_bug.cgi?id=27260
689
690         Inherits IdentifierTable class from FastAllocBase because it has been
691         instantiated by 'new' in JavaScriptCore/runtime/Identifier.cpp:70.
692
693         * runtime/Identifier.cpp:
694
695 2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
696
697         Reviewed by Darin Adler.
698
699         Allow custom memory allocation control for JavaScriptCore's Profiler class
700         https://bugs.webkit.org/show_bug.cgi?id=27253
701
702         Inherits Profiler class from FastAllocBase because it has been instantiated by
703         'new' in JavaScriptCore/profiler/Profiler.cpp:56.
704
705         * profiler/Profiler.h:
706
707 2009-07-06  George Staikos  <george.staikos@torchmobile.com>
708
709         Reviewed by Adam Treat.
710
711         Authors: George Staikos <george.staikos@torchmobile.com>, Joe Mason <joe.mason@torchmobile.com>, Makoto Matsumoto <matumoto@math.keio.ac.jp>, Takuji Nishimura
712
713         https://bugs.webkit.org/show_bug.cgi?id=27030
714         Implement custom RNG for WinCE using Mersenne Twister
715
716         * wtf/RandomNumber.cpp:
717         (WTF::randomNumber):
718         * wtf/RandomNumberSeed.h:
719         (WTF::initializeRandomNumberGenerator):
720         * wtf/wince/mt19937ar.c: Added.
721         (init_genrand):
722         (init_by_array):
723         (genrand_int32):
724         (genrand_int31):
725         (genrand_real1):
726         (genrand_real2):
727         (genrand_real3):
728         (genrand_res53):
729
730 2009-07-13  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
731
732         Unreviewed make dist build fix.
733
734         * GNUmakefile.am:
735
736 2009-07-13  Drew Wilson  <atwilson@google.com>
737
738         Reviewed by David Levin.
739
740         Add ENABLE(SHARED_WORKERS) flag and define SharedWorker APIs
741         https://bugs.webkit.org/show_bug.cgi?id=26932
742
743         Added ENABLE(SHARED_WORKERS) flag (off by default).
744
745         * Configurations/FeatureDefines.xcconfig:
746
747 2009-07-07  Norbert Leser  <norbert.leser@nokia.com>
748
749         Reviewed by Maciej Stachoviak.
750
751         https://bugs.webkit.org/show_bug.cgi?id=27058
752
753         Removed superfluous parenthesis around single expression.
754         Compilers on Symbian platform fail to properly parse and compile.
755
756         * JavaScriptCore/wtf/Platform.h:
757
758 2009-07-13  Norbert Leser  <norbert.leser@nokia.com>
759
760         Reviewed by Maciej Stachoviak.
761
762         https://bugs.webkit.org/show_bug.cgi?id=27054
763
764         Renamed Translator to HashTranslator
765
766         Codewarrior compiler (WINSCW) latest b482 cannot resolve typename
767         mismatch between template declaration and definition
768         (HashTranslator / Translator)
769
770         * wtf/HashSet.h:
771
772 2009-07-13  Norbert Leser  <norbert.leser@nokia.com>
773
774         Reviewed by Eric Seidel.
775
776         https://bugs.webkit.org/show_bug.cgi?id=27053
777
778         Ambiguity in LabelScope initialization
779
780         Codewarrior compiler (WINSCW) latest b482 on Symbian cannot resolve
781         type of "0" unambiguously. Set expression explicitly to
782         PassRefPtr<Label>::PassRefPtr()
783
784         * bytecompiler/BytecodeGenerator.cpp
785
786 2009-07-11  Simon Fraser  <simon.fraser@apple.com>
787
788         Enable support for accelerated compositing and 3d transforms on Leopard.
789         <https://bugs.webkit.org/show_bug.cgi?id=20166>
790         <rdar://problem/6120614>
791
792         Reviewed by Oliver Hunt.
793
794         * Configurations/FeatureDefines.xcconfig:
795         * wtf/Platform.h:
796
797 2009-07-10  Mark Rowe  <mrowe@apple.com>
798
799         Second part of the "make Windows happier" dance.
800
801         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
802         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
803
804 2009-07-10  Mark Rowe  <mrowe@apple.com>
805
806         Try and make the Windows build happy.
807
808         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
809         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
810
811 2009-07-10  Kevin McCullough  <kmccullough@apple.com>
812
813         Reviewed by Geoffrey Garen.
814
815         * debugger/Debugger.h: Made this function virtual for use in WebCore's
816         WebInspector.
817
818 2009-07-10  Kwang Yul Seo  <skyul@company100.net>
819
820         Reviewed by Darin Adler.
821
822         ParserArenaDeletable should override delete
823         https://bugs.webkit.org/show_bug.cgi?id=26790
824
825         ParserArenaDeletable overrides new, but it does not override delete.
826         ParserArenaDeletable must be freed by fastFree
827         because it is allocated by fastMalloc.
828
829         * parser/NodeConstructors.h:
830         (JSC::ParserArenaDeletable::operator delete):
831         * parser/Nodes.h:
832
833 2009-07-10  Adam Roben  <aroben@apple.com>
834
835         Sort all our Xcode projects
836
837         Accomplished using sort-Xcode-project-file.
838
839         Requested by Dave Kilzer.
840
841         * JavaScriptCore.xcodeproj/project.pbxproj:
842
843 2009-07-09  Maciej Stachowiak  <mjs@apple.com>
844
845         Not reviewed, build fix.
846
847         Windows build fix for the last change.
848
849         * wtf/dtoa.cpp: Forgot to include Vector.h
850
851 2009-07-09  Maciej Stachowiak  <mjs@apple.com>
852
853         Reviewed by Darin Adler.
854
855         REGRESSION: crash in edge cases of floating point parsing.
856         https://bugs.webkit.org/show_bug.cgi?id=27110
857         <rdar://problem/7044458>
858         
859         Tests: fast/css/number-parsing-crash.html
860                fast/css/number-parsing-crash.html
861                fast/js/number-parsing-crash.html
862         
863         * wtf/dtoa.cpp:
864         (WTF::BigInt::BigInt): Converted this to more a proper class, using a Vector
865         with inline capacity
866
867         (WTF::lshift): Rearranged logic somewhat nontrivially to deal with the new way of sizing BigInts.
868         Added an assertion to verify that invariants are maintained.
869
870         All other functions are adapted fairly mechanically to the above changes.
871         (WTF::BigInt::clear):
872         (WTF::BigInt::size):
873         (WTF::BigInt::resize):
874         (WTF::BigInt::words):
875         (WTF::BigInt::append):
876         (WTF::multadd):
877         (WTF::s2b):
878         (WTF::i2b):
879         (WTF::mult):
880         (WTF::cmp):
881         (WTF::diff):
882         (WTF::b2d):
883         (WTF::d2b):
884         (WTF::ratio):
885         (WTF::strtod):
886         (WTF::quorem):
887         (WTF::dtoa):
888
889 2009-07-09  Drew Wilson  <atwilson@google.com>
890
891         Reviewed by Alexey Proskuryakov.
892
893         Turned on CHANNEL_MESSAGING by default because the MessageChannel API
894         can now be implemented for Web Workers and is reasonably stable.
895
896         * Configurations/FeatureDefines.xcconfig:
897
898 2009-07-09  Oliver Hunt  <oliver@apple.com>
899
900         Reviewed by NOBODY (Build fix).
901
902         * interpreter/Interpreter.cpp:
903         (JSC::Interpreter::privateExecute):
904
905 2009-07-09  Oliver Hunt  <oliver@apple.com>
906
907         Reviewed by Darin Adler.
908
909         Bug 27016 - Interpreter crashes due to invalid array indexes
910         <https://bugs.webkit.org/show_bug.cgi?id=27016>
911
912         Unsigned vs signed conversions results in incorrect behaviour in
913         64bit interpreter builds.
914
915         * interpreter/Interpreter.cpp:
916         (JSC::Interpreter::privateExecute):
917
918 2009-07-09  Dimitri Glazkov  <dglazkov@chromium.org>
919
920         Reviewed by Darin Fisher.
921
922         [Chromium] Upstream JavaScriptCore.gypi, the project file for Chromium build.
923         https://bugs.webkit.org/show_bug.cgi?id=27135
924
925         * JavaScriptCore.gypi: Added.
926
927 2009-07-09  Joe Mason  <joe.mason@torchmobile.com>
928
929         Reviewed by George Staikos.
930         
931         Authors: Yong Li <yong.li@torchmobile.com>, Joe Mason <joe.mason@torchmobile.com>
932
933         https://bugs.webkit.org/show_bug.cgi?id=27031
934         Add an override for deleteOwnedPtr(HDC) on Windows
935         
936         * wtf/OwnPtrCommon.h:
937         * wtf/OwnPtrWin.cpp:
938         (WTF::deleteOwnedPtr):
939
940 2009-07-09  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
941
942         Reviewed by Darin Adler.
943
944         Guard singal.h dependency with HAVE(SIGNAL_H) to enable building jsc
945         on SYMBIAN.
946
947         https://bugs.webkit.org/show_bug.cgi?id=27026
948
949         Based on Norbert Leser's work.
950
951         * jsc.cpp:
952         (printUsageStatement):
953         (parseArguments):
954         * wtf/Platform.h:
955
956 2009-07-07  Gavin Barraclough  <barraclough@apple.com>
957
958         Reviewed by Sam Weinig.
959
960         Stop loading constants into the register file.
961
962         Instead, use high register values (highest bit bar the sign bit set) to indicate
963         constants in the instruction stream, and when we encounter such a value load it
964         directly from the CodeBlock.
965
966         Since constants are no longer copied into the register file, this patch renders
967         the 'unexpected constant' mechanism redundant, and removes it.
968
969         2% improvement, thanks to Sam Weinig.
970
971         * bytecode/CodeBlock.cpp:
972         (JSC::CodeBlock::dump):
973         (JSC::CodeBlock::CodeBlock):
974         (JSC::CodeBlock::mark):
975         (JSC::CodeBlock::shrinkToFit):
976         * bytecode/CodeBlock.h:
977         (JSC::CodeBlock::isTemporaryRegisterIndex):
978         (JSC::CodeBlock::constantRegister):
979         (JSC::CodeBlock::isConstantRegisterIndex):
980         (JSC::CodeBlock::getConstant):
981         (JSC::ExecState::r):
982         * bytecode/Opcode.h:
983         * bytecompiler/BytecodeGenerator.cpp:
984         (JSC::BytecodeGenerator::preserveLastVar):
985         (JSC::BytecodeGenerator::BytecodeGenerator):
986         (JSC::BytecodeGenerator::addConstantValue):
987         (JSC::BytecodeGenerator::emitEqualityOp):
988         (JSC::BytecodeGenerator::emitLoad):
989         (JSC::BytecodeGenerator::emitResolveBase):
990         (JSC::BytecodeGenerator::emitResolveWithBase):
991         (JSC::BytecodeGenerator::emitNewError):
992         * bytecompiler/BytecodeGenerator.h:
993         (JSC::BytecodeGenerator::emitNode):
994         * interpreter/CallFrame.h:
995         (JSC::ExecState::noCaller):
996         (JSC::ExecState::hasHostCallFrameFlag):
997         (JSC::ExecState::addHostCallFrameFlag):
998         (JSC::ExecState::removeHostCallFrameFlag):
999         * interpreter/Interpreter.cpp:
1000         (JSC::Interpreter::resolve):
1001         (JSC::Interpreter::resolveSkip):
1002         (JSC::Interpreter::resolveGlobal):
1003         (JSC::Interpreter::resolveBase):
1004         (JSC::Interpreter::resolveBaseAndProperty):
1005         (JSC::Interpreter::resolveBaseAndFunc):
1006         (JSC::Interpreter::dumpRegisters):
1007         (JSC::Interpreter::throwException):
1008         (JSC::Interpreter::createExceptionScope):
1009         (JSC::Interpreter::privateExecute):
1010         (JSC::Interpreter::retrieveArguments):
1011         * jit/JIT.cpp:
1012         (JSC::JIT::privateCompileMainPass):
1013         * jit/JITInlineMethods.h:
1014         (JSC::JIT::emitLoadDouble):
1015         (JSC::JIT::emitLoadInt32ToDouble):
1016         * jit/JITOpcodes.cpp:
1017         (JSC::JIT::emit_op_new_error):
1018         (JSC::JIT::emit_op_enter):
1019         (JSC::JIT::emit_op_enter_with_activation):
1020         * parser/Nodes.cpp:
1021         (JSC::DeleteResolveNode::emitBytecode):
1022         (JSC::DeleteValueNode::emitBytecode):
1023         (JSC::PrefixResolveNode::emitBytecode):
1024         * runtime/JSActivation.cpp:
1025         (JSC::JSActivation::JSActivation):
1026         * wtf/Platform.h:
1027
1028 2009-07-07  Mark Rowe  <mrowe@apple.com>
1029
1030         Reviewed by Darin Adler.
1031
1032         Fix <https://bugs.webkit.org/show_bug.cgi?id=27025> / <rdar://problem/7033448>.
1033         Bug 27025: Crashes and regression test failures related to regexps in 64-bit
1034
1035         For x86_64 RegexGenerator uses rbx, a callee-save register, as a scratch register but
1036         neglects to save and restore it.  The change in handling of the output vector in r45545
1037         altered code generation so that the RegExp::match was now storing important data in rbx,
1038         which caused crashes and bogus results when it was clobbered.
1039
1040         * yarr/RegexJIT.cpp:
1041         (JSC::Yarr::RegexGenerator::generateEnter): Save rbx.
1042         (JSC::Yarr::RegexGenerator::generateReturn): Restore rbx.
1043
1044 2009-07-06  Ada Chan  <adachan@apple.com>
1045
1046         Reviewed by Darin Adler and Mark Rowe.
1047
1048         Decommitted spans are added to the list of normal spans rather than 
1049         the returned spans in TCMalloc_PageHeap::Delete().
1050         https://bugs.webkit.org/show_bug.cgi?id=26998
1051         
1052         In TCMalloc_PageHeap::Delete(), the deleted span can be decommitted in 
1053         the process of merging with neighboring spans that are also decommitted.  
1054         The merged span needs to be placed in the list of returned spans (spans 
1055         whose memory has been returned to the system).  Right now it's always added 
1056         to the list of the normal spans which can theoretically cause thrashing.  
1057
1058         * wtf/FastMalloc.cpp:
1059         (WTF::TCMalloc_PageHeap::Delete):
1060
1061 2009-07-05  Lars Knoll  <lars.knoll@nokia.com>
1062
1063         Reviewed by Maciej Stachowiak.
1064
1065         https://bugs.webkit.org/show_bug.cgi?id=26843
1066
1067         Fix run-time crashes in JavaScriptCore with the Metrowerks compiler on Symbian.
1068
1069         The Metrowerks compiler on the Symbian platform moves the globally
1070         defined Hashtables into read-only memory, despite one of the members
1071         being mutable. This causes crashes at run-time due to write access to
1072         read-only memory.
1073
1074         Avoid the use of const with this compiler by introducing the
1075         JSC_CONST_HASHTABLE macro.
1076
1077         Based on idea by Norbert Leser.
1078
1079         * runtime/Lookup.h: Define JSC_CONST_HASHTABLE as const for !WINSCW.
1080         * create_hash_table: Use JSC_CONST_HASHTABLE for hashtables.
1081         * runtime/JSGlobalData.cpp: Import various global hashtables via the macro.
1082
1083 2009-07-04  Dan Bernstein  <mitz@apple.com>
1084
1085         - debug build fix
1086
1087         * runtime/RegExpConstructor.cpp:
1088         (JSC::RegExpConstructor::getLastParen):
1089
1090 2009-07-03  Yong Li  <yong.li@torchmobile.com>
1091
1092         Reviewed by Maciej Stachowiak (and revised slightly)
1093
1094         RegExp::match to be optimized
1095         https://bugs.webkit.org/show_bug.cgi?id=26957
1096
1097         Allow regexp matching to use Vectors with inline capacity instead of
1098         allocating a new ovector buffer every time.
1099         
1100         ~5% speedup on SunSpider string-unpack-code test, 0.3% on SunSpider overall.
1101
1102         * runtime/RegExp.cpp:
1103         (JSC::RegExp::match):
1104         * runtime/RegExp.h:
1105         * runtime/RegExpConstructor.cpp:
1106         (JSC::RegExpConstructorPrivate::RegExpConstructorPrivate):
1107         (JSC::RegExpConstructorPrivate::lastOvector):
1108         (JSC::RegExpConstructorPrivate::tempOvector):
1109         (JSC::RegExpConstructorPrivate::changeLastOvector):
1110         (JSC::RegExpConstructor::performMatch):
1111         (JSC::RegExpMatchesArray::RegExpMatchesArray):
1112         (JSC::RegExpMatchesArray::fillArrayInstance):
1113         (JSC::RegExpConstructor::getBackref):
1114         (JSC::RegExpConstructor::getLastParen):
1115         (JSC::RegExpConstructor::getLeftContext):
1116         (JSC::RegExpConstructor::getRightContext):
1117         * runtime/StringPrototype.cpp:
1118         (JSC::stringProtoFuncSplit):
1119
1120 2009-06-30  Kwang Yul Seo  <skyul@company100.net>
1121
1122         Reviewed by Eric Seidel.
1123
1124         Override operator new/delete with const std::nothrow_t& as the second
1125         argument.
1126         https://bugs.webkit.org/show_bug.cgi?id=26792
1127
1128         On Windows CE, operator new/delete, new[]/delete[] with const
1129         std::nothrow_t& must be overrided because some standard template
1130         libraries use these operators.
1131
1132         The problem occurs when memory allocated by new(size_t s, const
1133         std::nothrow_t&) is freed by delete(void* p). This causes the umatched
1134         malloc/free problem.
1135
1136         The patch overrides all new, delete, new[] and delete[] to use
1137         fastMaloc and fastFree consistently.
1138
1139         * wtf/FastMalloc.h:
1140         (throw):
1141
1142 2009-06-30  Gabor Loki  <loki@inf.u-szeged.hu>
1143
1144         Reviewed by Sam Weinig.
1145
1146         <https://bugs.webkit.org/show_bug.cgi?id=24986>
1147
1148         Remove unnecessary references to AssemblerBuffer.
1149
1150         * interpreter/Interpreter.cpp:
1151         * interpreter/Interpreter.h:
1152
1153 2009-06-29  David Levin  <levin@chromium.org>
1154
1155         Reviewed by Oliver Hunt.
1156
1157         Still seeing occasional leaks from UString::sharedBuffer code
1158         https://bugs.webkit.org/show_bug.cgi?id=26420
1159
1160         The problem is that the pointer to the memory allocation isn't visible
1161         by "leaks" due to the lower bits being used as flags.  The fix is to
1162         make the pointer visible in memory (in debug only). The downside of
1163         this fix that the memory allocated by sharedBuffer will still look like
1164         a leak in non-debug builds when any flags are set.
1165
1166         * wtf/PtrAndFlags.h:
1167         (WTF::PtrAndFlags::set):
1168
1169 2009-06-29  Sam Weinig  <sam@webkit.org>
1170
1171         Reviewed by Mark Rowe.
1172
1173         Remove more unused scons support.
1174
1175         * SConstruct: Removed.
1176
1177 2009-06-29  Oliver Hunt  <oliver@apple.com>
1178
1179         Reviewed by Gavin Barraclough.
1180
1181         <rdar://problem/7016214> JSON.parse fails to parse valid JSON with most Unicode characters
1182         <https://bugs.webkit.org/show_bug.cgi?id=26802>
1183
1184         In the original JSON.parse patch unicode was handled correctly, however in some last
1185         minute "clean up" I oversimplified isSafeStringCharacter.  This patch corrects this bug.
1186
1187         * runtime/LiteralParser.cpp:
1188         (JSC::isSafeStringCharacter):
1189         (JSC::LiteralParser::Lexer::lexString):
1190
1191 2009-06-26  Oliver Hunt  <oliver@apple.com>
1192
1193         Reviewed by Dan Bernstein.
1194
1195         <rdar://problem/7009684> REGRESSION(r45039): Crashes inside JSEvent::put on PowerPC (26746)
1196         <https://bugs.webkit.org/show_bug.cgi?id=26746>
1197
1198         Fix for r45039 incorrectly uncached a get_by_id by converting it to put_by_id.  Clearly this
1199         is less than correct.  This patch corrects that error.
1200
1201         * interpreter/Interpreter.cpp:
1202         (JSC::Interpreter::tryCacheGetByID):
1203
1204 2009-06-26  Eric Seidel  <eric@webkit.org>
1205
1206         No review, only rolling out r45259.
1207
1208         Roll out r45259 after crash appeared on the bots:
1209         plugins/undefined-property-crash.html
1210         ASSERTION FAILED: s <= HeapConstants<heapType>::cellSize
1211         (leopard-intel-debug-tests/build/JavaScriptCore/runtime/Collector.cpp:278
1212         void* JSC::Heap::heapAllocate(size_t) [with JSC::HeapType heapType = PrimaryHeap])
1213
1214         * runtime/DateInstance.cpp:
1215         * runtime/Identifier.cpp:
1216         * runtime/Lookup.h:
1217         * runtime/RegExpConstructor.cpp:
1218         * runtime/RegExpObject.h:
1219         * runtime/ScopeChain.h:
1220         * runtime/UString.h:
1221
1222 2009-06-26  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
1223
1224         Reviewed by Simon Hausmann.
1225
1226         Add support for QDataStream operators to Vector.
1227
1228         * wtf/Vector.h:
1229         (WTF::operator<<):
1230         (WTF::operator>>):
1231
1232 2009-06-24  Sam Weinig  <sam@webkit.org>
1233
1234         Reviewed by Gavin Barraclough.
1235
1236         Make the opcode sampler work once again.
1237
1238         * jit/JIT.h:
1239         (JSC::JIT::compileGetByIdProto):
1240         (JSC::JIT::compileGetByIdSelfList):
1241         (JSC::JIT::compileGetByIdProtoList):
1242         (JSC::JIT::compileGetByIdChainList):
1243         (JSC::JIT::compileGetByIdChain):
1244         (JSC::JIT::compilePutByIdTransition):
1245         (JSC::JIT::compileCTIMachineTrampolines):
1246         (JSC::JIT::compilePatchGetArrayLength):
1247         * jit/JITStubCall.h:
1248         (JSC::JITStubCall::call):
1249
1250 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
1251
1252         Reviewed by Maciej Stachowiak.
1253
1254         Extend FastAllocBase.h with 'using WTF::FastAllocBase' to avoid
1255         unnecessary WTF:: usings.
1256         Remove existing unnecessary WTF:: usings.
1257
1258         * interpreter/Interpreter.h:
1259         * profiler/CallIdentifier.h:
1260         * runtime/ScopeChain.h:
1261         * wtf/FastAllocBase.h:
1262
1263 2009-06-24  David Levin  <levin@chromium.org>
1264
1265         Fix all builds.
1266
1267         * bytecode/CodeBlock.h:
1268         * bytecompiler/BytecodeGenerator.h:
1269         * interpreter/Register.h:
1270
1271 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
1272
1273         Reviewed by Maciej Stachowiak.
1274         
1275         https://bugs.webkit.org/show_bug.cgi?id=26677
1276
1277         Inherits CodeBlock class from FastAllocBase because it
1278         has been instantiated by 'new' in JavaScriptCore/bytecode/CodeBlock.h:217.
1279
1280         * bytecode/CodeBlock.h:
1281
1282 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
1283
1284         Reviewed by Maciej Stachowiak.
1285         
1286         https://bugs.webkit.org/show_bug.cgi?id=26676
1287
1288         Inherits BytecodeGenerator class from FastAllocBase because it has been
1289         instantiated by 'new' in JavaScriptCore/parser/Nodes.cpp:1892.
1290
1291         * bytecompiler/BytecodeGenerator.h:
1292
1293 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
1294
1295         Reviewed by Maciej Stachowiak.
1296         
1297         https://bugs.webkit.org/show_bug.cgi?id=26675
1298
1299         Inherits Register class from FastAllocBase because it has been
1300         instantiated by 'new' in JavaScriptCore/runtime/JSVariableObject.h:149.
1301
1302         * interpreter/Register.h:
1303
1304 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
1305
1306         Reviewed by Darin Adler.
1307         
1308         https://bugs.webkit.org/show_bug.cgi?id=26674
1309
1310         Inherits HashMap class from FastAllocBase because it has been
1311         instantiated by 'new' in JavaScriptCore/runtime/Structure.cpp:458.
1312
1313         * wtf/HashMap.h:
1314
1315 2009-06-24  Oliver Hunt  <oliver@apple.com>
1316
1317         Reviewed by Darin Adler.
1318
1319         <rdar://problem/6940519> REGRESSION (Safari 4 Public Beta - TOT): google.com/adplanner shows blank page instead of site details in "basic research'
1320
1321         The problem was caused by the page returned with a function using a
1322         var declaration list containing around ~3000 variables.  The solution
1323         to this is to flatten the comma expression representation and make
1324         codegen comma expressions and initializer lists iterative rather than
1325         recursive.
1326
1327         * parser/Grammar.y:
1328         * parser/NodeConstructors.h:
1329         (JSC::CommaNode::CommaNode):
1330         * parser/Nodes.cpp:
1331         (JSC::CommaNode::emitBytecode):
1332         * parser/Nodes.h:
1333         (JSC::ExpressionNode::isCommaNode):
1334         (JSC::CommaNode::isCommaNode):
1335         (JSC::CommaNode::append):
1336
1337 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
1338
1339         Reviewed by Maciej Stachowiak.
1340
1341         https://bugs.webkit.org/show_bug.cgi?id=26645
1342
1343         Inherits ScopeChainNode class from FastAllocBase because it has been
1344         instantiated by 'new' in JavaScriptCore/runtime/ScopeChain.h:95.
1345
1346         * wtf/RefPtr.h:
1347
1348 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
1349
1350         Reviewed by Darin Adler.
1351
1352         https://bugs.webkit.org/show_bug.cgi?id=26648
1353
1354         Inherits Deque class from FastAllocBase because it has been
1355         instantiated by 'new' with DEFINE_STATIC_LOCAL macro in 
1356         JavaScriptCore/wtf/MainThread.cpp:62.
1357
1358         * wtf/Deque.h:
1359
1360 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
1361
1362         Reviewed by Darin Adler.
1363
1364         https://bugs.webkit.org/show_bug.cgi?id=26644
1365
1366         Inherits RefPtr class from FastAllocBase because it has been
1367         instantiated by 'new' in JavaScriptCore/runtime/StructureChain.cpp:41.
1368
1369         * wtf/RefPtr.h:
1370
1371 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
1372
1373         Reviewed by Darin Adler.
1374
1375         Inherits HashSet class from FastAllocBase, because it has been
1376         instantiated by 'new' in JavaScriptCore/runtime/Collector.h:116.
1377
1378         * wtf/HashSet.h:
1379
1380 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
1381
1382         Reviewed by Darin Adler.
1383
1384         Inherits Vector class from FastAllocBase because it has been
1385         instantiated by 'new' in JavaScriptCore/runtime/Structure.cpp:633.
1386
1387         * wtf/Vector.h:
1388
1389 2009-06-24  Norbert Leser  <norbert.leser@nokia.com>
1390
1391         Reviewed by Maciej Stachoviak.
1392
1393         The BytecodeGenerator objects were instantiated on stack, which takes up ~38kB per instance
1394         (each instance includes copy of JSC::CodeBlock with large SymbolTable, etc.).
1395         Specifically, since there is nested invocation (e.g., GlobalCode --> FunctionCode),
1396         the stack overflows immediately on Symbian hardware (max. 80 kB).
1397         Proposed change allocates generator objects on heap.
1398         Performance impact (if any) should be negligible and change is proposed as general fix,
1399         rather than ifdef'd for SYMBIAN.
1400
1401         * parser/Nodes.cpp:
1402         (JSC::ProgramNode::generateBytecode):
1403         (JSC::EvalNode::generateBytecode):
1404         (JSC::EvalNode::bytecodeForExceptionInfoReparse):
1405         (JSC::FunctionBodyNode::generateBytecode):
1406         (JSC::FunctionBodyNode::bytecodeForExceptionInfoReparse):
1407
1408 2009-06-23  Oliver Hunt  <oliver@apple.com>
1409
1410         Reviewed by Gavin Barraclough.
1411
1412         <rdar://problem/6992806> REGRESSION: Enumeration can skip new properties in cases of prototypes that have more than 64 (26593)
1413         <https://bugs.webkit.org/show_bug.cgi?id=26593>
1414
1415         Do not attempt to cache structure chains if they contain a dictionary at any level.
1416
1417         * interpreter/Interpreter.cpp:
1418         (JSC::Interpreter::tryCachePutByID):
1419         (JSC::Interpreter::tryCacheGetByID):
1420         * jit/JITStubs.cpp:
1421         (JSC::JITThunks::tryCachePutByID):
1422         * runtime/Structure.cpp:
1423         (JSC::Structure::getEnumerablePropertyNames):
1424         (JSC::Structure::addPropertyTransition):
1425         * runtime/StructureChain.cpp:
1426         (JSC::StructureChain::isCacheable):
1427         * runtime/StructureChain.h:
1428
1429 2009-06-23  Yong Li  <yong.li@torchmobile.com>
1430
1431         Reviewed by George Staikos.
1432
1433         https://bugs.webkit.org/show_bug.cgi?id=26654
1434         Add the proper export define for the JavaScriptCore API when building for WINCE.
1435
1436         * API/JSBase.h:
1437
1438 2009-06-23  Joe Mason  <joe.mason@torchmobile.com>
1439
1440         Reviewed by Adam Treat.
1441
1442         Authors: Yong Li <yong.li@torchmobile.com>, Joe Mason <joe.mason@torchmobile.com>
1443
1444         https://bugs.webkit.org/show_bug.cgi?id=26611
1445         Implement currentThreadStackBase on WINCE by adding a global,
1446         g_stackBase, which must be set to the address of a local variable
1447         by the caller before calling any WebKit function that invokes JSC.
1448
1449         * runtime/Collector.cpp:
1450         (JSC::isPageWritable):
1451         (JSC::getStackBase):
1452           Starts at the top of the stack and returns the entire range of
1453           consecutive writable pages as an estimate of the actual stack.
1454           This will be much bigger than the actual stack range, so some
1455           dead objects can't be collected, but it guarantees live objects
1456           aren't collected prematurely.
1457
1458         (JSC::currentThreadStackBase):
1459           On WinCE, returns g_stackBase if set or call getStackBase as a
1460           fallback if not.
1461
1462 2009-06-23  Oliver Hunt  <oliver@apple.com>
1463
1464         Reviewed by Alexey Proskuryakov.
1465
1466         Fix stupid performance problem in the LiteralParser
1467
1468         The LiteralParser was making a new UString in order to use
1469         toDouble, however UString's toDouble allows a much wider range
1470         of numberic strings than the LiteralParser accepts, and requires
1471         an additional heap allocation or two for the construciton of the
1472         UString.  To rectify this we just call WTF::dtoa directly using
1473         a stack allocated buffer to hold the validated numeric literal.
1474
1475         * runtime/LiteralParser.cpp:
1476         (JSC::LiteralParser::Lexer::lexNumber):
1477         (JSC::LiteralParser::parse):
1478         * runtime/LiteralParser.h:
1479
1480 2009-06-22  Oliver Hunt  <oliver@apple.com>
1481
1482         Reviewed by Alexey Proskuryakov.
1483
1484         Bug 26640: JSON.stringify needs to special case Boolean objects
1485         <https://bugs.webkit.org/show_bug.cgi?id=26640>
1486
1487         Add special case handling of the Boolean object so we match current
1488         ES5 errata.
1489
1490         * runtime/JSONObject.cpp:
1491         (JSC::unwrapBoxedPrimitive): renamed from unwrapNumberOrString
1492         (JSC::gap):
1493         (JSC::Stringifier::appendStringifiedValue):
1494
1495 2009-06-22  Oliver Hunt  <oliver@apple.com>
1496
1497         Reviewed by Darin Adler.
1498
1499         Bug 26591: Support revivers in JSON.parse
1500         <https://bugs.webkit.org/show_bug.cgi?id=26591>
1501
1502         Add reviver support to JSON.parse.  This completes the JSON object.
1503
1504         * runtime/JSONObject.cpp:
1505         (JSC::Walker::Walker):
1506         (JSC::Walker::callReviver):
1507         (JSC::Walker::walk):
1508         (JSC::JSONProtoFuncParse):
1509
1510 2009-06-21  Oliver Hunt  <oliver@apple.com>
1511
1512         Reviewed by Darin Adler.
1513
1514         Bug 26592: Support standard toJSON functions
1515         <https://bugs.webkit.org/show_bug.cgi?id=26592>
1516
1517         Add support for the standard Date.toJSON function.
1518
1519         * runtime/DatePrototype.cpp:
1520         (JSC::dateProtoFuncToJSON):
1521
1522 2009-06-21  Oliver Hunt  <oliver@apple.com>
1523
1524         Reviewed by Sam Weinig.
1525
1526         Bug 26594: JSC needs to support Date.toISOString
1527         <https://bugs.webkit.org/show_bug.cgi?id=26594>
1528
1529         Add support for Date.toISOString.
1530
1531         * runtime/DatePrototype.cpp:
1532         (JSC::dateProtoFuncToISOString):
1533
1534 2009-06-21  Oliver Hunt  <oliver@apple.com>
1535
1536         Reviewed by NOBODY (Build fix).
1537
1538         Remove dead code.
1539
1540         * runtime/LiteralParser.cpp:
1541         (JSC::LiteralParser::parse):
1542
1543 2009-06-21  Oliver Hunt  <oliver@apple.com>
1544
1545         Reviewed by Darin Adler and Cameron Zwarich.
1546
1547         Bug 26587: Support JSON.parse
1548         <https://bugs.webkit.org/show_bug.cgi?id=26587>
1549
1550         Extend the LiteralParser to support the full strict JSON
1551         grammar, fix a few places where the grammar was incorrectly
1552         lenient.   Doesn't yet support the JSON.parse reviver function
1553         but that does not block the JSON.parse functionality itself.
1554
1555         * interpreter/Interpreter.cpp:
1556         (JSC::Interpreter::callEval):
1557         * runtime/JSGlobalObjectFunctions.cpp:
1558         (JSC::globalFuncEval):
1559         * runtime/JSONObject.cpp:
1560         (JSC::JSONProtoFuncParse):
1561         * runtime/LiteralParser.cpp:
1562         (JSC::LiteralParser::Lexer::lex):
1563         (JSC::isSafeStringCharacter):
1564         (JSC::LiteralParser::Lexer::lexString):
1565         (JSC::LiteralParser::parse):
1566         * runtime/LiteralParser.h:
1567         (JSC::LiteralParser::LiteralParser):
1568         (JSC::LiteralParser::tryJSONParse):
1569         (JSC::LiteralParser::):
1570         (JSC::LiteralParser::Lexer::Lexer):
1571
1572 2009-06-21  David Levin  <levin@chromium.org>
1573
1574         Reviewed by NOBODY (speculative build fix for windows).
1575
1576         Simply removed some whitespace form this file to make windows build wtf and
1577         hopefully copy the new MessageQueque.h so that WebCore picks it up.
1578
1579         * wtf/Assertions.cpp:
1580
1581 2009-06-21  Drew Wilson  <atwilson@google.com>
1582
1583         Reviewed by David Levin.
1584
1585         <https://bugs.webkit.org/show_bug.cgi?id=25043>
1586         Added support for multi-threaded MessagePorts.
1587
1588         * wtf/MessageQueue.h:
1589         (WTF::::appendAndCheckEmpty):
1590             Added API to test whether the queue was empty before adding an element.
1591   
1592 2009-06-20  David D. Kilzer  <ddkilzer@webkit.org>
1593
1594         Fix namespace comment in SegmentedVector.h
1595
1596         * wtf/SegmentedVector.h: Updated namespace comment to reflect
1597         new namespace after r44897.
1598
1599 2009-06-20  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
1600
1601         Bug 24986: ARM JIT port
1602         <https://bugs.webkit.org/show_bug.cgi?id=24986>
1603
1604         Reviewed by Oliver Hunt.
1605
1606         An Iterator added for SegmentedVector. Currently
1607         only the pre ++ operator is supported.
1608
1609         * wtf/SegmentedVector.h:
1610         (WTF::SegmentedVectorIterator::~SegmentedVectorIterator):
1611         (WTF::SegmentedVectorIterator::operator*):
1612         (WTF::SegmentedVectorIterator::operator->):
1613         (WTF::SegmentedVectorIterator::operator++):
1614         (WTF::SegmentedVectorIterator::operator==):
1615         (WTF::SegmentedVectorIterator::operator!=):
1616         (WTF::SegmentedVectorIterator::operator=):
1617         (WTF::SegmentedVectorIterator::SegmentedVectorIterator):
1618         (WTF::SegmentedVector::alloc):
1619         (WTF::SegmentedVector::begin):
1620         (WTF::SegmentedVector::end):
1621
1622 2009-06-20  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
1623
1624         Bug 24986: ARM JIT port
1625         <https://bugs.webkit.org/show_bug.cgi?id=24986>
1626
1627         Reviewed by Oliver Hunt.
1628
1629         Move SegmentedVector to /wtf subdirectory
1630         and change "namespace JSC" to "namespace WTF"
1631
1632         Additional build file updates by David Kilzer.
1633
1634         * GNUmakefile.am: Updated path to SegmentedVector.h.
1635         * JavaScriptCore.order: Updated SegmentedVector namespace from
1636         JSC to WTF in mangled C++ method name.
1637         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1638         Removed reference to bytecompiler\SegmentedVector.h.
1639         * JavaScriptCore.vcproj/WTF/WTF.vcproj: Added reference to
1640         wtf\SegmentedVector.h.
1641         * JavaScriptCore.xcodeproj/project.pbxproj: Moved
1642         SegmentedVector.h definition from bytecompiler subdirectory to
1643         wtf subdirectory.
1644         * bytecompiler/BytecodeGenerator.h: Updated #include path to
1645         SegmentedVector.h and prepended WTF:: namespace to its use.
1646         * parser/Lexer.h: Ditto.
1647         * wtf/SegmentedVector.h: Renamed from JavaScriptCore/bytecompiler/SegmentedVector.h.
1648         (WTF::SegmentedVector::SegmentedVector):
1649         (WTF::SegmentedVector::~SegmentedVector):
1650         (WTF::SegmentedVector::size):
1651         (WTF::SegmentedVector::at):
1652         (WTF::SegmentedVector::operator[]):
1653         (WTF::SegmentedVector::last):
1654         (WTF::SegmentedVector::append):
1655         (WTF::SegmentedVector::removeLast):
1656         (WTF::SegmentedVector::grow):
1657         (WTF::SegmentedVector::clear):
1658         (WTF::SegmentedVector::deleteAllSegments):
1659         (WTF::SegmentedVector::segmentExistsFor):
1660         (WTF::SegmentedVector::segmentFor):
1661         (WTF::SegmentedVector::subscriptFor):
1662         (WTF::SegmentedVector::ensureSegmentsFor):
1663         (WTF::SegmentedVector::ensureSegment):
1664
1665 2009-06-19  Gavin Barraclough  <barraclough@apple.com>
1666
1667         Reviewed by NOBODY (build fix take 2 - rename FIELD_OFFSET to something that doesn't conflict with winnt.h).
1668
1669         * jit/JIT.cpp:
1670         (JSC::JIT::privateCompile):
1671         (JSC::JIT::privateCompileCTIMachineTrampolines):
1672         (JSC::JIT::emitGetVariableObjectRegister):
1673         (JSC::JIT::emitPutVariableObjectRegister):
1674         * jit/JIT.h:
1675         * jit/JITArithmetic.cpp:
1676         (JSC::JIT::emit_op_rshift):
1677         (JSC::JIT::emitSlow_op_jnless):
1678         (JSC::JIT::emitSlow_op_jnlesseq):
1679         (JSC::JIT::compileBinaryArithOp):
1680         * jit/JITCall.cpp:
1681         (JSC::JIT::compileOpCallInitializeCallFrame):
1682         (JSC::JIT::compileOpCall):
1683         * jit/JITInlineMethods.h:
1684         (JSC::JIT::restoreArgumentReference):
1685         (JSC::JIT::checkStructure):
1686         * jit/JITOpcodes.cpp:
1687         (JSC::JIT::emit_op_instanceof):
1688         (JSC::JIT::emit_op_get_scoped_var):
1689         (JSC::JIT::emit_op_put_scoped_var):
1690         (JSC::JIT::emit_op_construct_verify):
1691         (JSC::JIT::emit_op_resolve_global):
1692         (JSC::JIT::emit_op_jeq_null):
1693         (JSC::JIT::emit_op_jneq_null):
1694         (JSC::JIT::emit_op_to_jsnumber):
1695         (JSC::JIT::emit_op_catch):
1696         (JSC::JIT::emit_op_eq_null):
1697         (JSC::JIT::emit_op_neq_null):
1698         (JSC::JIT::emit_op_convert_this):
1699         (JSC::JIT::emit_op_profile_will_call):
1700         (JSC::JIT::emit_op_profile_did_call):
1701         (JSC::JIT::emitSlow_op_get_by_val):
1702         * jit/JITPropertyAccess.cpp:
1703         (JSC::JIT::emit_op_get_by_val):
1704         (JSC::JIT::emit_op_put_by_val):
1705         (JSC::JIT::emit_op_method_check):
1706         (JSC::JIT::compileGetByIdHotPath):
1707         (JSC::JIT::emit_op_put_by_id):
1708         (JSC::JIT::compilePutDirectOffset):
1709         (JSC::JIT::compileGetDirectOffset):
1710         (JSC::JIT::privateCompilePutByIdTransition):
1711         (JSC::JIT::privateCompilePatchGetArrayLength):
1712         * jit/JITStubs.cpp:
1713         (JSC::JITThunks::JITThunks):
1714
1715 2009-06-19  Gavin Barraclough  <barraclough@apple.com>
1716
1717         Reviewed by NOBODY (Windows build fix).
1718
1719         * jit/JIT.h:
1720         * jit/JITInlineMethods.h:
1721
1722 2009-06-19  Gabor Loki  <loki@inf.u-szeged.hu>
1723
1724         Reviewed by Gavin Barraclough.
1725
1726         Reorganize ARM architecture specific macros.
1727         Use PLATFORM_ARM_ARCH(7) instead of PLATFORM(ARM_V7).
1728
1729         Bug 24986: ARM JIT port
1730         <https://bugs.webkit.org/show_bug.cgi?id=24986>
1731
1732         * assembler/ARMv7Assembler.h:
1733         * assembler/AbstractMacroAssembler.h:
1734         (JSC::AbstractMacroAssembler::Imm32::Imm32):
1735         * assembler/MacroAssembler.h:
1736         * assembler/MacroAssemblerCodeRef.h:
1737         (JSC::MacroAssemblerCodePtr::MacroAssemblerCodePtr):
1738         * jit/ExecutableAllocator.h:
1739         (JSC::ExecutableAllocator::cacheFlush):
1740         * jit/JIT.h:
1741         * jit/JITInlineMethods.h:
1742         (JSC::JIT::restoreArgumentReferenceForTrampoline):
1743         * jit/JITStubs.cpp:
1744         * jit/JITStubs.h:
1745         * wtf/Platform.h:
1746         * yarr/RegexJIT.cpp:
1747         (JSC::Yarr::RegexGenerator::generateEnter):
1748         (JSC::Yarr::RegexGenerator::generateReturn):
1749
1750 2009-06-19  Gavin Barraclough  <barraclough@apple.com>
1751
1752         Reviewed by Oliver Hunt.
1753
1754         Fix armv7 JIT build issues.
1755
1756         Unfortunate the arm compiler does not like the use of offsetof on JITStackFrame (since it now contains non POD types),
1757         and the FIELD_OFFSET macro does not appear constantish enough for it to be happy with its use in COMPILE_ASSERT macros.
1758
1759         * Replace offsetofs with FIELD_OFFSETs (safe on C++ objects).
1760         * Move COMPILE_ASSERTs defending layout of JITStackFrame structure on armv7 into JITThunks constructor.
1761
1762         * jit/JIT.cpp:
1763         * jit/JIT.h:
1764         * jit/JITInlineMethods.h:
1765         (JSC::JIT::restoreArgumentReference):
1766         * jit/JITOpcodes.cpp:
1767         (JSC::JIT::emit_op_catch):
1768         * jit/JITStubs.cpp:
1769         (JSC::JITThunks::JITThunks):
1770
1771 2009-06-19  Adam Treat  <adam.treat@torchmobile.com>
1772
1773         Blind attempt at build fix.
1774
1775         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1776         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
1777
1778 2009-06-19  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
1779
1780         Reviewed by Oliver Hunt.
1781
1782         Inherits CallIdentifier struct from FastAllocBase because it has been
1783         instantiated by 'new' in JavaScriptCore/profiler/CallIdentifier.h:86.
1784
1785         * wtf/HashCountedSet.h:
1786
1787 2009-06-19  Adam Treat  <adam.treat@torchmobile.com>
1788
1789         Reviewed by Oliver Hunt.
1790
1791         https://bugs.webkit.org/show_bug.cgi?id=26540
1792         Modify the test shell to add a new function 'checkSyntax' that will
1793         only parse the source instead of executing it. In this way we can test
1794         pure parsing performance against some of the larger scripts in the wild.
1795
1796         * jsc.cpp:
1797         (GlobalObject::GlobalObject):
1798         (functionCheckSyntax):
1799
1800 2009-06-19  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
1801
1802         Reviewed by Darin Adler.
1803         
1804         Inherits HashCountedSet class from FastAllocBase because it has been
1805         instantiated by 'new' in JavaScriptCore/runtime/Collector.cpp:1095.
1806
1807         * wtf/HashCountedSet.h:
1808
1809 2009-06-19  Yong Li  <yong.li@torchmobile.com>
1810
1811         Reviewed by George Staikos.
1812
1813         https://bugs.webkit.org/show_bug.cgi?id=26558
1814         Declare these symbols extern for WINCE as they are provided by libce.
1815
1816         * runtime/DateConstructor.cpp:
1817         * runtime/DatePrototype.cpp:
1818         (JSC::formatLocaleDate):
1819
1820 2009-06-19  Oliver Hunt  <oliver@apple.com>
1821
1822         Reviewed by Maciej Stachowiak.
1823
1824         <rdar://problem/6988973> ScopeChain leak in interpreter builds
1825
1826         Move the Scopechain destruction code in JSFunction outside of the ENABLE(JIT)
1827         path.
1828
1829         * runtime/JSFunction.cpp:
1830         (JSC::JSFunction::~JSFunction):
1831         * wtf/Platform.h:
1832
1833 2009-06-19  Yong Li  <yong.li@torchmobile.com>
1834
1835         Reviewed by George Staikos.
1836
1837         https://bugs.webkit.org/show_bug.cgi?id=26543
1838         Windows CE uses 'GetLastError' instead of 'errno.'
1839
1840         * interpreter/RegisterFile.h:
1841         (JSC::RegisterFile::RegisterFile):
1842         (JSC::RegisterFile::grow):
1843
1844 2009-06-19  David Levin  <levin@chromium.org>
1845
1846         Reviewed by NOBODY (Windows build fix).
1847
1848         Add export for Windows corresponding to OSX export done in r44844.
1849         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1850         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
1851
1852 2009-06-18  Oliver Hunt  <oliver@apple.com>
1853
1854         Reviewed by Gavin "Viceroy of Venezuela" Barraclough.
1855
1856         Bug 26532: Native functions do not correctly unlink from optimised callsites when they're collected
1857         <https://bugs.webkit.org/show_bug.cgi?id=26532> <rdar://problem/6625385>
1858
1859         We need to make sure that each native function instance correctly unlinks any references to it
1860         when it is collected.  Allowing this to happen required a few changes:
1861             * Every native function needs a codeblock to track the link information
1862             * To have this codeblock, every function now also needs its own functionbodynode
1863               so we no longer get to have a single shared instance.
1864             * Identifying a host function is now done by looking for CodeBlock::codeType() == NativeCode
1865
1866         * JavaScriptCore.exp:
1867         * bytecode/CodeBlock.cpp:
1868         (JSC::CodeBlock::CodeBlock):
1869            Constructor for NativeCode CodeBlock
1870         (JSC::CodeBlock::derefStructures):
1871         (JSC::CodeBlock::refStructures):
1872         (JSC::CodeBlock::reparseForExceptionInfoIfNecessary):
1873         (JSC::CodeBlock::handlerForBytecodeOffset):
1874         (JSC::CodeBlock::lineNumberForBytecodeOffset):
1875         (JSC::CodeBlock::expressionRangeForBytecodeOffset):
1876         (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset):
1877         (JSC::CodeBlock::functionRegisterForBytecodeOffset):
1878         (JSC::CodeBlock::hasGlobalResolveInstructionAtBytecodeOffset):
1879         (JSC::CodeBlock::hasGlobalResolveInfoAtBytecodeOffset):
1880         (JSC::CodeBlock::setJITCode):
1881            Add assertions to ensure we don't try and use NativeCode CodeBlocks as
1882            a normal codeblock.
1883
1884         * bytecode/CodeBlock.h:
1885         (JSC::):
1886         (JSC::CodeBlock::source):
1887         (JSC::CodeBlock::sourceOffset):
1888         (JSC::CodeBlock::evalCodeCache):
1889         (JSC::CodeBlock::createRareDataIfNecessary):
1890           More assertions.
1891
1892         * jit/JIT.cpp:
1893         (JSC::JIT::privateCompileCTIMachineTrampolines):
1894         (JSC::JIT::linkCall):
1895           Update logic to allow native function caching
1896
1897         * jit/JITStubs.cpp:
1898         * parser/Nodes.cpp:
1899         (JSC::FunctionBodyNode::createNativeThunk):
1900         (JSC::FunctionBodyNode::isHostFunction):
1901         * parser/Nodes.h:
1902         * runtime/JSFunction.cpp:
1903         (JSC::JSFunction::JSFunction):
1904         (JSC::JSFunction::~JSFunction):
1905         (JSC::JSFunction::mark):
1906         * runtime/JSGlobalData.cpp:
1907         (JSC::JSGlobalData::~JSGlobalData):
1908         * runtime/JSGlobalData.h:
1909
1910 2009-06-18  Gavin Barraclough  <barraclough@apple.com>
1911
1912         Reviewed by NOBODY (Windows build fix).
1913
1914         * wtf/DateMath.cpp:
1915         (WTF::calculateUTCOffset):
1916
1917 2009-06-18  Gavin Barraclough  <barraclough@apple.com>
1918
1919         Reviewed by Geoff Garen.
1920
1921         Timezone calculation incorrect in Venezuela.
1922
1923         https://bugs.webkit.org/show_bug.cgi?id=26531
1924         <rdar://problem/6646169> Time is incorrectly reported to JavaScript in both Safari 3 and Firefox 3
1925
1926         The problem is that we're calculating the timezone relative to 01/01/2000,
1927         but the VET timezone changed from -4 hours to -4:30 hours on 12/09/2007.
1928         According to the spec, section 15.9.1.9 states "the time since the beginning
1929         of the year", presumably meaning the *current* year.  Change the calculation
1930         to be based on whatever the current year is, rather than a canned date.
1931
1932         No performance impact.
1933
1934         * wtf/DateMath.cpp:
1935         (WTF::calculateUTCOffset):
1936
1937 2009-06-18  Gavin Barraclough  <barraclough@apple.com>
1938
1939         Rubber Stamped by Mark Rowe (originally reviewed by Sam Weinig).
1940
1941         (Reintroducing patch added in r44492, and reverted in r44796.)
1942
1943         Change the implementation of op_throw so the stub function always modifies its
1944         return address - if it doesn't find a 'catch' it will switch to a trampoline
1945         to force a return from JIT execution.  This saves memory, by avoiding the need
1946         for a unique return for every op_throw.
1947
1948         * jit/JITOpcodes.cpp:
1949         (JSC::JIT::emit_op_throw):
1950             JITStubs::cti_op_throw now always changes its return address,
1951             remove return code generated after the stub call (this is now
1952             handled by ctiOpThrowNotCaught).
1953         * jit/JITStubs.cpp:
1954         (JSC::):
1955             Add ctiOpThrowNotCaught definitions.
1956         (JSC::JITStubs::DEFINE_STUB_FUNCTION):
1957             Change cti_op_throw to always change its return address.
1958         * jit/JITStubs.h:
1959             Add ctiOpThrowNotCaught declaration.
1960
1961 2009-06-18  Kevin McCullough  <kmccullough@apple.com>
1962
1963         Reviewed by Oliver Hunt.
1964
1965         <rdar://problem/6940880> REGRESSION: Breakpoints don't break in 64-bit
1966
1967         - Exposed functions now needed by WebCore.
1968
1969         * JavaScriptCore.exp:
1970
1971 2009-06-17  Darin Adler  <darin@apple.com>
1972
1973         Reviewed by Oliver Hunt.
1974
1975         Bug 26429: Make JSON.stringify non-recursive so it can handle objects
1976         of arbitrary complexity
1977         https://bugs.webkit.org/show_bug.cgi?id=26429
1978
1979         For marking I decided not to use gcProtect, because this is inside the engine
1980         so it's easy enough to just do marking. And that darned gcProtect does locking!
1981         Oliver tried to convince me to used MarkedArgumentBuffer, but the constructor
1982         for that class says "FIXME: Remove all clients of this API, then remove this API."
1983
1984         * runtime/Collector.cpp:
1985         (JSC::Heap::collect): Add a call to JSONObject::markStringifiers.
1986
1987         * runtime/CommonIdentifiers.cpp:
1988         (JSC::CommonIdentifiers::CommonIdentifiers): Added emptyIdentifier.
1989         * runtime/CommonIdentifiers.h: Ditto.
1990
1991         * runtime/JSGlobalData.cpp:
1992         (JSC::JSGlobalData::JSGlobalData): Initialize firstStringifierToMark to 0.
1993         * runtime/JSGlobalData.h: Added firstStringifierToMark.
1994
1995         * runtime/JSONObject.cpp: Cut down the includes to the needed ones only.
1996         (JSC::unwrapNumberOrString): Added. Helper for unwrapping number and string
1997         objects to get their number and string values.
1998         (JSC::ReplacerPropertyName::ReplacerPropertyName): Added. The class is used
1999         to wrap an identifier or integer so we don't have to do any work unless we
2000         actually call a replacer.
2001         (JSC::ReplacerPropertyName::value): Added.
2002         (JSC::gap): Added. Helper function for the Stringifier constructor.
2003         (JSC::PropertyNameForFunctionCall::PropertyNameForFunctionCall): Added.
2004         The class is used to wrap an identifier or integer so we don't have to
2005         allocate a number or string until we actually call toJSON or a replacer.
2006         (JSC::PropertyNameForFunctionCall::asJSValue): Added.
2007         (JSC::Stringifier::Stringifier): Updated and moved out of the class
2008         definition. Added code to hook this into a singly linked list for marking.
2009         (JSC::Stringifier::~Stringifier): Remove from the singly linked list.
2010         (JSC::Stringifier::mark): Mark all the objects in the holder stacks.
2011         (JSC::Stringifier::stringify): Updated.
2012         (JSC::Stringifier::appendQuotedString): Tweaked and streamlined a bit.
2013         (JSC::Stringifier::toJSON): Renamed from toJSONValue.
2014         (JSC::Stringifier::appendStringifiedValue): Renamed from stringify.
2015         Added code to use the m_holderStack to do non-recursive stringify of
2016         objects and arrays. This code also uses the timeout checker since in
2017         pathological cases it could be slow even without calling into the
2018         JavaScript virtual machine.
2019         (JSC::Stringifier::willIndent): Added.
2020         (JSC::Stringifier::indent): Added.
2021         (JSC::Stringifier::unindent): Added.
2022         (JSC::Stringifier::startNewLine): Added.
2023         (JSC::Stringifier::Holder::Holder): Added.
2024         (JSC::Stringifier::Holder::appendNextProperty): Added. This is the
2025         function that handles the format of arrays and objects.
2026         (JSC::JSONObject::getOwnPropertySlot): Moved this down to the bottom
2027         of the file so the JSONObject class is not interleaved with the
2028         Stringifier class.
2029         (JSC::JSONObject::markStringifiers): Added. Calls mark.
2030         (JSC::JSONProtoFuncStringify): Streamlined the code here. The code
2031         to compute the gap string is now a separate function.
2032
2033         * runtime/JSONObject.h: Made everything private. Added markStringifiers.
2034
2035 2009-06-17  Oliver Hunt  <oliver@apple.com>
2036
2037         Reviewed by Gavin Barraclough.
2038
2039         <rdar://problem/6974140> REGRESSION(r43849): Crash in cti_op_call_NotJSFunction when getting directions on maps.google.com
2040
2041         Roll out r43849 as it appears that we cannot rely on the address of
2042         an objects property storage being constant even if the structure is
2043         unchanged.
2044
2045         * jit/JIT.h:
2046         * jit/JITPropertyAccess.cpp:
2047         (JSC::JIT::compileGetDirectOffset):
2048         (JSC::JIT::privateCompileGetByIdProto):
2049         (JSC::JIT::privateCompileGetByIdProtoList):
2050         (JSC::JIT::privateCompileGetByIdChainList):
2051         (JSC::JIT::privateCompileGetByIdChain):
2052
2053 2009-06-17  Gavin Barraclough  <barraclough@apple.com>
2054
2055         Rubber Stamped by Mark Rowe.
2056
2057         Fully revert r44492 & r44748 while we fix a bug they cause on internal builds <rdar://problem/6955963>.
2058
2059         * jit/JITOpcodes.cpp:
2060         (JSC::JIT::emit_op_throw):
2061         * jit/JITStubs.cpp:
2062         (JSC::):
2063         (JSC::JITStubs::DEFINE_STUB_FUNCTION):
2064         * jit/JITStubs.h:
2065
2066 2009-06-17  Gavin Barraclough  <barraclough@apple.com>
2067
2068         Reviewed by Mark Rowe.
2069
2070         <rdar://problem/6947426> sunspider math-cordic.js exhibits different intermediate results running 32-bit vs. 64-bit
2071
2072         On 64-bit, NaN-encoded values must be detagged before they can be used in rshift.
2073
2074         No performance impact.
2075
2076         * jit/JITArithmetic.cpp:
2077         (JSC::JIT::emit_op_rshift):
2078
2079 2009-06-17  Adam Treat  <adam.treat@torchmobile.com>
2080
2081         Reviewed by George Staikos.
2082
2083         https://bugs.webkit.org/show_bug.cgi?id=23155
2084         Move WIN_CE -> WINCE as previously discussed with Qt WINCE folks.
2085
2086         * jsc.cpp:
2087         (main):
2088
2089 2009-06-17  George Staikos  <george.staikos@torchmobile.com>
2090
2091         Reviewed by Adam Treat.
2092
2093         https://bugs.webkit.org/show_bug.cgi?id=23155
2094         Move WIN_CE -> WINCE as previously discussed with Qt WINCE folks.
2095
2096         * config.h:
2097         * jsc.cpp:
2098         * wtf/Assertions.cpp:
2099         * wtf/Assertions.h:
2100         * wtf/CurrentTime.cpp:
2101         (WTF::lowResUTCTime):
2102         * wtf/DateMath.cpp:
2103         (WTF::getLocalTime):
2104         * wtf/MathExtras.h:
2105         * wtf/Platform.h:
2106         * wtf/StringExtras.h:
2107         * wtf/Threading.h:
2108         * wtf/win/MainThreadWin.cpp:
2109
2110 2009-06-17  Gavin Barraclough  <barraclough@apple.com>
2111
2112         Reviewed by Oliver Hunt.
2113
2114         <rdar://problem/6974175> ASSERT in JITStubs.cpp at appsaccess.apple.com
2115
2116         Remove PropertySlot::putValue - PropertySlots should only be used for getting,
2117         not putting.  Rename JSGlobalObject::getOwnPropertySlot to hasOwnPropertyForWrite,
2118         which is what it really was being used to ask, and remove some other getOwnPropertySlot
2119         & getOwnPropertySlotForWrite methods, which were unused and likely to lead to confusion.
2120
2121         * runtime/JSGlobalObject.h:
2122         (JSC::JSGlobalObject::hasOwnPropertyForWrite):
2123         * runtime/JSObject.h:
2124         * runtime/JSStaticScopeObject.cpp:
2125         * runtime/JSStaticScopeObject.h:
2126         * runtime/PropertySlot.h:
2127
2128 2009-06-16  Gavin Barraclough  <barraclough@apple.com>
2129
2130         Reviewed by Oliver hunt.
2131
2132         Temporarily partially disable r44492, since this is causing some problems on internal builds.
2133
2134         * jit/JITOpcodes.cpp:
2135         (JSC::JIT::emit_op_throw):
2136         * jit/JITStubs.cpp:
2137         (JSC::JITStubs::DEFINE_STUB_FUNCTION):
2138
2139 2009-06-16  Sam Weinig  <sam@webkit.org>
2140
2141         Fix windows build.
2142
2143         * jit/JIT.cpp:
2144         (JSC::JIT::JIT):
2145
2146 2009-06-16  Sam Weinig  <sam@webkit.org>
2147
2148         Reviewed by Oliver Hunt.
2149
2150         Initialize m_bytecodeIndex to -1 in JIT, and correctly initialize
2151         it for each type of stub using the return address to find the correct
2152         offset.
2153
2154         * jit/JIT.cpp:
2155         (JSC::JIT::JIT):
2156         * jit/JIT.h:
2157         (JSC::JIT::compileGetByIdProto):
2158         (JSC::JIT::compileGetByIdSelfList):
2159         (JSC::JIT::compileGetByIdProtoList):
2160         (JSC::JIT::compileGetByIdChainList):
2161         (JSC::JIT::compileGetByIdChain):
2162         (JSC::JIT::compilePutByIdTransition):
2163         (JSC::JIT::compileCTIMachineTrampolines):
2164         (JSC::JIT::compilePatchGetArrayLength):
2165         * jit/JITStubCall.h:
2166         (JSC::JITStubCall::call):
2167
2168 == Rolled over to ChangeLog-2009-06-16 ==