d4138acb11b4c7d3d839db699d586e62a67b57af
[WebKit-https.git] / JavaScriptCore / ChangeLog
1 2008-12-26  Sam Weinig  <sam@webkit.org>
2
3         Reviewed by Alexey Proskuryakov.
4
5         Remove unused method.
6
7         * runtime/Structure.h: Remove mutableTypeInfo.
8
9 2008-12-22  Gavin Barraclough  <barraclough@apple.com>
10
11         Reviewed by Oliver Hunt.
12
13         Fix rounding / bounds / signed comparison bug in ExecutableAllocator.
14
15         ExecutableAllocator::alloc assumed that m_freePtr would be aligned.  This was
16         not always true, since the first allocation from an additional pool would not
17         be rounded up.  Subsequent allocations would be unaligned, and too much memory
18         could be erroneously allocated from the pool, when the size requested was
19         available, but the size rounded up to word granularity was not available in the
20         pool.  This may result in the value of m_freePtr being greater than m_end.
21
22         Under these circumstances, the unsigned check for space will always pass,
23         resulting in pointers to memory outside of the arena being returned, and
24         ultimately segfaulty goodness when attempting to memcpy the hot freshly jitted
25         code from the AssemblerBuffer.
26
27         https://bugs.webkit.org/show_bug.cgi?id=22974
28         ... and probably many, many more.
29
30         * jit/ExecutableAllocator.h:
31         (JSC::ExecutablePool::alloc):
32         (JSC::ExecutablePool::roundUpAllocationSize):
33         (JSC::ExecutablePool::ExecutablePool):
34         (JSC::ExecutablePool::poolAllocate):
35
36 2008-12-22  Sam Weinig  <sam@webkit.org>
37
38         Reviewed by Gavin Barraclough.
39
40         Rename all uses of the term "repatch" to "patch".
41
42         * assembler/MacroAssembler.h:
43         (JSC::MacroAssembler::DataLabelPtr::patch):
44         (JSC::MacroAssembler::DataLabel32::patch):
45         (JSC::MacroAssembler::Jump::patch):
46         (JSC::MacroAssembler::PatchBuffer::PatchBuffer):
47         (JSC::MacroAssembler::PatchBuffer::setPtr):
48         (JSC::MacroAssembler::loadPtrWithAddressOffsetPatch):
49         (JSC::MacroAssembler::storePtrWithAddressOffsetPatch):
50         (JSC::MacroAssembler::storePtrWithPatch):
51         (JSC::MacroAssembler::jnePtrWithPatch):
52         * assembler/X86Assembler.h:
53         (JSC::X86Assembler::patchAddress):
54         (JSC::X86Assembler::patchImmediate):
55         (JSC::X86Assembler::patchPointer):
56         (JSC::X86Assembler::patchBranchOffset):
57         * interpreter/Interpreter.cpp:
58         (JSC::Interpreter::tryCTICachePutByID):
59         (JSC::Interpreter::tryCTICacheGetByID):
60         (JSC::Interpreter::cti_op_put_by_id):
61         (JSC::Interpreter::cti_op_get_by_id):
62         (JSC::Interpreter::cti_op_get_by_id_self_fail):
63         (JSC::Interpreter::cti_op_get_by_id_proto_list):
64         (JSC::Interpreter::cti_vm_dontLazyLinkCall):
65         * jit/JIT.cpp:
66         (JSC::ctiPatchCallByReturnAddress):
67         (JSC::JIT::privateCompileMainPass):
68         (JSC::JIT::privateCompile):
69         (JSC::JIT::privateCompileCTIMachineTrampolines):
70         * jit/JIT.h:
71         * jit/JITCall.cpp:
72         (JSC::JIT::unlinkCall):
73         (JSC::JIT::linkCall):
74         (JSC::JIT::compileOpCall):
75         * jit/JITPropertyAccess.cpp:
76         (JSC::JIT::compileGetByIdHotPath):
77         (JSC::JIT::compilePutByIdHotPath):
78         (JSC::JIT::compileGetByIdSlowCase):
79         (JSC::JIT::compilePutByIdSlowCase):
80         (JSC::JIT::privateCompilePutByIdTransition):
81         (JSC::JIT::patchGetByIdSelf):
82         (JSC::JIT::patchPutByIdReplace):
83         (JSC::JIT::privateCompilePatchGetArrayLength):
84         (JSC::JIT::privateCompileGetByIdSelf):
85         (JSC::JIT::privateCompileGetByIdProto):
86         (JSC::JIT::privateCompileGetByIdSelfList):
87         (JSC::JIT::privateCompileGetByIdProtoList):
88         (JSC::JIT::privateCompileGetByIdChainList):
89         (JSC::JIT::privateCompileGetByIdChain):
90         (JSC::JIT::privateCompilePutByIdReplace):
91
92 2008-12-22  Adam Roben  <aroben@apple.com>
93
94         Build fix after r39428
95
96         * jit/JITCall.cpp:
97         (JSC::JIT::compileOpCallSlowCase): Added a missing MacroAssembler::
98
99 2008-12-22  Nikolas Zimmermann  <nikolas.zimmermann@torchmobile.com>
100
101         Rubber-stamped by George Staikos.
102
103         Unify all TorchMobile copyright lines. Consolidate in a single line, as requested by Mark Rowe, some time ago.
104
105         * wtf/RandomNumber.cpp:
106         * wtf/RandomNumber.h:
107         * wtf/RandomNumberSeed.h:
108
109 2008-12-21  Nikolas Zimmermann  <nikolas.zimmermann@torchmobile.com>
110
111         Rubber-stamped by George Staikos.
112
113         Fix copyright of the new RandomNumber* files.
114
115         * wtf/RandomNumber.cpp:
116         * wtf/RandomNumber.h:
117         * wtf/RandomNumberSeed.h:
118
119 2008-12-21  Gavin Barraclough  <barraclough@apple.com>
120
121         Reviewed by Oliver Hunt & Cameron Zwarich.
122
123         Add support for call and property access repatching on x86-64.
124
125         No change in performance on current configurations (2x impovement on v8-tests with JIT enabled on x86-64).
126
127         * assembler/MacroAssembler.h:
128         (JSC::MacroAssembler::DataLabelPtr::repatch):
129         (JSC::MacroAssembler::DataLabelPtr::operator X86Assembler::JmpDst):
130         (JSC::MacroAssembler::DataLabel32::repatch):
131         (JSC::MacroAssembler::RepatchBuffer::addressOf):
132         (JSC::MacroAssembler::add32):
133         (JSC::MacroAssembler::sub32):
134         (JSC::MacroAssembler::loadPtrWithAddressOffsetRepatch):
135         (JSC::MacroAssembler::storePtrWithAddressOffsetRepatch):
136         (JSC::MacroAssembler::jePtr):
137         (JSC::MacroAssembler::jnePtr):
138         (JSC::MacroAssembler::jnePtrWithRepatch):
139         (JSC::MacroAssembler::differenceBetween):
140         * assembler/X86Assembler.h:
141         (JSC::X86Assembler::addl_im):
142         (JSC::X86Assembler::subl_im):
143         (JSC::X86Assembler::cmpl_rm):
144         (JSC::X86Assembler::movq_rm_disp32):
145         (JSC::X86Assembler::movq_mr_disp32):
146         (JSC::X86Assembler::repatchPointer):
147         (JSC::X86Assembler::X86InstructionFormatter::oneByteOp64_disp32):
148         * jit/JIT.cpp:
149         (JSC::JIT::privateCompile):
150         (JSC::JIT::privateCompileCTIMachineTrampolines):
151         * jit/JIT.h:
152         * jit/JITCall.cpp:
153         (JSC::JIT::unlinkCall):
154         (JSC::JIT::linkCall):
155         (JSC::JIT::compileOpCall):
156         (JSC::JIT::compileOpCallSlowCase):
157         * jit/JITInlineMethods.h:
158         (JSC::JIT::restoreArgumentReferenceForTrampoline):
159         * jit/JITPropertyAccess.cpp:
160         (JSC::JIT::compileGetByIdHotPath):
161         (JSC::JIT::compileGetByIdSlowCase):
162         (JSC::JIT::compilePutByIdHotPath):
163         (JSC::JIT::compilePutByIdSlowCase):
164         (JSC::resizePropertyStorage):
165         (JSC::JIT::privateCompilePutByIdTransition):
166         (JSC::JIT::privateCompileGetByIdProto):
167         (JSC::JIT::privateCompileGetByIdProtoList):
168         (JSC::JIT::privateCompileGetByIdChainList):
169         (JSC::JIT::privateCompileGetByIdChain):
170         * wtf/Platform.h:
171
172 2008-12-20  Gavin Barraclough  <barraclough@apple.com>
173
174         Reviewed by Oliver Hunt.
175
176         Port optimized property access generation to the MacroAssembler.
177
178         * assembler/MacroAssembler.h:
179         (JSC::MacroAssembler::AbsoluteAddress::AbsoluteAddress):
180         (JSC::MacroAssembler::DataLabelPtr::repatch):
181         (JSC::MacroAssembler::DataLabel32::DataLabel32):
182         (JSC::MacroAssembler::DataLabel32::repatch):
183         (JSC::MacroAssembler::Label::operator X86Assembler::JmpDst):
184         (JSC::MacroAssembler::Jump::repatch):
185         (JSC::MacroAssembler::JumpList::empty):
186         (JSC::MacroAssembler::RepatchBuffer::link):
187         (JSC::MacroAssembler::add32):
188         (JSC::MacroAssembler::and32):
189         (JSC::MacroAssembler::sub32):
190         (JSC::MacroAssembler::loadPtrWithAddressRepatch):
191         (JSC::MacroAssembler::storePtrWithAddressRepatch):
192         (JSC::MacroAssembler::push):
193         (JSC::MacroAssembler::ja32):
194         (JSC::MacroAssembler::jePtr):
195         (JSC::MacroAssembler::jnePtr):
196         (JSC::MacroAssembler::jnePtrWithRepatch):
197         (JSC::MacroAssembler::align):
198         (JSC::MacroAssembler::differenceBetween):
199         * assembler/X86Assembler.h:
200         (JSC::X86Assembler::movl_rm_disp32):
201         (JSC::X86Assembler::movl_mr_disp32):
202         (JSC::X86Assembler::X86InstructionFormatter::oneByteOp_disp32):
203         (JSC::X86Assembler::X86InstructionFormatter::memoryModRM):
204         * jit/JIT.cpp:
205         (JSC::ctiRepatchCallByReturnAddress):
206         (JSC::JIT::privateCompileMainPass):
207         (JSC::JIT::privateCompile):
208         (JSC::JIT::privateCompileCTIMachineTrampolines):
209         * jit/JIT.h:
210         * jit/JITPropertyAccess.cpp:
211         (JSC::JIT::compileGetByIdHotPath):
212         (JSC::JIT::compileGetByIdSlowCase):
213         (JSC::JIT::compilePutByIdHotPath):
214         (JSC::JIT::compilePutByIdSlowCase):
215         (JSC::resizePropertyStorage):
216         (JSC::JIT::privateCompilePutByIdTransition):
217         (JSC::JIT::patchGetByIdSelf):
218         (JSC::JIT::patchPutByIdReplace):
219         (JSC::JIT::privateCompilePatchGetArrayLength):
220         (JSC::JIT::privateCompileGetByIdSelf):
221         (JSC::JIT::privateCompileGetByIdProto):
222         (JSC::JIT::privateCompileGetByIdSelfList):
223         (JSC::JIT::privateCompileGetByIdProtoList):
224         (JSC::JIT::privateCompileGetByIdChainList):
225         (JSC::JIT::privateCompileGetByIdChain):
226         (JSC::JIT::privateCompilePutByIdReplace):
227         * wtf/RefCounted.h:
228         (WTF::RefCountedBase::addressOfCount):
229
230 2008-12-19  Gustavo Noronha Silva  <gns@gnome.org>
231
232         Reviewed by Holger Freyther.
233
234         https://bugs.webkit.org/show_bug.cgi?id=22686
235
236         Added file which was missing to the javascriptcore_sources
237         variable, so that it shows up in the tarball created by `make
238         dist'.
239
240         * GNUmakefile.am:
241
242 2008-12-19  Holger Hans Peter Freyther  <zecke@selfish.org>
243
244         Reviewed by Antti Koivisto.
245
246         Build fix when building JS API tests with a c89 c compiler
247
248         Do not use C++ style comments and convert them to C comments.
249
250         * wtf/Platform.h:
251
252 2008-12-18  Gavin Barraclough  <barraclough@apple.com>
253
254         Reviewed by Sam Weinig.
255
256         Same as last revision, adding cases for pre & post inc & dec.
257
258         https://bugs.webkit.org/show_bug.cgi?id=22928
259
260         * jit/JIT.cpp:
261         (JSC::JIT::privateCompileMainPass):
262
263 2008-12-18  Gavin Barraclough  <barraclough@apple.com>
264
265         Reviewed by Sam Weinig.
266
267         Fixes for the JIT's handling of JSImmediate values on x86-64.
268         On 64-bit systems, the code in JSImmediate.h relies on the upper
269         bits of a JSImmediate being a sign extension of the low 32-bits.
270         This was not being enforced by the JIT, since a number of inline
271         operations were being performed on 32-bit values in registers, and
272         when a 32-bit result is written to a register on x86-64 the value
273         is zero-extended to 64-bits.
274         
275         This fix honors previous behavoir.  A better fix in the long run
276         (when the JIT is enabled by default) may be to change JSImmediate.h
277         so it no longer relies on the upper bits of the pointer,... though
278         if we're going to change JSImmediate.h for 64-bit, we probably may
279         as well change the format so that the full range of 32-bit ints can
280         be stored, rather than just 31-bits.
281
282         https://bugs.webkit.org/show_bug.cgi?id=22925
283
284         * assembler/MacroAssembler.h:
285         (JSC::MacroAssembler::addPtr):
286         (JSC::MacroAssembler::andPtr):
287         (JSC::MacroAssembler::orPtr):
288         (JSC::MacroAssembler::or32):
289         (JSC::MacroAssembler::xor32):
290         (JSC::MacroAssembler::xorPtr):
291         (JSC::MacroAssembler::signExtend32ToPtr):
292         * assembler/X86Assembler.h:
293         (JSC::X86Assembler::):
294         (JSC::X86Assembler::andq_rr):
295         (JSC::X86Assembler::andq_ir):
296         (JSC::X86Assembler::orq_rr):
297         (JSC::X86Assembler::xorq_ir):
298         (JSC::X86Assembler::movsxd_rr):
299         * jit/JIT.cpp:
300         (JSC::JIT::privateCompileMainPass):
301         * jit/JITInlineMethods.h:
302         (JSC::JIT::emitFastArithReTagImmediate):
303         (JSC::JIT::emitFastArithPotentiallyReTagImmediate):
304         (JSC::JIT::emitFastArithImmToInt):
305
306 2008-12-18  Gavin Barraclough  <barraclough@apple.com>
307
308         Reviewed by Sam Weinig.
309
310         Just a tidy up - rename & refactor some the #defines configuring the JIT.
311
312         * interpreter/Interpreter.cpp:
313         (JSC::Interpreter::cti_op_convert_this):
314         (JSC::Interpreter::cti_op_end):
315         (JSC::Interpreter::cti_op_add):
316         (JSC::Interpreter::cti_op_pre_inc):
317         (JSC::Interpreter::cti_timeout_check):
318         (JSC::Interpreter::cti_register_file_check):
319         (JSC::Interpreter::cti_op_loop_if_less):
320         (JSC::Interpreter::cti_op_loop_if_lesseq):
321         (JSC::Interpreter::cti_op_new_object):
322         (JSC::Interpreter::cti_op_put_by_id_generic):
323         (JSC::Interpreter::cti_op_get_by_id_generic):
324         (JSC::Interpreter::cti_op_put_by_id):
325         (JSC::Interpreter::cti_op_put_by_id_second):
326         (JSC::Interpreter::cti_op_put_by_id_fail):
327         (JSC::Interpreter::cti_op_get_by_id):
328         (JSC::Interpreter::cti_op_get_by_id_second):
329         (JSC::Interpreter::cti_op_get_by_id_self_fail):
330         (JSC::Interpreter::cti_op_get_by_id_proto_list):
331         (JSC::Interpreter::cti_op_get_by_id_proto_list_full):
332         (JSC::Interpreter::cti_op_get_by_id_proto_fail):
333         (JSC::Interpreter::cti_op_get_by_id_array_fail):
334         (JSC::Interpreter::cti_op_get_by_id_string_fail):
335         (JSC::Interpreter::cti_op_instanceof):
336         (JSC::Interpreter::cti_op_del_by_id):
337         (JSC::Interpreter::cti_op_mul):
338         (JSC::Interpreter::cti_op_new_func):
339         (JSC::Interpreter::cti_op_call_JSFunction):
340         (JSC::Interpreter::cti_op_call_arityCheck):
341         (JSC::Interpreter::cti_vm_dontLazyLinkCall):
342         (JSC::Interpreter::cti_vm_lazyLinkCall):
343         (JSC::Interpreter::cti_op_push_activation):
344         (JSC::Interpreter::cti_op_call_NotJSFunction):
345         (JSC::Interpreter::cti_op_create_arguments):
346         (JSC::Interpreter::cti_op_create_arguments_no_params):
347         (JSC::Interpreter::cti_op_tear_off_activation):
348         (JSC::Interpreter::cti_op_tear_off_arguments):
349         (JSC::Interpreter::cti_op_profile_will_call):
350         (JSC::Interpreter::cti_op_profile_did_call):
351         (JSC::Interpreter::cti_op_ret_scopeChain):
352         (JSC::Interpreter::cti_op_new_array):
353         (JSC::Interpreter::cti_op_resolve):
354         (JSC::Interpreter::cti_op_construct_JSConstruct):
355         (JSC::Interpreter::cti_op_construct_NotJSConstruct):
356         (JSC::Interpreter::cti_op_get_by_val):
357         (JSC::Interpreter::cti_op_resolve_func):
358         (JSC::Interpreter::cti_op_sub):
359         (JSC::Interpreter::cti_op_put_by_val):
360         (JSC::Interpreter::cti_op_put_by_val_array):
361         (JSC::Interpreter::cti_op_lesseq):
362         (JSC::Interpreter::cti_op_loop_if_true):
363         (JSC::Interpreter::cti_op_negate):
364         (JSC::Interpreter::cti_op_resolve_base):
365         (JSC::Interpreter::cti_op_resolve_skip):
366         (JSC::Interpreter::cti_op_resolve_global):
367         (JSC::Interpreter::cti_op_div):
368         (JSC::Interpreter::cti_op_pre_dec):
369         (JSC::Interpreter::cti_op_jless):
370         (JSC::Interpreter::cti_op_not):
371         (JSC::Interpreter::cti_op_jtrue):
372         (JSC::Interpreter::cti_op_post_inc):
373         (JSC::Interpreter::cti_op_eq):
374         (JSC::Interpreter::cti_op_lshift):
375         (JSC::Interpreter::cti_op_bitand):
376         (JSC::Interpreter::cti_op_rshift):
377         (JSC::Interpreter::cti_op_bitnot):
378         (JSC::Interpreter::cti_op_resolve_with_base):
379         (JSC::Interpreter::cti_op_new_func_exp):
380         (JSC::Interpreter::cti_op_mod):
381         (JSC::Interpreter::cti_op_less):
382         (JSC::Interpreter::cti_op_neq):
383         (JSC::Interpreter::cti_op_post_dec):
384         (JSC::Interpreter::cti_op_urshift):
385         (JSC::Interpreter::cti_op_bitxor):
386         (JSC::Interpreter::cti_op_new_regexp):
387         (JSC::Interpreter::cti_op_bitor):
388         (JSC::Interpreter::cti_op_call_eval):
389         (JSC::Interpreter::cti_op_throw):
390         (JSC::Interpreter::cti_op_get_pnames):
391         (JSC::Interpreter::cti_op_next_pname):
392         (JSC::Interpreter::cti_op_push_scope):
393         (JSC::Interpreter::cti_op_pop_scope):
394         (JSC::Interpreter::cti_op_typeof):
395         (JSC::Interpreter::cti_op_is_undefined):
396         (JSC::Interpreter::cti_op_is_boolean):
397         (JSC::Interpreter::cti_op_is_number):
398         (JSC::Interpreter::cti_op_is_string):
399         (JSC::Interpreter::cti_op_is_object):
400         (JSC::Interpreter::cti_op_is_function):
401         (JSC::Interpreter::cti_op_stricteq):
402         (JSC::Interpreter::cti_op_nstricteq):
403         (JSC::Interpreter::cti_op_to_jsnumber):
404         (JSC::Interpreter::cti_op_in):
405         (JSC::Interpreter::cti_op_push_new_scope):
406         (JSC::Interpreter::cti_op_jmp_scopes):
407         (JSC::Interpreter::cti_op_put_by_index):
408         (JSC::Interpreter::cti_op_switch_imm):
409         (JSC::Interpreter::cti_op_switch_char):
410         (JSC::Interpreter::cti_op_switch_string):
411         (JSC::Interpreter::cti_op_del_by_val):
412         (JSC::Interpreter::cti_op_put_getter):
413         (JSC::Interpreter::cti_op_put_setter):
414         (JSC::Interpreter::cti_op_new_error):
415         (JSC::Interpreter::cti_op_debug):
416         (JSC::Interpreter::cti_vm_throw):
417         * interpreter/Interpreter.h:
418         * jit/JIT.cpp:
419         (JSC::):
420         (JSC::JIT::privateCompileMainPass):
421         (JSC::JIT::privateCompile):
422         * jit/JIT.h:
423         * jit/JITInlineMethods.h:
424         (JSC::JIT::restoreArgumentReference):
425         (JSC::JIT::restoreArgumentReferenceForTrampoline):
426         * wtf/Platform.h:
427
428 2008-12-18  Cameron Zwarich  <zwarich@apple.com>
429
430         Reviewed by Geoff Garen.
431
432         Bug 21855: REGRESSION (r37323): Gmail complains about popup blocking when opening a link
433         <https://bugs.webkit.org/show_bug.cgi?id=21855>
434         <rdar://problem/6278244>
435
436         Move DynamicGlobalObjectScope to JSGlobalObject.h so that it can be used
437         from WebCore.
438
439         * interpreter/Interpreter.cpp:
440         * runtime/JSGlobalObject.h:
441         (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope):
442         (JSC::DynamicGlobalObjectScope::~DynamicGlobalObjectScope):
443
444 2008-12-17  Geoffrey Garen  <ggaren@apple.com>
445
446         Reviewed by Gavin Barraclough.
447         
448         Fixed https://bugs.webkit.org/show_bug.cgi?id=22393
449         Segfault when caching property accesses to primitive cells.
450         
451         Changed some asObject casts to asCell casts in cases where a primitive
452         value may be a cell and not an object.
453         
454         Re-enabled property caching for primitives in cases where it had been
455         disabled because of this bug.
456         
457         Updated a comment to better explain something Darin thought needed
458         explaining in an old patch review.
459
460         * interpreter/Interpreter.cpp:
461         (JSC::countPrototypeChainEntriesAndCheckForProxies):
462         (JSC::Interpreter::tryCacheGetByID):
463         (JSC::Interpreter::tryCTICacheGetByID):
464         (JSC::Interpreter::cti_op_get_by_id_self_fail):
465         (JSC::Interpreter::cti_op_get_by_id_proto_list):
466
467 2008-12-17  Gavin Barraclough  <barraclough@apple.com>
468
469         Reviewed by Cameron Zwarich.
470
471         Fixes for Sunspider failures with the JIT enabled on x86-64.
472
473         * assembler/MacroAssembler.h:
474             Switch the order of the RegisterID & Address form of je32, to keep it consistent with jne32.
475         * jit/JIT.cpp:
476         * jit/JIT.h:
477         * jit/JITInlineMethods.h:
478             Port the m_ctiVirtualCall tramopline generation to use the MacroAssembler interface.
479         * jit/JITCall.cpp:
480             Fix bug in the non-optimizing code path, vptr check should have been to the memory address pointer
481             to by the register, not to the register itself.
482         * wrec/WRECGenerator.cpp:
483             See assembler/MacroAssembler.h, above.
484
485 2008-12-17  Gavin Barraclough  <barraclough@apple.com>
486
487         Reviewed by Sam Weinig.
488
489         print("Hello, 64-bit jitted world!");
490         Get hello-world working through the JIT, on x86-64.
491
492         * assembler/X86Assembler.h:
493             Fix encoding of opcode + RegisterID format instructions for 64-bit.
494         * interpreter/Interpreter.cpp:
495         * interpreter/Interpreter.h:
496             Make VoidPtrPair actually be a pair of void*s.
497             (Possibly should make this change for 32-bit Mac platforms, too - but won't change 32-bit behaviour in this patch).
498         * jit/JIT.cpp:
499         * jit/JIT.h:
500             Provide names for the timeoutCheckRegister & callFrameRegister on x86-64,
501             force x86-64 ctiTrampoline arguments onto the stack,
502             implement the asm trampolines for x86-64,
503             implement the restoreArgumentReference methods for x86-64 calling conventions.
504         * jit/JITCall.cpp:
505         * jit/JITInlineMethods.h:
506         * wtf/Platform.h:
507             Add switch settings to ENABLE(JIT), on PLATFORM(X86_64) (currently still disabled).
508
509 2008-12-17  Sam Weinig  <sam@webkit.org>
510
511         Reviewed by Gavin Barraclough.
512
513         Add more CodeBlock statistics.
514
515         * bytecode/CodeBlock.cpp:
516         (JSC::CodeBlock::dumpStatistics):
517
518 2008-12-17  Sam Weinig  <sam@webkit.org>
519
520         Reviewed by Darin Adler.
521
522         Fix for https://bugs.webkit.org/show_bug.cgi?id=22897
523         <rdar://problem/6428342>
524         Look into feasibility of discarding bytecode after native codegen
525
526         Clear the bytecode Instruction vector at the end JIT generation.
527
528         Saves 4.8 MB on Membuster head.
529
530         * bytecode/CodeBlock.cpp:
531         (JSC::CodeBlock::dump): Add logging for the case that someone tries
532         to dump the instructions of a CodeBlock that has had its bytecode
533         vector cleared.
534         (JSC::CodeBlock::CodeBlock): Initialize the instructionCount
535         (JSC::CodeBlock::handlerForBytecodeOffset): Use instructionCount instead
536         of the size of the instruction vector in the assertion.
537         (JSC::CodeBlock::lineNumberForBytecodeOffset): Ditto.
538         (JSC::CodeBlock::expressionRangeForBytecodeOffset): Ditto.
539         (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset): Ditto.
540         (JSC::CodeBlock::functionRegisterForBytecodeOffset): Ditto.
541         * bytecode/CodeBlock.h:
542         (JSC::CodeBlock::setInstructionCount): Store the instruction vector size
543         in debug builds for assertions.
544         * bytecompiler/BytecodeGenerator.cpp:
545         (JSC::BytecodeGenerator::generate):
546         * jit/JIT.cpp:
547         (JSC::JIT::privateCompile): Clear the bytecode vector unless we
548         have compiled with Opcode sampling where we will continue to require it
549
550 2008-12-17  Cary Clark  <caryclark@google.com>
551
552         Reviewed by Darin Adler.
553         Landed by Adam Barth.
554
555         Add ENABLE_TEXT_CARET to permit the ANDROID platform
556         to invalidate and draw the caret in a separate thread.
557
558         * wtf/Platform.h:
559         Default ENABLE_TEXT_CARET to 1.
560
561 2008-12-17  Alexey Proskuryakov  <ap@webkit.org>
562
563         Reviewed by Darin Adler.
564
565         Don't use unique context group in JSGlobalContextCreate() on Tiger or Leopard, take two.
566
567         * API/JSContextRef.cpp: The previous patch that claimed to do this was making Tiger and
568         Leopard always use unique context group instead.
569
570 2008-12-16  Sam Weinig  <sam@webkit.org>
571
572         Reviewed by Geoffrey Garen.
573
574         Fix for https://bugs.webkit.org/show_bug.cgi?id=22838
575         Remove dependency on the bytecode Instruction buffer in Interpreter::throwException
576         Part of <rdar://problem/6428342>
577
578         * bytecode/CodeBlock.cpp:
579         (JSC::CodeBlock::functionRegisterForBytecodeOffset): Added. Function to get
580         a function Register index in a callFrame for a bytecode offset.
581         (JSC::CodeBlock::shrinkToFit): Shrink m_getByIdExceptionInfo and m_functionRegisterInfos.
582         * bytecode/CodeBlock.h:
583         (JSC::FunctionRegisterInfo::FunctionRegisterInfo): Added.
584         (JSC::CodeBlock::addFunctionRegisterInfo):
585         * bytecompiler/BytecodeGenerator.cpp:
586         (JSC::BytecodeGenerator::emitCall):
587         * interpreter/Interpreter.cpp:
588         (JSC::Interpreter::throwException): Use functionRegisterForBytecodeOffset in JIT
589         mode.
590
591 2008-12-16  Sam Weinig  <sam@webkit.org>
592
593         Reviewed by Gavin Barraclough.
594
595         Fix for https://bugs.webkit.org/show_bug.cgi?id=22837
596         Remove dependency on the bytecode Instruction buffer in Interpreter::cti_op_call_NotJSFunction
597         Part of <rdar://problem/6428342>
598
599         * interpreter/CallFrame.h: Added comment regarding returnPC storing a void*.
600         * interpreter/Interpreter.cpp:
601         (JSC::bytecodeOffsetForPC): We no longer have any cases of the PC
602         being in the instruction stream for JIT, so we can remove the check.
603         (JSC::Interpreter::cti_op_call_NotJSFunction): Use the CTI_RETURN_ADDRESS
604         as the call frame returnPC as it is only necessary for looking up when
605         throwing an exception.
606         * interpreter/RegisterFile.h:
607         (JSC::RegisterFile::): Added comment regarding returnPC storing a void*.
608         * jit/JIT.h: Remove ARG_instr4.
609         * jit/JITCall.cpp:
610         (JSC::JIT::compileOpCallSetupArgs): Don't pass the instruction pointer.
611
612 2008-12-16  Darin Adler  <darin@apple.com>
613
614         Reviewed and landed by Cameron Zwarich.
615
616         Preparatory work for fixing
617
618         Bug 22887: Make UString::Rep use RefCounted rather than implementing its own ref counting
619         <https://bugs.webkit.org/show_bug.cgi?id=22887>
620
621         Change the various string translators used by Identifier:add() so that
622         they never zero the ref count of a newly created UString::Rep.
623
624         * runtime/Identifier.cpp:
625         (JSC::CStringTranslator::translate):
626         (JSC::Identifier::add):
627         (JSC::UCharBufferTranslator::translate):
628
629 2008-12-16  Gavin Barraclough  <barraclough@apple.com>
630
631         Build fix for 'doze.
632
633         * assembler/AssemblerBuffer.h:
634
635 2008-12-16  Gavin Barraclough  <barraclough@apple.com>
636
637         Reviewed by Cameron Zwarich.
638
639         Make the JIT compile on x86-64.
640         This largely involves populting the missing calls in MacroAssembler.h.
641         In addition some reinterpret_casts need removing from the JIT, and the
642         repatching property access code will need to be fully compiled out for
643         now.  The changes in interpret.cpp are to reorder the functions so that
644         the _generic forms come before all other property access methods, and
645         then to place all property access methods other than the generic forms
646         under control of the ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS macro.
647
648         No performance impact.
649
650         * assembler/AssemblerBuffer.h:
651         (JSC::AssemblerBuffer::putInt64Unchecked):
652         * assembler/MacroAssembler.h:
653         (JSC::MacroAssembler::loadPtr):
654         (JSC::MacroAssembler::load32):
655         (JSC::MacroAssembler::storePtr):
656         (JSC::MacroAssembler::storePtrWithRepatch):
657         (JSC::MacroAssembler::store32):
658         (JSC::MacroAssembler::poke):
659         (JSC::MacroAssembler::move):
660         (JSC::MacroAssembler::testImm64):
661         (JSC::MacroAssembler::jePtr):
662         (JSC::MacroAssembler::jnePtr):
663         (JSC::MacroAssembler::jnzPtr):
664         (JSC::MacroAssembler::jzPtr):
665         * assembler/X86Assembler.h:
666         (JSC::X86Assembler::):
667         (JSC::X86Assembler::cmpq_rr):
668         (JSC::X86Assembler::cmpq_rm):
669         (JSC::X86Assembler::cmpq_im):
670         (JSC::X86Assembler::testq_i32m):
671         (JSC::X86Assembler::movl_mEAX):
672         (JSC::X86Assembler::movl_i32r):
673         (JSC::X86Assembler::movl_EAXm):
674         (JSC::X86Assembler::movq_rm):
675         (JSC::X86Assembler::movq_mEAX):
676         (JSC::X86Assembler::movq_mr):
677         (JSC::X86Assembler::movq_i64r):
678         (JSC::X86Assembler::movl_mr):
679         (JSC::X86Assembler::X86InstructionFormatter::oneByteOp64):
680         (JSC::X86Assembler::X86InstructionFormatter::immediate64):
681         * interpreter/Interpreter.cpp:
682         (JSC::Interpreter::cti_op_put_by_id_generic):
683         (JSC::Interpreter::cti_op_get_by_id_generic):
684         (JSC::Interpreter::cti_op_put_by_id):
685         (JSC::Interpreter::cti_op_put_by_id_second):
686         * jit/JIT.cpp:
687         (JSC::JIT::privateCompileMainPass):
688         (JSC::JIT::privateCompile):
689         (JSC::JIT::privateCompileCTIMachineTrampolines):
690         * jit/JITCall.cpp:
691         (JSC::JIT::compileOpCallSetupArgs):
692         (JSC::JIT::compileOpCall):
693         * jit/JITPropertyAccess.cpp:
694         (JSC::JIT::compileGetByIdHotPath):
695         (JSC::JIT::compilePutByIdHotPath):
696         * runtime/JSImmediate.h:
697         (JSC::JSImmediate::makeInt):
698
699 2008-12-16  Cameron Zwarich  <zwarich@apple.com>
700
701         Reviewed by Darin Adler.
702
703         Bug 22869: REGRESSION (r38407): http://news.cnet.com/8301-13579_3-9953533-37.html crashes
704         <https://bugs.webkit.org/show_bug.cgi?id=22869>
705         <rdar://problem/6402499>
706
707         Before r38407, Structure::m_nameInPrevious was ref'd due to it being
708         stored in a PropertyMap. However, PropertyMaps are created lazily after
709         r38407, so Structure::m_nameInPrevious is not necessarily ref'd while
710         it is being used. Making it a RefPtr instead of a raw pointer fixes
711         the problem.
712
713         Unfortunately, the crash in the bug is rather intermittent, and it is
714         impossible to add an assertion in UString::Ref::ref() to catch this bug
715         because some users of UString::Rep deliberately zero out the reference
716         count. Therefore, there is no layout test accompanying this bug fix.
717
718         * runtime/Structure.cpp:
719         (JSC::Structure::~Structure): Use get().
720         (JSC::Structure::materializePropertyMap): Use get().
721         (JSC::Structure::addPropertyTransitionToExistingStructure): Use get().
722         (JSC::Structure::addPropertyTransition): Use get().
723         * runtime/Structure.h: Make Structure::m_nameInPrevious a RefPtr instead
724         of a raw pointer.
725
726 2008-12-16  Nikolas Zimmermann  <nikolas.zimmermann@torchmobile.com>
727
728         Not reviewed. Attempt to fix win build. No 'using namespace WTF' in this file, needs manual WTF:: prefix.
729         Not sure why the build works as is here.
730
731         * runtime/MathObject.cpp:
732         (JSC::mathProtoFuncRandom):
733
734 2008-12-16  Nikolas Zimmermann  <nikolas.zimmermann@torchmobile.com>
735
736         Reviewed by Darin Adler.
737
738         Fixes: https://bugs.webkit.org/show_bug.cgi?id=22876
739
740         Unify random number generation in JavaScriptCore & WebCore, by introducing
741         wtf/RandomNumber.h and moving wtf_random/wtf_random_init out of MathExtras.h.
742
743         wtf_random_init() has been renamed to initializeRandomNumberGenerator() and
744         lives in it's own private header: wtf/RandomNumberSeed.h, only intended to
745         be used from within JavaScriptCore.
746
747         wtf_random() has been renamed to randomNumber() and lives in a public header
748         wtf/RandomNumber.h, usable from within JavaScriptCore & WebCore. It encapsulates
749         the code taking care of initializing the random number generator (only when
750         building without ENABLE(JSC_MULTIPLE_THREADS), otherwhise initializeThreading()
751         already took care of that).
752
753         Functional change on darwin: Use random() instead of rand(), as it got a larger
754         period (more randomness). HTMLFormElement already contains this implementation
755         and I just moved it in randomNumber(), as  special case for PLATFORM(DARWIN).
756
757         * GNUmakefile.am: Add RandomNumber.(cpp/h) / RandomNumberSeed.h.
758         * JavaScriptCore.exp: Ditto.
759         * JavaScriptCore.pri: Ditto.
760         * JavaScriptCore.scons: Ditto.
761         * JavaScriptCore.vcproj/WTF/WTF.vcproj: Ditto.
762         * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
763         * JavaScriptCoreSources.bkl: Ditto.
764         * runtime/MathObject.cpp: Use new WTF::randomNumber() functionality.
765         (JSC::mathProtoFuncRandom):
766         * wtf/MathExtras.h: Move wtf_random / wtf_random_init to new files.
767         * wtf/RandomNumber.cpp: Added.
768         (WTF::randomNumber):
769         * wtf/RandomNumber.h: Added.
770         * wtf/RandomNumberSeed.h: Added. Internal usage within JSC only.
771         (WTF::initializeRandomNumberGenerator):
772         * wtf/ThreadingGtk.cpp: Rename wtf_random_init() to initializeRandomNumberGenerator().
773         (WTF::initializeThreading):
774         * wtf/ThreadingPthreads.cpp: Ditto.
775         (WTF::initializeThreading):
776         * wtf/ThreadingQt.cpp: Ditto.
777         (WTF::initializeThreading):
778         * wtf/ThreadingWin.cpp: Ditto.
779         (WTF::initializeThreading):
780
781 2008-12-16 Yael Aharon <yael.aharon@nokia.com>
782
783         Reviewed by Tor Arne Vestbø.
784
785         Qt/Win build fix
786
787         * JavaScriptCore.pri:
788
789 2008-12-15  Mark Rowe  <mrowe@apple.com>
790
791         Reviewed by Cameron Zwarich.
792
793         Fix the build with GCC 4.0.
794
795         * Configurations/JavaScriptCore.xcconfig:  GCC 4.0 appears to have a bug when compiling with -funwind-tables on,
796         so don't use it with that compiler version.
797
798 2008-12-15  Mark Rowe  <mrowe@apple.com>
799
800         Rubber-stamped by Cameron Zwarich.
801
802         <rdar://problem/6289933> Change WebKit-related projects to build with GCC 4.2 on Leopard.
803
804         * Configurations/Base.xcconfig:
805         * Configurations/DebugRelease.xcconfig:
806
807 2008-12-15  Alexey Proskuryakov  <ap@webkit.org>
808
809         Reviewed by Darin Adler.
810
811         Don't use unique context group in JSGlobalContextCreate() on Tiger or Leopard.
812
813         * API/JSContextRef.cpp: (JSGlobalContextCreate):
814
815 2008-12-15  Alexey Proskuryakov  <ap@webkit.org>
816
817         Reviewed by Darin Adler.
818
819         <rdar://problem/6445089> Mach ports leak from worker threads
820
821         * interpreter/Interpreter.cpp: (JSC::getCPUTime):
822         Deallocate the thread self port.
823
824 2008-12-15  Gavin Barraclough  <barraclough@apple.com>
825
826         Reviewed by Mark Rowe.
827
828         Construct stack frames in JIT code, so that backtracing can still work.
829         <rdar://problem/6447870> JIT should play nice with attempts to take stack traces
830
831         * jit/JIT.cpp:
832         (JSC::):
833         (JSC::JIT::privateCompileMainPass):
834
835 2008-12-15  Mark Rowe  <mrowe@apple.com>
836
837         Reviewed by Gavin Barraclough.
838
839         <rdar://problem/6402262> JavaScriptCore needs exception handling tables in order to get stack traces without frame pointers
840
841         * Configurations/JavaScriptCore.xcconfig:
842
843 2008-12-15  Gavin Barraclough  <barraclough@apple.com>
844
845         Rubber stamped by Mark Rowe.
846
847         Revert r39226 / Bug 22818: Unify JIT callback argument access OS X / Windows
848         This causes Acid3 failures – reverting for now & will revisit later.
849         https://bugs.webkit.org/show_bug.cgi?id=22873
850
851         * interpreter/Interpreter.h:
852         * jit/JIT.cpp:
853         (JSC::JIT::privateCompileCTIMachineTrampolines):
854         * jit/JIT.h:
855         * jit/JITInlineMethods.h:
856         (JSC::JIT::restoreArgumentReference):
857         (JSC::JIT::restoreArgumentReferenceForTrampoline):
858         (JSC::JIT::emitCTICall_internal):
859         * jit/JITPropertyAccess.cpp:
860         (JSC::JIT::privateCompilePutByIdTransition):
861         * wtf/Platform.h:
862
863 2008-12-15  Darin Adler  <darin@apple.com>
864
865         Reviewed by Sam Weinig.
866
867         - fix <rdar://problem/6427048> crash due to infinite recursion after setting window.__proto__ = window
868
869         Replaced toGlobalObject with the more generally useful unwrappedObject and used it to
870         fix the cycle detection code in put(__proto__).
871
872         * JavaScriptCore.exp: Updated.
873
874         * runtime/JSGlobalObject.cpp: Removed toGlobalObject. We now use unwrappedObject instead.
875         * runtime/JSGlobalObject.h:
876         (JSC::JSGlobalObject::isGlobalObject): Ditto.
877
878         * runtime/JSGlobalObjectFunctions.cpp:
879         (JSC::globalFuncEval): Use unwrappedObject and isGlobalObject here rather than toGlobalObject.
880
881         * runtime/JSObject.cpp:
882         (JSC::JSObject::put): Rewrote prototype cycle checking loop. Use unwrappedObject in the loop now.
883         (JSC::JSObject::unwrappedObject): Replaced toGlobalObject with this new function.
884         * runtime/JSObject.h: More of the same.
885
886 2008-12-15  Steve Falkenburg  <sfalken@apple.com>
887
888         Windows build fix.
889         
890         Visual Studio requires visibility of forward declarations to match class declaration.
891
892         * assembler/X86Assembler.h:
893
894 2008-12-15  Gustavo Noronha Silva  <kov@kov.eti.br>
895
896         Reviewed by Mark Rowe.
897
898         https://bugs.webkit.org/show_bug.cgi?id=22686
899
900         GTK+ build fix.
901
902         * GNUmakefile.am:
903
904 2008-12-15  Gavin Barraclough  <barraclough@apple.com>
905
906         Reviewed by Geoff Garen.
907
908         Add support to X86Assembler emitting instructions that access all 16 registers on x86-64.
909         Add a new formating class, that is reponsible for both emitting the opcode bytes and the
910         ModRm  bytes of an instruction in a single call; this can insert the REX byte as necessary
911         before the opcode, but has access to the register numbers to build the REX.
912
913         * assembler/AssemblerBuffer.h:
914         (JSC::AssemblerBuffer::isAligned):
915         (JSC::AssemblerBuffer::data):
916         * assembler/MacroAssembler.h:
917         (JSC::MacroAssembler::addPtr):
918         (JSC::MacroAssembler::add32):
919         (JSC::MacroAssembler::and32):
920         (JSC::MacroAssembler::or32):
921         (JSC::MacroAssembler::sub32):
922         (JSC::MacroAssembler::xor32):
923         (JSC::MacroAssembler::loadPtr):
924         (JSC::MacroAssembler::load32):
925         (JSC::MacroAssembler::load16):
926         (JSC::MacroAssembler::storePtr):
927         (JSC::MacroAssembler::storePtrWithRepatch):
928         (JSC::MacroAssembler::store32):
929         (JSC::MacroAssembler::pop):
930         (JSC::MacroAssembler::push):
931         (JSC::MacroAssembler::compareImm32ForBranch):
932         (JSC::MacroAssembler::compareImm32ForBranchEquality):
933         (JSC::MacroAssembler::testImm32):
934         (JSC::MacroAssembler::jae32):
935         (JSC::MacroAssembler::jb32):
936         (JSC::MacroAssembler::je16):
937         (JSC::MacroAssembler::jg32):
938         (JSC::MacroAssembler::jnePtr):
939         (JSC::MacroAssembler::jne32):
940         (JSC::MacroAssembler::jump):
941         * assembler/X86Assembler.h:
942         (JSC::X86::):
943         (JSC::X86Assembler::):
944         (JSC::X86Assembler::size):
945         (JSC::X86Assembler::push_r):
946         (JSC::X86Assembler::pop_r):
947         (JSC::X86Assembler::push_i32):
948         (JSC::X86Assembler::push_m):
949         (JSC::X86Assembler::pop_m):
950         (JSC::X86Assembler::addl_rr):
951         (JSC::X86Assembler::addl_mr):
952         (JSC::X86Assembler::addl_ir):
953         (JSC::X86Assembler::addq_ir):
954         (JSC::X86Assembler::addl_im):
955         (JSC::X86Assembler::andl_rr):
956         (JSC::X86Assembler::andl_ir):
957         (JSC::X86Assembler::orl_rr):
958         (JSC::X86Assembler::orl_mr):
959         (JSC::X86Assembler::orl_ir):
960         (JSC::X86Assembler::subl_rr):
961         (JSC::X86Assembler::subl_mr):
962         (JSC::X86Assembler::subl_ir):
963         (JSC::X86Assembler::subl_im):
964         (JSC::X86Assembler::xorl_rr):
965         (JSC::X86Assembler::xorl_ir):
966         (JSC::X86Assembler::sarl_i8r):
967         (JSC::X86Assembler::sarl_CLr):
968         (JSC::X86Assembler::shll_i8r):
969         (JSC::X86Assembler::shll_CLr):
970         (JSC::X86Assembler::imull_rr):
971         (JSC::X86Assembler::imull_i32r):
972         (JSC::X86Assembler::idivl_r):
973         (JSC::X86Assembler::cmpl_rr):
974         (JSC::X86Assembler::cmpl_rm):
975         (JSC::X86Assembler::cmpl_mr):
976         (JSC::X86Assembler::cmpl_ir):
977         (JSC::X86Assembler::cmpl_ir_force32):
978         (JSC::X86Assembler::cmpl_im):
979         (JSC::X86Assembler::cmpl_im_force32):
980         (JSC::X86Assembler::cmpw_rm):
981         (JSC::X86Assembler::testl_rr):
982         (JSC::X86Assembler::testl_i32r):
983         (JSC::X86Assembler::testl_i32m):
984         (JSC::X86Assembler::testq_rr):
985         (JSC::X86Assembler::testq_i32r):
986         (JSC::X86Assembler::testb_i8r):
987         (JSC::X86Assembler::sete_r):
988         (JSC::X86Assembler::setz_r):
989         (JSC::X86Assembler::setne_r):
990         (JSC::X86Assembler::setnz_r):
991         (JSC::X86Assembler::cdq):
992         (JSC::X86Assembler::xchgl_rr):
993         (JSC::X86Assembler::movl_rr):
994         (JSC::X86Assembler::movl_rm):
995         (JSC::X86Assembler::movl_mr):
996         (JSC::X86Assembler::movl_i32r):
997         (JSC::X86Assembler::movl_i32m):
998         (JSC::X86Assembler::movq_rr):
999         (JSC::X86Assembler::movq_rm):
1000         (JSC::X86Assembler::movq_mr):
1001         (JSC::X86Assembler::movzwl_mr):
1002         (JSC::X86Assembler::movzbl_rr):
1003         (JSC::X86Assembler::leal_mr):
1004         (JSC::X86Assembler::call):
1005         (JSC::X86Assembler::jmp):
1006         (JSC::X86Assembler::jmp_r):
1007         (JSC::X86Assembler::jmp_m):
1008         (JSC::X86Assembler::jne):
1009         (JSC::X86Assembler::jnz):
1010         (JSC::X86Assembler::je):
1011         (JSC::X86Assembler::jl):
1012         (JSC::X86Assembler::jb):
1013         (JSC::X86Assembler::jle):
1014         (JSC::X86Assembler::jbe):
1015         (JSC::X86Assembler::jge):
1016         (JSC::X86Assembler::jg):
1017         (JSC::X86Assembler::ja):
1018         (JSC::X86Assembler::jae):
1019         (JSC::X86Assembler::jo):
1020         (JSC::X86Assembler::jp):
1021         (JSC::X86Assembler::js):
1022         (JSC::X86Assembler::addsd_rr):
1023         (JSC::X86Assembler::addsd_mr):
1024         (JSC::X86Assembler::cvtsi2sd_rr):
1025         (JSC::X86Assembler::cvttsd2si_rr):
1026         (JSC::X86Assembler::movd_rr):
1027         (JSC::X86Assembler::movsd_rm):
1028         (JSC::X86Assembler::movsd_mr):
1029         (JSC::X86Assembler::mulsd_rr):
1030         (JSC::X86Assembler::mulsd_mr):
1031         (JSC::X86Assembler::pextrw_irr):
1032         (JSC::X86Assembler::subsd_rr):
1033         (JSC::X86Assembler::subsd_mr):
1034         (JSC::X86Assembler::ucomis_rr):
1035         (JSC::X86Assembler::int3):
1036         (JSC::X86Assembler::ret):
1037         (JSC::X86Assembler::predictNotTaken):
1038         (JSC::X86Assembler::label):
1039         (JSC::X86Assembler::align):
1040         (JSC::X86Assembler::link):
1041         (JSC::X86Assembler::executableCopy):
1042         (JSC::X86Assembler::X86InstructionFormater::prefix):
1043         (JSC::X86Assembler::X86InstructionFormater::oneByteOp):
1044         (JSC::X86Assembler::X86InstructionFormater::twoByteOp):
1045         (JSC::X86Assembler::X86InstructionFormater::oneByteOp64):
1046         (JSC::X86Assembler::X86InstructionFormater::oneByteOp8):
1047         (JSC::X86Assembler::X86InstructionFormater::twoByteOp8):
1048         (JSC::X86Assembler::X86InstructionFormater::instructionImmediate8):
1049         (JSC::X86Assembler::X86InstructionFormater::instructionImmediate32):
1050         (JSC::X86Assembler::X86InstructionFormater::instructionRel32):
1051         (JSC::X86Assembler::X86InstructionFormater::size):
1052         (JSC::X86Assembler::X86InstructionFormater::isAligned):
1053         (JSC::X86Assembler::X86InstructionFormater::data):
1054         (JSC::X86Assembler::X86InstructionFormater::executableCopy):
1055         (JSC::X86Assembler::X86InstructionFormater::registerModRM):
1056         (JSC::X86Assembler::X86InstructionFormater::memoryModRM):
1057         * jit/JIT.cpp:
1058         (JSC::JIT::privateCompileMainPass):
1059         (JSC::JIT::privateCompile):
1060         (JSC::JIT::privateCompileCTIMachineTrampolines):
1061         * jit/JITArithmetic.cpp:
1062         (JSC::JIT::putDoubleResultToJSNumberCellOrJSImmediate):
1063         (JSC::JIT::compileBinaryArithOp):
1064         * jit/JITCall.cpp:
1065         (JSC::JIT::compileOpCall):
1066         (JSC::JIT::compileOpCallSlowCase):
1067         * jit/JITPropertyAccess.cpp:
1068         (JSC::JIT::compileGetByIdHotPath):
1069         (JSC::JIT::compilePutByIdHotPath):
1070         (JSC::JIT::privateCompilePutByIdTransition):
1071         (JSC::JIT::privateCompilePatchGetArrayLength):
1072         (JSC::JIT::privateCompileGetByIdProto):
1073         (JSC::JIT::privateCompileGetByIdProtoList):
1074         (JSC::JIT::privateCompileGetByIdChainList):
1075         (JSC::JIT::privateCompileGetByIdChain):
1076
1077 2008-12-15  Darin Adler  <darin@apple.com>
1078
1079         * interpreter/RegisterFile.h: Tweak include formatting.
1080
1081 2008-12-15  Holger Hans Peter Freyther  <zecke@selfish.org>
1082
1083         Build fix for Gtk+.
1084
1085         * interpreter/RegisterFile.h: Include stdio.h for fprintf
1086
1087 2008-12-15  Alexey Proskuryakov  <ap@webkit.org>
1088
1089         Reviewed by Oliver Hunt.
1090
1091         <rdar://problem/6444455> Worker Thread crash running multiple workers for a moderate amount of time
1092
1093         * interpreter/RegisterFile.h: (JSC::RegisterFile::RegisterFile):
1094         Improve error handling: if mmap fails, crash immediately, and print out the reason.
1095
1096 2008-12-13  Gavin Barraclough  <barraclough@apple.com>
1097
1098         Reviewed by Cameron Zwarich.
1099
1100         Re-enable WREC on 64-bit.
1101         Implements one of the MacroAssembler::jnzPtr methods, previously only implemented for 32-bit x86.
1102
1103         https://bugs.webkit.org/show_bug.cgi?id=22849
1104
1105         * assembler/MacroAssembler.h:
1106         (JSC::MacroAssembler::testImm64):
1107         (JSC::MacroAssembler::jnzPtr):
1108         * assembler/X86Assembler.h:
1109         (JSC::X86Assembler::testq_i32r):
1110         (JSC::X86Assembler::testq_rr):
1111         * wtf/Platform.h:
1112
1113 2008-12-13  Gavin Barraclough  <barraclough@apple.com>
1114
1115         Fix PPC builds.
1116
1117         * assembler/MacroAssembler.h:
1118
1119 2008-12-13  Gavin Barraclough  <barraclough@apple.com>
1120
1121         Build fix only, no review.
1122
1123         * bytecode/CodeBlock.h:
1124
1125 2008-12-13  Gavin Barraclough  <barraclough@apple.com>
1126
1127         Reviewed by Cameron Zwarich.
1128
1129         Port the remainder of the JIT, bar calling convention related code, and code
1130         implementing optimizations which can be disabled, to use the MacroAssembler.
1131
1132         * assembler/MacroAssembler.h:
1133         (JSC::MacroAssembler::DataLabelPtr::DataLabelPtr):
1134         (JSC::MacroAssembler::RepatchBuffer::RepatchBuffer):
1135         (JSC::MacroAssembler::RepatchBuffer::link):
1136         (JSC::MacroAssembler::RepatchBuffer::addressOf):
1137         (JSC::MacroAssembler::RepatchBuffer::setPtr):
1138         (JSC::MacroAssembler::addPtr):
1139         (JSC::MacroAssembler::lshift32):
1140         (JSC::MacroAssembler::mod32):
1141         (JSC::MacroAssembler::rshift32):
1142         (JSC::MacroAssembler::storePtrWithRepatch):
1143         (JSC::MacroAssembler::jnzPtr):
1144         (JSC::MacroAssembler::jzPtr):
1145         (JSC::MacroAssembler::jump):
1146         (JSC::MacroAssembler::label):
1147         * assembler/X86Assembler.h:
1148         (JSC::X86Assembler::):
1149         (JSC::X86Assembler::xchgl_rr):
1150         (JSC::X86Assembler::jmp_m):
1151         (JSC::X86Assembler::repatchAddress):
1152         (JSC::X86Assembler::getRelocatedAddress):
1153         * bytecode/CodeBlock.cpp:
1154         (JSC::CodeBlock::CodeBlock):
1155         * bytecode/CodeBlock.h:
1156         (JSC::JITCodeRef::JITCodeRef):
1157         (JSC::CodeBlock::setJITCode):
1158         (JSC::CodeBlock::jitCode):
1159         (JSC::CodeBlock::executablePool):
1160         * jit/JIT.cpp:
1161         (JSC::JIT::privateCompileMainPass):
1162         (JSC::JIT::privateCompileLinkPass):
1163         (JSC::JIT::privateCompile):
1164         (JSC::JIT::privateCompileCTIMachineTrampolines):
1165         * jit/JIT.h:
1166         (JSC::CallRecord::CallRecord):
1167         (JSC::JumpTable::JumpTable):
1168         (JSC::JIT::emitCTICall):
1169         (JSC::JIT::JSRInfo::JSRInfo):
1170         * jit/JITArithmetic.cpp:
1171         * jit/JITCall.cpp:
1172         * jit/JITInlineMethods.h:
1173         (JSC::JIT::emitNakedCall):
1174         (JSC::JIT::emitCTICall_internal):
1175         (JSC::JIT::checkStructure):
1176         (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero):
1177         (JSC::JIT::addSlowCase):
1178         (JSC::JIT::addJump):
1179         (JSC::JIT::emitJumpSlowToHot):
1180         * jit/JITPropertyAccess.cpp:
1181         (JSC::JIT::privateCompileGetByIdChainList):
1182         (JSC::JIT::privateCompileGetByIdChain):
1183
1184 2008-12-12  Cameron Zwarich  <zwarich@apple.com>
1185
1186         Reviewed by Sam Weinig.
1187
1188         Fix the failures of the following layout tests, which regressed in
1189         r39255:
1190
1191         fast/dom/StyleSheet/ownerNode-lifetime-2.html
1192         fast/xsl/transform-xhr-doc.xhtml
1193
1194         The binary search in CodeBlock::getByIdExceptionInfoForBytecodeOffset()
1195         doesn't guarantee that it actually finds a match, so add an explicit check
1196         for this.
1197
1198         * bytecode/CodeBlock.cpp:
1199         (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset):
1200
1201 2008-12-12  Gavin Barraclough  <barraclough@apple.com>
1202
1203         Reviewed by Cameron Zwarich.
1204
1205         Replace emitPutCallArg methods with emitPutJITStubArg methods.  Primarily to make the argument numbering
1206         more sensible (1-based incrementing by 1, rather than 0-based incrementing by 4).  The CTI name also seems
1207         to be being deprecated from the code generally.
1208
1209         * jit/JIT.cpp:
1210         (JSC::JIT::privateCompileMainPass):
1211         (JSC::JIT::privateCompileSlowCases):
1212         (JSC::JIT::privateCompileCTIMachineTrampolines):
1213         * jit/JIT.h:
1214         * jit/JITArithmetic.cpp:
1215         (JSC::JIT::compileBinaryArithOp):
1216         (JSC::JIT::compileBinaryArithOpSlowCase):
1217         * jit/JITCall.cpp:
1218         (JSC::JIT::compileOpCallSetupArgs):
1219         (JSC::JIT::compileOpCallEvalSetupArgs):
1220         (JSC::JIT::compileOpConstructSetupArgs):
1221         (JSC::JIT::compileOpCall):
1222         * jit/JITInlineMethods.h:
1223         (JSC::JIT::emitPutJITStubArg):
1224         (JSC::JIT::emitPutJITStubArgConstant):
1225         (JSC::JIT::emitGetJITStubArg):
1226         (JSC::JIT::emitPutJITStubArgFromVirtualRegister):
1227         * jit/JITPropertyAccess.cpp:
1228         (JSC::JIT::compileGetByIdHotPath):
1229         (JSC::JIT::compilePutByIdHotPath):
1230         (JSC::JIT::compileGetByIdSlowCase):
1231         (JSC::JIT::compilePutByIdSlowCase):
1232
1233 2008-12-12  Gavin Barraclough  <barraclough@apple.com>
1234
1235         Fix windows builds.
1236
1237         * jit/JIT.cpp:
1238         (JSC::JIT::privateCompileMainPass):
1239         (JSC::JIT::privateCompileSlowCases):
1240         (JSC::JIT::privateCompile):
1241
1242 2008-12-12  Gavin Barraclough  <barraclough@apple.com>
1243
1244         Reviewed by Geoff Garen.
1245
1246         Remove loop counter 'i' from the JIT generation passes, replace with a member m_bytecodeIndex.
1247
1248         No impact on performance.
1249
1250         * jit/JIT.cpp:
1251         (JSC::JIT::compileOpStrictEq):
1252         (JSC::JIT::emitSlowScriptCheck):
1253         (JSC::JIT::privateCompileMainPass):
1254         (JSC::JIT::privateCompileSlowCases):
1255         (JSC::JIT::privateCompile):
1256         * jit/JIT.h:
1257         (JSC::CallRecord::CallRecord):
1258         (JSC::JmpTable::JmpTable):
1259         (JSC::JIT::emitCTICall):
1260         * jit/JITArithmetic.cpp:
1261         (JSC::JIT::compileBinaryArithOp):
1262         (JSC::JIT::compileBinaryArithOpSlowCase):
1263         * jit/JITCall.cpp:
1264         (JSC::JIT::compileOpCall):
1265         (JSC::JIT::compileOpCallSlowCase):
1266         * jit/JITInlineMethods.h:
1267         (JSC::JIT::emitGetVirtualRegister):
1268         (JSC::JIT::emitGetVirtualRegisters):
1269         (JSC::JIT::emitNakedCall):
1270         (JSC::JIT::emitCTICall_internal):
1271         (JSC::JIT::emitJumpSlowCaseIfJSCell):
1272         (JSC::JIT::emitJumpSlowCaseIfNotJSCell):
1273         (JSC::JIT::emitJumpSlowCaseIfNotImmNum):
1274         (JSC::JIT::emitJumpSlowCaseIfNotImmNums):
1275         (JSC::JIT::emitFastArithIntToImmOrSlowCase):
1276         (JSC::JIT::addSlowCase):
1277         (JSC::JIT::addJump):
1278         (JSC::JIT::emitJumpSlowToHot):
1279         * jit/JITPropertyAccess.cpp:
1280         (JSC::JIT::compileGetByIdHotPath):
1281         (JSC::JIT::compileGetByIdSlowCase):
1282         (JSC::JIT::compilePutByIdHotPath):
1283         (JSC::JIT::compilePutByIdSlowCase):
1284
1285 2008-12-12  Sam Weinig  <sam@webkit.org>
1286
1287         Reviewed by Cameron Zwarich.
1288
1289         <rdar://problem/6428342> Look into feasibility of discarding bytecode after native codegen
1290
1291         Move more JIT functionality to using offsets into the Instruction buffer
1292         instead of raw pointers. Two to go!
1293
1294         * interpreter/Interpreter.cpp:
1295         (JSC::bytecodeOffsetForPC): Rename from vPCForPC.
1296         (JSC::Interpreter::resolve): Pass offset to exception helper.
1297         (JSC::Interpreter::resolveSkip): Ditto.
1298         (JSC::Interpreter::resolveGlobal): Ditto.
1299         (JSC::Interpreter::resolveBaseAndProperty): Ditto.
1300         (JSC::Interpreter::resolveBaseAndFunc): Ditto.
1301         (JSC::isNotObject): Ditto.
1302         (JSC::Interpreter::unwindCallFrame): Call bytecodeOffsetForPC.
1303         (JSC::Interpreter::throwException): Use offsets instead of vPCs.
1304         (JSC::Interpreter::privateExecute): Pass offset to exception helper.
1305         (JSC::Interpreter::retrieveLastCaller): Ditto.
1306         (JSC::Interpreter::cti_op_instanceof): Ditto.
1307         (JSC::Interpreter::cti_op_call_NotJSFunction): Ditto.
1308         (JSC::Interpreter::cti_op_resolve): Pass offset to exception helper.
1309         (JSC::Interpreter::cti_op_construct_NotJSConstruct): Ditto.
1310         (JSC::Interpreter::cti_op_resolve_func): Ditto.
1311         (JSC::Interpreter::cti_op_resolve_skip): Ditto.
1312         (JSC::Interpreter::cti_op_resolve_global): Ditto.
1313         (JSC::Interpreter::cti_op_resolve_with_base): Ditto.
1314         (JSC::Interpreter::cti_op_throw): Ditto.
1315         (JSC::Interpreter::cti_op_in): Ditto.
1316         (JSC::Interpreter::cti_vm_throw): Ditto.
1317         * interpreter/Interpreter.h:
1318
1319         * jit/JIT.cpp:
1320         (JSC::JIT::privateCompileMainPass): Don't pass unnecessary vPC to stub.
1321         * jit/JIT.h: Remove ARG_instr1 - ARG_instr3 and ARG_instr5 - ARG_instr6.
1322         * jit/JITCall.cpp:
1323         (JSC::JIT::compileOpCallEvalSetupArgs): Don't pass unnecessary vPC to stub..
1324         (JSC::JIT::compileOpConstructSetupArgs): Ditto.
1325
1326         * runtime/ExceptionHelpers.cpp:
1327         (JSC::createUndefinedVariableError): Take an offset instead of vPC.
1328         (JSC::createInvalidParamError): Ditto.
1329         (JSC::createNotAConstructorError): Ditto.
1330         (JSC::createNotAFunctionError): Ditto.
1331         (JSC::createNotAnObjectError): Ditto.
1332         * runtime/ExceptionHelpers.h:
1333
1334 2008-12-12  Cameron Zwarich  <zwarich@apple.com>
1335
1336         Reviewed by Oliver Hunt.
1337
1338         Bug 22835: Crash during bytecode generation when comparing to null
1339         <https://bugs.webkit.org/show_bug.cgi?id=22835>
1340         <rdar://problem/6286749>
1341
1342         Change the special cases in bytecode generation for comparison to null
1343         to use tempDestination().
1344
1345         * parser/Nodes.cpp:
1346         (JSC::BinaryOpNode::emitBytecode):
1347         (JSC::EqualNode::emitBytecode):
1348
1349 2008-12-12  Gavin Barraclough  <barraclough@apple.com>
1350
1351         Reviewed by Geoff Garen.
1352
1353         Move slow-cases of JIT code generation over to the MacroAssembler interface.
1354
1355         * assembler/MacroAssembler.h:
1356         (JSC::MacroAssembler::Label::Label):
1357         (JSC::MacroAssembler::jae32):
1358         (JSC::MacroAssembler::jg32):
1359         (JSC::MacroAssembler::jzPtr):
1360         * jit/JIT.cpp:
1361         (JSC::JIT::privateCompileSlowCases):
1362         (JSC::JIT::privateCompile):
1363         (JSC::JIT::emitGetVariableObjectRegister):
1364         (JSC::JIT::emitPutVariableObjectRegister):
1365         * jit/JIT.h:
1366         (JSC::SlowCaseEntry::SlowCaseEntry):
1367         (JSC::JIT::getSlowCase):
1368         (JSC::JIT::linkSlowCase):
1369         * jit/JITArithmetic.cpp:
1370         (JSC::JIT::compileBinaryArithOpSlowCase):
1371         * jit/JITCall.cpp:
1372         (JSC::JIT::compileOpCallInitializeCallFrame):
1373         (JSC::JIT::compileOpCall):
1374         (JSC::JIT::compileOpCallSlowCase):
1375         * jit/JITInlineMethods.h:
1376         (JSC::JIT::emitJumpSlowCaseIfNotJSCell):
1377         (JSC::JIT::linkSlowCaseIfNotJSCell):
1378         * jit/JITPropertyAccess.cpp:
1379         (JSC::JIT::compileGetByIdHotPath):
1380         (JSC::JIT::compilePutByIdHotPath):
1381         (JSC::JIT::compileGetByIdSlowCase):
1382         (JSC::JIT::compilePutByIdSlowCase):
1383
1384 2008-12-12  Cameron Zwarich  <zwarich@apple.com>
1385
1386         Reviewed by Sam Weinig.
1387
1388         Bug 22828: Do not inspect bytecode instruction stream for op_get_by_id exception information
1389         <https://bugs.webkit.org/show_bug.cgi?id=22828>
1390
1391         In order to remove the bytecode instruction stream after generating
1392         native code, all inspection of bytecode instructions at runtime must
1393         be removed. One particular instance of this is the special handling of
1394         exceptions thrown by the op_get_by_id emitted directly before an
1395         op_construct or an op_instanceof. This patch moves that information to
1396         an auxiliary data structure in CodeBlock.
1397
1398         * bytecode/CodeBlock.cpp:
1399         (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset):
1400         * bytecode/CodeBlock.h:
1401         (JSC::CodeBlock::addGetByIdExceptionInfo):
1402         * bytecompiler/BytecodeGenerator.cpp:
1403         (JSC::BytecodeGenerator::emitConstruct):
1404         * bytecompiler/BytecodeGenerator.h:
1405         (JSC::BytecodeGenerator::emitGetByIdExceptionInfo):
1406         * parser/Nodes.cpp:
1407         (JSC::InstanceOfNode::emitBytecode):
1408         * runtime/ExceptionHelpers.cpp:
1409         (JSC::createNotAnObjectError):
1410
1411 2008-12-12  Sam Weinig  <sam@webkit.org>
1412
1413         Reviewed by Geoffrey Garen.
1414
1415         Change exception information accessors to take offsets into the bytecode
1416         instruction buffer instead of pointers so that they can work even even
1417         if the bytecode buffer is purged.
1418
1419         * bytecode/CodeBlock.cpp:
1420         (JSC::instructionOffsetForNth):
1421         (JSC::CodeBlock::handlerForBytecodeOffset):
1422         (JSC::CodeBlock::lineNumberForBytecodeOffset):
1423         (JSC::CodeBlock::expressionRangeForBytecodeOffset):
1424         * bytecode/CodeBlock.h:
1425         * bytecode/SamplingTool.cpp:
1426         (JSC::SamplingTool::dump):
1427         * interpreter/Interpreter.cpp:
1428         (JSC::Interpreter::throwException):
1429         (JSC::Interpreter::privateExecute):
1430         (JSC::Interpreter::retrieveLastCaller):
1431         * jit/JIT.cpp:
1432         (JSC::JIT::privateCompileMainPass):
1433         * runtime/ExceptionHelpers.cpp:
1434         (JSC::createUndefinedVariableError):
1435         (JSC::createInvalidParamError):
1436         (JSC::createNotAConstructorError):
1437         (JSC::createNotAFunctionError):
1438         (JSC::createNotAnObjectError):
1439
1440 2008-12-12  Geoffrey Garen  <ggaren@apple.com>
1441
1442         Reviewed by Cameron Zwarich.
1443         
1444         Tiny bit of refactoring in quantifier generation.
1445
1446         * wrec/WRECGenerator.cpp:
1447         (JSC::WREC::Generator::generateNonGreedyQuantifier):
1448         (JSC::WREC::Generator::generateGreedyQuantifier):
1449
1450 2008-12-11  Sam Weinig  <sam@webkit.org>
1451
1452         Reviewed by Geoffrey Garen.
1453
1454         Remove dependancy on having the Instruction buffer in order to
1455         deref Structures used for property access and global resolves.
1456         Instead, we put references to the necessary Structures in auxiliary
1457         data structures on the CodeBlock. This is not an ideal solution,
1458         as we still pay for having the Structures in two places and we
1459         would like to eventually just hold on to offsets into the machine
1460         code buffer.
1461
1462         - Also removes CodeBlock bloat in non-JIT by #ifdefing the JIT
1463           only data structures.
1464
1465         * GNUmakefile.am:
1466         * JavaScriptCore.pri:
1467         * JavaScriptCore.scons:
1468         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1469         * JavaScriptCore.xcodeproj/project.pbxproj:
1470         * JavaScriptCoreSources.bkl:
1471         * bytecode/CodeBlock.cpp:
1472         (JSC::isGlobalResolve):
1473         (JSC::isPropertyAccess):
1474         (JSC::instructionOffsetForNth):
1475         (JSC::printGlobalResolveInfo):
1476         (JSC::printStructureStubInfo):
1477         (JSC::CodeBlock::printStructures):
1478         (JSC::CodeBlock::dump):
1479         (JSC::CodeBlock::~CodeBlock):
1480         (JSC::CodeBlock::shrinkToFit):
1481         * bytecode/CodeBlock.h:
1482         (JSC::GlobalResolveInfo::GlobalResolveInfo):
1483         (JSC::getNativePC):
1484         (JSC::CodeBlock::instructions):
1485         (JSC::CodeBlock::getStubInfo):
1486         (JSC::CodeBlock::getBytecodeIndex):
1487         (JSC::CodeBlock::addPropertyAccessInstruction):
1488         (JSC::CodeBlock::addGlobalResolveInstruction):
1489         (JSC::CodeBlock::numberOfStructureStubInfos):
1490         (JSC::CodeBlock::addStructureStubInfo):
1491         (JSC::CodeBlock::structureStubInfo):
1492         (JSC::CodeBlock::addGlobalResolveInfo):
1493         (JSC::CodeBlock::globalResolveInfo):
1494         (JSC::CodeBlock::numberOfCallLinkInfos):
1495         (JSC::CodeBlock::addCallLinkInfo):
1496         (JSC::CodeBlock::callLinkInfo):
1497         * bytecode/Instruction.h:
1498         (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::set):
1499         (JSC::PolymorphicAccessStructureList::PolymorphicAccessStructureList):
1500         * bytecode/Opcode.h:
1501         (JSC::):
1502         * bytecode/StructureStubInfo.cpp: Copied from bytecode/CodeBlock.cpp.
1503         (JSC::StructureStubInfo::deref):
1504         * bytecode/StructureStubInfo.h: Copied from bytecode/CodeBlock.h.
1505         (JSC::StructureStubInfo::StructureStubInfo):
1506         (JSC::StructureStubInfo::initGetByIdSelf):
1507         (JSC::StructureStubInfo::initGetByIdProto):
1508         (JSC::StructureStubInfo::initGetByIdChain):
1509         (JSC::StructureStubInfo::initGetByIdSelfList):
1510         (JSC::StructureStubInfo::initGetByIdProtoList):
1511         (JSC::StructureStubInfo::initPutByIdTransition):
1512         (JSC::StructureStubInfo::initPutByIdReplace):
1513         (JSC::StructureStubInfo::):
1514         * bytecompiler/BytecodeGenerator.cpp:
1515         (JSC::BytecodeGenerator::emitResolve):
1516         (JSC::BytecodeGenerator::emitGetById):
1517         (JSC::BytecodeGenerator::emitPutById):
1518         (JSC::BytecodeGenerator::emitCall):
1519         (JSC::BytecodeGenerator::emitConstruct):
1520         (JSC::BytecodeGenerator::emitCatch):
1521         * interpreter/Interpreter.cpp:
1522         (JSC::Interpreter::tryCTICachePutByID):
1523         (JSC::Interpreter::tryCTICacheGetByID):
1524         (JSC::Interpreter::cti_op_get_by_id_self_fail):
1525         (JSC::getPolymorphicAccessStructureListSlot):
1526         (JSC::Interpreter::cti_op_get_by_id_proto_list):
1527         (JSC::Interpreter::cti_op_resolve_global):
1528         * jit/JIT.cpp:
1529         (JSC::JIT::JIT):
1530         (JSC::JIT::privateCompileMainPass):
1531         (JSC::JIT::privateCompileSlowCases):
1532         (JSC::JIT::privateCompile):
1533         * jit/JITPropertyAccess.cpp:
1534         (JSC::JIT::compileGetByIdHotPath):
1535         (JSC::JIT::compilePutByIdHotPath):
1536         (JSC::JIT::compileGetByIdSlowCase):
1537         (JSC::JIT::compilePutByIdSlowCase):
1538         (JSC::JIT::privateCompileGetByIdSelfList):
1539         (JSC::JIT::privateCompileGetByIdProtoList):
1540         (JSC::JIT::privateCompileGetByIdChainList):
1541
1542 2008-12-11  Gavin Barraclough  <barraclough@apple.com>
1543
1544         Reviewed by Oliver Hunt.
1545
1546         Remove CTI_ARGUMENTS mode, use va_start implementation on Windows,
1547         unifying JIT callback (cti_*) argument access on OS X & Windows
1548
1549         No performance impact.
1550
1551         * interpreter/Interpreter.h:
1552         * jit/JIT.cpp:
1553         (JSC::JIT::privateCompileCTIMachineTrampolines):
1554         * jit/JIT.h:
1555         * jit/JITInlineMethods.h:
1556         (JSC::JIT::emitCTICall):
1557         * jit/JITPropertyAccess.cpp:
1558         (JSC::JIT::privateCompilePutByIdTransition):
1559         * wtf/Platform.h:
1560
1561 2008-12-11  Holger Freyther  <zecke@selfish.org>
1562
1563         Reviewed by Simon Hausmann.
1564
1565         https://bugs.webkit.org/show_bug.cgi?id=20953
1566
1567         For Qt it is not pratical to have a FontCache and GlyphPageTreeNode
1568         implementation. This is one of the reasons why the Qt port is currently not
1569         using WebCore/platform/graphics/Font.cpp. By allowing to not use
1570         the simple/fast-path the Qt port will be able to use it.
1571
1572         Introduce USE(FONT_FAST_PATH) and define it for every port but the
1573         Qt one.
1574
1575         * wtf/Platform.h: Enable USE(FONT_FAST_PATH)
1576
1577 2008-12-11  Gabor Loki  <loki@inf.u-szeged.hu>
1578
1579         Reviewed by Darin Adler and landed by Holger Freyther.
1580
1581         <https://bugs.webkit.org/show_bug.cgi?id=22648>
1582         Fix threading on Qt-port and Gtk-port for Sampling tool.
1583
1584         * wtf/ThreadingGtk.cpp:
1585         (WTF::waitForThreadCompletion):
1586         * wtf/ThreadingQt.cpp:
1587         (WTF::waitForThreadCompletion):
1588
1589 2008-12-10  Cameron Zwarich  <zwarich@apple.com>
1590
1591         Reviewed by Oliver Hunt.
1592
1593         Bug 22734: Debugger crashes when stepping into a function call in a return statement
1594         <https://bugs.webkit.org/show_bug.cgi?id=22734>
1595         <rdar://problem/6426796>
1596
1597         * bytecompiler/BytecodeGenerator.cpp:
1598         (JSC::BytecodeGenerator::BytecodeGenerator): The DebuggerCallFrame uses
1599         the 'this' value stored in a callFrame, so op_convert_this should be
1600         emitted at the beginning of a function body when generating bytecode
1601         with debug hooks.
1602         * debugger/DebuggerCallFrame.cpp:
1603         (JSC::DebuggerCallFrame::thisObject): The assertion inherent in the call
1604         to asObject() here is valid, because any 'this' value should have been
1605         converted to a JSObject*.
1606
1607 2008-12-10  Gavin Barraclough  <barraclough@apple.com>
1608
1609         Reviewed by Geoff Garen.
1610
1611         Port more of the JIT to use the MacroAssembler interface.
1612         
1613         Everything in the main pass, bar a few corner cases (operations with required
1614         registers, or calling convention code).  Slightly refactors array creation,
1615         moving the offset calculation into the callFrame into C code (reducing code
1616         planted).
1617
1618         Overall this appears to be a 1% win on v8-tests, due to the smaller immediates
1619         being planted (in jfalse in particular).
1620
1621         * interpreter/Interpreter.cpp:
1622         (JSC::Interpreter::cti_op_new_array):
1623         * jit/JIT.cpp:
1624         (JSC::JIT::privateCompileMainPass):
1625         (JSC::JIT::privateCompileSlowCases):
1626         * jit/JIT.h:
1627         * wrec/WRECGenerator.cpp:
1628         (JSC::WREC::Generator::generateEnter):
1629
1630 2008-12-10  Sam Weinig  <sam@webkit.org>
1631
1632         Fix non-JIT builds.
1633
1634         * bytecode/CodeBlock.h:
1635
1636 2008-12-10  Sam Weinig  <sam@webkit.org>
1637
1638         Reviewed by Geoffrey Garen.
1639
1640         <rdar://problem/6428332> Remove the CTI return address table from CodeBlock
1641
1642         Step 2:
1643
1644         Convert the return address table from a HashMap to a sorted Vector.  This
1645         reduces the size of the data structure by ~4.5MB on Membuster head.
1646
1647         SunSpider reports a 0.5% progression.
1648
1649         * bytecode/CodeBlock.cpp:
1650         (JSC::sizeInBytes): Generic method to get the cost of a Vector.
1651         (JSC::CodeBlock::dumpStatistics): Add dumping of member sizes.
1652         * bytecode/CodeBlock.h:
1653         (JSC::PC::PC): Struct representing NativePC -> VirtualPC mappings.
1654         (JSC::getNativePC): Helper for binary chop.
1655         (JSC::CodeBlock::getBytecodeIndex): Used to get the VirtualPC from a
1656         NativePC using a binary chop of the pcVector.
1657         (JSC::CodeBlock::pcVector): Accessor.
1658
1659         * interpreter/Interpreter.cpp:
1660         (JSC::vPCForPC): Use getBytecodeIndex instead of jitReturnAddressVPCMap().get().
1661         (JSC::Interpreter::cti_op_instanceof): Ditto.
1662         (JSC::Interpreter::cti_op_resolve): Ditto.
1663         (JSC::Interpreter::cti_op_resolve_func): Ditto.
1664         (JSC::Interpreter::cti_op_resolve_skip): Ditto.
1665         (JSC::Interpreter::cti_op_resolve_with_base): Ditto.
1666         (JSC::Interpreter::cti_op_throw): Ditto.
1667         (JSC::Interpreter::cti_op_in): Ditto.
1668         (JSC::Interpreter::cti_vm_throw): Ditto.
1669
1670         * jit/JIT.cpp:
1671         (JSC::JIT::privateCompile): Reserve exact capacity and fill the pcVector.
1672
1673 2008-12-09  Geoffrey Garen  <ggaren@apple.com>
1674
1675         Reviewed by Oliver Hunt.
1676
1677         Added WREC support for an assertion followed by a quantifier. Fixed
1678         PCRE to match.
1679
1680         * wrec/WRECParser.cpp:
1681         (JSC::WREC::Parser::parseParentheses): Throw away the quantifier, since
1682         it's meaningless. (Firefox does the same.)
1683
1684         * pcre/pcre_compile.cpp:
1685         (compileBranch): ditto.
1686
1687 2008-12-09  Geoffrey Garen  <ggaren@apple.com>
1688
1689         Reviewed by Cameron Zwarich.
1690
1691         In preparation for compiling WREC without PCRE:
1692         
1693         Further relaxed WREC's parsing to be more web-compatible. Fixed PCRE to
1694         match in cases where it didn't already.
1695         
1696         Changed JavaScriptCore to report syntax errors detected by WREC, rather
1697         than falling back on PCRE any time WREC sees an error.
1698         
1699         * pcre/pcre_compile.cpp:
1700         (checkEscape): Relaxed parsing of \c and \N escapes to be more
1701         web-compatible.
1702         
1703         * runtime/RegExp.cpp:
1704         (JSC::RegExp::RegExp): Only fall back on PCRE if WREC has not reported
1705         a syntax error.
1706
1707         * wrec/WREC.cpp:
1708         (JSC::WREC::Generator::compileRegExp): Fixed some error reporting to
1709         match PCRE.
1710
1711         * wrec/WRECParser.cpp: Added error messages that match PCRE.
1712
1713         (JSC::WREC::Parser::consumeGreedyQuantifier):
1714         (JSC::WREC::Parser::parseParentheses):
1715         (JSC::WREC::Parser::parseCharacterClass):
1716         (JSC::WREC::Parser::parseNonCharacterEscape): Updated the above functions to
1717         use the new setError API.
1718
1719         (JSC::WREC::Parser::consumeEscape): Relaxed parsing of \c \N \u \x \B
1720         to be more web-compatible.
1721
1722         (JSC::WREC::Parser::parseAlternative): Distinguish between a malformed
1723         quantifier and a quantifier with no prefix, like PCRE does.
1724
1725         (JSC::WREC::Parser::consumeParenthesesType): Updated to use the new setError API.
1726
1727         * wrec/WRECParser.h:
1728         (JSC::WREC::Parser::error):
1729         (JSC::WREC::Parser::syntaxError):
1730         (JSC::WREC::Parser::parsePattern):
1731         (JSC::WREC::Parser::reset):
1732         (JSC::WREC::Parser::setError): Store error messages instead of error codes,
1733         to provide for exception messages. Use a setter for reporting errors, so
1734         errors detected early are not overwritten by errors detected later.
1735
1736 2008-12-09  Gavin Barraclough  <barraclough@apple.com>
1737
1738         Reviewed by Oliver Hunt.
1739
1740         Use va_args to access cti function arguments.
1741         https://bugs.webkit.org/show_bug.cgi?id=22774
1742
1743         This may be a minor regression, but we'll take the hit if so to reduce fragility.
1744
1745         * interpreter/Interpreter.cpp:
1746         * interpreter/Interpreter.h:
1747
1748 2008-12-09  Sam Weinig  <sam@webkit.org>
1749
1750         Reviewed twice by Cameron Zwarich.
1751
1752         Fix for https://bugs.webkit.org/show_bug.cgi?id=22752
1753         Clear SymbolTable after codegen for Function codeblocks that
1754         don't require an activation
1755
1756         This is a ~1.5MB improvement on Membuster-head.
1757
1758         * bytecode/CodeBlock.cpp:
1759         (JSC::CodeBlock::dumpStatistics): Add logging of non-empty symbol tables
1760         and total size used by symbol tables.
1761         * bytecompiler/BytecodeGenerator.cpp:
1762         (JSC::BytecodeGenerator::generate): Clear the symbol table here.
1763
1764 2008-12-09  Sam Weinig  <sam@webkit.org>
1765
1766         Reviewed by Geoffrey Garen.
1767
1768         Remove unnecessary extra lookup when throwing an exception.
1769         We used to first lookup the target offset using getHandlerForVPC
1770         and then we would lookup the native code stub using 
1771         nativeExceptionCodeForHandlerVPC.  Instead, we can just pass around
1772         the HandlerInfo.
1773
1774         * bytecode/CodeBlock.cpp:
1775         (JSC::CodeBlock::handlerForVPC): Return the HandlerInfo.
1776         * bytecode/CodeBlock.h: Remove nativeExceptionCodeForHandlerVPC.
1777
1778         * interpreter/Interpreter.cpp:
1779         (JSC::Interpreter::throwException): Return a HandlerInfo instead of
1780         and Instruction offset.
1781         (JSC::Interpreter::privateExecute): Get the offset from HandlerInfo.
1782         (JSC::Interpreter::cti_op_throw): Get the native code from the HandleInfo.
1783         (JSC::Interpreter::cti_vm_throw): Ditto.
1784         * interpreter/Interpreter.h:
1785
1786 2008-12-09  Eric Seidel  <eric@webkit.org>
1787
1788         Build fix only, no review.
1789
1790         Speculative fix for the Chromium-Windows bot.
1791         Add JavaScriptCore/os-win32 to the include path (for stdint.h)
1792         Strangely it builds fine on my local windows box (or at least doesn't hit this error)
1793
1794         * JavaScriptCore.scons:
1795
1796 2008-12-09  Eric Seidel  <eric@webkit.org>
1797
1798         No review, build fix only.
1799         
1800         Add ExecutableAllocator files missing from Scons build.
1801
1802         * JavaScriptCore.scons:
1803
1804 2008-12-09  Dimitri Glazkov  <dglazkov@chromium.org>
1805
1806         Reviewed by Timothy Hatcher.
1807
1808         https://bugs.webkit.org/show_bug.cgi?id=22631
1809         Allow ScriptCallFrame query names of functions in the call stack.
1810
1811         * JavaScriptCore.exp: added InternalFunction::name and
1812         UString operator==() as exported symbol
1813
1814 2008-12-08  Judit Jasz  <jasy@inf.u-szeged.hu>
1815
1816         Reviewed and tweaked by Cameron Zwarich.
1817
1818         Bug 22352: Annotate opcodes with their length
1819         <https://bugs.webkit.org/show_bug.cgi?id=22352>
1820
1821         * bytecode/Opcode.cpp:
1822         * bytecode/Opcode.h:
1823         * interpreter/Interpreter.cpp:
1824         (JSC::Interpreter::privateExecute):
1825         * jit/JIT.cpp:
1826         (JSC::JIT::privateCompileMainPass):
1827         (JSC::JIT::privateCompileSlowCases):
1828
1829 2008-12-08  Geoffrey Garen  <ggaren@apple.com>
1830
1831         Reviewed by Oliver Hunt.
1832         
1833         Implemented more of the relaxed and somewhat weird rules for deciding
1834         how to interpret a non-pattern-character.
1835         
1836         * wrec/Escapes.h:
1837         (JSC::WREC::Escape::):
1838         (JSC::WREC::Escape::Escape): Eliminated Escape::None because it was
1839         unused. If you see an '\\', it's either a valid escape or an error.
1840
1841         * wrec/Quantifier.h:
1842         (JSC::WREC::Quantifier::Quantifier):
1843         * wrec/WRECGenerator.cpp:
1844         (JSC::WREC::Generator::generateNonGreedyQuantifier):
1845         (JSC::WREC::Generator::generateGreedyQuantifier): Renamed "noMaxSpecified"
1846         to "Infinity", since that's what it means.
1847
1848         * wrec/WRECParser.cpp:
1849         (JSC::WREC::Parser::consumeGreedyQuantifier): Re-wrote {n,m} parsing rules
1850         because they were too strict before. Added support for backtracking
1851         in the case where the {n,m} fails to parse as a quantifier, and yet is
1852         not a syntax error.
1853
1854         (JSC::WREC::Parser::parseCharacterClass):
1855         (JSC::WREC::Parser::parseNonCharacterEscape): Eliminated Escape::None,
1856         as above.
1857
1858         (JSC::WREC::Parser::consumeEscape): Don't treat ASCII and _ escapes
1859         as syntax errors. See fast/regex/non-pattern-characters.html.
1860         
1861         * wrec/WRECParser.h:
1862         (JSC::WREC::Parser::SavedState::SavedState):
1863         (JSC::WREC::Parser::SavedState::restore): Added a state backtracker,
1864         since parsing {n,m} forms requires backtracking if the form turns out
1865         not to be a quantifier.
1866
1867 2008-12-08  Geoffrey Garen  <ggaren@apple.com>
1868
1869         Reviewed by Oliver Hunt.
1870         
1871         Refactored WREC parsing so that only one piece of code needs to know
1872         the relaxed and somewhat weird rules for deciding how to interpret a
1873         non-pattern-character, in preparation for implementing those rules.
1874         
1875         Also, implemented the relaxed and somewhat weird rules for '}' and ']'.
1876
1877         * wrec/WREC.cpp: Reduced the regular expression size limit. Now that
1878         WREC handles ']' properly, it compiles fast/js/regexp-charclass-crash.html,
1879         which makes it hang at the old limit. (The old limit was based on the
1880         misimpression that the same value in PCRE limited the regular expression
1881         pattern size; in reality, it limited the expected compiled regular
1882         expression size. WREC doesn't have a way to calculate an expected
1883         compiled regular expression size, but this should be good enough.)
1884
1885         * wrec/WRECParser.cpp:
1886         (JSC::WREC::parsePatternCharacterSequence): Nixed this function because
1887         it contained a second copy of the logic for handling non-pattern-characters,
1888         which is about to get a lot more complicated.
1889
1890         (JSC::WREC::PatternCharacterSequence::PatternCharacterSequence): 
1891         (JSC::WREC::PatternCharacterSequence::size):
1892         (JSC::WREC::PatternCharacterSequence::append):
1893         (JSC::WREC::PatternCharacterSequence::flush): Helper object for generating
1894         an optimized sequence of pattern characters.
1895
1896         (JSC::WREC::Parser::parseNonCharacterEscape): Renamed to reflect the fact
1897         that the main parseAlternative loop handles character escapes.
1898
1899         (JSC::WREC::Parser::parseAlternative): Moved pattern character sequence
1900         logic from parsePatternCharacterSequence to here, using
1901         PatternCharacterSequence to help with the details.
1902
1903         * wrec/WRECParser.h: Updated for renames.
1904
1905 2008-12-08  Alexey Proskuryakov  <ap@webkit.org>
1906
1907         Reviewed by Geoff Garen.
1908
1909         <rdar://problem/6166088> Give JSGlobalContextCreate a behavior that is concurrency aware,
1910         and un-deprecate it
1911
1912         * API/JSContextRef.cpp: (JSGlobalContextCreate):
1913         * API/JSContextRef.h:
1914         Use a unique context group for the context, unless the application was linked against old
1915         JavaScriptCore.
1916
1917 2008-12-08  Sam Weinig  <sam@webkit.org>
1918
1919         Reviewed by Cameron Zwarich.
1920
1921         Fix for <rdar://problem/6428332> Remove the CTI return address table from CodeBlock
1922
1923         Step 1:
1924
1925         Remove use of jitReturnAddressVPCMap when looking for vPC to store Structures
1926         in for cached lookup.  Instead, use the offset in the StructureStubInfo that is
1927         already required.
1928
1929         * bytecode/CodeBlock.cpp:
1930         (JSC::CodeBlock::dumpStatistics): Fix extraneous semicolon.
1931         * interpreter/Interpreter.cpp:
1932         (JSC::Interpreter::tryCTICachePutByID):
1933         (JSC::Interpreter::tryCTICacheGetByID):
1934         (JSC::Interpreter::cti_op_get_by_id_self_fail):
1935         (JSC::Interpreter::cti_op_get_by_id_proto_list):
1936         * jit/JIT.h:
1937         (JSC::JIT::compileGetByIdSelf):
1938         (JSC::JIT::compileGetByIdProto):
1939         (JSC::JIT::compileGetByIdChain):
1940         (JSC::JIT::compilePutByIdReplace):
1941         (JSC::JIT::compilePutByIdTransition):
1942         * jit/JITPropertyAccess.cpp:
1943         (JSC::JIT::privateCompilePutByIdTransition):
1944         (JSC::JIT::patchGetByIdSelf):
1945         (JSC::JIT::patchPutByIdReplace):
1946         (JSC::JIT::privateCompilePatchGetArrayLength): Remove extra call to getStubInfo.
1947         (JSC::JIT::privateCompileGetByIdSelf):
1948         (JSC::JIT::privateCompileGetByIdProto):
1949         (JSC::JIT::privateCompileGetByIdChain):
1950         (JSC::JIT::privateCompilePutByIdReplace):
1951
1952 2008-12-08  Gavin Barraclough  <barraclough@apple.com>
1953
1954         Reviewed by Oliver Hunt.
1955
1956         Port the op_j?n?eq_null JIT code generation to use the MacroAssembler,
1957         and clean up slightly at the same time.  The 'j' forms currently compare,
1958         then set a register, then compare again, then branch.  Branch directly on
1959         the result of the first compare.
1960
1961         Around a 1% progression on deltablue, crypto & early boyer, for about 1/2%
1962         overall on v8-tests.
1963
1964         * jit/JIT.cpp:
1965         (JSC::JIT::privateCompileMainPass):
1966         * jit/JITPropertyAccess.cpp:
1967         (JSC::JIT::compileGetByIdSlowCase):
1968
1969 2008-12-08  Gavin Barraclough  <barraclough@apple.com>
1970
1971         Reviewed by Geoff Garen.
1972
1973         Expand MacroAssembler to support more operations, required by the JIT.
1974
1975         Generally adds more operations and permutations of operands to the existing
1976         interface.  Rename 'jset' to 'jnz' and 'jnset' to 'jz', which seem clearer,
1977         and require that immediate pointer operands (though not pointer addresses to
1978         load and store instructions) are wrapped in a ImmPtr() type, akin to Imm32().
1979
1980         No performance impact.
1981
1982         * assembler/MacroAssembler.h:
1983         (JSC::MacroAssembler::):
1984         (JSC::MacroAssembler::ImmPtr::ImmPtr):
1985         (JSC::MacroAssembler::add32):
1986         (JSC::MacroAssembler::and32):
1987         (JSC::MacroAssembler::or32):
1988         (JSC::MacroAssembler::sub32):
1989         (JSC::MacroAssembler::xor32):
1990         (JSC::MacroAssembler::loadPtr):
1991         (JSC::MacroAssembler::load32):
1992         (JSC::MacroAssembler::storePtr):
1993         (JSC::MacroAssembler::store32):
1994         (JSC::MacroAssembler::poke):
1995         (JSC::MacroAssembler::move):
1996         (JSC::MacroAssembler::testImm32):
1997         (JSC::MacroAssembler::jae32):
1998         (JSC::MacroAssembler::jb32):
1999         (JSC::MacroAssembler::jePtr):
2000         (JSC::MacroAssembler::je32):
2001         (JSC::MacroAssembler::jnePtr):
2002         (JSC::MacroAssembler::jne32):
2003         (JSC::MacroAssembler::jnzPtr):
2004         (JSC::MacroAssembler::jnz32):
2005         (JSC::MacroAssembler::jzPtr):
2006         (JSC::MacroAssembler::jz32):
2007         (JSC::MacroAssembler::joSub32):
2008         (JSC::MacroAssembler::jump):
2009         (JSC::MacroAssembler::sete32):
2010         (JSC::MacroAssembler::setne32):
2011         (JSC::MacroAssembler::setnz32):
2012         (JSC::MacroAssembler::setz32):
2013         * assembler/X86Assembler.h:
2014         (JSC::X86Assembler::addl_mr):
2015         (JSC::X86Assembler::andl_i8r):
2016         (JSC::X86Assembler::cmpl_rm):
2017         (JSC::X86Assembler::cmpl_mr):
2018         (JSC::X86Assembler::cmpl_i8m):
2019         (JSC::X86Assembler::subl_mr):
2020         (JSC::X86Assembler::testl_i32m):
2021         (JSC::X86Assembler::xorl_i32r):
2022         (JSC::X86Assembler::movl_rm):
2023         (JSC::X86Assembler::modRm_opmsib):
2024         * jit/JIT.cpp:
2025         (JSC::JIT::privateCompileMainPass):
2026         * jit/JITInlineMethods.h:
2027         (JSC::JIT::emitGetVirtualRegister):
2028         (JSC::JIT::emitPutCTIArgConstant):
2029         (JSC::JIT::emitPutCTIParam):
2030         (JSC::JIT::emitPutImmediateToCallFrameHeader):
2031         (JSC::JIT::emitInitRegister):
2032         (JSC::JIT::checkStructure):
2033         (JSC::JIT::emitJumpIfJSCell):
2034         (JSC::JIT::emitJumpIfNotJSCell):
2035         (JSC::JIT::emitJumpSlowCaseIfNotImmNum):
2036
2037 2008-12-08  Geoffrey Garen  <ggaren@apple.com>
2038
2039         Reviewed by Sam Weinig.
2040         
2041         Fixed a bug where WREC would allow a quantifier whose minimum was
2042         greater than its maximum.
2043         
2044         * wrec/Quantifier.h:
2045         (JSC::WREC::Quantifier::Quantifier): ASSERT that the quantifier is not
2046         backwards.
2047         
2048         * wrec/WRECParser.cpp:
2049         (JSC::WREC::Parser::consumeGreedyQuantifier): Verify that the minimum
2050         is not greater than the maximum.
2051
2052 2008-12-08  Eric Seidel  <eric@webkit.org>
2053         
2054         Build fix only, no review.
2055
2056         * JavaScriptCore.scons: add bytecode/JumpTable.cpp
2057
2058 2008-12-08  Sam Weinig  <sam@webkit.org>
2059
2060         Reviewed by Geoffrey Garen.
2061
2062         Patch for https://bugs.webkit.org/show_bug.cgi?id=22716
2063         <rdar://problem/6428315>
2064         Add RareData structure to CodeBlock for infrequently used auxiliary data
2065         members.
2066
2067         Reduces memory on Membuster-head by ~.5MB 
2068
2069         * bytecode/CodeBlock.cpp:
2070         (JSC::CodeBlock::dump):
2071         (JSC::CodeBlock::dumpStatistics):
2072         (JSC::CodeBlock::mark):
2073         (JSC::CodeBlock::getHandlerForVPC):
2074         (JSC::CodeBlock::nativeExceptionCodeForHandlerVPC):
2075         (JSC::CodeBlock::shrinkToFit):
2076         * bytecode/CodeBlock.h:
2077         (JSC::CodeBlock::numberOfExceptionHandlers):
2078         (JSC::CodeBlock::addExceptionHandler):
2079         (JSC::CodeBlock::exceptionHandler):
2080         (JSC::CodeBlock::addFunction):
2081         (JSC::CodeBlock::function):
2082         (JSC::CodeBlock::addUnexpectedConstant):
2083         (JSC::CodeBlock::unexpectedConstant):
2084         (JSC::CodeBlock::addRegExp):
2085         (JSC::CodeBlock::regexp):
2086         (JSC::CodeBlock::numberOfImmediateSwitchJumpTables):
2087         (JSC::CodeBlock::addImmediateSwitchJumpTable):
2088         (JSC::CodeBlock::immediateSwitchJumpTable):
2089         (JSC::CodeBlock::numberOfCharacterSwitchJumpTables):
2090         (JSC::CodeBlock::addCharacterSwitchJumpTable):
2091         (JSC::CodeBlock::characterSwitchJumpTable):
2092         (JSC::CodeBlock::numberOfStringSwitchJumpTables):
2093         (JSC::CodeBlock::addStringSwitchJumpTable):
2094         (JSC::CodeBlock::stringSwitchJumpTable):
2095         (JSC::CodeBlock::evalCodeCache):
2096         (JSC::CodeBlock::createRareDataIfNecessary):
2097
2098 2008-11-26  Peter Kasting  <pkasting@google.com>
2099
2100         Reviewed by Anders Carlsson.
2101
2102         https://bugs.webkit.org/show_bug.cgi?id=16814
2103         Allow ports to disable ActiveX->NPAPI conversion for Media Player.
2104         Improve handling of miscellaneous ActiveX objects.
2105
2106         * wtf/Platform.h: Add another ENABLE(...).
2107
2108 2008-12-08  Sam Weinig  <sam@webkit.org>
2109
2110         Reviewed by Mark Rowe.
2111
2112         Add dumping of CodeBlock member structure usage.
2113
2114         * bytecode/CodeBlock.cpp:
2115         (JSC::CodeBlock::dumpStatistics):
2116         * bytecode/EvalCodeCache.h:
2117         (JSC::EvalCodeCache::isEmpty):
2118
2119 2008-12-08  David Kilzer  <ddkilzer@apple.com>
2120
2121         Bug 22555: Sort "children" sections in Xcode project files
2122
2123         <https://bugs.webkit.org/show_bug.cgi?id=22555>
2124
2125         Reviewed by Eric Seidel.
2126
2127         * JavaScriptCore.xcodeproj/project.pbxproj: Sorted.
2128
2129 2008-12-08  Tony Chang  <tony@chromium.org>
2130
2131         Reviewed by Eric Seidel.
2132
2133         Enable Pan scrolling only when building on PLATFORM(WIN_OS)
2134         Previously platforms like Apple Windows WebKit, Cairo Windows WebKit,
2135         Wx and Chromium were enabling it explicitly, now we just turn it on
2136         for all WIN_OS, later platforms can turn it off as needed on Windows
2137         (or turn it on under Linux, etc.)
2138         https://bugs.webkit.org/show_bug.cgi?id=22698
2139
2140         * wtf/Platform.h:
2141
2142 2008-12-08  Sam Weinig  <sam@webkit.org>
2143
2144         Reviewed by Cameron Zwarich.
2145
2146         Add basic memory statistics dumping for CodeBlock.
2147
2148         * bytecode/CodeBlock.cpp:
2149         (JSC::CodeBlock::dumpStatistics):
2150         (JSC::CodeBlock::CodeBlock):
2151         (JSC::CodeBlock::~CodeBlock):
2152         * bytecode/CodeBlock.h:
2153
2154 2008-12-08  Simon Hausmann  <simon.hausmann@nokia.com>
2155
2156         Fix the Linux build with newer gcc/glibc.
2157
2158         * jit/ExecutableAllocatorPosix.cpp: Include unistd.h for
2159         getpagesize(), according to
2160         http://opengroup.org/onlinepubs/007908775/xsh/getpagesize.html
2161
2162 2008-12-08  Simon Hausmann  <simon.hausmann@nokia.com>
2163
2164         Fix the build with Qt on Windows.
2165
2166         * JavaScriptCore.pri: Compile ExecutableAllocatorWin.cpp on Windows.
2167
2168 2008-12-07  Oliver Hunt  <oliver@apple.com>
2169
2170         Reviewed by NOBODY (Buildfix).
2171
2172         Fix non-WREC builds
2173
2174         * runtime/RegExp.cpp:
2175         (JSC::RegExp::RegExp):
2176
2177 2008-12-07  Oliver Hunt  <oliver@apple.com>
2178
2179         Reviewed by NOBODY (Build fix).
2180
2181         Put ENABLE(ASSEMBLER) guards around use of ExecutableAllocator in global data
2182
2183         Correct Qt and Gtk project files
2184
2185         * GNUmakefile.am:
2186         * JavaScriptCore.pri:
2187         * runtime/JSGlobalData.h:
2188
2189 2008-12-07  Oliver Hunt  <oliver@apple.com>
2190
2191         Reviewed by NOBODY (Build fix).
2192
2193         Add new files to other projects.
2194
2195         * GNUmakefile.am:
2196         * JavaScriptCore.pri:
2197         * JavaScriptCore.pro:
2198
2199 2008-12-07  Oliver Hunt  <oliver@apple.com>
2200
2201         Rubber stamped by Mark Rowe.
2202
2203         Rename ExecutableAllocatorMMAP to the more sensible ExecutableAllocatorPosix
2204
2205         * JavaScriptCore.xcodeproj/project.pbxproj:
2206         * jit/ExecutableAllocator.h:
2207         * jit/ExecutableAllocatorPosix.cpp: Renamed from JavaScriptCore/jit/ExecutableAllocatorMMAP.cpp.
2208         (JSC::ExecutableAllocator::intializePageSize):
2209         (JSC::ExecutablePool::systemAlloc):
2210         (JSC::ExecutablePool::systemRelease):
2211
2212 2008-12-07  Oliver Hunt  <oliver@apple.com>
2213
2214         Reviewed by Cameron Zwarich and Sam Weinig
2215
2216         <rdar://problem/6309878> Need more granular control over allocation of executable memory (21783)
2217         <https://bugs.webkit.org/show_bug.cgi?id=21783>
2218
2219         Add a new allocator for use by the JIT that provides executable pages, so
2220         we can get rid of the current hack that makes the entire heap executable.
2221
2222         1-2% progression on SunSpider-v8, 1% on SunSpider.  Reduces memory usage as well!
2223
2224         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2225         * JavaScriptCore.vcproj/jsc/jsc.vcproj:
2226         * JavaScriptCore.xcodeproj/project.pbxproj:
2227         * assembler/AssemblerBuffer.h:
2228         (JSC::AssemblerBuffer::size):
2229         (JSC::AssemblerBuffer::executableCopy):
2230         * assembler/MacroAssembler.h:
2231         (JSC::MacroAssembler::size):
2232         (JSC::MacroAssembler::copyCode):
2233         * assembler/X86Assembler.h:
2234         (JSC::X86Assembler::size):
2235         (JSC::X86Assembler::executableCopy):
2236         * bytecode/CodeBlock.cpp:
2237         (JSC::CodeBlock::~CodeBlock):
2238         * bytecode/CodeBlock.h:
2239         (JSC::CodeBlock::executablePool):
2240         (JSC::CodeBlock::setExecutablePool):
2241         * bytecode/Instruction.h:
2242         (JSC::PolymorphicAccessStructureList::derefStructures):
2243         * interpreter/Interpreter.cpp:
2244         (JSC::Interpreter::~Interpreter):
2245         * interpreter/Interpreter.h:
2246         * jit/ExecutableAllocator.cpp: Added.
2247         * jit/ExecutableAllocator.h: Added.
2248         (JSC::ExecutablePool::create):
2249         (JSC::ExecutablePool::alloc):
2250         (JSC::ExecutablePool::~ExecutablePool):
2251         (JSC::ExecutablePool::available):
2252         (JSC::ExecutablePool::ExecutablePool):
2253         (JSC::ExecutablePool::poolAllocate):
2254         (JSC::ExecutableAllocator::ExecutableAllocator):
2255         (JSC::ExecutableAllocator::poolForSize):
2256         (JSC::ExecutablePool::sizeForAllocation):
2257         * jit/ExecutableAllocatorMMAP.cpp: Added.
2258         (JSC::ExecutableAllocator::intializePageSize):
2259         (JSC::ExecutablePool::systemAlloc):
2260         (JSC::ExecutablePool::systemRelease):
2261         * jit/ExecutableAllocatorWin.cpp: Added.
2262         (JSC::ExecutableAllocator::intializePageSize):
2263         (JSC::ExecutablePool::systemAlloc):
2264         (JSC::ExecutablePool::systemRelease):
2265         * jit/JIT.cpp:
2266         (JSC::JIT::privateCompile):
2267         (JSC::JIT::privateCompileCTIMachineTrampolines):
2268         * jit/JIT.h:
2269         (JSC::JIT::compileCTIMachineTrampolines):
2270         * jit/JITPropertyAccess.cpp:
2271         (JSC::JIT::privateCompilePutByIdTransition):
2272         (JSC::JIT::privateCompilePatchGetArrayLength):
2273         (JSC::JIT::privateCompileGetByIdSelf):
2274         (JSC::JIT::privateCompileGetByIdProto):
2275         (JSC::JIT::privateCompileGetByIdSelfList):
2276         (JSC::JIT::privateCompileGetByIdProtoList):
2277         (JSC::JIT::privateCompileGetByIdChainList):
2278         (JSC::JIT::privateCompileGetByIdChain):
2279         (JSC::JIT::privateCompilePutByIdReplace):
2280         * parser/Nodes.cpp:
2281         (JSC::RegExpNode::emitBytecode):
2282         * runtime/JSGlobalData.h:
2283         (JSC::JSGlobalData::poolForSize):
2284         * runtime/RegExp.cpp:
2285         (JSC::RegExp::RegExp):
2286         (JSC::RegExp::create):
2287         (JSC::RegExp::~RegExp):
2288         * runtime/RegExp.h:
2289         * runtime/RegExpConstructor.cpp:
2290         (JSC::constructRegExp):
2291         * runtime/RegExpPrototype.cpp:
2292         (JSC::regExpProtoFuncCompile):
2293         * runtime/StringPrototype.cpp:
2294         (JSC::stringProtoFuncMatch):
2295         (JSC::stringProtoFuncSearch):
2296         * wrec/WREC.cpp:
2297         (JSC::WREC::Generator::compileRegExp):
2298         * wrec/WRECGenerator.h:
2299         * wtf/FastMalloc.cpp:
2300         * wtf/FastMalloc.h:
2301         * wtf/TCSystemAlloc.cpp:
2302         (TryMmap):
2303         (TryVirtualAlloc):
2304         (TryDevMem):
2305         (TCMalloc_SystemRelease):
2306
2307 2008-12-06  Sam Weinig  <sam@webkit.org>
2308
2309         Fix the Gtk build.
2310
2311         * jit/JITPropertyAccess.cpp:
2312         (JSC::JIT::compileGetByIdHotPath):
2313         (JSC::JIT::compilePutByIdHotPath):
2314
2315 2008-12-06  Sam Weinig  <sam@webkit.org>
2316
2317         Reviewed by Cameron Zwarich,
2318
2319         Move CodeBlock constructor into the .cpp file.
2320
2321         Sunspider reports a .7% progression, but I can only assume this
2322         is noise.
2323
2324         * bytecode/CodeBlock.cpp:
2325         (JSC::CodeBlock::CodeBlock):
2326         * bytecode/CodeBlock.h:
2327
2328 2008-12-06  Sam Weinig  <sam@webkit.org>
2329
2330         Reviewed by Cameron Zwarich.
2331
2332         Split JumpTable code into its own file.
2333
2334         * GNUmakefile.am:
2335         * JavaScriptCore.pri:
2336         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2337         * JavaScriptCore.xcodeproj/project.pbxproj:
2338         * JavaScriptCoreSources.bkl:
2339         * bytecode/CodeBlock.cpp:
2340         * bytecode/CodeBlock.h:
2341         * bytecode/JumpTable.cpp: Copied from bytecode/CodeBlock.cpp.
2342         * bytecode/JumpTable.h: Copied from bytecode/CodeBlock.h.
2343
2344 2008-12-05  Sam Weinig  <sam@webkit.org>
2345
2346         Reviewed by Cameron Zwarich.
2347
2348         Fix for https://bugs.webkit.org/show_bug.cgi?id=22715
2349         Encapsulate more CodeBlock members in preparation
2350         of moving some of them to a rare data structure.
2351
2352         * bytecode/CodeBlock.cpp:
2353         (JSC::locationForOffset):
2354         (JSC::printConditionalJump):
2355         (JSC::printGetByIdOp):
2356         (JSC::printPutByIdOp):
2357         (JSC::CodeBlock::printStructure):
2358         (JSC::CodeBlock::printStructures):
2359         (JSC::CodeBlock::dump):
2360         (JSC::CodeBlock::~CodeBlock):
2361         (JSC::CodeBlock::unlinkCallers):
2362         (JSC::CodeBlock::derefStructures):
2363         (JSC::CodeBlock::refStructures):
2364         (JSC::CodeBlock::mark):
2365         (JSC::CodeBlock::getHandlerForVPC):
2366         (JSC::CodeBlock::nativeExceptionCodeForHandlerVPC):
2367         (JSC::CodeBlock::lineNumberForVPC):
2368         (JSC::CodeBlock::expressionRangeForVPC):
2369         (JSC::CodeBlock::shrinkToFit):
2370         * bytecode/CodeBlock.h:
2371         (JSC::CodeBlock::CodeBlock):
2372         (JSC::CodeBlock::addCaller):
2373         (JSC::CodeBlock::removeCaller):
2374         (JSC::CodeBlock::isKnownNotImmediate):
2375         (JSC::CodeBlock::isConstantRegisterIndex):
2376         (JSC::CodeBlock::getConstant):
2377         (JSC::CodeBlock::isTemporaryRegisterIndex):
2378         (JSC::CodeBlock::getStubInfo):
2379         (JSC::CodeBlock::getCallLinkInfo):
2380         (JSC::CodeBlock::instructions):
2381         (JSC::CodeBlock::setJITCode):
2382         (JSC::CodeBlock::jitCode):
2383         (JSC::CodeBlock::ownerNode):
2384         (JSC::CodeBlock::setGlobalData):
2385         (JSC::CodeBlock::setThisRegister):
2386         (JSC::CodeBlock::thisRegister):
2387         (JSC::CodeBlock::setNeedsFullScopeChain):
2388         (JSC::CodeBlock::needsFullScopeChain):
2389         (JSC::CodeBlock::setUsesEval):
2390         (JSC::CodeBlock::usesEval):
2391         (JSC::CodeBlock::setUsesArguments):
2392         (JSC::CodeBlock::usesArguments):
2393         (JSC::CodeBlock::codeType):
2394         (JSC::CodeBlock::source):
2395         (JSC::CodeBlock::sourceOffset):
2396         (JSC::CodeBlock::addGlobalResolveInstruction):
2397         (JSC::CodeBlock::numberOfPropertyAccessInstructions):
2398         (JSC::CodeBlock::addPropertyAccessInstruction):
2399         (JSC::CodeBlock::propertyAccessInstruction):
2400         (JSC::CodeBlock::numberOfCallLinkInfos):
2401         (JSC::CodeBlock::addCallLinkInfo):
2402         (JSC::CodeBlock::callLinkInfo):
2403         (JSC::CodeBlock::numberOfJumpTargets):
2404         (JSC::CodeBlock::addJumpTarget):
2405         (JSC::CodeBlock::jumpTarget):
2406         (JSC::CodeBlock::lastJumpTarget):
2407         (JSC::CodeBlock::numberOfExceptionHandlers):
2408         (JSC::CodeBlock::addExceptionHandler):
2409         (JSC::CodeBlock::exceptionHandler):
2410         (JSC::CodeBlock::addExpressionInfo):
2411         (JSC::CodeBlock::numberOfLineInfos):
2412         (JSC::CodeBlock::addLineInfo):
2413         (JSC::CodeBlock::lastLineInfo):
2414         (JSC::CodeBlock::jitReturnAddressVPCMap):
2415         (JSC::CodeBlock::numberOfIdentifiers):
2416         (JSC::CodeBlock::addIdentifier):
2417         (JSC::CodeBlock::identifier):
2418         (JSC::CodeBlock::numberOfConstantRegisters):
2419         (JSC::CodeBlock::addConstantRegister):
2420         (JSC::CodeBlock::constantRegister):
2421         (JSC::CodeBlock::addFunction):
2422         (JSC::CodeBlock::function):
2423         (JSC::CodeBlock::addFunctionExpression):
2424         (JSC::CodeBlock::functionExpression):
2425         (JSC::CodeBlock::addUnexpectedConstant):
2426         (JSC::CodeBlock::unexpectedConstant):
2427         (JSC::CodeBlock::addRegExp):
2428         (JSC::CodeBlock::regexp):
2429         (JSC::CodeBlock::symbolTable):
2430         (JSC::CodeBlock::evalCodeCache):
2431         New inline setters/getters.
2432
2433         (JSC::ProgramCodeBlock::ProgramCodeBlock):
2434         (JSC::ProgramCodeBlock::~ProgramCodeBlock):
2435         (JSC::ProgramCodeBlock::clearGlobalObject):
2436         * bytecode/SamplingTool.cpp:
2437         (JSC::ScopeSampleRecord::sample):
2438         (JSC::SamplingTool::dump):
2439         * bytecompiler/BytecodeGenerator.cpp:
2440         * bytecompiler/BytecodeGenerator.h:
2441         * bytecompiler/Label.h:
2442         * interpreter/CallFrame.cpp:
2443         * interpreter/Interpreter.cpp:
2444         * jit/JIT.cpp:
2445         * jit/JITCall.cpp:
2446         * jit/JITInlineMethods.h:
2447         * jit/JITPropertyAccess.cpp:
2448         * parser/Nodes.cpp:
2449         * runtime/Arguments.h:
2450         * runtime/ExceptionHelpers.cpp:
2451         * runtime/JSActivation.cpp:
2452         * runtime/JSActivation.h:
2453         * runtime/JSGlobalObject.cpp:
2454         Change direct access to use new getter/setters.
2455
2456 2008-12-05  Gavin Barraclough  <barraclough@apple.com>
2457
2458         Reviewed by Oliver Hunt.
2459
2460         Prevent GCC4.2 from hanging when trying to compile Interpreter.cpp.
2461         Added "-fno-var-tracking" compiler flag.
2462
2463         https://bugs.webkit.org/show_bug.cgi?id=22704
2464
2465         * JavaScriptCore.xcodeproj/project.pbxproj:
2466
2467 2008-12-05  Gavin Barraclough  <barraclough@apple.com>
2468
2469         Reviewed by Oliver Hunt.
2470
2471         Ordering of branch operands in MacroAssembler in unnecessarily  inconsistent.
2472
2473         je, jg etc take an immediate operand as the second argument, but for the
2474         equality branches (je, jne) the immediate operand was the first argument.  This
2475         was unnecessarily inconsistent.  Change je, jne methods to take the immediate
2476         as the second argument.
2477
2478         https://bugs.webkit.org/show_bug.cgi?id=22703
2479
2480         * assembler/MacroAssembler.h:
2481         (JSC::MacroAssembler::je32):
2482         (JSC::MacroAssembler::jne32):
2483         * jit/JIT.cpp:
2484         (JSC::JIT::compileOpStrictEq):
2485         * wrec/WRECGenerator.cpp:
2486         (JSC::WREC::Generator::generateEnter):
2487         (JSC::WREC::Generator::generateNonGreedyQuantifier):
2488         (JSC::WREC::Generator::generateGreedyQuantifier):
2489         (JSC::WREC::Generator::generatePatternCharacterPair):
2490         (JSC::WREC::Generator::generatePatternCharacter):
2491         (JSC::WREC::Generator::generateCharacterClassInvertedRange):
2492         (JSC::WREC::Generator::generateCharacterClassInverted):
2493         (JSC::WREC::Generator::generateAssertionBOL):
2494         (JSC::WREC::Generator::generateAssertionWordBoundary):
2495
2496 2008-12-05  Gavin Barraclough  <barraclough@apple.com>
2497
2498         Reviewed by Geoff Garen.
2499
2500         Second tranche of porting JIT.cpp to MacroAssembler interface.
2501
2502         * assembler/MacroAssembler.h:
2503         (JSC::MacroAssembler::mul32):
2504         (JSC::MacroAssembler::jl32):
2505         (JSC::MacroAssembler::jnzSub32):
2506         (JSC::MacroAssembler::joAdd32):
2507         (JSC::MacroAssembler::joMul32):
2508         (JSC::MacroAssembler::jzSub32):
2509         * jit/JIT.cpp:
2510         (JSC::JIT::emitSlowScriptCheck):
2511         (JSC::JIT::privateCompileMainPass):
2512         (JSC::JIT::privateCompileSlowCases):
2513         (JSC::JIT::privateCompileCTIMachineTrampolines):
2514         * jit/JIT.h:
2515         * jit/JITInlineMethods.h:
2516         (JSC::JIT::emitJumpIfNotJSCell):
2517         (JSC::JIT::emitJumpSlowCaseIfNotJSCell):
2518
2519 2008-12-05  David Kilzer  <ddkilzer@apple.com>
2520
2521         Bug 22609: Provide a build-time choice when generating hash tables for properties of built-in DOM objects
2522
2523         <https://bugs.webkit.org/show_bug.cgi?id=22609>
2524         <rdar://problem/6331749>
2525
2526         Reviewed by Darin Adler.
2527
2528         Initial patch by Yosen Lin.  Adapted for ToT WebKit by David Kilzer.
2529
2530         Added back the code that generates a "compact" hash (instead of a
2531         perfect hash) as a build-time option using the
2532         ENABLE(PERFECT_HASH_SIZE) macro as defined in Lookup.h.
2533
2534         * create_hash_table: Rename variables to differentiate perfect hash
2535         values from compact hash values.  Added back code to compute compact
2536         hash tables.  Generate both hash table sizes and emit
2537         conditionalized code based on ENABLE(PERFECT_HASH_SIZE).
2538         * runtime/Lookup.cpp:
2539         (JSC::HashTable::createTable): Added version of createTable() for
2540         use with compact hash tables.
2541         (JSC::HashTable::deleteTable): Updated to work with compact hash
2542         tables.
2543         * runtime/Lookup.h: Defined ENABLE(PERFECT_HASH_SIZE) macro here.
2544         (JSC::HashEntry::initialize): Set m_next to zero when using compact
2545         hash tables.
2546         (JSC::HashEntry::setNext): Added for compact hash tables.
2547         (JSC::HashEntry::next): Added for compact hash tables.
2548         (JSC::HashTable::entry): Added version of entry() for use with
2549         compact hash tables.
2550         * runtime/Structure.cpp:
2551         (JSC::Structure::getEnumerablePropertyNames): Updated to work with
2552         compact hash tables.
2553
2554 2008-12-05  Gavin Barraclough  <barraclough@apple.com>
2555
2556         Reviewed by Geoff Garen.
2557
2558         Remove redundant calls to JIT::emitSlowScriptCheck.
2559         This is checked in the hot path, so is not needed on the slow path - and the code
2560         was being planted before the start of the slow case, so was completely unreachable!
2561
2562         * jit/JIT.cpp:
2563         (JSC::JIT::privateCompileSlowCases):
2564
2565 2008-12-05  Gavin Barraclough  <barraclough@apple.com>
2566
2567         Reviewed by Geoff Garen.
2568
2569         Move JIT::compileOpStrictEq to MacroAssembler interface.
2570
2571         The rewrite also looks like a small (<1%) performance progression.
2572
2573         https://bugs.webkit.org/show_bug.cgi?id=22697
2574
2575         * jit/JIT.cpp:
2576         (JSC::JIT::compileOpStrictEq):
2577         (JSC::JIT::privateCompileSlowCases):
2578         * jit/JIT.h:
2579         * jit/JITInlineMethods.h:
2580         (JSC::JIT::emitJumpIfJSCell):
2581         (JSC::JIT::emitJumpSlowCaseIfJSCell):
2582
2583 2008-12-05  Gavin Barraclough  <barraclough@apple.com>
2584
2585         Reviewed by Geoff Garen.
2586
2587         Remove m_assembler from MacroAssembler::Jump.
2588         Keeping a pointer allowed for some syntactic sugar - "link()" looks nicer
2589         than "link(this)".  But maintaining this doubles the size of Jump, which
2590         is even more unfortunate for the JIT, since there are many large structures
2591         holding JmpSrcs.  Probably best to remove it.
2592
2593         https://bugs.webkit.org/show_bug.cgi?id=22693
2594
2595         * assembler/MacroAssembler.h:
2596         (JSC::MacroAssembler::Jump::Jump):
2597         (JSC::MacroAssembler::Jump::link):
2598         (JSC::MacroAssembler::Jump::linkTo):
2599         (JSC::MacroAssembler::JumpList::link):
2600         (JSC::MacroAssembler::JumpList::linkTo):
2601         (JSC::MacroAssembler::jae32):
2602         (JSC::MacroAssembler::je32):
2603         (JSC::MacroAssembler::je16):
2604         (JSC::MacroAssembler::jg32):
2605         (JSC::MacroAssembler::jge32):
2606         (JSC::MacroAssembler::jl32):
2607         (JSC::MacroAssembler::jle32):
2608         (JSC::MacroAssembler::jnePtr):
2609         (JSC::MacroAssembler::jne32):
2610         (JSC::MacroAssembler::jnset32):
2611         (JSC::MacroAssembler::jset32):
2612         (JSC::MacroAssembler::jump):
2613         (JSC::MacroAssembler::jzSub32):
2614         (JSC::MacroAssembler::joAdd32):
2615         (JSC::MacroAssembler::call):
2616         * wrec/WREC.cpp:
2617         (JSC::WREC::Generator::compileRegExp):
2618         * wrec/WRECGenerator.cpp:
2619         (JSC::WREC::Generator::generateEnter):
2620         (JSC::WREC::Generator::generateBackreferenceQuantifier):
2621         (JSC::WREC::Generator::generateNonGreedyQuantifier):
2622         (JSC::WREC::Generator::generateGreedyQuantifier):
2623         (JSC::WREC::Generator::generatePatternCharacter):
2624         (JSC::WREC::Generator::generateCharacterClassInvertedRange):
2625         (JSC::WREC::Generator::generateCharacterClassInverted):
2626         (JSC::WREC::Generator::generateCharacterClass):
2627         (JSC::WREC::Generator::generateParenthesesAssertion):
2628         (JSC::WREC::Generator::generateParenthesesInvertedAssertion):
2629         (JSC::WREC::Generator::generateParenthesesNonGreedy):
2630         (JSC::WREC::Generator::generateParenthesesResetTrampoline):
2631         (JSC::WREC::Generator::generateAssertionBOL):
2632         (JSC::WREC::Generator::generateAssertionEOL):
2633         (JSC::WREC::Generator::generateAssertionWordBoundary):
2634         (JSC::WREC::Generator::generateBackreference):
2635         (JSC::WREC::Generator::terminateAlternative):
2636         (JSC::WREC::Generator::terminateDisjunction):
2637         * wrec/WRECParser.h:
2638
2639 2008-12-05  Gavin Barraclough  <barraclough@apple.com>
2640
2641         Reviewed by Geoffrey Garen.
2642
2643         Simplify JIT generated checks for timeout code, by moving more work into the C function.
2644         https://bugs.webkit.org/show_bug.cgi?id=22688
2645
2646         * interpreter/Interpreter.cpp:
2647         (JSC::Interpreter::cti_timeout_check):
2648         * interpreter/Interpreter.h:
2649         * jit/JIT.cpp:
2650         (JSC::JIT::emitSlowScriptCheck):
2651
2652 2008-12-05  Sam Weinig  <sam@webkit.org>
2653
2654         Reviewed by Geoffrey Garen.
2655
2656         Encapsulate access to jump tables in the CodeBlock in preparation
2657         of moving them to a rare data structure.
2658
2659         * bytecode/CodeBlock.cpp:
2660         (JSC::CodeBlock::dump):
2661         (JSC::CodeBlock::shrinkToFit):
2662         * bytecode/CodeBlock.h:
2663         (JSC::CodeBlock::numberOfImmediateSwitchJumpTables):
2664         (JSC::CodeBlock::addImmediateSwitchJumpTable):
2665         (JSC::CodeBlock::immediateSwitchJumpTable):
2666         (JSC::CodeBlock::numberOfCharacterSwitchJumpTables):
2667         (JSC::CodeBlock::addCharacterSwitchJumpTable):
2668         (JSC::CodeBlock::characterSwitchJumpTable):
2669         (JSC::CodeBlock::numberOfStringSwitchJumpTables):
2670         (JSC::CodeBlock::addStringSwitchJumpTable):
2671         (JSC::CodeBlock::stringSwitchJumpTable):
2672         * bytecompiler/BytecodeGenerator.cpp:
2673         (JSC::BytecodeGenerator::generate):
2674         (JSC::BytecodeGenerator::endSwitch):
2675         * interpreter/Interpreter.cpp:
2676         (JSC::Interpreter::privateExecute):
2677         (JSC::Interpreter::cti_op_switch_imm):
2678         (JSC::Interpreter::cti_op_switch_char):
2679         (JSC::Interpreter::cti_op_switch_string):
2680         * jit/JIT.cpp:
2681         (JSC::JIT::privateCompileMainPass):
2682
2683 2008-12-05  Adam Roben  <aroben@apple.com>
2684
2685         Windows build fix after r39020
2686
2687         * jit/JITInlineMethods.h:
2688         (JSC::JIT::restoreArgumentReference):
2689         (JSC::JIT::restoreArgumentReferenceForTrampoline):
2690         Add some apparently-missing __.
2691
2692 2008-12-04  Geoffrey Garen  <ggaren@apple.com>
2693
2694         Reviewed by Darin Adler.
2695         
2696         https://bugs.webkit.org/show_bug.cgi?id=22673
2697         
2698         Added support for the assertion (?=) and inverted assertion (?!) atoms
2699         in WREC.
2700
2701         * wrec/WRECGenerator.cpp:
2702         (JSC::WREC::Generator::generateParenthesesAssertion):
2703         (JSC::WREC::Generator::generateParenthesesInvertedAssertion): Split the
2704         old (unused) generateParentheses into these two functions, with more
2705         limited capabilities.
2706         
2707         * wrec/WRECGenerator.h:
2708         (JSC::WREC::Generator::): Moved an enum to the top of the class definition,
2709         to match the WebKit style, and removed a defunct comment.
2710
2711         * wrec/WRECParser.cpp:
2712         (JSC::WREC::Parser::parseParentheses):
2713         (JSC::WREC::Parser::consumeParenthesesType):
2714         * wrec/WRECParser.h:
2715         (JSC::WREC::Parser::): Added support for parsing (?=) and (?!).
2716
2717 2008-12-05  Simon Hausmann  <simon.hausmann@nokia.com>
2718
2719         Rubber-stamped by Tor Arne Vestbø.
2720
2721         Disable the JIT for the Qt build alltogether again, after observing
2722         more miscompilations in a wider range of newer gcc versions.
2723
2724         * JavaScriptCore.pri:
2725
2726 2008-12-05  Simon Hausmann  <simon.hausmann@nokia.com>
2727
2728         Reviewed by Tor Arne Vestbø.
2729
2730         Disable the JIT for the Qt build on Linux unless gcc is >= 4.2,
2731         due to miscompilations.
2732
2733         * JavaScriptCore.pri:
2734
2735 2008-12-04  Gavin Barraclough  <barraclough@apple.com>
2736
2737         Reviewed by Geoff Garen.
2738
2739         Start porting the JIT to use the MacroAssembler.
2740
2741         https://bugs.webkit.org/show_bug.cgi?id=22671
2742         No change in performance.
2743
2744         * assembler/MacroAssembler.h:
2745         (JSC::MacroAssembler::Jump::operator X86Assembler::JmpSrc):
2746         (JSC::MacroAssembler::add32):
2747         (JSC::MacroAssembler::and32):
2748         (JSC::MacroAssembler::lshift32):
2749         (JSC::MacroAssembler::rshift32):
2750         (JSC::MacroAssembler::storePtr):
2751         (JSC::MacroAssembler::store32):
2752         (JSC::MacroAssembler::poke):
2753         (JSC::MacroAssembler::move):
2754         (JSC::MacroAssembler::compareImm32ForBranchEquality):
2755         (JSC::MacroAssembler::jnePtr):
2756         (JSC::MacroAssembler::jnset32):
2757         (JSC::MacroAssembler::jset32):
2758         (JSC::MacroAssembler::jzeroSub32):
2759         (JSC::MacroAssembler::joverAdd32):
2760         (JSC::MacroAssembler::call):
2761         * assembler/X86Assembler.h:
2762         (JSC::X86Assembler::shll_i8r):
2763         * jit/JIT.cpp:
2764         (JSC::JIT::privateCompileMainPass):
2765         (JSC::JIT::privateCompile):
2766         (JSC::JIT::privateCompileCTIMachineTrampolines):
2767         * jit/JIT.h:
2768         * jit/JITArithmetic.cpp:
2769         (JSC::JIT::compileBinaryArithOp):
2770         * jit/JITInlineMethods.h:
2771         (JSC::JIT::emitGetVirtualRegister):
2772         (JSC::JIT::emitPutCTIArg):
2773         (JSC::JIT::emitPutCTIArgConstant):
2774         (JSC::JIT::emitGetCTIArg):
2775         (JSC::JIT::emitPutCTIArgFromVirtualRegister):
2776         (JSC::JIT::emitPutCTIParam):
2777         (JSC::JIT::emitGetCTIParam):
2778         (JSC::JIT::emitPutToCallFrameHeader):
2779         (JSC::JIT::emitPutImmediateToCallFrameHeader):
2780         (JSC::JIT::emitGetFromCallFrameHeader):
2781         (JSC::JIT::emitPutVirtualRegister):
2782         (JSC::JIT::emitInitRegister):
2783         (JSC::JIT::emitNakedCall):
2784         (JSC::JIT::restoreArgumentReference):
2785         (JSC::JIT::restoreArgumentReferenceForTrampoline):
2786         (JSC::JIT::emitCTICall):
2787         (JSC::JIT::checkStructure):
2788         (JSC::JIT::emitJumpSlowCaseIfNotJSCell):
2789         (JSC::JIT::emitJumpSlowCaseIfNotImmNum):
2790         (JSC::JIT::emitJumpSlowCaseIfNotImmNums):
2791         (JSC::JIT::emitFastArithDeTagImmediate):
2792         (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero):
2793         (JSC::JIT::emitFastArithReTagImmediate):
2794         (JSC::JIT::emitFastArithPotentiallyReTagImmediate):
2795         (JSC::JIT::emitFastArithImmToInt):
2796         (JSC::JIT::emitFastArithIntToImmOrSlowCase):
2797         (JSC::JIT::emitFastArithIntToImmNoCheck):
2798         (JSC::JIT::emitTagAsBoolImmediate):
2799         * jit/JITPropertyAccess.cpp:
2800         (JSC::JIT::privateCompilePutByIdTransition):
2801
2802 2008-12-04  Geoffrey Garen  <ggaren@apple.com>
2803
2804         Reviewed by Oliver Hunt.
2805         
2806         Some refactoring for generateGreedyQuantifier.
2807         
2808         SunSpider reports no change (possibly a 0.3% speedup).
2809
2810         * wrec/WRECGenerator.cpp:
2811         (JSC::WREC::Generator::generateGreedyQuantifier): Clarified label
2812         meanings and unified some logic to simplify things.
2813
2814         * wrec/WRECParser.h:
2815         (JSC::WREC::Parser::parseAlternative): Added a version of parseAlternative
2816         that can jump to a Label, instead of a JumpList, upon failure. (Eventually,
2817         when we have a true Label class, this will be redundant.) This makes
2818         things easier for generateGreedyQuantifier, because it can avoid
2819         explicitly linking things.
2820
2821 2008-12-04  Simon Hausmann  <simon.hausmann@nokia.com>
2822
2823         Reviewed by Holger Freyther.
2824
2825         Fix crashes in the Qt build on Linux/i386 with non-executable memory
2826         by enabling TCSystemAlloc and the PROT_EXEC flag for mmap.
2827
2828         * JavaScriptCore.pri: Enable the use of TCSystemAlloc if the JIT is
2829         enabled.
2830         * wtf/TCSystemAlloc.cpp: Extend the PROT_EXEC permissions to
2831         PLATFORM(QT).
2832
2833 2008-12-04  Simon Hausmann  <simon.hausmann@nokia.com>
2834
2835         Reviewed by Tor Arne Vestbø.
2836
2837         Enable ENABLE_JIT_OPTIMIZE_CALL, ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS
2838         and ENABLE_JIT_OPTIMIZE_ARITHMETIC, as suggested by Niko.
2839
2840         * JavaScriptCore.pri: 
2841
2842 2008-12-04  Kent Hansen  <khansen@trolltech.com>
2843
2844         Reviewed by Simon Hausmann.
2845
2846         Enable the JSC jit for the Qt build by default for release builds on
2847         linux-g++ and win32-msvc.
2848
2849         * JavaScriptCore.pri:
2850
2851 2008-12-04  Gavin Barraclough  <barraclough@apple.com>
2852
2853         Reviewed by Oliver Hunt.
2854
2855         Allow JIT to function without property access repatching and arithmetic optimizations.
2856         Controlled by ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS and ENABLE_JIT_OPTIMIZE_ARITHMETIC switches.
2857
2858         https://bugs.webkit.org/show_bug.cgi?id=22643
2859
2860         * JavaScriptCore.xcodeproj/project.pbxproj:
2861         * jit/JIT.cpp:
2862         (JSC::JIT::privateCompileMainPass):
2863         (JSC::JIT::privateCompileSlowCases):
2864         * jit/JIT.h:
2865         * jit/JITArithmetic.cpp: Copied from jit/JIT.cpp.
2866         (JSC::JIT::compileBinaryArithOp):
2867         (JSC::JIT::compileBinaryArithOpSlowCase):
2868         * jit/JITPropertyAccess.cpp: Copied from jit/JIT.cpp.
2869         (JSC::JIT::compileGetByIdHotPath):
2870         (JSC::JIT::compileGetByIdSlowCase):
2871         (JSC::JIT::compilePutByIdHotPath):
2872         (JSC::JIT::compilePutByIdSlowCase):
2873         (JSC::resizePropertyStorage):
2874         (JSC::transitionWillNeedStorageRealloc):
2875         (JSC::JIT::privateCompilePutByIdTransition):
2876         (JSC::JIT::patchGetByIdSelf):
2877         (JSC::JIT::patchPutByIdReplace):
2878         (JSC::JIT::privateCompilePatchGetArrayLength):
2879         * wtf/Platform.h:
2880
2881 2008-12-03  Geoffrey Garen  <ggaren@apple.com>
2882
2883         Reviewed by Oliver Hunt.
2884         
2885         Optimized sequences of characters in regular expressions by comparing
2886         two characters at a time.
2887         
2888         1-2% speedup on SunSpider, 19-25% speedup on regexp-dna.
2889
2890         * assembler/MacroAssembler.h:
2891         (JSC::MacroAssembler::load32):
2892         (JSC::MacroAssembler::jge32): Filled out a few more macro methods.
2893
2894         * assembler/X86Assembler.h:
2895         (JSC::X86Assembler::movl_mr): Added a verion of movl_mr that operates
2896         without an offset, to allow the macro assembler to optmize for that case.
2897         
2898         * wrec/WREC.cpp:
2899         (JSC::WREC::Generator::compileRegExp): Test the saved value of index
2900         instead of the index register when checking for "end of input." The
2901         index register doesn't increment by 1 in an orderly fashion, so testing
2902         it for == "end of input" is not valid.
2903         
2904         Also, jump all the way to "return failure" upon reaching "end of input,"
2905         instead of executing the next alternative. This is more logical, and
2906         it's a slight optimization in the case of an expression with many alternatives.
2907
2908         * wrec/WRECGenerator.cpp:
2909         (JSC::WREC::Generator::generateIncrementIndex): Added support for
2910         jumping to a failure label in the case where the index has reached "end
2911         of input."
2912
2913         (JSC::WREC::Generator::generatePatternCharacterSequence):
2914         (JSC::WREC::Generator::generatePatternCharacterPair): This is the
2915         optmization. It's basically like generatePatternCharacter, but it runs two
2916         characters at a time.
2917         
2918         (JSC::WREC::Generator::generatePatternCharacter): Changed to use isASCII,
2919         since it's clearer than comparing to a magic hex value.
2920         
2921         * wrec/WRECGenerator.h:
2922
2923 2008-12-03  Gavin Barraclough  <barraclough@apple.com>
2924
2925         Reviewed by Cameron Zwarich.
2926
2927         Allow JIT to operate without the call-repatching optimization.
2928         Controlled by ENABLE(JIT_OPTIMIZE_CALL), defaults on, disabling
2929         this leads to significant performance regression.
2930
2931         https://bugs.webkit.org/show_bug.cgi?id=22639
2932
2933         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2934         * JavaScriptCore.xcodeproj/project.pbxproj:
2935         * jit/JIT.cpp:
2936         (JSC::JIT::privateCompileSlowCases):
2937         * jit/JIT.h:
2938         * jit/JITCall.cpp: Copied from jit/JIT.cpp.
2939         (JSC::JIT::compileOpCallInitializeCallFrame):
2940         (JSC::JIT::compileOpCallSetupArgs):
2941         (JSC::JIT::compileOpCallEvalSetupArgs):
2942         (JSC::JIT::compileOpConstructSetupArgs):
2943         (JSC::JIT::compileOpCall):
2944         (JSC::JIT::compileOpCallSlowCase):
2945         (JSC::unreachable):
2946         * jit/JITInlineMethods.h: Copied from jit/JIT.cpp.
2947         (JSC::JIT::checkStructure):
2948         (JSC::JIT::emitFastArithPotentiallyReTagImmediate):
2949         (JSC::JIT::emitTagAsBoolImmediate):
2950         * wtf/Platform.h:
2951
2952 2008-12-03  Eric Seidel  <eric@webkit.org>
2953
2954         Rubber-stamped by David Hyatt.
2955
2956         Make HAVE_ACCESSIBILITY only define if !defined
2957
2958         * wtf/Platform.h:
2959
2960 2008-12-03  Sam Weinig  <sam@webkit.org>
2961
2962         Fix build.
2963
2964         * assembler/X86Assembler.h:
2965         (JSC::X86Assembler::orl_i32r):
2966
2967 2008-12-03  Sam Weinig  <sam@webkit.org>
2968
2969         Reviewed by Geoffrey Garen.
2970
2971         Remove shared AssemblerBuffer 1MB buffer and instead give AssemblerBuffer
2972         an 256 byte inline capacity.
2973
2974         1% progression on Sunspider.
2975
2976         * assembler/AssemblerBuffer.h:
2977         (JSC::AssemblerBuffer::AssemblerBuffer):
2978         (JSC::AssemblerBuffer::~AssemblerBuffer):
2979         (JSC::AssemblerBuffer::grow):
2980         * assembler/MacroAssembler.h:
2981         (JSC::MacroAssembler::MacroAssembler):
2982         * assembler/X86Assembler.h:
2983         (JSC::X86Assembler::X86Assembler):
2984         * interpreter/Interpreter.cpp:
2985         (JSC::Interpreter::Interpreter):
2986         * interpreter/Interpreter.h:
2987         * jit/JIT.cpp:
2988         (JSC::JIT::JIT):
2989         * parser/Nodes.cpp:
2990         (JSC::RegExpNode::emitBytecode):
2991         * runtime/RegExp.cpp:
2992         (JSC::RegExp::RegExp):
2993         (JSC::RegExp::create):
2994         * runtime/RegExp.h:
2995         * runtime/RegExpConstructor.cpp:
2996         (JSC::constructRegExp):
2997         * runtime/RegExpPrototype.cpp:
2998         (JSC::regExpProtoFuncCompile):
2999         * runtime/StringPrototype.cpp:
3000         (JSC::stringProtoFuncMatch):
3001         (JSC::stringProtoFuncSearch):
3002         * wrec/WREC.cpp:
3003         (JSC::WREC::Generator::compileRegExp):
3004         * wrec/WRECGenerator.h:
3005         (JSC::WREC::Generator::Generator):
3006         * wrec/WRECParser.h:
3007         (JSC::WREC::Parser::Parser):
3008
3009 2008-12-03  Geoffrey Garen  <ggaren@apple.com>
3010
3011         Reviewed by Oliver Hunt, with help from Gavin Barraclough.
3012         
3013         orl_i32r was actually coded as an 8bit OR. So, I renamed orl_i32r to
3014         orl_i8r, changed all orl_i32r clients to use orl_i8r, and then added
3015         a new orl_i32r that actually does a 32bit OR.
3016         
3017         (32bit OR is currently unused, but a patch I'm working on uses it.)
3018
3019         * assembler/MacroAssembler.h:
3020         (JSC::MacroAssembler::or32): Updated to choose between 8bit and 32bit OR.
3021
3022         * assembler/X86Assembler.h:
3023         (JSC::X86Assembler::orl_i8r): The old orl_i32r.
3024         (JSC::X86Assembler::orl_i32r): The new orl_i32r.
3025         
3026         * jit/JIT.cpp:
3027         (JSC::JIT::emitFastArithPotentiallyReTagImmediate):
3028         (JSC::JIT::emitTagAsBoolImmediate): Use orl_i8r, since we're ORing 8bit
3029         values.
3030
3031 2008-12-03  Dean Jackson  <dino@apple.com>
3032
3033         Reviewed by Dan Bernstein.
3034
3035         Helper functions for turn -> degrees.
3036         https://bugs.webkit.org/show_bug.cgi?id=22497
3037
3038         * wtf/MathExtras.h:
3039         (turn2deg):
3040         (deg2turn):
3041
3042 2008-12-02  Cameron Zwarich  <zwarich@apple.com>
3043
3044         Reviewed by Geoff Garen.
3045
3046         Bug 22504: Crashes during code generation occur due to refing of ignoredResult()
3047         <https://bugs.webkit.org/show_bug.cgi?id=22504>
3048
3049         Since ignoredResult() was implemented by casting 1 to a RegisterID*, any
3050         attempt to ref ignoredResult() results in a crash. This will occur in
3051         code generation of a function body where a node emits another node with
3052         the dst that was passed to it, and then refs the returned RegisterID*.
3053
3054         To fix this problem, make ignoredResult() a member function of
3055         BytecodeGenerator that simply returns a pointe to a fixed RegisterID
3056         member of BytecodeGenerator.
3057
3058         * bytecompiler/BytecodeGenerator.h:
3059         (JSC::BytecodeGenerator::ignoredResult):
3060         * bytecompiler/RegisterID.h:
3061         * parser/Nodes.cpp:
3062         (JSC::NullNode::emitBytecode):
3063         (JSC::BooleanNode::emitBytecode):
3064         (JSC::NumberNode::emitBytecode):
3065         (JSC::StringNode::emitBytecode):
3066         (JSC::RegExpNode::emitBytecode):
3067         (JSC::ThisNode::emitBytecode):
3068         (JSC::ResolveNode::emitBytecode):
3069         (JSC::ObjectLiteralNode::emitBytecode):
3070         (JSC::PostfixResolveNode::emitBytecode):
3071         (JSC::PostfixBracketNode::emitBytecode):
3072         (JSC::PostfixDotNode::emitBytecode):
3073         (JSC::DeleteValueNode::emitBytecode):
3074         (JSC::VoidNode::emitBytecode):
3075         (JSC::TypeOfResolveNode::emitBytecode):
3076         (JSC::TypeOfValueNode::emitBytecode):
3077         (JSC::PrefixResolveNode::emitBytecode):
3078         (JSC::AssignResolveNode::emitBytecode):
3079         (JSC::CommaNode::emitBytecode):
3080         (JSC::ForNode::emitBytecode):
3081         (JSC::ForInNode::emitBytecode):
3082         (JSC::ReturnNode::emitBytecode):
3083         (JSC::ThrowNode::emitBytecode):
3084         (JSC::FunctionBodyNode::emitBytecode):
3085         (JSC::FuncDeclNode::emitBytecode):
3086
3087 2008-12-02  Geoffrey Garen  <ggaren@apple.com>
3088
3089         Reviewed by Cameron Zwarich.
3090         
3091         Fixed https://bugs.webkit.org/show_bug.cgi?id=22537
3092         REGRESSION (r38745): Assertion failure in jsSubstring() at ge.com
3093
3094         The bug was that index would become greater than length, so our
3095         "end of input" checks, which all check "index == length", would fail.
3096         
3097         The solution is to check for end of input before incrementing index,
3098         to ensure that index is always <= length.
3099         
3100         As a side benefit, generateJumpIfEndOfInput can now use je instead of
3101         jg, which should be slightly faster.
3102
3103         * wrec/WREC.cpp:
3104         (JSC::WREC::Generator::compileRegExp):
3105         * wrec/WRECGenerator.cpp:
3106         (JSC::WREC::Generator::generateJumpIfEndOfInput):
3107
3108 2008-12-02  Gavin Barraclough  <barraclough@apple.com>
3109
3110         Reviewed by Geoffrey Garen.
3111
3112         Plant shift right immediate instructions, which are awesome.
3113         https://bugs.webkit.org/show_bug.cgi?id=22610
3114         ~5% on the v8-crypto test.
3115
3116         * jit/JIT.cpp:
3117         (JSC::JIT::privateCompileMainPass):
3118         (JSC::JIT::privateCompileSlowCases):
3119
3120 2008-12-02  Geoffrey Garen  <ggaren@apple.com>
3121
3122         Reviewed by Sam Weinig.
3123         
3124         Cleaned up SegmentedVector by abstracting segment access into helper
3125         functions.
3126         
3127         SunSpider reports no change.
3128
3129         * bytecompiler/SegmentedVector.h:
3130         (JSC::SegmentedVector::SegmentedVector):
3131         (JSC::SegmentedVector::~SegmentedVector):
3132         (JSC::SegmentedVector::size):
3133         (JSC::SegmentedVector::at):
3134         (JSC::SegmentedVector::operator[]):
3135         (JSC::SegmentedVector::last):
3136         (JSC::SegmentedVector::append):
3137         (JSC::SegmentedVector::removeLast):
3138         (JSC::SegmentedVector::grow):
3139         (JSC::SegmentedVector::clear):
3140         (JSC::SegmentedVector::deleteAllSegments):
3141         (JSC::SegmentedVector::segmentFor):
3142         (JSC::SegmentedVector::subscriptFor):
3143         (JSC::SegmentedVector::ensureSegmentsFor):
3144         (JSC::SegmentedVector::ensureSegment):
3145
3146 2008-12-02  Geoffrey Garen  <ggaren@apple.com>
3147
3148         Reviewed by Geoffrey Garen. (Patch by Cameron Zwarich <zwarich@apple.com>.)
3149         
3150         Fixed https://bugs.webkit.org/show_bug.cgi?id=22482
3151         REGRESSION (r37991): Occasionally see "Scene rendered incorrectly"
3152         message when running the V8 Raytrace benchmark
3153         
3154         Rolled out r37991. It didn't properly save xmm0, which is caller-save,
3155         before calling helper functions.
3156         
3157         SunSpider and v8 benchmarks show little change -- possibly a .2%
3158         SunSpider regression, possibly a .2% v8 benchmark speedup.
3159
3160         * assembler/X86Assembler.h:
3161         (JSC::X86Assembler::):
3162         * bytecode/CodeBlock.cpp:
3163         (JSC::CodeBlock::dump):
3164         * bytecode/Instruction.h:
3165         (JSC::Instruction::):
3166         * bytecompiler/BytecodeGenerator.cpp:
3167         (JSC::BytecodeGenerator::emitUnaryOp):
3168         * bytecompiler/BytecodeGenerator.h:
3169         (JSC::BytecodeGenerator::emitToJSNumber):
3170         (JSC::BytecodeGenerator::emitTypeOf):
3171         (JSC::BytecodeGenerator::emitGetPropertyNames):
3172         * interpreter/Interpreter.cpp:
3173         (JSC::Interpreter::privateExecute):
3174         * interpreter/Interpreter.h:
3175         * jit/JIT.cpp:
3176         (JSC::JIT::privateCompileMainPass):
3177         (JSC::JIT::privateCompileSlowCases):
3178         * jit/JIT.h:
3179         * parser/Nodes.cpp:
3180         (JSC::UnaryOpNode::emitBytecode):
3181         (JSC::BinaryOpNode::emitBytecode):
3182         (JSC::EqualNode::emitBytecode):
3183         * parser/ResultType.h:
3184         (JSC::ResultType::isReusable):
3185         (JSC::ResultType::mightBeNumber):
3186         * runtime/JSNumberCell.h:
3187
3188 2008-12-01  Gavin Barraclough  <barraclough@apple.com>
3189
3190         Reviewed by Geoffrey Garen.
3191
3192         Remove unused (sampling only, and derivable) argument to JIT::emitCTICall.
3193         https://bugs.webkit.org/show_bug.cgi?id=22587
3194
3195         * jit/JIT.cpp:
3196         (JSC::JIT::emitCTICall):
3197         (JSC::JIT::compileOpCall):
3198         (JSC::JIT::emitSlowScriptCheck):
3199         (JSC::JIT::compileBinaryArithOpSlowCase):
3200         (JSC::JIT::privateCompileMainPass):
3201         (JSC::JIT::privateCompileSlowCases):
3202         (JSC::JIT::privateCompile):
3203         * jit/JIT.h:
3204
3205 2008-12-02  Dimitri Glazkov  <dglazkov@chromium.org>
3206
3207         Reviewed by Eric Seidel.
3208         
3209         Fix the inheritance chain for JSFunction.
3210
3211         * runtime/JSFunction.cpp:
3212         (JSC::JSFunction::info): Add InternalFunction::info as parent class
3213
3214 2008-12-02  Simon Hausmann  <hausmann@webkit.org>
3215
3216         Reviewed by Tor Arne Vestbø.
3217
3218         Fix ability to include JavaScriptCore.pri from other .pro files.
3219
3220         * JavaScriptCore.pri: Moved -O3 setting into the .pro files.
3221         * JavaScriptCore.pro:
3222         * jsc.pro:
3223
3224 2008-12-01  Geoffrey Garen  <ggaren@apple.com>
3225
3226         Reviewed by Cameron Zwarich, with help from Gavin Barraclough.
3227         
3228         Fixed https://bugs.webkit.org/show_bug.cgi?id=22583.
3229
3230         Refactored regular expression parsing to parse sequences of characters
3231         as a single unit, in preparation for optimizing sequences of characters.
3232         
3233         SunSpider reports no change.
3234
3235         * JavaScriptCore.xcodeproj/project.pbxproj:
3236         * wrec/Escapes.h: Added. Set of classes for representing an escaped
3237         token in a pattern.
3238
3239         * wrec/Quantifier.h:
3240         (JSC::WREC::Quantifier::Quantifier): Simplified this constructor slightly,
3241         to match the new Escape constructor.
3242
3243         * wrec/WRECGenerator.cpp:
3244         (JSC::WREC::Generator::generatePatternCharacterSequence):
3245         * wrec/WRECGenerator.h: Added an interface for generating a sequence
3246         of pattern characters at a time. It doesn't do anything special yet.
3247
3248         * wrec/WRECParser.cpp:
3249         (JSC::WREC::Parser::consumeGreedyQuantifier):
3250         (JSC::WREC::Parser::consumeQuantifier): Renamed "parse" to "consume" in
3251         these functions, to match "consumeEscape."
3252
3253         (JSC::WREC::Parser::parsePatternCharacterSequence): New function for
3254         iteratively aggregating a sequence of characters in a pattern.
3255
3256         (JSC::WREC::Parser::parseCharacterClassQuantifier):
3257         (JSC::WREC::Parser::parseBackreferenceQuantifier): Renamed "parse" to
3258         "consume" in these functions, to match "consumeEscape."
3259
3260         (JSC::WREC::Parser::parseCharacterClass): Refactored to use the common
3261         escape processing code in consumeEscape.
3262
3263         (JSC::WREC::Parser::parseEscape): Refactored to use the common
3264         escape processing code in consumeEscape.
3265
3266         (JSC::WREC::Parser::consumeEscape): Factored escaped token processing
3267         into a common function, since we were doing this in a few places.
3268
3269         (JSC::WREC::Parser::parseTerm): Refactored to use the common
3270         escape processing code in consumeEscape.
3271
3272         * wrec/WRECParser.h:
3273         (JSC::WREC::Parser::consumeOctal): Refactored to use a helper function
3274         for reading a digit.
3275
3276 2008-12-01  Cameron Zwarich  <zwarich@apple.com>
3277
3278         Reviewed by Oliver Hunt.
3279
3280         Bug 20340: SegmentedVector segment allocations can lead to unsafe use of temporary registers
3281         <https://bugs.webkit.org/show_bug.cgi?id=20340>
3282
3283         SegmentedVector currently frees segments and reallocates them when used
3284         as a stack. This can lead to unsafe use of pointers into freed segments.
3285
3286         In order to fix this problem, SegmentedVector will be changed to only
3287         grow and never shrink. Also, rename the reserveCapacity() member
3288         function to grow() to match the actual usage in BytecodeGenerator, where
3289         this function is used to allocate a group of registers at once, rather
3290         than merely saving space for them.
3291
3292         * bytecompiler/BytecodeGenerator.cpp:
3293         (JSC::BytecodeGenerator::BytecodeGenerator): Use grow() instead of 
3294         reserveCapacity().
3295         * bytecompiler/SegmentedVector.h:
3296         (JSC::SegmentedVector::SegmentedVector):
3297         (JSC::SegmentedVector::last):
3298         (JSC::SegmentedVector::append):
3299         (JSC::SegmentedVector::removeLast):
3300         (JSC::SegmentedVector::grow): Renamed from reserveCapacity().
3301         (JSC::SegmentedVector::clear):
3302
3303 2008-12-01  Mark Rowe  <mrowe@apple.com>
3304
3305         Rubber-stamped by Anders Carlsson.
3306
3307         Disable WREC for x86_64 since memory allocated by the system allocator is not marked executable,
3308         which causes 64-bit debug builds to crash.  Once we have a dedicated allocator for executable
3309         memory we can turn this back on.
3310
3311         * wtf/Platform.h:
3312
3313 2008-12-01  Antti Koivisto  <antti@apple.com>
3314
3315         Reviewed by Maciej Stachowiak.
3316         
3317         Restore inline buffer after vector is shrunk back below its inline capacity.
3318
3319         * wtf/Vector.h:
3320         (WTF::):
3321         (WTF::VectorBuffer::restoreInlineBufferIfNeeded):
3322         (WTF::::shrinkCapacity):
3323
3324 2008-11-30  Antti Koivisto  <antti@apple.com>
3325
3326         Reviewed by Mark Rowe.
3327         
3328         Try to return free pages in the current thread cache too.
3329
3330         * wtf/FastMalloc.cpp:
3331         (WTF::TCMallocStats::releaseFastMallocFreeMemory):
3332
3333 2008-12-01  David Levin  <levin@chromium.org>
3334
3335         Reviewed by Alexey Proskuryakov.
3336
3337         https://bugs.webkit.org/show_bug.cgi?id=22567
3338         Make HashTable work as expected with respect to threads. Specifically, it has class-level
3339         thread safety and constant methods work on constant objects without synchronization.
3340         
3341         No observable change in behavior, so no test. This only affects debug builds.
3342
3343         * wtf/HashTable.cpp:
3344         (WTF::hashTableStatsMutex):
3345         (WTF::HashTableStats::~HashTableStats):
3346         (WTF::HashTableStats::recordCollisionAtCount):
3347         Guarded variable access with a mutex.
3348
3349         * wtf/HashTable.h:
3350         (WTF::::lookup):
3351         (WTF::::lookupForWriting):
3352         (WTF::::fullLookupForWriting):
3353         (WTF::::add):
3354         (WTF::::reinsert):
3355         (WTF::::remove):
3356         (WTF::::rehash):
3357         Changed increments of static variables to use atomicIncrement.
3358
3359         (WTF::::invalidateIterators):
3360         (WTF::addIterator):
3361         (WTF::removeIterator):
3362         Guarded mutable access with a mutex.
3363
3364 2008-11-29  Gavin Barraclough  <barraclough@apple.com>
3365
3366         Reviewed by Cameron Zwarich.
3367
3368         Enable WREC on PLATFORM(X86_64).  This change predominantly requires changes to the
3369         WREC::Generator::generateEnter method to support the x86-64 ABI, and addition of
3370         support for a limited number of quadword operations in the X86Assembler.
3371
3372         This patch will cause the JS heap to be allocated with RWX permissions on 64-bit Mac
3373         platforms.  This is a regression with respect to previous 64-bit behaviour, but is no
3374         more permissive than on 32-bit builds.  This issue should be addressed at some point.
3375         (This is tracked by bug #21783.)
3376
3377         https://bugs.webkit.org/show_bug.cgi?id=22554
3378         Greater than 4x speedup on regexp-dna, on x86-64.
3379
3380         * assembler/MacroAssembler.h:
3381         (JSC::MacroAssembler::addPtr):
3382         (JSC::MacroAssembler::loadPtr):
3383         (JSC::MacroAssembler::storePtr):
3384         (JSC::MacroAssembler::pop):
3385         (JSC::MacroAssembler::push):
3386         (JSC::MacroAssembler::move):
3387         * assembler/X86Assembler.h:
3388         (JSC::X86Assembler::):
3389         (JSC::X86Assembler::movq_rr):
3390         (JSC::X86Assembler::addl_i8m):
3391         (JSC::X86Assembler::addl_i32r):
3392         (JSC::X86Assembler::addq_i8r):
3393         (JSC::X86Assembler::addq_i32r):
3394         (JSC::X86Assembler::movq_mr):
3395         (JSC::X86Assembler::movq_rm):
3396         * wrec/WREC.h:
3397         * wrec/WRECGenerator.cpp:
3398         (JSC::WREC::Generator::generateEnter):
3399         (JSC::WREC::Generator::generateReturnSuccess):
3400         (JSC::WREC::Generator::generateReturnFailure):
3401         * wtf/Platform.h:
3402         * wtf/TCSystemAlloc.cpp:
3403
3404 2008-12-01  Cameron Zwarich  <zwarich@apple.com>
3405
3406         Reviewed by Sam Weinig.
3407
3408         Preliminary work for bug 20340: SegmentedVector segment allocations can lead to unsafe use of temporary registers
3409         <https://bugs.webkit.org/show_bug.cgi?id=20340>
3410
3411         SegmentedVector currently frees segments and reallocates them when used
3412         as a stack. This can lead to unsafe use of pointers into freed segments.
3413
3414         In order to fix this problem, SegmentedVector will be changed to only
3415         grow and never shrink, with the sole exception of clearing all of its
3416         data, a capability that is required by Lexer. This patch changes the
3417         public interface to only allow for these capabilities.
3418
3419         * bytecompiler/BytecodeGenerator.cpp:
3420         (JSC::BytecodeGenerator::BytecodeGenerator): Use reserveCapacity()
3421         instead of resize() for m_globals and m_parameters.
3422         * bytecompiler/SegmentedVector.h:
3423         (JSC::SegmentedVector::resize): Removed.
3424         (JSC::SegmentedVector::reserveCapacity): Added.
3425         (JSC::SegmentedVector::clear): Added.
3426         (JSC::SegmentedVector::shrink): Removed.
3427         (JSC::SegmentedVector::grow): Removed.
3428         * parser/Lexer.cpp:
3429         (JSC::Lexer::clear): Use clear() instead of resize(0).
3430
3431 2008-11-30  Sam Weinig  <sam@webkit.org>
3432
3433         Reviewed by Mark Rowe.
3434
3435         Renames jumps to m_jumps in JumpList.
3436
3437         * assembler/MacroAssembler.h:
3438         (JSC::MacroAssembler::JumpList::link):
3439         (JSC::MacroAssembler::JumpList::linkTo):
3440         (JSC::MacroAssembler::JumpList::append):
3441
3442 2008-11-30  Antti Koivisto  <antti@apple.com>
3443
3444         Reviewed by Mark Rowe.
3445         
3446         https://bugs.webkit.org/show_bug.cgi?id=22557
3447         
3448         Report free size in central and thread caches too.
3449
3450         * wtf/FastMalloc.cpp:
3451         (WTF::TCMallocStats::fastMallocStatistics):
3452         * wtf/FastMalloc.h:
3453
3454 2008-11-29  Antti Koivisto  <antti@apple.com>
3455
3456         Reviewed by Dan Bernstein.
3457         
3458         https://bugs.webkit.org/show_bug.cgi?id=22557
3459         Add statistics for JavaScript GC heap.
3460
3461         * JavaScriptCore.exp:
3462         * runtime/Collector.cpp:
3463         (JSC::Heap::objectCount):
3464         (JSC::addToStatistics):
3465         (JSC::Heap::statistics):
3466         * runtime/Collector.h:
3467
3468 2008-11-29  Antti Koivisto  <antti@apple.com>
3469
3470         Fix debug build by adding a stub method.
3471
3472         * wtf/FastMalloc.cpp:
3473         (WTF::fastMallocStatistics):
3474
3475 2008-11-29  Antti Koivisto  <antti@apple.com>
3476
3477         Reviewed by Alexey Proskuryakov.
3478         
3479         https://bugs.webkit.org/show_bug.cgi?id=22557
3480         
3481         Add function for getting basic statistics from FastMalloc.
3482
3483         * JavaScriptCore.exp:
3484         * wtf/FastMalloc.cpp:
3485         (WTF::DLL_Length):
3486         (WTF::TCMalloc_PageHeap::ReturnedBytes):
3487         (WTF::TCMallocStats::fastMallocStatistics):
3488         * wtf/FastMalloc.h:
3489
3490 2008-11-29  Cameron Zwarich  <zwarich@apple.com>
3491
3492         Not reviewed.
3493
3494         The C++ standard does not automatically grant the friendships of an
3495         enclosing class to its nested subclasses, so we should do so explicitly.
3496         This fixes the GCC 4.0 build, although both GCC 4.2 and Visual C++ 2005
3497         accept the incorrect code as it is.
3498
3499         * assembler/MacroAssembler.h:
3500
3501 2008-11-29  Gavin Barraclough  <barraclough@apple.com>
3502
3503         Reviewed by Cameron Zwarich.
3504
3505         Add the class MacroAssembler to provide some abstraction of code generation,
3506         and change WREC to make use of this class, rather than directly accessing
3507         the X86Assembler.
3508
3509         This patch also allows WREC to be compiled without the rest of the JIT enabled.
3510
3511         * JavaScriptCore.xcodeproj/project.pbxproj:
3512         * assembler/MacroAssembler.h: Added.
3513         (JSC::MacroAssembler::):
3514         (JSC::MacroAssembler::MacroAssembler):
3515         (JSC::MacroAssembler::copyCode):
3516         (JSC::MacroAssembler::Address::Address):
3517         (JSC::MacroAssembler::ImplicitAddress::ImplicitAddress):
3518         (JSC::MacroAssembler::BaseIndex::BaseIndex):
3519         (JSC::MacroAssembler::Label::Label):
3520         (JSC::MacroAssembler::Jump::Jump):
3521         (JSC::MacroAssembler::Jump::link):
3522         (JSC::MacroAssembler::Jump::linkTo):
3523         (JSC::MacroAssembler::JumpList::link):
3524         (JSC::MacroAssembler::JumpList::linkTo):
3525         (JSC::MacroAssembler::JumpList::append):
3526         (JSC::MacroAssembler::Imm32::Imm32):
3527         (JSC::MacroAssembler::add32):
3528         (JSC::MacroAssembler::or32):
3529         (JSC::MacroAssembler::sub32):
3530         (JSC::MacroAssembler::loadPtr):
3531         (JSC::MacroAssembler::load32):
3532         (JSC::MacroAssembler::load16):
3533         (JSC::MacroAssembler::storePtr):
3534         (JSC::MacroAssembler::store32):
3535         (JSC::MacroAssembler::pop):
3536         (JSC::MacroAssembler::push):
3537         (JSC::MacroAssembler::peek):
3538         (JSC::MacroAssembler::poke):
3539         (JSC::MacroAssembler::move):
3540         (JSC::MacroAssembler::compareImm32ForBranch):
3541         (JSC::MacroAssembler::compareImm32ForBranchEquality):
3542         (JSC::MacroAssembler::jae32):
3543         (JSC::MacroAssembler::je32):
3544         (JSC::MacroAssembler::je16):
3545         (JSC::MacroAssembler::jg32):
3546         (JSC::MacroAssembler::jge32):
3547         (JSC::MacroAssembler::jl32):
3548         (JSC::MacroAssembler::jle32):
3549         (JSC::MacroAssembler::jne32):
3550         (JSC::MacroAssembler::jump):
3551         (JSC::MacroAssembler::breakpoint):
3552         (JSC::MacroAssembler::ret):
3553         * assembler/X86Assembler.h:
3554         (JSC::X86Assembler::cmpw_rm):
3555         * interpreter/Interpreter.cpp:
3556         (JSC::Interpreter::Interpreter):
3557         * interpreter/Interpreter.h:
3558         (JSC::Interpreter::assemblerBuffer):
3559         * runtime/RegExp.cpp:
3560         (JSC::RegExp::RegExp):
3561         * wrec/WREC.cpp:
3562         (JSC::WREC::Generator::compileRegExp):
3563         * wrec/WREC.h:
3564         * wrec/WRECFunctors.cpp:
3565         (JSC::WREC::GeneratePatternCharacterFunctor::generateAtom):
3566         (JSC::WREC::GenerateCharacterClassFunctor::generateAtom):
3567         (JSC::WREC::GenerateBackreferenceFunctor::generateAtom):
3568         (JSC::WREC::GenerateParenthesesNonGreedyFunctor::generateAtom):
3569         * wrec/WRECFunctors.h:
3570         (JSC::WREC::GenerateParenthesesNonGreedyFunctor::GenerateParenthesesNonGreedyFunctor):
3571         * wrec/WRECGenerator.cpp:
3572         (JSC::WREC::Generator::generateEnter):
3573         (JSC::WREC::Generator::generateReturnSuccess):
3574         (JSC::WREC::Generator::generateSaveIndex):
3575         (JSC::WREC::Generator::generateIncrementIndex):
3576         (JSC::WREC::Generator::generateLoadCharacter):
3577         (JSC::WREC::Generator::generateJumpIfEndOfInput):
3578         (JSC::WREC::Generator::generateJumpIfNotEndOfInput):
3579         (JSC::WREC::Generator::generateReturnFailure):
3580         (JSC::WREC::Generator::generateBacktrack1):
3581         (JSC::WREC::Generator::generateBacktrackBackreference):
3582         (JSC::WREC::Generator::generateBackreferenceQuantifier):
3583         (JSC::WREC::Generator::generateNonGreedyQuantifier):
3584         (JSC::WREC::Generator::generateGreedyQuantifier):
3585         (JSC::WREC::Generator::generatePatternCharacter):
3586         (JSC::WREC::Generator::generateCharacterClassInvertedRange):
3587         (JSC::WREC::Generator::generateCharacterClassInverted):
3588         (JSC::WREC::Generator::generateCharacterClass):
3589         (JSC::WREC::Generator::generateParentheses):
3590         (JSC::WREC::Generator::generateParenthesesNonGreedy):
3591         (JSC::WREC::Generator::generateParenthesesResetTrampoline):
3592         (JSC::WREC::Generator::generateAssertionBOL):
3593         (JSC::WREC::Generator::generateAssertionEOL):
3594         (JSC::WREC::Generator::generateAssertionWordBoundary):
3595         (JSC::WREC::Generator::generateBackreference):
3596         (JSC::WREC::Generator::terminateAlternative):
3597         (JSC::WREC::Generator::terminateDisjunction):
3598         * wrec/WRECGenerator.h:
3599         (JSC::WREC::Generator::Generator):
3600         * wrec/WRECParser.cpp:
3601         (JSC::WREC::Parser::parsePatternCharacterQualifier):
3602         (JSC::WREC::Parser::parseCharacterClassQuantifier):
3603         (JSC::WREC::Parser::parseBackreferenceQuantifier):
3604         (JSC::WREC::Parser::parseParentheses):
3605         (JSC::WREC::Parser::parseCharacterClass):
3606         (JSC::WREC::Parser::parseOctalEscape):
3607         (JSC::WREC::Parser::parseEscape):
3608         (JSC::WREC::Parser::parseTerm):
3609         (JSC::WREC::Parser::parseDisjunction):
3610         * wrec/WRECParser.h:
3611         (JSC::WREC::Parser::Parser):
3612         (JSC::WREC::Parser::parsePattern):
3613         (JSC::WREC::Parser::parseAlternative):
3614         * wtf/Platform.h:
3615
3616 2008-11-28  Simon Hausmann  <hausmann@webkit.org>
3617
3618         Reviewed by Tor Arne Vestbø.
3619
3620         Fix compilation on Windows CE
3621
3622         Port away from the use of errno after calling strtol(), instead
3623         detect conversion errors by checking the result and the stop
3624         position.
3625
3626         * runtime/DateMath.cpp:
3627         (JSC::parseLong):
3628         (JSC::parseDate):
3629
3630 2008-11-28  Joerg Bornemann  <joerg.bornemann@trolltech.com>
3631
3632         Reviewed by Simon Hausmann.
3633
3634         Implement lowResUTCTime() on Windows CE using GetSystemTime as _ftime() is not available.
3635
3636         * runtime/DateMath.cpp:
3637         (JSC::lowResUTCTime):
3638
3639 2008-11-28  Simon Hausmann  <hausmann@webkit.org>
3640
3641         Rubber-stamped by Tor Arne Vestbø.
3642
3643         Removed unnecessary inclusion of errno.h, which also fixes compilation on Windows CE.
3644
3645         * runtime/JSGlobalObjectFunctions.cpp:
3646
3647 2008-11-27  Cameron Zwarich  <zwarich@apple.com>
3648
3649         Not reviewed.
3650
3651         r38825 made JSFunction::m_body private, but some inspector code in
3652         WebCore sets the field. Add setters for it.
3653
3654         * runtime/JSFunction.h:
3655         (JSC::JSFunction::setBody):
3656
3657 2008-11-27  Sam Weinig  <sam@webkit.org>
3658
3659         Reviewed by Cameron Zwarich.
3660
3661         Fix FIXME by adding accessor for JSFunction's m_body property.
3662
3663         * interpreter/Interpreter.cpp:
3664         (JSC::Interpreter::cti_op_call_JSFunction):
3665         (JSC::Interpreter::cti_vm_dontLazyLinkCall):
3666         (JSC::Interpreter::cti_vm_lazyLinkCall):
3667         * profiler/Profiler.cpp:
3668         (JSC::createCallIdentifierFromFunctionImp):
3669         * runtime/Arguments.h:
3670         (JSC::Arguments::getArgumentsData):
3671         (JSC::Arguments::Arguments):
3672         * runtime/FunctionPrototype.cpp:
3673         (JSC::functionProtoFuncToString):
3674         * runtime/JSFunction.h:
3675         (JSC::JSFunction::JSFunction):
3676         (JSC::JSFunction::body):
3677
3678 2008-11-27  Sam Weinig  <sam@webkit.org>
3679
3680         Reviewed by Oliver Hunt.
3681
3682         Remove unused member variables from ProgramNode.
3683
3684         * parser/Nodes.h:
3685
3686 2008-11-27  Brent Fulgham  <bfulgham@gmail.com>
3687
3688         Reviewed by Alexey Proskuryakov.
3689
3690         Enable mouse panning feaure on Windows Cairo build.
3691         See http://bugs.webkit.org/show_bug.cgi?id=22525
3692
3693         * wtf/Platform.h: Enable mouse panning feaure on Windows Cairo build.
3694
3695 2008-11-27  Alp Toker  <alp@nuanti.com>
3696
3697         Change recently introduced C++ comments in Platform.h to C comments to
3698         fix the minidom build with traditional C.
3699
3700         Build GtkLauncher and minidom with the '-ansi' compiler flag to detect
3701         API header breakage at build time.
3702
3703         * GNUmakefile.am:
3704         * wtf/Platform.h:
3705
3706 2008-11-27  Alp Toker  <alp@nuanti.com>
3707
3708         Remove C++ comment from JavaScriptCore API headers (introduced r35449).
3709         Fixes build for ANSI C applications using the public API.
3710
3711         * API/WebKitAvailability.h:
3712
3713 2008-11-26  Eric Seidel  <eric@webkit.org>
3714
3715         No review, build fix only.
3716
3717         Fix the JSC Chromium Mac build by adding JavaScriptCore/icu into the include path
3718
3719         * JavaScriptCore.scons:
3720
3721 2008-11-25  Cameron Zwarich  <zwarich@apple.com>
3722
3723         Reviewed by Maciej Stachowiak.
3724
3725         Remove the unused member function JSFunction::getParameterName().
3726
3727         * runtime/JSFunction.cpp:
3728         * runtime/JSFunction.h:
3729
3730 2008-11-24  Gavin Barraclough  <barraclough@apple.com>
3731
3732         Reviewed by Geoff Garen.
3733
3734         Polymorpic caching for get by id chain.  Similar to the polymorphic caching already implemented
3735         for self and proto accesses (implemented by allowing multiple trampolines to be JIT genertaed,
3736         and linked together) - the get by id chain caching is implemented as a genericization of the
3737         proto list caching, allowing cached access lists to contain a mix of proto and proto chain
3738         accesses (since in JS style inheritance hierarchies you may commonly see a mix of properties
3739         being overridden on the direct prototype, or higher up its prototype chain).
3740
3741         In order to allow this patch to compile there is a fix to appease gcc 4.2 compiler issues
3742         (removing the jumps between fall-through cases in privateExecute).
3743         
3744         This patch also removes redundant immediate checking from the reptach code, and fixes a related
3745         memory leak (failure to deallocate trampolines). 
3746
3747         ~2% progression on v8 tests (bulk on the win on deltablue)
3748
3749         * bytecode/Instruction.h:
3750         (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::):
3751         (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::set):
3752         (JSC::PolymorphicAccessStructureList::PolymorphicAccessStructureList):
3753         (JSC::PolymorphicAccessStructureList::derefStructures):
3754         * interpreter/Interpreter.cpp:
3755         (JSC::countPrototypeChainEntriesAndCheckForProxies):
3756         (JSC::Interpreter::tryCacheGetByID):
3757         (JSC::Interpreter::privateExecute):
3758         (JSC::Interpreter::tryCTICacheGetByID):
3759         (JSC::Interpreter::cti_op_get_by_id_self_fail):
3760         (JSC::getPolymorphicAccessStructureListSlot):
3761         (JSC::Interpreter::cti_op_get_by_id_proto_list):
3762         * interpreter/Interpreter.h:
3763         * jit/JIT.cpp:
3764         (JSC::JIT::privateCompileGetByIdProto):
3765         (JSC::JIT::privateCompileGetByIdSelfList):
3766         (JSC::JIT::privateCompileGetByIdProtoList):
3767         (JSC::JIT::privateCompileGetByIdChainList):
3768         (JSC::JIT::privateCompileGetByIdChain):
3769         (JSC::JIT::privateCompilePatchGetArrayLength):
3770         * jit/JIT.h:
3771         (JSC::JIT::compileGetByIdChainList):
3772
3773 2008-11-25  Cameron Zwarich  <zwarich@apple.com>
3774
3775         Reviewed by Alexey Proskuryakov.
3776
3777         Move the collect() call in Heap::heapAllocate() that is conditionally
3778         compiled under COLLECT_ON_EVERY_ALLOCATION so that it is before we get
3779         information about the heap. This was causing assertion failures for me
3780         while I was reducing a bug.
3781
3782         * runtime/Collector.cpp:
3783         (JSC::Heap::heapAllocate):
3784
3785 2008-11-24  Cameron Zwarich  <zwarich@apple.com>
3786
3787         Reviewed by Geoff Garen.
3788
3789         Bug 13790: Function declarations are not treated as statements (used to affect starcraft2.com)
3790         <https://bugs.webkit.org/show_bug.cgi?id=13790>
3791
3792         Modify the parser to treat function declarations as statements,
3793         simplifying the grammar in the process. Technically, according to the
3794         grammar in the ECMA spec, function declarations are not statements and
3795         can not be used everywhere that statements can, but it is not worth the
3796         possibility compatibility issues just to stick to the spec in this case.
3797
3798         * parser/Grammar.y:
3799         * parser/Nodes.cpp:
3800         (JSC::FuncDeclNode::emitBytecode): Avoid returning ignoredResult()
3801         as a result, because it causes a crash in DoWhileNode::emitBytecode().
3802
3803 2008-11-24  Geoffrey Garen  <ggaren@apple.com>
3804
3805         Reviewed by Sam Weinig.
3806         
3807         Unroll the regexp matching loop by 1. 10% speedup on simple matching
3808         stress test. No change on SunSpider.
3809         
3810         (I decided not to unroll to arbitrary levels because the returns diminsh
3811         quickly.)
3812
3813         * wrec/WREC.cpp:
3814         (JSC::WREC::compileRegExp):
3815         * wrec/WRECGenerator.cpp:
3816         (JSC::WREC::Generator::generateJumpIfEndOfInput):
3817         (JSC::WREC::Generator::generateJumpIfNotEndOfInput):
3818         * wrec/WRECGenerator.h:
3819         * wrec/WRECParser.h:
3820         (JSC::WREC::Parser::error):
3821         (JSC::WREC::Parser::parsePattern):
3822
3823 2008-11-24  Geoffrey Garen  <ggaren@apple.com>
3824
3825         Reviewed by Sam Weinig.
3826         
3827         Removed some unnecessary "Generator::" prefixes.
3828
3829         * wrec/WRECGenerator.cpp:
3830         (JSC::WREC::Generator::generateEnter):
3831         (JSC::WREC::Generator::generateReturnSuccess):
3832         (JSC::WREC::Generator::generateSaveIndex):
3833         (JSC::WREC::Generator::generateIncrementIndex):
3834         (JSC::WREC::Generator::generateLoopIfNotEndOfInput):
3835         (JSC::WREC::Generator::generateReturnFailure):
3836
3837 2008-11-24  Geoffrey Garen  <ggaren@apple.com>
3838
3839         Reviewed by Sam Weinig.
3840         
3841         Made a bunch of WREC::Parser functions private, and added an explicit
3842         "reset()" function, so a parser can be reused.
3843
3844         * wrec/WRECParser.h:
3845         (JSC::WREC::Parser::Parser):
3846         (JSC::WREC::Parser::generator):
3847         (JSC::WREC::Parser::ignoreCase):
3848         (JSC::WREC::Parser::multiline):
3849         (JSC::WREC::Parser::recordSubpattern):
3850         (JSC::WREC::Parser::numSubpatterns):
3851         (JSC::WREC::Parser::parsePattern):
3852         (JSC::WREC::Parser::parseAlternative):
3853         (JSC::WREC::Parser::reset):
3854
3855 2008-11-24  Gavin Barraclough  <barraclough@apple.com>
3856
3857         Reviewed by Cameron Zwarich.
3858
3859         Implement repatching for get by id chain.
3860         Previously the access is performed in a function stub, in the repatch form
3861         the trampoline is not called to; instead the hot path is relinked to jump
3862         directly to the trampoline, if it fails it will jump to the slow case.
3863
3864         https://bugs.webkit.org/show_bug.cgi?id=22449
3865         3% progression on deltablue.
3866
3867         * jit/JIT.cpp:
3868         (JSC::JIT::privateCompileGetByIdProto):
3869         (JSC::JIT::privateCompileGetByIdChain):
3870
3871 2008-11-24  Joerg Bornemann  <joerg.bornemann@trolltech.com>
3872
3873         Reviewed by Simon Hausmann.
3874
3875         https://bugs.webkit.org/show_bug.cgi?id=20746
3876
3877         Various small compilation fixes to make the Qt port of WebKit
3878         compile on Windows CE.
3879
3880         * config.h: Don't set _CRT_RAND_S for CE, it's not available.
3881         * jsc.cpp: Disabled use of debugger includes for CE. It
3882           does not have the debugging functions.
3883         * runtime/DateMath.cpp: Use localtime() on Windows CE.
3884         * wtf/Assertions.cpp: Compile on Windows CE without debugger.
3885         * wtf/Assertions.h: Include windows.h before defining ASSERT.
3886         * wtf/MathExtras.h: Include stdlib.h instead of xmath.h.
3887         * wtf/Platform.h: Disable ERRNO_H and detect endianess based
3888           on the Qt endianess. On Qt for Windows CE the endianess is
3889           defined by the vendor specific build spec.
3890         * wtf/Threading.h: Use the volatile-less atomic functions.
3891         * wtf/dtoa.cpp: Compile without errno.
3892         * wtf/win/MainThreadWin.cpp: Don't include windows.h on CE after
3893         Assertions.h due to the redefinition of ASSERT.
3894
3895 2008-11-22  Gavin Barraclough  <barraclough@apple.com>
3896
3897         Reviewed by Cameron Zwarich.
3898
3899         Replace accidentally deleted immediate check from get by id chain trampoline.
3900         https://bugs.webkit.org/show_bug.cgi?id=22413
3901
3902         * jit/JIT.cpp:
3903         (JSC::JIT::privateCompileGetByIdChain):
3904
3905 2008-11-21  Gavin Barraclough  <barraclough@apple.com>
3906
3907         Reviewed by Oliver Hunt.
3908
3909         Add (really) polymorphic caching for get by id self.
3910         Very similar to caching of prototype accesses, described below.
3911
3912         Oh, also, probably shouldn't have been leaking those structure list objects.
3913         
3914         4% preogression on deltablue.
3915
3916         * bytecode/CodeBlock.cpp:
3917         (JSC::CodeBlock::dump):
3918         (JSC::CodeBlock::derefStructures):
3919         (JSC::PrototypeStructureList::derefStructures):
3920         * bytecode/Instruction.h:
3921         * bytecode/Opcode.h:
3922         * interpreter/Interpreter.cpp:
3923         (JSC::Interpreter::privateExecute):
3924         (JSC::Interpreter::cti_op_get_by_id_self_fail):
3925         * jit/JIT.cpp:
3926         (JSC::JIT::privateCompileMainPass):
3927         (JSC::JIT::privateCompileGetByIdSelfList):
3928         (JSC::JIT::patchGetByIdSelf):
3929         * jit/JIT.h:
3930         (JSC::JIT::compileGetByIdSelfList):
3931
3932 2008-11-21  Geoffrey Garen  <ggaren@apple.com>
3933
3934         Reviewed by Sam Weinig.
3935         
3936         Fixed many crashes seen 'round the world (but only in release builds).
3937         
3938         Update outputParameter offset to reflect slight re-ordering of push
3939         instructions in r38669.
3940
3941         * wrec/WRECGenerator.cpp:
3942
3943 2008-11-21  Geoffrey Garen  <ggaren@apple.com>
3944
3945         Reviewed by Sam Weinig.
3946         
3947         A little more RegExp refactoring.
3948         
3949         Deployed a helper function for reading the next character. Used the "link
3950         vector of jumps" helper in a place I missed before.
3951
3952         * wrec/WRECGenerator.cpp:
3953         (JSC::WREC::Generator::generateLoadCharacter):
3954         (JSC::WREC::Generator::generatePatternCharacter):
3955         (JSC::WREC::Generator::generateCharacterClass):
3956         (JSC::WREC::Generator::generateAssertionEOL):
3957         (JSC::WREC::Generator::generateAssertionWordBoundary):
3958         * wrec/WRECGenerator.h:
3959
3960 2008-11-21  Alexey Proskuryakov  <ap@webkit.org>
3961
3962         Reviewed by Dan Bernstein.
3963
3964         https://bugs.webkit.org/show_bug.cgi?id=22402
3965         Replace abort() with CRASH()
3966
3967         * wtf/Assertions.h: Added a different method to crash, which should work even is 0xbbadbeef
3968         is a valid memory address.
3969
3970         * runtime/Collector.cpp:
3971         * wtf/FastMalloc.cpp:
3972         * wtf/FastMalloc.h:
3973         * wtf/TCSpinLock.h:
3974         Replace abort() with CRASH().
3975
3976 2008-11-21  Alexey Proskuryakov  <ap@webkit.org>
3977
3978         Reverted fix for bug 22042 (Replace abort() with CRASH()), because it was breaking
3979         FOR_EACH_OPCODE_ID macro somehow, making Safari crash.
3980
3981         * runtime/Collector.cpp:
3982         (JSC::Heap::heapAllocate):
3983         (JSC::Heap::collect):
3984         * wtf/Assertions.h:
3985         * wtf/FastMalloc.cpp:
3986         (WTF::fastMalloc):
3987         (WTF::fastCalloc):
3988         (WTF::fastRealloc):
3989         (WTF::InitSizeClasses):
3990         (WTF::PageHeapAllocator::New):
3991         (WTF::TCMallocStats::do_malloc):
3992         * wtf/FastMalloc.h:
3993         * wtf/TCSpinLock.h:
3994         (TCMalloc_SpinLock::Init):
3995         (TCMalloc_SpinLock::Finalize):
3996         (TCMalloc_SpinLock::Lock):
3997         (TCMalloc_SpinLock::Unlock):
3998
3999 2008-11-21  Geoffrey Garen  <ggaren@apple.com>
4000
4001         Reviewed by Sam Weinig.
4002         
4003         A little more RegExp refactoring.
4004         
4005         Moved all assembly from WREC.cpp into WRECGenerator helper functions.
4006         This should help with portability and readability.
4007         
4008         Removed ASSERTs after calls to executableCopy(), and changed
4009         executableCopy() to ASSERT instead.
4010
4011         * assembler/X86Assembler.h:
4012         (JSC::X86Assembler::executableCopy):
4013         * jit/JIT.cpp:
4014         (JSC::JIT::privateCompile):
4015         (JSC::JIT::privateCompileGetByIdSelf):
4016         (JSC::JIT::privateCompileGetByIdProto):
4017         (JSC::JIT::privateCompileGetByIdChain):
4018         (JSC::JIT::privateCompilePutByIdReplace):
4019         (JSC::JIT::privateCompilePutByIdTransition):
4020         (JSC::JIT::privateCompileCTIMachineTrampolines):
4021         (JSC::JIT::privateCompilePatchGetArrayLength):
4022         * wrec/WREC.cpp:
4023         (JSC::WREC::compileRegExp):
4024         * wrec/WRECGenerator.cpp:
4025         (JSC::WREC::Generator::generateEnter):
4026         (JSC::WREC::Generator::generateReturnSuccess):
4027         (JSC::WREC::Generator::generateSaveIndex):
4028         (JSC::WREC::Generator::generateIncrementIndex):
4029         (JSC::WREC::Generator::generateLoopIfNotEndOfInput):
4030         (JSC::WREC::Generator::generateReturnFailure):
4031         * wrec/WRECGenerator.h:
4032         * wrec/WRECParser.h:
4033         (JSC::WREC::Parser::ignoreCase):
4034         (JSC::WREC::Parser::generator):
4035
4036 2008-11-21  Alexey Proskuryakov  <ap@webkit.org>
4037
4038         Build fix.
4039
4040         * wtf/Assertions.h: Use ::abort for C++ code.
4041
4042 2008-11-21  Alexey Proskuryakov  <ap@webkit.org>
4043
4044         Reviewed by Sam Weinig.
4045
4046         https://bugs.webkit.org/show_bug.cgi?id=22402
4047         Replace abort() with CRASH()
4048
4049         * wtf/Assertions.h: Added abort() after an attempt to crash for extra safety.
4050
4051         * runtime/Collector.cpp:
4052         * wtf/FastMalloc.cpp:
4053         * wtf/FastMalloc.h:
4054         * wtf/TCSpinLock.h:
4055         Replace abort() with CRASH().
4056
4057 2008-11-21  Geoffrey Garen  <ggaren@apple.com>
4058
4059         Reviewed by Sam Weinig.
4060         
4061         Renamed wrec => generator.
4062
4063         * wrec/WRECFunctors.cpp:
4064         (JSC::WREC::GeneratePatternCharacterFunctor::generateAtom):
4065         (JSC::WREC::GeneratePatternCharacterFunctor::backtrack):
4066         (JSC::WREC::GenerateCharacterClassFunctor::generateAtom):
4067         (JSC::WREC::GenerateCharacterClassFunctor::backtrack):
4068         (JSC::WREC::GenerateBackreferenceFunctor::generateAtom):
4069         (JSC::WREC::GenerateBackreferenceFunctor::backtrack):
4070         (JSC::WREC::GenerateParenthesesNonGreedyFunctor::generateAtom):
4071
4072 2008-11-19  Gavin Barraclough  <barraclough@apple.com>
4073
4074         Reviewed by Darin Adler.
4075
4076         Add support for (really) polymorphic caching of prototype accesses.
4077         
4078         If a cached prototype access misses, cti_op_get_by_id_proto_list is called.
4079         When this occurs the Structure pointers from the instruction stream are copied
4080         off into a new ProtoStubInfo object.  A second prototype access trampoline is
4081         generated, and chained onto the first.  Subsequent missed call to
4082         cti_op_get_by_id_proto_list_append, which append futher new trampolines, up to
4083         PROTOTYPE_LIST_CACHE_SIZE (currently 4).  If any of the misses result in an
4084         access other than to a direct prototype property, list formation is halted (or
4085         for the initial miss, does not take place at all).
4086
4087         Separate fail case functions are provided for each access since this contributes
4088         to the performance progression (enables better processor branch prediction).
4089
4090         Overall this is a near 5% progression on v8, with around 10% wins on richards
4091         and deltablue.
4092
4093         * bytecode/CodeBlock.cpp:
4094         (JSC::CodeBlock::dump):
4095         (JSC::CodeBlock::derefStructures):
4096         * bytecode/Instruction.h:
4097         (JSC::ProtoStructureList::ProtoStubInfo::set):
4098         (JSC::ProtoStructureList::ProtoStructureList):
4099         (JSC::Instruction::Instruction):
4100         (JSC::Instruction::):
4101         * bytecode/Opcode.h:
4102         * interpreter/Interpreter.cpp:
4103         (JSC::Interpreter::privateExecute):
4104         (JSC::Interpreter::tryCTICacheGetByID):
4105         (JSC::Interpreter::cti_op_put_by_id_fail):
4106         (JSC::Interpreter::cti_op_get_by_id_self_fail):
4107         (JSC::Interpreter::cti_op_get_by_id_proto_list):
4108         (JSC::Interpreter::cti_op_get_by_id_proto_list_append):
4109         (JSC::Interpreter::cti_op_get_by_id_proto_list_full):
4110         (JSC::Interpreter::cti_op_get_by_id_proto_fail):
4111         (JSC::Interpreter::cti_op_get_by_id_chain_fail):
4112         (JSC::Interpreter::cti_op_get_by_id_array_fail):
4113         (JSC::Interpreter::cti_op_get_by_id_string_fail):
4114         * interpreter/Interpreter.h:
4115         * jit/JIT.cpp:
4116         (JSC::JIT::privateCompileMainPass):
4117         (JSC::JIT::privateCompileGetByIdSelf):
4118         (JSC::JIT::privateCompileGetByIdProto):
4119         (JSC::JIT::privateCompileGetByIdProtoList):
4120         (JSC::JIT::privateCompileGetByIdChain):
4121         (JSC::JIT::privateCompileCTIMachineTrampolines):
4122         (JSC::JIT::privateCompilePatchGetArrayLength):
4123         * jit/JIT.h:
4124         (JSC::JIT::compileGetByIdProtoList):
4125
4126 2008-11-20  Sam Weinig  <sam@webkit.org>
4127
4128         Try and fix the tiger build.
4129
4130         * parser/Grammar.y:
4131
4132 2008-11-20  Eric Seidel  <eric@webkit.org>
4133
4134         Reviewed by Darin Adler.
4135
4136         Make JavaScriptCore Chromium build under Windows (cmd only, cygwin almost works)
4137         https://bugs.webkit.org/show_bug.cgi?id=22347
4138
4139         * JavaScriptCore.scons:
4140         * parser/Parser.cpp: Add using std::auto_ptr since we use auto_ptr
4141
4142 2008-11-20  Steve Falkenburg  <sfalken@apple.com>
4143
4144         Fix build.
4145         
4146         Reviewed by Sam Weinig.
4147
4148         * parser/Parser.cpp:
4149         (JSC::Parser::reparse):
4150
4151 2008-11-20  Geoffrey Garen  <ggaren@apple.com>
4152
4153         Reviewed by Sam Weinig.
4154
4155         A little more RegExp refactoring.
4156         
4157         Created a helper function in the assembler for linking a vector of
4158         JmpSrc to a location, and deployed it in a bunch of places.
4159
4160         * JavaScriptCore.xcodeproj/project.pbxproj:
4161         * assembler/X86Assembler.h:
4162         (JSC::X86Assembler::link):
4163         * wrec/WREC.cpp:
4164         (JSC::WREC::compileRegExp):
4165         * wrec/WRECGenerator.cpp:
4166         (JSC::WREC::Generator::generateNonGreedyQuantifier):
4167         (JSC::WREC::Generator::generateGreedyQuantifier):
4168         (JSC::WREC::Generator::generateCharacterClassInverted):
4169         (JSC::WREC::Gener