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