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