037b84c44b7f368bd8a27e90d6a3c680748e9bc1
[WebKit.git] / JavaScriptCore / ChangeLog
1 2009-06-30  Kwang Yul Seo  <skyul@company100.net>
2
3         Reviewed by Eric Seidel.
4
5         Override operator new/delete with const std::nothrow_t& as the second
6         argument.
7         https://bugs.webkit.org/show_bug.cgi?id=26792
8
9         On Windows CE, operator new/delete, new[]/delete[] with const
10         std::nothrow_t& must be overrided because some standard template
11         libraries use these operators.
12
13         The problem occurs when memory allocated by new(size_t s, const
14         std::nothrow_t&) is freed by delete(void* p). This causes the umatched
15         malloc/free problem.
16
17         The patch overrides all new, delete, new[] and delete[] to use
18         fastMaloc and fastFree consistently.
19
20         * wtf/FastMalloc.h:
21         (throw):
22
23 2009-06-30  Gabor Loki  <loki@inf.u-szeged.hu>
24
25         Reviewed by Sam Weinig.
26
27         <https://bugs.webkit.org/show_bug.cgi?id=24986>
28
29         Remove unnecessary references to AssemblerBuffer.
30
31         * interpreter/Interpreter.cpp:
32         * interpreter/Interpreter.h:
33
34 2009-06-29  David Levin  <levin@chromium.org>
35
36         Reviewed by Oliver Hunt.
37
38         Still seeing occasional leaks from UString::sharedBuffer code
39         https://bugs.webkit.org/show_bug.cgi?id=26420
40
41         The problem is that the pointer to the memory allocation isn't visible
42         by "leaks" due to the lower bits being used as flags.  The fix is to
43         make the pointer visible in memory (in debug only). The downside of
44         this fix that the memory allocated by sharedBuffer will still look like
45         a leak in non-debug builds when any flags are set.
46
47         * wtf/PtrAndFlags.h:
48         (WTF::PtrAndFlags::set):
49
50 2009-06-29  Sam Weinig  <sam@webkit.org>
51
52         Reviewed by Mark Rowe.
53
54         Remove more unused scons support.
55
56         * SConstruct: Removed.
57
58 2009-06-29  Oliver Hunt  <oliver@apple.com>
59
60         Reviewed by Gavin Barraclough.
61
62         <rdar://problem/7016214> JSON.parse fails to parse valid JSON with most Unicode characters
63         <https://bugs.webkit.org/show_bug.cgi?id=26802>
64
65         In the original JSON.parse patch unicode was handled correctly, however in some last
66         minute "clean up" I oversimplified isSafeStringCharacter.  This patch corrects this bug.
67
68         * runtime/LiteralParser.cpp:
69         (JSC::isSafeStringCharacter):
70         (JSC::LiteralParser::Lexer::lexString):
71
72 2009-06-26  Oliver Hunt  <oliver@apple.com>
73
74         Reviewed by Dan Bernstein.
75
76         <rdar://problem/7009684> REGRESSION(r45039): Crashes inside JSEvent::put on PowerPC (26746)
77         <https://bugs.webkit.org/show_bug.cgi?id=26746>
78
79         Fix for r45039 incorrectly uncached a get_by_id by converting it to put_by_id.  Clearly this
80         is less than correct.  This patch corrects that error.
81
82         * interpreter/Interpreter.cpp:
83         (JSC::Interpreter::tryCacheGetByID):
84
85 2009-06-26  Eric Seidel  <eric@webkit.org>
86
87         No review, only rolling out r45259.
88
89         Roll out r45259 after crash appeared on the bots:
90         plugins/undefined-property-crash.html
91         ASSERTION FAILED: s <= HeapConstants<heapType>::cellSize
92         (leopard-intel-debug-tests/build/JavaScriptCore/runtime/Collector.cpp:278
93         void* JSC::Heap::heapAllocate(size_t) [with JSC::HeapType heapType = PrimaryHeap])
94
95         * runtime/DateInstance.cpp:
96         * runtime/Identifier.cpp:
97         * runtime/Lookup.h:
98         * runtime/RegExpConstructor.cpp:
99         * runtime/RegExpObject.h:
100         * runtime/ScopeChain.h:
101         * runtime/UString.h:
102
103 2009-06-26  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
104
105         Reviewed by Simon Hausmann.
106
107         Add support for QDataStream operators to Vector.
108
109         * wtf/Vector.h:
110         (WTF::operator<<):
111         (WTF::operator>>):
112
113 2009-06-24  Sam Weinig  <sam@webkit.org>
114
115         Reviewed by Gavin Barraclough.
116
117         Make the opcode sampler work once again.
118
119         * jit/JIT.h:
120         (JSC::JIT::compileGetByIdProto):
121         (JSC::JIT::compileGetByIdSelfList):
122         (JSC::JIT::compileGetByIdProtoList):
123         (JSC::JIT::compileGetByIdChainList):
124         (JSC::JIT::compileGetByIdChain):
125         (JSC::JIT::compilePutByIdTransition):
126         (JSC::JIT::compileCTIMachineTrampolines):
127         (JSC::JIT::compilePatchGetArrayLength):
128         * jit/JITStubCall.h:
129         (JSC::JITStubCall::call):
130
131 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
132
133         Reviewed by Maciej Stachowiak.
134
135         Extend FastAllocBase.h with 'using WTF::FastAllocBase' to avoid
136         unnecessary WTF:: usings.
137         Remove existing unnecessary WTF:: usings.
138
139         * interpreter/Interpreter.h:
140         * profiler/CallIdentifier.h:
141         * runtime/ScopeChain.h:
142         * wtf/FastAllocBase.h:
143
144 2009-06-24  David Levin  <levin@chromium.org>
145
146         Fix all builds.
147
148         * bytecode/CodeBlock.h:
149         * bytecompiler/BytecodeGenerator.h:
150         * interpreter/Register.h:
151
152 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
153
154         Reviewed by Maciej Stachowiak.
155         
156         https://bugs.webkit.org/show_bug.cgi?id=26677
157
158         Inherits CodeBlock class from FastAllocBase because it
159         has been instantiated by 'new' in JavaScriptCore/bytecode/CodeBlock.h:217.
160
161         * bytecode/CodeBlock.h:
162
163 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
164
165         Reviewed by Maciej Stachowiak.
166         
167         https://bugs.webkit.org/show_bug.cgi?id=26676
168
169         Inherits BytecodeGenerator class from FastAllocBase because it has been
170         instantiated by 'new' in JavaScriptCore/parser/Nodes.cpp:1892.
171
172         * bytecompiler/BytecodeGenerator.h:
173
174 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
175
176         Reviewed by Maciej Stachowiak.
177         
178         https://bugs.webkit.org/show_bug.cgi?id=26675
179
180         Inherits Register class from FastAllocBase because it has been
181         instantiated by 'new' in JavaScriptCore/runtime/JSVariableObject.h:149.
182
183         * interpreter/Register.h:
184
185 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
186
187         Reviewed by Darin Adler.
188         
189         https://bugs.webkit.org/show_bug.cgi?id=26674
190
191         Inherits HashMap class from FastAllocBase because it has been
192         instantiated by 'new' in JavaScriptCore/runtime/Structure.cpp:458.
193
194         * wtf/HashMap.h:
195
196 2009-06-24  Oliver Hunt  <oliver@apple.com>
197
198         Reviewed by Darin Adler.
199
200         <rdar://problem/6940519> REGRESSION (Safari 4 Public Beta - TOT): google.com/adplanner shows blank page instead of site details in "basic research'
201
202         The problem was caused by the page returned with a function using a
203         var declaration list containing around ~3000 variables.  The solution
204         to this is to flatten the comma expression representation and make
205         codegen comma expressions and initializer lists iterative rather than
206         recursive.
207
208         * parser/Grammar.y:
209         * parser/NodeConstructors.h:
210         (JSC::CommaNode::CommaNode):
211         * parser/Nodes.cpp:
212         (JSC::CommaNode::emitBytecode):
213         * parser/Nodes.h:
214         (JSC::ExpressionNode::isCommaNode):
215         (JSC::CommaNode::isCommaNode):
216         (JSC::CommaNode::append):
217
218 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
219
220         Reviewed by Maciej Stachowiak.
221
222         https://bugs.webkit.org/show_bug.cgi?id=26645
223
224         Inherits ScopeChainNode class from FastAllocBase because it has been
225         instantiated by 'new' in JavaScriptCore/runtime/ScopeChain.h:95.
226
227         * wtf/RefPtr.h:
228
229 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
230
231         Reviewed by Darin Adler.
232
233         https://bugs.webkit.org/show_bug.cgi?id=26648
234
235         Inherits Deque class from FastAllocBase because it has been
236         instantiated by 'new' with DEFINE_STATIC_LOCAL macro in 
237         JavaScriptCore/wtf/MainThread.cpp:62.
238
239         * wtf/Deque.h:
240
241 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
242
243         Reviewed by Darin Adler.
244
245         https://bugs.webkit.org/show_bug.cgi?id=26644
246
247         Inherits RefPtr class from FastAllocBase because it has been
248         instantiated by 'new' in JavaScriptCore/runtime/StructureChain.cpp:41.
249
250         * wtf/RefPtr.h:
251
252 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
253
254         Reviewed by Darin Adler.
255
256         Inherits HashSet class from FastAllocBase, because it has been
257         instantiated by 'new' in JavaScriptCore/runtime/Collector.h:116.
258
259         * wtf/HashSet.h:
260
261 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
262
263         Reviewed by Darin Adler.
264
265         Inherits Vector class from FastAllocBase because it has been
266         instantiated by 'new' in JavaScriptCore/runtime/Structure.cpp:633.
267
268         * wtf/Vector.h:
269
270 2009-06-24  Norbert Leser  <norbert.leser@nokia.com>
271
272         Reviewed by Maciej Stachoviak.
273
274         The BytecodeGenerator objects were instantiated on stack, which takes up ~38kB per instance
275         (each instance includes copy of JSC::CodeBlock with large SymbolTable, etc.).
276         Specifically, since there is nested invocation (e.g., GlobalCode --> FunctionCode),
277         the stack overflows immediately on Symbian hardware (max. 80 kB).
278         Proposed change allocates generator objects on heap.
279         Performance impact (if any) should be negligible and change is proposed as general fix,
280         rather than ifdef'd for SYMBIAN.
281
282         * parser/Nodes.cpp:
283         (JSC::ProgramNode::generateBytecode):
284         (JSC::EvalNode::generateBytecode):
285         (JSC::EvalNode::bytecodeForExceptionInfoReparse):
286         (JSC::FunctionBodyNode::generateBytecode):
287         (JSC::FunctionBodyNode::bytecodeForExceptionInfoReparse):
288
289 2009-06-23  Oliver Hunt  <oliver@apple.com>
290
291         Reviewed by Gavin Barraclough.
292
293         <rdar://problem/6992806> REGRESSION: Enumeration can skip new properties in cases of prototypes that have more than 64 (26593)
294         <https://bugs.webkit.org/show_bug.cgi?id=26593>
295
296         Do not attempt to cache structure chains if they contain a dictionary at any level.
297
298         * interpreter/Interpreter.cpp:
299         (JSC::Interpreter::tryCachePutByID):
300         (JSC::Interpreter::tryCacheGetByID):
301         * jit/JITStubs.cpp:
302         (JSC::JITThunks::tryCachePutByID):
303         * runtime/Structure.cpp:
304         (JSC::Structure::getEnumerablePropertyNames):
305         (JSC::Structure::addPropertyTransition):
306         * runtime/StructureChain.cpp:
307         (JSC::StructureChain::isCacheable):
308         * runtime/StructureChain.h:
309
310 2009-06-23  Yong Li  <yong.li@torchmobile.com>
311
312         Reviewed by George Staikos.
313
314         https://bugs.webkit.org/show_bug.cgi?id=26654
315         Add the proper export define for the JavaScriptCore API when building for WINCE.
316
317         * API/JSBase.h:
318
319 2009-06-23  Joe Mason  <joe.mason@torchmobile.com>
320
321         Reviewed by Adam Treat.
322
323         Authors: Yong Li <yong.li@torchmobile.com>, Joe Mason <joe.mason@torchmobile.com>
324
325         https://bugs.webkit.org/show_bug.cgi?id=26611
326         Implement currentThreadStackBase on WINCE by adding a global,
327         g_stackBase, which must be set to the address of a local variable
328         by the caller before calling any WebKit function that invokes JSC.
329
330         * runtime/Collector.cpp:
331         (JSC::isPageWritable):
332         (JSC::getStackBase):
333           Starts at the top of the stack and returns the entire range of
334           consecutive writable pages as an estimate of the actual stack.
335           This will be much bigger than the actual stack range, so some
336           dead objects can't be collected, but it guarantees live objects
337           aren't collected prematurely.
338
339         (JSC::currentThreadStackBase):
340           On WinCE, returns g_stackBase if set or call getStackBase as a
341           fallback if not.
342
343 2009-06-23  Oliver Hunt  <oliver@apple.com>
344
345         Reviewed by Alexey Proskuryakov.
346
347         Fix stupid performance problem in the LiteralParser
348
349         The LiteralParser was making a new UString in order to use
350         toDouble, however UString's toDouble allows a much wider range
351         of numberic strings than the LiteralParser accepts, and requires
352         an additional heap allocation or two for the construciton of the
353         UString.  To rectify this we just call WTF::dtoa directly using
354         a stack allocated buffer to hold the validated numeric literal.
355
356         * runtime/LiteralParser.cpp:
357         (JSC::LiteralParser::Lexer::lexNumber):
358         (JSC::LiteralParser::parse):
359         * runtime/LiteralParser.h:
360
361 2009-06-22  Oliver Hunt  <oliver@apple.com>
362
363         Reviewed by Alexey Proskuryakov.
364
365         Bug 26640: JSON.stringify needs to special case Boolean objects
366         <https://bugs.webkit.org/show_bug.cgi?id=26640>
367
368         Add special case handling of the Boolean object so we match current
369         ES5 errata.
370
371         * runtime/JSONObject.cpp:
372         (JSC::unwrapBoxedPrimitive): renamed from unwrapNumberOrString
373         (JSC::gap):
374         (JSC::Stringifier::appendStringifiedValue):
375
376 2009-06-22  Oliver Hunt  <oliver@apple.com>
377
378         Reviewed by Darin Adler.
379
380         Bug 26591: Support revivers in JSON.parse
381         <https://bugs.webkit.org/show_bug.cgi?id=26591>
382
383         Add reviver support to JSON.parse.  This completes the JSON object.
384
385         * runtime/JSONObject.cpp:
386         (JSC::Walker::Walker):
387         (JSC::Walker::callReviver):
388         (JSC::Walker::walk):
389         (JSC::JSONProtoFuncParse):
390
391 2009-06-21  Oliver Hunt  <oliver@apple.com>
392
393         Reviewed by Darin Adler.
394
395         Bug 26592: Support standard toJSON functions
396         <https://bugs.webkit.org/show_bug.cgi?id=26592>
397
398         Add support for the standard Date.toJSON function.
399
400         * runtime/DatePrototype.cpp:
401         (JSC::dateProtoFuncToJSON):
402
403 2009-06-21  Oliver Hunt  <oliver@apple.com>
404
405         Reviewed by Sam Weinig.
406
407         Bug 26594: JSC needs to support Date.toISOString
408         <https://bugs.webkit.org/show_bug.cgi?id=26594>
409
410         Add support for Date.toISOString.
411
412         * runtime/DatePrototype.cpp:
413         (JSC::dateProtoFuncToISOString):
414
415 2009-06-21  Oliver Hunt  <oliver@apple.com>
416
417         Reviewed by NOBODY (Build fix).
418
419         Remove dead code.
420
421         * runtime/LiteralParser.cpp:
422         (JSC::LiteralParser::parse):
423
424 2009-06-21  Oliver Hunt  <oliver@apple.com>
425
426         Reviewed by Darin Adler and Cameron Zwarich.
427
428         Bug 26587: Support JSON.parse
429         <https://bugs.webkit.org/show_bug.cgi?id=26587>
430
431         Extend the LiteralParser to support the full strict JSON
432         grammar, fix a few places where the grammar was incorrectly
433         lenient.   Doesn't yet support the JSON.parse reviver function
434         but that does not block the JSON.parse functionality itself.
435
436         * interpreter/Interpreter.cpp:
437         (JSC::Interpreter::callEval):
438         * runtime/JSGlobalObjectFunctions.cpp:
439         (JSC::globalFuncEval):
440         * runtime/JSONObject.cpp:
441         (JSC::JSONProtoFuncParse):
442         * runtime/LiteralParser.cpp:
443         (JSC::LiteralParser::Lexer::lex):
444         (JSC::isSafeStringCharacter):
445         (JSC::LiteralParser::Lexer::lexString):
446         (JSC::LiteralParser::parse):
447         * runtime/LiteralParser.h:
448         (JSC::LiteralParser::LiteralParser):
449         (JSC::LiteralParser::tryJSONParse):
450         (JSC::LiteralParser::):
451         (JSC::LiteralParser::Lexer::Lexer):
452
453 2009-06-21  David Levin  <levin@chromium.org>
454
455         Reviewed by NOBODY (speculative build fix for windows).
456
457         Simply removed some whitespace form this file to make windows build wtf and
458         hopefully copy the new MessageQueque.h so that WebCore picks it up.
459
460         * wtf/Assertions.cpp:
461
462 2009-06-21  Drew Wilson  <atwilson@google.com>
463
464         Reviewed by David Levin.
465
466         <https://bugs.webkit.org/show_bug.cgi?id=25043>
467         Added support for multi-threaded MessagePorts.
468
469         * wtf/MessageQueue.h:
470         (WTF::::appendAndCheckEmpty):
471             Added API to test whether the queue was empty before adding an element.
472   
473 2009-06-20  David D. Kilzer  <ddkilzer@webkit.org>
474
475         Fix namespace comment in SegmentedVector.h
476
477         * wtf/SegmentedVector.h: Updated namespace comment to reflect
478         new namespace after r44897.
479
480 2009-06-20  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
481
482         Bug 24986: ARM JIT port
483         <https://bugs.webkit.org/show_bug.cgi?id=24986>
484
485         Reviewed by Oliver Hunt.
486
487         An Iterator added for SegmentedVector. Currently
488         only the pre ++ operator is supported.
489
490         * wtf/SegmentedVector.h:
491         (WTF::SegmentedVectorIterator::~SegmentedVectorIterator):
492         (WTF::SegmentedVectorIterator::operator*):
493         (WTF::SegmentedVectorIterator::operator->):
494         (WTF::SegmentedVectorIterator::operator++):
495         (WTF::SegmentedVectorIterator::operator==):
496         (WTF::SegmentedVectorIterator::operator!=):
497         (WTF::SegmentedVectorIterator::operator=):
498         (WTF::SegmentedVectorIterator::SegmentedVectorIterator):
499         (WTF::SegmentedVector::alloc):
500         (WTF::SegmentedVector::begin):
501         (WTF::SegmentedVector::end):
502
503 2009-06-20  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
504
505         Bug 24986: ARM JIT port
506         <https://bugs.webkit.org/show_bug.cgi?id=24986>
507
508         Reviewed by Oliver Hunt.
509
510         Move SegmentedVector to /wtf subdirectory
511         and change "namespace JSC" to "namespace WTF"
512
513         Additional build file updates by David Kilzer.
514
515         * GNUmakefile.am: Updated path to SegmentedVector.h.
516         * JavaScriptCore.order: Updated SegmentedVector namespace from
517         JSC to WTF in mangled C++ method name.
518         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
519         Removed reference to bytecompiler\SegmentedVector.h.
520         * JavaScriptCore.vcproj/WTF/WTF.vcproj: Added reference to
521         wtf\SegmentedVector.h.
522         * JavaScriptCore.xcodeproj/project.pbxproj: Moved
523         SegmentedVector.h definition from bytecompiler subdirectory to
524         wtf subdirectory.
525         * bytecompiler/BytecodeGenerator.h: Updated #include path to
526         SegmentedVector.h and prepended WTF:: namespace to its use.
527         * parser/Lexer.h: Ditto.
528         * wtf/SegmentedVector.h: Renamed from JavaScriptCore/bytecompiler/SegmentedVector.h.
529         (WTF::SegmentedVector::SegmentedVector):
530         (WTF::SegmentedVector::~SegmentedVector):
531         (WTF::SegmentedVector::size):
532         (WTF::SegmentedVector::at):
533         (WTF::SegmentedVector::operator[]):
534         (WTF::SegmentedVector::last):
535         (WTF::SegmentedVector::append):
536         (WTF::SegmentedVector::removeLast):
537         (WTF::SegmentedVector::grow):
538         (WTF::SegmentedVector::clear):
539         (WTF::SegmentedVector::deleteAllSegments):
540         (WTF::SegmentedVector::segmentExistsFor):
541         (WTF::SegmentedVector::segmentFor):
542         (WTF::SegmentedVector::subscriptFor):
543         (WTF::SegmentedVector::ensureSegmentsFor):
544         (WTF::SegmentedVector::ensureSegment):
545
546 2009-06-19  Gavin Barraclough  <barraclough@apple.com>
547
548         Reviewed by NOBODY (build fix take 2 - rename FIELD_OFFSET to something that doesn't conflict with winnt.h).
549
550         * jit/JIT.cpp:
551         (JSC::JIT::privateCompile):
552         (JSC::JIT::privateCompileCTIMachineTrampolines):
553         (JSC::JIT::emitGetVariableObjectRegister):
554         (JSC::JIT::emitPutVariableObjectRegister):
555         * jit/JIT.h:
556         * jit/JITArithmetic.cpp:
557         (JSC::JIT::emit_op_rshift):
558         (JSC::JIT::emitSlow_op_jnless):
559         (JSC::JIT::emitSlow_op_jnlesseq):
560         (JSC::JIT::compileBinaryArithOp):
561         * jit/JITCall.cpp:
562         (JSC::JIT::compileOpCallInitializeCallFrame):
563         (JSC::JIT::compileOpCall):
564         * jit/JITInlineMethods.h:
565         (JSC::JIT::restoreArgumentReference):
566         (JSC::JIT::checkStructure):
567         * jit/JITOpcodes.cpp:
568         (JSC::JIT::emit_op_instanceof):
569         (JSC::JIT::emit_op_get_scoped_var):
570         (JSC::JIT::emit_op_put_scoped_var):
571         (JSC::JIT::emit_op_construct_verify):
572         (JSC::JIT::emit_op_resolve_global):
573         (JSC::JIT::emit_op_jeq_null):
574         (JSC::JIT::emit_op_jneq_null):
575         (JSC::JIT::emit_op_to_jsnumber):
576         (JSC::JIT::emit_op_catch):
577         (JSC::JIT::emit_op_eq_null):
578         (JSC::JIT::emit_op_neq_null):
579         (JSC::JIT::emit_op_convert_this):
580         (JSC::JIT::emit_op_profile_will_call):
581         (JSC::JIT::emit_op_profile_did_call):
582         (JSC::JIT::emitSlow_op_get_by_val):
583         * jit/JITPropertyAccess.cpp:
584         (JSC::JIT::emit_op_get_by_val):
585         (JSC::JIT::emit_op_put_by_val):
586         (JSC::JIT::emit_op_method_check):
587         (JSC::JIT::compileGetByIdHotPath):
588         (JSC::JIT::emit_op_put_by_id):
589         (JSC::JIT::compilePutDirectOffset):
590         (JSC::JIT::compileGetDirectOffset):
591         (JSC::JIT::privateCompilePutByIdTransition):
592         (JSC::JIT::privateCompilePatchGetArrayLength):
593         * jit/JITStubs.cpp:
594         (JSC::JITThunks::JITThunks):
595
596 2009-06-19  Gavin Barraclough  <barraclough@apple.com>
597
598         Reviewed by NOBODY (Windows build fix).
599
600         * jit/JIT.h:
601         * jit/JITInlineMethods.h:
602
603 2009-06-19  Gabor Loki  <loki@inf.u-szeged.hu>
604
605         Reviewed by Gavin Barraclough.
606
607         Reorganize ARM architecture specific macros.
608         Use PLATFORM_ARM_ARCH(7) instead of PLATFORM(ARM_V7).
609
610         Bug 24986: ARM JIT port
611         <https://bugs.webkit.org/show_bug.cgi?id=24986>
612
613         * assembler/ARMv7Assembler.h:
614         * assembler/AbstractMacroAssembler.h:
615         (JSC::AbstractMacroAssembler::Imm32::Imm32):
616         * assembler/MacroAssembler.h:
617         * assembler/MacroAssemblerCodeRef.h:
618         (JSC::MacroAssemblerCodePtr::MacroAssemblerCodePtr):
619         * jit/ExecutableAllocator.h:
620         (JSC::ExecutableAllocator::cacheFlush):
621         * jit/JIT.h:
622         * jit/JITInlineMethods.h:
623         (JSC::JIT::restoreArgumentReferenceForTrampoline):
624         * jit/JITStubs.cpp:
625         * jit/JITStubs.h:
626         * wtf/Platform.h:
627         * yarr/RegexJIT.cpp:
628         (JSC::Yarr::RegexGenerator::generateEnter):
629         (JSC::Yarr::RegexGenerator::generateReturn):
630
631 2009-06-19  Gavin Barraclough  <barraclough@apple.com>
632
633         Reviewed by Oliver Hunt.
634
635         Fix armv7 JIT build issues.
636
637         Unfortunate the arm compiler does not like the use of offsetof on JITStackFrame (since it now contains non POD types),
638         and the FIELD_OFFSET macro does not appear constantish enough for it to be happy with its use in COMPILE_ASSERT macros.
639
640         * Replace offsetofs with FIELD_OFFSETs (safe on C++ objects).
641         * Move COMPILE_ASSERTs defending layout of JITStackFrame structure on armv7 into JITThunks constructor.
642
643         * jit/JIT.cpp:
644         * jit/JIT.h:
645         * jit/JITInlineMethods.h:
646         (JSC::JIT::restoreArgumentReference):
647         * jit/JITOpcodes.cpp:
648         (JSC::JIT::emit_op_catch):
649         * jit/JITStubs.cpp:
650         (JSC::JITThunks::JITThunks):
651
652 2009-06-19  Adam Treat  <adam.treat@torchmobile.com>
653
654         Blind attempt at build fix.
655
656         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
657         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
658
659 2009-06-19  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
660
661         Reviewed by Oliver Hunt.
662
663         Inherits CallIdentifier struct from FastAllocBase because it has been
664         instantiated by 'new' in JavaScriptCore/profiler/CallIdentifier.h:86.
665
666         * wtf/HashCountedSet.h:
667
668 2009-06-19  Adam Treat  <adam.treat@torchmobile.com>
669
670         Reviewed by Oliver Hunt.
671
672         https://bugs.webkit.org/show_bug.cgi?id=26540
673         Modify the test shell to add a new function 'checkSyntax' that will
674         only parse the source instead of executing it. In this way we can test
675         pure parsing performance against some of the larger scripts in the wild.
676
677         * jsc.cpp:
678         (GlobalObject::GlobalObject):
679         (functionCheckSyntax):
680
681 2009-06-19  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
682
683         Reviewed by Darin Adler.
684         
685         Inherits HashCountedSet class from FastAllocBase because it has been
686         instantiated by 'new' in JavaScriptCore/runtime/Collector.cpp:1095.
687
688         * wtf/HashCountedSet.h:
689
690 2009-06-19  Yong Li  <yong.li@torchmobile.com>
691
692         Reviewed by George Staikos.
693
694         https://bugs.webkit.org/show_bug.cgi?id=26558
695         Declare these symbols extern for WINCE as they are provided by libce.
696
697         * runtime/DateConstructor.cpp:
698         * runtime/DatePrototype.cpp:
699         (JSC::formatLocaleDate):
700
701 2009-06-19  Oliver Hunt  <oliver@apple.com>
702
703         Reviewed by Maciej Stachowiak.
704
705         <rdar://problem/6988973> ScopeChain leak in interpreter builds
706
707         Move the Scopechain destruction code in JSFunction outside of the ENABLE(JIT)
708         path.
709
710         * runtime/JSFunction.cpp:
711         (JSC::JSFunction::~JSFunction):
712         * wtf/Platform.h:
713
714 2009-06-19  Yong Li  <yong.li@torchmobile.com>
715
716         Reviewed by George Staikos.
717
718         https://bugs.webkit.org/show_bug.cgi?id=26543
719         Windows CE uses 'GetLastError' instead of 'errno.'
720
721         * interpreter/RegisterFile.h:
722         (JSC::RegisterFile::RegisterFile):
723         (JSC::RegisterFile::grow):
724
725 2009-06-19  David Levin  <levin@chromium.org>
726
727         Reviewed by NOBODY (Windows build fix).
728
729         Add export for Windows corresponding to OSX export done in r44844.
730         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
731         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
732
733 2009-06-18  Oliver Hunt  <oliver@apple.com>
734
735         Reviewed by Gavin "Viceroy of Venezuela" Barraclough.
736
737         Bug 26532: Native functions do not correctly unlink from optimised callsites when they're collected
738         <https://bugs.webkit.org/show_bug.cgi?id=26532> <rdar://problem/6625385>
739
740         We need to make sure that each native function instance correctly unlinks any references to it
741         when it is collected.  Allowing this to happen required a few changes:
742             * Every native function needs a codeblock to track the link information
743             * To have this codeblock, every function now also needs its own functionbodynode
744               so we no longer get to have a single shared instance.
745             * Identifying a host function is now done by looking for CodeBlock::codeType() == NativeCode
746
747         * JavaScriptCore.exp:
748         * bytecode/CodeBlock.cpp:
749         (JSC::CodeBlock::CodeBlock):
750            Constructor for NativeCode CodeBlock
751         (JSC::CodeBlock::derefStructures):
752         (JSC::CodeBlock::refStructures):
753         (JSC::CodeBlock::reparseForExceptionInfoIfNecessary):
754         (JSC::CodeBlock::handlerForBytecodeOffset):
755         (JSC::CodeBlock::lineNumberForBytecodeOffset):
756         (JSC::CodeBlock::expressionRangeForBytecodeOffset):
757         (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset):
758         (JSC::CodeBlock::functionRegisterForBytecodeOffset):
759         (JSC::CodeBlock::hasGlobalResolveInstructionAtBytecodeOffset):
760         (JSC::CodeBlock::hasGlobalResolveInfoAtBytecodeOffset):
761         (JSC::CodeBlock::setJITCode):
762            Add assertions to ensure we don't try and use NativeCode CodeBlocks as
763            a normal codeblock.
764
765         * bytecode/CodeBlock.h:
766         (JSC::):
767         (JSC::CodeBlock::source):
768         (JSC::CodeBlock::sourceOffset):
769         (JSC::CodeBlock::evalCodeCache):
770         (JSC::CodeBlock::createRareDataIfNecessary):
771           More assertions.
772
773         * jit/JIT.cpp:
774         (JSC::JIT::privateCompileCTIMachineTrampolines):
775         (JSC::JIT::linkCall):
776           Update logic to allow native function caching
777
778         * jit/JITStubs.cpp:
779         * parser/Nodes.cpp:
780         (JSC::FunctionBodyNode::createNativeThunk):
781         (JSC::FunctionBodyNode::isHostFunction):
782         * parser/Nodes.h:
783         * runtime/JSFunction.cpp:
784         (JSC::JSFunction::JSFunction):
785         (JSC::JSFunction::~JSFunction):
786         (JSC::JSFunction::mark):
787         * runtime/JSGlobalData.cpp:
788         (JSC::JSGlobalData::~JSGlobalData):
789         * runtime/JSGlobalData.h:
790
791 2009-06-18  Gavin Barraclough  <barraclough@apple.com>
792
793         Reviewed by NOBODY (Windows build fix).
794
795         * wtf/DateMath.cpp:
796         (WTF::calculateUTCOffset):
797
798 2009-06-18  Gavin Barraclough  <barraclough@apple.com>
799
800         Reviewed by Geoff Garen.
801
802         Timezone calculation incorrect in Venezuela.
803
804         https://bugs.webkit.org/show_bug.cgi?id=26531
805         <rdar://problem/6646169> Time is incorrectly reported to JavaScript in both Safari 3 and Firefox 3
806
807         The problem is that we're calculating the timezone relative to 01/01/2000,
808         but the VET timezone changed from -4 hours to -4:30 hours on 12/09/2007.
809         According to the spec, section 15.9.1.9 states "the time since the beginning
810         of the year", presumably meaning the *current* year.  Change the calculation
811         to be based on whatever the current year is, rather than a canned date.
812
813         No performance impact.
814
815         * wtf/DateMath.cpp:
816         (WTF::calculateUTCOffset):
817
818 2009-06-18  Gavin Barraclough  <barraclough@apple.com>
819
820         Rubber Stamped by Mark Rowe (originally reviewed by Sam Weinig).
821
822         (Reintroducing patch added in r44492, and reverted in r44796.)
823
824         Change the implementation of op_throw so the stub function always modifies its
825         return address - if it doesn't find a 'catch' it will switch to a trampoline
826         to force a return from JIT execution.  This saves memory, by avoiding the need
827         for a unique return for every op_throw.
828
829         * jit/JITOpcodes.cpp:
830         (JSC::JIT::emit_op_throw):
831             JITStubs::cti_op_throw now always changes its return address,
832             remove return code generated after the stub call (this is now
833             handled by ctiOpThrowNotCaught).
834         * jit/JITStubs.cpp:
835         (JSC::):
836             Add ctiOpThrowNotCaught definitions.
837         (JSC::JITStubs::DEFINE_STUB_FUNCTION):
838             Change cti_op_throw to always change its return address.
839         * jit/JITStubs.h:
840             Add ctiOpThrowNotCaught declaration.
841
842 2009-06-18  Kevin McCullough  <kmccullough@apple.com>
843
844         Reviewed by Oliver Hunt.
845
846         <rdar://problem/6940880> REGRESSION: Breakpoints don't break in 64-bit
847
848         - Exposed functions now needed by WebCore.
849
850         * JavaScriptCore.exp:
851
852 2009-06-17  Darin Adler  <darin@apple.com>
853
854         Reviewed by Oliver Hunt.
855
856         Bug 26429: Make JSON.stringify non-recursive so it can handle objects
857         of arbitrary complexity
858         https://bugs.webkit.org/show_bug.cgi?id=26429
859
860         For marking I decided not to use gcProtect, because this is inside the engine
861         so it's easy enough to just do marking. And that darned gcProtect does locking!
862         Oliver tried to convince me to used MarkedArgumentBuffer, but the constructor
863         for that class says "FIXME: Remove all clients of this API, then remove this API."
864
865         * runtime/Collector.cpp:
866         (JSC::Heap::collect): Add a call to JSONObject::markStringifiers.
867
868         * runtime/CommonIdentifiers.cpp:
869         (JSC::CommonIdentifiers::CommonIdentifiers): Added emptyIdentifier.
870         * runtime/CommonIdentifiers.h: Ditto.
871
872         * runtime/JSGlobalData.cpp:
873         (JSC::JSGlobalData::JSGlobalData): Initialize firstStringifierToMark to 0.
874         * runtime/JSGlobalData.h: Added firstStringifierToMark.
875
876         * runtime/JSONObject.cpp: Cut down the includes to the needed ones only.
877         (JSC::unwrapNumberOrString): Added. Helper for unwrapping number and string
878         objects to get their number and string values.
879         (JSC::ReplacerPropertyName::ReplacerPropertyName): Added. The class is used
880         to wrap an identifier or integer so we don't have to do any work unless we
881         actually call a replacer.
882         (JSC::ReplacerPropertyName::value): Added.
883         (JSC::gap): Added. Helper function for the Stringifier constructor.
884         (JSC::PropertyNameForFunctionCall::PropertyNameForFunctionCall): Added.
885         The class is used to wrap an identifier or integer so we don't have to
886         allocate a number or string until we actually call toJSON or a replacer.
887         (JSC::PropertyNameForFunctionCall::asJSValue): Added.
888         (JSC::Stringifier::Stringifier): Updated and moved out of the class
889         definition. Added code to hook this into a singly linked list for marking.
890         (JSC::Stringifier::~Stringifier): Remove from the singly linked list.
891         (JSC::Stringifier::mark): Mark all the objects in the holder stacks.
892         (JSC::Stringifier::stringify): Updated.
893         (JSC::Stringifier::appendQuotedString): Tweaked and streamlined a bit.
894         (JSC::Stringifier::toJSON): Renamed from toJSONValue.
895         (JSC::Stringifier::appendStringifiedValue): Renamed from stringify.
896         Added code to use the m_holderStack to do non-recursive stringify of
897         objects and arrays. This code also uses the timeout checker since in
898         pathological cases it could be slow even without calling into the
899         JavaScript virtual machine.
900         (JSC::Stringifier::willIndent): Added.
901         (JSC::Stringifier::indent): Added.
902         (JSC::Stringifier::unindent): Added.
903         (JSC::Stringifier::startNewLine): Added.
904         (JSC::Stringifier::Holder::Holder): Added.
905         (JSC::Stringifier::Holder::appendNextProperty): Added. This is the
906         function that handles the format of arrays and objects.
907         (JSC::JSONObject::getOwnPropertySlot): Moved this down to the bottom
908         of the file so the JSONObject class is not interleaved with the
909         Stringifier class.
910         (JSC::JSONObject::markStringifiers): Added. Calls mark.
911         (JSC::JSONProtoFuncStringify): Streamlined the code here. The code
912         to compute the gap string is now a separate function.
913
914         * runtime/JSONObject.h: Made everything private. Added markStringifiers.
915
916 2009-06-17  Oliver Hunt  <oliver@apple.com>
917
918         Reviewed by Gavin Barraclough.
919
920         <rdar://problem/6974140> REGRESSION(r43849): Crash in cti_op_call_NotJSFunction when getting directions on maps.google.com
921
922         Roll out r43849 as it appears that we cannot rely on the address of
923         an objects property storage being constant even if the structure is
924         unchanged.
925
926         * jit/JIT.h:
927         * jit/JITPropertyAccess.cpp:
928         (JSC::JIT::compileGetDirectOffset):
929         (JSC::JIT::privateCompileGetByIdProto):
930         (JSC::JIT::privateCompileGetByIdProtoList):
931         (JSC::JIT::privateCompileGetByIdChainList):
932         (JSC::JIT::privateCompileGetByIdChain):
933
934 2009-06-17  Gavin Barraclough  <barraclough@apple.com>
935
936         Rubber Stamped by Mark Rowe.
937
938         Fully revert r44492 & r44748 while we fix a bug they cause on internal builds <rdar://problem/6955963>.
939
940         * jit/JITOpcodes.cpp:
941         (JSC::JIT::emit_op_throw):
942         * jit/JITStubs.cpp:
943         (JSC::):
944         (JSC::JITStubs::DEFINE_STUB_FUNCTION):
945         * jit/JITStubs.h:
946
947 2009-06-17  Gavin Barraclough  <barraclough@apple.com>
948
949         Reviewed by Mark Rowe.
950
951         <rdar://problem/6947426> sunspider math-cordic.js exhibits different intermediate results running 32-bit vs. 64-bit
952
953         On 64-bit, NaN-encoded values must be detagged before they can be used in rshift.
954
955         No performance impact.
956
957         * jit/JITArithmetic.cpp:
958         (JSC::JIT::emit_op_rshift):
959
960 2009-06-17  Adam Treat  <adam.treat@torchmobile.com>
961
962         Reviewed by George Staikos.
963
964         https://bugs.webkit.org/show_bug.cgi?id=23155
965         Move WIN_CE -> WINCE as previously discussed with Qt WINCE folks.
966
967         * jsc.cpp:
968         (main):
969
970 2009-06-17  George Staikos  <george.staikos@torchmobile.com>
971
972         Reviewed by Adam Treat.
973
974         https://bugs.webkit.org/show_bug.cgi?id=23155
975         Move WIN_CE -> WINCE as previously discussed with Qt WINCE folks.
976
977         * config.h:
978         * jsc.cpp:
979         * wtf/Assertions.cpp:
980         * wtf/Assertions.h:
981         * wtf/CurrentTime.cpp:
982         (WTF::lowResUTCTime):
983         * wtf/DateMath.cpp:
984         (WTF::getLocalTime):
985         * wtf/MathExtras.h:
986         * wtf/Platform.h:
987         * wtf/StringExtras.h:
988         * wtf/Threading.h:
989         * wtf/win/MainThreadWin.cpp:
990
991 2009-06-17  Gavin Barraclough  <barraclough@apple.com>
992
993         Reviewed by Oliver Hunt.
994
995         <rdar://problem/6974175> ASSERT in JITStubs.cpp at appsaccess.apple.com
996
997         Remove PropertySlot::putValue - PropertySlots should only be used for getting,
998         not putting.  Rename JSGlobalObject::getOwnPropertySlot to hasOwnPropertyForWrite,
999         which is what it really was being used to ask, and remove some other getOwnPropertySlot
1000         & getOwnPropertySlotForWrite methods, which were unused and likely to lead to confusion.
1001
1002         * runtime/JSGlobalObject.h:
1003         (JSC::JSGlobalObject::hasOwnPropertyForWrite):
1004         * runtime/JSObject.h:
1005         * runtime/JSStaticScopeObject.cpp:
1006         * runtime/JSStaticScopeObject.h:
1007         * runtime/PropertySlot.h:
1008
1009 2009-06-16  Gavin Barraclough  <barraclough@apple.com>
1010
1011         Reviewed by Oliver hunt.
1012
1013         Temporarily partially disable r44492, since this is causing some problems on internal builds.
1014
1015         * jit/JITOpcodes.cpp:
1016         (JSC::JIT::emit_op_throw):
1017         * jit/JITStubs.cpp:
1018         (JSC::JITStubs::DEFINE_STUB_FUNCTION):
1019
1020 2009-06-16  Sam Weinig  <sam@webkit.org>
1021
1022         Fix windows build.
1023
1024         * jit/JIT.cpp:
1025         (JSC::JIT::JIT):
1026
1027 2009-06-16  Sam Weinig  <sam@webkit.org>
1028
1029         Reviewed by Oliver Hunt.
1030
1031         Initialize m_bytecodeIndex to -1 in JIT, and correctly initialize
1032         it for each type of stub using the return address to find the correct
1033         offset.
1034
1035         * jit/JIT.cpp:
1036         (JSC::JIT::JIT):
1037         * jit/JIT.h:
1038         (JSC::JIT::compileGetByIdProto):
1039         (JSC::JIT::compileGetByIdSelfList):
1040         (JSC::JIT::compileGetByIdProtoList):
1041         (JSC::JIT::compileGetByIdChainList):
1042         (JSC::JIT::compileGetByIdChain):
1043         (JSC::JIT::compilePutByIdTransition):
1044         (JSC::JIT::compileCTIMachineTrampolines):
1045         (JSC::JIT::compilePatchGetArrayLength):
1046         * jit/JITStubCall.h:
1047         (JSC::JITStubCall::call):
1048
1049 == Rolled over to ChangeLog-2009-06-16 ==