2009-12-08 Steve Block <steveblock@google.com>
[WebKit-https.git] / JavaScriptCore / ChangeLog
1 2009-12-08  Steve Block  <steveblock@google.com>
2
3         Reviewed by Adam Barth.
4
5         [Android] Adds Makefiles for Android port.
6         https://bugs.webkit.org/show_bug.cgi?id=31325
7
8         * Android.mk: Added.
9         * Android.v8.wtf.mk: Added.
10
11 2009-12-07  Dmitry Titov  <dimich@chromium.org>
12
13         Rubber-stamped by Darin Adler.
14
15         Remove ENABLE_SHARED_SCRIPT flags
16         https://bugs.webkit.org/show_bug.cgi?id=32245
17         This patch was obtained by "git revert" command and then un-reverting of ChangeLog files.
18
19         * Configurations/FeatureDefines.xcconfig:
20         * wtf/Platform.h:
21
22 2009-12-07  Gavin Barraclough  <barraclough@apple.com>
23
24         Reviewed by NOBODY (Windows build fixage part I).
25
26         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
27
28 2009-12-05  Gavin Barraclough  <barraclough@apple.com>
29
30         Reviewed by Oliver Hunt.
31
32         https://bugs.webkit.org/show_bug.cgi?id=32184
33         Handle out-of-memory conditions with JSC Ropes with a JS exception, rather than crashing.
34         Switch from using fastMalloc to tryFastMalloc, pass an ExecState to record the exception on.
35
36         * API/JSCallbackObjectFunctions.h:
37         (JSC::::toString):
38         * API/JSValueRef.cpp:
39         (JSValueIsStrictEqual):
40         * JavaScriptCore.exp:
41         * bytecompiler/BytecodeGenerator.cpp:
42         (JSC::BytecodeGenerator::emitEqualityOp):
43         * debugger/DebuggerCallFrame.cpp:
44         (JSC::DebuggerCallFrame::functionName):
45         (JSC::DebuggerCallFrame::calculatedFunctionName):
46         * interpreter/Interpreter.cpp:
47         (JSC::Interpreter::callEval):
48         (JSC::Interpreter::privateExecute):
49         * jit/JITStubs.cpp:
50         (JSC::DEFINE_STUB_FUNCTION):
51         * profiler/ProfileGenerator.cpp:
52         (JSC::ProfileGenerator::addParentForConsoleStart):
53         * profiler/Profiler.cpp:
54         (JSC::Profiler::willExecute):
55         (JSC::Profiler::didExecute):
56         (JSC::Profiler::createCallIdentifier):
57         (JSC::createCallIdentifierFromFunctionImp):
58         * profiler/Profiler.h:
59         * runtime/ArrayPrototype.cpp:
60         (JSC::arrayProtoFuncIndexOf):
61         (JSC::arrayProtoFuncLastIndexOf):
62         * runtime/DateConstructor.cpp:
63         (JSC::constructDate):
64         * runtime/FunctionPrototype.cpp:
65         (JSC::functionProtoFuncToString):
66         * runtime/InternalFunction.cpp:
67         (JSC::InternalFunction::name):
68         (JSC::InternalFunction::displayName):
69         (JSC::InternalFunction::calculatedDisplayName):
70         * runtime/InternalFunction.h:
71         * runtime/JSCell.cpp:
72         (JSC::JSCell::getString):
73         * runtime/JSCell.h:
74         (JSC::JSValue::getString):
75         * runtime/JSONObject.cpp:
76         (JSC::gap):
77         (JSC::Stringifier::Stringifier):
78         (JSC::Stringifier::appendStringifiedValue):
79         * runtime/JSObject.cpp:
80         (JSC::JSObject::putDirectFunction):
81         (JSC::JSObject::putDirectFunctionWithoutTransition):
82         (JSC::JSObject::defineOwnProperty):
83         * runtime/JSObject.h:
84         * runtime/JSPropertyNameIterator.cpp:
85         (JSC::JSPropertyNameIterator::get):
86         * runtime/JSString.cpp:
87         (JSC::JSString::Rope::~Rope):
88         (JSC::JSString::resolveRope):
89         (JSC::JSString::getPrimitiveNumber):
90         (JSC::JSString::toNumber):
91         (JSC::JSString::toString):
92         (JSC::JSString::toThisString):
93         (JSC::JSString::getStringPropertyDescriptor):
94         * runtime/JSString.h:
95         (JSC::JSString::Rope::createOrNull):
96         (JSC::JSString::Rope::operator new):
97         (JSC::JSString::value):
98         (JSC::JSString::tryGetValue):
99         (JSC::JSString::getIndex):
100         (JSC::JSString::getStringPropertySlot):
101         (JSC::JSValue::toString):
102         * runtime/JSValue.h:
103         * runtime/NativeErrorConstructor.cpp:
104         (JSC::NativeErrorConstructor::NativeErrorConstructor):
105         * runtime/Operations.cpp:
106         (JSC::JSValue::strictEqualSlowCase):
107         * runtime/Operations.h:
108         (JSC::JSValue::equalSlowCaseInline):
109         (JSC::JSValue::strictEqualSlowCaseInline):
110         (JSC::JSValue::strictEqual):
111         (JSC::jsLess):
112         (JSC::jsLessEq):
113         (JSC::jsAdd):
114         (JSC::concatenateStrings):
115         * runtime/PropertyDescriptor.cpp:
116         (JSC::PropertyDescriptor::equalTo):
117         * runtime/PropertyDescriptor.h:
118         * runtime/StringPrototype.cpp:
119         (JSC::stringProtoFuncReplace):
120         (JSC::stringProtoFuncToLowerCase):
121         (JSC::stringProtoFuncToUpperCase):
122
123 2009-12-07  Nikolas Zimmermann  <nzimmermann@rim.com>
124
125         Reviewed by Holger Freyther.
126
127         Turn on (SVG) Filters support, by default.
128         https://bugs.webkit.org/show_bug.cgi?id=32224
129
130         * Configurations/FeatureDefines.xcconfig: Enable FILTERS build flag.
131
132 2009-12-07  Steve Falkenburg  <sfalken@apple.com>
133
134         Build fix. Be flexible about which version of ICU is used on Windows.
135
136         * JavaScriptCore.vcproj/jsc/jscCommon.vsprops: Add optional xcopy commands to copy ICU 4.2.
137
138 2009-12-07  Maciej Stachowiak  <mjs@apple.com>
139
140         Reviewed by Oliver Hunt.
141
142         op_loop_if_less JIT codegen is broken for 64-bit
143         https://bugs.webkit.org/show_bug.cgi?id=32221
144
145         * jit/JITOpcodes.cpp:
146         (JSC::JIT::emit_op_loop_if_false): Fix codegen in this version - test was backwards.
147
148 2009-12-07  Oliver Hunt  <oliver@apple.com>
149
150         Reviewed by Maciej Stachowiak.
151
152         Object.create fails if properties on the descriptor are getters
153         https://bugs.webkit.org/show_bug.cgi?id=32219
154
155         Correctly initialise the PropertySlots with the descriptor object.
156
157         * runtime/ObjectConstructor.cpp:
158         (JSC::toPropertyDescriptor):
159
160 2009-12-06  Maciej Stachowiak  <mjs@apple.com>
161
162         Not reviewed, build fix.
163
164         Actually tested 64-bit *and* 32-bit build this time.
165
166         * jit/JITOpcodes.cpp:
167         (JSC::JIT::emit_op_loop_if_false):
168
169 2009-12-06  Maciej Stachowiak  <mjs@apple.com>
170
171         Not reviewed, build fix.
172
173         Really really fix 64-bit build for prior patch (actually tested this time).
174
175         * jit/JITOpcodes.cpp:
176         (JSC::JIT::emit_op_loop_if_false):
177         (JSC::JIT::emitSlow_op_loop_if_false):
178
179 2009-12-06  Maciej Stachowiak  <mjs@apple.com>
180
181         Not reviewed, build fix.
182
183         Really fix 64-bit build for prior patch.
184
185         * jit/JITArithmetic.cpp:
186         (JSC::JIT::emitSlow_op_jless):
187
188 2009-12-06  Maciej Stachowiak  <mjs@apple.com>
189
190         Not reviewed, build fix.
191
192         Fix 64-bit build for prior patch.
193
194         * jit/JITOpcodes.cpp:
195         (JSC::JIT::emitSlow_op_loop_if_less):
196
197 2009-12-05  Maciej Stachowiak  <mjs@apple.com>
198
199         Reviewed by Oliver Hunt.
200
201         conway benchmark spends half it's time in op_less (jump fusion fails)
202         https://bugs.webkit.org/show_bug.cgi?id=32190
203
204         <1% speedup on SunSpider and V8
205         2x speedup on "conway" benchmark
206         
207         Two optimizations:
208         1) Improve codegen for logical operators &&, || and ! in a condition context
209         
210         When generating code for combinations of &&, || and !, in a
211         condition context (i.e. in an if statement or loop condition), we
212         used to produce a value, and then separately jump based on its
213         truthiness. Now we pass the false and true targets in, and let the
214         logical operators generate jumps directly. This helps in four
215         ways:
216
217         a) Individual clauses of a short-circuit logical operator can now
218         jump directly to the then or else clause of an if statement (or to
219         the top or exit of a loop) instead of jumping to a jump.
220         
221         b) It used to be that jump fusion with the condition of the first
222         clause of a logical operator was inhibited, because the register
223         was ref'd to be used later, in the actual condition jump; this no
224         longer happens since a jump straight to the final target is
225         generated directly.
226
227         c) It used to be that jump fusion with the condition of the second
228         clause of a logical operator was inhibited, because there was a
229         jump target right after the second clause and before the actual
230         condition jump. But now it's no longer necessary for the first
231         clause to jump there so jump fusion is not blocked.
232
233         d) We avoid generating excess mov statements in some cases.
234         
235         As a concrete example this source:
236         
237         if (!((x < q && y < q) || (t < q && z < q))) {
238             // ...
239         }
240         
241         Used to generate this bytecode:
242         
243         [  34] less              r1, r-15, r-19
244         [  38] jfalse            r1, 7(->45)
245         [  41] less              r1, r-16, r-19
246         [  45] jtrue             r1, 14(->59)
247         [  48] less              r1, r-17, r-19
248         [  52] jfalse            r1, 7(->59)
249         [  55] less              r1, r-18, r-19
250         [  59] jtrue             r1, 17(->76)
251         
252         And now generates this bytecode (also taking advantage of the second optimization below):
253         
254         [  34] jnless            r-15, r-19, 8(->42)
255         [  38] jless             r-16, r-19, 26(->64)
256         [  42] jnless            r-17, r-19, 8(->50)
257         [  46] jless             r-18, r-19, 18(->64)
258         
259         Note the jump fusion and the fact that there's less jump
260         indirection - three of the four jumps go straight to the target
261         clause instead of indirecting through another jump.
262         
263         2) Implement jless opcode to take advantage of the above, since we'll now often generate
264         a less followed by a jtrue where fusion is not forbidden.
265        
266         * parser/Nodes.h:
267         (JSC::ExpressionNode::hasConditionContextCodegen): Helper function to determine
268         whether a node supports special conditional codegen. Return false as this is the default.
269         (JSC::ExpressionNode::emitBytecodeInConditionContext): Assert not reached - only really
270         defined for nodes that do have conditional codegen.
271         (JSC::UnaryOpNode::expr): Add const version.
272         (JSC::LogicalNotNode::hasConditionContextCodegen): Returne true only if subexpression
273         supports it.
274         (JSC::LogicalOpNode::hasConditionContextCodegen): Return true.
275         * parser/Nodes.cpp:
276         (JSC::LogicalNotNode::emitBytecodeInConditionContext): Implemented - just swap
277         the true and false targets for the child node.
278         (JSC::LogicalOpNode::emitBytecodeInConditionContext): Implemented - handle jumps
279         directly, improving codegen quality. Also handles further nested conditional codegen.
280         (JSC::ConditionalNode::emitBytecode): Use condition context codegen when available.
281         (JSC::IfNode::emitBytecode): ditto
282         (JSC::IfElseNode::emitBytecode): ditto
283         (JSC::DoWhileNode::emitBytecode): ditto
284         (JSC::WhileNode::emitBytecode): ditto
285         (JSC::ForNode::emitBytecode): ditto
286
287         * bytecode/Opcode.h: 
288         - Added loop_if_false opcode - needed now that falsey jumps can be backwards.
289         - Added jless opcode to take advantage of new fusion opportunities.
290         * bytecode/CodeBlock.cpp:
291         (JSC::CodeBlock::dump): Handle above.
292         * bytecompiler/BytecodeGenerator.cpp:
293         (JSC::BytecodeGenerator::emitJumpIfTrue): Add peephole for less + jtrue ==> jless.
294         (JSC::BytecodeGenerator::emitJumpIfFalse): Add handling of backwrds falsey jumps.
295         * bytecompiler/BytecodeGenerator.h:
296         (JSC::BytecodeGenerator::emitNodeInConditionContext): Wrapper to handle tracking of
297         overly deep expressions etc.
298         * interpreter/Interpreter.cpp:
299         (JSC::Interpreter::privateExecute): Implement the two new opcodes (loop_if_false, jless).
300         * jit/JIT.cpp:
301         (JSC::JIT::privateCompileMainPass): Implement JIT support for the two new opcodes.
302         (JSC::JIT::privateCompileSlowCases): ditto
303         * jit/JIT.h:
304         * jit/JITArithmetic.cpp:
305         (JSC::JIT::emit_op_jless):
306         (JSC::JIT::emitSlow_op_jless): ditto
307         (JSC::JIT::emitBinaryDoubleOp): ditto
308         * jit/JITOpcodes.cpp:
309         (JSC::JIT::emitSlow_op_loop_if_less): ditto
310         (JSC::JIT::emit_op_loop_if_false): ditto
311         (JSC::JIT::emitSlow_op_loop_if_false): ditto
312         * jit/JITStubs.cpp:
313         * jit/JITStubs.h:
314         (JSC::):
315
316 2009-12-04  Kent Hansen  <kent.hansen@nokia.com>
317
318         Reviewed by Darin Adler.
319
320         JavaScript delete operator should return false for string properties
321         https://bugs.webkit.org/show_bug.cgi?id=32012
322
323         * runtime/StringObject.cpp:
324         (JSC::StringObject::deleteProperty):
325
326 2009-12-03  Drew Wilson  <atwilson@chromium.org>
327
328         Rolled back r51633 because it causes a perf regression in Chromium.
329
330         * wtf/Platform.h:
331
332 2009-12-03  Gavin Barraclough  <barraclough@apple.com>
333
334         Try and fix the Windows build.
335
336         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:  Export a symbol that should be exported.
337
338 2009-12-03  Mark Rowe  <mrowe@apple.com>
339
340         Try and fix the Mac build.
341
342         * JavaScriptCore.exp:  Export a symbol that should be exported.
343
344 2009-12-03  Oliver Hunt  <oliver@apple.com>
345
346         Reviewed by Gavin Barraclough.
347
348         REGRESSION(4.0.3-48777): Crash in JSC::ExecState::propertyNames() (Debug-only?)
349         https://bugs.webkit.org/show_bug.cgi?id=32133
350
351         Work around odd GCC-ism and correct the scopechain for use by
352         calls made while a cachedcall is active on the callstack.
353
354         * interpreter/CachedCall.h:
355         (JSC::CachedCall::newCallFrame):
356         * runtime/JSArray.cpp:
357         (JSC::AVLTreeAbstractorForArrayCompare::compare_key_key):
358         * runtime/StringPrototype.cpp:
359         (JSC::stringProtoFuncReplace):
360
361 2009-12-03  Gavin Barraclough  <barraclough@apple.com>
362
363         Reviewed by Oliver "Brraaaaiiiinnnnnzzzzzzzz" Hunt.
364
365         https://bugs.webkit.org/show_bug.cgi?id=32136
366         Add a rope representation to JSString.  Presently JSString always holds its data in UString form.
367         Instead, allow the result of a string concatenation to be represented in a tree form - with a
368         variable sized, reference-counted rope node retaining a set of UString::Reps (or other rope nopes).
369
370         Strings must still currently be resolved down to a flat UString representation before being used,
371         but by holding the string in a rope representation during construction we can avoid copying data
372         until we know the final size of the string.
373
374         ~2% progression on SunSpider (~25% on date-format-xparb, ~20% on string-validate-input).
375
376         * JavaScriptCore.exp:
377
378             - Update exports.
379
380         * interpreter/Interpreter.cpp:
381         (JSC::Interpreter::privateExecute):
382
383             - Make use of new JSString::length() method to avoid prematurely resolving ropes.
384
385         * jit/JITOpcodes.cpp:
386         (JSC::JIT::privateCompileCTIMachineTrampolines):
387
388             - Switch the string length trampoline to read the length directly from JSString::m_length,
389               rather than from the JSString's UString::Rep's 'len' property.
390
391         * jit/JITStubs.cpp:
392         (JSC::DEFINE_STUB_FUNCTION):
393
394             - Modify op_add such that addition of two strings, where either or both strings are already
395               in rope representation, produces a rope as a result.
396
397         * runtime/JSString.cpp:
398         (JSC::JSString::Rope::~Rope):
399         (JSC::copyChars):
400         (JSC::JSString::resolveRope):
401         (JSC::JSString::getPrimitiveNumber):
402         (JSC::JSString::toBoolean):
403         (JSC::JSString::toNumber):
404         (JSC::JSString::toString):
405         (JSC::JSString::toThisString):
406         (JSC::JSString::getStringPropertyDescriptor):
407         * runtime/JSString.h:
408         (JSC::JSString::Rope::Fiber::Fiber):
409         (JSC::JSString::Rope::Fiber::destroy):
410         (JSC::JSString::Rope::Fiber::isRope):
411         (JSC::JSString::Rope::Fiber::rope):
412         (JSC::JSString::Rope::Fiber::string):
413         (JSC::JSString::Rope::create):
414         (JSC::JSString::Rope::initializeFiber):
415         (JSC::JSString::Rope::ropeLength):
416         (JSC::JSString::Rope::stringLength):
417         (JSC::JSString::Rope::fibers):
418         (JSC::JSString::Rope::Rope):
419         (JSC::JSString::Rope::operator new):
420         (JSC::JSString::JSString):
421         (JSC::JSString::value):
422         (JSC::JSString::length):
423         (JSC::JSString::isRope):
424         (JSC::JSString::rope):
425         (JSC::JSString::string):
426         (JSC::JSString::canGetIndex):
427         (JSC::jsSingleCharacterSubstring):
428         (JSC::JSString::getIndex):
429         (JSC::jsSubstring):
430         (JSC::JSString::getStringPropertySlot):
431
432             - Add rope form.
433
434         * runtime/Operations.h:
435         (JSC::jsAdd):
436         (JSC::concatenateStrings):
437
438             - Update string concatenation, and addition of ropes, to produce ropes.
439
440         * runtime/StringObject.cpp:
441         (JSC::StringObject::getOwnPropertyNames):
442
443             - Make use of new JSString::length() method to avoid prematurely resolving ropes.
444
445 2009-11-23  Jeremy Moskovich  <jeremy@chromium.org>
446
447         Reviewed by Eric Seidel.
448
449         Switch Chrome/Mac to use Core Text APIs rather than ATSUI APIs.
450         https://bugs.webkit.org/show_bug.cgi?id=31802
451
452         No test since this is already covered by existing pixel tests.
453
454         * wtf/Platform.h: #define USE_CORE_TEXT for Chrome/Mac.
455
456 2009-12-02  Oliver Hunt  <oliver@apple.com>
457
458         Reviewed by Gavin Barraclough.
459
460         Add files missed in prior patch.
461
462         * runtime/JSZombie.cpp:
463         (JSC::):
464         (JSC::JSZombie::leakedZombieStructure):
465         * runtime/JSZombie.h: Added.
466         (JSC::JSZombie::JSZombie):
467         (JSC::JSZombie::isZombie):
468         (JSC::JSZombie::classInfo):
469         (JSC::JSZombie::isGetterSetter):
470         (JSC::JSZombie::isAPIValueWrapper):
471         (JSC::JSZombie::isPropertyNameIterator):
472         (JSC::JSZombie::getCallData):
473         (JSC::JSZombie::getConstructData):
474         (JSC::JSZombie::getUInt32):
475         (JSC::JSZombie::toPrimitive):
476         (JSC::JSZombie::getPrimitiveNumber):
477         (JSC::JSZombie::toBoolean):
478         (JSC::JSZombie::toNumber):
479         (JSC::JSZombie::toString):
480         (JSC::JSZombie::toObject):
481         (JSC::JSZombie::markChildren):
482         (JSC::JSZombie::put):
483         (JSC::JSZombie::deleteProperty):
484         (JSC::JSZombie::toThisObject):
485         (JSC::JSZombie::toThisString):
486         (JSC::JSZombie::toThisJSString):
487         (JSC::JSZombie::getJSNumber):
488         (JSC::JSZombie::getOwnPropertySlot):
489
490 2009-12-02  Oliver Hunt  <oliver@apple.com>
491
492         Reviewed by Gavin Barraclough.
493
494         Add zombies to JSC
495         https://bugs.webkit.org/show_bug.cgi?id=32103
496
497         Add a compile time flag to make the JSC collector replace "unreachable"
498         objects with zombie objects.  The zombie object is a JSCell subclass that
499         ASSERTs on any attempt to use the JSCell methods.  In addition there are
500         a number of additional assertions in bottleneck code to catch zombie usage
501         as quickly as possible.
502
503         Grrr. Argh. Brains.
504
505         * JavaScriptCore.xcodeproj/project.pbxproj:
506         * interpreter/Register.h:
507         (JSC::Register::Register):
508         * runtime/ArgList.h:
509         (JSC::MarkedArgumentBuffer::append):
510         (JSC::ArgList::ArgList):
511         * runtime/Collector.cpp:
512         (JSC::Heap::destroy):
513         (JSC::Heap::sweep):
514         * runtime/Collector.h:
515         * runtime/JSCell.h:
516         (JSC::JSCell::isZombie):
517         (JSC::JSValue::isZombie):
518         * runtime/JSValue.h:
519         (JSC::JSValue::decode):
520         (JSC::JSValue::JSValue):
521         * wtf/Platform.h:
522
523 2009-12-01  Jens Alfke  <snej@chromium.org>
524
525         Reviewed by Darin Adler.
526
527         Added variants of find/contains/add that allow a foreign key type to be used.
528         This will allow AtomicString-keyed maps to be queried by C string without
529         having to create a temporary AtomicString (see HTTPHeaderMap.)
530         The code for this is adapted from the equivalent in HashSet.h.
531
532         * wtf/HashMap.h:
533         (WTF::HashMap::find):
534         (WTF::HashMap::contains):
535         (WTF::HashMap::add):
536         * wtf/HashSet.h: Changed "method" to "function member" in a comment.
537
538 2009-12-01  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
539
540         Revert 51551 because it broke GTK+.
541
542         * wtf/Platform.h:
543
544 2009-11-30  Gavin Barraclough  <barraclough@apple.com>
545
546         Windows Build fix.  Reviewed by NOBODY.
547
548         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
549
550 2009-11-24  Gavin Barraclough  <barraclough@apple.com>
551
552         Reviewed by Geoff Garen.
553
554         Bug 31859 - Make world selection for JSC IsolatedWorlds automagical.
555
556         WebCore presently has to explicitly specify the world before entering into JSC,
557         which is a little fragile (particularly since property access via a
558         getter/setter might invoke execution). Instead derive the current world from
559         the lexical global object.
560         
561         Remove the temporary duct tape of willExecute/didExecute virtual hooks on the JSGlobalData::ClientData - these are no longer necessary.
562
563         * API/JSBase.cpp:
564         (JSEvaluateScript):
565         * API/JSObjectRef.cpp:
566         (JSObjectCallAsFunction):
567         * JavaScriptCore.exp:
568         * runtime/JSGlobalData.cpp:
569         * runtime/JSGlobalData.h:
570
571 2009-11-30  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
572
573         Reviewed by Kenneth Rohde Christiansen.
574
575         [Qt] Remove obsolete PLATFORM(KDE) code
576         https://bugs.webkit.org/show_bug.cgi?id=31958
577
578         KDE is now using unpatched QtWebKit.
579
580         * parser/Lexer.cpp: Remove obsolete KDE_USE_FINAL guard
581         * wtf/Platform.h: Remove PLATFORM(KDE) definition and code 
582         section that is guarded with it.
583
584 2009-11-30  Jan-Arve Sæther  <jan-arve.saether@nokia.com>
585
586         Reviewed by Simon Hausmann.
587
588         [Qt] Fix compilation with win32-icc
589
590         The Intel compiler does not support the __has_trivial_constructor type
591         trait.  The Intel Compiler can report itself as _MSC_VER >= 1400. The
592         reason for that is that the Intel Compiler depends on the Microsoft
593         Platform SDK, and in order to try to be "fully" MS compatible it will
594         "pretend" to be the same MS compiler as was shipped with the MS PSDK.
595         (Thus, compiling with win32-icc with VC8 SDK will make the source code
596         "think" the compiler at hand supports this type trait).
597
598         * wtf/TypeTraits.h:
599
600 2009-11-29  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
601
602         Reviewed by Eric Seidel.
603
604         [Qt] Mac build has JIT disabled
605         https://bugs.webkit.org/show_bug.cgi?id=31828
606
607         * wtf/Platform.h: Enable JIT for Qt Mac builds
608
609 2009-11-28  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
610
611         Reviewed by Eric Seidel.
612
613         Apply workaround for the limitation of VirtualFree with MEM_RELEASE to all ports running on Windows
614         https://bugs.webkit.org/show_bug.cgi?id=31943
615
616         * runtime/MarkStack.h:
617         (JSC::MarkStack::MarkStackArray::shrinkAllocation):
618
619 2009-11-28  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
620
621         Reviewed by Gavin Barraclough.
622
623         https://bugs.webkit.org/show_bug.cgi?id=31930
624
625         Seems a typo. We don't need ~270k memory to determine the vptrs.
626
627         * runtime/JSGlobalData.cpp:
628         (JSC::VPtrSet::VPtrSet):
629
630 2009-11-27  Shinichiro Hamaji  <hamaji@chromium.org>
631
632         Unreviewed. 
633
634         Move GOwnPtr* from wtf to wtf/gtk
635         https://bugs.webkit.org/show_bug.cgi?id=31793
636
637         Build fix for chromium after r51423.
638         Exclude gtk directory from chromium build.
639
640         * JavaScriptCore.gyp/JavaScriptCore.gyp:
641
642 2009-11-25  Oliver Hunt  <oliver@apple.com>
643
644         Reviewed by Gavin Barraclough.
645
646         Incorrect behaviour of jneq_null in the interpreter
647         https://bugs.webkit.org/show_bug.cgi?id=31901
648
649         Correct the logic of jneq_null.  This is already covered by existing tests.
650
651         * interpreter/Interpreter.cpp:
652         (JSC::Interpreter::privateExecute):
653
654 2009-11-26  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
655
656         Reviewed by Oliver Hunt.
657
658         Move GOwnPtr* from wtf to wtf/gtk
659         https://bugs.webkit.org/show_bug.cgi?id=31793
660
661         * GNUmakefile.am: Change the path for GOwnPtr.*.
662         * JavaScriptCore.gyp/JavaScriptCore.gyp: Remove
663           GOwnPtr.cpp from the exclude list.
664         * JavaScriptCore.gypi: Change the path for GOwnPtr.*.
665         * wscript: Remove GOwnPtr.cpp from the exclude list.
666         * wtf/GOwnPtr.cpp: Removed.
667         * wtf/GOwnPtr.h: Removed.
668         * wtf/Threading.h: Change the path for GOwnPtr.h.
669         * wtf/gtk/GOwnPtr.cpp: Copied from JavaScriptCore/wtf/GOwnPtr.cpp.
670         * wtf/gtk/GOwnPtr.h: Copied from JavaScriptCore/wtf/GOwnPtr.h.
671         * wtf/unicode/glib/UnicodeGLib.h: Change the path for GOwnPtr.h.
672
673 2009-11-24  Dmitry Titov  <dimich@chromium.org>
674
675         Reviewed by Eric Seidel.
676
677         Add ENABLE_SHARED_SCRIPT feature define and flag for build-webkit
678         https://bugs.webkit.org/show_bug.cgi?id=31444
679
680         * Configurations/FeatureDefines.xcconfig:
681         * wtf/Platform.h:
682
683 2009-11-24  Chris Marrin  <cmarrin@apple.com>
684
685         Reviewed by Simon Fraser.
686
687         Add ability to enable ACCELERATED_COMPOSITING on Windows (currently disabled)
688         https://bugs.webkit.org/show_bug.cgi?id=27314
689
690         * wtf/Platform.h:
691
692 2009-11-24  Jason Smith  <dark.panda@gmail.com>
693
694         Reviewed by Alexey Proskuryakov.
695
696         RegExp#exec's returned Array-like object behaves differently from
697         regular Arrays
698         https://bugs.webkit.org/show_bug.cgi?id=31689
699
700         * JavaScriptCore/runtime/RegExpConstructor.cpp: ensure that undefined
701         values are added to the returned RegExpMatchesArray
702
703 2009-11-24  Oliver Hunt  <oliver@apple.com>
704
705         Reviewed by Alexey Proskuryakov.
706
707         JSON.stringify performance on undefined is very poor
708         https://bugs.webkit.org/show_bug.cgi?id=31839
709
710         Switch from a UString to a Vector<UChar> when building
711         the JSON string, allowing us to safely remove the substr-copy
712         we otherwise did when unwinding an undefined property.
713
714         Also turns out to be a ~5% speedup on stringification.
715
716         * runtime/JSONObject.cpp:
717         (JSC::Stringifier::StringBuilder::append):
718         (JSC::Stringifier::stringify):
719         (JSC::Stringifier::Holder::appendNextProperty):
720
721 2009-11-24  Mark Rowe  <mrowe@apple.com>
722
723         Fix production builds where the source tree may be read-only.
724
725         * JavaScriptCore.xcodeproj/project.pbxproj:
726
727 2009-11-23  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
728
729         Reviewed by Kenneth Rohde Christiansen.
730
731         Include "config.h" to meet Coding Style Guidelines
732         https://bugs.webkit.org/show_bug.cgi?id=31792
733
734         * wtf/unicode/UTF8.cpp:
735         * wtf/unicode/glib/UnicodeGLib.cpp:
736         * wtf/unicode/wince/UnicodeWince.cpp:
737
738 2009-11-23  Geoffrey Garen  <ggaren@apple.com>
739
740         Reviewed by Oliver Hunt.
741
742         Streamlined some Math functions where we expect or know the result not
743         to be representable as an int.
744         
745         SunSpider says 0.6% faster.
746
747         * runtime/JSNumberCell.h:
748         (JSC::JSValue::JSValue):
749         * runtime/JSValue.h:
750         (JSC::JSValue::):
751         (JSC::jsDoubleNumber):
752         (JSC::JSValue::JSValue): Added a function for making a numeric JSValue
753         and skipping the "can I encode this as an int?" check, avoiding the
754         overhead of int <-> double roundtripping and double <-> double comparison
755         and branching.
756
757         * runtime/MathObject.cpp:
758         (JSC::mathProtoFuncACos):
759         (JSC::mathProtoFuncASin):
760         (JSC::mathProtoFuncATan):
761         (JSC::mathProtoFuncATan2):
762         (JSC::mathProtoFuncCos):
763         (JSC::mathProtoFuncExp):
764         (JSC::mathProtoFuncLog):
765         (JSC::mathProtoFuncRandom):
766         (JSC::mathProtoFuncSin):
767         (JSC::mathProtoFuncSqrt):
768         (JSC::mathProtoFuncTan): For these functions, which we expect or know
769         to produce results not representable as ints, call jsDoubleNumber instead
770         of jsNumber.
771
772 2009-11-23  Mark Rowe  <mrowe@apple.com>
773
774         Unreviewed. Unbreak the regression tests after r51329.
775
776         * API/JSBase.cpp:
777         (JSEvaluateScript): Null-check clientData before dereferencing it.
778         * API/JSObjectRef.cpp:
779         (JSObjectCallAsFunction): Ditto.
780
781 2009-11-23  Gavin Barraclough  <barraclough@apple.com>
782
783         Reviewed by Geoff Garen.
784
785         Part 1/3 of <rdar://problem/7377477> REGRESSION: Many web pages fail to render after interesting script runs in isolated world
786
787         Some clients of the JavaScriptCore API expect to be able to make callbacks over the JSC API,
788         and for this to automagically cause execution to take place in the world associated with the
789         global object associated with the ExecState (JSContextRef) passed.  However this is not how
790         things work - the world must be explicitly set within WebCore.
791
792         Making this work just for API calls to evaluate & call will be a far from perfect solution,
793         since direct (non-API) use of JSC still relies on WebCore setting the current world correctly.
794         A better solution would be to make this all work automagically all throughout WebCore, but this
795         will require more refactoring.
796
797         Since the API is in JSC but worlds only exist in WebCore, add callbacks on the JSGlobalData::ClientData
798         to allow it to update the current world on entry/exit via the JSC API.  This is temporary duck
799         tape, and should be removed once the current world no longer needs to be explicitly tracked.
800
801         * API/JSBase.cpp:
802         (JSEvaluateScript):
803         * API/JSObjectRef.cpp:
804         (JSObjectCallAsFunction):
805         * JavaScriptCore.exp:
806         * runtime/JSGlobalData.cpp:
807         (JSC::JSGlobalData::ClientData::beginningExecution):
808         (JSC::JSGlobalData::ClientData::completedExecution):
809         * runtime/JSGlobalData.h:
810
811 2009-11-23  Steve Block  <steveblock@google.com>
812
813         Reviewed by Dmitry Titov.
814
815         Adds MainThreadAndroid.cpp with Android-specific WTF threading functions.
816         https://bugs.webkit.org/show_bug.cgi?id=31807
817
818         * wtf/android: Added.
819         * wtf/android/MainThreadAndroid.cpp: Added.
820         (WTF::timeoutFired):
821         (WTF::initializeMainThreadPlatform):
822         (WTF::scheduleDispatchFunctionsOnMainThread):
823
824 2009-11-23  Alexey Proskuryakov  <ap@apple.com>
825
826         Reviewed by Brady Eidson.
827
828         https://bugs.webkit.org/show_bug.cgi?id=31748
829         Make WebSocketHandleCFNet respect proxy auto-configuration files via CFProxySupport
830
831         * JavaScriptCore.exp: Export callOnMainThreadAndWait.
832
833 2009-11-23  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
834
835         Reviewed by Kenneth Rohde Christiansen.
836
837         [Symbian] Fix lastIndexOf() for Symbian
838         https://bugs.webkit.org/show_bug.cgi?id=31773
839
840         Symbian soft floating point library has problems with operators
841         comparing NaN to numbers. Without a workaround lastIndexOf() 
842         function does not work.
843
844         Patch developed by David Leong.
845
846         * runtime/StringPrototype.cpp:
847         (JSC::stringProtoFuncLastIndexOf):Add an extra test 
848         to check for NaN for Symbian.
849
850 2009-11-23  Steve Block  <steveblock@google.com>
851
852         Reviewed by Eric Seidel.
853
854         Android port lacks implementation of atomicIncrement and atomicDecrement.
855         https://bugs.webkit.org/show_bug.cgi?id=31715
856
857         * wtf/Threading.h: Modified.
858         (WTF::atomicIncrement): Added Android implementation.
859         (WTF::atomicDecrement): Added Android implementation.
860
861 2009-11-22  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
862
863         Unreviewed.
864
865         [Qt] Sort source lists and remove obsolete comments 
866         from the build system.
867
868         * JavaScriptCore.pri:
869
870 2009-11-21  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
871
872         Reviewed by Eric Seidel.
873
874         [Qt][Mac] Turn on multiple JavaScript threads for QtWebkit on Mac
875         https://bugs.webkit.org/show_bug.cgi?id=31753
876
877         * wtf/Platform.h:
878
879 2009-11-19  Steve Block  <steveblock@google.com>
880
881         Android port lacks configuration in Platform.h and config.h.
882         https://bugs.webkit.org/show_bug.cgi?id=31671
883
884         * wtf/Platform.h: Modified. Added Android-specific configuration.
885
886 2009-11-19  Alexey Proskuryakov  <ap@apple.com>
887
888         Reviewed by Darin Adler.
889
890         https://bugs.webkit.org/show_bug.cgi?id=31690
891         Make SocketStreamHandleCFNet work on Windows
892
893         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
894         * wtf/MainThread.cpp:
895         (WTF::FunctionWithContext::FunctionWithContext):
896         (WTF::dispatchFunctionsFromMainThread):
897         (WTF::callOnMainThreadAndWait):
898         * wtf/MainThread.h:
899         Re-add callOnMainThreadAndWait(), which was removed in bug 23926.
900
901 2009-11-19  Dmitry Titov  <dimich@chromium.org>
902
903         Reviewed by David Levin.
904
905         isMainThread() on Chromium (Mac and Linux) is so slow it timeouts LayoutTests..
906         https://bugs.webkit.org/show_bug.cgi?id=31693
907
908         * wtf/ThreadingPthreads.cpp:
909         (WTF::initializeThreading): grab and use the pthread_t of the main thread instead of ThreadIdentifier.
910         (WTF::isMainThread): Ditto.
911
912 2009-11-19  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
913
914         Reviewed by Darin Adler.
915
916         Remove HAVE(STRING_H) guard from JavaScriptCore
917         https://bugs.webkit.org/show_bug.cgi?id=31668
918
919         * config.h:
920         * runtime/UString.cpp:
921
922 2009-11-19  Dumitru Daniliuc  <dumi@chromium.org>
923
924         Reviewed by Dmitry Titov.
925
926         Fixing a bug in MessageQueue::removeIf() that leads to an
927         assertion failure.
928
929         https://bugs.webkit.org/show_bug.cgi?id=31657
930
931         * wtf/MessageQueue.h:
932         (WTF::MessageQueue::removeIf):
933
934 2009-11-19  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
935
936         Reviewed by Darin Adler.
937
938         Remove HAVE(FLOAT_H) guard
939         https://bugs.webkit.org/show_bug.cgi?id=31661
940
941         JavaScriptCore has a dependency on float.h, there is
942         no need to guard float.h.
943
944         * runtime/DatePrototype.cpp: Remove include directive 
945         for float.h as it is included in MathExtras.h already.
946         * runtime/Operations.cpp: Ditto.
947         * runtime/UString.cpp: Ditto.
948         * wtf/dtoa.cpp: Ditto.
949         * wtf/MathExtras.h: Remove HAVE(FLOAT_H) guard.
950         * wtf/Platform.h: Ditto.
951
952 2009-11-19  Thiago Macieira <thiago.macieira@nokia.com>
953
954         Reviewed by Simon Hausmann.
955
956         Build fix for 32-bit Sparc machines: these machines are big-endian.
957
958         * wtf/Platform.h:
959
960 2009-11-18  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
961
962         Reviewed by Kenneth Rohde Christiansen.
963
964         [Qt] Remove support for Qt v4.3 or older versions
965         https://bugs.webkit.org/show_bug.cgi?id=29469
966
967         * JavaScriptCore.pro:
968         * jsc.pro:
969         * wtf/unicode/qt4/UnicodeQt4.h:
970
971 2009-11-18  Kent Tamura  <tkent@chromium.org>
972
973         Reviewed by Darin Adler.
974
975         Move UString::from(double) implementation to new
976         WTF::doubleToStringInJavaScriptFormat(), and expose it because WebCore
977         code will use it.
978         https://bugs.webkit.org/show_bug.cgi?id=31330
979
980         - Introduce new function createRep(const char*, unsigned) and
981           UString::UString(const char*, unsigned) to reduce 2 calls to strlen().
982         - Fix a bug that dtoa() doesn't update *rve if the input value is NaN
983           or Infinity.
984
985         No new tests because this doesn't change the behavior.
986
987         * JavaScriptCore.exp:
988         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
989         * runtime/UString.cpp:
990         (JSC::createRep):
991         (JSC::UString::UString):
992         (JSC::UString::from): Move the code to doubleToStringInJavaScriptFormat().
993         * runtime/UString.h:
994         * wtf/dtoa.cpp:
995         (WTF::dtoa): Fix a bug about rve.
996         (WTF::append): A helper for doubleToStringInJavaScriptFormat().
997         (WTF::doubleToStringInJavaScriptFormat): Move the code from UString::from(double).
998         * wtf/dtoa.h:
999
1000 2009-11-18  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
1001
1002         Reviewed by Kenneth Rohde Christiansen.
1003
1004         [Qt] Remove WTF_USE_JAVASCRIPTCORE_BINDINGS as it is no longer used
1005         https://bugs.webkit.org/show_bug.cgi?id=31643
1006
1007         * JavaScriptCore.pro:
1008
1009 2009-11-18  Nate Chapin  <japhet@chromium.org>
1010
1011         Reviewed by Darin Fisher.
1012
1013         Remove Chromium's unnecessary dependency on wtf's tcmalloc files.
1014
1015         https://bugs.webkit.org/show_bug.cgi?id=31648
1016
1017         * JavaScriptCore.gyp/JavaScriptCore.gyp:
1018
1019 2009-11-18  Thiago Macieira <thiago.macieira@nokia.com>
1020
1021         Reviewed by Gavin Barraclough.
1022
1023         [Qt] Implement symbol hiding for JSC's JIT functions.
1024
1025         These functions are implemented directly in assembly, so they need the
1026         proper directives to enable/disable visibility. On ELF systems, it's
1027         .hidden, whereas on Mach-O systems (Mac) it's .private_extern. On
1028         Windows, it's not necessary since you have to explicitly export. I
1029         also implemented the AIX idiom, though it's unlikely anyone will
1030         implement AIX/POWER JIT.
1031         https://bugs.webkit.org/show_bug.cgi?id=30864
1032
1033         * jit/JITStubs.cpp:
1034
1035 2009-11-18  Oliver Hunt  <oliver@apple.com>
1036
1037         Reviewed by Alexey Proskuryakov.
1038
1039         Interpreter may do an out of range access when throwing an exception in the profiler.
1040         https://bugs.webkit.org/show_bug.cgi?id=31635
1041
1042         Add bounds check.
1043
1044         * interpreter/Interpreter.cpp:
1045         (JSC::Interpreter::throwException):
1046
1047 2009-11-18  Gabor Loki  <loki@inf.u-szeged.hu>
1048
1049         Reviewed by Darin Adler.
1050
1051         Fix the clobber list of cacheFlush for ARM and Thumb2 on Linux
1052         https://bugs.webkit.org/show_bug.cgi?id=31631
1053
1054         * jit/ExecutableAllocator.h:
1055         (JSC::ExecutableAllocator::cacheFlush):
1056
1057 2009-11-18  Harald Fernengel  <harald.fernengel@nokia.com>
1058
1059         Reviewed by Simon Hausmann.
1060
1061         [Qt] Fix detection of linux-g++
1062
1063         Never use "linux-g++*" to check for linux-g++, since this will break embedded
1064         builds which use linux-arm-g++ and friends. Use 'linux*-g++*' to check for any
1065         g++ on linux mkspec.
1066
1067         * JavaScriptCore.pri:
1068
1069 2009-11-17  Jon Honeycutt  <jhoneycutt@apple.com>
1070
1071         Add JSContextRefPrivate.h to list of copied files.
1072
1073         Reviewed by Mark Rowe.
1074
1075         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
1076
1077 2009-11-17  Martin Robinson  <martin.james.robinson@gmail.com>
1078
1079         Reviewed by Adam Barth.
1080
1081         [GTK] Style cleanup for GOwnPtr
1082         https://bugs.webkit.org/show_bug.cgi?id=31506
1083
1084         Remove forward declaration in GOwnPtr and do some style cleanup.
1085
1086         * wtf/GOwnPtr.cpp:
1087         * wtf/GOwnPtr.h:
1088         (WTF::GOwnPtr::GOwnPtr):
1089         (WTF::GOwnPtr::~GOwnPtr):
1090         (WTF::GOwnPtr::get):
1091         (WTF::GOwnPtr::release):
1092         (WTF::GOwnPtr::outPtr):
1093         (WTF::GOwnPtr::set):
1094         (WTF::GOwnPtr::clear):
1095         (WTF::GOwnPtr::operator*):
1096         (WTF::GOwnPtr::operator->):
1097         (WTF::GOwnPtr::operator!):
1098         (WTF::GOwnPtr::operator UnspecifiedBoolType):
1099         (WTF::GOwnPtr::swap):
1100         (WTF::swap):
1101         (WTF::operator==):
1102         (WTF::operator!=):
1103         (WTF::getPtr):
1104         (WTF::freeOwnedGPtr):
1105
1106 2009-11-17  Oliver Hunt  <oliver@apple.com>
1107
1108         Reviewed by Maciej Stachowiak.
1109
1110         Incorrect use of JavaScriptCore API in DumpRenderTree
1111         https://bugs.webkit.org/show_bug.cgi?id=31577
1112
1113         Add assertions to the 'toJS' functions to catch mistakes like
1114         this early.  Restructure existing code which blindly passed potentially
1115         null values to toJS when forwarding exceptions so that a null check is
1116         performed first.
1117
1118         * API/APICast.h:
1119         (toJS):
1120         (toJSForGC):
1121         * API/JSCallbackObjectFunctions.h:
1122         (JSC::::getOwnPropertySlot):
1123         (JSC::::put):
1124         (JSC::::deleteProperty):
1125         (JSC::::construct):
1126         (JSC::::hasInstance):
1127         (JSC::::call):
1128         (JSC::::toNumber):
1129         (JSC::::toString):
1130         (JSC::::staticValueGetter):
1131         (JSC::::callbackGetter):
1132         * API/tests/testapi.c: Fix errors in the API tester.
1133         (MyObject_getProperty):
1134         (MyObject_convertToType):
1135         (EvilExceptionObject_convertToType):
1136
1137 2009-11-16  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
1138
1139         Reviewed by Gavin Barraclough.
1140
1141         https://bugs.webkit.org/show_bug.cgi?id=31050
1142
1143         Minor fixes for JSVALUE32_64: branchConvertDoubleToInt32
1144         failed on a CortexA8 CPU, but not on a simulator; and
1145         JITCall.cpp modifications was somehow not committed to mainline.
1146
1147         * assembler/ARMAssembler.h:
1148         (JSC::ARMAssembler::fmrs_r):
1149         * assembler/MacroAssemblerARM.h:
1150         (JSC::MacroAssemblerARM::branchConvertDoubleToInt32):
1151         * jit/JITCall.cpp:
1152         (JSC::JIT::compileOpCall):
1153
1154 2009-11-16  Joerg Bornemann  <joerg.bornemann@trolltech.com>
1155
1156         Reviewed by Simon Hausmann.
1157
1158         Fix Qt build on Windows CE 6.
1159
1160         * JavaScriptCore.pri: Add missing include path.
1161         * wtf/Platform.h: Include ce_time.h for Windows CE 6.
1162
1163 2009-11-13  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
1164
1165         Reviewed by Gavin Barraclough.
1166
1167         https://bugs.webkit.org/show_bug.cgi?id=31050
1168
1169         Adding optimization support for mode JSVALUE32_64
1170         on ARM systems.
1171
1172         * jit/JIT.h:
1173         * jit/JITCall.cpp:
1174         (JSC::JIT::compileOpCall):
1175         * jit/JITPropertyAccess.cpp:
1176         (JSC::JIT::emit_op_method_check):
1177         (JSC::JIT::compileGetByIdHotPath):
1178         (JSC::JIT::compileGetByIdSlowCase):
1179         (JSC::JIT::emit_op_put_by_id):
1180
1181 2009-11-14  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
1182
1183         Reviewed by Gavin Barraclough.
1184
1185         https://bugs.webkit.org/show_bug.cgi?id=31050
1186
1187         Adding JSVALUE32_64 support for ARM (but not turning it
1188         on by default). All optimizations must be disabled, since
1189         this patch is only the first of a series of patches.
1190
1191         During the work, a lot of x86 specific code revealed and
1192         made platform independent.
1193         See revisions: 50531 50541 50593 50594 50595
1194
1195         * assembler/ARMAssembler.h:
1196         (JSC::ARMAssembler::):
1197         (JSC::ARMAssembler::fdivd_r):
1198         * assembler/MacroAssemblerARM.h:
1199         (JSC::MacroAssemblerARM::lshift32):
1200         (JSC::MacroAssemblerARM::neg32):
1201         (JSC::MacroAssemblerARM::rshift32):
1202         (JSC::MacroAssemblerARM::branchOr32):
1203         (JSC::MacroAssemblerARM::set8):
1204         (JSC::MacroAssemblerARM::setTest8):
1205         (JSC::MacroAssemblerARM::loadDouble):
1206         (JSC::MacroAssemblerARM::divDouble):
1207         (JSC::MacroAssemblerARM::convertInt32ToDouble):
1208         (JSC::MacroAssemblerARM::zeroDouble):
1209         * jit/JIT.cpp:
1210         * jit/JIT.h:
1211         * jit/JITOpcodes.cpp:
1212         (JSC::JIT::privateCompileCTIMachineTrampolines):
1213         * jit/JITStubs.cpp:
1214         * wtf/StdLibExtras.h:
1215
1216 2009-11-13  Dominik Röttsches  <dominik.roettsches@access-company.com>
1217
1218         Reviewed by Eric Seidel.
1219
1220         Unify TextBoundaries implementations by only relying on WTF Unicode abstractions
1221         https://bugs.webkit.org/show_bug.cgi?id=31468
1222
1223         Adding isAlphanumeric abstraction, required
1224         by TextBoundaries.cpp.
1225
1226         * wtf/unicode/glib/UnicodeGLib.h:
1227         (WTF::Unicode::isAlphanumeric):
1228         * wtf/unicode/icu/UnicodeIcu.h:
1229         (WTF::Unicode::isAlphanumeric):
1230
1231 2009-11-13  Norbert Leser  <norbert.leser&nokia.com>
1232
1233         Reviewed by Eric Seidel.
1234
1235         Added macros for USERINCLUDE paths within symbian blocks
1236         to guarantee inclusion of respective header files from local path
1237         first (to avoid clashes with same names of header files in system include path).
1238
1239         * JavaScriptCore.pri:
1240
1241 2009-11-13  Oliver Hunt  <oliver@apple.com>
1242
1243         Reviewed by Geoff Garen.
1244
1245         JSValueProtect and JSValueUnprotect don't protect API wrapper values
1246         https://bugs.webkit.org/show_bug.cgi?id=31485
1247
1248         Make JSValueProtect/Unprotect use a new 'toJS' function, 'toJSForGC' that
1249         does not attempt to to strip out API wrapper objects.
1250
1251         * API/APICast.h:
1252         (toJSForGC):
1253         * API/JSValueRef.cpp:
1254         (JSValueProtect):
1255         (JSValueUnprotect):
1256         * API/tests/testapi.c:
1257         (makeGlobalNumberValue):
1258         (main):
1259
1260 2009-11-13  İsmail Dönmez  <ismail@namtrac.org>
1261
1262         Reviewed by Antti Koivisto.
1263
1264         Fix typo, ce_time.cpp should be ce_time.c
1265
1266         * JavaScriptCore.pri:
1267
1268 2009-11-12  Steve VanDeBogart  <vandebo@chromium.org>
1269
1270         Reviewed by Adam Barth.
1271
1272         Calculate the time offset only if we were able to parse
1273         the date string. This saves an IPC in Chromium for
1274         invalid date strings.
1275         https://bugs.webkit.org/show_bug.cgi?id=31416
1276
1277         * wtf/DateMath.cpp:
1278         (WTF::parseDateFromNullTerminatedCharacters):
1279         (JSC::parseDateFromNullTerminatedCharacters):
1280
1281 2009-11-12  Oliver Hunt  <oliver@apple.com>
1282
1283         Rollout r50896 until i can work out why it causes failures.
1284
1285         * bytecompiler/BytecodeGenerator.cpp:
1286         (JSC::BytecodeGenerator::emitReturn):
1287         * interpreter/Interpreter.cpp:
1288         (JSC::Interpreter::execute):
1289         * parser/Nodes.cpp:
1290         (JSC::EvalNode::emitBytecode):
1291
1292 2009-11-12  Steve Falkenburg  <sfalken@apple.com>
1293
1294         Reviewed by Stephanie Lewis.
1295
1296         Remove LIBRARY directive from def file to fix Debug_All target.
1297
1298         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1299
1300 2009-11-12  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
1301
1302         Rubber-stamped by Holger Freyther.
1303
1304         Revert r50204, since it makes DRT crash on 32 bits release builds
1305         for GTK+.
1306
1307         * wtf/FastMalloc.h:
1308
1309 2009-11-12  Oliver Hunt  <oliver@apple.com>
1310
1311         Reviewed by Gavin Barraclough.
1312
1313         Start unifying entry logic for function and eval code.
1314
1315         Eval now uses a ret instruction to end execution, and sets up
1316         a callframe more in line with what we do for function entry.
1317
1318         * bytecompiler/BytecodeGenerator.cpp:
1319         (JSC::BytecodeGenerator::emitReturn):
1320         * interpreter/Interpreter.cpp:
1321         (JSC::Interpreter::execute):
1322         * parser/Nodes.cpp:
1323         (JSC::EvalNode::emitBytecode):
1324
1325 2009-11-12  Richard Moe Gustavsen  <richard.gustavsen@nokia.com>
1326
1327         Reviewed by Kenneth Rohde Christiansen.
1328
1329         [Qt] Disable pthread_setname_np.
1330
1331         This allows Qt builds on Mac from 10.6 to run on earlier version
1332         where this symbol is not present.
1333         https://bugs.webkit.org/show_bug.cgi?id=31403
1334
1335         * wtf/Platform.h:
1336
1337 2009-11-12  Thiago Macieira <thiago.macieira@nokia.com>
1338
1339         Reviewed by Kenneth Rohde Christiansen.
1340
1341         [Qt] Fix linking on Linux 32-bit.
1342
1343         It was missing the ".text" directive at the top of the file,
1344         indicating that code would follow. Without it, the assembler created
1345         "NOTYPE" symbols, which would result in linker errors.
1346         https://bugs.webkit.org/show_bug.cgi?id=30863
1347
1348         * jit/JITStubs.cpp:
1349
1350 2009-11-11  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
1351
1352         Reviewed by Alexey Proskuryakov.
1353
1354         Refactor multiple JavaScriptCore threads
1355         https://bugs.webkit.org/show_bug.cgi?id=31328
1356
1357         Remove the id field from the PlatformThread structure 
1358         as it is not used.
1359
1360         * runtime/Collector.cpp:
1361         (JSC::getCurrentPlatformThread):
1362         (JSC::suspendThread):
1363         (JSC::resumeThread):
1364         (JSC::getPlatformThreadRegisters):
1365
1366 2009-11-10  Geoffrey Garen  <ggaren@apple.com>
1367
1368         Linux build fix: Added an #include for UINT_MAX.
1369
1370         * runtime/WeakRandom.h:
1371
1372 2009-11-10  Geoffrey Garen  <ggaren@apple.com>
1373
1374         JavaScriptGlue build fix: Marked a file 'private' instead of 'project'.
1375
1376         * JavaScriptCore.xcodeproj/project.pbxproj:
1377
1378 2009-11-10  Geoffrey Garen  <ggaren@apple.com>
1379
1380         Reviewed by Gavin "avGni arBalroguch" Barraclough.
1381
1382         Faster Math.random, based on GameRand.
1383         
1384         SunSpider says 1.4% faster.
1385
1386         * GNUmakefile.am:
1387         * JavaScriptCore.gypi:
1388         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1389         * JavaScriptCore.xcodeproj/project.pbxproj: Added the header to the project.
1390
1391         * runtime/JSGlobalData.cpp:
1392         (JSC::JSGlobalData::JSGlobalData):
1393         * runtime/JSGlobalData.h: Use an object to track random number generation
1394         state, initialized to the current time.
1395
1396         * runtime/MathObject.cpp:
1397         (JSC::MathObject::MathObject):
1398         (JSC::mathProtoFuncRandom): Use the new hotness.
1399
1400         * runtime/WeakRandom.h: Added.
1401         (JSC::WeakRandom::WeakRandom):
1402         (JSC::WeakRandom::get):
1403         (JSC::WeakRandom::advance): The new hotness.
1404
1405 2009-11-09  Geoffrey Garen  <ggaren@apple.com>
1406
1407         Reviewed by Oliver Hunt.
1408
1409         Imported the v8 DST cache.
1410         
1411         SunSpider says 1.5% faster.
1412
1413         * runtime/JSGlobalData.cpp:
1414         (JSC::JSGlobalData::resetDateCache): Reset the DST cache when resetting
1415         other date data.
1416
1417         * runtime/JSGlobalData.h:
1418         (JSC::DSTOffsetCache::DSTOffsetCache):
1419         (JSC::DSTOffsetCache::reset): Added a struct for the DST cache.
1420
1421         * wtf/DateMath.cpp:
1422         (WTF::calculateDSTOffsetSimple):
1423         (WTF::calculateDSTOffset):
1424         (WTF::parseDateFromNullTerminatedCharacters):
1425         (JSC::getDSTOffset):
1426         (JSC::gregorianDateTimeToMS):
1427         (JSC::msToGregorianDateTime):
1428         (JSC::parseDateFromNullTerminatedCharacters):
1429         * wtf/DateMath.h: The imported code for probing and updating the cache.
1430
1431 2009-11-09  Geoffrey Garen  <ggaren@apple.com>
1432
1433         Reviewed by Oliver Hunt.
1434
1435         Fixed an edge case that could cause the engine not to notice a timezone
1436         change.
1437         
1438         No test because this case would require manual intervention to change
1439         the timezone during the test.
1440         
1441         SunSpider reports no change.
1442
1443         * runtime/DateInstanceCache.h:
1444         (JSC::DateInstanceCache::DateInstanceCache):
1445         (JSC::DateInstanceCache::reset): Added a helper function for resetting
1446         this cache. Also, shrank the cache, since we'll be resetting it often.
1447
1448         * runtime/JSGlobalData.cpp:
1449         (JSC::JSGlobalData::resetDateCache): Include resetting the DateInstanceCache
1450         in resetting Date data. (Otherwise, a cache hit could bypass a necessary
1451         timezone update check.)
1452
1453 2009-11-09  Geoffrey Garen  <ggaren@apple.com>
1454
1455         Reviewed by Sam Weinig.
1456
1457         Some manual inlining and constant propogation in Date code.
1458         
1459         SunSpider reports a 0.4% speedup on date-*, no overall speedup. Shark
1460         says some previously evident stalls are now gone.
1461
1462         * runtime/DateConstructor.cpp:
1463         (JSC::callDate):
1464         * runtime/DateConversion.cpp:
1465         (JSC::formatTime):
1466         (JSC::formatTimeUTC): Split formatTime into UTC and non-UTC variants.
1467
1468         * runtime/DateConversion.h:
1469         * runtime/DateInstance.cpp:
1470         (JSC::DateInstance::calculateGregorianDateTime):
1471         (JSC::DateInstance::calculateGregorianDateTimeUTC):
1472         * runtime/DateInstance.h:
1473         (JSC::DateInstance::gregorianDateTime):
1474         (JSC::DateInstance::gregorianDateTimeUTC): Split gregorianDateTime into
1475         a UTC and non-UTC variant, and split each variant into a fast inline
1476         case and a slow out-of-line case.
1477
1478         * runtime/DatePrototype.cpp:
1479         (JSC::formatLocaleDate):
1480         (JSC::dateProtoFuncToString):
1481         (JSC::dateProtoFuncToUTCString):
1482         (JSC::dateProtoFuncToISOString):
1483         (JSC::dateProtoFuncToDateString):
1484         (JSC::dateProtoFuncToTimeString):
1485         (JSC::dateProtoFuncGetFullYear):
1486         (JSC::dateProtoFuncGetUTCFullYear):
1487         (JSC::dateProtoFuncToGMTString):
1488         (JSC::dateProtoFuncGetMonth):
1489         (JSC::dateProtoFuncGetUTCMonth):
1490         (JSC::dateProtoFuncGetDate):
1491         (JSC::dateProtoFuncGetUTCDate):
1492         (JSC::dateProtoFuncGetDay):
1493         (JSC::dateProtoFuncGetUTCDay):
1494         (JSC::dateProtoFuncGetHours):
1495         (JSC::dateProtoFuncGetUTCHours):
1496         (JSC::dateProtoFuncGetMinutes):
1497         (JSC::dateProtoFuncGetUTCMinutes):
1498         (JSC::dateProtoFuncGetSeconds):
1499         (JSC::dateProtoFuncGetUTCSeconds):
1500         (JSC::dateProtoFuncGetTimezoneOffset):
1501         (JSC::setNewValueFromTimeArgs):
1502         (JSC::setNewValueFromDateArgs):
1503         (JSC::dateProtoFuncSetYear):
1504         (JSC::dateProtoFuncGetYear): Updated for the gregorianDateTime change above.
1505
1506 2009-11-09  Geoffrey Garen  <ggaren@apple.com>
1507
1508         Build fix: export a new symbol.
1509
1510         * JavaScriptCore.exp:
1511         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1512
1513 2009-11-09  Geoffrey Garen  <ggaren@apple.com>
1514
1515         Reviewed by Sam "Home Wrecker" Weinig.
1516
1517         Added a tiny cache for Date parsing.
1518         
1519         SunSpider says 1.2% faster.
1520
1521         * runtime/DateConversion.cpp:
1522         (JSC::parseDate): Try to reuse the last parsed Date, if present.
1523
1524         * runtime/JSGlobalData.cpp:
1525         (JSC::JSGlobalData::resetDateCache):
1526         * runtime/JSGlobalData.h: Added storage for last parsed Date. Refactored
1527         this code to make resetting the date cache easier.
1528
1529         * runtime/JSGlobalObject.h:
1530         (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope): Updated for
1531         refactoring.
1532
1533         * wtf/DateMath.cpp:
1534         (JSC::parseDateFromNullTerminatedCharacters):
1535         * wtf/DateMath.h: Changed ExecState to be first parameter, as is the JSC custom.
1536
1537 2009-11-09  Oliver Hunt  <oliver@apple.com>
1538
1539         Reviewed by Gavin Barraclough.
1540
1541         Can cache prototype lookups on uncacheable dictionaries.
1542         https://bugs.webkit.org/show_bug.cgi?id=31198
1543
1544         Replace fromDictionaryTransition with flattenDictionaryObject and
1545         flattenDictionaryStructure.  This change is necessary as we need to
1546         guarantee that our attempt to convert away from a dictionary structure
1547         will definitely succeed, and in some cases this requires mutating the
1548         object storage itself.
1549
1550         * interpreter/Interpreter.cpp:
1551         (JSC::Interpreter::tryCacheGetByID):
1552         * jit/JITStubs.cpp:
1553         (JSC::JITThunks::tryCacheGetByID):
1554         (JSC::DEFINE_STUB_FUNCTION):
1555         * runtime/BatchedTransitionOptimizer.h:
1556         (JSC::BatchedTransitionOptimizer::~BatchedTransitionOptimizer):
1557         * runtime/JSObject.h:
1558         (JSC::JSObject::flattenDictionaryObject):
1559         * runtime/Operations.h:
1560         (JSC::normalizePrototypeChain):
1561         * runtime/Structure.cpp:
1562         (JSC::Structure::flattenDictionaryStructure):
1563         (JSC::comparePropertyMapEntryIndices):
1564         * runtime/Structure.h:
1565
1566 2009-11-09  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
1567
1568         Not reviewed, build fix.
1569
1570         Remove extra character from r50701.
1571
1572         * JavaScriptCore.pri:
1573
1574 2009-11-09  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
1575
1576         Not reviewed, build fix.
1577
1578         Revert r50695 because it broke QtWebKit (clean builds).
1579
1580         * JavaScriptCore.pri:
1581
1582 2009-11-09  Norbert Leser  <norbert.leser@nokia.com>
1583
1584         Reviewed by Kenneth Rohde Christiansen.
1585
1586         Prepended $$PWD to GENERATED_SOURCES_DIR to avoid potential ambiguities when included from WebCore.pro.
1587         Some preprocessors consider this GENERATED_SOURCES_DIR relative to current invoking dir (e.g., ./WebCore),
1588         and not the working dir of JavaCriptCore.pri (i.e., ../JavaScriptCore/).
1589
1590         * JavaScriptCore.pri:
1591
1592 2009-11-09  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
1593
1594         Reviewed by Kenneth Rohde Christiansen.
1595
1596         Use explicit parentheses to silence gcc 4.4 -Wparentheses warnings
1597         https://bugs.webkit.org/show_bug.cgi?id=31040
1598
1599         * interpreter/Interpreter.cpp:
1600         (JSC::Interpreter::privateExecute):
1601
1602 2009-11-08  David Levin  <levin@chromium.org>
1603
1604         Reviewed by NOBODY (speculative snow leopard and windows build fixes).
1605
1606         * wtf/DateMath.cpp:
1607         (WTF::parseDateFromNullTerminatedCharacters):
1608         (JSC::gregorianDateTimeToMS):
1609         (JSC::msToGregorianDateTime):
1610         (JSC::parseDateFromNullTerminatedCharacters):
1611         * wtf/DateMath.h:
1612         (JSC::GregorianDateTime::GregorianDateTime):
1613
1614 2009-11-08  David Levin  <levin@chromium.org>
1615
1616         Reviewed by NOBODY (chromium build fix).
1617         
1618         Hopefully, the last build fix.
1619
1620         Create better separation in DateMath about the JSC
1621         and non-JSC portions. Also, only expose the non-JSC
1622         version in the exports.
1623
1624         * JavaScriptCore.exp:
1625         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1626         * wtf/DateMath.cpp:
1627         (WTF::parseDateFromNullTerminatedCharacters):
1628         (JSC::getUTCOffset):
1629         (JSC::gregorianDateTimeToMS):
1630         (JSC::msToGregorianDateTime):
1631         (JSC::parseDateFromNullTerminatedCharacters):
1632         * wtf/DateMath.h:
1633         (JSC::gmtoffset):
1634
1635 2009-11-08  David Levin  <levin@chromium.org>
1636
1637         Reviewed by NOBODY (chromium build fix).
1638
1639         For the change in DateMath.
1640
1641         * config.h:
1642         * wtf/DateMath.cpp:
1643
1644 2009-11-06  Geoffrey Garen  <ggaren@apple.com>
1645
1646         Windows build fix: export some symbols.
1647
1648         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1649
1650 2009-11-06  Geoffrey Garen  <ggaren@apple.com>
1651
1652         Build fix: updated export file.
1653
1654         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1655
1656 2009-11-06  Geoffrey Garen  <ggaren@apple.com>
1657
1658         Build fix: added some #includes.
1659
1660         * wtf/CurrentTime.h:
1661         * wtf/DateMath.h:
1662
1663 2009-11-06  Geoffrey Garen  <ggaren@apple.com>
1664
1665         Reviewed by Oliver Hunt.
1666         
1667         https://bugs.webkit.org/show_bug.cgi?id=31197
1668         Implemented a timezone cache not based on Mac OS X's notify_check API.
1669         
1670         If the VM calculates the local timezone offset from UTC, it caches the
1671         result until the end of the current VM invocation. (We don't want to cache
1672         forever, because the user's timezone may change over time.)
1673         
1674         This removes notify_* overhead on Mac, and, more significantly, removes
1675         OS time and date call overhead on non-Mac platforms.
1676
1677         ~8% speedup on Date microbenchmark on Mac. SunSpider reports maybe a tiny
1678         speedup on Mac. (Speedup on non-Mac platforms should be even more noticeable.)
1679
1680         * JavaScriptCore.exp:
1681
1682         * interpreter/CachedCall.h:
1683         (JSC::CachedCall::CachedCall):
1684         * interpreter/Interpreter.cpp:
1685         (JSC::Interpreter::execute):
1686         * runtime/JSGlobalObject.h:
1687         (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope): Made the 
1688         DynamicGlobalObjectScope constructor responsible for checking whether a
1689         dynamicGlobalObject has already been set. This eliminated some duplicate
1690         client code, and allowed me to avoid adding even more duplicate client
1691         code. Made DynamicGlobalObjectScope responsible for resetting the
1692         local timezone cache upon first entry to the VM.
1693
1694         * runtime/DateConstructor.cpp:
1695         (JSC::constructDate):
1696         (JSC::callDate):
1697         (JSC::dateParse):
1698         (JSC::dateUTC):
1699         * runtime/DateConversion.cpp:
1700         (JSC::parseDate):
1701         * runtime/DateConversion.h:
1702         * runtime/DateInstance.cpp:
1703         (JSC::DateInstance::gregorianDateTime):
1704         * runtime/DateInstance.h:
1705         * runtime/DateInstanceCache.h:
1706         * runtime/DatePrototype.cpp:
1707         (JSC::setNewValueFromTimeArgs):
1708         (JSC::setNewValueFromDateArgs):
1709         (JSC::dateProtoFuncSetYear):
1710         * runtime/InitializeThreading.cpp:
1711         (JSC::initializeThreadingOnce):
1712         * runtime/JSGlobalData.cpp:
1713         (JSC::JSGlobalData::JSGlobalData):
1714         * runtime/JSGlobalData.h:
1715         * wtf/DateMath.cpp:
1716         (WTF::getCurrentUTCTime):
1717         (WTF::getCurrentUTCTimeWithMicroseconds):
1718         (WTF::getLocalTime):
1719         (JSC::getUTCOffset): Use the new cache. Also, see below.
1720         (JSC::gregorianDateTimeToMS):
1721         (JSC::msToGregorianDateTime):
1722         (JSC::initializeDates):
1723         (JSC::parseDateFromNullTerminatedCharacters): Simplified the way this function
1724         accounts for the local timezone offset, to accomodate our new caching API,
1725         and a (possibly misguided) caller in WebCore. Also, see below.
1726         * wtf/DateMath.h:
1727         (JSC::GregorianDateTime::GregorianDateTime): Moved most of the code in
1728         DateMath.* into the JSC namespace. The code needed to move so it could
1729         naturally interact with ExecState and JSGlobalData to support caching.
1730         Logically, it seemed right to move it, too, since this code is not really
1731         as low-level as the WTF namespace might imply -- it implements a set of
1732         date parsing and conversion quirks that are finely tuned to the JavaScript
1733         language. Also removed the Mac OS X notify_* infrastructure.
1734         
1735         * wtf/CurrentTime.h:
1736         (WTF::currentTimeMS):
1737         (WTF::getLocalTime): Moved the rest of the DateMath code here, and renamed
1738         it to make it consistent with WTF's currentTime function.
1739
1740 2009-11-06  Gabor Loki  <loki@inf.u-szeged.hu>
1741
1742         Unreviewed trivial buildfix after r50595.
1743
1744         Rename the remaining rshiftPtr calls to rshift32
1745
1746         * jit/JITArithmetic.cpp:
1747         (JSC::JIT::emit_op_rshift):
1748         * jit/JITInlineMethods.h:
1749         (JSC::JIT::emitFastArithImmToInt):
1750
1751 2009-11-06  Gavin Barraclough  <barraclough@apple.com>
1752
1753         Reviewed by Oliver Hunt.
1754
1755         Tidy up the shift methods on the macro-assembler interface.
1756
1757         Currently behaviour of shifts of a magnitude > 0x1f is undefined.
1758         Instead defined that all shifts are masked to this range.  This makes a lot of
1759         practical sense, both since having undefined behaviour is not particularly
1760         desirable, and because this behaviour is commonly required (particularly since
1761         it is required bt ECMA-262 for shifts).
1762
1763         Update the ARM assemblers to provide this behaviour.  Remove (now) redundant
1764         masks from JITArithmetic, and remove rshiftPtr (this was used in case that
1765         could be rewritten in a simpler form using rshift32, only optimized JSVALUE32
1766         on x86-64, which uses JSVALUE64!)
1767
1768         * assembler/MacroAssembler.h:
1769         * assembler/MacroAssemblerARM.h:
1770         (JSC::MacroAssemblerARM::lshift32):
1771         (JSC::MacroAssemblerARM::rshift32):
1772         * assembler/MacroAssemblerARMv7.h:
1773         (JSC::MacroAssemblerARMv7::lshift32):
1774         (JSC::MacroAssemblerARMv7::rshift32):
1775         * assembler/MacroAssemblerX86_64.h:
1776         * jit/JITArithmetic.cpp:
1777         (JSC::JIT::emit_op_lshift):
1778         (JSC::JIT::emit_op_rshift):
1779
1780 2009-11-05  Gavin Barraclough  <barraclough@apple.com>
1781
1782         Rubber Stamped by Oliver Hunt.
1783
1784         Remove a magic number (1) from the JIT, instead compute the value with OBJECT_OFFSET.
1785
1786         * jit/JITInlineMethods.h:
1787         (JSC::JIT::emitPutJITStubArg):
1788         (JSC::JIT::emitPutJITStubArgConstant):
1789         (JSC::JIT::emitGetJITStubArg):
1790         (JSC::JIT::emitPutJITStubArgFromVirtualRegister):
1791         * jit/JITStubCall.h:
1792         (JSC::JITStubCall::JITStubCall):
1793         (JSC::JITStubCall::getArgument):
1794         * jit/JITStubs.h:
1795
1796 2009-11-05  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
1797
1798         Reviewed by Gavin Barraclough.
1799
1800         https://bugs.webkit.org/show_bug.cgi?id=31159
1801         Fix branchDouble behaviour on ARM THUMB2 JIT.
1802
1803         The x86 branchDouble behaviour is reworked, and all JIT
1804         ports should follow the x86 port. See bug 31104 and 31151
1805
1806         This patch contains a fix for the traditional ARM port
1807
1808         * assembler/ARMAssembler.h:
1809         (JSC::ARMAssembler::):
1810         (JSC::ARMAssembler::fmrs_r):
1811         (JSC::ARMAssembler::ftosid_r):
1812         * assembler/MacroAssemblerARM.h:
1813         (JSC::MacroAssemblerARM::):
1814         (JSC::MacroAssemblerARM::branchDouble):
1815         (JSC::MacroAssemblerARM::branchConvertDoubleToInt32):
1816
1817 2009-11-05  Chris Jerdonek  <chris.jerdonek@gmail.com>
1818
1819         Reviewed by Eric Seidel.
1820
1821         Removed the "this is part of the KDE project" comments from 
1822         all *.h, *.cpp, *.idl, and *.pm files.
1823         
1824         https://bugs.webkit.org/show_bug.cgi?id=31167
1825         
1826         The maintenance and architecture page in the project wiki lists
1827         this as a task.
1828         
1829         This change includes no changes or additions to test cases 
1830         since the change affects only comments.
1831         
1832         * wtf/wince/FastMallocWince.h:
1833
1834 2009-11-05  Gabor Loki  <loki@inf.u-szeged.hu>
1835
1836         Reviewed by Gavin Barraclough.
1837
1838         Use ARMv7 specific encoding for immediate constants on ARMv7 target
1839         https://bugs.webkit.org/show_bug.cgi?id=31060
1840
1841         * assembler/ARMAssembler.cpp:
1842         (JSC::ARMAssembler::getOp2): Use INVALID_IMM
1843         (JSC::ARMAssembler::getImm): Use encodeComplexImm for complex immediate
1844         (JSC::ARMAssembler::moveImm): Ditto.
1845         (JSC::ARMAssembler::encodeComplexImm): Encode a constant by one or two
1846         instructions or a PC relative load.
1847         * assembler/ARMAssembler.h: Use INVALID_IMM if a constant cannot be
1848         encoded as an immediate constant.
1849         (JSC::ARMAssembler::):
1850         (JSC::ARMAssembler::movw_r): 16-bit immediate load
1851         (JSC::ARMAssembler::movt_r): High halfword 16-bit immediate load
1852         (JSC::ARMAssembler::getImm16Op2): Encode immediate constant for
1853         movw_r and mowt_r
1854
1855 2009-11-04  Mark Mentovai  <mark@chromium.org>
1856
1857         Reviewed by Mark Rowe.
1858
1859         Provide TARGETING_TIGER and TARGETING_LEOPARD as analogues to
1860         BUILDING_ON_TIGER and BUILDING_ON_LEOPARD.  The TARGETING_ macros
1861         consider the deployment target; the BUILDING_ON_ macros consider the
1862         headers being built against.
1863
1864         * wtf/Platform.h:
1865
1866 2009-11-04  Gavin Barraclough  <barraclough@apple.com>
1867
1868         Reviewed by Oliver Hunt.
1869
1870         https://bugs.webkit.org/show_bug.cgi?id=31151
1871         Fix branchDouble behaviour on ARM THUMB2 JIT.
1872
1873         The ARMv7 JIT is currently using ARMv7Assembler::ConditionEQ to branch
1874         for DoubleEqualOrUnordered, however this is incorrect – ConditionEQ won't
1875         branch on unordered operands.  Similarly, DoubleLessThanOrUnordered &
1876         DoubleLessThanOrEqualOrUnordered use ARMv7Assembler::ConditionLO &
1877         ARMv7Assembler::ConditionLS, whereas they should be using
1878         ARMv7Assembler::ConditionLT & ARMv7Assembler::ConditionLE.
1879
1880         Fix these, and fill out the missing DoubleConditions.
1881
1882         * assembler/MacroAssemblerARMv7.h:
1883         (JSC::MacroAssemblerARMv7::):
1884         (JSC::MacroAssemblerARMv7::branchDouble):
1885
1886 2009-11-04  Gavin Barraclough  <barraclough@apple.com>
1887
1888         Rubber Stamped by Oliver Hunt.
1889
1890         Enable native call optimizations on ARMv7.  (Existing ARM_TRADITIONAL
1891         implementation was generic, worked perfectly, just needed turning on).
1892
1893         * jit/JITOpcodes.cpp:
1894         * wtf/Platform.h:
1895
1896 2009-11-04  Gavin Barraclough  <barraclough@apple.com>
1897
1898         Rubber Stamped by Mark Rowe, Oliver Hunt, and Sam Weinig.
1899
1900         Add a missing assert to the ARMv7 JIT.
1901
1902         * assembler/ARMv7Assembler.h:
1903         (JSC::ARMThumbImmediate::ARMThumbImmediate):
1904
1905 2009-11-04  Mark Rowe  <mrowe@apple.com>
1906
1907         Rubber-stamped by Oliver Hunt.
1908
1909         Remove bogus op_ prefix on dumped version of three opcodes.
1910
1911         * bytecode/CodeBlock.cpp:
1912         (JSC::CodeBlock::dump):
1913
1914 2009-11-04  Mark Rowe  <mrowe@apple.com>
1915
1916         Reviewed by Sam Weinig.
1917
1918         Fix dumping of constants in bytecode so that they aren't printed as large positive register numbers.
1919
1920         We do this by having the registerName function return information about the constant if the register
1921         number corresponds to a constant.  This requires that registerName, and several functions that call it,
1922         be converted to member functions of CodeBlock so that the constant value can be retrieved.  The
1923         ExecState also needs to be threaded down through these functions so that it can be passed on to
1924         constantName when needed.
1925
1926         * bytecode/CodeBlock.cpp:
1927         (JSC::constantName):
1928         (JSC::CodeBlock::registerName):
1929         (JSC::CodeBlock::printUnaryOp):
1930         (JSC::CodeBlock::printBinaryOp):
1931         (JSC::CodeBlock::printConditionalJump):
1932         (JSC::CodeBlock::printGetByIdOp):
1933         (JSC::CodeBlock::printPutByIdOp):
1934         (JSC::CodeBlock::dump):
1935         * bytecode/CodeBlock.h:
1936         (JSC::CodeBlock::isConstantRegisterIndex):
1937
1938 2009-11-04  Pavel Heimlich  <tropikhajma@gmail.com>
1939
1940         Reviewed by Alexey Proskuryakov.
1941
1942         https://bugs.webkit.org/show_bug.cgi?id=30647
1943         Solaris build failure due to strnstr.
1944
1945         * wtf/StringExtras.h: Enable strnstr on Solaris, too.
1946
1947 2009-11-04  Gavin Barraclough  <barraclough@apple.com>
1948
1949         Reviewed by Oliver Hunt.
1950
1951         https://bugs.webkit.org/show_bug.cgi?id=31104
1952         Refactor x86-specific behaviour out of the JIT.
1953
1954         - Add explicit double branch conditions for ordered and unordered comparisons (presently the brehaviour is a mix).
1955         - Refactor double to int conversion out into the MacroAssembler.
1956         - Remove broken double to int conversion for !JSVALUE32_64 builds - this code was broken and slowing us down, fixing it showed it not to be an improvement.
1957         - Remove exclusion of double to int conversion from (1 % X) cases in JSVALUE32_64 builds - if this was of benefit this is no longer the case; simplify.
1958
1959         * assembler/MacroAssemblerARM.h:
1960         (JSC::MacroAssemblerARM::):
1961         * assembler/MacroAssemblerARMv7.h:
1962         (JSC::MacroAssemblerARMv7::):
1963         * assembler/MacroAssemblerX86Common.h:
1964         (JSC::MacroAssemblerX86Common::):
1965         (JSC::MacroAssemblerX86Common::convertInt32ToDouble):
1966         (JSC::MacroAssemblerX86Common::branchDouble):
1967         (JSC::MacroAssemblerX86Common::branchConvertDoubleToInt32):
1968         * jit/JITArithmetic.cpp:
1969         (JSC::JIT::emitBinaryDoubleOp):
1970         (JSC::JIT::emit_op_div):
1971         (JSC::JIT::emitSlow_op_jnless):
1972         (JSC::JIT::emitSlow_op_jnlesseq):
1973         * jit/JITOpcodes.cpp:
1974         (JSC::JIT::emit_op_jfalse):
1975
1976 2009-11-04  Mark Mentovai  <mark@chromium.org>
1977
1978         Reviewed by Eric Seidel.
1979
1980         Remove BUILDING_ON_LEOPARD from JavaScriptCore.gyp.  This is supposed
1981         to be set as needed only in wtf/Platform.h.
1982
1983         * JavaScriptCore.gyp/JavaScriptCore.gyp:
1984
1985 2009-11-02  Oliver Hunt  <oliver@apple.com>
1986
1987         Reviewed by Gavin Barraclough.
1988
1989         REGRESSION (r48573): JSC may incorrectly cache chain lookups with a dictionary at the head of the chain
1990         https://bugs.webkit.org/show_bug.cgi?id=31045
1991
1992         Add guards to prevent caching of prototype chain lookups with dictionaries at the
1993         head of the chain.  Also add a few tighter assertions to cached prototype lookups
1994         to catch this in future.
1995
1996         * interpreter/Interpreter.cpp:
1997         (JSC::Interpreter::tryCacheGetByID):
1998         (JSC::Interpreter::privateExecute):
1999         * jit/JITStubs.cpp:
2000         (JSC::JITThunks::tryCacheGetByID):
2001
2002 2009-11-02  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
2003
2004         Reviewed by Darin Adler.
2005
2006         PLATFORM(CF) should be set when building for Qt on Darwin
2007         https://bugs.webkit.org/show_bug.cgi?id=23671
2008
2009         * wtf/Platform.h: Turn on CF support if both QT and DARWIN
2010         platforms are defined.
2011
2012 2009-11-02  Dmitry Titov  <dimich@chromium.org>
2013
2014         Reviewed by David Levin.
2015
2016         Remove threadsafe refcounting from tasks used with WTF::MessageQueue.
2017         https://bugs.webkit.org/show_bug.cgi?id=30612
2018
2019         * wtf/MessageQueue.h:
2020         (WTF::MessageQueue::alwaysTruePredicate):
2021         (WTF::MessageQueue::~MessageQueue):
2022         (WTF::MessageQueue::append):
2023         (WTF::MessageQueue::appendAndCheckEmpty):
2024         (WTF::MessageQueue::prepend):
2025         (WTF::MessageQueue::waitForMessage):
2026         (WTF::MessageQueue::waitForMessageFilteredWithTimeout):
2027         (WTF::MessageQueue::tryGetMessage):
2028         (WTF::MessageQueue::removeIf):
2029         The MessageQueue is changed to act as a queue of OwnPtr<DataType>. It takes ownership
2030         of posted tasks and passes it to the new owner (in another thread) when the task is fetched.
2031         All methods have arguments of type PassOwnPtr<DataType> and return the same type.
2032
2033         * wtf/Threading.cpp:
2034         (WTF::createThread):
2035         Superficial change to trigger rebuild of JSC project on Windows,
2036         workaround for https://bugs.webkit.org/show_bug.cgi?id=30890
2037
2038 2009-10-30  Geoffrey Garen  <ggaren@apple.com>
2039
2040         Reviewed by Oliver Hunt.
2041
2042         Fixed failing layout test: restore a special case I accidentally deleted.
2043
2044         * runtime/DatePrototype.cpp:
2045         (JSC::setNewValueFromDateArgs): In the case of applying a change to a date
2046         that is NaN, reset the date to 0 *and* then apply the change; don't just
2047         reset the date to 0.
2048
2049 2009-10-30  Geoffrey Garen  <ggaren@apple.com>
2050
2051         Windows build fix: update for object-to-pointer change.
2052
2053         * runtime/DatePrototype.cpp:
2054         (JSC::formatLocaleDate):
2055
2056 2009-10-29  Geoffrey Garen  <ggaren@apple.com>
2057
2058         Reviewed by Darin Adler.
2059
2060         https://bugs.webkit.org/show_bug.cgi?id=30942
2061         Use pointers instead of copies to pass GregorianDateTime objects around.
2062         
2063         SunSpider reports a shocking 4.5% speedup on date-format-xparb, and 1.3%
2064         speedup on date-format-tofte.
2065
2066         * runtime/DateInstance.cpp:
2067         (JSC::DateInstance::gregorianDateTime):
2068         * runtime/DateInstance.h:
2069         * runtime/DatePrototype.cpp:
2070         (JSC::formatLocaleDate):
2071         (JSC::dateProtoFuncToString):
2072         (JSC::dateProtoFuncToUTCString):
2073         (JSC::dateProtoFuncToISOString):
2074         (JSC::dateProtoFuncToDateString):
2075         (JSC::dateProtoFuncToTimeString):
2076         (JSC::dateProtoFuncGetFullYear):
2077         (JSC::dateProtoFuncGetUTCFullYear):
2078         (JSC::dateProtoFuncToGMTString):
2079         (JSC::dateProtoFuncGetMonth):
2080         (JSC::dateProtoFuncGetUTCMonth):
2081         (JSC::dateProtoFuncGetDate):
2082         (JSC::dateProtoFuncGetUTCDate):
2083         (JSC::dateProtoFuncGetDay):
2084         (JSC::dateProtoFuncGetUTCDay):
2085         (JSC::dateProtoFuncGetHours):
2086         (JSC::dateProtoFuncGetUTCHours):
2087         (JSC::dateProtoFuncGetMinutes):
2088         (JSC::dateProtoFuncGetUTCMinutes):
2089         (JSC::dateProtoFuncGetSeconds):
2090         (JSC::dateProtoFuncGetUTCSeconds):
2091         (JSC::dateProtoFuncGetTimezoneOffset):
2092         (JSC::setNewValueFromTimeArgs):
2093         (JSC::setNewValueFromDateArgs):
2094         (JSC::dateProtoFuncSetYear):
2095         (JSC::dateProtoFuncGetYear): Renamed getGregorianDateTime to gregorianDateTime,
2096         since it no longer has an out parameter. Uses 0 to indicate invalid dates.
2097
2098 2009-10-30  Zoltan Horvath  <zoltan@webkit.org>
2099
2100         Reviewed by Darin Adler.
2101
2102         Allow custom memory allocation control for JavaScriptCore's ListHashSet
2103         https://bugs.webkit.org/show_bug.cgi?id=30853
2104
2105         Inherits ListHashSet class from FastAllocBase because it is
2106         instantiated by 'new' in WebCore/rendering/RenderBlock.cpp:1813.
2107
2108         * wtf/ListHashSet.h:
2109
2110 2009-10-30  Oliver Hunt  <oliver@apple.com>
2111
2112         Reviewed by Gavin Barraclough.
2113
2114         Regression: crash enumerating properties of an object with getters or setters
2115         https://bugs.webkit.org/show_bug.cgi?id=30948
2116
2117         Add a guard to prevent us trying to cache property enumeration on
2118         objects with getters or setters.
2119
2120         * runtime/JSPropertyNameIterator.cpp:
2121         (JSC::JSPropertyNameIterator::create):
2122
2123 2009-10-30  Roland Steiner  <rolandsteiner@chromium.org>
2124
2125         Reviewed by Eric Seidel.
2126
2127         Remove ENABLE_RUBY guards as discussed with Dave Hyatt and Maciej Stachowiak.
2128
2129         Bug 28420 -  Implement HTML5 <ruby> rendering
2130         (https://bugs.webkit.org/show_bug.cgi?id=28420)
2131  
2132         No new tests (no functional change).
2133
2134         * Configurations/FeatureDefines.xcconfig:
2135
2136 2009-10-29  Oliver Hunt  <oliver@apple.com>
2137
2138         Reviewed by Maciej Stachowiak.
2139
2140         REGRESSION (r50218-r50262): E*TRADE accounts page is missing content
2141         https://bugs.webkit.org/show_bug.cgi?id=30947
2142         <rdar://problem/7348833>
2143
2144         The logic for flagging that a structure has non-enumerable properties
2145         was in addPropertyWithoutTransition, rather than in the core Structure::put
2146         method.  Despite this I was unable to produce a testcase that caused
2147         the failure that etrade was experiencing, but the new assertion in
2148         getEnumerablePropertyNames triggers on numerous layout tests without
2149         the fix, so in effecti all for..in enumeration in any test ends up
2150         doing the required consistency check.
2151
2152         * runtime/Structure.cpp:
2153         (JSC::Structure::addPropertyWithoutTransition):
2154         (JSC::Structure::put):
2155         (JSC::Structure::getEnumerablePropertyNames):
2156         (JSC::Structure::checkConsistency):
2157
2158 2009-10-29  Gabor Loki  <loki@inf.u-szeged.hu>
2159
2160         Reviewed by Gavin Barraclough.
2161
2162         Add cacheFlush support for Thumb-2 on Linux
2163         https://bugs.webkit.org/show_bug.cgi?id=30865
2164
2165         * jit/ExecutableAllocator.h:
2166         (JSC::ExecutableAllocator::cacheFlush):
2167
2168 2009-10-28  Gavin Barraclough  <barraclough@apple.com>
2169
2170         Reviewed by Oliver Hunt.
2171
2172         JSC JIT on ARMv7 cannot link jumps >16Mb range
2173         https://bugs.webkit.org/show_bug.cgi?id=30891
2174
2175         Start planing all relative jumps as move-32-bit-immediate-to-register-BX.
2176         In the cases where the jump would fall within a relative jump range, use a relative jump.
2177
2178         * JavaScriptCore.xcodeproj/project.pbxproj:
2179         * assembler/ARMv7Assembler.h:
2180         (JSC::ARMv7Assembler::~ARMv7Assembler):
2181         (JSC::ARMv7Assembler::LinkRecord::LinkRecord):
2182         (JSC::ARMv7Assembler::):
2183         (JSC::ARMv7Assembler::executableCopy):
2184         (JSC::ARMv7Assembler::linkJump):
2185         (JSC::ARMv7Assembler::relinkJump):
2186         (JSC::ARMv7Assembler::setInt32):
2187         (JSC::ARMv7Assembler::isB):
2188         (JSC::ARMv7Assembler::isBX):
2189         (JSC::ARMv7Assembler::isMOV_imm_T3):
2190         (JSC::ARMv7Assembler::isMOVT):
2191         (JSC::ARMv7Assembler::isNOP_T1):
2192         (JSC::ARMv7Assembler::isNOP_T2):
2193         (JSC::ARMv7Assembler::linkJumpAbsolute):
2194         (JSC::ARMv7Assembler::twoWordOp5i6Imm4Reg4EncodedImmFirst):
2195         (JSC::ARMv7Assembler::twoWordOp5i6Imm4Reg4EncodedImmSecond):
2196         (JSC::ARMv7Assembler::ARMInstructionFormatter::twoWordOp5i6Imm4Reg4EncodedImm):
2197         * assembler/MacroAssemblerARMv7.h:
2198         (JSC::MacroAssemblerARMv7::makeJump):
2199         (JSC::MacroAssemblerARMv7::makeBranch):
2200         * jit/JIT.h:
2201         * wtf/Platform.h:
2202
2203 2009-10-28  Oliver Hunt  <oliver@apple.com>
2204
2205         Reviewed by Geoff Garen.
2206
2207         Improve for..in enumeration performance
2208         https://bugs.webkit.org/show_bug.cgi?id=30887
2209
2210         Improve indexing of an object with a for..in iterator by
2211         identifying cases where get_by_val is being used with a iterator
2212         as the subscript and replace it with a new get_by_pname
2213         bytecode.  get_by_pname then optimizes lookups that directly access
2214         the base object.
2215
2216         * bytecode/CodeBlock.cpp:
2217         (JSC::CodeBlock::dump):
2218         * bytecode/Opcode.h:
2219         * bytecompiler/BytecodeGenerator.cpp:
2220         (JSC::BytecodeGenerator::emitGetByVal):
2221         * bytecompiler/BytecodeGenerator.h:
2222         (JSC::BytecodeGenerator::pushOptimisedForIn):
2223         (JSC::BytecodeGenerator::popOptimisedForIn):
2224         * interpreter/Interpreter.cpp:
2225         (JSC::Interpreter::privateExecute):
2226         * jit/JIT.cpp:
2227         (JSC::JIT::privateCompileMainPass):
2228         (JSC::JIT::privateCompileSlowCases):
2229         * jit/JIT.h:
2230         * jit/JITPropertyAccess.cpp:
2231         (JSC::JIT::compileGetDirectOffset):
2232         (JSC::JIT::emit_op_get_by_pname):
2233         (JSC::JIT::emitSlow_op_get_by_pname):
2234         * parser/Nodes.cpp:
2235         (JSC::ForInNode::emitBytecode):
2236         * runtime/JSObject.h:
2237         * runtime/JSPropertyNameIterator.cpp:
2238         (JSC::JSPropertyNameIterator::create):
2239         * runtime/JSPropertyNameIterator.h:
2240         (JSC::JSPropertyNameIterator::getOffset):
2241         (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
2242         * runtime/JSValue.h:
2243         (JSC::JSValue::):
2244         * runtime/Structure.cpp:
2245         (JSC::Structure::addPropertyTransition):
2246         (JSC::Structure::changePrototypeTransition):
2247         (JSC::Structure::despecifyFunctionTransition):
2248         (JSC::Structure::addAnonymousSlotsTransition):
2249         (JSC::Structure::getterSetterTransition):
2250         (JSC::Structure::toDictionaryTransition):
2251         (JSC::Structure::addPropertyWithoutTransition):
2252           Track the existence (or not) of non-enumerable properties.
2253         * runtime/Structure.h:
2254         (JSC::Structure::propertyStorageCapacity):
2255         (JSC::Structure::propertyStorageSize):
2256         (JSC::Structure::hasNonEnumerableProperties):
2257         (JSC::Structure::hasAnonymousSlots):
2258
2259 2009-10-28  Dmitry Titov  <dimich@chromium.org>
2260
2261         Not reviewed, attemp to fix Windows build.
2262
2263         Touch the cpp file to cause recompile.
2264
2265         * wtf/Threading.cpp:
2266         (WTF::threadEntryPoint):
2267
2268 2009-10-28  Dmitry Titov  <dimich@chromium.org>
2269
2270         Reviewed by David Levin.
2271
2272         https://bugs.webkit.org/show_bug.cgi?id=30805
2273         Add MessageQueue::removeIf(Predicate&) to remove certain tasks without pulling them from the queue.
2274         Existing Database tests cover this since Database removes tasks when it is stopped.
2275
2276         * wtf/MessageQueue.h:
2277         (WTF::::removeIf):
2278
2279 2009-10-28  Afonso R. Costa Jr.  <afonso.costa@openbossa.org>
2280
2281         Reviewed by Oliver Hunt.
2282
2283         [Qt] Enable YARR when YARR_JIT is enabled
2284         https://bugs.webkit.org/show_bug.cgi?id=30730
2285
2286         When enabling or disabling JIT using JAVASCRIPTCORE_JIT, the ENABLE_YARR should
2287         be toggled also.
2288
2289         * JavaScriptCore.pri:
2290
2291 2009-10-24  Martin Robinson  <martin.james.robinson@gmail.com>
2292
2293         Reviewed by Oliver Hunt.
2294
2295         Fix strict aliasing warning by switching reinterpret_cast to bitwise_cast.
2296
2297         strict-aliasing warnings in JSFunction.h
2298         https://bugs.webkit.org/show_bug.cgi?id=27869
2299
2300         * runtime/JSFunction.h:
2301         (JSC::JSFunction::nativeFunction):
2302         (JSC::JSFunction::scopeChain):
2303         (JSC::JSFunction::setScopeChain):
2304         (JSC::JSFunction::setNativeFunction):
2305
2306 2009-10-28  Jan-Arve Sæther <jan-arve.saether@nokia.com>
2307
2308         Reviewed by Tor Arne Vestbø.
2309
2310         Build-fix for 64-bit Windows
2311
2312         * wtf/Platform.h: Make sure to use WTF_USE_JSVALUE64
2313
2314 2009-10-28  Gavin Barraclough  <barraclough@apple.com>
2315
2316         Reviewed by NOBODY (build fix!).
2317
2318         * jit/JIT.h:
2319
2320 2009-10-26  Holger Hans Peter Freyther  <zecke@selfish.org>
2321
2322         Rubber-stamped by Darin Adler.
2323
2324         Export fastMalloc, fastCalloc, fastRealloc and fastFree on GCC/Unix
2325         https://bugs.webkit.org/show_bug.cgi?id=30769
2326
2327         When using -fvisibility=hidden to hide all internal symbols by default
2328         the malloc symbols will be hidden as well. For memory instrumentation
2329         it is needed to provide an instrumented version of these symbols and
2330         override the normal routines and by changing the visibility back to
2331         default this becomes possible.
2332
2333         The only other solution would be to use system malloc instead of the
2334         TCmalloc implementation but this will not allow to analyze memory
2335         behavior with the default allocator.
2336
2337         * wtf/FastMalloc.h: Define WTF_FAST_MALLOC_EXPORT for GCC and !darwin
2338
2339 2009-10-27  Gavin Barraclough  <barraclough@apple.com>
2340
2341         Rubber Stamped by Samuel Q. Weinig.
2342
2343         Make the asserts protecting the offsets in the JIT more descriptive.
2344
2345         * jit/JIT.h:
2346         * jit/JITCall.cpp:
2347         (JSC::JIT::compileOpCall):
2348         * jit/JITPropertyAccess.cpp:
2349         (JSC::JIT::emit_op_method_check):
2350         (JSC::JIT::compileGetByIdHotPath):
2351         (JSC::JIT::compileGetByIdSlowCase):
2352         (JSC::JIT::emit_op_put_by_id):
2353
2354 2009-10-27  Geoffrey Garen  <ggaren@apple.com>
2355
2356         Reviewed by Sam Weinig.
2357
2358         A little bit of refactoring in the date code.
2359
2360         * JavaScriptCore.exp: Don't export this unused symbol.
2361
2362         * runtime/DateConstructor.cpp:
2363         (JSC::constructDate):
2364
2365         * runtime/DateInstance.cpp:
2366         (JSC::DateInstance::DateInstance):
2367         * runtime/DateInstance.h: Removed some unused functions. Changed the default
2368         constructor to ensure that a DateInstance is always initialized.
2369
2370         * runtime/DatePrototype.cpp:
2371         (JSC::DatePrototype::DatePrototype): Pass an initializer to our constructor,
2372         since it now requires one.
2373
2374         * wtf/DateMath.cpp:
2375         (WTF::msToGregorianDateTime): Only compute our offset from UTC if our
2376         output will require it. Otherwise, our offset is 0.
2377
2378 2009-10-27  Geoffrey Garen  <ggaren@apple.com>
2379
2380         Build fix: Mark DateInstaceCache.h private, so other frameworks can see it.
2381
2382         * JavaScriptCore.xcodeproj/project.pbxproj:
2383
2384 2009-10-27  Geoffrey Garen  <ggaren@apple.com>
2385
2386         Build fix: re-readded this file.
2387
2388         * runtime/DateInstanceCache.h: Added.
2389         (JSC::DateInstanceData::create):
2390         (JSC::DateInstanceData::DateInstanceData):
2391         (JSC::DateInstanceCache::DateInstanceCache):
2392         (JSC::DateInstanceCache::add):
2393         (JSC::DateInstanceCache::lookup):
2394
2395 2009-10-27  Geoffrey Garen  <ggaren@apple.com>
2396
2397         Reviewed by Darin Adler and Oliver Hunt.
2398
2399         https://bugs.webkit.org/show_bug.cgi?id=30800
2400         Cache recently computed date data.
2401         
2402         SunSpider reports a ~0.5% speedup, mostly from date-format-tofte.js.
2403
2404         * GNUmakefile.am:
2405         * JavaScriptCore.gypi:
2406         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2407         * JavaScriptCore.xcodeproj/project.pbxproj: Added new file.
2408
2409         * runtime/DateInstance.cpp:
2410         (JSC::DateInstance::DateInstance):
2411         (JSC::DateInstance::getGregorianDateTime): Use the shared cache.
2412
2413         * runtime/DateInstance.h: Renamed m_cache to m_data, to avoid the confusion
2414         of a "cache cache".
2415
2416         * runtime/DatePrototype.cpp:
2417         (JSC::formatLocaleDate):
2418         (JSC::dateProtoFuncToString):
2419         (JSC::dateProtoFuncToUTCString):
2420         (JSC::dateProtoFuncToISOString):
2421         (JSC::dateProtoFuncToDateString):
2422         (JSC::dateProtoFuncToTimeString):
2423         (JSC::dateProtoFuncGetFullYear):
2424         (JSC::dateProtoFuncGetUTCFullYear):
2425         (JSC::dateProtoFuncToGMTString):
2426         (JSC::dateProtoFuncGetMonth):
2427         (JSC::dateProtoFuncGetUTCMonth):
2428         (JSC::dateProtoFuncGetDate):
2429         (JSC::dateProtoFuncGetUTCDate):
2430         (JSC::dateProtoFuncGetDay):
2431         (JSC::dateProtoFuncGetUTCDay):
2432         (JSC::dateProtoFuncGetHours):
2433         (JSC::dateProtoFuncGetUTCHours):
2434         (JSC::dateProtoFuncGetMinutes):
2435         (JSC::dateProtoFuncGetUTCMinutes):
2436         (JSC::dateProtoFuncGetSeconds):
2437         (JSC::dateProtoFuncGetUTCSeconds):
2438         (JSC::dateProtoFuncGetTimezoneOffset):
2439         (JSC::setNewValueFromTimeArgs):
2440         (JSC::setNewValueFromDateArgs):
2441         (JSC::dateProtoFuncSetYear):
2442         (JSC::dateProtoFuncGetYear): Pass an ExecState to these functions, so they
2443         can access the DateInstanceCache.
2444
2445         * runtime/JSGlobalData.h: Keep a DateInstanceCache.
2446
2447 2009-10-27  James Robinson  <jamesr@chromium.org>
2448
2449         Reviewed by Darin Fisher.
2450
2451         Ensures that JavaScriptCore/wtf/CurrentTime.cpp is not built in PLATFORM(CHROMIUM) builds.
2452
2453         Chromium uses a different method to calculate the current time than is used in
2454         JavaScriptCore/wtf/CurrentTime.cpp. This can lead to time skew when calls to currentTime() and Chromium's time
2455         function are mixed.  In particular, timers can get scheduled in the past which leads to 100% CPU use.
2456         See http://code.google.com/p/chromium/issues/detail?id=25892 for an example.
2457
2458         https://bugs.webkit.org/show_bug.cgi?id=30833
2459
2460         * JavaScriptCore.gyp/JavaScriptCore.gyp:
2461         * wtf/CurrentTime.cpp:
2462
2463 2009-10-27  Peter Varga  <pvarga@inf.u-szeged.hu>
2464
2465         Rubber-stamped by Tor Arne Vestbø.
2466
2467         Fix typo in RegexInterpreter.cpp and RegexJIT.cpp alterantive to
2468         alternative.
2469
2470         * yarr/RegexInterpreter.cpp:
2471         (JSC::Yarr::ByteCompiler::alternativeBodyDisjunction):
2472         (JSC::Yarr::ByteCompiler::alternativeDisjunction):
2473         (JSC::Yarr::ByteCompiler::emitDisjunction):
2474         * yarr/RegexJIT.cpp:
2475         (JSC::Yarr::RegexGenerator::generateDisjunction):
2476
2477 2009-10-26  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
2478
2479         Reviewed by Darin Adler.
2480
2481         Make .rc files compile on Windows without depending on MFC headers
2482         https://bugs.webkit.org/show_bug.cgi?id=30750
2483
2484         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.rc: Use
2485         winresrc.h because it exists even when MFC is not installed, and is
2486         all that's needed here.
2487
2488 2009-10-26  Gabor Loki  <loki@inf.u-szeged.hu>
2489
2490         Reviewed by Gavin Barraclough.
2491
2492         The thunkReturnAddress is on JITStackFrame on ARM JIT as well
2493         https://bugs.webkit.org/show_bug.cgi?id=30782
2494
2495         Move the thunkReturnAddress from top of the stack into the JITStackFrame
2496         structure. This is a requirement for JSValue32_64 support on ARM.
2497
2498         * assembler/MacroAssemblerARM.h:
2499         (JSC::MacroAssemblerARM::ret): Return with link register
2500         (JSC::MacroAssemblerARM::prepareCall): Store the return address in link register
2501         * jit/JIT.h: Remove unused ctiReturnRegister
2502         * jit/JITInlineMethods.h: Same as ARMv7
2503         (JSC::JIT::restoreArgumentReference): Ditto.
2504         (JSC::JIT::restoreArgumentReferenceForTrampoline): Ditto.
2505         * jit/JITOpcodes.cpp: Remove ctiReturnRegister related instruction
2506         * jit/JITStubs.cpp: Store thunkReturnAddress on JITStackFrame. Use
2507         small trampoline functions which handle return addresses for each
2508         CTI_STUB_FUNCTION.
2509         * jit/JITStubs.h: Store thunkReturnAddress on JITStackFrame
2510         (JSC::JITStackFrame::returnAddressSlot): Return with the address of thunkReturnAddress
2511         * yarr/RegexJIT.cpp:
2512         (JSC::Yarr::RegexGenerator::generateEnter): Remove the unnecessary instruction
2513
2514 2009-10-26  Steve Block  <steveblock@google.com>
2515
2516         Reviewed by Darin Adler.
2517
2518         Adds ability to disable ReadWriteLock on platforms (eg Android) that use pthreads but do not support pthread_rwlock.
2519         https://bugs.webkit.org/show_bug.cgi?id=30713
2520
2521         * wtf/Platform.h: Modified. Defines HAVE_PTHREAD_RWLOCK for all platforms currently using pthreads.
2522         * wtf/Threading.h: Modified. Use pthread_rwlock_t only when HAVE_PTHREAD_RWLOCK is defined.
2523         * wtf/ThreadingPthreads.cpp: Modified. Build ReadWriteLock methods only when HAVE_PTHREAD_RWLOCK is defined.
2524
2525 2009-10-24  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
2526
2527         Reviewed by Holger Freyther.
2528
2529         [Qt] [Symbian] Set the capability and memory required to run QtWebKit for Symbian
2530         https://bugs.webkit.org/show_bug.cgi?id=30476
2531
2532         Assign ReadUserData WriteUserData NetworkServices Symbian capabilities
2533         to jsc.exe.
2534
2535         * jsc.pro:
2536
2537 2009-10-23  Steve Block  <steveblock@google.com>
2538
2539         Reviewed by Dmitry Titov.
2540
2541         Fixes a leak in createThreadInternal on Android.
2542         https://bugs.webkit.org/show_bug.cgi?id=30698
2543
2544         * wtf/ThreadingPthreads.cpp: Modified.
2545         (WTF::createThreadInternal): Avoid leaking a ThreadData object on failure.
2546
2547 2009-10-22  Geoffrey Garen  <ggaren@apple.com>
2548
2549         Reviewed by Alexey Proskuryakov.
2550
2551         Fixed ASSERT when opening Safari's Caches window while the Web Inspector
2552         is open.
2553
2554         * runtime/Collector.cpp:
2555         (JSC::typeName): Added two new types to the type name list in the Collector.
2556         These types have been around for a while, but nobody remembered to consider them here.
2557
2558         * runtime/JSCell.h:
2559         (JSC::JSCell::isPropertyNameIterator):
2560         * runtime/JSPropertyNameIterator.h:
2561         (JSC::JSPropertyNameIterator::isPropertyNameIterator): Give the Collector
2562         a way to tell if a cell is a JSPropertyNameIterator.
2563
2564 2009-10-22  Steve Falkenburg  <sfalken@apple.com>
2565
2566         Reviewed by Jon Honeycutt.
2567
2568         https://bugs.webkit.org/show_bug.cgi?id=30686
2569         Remove debug-specific def file.
2570         Only Debug_All target uses JavaScriptCore_debug.dll naming, and since
2571         that target is only used internally, maintaining two files just to
2572         suppress a single link warning isn't worthwhile.
2573
2574         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
2575         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: Removed.
2576
2577 2009-10-21  Jon Honeycutt  <jhoneycutt@apple.com>
2578
2579         <rdar://problem/7270320> Screenshots of off-screen plug-ins are blank
2580         <rdar://problem/7270314> After halting a transparent PluginView on
2581         Windows, the transparency is applied twice
2582
2583         Reviewed by Dan Bernstein.
2584
2585         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2586         Export WTF::deleteOwnedPtr(HDC).
2587
2588         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
2589         Ditto.
2590
2591 2009-10-20  Geoffrey Garen  <ggaren@apple.com>
2592
2593         Windows build fix: updated variable name.
2594
2595         * runtime/DatePrototype.cpp:
2596         (JSC::formatLocaleDate):
2597
2598 2009-10-20  Geoffrey Garen  <ggaren@apple.com>
2599
2600         Reviewed by Mark Rowe.
2601
2602         * jit/JITOpcodes.cpp:
2603         (JSC::JIT::emit_op_next_pname): Slightly tweaked this #ifdef to match the
2604         size of a JSValue because m_jsStrings is an array of JSValues.
2605
2606 2009-10-20  Geoffrey Garen  <ggaren@apple.com>
2607
2608         Reviewed by Mark Rowe.
2609
2610         Fixed a 64-bit regression caused by the fix for
2611         https://bugs.webkit.org/show_bug.cgi?id=30570.
2612
2613         * jit/JITOpcodes.cpp:
2614         (JSC::JIT::emit_op_next_pname): Use TimesEight stepping on 64-bit, since
2615         64-bit pointers are eight bytes long.
2616
2617 2009-10-20  Geoffrey Garen  <ggaren@apple.com>
2618
2619         Reviewed by Sam Weinig.
2620
2621         Refactored DateInstance::msToGregorianDateTime so that a DateInstance's
2622         caller doesn't need to supply the DateInstance's own internal value to
2623         the DateInstance.
2624
2625         * runtime/DateInstance.cpp:
2626         (JSC::DateInstance::getGregorianDateTime): Renamed from "msToGregorianDateTime".
2627
2628         * runtime/DateInstance.h:
2629         * runtime/DatePrototype.cpp:
2630         (JSC::formatLocaleDate):
2631         (JSC::dateProtoFuncToString):
2632         (JSC::dateProtoFuncToUTCString):
2633         (JSC::dateProtoFuncToISOString):
2634         (JSC::dateProtoFuncToDateString):
2635         (JSC::dateProtoFuncToTimeString):
2636         (JSC::dateProtoFuncToLocaleString):
2637         (JSC::dateProtoFuncToLocaleDateString):
2638         (JSC::dateProtoFuncToLocaleTimeString):
2639         (JSC::dateProtoFuncGetTime):
2640         (JSC::dateProtoFuncGetFullYear):
2641         (JSC::dateProtoFuncGetUTCFullYear):
2642         (JSC::dateProtoFuncToGMTString):
2643         (JSC::dateProtoFuncGetMonth):
2644         (JSC::dateProtoFuncGetUTCMonth):
2645         (JSC::dateProtoFuncGetDate):
2646         (JSC::dateProtoFuncGetUTCDate):
2647         (JSC::dateProtoFuncGetDay):
2648         (JSC::dateProtoFuncGetUTCDay):
2649         (JSC::dateProtoFuncGetHours):
2650         (JSC::dateProtoFuncGetUTCHours):
2651         (JSC::dateProtoFuncGetMinutes):
2652         (JSC::dateProtoFuncGetUTCMinutes):
2653         (JSC::dateProtoFuncGetSeconds):
2654         (JSC::dateProtoFuncGetUTCSeconds):
2655         (JSC::dateProtoFuncGetTimezoneOffset):
2656         (JSC::setNewValueFromTimeArgs):
2657         (JSC::setNewValueFromDateArgs):
2658         (JSC::dateProtoFuncSetYear):
2659         (JSC::dateProtoFuncGetYear): Also renamed "utc" to "outputIsUTC", for clarity.
2660
2661 2009-10-20  Gabor Loki  <loki@inf.u-szeged.hu>
2662
2663         Reviewed by Geoffrey Garen.
2664
2665         The op_next_pname should use 4 bytes addressing mode in case of JSValue32
2666         https://bugs.webkit.org/show_bug.cgi?id=30570
2667
2668         * jit/JITOpcodes.cpp:
2669         (JSC::JIT::emit_op_next_pname):
2670
2671 2009-10-20  Gabor Loki  <loki@inf.u-szeged.hu>
2672
2673         Reviewed by Oliver Hunt.
2674
2675         Move OverridesMarkChildren flag from DatePrototype to its parent class
2676         https://bugs.webkit.org/show_bug.cgi?id=30372
2677
2678         * runtime/DateInstance.h:
2679         (JSC::DateInstance::createStructure):
2680         * runtime/DatePrototype.h:
2681
2682 2009-10-19  Geoffrey Garen  <ggaren@apple.com>
2683
2684         Reviewed by Oliver Hunt.
2685
2686         Tightened up some put_by_id_transition code generation.
2687         https://bugs.webkit.org/show_bug.cgi?id=30539
2688
2689         * jit/JIT.h:
2690         * jit/JITPropertyAccess.cpp:
2691         (JSC::JIT::testPrototype):
2692         (JSC::JIT::privateCompilePutByIdTransition): No need to do object type
2693         checks or read Structures and prototypes from objects: they're all known
2694         constants at compile time.
2695
2696 2009-10-19  Geoffrey Garen  <ggaren@apple.com>
2697
2698         Reviewed by Sam Weinig.
2699
2700         Added a private API for getting a global context from a context, for
2701         clients who want to preserve a context for a later callback.
2702
2703         * API/APICast.h:
2704         (toGlobalRef): Added an ASSERT, since this function is used more often
2705         than before.
2706
2707         * API/JSContextRef.cpp:
2708         * API/JSContextRefPrivate.h: Added. The new API.
2709
2710         * API/tests/testapi.c:
2711         (print_callAsFunction):
2712         (main): Test the new API.
2713
2714         * JavaScriptCore.exp:
2715         * JavaScriptCore.xcodeproj/project.pbxproj: Build and export the new API.
2716
2717 2009-10-17  Geoffrey Garen  <ggaren@apple.com>
2718
2719         Reviewed by Oliver Hunt.
2720         
2721         Tightened up some instanceof code generation.
2722         https://bugs.webkit.org/show_bug.cgi?id=30488
2723
2724         * jit/JITOpcodes.cpp:
2725         (JSC::JIT::emit_op_instanceof):
2726         (JSC::JIT::emitSlow_op_instanceof): No need to do object type checks - 
2727         cell type checks and ImplementsDefaultHasIntance checks implicitly
2728         supersede object type checks.
2729
2730 2009-10-18  Kwang Yul Seo  <skyul@company100.net>
2731
2732         Reviewed by Darin Adler.
2733
2734         Use _stricmp and _strnicmp instead of deprecated stricmp and strnicmp.
2735         https://bugs.webkit.org/show_bug.cgi?id=30474
2736
2737         stricmp and strnicmp are deprecated beginning in Visual
2738         C++ 2005. Use _stricmp and _strnicmp instead in StringExtras.h.
2739
2740         * wtf/StringExtras.h:
2741         (strncasecmp):
2742         (strcasecmp):
2743
2744 2009-10-16  Geoffrey Garen  <ggaren@apple.com>
2745
2746         Build fix: apparently we shouldn't export those symbols?
2747
2748         * JavaScriptCore.exp:
2749
2750 2009-10-16  Geoffrey Garen  <ggaren@apple.com>
2751
2752         Build fix: export some symbols.
2753
2754         * JavaScriptCore.exp:
2755
2756 2009-10-16  Oliver Hunt  <oliver@apple.com>
2757
2758         Reviewed by Gavin Barraclough.
2759
2760         structure typeinfo flags should be inherited.
2761         https://bugs.webkit.org/show_bug.cgi?id=30468
2762
2763         Add StructureFlag constant to the various JSC classes and use
2764         it for the TypeInfo construction.  This allows us to simply
2765         accumulate flags by basing each classes StructureInfo on its parents.
2766
2767         * API/JSCallbackConstructor.h:
2768         (JSC::JSCallbackConstructor::createStructure):
2769         * API/JSCallbackFunction.h:
2770         (JSC::JSCallbackFunction::createStructure):
2771         * API/JSCallbackObject.h:
2772         (JSC::JSCallbackObject::createStructure):
2773         * debugger/DebuggerActivation.h:
2774         (JSC::DebuggerActivation::createStructure):
2775         * runtime/Arguments.h:
2776         (JSC::Arguments::createStructure):
2777         * runtime/BooleanObject.h:
2778         (JSC::BooleanObject::createStructure):
2779         * runtime/DatePrototype.h:
2780         (JSC::DatePrototype::createStructure):
2781         * runtime/FunctionPrototype.h:
2782         (JSC::FunctionPrototype::createStructure):
2783         * runtime/GlobalEvalFunction.h:
2784         (JSC::GlobalEvalFunction::createStructure):
2785         * runtime/InternalFunction.h:
2786         (JSC::InternalFunction::createStructure):
2787         * runtime/JSActivation.h:
2788         (JSC::JSActivation::createStructure):
2789         * runtime/JSArray.h:
2790         (JSC::JSArray::createStructure):
2791         * runtime/JSByteArray.cpp:
2792         (JSC::JSByteArray::createStructure):
2793         * runtime/JSByteArray.h:
2794         * runtime/JSFunction.h:
2795         (JSC::JSFunction::createStructure):
2796         * runtime/JSGlobalObject.h:
2797         (JSC::JSGlobalObject::createStructure):
2798         * runtime/JSNotAnObject.h:
2799         (JSC::JSNotAnObject::createStructure):
2800         * runtime/JSONObject.h:
2801         (JSC::JSONObject::createStructure):
2802         * runtime/JSObject.h:
2803         (JSC::JSObject::createStructure):
2804         * runtime/JSStaticScopeObject.h:
2805         (JSC::JSStaticScopeObject::createStructure):
2806         * runtime/JSVariableObject.h:
2807         (JSC::JSVariableObject::createStructure):
2808         * runtime/JSWrapperObject.h:
2809         (JSC::JSWrapperObject::createStructure):
2810         * runtime/MathObject.h:
2811         (JSC::MathObject::createStructure):
2812         * runtime/NumberConstructor.h:
2813         (JSC::NumberConstructor::createStructure):
2814         * runtime/NumberObject.h:
2815         (JSC::NumberObject::createStructure):
2816         * runtime/RegExpConstructor.h:
2817         (JSC::RegExpConstructor::createStructure):
2818         * runtime/RegExpObject.h:
2819         (JSC::RegExpObject::createStructure):
2820         * runtime/StringObject.h:
2821         (JSC::StringObject::createStructure):
2822         * runtime/StringObjectThatMasqueradesAsUndefined.h:
2823         (JSC::StringObjectThatMasqueradesAsUndefined::createStructure):
2824
2825 2009-10-16  Geoffrey Garen  <ggaren@apple.com>
2826
2827         Reviewed by Oliver Hunt.
2828         
2829         Fast for-in enumeration: Cache JSPropertyNameIterator; cache JSStrings
2830         in JSPropertyNameIterator; inline more code.
2831
2832         1.024x as fast on SunSpider (fasta: 1.43x as fast).
2833
2834         * bytecode/CodeBlock.cpp:
2835         (JSC::CodeBlock::dump):
2836         * bytecode/Opcode.h:
2837         * bytecompiler/BytecodeGenerator.cpp:
2838         (JSC::BytecodeGenerator::emitGetPropertyNames):
2839         (JSC::BytecodeGenerator::emitNextPropertyName):
2840         * bytecompiler/BytecodeGenerator.h: Added a few extra operands to
2841         op_get_pnames and op_next_pname so that we can track iteration state
2842         in the register file instead of in the JSPropertyNameIterator. (To be
2843         cacheable, the JSPropertyNameIterator must be stateless.)
2844
2845         * interpreter/Interpreter.cpp:
2846         (JSC::Interpreter::tryCachePutByID):
2847         (JSC::Interpreter::tryCacheGetByID): Updated for rename to
2848         "normalizePrototypeChain" and removal of "isCacheable". 
2849
2850         (JSC::Interpreter::privateExecute): Updated for in-RegisterFile
2851         iteration state tracking.
2852
2853         * jit/JIT.cpp:
2854         (JSC::JIT::privateCompileMainPass):
2855         * jit/JIT.h:
2856         * jit/JITOpcodes.cpp:
2857         (JSC::JIT::emit_op_get_pnames): Updated for in-RegisterFile
2858         iteration state tracking.
2859
2860         (JSC::JIT::emit_op_next_pname): Inlined code generation for op_next_pname.
2861
2862         * jit/JITStubs.cpp:
2863         (JSC::JITThunks::tryCachePutByID):
2864         (JSC::JITThunks::tryCacheGetByID): Updated for rename to
2865         "normalizePrototypeChain" and removal of "isCacheable". 
2866
2867         (JSC::DEFINE_STUB_FUNCTION):
2868         * jit/JITStubs.h:
2869         (JSC::): Added has_property and to_object stubs. Removed op_next_pname
2870         stub, since has_property is all we need anymore.
2871
2872         * parser/Nodes.cpp:
2873         (JSC::ForInNode::emitBytecode): Updated for in-RegisterFile
2874         iteration state tracking.
2875
2876         * runtime/JSCell.h:
2877         * runtime/JSObject.cpp:
2878         (JSC::JSObject::getPropertyNames): Don't do caching at this layer
2879         anymore, since we don't create a JSPropertyNameIterator at this layer.
2880
2881         * runtime/JSPropertyNameIterator.cpp:
2882         (JSC::JSPropertyNameIterator::create): Do do caching at this layer.
2883         (JSC::JSPropertyNameIterator::get):  Updated for in-RegisterFile
2884         iteration state tracking.
2885         (JSC::JSPropertyNameIterator::markChildren): Mark our JSStrings.
2886
2887         * runtime/JSPropertyNameIterator.h:
2888         (JSC::JSPropertyNameIterator::size):
2889         (JSC::JSPropertyNameIterator::setCachedStructure):
2890         (JSC::JSPropertyNameIterator::cachedStructure):
2891         (JSC::JSPropertyNameIterator::setCachedPrototypeChain):
2892         (JSC::JSPropertyNameIterator::cachedPrototypeChain):
2893         (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
2894         (JSC::Structure::setEnumerationCache): Don't store iteration state in
2895         a JSPropertyNameIterator. Do cache a JSPropertyNameIterator in a
2896         Structure.
2897
2898         * runtime/JSValue.h:
2899         (JSC::asCell):
2900         * runtime/MarkStack.h: Make those mischievous #include gods happy.
2901
2902         * runtime/ObjectConstructor.cpp:
2903
2904         * runtime/Operations.h:
2905         (JSC::normalizePrototypeChain): Renamed countPrototypeChainEntriesAndCheckForProxies
2906         to normalizePrototypeChain, since it changes dictionary prototypes to
2907         non-dictionary objects.
2908
2909         * runtime/PropertyNameArray.cpp:
2910         (JSC::PropertyNameArray::add):
2911         * runtime/PropertyNameArray.h:
2912         (JSC::PropertyNameArrayData::PropertyNameArrayData):
2913         (JSC::PropertyNameArray::data):
2914         (JSC::PropertyNameArray::size):
2915         (JSC::PropertyNameArray::begin):
2916         (JSC::PropertyNameArray::end): Simplified some code here to help with
2917         current and future refactoring.
2918
2919         * runtime/Protect.h:
2920         * runtime/Structure.cpp:
2921         (JSC::Structure::~Structure):
2922         (JSC::Structure::addPropertyWithoutTransition):
2923         (JSC::Structure::removePropertyWithoutTransition): No need to clear
2924         the enumeration cache with adding / removing properties without
2925         transition. It is an error to add / remove properties without transition
2926         once an object has been observed, and we can ASSERT to catch that.
2927
2928         * runtime/Structure.h:
2929         (JSC::Structure::enumerationCache): Changed the enumeration cache to
2930         hold a JSPropertyNameIterator.
2931
2932         * runtime/StructureChain.cpp:
2933         * runtime/StructureChain.h:
2934         (JSC::StructureChain::head): Removed StructureChain::isCacheable because
2935         it was wrong-headed in two ways: (1) It gave up when a prototype was a
2936         dictionary, but instead we want un-dictionary heavily accessed
2937         prototypes; (2) It folded a test for hasDefaultGetPropertyNames() into
2938         a generic test for "cacheable-ness", but hasDefaultGetPropertyNames()
2939         is only releavant to for-in caching.
2940
2941 2009-10-16  Steve Falkenburg  <sfalken@apple.com>
2942
2943         Reviewed by Adam Roben.
2944
2945         Add a Debug_All configuration to build entire stack as debug.
2946         Change Debug_Internal to:
2947         - stop using _debug suffix for all WebKit/Safari binaries
2948         - not use _debug as a DLL naming suffix
2949         - use non-debug C runtime lib.
2950
2951         * JavaScriptCore.vcproj/JavaScriptCore.make: Debug build in makefile should build Debug_All.
2952         * JavaScriptCore.vcproj/JavaScriptCore.sln: Add Debug_All configuration.
2953         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add Debug_All configuration.
2954         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj: Renamed single configuration from "Release" to "all".
2955         * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln: Add Debug_All configuration.
2956         * JavaScriptCore.vcproj/WTF/WTF.vcproj: Add Debug_All configuration.
2957         * JavaScriptCore.vcproj/jsc/jsc.vcproj: Add Debug_All configuration.
2958         * JavaScriptCore.vcproj/testapi/testapi.vcproj: Add Debug_All configuration.
2959
2960 2009-10-16  Oliver Hunt  <oliver@apple.com>
2961
2962         Reviewed by Gavin Barraclough.
2963
2964         Make typeinfo flags default to false
2965         https://bugs.webkit.org/show_bug.cgi?id=30372
2966
2967         Last part -- replace HasDefaultGetPropertyNames with OverridesGetPropertyNames
2968         flag.
2969
2970         * API/JSCallbackConstructor.h:
2971         (JSC::JSCallbackConstructor::createStructure):
2972         * API/JSCallbackObject.h:
2973         (JSC::JSCallbackObject::createStructure):
2974         * debugger/DebuggerActivation.h:
2975         (JSC::DebuggerActivation::createStructure):
2976         * runtime/Arguments.h:
2977         (JSC::Arguments::createStructure):
2978         * runtime/BooleanObject.h:
2979         (JSC::BooleanObject::createStructure):
2980         * runtime/DatePrototype.h:
2981         (JSC::DatePrototype::createStructure):
2982         * runtime/FunctionPrototype.h:
2983         (JSC::FunctionPrototype::createStructure):
2984         * runtime/GlobalEvalFunction.h:
2985         (JSC::GlobalEvalFunction::createStructure):
2986         * runtime/JSAPIValueWrapper.h:
2987         (JSC::JSAPIValueWrapper::createStructure):
2988         * runtime/JSActivation.h:
2989         (JSC::JSActivation::createStructure):
2990         * runtime/JSArray.h:
2991         (JSC::JSArray::createStructure):
2992         * runtime/JSByteArray.cpp:
2993         (JSC::JSByteArray::createStructure):
2994         * runtime/JSFunction.h:
2995         (JSC::JSFunction::createStructure):
2996         * runtime/JSGlobalObject.h:
2997         (JSC::JSGlobalObject::createStructure):
2998         * runtime/JSNotAnObject.h:
2999         (JSC::JSNotAnObject::createStructure):
3000         * runtime/JSONObject.h:
3001         (JSC::JSONObject::createStructure):
3002         * runtime/JSObject.cpp:
3003         (JSC::JSObject::getPropertyNames):
3004         * runtime/JSObject.h:
3005         (JSC::JSObject::createStructure):
3006         * runtime/JSStaticScopeObject.h:
3007         (JSC::JSStaticScopeObject::createStructure):
3008         * runtime/JSTypeInfo.h:
3009         (JSC::TypeInfo::overridesGetPropertyNames):
3010         * runtime/JSVariableObject.h:
3011         (JSC::JSVariableObject::createStructure):
3012         * runtime/JSWrapperObject.h:
3013         (JSC::JSWrapperObject::createStructure):
3014         * runtime/MathObject.h:
3015         (JSC::MathObject::createStructure):
3016         * runtime/NumberConstructor.h:
3017         (JSC::NumberConstructor::createStructure):
3018         * runtime/NumberObject.h:
3019         (JSC::NumberObject::createStructure):
3020         * runtime/RegExpConstructor.h:
3021         (JSC::RegExpConstructor::createStructure):
3022         * runtime/RegExpObject.h:
3023         (JSC::RegExpObject::createStructure):
3024         * runtime/StringObject.h:
3025         (JSC::StringObject::createStructure):
3026         * runtime/StringObjectThatMasqueradesAsUndefined.h:
3027         (JSC::StringObjectThatMasqueradesAsUndefined::createStructure):
3028         * runtime/StructureChain.cpp:
3029         (JSC::StructureChain::isCacheable):
3030
3031 2009-10-16  Kevin Ollivier  <kevino@theolliviers.com>
3032
3033         wxMSW build fix, we can't use the simple hash there because the PlatformModuleVersion 
3034         structure differs.
3035
3036         * wtf/Platform.h:
3037
3038 2009-10-16  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
3039
3040         Reviewed by Simon Hausmann.
3041
3042         [Qt] Implement ExecutableAllocator for Symbian
3043         https://bugs.webkit.org/show_bug.cgi?id=29946
3044
3045         Tested with YARR JIT enabled for Symbian; 
3046         This patch does not (yet) enable YARR JIT by default.
3047
3048         * JavaScriptCore.pri:
3049         * jit/ExecutableAllocator.h:
3050         * jit/ExecutableAllocatorSymbian.cpp: Added.
3051         (JSC::ExecutableAllocator::intializePageSize):
3052         (JSC::ExecutablePool::systemAlloc):
3053         (JSC::ExecutablePool::systemRelease):
3054
3055 2009-10-15  Oliver Hunt  <oliver@apple.com>
3056
3057         Reviewed by Darin Adler.
3058
3059         Make typeinfo flags default to false
3060         https://bugs.webkit.org/show_bug.cgi?id=30372
3061
3062         Part 2 -- Reverse the TypeInfo HasDefaultMark flag to OverridesMarkChildren, etc
3063
3064         * API/JSCallbackConstructor.h:
3065         (JSC::JSCallbackConstructor::createStructure):
3066         * API/JSCallbackFunction.h:
3067         (JSC::JSCallbackFunction::createStructure):
3068         * API/JSCallbackObject.h:
3069         (JSC::JSCallbackObject::createStructure):
3070         * debugger/DebuggerActivation.h:
3071         (JSC::DebuggerActivation::createStructure):
3072         * runtime/Arguments.h:
3073         (JSC::Arguments::createStructure):
3074         * runtime/BooleanObject.h:
3075         (JSC::BooleanObject::createStructure):
3076         * runtime/DatePrototype.h:
3077         (JSC::DatePrototype::createStructure):
3078         * runtime/FunctionPrototype.h:
3079         (JSC::FunctionPrototype::createStructure):
3080         * runtime/GetterSetter.h:
3081         (JSC::GetterSetter::createStructure):
3082         * runtime/GlobalEvalFunction.h:
3083         (JSC::GlobalEvalFunction::createStructure):
3084         * runtime/InternalFunction.h:
3085         (JSC::InternalFunction::createStructure):
3086         * runtime/JSAPIValueWrapper.h:
3087         (JSC::JSAPIValueWrapper::createStructure):
3088         * runtime/JSActivation.h:
3089         (JSC::JSActivation::createStructure):
3090         * runtime/JSArray.h:
3091         (JSC::JSArray::createStructure):
3092         (JSC::MarkStack::markChildren):
3093         * runtime/JSByteArray.cpp:
3094         (JSC::JSByteArray::createStructure):
3095         * runtime/JSFunction.h:
3096         (JSC::JSFunction::createStructure):
3097         * runtime/JSGlobalObject.h:
3098         (JSC::JSGlobalObject::createStructure):
3099         * runtime/JSNotAnObject.h:
3100         (JSC::JSNotAnObject::createStructure):
3101         * runtime/JSNumberCell.h:
3102         (JSC::JSNumberCell::createStructure):
3103         * runtime/JSONObject.h:
3104         (JSC::JSONObject::createStructure):
3105         * runtime/JSObject.h:
3106         (JSC::JSObject::createStructure):
3107         * runtime/JSPropertyNameIterator.h:
3108         (JSC::JSPropertyNameIterator::createStructure):
3109         * runtime/JSStaticScopeObject.h:
3110         (JSC::JSStaticScopeObject::createStructure):
3111         * runtime/JSString.h:
3112         (JSC::JSString::createStructure):
3113         * runtime/JSTypeInfo.h:
3114         (JSC::TypeInfo::overridesMarkChildren):
3115         * runtime/JSVariableObject.h:
3116         (JSC::JSVariableObject::createStructure):
3117         * runtime/JSWrapperObject.h:
3118         (JSC::JSWrapperObject::createStructure):
3119         * runtime/MathObject.h:
3120         (JSC::MathObject::createStructure):
3121         * runtime/NumberConstructor.h:
3122         (JSC::NumberConstructor::createStructure):
3123         * runtime/NumberObject.h:
3124         (JSC::NumberObject::createStructure):
3125         * runtime/RegExpConstructor.h:
3126         (JSC::RegExpConstructor::createStructure):
3127         * runtime/RegExpObject.h:
3128         (JSC::RegExpObject::createStructure):
3129         * runtime/StringObject.h:
3130         (JSC::StringObject::createStructure):
3131         * runtime/StringObjectThatMasqueradesAsUndefined.h:
3132         (JSC::StringObjectThatMasqueradesAsUndefined::createStructure):
3133
3134 2009-10-14  Oliver Hunt  <oliver@apple.com>
3135
3136         Reviewed by Geoff Garen.
3137
3138         Make typeinfo flags default to false
3139         https://bugs.webkit.org/show_bug.cgi?id=30372
3140         
3141         Part 1. Reverse the HasStandardGetOwnPropertySlot flag.
3142
3143         * API/JSCallbackConstructor.h:
3144         (JSC::JSCallbackConstructor::createStructure):
3145         * API/JSCallbackFunction.h:
3146         (JSC::JSCallbackFunction::createStructure):
3147         * API/JSCallbackObject.h:
3148         (JSC::JSCallbackObject::createStructure):
3149         * debugger/DebuggerActivation.h:
3150         (JSC::DebuggerActivation::createStructure):
3151         * jit/JITStubs.cpp:
3152         (JSC::DEFINE_STUB_FUNCTION):
3153         * runtime/Arguments.h:
3154         (JSC::Arguments::createStructure):
3155         * runtime/BooleanObject.h:
3156         (JSC::BooleanObject::createStructure):
3157         * runtime/DatePrototype.h:
3158         (JSC::DatePrototype::createStructure):
3159         * runtime/FunctionPrototype.h:
3160         (JSC::FunctionPrototype::createStructure):
3161         * runtime/GlobalEvalFunction.h:
3162         (JSC::GlobalEvalFunction::createStructure):
3163         * runtime/InternalFunction.h:
3164         (JSC::InternalFunction::createStructure):
3165         * runtime/JSActivation.h:
3166         (JSC::JSActivation::createStructure):
3167         * runtime/JSArray.h:
3168         (JSC::JSArray::createStructure):
3169         * runtime/JSByteArray.cpp:
3170         (JSC::JSByteArray::createStructure):
3171         * runtime/JSFunction.h:
3172         (JSC::JSFunction::createStructure):
3173         * runtime/JSGlobalObject.h:
3174         (JSC::JSGlobalObject::createStructure):
3175         * runtime/JSNumberCell.h:
3176         (JSC::JSNumberCell::createStructure):
3177         * runtime/JSONObject.h:
3178         (JSC::JSONObject::createStructure):
3179         * runtime/JSObject.h:
3180         (JSC::JSObject::createStructure):
3181         (JSC::JSCell::fastGetOwnPropertySlot):
3182         * runtime/JSStaticScopeObject.h:
3183         (JSC::JSStaticScopeObject::createStructure):
3184         * runtime/JSString.h:
3185         (JSC::JSString::createStructure):
3186         * runtime/JSTypeInfo.h:
3187         (JSC::TypeInfo::overridesGetOwnPropertySlot):
3188         * runtime/JSVariableObject.h:
3189         (JSC::JSVariableObject::createStructure):
3190         * runtime/JSWrapperObject.h:
3191         (JSC::JSWrapperObject::createStructure):
3192         * runtime/MathObject.h:
3193         (JSC::MathObject::createStructure):
3194         * runtime/NumberConstructor.h:
3195         (JSC::NumberConstructor::createStructure):
3196         * runtime/NumberObject.h:
3197         (JSC::NumberObject::createStructure):
3198         * runtime/RegExpConstructor.h:
3199         (JSC::RegExpConstructor::createStructure):
3200         * runtime/RegExpObject.h:
3201         (JSC::RegExpObject::createStructure):
3202         * runtime/StringObject.h:
3203         (JSC::StringObject::createStructure):
3204         * runtime/StringObjectThatMasqueradesAsUndefined.h:
3205         (JSC::StringObjectThatMasqueradesAsUndefined::createStructure):
3206
3207 2009-10-14  Kevin Ollivier  <kevino@theolliviers.com>
3208 2009-10-14  Darin Adler  <darin@apple.com>
3209
3210         Additions so fix for https://bugs.webkit.org/show_bug.cgi?id=18994
3211         can build on Windows.
3212
3213         * wtf/MathExtras.h: Added llround and llroundf for Windows.
3214
3215 2009-10-14  Kevin Ollivier  <kevino@theolliviers.com>
3216
3217         wx build fix. Set ENABLE_PLUGIN_PACKAGE_SIMPLE_HASH for plugins while we're still building stubs.
3218
3219         * wtf/Platform.h:
3220
3221 2009-10-13  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
3222
3223         Reviewed by Simon Hausmann.
3224
3225         Refactor ENABLE_PLUGIN_PACKAGE_SIMPLE_HASH
3226         https://bugs.webkit.org/show_bug.cgi?id=30278
3227
3228         Move the definition of ENABLE_PLUGIN_PACKAGE_SIMPLE_HASH
3229         from the make system into common code.
3230
3231         * wtf/Platform.h:
3232
3233 2009-10-13  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
3234
3235         Reviewed by Darin Adler.
3236
3237         ARM compiler does not understand reinterpret_cast<void*>
3238         https://bugs.webkit.org/show_bug.cgi?id=29034
3239
3240         Change reinterpret_cast<void*> to regular C style (void*) cast 
3241         for the ARM RVCT compiler.
3242
3243         * assembler/MacroAssemblerCodeRef.h:
3244         (JSC::FunctionPtr::FunctionPtr): 
3245         * jit/JITOpcodes.cpp: Cast to FunctionPtr first 
3246            instead of directly casting to reinterpret_cast
3247         * jit/JITStubCall.h: Ditto + change the type of m_stub
3248           from void* to FunctionPtr.
3249         (JSC::JITStubCall::JITStubCall): 
3250         (JSC::JITStubCall::call):
3251         * jit/JITStubs.cpp: Ditto.
3252         (JSC::DEFINE_STUB_FUNCTION(EncodedJSValue, op_throw)):
3253
3254 2009-10-11  Oliver Hunt  <oliver@apple.com>
3255
3256         Re-enable the JIT.
3257
3258         * wtf/Platform.h:
3259
3260 2009-10-10  Oliver Hunt  <oliver@apple.com>
3261
3262         Reviewed by Maciej Stachowiak.
3263
3264         Support for String.trim(), String.trimLeft() and String.trimRight() methods
3265         https://bugs.webkit.org/show_bug.cgi?id=26590
3266
3267         Implement trim, trimLeft, and trimRight
3268
3269         * runtime/StringPrototype.cpp:
3270         (JSC::isTrimWhitespace):
3271            Our normal string whitespace function does not include U+200B which
3272            is needed for compatibility with mozilla's implementation of trim.
3273            U+200B does not appear to be expected according to spec, however I am
3274            choosing to be lax, and match mozilla behavior so have added this
3275            exception.
3276         (JSC::trimString):
3277
3278 2009-10-09  Geoffrey Garen  <ggaren@apple.com>
3279
3280         Reviewed by Oliver Hunt.
3281
3282         Eliminated some legacy bytecode weirdness.
3283         
3284         Use vPC[x] subscripting instead of ++vPC to access instruction operands.
3285         This is simpler, and often more efficient.
3286
3287         To support this, and to remove use of hard-coded offsets in bytecode and
3288         JIT code generation and dumping, calculate jump offsets from the beginning
3289         of an instruction, rather than the middle or end.
3290         
3291         Also, use OPCODE_LENGTH instead of hard-coded constants for the sizes of
3292         opcodes.
3293         
3294         SunSpider reports no change in JIT mode, and a 1.01x speedup in Interpreter
3295         mode.
3296
3297         * bytecode/CodeBlock.cpp:
3298         (JSC::printConditionalJump):
3299         (JSC::CodeBlock::dump):
3300         * bytecompiler/BytecodeGenerator.cpp:
3301         (JSC::BytecodeGenerator::emitJump):
3302         (JSC::BytecodeGenerator::emitJumpIfTrue):
3303         (JSC::BytecodeGenerator::emitJumpIfFalse):
3304         (JSC::BytecodeGenerator::emitJumpIfNotFunctionCall):
3305         (JSC::BytecodeGenerator::emitJumpIfNotFunctionApply):
3306         (JSC::BytecodeGenerator::emitComplexJumpScopes):
3307         (JSC::BytecodeGenerator::emitJumpScopes):
3308         (JSC::BytecodeGenerator::emitNextPropertyName):
3309         (JSC::BytecodeGenerator::emitCatch):
3310         (JSC::BytecodeGenerator::emitJumpSubroutine):
3311         (JSC::prepareJumpTableForImmediateSwitch):
3312         (JSC::prepareJumpTableForCharacterSwitch):
3313         (JSC::prepareJumpTableForStringSwitch):
3314         (JSC::BytecodeGenerator::endSwitch):
3315         * bytecompiler/Label.h:
3316         (JSC::Label::setLocation):
3317         (JSC::Label::bind):
3318         * interpreter/Interpreter.cpp:
3319         (JSC::Interpreter::resolve):
3320         (JSC::Interpreter::resolveSkip):
3321         (JSC::Interpreter::resolveGlobal):
3322         (JSC::Interpreter::resolveBase):
3323         (JSC::Interpreter::resolveBaseAndProperty):
3324         (JSC::Interpreter::createExceptionScope):
3325         (JSC::Interpreter::privateExecute):
3326         * interpreter/Interpreter.h:
3327         * jit/JIT.cpp:
3328         (JSC::JIT::privateCompile):
3329         * jit/JITArithmetic.cpp:
3330         (JSC::JIT::emit_op_jnless):
3331         (JSC::JIT::emitSlow_op_jnless):
3332         (JSC::JIT::emit_op_jnlesseq):
3333         (JSC::JIT::emitSlow_op_jnlesseq):
3334         (JSC::JIT::emitBinaryDoubleOp):
3335         * jit/JITOpcodes.cpp:
3336         (JSC::JIT::emit_op_jmp):
3337         (JSC::JIT::emit_op_loop):
3338         (JSC::JIT::emit_op_loop_if_less):
3339         (JSC::JIT::emitSlow_op_loop_if_less):
3340         (JSC::JIT::emit_op_loop_if_lesseq):
3341         (JSC::JIT::emitSlow_op_loop_if_lesseq):
3342         (JSC::JIT::emit_op_loop_if_true):
3343         (JSC::JIT::emitSlow_op_loop_if_true):
3344         (JSC::JIT::emit_op_jfalse):
3345         (JSC::JIT::emitSlow_op_jfalse):
3346         (JSC::JIT::emit_op_jtrue):
3347         (JSC::JIT::emitSlow_op_jtrue):
3348         (JSC::JIT::emit_op_jeq_null):
3349         (JSC::JIT::emit_op_jneq_null):
3350         (JSC::JIT::emit_op_jneq_ptr):
3351         (JSC::JIT::emit_op_jsr):
3352         (JSC::JIT::emit_op_next_pname):
3353         (JSC::JIT::emit_op_jmp_scopes):
3354
3355 2009-10-09  Geoffrey Garen  <ggaren@apple.com>
3356
3357         Reviewed by Sam Weinig.
3358
3359         Migrated some code that didn't belong out of Structure.
3360         
3361         SunSpider says maybe 1.03x faster.
3362
3363         * runtime/JSCell.h: Nixed Structure::markAggregate, and made marking of
3364         a Structure's prototype the direct responsility of the object using it.
3365         (Giving Structure a mark function was misleading because it implied that
3366         all live structures get marked during GC, when they don't.)
3367         
3368         * runtime/JSGlobalObject.cpp:
3369         (JSC::markIfNeeded):
3370         (JSC::JSGlobalObject::markChildren): Added code to mark prototypes stored
3371         on the global object. Maybe this wasn't necessary, but now we don't have
3372         to wonder.
3373
3374         * runtime/JSObject.cpp:
3375         (JSC::JSObject::getPropertyNames):
3376         (JSC::JSObject::getOwnPropertyNames):
3377         (JSC::JSObject::getEnumerableNamesFromClassInfoTable):
3378         * runtime/JSObject.h:
3379         (JSC::JSObject::markChildrenDirect):
3380         * runtime/PropertyNameArray.h:
3381         * runtime/Structure.cpp:
3382         * runtime/Structure.h:
3383         (JSC::Structure::setEnumerationCache):
3384         (JSC::Structure::enumerationCache): Moved property name gathering code
3385         from Structure to JSObject because having a Structure iterate its JSObject
3386         was a layering violation. A JSObject is implemented using a Structure; not
3387         the other way around.
3388
3389 2009-10-09  Mark Rowe  <mrowe@apple.com>
3390
3391         Attempt to fix the GTK release build.
3392
3393         * GNUmakefile.am: Include Grammar.cpp in release builds now that
3394         AllInOneFile.cpp is gone.
3395
3396 2009-10-09  Gabor Loki  <loki@inf.u-szeged.hu>
3397
3398         Rubber-stamped by Eric Seidel.
3399
3400         Add ARM JIT support for Gtk port (disabled by default)
3401         https://bugs.webkit.org/show_bug.cgi?id=30228
3402
3403         * GNUmakefile.am:
3404
3405 2009-10-08  Geoffrey Garen  <ggaren@apple.com>
3406
3407         Tiger build fix: added a few more variable initializations.
3408
3409         * runtime/StringPrototype.cpp:
3410         (JSC::stringProtoFuncReplace):
3411         (JSC::stringProtoFuncSearch):
3412
3413 2009-10-08  Geoffrey Garen  <ggaren@apple.com>
3414
3415         Qt build fix: added missing #include.
3416
3417         * jsc.cpp:
3418
3419 2009-10-08  Geoffrey Garen  <ggaren@apple.com>
3420
3421         Tiger build fix: initialize variable whose initialization the compiler
3422         can't otherwise figure out.
3423
3424         * runtime/RegExpObject.cpp:
3425         (JSC::RegExpObject::match):
3426
3427 2009-10-08  Geoffrey Garen  <ggaren@apple.com>
3428
3429         Windows build fix: updated exports.
3430
3431         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3432         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
3433
3434 2009-10-08  Geoffrey Garen  <ggaren@apple.com>
3435
3436         Tiger build fix: fixed file name case.
3437
3438         * JavaScriptCore.xcodeproj/project.pbxproj:
3439
3440 2009-10-08  Geoffrey Garen  <ggaren@apple.com>
3441
3442         Reviewed by Maciej Stachowiak.
3443
3444         At long last, I pronounce the death of AllInOneFile.cpp.
3445         
3446         SunSpider reports a 1.01x speedup.
3447
3448         * AllInOneFile.cpp: Removed.
3449         * GNUmakefile.am:
3450         * JavaScriptCore.exp:
3451         * JavaScriptCore.gypi:
3452         * JavaScriptCore.xcodeproj/project.pbxproj: Added missing project files
3453         to compilation stages.
3454
3455         * parser/Grammar.y:
3456         * parser/Lexer.cpp:
3457         * parser/Lexer.h:
3458         (JSC::jscyylex):
3459         * runtime/ArrayConstructor.cpp:
3460         (JSC::constructArrayWithSizeQuirk):
3461         * runtime/Collector.h:
3462         * runtime/JSCell.cpp:
3463         (JSC::JSCell::operator new):
3464         * runtime/JSCell.h:
3465         (JSC::JSCell::operator new):
3466         * runtime/JSGlobalObject.cpp:
3467         (JSC::JSGlobalObject::operator new):
3468         * runtime/JSNumberCell.h:
3469         (JSC::JSNumberCell::operator new):
3470         * runtime/JSString.cpp:
3471         * runtime/JSString.h:
3472         (JSC::jsString):
3473         (JSC::jsSubstring):
3474         (JSC::jsOwnedString):
3475         * runtime/RegExpConstructor.cpp:
3476         * runtime/RegExpConstructor.h:
3477         (JSC::RegExpConstructorPrivate::RegExpConstructorPrivate):
3478         (JSC::RegExpConstructorPrivate::lastOvector):
3479         (JSC::RegExpConstructorPrivate::tempOvector):
3480         (JSC::RegExpConstructorPrivate::changeLastOvector):
3481         (JSC::RegExpConstructor::performMatch):
3482         * runtime/StringPrototype.cpp:
3483         (JSC::stringProtoFuncMatch):
3484         * yarr/RegexJIT.cpp:
3485         * yarr/RegexJIT.h:
3486         (JSC::Yarr::executeRegex): Inlined a few things that Shark said
3487         were hot, on the presumption that AllInOneFile.cpp used to inline them
3488         automatically.
3489
3490 2009-10-08  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
3491
3492         Reviewed by Gavin Barraclough.
3493
3494         Fix for JIT'ed op_call instructions (evals, constructs, etc.)
3495         when !ENABLE(JIT_OPTIMIZE_CALL) && USE(JSVALUE32_64)
3496
3497         https://bugs.webkit.org/show_bug.cgi?id=30201
3498
3499         * jit/JITCall.cpp:
3500         (JSC::JIT::compileOpCall):
3501
3502 2009-10-07  Geoffrey Garen  <ggaren@apple.com>
3503
3504         Windows build fix: removed no longer exported symbol.
3505
3506         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3507         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
3508
3509 2009-10-07  Geoffrey Garen  <ggaren@apple.com>
3510
3511         Reviewed by Oliver Hunt.
3512
3513         Fixed <rdar://problem/5751979> Database code takes JSLock on secondary
3514         thread, permanently slowing down JavaScript
3515         
3516         Removed the optional lock from Heap::protect, Heap::unprotect, and friends,
3517         since WebCore no longer uses it.
3518
3519         * JavaScriptCore.exp:
3520         * runtime/Collector.cpp:
3521         (JSC::Heap::protect):
3522         (JSC::Heap::unprotect):
3523         (JSC::Heap::markProtectedObjects):
3524         (JSC::Heap::protectedGlobalObjectCount):
3525         (JSC::Heap::protectedObjectCount):
3526         (JSC::Heap::protectedObjectTypeCounts):
3527         * runtime/Collector.h:
3528
3529 2009-10-07  Zoltan Horvath  <zoltan@webkit.org>
3530
3531         Reviewed by Darin Adler.
3532
3533         Allow custom memory allocation control for JavaScriptCore's IdentifierArena
3534         https://bugs.webkit.org/show_bug.cgi?id=30158
3535
3536         Inherits IdentifierArena class from FastAllocBase because it has been
3537         instantiated by 'new' in JavaScriptCore/parser/ParserArena.cpp:36.
3538
3539         * parser/ParserArena.h:
3540
3541 2009-10-07  Adam Roben  <aroben@apple.com>
3542
3543         Export DateInstance::info in a way that works on Windows
3544
3545         Fixes <http://webkit.org/b/30171>
3546         fast/dom/Window/window-postmessage-clone.html fails on Windows
3547
3548         Reviewed by Anders Carlsson.
3549
3550         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3551         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
3552         Removed the export of DateInstance::info from here.
3553
3554         * runtime/DateInstance.h: Use JS_EXPORTDATA to export
3555         DateInstance::info, which is the required way of exporting data on
3556         Windows.
3557
3558 2009-10-07  Jørgen Lind  <jorgen.lind@nokia.com>
3559
3560         Reviewed by Simon Hausmann.
3561
3562         When enabling or disabling the JIT through .qmake.cache, make sure
3563         to also toggle ENABLE_YARR_JIT.
3564
3565         * JavaScriptCore.pri:
3566
3567 2009-10-06  Priit Laes  <plaes@plaes.org>
3568
3569         Reviewed by Gavin Barraclough.
3570
3571         Linking fails with "relocation R_X86_64_PC32 against symbol
3572         `cti_vm_throw'"
3573         https://bugs.webkit.org/show_bug.cgi?id=28422
3574
3575         * jit/JITStubs.cpp:
3576         Mark cti_vm_throw symbol as PLT-indirect symbol, so it doesn't end up
3577         in text segment causing relocation errors on amd64 architecture.
3578         Introduced new define SYMBOL_STRING_RELOCATION for such symbols.
3579