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