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