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