2009-07-14 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
[WebKit-https.git] / JavaScriptCore / ChangeLog
1 2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
2
3         Reviewed by Darin Adler.
4
5         Change ParserArenaRefCounted's superclass to RefCountedCustomAllocated
6         https://bugs.webkit.org/show_bug.cgi?id=27249
7
8         ParserArenaDeletable customizes operator new, to avoid double inheritance
9         ParserArenaDeletable's superclass has been changed to RefCountedCustomAllocated.
10
11         * parser/Nodes.h:
12
13 2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
14
15         Reviewed by Darin Adler.
16
17         Add RefCountedCustomAllocated to RefCounted.h
18         https://bugs.webkit.org/show_bug.cgi?id=27232
19
20         Some class which are inherited from RefCounted customize
21         operator new, but RefCounted is inherited from Noncopyable
22         which will be inherited from FastAllocBase. To avoid
23         conflicts Noncopyable inheriting was moved down to RefCounted
24         and to avoid double inheritance this class has been added.
25
26         * wtf/RefCounted.h:
27         (WTF::RefCountedCustomAllocated::deref):
28         (WTF::RefCountedCustomAllocated::~RefCountedCustomAllocated):
29
30 2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
31
32         Reviewed by Darin Adler.
33
34         Add NoncopyableCustomAllocated to Noncopyable.h.
35         https://bugs.webkit.org/show_bug.cgi?id=27228
36         
37         Some classes which inherited from Noncopyable overrides operator new
38         since Noncopyable'll be inherited from FastAllocBase, Noncopyable.h 
39         needs to be extended with this new class to support the overriding. 
40
41         * wtf/Noncopyable.h:
42         (WTFNoncopyable::NoncopyableCustomAllocated::NoncopyableCustomAllocated):
43         (WTFNoncopyable::NoncopyableCustomAllocated::~NoncopyableCustomAllocated):
44
45 2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
46
47         Reviewed by Darin Adler.
48
49         Allow custom memory allocation control for JavaScriptCore's IdentifierTable class
50         https://bugs.webkit.org/show_bug.cgi?id=27260
51
52         Inherits IdentifierTable class from FastAllocBase because it has been
53         instantiated by 'new' in JavaScriptCore/runtime/Identifier.cpp:70.
54
55         * runtime/Identifier.cpp:
56
57 2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
58
59         Reviewed by Darin Adler.
60
61         Allow custom memory allocation control for JavaScriptCore's Profiler class
62         https://bugs.webkit.org/show_bug.cgi?id=27253
63
64         Inherits Profiler class from FastAllocBase because it has been instantiated by
65         'new' in JavaScriptCore/profiler/Profiler.cpp:56.
66
67         * profiler/Profiler.h:
68
69 2009-07-06  George Staikos  <george.staikos@torchmobile.com>
70
71         Reviewed by Adam Treat.
72
73         Authors: George Staikos <george.staikos@torchmobile.com>, Joe Mason <joe.mason@torchmobile.com>, Makoto Matsumoto <matumoto@math.keio.ac.jp>, Takuji Nishimura
74
75         https://bugs.webkit.org/show_bug.cgi?id=27030
76         Implement custom RNG for WinCE using Mersenne Twister
77
78         * wtf/RandomNumber.cpp:
79         (WTF::randomNumber):
80         * wtf/RandomNumberSeed.h:
81         (WTF::initializeRandomNumberGenerator):
82         * wtf/wince/mt19937ar.c: Added.
83         (init_genrand):
84         (init_by_array):
85         (genrand_int32):
86         (genrand_int31):
87         (genrand_real1):
88         (genrand_real2):
89         (genrand_real3):
90         (genrand_res53):
91
92 2009-07-13  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
93
94         Unreviewed make dist build fix.
95
96         * GNUmakefile.am:
97
98 2009-07-13  Drew Wilson  <atwilson@google.com>
99
100         Reviewed by David Levin.
101
102         Add ENABLE(SHARED_WORKERS) flag and define SharedWorker APIs
103         https://bugs.webkit.org/show_bug.cgi?id=26932
104
105         Added ENABLE(SHARED_WORKERS) flag (off by default).
106
107         * Configurations/FeatureDefines.xcconfig:
108
109 2009-07-07  Norbert Leser  <norbert.leser@nokia.com>
110
111         Reviewed by Maciej Stachoviak.
112
113         https://bugs.webkit.org/show_bug.cgi?id=27058
114
115         Removed superfluous parenthesis around single expression.
116         Compilers on Symbian platform fail to properly parse and compile.
117
118         * JavaScriptCore/wtf/Platform.h:
119
120 2009-07-13  Norbert Leser  <norbert.leser@nokia.com>
121
122         Reviewed by Maciej Stachoviak.
123
124         https://bugs.webkit.org/show_bug.cgi?id=27054
125
126         Renamed Translator to HashTranslator
127
128         Codewarrior compiler (WINSCW) latest b482 cannot resolve typename
129         mismatch between template declaration and definition
130         (HashTranslator / Translator)
131
132         * wtf/HashSet.h:
133
134 2009-07-13  Norbert Leser  <norbert.leser@nokia.com>
135
136         Reviewed by Eric Seidel.
137
138         https://bugs.webkit.org/show_bug.cgi?id=27053
139
140         Ambiguity in LabelScope initialization
141
142         Codewarrior compiler (WINSCW) latest b482 on Symbian cannot resolve
143         type of "0" unambiguously. Set expression explicitly to
144         PassRefPtr<Label>::PassRefPtr()
145
146         * bytecompiler/BytecodeGenerator.cpp
147
148 2009-07-11  Simon Fraser  <simon.fraser@apple.com>
149
150         Enable support for accelerated compositing and 3d transforms on Leopard.
151         <https://bugs.webkit.org/show_bug.cgi?id=20166>
152         <rdar://problem/6120614>
153
154         Reviewed by Oliver Hunt.
155
156         * Configurations/FeatureDefines.xcconfig:
157         * wtf/Platform.h:
158
159 2009-07-10  Mark Rowe  <mrowe@apple.com>
160
161         Second part of the "make Windows happier" dance.
162
163         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
164         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
165
166 2009-07-10  Mark Rowe  <mrowe@apple.com>
167
168         Try and make the Windows build happy.
169
170         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
171         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
172
173 2009-07-10  Kevin McCullough  <kmccullough@apple.com>
174
175         Reviewed by Geoffrey Garen.
176
177         * debugger/Debugger.h: Made this function virtual for use in WebCore's
178         WebInspector.
179
180 2009-07-10  Kwang Yul Seo  <skyul@company100.net>
181
182         Reviewed by Darin Adler.
183
184         ParserArenaDeletable should override delete
185         https://bugs.webkit.org/show_bug.cgi?id=26790
186
187         ParserArenaDeletable overrides new, but it does not override delete.
188         ParserArenaDeletable must be freed by fastFree
189         because it is allocated by fastMalloc.
190
191         * parser/NodeConstructors.h:
192         (JSC::ParserArenaDeletable::operator delete):
193         * parser/Nodes.h:
194
195 2009-07-10  Adam Roben  <aroben@apple.com>
196
197         Sort all our Xcode projects
198
199         Accomplished using sort-Xcode-project-file.
200
201         Requested by Dave Kilzer.
202
203         * JavaScriptCore.xcodeproj/project.pbxproj:
204
205 2009-07-09  Maciej Stachowiak  <mjs@apple.com>
206
207         Not reviewed, build fix.
208
209         Windows build fix for the last change.
210
211         * wtf/dtoa.cpp: Forgot to include Vector.h
212
213 2009-07-09  Maciej Stachowiak  <mjs@apple.com>
214
215         Reviewed by Darin Adler.
216
217         REGRESSION: crash in edge cases of floating point parsing.
218         https://bugs.webkit.org/show_bug.cgi?id=27110
219         <rdar://problem/7044458>
220         
221         Tests: fast/css/number-parsing-crash.html
222                fast/css/number-parsing-crash.html
223                fast/js/number-parsing-crash.html
224         
225         * wtf/dtoa.cpp:
226         (WTF::BigInt::BigInt): Converted this to more a proper class, using a Vector
227         with inline capacity
228
229         (WTF::lshift): Rearranged logic somewhat nontrivially to deal with the new way of sizing BigInts.
230         Added an assertion to verify that invariants are maintained.
231
232         All other functions are adapted fairly mechanically to the above changes.
233         (WTF::BigInt::clear):
234         (WTF::BigInt::size):
235         (WTF::BigInt::resize):
236         (WTF::BigInt::words):
237         (WTF::BigInt::append):
238         (WTF::multadd):
239         (WTF::s2b):
240         (WTF::i2b):
241         (WTF::mult):
242         (WTF::cmp):
243         (WTF::diff):
244         (WTF::b2d):
245         (WTF::d2b):
246         (WTF::ratio):
247         (WTF::strtod):
248         (WTF::quorem):
249         (WTF::dtoa):
250
251 2009-07-09  Drew Wilson  <atwilson@google.com>
252
253         Reviewed by Alexey Proskuryakov.
254
255         Turned on CHANNEL_MESSAGING by default because the MessageChannel API
256         can now be implemented for Web Workers and is reasonably stable.
257
258         * Configurations/FeatureDefines.xcconfig:
259
260 2009-07-09  Oliver Hunt  <oliver@apple.com>
261
262         Reviewed by NOBODY (Build fix).
263
264         * interpreter/Interpreter.cpp:
265         (JSC::Interpreter::privateExecute):
266
267 2009-07-09  Oliver Hunt  <oliver@apple.com>
268
269         Reviewed by Darin Adler.
270
271         Bug 27016 - Interpreter crashes due to invalid array indexes
272         <https://bugs.webkit.org/show_bug.cgi?id=27016>
273
274         Unsigned vs signed conversions results in incorrect behaviour in
275         64bit interpreter builds.
276
277         * interpreter/Interpreter.cpp:
278         (JSC::Interpreter::privateExecute):
279
280 2009-07-09  Dimitri Glazkov  <dglazkov@chromium.org>
281
282         Reviewed by Darin Fisher.
283
284         [Chromium] Upstream JavaScriptCore.gypi, the project file for Chromium build.
285         https://bugs.webkit.org/show_bug.cgi?id=27135
286
287         * JavaScriptCore.gypi: Added.
288
289 2009-07-09  Joe Mason  <joe.mason@torchmobile.com>
290
291         Reviewed by George Staikos.
292         
293         Authors: Yong Li <yong.li@torchmobile.com>, Joe Mason <joe.mason@torchmobile.com>
294
295         https://bugs.webkit.org/show_bug.cgi?id=27031
296         Add an override for deleteOwnedPtr(HDC) on Windows
297         
298         * wtf/OwnPtrCommon.h:
299         * wtf/OwnPtrWin.cpp:
300         (WTF::deleteOwnedPtr):
301
302 2009-07-09  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
303
304         Reviewed by Darin Adler.
305
306         Guard singal.h dependency with HAVE(SIGNAL_H) to enable building jsc
307         on SYMBIAN.
308
309         https://bugs.webkit.org/show_bug.cgi?id=27026
310
311         Based on Norbert Leser's work.
312
313         * jsc.cpp:
314         (printUsageStatement):
315         (parseArguments):
316         * wtf/Platform.h:
317
318 2009-07-07  Gavin Barraclough  <barraclough@apple.com>
319
320         Reviewed by Sam Weinig.
321
322         Stop loading constants into the register file.
323
324         Instead, use high register values (highest bit bar the sign bit set) to indicate
325         constants in the instruction stream, and when we encounter such a value load it
326         directly from the CodeBlock.
327
328         Since constants are no longer copied into the register file, this patch renders
329         the 'unexpected constant' mechanism redundant, and removes it.
330
331         2% improvement, thanks to Sam Weinig.
332
333         * bytecode/CodeBlock.cpp:
334         (JSC::CodeBlock::dump):
335         (JSC::CodeBlock::CodeBlock):
336         (JSC::CodeBlock::mark):
337         (JSC::CodeBlock::shrinkToFit):
338         * bytecode/CodeBlock.h:
339         (JSC::CodeBlock::isTemporaryRegisterIndex):
340         (JSC::CodeBlock::constantRegister):
341         (JSC::CodeBlock::isConstantRegisterIndex):
342         (JSC::CodeBlock::getConstant):
343         (JSC::ExecState::r):
344         * bytecode/Opcode.h:
345         * bytecompiler/BytecodeGenerator.cpp:
346         (JSC::BytecodeGenerator::preserveLastVar):
347         (JSC::BytecodeGenerator::BytecodeGenerator):
348         (JSC::BytecodeGenerator::addConstantValue):
349         (JSC::BytecodeGenerator::emitEqualityOp):
350         (JSC::BytecodeGenerator::emitLoad):
351         (JSC::BytecodeGenerator::emitResolveBase):
352         (JSC::BytecodeGenerator::emitResolveWithBase):
353         (JSC::BytecodeGenerator::emitNewError):
354         * bytecompiler/BytecodeGenerator.h:
355         (JSC::BytecodeGenerator::emitNode):
356         * interpreter/CallFrame.h:
357         (JSC::ExecState::noCaller):
358         (JSC::ExecState::hasHostCallFrameFlag):
359         (JSC::ExecState::addHostCallFrameFlag):
360         (JSC::ExecState::removeHostCallFrameFlag):
361         * interpreter/Interpreter.cpp:
362         (JSC::Interpreter::resolve):
363         (JSC::Interpreter::resolveSkip):
364         (JSC::Interpreter::resolveGlobal):
365         (JSC::Interpreter::resolveBase):
366         (JSC::Interpreter::resolveBaseAndProperty):
367         (JSC::Interpreter::resolveBaseAndFunc):
368         (JSC::Interpreter::dumpRegisters):
369         (JSC::Interpreter::throwException):
370         (JSC::Interpreter::createExceptionScope):
371         (JSC::Interpreter::privateExecute):
372         (JSC::Interpreter::retrieveArguments):
373         * jit/JIT.cpp:
374         (JSC::JIT::privateCompileMainPass):
375         * jit/JITInlineMethods.h:
376         (JSC::JIT::emitLoadDouble):
377         (JSC::JIT::emitLoadInt32ToDouble):
378         * jit/JITOpcodes.cpp:
379         (JSC::JIT::emit_op_new_error):
380         (JSC::JIT::emit_op_enter):
381         (JSC::JIT::emit_op_enter_with_activation):
382         * parser/Nodes.cpp:
383         (JSC::DeleteResolveNode::emitBytecode):
384         (JSC::DeleteValueNode::emitBytecode):
385         (JSC::PrefixResolveNode::emitBytecode):
386         * runtime/JSActivation.cpp:
387         (JSC::JSActivation::JSActivation):
388         * wtf/Platform.h:
389
390 2009-07-07  Mark Rowe  <mrowe@apple.com>
391
392         Reviewed by Darin Adler.
393
394         Fix <https://bugs.webkit.org/show_bug.cgi?id=27025> / <rdar://problem/7033448>.
395         Bug 27025: Crashes and regression test failures related to regexps in 64-bit
396
397         For x86_64 RegexGenerator uses rbx, a callee-save register, as a scratch register but
398         neglects to save and restore it.  The change in handling of the output vector in r45545
399         altered code generation so that the RegExp::match was now storing important data in rbx,
400         which caused crashes and bogus results when it was clobbered.
401
402         * yarr/RegexJIT.cpp:
403         (JSC::Yarr::RegexGenerator::generateEnter): Save rbx.
404         (JSC::Yarr::RegexGenerator::generateReturn): Restore rbx.
405
406 2009-07-06  Ada Chan  <adachan@apple.com>
407
408         Reviewed by Darin Adler and Mark Rowe.
409
410         Decommitted spans are added to the list of normal spans rather than 
411         the returned spans in TCMalloc_PageHeap::Delete().
412         https://bugs.webkit.org/show_bug.cgi?id=26998
413         
414         In TCMalloc_PageHeap::Delete(), the deleted span can be decommitted in 
415         the process of merging with neighboring spans that are also decommitted.  
416         The merged span needs to be placed in the list of returned spans (spans 
417         whose memory has been returned to the system).  Right now it's always added 
418         to the list of the normal spans which can theoretically cause thrashing.  
419
420         * wtf/FastMalloc.cpp:
421         (WTF::TCMalloc_PageHeap::Delete):
422
423 2009-07-05  Lars Knoll  <lars.knoll@nokia.com>
424
425         Reviewed by Maciej Stachowiak.
426
427         https://bugs.webkit.org/show_bug.cgi?id=26843
428
429         Fix run-time crashes in JavaScriptCore with the Metrowerks compiler on Symbian.
430
431         The Metrowerks compiler on the Symbian platform moves the globally
432         defined Hashtables into read-only memory, despite one of the members
433         being mutable. This causes crashes at run-time due to write access to
434         read-only memory.
435
436         Avoid the use of const with this compiler by introducing the
437         JSC_CONST_HASHTABLE macro.
438
439         Based on idea by Norbert Leser.
440
441         * runtime/Lookup.h: Define JSC_CONST_HASHTABLE as const for !WINSCW.
442         * create_hash_table: Use JSC_CONST_HASHTABLE for hashtables.
443         * runtime/JSGlobalData.cpp: Import various global hashtables via the macro.
444
445 2009-07-04  Dan Bernstein  <mitz@apple.com>
446
447         - debug build fix
448
449         * runtime/RegExpConstructor.cpp:
450         (JSC::RegExpConstructor::getLastParen):
451
452 2009-07-03  Yong Li  <yong.li@torchmobile.com>
453
454         Reviewed by Maciej Stachowiak (and revised slightly)
455
456         RegExp::match to be optimized
457         https://bugs.webkit.org/show_bug.cgi?id=26957
458
459         Allow regexp matching to use Vectors with inline capacity instead of
460         allocating a new ovector buffer every time.
461         
462         ~5% speedup on SunSpider string-unpack-code test, 0.3% on SunSpider overall.
463
464         * runtime/RegExp.cpp:
465         (JSC::RegExp::match):
466         * runtime/RegExp.h:
467         * runtime/RegExpConstructor.cpp:
468         (JSC::RegExpConstructorPrivate::RegExpConstructorPrivate):
469         (JSC::RegExpConstructorPrivate::lastOvector):
470         (JSC::RegExpConstructorPrivate::tempOvector):
471         (JSC::RegExpConstructorPrivate::changeLastOvector):
472         (JSC::RegExpConstructor::performMatch):
473         (JSC::RegExpMatchesArray::RegExpMatchesArray):
474         (JSC::RegExpMatchesArray::fillArrayInstance):
475         (JSC::RegExpConstructor::getBackref):
476         (JSC::RegExpConstructor::getLastParen):
477         (JSC::RegExpConstructor::getLeftContext):
478         (JSC::RegExpConstructor::getRightContext):
479         * runtime/StringPrototype.cpp:
480         (JSC::stringProtoFuncSplit):
481
482 2009-06-30  Kwang Yul Seo  <skyul@company100.net>
483
484         Reviewed by Eric Seidel.
485
486         Override operator new/delete with const std::nothrow_t& as the second
487         argument.
488         https://bugs.webkit.org/show_bug.cgi?id=26792
489
490         On Windows CE, operator new/delete, new[]/delete[] with const
491         std::nothrow_t& must be overrided because some standard template
492         libraries use these operators.
493
494         The problem occurs when memory allocated by new(size_t s, const
495         std::nothrow_t&) is freed by delete(void* p). This causes the umatched
496         malloc/free problem.
497
498         The patch overrides all new, delete, new[] and delete[] to use
499         fastMaloc and fastFree consistently.
500
501         * wtf/FastMalloc.h:
502         (throw):
503
504 2009-06-30  Gabor Loki  <loki@inf.u-szeged.hu>
505
506         Reviewed by Sam Weinig.
507
508         <https://bugs.webkit.org/show_bug.cgi?id=24986>
509
510         Remove unnecessary references to AssemblerBuffer.
511
512         * interpreter/Interpreter.cpp:
513         * interpreter/Interpreter.h:
514
515 2009-06-29  David Levin  <levin@chromium.org>
516
517         Reviewed by Oliver Hunt.
518
519         Still seeing occasional leaks from UString::sharedBuffer code
520         https://bugs.webkit.org/show_bug.cgi?id=26420
521
522         The problem is that the pointer to the memory allocation isn't visible
523         by "leaks" due to the lower bits being used as flags.  The fix is to
524         make the pointer visible in memory (in debug only). The downside of
525         this fix that the memory allocated by sharedBuffer will still look like
526         a leak in non-debug builds when any flags are set.
527
528         * wtf/PtrAndFlags.h:
529         (WTF::PtrAndFlags::set):
530
531 2009-06-29  Sam Weinig  <sam@webkit.org>
532
533         Reviewed by Mark Rowe.
534
535         Remove more unused scons support.
536
537         * SConstruct: Removed.
538
539 2009-06-29  Oliver Hunt  <oliver@apple.com>
540
541         Reviewed by Gavin Barraclough.
542
543         <rdar://problem/7016214> JSON.parse fails to parse valid JSON with most Unicode characters
544         <https://bugs.webkit.org/show_bug.cgi?id=26802>
545
546         In the original JSON.parse patch unicode was handled correctly, however in some last
547         minute "clean up" I oversimplified isSafeStringCharacter.  This patch corrects this bug.
548
549         * runtime/LiteralParser.cpp:
550         (JSC::isSafeStringCharacter):
551         (JSC::LiteralParser::Lexer::lexString):
552
553 2009-06-26  Oliver Hunt  <oliver@apple.com>
554
555         Reviewed by Dan Bernstein.
556
557         <rdar://problem/7009684> REGRESSION(r45039): Crashes inside JSEvent::put on PowerPC (26746)
558         <https://bugs.webkit.org/show_bug.cgi?id=26746>
559
560         Fix for r45039 incorrectly uncached a get_by_id by converting it to put_by_id.  Clearly this
561         is less than correct.  This patch corrects that error.
562
563         * interpreter/Interpreter.cpp:
564         (JSC::Interpreter::tryCacheGetByID):
565
566 2009-06-26  Eric Seidel  <eric@webkit.org>
567
568         No review, only rolling out r45259.
569
570         Roll out r45259 after crash appeared on the bots:
571         plugins/undefined-property-crash.html
572         ASSERTION FAILED: s <= HeapConstants<heapType>::cellSize
573         (leopard-intel-debug-tests/build/JavaScriptCore/runtime/Collector.cpp:278
574         void* JSC::Heap::heapAllocate(size_t) [with JSC::HeapType heapType = PrimaryHeap])
575
576         * runtime/DateInstance.cpp:
577         * runtime/Identifier.cpp:
578         * runtime/Lookup.h:
579         * runtime/RegExpConstructor.cpp:
580         * runtime/RegExpObject.h:
581         * runtime/ScopeChain.h:
582         * runtime/UString.h:
583
584 2009-06-26  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
585
586         Reviewed by Simon Hausmann.
587
588         Add support for QDataStream operators to Vector.
589
590         * wtf/Vector.h:
591         (WTF::operator<<):
592         (WTF::operator>>):
593
594 2009-06-24  Sam Weinig  <sam@webkit.org>
595
596         Reviewed by Gavin Barraclough.
597
598         Make the opcode sampler work once again.
599
600         * jit/JIT.h:
601         (JSC::JIT::compileGetByIdProto):
602         (JSC::JIT::compileGetByIdSelfList):
603         (JSC::JIT::compileGetByIdProtoList):
604         (JSC::JIT::compileGetByIdChainList):
605         (JSC::JIT::compileGetByIdChain):
606         (JSC::JIT::compilePutByIdTransition):
607         (JSC::JIT::compileCTIMachineTrampolines):
608         (JSC::JIT::compilePatchGetArrayLength):
609         * jit/JITStubCall.h:
610         (JSC::JITStubCall::call):
611
612 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
613
614         Reviewed by Maciej Stachowiak.
615
616         Extend FastAllocBase.h with 'using WTF::FastAllocBase' to avoid
617         unnecessary WTF:: usings.
618         Remove existing unnecessary WTF:: usings.
619
620         * interpreter/Interpreter.h:
621         * profiler/CallIdentifier.h:
622         * runtime/ScopeChain.h:
623         * wtf/FastAllocBase.h:
624
625 2009-06-24  David Levin  <levin@chromium.org>
626
627         Fix all builds.
628
629         * bytecode/CodeBlock.h:
630         * bytecompiler/BytecodeGenerator.h:
631         * interpreter/Register.h:
632
633 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
634
635         Reviewed by Maciej Stachowiak.
636         
637         https://bugs.webkit.org/show_bug.cgi?id=26677
638
639         Inherits CodeBlock class from FastAllocBase because it
640         has been instantiated by 'new' in JavaScriptCore/bytecode/CodeBlock.h:217.
641
642         * bytecode/CodeBlock.h:
643
644 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
645
646         Reviewed by Maciej Stachowiak.
647         
648         https://bugs.webkit.org/show_bug.cgi?id=26676
649
650         Inherits BytecodeGenerator class from FastAllocBase because it has been
651         instantiated by 'new' in JavaScriptCore/parser/Nodes.cpp:1892.
652
653         * bytecompiler/BytecodeGenerator.h:
654
655 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
656
657         Reviewed by Maciej Stachowiak.
658         
659         https://bugs.webkit.org/show_bug.cgi?id=26675
660
661         Inherits Register class from FastAllocBase because it has been
662         instantiated by 'new' in JavaScriptCore/runtime/JSVariableObject.h:149.
663
664         * interpreter/Register.h:
665
666 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
667
668         Reviewed by Darin Adler.
669         
670         https://bugs.webkit.org/show_bug.cgi?id=26674
671
672         Inherits HashMap class from FastAllocBase because it has been
673         instantiated by 'new' in JavaScriptCore/runtime/Structure.cpp:458.
674
675         * wtf/HashMap.h:
676
677 2009-06-24  Oliver Hunt  <oliver@apple.com>
678
679         Reviewed by Darin Adler.
680
681         <rdar://problem/6940519> REGRESSION (Safari 4 Public Beta - TOT): google.com/adplanner shows blank page instead of site details in "basic research'
682
683         The problem was caused by the page returned with a function using a
684         var declaration list containing around ~3000 variables.  The solution
685         to this is to flatten the comma expression representation and make
686         codegen comma expressions and initializer lists iterative rather than
687         recursive.
688
689         * parser/Grammar.y:
690         * parser/NodeConstructors.h:
691         (JSC::CommaNode::CommaNode):
692         * parser/Nodes.cpp:
693         (JSC::CommaNode::emitBytecode):
694         * parser/Nodes.h:
695         (JSC::ExpressionNode::isCommaNode):
696         (JSC::CommaNode::isCommaNode):
697         (JSC::CommaNode::append):
698
699 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
700
701         Reviewed by Maciej Stachowiak.
702
703         https://bugs.webkit.org/show_bug.cgi?id=26645
704
705         Inherits ScopeChainNode class from FastAllocBase because it has been
706         instantiated by 'new' in JavaScriptCore/runtime/ScopeChain.h:95.
707
708         * wtf/RefPtr.h:
709
710 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
711
712         Reviewed by Darin Adler.
713
714         https://bugs.webkit.org/show_bug.cgi?id=26648
715
716         Inherits Deque class from FastAllocBase because it has been
717         instantiated by 'new' with DEFINE_STATIC_LOCAL macro in 
718         JavaScriptCore/wtf/MainThread.cpp:62.
719
720         * wtf/Deque.h:
721
722 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
723
724         Reviewed by Darin Adler.
725
726         https://bugs.webkit.org/show_bug.cgi?id=26644
727
728         Inherits RefPtr class from FastAllocBase because it has been
729         instantiated by 'new' in JavaScriptCore/runtime/StructureChain.cpp:41.
730
731         * wtf/RefPtr.h:
732
733 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
734
735         Reviewed by Darin Adler.
736
737         Inherits HashSet class from FastAllocBase, because it has been
738         instantiated by 'new' in JavaScriptCore/runtime/Collector.h:116.
739
740         * wtf/HashSet.h:
741
742 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
743
744         Reviewed by Darin Adler.
745
746         Inherits Vector class from FastAllocBase because it has been
747         instantiated by 'new' in JavaScriptCore/runtime/Structure.cpp:633.
748
749         * wtf/Vector.h:
750
751 2009-06-24  Norbert Leser  <norbert.leser@nokia.com>
752
753         Reviewed by Maciej Stachoviak.
754
755         The BytecodeGenerator objects were instantiated on stack, which takes up ~38kB per instance
756         (each instance includes copy of JSC::CodeBlock with large SymbolTable, etc.).
757         Specifically, since there is nested invocation (e.g., GlobalCode --> FunctionCode),
758         the stack overflows immediately on Symbian hardware (max. 80 kB).
759         Proposed change allocates generator objects on heap.
760         Performance impact (if any) should be negligible and change is proposed as general fix,
761         rather than ifdef'd for SYMBIAN.
762
763         * parser/Nodes.cpp:
764         (JSC::ProgramNode::generateBytecode):
765         (JSC::EvalNode::generateBytecode):
766         (JSC::EvalNode::bytecodeForExceptionInfoReparse):
767         (JSC::FunctionBodyNode::generateBytecode):
768         (JSC::FunctionBodyNode::bytecodeForExceptionInfoReparse):
769
770 2009-06-23  Oliver Hunt  <oliver@apple.com>
771
772         Reviewed by Gavin Barraclough.
773
774         <rdar://problem/6992806> REGRESSION: Enumeration can skip new properties in cases of prototypes that have more than 64 (26593)
775         <https://bugs.webkit.org/show_bug.cgi?id=26593>
776
777         Do not attempt to cache structure chains if they contain a dictionary at any level.
778
779         * interpreter/Interpreter.cpp:
780         (JSC::Interpreter::tryCachePutByID):
781         (JSC::Interpreter::tryCacheGetByID):
782         * jit/JITStubs.cpp:
783         (JSC::JITThunks::tryCachePutByID):
784         * runtime/Structure.cpp:
785         (JSC::Structure::getEnumerablePropertyNames):
786         (JSC::Structure::addPropertyTransition):
787         * runtime/StructureChain.cpp:
788         (JSC::StructureChain::isCacheable):
789         * runtime/StructureChain.h:
790
791 2009-06-23  Yong Li  <yong.li@torchmobile.com>
792
793         Reviewed by George Staikos.
794
795         https://bugs.webkit.org/show_bug.cgi?id=26654
796         Add the proper export define for the JavaScriptCore API when building for WINCE.
797
798         * API/JSBase.h:
799
800 2009-06-23  Joe Mason  <joe.mason@torchmobile.com>
801
802         Reviewed by Adam Treat.
803
804         Authors: Yong Li <yong.li@torchmobile.com>, Joe Mason <joe.mason@torchmobile.com>
805
806         https://bugs.webkit.org/show_bug.cgi?id=26611
807         Implement currentThreadStackBase on WINCE by adding a global,
808         g_stackBase, which must be set to the address of a local variable
809         by the caller before calling any WebKit function that invokes JSC.
810
811         * runtime/Collector.cpp:
812         (JSC::isPageWritable):
813         (JSC::getStackBase):
814           Starts at the top of the stack and returns the entire range of
815           consecutive writable pages as an estimate of the actual stack.
816           This will be much bigger than the actual stack range, so some
817           dead objects can't be collected, but it guarantees live objects
818           aren't collected prematurely.
819
820         (JSC::currentThreadStackBase):
821           On WinCE, returns g_stackBase if set or call getStackBase as a
822           fallback if not.
823
824 2009-06-23  Oliver Hunt  <oliver@apple.com>
825
826         Reviewed by Alexey Proskuryakov.
827
828         Fix stupid performance problem in the LiteralParser
829
830         The LiteralParser was making a new UString in order to use
831         toDouble, however UString's toDouble allows a much wider range
832         of numberic strings than the LiteralParser accepts, and requires
833         an additional heap allocation or two for the construciton of the
834         UString.  To rectify this we just call WTF::dtoa directly using
835         a stack allocated buffer to hold the validated numeric literal.
836
837         * runtime/LiteralParser.cpp:
838         (JSC::LiteralParser::Lexer::lexNumber):
839         (JSC::LiteralParser::parse):
840         * runtime/LiteralParser.h:
841
842 2009-06-22  Oliver Hunt  <oliver@apple.com>
843
844         Reviewed by Alexey Proskuryakov.
845
846         Bug 26640: JSON.stringify needs to special case Boolean objects
847         <https://bugs.webkit.org/show_bug.cgi?id=26640>
848
849         Add special case handling of the Boolean object so we match current
850         ES5 errata.
851
852         * runtime/JSONObject.cpp:
853         (JSC::unwrapBoxedPrimitive): renamed from unwrapNumberOrString
854         (JSC::gap):
855         (JSC::Stringifier::appendStringifiedValue):
856
857 2009-06-22  Oliver Hunt  <oliver@apple.com>
858
859         Reviewed by Darin Adler.
860
861         Bug 26591: Support revivers in JSON.parse
862         <https://bugs.webkit.org/show_bug.cgi?id=26591>
863
864         Add reviver support to JSON.parse.  This completes the JSON object.
865
866         * runtime/JSONObject.cpp:
867         (JSC::Walker::Walker):
868         (JSC::Walker::callReviver):
869         (JSC::Walker::walk):
870         (JSC::JSONProtoFuncParse):
871
872 2009-06-21  Oliver Hunt  <oliver@apple.com>
873
874         Reviewed by Darin Adler.
875
876         Bug 26592: Support standard toJSON functions
877         <https://bugs.webkit.org/show_bug.cgi?id=26592>
878
879         Add support for the standard Date.toJSON function.
880
881         * runtime/DatePrototype.cpp:
882         (JSC::dateProtoFuncToJSON):
883
884 2009-06-21  Oliver Hunt  <oliver@apple.com>
885
886         Reviewed by Sam Weinig.
887
888         Bug 26594: JSC needs to support Date.toISOString
889         <https://bugs.webkit.org/show_bug.cgi?id=26594>
890
891         Add support for Date.toISOString.
892
893         * runtime/DatePrototype.cpp:
894         (JSC::dateProtoFuncToISOString):
895
896 2009-06-21  Oliver Hunt  <oliver@apple.com>
897
898         Reviewed by NOBODY (Build fix).
899
900         Remove dead code.
901
902         * runtime/LiteralParser.cpp:
903         (JSC::LiteralParser::parse):
904
905 2009-06-21  Oliver Hunt  <oliver@apple.com>
906
907         Reviewed by Darin Adler and Cameron Zwarich.
908
909         Bug 26587: Support JSON.parse
910         <https://bugs.webkit.org/show_bug.cgi?id=26587>
911
912         Extend the LiteralParser to support the full strict JSON
913         grammar, fix a few places where the grammar was incorrectly
914         lenient.   Doesn't yet support the JSON.parse reviver function
915         but that does not block the JSON.parse functionality itself.
916
917         * interpreter/Interpreter.cpp:
918         (JSC::Interpreter::callEval):
919         * runtime/JSGlobalObjectFunctions.cpp:
920         (JSC::globalFuncEval):
921         * runtime/JSONObject.cpp:
922         (JSC::JSONProtoFuncParse):
923         * runtime/LiteralParser.cpp:
924         (JSC::LiteralParser::Lexer::lex):
925         (JSC::isSafeStringCharacter):
926         (JSC::LiteralParser::Lexer::lexString):
927         (JSC::LiteralParser::parse):
928         * runtime/LiteralParser.h:
929         (JSC::LiteralParser::LiteralParser):
930         (JSC::LiteralParser::tryJSONParse):
931         (JSC::LiteralParser::):
932         (JSC::LiteralParser::Lexer::Lexer):
933
934 2009-06-21  David Levin  <levin@chromium.org>
935
936         Reviewed by NOBODY (speculative build fix for windows).
937
938         Simply removed some whitespace form this file to make windows build wtf and
939         hopefully copy the new MessageQueque.h so that WebCore picks it up.
940
941         * wtf/Assertions.cpp:
942
943 2009-06-21  Drew Wilson  <atwilson@google.com>
944
945         Reviewed by David Levin.
946
947         <https://bugs.webkit.org/show_bug.cgi?id=25043>
948         Added support for multi-threaded MessagePorts.
949
950         * wtf/MessageQueue.h:
951         (WTF::::appendAndCheckEmpty):
952             Added API to test whether the queue was empty before adding an element.
953   
954 2009-06-20  David D. Kilzer  <ddkilzer@webkit.org>
955
956         Fix namespace comment in SegmentedVector.h
957
958         * wtf/SegmentedVector.h: Updated namespace comment to reflect
959         new namespace after r44897.
960
961 2009-06-20  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
962
963         Bug 24986: ARM JIT port
964         <https://bugs.webkit.org/show_bug.cgi?id=24986>
965
966         Reviewed by Oliver Hunt.
967
968         An Iterator added for SegmentedVector. Currently
969         only the pre ++ operator is supported.
970
971         * wtf/SegmentedVector.h:
972         (WTF::SegmentedVectorIterator::~SegmentedVectorIterator):
973         (WTF::SegmentedVectorIterator::operator*):
974         (WTF::SegmentedVectorIterator::operator->):
975         (WTF::SegmentedVectorIterator::operator++):
976         (WTF::SegmentedVectorIterator::operator==):
977         (WTF::SegmentedVectorIterator::operator!=):
978         (WTF::SegmentedVectorIterator::operator=):
979         (WTF::SegmentedVectorIterator::SegmentedVectorIterator):
980         (WTF::SegmentedVector::alloc):
981         (WTF::SegmentedVector::begin):
982         (WTF::SegmentedVector::end):
983
984 2009-06-20  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
985
986         Bug 24986: ARM JIT port
987         <https://bugs.webkit.org/show_bug.cgi?id=24986>
988
989         Reviewed by Oliver Hunt.
990
991         Move SegmentedVector to /wtf subdirectory
992         and change "namespace JSC" to "namespace WTF"
993
994         Additional build file updates by David Kilzer.
995
996         * GNUmakefile.am: Updated path to SegmentedVector.h.
997         * JavaScriptCore.order: Updated SegmentedVector namespace from
998         JSC to WTF in mangled C++ method name.
999         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1000         Removed reference to bytecompiler\SegmentedVector.h.
1001         * JavaScriptCore.vcproj/WTF/WTF.vcproj: Added reference to
1002         wtf\SegmentedVector.h.
1003         * JavaScriptCore.xcodeproj/project.pbxproj: Moved
1004         SegmentedVector.h definition from bytecompiler subdirectory to
1005         wtf subdirectory.
1006         * bytecompiler/BytecodeGenerator.h: Updated #include path to
1007         SegmentedVector.h and prepended WTF:: namespace to its use.
1008         * parser/Lexer.h: Ditto.
1009         * wtf/SegmentedVector.h: Renamed from JavaScriptCore/bytecompiler/SegmentedVector.h.
1010         (WTF::SegmentedVector::SegmentedVector):
1011         (WTF::SegmentedVector::~SegmentedVector):
1012         (WTF::SegmentedVector::size):
1013         (WTF::SegmentedVector::at):
1014         (WTF::SegmentedVector::operator[]):
1015         (WTF::SegmentedVector::last):
1016         (WTF::SegmentedVector::append):
1017         (WTF::SegmentedVector::removeLast):
1018         (WTF::SegmentedVector::grow):
1019         (WTF::SegmentedVector::clear):
1020         (WTF::SegmentedVector::deleteAllSegments):
1021         (WTF::SegmentedVector::segmentExistsFor):
1022         (WTF::SegmentedVector::segmentFor):
1023         (WTF::SegmentedVector::subscriptFor):
1024         (WTF::SegmentedVector::ensureSegmentsFor):
1025         (WTF::SegmentedVector::ensureSegment):
1026
1027 2009-06-19  Gavin Barraclough  <barraclough@apple.com>
1028
1029         Reviewed by NOBODY (build fix take 2 - rename FIELD_OFFSET to something that doesn't conflict with winnt.h).
1030
1031         * jit/JIT.cpp:
1032         (JSC::JIT::privateCompile):
1033         (JSC::JIT::privateCompileCTIMachineTrampolines):
1034         (JSC::JIT::emitGetVariableObjectRegister):
1035         (JSC::JIT::emitPutVariableObjectRegister):
1036         * jit/JIT.h:
1037         * jit/JITArithmetic.cpp:
1038         (JSC::JIT::emit_op_rshift):
1039         (JSC::JIT::emitSlow_op_jnless):
1040         (JSC::JIT::emitSlow_op_jnlesseq):
1041         (JSC::JIT::compileBinaryArithOp):
1042         * jit/JITCall.cpp:
1043         (JSC::JIT::compileOpCallInitializeCallFrame):
1044         (JSC::JIT::compileOpCall):
1045         * jit/JITInlineMethods.h:
1046         (JSC::JIT::restoreArgumentReference):
1047         (JSC::JIT::checkStructure):
1048         * jit/JITOpcodes.cpp:
1049         (JSC::JIT::emit_op_instanceof):
1050         (JSC::JIT::emit_op_get_scoped_var):
1051         (JSC::JIT::emit_op_put_scoped_var):
1052         (JSC::JIT::emit_op_construct_verify):
1053         (JSC::JIT::emit_op_resolve_global):
1054         (JSC::JIT::emit_op_jeq_null):
1055         (JSC::JIT::emit_op_jneq_null):
1056         (JSC::JIT::emit_op_to_jsnumber):
1057         (JSC::JIT::emit_op_catch):
1058         (JSC::JIT::emit_op_eq_null):
1059         (JSC::JIT::emit_op_neq_null):
1060         (JSC::JIT::emit_op_convert_this):
1061         (JSC::JIT::emit_op_profile_will_call):
1062         (JSC::JIT::emit_op_profile_did_call):
1063         (JSC::JIT::emitSlow_op_get_by_val):
1064         * jit/JITPropertyAccess.cpp:
1065         (JSC::JIT::emit_op_get_by_val):
1066         (JSC::JIT::emit_op_put_by_val):
1067         (JSC::JIT::emit_op_method_check):
1068         (JSC::JIT::compileGetByIdHotPath):
1069         (JSC::JIT::emit_op_put_by_id):
1070         (JSC::JIT::compilePutDirectOffset):
1071         (JSC::JIT::compileGetDirectOffset):
1072         (JSC::JIT::privateCompilePutByIdTransition):
1073         (JSC::JIT::privateCompilePatchGetArrayLength):
1074         * jit/JITStubs.cpp:
1075         (JSC::JITThunks::JITThunks):
1076
1077 2009-06-19  Gavin Barraclough  <barraclough@apple.com>
1078
1079         Reviewed by NOBODY (Windows build fix).
1080
1081         * jit/JIT.h:
1082         * jit/JITInlineMethods.h:
1083
1084 2009-06-19  Gabor Loki  <loki@inf.u-szeged.hu>
1085
1086         Reviewed by Gavin Barraclough.
1087
1088         Reorganize ARM architecture specific macros.
1089         Use PLATFORM_ARM_ARCH(7) instead of PLATFORM(ARM_V7).
1090
1091         Bug 24986: ARM JIT port
1092         <https://bugs.webkit.org/show_bug.cgi?id=24986>
1093
1094         * assembler/ARMv7Assembler.h:
1095         * assembler/AbstractMacroAssembler.h:
1096         (JSC::AbstractMacroAssembler::Imm32::Imm32):
1097         * assembler/MacroAssembler.h:
1098         * assembler/MacroAssemblerCodeRef.h:
1099         (JSC::MacroAssemblerCodePtr::MacroAssemblerCodePtr):
1100         * jit/ExecutableAllocator.h:
1101         (JSC::ExecutableAllocator::cacheFlush):
1102         * jit/JIT.h:
1103         * jit/JITInlineMethods.h:
1104         (JSC::JIT::restoreArgumentReferenceForTrampoline):
1105         * jit/JITStubs.cpp:
1106         * jit/JITStubs.h:
1107         * wtf/Platform.h:
1108         * yarr/RegexJIT.cpp:
1109         (JSC::Yarr::RegexGenerator::generateEnter):
1110         (JSC::Yarr::RegexGenerator::generateReturn):
1111
1112 2009-06-19  Gavin Barraclough  <barraclough@apple.com>
1113
1114         Reviewed by Oliver Hunt.
1115
1116         Fix armv7 JIT build issues.
1117
1118         Unfortunate the arm compiler does not like the use of offsetof on JITStackFrame (since it now contains non POD types),
1119         and the FIELD_OFFSET macro does not appear constantish enough for it to be happy with its use in COMPILE_ASSERT macros.
1120
1121         * Replace offsetofs with FIELD_OFFSETs (safe on C++ objects).
1122         * Move COMPILE_ASSERTs defending layout of JITStackFrame structure on armv7 into JITThunks constructor.
1123
1124         * jit/JIT.cpp:
1125         * jit/JIT.h:
1126         * jit/JITInlineMethods.h:
1127         (JSC::JIT::restoreArgumentReference):
1128         * jit/JITOpcodes.cpp:
1129         (JSC::JIT::emit_op_catch):
1130         * jit/JITStubs.cpp:
1131         (JSC::JITThunks::JITThunks):
1132
1133 2009-06-19  Adam Treat  <adam.treat@torchmobile.com>
1134
1135         Blind attempt at build fix.
1136
1137         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1138         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
1139
1140 2009-06-19  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
1141
1142         Reviewed by Oliver Hunt.
1143
1144         Inherits CallIdentifier struct from FastAllocBase because it has been
1145         instantiated by 'new' in JavaScriptCore/profiler/CallIdentifier.h:86.
1146
1147         * wtf/HashCountedSet.h:
1148
1149 2009-06-19  Adam Treat  <adam.treat@torchmobile.com>
1150
1151         Reviewed by Oliver Hunt.
1152
1153         https://bugs.webkit.org/show_bug.cgi?id=26540
1154         Modify the test shell to add a new function 'checkSyntax' that will
1155         only parse the source instead of executing it. In this way we can test
1156         pure parsing performance against some of the larger scripts in the wild.
1157
1158         * jsc.cpp:
1159         (GlobalObject::GlobalObject):
1160         (functionCheckSyntax):
1161
1162 2009-06-19  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
1163
1164         Reviewed by Darin Adler.
1165         
1166         Inherits HashCountedSet class from FastAllocBase because it has been
1167         instantiated by 'new' in JavaScriptCore/runtime/Collector.cpp:1095.
1168
1169         * wtf/HashCountedSet.h:
1170
1171 2009-06-19  Yong Li  <yong.li@torchmobile.com>
1172
1173         Reviewed by George Staikos.
1174
1175         https://bugs.webkit.org/show_bug.cgi?id=26558
1176         Declare these symbols extern for WINCE as they are provided by libce.
1177
1178         * runtime/DateConstructor.cpp:
1179         * runtime/DatePrototype.cpp:
1180         (JSC::formatLocaleDate):
1181
1182 2009-06-19  Oliver Hunt  <oliver@apple.com>
1183
1184         Reviewed by Maciej Stachowiak.
1185
1186         <rdar://problem/6988973> ScopeChain leak in interpreter builds
1187
1188         Move the Scopechain destruction code in JSFunction outside of the ENABLE(JIT)
1189         path.
1190
1191         * runtime/JSFunction.cpp:
1192         (JSC::JSFunction::~JSFunction):
1193         * wtf/Platform.h:
1194
1195 2009-06-19  Yong Li  <yong.li@torchmobile.com>
1196
1197         Reviewed by George Staikos.
1198
1199         https://bugs.webkit.org/show_bug.cgi?id=26543
1200         Windows CE uses 'GetLastError' instead of 'errno.'
1201
1202         * interpreter/RegisterFile.h:
1203         (JSC::RegisterFile::RegisterFile):
1204         (JSC::RegisterFile::grow):
1205
1206 2009-06-19  David Levin  <levin@chromium.org>
1207
1208         Reviewed by NOBODY (Windows build fix).
1209
1210         Add export for Windows corresponding to OSX export done in r44844.
1211         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1212         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
1213
1214 2009-06-18  Oliver Hunt  <oliver@apple.com>
1215
1216         Reviewed by Gavin "Viceroy of Venezuela" Barraclough.
1217
1218         Bug 26532: Native functions do not correctly unlink from optimised callsites when they're collected
1219         <https://bugs.webkit.org/show_bug.cgi?id=26532> <rdar://problem/6625385>
1220
1221         We need to make sure that each native function instance correctly unlinks any references to it
1222         when it is collected.  Allowing this to happen required a few changes:
1223             * Every native function needs a codeblock to track the link information
1224             * To have this codeblock, every function now also needs its own functionbodynode
1225               so we no longer get to have a single shared instance.
1226             * Identifying a host function is now done by looking for CodeBlock::codeType() == NativeCode
1227
1228         * JavaScriptCore.exp:
1229         * bytecode/CodeBlock.cpp:
1230         (JSC::CodeBlock::CodeBlock):
1231            Constructor for NativeCode CodeBlock
1232         (JSC::CodeBlock::derefStructures):
1233         (JSC::CodeBlock::refStructures):
1234         (JSC::CodeBlock::reparseForExceptionInfoIfNecessary):
1235         (JSC::CodeBlock::handlerForBytecodeOffset):
1236         (JSC::CodeBlock::lineNumberForBytecodeOffset):
1237         (JSC::CodeBlock::expressionRangeForBytecodeOffset):
1238         (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset):
1239         (JSC::CodeBlock::functionRegisterForBytecodeOffset):
1240         (JSC::CodeBlock::hasGlobalResolveInstructionAtBytecodeOffset):
1241         (JSC::CodeBlock::hasGlobalResolveInfoAtBytecodeOffset):
1242         (JSC::CodeBlock::setJITCode):
1243            Add assertions to ensure we don't try and use NativeCode CodeBlocks as
1244            a normal codeblock.
1245
1246         * bytecode/CodeBlock.h:
1247         (JSC::):
1248         (JSC::CodeBlock::source):
1249         (JSC::CodeBlock::sourceOffset):
1250         (JSC::CodeBlock::evalCodeCache):
1251         (JSC::CodeBlock::createRareDataIfNecessary):
1252           More assertions.
1253
1254         * jit/JIT.cpp:
1255         (JSC::JIT::privateCompileCTIMachineTrampolines):
1256         (JSC::JIT::linkCall):
1257           Update logic to allow native function caching
1258
1259         * jit/JITStubs.cpp:
1260         * parser/Nodes.cpp:
1261         (JSC::FunctionBodyNode::createNativeThunk):
1262         (JSC::FunctionBodyNode::isHostFunction):
1263         * parser/Nodes.h:
1264         * runtime/JSFunction.cpp:
1265         (JSC::JSFunction::JSFunction):
1266         (JSC::JSFunction::~JSFunction):
1267         (JSC::JSFunction::mark):
1268         * runtime/JSGlobalData.cpp:
1269         (JSC::JSGlobalData::~JSGlobalData):
1270         * runtime/JSGlobalData.h:
1271
1272 2009-06-18  Gavin Barraclough  <barraclough@apple.com>
1273
1274         Reviewed by NOBODY (Windows build fix).
1275
1276         * wtf/DateMath.cpp:
1277         (WTF::calculateUTCOffset):
1278
1279 2009-06-18  Gavin Barraclough  <barraclough@apple.com>
1280
1281         Reviewed by Geoff Garen.
1282
1283         Timezone calculation incorrect in Venezuela.
1284
1285         https://bugs.webkit.org/show_bug.cgi?id=26531
1286         <rdar://problem/6646169> Time is incorrectly reported to JavaScript in both Safari 3 and Firefox 3
1287
1288         The problem is that we're calculating the timezone relative to 01/01/2000,
1289         but the VET timezone changed from -4 hours to -4:30 hours on 12/09/2007.
1290         According to the spec, section 15.9.1.9 states "the time since the beginning
1291         of the year", presumably meaning the *current* year.  Change the calculation
1292         to be based on whatever the current year is, rather than a canned date.
1293
1294         No performance impact.
1295
1296         * wtf/DateMath.cpp:
1297         (WTF::calculateUTCOffset):
1298
1299 2009-06-18  Gavin Barraclough  <barraclough@apple.com>
1300
1301         Rubber Stamped by Mark Rowe (originally reviewed by Sam Weinig).
1302
1303         (Reintroducing patch added in r44492, and reverted in r44796.)
1304
1305         Change the implementation of op_throw so the stub function always modifies its
1306         return address - if it doesn't find a 'catch' it will switch to a trampoline
1307         to force a return from JIT execution.  This saves memory, by avoiding the need
1308         for a unique return for every op_throw.
1309
1310         * jit/JITOpcodes.cpp:
1311         (JSC::JIT::emit_op_throw):
1312             JITStubs::cti_op_throw now always changes its return address,
1313             remove return code generated after the stub call (this is now
1314             handled by ctiOpThrowNotCaught).
1315         * jit/JITStubs.cpp:
1316         (JSC::):
1317             Add ctiOpThrowNotCaught definitions.
1318         (JSC::JITStubs::DEFINE_STUB_FUNCTION):
1319             Change cti_op_throw to always change its return address.
1320         * jit/JITStubs.h:
1321             Add ctiOpThrowNotCaught declaration.
1322
1323 2009-06-18  Kevin McCullough  <kmccullough@apple.com>
1324
1325         Reviewed by Oliver Hunt.
1326
1327         <rdar://problem/6940880> REGRESSION: Breakpoints don't break in 64-bit
1328
1329         - Exposed functions now needed by WebCore.
1330
1331         * JavaScriptCore.exp:
1332
1333 2009-06-17  Darin Adler  <darin@apple.com>
1334
1335         Reviewed by Oliver Hunt.
1336
1337         Bug 26429: Make JSON.stringify non-recursive so it can handle objects
1338         of arbitrary complexity
1339         https://bugs.webkit.org/show_bug.cgi?id=26429
1340
1341         For marking I decided not to use gcProtect, because this is inside the engine
1342         so it's easy enough to just do marking. And that darned gcProtect does locking!
1343         Oliver tried to convince me to used MarkedArgumentBuffer, but the constructor
1344         for that class says "FIXME: Remove all clients of this API, then remove this API."
1345
1346         * runtime/Collector.cpp:
1347         (JSC::Heap::collect): Add a call to JSONObject::markStringifiers.
1348
1349         * runtime/CommonIdentifiers.cpp:
1350         (JSC::CommonIdentifiers::CommonIdentifiers): Added emptyIdentifier.
1351         * runtime/CommonIdentifiers.h: Ditto.
1352
1353         * runtime/JSGlobalData.cpp:
1354         (JSC::JSGlobalData::JSGlobalData): Initialize firstStringifierToMark to 0.
1355         * runtime/JSGlobalData.h: Added firstStringifierToMark.
1356
1357         * runtime/JSONObject.cpp: Cut down the includes to the needed ones only.
1358         (JSC::unwrapNumberOrString): Added. Helper for unwrapping number and string
1359         objects to get their number and string values.
1360         (JSC::ReplacerPropertyName::ReplacerPropertyName): Added. The class is used
1361         to wrap an identifier or integer so we don't have to do any work unless we
1362         actually call a replacer.
1363         (JSC::ReplacerPropertyName::value): Added.
1364         (JSC::gap): Added. Helper function for the Stringifier constructor.
1365         (JSC::PropertyNameForFunctionCall::PropertyNameForFunctionCall): Added.
1366         The class is used to wrap an identifier or integer so we don't have to
1367         allocate a number or string until we actually call toJSON or a replacer.
1368         (JSC::PropertyNameForFunctionCall::asJSValue): Added.
1369         (JSC::Stringifier::Stringifier): Updated and moved out of the class
1370         definition. Added code to hook this into a singly linked list for marking.
1371         (JSC::Stringifier::~Stringifier): Remove from the singly linked list.
1372         (JSC::Stringifier::mark): Mark all the objects in the holder stacks.
1373         (JSC::Stringifier::stringify): Updated.
1374         (JSC::Stringifier::appendQuotedString): Tweaked and streamlined a bit.
1375         (JSC::Stringifier::toJSON): Renamed from toJSONValue.
1376         (JSC::Stringifier::appendStringifiedValue): Renamed from stringify.
1377         Added code to use the m_holderStack to do non-recursive stringify of
1378         objects and arrays. This code also uses the timeout checker since in
1379         pathological cases it could be slow even without calling into the
1380         JavaScript virtual machine.
1381         (JSC::Stringifier::willIndent): Added.
1382         (JSC::Stringifier::indent): Added.
1383         (JSC::Stringifier::unindent): Added.
1384         (JSC::Stringifier::startNewLine): Added.
1385         (JSC::Stringifier::Holder::Holder): Added.
1386         (JSC::Stringifier::Holder::appendNextProperty): Added. This is the
1387         function that handles the format of arrays and objects.
1388         (JSC::JSONObject::getOwnPropertySlot): Moved this down to the bottom
1389         of the file so the JSONObject class is not interleaved with the
1390         Stringifier class.
1391         (JSC::JSONObject::markStringifiers): Added. Calls mark.
1392         (JSC::JSONProtoFuncStringify): Streamlined the code here. The code
1393         to compute the gap string is now a separate function.
1394
1395         * runtime/JSONObject.h: Made everything private. Added markStringifiers.
1396
1397 2009-06-17  Oliver Hunt  <oliver@apple.com>
1398
1399         Reviewed by Gavin Barraclough.
1400
1401         <rdar://problem/6974140> REGRESSION(r43849): Crash in cti_op_call_NotJSFunction when getting directions on maps.google.com
1402
1403         Roll out r43849 as it appears that we cannot rely on the address of
1404         an objects property storage being constant even if the structure is
1405         unchanged.
1406
1407         * jit/JIT.h:
1408         * jit/JITPropertyAccess.cpp:
1409         (JSC::JIT::compileGetDirectOffset):
1410         (JSC::JIT::privateCompileGetByIdProto):
1411         (JSC::JIT::privateCompileGetByIdProtoList):
1412         (JSC::JIT::privateCompileGetByIdChainList):
1413         (JSC::JIT::privateCompileGetByIdChain):
1414
1415 2009-06-17  Gavin Barraclough  <barraclough@apple.com>
1416
1417         Rubber Stamped by Mark Rowe.
1418
1419         Fully revert r44492 & r44748 while we fix a bug they cause on internal builds <rdar://problem/6955963>.
1420
1421         * jit/JITOpcodes.cpp:
1422         (JSC::JIT::emit_op_throw):
1423         * jit/JITStubs.cpp:
1424         (JSC::):
1425         (JSC::JITStubs::DEFINE_STUB_FUNCTION):
1426         * jit/JITStubs.h:
1427
1428 2009-06-17  Gavin Barraclough  <barraclough@apple.com>
1429
1430         Reviewed by Mark Rowe.
1431
1432         <rdar://problem/6947426> sunspider math-cordic.js exhibits different intermediate results running 32-bit vs. 64-bit
1433
1434         On 64-bit, NaN-encoded values must be detagged before they can be used in rshift.
1435
1436         No performance impact.
1437
1438         * jit/JITArithmetic.cpp:
1439         (JSC::JIT::emit_op_rshift):
1440
1441 2009-06-17  Adam Treat  <adam.treat@torchmobile.com>
1442
1443         Reviewed by George Staikos.
1444
1445         https://bugs.webkit.org/show_bug.cgi?id=23155
1446         Move WIN_CE -> WINCE as previously discussed with Qt WINCE folks.
1447
1448         * jsc.cpp:
1449         (main):
1450
1451 2009-06-17  George Staikos  <george.staikos@torchmobile.com>
1452
1453         Reviewed by Adam Treat.
1454
1455         https://bugs.webkit.org/show_bug.cgi?id=23155
1456         Move WIN_CE -> WINCE as previously discussed with Qt WINCE folks.
1457
1458         * config.h:
1459         * jsc.cpp:
1460         * wtf/Assertions.cpp:
1461         * wtf/Assertions.h:
1462         * wtf/CurrentTime.cpp:
1463         (WTF::lowResUTCTime):
1464         * wtf/DateMath.cpp:
1465         (WTF::getLocalTime):
1466         * wtf/MathExtras.h:
1467         * wtf/Platform.h:
1468         * wtf/StringExtras.h:
1469         * wtf/Threading.h:
1470         * wtf/win/MainThreadWin.cpp:
1471
1472 2009-06-17  Gavin Barraclough  <barraclough@apple.com>
1473
1474         Reviewed by Oliver Hunt.
1475
1476         <rdar://problem/6974175> ASSERT in JITStubs.cpp at appsaccess.apple.com
1477
1478         Remove PropertySlot::putValue - PropertySlots should only be used for getting,
1479         not putting.  Rename JSGlobalObject::getOwnPropertySlot to hasOwnPropertyForWrite,
1480         which is what it really was being used to ask, and remove some other getOwnPropertySlot
1481         & getOwnPropertySlotForWrite methods, which were unused and likely to lead to confusion.
1482
1483         * runtime/JSGlobalObject.h:
1484         (JSC::JSGlobalObject::hasOwnPropertyForWrite):
1485         * runtime/JSObject.h:
1486         * runtime/JSStaticScopeObject.cpp:
1487         * runtime/JSStaticScopeObject.h:
1488         * runtime/PropertySlot.h:
1489
1490 2009-06-16  Gavin Barraclough  <barraclough@apple.com>
1491
1492         Reviewed by Oliver hunt.
1493
1494         Temporarily partially disable r44492, since this is causing some problems on internal builds.
1495
1496         * jit/JITOpcodes.cpp:
1497         (JSC::JIT::emit_op_throw):
1498         * jit/JITStubs.cpp:
1499         (JSC::JITStubs::DEFINE_STUB_FUNCTION):
1500
1501 2009-06-16  Sam Weinig  <sam@webkit.org>
1502
1503         Fix windows build.
1504
1505         * jit/JIT.cpp:
1506         (JSC::JIT::JIT):
1507
1508 2009-06-16  Sam Weinig  <sam@webkit.org>
1509
1510         Reviewed by Oliver Hunt.
1511
1512         Initialize m_bytecodeIndex to -1 in JIT, and correctly initialize
1513         it for each type of stub using the return address to find the correct
1514         offset.
1515
1516         * jit/JIT.cpp:
1517         (JSC::JIT::JIT):
1518         * jit/JIT.h:
1519         (JSC::JIT::compileGetByIdProto):
1520         (JSC::JIT::compileGetByIdSelfList):
1521         (JSC::JIT::compileGetByIdProtoList):
1522         (JSC::JIT::compileGetByIdChainList):
1523         (JSC::JIT::compileGetByIdChain):
1524         (JSC::JIT::compilePutByIdTransition):
1525         (JSC::JIT::compileCTIMachineTrampolines):
1526         (JSC::JIT::compilePatchGetArrayLength):
1527         * jit/JITStubCall.h:
1528         (JSC::JITStubCall::call):
1529
1530 == Rolled over to ChangeLog-2009-06-16 ==