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