OSDN Git Service

am b9fca1a7: (-s ours) Fix Geolocation service to use correct signature for Location...
[android-x86/external-webkit.git] / JavaScriptCore / ChangeLog
1 2009-10-08  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
2
3         Reviewed by Gavin Barraclough.
4
5         Fix for JIT'ed op_call instructions (evals, constructs, etc.)
6         when !ENABLE(JIT_OPTIMIZE_CALL) && USE(JSVALUE32_64)
7
8         https://bugs.webkit.org/show_bug.cgi?id=30201
9
10         * jit/JITCall.cpp:
11         (JSC::JIT::compileOpCall):
12
13 2009-10-07  Geoffrey Garen  <ggaren@apple.com>
14
15         Windows build fix: removed no longer exported symbol.
16
17         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
18         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
19
20 2009-10-07  Geoffrey Garen  <ggaren@apple.com>
21
22         Reviewed by Oliver Hunt.
23
24         Fixed <rdar://problem/5751979> Database code takes JSLock on secondary
25         thread, permanently slowing down JavaScript
26         
27         Removed the optional lock from Heap::protect, Heap::unprotect, and friends,
28         since WebCore no longer uses it.
29
30         * JavaScriptCore.exp:
31         * runtime/Collector.cpp:
32         (JSC::Heap::protect):
33         (JSC::Heap::unprotect):
34         (JSC::Heap::markProtectedObjects):
35         (JSC::Heap::protectedGlobalObjectCount):
36         (JSC::Heap::protectedObjectCount):
37         (JSC::Heap::protectedObjectTypeCounts):
38         * runtime/Collector.h:
39
40 2009-10-07  Zoltan Horvath  <zoltan@webkit.org>
41
42         Reviewed by Darin Adler.
43
44         Allow custom memory allocation control for JavaScriptCore's IdentifierArena
45         https://bugs.webkit.org/show_bug.cgi?id=30158
46
47         Inherits IdentifierArena class from FastAllocBase because it has been
48         instantiated by 'new' in JavaScriptCore/parser/ParserArena.cpp:36.
49
50         * parser/ParserArena.h:
51
52 2009-10-07  Adam Roben  <aroben@apple.com>
53
54         Export DateInstance::info in a way that works on Windows
55
56         Fixes <http://webkit.org/b/30171>
57         fast/dom/Window/window-postmessage-clone.html fails on Windows
58
59         Reviewed by Anders Carlsson.
60
61         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
62         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
63         Removed the export of DateInstance::info from here.
64
65         * runtime/DateInstance.h: Use JS_EXPORTDATA to export
66         DateInstance::info, which is the required way of exporting data on
67         Windows.
68
69 2009-10-07  Jørgen Lind  <jorgen.lind@nokia.com>
70
71         Reviewed by Simon Hausmann.
72
73         When enabling or disabling the JIT through .qmake.cache, make sure
74         to also toggle ENABLE_YARR_JIT.
75
76         * JavaScriptCore.pri:
77
78 2009-10-06  Priit Laes  <plaes@plaes.org>
79
80         Reviewed by Gavin Barraclough.
81
82         Linking fails with "relocation R_X86_64_PC32 against symbol
83         `cti_vm_throw'"
84         https://bugs.webkit.org/show_bug.cgi?id=28422
85
86         * jit/JITStubs.cpp:
87         Mark cti_vm_throw symbol as PLT-indirect symbol, so it doesn't end up
88         in text segment causing relocation errors on amd64 architecture.
89         Introduced new define SYMBOL_STRING_RELOCATION for such symbols.
90
91 2009-10-06  Oliver Hunt  <oliver@apple.com>
92
93         Windows linking fix
94
95         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
96         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
97
98 2009-10-06  Oliver Hunt  <oliver@apple.com>
99
100         Reviewed by NOBODY (build fix).
101
102         Windows build fix.
103
104         * runtime/DateInstance.cpp:
105
106 2009-10-05  Oliver Hunt  <oliver@apple.com>
107
108         Reviewed by Gavin Barraclough.
109
110         It should be possible to post (clone) built-in JS objects to Workers
111         https://bugs.webkit.org/show_bug.cgi?id=22878
112
113         Expose helpers to throw correct exceptions during object graph walk
114         used for cloning and add a helper function to create Date instances
115         without going through the JS Date constructor function.
116
117         * JavaScriptCore.exp:
118         * JavaScriptCore.xcodeproj/project.pbxproj:
119         * runtime/DateInstance.cpp:
120         (JSC::DateInstance::DateInstance):
121         * runtime/DateInstance.h:
122         * runtime/ExceptionHelpers.cpp:
123         (JSC::createTypeError):
124         * runtime/ExceptionHelpers.h:
125
126 2009-10-06  David Levin  <levin@chromium.org>
127
128         Reviewed by Oliver Hunt.
129
130         StringImpl needs a method to get an instance for another thread which doesn't copy the underlying buffer.
131         https://bugs.webkit.org/show_bug.cgi?id=30095
132
133         * wtf/CrossThreadRefCounted.h:
134         Removed an unused function and assert improvement.
135         (WTF::CrossThreadRefCounted::isOwnedByCurrentThread): Moved out common code from asserts.
136         (WTF::CrossThreadRefCounted::ref): Changed assert to use the common method.
137         (WTF::CrossThreadRefCounted::deref): Changed assert to use the common method.
138         (WTF::CrossThreadRefCounted::crossThreadCopy): Since this includes a potentially
139         non-threadsafe operation, add an assert that the class is owned by the current thread.
140
141 2009-10-05  Kevin Ollivier  <kevino@theolliviers.com>
142
143         wx build fix. Add Symbian files to the list of excludes.
144
145         * wscript:
146
147 2009-10-05  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
148
149         Reviewed by Simon Hausmann.
150
151         [Qt] Remove precompiled header from JavaScriptCore compilation to
152         prevent qmake warning during autonomous compilation.
153         https://bugs.webkit.org/show_bug.cgi?id=30069
154
155         * JavaScriptCore.pro:
156
157 2009-10-02  Geoffrey Garen  <ggaren@apple.com>
158
159         Reviewed by Sam Weinig.
160
161         Removed the concept of a "fast access cutoff" in arrays, because it
162         punished some patterns of array access too much, and made things too
163         complex for inlining in some cases.
164         
165         1.3% speedup on SunSpider.
166
167         * jit/JITOpcodes.cpp:
168         (JSC::JIT::emitSlow_op_get_by_val):
169         (JSC::JIT::emitSlow_op_put_by_val):
170         * jit/JITPropertyAccess.cpp:
171         (JSC::JIT::emit_op_get_by_val):
172         (JSC::JIT::emitSlow_op_get_by_val):
173         (JSC::JIT::emit_op_put_by_val):
174         (JSC::JIT::emitSlow_op_put_by_val):
175         * jit/JITStubs.cpp:
176         * jit/JITStubs.h:
177         (JSC::): Check m_vectorLength instead of m_fastAccessCutoff when
178         getting / putting from / to an array. Inline putting past the end of
179         the array.
180
181         * runtime/JSArray.cpp:
182         (JSC::JSArray::JSArray):
183         (JSC::JSArray::getOwnPropertySlot):
184         (JSC::JSArray::getOwnPropertyDescriptor):
185         (JSC::JSArray::put):
186         (JSC::JSArray::putSlowCase):
187         (JSC::JSArray::deleteProperty):
188         (JSC::JSArray::getOwnPropertyNames):
189         (JSC::JSArray::increaseVectorLength):
190         (JSC::JSArray::setLength):
191         (JSC::JSArray::pop):
192         (JSC::JSArray::push):
193         (JSC::JSArray::sort):
194         (JSC::JSArray::fillArgList):
195         (JSC::JSArray::copyToRegisters):
196         (JSC::JSArray::compactForSorting):
197         (JSC::JSArray::checkConsistency):
198         * runtime/JSArray.h:
199         (JSC::JSArray::canGetIndex):
200         (JSC::JSArray::canSetIndex):
201         (JSC::JSArray::setIndex):
202         (JSC::JSArray::markChildrenDirect): Removed m_fastAccessCutoff, and
203         replaced with checks for JSValue() to detect reads and writes from / to
204         uninitialized parts of the array.
205
206 2009-10-02  Jonni Rainisto  <jonni.rainisto@nokia.com>
207
208         Reviewed by Darin Adler.
209
210         Math.random() gives too low values on Win32 when _CRT_RAND_S is not defined
211         https://bugs.webkit.org/show_bug.cgi?id=29956
212
213         * wtf/RandomNumber.cpp:
214         (WTF::randomNumber): Added PLATFORM(WIN_OS) to handle 15bit rand()
215
216 2009-10-02  Geoffrey Garen  <ggaren@apple.com>
217
218         Reviewed by Sam Weinig.
219
220         Take one branch instead of two to test for JSValue().
221         
222         1.1% SunSpider speedup.
223
224         * jit/JITCall.cpp:
225         (JSC::JIT::compileOpCall):
226         * jit/JITOpcodes.cpp:
227         (JSC::JIT::emit_op_to_jsnumber):
228         (JSC::JIT::emit_op_create_arguments):
229         * jit/JITPropertyAccess.cpp:
230         (JSC::JIT::emitSlow_op_get_by_val):
231         (JSC::JIT::emit_op_put_by_val): Test for the empty value tag, instead
232         of testing for the cell tag with a 0 payload.
233
234         * runtime/JSValue.cpp:
235         (JSC::JSValue::description): Added support for dumping the new empty value,
236         and deleted values, in debug builds.
237
238         * runtime/JSValue.h:
239         (JSC::JSValue::JSValue()): Construct JSValue() with the empty value tag.
240
241         (JSC::JSValue::JSValue(JSCell*)): Convert null pointer to the empty value
242         tag, to avoid having two different c++ versions of null / empty.
243
244         (JSC::JSValue::operator bool): Test for the empty value tag, instead
245         of testing for the cell tag with a 0 payload.
246
247 2009-10-02  Steve Falkenburg  <sfalken@apple.com>
248
249         Reviewed by Mark Rowe.
250
251         <https://bugs.webkit.org/show_bug.cgi?id=29989>
252         Safari version number shouldn't be exposed in WebKit code
253         
254         For a WebKit version of 532.3.4:
255         Product version is: 5.32.3.4 (was 4.0.3.0)
256         File version is: 5.32.3.4 (was 4.532.3.4)
257
258         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.rc:
259
260 2009-10-02  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
261
262         Rubber-stamped by Simon Hausmann.
263
264         Fix the Qt on Mac OS X build.
265
266         * wtf/FastMalloc.cpp:
267
268 2009-10-02  Jørgen Lind  <jorgen.lind@nokia.com>
269
270         Reviewed by Simon Hausmann.
271
272         Allow enabling and disabling of the JIT through a qmake variable.
273
274         Qt's configure may set this variable through .qmake.cache if a
275         commandline option is given and/or the compile test for hwcap.h
276         failed/succeeded.
277
278         * JavaScriptCore.pri:
279
280 2009-10-01  Mark Rowe  <mrowe@apple.com>
281
282         Fix the Tiger build.  Don't unconditionally enable 3D canvas as it is not supported on Tiger.
283
284         * Configurations/FeatureDefines.xcconfig:
285
286 2009-10-01  Yongjun Zhang  <yongjun.zhang@nokia.com>
287
288         Reviewed by Darin Adler.
289
290         https://bugs.webkit.org/show_bug.cgi?id=29187
291
292         Don't inline ~ListRefPtr() to work around winscw compiler forward declaration
293         bug regarding templated classes.
294
295         The compiler bug is reported at:
296         https://xdabug001.ext.nokia.com/bugzilla/show_bug.cgi?id=9812
297
298         The change will be reverted when the above bug is fixed in winscw compiler.
299
300         * wtf/ListRefPtr.h:
301         (WTF::::~ListRefPtr):
302
303 2009-10-01  Zoltan Horvath  <zoltan@webkit.org>
304
305         Reviewed by Simon Hausmann.
306
307         [Qt] Allow custom memory allocation control for the whole JavaScriptCore
308         https://bugs.webkit.org/show_bug.cgi?id=27029
309
310         Since in JavaScriptCore almost every class which has been instantiated by operator new is
311         inherited from FastAllocBase (bug #20422), we disable customizing global operator new for the Qt-port
312         when USE_SYSTEM_MALLOC=0.
313
314         Add #include <unistd.h> to FastMalloc.cpp because it's used by TCMalloc_PageHeap::scavengerThread().
315         (It's needed for the functionality of TCmalloc.)
316
317         Add TCSystemAlloc.cpp to JavaScriptCore.pri if USE_SYSTEM_MALLOC is disabled.
318
319         * JavaScriptCore.pri:
320         * wtf/FastMalloc.cpp:
321         (WTF::sleep):
322         * wtf/FastMalloc.h:
323
324 2009-09-30  Gabor Loki  <loki@inf.u-szeged.hu>
325
326         Reviewed by George Staikos.
327
328         Defines two pseudo-platforms for ARM and Thumb-2 instruction set.
329         https://bugs.webkit.org/show_bug.cgi?id=29122
330
331         Introduces WTF_PLATFORM_ARM_TRADITIONAL and WTF_PLATFORM_ARM_THUMB2
332         macros on ARM platforms. The PLATFORM(ARM_THUMB2) should be used
333         when Thumb-2 instruction set is the required target. The
334         PLATFORM(ARM_TRADITIONAL) is for generic ARM instruction set. In
335         case where the code is common the PLATFORM(ARM) have to be used.
336
337         Modified by George Wright  <gwright@rim.com> to correctly work
338         with the RVCT-defined __TARGET_ARCH_ARM and __TARGET_ARCH_THUMB
339         compiler macros, as well as adding readability changes.
340
341         * wtf/Platform.h:
342
343 2009-09-30  Oliver Hunt  <oliver@apple.com>
344
345         Reviewed by Geoff Garen.
346
347         Devirtualise array toString conversion
348
349         Tweak the implementation of Array.prototype.toString to have a fast path
350         when acting on a true JSArray.
351
352         * runtime/ArrayPrototype.cpp:
353         (JSC::arrayProtoFuncToString):
354
355 2009-09-30  Csaba Osztrogonac  <oszi@inf.u-szeged.hu>
356
357         Reviewed by Geoffrey Garen.
358
359         Buildfix for platforms using JSVALUE32.
360         https://bugs.webkit.org/show_bug.cgi?id=29915
361
362         After http://trac.webkit.org/changeset/48905 the build broke in JSVALUE32 case.
363         Also removed unreachable code.
364
365         * jit/JITArithmetic.cpp:
366         (JSC::JIT::emit_op_add):
367          - Declaration of "OperandTypes types" moved before first use.
368          - Typos fixed: dst modified to result, regT2 added.
369          - Unreachable code removed.
370         (JSC::JIT::emitSlow_op_add):
371          - Missing declaration of "OperandTypes types" added.
372
373 2009-09-30  Janne Koskinen  <janne.p.koskinen@digia.com> 
374
375         Reviewed by Simon Hausmann.
376
377         Reduce heap size on Symbian from 64MB to 8MB.
378
379         This is not a perfect fix, it requires more fine tuning.
380         But this makes it possible again to debug in the emulator,
381         which is more important in order to be able to fix other
382         run-time issues.
383
384         * runtime/Collector.h:
385
386 2009-09-30  Janne Koskinen  <janne.p.koskinen@digia.com> 
387
388         Reviewed by Simon Hausmann.
389
390         Fix CRASH() macro for Symbian build.
391
392         * wtf/Assertions.h: Added missing }
393
394 2009-09-29  Geoffrey Garen  <ggaren@apple.com>
395
396         Reviewed by Gavin Barraclough.
397
398         Inlined a few math operations.
399         
400         ~1% SunSpider speedup.
401
402         * jit/JIT.h:
403         * jit/JITArithmetic.cpp:
404         (JSC::JIT::compileBinaryArithOpSlowCase):
405         (JSC::JIT::emitSlow_op_add):
406         (JSC::JIT::emitSlow_op_mul):
407         (JSC::JIT::emit_op_sub):
408         (JSC::JIT::emitSlow_op_sub): Don't take a stub call when operating on
409         a constant int and a double.
410
411 2009-09-28  Oliver Hunt  <oliver@apple.com>
412
413         Reviewed by Gavin Barraclough.
414
415         Tidy up codeblock sampler
416         https://bugs.webkit.org/show_bug.cgi?id=29836
417
418         Some rather simple refactoring of codeblock sampler so that
419         it's easier for us to use it to find problems in non-jsc
420         environments
421
422         * JavaScriptCore.exp:
423         * bytecode/SamplingTool.h:
424         * debugger/Debugger.cpp:
425         (JSC::evaluateInGlobalCallFrame):
426         * debugger/DebuggerCallFrame.cpp:
427         (JSC::DebuggerCallFrame::evaluate):
428         * interpreter/Interpreter.cpp:
429         (JSC::Interpreter::Interpreter):
430         (JSC::Interpreter::execute):
431         (JSC::Interpreter::privateExecute):
432         (JSC::Interpreter::enableSampler):
433         (JSC::Interpreter::dumpSampleData):
434         (JSC::Interpreter::startSampling):
435         (JSC::Interpreter::stopSampling):
436         * interpreter/Interpreter.h:
437         (JSC::Interpreter::sampler):
438         * jit/JIT.h:
439         * jsc.cpp:
440         (runWithScripts):
441         * runtime/Completion.cpp:
442         (JSC::checkSyntax):
443         (JSC::evaluate):
444         * runtime/Executable.h:
445         (JSC::EvalExecutable::EvalExecutable):
446         (JSC::ProgramExecutable::create):
447         (JSC::ProgramExecutable::ProgramExecutable):
448         * runtime/JSGlobalData.cpp:
449         (JSC::JSGlobalData::startSampling):
450         (JSC::JSGlobalData::stopSampling):
451         (JSC::JSGlobalData::dumpSampleData):
452         * runtime/JSGlobalData.h:
453         * runtime/JSGlobalObjectFunctions.cpp:
454         (JSC::globalFuncEval):
455
456 2009-09-29  Jeremy Orlow  <jorlow@chromium.org>
457
458         Reviewed by Dimitri Glazkov.
459
460         Add GYP generated files to svn:ignore
461         https://bugs.webkit.org/show_bug.cgi?id=29895
462
463         The following files are generated by JavaScriptCore's GYP file and should be ignored:
464
465         pcre.mk
466         wtf.scons
467         wtf.mk
468         SConstruct
469         wtf_config.scons
470         wtf_config.mk
471         pcre.scons
472
473         * JavaScriptCore.gyp: Changed property svn:ignore.
474
475 2009-09-29  Geoffrey Garen  <ggaren@apple.com>
476
477         Reviewed by Sam Weinig.
478
479         Standardized an optimization for adding non-numbers.
480         
481         SunSpider says maybe a tiny speedup.
482
483         * jit/JITArithmetic.cpp:
484         (JSC::JIT::emit_op_add):
485         (JSC::JIT::emitSlow_op_add):
486
487 2009-09-29  Geoffrey Garen  <ggaren@apple.com>
488
489         Windows build fix: export a new symbol.
490
491         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
492         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
493
494 2009-09-28  Geoffrey Garen  <ggaren@apple.com>
495
496         Reviewed by Sam Weinig.
497
498         Removed virtual destructor from JSGlobalObjectData to eliminate pointer
499         fix-ups when accessing JSGlobalObject::d.
500         
501         Replaced with an explicit destructor function pointer.
502         
503         6% speedup on bench-alloc-nonretained.js.
504
505         * JavaScriptCore.exp:
506         * runtime/JSGlobalObject.cpp:
507         (JSC::JSGlobalObject::~JSGlobalObject):
508         (JSC::JSGlobalObject::destroyJSGlobalObjectData):
509         * runtime/JSGlobalObject.h:
510         (JSC::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData):
511         (JSC::JSGlobalObject::JSGlobalObject):
512
513 2009-09-29  Janne Koskinen  <janne.p.koskinen@digia.com>
514
515         Reviewed by David Kilzer.
516
517         [Qt] Assert messages prints visible in Symbian
518         https://bugs.webkit.org/show_bug.cgi?id=29808
519
520         Asserts use vprintf to print the messages to stderr.
521         In Symbian Open C it is not possible to see stderr so
522         I routed the messages to stdout instead.
523
524         * wtf/Assertions.cpp:
525
526 2009-09-29  Janne Koskinen  <janne.p.koskinen@digia.com>
527
528         Reviewed by Darin Adler.
529
530         [Qt] Symbian CRASH macro implementation
531
532         Added Symbian specific crash macro that
533         stops to crash line if JIT debugging is used.
534         Additional differentiation of access violation
535         (KERN-EXEC 3) and CRASH panic.
536
537         * wtf/Assertions.h:
538
539 2009-09-28  Mark Rowe  <mrowe@apple.com>
540
541         Fix the PowerPC build.
542
543         * JavaScriptCore.exp:
544
545 2009-09-28  Mark Rowe  <mrowe@apple.com>
546
547         Reviewed by Gavin Barraclough.
548
549         <rdar://problem/7195704> JavaScriptCore fails to mark registers when built for x86_64 using LLVM GCC.
550
551         * runtime/Collector.cpp:
552         (JSC::Heap::markCurrentThreadConservatively): Force jmp_buf to use the appropriate alignment for a pointer
553         to ensure that we correctly interpret the contents of registers during marking.
554
555 2009-09-28  Geoffrey Garen  <ggaren@apple.com>
556
557         Windows build fix: added new exports.
558
559         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
560         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
561
562 2009-09-28  Geoffrey Garen  <ggaren@apple.com>
563
564         Windows build fix: removed exports that no longer exist.
565
566         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
567         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
568
569 2009-09-28  Geoffrey Garen  <ggaren@apple.com>
570
571         Reviewed by Darin Adler.
572
573         NotNullPassRefPtr: smart pointer optimized for passing references that are not null
574         https://bugs.webkit.org/show_bug.cgi?id=29822
575         
576         Added NotNullPassRefPtr, and deployed it in all places that initialize
577         JavaScript objects.
578         
579         2.2% speedup on bench-allocate-nonretained.js.
580
581         * API/JSCallbackConstructor.cpp:
582         (JSC::JSCallbackConstructor::JSCallbackConstructor):
583         * API/JSCallbackConstructor.h:
584         * API/JSCallbackObject.h:
585         * API/JSCallbackObjectFunctions.h:
586         (JSC::JSCallbackObject::JSCallbackObject):
587         * JavaScriptCore.exp:
588         * bytecode/CodeBlock.h:
589         (JSC::CodeBlock::addFunctionDecl):
590         (JSC::CodeBlock::addFunctionExpr):
591         * runtime/ArrayConstructor.cpp:
592         (JSC::ArrayConstructor::ArrayConstructor):
593         * runtime/ArrayConstructor.h:
594         * runtime/ArrayPrototype.cpp:
595         (JSC::ArrayPrototype::ArrayPrototype):
596         * runtime/ArrayPrototype.h:
597         * runtime/BooleanConstructor.cpp:
598         (JSC::BooleanConstructor::BooleanConstructor):
599         * runtime/BooleanConstructor.h:
600         * runtime/BooleanObject.cpp:
601         (JSC::BooleanObject::BooleanObject):
602         * runtime/BooleanObject.h:
603         * runtime/BooleanPrototype.cpp:
604         (JSC::BooleanPrototype::BooleanPrototype):
605         * runtime/BooleanPrototype.h:
606         * runtime/DateConstructor.cpp:
607         (JSC::DateConstructor::DateConstructor):
608         * runtime/DateConstructor.h:
609         * runtime/DateInstance.cpp:
610         (JSC::DateInstance::DateInstance):
611         * runtime/DateInstance.h:
612         * runtime/DatePrototype.cpp:
613         (JSC::DatePrototype::DatePrototype):
614         * runtime/DatePrototype.h:
615         * runtime/ErrorConstructor.cpp:
616         (JSC::ErrorConstructor::ErrorConstructor):
617         * runtime/ErrorConstructor.h:
618         * runtime/ErrorInstance.cpp:
619         (JSC::ErrorInstance::ErrorInstance):
620         * runtime/ErrorInstance.h:
621         * runtime/ErrorPrototype.cpp:
622         (JSC::ErrorPrototype::ErrorPrototype):
623         * runtime/ErrorPrototype.h:
624         * runtime/FunctionConstructor.cpp:
625         (JSC::FunctionConstructor::FunctionConstructor):
626         * runtime/FunctionConstructor.h:
627         * runtime/FunctionPrototype.cpp:
628         (JSC::FunctionPrototype::FunctionPrototype):
629         * runtime/FunctionPrototype.h:
630         * runtime/GlobalEvalFunction.cpp:
631         (JSC::GlobalEvalFunction::GlobalEvalFunction):
632         * runtime/GlobalEvalFunction.h:
633         * runtime/InternalFunction.cpp:
634         (JSC::InternalFunction::InternalFunction):
635         * runtime/InternalFunction.h:
636         (JSC::InternalFunction::InternalFunction):
637         * runtime/JSActivation.cpp:
638         (JSC::JSActivation::JSActivation):
639         * runtime/JSActivation.h:
640         (JSC::JSActivation::JSActivationData::JSActivationData):
641         * runtime/JSArray.cpp:
642         (JSC::JSArray::JSArray):
643         * runtime/JSArray.h:
644         * runtime/JSByteArray.cpp:
645         (JSC::JSByteArray::JSByteArray):
646         * runtime/JSByteArray.h:
647         * runtime/JSFunction.cpp:
648         (JSC::JSFunction::JSFunction):
649         * runtime/JSFunction.h:
650         * runtime/JSGlobalObject.h:
651         (JSC::JSGlobalObject::JSGlobalObject):
652         * runtime/JSONObject.h:
653         (JSC::JSONObject::JSONObject):
654         * runtime/JSObject.h:
655         (JSC::JSObject::JSObject):
656         (JSC::JSObject::setStructure):
657         * runtime/JSVariableObject.h:
658         (JSC::JSVariableObject::JSVariableObject):
659         * runtime/JSWrapperObject.h:
660         (JSC::JSWrapperObject::JSWrapperObject):
661         * runtime/MathObject.cpp:
662         (JSC::MathObject::MathObject):
663         * runtime/MathObject.h:
664         * runtime/NativeErrorConstructor.cpp:
665         (JSC::NativeErrorConstructor::NativeErrorConstructor):
666         * runtime/NativeErrorConstructor.h:
667         * runtime/NativeErrorPrototype.cpp:
668         (JSC::NativeErrorPrototype::NativeErrorPrototype):
669         * runtime/NativeErrorPrototype.h:
670         * runtime/NumberConstructor.cpp:
671         (JSC::NumberConstructor::NumberConstructor):
672         * runtime/NumberConstructor.h:
673         * runtime/NumberObject.cpp:
674         (JSC::NumberObject::NumberObject):
675         * runtime/NumberObject.h:
676         * runtime/NumberPrototype.cpp:
677         (JSC::NumberPrototype::NumberPrototype):
678         * runtime/NumberPrototype.h:
679         * runtime/ObjectConstructor.cpp:
680         (JSC::ObjectConstructor::ObjectConstructor):
681         * runtime/ObjectConstructor.h:
682         * runtime/ObjectPrototype.cpp:
683         (JSC::ObjectPrototype::ObjectPrototype):
684         * runtime/ObjectPrototype.h:
685         * runtime/PropertyNameArray.h:
686         (JSC::PropertyNameArrayData::setCachedPrototypeChain):
687         * runtime/PrototypeFunction.cpp:
688         (JSC::PrototypeFunction::PrototypeFunction):
689         * runtime/PrototypeFunction.h:
690         * runtime/RegExpConstructor.cpp:
691         (JSC::RegExpConstructor::RegExpConstructor):
692         * runtime/RegExpConstructor.h:
693         * runtime/RegExpObject.cpp:
694         (JSC::RegExpObject::RegExpObject):
695         * runtime/RegExpObject.h:
696         (JSC::RegExpObject::RegExpObjectData::RegExpObjectData):
697         * runtime/RegExpPrototype.cpp:
698         (JSC::RegExpPrototype::RegExpPrototype):
699         * runtime/RegExpPrototype.h:
700         * runtime/StringConstructor.cpp:
701         (JSC::StringConstructor::StringConstructor):
702         * runtime/StringConstructor.h:
703         * runtime/StringObject.cpp:
704         (JSC::StringObject::StringObject):
705         * runtime/StringObject.h:
706         * runtime/StringObjectThatMasqueradesAsUndefined.h:
707         (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
708         * runtime/StringPrototype.cpp:
709         (JSC::StringPrototype::StringPrototype):
710         * runtime/StringPrototype.h:
711         * wtf/PassRefPtr.h:
712         (WTF::NotNullPassRefPtr::NotNullPassRefPtr):
713         (WTF::NotNullPassRefPtr::~NotNullPassRefPtr):
714         (WTF::NotNullPassRefPtr::get):
715         (WTF::NotNullPassRefPtr::clear):
716         (WTF::NotNullPassRefPtr::releaseRef):
717         (WTF::NotNullPassRefPtr::operator*):
718         (WTF::NotNullPassRefPtr::operator->):
719         (WTF::NotNullPassRefPtr::operator!):
720         (WTF::NotNullPassRefPtr::operator UnspecifiedBoolType):
721         * wtf/RefPtr.h:
722         (WTF::RefPtr::RefPtr):
723         (WTF::operator==):
724
725 2009-09-28  Oliver Hunt  <oliver@apple.com>
726
727         Reviewed by Geoff Garen.
728
729         Hard dependency on SSE2 instruction set with JIT
730         https://bugs.webkit.org/show_bug.cgi?id=29779
731
732         Add floating point support checks to op_jfalse and op_jtrue, and
733         fix the logic for the slow case of op_add
734
735         * jit/JITArithmetic.cpp:
736         (JSC::JIT::emitSlow_op_add):
737         * jit/JITOpcodes.cpp:
738         (JSC::JIT::emit_op_jfalse):
739         (JSC::JIT::emit_op_jtrue):
740
741 2009-09-28  Yaar Schnitman  <yaar@chromium.org>
742
743         Reviewed by Dimitri Glazkov.
744
745         Chromium port - recognize we are being built independently
746         of chromium and look for dependencies under webkit/chromium rather
747         than chromium/src.
748
749         https://bugs.webkit.org/show_bug.cgi?id=29722
750
751         * JavaScriptCore.gyp/JavaScriptCore.gyp:
752
753 2009-09-28  Jakub Wieczorek  <faw217@gmail.com>
754
755         Reviewed by Simon Hausmann.
756
757         [Qt] Implement XSLT support with QtXmlPatterns.
758         https://bugs.webkit.org/show_bug.cgi?id=28303
759
760         * wtf/Platform.h: Add a WTF_USE_QXMLQUERY #define.
761
762 2009-09-28  Gabor Loki  <loki@inf.u-szeged.hu>
763
764         Reviewed by Simon Hausmann.
765
766         Remove __clear_cache which is an internal function of GCC
767         https://bugs.webkit.org/show_bug.cgi?id=28886
768
769         Although __clear_cache is exported from GCC, this is an internal
770         function. GCC makes no promises about it.
771
772         * jit/ExecutableAllocator.h:
773         (JSC::ExecutableAllocator::cacheFlush):
774
775 2009-09-28  Sam Weinig  <sam@webkit.org>
776
777         Reviewed by Oliver Hunt.
778
779         Fix an absolute path to somewhere in Oliver's machine to a relative path
780         for derived JSONObject.lut.h.
781
782         * JavaScriptCore.xcodeproj/project.pbxproj:
783
784 2009-09-28  Joerg Bornemann  <joerg.bornemann@nokia.com>
785
786         Reviewed by Simon Hausmann.
787
788         Add ARM version detection for Windows CE.
789
790         * wtf/Platform.h:
791
792 2009-09-26  Yongjun Zhang  <yongjun.zhang@nokia.com>
793
794         Reviewed by Simon Hausmann.
795
796         Add MarkStackSymbian.cpp to build JavascriptCore for Symbian.
797
798         Re-use Windows shrinkAllocation implementation because Symbian doesn't
799         support releasing part of memory region.
800         
801         Use fastMalloc and fastFree to implement allocateStack and releaseStack
802         for Symbian port.
803
804         * JavaScriptCore.pri:
805         * runtime/MarkStack.h:
806         (JSC::MarkStack::MarkStackArray::shrinkAllocation):
807         * runtime/MarkStackSymbian.cpp: Added.
808         (JSC::MarkStack::initializePagesize):
809         (JSC::MarkStack::allocateStack):
810         (JSC::MarkStack::releaseStack):
811
812 2009-09-25  Gabor Loki  <loki@inf.u-szeged.hu>
813
814         Reviewed by Gavin Barraclough.
815
816         Fix unaligned data access in YARR_JIT on ARMv5 and below.
817         https://bugs.webkit.org/show_bug.cgi?id=29695
818
819         On ARMv5 and below all data access should be naturally aligned.
820         In the YARR_JIT there is a case when character pairs are
821         loaded from the input string, but this data access is not
822         naturally aligned. This fix introduces load32WithUnalignedHalfWords
823         and branch32WithUnalignedHalfWords functions which contain
824         naturally aligned memory loads - half word loads - on ARMv5 and below.
825
826         * assembler/MacroAssemblerARM.cpp:
827         (JSC::MacroAssemblerARM::load32WithUnalignedHalfWords):
828         * assembler/MacroAssemblerARM.h:
829         (JSC::MacroAssemblerARM::load32WithUnalignedHalfWords):
830         (JSC::MacroAssemblerARM::branch32WithUnalignedHalfWords):
831         * assembler/MacroAssemblerARMv7.h:
832         (JSC::MacroAssemblerARMv7::load32WithUnalignedHalfWords):
833         (JSC::MacroAssemblerARMv7::branch32):
834         (JSC::MacroAssemblerARMv7::branch32WithUnalignedHalfWords):
835         * assembler/MacroAssemblerX86Common.h:
836         (JSC::MacroAssemblerX86Common::load32WithUnalignedHalfWords):
837         (JSC::MacroAssemblerX86Common::branch32WithUnalignedHalfWords):
838         * wtf/Platform.h:
839         * yarr/RegexJIT.cpp:
840         (JSC::Yarr::RegexGenerator::generatePatternCharacterPair):
841
842 2009-09-25  Jeremy Orlow  <jorlow@chromium.org>
843
844         This is breaking Chromium try bots, so I'm counting this as a build fix.
845
846         Add more svn:ignore exceptions.  On different platforms, these files are
847         generated with different case for JavaScriptCore.  Also there are some
848         wtf project files that get built apparently.
849
850         * JavaScriptCore.gyp: Changed property svn:ignore.
851
852 2009-09-25  Ada Chan  <adachan@apple.com>
853
854         Build fix.
855
856         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
857         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
858
859 2009-09-25  Geoffrey Garen  <ggaren@apple.com>
860
861         Reviewed by Darin Adler.
862
863         Inlined some object creation code, including lexicalGlobalObject access
864         https://bugs.webkit.org/show_bug.cgi?id=29750
865         
866         SunSpider says 0.5% faster.
867         
868         0.8% speedup on bench-alloc-nonretained.js.
869         2.5% speedup on v8-splay.js.
870
871         * interpreter/CachedCall.h:
872         (JSC::CachedCall::CachedCall):
873         * interpreter/CallFrame.h:
874         (JSC::ExecState::lexicalGlobalObject):
875         (JSC::ExecState::globalThisValue):
876         * interpreter/Interpreter.cpp:
877         (JSC::Interpreter::dumpRegisters):
878         (JSC::Interpreter::execute):
879         (JSC::Interpreter::privateExecute):
880         * jit/JITStubs.cpp:
881         (JSC::DEFINE_STUB_FUNCTION):
882         * runtime/FunctionConstructor.cpp:
883         (JSC::constructFunction):
884         * runtime/ScopeChain.cpp:
885         (JSC::ScopeChainNode::print):
886         * runtime/ScopeChain.h:
887         (JSC::ScopeChainNode::ScopeChainNode):
888         (JSC::ScopeChainNode::~ScopeChainNode):
889         (JSC::ScopeChainNode::push):
890         (JSC::ScopeChain::ScopeChain):
891         (JSC::ScopeChain::globalObject): Added a globalObject data member to ScopeChainNode.
892         Replaced accessor function for globalObject() with data member. Replaced
893         globalThisObject() accessor with direct access to globalThis, to match.
894
895         * runtime/JSGlobalObject.cpp:
896         (JSC::JSGlobalObject::init):
897         * runtime/JSGlobalObject.h: Inlined array and object construction.
898
899 2009-09-25  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
900
901         Reviewed by Gavin Barraclough.
902
903         Add ARM version detection rules for Symbian
904         https://bugs.webkit.org/show_bug.cgi?id=29715
905
906         * wtf/Platform.h:
907
908 2009-09-24  Xan Lopez  <xlopez@igalia.com>
909
910         Reviewed by Mark "Do It!" Rowe.
911
912         Some GCC versions don't like C++-style comments in preprocessor
913         directives, change to C-style to shut them up.
914
915         * wtf/Platform.h:
916
917 2009-09-24  Oliver Hunt  <oliver@apple.com>
918
919         Reviewed by Gavin Barraclough.
920
921         Division is needlessly slow in 64-bit
922         https://bugs.webkit.org/show_bug.cgi?id=29723
923
924         Add codegen for op_div on x86-64
925
926         * jit/JIT.cpp:
927         (JSC::JIT::privateCompileMainPass):
928         (JSC::JIT::privateCompileSlowCases):
929         * jit/JIT.h:
930         * jit/JITArithmetic.cpp:
931         (JSC::JIT::compileBinaryArithOpSlowCase):
932         (JSC::JIT::emit_op_div):
933         (JSC::JIT::emitSlow_op_div):
934         * jit/JITInlineMethods.h:
935         (JSC::JIT::isOperandConstantImmediateDouble):
936         (JSC::JIT::addressFor):
937         (JSC::JIT::emitLoadDouble):
938         (JSC::JIT::emitLoadInt32ToDouble):
939         (JSC::JIT::emitJumpSlowCaseIfNotImmediateNumber):
940
941 2009-09-24  Jeremy Orlow  <jorlow@chromium.org>
942
943         Reviewed by Dimitri Glazkov.
944
945         Add GYP generated files to svn:ignore
946         https://bugs.webkit.org/show_bug.cgi?id=29724
947
948         Adding the following files to the svn:ignore list (all in the
949         JavaScriptCore/JavaScriptCore.gyp directory)
950
951         JavaScriptCore.xcodeproj
952         JavaScriptCore.sln
953         JavaScriptCore.vcproj
954         JavaScriptCore_Debug.rules
955         JavaScriptCore_Release.rules
956         JavaScriptCore_Release - no tcmalloc.rules
957         JavaScriptCore_Purify.rules
958         JavaScriptCore.mk
959         JavaScriptCore_Debug_rules.mk
960         JavaScriptCore_Release_rules.mk
961         JavaScriptCore_Release - no tcmalloc_rules.mk
962         JavaScriptCore_Purify_rules.mk
963         JavaScriptCore.scons
964         JavaScriptCore_main.scons
965
966         * JavaScriptCore.gyp: Changed property svn:ignore.
967
968 2009-09-24  Yong Li  <yong.li@torchmobile.com>
969
970         Reviewed by Adam Barth.
971
972         Replace platform-dependent code with WTF::currentTime()
973         https://bugs.webkit.org/show_bug.cgi?id=29148
974
975         * jsc.cpp:
976         (StopWatch::start):
977         (StopWatch::stop):
978         (StopWatch::getElapsedMS):
979         * runtime/TimeoutChecker.cpp:
980         (JSC::getCPUTime):
981
982 2009-09-24  Mark Rowe  <mrowe@apple.com>
983
984         Reviewed by Sam Weinig.
985
986         <rdar://problem/7215058> FastMalloc scavenging thread should be named
987
988         * wtf/FastMalloc.cpp:
989         (WTF::TCMalloc_PageHeap::scavengerThread): Set the thread name.
990         * wtf/Platform.h: Move the knowledge of whether pthread_setname_np exists to here as HAVE(PTHREAD_SETNAME_NP).
991         * wtf/ThreadingPthreads.cpp:
992         (WTF::setThreadNameInternal): Use HAVE(PTHREAD_SETNAME_NP).
993
994 2009-09-24  Geoffrey Garen  <ggaren@apple.com>
995
996         Reviewed by Sam Weinig.
997
998         Renamed clear to removeAll, as suggested by Darin Adler.
999
1000         * wtf/HashCountedSet.h:
1001         (WTF::::removeAll):
1002
1003 2009-09-24  Mark Rowe  <mrowe@apple.com>
1004
1005         Reviewed by Gavin Barraclough.
1006
1007         Fix FastMalloc to build with assertions enabled.
1008
1009         * wtf/FastMalloc.cpp:
1010         (WTF::TCMalloc_Central_FreeList::ReleaseToSpans):
1011         * wtf/TCSpinLock.h:
1012         (TCMalloc_SpinLock::IsHeld):
1013
1014 2009-09-24  Geoffrey Garen  <ggaren@apple.com>
1015
1016         Suggested by Darin Adler.
1017
1018         Removed some unnecessary parameter names.
1019
1020         * wtf/HashCountedSet.h:
1021
1022 2009-09-24  Janne Koskinen  <janne.p.koskinen@digia.com>
1023
1024         Reviewed by Simon Hausmann.
1025
1026         On Windows JSChar is typedef'ed to wchar_t.
1027
1028         When building with WINSCW for Symbian we need to do the
1029         same typedef.
1030
1031         * API/JSStringRef.h:
1032
1033 2009-09-23  Geoffrey Garen  <ggaren@apple.com>
1034
1035         A piece of my last patch that I forgot.
1036
1037         * wtf/HashCountedSet.h:
1038         (WTF::::clear): Added HashCountedSet::clear.
1039
1040 2009-09-24  Gabor Loki  <loki@inf.u-szeged.hu>
1041
1042         Reviewed by Gavin Barraclough.
1043
1044         Avoid __clear_cache built-in function if DISABLE_BUILTIN_CLEAR_CACHE define is set
1045         https://bugs.webkit.org/show_bug.cgi?id=28886
1046
1047         There are some GCC packages (for example GCC-2006q3 from CodeSourcery)
1048         which contain __clear_cache built-in function only for C while the C++
1049         version of __clear_cache is missing on ARM architectures.
1050
1051         Fixed a small bug in the inline assembly of cacheFlush function on
1052         ARM_TRADITIONAL.
1053
1054         * jit/ExecutableAllocator.h:
1055         (JSC::ExecutableAllocator::cacheFlush):
1056
1057 2009-09-23  Geoffrey Garen  <ggaren@apple.com>
1058
1059         Reviewed by Sam Weinig.
1060
1061         Added the ability to swap vectors with inline capacities, so you can
1062         store a vector with inline capacity in a hash table.
1063
1064         * wtf/Vector.h:
1065         (WTF::swap):
1066         (WTF::VectorBuffer::swap):
1067
1068 2009-09-23  David Kilzer  <ddkilzer@apple.com>
1069
1070         Move definition of USE(PLUGIN_HOST_PROCESS) from WebKitPrefix.h to Platform.h
1071
1072         Reviewed by Mark Rowe.
1073
1074         * wtf/Platform.h: Define WTF_USE_PLUGIN_HOST_PROCESS to 1 when
1075         building on 64-bit SnowLeopard.  Define to 0 elsewhere.
1076
1077 2009-09-22  Oliver Hunt  <oliver@apple.com>
1078
1079         Reviewed by Geoff Garen.
1080
1081         Code sampling builds are broken.
1082         https://bugs.webkit.org/show_bug.cgi?id=29662
1083
1084         Fix build.
1085
1086         * bytecode/EvalCodeCache.h:
1087         (JSC::EvalCodeCache::get):
1088         * bytecode/SamplingTool.cpp:
1089         (JSC::ScriptSampleRecord::sample):
1090         (JSC::SamplingTool::doRun):
1091         (JSC::SamplingTool::notifyOfScope):
1092         (JSC::compareScriptSampleRecords):
1093         (JSC::SamplingTool::dump):
1094         * bytecode/SamplingTool.h:
1095         (JSC::ScriptSampleRecord::ScriptSampleRecord):
1096         (JSC::ScriptSampleRecord::~ScriptSampleRecord):
1097         (JSC::SamplingTool::SamplingTool):
1098         * bytecompiler/BytecodeGenerator.cpp:
1099         (JSC::BytecodeGenerator::BytecodeGenerator):
1100         (JSC::BytecodeGenerator::emitNewFunction):
1101         (JSC::BytecodeGenerator::emitNewFunctionExpression):
1102         * bytecompiler/BytecodeGenerator.h:
1103         (JSC::BytecodeGenerator::makeFunction):
1104         * debugger/Debugger.cpp:
1105         (JSC::evaluateInGlobalCallFrame):
1106         * debugger/DebuggerCallFrame.cpp:
1107         (JSC::DebuggerCallFrame::evaluate):
1108         * parser/Nodes.cpp:
1109         (JSC::ScopeNode::ScopeNode):
1110         * runtime/Completion.cpp:
1111         (JSC::checkSyntax):
1112         (JSC::evaluate):
1113         * runtime/Executable.cpp:
1114         (JSC::FunctionExecutable::fromGlobalCode):
1115         * runtime/Executable.h:
1116         (JSC::ScriptExecutable::ScriptExecutable):
1117         (JSC::EvalExecutable::EvalExecutable):
1118         (JSC::EvalExecutable::create):
1119         (JSC::ProgramExecutable::ProgramExecutable):
1120         (JSC::FunctionExecutable::create):
1121         (JSC::FunctionExecutable::FunctionExecutable):
1122         * runtime/JSGlobalObjectFunctions.cpp:
1123         (JSC::globalFuncEval):
1124
1125 2009-09-22  Darin Adler  <darin@apple.com>
1126
1127         Reviewed by Sam Weinig.
1128
1129         * wtf/Forward.h: Added PassOwnPtr.
1130
1131 2009-09-22  Yaar Schnitman  <yaar@chromium.org>
1132
1133         Reviewed by David Levin.
1134
1135         Ported chromium.org's javascriptcore.gyp for the webkit chromium port.
1136
1137         https://bugs.webkit.org/show_bug.cgi?id=29617
1138
1139         * JavaScriptCore.gyp/JavaScriptCore.gyp: Added.
1140
1141 2009-09-22  Thiago Macieira  <thiago.macieira@nokia.com>
1142
1143         Reviewed by Simon Hausmann.
1144
1145         Fix compilation with WINSCW: no varargs macros
1146
1147         Disable variadic arguments for WINSCW just like we do
1148         for MSVC7.
1149
1150         * wtf/Assertions.h:
1151
1152 2009-09-22  Kent Hansen  <khansen@trolltech.com>
1153
1154         Reviewed by Simon Hausmann.
1155
1156         Disable variadic macros on MSVC7.
1157
1158         This was originally added in r26589 but not extended
1159         when LOG_DISABLED/ASSERT_DISABLED was introduced.
1160
1161         * wtf/Assertions.h:
1162
1163 2009-09-22  Simon Hausmann  <simon.hausmann@nokia.com>
1164
1165         Unreviewed build fix for Windows CE < 5
1166
1167         Define WINCEBASIC to disable the IsDebuggerPresent() code in
1168         wtf/Assertions.cpp.
1169
1170         * JavaScriptCore.pri:
1171
1172 2009-09-22  Joerg Bornemann  <joerg.bornemann@nokia.com>
1173
1174         Reviewed by Simon Hausmann.
1175
1176         Fix major memory leak in JavaScriptCore RegisterFile on Windows CE
1177
1178         https://bugs.webkit.org/show_bug.cgi?id=29367
1179
1180         On Widows CE we must decommit all committed pages before we release
1181         them. See VirtualFree documentation.
1182         Desktop Windows behaves much smoother in this situation.
1183
1184         * interpreter/RegisterFile.cpp:
1185         (JSC::RegisterFile::~RegisterFile):
1186
1187 2009-09-21  Greg Bolsinga  <bolsinga@apple.com>
1188
1189         Reviewed by Simon Fraser & Sam Weinig.
1190
1191         Add ENABLE(ORIENTATION_EVENTS)
1192         https://bugs.webkit.org/show_bug.cgi?id=29508
1193
1194         * wtf/Platform.h: Also sort PLATFORM(IPHONE) #defines.
1195
1196 2009-09-21  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
1197
1198         Reviewed by Eric Seidel.
1199
1200         [Fix] SourceCode's uninitialized member
1201         
1202         Potential source of crashes and bugs was fixed. Default constructor
1203         didn't initialized m_provider member.
1204
1205         https://bugs.webkit.org/show_bug.cgi?id=29364
1206
1207         * parser/SourceCode.h:
1208         (JSC::SourceCode::SourceCode):
1209
1210 2009-09-21  Oliver Hunt  <oliver@apple.com>
1211
1212         Reviewed by Geoff Garen.
1213
1214         REGRESSION (r48582): Crash in StructureStubInfo::initPutByIdTransition when reloading trac.webkit.org
1215         https://bugs.webkit.org/show_bug.cgi?id=29599
1216
1217         It is unsafe to attempt to cache new property transitions on
1218         dictionaries of any type.
1219
1220         * interpreter/Interpreter.cpp:
1221         (JSC::Interpreter::tryCachePutByID):
1222         * jit/JITStubs.cpp:
1223         (JSC::JITThunks::tryCachePutByID):
1224
1225 2009-09-21  Oliver Hunt  <oliver@apple.com>
1226
1227         RS=Maciej Stachowiak.
1228
1229         Re-land SNES fix with corrected assertion.
1230
1231         * interpreter/Interpreter.cpp:
1232         (JSC::Interpreter::resolveGlobal):
1233         (JSC::Interpreter::tryCachePutByID):
1234         (JSC::Interpreter::tryCacheGetByID):
1235         * jit/JITStubs.cpp:
1236         (JSC::JITThunks::tryCachePutByID):
1237         (JSC::JITThunks::tryCacheGetByID):
1238         (JSC::DEFINE_STUB_FUNCTION):
1239         * runtime/BatchedTransitionOptimizer.h:
1240         (JSC::BatchedTransitionOptimizer::BatchedTransitionOptimizer):
1241         * runtime/JSObject.cpp:
1242         (JSC::JSObject::removeDirect):
1243         * runtime/Structure.cpp:
1244         (JSC::Structure::Structure):
1245         (JSC::Structure::getEnumerablePropertyNames):
1246         (JSC::Structure::despecifyDictionaryFunction):
1247         (JSC::Structure::addPropertyTransitionToExistingStructure):
1248         (JSC::Structure::addPropertyTransition):
1249         (JSC::Structure::removePropertyTransition):
1250         (JSC::Structure::toDictionaryTransition):
1251         (JSC::Structure::toCacheableDictionaryTransition):
1252         (JSC::Structure::toUncacheableDictionaryTransition):
1253         (JSC::Structure::fromDictionaryTransition):
1254         (JSC::Structure::removePropertyWithoutTransition):
1255         * runtime/Structure.h:
1256         (JSC::Structure::isDictionary):
1257         (JSC::Structure::isUncacheableDictionary):
1258         (JSC::Structure::):
1259         * runtime/StructureChain.cpp:
1260         (JSC::StructureChain::isCacheable):
1261
1262 2009-09-21  Adam Roben  <aroben@apple.com>
1263
1264         Revert r48573, as it caused many assertion failures
1265
1266         * interpreter/Interpreter.cpp:
1267         * jit/JITStubs.cpp:
1268         * runtime/BatchedTransitionOptimizer.h:
1269         * runtime/JSObject.cpp:
1270         * runtime/Structure.cpp:
1271         * runtime/Structure.h:
1272         * runtime/StructureChain.cpp:
1273
1274 2009-09-21  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
1275
1276         Unreviewed make dist build fix. Missing files.
1277
1278         * GNUmakefile.am:
1279
1280 2009-09-19  Gavin Barraclough  <barraclough@apple.com>
1281
1282         Reviewed by Sam 'Cabin Boy' Weinig.
1283
1284         Fix stack alignment with ARM THUMB2 JIT.
1285         https://bugs.webkit.org/show_bug.cgi?id=29526
1286         
1287         Stack is currently being decremented by 0x3c, bump this to 0x40 to make this a
1288         multiple of 16 bytes.
1289
1290         * jit/JITStubs.cpp:
1291         (JSC::JITThunks::JITThunks):
1292         * jit/JITStubs.h:
1293
1294 2009-09-20  Oliver Hunt  <oliver@apple.com>
1295
1296         Reviewed by Maciej Stachowiak.
1297
1298         SNES is too slow
1299         https://bugs.webkit.org/show_bug.cgi?id=29534
1300
1301         The problem was that the emulator used multiple classes with
1302         more properties than our dictionary cutoff allowed, this resulted
1303         in more or less all critical logic inside the emulator requiring
1304         uncached property access.
1305
1306         Rather than simply bumping the dictionary cutoff, this patch
1307         recognises that there are two ways to create a "dictionary"
1308         structure.  Either by adding a large number of properties, or
1309         by removing a property.  In the case of adding properties we
1310         know all the existing properties will maintain their existing
1311         offsets, so we could cache access to those properties, if we
1312         know they won't be removed.
1313
1314         To make this possible, this patch adds the logic required to
1315         distinguish a dictionary created by addition from one created
1316         by removal.  With this logic in place we can now cache access
1317         to objects with large numbers of properties.
1318
1319         SNES performance improved by more than 6x.
1320
1321         * interpreter/Interpreter.cpp:
1322         (JSC::Interpreter::resolveGlobal):
1323         (JSC::Interpreter::tryCachePutByID):
1324         (JSC::Interpreter::tryCacheGetByID):
1325         * jit/JITStubs.cpp:
1326         (JSC::JITThunks::tryCachePutByID):
1327         (JSC::JITThunks::tryCacheGetByID):
1328         (JSC::DEFINE_STUB_FUNCTION):
1329         * runtime/BatchedTransitionOptimizer.h:
1330         (JSC::BatchedTransitionOptimizer::BatchedTransitionOptimizer):
1331         * runtime/JSObject.cpp:
1332         (JSC::JSObject::removeDirect):
1333         * runtime/Structure.cpp:
1334         (JSC::Structure::Structure):
1335         (JSC::Structure::getEnumerablePropertyNames):
1336         (JSC::Structure::despecifyDictionaryFunction):
1337         (JSC::Structure::addPropertyTransitionToExistingStructure):
1338         (JSC::Structure::addPropertyTransition):
1339         (JSC::Structure::removePropertyTransition):
1340         (JSC::Structure::toDictionaryTransition):
1341         (JSC::Structure::toCacheableDictionaryTransition):
1342         (JSC::Structure::toUncacheableDictionaryTransition):
1343         (JSC::Structure::fromDictionaryTransition):
1344         (JSC::Structure::removePropertyWithoutTransition):
1345         * runtime/Structure.h:
1346         (JSC::Structure::isDictionary):
1347         (JSC::Structure::isUncacheableDictionary):
1348         (JSC::Structure::):
1349         * runtime/StructureChain.cpp:
1350         (JSC::StructureChain::isCacheable):
1351
1352 2009-09-19  Oliver Hunt  <oliver@apple.com>
1353
1354         Reviewed by Maciej Stachowiak.
1355
1356         Implement ES5 Object.create function
1357         https://bugs.webkit.org/show_bug.cgi?id=29524
1358
1359         Implement Object.create.  Very simple patch, effectively Object.defineProperties
1360         only creating the target object itself.
1361
1362         * runtime/CommonIdentifiers.h:
1363         * runtime/ObjectConstructor.cpp:
1364         (JSC::ObjectConstructor::ObjectConstructor):
1365         (JSC::objectConstructorCreate):
1366
1367 2009-09-19  Dan Bernstein  <mitz@apple.com>
1368
1369         Fix clean debug builds.
1370
1371         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
1372
1373 2009-09-19  Joerg Bornemann  <joerg.bornemann@nokia.com>
1374
1375         Reviewed by George Staikos.
1376
1377         QtWebKit Windows CE compile fix
1378
1379         https://bugs.webkit.org/show_bug.cgi?id=29379
1380
1381         There is no _aligned_alloc or _aligned_free on Windows CE.
1382         We just use the Windows code that was there before and use VirtualAlloc.
1383         But that also means that the BLOCK_SIZE must be 64K as this function
1384         allocates on 64K boundaries.
1385
1386         * runtime/Collector.cpp:
1387         (JSC::Heap::allocateBlock):
1388         (JSC::Heap::freeBlock):
1389         * runtime/Collector.h:
1390
1391 2009-09-19  Oliver Hunt  <oliver@apple.com>
1392
1393         Reviewed by Sam Weinig.
1394
1395         Implement ES5 Object.defineProperties function
1396         https://bugs.webkit.org/show_bug.cgi?id=29522
1397
1398         Implement Object.defineProperties.  Fairly simple patch, simply makes use of
1399         existing functionality used for defineProperty.
1400
1401         * runtime/CommonIdentifiers.h:
1402         * runtime/ObjectConstructor.cpp:
1403         (JSC::ObjectConstructor::ObjectConstructor):
1404         (JSC::defineProperties):
1405         (JSC::objectConstructorDefineProperties):
1406
1407 2009-09-19  Oliver Hunt  <oliver@apple.com>
1408
1409         Reviewed by NOBODY (Build fix).
1410
1411         Windows build fix part2
1412
1413         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1414         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
1415
1416 2009-09-19  Oliver Hunt  <oliver@apple.com>
1417
1418         Reviewed by NOBODY (Buildfix).
1419
1420         Windows build fix part 1.
1421
1422         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1423         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
1424
1425 2009-09-18  Oliver Hunt  <oliver@apple.com>
1426
1427         Reviewed by Geoff Garen.
1428
1429         Implement ES5 Object.defineProperty function
1430         https://bugs.webkit.org/show_bug.cgi?id=29503
1431
1432         Implement Object.defineProperty.  This requires adding the API to
1433         ObjectConstructor, along with a helper function that implements the
1434         ES5 internal [[ToPropertyDescriptor]] function.  It then adds
1435         JSObject::defineOwnProperty that implements the appropriate ES5 semantics.
1436         Currently defineOwnProperty uses a delete followed by a put to redefine
1437         attributes of a property, clearly this is less efficient than it could be
1438         but we can improve this if it needs to be possible in future.
1439
1440         * JavaScriptCore.exp:
1441         * debugger/DebuggerActivation.cpp:
1442         (JSC::DebuggerActivation::defineGetter):
1443         (JSC::DebuggerActivation::defineSetter):
1444         * debugger/DebuggerActivation.h:
1445         * interpreter/Interpreter.cpp:
1446         (JSC::Interpreter::privateExecute):
1447         * jit/JITStubs.cpp:
1448           Update defineGetter/Setter calls
1449         * runtime/CommonIdentifiers.h:
1450         * runtime/JSArray.cpp:
1451         (JSC::JSArray::getOwnPropertySlot):
1452         * runtime/JSGlobalObject.cpp:
1453         (JSC::JSGlobalObject::defineGetter):
1454         (JSC::JSGlobalObject::defineSetter):
1455         * runtime/JSGlobalObject.h:
1456         * runtime/JSObject.cpp:
1457         (JSC::JSObject::defineGetter):
1458         (JSC::JSObject::defineSetter):
1459         (JSC::putDescriptor):
1460         (JSC::JSObject::defineOwnProperty):
1461         * runtime/JSObject.h:
1462         * runtime/ObjectConstructor.cpp:
1463         (JSC::ObjectConstructor::ObjectConstructor):
1464         (JSC::objectConstructorGetOwnPropertyDescriptor):
1465         (JSC::toPropertyDescriptor):
1466         (JSC::objectConstructorDefineProperty):
1467         * runtime/ObjectPrototype.cpp:
1468         (JSC::objectProtoFuncDefineGetter):
1469         (JSC::objectProtoFuncDefineSetter):
1470         * runtime/PropertyDescriptor.cpp:
1471         (JSC::PropertyDescriptor::writable):
1472         (JSC::PropertyDescriptor::enumerable):
1473         (JSC::PropertyDescriptor::configurable):
1474         (JSC::PropertyDescriptor::isDataDescriptor):
1475         (JSC::PropertyDescriptor::isGenericDescriptor):
1476         (JSC::PropertyDescriptor::isAccessorDescriptor):
1477         (JSC::PropertyDescriptor::getter):
1478         (JSC::PropertyDescriptor::setter):
1479         (JSC::PropertyDescriptor::setDescriptor):
1480         (JSC::PropertyDescriptor::setAccessorDescriptor):
1481         (JSC::PropertyDescriptor::setWritable):
1482         (JSC::PropertyDescriptor::setEnumerable):
1483         (JSC::PropertyDescriptor::setConfigurable):
1484         (JSC::PropertyDescriptor::setSetter):
1485         (JSC::PropertyDescriptor::setGetter):
1486         (JSC::PropertyDescriptor::equalTo):
1487         (JSC::PropertyDescriptor::attributesEqual):
1488         (JSC::PropertyDescriptor::attributesWithOverride):
1489         * runtime/PropertyDescriptor.h:
1490         (JSC::PropertyDescriptor::PropertyDescriptor):
1491         (JSC::PropertyDescriptor::value):
1492         (JSC::PropertyDescriptor::setValue):
1493         (JSC::PropertyDescriptor::isEmpty):
1494         (JSC::PropertyDescriptor::writablePresent):
1495         (JSC::PropertyDescriptor::enumerablePresent):
1496         (JSC::PropertyDescriptor::configurablePresent):
1497         (JSC::PropertyDescriptor::setterPresent):
1498         (JSC::PropertyDescriptor::getterPresent):
1499         (JSC::PropertyDescriptor::operator==):
1500         (JSC::PropertyDescriptor::):
1501
1502 2009-09-18  Gabor Loki  <loki@inf.u-szeged.hu>
1503
1504         Reviewed by Gavin Barraclough.
1505
1506         Build fix to enable ARM_THUMB2 on Linux
1507         https://bugs.webkit.org/show_bug.cgi?id=
1508
1509         * jit/ExecutableAllocator.h:
1510         (JSC::ExecutableAllocator::cacheFlush):
1511         * jit/JITStubs.cpp:
1512         * wtf/Platform.h:
1513
1514 2009-09-18  Gabor Loki  <loki@inf.u-szeged.hu>
1515
1516         Reviewed by Gavin Barraclough.
1517
1518         Defines two pseudo-platforms for ARM and Thumb-2 instruction set.
1519         https://bugs.webkit.org/show_bug.cgi?id=29122
1520
1521         Introduces WTF_PLATFORM_ARM_TRADITIONAL and WTF_PLATFORM_ARM_THUMB2
1522         macros on ARM platforms. The PLATFORM(ARM_THUMB2) should be used
1523         when Thumb-2 instruction set is the required target. The
1524         PLATFORM(ARM_TRADITIONAL) is for generic ARM instruction set. In
1525         case where the code is common the PLATFORM(ARM) have to be used.
1526
1527         * assembler/ARMAssembler.cpp:
1528         * assembler/ARMAssembler.h:
1529         * assembler/ARMv7Assembler.h:
1530         * assembler/MacroAssembler.h:
1531         * assembler/MacroAssemblerARM.cpp:
1532         * assembler/MacroAssemblerARM.h:
1533         * assembler/MacroAssemblerCodeRef.h:
1534         (JSC::MacroAssemblerCodePtr::MacroAssemblerCodePtr):
1535         * jit/ExecutableAllocator.h:
1536         * jit/JIT.h:
1537         * jit/JITInlineMethods.h:
1538         (JSC::JIT::beginUninterruptedSequence):
1539         (JSC::JIT::preserveReturnAddressAfterCall):
1540         (JSC::JIT::restoreReturnAddressBeforeReturn):
1541         (JSC::JIT::restoreArgumentReference):
1542         (JSC::JIT::restoreArgumentReferenceForTrampoline):
1543         * jit/JITOpcodes.cpp:
1544         * jit/JITStubs.cpp:
1545         (JSC::JITThunks::JITThunks):
1546         * jit/JITStubs.h:
1547         * wtf/Platform.h:
1548         * yarr/RegexJIT.cpp:
1549         (JSC::Yarr::RegexGenerator::generateEnter):
1550
1551 2009-09-18  Joerg Bornemann  <joerg.bornemann@nokia.com>
1552
1553         Reviewed by Simon Hausmann.
1554
1555         Fix the Qt/Windows CE build.
1556
1557         * JavaScriptCore.pri: Build the ce_time.cpp functions from
1558         within Qt externally.
1559         * wtf/DateMath.cpp: Removed unnecessary Qt #ifdef, for the
1560         Qt build these functions are no external, too.
1561
1562 2009-09-17  Janne Koskinen  <janne.p.koskinen@digia.com>
1563
1564         Reviewed by Simon Hausmann.
1565
1566         Symbian/WINSCW build fox.
1567
1568         Repeat Q_OS_WIN wchar_t hack for WINSCW, similar to
1569         revision 24774.
1570
1571         WINSCW defines wchar_t, thus UChar has to be wchar_t
1572
1573         * wtf/unicode/qt4/UnicodeQt4.h:
1574
1575 2009-09-17  Janne Koskinen  <janne.p.koskinen@digia.com>
1576
1577         Reviewed by Simon Hausmann.
1578
1579         Symbian/WINSCW build fix.
1580
1581         https://bugs.webkit.org/show_bug.cgi?id=29186
1582
1583         WINSCW Template specialisation name in declaration must the be the same as in implementation.
1584
1585         * runtime/LiteralParser.h:
1586
1587 2009-09-15  Norbert Leser  <norbert.leser@nokia.com>
1588
1589         Reviewed by Darin Adler.
1590
1591         https://bugs.webkit.org/show_bug.cgi?id=27060
1592
1593         Symbian compiler for emulator target (WINSCW) fails with
1594         "illegal operand" for m_attributesInPrevious in structure.ccp
1595         (when calling make_pair functions).
1596         This error is apparently due to the compiler not properly
1597         resolving the unsigned type of the declared bitfield.
1598
1599         Initial patch explicitly casted m_attributesInPrevious
1600         to unsigned, but since bitfield optimization is not critical for
1601         the emulator target, this conditional change in header file
1602         appears to be least intrusive.
1603
1604         * runtime/Structure.h:
1605
1606 2009-09-16  Gabor Loki  <loki@inf.u-szeged.hu>
1607
1608         Reviewed by Darin Adler.
1609
1610         Fix GCC warnings on ARM_THUMB2 platform
1611
1612         * assembler/ARMv7Assembler.h:
1613         (JSC::ARMThumbImmediate::countLeadingZerosPartial):
1614         * assembler/MacroAssemblerARMv7.h:
1615         (JSC::MacroAssemblerARMv7::branchTruncateDoubleToInt32):
1616         (JSC::MacroAssemblerARMv7::moveFixedWidthEncoding):
1617
1618 2009-09-16  Greg Bolsinga  <bolsinga@apple.com>
1619
1620         Add ENABLE(INSPECTOR)
1621         https://bugs.webkit.org/show_bug.cgi?id=29260
1622
1623         Reviewed by David Kilzer.
1624
1625         * wtf/Platform.h:
1626
1627 2009-09-16  Greg Bolsinga  <bolsinga@apple.com>
1628
1629         Add ENABLE(CONTEXT_MENUS)
1630         https://bugs.webkit.org/show_bug.cgi?id=29225
1631
1632         Reviewed by David Kilzer.
1633
1634         * wtf/Platform.h:
1635
1636 2009-09-16  Benjamin C Meyer  <benjamin.meyer@torchmobile.com>
1637
1638         Reviewed by Eric Seidel.
1639
1640         The webkit stdint and stdbool headers exists because
1641         the compiler MSVC doesn't include them.  The check
1642         should not check for PLATFORM(WIN_OS) but for MSVC.
1643
1644         * os-win32/stdbool.h:
1645         * os-win32/stdint.h:
1646
1647 2009-09-16  Greg Bolsinga  <bolsinga@apple.com>
1648
1649         Add ENABLE(DRAG_SUPPORT)
1650         https://bugs.webkit.org/show_bug.cgi?id=29233
1651
1652         Reviewed by David Kilzer.
1653
1654         * wtf/Platform.h:
1655
1656 2009-09-16  Kevin Ollivier  <kevino@theolliviers.com>
1657
1658         waf build fix after flag was moved to correct place.
1659
1660         * wscript:
1661
1662 2009-09-16  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
1663
1664         Reviewed by Simon Hausmann.
1665
1666         [Qt] Build fix for 64-bit Qt on Mac OS X
1667
1668         * wtf/Platform.h: Use JSVALUE64 on DARWIN, not only on MAC
1669
1670 2009-09-16  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
1671
1672         Reviewed by Simon Hausmann.
1673
1674         [Qt] Fix wtf/ThreadSpecific.h under Qt to free thread local objects.
1675         https://bugs.webkit.org/show_bug.cgi?id=29295
1676
1677         This is an important fix when JavaScript workers are in use, since
1678         unfreed ThreadGlobalDatas leak a big amount of memory (50-100k each).
1679         QThreadStorage calls the destructor of a given object, which is the
1680         ThreadSpecific::Data. Unlike pthread, Qt is object oriented, and does
1681         not support the calling of a static utility function when the thread
1682         is about to close. In this patch we call the ThreadSpecific::destroy()
1683         utility function from the destructor of ThreadSpecific::Data. Moreover,
1684         since Qt resets all thread local values to 0 before the calling of the
1685         appropriate destructors, we set back the pointer to its original value.
1686         This is necessary because the get() method of the ThreadSpecific
1687         object may be called during the exuction of the destructor.
1688
1689         * wtf/ThreadSpecific.h:
1690         (WTF::ThreadSpecific::Data::~Data):
1691         (WTF::::~ThreadSpecific):
1692         (WTF::::set):
1693         (WTF::::destroy):
1694
1695 2009-09-10  Oliver Hunt  <oliver@apple.com>
1696
1697         Reviewed by Geoff Garen.
1698
1699         Allow anonymous storage inside JSObject
1700         https://bugs.webkit.org/show_bug.cgi?id=29168
1701
1702         Add the concept of anonymous slots to Structures so that it is
1703         possible to store references to values that need marking in the
1704         standard JSObject storage buffer.  This allows us to reduce the
1705         malloc overhead of some objects (by allowing them to store JS
1706         values in the inline storage of the object) and reduce the 
1707         dependence of custom mark functions (if all an objects children
1708         are in the standard object property storage there's no need to
1709         mark them manually).
1710
1711         * JavaScriptCore.exp:
1712         * runtime/JSObject.h:
1713         (JSC::JSObject::putAnonymousValue):
1714         (JSC::JSObject::getAnonymousValue):
1715         (JSC::JSObject::addAnonymousSlots):
1716         * runtime/JSWrapperObject.h:
1717         (JSC::JSWrapperObject::createStructure):
1718         (JSC::JSWrapperObject::JSWrapperObject):
1719         (JSC::JSWrapperObject::setInternalValue):
1720         * runtime/PropertyMapHashTable.h:
1721         * runtime/Structure.cpp:
1722         (JSC::Structure::~Structure):
1723         (JSC::Structure::materializePropertyMap):
1724         (JSC::Structure::addAnonymousSlotsTransition):
1725         (JSC::Structure::copyPropertyTable):
1726         (JSC::Structure::put):
1727         (JSC::Structure::rehashPropertyMapHashTable):
1728         * runtime/Structure.h:
1729         (JSC::Structure::propertyStorageSize):
1730         (JSC::StructureTransitionTable::reifySingleTransition):
1731         * runtime/StructureTransitionTable.h:
1732         (JSC::StructureTransitionTable::TransitionTable::addSlotTransition):
1733         (JSC::StructureTransitionTable::TransitionTable::removeSlotTransition):
1734         (JSC::StructureTransitionTable::TransitionTable::getSlotTransition):
1735         (JSC::StructureTransitionTable::getAnonymousSlotTransition):
1736         (JSC::StructureTransitionTable::addAnonymousSlotTransition):
1737         (JSC::StructureTransitionTable::removeAnonymousSlotTransition):
1738
1739 2009-09-15  Alex Milowski  <alex@milowski.com>
1740
1741         Reviewed by Tor Arne Vestbø.
1742
1743         Added the ENABLE_MATHML define to the features
1744
1745         * Configurations/FeatureDefines.xcconfig:
1746
1747 2009-09-15 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
1748
1749         Reviewed by Tor Arne Vestbø.
1750
1751         [Qt] Build fix for windows.
1752
1753         After http://trac.webkit.org/changeset/47795 the MinGW build broke,
1754         because MinGW has __mingw_aligned_malloc instead of _aligned_malloc.
1755
1756         * runtime/Collector.cpp:
1757         (JSC::Heap::allocateBlock): MinGW case added.
1758         (JSC::Heap::freeBlock): MinGW case added.
1759
1760 2009-09-15  Csaba Osztrogonac  <oszi@inf.u-szeged.hu>
1761
1762         Reviewed by Tor Arne Vestbø.
1763
1764         [Qt] Build fix for Windows/MinGW
1765
1766         https://bugs.webkit.org/show_bug.cgi?id=29268
1767
1768         * wtf/Platform.h: JSVALUE32_64 temporarily disabled on PLATFORM(WIN_OS) with COMPILER(MINGW)
1769
1770 2009-09-14  Gabor Loki  <loki@inf.u-szeged.hu>
1771
1772         Reviewed by Gavin Barraclough.
1773
1774         Detect VFP at runtime in generic ARM port on Linux platform.
1775         https://bugs.webkit.org/show_bug.cgi?id=29076
1776
1777         * JavaScriptCore.pri:
1778         * assembler/MacroAssemblerARM.cpp: Added.
1779         (JSC::isVFPPresent):
1780         * assembler/MacroAssemblerARM.h:
1781         (JSC::MacroAssemblerARM::supportsFloatingPoint):
1782
1783 2009-09-14  Csaba Osztrogonac  <oszi@inf.u-szeged.hu>
1784
1785         Reviewed by Tor Arne Vestbø.
1786
1787         [Qt] Build fix for windows build.
1788
1789         * JavaScriptCore.pri: Correct a logic error.
1790         * pcre/dftables: Add missing paranthesis for tmpdir function.
1791
1792 2009-09-12  Oliver Hunt  <oliver@apple.com>
1793
1794         Reviewed by NOBODY (Build fix).
1795
1796         Build fix for windows exports (again).
1797
1798         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1799         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
1800
1801 2009-09-12  Oliver Hunt  <oliver@apple.com>
1802
1803         Reviewed by NOBODY (Build fix).
1804
1805         Build fix for windows exports.
1806
1807         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1808         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
1809
1810 2009-09-12  Oliver Hunt  <oliver@apple.com>
1811
1812         Reviewed by NOBODY (Build fix).
1813
1814         Correct fix for non-allinonefile builds
1815
1816         * runtime/ObjectConstructor.cpp:
1817
1818 2009-09-12  Oliver Hunt  <oliver@apple.com>
1819
1820         Reviewed by NOBODY (Build fix).
1821
1822         Fix non-allinonefile builds
1823
1824         * runtime/ObjectConstructor.cpp:
1825
1826 2009-09-12  Oliver Hunt  <oliver@apple.com>
1827
1828         Reviewed by Maciej Stachowiak.
1829
1830         [ES5] Implement Object.keys
1831         https://bugs.webkit.org/show_bug.cgi?id=29170
1832
1833         This patch basically requires two separate steps, the first is to split getPropertyNames
1834         into two functions -- getOwnPropertyNames and getPropertyNames, basically making them behave
1835         in the same way as getOwnPropertySlot and getPropertySlot.  In essence getOwnPropertyNames
1836         produces the list of properties on an object excluding its prototype chain and getPropertyNames
1837         just iterates the the object and its prototype chain calling getOwnPropertyNames at each level.
1838
1839         * API/JSCallbackObject.h:
1840         * API/JSCallbackObjectFunctions.h:
1841         (JSC::::getOwnPropertyNames):
1842         * JavaScriptCore.exp:
1843         * debugger/DebuggerActivation.cpp:
1844         (JSC::DebuggerActivation::getOwnPropertyNames):
1845         * debugger/DebuggerActivation.h:
1846         * runtime/CommonIdentifiers.h:
1847         * runtime/JSArray.cpp:
1848         (JSC::JSArray::getOwnPropertyNames):
1849         * runtime/JSArray.h:
1850         * runtime/JSByteArray.cpp:
1851         (JSC::JSByteArray::getOwnPropertyNames):
1852         * runtime/JSByteArray.h:
1853         * runtime/JSNotAnObject.cpp:
1854         (JSC::JSNotAnObject::getOwnPropertyNames):
1855         * runtime/JSNotAnObject.h:
1856         * runtime/JSObject.cpp:
1857         (JSC::JSObject::getOwnPropertyNames):
1858         * runtime/JSObject.h:
1859         * runtime/JSVariableObject.cpp:
1860         (JSC::JSVariableObject::getOwnPropertyNames):
1861         * runtime/JSVariableObject.h:
1862         * runtime/ObjectConstructor.cpp:
1863         (JSC::ObjectConstructor::ObjectConstructor):
1864         (JSC::objectConstructorKeys):
1865         * runtime/RegExpMatchesArray.h:
1866         (JSC::RegExpMatchesArray::getOwnPropertyNames):
1867         * runtime/StringObject.cpp:
1868         (JSC::StringObject::getOwnPropertyNames):
1869         * runtime/StringObject.h:
1870         * runtime/Structure.cpp:
1871         (JSC::Structure::getOwnEnumerablePropertyNames):
1872         (JSC::Structure::getEnumerablePropertyNames):
1873         * runtime/Structure.h:
1874
1875 2009-09-11  Oliver Hunt  <oliver@apple.com>
1876
1877         Reviewed by Sam Weinig.
1878
1879         getPropertyNames caching is invalid when the prototype chain contains objects with custom getPropertyNames
1880         https://bugs.webkit.org/show_bug.cgi?id=29214
1881
1882         Add a flag to TypeInfo to indicate whether a type overrides getPropertyNames.
1883         This flag is used to make sure that caching of the property name data is safe.
1884
1885         * API/JSCallbackConstructor.h:
1886         (JSC::JSCallbackConstructor::createStructure):
1887         * debugger/DebuggerActivation.h:
1888         (JSC::DebuggerActivation::createStructure):
1889         * runtime/BooleanObject.h:
1890         (JSC::BooleanObject::createStructure):
1891         * runtime/DatePrototype.h:
1892         (JSC::DatePrototype::createStructure):
1893         * runtime/FunctionPrototype.h:
1894         (JSC::FunctionPrototype::createStructure):
1895         * runtime/JSONObject.h:
1896         (JSC::JSONObject::createStructure):
1897         * runtime/JSObject.h:
1898         (JSC::JSObject::createStructure):
1899         * runtime/JSTypeInfo.h:
1900         (JSC::TypeInfo::hasDefaultGetPropertyNames):
1901         * runtime/JSVariableObject.h:
1902         (JSC::JSVariableObject::createStructure):
1903         * runtime/JSWrapperObject.h:
1904         (JSC::JSWrapperObject::createStructure):
1905         * runtime/MathObject.h:
1906         (JSC::MathObject::createStructure):
1907         * runtime/NumberConstructor.h:
1908         (JSC::NumberConstructor::createStructure):
1909         * runtime/NumberObject.h:
1910         (JSC::NumberObject::createStructure):
1911         * runtime/RegExpConstructor.h:
1912         (JSC::RegExpConstructor::createStructure):
1913         * runtime/RegExpObject.h:
1914         (JSC::RegExpObject::createStructure):
1915         * runtime/StructureChain.cpp:
1916         (JSC::StructureChain::isCacheable):
1917
1918 2009-09-11  Alexey Proskuryakov  <ap@webkit.org>
1919
1920         Reviewed by Geoff Garen.
1921
1922         https://bugs.webkit.org/show_bug.cgi?id=29207
1923         Add checks for using WebCore JS context on secondary threads
1924
1925         * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData):
1926         * runtime/JSGlobalData.h:
1927         Added a new mainThreadOnly flag that WebCore would set.
1928
1929         * runtime/Collector.cpp: (JSC::Heap::registerThread): JSC API methods always call this,
1930         so this is a good place to check that the API isn't used form a wrong thread.
1931
1932 2009-09-11  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
1933
1934         Reviewed by Simon Hausmann.
1935
1936         Compiling JavaScriptCore on sparc 64 with gcc fails.
1937
1938         ThreadSafeShared uses the atomic __gnu_cxx::__exchange_and_add with an int,
1939         however on sparc 64 the _Atomic_word argument is typedefed to long (8 bytes).
1940
1941         The patch disables WTF_USE_LOCKFREE_THREADSAFESHARED in ThreadSafeShared to use
1942         a mutex instead when compiling for sparc 64 with gcc.
1943
1944         https://bugs.webkit.org/show_bug.cgi?id=29175
1945
1946         * wtf/Platform.h:
1947         __sparc64__ is not defined on all OS.
1948         Uses instead: __sparc__ && __arch64__ || __sparcv9
1949         * wtf/Threading.h:
1950
1951 2009-09-11  Prasanth Ullattil  <prasanth.ullattil@nokia.com>
1952
1953         Reviewed by Simon Hausmann.
1954
1955         Fix compile error on Windows7(64Bit) with latest SDK.
1956
1957         Added the missing include file.
1958
1959         * runtime/UString.cpp:
1960
1961 2009-09-11  Joerg Bornemann  <joerg.bornemann@trolltech.com>
1962
1963         Reviewed by Simon Hausmann.
1964
1965         Qt/Windows CE compile fix, include the executable allocator and
1966         markstack implementation in the windows build.
1967
1968         * JavaScriptCore.pri:
1969
1970 2009-09-08  John Abd-El-Malek  <jam@chromium.org>
1971
1972         Reviewed by Dimitri Glazkov.
1973
1974         Remove unneeded define for ActiveX.
1975         https://bugs.webkit.org/show_bug.cgi?id=29054
1976
1977         * wtf/Platform.h:
1978
1979 2009-09-10  Mark Rowe  <mrowe@apple.com>
1980
1981         Rubber-stamped by Sam Weinig.
1982
1983         Update JavaScriptCore and WebKit's FeatureDefines.xcconfig so that they are in sync with WebCore as they need to be.
1984
1985         * Configurations/FeatureDefines.xcconfig:
1986
1987 2009-09-10  Fumitoshi Ukai  <ukai@chromium.org>
1988
1989         Reviewed by Alexey Proskuryakov.
1990
1991         Export WTF::tryFastMalloc used in WebSocketChannel.
1992         https://bugs.webkit.org/show_bug.cgi?id=28038
1993
1994         * JavaScriptCore.exp:
1995         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1996         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
1997
1998 2009-09-10  Oliver Hunt  <oliver@apple.com>
1999
2000         Reviewed by NOBODY (Build fix).
2001
2002         Make StructureTransitionTable use an enum for the PtrAndFlags member
2003         used for the single transition slot optimisation.
2004
2005         * runtime/StructureTransitionTable.h:
2006         (JSC::StructureTransitionTable::StructureTransitionTable):
2007         (JSC::StructureTransitionTable::usingSingleTransitionSlot):
2008         (JSC::StructureTransitionTable::):
2009
2010 2009-09-10  Oliver Hunt  <oliver@apple.com>
2011
2012         Reviewed by Geoff Garen.
2013
2014         Refactor StructureTransitionTable and Structure to unify handling of the single slot optimization
2015         https://bugs.webkit.org/show_bug.cgi?id=29141
2016
2017         Make StructureTransitionTable encapsulate the single transition slot optimization.
2018
2019         * runtime/Structure.cpp:
2020         (JSC::Structure::Structure):
2021         (JSC::Structure::~Structure):
2022         (JSC::Structure::addPropertyTransitionToExistingStructure):
2023         (JSC::Structure::addPropertyTransition):
2024         (JSC::Structure::addPropertyWithoutTransition):
2025         (JSC::Structure::removePropertyWithoutTransition):
2026         (JSC::Structure::hasTransition):
2027         * runtime/Structure.h:
2028         (JSC::StructureTransitionTable::contains):
2029         (JSC::StructureTransitionTable::get):
2030         (JSC::StructureTransitionTable::hasTransition):
2031         (JSC::StructureTransitionTable::reifySingleTransition):
2032         * runtime/StructureTransitionTable.h:
2033         (JSC::StructureTransitionTable::StructureTransitionTable):
2034         (JSC::StructureTransitionTable::~StructureTransitionTable):
2035         (JSC::StructureTransitionTable::remove):
2036         (JSC::StructureTransitionTable::add):
2037         (JSC::StructureTransitionTable::table):
2038         (JSC::StructureTransitionTable::singleTransition):
2039         (JSC::StructureTransitionTable::usingSingleTransitionSlot):
2040         (JSC::StructureTransitionTable::setSingleTransition):
2041         (JSC::StructureTransitionTable::setTransitionTable):
2042         (JSC::StructureTransitionTable::):
2043         * wtf/PtrAndFlags.h:
2044         (WTF::PtrAndFlags::PtrAndFlags):
2045
2046 2009-09-10  Zoltan Horvath  <zoltan@webkit.org>
2047
2048         Reviewed by Darin Adler.
2049
2050         Implement fastDeleteSkippingDestructor for FastAllocBase and fastDeleteAllValues for HashSet
2051         https://bugs.webkit.org/show_bug.cgi?id=25930
2052
2053         FastAllocBase has been extended with fastDeleteSkippingDestructor function which
2054         releases memory without destructor call. fastDeleteAllValues has been implemented 
2055         similar as deleteAllValues but it uses fastDelete function to release memory.
2056
2057         * wtf/FastAllocBase.h:
2058         (WTF::fastDeleteSkippingDestructor):
2059         * wtf/HashSet.h:
2060         (WTF::fastDeleteAllValues):
2061
2062 2009-09-10  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
2063
2064         Reviewed by Darin Adler.
2065
2066         ARM compiler does not understand GCC visibility attribute
2067         https://bugs.webkit.org/show_bug.cgi?id=29079
2068
2069         * API/JSBase.h: Make the test more specific to hit only
2070         the GCC compiler
2071
2072 2009-09-10  Adam Barth  <abarth@webkit.org>
2073
2074         Unreviewed revert of the previous change.  It broke the tests.
2075
2076         * wtf/dtoa.cpp:
2077         (WTF::dtoa):
2078
2079 2009-09-10  Ben Laurie  <benl@google.com>
2080
2081         Reviewed by Adam Barth.
2082
2083         <https://bugs.webkit.org/show_bug.cgi?id=26836>
2084
2085         If dtoa was given a small buffer and the number was either infinite or
2086         NaN, then the buffer would be overflowed.
2087
2088         * wtf/dtoa.cpp:
2089
2090 2009-09-09  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
2091
2092         Reviewed by Darin Adler.
2093
2094         Change reinterpret_cast to static_cast in r48212.
2095
2096         * jit/ExecutableAllocator.h:
2097         (JSC::ExecutableAllocator::cacheFlush):
2098
2099 2009-09-09  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
2100
2101         Reviewed by Darin Adler.
2102
2103         Remove WTF_PLATFORM_FORCE_PACK as it is no longer used
2104         https://bugs.webkit.org/show_bug.cgi?id=29066
2105
2106         * wtf/Platform.h:
2107
2108 2009-09-09  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
2109
2110         Reviewed by Ariya Hidayat.
2111
2112         Implement flushing the instruction cache for Symbian
2113         https://bugs.webkit.org/show_bug.cgi?id=29075
2114
2115         * jit/ExecutableAllocator.h:
2116         (JSC::ExecutableAllocator::cacheFlush): Call IMB_Range to flush
2117         the instruction cache on Symbian
2118
2119 2009-09-09  Kent Hansen  <khansen@trolltech.com>
2120
2121         Reviewed by Darin Adler.
2122
2123         https://bugs.webkit.org/show_bug.cgi?id=29024
2124         Make JavaScriptCore compile on platforms with case-insensitive file systems and typeinfo.h in STL
2125
2126         These platforms include Microsoft Visual Studio 2003, and Symbian with Metrowerks compiler.
2127
2128         * JavaScriptCore.gypi:
2129         * JavaScriptCore.xcodeproj/project.pbxproj:
2130         * runtime/JSTypeInfo.h: Copied from JavaScriptCore/runtime/TypeInfo.h.
2131         * runtime/Structure.h:
2132         * runtime/TypeInfo.h: Removed.
2133
2134 2009-09-08  Oliver Hunt  <oliver@apple.com>
2135
2136         Reviewed by Maciej Stachowiak.
2137
2138         JSON.stringify(Date) loses the milliseconds information
2139         https://bugs.webkit.org/show_bug.cgi?id=29063
2140
2141         Make sure we include milliseconds in the output of toISOString.
2142
2143         * runtime/DatePrototype.cpp:
2144         (JSC::dateProtoFuncToISOString):
2145
2146 2009-09-08  Kevin Ollivier  <kevino@theolliviers.com>
2147
2148         wx build fix, generate derived sources earlier in order to make sure
2149         they're found by the build system when generating the list of sources to build.
2150
2151         * wscript:
2152
2153 2009-09-08  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
2154
2155         Reviewed by Simon Hausmann.
2156
2157         Build fix when USE(LOCKFREE_THREADSAFESHARED) is not defined
2158         https://bugs.webkit.org/show_bug.cgi?id=29011
2159
2160         * wtf/Threading.h: Use LOCKFREE_THREADSAFESHARED guard for 
2161         atomicIncrement and atomicDecrement
2162
2163 2009-09-07  Zoltan Horvath  <zoltan@webkit.org>
2164
2165         Reviewed by Darin Adler.
2166
2167         Allow custom memory allocation control in Yarr's RegexInterpreter
2168         https://bugs.webkit.org/show_bug.cgi?id=29025
2169
2170         Inherits RegexInterpreter classes from FastAllocBase (bug #20422), which has
2171         been instantiated by 'new':
2172
2173         class ByteDisjunction
2174         -> instantiated in JavaScriptCore/yarr/RegexInterpreter.cpp:1462
2175
2176         struct BytecodePattern
2177         -> instantiated in JavaScriptCore/yarr/RegexInterpreter.cpp:1279
2178
2179         * yarr/RegexInterpreter.h:
2180
2181 2009-09-07  Drew Wilson  <atwilson@google.com>
2182
2183         Reverting r48121 to fix Windows build errors.
2184
2185         * JavaScriptCore.exp:
2186
2187 2009-09-07  Drew Wilson  <atwilson@google.com>
2188
2189         Reviewed by David Levin.
2190
2191         Enable SHARED_WORKERS by default
2192         https://bugs.webkit.org/show_bug.cgi?id=28959
2193
2194         * Configurations/FeatureDefines.xcconfig:
2195
2196 2009-09-07  Fumitoshi Ukai  <ukai@chromium.org>
2197
2198         Reviewed by Alexey Proskuryakov.
2199
2200         Export WTF::tryFastMalloc used in WebSocketChannel.
2201         https://bugs.webkit.org/show_bug.cgi?id=28038
2202
2203         * JavaScriptCore.exp:
2204
2205 2009-09-04  Oliver Hunt  <oliver@apple.com>
2206
2207         Reviewed by NOBODY (Build fix).
2208
2209         Fix windows export files
2210
2211         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2212         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
2213
2214 2009-09-04  Oliver Hunt  <oliver@apple.com>
2215
2216         Reviewed by Gavin Barraclough.
2217
2218         [[ToString]] conversion should use the actual toString function for String objects.
2219
2220         Remove incorrect specialisations of toString conversions on StringObject.
2221
2222         * JavaScriptCore.exp:
2223         * runtime/StringObject.cpp:
2224         * runtime/StringObject.h:
2225
2226 2009-09-04  Steve Falkenburg  <sfalken@apple.com>
2227
2228         Windows build fix.
2229
2230         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Add new export.
2231         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: Add new export.
2232
2233 2009-09-04  Steve Falkenburg  <sfalken@apple.com>
2234
2235         Windows build fix.
2236
2237         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Remove unneeded export.
2238         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: Remove unneeded export.
2239
2240 2009-09-04  Darin Adler  <darin@apple.com>
2241
2242         Reviewed by Geoff Garen.
2243
2244         DateInstance object collected on ARM JIT (JSValue: WTF_USE_JSVALUE32)
2245         https://bugs.webkit.org/show_bug.cgi?id=28909
2246
2247         Part two.
2248
2249         Make some improvements to garbage collection code:
2250
2251             1) Create a runtime assertion that catches any classes that
2252                override markChildren but have the HasDefaultMark bit set.
2253             2) Remove checks of the mark bit outside the MarkStack::append
2254                function; they are redundant.
2255             3) Improve the efficiency of the asObject and asArray functions
2256                when called on JSCell* to avoid a round trip to JSValue.
2257             4) Make more callers use the checked asCell and asObject
2258                casting functions rather than unchecked casts.
2259             5) Removed the JSCell::marked function and other GC-related
2260                functions because these operations are no longer things that
2261                code other than the core GC code needs to do directly. Fixed
2262                callers that were calling them.
2263
2264         * runtime/Collector.cpp:
2265         (JSC::Heap::markConservatively): Removed unneeded call to MarkStack::drain.
2266         (JSC::Heap::markProtectedObjects): Removed unneeded check of the mark
2267         bit and call to MarkStack::drain.
2268         (JSC::Heap::collect): Removed unneeded checks of the mark bit and also
2269         changed call to SmallStrings::mark to call markChildren instead to match
2270         the rest of the objects.
2271         (JSC::typeName): Removed unneeded cast to JSObject*.
2272
2273         * runtime/JSArray.h:
2274         (JSC::asArray): Added an overload for JSCell* and changed the JSValue
2275         version to call it. Removed some unneeded casts.
2276         (JSC::JSArray::markChildrenDirect): Marked this function inline. It's in
2277         a header, and if not marked inline this could lead to linking problems.
2278         (JSC::MarkStack::markChildren): Added. This helper function is used by
2279         the drain function to avoid repating code. Also added the code here to
2280         check fro default mark violations in debug code. If a markChildren
2281         function adds something to the mark stack, but the type info claimed
2282         hasDefaultMark was true, then we will get an assertion now. Also fixed
2283         the assertion about the mark bit to use the Heap function directly
2284         because we don't have a JSCell::marked function any more.
2285         (JSC::MarkStack::drain): Changed a local variable from "v" to "value",
2286         and from "currentCell" to "cell". Changed to call markChildren in two
2287         places instead of repeating a chain of if statements twice. Changed
2288         code that reads and writes the mark bit to use Heap::isCellMarked and
2289         Heap::markCell so we can eliminate the JSCell::marked and
2290         JSCell::markCellDirect functions.
2291
2292         * runtime/JSCell.h: Removed JSCell's markCellDirect and marked member
2293         functions. Added a comment explaining that asCell should be deprecated
2294         in favor of the JSValue asCell member function.
2295         (JSC::MarkStack::append): Added the assertion that catches callers
2296         that have set the HasDefaultMark bit incorrectly. Changed
2297         code that reads and writes the mark bit to use Heap::isCellMarked and
2298         Heap::markCell so we can eliminate the JSCell::marked and
2299         JSCell::markCellDirect functions. Moved the overload of
2300         MarkStack::append for JSValue here so it can call through to the cell
2301         version. The old version had a copy of all the code instead, but that
2302         repeated the conversion from JSValue to JSCell* and the check for
2303         whether a value is a cell multiple times.
2304         (JSC::Structure::markAggregate): Moved this function here to avoid
2305         dependencies for Structure.h, since this calls MarkStack::append.
2306
2307         * runtime/JSObject.cpp:
2308         (JSC::JSObject::markChildren): Added code to clear
2309         m_isCheckingForDefaultMarkViolation so the marking done by JSObject
2310         doesn't trigger the assertion.
2311
2312         * runtime/JSValue.h: Moved some stray includes that were outside the
2313         header guard inside it. Not sure how that happened! Removed the
2314         GC-related member functions markChildren, hasChildren, marked, and
2315         markDirect.
2316
2317         * runtime/JSWrapperObject.h: Made markChildren private.
2318         (JSC::JSWrapperObject::createStructure): Added. Fixes a bug where the
2319         HasDefaultMark bit was set.
2320
2321         * runtime/MarkStack.h: Added m_isCheckingForDefaultMarkViolation and
2322         initialized it to false. Moved the append function body from here to
2323         JSCell.h. Added a declaration of a private markChildren function used
2324         inside the drain function.
2325
2326         * runtime/SmallStrings.cpp:
2327         (JSC::SmallStrings::markChildren): Changed the name and style of this
2328         function to match other functions. This allows us to share the normal
2329         mark stack code path.
2330
2331         * runtime/SmallStrings.h: Changed the name and interface of mark to
2332         the more-normal markChildren style.
2333
2334         * runtime/Structure.h: Moved the body of markAggregate into the
2335         JSCell.h to avoid a circular dependency with JSCell.h.
2336
2337 2009-09-04  Darin Adler  <darin@apple.com>
2338
2339         Reviewed by Geoff Garen.
2340
2341         DateInstance object collected on ARM JIT (JSValue: WTF_USE_JSVALUE32)
2342         https://bugs.webkit.org/show_bug.cgi?id=28909
2343
2344         Part one.
2345
2346         Make some improvements to garbage collection code:
2347
2348             1) Fix the two classes that had the default mark bit set but
2349                should not.
2350             2) Remove checks of the mark bit outside the MarkStack::append
2351                function; they are redundant.
2352             3) Make more callers use the checked asCell and asObject
2353                casting functions rather than unchecked casts.
2354             4) Removed some GC-related functions because these operations are
2355                no longer things that code other than the core GC code needs
2356                to do directly. Fixed callers that were calling them.
2357
2358         * bytecode/CodeBlock.cpp:
2359         (JSC::CodeBlock::markAggregate): Removed unneeded check of the mark
2360         bit before calling MarkStack::append.
2361
2362         * interpreter/Register.h: Removed unneeded marked and markChildren
2363         functions.
2364
2365         * jit/JITStubs.cpp:
2366         (op_eq): Removed unneeded assertions, instead using checked casting
2367         functions such as asObject.
2368
2369         * runtime/ArgList.h: Added now-needed forward declaration of MarkStack.
2370
2371         * runtime/GetterSetter.cpp:
2372         (JSC::GetterSetter::markChildren): Remmoved unneeded check of the mark bit.
2373
2374         * runtime/GlobalEvalFunction.h:
2375         (JSC::GlobalEvalFunction::createStructure): Added. Fixes a bug where the
2376         HasDefaultMark bit was set.
2377
2378         * runtime/JSCell.cpp:
2379         (JSC::JSCell::getObject): Use asObject to avoid a direct static_cast.
2380
2381         * runtime/JSObject.h:
2382         (JSC::asObject): Added an overload for JSCell* and changed the JSValue
2383         version to call it.
2384         (JSC::JSValue::get): Use asObject to avoid a direct static_cast.
2385
2386         * runtime/JSWrapperObject.h: Made markChildren private.
2387         (JSC::JSWrapperObject::createStructure): Added. Fixes a bug where the
2388         HasDefaultMark bit was set. Later we may want to optimize this for
2389         wrapper types that never have cells in their internal values, but there
2390         is no measured performance regression in SunSpider or V8 doing this
2391         all the time.
2392
2393         * runtime/MarkStack.cpp: Tweaked formatting.
2394
2395 2009-09-04  Kevin Ollivier  <kevino@theolliviers.com>
2396
2397         wx build fix. Switch USE_ defines over to the compiler so that they can be
2398         checked by files not including config.h (like WebCorePrefix.h).
2399
2400         * wtf/Platform.h:
2401
2402 2009-09-03  Yong Li  <yong.li@torchmobile.com>
2403
2404         Reviewed by David Levin.
2405
2406         Remove unnecessary dependency on unistd.h
2407         https://bugs.webkit.org/show_bug.cgi?id=28962
2408
2409         * runtime/Completion.cpp:
2410
2411 2009-09-03  Fumitoshi Ukai  <ukai@chromium.org>
2412
2413         Reviewed by Eric Seidel.
2414
2415         Add strnstr for Linux and Windows in StringExtras.h
2416         https://bugs.webkit.org/show_bug.cgi?id=28901
2417
2418         * wtf/StringExtras.h:
2419         (strnstr):
2420
2421 2009-09-03  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
2422
2423         Reviewed by Darin Adler.
2424
2425         Allow custom memory allocation control for JavaScriptCore's HashEntry class
2426         https://bugs.webkit.org/show_bug.cgi?id=27830
2427
2428         Inherits HashEntry class from FastAllocBase because it has been
2429         instantiated by 'new' JavaScriptCore/runtime/Lookup.cpp:32.
2430
2431         * runtime/Lookup.h:
2432
2433 2009-09-02  Gavin Barraclough  <barraclough@apple.com>
2434
2435         Should crash if JIT code buffer allocation fails.
2436
2437         https://bugs.webkit.org/show_bug.cgi?id=28926
2438         <rdar://problem/7031922>
2439
2440         * jit/ExecutableAllocatorPosix.cpp:
2441         (JSC::ExecutablePool::systemAlloc):
2442         * jit/ExecutableAllocatorWin.cpp:
2443         (JSC::ExecutablePool::systemAlloc):
2444
2445 2009-09-02  Kevin Ollivier  <kevino@theolliviers.com>
2446
2447         waf build fixes for Windows/MSVC.
2448
2449         * wscript:
2450
2451 2009-09-02  Kevin Ollivier  <kevino@theolliviers.com>
2452
2453         Build fix for building on Windows.
2454
2455         * wtf/ThreadingPthreads.cpp:
2456
2457 2009-09-02  Norbert Leser  <norbert.leser@nokia.com>
2458
2459         Reviewed by Eric Seidel.
2460
2461         Use fastMalloc when neither MMAP nor VIRTUALALLOC are enabled
2462         
2463         RegisterFile constructor currently throws #error when both
2464         MMAP and VIRTUALALLOC conditions fail.
2465         On any platform that does not provide these features
2466         (for instance, Symbian),
2467         the fallback should be regular malloc (or fastMalloc).
2468         It is functionally equivalent in this case, even though it may
2469         have certain drawbacks such as lack of dynamic pre-allocation.
2470
2471         * interpreter/RegisterFile.cpp:
2472         (JSC::RegisterFile::~RegisterFile):
2473         * interpreter/RegisterFile.h:
2474         (JSC::RegisterFile::RegisterFile):
2475
2476 2009-08-31  Robert Agoston  <Agoston.Robert@stud.u-szeged.hu>
2477
2478         Reviewed by Gavin Barraclough.
2479
2480         Fixed typo.
2481         https://bugs.webkit.org/show_bug.cgi?id=28691
2482
2483         * parser/Parser.h:
2484         (JSC::Parser::parse):
2485
2486 2009-08-27  Oliver Hunt  <oliver@apple.com>
2487
2488         Reviewed by Maciej Stachowiak.
2489
2490         JSON Stringifier does not follow ES5 spec for handling of Number, String and Boolean objects
2491         https://bugs.webkit.org/show_bug.cgi?id=28797
2492
2493         Fixed unwrapBoxedPrimitive to do the right thing, which necessitated a couple of new exception
2494         checks, and corrected the logic in gap to correctly convert Number and String objects.
2495
2496         * runtime/JSONObject.cpp:
2497         (JSC::unwrapBoxedPrimitive):
2498         (JSC::gap):
2499         (JSC::Stringifier::Stringifier):
2500         (JSC::Stringifier::appendStringifiedValue):
2501
2502 2009-08-27  Oliver Hunt  <oliver@apple.com>
2503
2504         Reviewed by Adam Roben.
2505
2506         JSON.stringify replacer array does not accept values that are not string primitives.
2507         https://bugs.webkit.org/show_bug.cgi?id=28788
2508
2509         Update the JSON stringifier to initialise its replacer array according to the most
2510         recent version of the spec.
2511
2512         * runtime/Identifier.h:
2513         (JSC::Identifier::from):
2514         * runtime/JSONObject.cpp:
2515         (JSC::Stringifier::Stringifier):
2516
2517 2009-08-27  Alexey Proskuryakov  <ap@apple.com>
2518
2519         Reviewed by Oliver Hunt.
2520
2521         https://bugs.webkit.org/show_bug.cgi?id=28753
2522         <rdar://problem/7173448> Excessive number of threads (and a crash)
2523
2524         * wtf/Threading.h: (WTF::atomicIncrement): Changed atomicIncrement to match decrement
2525         and return the new value. Also added using directives for these functions, to match
2526         te rest of WTF.
2527
2528 2009-08-27  Brent Fulgham  <bfulgham@webkit.org>
2529
2530         Reviewed by Adam Roben.
2531
2532         Link the testapi against CFLite when building the WinCairo port.
2533
2534         * JavaScriptCore.vcproj/testapi/testapi.vcproj: Add new Release_CFLite
2535           target.  Update all targets to inherit from either the
2536           JavaScriptCF.vsprops (Apple target) or the JavaScriptCFLite.vsprops
2537           file (WinCairo target).
2538         * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops: Remove
2539           input file CoreFoundation.lib. This is provided by either the
2540           JavaScriptCF.vsprops or JavaScriptCFLite.vsprops file.
2541
2542 2009-08-27  Steve Falkenburg  <sfalken@apple.com>
2543
2544         Reviewed by Geoff Garen.
2545         
2546         Fix Windows-specific crash due to missing memory clearing call.
2547         
2548         * runtime/Collector.cpp:
2549         (JSC::Heap::allocateBlock):
2550
2551 2009-08-27  Brent Fulgham  <bfulgham@webkit.org>
2552
2553         Build fix: JavaScriptCore_debug.def missing some exports.  Apple
2554         Windows build does not use this file, so it was not noticed previously.
2555
2556         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
2557
2558 2009-08-27  Gavin Barraclough  <barraclough@apple.com>
2559
2560         Reviewed by Oliver Hunt.
2561
2562         x86-64 GTK broken due to code offsets changing, pointers sometimes packed into immediates.
2563         https://bugs.webkit.org/show_bug.cgi?id=28317
2564
2565         Missed one, fix part II.
2566
2567         * assembler/MacroAssemblerX86Common.h:
2568         (JSC::MacroAssemblerX86Common::move):
2569         * assembler/X86Assembler.h:
2570         (JSC::CAN_SIGN_EXTEND_8_32):
2571
2572 2009-08-27  Oliver Hunt  <oliver@apple.com>
2573
2574         Reviewed by Adam Roben.
2575
2576         JSON.stringify replacer array does not accept values that are not string primitives.
2577         https://bugs.webkit.org/show_bug.cgi?id=28788
2578
2579         Update the JSON stringifier to initialise its replacer array according to the most
2580         recent version of the spec.
2581
2582         * runtime/Identifier.h:
2583         (JSC::Identifier::from):
2584         * runtime/JSONObject.cpp:
2585         (JSC::Stringifier::Stringifier):
2586
2587 2009-08-27  Oliver Hunt  <oliver@apple.com>
2588
2589         Reviewed by Alexey Proskuryakov.
2590
2591         JSON parser accepts trailing comma in array literals
2592         https://bugs.webkit.org/show_bug.cgi?id=28779
2593
2594         Update parser to correctly fail if there's a trailing comma.
2595
2596         * runtime/LiteralParser.cpp:
2597         (JSC::LiteralParser::parse):
2598
2599 2009-08-26  Oliver Hunt  <oliver@apple.com>
2600
2601         Reviewed by Gavin Barraclough.
2602
2603         'this' in JSON.parse reviver is the global object
2604         https://bugs.webkit.org/show_bug.cgi?id=28752
2605
2606         This is a technically simple change, we merely update the code for calling
2607         the reviver function to pass the correct this object.  Doing so however
2608         exposes the holder to arbitrary mutation by the reviver function so it is
2609         necessary for us to now guard all property accesses against the possibility
2610         of failure.
2611
2612         * runtime/JSArray.h:
2613           JSON needs to delete a property from the array, so we friend its 
2614           Walker class so that we can make a non-virtual call to the arrays
2615           delete and getOwnPropertySlot methods.
2616         * runtime/JSONObject.cpp:
2617         (JSC::Walker::callReviver):
2618           We need to pass the correct this object
2619         (JSC::Walker::walk):
2620           Update calls to callReviver, and update property logic logic
2621           to correctly handle the holder being mutated by the reviver
2622           function.
2623
2624 2009-08-26  Alice Liu  <alice.liu@apple.com>
2625
2626         Windows build fix: added some exported symbols
2627
2628         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2629         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
2630
2631 2009-08-26  Geoffrey Garen  <ggaren@apple.com>
2632
2633         Windows build fix: Removed some exported symbols that no longer exist.
2634
2635         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2636         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
2637
2638 2009-08-26  Gavin Barraclough  <barraclough@apple.com>
2639
2640         Reviewed by Olliejver Hunt.
2641
2642         x86-64 GTK broken due to code offsets changing, pointers sometimes packed into immediates.
2643         https://bugs.webkit.org/show_bug.cgi?id=28317
2644
2645         We rely on a slightly OS X specific behaviour, that x86-64 applications have a 4Gb zero page,
2646         so pointers are never representable as a 32-bit integer, and always have to be represented by
2647         a separate immediate load instruction, rather than within the immediate field of an arithmetic
2648         or memory operation.
2649
2650         We explicitly check for a couple of cases where a value might be representable in 32-bit, but
2651         these probably never kick in on Mac OS, and only kick in to hose GTK.  Deleting these does not
2652         show a performance degradation on SunSpider.  Remove.
2653
2654         * assembler/MacroAssemblerX86_64.h:
2655         (JSC::MacroAssemblerX86_64::storePtr):
2656         (JSC::MacroAssemblerX86_64::branchPtr):
2657
2658 2009-08-26  Geoffrey Garen  <ggaren@apple.com>
2659
2660         Reviewed by Oliver Hunt.
2661
2662         A bit of Collector refatoring.
2663         
2664         SunSpider says no change. v8 says 1.003x faster (1.02x faster on splay).
2665
2666         * JavaScriptCore.exp:
2667
2668         * runtime/JSCell.cpp:
2669         (JSC::JSCell::toPrimitive):
2670         (JSC::JSCell::getPrimitiveNumber):
2671         (JSC::JSCell::toBoolean):
2672         (JSC::JSCell::toNumber):
2673         (JSC::JSCell::toString):
2674         (JSC::JSCell::toObject): Removed pure virtual functions from
2675         JSCell, so the collector can construct one. This allowed
2676         me to remove a bunch of ASSERT_NOT_REACHED throughout the
2677         code, too.
2678
2679         * runtime/JSCell.h:
2680         (JSC::JSCell::JSCell): ditto
2681         (JSC::Heap::heap): Inlined this function because it's trivial.
2682
2683         * JavaScriptCore.exp:
2684
2685         * runtime/Collector.cpp:
2686         (JSC::Heap::destroy):
2687         (JSC::Heap::allocateBlock):
2688         (JSC::Heap::freeBlock):
2689         (JSC::Heap::freeBlocks): Renamed freeHeap to freeBlocks, since
2690         it doesn't actually free the Heap object.
2691         (JSC::Heap::heapAllocate):
2692         (JSC::Heap::sweep):
2693         * runtime/Collector.h: Refactored block allocation and destruction
2694         into helper functions.
2695         
2696         * runtime/GetterSetter.cpp:
2697         * runtime/JSAPIValueWrapper.cpp:
2698         * runtime/JSPropertyNameIterator.cpp: Removed dummy implementations
2699         of pure virtual functions. (See above.)
2700
2701 === End re-roll-in of r47738:47740 with Windows crash fixed ===
2702
2703 2009-08-26  Geoffrey Garen  <ggaren@apple.com>
2704
2705         Build fix: start out with a 32-bit value to avoid a shortening warning.
2706
2707         * runtime/Collector.cpp:
2708         (JSC::Heap::sweep):
2709
2710 2009-08-24  Geoffrey Garen  <ggaren@apple.com>
2711
2712         Reviewed by Oliver Hunt.
2713
2714         Substantially reduced VM thrash in the GC heap.
2715         
2716         1.08x faster on v8 (1.60x faster on v8-splay).
2717         
2718         1.40x faster on bench-alloc-nonretained.
2719         
2720         1.90x faster on bench-alloc-retained.
2721         
2722         SunSpider says no change.
2723         
2724         * runtime/Collector.cpp:
2725         (JSC::Heap::heapAllocate): Fixed a long-standing bug: update a few local
2726         variables unconditionally after calling collect(), since they may be used
2727         even if we don't "goto scan". (In the bug I saw, usedBlocks got out of
2728         sync with heap.usedBlocks).
2729         (JSC::Heap::sweep): Keep enough free heap space to accomodate 
2730         the number of objects we'll allocate before the next GC, plus 25%, for
2731         good measure.
2732         * runtime/Collector.h: Bumped the block size to 256k. This seems to give
2733         the best cache performance, and it prevents us from initiating lots of
2734         VM traffic to recover very small chunks of memory.
2735
2736 === Begin re-roll-in of r47738:47740 with Windows crash fixed ===
2737
2738 2009-08-25  Drew Wilson  <atwilson@google.com>
2739
2740         Reviewed by David Levin.
2741
2742         postMessage() spec now supports sending arrays of ports
2743         https://bugs.webkit.org/show_bug.cgi?id=26902
2744
2745         Added OwnPtr to VectorTraits so we can store OwnPtrs in Vectors.
2746
2747         * wtf/VectorTraits.h:
2748
2749 2009-08-26  Xan Lopez  <xlopez@igalia.com>
2750
2751         Rubber-stamped by Gustavo Noronha.
2752
2753         Remove duplicated files from file list.
2754
2755         * GNUmakefile.am:
2756
2757 2009-08-26  Oliver Hunt  <oliver@apple.com>
2758
2759         Reviewed by NOBODY (Build fix).
2760
2761         More export fixes.
2762
2763         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2764         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
2765
2766 2009-08-26  Oliver Hunt  <oliver@apple.com>
2767
2768         Reviewed by NOBODY (Build fix).
2769
2770         Hopefully fix all the exports from JSC on windows
2771
2772         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2773         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
2774
2775 2009-08-26  Oliver Hunt  <oliver@apple.com>
2776
2777         Reviewed by NOBODY (Build fixes).
2778
2779         Forgot I added files to JavaScriptCore. 
2780
2781         * GNUmakefile.am:
2782         * JavaScriptCore.gypi:
2783         * JavaScriptCore.pri:
2784         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2785         * JavaScriptCoreSources.bkl:
2786
2787 2009-08-25  Oliver Hunt  <oliver@apple.com>
2788
2789         Reviewed by Gavin Barraclough.
2790
2791         [ES5] Implement getOwnPropertyDescriptor
2792         https://bugs.webkit.org/show_bug.cgi?id=28724
2793
2794         Implement the core runtime support for getOwnPropertyDescriptor.
2795         This adds a virtual getOwnPropertyDescriptor method to every class
2796         that implements getOwnPropertySlot that shadows the behaviour of
2797         getOwnPropertySlot.  The alternative would be to make getOwnPropertySlot
2798         (or PropertySlots in general) provide property attribute information,
2799         but quick testing showed this to be a regression.
2800
2801         * JavaScriptCore.exp:
2802         * JavaScriptCore.xcodeproj/project.pbxproj:
2803         * runtime/Arguments.cpp:
2804         (JSC::Arguments::getOwnPropertyDescriptor):
2805         * runtime/Arguments.h:
2806         * runtime/ArrayPrototype.cpp:
2807         (JSC::ArrayPrototype::getOwnPropertyDescriptor):
2808         * runtime/ArrayPrototype.h:
2809         * runtime/CommonIdentifiers.h:
2810         * runtime/DatePrototype.cpp:
2811         (JSC::DatePrototype::getOwnPropertyDescriptor):
2812         * runtime/DatePrototype.h:
2813         * runtime/JSArray.cpp:
2814         (JSC::JSArray::getOwnPropertyDescriptor):
2815         * runtime/JSArray.h:
2816         * runtime/JSByteArray.cpp:
2817         (JSC::JSByteArray::getOwnPropertyDescriptor):
2818         * runtime/JSByteArray.h:
2819         * runtime/JSFunction.cpp:
2820         (JSC::JSFunction::getOwnPropertyDescriptor):
2821         * runtime/JSFunction.h:
2822         * runtime/JSGlobalObject.h:
2823         (JSC::JSGlobalObject::getOwnPropertyDescriptor):
2824         * runtime/JSNotAnObject.cpp:
2825         (JSC::JSNotAnObject::getOwnPropertyDescriptor):
2826         * runtime/JSNotAnObject.h:
2827         * runtime/JSONObject.cpp:
2828         (JSC::JSONObject::getOwnPropertySlot):
2829         (JSC::JSONObject::getOwnPropertyDescriptor):
2830         * runtime/JSONObject.h:
2831         * runtime/JSObject.cpp:
2832         (JSC::JSObject::getOwnPropertyDescriptor):
2833         (JSC::JSObject::getPropertyDescriptor):
2834         * runtime/JSObject.h:
2835         * runtime/JSString.cpp:
2836         (JSC::JSString::getStringPropertyDescriptor):
2837         (JSC::JSString::getOwnPropertyDescriptor):
2838         * runtime/JSString.h:
2839         * runtime/JSVariableObject.cpp:
2840         (JSC::JSVariableObject::symbolTableGet):
2841         * runtime/JSVariableObject.h:
2842         * runtime/Lookup.h:
2843         (JSC::getStaticPropertyDescriptor):
2844         (JSC::getStaticFunctionDescriptor):
2845         (JSC::getStaticValueDescriptor):
2846           Add property descriptor equivalents of the lookup
2847           table access functions
2848
2849         * runtime/MathObject.cpp:
2850         (JSC::MathObject::getOwnPropertySlot):
2851         (JSC::MathObject::getOwnPropertyDescriptor):
2852         * runtime/MathObject.h:
2853         * runtime/NumberConstructor.cpp:
2854         (JSC::NumberConstructor::getOwnPropertyDescriptor):
2855         * runtime/NumberConstructor.h:
2856         * runtime/ObjectConstructor.cpp:
2857         (JSC::ObjectConstructor::ObjectConstructor):
2858         (JSC::objectConstructorGetOwnPropertyDescriptor):
2859         * runtime/PropertyDescriptor.cpp: Added.
2860         (JSC::PropertyDescriptor::writable):
2861         (JSC::PropertyDescriptor::enumerable):
2862         (JSC::PropertyDescriptor::configurable):
2863         (JSC::PropertyDescriptor::hasAccessors):
2864         (JSC::PropertyDescriptor::setUndefined):
2865         (JSC::PropertyDescriptor::getter):
2866         (JSC::PropertyDescriptor::setter):
2867         (JSC::PropertyDescriptor::setDescriptor):
2868         (JSC::PropertyDescriptor::setAccessorDescriptor):
2869         * runtime/PropertyDescriptor.h: Added.
2870         (JSC::PropertyDescriptor::PropertyDescriptor):
2871         (JSC::PropertyDescriptor::attributes):
2872         (JSC::PropertyDescriptor::isValid):
2873         (JSC::PropertyDescriptor::value):
2874         * runtime/RegExpConstructor.cpp:
2875         (JSC::RegExpConstructor::getOwnPropertyDescriptor):
2876         * runtime/RegExpConstructor.h:
2877         * runtime/RegExpMatchesArray.h:
2878         (JSC::RegExpMatchesArray::getOwnPropertyDescriptor):
2879         * runtime/RegExpObject.cpp:
2880         (JSC::RegExpObject::getOwnPropertyDescriptor):
2881         * runtime/RegExpObject.h:
2882         * runtime/StringObject.cpp:
2883         (JSC::StringObject::getOwnPropertyDescriptor):
2884         * runtime/StringObject.h:
2885         * runtime/StringPrototype.cpp:
2886         (JSC::StringPrototype::getOwnPropertyDescriptor):
2887         * runtime/StringPrototype.h:
2888
2889 2009-08-24  Gavin Barraclough  <barraclough@apple.com>
2890
2891         Reviewed by Darin Adler.
2892
2893         How many copies of the parameters do you need?
2894         https://bugs.webkit.org/show_bug.cgi?id=28701
2895
2896         The function parameters in JSC get copied a lot - and unnecessarily so.
2897
2898         Originally this happened due to duplicating FunctionBodyNodes on recompilation,
2899         though the problem has been exacerbated by copying the parameters from the
2900         original function body onto the executable, then back onto the real body that
2901         will be generated (this happens on every function).  And this is all made worse
2902         since the data structures in question are a little ugly - C style arrays of C++
2903         objects containing ref counts, so they need a full copy-construct (rather than
2904         a simple memcpy).
2905
2906         This can all be greatly simplified by just punting the parameters off into
2907         their own ref-counted object, and forgoing all the copying.
2908
2909         ~no performance change, possible slight progression.
2910
2911         * bytecompiler/BytecodeGenerator.cpp:
2912         (JSC::BytecodeGenerator::BytecodeGenerator):
2913         * bytecompiler/BytecodeGenerator.h:
2914         (JSC::BytecodeGenerator::makeFunction):
2915         * parser/Nodes.cpp:
2916         (JSC::FunctionParameters::FunctionParameters):
2917         (JSC::FunctionBodyNode::FunctionBodyNode):
2918         (JSC::FunctionBodyNode::finishParsing):
2919         * parser/Nodes.h:
2920         (JSC::FunctionBodyNode::parameters):
2921         (JSC::FunctionBodyNode::parameterCount):
2922         * runtime/Executable.cpp:
2923         (JSC::FunctionExecutable::~FunctionExecutable):
2924         (JSC::FunctionExecutable::compile):
2925         (JSC::FunctionExecutable::reparseExceptionInfo):
2926         (JSC::FunctionExecutable::fromGlobalCode):
2927         (JSC::FunctionExecutable::paramString):
2928         * runtime/Executable.h:
2929         (JSC::FunctionExecutable::FunctionExecutable):
2930         (JSC::FunctionExecutable::parameterCount):
2931
2932 2009-08-25  Brent Fulgham  <bfulgham@webkit.org>
2933
2934         Reviewed by NOBODY (Buildfix).
2935
2936         * JavaScriptCore.vcproj/jsc/jsc.vcproj: Add Debug_CFLite target
2937           that inherits from the debug_wincairo property sheet and therefore
2938           links to the proper debug library.
2939         * JavaScriptCore.vcproj/testapi/testapi.vcproj: Add Debug_CFLite target
2940           that inherits from the debug_wincairo property sheet and therefore
2941           links to the proper debug library.
2942
2943 2009-08-25  Chris Marrin  <cmarrin@apple.com>
2944
2945         Reviewed by Simon Fraser.
2946
2947         Export tryFastMalloc for Canvas3D work
2948         https://bugs.webkit.org/show_bug.cgi?id=28018
2949
2950         * JavaScriptCore.exp:
2951
2952 2009-08-25  David Levin  <levin@chromium.org>
2953
2954         Reviewed by Adam Roben.
2955
2956         PLATFORM(CFNETWORK) should be USE(CFNETWORK).
2957         https://bugs.webkit.org/show_bug.cgi?id=28713
2958
2959         * wtf/Platform.h: Added a #define to catch this issue in the
2960         future. The define would generate an error on gcc without the
2961         space in the expansion, but Visual C++ needs the space to cause an error.
2962
2963 2009-08-24  Brent Fulgham  <bfulgham@webkit.org>
2964
2965         Reviewed by Steve Falkenburg.
2966
2967         Revise CFLite Debug build to emit DLL's with _debug label.
2968         https://bugs.webkit.org/show_bug.cgi?id=28695.
2969
2970         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Modify
2971           Cairo debug build to inherit from new debug_cairo property sheet.
2972         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCFLite.vsprops:
2973           Modify to look for debug CFLite when in debug build.
2974
2975 2009-08-24  Gavin Barraclough  <barraclough@apple.com>
2976
2977         Reviewed by Oliver Adler & Darin Hunt.
2978
2979         https://bugs.webkit.org/show_bug.cgi?id=28691
2980         Do not retain ScopeNodes outside of parsing
2981         
2982         There is now no need for these to exist outside of parsing - their use in the runtime is replaced by Executable types.
2983
2984         * bytecode/EvalCodeCache.h:
2985         (JSC::EvalCodeCache::get):
2986         * bytecompiler/BytecodeGenerator.cpp:
2987         (JSC::BytecodeGenerator::BytecodeGenerator):
2988         (JSC::BytecodeGenerator::emitNewFunction):
2989         (JSC::BytecodeGenerator::emitNewFunctionExpression):
2990         * bytecompiler/BytecodeGenerator.h:
2991         (JSC::BytecodeGenerator::makeFunction):
2992         * debugger/Debugger.cpp:
2993         (JSC::Debugger::recompileAllJSFunctions):
2994         (JSC::evaluateInGlobalCallFrame):
2995         * debugger/DebuggerCallFrame.cpp:
2996         (JSC::DebuggerCallFrame::evaluate):
2997         * interpreter/Interpreter.cpp:
2998         (JSC::Interpreter::execute):
2999         (JSC::Interpreter::prepareForRepeatCall):
3000         (JSC::Interpreter::privateExecute):
3001         * jit/JITStubs.cpp:
3002         (JSC::DEFINE_STUB_FUNCTION):
3003         * parser/Nodes.cpp:
3004         (JSC::ScopeNodeData::ScopeNodeData):
3005         (JSC::ProgramNode::create):
3006         (JSC::EvalNode::create):
3007         (JSC::FunctionBodyNode::create):
3008         * parser/Nodes.h:
3009         (JSC::ScopeNode::adoptData):
3010         (JSC::FunctionBodyNode::parameterCount):
3011         * parser/Parser.cpp:
3012         * parser/Parser.h:
3013         (JSC::Parser::arena):
3014         (JSC::Parser::Parser):
3015         (JSC::Parser::parse):
3016         * runtime/ArrayPrototype.cpp:
3017         (JSC::isNumericCompareFunction):
3018         (JSC::arrayProtoFuncSort):
3019         * runtime/Completion.cpp:
3020         (JSC::checkSyntax):
3021         (JSC::evaluate):
3022         * runtime/Executable.cpp:
3023         (JSC::FunctionExecutable::~FunctionExecutable):
3024         (JSC::EvalExecutable::compile):
3025         (JSC::ProgramExecutable::checkSyntax):
3026         (JSC::ProgramExecutable::compile):
3027         (JSC::FunctionExecutable::compile):
3028         (JSC::EvalExecutable::generateJITCode):
3029         (JSC::ProgramExecutable::generateJITCode):
3030         (JSC::FunctionExecutable::generateJITCode):
3031         (JSC::FunctionExecutable::reparseExceptionInfo):
3032         (JSC::EvalExecutable::reparseExceptionInfo):
3033         (JSC::FunctionExecutable::recompile):
3034         (JSC::FunctionExecutable::fromGlobalCode):
3035         (JSC::FunctionExecutable::copyParameters):
3036         (JSC::FunctionExecutable::paramString):
3037         * runtime/Executable.h:
3038         (JSC::ScriptExecutable::ScriptExecutable):
3039         (JSC::ScriptExecutable::sourceID):
3040         (JSC::ScriptExecutable::sourceURL):
3041         (JSC::ScriptExecutable::lineNo):
3042         (JSC::ScriptExecutable::lastLine):
3043         (JSC::ScriptExecutable::usesEval):
3044         (JSC::ScriptExecutable::usesArguments):
3045         (JSC::ScriptExecutable::needsActivation):
3046         (JSC::ScriptExecutable::recordParse):
3047         (JSC::EvalExecutable::bytecode):
3048         (JSC::EvalExecutable::jitCode):
3049         (JSC::ProgramExecutable::bytecode):
3050         (JSC::ProgramExecutable::reparseExceptionInfo):
3051         (JSC::ProgramExecutable::jitCode):
3052         (JSC::FunctionExecutable::FunctionExecutable):
3053         (JSC::FunctionExecutable::make):
3054         (JSC::FunctionExecutable::bytecode):
3055         (JSC::FunctionExecutable::isGenerated):
3056         (JSC::FunctionExecutable::name):
3057         (JSC::FunctionExecutable::parameterCount):
3058         (JSC::FunctionExecutable::jitCode):
3059         * runtime/FunctionConstructor.cpp:
3060         (JSC::constructFunction):
3061         * runtime/JSGlobalData.cpp:
3062         (JSC::JSGlobalData::numericCompareFunction):
3063         * runtime/JSGlobalObjectFunctions.cpp:
3064         (JSC::globalFuncEval):
3065
3066 2009-08-24  Darin Adler  <darin@apple.com>
3067
3068         * runtime/ObjectPrototype.cpp:
3069         (JSC::ObjectPrototype::put): Landed revised version I had tested but forgot
3070         to land. Leave out the branch, since we don't need one.
3071
3072 2009-08-24  Darin Adler  <darin@apple.com>
3073
3074         Reviewed by Geoff Garen.
3075
3076         Array index miss case creates a string every time
3077         https://bugs.webkit.org/show_bug.cgi?id=28664
3078
3079         SunSpider test results I saw:
3080
3081             0.5% faster overall
3082             1% faster on crypto-aes
3083             20% faster on crypto-md5
3084             13% faster on crypto-sha1
3085
3086         * runtime/ObjectPrototype.cpp:
3087         (JSC::ObjectPrototype::ObjectPrototype): Initialize m_hasNoPropertiesWithUInt32Names
3088         to true.
3089         (JSC::ObjectPrototype::put): Clearly m_hasNoPropertiesWithUInt32Names if the new
3090         property has a name that is the string form of a UInt32.
3091         (JSC::ObjectPrototype::getOwnPropertySlot): Don't call JSObject::getOwnPropertySlot
3092         if m_hasNoPropertiesWithUInt32Names is true, and it is highly likely to be true.
3093
3094         * runtime/ObjectPrototype.h: Added declarations for the above.
3095
3096 2009-08-24  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
3097
3098         Unreviewed. Fix a typo in my distcheck build fix.
3099
3100         * GNUmakefile.am:
3101
3102 2009-08-23  Gustavo Noronha Silva  <gns@gnome.org>
3103
3104         Unreviewed build fix for make distcheck.
3105
3106         * GNUmakefile.am: Added files required for the build.
3107
3108 2009-08-22  Maciej Stachowiak  <mjs@apple.com>
3109
3110         Reviewed by Mark Rowe.
3111
3112         REGRESSION(r47639-r47660): Webkit crashes on launch on PowerPC
3113         https://bugs.webkit.org/show_bug.cgi?id=28655
3114
3115         * runtime/JSFunction.cpp:
3116         (JSC::JSFunction::JSFunction): Initialize properly with a VPtrHackExecutable.
3117         * wtf/Platform.h:
3118
3119 2009-08-22  Darin Adler  <darin@apple.com>
3120
3121         Fix storage leak from syntax tree arena allocation patch.
3122
3123         * parser/Nodes.h: CommaNode needs to inherit from ParserArenaDeletable
3124         because it has a vector.
3125
3126 2009-08-21  Darin Adler  <darin@apple.com>
3127
3128         Fix Qt build.
3129
3130         * parser/Nodes.cpp:
3131         (JSC::ScopeNodeData::ScopeNodeData): Made non-inline again.
3132         This is used outside Nodes.cpp so can't be inline unless
3133         it is in the header.
3134
3135 2009-08-21  Darin Adler  <darin@apple.com>
3136
3137         Two loose ends from the last commit.
3138
3139         * JavaScriptCore.xcodeproj/project.pbxproj: Made ParserArena.h
3140         and create_hash_table project-internal instead of "private".
3141         * runtime/Executable.h: Removed accidentally-added constructor.
3142
3143 2009-08-21  Darin Adler  <darin@apple.com>
3144
3145         Reviewed by Gavin Barraclough.
3146
3147         Syntax tree nodes should use arena allocation
3148         https://bugs.webkit.org/show_bug.cgi?id=25674
3149
3150         Use an actual arena now. 0.6% speedup on SunSpider.
3151
3152         New and improved with 100% less leaking of the universe.
3153
3154         * JavaScriptCore.exp:
3155         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3156         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
3157         Removed all exports involving the class FunctionBodyNode, which no
3158         longer needs to be used outside JavaScriptCore.
3159
3160         * JavaScriptCore.xcodeproj/project.pbxproj: Made Nodes.h and
3161         Executable.h project-internal instead of "private".
3162
3163         * bytecompiler/BytecodeGenerator.cpp:
3164         (JSC::BytecodeGenerator::BytecodeGenerator): Updated since VarStack
3165         contains const Identifier* now.
3166
3167         * parser/Grammar.y: Made identifiers from the lexer be const
3168         Identifier* and updated since VarStack contains const Identifier* now.
3169
3170         * parser/Lexer.cpp:
3171         (JSC::Lexer::setCode): Pass in ParserArena, used for identifiers.
3172         (JSC::Lexer::makeIdentifier): Changed return type to const Identifier*
3173         and changed to call ParserArena.
3174         (JSC::Lexer::clear): Removed the code to manage m_identifiers and
3175         added code to set m_arena to 0.
3176         * parser/Lexer.h: Updated for changes above.
3177
3178         * parser/NodeConstructors.h:
3179         (JSC::ParserArenaFreeable::operator new): Added. Calls allocateFreeable
3180         on the arena.
3181         (JSC::ParserArenaDeletable::operator new): Changed to call the
3182         allocateDeletable function on the arena instead of deleteWithArena.
3183         (JSC::PropertyNode::PropertyNode): Added new constructor that makes
3184         numeric identifiers. Some day we might want to optimize this for
3185         integers so it doesn't create a string for each one.
3186         (JSC::ContinueNode::ContinueNode): Initialize m_ident to nullIdentifier
3187         since it's now a const Identifier& so it can't be left uninitialized.
3188         (JSC::BreakNode::BreakNode): Ditto.
3189         (JSC::CaseClauseNode::CaseClauseNode): Updated to use SourceElements*
3190         to keep track of the statements rather than a separate statement vector.
3191         (JSC::BlockNode::BlockNode): Ditto.
3192         (JSC::ForInNode::ForInNode): Initialize m_ident to nullIdentifier.
3193
3194         * parser/Nodes.cpp: Moved the comment explaining emitBytecode in here.
3195         It seemed strangely out of place in the header.
3196         (JSC::ThrowableExpressionData::emitThrowError): Added an overload for
3197         UString as well as Identifier.
3198         (JSC::SourceElements::singleStatement): Added.
3199         (JSC::SourceElements::lastStatement): Added.
3200         (JSC::RegExpNode::emitBytecode): Changed the throwError code to use
3201         the substitution mechanism instead of doing a string append.
3202         (JSC::SourceElements::emitBytecode): Added. Replaces the old
3203         statementListEmitCode function, since we now keep the SourceElements
3204         objects around.
3205         (JSC::BlockNode::lastStatement): Added.
3206         (JSC::BlockNode::emitBytecode): Changed to use emitBytecode instead of
3207         statementListEmitCode.
3208         (JSC::CaseClauseNode::emitBytecode): Added.
3209         (JSC::CaseBlockNode::emitBytecodeForBlock): Changed to use emitBytecode
3210         instead of statementListEmitCode.
3211         (JSC::ScopeNodeData::ScopeNodeData): Changed to store the
3212         SourceElements* instead of using releaseContentsIntoVector.
3213         (JSC::ScopeNode::emitStatementsBytecode): Added.
3214         (JSC::ScopeNode::singleStatement): Added.
3215         (JSC::ProgramNode::emitBytecode): Call emitStatementsBytecode instead
3216         of statementListEmitCode.
3217         (JSC::EvalNode::emitBytecode): Ditto.
3218         (JSC::FunctionBodyNode::emitBytecode): Call emitStatementsBytecode
3219         insetad of statementListEmitCode and check for the return node using
3220         the new functions.
3221
3222         * parser/Nodes.h: Changed VarStack to store const Identifier* instead
3223         of Identifier and rely on the arena to control lifetime. Added a new
3224         ParserArenaFreeable class. Made ParserArenaDeletable inherit from
3225         FastAllocBase instead of having its own operator new. Base the Node
3226         class on ParserArenaFreeable. Changed the various Node classes
3227         to use const Identifier& instead of Identifier to avoid the need to
3228         call their destructors and allow them to function as "freeable" in the
3229         arena. Removed extraneous JSC_FAST_CALL on definitions of inline functions.
3230         Changed ElementNode, PropertyNode, ArgumentsNode, ParameterNode,
3231         CaseClauseNode, ClauseListNode, and CaseBlockNode to use ParserArenaFreeable
3232         as a base class since they do not descend from Node. Eliminated the
3233         StatementVector type and instead have various classes use SourceElements*
3234         instead of StatementVector. This prevents those classes from having to
3235         use ParserArenaDeletable to make sure the vector destructor is called.
3236
3237         * parser/Parser.cpp:
3238         (JSC::Parser::parse): Pass the arena to the lexer.
3239
3240         * parser/Parser.h: Added an include of ParserArena.h, which is no longer
3241         included by Nodes.h.
3242         (JSC::Parser::parseFunctionFromGlobalCode): Changed to use the
3243         singleStatement function, since there is no longer any children function.
3244         Removed some unneeded use of RefPtr.
3245
3246         * parser/ParserArena.cpp:
3247         (JSC::ParserArena::ParserArena): Added. Initializes the new members,
3248         m_freeableMemory, m_freeablePoolEnd, and m_identifiers.
3249         (JSC::ParserArena::freeablePool): Added. Computes the pool pointer,
3250         since we store only the current pointer and the end of pool pointer.
3251         (JSC::ParserArena::deallocateObjects): Added. Contains the common
3252         memory-deallocation logic used by both the destructor and the
3253         reset function.
3254         (JSC::ParserArena::~ParserArena): Changed to call deallocateObjects.
3255         (JSC::ParserArena::reset): Ditto. Also added code to zero out the
3256         new structures, and switched to use clear() instead of shrink(0) since
3257         we don't really reuse arenas.
3258         (JSC::ParserArena::makeNumericIdentifier): Added.
3259         (JSC::ParserArena::allocateFreeablePool): Added. Used when the pool
3260         is empty.
3261         (JSC::ParserArena::isEmpty): Added. No longer inline, which is fine
3262         since this is used only for assertions at the moment.
3263         (JSC::ParserArena::derefWithArena): Make non-inline.
3264
3265         * parser/ParserArena.h: Added an actual arena of "freeable" objects,
3266         ones that don't need destructors to be called. Also added a separate
3267         IdentifierArena object, a segmented vector of identifiers that used
3268         to be in the Lexer.
3269
3270         * runtime/Executable.h: Moved the definition of the
3271         FunctionExecutable::make function here. It can't go in JSFunction.h
3272         since that header has to be used outside JavaScriptCore and so can't
3273         include this, which includes Nodes.h. The function could be moved
3274         elswhere if we don't want to include JSFunction.h in this header, but
3275         for now this seems to be the best place.
3276
3277         * runtime/JSFunction.h: Removed the include of Executable.h and
3278         definition of the FunctionExecutable::make function.
3279
3280         * wtf/FastMalloc.cpp: Fixed an incorrect comment.
3281
3282 2009-08-21  Mark Rowe  <mrowe@apple.com>
3283
3284         Fix the non-JIT build.
3285
3286         * runtime/Executable.cpp:
3287         * runtime/Executable.h:
3288
3289 2009-08-21  Gavin Barraclough  <barraclough@apple.com>
3290
3291         Speculative QuickTime build fix.
3292
3293         * runtime/JSArray.cpp:
3294
3295 2009-08-21  Gavin Barraclough  <barraclough@apple.com>
3296
3297         Speculative QT build fix.
3298
3299         * runtime/StringPrototype.cpp:
3300
3301 2009-08-21  Gavin Barraclough  <barraclough@apple.com>
3302
3303         Reviewed by Oliver Hunt.
3304
3305         Restructure Executable types so that host functions do not hold a FunctionExecutable.
3306         https://bugs.webkit.org/show_bug.cgi?id=28621
3307
3308         All JSFunction objects have a pointer to an Executable*.  This is currently always a
3309         FunctionExecutable, however this has a couple of drawbacks.  Host functions do not
3310         store a range of information that the FunctionExecutable provides (source, name,
3311         CodeBlock & information presently held on the FunctionBodyNode). 
3312
3313         [ * nearly all... see below! ]
3314
3315         Instead, make JSFunctions hold a pointer to an ExecutableBase, move fields specific
3316         to JS sourced executable types (source, node) into a new subclass (ScriptExecutable),
3317         and create a new NativeExecutable type.  We now provide a new method in JSFunction
3318         to access & downcast to FunctionExecutable, but in doing so we can make an early
3319         check (with an ASSERT) to ensure that the Executable read from a function will only
3320         be treated as a FunctionExecutable (and thus the JS sepcific fields will only be
3321         accessed) if the JSFunction is not a host function.
3322
3323         There is one JSFunction that currently does not have an Executable, which is the
3324         object created to allow us to read out the vtable pointer.  By making this change
3325         we can also add a new Executable type fror this object (VPtrHackExecutable).
3326         Since this means that really all JSFunctions have an Executable we no longer have
3327         to null-check m_executable before us it - particularly in isHostFunction().
3328
3329         This patch removes CacheableEvalExecutable, since all subclasses of ExecutableBase
3330         can now be ref-counted - since both JSFunction holds (and ref-counts) an ExecutableBase
3331         that might be a FunctionExecutable or a NativeExecutable.  This does now mean that all
3332         ProgramExecutables and EvalExecutables (unnecessarily) provide an interface to be
3333         ref-counted, however this seems less-bad than host functions unnecessarily providing
3334         interface to access non-host specific information.
3335
3336         The class hierarcy has changed from this:
3337         
3338         - ExecutableBase
3339             - ProgramExecutable
3340             - EvalExecutable
3341                 - CacheableEvalExecutable (also RefCounted by multiple-inheritance)
3342             - FunctionExecutable (also RefCounted by multiple-inheritance, 'special' FunctionExecutable also used for host functions)
3343
3344         To this:
3345         
3346         - RefCounted
3347             - ExecutableBase
3348                 - NativeExecutable
3349                 - VPtrHackExecutable
3350                 - ScriptExecutable
3351                     - ProgramExecutable
3352                     - EvalExecutable
3353                     - FunctionExecutable
3354
3355         This patch speeds up sunspidey by a couple of ms (presumably due to the changes to isHostFunction()).
3356
3357         * bytecode/CodeBlock.cpp:
3358         (JSC::CodeBlock::CodeBlock):
3359         * bytecode/CodeBlock.h:
3360         (JSC::CodeBlock::ownerExecutable):
3361         (JSC::GlobalCodeBlock::GlobalCodeBlock):
3362         * bytecode/EvalCodeCache.h:
3363         (JSC::EvalCodeCache::get):
3364         * debugger/Debugger.cpp:
3365         (JSC::Debugger::recompileAllJSFunctions):
3366         * interpreter/CachedCall.h:
3367         (JSC::CachedCall::CachedCall):
3368         * interpreter/Interpreter.cpp:
3369         (JSC::Interpreter::callEval):
3370         (JSC::Interpreter::privateExecute):
3371         * jit/JITStubs.cpp:
3372         (JSC::DEFINE_STUB_FUNCTION):
3373         * profiler/Profiler.cpp:
3374         (JSC::createCallIdentifierFromFunctionImp):
3375         * runtime/Arguments.h:
3376         (JSC::Arguments::getArgumentsData):
3377         (JSC::Arguments::Arguments):
3378         * runtime/Executable.cpp:
3379         (JSC::NativeExecutable::~NativeExecutable):
3380         (JSC::VPtrHackExecutable::~VPtrHackExecutable):
3381         * runtime/Executable.h:
3382         (JSC::ExecutableBase::ExecutableBase):
3383         (JSC::ExecutableBase::~ExecutableBase):
3384         (JSC::ExecutableBase::isHostFunction):
3385         (JSC::NativeExecutable::NativeExecutable):
3386         (JSC::VPtrHackExecutable::VPtrHackExecutable):
3387         (JSC::ScriptExecutable::ScriptExecutable):
3388         (JSC::ScriptExecutable::source):
3389         (JSC::ScriptExecutable::sourceID):
3390         (JSC::ScriptExecutable::sourceURL):
3391         (JSC::ScriptExecutable::lineNo):
3392         (JSC::ScriptExecutable::lastLine):
3393         (JSC::ScriptExecutable::usesEval):
3394         (JSC::ScriptExecutable::usesArguments):
3395         (JSC::ScriptExecutable::needsActivation):
3396         (JSC::EvalExecutable::EvalExecutable):
3397         (JSC::EvalExecutable::create):
3398         (JSC::ProgramExecutable::ProgramExecutable):
3399         (JSC::FunctionExecutable::FunctionExecutable):
3400         * runtime/FunctionPrototype.cpp:
3401         (JSC::functionProtoFuncToString):
3402         * runtime/JSFunction.cpp:
3403         (JSC::JSFunction::JSFunction):
3404         (JSC::JSFunction::~JSFunction):
3405         (JSC::JSFunction::markChildren):
3406         (JSC::JSFunction::getCallData):
3407         (JSC::JSFunction::call):
3408         (JSC::JSFunction::lengthGetter):
3409         (JSC::JSFunction::getConstructData):
3410         (JSC::JSFunction::construct):
3411         * runtime/JSFunction.h:
3412         (JSC::JSFunction::executable):
3413         (JSC::JSFunction::jsExecutable):
3414         (JSC::JSFunction::isHostFunction):
3415
3416 2009-08-20  Oliver Hunt  <oliver@apple.com>
3417
3418         Reviewed by Maciej Stachowiak.
3419
3420         Browser hangs on opening Web Inspector.
3421         https://bugs.webkit.org/show_bug.cgi?id=28438
3422
3423         Code generation needs to be able to walk the entire scopechain in some
3424         cases, however the symbol table used by activations was a member of the
3425         codeblock.  Following recompilation this may no longer exist, leading
3426         to a crash or hang on lookup.
3427
3428         We fix this by introducing a refcounted SymbolTable subclass, SharedSymbolTable,
3429         for the CodeBlocks used by function code.  This allows activations to
3430         maintain ownership of a copy of the symbol table even after recompilation so
3431         they can continue to work.
3432
3433         * bytecode/CodeBlock.cpp:
3434         (JSC::CodeBlock::CodeBlock):
3435         * bytecode/CodeBlock.h:
3436         (JSC::CodeBlock::symbolTable):
3437         (JSC::CodeBlock::sharedSymbolTable):
3438         (JSC::GlobalCodeBlock::GlobalCodeBlock):
3439         (JSC::FunctionCodeBlock::FunctionCodeBlock):
3440         (JSC::FunctionCodeBlock::~FunctionCodeBlock):
3441         * interpreter/Interpreter.cpp:
3442         (JSC::Interpreter::retrieveArguments):
3443         * runtime/Executable.cpp:
3444         (JSC::EvalExecutable::generateBytecode):
3445         (JSC::FunctionExecutable::generateBytecode):
3446         (JSC::FunctionExecutable::reparseExceptionInfo):
3447         (JSC::EvalExecutable::reparseExceptionInfo):
3448         * runtime/JSActivation.h:
3449         (JSC::JSActivation::JSActivationData::JSActivationData):
3450         (JSC::JSActivation::JSActivationData::~JSActivationData):
3451         * runtime/SymbolTable.h:
3452
3453 2009-08-20  Xan Lopez  <xlopez@igalia.com>
3454
3455         Add new file to GTK+ build.
3456
3457         * GNUmakefile.am:
3458
3459 2009-08-20  Geoffrey Garen  <ggaren@apple.com>
3460
3461         Reviewed by Maciej Stachowiak.
3462
3463         Added a number => string cache.
3464         
3465         1.07x faster on v8 (1.7x faster on v8-splay).
3466         1.004x faster on SunSpider.
3467
3468         * runtime/JSCell.h: Moved JSValue::toString to JSString.h.
3469         * runtime/JSGlobalData.h: Holds the cache.
3470         * runtime/JSNumberCell.cpp:
3471         (JSC::JSNumberCell::toString):
3472         (JSC::JSNumberCell::toThisString): Removed -0 special case.
3473         UString handles this now, since too many clients were
3474         special-casing it.
3475
3476         * runtime/JSString.h:
3477         (JSC::JSValue::toString): Use the cache when converting
3478         an int or double to string.
3479
3480         * runtime/Operations.h:
3481         (JSC::concatenateStrings): Call toString to take advantage
3482         of the cache.
3483
3484         * runtime/SmallStrings.h:
3485         (JSC::NumericStrings::add):
3486         (JSC::NumericStrings::lookup): The cache.
3487
3488         * runtime/UString.cpp:
3489         (JSC::UString::from): Added -0 special case mentioned above.
3490         Removed appendNumeric because it's mutually exclusive with the
3491         cache.
3492
3493 2009-08-20  Oliver Hunt  <oliver@apple.com>
3494
3495         Reviewed by Gavin Barraclough.
3496
3497         REGRESSION: fast/profiler/call.html is crashing occasionally
3498         https://bugs.webkit.org/show_bug.cgi?id=28476
3499
3500         Using the codeblock for information about how many parameters and
3501         locals a function has is unsafe in certain circumstances.  The
3502         basic scenario is all function code being cleared in response to
3503         the debugger or profiler being enabled, and then an activation is
3504         marked before its associated function is re-executed.
3505
3506         To deal with this scenario we store the variable count of a function
3507         directly in the FunctionExecutable, and then use that information.
3508
3509         * runtime/Arguments.h:
3510         (JSC::Arguments::getArgumentsData):
3511         * runtime/Executable.cpp:
3512         (JSC::FunctionExecutable::generateBytecode):
3513         * runtime/Executable.h:
3514         (JSC::FunctionExecutable::FunctionExecutable):
3515         (JSC::FunctionExecutable::variableCount):
3516         * runtime/JSActivation.cpp:
3517         (JSC::JSActivation::markChildren):
3518
3519 2009-08-20  Gavin Barraclough  <barraclough@apple.com>
3520
3521         Reviewed by Oliver Hunt.
3522
3523         Numbering of arguments to emitGetJITStubArg/emitPutJITStubArg incorrect
3524         <bug lost in the great bug disasteroony of 08/20/09!>
3525
3526         The argumentNumber argument to emitGetJITStubArg/emitPutJITStubArg should match
3527         the argument number used within the stub functions in JITStubs.cpp, but it doesn't.
3528
3529         Firstly, all the numbers changed when we added a void* 'reserved' as the first slot
3530         (rather than leaving argument 0 unused), and secondly in 32_64 builds the index to
3531         peek/poke needs to be multiplies by 2 (since the argument to peek/poke is a number
3532         of machine words, and on 32_64 build the argument slots to stub functions are two
3533         words wide).
3534
3535         * jit/JIT.h:
3536         * jit/JITCall.cpp:
3537         (JSC::JIT::compileOpCallSetupArgs):
3538         (JSC::JIT::compileOpConstructSetupArgs):
3539         (JSC::JIT::compileOpCallVarargsSetupArgs):
3540         (JSC::JIT::compileOpCall):
3541         * jit/JITInlineMethods.h:
3542         (JSC::JIT::emitPutJITStubArg):
3543         (JSC::JIT::emitPutJITStubArgConstant):
3544         (JSC::JIT::emitGetJITStubArg):
3545         (JSC::JIT::emitPutJITStubArgFromVirtualRegister):
3546         * jit/JITOpcodes.cpp:
3547         (JSC::JIT::privateCompileCTIMachineTrampolines):
3548         * jit/JITPropertyAccess.cpp:
3549         (JSC::JIT::privateCompilePutByIdTransition):
3550
3551 2009-08-20  Oliver Hunt  <oliver@apple.com>
3552
3553         Reviewed by Geoff Garen.
3554
3555         REGRESSION: significant slowdown on Celtic Kane "AJAX declaration" subtest
3556         https://bugs.webkit.org/show_bug.cgi?id=28332
3557
3558         Follow up style fixes that were missed in review.
3559
3560         * runtime/Structure.cpp:
3561         (JSC::Structure::hasTransition):
3562         * runtime/Structure.h:
3563         (JSC::Structure::get):
3564         (JSC::StructureTransitionTable::contains):
3565         * runtime/StructureTransitionTable.h:
3566         (JSC::StructureTransitionTable::add):
3567
3568 2009-08-20  Oliver Hunt  <oliver@apple.com>
3569
3570         Add new exports to windows jsc build
3571
3572         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3573         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
3574
3575 2009-08-20  Oliver Hunt  <oliver@apple.com>
3576
3577         Reviewed by Gavin Barraclough.
3578
3579         REGRESSION: significant slowdown on Celtic Kane "AJAX declaration" subtest
3580         https://bugs.webkit.org/show_bug.cgi?id=28332
3581
3582         The method check optimisation made transitions aware of the value being
3583         assigned when a transition was assigning a function.  This had the side
3584         effect of making every assignment of a function expression result in a
3585         new transition, and thus a new Structure.  The net result of this is that
3586         the common JS idiom of
3587
3588             function MyObject() {
3589                 this.myFunction = function(...){...};
3590             }
3591             new MyObject();
3592
3593         Will produce a unique structure on every iteration, meaning that all
3594         caching is defeated and there is a significant amount of structure churn.
3595
3596         The fix is to return the transition to its original form where it is
3597         keyed off a property name + attributes tuple, but have each transition
3598         support an optional transition on a specific value.
3599
3600         * JavaScriptCore.exp:
3601         * runtime/JSObject.h:
3602         (JSC::JSObject::putDirectInternal):
3603         * runtime/Structure.cpp:
3604         (JSC::Structure::~Structure):
3605         (JSC::Structure::addPropertyTransitionToExistingStructure):
3606         (JSC::Structure::addPropertyTransition):
3607         (JSC::Structure::hasTransition):
3608         * runtime/Structure.h:
3609         (JSC::Structure::transitionedFor):
3610         (JSC::Structure::hasTransition):
3611         (JSC::Structure::):
3612         (JSC::StructureTransitionTable::contains):
3613         (JSC::StructureTransitionTable::get):
3614         * runtime/StructureTransitionTable.h:
3615         (JSC::StructureTransitionTableHashTraits::emptyValue):
3616         (JSC::StructureTransitionTable::hasTransition):
3617         (JSC::StructureTransitionTable::remove):
3618         (JSC::StructureTransitionTable::add):
3619
3620 2009-08-20  Gavin Barraclough  <barraclough@apple.com>
3621
3622         Reviewed by Oliver Hunt.
3623
3624         Remove FunctionCodeBlock.
3625         https://bugs.webkit.org/show_bug.cgi?id=28502
3626
3627         These only exist to allow JIT code to dereference properties off the
3628         CodeBlock for any callee, regardless of whether it is a host function.
3629
3630         Instead just use the FunctionExecutable.  Copy the m_parameters field
3631         from the CodeBlock into the Executable, and use this to distinguish
3632         between host functions, functions that have been bytecompiled, and
3633         functions that have not.
3634
3635         m_parameters is moved to ExecutableBase rather than FunctionExecutable
3636         so that (as a separate change) we can move make a separate class of
3637         executable for host code, which is not devived from FunctionExecutable
3638         (host code does not feature any of the properties that normal executable
3639         do and will provide, such as source, attributes, and a parsed name).
3640
3641         1% win on v8 tests, 0.5% on sunspider.
3642
3643         * bytecode/CodeBlock.cpp:
3644         (JSC::CodeBlock::derefStructures):
3645         (JSC::CodeBlock::refStructures):
3646         (JSC::CodeBlock::reparseForExceptionInfoIfNecessary):
3647         (JSC::CodeBlock::handlerForBytecodeOffset):
3648         (JSC::CodeBlock::lineNumberForBytecodeOffset):
3649         (JSC::CodeBlock::expressionRangeForBytecodeOffset):
3650         (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset):
3651         (JSC::CodeBlock::functionRegisterForBytecodeOffset):
3652         (JSC::CodeBlock::hasGlobalResolveInstructionAtBytecodeOffset):
3653         (JSC::CodeBlock::hasGlobalResolveInfoAtBytecodeOffset):
3654         * bytecode/CodeBlock.h:
3655         (JSC::):
3656         (JSC::CodeBlock::source):
3657         (JSC::CodeBlock::sourceOffset):
3658         (JSC::CodeBlock::evalCodeCache):
3659         (JSC::CodeBlock::createRareDataIfNecessary):
3660         
3661             remove NativeCodeBlocks and the NativeCode code type.
3662         
3663         * jit/JIT.cpp:
3664         (JSC::JIT::linkCall):
3665
3666             Revert to previous behaviour (as currently still commented!) that Hhost functions have a null codeblock.
3667
3668         * jit/JITCall.cpp:
3669         (JSC::JIT::compileOpCallInitializeCallFrame):
3670         (JSC::JIT::compileOpCallSetupArgs):
3671         (JSC::JIT::compileOpCallVarargsSetupArgs):
3672         (JSC::JIT::compileOpConstructSetupArgs):
3673         (JSC::JIT::compileOpCallVarargs):
3674         (JSC::JIT::compileOpCall):
3675         (JSC::JIT::compileOpCallSlowCase):
3676
3677             Bring the 32_64 & non-32_64 JITs into line with each other, callee in regT0.
3678
3679         * jit/JITOpcodes.cpp:
3680         (JSC::JIT::privateCompileCTIMachineTrampolines):
3681
3682             Rewrite call trampolines to not use the CodeBlock.
3683
3684         * jit/JITStubs.cpp:
3685         (JSC::DEFINE_STUB_FUNCTION):
3686
3687             Make call_JSFunction & call_arityCheck return the callee, don't expect to be passed the CodeBlock.
3688
3689         * runtime/Executable.cpp:
3690         (JSC::FunctionExecutable::generateBytecode):
3691         (JSC::FunctionExecutable::recompile):
3692         (JSC::FunctionExecutable::FunctionExecutable):
3693         * runtime/Executable.h:
3694         (JSC::ExecutableBase::):
3695         (JSC::ExecutableBase::ExecutableBase):
3696         (JSC::FunctionExecutable::isHostFunction):
3697
3698             Add m_numParameters.
3699
3700         * runtime/JSFunction.cpp:
3701         (JSC::JSFunction::~JSFunction):
3702
3703             Only call generatedBytecode() on JSFunctions non-host FunctionExecutables.
3704
3705 2009-08-20  Yongjun Zhang  <yongjun.zhang@nokia.com>
3706
3707         Reviewed by Eric Seidel.
3708
3709         https://bugs.webkit.org/show_bug.cgi?id=28054
3710        
3711         Use a helper function to work around winscw compiler forward declaration bug
3712         regarding templated classes.
3713
3714         Add parenthesis around (PassRefPtr::*UnspecifiedBoolType) to make winscw compiler
3715         work with the default UnSpecifiedBoolType() operator, which removes the winscw
3716         specific bool cast hack.
3717
3718         * wtf/PassRefPtr.h:
3719         (WTF::derefIfNotNull):
3720         (WTF::PassRefPtr::~PassRefPtr):
3721
3722 2009-08-19  Yong Li  <yong.li@torchmobile.com>
3723
3724         Reviewed by Gavin Barraclough.
3725
3726         Change namespace ARM to ARMRegisters
3727         X86 to X86Registers to avoid conflict with macros
3728         https://bugs.webkit.org/show_bug.cgi?id=28428
3729
3730         * assembler/ARMAssembler.cpp:
3731         * assembler/ARMAssembler.h:
3732         * assembler/ARMv7Assembler.h:
3733         * assembler/MacroAssemblerARM.h:
3734         * assembler/MacroAssemblerARMv7.h:
3735         * assembler/MacroAssemblerX86Common.h:
3736         * assembler/MacroAssemblerX86_64.h:
3737         * assembler/X86Assembler.h:
3738         * jit/JIT.h:
3739         * jit/JITArithmetic.cpp:
3740         * jit/JITInlineMethods.h:
3741         * jit/JITOpcodes.cpp:
3742         * wrec/WRECGenerator.cpp:
3743         * wrec/WRECGenerator.h:
3744         * yarr/RegexJIT.cpp:
3745
3746 2009-08-19  Oliver Hunt  <oliver@apple.com>
3747
3748         Reviewed by Gavin Barraclough.
3749
3750         Devirtualise marking
3751         https://bugs.webkit.org/show_bug.cgi?id=28294
3752
3753         We actually need to mark the value in a number object if we're using the
3754         32bit number representation.
3755
3756         * runtime/NumberObject.h:
3757         (JSC::NumberObject::createStructure):
3758
3759 2009-08-19  Gavin Barraclough  <barraclough@apple.com>
3760
3761         Reviewed by Darin Adler.
3762
3763          We probably shouldn't be keeping the AST for eval nodes around forevar.
3764         https://bugs.webkit.org/show_bug.cgi?id=28469
3765
3766         EvalNodes don't destroyData() (delete their parser data) since they need to hold onto
3767         their varStack.  Copy a list of variable onto EvalCodeBlock, and this can go away.
3768
3769         * bytecode/CodeBlock.h:
3770         (JSC::EvalCodeBlock::variable):
3771         (JSC::EvalCodeBlock::numVariables):
3772         (JSC::EvalCodeBlock::adoptVariables):
3773         * bytecompiler/BytecodeGenerator.cpp:
3774         (JSC::BytecodeGenerator::BytecodeGenerator):
3775         * interpreter/Interpreter.cpp:
3776         (JSC::Interpreter::execute):
3777         * parser/Nodes.h:
3778         * runtime/Executable.cpp:
3779         (JSC::EvalExecutable::generateBytecode):
3780         * runtime/Executable.h:
3781
3782 2009-08-19  Jungshik Shin  <jshin@chromium.org>
3783
3784         Reviewed by Darin Adler.
3785
3786         http://bugs.webkit.org/show_bug.cgi?id=28441
3787
3788         Fix a build issue with ICU 4.2 or later on Windows with Visual C++. 
3789         Instead of defining all isXXX and toupper/tolower as 
3790           WTF_Please_use_ASCIICType_instead_of_ctype_see_comment_in_ASCIICType_h,
3791         #define them to be different by prepending 'WTF_...ASCIIType_h' with
3792         the originial names like 'toupper_WTF_...ASCIIType_h'. 
3793
3794         * wtf/DisallowCType.h:
3795
3796 2009-08-18  Oliver Hunt  <oliver@apple.com>
3797
3798         Reviewed by Gavin Barraclough.
3799
3800         Assigning a function to an object should always use the existing transition, even if the transition is not specialized
3801         https://bugs.webkit.org/show_bug.cgi?id=28442
3802
3803         Check for an unspecialized transition as an alternative to always failing if specialisation does not match.
3804
3805         * runtime/Structure.cpp:
3806         (JSC::Structure::addPropertyTransitionToExistingStructure):
3807
3808 2009-08-18  Dirk Schulze  <krit@webkit.org>
3809
3810         Reviewed by Oliver Hunt.
3811
3812         Added additional getter to ByteArray with an unsigned char as return.
3813         ByteArray can take unsigned char directly now.
3814
3815         * wtf/ByteArray.h:
3816         (WTF::ByteArray::set):
3817         (WTF::ByteArray::get):
3818
3819 2009-08-18  Peter Kasting  <pkasting@google.com>
3820
3821         Reviewed by Eric Seidel.
3822
3823         https://bugs.webkit.org/show_bug.cgi?id=28415
3824         Set svn:eol-style CRLF on all .sln and .vcproj files that don't already
3825         have it.
3826
3827         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj:
3828         * JavaScriptCore.vcproj/testapi/testapi.vcproj:
3829         
3830 2009-08-18  Xan Lopez  <xlopez@igalia.com>
3831
3832         Try to fix the GTK+ build.
3833
3834         * GNUmakefile.am:
3835
3836 2009-08-17  Gavin Barraclough  <barraclough@apple.com>
3837
3838         Reviewed by Sam Weinig.
3839
3840         No, silly runtime, AST nodes are not for you.
3841
3842         We still use AST nodes (ScopeNodes, particularly FunctionBodyNodes) within
3843         the runtime, which means that these nodes must be persisted outside of the
3844         arena, contain both parser & runtime data, etc.  This is all a bit of a mess.
3845
3846         Move functionality into a new FunctionExecutable class.
3847
3848         * API/JSCallbackFunction.cpp:
3849         * API/JSObjectRef.cpp:
3850         * JavaScriptCore.exp:
3851         * JavaScriptCore.xcodeproj/project.pbxproj:
3852         * bytecode/CodeBlock.cpp:
3853         (JSC::CodeBlock::CodeBlock):
3854         (JSC::CodeBlock::markAggregate):
3855         (JSC::CodeBlock::reparseForExceptionInfoIfNecessary):
3856         (JSC::CodeBlock::lineNumberForBytecodeOffset):
3857         (JSC::CodeBlock::shrinkToFit):
3858         * bytecode/CodeBlock.h:
3859         (JSC::CodeBlock::getBytecodeIndex):
3860         (JSC::CodeBlock::discardBytecode):
3861         (JSC::CodeBlock::instructionCount):
3862         (JSC::CodeBlock::getJITCode):
3863         (JSC::CodeBlock::executablePool):
3864         (JSC::CodeBlock::ownerExecutable):
3865         (JSC::CodeBlock::extractExceptionInfo):
3866         (JSC::CodeBlock::addFunctionDecl):
3867         (JSC::CodeBlock::functionDecl):
3868         (JSC::CodeBlock::numberOfFunctionDecls):
3869         (JSC::CodeBlock::addFunctionExpr):
3870         (JSC::CodeBlock::functionExpr):
3871         (JSC::GlobalCodeBlock::GlobalCodeBlock):
3872         (JSC::ProgramCodeBlock::ProgramCodeBlock):
3873         (JSC::EvalCodeBlock::EvalCodeBlock):
3874         (JSC::FunctionCodeBlock::FunctionCodeBlock):
3875         (JSC::NativeCodeBlock::NativeCodeBlock):
3876         * bytecode/EvalCodeCache.h:
3877         * bytecode/SamplingTool.cpp:
3878         (JSC::SamplingTool::doRun):
3879         * bytecompiler/BytecodeGenerator.cpp:
3880         (JSC::BytecodeGenerator::BytecodeGenerator):
3881         (JSC::BytecodeGenerator::emitNewFunction):
3882         (JSC::BytecodeGenerator::emitNewFunctionExpression):
3883         * bytecompiler/BytecodeGenerator.h:
3884         * debugger/Debugger.cpp:
3885         (JSC::Debugger::recompileAllJSFunctions):
3886         * interpreter/CachedCall.h:
3887         (JSC::CachedCall::CachedCall):
3888         * interpreter/CallFrameClosure.h:
3889         * interpreter/Interpreter.cpp:
3890         (JSC::Interpreter::unwindCallFrame):
3891         (JSC::Interpreter::throwException):
3892         (JSC::Interpreter::execute):
3893         (JSC::Interpreter::prepareForRepeatCall):
3894         (JSC::Interpreter::debug):
3895         (JSC::Interpreter::privateExecute):
3896         (JSC::Interpreter::retrieveLastCaller):
3897         * interpreter/Interpreter.h:
3898         * jit/JIT.cpp:
3899         (JSC::JIT::privateCompile):
3900         * jit/JIT.h:
3901         (JSC::JIT::compile):
3902         * jit/JITOpcodes.cpp:
3903         (JSC::JIT::privateCompileCTIMachineTrampolines):
3904         (JSC::JIT::emit_op_new_func):
3905         (JSC::JIT::emit_op_new_func_exp):
3906         * jit/JITStubs.cpp:
3907         (JSC::DEFINE_STUB_FUNCTION):
3908         * jit/JITStubs.h:
3909         (JSC::):
3910         * parser/Nodes.cpp:
3911         (JSC::FunctionBodyNode::reparseDataIfNecessary):
3912         * parser/Nodes.h:
3913         (JSC::EvalNode::partialDestroyData):
3914         * parser/Parser.h:
3915         * profiler/ProfileGenerator.cpp:
3916         * profiler/Profiler.cpp:
3917         (JSC::Profiler::createCallIdentifier):
3918         (JSC::createCallIdentifierFromFunctionImp):
3919         * runtime/Arguments.h:
3920         (JSC::Arguments::getArgumentsData):
3921         (JSC::Arguments::Arguments):
3922         (JSC::JSActivation::copyRegisters):
3923         * runtime/ArrayPrototype.cpp:
3924         (JSC::isNumericCompareFunction):
3925         * runtime/CallData.h:
3926         (JSC::):
3927         * runtime/Collector.cpp:
3928         (JSC::Heap::collect):
3929         * runtime/ConstructData.h:
3930         (JSC::):
3931         * runtime/ExceptionHelpers.cpp:
3932         (JSC::createUndefinedVariableError):
3933         (JSC::createInvalidParamError):
3934         (JSC::createNotAConstructorError):
3935         (JSC::createNotAFunctionError):
3936         (JSC::createNotAnObjectError):
3937         * runtime/Executable.cpp: Added.
3938         (JSC::EvalExecutable::generateBytecode):
3939         (JSC::ProgramExecutable::generateBytecode):
3940         (JSC::FunctionExecutable::generateBytecode):
3941         (JSC::EvalExecutable::generateJITCode):
3942         (JSC::ProgramExecutable::generateJITCode):
3943         (JSC::FunctionExecutable::generateJITCode):
3944         (JSC::FunctionExecutable::isHostFunction):
3945         (JSC::FunctionExecutable::markAggregate):
3946         (JSC::FunctionExecutable::reparseExceptionInfo):
3947         (JSC::EvalExecutable::reparseExceptionInfo):
3948         (JSC::FunctionExecutable::recompile):
3949         (JSC::FunctionExecutable::FunctionExecutable):
3950         * runtime/Executable.h:
3951         (JSC::ExecutableBase::~ExecutableBase):
3952         (JSC::ExecutableBase::ExecutableBase):
3953         (JSC::ExecutableBase::source):
3954         (JSC::ExecutableBase::sourceID):
3955         (JSC::ExecutableBase::lastLine):
3956         (JSC::ExecutableBase::usesEval):
3957         (JSC::ExecutableBase::usesArguments):
3958         (JSC::ExecutableBase::needsActivation):
3959         (JSC::ExecutableBase::astNode):
3960         (JSC::ExecutableBase::generatedJITCode):
3961         (JSC::ExecutableBase::getExecutablePool):
3962         (JSC::EvalExecutable::EvalExecutable):
3963         (JSC::EvalExecutable::bytecode):
3964         (JSC::EvalExecutable::varStack):
3965         (JSC::EvalExecutable::evalNode):
3966         (JSC::EvalExecutable::jitCode):
3967         (JSC::ProgramExecutable::ProgramExecutable):
3968         (JSC::ProgramExecutable::reparseExceptionInfo):
3969         (JSC::ProgramExecutable::bytecode):
3970         (JSC::ProgramExecutable::programNode):
3971         (JSC::ProgramExecutable::jitCode):
3972         (JSC::FunctionExecutable::FunctionExecutable):
3973         (JSC::FunctionExecutable::name):
3974         (JSC::FunctionExecutable::bytecode):
3975         (JSC::FunctionExecutable::generatedBytecode):
3976         (JSC::FunctionExecutable::usesEval):
3977         (JSC::FunctionExecutable::usesArguments):
3978         (JSC::FunctionExecutable::parameterCount):
3979         (JSC::FunctionExecutable::paramString):
3980         (JSC::FunctionExecutable::isGenerated):
3981         (JSC::FunctionExecutable::body):
3982         (JSC::FunctionExecutable::jitCode):
3983         (JSC::FunctionExecutable::createNativeThunk):
3984         * runtime/FunctionConstructor.cpp:
3985         (JSC::constructFunction):
3986         * runtime/FunctionPrototype.cpp:
3987         (JSC::functionProtoFuncToString):
3988         * runtime/JSActivation.cpp:
3989         (JSC::JSActivation::JSActivation):
3990         (JSC::JSActivation::markChildren):
3991         (JSC::JSActivation::isDynamicScope):
3992         (JSC::JSActivation::argumentsGetter):
3993         * runtime/JSActivation.h:
3994         (JSC::JSActivation::JSActivationData::JSActivationData):
3995         * runtime/JSFunction.cpp:
3996         (JSC::JSFunction::isHostFunction):
3997         (JSC::JSFunction::JSFunction):
3998         (JSC::JSFunction::~JSFunction):
3999         (JSC::JSFunction::markChildren):
4000         (JSC::JSFunction::getCallData):
4001         (JSC::JSFunction::call):
4002         (JSC::JSFunction::lengthGetter):
4003         (JSC::JSFunction::getConstructData):
4004         (JSC::JSFunction::construct):
4005         * runtime/JSFunction.h:
4006         (JSC::JSFunction::executable):
4007         (JSC::FunctionExecutable::make):
4008         * runtime/JSGlobalData.cpp:
4009         (JSC::JSGlobalData::JSGlobalData):
4010         (JSC::JSGlobalData::numericCompareFunction):
4011         * runtime/JSGlobalData.h:
4012
4013 2009-08-17  Mark Rowe  <mrowe@apple.com>
4014
4015         Reviewed by Darin Adler.
4016
4017         Fix 300,000+ leaks seen during the regression tests.
4018
4019         EvalCodeCache::get was heap-allocating an EvalExecutable instance without adopting the initial reference.
4020         While fixing this we noticed that EvalExecutable was a RefCounted type that was sometimes stack allocated.
4021         To make this cleaner and to prevent clients from attempting to ref a stack-allocated instance, we move the
4022         refcounting down to a new CacheableEvalExecutable class that derives from EvalExecutable. EvalCodeCache::get
4023         now uses CacheableEvalExecutable::create and avoids the leak.
4024
4025         * bytecode/EvalCodeCache.h:
4026         (JSC::EvalCodeCache::get):
4027         * interpreter/Interpreter.cpp:
4028         (JSC::Interpreter::callEval):
4029         * runtime/Executable.h:
4030         (JSC::CacheableEvalExecutable::create):
4031         (JSC::CacheableEvalExecutable::CacheableEvalExecutable):
4032
4033 2009-08-17  Oliver Hunt  <oliver@apple.com>
4034
4035         RS=Mark Rowe.
4036
4037         REGRESSION (r47292): Prototype.js is broken by ES5 Arguments changes
4038         https://bugs.webkit.org/show_bug.cgi?id=28341
4039         <rdar://problem/7145615>
4040
4041         Reverting r47292.  Alas Prototype.js breaks with Arguments inheriting
4042         from Array as ES5 attempted.  Prototype.js defines $A in terms of a 
4043         function it places on (among other global objects) the Array prototype,
4044         thus breaking $A for arrays.
4045
4046         * runtime/Arguments.h:
4047         (JSC::Arguments::Arguments):
4048         * runtime/JSGlobalObject.cpp:
4049         (JSC::JSGlobalObject::reset):
4050         (JSC::JSGlobalObject::markChildren):
4051         * runtime/JSGlobalObject.h:
4052         (JSC::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData):
4053         * runtime/ObjectPrototype.cpp:
4054         (JSC::ObjectPrototype::ObjectPrototype):
4055         * runtime/ObjectPrototype.h:
4056         * tests/mozilla/ecma_3/Function/arguments-001.js:
4057
4058 2009-08-17  Peter Kasting  <pkasting@google.com>
4059
4060         Reviewed by Steve Falkenburg.
4061
4062         https://bugs.webkit.org/show_bug.cgi?id=27323
4063         Only add Cygwin to the path when it isn't already there.  This avoids
4064         causing problems for people who purposefully have non-Cygwin versions of
4065         executables like svn in front of the Cygwin ones in their paths.
4066
4067         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
4068         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj:
4069         * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops:
4070         * JavaScriptCore.vcproj/jsc/jscCommon.vsprops:
4071         * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops:
4072
4073 2009-08-17  Xan Lopez  <xlopez@igalia.com>
4074
4075         Reviewed by Mark Rowe.
4076
4077         Fix build with FAST_MALLOC_MATCH_VALIDATION enabled.
4078
4079         * wtf/FastMalloc.cpp:
4080         (WTF::fastMalloc):
4081         (WTF::fastCalloc):
4082         (WTF::fastRealloc):
4083
4084 2009-08-16  Holger Hans Peter Freyther  <zecke@selfish.org>
4085
4086         Reviewed by Mark Rowe.
4087
4088         Fix crash on ./ecma_2/RegExp/exec-002.js.
4089         https://bugs.webkit.org/show_bug.cgi?id=28353
4090
4091         Change the order of freeParenthesesDisjunctionContext and
4092         popParenthesesDisjunctionContext on all call sites as the pop
4093         method is accessing backTrack->lastContext which is the context
4094         that is about to be freed.
4095
4096         * yarr/RegexInterpreter.cpp:
4097         (JSC::Yarr::Interpreter::parenthesesDoBacktrack):
4098         (JSC::Yarr::Interpreter::backtrackParentheses):
4099
4100 2009-08-16  Holger Hans Peter Freyther  <zecke@selfish.org>
4101
4102         Reviewed by Mark Rowe.
4103
4104         https://bugs.webkit.org/show_bug.cgi?id=28352
4105
4106         Fix coding style violations. Use m_ for C++ class members. Remove
4107         trailing whitespace on empty lines.
4108
4109         * yarr/RegexInterpreter.cpp:
4110         (JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::ParenthesesDisjunctionContext):
4111         (JSC::Yarr::Interpreter::tryConsumeCharacter):
4112         (JSC::Yarr::Interpreter::tryConsumeBackReference):
4113         (JSC::Yarr::Interpreter::parenthesesDoBacktrack):
4114         (JSC::Yarr::Interpreter::backtrackParentheses):
4115         (JSC::Yarr::ByteCompiler::ByteCompiler):
4116         (JSC::Yarr::ByteCompiler::compile):
4117         (JSC::Yarr::ByteCompiler::checkInput):
4118         (JSC::Yarr::ByteCompiler::assertionBOL):
4119         (JSC::Yarr::ByteCompiler::assertionEOL):
4120         (JSC::Yarr::ByteCompiler::assertionWordBoundary):
4121         (JSC::Yarr::ByteCompiler::atomPatternCharacter):
4122         (JSC::Yarr::ByteCompiler::atomCharacterClass):
4123         (JSC::Yarr::ByteCompiler::atomBackReference):
4124         (JSC::Yarr::ByteCompiler::atomParenthesesSubpatternBegin):
4125         (JSC::Yarr::ByteCompiler::atomParentheticalAssertionBegin):
4126         (JSC::Yarr::ByteCompiler::popParenthesesStack):
4127         (JSC::Yarr::ByteCompiler::closeAlternative):
4128         (JSC::Yarr::ByteCompiler::closeBodyAlternative):
4129         (JSC::Yarr::ByteCompiler::atomParenthesesEnd):
4130         (JSC::Yarr::ByteCompiler::regexBegin):
4131         (JSC::Yarr::ByteCompiler::alterantiveBodyDisjunction):
4132         (JSC::Yarr::ByteCompiler::alterantiveDisjunction):
4133         (JSC::Yarr::ByteCompiler::emitDisjunction):
4134
4135 2009-08-15  Mark Rowe  <mrowe@apple.com>
4136
4137         Fix the build with JIT disabled.
4138
4139         * runtime/Arguments.h: Only compile the jitCode method when the JIT is enabled.
4140         * runtime/Executable.h: Include PrototypeFunction.h so the compiler knows what
4141         NativeFunctionWrapper is when the JIT is disabled.
4142
4143 2009-08-15  Adam Bergkvist  <adam.bergkvist@ericsson.com>
4144
4145         Reviewed by Sam Weinig.
4146
4147         Added ENABLE_EVENTSOURCE flag.
4148         https://bugs.webkit.org/show_bug.cgi?id=14997
4149
4150         * Configurations/FeatureDefines.xcconfig:
4151
4152 2009-08-14  Gavin Barraclough  <barraclough@apple.com>
4153
4154         * parser/Parser.h:
4155         (JSC::EvalExecutable::parse):
4156         (JSC::ProgramExecutable::parse):
4157         * runtime/Executable.h:
4158
4159 2009-08-14  Gavin Barraclough  <barraclough@apple.com>
4160
4161         Reviewed by Oliver Hunt.
4162
4163         Remove AST nodes from use within the Runtime (outside of parsing), stage 1
4164         https://bugs.webkit.org/show_bug.cgi?id=28330
4165
4166         Remove the EvalNode and ProgramNode from use in the runtime.  They still exist
4167         after this patch, but are hidden behind EvalExecutable and FunctionExecutable,
4168         and are also still reachable behind CodeBlock::m_ownerNode.
4169
4170         The next step will be to beat back FunctionBodyNode in the same fashion.
4171         Then remove the usage via CodeBlock, then only construct these nodes only on
4172         demand during bytecode generation.
4173
4174         * JavaScriptCore.xcodeproj/project.pbxproj:
4175         * bytecode/CodeBlock.h:
4176         (JSC::GlobalCodeBlock::GlobalCodeBlock):
4177         (JSC::GlobalCodeBlock::~GlobalCodeBlock):
4178         (JSC::ProgramCodeBlock::ProgramCodeBlock):
4179         (JSC::EvalCodeBlock::EvalCodeBlock):
4180         (JSC::FunctionCodeBlock::FunctionCodeBlock):
4181         (JSC::NativeCodeBlock::NativeCodeBlock):
4182         * bytecode/EvalCodeCache.h:
4183         (JSC::EvalCodeCache::get):
4184         * debugger/Debugger.cpp:
4185         (JSC::evaluateInGlobalCallFrame):
4186         * debugger/DebuggerCallFrame.cpp:
4187         (JSC::DebuggerCallFrame::evaluate):
4188         * interpreter/Interpreter.cpp:
4189         (JSC::Interpreter::callEval):
4190         (JSC::Interpreter::execute):
4191         * interpreter/Interpreter.h:
4192         * parser/Nodes.cpp:
4193         (JSC::FunctionBodyNode::createNativeThunk):
4194         (JSC::FunctionBodyNode::generateBytecode):
4195         (JSC::FunctionBodyNode::bytecodeForExceptionInfoReparse):
4196         * parser/Parser.h:
4197         (JSC::Parser::parse):
4198         (JSC::Parser::reparse):
4199         (JSC::Parser::parseFunctionFromGlobalCode):
4200         (JSC::::parse):
4201         * runtime/Completion.cpp:
4202         (JSC::checkSyntax):
4203         (JSC::evaluate):
4204         * runtime/Error.cpp:
4205         (JSC::throwError):
4206         * runtime/Error.h:
4207         * runtime/Executable.h: Added.
4208         (JSC::TemplateExecutable::TemplateExecutable):
4209         (JSC::TemplateExecutable::markAggregate):
4210         (JSC::TemplateExecutable::sourceURL):
4211         (JSC::TemplateExecutable::lineNo):
4212         (JSC::TemplateExecutable::bytecode):
4213         (JSC::TemplateExecutable::jitCode):
4214         (JSC::EvalExecutable::EvalExecutable):
4215         (JSC::ProgramExecutable::ProgramExecutable):
4216         * runtime/FunctionConstructor.cpp:
4217         (JSC::constructFunction):
4218         * runtime/FunctionConstructor.h:
4219         * runtime/JSGlobalData.cpp:
4220         (JSC::JSGlobalData::numericCompareFunction):
4221         * runtime/JSGlobalObject.cpp:
4222         (JSC::JSGlobalObject::~JSGlobalObject):
4223         (JSC::JSGlobalObject::markChildren):
4224         * runtime/JSGlobalObject.h:
4225         (JSC::JSGlobalObject::codeBlocks):
4226         * runtime/JSGlobalObjectFunctions.cpp:
4227         (JSC::globalFuncEval):
4228
4229 2009-08-14  Darin Adler  <darin@apple.com>
4230
4231         Reviewed by Sam Weinig.
4232
4233         Rename the confusing isObject(<class>) to inherits(<class>).
4234         It still works on non-objects, returning false.
4235
4236         * runtime/ArrayConstructor.cpp:
4237         (JSC::arrayConstructorIsArray): Removed unneeded isObject call
4238         and updated remaining isObject call to new name, inherits.
4239
4240         * runtime/JSCell.h: Renamed isObject(<class>) to inherits(<class>)
4241         but more importantly, made it non-virtual (it was already inline)
4242         so it is now as fast as JSObject::inherits was.
4243
4244         * runtime/JSObject.h: Removed inherits function since the one
4245         in the base class is fine as-is. Also made various JSCell functions
4246         that should not be called on JSObject uncallable by making them
4247         both private and not implemented.
4248         (JSC::JSCell::inherits): Updated name.
4249         (JSC::JSValue::inherits): Ditto.
4250
4251         * debugger/Debugger.cpp:
4252         (JSC::Debugger::recompileAllJSFunctions):
4253         * interpreter/Interpreter.cpp:
4254         (JSC::Interpreter::unwindCallFrame):
4255         * runtime/ArrayPrototype.cpp:
4256         (JSC::arrayProtoFuncToString):
4257         (JSC::arrayProtoFuncToLocaleString):
4258         (JSC::arrayProtoFuncConcat):
4259         * runtime/BooleanPrototype.cpp:
4260         (JSC::booleanProtoFuncToString):
4261         (JSC::booleanProtoFuncValueOf):
4262         * runtime/DateConstructor.cpp:
4263         (JSC::constructDate):
4264         * runtime/DatePrototype.cpp:
4265         (JSC::dateProtoFuncToString):
4266         (JSC::dateProtoFuncToUTCString):
4267         (JSC::dateProtoFuncToISOString):
4268         (JSC::dateProtoFuncToDateString):
4269         (JSC::dateProtoFuncToTimeString):
4270         (JSC::dateProtoFuncToLocaleString):
4271         (JSC::dateProtoFuncToLocaleDateString):
4272         (JSC::dateProtoFuncToLocaleTimeString):
4273         (JSC::dateProtoFuncGetTime):
4274         (JSC::dateProtoFuncGetFullYear):
4275         (JSC::dateProtoFuncGetUTCFullYear):
4276         (JSC::dateProtoFuncToGMTString):
4277         (JSC::dateProtoFuncGetMonth):
4278         (JSC::dateProtoFuncGetUTCMonth):
4279         (JSC::dateProtoFuncGetDate):
4280         (JSC::dateProtoFuncGetUTCDate):
4281         (JSC::dateProtoFuncGetDay):
4282         (JSC::dateProtoFuncGetUTCDay):
4283         (JSC::dateProtoFuncGetHours):
4284         (JSC::dateProtoFuncGetUTCHours):
4285         (JSC::dateProtoFuncGetMinutes):
4286         (JSC::dateProtoFuncGetUTCMinutes):
4287         (JSC::dateProtoFuncGetSeconds):
4288         (JSC::dateProtoFuncGetUTCSeconds):
4289         (JSC::dateProtoFuncGetMilliSeconds):
4290         (JSC::dateProtoFuncGetUTCMilliseconds):
4291         (JSC::dateProtoFuncGetTimezoneOffset):
4292         (JSC::dateProtoFuncSetTime):
4293         (JSC::setNewValueFromTimeArgs):
4294         (JSC::setNewValueFromDateArgs):
4295         (JSC::dateProtoFuncSetYear):
4296         (JSC::dateProtoFuncGetYear):
4297         * runtime/FunctionPrototype.cpp:
4298         (JSC::functionProtoFuncToString):
4299         * runtime/JSActivation.cpp:
4300         (JSC::JSActivation::argumentsGetter):
4301         * runtime/JSValue.h:
4302         * runtime/RegExpConstructor.cpp:
4303         (JSC::constructRegExp):
4304         * runtime/RegExpPrototype.cpp:
4305         (JSC::regExpProtoFuncTest):
4306         (JSC::regExpProtoFuncExec):
4307         (JSC::regExpProtoFuncCompile):
4308         (JSC::regExpProtoFuncToString):
4309         * runtime/ScopeChain.cpp:
4310         (JSC::ScopeChain::localDepth):
4311         * runtime/StringPrototype.cpp:
4312         (JSC::stringProtoFuncReplace):
4313         (JSC::stringProtoFuncToString):
4314         (JSC::stringProtoFuncMatch):
4315         (JSC::stringProtoFuncSearch):
4316         (JSC::stringProtoFuncSplit):
4317         Updated to new name, inherits, from old name, isObject.
4318
4319 2009-07-31  Harald Fernengel  <harald.fernengel@nokia.com>
4320
4321         Reviewed by Simon Hausmann.
4322
4323         Adding QNX as a platform. Currently only tested with Qt.
4324
4325         https://bugs.webkit.org/show_bug.cgi?id=27885
4326
4327         * JavaScriptCore/runtime/Collector.cpp: Added retrieving of stack base
4328           since QNX doesn't have the pthread _nt functions
4329         * JavaScriptCore/wtf/Platform.h: Added WTF_PLATFORM_QNX and corresponding
4330           defines
4331         * WebCore/bridge/npapi.h: Build fix for missing typedefs on QNX
4332
4333 2009-08-14  Gabor Loki  <loki@inf.u-szeged.hu>
4334
4335         Reviewed by Simon Hausmann.
4336
4337         Currently generic ARM and ARMv7 platforms work only with JSVALUE32
4338         https://bugs.webkit.org/show_bug.cgi?id=28300
4339
4340         * wtf/Platform.h:
4341
4342 2009-08-14  Gabor Loki  <loki@inf.u-szeged.hu>
4343
4344         Reviewed by Simon Hausmann.
4345
4346         Enable JIT on ARM for QT by default
4347         https://bugs.webkit.org/show_bug.cgi?id=28259
4348
4349         * wtf/Platform.h:
4350
4351 2009-08-14  Gabor Loki  <loki@inf.u-szeged.hu>
4352
4353         Reviewed by Simon Hausmann.
4354
4355         Enable YARR_JIT on ARM for QT by default
4356         https://bugs.webkit.org/show_bug.cgi?id=28259
4357
4358         * wtf/Platform.h:
4359
4360 2009-08-14  Oliver Hunt  <oliver@apple.com>
4361
4362         Reviewed by Gavin Barraclough.
4363
4364         [ES5] Arguments object should inherit from Array
4365         https://bugs.webkit.org/show_bug.cgi?id=28298
4366
4367         Make the Arguments object conform to the behaviour specified in ES5.
4368         The simple portion of this is to make Arguments use Array.prototype
4369         as its prototype rather than Object.prototype.
4370
4371         The spec then requires us to set instance.constructor to the pristine
4372         Object constructor, and instance.toString and instance.toLocaleString
4373         to the pristine versions from Object.prototype.  To do this we now 
4374         make the ObjectPrototype constructor return its toString and
4375         toLocaleString functions (similar to the call and apply functions
4376         from FunctionPrototype).
4377
4378         Oddly enough this reports itself as a slight win, but given the code
4379         isn't hit in the tests that claim to have improved I put this down to
4380         code motion.
4381
4382         * runtime/Arguments.h:
4383         (JSC::Arguments::Arguments):
4384         (JSC::Arguments::initializeStandardProperties):
4385         * runtime/JSGlobalObject.cpp:
4386         (JSC::JSGlobalObject::reset):
4387         (JSC::JSGlobalObject::markChildren):
4388         * runtime/JSGlobalObject.h:
4389         (JSC::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData):
4390         (JSC::JSGlobalObject::objectConstructor):
4391         (JSC::JSGlobalObject::objectToStringFunction):
4392         (JSC::JSGlobalObject::objectToLocaleStringFunction):
4393         * runtime/ObjectPrototype.cpp:
4394         (JSC::ObjectPrototype::ObjectPrototype):
4395         * runtime/ObjectPrototype.h:
4396         * tests/mozilla/ecma_3/Function/arguments-001.js:
4397           Update test to new es5 behaviour
4398
4399 2009-08-14  Oliver Hunt  <oliver@apple.com>
4400
4401         Remove MarkStack::drain from the JSC exports file
4402
4403         MarkStack::drain is now marked inline, the including it in the exports file
4404         produces an ld warning
4405
4406         * JavaScriptCore.exp:
4407
4408 2009-08-13  Sam Weinig  <sam@webkit.org>
4409
4410         Reviewed by Oliver Hunt.
4411
4412         Remove accidentally left in debugging statement.
4413
4414         * runtime/JSArray.h:
4415         (JSC::MarkStack::drain):
4416
4417 2009-08-13  Oliver Hunt  <oliver@apple.com>
4418
4419         Reviewed by Maciej Stachowiak.
4420
4421         [ES5] Implement Array.isArray
4422         https://bugs.webkit.org/show_bug.cgi?id=28296
4423
4424         Add support for Array.isArray to the Array constructor
4425
4426         * runtime/ArrayConstructor.cpp:
4427         (JSC::ArrayConstructor::ArrayConstructor):
4428         (JSC::arrayConstructorIsArray):
4429         * runtime/ArrayConstructor.h:
4430         * runtime/CommonIdentifiers.h:
4431         * runtime/JSArray.h:
4432         (JSC::MarkStack::drain):
4433         * runtime/JSGlobalObject.cpp:
4434         (JSC::JSGlobalObject::reset):
4435
4436 2009-08-13  Oliver Hunt  <oliver@apple.com>
4437
4438         Reviewed by NOBODY (Buildfix).
4439
4440         Attempt to fix windows build
4441
4442         * runtime/Collector.cpp:
4443
4444 2009-08-13  Oliver Hunt  <oliver@apple.com>
4445
4446         Reviewed by Maciej Stachowiak.
4447
4448         Devirtualise marking
4449         https://bugs.webkit.org/show_bug.cgi?id=28294
4450
4451         Add a bit to TypeInfo to indicate that an object uses the standard
4452         JSObject::markChildren method.  This allows us to devirtualise marking
4453         of most objects (though a branch is still needed).  We also add a branch
4454         to identify arrays thus devirtualising marking in that case as well.
4455
4456         In order to make the best use of this devirtualisation I've also reworked
4457         the MarkStack::drain() logic to make the iteration more efficient.
4458
4459         * API/JSCallbackConstructor.h:
4460         (JSC::JSCallbackConstructor::createStructure):
4461         * API/JSCallbackFunction.h:
4462         (JSC::JSCallbackFunction::createStructure):
4463         * JavaScriptCore.exp:
4464         * runtime/BooleanObject.h:
4465         (JSC::BooleanObject::createStructure):
4466         * runtime/FunctionPrototype.h:
4467         (JSC::FunctionPrototype::createStructure):
4468         * runtime/InternalFunction.h:
4469         (JSC::InternalFunction::createStructure):
4470         * runtime/JSAPIValueWrapper.h:
4471         (JSC::JSAPIValueWrapper::JSAPIValueWrapper):
4472         * runtime/JSArray.cpp:
4473         (JSC::JSArray::markChildren):
4474         * runtime/JSArray.h:
4475         (JSC::JSArray::markChildrenDirect):
4476         (JSC::MarkStack::drain):
4477         * runtime/JSByteArray.cpp:
4478         (JSC::JSByteArray::createStructure):
4479         * runtime/JSCell.h:
4480         (JSC::MarkStack::append):
4481         * runtime/JSGlobalData.cpp:
4482         (JSC::JSGlobalData::JSGlobalData):
4483         * runtime/JSNumberCell.h:
4484         (JSC::JSNumberCell::createStructure):
4485         * runtime/JSONObject.h:
4486         (JSC::JSONObject::createStructure):
4487         * runtime/JSObject.cpp:
4488         (JSC::JSObject::markChildren):
4489         * runtime/JSObject.h:
4490         (JSC::JSObject::markChildrenDirect):
4491         (JSC::JSObject::createStructure):
4492         * runtime/JSString.h:
4493         (JSC::JSString::createStructure):
4494         * runtime/JSType.h:
4495         (JSC::):
4496         * runtime/MarkStack.h:
4497         (JSC::MarkStack::MarkStack):
4498         (JSC::MarkStack::MarkSet::MarkSet):
4499         (JSC::MarkStack::MarkStackArray::last):
4500         * runtime/MathObject.h:
4501         (JSC::MathObject::createStructure):
4502         * runtime/NumberConstructor.h:
4503         (JSC::NumberConstructor::createStructure):
4504         * runtime/NumberObject.h:
4505         (JSC::NumberObject::createStructure):
4506         * runtime/RegExpConstructor.h:
4507         (JSC::RegExpConstructor::createStructure):
4508         * runtime/RegExpObject.h:
4509         (JSC::RegExpObject::createStructure):
4510         * runtime/StringObjectThatMasqueradesAsUndefined.h:
4511         (JSC::StringObjectThatMasqueradesAsUndefined::createStructure):
4512         * runtime/TypeInfo.h:
4513         (JSC::TypeInfo::hasDefaultMark):
4514
4515 2009-08-13  Darin Adler  <darin@apple.com>
4516
4517         Reviewed by Mark Rowe.
4518
4519         Some small bits of housekeeping.
4520
4521         * JavaScriptCore.xcodeproj/project.pbxproj: Make Parser.h
4522         project instead of private. Remove JSONObject.lut.h.
4523
4524         * assembler/ARMAssembler.h: Remove unneeded WTF prefix.
4525         * assembler/AssemblerBufferWithConstantPool.h: Ditto.
4526         * bytecompiler/BytecodeGenerator.h: Ditto.
4527
4528         * wtf/SegmentedVector.h: Add a "using" statement as we do
4529         with the other WTF headers.
4530
4531 2009-08-13  Darin Adler  <darin@apple.com>
4532
4533         Fix Tiger build.
4534
4535         * parser/Grammar.y: Use a template function so we can compile
4536         setStatementLocation even if it comes before YYLTYPE is defined.
4537
4538 2009-08-13  Darin Adler  <darin@apple.com>
4539
4540         Reviewed by George Staikos.
4541
4542         Too much use of void* in Grammar.y
4543         https://bugs.webkit.org/show_bug.cgi?id=28287
4544
4545         * parser/Grammar.y: Changed all the helper functions to
4546         take a JSGlobalData* instead of a void*. A couple formatting
4547         tweaks that I missed when breaking this into pieces.
4548
4549 2009-08-13  Darin Adler  <darin@apple.com>
4550
4551         Reviewed by George Staikos.
4552
4553         Another part of https://bugs.webkit.org/show_bug.cgi?id=28287
4554
4555         * parser/Grammar.y: Reduced and sorted includes. Tweaked comment
4556         format. Marked a few more functions inline.
4557
4558 2009-08-13  Darin Adler  <darin@apple.com>
4559
4560         Reviewed by George Staikos.
4561
4562         Another part of https://bugs.webkit.org/show_bug.cgi?id=28287
4563
4564         * parser/Grammar.y: Pass the number to the PropertyNode instead of
4565         first turning it into an Identifier.
4566
4567         * parser/NodeConstructors.h:
4568         (JSC::PropertyNode::PropertyNode): Add an overload that takes a double
4569         so the code to convert to a string can be here instead of Grammar.y.
4570         * parser/Nodes.h: Ditto.
4571
4572 2009-08-13  Darin Adler  <darin@apple.com>
4573
4574         Reviewed by George Staikos.
4575
4576         Another part of https://bugs.webkit.org/show_bug.cgi?id=28287
4577
4578         * parser/Grammar.y: Eliminate the DBG macro.
4579
4580 2009-08-13  Darin Adler  <darin@apple.com>
4581
4582         Reviewed by George Staikos.
4583
4584         Another part of https://bugs.webkit.org/show_bug.cgi?id=28287
4585
4586         * parser/Grammar.y: Eliminate the SET_EXCEPTION_LOCATION macro.
4587
4588 2009-08-13  Darin Adler  <darin@apple.com>
4589
4590         Reviewed by George Staikos.
4591
4592         George asked me to break the patch from
4593         https://bugs.webkit.org/show_bug.cgi?id=28287
4594         into smaller pieces and land it in stages.
4595
4596         * parser/Grammar.y: Eliminate the LEXER macro.
4597
4598 2009-08-13  Mark Rowe  <mrowe@apple.com>
4599
4600         Try some more to fix the Windows build.
4601
4602         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Export a new symbol.
4603         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: Ditto.
4604
4605 2009-08-13  Mark Rowe  <mrowe@apple.com>
4606
4607         Try and fix the Windows build.
4608
4609         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Export a new symbol.
4610         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: Ditto.
4611
4612 2009-08-13  Darin Adler  <darin@apple.com>
4613
4614         Reviewed by David Levin.
4615
4616         JavaScriptCore tweaks to get ready for the parser arena
4617         https://bugs.webkit.org/show_bug.cgi?id=28243
4618
4619         Eliminate dependencies on Nodes.h outside JavaScriptCore,
4620         and cut down on them inside JavaScriptCore.
4621
4622         Change regular expression parsing to use identifiers as
4623         with other strings we parse.
4624
4625         Fix a couple things that are needed to use const Identifier
4626         more, which will be part of the parser arena work.
4627
4628         * JavaScriptCore.exp: Resorted and updated.
4629
4630         * JavaScriptCore.xcodeproj/project.pbxproj: Changed
4631         CollectorHeapIterator.h to be project-internal.
4632
4633         * bytecompiler/BytecodeGenerator.cpp:
4634         (JSC::BytecodeGenerator::emitPushNewScope): Added const.
4635         * bytecompiler/BytecodeGenerator.h: Ditto.
4636
4637         * debugger/Debugger.cpp:
4638         (JSC::Debugger::recompileAllJSFunctions): Moved this function
4639         here from WebCore. Here is better since it uses so many internals.
4640         Removed unimportant optimization for the no listener case.
4641         * debugger/Debugger.h: Ditto. Also removed unneeded include
4642         and tweaked formatting and comments.
4643
4644         * debugger/DebuggerCallFrame.cpp:
4645         (JSC::DebuggerCallFrame::functionName): Call asFunction instead
4646         of doing the unchecked static_cast.
4647         (JSC::DebuggerCallFrame::calculatedFunctionName): Ditto.
4648
4649         * jit/JITStubs.cpp:
4650         (JSC::op_call_JSFunction): Call isHostFunction on the body rather
4651         than on the JSFunction.
4652         (JSC::vm_lazyLinkCall): Ditto.
4653         (JSC::op_construct_JSConstruct): Ditto.
4654
4655         * parser/Grammar.y: Changed callers to use new scanRegExp with
4656         out arguments instead of relying on state in the Lexer. And
4657         callers that just want to skip a regular expression to use
4658         skipRegExp.
4659
4660         * parser/Lexer.cpp:
4661         (JSC::Lexer::scanRegExp): Changed to use out arguments, and to
4662         add a prefix argument so we can add in the "=" character as needed.
4663         Also rewrote to streamline the logic a bit inspired by suggestions
4664         by David Levin.
4665         (JSC::Lexer::skipRegExp): Added. Version of the function above that
4666         does not actually put the regular expression into a string.
4667         (JSC::Lexer::clear): Removed code to clear m_pattern and m_flags.
4668         * parser/Lexer.h: Changed scanRegExp to have out arguments. Added
4669         skipRegExp. Eliminated pattern, flags, m_pattern, and m_flags.
4670
4671         * parser/NodeConstructors.h:
4672         (JSC::RegExpNode::RegExpNode): Changed to take const Identifier&.
4673         * parser/Nodes.cpp:
4674         (JSC::RegExpNode::emitBytecode): Changed since m_pattern and
4675         m_flags are now Identifier instead of UString.
4676         (JSC::FunctionBodyNode::make): Moved this function here instead
4677         of putting it in the JSFunction.h header.
4678         * parser/Nodes.h: Changed RegExpNode to use Identifier.
4679
4680         * profiler/Profiler.cpp:
4681         (JSC::Profiler::createCallIdentifier): Changed to use isHostFunction
4682         on the body instead of on the JSFunction object.
4683         * runtime/FunctionPrototype.cpp:
4684         (JSC::functionProtoFuncToString): Ditto.
4685
4686         * runtime/JSFunction.cpp:
4687         (JSC::JSFunction::isHostFunction): Moved here from header.
4688         (JSC::JSFunction::isHostFunctionNonInline): Added.
4689         (JSC::JSFunction::JSFunction): Removed unneeded initialization of
4690         m_body to 0.
4691         (JSC::JSFunction::setBody): Moved here from header.
4692
4693         * runtime/JSFunction.h: Removed unneeded includes. Moved private
4694         constructor down to the private section. Made virtual functions
4695         private. Removed unneeded overload of setBody and moved the body
4696         of the function into the .cpp file. Changed assertions to use
4697         the non-inline version of isHostFunction.
4698
4699         * runtime/PropertySlot.cpp:
4700         (JSC::PropertySlot::functionGetter): Use asFunction instead
4701         of doing the unchecked static_cast.
4702
4703         * wtf/SegmentedVector.h:
4704         (WTF::SegmentedVector::isEmpty): Added.
4705
4706 2009-08-13  Mark Rowe  <mrowe@apple.com>
4707
4708         Rubber-stamped by Darin Adler.
4709
4710         Use the version of operator new that takes a JSGlobalData when allocating FuncDeclNode and FuncExprNode
4711         from within the grammar to prevent these nodes from being leaked.
4712
4713         * parser/Grammar.y:
4714
4715 2009-08-13  Simon Hausmann  <simon.hausmann@nokia.com>
4716
4717         Reviewed by Ariya Hidayat.
4718
4719         Remove the special-case for Qt wrt JSVALUE_32 introduced in
4720         r46709. It must've been a dependency issue on the bot, as
4721         after a manual build all the tests pass on amd64 and ia32.
4722
4723         * wtf/Platform.h:
4724
4725 2009-08-12  Gabor Loki  <loki@inf.u-szeged.hu>
4726
4727         Reviewed by Gavin Barraclough.
4728
4729         Add optimize call and property access support for ARM JIT.
4730         https://bugs.webkit.org/show_bug.cgi?id=24986
4731
4732         For tightly coupled sequences the BEGIN_UNINTERRUPTED_SEQUENCE and
4733         END_UNINTERRUPTED_SEQUENCE macros have been introduced which ensure
4734         space for instructions and constants of the named sequence. This
4735         method is vital for those architecture which are using constant pool.
4736
4737         The 'latePatch' method - which was linked to JmpSrc - is replaced with
4738         a port specific solution (each calls are marked to place their address
4739         on the constant pool).
4740
4741         * assembler/ARMAssembler.cpp:
4742         (JSC::ARMAssembler::linkBranch):
4743         (JSC::ARMAssembler::executableCopy): Add extra align for constant pool.
4744         * assembler/ARMAssembler.h:
4745         (JSC::ARMAssembler::JmpSrc::JmpSrc):
4746         (JSC::ARMAssembler::sizeOfConstantPool):
4747         (JSC::ARMAssembler::jmp):
4748         (JSC::ARMAssembler::linkCall):
4749         * assembler/ARMv7Assembler.h:
4750         * assembler/AbstractMacroAssembler.h:
4751         * assembler/AssemblerBufferWithConstantPool.h:
4752         (JSC::AssemblerBufferWithConstantPool::flushIfNoSpaceFor): Fix the
4753         computation of the remaining space.
4754         * assembler/MacroAssemblerARM.h:
4755         (JSC::MacroAssemblerARM::branch32):
4756         (JSC::MacroAssemblerARM::nearCall):
4757         (JSC::MacroAssemblerARM::call):
4758         (JSC::MacroAssemblerARM::branchPtrWithPatch):
4759         (JSC::MacroAssemblerARM::ensureSpace):
4760         (JSC::MacroAssemblerARM::sizeOfConstantPool):
4761         (JSC::MacroAssemblerARM::prepareCall):
4762         * assembler/X86Assembler.h:
4763         * jit/JIT.h:
4764         * jit/JITCall.cpp:
4765         (JSC::JIT::compileOpCall):
4766         * jit/JITInlineMethods.h:
4767         (JSC::JIT::beginUninterruptedSequence):
4768         (JSC::JIT::endUninterruptedSequence):
4769         * jit/JITPropertyAccess.cpp:
4770         (JSC::JIT::emit_op_method_check):
4771         (JSC::JIT::compileGetByIdHotPath):
4772         (JSC::JIT::compileGetByIdSlowCase):
4773         (JSC::JIT::emit_op_put_by_id):
4774
4775 2009-08-12  Gavin Barraclough  <barraclough@apple.com>
4776
4777         Rubber Stamped by Dave Kilzer.
4778
4779         Disable WTF_USE_JSVALUE32_64 on iPhone for now (support not yet added for ARMv7).
4780
4781         * wtf/Platform.h:
4782
4783 2009-08-12  Gavin Barraclough  <barraclough@apple.com>
4784
4785         Reviewed by Maciej Stachoviak.
4786
4787         Ooops - moved code that had been accidentally added to op_new_func instead of
4788         op_new_func_exp, to where it shoulds be.
4789
4790         * interpreter/Interpreter.cpp:
4791         (JSC::Interpreter::privateExecute):
4792         * wtf/Platform.h:
4793
4794 2009-08-12  Ada Chan  <adachan@apple.com>
4795
4796         Added workaround for the limitation that VirtualFree with MEM_RELEASE
4797         can only accept the base address returned by VirtualAlloc when the region
4798         was reserved and it can only free the entire region, and not a part of it.
4799
4800         Reviewed by Oliver Hunt.
4801
4802         * runtime/MarkStack.h:
4803         (JSC::MarkStack::MarkStackArray::shrinkAllocation):
4804         * runtime/MarkStackWin.cpp:
4805         (JSC::MarkStack::releaseStack):
4806
4807 2009-08-12  Balazs Kelemen  <kelemen.balazs.3@stud.u-szeged.hu>
4808
4809         Reviewed by Ariya Hidayat.
4810
4811         Build fix: use std::numeric_limits<long long>::min() instead of LLONG_MIN
4812         since LLONG_MIN is not defined in standard c++.
4813
4814         * runtime/UString.cpp:
4815         (JSC::UString::from):
4816
4817 2009-08-12  Benjamin Otte  <otte@gnome.org>
4818
4819         Reviewed by Jan Alonzo.
4820
4821         Buildfix for Gtk platforms debug builds.
4822
4823         * GNUmakefile.am: Choose MarkStackPosix.cpp or MarkStackWin.cpp
4824         depending on platform.
4825
4826 2009-08-12  Simon Hausmann  <simon.hausmann@nokia.com>
4827
4828         Prospective build fix for Mac and 32-bit Windows.
4829
4830         * runtime/UString.cpp: Include wtf/StringExtras.h for snprintf.
4831         (JSC::UString::from): Use %lld instead of %I64d for snprintf
4832         on non-windows platforms.
4833
4834 2009-08-12  Prasanth Ullattil  <prasanth.ullattil@nokia.com>
4835
4836         Reviewed by Simon Hausmann.
4837
4838         Fix compile error on 64Bit Windows, when UString::from
4839         is called with an intptr_t.
4840
4841         Added new UString::From overload with long long parameter.
4842
4843         Thanks to Holger for the long long idea.
4844
4845         * runtime/UString.cpp:
4846         (JSC::UString::from):
4847         * runtime/UString.h:
4848
4849 2009-08-11  Oliver Hunt  <oliver@apple.com>
4850
4851         Reviewed by Mark Rowe.
4852
4853         Minor style fixes.
4854
4855         * runtime/UString.h:
4856         (JSC::UString::Rep::createEmptyBuffer):
4857         * wtf/FastMalloc.h:
4858         (WTF::TryMallocReturnValue::getValue):
4859
4860 2009-08-11  Oliver Hunt  <oliver@apple.com>
4861
4862         Reviewed by Gavin Barraclough.
4863
4864         Make it harder to misuse try* allocation routines
4865         https://bugs.webkit.org/show_bug.cgi?id=27469
4866
4867         Jump through a few hoops to make it much harder to accidentally
4868         miss null-checking of values returned by the try-* allocation
4869         routines.
4870
4871         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
4872         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
4873         * JavaScriptCore.xcodeproj/project.pbxproj:
4874         * runtime/JSArray.cpp:
4875         (JSC::JSArray::putSlowCase):
4876         (JSC::JSArray::increaseVectorLength):
4877         * runtime/StringPrototype.cpp:
4878         (JSC::stringProtoFuncFontsize):
4879         (JSC::stringProtoFuncLink):
4880         * runtime/UString.cpp:
4881         (JSC::allocChars):
4882         (JSC::reallocChars):
4883         (JSC::expandCapacity):
4884         (JSC::UString::Rep::reserveCapacity):
4885         (JSC::UString::expandPreCapacity):
4886         (JSC::createRep):
4887         (JSC::concatenate):
4888         (JSC::UString::spliceSubstringsWithSeparators):
4889         (JSC::UString::replaceRange):
4890         (JSC::UString::append):
4891         (JSC::UString::operator=):
4892         * runtime/UString.h:
4893         (JSC::UString::Rep::createEmptyBuffer):
4894         * wtf/FastMalloc.cpp:
4895         (WTF::tryFastZeroedMalloc):
4896         (WTF::tryFastMalloc):
4897         (WTF::tryFastCalloc):
4898         (WTF::tryFastRealloc):
4899         (WTF::TCMallocStats::tryFastMalloc):
4900         (WTF::TCMallocStats::tryFastCalloc):
4901         (WTF::TCMallocStats::tryFastRealloc):
4902         * wtf/FastMalloc.h:
4903         (WTF::TryMallocReturnValue::TryMallocReturnValue):
4904         (WTF::TryMallocReturnValue::~TryMallocReturnValue):
4905         (WTF::TryMallocReturnValue::operator PossiblyNull<T>):
4906         (WTF::TryMallocReturnValue::getValue):
4907         * wtf/Platform.h:
4908         * wtf/PossiblyNull.h: Added.
4909         (WTF::PossiblyNull::PossiblyNull):
4910         (WTF::PossiblyNull::~PossiblyNull):
4911         (WTF::::getValue):
4912
4913 2009-08-11  Gavin Barraclough  <barraclough@apple.com>
4914
4915         Reviewed by NOBODY (build fix part deux).
4916
4917         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
4918         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
4919
4920 2009-08-11  Gavin Barraclough  <barraclough@apple.com>
4921
4922         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
4923         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
4924
4925 2009-08-11  Gavin Barraclough  <barraclough@apple.com>
4926
4927         Reviewed by Oliver Hunt.
4928
4929         Restrict use of FuncDeclNode & FuncExprNode to the parser.
4930         https://bugs.webkit.org/show_bug.cgi?id=28209
4931
4932         These objects were also being referenced from the CodeBlock.  By changing this
4933         to just retain pointers to FunctionBodyNodes these classes can be restricted to
4934         use during parsing.
4935
4936         No performance impact (or sub-percent progression).
4937
4938         * JavaScriptCore.exp:
4939             Update symbols.
4940
4941         * bytecode/CodeBlock.cpp:
4942         (JSC::CodeBlock::mark):
4943         (JSC::CodeBlock::reparseForExceptionInfoIfNecessary):
4944         (JSC::CodeBlock::shrinkToFit):
4945         * bytecode/CodeBlock.h:
4946         (JSC::CodeBlock::addFunction):
4947         (JSC::CodeBlock::function):
4948             Unify m_functions & m_functionExpressions into a single Vector<RefPtr<FuncExprNode> >.
4949
4950         * bytecompiler/BytecodeGenerator.cpp:
4951         (JSC::BytecodeGenerator::BytecodeGenerator):
4952         (JSC::BytecodeGenerator::addConstant):
4953         (JSC::BytecodeGenerator::emitNewFunction):
4954         (JSC::BytecodeGenerator::emitNewFunctionExpression):
4955         * bytecompiler/BytecodeGenerator.h:
4956             FunctionStacks now contain FunctionBodyNodes not FuncDeclNodes.
4957
4958         * interpreter/Interpreter.cpp:
4959         (JSC::Interpreter::execute):
4960         (JSC::Interpreter::privateExecute):
4961             Update to reflect chnages in CodeBlock.
4962
4963         * jit/JITOpcodes.cpp:
4964         (JSC::JIT::emit_op_new_func_exp):
4965         * jit/JITStubs.cpp:
4966         (JSC::DEFINE_STUB_FUNCTION):
4967         * jit/JITStubs.h:
4968         (JSC::):
4969             Update to reflect chnages in CodeBlock.
4970
4971         * parser/Grammar.y:
4972             FunctionStacks now contain FunctionBodyNodes not FuncDeclNodes.
4973
4974         * parser/NodeConstructors.h:
4975         (JSC::FuncExprNode::FuncExprNode):
4976         (JSC::FuncDeclNode::FuncDeclNode):
4977         * parser/Nodes.cpp:
4978         (JSC::ScopeNodeData::mark):
4979         (JSC::FunctionBodyNode::finishParsing):
4980         * parser/Nodes.h:
4981         (JSC::FunctionBodyNode::ident):
4982             Move m_ident & make methods from FuncDeclNode & FuncExprNode to FunctionBodyNode.
4983
4984         * runtime/JSFunction.h:
4985         (JSC::FunctionBodyNode::make):
4986             Make this method inline (was FuncDeclNode::makeFunction).
4987
4988 2009-08-11  Oliver Hunt  <oliver@apple.com>
4989
4990         Reviewed by Gavin Barraclough.
4991
4992         Native JSON.stringify does not omit functions
4993         https://bugs.webkit.org/show_bug.cgi?id=28117
4994
4995         Objects that are callable should be treated as undefined when
4996         serialising to JSON.
4997
4998         * runtime/JSONObject.cpp:
4999         (JSC::Stringifier::appendStringifiedValue):
5000
5001 2009-08-11  Oliver Hunt  <oliver@apple.com>
5002
5003         Reviewed by Geoff Garen.
5004
5005         REGRESSION: Hang/crash in BytecodeGenerator::constRegisterFor loading simple page
5006         https://bugs.webkit.org/show_bug.cgi?id=28169
5007
5008         Handle the case where someone has attempted to shadow a property
5009         on the global object with a constant.
5010
5011         * bytecompiler/BytecodeGenerator.cpp:
5012         (JSC::BytecodeGenerator::constRegisterFor):
5013         * parser/Nodes.cpp:
5014         (JSC::ConstDeclNode::emitCodeSingle):
5015
5016 2009-08-11  John Gregg  <johnnyg@google.com>
5017
5018         Reviewed by Maciej Stachowiak.
5019
5020         Desktop Notifications API
5021         https://bugs.webkit.org/show_bug.cgi?id=25463
5022
5023         Adds ENABLE_NOTIFICATION flag.
5024
5025         * Configurations/FeatureDefines.xcconfig:
5026         * wtf/Platform.h:
5027
5028 2009-08-11  Maxime Simon  <simon.maxime@gmail.com>
5029
5030         Reviewed by Eric Seidel.
5031
5032         Modifications on JavaScriptCore to allow Haiku port.
5033         https://bugs.webkit.org/show_bug.cgi?id=28121
5034
5035         * runtime/Collector.cpp: Haiku doesn't have sys/mman.h, using OS.h instead.
5036         (JSC::currentThreadStackBase): Haiku uses its own threading system.
5037         * wtf/Platform.h: Defining all Haiku platform values.
5038         * wtf/haiku/MainThreadHaiku.cpp: Adding a missing header (NotImplemented.h).
5039
5040 2009-08-11  Jessie Berlin  <jberlin@apple.com>
5041
5042         Reviewed by Adam Roben.
5043
5044         Fix windows build.
5045
5046         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
5047
5048 2009-08-11  Csaba Osztrogonac  <oszi@inf.u-szeged.hu>
5049
5050         Reviewed by Tor Arne Vestbø.
5051
5052         Buildfix for Qt-win platforms.
5053
5054         * JavaScriptCore.pri: Choose MarkStackPosix.cpp or MarkStackWin.cpp depend on platform.
5055
5056 2009-08-10  Oliver Hunt  <oliver@apple.com>
5057
5058         Reviewed by NOBODY (And another build fix).
5059
5060         Add new exports for MSVC
5061
5062         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
5063         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
5064         * JavaScriptCore.xcodeproj/project.pbxproj:
5065
5066 2009-08-10  Oliver Hunt  <oliver@apple.com>
5067
5068         Reviewed by NOBODY (yet another build fix).
5069
5070         Remove obsolete entries from MSVC exports file
5071
5072         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
5073         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
5074
5075 2009-08-10  Oliver Hunt  <oliver@apple.com>
5076
5077         Add includes needed for non-allinonefile builds
5078
5079         * runtime/GetterSetter.h:
5080         * runtime/ScopeChain.h:
5081
5082 2009-08-10  Oliver Hunt  <oliver@apple.com>
5083
5084         Fix export file for last build fix
5085
5086         * JavaScriptCore.exp:
5087
5088 2009-08-10  Oliver Hunt  <oliver@apple.com>
5089
5090         Hoist page size initialization into platform specific code.
5091
5092         * jit/ExecutableAllocatorPosix.cpp:
5093         * jit/ExecutableAllocatorWin.cpp:
5094         * runtime/MarkStack.h:
5095         (JSC::MarkStack::pageSize):
5096         * runtime/MarkStackPosix.cpp:
5097         (JSC::MarkStack::initializePagesize):
5098         * runtime/MarkStackWin.cpp:
5099         (JSC::MarkStack::initializePagesize):
5100
5101 2009-08-07  Oliver Hunt  <oliver@apple.com>
5102
5103         Reviewed by Gavin Barraclough.
5104
5105         Stack overflow crash in JavaScript garbage collector mark pass
5106         https://bugs.webkit.org/show_bug.cgi?id=12216
5107
5108         Make the GC mark phase iterative by using an explicit mark stack.
5109         To do this marking any single object is performed in multiple stages
5110           * The object is appended to the MarkStack, this sets the marked
5111             bit for the object using the new markDirect() function, and then
5112             returns
5113           * When the MarkStack is drain()ed the object is popped off the stack
5114             and markChildren(MarkStack&) is called on the object to collect 
5115             all of its children.  drain() then repeats until the stack is empty.
5116
5117         Additionally I renamed a number of methods from 'mark' to 'markAggregate'
5118         in order to make it more clear that marking of those object was not
5119         going to result in an actual recursive mark.
5120
5121         * GNUmakefile.am
5122         * JavaScriptCore.exp:
5123         * JavaScriptCore.gypi:
5124         * JavaScriptCore.pri:
5125         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
5126         * JavaScriptCore.xcodeproj/project.pbxproj:
5127         * bytecode/CodeBlock.cpp:
5128         (JSC::CodeBlock::markAggregate):
5129         * bytecode/CodeBlock.h:
5130         * bytecode/EvalCodeCache.h:
5131         (JSC::EvalCodeCache::markAggregate):
5132         * debugger/DebuggerActivation.cpp:
5133         (JSC::DebuggerActivation::markChildren):
5134         * debugger/DebuggerActivation.h:
5135         * interpreter/Register.h:
5136         * interpreter/RegisterFile.h:
5137         (JSC::RegisterFile::markGlobals):
5138         (JSC::RegisterFile::markCallFrames):
5139         * parser/Nodes.cpp:
5140         (JSC::ScopeNodeData::markAggregate):
5141         (JSC::EvalNode::markAggregate):
5142         (JSC::FunctionBodyNode::markAggregate):
5143         * parser/Nodes.h:
5144         (JSC::ScopeNode::markAggregate):
5145         * runtime/ArgList.cpp:
5146         (JSC::MarkedArgumentBuffer::markLists):
5147         * runtime/ArgList.h:
5148         * runtime/Arguments.cpp:
5149         (JSC::Arguments::markChildren):
5150         * runtime/Arguments.h:
5151         * runtime/Collector.cpp:
5152         (JSC::Heap::markConservatively):
5153         (JSC::Heap::markCurrentThreadConservativelyInternal):
5154         (JSC::Heap::markCurrentThreadConservatively):
5155         (JSC::Heap::markOtherThreadConservatively):
5156         (JSC::Heap::markStackObjectsConservatively):
5157         (JSC::Heap::markProtectedObjects):
5158         (JSC::Heap::collect):
5159         * runtime/Collector.h:
5160         * runtime/GetterSetter.cpp:
5161         (JSC::GetterSetter::markChildren):
5162         * runtime/GetterSetter.h:
5163         (JSC::GetterSetter::GetterSetter):
5164         (JSC::GetterSetter::createStructure):
5165         * runtime/GlobalEvalFunction.cpp:
5166         (JSC::GlobalEvalFunction::markChildren):
5167         * runtime/GlobalEvalFunction.h:
5168         * runtime/JSActivation.cpp:
5169         (JSC::JSActivation::markChildren):
5170         * runtime/JSActivation.h:
5171         * runtime/JSArray.cpp:
5172         (JSC::JSArray::markChildren):
5173         * runtime/JSArray.h:
5174         * runtime/JSCell.h:
5175         (JSC::JSCell::markCellDirect):
5176         (JSC::JSCell::markChildren):
5177         (JSC::JSValue::markDirect):
5178         (JSC::JSValue::markChildren):
5179         (JSC::JSValue::hasChildren):
5180         (JSC::MarkStack::append):
5181         (JSC::MarkStack::drain):
5182         * runtime/JSFunction.cpp:
5183         (JSC::JSFunction::markChildren):
5184         * runtime/JSFunction.h:
5185         * runtime/JSGlobalData.cpp:
5186         (JSC::JSGlobalData::JSGlobalData):
5187         * runtime/JSGlobalData.h:
5188         * runtime/JSGlobalObject.cpp:
5189         (JSC::markIfNeeded):
5190         (JSC::JSGlobalObject::markChildren):
5191         * runtime/JSGlobalObject.h:
5192         * runtime/JSNotAnObject.cpp:
5193         (JSC::JSNotAnObject::markChildren):
5194         * runtime/JSNotAnObject.h:
5195         * runtime/JSONObject.cpp:
5196         (JSC::Stringifier::markAggregate):
5197         (JSC::JSONObject::markStringifiers):
5198         * runtime/JSONObject.h:
5199         * runtime/JSObject.cpp:
5200         (JSC::JSObject::markChildren):
5201         (JSC::JSObject::defineGetter):
5202         (JSC::JSObject::defineSetter):
5203         * runtime/JSObject.h:
5204         * runtime/JSPropertyNameIterator.cpp:
5205         (JSC::JSPropertyNameIterator::markChildren):
5206         * runtime/JSPropertyNameIterator.h:
5207         (JSC::JSPropertyNameIterator::createStructure):
5208         (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
5209         (JSC::JSPropertyNameIterator::create):
5210         * runtime/JSStaticScopeObject.cpp:
5211         (JSC::JSStaticScopeObject::markChildren):
5212         * runtime/JSStaticScopeObject.h:
5213         * runtime/JSType.h:
5214         (JSC::):
5215         * runtime/JSValue.h:
5216         * runtime/JSWrapperObject.cpp:
5217         (JSC::JSWrapperObject::markChildren):
5218         * runtime/JSWrapperObject.h:
5219         * runtime/MarkStack.cpp: Added.
5220         (JSC::MarkStack::compact):
5221         * runtime/MarkStack.h: Added.
5222         (JSC::):
5223         (JSC::MarkStack::MarkStack):
5224         (JSC::MarkStack::append):
5225         (JSC::MarkStack::appendValues):
5226         (JSC::MarkStack::~MarkStack):
5227         (JSC::MarkStack::MarkSet::MarkSet):
5228         (JSC::MarkStack::pageSize):
5229         
5230         MarkStackArray is a non-shrinking, mmap-based vector type
5231         used for storing objects to be marked.
5232         (JSC::MarkStack::MarkStackArray::MarkStackArray):
5233         (JSC::MarkStack::MarkStackArray::~MarkStackArray):
5234         (JSC::MarkStack::MarkStackArray::expand):
5235         (JSC::MarkStack::MarkStackArray::append):
5236         (JSC::MarkStack::MarkStackArray::removeLast):
5237         (JSC::MarkStack::MarkStackArray::isEmpty):
5238         (JSC::MarkStack::MarkStackArray::size):
5239         (JSC::MarkStack::MarkStackArray::shrinkAllocation):
5240         * runtime/MarkStackPosix.cpp: Added.
5241         (JSC::MarkStack::allocateStack):
5242         (JSC::MarkStack::releaseStack):
5243         * runtime/MarkStackWin.cpp: Added.
5244         (JSC::MarkStack::allocateStack):
5245         (JSC::MarkStack::releaseStack):
5246
5247         * runtime/ScopeChain.h:
5248         * runtime/ScopeChainMark.h:
5249         (JSC::ScopeChain::markAggregate):
5250         * runtime/SmallStrings.cpp:
5251         (JSC::SmallStrings::mark):
5252         * runtime/Structure.h:
5253         (JSC::Structure::markAggregate):
5254
5255 2009-08-10  Mark Rowe  <mrowe@apple.com>
5256         
5257         Reviewed by Darin Adler.
5258
5259         Fix hundreds of "pointer being freed was not allocated" errors seen on the build bot.
5260
5261         * wtf/FastMalloc.h: Implement nothrow variants of the delete and delete[] operators since
5262         we implement the nothrow variants of new and new[].  The nothrow variant of delete is called
5263         explicitly in the implementation of std::sort which was resulting in FastMalloc-allocated
5264         memory being passed to the system allocator to free.
5265
5266 2009-08-10  Jan Michael Alonzo  <jmalonzo@webkit.org>
5267
5268         [Gtk] Unreviewed build fix. Move JSAPIValueWrapper.cpp/.h in the debug
5269         section. This file is already part of AllInOneFile in Release builds.
5270
5271         * GNUmakefile.am:
5272
5273 2009-08-10  Darin Adler  <darin@apple.com>
5274
5275         * wtf/FastMalloc.h: Fix build.
5276
5277 2009-08-10  Darin Adler  <darin@apple.com>
5278
5279         Reviewed by Mark Rowe.
5280
5281         FastMalloc.h has cross-platform code but marked as WinCE-only
5282         https://bugs.webkit.org/show_bug.cgi?id=28160
5283
5284         1) The support for nothrow was inside #if PLATFORM(WINCE) even though it is
5285            not platform-specific.
5286         2) The code tried to override operator delete nothrow, which does not exist.
5287         3) The code in the header checks the value of USE_SYSTEM_MALLOC, but the code
5288            in FastMalloc.cpp checks only if the macro is defined.
5289
5290         * wtf/FastMalloc.h: See above.
5291         * wtf/FastMalloc.cpp: Ditto.
5292
5293 2009-08-10  Sam Weinig  <sam@webkit.org>
5294
5295         Reviewed by Anders Carlsson.
5296
5297         Fix an annoying indentation issue.
5298
5299         * runtime/DateConstructor.cpp:
5300         (JSC::constructDate):
5301
5302 2009-08-10  Xan Lopez  <xlopez@igalia.com>
5303
5304         Unreviewed build fix.
5305
5306         Add new files to makefile.
5307
5308         * GNUmakefile.am:
5309
5310 2009-08-10  Simon Hausmann  <simon.hausmann@nokia.com>
5311
5312         Fix compilation with the interpreter instead of the JIT by including
5313         PrototypeFunction.h as forward-declared through NativeFunctionWrapper.h.
5314
5315         * runtime/ObjectConstructor.cpp:
5316
5317 2009-08-09  Oliver Hunt  <oliver@apple.com>
5318
5319         Reviewed by George Staikos.
5320
5321         JSON.stringify replacer returning undefined does not omit object properties
5322         https://bugs.webkit.org/show_bug.cgi?id=28118
5323
5324         Correct behaviour of stringify when using a replacer function that returns
5325         undefined.  This is a simple change to move the undefined value check to
5326         after the replacer function is called.  This means that the replacer function
5327         is now called for properties with the value undefined, however i've confirmed
5328         that this behaviour is correct.
5329         
5330         In addition I've made the cyclic object exception have a more useful error
5331         message.
5332
5333         * runtime/JSONObject.cpp:
5334         (JSC::Stringifier::appendStringifiedValue):
5335
5336 2009-08-08  Oliver Hunt  <oliver@apple.com>
5337
5338         Reviewed by Eric Seidel and Sam Weinig.
5339
5340         [ES5] Implement Object.getPrototypeOf
5341         https://bugs.webkit.org/show_bug.cgi?id=28114
5342
5343         Implement getPrototypeOf
5344
5345         * runtime/CommonIdentifiers.h:
5346         * runtime/JSGlobalObject.cpp:
5347         (JSC::JSGlobalObject::reset):
5348         * runtime/ObjectConstructor.cpp:
5349         (JSC::ObjectConstructor::ObjectConstructor):
5350         (JSC::objectConsGetPrototypeOf):
5351         * runtime/ObjectConstructor.h:
5352
5353 2009-08-07  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
5354
5355         Reviewed by Eric Seidel.
5356
5357         Allow custom memory allocation control for Noncopyable class
5358         https://bugs.webkit.org/show_bug.cgi?id=27879
5359
5360         Several classes which are inherited from Noncopyable are instantiated by
5361         operator new, so Noncopyable class has been inherited from FastAllocBase.
5362
5363         * wtf/Noncopyable.h:
5364
5365 2009-08-07  George Staikos <george.staikos@torchmobile.com> 
5366
5367         Reviewed by Eric Seidel.
5368
5369         https://bugs.webkit.org/show_bug.cgi?id=27305
5370         Implement WinCE-specific unicode layer.
5371         Written by George Staikos <george.staikos@torchmobile.com>
5372         with bug fixes by Yong Li <yong.li@torchmobile.com>
5373         refactored by Joe Mason <joe.mason@torchmobile.com> 
5374
5375         * wtf/Platform.h:
5376         * wtf/unicode/Unicode.h:
5377         * wtf/unicode/wince/UnicodeWince.cpp: Added.
5378         (WTF::Unicode::toLower):
5379         (WTF::Unicode::toUpper):
5380         (WTF::Unicode::foldCase):
5381         (WTF::Unicode::isPrintableChar):
5382         (WTF::Unicode::isSpace):
5383         (WTF::Unicode::isLetter):
5384         (WTF::Unicode::isUpper):
5385         (WTF::Unicode::isLower):
5386         (WTF::Unicode::isDigit):
5387         (WTF::Unicode::isPunct):
5388         (WTF::Unicode::toTitleCase):
5389         (WTF::Unicode::direction):
5390         (WTF::Unicode::category):
5391         (WTF::Unicode::decompositionType):
5392         (WTF::Unicode::combiningClass):
5393         (WTF::Unicode::mirroredChar):
5394         (WTF::Unicode::digitValue):
5395         * wtf/unicode/wince/UnicodeWince.h: Added.
5396         (WTF::Unicode::):
5397         (WTF::Unicode::isSeparatorSpace):
5398         (WTF::Unicode::isHighSurrogate):
5399         (WTF::Unicode::isLowSurrogate):
5400         (WTF::Unicode::isArabicChar):
5401         (WTF::Unicode::hasLineBreakingPropertyComplexContext):
5402         (WTF::Unicode::umemcasecmp):
5403         (WTF::Unicode::surrogateToUcs4):
5404
5405 2009-08-07  Yongjun Zhang  <yongjun.zhang@nokia.com>
5406
5407         Reviewed by Eric Seidel.
5408
5409         https://bugs.webkit.org/show_bug.cgi?id=28069
5410
5411         Add inline to help winscw compiler resolve specialized argument in 
5412         templated functions.  
5413
5414         * runtime/LiteralParser.cpp:
5415         (JSC::LiteralParser::Lexer::lexString):
5416
5417 2009-08-07  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
5418
5419         Reviewed by Eric Seidel.
5420
5421         Allow custom memory allocation control for RegExpObjectData struct
5422         http://bugs.webkit.org/show_bug.cgi?id=26750
5423
5424         Inherits RegExpObjectData struct from FastAllocBase because
5425         it has been instantiated by 'new' in JavaScriptCore/runtime/RegExpObject.cpp:62
5426
5427         * runtime/RegExpObject.h:
5428
5429 2009-08-06  Norbert Leser  <norbert.leser@nokia.com>
5430
5431         Reviewed by Darin Adler.
5432
5433         Updated patch for bug #27059:
5434         Symbian platform always uses little endian encoding,
5435         regardless of compiler.
5436         We need to make sure that we correctly detect EABI architecture
5437         for armv5 targets on Symbian,
5438         where __EABI__ is set but not __ARM_EABI__
5439
5440         * wtf/Platform.h:
5441
5442 2009-08-06  Adam Barth  <abarth@webkit.org>
5443
5444         Unreviewed revert.
5445
5446         http://bugs.webkit.org/show_bug.cgi?id=27879
5447
5448         Revert 46877 because it broke GTK.
5449
5450         * wtf/Noncopyable.h:
5451
5452 2009-08-06  Gavin Barraclough  <barraclough@apple.com>
5453
5454         Reviewed by Oliver Hunt.
5455
5456         Make get_by_id/put_by_id/method_check/call defer optimization using a data flag rather than a code modification.
5457         ( https://bugs.webkit.org/show_bug.cgi?id=27635 )
5458
5459         This improves performance of ENABLE(ASSEMBLER_WX_EXCLUSIVE) builds by 2-2.5%, reducing the overhead to about 2.5%.
5460         (No performance impact with ASSEMBLER_WX_EXCLUSIVE disabled).
5461
5462         * bytecode/CodeBlock.cpp:
5463         (JSC::printStructureStubInfo):
5464             - Make StructureStubInfo store the type as an integer, rather than an OpcodeID.
5465
5466         * bytecode/CodeBlock.h:
5467         (JSC::):
5468         (JSC::CallLinkInfo::seenOnce):
5469         (JSC::CallLinkInfo::setSeen):
5470         (JSC::MethodCallLinkInfo::seenOnce):
5471         (JSC::MethodCallLinkInfo::setSeen):
5472             - Change a pointer in CallLinkInfo/MethodCallLinkInfo to use a PtrAndFlags, use a flag to track when an op has been executed once.
5473
5474         * bytecode/StructureStubInfo.cpp:
5475         (JSC::StructureStubInfo::deref):
5476             - Make StructureStubInfo store the type as an integer, rather than an OpcodeID.
5477
5478         * bytecode/StructureStubInfo.h:
5479         (JSC::StructureStubInfo::StructureStubInfo):
5480         (JSC::StructureStubInfo::initGetByIdSelf):
5481         (JSC::StructureStubInfo::initGetByIdProto):
5482         (JSC::StructureStubInfo::initGetByIdChain):
5483         (JSC::StructureStubInfo::initGetByIdSelfList):
5484         (JSC::StructureStubInfo::initGetByIdProtoList):
5485         (JSC::StructureStubInfo::initPutByIdTransition):
5486         (JSC::StructureStubInfo::initPutByIdReplace):
5487         (JSC::StructureStubInfo::seenOnce):
5488         (JSC::StructureStubInfo::setSeen):
5489             - Make StructureStubInfo store the type as an integer, rather than an OpcodeID, add a flag to track when an op has been executed once.
5490
5491         * bytecompiler/BytecodeGenerator.cpp:
5492         (JSC::BytecodeGenerator::emitGetById):
5493         (JSC::BytecodeGenerator::emitPutById):
5494             - Make StructureStubInfo store the type as an integer, rather than an OpcodeID.
5495
5496         * jit/JIT.cpp:
5497         (JSC::JIT::privateCompileCTIMachineTrampolines):
5498         (JSC::JIT::unlinkCall):
5499             - Remove the "don't lazy link" stage of calls.
5500
5501         * jit/JIT.h:
5502         (JSC::JIT::compileCTIMachineTrampolines):
5503             - Remove the "don't lazy link" stage of calls.
5504
5505         * jit/JITCall.cpp:
5506         (JSC::JIT::compileOpCallSlowCase):
5507             - Remove the "don't lazy link" stage of calls.
5508
5509         * jit/JITStubs.cpp:
5510         (JSC::JITThunks::JITThunks):
5511         (JSC::JITThunks::tryCachePutByID):
5512         (JSC::JITThunks::tryCacheGetByID):
5513         (JSC::JITStubs::DEFINE_STUB_FUNCTION):
5514         (JSC::JITStubs::getPolymorphicAccessStructureListSlot):
5515             - Remove the "don't lazy link" stage of calls, and the "_second" stage of get_by_id/put_by_id/method_check.
5516
5517         * jit/JITStubs.h:
5518         (JSC::JITThunks::ctiStringLengthTrampoline):
5519         (JSC::JITStubs::):
5520             - Remove the "don't lazy link" stage of calls, and the "_second" stage of get_by_id/put_by_id/method_check.
5521
5522         * wtf/PtrAndFlags.h:
5523         (WTF::PtrAndFlags::PtrAndFlags):
5524         (WTF::PtrAndFlags::operator!):
5525         (WTF::PtrAndFlags::operator->):
5526             - Add ! and -> operators, add constuctor with pointer argument.
5527
5528 2009-08-06  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
5529
5530         Reviewed by Adam Barth.
5531
5532         Allow custom memory allocation control for Noncopyable class
5533         https://bugs.webkit.org/show_bug.cgi?id=27879
5534
5535         Several classes which inherited from Noncopyable are instantiated by
5536         operator new, so Noncopyable class has been inherited from FastAllocBase.
5537
5538         * wtf/Noncopyable.h:
5539
5540 2009-08-06  Mark Rowe  <mrowe@apple.com>
5541
5542         Rubber-stamped by Sam Weinig.
5543
5544         Add explicit dependencies for our build verification scripts to ensure that they always run after linking has completed.
5545
5546         * JavaScriptCore.xcodeproj/project.pbxproj:
5547
5548 2009-08-06  Mark Rowe  <mrowe@apple.com>
5549
5550         Bring a little order to our otherwise out of control lives.
5551
5552         * JavaScriptCore.xcodeproj/project.pbxproj:
5553
5554 2009-08-06  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
5555
5556         Reviewed by Darin Adler.
5557
5558         Allow custom memory allocation control for JavaScriptCore's PolymorphicAccessStructureList struct
5559         https://bugs.webkit.org/show_bug.cgi?id=27877
5560
5561         Inherits PolymorphicAccessStructureList struct from FastAllocBase because it has been instantiated by
5562         'new' in JavaScriptCore/jit/JITStubs.cpp:1229.
5563
5564         * bytecode/Instruction.h:
5565
5566 2009-08-05  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
5567
5568         Reviewed by Darin Adler.
5569
5570         Allow custom memory allocation control for JavaScriptCore's ScopeNodeData struct
5571         https://bugs.webkit.org/show_bug.cgi?id=27875
5572
5573         Inherits ScopeNodeData struct from FastAllocBase because it has been instantiated by
5574         'new' in JavaScriptCore/parser/Nodes.cpp:1848.
5575
5576         * parser/Nodes.h:
5577
5578 2009-08-05  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
5579
5580         Reviewed by Gavin Barraclough.
5581
5582         Add floating point support for generic ARM port.
5583         https://bugs.webkit.org/show_bug.cgi?id=24986
5584
5585         * assembler/ARMAssembler.cpp:
5586         (JSC::ARMAssembler::doubleTransfer):
5587         * assembler/ARMAssembler.h:
5588         (JSC::ARM::):
5589         (JSC::ARMAssembler::):
5590         (JSC::ARMAssembler::faddd_r):
5591         (JSC::ARMAssembler::fsubd_r):
5592         (JSC::ARMAssembler::fmuld_r):
5593         (JSC::ARMAssembler::fcmpd_r):
5594         (JSC::ARMAssembler::fdtr_u):
5595         (JSC::ARMAssembler::fdtr_d):
5596         (JSC::ARMAssembler::fmsr_r):
5597         (JSC::ARMAssembler::fsitod_r):
5598         (JSC::ARMAssembler::fmstat):
5599         * assembler/MacroAssemblerARM.h:
5600         (JSC::MacroAssemblerARM::):
5601         (JSC::MacroAssemblerARM::supportsFloatingPoint):
5602         (JSC::MacroAssemblerARM::loadDouble):
5603         (JSC::MacroAssemblerARM::storeDouble):
5604         (JSC::MacroAssemblerARM::addDouble):
5605         (JSC::MacroAssemblerARM::subDouble):
5606         (JSC::MacroAssemblerARM::mulDouble):
5607         (JSC::MacroAssemblerARM::convertInt32ToDouble):
5608         (JSC::MacroAssemblerARM::branchDouble):
5609         * jit/JIT.h:
5610
5611 2009-08-05  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
5612
5613         Reviewed by Gavin Barraclough.
5614
5615         Add JIT support for generic ARM port without optimizations.
5616         https://bugs.webkit.org/show_bug.cgi?id=24986
5617
5618         All JIT optimizations are disabled.
5619
5620         Signed off by Zoltan Herczeg <zherczeg@inf.u-szeged.hu>
5621         Signed off by Gabor Loki <loki@inf.u-szeged.hu>
5622
5623         * assembler/ARMAssembler.cpp:
5624         (JSC::ARMAssembler::baseIndexTransfer32):
5625         * assembler/AbstractMacroAssembler.h:
5626         (JSC::AbstractMacroAssembler::Imm32::Imm32):
5627         * assembler/MacroAssemblerARM.h:
5628         (JSC::MacroAssemblerARM::store32):
5629         (JSC::MacroAssemblerARM::move):
5630         (JSC::MacroAssemblerARM::branch32):
5631         (JSC::MacroAssemblerARM::add32):
5632         (JSC::MacroAssemblerARM::sub32):
5633         (JSC::MacroAssemblerARM::load32):
5634         * bytecode/CodeBlock.h:
5635         (JSC::CodeBlock::getBytecodeIndex):
5636         * jit/JIT.h:
5637         * jit/JITInlineMethods.h:
5638         (JSC::JIT::restoreArgumentReference):
5639         * jit/JITOpcodes.cpp:
5640         * jit/JITStubs.cpp:
5641         * jit/JITStubs.h:
5642         (JSC::JITStackFrame::returnAddressSlot):
5643         * wtf/Platform.h:
5644
5645 2009-08-04  Gavin Barraclough  <barraclough@apple.com>
5646
5647         Rubber Stamped by Oiver Hunt.
5648
5649         Revert r46643 since this breaks the Yarr::Interpreter running the v8 tests.
5650         https://bugs.webkit.org/show_bug.cgi?id=27874
5651
5652         * yarr/RegexInterpreter.cpp:
5653         (JSC::Yarr::Interpreter::allocDisjunctionContext):
5654         (JSC::Yarr::Interpreter::freeDisjunctionContext):
5655         (JSC::Yarr::Interpreter::allocParenthesesDisjunctionContext):
5656         (JSC::Yarr::Interpreter::freeParenthesesDisjunctionContext):
5657
5658 2009-08-04  Oliver Hunt  <oliver@apple.com>
5659
5660         PPC64 Build fix
5661
5662         * wtf/Platform.h:
5663
5664 2009-08-04  Benjamin C Meyer  <benjamin.meyer@torchmobile.com>
5665
5666         Reviewed by Adam Treat
5667
5668         Explicitly include limits.h header when using INT_MAX and INT_MIN
5669
5670         * interpreter/Interpreter.cpp
5671
5672 2009-08-03  Harald Fernengel  <harald.fernengel@nokia.com>
5673
5674         Reviewed by Darin Adler.
5675
5676         Fix compile error for ambigous call to abs()
5677         https://bugs.webkit.org/show_bug.cgi?id=27873
5678
5679         Fix ambiguity in abs(long int) call by calling labs() instead
5680
5681         * wtf/DateMath.cpp: replace call to abs() with labs()
5682
5683 2009-08-03  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
5684
5685         Reviewed by Eric Seidel.
5686
5687         [Qt] Consolidate common gcc flags to WebKit.pri
5688         https://bugs.webkit.org/show_bug.cgi?id=27934
5689
5690         * JavaScriptCore.pro:
5691
5692 2009-08-03  Ada Chan  <adachan@apple.com>
5693
5694         Fixed the Tiger build.
5695
5696         * wtf/FastMalloc.cpp:
5697
5698 2009-08-03  Ada Chan  <adachan@apple.com>
5699
5700         Reviewed by Darin Adler.
5701
5702         Don't use background thread to scavenge memory on Tiger until we figure out why it causes a crash.
5703         https://bugs.webkit.org/show_bug.cgi?id=27900
5704
5705         * wtf/FastMalloc.cpp:
5706
5707 2009-08-03  Fumitoshi Ukai  <ukai@chromium.org>
5708
5709         Reviewed by Jan Alonzo.
5710
5711         Fix build break on Gtk/x86_64.
5712         https://bugs.webkit.org/show_bug.cgi?id=27936
5713
5714         Use JSVALUE64 for X86_64 LINUX, except Qt.
5715
5716         * wtf/Platform.h:
5717
5718 2009-08-02  Xan Lopez  <xlopez@igalia.com>
5719
5720         Fix the GTK+ build.
5721
5722         * wtf/Platform.h:
5723
5724 2009-08-02  Geoffrey Garen  <ggaren@apple.com>
5725
5726         Reviewed by Sam Weinig.
5727
5728         Disabled JSVALUE32_64 on Qt builds, since all layout tests mysteriously
5729         crash with it enabled.
5730
5731         * wtf/Platform.h:
5732
5733 2009-08-02  Geoffrey Garen  <ggaren@apple.com>
5734
5735         Qt build fix.
5736
5737         Added JSAPIValueWrapper.cpp to the build.
5738
5739         * JavaScriptCore.pri:
5740
5741 2009-08-02  Geoffrey Garen  <ggaren@apple.com>
5742
5743         Windows build fix.
5744
5745         Exported symbols for JSAPIValueWrapper.
5746
5747         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
5748         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
5749
5750 2009-08-02  Geoffrey Garen  <ggaren@apple.com>
5751
5752         GTK build fix.
5753
5754         * jit/JITStubs.cpp: #include <stdarg.h>, for a definition of va_start.
5755
5756 2009-08-02  Geoffrey Garen  <ggaren@apple.com>
5757
5758         Qt build fix.
5759         
5760         * runtime/Collector.cpp: #include <limits.h>, for a definition of ULONG_MAX.
5761
5762 2009-08-02  Geoffrey Garen  <ggaren@apple.com>
5763
5764         Windows build fix: Nixed JSImmediate::prototype, JSImmediate::toObject,
5765         and JSImmediate::toThisObject, and removed their exported symbols.
5766
5767         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
5768         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
5769         * runtime/JSImmediate.cpp:
5770         * runtime/JSImmediate.h:
5771
5772 2009-08-02  Geoffrey Garen  <ggaren@apple.com>
5773
5774         Reviewed by Mark Rowe.
5775
5776         Enabled JSVALUE32_64 by default on all platforms other than x86_64 (which uses JSVALUE64).
5777
5778         * wtf/Platform.h:
5779
5780 2009-08-02  Kevin Ollivier  <kevino@theolliviers.com>
5781
5782         Reviewed by Jan Alonzo.
5783
5784         Script for building the JavaScriptCore library for wx.
5785         https://bugs.webkit.org/show_bug.cgi?id=27619
5786
5787         * wscript: Added.
5788
5789 2009-08-02  Yong Li  <yong.li@torchmobile.com>
5790
5791         Reviewed by George Staikos.
5792
5793         DateMath depends on strftime and localtime, which need to be imported manually on WinCE
5794         https://bugs.webkit.org/show_bug.cgi?id=26558
5795
5796         * wtf/DateMath.cpp:
5797
5798 2009-08-01  David Kilzer  <ddkilzer@apple.com>
5799
5800         wtf/Threading.h: added include of Platform.h
5801
5802         Reviewed by Mark Rowe.
5803
5804         * wtf/Threading.h: Added #include "Platform.h" since this header
5805         uses PLATFORM() and other macros.
5806
5807 2009-08-01  Mark Rowe  <mrowe@apple.com>
5808
5809         Rubber-stamped by Oliver Hunt.
5810
5811         Roll out r46668 as it was misinformed.  ScopeChain is only used with placement new.
5812
5813         * runtime/ScopeChain.h:
5814
5815 2009-08-01  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
5816
5817         Allow custom memory allocation control for JavaScriptCore's HashMap class
5818         http://bugs.webkit.org/show_bug.cgi?id=27871
5819
5820         Inherits HashMap class from FastAllocBase because it has been
5821         instantiated by 'new' in JavaScriptCore/API/JSClassRef.cpp:148.
5822
5823         * wtf/RefPtrHashMap.h:
5824         (WTF::):
5825
5826 2009-08-01  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
5827
5828         Allow custom memory allocation control for JavaScriptCore's ScopeChain class
5829         https://bugs.webkit.org/show_bug.cgi?id=27834
5830
5831         Inherits ScopeChain class from FastAllocBase because it has been
5832         instantiated by 'new' in JavaScriptCore/runtime/JSFunction.h:109.
5833
5834         * runtime/ScopeChain.h:
5835
5836 2009-08-01  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
5837
5838         Reviewed by Darin Adler.
5839
5840         Allow custom memory allocation control for JavaScriptCore's RegExpConstructorPrivate struct 
5841         https://bugs.webkit.org/show_bug.cgi?id=27833
5842
5843         Inherits RegExpConstructorPrivate class from FastAllocBase because it has been
5844         instantiated by 'new' in JavaScriptCore/runtime/RegExpConstructor.cpp:152.
5845
5846         * runtime/RegExpConstructor.cpp:
5847
5848 2009-07-31  Yong Li  <yong.li@torchmobile.com>
5849
5850         Reviewed by George Staikos.
5851
5852         Resurrect the old GetTickCount implementation of currentTime, controlled by WTF_USE_QUERY_PERFORMANCE_COUNTER
5853         currentSystemTime taken from older WebKit; currentTime written by Yong Li <yong.li@torchmobile.com>; cleanup by Joe Mason <joe.mason@torchmobile.com>
5854         https://bugs.webkit.org/show_bug.cgi?id=27848
5855
5856         * wtf/CurrentTime.cpp:
5857         (WTF::currentSystemTime): get current time with GetCurrentFT
5858         (WTF::currentTime): track msec elapsed since first currentSystemTime call using GetTickCount
5859         * wtf/Platform.h:
5860
5861 2009-07-31  Ada Chan  <adachan@apple.com>
5862
5863         Fixes the Windows release-PGO build.
5864
5865         Reviewed by Jon Honeycutt.
5866
5867         * JavaScriptCore.vcproj/WTF/WTF.vcproj: Suppresses the warning about unreachable code that we get by adding "return 0" to WTF::TCMalloc_PageHeap::runScavengerThread().
5868         * wtf/FastMalloc.cpp:
5869         (WTF::TCMalloc_PageHeap::runScavengerThread): Fixes the error about the method not returning a value in the release-PGO build.
5870
5871 2009-07-31  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
5872
5873         Change malloc to fastMalloc and free to fastFree in Yarr's RegexInterpreter.cpp
5874         https://bugs.webkit.org/show_bug.cgi?id=27874
5875
5876         Use fastMalloc and fastFree instead of malloc and free in RegexInterpreter.cpp's methods.
5877
5878         * yarr/RegexInterpreter.cpp:
5879         (JSC::Yarr::Interpreter::allocDisjunctionContext):
5880         (JSC::Yarr::Interpreter::freeDisjunctionContext):
5881         (JSC::Yarr::Interpreter::allocParenthesesDisjunctionContext):
5882         (JSC::Yarr::Interpreter::freeParenthesesDisjunctionContext):
5883
5884 2009-07-30  Xan Lopez  <xlopez@igalia.com>
5885
5886         Reviewed by Jan Alonzo.
5887
5888         Fix compiler warning.
5889
5890         GCC does not like C++-style comments in preprocessor directives.
5891
5892         * wtf/Platform.h:
5893
5894 2009-07-30  John McCall  <rjmccall@apple.com>
5895
5896         Reviewed by Gavin Barraclough.
5897
5898         Optimize the X86_64 trampolines: avoid the need for filler arguments
5899         and move the stub-args area closer to the stack pointer.
5900
5901         * jit/JIT.h: adjust patch offsets because of slight code-size change 
5902         * jit/JITCode.h:
5903         (JSC::JITCode::execute): don't pass filler args
5904         * jit/JITStubs.cpp:
5905         (ctiTrampoline): (X86_64): push args onto stack, use args directly
5906         (ctiVMThrowTrampoline): (X86_64): adjust %rsp by correct displacement
5907         (ctiOpThrowNotCaught): (X86_64): adjust %rsp by correct displacement
5908         * jit/JITStubs.h:
5909         (JITStackFrame): (X86_64): move args area earlier
5910         (ctiTrampoline): remove filler args from prototype
5911
5912 2009-07-30  Gavin Barraclough  <barraclough@apple.com>
5913
5914         Temporarily revert r46618 since this is b0rking on Linux.
5915
5916 2009-07-23  Gavin Barraclough  <barraclough@apple.com>
5917
5918         Reviewed by Oliver Hunt.
5919
5920         Make get_by_id/put_by_id/method_check/call defer optimization using a data flag rather than a code modification.
5921         ( https://bugs.webkit.org/show_bug.cgi?id=27635 )
5922
5923         This improves performance of ENABLE(ASSEMBLER_WX_EXCLUSIVE) builds by 2-2.5%, reducing the overhead to about 2.5%.
5924         (No performance impact with ASSEMBLER_WX_EXCLUSIVE disabled).
5925
5926         * bytecode/CodeBlock.cpp:
5927         (JSC::printStructureStubInfo):
5928             - Make StructureStubInfo store the type as an integer, rather than an OpcodeID.
5929
5930         * bytecode/CodeBlock.h:
5931         (JSC::):
5932         (JSC::CallLinkInfo::seenOnce):
5933         (JSC::CallLinkInfo::setSeen):
5934         (JSC::MethodCallLinkInfo::seenOnce):
5935         (JSC::MethodCallLinkInfo::setSeen):
5936             - Change a pointer in CallLinkInfo/MethodCallLinkInfo to use a PtrAndFlags, use a flag to track when an op has been executed once.
5937
5938         * bytecode/StructureStubInfo.cpp:
5939         (JSC::StructureStubInfo::deref):
5940             - Make StructureStubInfo store the type as an integer, rather than an OpcodeID.
5941
5942         * bytecode/StructureStubInfo.h:
5943         (JSC::StructureStubInfo::StructureStubInfo):
5944         (JSC::StructureStubInfo::initGetByIdSelf):
5945         (JSC::StructureStubInfo::initGetByIdProto):
5946         (JSC::StructureStubInfo::initGetByIdChain):
5947         (JSC::StructureStubInfo::initGetByIdSelfList):
5948         (JSC::StructureStubInfo::initGetByIdProtoList):
5949         (JSC::StructureStubInfo::initPutByIdTransition):
5950         (JSC::StructureStubInfo::initPutByIdReplace):
5951         (JSC::StructureStubInfo::seenOnce):
5952         (JSC::StructureStubInfo::setSeen):
5953             - Make StructureStubInfo store the type as an integer, rather than an OpcodeID, add a flag to track when an op has been executed once.
5954
5955         * bytecompiler/BytecodeGenerator.cpp:
5956         (JSC::BytecodeGenerator::emitGetById):
5957         (JSC::BytecodeGenerator::emitPutById):
5958             - Make StructureStubInfo store the type as an integer, rather than an OpcodeID.
5959
5960         * jit/JIT.cpp:
5961         (JSC::JIT::privateCompileCTIMachineTrampolines):
5962         (JSC::JIT::unlinkCall):
5963             - Remove the "don't lazy link" stage of calls.
5964
5965         * jit/JIT.h:
5966         (JSC::JIT::compileCTIMachineTrampolines):
5967             - Remove the "don't lazy link" stage of calls.
5968
5969         * jit/JITCall.cpp:
5970         (JSC::JIT::compileOpCallSlowCase):
5971             - Remove the "don't lazy link" stage of calls.
5972
5973         * jit/JITStubs.cpp:
5974         (JSC::JITThunks::JITThunks):
5975         (JSC::JITThunks::tryCachePutByID):
5976         (JSC::JITThunks::tryCacheGetByID):
5977         (JSC::JITStubs::DEFINE_STUB_FUNCTION):
5978         (JSC::JITStubs::getPolymorphicAccessStructureListSlot):
5979             - Remove the "don't lazy link" stage of calls, and the "_second" stage of get_by_id/put_by_id/method_check.
5980
5981         * jit/JITStubs.h:
5982         (JSC::JITThunks::ctiStringLengthTrampoline):
5983         (JSC::JITStubs::):
5984             - Remove the "don't lazy link" stage of calls, and the "_second" stage of get_by_id/put_by_id/method_check.
5985
5986         * wtf/PtrAndFlags.h:
5987         (WTF::PtrAndFlags::PtrAndFlags):
5988         (WTF::PtrAndFlags::operator!):
5989         (WTF::PtrAndFlags::operator->):
5990             - Add ! and -> operators, add constuctor with pointer argument.
5991
5992 2009-07-30  Geoffrey Garen  <ggaren@apple.com>
5993
5994         Reviewed by Gavin Barraclough.
5995
5996         Fixed failing tests seen on Windows buildbot.
5997
5998         * jit/JITStubs.cpp:
5999         (JSC::DEFINE_STUB_FUNCTION):
6000         * jit/JITStubs.h:
6001         (JSC::): Use "int" instead of "bool" to guarantee a 32-bit result,
6002         regardless of compiler. gcc on mac uses 32-bit values for bool,
6003         but gcc on linux and MSVC on Windows use 8-bit values.
6004
6005 2009-07-30  Geoffrey Garen  <ggaren@apple.com>
6006
6007         Windows build fix: added missing symbols on Windows.
6008
6009         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
6010         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
6011
6012 2009-07-30  Geoffrey Garen  <ggaren@apple.com>
6013
6014         Windows build fix: removed stale symbols on Windows.
6015
6016         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
6017         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
6018
6019 === End merge of nitro-extreme branch 2009-07-30 ===
6020
6021 2009-07-20  Geoffrey Garen  <ggaren@apple.com>
6022
6023         Fixed a post-review typo in r46066 that caused tons of test failures.
6024         
6025         SunSpider reports no change.
6026
6027         * runtime/JSArray.cpp:
6028         (JSC::JSArray::JSArray): Initialize the full vector capacity, to avoid
6029         uninitialized members at the end.
6030
6031 2009-07-20  Geoffrey Garen  <ggaren@apple.com>
6032
6033         Windows WebKit build fix: Added some missing exports.
6034
6035         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
6036         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
6037
6038 2009-07-17  Geoffrey Garen  <ggaren@apple.com>
6039
6040         Reviewed by Sam Weinig.
6041
6042         Get the branch working on windows.
6043         https://bugs.webkit.org/show_bug.cgi?id=27391
6044         
6045         SunSpider says 0.3% faster.
6046
6047         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
6048         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: Updated
6049         MSVC export lists to fix linker errors.
6050
6051         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Added / removed
6052         new / old project files.
6053
6054         * jit/JIT.cpp:
6055         (JSC::JIT::privateCompileCTIMachineTrampolines): Used #pragma pack to tell
6056         MSVC that these structures represent actual memory layout, and should not be
6057         automatically aligned. Changed the return value load to load a 64bit quantity
6058         into the canonical registers.
6059
6060         * jit/JIT.h: Moved OBJECT_OFFSETOF definition to StdLibExtras.h because
6061         it's needed by more than just the JIT, and it supplements a standard library
6062         macro (offsetof).
6063
6064         * jit/JITCall.cpp:
6065         (JSC::JIT::compileOpCallInitializeCallFrame): Fixed an incorrectly signed
6066         cast to resolve an MSVC warning.
6067
6068         * jit/JITStubs.h: Used #pragma pack to tell MSVC that these structures
6069         represent actual memory layout, and should not be automatically aligned. 
6070
6071         * runtime/JSArray.cpp:
6072         (JSC::JSArray::JSArray): Replaced memset_pattern8 with a for loop, since
6073         memset_pattern8 is not portable. (I verified that this version of the loop
6074         gives the best performance / generated code in GCC.)
6075
6076         * runtime/JSObject.h:
6077         (JSC::JSObject::JSObject): Removed accidental usage of FIELD_OFFSET --
6078         OBJECT_OFFSETOF is our new macro name. (FIELD_OFFSET conflicts with a
6079         definition in winnt.h.)
6080
6081         * runtime/JSValue.cpp: Added some headers needed by non-all-in-one builds.
6082         
6083         * runtime/JSValue.h:
6084         (JSC::JSValue::): Made the tag signed, to match MSVC's signed enum values.
6085         (GCC doesn't seem to care one way or the other.)
6086
6087         * wtf/MainThread.cpp: Moved the StdLibExtras.h #include -- I did this a
6088         while ago to resolve a conflict with winnt.h. I can't remember if it's truly
6089         still needed, but what the heck.
6090
6091         * wtf/StdLibExtras.h: Moved OBJECT_OFFSETOF definition here.
6092
6093 2009-07-06  Geoffrey Garen  <ggaren@apple.com>
6094
6095         Reviewed by Sam Weinig (?).
6096         
6097         Fixed an assertion seen during the stress test.
6098         
6099         Don't assume that, if op1 is constant, op2 is not, and vice versa. Sadly,
6100         not all constants get folded.
6101
6102         * jit/JITArithmetic.cpp:
6103         (JSC::JIT::emit_op_jnless):
6104         (JSC::JIT::emitSlow_op_jnless):
6105         (JSC::JIT::emit_op_jnlesseq):
6106         (JSC::JIT::emitSlow_op_jnlesseq):
6107
6108 2009-07-06  Geoffrey Garen  <ggaren@apple.com>
6109
6110         Reviewed by Sam Weinig.
6111         
6112         Include op_convert_this in result caching.
6113         
6114         No change on SunSpider or v8.
6115
6116         * jit/JITOpcodes.cpp:
6117         (JSC::JIT::emit_op_convert_this):
6118
6119         * jit/JITStubs.cpp:
6120         (JSC::DEFINE_STUB_FUNCTION):
6121         * jit/JITStubs.h:
6122         (JSC::): Made the op_convert_this JIT stub return an EncodedJSValue, so
6123         to maintain the result caching contract that { tag, payload } can be
6124         found in { regT1, regT0 }.
6125
6126 2009-07-06  Geoffrey Garen  <ggaren@apple.com>
6127
6128         Reviewed by Sam Weinig.
6129         
6130         Implemented result chaining.
6131         
6132         1% faster on SunSpider. 4%-5% faster on v8.
6133
6134         * assembler/MacroAssemblerX86Common.h:
6135         (JSC::MacroAssemblerX86Common::move):
6136         * assembler/X86Assembler.h:
6137         (JSC::X86Assembler::movl_rr): Added an optimization to eliminate
6138         no-op mov instructions, to simplify chaining.
6139
6140         * jit/JIT.cpp:
6141         (JSC::JIT::JIT):
6142         * jit/JIT.h: Added data members and helper functions for recording
6143         chained results. We record both a mapping from virtual to machine register
6144         and the opcode for which the mapping is valid, to help ensure that the
6145         mapping isn't used after the mapped register has been stomped by other
6146         instructions.
6147
6148         * jit/JITCall.cpp:
6149         (JSC::JIT::compileOpCallVarargs):
6150         (JSC::JIT::compileOpCallVarargsSlowCase):
6151         (JSC::JIT::emit_op_ret):
6152         (JSC::JIT::emit_op_construct_verify):
6153         (JSC::JIT::compileOpCall):
6154         (JSC::JIT::compileOpCallSlowCase): Chain function call results.
6155
6156         * jit/JITInlineMethods.h:
6157         (JSC::JIT::emitLoadTag):
6158         (JSC::JIT::emitLoadPayload):
6159         (JSC::JIT::emitLoad):
6160         (JSC::JIT::emitLoad2):
6161         (JSC::JIT::isLabeled):
6162         (JSC::JIT::map):
6163         (JSC::JIT::unmap):
6164         (JSC::JIT::isMapped):
6165         (JSC::JIT::getMappedPayload):
6166         (JSC::JIT::getMappedTag): Use helper functions when loading virtual
6167         registers into machine registers, in case the loads can be eliminated
6168         by chaining.
6169
6170         * jit/JITOpcodes.cpp:
6171         (JSC::JIT::emit_op_mov):
6172         (JSC::JIT::emit_op_end):
6173         (JSC::JIT::emit_op_instanceof):
6174         (JSC::JIT::emit_op_get_global_var):
6175         (JSC::JIT::emit_op_put_global_var):
6176         (JSC::JIT::emit_op_get_scoped_var):
6177         (JSC::JIT::emit_op_put_scoped_var):
6178         (JSC::JIT::emit_op_to_primitive):
6179         (JSC::JIT::emit_op_resolve_global):
6180         (JSC::JIT::emit_op_jneq_ptr):
6181         (JSC::JIT::emit_op_next_pname):
6182         (JSC::JIT::emit_op_to_jsnumber):
6183         (JSC::JIT::emit_op_catch): Chain results from these opcodes.
6184
6185         (JSC::JIT::emit_op_profile_will_call):
6186         (JSC::JIT::emit_op_profile_did_call): Load the profiler into regT2 to
6187         avoid stomping a chained result.
6188
6189         * jit/JITPropertyAccess.cpp:
6190         (JSC::JIT::emit_op_method_check):
6191         (JSC::JIT::emit_op_get_by_val):
6192         (JSC::JIT::emit_op_get_by_id): Chain results from these opcodes.
6193
6194         * jit/JITStubCall.h:
6195         (JSC::JITStubCall::addArgument): Always use { regT1, regT0 }, to facilitate
6196         chaining.
6197
6198         (JSC::JITStubCall::call): Unmap all mapped registers, since our callee
6199         stub might stomp them.
6200
6201 2009-07-01  Sam Weinig  <sam@webkit.org>
6202
6203         Reviewed by Gavin Barraclough.
6204
6205         Don't reload values in emitBinaryDoubleOp.
6206
6207         SunSpider reports a 0.6% progression. 
6208
6209         * jit/JIT.h:
6210         * jit/JITArithmetic.cpp:
6211         (JSC::JIT::emit_op_jnless):
6212         (JSC::JIT::emit_op_jnlesseq):
6213         (JSC::JIT::emitBinaryDoubleOp):
6214
6215 2009-07-01  Sam Weinig  <sam@webkit.org>
6216
6217         Reviewed by Geoffrey Garen.
6218
6219         Convert op_div to load op1 and op2 up front.
6220
6221         * jit/JITArithmetic.cpp:
6222         (JSC::JIT::emit_op_div):
6223
6224 2009-07-01  Sam Weinig  <sam@webkit.org>
6225
6226         Reviewed by Geoffrey Garen.
6227
6228         Don't emit code in emitBinaryDoubleOp if code is unreachable, observable
6229         via an empty (unlinked) jumplist passed in.  This only effects op_jnless
6230         and op_jnlesseq at present.
6231
6232         * jit/JITArithmetic.cpp:
6233         (JSC::JIT::emitSlow_op_jnless):
6234         (JSC::JIT::emitSlow_op_jnlesseq):
6235         (JSC::JIT::emitBinaryDoubleOp):
6236
6237 2009-07-01  Geoffrey Garen  <ggaren@apple.com>
6238
6239         Reviewed by Sam Weinig.
6240
6241         Converted op_mod to put { tag, payload } in { regT1, regT0 }, and
6242         tidied up its constant case.
6243         
6244         SunSpider reports a 0.2% regression, but a micro-benchmark of op_mod
6245         shows a 12% speedup, and the SunSpider test that uses op_mod most should
6246         benefit a lot from result caching in the end, since it almost always
6247         performs (expression) % constant.
6248
6249         * jit/JITArithmetic.cpp:
6250         (JSC::JIT::emit_op_mod):
6251         (JSC::JIT::emitSlow_op_mod):
6252
6253 2009-06-30  Sam Weinig  <sam@webkit.org>
6254
6255         Reviewed by Geoffrey Garen.
6256
6257         Converted some more arithmetic ops to put { tag, payload } in
6258         { regT1, regT0 }.
6259
6260         * jit/JITArithmetic.cpp:
6261         (JSC::JIT::emit_op_mul):
6262         (JSC::JIT::emitSlow_op_mul):
6263
6264 2009-06-30  Geoffrey Garen  <ggaren@apple.com>
6265
6266         Reviewed by Sam Weinig.
6267
6268         Converted some more arithmetic ops to put { tag, payload } in
6269         { regT1, regT0 }, and added a case for subtract constant.
6270         
6271         SunSpider says no change. v8 says 0.3% slower.
6272
6273         * jit/JIT.h:
6274         * jit/JITArithmetic.cpp:
6275         (JSC::JIT::emit_op_add):
6276         (JSC::JIT::emitAdd32Constant):
6277         (JSC::JIT::emitSlow_op_add):
6278         (JSC::JIT::emit_op_sub):
6279         (JSC::JIT::emitSub32Constant):
6280         (JSC::JIT::emitSlow_op_sub):
6281
6282 2009-06-30  Gavin Barraclough  <barraclough@apple.com>
6283
6284         Reviewed by Sam Weinig.
6285
6286         Remove more uses of addressFor(), load double constants directly from
6287         the constantpool in the CodeBlock, rather than from the register file.
6288
6289         * jit/JITArithmetic.cpp:
6290         (JSC::JIT::emitAdd32Constant):
6291         (JSC::JIT::emitBinaryDoubleOp):
6292
6293 2009-06-30  Geoffrey Garen  <ggaren@apple.com>
6294
6295         Reviewed by Sam Weinig.
6296         
6297         Fixed a bug in postfix ops, where we would treat x = x++ and x = x--
6298         as a no-op, even if x were not an int, and the ++/-- could have side-effects.
6299
6300         * jit/JITArithmetic.cpp:
6301         (JSC::JIT::emit_op_post_inc):
6302         (JSC::JIT::emitSlow_op_post_inc):
6303         (JSC::JIT::emit_op_post_dec):
6304         (JSC::JIT::emitSlow_op_post_dec):
6305
6306 2009-06-30  Geoffrey Garen  <ggaren@apple.com>
6307
6308         Reviewed by Sam Weinig.
6309         
6310         Converted some arithmetic ops to put { tag, payload } in
6311         { regT1, regT0 }.
6312         
6313         SunSpider says 0.7% faster. v8 says no change.
6314
6315         * jit/JIT.h:
6316         * jit/JITArithmetic.cpp:
6317         (JSC::JIT::emit_op_jnless):
6318         (JSC::JIT::emit_op_jnlesseq):
6319         (JSC::JIT::emit_op_lshift):
6320         (JSC::JIT::emit_op_rshift):
6321         (JSC::JIT::emit_op_bitand):
6322         (JSC::JIT::emit_op_bitor):
6323         (JSC::JIT::emit_op_bitxor):
6324         * jit/JITInlineMethods.h:
6325         (JSC::JIT::isOperandConstantImmediateInt):
6326         (JSC::JIT::getOperandConstantImmediateInt):
6327
6328 2009-06-30  Gavin Barraclough  <barraclough@apple.com>
6329
6330         Reviewed by Sam Weinig.
6331
6332         Start removing cases of addressFor().
6333
6334         * jit/JIT.h:
6335         * jit/JITArithmetic.cpp:
6336         (JSC::JIT::emitAdd32Constant):
6337         (JSC::JIT::emitBinaryDoubleOp):
6338         (JSC::JIT::emit_op_div):
6339         * jit/JITInlineMethods.h:
6340         (JSC::JIT::emitLoadDouble):
6341         (JSC::JIT::emitLoadInt32ToDouble):
6342         (JSC::JIT::emitStoreDouble):
6343         * jit/JITOpcodes.cpp:
6344         (JSC::JIT::emit_op_jfalse):
6345         (JSC::JIT::emit_op_jtrue):
6346
6347 2009-06-30  Geoffrey Garen  <ggaren@apple.com>
6348
6349         Rolled back in my last patch with regression fixed.
6350
6351         * jit/JIT.cpp:
6352         (JSC::JIT::privateCompileSlowCases):
6353         * jit/JIT.h:
6354         * jit/JITOpcodes.cpp:
6355         (JSC::JIT::emit_op_loop_if_less):
6356         (JSC::JIT::emit_op_loop_if_lesseq):
6357         (JSC::JIT::emit_op_resolve_global):
6358         (JSC::JIT::emitSlow_op_resolve_global):
6359         (JSC::JIT::emit_op_eq):
6360         (JSC::JIT::emitSlow_op_eq):
6361         (JSC::JIT::emit_op_neq):
6362         (JSC::JIT::emitSlow_op_neq):
6363
6364 2009-06-30  Geoffrey Garen  <ggaren@apple.com>
6365
6366         Rolled out my last patch because it was a 2% SunSpider regression.
6367
6368         * jit/JIT.cpp:
6369         (JSC::JIT::privateCompileSlowCases):
6370         * jit/JIT.h:
6371         * jit/JITOpcodes.cpp:
6372         (JSC::JIT::emit_op_loop_if_less):
6373         (JSC::JIT::emit_op_loop_if_lesseq):
6374         (JSC::JIT::emit_op_resolve_global):
6375         (JSC::JIT::emit_op_eq):
6376         (JSC::JIT::emitSlow_op_eq):
6377         (JSC::JIT::emit_op_neq):
6378         (JSC::JIT::emitSlow_op_neq):
6379
6380 2009-06-30  Geoffrey Garen  <ggaren@apple.com>
6381
6382         Reviewed by Gavin "Sam Weinig" Barraclough.
6383         
6384         Standardized the rest of our opcodes to put { tag, payload } in
6385         { regT1, regT0 } where possible.
6386
6387         * jit/JIT.cpp:
6388         (JSC::JIT::privateCompileSlowCases):
6389         * jit/JIT.h:
6390         * jit/JITOpcodes.cpp:
6391         (JSC::JIT::emit_op_loop_if_less):
6392         (JSC::JIT::emit_op_loop_if_lesseq):
6393         (JSC::JIT::emit_op_resolve_global):
6394         (JSC::JIT::emitSlow_op_resolve_global):
6395         (JSC::JIT::emit_op_eq):
6396         (JSC::JIT::emitSlow_op_eq):
6397         (JSC::JIT::emit_op_neq):
6398         (JSC::JIT::emitSlow_op_neq):
6399
6400 2009-06-30  Gavin Barraclough  <barraclough@apple.com>
6401
6402         Reviewed by Geoffrey Garen.
6403
6404         Replace calls to store32(tagFor()) and store32(payloadFor())
6405         with emitStoreInt32(), emitStoreBool(), and emitStoreCell().
6406
6407         * jit/JIT.h:
6408         * jit/JITArithmetic.cpp:
6409         (JSC::JIT::emit_op_negate):
6410         (JSC::JIT::emit_op_lshift):
6411         (JSC::JIT::emit_op_rshift):
6412         (JSC::JIT::emit_op_bitand):
6413         (JSC::JIT::emitBitAnd32Constant):
6414         (JSC::JIT::emit_op_bitor):
6415         (JSC::JIT::emitBitOr32Constant):
6416         (JSC::JIT::emit_op_bitxor):
6417         (JSC::JIT::emitBitXor32Constant):
6418         (JSC::JIT::emit_op_bitnot):
6419         (JSC::JIT::emit_op_post_inc):
6420         (JSC::JIT::emit_op_post_dec):
6421         (JSC::JIT::emit_op_pre_inc):
6422         (JSC::JIT::emit_op_pre_dec):
6423         (JSC::JIT::emit_op_add):
6424         (JSC::JIT::emitAdd32Constant):
6425         (JSC::JIT::emit_op_sub):
6426         (JSC::JIT::emitSub32ConstantLeft):
6427         (JSC::JIT::emitSub32ConstantRight):
6428         (JSC::JIT::emit_op_mul):
6429         (JSC::JIT::emitSlow_op_mul):
6430         (JSC::JIT::emit_op_div):
6431         (JSC::JIT::emit_op_mod):
6432         * jit/JITCall.cpp:
6433         (JSC::JIT::emit_op_load_varargs):
6434         * jit/JITInlineMethods.h:
6435         (JSC::JIT::emitStoreInt32):
6436         (JSC::JIT::emitStoreCell):
6437         (JSC::JIT::emitStoreBool):
6438         (JSC::JIT::emitStore):
6439         * jit/JITOpcodes.cpp:
6440         (JSC::JIT::emit_op_instanceof):
6441         (JSC::JIT::emit_op_not):
6442         (JSC::JIT::emit_op_eq):
6443         (JSC::JIT::emitSlow_op_eq):
6444         (JSC::JIT::emit_op_neq):
6445         (JSC::JIT::emitSlow_op_neq):
6446         (JSC::JIT::compileOpStrictEq):
6447         (JSC::JIT::emit_op_eq_null):
6448         (JSC::JIT::emit_op_neq_null):
6449         * jit/JITStubCall.h:
6450         (JSC::JITStubCall::call):
6451
6452 2009-06-30  Geoffrey Garen  <ggaren@apple.com>
6453
6454         Reviewed by Sam Weinig.
6455         
6456         Standardized the rest of the property access instructions to put { tag,
6457         payload } in { regT1, regT0 }.
6458
6459         Small v8 speedup, 0.2% SunSpider slowdown.
6460
6461         * jit/JIT.h:
6462         * jit/JITInlineMethods.h:
6463         (JSC::JIT::emitLoad):
6464         (JSC::JIT::emitLoad2):
6465         * jit/JITPropertyAccess.cpp:
6466         (JSC::JIT::emit_op_get_by_val):
6467         (JSC::JIT::emitSlow_op_get_by_val):
6468         (JSC::JIT::emit_op_put_by_val):
6469         (JSC::JIT::emitSlow_op_put_by_val):
6470         (JSC::JIT::emit_op_put_by_id):
6471         (JSC::JIT::emitSlow_op_put_by_id):
6472         (JSC::JIT::patchPutByIdReplace):
6473
6474 2009-06-29  Sam Weinig  <sam@webkit.org>
6475
6476         Reviewed by Gavin Barraclough.
6477
6478         Various cleanups.
6479         - Use fpRegT* instead of X86::xmm*.
6480         - Use a switch statement in emitBinaryDoubleOp instead of a bunch of
6481           if/elses.
6482
6483         * jit/JITArithmetic.cpp:
6484         (JSC::JIT::emitAdd32Constant):
6485         (JSC::JIT::emitBinaryDoubleOp):
6486         (JSC::JIT::emit_op_div):
6487
6488 2009-06-29  Sam Weinig  <sam@webkit.org>
6489
6490         Reviewed by Geoffrey Garen.
6491
6492         Add inline code dealing with doubles for op_jfalse and op_jtrue.
6493
6494         * assembler/MacroAssemblerX86Common.h:
6495         (JSC::MacroAssemblerX86Common::):
6496         (JSC::MacroAssemblerX86Common::zeroDouble):
6497         * jit/JITOpcodes.cpp:
6498         (JSC::JIT::emit_op_jfalse):
6499         (JSC::JIT::emit_op_jtrue):
6500
6501 2009-06-28  Geoffrey Garen  <ggaren@apple.com>
6502
6503         Reviewed by Sam Weinig.
6504
6505         Standardized op_get_by_id to put { tag, payload } in { regT1, regT0 }.
6506         
6507         SunSpider and v8 report maybe 0.2%-0.4% regressions, but the optimization
6508         this enables will win much more than that back.
6509
6510         * jit/JIT.cpp:
6511         (JSC::JIT::privateCompileCTIMachineTrampolines):
6512         * jit/JIT.h:
6513         * jit/JITPropertyAccess.cpp:
6514         (JSC::JIT::emit_op_method_check):
6515         (JSC::JIT::emit_op_get_by_id):
6516         (JSC::JIT::compileGetByIdHotPath):
6517         (JSC::JIT::compileGetByIdSlowCase):
6518         (JSC::JIT::patchGetByIdSelf):
6519         (JSC::JIT::privateCompilePatchGetArrayLength):
6520         (JSC::JIT::privateCompileGetByIdProto):
6521         (JSC::JIT::privateCompileGetByIdSelfList):
6522         (JSC::JIT::privateCompileGetByIdProtoList):
6523         (JSC::JIT::privateCompileGetByIdChainList):
6524         (JSC::JIT::privateCompileGetByIdChain):
6525
6526 2009-06-26  Geoffrey Garen  <ggaren@apple.com>
6527
6528         Reviewed by Maciej Stachowiak.
6529         
6530         Standardized op_call to put { tag, payload } in { regT1, regT0 }.
6531         
6532         SunSpider and v8 report no change.
6533
6534         * jit/JIT.cpp:
6535         (JSC::JIT::privateCompileCTIMachineTrampolines):
6536         * jit/JITCall.cpp:
6537         (JSC::JIT::compileOpCallInitializeCallFrame):
6538         (JSC::JIT::compileOpCallSetupArgs):
6539         (JSC::JIT::compileOpConstructSetupArgs):
6540         (JSC::JIT::compileOpCallVarargsSetupArgs):
6541         (JSC::JIT::compileOpCallVarargs):
6542         (JSC::JIT::compileOpCall):
6543         (JSC::JIT::compileOpCallSlowCase):
6544
6545 2009-06-26  Sam Weinig  <sam@webkit.org>
6546
6547         Reviewed by Geoffrey Garen.
6548
6549         Handle multiplying by zero a little better by
6550         inlining the case that both operands are non-negative
6551         into the slowpath.
6552
6553         * assembler/MacroAssemblerX86Common.h:
6554         (JSC::MacroAssemblerX86Common::branchOr32):
6555         * jit/JITArithmetic.cpp:
6556         (JSC::JIT::emit_op_mul):
6557         (JSC::JIT::emitSlow_op_mul):
6558
6559 2009-06-25  Geoffrey Garen  <ggaren@apple.com>
6560
6561         Reviewed by Sam Weinig.
6562         
6563         Optimize x++ to ++x inside for loops.
6564         
6565         Sadly, no measurable speedup, but this should help with result chaining.
6566
6567         * parser/Nodes.cpp:
6568         (JSC::ForNode::emitBytecode):
6569
6570 2009-06-25  Geoffrey Garen  <ggaren@apple.com>
6571
6572         Reviewed by Sam Weinig.
6573         
6574         Standardized some more opcodes to put { tag, payload } in { regT1, regT0 }.
6575
6576         * jit/JITArithmetic.cpp:
6577         (JSC::JIT::emitSlow_op_bitnot):
6578         (JSC::JIT::emit_op_post_inc):
6579
6580 2009-06-25  Geoffrey Garen  <ggaren@apple.com>
6581
6582         Reviewed by Sam Weinig.
6583         
6584         Standardized some more opcodes to put { tag, payload } in { regT1, regT0 }.
6585
6586         * jit/JITArithmetic.cpp:
6587         (JSC::JIT::emit_op_bitnot):
6588         (JSC::JIT::emit_op_post_dec):
6589         (JSC::JIT::emit_op_pre_inc):
6590         (JSC::JIT::emitSlow_op_pre_inc):
6591         (JSC::JIT::emit_op_pre_dec):
6592         (JSC::JIT::emitSlow_op_pre_dec):
6593
6594 2009-06-25  Geoffrey Garen  <ggaren@apple.com>
6595
6596         Reviewed by Sam Weinig.
6597         
6598         Standardized some more opcodes to put { tag, payload } in { regT1, regT0 }.
6599
6600         * jit/JITArithmetic.cpp:
6601         (JSC::JIT::emit_op_negate):
6602         (JSC::JIT::emitSlow_op_negate):
6603         * jit/JITCall.cpp:
6604         (JSC::JIT::emit_op_construct_verify):
6605         (JSC::JIT::emitSlow_op_construct_verify):
6606
6607 2009-06-25  Geoffrey Garen  <ggaren@apple.com>
6608
6609         Reviewed by Sam Weinig.
6610         
6611         Standardized some more opcodes to put { tag, payload } in { regT1, regT0 }.
6612
6613         * jit/JITOpcodes.cpp:
6614         (JSC::JIT::emit_op_loop_if_true):
6615         (JSC::JIT::emit_op_jfalse):
6616         (JSC::JIT::emit_op_jtrue):
6617         (JSC::JIT::emit_op_jeq_null):
6618         (JSC::JIT::emit_op_jneq_null):
6619         (JSC::JIT::emit_op_eq_null):
6620         (JSC::JIT::emit_op_neq_null):
6621
6622 2009-06-25  Geoffrey Garen  <ggaren@apple.com>
6623
6624         Reviewed by Sam Weinig (sort of, maybe).
6625         
6626         Fixed some ASSERTs in http/tests/security.
6627         
6628         These ASSERTs were introduced by http://trac.webkit.org/changeset/45057,
6629         but the underlying problem was actually older. http://trac.webkit.org/changeset/45057
6630         just exposed the problem by enabling optimization in more cases.
6631         
6632         The ASSERTs fired because we tested PropertySlot::slotBase() for validity,
6633         but slotBase() ASSERTs if it's invalid, so we would ASSERT before
6634         the test could happen. Solution: Remove the ASSERT. Maybe it was valid
6635         once, but it clearly goes against a pattern we've deployed of late.
6636         
6637         The underlying problem was that WebCore would re-use a PropertySlot in
6638         the case of a forwarding access, and the second use would not completely
6639         overwrite the first use. Solution: Make sure to overwrite m_offset when
6640         setting a value on a PropertySlot. (Other values already get implicitly
6641         overwritten during reuse.)
6642
6643         * runtime/PropertySlot.h:
6644         (JSC::PropertySlot::PropertySlot):
6645         (JSC::PropertySlot::setValueSlot):
6646         (JSC::PropertySlot::setValue):
6647         (JSC::PropertySlot::setRegisterSlot):
6648         (JSC::PropertySlot::setUndefined):
6649         (JSC::PropertySlot::slotBase):
6650         (JSC::PropertySlot::clearOffset):
6651
6652 2009-06-24  Gavin Barraclough  <barraclough@apple.com>
6653
6654         Reviewed by Geoff Garen.
6655
6656         Enable JIT_OPTIMIZE_METHOD_CALLS on the branch, implementation matches current implemenatation in ToT.
6657
6658         * jit/JIT.h:
6659         * jit/JITPropertyAccess.cpp:
6660         (JSC::JIT::emit_op_method_check):
6661         (JSC::JIT::emitSlow_op_method_check):
6662         (JSC::JIT::emit_op_get_by_id):
6663         (JSC::JIT::compileGetByIdHotPath):
6664         (JSC::JIT::emitSlow_op_get_by_id):
6665         (JSC::JIT::compileGetByIdSlowCase):
6666
6667 2009-06-23  Geoffrey Garen  <ggaren@apple.com>
6668
6669         Reviewed by Sam Weinig.
6670
6671         Bit off a tiny bit more of standardizing opcode behavior to help with result
6672         caching.
6673         
6674         SunSpider reports no change, v8 maybe a tiny speedup.
6675
6676         * jit/JITOpcodes.cpp:
6677         (JSC::JIT::emit_op_to_jsnumber):
6678         (JSC::JIT::emitSlow_op_to_jsnumber):
6679         (JSC::JIT::emit_op_convert_this):
6680         (JSC::JIT::emitSlow_op_convert_this):
6681
6682 2009-06-23  Geoffrey Garen  <ggaren@apple.com>
6683
6684         Reviewed by Sam Weinig.
6685
6686         Bit off a tiny bit more of standardizing opcode behavior to help with result
6687         caching -- including removing my old enemy, op_resolve_function, because
6688         it was non-standard, and removing it felt better than helping it limp along.
6689         
6690         SunSpider reports no change, v8 maybe a tiny speedup.
6691         
6692         * bytecode/CodeBlock.cpp:
6693         (JSC::CodeBlock::dump):
6694         * bytecode/Opcode.h:
6695         * bytecompiler/BytecodeGenerator.cpp:
6696         * bytecompiler/BytecodeGenerator.h:
6697         * interpreter/Interpreter.cpp:
6698         (JSC::Interpreter::privateExecute):
6699         * jit/JIT.cpp:
6700         (JSC::JIT::privateCompileMainPass):
6701         * jit/JIT.h:
6702         * jit/JITOpcodes.cpp:
6703         (JSC::JIT::emit_op_get_scoped_var):
6704         (JSC::JIT::emit_op_put_scoped_var):
6705         (JSC::JIT::emit_op_to_primitive):
6706         (JSC::JIT::emitSlow_op_to_primitive):
6707         * jit/JITStubs.cpp:
6708         * jit/JITStubs.h:
6709         * parser/Nodes.cpp:
6710         (JSC::FunctionCallResolveNode::emitBytecode):
6711
6712 2009-06-23  Geoffrey Garen  <ggaren@apple.com>
6713
6714         Reviewed by Sam Weinig.
6715         
6716         Bit off a tiny bit of standardizing opcode behavior to help with result
6717         caching.
6718         
6719         0.6% SunSpider speedup. 0.3% v8 speedup.
6720
6721         * jit/JITInlineMethods.h:
6722         (JSC::JIT::emitLoad): Accomodate a base register that overlaps with payload
6723         by loading tag before payload, to avoid stomping base/payload.
6724
6725         * jit/JITOpcodes.cpp:
6726         (JSC::JIT::emit_op_mov): Abide by the standard "tag in regT1, payload in
6727         regT0" semantics.
6728
6729         (JSC::JIT::emit_op_get_global_var):
6730         (JSC::JIT::emit_op_put_global_var): Ditto. Also, removed some irrelevent
6731         loads while I was at it. The global object's "d" pointer never changes
6732         after construction.
6733
6734 2009-06-23  Gavin Barraclough  <barraclough@apple.com>
6735
6736         Reviewed by Sam Weinig.
6737
6738         Remove 'arguments' field from Register union (again).
6739         This time do so without breaking tests (radical, I know).
6740
6741         * interpreter/CallFrame.h:
6742         (JSC::ExecState::optionalCalleeArguments):
6743         (JSC::ExecState::setArgumentCount):
6744         (JSC::ExecState::init):
6745         * interpreter/Interpreter.cpp:
6746         (JSC::Interpreter::dumpRegisters):
6747         (JSC::Interpreter::unwindCallFrame):
6748         (JSC::Interpreter::privateExecute):
6749         (JSC::Interpreter::retrieveArguments):
6750         * interpreter/Register.h:
6751         (JSC::Register::withInt):
6752         (JSC::Register::):
6753         (JSC::Register::Register):
6754         (JSC::Register::i):
6755         * jit/JITStubs.cpp:
6756         (JSC::JITStubs::cti_op_tear_off_arguments):
6757         * runtime/Arguments.h:
6758         (JSC::JSActivation::copyRegisters):
6759         (JSC::Register::arguments):
6760         * runtime/JSActivation.cpp:
6761         (JSC::JSActivation::argumentsGetter):
6762         * runtime/JSActivation.h:
6763
6764 2009-06-23  Geoffrey Garen  <ggaren@apple.com>
6765
6766         Reviewed by Sam Weinig.
6767         
6768         Removed some result register tracking cruft in preparation for a new
6769         result tracking mechanism.
6770         
6771         SunSpider reports no change.
6772
6773         * assembler/AbstractMacroAssembler.h:
6774         * assembler/X86Assembler.h:
6775         (JSC::X86Assembler::JmpDst::JmpDst): No need to track jump targets in
6776         machine code; we already do this in bytecode.
6777
6778         * jit/JIT.cpp:
6779         (JSC::JIT::JIT):
6780         (JSC::JIT::emitTimeoutCheck): Make sure to save and restore the result
6781         registers, so an opcode with a timeout check can still benefit from result
6782         register caching.
6783
6784         (JSC::JIT::privateCompileMainPass):
6785         (JSC::JIT::privateCompileSlowCases): Removed calls to killLastResultRegister()
6786         in preparation for something new.
6787
6788         * jit/JIT.h:
6789         * jit/JITArithmetic.cpp:
6790         (JSC::JIT::emit_op_jnless):
6791         (JSC::JIT::emit_op_jnlesseq):
6792         * jit/JITInlineMethods.h:
6793         (JSC::JIT::emitGetFromCallFrameHeaderPtr):
6794         (JSC::JIT::emitGetFromCallFrameHeader32):
6795         * jit/JITOpcodes.cpp:
6796         (JSC::JIT::emit_op_jmp):
6797         (JSC::JIT::emit_op_jfalse):
6798         (JSC::JIT::emit_op_jtrue):
6799         (JSC::JIT::emit_op_jeq_null):
6800         (JSC::JIT::emit_op_jneq_null):
6801         (JSC::JIT::emit_op_jneq_ptr):
6802         (JSC::JIT::emit_op_jsr):
6803         (JSC::JIT::emit_op_sret):
6804         (JSC::JIT::emit_op_jmp_scopes): ditto
6805
6806         * jit/JITStubCall.h:
6807         (JSC::JITStubCall::JITStubCall):
6808         (JSC::JITStubCall::getArgument): added a mechanism for reloading an argument
6809         you passed to a JIT stub, for use in emitTimeoutCheck.
6810
6811 2009-06-23  Sam Weinig  <sam@webkit.org>
6812
6813         Reviewed by Geoffrey Garen.
6814
6815         Remove now-useless inplace variants of binary ops.
6816
6817         * jit/JIT.h:
6818         * jit/JITArithmetic.cpp:
6819         (JSC::JIT::emit_op_bitand):
6820         (JSC::JIT::emit_op_bitor):
6821         (JSC::JIT::emit_op_bitxor):
6822         (JSC::JIT::emit_op_add):
6823         (JSC::JIT::emit_op_sub):
6824         (JSC::JIT::emit_op_mul):
6825
6826 2009-06-23  Sam Weinig  <sam@webkit.org>
6827
6828         Reviewed by Geoffrey Garen.
6829
6830         Move off memory operands to aid in re-enabling result caching.
6831
6832         - No regression measured.
6833
6834         * jit/JIT.h:
6835         * jit/JITArithmetic.cpp:
6836         (JSC::JIT::emit_op_negate):
6837         (JSC::JIT::emit_op_jnless):
6838         (JSC::JIT::emit_op_jnlesseq):
6839         (JSC::JIT::emit_op_lshift):
6840         (JSC::JIT::emit_op_rshift):
6841         (JSC::JIT::emit_op_bitand):
6842         (JSC::JIT::emitBitAnd32Constant):
6843         (JSC::JIT::emitBitAnd32InPlace):
6844         (JSC::JIT::emit_op_bitor):
6845         (JSC::JIT::emitBitOr32Constant):
6846         (JSC::JIT::emitBitOr32InPlace):
6847         (JSC::JIT::emit_op_bitxor):
6848         (JSC::JIT::emitBitXor32Constant):
6849         (JSC::JIT::emitBitXor32InPlace):
6850         (JSC::JIT::emit_op_bitnot):
6851         (JSC::JIT::emit_op_post_inc):
6852         (JSC::JIT::emit_op_post_dec):
6853         (JSC::JIT::emit_op_pre_inc):
6854         (JSC::JIT::emitSlow_op_pre_inc):
6855         (JSC::JIT::emit_op_pre_dec):
6856         (JSC::JIT::emitSlow_op_pre_dec):
6857         (JSC::JIT::emit_op_add):
6858         (JSC::JIT::emitAdd32Constant):
6859         (JSC::JIT::emitAdd32InPlace):
6860         (JSC::JIT::emitSlow_op_add):
6861         (JSC::JIT::emitSlowAdd32Constant):
6862         (JSC::JIT::emit_op_sub):
6863         (JSC::JIT::emitSlow_op_sub):
6864         (JSC::JIT::emitSub32ConstantLeft):
6865         (JSC::JIT::emitSub32ConstantRight):
6866         (JSC::JIT::emitSub32InPlaceLeft):
6867         (JSC::JIT::emitSub32InPlaceRight):
6868         (JSC::JIT::emitBinaryDoubleOp):
6869         (JSC::JIT::emit_op_mul):
6870         (JSC::JIT::emitMul32InPlace):
6871         (JSC::JIT::emit_op_div):
6872         (JSC::JIT::emit_op_mod):
6873         * jit/JITCall.cpp:
6874         (JSC::JIT::compileOpCallVarargs):
6875         * jit/JITOpcodes.cpp:
6876         (JSC::JIT::emit_op_loop_if_less):
6877         (JSC::JIT::emit_op_loop_if_lesseq):
6878         (JSC::JIT::emit_op_instanceof):
6879         (JSC::JIT::emit_op_to_primitive):
6880         (JSC::JIT::emit_op_not):
6881         (JSC::JIT::emit_op_jneq_ptr):
6882         (JSC::JIT::emit_op_eq):
6883         (JSC::JIT::emit_op_neq):
6884         (JSC::JIT::emit_op_to_jsnumber):
6885         * jit/JITPropertyAccess.cpp:
6886         (JSC::JIT::emit_op_get_by_val):
6887         (JSC::JIT::emit_op_put_by_val):
6888
6889 2009-06-23  Geoffrey Garen  <ggaren@apple.com>
6890
6891         Reviewed by Sam Weinig.
6892         
6893         Fixed some missing and/or misplaced labels in bytecode generation, so
6894         we don't have to work around them in JIT code generation.
6895
6896         * bytecompiler/BytecodeGenerator.cpp:
6897         (JSC::BytecodeGenerator::emitJumpSubroutine):
6898         * parser/Nodes.cpp:
6899         (JSC::TryNode::emitBytecode):
6900
6901 2009-06-22  Geoffrey Garen  <ggaren@apple.com>
6902
6903         Reviewed by Sam Weinig.
6904         
6905         For member function calls, emit "this" directly into the "this" slot
6906         for the function call, instead of moving it there later. This reduces
6907         time spent in op_mov during certain calls, like "a.b.c()".
6908         
6909         1%-2% speedup on v8, mostly richards and delta-blue.
6910
6911         * parser/Nodes.cpp:
6912         (JSC::FunctionCallDotNode::emitBytecode):
6913
6914 2009-06-22  Gavin Barraclough  <barraclough@apple.com>
6915
6916         Reviewed by Sam Weinig.
6917
6918         Remove 'arguments' field from Register union.  Having JSCell derived types in the union is
6919         dangerous since it opens the possibility for the field to be written as a raw pointer but
6920         then read as a JSValue.  This will lead to statle data being read for the tag, which may
6921         be dangerous.  Having removed Arguments* types form Register, all arguments objects must
6922         always explicitly be stored in the register file as JSValues.
6923
6924         * interpreter/CallFrame.h:
6925         (JSC::ExecState::optionalCalleeArguments):
6926         * interpreter/Interpreter.cpp:
6927         (JSC::Interpreter::unwindCallFrame):
6928         (JSC::Interpreter::privateExecute):
6929         (JSC::Interpreter::retrieveArguments):
6930         * interpreter/Register.h:
6931         (JSC::Register::):
6932         * jit/JITStubs.cpp:
6933         (JSC::JITStubs::cti_op_tear_off_arguments):
6934         * runtime/Arguments.h:
6935         (JSC::JSActivation::copyRegisters):
6936         * runtime/JSActivation.cpp:
6937         (JSC::JSActivation::argumentsGetter):
6938         * runtime/JSActivation.h:
6939
6940 2009-06-03  Sam Weinig  <sam@webkit.org>
6941
6942         Reviewed by Geoffrey Garen.
6943
6944         Add back known this value optimization by abstracting
6945         slow case if not JSCell jumps.
6946
6947         * jit/JIT.h:
6948         * jit/JITCall.cpp:
6949         (JSC::JIT::compileOpCallVarargs):
6950         (JSC::JIT::compileOpCallVarargsSlowCase):
6951         (JSC::JIT::compileOpCall):
6952         (JSC::JIT::compileOpCallSlowCase):
6953         * jit/JITInlineMethods.h:
6954         (JSC::JIT::emitJumpSlowCaseIfNotJSCell):
6955         (JSC::JIT::linkSlowCaseIfNotJSCell):
6956         * jit/JITOpcodes.cpp:
6957         (JSC::JIT::emit_op_instanceof):
6958         (JSC::JIT::emitSlow_op_instanceof):
6959         * jit/JITPropertyAccess.cpp:
6960         (JSC::JIT::emit_op_get_by_val):
6961         (JSC::JIT::emitSlow_op_get_by_val):
6962         (JSC::JIT::emit_op_put_by_val):
6963         (JSC::JIT::emitSlow_op_put_by_val):
6964         (JSC::JIT::emit_op_get_by_id):
6965         (JSC::JIT::emitSlow_op_get_by_id):
6966         (JSC::JIT::emit_op_put_by_id):
6967         (JSC::JIT::emitSlow_op_put_by_id):
6968
6969 2009-06-01  Geoffrey Garen  <ggaren@apple.com>
6970
6971         Reviewed by Sam Weinig.
6972         
6973         Fixed some of the regression in crypto-aes.js. (8.5% speedup in
6974         crypto-aes.js.)
6975         
6976         SunSpider reports no change overall.
6977         
6978         Division was producing double results, which took the slow path through
6979         array access code.
6980         
6981         Strangely, all my attempts at versions of this patch that modified array
6982         access code to accept ints encoded as doubles along the fast or slow paths
6983         were regressions. So I did this instead.
6984
6985         * jit/JITArithmetic.cpp:
6986         (JSC::JIT::emit_op_div): When dividing an int by an int, go ahead and try
6987         to turn the result into an int. Don't just do int division, though, because
6988         testing shows it to be slower than SSE double division, and the corner
6989         cases are pretty complicated / lengthy on top of that. Also, don't try
6990         to canonicalize division of known tiny numerators into ints, since that's a
6991         waste of time.
6992
6993 2009-05-26  Geoffrey Garen  <ggaren@apple.com>
6994
6995         Reviewed by Oliver Hunt.
6996         
6997         Fixed a regression caused by my recent fix for NaN.
6998
6999         * jit/JITArithmetic.cpp:
7000         (JSC::JIT::emitBinaryDoubleOp): Actually do the comparison in reverse
7001         order, like the ChangeLog said we would, bokay?
7002
7003 2009-05-26  Geoffrey Garen  <ggaren@apple.com>
7004
7005         Reviewed by Sam Weinig and Oliver Hunt.
7006         
7007         Fixed two edge cases in %:
7008         
7009         - Don't do -2147483648 % x as a fast case, since you might do -2147483648 % -1,
7010         which will signal a hardware exception due to overflow.
7011
7012         - In the case of a zero remainder, be sure to store negative zero if the
7013         dividend was zero.
7014         
7015         SunSpider reports no change.
7016
7017         * jit/JITArithmetic.cpp:
7018         (JSC::JIT::emit_op_mod):
7019         (JSC::JIT::emitSlow_op_mod):
7020
7021 2009-05-25  Geoffrey Garen  <ggaren@apple.com>
7022
7023         Reviewed by Maciej Stachowiak.
7024         
7025         Fixed a regression when comparing to NaN.
7026
7027         * jit/JITArithmetic.cpp:
7028         (JSC::JIT::emitBinaryDoubleOp): For op_jnless and op_jnless_eq, do the
7029         comparison in reverse order, and jump if the result is below or 
7030         below-or-equal. This ensures that we do jump in the case of NaN.
7031
7032 2009-05-25  Geoffrey Garen  <ggaren@apple.com>
7033
7034         Reviewed by Oliver Hunt.
7035         
7036         SunSpider says no change.
7037         
7038         Fixed regressions in fast/js/var-declarations-shadowing.html and
7039         fast/js/equality.html, caused by recent == and != optimizations.
7040
7041         * jit/JITStubs.cpp:
7042         (JSC::JITStubs::cti_op_eq): Don't treat "compare to string" as always
7043         numeric or string comparison. If the second operand is an object, you
7044         need to ToPrimitive it, and start all over again. Also, I wrote out each
7045         of the possible cases explicitly, to cut down on redundant branching.
7046
7047 2009-05-25  Sam Weinig  <sam@webkit.org>
7048
7049         Reviewed by Mark Rowe.
7050
7051         Fix bug in fast/js/constant-folding.html where we were not negating
7052         -0 properly.
7053
7054         * jit/JITArithmetic.cpp:
7055         (JSC::JIT::emit_op_negate):
7056
7057 2009-05-23  Geoffrey Garen  <ggaren@apple.com>
7058
7059         Reviewed by Oliver Hunt.
7060         
7061         Refactored new slow case codegen for == and !=.
7062         
7063         SunSpider reports no change, maybe a tiny speedup.
7064
7065         * jit/JITOpcodes.cpp:
7066         (JSC::JIT::emitSlow_op_eq):
7067         (JSC::JIT::emitSlow_op_neq): Made a vptr comparison a *Ptr operation,
7068         instead of *32, to make it portable to 64bit. Reorganized the string
7069         and generic cases to make their control flow a little clearer.
7070
7071 2009-05-23  Geoffrey Garen  <ggaren@apple.com>
7072
7073         Reviewed by Maciej Stachowiak.
7074         
7075         Optimized == and != for our new value representation -- especially for strings.
7076         
7077         14% speedup on date-format-tofte.
7078
7079         * jit/JITOpcodes.cpp:
7080         (JSC::JIT::emit_op_eq):
7081         (JSC::JIT::emitSlow_op_eq):
7082         (JSC::JIT::emit_op_neq):
7083         (JSC::JIT::emitSlow_op_neq):
7084         * jit/JITStubCall.h:
7085         (JSC::JITStubCall::JITStubCall):
7086         * jit/JITStubs.cpp:
7087         (JSC::JITStubs::cti_op_eq):
7088         (JSC::JITStubs::cti_op_eq_strings):
7089         (JSC::JITStubs::cti_op_call_eval):
7090         * jit/JITStubs.h:
7091         (JSC::):
7092         * runtime/JSValue.h:
7093
7094 2009-05-22  Sam Weinig  <sam@webkit.org>
7095
7096         Reviewed by Gavin Barraclough.
7097
7098         Fix non-SSE enabled builds.
7099
7100         * jit/JITArithmetic.cpp:
7101         (JSC::JIT::emitSlow_op_add): Don't early return here, we still need to call the JIT stub.
7102         (JSC::JIT::emitSlow_op_sub): Ditto.
7103
7104 2009-05-22  Geoffrey Garen  <ggaren@apple.com>
7105
7106         Reviewed by Sam Weinig.
7107         
7108         Here's a thought: let's not take a jit stub call just to multiply by 1,
7109         bokay?
7110         
7111         imul doesn't set the zero flag, so to test for a zero result, we need
7112         an explicit instruction. (Luckily, it does set the overflow flag, so
7113         we can still use that.)
7114
7115         * jit/JIT.h:
7116         * jit/JITArithmetic.cpp:
7117         (JSC::JIT::emit_op_mul):
7118         (JSC::JIT::emitSlow_op_mul):
7119         (JSC::JIT::emitMul32InPlace):
7120
7121 2009-05-22  Sam Weinig  <sam@webkit.org>
7122
7123         Reviewed by Geoffrey "Premature Commit" Garen.
7124
7125         Add back constant integer cases for op_add.
7126
7127         * jit/JIT.h:
7128         * jit/JITArithmetic.cpp:
7129         (JSC::JIT::emit_op_add):
7130         (JSC::JIT::emitAdd32Constant):
7131         (JSC::JIT::emitSlow_op_add):
7132         (JSC::JIT::emitSlowAdd32Constant):
7133         * jit/JITInlineMethods.h:
7134         (JSC::JIT::getConstantOperandImmediateDouble):
7135         (JSC::JIT::isOperandConstantImmediateDouble):
7136
7137 2009-05-22  Geoffrey Garen  <ggaren@apple.com>
7138
7139         Reviewed by Sam Weinig.
7140         
7141         Added fast double cases for op_jnless and op_jnlesseq.
7142
7143         * assembler/AbstractMacroAssembler.h:
7144         (JSC::AbstractMacroAssembler::JumpList::jumps): New accesor, used by
7145         addSlowCase.
7146
7147         * assembler/X86Assembler.h:
7148         (JSC::X86Assembler::ucomisd_rm): New method for comparing register to
7149         memory.
7150
7151         * jit/JIT.h:
7152         * jit/JITArithmetic.cpp:
7153         (JSC::JIT::emit_op_jnless):
7154         (JSC::JIT::emitSlow_op_jnless):
7155         (JSC::JIT::emit_op_jnlesseq):
7156         (JSC::JIT::emitSlow_op_jnlesseq):
7157         (JSC::JIT::emit_op_add):
7158         (JSC::JIT::emit_op_sub):
7159         (JSC::JIT::emitBinaryDoubleOp):
7160         (JSC::JIT::emit_op_mul):
7161         (JSC::JIT::emit_op_div): Modified emitBinaryDoubleOp to accept comparison/jump
7162         operations in addition to operations with explicit result registers.
7163
7164         * jit/JITInlineMethods.h:
7165         (JSC::JIT::addSlowCase): Added an "addSlowCase" for JumpLists, so clients
7166         can track multiple jumps to the same slow case condition together.
7167
7168 2009-05-21  Sam Weinig  <sam@webkit.org>
7169
7170         Reviewed by Gavin Barraclough.
7171
7172         Implement op_negate inline fast cases.
7173
7174         * assembler/MacroAssemblerX86Common.h:
7175         (JSC::MacroAssemblerX86Common::neg32):
7176         * assembler/X86Assembler.h:
7177         (JSC::X86Assembler::):
7178         (JSC::X86Assembler::negl_m):
7179         (JSC::X86Assembler::xorpd_rr):
7180         * jit/JIT.cpp:
7181         (JSC::JIT::privateCompileMainPass):
7182         (JSC::JIT::privateCompileSlowCases):
7183         * jit/JIT.h:
7184         * jit/JITArithmetic.cpp:
7185         (JSC::JIT::emit_op_negate):
7186         (JSC::JIT::emitSlow_op_negate):
7187
7188 2009-05-20  Sam Weinig  <sam@webkit.org>
7189
7190         Reviewed by Gavin Barraclough.
7191
7192         Update the patchOffsetGetByIdSlowCaseCall constant for the
7193         case that OPCODE_SAMPLING is enabled.
7194
7195         * jit/JIT.h:
7196
7197 2009-05-20  Geoffrey Garen  <ggaren@apple.com>
7198
7199         Reviewed by Sam Weinig.
7200
7201         Added support for inline subtraction of doubles.
7202
7203         * jit/JITArithmetic.cpp:
7204         (JSC::JIT::emit_op_sub):
7205         (JSC::JIT::emitSlow_op_sub):
7206         (JSC::JIT::emitSlowSub32InPlaceLeft):
7207         (JSC::JIT::emitBinaryDoubleOp):
7208
7209 2009-05-20  Sam Weinig  <sam@webkit.org>
7210
7211         Reviewed by Geoffrey Garen.
7212
7213         Added support for inline division.
7214
7215         * assembler/X86Assembler.h:
7216         (JSC::X86Assembler::):
7217         (JSC::X86Assembler::divsd_rr):
7218         (JSC::X86Assembler::divsd_mr):
7219         * bytecode/CodeBlock.cpp:
7220         (JSC::CodeBlock::dump):
7221         * bytecode/Opcode.h:
7222         * bytecompiler/BytecodeGenerator.cpp:
7223         (JSC::BytecodeGenerator::emitBinaryOp):
7224         * interpreter/Interpreter.cpp:
7225         (JSC::Interpreter::privateExecute):
7226         * jit/JIT.cpp:
7227         (JSC::JIT::privateCompileMainPass):
7228         (JSC::JIT::privateCompileSlowCases):
7229         * jit/JIT.h:
7230         * jit/JITArithmetic.cpp:
7231         (JSC::JIT::emitBinaryDoubleOp):
7232         (JSC::JIT::emit_op_div):
7233         (JSC::JIT::emitSlow_op_div):
7234
7235 2009-05-20  Geoffrey Garen  <ggaren@apple.com>
7236
7237         Reviewed by Sam Weinig.
7238
7239         Added support for inline addition of doubles.
7240
7241         * jit/JITArithmetic.cpp:
7242         (JSC::JIT::emit_op_add):
7243         (JSC::JIT::emitSlow_op_add):
7244         (JSC::JIT::emitSlowAdd32InPlace):
7245         (JSC::JIT::emitBinaryDoubleOp):
7246         (JSC::JIT::emit_op_mul):
7247         (JSC::JIT::emitSlow_op_mul):
7248
7249 2009-05-20  Geoffrey Garen  <ggaren@apple.com>
7250
7251         Reviewed by Sam Weinig.
7252         
7253         Factored inline double operations into a helper function, so that we
7254         can reuse this code for other math operations.
7255
7256         * jit/JIT.h:
7257         * jit/JITArithmetic.cpp:
7258         (JSC::JIT::emitBinaryDoubleOp):
7259         (JSC::JIT::emit_op_mul):
7260         * jit/JITCall.cpp:
7261         (JSC::JIT::compileOpCallInitializeCallFrame):
7262
7263 2009-05-20  Geoffrey Garen  <ggaren@apple.com>
7264
7265         Reviewed by Sam Weinig.
7266         
7267         Added support for inline multiplication of doubles.
7268
7269         * assembler/X86Assembler.h:
7270         (JSC::X86Assembler::cvtsi2sd_mr): New function, useful for loading an
7271         int32 into a double register.
7272
7273         * jit/JITArithmetic.cpp:
7274         (JSC::JIT::emit_op_mul):
7275         (JSC::JIT::emitSlow_op_mul): Filled out these cases for double arithmetic.
7276
7277         * jit/JIT.h:
7278         * jit/JITInlineMethods.h:
7279         (JSC::JIT::addressFor): New function, useful for addressing a JSValue's
7280         full 64bits as a double.
7281
7282 2009-05-19  Sam Weinig  <sam@webkit.org>
7283
7284         Reviewed by Geoffrey Garen.
7285
7286         Implement and enable optimized calls.
7287
7288         * jit/JIT.cpp:
7289         (JSC::JIT::privateCompileCTIMachineTrampolines): Add ENABLE(JIT_OPTIMIZE_CALL) guards
7290         around the the optimize call only trampolines (virtualCallPreLink and virtualCallLink).
7291         Update the trampolines to account for the new JSValue representation.
7292         (JSC::JIT::unlinkCall): Use NULL instead of JSValue noValue. 
7293
7294         * jit/JITCall.cpp:
7295         (JSC::JIT::compileOpCall): Update to account for the new JSValue representation
7296         (JSC::JIT::compileOpCallSlowCase): Ditto.
7297
7298         * jit/JITStubs.h: Remove incorrect !ENABLE(JIT_OPTIMIZE_CALL) guard.
7299
7300         * wtf/Platform.h: Enable ENABLE_JIT_OPTIMIZE_CALL.
7301
7302 2009-05-19  Sam Weinig  <sam@webkit.org>
7303
7304         Reviewed by Geoffrey Garen.
7305
7306         Implement and enable optimized property access.
7307
7308         * assembler/AbstractMacroAssembler.h: Fix comment.
7309         * jit/JIT.cpp:
7310         (JSC::JIT::privateCompileCTIMachineTrampolines): Remove array length trampoline
7311         and implement the string length trampoline.
7312         * jit/JIT.h: Add new constants for patch offsets.
7313         * jit/JITInlineMethods.h: Remove FIELD_OFFSET which is now in StdLibExtras.h.
7314         * jit/JITPropertyAccess.cpp: 
7315         (JSC::JIT::emit_op_get_by_id):
7316         (JSC::JIT::emitSlow_op_get_by_id):
7317         (JSC::JIT::emit_op_put_by_id):
7318         (JSC::JIT::emitSlow_op_put_by_id):
7319         (JSC::JIT::compilePutDirectOffset):
7320         (JSC::JIT::compileGetDirectOffset):
7321         (JSC::JIT::privateCompilePutByIdTransition):
7322         (JSC::JIT::patchGetByIdSelf):
7323         (JSC::JIT::patchPutByIdReplace):
7324         (JSC::JIT::privateCompilePatchGetArrayLength):
7325         (JSC::JIT::privateCompileGetByIdProto):
7326         (JSC::JIT::privateCompileGetByIdSelfList):
7327         (JSC::JIT::privateCompileGetByIdProtoList):
7328         (JSC::JIT::privateCompileGetByIdChainList):
7329         (JSC::JIT::privateCompileGetByIdChain):
7330         * jit/JITStubCall.h:
7331         (JSC::JITStubCall::addArgument): Add version of addArgument that takes
7332         two registers for the tag and payload.
7333         * jit/JITStubs.cpp:
7334         (JSC::JITStubs::JITStubs): Remove array length trampoline pointer.
7335         (JSC::JITStubs::cti_op_get_by_id_self_fail): 
7336         * jit/JITStubs.h:
7337         * runtime/JSObject.h:
7338         (JSC::JSObject::JSObject): Move m_inheritorID below the property storage
7339         to align it to a 16 byte boundary.
7340         * wtf/Platform.h: Enable ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS
7341         * wtf/StdLibExtras.h: Move FIELD_OFFSET here.
7342
7343 2009-05-17  Sam Weinig  <sam@webkit.org>
7344
7345         Reviewed by Geoffrey Garen.
7346
7347         Remove unneeded ExecState parameter from the number JSValue constructors.
7348
7349         * runtime/JSValue.h:
7350         (JSC::jsNumber):
7351         (JSC::jsNaN):
7352         (JSC::JSValue::JSValue):
7353
7354 2009-05-15  Sam Weinig  <sam@webkit.org>
7355
7356         Reviewed by Geoffrey Garen.
7357
7358         Implemented fast path for op_put_by_val when putting to arrays.
7359
7360         * jit/JITPropertyAccess.cpp:
7361         (JSC::JIT::emit_op_put_by_val):
7362         (JSC::JIT::emitSlow_op_put_by_val):
7363
7364 2009-05-15  Geoffrey Garen  <ggaren@apple.com> (Mostly by Sam)
7365
7366         Reviewed by Sam Weinig.
7367         
7368         Implemented fast path for op_get_by_val when accessing array.
7369
7370         * jit/JIT.cpp:
7371         * jit/JITPropertyAccess.cpp:
7372         (JSC::JIT::emit_op_get_by_val):
7373         (JSC::JIT::emitSlow_op_get_by_val):
7374
7375 2009-05-14  Geoffrey Garen  <ggaren@apple.com>
7376
7377         Reviewed by Sam Weinig.
7378         
7379         Fixed a failure in fast/js/math-transforms.html caused by failing to
7380         preserve -0 in multiplication.
7381
7382         * assembler/X86Assembler.h:
7383         (JSC::X86Assembler::jz):
7384         * jit/JITArithmetic.cpp:
7385         (JSC::JIT::emit_op_mul):
7386         (JSC::JIT::emitSlow_op_mul):
7387         (JSC::JIT::emitMul32Constant):
7388         (JSC::JIT::emitMul32InPlace): Check both for overflow and for zero when
7389         doing multiplication. Use a slow case to get these right.
7390
7391 2009-05-14  Geoffrey Garen  <ggaren@apple.com>
7392
7393         Reviewed by Sam Weinig.
7394         
7395         Fixed a bug in the varargs calling convention.
7396
7397         * jit/JITCall.cpp:
7398         (JSC::JIT::compileOpCallVarargs): Move the argument count into regT1,
7399         since that's where ctiVirtualCall expects it to be.
7400
7401 2009-05-14  Geoffrey Garen  <ggaren@apple.com>
7402
7403         Reviewed by Sam Weinig.
7404
7405         Fixed a small bug in instanceof's looping code.
7406
7407         * jit/JITOpcodes.cpp:
7408         (JSC::JIT::emit_op_instanceof): NULL means the object has no prototype,
7409         so only loop when *not* equal to NULL.
7410
7411 2009-05-14  Geoffrey Garen  <ggaren@apple.com>
7412
7413         Reviewed by Sam Weinig.
7414         
7415         Fixed a small bug in instanceof's result writing code.
7416
7417         * jit/JITOpcodes.cpp:
7418         (JSC::JIT::emit_op_instanceof): Make sure to fill out the payload bits
7419         in all cases.
7420
7421 2009-05-14  Sam Weinig  <sam@webkit.org>
7422
7423         Reviewed by Geoffrey Garen.
7424
7425         Removed an invalid assertion in cti_op_urshift which
7426         depended on a fast path for op_urshift which has
7427         never existed.
7428
7429         * jit/JITStubs.cpp:
7430         (JSC::JITStubs::cti_op_urshift):
7431
7432 2009-05-14  Geoffrey Garen  <ggaren@apple.com>
7433
7434         Reviewed by Sam Weinig.
7435         
7436         Fixed loop_if_true, which had the same reversed test that jtrue had.
7437
7438         * jit/JITOpcodes.cpp:
7439         (JSC::JIT::emit_op_loop_if_true):
7440
7441 2009-05-14  Sam Weinig  <sam@webkit.org>
7442
7443         Reviewed by Geoffrey Garen.
7444
7445         In op_neq, we apparently want to check that one value
7446         does *not* equal another.  Go figure.
7447
7448         * jit/JITOpcodes.cpp:
7449         (JSC::JIT::emit_op_neq):
7450
7451 2009-05-14  Sam Weinig  <sam@webkit.org>
7452
7453         Reviewed by Geoffrey Garen.
7454
7455         The slow case of op_mod should call op_mod's jit stub,
7456         not op_mul.  That would be dumb.
7457
7458         * jit/JITArithmetic.cpp:
7459         (JSC::JIT::emitSlow_op_mod):
7460
7461 2009-05-14  Geoffrey Garen  <ggaren@apple.com>
7462
7463         Reviewed by Sam Weinig.
7464         
7465         Fixed problems when using 'arguments' due to a half-initialized register.
7466
7467         * interpreter/CallFrame.h:
7468         (JSC::ExecState::setCalleeArguments):
7469         (JSC::ExecState::init): Require a full JSValue when setting up the 
7470         'arguments' virtual register, since this register is accessible from JIT
7471         code and bytecode, and needs to be a true JSValue.
7472
7473         * interpreter/CallFrameClosure.h:
7474         (JSC::CallFrameClosure::resetCallFrame): ditto
7475
7476         * interpreter/Interpreter.cpp:
7477         (JSC::Interpreter::privateExecute): ditto
7478
7479         * interpreter/Register.h: Removed the constructor that allowed assignment
7480         of a JSArguments* to a register. That is not safe. See above.
7481
7482         * jit/JITStubs.cpp:
7483         (JSC::JITStubs::cti_op_create_arguments):
7484         (JSC::JITStubs::cti_op_create_arguments_no_params): ditto
7485
7486 2009-05-14  Sam Weinig  <sam@webkit.org>
7487
7488         Reviewed by Geoffrey Garen.
7489
7490         We really want to go to the slow case in op_jfalse and
7491         op_jtrue if the value is *not* boolean. 
7492
7493         * jit/JITOpcodes.cpp:
7494         (JSC::JIT::emit_op_jfalse):
7495         (JSC::JIT::emit_op_jtrue):
7496
7497 2009-05-14  Sam Weinig  <sam@webkit.org>
7498
7499         Reviewed by Geoffrey Garen.
7500
7501         Flipped the condition when emitting a an op_loop_if_less or op_loop_if_lesseq
7502         if the first operand is a constant.
7503
7504         * jit/JITOpcodes.cpp:
7505         (JSC::JIT::emit_op_loop_if_less):
7506         (JSC::JIT::emit_op_loop_if_lesseq):
7507
7508 2009-05-14  Sam Weinig  <sam@webkit.org>
7509
7510         Reviewed by Geoffrey Garen.
7511
7512         Added missing return in op_jnless and op_jnlesseq. 
7513
7514         * jit/JITArithmetic.cpp:
7515         (JSC::JIT::emit_op_jnless):
7516         (JSC::JIT::emit_op_jnlesseq):
7517
7518 2009-05-14  Sam Weinig  <sam@webkit.org>
7519
7520         Reviewed by Geoffrey Garen.
7521
7522         Load constants into the the register file as a temporary measure to
7523         aid bring up.  This allows us to use to treat constants like any
7524         other virtual register.
7525
7526         * jit/JITOpcodes.cpp:
7527         (JSC::JIT::emit_op_enter):
7528         (JSC::JIT::emit_op_enter_with_activation):
7529
7530 2009-05-14  Geoffrey Garen  <ggaren@apple.com>
7531
7532         Reviewed by Sam Weinig.
7533         
7534         Implemented op_strict_eq. Original patch by Snowy, by way of Sam and Gavin.
7535
7536         * assembler/MacroAssemblerX86Common.h:
7537         (JSC::MacroAssemblerX86Common::set8): Added set8, since it's slightly
7538         faster than set32, and the new value representation usually doesn't
7539         need set32.
7540
7541         * jit/JIT.cpp:
7542         * jit/JIT.h:
7543         * jit/JITInlineMethods.h:
7544         (JSC::JIT::emitLoadTag):
7545         (JSC::JIT::emitLoadPayload): Added helper functions for dealing with
7546         constants. Eventually, we should write special cases for all constants,
7547         but these are helpful in the short term.
7548
7549         * jit/JITOpcodes.cpp:
7550         (JSC::JIT::compileOpStrictEq):
7551         (JSC::JIT::emitSlow_op_stricteq):
7552         (JSC::JIT::emitSlow_op_nstricteq): teh opcodez.
7553
7554         * runtime/JSValue.h:
7555         (JSC::JSValue::):
7556         (JSC::JSValue::isDouble): Added a LowestTag for clarity.
7557
7558 2009-05-13  Geoffrey Garen  <ggaren@apple.com>
7559
7560         Reviewed by Sam Weinig.
7561         
7562         Fixed some bugs in host function calls.
7563         
7564         testapi now passes!
7565
7566         * jit/JIT.cpp: Changed some registers around to avoid overwriting edx:eax,
7567         which is how JSValues are now returned. Also changed the code that
7568         passes thisValue to pass the full 64bits of the value. Also added
7569         an #error compiler directive to other platform builds, since the JSValue
7570         return signature probably won't return in edx:eax on those platforms,
7571         and we'll have to investigate a solution.
7572
7573 2009-05-13  Geoffrey Garen  <ggaren@apple.com>
7574
7575         Reviewed by Sam Weinig.
7576         
7577         Removed parameters from functions that are intended never to use their
7578         parameters.
7579
7580         * jit/JITPropertyAccess.cpp:
7581         (JSC::JIT::emitSlow_op_get_by_val):
7582         (JSC::JIT::emitSlow_op_put_by_val):
7583
7584 2009-05-13  Geoffrey Garen  <ggaren@apple.com>
7585
7586         Reviewed by Sam Weinig.
7587         
7588         Ported op_instance_of from TOT. It's basically the same, but some register
7589         stuff changed to memory stuff.
7590
7591         * jit/JITInlineMethods.h:
7592         (JSC::JIT::emitPutJITStubArgFromVirtualRegister):
7593         (JSC::JIT::emitStore): Changed to use helper functions.
7594
7595         * jit/JITOpcodes.cpp:
7596         (JSC::JIT::emit_op_instanceof):
7597         (JSC::JIT::emitSlow_op_instanceof): Ported from TOT.
7598
7599 2009-05-13  Geoffrey Garen  <ggaren@apple.com>
7600
7601         Reviewed by Gavin Barraclough.
7602         
7603         Added a comment to explain an exception-handling subtelty that we found
7604         hard to remember when reviewing my last patch.
7605
7606         * jit/JITOpcodes.cpp:
7607         (JSC::JIT::emit_op_catch):
7608
7609 2009-05-13  Geoffrey Garen  <ggaren@apple.com>
7610
7611         Reviewed by Sam Weinig.
7612         
7613         Implemented try/catch.
7614
7615         * jit/JITOpcodes.cpp:
7616         (JSC::JIT::emit_op_throw): Updated to use JITStackFrame abstraction.
7617         (JSC::JIT::emit_op_catch): Filled out.
7618
7619 2009-05-13  Sam Weinig  <sam@webkit.org>
7620
7621         Reviewed by Geoffrey Garen.
7622
7623         Implemented op_loop_if_true, op_jfalse, op_jtrue, op_jeq_null and op_jneq_null
7624
7625         * jit/JITOpcodes.cpp:
7626         (JSC::JIT::emitSlow_op_instanceof): Moved from below to be next to its
7627         fast brother.
7628
7629         (JSC::JIT::emit_op_loop_if_true): Similar to the old version
7630         in that it tries to do the integer case first and reduce the
7631         number of jumps you might need to take.
7632         (JSC::JIT::emitSlow_op_loop_if_true):
7633
7634         (JSC::JIT::emit_op_jfalse): Very similar to op_loop_if_true, only
7635         the inverse and without a timeout check.
7636         (JSC::JIT::emitSlow_op_jfalse):
7637
7638         (JSC::JIT::emit_op_jtrue): Very similar to op_loop_if_true except
7639         without the timeout check.
7640         (JSC::JIT::emitSlow_op_jtrue):
7641
7642         (JSC::JIT::emit_op_jeq_null): Very similar to the implementation
7643         of op_eq, except it takes jumps instead of copying the condition
7644         to a dst.
7645         (JSC::JIT::emit_op_jneq_null): Ditto but for op_neq.
7646
7647 2009-05-13  Geoffrey Garen  <ggaren@apple.com>
7648
7649         Reviewed by Sam Weinig.
7650         
7651         Implemented op_call_varargs.
7652
7653         * jit/JITCall.cpp:
7654         (JSC::JIT::compileOpCallVarargsSetupArgs):
7655         (JSC::JIT::compileOpCallVarargs):
7656         (JSC::JIT::emit_op_call):
7657         (JSC::JIT::emit_op_call_eval):
7658         (JSC::JIT::emit_op_load_varargs):
7659         (JSC::JIT::emit_op_call_varargs):
7660         (JSC::JIT::emit_op_construct):
7661         * jit/JITOpcodes.cpp:
7662         (JSC::JIT::emit_op_jneq_ptr):
7663
7664 2009-05-13  Geoffrey Garen  <ggaren@apple.com>
7665
7666         Reviewed by Sam Weinig.
7667         
7668         Implemented op_call_eval.
7669
7670         * jit/JITCall.cpp:
7671         (JSC::JIT::compileOpCallVarargsSetupArgs):
7672         (JSC::JIT::compileOpCall):
7673         * jit/JITStubCall.h:
7674         (JSC::CallEvalJITStub::CallEvalJITStub):
7675
7676 2009-05-13  Sam Weinig  <sam@webkit.org>
7677
7678         Reviewed by Gavin Barraclough.
7679
7680         Implemented op_not. (Gavin did most of the work!)
7681
7682         * jit/JITOpcodes.cpp:
7683         (JSC::JIT::emit_op_not):
7684         (JSC::JIT::emitSlow_op_not):
7685
7686 2009-05-13  Geoffrey Garen  <ggaren@apple.com>
7687
7688         Reviewed by Sam Weinig.
7689         
7690         Implemented op_global_resolve.
7691
7692         * jit/JITOpcodes.cpp:
7693         (JSC::JIT::emit_op_loop_if_less):
7694         (JSC::JIT::emit_op_loop_if_lesseq): Added back accidentally removed
7695         early returns. 
7696
7697         (JSC::JIT::emit_op_resolve_global):
7698         * jit/JITStubs.cpp:
7699         (JSC::JITStubs::cti_op_resolve_global): Pretty similar to the old code,
7700         but we need two reads and a TimesEight step in order to account for the
7701         64bit value size.
7702
7703         * jit/JITStubs.h:
7704         (JSC::): Slightly tweaked this code to specialize for a JSGlobalObject*,
7705         to avoid having to pass an irrelevant tag pointer to the stub.
7706
7707 2009-05-13  Sam Weinig  <sam@webkit.org>
7708
7709         Reviewed by Geoffrey Garen.
7710
7711         Implemented op_to_jsnumber.
7712
7713         * jit/JITOpcodes.cpp:
7714         (JSC::JIT::emit_op_to_jsnumber):
7715         (JSC::JIT::emitSlow_op_to_jsnumber):
7716
7717 2009-05-13  Sam Weinig  <sam@webkit.org>
7718
7719         Reviewed by Geoffrey Garen.
7720
7721         Implemented op_convert_this.
7722
7723         * jit/JITOpcodes.cpp:
7724         (JSC::JIT::emit_op_convert_this):
7725         (JSC::JIT::emitSlow_op_convert_this):
7726
7727 2009-05-13  Geoffrey Garen  <ggaren@apple.com>
7728
7729         Reviewed by Sam Weinig.
7730         
7731         Got basic JS function and constructor calls working.
7732
7733         * jit/JIT.cpp:
7734         (JSC::JIT::privateCompileCTIMachineTrampolines):
7735         * jit/JIT.h:
7736         * jit/JITCall.cpp:
7737         (JSC::JIT::compileOpCallSetupArgs):
7738         (JSC::JIT::compileOpCallVarargsSetupArgs):
7739         (JSC::JIT::compileOpConstructSetupArgs):
7740         (JSC::JIT::emit_op_ret):
7741         (JSC::JIT::emit_op_construct_verify):
7742         (JSC::JIT::emitSlow_op_construct_verify):
7743         (JSC::JIT::emitSlow_op_call):
7744         (JSC::JIT::emitSlow_op_call_eval):
7745         (JSC::JIT::emitSlow_op_call_varargs):
7746         (JSC::JIT::emitSlow_op_construct):
7747         (JSC::JIT::compileOpCall): Filled out these cases, with call_eval #if'd out.
7748
7749         * jit/JITInlineMethods.h:
7750         (JSC::JIT::emitPutJITStubArgFromVirtualRegister):
7751         (JSC::JIT::emitLoad): Restored some legacy "*CTIArg*" functions,
7752         since I wanted to avoid the complexity of revamping the API here while
7753         trying to bring it up. Eventually, we should re-remove all of these functions.
7754
7755         (JSC::JIT::recordJumpTarget): Removed unnecessary macro cruft. You will
7756         not silence me, Sam Weinig! The world will know that you are a crufty,
7757         crufty, crufty programmer!!!
7758
7759         * jit/JITOpcodes.cpp:
7760         * jit/JITStubs.cpp:
7761         (JSC::):
7762         * jit/JITStubs.h: Changed up some offsets in the JITStackFrame class, since
7763         and off-by-one error was causing stack misalignment.
7764
7765 2009-05-13  Sam Weinig  <sam@webkit.org>
7766
7767         Reviewed by Geoffrey Garen.
7768
7769         Implement op_eq_null and op_neq_null.
7770
7771         * assembler/MacroAssemblerX86Common.h:
7772         (JSC::MacroAssemblerX86Common::set8):
7773         (JSC::MacroAssemblerX86Common::setTest8):
7774         * jit/JITOpcodes.cpp:
7775         (JSC::JIT::emit_op_stricteq):
7776         (JSC::JIT::emitSlow_op_stricteq):
7777         (JSC::JIT::emit_op_nstricteq):
7778         (JSC::JIT::emitSlow_op_nstricteq):
7779         (JSC::JIT::emit_op_eq_null):
7780         (JSC::JIT::emit_op_neq_null):
7781         * jsc.cpp:
7782
7783 2009-05-12  Sam Weinig  <sam@webkit.org>
7784
7785         Reviewed by Geoffrey Garen.
7786
7787         Implement op_new_error.
7788
7789         * jit/JITOpcodes.cpp:
7790         (JSC::JIT::emit_op_new_error):
7791         * jit/JITStubCall.h:
7792         (JSC::JITStubCall::addArgument): Add a version of addArgument
7793         that takes a constant JSValue.
7794
7795 2009-05-12  Sam Weinig  <sam@webkit.org>
7796
7797         Reviewed by Geoffrey Garen.
7798
7799         Remove now unused emitGetVariableObjectRegister and emitPutVariableObjectRegister.
7800
7801         * jit/JIT.cpp:
7802         * jit/JIT.h:
7803
7804 2009-05-12  Sam Weinig  <sam@webkit.org>
7805
7806         Reviewed by Geoffrey Garen.
7807
7808         Implement op_to_primitive and op_next_pname.
7809
7810         * jit/JITOpcodes.cpp:
7811         (JSC::JIT::emitSlow_op_construct_verify):
7812         (JSC::JIT::emit_op_to_primitive):
7813         (JSC::JIT::emitSlow_op_to_primitive):
7814         (JSC::JIT::emitSlow_op_loop_if_true):
7815         (JSC::JIT::emit_op_jtrue):
7816         (JSC::JIT::emit_op_next_pname):
7817
7818 2009-05-12  Sam Weinig  <sam@webkit.org>
7819
7820         Reviewed by Geoffrey Garen.
7821
7822         Add op_get_global_var, op_put_global_var, emit_op_get_scoped_var, emit_op_put_scoped_var and
7823         op_unexpected_load.
7824
7825         * jit/JIT.h:
7826         * jit/JITInlineMethods.h:
7827         (JSC::JIT::tagFor):
7828         (JSC::JIT::payloadFor):
7829         (JSC::JIT::emitLoad):
7830         (JSC::JIT::emitStore):
7831         (JSC::JIT::emitLoadReturnValue):
7832         * jit/JITOpcodes.cpp:
7833         (JSC::JIT::emit_op_get_global_var):
7834         (JSC::JIT::emit_op_put_global_var):
7835         (JSC::JIT::emit_op_get_scoped_var):
7836         (JSC::JIT::emit_op_put_scoped_var):
7837         (JSC::JIT::emit_op_unexpected_load):
7838
7839 2009-05-12  Geoffrey Garen  <ggaren@apple.com>
7840
7841         Reviewed by Sam Weinig.
7842
7843         Added overflow handling to op_sub.
7844
7845         * jit/JIT.h:
7846         * jit/JITArithmetic.cpp:
7847         (JSC::JIT::emitSlow_op_sub):
7848         (JSC::JIT::emitSlowSub32InPlaceLeft):
7849
7850 2009-05-12  Sam Weinig  <sam@webkit.org>
7851
7852         Reviewed by Geoffrey Garen.
7853
7854         Remove a function call by folding op_get_by_id and op_put_by_id into
7855         their respective compile functions.
7856
7857         * jit/JIT.h:
7858         * jit/JITPropertyAccess.cpp:
7859         (JSC::JIT::emit_op_get_by_id):
7860         (JSC::JIT::emitSlow_op_get_by_id):
7861         (JSC::JIT::emit_op_put_by_id):
7862         (JSC::JIT::emitSlow_op_put_by_id):
7863
7864 2009-05-12  Sam Weinig  <sam@webkit.org>
7865
7866         Reviewed by Geoffrey Garen.
7867
7868         Make JITStubCall work in 64bit by making the stack index
7869         step dependent on the size of void*.
7870
7871         * jit/JITStubCall.h:
7872         (JSC::JITStubCall::JITStubCall):
7873         (JSC::JITStubCall::addArgument):
7874
7875 2009-05-12  Sam Weinig  <sam@webkit.org>
7876
7877         Reviewed by Geoffrey Garen.
7878
7879         Implement simple version of property access opcodes
7880         which just call a stub functions.
7881
7882         * jit/JITOpcodes.cpp:
7883         * jit/JITPropertyAccess.cpp:
7884         (JSC::JIT::emitSlow_op_put_by_id):
7885         (JSC::JIT::emitSlow_op_get_by_id):
7886         (JSC::JIT::emit_op_get_by_val):
7887         (JSC::JIT::emitSlow_op_get_by_val):
7888         (JSC::JIT::emit_op_put_by_val):
7889         (JSC::JIT::emitSlow_op_put_by_val):
7890         (JSC::JIT::emit_op_put_by_index):
7891         (JSC::JIT::emit_op_put_getter):
7892         (JSC::JIT::emit_op_put_setter):
7893         (JSC::JIT::emit_op_del_by_id):
7894         (JSC::JIT::compileGetByIdHotPath):
7895         (JSC::JIT::compilePutByIdHotPath):
7896         * jit/JITStubCall.h:
7897         (JSC::JITStubCall::addArgument):
7898         * jsc.cpp:
7899
7900 2009-05-12  Geoffrey Garen  <ggaren@apple.com>
7901
7902         Reviewed by Sam Weinig.
7903         
7904         Added work-around for XCode debugging echo problem.
7905
7906         * jsc.cpp:
7907         (runInteractive):
7908
7909 2009-05-12  Geoffrey Garen  <ggaren@apple.com>
7910
7911         Reviewed by Sam Weinig.
7912         
7913         Added overflow handling to op_add.
7914
7915         * jit/JIT.h:
7916         * jit/JITArithmetic.cpp:
7917         (JSC::JIT::emitSlow_op_add):
7918         (JSC::JIT::emitSlowAdd32InPlace):
7919
7920 2009-05-12  Sam Weinig  <sam@webkit.org>
7921
7922         Reviewed by Geoffrey Garen.
7923
7924         Add slow cases for op_jnless or emit_op_jnlesseq.
7925
7926         * jit/JITArithmetic.cpp:
7927         (JSC::JIT::emitSlow_op_jnless):
7928         (JSC::JIT::emitSlow_op_jnlesseq):
7929
7930 2009-05-12  Sam Weinig  <sam@webkit.org>
7931
7932         Reviewed by Geoffrey Garen.
7933
7934         Add implementations for op_jnless, emit_op_jnlesseq, op_loop_if_less and op_loop_if_lesseq.
7935         No slow cases for op_jnless or emit_op_jnlesseq yet.
7936
7937         * jit/JITArithmetic.cpp:
7938         (JSC::JIT::emit_op_jnless):
7939         (JSC::JIT::emitSlow_op_jnless):
7940         (JSC::JIT::emit_op_jnlesseq):
7941         (JSC::JIT::emitSlow_op_jnlesseq):
7942         * jit/JITOpcodes.cpp:
7943         (JSC::JIT::emit_op_loop_if_less):
7944         (JSC::JIT::emitSlow_op_loop_if_less):
7945         (JSC::JIT::emit_op_loop_if_lesseq):
7946         (JSC::JIT::emitSlow_op_loop_if_lesseq):
7947
7948 2009-05-12  Sam Weinig  <sam@webkit.org>
7949
7950         Reviewed by Geoffrey Garen.
7951
7952         Turn the RECORD_JUMP_TARGET macro into an inline function.
7953
7954         * jit/JIT.h:
7955         * jit/JITInlineMethods.h:
7956         (JSC::JIT::recordJumpTarget):
7957         * jit/JITOpcodes.cpp:
7958         (JSC::JIT::emit_op_jmp):
7959         (JSC::JIT::emit_op_jsr):
7960         (JSC::JIT::emit_op_jmp_scopes):
7961
7962 2009-05-12  Sam Weinig  <sam@webkit.org>
7963
7964         Add MacroAssemblerX86Common::set8 to fix the build.
7965
7966         * assembler/MacroAssemblerX86Common.h:
7967         (JSC::MacroAssemblerX86Common::set8):
7968
7969 2009-05-12  Geoffrey Garen  <ggaren@apple.com>
7970
7971         Reviewed by Sam Weinig.
7972         
7973         Added overflow recovery for pre_inc and pre_dec.
7974         
7975         Turned some short-circuit code into early returns, as is the WebKit style.
7976
7977         * jit/JITArithmetic.cpp:
7978         (JSC::JIT::emit_op_post_inc):
7979         (JSC::JIT::emitSlow_op_post_inc):
7980         (JSC::JIT::emit_op_post_dec):
7981         (JSC::JIT::emitSlow_op_post_dec):
7982         (JSC::JIT::emitSlow_op_pre_inc):
7983         (JSC::JIT::emitSlow_op_pre_dec):
7984
7985 2009-05-12  Sam Weinig  <sam@webkit.org>
7986
7987         Reviewed by Geoffrey Garen.
7988
7989         Implement op_jmp, op_loop, op_eq and op_neq.
7990
7991         * jit/JITOpcodes.cpp:
7992         (JSC::JIT::emit_op_jmp):
7993         (JSC::JIT::emit_op_loop):
7994         (JSC::JIT::emit_op_eq):
7995         (JSC::JIT::emitSlow_op_eq):
7996         (JSC::JIT::emit_op_neq):
7997         (JSC::JIT::emitSlow_op_neq):
7998         (JSC::JIT::emit_op_enter):
7999         (JSC::JIT::emit_op_enter_with_activation):
8000
8001 2009-05-12  Sam Weinig  <sam@webkit.org>
8002
8003         Reviewed by Geoffrey Garen.
8004
8005         Implement the slow cases for arithmetic opcodes.
8006
8007         * jit/JITArithmetic.cpp:
8008         (JSC::JIT::emitSlow_op_lshift):
8009         (JSC::JIT::emitSlow_op_rshift):
8010         (JSC::JIT::emitSlow_op_bitand):
8011         (JSC::JIT::emitSlow_op_bitor):
8012         (JSC::JIT::emitSlow_op_bitxor):
8013         (JSC::JIT::emitSlow_op_bitnot):
8014         (JSC::JIT::emitSlow_op_sub):
8015         (JSC::JIT::emitSlow_op_mul):
8016         (JSC::JIT::emitSlow_op_mod):
8017         (JSC::JIT::emit_op_mod):
8018
8019 2009-05-12  Sam Weinig  <sam@webkit.org>
8020
8021         Reviewed by Geoffrey Garen.
8022
8023         Implement op_bitnot.
8024
8025         * assembler/MacroAssemblerX86Common.h:
8026         (JSC::MacroAssemblerX86Common::not32):
8027         * assembler/X86Assembler.h:
8028         (JSC::X86Assembler::notl_m):
8029         * jit/JITArithmetic.cpp:
8030         (JSC::JIT::emit_op_bitnot):
8031
8032 2009-05-12  Sam Weinig  <sam@webkit.org>
8033
8034         Reviewed by Geoffrey Garen.
8035
8036         Add arithmetic opcode implementations from the old nitro-extreme branch.
8037
8038         * jit/JIT.h:
8039         * jit/JITArithmetic.cpp:
8040         (JSC::JIT::emit_op_jnless):
8041         (JSC::JIT::emitSlow_op_jnless):
8042         (JSC::JIT::emit_op_jnlesseq):
8043         (JSC::JIT::emitSlow_op_jnlesseq):
8044         (JSC::JIT::emit_op_lshift):
8045         (JSC::JIT::emitSlow_op_lshift):
8046         (JSC::JIT::emit_op_rshift):
8047         (JSC::JIT::emitSlow_op_rshift):
8048         (JSC::JIT::emit_op_bitand):
8049         (JSC::JIT::emitBitAnd32Constant):
8050         (JSC::JIT::emitBitAnd32InPlace):
8051         (JSC::JIT::emit_op_bitor):
8052         (JSC::JIT::emitSlow_op_bitor):
8053         (JSC::JIT::emitBitOr32Constant):
8054         (JSC::JIT::emitBitOr32InPlace):
8055         (JSC::JIT::emit_op_bitxor):
8056         (JSC::JIT::emitSlow_op_bitxor):
8057         (JSC::JIT::emitBitXor32Constant):
8058         (JSC::JIT::emitBitXor32InPlace):
8059         (JSC::JIT::emit_op_bitnot):
8060         (JSC::JIT::emitSlow_op_bitnot):
8061         (JSC::JIT::emit_op_post_inc):
8062         (JSC::JIT::emitSlow_op_post_inc):
8063         (JSC::JIT::emit_op_post_dec):
8064         (JSC::JIT::emitSlow_op_post_dec):
8065         (JSC::JIT::emit_op_pre_inc):
8066         (JSC::JIT::emitSlow_op_pre_inc):
8067         (JSC::JIT::emit_op_pre_dec):
8068         (JSC::JIT::emitSlow_op_pre_dec):
8069         (JSC::JIT::emit_op_add):
8070         (JSC::JIT::emitAdd32Constant):
8071         (JSC::JIT::emitAdd32InPlace):
8072         (JSC::JIT::emitSlow_op_add):
8073         (JSC::JIT::emit_op_sub):
8074         (JSC::JIT::emitSlow_op_sub):
8075         (JSC::JIT::emitSub32ConstantLeft):
8076         (JSC::JIT::emitSub32ConstantRight):
8077         (JSC::JIT::emitSub32InPlaceLeft):
8078         (JSC::JIT::emitSub32InPlaceRight):
8079         (JSC::JIT::emit_op_mul):
8080         (JSC::JIT::emitSlow_op_mul):
8081         (JSC::JIT::emitMul32Constant):
8082         (JSC::JIT::emitMul32InPlace):
8083         (JSC::JIT::emit_op_mod):
8084         (JSC::JIT::emitSlow_op_mod):
8085         * jit/JITOpcodes.cpp:
8086
8087 2009-05-12  Geoffrey Garen  <ggaren@apple.com>
8088
8089         Removed JIT_OPTIMIZE_ARITHMETIC setting, since it was all about 32bit
8090         value representations.
8091         
8092         Added JSAPIValueWrapper to the repository.
8093
8094         * jit/JIT.h:
8095         * jit/JITArithmetic.cpp:
8096         * runtime/JSAPIValueWrapper.cpp: Added.
8097         (JSC::JSAPIValueWrapper::toPrimitive):
8098         (JSC::JSAPIValueWrapper::getPrimitiveNumber):
8099         (JSC::JSAPIValueWrapper::toBoolean):
8100         (JSC::JSAPIValueWrapper::toNumber):
8101         (JSC::JSAPIValueWrapper::toString):
8102         (JSC::JSAPIValueWrapper::toObject):
8103         * runtime/JSAPIValueWrapper.h: Added.
8104         (JSC::JSAPIValueWrapper::value):
8105         (JSC::JSAPIValueWrapper::isAPIValueWrapper):
8106         (JSC::JSAPIValueWrapper::JSAPIValueWrapper):
8107         (JSC::jsAPIValueWrapper):
8108         * wtf/Platform.h:
8109
8110 2009-05-12  Geoffrey Garen  <ggaren@apple.com>
8111
8112         Turned on the JIT and got it building and running the most trivial of
8113         programs.
8114         
8115         All configurable optimizations are turned off, and a few opcodes are ad
8116         hoc #if'd out.
8117         
8118         So far, I've only merged op_mov and op_end, but some stub-reliant
8119         opcodes work as-is from TOT.
8120         
8121         * bytecode/CodeBlock.cpp:
8122         (JSC::CodeBlock::~CodeBlock):
8123         * bytecode/CodeBlock.h:
8124         * jit/JIT.cpp:
8125         (JSC::JIT::compileOpStrictEq):
8126         * jit/JIT.h:
8127         * jit/JITArithmetic.cpp:
8128         (JSC::JIT::emit_op_lshift):
8129         (JSC::JIT::emitSlow_op_lshift):
8130         (JSC::JIT::emit_op_rshift):
8131         (JSC::JIT::emitSlow_op_rshift):
8132         (JSC::JIT::emit_op_jnless):
8133         (JSC::JIT::emitSlow_op_jnless):
8134         (JSC::JIT::emit_op_jnlesseq):
8135         (JSC::JIT::emitSlow_op_jnlesseq):
8136         (JSC::JIT::emit_op_bitand):
8137         (JSC::JIT::emitSlow_op_bitand):
8138         (JSC::JIT::emit_op_post_inc):
8139         (JSC::JIT::emitSlow_op_post_inc):
8140         (JSC::JIT::emit_op_post_dec):
8141         (JSC::JIT::emitSlow_op_post_dec):
8142         (JSC::JIT::emit_op_pre_inc):
8143         (JSC::JIT::emitSlow_op_pre_inc):
8144         (JSC::JIT::emit_op_pre_dec):
8145         (JSC::JIT::emitSlow_op_pre_dec):
8146         (JSC::JIT::emit_op_mod):
8147         (JSC::JIT::emitSlow_op_mod):
8148         (JSC::JIT::emit_op_add):
8149         (JSC::JIT::emit_op_mul):
8150         (JSC::JIT::emit_op_sub):
8151         (JSC::JIT::compileBinaryArithOpSlowCase):
8152         (JSC::JIT::emitSlow_op_add):
8153         (JSC::JIT::emitSlow_op_mul):
8154         * jit/JITCall.cpp:
8155         (JSC::JIT::compileOpCallInitializeCallFrame):
8156         (JSC::JIT::compileOpConstructSetupArgs):
8157         (JSC::JIT::compileOpCallVarargs):
8158         (JSC::JIT::compileOpCall):
8159         (JSC::JIT::compileOpCallSlowCase):
8160         * jit/JITInlineMethods.h:
8161         (JSC::JIT::getConstantOperandImmediateInt):
8162         (JSC::JIT::isOperandConstantImmediateInt):
8163         (JSC::JIT::emitInitRegister):
8164         (JSC::JIT::addSlowCase):
8165         (JSC::JIT::addJump):
8166         (JSC::JIT::emitJumpSlowToHot):
8167         (JSC::JIT::tagFor):
8168         (JSC::JIT::payloadFor):
8169         (JSC::JIT::emitLoad):
8170         (JSC::JIT::emitLoadReturnValue):
8171         (JSC::JIT::emitStore):
8172         (JSC::JIT::emitStoreReturnValue):
8173         * jit/JITOpcodes.cpp:
8174         (JSC::JIT::emit_op_mov):
8175         (JSC::JIT::emit_op_end):
8176         (JSC::JIT::emit_op_jmp):
8177         (JSC::JIT::emit_op_loop):
8178         (JSC::JIT::emit_op_loop_if_less):
8179         (JSC::JIT::emit_op_loop_if_lesseq):
8180         (JSC::JIT::emit_op_instanceof):
8181         (JSC::JIT::emit_op_get_global_var):
8182         (JSC::JIT::emit_op_put_global_var):
8183         (JSC::JIT::emit_op_get_scoped_var):
8184         (JSC::JIT::emit_op_put_scoped_var):
8185         (JSC::JIT::emit_op_tear_off_activation):
8186         (JSC::JIT::emit_op_ret):
8187         (JSC::JIT::emit_op_construct_verify):
8188         (JSC::JIT::emit_op_to_primitive):
8189         (JSC::JIT::emit_op_loop_if_true):
8190         (JSC::JIT::emit_op_resolve_global):
8191         (JSC::JIT::emit_op_not):
8192         (JSC::JIT::emit_op_jfalse):
8193         (JSC::JIT::emit_op_jeq_null):
8194         (JSC::JIT::emit_op_jneq_null):
8195         (JSC::JIT::emit_op_jneq_ptr):
8196         (JSC::JIT::emit_op_unexpected_load):
8197         (JSC::JIT::emit_op_eq):
8198         (JSC::JIT::emit_op_bitnot):
8199         (JSC::JIT::emit_op_jtrue):
8200         (JSC::JIT::emit_op_neq):
8201         (JSC::JIT::emit_op_bitxor):
8202         (JSC::JIT::emit_op_bitor):
8203         (JSC::JIT::emit_op_throw):
8204         (JSC::JIT::emit_op_next_pname):
8205         (JSC::JIT::emit_op_push_scope):
8206         (JSC::JIT::emit_op_to_jsnumber):
8207         (JSC::JIT::emit_op_push_new_scope):
8208         (JSC::JIT::emit_op_catch):
8209         (JSC::JIT::emit_op_switch_imm):
8210         (JSC::JIT::emit_op_switch_char):
8211         (JSC::JIT::emit_op_switch_string):
8212         (JSC::JIT::emit_op_new_error):
8213         (JSC::JIT::emit_op_eq_null):
8214         (JSC::JIT::emit_op_neq_null):
8215         (JSC::JIT::emit_op_convert_this):
8216         (JSC::JIT::emit_op_profile_will_call):
8217         (JSC::JIT::emit_op_profile_did_call):
8218         (JSC::JIT::emitSlow_op_construct_verify):
8219         (JSC::JIT::emitSlow_op_get_by_val):
8220         (JSC::JIT::emitSlow_op_loop_if_less):
8221         (JSC::JIT::emitSlow_op_loop_if_lesseq):
8222         (JSC::JIT::emitSlow_op_put_by_val):
8223         (JSC::JIT::emitSlow_op_not):
8224         (JSC::JIT::emitSlow_op_instanceof):
8225         * jit/JITPropertyAccess.cpp:
8226         (JSC::JIT::emit_op_get_by_val):
8227         (JSC::JIT::emit_op_put_by_val):
8228         (JSC::JIT::emit_op_put_by_index):
8229         (JSC::JIT::emit_op_put_getter):
8230         (JSC::JIT::emit_op_put_setter):
8231         (JSC::JIT::emit_op_del_by_id):
8232         (JSC::JIT::compileGetByIdHotPath):
8233         (JSC::JIT::compilePutByIdHotPath):
8234         * jit/JITStubCall.h:
8235         (JSC::JITStubCall::JITStubCall):
8236         (JSC::JITStubCall::addArgument):
8237         (JSC::JITStubCall::call):
8238         (JSC::JITStubCall::):
8239         (JSC::CallEvalJITStub::CallEvalJITStub):
8240         * jit/JITStubs.cpp:
8241         (JSC::):
8242         (JSC::JITStubs::cti_op_add):
8243         (JSC::JITStubs::cti_op_pre_inc):
8244         (JSC::JITStubs::cti_op_mul):
8245         (JSC::JITStubs::cti_op_get_by_val):
8246         (JSC::JITStubs::cti_op_get_by_val_string):
8247         (JSC::JITStubs::cti_op_get_by_val_byte_array):
8248         (JSC::JITStubs::cti_op_sub):
8249         (JSC::JITStubs::cti_op_put_by_val):
8250         (JSC::JITStubs::cti_op_put_by_val_array):
8251         (JSC::JITStubs::cti_op_put_by_val_byte_array):
8252         (JSC::JITStubs::cti_op_negate):
8253         (JSC::JITStubs::cti_op_div):
8254         (JSC::JITStubs::cti_op_pre_dec):
8255         (JSC::JITStubs::cti_op_post_inc):
8256         (JSC::JITStubs::cti_op_eq):
8257         (JSC::JITStubs::cti_op_lshift):
8258         (JSC::JITStubs::cti_op_bitand):
8259         (JSC::JITStubs::cti_op_rshift):
8260         (JSC::JITStubs::cti_op_bitnot):
8261         (JSC::JITStubs::cti_op_mod):
8262         (JSC::JITStubs::cti_op_neq):
8263         (JSC::JITStubs::cti_op_post_dec):
8264         (JSC::JITStubs::cti_op_urshift):
8265         (JSC::JITStubs::cti_op_bitxor):
8266         (JSC::JITStubs::cti_op_bitor):
8267         (JSC::JITStubs::cti_op_switch_imm):
8268         * jit/JITStubs.h:
8269         * runtime/JSArray.cpp:
8270         (JSC::JSArray::JSArray):
8271         * runtime/JSFunction.cpp:
8272         (JSC::JSFunction::~JSFunction):
8273         * runtime/JSValue.h:
8274         (JSC::JSValue::payload):
8275         * wtf/Platform.h:
8276
8277 2009-05-07  Sam Weinig  <sam@webkit.org>
8278
8279         Reviewed by Geoffrey Garen.
8280
8281         Add some new MacroAssembler and assembler functions that will be needed shortly.
8282
8283         * assembler/MacroAssemblerX86Common.h:
8284         (JSC::MacroAssemblerX86Common::add32):
8285         (JSC::MacroAssemblerX86Common::and32):
8286         (JSC::MacroAssemblerX86Common::mul32):
8287         (JSC::MacroAssemblerX86Common::neg32):
8288         (JSC::MacroAssemblerX86Common::or32):
8289         (JSC::MacroAssemblerX86Common::sub32):
8290         (JSC::MacroAssemblerX86Common::xor32):
8291         (JSC::MacroAssemblerX86Common::branchAdd32):
8292         (JSC::MacroAssemblerX86Common::branchMul32):
8293         (JSC::MacroAssemblerX86Common::branchSub32):
8294         * assembler/X86Assembler.h:
8295         (JSC::X86Assembler::):
8296         (JSC::X86Assembler::addl_rm):
8297         (JSC::X86Assembler::andl_mr):
8298         (JSC::X86Assembler::andl_rm):
8299         (JSC::X86Assembler::andl_im):
8300         (JSC::X86Assembler::negl_r):
8301         (JSC::X86Assembler::notl_r):
8302         (JSC::X86Assembler::orl_rm):
8303         (JSC::X86Assembler::orl_im):
8304         (JSC::X86Assembler::subl_rm):
8305         (JSC::X86Assembler::xorl_mr):
8306         (JSC::X86Assembler::xorl_rm):
8307         (JSC::X86Assembler::xorl_im):
8308         (JSC::X86Assembler::imull_mr):
8309
8310 2009-05-11  Sam Weinig  <sam@webkit.org>
8311
8312         Reviewed by Cameron Zwarich.
8313
8314         Remove the NumberHeap.
8315
8316         * JavaScriptCore.exp:
8317         * runtime/Collector.cpp:
8318         (JSC::Heap::Heap):
8319         (JSC::Heap::destroy):
8320         (JSC::Heap::recordExtraCost):
8321         (JSC::Heap::heapAllocate):
8322         (JSC::Heap::markConservatively):
8323         (JSC::Heap::sweep):
8324         (JSC::Heap::collect):
8325         (JSC::Heap::objectCount):
8326         (JSC::Heap::statistics):
8327         (JSC::typeName):
8328         (JSC::Heap::isBusy):
8329         * runtime/Collector.h:
8330         (JSC::Heap::globalData):
8331         * runtime/JSCell.h:
8332
8333 2009-05-11  Geoffrey Garen  <ggaren@apple.com>
8334
8335         Reviewed by Sam Weinig.
8336
8337         Land initial commit of new number representation for 32 bit platforms,
8338         with JIT disabled.
8339
8340         * API/APICast.h:
8341         (toJS):
8342         (toRef):
8343         * API/JSCallbackObjectFunctions.h:
8344         (JSC::::hasInstance):
8345         (JSC::::toNumber):
8346         (JSC::::toString):
8347         * API/tests/testapi.c:
8348         (EvilExceptionObject_convertToType):
8349         * AllInOneFile.cpp:
8350         * JavaScriptCore.exp:
8351         * JavaScriptCore.xcodeproj/project.pbxproj:
8352         * bytecode/CodeBlock.cpp:
8353         (JSC::valueToSourceString):
8354         * bytecompiler/BytecodeGenerator.cpp:
8355         (JSC::BytecodeGenerator::emitLoad):
8356         (JSC::BytecodeGenerator::emitUnexpectedLoad):
8357         (JSC::keyForImmediateSwitch):
8358         * bytecompiler/BytecodeGenerator.h:
8359         * interpreter/Interpreter.cpp:
8360         (JSC::Interpreter::dumpRegisters):
8361         (JSC::Interpreter::privateExecute):
8362         * parser/Nodes.cpp:
8363         (JSC::ArrayNode::emitBytecode):
8364         (JSC::processClauseList):
8365         * runtime/ArgList.h:
8366         * runtime/Collector.h:
8367         (JSC::sizeof):
8368         * runtime/DateMath.cpp:
8369         * runtime/ExceptionHelpers.h:
8370         * runtime/InitializeThreading.cpp:
8371         * runtime/JSArray.cpp:
8372         (JSC::JSArray::JSArray):
8373         * runtime/JSCell.cpp:
8374         * runtime/JSCell.h:
8375         (JSC::JSCell::isAPIValueWrapper):
8376         (JSC::JSValue::isString):
8377         (JSC::JSValue::isGetterSetter):
8378         (JSC::JSValue::isObject):
8379         (JSC::JSValue::getString):
8380         (JSC::JSValue::getObject):
8381         (JSC::JSValue::getCallData):
8382         (JSC::JSValue::getConstructData):
8383         (JSC::JSValue::getUInt32):
8384         (JSC::JSValue::marked):
8385         (JSC::JSValue::toPrimitive):
8386         (JSC::JSValue::getPrimitiveNumber):
8387         (JSC::JSValue::toBoolean):
8388         (JSC::JSValue::toNumber):
8389         (JSC::JSValue::toString):
8390         (JSC::JSValue::needsThisConversion):
8391         (JSC::JSValue::toThisString):
8392         (JSC::JSValue::getJSNumber):
8393         (JSC::JSValue::toObject):
8394         (JSC::JSValue::toThisObject):
8395         * runtime/JSGlobalData.cpp:
8396         (JSC::JSGlobalData::JSGlobalData):
8397         * runtime/JSGlobalData.h:
8398         * runtime/JSGlobalObject.h:
8399         (JSC::Structure::prototypeForLookup):
8400         * runtime/JSGlobalObjectFunctions.cpp:
8401         (JSC::globalFuncParseInt):
8402         * runtime/JSImmediate.h:
8403         * runtime/JSNumberCell.cpp: Removed.
8404         * runtime/JSNumberCell.h: Removed.
8405         * runtime/JSObject.h:
8406         (JSC::JSValue::get):
8407         (JSC::JSValue::put):
8408         * runtime/JSString.h:
8409         (JSC::JSValue::toThisJSString):
8410         * runtime/JSValue.cpp:
8411         (JSC::JSValue::toInteger):
8412         (JSC::JSValue::toIntegerPreserveNaN):
8413         (JSC::JSValue::toObjectSlowCase):
8414         (JSC::JSValue::toThisObjectSlowCase):
8415         (JSC::JSValue::synthesizeObject):
8416         (JSC::JSValue::synthesizePrototype):
8417         (JSC::JSValue::description):
8418         (JSC::nonInlineNaN):
8419         * runtime/JSValue.h:
8420         (JSC::JSValue::):
8421         (JSC::EncodedJSValueHashTraits::emptyValue):
8422         (JSC::jsNaN):
8423         (JSC::operator==):
8424         (JSC::operator!=):
8425         (JSC::toInt32):
8426         (JSC::toUInt32):
8427         (JSC::JSValue::encode):
8428         (JSC::JSValue::decode):
8429         (JSC::JSValue::JSValue):
8430         (JSC::JSValue::operator bool):
8431         (JSC::JSValue::operator==):
8432         (JSC::JSValue::operator!=):
8433         (JSC::JSValue::isUndefined):
8434         (JSC::JSValue::isNull):
8435         (JSC::JSValue::isUndefinedOrNull):
8436         (JSC::JSValue::isCell):
8437         (JSC::JSValue::isInt32):
8438         (JSC::JSValue::isUInt32):
8439         (JSC::JSValue::isDouble):
8440         (JSC::JSValue::isTrue):
8441         (JSC::JSValue::isFalse):
8442         (JSC::JSValue::tag):
8443         (JSC::JSValue::asInt32):
8444         (JSC::JSValue::asUInt32):
8445         (JSC::JSValue::asDouble):
8446         (JSC::JSValue::asCell):
8447         (JSC::JSValue::isNumber):
8448         (JSC::JSValue::isBoolean):
8449         (JSC::JSValue::getBoolean):
8450         (JSC::JSValue::uncheckedGetNumber):
8451         (JSC::JSValue::toJSNumber):
8452         (JSC::JSValue::getNumber):
8453         (JSC::JSValue::toInt32):
8454         (JSC::JSValue::toUInt32):
8455         * runtime/Operations.h:
8456         (JSC::JSValue::equal):
8457         (JSC::JSValue::equalSlowCaseInline):
8458         (JSC::JSValue::strictEqual):
8459         (JSC::JSValue::strictEqualSlowCaseInline):
8460         (JSC::jsLess):
8461         (JSC::jsLessEq):
8462         (JSC::jsAdd):
8463         * runtime/PropertySlot.h:
8464         * runtime/StringPrototype.cpp:
8465         (JSC::stringProtoFuncCharAt):
8466         (JSC::stringProtoFuncCharCodeAt):
8467         (JSC::stringProtoFuncIndexOf):
8468         * wtf/Platform.h:
8469
8470 === Start merge of nitro-extreme branch 2009-07-30 ===
8471
8472 2009-07-29  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
8473
8474         Reviewed by George Staikos.
8475
8476         Resolve class/struct mixup in forward declarations
8477         https://bugs.webkit.org/show_bug.cgi?id=27708
8478
8479         * API/JSClassRef.h:
8480         * bytecode/SamplingTool.h:
8481         * interpreter/Interpreter.h:
8482         * jit/JIT.h:
8483         * profiler/ProfileGenerator.h:
8484         * profiler/Profiler.h:
8485         * runtime/ClassInfo.h:
8486         * runtime/ExceptionHelpers.h:
8487         * runtime/JSByteArray.h:
8488         * runtime/JSCell.h:
8489         * runtime/JSFunction.h:
8490         * runtime/JSGlobalData.h:
8491         * runtime/JSObject.h:
8492         * runtime/JSString.h:
8493
8494 2009-07-28  Ada Chan  <adachan@apple.com>        
8495
8496         Reviewed by Darin Adler.
8497
8498         https://bugs.webkit.org/show_bug.cgi?id=27236
8499         - Implement TCMalloc_SystemRelease and TCMalloc_SystemCommit for Windows.
8500         - Use a background thread to periodically scavenge memory to release back to the system.
8501
8502         * wtf/FastMalloc.cpp:
8503         (WTF::TCMalloc_PageHeap::init):
8504         (WTF::TCMalloc_PageHeap::runScavengerThread):
8505         (WTF::TCMalloc_PageHeap::scavenge):
8506         (WTF::TCMalloc_PageHeap::shouldContinueScavenging):
8507         (WTF::TCMalloc_PageHeap::New):
8508         (WTF::TCMalloc_PageHeap::AllocLarge):
8509         (WTF::TCMalloc_PageHeap::Delete):
8510         (WTF::TCMalloc_PageHeap::GrowHeap):
8511         (WTF::sleep):
8512         (WTF::TCMalloc_PageHeap::scavengerThread):
8513         * wtf/TCSystemAlloc.cpp:
8514         (TCMalloc_SystemRelease):
8515         (TCMalloc_SystemCommit):
8516         * wtf/TCSystemAlloc.h:
8517
8518 2009-07-28  Xan Lopez  <xlopez@igalia.com>
8519
8520         Add new files, fixes distcheck.
8521
8522         * GNUmakefile.am:
8523
8524 2009-07-28  Csaba Osztrogonac  <oszi@inf.u-szeged.hu>
8525
8526         Reviewed by Simon Hausmann.
8527
8528         [Qt] Determining whether to use JIT or interpreter
8529         moved from JavaScriptCore.pri to Platform.h
8530
8531         * JavaScriptCore.pri:
8532         * wtf/Platform.h:
8533
8534 2009-07-27  Brian Weinstein  <bweinstein@apple.com>
8535
8536         Fix of misuse of sort command.
8537
8538         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
8539         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
8540
8541 2009-07-27  Brian Weinstein  <bweinstein@apple.com>
8542
8543         Build fix for Windows.
8544
8545         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
8546         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
8547
8548 2009-07-27  Gavin Barraclough  <barraclough@apple.com>
8549
8550         Rubber stamped by Oliver Hunt.
8551
8552         Fix tyop in JIT, renamed preverveReturnAddressAfterCall -> preserveReturnAddressAfterCall.
8553
8554         * jit/JIT.cpp:
8555         (JSC::JIT::privateCompile):
8556         (JSC::JIT::privateCompileCTIMachineTrampolines):
8557         * jit/JIT.h:
8558         * jit/JITInlineMethods.h:
8559         (JSC::JIT::preserveReturnAddressAfterCall):
8560         * jit/JITPropertyAccess.cpp:
8561         (JSC::JIT::privateCompilePutByIdTransition):
8562
8563 2009-07-27  Alexey Proskuryakov  <ap@webkit.org>
8564
8565         Gtk build fix.
8566
8567         * runtime/JSLock.cpp: (JSC::JSLock::JSLock): Fix "no threading" case.
8568
8569 2009-07-27  Alexey Proskuryakov  <ap@webkit.org>
8570
8571         Release build fix.
8572
8573         * runtime/JSLock.h: (JSC::JSLock::~JSLock):
8574
8575 2009-07-27  Alexey Proskuryakov  <ap@webkit.org>
8576
8577         Reviewed by Darin Adler.
8578
8579         https://bugs.webkit.org/show_bug.cgi?id=27735
8580         Give a helpful name to JSLock constructor argument
8581
8582         * API/JSBase.cpp:
8583         (JSGarbageCollect):
8584         * API/JSContextRef.cpp:
8585         * API/JSObjectRef.cpp:
8586         (JSPropertyNameArrayRelease):
8587         (JSPropertyNameAccumulatorAddName):
8588         * JavaScriptCore.exp:
8589         * jsc.cpp:
8590         (functionGC):
8591         (cleanupGlobalData):
8592         (jscmain):
8593         * runtime/Collector.cpp:
8594         (JSC::Heap::destroy):
8595         * runtime/JSLock.cpp:
8596         (JSC::JSLock::JSLock):
8597         (JSC::JSLock::lock):
8598         (JSC::JSLock::unlock):
8599         (JSC::JSLock::DropAllLocks::DropAllLocks):
8600         (JSC::JSLock::DropAllLocks::~DropAllLocks):
8601         * runtime/JSLock.h:
8602         (JSC::):
8603         (JSC::JSLock::JSLock):
8604         (JSC::JSLock::~JSLock):
8605
8606 2009-07-25  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
8607
8608         Reviewed by Eric Seidel.
8609
8610         Allow custom memory allocation control for OpaqueJSPropertyNameArray struct
8611         https://bugs.webkit.org/show_bug.cgi?id=27342
8612
8613         Inherits OpaqueJSPropertyNameArray struct from FastAllocBase because it has been
8614         instantiated by 'new' JavaScriptCore/API/JSObjectRef.cpp:473.
8615
8616         * API/JSObjectRef.cpp:
8617
8618 2009-07-24  Ada Chan  <adachan@apple.com>
8619
8620         In preparation for https://bugs.webkit.org/show_bug.cgi?id=27236:
8621         Remove TCMALLOC_TRACK_DECOMMITED_SPANS.  We'll always track decommitted spans.
8622         We have tested this and show it has little impact on performance.
8623
8624         Reviewed by Mark Rowe.
8625
8626         * wtf/FastMalloc.cpp:
8627         (WTF::TCMalloc_PageHeap::New):
8628         (WTF::TCMalloc_PageHeap::AllocLarge):
8629         (WTF::propagateDecommittedState):
8630         (WTF::mergeDecommittedStates):
8631         (WTF::TCMalloc_PageHeap::Delete):
8632         (WTF::TCMalloc_PageHeap::IncrementalScavenge):
8633
8634 2009-07-24  Csaba Osztrogonac  <oszi@inf.u-szeged.hu>
8635
8636         Reviewed by Darin Adler and Adam Barth.
8637
8638         Build fix for x86 platforms.
8639         https://bugs.webkit.org/show_bug.cgi?id=27602
8640
8641         * jit/JIT.cpp:
8642
8643 2009-07-23  Kevin Ollivier  <kevino@theolliviers.com>
8644
8645         wx build fix, adding missing header.
8646
8647         * jit/JIT.cpp:
8648
8649 2009-07-22  Yong Li  <yong.li@torchmobile.com>
8650
8651         Reviewed by George Staikos.
8652
8653         Add wince specific memory files into wtf/wince
8654         https://bugs.webkit.org/show_bug.cgi?id=27550
8655
8656         * wtf/wince/FastMallocWince.h: Added.
8657         * wtf/wince/MemoryManager.cpp: Added.
8658         * wtf/wince/MemoryManager.h: Added.
8659
8660 2009-07-23  Norbert Leser  <norbert.leser@nokia.com>
8661
8662         Reviewed by Simon Hausmann.
8663
8664         Fix for missing mmap features in Symbian
8665         https://bugs.webkit.org/show_bug.cgi?id=24540
8666
8667         Fix, conditionally for PLATFORM(SYMBIAN), as an alternative 
8668         to missing support for the MAP_ANON property flag in mmap. 
8669         It utilizes Symbian specific memory allocation features.
8670
8671         * runtime/Collector.cpp
8672
8673 2009-07-22  Gavin Barraclough  <barraclough@apple.com>
8674
8675         Reviewed by Sam Weinig.
8676
8677         With ENABLE(ASSEMBLER_WX_EXCLUSIVE), only change permissions once per repatch event.
8678         ( https://bugs.webkit.org/show_bug.cgi?id=27564 )
8679
8680         Currently we change permissions forwards and backwards for each instruction modified,
8681         instead we should only change permissions once per complete repatching event.
8682
8683         2.5% progression running with ENABLE(ASSEMBLER_WX_EXCLUSIVE) enabled,
8684         which recoups 1/3 of the penalty of running with this mode enabled.
8685
8686         * assembler/ARMAssembler.cpp:
8687         (JSC::ARMAssembler::linkBranch):
8688             - Replace usage of MakeWritable with cacheFlush.
8689         
8690         * assembler/ARMAssembler.h:
8691         (JSC::ARMAssembler::patchPointerInternal):
8692         (JSC::ARMAssembler::repatchLoadPtrToLEA):
8693             - Replace usage of MakeWritable with cacheFlush.
8694
8695         * assembler/ARMv7Assembler.h:
8696         (JSC::ARMv7Assembler::relinkJump):
8697         (JSC::ARMv7Assembler::relinkCall):
8698         (JSC::ARMv7Assembler::repatchInt32):
8699         (JSC::ARMv7Assembler::repatchPointer):
8700         (JSC::ARMv7Assembler::repatchLoadPtrToLEA):
8701         (JSC::ARMv7Assembler::setInt32):
8702             - Replace usage of MakeWritable with cacheFlush.
8703
8704         * assembler/LinkBuffer.h:
8705         (JSC::LinkBuffer::performFinalization):
8706             - Make explicit call to cacheFlush.
8707
8708         * assembler/MacroAssemblerCodeRef.h:
8709         (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef):
8710             - Make size always available.
8711
8712         * assembler/RepatchBuffer.h:
8713         (JSC::RepatchBuffer::RepatchBuffer):
8714         (JSC::RepatchBuffer::~RepatchBuffer):
8715             - Add calls to MakeWritable & makeExecutable.
8716
8717         * assembler/X86Assembler.h:
8718         (JSC::X86Assembler::relinkJump):
8719         (JSC::X86Assembler::relinkCall):
8720         (JSC::X86Assembler::repatchInt32):
8721         (JSC::X86Assembler::repatchPointer):
8722         (JSC::X86Assembler::repatchLoadPtrToLEA):
8723             - Remove usage of MakeWritable.
8724
8725         * bytecode/CodeBlock.h:
8726         (JSC::CodeBlock::getJITCode):
8727             - Provide access to CodeBlock's JITCode.
8728
8729         * jit/ExecutableAllocator.h:
8730         (JSC::ExecutableAllocator::makeExecutable):
8731         (JSC::ExecutableAllocator::cacheFlush):
8732             - Remove MakeWritable, make cacheFlush public.
8733
8734         * jit/JIT.cpp:
8735         (JSC::ctiPatchNearCallByReturnAddress):
8736         (JSC::ctiPatchCallByReturnAddress):
8737         (JSC::JIT::privateCompile):
8738         (JSC::JIT::unlinkCall):
8739         (JSC::JIT::linkCall):
8740             - Add CodeBlock argument to RepatchBuffer.
8741
8742         * jit/JIT.h:
8743             - Pass CodeBlock argument for use by RepatchBuffer.
8744
8745         * jit/JITCode.h:
8746         (JSC::JITCode::start):
8747         (JSC::JITCode::size):
8748             - Provide access to code start & size.
8749
8750         * jit/JITPropertyAccess.cpp:
8751         (JSC::JIT::privateCompilePutByIdTransition):
8752         (JSC::JIT::patchGetByIdSelf):
8753         (JSC::JIT::patchMethodCallProto):
8754         (JSC::JIT::patchPutByIdReplace):
8755         (JSC::JIT::privateCompilePatchGetArrayLength):
8756         (JSC::JIT::privateCompileGetByIdProto):
8757         (JSC::JIT::privateCompileGetByIdSelfList):
8758         (JSC::JIT::privateCompileGetByIdProtoList):
8759         (JSC::JIT::privateCompileGetByIdChainList):
8760         (JSC::JIT::privateCompileGetByIdChain):
8761             - Add CodeBlock argument to RepatchBuffer.
8762
8763         * jit/JITStubs.cpp:
8764         (JSC::JITThunks::tryCachePutByID):
8765         (JSC::JITThunks::tryCacheGetByID):
8766         (JSC::JITStubs::DEFINE_STUB_FUNCTION):
8767             - Pass CodeBlock argument for use by RepatchBuffer.
8768
8769 2009-07-21  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
8770
8771         Reviewed by Gavin Barraclough.
8772
8773         Cache not only the structure of the method, but the
8774         structure of its prototype as well.
8775         https://bugs.webkit.org/show_bug.cgi?id=27077
8776
8777         * bytecode/CodeBlock.cpp:
8778         (JSC::CodeBlock::~CodeBlock):
8779         * bytecode/CodeBlock.h:
8780         (JSC::MethodCallLinkInfo::MethodCallLinkInfo):
8781         * jit/JITPropertyAccess.cpp:
8782         (JSC::JIT::patchMethodCallProto):
8783
8784 2009-07-21  Gavin Barraclough  <barraclough@apple.com>
8785
8786         Reviewed by Sam Weinig.
8787
8788         Move call linking / repatching down from AbstractMacroAssembler into MacroAssemblerARCH classes.
8789         ( https://bugs.webkit.org/show_bug.cgi?id=27527 )
8790
8791         This allows the implementation to be defined per architecture.  Specifically this addresses the
8792         fact that x86-64 MacroAssembler implements far calls as a load to register, followed by a call
8793         to register.  Patching the call actually requires the pointer load to be patched, rather than
8794         the call to be patched.  This is implementation detail specific to MacroAssemblerX86_64, and as
8795         such is best handled there.
8796
8797         * assembler/AbstractMacroAssembler.h:
8798         * assembler/MacroAssemblerARM.h:
8799         (JSC::MacroAssemblerARM::linkCall):
8800         (JSC::MacroAssemblerARM::repatchCall):
8801         * assembler/MacroAssemblerARMv7.h:
8802         (JSC::MacroAssemblerARMv7::linkCall):
8803         (JSC::MacroAssemblerARMv7::repatchCall):
8804         * assembler/MacroAssemblerX86.h:
8805         (JSC::MacroAssemblerX86::linkCall):
8806         (JSC::MacroAssemblerX86::repatchCall):
8807         * assembler/MacroAssemblerX86_64.h:
8808         (JSC::MacroAssemblerX86_64::linkCall):
8809         (JSC::MacroAssemblerX86_64::repatchCall):
8810
8811 2009-07-21  Adam Treat  <adam.treat@torchmobile.com>
8812
8813         Reviewed by George Staikos.
8814
8815         Every wtf file includes other wtf files with <> style includes
8816         except this one.  Fix the exception.
8817
8818         * wtf/ByteArray.h:
8819
8820 2009-07-21  Gavin Barraclough  <barraclough@apple.com>
8821
8822         Reviewed by Oliver Hunt.
8823
8824         Move LinkBuffer/RepatchBuffer out of AbstractMacroAssembler.
8825         ( https://bugs.webkit.org/show_bug.cgi?id=27485 )
8826
8827         This change is the first step in a process to move code that should be in
8828         the architecture-specific MacroAssembler classes up out of Assmbler and
8829         AbstractMacroAssembler.
8830
8831         * JavaScriptCore.xcodeproj/project.pbxproj:
8832             - added new files
8833         
8834         * assembler/ARMAssembler.h:
8835         (JSC::ARMAssembler::linkPointer):
8836             - rename patchPointer to bring it in line with the current link/repatch naming scheme
8837         
8838         * assembler/ARMv7Assembler.h:
8839         (JSC::ARMv7Assembler::linkCall):
8840         (JSC::ARMv7Assembler::linkPointer):
8841         (JSC::ARMv7Assembler::relinkCall):
8842         (JSC::ARMv7Assembler::repatchInt32):
8843         (JSC::ARMv7Assembler::repatchPointer):
8844         (JSC::ARMv7Assembler::setInt32):
8845         (JSC::ARMv7Assembler::setPointer):
8846             - rename patchPointer to bring it in line with the current link/repatch naming scheme
8847
8848         * assembler/AbstractMacroAssembler.h:
8849         (JSC::AbstractMacroAssembler::linkJump):
8850         (JSC::AbstractMacroAssembler::linkCall):
8851         (JSC::AbstractMacroAssembler::linkPointer):
8852         (JSC::AbstractMacroAssembler::getLinkerAddress):
8853         (JSC::AbstractMacroAssembler::getLinkerCallReturnOffset):
8854         (JSC::AbstractMacroAssembler::repatchJump):
8855         (JSC::AbstractMacroAssembler::repatchCall):
8856         (JSC::AbstractMacroAssembler::repatchNearCall):
8857         (JSC::AbstractMacroAssembler::repatchInt32):
8858         (JSC::AbstractMacroAssembler::repatchPointer):
8859         (JSC::AbstractMacroAssembler::repatchLoadPtrToLEA):
8860             - remove the LinkBuffer/RepatchBuffer classes, but leave a set of (private, friended) methods to interface to the Assembler
8861
8862         * assembler/LinkBuffer.h: Added.
8863         (JSC::LinkBuffer::LinkBuffer):
8864         (JSC::LinkBuffer::~LinkBuffer):
8865         (JSC::LinkBuffer::link):
8866         (JSC::LinkBuffer::patch):
8867         (JSC::LinkBuffer::locationOf):
8868         (JSC::LinkBuffer::locationOfNearCall):
8869         (JSC::LinkBuffer::returnAddressOffset):
8870         (JSC::LinkBuffer::finalizeCode):
8871         (JSC::LinkBuffer::finalizeCodeAddendum):
8872         (JSC::LinkBuffer::code):
8873         (JSC::LinkBuffer::performFinalization):
8874             - new file containing the LinkBuffer class, previously a member of AbstractMacroAssembler
8875
8876         * assembler/RepatchBuffer.h: Added.
8877         (JSC::RepatchBuffer::RepatchBuffer):
8878         (JSC::RepatchBuffer::relink):
8879         (JSC::RepatchBuffer::repatch):
8880         (JSC::RepatchBuffer::repatchLoadPtrToLEA):
8881         (JSC::RepatchBuffer::relinkCallerToTrampoline):
8882         (JSC::RepatchBuffer::relinkCallerToFunction):
8883         (JSC::RepatchBuffer::relinkNearCallerToTrampoline):
8884             - new file containing the RepatchBuffer class, previously a member of AbstractMacroAssembler
8885
8886         * assembler/X86Assembler.h:
8887         (JSC::X86Assembler::linkJump):
8888         (JSC::X86Assembler::linkCall):
8889         (JSC::X86Assembler::linkPointerForCall):
8890         (JSC::X86Assembler::linkPointer):
8891         (JSC::X86Assembler::relinkJump):
8892         (JSC::X86Assembler::relinkCall):
8893         (JSC::X86Assembler::repatchInt32):
8894         (JSC::X86Assembler::repatchPointer):
8895         (JSC::X86Assembler::setPointer):
8896         (JSC::X86Assembler::setInt32):
8897         (JSC::X86Assembler::setRel32):
8898             - rename patchPointer to bring it in line with the current link/repatch naming scheme
8899
8900         * jit/JIT.cpp:
8901         (JSC::ctiPatchNearCallByReturnAddress):
8902         (JSC::ctiPatchCallByReturnAddress):
8903             - include new headers
8904             - remove MacroAssembler:: specification from RepatchBuffer usage
8905
8906         * jit/JITPropertyAccess.cpp:
8907         * yarr/RegexJIT.cpp:
8908             - include new headers
8909
8910 2009-07-21  Robert Agoston  <Agoston.Robert@stud.u-szeged.hu>
8911
8912         Reviewed by David Levin.
8913
8914         Fixed #undef typo.
8915         https://bugs.webkit.org/show_bug.cgi?id=27506
8916
8917         * bytecode/Opcode.h:
8918
8919 2009-07-21  Adam Roben  <aroben@apple.com>
8920
8921         Roll out r46153, r46154, and r46155
8922
8923         These changes were causing build failures and assertion failures on
8924         Windows.
8925
8926         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
8927         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
8928         * JavaScriptCore.xcodeproj/project.pbxproj:
8929         * runtime/JSArray.cpp:
8930         * runtime/StringPrototype.cpp:
8931         * runtime/UString.cpp:
8932         * runtime/UString.h:
8933         * wtf/FastMalloc.cpp:
8934         * wtf/FastMalloc.h:
8935         * wtf/Platform.h:
8936         * wtf/PossiblyNull.h: Removed.
8937
8938 2009-07-21  Roland Steiner  <rolandsteiner@google.com>
8939
8940         Reviewed by David Levin.
8941
8942         Add ENABLE_RUBY to list of build options
8943         https://bugs.webkit.org/show_bug.cgi?id=27324
8944
8945         * Configurations/FeatureDefines.xcconfig: Added flag ENABLE_RUBY.
8946
8947 2009-07-20  Oliver Hunt  <oliver@apple.com>
8948
8949         Build fix attempt #2
8950
8951         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
8952         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
8953
8954 2009-07-20  Oliver Hunt  <oliver@apple.com>
8955
8956         Build fix attempt #1
8957
8958         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
8959         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
8960
8961 2009-07-20  Oliver Hunt  <oliver@apple.com>
8962
8963         Reviewed by Gavin Barraclough.
8964
8965         Make it harder to misuse try* allocation routines
8966         https://bugs.webkit.org/show_bug.cgi?id=27469
8967
8968         Jump through a few hoops to make it much harder to accidentally
8969         miss null-checking of values returned by the try-* allocation
8970         routines.
8971
8972         * JavaScriptCore.xcodeproj/project.pbxproj:
8973         * runtime/JSArray.cpp:
8974         (JSC::JSArray::putSlowCase):
8975         (JSC::JSArray::increaseVectorLength):
8976         * runtime/StringPrototype.cpp:
8977         (JSC::stringProtoFuncFontsize):
8978         (JSC::stringProtoFuncLink):
8979         * runtime/UString.cpp:
8980         (JSC::allocChars):
8981         (JSC::reallocChars):
8982         (JSC::expandCapacity):
8983         (JSC::UString::Rep::reserveCapacity):
8984         (JSC::UString::expandPreCapacity):
8985         (JSC::createRep):
8986         (JSC::concatenate):
8987         (JSC::UString::spliceSubstringsWithSeparators):
8988         (JSC::UString::replaceRange):
8989         (JSC::UString::append):
8990         (JSC::UString::operator=):
8991         * runtime/UString.h:
8992         (JSC::UString::Rep::createEmptyBuffer):
8993         * wtf/FastMalloc.cpp:
8994         (WTF::tryFastZeroedMalloc):
8995         (WTF::tryFastMalloc):
8996         (WTF::tryFastCalloc):
8997         (WTF::tryFastRealloc):
8998         (WTF::TCMallocStats::tryFastMalloc):
8999         (WTF::TCMallocStats::tryFastCalloc):
9000         (WTF::TCMallocStats::tryFastRealloc):
9001         * wtf/FastMalloc.h:
9002         (WTF::TryMallocReturnValue::TryMallocReturnValue):
9003         (WTF::TryMallocReturnValue::~TryMallocReturnValue):
9004         (WTF::TryMallocReturnValue::operator Maybe<T>):
9005         (WTF::TryMallocReturnValue::getValue):
9006         * wtf/PossiblyNull.h:
9007         (WTF::PossiblyNull::PossiblyNull):
9008         (WTF::PossiblyNull::~PossiblyNull):
9009         (WTF::PossiblyNull::getValue):
9010         * wtf/Platform.h:
9011
9012 2009-07-20  Gavin Barraclough  <barraclough@apple.com>
9013
9014         RS Oliver Hunt.
9015
9016         Add ARM assembler files to xcodeproj, for convenience editing.
9017
9018         * JavaScriptCore.xcodeproj/project.pbxproj:
9019
9020 2009-07-20  Jessie Berlin  <jberlin@apple.com>
9021
9022         Reviewed by David Levin.
9023
9024         Fix an incorrect assertion in Vector::remove.
9025         
9026         https://bugs.webkit.org/show_bug.cgi?id=27477
9027
9028         * wtf/Vector.h:
9029         (WTF::::remove):
9030         Assert that the position at which to start removing elements + the
9031         length (the number of elements to remove) is less than or equal to the
9032         size of the entire Vector.
9033
9034 2009-07-20  Peter Kasting  <pkasting@google.com>
9035
9036         Reviewed by Mark Rowe.
9037
9038         https://bugs.webkit.org/show_bug.cgi?id=27468
9039         Back out r46060, which caused problems for some Apple developers.
9040
9041         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
9042         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj:
9043         * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops:
9044         * JavaScriptCore.vcproj/jsc/jscCommon.vsprops:
9045         * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops:
9046
9047 2009-07-20  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
9048
9049         Reviewed by Oliver Hunt.
9050
9051         Allow custom memory allocation control in NewThreadContext
9052         https://bugs.webkit.org/show_bug.cgi?id=27338
9053
9054         Inherits NewThreadContext struct from FastAllocBase because it
9055         has been instantiated by 'new' JavaScriptCore/wtf/Threading.cpp:76.
9056
9057         * wtf/Threading.cpp:
9058
9059 2009-07-20  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
9060
9061         Reviewed by Oliver Hunt.
9062
9063         Allow custom memory allocation control in JavaScriptCore's JSClassRef.h
9064         https://bugs.webkit.org/show_bug.cgi?id=27340
9065
9066         Inherit StaticValueEntry and StaticFunctionEntry struct from FastAllocBase because these
9067         have been instantiated by 'new' in JavaScriptCore/API/JSClassRef.cpp:153
9068         and in JavaScriptCore/API/JSClassRef.cpp:166.
9069
9070         * API/JSClassRef.h:
9071
9072 2009-07-20  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
9073
9074         Reviewed by Darin Adler.
9075
9076         Allow custom memory allocation control in JavaScriptCore's RegexPattern.h
9077         https://bugs.webkit.org/show_bug.cgi?id=27343
9078
9079         Inherits RegexPattern.h's structs (which have been instantiated by operator new) from FastAllocBase:
9080
9081         CharacterClass (new call: JavaScriptCore/yarr/RegexCompiler.cpp:144)
9082         PatternAlternative (new call: JavaScriptCore/yarr/RegexPattern.h:221) 
9083         PatternDisjunction (new call: JavaScriptCore/yarr/RegexCompiler.cpp:446)
9084
9085         * yarr/RegexPattern.h:
9086
9087 2009-07-20  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
9088
9089         Reviewed by Darin Adler.
9090
9091         Allow custom memory allocation control for JavaScriptCore's MatchFrame struct
9092         https://bugs.webkit.org/show_bug.cgi?id=27344
9093
9094         Inherits MatchFrame struct from FastAllocBase because it has
9095         been instantiated by 'new' JavaScriptCore/pcre/pcre_exec.cpp:359.
9096
9097         * pcre/pcre_exec.cpp:
9098
9099 2009-07-20  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
9100
9101         Reviewed by Holger Freyther.
9102
9103         Remove some outdated S60 platform specific code
9104         https://bugs.webkit.org/show_bug.cgi?id=27423
9105
9106         * wtf/Platform.h:
9107
9108 2009-07-20  Csaba Osztrogonac  <oszi@inf.u-szeged.hu>
9109
9110         Reviewed by Simon Hausmann.
9111
9112         Qt build fix with MSVC and MinGW.
9113
9114         * jsc.pro: Make sure jsc is a console application, and turn off
9115         exceptions and stl support to fix the build.
9116
9117 2009-07-20  Xan Lopez  <xlopez@igalia.com>
9118
9119         Reviewed by Gustavo Noronha.
9120
9121         Do not use C++-style comments in preprocessor directives.
9122
9123         GCC does not like this in some configurations, using C-style
9124         comments is safer.
9125
9126         * wtf/Platform.h:
9127
9128 2009-07-17  Peter Kasting  <pkasting@google.com>
9129
9130         Reviewed by Steve Falkenburg.
9131
9132         https://bugs.webkit.org/show_bug.cgi?id=27323
9133         Only add Cygwin to the path when it isn't already there.  This avoids
9134         causing problems for people who purposefully have non-Cygwin versions of
9135         executables like svn in front of the Cygwin ones in their paths.
9136
9137         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
9138         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj:
9139         * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops:
9140         * JavaScriptCore.vcproj/jsc/jscCommon.vsprops:
9141         * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops:
9142
9143 2009-07-17  Gabor Loki  <loki@inf.u-szeged.hu>
9144
9145         Reviewed by Gavin Barraclough.
9146
9147         Add YARR support for generic ARM platforms (disabled by default).
9148         https://bugs.webkit.org/show_bug.cgi?id=24986
9149
9150         Add generic ARM port for MacroAssembler. It supports the whole
9151         MacroAssembler functionality except floating point.
9152
9153         The class JmpSrc is extended with a flag which enables to patch
9154         the jump destination offset during execution. This feature is
9155         required for generic ARM port.
9156
9157         Signed off by Zoltan Herczeg <zherczeg@inf.u-szeged.hu>
9158         Signed off by Gabor Loki <loki@inf.u-szeged.hu>
9159
9160         * JavaScriptCore.pri:
9161         * assembler/ARMAssembler.cpp: Added.
9162         (JSC::ARMAssembler::getLdrImmAddress):
9163         (JSC::ARMAssembler::linkBranch):
9164         (JSC::ARMAssembler::patchConstantPoolLoad):
9165         (JSC::ARMAssembler::getOp2):
9166         (JSC::ARMAssembler::genInt):
9167         (JSC::ARMAssembler::getImm):
9168         (JSC::ARMAssembler::moveImm):
9169         (JSC::ARMAssembler::dataTransfer32):
9170         (JSC::ARMAssembler::baseIndexTransfer32):
9171         (JSC::ARMAssembler::executableCopy):
9172         * assembler/ARMAssembler.h: Added.
9173         (JSC::ARM::):
9174         (JSC::ARMAssembler::ARMAssembler):
9175         (JSC::ARMAssembler::):
9176         (JSC::ARMAssembler::JmpSrc::JmpSrc):
9177         (JSC::ARMAssembler::JmpSrc::enableLatePatch):
9178         (JSC::ARMAssembler::JmpDst::JmpDst):
9179         (JSC::ARMAssembler::JmpDst::isUsed):
9180         (JSC::ARMAssembler::JmpDst::used):
9181         (JSC::ARMAssembler::emitInst):
9182         (JSC::ARMAssembler::and_r):
9183         (JSC::ARMAssembler::ands_r):
9184         (JSC::ARMAssembler::eor_r):
9185         (JSC::ARMAssembler::eors_r):
9186         (JSC::ARMAssembler::sub_r):
9187         (JSC::ARMAssembler::subs_r):
9188         (JSC::ARMAssembler::rsb_r):
9189         (JSC::ARMAssembler::rsbs_r):
9190         (JSC::ARMAssembler::add_r):
9191         (JSC::ARMAssembler::adds_r):
9192         (JSC::ARMAssembler::adc_r):
9193         (JSC::ARMAssembler::adcs_r):
9194         (JSC::ARMAssembler::sbc_r):
9195         (JSC::ARMAssembler::sbcs_r):
9196         (JSC::ARMAssembler::rsc_r):
9197         (JSC::ARMAssembler::rscs_r):
9198         (JSC::ARMAssembler::tst_r):
9199         (JSC::ARMAssembler::teq_r):
9200         (JSC::ARMAssembler::cmp_r):
9201         (JSC::ARMAssembler::orr_r):
9202         (JSC::ARMAssembler::orrs_r):
9203         (JSC::ARMAssembler::mov_r):
9204         (JSC::ARMAssembler::movs_r):
9205         (JSC::ARMAssembler::bic_r):
9206         (JSC::ARMAssembler::bics_r):
9207         (JSC::ARMAssembler::mvn_r):
9208         (JSC::ARMAssembler::mvns_r):
9209         (JSC::ARMAssembler::mul_r):
9210         (JSC::ARMAssembler::muls_r):
9211         (JSC::ARMAssembler::mull_r):
9212         (JSC::ARMAssembler::ldr_imm):
9213         (JSC::ARMAssembler::ldr_un_imm):
9214         (JSC::ARMAssembler::dtr_u):
9215         (JSC::ARMAssembler::dtr_ur):
9216         (JSC::ARMAssembler::dtr_d):
9217         (JSC::ARMAssembler::dtr_dr):
9218         (JSC::ARMAssembler::ldrh_r):
9219         (JSC::ARMAssembler::ldrh_d):
9220         (JSC::ARMAssembler::ldrh_u):
9221         (JSC::ARMAssembler::strh_r):
9222         (JSC::ARMAssembler::push_r):
9223         (JSC::ARMAssembler::pop_r):
9224         (JSC::ARMAssembler::poke_r):
9225         (JSC::ARMAssembler::peek_r):
9226         (JSC::ARMAssembler::clz_r):
9227         (JSC::ARMAssembler::bkpt):
9228         (JSC::ARMAssembler::lsl):
9229         (JSC::ARMAssembler::lsr):
9230         (JSC::ARMAssembler::asr):
9231         (JSC::ARMAssembler::lsl_r):
9232         (JSC::ARMAssembler::lsr_r):
9233         (JSC::ARMAssembler::asr_r):
9234         (JSC::ARMAssembler::size):
9235         (JSC::ARMAssembler::ensureSpace):
9236         (JSC::ARMAssembler::label):
9237         (JSC::ARMAssembler::align):
9238         (JSC::ARMAssembler::jmp):
9239         (JSC::ARMAssembler::patchPointerInternal):
9240         (JSC::ARMAssembler::patchConstantPoolLoad):
9241         (JSC::ARMAssembler::patchPointer):
9242         (JSC::ARMAssembler::repatchInt32):
9243         (JSC::ARMAssembler::repatchPointer):
9244         (JSC::ARMAssembler::repatchLoadPtrToLEA):
9245         (JSC::ARMAssembler::linkJump):
9246         (JSC::ARMAssembler::relinkJump):
9247         (JSC::ARMAssembler::linkCall):
9248         (JSC::ARMAssembler::relinkCall):
9249         (JSC::ARMAssembler::getRelocatedAddress):
9250         (JSC::ARMAssembler::getDifferenceBetweenLabels):
9251         (JSC::ARMAssembler::getCallReturnOffset):
9252         (JSC::ARMAssembler::getOp2Byte):
9253         (JSC::ARMAssembler::placeConstantPoolBarrier):
9254         (JSC::ARMAssembler::RM):
9255         (JSC::ARMAssembler::RS):
9256         (JSC::ARMAssembler::RD):
9257         (JSC::ARMAssembler::RN):
9258         (JSC::ARMAssembler::getConditionalField):
9259         * assembler/ARMv7Assembler.h:
9260         (JSC::ARMv7Assembler::JmpSrc::enableLatePatch):
9261         * assembler/AbstractMacroAssembler.h:
9262         (JSC::AbstractMacroAssembler::Call::enableLatePatch):
9263         (JSC::AbstractMacroAssembler::Jump::enableLatePatch):
9264         * assembler/MacroAssembler.h:
9265         * assembler/MacroAssemblerARM.h: Added.
9266         (JSC::MacroAssemblerARM::):
9267         (JSC::MacroAssemblerARM::add32):
9268         (JSC::MacroAssemblerARM::and32):
9269         (JSC::MacroAssemblerARM::lshift32):
9270         (JSC::MacroAssemblerARM::mul32):
9271         (JSC::MacroAssemblerARM::not32):
9272         (JSC::MacroAssemblerARM::or32):
9273         (JSC::MacroAssemblerARM::rshift32):
9274         (JSC::MacroAssemblerARM::sub32):
9275         (JSC::MacroAssemblerARM::xor32):
9276         (JSC::MacroAssemblerARM::load32):
9277         (JSC::MacroAssemblerARM::load32WithAddressOffsetPatch):
9278         (JSC::MacroAssemblerARM::loadPtrWithPatchToLEA):
9279         (JSC::MacroAssemblerARM::load16):
9280         (JSC::MacroAssemblerARM::store32WithAddressOffsetPatch):
9281         (JSC::MacroAssemblerARM::store32):
9282         (JSC::MacroAssemblerARM::pop):
9283         (JSC::MacroAssemblerARM::push):
9284         (JSC::MacroAssemblerARM::move):
9285         (JSC::MacroAssemblerARM::swap):
9286         (JSC::MacroAssemblerARM::signExtend32ToPtr):
9287         (JSC::MacroAssemblerARM::zeroExtend32ToPtr):
9288         (JSC::MacroAssemblerARM::branch32):
9289         (JSC::MacroAssemblerARM::branch16):
9290         (JSC::MacroAssemblerARM::branchTest32):
9291         (JSC::MacroAssemblerARM::jump):
9292         (JSC::MacroAssemblerARM::branchAdd32):
9293         (JSC::MacroAssemblerARM::mull32):
9294         (JSC::MacroAssemblerARM::branchMul32):
9295         (JSC::MacroAssemblerARM::branchSub32):
9296         (JSC::MacroAssemblerARM::breakpoint):
9297         (JSC::MacroAssemblerARM::nearCall):
9298         (JSC::MacroAssemblerARM::call):
9299         (JSC::MacroAssemblerARM::ret):
9300         (JSC::MacroAssemblerARM::set32):
9301         (JSC::MacroAssemblerARM::setTest32):
9302         (JSC::MacroAssemblerARM::tailRecursiveCall):
9303         (JSC::MacroAssemblerARM::makeTailRecursiveCall):
9304         (JSC::MacroAssemblerARM::moveWithPatch):
9305         (JSC::MacroAssemblerARM::branchPtrWithPatch):
9306         (JSC::MacroAssemblerARM::storePtrWithPatch):
9307         (JSC::MacroAssemblerARM::supportsFloatingPoint):
9308         (JSC::MacroAssemblerARM::supportsFloatingPointTruncate):
9309         (JSC::MacroAssemblerARM::loadDouble):
9310         (JSC::MacroAssemblerARM::storeDouble):
9311         (JSC::MacroAssemblerARM::addDouble):
9312         (JSC::MacroAssemblerARM::subDouble):
9313         (JSC::MacroAssemblerARM::mulDouble):
9314         (JSC::MacroAssemblerARM::convertInt32ToDouble):
9315         (JSC::MacroAssemblerARM::branchDouble):
9316         (JSC::MacroAssemblerARM::branchTruncateDoubleToInt32):
9317         (JSC::MacroAssemblerARM::ARMCondition):
9318         (JSC::MacroAssemblerARM::prepareCall):
9319         (JSC::MacroAssemblerARM::call32):
9320         * assembler/X86Assembler.h:
9321         (JSC::X86Assembler::JmpSrc::enableLatePatch):
9322         * jit/ExecutableAllocator.h:
9323         (JSC::ExecutableAllocator::cacheFlush):
9324         * wtf/Platform.h:
9325         * yarr/RegexJIT.cpp:
9326         (JSC::Yarr::RegexGenerator::generateEnter):
9327         (JSC::Yarr::RegexGenerator::generateReturn):
9328
9329 2009-07-17  Gabor Loki  <loki@inf.u-szeged.hu>
9330
9331         Reviewed by Gavin Barraclough.
9332
9333         Extend AssemblerBuffer with constant pool handling mechanism.
9334         https://bugs.webkit.org/show_bug.cgi?id=24986
9335
9336         Add a platform independed constant pool framework.
9337         This pool can store 32 or 64 bits values which is enough to hold
9338         any integer, pointer or double constant.
9339
9340         * assembler/AssemblerBuffer.h:
9341         (JSC::AssemblerBuffer::putIntUnchecked):
9342         (JSC::AssemblerBuffer::putInt64Unchecked):
9343         (JSC::AssemblerBuffer::append):
9344         (JSC::AssemblerBuffer::grow):
9345         * assembler/AssemblerBufferWithConstantPool.h: Added.
9346         (JSC::):
9347
9348 2009-07-17  Eric Roman  <eroman@chromium.org>
9349
9350         Reviewed by Darin Adler.
9351
9352         Build fix for non-Darwin.
9353         Add a guard for inclusion of RetainPtr.h which includes CoreFoundation.h
9354
9355         https://bugs.webkit.org/show_bug.cgi?id=27382
9356
9357         * wtf/unicode/icu/CollatorICU.cpp:
9358
9359 2009-07-17  Alexey Proskuryakov  <ap@webkit.org>
9360
9361         Reviewed by John Sullivan.
9362
9363         Get user default collation order via a CFLocale API when available.
9364
9365         * wtf/unicode/icu/CollatorICU.cpp: (WTF::Collator::userDefault):
9366
9367 2009-07-17  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
9368
9369         Reviewed by Simon Hausmann.
9370
9371         [Qt] Fix the include path for the Symbian port
9372         https://bugs.webkit.org/show_bug.cgi?id=27358
9373
9374         * JavaScriptCore.pri:
9375
9376 2009-07-17  Csaba Osztrogonac  <oszi@inf.u-szeged.hu>
9377
9378         Reviewed by David Levin.
9379
9380         Build fix on platforms don't have MMAP.
9381         https://bugs.webkit.org/show_bug.cgi?id=27365
9382
9383         * interpreter/RegisterFile.h: Including stdio.h irrespectively of HAVE(MMAP)
9384
9385 2009-07-16  Fumitoshi Ukai  <ukai@chromium.org>
9386
9387         Reviewed by David Levin.
9388
9389         Add --web-sockets flag and ENABLE_WEB_SOCKETS define.
9390         https://bugs.webkit.org/show_bug.cgi?id=27206
9391         
9392         Add ENABLE_WEB_SOCKETS
9393
9394         * Configurations/FeatureDefines.xcconfig: add ENABLE_WEB_SOCKETS
9395
9396 2009-07-16  Maxime Simon  <simon.maxime@gmail.com>
9397
9398         Reviewed by Eric Seidel.
9399
9400         Added Haiku-specific files for JavaScriptCore.
9401         https://bugs.webkit.org/show_bug.cgi?id=26620
9402
9403         * wtf/haiku/MainThreadHaiku.cpp: Added.
9404         (WTF::initializeMainThreadPlatform):
9405         (WTF::scheduleDispatchFunctionsOnMainThread):
9406
9407 2009-07-16  Gavin Barraclough  <barraclough@apple.com>
9408
9409         RS by Oliver Hunt.
9410
9411         Revert r45969, this fix does not appear to be valid.
9412         https://bugs.webkit.org/show_bug.cgi?id=27077
9413
9414         * bytecode/CodeBlock.cpp:
9415         (JSC::CodeBlock::~CodeBlock):
9416         (JSC::CodeBlock::unlinkCallers):
9417         * jit/JIT.cpp:
9418         * jit/JIT.h:
9419
9420 2009-07-16  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
9421
9422         Reviewed by Oliver Hunt.
9423
9424         Allow custom memory allocation control in ExceptionInfo and RareData struct
9425         https://bugs.webkit.org/show_bug.cgi?id=27336
9426
9427         Inherits ExceptionInfo and RareData struct from FastAllocBase because these
9428         have been instantiated by 'new' in JavaScriptCore/bytecode/CodeBlock.cpp:1289 and
9429         in JavaScriptCore/bytecode/CodeBlock.h:453.
9430
9431         Remove unnecessary WTF:: namespace from CodeBlock inheritance.
9432  
9433         * bytecode/CodeBlock.h:
9434
9435 2009-07-16  Mark Rowe  <mrowe@apple.com>
9436
9437         Rubber-stamped by Geoff Garen.
9438
9439         Fix FeatureDefines.xcconfig to not be out of sync with the rest of the world.
9440
9441         * Configurations/FeatureDefines.xcconfig:
9442
9443 2009-07-16  Yong Li  <yong.li@torchmobile.com>
9444
9445          Reviewed by George Staikos.
9446
9447          https://bugs.webkit.org/show_bug.cgi?id=27320
9448          _countof is only included in CE6; for CE5 we need to define it ourself
9449
9450          * wtf/Platform.h:
9451
9452 2009-07-16  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
9453
9454         Reviewed by Oliver Hunt.
9455
9456         Workers + garbage collector: weird crashes
9457         https://bugs.webkit.org/show_bug.cgi?id=27077
9458
9459         We need to unlink cached method call sites when a function is destroyed.
9460
9461         * JavaScriptCore.xcodeproj/project.pbxproj:
9462         * bytecode/CodeBlock.cpp:
9463         (JSC::CodeBlock::~CodeBlock):
9464         (JSC::CodeBlock::unlinkCallers):
9465         * jit/JIT.cpp:
9466         (JSC::JIT::unlinkMethodCall):
9467         * jit/JIT.h:
9468
9469 2009-07-15  Steve Falkenburg  <sfalken@apple.com>
9470
9471         Windows Build fix.
9472
9473         Visual Studio reset our intermediate directory on us.
9474         This sets it back.
9475         
9476         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
9477         * JavaScriptCore.vcproj/testapi/testapi.vcproj:
9478
9479 2009-07-15  Kwang Yul Seo  <skyul@company100.net>
9480
9481         Reviewed by Eric Seidel.
9482
9483         https://bugs.webkit.org/show_bug.cgi?id=26794
9484         Make Yacc-generated parsers to use fastMalloc/fastFree.
9485         
9486         Define YYMALLOC and YYFREE to fastMalloc and fastFree
9487         respectively.
9488
9489         * parser/Grammar.y:
9490
9491 2009-07-15  Darin Adler  <darin@apple.com>
9492
9493         Fix a build for a particular Apple configuration.
9494
9495         * wtf/FastAllocBase.h: Change include to use "" style for
9496         including another wtf header. This is the style we use for
9497         including other public headers in the same directory.
9498
9499 2009-07-15  George Staikos  <george.staikos@torchmobile.com>
9500
9501         Reviewed by Adam Treat.
9502
9503         https://bugs.webkit.org/show_bug.cgi?id=27303
9504         Implement createThreadInternal for WinCE.
9505         Contains changes by George Staikos <george.staikos@torchmobile.com> and Joe Mason <joe.mason@torchmobile.com>
9506
9507         * wtf/ThreadingWin.cpp:
9508         (WTF::createThreadInternal):
9509
9510 2009-07-15  Joe Mason  <joe.mason@torchmobile.com>
9511
9512          Reviewed by George Staikos.
9513
9514          https://bugs.webkit.org/show_bug.cgi?id=27298
9515          Platform defines for WINCE.
9516          Contains changes by Yong Li <yong.li@torchmobile.com>,
9517          George Staikos <george.staikos@torchmobile.com> and Joe Mason <joe.mason@torchmobile.com>
9518
9519          * wtf/Platform.h:
9520
9521 2009-07-15  Yong Li  <yong.li@torchmobile.com>
9522
9523          Reviewed by Adam Treat.
9524
9525          https://bugs.webkit.org/show_bug.cgi?id=27306
9526          Use RegisterClass instead of RegisterClassEx on WinCE.
9527
9528          * wtf/win/MainThreadWin.cpp:
9529          (WTF::initializeMainThreadPlatform):
9530
9531 2009-07-15  Yong Li  <yong.li@torchmobile.com>
9532
9533          Reviewed by George Staikos.
9534
9535          https://bugs.webkit.org/show_bug.cgi?id=27301
9536          Use OutputDebugStringW on WinCE since OutputDebugStringA is not supported
9537          Originally written by Yong Li <yong.li@torchmobile.com> and refactored by
9538          Joe Mason <joe.mason@torchmobile.com>
9539
9540          * wtf/Assertions.cpp: vprintf_stderr_common
9541
9542 2009-07-15  Yong Li  <yong.li@torchmobile.com>
9543
9544          Reviewed by George Staikos.
9545
9546          https://bugs.webkit.org/show_bug.cgi?id=27020
9547          msToGregorianDateTime should set utcOffset to 0 when outputIsUTC is false
9548
9549          * wtf/DateMath.cpp:
9550          (WTF::gregorianDateTimeToMS):
9551
9552 2009-07-15  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
9553
9554         Reviewed by Simon Hausmann.
9555
9556         [Qt] Cleanup - Remove obsolete code from the make system
9557         https://bugs.webkit.org/show_bug.cgi?id=27299
9558
9559         * JavaScriptCore.pro:
9560         * jsc.pro:
9561
9562 2009-07-07  Norbert Leser  <norbert.leser@nokia.com>
9563
9564         Reviewed by Simon Hausmann.
9565
9566         https://bugs.webkit.org/show_bug.cgi?id=27056
9567
9568         Alternate bool operator for codewarrior compiler (WINSCW).
9569         Compiler (latest b482) reports error for UnspecifiedBoolType construct:
9570         "illegal explicit conversion from 'WTF::OwnArrayPtr<JSC::Register>' to 'bool'"
9571
9572         Same fix as in r38391.
9573
9574         * JavaScriptCore/wtf/OwnArrayPtr.h:
9575
9576 2009-07-15  Norbert Leser  <norbert.leser@nokia.com>
9577
9578         Reviewed by Darin Adler.
9579
9580         Qualify include path with wtf to fix compilation
9581         on Symbian.
9582         https://bugs.webkit.org/show_bug.cgi?id=27055
9583
9584         * interpreter/Interpreter.h:
9585
9586 2009-07-15  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
9587
9588         Reviewed by Dave Kilzer.
9589
9590         Turn off non-portable date manipulations for SYMBIAN
9591         https://bugs.webkit.org/show_bug.cgi?id=27064
9592
9593         Introduce HAVE(TM_GMTOFF), HAVE(TM_ZONE) and HAVE(TIMEGM) guards 
9594         and place the rules for controlling the guards in Platform.h.
9595         Turn off these newly introduced guards for SYMBIAN.
9596
9597         * wtf/DateMath.cpp:
9598         (WTF::calculateUTCOffset):
9599         * wtf/DateMath.h:
9600         (WTF::GregorianDateTime::GregorianDateTime):
9601         (WTF::GregorianDateTime::operator tm):
9602         * wtf/Platform.h:
9603
9604 2009-07-15  Norbert Leser  <norbert.leser@nokia.com>
9605
9606         Reviewed by Simon Hausmann.
9607
9608         Undef ASSERT on Symbian, to avoid excessive warnings
9609         https://bugs.webkit.org/show_bug.cgi?id=27052
9610
9611         * wtf/Assertions.h:
9612
9613 2009-07-15  Oliver Hunt  <oliver@apple.com>
9614
9615         Reviewed by Simon Hausmann.
9616
9617         REGRESSION: fast/js/postfix-syntax.html fails with interpreter
9618         https://bugs.webkit.org/show_bug.cgi?id=27294
9619
9620         When postfix operators operating on locals assign to the same local
9621         the order of operations has to be to store the incremented value, then
9622         store the unmodified number.  Rather than implementing this subtle
9623         semantic in the interpreter I've just made the logic explicit in the
9624         bytecode generator, so x=x++ effectively becomes x=ToNumber(x) (for a
9625         local var x).
9626
9627         * parser/Nodes.cpp:
9628         (JSC::emitPostIncOrDec):
9629
9630 2009-07-15  Oliver Hunt  <oliver@apple.com>
9631
9632         Reviewed by Simon Hausmann.
9633
9634         REGRESSION(43559): fast/js/kde/arguments-scope.html fails with interpreter
9635         https://bugs.webkit.org/show_bug.cgi?id=27259
9636
9637         The interpreter was incorrectly basing its need to create the arguments object
9638         based on the presence of the callframe's argument reference rather than the local
9639         arguments reference.  Based on this it then overrode the local variable reference.
9640
9641         * interpreter/Interpreter.cpp:
9642         (JSC::Interpreter::privateExecute):
9643
9644 2009-07-14  Steve Falkenburg  <sfalken@apple.com>
9645
9646         Reorganize JavaScriptCore headers into:
9647         API: include/JavaScriptCore/
9648         Private: include/private/JavaScriptCore/
9649
9650         Reviewed by Darin Adler.
9651
9652         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
9653         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
9654         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
9655         * JavaScriptCore.vcproj/testapi/testapi.vcproj:
9656         * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops:
9657
9658 2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
9659
9660         Reviewed by Darin Adler.
9661
9662         Change JSCell's superclass to NoncopyableCustomAllocated
9663         https://bugs.webkit.org/show_bug.cgi?id=27248
9664
9665         JSCell class customizes operator new, since Noncopyable will be 
9666         inherited from FastAllocBase, NoncopyableCustomAllocated has 
9667         to be used.
9668
9669         * runtime/JSCell.h:
9670
9671 2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
9672
9673         Reviewed by Darin Adler.
9674
9675         Change all Noncopyable inheriting visibility to public.
9676         https://bugs.webkit.org/show_bug.cgi?id=27225
9677
9678         Change all Noncopyable inheriting visibility to public because
9679         it is needed to the custom allocation framework (bug #20422).
9680
9681         * bytecode/SamplingTool.h:
9682         * bytecompiler/RegisterID.h:
9683         * interpreter/CachedCall.h:
9684         * interpreter/RegisterFile.h:
9685         * parser/Lexer.h:
9686         * parser/Parser.h:
9687         * runtime/ArgList.h:
9688         * runtime/BatchedTransitionOptimizer.h:
9689         * runtime/Collector.h:
9690         * runtime/CommonIdentifiers.h:
9691         * runtime/JSCell.h:
9692         * runtime/JSGlobalObject.h:
9693         * runtime/JSLock.h:
9694         * runtime/JSONObject.cpp:
9695         * runtime/SmallStrings.cpp:
9696         * runtime/SmallStrings.h:
9697         * wtf/CrossThreadRefCounted.h:
9698         * wtf/GOwnPtr.h:
9699         * wtf/Locker.h:
9700         * wtf/MessageQueue.h:
9701         * wtf/OwnArrayPtr.h:
9702         * wtf/OwnFastMallocPtr.h:
9703         * wtf/OwnPtr.h:
9704         * wtf/RefCounted.h:
9705         * wtf/ThreadSpecific.h:
9706         * wtf/Threading.h:
9707         * wtf/Vector.h:
9708         * wtf/unicode/Collator.h:
9709
9710 2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
9711
9712         Reviewed by Darin Adler.
9713
9714         Change ParserArenaRefCounted's superclass to RefCountedCustomAllocated
9715         https://bugs.webkit.org/show_bug.cgi?id=27249
9716
9717         ParserArenaDeletable customizes operator new, to avoid double inheritance
9718         ParserArenaDeletable's superclass has been changed to RefCountedCustomAllocated.
9719
9720         * parser/Nodes.h:
9721
9722 2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
9723
9724         Reviewed by Darin Adler.
9725
9726         Add RefCountedCustomAllocated to RefCounted.h
9727         https://bugs.webkit.org/show_bug.cgi?id=27232
9728
9729         Some class which are inherited from RefCounted customize
9730         operator new, but RefCounted is inherited from Noncopyable
9731         which will be inherited from FastAllocBase. To avoid
9732         conflicts Noncopyable inheriting was moved down to RefCounted
9733         and to avoid double inheritance this class has been added.
9734
9735         * wtf/RefCounted.h:
9736         (WTF::RefCountedCustomAllocated::deref):
9737         (WTF::RefCountedCustomAllocated::~RefCountedCustomAllocated):
9738
9739 2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
9740
9741         Reviewed by Darin Adler.
9742
9743         Add NoncopyableCustomAllocated to Noncopyable.h.
9744         https://bugs.webkit.org/show_bug.cgi?id=27228
9745         
9746         Some classes which inherited from Noncopyable overrides operator new
9747         since Noncopyable'll be inherited from FastAllocBase, Noncopyable.h 
9748         needs to be extended with this new class to support the overriding. 
9749
9750         * wtf/Noncopyable.h:
9751         (WTFNoncopyable::NoncopyableCustomAllocated::NoncopyableCustomAllocated):
9752         (WTFNoncopyable::NoncopyableCustomAllocated::~NoncopyableCustomAllocated):
9753
9754 2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
9755
9756         Reviewed by Darin Adler.
9757
9758         Allow custom memory allocation control for JavaScriptCore's IdentifierTable class
9759         https://bugs.webkit.org/show_bug.cgi?id=27260
9760
9761         Inherits IdentifierTable class from FastAllocBase because it has been
9762         instantiated by 'new' in JavaScriptCore/runtime/Identifier.cpp:70.
9763
9764         * runtime/Identifier.cpp:
9765
9766 2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
9767
9768         Reviewed by Darin Adler.
9769
9770         Allow custom memory allocation control for JavaScriptCore's Profiler class
9771         https://bugs.webkit.org/show_bug.cgi?id=27253
9772
9773         Inherits Profiler class from FastAllocBase because it has been instantiated by
9774         'new' in JavaScriptCore/profiler/Profiler.cpp:56.
9775
9776         * profiler/Profiler.h:
9777
9778 2009-07-06  George Staikos  <george.staikos@torchmobile.com>
9779
9780         Reviewed by Adam Treat.
9781
9782         Authors: George Staikos <george.staikos@torchmobile.com>, Joe Mason <joe.mason@torchmobile.com>, Makoto Matsumoto <matumoto@math.keio.ac.jp>, Takuji Nishimura
9783
9784         https://bugs.webkit.org/show_bug.cgi?id=27030
9785         Implement custom RNG for WinCE using Mersenne Twister
9786
9787         * wtf/RandomNumber.cpp:
9788         (WTF::randomNumber):
9789         * wtf/RandomNumberSeed.h:
9790         (WTF::initializeRandomNumberGenerator):
9791         * wtf/wince/mt19937ar.c: Added.
9792         (init_genrand):
9793         (init_by_array):
9794         (genrand_int32):
9795         (genrand_int31):
9796         (genrand_real1):
9797         (genrand_real2):
9798         (genrand_real3):
9799         (genrand_res53):
9800
9801 2009-07-13  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
9802
9803         Unreviewed make dist build fix.
9804
9805         * GNUmakefile.am:
9806
9807 2009-07-13  Drew Wilson  <atwilson@google.com>
9808
9809         Reviewed by David Levin.
9810
9811         Add ENABLE(SHARED_WORKERS) flag and define SharedWorker APIs
9812         https://bugs.webkit.org/show_bug.cgi?id=26932
9813
9814         Added ENABLE(SHARED_WORKERS) flag (off by default).
9815
9816         * Configurations/FeatureDefines.xcconfig:
9817
9818 2009-07-07  Norbert Leser  <norbert.leser@nokia.com>
9819
9820         Reviewed by Maciej Stachoviak.
9821
9822         https://bugs.webkit.org/show_bug.cgi?id=27058
9823
9824         Removed superfluous parenthesis around single expression.
9825         Compilers on Symbian platform fail to properly parse and compile.
9826
9827         * JavaScriptCore/wtf/Platform.h:
9828
9829 2009-07-13  Norbert Leser  <norbert.leser@nokia.com>
9830
9831         Reviewed by Maciej Stachoviak.
9832
9833         https://bugs.webkit.org/show_bug.cgi?id=27054
9834
9835         Renamed Translator to HashTranslator
9836
9837         Codewarrior compiler (WINSCW) latest b482 cannot resolve typename
9838         mismatch between template declaration and definition
9839         (HashTranslator / Translator)
9840
9841         * wtf/HashSet.h:
9842
9843 2009-07-13  Norbert Leser  <norbert.leser@nokia.com>
9844
9845         Reviewed by Eric Seidel.
9846
9847         https://bugs.webkit.org/show_bug.cgi?id=27053
9848
9849         Ambiguity in LabelScope initialization
9850
9851         Codewarrior compiler (WINSCW) latest b482 on Symbian cannot resolve
9852         type of "0" unambiguously. Set expression explicitly to
9853         PassRefPtr<Label>::PassRefPtr()
9854
9855         * bytecompiler/BytecodeGenerator.cpp
9856
9857 2009-07-11  Simon Fraser  <simon.fraser@apple.com>
9858
9859         Enable support for accelerated compositing and 3d transforms on Leopard.
9860         <https://bugs.webkit.org/show_bug.cgi?id=20166>
9861         <rdar://problem/6120614>
9862
9863         Reviewed by Oliver Hunt.
9864
9865         * Configurations/FeatureDefines.xcconfig:
9866         * wtf/Platform.h:
9867
9868 2009-07-10  Mark Rowe  <mrowe@apple.com>
9869
9870         Second part of the "make Windows happier" dance.
9871
9872         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
9873         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
9874
9875 2009-07-10  Mark Rowe  <mrowe@apple.com>
9876
9877         Try and make the Windows build happy.
9878
9879         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
9880         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
9881
9882 2009-07-10  Kevin McCullough  <kmccullough@apple.com>
9883
9884         Reviewed by Geoffrey Garen.
9885
9886         * debugger/Debugger.h: Made this function virtual for use in WebCore's
9887         WebInspector.
9888
9889 2009-07-10  Kwang Yul Seo  <skyul@company100.net>
9890
9891         Reviewed by Darin Adler.
9892
9893         ParserArenaDeletable should override delete
9894         https://bugs.webkit.org/show_bug.cgi?id=26790
9895
9896         ParserArenaDeletable overrides new, but it does not override delete.
9897         ParserArenaDeletable must be freed by fastFree
9898         because it is allocated by fastMalloc.
9899
9900         * parser/NodeConstructors.h:
9901         (JSC::ParserArenaDeletable::operator delete):
9902         * parser/Nodes.h:
9903
9904 2009-07-10  Adam Roben  <aroben@apple.com>
9905
9906         Sort all our Xcode projects
9907
9908         Accomplished using sort-Xcode-project-file.
9909
9910         Requested by Dave Kilzer.
9911
9912         * JavaScriptCore.xcodeproj/project.pbxproj:
9913
9914 2009-07-09  Maciej Stachowiak  <mjs@apple.com>
9915
9916         Not reviewed, build fix.
9917
9918         Windows build fix for the last change.
9919
9920         * wtf/dtoa.cpp: Forgot to include Vector.h
9921
9922 2009-07-09  Maciej Stachowiak  <mjs@apple.com>
9923
9924         Reviewed by Darin Adler.
9925
9926         REGRESSION: crash in edge cases of floating point parsing.
9927         https://bugs.webkit.org/show_bug.cgi?id=27110
9928         <rdar://problem/7044458>
9929         
9930         Tests: fast/css/number-parsing-crash.html
9931                fast/css/number-parsing-crash.html
9932                fast/js/number-parsing-crash.html
9933         
9934         * wtf/dtoa.cpp:
9935         (WTF::BigInt::BigInt): Converted this to more a proper class, using a Vector
9936         with inline capacity
9937
9938         (WTF::lshift): Rearranged logic somewhat nontrivially to deal with the new way of sizing BigInts.
9939         Added an assertion to verify that invariants are maintained.
9940
9941         All other functions are adapted fairly mechanically to the above changes.
9942         (WTF::BigInt::clear):
9943         (WTF::BigInt::size):
9944         (WTF::BigInt::resize):
9945         (WTF::BigInt::words):
9946         (WTF::BigInt::append):
9947         (WTF::multadd):
9948         (WTF::s2b):
9949         (WTF::i2b):
9950         (WTF::mult):
9951         (WTF::cmp):
9952         (WTF::diff):
9953         (WTF::b2d):
9954         (WTF::d2b):
9955         (WTF::ratio):
9956         (WTF::strtod):
9957         (WTF::quorem):
9958         (WTF::dtoa):
9959
9960 2009-07-09  Drew Wilson  <atwilson@google.com>
9961
9962         Reviewed by Alexey Proskuryakov.
9963
9964         Turned on CHANNEL_MESSAGING by default because the MessageChannel API
9965         can now be implemented for Web Workers and is reasonably stable.
9966
9967         * Configurations/FeatureDefines.xcconfig:
9968
9969 2009-07-09  Oliver Hunt  <oliver@apple.com>
9970
9971         * interpreter/Interpreter.cpp:
9972         (JSC::Interpreter::privateExecute):
9973
9974 2009-07-09  Oliver Hunt  <oliver@apple.com>
9975
9976         Reviewed by Darin Adler.
9977
9978         Bug 27016 - Interpreter crashes due to invalid array indexes
9979         <https://bugs.webkit.org/show_bug.cgi?id=27016>
9980
9981         Unsigned vs signed conversions results in incorrect behaviour in
9982         64bit interpreter builds.
9983
9984         * interpreter/Interpreter.cpp:
9985         (JSC::Interpreter::privateExecute):
9986
9987 2009-07-09  Dimitri Glazkov  <dglazkov@chromium.org>
9988
9989         Reviewed by Darin Fisher.
9990
9991         [Chromium] Upstream JavaScriptCore.gypi, the project file for Chromium build.
9992         https://bugs.webkit.org/show_bug.cgi?id=27135
9993
9994         * JavaScriptCore.gypi: Added.
9995
9996 2009-07-09  Joe Mason  <joe.mason@torchmobile.com>
9997
9998         Reviewed by George Staikos.
9999         
10000         Authors: Yong Li <yong.li@torchmobile.com>, Joe Mason <joe.mason@torchmobile.com>
10001
10002         https://bugs.webkit.org/show_bug.cgi?id=27031
10003         Add an override for deleteOwnedPtr(HDC) on Windows
10004         
10005         * wtf/OwnPtrCommon.h:
10006         * wtf/OwnPtrWin.cpp:
10007         (WTF::deleteOwnedPtr):
10008
10009 2009-07-09  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
10010
10011         Reviewed by Darin Adler.
10012
10013         Guard singal.h dependency with HAVE(SIGNAL_H) to enable building jsc
10014         on SYMBIAN.
10015
10016         https://bugs.webkit.org/show_bug.cgi?id=27026
10017
10018         Based on Norbert Leser's work.
10019
10020         * jsc.cpp:
10021         (printUsageStatement):
10022         (parseArguments):
10023         * wtf/Platform.h:
10024
10025 2009-07-07  Gavin Barraclough  <barraclough@apple.com>
10026
10027         Reviewed by Sam Weinig.
10028
10029         Stop loading constants into the register file.
10030
10031         Instead, use high register values (highest bit bar the sign bit set) to indicate
10032         constants in the instruction stream, and when we encounter such a value load it
10033         directly from the CodeBlock.
10034
10035         Since constants are no longer copied into the register file, this patch renders
10036         the 'unexpected constant' mechanism redundant, and removes it.
10037
10038         2% improvement, thanks to Sam Weinig.
10039
10040         * bytecode/CodeBlock.cpp:
10041         (JSC::CodeBlock::dump):
10042         (JSC::CodeBlock::CodeBlock):
10043         (JSC::CodeBlock::mark):
10044         (JSC::CodeBlock::shrinkToFit):
10045         * bytecode/CodeBlock.h:
10046         (JSC::CodeBlock::isTemporaryRegisterIndex):
10047         (JSC::CodeBlock::constantRegister):
10048         (JSC::CodeBlock::isConstantRegisterIndex):
10049         (JSC::CodeBlock::getConstant):
10050         (JSC::ExecState::r):
10051         * bytecode/Opcode.h:
10052         * bytecompiler/BytecodeGenerator.cpp:
10053         (JSC::BytecodeGenerator::preserveLastVar):
10054         (JSC::BytecodeGenerator::BytecodeGenerator):
10055         (JSC::BytecodeGenerator::addConstantValue):
10056         (JSC::BytecodeGenerator::emitEqualityOp):
10057         (JSC::BytecodeGenerator::emitLoad):
10058         (JSC::BytecodeGenerator::emitResolveBase):
10059         (JSC::BytecodeGenerator::emitResolveWithBase):
10060         (JSC::BytecodeGenerator::emitNewError):
10061         * bytecompiler/BytecodeGenerator.h:
10062         (JSC::BytecodeGenerator::emitNode):
10063         * interpreter/CallFrame.h:
10064         (JSC::ExecState::noCaller):
10065         (JSC::ExecState::hasHostCallFrameFlag):
10066         (JSC::ExecState::addHostCallFrameFlag):
10067         (JSC::ExecState::removeHostCallFrameFlag):
10068         * interpreter/Interpreter.cpp:
10069         (JSC::Interpreter::resolve):
10070         (JSC::Interpreter::resolveSkip):
10071         (JSC::Interpreter::resolveGlobal):
10072         (JSC::Interpreter::resolveBase):
10073         (JSC::Interpreter::resolveBaseAndProperty):
10074         (JSC::Interpreter::resolveBaseAndFunc):
10075         (JSC::Interpreter::dumpRegisters):
10076         (JSC::Interpreter::throwException):
10077         (JSC::Interpreter::createExceptionScope):
10078         (JSC::Interpreter::privateExecute):
10079         (JSC::Interpreter::retrieveArguments):
10080         * jit/JIT.cpp:
10081         (JSC::JIT::privateCompileMainPass):
10082         * jit/JITInlineMethods.h:
10083         (JSC::JIT::emitLoadDouble):
10084         (JSC::JIT::emitLoadInt32ToDouble):
10085         * jit/JITOpcodes.cpp:
10086         (JSC::JIT::emit_op_new_error):
10087         (JSC::JIT::emit_op_enter):
10088         (JSC::JIT::emit_op_enter_with_activation):
10089         * parser/Nodes.cpp:
10090         (JSC::DeleteResolveNode::emitBytecode):
10091         (JSC::DeleteValueNode::emitBytecode):
10092         (JSC::PrefixResolveNode::emitBytecode):
10093         * runtime/JSActivation.cpp:
10094         (JSC::JSActivation::JSActivation):
10095         * wtf/Platform.h:
10096
10097 2009-07-07  Mark Rowe  <mrowe@apple.com>
10098
10099         Reviewed by Darin Adler.
10100
10101         Fix <https://bugs.webkit.org/show_bug.cgi?id=27025> / <rdar://problem/7033448>.
10102         Bug 27025: Crashes and regression test failures related to regexps in 64-bit
10103
10104         For x86_64 RegexGenerator uses rbx, a callee-save register, as a scratch register but
10105         neglects to save and restore it.  The change in handling of the output vector in r45545
10106         altered code generation so that the RegExp::match was now storing important data in rbx,
10107         which caused crashes and bogus results when it was clobbered.
10108
10109         * yarr/RegexJIT.cpp:
10110         (JSC::Yarr::RegexGenerator::generateEnter): Save rbx.
10111         (JSC::Yarr::RegexGenerator::generateReturn): Restore rbx.
10112
10113 2009-07-06  Ada Chan  <adachan@apple.com>
10114
10115         Reviewed by Darin Adler and Mark Rowe.
10116
10117         Decommitted spans are added to the list of normal spans rather than 
10118         the returned spans in TCMalloc_PageHeap::Delete().
10119         https://bugs.webkit.org/show_bug.cgi?id=26998
10120         
10121         In TCMalloc_PageHeap::Delete(), the deleted span can be decommitted in 
10122         the process of merging with neighboring spans that are also decommitted.  
10123         The merged span needs to be placed in the list of returned spans (spans 
10124         whose memory has been returned to the system).  Right now it's always added 
10125         to the list of the normal spans which can theoretically cause thrashing.  
10126
10127         * wtf/FastMalloc.cpp:
10128         (WTF::TCMalloc_PageHeap::Delete):
10129
10130 2009-07-05  Lars Knoll  <lars.knoll@nokia.com>
10131
10132         Reviewed by Maciej Stachowiak.
10133
10134         https://bugs.webkit.org/show_bug.cgi?id=26843
10135
10136         Fix run-time crashes in JavaScriptCore with the Metrowerks compiler on Symbian.
10137
10138         The Metrowerks compiler on the Symbian platform moves the globally
10139         defined Hashtables into read-only memory, despite one of the members
10140         being mutable. This causes crashes at run-time due to write access to
10141         read-only memory.
10142
10143         Avoid the use of const with this compiler by introducing the
10144         JSC_CONST_HASHTABLE macro.
10145
10146         Based on idea by Norbert Leser.
10147
10148         * runtime/Lookup.h: Define JSC_CONST_HASHTABLE as const for !WINSCW.
10149         * create_hash_table: Use JSC_CONST_HASHTABLE for hashtables.
10150         * runtime/JSGlobalData.cpp: Import various global hashtables via the macro.
10151
10152 2009-07-04  Dan Bernstein  <mitz@apple.com>
10153
10154         - debug build fix
10155
10156         * runtime/RegExpConstructor.cpp:
10157         (JSC::RegExpConstructor::getLastParen):
10158
10159 2009-07-03  Yong Li  <yong.li@torchmobile.com>
10160
10161         Reviewed by Maciej Stachowiak (and revised slightly)
10162
10163         RegExp::match to be optimized
10164         https://bugs.webkit.org/show_bug.cgi?id=26957
10165
10166         Allow regexp matching to use Vectors with inline capacity instead of
10167         allocating a new ovector buffer every time.
10168         
10169         ~5% speedup on SunSpider string-unpack-code test, 0.3% on SunSpider overall.
10170
10171         * runtime/RegExp.cpp:
10172         (JSC::RegExp::match):
10173         * runtime/RegExp.h:
10174         * runtime/RegExpConstructor.cpp:
10175         (JSC::RegExpConstructorPrivate::RegExpConstructorPrivate):
10176         (JSC::RegExpConstructorPrivate::lastOvector):
10177         (JSC::RegExpConstructorPrivate::tempOvector):
10178         (JSC::RegExpConstructorPrivate::changeLastOvector):
10179         (JSC::RegExpConstructor::performMatch):
10180         (JSC::RegExpMatchesArray::RegExpMatchesArray):
10181         (JSC::RegExpMatchesArray::fillArrayInstance):
10182         (JSC::RegExpConstructor::getBackref):
10183         (JSC::RegExpConstructor::getLastParen):
10184         (JSC::RegExpConstructor::getLeftContext):
10185         (JSC::RegExpConstructor::getRightContext):
10186         * runtime/StringPrototype.cpp:
10187         (JSC::stringProtoFuncSplit):
10188
10189 2009-06-30  Kwang Yul Seo  <skyul@company100.net>
10190
10191         Reviewed by Eric Seidel.
10192
10193         Override operator new/delete with const std::nothrow_t& as the second
10194         argument.
10195         https://bugs.webkit.org/show_bug.cgi?id=26792
10196
10197         On Windows CE, operator new/delete, new[]/delete[] with const
10198         std::nothrow_t& must be overrided because some standard template
10199         libraries use these operators.
10200
10201         The problem occurs when memory allocated by new(size_t s, const
10202         std::nothrow_t&) is freed by delete(void* p). This causes the umatched
10203         malloc/free problem.
10204
10205         The patch overrides all new, delete, new[] and delete[] to use
10206         fastMaloc and fastFree consistently.
10207
10208         * wtf/FastMalloc.h:
10209         (throw):
10210
10211 2009-06-30  Gabor Loki  <loki@inf.u-szeged.hu>
10212
10213         Reviewed by Sam Weinig.
10214
10215         <https://bugs.webkit.org/show_bug.cgi?id=24986>
10216
10217         Remove unnecessary references to AssemblerBuffer.
10218
10219         * interpreter/Interpreter.cpp:
10220         * interpreter/Interpreter.h:
10221
10222 2009-06-29  David Levin  <levin@chromium.org>
10223
10224         Reviewed by Oliver Hunt.
10225
10226         Still seeing occasional leaks from UString::sharedBuffer code
10227         https://bugs.webkit.org/show_bug.cgi?id=26420
10228
10229         The problem is that the pointer to the memory allocation isn't visible
10230         by "leaks" due to the lower bits being used as flags.  The fix is to
10231         make the pointer visible in memory (in debug only). The downside of
10232         this fix that the memory allocated by sharedBuffer will still look like
10233         a leak in non-debug builds when any flags are set.
10234
10235         * wtf/PtrAndFlags.h:
10236         (WTF::PtrAndFlags::set):
10237
10238 2009-06-29  Sam Weinig  <sam@webkit.org>
10239
10240         Reviewed by Mark Rowe.
10241
10242         Remove more unused scons support.
10243
10244         * SConstruct: Removed.
10245
10246 2009-06-29  Oliver Hunt  <oliver@apple.com>
10247
10248         Reviewed by Gavin Barraclough.
10249
10250         <rdar://problem/7016214> JSON.parse fails to parse valid JSON with most Unicode characters
10251         <https://bugs.webkit.org/show_bug.cgi?id=26802>
10252
10253         In the original JSON.parse patch unicode was handled correctly, however in some last
10254         minute "clean up" I oversimplified isSafeStringCharacter.  This patch corrects this bug.
10255
10256         * runtime/LiteralParser.cpp:
10257         (JSC::isSafeStringCharacter):
10258         (JSC::LiteralParser::Lexer::lexString):
10259
10260 2009-06-26  Oliver Hunt  <oliver@apple.com>
10261
10262         Reviewed by Dan Bernstein.
10263
10264         <rdar://problem/7009684> REGRESSION(r45039): Crashes inside JSEvent::put on PowerPC (26746)
10265         <https://bugs.webkit.org/show_bug.cgi?id=26746>
10266
10267         Fix for r45039 incorrectly uncached a get_by_id by converting it to put_by_id.  Clearly this
10268         is less than correct.  This patch corrects that error.
10269
10270         * interpreter/Interpreter.cpp:
10271         (JSC::Interpreter::tryCacheGetByID):
10272
10273 2009-06-26  Eric Seidel  <eric@webkit.org>
10274
10275         No review, only rolling out r45259.
10276
10277         Roll out r45259 after crash appeared on the bots:
10278         plugins/undefined-property-crash.html
10279         ASSERTION FAILED: s <= HeapConstants<heapType>::cellSize
10280         (leopard-intel-debug-tests/build/JavaScriptCore/runtime/Collector.cpp:278
10281         void* JSC::Heap::heapAllocate(size_t) [with JSC::HeapType heapType = PrimaryHeap])
10282
10283         * runtime/DateInstance.cpp:
10284         * runtime/Identifier.cpp:
10285         * runtime/Lookup.h:
10286         * runtime/RegExpConstructor.cpp:
10287         * runtime/RegExpObject.h:
10288         * runtime/ScopeChain.h:
10289         * runtime/UString.h:
10290
10291 2009-06-26  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
10292
10293         Reviewed by Simon Hausmann.
10294
10295         Add support for QDataStream operators to Vector.
10296
10297         * wtf/Vector.h:
10298         (WTF::operator<<):
10299         (WTF::operator>>):
10300
10301 2009-06-24  Sam Weinig  <sam@webkit.org>
10302
10303         Reviewed by Gavin Barraclough.
10304
10305         Make the opcode sampler work once again.
10306
10307         * jit/JIT.h:
10308         (JSC::JIT::compileGetByIdProto):
10309         (JSC::JIT::compileGetByIdSelfList):
10310         (JSC::JIT::compileGetByIdProtoList):
10311         (JSC::JIT::compileGetByIdChainList):
10312         (JSC::JIT::compileGetByIdChain):
10313         (JSC::JIT::compilePutByIdTransition):
10314         (JSC::JIT::compileCTIMachineTrampolines):
10315         (JSC::JIT::compilePatchGetArrayLength):
10316         * jit/JITStubCall.h:
10317         (JSC::JITStubCall::call):
10318
10319 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
10320
10321         Reviewed by Maciej Stachowiak.
10322
10323         Extend FastAllocBase.h with 'using WTF::FastAllocBase' to avoid
10324         unnecessary WTF:: usings.
10325         Remove existing unnecessary WTF:: usings.
10326
10327         * interpreter/Interpreter.h:
10328         * profiler/CallIdentifier.h:
10329         * runtime/ScopeChain.h:
10330         * wtf/FastAllocBase.h:
10331
10332 2009-06-24  David Levin  <levin@chromium.org>
10333
10334         Fix all builds.
10335
10336         * bytecode/CodeBlock.h:
10337         * bytecompiler/BytecodeGenerator.h:
10338         * interpreter/Register.h:
10339
10340 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
10341
10342         Reviewed by Maciej Stachowiak.
10343         
10344         https://bugs.webkit.org/show_bug.cgi?id=26677
10345
10346         Inherits CodeBlock class from FastAllocBase because it
10347         has been instantiated by 'new' in JavaScriptCore/bytecode/CodeBlock.h:217.
10348
10349         * bytecode/CodeBlock.h:
10350
10351 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
10352
10353         Reviewed by Maciej Stachowiak.
10354         
10355         https://bugs.webkit.org/show_bug.cgi?id=26676
10356
10357         Inherits BytecodeGenerator class from FastAllocBase because it has been
10358         instantiated by 'new' in JavaScriptCore/parser/Nodes.cpp:1892.
10359
10360         * bytecompiler/BytecodeGenerator.h:
10361
10362 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
10363
10364         Reviewed by Maciej Stachowiak.
10365         
10366         https://bugs.webkit.org/show_bug.cgi?id=26675
10367
10368         Inherits Register class from FastAllocBase because it has been
10369         instantiated by 'new' in JavaScriptCore/runtime/JSVariableObject.h:149.
10370
10371         * interpreter/Register.h:
10372
10373 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
10374
10375         Reviewed by Darin Adler.
10376         
10377         https://bugs.webkit.org/show_bug.cgi?id=26674
10378
10379         Inherits HashMap class from FastAllocBase because it has been
10380         instantiated by 'new' in JavaScriptCore/runtime/Structure.cpp:458.
10381
10382         * wtf/HashMap.h:
10383
10384 2009-06-24  Oliver Hunt  <oliver@apple.com>
10385
10386         Reviewed by Darin Adler.
10387
10388         <rdar://problem/6940519> REGRESSION (Safari 4 Public Beta - TOT): google.com/adplanner shows blank page instead of site details in "basic research'
10389
10390         The problem was caused by the page returned with a function using a
10391         var declaration list containing around ~3000 variables.  The solution
10392         to this is to flatten the comma expression representation and make
10393         codegen comma expressions and initializer lists iterative rather than
10394         recursive.
10395
10396         * parser/Grammar.y:
10397         * parser/NodeConstructors.h:
10398         (JSC::CommaNode::CommaNode):
10399         * parser/Nodes.cpp:
10400         (JSC::CommaNode::emitBytecode):
10401         * parser/Nodes.h:
10402         (JSC::ExpressionNode::isCommaNode):
10403         (JSC::CommaNode::isCommaNode):
10404         (JSC::CommaNode::append):
10405
10406 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
10407
10408         Reviewed by Maciej Stachowiak.
10409
10410         https://bugs.webkit.org/show_bug.cgi?id=26645
10411
10412         Inherits ScopeChainNode class from FastAllocBase because it has been
10413         instantiated by 'new' in JavaScriptCore/runtime/ScopeChain.h:95.
10414
10415         * wtf/RefPtr.h:
10416
10417 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
10418
10419         Reviewed by Darin Adler.
10420
10421         https://bugs.webkit.org/show_bug.cgi?id=26648
10422
10423         Inherits Deque class from FastAllocBase because it has been
10424         instantiated by 'new' with DEFINE_STATIC_LOCAL macro in 
10425         JavaScriptCore/wtf/MainThread.cpp:62.
10426
10427         * wtf/Deque.h:
10428
10429 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
10430
10431         Reviewed by Darin Adler.
10432
10433         https://bugs.webkit.org/show_bug.cgi?id=26644
10434
10435         Inherits RefPtr class from FastAllocBase because it has been
10436         instantiated by 'new' in JavaScriptCore/runtime/StructureChain.cpp:41.
10437
10438         * wtf/RefPtr.h:
10439
10440 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
10441
10442         Reviewed by Darin Adler.
10443
10444         Inherits HashSet class from FastAllocBase, because it has been
10445         instantiated by 'new' in JavaScriptCore/runtime/Collector.h:116.
10446
10447         * wtf/HashSet.h:
10448
10449 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
10450
10451         Reviewed by Darin Adler.
10452
10453         Inherits Vector class from FastAllocBase because it has been
10454         instantiated by 'new' in JavaScriptCore/runtime/Structure.cpp:633.
10455
10456         * wtf/Vector.h:
10457
10458 2009-06-24  Norbert Leser  <norbert.leser@nokia.com>
10459
10460         Reviewed by Maciej Stachoviak.
10461
10462         The BytecodeGenerator objects were instantiated on stack, which takes up ~38kB per instance
10463         (each instance includes copy of JSC::CodeBlock with large SymbolTable, etc.).
10464         Specifically, since there is nested invocation (e.g., GlobalCode --> FunctionCode),
10465         the stack overflows immediately on Symbian hardware (max. 80 kB).
10466         Proposed change allocates generator objects on heap.
10467         Performance impact (if any) should be negligible and change is proposed as general fix,
10468         rather than ifdef'd for SYMBIAN.
10469
10470         * parser/Nodes.cpp:
10471         (JSC::ProgramNode::generateBytecode):
10472         (JSC::EvalNode::generateBytecode):
10473         (JSC::EvalNode::bytecodeForExceptionInfoReparse):
10474         (JSC::FunctionBodyNode::generateBytecode):
10475         (JSC::FunctionBodyNode::bytecodeForExceptionInfoReparse):
10476
10477 2009-06-23  Oliver Hunt  <oliver@apple.com>
10478
10479         Reviewed by Gavin Barraclough.
10480
10481         <rdar://problem/6992806> REGRESSION: Enumeration can skip new properties in cases of prototypes that have more than 64 (26593)
10482         <https://bugs.webkit.org/show_bug.cgi?id=26593>
10483
10484         Do not attempt to cache structure chains if they contain a dictionary at any level.
10485
10486         * interpreter/Interpreter.cpp:
10487         (JSC::Interpreter::tryCachePutByID):
10488         (JSC::Interpreter::tryCacheGetByID):
10489         * jit/JITStubs.cpp:
10490         (JSC::JITThunks::tryCachePutByID):
10491         * runtime/Structure.cpp:
10492         (JSC::Structure::getEnumerablePropertyNames):
10493         (JSC::Structure::addPropertyTransition):
10494         * runtime/StructureChain.cpp:
10495         (JSC::StructureChain::isCacheable):
10496         * runtime/StructureChain.h:
10497
10498 2009-06-23  Yong Li  <yong.li@torchmobile.com>
10499
10500         Reviewed by George Staikos.
10501
10502         https://bugs.webkit.org/show_bug.cgi?id=26654
10503         Add the proper export define for the JavaScriptCore API when building for WINCE.
10504
10505         * API/JSBase.h:
10506
10507 2009-06-23  Joe Mason  <joe.mason@torchmobile.com>
10508
10509         Reviewed by Adam Treat.
10510
10511         Authors: Yong Li <yong.li@torchmobile.com>, Joe Mason <joe.mason@torchmobile.com>
10512
10513         https://bugs.webkit.org/show_bug.cgi?id=26611
10514         Implement currentThreadStackBase on WINCE by adding a global,
10515         g_stackBase, which must be set to the address of a local variable
10516         by the caller before calling any WebKit function that invokes JSC.
10517
10518         * runtime/Collector.cpp:
10519         (JSC::isPageWritable):
10520         (JSC::getStackBase):
10521           Starts at the top of the stack and returns the entire range of
10522           consecutive writable pages as an estimate of the actual stack.
10523           This will be much bigger than the actual stack range, so some
10524           dead objects can't be collected, but it guarantees live objects
10525           aren't collected prematurely.
10526
10527         (JSC::currentThreadStackBase):
10528           On WinCE, returns g_stackBase if set or call getStackBase as a
10529           fallback if not.
10530
10531 2009-06-23  Oliver Hunt  <oliver@apple.com>
10532
10533         Reviewed by Alexey Proskuryakov.
10534
10535         Fix stupid performance problem in the LiteralParser
10536
10537         The LiteralParser was making a new UString in order to use
10538         toDouble, however UString's toDouble allows a much wider range
10539         of numberic strings than the LiteralParser accepts, and requires
10540         an additional heap allocation or two for the construciton of the
10541         UString.  To rectify this we just call WTF::dtoa directly using
10542         a stack allocated buffer to hold the validated numeric literal.
10543
10544         * runtime/LiteralParser.cpp:
10545         (JSC::LiteralParser::Lexer::lexNumber):
10546         (JSC::LiteralParser::parse):
10547         * runtime/LiteralParser.h:
10548
10549 2009-06-22  Oliver Hunt  <oliver@apple.com>
10550
10551         Reviewed by Alexey Proskuryakov.
10552
10553         Bug 26640: JSON.stringify needs to special case Boolean objects
10554         <https://bugs.webkit.org/show_bug.cgi?id=26640>
10555
10556         Add special case handling of the Boolean object so we match current
10557         ES5 errata.
10558
10559         * runtime/JSONObject.cpp:
10560         (JSC::unwrapBoxedPrimitive): renamed from unwrapNumberOrString
10561         (JSC::gap):
10562         (JSC::Stringifier::appendStringifiedValue):
10563
10564 2009-06-22  Oliver Hunt  <oliver@apple.com>
10565
10566         Reviewed by Darin Adler.
10567
10568         Bug 26591: Support revivers in JSON.parse
10569         <https://bugs.webkit.org/show_bug.cgi?id=26591>
10570
10571         Add reviver support to JSON.parse.  This completes the JSON object.
10572
10573         * runtime/JSONObject.cpp:
10574         (JSC::Walker::Walker):
10575         (JSC::Walker::callReviver):
10576         (JSC::Walker::walk):
10577         (JSC::JSONProtoFuncParse):
10578
10579 2009-06-21  Oliver Hunt  <oliver@apple.com>
10580
10581         Reviewed by Darin Adler.
10582
10583         Bug 26592: Support standard toJSON functions
10584         <https://bugs.webkit.org/show_bug.cgi?id=26592>
10585
10586         Add support for the standard Date.toJSON function.
10587
10588         * runtime/DatePrototype.cpp:
10589         (JSC::dateProtoFuncToJSON):
10590
10591 2009-06-21  Oliver Hunt  <oliver@apple.com>
10592
10593         Reviewed by Sam Weinig.
10594
10595         Bug 26594: JSC needs to support Date.toISOString
10596         <https://bugs.webkit.org/show_bug.cgi?id=26594>
10597
10598         Add support for Date.toISOString.
10599
10600         * runtime/DatePrototype.cpp:
10601         (JSC::dateProtoFuncToISOString):
10602
10603 2009-06-21  Oliver Hunt  <oliver@apple.com>
10604
10605         Remove dead code.
10606
10607         * runtime/LiteralParser.cpp:
10608         (JSC::LiteralParser::parse):
10609
10610 2009-06-21  Oliver Hunt  <oliver@apple.com>
10611
10612         Reviewed by Darin Adler and Cameron Zwarich.
10613
10614         Bug 26587: Support JSON.parse
10615         <https://bugs.webkit.org/show_bug.cgi?id=26587>
10616
10617         Extend the LiteralParser to support the full strict JSON
10618         grammar, fix a few places where the grammar was incorrectly
10619         lenient.   Doesn't yet support the JSON.parse reviver function
10620         but that does not block the JSON.parse functionality itself.
10621
10622         * interpreter/Interpreter.cpp:
10623         (JSC::Interpreter::callEval):
10624         * runtime/JSGlobalObjectFunctions.cpp:
10625         (JSC::globalFuncEval):
10626         * runtime/JSONObject.cpp:
10627         (JSC::JSONProtoFuncParse):
10628         * runtime/LiteralParser.cpp:
10629         (JSC::LiteralParser::Lexer::lex):
10630         (JSC::isSafeStringCharacter):
10631         (JSC::LiteralParser::Lexer::lexString):
10632         (JSC::LiteralParser::parse):
10633         * runtime/LiteralParser.h:
10634         (JSC::LiteralParser::LiteralParser):
10635         (JSC::LiteralParser::tryJSONParse):
10636         (JSC::LiteralParser::):
10637         (JSC::LiteralParser::Lexer::Lexer):
10638
10639 2009-06-21  David Levin  <levin@chromium.org>
10640
10641         Reviewed by NOBODY (speculative build fix for windows).
10642
10643         Simply removed some whitespace form this file to make windows build wtf and
10644         hopefully copy the new MessageQueque.h so that WebCore picks it up.
10645
10646         * wtf/Assertions.cpp:
10647
10648 2009-06-21  Drew Wilson  <atwilson@google.com>
10649
10650         Reviewed by David Levin.
10651
10652         <https://bugs.webkit.org/show_bug.cgi?id=25043>
10653         Added support for multi-threaded MessagePorts.
10654
10655         * wtf/MessageQueue.h:
10656         (WTF::::appendAndCheckEmpty):
10657             Added API to test whether the queue was empty before adding an element.
10658   
10659 2009-06-20  David D. Kilzer  <ddkilzer@webkit.org>
10660
10661         Fix namespace comment in SegmentedVector.h
10662
10663         * wtf/SegmentedVector.h: Updated namespace comment to reflect
10664         new namespace after r44897.
10665
10666 2009-06-20  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
10667
10668         Bug 24986: ARM JIT port
10669         <https://bugs.webkit.org/show_bug.cgi?id=24986>
10670
10671         Reviewed by Oliver Hunt.
10672
10673         An Iterator added for SegmentedVector. Currently
10674         only the pre ++ operator is supported.
10675
10676         * wtf/SegmentedVector.h:
10677         (WTF::SegmentedVectorIterator::~SegmentedVectorIterator):
10678         (WTF::SegmentedVectorIterator::operator*):
10679         (WTF::SegmentedVectorIterator::operator->):
10680         (WTF::SegmentedVectorIterator::operator++):
10681         (WTF::SegmentedVectorIterator::operator==):
10682         (WTF::SegmentedVectorIterator::operator!=):
10683         (WTF::SegmentedVectorIterator::operator=):
10684         (WTF::SegmentedVectorIterator::SegmentedVectorIterator):
10685         (WTF::SegmentedVector::alloc):
10686         (WTF::SegmentedVector::begin):
10687         (WTF::SegmentedVector::end):
10688
10689 2009-06-20  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
10690
10691         Bug 24986: ARM JIT port
10692         <https://bugs.webkit.org/show_bug.cgi?id=24986>
10693
10694         Reviewed by Oliver Hunt.
10695
10696         Move SegmentedVector to /wtf subdirectory
10697         and change "namespace JSC" to "namespace WTF"
10698
10699         Additional build file updates by David Kilzer.
10700
10701         * GNUmakefile.am: Updated path to SegmentedVector.h.
10702         * JavaScriptCore.order: Updated SegmentedVector namespace from
10703         JSC to WTF in mangled C++ method name.
10704         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
10705         Removed reference to bytecompiler\SegmentedVector.h.
10706         * JavaScriptCore.vcproj/WTF/WTF.vcproj: Added reference to
10707         wtf\SegmentedVector.h.
10708         * JavaScriptCore.xcodeproj/project.pbxproj: Moved
10709         SegmentedVector.h definition from bytecompiler subdirectory to
10710         wtf subdirectory.
10711         * bytecompiler/BytecodeGenerator.h: Updated #include path to
10712         SegmentedVector.h and prepended WTF:: namespace to its use.
10713         * parser/Lexer.h: Ditto.
10714         * wtf/SegmentedVector.h: Renamed from JavaScriptCore/bytecompiler/SegmentedVector.h.
10715         (WTF::SegmentedVector::SegmentedVector):
10716         (WTF::SegmentedVector::~SegmentedVector):
10717         (WTF::SegmentedVector::size):
10718         (WTF::SegmentedVector::at):
10719         (WTF::SegmentedVector::operator[]):
10720         (WTF::SegmentedVector::last):
10721         (WTF::SegmentedVector::append):
10722         (WTF::SegmentedVector::removeLast):
10723         (WTF::SegmentedVector::grow):
10724         (WTF::SegmentedVector::clear):
10725         (WTF::SegmentedVector::deleteAllSegments):
10726         (WTF::SegmentedVector::segmentExistsFor):
10727         (WTF::SegmentedVector::segmentFor):
10728         (WTF::SegmentedVector::subscriptFor):
10729         (WTF::SegmentedVector::ensureSegmentsFor):
10730         (WTF::SegmentedVector::ensureSegment):
10731
10732 2009-06-19  Gavin Barraclough  <barraclough@apple.com>
10733
10734         Reviewed by NOBODY (build fix take 2 - rename FIELD_OFFSET to something that doesn't conflict with winnt.h).
10735
10736         * jit/JIT.cpp:
10737         (JSC::JIT::privateCompile):
10738         (JSC::JIT::privateCompileCTIMachineTrampolines):
10739         (JSC::JIT::emitGetVariableObjectRegister):
10740         (JSC::JIT::emitPutVariableObjectRegister):
10741         * jit/JIT.h:
10742         * jit/JITArithmetic.cpp:
10743         (JSC::JIT::emit_op_rshift):
10744         (JSC::JIT::emitSlow_op_jnless):
10745         (JSC::JIT::emitSlow_op_jnlesseq):
10746         (JSC::JIT::compileBinaryArithOp):
10747         * jit/JITCall.cpp:
10748         (JSC::JIT::compileOpCallInitializeCallFrame):
10749         (JSC::JIT::compileOpCall):
10750         * jit/JITInlineMethods.h:
10751         (JSC::JIT::restoreArgumentReference):
10752         (JSC::JIT::checkStructure):
10753         * jit/JITOpcodes.cpp:
10754         (JSC::JIT::emit_op_instanceof):
10755         (JSC::JIT::emit_op_get_scoped_var):
10756         (JSC::JIT::emit_op_put_scoped_var):
10757         (JSC::JIT::emit_op_construct_verify):
10758         (JSC::JIT::emit_op_resolve_global):
10759         (JSC::JIT::emit_op_jeq_null):
10760         (JSC::JIT::emit_op_jneq_null):
10761         (JSC::JIT::emit_op_to_jsnumber):
10762         (JSC::JIT::emit_op_catch):
10763         (JSC::JIT::emit_op_eq_null):
10764         (JSC::JIT::emit_op_neq_null):
10765         (JSC::JIT::emit_op_convert_this):
10766         (JSC::JIT::emit_op_profile_will_call):
10767         (JSC::JIT::emit_op_profile_did_call):
10768         (JSC::JIT::emitSlow_op_get_by_val):
10769         * jit/JITPropertyAccess.cpp:
10770         (JSC::JIT::emit_op_get_by_val):
10771         (JSC::JIT::emit_op_put_by_val):
10772         (JSC::JIT::emit_op_method_check):
10773         (JSC::JIT::compileGetByIdHotPath):
10774         (JSC::JIT::emit_op_put_by_id):
10775         (JSC::JIT::compilePutDirectOffset):
10776         (JSC::JIT::compileGetDirectOffset):
10777         (JSC::JIT::privateCompilePutByIdTransition):
10778         (JSC::JIT::privateCompilePatchGetArrayLength):
10779         * jit/JITStubs.cpp:
10780         (JSC::JITThunks::JITThunks):
10781
10782 2009-06-19  Gavin Barraclough  <barraclough@apple.com>
10783
10784         Reviewed by NOBODY (Windows build fix).
10785
10786         * jit/JIT.h:
10787         * jit/JITInlineMethods.h:
10788
10789 2009-06-19  Gabor Loki  <loki@inf.u-szeged.hu>
10790
10791         Reviewed by Gavin Barraclough.
10792
10793         Reorganize ARM architecture specific macros.
10794         Use PLATFORM_ARM_ARCH(7) instead of PLATFORM(ARM_V7).
10795
10796         Bug 24986: ARM JIT port
10797         <https://bugs.webkit.org/show_bug.cgi?id=24986>
10798
10799         * assembler/ARMv7Assembler.h:
10800         * assembler/AbstractMacroAssembler.h:
10801         (JSC::AbstractMacroAssembler::Imm32::Imm32):
10802         * assembler/MacroAssembler.h:
10803         * assembler/MacroAssemblerCodeRef.h:
10804         (JSC::MacroAssemblerCodePtr::MacroAssemblerCodePtr):
10805         * jit/ExecutableAllocator.h:
10806         (JSC::ExecutableAllocator::cacheFlush):
10807         * jit/JIT.h:
10808         * jit/JITInlineMethods.h:
10809         (JSC::JIT::restoreArgumentReferenceForTrampoline):
10810         * jit/JITStubs.cpp:
10811         * jit/JITStubs.h:
10812         * wtf/Platform.h:
10813         * yarr/RegexJIT.cpp:
10814         (JSC::Yarr::RegexGenerator::generateEnter):
10815         (JSC::Yarr::RegexGenerator::generateReturn):
10816
10817 2009-06-19  Gavin Barraclough  <barraclough@apple.com>
10818
10819         Reviewed by Oliver Hunt.
10820
10821         Fix armv7 JIT build issues.
10822
10823         Unfortunate the arm compiler does not like the use of offsetof on JITStackFrame (since it now contains non POD types),
10824         and the FIELD_OFFSET macro does not appear constantish enough for it to be happy with its use in COMPILE_ASSERT macros.
10825
10826         * Replace offsetofs with FIELD_OFFSETs (safe on C++ objects).
10827         * Move COMPILE_ASSERTs defending layout of JITStackFrame structure on armv7 into JITThunks constructor.
10828
10829         * jit/JIT.cpp:
10830         * jit/JIT.h:
10831         * jit/JITInlineMethods.h:
10832         (JSC::JIT::restoreArgumentReference):
10833         * jit/JITOpcodes.cpp:
10834         (JSC::JIT::emit_op_catch):
10835         * jit/JITStubs.cpp:
10836         (JSC::JITThunks::JITThunks):
10837
10838 2009-06-19  Adam Treat  <adam.treat@torchmobile.com>
10839
10840         Blind attempt at build fix.
10841
10842         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
10843         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
10844
10845 2009-06-19  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
10846
10847         Reviewed by Oliver Hunt.
10848
10849         Inherits CallIdentifier struct from FastAllocBase because it has been
10850         instantiated by 'new' in JavaScriptCore/profiler/CallIdentifier.h:86.
10851
10852         * wtf/HashCountedSet.h:
10853
10854 2009-06-19  Adam Treat  <adam.treat@torchmobile.com>
10855
10856         Reviewed by Oliver Hunt.
10857
10858         https://bugs.webkit.org/show_bug.cgi?id=26540
10859         Modify the test shell to add a new function 'checkSyntax' that will
10860         only parse the source instead of executing it. In this way we can test
10861         pure parsing performance against some of the larger scripts in the wild.
10862
10863         * jsc.cpp:
10864         (GlobalObject::GlobalObject):
10865         (functionCheckSyntax):
10866
10867 2009-06-19  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
10868
10869         Reviewed by Darin Adler.
10870         
10871         Inherits HashCountedSet class from FastAllocBase because it has been
10872         instantiated by 'new' in JavaScriptCore/runtime/Collector.cpp:1095.
10873
10874         * wtf/HashCountedSet.h:
10875
10876 2009-06-19  Yong Li  <yong.li@torchmobile.com>
10877
10878         Reviewed by George Staikos.
10879
10880         https://bugs.webkit.org/show_bug.cgi?id=26558
10881         Declare these symbols extern for WINCE as they are provided by libce.
10882
10883         * runtime/DateConstructor.cpp:
10884         * runtime/DatePrototype.cpp:
10885         (JSC::formatLocaleDate):
10886
10887 2009-06-19  Oliver Hunt  <oliver@apple.com>
10888
10889         Reviewed by Maciej Stachowiak.
10890
10891         <rdar://problem/6988973> ScopeChain leak in interpreter builds
10892
10893         Move the Scopechain destruction code in JSFunction outside of the ENABLE(JIT)
10894         path.
10895
10896         * runtime/JSFunction.cpp:
10897         (JSC::JSFunction::~JSFunction):
10898         * wtf/Platform.h:
10899
10900 2009-06-19  Yong Li  <yong.li@torchmobile.com>
10901
10902         Reviewed by George Staikos.
10903
10904         https://bugs.webkit.org/show_bug.cgi?id=26543
10905         Windows CE uses 'GetLastError' instead of 'errno.'
10906
10907         * interpreter/RegisterFile.h:
10908         (JSC::RegisterFile::RegisterFile):
10909         (JSC::RegisterFile::grow):
10910
10911 2009-06-19  David Levin  <levin@chromium.org>
10912
10913         Reviewed by NOBODY (Windows build fix).
10914
10915         Add export for Windows corresponding to OSX export done in r44844.
10916         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
10917         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
10918
10919 2009-06-18  Oliver Hunt  <oliver@apple.com>
10920
10921         Reviewed by Gavin "Viceroy of Venezuela" Barraclough.
10922
10923         Bug 26532: Native functions do not correctly unlink from optimised callsites when they're collected
10924         <https://bugs.webkit.org/show_bug.cgi?id=26532> <rdar://problem/6625385>
10925
10926         We need to make sure that each native function instance correctly unlinks any references to it
10927         when it is collected.  Allowing this to happen required a few changes:
10928             * Every native function needs a codeblock to track the link information
10929             * To have this codeblock, every function now also needs its own functionbodynode
10930               so we no longer get to have a single shared instance.
10931             * Identifying a host function is now done by looking for CodeBlock::codeType() == NativeCode
10932
10933         * JavaScriptCore.exp:
10934         * bytecode/CodeBlock.cpp:
10935         (JSC::CodeBlock::CodeBlock):
10936            Constructor for NativeCode CodeBlock
10937         (JSC::CodeBlock::derefStructures):
10938         (JSC::CodeBlock::refStructures):
10939         (JSC::CodeBlock::reparseForExceptionInfoIfNecessary):
10940         (JSC::CodeBlock::handlerForBytecodeOffset):
10941         (JSC::CodeBlock::lineNumberForBytecodeOffset):
10942         (JSC::CodeBlock::expressionRangeForBytecodeOffset):
10943         (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset):
10944         (JSC::CodeBlock::functionRegisterForBytecodeOffset):
10945         (JSC::CodeBlock::hasGlobalResolveInstructionAtBytecodeOffset):
10946         (JSC::CodeBlock::hasGlobalResolveInfoAtBytecodeOffset):
10947         (JSC::CodeBlock::setJITCode):
10948            Add assertions to ensure we don't try and use NativeCode CodeBlocks as
10949            a normal codeblock.
10950
10951         * bytecode/CodeBlock.h:
10952         (JSC::):
10953         (JSC::CodeBlock::source):
10954         (JSC::CodeBlock::sourceOffset):
10955         (JSC::CodeBlock::evalCodeCache):
10956         (JSC::CodeBlock::createRareDataIfNecessary):
10957           More assertions.
10958
10959         * jit/JIT.cpp:
10960         (JSC::JIT::privateCompileCTIMachineTrampolines):
10961         (JSC::JIT::linkCall):
10962           Update logic to allow native function caching
10963
10964         * jit/JITStubs.cpp:
10965         * parser/Nodes.cpp:
10966         (JSC::FunctionBodyNode::createNativeThunk):
10967         (JSC::FunctionBodyNode::isHostFunction):
10968         * parser/Nodes.h:
10969         * runtime/JSFunction.cpp:
10970         (JSC::JSFunction::JSFunction):
10971         (JSC::JSFunction::~JSFunction):
10972         (JSC::JSFunction::mark):
10973         * runtime/JSGlobalData.cpp:
10974         (JSC::JSGlobalData::~JSGlobalData):
10975         * runtime/JSGlobalData.h:
10976
10977 2009-06-18  Gavin Barraclough  <barraclough@apple.com>
10978
10979         Reviewed by NOBODY (Windows build fix).
10980
10981         * wtf/DateMath.cpp:
10982         (WTF::calculateUTCOffset):
10983
10984 2009-06-18  Gavin Barraclough  <barraclough@apple.com>
10985
10986         Reviewed by Geoff Garen.
10987
10988         Timezone calculation incorrect in Venezuela.
10989
10990         https://bugs.webkit.org/show_bug.cgi?id=26531
10991         <rdar://problem/6646169> Time is incorrectly reported to JavaScript in both Safari 3 and Firefox 3
10992
10993         The problem is that we're calculating the timezone relative to 01/01/2000,
10994         but the VET timezone changed from -4 hours to -4:30 hours on 12/09/2007.
10995         According to the spec, section 15.9.1.9 states "the time since the beginning
10996         of the year", presumably meaning the *current* year.  Change the calculation
10997         to be based on whatever the current year is, rather than a canned date.
10998
10999         No performance impact.
11000
11001         * wtf/DateMath.cpp:
11002         (WTF::calculateUTCOffset):
11003
11004 2009-06-18  Gavin Barraclough  <barraclough@apple.com>
11005
11006         Rubber Stamped by Mark Rowe (originally reviewed by Sam Weinig).
11007
11008         (Reintroducing patch added in r44492, and reverted in r44796.)
11009
11010         Change the implementation of op_throw so the stub function always modifies its
11011         return address - if it doesn't find a 'catch' it will switch to a trampoline
11012         to force a return from JIT execution.  This saves memory, by avoiding the need
11013         for a unique return for every op_throw.
11014
11015         * jit/JITOpcodes.cpp:
11016         (JSC::JIT::emit_op_throw):
11017             JITStubs::cti_op_throw now always changes its return address,
11018             remove return code generated after the stub call (this is now
11019             handled by ctiOpThrowNotCaught).
11020         * jit/JITStubs.cpp:
11021         (JSC::):
11022             Add ctiOpThrowNotCaught definitions.
11023         (JSC::JITStubs::DEFINE_STUB_FUNCTION):
11024             Change cti_op_throw to always change its return address.
11025         * jit/JITStubs.h:
11026             Add ctiOpThrowNotCaught declaration.
11027
11028 2009-06-18  Kevin McCullough  <kmccullough@apple.com>
11029
11030         Reviewed by Oliver Hunt.
11031
11032         <rdar://problem/6940880> REGRESSION: Breakpoints don't break in 64-bit
11033
11034         - Exposed functions now needed by WebCore.
11035
11036         * JavaScriptCore.exp:
11037
11038 2009-06-17  Darin Adler  <darin@apple.com>
11039
11040         Reviewed by Oliver Hunt.
11041
11042         Bug 26429: Make JSON.stringify non-recursive so it can handle objects
11043         of arbitrary complexity
11044         https://bugs.webkit.org/show_bug.cgi?id=26429
11045
11046         For marking I decided not to use gcProtect, because this is inside the engine
11047         so it's easy enough to just do marking. And that darned gcProtect does locking!
11048         Oliver tried to convince me to used MarkedArgumentBuffer, but the constructor
11049         for that class says "FIXME: Remove all clients of this API, then remove this API."
11050
11051         * runtime/Collector.cpp:
11052         (JSC::Heap::collect): Add a call to JSONObject::markStringifiers.
11053
11054         * runtime/CommonIdentifiers.cpp:
11055         (JSC::CommonIdentifiers::CommonIdentifiers): Added emptyIdentifier.
11056         * runtime/CommonIdentifiers.h: Ditto.
11057
11058         * runtime/JSGlobalData.cpp:
11059         (JSC::JSGlobalData::JSGlobalData): Initialize firstStringifierToMark to 0.
11060         * runtime/JSGlobalData.h: Added firstStringifierToMark.
11061
11062         * runtime/JSONObject.cpp: Cut down the includes to the needed ones only.
11063         (JSC::unwrapNumberOrString): Added. Helper for unwrapping number and string
11064         objects to get their number and string values.
11065         (JSC::ReplacerPropertyName::ReplacerPropertyName): Added. The class is used
11066         to wrap an identifier or integer so we don't have to do any work unless we
11067         actually call a replacer.
11068         (JSC::ReplacerPropertyName::value): Added.
11069         (JSC::gap): Added. Helper function for the Stringifier constructor.
11070         (JSC::PropertyNameForFunctionCall::PropertyNameForFunctionCall): Added.
11071         The class is used to wrap an identifier or integer so we don't have to
11072         allocate a number or string until we actually call toJSON or a replacer.
11073         (JSC::PropertyNameForFunctionCall::asJSValue): Added.
11074         (JSC::Stringifier::Stringifier): Updated and moved out of the class
11075         definition. Added code to hook this into a singly linked list for marking.
11076         (JSC::Stringifier::~Stringifier): Remove from the singly linked list.
11077         (JSC::Stringifier::mark): Mark all the objects in the holder stacks.
11078         (JSC::Stringifier::stringify): Updated.
11079         (JSC::Stringifier::appendQuotedString): Tweaked and streamlined a bit.
11080         (JSC::Stringifier::toJSON): Renamed from toJSONValue.
11081         (JSC::Stringifier::appendStringifiedValue): Renamed from stringify.
11082         Added code to use the m_holderStack to do non-recursive stringify of
11083         objects and arrays. This code also uses the timeout checker since in
11084         pathological cases it could be slow even without calling into the
11085         JavaScript virtual machine.
11086         (JSC::Stringifier::willIndent): Added.
11087         (JSC::Stringifier::indent): Added.
11088         (JSC::Stringifier::unindent): Added.
11089         (JSC::Stringifier::startNewLine): Added.
11090         (JSC::Stringifier::Holder::Holder): Added.
11091         (JSC::Stringifier::Holder::appendNextProperty): Added. This is the
11092         function that handles the format of arrays and objects.
11093         (JSC::JSONObject::getOwnPropertySlot): Moved this down to the bottom
11094         of the file so the JSONObject class is not interleaved with the
11095         Stringifier class.
11096         (JSC::JSONObject::markStringifiers): Added. Calls mark.
11097         (JSC::JSONProtoFuncStringify): Streamlined the code here. The code
11098         to compute the gap string is now a separate function.
11099
11100         * runtime/JSONObject.h: Made everything private. Added markStringifiers.
11101
11102 2009-06-17  Oliver Hunt  <oliver@apple.com>
11103
11104         Reviewed by Gavin Barraclough.
11105
11106         <rdar://problem/6974140> REGRESSION(r43849): Crash in cti_op_call_NotJSFunction when getting directions on maps.google.com
11107
11108         Roll out r43849 as it appears that we cannot rely on the address of
11109         an objects property storage being constant even if the structure is
11110         unchanged.
11111
11112         * jit/JIT.h:
11113         * jit/JITPropertyAccess.cpp:
11114         (JSC::JIT::compileGetDirectOffset):
11115         (JSC::JIT::privateCompileGetByIdProto):
11116         (JSC::JIT::privateCompileGetByIdProtoList):
11117         (JSC::JIT::privateCompileGetByIdChainList):
11118         (JSC::JIT::privateCompileGetByIdChain):
11119
11120 2009-06-17  Gavin Barraclough  <barraclough@apple.com>
11121
11122         Rubber Stamped by Mark Rowe.
11123
11124         Fully revert r44492 & r44748 while we fix a bug they cause on internal builds <rdar://problem/6955963>.
11125
11126         * jit/JITOpcodes.cpp:
11127         (JSC::JIT::emit_op_throw):
11128         * jit/JITStubs.cpp:
11129         (JSC::):
11130         (JSC::JITStubs::DEFINE_STUB_FUNCTION):
11131         * jit/JITStubs.h:
11132
11133 2009-06-17  Gavin Barraclough  <barraclough@apple.com>
11134
11135         Reviewed by Mark Rowe.
11136
11137         <rdar://problem/6947426> sunspider math-cordic.js exhibits different intermediate results running 32-bit vs. 64-bit
11138
11139         On 64-bit, NaN-encoded values must be detagged before they can be used in rshift.
11140
11141         No performance impact.
11142
11143         * jit/JITArithmetic.cpp:
11144         (JSC::JIT::emit_op_rshift):
11145
11146 2009-06-17  Adam Treat  <adam.treat@torchmobile.com>
11147
11148         Reviewed by George Staikos.
11149
11150         https://bugs.webkit.org/show_bug.cgi?id=23155
11151         Move WIN_CE -> WINCE as previously discussed with Qt WINCE folks.
11152
11153         * jsc.cpp:
11154         (main):
11155
11156 2009-06-17  George Staikos  <george.staikos@torchmobile.com>
11157
11158         Reviewed by Adam Treat.
11159
11160         https://bugs.webkit.org/show_bug.cgi?id=23155
11161         Move WIN_CE -> WINCE as previously discussed with Qt WINCE folks.
11162
11163         * config.h:
11164         * jsc.cpp:
11165         * wtf/Assertions.cpp:
11166         * wtf/Assertions.h:
11167         * wtf/CurrentTime.cpp:
11168         (WTF::lowResUTCTime):
11169         * wtf/DateMath.cpp:
11170         (WTF::getLocalTime):
11171         * wtf/MathExtras.h:
11172         * wtf/Platform.h:
11173         * wtf/StringExtras.h:
11174         * wtf/Threading.h:
11175         * wtf/win/MainThreadWin.cpp:
11176
11177 2009-06-17  Gavin Barraclough  <barraclough@apple.com>
11178
11179         Reviewed by Oliver Hunt.
11180
11181         <rdar://problem/6974175> ASSERT in JITStubs.cpp at appsaccess.apple.com
11182
11183         Remove PropertySlot::putValue - PropertySlots should only be used for getting,
11184         not putting.  Rename JSGlobalObject::getOwnPropertySlot to hasOwnPropertyForWrite,
11185         which is what it really was being used to ask, and remove some other getOwnPropertySlot
11186         & getOwnPropertySlotForWrite methods, which were unused and likely to lead to confusion.
11187
11188         * runtime/JSGlobalObject.h:
11189         (JSC::JSGlobalObject::hasOwnPropertyForWrite):
11190         * runtime/JSObject.h:
11191         * runtime/JSStaticScopeObject.cpp:
11192         * runtime/JSStaticScopeObject.h:
11193         * runtime/PropertySlot.h:
11194
11195 2009-06-16  Gavin Barraclough  <barraclough@apple.com>
11196
11197         Reviewed by Oliver hunt.
11198
11199         Temporarily partially disable r44492, since this is causing some problems on internal builds.
11200
11201         * jit/JITOpcodes.cpp:
11202         (JSC::JIT::emit_op_throw):
11203         * jit/JITStubs.cpp:
11204         (JSC::JITStubs::DEFINE_STUB_FUNCTION):
11205
11206 2009-06-16  Sam Weinig  <sam@webkit.org>
11207
11208         Fix windows build.
11209
11210         * jit/JIT.cpp:
11211         (JSC::JIT::JIT):
11212
11213 2009-06-16  Sam Weinig  <sam@webkit.org>
11214
11215         Reviewed by Oliver Hunt.
11216
11217         Initialize m_bytecodeIndex to -1 in JIT, and correctly initialize
11218         it for each type of stub using the return address to find the correct
11219         offset.
11220
11221         * jit/JIT.cpp:
11222         (JSC::JIT::JIT):
11223         * jit/JIT.h:
11224         (JSC::JIT::compileGetByIdProto):
11225         (JSC::JIT::compileGetByIdSelfList):
11226         (JSC::JIT::compileGetByIdProtoList):
11227         (JSC::JIT::compileGetByIdChainList):
11228         (JSC::JIT::compileGetByIdChain):
11229         (JSC::JIT::compilePutByIdTransition):
11230         (JSC::JIT::compileCTIMachineTrampolines):
11231         (JSC::JIT::compilePatchGetArrayLength):
11232         * jit/JITStubCall.h:
11233         (JSC::JITStubCall::call):
11234
11235 == Rolled over to ChangeLog-2009-06-16 ==