393a25e2894ce07ee38815a98ae64b2360206f8c
[WebKit-https.git] / JavaScriptCore / ChangeLog
1 2009-03-13  Norbert Leser  <norbert.leser@nokia.com>
2
3         Reviewed by Darin Adler.
4
5         Resolved name conflict with globally defined tzname in Symbian.
6         Replaced with different name instead of using namespace qualifier
7         (appeared to be less clumsy).
8
9         * runtime/DateMath.cpp:
10
11 2009-03-12  Mark Rowe  <mrowe@apple.com>
12
13         Reviewed by Darin Adler.
14
15         <rdar://problem/6548446> TCMalloc_SystemRelease should use madvise rather than re-mmaping span of pages
16
17         * wtf/FastMalloc.cpp:
18         (WTF::mergeDecommittedStates): If either of the spans has been released to the system, release the other
19         span as well so that the flag in the merged span is accurate.
20         * wtf/Platform.h:
21         * wtf/TCSystemAlloc.cpp: Track decommitted spans when using MADV_FREE_REUSABLE / MADV_FREE_REUSE.
22         (TCMalloc_SystemRelease): Use madvise with MADV_FREE_REUSABLE when it is available.
23         (TCMalloc_SystemCommit): Use madvise with MADV_FREE_REUSE when it is available.
24         * wtf/TCSystemAlloc.h:
25
26 2009-03-12  Adam Treat  <adam.treat@torchmobile.com>
27
28         Reviewed by NOBODY (Build fix).
29
30         Include string.h for strlen usage.
31
32         * wtf/Threading.cpp:
33
34 2009-03-12  David Kilzer  <ddkilzer@apple.com>
35
36         Add NO_RETURN attribute to runInteractive() when not using readline
37
38         Reviewed by Darin Adler.
39
40         * jsc.cpp:
41         (runInteractive): If the readline library is not used, this method
42         will never return, thus the NO_RETURN attribute is needed to prevent
43         a gcc warning.
44
45 2009-03-12  Adam Roben  <aroben@apple.com>
46
47         Adopt setThreadNameInternal on Windows
48
49         Also changed a Windows-only assertion about thread name length to an
50         all-platform log message.
51
52         Reviewed by Adam Treat.
53
54         * wtf/Threading.cpp:
55         (WTF::createThread): Warn if the thread name is longer than 31
56         characters, as Visual Studio will truncate names longer than that
57         length.
58
59         * wtf/ThreadingWin.cpp:
60         (WTF::setThreadNameInternal): Renamed from setThreadName and changed
61         to always operate on the current thread.
62         (WTF::initializeThreading): Changed to use setThreadNameInternal.
63         (WTF::createThreadInternal): Removed call to setThreadName. This is
64         now handled by threadEntryPoint and setThreadNameInternal.
65
66 2009-03-11  David Kilzer  <ddkilzer@apple.com>
67
68         Clarify comments regarding order of FEATURE_DEFINES
69
70         Rubber-stamped by Mark Rowe.
71
72         * Configurations/JavaScriptCore.xcconfig: Added warning about
73         the consequences when FEATURE_DEFINES are not kept in sync.
74
75 2009-03-11  Dan Bernstein  <mitz@apple.com>
76
77         Reviewed by Darin Adler.
78
79         - WTF support for fixing <rdar://problem/3919124> Thai text selection
80           in Safari is incorrect
81
82         * wtf/unicode/icu/UnicodeIcu.h:
83         (WTF::Unicode::hasLineBreakingPropertyComplexContext): Added. Returns
84         whether the character has Unicode line breaking property value SA
85         ("Complex Context").
86         * wtf/unicode/qt4/UnicodeQt4.h:
87         (WTF::Unicode::hasLineBreakingPropertyComplexContext): Added an
88         implementation that always returns false.
89
90 2009-03-11  Darin Adler  <darin@apple.com>
91
92         Reviewed by Mark Rowe.
93
94         Give threads names on platforms with pthread_setname_np.
95
96         * wtf/Threading.cpp:
97         (WTF::NewThreadContext::NewThreadContext): Initialize thread name.
98         (WTF::threadEntryPoint): Call setThreadNameInternal.
99         (WTF::createThread): Pass thread name.
100
101         * wtf/Threading.h: Added new comments, setThreadNameInternal.
102
103         * wtf/ThreadingGtk.cpp:
104         (WTF::setThreadNameInternal): Added. Empty.
105         * wtf/ThreadingNone.cpp:
106         (WTF::setThreadNameInternal): Added. Empty.
107         * wtf/ThreadingPthreads.cpp:
108         (WTF::setThreadNameInternal): Call pthread_setname_np when available.
109         * wtf/ThreadingQt.cpp:
110         (WTF::setThreadNameInternal): Added. Empty.
111         * wtf/ThreadingWin.cpp:
112         (WTF::setThreadNameInternal): Added. Empty.
113
114 2009-03-11  Adam Roben  <aroben@apple.com>
115
116         Change the Windows implementation of ThreadSpecific to use functions
117         instead of extern globals
118
119         This will make it easier to export ThreadSpecific from WebKit.
120
121         Reviewed by John Sullivan.
122
123         * API/JSBase.cpp:
124         (JSEvaluateScript): 
125         Touched this file to force ThreadSpecific.h to be copied into
126         $WebKitOutputDir.
127
128         * wtf/ThreadSpecific.h: Replaced g_tls_key_count with tlsKeyCount()
129         and g_tls_keys with tlsKeys().
130
131         (WTF::::ThreadSpecific):
132         (WTF::::~ThreadSpecific):
133         (WTF::::get):
134         (WTF::::set):
135         (WTF::::destroy):
136         Updated to use the new functions.
137
138         * wtf/ThreadSpecificWin.cpp:
139         (WTF::tlsKeyCount):
140         (WTF::tlsKeys):
141         Added.
142
143         (WTF::ThreadSpecificThreadExit): Changed to use the new functions.
144
145 2009-03-10  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
146
147         Reviewed by Geoff Garen.
148
149         Bug 24291: REGRESSION (r38635): Single line JavaScript comment prevents HTML button click handler execution
150         <https://bugs.webkit.org/show_bug.cgi?id=24291>
151         <rdar://problem/6663472>
152
153         Add an extra newline to the end of the body of the program text constructed
154         by the Function constructor for parsing. This allows single line comments to
155         be handled correctly by the parser.
156
157         * runtime/FunctionConstructor.cpp:
158         (JSC::constructFunction):
159
160 2009-03-09  Oliver Hunt  <oliver@apple.com>
161
162         Reviewed by Gavin Barraclough.
163
164         Bug 24447: REGRESSION (r41508): Google Maps does not complete initialization
165         <rdar://problem/6657774>
166
167         r41508 actually exposed a pre-existing bug where we were not invalidating the result
168         register cache at jump targets.  This causes problems when condition loads occur in an
169         expression -- namely through the ?: and || operators.  This patch corrects these issues
170         by marking the target of all forward jumps as being a jump target, and then clears the
171         result register cache when ever it starts generating code for a targeted instruction.
172
173         I do not believe it is possible to cause this class of failure outside of a single
174         expression, and expressions only provide forward branches, so this should resolve this
175         entire class of bug.  That said i've included a test case that gets as close as possible
176         to hitting this bug with a back branch, to hopefully prevent anyone from introducing the
177         problem in future.
178
179         * assembler/AbstractMacroAssembler.h:
180         (JSC::AbstractMacroAssembler::Label::isUsed):
181         (JSC::AbstractMacroAssembler::Label::used):
182         * assembler/X86Assembler.h:
183         (JSC::X86Assembler::JmpDst::JmpDst):
184         (JSC::X86Assembler::JmpDst::isUsed):
185         (JSC::X86Assembler::JmpDst::used):
186         * jit/JIT.cpp:
187         (JSC::JIT::privateCompileMainPass):
188
189 2009-03-09  David Levin  <levin@chromium.org>
190
191         Reviewed by Darin Adler.
192
193         Bug 23175: String and UString should be able to share a UChar* buffer.
194         <https://bugs.webkit.org/show_bug.cgi?id=23175>
195
196         Add CrossThreadRefCounted.
197
198         * wtf/CrossThreadRefCounted.h: Added.
199         (WTF::CrossThreadRefCounted::create):
200         (WTF::CrossThreadRefCounted::isShared):
201         (WTF::CrossThreadRefCounted::dataAccessMustBeThreadSafe):
202         (WTF::CrossThreadRefCounted::mayBePassedToAnotherThread):
203         (WTF::CrossThreadRefCounted::CrossThreadRefCounted):
204         (WTF::CrossThreadRefCounted::~CrossThreadRefCounted):
205         (WTF::CrossThreadRefCounted::ref):
206         (WTF::CrossThreadRefCounted::deref):
207         (WTF::CrossThreadRefCounted::release):
208         (WTF::CrossThreadRefCounted::copy):
209         (WTF::CrossThreadRefCounted::threadSafeDeref):
210         * wtf/RefCounted.h:
211         * wtf/Threading.h:
212         (WTF::ThreadSafeSharedBase::ThreadSafeSharedBase):
213         (WTF::ThreadSafeSharedBase::derefBase):
214         (WTF::ThreadSafeShared::ThreadSafeShared):
215         (WTF::ThreadSafeShared::deref):
216
217 2009-03-09  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
218
219         Reviewed by George Staikos.
220
221         https://bugs.webkit.org/show_bug.cgi?id=24353
222         Allow to overrule default build options for Qt build.
223
224         * JavaScriptCore.pri: Allow to overrule ENABLE_JIT
225
226 2009-03-08  Oliver Hunt  <oliver@apple.com>
227
228         Reviewed by NOBODY (build fix).
229
230         Build fix.
231
232         * runtime/ArrayPrototype.cpp:
233         (JSC::arrayProtoFuncConcat):
234
235 2009-03-01  Oliver Hunt  <oliver@apple.com>
236
237         Reviewed by Cameron Zwarich.
238
239         Bug 24268: RuntimeArray is not a fully implemented JSArray
240         <https://bugs.webkit.org/show_bug.cgi?id=24268>
241
242         Don't cast a type to JSArray, just because it reportsArray as a supertype
243         in the JS type system.  Doesn't appear feasible to create a testcase
244         unfortunately as setting up the failure conditions requires internal access 
245         to JSC not present in DRT.
246
247         * runtime/ArrayPrototype.cpp:
248         (JSC::arrayProtoFuncConcat):
249
250 2009-03-06  Gavin Barraclough  <barraclough@apple.com>
251
252         Reviewed by Oliver Hunt.
253
254         When preforming an op_mov, preserve any existing register mapping.
255
256         ~0.5% progression on v8 tests x86-64.
257
258         * jit/JIT.cpp:
259         (JSC::JIT::privateCompileMainPass):
260
261 2009-03-05  Simone Fiorentino  <simone.fiorentino@consulenti.fastweb.it>
262
263         Bug 24382: request to add SH4 platform
264
265         <https://bugs.webkit.org/show_bug.cgi?id=24382>
266
267         Reviewed by David Kilzer.
268
269         * wtf/Platform.h: Added support for SH4 platform.
270
271 2009-03-05  Gavin Barraclough  <barraclough@apple.com>
272
273         Reviewed by Oliver Hunt.
274
275         Writes of constant values to SF registers should be made with direct memory
276         writes where possible, rather than moving the value via a hardware register.
277
278         ~3% win on SunSpider tests on x86, ~1.5% win on v8 tests on x86-64.
279
280         * assembler/MacroAssemblerX86_64.h:
281         (JSC::MacroAssemblerX86_64::storePtr):
282         * assembler/X86Assembler.h:
283         (JSC::X86Assembler::movq_i32m):
284         * jit/JIT.cpp:
285         (JSC::JIT::privateCompileMainPass):
286
287 2009-03-05  Mark Rowe  <mrowe@apple.com>
288
289         Fix the build.
290
291         Sprinkle "static" around NumberConstructor.cpp in order to please the compiler.
292
293         * runtime/NumberConstructor.cpp:
294         (JSC::numberConstructorNaNValue):
295         (JSC::numberConstructorNegInfinity):
296         (JSC::numberConstructorPosInfinity):
297         (JSC::numberConstructorMaxValue):
298         (JSC::numberConstructorMinValue):
299
300 2009-03-04  Mark Rowe  <mrowe@apple.com>
301
302         Reviewed by Oliver Hunt.
303
304         <rdar://problem/6354858> FastMallocZone's enumeration code reports fragmented administration space
305
306         The handling of MALLOC_ADMIN_REGION_RANGE_TYPE in FastMalloc's zone was incorrect.  It was attempting
307         to record the memory containing and individual span as an administrative region, when all memory
308         allocated via MetaDataAlloc should in fact be recorded.  This was causing memory regions allocated
309         via MetaDataAlloc to appear as "VM_ALLOCATE ?" in vmmap output.  They are now correctly reported as
310         "MALLOC_OTHER" regions associated with the JavaScriptCore FastMalloc zone.
311
312         Memory is allocated via MetaDataAlloc from two locations: PageHeapAllocator, and TCMalloc_PageMap{2,3}.
313         These two cases are handled differently.
314
315         PageHeapAllocator is extended to keep a linked list of memory regions that it has allocated.  The
316         first object in an allocated region contains the link to the previously allocated region. To record
317         the administrative regions of a PageHeapAllocator we can simply walk the linked list and record
318         each allocated region we encounter.
319
320         TCMalloc_PageMaps allocate memory via MetaDataAlloc to store each level of the radix tree.  To record
321         the administrative regions of a TCMalloc_PageMap we walk the tree and record the storage used for nodes
322         at each position rather than the nodes themselves.
323
324         A small performance improvement is achieved by coalescing adjacent memory regions inside the PageMapMemoryUsageRecorder
325         so that fewer calls in to the range recorder are necessary.  We further reduce the number of calls to the
326         range recorder by aggregating the in-use ranges of a given memory region into a local buffer before recording
327         them with a single call.  A similar approach is also used by AdminRegionRecorder.
328
329         * wtf/FastMalloc.cpp:
330         (WTF::PageHeapAllocator::Init):
331         (WTF::PageHeapAllocator::New):
332         (WTF::PageHeapAllocator::recordAdministrativeRegions):
333         (WTF::TCMallocStats::FreeObjectFinder::isFreeObject):
334         (WTF::TCMallocStats::PageMapMemoryUsageRecorder::~PageMapMemoryUsageRecorder):
335         (WTF::TCMallocStats::PageMapMemoryUsageRecorder::recordPendingRegions):
336         (WTF::TCMallocStats::PageMapMemoryUsageRecorder::visit):
337         (WTF::TCMallocStats::AdminRegionRecorder::AdminRegionRecorder):
338         (WTF::TCMallocStats::AdminRegionRecorder::recordRegion):
339         (WTF::TCMallocStats::AdminRegionRecorder::visit):
340         (WTF::TCMallocStats::AdminRegionRecorder::recordPendingRegions):
341         (WTF::TCMallocStats::AdminRegionRecorder::~AdminRegionRecorder):
342         (WTF::TCMallocStats::FastMallocZone::enumerate):
343         (WTF::TCMallocStats::FastMallocZone::FastMallocZone):
344         (WTF::TCMallocStats::FastMallocZone::init):
345         * wtf/TCPageMap.h:
346         (TCMalloc_PageMap2::visitValues):
347         (TCMalloc_PageMap2::visitAllocations):
348         (TCMalloc_PageMap3::visitValues):
349         (TCMalloc_PageMap3::visitAllocations):
350
351 2009-03-04  Antti Koivisto  <antti@apple.com>
352
353         Reviewed by Dave Hyatt.
354
355         https://bugs.webkit.org/show_bug.cgi?id=24359
356         Repaint throttling mechanism
357         
358         Set ENABLE_REPAINT_THROTTLING to 0 by default.
359
360         * wtf/Platform.h:
361
362 2009-03-03  David Kilzer  <ddkilzer@apple.com>
363
364         <rdar://problem/6581203> WebCore and WebKit should install the same set of headers during installhdrs phase as build phase
365
366         Reviewed by Mark Rowe.
367
368         * Configurations/Base.xcconfig: Defined REAL_PLATFORM_NAME based
369         on PLATFORM_NAME to work around the missing definition on Tiger.
370         Updated HAVE_DTRACE to use REAL_PLATFORM_NAME.
371
372 2009-03-03  Kevin McCullough  <kmccullough@apple.com>
373
374         Reviewed by Oliver Hunt.
375
376         <rdar://problem/6639110> console.profile() doesn't work without a title
377
378         * profiler/Profiler.cpp:
379         (JSC::Profiler::startProfiling): assert if there is not title to ensure
380         we don't start profiling without one.
381
382 2009-03-02  Sam Weinig  <sam@webkit.org>
383
384         Reviewed by Mark Rowe.
385
386         Enable Geolocation (except on Tiger and Leopard).
387
388         * Configurations/JavaScriptCore.xcconfig:
389
390 2009-03-01  David Kilzer  <ddkilzer@apple.com>
391
392         <rdar://problem/6635688> Move HAVE_DTRACE check to Base.xcconfig
393
394         Reviewed by Mark Rowe.
395
396         * Configurations/Base.xcconfig: Set HAVE_DTRACE Xcode variable
397         based on PLATFORM_NAME and MAC_OS_X_VERSION_MAJOR.  Also define
398         it as a preprocessor macro by modifying
399         GCC_PREPROCESSOR_DEFINITIONS.
400         * JavaScriptCore.xcodeproj/project.pbxproj: Changed "Generate
401         DTrace header" script phase to check for HAVE_DTRACE instead of
402         MACOSX_DEPLOYMENT_TARGET.
403         * wtf/Platform.h: Removed definition of HAVE_DTRACE macro since
404         it's defined in Base.xcconfig now.
405
406 2009-03-01  Horia Olaru  <olaru@adobe.com>
407
408         By looking in grammar.y there are only a few types of statement nodes
409         on which the debugger should stop. 
410
411         Removed isBlock and isLoop virtual calls. No need to emit debug hooks in
412         the "statementListEmitCode" method as long as the necessary hooks can be
413         added in each "emitCode".
414
415         https://bugs.webkit.org/show_bug.cgi?id=21073
416
417         Reviewed by Kevin McCullough.
418
419         * parser/Nodes.cpp:
420         (JSC::ConstStatementNode::emitBytecode):
421         (JSC::statementListEmitCode):
422         (JSC::EmptyStatementNode::emitBytecode):
423         (JSC::ExprStatementNode::emitBytecode):
424         (JSC::VarStatementNode::emitBytecode):
425         (JSC::IfNode::emitBytecode):
426         (JSC::IfElseNode::emitBytecode):
427         (JSC::DoWhileNode::emitBytecode):
428         (JSC::WhileNode::emitBytecode):
429         (JSC::ForNode::emitBytecode):
430         (JSC::ForInNode::emitBytecode):
431         (JSC::ContinueNode::emitBytecode):
432         (JSC::BreakNode::emitBytecode):
433         (JSC::ReturnNode::emitBytecode):
434         (JSC::WithNode::emitBytecode):
435         (JSC::SwitchNode::emitBytecode):
436         (JSC::LabelNode::emitBytecode):
437         (JSC::ThrowNode::emitBytecode):
438         (JSC::TryNode::emitBytecode):
439         * parser/Nodes.h:
440
441 2009-02-26  Gavin Barraclough  <barraclough@apple.com>
442
443         Reviewed by Geoff Garen.
444
445         Fix bug #23614.  Switches on double precision values were incorrectly
446         truncating the scrutinee value.  E.g.:
447
448             switch (1.1) { case 1: print("FAIL"); }
449
450         Was resulting in FAIL.
451
452         * interpreter/Interpreter.cpp:
453         (JSC::Interpreter::privateExecute):
454         * jit/JITStubs.cpp:
455         (JSC::JITStubs::cti_op_switch_imm):
456
457 2009-02-26  Gavin Barraclough  <barraclough@apple.com>
458
459         Reviewed by Oliver Hunt.
460
461         Integer Immediate representation need not be canonical in x86 JIT code.
462         On x86-64 we already have loosened the requirement that the int immediate
463         representation in canonical, we should bring x86 into line.
464
465         This patch is a minor (~0.5%) improvement on sunspider & v8-tests, and
466         should reduce memory footoprint (reduces JIT code size).
467
468         * jit/JIT.cpp:
469         (JSC::JIT::compileOpStrictEq):
470         (JSC::JIT::privateCompileSlowCases):
471         * jit/JIT.h:
472         (JSC::JIT::emitJumpIfImmediateNumber):
473         (JSC::JIT::emitJumpIfNotImmediateNumber):
474         * jit/JITArithmetic.cpp:
475         (JSC::JIT::putDoubleResultToJSNumberCellOrJSImmediate):
476         (JSC::JIT::compileBinaryArithOp):
477
478 2009-02-26  Carol Szabo  <carol.szabo@nokia.com>
479
480         Reviewed by Darin Adler.
481
482         https://bugs.webkit.org/show_bug.cgi?id=24099
483         ARM Compiler Warnings in pcre_exec.cpp
484
485         * pcre/pcre_exec.cpp:
486         (match):
487
488 2009-02-25  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
489
490         Reviewed by Gavin Barraclough.
491
492         Bug 24086: Regression (r40993): WebKit crashes after logging in to lists.zenbe
493         <https://bugs.webkit.org/show_bug.cgi?id=24086>
494         <rdar://problem/6625111>
495
496         The numeric sort optimization in r40993 generated bytecode for a function
497         without generating JIT code. This breaks an assumption in some parts of
498         the JIT's function calling logic that the presence of a CodeBlock implies
499         the existence of JIT code.
500
501         In order to fix this, we simply generate JIT code whenever we check whether
502         a function is a numeric sort function. This only incurs an additional cost
503         in the case when the function is a numeric sort function, in which case it
504         is not expensive to generate JIT code for it.
505
506         * runtime/ArrayPrototype.cpp:
507         (JSC::isNumericCompareFunction):
508
509 2009-02-25  Geoffrey Garen  <ggaren@apple.com>
510
511         Reviewed by Maciej Stachowiak.
512         
513         Fixed <rdar://problem/6611174> REGRESSION (r36701): Unable to select
514         messages on hotmail (24052)
515         
516         The bug was that for-in enumeration used a cached prototype chain without
517         validating that it was up-to-date.
518         
519         This led me to refactor prototype chain caching so it was easier to work
520         with and harder to get wrong.
521         
522         After a bit of inlining, this patch is performance-neutral on SunSpider
523         and the v8 benchmarks.
524
525         * interpreter/Interpreter.cpp:
526         (JSC::Interpreter::tryCachePutByID):
527         (JSC::Interpreter::tryCacheGetByID):
528         * jit/JITStubs.cpp:
529         (JSC::JITStubs::tryCachePutByID):
530         (JSC::JITStubs::tryCacheGetByID):
531         (JSC::JITStubs::cti_op_get_by_id_proto_list): Use the new refactored goodness. See
532         lines beginning with "-" and smile.
533
534         * runtime/JSGlobalObject.h:
535         (JSC::Structure::prototypeForLookup): A shout out to const.
536
537         * runtime/JSPropertyNameIterator.h:
538         (JSC::JSPropertyNameIterator::next): We can use a pointer comparison to
539         see if our cached structure chain is equal to the object's structure chain,
540         since in the case of a cache hit, we share references to the same structure
541         chain.
542
543         * runtime/Operations.h:
544         (JSC::countPrototypeChainEntriesAndCheckForProxies): Use the new refactored
545         goodness.
546
547         * runtime/PropertyNameArray.h:
548         (JSC::PropertyNameArray::PropertyNameArray):
549         (JSC::PropertyNameArray::setShouldCache):
550         (JSC::PropertyNameArray::shouldCache): Renamed "cacheable" to "shouldCache"
551         to communicate that the client is specifying a recommendation, not a
552         capability.
553         
554         * runtime/Structure.cpp:
555         (JSC::Structure::Structure): No need to initialize a RefPtr.
556         (JSC::Structure::getEnumerablePropertyNames): Moved some code into helper
557         functions.
558
559         (JSC::Structure::prototypeChain): New centralized accessor for a prototype
560         chain. Revalidates on every access, since the objects in the prototype
561         chain may have mutated.
562
563         (JSC::Structure::isValid): Helper function for revalidating a cached
564         prototype chain.
565
566         (JSC::Structure::getEnumerableNamesFromPropertyTable):
567         (JSC::Structure::getEnumerableNamesFromClassInfoTable): Factored out of
568         getEnumerablePropertyNames.
569
570         * runtime/Structure.h:
571
572         * runtime/StructureChain.cpp:
573         (JSC::StructureChain::StructureChain):
574         * runtime/StructureChain.h:
575         (JSC::StructureChain::create): No need for structureChainsAreEqual, since
576         we use pointer equality now. Refactored StructureChain to make a little
577         more sense and eliminate special cases for null prototypes.
578
579 2009-02-25  Steve Falkenburg  <sfalken@apple.com>
580
581         Use timeBeginPeriod to enable timing resolution greater than 16ms in command line jsc for Windows.
582         Allows more accurate reporting of benchmark times via command line jsc.exe. Doesn't affect WebKit's use of JavaScriptCore.
583         
584         Reviewed by Adam Roben.
585
586         * jsc.cpp:
587         (main):
588
589 2009-02-24  Geoffrey Garen  <ggaren@apple.com>
590
591         Build fix?
592
593         * GNUmakefile.am:
594
595 2009-02-24  Mark Rowe  <mrowe@apple.com>
596
597         Reviewed by Oliver Hunt.
598
599         <rdar://problem/6259220> Rename AVAILABLE_AFTER_WEBKIT_VERSION_3_1 (etc.) to match the other macros
600
601         * API/JSBasePrivate.h:
602         * API/JSContextRef.h:
603         * API/JSObjectRef.h:
604         * API/WebKitAvailability.h:
605
606 2009-02-23  Geoffrey Garen  <ggaren@apple.com>
607
608         Reviewed by Sam Weinig.
609
610         Next step in splitting JIT functionality out of the Interpreter class:
611         Moved vptr storage from Interpreter to JSGlobalData, so it could be shared
612         between Interpreter and JITStubs, and moved the *Trampoline JIT stubs
613         into the JITStubs class. Also added a VPtrSet class to encapsulate vptr
614         hacks during JSGlobalData initialization.
615         
616         SunSpider says 0.4% faster. Meh.
617
618         * JavaScriptCore.exp:
619         * JavaScriptCore.xcodeproj/project.pbxproj:
620         * interpreter/Interpreter.cpp:
621         (JSC::Interpreter::Interpreter):
622         (JSC::Interpreter::tryCacheGetByID):
623         (JSC::Interpreter::privateExecute):
624         * interpreter/Interpreter.h:
625         * jit/JIT.cpp:
626         (JSC::JIT::privateCompileMainPass):
627         (JSC::JIT::privateCompile):
628         (JSC::JIT::privateCompileCTIMachineTrampolines):
629         * jit/JIT.h:
630         (JSC::JIT::compileCTIMachineTrampolines):
631         * jit/JITCall.cpp:
632         (JSC::JIT::compileOpCall):
633         (JSC::JIT::compileOpCallSlowCase):
634         * jit/JITPropertyAccess.cpp:
635         (JSC::JIT::privateCompilePatchGetArrayLength):
636         * jit/JITStubs.cpp:
637         (JSC::JITStubs::JITStubs):
638         (JSC::JITStubs::tryCacheGetByID):
639         (JSC::JITStubs::cti_vm_dontLazyLinkCall):
640         (JSC::JITStubs::cti_op_get_by_val):
641         (JSC::JITStubs::cti_op_get_by_val_byte_array):
642         (JSC::JITStubs::cti_op_put_by_val):
643         (JSC::JITStubs::cti_op_put_by_val_array):
644         (JSC::JITStubs::cti_op_put_by_val_byte_array):
645         (JSC::JITStubs::cti_op_is_string):
646         * jit/JITStubs.h:
647         (JSC::JITStubs::ctiArrayLengthTrampoline):
648         (JSC::JITStubs::ctiStringLengthTrampoline):
649         (JSC::JITStubs::ctiVirtualCallPreLink):
650         (JSC::JITStubs::ctiVirtualCallLink):
651         (JSC::JITStubs::ctiVirtualCall):
652         * runtime/ArrayPrototype.cpp:
653         (JSC::arrayProtoFuncPop):
654         (JSC::arrayProtoFuncPush):
655         * runtime/FunctionPrototype.cpp:
656         (JSC::functionProtoFuncApply):
657         * runtime/JSArray.h:
658         (JSC::isJSArray):
659         * runtime/JSByteArray.h:
660         (JSC::asByteArray):
661         (JSC::isJSByteArray):
662         * runtime/JSCell.h:
663         * runtime/JSFunction.h:
664         * runtime/JSGlobalData.cpp:
665         (JSC::VPtrSet::VPtrSet):
666         (JSC::JSGlobalData::JSGlobalData):
667         (JSC::JSGlobalData::create):
668         (JSC::JSGlobalData::sharedInstance):
669         * runtime/JSGlobalData.h:
670         * runtime/JSString.h:
671         (JSC::isJSString):
672         * runtime/Operations.h:
673         (JSC::jsLess):
674         (JSC::jsLessEq):
675         * wrec/WREC.cpp:
676         (JSC::WREC::Generator::compileRegExp):
677
678 2009-02-23  Csaba Osztrogonac  <oszi@inf.u-szeged.hu>
679
680         Reviewed by Oliver Hunt.
681
682         Bug 23787: Allow JIT to generate SSE2 code if using GCC
683         <https://bugs.webkit.org/show_bug.cgi?id=23787>
684
685         GCC version of the cpuid check.
686
687         * jit/JITArithmetic.cpp:
688         (JSC::isSSE2Present): previous assembly code fixed.
689
690 2009-02-23  David Levin  <levin@chromium.org>
691
692         Reviewed by Alexey Proskuryakov.
693
694         Bug 24047: Need to simplify nested if's in WorkerRunLoop::runInMode
695         <https://bugs.webkit.org/show_bug.cgi?id=24047>
696
697         * wtf/MessageQueue.h:
698         (WTF::MessageQueue::infiniteTime):
699         Allows for one to call waitForMessageFilteredWithTimeout and wait forever.
700
701         (WTF::MessageQueue::alwaysTruePredicate):
702         (WTF::MessageQueue::waitForMessage):
703         Made waitForMessage call waitForMessageFilteredWithTimeout, so that there is less
704         duplicate code.
705
706         (WTF::MessageQueue::waitForMessageFilteredWithTimeout):
707
708         * wtf/ThreadingQt.cpp:
709         (WTF::ThreadCondition::timedWait):
710         * wtf/ThreadingWin.cpp:
711         (WTF::ThreadCondition::timedWait):
712         Made these two implementations consistent with the pthread and gtk implementations.
713         Currently, the time calculations would overflow when passed large values.
714
715 2009-02-23  Jeremy Moskovich  <jeremy@chromium.org>
716
717         Reviewed by Adam Roben.
718
719         https://bugs.webkit.org/show_bug.cgi?id=24096
720         PLATFORM(MAC)->PLATFORM(CF) since we want to use the CF functions in Chrome on OS X.
721
722         * wtf/CurrentTime.cpp:
723
724 2009-02-22  Geoffrey Garen  <ggaren@apple.com>
725
726         Build fix?
727
728         * GNUmakefile.am:
729
730 2009-02-22  Geoffrey Garen  <ggaren@apple.com>
731
732         Build fix.
733
734         * GNUmakefile.am:
735
736 2009-02-22  Geoffrey Garen  <ggaren@apple.com>
737
738         Reviewed by Sam Weinig.
739
740         Next step in splitting JIT functionality out of the Interpreter class:
741         Created a JITStubs class and renamed Interpreter::cti_* to JITStubs::cti_*.
742         
743         Also, moved timeout checking into its own class, located in JSGlobalData,
744         so both the Interpreter and the JIT could have access to it.
745
746         * JavaScriptCore.exp:
747         * JavaScriptCore.pri:
748         * JavaScriptCore.scons:
749         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
750         * JavaScriptCore.xcodeproj/project.pbxproj:
751         * JavaScriptCoreSources.bkl:
752         * interpreter/CallFrame.h:
753         * interpreter/Interpreter.cpp:
754         (JSC::Interpreter::Interpreter):
755         (JSC::Interpreter::privateExecute):
756         * interpreter/Interpreter.h:
757         * interpreter/Register.h:
758         * jit/JIT.cpp:
759         (JSC::):
760         (JSC::JIT::emitTimeoutCheck):
761         (JSC::JIT::privateCompileMainPass):
762         (JSC::JIT::privateCompileSlowCases):
763         (JSC::JIT::privateCompile):
764         (JSC::JIT::privateCompileCTIMachineTrampolines):
765         * jit/JIT.h:
766         * jit/JITArithmetic.cpp:
767         (JSC::JIT::compileFastArithSlow_op_lshift):
768         (JSC::JIT::compileFastArithSlow_op_rshift):
769         (JSC::JIT::compileFastArithSlow_op_bitand):
770         (JSC::JIT::compileFastArithSlow_op_mod):
771         (JSC::JIT::compileFastArith_op_mod):
772         (JSC::JIT::compileFastArithSlow_op_post_inc):
773         (JSC::JIT::compileFastArithSlow_op_post_dec):
774         (JSC::JIT::compileFastArithSlow_op_pre_inc):
775         (JSC::JIT::compileFastArithSlow_op_pre_dec):
776         (JSC::JIT::compileFastArith_op_add):
777         (JSC::JIT::compileFastArith_op_mul):
778         (JSC::JIT::compileFastArith_op_sub):
779         (JSC::JIT::compileBinaryArithOpSlowCase):
780         (JSC::JIT::compileFastArithSlow_op_add):
781         (JSC::JIT::compileFastArithSlow_op_mul):
782         * jit/JITCall.cpp:
783         (JSC::JIT::compileOpCall):
784         (JSC::JIT::compileOpCallSlowCase):
785         * jit/JITPropertyAccess.cpp:
786         (JSC::JIT::compileGetByIdHotPath):
787         (JSC::JIT::compilePutByIdHotPath):
788         (JSC::JIT::compileGetByIdSlowCase):
789         (JSC::JIT::compilePutByIdSlowCase):
790         (JSC::JIT::privateCompilePutByIdTransition):
791         (JSC::JIT::patchGetByIdSelf):
792         (JSC::JIT::patchPutByIdReplace):
793         (JSC::JIT::privateCompilePatchGetArrayLength):
794         (JSC::JIT::privateCompileGetByIdSelf):
795         (JSC::JIT::privateCompileGetByIdProto):
796         (JSC::JIT::privateCompileGetByIdChain):
797         (JSC::JIT::privateCompilePutByIdReplace):
798         * jit/JITStubs.cpp:
799         (JSC::JITStubs::tryCachePutByID):
800         (JSC::JITStubs::tryCacheGetByID):
801         (JSC::JITStubs::cti_op_convert_this):
802         (JSC::JITStubs::cti_op_end):
803         (JSC::JITStubs::cti_op_add):
804         (JSC::JITStubs::cti_op_pre_inc):
805         (JSC::JITStubs::cti_timeout_check):
806         (JSC::JITStubs::cti_register_file_check):
807         (JSC::JITStubs::cti_op_loop_if_less):
808         (JSC::JITStubs::cti_op_loop_if_lesseq):
809         (JSC::JITStubs::cti_op_new_object):
810         (JSC::JITStubs::cti_op_put_by_id_generic):
811         (JSC::JITStubs::cti_op_get_by_id_generic):
812         (JSC::JITStubs::cti_op_put_by_id):
813         (JSC::JITStubs::cti_op_put_by_id_second):
814         (JSC::JITStubs::cti_op_put_by_id_fail):
815         (JSC::JITStubs::cti_op_get_by_id):
816         (JSC::JITStubs::cti_op_get_by_id_second):
817         (JSC::JITStubs::cti_op_get_by_id_self_fail):
818         (JSC::JITStubs::cti_op_get_by_id_proto_list):
819         (JSC::JITStubs::cti_op_get_by_id_proto_list_full):
820         (JSC::JITStubs::cti_op_get_by_id_proto_fail):
821         (JSC::JITStubs::cti_op_get_by_id_array_fail):
822         (JSC::JITStubs::cti_op_get_by_id_string_fail):
823         (JSC::JITStubs::cti_op_instanceof):
824         (JSC::JITStubs::cti_op_del_by_id):
825         (JSC::JITStubs::cti_op_mul):
826         (JSC::JITStubs::cti_op_new_func):
827         (JSC::JITStubs::cti_op_call_JSFunction):
828         (JSC::JITStubs::cti_op_call_arityCheck):
829         (JSC::JITStubs::cti_vm_dontLazyLinkCall):
830         (JSC::JITStubs::cti_vm_lazyLinkCall):
831         (JSC::JITStubs::cti_op_push_activation):
832         (JSC::JITStubs::cti_op_call_NotJSFunction):
833         (JSC::JITStubs::cti_op_create_arguments):
834         (JSC::JITStubs::cti_op_create_arguments_no_params):
835         (JSC::JITStubs::cti_op_tear_off_activation):
836         (JSC::JITStubs::cti_op_tear_off_arguments):
837         (JSC::JITStubs::cti_op_profile_will_call):
838         (JSC::JITStubs::cti_op_profile_did_call):
839         (JSC::JITStubs::cti_op_ret_scopeChain):
840         (JSC::JITStubs::cti_op_new_array):
841         (JSC::JITStubs::cti_op_resolve):
842         (JSC::JITStubs::cti_op_construct_JSConstruct):
843         (JSC::JITStubs::cti_op_construct_NotJSConstruct):
844         (JSC::JITStubs::cti_op_get_by_val):
845         (JSC::JITStubs::cti_op_get_by_val_byte_array):
846         (JSC::JITStubs::cti_op_resolve_func):
847         (JSC::JITStubs::cti_op_sub):
848         (JSC::JITStubs::cti_op_put_by_val):
849         (JSC::JITStubs::cti_op_put_by_val_array):
850         (JSC::JITStubs::cti_op_put_by_val_byte_array):
851         (JSC::JITStubs::cti_op_lesseq):
852         (JSC::JITStubs::cti_op_loop_if_true):
853         (JSC::JITStubs::cti_op_negate):
854         (JSC::JITStubs::cti_op_resolve_base):
855         (JSC::JITStubs::cti_op_resolve_skip):
856         (JSC::JITStubs::cti_op_resolve_global):
857         (JSC::JITStubs::cti_op_div):
858         (JSC::JITStubs::cti_op_pre_dec):
859         (JSC::JITStubs::cti_op_jless):
860         (JSC::JITStubs::cti_op_not):
861         (JSC::JITStubs::cti_op_jtrue):
862         (JSC::JITStubs::cti_op_post_inc):
863         (JSC::JITStubs::cti_op_eq):
864         (JSC::JITStubs::cti_op_lshift):
865         (JSC::JITStubs::cti_op_bitand):
866         (JSC::JITStubs::cti_op_rshift):
867         (JSC::JITStubs::cti_op_bitnot):
868         (JSC::JITStubs::cti_op_resolve_with_base):
869         (JSC::JITStubs::cti_op_new_func_exp):
870         (JSC::JITStubs::cti_op_mod):
871         (JSC::JITStubs::cti_op_less):
872         (JSC::JITStubs::cti_op_neq):
873         (JSC::JITStubs::cti_op_post_dec):
874         (JSC::JITStubs::cti_op_urshift):
875         (JSC::JITStubs::cti_op_bitxor):
876         (JSC::JITStubs::cti_op_new_regexp):
877         (JSC::JITStubs::cti_op_bitor):
878         (JSC::JITStubs::cti_op_call_eval):
879         (JSC::JITStubs::cti_op_throw):
880         (JSC::JITStubs::cti_op_get_pnames):
881         (JSC::JITStubs::cti_op_next_pname):
882         (JSC::JITStubs::cti_op_push_scope):
883         (JSC::JITStubs::cti_op_pop_scope):
884         (JSC::JITStubs::cti_op_typeof):
885         (JSC::JITStubs::cti_op_is_undefined):
886         (JSC::JITStubs::cti_op_is_boolean):
887         (JSC::JITStubs::cti_op_is_number):
888         (JSC::JITStubs::cti_op_is_string):
889         (JSC::JITStubs::cti_op_is_object):
890         (JSC::JITStubs::cti_op_is_function):
891         (JSC::JITStubs::cti_op_stricteq):
892         (JSC::JITStubs::cti_op_nstricteq):
893         (JSC::JITStubs::cti_op_to_jsnumber):
894         (JSC::JITStubs::cti_op_in):
895         (JSC::JITStubs::cti_op_push_new_scope):
896         (JSC::JITStubs::cti_op_jmp_scopes):
897         (JSC::JITStubs::cti_op_put_by_index):
898         (JSC::JITStubs::cti_op_switch_imm):
899         (JSC::JITStubs::cti_op_switch_char):
900         (JSC::JITStubs::cti_op_switch_string):
901         (JSC::JITStubs::cti_op_del_by_val):
902         (JSC::JITStubs::cti_op_put_getter):
903         (JSC::JITStubs::cti_op_put_setter):
904         (JSC::JITStubs::cti_op_new_error):
905         (JSC::JITStubs::cti_op_debug):
906         (JSC::JITStubs::cti_vm_throw):
907         * jit/JITStubs.h:
908         (JSC::):
909         * runtime/JSFunction.h:
910         * runtime/JSGlobalData.cpp:
911         (JSC::JSGlobalData::JSGlobalData):
912         * runtime/JSGlobalData.h:
913         * runtime/JSGlobalObject.cpp:
914         * runtime/JSGlobalObject.h:
915         * runtime/TimeoutChecker.cpp: Copied from interpreter/Interpreter.cpp.
916         (JSC::TimeoutChecker::TimeoutChecker):
917         (JSC::TimeoutChecker::reset):
918         (JSC::TimeoutChecker::didTimeOut):
919         * runtime/TimeoutChecker.h: Copied from interpreter/Interpreter.h.
920         (JSC::TimeoutChecker::setTimeoutInterval):
921         (JSC::TimeoutChecker::ticksUntilNextCheck):
922         (JSC::TimeoutChecker::start):
923         (JSC::TimeoutChecker::stop):
924
925 2009-02-20  Gustavo Noronha Silva  <gns@gnome.org>
926
927         Unreviewed build fix after r41100.
928
929         * GNUmakefile.am:
930
931 2009-02-20  Oliver Hunt  <oliver@apple.com>
932
933         Reviewed by Mark Rowe.
934
935         <rdar://problem/6606660> 2==null returns true in 64bit jit
936
937         Code for op_eq_null and op_neq_null was incorrectly performing
938         a 32bit compare, which truncated the type tag from an integer
939         immediate, leading to incorrect behaviour.
940
941         * assembler/MacroAssembler.h:
942         (JSC::MacroAssembler::setPtr):
943         * assembler/MacroAssemblerX86_64.h:
944         (JSC::MacroAssemblerX86_64::setPtr):
945         * jit/JIT.cpp:
946         (JSC::JIT::privateCompileMainPass):
947
948 2009-02-19  Geoffrey Garen  <ggaren@apple.com>
949
950         Reviewed by Gavin Barraclough.
951         
952         First step in splitting JIT functionality out of the Interpreter class:
953         Created JITStubs.h/.cpp, and moved Interpreter::cti_* into JITStubs.cpp.
954         
955         Functions that the Interpreter and JITStubs share moved to Operations.h/.cpp.
956
957         * GNUmakefile.am:
958         * JavaScriptCore.pri:
959         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
960         * JavaScriptCore.xcodeproj/project.pbxproj:
961         * interpreter/Interpreter.cpp:
962         (JSC::Interpreter::resolveBase):
963         (JSC::Interpreter::checkTimeout):
964         (JSC::Interpreter::privateExecute):
965         * interpreter/Interpreter.h:
966         * jit/JITStubs.cpp: Copied from interpreter/Interpreter.cpp.
967         (JSC::Interpreter::cti_op_resolve_base):
968         * jit/JITStubs.h: Copied from interpreter/Interpreter.h.
969         * runtime/Operations.cpp:
970         (JSC::jsAddSlowCase):
971         (JSC::jsTypeStringForValue):
972         (JSC::jsIsObjectType):
973         (JSC::jsIsFunctionType):
974         * runtime/Operations.h:
975         (JSC::jsLess):
976         (JSC::jsLessEq):
977         (JSC::jsAdd):
978         (JSC::cachePrototypeChain):
979         (JSC::countPrototypeChainEntriesAndCheckForProxies):
980         (JSC::resolveBase):
981
982 2009-02-19  Gavin Barraclough  <barraclough@apple.com>
983
984         Reviewed by Oliver Hunt.
985
986         Fix for x86-64. Where the JavaScriptCore text segment lies outside
987         a 2gb range of the heap containing JIT generated code, callbacks
988         from JIT code to the stub functions in Interpreter will be incorrectly
989         linked.
990
991         No performance impact on Sunspider, 1% regression on v8-tests,
992         due to a 3% regression on richards.
993
994         * assembler/AbstractMacroAssembler.h:
995         (JSC::AbstractMacroAssembler::Call::Call):
996         (JSC::AbstractMacroAssembler::Jump::link):
997         (JSC::AbstractMacroAssembler::Jump::linkTo):
998         (JSC::AbstractMacroAssembler::CodeLocationJump::relink):
999         (JSC::AbstractMacroAssembler::CodeLocationCall::relink):
1000         (JSC::AbstractMacroAssembler::ProcessorReturnAddress::relinkCallerToFunction):
1001         (JSC::AbstractMacroAssembler::PatchBuffer::link):
1002         (JSC::AbstractMacroAssembler::PatchBuffer::linkTailRecursive):
1003         (JSC::AbstractMacroAssembler::differenceBetween):
1004         * assembler/MacroAssembler.h:
1005         (JSC::MacroAssembler::tailRecursiveCall):
1006         (JSC::MacroAssembler::makeTailRecursiveCall):
1007         * assembler/MacroAssemblerX86.h:
1008         (JSC::MacroAssemblerX86::call):
1009         * assembler/MacroAssemblerX86Common.h:
1010         * assembler/MacroAssemblerX86_64.h:
1011         (JSC::MacroAssemblerX86_64::call):
1012         (JSC::MacroAssemblerX86_64::moveWithPatch):
1013         (JSC::MacroAssemblerX86_64::branchPtrWithPatch):
1014         (JSC::MacroAssemblerX86_64::storePtrWithPatch):
1015         * assembler/X86Assembler.h:
1016         (JSC::X86Assembler::jmp_r):
1017         (JSC::X86Assembler::linkJump):
1018         (JSC::X86Assembler::patchJump):
1019         (JSC::X86Assembler::patchCall):
1020         (JSC::X86Assembler::linkCall):
1021         (JSC::X86Assembler::patchAddress):
1022         * interpreter/Interpreter.cpp:
1023         (JSC::Interpreter::tryCTICachePutByID):
1024         * jit/JIT.cpp:
1025         (JSC::JIT::privateCompile):
1026         (JSC::JIT::privateCompileCTIMachineTrampolines):
1027         * jit/JIT.h:
1028         * jit/JITArithmetic.cpp:
1029         (JSC::JIT::putDoubleResultToJSNumberCellOrJSImmediate):
1030         (JSC::JIT::compileBinaryArithOp):
1031         * jit/JITPropertyAccess.cpp:
1032         (JSC::JIT::privateCompilePutByIdTransition):
1033         (JSC::JIT::privateCompileGetByIdSelf):
1034         (JSC::JIT::privateCompilePutByIdReplace):
1035
1036 2009-02-18  Geoffrey Garen  <ggaren@apple.com>
1037
1038         Reviewed by Oliver Hunt.
1039         
1040         Simplified .call and .apply in preparation for optimizing them. Also,
1041         a little cleanup.
1042
1043         * runtime/FunctionPrototype.cpp:
1044         (JSC::functionProtoFuncApply):
1045         (JSC::functionProtoFuncCall): No need to do any specific conversion on
1046         'this' -- op_convert_this will do it if necessary.
1047
1048         * runtime/JSImmediate.cpp:
1049         (JSC::JSImmediate::toThisObject): Slightly relaxed the rules on
1050         toThisObject to allow for 'undefined', which can be passed through
1051         .call and .apply.
1052
1053 2009-02-19  David Levin  <levin@chromium.org>
1054
1055         Reviewed by Alexey Proskuryakov.
1056
1057         Bug 23976: MessageQueue needs a way to wait for a message that satisfies an arbitrary criteria.
1058         <https://bugs.webkit.org/show_bug.cgi?id=23976>
1059
1060         * wtf/Deque.h:
1061         (WTF::Deque<T>::findIf):
1062         * wtf/MessageQueue.h:
1063         (WTF::MessageQueue<T>::waitForMessageFiltered):
1064
1065 2009-02-18  David Levin  <levin@chromium.org>
1066
1067         Reviewed by Alexey Proskuryakov.
1068
1069         Bug 23974: Deque::Remove would be a useful method.
1070         <https://bugs.webkit.org/show_bug.cgi?id=23974>
1071
1072         Add Deque::remove and DequeIteratorBase<T>::operator=.
1073
1074         Why was operator= added? Every concrete iterator (DequeIterator..DequeConstReverseIterator)
1075         was calling DequeIteratorBase::assign(), which called Base::operator=(). Base::operator=()
1076         was not implemented. This went unnoticed because the iterator copy code has been unused.
1077
1078         * wtf/Deque.h:
1079         (WTF::Deque<T>::remove):
1080         (WTF::DequeIteratorBase<T>::removeFromIteratorsList):
1081         (WTF::DequeIteratorBase<T>::operator=):
1082         (WTF::DequeIteratorBase<T>::~DequeIteratorBase):
1083
1084 2009-02-18  Gustavo Noronha Silva  <gns@gnome.org>
1085
1086         Reviewed by Holger Freyther.
1087
1088         Fix symbols.filter location, and add other missing files to the
1089         autotools build, so that make dist works.
1090
1091         * GNUmakefile.am:
1092
1093 2009-02-17  Geoffrey Garen  <ggaren@apple.com>
1094
1095         Reviewed by Sam Weinig.
1096         
1097         Fixed failure in js1_5/Regress/regress-168347.js, as seen on the Oliver
1098         bot.
1099         
1100         Technically, both behaviors are OK, but we might as well keep this test
1101         passing.
1102
1103         * runtime/FunctionPrototype.cpp:
1104         (JSC::insertSemicolonIfNeeded): No need to add a trailing semicolon
1105         after a trailing '}', since '}' ends a block, indicating the end of a
1106         statement.
1107
1108 2009-02-17  Geoffrey Garen  <ggaren@apple.com>
1109
1110         Build fix.
1111
1112         * runtime/FunctionPrototype.cpp:
1113
1114 2009-02-17  Oliver Hunt  <oliver@apple.com>
1115
1116         Reviewed by Geoff Garen.
1117
1118         Add assertion to guard against oversized pc relative calls.
1119
1120         * assembler/X86Assembler.h:
1121         (JSC::X86Assembler::link):
1122
1123 2009-02-17  Geoffrey Garen  <ggaren@apple.com>
1124
1125         Reviewed by Sam Weinig.
1126         
1127         Fixed <rdar://problem/6595040> REGRESSION: http://www.amnestyusa.org/
1128         fails to load.
1129         
1130         amnestyusa.org uses the Optimist JavaScript library, which adds event
1131         listeners by concatenating string-ified functions. This is only sure to
1132         be syntactically valid if the string-ified functions end in semicolons.
1133
1134         * parser/Lexer.cpp:
1135         (JSC::Lexer::isWhiteSpace):
1136         * parser/Lexer.h:
1137         (JSC::Lexer::isWhiteSpace):
1138         (JSC::Lexer::isLineTerminator): Added some helper functions for examining
1139         whitespace.
1140
1141         * runtime/FunctionPrototype.cpp:
1142         (JSC::appendSemicolonIfNeeded):
1143         (JSC::functionProtoFuncToString): When string-ifying a function, insert
1144         a semicolon in the last non-whitespace position, if one doesn't already exist.
1145
1146 2009-02-16  Oliver Hunt  <oliver@apple.com>
1147
1148         Reviewed by NOBODY (Build fix).
1149
1150         Roll out r41022 as it breaks qt and gtk builds
1151
1152         * jit/JITArithmetic.cpp:
1153         (JSC::isSSE2Present):
1154
1155 2009-02-16  Sam Weinig  <sam@webkit.org>
1156
1157         Reviewed by Geoffrey Garen.
1158
1159         Fix for <rdar://problem/6468156>
1160         REGRESSION (r36779): Adding link, images, flash in TinyMCE blocks entire page (21382)
1161
1162         No performance regression.
1163
1164         * runtime/Arguments.cpp:
1165         (JSC::Arguments::fillArgList): Add codepath for when the "length" property has been
1166         overridden.
1167
1168 2009-02-16  Mark Rowe  <mrowe@apple.com>
1169
1170         Build fix.
1171
1172         * wtf/FastMalloc.cpp:
1173         (WTF::TCMallocStats::):
1174         (WTF::TCMallocStats::FastMallocZone::FastMallocZone):
1175
1176 2009-02-16  Csaba Osztrogonac  <oszi@inf.u-szeged.hu>
1177
1178         Reviewed by Oliver Hunt.
1179
1180         Bug 23787: Allow JIT to generate SSE2 code if using GCC
1181         <https://bugs.webkit.org/show_bug.cgi?id=23787>
1182
1183         GCC version of the cpuid check.
1184
1185         * jit/JITArithmetic.cpp:
1186         (JSC::isSSE2Present): GCC assembly code added.
1187         6.6% progression on x86 Linux with JIT and WREC on SunSpider if using SSE2 capable machine.
1188
1189 2009-02-13  Adam Treat  <adam.treat@torchmobile.com>
1190
1191         Reviewed by George Staikos.
1192
1193         https://bugs.webkit.org/show_bug.cgi?id=23960
1194         Crash Fix.
1195
1196         Don't depend on 'initializeThreading()' to come before a call to 'isMainThread()'
1197         as QtWebKit only calls 'initializeThreading()' during QWebPage construction.
1198
1199         A client app may well make a call to QWebSettings::iconForUrl() for instance
1200         before creating a QWebPage and that call to QWebSettings triggers an
1201         ASSERT(isMainThread()) deep within WebCore.
1202
1203         * wtf/ThreadingQt.cpp:
1204         (WTF::isMainThread):
1205
1206 2009-02-13  Gavin Barraclough  <barraclough@apple.com>
1207
1208         Reviewed by Darin Adler.
1209
1210         Some data in the instruction stream is potentially uninitialized - fix this.
1211
1212         Change the OperandTypes constructor so that uninitialized memory in the int
1213         is zeroed, and modify the Instruction constructor taking an Opcode so that
1214         if !HAVE(COMPUTED_GOTO) (i.e. when Opcode is an enum, and is potentially only
1215         a byte) it zeros the Instruction first before writing the opcode.
1216
1217         * bytecode/Instruction.h:
1218         (JSC::Instruction::Instruction):
1219         * parser/ResultType.h:
1220         (JSC::OperandTypes::OperandTypes):
1221
1222 2009-02-13  Geoffrey Garen  <ggaren@apple.com>
1223
1224         Build fix for non_JIT platforms.
1225
1226         * bytecode/CodeBlock.h:
1227         (JSC::CodeBlock::setIsNumericCompareFunction):
1228         (JSC::CodeBlock::isNumericCompareFunction):
1229
1230 2009-02-13  Geoffrey Garen  <ggaren@apple.com>
1231
1232         Reviewed by Darin Adler.
1233         
1234         Fixed <rdar://problem/6584057> Optimize sort by JS numeric comparison
1235         function not to run the comparison function
1236         
1237         * bytecode/CodeBlock.cpp:
1238         (JSC::CodeBlock::CodeBlock):
1239         * bytecode/CodeBlock.h:
1240         (JSC::CodeBlock::setIsNumericCompareFunction):
1241         (JSC::CodeBlock::isNumericCompareFunction): Added the ability to track
1242         whether a CodeBlock performs a sort-like numeric comparison.
1243
1244         * bytecompiler/BytecodeGenerator.cpp:
1245         (JSC::BytecodeGenerator::generate): Set the isNumericCompareFunction bit
1246         after compiling.
1247
1248         * parser/Nodes.cpp:
1249         (JSC::FunctionBodyNode::emitBytecode): Fixed a bug that caused us to
1250         codegen an extra return at the end of all functions (eek!), since this
1251         made it harder / weirder to detect the numeric comparison pattern in
1252         bytecode.
1253
1254         * runtime/ArrayPrototype.cpp:
1255         (JSC::arrayProtoFuncSort): Use the isNumericCompareFunction bit to do
1256         a faster sort if we can.
1257
1258         * runtime/FunctionConstructor.cpp:
1259         (JSC::extractFunctionBody):
1260         (JSC::constructFunction):
1261         * runtime/FunctionConstructor.h: Renamed and exported extractFunctionBody for
1262         use in initializing lazyNumericCompareFunction.
1263
1264         * runtime/JSArray.cpp:
1265         (JSC::compareNumbersForQSort):
1266         (JSC::compareByStringPairForQSort):
1267         (JSC::JSArray::sortNumeric):
1268         (JSC::JSArray::sort):
1269         * runtime/JSArray.h: Added a fast numeric sort. Renamed ArrayQSortPair
1270         to be more specific since we do different kinds of qsort now.
1271
1272         * runtime/JSGlobalData.cpp:
1273         (JSC::JSGlobalData::JSGlobalData):
1274         (JSC::JSGlobalData::numericCompareFunction):
1275         (JSC::JSGlobalData::ClientData::~ClientData):
1276         * runtime/JSGlobalData.h: Added helper data for computing the
1277         isNumericCompareFunction bit.
1278
1279 2009-02-13  Darin Adler  <darin@apple.com>
1280
1281         * Configurations/JavaScriptCore.xcconfig: Undo accidental commit of this file.
1282
1283 2009-02-12  Darin Adler  <darin@apple.com>
1284
1285         Reviewed by Oliver Hunt and Alexey Proskuryakov.
1286
1287         Speed up a couple string functions.
1288
1289         * runtime/StringPrototype.cpp:
1290         (JSC::stringProtoFuncIndexOf): Added a fast path for cases where the second
1291         argument is either missing or an integer.
1292         (JSC::stringProtoFuncBig): Use jsNontrivialString since the string is guaranteed
1293         to be 2 or more characters long.
1294         (JSC::stringProtoFuncSmall): Ditto.
1295         (JSC::stringProtoFuncBlink): Ditto.
1296         (JSC::stringProtoFuncBold): Ditto.
1297         (JSC::stringProtoFuncItalics): Ditto.
1298         (JSC::stringProtoFuncStrike): Ditto.
1299         (JSC::stringProtoFuncSub): Ditto.
1300         (JSC::stringProtoFuncSup): Ditto.
1301         (JSC::stringProtoFuncFontcolor): Ditto.
1302         (JSC::stringProtoFuncFontsize): Make the fast path Sam recently added even faster
1303         by avoiding all but the minimum memory allocation.
1304         (JSC::stringProtoFuncAnchor): Use jsNontrivialString.
1305         (JSC::stringProtoFuncLink): Added a fast path.
1306
1307         * runtime/UString.cpp:
1308         (JSC::UString::find): Added a fast path for single-character search strings.
1309
1310 2009-02-13  David Levin  <levin@chromium.org>
1311
1312         Reviewed by Darin Adler.
1313
1314         Bug 23926: Race condition in callOnMainThreadAndWait
1315         <https://bugs.webkit.org/show_bug.cgi?id=23926>
1316
1317         * wtf/MainThread.cpp:
1318         Removed callOnMainThreadAndWait since it isn't used.
1319
1320 2009-02-13  Oliver Hunt  <oliver@apple.com>
1321
1322         Reviewed by Jon Honeycutt.
1323
1324         Math.random is really slow on windows.
1325
1326         Math.random calls WTF::randomNumber which is implemented as
1327         the secure rand_s on windows.  Unfortunately rand_s is an order
1328         of magnitude slower than arc4random.  For this reason I've
1329         added "weakRandomNumber" for use by JavaScript's Math Object.
1330         In the long term we should look at using our own secure PRNG
1331         in place of the system, but this will do for now.
1332
1333         30% win on SunSpider on Windows, resolving most of the remaining
1334         disparity vs. Mac.
1335
1336         * runtime/MathObject.cpp:
1337         (JSC::MathObject::MathObject):
1338         (JSC::mathProtoFuncRandom):
1339         * wtf/RandomNumber.cpp:
1340         (WTF::weakRandomNumber):
1341         (WTF::randomNumber):
1342         * wtf/RandomNumber.h:
1343         * wtf/RandomNumberSeed.h:
1344         (WTF::initializeWeakRandomNumberGenerator):
1345
1346 2009-02-12  Mark Rowe  <mrowe@apple.com>
1347
1348         Fix the build for other platforms.
1349
1350         * wtf/RandomNumber.cpp:
1351         (WTF::randomNumber):
1352
1353 2009-02-12  Gavin Barraclough  <barraclough@apple.com>
1354
1355         Reviewed by Sam Weinig.
1356
1357         Remove (/reduce) use of hard-wired register names from the JIT.
1358         Currently there is no abstraction of registers used in the JIT,
1359         which has a number of negative consequences.  Hard-wiring x86
1360         register names makes the JIT less portable to other platforms,
1361         and prevents us from performing dynamic register allocation to
1362         attempt to maintain more temporary values in machine registers.
1363         (The latter will be more important on x86-64, where we have more
1364         registers to make use of).
1365
1366         Also, remove MacroAssembler::mod32.  This was not providing a
1367         useful abstraction, and was not in keeping with the rest of the
1368         MacroAssembler interface, in having specific register requirements.
1369
1370         * assembler/MacroAssemblerX86Common.h:
1371         * jit/JIT.cpp:
1372         (JSC::JIT::compileOpStrictEq):
1373         (JSC::JIT::emitSlowScriptCheck):
1374         (JSC::JIT::privateCompileMainPass):
1375         (JSC::JIT::privateCompileSlowCases):
1376         (JSC::JIT::privateCompile):
1377         (JSC::JIT::privateCompileCTIMachineTrampolines):
1378         * jit/JIT.h:
1379         * jit/JITArithmetic.cpp:
1380         (JSC::JIT::compileFastArith_op_lshift):
1381         (JSC::JIT::compileFastArithSlow_op_lshift):
1382         (JSC::JIT::compileFastArith_op_rshift):
1383         (JSC::JIT::compileFastArithSlow_op_rshift):
1384         (JSC::JIT::compileFastArith_op_bitand):
1385         (JSC::JIT::compileFastArithSlow_op_bitand):
1386         (JSC::JIT::compileFastArith_op_mod):
1387         (JSC::JIT::compileFastArithSlow_op_mod):
1388         (JSC::JIT::compileFastArith_op_post_inc):
1389         (JSC::JIT::compileFastArithSlow_op_post_inc):
1390         (JSC::JIT::compileFastArith_op_post_dec):
1391         (JSC::JIT::compileFastArithSlow_op_post_dec):
1392         (JSC::JIT::compileFastArith_op_pre_inc):
1393         (JSC::JIT::compileFastArithSlow_op_pre_inc):
1394         (JSC::JIT::compileFastArith_op_pre_dec):
1395         (JSC::JIT::compileFastArithSlow_op_pre_dec):
1396         (JSC::JIT::compileFastArith_op_add):
1397         (JSC::JIT::compileFastArith_op_mul):
1398         (JSC::JIT::compileFastArith_op_sub):
1399         (JSC::JIT::compileBinaryArithOp):
1400         * jit/JITCall.cpp:
1401         (JSC::JIT::compileOpCallInitializeCallFrame):
1402         (JSC::JIT::compileOpCallSetupArgs):
1403         (JSC::JIT::compileOpCallEvalSetupArgs):
1404         (JSC::JIT::compileOpConstructSetupArgs):
1405         (JSC::JIT::compileOpCall):
1406         (JSC::JIT::compileOpCallSlowCase):
1407         * jit/JITInlineMethods.h:
1408         (JSC::JIT::emitGetVirtualRegister):
1409         (JSC::JIT::emitPutVirtualRegister):
1410         (JSC::JIT::emitNakedCall):
1411         (JSC::JIT::restoreArgumentReference):
1412         (JSC::JIT::restoreArgumentReferenceForTrampoline):
1413         * jit/JITPropertyAccess.cpp:
1414         (JSC::JIT::compileGetByIdHotPath):
1415         (JSC::JIT::compilePutByIdHotPath):
1416         (JSC::JIT::compileGetByIdSlowCase):
1417         (JSC::JIT::compilePutByIdSlowCase):
1418         (JSC::JIT::privateCompilePutByIdTransition):
1419         (JSC::JIT::privateCompilePatchGetArrayLength):
1420         (JSC::JIT::privateCompileGetByIdSelf):
1421         (JSC::JIT::privateCompileGetByIdProto):
1422         (JSC::JIT::privateCompileGetByIdSelfList):
1423         (JSC::JIT::privateCompileGetByIdProtoList):
1424         (JSC::JIT::privateCompileGetByIdChainList):
1425         (JSC::JIT::privateCompileGetByIdChain):
1426         (JSC::JIT::privateCompilePutByIdReplace):
1427
1428 2009-02-12  Horia Olaru  <olaru@adobe.com>
1429
1430         Reviewed by Oliver Hunt.
1431
1432         https://bugs.webkit.org/show_bug.cgi?id=23400
1433
1434         When throwing an exception within an eval argument string, the dst parameter was
1435         modified in the functions below and the return value for eval was altered. Changed
1436         the emitNode call in JSC::ThrowNode::emitBytecode to use a temporary register
1437         to store its results instead of dst. The JSC::FunctionCallResolveNode::emitBytecode
1438         would load the function within the dst registry, also altering the result returned
1439         by eval. Replaced it with another temporary.
1440
1441         * parser/Nodes.cpp:
1442         (JSC::FunctionCallResolveNode::emitBytecode):
1443         (JSC::ThrowNode::emitBytecode):
1444
1445 2009-02-12  Sam Weinig  <sam@webkit.org>
1446
1447         Reviewed by Geoffrey Garen.
1448
1449         Speed up String.prototype.fontsize.
1450
1451         * runtime/StringPrototype.cpp:
1452         (JSC::stringProtoFuncFontsize): Specialize for defined/commonly used values.
1453
1454 2009-02-12  Geoffrey Garen  <ggaren@apple.com>
1455
1456         Reviewed by Sam Weinig.
1457         
1458         Correctness fix.
1459
1460         * wtf/RandomNumber.cpp:
1461         (WTF::randomNumber): Divide by the maximum representable value, which
1462         is different on each platform now, to get values between 0 and 1.
1463
1464 2009-02-12  Geoffrey Garen  <ggaren@apple.com>
1465
1466         Build fix.
1467
1468         * wtf/RandomNumber.cpp:
1469         (WTF::randomNumber):
1470
1471 2009-02-12  Geoffrey Garen  <ggaren@apple.com>
1472
1473         Reviewed by Sam Weinig.
1474         
1475         Fixed <rdar://problem/6582048>.
1476
1477         * wtf/RandomNumber.cpp:
1478         (WTF::randomNumber): Make only one call to the random number generator
1479         on platforms where the generator is cryptographically secure. The value
1480         of randomness over and above cryptographically secure randomness is not
1481         clear, and it caused some performance problems.
1482
1483 2009-02-12  Adam Roben  <aroben@apple.com>
1484
1485         Fix lots of Perl warnings when building JavaScriptCoreGenerated on
1486         Windows
1487
1488         Reviewed by John Sullivan.
1489
1490         * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
1491         Create the docs/ directory so that we can write bytecode.html into it.
1492         This matches what JavaScriptCore.xcodeproj does.
1493
1494 2009-02-12  Simon Hausmann  <simon.hausmann@nokia.com>
1495
1496         Rubber-stamped by Lars.
1497
1498         Re-enable the JIT in the Qt build with -fno-stack-protector on Linux.
1499
1500         * JavaScriptCore.pri:
1501
1502 2009-02-11  Dmitry Titov  <dimich@chromium.org>
1503
1504         Reviewed by Alexey Proskuryakov.
1505
1506         https://bugs.webkit.org/show_bug.cgi?id=23705
1507         Fix the UI freeze caused by Worker generating a flood of messages.
1508         Measure time we spend in executing posted work items. If too much time is spent
1509         without returning to the run loop, exit and reschedule.
1510
1511         * wtf/MainThread.h:
1512         Added initializeMainThreadPlatform() to initialize low-level mechanism for posting
1513         work items from thread to thread. This removes #ifdefs for WIN and CHROMIUM from platform-independent code.
1514
1515         * wtf/MainThread.cpp:
1516         (WTF::initializeMainThread):
1517         (WTF::dispatchFunctionsFromMainThread):
1518         Instead of dispatching all work items in the queue, dispatch them one by one
1519         and measure elapsed time. After a threshold, reschedule and quit.
1520
1521         (WTF::callOnMainThread):
1522         (WTF::callOnMainThreadAndWait):
1523         Only schedule dispatch if the queue was empty - to avoid many posted messages in the run loop queue.
1524
1525         * wtf/mac/MainThreadMac.mm:
1526         (WTF::scheduleDispatchFunctionsOnMainThread):
1527         Use static instance of the mainThreadCaller instead of allocating and releasing it each time.
1528         (WTF::initializeMainThreadPlatform):
1529         * wtf/gtk/MainThreadChromium.cpp:
1530         (WTF::initializeMainThreadPlatform):
1531         * wtf/gtk/MainThreadGtk.cpp:
1532         (WTF::initializeMainThreadPlatform):
1533         * wtf/qt/MainThreadQt.cpp:
1534         (WTF::initializeMainThreadPlatform):
1535         * wtf/win/MainThreadWin.cpp:
1536         (WTF::initializeMainThreadPlatform):
1537         * wtf/wx/MainThreadWx.cpp:
1538         (WTF::initializeMainThreadPlatform):
1539
1540 2009-02-11  Sam Weinig  <sam@webkit.org>
1541
1542         Reviewed by Gavin Barraclough.
1543
1544         Style cleanup.
1545
1546         * assembler/AbstractMacroAssembler.h:
1547         (JSC::AbstractMacroAssembler::CodeLocationCommon::CodeLocationCommon):
1548         (JSC::AbstractMacroAssembler::CodeLocationCommon::operator bool):
1549         (JSC::AbstractMacroAssembler::CodeLocationCommon::reset):
1550         (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForSwitch):
1551         (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForExceptionHandler):
1552         (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForJSR):
1553         (JSC::AbstractMacroAssembler::CodeLocationLabel::getJumpDestination):
1554         (JSC::AbstractMacroAssembler::CodeLocationJump::relink):
1555         (JSC::AbstractMacroAssembler::CodeLocationJump::CodeLocationJump):
1556         (JSC::AbstractMacroAssembler::CodeLocationCall::relink):
1557         (JSC::AbstractMacroAssembler::CodeLocationCall::calleeReturnAddressValue):
1558         (JSC::AbstractMacroAssembler::CodeLocationCall::CodeLocationCall):
1559         (JSC::AbstractMacroAssembler::CodeLocationDataLabel32::repatch):
1560         (JSC::AbstractMacroAssembler::CodeLocationDataLabel32::CodeLocationDataLabel32):
1561         (JSC::AbstractMacroAssembler::CodeLocationDataLabelPtr::repatch):
1562         (JSC::AbstractMacroAssembler::CodeLocationDataLabelPtr::CodeLocationDataLabelPtr):
1563         (JSC::AbstractMacroAssembler::ProcessorReturnAddress::ProcessorReturnAddress):
1564         (JSC::AbstractMacroAssembler::ProcessorReturnAddress::relinkCallerToFunction):
1565         (JSC::AbstractMacroAssembler::ProcessorReturnAddress::operator void*):
1566         (JSC::AbstractMacroAssembler::PatchBuffer::link):
1567         (JSC::::CodeLocationCommon::labelAtOffset):
1568         (JSC::::CodeLocationCommon::jumpAtOffset):
1569         (JSC::::CodeLocationCommon::callAtOffset):
1570         (JSC::::CodeLocationCommon::dataLabelPtrAtOffset):
1571         (JSC::::CodeLocationCommon::dataLabel32AtOffset):
1572
1573 2009-02-11  Sam Weinig  <sam@webkit.org>
1574
1575         Reviewed by Gavin Barraclough.
1576
1577         * assembler/AbstractMacroAssembler.h: Fix comments.
1578
1579 2009-02-11  Alexey Proskuryakov  <ap@webkit.org>
1580
1581         Trying to fix wx build.
1582
1583         * bytecode/JumpTable.h: Include "MacroAssembler.h", not <MacroAssembler.h>.
1584         * jscore.bkl: Added assembler directory to search paths.
1585
1586 2009-02-10  Gavin Barraclough  <barraclough@apple.com>
1587
1588         Build
1589         fix.
1590         (Narrow
1591         changelog
1592         for
1593         dhyatt).
1594
1595         * bytecode/Instruction.h:
1596         (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::set):
1597         (JSC::PolymorphicAccessStructureList::PolymorphicAccessStructureList):
1598
1599 2009-02-10  Gavin Barraclough  <barraclough@apple.com>
1600
1601         Reviewed by Oliver Hunt.
1602
1603         Reduce use of void* / reinterpret_cast in JIT repatching code,
1604         add strong types for Calls and for the various types of pointers
1605         we retain into the JIT generated instruction stream.
1606
1607         No performance impact.
1608
1609         * assembler/AbstractMacroAssembler.h:
1610         (JSC::AbstractMacroAssembler::ImmPtr::ImmPtr):
1611         (JSC::AbstractMacroAssembler::ImmPtr::asIntptr):
1612         (JSC::AbstractMacroAssembler::Imm32::Imm32):
1613         (JSC::AbstractMacroAssembler::Label::Label):
1614         (JSC::AbstractMacroAssembler::DataLabelPtr::DataLabelPtr):
1615         (JSC::AbstractMacroAssembler::Call::Call):
1616         (JSC::AbstractMacroAssembler::Call::link):
1617         (JSC::AbstractMacroAssembler::Call::linkTo):
1618         (JSC::AbstractMacroAssembler::Jump::Jump):
1619         (JSC::AbstractMacroAssembler::Jump::linkTo):
1620         (JSC::AbstractMacroAssembler::CodeLocationCommon::CodeLocationCommon):
1621         (JSC::AbstractMacroAssembler::CodeLocationCommon::operator bool):
1622         (JSC::AbstractMacroAssembler::CodeLocationCommon::reset):
1623         (JSC::AbstractMacroAssembler::CodeLocationLabel::CodeLocationLabel):
1624         (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForSwitch):
1625         (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForExceptionHandler):
1626         (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForJSR):
1627         (JSC::AbstractMacroAssembler::CodeLocationLabel::getJumpDestination):
1628         (JSC::AbstractMacroAssembler::CodeLocationJump::CodeLocationJump):
1629         (JSC::AbstractMacroAssembler::CodeLocationJump::relink):
1630         (JSC::AbstractMacroAssembler::CodeLocationCall::CodeLocationCall):
1631         (JSC::AbstractMacroAssembler::CodeLocationCall::relink):
1632         (JSC::AbstractMacroAssembler::CodeLocationCall::calleeReturnAddressValue):
1633         (JSC::AbstractMacroAssembler::CodeLocationDataLabel32::CodeLocationDataLabel32):
1634         (JSC::AbstractMacroAssembler::CodeLocationDataLabel32::repatch):
1635         (JSC::AbstractMacroAssembler::CodeLocationDataLabelPtr::CodeLocationDataLabelPtr):
1636         (JSC::AbstractMacroAssembler::CodeLocationDataLabelPtr::repatch):
1637         (JSC::AbstractMacroAssembler::ProcessorReturnAddress::ProcessorReturnAddress):
1638         (JSC::AbstractMacroAssembler::ProcessorReturnAddress::relinkCallerToFunction):
1639         (JSC::AbstractMacroAssembler::ProcessorReturnAddress::operator void*):
1640         (JSC::AbstractMacroAssembler::PatchBuffer::entry):
1641         (JSC::AbstractMacroAssembler::PatchBuffer::trampolineAt):
1642         (JSC::AbstractMacroAssembler::PatchBuffer::link):
1643         (JSC::AbstractMacroAssembler::PatchBuffer::linkTailRecursive):
1644         (JSC::AbstractMacroAssembler::PatchBuffer::patch):
1645         (JSC::AbstractMacroAssembler::PatchBuffer::locationOf):
1646         (JSC::AbstractMacroAssembler::PatchBuffer::returnAddressOffset):
1647         (JSC::AbstractMacroAssembler::differenceBetween):
1648         (JSC::::CodeLocationCommon::labelAtOffset):
1649         (JSC::::CodeLocationCommon::jumpAtOffset):
1650         (JSC::::CodeLocationCommon::callAtOffset):
1651         (JSC::::CodeLocationCommon::dataLabelPtrAtOffset):
1652         (JSC::::CodeLocationCommon::dataLabel32AtOffset):
1653         * assembler/MacroAssemblerX86Common.h:
1654         (JSC::MacroAssemblerX86Common::call):
1655         * assembler/X86Assembler.h:
1656         (JSC::X86Assembler::getCallReturnOffset):
1657         * bytecode/CodeBlock.h:
1658         (JSC::CallLinkInfo::CallLinkInfo):
1659         (JSC::getStructureStubInfoReturnLocation):
1660         (JSC::getCallLinkInfoReturnLocation):
1661         * bytecode/Instruction.h:
1662         (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::set):
1663         (JSC::PolymorphicAccessStructureList::PolymorphicAccessStructureList):
1664         * bytecode/JumpTable.h:
1665         (JSC::StringJumpTable::ctiForValue):
1666         (JSC::SimpleJumpTable::ctiForValue):
1667         * bytecode/StructureStubInfo.h:
1668         (JSC::StructureStubInfo::StructureStubInfo):
1669         * bytecompiler/BytecodeGenerator.cpp:
1670         (JSC::BytecodeGenerator::emitCatch):
1671         (JSC::prepareJumpTableForStringSwitch):
1672         * interpreter/Interpreter.cpp:
1673         (JSC::Interpreter::cti_op_get_by_id_self_fail):
1674         (JSC::getPolymorphicAccessStructureListSlot):
1675         (JSC::Interpreter::cti_op_throw):
1676         (JSC::Interpreter::cti_op_switch_imm):
1677         (JSC::Interpreter::cti_op_switch_char):
1678         (JSC::Interpreter::cti_op_switch_string):
1679         (JSC::Interpreter::cti_vm_throw):
1680         * jit/JIT.cpp:
1681         (JSC::ctiSetReturnAddress):
1682         (JSC::ctiPatchCallByReturnAddress):
1683         (JSC::JIT::privateCompile):
1684         (JSC::JIT::privateCompileCTIMachineTrampolines):
1685         * jit/JIT.h:
1686         (JSC::CallRecord::CallRecord):
1687         (JSC::JIT::compileGetByIdSelf):
1688         (JSC::JIT::compileGetByIdProto):
1689         (JSC::JIT::compileGetByIdChain):
1690         (JSC::JIT::compilePutByIdReplace):
1691         (JSC::JIT::compilePutByIdTransition):
1692         (JSC::JIT::compilePatchGetArrayLength):
1693         (JSC::JIT::emitCTICall):
1694         * jit/JITCall.cpp:
1695         (JSC::JIT::unlinkCall):
1696         (JSC::JIT::linkCall):
1697         * jit/JITInlineMethods.h:
1698         (JSC::JIT::emitNakedCall):
1699         (JSC::JIT::emitCTICall_internal):
1700         * jit/JITPropertyAccess.cpp:
1701         (JSC::JIT::compileGetByIdSlowCase):
1702         (JSC::JIT::compilePutByIdSlowCase):
1703         (JSC::JIT::privateCompilePutByIdTransition):
1704         (JSC::JIT::patchGetByIdSelf):
1705         (JSC::JIT::patchPutByIdReplace):
1706         (JSC::JIT::privateCompilePatchGetArrayLength):
1707         (JSC::JIT::privateCompileGetByIdSelf):
1708         (JSC::JIT::privateCompileGetByIdProto):
1709         (JSC::JIT::privateCompileGetByIdSelfList):
1710         (JSC::JIT::privateCompileGetByIdProtoList):
1711         (JSC::JIT::privateCompileGetByIdChainList):
1712         (JSC::JIT::privateCompileGetByIdChain):
1713         (JSC::JIT::privateCompilePutByIdReplace):
1714
1715 2009-02-10  Adam Roben  <aroben@apple.com>
1716
1717         Windows build fix after r40813
1718
1719         * JavaScriptCore.vcproj/jsc/jsc.vcproj: Added profiler/ to the include
1720         path so that Profiler.h can be found.
1721
1722 2009-02-09  Gavin Barraclough  <barraclough@apple.com>
1723
1724         Reviewed by Oliver Hunt.
1725
1726         Provide a class type for a generated block of JIT code.
1727         Also changes the return address -> bytecode index map to
1728         track the return addess as an unsigned offset into the code
1729         instead of a ptrdiff_t in terms of void**s - the latter is
1730         equal to the actual offset / sizeof(void*), making it a
1731         potentially lossy representation.
1732
1733         * JavaScriptCore.xcodeproj/project.pbxproj:
1734         * assembler/AbstractMacroAssembler.h:
1735         (JSC::AbstractMacroAssembler::PatchBuffer::returnAddressOffset):
1736         * assembler/X86Assembler.h:
1737         (JSC::X86Assembler::getCallReturnOffset):
1738         * bytecode/CodeBlock.h:
1739         (JSC::CallReturnOffsetToBytecodeIndex::CallReturnOffsetToBytecodeIndex):
1740         (JSC::getCallReturnOffset):
1741         (JSC::CodeBlock::getBytecodeIndex):
1742         (JSC::CodeBlock::jitCode):
1743         (JSC::CodeBlock::callReturnIndexVector):
1744         * interpreter/Interpreter.cpp:
1745         (JSC::Interpreter::execute):
1746         (JSC::Interpreter::cti_vm_dontLazyLinkCall):
1747         (JSC::Interpreter::cti_vm_lazyLinkCall):
1748         * jit/JIT.cpp:
1749         (JSC::JIT::privateCompile):
1750         * jit/JIT.h:
1751         (JSC::):
1752         * jit/JITCall.cpp:
1753         (JSC::JIT::linkCall):
1754         * jit/JITCode.h: Added.
1755         (JSC::):
1756         (JSC::JITCode::JITCode):
1757         (JSC::JITCode::operator bool):
1758         (JSC::JITCode::addressForCall):
1759         (JSC::JITCode::offsetOf):
1760         (JSC::JITCode::execute):
1761
1762 2009-02-09  John Grabowski  <jrg@chromium.org>
1763
1764         Reviewed by Darin Adler.
1765
1766         https://bugs.webkit.org/show_bug.cgi?id=23856
1767         Change the definition of "main thread" for Chromium on OSX.
1768         It does not match the DARWIN definition.
1769
1770         * wtf/ThreadingPthreads.cpp:
1771         (WTF::initializeThreading):
1772         (WTF::isMainThread):
1773
1774 2009-02-09  Gavin Barraclough  <barraclough@apple.com>
1775
1776         Reviewed by Oliver Hunt.
1777
1778         Minor bugfix, incorrect check meant that subtraction causing integer overflow
1779         would be missed on x86-64 JIT.
1780
1781         * jit/JITArithmetic.cpp:
1782         (JSC::JIT::compileBinaryArithOp):
1783
1784 2009-02-09  Gavin Barraclough  <barraclough@apple.com>
1785
1786         Reviewed by Oliver Hunt.
1787
1788         A more sensible register allocation for x86-64.
1789
1790         When WREC was ported to x86-64 it stuck with the same register allocation as x86.
1791         This requires registers to be reordered on entry into WREC generated code, since
1792         argument passing is different on x86-64 and x86 (regparm(3)).  This patch switches
1793         x86-64 to use a native register allocation, that does not require argument registers
1794         to be reordered.
1795
1796         * wrec/WRECGenerator.cpp:
1797         (JSC::WREC::Generator::generateEnter):
1798         (JSC::WREC::Generator::generateReturnSuccess):
1799         (JSC::WREC::Generator::generateReturnFailure):
1800         * wrec/WRECGenerator.h:
1801
1802 2009-02-05  Adam Roben  <aroben@apple.com>
1803
1804         Build fix
1805
1806         Rubberstamped by Sam Weinig.
1807
1808         * wtf/TypeTraits.h: Include Platform.h, since this header uses macros
1809         defined there.
1810
1811 2009-02-05  Dimitri Glazkov  <dglazkov@chromium.org>
1812
1813         Reviewed by Eric Seidel.
1814
1815         https://bugs.webkit.org/show_bug.cgi?id=23747
1816         Add Chromium threading-related files.
1817
1818         * wtf/MainThread.cpp: Added platform guard to initializeMainThread.
1819         * wtf/chromium/ChromiumThreading.h: Added.
1820         * wtf/chromium/MainThreadChromium.cpp: Added.
1821         (WTF::initializeMainThread):
1822         (WTF::scheduleDispatchFunctionsOnMainThread):
1823
1824 2009-02-05  David Levin  <levin@chromium.org>
1825
1826         Reviewed by Darin Adler.
1827
1828         Bug 23713: COMPILE_ASSERTS should be moved out of TypeTraits.h and into .cpp file
1829         <https://bugs.webkit.org/show_bug.cgi?id=23713>
1830
1831         * GNUmakefile.am:
1832         * JavaScriptCore.pri:
1833         * JavaScriptCore.scons:
1834         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
1835         * JavaScriptCore.xcodeproj/project.pbxproj:
1836         * JavaScriptCoreSources.bkl:
1837
1838         * wtf/HashTraits.h:
1839         Remove unnecessary header file that I missed when moving out the type traits form this file.
1840
1841         * wtf/TypeTraits.cpp: Added.
1842         (WTF::):
1843         * wtf/TypeTraits.h:
1844         Moved the compile asserts into TypeTraits.cpp file.
1845
1846 2009-02-04  Gavin Barraclough  <barraclough@apple.com>
1847
1848         Reviewed by Oliver 'the nun' Hunt.
1849
1850         Add -e switch to jsc to enable evaluation of scripts passed on the command line.
1851
1852         * jsc.cpp:
1853         (Script::Script):
1854         (runWithScripts):
1855         (printUsageStatement):
1856         (parseArguments):
1857         (jscmain):
1858
1859 2009-02-04  Gavin Barraclough  <barraclough@apple.com>
1860
1861         Rubber stamped by Sam 'Big Mac' Weinig.
1862
1863         * assembler/AbstractMacroAssembler.h: Copied from assembler/MacroAssembler.h.
1864         * assembler/MacroAssemblerX86.h: Copied from assembler/MacroAssembler.h.
1865         * assembler/MacroAssemblerX86Common.h: Copied from assembler/MacroAssembler.h.
1866         * assembler/MacroAssemblerX86_64.h: Copied from assembler/MacroAssembler.h.
1867
1868 2009-02-04  Gavin Barraclough  <barraclough@apple.com>
1869
1870         Reviewed by Sam Weinig.
1871
1872         This patch tidies up the MacroAssembler, cleaning up the code and refactoring out the
1873         platform-specific parts.  The MacroAssembler gets split up like a beef burger, with the
1874         platform-agnostic data types being the lower bun (in the form of the class AbstractMacroAssembler),
1875         the plaform-specific code generation forming a big meaty patty of methods like 'add32',
1876         'branch32', etc (MacroAssemblerX86), and finally topped off with the bun-lid of the
1877         MacroAssembler class itself, providing covenience methods such as the stack peek & poke,
1878         and backwards branch methods, all of which can be described in a platform independent
1879         way using methods from the base class.  The AbstractMacroAssembler is templated on the
1880         type of the assembler class that will be used for code generation, and the three layers
1881         are held together with the cocktail stick of inheritance.
1882
1883         The above description is a slight simplification since the MacroAssemblerX86 is actually
1884         formed from two layers (in effect giving us a kind on bacon double cheeseburger) - with the
1885         bulk of methods that are common between x86 & x86-64 implemented in MacroAssemblerX86Common,
1886         which forms a base class for MacroAssemblerX86 and MacroAssemblerX86_64 (which add the methods
1887         specific to the given platform).
1888
1889         I'm landing these changes first without splitting the classes across multiple files,
1890         I will follow up with a second patch to split up the file MacroAssembler.h.
1891
1892         * assembler/MacroAssembler.h:
1893         (JSC::AbstractMacroAssembler::):
1894         (JSC::AbstractMacroAssembler::DataLabelPtr::DataLabelPtr):
1895         (JSC::AbstractMacroAssembler::DataLabelPtr::patch):
1896         (JSC::AbstractMacroAssembler::DataLabel32::DataLabel32):
1897         (JSC::AbstractMacroAssembler::DataLabel32::patch):
1898         (JSC::AbstractMacroAssembler::Label::Label):
1899         (JSC::AbstractMacroAssembler::Jump::Jump):
1900         (JSC::AbstractMacroAssembler::Jump::link):
1901         (JSC::AbstractMacroAssembler::Jump::linkTo):
1902         (JSC::AbstractMacroAssembler::Jump::patch):
1903         (JSC::AbstractMacroAssembler::JumpList::link):
1904         (JSC::AbstractMacroAssembler::JumpList::linkTo):
1905         (JSC::AbstractMacroAssembler::PatchBuffer::link):
1906         (JSC::AbstractMacroAssembler::PatchBuffer::addressOf):
1907         (JSC::AbstractMacroAssembler::PatchBuffer::setPtr):
1908         (JSC::AbstractMacroAssembler::size):
1909         (JSC::AbstractMacroAssembler::copyCode):
1910         (JSC::AbstractMacroAssembler::label):
1911         (JSC::AbstractMacroAssembler::align):
1912         (JSC::AbstractMacroAssembler::differenceBetween):
1913         (JSC::MacroAssemblerX86Common::xor32):
1914         (JSC::MacroAssemblerX86Common::load32WithAddressOffsetPatch):
1915         (JSC::MacroAssemblerX86Common::store32WithAddressOffsetPatch):
1916         (JSC::MacroAssemblerX86Common::move):
1917         (JSC::MacroAssemblerX86Common::swap):
1918         (JSC::MacroAssemblerX86Common::signExtend32ToPtr):
1919         (JSC::MacroAssemblerX86Common::zeroExtend32ToPtr):
1920         (JSC::MacroAssemblerX86Common::branch32):
1921         (JSC::MacroAssemblerX86Common::jump):
1922         (JSC::MacroAssemblerX86_64::add32):
1923         (JSC::MacroAssemblerX86_64::sub32):
1924         (JSC::MacroAssemblerX86_64::load32):
1925         (JSC::MacroAssemblerX86_64::store32):
1926         (JSC::MacroAssemblerX86_64::addPtr):
1927         (JSC::MacroAssemblerX86_64::andPtr):
1928         (JSC::MacroAssemblerX86_64::orPtr):
1929         (JSC::MacroAssemblerX86_64::rshiftPtr):
1930         (JSC::MacroAssemblerX86_64::subPtr):
1931         (JSC::MacroAssemblerX86_64::xorPtr):
1932         (JSC::MacroAssemblerX86_64::loadPtr):
1933         (JSC::MacroAssemblerX86_64::loadPtrWithAddressOffsetPatch):
1934         (JSC::MacroAssemblerX86_64::storePtr):
1935         (JSC::MacroAssemblerX86_64::storePtrWithAddressOffsetPatch):
1936         (JSC::MacroAssemblerX86_64::branchPtr):
1937         (JSC::MacroAssemblerX86_64::branchTestPtr):
1938         (JSC::MacroAssemblerX86_64::branchAddPtr):
1939         (JSC::MacroAssemblerX86_64::branchSubPtr):
1940         (JSC::MacroAssemblerX86_64::branchPtrWithPatch):
1941         (JSC::MacroAssemblerX86_64::storePtrWithPatch):
1942         (JSC::MacroAssemblerX86::add32):
1943         (JSC::MacroAssemblerX86::sub32):
1944         (JSC::MacroAssemblerX86::load32):
1945         (JSC::MacroAssemblerX86::store32):
1946         (JSC::MacroAssemblerX86::branch32):
1947         (JSC::MacroAssemblerX86::branchPtrWithPatch):
1948         (JSC::MacroAssemblerX86::storePtrWithPatch):
1949         (JSC::MacroAssembler::pop):
1950         (JSC::MacroAssembler::peek):
1951         (JSC::MacroAssembler::poke):
1952         (JSC::MacroAssembler::branchPtr):
1953         (JSC::MacroAssembler::branch32):
1954         (JSC::MacroAssembler::branch16):
1955         (JSC::MacroAssembler::branchTestPtr):
1956         (JSC::MacroAssembler::addPtr):
1957         (JSC::MacroAssembler::andPtr):
1958         (JSC::MacroAssembler::orPtr):
1959         (JSC::MacroAssembler::rshiftPtr):
1960         (JSC::MacroAssembler::subPtr):
1961         (JSC::MacroAssembler::xorPtr):
1962         (JSC::MacroAssembler::loadPtr):
1963         (JSC::MacroAssembler::loadPtrWithAddressOffsetPatch):
1964         (JSC::MacroAssembler::storePtr):
1965         (JSC::MacroAssembler::storePtrWithAddressOffsetPatch):
1966         (JSC::MacroAssembler::branchAddPtr):
1967         (JSC::MacroAssembler::branchSubPtr):
1968         * jit/JITArithmetic.cpp:
1969         (JSC::JIT::compileBinaryArithOp):
1970
1971 2009-02-04  Alexey Proskuryakov  <ap@webkit.org>
1972
1973         Reviewed by Sam Weinig.
1974
1975         https://bugs.webkit.org/show_bug.cgi?id=23681
1976         Worker tests crash in debug builds if run --singly
1977
1978         The crash happened because worker threads continued running while debug-only static objects
1979         were already being destroyed on main thread.
1980
1981         * runtime/Structure.cpp: Create static debug-only sets in heap, so that they don't get
1982         destroyed.
1983
1984         * wtf/ThreadingPthreads.cpp: Changed assertions to conventional form.
1985
1986 2009-02-03  Gavin Barraclough  <barraclough@apple.com>
1987
1988         Reviewed by Geoff Garen.
1989
1990         https://bugs.webkit.org/show_bug.cgi?id=23715
1991
1992         Simplify MacroAssembler interface, by combining comparison methods.
1993         Seprate operations are combined as follows:
1994             jz32/jnz32/jzPtr/jnzPtr -> branchTest32/branchTestPtr,
1995             j*(Add|Mul|Sub)32/j*(Add|Mul|Sub)Ptr -> branch(Add|Mul|Sub)32/branch(Add|Mul|Sub)Ptr
1996             j*32/j*Ptr (all other two op combparisons) -> branch32/brnachPtr
1997             set*32 -> set32
1998
1999         Also, represent the Scale of BaseIndex addresses as a plain enum (0,1,2,3),
2000         instead of as multiplicands (1,2,4,8).
2001
2002         This patch singificantly reduces replication of code, and increases functionality supported
2003         by the MacroAssembler.  No performance impact.
2004
2005         * assembler/MacroAssembler.h:
2006         (JSC::MacroAssembler::):
2007         (JSC::MacroAssembler::branchPtr):
2008         (JSC::MacroAssembler::branchPtrWithPatch):
2009         (JSC::MacroAssembler::branch32):
2010         (JSC::MacroAssembler::branch16):
2011         (JSC::MacroAssembler::branchTestPtr):
2012         (JSC::MacroAssembler::branchTest32):
2013         (JSC::MacroAssembler::branchAddPtr):
2014         (JSC::MacroAssembler::branchAdd32):
2015         (JSC::MacroAssembler::branchMul32):
2016         (JSC::MacroAssembler::branchSubPtr):
2017         (JSC::MacroAssembler::branchSub32):
2018         (JSC::MacroAssembler::set32):
2019         (JSC::MacroAssembler::setTest32):
2020         * assembler/X86Assembler.h:
2021         (JSC::X86Assembler::):
2022         (JSC::X86Assembler::jccRel32):
2023         (JSC::X86Assembler::setccOpcode):
2024         (JSC::X86Assembler::cmpq_mr):
2025         (JSC::X86Assembler::setcc_r):
2026         (JSC::X86Assembler::sete_r):
2027         (JSC::X86Assembler::setne_r):
2028         (JSC::X86Assembler::jne):
2029         (JSC::X86Assembler::je):
2030         (JSC::X86Assembler::jl):
2031         (JSC::X86Assembler::jb):
2032         (JSC::X86Assembler::jle):
2033         (JSC::X86Assembler::jbe):
2034         (JSC::X86Assembler::jge):
2035         (JSC::X86Assembler::jg):
2036         (JSC::X86Assembler::ja):
2037         (JSC::X86Assembler::jae):
2038         (JSC::X86Assembler::jo):
2039         (JSC::X86Assembler::jp):
2040         (JSC::X86Assembler::js):
2041         (JSC::X86Assembler::jcc):
2042         (JSC::X86Assembler::X86InstructionFormatter::putModRmSib):
2043         * jit/JIT.cpp:
2044         (JSC::JIT::compileOpStrictEq):
2045         (JSC::JIT::emitSlowScriptCheck):
2046         (JSC::JIT::privateCompileMainPass):
2047         (JSC::JIT::privateCompileSlowCases):
2048         (JSC::JIT::privateCompile):
2049         (JSC::JIT::privateCompileCTIMachineTrampolines):
2050         * jit/JITArithmetic.cpp:
2051         (JSC::JIT::compileFastArith_op_lshift):
2052         (JSC::JIT::compileFastArith_op_mod):
2053         (JSC::JIT::compileFastArith_op_post_inc):
2054         (JSC::JIT::compileFastArith_op_post_dec):
2055         (JSC::JIT::compileFastArith_op_pre_inc):
2056         (JSC::JIT::compileFastArith_op_pre_dec):
2057         (JSC::JIT::compileBinaryArithOp):
2058         (JSC::JIT::compileFastArith_op_add):
2059         (JSC::JIT::compileFastArith_op_mul):
2060         * jit/JITCall.cpp:
2061         (JSC::JIT::compileOpCall):
2062         (JSC::JIT::compileOpCallSlowCase):
2063         * jit/JITInlineMethods.h:
2064         (JSC::JIT::checkStructure):
2065         (JSC::JIT::emitJumpIfJSCell):
2066         (JSC::JIT::emitJumpIfNotJSCell):
2067         (JSC::JIT::emitJumpIfImmediateNumber):
2068         (JSC::JIT::emitJumpIfNotImmediateNumber):
2069         (JSC::JIT::emitJumpIfImmediateInteger):
2070         (JSC::JIT::emitJumpIfNotImmediateInteger):
2071         (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero):
2072         * jit/JITPropertyAccess.cpp:
2073         (JSC::JIT::compileGetByIdHotPath):
2074         (JSC::JIT::compilePutByIdHotPath):
2075         (JSC::JIT::privateCompilePutByIdTransition):
2076         (JSC::JIT::privateCompilePatchGetArrayLength):
2077         (JSC::JIT::privateCompileGetByIdProto):
2078         (JSC::JIT::privateCompileGetByIdProtoList):
2079         (JSC::JIT::privateCompileGetByIdChainList):
2080         (JSC::JIT::privateCompileGetByIdChain):
2081         * runtime/RegExp.cpp:
2082         (JSC::RegExp::match):
2083         * wrec/WRECGenerator.cpp:
2084         (JSC::WREC::Generator::generateEnter):
2085         (JSC::WREC::Generator::generateIncrementIndex):
2086         (JSC::WREC::Generator::generateLoadCharacter):
2087         (JSC::WREC::Generator::generateJumpIfNotEndOfInput):
2088         (JSC::WREC::Generator::generateBackreferenceQuantifier):
2089         (JSC::WREC::Generator::generateNonGreedyQuantifier):
2090         (JSC::WREC::Generator::generateGreedyQuantifier):
2091         (JSC::WREC::Generator::generatePatternCharacterPair):
2092         (JSC::WREC::Generator::generatePatternCharacter):
2093         (JSC::WREC::Generator::generateCharacterClassInvertedRange):
2094         (JSC::WREC::Generator::generateCharacterClassInverted):
2095         (JSC::WREC::Generator::generateAssertionBOL):
2096         (JSC::WREC::Generator::generateAssertionEOL):
2097         (JSC::WREC::Generator::generateAssertionWordBoundary):
2098         (JSC::WREC::Generator::generateBackreference):
2099
2100 2009-02-03  David Hyatt  <hyatt@apple.com>
2101
2102         Fix a bug in Vector's shrinkCapacity method.  It did not properly copy elements into the inline buffer
2103         when shrinking down from a size that was greater than the inline capacity.
2104
2105         Reviewed by Maciej
2106
2107         * wtf/Vector.h:
2108         (WTF::VectorBuffer::VectorBuffer):
2109         (WTF::VectorBuffer::allocateBuffer):
2110
2111 2009-02-03  Simon Hausmann  <simon.hausmann@nokia.com>
2112
2113         Reviewed by Tor Arne Vestbø.
2114
2115         Added accessor for JSByteArray storage.
2116
2117         * runtime/JSByteArray.h:
2118         (JSC::JSByteArray::storage):
2119
2120 2009-02-03  Dmitry Titov  <dimich@chromium.org>
2121
2122         Reviewed by Alexey Proskuryakov.
2123
2124         https://bugs.webkit.org/show_bug.cgi?id=23560
2125         Implement SharedTimer on WorkerRunLoop
2126
2127         * JavaScriptCore.exp:
2128         Forgot to expose ThreadCondition::timedWait() in one of previous patches.
2129
2130 2009-02-02  Oliver Hunt  <oliver@apple.com>
2131
2132         Reviewed by Gavin Barraclough.
2133
2134         <https://bugs.webkit.org/show_bug.cgi?id=21414> REGRESSION: Regular Expressions and character classes, shorthands and ranges
2135         <rdar://problem/6543487>
2136
2137         In certain circumstances when WREC::Generator::generateCharacterClassInvertedRange invokes
2138         itself recursively, it will incorrectly emit (and thus consume) the next single character
2139         match in the current character class.  As WREC uses a binary search this out of sequence
2140         codegen could result in a character match being missed and so cause the regex to produce
2141         incorrect results.
2142
2143         * wrec/WRECGenerator.cpp:
2144         (JSC::WREC::Generator::generateCharacterClassInvertedRange):
2145
2146 2009-02-02  Darin Adler  <darin@apple.com>
2147
2148         Reviewed by Dave Hyatt.
2149
2150         Bug 23676: Speed up uses of reserveCapacity on new vectors by adding a new reserveInitialCapacity
2151         https://bugs.webkit.org/show_bug.cgi?id=23676
2152
2153         * API/JSObjectRef.cpp:
2154         (JSObjectCopyPropertyNames): Use reserveInitialCapacity.
2155         * parser/Lexer.cpp:
2156         (JSC::Lexer::Lexer): Ditto.
2157         (JSC::Lexer::clear): Ditto.
2158
2159         * wtf/Vector.h: Added reserveInitialCapacity, a more efficient version of
2160         reserveCapacity for use when the vector is brand new (still size 0 with no
2161         capacity other than the inline capacity).
2162
2163 2009-01-30  Mark Rowe  <mrowe@apple.com>
2164
2165         Rubber-stamped by Oliver Hunt.
2166
2167         <rdar://problem/6391501> Enable the JIT on Mac OS X x86_64 as it passes all tests.
2168
2169         * wtf/Platform.h:
2170
2171 2009-01-30  Oliver Hunt  <oliver@apple.com>
2172
2173         Reviewed by Mark Rowe and Sam Weinig.
2174
2175         Finally fix load() to propagate exceptions correctly.
2176
2177         * jsc.cpp:
2178         (functionLoad):
2179
2180 2009-01-30  David Levin  <levin@chromium.org>
2181
2182         Reviewed by Darin Adler.
2183
2184         https://bugs.webkit.org/show_bug.cgi?id=23618
2185         Templated worker tasks should be more error proof to use.
2186         Fix Chromium build.
2187
2188         * wtf/TypeTraits.h:
2189         (WTF::IsConvertibleToInteger::IsConvertibleToDouble):
2190         Avoid "possible loss of data" warning when using Microsoft's C++ compiler
2191         by avoiding an implicit conversion of int types to doubles.
2192
2193 2009-01-30  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
2194
2195         Reviewed by Simon Hausmann.
2196
2197         Bug 23580: GNU mode RVCT compilation support
2198         <https://bugs.webkit.org/show_bug.cgi?id=23580>
2199
2200         * pcre/pcre_exec.cpp: Use COMPILER(GCC) instead of __GNUC__.
2201         * wtf/FastMalloc.cpp: Ditto.
2202         (WTF::TCMallocStats::):
2203         * wtf/Platform.h: Don't define COMPILER(GCC) with RVCT --gnu.
2204
2205 2009-01-30  David Levin  <levin@chromium.org>
2206
2207         Reviewed by Alexey Proskuryakov.
2208
2209         Bug 23618: Templated worker tasks should be more error proof to use
2210         <https://bugs.webkit.org/show_bug.cgi?id=23618>
2211
2212         Add the type traits needed for the generic worker tasks
2213         and compile asserts for them.
2214
2215         Add a summary header to the TypeTraits.h file to explain what is in there.
2216
2217         Add a note to explain IsPod's deficiencies.
2218
2219         * wtf/TypeTraits.h:
2220
2221 2009-01-30  David Levin  <levin@chromium.org>
2222
2223         Reviewed by Alexey Proskuryakov.
2224
2225         Bug 23616: Various "template helpers" should be consolidated from isolated files in JavaScriptCore.
2226         <https://bugs.webkit.org/show_bug.cgi?id=23616>
2227
2228         * wtf/TypeTraits.h: Moved RemovePointer, IsPod, IsInteger to this file.
2229
2230         * wtf/OwnPtr.h: Use RemovePointer from TypeTraits.h.
2231         * wtf/RetainPtr.h:  Ditto.
2232
2233         * wtf/HashTraits.h: Use IsInteger from TypeTraits.h.
2234
2235         * wtf/VectorTraits.h: Use IsPod from TypeTraits.h.
2236
2237         * GNUmakefile.am:
2238         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
2239         * JavaScriptCore.xcodeproj/project.pbxproj:
2240         Added TypeTraits.h.
2241
2242 2009-01-29  Stephanie Lewis <slewis@apple.com>
2243
2244         RS by Oliver Hunt.
2245
2246         Update the order files.
2247
2248         * JavaScriptCore.order:
2249
2250 2009-01-29  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2251
2252         Reviewed by Oliver Hunt.
2253
2254         Bug 23551: Crash on page load with profiler enabled and running
2255         <https://bugs.webkit.org/show_bug.cgi?id=23551>
2256         <rdar://problem/6529521>
2257
2258         Interpreter::execute(FunctionBodyNode*, ...) calls Profiler::didExecute()
2259         with a stale CallFrame. If some part of the scope chain has already been
2260         freed, Profiler::didExecute() will crash when attempting to get the lexical
2261         global object. The fix is to make the didExecute() call use the caller's
2262         CallFrame, not the one made for the function call. In this case, the
2263         willExecute() call should also be changed to match.
2264
2265         Since this occurs in the actual inspector JS, it is difficult to reduce.
2266         I couldn't make a layout test.
2267
2268         * interpreter/Interpreter.cpp:
2269         (JSC::Interpreter::execute):
2270
2271 2009-01-28  Sam Weinig  <sam@webkit.org>
2272
2273         Reviewed by Gavin Barraclough.
2274
2275         Fix for <rdar://problem/6525537>
2276         Hang occurs when closing Installer window (iTunes, Aperture)
2277
2278         * JavaScriptCore.exp: Export JSGlobalData::sharedInstance.
2279
2280 2009-01-28  Sam Weinig  <sam@webkit.org>
2281
2282         Reviewed by Geoff Garen.
2283
2284         Initial patch by Mark Rowe.
2285
2286         <rdar://problem/6519356>
2287         REGRESSION (r36006): "out of memory" alert running dromaeo on Windows
2288
2289         Report the cost of the ArrayStorage vector more accurately/often.
2290
2291         * runtime/JSArray.cpp:
2292         (JSC::JSArray::JSArray): Report the extra cost even for a filled array
2293         because JSString using the single character optimization and immediates
2294         wont increase the cost themselves. 
2295         (JSC::JSArray::putSlowCase): Update the cost when increasing the size of
2296         the array.
2297         (JSC::JSArray::increaseVectorLength): Ditto.
2298
2299 2009-01-28  Sam Weinig  <sam@webkit.org>
2300
2301         Reviewed by Geoff Garen.
2302
2303         Fix for <rdar://problem/6129678>
2304         REGRESSION (Safari 3-4): Local variable not accessible from Dashcode console or variables view
2305
2306         Iterating the properties of activation objects accessed through the WebKit debugging
2307         APIs was broken by forced conversion of JSActivation to the global object. To fix this,
2308         we use a proxy activation object that acts more like a normal JSObject.
2309
2310         * debugger/DebuggerActivation.cpp: Added.
2311         (JSC::DebuggerActivation::DebuggerActivation):
2312         (JSC::DebuggerActivation::mark):
2313         (JSC::DebuggerActivation::className):
2314         (JSC::DebuggerActivation::getOwnPropertySlot):
2315         (JSC::DebuggerActivation::put):
2316         (JSC::DebuggerActivation::putWithAttributes):
2317         (JSC::DebuggerActivation::deleteProperty):
2318         (JSC::DebuggerActivation::getPropertyNames):
2319         (JSC::DebuggerActivation::getPropertyAttributes):
2320         (JSC::DebuggerActivation::defineGetter):
2321         (JSC::DebuggerActivation::defineSetter):
2322         (JSC::DebuggerActivation::lookupGetter):
2323         (JSC::DebuggerActivation::lookupSetter):
2324         * debugger/DebuggerActivation.h: Added.
2325         Proxy JSActivation object for Debugging.
2326
2327         * runtime/JSActivation.h:
2328         (JSC::JSActivation::isActivationObject): Added.
2329         * runtime/JSObject.h:
2330         (JSC::JSObject::isActivationObject): Added.
2331
2332 2009-01-28  David Kilzer  <ddkilzer@apple.com>
2333
2334         Bug 23490: Remove initialRefCount argument from RefCounted class
2335
2336         <https://bugs.webkit.org/show_bug.cgi?id=23490>
2337
2338         Reviewed by Darin Adler.
2339
2340         RefCountedBase now always starts with a ref count of 1, so there
2341         is no need to pass the initialRefCount into the class anymore.
2342
2343         * wtf/ByteArray.h:
2344         (WTF::ByteArray::ByteArray): Removed call to RefCounted(1).
2345         * wtf/RefCounted.h:
2346         (WTF::RefCountedBase::RefCountedBase): Changed to start with a
2347         ref count of 1.
2348         (WTF::RefCounted::RefCounted): Removed initialRefCount argument
2349         and removed call to RefCounted(1).
2350
2351 2009-01-26  Adele Peterson  <adele@apple.com>
2352
2353         Build fix.  
2354
2355         * debugger/Debugger.cpp:
2356
2357 2009-01-26  Gavin Barraclough  <barraclough@apple.com>
2358
2359         Reviewed by Darin Adler.
2360
2361         Fixes for eq null & neq null, on 64-bit JIT.
2362         https://bugs.webkit.org/show_bug.cgi?id=23559
2363
2364         This patch degrades 64-bit JIT performance on some benchmarks,
2365         due to the whole not-being-incorrect thing.
2366
2367         * jit/JIT.cpp:
2368         (JSC::JIT::privateCompileMainPass):
2369
2370 2009-01-26  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2371
2372         Reviewed by Gavin Barraclough.
2373
2374         Bug 23552: Dashcode evaluator no longer works after making ExecStates actual call frames
2375         <https://bugs.webkit.org/show_bug.cgi?id=23552>
2376         <rdar://problem/6398839>
2377
2378         * JavaScriptCore.exp:
2379         * debugger/Debugger.cpp:
2380         (JSC::evaluateInGlobalCallFrame): Added so that WebScriptCallFrame can
2381         evaluate JS starting from a global call frame.
2382         * debugger/Debugger.h:
2383
2384 2009-01-25  Mark Rowe  <mrowe@apple.com>
2385
2386         Rubber-stamped by Dan Bernstein.
2387
2388         Improve the consistency of settings in our .xcconfig files.
2389
2390         * Configurations/Base.xcconfig: Enable GCC_OBJC_CALL_CXX_CDTORS to match other projects.
2391
2392 2009-01-25  Darin Adler  <darin@apple.com>
2393
2394         Reviewed by Mark Rowe.
2395
2396         Bug 23352: Turn on more compiler warnings in the Mac build
2397         https://bugs.webkit.org/show_bug.cgi?id=23352
2398
2399         Turn on the following warnings:
2400
2401             -Wcast-qual
2402             -Wextra-tokens
2403             -Wformat=2
2404             -Winit-self
2405             -Wmissing-noreturn
2406             -Wpacked
2407             -Wrendundant-decls
2408
2409         * Configurations/Base.xcconfig: Added the new warnings. Switched to -Wextra instead of
2410         -W for clarity since we don't have to support the older versions of gcc that require the
2411         old -W syntax. Since we now use -Wformat=2, removed -Wformat-security. Also removed
2412         -Wno-format-y2k since we can have that one on now.
2413
2414 2009-01-25  Judit Jasz  <jasy@inf.u-szeged.hu>
2415
2416         Reviewed by Darin Adler.
2417         
2418         Compilation problem fixing 
2419         http://bugs.webkit.org/show_bug.cgi?id=23497
2420
2421         * jit/JITCall.cpp:
2422         (JSC::JIT::compileOpCall): Use JSValuePtr::encode.
2423
2424 2009-01-25  Darin Adler  <darin@apple.com>
2425
2426         Reviewed by Sam Weinig.
2427
2428         Bug 23352: Turn on more compiler warnings in the Mac build
2429         https://bugs.webkit.org/show_bug.cgi?id=23352
2430
2431         Fourth patch: Deal with the last few stray warnings.
2432
2433         * parser/Parser.cpp: Only declare jscyyparse if it's not already declared.
2434         This makes both separate compilation and all-in-one compilation work with the
2435         -Wredundant-decls warning.
2436
2437 2009-01-25  Darin Adler  <darin@apple.com>
2438
2439         Reviewed by Sam Weinig.
2440
2441         Bug 23352: Turn on more compiler warnings in the Mac build
2442         https://bugs.webkit.org/show_bug.cgi?id=23352
2443
2444         Third patch: Use the noreturn attribute on functions that don't
2445         return to prepare for the use of the -Wmissing-noreturn warning.
2446
2447         * jit/JITCall.cpp:
2448         (JSC::unreachable): Added NO_RETURN.
2449         * jsc.cpp:
2450         (functionQuit): Ditto.
2451         (printUsageStatement): Ditto.
2452         * wtf/AlwaysInline.h: Added definition of NO_RETURN.
2453
2454 2009-01-24  Oliver Hunt  <oliver@apple.com>
2455
2456         Reviewed by Maciej Stachowiak.
2457
2458         Force inlining of Lexer::matchPunctuator
2459
2460         2.2% win when parsing jQuery, Mootools, Prototype, etc
2461
2462         * parser/Lexer.h:
2463
2464 2009-01-23  Gavin Barraclough  <barraclough@apple.com>
2465
2466         Reviewed by Geoff Garen.
2467
2468         Fix for <rdar://problem/6126212>
2469         Ensure that callbacks out from the JSC interface are only allowed
2470         to return in reverse-chronological order to that in which they were
2471         made.  If we allow earlier callbacks to return first, then this may
2472         result in setions of the RegisterFile in use by another thread
2473         being trampled.
2474
2475         See uber-comment in JSLock.h for details.
2476
2477         * runtime/JSLock.cpp:
2478         (JSC::JSLock::DropAllLocks::DropAllLocks):
2479         (JSC::JSLock::DropAllLocks::~DropAllLocks):
2480
2481 2009-01-23  Darin Adler  <darin@apple.com>
2482
2483         Try to fix WX build.
2484
2485         * runtime/JSGlobalObjectFunctions.h: Include <wtf/unicode/Unicode.h>
2486         for the definition of UChar.
2487
2488 2009-01-23  Anders Carlsson  <andersca@apple.com>
2489
2490         * Configurations/Base.xcconfig:
2491         GCC 4.0 build fix.
2492         
2493         * runtime/JSNumberCell.h:
2494         64-bit build fix.
2495
2496 2009-01-23  Anders Carlsson  <andersca@apple.com>
2497
2498         Reviewed by Sam Weinig.
2499         
2500         Turn on -Wmissing-prototypes and fix the warnings.
2501         
2502         * API/JSClassRef.cpp:
2503         (clearReferenceToPrototype):
2504         * Configurations/Base.xcconfig:
2505         * runtime/Collector.cpp:
2506         (JSC::getPlatformThreadRegisters):
2507         * runtime/ExceptionHelpers.cpp:
2508         (JSC::createError):
2509         * runtime/JSGlobalObjectFunctions.h:
2510         * runtime/JSNumberCell.h:
2511         * runtime/UString.cpp:
2512         (JSC::initializeStaticBaseString):
2513         (JSC::createRep):
2514         * wtf/FastMalloc.cpp:
2515         * wtf/Threading.cpp:
2516
2517 2009-01-22  Mark Rowe  <mrowe@apple.com>
2518
2519         Rubber-stamped by Anders Carlsson.
2520
2521         Disable GCC_WARN_ABOUT_MISSING_PROTOTYPES temporarily.
2522
2523         Current versions of Xcode only respect it for C and Objective-C files,
2524         and our code doesn't currently compile if it is applied to C++ and
2525         Objective-C++ files.
2526
2527         * Configurations/Base.xcconfig:
2528
2529 2009-01-22  Steve Falkenburg  <sfalken@apple.com>
2530
2531         https://bugs.webkit.org/show_bug.cgi?id=23489
2532         
2533         Return currentTime() in correct units for the two early return cases.
2534
2535         Reviewed by Mark Rowe.
2536
2537         * wtf/CurrentTime.cpp:
2538         (WTF::currentTime):
2539
2540 2009-01-22  Sam Weinig  <sam@webkit.org>
2541
2542         Reviewed by Mark Rowe.
2543
2544         Fix for <rdar://problem/6439247>
2545         FastMalloc allocating an extra 4MB of meta-data on 64-bit
2546
2547         Rely on the fact that on all known x86-64 platforms only use 48 bits of
2548         address space to shrink the initial size of the PageMap from ~4MB to 120K.
2549         For 64-bit we still use a 3-level radix tree, but now each level is only 12
2550         bits wide.
2551
2552         No performance change.
2553
2554         * wtf/FastMalloc.cpp:
2555         (WTF::MapSelector): Add specialization for 64 bit that takes into account the
2556         16 bits of unused address space on x86-64.
2557
2558 2009-01-22  Beth Dakin  <bdakin@apple.com>
2559
2560         Reviewed by Sam Weinig.
2561
2562         Fix for https://bugs.webkit.org/show_bug.cgi?id=23461 LayoutTests/
2563         fast/js/numeric-conversion.html is broken, and corresponding 
2564         <rdar://problem/6514842>
2565
2566         The basic problem here is that parseInt(Infinity) should be NaN, 
2567         but we were returning 0. NaN matches Safari 3.2.1 and Firefox.
2568
2569         * runtime/JSGlobalObjectFunctions.cpp:
2570         (JSC::globalFuncParseInt):
2571
2572 2009-01-22  Oliver Hunt  <oliver@apple.com>
2573
2574         Reviewed by Geoff Garen.
2575
2576         <rdar://problem/6516853> (r39682-r39736) JSFunFuzz: crash on "(function(){({ x2: x }), })()"
2577         <https://bugs.webkit.org/show_bug.cgi?id=23479>
2578
2579         Automatic semicolon insertion was resulting in this being accepted in the initial
2580         nodeless parsing, but subsequent reparsing for code generation would fail, leading
2581         to a crash.  The solution is to ensure that reparsing a function performs parsing
2582         in the same state as the initial parse.  We do this by modifying the saved source
2583         ranges to include rather than exclude the opening and closing braces.
2584
2585         * bytecode/CodeBlock.cpp:
2586         (JSC::CodeBlock::reparseForExceptionInfoIfNecessary): add an assertion for successful recompile
2587         * parser/Lexer.h:
2588         (JSC::Lexer::sourceCode): include rather than exclude braces.
2589         * parser/Nodes.h:
2590         (JSC::FunctionBodyNode::toSourceString):  No need to append braces anymore.
2591
2592 2009-01-22  Dmitry Titov  <dimich@chromium.org>
2593
2594         Reviewed by Alexey Proskuryakov.
2595
2596         https://bugs.webkit.org/show_bug.cgi?id=23373
2597
2598         Implement ThreadCondition::timedWait().
2599         Since we borrow the code for condition variables from other sources,
2600         I did the same for timedWait(). See comments in ThreadingWin.cpp for
2601         rationale and more info.
2602
2603         * wtf/CONTRIBUTORS.pthreads-win32: 
2604         Added. A list of Pthreads-win32 contributors mentioned in their license. The license itself
2605         is included into wtf/ThreadingWin32.cpp.
2606
2607         * wtf/Threading.h:
2608         * wtf/ThreadingWin.cpp:
2609         Additional info and Pthreads-win32 license at the beginning.
2610         (WTF::PlatformCondition::timedWait): new method, derived from Pthreads-win32.
2611         (WTF::PlatformCondition::signal): same
2612         (WTF::ThreadCondition::ThreadCondition):
2613         (WTF::ThreadCondition::~ThreadCondition):
2614         (WTF::ThreadCondition::wait): this now calls PlatformCondition::timedWait.
2615         (WTF::ThreadCondition::timedWait): same
2616         (WTF::ThreadCondition::signal): this now calls PlatformCondition::signal.
2617         (WTF::ThreadCondition::broadcast): same
2618
2619 2009-01-21  Gavin Barraclough  <barraclough@apple.com>
2620
2621         Reviewed by Oliver Hunt.
2622
2623         Fix for https://bugs.webkit.org/show_bug.cgi?id=23469.
2624
2625         We need to check all numbers in integer switches, not just those
2626         represented as integer JSImmediates.
2627
2628         * interpreter/Interpreter.cpp:
2629         (JSC::Interpreter::privateExecute):
2630         (JSC::Interpreter::cti_op_switch_imm):
2631
2632 2009-01-21  Gavin Barraclough  <barraclough@apple.com>
2633
2634         Reviewed by Geoff Garen.
2635
2636         Fix for https://bugs.webkit.org/show_bug.cgi?id=23468.
2637
2638         * interpreter/Interpreter.cpp:
2639         (JSC::Interpreter::privateExecute):
2640
2641 2009-01-21  Alexey Proskuryakov  <ap@webkit.org>
2642
2643         Suggested by Oliver Hunt. Reviewed by Oliver Hunt.
2644
2645         https://bugs.webkit.org/show_bug.cgi?id=23456
2646         Function argument names leak
2647
2648         * parser/Nodes.cpp: (JSC::FunctionBodyNode::~FunctionBodyNode): Destruct parameter names.
2649
2650 2009-01-20  Oliver Hunt  <oliver@apple.com>
2651
2652         Reviewed by NOBODY (Build fix).
2653
2654         Windows build fix
2655
2656         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
2657
2658 2009-01-20  Gavin Barraclough  <barraclough@apple.com>
2659
2660         Reviewed by Mark Rowe.
2661
2662         Structure property table deleted offset maps are being leaked.
2663         Probably shouldn't be doing that.
2664
2665         https://bugs.webkit.org/show_bug.cgi?id=23442
2666
2667         * runtime/Structure.cpp:
2668         (JSC::Structure::~Structure):
2669
2670 2009-01-20  Oliver Hunt  <oliver@apple.com>
2671
2672         Reviewed by NOBODY (build fix).
2673
2674         Attempt to fix gtk build
2675
2676         * GNUmakefile.am:
2677
2678 2009-01-20  Darin Adler  <darin@apple.com>
2679
2680         * runtime/StringPrototype.cpp:
2681         (JSC::substituteBackreferences): Add back the initialization to fix the build.
2682
2683 2009-01-20  Darin Adler  <darin@apple.com>
2684
2685         Reviewed by Mark Rowe.
2686
2687         Bug 23352: Turn on more compiler warnings in the Mac build
2688         https://bugs.webkit.org/show_bug.cgi?id=23352
2689
2690         First patch: Fix some simple cases of various warnings.
2691
2692         * pcre/pcre_compile.cpp:
2693         (jsRegExpCompile): Use const_cast to change const-ness.
2694
2695         * runtime/StringPrototype.cpp:
2696         (JSC::substituteBackreferences): Remove unneeded initialization and
2697         use UChar instead of unsigned short for UTF-16 values.
2698
2699         * wtf/dtoa.cpp:
2700         (WTF::strtod): Use const_cast to change const-ness.
2701
2702 2009-01-20  Oliver Hunt  <oliver@apple.com>
2703
2704         Reviewed by NOBODY (build fix).
2705
2706         Whoops, remove runtime/ByteArray references from .pri and .scons builds, update .bkl
2707
2708         * JavaScriptCore.pri:
2709         * JavaScriptCore.scons:
2710         * JavaScriptCoreSources.bkl:
2711
2712 2009-01-20  Oliver Hunt  <oliver@apple.com>
2713
2714         RS=Dan Bernstein.
2715
2716         Move runtime/ByteArray to wtf/ByteArray
2717
2718         * GNUmakefile.am:
2719         * JavaScriptCore.exp:
2720         * JavaScriptCore.pri:
2721         * JavaScriptCore.scons:
2722         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2723         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
2724         * JavaScriptCore.xcodeproj/project.pbxproj:
2725         * runtime/JSByteArray.cpp:
2726         * runtime/JSByteArray.h:
2727         * wtf/ByteArray.cpp: Renamed from JavaScriptCore/runtime/ByteArray.cpp.
2728         (WTF::ByteArray::create):
2729         * wtf/ByteArray.h: Renamed from JavaScriptCore/runtime/ByteArray.h.
2730         (WTF::ByteArray::length):
2731         (WTF::ByteArray::set):
2732         (WTF::ByteArray::get):
2733         (WTF::ByteArray::data):
2734         (WTF::ByteArray::deref):
2735         (WTF::ByteArray::ByteArray):
2736
2737 2009-01-19  Sam Weinig  <sam@webkit.org>
2738
2739         Rubber-stamped by Gavin Barraclough.
2740
2741         Remove temporary operator-> from JSValuePtr.
2742
2743         * API/JSCallbackFunction.cpp:
2744         (JSC::JSCallbackFunction::call):
2745         * API/JSCallbackObjectFunctions.h:
2746         (JSC::::call):
2747         (JSC::::toNumber):
2748         (JSC::::toString):
2749         * API/JSObjectRef.cpp:
2750         (JSObjectSetPrototype):
2751         * API/JSValueRef.cpp:
2752         (JSValueGetType):
2753         (JSValueIsUndefined):
2754         (JSValueIsNull):
2755         (JSValueIsBoolean):
2756         (JSValueIsNumber):
2757         (JSValueIsString):
2758         (JSValueIsObject):
2759         (JSValueIsObjectOfClass):
2760         (JSValueToBoolean):
2761         (JSValueToNumber):
2762         (JSValueToStringCopy):
2763         (JSValueToObject):
2764         * bytecode/CodeBlock.cpp:
2765         (JSC::valueToSourceString):
2766         (JSC::CodeBlock::mark):
2767         * bytecode/CodeBlock.h:
2768         (JSC::CodeBlock::isKnownNotImmediate):
2769         * bytecompiler/BytecodeGenerator.cpp:
2770         (JSC::BytecodeGenerator::emitEqualityOp):
2771         (JSC::keyForImmediateSwitch):
2772         * interpreter/Interpreter.cpp:
2773         (JSC::jsLess):
2774         (JSC::jsLessEq):
2775         (JSC::jsAddSlowCase):
2776         (JSC::jsAdd):
2777         (JSC::jsTypeStringForValue):
2778         (JSC::jsIsObjectType):
2779         (JSC::jsIsFunctionType):
2780         (JSC::isNotObject):
2781         (JSC::Interpreter::callEval):
2782         (JSC::Interpreter::throwException):
2783         (JSC::cachePrototypeChain):
2784         (JSC::Interpreter::tryCachePutByID):
2785         (JSC::countPrototypeChainEntriesAndCheckForProxies):
2786         (JSC::Interpreter::tryCacheGetByID):
2787         (JSC::Interpreter::privateExecute):
2788         (JSC::Interpreter::tryCTICachePutByID):
2789         (JSC::Interpreter::tryCTICacheGetByID):
2790         (JSC::Interpreter::cti_op_convert_this):
2791         (JSC::Interpreter::cti_op_add):
2792         (JSC::Interpreter::cti_op_pre_inc):
2793         (JSC::Interpreter::cti_op_put_by_id_generic):
2794         (JSC::Interpreter::cti_op_get_by_id_generic):
2795         (JSC::Interpreter::cti_op_put_by_id):
2796         (JSC::Interpreter::cti_op_put_by_id_second):
2797         (JSC::Interpreter::cti_op_put_by_id_fail):
2798         (JSC::Interpreter::cti_op_get_by_id):
2799         (JSC::Interpreter::cti_op_get_by_id_second):
2800         (JSC::Interpreter::cti_op_get_by_id_self_fail):
2801         (JSC::Interpreter::cti_op_get_by_id_proto_list):
2802         (JSC::Interpreter::cti_op_get_by_id_proto_list_full):
2803         (JSC::Interpreter::cti_op_get_by_id_proto_fail):
2804         (JSC::Interpreter::cti_op_get_by_id_array_fail):
2805         (JSC::Interpreter::cti_op_get_by_id_string_fail):
2806         (JSC::Interpreter::cti_op_instanceof):
2807         (JSC::Interpreter::cti_op_del_by_id):
2808         (JSC::Interpreter::cti_op_mul):
2809         (JSC::Interpreter::cti_op_call_JSFunction):
2810         (JSC::Interpreter::cti_op_call_NotJSFunction):
2811         (JSC::Interpreter::cti_op_construct_JSConstruct):
2812         (JSC::Interpreter::cti_op_construct_NotJSConstruct):
2813         (JSC::Interpreter::cti_op_get_by_val):
2814         (JSC::Interpreter::cti_op_get_by_val_byte_array):
2815         (JSC::Interpreter::cti_op_sub):
2816         (JSC::Interpreter::cti_op_put_by_val):
2817         (JSC::Interpreter::cti_op_put_by_val_array):
2818         (JSC::Interpreter::cti_op_put_by_val_byte_array):
2819         (JSC::Interpreter::cti_op_loop_if_true):
2820         (JSC::Interpreter::cti_op_negate):
2821         (JSC::Interpreter::cti_op_div):
2822         (JSC::Interpreter::cti_op_pre_dec):
2823         (JSC::Interpreter::cti_op_not):
2824         (JSC::Interpreter::cti_op_jtrue):
2825         (JSC::Interpreter::cti_op_post_inc):
2826         (JSC::Interpreter::cti_op_lshift):
2827         (JSC::Interpreter::cti_op_bitand):
2828         (JSC::Interpreter::cti_op_rshift):
2829         (JSC::Interpreter::cti_op_bitnot):
2830         (JSC::Interpreter::cti_op_mod):
2831         (JSC::Interpreter::cti_op_post_dec):
2832         (JSC::Interpreter::cti_op_urshift):
2833         (JSC::Interpreter::cti_op_bitxor):
2834         (JSC::Interpreter::cti_op_bitor):
2835         (JSC::Interpreter::cti_op_push_scope):
2836         (JSC::Interpreter::cti_op_is_undefined):
2837         (JSC::Interpreter::cti_op_is_boolean):
2838         (JSC::Interpreter::cti_op_is_number):
2839         (JSC::Interpreter::cti_op_to_jsnumber):
2840         (JSC::Interpreter::cti_op_in):
2841         (JSC::Interpreter::cti_op_put_by_index):
2842         (JSC::Interpreter::cti_op_switch_imm):
2843         (JSC::Interpreter::cti_op_switch_char):
2844         (JSC::Interpreter::cti_op_switch_string):
2845         (JSC::Interpreter::cti_op_del_by_val):
2846         (JSC::Interpreter::cti_op_put_getter):
2847         (JSC::Interpreter::cti_op_put_setter):
2848         (JSC::Interpreter::cti_op_new_error):
2849         * interpreter/Interpreter.h:
2850         (JSC::Interpreter::isJSArray):
2851         (JSC::Interpreter::isJSString):
2852         (JSC::Interpreter::isJSByteArray):
2853         * interpreter/Register.h:
2854         (JSC::Register::marked):
2855         (JSC::Register::mark):
2856         * jit/JITInlineMethods.h:
2857         (JSC::JIT::getConstantOperandImmediateInt):
2858         (JSC::JIT::isOperandConstantImmediateInt):
2859         * jsc.cpp:
2860         (functionPrint):
2861         (functionDebug):
2862         (functionRun):
2863         (functionLoad):
2864         (runWithScripts):
2865         (runInteractive):
2866         * parser/Nodes.cpp:
2867         (JSC::processClauseList):
2868         * profiler/ProfileGenerator.cpp:
2869         (JSC::ProfileGenerator::addParentForConsoleStart):
2870         * profiler/Profiler.cpp:
2871         (JSC::Profiler::createCallIdentifier):
2872         * runtime/ArrayConstructor.cpp:
2873         (JSC::constructArrayWithSizeQuirk):
2874         * runtime/ArrayPrototype.cpp:
2875         (JSC::arrayProtoFuncToString):
2876         (JSC::arrayProtoFuncToLocaleString):
2877         (JSC::arrayProtoFuncJoin):
2878         (JSC::arrayProtoFuncConcat):
2879         (JSC::arrayProtoFuncPop):
2880         (JSC::arrayProtoFuncPush):
2881         (JSC::arrayProtoFuncReverse):
2882         (JSC::arrayProtoFuncShift):
2883         (JSC::arrayProtoFuncSlice):
2884         (JSC::arrayProtoFuncSort):
2885         (JSC::arrayProtoFuncSplice):
2886         (JSC::arrayProtoFuncUnShift):
2887         (JSC::arrayProtoFuncFilter):
2888         (JSC::arrayProtoFuncMap):
2889         (JSC::arrayProtoFuncEvery):
2890         (JSC::arrayProtoFuncForEach):
2891         (JSC::arrayProtoFuncSome):
2892         (JSC::arrayProtoFuncIndexOf):
2893         (JSC::arrayProtoFuncLastIndexOf):
2894         * runtime/BooleanConstructor.cpp:
2895         (JSC::constructBoolean):
2896         (JSC::callBooleanConstructor):
2897         * runtime/BooleanPrototype.cpp:
2898         (JSC::booleanProtoFuncToString):
2899         (JSC::booleanProtoFuncValueOf):
2900         * runtime/Collector.cpp:
2901         (JSC::Heap::protect):
2902         (JSC::Heap::unprotect):
2903         (JSC::Heap::heap):
2904         (JSC::Heap::collect):
2905         (JSC::typeName):
2906         * runtime/Completion.cpp:
2907         (JSC::evaluate):
2908         * runtime/DateConstructor.cpp:
2909         (JSC::constructDate):
2910         (JSC::dateParse):
2911         (JSC::dateUTC):
2912         * runtime/DateInstance.h:
2913         (JSC::DateInstance::internalNumber):
2914         * runtime/DatePrototype.cpp:
2915         (JSC::formatLocaleDate):
2916         (JSC::fillStructuresUsingTimeArgs):
2917         (JSC::fillStructuresUsingDateArgs):
2918         (JSC::dateProtoFuncToString):
2919         (JSC::dateProtoFuncToUTCString):
2920         (JSC::dateProtoFuncToDateString):
2921         (JSC::dateProtoFuncToTimeString):
2922         (JSC::dateProtoFuncToLocaleString):
2923         (JSC::dateProtoFuncToLocaleDateString):
2924         (JSC::dateProtoFuncToLocaleTimeString):
2925         (JSC::dateProtoFuncGetTime):
2926         (JSC::dateProtoFuncGetFullYear):
2927         (JSC::dateProtoFuncGetUTCFullYear):
2928         (JSC::dateProtoFuncToGMTString):
2929         (JSC::dateProtoFuncGetMonth):
2930         (JSC::dateProtoFuncGetUTCMonth):
2931         (JSC::dateProtoFuncGetDate):
2932         (JSC::dateProtoFuncGetUTCDate):
2933         (JSC::dateProtoFuncGetDay):
2934         (JSC::dateProtoFuncGetUTCDay):
2935         (JSC::dateProtoFuncGetHours):
2936         (JSC::dateProtoFuncGetUTCHours):
2937         (JSC::dateProtoFuncGetMinutes):
2938         (JSC::dateProtoFuncGetUTCMinutes):
2939         (JSC::dateProtoFuncGetSeconds):
2940         (JSC::dateProtoFuncGetUTCSeconds):
2941         (JSC::dateProtoFuncGetMilliSeconds):
2942         (JSC::dateProtoFuncGetUTCMilliseconds):
2943         (JSC::dateProtoFuncGetTimezoneOffset):
2944         (JSC::dateProtoFuncSetTime):
2945         (JSC::setNewValueFromTimeArgs):
2946         (JSC::setNewValueFromDateArgs):
2947         (JSC::dateProtoFuncSetYear):
2948         (JSC::dateProtoFuncGetYear):
2949         * runtime/ErrorConstructor.cpp:
2950         (JSC::constructError):
2951         * runtime/ErrorPrototype.cpp:
2952         (JSC::errorProtoFuncToString):
2953         * runtime/ExceptionHelpers.cpp:
2954         (JSC::createError):
2955         (JSC::createErrorMessage):
2956         * runtime/FunctionConstructor.cpp:
2957         (JSC::constructFunction):
2958         * runtime/FunctionPrototype.cpp:
2959         (JSC::functionProtoFuncToString):
2960         (JSC::functionProtoFuncApply):
2961         (JSC::functionProtoFuncCall):
2962         * runtime/GetterSetter.cpp:
2963         (JSC::GetterSetter::toObject):
2964         * runtime/JSActivation.cpp:
2965         (JSC::JSActivation::getOwnPropertySlot):
2966         * runtime/JSArray.cpp:
2967         (JSC::JSArray::put):
2968         (JSC::JSArray::mark):
2969         (JSC::JSArray::sort):
2970         (JSC::AVLTreeAbstractorForArrayCompare::compare_key_key):
2971         (JSC::JSArray::compactForSorting):
2972         * runtime/JSByteArray.h:
2973         (JSC::JSByteArray::setIndex):
2974         * runtime/JSCell.h:
2975         (JSC::asCell):
2976         * runtime/JSFunction.cpp:
2977         (JSC::JSFunction::call):
2978         (JSC::JSFunction::construct):
2979         * runtime/JSGlobalObject.cpp:
2980         (JSC::markIfNeeded):
2981         (JSC::lastInPrototypeChain):
2982         * runtime/JSGlobalObjectFunctions.cpp:
2983         (JSC::encode):
2984         (JSC::decode):
2985         (JSC::globalFuncEval):
2986         (JSC::globalFuncParseInt):
2987         (JSC::globalFuncParseFloat):
2988         (JSC::globalFuncIsNaN):
2989         (JSC::globalFuncIsFinite):
2990         (JSC::globalFuncEscape):
2991         (JSC::globalFuncUnescape):
2992         (JSC::globalFuncJSCPrint):
2993         * runtime/JSImmediate.cpp:
2994         (JSC::JSImmediate::toThisObject):
2995         (JSC::JSImmediate::toObject):
2996         (JSC::JSImmediate::prototype):
2997         (JSC::JSImmediate::toString):
2998         * runtime/JSImmediate.h:
2999         * runtime/JSObject.cpp:
3000         (JSC::JSObject::mark):
3001         (JSC::JSObject::put):
3002         (JSC::callDefaultValueFunction):
3003         (JSC::JSObject::getPrimitiveNumber):
3004         (JSC::JSObject::defineGetter):
3005         (JSC::JSObject::defineSetter):
3006         (JSC::JSObject::lookupGetter):
3007         (JSC::JSObject::lookupSetter):
3008         (JSC::JSObject::hasInstance):
3009         (JSC::JSObject::toNumber):
3010         (JSC::JSObject::toString):
3011         * runtime/JSObject.h:
3012         (JSC::JSObject::JSObject):
3013         (JSC::JSObject::inlineGetOwnPropertySlot):
3014         (JSC::JSObject::getOwnPropertySlotForWrite):
3015         (JSC::JSObject::getPropertySlot):
3016         (JSC::JSValuePtr::get):
3017         * runtime/JSPropertyNameIterator.h:
3018         (JSC::JSPropertyNameIterator::create):
3019         * runtime/JSString.cpp:
3020         (JSC::JSString::getOwnPropertySlot):
3021         * runtime/JSValue.h:
3022         * runtime/JSWrapperObject.cpp:
3023         (JSC::JSWrapperObject::mark):
3024         * runtime/JSWrapperObject.h:
3025         (JSC::JSWrapperObject::setInternalValue):
3026         * runtime/MathObject.cpp:
3027         (JSC::mathProtoFuncAbs):
3028         (JSC::mathProtoFuncACos):
3029         (JSC::mathProtoFuncASin):
3030         (JSC::mathProtoFuncATan):
3031         (JSC::mathProtoFuncATan2):
3032         (JSC::mathProtoFuncCeil):
3033         (JSC::mathProtoFuncCos):
3034         (JSC::mathProtoFuncExp):
3035         (JSC::mathProtoFuncFloor):
3036         (JSC::mathProtoFuncLog):
3037         (JSC::mathProtoFuncMax):
3038         (JSC::mathProtoFuncMin):
3039         (JSC::mathProtoFuncPow):
3040         (JSC::mathProtoFuncRound):
3041         (JSC::mathProtoFuncSin):
3042         (JSC::mathProtoFuncSqrt):
3043         (JSC::mathProtoFuncTan):
3044         * runtime/NativeErrorConstructor.cpp:
3045         (JSC::NativeErrorConstructor::NativeErrorConstructor):
3046         (JSC::NativeErrorConstructor::construct):
3047         * runtime/NumberConstructor.cpp:
3048         (JSC::constructWithNumberConstructor):
3049         (JSC::callNumberConstructor):
3050         * runtime/NumberPrototype.cpp:
3051         (JSC::numberProtoFuncToString):
3052         (JSC::numberProtoFuncToLocaleString):
3053         (JSC::numberProtoFuncValueOf):
3054         (JSC::numberProtoFuncToFixed):
3055         (JSC::numberProtoFuncToExponential):
3056         (JSC::numberProtoFuncToPrecision):
3057         * runtime/ObjectConstructor.cpp:
3058         (JSC::constructObject):
3059         * runtime/ObjectPrototype.cpp:
3060         (JSC::objectProtoFuncValueOf):
3061         (JSC::objectProtoFuncHasOwnProperty):
3062         (JSC::objectProtoFuncIsPrototypeOf):
3063         (JSC::objectProtoFuncDefineGetter):
3064         (JSC::objectProtoFuncDefineSetter):
3065         (JSC::objectProtoFuncLookupGetter):
3066         (JSC::objectProtoFuncLookupSetter):
3067         (JSC::objectProtoFuncPropertyIsEnumerable):
3068         (JSC::objectProtoFuncToLocaleString):
3069         (JSC::objectProtoFuncToString):
3070         * runtime/Operations.h:
3071         (JSC::JSValuePtr::equalSlowCaseInline):
3072         (JSC::JSValuePtr::strictEqual):
3073         (JSC::JSValuePtr::strictEqualSlowCaseInline):
3074         * runtime/Protect.h:
3075         (JSC::gcProtect):
3076         (JSC::gcUnprotect):
3077         * runtime/RegExpConstructor.cpp:
3078         (JSC::setRegExpConstructorInput):
3079         (JSC::setRegExpConstructorMultiline):
3080         (JSC::constructRegExp):
3081         * runtime/RegExpObject.cpp:
3082         (JSC::setRegExpObjectLastIndex):
3083         (JSC::RegExpObject::match):
3084         * runtime/RegExpPrototype.cpp:
3085         (JSC::regExpProtoFuncTest):
3086         (JSC::regExpProtoFuncExec):
3087         (JSC::regExpProtoFuncCompile):
3088         (JSC::regExpProtoFuncToString):
3089         * runtime/StringConstructor.cpp:
3090         (JSC::stringFromCharCodeSlowCase):
3091         (JSC::stringFromCharCode):
3092         (JSC::constructWithStringConstructor):
3093         (JSC::callStringConstructor):
3094         * runtime/StringPrototype.cpp:
3095         (JSC::stringProtoFuncReplace):
3096         (JSC::stringProtoFuncToString):
3097         (JSC::stringProtoFuncCharAt):
3098         (JSC::stringProtoFuncCharCodeAt):
3099         (JSC::stringProtoFuncConcat):
3100         (JSC::stringProtoFuncIndexOf):
3101         (JSC::stringProtoFuncLastIndexOf):
3102         (JSC::stringProtoFuncMatch):
3103         (JSC::stringProtoFuncSearch):
3104         (JSC::stringProtoFuncSlice):
3105         (JSC::stringProtoFuncSplit):
3106         (JSC::stringProtoFuncSubstr):
3107         (JSC::stringProtoFuncSubstring):
3108         (JSC::stringProtoFuncToLowerCase):
3109         (JSC::stringProtoFuncToUpperCase):
3110         (JSC::stringProtoFuncLocaleCompare):
3111         (JSC::stringProtoFuncBig):
3112         (JSC::stringProtoFuncSmall):
3113         (JSC::stringProtoFuncBlink):
3114         (JSC::stringProtoFuncBold):
3115         (JSC::stringProtoFuncFixed):
3116         (JSC::stringProtoFuncItalics):
3117         (JSC::stringProtoFuncStrike):
3118         (JSC::stringProtoFuncSub):
3119         (JSC::stringProtoFuncSup):
3120         (JSC::stringProtoFuncFontcolor):
3121         (JSC::stringProtoFuncFontsize):
3122         (JSC::stringProtoFuncAnchor):
3123         (JSC::stringProtoFuncLink):
3124         * runtime/Structure.cpp:
3125         (JSC::Structure::Structure):
3126         (JSC::Structure::getEnumerablePropertyNames):
3127         (JSC::Structure::createCachedPrototypeChain):
3128         * runtime/Structure.h:
3129         (JSC::Structure::mark):
3130         * runtime/StructureChain.cpp:
3131         (JSC::StructureChain::StructureChain):
3132
3133 2009-01-19  Darin Adler  <darin@apple.com>
3134
3135         Reviewed by Sam Weinig.
3136
3137         Bug 23409: REGRESSION: RegExp 'replace()' function improperly processes '$$'
3138         <https://bugs.webkit.org/show_bug.cgi?id=23409>
3139         <rdar://problem/6505723>
3140
3141         Test: fast/js/string-replace-3.html
3142
3143         * runtime/StringPrototype.cpp:
3144         (JSC::substituteBackreferences): Remove code that adds an extra $ -- not sure
3145         how this ever worked.
3146
3147 2009-01-16  Gavin Barraclough  <barraclough@apple.com>
3148
3149         Reviewed by Oliver Hunt.
3150
3151         On x86-64 jit, cache JSImmedate::TagMask & JSImmedate::TagTypeNumber in
3152         registers, save reloading them every time they're used.
3153
3154         Draws x86-64 jit performance close to that of i386 jit.
3155
3156         * assembler/MacroAssembler.h:
3157         (JSC::MacroAssembler::subPtr):
3158         (JSC::MacroAssembler::jnzPtr):
3159         (JSC::MacroAssembler::jzPtr):
3160         * jit/JIT.cpp:
3161         (JSC::JIT::privateCompileMainPass):
3162         * jit/JIT.h:
3163         * jit/JITArithmetic.cpp:
3164         (JSC::JIT::compileBinaryArithOpSlowCase):
3165         * jit/JITInlineMethods.h:
3166         (JSC::JIT::emitJumpIfJSCell):
3167         (JSC::JIT::emitJumpIfNotJSCell):
3168         (JSC::JIT::emitJumpIfImmediateNumber):
3169         (JSC::JIT::emitJumpIfNotImmediateNumber):
3170         (JSC::JIT::emitJumpIfImmediateInteger):
3171         (JSC::JIT::emitJumpIfNotImmediateInteger):
3172         (JSC::JIT::emitFastArithIntToImmNoCheck):
3173
3174 2009-01-16  Gavin Barraclough  <barraclough@apple.com>
3175
3176         Reviewed by Oliver Hunt.
3177
3178         Add support to x86-64 JIT for inline double precision arithmetic ops.
3179         +5/6% on x86-64, JIT enabled, sunspider.
3180
3181         * assembler/MacroAssembler.h:
3182         (JSC::MacroAssembler::addPtr):
3183         * assembler/X86Assembler.h:
3184         (JSC::X86Assembler::movq_rr):
3185         * jit/JIT.h:
3186         * jit/JITArithmetic.cpp:
3187         (JSC::JIT::compileFastArith_op_pre_inc):
3188         (JSC::JIT::compileBinaryArithOp):
3189         (JSC::JIT::compileBinaryArithOpSlowCase):
3190         (JSC::JIT::compileFastArith_op_add):
3191         (JSC::JIT::compileFastArithSlow_op_add):
3192         (JSC::JIT::compileFastArith_op_mul):
3193         (JSC::JIT::compileFastArithSlow_op_mul):
3194         (JSC::JIT::compileFastArith_op_sub):
3195         (JSC::JIT::compileFastArithSlow_op_sub):
3196         * parser/ResultType.h:
3197         (JSC::ResultType::isReusable):
3198         (JSC::ResultType::isInt32):
3199         (JSC::ResultType::definitelyIsNumber):
3200         (JSC::ResultType::mightBeNumber):
3201         (JSC::ResultType::isNotNumber):
3202         (JSC::ResultType::unknownType):
3203
3204 2009-01-16  Gavin Barraclough  <barraclough@apple.com>
3205
3206         Reviewed by Geoff Garen.
3207
3208         Fixes for SamplingTool.
3209
3210         https://bugs.webkit.org/show_bug.cgi?id=23390
3211
3212         * assembler/MacroAssembler.h:
3213         (JSC::MacroAssembler::storePtr):
3214         * bytecode/SamplingTool.cpp:
3215         (JSC::SamplingTool::run):
3216         (JSC::SamplingTool::dump):
3217         * bytecode/SamplingTool.h:
3218         (JSC::SamplingTool::encodeSample):
3219         * jit/JIT.cpp:
3220         (JSC::JIT::privateCompileMainPass):
3221         (JSC::JIT::privateCompile):
3222         * jit/JIT.h:
3223         (JSC::JIT::samplingToolTrackCodeBlock):
3224         * jit/JITCall.cpp:
3225         (JSC::JIT::compileOpCall):
3226         (JSC::JIT::compileOpCallSlowCase):
3227         * jit/JITInlineMethods.h:
3228         (JSC::JIT::emitCTICall_internal):
3229
3230 2009-01-16  Geoffrey Garen  <ggaren@apple.com>
3231
3232         Reviewed by Darin Adler.
3233         
3234         Fixed <rdar://problem/6452301> REGRESSION: Latest WebKit nightlies
3235         turn "c" into "" when stripping \\c_ character
3236
3237         * wrec/WRECParser.cpp:
3238         (JSC::WREC::Parser::consumeEscape): Mimic a Firefox quirk when parsing
3239         control escapes inside character classes.
3240
3241 2009-01-16  Adam Roben  <aroben@apple.com>
3242
3243         Windows build fix
3244
3245         * wrec/WRECParser.cpp:
3246         (JSC::WREC::Parser::parseParentheses): Removed unreachable code.
3247
3248 2009-01-15  Geoffrey Garen  <ggaren@apple.com>
3249
3250         Reviewed by Cameron Zwarich.
3251         
3252         Fixed <rdar://problem/6471394> REGRESSION (r39164): Discarding quantifier
3253         on assertion gives incorrect result (23075)
3254         
3255         https://bugs.webkit.org/show_bug.cgi?id=23075
3256
3257         * pcre/pcre_compile.cpp:
3258         (compileBranch): Throw away an assertion if it's followed by a quantifier
3259         with a 0 minimum, to match SpiderMonkey, v8, and the ECMA spec.
3260
3261         * wrec/WRECParser.cpp:
3262         (JSC::WREC::Parser::parseParentheses): Fall back on PCRE for the rare
3263         case of an assertion with a quantifier with a 0 minimum, since we
3264         don't handle quantified subexpressions yet, and in this special case,
3265         we can't just throw away the quantifier.
3266
3267 2009-01-15  Gavin Barraclough  <barraclough@apple.com>
3268
3269         Reviewed by Oliver Hunt.
3270
3271         Add support in ResultType to track that the results of bitops
3272         are always of type int32_t.
3273
3274         * parser/Nodes.cpp:
3275         (JSC::ReadModifyResolveNode::emitBytecode):
3276         (JSC::ReadModifyDotNode::emitBytecode):
3277         (JSC::ReadModifyBracketNode::emitBytecode):
3278         * parser/Nodes.h:
3279         (JSC::ExpressionNode::):
3280         (JSC::BooleanNode::):
3281         (JSC::NumberNode::):
3282         (JSC::StringNode::):
3283         (JSC::PrePostResolveNode::):
3284         (JSC::TypeOfResolveNode::):
3285         (JSC::TypeOfValueNode::):
3286         (JSC::UnaryPlusNode::):
3287         (JSC::NegateNode::):
3288         (JSC::BitwiseNotNode::):
3289         (JSC::LogicalNotNode::):
3290         (JSC::MultNode::):
3291         (JSC::DivNode::):
3292         (JSC::ModNode::):
3293         (JSC::SubNode::):
3294         (JSC::LeftShiftNode::):
3295         (JSC::RightShiftNode::):
3296         (JSC::UnsignedRightShiftNode::):
3297         (JSC::LessNode::):
3298         (JSC::GreaterNode::):
3299         (JSC::LessEqNode::):
3300         (JSC::GreaterEqNode::):
3301         (JSC::InstanceOfNode::):
3302         (JSC::EqualNode::):
3303         (JSC::NotEqualNode::):
3304         (JSC::StrictEqualNode::):
3305         (JSC::NotStrictEqualNode::):
3306         (JSC::BitAndNode::):
3307         (JSC::BitOrNode::):
3308         (JSC::BitXOrNode::):
3309         (JSC::LogicalOpNode::):
3310         * parser/ResultType.h:
3311         (JSC::ResultType::isInt32):
3312         (JSC::ResultType::isNotNumber):
3313         (JSC::ResultType::booleanType):
3314         (JSC::ResultType::numberType):
3315         (JSC::ResultType::numberTypeCanReuse):
3316         (JSC::ResultType::numberTypeCanReuseIsInt32):
3317         (JSC::ResultType::stringOrNumberTypeCanReuse):
3318         (JSC::ResultType::stringType):
3319         (JSC::ResultType::unknownType):
3320         (JSC::ResultType::forAdd):
3321         (JSC::ResultType::forBitOp):
3322         (JSC::OperandTypes::OperandTypes):
3323
3324 2009-01-15  Gavin Barraclough  <barraclough@apple.com>
3325
3326         Reviewed by Oliver Hunt.
3327
3328         Add support for integer addition, subtraction and multiplication
3329         in JIT code on x86-64.
3330
3331         * assembler/MacroAssembler.h:
3332         (JSC::MacroAssembler::mul32):
3333         (JSC::MacroAssembler::sub32):
3334         (JSC::MacroAssembler::joMul32):
3335         (JSC::MacroAssembler::joSub32):
3336         * jit/JIT.cpp:
3337         (JSC::JIT::privateCompileMainPass):
3338         (JSC::JIT::privateCompileSlowCases):
3339         * jit/JIT.h:
3340         * jit/JITArithmetic.cpp:
3341         (JSC::JIT::compileFastArith_op_add):
3342         (JSC::JIT::compileFastArithSlow_op_add):
3343         (JSC::JIT::compileFastArith_op_mul):
3344         (JSC::JIT::compileFastArithSlow_op_mul):
3345         (JSC::JIT::compileFastArith_op_sub):
3346         (JSC::JIT::compileFastArithSlow_op_sub):
3347
3348 2009-01-15  Gavin Barraclough  <barraclough@apple.com>
3349
3350         Reviewed by Geoff Garen.
3351
3352         On x86-64 allow JSImmediate to encode 64-bit double precision values.
3353         This patch only affects builds that set USE(ALTERNATE_JSIMMEDIATE).
3354         Updates the implementation of JSValuePtr:: and JSImmediate:: methods
3355         that operate on neumeric values to be be aware of the new representation.
3356         When this representation is in use, the class JSNumberCell is redundant
3357         and is compiled out.
3358
3359         The format of the new immediate representation is documented in JSImmediate.h.
3360
3361         * JavaScriptCore.exp:
3362         * assembler/MacroAssembler.h:
3363         (JSC::MacroAssembler::subPtr):
3364         * assembler/X86Assembler.h:
3365         (JSC::X86Assembler::):
3366         (JSC::X86Assembler::subq_rr):
3367         (JSC::X86Assembler::movq_rr):
3368         (JSC::X86Assembler::ucomisd_rr):
3369         (JSC::X86Assembler::X86InstructionFormatter::twoByteOp64):
3370         * interpreter/Interpreter.cpp:
3371         (JSC::Interpreter::cti_op_stricteq):
3372         (JSC::Interpreter::cti_op_nstricteq):
3373         * jit/JIT.cpp:
3374         (JSC::JIT::compileOpStrictEq):
3375         (JSC::JIT::privateCompileMainPass):
3376         (JSC::JIT::privateCompileSlowCases):
3377         * jit/JIT.h:
3378         * jit/JITArithmetic.cpp:
3379         (JSC::JIT::compileFastArith_op_lshift):
3380         (JSC::JIT::compileFastArith_op_rshift):
3381         (JSC::JIT::compileFastArith_op_bitand):
3382         (JSC::JIT::compileFastArith_op_mod):
3383         (JSC::JIT::compileFastArith_op_add):
3384         (JSC::JIT::compileFastArith_op_mul):
3385         (JSC::JIT::compileFastArith_op_post_inc):
3386         (JSC::JIT::compileFastArith_op_post_dec):
3387         (JSC::JIT::compileFastArith_op_pre_inc):
3388         (JSC::JIT::compileFastArith_op_pre_dec):
3389         (JSC::JIT::putDoubleResultToJSNumberCellOrJSImmediate):
3390         (JSC::JIT::compileBinaryArithOp):
3391         * jit/JITInlineMethods.h:
3392         (JSC::JIT::emitJumpIfBothJSCells):
3393         (JSC::JIT::emitJumpIfEitherNumber):
3394         (JSC::JIT::emitJumpIfNotEitherNumber):
3395         (JSC::JIT::emitJumpIfImmediateIntegerNumber):
3396         (JSC::JIT::emitJumpIfNotImmediateIntegerNumber):
3397         (JSC::JIT::emitJumpIfNotImmediateIntegerNumbers):
3398         (JSC::JIT::emitJumpSlowCaseIfNotImmediateIntegerNumber):
3399         (JSC::JIT::emitJumpSlowCaseIfNotImmediateIntegerNumbers):
3400         (JSC::JIT::emitFastArithDeTagImmediate):
3401         (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero):
3402         (JSC::JIT::emitFastArithReTagImmediate):
3403         (JSC::JIT::emitFastArithIntToImmNoCheck):
3404         * runtime/JSCell.h:
3405         * runtime/JSGlobalData.cpp:
3406         (JSC::JSGlobalData::JSGlobalData):
3407         * runtime/JSImmediate.cpp:
3408         (JSC::JSImmediate::toThisObject):
3409         (JSC::JSImmediate::toObject):
3410         (JSC::JSImmediate::toString):
3411         * runtime/JSImmediate.h:
3412         (JSC::wtf_reinterpret_cast):
3413         (JSC::JSImmediate::isNumber):
3414         (JSC::JSImmediate::isIntegerNumber):
3415         (JSC::JSImmediate::isDoubleNumber):
3416         (JSC::JSImmediate::isPositiveIntegerNumber):
3417         (JSC::JSImmediate::areBothImmediateIntegerNumbers):
3418         (JSC::JSImmediate::makeInt):
3419         (JSC::JSImmediate::makeDouble):
3420         (JSC::JSImmediate::doubleValue):
3421         (JSC::doubleToBoolean):
3422         (JSC::JSImmediate::toBoolean):
3423         (JSC::JSImmediate::getTruncatedUInt32):
3424         (JSC::JSImmediate::makeOutOfIntegerRange):
3425         (JSC::JSImmediate::from):
3426         (JSC::JSImmediate::getTruncatedInt32):
3427         (JSC::JSImmediate::toDouble):
3428         (JSC::JSImmediate::getUInt32):
3429         (JSC::JSValuePtr::isInt32Fast):
3430         (JSC::JSValuePtr::isUInt32Fast):
3431         (JSC::JSValuePtr::areBothInt32Fast):
3432         (JSC::JSFastMath::canDoFastBitwiseOperations):
3433         (JSC::JSFastMath::xorImmediateNumbers):
3434         (JSC::JSFastMath::canDoFastRshift):
3435         (JSC::JSFastMath::canDoFastUrshift):
3436         (JSC::JSFastMath::rightShiftImmediateNumbers):
3437         (JSC::JSFastMath::canDoFastAdditiveOperations):
3438         (JSC::JSFastMath::addImmediateNumbers):
3439         (JSC::JSFastMath::subImmediateNumbers):
3440         * runtime/JSNumberCell.cpp:
3441         (JSC::jsNumberCell):
3442         * runtime/JSNumberCell.h:
3443         (JSC::createNumberStructure):
3444         (JSC::isNumberCell):
3445         (JSC::asNumberCell):
3446         (JSC::jsNumber):
3447         (JSC::JSValuePtr::isDoubleNumber):
3448         (JSC::JSValuePtr::getDoubleNumber):
3449         (JSC::JSValuePtr::isNumber):
3450         (JSC::JSValuePtr::uncheckedGetNumber):
3451         (JSC::jsNaN):
3452         (JSC::JSValuePtr::getNumber):
3453         (JSC::JSValuePtr::numberToInt32):
3454         (JSC::JSValuePtr::numberToUInt32):
3455         * runtime/JSValue.h:
3456         * runtime/NumberConstructor.cpp:
3457         (JSC::numberConstructorNegInfinity):
3458         (JSC::numberConstructorPosInfinity):
3459         (JSC::numberConstructorMaxValue):
3460         (JSC::numberConstructorMinValue):
3461         * runtime/NumberObject.cpp:
3462         (JSC::constructNumber):
3463         * runtime/NumberObject.h:
3464         * runtime/Operations.h:
3465         (JSC::JSValuePtr::equal):
3466         (JSC::JSValuePtr::equalSlowCaseInline):
3467         (JSC::JSValuePtr::strictEqual):
3468         (JSC::JSValuePtr::strictEqualSlowCaseInline):
3469         * wtf/Platform.h:
3470
3471 2009-01-15  Sam Weinig  <sam@webkit.org>
3472
3473         Reviewed by Geoffrey Garen.
3474
3475         <rdar://problem/6045018>
3476         REGRESSION (r34838): JavaScript objects appear to be leaked after loading google.com
3477
3478         Subtract the number of JSStrings cached in SmallStrings when calculating the
3479         number of live JSObjects.
3480
3481         * runtime/Collector.cpp:
3482         (JSC::Heap::objectCount):
3483         * runtime/SmallStrings.cpp:
3484         (JSC::SmallStrings::count):
3485         * runtime/SmallStrings.h:
3486
3487 2009-01-15  Sam Weinig  <sam@webkit.org>
3488
3489         Fix Qt build.
3490
3491         * runtime/Collector.cpp:
3492
3493 2009-01-15  Sam Weinig  <sam@webkit.org>
3494
3495         Reviewed by Gavin Barraclough.
3496
3497         Fix crash seen running fast/canvas.
3498
3499         Make sure to mark the ScopeNode and CodeBlock being created
3500         in the re-parse for exception information.
3501
3502         * bytecode/CodeBlock.cpp:
3503         (JSC::CodeBlock::reparseForExceptionInfoIfNecessary):
3504         * parser/Nodes.h:
3505         (JSC::ScopeNode::mark):
3506         * runtime/Collector.cpp:
3507         (JSC::Heap::collect):
3508         * runtime/JSGlobalData.cpp:
3509         (JSC::JSGlobalData::JSGlobalData):
3510         * runtime/JSGlobalData.h:
3511
3512 2009-01-15  Craig Schlenter  <craig.schlenter@gmail.com>
3513
3514         Reviewed by Darin Adler.
3515
3516         https://bugs.webkit.org/show_bug.cgi?id=23347
3517         Compilation of JavaScriptCore/wtf/ThreadingPthreads.cpp fails on Linux
3518
3519         * wtf/ThreadingPthreads.cpp: included limits.h as INT_MAX is defined there.
3520
3521 2009-01-15  Oliver Hunt  <oliver@apple.com>
3522
3523         Reviewed by Geoff Garen.
3524
3525         Bug 23225: REGRESSION: Assertion failure in reparseInPlace() (m_sourceElements) at sfgate.com
3526         <https://bugs.webkit.org/show_bug.cgi?id=23225> <rdar://problem/6487432>
3527
3528         Character position for open and closing brace was incorrectly referencing m_position to
3529         record their position in a source document, however this is unsafe as BOMs may lead to
3530         m_position being an arbitrary position from the real position of the current character.
3531
3532         * parser/Lexer.cpp:
3533         (JSC::Lexer::matchPunctuator):
3534
3535 2009-01-14  David Kilzer  <ddkilzer@apple.com>
3536
3537         Bug 23153: JSC build always touches JavaScriptCore/docs/bytecode.html
3538
3539         <https://bugs.webkit.org/show_bug.cgi?id=23153>
3540
3541         Reviewed by Darin Adler.
3542
3543         Instead of building bytecode.html into ${SRCROOT}/docs/bytecode.html, build it
3544         into ${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore/docs/bytecode.html.
3545
3546         Also fixes make-bytecode-docs.pl to actually generate documentation.
3547
3548         * DerivedSources.make: Changed bytecode.html to be built into local docs
3549         directory in ${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore.
3550         * JavaScriptCore.xcodeproj/project.pbxproj: Added "/docs" to the end of the
3551         "mkdir -p" command so that the docs subdirectory is automatically created.
3552         * docs/make-bytecode-docs.pl: Changed BEGIN_OPCODE to DEFINE_OPCODE so that
3553         documentation is actually generated.
3554
3555 2009-01-14  Adam Treat  <adam.treat@torchmobile.com>
3556