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