48800c75414be22a90b3f96c3885f80f4ea51307
[WebKit-https.git] / JavaScriptCore / ChangeLog
1 2009-10-02  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
2
3         Rubber-stamped by Simon Hausmann.
4
5         Fix the Qt on Mac OS X build.
6
7         * wtf/FastMalloc.cpp:
8
9 2009-10-02  Jørgen Lind  <jorgen.lind@nokia.com>
10
11         Reviewed by Simon Hausmann.
12
13         Allow enabling and disabling of the JIT through a qmake variable.
14
15         Qt's configure may set this variable through .qmake.cache if a
16         commandline option is given and/or the compile test for hwcap.h
17         failed/succeeded.
18
19         * JavaScriptCore.pri:
20
21 2009-10-01  Mark Rowe  <mrowe@apple.com>
22
23         Fix the Tiger build.  Don't unconditionally enable 3D canvas as it is not supported on Tiger.
24
25         * Configurations/FeatureDefines.xcconfig:
26
27 2009-10-01  Yongjun Zhang  <yongjun.zhang@nokia.com>
28
29         Reviewed by Darin Adler.
30
31         https://bugs.webkit.org/show_bug.cgi?id=29187
32
33         Don't inline ~ListRefPtr() to work around winscw compiler forward declaration
34         bug regarding templated classes.
35
36         The compiler bug is reported at:
37         https://xdabug001.ext.nokia.com/bugzilla/show_bug.cgi?id=9812
38
39         The change will be reverted when the above bug is fixed in winscw compiler.
40
41         * wtf/ListRefPtr.h:
42         (WTF::::~ListRefPtr):
43
44 2009-10-01  Zoltan Horvath  <zoltan@webkit.org>
45
46         Reviewed by Simon Hausmann.
47
48         [Qt] Allow custom memory allocation control for the whole JavaScriptCore
49         https://bugs.webkit.org/show_bug.cgi?id=27029
50
51         Since in JavaScriptCore almost every class which has been instantiated by operator new is
52         inherited from FastAllocBase (bug #20422), we disable customizing global operator new for the Qt-port
53         when USE_SYSTEM_MALLOC=0.
54
55         Add #include <unistd.h> to FastMalloc.cpp because it's used by TCMalloc_PageHeap::scavengerThread().
56         (It's needed for the functionality of TCmalloc.)
57
58         Add TCSystemAlloc.cpp to JavaScriptCore.pri if USE_SYSTEM_MALLOC is disabled.
59
60         * JavaScriptCore.pri:
61         * wtf/FastMalloc.cpp:
62         (WTF::sleep):
63         * wtf/FastMalloc.h:
64
65 2009-09-30  Gabor Loki  <loki@inf.u-szeged.hu>
66
67         Reviewed by George Staikos.
68
69         Defines two pseudo-platforms for ARM and Thumb-2 instruction set.
70         https://bugs.webkit.org/show_bug.cgi?id=29122
71
72         Introduces WTF_PLATFORM_ARM_TRADITIONAL and WTF_PLATFORM_ARM_THUMB2
73         macros on ARM platforms. The PLATFORM(ARM_THUMB2) should be used
74         when Thumb-2 instruction set is the required target. The
75         PLATFORM(ARM_TRADITIONAL) is for generic ARM instruction set. In
76         case where the code is common the PLATFORM(ARM) have to be used.
77
78         Modified by George Wright  <gwright@rim.com> to correctly work
79         with the RVCT-defined __TARGET_ARCH_ARM and __TARGET_ARCH_THUMB
80         compiler macros, as well as adding readability changes.
81
82         * wtf/Platform.h:
83
84 2009-09-30  Oliver Hunt  <oliver@apple.com>
85
86         Reviewed by Geoff Garen.
87
88         Devirtualise array toString conversion
89
90         Tweak the implementation of Array.prototype.toString to have a fast path
91         when acting on a true JSArray.
92
93         * runtime/ArrayPrototype.cpp:
94         (JSC::arrayProtoFuncToString):
95
96 2009-09-30  Csaba Osztrogonac  <oszi@inf.u-szeged.hu>
97
98         Reviewed by Geoffrey Garen.
99
100         Buildfix for platforms using JSVALUE32.
101         https://bugs.webkit.org/show_bug.cgi?id=29915
102
103         After http://trac.webkit.org/changeset/48905 the build broke in JSVALUE32 case.
104         Also removed unreachable code.
105
106         * jit/JITArithmetic.cpp:
107         (JSC::JIT::emit_op_add):
108          - Declaration of "OperandTypes types" moved before first use.
109          - Typos fixed: dst modified to result, regT2 added.
110          - Unreachable code removed.
111         (JSC::JIT::emitSlow_op_add):
112          - Missing declaration of "OperandTypes types" added.
113
114 2009-09-30  Janne Koskinen  <janne.p.koskinen@digia.com> 
115
116         Reviewed by Simon Hausmann.
117
118         Reduce heap size on Symbian from 64MB to 8MB.
119
120         This is not a perfect fix, it requires more fine tuning.
121         But this makes it possible again to debug in the emulator,
122         which is more important in order to be able to fix other
123         run-time issues.
124
125         * runtime/Collector.h:
126
127 2009-09-30  Janne Koskinen  <janne.p.koskinen@digia.com> 
128
129         Reviewed by Simon Hausmann.
130
131         Fix CRASH() macro for Symbian build.
132
133         * wtf/Assertions.h: Added missing }
134
135 2009-09-29  Geoffrey Garen  <ggaren@apple.com>
136
137         Reviewed by Gavin Barraclough.
138
139         Inlined a few math operations.
140         
141         ~1% SunSpider speedup.
142
143         * jit/JIT.h:
144         * jit/JITArithmetic.cpp:
145         (JSC::JIT::compileBinaryArithOpSlowCase):
146         (JSC::JIT::emitSlow_op_add):
147         (JSC::JIT::emitSlow_op_mul):
148         (JSC::JIT::emit_op_sub):
149         (JSC::JIT::emitSlow_op_sub): Don't take a stub call when operating on
150         a constant int and a double.
151
152 2009-09-28  Oliver Hunt  <oliver@apple.com>
153
154         Reviewed by Gavin Barraclough.
155
156         Tidy up codeblock sampler
157         https://bugs.webkit.org/show_bug.cgi?id=29836
158
159         Some rather simple refactoring of codeblock sampler so that
160         it's easier for us to use it to find problems in non-jsc
161         environments
162
163         * JavaScriptCore.exp:
164         * bytecode/SamplingTool.h:
165         * debugger/Debugger.cpp:
166         (JSC::evaluateInGlobalCallFrame):
167         * debugger/DebuggerCallFrame.cpp:
168         (JSC::DebuggerCallFrame::evaluate):
169         * interpreter/Interpreter.cpp:
170         (JSC::Interpreter::Interpreter):
171         (JSC::Interpreter::execute):
172         (JSC::Interpreter::privateExecute):
173         (JSC::Interpreter::enableSampler):
174         (JSC::Interpreter::dumpSampleData):
175         (JSC::Interpreter::startSampling):
176         (JSC::Interpreter::stopSampling):
177         * interpreter/Interpreter.h:
178         (JSC::Interpreter::sampler):
179         * jit/JIT.h:
180         * jsc.cpp:
181         (runWithScripts):
182         * runtime/Completion.cpp:
183         (JSC::checkSyntax):
184         (JSC::evaluate):
185         * runtime/Executable.h:
186         (JSC::EvalExecutable::EvalExecutable):
187         (JSC::ProgramExecutable::create):
188         (JSC::ProgramExecutable::ProgramExecutable):
189         * runtime/JSGlobalData.cpp:
190         (JSC::JSGlobalData::startSampling):
191         (JSC::JSGlobalData::stopSampling):
192         (JSC::JSGlobalData::dumpSampleData):
193         * runtime/JSGlobalData.h:
194         * runtime/JSGlobalObjectFunctions.cpp:
195         (JSC::globalFuncEval):
196
197 2009-09-29  Jeremy Orlow  <jorlow@chromium.org>
198
199         Reviewed by Dimitri Glazkov.
200
201         Add GYP generated files to svn:ignore
202         https://bugs.webkit.org/show_bug.cgi?id=29895
203
204         The following files are generated by JavaScriptCore's GYP file and should be ignored:
205
206         pcre.mk
207         wtf.scons
208         wtf.mk
209         SConstruct
210         wtf_config.scons
211         wtf_config.mk
212         pcre.scons
213
214         * JavaScriptCore.gyp: Changed property svn:ignore.
215
216 2009-09-29  Geoffrey Garen  <ggaren@apple.com>
217
218         Reviewed by Sam Weinig.
219
220         Standardized an optimization for adding non-numbers.
221         
222         SunSpider says maybe a tiny speedup.
223
224         * jit/JITArithmetic.cpp:
225         (JSC::JIT::emit_op_add):
226         (JSC::JIT::emitSlow_op_add):
227
228 2009-09-29  Geoffrey Garen  <ggaren@apple.com>
229
230         Windows build fix: export a new symbol.
231
232         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
233         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
234
235 2009-09-28  Geoffrey Garen  <ggaren@apple.com>
236
237         Reviewed by Sam Weinig.
238
239         Removed virtual destructor from JSGlobalObjectData to eliminate pointer
240         fix-ups when accessing JSGlobalObject::d.
241         
242         Replaced with an explicit destructor function pointer.
243         
244         6% speedup on bench-alloc-nonretained.js.
245
246         * JavaScriptCore.exp:
247         * runtime/JSGlobalObject.cpp:
248         (JSC::JSGlobalObject::~JSGlobalObject):
249         (JSC::JSGlobalObject::destroyJSGlobalObjectData):
250         * runtime/JSGlobalObject.h:
251         (JSC::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData):
252         (JSC::JSGlobalObject::JSGlobalObject):
253
254 2009-09-29  Janne Koskinen  <janne.p.koskinen@digia.com>
255
256         Reviewed by David Kilzer.
257
258         [Qt] Assert messages prints visible in Symbian
259         https://bugs.webkit.org/show_bug.cgi?id=29808
260
261         Asserts use vprintf to print the messages to stderr.
262         In Symbian Open C it is not possible to see stderr so
263         I routed the messages to stdout instead.
264
265         * wtf/Assertions.cpp:
266
267 2009-09-29  Janne Koskinen  <janne.p.koskinen@digia.com>
268
269         Reviewed by Darin Adler.
270
271         [Qt] Symbian CRASH macro implementation
272
273         Added Symbian specific crash macro that
274         stops to crash line if JIT debugging is used.
275         Additional differentiation of access violation
276         (KERN-EXEC 3) and CRASH panic.
277
278         * wtf/Assertions.h:
279
280 2009-09-28  Mark Rowe  <mrowe@apple.com>
281
282         Fix the PowerPC build.
283
284         * JavaScriptCore.exp:
285
286 2009-09-28  Mark Rowe  <mrowe@apple.com>
287
288         Reviewed by Gavin Barraclough.
289
290         <rdar://problem/7195704> JavaScriptCore fails to mark registers when built for x86_64 using LLVM GCC.
291
292         * runtime/Collector.cpp:
293         (JSC::Heap::markCurrentThreadConservatively): Force jmp_buf to use the appropriate alignment for a pointer
294         to ensure that we correctly interpret the contents of registers during marking.
295
296 2009-09-28  Geoffrey Garen  <ggaren@apple.com>
297
298         Windows build fix: added new exports.
299
300         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
301         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
302
303 2009-09-28  Geoffrey Garen  <ggaren@apple.com>
304
305         Windows build fix: removed exports that no longer exist.
306
307         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
308         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
309
310 2009-09-28  Geoffrey Garen  <ggaren@apple.com>
311
312         Reviewed by Darin Adler.
313
314         NotNullPassRefPtr: smart pointer optimized for passing references that are not null
315         https://bugs.webkit.org/show_bug.cgi?id=29822
316         
317         Added NotNullPassRefPtr, and deployed it in all places that initialize
318         JavaScript objects.
319         
320         2.2% speedup on bench-allocate-nonretained.js.
321
322         * API/JSCallbackConstructor.cpp:
323         (JSC::JSCallbackConstructor::JSCallbackConstructor):
324         * API/JSCallbackConstructor.h:
325         * API/JSCallbackObject.h:
326         * API/JSCallbackObjectFunctions.h:
327         (JSC::JSCallbackObject::JSCallbackObject):
328         * JavaScriptCore.exp:
329         * bytecode/CodeBlock.h:
330         (JSC::CodeBlock::addFunctionDecl):
331         (JSC::CodeBlock::addFunctionExpr):
332         * runtime/ArrayConstructor.cpp:
333         (JSC::ArrayConstructor::ArrayConstructor):
334         * runtime/ArrayConstructor.h:
335         * runtime/ArrayPrototype.cpp:
336         (JSC::ArrayPrototype::ArrayPrototype):
337         * runtime/ArrayPrototype.h:
338         * runtime/BooleanConstructor.cpp:
339         (JSC::BooleanConstructor::BooleanConstructor):
340         * runtime/BooleanConstructor.h:
341         * runtime/BooleanObject.cpp:
342         (JSC::BooleanObject::BooleanObject):
343         * runtime/BooleanObject.h:
344         * runtime/BooleanPrototype.cpp:
345         (JSC::BooleanPrototype::BooleanPrototype):
346         * runtime/BooleanPrototype.h:
347         * runtime/DateConstructor.cpp:
348         (JSC::DateConstructor::DateConstructor):
349         * runtime/DateConstructor.h:
350         * runtime/DateInstance.cpp:
351         (JSC::DateInstance::DateInstance):
352         * runtime/DateInstance.h:
353         * runtime/DatePrototype.cpp:
354         (JSC::DatePrototype::DatePrototype):
355         * runtime/DatePrototype.h:
356         * runtime/ErrorConstructor.cpp:
357         (JSC::ErrorConstructor::ErrorConstructor):
358         * runtime/ErrorConstructor.h:
359         * runtime/ErrorInstance.cpp:
360         (JSC::ErrorInstance::ErrorInstance):
361         * runtime/ErrorInstance.h:
362         * runtime/ErrorPrototype.cpp:
363         (JSC::ErrorPrototype::ErrorPrototype):
364         * runtime/ErrorPrototype.h:
365         * runtime/FunctionConstructor.cpp:
366         (JSC::FunctionConstructor::FunctionConstructor):
367         * runtime/FunctionConstructor.h:
368         * runtime/FunctionPrototype.cpp:
369         (JSC::FunctionPrototype::FunctionPrototype):
370         * runtime/FunctionPrototype.h:
371         * runtime/GlobalEvalFunction.cpp:
372         (JSC::GlobalEvalFunction::GlobalEvalFunction):
373         * runtime/GlobalEvalFunction.h:
374         * runtime/InternalFunction.cpp:
375         (JSC::InternalFunction::InternalFunction):
376         * runtime/InternalFunction.h:
377         (JSC::InternalFunction::InternalFunction):
378         * runtime/JSActivation.cpp:
379         (JSC::JSActivation::JSActivation):
380         * runtime/JSActivation.h:
381         (JSC::JSActivation::JSActivationData::JSActivationData):
382         * runtime/JSArray.cpp:
383         (JSC::JSArray::JSArray):
384         * runtime/JSArray.h:
385         * runtime/JSByteArray.cpp:
386         (JSC::JSByteArray::JSByteArray):
387         * runtime/JSByteArray.h:
388         * runtime/JSFunction.cpp:
389         (JSC::JSFunction::JSFunction):
390         * runtime/JSFunction.h:
391         * runtime/JSGlobalObject.h:
392         (JSC::JSGlobalObject::JSGlobalObject):
393         * runtime/JSONObject.h:
394         (JSC::JSONObject::JSONObject):
395         * runtime/JSObject.h:
396         (JSC::JSObject::JSObject):
397         (JSC::JSObject::setStructure):
398         * runtime/JSVariableObject.h:
399         (JSC::JSVariableObject::JSVariableObject):
400         * runtime/JSWrapperObject.h:
401         (JSC::JSWrapperObject::JSWrapperObject):
402         * runtime/MathObject.cpp:
403         (JSC::MathObject::MathObject):
404         * runtime/MathObject.h:
405         * runtime/NativeErrorConstructor.cpp:
406         (JSC::NativeErrorConstructor::NativeErrorConstructor):
407         * runtime/NativeErrorConstructor.h:
408         * runtime/NativeErrorPrototype.cpp:
409         (JSC::NativeErrorPrototype::NativeErrorPrototype):
410         * runtime/NativeErrorPrototype.h:
411         * runtime/NumberConstructor.cpp:
412         (JSC::NumberConstructor::NumberConstructor):
413         * runtime/NumberConstructor.h:
414         * runtime/NumberObject.cpp:
415         (JSC::NumberObject::NumberObject):
416         * runtime/NumberObject.h:
417         * runtime/NumberPrototype.cpp:
418         (JSC::NumberPrototype::NumberPrototype):
419         * runtime/NumberPrototype.h:
420         * runtime/ObjectConstructor.cpp:
421         (JSC::ObjectConstructor::ObjectConstructor):
422         * runtime/ObjectConstructor.h:
423         * runtime/ObjectPrototype.cpp:
424         (JSC::ObjectPrototype::ObjectPrototype):
425         * runtime/ObjectPrototype.h:
426         * runtime/PropertyNameArray.h:
427         (JSC::PropertyNameArrayData::setCachedPrototypeChain):
428         * runtime/PrototypeFunction.cpp:
429         (JSC::PrototypeFunction::PrototypeFunction):
430         * runtime/PrototypeFunction.h:
431         * runtime/RegExpConstructor.cpp:
432         (JSC::RegExpConstructor::RegExpConstructor):
433         * runtime/RegExpConstructor.h:
434         * runtime/RegExpObject.cpp:
435         (JSC::RegExpObject::RegExpObject):
436         * runtime/RegExpObject.h:
437         (JSC::RegExpObject::RegExpObjectData::RegExpObjectData):
438         * runtime/RegExpPrototype.cpp:
439         (JSC::RegExpPrototype::RegExpPrototype):
440         * runtime/RegExpPrototype.h:
441         * runtime/StringConstructor.cpp:
442         (JSC::StringConstructor::StringConstructor):
443         * runtime/StringConstructor.h:
444         * runtime/StringObject.cpp:
445         (JSC::StringObject::StringObject):
446         * runtime/StringObject.h:
447         * runtime/StringObjectThatMasqueradesAsUndefined.h:
448         (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
449         * runtime/StringPrototype.cpp:
450         (JSC::StringPrototype::StringPrototype):
451         * runtime/StringPrototype.h:
452         * wtf/PassRefPtr.h:
453         (WTF::NotNullPassRefPtr::NotNullPassRefPtr):
454         (WTF::NotNullPassRefPtr::~NotNullPassRefPtr):
455         (WTF::NotNullPassRefPtr::get):
456         (WTF::NotNullPassRefPtr::clear):
457         (WTF::NotNullPassRefPtr::releaseRef):
458         (WTF::NotNullPassRefPtr::operator*):
459         (WTF::NotNullPassRefPtr::operator->):
460         (WTF::NotNullPassRefPtr::operator!):
461         (WTF::NotNullPassRefPtr::operator UnspecifiedBoolType):
462         * wtf/RefPtr.h:
463         (WTF::RefPtr::RefPtr):
464         (WTF::operator==):
465
466 2009-09-28  Oliver Hunt  <oliver@apple.com>
467
468         Reviewed by Geoff Garen.
469
470         Hard dependency on SSE2 instruction set with JIT
471         https://bugs.webkit.org/show_bug.cgi?id=29779
472
473         Add floating point support checks to op_jfalse and op_jtrue, and
474         fix the logic for the slow case of op_add
475
476         * jit/JITArithmetic.cpp:
477         (JSC::JIT::emitSlow_op_add):
478         * jit/JITOpcodes.cpp:
479         (JSC::JIT::emit_op_jfalse):
480         (JSC::JIT::emit_op_jtrue):
481
482 2009-09-28  Yaar Schnitman  <yaar@chromium.org>
483
484         Reviewed by Dimitri Glazkov.
485
486         Chromium port - recognize we are being built independently
487         of chromium and look for dependencies under webkit/chromium rather
488         than chromium/src.
489
490         https://bugs.webkit.org/show_bug.cgi?id=29722
491
492         * JavaScriptCore.gyp/JavaScriptCore.gyp:
493
494 2009-09-28  Jakub Wieczorek  <faw217@gmail.com>
495
496         Reviewed by Simon Hausmann.
497
498         [Qt] Implement XSLT support with QtXmlPatterns.
499         https://bugs.webkit.org/show_bug.cgi?id=28303
500
501         * wtf/Platform.h: Add a WTF_USE_QXMLQUERY #define.
502
503 2009-09-28  Gabor Loki  <loki@inf.u-szeged.hu>
504
505         Reviewed by Simon Hausmann.
506
507         Remove __clear_cache which is an internal function of GCC
508         https://bugs.webkit.org/show_bug.cgi?id=28886
509
510         Although __clear_cache is exported from GCC, this is an internal
511         function. GCC makes no promises about it.
512
513         * jit/ExecutableAllocator.h:
514         (JSC::ExecutableAllocator::cacheFlush):
515
516 2009-09-28  Sam Weinig  <sam@webkit.org>
517
518         Reviewed by Oliver Hunt.
519
520         Fix an absolute path to somewhere in Oliver's machine to a relative path
521         for derived JSONObject.lut.h.
522
523         * JavaScriptCore.xcodeproj/project.pbxproj:
524
525 2009-09-28  Joerg Bornemann  <joerg.bornemann@nokia.com>
526
527         Reviewed by Simon Hausmann.
528
529         Add ARM version detection for Windows CE.
530
531         * wtf/Platform.h:
532
533 2009-09-26  Yongjun Zhang  <yongjun.zhang@nokia.com>
534
535         Reviewed by Simon Hausmann.
536
537         Add MarkStackSymbian.cpp to build JavascriptCore for Symbian.
538
539         Re-use Windows shrinkAllocation implementation because Symbian doesn't
540         support releasing part of memory region.
541         
542         Use fastMalloc and fastFree to implement allocateStack and releaseStack
543         for Symbian port.
544
545         * JavaScriptCore.pri:
546         * runtime/MarkStack.h:
547         (JSC::MarkStack::MarkStackArray::shrinkAllocation):
548         * runtime/MarkStackSymbian.cpp: Added.
549         (JSC::MarkStack::initializePagesize):
550         (JSC::MarkStack::allocateStack):
551         (JSC::MarkStack::releaseStack):
552
553 2009-09-25  Gabor Loki  <loki@inf.u-szeged.hu>
554
555         Reviewed by Gavin Barraclough.
556
557         Fix unaligned data access in YARR_JIT on ARMv5 and below.
558         https://bugs.webkit.org/show_bug.cgi?id=29695
559
560         On ARMv5 and below all data access should be naturally aligned.
561         In the YARR_JIT there is a case when character pairs are
562         loaded from the input string, but this data access is not
563         naturally aligned. This fix introduces load32WithUnalignedHalfWords
564         and branch32WithUnalignedHalfWords functions which contain
565         naturally aligned memory loads - half word loads - on ARMv5 and below.
566
567         * assembler/MacroAssemblerARM.cpp:
568         (JSC::MacroAssemblerARM::load32WithUnalignedHalfWords):
569         * assembler/MacroAssemblerARM.h:
570         (JSC::MacroAssemblerARM::load32WithUnalignedHalfWords):
571         (JSC::MacroAssemblerARM::branch32WithUnalignedHalfWords):
572         * assembler/MacroAssemblerARMv7.h:
573         (JSC::MacroAssemblerARMv7::load32WithUnalignedHalfWords):
574         (JSC::MacroAssemblerARMv7::branch32):
575         (JSC::MacroAssemblerARMv7::branch32WithUnalignedHalfWords):
576         * assembler/MacroAssemblerX86Common.h:
577         (JSC::MacroAssemblerX86Common::load32WithUnalignedHalfWords):
578         (JSC::MacroAssemblerX86Common::branch32WithUnalignedHalfWords):
579         * wtf/Platform.h:
580         * yarr/RegexJIT.cpp:
581         (JSC::Yarr::RegexGenerator::generatePatternCharacterPair):
582
583 2009-09-25  Jeremy Orlow  <jorlow@chromium.org>
584
585         This is breaking Chromium try bots, so I'm counting this as a build fix.
586
587         Add more svn:ignore exceptions.  On different platforms, these files are
588         generated with different case for JavaScriptCore.  Also there are some
589         wtf project files that get built apparently.
590
591         * JavaScriptCore.gyp: Changed property svn:ignore.
592
593 2009-09-25  Ada Chan  <adachan@apple.com>
594
595         Build fix.
596
597         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
598         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
599
600 2009-09-25  Geoffrey Garen  <ggaren@apple.com>
601
602         Reviewed by Darin Adler.
603
604         Inlined some object creation code, including lexicalGlobalObject access
605         https://bugs.webkit.org/show_bug.cgi?id=29750
606         
607         SunSpider says 0.5% faster.
608         
609         0.8% speedup on bench-alloc-nonretained.js.
610         2.5% speedup on v8-splay.js.
611
612         * interpreter/CachedCall.h:
613         (JSC::CachedCall::CachedCall):
614         * interpreter/CallFrame.h:
615         (JSC::ExecState::lexicalGlobalObject):
616         (JSC::ExecState::globalThisValue):
617         * interpreter/Interpreter.cpp:
618         (JSC::Interpreter::dumpRegisters):
619         (JSC::Interpreter::execute):
620         (JSC::Interpreter::privateExecute):
621         * jit/JITStubs.cpp:
622         (JSC::DEFINE_STUB_FUNCTION):
623         * runtime/FunctionConstructor.cpp:
624         (JSC::constructFunction):
625         * runtime/ScopeChain.cpp:
626         (JSC::ScopeChainNode::print):
627         * runtime/ScopeChain.h:
628         (JSC::ScopeChainNode::ScopeChainNode):
629         (JSC::ScopeChainNode::~ScopeChainNode):
630         (JSC::ScopeChainNode::push):
631         (JSC::ScopeChain::ScopeChain):
632         (JSC::ScopeChain::globalObject): Added a globalObject data member to ScopeChainNode.
633         Replaced accessor function for globalObject() with data member. Replaced
634         globalThisObject() accessor with direct access to globalThis, to match.
635
636         * runtime/JSGlobalObject.cpp:
637         (JSC::JSGlobalObject::init):
638         * runtime/JSGlobalObject.h: Inlined array and object construction.
639
640 2009-09-25  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
641
642         Reviewed by Gavin Barraclough.
643
644         Add ARM version detection rules for Symbian
645         https://bugs.webkit.org/show_bug.cgi?id=29715
646
647         * wtf/Platform.h:
648
649 2009-09-24  Xan Lopez  <xlopez@igalia.com>
650
651         Reviewed by Mark "Do It!" Rowe.
652
653         Some GCC versions don't like C++-style comments in preprocessor
654         directives, change to C-style to shut them up.
655
656         * wtf/Platform.h:
657
658 2009-09-24  Oliver Hunt  <oliver@apple.com>
659
660         Reviewed by Gavin Barraclough.
661
662         Division is needlessly slow in 64-bit
663         https://bugs.webkit.org/show_bug.cgi?id=29723
664
665         Add codegen for op_div on x86-64
666
667         * jit/JIT.cpp:
668         (JSC::JIT::privateCompileMainPass):
669         (JSC::JIT::privateCompileSlowCases):
670         * jit/JIT.h:
671         * jit/JITArithmetic.cpp:
672         (JSC::JIT::compileBinaryArithOpSlowCase):
673         (JSC::JIT::emit_op_div):
674         (JSC::JIT::emitSlow_op_div):
675         * jit/JITInlineMethods.h:
676         (JSC::JIT::isOperandConstantImmediateDouble):
677         (JSC::JIT::addressFor):
678         (JSC::JIT::emitLoadDouble):
679         (JSC::JIT::emitLoadInt32ToDouble):
680         (JSC::JIT::emitJumpSlowCaseIfNotImmediateNumber):
681
682 2009-09-24  Jeremy Orlow  <jorlow@chromium.org>
683
684         Reviewed by Dimitri Glazkov.
685
686         Add GYP generated files to svn:ignore
687         https://bugs.webkit.org/show_bug.cgi?id=29724
688
689         Adding the following files to the svn:ignore list (all in the
690         JavaScriptCore/JavaScriptCore.gyp directory)
691
692         JavaScriptCore.xcodeproj
693         JavaScriptCore.sln
694         JavaScriptCore.vcproj
695         JavaScriptCore_Debug.rules
696         JavaScriptCore_Release.rules
697         JavaScriptCore_Release - no tcmalloc.rules
698         JavaScriptCore_Purify.rules
699         JavaScriptCore.mk
700         JavaScriptCore_Debug_rules.mk
701         JavaScriptCore_Release_rules.mk
702         JavaScriptCore_Release - no tcmalloc_rules.mk
703         JavaScriptCore_Purify_rules.mk
704         JavaScriptCore.scons
705         JavaScriptCore_main.scons
706
707         * JavaScriptCore.gyp: Changed property svn:ignore.
708
709 2009-09-24  Yong Li  <yong.li@torchmobile.com>
710
711         Reviewed by Adam Barth.
712
713         Replace platform-dependent code with WTF::currentTime()
714         https://bugs.webkit.org/show_bug.cgi?id=29148
715
716         * jsc.cpp:
717         (StopWatch::start):
718         (StopWatch::stop):
719         (StopWatch::getElapsedMS):
720         * runtime/TimeoutChecker.cpp:
721         (JSC::getCPUTime):
722
723 2009-09-24  Mark Rowe  <mrowe@apple.com>
724
725         Reviewed by Sam Weinig.
726
727         <rdar://problem/7215058> FastMalloc scavenging thread should be named
728
729         * wtf/FastMalloc.cpp:
730         (WTF::TCMalloc_PageHeap::scavengerThread): Set the thread name.
731         * wtf/Platform.h: Move the knowledge of whether pthread_setname_np exists to here as HAVE(PTHREAD_SETNAME_NP).
732         * wtf/ThreadingPthreads.cpp:
733         (WTF::setThreadNameInternal): Use HAVE(PTHREAD_SETNAME_NP).
734
735 2009-09-24  Geoffrey Garen  <ggaren@apple.com>
736
737         Reviewed by Sam Weinig.
738
739         Renamed clear to removeAll, as suggested by Darin Adler.
740
741         * wtf/HashCountedSet.h:
742         (WTF::::removeAll):
743
744 2009-09-24  Mark Rowe  <mrowe@apple.com>
745
746         Reviewed by Gavin Barraclough.
747
748         Fix FastMalloc to build with assertions enabled.
749
750         * wtf/FastMalloc.cpp:
751         (WTF::TCMalloc_Central_FreeList::ReleaseToSpans):
752         * wtf/TCSpinLock.h:
753         (TCMalloc_SpinLock::IsHeld):
754
755 2009-09-24  Geoffrey Garen  <ggaren@apple.com>
756
757         Suggested by Darin Adler.
758
759         Removed some unnecessary parameter names.
760
761         * wtf/HashCountedSet.h:
762
763 2009-09-24  Janne Koskinen  <janne.p.koskinen@digia.com>
764
765         Reviewed by Simon Hausmann.
766
767         On Windows JSChar is typedef'ed to wchar_t.
768
769         When building with WINSCW for Symbian we need to do the
770         same typedef.
771
772         * API/JSStringRef.h:
773
774 2009-09-23  Geoffrey Garen  <ggaren@apple.com>
775
776         A piece of my last patch that I forgot.
777
778         * wtf/HashCountedSet.h:
779         (WTF::::clear): Added HashCountedSet::clear.
780
781 2009-09-24  Gabor Loki  <loki@inf.u-szeged.hu>
782
783         Reviewed by Gavin Barraclough.
784
785         Avoid __clear_cache built-in function if DISABLE_BUILTIN_CLEAR_CACHE define is set
786         https://bugs.webkit.org/show_bug.cgi?id=28886
787
788         There are some GCC packages (for example GCC-2006q3 from CodeSourcery)
789         which contain __clear_cache built-in function only for C while the C++
790         version of __clear_cache is missing on ARM architectures.
791
792         Fixed a small bug in the inline assembly of cacheFlush function on
793         ARM_TRADITIONAL.
794
795         * jit/ExecutableAllocator.h:
796         (JSC::ExecutableAllocator::cacheFlush):
797
798 2009-09-23  Geoffrey Garen  <ggaren@apple.com>
799
800         Reviewed by Sam Weinig.
801
802         Added the ability to swap vectors with inline capacities, so you can
803         store a vector with inline capacity in a hash table.
804
805         * wtf/Vector.h:
806         (WTF::swap):
807         (WTF::VectorBuffer::swap):
808
809 2009-09-23  David Kilzer  <ddkilzer@apple.com>
810
811         Move definition of USE(PLUGIN_HOST_PROCESS) from WebKitPrefix.h to Platform.h
812
813         Reviewed by Mark Rowe.
814
815         * wtf/Platform.h: Define WTF_USE_PLUGIN_HOST_PROCESS to 1 when
816         building on 64-bit SnowLeopard.  Define to 0 elsewhere.
817
818 2009-09-22  Oliver Hunt  <oliver@apple.com>
819
820         Reviewed by Geoff Garen.
821
822         Code sampling builds are broken.
823         https://bugs.webkit.org/show_bug.cgi?id=29662
824
825         Fix build.
826
827         * bytecode/EvalCodeCache.h:
828         (JSC::EvalCodeCache::get):
829         * bytecode/SamplingTool.cpp:
830         (JSC::ScriptSampleRecord::sample):
831         (JSC::SamplingTool::doRun):
832         (JSC::SamplingTool::notifyOfScope):
833         (JSC::compareScriptSampleRecords):
834         (JSC::SamplingTool::dump):
835         * bytecode/SamplingTool.h:
836         (JSC::ScriptSampleRecord::ScriptSampleRecord):
837         (JSC::ScriptSampleRecord::~ScriptSampleRecord):
838         (JSC::SamplingTool::SamplingTool):
839         * bytecompiler/BytecodeGenerator.cpp:
840         (JSC::BytecodeGenerator::BytecodeGenerator):
841         (JSC::BytecodeGenerator::emitNewFunction):
842         (JSC::BytecodeGenerator::emitNewFunctionExpression):
843         * bytecompiler/BytecodeGenerator.h:
844         (JSC::BytecodeGenerator::makeFunction):
845         * debugger/Debugger.cpp:
846         (JSC::evaluateInGlobalCallFrame):
847         * debugger/DebuggerCallFrame.cpp:
848         (JSC::DebuggerCallFrame::evaluate):
849         * parser/Nodes.cpp:
850         (JSC::ScopeNode::ScopeNode):
851         * runtime/Completion.cpp:
852         (JSC::checkSyntax):
853         (JSC::evaluate):
854         * runtime/Executable.cpp:
855         (JSC::FunctionExecutable::fromGlobalCode):
856         * runtime/Executable.h:
857         (JSC::ScriptExecutable::ScriptExecutable):
858         (JSC::EvalExecutable::EvalExecutable):
859         (JSC::EvalExecutable::create):
860         (JSC::ProgramExecutable::ProgramExecutable):
861         (JSC::FunctionExecutable::create):
862         (JSC::FunctionExecutable::FunctionExecutable):
863         * runtime/JSGlobalObjectFunctions.cpp:
864         (JSC::globalFuncEval):
865
866 2009-09-22  Darin Adler  <darin@apple.com>
867
868         Reviewed by Sam Weinig.
869
870         * wtf/Forward.h: Added PassOwnPtr.
871
872 2009-09-22  Yaar Schnitman  <yaar@chromium.org>
873
874         Reviewed by David Levin.
875
876         Ported chromium.org's javascriptcore.gyp for the webkit chromium port.
877
878         https://bugs.webkit.org/show_bug.cgi?id=29617
879
880         * JavaScriptCore.gyp/JavaScriptCore.gyp: Added.
881
882 2009-09-22  Thiago Macieira  <thiago.macieira@nokia.com>
883
884         Reviewed by Simon Hausmann.
885
886         Fix compilation with WINSCW: no varargs macros
887
888         Disable variadic arguments for WINSCW just like we do
889         for MSVC7.
890
891         * wtf/Assertions.h:
892
893 2009-09-22  Kent Hansen  <khansen@trolltech.com>
894
895         Reviewed by Simon Hausmann.
896
897         Disable variadic macros on MSVC7.
898
899         This was originally added in r26589 but not extended
900         when LOG_DISABLED/ASSERT_DISABLED was introduced.
901
902         * wtf/Assertions.h:
903
904 2009-09-22  Simon Hausmann  <simon.hausmann@nokia.com>
905
906         Unreviewed build fix for Windows CE < 5
907
908         Define WINCEBASIC to disable the IsDebuggerPresent() code in
909         wtf/Assertions.cpp.
910
911         * JavaScriptCore.pri:
912
913 2009-09-22  Joerg Bornemann  <joerg.bornemann@nokia.com>
914
915         Reviewed by Simon Hausmann.
916
917         Fix major memory leak in JavaScriptCore RegisterFile on Windows CE
918
919         https://bugs.webkit.org/show_bug.cgi?id=29367
920
921         On Widows CE we must decommit all committed pages before we release
922         them. See VirtualFree documentation.
923         Desktop Windows behaves much smoother in this situation.
924
925         * interpreter/RegisterFile.cpp:
926         (JSC::RegisterFile::~RegisterFile):
927
928 2009-09-21  Greg Bolsinga  <bolsinga@apple.com>
929
930         Reviewed by Simon Fraser & Sam Weinig.
931
932         Add ENABLE(ORIENTATION_EVENTS)
933         https://bugs.webkit.org/show_bug.cgi?id=29508
934
935         * wtf/Platform.h: Also sort PLATFORM(IPHONE) #defines.
936
937 2009-09-21  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
938
939         Reviewed by Eric Seidel.
940
941         [Fix] SourceCode's uninitialized member
942         
943         Potential source of crashes and bugs was fixed. Default constructor
944         didn't initialized m_provider member.
945
946         https://bugs.webkit.org/show_bug.cgi?id=29364
947
948         * parser/SourceCode.h:
949         (JSC::SourceCode::SourceCode):
950
951 2009-09-21  Oliver Hunt  <oliver@apple.com>
952
953         Reviewed by Geoff Garen.
954
955         REGRESSION (r48582): Crash in StructureStubInfo::initPutByIdTransition when reloading trac.webkit.org
956         https://bugs.webkit.org/show_bug.cgi?id=29599
957
958         It is unsafe to attempt to cache new property transitions on
959         dictionaries of any type.
960
961         * interpreter/Interpreter.cpp:
962         (JSC::Interpreter::tryCachePutByID):
963         * jit/JITStubs.cpp:
964         (JSC::JITThunks::tryCachePutByID):
965
966 2009-09-21  Oliver Hunt  <oliver@apple.com>
967
968         RS=Maciej Stachowiak.
969
970         Re-land SNES fix with corrected assertion.
971
972         * interpreter/Interpreter.cpp:
973         (JSC::Interpreter::resolveGlobal):
974         (JSC::Interpreter::tryCachePutByID):
975         (JSC::Interpreter::tryCacheGetByID):
976         * jit/JITStubs.cpp:
977         (JSC::JITThunks::tryCachePutByID):
978         (JSC::JITThunks::tryCacheGetByID):
979         (JSC::DEFINE_STUB_FUNCTION):
980         * runtime/BatchedTransitionOptimizer.h:
981         (JSC::BatchedTransitionOptimizer::BatchedTransitionOptimizer):
982         * runtime/JSObject.cpp:
983         (JSC::JSObject::removeDirect):
984         * runtime/Structure.cpp:
985         (JSC::Structure::Structure):
986         (JSC::Structure::getEnumerablePropertyNames):
987         (JSC::Structure::despecifyDictionaryFunction):
988         (JSC::Structure::addPropertyTransitionToExistingStructure):
989         (JSC::Structure::addPropertyTransition):
990         (JSC::Structure::removePropertyTransition):
991         (JSC::Structure::toDictionaryTransition):
992         (JSC::Structure::toCacheableDictionaryTransition):
993         (JSC::Structure::toUncacheableDictionaryTransition):
994         (JSC::Structure::fromDictionaryTransition):
995         (JSC::Structure::removePropertyWithoutTransition):
996         * runtime/Structure.h:
997         (JSC::Structure::isDictionary):
998         (JSC::Structure::isUncacheableDictionary):
999         (JSC::Structure::):
1000         * runtime/StructureChain.cpp:
1001         (JSC::StructureChain::isCacheable):
1002
1003 2009-09-21  Adam Roben  <aroben@apple.com>
1004
1005         Revert r48573, as it caused many assertion failures
1006
1007         * interpreter/Interpreter.cpp:
1008         * jit/JITStubs.cpp:
1009         * runtime/BatchedTransitionOptimizer.h:
1010         * runtime/JSObject.cpp:
1011         * runtime/Structure.cpp:
1012         * runtime/Structure.h:
1013         * runtime/StructureChain.cpp:
1014
1015 2009-09-21  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
1016
1017         Unreviewed make dist build fix. Missing files.
1018
1019         * GNUmakefile.am:
1020
1021 2009-09-19  Gavin Barraclough  <barraclough@apple.com>
1022
1023         Reviewed by Sam 'Cabin Boy' Weinig.
1024
1025         Fix stack alignment with ARM THUMB2 JIT.
1026         https://bugs.webkit.org/show_bug.cgi?id=29526
1027         
1028         Stack is currently being decremented by 0x3c, bump this to 0x40 to make this a
1029         multiple of 16 bytes.
1030
1031         * jit/JITStubs.cpp:
1032         (JSC::JITThunks::JITThunks):
1033         * jit/JITStubs.h:
1034
1035 2009-09-20  Oliver Hunt  <oliver@apple.com>
1036
1037         Reviewed by Maciej Stachowiak.
1038
1039         SNES is too slow
1040         https://bugs.webkit.org/show_bug.cgi?id=29534
1041
1042         The problem was that the emulator used multiple classes with
1043         more properties than our dictionary cutoff allowed, this resulted
1044         in more or less all critical logic inside the emulator requiring
1045         uncached property access.
1046
1047         Rather than simply bumping the dictionary cutoff, this patch
1048         recognises that there are two ways to create a "dictionary"
1049         structure.  Either by adding a large number of properties, or
1050         by removing a property.  In the case of adding properties we
1051         know all the existing properties will maintain their existing
1052         offsets, so we could cache access to those properties, if we
1053         know they won't be removed.
1054
1055         To make this possible, this patch adds the logic required to
1056         distinguish a dictionary created by addition from one created
1057         by removal.  With this logic in place we can now cache access
1058         to objects with large numbers of properties.
1059
1060         SNES performance improved by more than 6x.
1061
1062         * interpreter/Interpreter.cpp:
1063         (JSC::Interpreter::resolveGlobal):
1064         (JSC::Interpreter::tryCachePutByID):
1065         (JSC::Interpreter::tryCacheGetByID):
1066         * jit/JITStubs.cpp:
1067         (JSC::JITThunks::tryCachePutByID):
1068         (JSC::JITThunks::tryCacheGetByID):
1069         (JSC::DEFINE_STUB_FUNCTION):
1070         * runtime/BatchedTransitionOptimizer.h:
1071         (JSC::BatchedTransitionOptimizer::BatchedTransitionOptimizer):
1072         * runtime/JSObject.cpp:
1073         (JSC::JSObject::removeDirect):
1074         * runtime/Structure.cpp:
1075         (JSC::Structure::Structure):
1076         (JSC::Structure::getEnumerablePropertyNames):
1077         (JSC::Structure::despecifyDictionaryFunction):
1078         (JSC::Structure::addPropertyTransitionToExistingStructure):
1079         (JSC::Structure::addPropertyTransition):
1080         (JSC::Structure::removePropertyTransition):
1081         (JSC::Structure::toDictionaryTransition):
1082         (JSC::Structure::toCacheableDictionaryTransition):
1083         (JSC::Structure::toUncacheableDictionaryTransition):
1084         (JSC::Structure::fromDictionaryTransition):
1085         (JSC::Structure::removePropertyWithoutTransition):
1086         * runtime/Structure.h:
1087         (JSC::Structure::isDictionary):
1088         (JSC::Structure::isUncacheableDictionary):
1089         (JSC::Structure::):
1090         * runtime/StructureChain.cpp:
1091         (JSC::StructureChain::isCacheable):
1092
1093 2009-09-19  Oliver Hunt  <oliver@apple.com>
1094
1095         Reviewed by Maciej Stachowiak.
1096
1097         Implement ES5 Object.create function
1098         https://bugs.webkit.org/show_bug.cgi?id=29524
1099
1100         Implement Object.create.  Very simple patch, effectively Object.defineProperties
1101         only creating the target object itself.
1102
1103         * runtime/CommonIdentifiers.h:
1104         * runtime/ObjectConstructor.cpp:
1105         (JSC::ObjectConstructor::ObjectConstructor):
1106         (JSC::objectConstructorCreate):
1107
1108 2009-09-19  Dan Bernstein  <mitz@apple.com>
1109
1110         Fix clean debug builds.
1111
1112         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
1113
1114 2009-09-19  Joerg Bornemann  <joerg.bornemann@nokia.com>
1115
1116         Reviewed by George Staikos.
1117
1118         QtWebKit Windows CE compile fix
1119
1120         https://bugs.webkit.org/show_bug.cgi?id=29379
1121
1122         There is no _aligned_alloc or _aligned_free on Windows CE.
1123         We just use the Windows code that was there before and use VirtualAlloc.
1124         But that also means that the BLOCK_SIZE must be 64K as this function
1125         allocates on 64K boundaries.
1126
1127         * runtime/Collector.cpp:
1128         (JSC::Heap::allocateBlock):
1129         (JSC::Heap::freeBlock):
1130         * runtime/Collector.h:
1131
1132 2009-09-19  Oliver Hunt  <oliver@apple.com>
1133
1134         Reviewed by Sam Weinig.
1135
1136         Implement ES5 Object.defineProperties function
1137         https://bugs.webkit.org/show_bug.cgi?id=29522
1138
1139         Implement Object.defineProperties.  Fairly simple patch, simply makes use of
1140         existing functionality used for defineProperty.
1141
1142         * runtime/CommonIdentifiers.h:
1143         * runtime/ObjectConstructor.cpp:
1144         (JSC::ObjectConstructor::ObjectConstructor):
1145         (JSC::defineProperties):
1146         (JSC::objectConstructorDefineProperties):
1147
1148 2009-09-19  Oliver Hunt  <oliver@apple.com>
1149
1150         Reviewed by NOBODY (Build fix).
1151
1152         Windows build fix part2
1153
1154         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1155         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
1156
1157 2009-09-19  Oliver Hunt  <oliver@apple.com>
1158
1159         Reviewed by NOBODY (Buildfix).
1160
1161         Windows build fix part 1.
1162
1163         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1164         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
1165
1166 2009-09-18  Oliver Hunt  <oliver@apple.com>
1167
1168         Reviewed by Geoff Garen.
1169
1170         Implement ES5 Object.defineProperty function
1171         https://bugs.webkit.org/show_bug.cgi?id=29503
1172
1173         Implement Object.defineProperty.  This requires adding the API to
1174         ObjectConstructor, along with a helper function that implements the
1175         ES5 internal [[ToPropertyDescriptor]] function.  It then adds
1176         JSObject::defineOwnProperty that implements the appropriate ES5 semantics.
1177         Currently defineOwnProperty uses a delete followed by a put to redefine
1178         attributes of a property, clearly this is less efficient than it could be
1179         but we can improve this if it needs to be possible in future.
1180
1181         * JavaScriptCore.exp:
1182         * debugger/DebuggerActivation.cpp:
1183         (JSC::DebuggerActivation::defineGetter):
1184         (JSC::DebuggerActivation::defineSetter):
1185         * debugger/DebuggerActivation.h:
1186         * interpreter/Interpreter.cpp:
1187         (JSC::Interpreter::privateExecute):
1188         * jit/JITStubs.cpp:
1189           Update defineGetter/Setter calls
1190         * runtime/CommonIdentifiers.h:
1191         * runtime/JSArray.cpp:
1192         (JSC::JSArray::getOwnPropertySlot):
1193         * runtime/JSGlobalObject.cpp:
1194         (JSC::JSGlobalObject::defineGetter):
1195         (JSC::JSGlobalObject::defineSetter):
1196         * runtime/JSGlobalObject.h:
1197         * runtime/JSObject.cpp:
1198         (JSC::JSObject::defineGetter):
1199         (JSC::JSObject::defineSetter):
1200         (JSC::putDescriptor):
1201         (JSC::JSObject::defineOwnProperty):
1202         * runtime/JSObject.h:
1203         * runtime/ObjectConstructor.cpp:
1204         (JSC::ObjectConstructor::ObjectConstructor):
1205         (JSC::objectConstructorGetOwnPropertyDescriptor):
1206         (JSC::toPropertyDescriptor):
1207         (JSC::objectConstructorDefineProperty):
1208         * runtime/ObjectPrototype.cpp:
1209         (JSC::objectProtoFuncDefineGetter):
1210         (JSC::objectProtoFuncDefineSetter):
1211         * runtime/PropertyDescriptor.cpp:
1212         (JSC::PropertyDescriptor::writable):
1213         (JSC::PropertyDescriptor::enumerable):
1214         (JSC::PropertyDescriptor::configurable):
1215         (JSC::PropertyDescriptor::isDataDescriptor):
1216         (JSC::PropertyDescriptor::isGenericDescriptor):
1217         (JSC::PropertyDescriptor::isAccessorDescriptor):
1218         (JSC::PropertyDescriptor::getter):
1219         (JSC::PropertyDescriptor::setter):
1220         (JSC::PropertyDescriptor::setDescriptor):
1221         (JSC::PropertyDescriptor::setAccessorDescriptor):
1222         (JSC::PropertyDescriptor::setWritable):
1223         (JSC::PropertyDescriptor::setEnumerable):
1224         (JSC::PropertyDescriptor::setConfigurable):
1225         (JSC::PropertyDescriptor::setSetter):
1226         (JSC::PropertyDescriptor::setGetter):
1227         (JSC::PropertyDescriptor::equalTo):
1228         (JSC::PropertyDescriptor::attributesEqual):
1229         (JSC::PropertyDescriptor::attributesWithOverride):
1230         * runtime/PropertyDescriptor.h:
1231         (JSC::PropertyDescriptor::PropertyDescriptor):
1232         (JSC::PropertyDescriptor::value):
1233         (JSC::PropertyDescriptor::setValue):
1234         (JSC::PropertyDescriptor::isEmpty):
1235         (JSC::PropertyDescriptor::writablePresent):
1236         (JSC::PropertyDescriptor::enumerablePresent):
1237         (JSC::PropertyDescriptor::configurablePresent):
1238         (JSC::PropertyDescriptor::setterPresent):
1239         (JSC::PropertyDescriptor::getterPresent):
1240         (JSC::PropertyDescriptor::operator==):
1241         (JSC::PropertyDescriptor::):
1242
1243 2009-09-18  Gabor Loki  <loki@inf.u-szeged.hu>
1244
1245         Reviewed by Gavin Barraclough.
1246
1247         Build fix to enable ARM_THUMB2 on Linux
1248         https://bugs.webkit.org/show_bug.cgi?id=
1249
1250         * jit/ExecutableAllocator.h:
1251         (JSC::ExecutableAllocator::cacheFlush):
1252         * jit/JITStubs.cpp:
1253         * wtf/Platform.h:
1254
1255 2009-09-18  Gabor Loki  <loki@inf.u-szeged.hu>
1256
1257         Reviewed by Gavin Barraclough.
1258
1259         Defines two pseudo-platforms for ARM and Thumb-2 instruction set.
1260         https://bugs.webkit.org/show_bug.cgi?id=29122
1261
1262         Introduces WTF_PLATFORM_ARM_TRADITIONAL and WTF_PLATFORM_ARM_THUMB2
1263         macros on ARM platforms. The PLATFORM(ARM_THUMB2) should be used
1264         when Thumb-2 instruction set is the required target. The
1265         PLATFORM(ARM_TRADITIONAL) is for generic ARM instruction set. In
1266         case where the code is common the PLATFORM(ARM) have to be used.
1267
1268         * assembler/ARMAssembler.cpp:
1269         * assembler/ARMAssembler.h:
1270         * assembler/ARMv7Assembler.h:
1271         * assembler/MacroAssembler.h:
1272         * assembler/MacroAssemblerARM.cpp:
1273         * assembler/MacroAssemblerARM.h:
1274         * assembler/MacroAssemblerCodeRef.h:
1275         (JSC::MacroAssemblerCodePtr::MacroAssemblerCodePtr):
1276         * jit/ExecutableAllocator.h:
1277         * jit/JIT.h:
1278         * jit/JITInlineMethods.h:
1279         (JSC::JIT::beginUninterruptedSequence):
1280         (JSC::JIT::preserveReturnAddressAfterCall):
1281         (JSC::JIT::restoreReturnAddressBeforeReturn):
1282         (JSC::JIT::restoreArgumentReference):
1283         (JSC::JIT::restoreArgumentReferenceForTrampoline):
1284         * jit/JITOpcodes.cpp:
1285         * jit/JITStubs.cpp:
1286         (JSC::JITThunks::JITThunks):
1287         * jit/JITStubs.h:
1288         * wtf/Platform.h:
1289         * yarr/RegexJIT.cpp:
1290         (JSC::Yarr::RegexGenerator::generateEnter):
1291
1292 2009-09-18  Joerg Bornemann  <joerg.bornemann@nokia.com>
1293
1294         Reviewed by Simon Hausmann.
1295
1296         Fix the Qt/Windows CE build.
1297
1298         * JavaScriptCore.pri: Build the ce_time.cpp functions from
1299         within Qt externally.
1300         * wtf/DateMath.cpp: Removed unnecessary Qt #ifdef, for the
1301         Qt build these functions are no external, too.
1302
1303 2009-09-17  Janne Koskinen  <janne.p.koskinen@digia.com>
1304
1305         Reviewed by Simon Hausmann.
1306
1307         Symbian/WINSCW build fox.
1308
1309         Repeat Q_OS_WIN wchar_t hack for WINSCW, similar to
1310         revision 24774.
1311
1312         WINSCW defines wchar_t, thus UChar has to be wchar_t
1313
1314         * wtf/unicode/qt4/UnicodeQt4.h:
1315
1316 2009-09-17  Janne Koskinen  <janne.p.koskinen@digia.com>
1317
1318         Reviewed by Simon Hausmann.
1319
1320         Symbian/WINSCW build fix.
1321
1322         https://bugs.webkit.org/show_bug.cgi?id=29186
1323
1324         WINSCW Template specialisation name in declaration must the be the same as in implementation.
1325
1326         * runtime/LiteralParser.h:
1327
1328 2009-09-15  Norbert Leser  <norbert.leser@nokia.com>
1329
1330         Reviewed by Darin Adler.
1331
1332         https://bugs.webkit.org/show_bug.cgi?id=27060
1333
1334         Symbian compiler for emulator target (WINSCW) fails with
1335         "illegal operand" for m_attributesInPrevious in structure.ccp
1336         (when calling make_pair functions).
1337         This error is apparently due to the compiler not properly
1338         resolving the unsigned type of the declared bitfield.
1339
1340         Initial patch explicitly casted m_attributesInPrevious
1341         to unsigned, but since bitfield optimization is not critical for
1342         the emulator target, this conditional change in header file
1343         appears to be least intrusive.
1344
1345         * runtime/Structure.h:
1346
1347 2009-09-16  Gabor Loki  <loki@inf.u-szeged.hu>
1348
1349         Reviewed by Darin Adler.
1350
1351         Fix GCC warnings on ARM_THUMB2 platform
1352
1353         * assembler/ARMv7Assembler.h:
1354         (JSC::ARMThumbImmediate::countLeadingZerosPartial):
1355         * assembler/MacroAssemblerARMv7.h:
1356         (JSC::MacroAssemblerARMv7::branchTruncateDoubleToInt32):
1357         (JSC::MacroAssemblerARMv7::moveFixedWidthEncoding):
1358
1359 2009-09-16  Greg Bolsinga  <bolsinga@apple.com>
1360
1361         Add ENABLE(INSPECTOR)
1362         https://bugs.webkit.org/show_bug.cgi?id=29260
1363
1364         Reviewed by David Kilzer.
1365
1366         * wtf/Platform.h:
1367
1368 2009-09-16  Greg Bolsinga  <bolsinga@apple.com>
1369
1370         Add ENABLE(CONTEXT_MENUS)
1371         https://bugs.webkit.org/show_bug.cgi?id=29225
1372
1373         Reviewed by David Kilzer.
1374
1375         * wtf/Platform.h:
1376
1377 2009-09-16  Benjamin C Meyer  <benjamin.meyer@torchmobile.com>
1378
1379         Reviewed by Eric Seidel.
1380
1381         The webkit stdint and stdbool headers exists because
1382         the compiler MSVC doesn't include them.  The check
1383         should not check for PLATFORM(WIN_OS) but for MSVC.
1384
1385         * os-win32/stdbool.h:
1386         * os-win32/stdint.h:
1387
1388 2009-09-16  Greg Bolsinga  <bolsinga@apple.com>
1389
1390         Add ENABLE(DRAG_SUPPORT)
1391         https://bugs.webkit.org/show_bug.cgi?id=29233
1392
1393         Reviewed by David Kilzer.
1394
1395         * wtf/Platform.h:
1396
1397 2009-09-16  Kevin Ollivier  <kevino@theolliviers.com>
1398
1399         waf build fix after flag was moved to correct place.
1400
1401         * wscript:
1402
1403 2009-09-16  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
1404
1405         Reviewed by Simon Hausmann.
1406
1407         [Qt] Build fix for 64-bit Qt on Mac OS X
1408
1409         * wtf/Platform.h: Use JSVALUE64 on DARWIN, not only on MAC
1410
1411 2009-09-16  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
1412
1413         Reviewed by Simon Hausmann.
1414
1415         [Qt] Fix wtf/ThreadSpecific.h under Qt to free thread local objects.
1416         https://bugs.webkit.org/show_bug.cgi?id=29295
1417
1418         This is an important fix when JavaScript workers are in use, since
1419         unfreed ThreadGlobalDatas leak a big amount of memory (50-100k each).
1420         QThreadStorage calls the destructor of a given object, which is the
1421         ThreadSpecific::Data. Unlike pthread, Qt is object oriented, and does
1422         not support the calling of a static utility function when the thread
1423         is about to close. In this patch we call the ThreadSpecific::destroy()
1424         utility function from the destructor of ThreadSpecific::Data. Moreover,
1425         since Qt resets all thread local values to 0 before the calling of the
1426         appropriate destructors, we set back the pointer to its original value.
1427         This is necessary because the get() method of the ThreadSpecific
1428         object may be called during the exuction of the destructor.
1429
1430         * wtf/ThreadSpecific.h:
1431         (WTF::ThreadSpecific::Data::~Data):
1432         (WTF::::~ThreadSpecific):
1433         (WTF::::set):
1434         (WTF::::destroy):
1435
1436 2009-09-10  Oliver Hunt  <oliver@apple.com>
1437
1438         Reviewed by Geoff Garen.
1439
1440         Allow anonymous storage inside JSObject
1441         https://bugs.webkit.org/show_bug.cgi?id=29168
1442
1443         Add the concept of anonymous slots to Structures so that it is
1444         possible to store references to values that need marking in the
1445         standard JSObject storage buffer.  This allows us to reduce the
1446         malloc overhead of some objects (by allowing them to store JS
1447         values in the inline storage of the object) and reduce the 
1448         dependence of custom mark functions (if all an objects children
1449         are in the standard object property storage there's no need to
1450         mark them manually).
1451
1452         * JavaScriptCore.exp:
1453         * runtime/JSObject.h:
1454         (JSC::JSObject::putAnonymousValue):
1455         (JSC::JSObject::getAnonymousValue):
1456         (JSC::JSObject::addAnonymousSlots):
1457         * runtime/JSWrapperObject.h:
1458         (JSC::JSWrapperObject::createStructure):
1459         (JSC::JSWrapperObject::JSWrapperObject):
1460         (JSC::JSWrapperObject::setInternalValue):
1461         * runtime/PropertyMapHashTable.h:
1462         * runtime/Structure.cpp:
1463         (JSC::Structure::~Structure):
1464         (JSC::Structure::materializePropertyMap):
1465         (JSC::Structure::addAnonymousSlotsTransition):
1466         (JSC::Structure::copyPropertyTable):
1467         (JSC::Structure::put):
1468         (JSC::Structure::rehashPropertyMapHashTable):
1469         * runtime/Structure.h:
1470         (JSC::Structure::propertyStorageSize):
1471         (JSC::StructureTransitionTable::reifySingleTransition):
1472         * runtime/StructureTransitionTable.h:
1473         (JSC::StructureTransitionTable::TransitionTable::addSlotTransition):
1474         (JSC::StructureTransitionTable::TransitionTable::removeSlotTransition):
1475         (JSC::StructureTransitionTable::TransitionTable::getSlotTransition):
1476         (JSC::StructureTransitionTable::getAnonymousSlotTransition):
1477         (JSC::StructureTransitionTable::addAnonymousSlotTransition):
1478         (JSC::StructureTransitionTable::removeAnonymousSlotTransition):
1479
1480 2009-09-15  Alex Milowski  <alex@milowski.com>
1481
1482         Reviewed by Tor Arne Vestbø.
1483
1484         Added the ENABLE_MATHML define to the features
1485
1486         * Configurations/FeatureDefines.xcconfig:
1487
1488 2009-09-15 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
1489
1490         Reviewed by Tor Arne Vestbø.
1491
1492         [Qt] Build fix for windows.
1493
1494         After http://trac.webkit.org/changeset/47795 the MinGW build broke,
1495         because MinGW has __mingw_aligned_malloc instead of _aligned_malloc.
1496
1497         * runtime/Collector.cpp:
1498         (JSC::Heap::allocateBlock): MinGW case added.
1499         (JSC::Heap::freeBlock): MinGW case added.
1500
1501 2009-09-15  Csaba Osztrogonac  <oszi@inf.u-szeged.hu>
1502
1503         Reviewed by Tor Arne Vestbø.
1504
1505         [Qt] Build fix for Windows/MinGW
1506
1507         https://bugs.webkit.org/show_bug.cgi?id=29268
1508
1509         * wtf/Platform.h: JSVALUE32_64 temporarily disabled on PLATFORM(WIN_OS) with COMPILER(MINGW)
1510
1511 2009-09-14  Gabor Loki  <loki@inf.u-szeged.hu>
1512
1513         Reviewed by Gavin Barraclough.
1514
1515         Detect VFP at runtime in generic ARM port on Linux platform.
1516         https://bugs.webkit.org/show_bug.cgi?id=29076
1517
1518         * JavaScriptCore.pri:
1519         * assembler/MacroAssemblerARM.cpp: Added.
1520         (JSC::isVFPPresent):
1521         * assembler/MacroAssemblerARM.h:
1522         (JSC::MacroAssemblerARM::supportsFloatingPoint):
1523
1524 2009-09-14  Csaba Osztrogonac  <oszi@inf.u-szeged.hu>
1525
1526         Reviewed by Tor Arne Vestbø.
1527
1528         [Qt] Build fix for windows build.
1529
1530         * JavaScriptCore.pri: Correct a logic error.
1531         * pcre/dftables: Add missing paranthesis for tmpdir function.
1532
1533 2009-09-12  Oliver Hunt  <oliver@apple.com>
1534
1535         Reviewed by NOBODY (Build fix).
1536
1537         Build fix for windows exports (again).
1538
1539         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1540         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
1541
1542 2009-09-12  Oliver Hunt  <oliver@apple.com>
1543
1544         Reviewed by NOBODY (Build fix).
1545
1546         Build fix for windows exports.
1547
1548         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1549         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
1550
1551 2009-09-12  Oliver Hunt  <oliver@apple.com>
1552
1553         Reviewed by NOBODY (Build fix).
1554
1555         Correct fix for non-allinonefile builds
1556
1557         * runtime/ObjectConstructor.cpp:
1558
1559 2009-09-12  Oliver Hunt  <oliver@apple.com>
1560
1561         Reviewed by NOBODY (Build fix).
1562
1563         Fix non-allinonefile builds
1564
1565         * runtime/ObjectConstructor.cpp:
1566
1567 2009-09-12  Oliver Hunt  <oliver@apple.com>
1568
1569         Reviewed by Maciej Stachowiak.
1570
1571         [ES5] Implement Object.keys
1572         https://bugs.webkit.org/show_bug.cgi?id=29170
1573
1574         This patch basically requires two separate steps, the first is to split getPropertyNames
1575         into two functions -- getOwnPropertyNames and getPropertyNames, basically making them behave
1576         in the same way as getOwnPropertySlot and getPropertySlot.  In essence getOwnPropertyNames
1577         produces the list of properties on an object excluding its prototype chain and getPropertyNames
1578         just iterates the the object and its prototype chain calling getOwnPropertyNames at each level.
1579
1580         * API/JSCallbackObject.h:
1581         * API/JSCallbackObjectFunctions.h:
1582         (JSC::::getOwnPropertyNames):
1583         * JavaScriptCore.exp:
1584         * debugger/DebuggerActivation.cpp:
1585         (JSC::DebuggerActivation::getOwnPropertyNames):
1586         * debugger/DebuggerActivation.h:
1587         * runtime/CommonIdentifiers.h:
1588         * runtime/JSArray.cpp:
1589         (JSC::JSArray::getOwnPropertyNames):
1590         * runtime/JSArray.h:
1591         * runtime/JSByteArray.cpp:
1592         (JSC::JSByteArray::getOwnPropertyNames):
1593         * runtime/JSByteArray.h:
1594         * runtime/JSNotAnObject.cpp:
1595         (JSC::JSNotAnObject::getOwnPropertyNames):
1596         * runtime/JSNotAnObject.h:
1597         * runtime/JSObject.cpp:
1598         (JSC::JSObject::getOwnPropertyNames):
1599         * runtime/JSObject.h:
1600         * runtime/JSVariableObject.cpp:
1601         (JSC::JSVariableObject::getOwnPropertyNames):
1602         * runtime/JSVariableObject.h:
1603         * runtime/ObjectConstructor.cpp:
1604         (JSC::ObjectConstructor::ObjectConstructor):
1605         (JSC::objectConstructorKeys):
1606         * runtime/RegExpMatchesArray.h:
1607         (JSC::RegExpMatchesArray::getOwnPropertyNames):
1608         * runtime/StringObject.cpp:
1609         (JSC::StringObject::getOwnPropertyNames):
1610         * runtime/StringObject.h:
1611         * runtime/Structure.cpp:
1612         (JSC::Structure::getOwnEnumerablePropertyNames):
1613         (JSC::Structure::getEnumerablePropertyNames):
1614         * runtime/Structure.h:
1615
1616 2009-09-11  Oliver Hunt  <oliver@apple.com>
1617
1618         Reviewed by Sam Weinig.
1619
1620         getPropertyNames caching is invalid when the prototype chain contains objects with custom getPropertyNames
1621         https://bugs.webkit.org/show_bug.cgi?id=29214
1622
1623         Add a flag to TypeInfo to indicate whether a type overrides getPropertyNames.
1624         This flag is used to make sure that caching of the property name data is safe.
1625
1626         * API/JSCallbackConstructor.h:
1627         (JSC::JSCallbackConstructor::createStructure):
1628         * debugger/DebuggerActivation.h:
1629         (JSC::DebuggerActivation::createStructure):
1630         * runtime/BooleanObject.h:
1631         (JSC::BooleanObject::createStructure):
1632         * runtime/DatePrototype.h:
1633         (JSC::DatePrototype::createStructure):
1634         * runtime/FunctionPrototype.h:
1635         (JSC::FunctionPrototype::createStructure):
1636         * runtime/JSONObject.h:
1637         (JSC::JSONObject::createStructure):
1638         * runtime/JSObject.h:
1639         (JSC::JSObject::createStructure):
1640         * runtime/JSTypeInfo.h:
1641         (JSC::TypeInfo::hasDefaultGetPropertyNames):
1642         * runtime/JSVariableObject.h:
1643         (JSC::JSVariableObject::createStructure):
1644         * runtime/JSWrapperObject.h:
1645         (JSC::JSWrapperObject::createStructure):
1646         * runtime/MathObject.h:
1647         (JSC::MathObject::createStructure):
1648         * runtime/NumberConstructor.h:
1649         (JSC::NumberConstructor::createStructure):
1650         * runtime/NumberObject.h:
1651         (JSC::NumberObject::createStructure):
1652         * runtime/RegExpConstructor.h:
1653         (JSC::RegExpConstructor::createStructure):
1654         * runtime/RegExpObject.h:
1655         (JSC::RegExpObject::createStructure):
1656         * runtime/StructureChain.cpp:
1657         (JSC::StructureChain::isCacheable):
1658
1659 2009-09-11  Alexey Proskuryakov  <ap@webkit.org>
1660
1661         Reviewed by Geoff Garen.
1662
1663         https://bugs.webkit.org/show_bug.cgi?id=29207
1664         Add checks for using WebCore JS context on secondary threads
1665
1666         * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData):
1667         * runtime/JSGlobalData.h:
1668         Added a new mainThreadOnly flag that WebCore would set.
1669
1670         * runtime/Collector.cpp: (JSC::Heap::registerThread): JSC API methods always call this,
1671         so this is a good place to check that the API isn't used form a wrong thread.
1672
1673 2009-09-11  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
1674
1675         Reviewed by Simon Hausmann.
1676
1677         Compiling JavaScriptCore on sparc 64 with gcc fails.
1678
1679         ThreadSafeShared uses the atomic __gnu_cxx::__exchange_and_add with an int,
1680         however on sparc 64 the _Atomic_word argument is typedefed to long (8 bytes).
1681
1682         The patch disables WTF_USE_LOCKFREE_THREADSAFESHARED in ThreadSafeShared to use
1683         a mutex instead when compiling for sparc 64 with gcc.
1684
1685         https://bugs.webkit.org/show_bug.cgi?id=29175
1686
1687         * wtf/Platform.h:
1688         __sparc64__ is not defined on all OS.
1689         Uses instead: __sparc__ && __arch64__ || __sparcv9
1690         * wtf/Threading.h:
1691
1692 2009-09-11  Prasanth Ullattil  <prasanth.ullattil@nokia.com>
1693
1694         Reviewed by Simon Hausmann.
1695
1696         Fix compile error on Windows7(64Bit) with latest SDK.
1697
1698         Added the missing include file.
1699
1700         * runtime/UString.cpp:
1701
1702 2009-09-11  Joerg Bornemann  <joerg.bornemann@trolltech.com>
1703
1704         Reviewed by Simon Hausmann.
1705
1706         Qt/Windows CE compile fix, include the executable allocator and
1707         markstack implementation in the windows build.
1708
1709         * JavaScriptCore.pri:
1710
1711 2009-09-08  John Abd-El-Malek  <jam@chromium.org>
1712
1713         Reviewed by Dimitri Glazkov.
1714
1715         Remove unneeded define for ActiveX.
1716         https://bugs.webkit.org/show_bug.cgi?id=29054
1717
1718         * wtf/Platform.h:
1719
1720 2009-09-10  Mark Rowe  <mrowe@apple.com>
1721
1722         Rubber-stamped by Sam Weinig.
1723
1724         Update JavaScriptCore and WebKit's FeatureDefines.xcconfig so that they are in sync with WebCore as they need to be.
1725
1726         * Configurations/FeatureDefines.xcconfig:
1727
1728 2009-09-10  Fumitoshi Ukai  <ukai@chromium.org>
1729
1730         Reviewed by Alexey Proskuryakov.
1731
1732         Export WTF::tryFastMalloc used in WebSocketChannel.
1733         https://bugs.webkit.org/show_bug.cgi?id=28038
1734
1735         * JavaScriptCore.exp:
1736         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1737         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
1738
1739 2009-09-10  Oliver Hunt  <oliver@apple.com>
1740
1741         Reviewed by NOBODY (Build fix).
1742
1743         Make StructureTransitionTable use an enum for the PtrAndFlags member
1744         used for the single transition slot optimisation.
1745
1746         * runtime/StructureTransitionTable.h:
1747         (JSC::StructureTransitionTable::StructureTransitionTable):
1748         (JSC::StructureTransitionTable::usingSingleTransitionSlot):
1749         (JSC::StructureTransitionTable::):
1750
1751 2009-09-10  Oliver Hunt  <oliver@apple.com>
1752
1753         Reviewed by Geoff Garen.
1754
1755         Refactor StructureTransitionTable and Structure to unify handling of the single slot optimization
1756         https://bugs.webkit.org/show_bug.cgi?id=29141
1757
1758         Make StructureTransitionTable encapsulate the single transition slot optimization.
1759
1760         * runtime/Structure.cpp:
1761         (JSC::Structure::Structure):
1762         (JSC::Structure::~Structure):
1763         (JSC::Structure::addPropertyTransitionToExistingStructure):
1764         (JSC::Structure::addPropertyTransition):
1765         (JSC::Structure::addPropertyWithoutTransition):
1766         (JSC::Structure::removePropertyWithoutTransition):
1767         (JSC::Structure::hasTransition):
1768         * runtime/Structure.h:
1769         (JSC::StructureTransitionTable::contains):
1770         (JSC::StructureTransitionTable::get):
1771         (JSC::StructureTransitionTable::hasTransition):
1772         (JSC::StructureTransitionTable::reifySingleTransition):
1773         * runtime/StructureTransitionTable.h:
1774         (JSC::StructureTransitionTable::StructureTransitionTable):
1775         (JSC::StructureTransitionTable::~StructureTransitionTable):
1776         (JSC::StructureTransitionTable::remove):
1777         (JSC::StructureTransitionTable::add):
1778         (JSC::StructureTransitionTable::table):
1779         (JSC::StructureTransitionTable::singleTransition):
1780         (JSC::StructureTransitionTable::usingSingleTransitionSlot):
1781         (JSC::StructureTransitionTable::setSingleTransition):
1782         (JSC::StructureTransitionTable::setTransitionTable):
1783         (JSC::StructureTransitionTable::):
1784         * wtf/PtrAndFlags.h:
1785         (WTF::PtrAndFlags::PtrAndFlags):
1786
1787 2009-09-10  Zoltan Horvath  <zoltan@webkit.org>
1788
1789         Reviewed by Darin Adler.
1790
1791         Implement fastDeleteSkippingDestructor for FastAllocBase and fastDeleteAllValues for HashSet
1792         https://bugs.webkit.org/show_bug.cgi?id=25930
1793
1794         FastAllocBase has been extended with fastDeleteSkippingDestructor function which
1795         releases memory without destructor call. fastDeleteAllValues has been implemented 
1796         similar as deleteAllValues but it uses fastDelete function to release memory.
1797
1798         * wtf/FastAllocBase.h:
1799         (WTF::fastDeleteSkippingDestructor):
1800         * wtf/HashSet.h:
1801         (WTF::fastDeleteAllValues):
1802
1803 2009-09-10  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
1804
1805         Reviewed by Darin Adler.
1806
1807         ARM compiler does not understand GCC visibility attribute
1808         https://bugs.webkit.org/show_bug.cgi?id=29079
1809
1810         * API/JSBase.h: Make the test more specific to hit only
1811         the GCC compiler
1812
1813 2009-09-10  Adam Barth  <abarth@webkit.org>
1814
1815         Unreviewed revert of the previous change.  It broke the tests.
1816
1817         * wtf/dtoa.cpp:
1818         (WTF::dtoa):
1819
1820 2009-09-10  Ben Laurie  <benl@google.com>
1821
1822         Reviewed by Adam Barth.
1823
1824         <https://bugs.webkit.org/show_bug.cgi?id=26836>
1825
1826         If dtoa was given a small buffer and the number was either infinite or
1827         NaN, then the buffer would be overflowed.
1828
1829         * wtf/dtoa.cpp:
1830
1831 2009-09-09  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
1832
1833         Reviewed by Darin Adler.
1834
1835         Change reinterpret_cast to static_cast in r48212.
1836
1837         * jit/ExecutableAllocator.h:
1838         (JSC::ExecutableAllocator::cacheFlush):
1839
1840 2009-09-09  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
1841
1842         Reviewed by Darin Adler.
1843
1844         Remove WTF_PLATFORM_FORCE_PACK as it is no longer used
1845         https://bugs.webkit.org/show_bug.cgi?id=29066
1846
1847         * wtf/Platform.h:
1848
1849 2009-09-09  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
1850
1851         Reviewed by Ariya Hidayat.
1852
1853         Implement flushing the instruction cache for Symbian
1854         https://bugs.webkit.org/show_bug.cgi?id=29075
1855
1856         * jit/ExecutableAllocator.h:
1857         (JSC::ExecutableAllocator::cacheFlush): Call IMB_Range to flush
1858         the instruction cache on Symbian
1859
1860 2009-09-09  Kent Hansen  <khansen@trolltech.com>
1861
1862         Reviewed by Darin Adler.
1863
1864         https://bugs.webkit.org/show_bug.cgi?id=29024
1865         Make JavaScriptCore compile on platforms with case-insensitive file systems and typeinfo.h in STL
1866
1867         These platforms include Microsoft Visual Studio 2003, and Symbian with Metrowerks compiler.
1868
1869         * JavaScriptCore.gypi:
1870         * JavaScriptCore.xcodeproj/project.pbxproj:
1871         * runtime/JSTypeInfo.h: Copied from JavaScriptCore/runtime/TypeInfo.h.
1872         * runtime/Structure.h:
1873         * runtime/TypeInfo.h: Removed.
1874
1875 2009-09-08  Oliver Hunt  <oliver@apple.com>
1876
1877         Reviewed by Maciej Stachowiak.
1878
1879         JSON.stringify(Date) loses the milliseconds information
1880         https://bugs.webkit.org/show_bug.cgi?id=29063
1881
1882         Make sure we include milliseconds in the output of toISOString.
1883
1884         * runtime/DatePrototype.cpp:
1885         (JSC::dateProtoFuncToISOString):
1886
1887 2009-09-08  Kevin Ollivier  <kevino@theolliviers.com>
1888
1889         wx build fix, generate derived sources earlier in order to make sure
1890         they're found by the build system when generating the list of sources to build.
1891
1892         * wscript:
1893
1894 2009-09-08  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
1895
1896         Reviewed by Simon Hausmann.
1897
1898         Build fix when USE(LOCKFREE_THREADSAFESHARED) is not defined
1899         https://bugs.webkit.org/show_bug.cgi?id=29011
1900
1901         * wtf/Threading.h: Use LOCKFREE_THREADSAFESHARED guard for 
1902         atomicIncrement and atomicDecrement
1903
1904 2009-09-07  Zoltan Horvath  <zoltan@webkit.org>
1905
1906         Reviewed by Darin Adler.
1907
1908         Allow custom memory allocation control in Yarr's RegexInterpreter
1909         https://bugs.webkit.org/show_bug.cgi?id=29025
1910
1911         Inherits RegexInterpreter classes from FastAllocBase (bug #20422), which has
1912         been instantiated by 'new':
1913
1914         class ByteDisjunction
1915         -> instantiated in JavaScriptCore/yarr/RegexInterpreter.cpp:1462
1916
1917         struct BytecodePattern
1918         -> instantiated in JavaScriptCore/yarr/RegexInterpreter.cpp:1279
1919
1920         * yarr/RegexInterpreter.h:
1921
1922 2009-09-07  Drew Wilson  <atwilson@google.com>
1923
1924         Reverting r48121 to fix Windows build errors.
1925
1926         * JavaScriptCore.exp:
1927
1928 2009-09-07  Drew Wilson  <atwilson@google.com>
1929
1930         Reviewed by David Levin.
1931
1932         Enable SHARED_WORKERS by default
1933         https://bugs.webkit.org/show_bug.cgi?id=28959
1934
1935         * Configurations/FeatureDefines.xcconfig:
1936
1937 2009-09-07  Fumitoshi Ukai  <ukai@chromium.org>
1938
1939         Reviewed by Alexey Proskuryakov.
1940
1941         Export WTF::tryFastMalloc used in WebSocketChannel.
1942         https://bugs.webkit.org/show_bug.cgi?id=28038
1943
1944         * JavaScriptCore.exp:
1945
1946 2009-09-04  Oliver Hunt  <oliver@apple.com>
1947
1948         Reviewed by NOBODY (Build fix).
1949
1950         Fix windows export files
1951
1952         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1953         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
1954
1955 2009-09-04  Oliver Hunt  <oliver@apple.com>
1956
1957         Reviewed by Gavin Barraclough.
1958
1959         [[ToString]] conversion should use the actual toString function for String objects.
1960
1961         Remove incorrect specialisations of toString conversions on StringObject.
1962
1963         * JavaScriptCore.exp:
1964         * runtime/StringObject.cpp:
1965         * runtime/StringObject.h:
1966
1967 2009-09-04  Steve Falkenburg  <sfalken@apple.com>
1968
1969         Windows build fix.
1970
1971         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Add new export.
1972         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: Add new export.
1973
1974 2009-09-04  Steve Falkenburg  <sfalken@apple.com>
1975
1976         Windows build fix.
1977
1978         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Remove unneeded export.
1979         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: Remove unneeded export.
1980
1981 2009-09-04  Darin Adler  <darin@apple.com>
1982
1983         Reviewed by Geoff Garen.
1984
1985         DateInstance object collected on ARM JIT (JSValue: WTF_USE_JSVALUE32)
1986         https://bugs.webkit.org/show_bug.cgi?id=28909
1987
1988         Part two.
1989
1990         Make some improvements to garbage collection code:
1991
1992             1) Create a runtime assertion that catches any classes that
1993                override markChildren but have the HasDefaultMark bit set.
1994             2) Remove checks of the mark bit outside the MarkStack::append
1995                function; they are redundant.
1996             3) Improve the efficiency of the asObject and asArray functions
1997                when called on JSCell* to avoid a round trip to JSValue.
1998             4) Make more callers use the checked asCell and asObject
1999                casting functions rather than unchecked casts.
2000             5) Removed the JSCell::marked function and other GC-related
2001                functions because these operations are no longer things that
2002                code other than the core GC code needs to do directly. Fixed
2003                callers that were calling them.
2004
2005         * runtime/Collector.cpp:
2006         (JSC::Heap::markConservatively): Removed unneeded call to MarkStack::drain.
2007         (JSC::Heap::markProtectedObjects): Removed unneeded check of the mark
2008         bit and call to MarkStack::drain.
2009         (JSC::Heap::collect): Removed unneeded checks of the mark bit and also
2010         changed call to SmallStrings::mark to call markChildren instead to match
2011         the rest of the objects.
2012         (JSC::typeName): Removed unneeded cast to JSObject*.
2013
2014         * runtime/JSArray.h:
2015         (JSC::asArray): Added an overload for JSCell* and changed the JSValue
2016         version to call it. Removed some unneeded casts.
2017         (JSC::JSArray::markChildrenDirect): Marked this function inline. It's in
2018         a header, and if not marked inline this could lead to linking problems.
2019         (JSC::MarkStack::markChildren): Added. This helper function is used by
2020         the drain function to avoid repating code. Also added the code here to
2021         check fro default mark violations in debug code. If a markChildren
2022         function adds something to the mark stack, but the type info claimed
2023         hasDefaultMark was true, then we will get an assertion now. Also fixed
2024         the assertion about the mark bit to use the Heap function directly
2025         because we don't have a JSCell::marked function any more.
2026         (JSC::MarkStack::drain): Changed a local variable from "v" to "value",
2027         and from "currentCell" to "cell". Changed to call markChildren in two
2028         places instead of repeating a chain of if statements twice. Changed
2029         code that reads and writes the mark bit to use Heap::isCellMarked and
2030         Heap::markCell so we can eliminate the JSCell::marked and
2031         JSCell::markCellDirect functions.
2032
2033         * runtime/JSCell.h: Removed JSCell's markCellDirect and marked member
2034         functions. Added a comment explaining that asCell should be deprecated
2035         in favor of the JSValue asCell member function.
2036         (JSC::MarkStack::append): Added the assertion that catches callers
2037         that have set the HasDefaultMark bit incorrectly. Changed
2038         code that reads and writes the mark bit to use Heap::isCellMarked and
2039         Heap::markCell so we can eliminate the JSCell::marked and
2040         JSCell::markCellDirect functions. Moved the overload of
2041         MarkStack::append for JSValue here so it can call through to the cell
2042         version. The old version had a copy of all the code instead, but that
2043         repeated the conversion from JSValue to JSCell* and the check for
2044         whether a value is a cell multiple times.
2045         (JSC::Structure::markAggregate): Moved this function here to avoid
2046         dependencies for Structure.h, since this calls MarkStack::append.
2047
2048         * runtime/JSObject.cpp:
2049         (JSC::JSObject::markChildren): Added code to clear
2050         m_isCheckingForDefaultMarkViolation so the marking done by JSObject
2051         doesn't trigger the assertion.
2052
2053         * runtime/JSValue.h: Moved some stray includes that were outside the
2054         header guard inside it. Not sure how that happened! Removed the
2055         GC-related member functions markChildren, hasChildren, marked, and
2056         markDirect.
2057
2058         * runtime/JSWrapperObject.h: Made markChildren private.
2059         (JSC::JSWrapperObject::createStructure): Added. Fixes a bug where the
2060         HasDefaultMark bit was set.
2061
2062         * runtime/MarkStack.h: Added m_isCheckingForDefaultMarkViolation and
2063         initialized it to false. Moved the append function body from here to
2064         JSCell.h. Added a declaration of a private markChildren function used
2065         inside the drain function.
2066
2067         * runtime/SmallStrings.cpp:
2068         (JSC::SmallStrings::markChildren): Changed the name and style of this
2069         function to match other functions. This allows us to share the normal
2070         mark stack code path.
2071
2072         * runtime/SmallStrings.h: Changed the name and interface of mark to
2073         the more-normal markChildren style.
2074
2075         * runtime/Structure.h: Moved the body of markAggregate into the
2076         JSCell.h to avoid a circular dependency with JSCell.h.
2077
2078 2009-09-04  Darin Adler  <darin@apple.com>
2079
2080         Reviewed by Geoff Garen.
2081
2082         DateInstance object collected on ARM JIT (JSValue: WTF_USE_JSVALUE32)
2083         https://bugs.webkit.org/show_bug.cgi?id=28909
2084
2085         Part one.
2086
2087         Make some improvements to garbage collection code:
2088
2089             1) Fix the two classes that had the default mark bit set but
2090                should not.
2091             2) Remove checks of the mark bit outside the MarkStack::append
2092                function; they are redundant.
2093             3) Make more callers use the checked asCell and asObject
2094                casting functions rather than unchecked casts.
2095             4) Removed some GC-related functions because these operations are
2096                no longer things that code other than the core GC code needs
2097                to do directly. Fixed callers that were calling them.
2098
2099         * bytecode/CodeBlock.cpp:
2100         (JSC::CodeBlock::markAggregate): Removed unneeded check of the mark
2101         bit before calling MarkStack::append.
2102
2103         * interpreter/Register.h: Removed unneeded marked and markChildren
2104         functions.
2105
2106         * jit/JITStubs.cpp:
2107         (op_eq): Removed unneeded assertions, instead using checked casting
2108         functions such as asObject.
2109
2110         * runtime/ArgList.h: Added now-needed forward declaration of MarkStack.
2111
2112         * runtime/GetterSetter.cpp:
2113         (JSC::GetterSetter::markChildren): Remmoved unneeded check of the mark bit.
2114
2115         * runtime/GlobalEvalFunction.h:
2116         (JSC::GlobalEvalFunction::createStructure): Added. Fixes a bug where the
2117         HasDefaultMark bit was set.
2118
2119         * runtime/JSCell.cpp:
2120         (JSC::JSCell::getObject): Use asObject to avoid a direct static_cast.
2121
2122         * runtime/JSObject.h:
2123         (JSC::asObject): Added an overload for JSCell* and changed the JSValue
2124         version to call it.
2125         (JSC::JSValue::get): Use asObject to avoid a direct static_cast.
2126
2127         * runtime/JSWrapperObject.h: Made markChildren private.
2128         (JSC::JSWrapperObject::createStructure): Added. Fixes a bug where the
2129         HasDefaultMark bit was set. Later we may want to optimize this for
2130         wrapper types that never have cells in their internal values, but there
2131         is no measured performance regression in SunSpider or V8 doing this
2132         all the time.
2133
2134         * runtime/MarkStack.cpp: Tweaked formatting.
2135
2136 2009-09-04  Kevin Ollivier  <kevino@theolliviers.com>
2137
2138         wx build fix. Switch USE_ defines over to the compiler so that they can be
2139         checked by files not including config.h (like WebCorePrefix.h).
2140
2141         * wtf/Platform.h:
2142
2143 2009-09-03  Yong Li  <yong.li@torchmobile.com>
2144
2145         Reviewed by David Levin.
2146
2147         Remove unnecessary dependency on unistd.h
2148         https://bugs.webkit.org/show_bug.cgi?id=28962
2149
2150         * runtime/Completion.cpp:
2151
2152 2009-09-03  Fumitoshi Ukai  <ukai@chromium.org>
2153
2154         Reviewed by Eric Seidel.
2155
2156         Add strnstr for Linux and Windows in StringExtras.h
2157         https://bugs.webkit.org/show_bug.cgi?id=28901
2158
2159         * wtf/StringExtras.h:
2160         (strnstr):
2161
2162 2009-09-03  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
2163
2164         Reviewed by Darin Adler.
2165
2166         Allow custom memory allocation control for JavaScriptCore's HashEntry class
2167         https://bugs.webkit.org/show_bug.cgi?id=27830
2168
2169         Inherits HashEntry class from FastAllocBase because it has been
2170         instantiated by 'new' JavaScriptCore/runtime/Lookup.cpp:32.
2171
2172         * runtime/Lookup.h:
2173
2174 2009-09-02  Gavin Barraclough  <barraclough@apple.com>
2175
2176         Should crash if JIT code buffer allocation fails.
2177
2178         https://bugs.webkit.org/show_bug.cgi?id=28926
2179         <rdar://problem/7031922>
2180
2181         * jit/ExecutableAllocatorPosix.cpp:
2182         (JSC::ExecutablePool::systemAlloc):
2183         * jit/ExecutableAllocatorWin.cpp:
2184         (JSC::ExecutablePool::systemAlloc):
2185
2186 2009-09-02  Kevin Ollivier  <kevino@theolliviers.com>
2187
2188         waf build fixes for Windows/MSVC.
2189
2190         * wscript:
2191
2192 2009-09-02  Kevin Ollivier  <kevino@theolliviers.com>
2193
2194         Build fix for building on Windows.
2195
2196         * wtf/ThreadingPthreads.cpp:
2197
2198 2009-09-02  Norbert Leser  <norbert.leser@nokia.com>
2199
2200         Reviewed by Eric Seidel.
2201
2202         Use fastMalloc when neither MMAP nor VIRTUALALLOC are enabled
2203         
2204         RegisterFile constructor currently throws #error when both
2205         MMAP and VIRTUALALLOC conditions fail.
2206         On any platform that does not provide these features
2207         (for instance, Symbian),
2208         the fallback should be regular malloc (or fastMalloc).
2209         It is functionally equivalent in this case, even though it may
2210         have certain drawbacks such as lack of dynamic pre-allocation.
2211
2212         * interpreter/RegisterFile.cpp:
2213         (JSC::RegisterFile::~RegisterFile):
2214         * interpreter/RegisterFile.h:
2215         (JSC::RegisterFile::RegisterFile):
2216
2217 2009-08-31  Robert Agoston  <Agoston.Robert@stud.u-szeged.hu>
2218
2219         Reviewed by Gavin Barraclough.
2220
2221         Fixed typo.
2222         https://bugs.webkit.org/show_bug.cgi?id=28691
2223
2224         * parser/Parser.h:
2225         (JSC::Parser::parse):
2226
2227 2009-08-27  Oliver Hunt  <oliver@apple.com>
2228
2229         Reviewed by Maciej Stachowiak.
2230
2231         JSON Stringifier does not follow ES5 spec for handling of Number, String and Boolean objects
2232         https://bugs.webkit.org/show_bug.cgi?id=28797
2233
2234         Fixed unwrapBoxedPrimitive to do the right thing, which necessitated a couple of new exception
2235         checks, and corrected the logic in gap to correctly convert Number and String objects.
2236
2237         * runtime/JSONObject.cpp:
2238         (JSC::unwrapBoxedPrimitive):
2239         (JSC::gap):
2240         (JSC::Stringifier::Stringifier):
2241         (JSC::Stringifier::appendStringifiedValue):
2242
2243 2009-08-27  Oliver Hunt  <oliver@apple.com>
2244
2245         Reviewed by Adam Roben.
2246
2247         JSON.stringify replacer array does not accept values that are not string primitives.
2248         https://bugs.webkit.org/show_bug.cgi?id=28788
2249
2250         Update the JSON stringifier to initialise its replacer array according to the most
2251         recent version of the spec.
2252
2253         * runtime/Identifier.h:
2254         (JSC::Identifier::from):
2255         * runtime/JSONObject.cpp:
2256         (JSC::Stringifier::Stringifier):
2257
2258 2009-08-27  Alexey Proskuryakov  <ap@apple.com>
2259
2260         Reviewed by Oliver Hunt.
2261
2262         https://bugs.webkit.org/show_bug.cgi?id=28753
2263         <rdar://problem/7173448> Excessive number of threads (and a crash)
2264
2265         * wtf/Threading.h: (WTF::atomicIncrement): Changed atomicIncrement to match decrement
2266         and return the new value. Also added using directives for these functions, to match
2267         te rest of WTF.
2268
2269 2009-08-27  Brent Fulgham  <bfulgham@webkit.org>
2270
2271         Reviewed by Adam Roben.
2272
2273         Link the testapi against CFLite when building the WinCairo port.
2274
2275         * JavaScriptCore.vcproj/testapi/testapi.vcproj: Add new Release_CFLite
2276           target.  Update all targets to inherit from either the
2277           JavaScriptCF.vsprops (Apple target) or the JavaScriptCFLite.vsprops
2278           file (WinCairo target).
2279         * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops: Remove
2280           input file CoreFoundation.lib. This is provided by either the
2281           JavaScriptCF.vsprops or JavaScriptCFLite.vsprops file.
2282
2283 2009-08-27  Steve Falkenburg  <sfalken@apple.com>
2284
2285         Reviewed by Geoff Garen.
2286         
2287         Fix Windows-specific crash due to missing memory clearing call.
2288         
2289         * runtime/Collector.cpp:
2290         (JSC::Heap::allocateBlock):
2291
2292 2009-08-27  Brent Fulgham  <bfulgham@webkit.org>
2293
2294         Build fix: JavaScriptCore_debug.def missing some exports.  Apple
2295         Windows build does not use this file, so it was not noticed previously.
2296
2297         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
2298
2299 2009-08-27  Gavin Barraclough  <barraclough@apple.com>
2300
2301         Reviewed by Oliver Hunt.
2302
2303         x86-64 GTK broken due to code offsets changing, pointers sometimes packed into immediates.
2304         https://bugs.webkit.org/show_bug.cgi?id=28317
2305
2306         Missed one, fix part II.
2307
2308         * assembler/MacroAssemblerX86Common.h:
2309         (JSC::MacroAssemblerX86Common::move):
2310         * assembler/X86Assembler.h:
2311         (JSC::CAN_SIGN_EXTEND_8_32):
2312
2313 2009-08-27  Oliver Hunt  <oliver@apple.com>
2314
2315         Reviewed by Adam Roben.
2316
2317         JSON.stringify replacer array does not accept values that are not string primitives.
2318         https://bugs.webkit.org/show_bug.cgi?id=28788
2319
2320         Update the JSON stringifier to initialise its replacer array according to the most
2321         recent version of the spec.
2322
2323         * runtime/Identifier.h:
2324         (JSC::Identifier::from):
2325         * runtime/JSONObject.cpp:
2326         (JSC::Stringifier::Stringifier):
2327
2328 2009-08-27  Oliver Hunt  <oliver@apple.com>
2329
2330         Reviewed by Alexey Proskuryakov.
2331
2332         JSON parser accepts trailing comma in array literals
2333         https://bugs.webkit.org/show_bug.cgi?id=28779
2334
2335         Update parser to correctly fail if there's a trailing comma.
2336
2337         * runtime/LiteralParser.cpp:
2338         (JSC::LiteralParser::parse):
2339
2340 2009-08-26  Oliver Hunt  <oliver@apple.com>
2341
2342         Reviewed by Gavin Barraclough.
2343
2344         'this' in JSON.parse reviver is the global object
2345         https://bugs.webkit.org/show_bug.cgi?id=28752
2346
2347         This is a technically simple change, we merely update the code for calling
2348         the reviver function to pass the correct this object.  Doing so however
2349         exposes the holder to arbitrary mutation by the reviver function so it is
2350         necessary for us to now guard all property accesses against the possibility
2351         of failure.
2352
2353         * runtime/JSArray.h:
2354           JSON needs to delete a property from the array, so we friend its 
2355           Walker class so that we can make a non-virtual call to the arrays
2356           delete and getOwnPropertySlot methods.
2357         * runtime/JSONObject.cpp:
2358         (JSC::Walker::callReviver):
2359           We need to pass the correct this object
2360         (JSC::Walker::walk):
2361           Update calls to callReviver, and update property logic logic
2362           to correctly handle the holder being mutated by the reviver
2363           function.
2364
2365 2009-08-26  Alice Liu  <alice.liu@apple.com>
2366
2367         Windows build fix: added some exported symbols
2368
2369         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2370         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
2371
2372 2009-08-26  Geoffrey Garen  <ggaren@apple.com>
2373
2374         Windows build fix: Removed some exported symbols that no longer exist.
2375
2376         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2377         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
2378
2379 2009-08-26  Gavin Barraclough  <barraclough@apple.com>
2380
2381         Reviewed by Olliejver Hunt.
2382
2383         x86-64 GTK broken due to code offsets changing, pointers sometimes packed into immediates.
2384         https://bugs.webkit.org/show_bug.cgi?id=28317
2385
2386         We rely on a slightly OS X specific behaviour, that x86-64 applications have a 4Gb zero page,
2387         so pointers are never representable as a 32-bit integer, and always have to be represented by
2388         a separate immediate load instruction, rather than within the immediate field of an arithmetic
2389         or memory operation.
2390
2391         We explicitly check for a couple of cases where a value might be representable in 32-bit, but
2392         these probably never kick in on Mac OS, and only kick in to hose GTK.  Deleting these does not
2393         show a performance degradation on SunSpider.  Remove.
2394
2395         * assembler/MacroAssemblerX86_64.h:
2396         (JSC::MacroAssemblerX86_64::storePtr):
2397         (JSC::MacroAssemblerX86_64::branchPtr):
2398
2399 2009-08-26  Geoffrey Garen  <ggaren@apple.com>
2400
2401         Reviewed by Oliver Hunt.
2402
2403         A bit of Collector refatoring.
2404         
2405         SunSpider says no change. v8 says 1.003x faster (1.02x faster on splay).
2406
2407         * JavaScriptCore.exp:
2408
2409         * runtime/JSCell.cpp:
2410         (JSC::JSCell::toPrimitive):
2411         (JSC::JSCell::getPrimitiveNumber):
2412         (JSC::JSCell::toBoolean):
2413         (JSC::JSCell::toNumber):
2414         (JSC::JSCell::toString):
2415         (JSC::JSCell::toObject): Removed pure virtual functions from
2416         JSCell, so the collector can construct one. This allowed
2417         me to remove a bunch of ASSERT_NOT_REACHED throughout the
2418         code, too.
2419
2420         * runtime/JSCell.h:
2421         (JSC::JSCell::JSCell): ditto
2422         (JSC::Heap::heap): Inlined this function because it's trivial.
2423
2424         * JavaScriptCore.exp:
2425
2426         * runtime/Collector.cpp:
2427         (JSC::Heap::destroy):
2428         (JSC::Heap::allocateBlock):
2429         (JSC::Heap::freeBlock):
2430         (JSC::Heap::freeBlocks): Renamed freeHeap to freeBlocks, since
2431         it doesn't actually free the Heap object.
2432         (JSC::Heap::heapAllocate):
2433         (JSC::Heap::sweep):
2434         * runtime/Collector.h: Refactored block allocation and destruction
2435         into helper functions.
2436         
2437         * runtime/GetterSetter.cpp:
2438         * runtime/JSAPIValueWrapper.cpp:
2439         * runtime/JSPropertyNameIterator.cpp: Removed dummy implementations
2440         of pure virtual functions. (See above.)
2441
2442 === End re-roll-in of r47738:47740 with Windows crash fixed ===
2443
2444 2009-08-26  Geoffrey Garen  <ggaren@apple.com>
2445
2446         Build fix: start out with a 32-bit value to avoid a shortening warning.
2447
2448         * runtime/Collector.cpp:
2449         (JSC::Heap::sweep):
2450
2451 2009-08-24  Geoffrey Garen  <ggaren@apple.com>
2452
2453         Reviewed by Oliver Hunt.
2454
2455         Substantially reduced VM thrash in the GC heap.
2456         
2457         1.08x faster on v8 (1.60x faster on v8-splay).
2458         
2459         1.40x faster on bench-alloc-nonretained.
2460         
2461         1.90x faster on bench-alloc-retained.
2462         
2463         SunSpider says no change.
2464         
2465         * runtime/Collector.cpp:
2466         (JSC::Heap::heapAllocate): Fixed a long-standing bug: update a few local
2467         variables unconditionally after calling collect(), since they may be used
2468         even if we don't "goto scan". (In the bug I saw, usedBlocks got out of
2469         sync with heap.usedBlocks).
2470         (JSC::Heap::sweep): Keep enough free heap space to accomodate 
2471         the number of objects we'll allocate before the next GC, plus 25%, for
2472         good measure.
2473         * runtime/Collector.h: Bumped the block size to 256k. This seems to give
2474         the best cache performance, and it prevents us from initiating lots of
2475         VM traffic to recover very small chunks of memory.
2476
2477 === Begin re-roll-in of r47738:47740 with Windows crash fixed ===
2478
2479 2009-08-25  Drew Wilson  <atwilson@google.com>
2480
2481         Reviewed by David Levin.
2482
2483         postMessage() spec now supports sending arrays of ports
2484         https://bugs.webkit.org/show_bug.cgi?id=26902
2485
2486         Added OwnPtr to VectorTraits so we can store OwnPtrs in Vectors.
2487
2488         * wtf/VectorTraits.h:
2489
2490 2009-08-26  Xan Lopez  <xlopez@igalia.com>
2491
2492         Rubber-stamped by Gustavo Noronha.
2493
2494         Remove duplicated files from file list.
2495
2496         * GNUmakefile.am:
2497
2498 2009-08-26  Oliver Hunt  <oliver@apple.com>
2499
2500         Reviewed by NOBODY (Build fix).
2501
2502         More export fixes.
2503
2504         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2505         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
2506
2507 2009-08-26  Oliver Hunt  <oliver@apple.com>
2508
2509         Reviewed by NOBODY (Build fix).
2510
2511         Hopefully fix all the exports from JSC on windows
2512
2513         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2514         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
2515
2516 2009-08-26  Oliver Hunt  <oliver@apple.com>
2517
2518         Reviewed by NOBODY (Build fixes).
2519
2520         Forgot I added files to JavaScriptCore. 
2521
2522         * GNUmakefile.am:
2523         * JavaScriptCore.gypi:
2524         * JavaScriptCore.pri:
2525         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2526         * JavaScriptCoreSources.bkl:
2527
2528 2009-08-25  Oliver Hunt  <oliver@apple.com>
2529
2530         Reviewed by Gavin Barraclough.
2531
2532         [ES5] Implement getOwnPropertyDescriptor
2533         https://bugs.webkit.org/show_bug.cgi?id=28724
2534
2535         Implement the core runtime support for getOwnPropertyDescriptor.
2536         This adds a virtual getOwnPropertyDescriptor method to every class
2537         that implements getOwnPropertySlot that shadows the behaviour of
2538         getOwnPropertySlot.  The alternative would be to make getOwnPropertySlot
2539         (or PropertySlots in general) provide property attribute information,
2540         but quick testing showed this to be a regression.
2541
2542         * JavaScriptCore.exp:
2543         * JavaScriptCore.xcodeproj/project.pbxproj:
2544         * runtime/Arguments.cpp:
2545         (JSC::Arguments::getOwnPropertyDescriptor):
2546         * runtime/Arguments.h:
2547         * runtime/ArrayPrototype.cpp:
2548         (JSC::ArrayPrototype::getOwnPropertyDescriptor):
2549         * runtime/ArrayPrototype.h:
2550         * runtime/CommonIdentifiers.h:
2551         * runtime/DatePrototype.cpp:
2552         (JSC::DatePrototype::getOwnPropertyDescriptor):
2553         * runtime/DatePrototype.h:
2554         * runtime/JSArray.cpp:
2555         (JSC::JSArray::getOwnPropertyDescriptor):
2556         * runtime/JSArray.h:
2557         * runtime/JSByteArray.cpp:
2558         (JSC::JSByteArray::getOwnPropertyDescriptor):
2559         * runtime/JSByteArray.h:
2560         * runtime/JSFunction.cpp:
2561         (JSC::JSFunction::getOwnPropertyDescriptor):
2562         * runtime/JSFunction.h:
2563         * runtime/JSGlobalObject.h:
2564         (JSC::JSGlobalObject::getOwnPropertyDescriptor):
2565         * runtime/JSNotAnObject.cpp:
2566         (JSC::JSNotAnObject::getOwnPropertyDescriptor):
2567         * runtime/JSNotAnObject.h:
2568         * runtime/JSONObject.cpp:
2569         (JSC::JSONObject::getOwnPropertySlot):
2570         (JSC::JSONObject::getOwnPropertyDescriptor):
2571         * runtime/JSONObject.h:
2572         * runtime/JSObject.cpp:
2573         (JSC::JSObject::getOwnPropertyDescriptor):
2574         (JSC::JSObject::getPropertyDescriptor):
2575         * runtime/JSObject.h:
2576         * runtime/JSString.cpp:
2577         (JSC::JSString::getStringPropertyDescriptor):
2578         (JSC::JSString::getOwnPropertyDescriptor):
2579         * runtime/JSString.h:
2580         * runtime/JSVariableObject.cpp:
2581         (JSC::JSVariableObject::symbolTableGet):
2582         * runtime/JSVariableObject.h:
2583         * runtime/Lookup.h:
2584         (JSC::getStaticPropertyDescriptor):
2585         (JSC::getStaticFunctionDescriptor):
2586         (JSC::getStaticValueDescriptor):
2587           Add property descriptor equivalents of the lookup
2588           table access functions
2589
2590         * runtime/MathObject.cpp:
2591         (JSC::MathObject::getOwnPropertySlot):
2592         (JSC::MathObject::getOwnPropertyDescriptor):
2593         * runtime/MathObject.h:
2594         * runtime/NumberConstructor.cpp:
2595         (JSC::NumberConstructor::getOwnPropertyDescriptor):
2596         * runtime/NumberConstructor.h:
2597         * runtime/ObjectConstructor.cpp:
2598         (JSC::ObjectConstructor::ObjectConstructor):
2599         (JSC::objectConstructorGetOwnPropertyDescriptor):
2600         * runtime/PropertyDescriptor.cpp: Added.
2601         (JSC::PropertyDescriptor::writable):
2602         (JSC::PropertyDescriptor::enumerable):
2603         (JSC::PropertyDescriptor::configurable):
2604         (JSC::PropertyDescriptor::hasAccessors):
2605         (JSC::PropertyDescriptor::setUndefined):
2606         (JSC::PropertyDescriptor::getter):
2607         (JSC::PropertyDescriptor::setter):
2608         (JSC::PropertyDescriptor::setDescriptor):
2609         (JSC::PropertyDescriptor::setAccessorDescriptor):
2610         * runtime/PropertyDescriptor.h: Added.
2611         (JSC::PropertyDescriptor::PropertyDescriptor):
2612         (JSC::PropertyDescriptor::attributes):
2613         (JSC::PropertyDescriptor::isValid):
2614         (JSC::PropertyDescriptor::value):
2615         * runtime/RegExpConstructor.cpp:
2616         (JSC::RegExpConstructor::getOwnPropertyDescriptor):
2617         * runtime/RegExpConstructor.h:
2618         * runtime/RegExpMatchesArray.h:
2619         (JSC::RegExpMatchesArray::getOwnPropertyDescriptor):
2620         * runtime/RegExpObject.cpp:
2621         (JSC::RegExpObject::getOwnPropertyDescriptor):
2622         * runtime/RegExpObject.h:
2623         * runtime/StringObject.cpp:
2624         (JSC::StringObject::getOwnPropertyDescriptor):
2625         * runtime/StringObject.h:
2626         * runtime/StringPrototype.cpp:
2627         (JSC::StringPrototype::getOwnPropertyDescriptor):
2628         * runtime/StringPrototype.h:
2629
2630 2009-08-24  Gavin Barraclough  <barraclough@apple.com>
2631
2632         Reviewed by Darin Adler.
2633
2634         How many copies of the parameters do you need?
2635         https://bugs.webkit.org/show_bug.cgi?id=28701
2636
2637         The function parameters in JSC get copied a lot - and unnecessarily so.
2638
2639         Originally this happened due to duplicating FunctionBodyNodes on recompilation,
2640         though the problem has been exacerbated by copying the parameters from the
2641         original function body onto the executable, then back onto the real body that
2642         will be generated (this happens on every function).  And this is all made worse
2643         since the data structures in question are a little ugly - C style arrays of C++
2644         objects containing ref counts, so they need a full copy-construct (rather than
2645         a simple memcpy).
2646
2647         This can all be greatly simplified by just punting the parameters off into
2648         their own ref-counted object, and forgoing all the copying.
2649
2650         ~no performance change, possible slight progression.
2651
2652         * bytecompiler/BytecodeGenerator.cpp:
2653         (JSC::BytecodeGenerator::BytecodeGenerator):
2654         * bytecompiler/BytecodeGenerator.h:
2655         (JSC::BytecodeGenerator::makeFunction):
2656         * parser/Nodes.cpp:
2657         (JSC::FunctionParameters::FunctionParameters):
2658         (JSC::FunctionBodyNode::FunctionBodyNode):
2659         (JSC::FunctionBodyNode::finishParsing):
2660         * parser/Nodes.h:
2661         (JSC::FunctionBodyNode::parameters):
2662         (JSC::FunctionBodyNode::parameterCount):
2663         * runtime/Executable.cpp:
2664         (JSC::FunctionExecutable::~FunctionExecutable):
2665         (JSC::FunctionExecutable::compile):
2666         (JSC::FunctionExecutable::reparseExceptionInfo):
2667         (JSC::FunctionExecutable::fromGlobalCode):
2668         (JSC::FunctionExecutable::paramString):
2669         * runtime/Executable.h:
2670         (JSC::FunctionExecutable::FunctionExecutable):
2671         (JSC::FunctionExecutable::parameterCount):
2672
2673 2009-08-25  Brent Fulgham  <bfulgham@webkit.org>
2674
2675         Reviewed by NOBODY (Buildfix).
2676
2677         * JavaScriptCore.vcproj/jsc/jsc.vcproj: Add Debug_CFLite target
2678           that inherits from the debug_wincairo property sheet and therefore
2679           links to the proper debug library.
2680         * JavaScriptCore.vcproj/testapi/testapi.vcproj: Add Debug_CFLite target
2681           that inherits from the debug_wincairo property sheet and therefore
2682           links to the proper debug library.
2683
2684 2009-08-25  Chris Marrin  <cmarrin@apple.com>
2685
2686         Reviewed by Simon Fraser.
2687
2688         Export tryFastMalloc for Canvas3D work
2689         https://bugs.webkit.org/show_bug.cgi?id=28018
2690
2691         * JavaScriptCore.exp:
2692
2693 2009-08-25  David Levin  <levin@chromium.org>
2694
2695         Reviewed by Adam Roben.
2696
2697         PLATFORM(CFNETWORK) should be USE(CFNETWORK).
2698         https://bugs.webkit.org/show_bug.cgi?id=28713
2699
2700         * wtf/Platform.h: Added a #define to catch this issue in the
2701         future. The define would generate an error on gcc without the
2702         space in the expansion, but Visual C++ needs the space to cause an error.
2703
2704 2009-08-24  Brent Fulgham  <bfulgham@webkit.org>
2705
2706         Reviewed by Steve Falkenburg.
2707
2708         Revise CFLite Debug build to emit DLL's with _debug label.
2709         https://bugs.webkit.org/show_bug.cgi?id=28695.
2710
2711         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Modify
2712           Cairo debug build to inherit from new debug_cairo property sheet.
2713         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCFLite.vsprops:
2714           Modify to look for debug CFLite when in debug build.
2715
2716 2009-08-24  Gavin Barraclough  <barraclough@apple.com>
2717
2718         Reviewed by Oliver Adler & Darin Hunt.
2719
2720         https://bugs.webkit.org/show_bug.cgi?id=28691
2721         Do not retain ScopeNodes outside of parsing
2722         
2723         There is now no need for these to exist outside of parsing - their use in the runtime is replaced by Executable types.
2724
2725         * bytecode/EvalCodeCache.h:
2726         (JSC::EvalCodeCache::get):
2727         * bytecompiler/BytecodeGenerator.cpp:
2728         (JSC::BytecodeGenerator::BytecodeGenerator):
2729         (JSC::BytecodeGenerator::emitNewFunction):
2730         (JSC::BytecodeGenerator::emitNewFunctionExpression):
2731         * bytecompiler/BytecodeGenerator.h:
2732         (JSC::BytecodeGenerator::makeFunction):
2733         * debugger/Debugger.cpp:
2734         (JSC::Debugger::recompileAllJSFunctions):
2735         (JSC::evaluateInGlobalCallFrame):
2736         * debugger/DebuggerCallFrame.cpp:
2737         (JSC::DebuggerCallFrame::evaluate):
2738         * interpreter/Interpreter.cpp:
2739         (JSC::Interpreter::execute):
2740         (JSC::Interpreter::prepareForRepeatCall):
2741         (JSC::Interpreter::privateExecute):
2742         * jit/JITStubs.cpp:
2743         (JSC::DEFINE_STUB_FUNCTION):
2744         * parser/Nodes.cpp:
2745         (JSC::ScopeNodeData::ScopeNodeData):
2746         (JSC::ProgramNode::create):
2747         (JSC::EvalNode::create):
2748         (JSC::FunctionBodyNode::create):
2749         * parser/Nodes.h:
2750         (JSC::ScopeNode::adoptData):
2751         (JSC::FunctionBodyNode::parameterCount):
2752         * parser/Parser.cpp:
2753         * parser/Parser.h:
2754         (JSC::Parser::arena):
2755         (JSC::Parser::Parser):
2756         (JSC::Parser::parse):
2757         * runtime/ArrayPrototype.cpp:
2758         (JSC::isNumericCompareFunction):
2759         (JSC::arrayProtoFuncSort):
2760         * runtime/Completion.cpp:
2761         (JSC::checkSyntax):
2762         (JSC::evaluate):
2763         * runtime/Executable.cpp:
2764         (JSC::FunctionExecutable::~FunctionExecutable):
2765         (JSC::EvalExecutable::compile):
2766         (JSC::ProgramExecutable::checkSyntax):
2767         (JSC::ProgramExecutable::compile):
2768         (JSC::FunctionExecutable::compile):
2769         (JSC::EvalExecutable::generateJITCode):
2770         (JSC::ProgramExecutable::generateJITCode):
2771         (JSC::FunctionExecutable::generateJITCode):
2772         (JSC::FunctionExecutable::reparseExceptionInfo):
2773         (JSC::EvalExecutable::reparseExceptionInfo):
2774         (JSC::FunctionExecutable::recompile):
2775         (JSC::FunctionExecutable::fromGlobalCode):
2776         (JSC::FunctionExecutable::copyParameters):
2777         (JSC::FunctionExecutable::paramString):
2778         * runtime/Executable.h:
2779         (JSC::ScriptExecutable::ScriptExecutable):
2780         (JSC::ScriptExecutable::sourceID):
2781         (JSC::ScriptExecutable::sourceURL):
2782         (JSC::ScriptExecutable::lineNo):
2783         (JSC::ScriptExecutable::lastLine):
2784         (JSC::ScriptExecutable::usesEval):
2785         (JSC::ScriptExecutable::usesArguments):
2786         (JSC::ScriptExecutable::needsActivation):
2787         (JSC::ScriptExecutable::recordParse):
2788         (JSC::EvalExecutable::bytecode):
2789         (JSC::EvalExecutable::jitCode):
2790         (JSC::ProgramExecutable::bytecode):
2791         (JSC::ProgramExecutable::reparseExceptionInfo):
2792         (JSC::ProgramExecutable::jitCode):
2793         (JSC::FunctionExecutable::FunctionExecutable):
2794         (JSC::FunctionExecutable::make):
2795         (JSC::FunctionExecutable::bytecode):
2796         (JSC::FunctionExecutable::isGenerated):
2797         (JSC::FunctionExecutable::name):
2798         (JSC::FunctionExecutable::parameterCount):
2799         (JSC::FunctionExecutable::jitCode):
2800         * runtime/FunctionConstructor.cpp:
2801         (JSC::constructFunction):
2802         * runtime/JSGlobalData.cpp:
2803         (JSC::JSGlobalData::numericCompareFunction):
2804         * runtime/JSGlobalObjectFunctions.cpp:
2805         (JSC::globalFuncEval):
2806
2807 2009-08-24  Darin Adler  <darin@apple.com>
2808
2809         * runtime/ObjectPrototype.cpp:
2810         (JSC::ObjectPrototype::put): Landed revised version I had tested but forgot
2811         to land. Leave out the branch, since we don't need one.
2812
2813 2009-08-24  Darin Adler  <darin@apple.com>
2814
2815         Reviewed by Geoff Garen.
2816
2817         Array index miss case creates a string every time
2818         https://bugs.webkit.org/show_bug.cgi?id=28664
2819
2820         SunSpider test results I saw:
2821
2822             0.5% faster overall
2823             1% faster on crypto-aes
2824             20% faster on crypto-md5
2825             13% faster on crypto-sha1
2826
2827         * runtime/ObjectPrototype.cpp:
2828         (JSC::ObjectPrototype::ObjectPrototype): Initialize m_hasNoPropertiesWithUInt32Names
2829         to true.
2830         (JSC::ObjectPrototype::put): Clearly m_hasNoPropertiesWithUInt32Names if the new
2831         property has a name that is the string form of a UInt32.
2832         (JSC::ObjectPrototype::getOwnPropertySlot): Don't call JSObject::getOwnPropertySlot
2833         if m_hasNoPropertiesWithUInt32Names is true, and it is highly likely to be true.
2834
2835         * runtime/ObjectPrototype.h: Added declarations for the above.
2836
2837 2009-08-24  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
2838
2839         Unreviewed. Fix a typo in my distcheck build fix.
2840
2841         * GNUmakefile.am:
2842
2843 2009-08-23  Gustavo Noronha Silva  <gns@gnome.org>
2844
2845         Unreviewed build fix for make distcheck.
2846
2847         * GNUmakefile.am: Added files required for the build.
2848
2849 2009-08-22  Maciej Stachowiak  <mjs@apple.com>
2850
2851         Reviewed by Mark Rowe.
2852
2853         REGRESSION(r47639-r47660): Webkit crashes on launch on PowerPC
2854         https://bugs.webkit.org/show_bug.cgi?id=28655
2855
2856         * runtime/JSFunction.cpp:
2857         (JSC::JSFunction::JSFunction): Initialize properly with a VPtrHackExecutable.
2858         * wtf/Platform.h:
2859
2860 2009-08-22  Darin Adler  <darin@apple.com>
2861
2862         Fix storage leak from syntax tree arena allocation patch.
2863
2864         * parser/Nodes.h: CommaNode needs to inherit from ParserArenaDeletable
2865         because it has a vector.
2866
2867 2009-08-21  Darin Adler  <darin@apple.com>
2868
2869         Fix Qt build.
2870
2871         * parser/Nodes.cpp:
2872         (JSC::ScopeNodeData::ScopeNodeData): Made non-inline again.
2873         This is used outside Nodes.cpp so can't be inline unless
2874         it is in the header.
2875
2876 2009-08-21  Darin Adler  <darin@apple.com>
2877
2878         Two loose ends from the last commit.
2879
2880         * JavaScriptCore.xcodeproj/project.pbxproj: Made ParserArena.h
2881         and create_hash_table project-internal instead of "private".
2882         * runtime/Executable.h: Removed accidentally-added constructor.
2883
2884 2009-08-21  Darin Adler  <darin@apple.com>
2885
2886         Reviewed by Gavin Barraclough.
2887
2888         Syntax tree nodes should use arena allocation
2889         https://bugs.webkit.org/show_bug.cgi?id=25674
2890
2891         Use an actual arena now. 0.6% speedup on SunSpider.
2892
2893         New and improved with 100% less leaking of the universe.
2894
2895         * JavaScriptCore.exp:
2896         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2897         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
2898         Removed all exports involving the class FunctionBodyNode, which no
2899         longer needs to be used outside JavaScriptCore.
2900
2901         * JavaScriptCore.xcodeproj/project.pbxproj: Made Nodes.h and
2902         Executable.h project-internal instead of "private".
2903
2904         * bytecompiler/BytecodeGenerator.cpp:
2905         (JSC::BytecodeGenerator::BytecodeGenerator): Updated since VarStack
2906         contains const Identifier* now.
2907
2908         * parser/Grammar.y: Made identifiers from the lexer be const
2909         Identifier* and updated since VarStack contains const Identifier* now.
2910
2911         * parser/Lexer.cpp:
2912         (JSC::Lexer::setCode): Pass in ParserArena, used for identifiers.
2913         (JSC::Lexer::makeIdentifier): Changed return type to const Identifier*
2914         and changed to call ParserArena.
2915         (JSC::Lexer::clear): Removed the code to manage m_identifiers and
2916         added code to set m_arena to 0.
2917         * parser/Lexer.h: Updated for changes above.
2918
2919         * parser/NodeConstructors.h:
2920         (JSC::ParserArenaFreeable::operator new): Added. Calls allocateFreeable
2921         on the arena.
2922         (JSC::ParserArenaDeletable::operator new): Changed to call the
2923         allocateDeletable function on the arena instead of deleteWithArena.
2924         (JSC::PropertyNode::PropertyNode): Added new constructor that makes
2925         numeric identifiers. Some day we might want to optimize this for
2926         integers so it doesn't create a string for each one.
2927         (JSC::ContinueNode::ContinueNode): Initialize m_ident to nullIdentifier
2928         since it's now a const Identifier& so it can't be left uninitialized.
2929         (JSC::BreakNode::BreakNode): Ditto.
2930         (JSC::CaseClauseNode::CaseClauseNode): Updated to use SourceElements*
2931         to keep track of the statements rather than a separate statement vector.
2932         (JSC::BlockNode::BlockNode): Ditto.
2933         (JSC::ForInNode::ForInNode): Initialize m_ident to nullIdentifier.
2934
2935         * parser/Nodes.cpp: Moved the comment explaining emitBytecode in here.
2936         It seemed strangely out of place in the header.
2937         (JSC::ThrowableExpressionData::emitThrowError): Added an overload for
2938         UString as well as Identifier.
2939         (JSC::SourceElements::singleStatement): Added.
2940         (JSC::SourceElements::lastStatement): Added.
2941         (JSC::RegExpNode::emitBytecode): Changed the throwError code to use
2942         the substitution mechanism instead of doing a string append.
2943         (JSC::SourceElements::emitBytecode): Added. Replaces the old
2944         statementListEmitCode function, since we now keep the SourceElements
2945         objects around.
2946         (JSC::BlockNode::lastStatement): Added.
2947         (JSC::BlockNode::emitBytecode): Changed to use emitBytecode instead of
2948         statementListEmitCode.
2949         (JSC::CaseClauseNode::emitBytecode): Added.
2950         (JSC::CaseBlockNode::emitBytecodeForBlock): Changed to use emitBytecode
2951         instead of statementListEmitCode.
2952         (JSC::ScopeNodeData::ScopeNodeData): Changed to store the
2953         SourceElements* instead of using releaseContentsIntoVector.
2954         (JSC::ScopeNode::emitStatementsBytecode): Added.
2955         (JSC::ScopeNode::singleStatement): Added.
2956         (JSC::ProgramNode::emitBytecode): Call emitStatementsBytecode instead
2957         of statementListEmitCode.
2958         (JSC::EvalNode::emitBytecode): Ditto.
2959         (JSC::FunctionBodyNode::emitBytecode): Call emitStatementsBytecode
2960         insetad of statementListEmitCode and check for the return node using
2961         the new functions.
2962
2963         * parser/Nodes.h: Changed VarStack to store const Identifier* instead
2964         of Identifier and rely on the arena to control lifetime. Added a new
2965         ParserArenaFreeable class. Made ParserArenaDeletable inherit from
2966         FastAllocBase instead of having its own operator new. Base the Node
2967         class on ParserArenaFreeable. Changed the various Node classes
2968         to use const Identifier& instead of Identifier to avoid the need to
2969         call their destructors and allow them to function as "freeable" in the
2970         arena. Removed extraneous JSC_FAST_CALL on definitions of inline functions.
2971         Changed ElementNode, PropertyNode, ArgumentsNode, ParameterNode,
2972         CaseClauseNode, ClauseListNode, and CaseBlockNode to use ParserArenaFreeable
2973         as a base class since they do not descend from Node. Eliminated the
2974         StatementVector type and instead have various classes use SourceElements*
2975         instead of StatementVector. This prevents those classes from having to
2976         use ParserArenaDeletable to make sure the vector destructor is called.
2977
2978         * parser/Parser.cpp:
2979         (JSC::Parser::parse): Pass the arena to the lexer.
2980
2981         * parser/Parser.h: Added an include of ParserArena.h, which is no longer
2982         included by Nodes.h.
2983         (JSC::Parser::parseFunctionFromGlobalCode): Changed to use the
2984         singleStatement function, since there is no longer any children function.
2985         Removed some unneeded use of RefPtr.
2986
2987         * parser/ParserArena.cpp:
2988         (JSC::ParserArena::ParserArena): Added. Initializes the new members,
2989         m_freeableMemory, m_freeablePoolEnd, and m_identifiers.
2990         (JSC::ParserArena::freeablePool): Added. Computes the pool pointer,
2991         since we store only the current pointer and the end of pool pointer.
2992         (JSC::ParserArena::deallocateObjects): Added. Contains the common
2993         memory-deallocation logic used by both the destructor and the
2994         reset function.
2995         (JSC::ParserArena::~ParserArena): Changed to call deallocateObjects.
2996         (JSC::ParserArena::reset): Ditto. Also added code to zero out the
2997         new structures, and switched to use clear() instead of shrink(0) since
2998         we don't really reuse arenas.
2999         (JSC::ParserArena::makeNumericIdentifier): Added.
3000         (JSC::ParserArena::allocateFreeablePool): Added. Used when the pool
3001         is empty.
3002         (JSC::ParserArena::isEmpty): Added. No longer inline, which is fine
3003         since this is used only for assertions at the moment.
3004         (JSC::ParserArena::derefWithArena): Make non-inline.
3005
3006         * parser/ParserArena.h: Added an actual arena of "freeable" objects,
3007         ones that don't need destructors to be called. Also added a separate
3008         IdentifierArena object, a segmented vector of identifiers that used
3009         to be in the Lexer.
3010
3011         * runtime/Executable.h: Moved the definition of the
3012         FunctionExecutable::make function here. It can't go in JSFunction.h
3013         since that header has to be used outside JavaScriptCore and so can't
3014         include this, which includes Nodes.h. The function could be moved
3015         elswhere if we don't want to include JSFunction.h in this header, but
3016         for now this seems to be the best place.
3017
3018         * runtime/JSFunction.h: Removed the include of Executable.h and
3019         definition of the FunctionExecutable::make function.
3020
3021         * wtf/FastMalloc.cpp: Fixed an incorrect comment.
3022
3023 2009-08-21  Mark Rowe  <mrowe@apple.com>
3024
3025         Fix the non-JIT build.
3026
3027         * runtime/Executable.cpp:
3028         * runtime/Executable.h:
3029
3030 2009-08-21  Gavin Barraclough  <barraclough@apple.com>
3031
3032         Speculative QuickTime build fix.
3033
3034         * runtime/JSArray.cpp:
3035
3036 2009-08-21  Gavin Barraclough  <barraclough@apple.com>
3037
3038         Speculative QT build fix.
3039
3040         * runtime/StringPrototype.cpp:
3041
3042 2009-08-21  Gavin Barraclough  <barraclough@apple.com>
3043
3044         Reviewed by Oliver Hunt.
3045
3046         Restructure Executable types so that host functions do not hold a FunctionExecutable.
3047         https://bugs.webkit.org/show_bug.cgi?id=28621
3048
3049         All JSFunction objects have a pointer to an Executable*.  This is currently always a
3050         FunctionExecutable, however this has a couple of drawbacks.  Host functions do not
3051         store a range of information that the FunctionExecutable provides (source, name,
3052         CodeBlock & information presently held on the FunctionBodyNode). 
3053
3054         [ * nearly all... see below! ]
3055
3056         Instead, make JSFunctions hold a pointer to an ExecutableBase, move fields specific
3057         to JS sourced executable types (source, node) into a new subclass (ScriptExecutable),
3058         and create a new NativeExecutable type.  We now provide a new method in JSFunction
3059         to access & downcast to FunctionExecutable, but in doing so we can make an early
3060         check (with an ASSERT) to ensure that the Executable read from a function will only
3061         be treated as a FunctionExecutable (and thus the JS sepcific fields will only be
3062         accessed) if the JSFunction is not a host function.
3063
3064         There is one JSFunction that currently does not have an Executable, which is the
3065         object created to allow us to read out the vtable pointer.  By making this change
3066         we can also add a new Executable type fror this object (VPtrHackExecutable).
3067         Since this means that really all JSFunctions have an Executable we no longer have
3068         to null-check m_executable before us it - particularly in isHostFunction().
3069
3070         This patch removes CacheableEvalExecutable, since all subclasses of ExecutableBase
3071         can now be ref-counted - since both JSFunction holds (and ref-counts) an ExecutableBase
3072         that might be a FunctionExecutable or a NativeExecutable.  This does now mean that all
3073         ProgramExecutables and EvalExecutables (unnecessarily) provide an interface to be
3074         ref-counted, however this seems less-bad than host functions unnecessarily providing
3075         interface to access non-host specific information.
3076
3077         The class hierarcy has changed from this:
3078         
3079         - ExecutableBase
3080             - ProgramExecutable
3081             - EvalExecutable
3082                 - CacheableEvalExecutable (also RefCounted by multiple-inheritance)
3083             - FunctionExecutable (also RefCounted by multiple-inheritance, 'special' FunctionExecutable also used for host functions)
3084
3085         To this:
3086         
3087         - RefCounted
3088             - ExecutableBase
3089                 - NativeExecutable
3090                 - VPtrHackExecutable
3091                 - ScriptExecutable
3092                     - ProgramExecutable
3093                     - EvalExecutable
3094                     - FunctionExecutable
3095
3096         This patch speeds up sunspidey by a couple of ms (presumably due to the changes to isHostFunction()).
3097
3098         * bytecode/CodeBlock.cpp:
3099         (JSC::CodeBlock::CodeBlock):
3100         * bytecode/CodeBlock.h:
3101         (JSC::CodeBlock::ownerExecutable):
3102         (JSC::GlobalCodeBlock::GlobalCodeBlock):
3103         * bytecode/EvalCodeCache.h:
3104         (JSC::EvalCodeCache::get):
3105         * debugger/Debugger.cpp:
3106         (JSC::Debugger::recompileAllJSFunctions):
3107         * interpreter/CachedCall.h:
3108         (JSC::CachedCall::CachedCall):
3109         * interpreter/Interpreter.cpp:
3110         (JSC::Interpreter::callEval):
3111         (JSC::Interpreter::privateExecute):
3112         * jit/JITStubs.cpp:
3113         (JSC::DEFINE_STUB_FUNCTION):
3114         * profiler/Profiler.cpp:
3115         (JSC::createCallIdentifierFromFunctionImp):
3116         * runtime/Arguments.h:
3117         (JSC::Arguments::getArgumentsData):
3118         (JSC::Arguments::Arguments):
3119         * runtime/Executable.cpp:
3120         (JSC::NativeExecutable::~NativeExecutable):
3121         (JSC::VPtrHackExecutable::~VPtrHackExecutable):
3122         * runtime/Executable.h:
3123         (JSC::ExecutableBase::ExecutableBase):
3124         (JSC::ExecutableBase::~ExecutableBase):
3125         (JSC::ExecutableBase::isHostFunction):
3126         (JSC::NativeExecutable::NativeExecutable):
3127         (JSC::VPtrHackExecutable::VPtrHackExecutable):
3128         (JSC::ScriptExecutable::ScriptExecutable):
3129         (JSC::ScriptExecutable::source):
3130         (JSC::ScriptExecutable::sourceID):
3131         (JSC::ScriptExecutable::sourceURL):
3132         (JSC::ScriptExecutable::lineNo):
3133         (JSC::ScriptExecutable::lastLine):
3134         (JSC::ScriptExecutable::usesEval):
3135         (JSC::ScriptExecutable::usesArguments):
3136         (JSC::ScriptExecutable::needsActivation):
3137         (JSC::EvalExecutable::EvalExecutable):
3138         (JSC::EvalExecutable::create):
3139         (JSC::ProgramExecutable::ProgramExecutable):
3140         (JSC::FunctionExecutable::FunctionExecutable):
3141         * runtime/FunctionPrototype.cpp:
3142         (JSC::functionProtoFuncToString):
3143         * runtime/JSFunction.cpp:
3144         (JSC::JSFunction::JSFunction):
3145         (JSC::JSFunction::~JSFunction):
3146         (JSC::JSFunction::markChildren):
3147         (JSC::JSFunction::getCallData):
3148         (JSC::JSFunction::call):
3149         (JSC::JSFunction::lengthGetter):
3150         (JSC::JSFunction::getConstructData):
3151         (JSC::JSFunction::construct):
3152         * runtime/JSFunction.h:
3153         (JSC::JSFunction::executable):
3154         (JSC::JSFunction::jsExecutable):
3155         (JSC::JSFunction::isHostFunction):
3156
3157 2009-08-20  Oliver Hunt  <oliver@apple.com>
3158
3159         Reviewed by Maciej Stachowiak.
3160
3161         Browser hangs on opening Web Inspector.
3162         https://bugs.webkit.org/show_bug.cgi?id=28438
3163
3164         Code generation needs to be able to walk the entire scopechain in some
3165         cases, however the symbol table used by activations was a member of the
3166         codeblock.  Following recompilation this may no longer exist, leading
3167         to a crash or hang on lookup.
3168
3169         We fix this by introducing a refcounted SymbolTable subclass, SharedSymbolTable,
3170         for the CodeBlocks used by function code.  This allows activations to
3171         maintain ownership of a copy of the symbol table even after recompilation so
3172         they can continue to work.
3173
3174         * bytecode/CodeBlock.cpp:
3175         (JSC::CodeBlock::CodeBlock):
3176         * bytecode/CodeBlock.h:
3177         (JSC::CodeBlock::symbolTable):
3178         (JSC::CodeBlock::sharedSymbolTable):
3179         (JSC::GlobalCodeBlock::GlobalCodeBlock):
3180         (JSC::FunctionCodeBlock::FunctionCodeBlock):
3181         (JSC::FunctionCodeBlock::~FunctionCodeBlock):
3182         * interpreter/Interpreter.cpp:
3183         (JSC::Interpreter::retrieveArguments):
3184         * runtime/Executable.cpp:
3185         (JSC::EvalExecutable::generateBytecode):
3186         (JSC::FunctionExecutable::generateBytecode):
3187         (JSC::FunctionExecutable::reparseExceptionInfo):
3188         (JSC::EvalExecutable::reparseExceptionInfo):
3189         * runtime/JSActivation.h:
3190         (JSC::JSActivation::JSActivationData::JSActivationData):
3191         (JSC::JSActivation::JSActivationData::~JSActivationData):
3192         * runtime/SymbolTable.h:
3193
3194 2009-08-20  Xan Lopez  <xlopez@igalia.com>
3195
3196         Add new file to GTK+ build.
3197
3198         * GNUmakefile.am:
3199
3200 2009-08-20  Geoffrey Garen  <ggaren@apple.com>
3201
3202         Reviewed by Maciej Stachowiak.
3203
3204         Added a number => string cache.
3205         
3206         1.07x faster on v8 (1.7x faster on v8-splay).
3207         1.004x faster on SunSpider.
3208
3209         * runtime/JSCell.h: Moved JSValue::toString to JSString.h.
3210         * runtime/JSGlobalData.h: Holds the cache.
3211         * runtime/JSNumberCell.cpp:
3212         (JSC::JSNumberCell::toString):
3213         (JSC::JSNumberCell::toThisString): Removed -0 special case.
3214         UString handles this now, since too many clients were
3215         special-casing it.
3216
3217         * runtime/JSString.h:
3218         (JSC::JSValue::toString): Use the cache when converting
3219         an int or double to string.
3220
3221         * runtime/Operations.h:
3222         (JSC::concatenateStrings): Call toString to take advantage
3223         of the cache.
3224
3225         * runtime/SmallStrings.h:
3226         (JSC::NumericStrings::add):
3227         (JSC::NumericStrings::lookup): The cache.
3228
3229         * runtime/UString.cpp:
3230         (JSC::UString::from): Added -0 special case mentioned above.
3231         Removed appendNumeric because it's mutually exclusive with the
3232         cache.
3233
3234 2009-08-20  Oliver Hunt  <oliver@apple.com>
3235
3236         Reviewed by Gavin Barraclough.
3237
3238         REGRESSION: fast/profiler/call.html is crashing occasionally
3239         https://bugs.webkit.org/show_bug.cgi?id=28476
3240
3241         Using the codeblock for information about how many parameters and
3242         locals a function has is unsafe in certain circumstances.  The
3243         basic scenario is all function code being cleared in response to
3244         the debugger or profiler being enabled, and then an activation is
3245         marked before its associated function is re-executed.
3246
3247         To deal with this scenario we store the variable count of a function
3248         directly in the FunctionExecutable, and then use that information.
3249
3250         * runtime/Arguments.h:
3251         (JSC::Arguments::getArgumentsData):
3252         * runtime/Executable.cpp:
3253         (JSC::FunctionExecutable::generateBytecode):
3254         * runtime/Executable.h:
3255         (JSC::FunctionExecutable::FunctionExecutable):
3256         (JSC::FunctionExecutable::variableCount):
3257         * runtime/JSActivation.cpp:
3258         (JSC::JSActivation::markChildren):
3259
3260 2009-08-20  Gavin Barraclough  <barraclough@apple.com>
3261
3262         Reviewed by Oliver Hunt.
3263
3264         Numbering of arguments to emitGetJITStubArg/emitPutJITStubArg incorrect
3265         <bug lost in the great bug disasteroony of 08/20/09!>
3266
3267         The argumentNumber argument to emitGetJITStubArg/emitPutJITStubArg should match
3268         the argument number used within the stub functions in JITStubs.cpp, but it doesn't.
3269
3270         Firstly, all the numbers changed when we added a void* 'reserved' as the first slot
3271         (rather than leaving argument 0 unused), and secondly in 32_64 builds the index to
3272         peek/poke needs to be multiplies by 2 (since the argument to peek/poke is a number
3273         of machine words, and on 32_64 build the argument slots to stub functions are two
3274         words wide).
3275
3276         * jit/JIT.h:
3277         * jit/JITCall.cpp:
3278         (JSC::JIT::compileOpCallSetupArgs):
3279         (JSC::JIT::compileOpConstructSetupArgs):
3280         (JSC::JIT::compileOpCallVarargsSetupArgs):
3281         (JSC::JIT::compileOpCall):
3282         * jit/JITInlineMethods.h:
3283         (JSC::JIT::emitPutJITStubArg):
3284         (JSC::JIT::emitPutJITStubArgConstant):
3285         (JSC::JIT::emitGetJITStubArg):
3286         (JSC::JIT::emitPutJITStubArgFromVirtualRegister):
3287         * jit/JITOpcodes.cpp:
3288         (JSC::JIT::privateCompileCTIMachineTrampolines):
3289         * jit/JITPropertyAccess.cpp:
3290         (JSC::JIT::privateCompilePutByIdTransition):
3291
3292 2009-08-20  Oliver Hunt  <oliver@apple.com>
3293
3294         Reviewed by Geoff Garen.
3295
3296         REGRESSION: significant slowdown on Celtic Kane "AJAX declaration" subtest
3297         https://bugs.webkit.org/show_bug.cgi?id=28332
3298
3299         Follow up style fixes that were missed in review.
3300
3301         * runtime/Structure.cpp:
3302         (JSC::Structure::hasTransition):
3303         * runtime/Structure.h:
3304         (JSC::Structure::get):
3305         (JSC::StructureTransitionTable::contains):
3306         * runtime/StructureTransitionTable.h:
3307         (JSC::StructureTransitionTable::add):
3308
3309 2009-08-20  Oliver Hunt  <oliver@apple.com>
3310
3311         Add new exports to windows jsc build
3312
3313         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3314         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
3315
3316 2009-08-20  Oliver Hunt  <oliver@apple.com>
3317
3318         Reviewed by Gavin Barraclough.
3319
3320         REGRESSION: significant slowdown on Celtic Kane "AJAX declaration" subtest
3321         https://bugs.webkit.org/show_bug.cgi?id=28332
3322
3323         The method check optimisation made transitions aware of the value being
3324         assigned when a transition was assigning a function.  This had the side
3325         effect of making every assignment of a function expression result in a
3326         new transition, and thus a new Structure.  The net result of this is that
3327         the common JS idiom of
3328
3329             function MyObject() {
3330                 this.myFunction = function(...){...};
3331             }
3332             new MyObject();
3333
3334         Will produce a unique structure on every iteration, meaning that all
3335         caching is defeated and there is a significant amount of structure churn.
3336
3337         The fix is to return the transition to its original form where it is
3338         keyed off a property name + attributes tuple, but have each transition
3339         support an optional transition on a specific value.
3340
3341         * JavaScriptCore.exp:
3342         * runtime/JSObject.h:
3343         (JSC::JSObject::putDirectInternal):
3344         * runtime/Structure.cpp:
3345         (JSC::Structure::~Structure):
3346         (JSC::Structure::addPropertyTransitionToExistingStructure):
3347         (JSC::Structure::addPropertyTransition):
3348         (JSC::Structure::hasTransition):
3349         * runtime/Structure.h:
3350         (JSC::Structure::transitionedFor):
3351         (JSC::Structure::hasTransition):
3352         (JSC::Structure::):
3353         (JSC::StructureTransitionTable::contains):
3354         (JSC::StructureTransitionTable::get):
3355         * runtime/StructureTransitionTable.h:
3356         (JSC::StructureTransitionTableHashTraits::emptyValue):
3357         (JSC::StructureTransitionTable::hasTransition):
3358         (JSC::StructureTransitionTable::remove):
3359         (JSC::StructureTransitionTable::add):
3360
3361 2009-08-20  Gavin Barraclough  <barraclough@apple.com>
3362
3363         Reviewed by Oliver Hunt.
3364
3365         Remove FunctionCodeBlock.
3366         https://bugs.webkit.org/show_bug.cgi?id=28502
3367
3368         These only exist to allow JIT code to dereference properties off the
3369         CodeBlock for any callee, regardless of whether it is a host function.
3370
3371         Instead just use the FunctionExecutable.  Copy the m_parameters field
3372         from the CodeBlock into the Executable, and use this to distinguish
3373         between host functions, functions that have been bytecompiled, and
3374         functions that have not.
3375
3376         m_parameters is moved to ExecutableBase rather than FunctionExecutable
3377         so that (as a separate change) we can move make a separate class of
3378         executable for host code, which is not devived from FunctionExecutable
3379         (host code does not feature any of the properties that normal executable
3380         do and will provide, such as source, attributes, and a parsed name).
3381
3382         1% win on v8 tests, 0.5% on sunspider.
3383
3384         * bytecode/CodeBlock.cpp:
3385         (JSC::CodeBlock::derefStructures):
3386         (JSC::CodeBlock::refStructures):
3387         (JSC::CodeBlock::reparseForExceptionInfoIfNecessary):
3388         (JSC::CodeBlock::handlerForBytecodeOffset):
3389         (JSC::CodeBlock::lineNumberForBytecodeOffset):
3390         (JSC::CodeBlock::expressionRangeForBytecodeOffset):
3391         (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset):
3392         (JSC::CodeBlock::functionRegisterForBytecodeOffset):
3393         (JSC::CodeBlock::hasGlobalResolveInstructionAtBytecodeOffset):
3394         (JSC::CodeBlock::hasGlobalResolveInfoAtBytecodeOffset):
3395         * bytecode/CodeBlock.h:
3396         (JSC::):
3397         (JSC::CodeBlock::source):
3398         (JSC::CodeBlock::sourceOffset):
3399         (JSC::CodeBlock::evalCodeCache):
3400         (JSC::CodeBlock::createRareDataIfNecessary):
3401         
3402             remove NativeCodeBlocks and the NativeCode code type.
3403         
3404         * jit/JIT.cpp:
3405         (JSC::JIT::linkCall):
3406
3407             Revert to previous behaviour (as currently still commented!) that Hhost functions have a null codeblock.
3408
3409         * jit/JITCall.cpp:
3410         (JSC::JIT::compileOpCallInitializeCallFrame):
3411         (JSC::JIT::compileOpCallSetupArgs):
3412         (JSC::JIT::compileOpCallVarargsSetupArgs):
3413         (JSC::JIT::compileOpConstructSetupArgs):
3414         (JSC::JIT::compileOpCallVarargs):
3415         (JSC::JIT::compileOpCall):
3416         (JSC::JIT::compileOpCallSlowCase):
3417
3418             Bring the 32_64 & non-32_64 JITs into line with each other, callee in regT0.
3419
3420         * jit/JITOpcodes.cpp:
3421         (JSC::JIT::privateCompileCTIMachineTrampolines):
3422
3423             Rewrite call trampolines to not use the CodeBlock.
3424
3425         * jit/JITStubs.cpp:
3426         (JSC::DEFINE_STUB_FUNCTION):
3427
3428             Make call_JSFunction & call_arityCheck return the callee, don't expect to be passed the CodeBlock.
3429
3430         * runtime/Executable.cpp:
3431         (JSC::FunctionExecutable::generateBytecode):
3432         (JSC::FunctionExecutable::recompile):
3433         (JSC::FunctionExecutable::FunctionExecutable):
3434         * runtime/Executable.h:
3435         (JSC::ExecutableBase::):
3436         (JSC::ExecutableBase::ExecutableBase):
3437         (JSC::FunctionExecutable::isHostFunction):
3438
3439             Add m_numParameters.
3440
3441         * runtime/JSFunction.cpp:
3442         (JSC::JSFunction::~JSFunction):
3443
3444             Only call generatedBytecode() on JSFunctions non-host FunctionExecutables.
3445
3446 2009-08-20  Yongjun Zhang  <yongjun.zhang@nokia.com>
3447
3448         Reviewed by Eric Seidel.
3449
3450         https://bugs.webkit.org/show_bug.cgi?id=28054
3451        
3452         Use a helper function to work around winscw compiler forward declaration bug
3453         regarding templated classes.
3454
3455         Add parenthesis around (PassRefPtr::*UnspecifiedBoolType) to make winscw compiler
3456         work with the default UnSpecifiedBoolType() operator, which removes the winscw
3457         specific bool cast hack.
3458
3459         * wtf/PassRefPtr.h:
3460         (WTF::derefIfNotNull):
3461         (WTF::PassRefPtr::~PassRefPtr):
3462
3463 2009-08-19  Yong Li  <yong.li@torchmobile.com>
3464
3465         Reviewed by Gavin Barraclough.
3466
3467         Change namespace ARM to ARMRegisters
3468         X86 to X86Registers to avoid conflict with macros
3469         https://bugs.webkit.org/show_bug.cgi?id=28428
3470
3471         * assembler/ARMAssembler.cpp:
3472         * assembler/ARMAssembler.h:
3473         * assembler/ARMv7Assembler.h:
3474         * assembler/MacroAssemblerARM.h:
3475         * assembler/MacroAssemblerARMv7.h:
3476         * assembler/MacroAssemblerX86Common.h:
3477         * assembler/MacroAssemblerX86_64.h:
3478         * assembler/X86Assembler.h:
3479         * jit/JIT.h:
3480         * jit/JITArithmetic.cpp:
3481         * jit/JITInlineMethods.h:
3482         * jit/JITOpcodes.cpp:
3483         * wrec/WRECGenerator.cpp:
3484         * wrec/WRECGenerator.h:
3485         * yarr/RegexJIT.cpp:
3486
3487 2009-08-19  Oliver Hunt  <oliver@apple.com>
3488
3489         Reviewed by Gavin Barraclough.
3490
3491         Devirtualise marking
3492         https://bugs.webkit.org/show_bug.cgi?id=28294
3493
3494         We actually need to mark the value in a number object if we're using the
3495         32bit number representation.
3496
3497         * runtime/NumberObject.h:
3498         (JSC::NumberObject::createStructure):
3499
3500 2009-08-19  Gavin Barraclough  <barraclough@apple.com>
3501
3502         Reviewed by Darin Adler.
3503
3504          We probably shouldn't be keeping the AST for eval nodes around forevar.
3505         https://bugs.webkit.org/show_bug.cgi?id=28469
3506
3507         EvalNodes don't destroyData() (delete their parser data) since they need to hold onto
3508         their varStack.  Copy a list of variable onto EvalCodeBlock, and this can go away.
3509
3510         * bytecode/CodeBlock.h:
3511         (JSC::EvalCodeBlock::variable):
3512         (JSC::EvalCodeBlock::numVariables):
3513         (JSC::EvalCodeBlock::adoptVariables):
3514         * bytecompiler/BytecodeGenerator.cpp:
3515         (JSC::BytecodeGenerator::BytecodeGenerator):
3516         * interpreter/Interpreter.cpp:
3517         (JSC::Interpreter::execute):
3518         * parser/Nodes.h:
3519         * runtime/Executable.cpp:
3520         (JSC::EvalExecutable::generateBytecode):
3521         * runtime/Executable.h:
3522
3523 2009-08-19  Jungshik Shin  <jshin@chromium.org>
3524
3525         Reviewed by Darin Adler.
3526
3527         http://bugs.webkit.org/show_bug.cgi?id=28441
3528
3529         Fix a build issue with ICU 4.2 or later on Windows with Visual C++. 
3530         Instead of defining all isXXX and toupper/tolower as 
3531           WTF_Please_use_ASCIICType_instead_of_ctype_see_comment_in_ASCIICType_h,
3532         #define them to be different by prepending 'WTF_...ASCIIType_h' with
3533         the originial names like 'toupper_WTF_...ASCIIType_h'. 
3534
3535         * wtf/DisallowCType.h:
3536
3537 2009-08-18  Oliver Hunt  <oliver@apple.com>
3538
3539         Reviewed by Gavin Barraclough.
3540
3541         Assigning a function to an object should always use the existing transition, even if the transition is not specialized
3542         https://bugs.webkit.org/show_bug.cgi?id=28442
3543
3544         Check for an unspecialized transition as an alternative to always failing if specialisation does not match.
3545
3546         * runtime/Structure.cpp:
3547         (JSC::Structure::addPropertyTransitionToExistingStructure):
3548
3549 2009-08-18  Dirk Schulze  <krit@webkit.org>
3550
3551         Reviewed by Oliver Hunt.
3552
3553         Added additional getter to ByteArray with an unsigned char as return.
3554         ByteArray can take unsigned char directly now.
3555
3556         * wtf/ByteArray.h:
3557         (WTF::ByteArray::set):
3558         (WTF::ByteArray::get):
3559
3560 2009-08-18  Peter Kasting  <pkasting@google.com>
3561
3562         Reviewed by Eric Seidel.
3563
3564         https://bugs.webkit.org/show_bug.cgi?id=28415
3565         Set svn:eol-style CRLF on all .sln and .vcproj files that don't already
3566         have it.
3567
3568         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj:
3569         * JavaScriptCore.vcproj/testapi/testapi.vcproj:
3570         
3571 2009-08-18  Xan Lopez  <xlopez@igalia.com>
3572
3573         Try to fix the GTK+ build.
3574
3575         * GNUmakefile.am:
3576
3577 2009-08-17  Gavin Barraclough  <barraclough@apple.com>
3578
3579         Reviewed by Sam Weinig.
3580
3581         No, silly runtime, AST nodes are not for you.
3582
3583         We still use AST nodes (ScopeNodes, particularly FunctionBodyNodes) within
3584         the runtime, which means that these nodes must be persisted outside of the
3585         arena, contain both parser & runtime data, etc.  This is all a bit of a mess.
3586
3587         Move functionality into a new FunctionExecutable class.
3588
3589         * API/JSCallbackFunction.cpp:
3590         * API/JSObjectRef.cpp:
3591         * JavaScriptCore.exp:
3592         * JavaScriptCore.xcodeproj/project.pbxproj:
3593         * bytecode/CodeBlock.cpp:
3594         (JSC::CodeBlock::CodeBlock):
3595         (JSC::CodeBlock::markAggregate):
3596         (JSC::CodeBlock::reparseForExceptionInfoIfNecessary):
3597         (JSC::CodeBlock::lineNumberForBytecodeOffset):
3598         (JSC::CodeBlock::shrinkToFit):
3599         * bytecode/CodeBlock.h:
3600         (JSC::CodeBlock::getBytecodeIndex):
3601         (JSC::CodeBlock::discardBytecode):
3602         (JSC::CodeBlock::instructionCount):
3603         (JSC::CodeBlock::getJITCode):
3604         (JSC::CodeBlock::executablePool):
3605         (JSC::CodeBlock::ownerExecutable):
3606         (JSC::CodeBlock::extractExceptionInfo):
3607         (JSC::CodeBlock::addFunctionDecl):
3608         (JSC::CodeBlock::functionDecl):
3609         (JSC::CodeBlock::numberOfFunctionDecls):
3610         (JSC::CodeBlock::addFunctionExpr):
3611         (JSC::CodeBlock::functionExpr):
3612         (JSC::GlobalCodeBlock::GlobalCodeBlock):
3613         (JSC::ProgramCodeBlock::ProgramCodeBlock):
3614         (JSC::EvalCodeBlock::EvalCodeBlock):
3615         (JSC::FunctionCodeBlock::FunctionCodeBlock):
3616         (JSC::NativeCodeBlock::NativeCodeBlock):
3617         * bytecode/EvalCodeCache.h:
3618         * bytecode/SamplingTool.cpp:
3619         (JSC::SamplingTool::doRun):
3620         * bytecompiler/BytecodeGenerator.cpp:
3621         (JSC::BytecodeGenerator::BytecodeGenerator):
3622         (JSC::BytecodeGenerator::emitNewFunction):
3623         (JSC::BytecodeGenerator::emitNewFunctionExpression):
3624         * bytecompiler/BytecodeGenerator.h:
3625         * debugger/Debugger.cpp:
3626         (JSC::Debugger::recompileAllJSFunctions):
3627         * interpreter/CachedCall.h:
3628         (JSC::CachedCall::CachedCall):
3629         * interpreter/CallFrameClosure.h:
3630         * interpreter/Interpreter.cpp:
3631         (JSC::Interpreter::unwindCallFrame):
3632         (JSC::Interpreter::throwException):
3633         (JSC::Interpreter::execute):
3634         (JSC::Interpreter::prepareForRepeatCall):
3635         (JSC::Interpreter::debug):
3636         (JSC::Interpreter::privateExecute):
3637         (JSC::Interpreter::retrieveLastCaller):
3638         * interpreter/Interpreter.h:
3639         * jit/JIT.cpp:
3640         (JSC::JIT::privateCompile):
3641         * jit/JIT.h:
3642         (JSC::JIT::compile):
3643         * jit/JITOpcodes.cpp:
3644         (JSC::JIT::privateCompileCTIMachineTrampolines):
3645         (JSC::JIT::emit_op_new_func):
3646         (JSC::JIT::emit_op_new_func_exp):
3647         * jit/JITStubs.cpp:
3648         (JSC::DEFINE_STUB_FUNCTION):
3649         * jit/JITStubs.h:
3650         (JSC::):
3651         * parser/Nodes.cpp:
3652         (JSC::FunctionBodyNode::reparseDataIfNecessary):
3653         * parser/Nodes.h:
3654         (JSC::EvalNode::partialDestroyData):
3655         * parser/Parser.h:
3656         * profiler/ProfileGenerator.cpp:
3657         * profiler/Profiler.cpp:
3658         (JSC::Profiler::createCallIdentifier):
3659         (JSC::createCallIdentifierFromFunctionImp):
3660         * runtime/Arguments.h:
3661         (JSC::Arguments::getArgumentsData):
3662         (JSC::Arguments::Arguments):
3663         (JSC::JSActivation::copyRegisters):
3664         * runtime/ArrayPrototype.cpp:
3665         (JSC::isNumericCompareFunction):
3666         * runtime/CallData.h:
3667         (JSC::):
3668         * runtime/Collector.cpp:
3669         (JSC::Heap::collect):
3670         * runtime/ConstructData.h:
3671         (JSC::):
3672         * runtime/ExceptionHelpers.cpp:
3673         (JSC::createUndefinedVariableError):
3674         (JSC::createInvalidParamError):
3675         (JSC::createNotAConstructorError):
3676         (JSC::createNotAFunctionError):
3677         (JSC::createNotAnObjectError):
3678         * runtime/Executable.cpp: Added.
3679         (JSC::EvalExecutable::generateBytecode):
3680         (JSC::ProgramExecutable::generateBytecode):
3681         (JSC::FunctionExecutable::generateBytecode):
3682         (JSC::EvalExecutable::generateJITCode):
3683         (JSC::ProgramExecutable::generateJITCode):
3684         (JSC::FunctionExecutable::generateJITCode):
3685         (JSC::FunctionExecutable::isHostFunction):
3686         (JSC::FunctionExecutable::markAggregate):
3687         (JSC::FunctionExecutable::reparseExceptionInfo):
3688         (JSC::EvalExecutable::reparseExceptionInfo):
3689         (JSC::FunctionExecutable::recompile):
3690         (JSC::FunctionExecutable::FunctionExecutable):
3691         * runtime/Executable.h:
3692         (JSC::ExecutableBase::~ExecutableBase):
3693         (JSC::ExecutableBase::ExecutableBase):
3694         (JSC::ExecutableBase::source):
3695         (JSC::ExecutableBase::sourceID):
3696         (JSC::ExecutableBase::lastLine):
3697         (JSC::ExecutableBase::usesEval):
3698         (JSC::ExecutableBase::usesArguments):
3699         (JSC::ExecutableBase::needsActivation):
3700         (JSC::ExecutableBase::astNode):
3701         (JSC::ExecutableBase::generatedJITCode):
3702         (JSC::ExecutableBase::getExecutablePool):
3703         (JSC::EvalExecutable::EvalExecutable):
3704         (JSC::EvalExecutable::bytecode):
3705         (JSC::EvalExecutable::varStack):
3706         (JSC::EvalExecutable::evalNode):
3707         (JSC::EvalExecutable::jitCode):
3708         (JSC::ProgramExecutable::ProgramExecutable):
3709         (JSC::ProgramExecutable::reparseExceptionInfo):
3710         (JSC::ProgramExecutable::bytecode):
3711         (JSC::ProgramExecutable::programNode):
3712         (JSC::ProgramExecutable::jitCode):
3713         (JSC::FunctionExecutable::FunctionExecutable):
3714         (JSC::FunctionExecutable::name):
3715         (JSC::FunctionExecutable::bytecode):
3716         (JSC::FunctionExecutable::generatedBytecode):
3717         (JSC::FunctionExecutable::usesEval):
3718         (JSC::FunctionExecutable::usesArguments):
3719         (JSC::FunctionExecutable::parameterCount):
3720         (JSC::FunctionExecutable::paramString):
3721         (JSC::FunctionExecutable::isGenerated):
3722         (JSC::FunctionExecutable::body):
3723         (JSC::FunctionExecutable::jitCode):
3724         (JSC::FunctionExecutable::createNativeThunk):
3725         * runtime/FunctionConstructor.cpp:
3726         (JSC::constructFunction):
3727         * runtime/FunctionPrototype.cpp:
3728         (JSC::functionProtoFuncToString):
3729         * runtime/JSActivation.cpp:
3730         (JSC::JSActivation::JSActivation):
3731         (JSC::JSActivation::markChildren):
3732         (JSC::JSActivation::isDynamicScope):
3733         (JSC::JSActivation::argumentsGetter):
3734         * runtime/JSActivation.h:
3735         (JSC::JSActivation::JSActivationData::JSActivationData):
3736         * runtime/JSFunction.cpp:
3737         (JSC::JSFunction::isHostFunction):
3738         (JSC::JSFunction::JSFunction):
3739         (JSC::JSFunction::~JSFunction):
3740         (JSC::JSFunction::markChildren):
3741         (JSC::JSFunction::getCallData):
3742         (JSC::JSFunction::call):
3743         (JSC::JSFunction::lengthGetter):
3744         (JSC::JSFunction::getConstructData):
3745         (JSC::JSFunction::construct):
3746         * runtime/JSFunction.h:
3747         (JSC::JSFunction::executable):
3748         (JSC::FunctionExecutable::make):
3749         * runtime/JSGlobalData.cpp:
3750         (JSC::JSGlobalData::JSGlobalData):
3751         (JSC::JSGlobalData::numericCompareFunction):
3752         * runtime/JSGlobalData.h:
3753
3754 2009-08-17  Mark Rowe  <mrowe@apple.com>
3755
3756         Reviewed by Darin Adler.
3757
3758         Fix 300,000+ leaks seen during the regression tests.
3759
3760         EvalCodeCache::get was heap-allocating an EvalExecutable instance without adopting the initial reference.
3761         While fixing this we noticed that EvalExecutable was a RefCounted type that was sometimes stack allocated.
3762         To make this cleaner and to prevent clients from attempting to ref a stack-allocated instance, we move the
3763         refcounting down to a new CacheableEvalExecutable class that derives from EvalExecutable. EvalCodeCache::get
3764         now uses CacheableEvalExecutable::create and avoids the leak.
3765
3766         * bytecode/EvalCodeCache.h:
3767         (JSC::EvalCodeCache::get):
3768         * interpreter/Interpreter.cpp:
3769         (JSC::Interpreter::callEval):
3770         * runtime/Executable.h:
3771         (JSC::CacheableEvalExecutable::create):
3772         (JSC::CacheableEvalExecutable::CacheableEvalExecutable):
3773
3774 2009-08-17  Oliver Hunt  <oliver@apple.com>
3775
3776         RS=Mark Rowe.
3777
3778         REGRESSION (r47292): Prototype.js is broken by ES5 Arguments changes
3779         https://bugs.webkit.org/show_bug.cgi?id=28341
3780         <rdar://problem/7145615>
3781
3782         Reverting r47292.  Alas Prototype.js breaks with Arguments inheriting
3783         from Array as ES5 attempted.  Prototype.js defines $A in terms of a 
3784         function it places on (among other global objects) the Array prototype,
3785         thus breaking $A for arrays.
3786
3787         * runtime/Arguments.h:
3788         (JSC::Arguments::Arguments):
3789         * runtime/JSGlobalObject.cpp:
3790         (JSC::JSGlobalObject::reset):
3791         (JSC::JSGlobalObject::markChildren):
3792         * runtime/JSGlobalObject.h:
3793         (JSC::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData):
3794         * runtime/ObjectPrototype.cpp:
3795         (JSC::ObjectPrototype::ObjectPrototype):
3796         * runtime/ObjectPrototype.h:
3797         * tests/mozilla/ecma_3/Function/arguments-001.js:
3798
3799 2009-08-17  Peter Kasting  <pkasting@google.com>
3800
3801         Reviewed by Steve Falkenburg.
3802
3803         https://bugs.webkit.org/show_bug.cgi?id=27323
3804         Only add Cygwin to the path when it isn't already there.  This avoids
3805         causing problems for people who purposefully have non-Cygwin versions of
3806         executables like svn in front of the Cygwin ones in their paths.
3807
3808         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
3809         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj:
3810         * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops:
3811         * JavaScriptCore.vcproj/jsc/jscCommon.vsprops:
3812         * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops:
3813
3814 2009-08-17  Xan Lopez  <xlopez@igalia.com>
3815
3816         Reviewed by Mark Rowe.
3817
3818         Fix build with FAST_MALLOC_MATCH_VALIDATION enabled.
3819
3820         * wtf/FastMalloc.cpp:
3821         (WTF::fastMalloc):
3822         (WTF::fastCalloc):
3823         (WTF::fastRealloc):
3824
3825 2009-08-16  Holger Hans Peter Freyther  <zecke@selfish.org>
3826
3827         Reviewed by Mark Rowe.
3828
3829         Fix crash on ./ecma_2/RegExp/exec-002.js.
3830         https://bugs.webkit.org/show_bug.cgi?id=28353
3831
3832         Change the order of freeParenthesesDisjunctionContext and
3833         popParenthesesDisjunctionContext on all call sites as the pop
3834         method is accessing backTrack->lastContext which is the context
3835         that is about to be freed.
3836
3837         * yarr/RegexInterpreter.cpp:
3838         (JSC::Yarr::Interpreter::parenthesesDoBacktrack):
3839         (JSC::Yarr::Interpreter::backtrackParentheses):
3840
3841 2009-08-16  Holger Hans Peter Freyther  <zecke@selfish.org>
3842
3843         Reviewed by Mark Rowe.
3844
3845         https://bugs.webkit.org/show_bug.cgi?id=28352
3846
3847         Fix coding style violations. Use m_ for C++ class members. Remove
3848         trailing whitespace on empty lines.
3849
3850         * yarr/RegexInterpreter.cpp:
3851         (JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::ParenthesesDisjunctionContext):
3852         (JSC::Yarr::Interpreter::tryConsumeCharacter):
3853         (JSC::Yarr::Interpreter::tryConsumeBackReference):
3854         (JSC::Yarr::Interpreter::parenthesesDoBacktrack):
3855         (JSC::Yarr::Interpreter::backtrackParentheses):
3856         (JSC::Yarr::ByteCompiler::ByteCompiler):
3857         (JSC::Yarr::ByteCompiler::compile):
3858         (JSC::Yarr::ByteCompiler::checkInput):
3859         (JSC::Yarr::ByteCompiler::assertionBOL):
3860         (JSC::Yarr::ByteCompiler::assertionEOL):
3861         (JSC::Yarr::ByteCompiler::assertionWordBoundary):
3862         (JSC::Yarr::ByteCompiler::atomPatternCharacter):
3863         (JSC::Yarr::ByteCompiler::atomCharacterClass):
3864         (JSC::Yarr::ByteCompiler::atomBackReference):
3865         (JSC::Yarr::ByteCompiler::atomParenthesesSubpatternBegin):
3866         (JSC::Yarr::ByteCompiler::atomParentheticalAssertionBegin):
3867         (JSC::Yarr::ByteCompiler::popParenthesesStack):
3868         (JSC::Yarr::ByteCompiler::closeAlternative):
3869         (JSC::Yarr::ByteCompiler::closeBodyAlternative):
3870         (JSC::Yarr::ByteCompiler::atomParenthesesEnd):
3871         (JSC::Yarr::ByteCompiler::regexBegin):
3872         (JSC::Yarr::ByteCompiler::alterantiveBodyDisjunction):
3873         (JSC::Yarr::ByteCompiler::alterantiveDisjunction):
3874         (JSC::Yarr::ByteCompiler::emitDisjunction):
3875
3876 2009-08-15  Mark Rowe  <mrowe@apple.com>
3877
3878         Fix the build with JIT disabled.
3879
3880         * runtime/Arguments.h: Only compile the jitCode method when the JIT is enabled.
3881         * runtime/Executable.h: Include PrototypeFunction.h so the compiler knows what
3882         NativeFunctionWrapper is when the JIT is disabled.
3883
3884 2009-08-15  Adam Bergkvist  <adam.bergkvist@ericsson.com>
3885
3886         Reviewed by Sam Weinig.
3887
3888         Added ENABLE_EVENTSOURCE flag.
3889         https://bugs.webkit.org/show_bug.cgi?id=14997
3890
3891         * Configurations/FeatureDefines.xcconfig:
3892
3893 2009-08-14  Gavin Barraclough  <barraclough@apple.com>
3894
3895         * parser/Parser.h:
3896         (JSC::EvalExecutable::parse):
3897         (JSC::ProgramExecutable::parse):
3898         * runtime/Executable.h:
3899
3900 2009-08-14  Gavin Barraclough  <barraclough@apple.com>
3901
3902         Reviewed by Oliver Hunt.
3903
3904         Remove AST nodes from use within the Runtime (outside of parsing), stage 1
3905         https://bugs.webkit.org/show_bug.cgi?id=28330
3906
3907         Remove the EvalNode and ProgramNode from use in the runtime.  They still exist
3908         after this patch, but are hidden behind EvalExecutable and FunctionExecutable,
3909         and are also still reachable behind CodeBlock::m_ownerNode.
3910
3911         The next step will be to beat back FunctionBodyNode in the same fashion.
3912         Then remove the usage via CodeBlock, then only construct these nodes only on
3913         demand during bytecode generation.
3914
3915         * JavaScriptCore.xcodeproj/project.pbxproj:
3916         * bytecode/CodeBlock.h:
3917         (JSC::GlobalCodeBlock::GlobalCodeBlock):
3918         (JSC::GlobalCodeBlock::~GlobalCodeBlock):
3919         (JSC::ProgramCodeBlock::ProgramCodeBlock):
3920         (JSC::EvalCodeBlock::EvalCodeBlock):
3921         (JSC::FunctionCodeBlock::FunctionCodeBlock):
3922         (JSC::NativeCodeBlock::NativeCodeBlock):
3923         * bytecode/EvalCodeCache.h:
3924         (JSC::EvalCodeCache::get):
3925         * debugger/Debugger.cpp:
3926         (JSC::evaluateInGlobalCallFrame):
3927         * debugger/DebuggerCallFrame.cpp:
3928         (JSC::DebuggerCallFrame::evaluate):
3929         * interpreter/Interpreter.cpp:
3930         (JSC::Interpreter::callEval):
3931         (JSC::Interpreter::execute):
3932         * interpreter/Interpreter.h:
3933         * parser/Nodes.cpp:
3934         (JSC::FunctionBodyNode::createNativeThunk):
3935         (JSC::FunctionBodyNode::generateBytecode):
3936         (JSC::FunctionBodyNode::bytecodeForExceptionInfoReparse):
3937         * parser/Parser.h:
3938         (JSC::Parser::parse):
3939         (JSC::Parser::reparse):
3940         (JSC::Parser::parseFunctionFromGlobalCode):
3941         (JSC::::parse):
3942         * runtime/Completion.cpp:
3943         (JSC::checkSyntax):
3944         (JSC::evaluate):
3945         * runtime/Error.cpp:
3946         (JSC::throwError):
3947         * runtime/Error.h:
3948         * runtime/Executable.h: Added.
3949         (JSC::TemplateExecutable::TemplateExecutable):
3950         (JSC::TemplateExecutable::markAggregate):
3951         (JSC::TemplateExecutable::sourceURL):
3952         (JSC::TemplateExecutable::lineNo):
3953         (JSC::TemplateExecutable::bytecode):
3954         (JSC::TemplateExecutable::jitCode):
3955         (JSC::EvalExecutable::EvalExecutable):
3956         (JSC::ProgramExecutable::ProgramExecutable):
3957         * runtime/FunctionConstructor.cpp:
3958         (JSC::constructFunction):
3959         * runtime/FunctionConstructor.h:
3960         * runtime/JSGlobalData.cpp:
3961         (JSC::JSGlobalData::numericCompareFunction):
3962         * runtime/JSGlobalObject.cpp:
3963         (JSC::JSGlobalObject::~JSGlobalObject):
3964         (JSC::JSGlobalObject::markChildren):
3965         * runtime/JSGlobalObject.h:
3966         (JSC::JSGlobalObject::codeBlocks):
3967         * runtime/JSGlobalObjectFunctions.cpp:
3968         (JSC::globalFuncEval):
3969
3970 2009-08-14  Darin Adler  <darin@apple.com>
3971
3972         Reviewed by Sam Weinig.
3973
3974         Rename the confusing isObject(<class>) to inherits(<class>).
3975         It still works on non-objects, returning false.
3976
3977         * runtime/ArrayConstructor.cpp:
3978         (JSC::arrayConstructorIsArray): Removed unneeded isObject call
3979         and updated remaining isObject call to new name, inherits.
3980
3981         * runtime/JSCell.h: Renamed isObject(<class>) to inherits(<class>)
3982         but more importantly, made it non-virtual (it was already inline)
3983         so it is now as fast as JSObject::inherits was.
3984
3985         * runtime/JSObject.h: Removed inherits function since the one
3986         in the base class is fine as-is. Also made various JSCell functions
3987         that should not be called on JSObject uncallable by making them
3988         both private and not implemented.
3989         (JSC::JSCell::inherits): Updated name.
3990         (JSC::JSValue::inherits): Ditto.
3991
3992         * debugger/Debugger.cpp:
3993         (JSC::Debugger::recompileAllJSFunctions):
3994         * interpreter/Interpreter.cpp:
3995         (JSC::Interpreter::unwindCallFrame):
3996         * runtime/ArrayPrototype.cpp:
3997         (JSC::arrayProtoFuncToString):
3998         (JSC::arrayProtoFuncToLocaleString):
3999         (JSC::arrayProtoFuncConcat):
4000         * runtime/BooleanPrototype.cpp:
4001         (JSC::booleanProtoFuncToString):
4002         (JSC::booleanProtoFuncValueOf):
4003         * runtime/DateConstructor.cpp:
4004         (JSC::constructDate):
4005         * runtime/DatePrototype.cpp:
4006         (JSC::dateProtoFuncToString):
4007         (JSC::dateProtoFuncToUTCString):
4008         (JSC::dateProtoFuncToISOString):
4009         (JSC::dateProtoFuncToDateString):
4010         (JSC::dateProtoFuncToTimeString):
4011         (JSC::dateProtoFuncToLocaleString):
4012         (JSC::dateProtoFuncToLocaleDateString):
4013         (JSC::dateProtoFuncToLocaleTimeString):
4014         (JSC::dateProtoFuncGetTime):
4015         (JSC::dateProtoFuncGetFullYear):
4016         (JSC::dateProtoFuncGetUTCFullYear):
4017         (JSC::dateProtoFuncToGMTString):
4018         (JSC::dateProtoFuncGetMonth):
4019         (JSC::dateProtoFuncGetUTCMonth):
4020         (JSC::dateProtoFuncGetDate):
4021         (JSC::dateProtoFuncGetUTCDate):
4022         (JSC::dateProtoFuncGetDay):
4023         (JSC::dateProtoFuncGetUTCDay):
4024         (JSC::dateProtoFuncGetHours):
4025         (JSC::dateProtoFuncGetUTCHours):
4026         (JSC::dateProtoFuncGetMinutes):
4027         (JSC::dateProtoFuncGetUTCMinutes):
4028         (JSC::dateProtoFuncGetSeconds):
4029         (JSC::dateProtoFuncGetUTCSeconds):
4030         (JSC::dateProtoFuncGetMilliSeconds):
4031         (JSC::dateProtoFuncGetUTCMilliseconds):
4032         (JSC::dateProtoFuncGetTimezoneOffset):
4033         (JSC::dateProtoFuncSetTime):
4034         (JSC::setNewValueFromTimeArgs):
4035         (JSC::setNewValueFromDateArgs):
4036         (JSC::dateProtoFuncSetYear):
4037         (JSC::dateProtoFuncGetYear):
4038         * runtime/FunctionPrototype.cpp:
4039         (JSC::functionProtoFuncToString):
4040         * runtime/JSActivation.cpp:
4041         (JSC::JSActivation::argumentsGetter):
4042         * runtime/JSValue.h:
4043         * runtime/RegExpConstructor.cpp:
4044         (JSC::constructRegExp):
4045         * runtime/RegExpPrototype.cpp:
4046         (JSC::regExpProtoFuncTest):
4047         (JSC::regExpProtoFuncExec):
4048         (JSC::regExpProtoFuncCompile):
4049         (JSC::regExpProtoFuncToString):
4050         * runtime/ScopeChain.cpp:
4051         (JSC::ScopeChain::localDepth):
4052         * runtime/StringPrototype.cpp:
4053         (JSC::stringProtoFuncReplace):
4054         (JSC::stringProtoFuncToString):
4055         (JSC::stringProtoFuncMatch):
4056         (JSC::stringProtoFuncSearch):
4057         (JSC::stringProtoFuncSplit):
4058         Updated to new name, inherits, from old name, isObject.
4059
4060 2009-07-31  Harald Fernengel  <harald.fernengel@nokia.com>
4061
4062         Reviewed by Simon Hausmann.
4063
4064         Adding QNX as a platform. Currently only tested with Qt.
4065
4066         https://bugs.webkit.org/show_bug.cgi?id=27885
4067
4068         * JavaScriptCore/runtime/Collector.cpp: Added retrieving of stack base
4069           since QNX doesn't have the pthread _nt functions
4070         * JavaScriptCore/wtf/Platform.h: Added WTF_PLATFORM_QNX and corresponding
4071           defines
4072         * WebCore/bridge/npapi.h: Build fix for missing typedefs on QNX
4073
4074 2009-08-14  Gabor Loki  <loki@inf.u-szeged.hu>
4075
4076         Reviewed by Simon Hausmann.
4077
4078         Currently generic ARM and ARMv7 platforms work only with JSVALUE32
4079         https://bugs.webkit.org/show_bug.cgi?id=28300
4080
4081         * wtf/Platform.h:
4082
4083 2009-08-14  Gabor Loki  <loki@inf.u-szeged.hu>
4084
4085         Reviewed by Simon Hausmann.
4086
4087         Enable JIT on ARM for QT by default
4088         https://bugs.webkit.org/show_bug.cgi?id=28259
4089
4090         * wtf/Platform.h:
4091
4092 2009-08-14  Gabor Loki  <loki@inf.u-szeged.hu>
4093
4094         Reviewed by Simon Hausmann.
4095
4096         Enable YARR_JIT on ARM for QT by default
4097         https://bugs.webkit.org/show_bug.cgi?id=28259
4098
4099         * wtf/Platform.h:
4100
4101 2009-08-14  Oliver Hunt  <oliver@apple.com>
4102
4103         Reviewed by Gavin Barraclough.
4104
4105         [ES5] Arguments object should inherit from Array
4106         https://bugs.webkit.org/show_bug.cgi?id=28298
4107
4108         Make the Arguments object conform to the behaviour specified in ES5.
4109         The simple portion of this is to make Arguments use Array.prototype
4110         as its prototype rather than Object.prototype.
4111
4112         The spec then requires us to set instance.constructor to the pristine
4113         Object constructor, and instance.toString and instance.toLocaleString
4114         to the pristine versions from Object.prototype.  To do this we now 
4115         make the ObjectPrototype constructor return its toString and
4116         toLocaleString functions (similar to the call and apply functions
4117         from FunctionPrototype).
4118
4119         Oddly enough this reports itself as a slight win, but given the code
4120         isn't hit in the tests that claim to have improved I put this down to
4121         code motion.
4122
4123         * runtime/Arguments.h:
4124         (JSC::Arguments::Arguments):
4125         (JSC::Arguments::initializeStandardProperties):
4126         * runtime/JSGlobalObject.cpp:
4127         (JSC::JSGlobalObject::reset):
4128         (JSC::JSGlobalObject::markChildren):
4129         * runtime/JSGlobalObject.h:
4130         (JSC::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData):
4131         (JSC::JSGlobalObject::objectConstructor):
4132         (JSC::JSGlobalObject::objectToStringFunction):
4133         (JSC::JSGlobalObject::objectToLocaleStringFunction):
4134         * runtime/ObjectPrototype.cpp:
4135         (JSC::ObjectPrototype::ObjectPrototype):
4136         * runtime/ObjectPrototype.h:
4137         * tests/mozilla/ecma_3/Function/arguments-001.js:
4138           Update test to new es5 behaviour
4139
4140 2009-08-14  Oliver Hunt  <oliver@apple.com>
4141
4142         Remove MarkStack::drain from the JSC exports file
4143
4144         MarkStack::drain is now marked inline, the including it in the exports file
4145         produces an ld warning
4146
4147         * JavaScriptCore.exp:
4148
4149 2009-08-13  Sam Weinig  <sam@webkit.org>
4150
4151         Reviewed by Oliver Hunt.
4152
4153         Remove accidentally left in debugging statement.
4154
4155         * runtime/JSArray.h:
4156         (JSC::MarkStack::drain):
4157
4158 2009-08-13  Oliver Hunt  <oliver@apple.com>
4159
4160         Reviewed by Maciej Stachowiak.
4161
4162         [ES5] Implement Array.isArray
4163         https://bugs.webkit.org/show_bug.cgi?id=28296
4164
4165         Add support for Array.isArray to the Array constructor
4166
4167         * runtime/ArrayConstructor.cpp:
4168         (JSC::ArrayConstructor::ArrayConstructor):
4169         (JSC::arrayConstructorIsArray):
4170         * runtime/ArrayConstructor.h:
4171         * runtime/CommonIdentifiers.h:
4172         * runtime/JSArray.h:
4173         (JSC::MarkStack::drain):
4174         * runtime/JSGlobalObject.cpp:
4175         (JSC::JSGlobalObject::reset):
4176
4177 2009-08-13  Oliver Hunt  <oliver@apple.com>
4178
4179         Reviewed by NOBODY (Buildfix).
4180
4181         Attempt to fix windows build
4182
4183         * runtime/Collector.cpp:
4184
4185 2009-08-13  Oliver Hunt  <oliver@apple.com>
4186
4187         Reviewed by Maciej Stachowiak.
4188
4189         Devirtualise marking
4190         https://bugs.webkit.org/show_bug.cgi?id=28294
4191
4192         Add a bit to TypeInfo to indicate that an object uses the standard
4193         JSObject::markChildren method.  This allows us to devirtualise marking
4194         of most objects (though a branch is still needed).  We also add a branch