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