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