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