2008-09-24 Maciej Stachowiak <mjs@apple.com>
[WebKit.git] / JavaScriptCore / ChangeLog
1 2008-09-24  Maciej Stachowiak  <mjs@apple.com>
2
3         Reviewed by Oliver Hunt.
4         
5         - inline PropertyMap::getOffset to speed up polymorphic lookups
6         
7         ~1.5% speedup on v8 benchmark
8         no effect on SunSpider
9
10         * JavaScriptCore.exp:
11         * kjs/PropertyMap.cpp:
12         * kjs/PropertyMap.h:
13         (JSC::PropertyMap::getOffset):
14
15 2008-09-24  Jan Michael Alonzo  <jmalonzo@webkit.org>
16
17         Reviewed by Alp Toker.
18
19         https://bugs.webkit.org/show_bug.cgi?id=20992
20         Build fails on GTK+ Mac OS
21
22         * wtf/ThreadingGtk.cpp: Remove platform ifdef as suggested by
23           Richard Hult.
24         (WTF::initializeThreading):
25
26 2008-09-23  Oliver Hunt  <oliver@apple.com>
27
28         Reviewed by Maciej Stachowiak.
29
30         Bug 19968: Slow Script at www.huffingtonpost.com
31         <https://bugs.webkit.org/show_bug.cgi?id=19968>
32
33         Finally found the cause of this accursed issue.  It is triggered
34         by synchronous creation of a new global object from JS.  The new
35         global object resets the timer state in this execution group's
36         Machine, taking timerCheckCount to 0.  Then when JS returns the
37         timerCheckCount is decremented making it non-zero.  The next time
38         we execute JS we will start the timeout counter, however the non-zero
39         timeoutCheckCount means we don't reset the timer information. This
40         means that the timeout check is now checking the cumulative time
41         since the creation of the global object rather than the time since
42         JS was last entered.  At this point the slow script dialog is guaranteed
43         to eventually be displayed incorrectly unless a page is loaded
44         asynchronously (which will reset everything into a sane state).
45
46         The fix for this is rather trivial -- the JSGlobalObject constructor
47         should not be resetting the machine timer state.
48
49         * VM/Machine.cpp:
50         (JSC::Machine::Machine):
51           Now that we can't rely on the GlobalObject initialising the timeout
52           state, we do it in the Machine constructor.
53
54         * VM/Machine.h:
55         (JSC::Machine::stopTimeoutCheck):
56           Add assertions to guard against this happening.
57
58         * kjs/JSGlobalObject.cpp:
59         (JSC::JSGlobalObject::init):
60           Don't reset the timeout state.
61
62 2008-09-23  Geoffrey Garen  <ggaren@apple.com>
63
64         Reviewed by Oliver Hunt.
65         
66         Fixed https://bugs.webkit.org/show_bug.cgi?id=21038 | <rdar://problem/6240812>
67         Uncaught exceptions in regex replace callbacks crash webkit
68         
69         This was a combination of two problems:
70         
71         (1) the replace function would continue execution after an exception
72         had been thrown.
73         
74         (2) In some cases, the Machine would return 0 in the case of an exception,
75         despite the fact that a few clients dereference the Machine's return
76         value without first checking for an exception.
77         
78         * VM/Machine.cpp:
79         (JSC::Machine::execute):
80         
81         ^ Return jsNull() instead of 0 in the case of an exception, since some
82         clients depend on using our return value.
83         
84         ^ ASSERT that execution does not continue after an exception has been
85         thrown, to help catch problems like this in the future.
86
87         * kjs/StringPrototype.cpp:
88         (JSC::stringProtoFuncReplace):
89         
90         ^ Stop execution if an exception has been thrown.
91
92 2008-09-23  Geoffrey Garen  <ggaren@apple.com>
93
94         Try to fix the windows build.
95
96         * VM/CTI.cpp:
97         (JSC::CTI::compileOpCall):
98         (JSC::CTI::privateCompileMainPass):
99
100 2008-09-23  Alp Toker  <alp@nuanti.com>
101
102         Build fix.
103
104         * VM/CTI.h:
105
106 2008-09-23  Geoffrey Garen  <ggaren@apple.com>
107
108         Reviewed by Darin Adler.
109
110         * wtf/Platform.h: Removed duplicate #if.
111
112 2008-09-23  Geoffrey Garen  <ggaren@apple.com>
113
114         Reviewed by Darin Adler.
115         
116         Changed the layout of the call frame from
117         
118         { header, parameters, locals | constants, temporaries }
119         
120         to
121         
122         { parameters, header | locals, constants, temporaries }
123         
124         This simplifies function entry+exit, and enables a number of future
125         optimizations.
126         
127         13.5% speedup on empty call benchmark for bytecode; 23.6% speedup on
128         empty call benchmark for CTI.
129         
130         SunSpider says no change. SunSpider --v8 says 1% faster.
131
132         * VM/CTI.cpp:
133         
134         Added a bit of abstraction for calculating whether a register is a
135         constant, since this patch changes that calculation:
136         (JSC::CTI::isConstant):
137         (JSC::CTI::getConstant):
138         (JSC::CTI::emitGetArg):
139         (JSC::CTI::emitGetPutArg):
140         (JSC::CTI::getConstantImmediateNumericArg):
141
142         Updated for changes to callframe header location:
143         (JSC::CTI::emitPutToCallFrameHeader):
144         (JSC::CTI::emitGetFromCallFrameHeader):
145         (JSC::CTI::printOpcodeOperandTypes):
146         
147         Renamed to spite Oliver:
148         (JSC::CTI::emitInitRegister):
149         
150         Added an abstraction for emitting a call through a register, so that
151         calls through registers generate exception info, too:
152         (JSC::CTI::emitCall):
153
154         Updated to match the new callframe header layout, and to support calls
155         through registers, which have no destination address:
156         (JSC::CTI::compileOpCall):
157         (JSC::CTI::privateCompileMainPass):
158         (JSC::CTI::privateCompileSlowCases):
159         (JSC::CTI::privateCompile):
160
161         * VM/CTI.h:
162
163         More of the above:
164         (JSC::CallRecord::CallRecord):
165
166         * VM/CodeBlock.cpp:
167
168         Updated for new register layout:
169         (JSC::registerName):
170         (JSC::CodeBlock::dump):
171
172         * VM/CodeBlock.h:
173         
174         Updated CodeBlock to track slightly different information about the
175         register frame, and tweaked the style of an ASSERT_NOT_REACHED.
176         (JSC::CodeBlock::CodeBlock):
177         (JSC::CodeBlock::getStubInfo):
178
179         * VM/CodeGenerator.cpp:
180         
181         Added some abstraction around constant register allocation, since this
182         patch changes it, changed codegen to account for the new callframe
183         layout, and added abstraction around register fetching code
184         that used to assume that all local registers lived at negative indices,
185         since vars now live at positive indices:
186         (JSC::CodeGenerator::generate):
187         (JSC::CodeGenerator::addVar):
188         (JSC::CodeGenerator::addGlobalVar):
189         (JSC::CodeGenerator::allocateConstants):
190         (JSC::CodeGenerator::CodeGenerator):
191         (JSC::CodeGenerator::addParameter):
192         (JSC::CodeGenerator::registerFor):
193         (JSC::CodeGenerator::constRegisterFor):
194         (JSC::CodeGenerator::newRegister):
195         (JSC::CodeGenerator::newTemporary):
196         (JSC::CodeGenerator::highestUsedRegister):
197         (JSC::CodeGenerator::addConstant):
198         
199         ASSERT that our caller referenced the registers it passed to us.
200         Otherwise, we might overwrite them with parameters:
201         (JSC::CodeGenerator::emitCall):
202         (JSC::CodeGenerator::emitConstruct):
203
204         * VM/CodeGenerator.h:
205         
206         Added some abstraction for getting a RegisterID for a given index,
207         since the rules are a little weird:
208         (JSC::CodeGenerator::registerFor):
209
210         * VM/Machine.cpp:
211
212         Utility function to transform a machine return PC to a virtual machine
213         return VPC, for the sake of stack unwinding, since both PCs are stored
214         in the same location now:
215         (JSC::vPCForPC):
216
217         Tweaked to account for new call frame:
218         (JSC::Machine::initializeCallFrame):
219         
220         Tweaked to account for registerOffset supplied by caller:
221         (JSC::slideRegisterWindowForCall):
222
223         Tweaked to account for new register layout:
224         (JSC::scopeChainForCall):
225         (JSC::Machine::callEval):
226         (JSC::Machine::dumpRegisters):
227         (JSC::Machine::unwindCallFrame):
228         (JSC::Machine::execute):
229
230         Changed op_call and op_construct to implement the new calling convention:
231         (JSC::Machine::privateExecute):
232
233         Tweaked to account for the new register layout:
234         (JSC::Machine::retrieveArguments):
235         (JSC::Machine::retrieveCaller):
236         (JSC::Machine::retrieveLastCaller):
237         (JSC::Machine::callFrame):
238         (JSC::Machine::getArgumentsData):
239
240         Changed CTI call helpers to implement the new calling convention:
241         (JSC::Machine::cti_op_call_JSFunction):
242         (JSC::Machine::cti_op_call_NotJSFunction):
243         (JSC::Machine::cti_op_ret_activation):
244         (JSC::Machine::cti_op_ret_profiler):
245         (JSC::Machine::cti_op_construct_JSConstruct):
246         (JSC::Machine::cti_op_construct_NotJSConstruct):
247         (JSC::Machine::cti_op_call_eval):
248
249         * VM/Machine.h:
250
251         * VM/Opcode.h:
252         
253         Renamed op_initialise_locals to op_init, because this opcode
254         doesn't initialize all locals, and it doesn't initialize only locals.
255         Also, to spite Oliver.
256         
257         * VM/RegisterFile.h:
258         
259         New call frame enumeration values:
260         (JSC::RegisterFile::):
261
262         Simplified the calculation of whether a RegisterID is a temporary,
263         since we can no longer assume that all positive non-constant registers
264         are temporaries:
265         * VM/RegisterID.h:
266         (JSC::RegisterID::RegisterID):
267         (JSC::RegisterID::setTemporary):
268         (JSC::RegisterID::isTemporary):
269
270         Renamed firstArgumentIndex to firstParameterIndex because the assumption
271         that this variable pertained to the actual arguments supplied by the
272         caller caused me to write some buggy code:
273         * kjs/Arguments.cpp:
274         (JSC::ArgumentsData::ArgumentsData):
275         (JSC::Arguments::Arguments):
276         (JSC::Arguments::fillArgList):
277         (JSC::Arguments::getOwnPropertySlot):
278         (JSC::Arguments::put):
279
280         Updated for new call frame layout:
281         * kjs/DebuggerCallFrame.cpp:
282         (JSC::DebuggerCallFrame::functionName):
283         (JSC::DebuggerCallFrame::type):
284         * kjs/DebuggerCallFrame.h:
285
286         Changed the activation object to account for the fact that a call frame
287         header now sits between parameters and local variables. This change
288         requires all variable objects to do their own marking, since they
289         now use their register storage differently:
290         * kjs/JSActivation.cpp:
291         (JSC::JSActivation::mark):
292         (JSC::JSActivation::copyRegisters):
293         (JSC::JSActivation::createArgumentsObject):
294         * kjs/JSActivation.h:
295
296         Updated global object to use the new interfaces required by the change
297         to JSActivation above:
298         * kjs/JSGlobalObject.cpp:
299         (JSC::JSGlobalObject::reset):
300         (JSC::JSGlobalObject::mark):
301         (JSC::JSGlobalObject::copyGlobalsFrom):
302         (JSC::JSGlobalObject::copyGlobalsTo):
303         * kjs/JSGlobalObject.h:
304         (JSC::JSGlobalObject::addStaticGlobals):
305
306         Updated static scope object to use the new interfaces required by the 
307         change to JSActivation above:
308         * kjs/JSStaticScopeObject.cpp:
309         (JSC::JSStaticScopeObject::mark):
310         (JSC::JSStaticScopeObject::~JSStaticScopeObject):
311         * kjs/JSStaticScopeObject.h:
312         (JSC::JSStaticScopeObject::JSStaticScopeObject):
313         (JSC::JSStaticScopeObject::d):
314
315         Updated variable object to use the new interfaces required by the 
316         change to JSActivation above:
317         * kjs/JSVariableObject.cpp:
318         (JSC::JSVariableObject::copyRegisterArray):
319         (JSC::JSVariableObject::setRegisters):
320         * kjs/JSVariableObject.h:
321
322         Changed the bit twiddling in symbol table not to assume that all indices
323         are negative, since they can be positive now:
324         * kjs/SymbolTable.h:
325         (JSC::SymbolTableEntry::SymbolTableEntry):
326         (JSC::SymbolTableEntry::isNull):
327         (JSC::SymbolTableEntry::getIndex):
328         (JSC::SymbolTableEntry::getAttributes):
329         (JSC::SymbolTableEntry::setAttributes):
330         (JSC::SymbolTableEntry::isReadOnly):
331         (JSC::SymbolTableEntry::pack):
332         (JSC::SymbolTableEntry::isValidIndex):
333
334         Changed call and construct nodes to ref their functions and/or bases,
335         so that emitCall/emitConstruct doesn't overwrite them with parameters.
336         Also, updated for rename to registerFor:
337         * kjs/nodes.cpp:
338         (JSC::ResolveNode::emitCode):
339         (JSC::NewExprNode::emitCode):
340         (JSC::EvalFunctionCallNode::emitCode):
341         (JSC::FunctionCallValueNode::emitCode):
342         (JSC::FunctionCallResolveNode::emitCode):
343         (JSC::FunctionCallBracketNode::emitCode):
344         (JSC::FunctionCallDotNode::emitCode):
345         (JSC::PostfixResolveNode::emitCode):
346         (JSC::DeleteResolveNode::emitCode):
347         (JSC::TypeOfResolveNode::emitCode):
348         (JSC::PrefixResolveNode::emitCode):
349         (JSC::ReadModifyResolveNode::emitCode):
350         (JSC::AssignResolveNode::emitCode):
351         (JSC::ConstDeclNode::emitCodeSingle):
352         (JSC::ForInNode::emitCode):
353
354         Added abstraction for getting exception info out of a call through a
355         register:
356         * masm/X86Assembler.h:
357         (JSC::X86Assembler::emitCall):
358         
359         Removed duplicate #if:
360         * wtf/Platform.h:
361
362 2008-09-23  Kevin McCullough  <kmccullough@apple.com>
363
364         Reviewed by Darin.
365
366         Bug 21030: The JS debugger breaks on the do of a do-while not the while
367         (where the conditional statement is)
368         https://bugs.webkit.org/show_bug.cgi?id=21030
369         Now the statementListEmitCode detects if a do-while node is being
370         emited and emits the debug hook on the last line instead of the first.
371
372         This change had no effect on sunspider.
373
374         * kjs/nodes.cpp:
375         (JSC::statementListEmitCode):
376         * kjs/nodes.h:
377         (JSC::StatementNode::isDoWhile):
378         (JSC::DoWhileNode::isDoWhile):
379
380 2008-09-23  Maciej Stachowiak  <mjs@apple.com>
381
382         Reviewed by Camron Zwarich.
383
384         - inline the fast case of instanceof
385         https://bugs.webkit.org/show_bug.cgi?id=20818
386
387         ~2% speedup on EarleyBoyer test.
388         
389         * VM/CTI.cpp:
390         (JSC::CTI::privateCompileMainPass):
391         (JSC::CTI::privateCompileSlowCases):
392         * VM/Machine.cpp:
393         (JSC::Machine::cti_op_instanceof):
394
395 2008-09-23  Maciej Stachowiak  <mjs@apple.com>
396
397         Reviewed by Cameron Zwarich.
398         
399         - add forgotten slow case logic for !==
400
401         * VM/CTI.cpp:
402         (JSC::CTI::privateCompileSlowCases):
403
404 2008-09-23  Maciej Stachowiak  <mjs@apple.com>
405
406         Reviewed by Cameron Zwarich.
407
408         - inline the fast cases of !==, same as for ===
409         
410         2.9% speedup on EarleyBoyer benchmark
411
412         * VM/CTI.cpp:
413         (JSC::CTI::compileOpStrictEq): Factored stricteq codegen into this function,
414         and parameterized so it can do the reverse version as well.
415         (JSC::CTI::privateCompileMainPass): Use the above for stricteq and nstricteq.
416         * VM/CTI.h:
417         (JSC::CTI::): Declare above stuff.
418         * VM/Machine.cpp:
419         (JSC::Machine::cti_op_nstricteq): Removed fast cases, now handled inline.
420
421 2008-09-23  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
422
423         Reviewed by Oliver Hunt.
424
425         Bug 20989: Aguments constructor should put 'callee' and 'length' properties in a more efficient way
426         <https://bugs.webkit.org/show_bug.cgi?id=20989>
427
428         Make special cases for the 'callee' and 'length' properties in the
429         Arguments object.
430
431         This is somewhere between a 7.8% speedup and a 10% speedup on the V8
432         Raytrace benchmark, depending on whether it is run alone or with the
433         other V8 benchmarks.
434
435         * kjs/Arguments.cpp:
436         (JSC::ArgumentsData::ArgumentsData):
437         (JSC::Arguments::Arguments):
438         (JSC::Arguments::mark):
439         (JSC::Arguments::getOwnPropertySlot):
440         (JSC::Arguments::put):
441         (JSC::Arguments::deleteProperty):
442
443 2008-09-23  Maciej Stachowiak  <mjs@apple.com>
444
445         Reviewed by Darin.
446
447         - speed up instanceof some more
448         https://bugs.webkit.org/show_bug.cgi?id=20818
449         
450         ~2% speedup on EarleyBoyer
451
452         The idea here is to record in the StructureID whether the class
453         needs a special hasInstance or if it can use the normal logic from
454         JSObject. 
455         
456         Based on this I inlined the real work directly into
457         cti_op_instanceof and put the fastest checks up front and the
458         error handling at the end (so it should be fairly straightforward
459         to split off the beginning to be inlined if desired).
460
461         I only did this for CTI, not the bytecode interpreter.
462         
463         * API/JSCallbackObject.h:
464         (JSC::JSCallbackObject::createStructureID):
465         * ChangeLog:
466         * VM/Machine.cpp:
467         (JSC::Machine::cti_op_instanceof):
468         * kjs/JSImmediate.h:
469         (JSC::JSImmediate::isAnyImmediate):
470         * kjs/TypeInfo.h:
471         (JSC::TypeInfo::overridesHasInstance):
472         (JSC::TypeInfo::flags):
473
474 2008-09-22  Darin Adler  <darin@apple.com>
475
476         Reviewed by Sam Weinig.
477
478         - https://bugs.webkit.org/show_bug.cgi?id=21019
479           make FunctionBodyNode::ref/deref fast
480
481         Speeds up v8-raytrace by 7.2%.
482
483         * kjs/nodes.cpp:
484         (JSC::FunctionBodyNode::FunctionBodyNode): Initialize m_refCount to 0.
485         * kjs/nodes.h:
486         (JSC::FunctionBodyNode::ref): Call base class ref once, and thereafter use
487         m_refCount.
488         (JSC::FunctionBodyNode::deref): Ditto, but the deref side.
489
490 2008-09-22  Darin Adler  <darin@apple.com>
491
492         Pointed out by Sam Weinig.
493
494         * kjs/Arguments.cpp:
495         (JSC::Arguments::fillArgList): Fix bad copy and paste. Oops!
496
497 2008-09-22  Darin Adler  <darin@apple.com>
498
499         Reviewed by Cameron Zwarich.
500
501         - https://bugs.webkit.org/show_bug.cgi?id=20983
502           ArgumentsData should have some room to allocate some extra arguments inline
503
504         Speeds up v8-raytrace by 5%.
505
506         * kjs/Arguments.cpp:
507         (JSC::ArgumentsData::ArgumentsData): Use a fixed buffer if there are 4 or fewer
508         extra arguments.
509         (JSC::Arguments::Arguments): Use a fixed buffer if there are 4 or fewer
510         extra arguments.
511         (JSC::Arguments::~Arguments): Delete the buffer if necessary.
512         (JSC::Arguments::mark): Update since extraArguments are now Register.
513         (JSC::Arguments::fillArgList): Added special case for the only case that's
514         actually used in the practice, when there are no parameters. There are some
515         other special cases in there too, but that's the only one that matters.
516         (JSC::Arguments::getOwnPropertySlot): Updated to use setValueSlot since there's
517         no operation to get you at the JSValue* inside a Register as a "slot".
518
519 2008-09-22  Sam Weinig  <sam@webkit.org>
520
521         Reviewed by Maciej Stachowiak.
522
523         Patch for https://bugs.webkit.org/show_bug.cgi?id=21014
524         Speed up for..in by using StructureID to avoid calls to hasProperty
525
526         Speeds up fasta by 8%.
527
528         * VM/JSPropertyNameIterator.cpp:
529         (JSC::JSPropertyNameIterator::invalidate):
530         * VM/JSPropertyNameIterator.h:
531         (JSC::JSPropertyNameIterator::next):
532         * kjs/PropertyNameArray.h:
533         (JSC::PropertyNameArrayData::begin):
534         (JSC::PropertyNameArrayData::end):
535         (JSC::PropertyNameArrayData::setCachedStructureID):
536         (JSC::PropertyNameArrayData::cachedStructureID):
537         * kjs/StructureID.cpp:
538         (JSC::StructureID::getEnumerablePropertyNames):
539         (JSC::structureIDChainsAreEqual):
540         * kjs/StructureID.h:
541
542 2008-09-22  Kelvin Sherlock  <ksherlock@gmail.com>
543
544         Updated and tweaked by Sam Weinig.
545
546         Reviewed by Geoffrey Garen.
547
548         Bug 20020: Proposed enhancement to JavaScriptCore API
549         <https://bugs.webkit.org/show_bug.cgi?id=20020>
550
551         Add JSObjectMakeArray, JSObjectMakeDate, JSObjectMakeError, and JSObjectMakeRegExp
552         functions to create JavaScript Array, Date, Error, and RegExp objects, respectively.
553
554         * API/JSObjectRef.cpp: The functions
555         * API/JSObjectRef.h: Function prototype and documentation
556         * JavaScriptCore.exp: Added functions to exported function list
557         * API/tests/testapi.c: Added basic functionality tests.
558
559         * kjs/DateConstructor.cpp:
560         Replaced static JSObject* constructDate(ExecState* exec, JSObject*, const ArgList& args)
561         with JSObject* constructDate(ExecState* exec, const ArgList& args).
562         Added static JSObject* constructWithDateConstructor(ExecState* exec, JSObject*, const ArgList& args) function
563
564         * kjs/DateConstructor.h:
565         added prototype for JSObject* constructDate(ExecState* exec, const ArgList& args)
566
567         * kjs/ErrorConstructor.cpp:
568         removed static qualifier from ErrorInstance* constructError(ExecState* exec, const ArgList& args)
569
570         * kjs/ErrorConstructor.h:
571         added prototype for ErrorInstance* constructError(ExecState* exec, const ArgList& args)
572
573         * kjs/RegExpConstructor.cpp:
574         removed static qualifier from JSObject* constructRegExp(ExecState* exec, const ArgList& args)
575
576         * kjs/RegExpConstructor.h:
577         added prototype for JSObject* constructRegExp(ExecState* exec, const ArgList& args)
578
579 2008-09-22  Matt Lilek  <webkit@mattlilek.com>
580
581         Not reviewed, Windows build fix.
582
583         * kjs/Arguments.cpp:
584         * kjs/FunctionPrototype.cpp:
585
586 2008-09-22  Sam Weinig  <sam@webkit.org>
587
588         Reviewed by Darin Adler.
589
590         Patch for https://bugs.webkit.org/show_bug.cgi?id=20982
591         Speed up the apply method of functions by special-casing array and 'arguments' objects
592
593         1% speedup on v8-raytrace.
594
595         Test: fast/js/function-apply.html
596
597         * kjs/Arguments.cpp:
598         (JSC::Arguments::fillArgList):
599         * kjs/Arguments.h:
600         * kjs/FunctionPrototype.cpp:
601         (JSC::functionProtoFuncApply):
602         * kjs/JSArray.cpp:
603         (JSC::JSArray::fillArgList):
604         * kjs/JSArray.h:
605
606 2008-09-22  Darin Adler  <darin@apple.com>
607
608         Reviewed by Sam Weinig.
609
610         - https://bugs.webkit.org/show_bug.cgi?id=20993
611           Array.push/pop need optimized cases for JSArray
612
613         3% or so speedup on DeltaBlue benchmark.
614
615         * kjs/ArrayPrototype.cpp:
616         (JSC::arrayProtoFuncPop): Call JSArray::pop when appropriate.
617         (JSC::arrayProtoFuncPush): Call JSArray::push when appropriate.
618
619         * kjs/JSArray.cpp:
620         (JSC::JSArray::putSlowCase): Set m_fastAccessCutoff when appropriate, getting
621         us into the fast code path.
622         (JSC::JSArray::pop): Added.
623         (JSC::JSArray::push): Added.
624         * kjs/JSArray.h: Added push and pop.
625
626         * kjs/operations.cpp:
627         (JSC::throwOutOfMemoryError): Don't inline this. Helps us avoid PIC branches.
628
629 2008-09-22  Maciej Stachowiak  <mjs@apple.com>
630
631         Reviewed by Cameron Zwarich.
632         
633         - speed up instanceof operator by replacing implementsHasInstance method with a TypeInfo flag
634
635         Partial work towards <https://bugs.webkit.org/show_bug.cgi?id=20818>
636         
637         2.2% speedup on EarleyBoyer benchmark.
638
639         * API/JSCallbackConstructor.cpp:
640         * API/JSCallbackConstructor.h:
641         (JSC::JSCallbackConstructor::createStructureID):
642         * API/JSCallbackFunction.cpp:
643         * API/JSCallbackFunction.h:
644         (JSC::JSCallbackFunction::createStructureID):
645         * API/JSCallbackObject.h:
646         (JSC::JSCallbackObject::createStructureID):
647         * API/JSCallbackObjectFunctions.h:
648         (JSC::::hasInstance):
649         * API/JSValueRef.cpp:
650         (JSValueIsInstanceOfConstructor):
651         * JavaScriptCore.exp:
652         * VM/Machine.cpp:
653         (JSC::Machine::privateExecute):
654         (JSC::Machine::cti_op_instanceof):
655         * kjs/InternalFunction.cpp:
656         * kjs/InternalFunction.h:
657         (JSC::InternalFunction::createStructureID):
658         * kjs/JSObject.cpp:
659         * kjs/JSObject.h:
660         * kjs/TypeInfo.h:
661         (JSC::TypeInfo::implementsHasInstance):
662
663 2008-09-22  Maciej Stachowiak  <mjs@apple.com>
664
665         Reviewed by Dave Hyatt.
666         
667         Based on initial work by Darin Adler.
668         
669         - replace masqueradesAsUndefined virtual method with a flag in TypeInfo
670         - use this to JIT inline code for eq_null and neq_null
671         https://bugs.webkit.org/show_bug.cgi?id=20823
672
673         0.5% speedup on SunSpider
674         ~4% speedup on Richards benchmark
675         
676         * VM/CTI.cpp:
677         (JSC::CTI::privateCompileMainPass):
678         * VM/Machine.cpp:
679         (JSC::jsTypeStringForValue):
680         (JSC::jsIsObjectType):
681         (JSC::Machine::privateExecute):
682         (JSC::Machine::cti_op_is_undefined):
683         * VM/Machine.h:
684         * kjs/JSCell.h:
685         * kjs/JSValue.h:
686         * kjs/StringObjectThatMasqueradesAsUndefined.h:
687         (JSC::StringObjectThatMasqueradesAsUndefined::create):
688         (JSC::StringObjectThatMasqueradesAsUndefined::createStructureID):
689         * kjs/StructureID.h:
690         (JSC::StructureID::mutableTypeInfo):
691         * kjs/TypeInfo.h:
692         (JSC::TypeInfo::TypeInfo):
693         (JSC::TypeInfo::masqueradesAsUndefined):
694         * kjs/operations.cpp:
695         (JSC::equal):
696         * masm/X86Assembler.h:
697         (JSC::X86Assembler::):
698         (JSC::X86Assembler::setne_r):
699         (JSC::X86Assembler::setnz_r):
700         (JSC::X86Assembler::testl_i32m):
701
702 2008-09-22  Tor Arne Vestbø  <tavestbo@trolltech.com>
703
704         Reviewed by Simon.
705
706         Initialize QCoreApplication in kjs binary/Shell.cpp
707         
708         This allows us to use QCoreApplication::instance() to
709         get the main thread in ThreadingQt.cpp
710
711         * kjs/Shell.cpp:
712         (main):
713         * wtf/ThreadingQt.cpp:
714         (WTF::initializeThreading):
715
716 2008-09-21  Darin Adler  <darin@apple.com>
717
718         - blind attempt to fix non-all-in-one builds
719
720         * kjs/JSGlobalObject.cpp: Added includes of Arguments.h and RegExpObject.h.
721
722 2008-09-21  Darin Adler  <darin@apple.com>
723
724         - fix debug build
725
726         * kjs/StructureID.cpp:
727         (JSC::StructureID::addPropertyTransition): Use typeInfo().type() instead of m_type.
728         (JSC::StructureID::createCachedPrototypeChain): Ditto.
729
730 2008-09-21  Maciej Stachowiak  <mjs@apple.com>
731
732         Reviewed by Darin Adler.
733         
734         - introduce a TypeInfo class, for holding per-type (in the C++ class sense) date in StructureID
735         https://bugs.webkit.org/show_bug.cgi?id=20981
736
737         * JavaScriptCore.exp:
738         * JavaScriptCore.xcodeproj/project.pbxproj:
739         * VM/CTI.cpp:
740         (JSC::CTI::privateCompileMainPass):
741         (JSC::CTI::privateCompilePutByIdTransition):
742         * VM/Machine.cpp:
743         (JSC::jsIsObjectType):
744         (JSC::Machine::Machine):
745         * kjs/AllInOneFile.cpp:
746         * kjs/JSCell.h:
747         (JSC::JSCell::isObject):
748         (JSC::JSCell::isString):
749         * kjs/JSGlobalData.cpp:
750         (JSC::JSGlobalData::JSGlobalData):
751         * kjs/JSGlobalObject.cpp:
752         (JSC::JSGlobalObject::reset):
753         * kjs/JSGlobalObject.h:
754         (JSC::StructureID::prototypeForLookup):
755         * kjs/JSNumberCell.h:
756         (JSC::JSNumberCell::createStructureID):
757         * kjs/JSObject.cpp:
758         (JSC::JSObject::createInheritorID):
759         * kjs/JSObject.h:
760         (JSC::JSObject::createStructureID):
761         * kjs/JSString.h:
762         (JSC::JSString::createStructureID):
763         * kjs/NativeErrorConstructor.cpp:
764         (JSC::NativeErrorConstructor::NativeErrorConstructor):
765         * kjs/RegExpConstructor.cpp:
766         * kjs/RegExpMatchesArray.h: Added.
767         (JSC::RegExpMatchesArray::getOwnPropertySlot):
768         (JSC::RegExpMatchesArray::put):
769         (JSC::RegExpMatchesArray::deleteProperty):
770         (JSC::RegExpMatchesArray::getPropertyNames):
771         * kjs/StructureID.cpp:
772         (JSC::StructureID::StructureID):
773         (JSC::StructureID::addPropertyTransition):
774         (JSC::StructureID::toDictionaryTransition):
775         (JSC::StructureID::changePrototypeTransition):
776         (JSC::StructureID::getterSetterTransition):
777         * kjs/StructureID.h:
778         (JSC::StructureID::create):
779         (JSC::StructureID::typeInfo):
780         * kjs/TypeInfo.h: Added.
781         (JSC::TypeInfo::TypeInfo):
782         (JSC::TypeInfo::type):
783
784 2008-09-21  Darin Adler  <darin@apple.com>
785
786         Reviewed by Cameron Zwarich.
787
788         - fix crash logging into Gmail due to recent Arguments change
789
790         * kjs/Arguments.cpp:
791         (JSC::Arguments::Arguments): Fix window where mark() function could
792         see d->extraArguments with uninitialized contents.
793         (JSC::Arguments::mark): Check d->extraArguments for 0 to handle two
794         cases: 1) Inside the constructor before it's initialized.
795         2) numArguments <= numParameters.
796
797 2008-09-21  Darin Adler  <darin@apple.com>
798
799         - fix loose end from the "duplicate constant values" patch
800
801         * VM/CodeGenerator.cpp:
802         (JSC::CodeGenerator::emitLoad): Add a special case for values the
803         hash table can't handle.
804
805 2008-09-21  Mark Rowe  <mrowe@apple.com>
806
807         Fix the non-AllInOneFile build.
808
809         * kjs/Arguments.cpp: Add missing #include.
810
811 2008-09-21  Darin Adler  <darin@apple.com>
812
813         Reviewed by Cameron Zwarich and Mark Rowe.
814
815         - fix test failure caused by my recent IndexToNameMap patch
816
817         * kjs/Arguments.cpp:
818         (JSC::Arguments::deleteProperty): Added the accidentally-omitted
819         check of the boolean result from toArrayIndex.
820
821 2008-09-21  Darin Adler  <darin@apple.com>
822
823         Reviewed by Maciej Stachowiak.
824
825         - https://bugs.webkit.org/show_bug.cgi?id=20975
826           inline immediate-number case of ==
827
828         * VM/CTI.h: Renamed emitJumpSlowCaseIfNotImm to
829         emitJumpSlowCaseIfNotImmNum, since the old name was incorrect.
830
831         * VM/CTI.cpp: Updated for new name.
832         (JSC::CTI::privateCompileMainPass): Added op_eq.
833         (JSC::CTI::privateCompileSlowCases): Added op_eq.
834
835         * VM/Machine.cpp:
836         (JSC::Machine::cti_op_eq): Removed fast case, since it's now
837         compiled.
838
839 2008-09-21  Peter Gal  <galpter@inf.u-szeged.hu>
840
841         Reviewed by Tim Hatcher and Eric Seidel.
842
843         Fix the QT/Linux JavaScriptCore segmentation fault.
844         https://bugs.webkit.org/show_bug.cgi?id=20914
845
846         * wtf/ThreadingQt.cpp:
847         (WTF::initializeThreading): Use currentThread() if
848         platform is not a MAC (like in pre 36541 revisions)
849
850 2008-09-21  Darin Adler  <darin@apple.com>
851
852         Reviewed by Sam Weinig.
853
854         * kjs/debugger.h: Removed some unneeded includes and declarations.
855
856 2008-09-21  Darin Adler  <darin@apple.com>
857
858         Reviewed by Sam Weinig.
859
860         - https://bugs.webkit.org/show_bug.cgi?id=20972
861           speed up Arguments further by eliminating the IndexToNameMap
862
863         No change on SunSpider. 1.29x as fast on V8 Raytrace.
864
865         * kjs/Arguments.cpp: Moved ArgumentsData in here. Eliminated the
866         indexToNameMap and hadDeletes data members. Changed extraArguments into
867         an OwnArrayPtr and added deletedArguments, another OwnArrayPtr.
868         Replaced numExtraArguments with numParameters, since that's what's
869         used more directly in hot code paths.
870         (JSC::Arguments::Arguments): Pass in argument count instead of ArgList.
871         Initialize ArgumentsData the new way.
872         (JSC::Arguments::mark): Updated.
873         (JSC::Arguments::getOwnPropertySlot): Overload for the integer form so
874         we don't have to convert integers to identifiers just to get an argument.
875         Integrated the deleted case with the fast case.
876         (JSC::Arguments::put): Ditto.
877         (JSC::Arguments::deleteProperty): Ditto.
878
879         * kjs/Arguments.h: Minimized includes. Made everything private. Added
880         overloads for the integral property name case. Eliminated mappedIndexSetter.
881         Moved ArgumentsData into the .cpp file.
882
883         * kjs/IndexToNameMap.cpp: Emptied out and prepared for deletion.
884         * kjs/IndexToNameMap.h: Ditto.
885
886         * kjs/JSActivation.cpp:
887         (JSC::JSActivation::createArgumentsObject): Elminated ArgList.
888
889         * GNUmakefile.am:
890         * JavaScriptCore.pri:
891         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
892         * JavaScriptCore.xcodeproj/project.pbxproj:
893         * JavaScriptCoreSources.bkl:
894         * kjs/AllInOneFile.cpp:
895         Removed IndexToNameMap.
896
897 2008-09-21  Darin Adler  <darin@apple.com>
898
899         * VM/CodeGenerator.cpp:
900         (JSC::CodeGenerator::emitLoad): One more tweak: Wrote this in a slightly
901         clearer style.
902
903 2008-09-21  Judit Jasz  <jasy@inf.u-szeged.hu>
904
905         Reviewed and tweaked by Darin Adler.
906
907         - https://bugs.webkit.org/show_bug.cgi?id=20645
908           Elminate duplicate constant values in CodeBlocks.
909
910         Seems to be a wash on SunSpider.
911
912         * VM/CodeGenerator.cpp:
913         (JSC::CodeGenerator::emitLoad): Use m_numberMap and m_stringMap to guarantee
914         we emit the same JSValue* for identical numbers and strings.
915         * VM/CodeGenerator.h: Added overload of emitLoad for const Identifier&.
916         Add NumberMap and IdentifierStringMap types and m_numberMap and m_stringMap.
917         * kjs/nodes.cpp:
918         (JSC::StringNode::emitCode): Call the new emitLoad and let it do the
919         JSString creation.
920
921 2008-09-21  Paul Pedriana  <webkit@pedriana.com>
922
923         Reviewed and tweaked by Darin Adler.
924
925         - https://bugs.webkit.org/show_bug.cgi?id=16925
926           Fixed lack of Vector buffer alignment for both GCC and MSVC.
927           Since there's no portable way to do this, for now we don't support
928           other compilers.
929
930         * wtf/Vector.h: Added WTF_ALIGH_ON, WTF_ALIGNED, AlignedBufferChar, and AlignedBuffer.
931         Use AlignedBuffer insteadof an array of char in VectorBuffer.
932
933 2008-09-21  Gabor Loki  <loki@inf.u-szeged.hu>
934
935         Reviewed by Darin Adler.
936
937         - https://bugs.webkit.org/show_bug.cgi?id=19408
938           Add lightweight constant folding to the parser for *, /, + (only for numbers), <<, >>, ~ operators.
939
940         1.008x as fast on SunSpider.
941
942         * kjs/grammar.y:
943         (makeNegateNode): Fold if expression is a number > 0.
944         (makeBitwiseNotNode): Fold if expression is a number.
945         (makeMultNode): Fold if expressions are both numbers.
946         (makeDivNode): Fold if expressions are both numbers.
947         (makeAddNode): Fold if expressions are both numbers.
948         (makeLeftShiftNode): Fold if expressions are both numbers.
949         (makeRightShiftNode): Fold if expressions are both numbers.
950
951 2008-09-21  Maciej Stachowiak  <mjs@apple.com>
952
953         Reviewed by Oliver.
954         
955         - speed up === operator by generating inline machine code for the fast paths
956         https://bugs.webkit.org/show_bug.cgi?id=20820
957
958         * VM/CTI.cpp:
959         (JSC::CTI::emitJumpSlowCaseIfNotImmediateNumber):
960         (JSC::CTI::emitJumpSlowCaseIfNotImmediateNumbers):
961         (JSC::CTI::emitJumpSlowCaseIfNotImmediates):
962         (JSC::CTI::emitTagAsBoolImmediate):
963         (JSC::CTI::privateCompileMainPass):
964         (JSC::CTI::privateCompileSlowCases):
965         * VM/CTI.h:
966         * VM/Machine.cpp:
967         (JSC::Machine::cti_op_stricteq):
968         * masm/X86Assembler.h:
969         (JSC::X86Assembler::):
970         (JSC::X86Assembler::sete_r):
971         (JSC::X86Assembler::setz_r):
972         (JSC::X86Assembler::movzbl_rr):
973         (JSC::X86Assembler::emitUnlinkedJnz):
974
975 2008-09-21  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
976
977         Reviewed by Maciej Stachowiak.
978
979         Free memory allocated for extra arguments in the destructor of the
980         Arguments object.
981
982         * kjs/Arguments.cpp:
983         (JSC::Arguments::~Arguments):
984         * kjs/Arguments.h:
985
986 2008-09-21  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
987
988         Reviewed by Maciej Stachowiak.
989
990         Bug 20815: 'arguments' object creation is non-optimal
991         <https://bugs.webkit.org/show_bug.cgi?id=20815>
992
993         Fix our inefficient way of creating the arguments object by only
994         creating named properties for each of the arguments after a use of the
995         'delete' statement. This patch also speeds up access to the 'arguments'
996         object slightly, but it still does not use the array fast path for
997         indexed access that exists for many opcodes.
998
999         This is about a 20% improvement on the V8 Raytrace benchmark, and a 1.5%
1000         improvement on the Earley-Boyer benchmark, which gives a 4% improvement
1001         overall.
1002
1003         * kjs/Arguments.cpp:
1004         (JSC::Arguments::Arguments):
1005         (JSC::Arguments::mark):
1006         (JSC::Arguments::getOwnPropertySlot):
1007         (JSC::Arguments::put):
1008         (JSC::Arguments::deleteProperty):
1009         * kjs/Arguments.h:
1010         (JSC::Arguments::ArgumentsData::ArgumentsData):
1011         * kjs/IndexToNameMap.h:
1012         (JSC::IndexToNameMap::size):
1013         * kjs/JSActivation.cpp:
1014         (JSC::JSActivation::createArgumentsObject):
1015         * kjs/JSActivation.h:
1016         (JSC::JSActivation::uncheckedSymbolTableGet):
1017         (JSC::JSActivation::uncheckedSymbolTableGetValue):
1018         (JSC::JSActivation::uncheckedSymbolTablePut):
1019         * kjs/JSFunction.h:
1020         (JSC::JSFunction::numParameters):
1021
1022 2008-09-20  Darin Adler  <darin@apple.com>
1023
1024         Reviewed by Mark Rowe.
1025
1026         - fix crash seen on buildbot
1027
1028         * kjs/JSGlobalObject.cpp:
1029         (JSC::JSGlobalObject::mark): Add back mark of arrayPrototype,
1030         deleted by accident in my recent check-in.
1031
1032 2008-09-20  Maciej Stachowiak  <mjs@apple.com>
1033
1034         Not reviewed, build fix.
1035         
1036         - speculative fix for non-AllInOne builds
1037
1038         * kjs/operations.h:
1039
1040 2008-09-20  Maciej Stachowiak  <mjs@apple.com>
1041
1042         Reviewed by Darin Adler.
1043         
1044         - assorted optimizations to === and !== operators
1045         (work towards <https://bugs.webkit.org/show_bug.cgi?id=20820>)
1046         
1047         2.5% speedup on earley-boyer test
1048
1049         * VM/Machine.cpp:
1050         (JSC::Machine::cti_op_stricteq): Use inline version of
1051         strictEqualSlowCase; remove unneeded exception check.
1052         (JSC::Machine::cti_op_nstricteq): ditto
1053         * kjs/operations.cpp:
1054         (JSC::strictEqual): Use strictEqualSlowCaseInline
1055         (JSC::strictEqualSlowCase): ditto
1056         * kjs/operations.h:
1057         (JSC::strictEqualSlowCaseInline): Version of strictEqualSlowCase that can be inlined,
1058         since the extra function call indirection is a lose for CTI.
1059
1060 2008-09-20  Darin Adler  <darin@apple.com>
1061
1062         Reviewed by Maciej Stachowiak.
1063
1064         - finish https://bugs.webkit.org/show_bug.cgi?id=20858
1065           make each distinct C++ class get a distinct JSC::Structure
1066
1067         This also includes some optimizations that make the change an overall
1068         small speedup. Without those it was a bit of a slowdown.
1069
1070         * API/JSCallbackConstructor.cpp:
1071         (JSC::JSCallbackConstructor::JSCallbackConstructor): Take a structure.
1072         * API/JSCallbackConstructor.h: Ditto.
1073         * API/JSCallbackFunction.cpp:
1074         (JSC::JSCallbackFunction::JSCallbackFunction): Pass a structure.
1075         * API/JSCallbackObject.h: Take a structure.
1076         * API/JSCallbackObjectFunctions.h:
1077         (JSC::JSCallbackObject::JSCallbackObject): Ditto.
1078
1079         * API/JSClassRef.cpp:
1080         (OpaqueJSClass::prototype): Pass in a structure. Call setPrototype
1081         if there's a custom prototype involved.
1082         * API/JSObjectRef.cpp:
1083         (JSObjectMake): Ditto.
1084         (JSObjectMakeConstructor): Pass in a structure.
1085
1086         * JavaScriptCore.exp: Updated.
1087
1088         * VM/Machine.cpp:
1089         (JSC::jsLess): Added a special case for when both arguments are strings.
1090         This avoids converting both strings to with UString::toDouble.
1091         (JSC::jsLessEq): Ditto.
1092         (JSC::Machine::privateExecute): Pass in a structure.
1093         (JSC::Machine::cti_op_construct_JSConstruct): Ditto.
1094         (JSC::Machine::cti_op_new_regexp): Ditto.
1095         (JSC::Machine::cti_op_is_string): Ditto.
1096         * VM/Machine.h: Made isJSString public so it can be used in the CTI.
1097
1098         * kjs/Arguments.cpp:
1099         (JSC::Arguments::Arguments): Pass in a structure.
1100
1101         * kjs/JSCell.h: Mark constructor explicit.
1102
1103         * kjs/JSGlobalObject.cpp:
1104         (JSC::markIfNeeded): Added an overload for marking structures.
1105         (JSC::JSGlobalObject::reset): Eliminate code to set data members to
1106         zero. We now do that in the constructor, and we no longer use this
1107         anywhere except in the constructor. Added code to create structures.
1108         Pass structures rather than prototypes when creating objects.
1109         (JSC::JSGlobalObject::mark): Mark the structures.
1110
1111         * kjs/JSGlobalObject.h: Removed unneeded class declarations.
1112         Added initializers for raw pointers in JSGlobalObjectData so
1113         everything starts with a 0. Added structure data and accessor
1114         functions.
1115
1116         * kjs/JSImmediate.cpp:
1117         (JSC::JSImmediate::nonInlineNaN): Added.
1118         * kjs/JSImmediate.h:
1119         (JSC::JSImmediate::toDouble): Rewrote to avoid PIC branches.
1120
1121         * kjs/JSNumberCell.cpp:
1122         (JSC::jsNumberCell): Made non-inline to avoid PIC branches
1123         in functions that call this one.
1124         (JSC::jsNaN): Ditto.
1125         * kjs/JSNumberCell.h: Ditto.
1126
1127         * kjs/JSObject.h: Removed constructor that takes a prototype.
1128         All callers now pass structures.
1129
1130         * kjs/ArrayConstructor.cpp:
1131         (JSC::ArrayConstructor::ArrayConstructor):
1132         (JSC::constructArrayWithSizeQuirk):
1133         * kjs/ArrayConstructor.h:
1134         * kjs/ArrayPrototype.cpp:
1135         (JSC::ArrayPrototype::ArrayPrototype):
1136         * kjs/ArrayPrototype.h:
1137         * kjs/BooleanConstructor.cpp:
1138         (JSC::BooleanConstructor::BooleanConstructor):
1139         (JSC::constructBoolean):
1140         (JSC::constructBooleanFromImmediateBoolean):
1141         * kjs/BooleanConstructor.h:
1142         * kjs/BooleanObject.cpp:
1143         (JSC::BooleanObject::BooleanObject):
1144         * kjs/BooleanObject.h:
1145         * kjs/BooleanPrototype.cpp:
1146         (JSC::BooleanPrototype::BooleanPrototype):
1147         * kjs/BooleanPrototype.h:
1148         * kjs/DateConstructor.cpp:
1149         (JSC::DateConstructor::DateConstructor):
1150         (JSC::constructDate):
1151         * kjs/DateConstructor.h:
1152         * kjs/DateInstance.cpp:
1153         (JSC::DateInstance::DateInstance):
1154         * kjs/DateInstance.h:
1155         * kjs/DatePrototype.cpp:
1156         (JSC::DatePrototype::DatePrototype):
1157         * kjs/DatePrototype.h:
1158         * kjs/ErrorConstructor.cpp:
1159         (JSC::ErrorConstructor::ErrorConstructor):
1160         (JSC::constructError):
1161         * kjs/ErrorConstructor.h:
1162         * kjs/ErrorInstance.cpp:
1163         (JSC::ErrorInstance::ErrorInstance):
1164         * kjs/ErrorInstance.h:
1165         * kjs/ErrorPrototype.cpp:
1166         (JSC::ErrorPrototype::ErrorPrototype):
1167         * kjs/ErrorPrototype.h:
1168         * kjs/FunctionConstructor.cpp:
1169         (JSC::FunctionConstructor::FunctionConstructor):
1170         * kjs/FunctionConstructor.h:
1171         * kjs/FunctionPrototype.cpp:
1172         (JSC::FunctionPrototype::FunctionPrototype):
1173         (JSC::FunctionPrototype::addFunctionProperties):
1174         * kjs/FunctionPrototype.h:
1175         * kjs/GlobalEvalFunction.cpp:
1176         (JSC::GlobalEvalFunction::GlobalEvalFunction):
1177         * kjs/GlobalEvalFunction.h:
1178         * kjs/InternalFunction.cpp:
1179         (JSC::InternalFunction::InternalFunction):
1180         * kjs/InternalFunction.h:
1181         (JSC::InternalFunction::InternalFunction):
1182         * kjs/JSArray.cpp:
1183         (JSC::JSArray::JSArray):
1184         (JSC::constructEmptyArray):
1185         (JSC::constructArray):
1186         * kjs/JSArray.h:
1187         * kjs/JSFunction.cpp:
1188         (JSC::JSFunction::JSFunction):
1189         (JSC::JSFunction::construct):
1190         * kjs/JSObject.cpp:
1191         (JSC::constructEmptyObject):
1192         * kjs/JSString.cpp:
1193         (JSC::StringObject::create):
1194         * kjs/JSWrapperObject.h:
1195         * kjs/MathObject.cpp:
1196         (JSC::MathObject::MathObject):
1197         * kjs/MathObject.h:
1198         * kjs/NativeErrorConstructor.cpp:
1199         (JSC::NativeErrorConstructor::NativeErrorConstructor):
1200         (JSC::NativeErrorConstructor::construct):
1201         * kjs/NativeErrorConstructor.h:
1202         * kjs/NativeErrorPrototype.cpp:
1203         (JSC::NativeErrorPrototype::NativeErrorPrototype):
1204         * kjs/NativeErrorPrototype.h:
1205         * kjs/NumberConstructor.cpp:
1206         (JSC::NumberConstructor::NumberConstructor):
1207         (JSC::constructWithNumberConstructor):
1208         * kjs/NumberConstructor.h:
1209         * kjs/NumberObject.cpp:
1210         (JSC::NumberObject::NumberObject):
1211         (JSC::constructNumber):
1212         (JSC::constructNumberFromImmediateNumber):
1213         * kjs/NumberObject.h:
1214         * kjs/NumberPrototype.cpp:
1215         (JSC::NumberPrototype::NumberPrototype):
1216         * kjs/NumberPrototype.h:
1217         * kjs/ObjectConstructor.cpp:
1218         (JSC::ObjectConstructor::ObjectConstructor):
1219         (JSC::constructObject):
1220         * kjs/ObjectConstructor.h:
1221         * kjs/ObjectPrototype.cpp:
1222         (JSC::ObjectPrototype::ObjectPrototype):
1223         * kjs/ObjectPrototype.h:
1224         * kjs/PrototypeFunction.cpp:
1225         (JSC::PrototypeFunction::PrototypeFunction):
1226         * kjs/PrototypeFunction.h:
1227         * kjs/RegExpConstructor.cpp:
1228         (JSC::RegExpConstructor::RegExpConstructor):
1229         (JSC::RegExpMatchesArray::RegExpMatchesArray):
1230         (JSC::constructRegExp):
1231         * kjs/RegExpConstructor.h:
1232         * kjs/RegExpObject.cpp:
1233         (JSC::RegExpObject::RegExpObject):
1234         * kjs/RegExpObject.h:
1235         * kjs/RegExpPrototype.cpp:
1236         (JSC::RegExpPrototype::RegExpPrototype):
1237         * kjs/RegExpPrototype.h:
1238         * kjs/Shell.cpp:
1239         (GlobalObject::GlobalObject):
1240         * kjs/StringConstructor.cpp:
1241         (JSC::StringConstructor::StringConstructor):
1242         (JSC::constructWithStringConstructor):
1243         * kjs/StringConstructor.h:
1244         * kjs/StringObject.cpp:
1245         (JSC::StringObject::StringObject):
1246         * kjs/StringObject.h:
1247         * kjs/StringObjectThatMasqueradesAsUndefined.h:
1248         (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
1249         * kjs/StringPrototype.cpp:
1250         (JSC::StringPrototype::StringPrototype):
1251         * kjs/StringPrototype.h:
1252         Take and pass structures.
1253
1254 2008-09-19  Alp Toker  <alp@nuanti.com>
1255
1256         Build fix for the 'gold' linker and recent binutils. New behaviour
1257         requires that we link to used libraries explicitly.
1258
1259         * GNUmakefile.am:
1260
1261 2008-09-19  Sam Weinig  <sam@webkit.org>
1262
1263         Roll r36694 back in.  It did not cause the crash.
1264
1265         * JavaScriptCore.exp:
1266         * VM/JSPropertyNameIterator.cpp:
1267         (JSC::JSPropertyNameIterator::~JSPropertyNameIterator):
1268         (JSC::JSPropertyNameIterator::invalidate):
1269         * VM/JSPropertyNameIterator.h:
1270         (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
1271         (JSC::JSPropertyNameIterator::create):
1272         * kjs/JSObject.cpp:
1273         (JSC::JSObject::getPropertyNames):
1274         * kjs/PropertyMap.cpp:
1275         (JSC::PropertyMap::getEnumerablePropertyNames):
1276         * kjs/PropertyMap.h:
1277         * kjs/PropertyNameArray.cpp:
1278         (JSC::PropertyNameArray::add):
1279         * kjs/PropertyNameArray.h:
1280         (JSC::PropertyNameArrayData::create):
1281         (JSC::PropertyNameArrayData::propertyNameVector):
1282         (JSC::PropertyNameArrayData::setCachedPrototypeChain):
1283         (JSC::PropertyNameArrayData::cachedPrototypeChain):
1284         (JSC::PropertyNameArrayData::begin):
1285         (JSC::PropertyNameArrayData::end):
1286         (JSC::PropertyNameArrayData::PropertyNameArrayData):
1287         (JSC::PropertyNameArray::PropertyNameArray):
1288         (JSC::PropertyNameArray::addKnownUnique):
1289         (JSC::PropertyNameArray::size):
1290         (JSC::PropertyNameArray::operator[]):
1291         (JSC::PropertyNameArray::begin):
1292         (JSC::PropertyNameArray::end):
1293         (JSC::PropertyNameArray::setData):
1294         (JSC::PropertyNameArray::data):
1295         (JSC::PropertyNameArray::releaseData):
1296         * kjs/StructureID.cpp:
1297         (JSC::structureIDChainsAreEqual):
1298         (JSC::StructureID::getEnumerablePropertyNames):
1299         (JSC::StructureID::clearEnumerationCache):
1300         (JSC::StructureID::createCachedPrototypeChain):
1301         * kjs/StructureID.h:
1302
1303 2008-09-19  Sam Weinig  <sam@webkit.org>
1304
1305         Roll out r36694.
1306
1307         * JavaScriptCore.exp:
1308         * VM/JSPropertyNameIterator.cpp:
1309         (JSC::JSPropertyNameIterator::~JSPropertyNameIterator):
1310         (JSC::JSPropertyNameIterator::invalidate):
1311         * VM/JSPropertyNameIterator.h:
1312         (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
1313         (JSC::JSPropertyNameIterator::create):
1314         * kjs/JSObject.cpp:
1315         (JSC::JSObject::getPropertyNames):
1316         * kjs/PropertyMap.cpp:
1317         (JSC::PropertyMap::getEnumerablePropertyNames):
1318         * kjs/PropertyMap.h:
1319         * kjs/PropertyNameArray.cpp:
1320         (JSC::PropertyNameArray::add):
1321         * kjs/PropertyNameArray.h:
1322         (JSC::PropertyNameArray::PropertyNameArray):
1323         (JSC::PropertyNameArray::addKnownUnique):
1324         (JSC::PropertyNameArray::begin):
1325         (JSC::PropertyNameArray::end):
1326         (JSC::PropertyNameArray::size):
1327         (JSC::PropertyNameArray::operator[]):
1328         (JSC::PropertyNameArray::releaseIdentifiers):
1329         * kjs/StructureID.cpp:
1330         (JSC::StructureID::getEnumerablePropertyNames):
1331         * kjs/StructureID.h:
1332         (JSC::StructureID::clearEnumerationCache):
1333
1334 2008-09-19  Oliver Hunt  <oliver@apple.com>
1335
1336         Reviewed by Maciej Stachowiak.
1337
1338         Improve peformance of local variable initialisation.
1339
1340         Pull local and constant initialisation out of slideRegisterWindowForCall
1341         and into its own opcode.  This allows the JIT to generate the initialisation
1342         code for a function directly into the instruction stream and so avoids a few
1343         branches on function entry.
1344
1345         Results a 1% progression in SunSpider, particularly in a number of the bitop
1346         tests where the called functions are very fast. 
1347
1348         * VM/CTI.cpp:
1349         (JSC::CTI::emitInitialiseRegister):
1350         (JSC::CTI::privateCompileMainPass):
1351         * VM/CTI.h:
1352         * VM/CodeBlock.cpp:
1353         (JSC::CodeBlock::dump):
1354         * VM/CodeGenerator.cpp:
1355         (JSC::CodeGenerator::CodeGenerator):
1356         * VM/Machine.cpp:
1357         (JSC::slideRegisterWindowForCall):
1358         (JSC::Machine::privateExecute):
1359         * VM/Opcode.h:
1360
1361 2008-09-19  Sam Weinig  <sam@webkit.org>
1362
1363         Reviewed by Darin Adler.
1364
1365         Patch for https://bugs.webkit.org/show_bug.cgi?id=20928
1366         Speed up JS property enumeration by caching entire PropertyNameArray
1367
1368         1.3% speedup on Sunspider, 30% on string-fasta.
1369
1370         * JavaScriptCore.exp:
1371         * VM/JSPropertyNameIterator.cpp:
1372         (JSC::JSPropertyNameIterator::~JSPropertyNameIterator):
1373         (JSC::JSPropertyNameIterator::invalidate):
1374         * VM/JSPropertyNameIterator.h:
1375         (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
1376         (JSC::JSPropertyNameIterator::create):
1377         * kjs/JSObject.cpp:
1378         (JSC::JSObject::getPropertyNames):
1379         * kjs/PropertyMap.cpp:
1380         (JSC::PropertyMap::getEnumerablePropertyNames):
1381         * kjs/PropertyMap.h:
1382         * kjs/PropertyNameArray.cpp:
1383         (JSC::PropertyNameArray::add):
1384         * kjs/PropertyNameArray.h:
1385         (JSC::PropertyNameArrayData::create):
1386         (JSC::PropertyNameArrayData::propertyNameVector):
1387         (JSC::PropertyNameArrayData::setCachedPrototypeChain):
1388         (JSC::PropertyNameArrayData::cachedPrototypeChain):
1389         (JSC::PropertyNameArrayData::begin):
1390         (JSC::PropertyNameArrayData::end):
1391         (JSC::PropertyNameArrayData::PropertyNameArrayData):
1392         (JSC::PropertyNameArray::PropertyNameArray):
1393         (JSC::PropertyNameArray::addKnownUnique):
1394         (JSC::PropertyNameArray::size):
1395         (JSC::PropertyNameArray::operator[]):
1396         (JSC::PropertyNameArray::begin):
1397         (JSC::PropertyNameArray::end):
1398         (JSC::PropertyNameArray::setData):
1399         (JSC::PropertyNameArray::data):
1400         (JSC::PropertyNameArray::releaseData):
1401         * kjs/ScopeChain.cpp:
1402         (JSC::ScopeChainNode::print):
1403         * kjs/StructureID.cpp:
1404         (JSC::structureIDChainsAreEqual):
1405         (JSC::StructureID::getEnumerablePropertyNames):
1406         (JSC::StructureID::clearEnumerationCache):
1407         (JSC::StructureID::createCachedPrototypeChain):
1408         * kjs/StructureID.h:
1409
1410 2008-09-19  Holger Hans Peter Freyther  <zecke@selfish.org>
1411
1412         Reviewed by Maciej Stachowiak.
1413
1414         Fix a mismatched new[]/delete in JSObject::allocatePropertyStorage
1415
1416         * kjs/JSObject.cpp:
1417         (JSC::JSObject::allocatePropertyStorage): Spotted by valgrind.
1418
1419 2008-09-19  Darin Adler  <darin@apple.com>
1420
1421         Reviewed by Sam Weinig.
1422
1423         - part 2 of https://bugs.webkit.org/show_bug.cgi?id=20858
1424           make each distinct C++ class get a distinct JSC::Structure
1425
1426         * JavaScriptCore.exp: Exported constructEmptyObject for use in WebCore.
1427
1428         * kjs/JSGlobalObject.h: Changed the protected constructor to take a
1429         structure instead of a prototype.
1430
1431         * kjs/JSVariableObject.h: Removed constructor that takes a prototype.
1432
1433 2008-09-19  Julien Chaffraix  <jchaffraix@pleyo.com>
1434
1435         Reviewed by Alexey Proskuryakov.
1436
1437         Use the template hoisting technique on the RefCounted class. This reduces the code bloat due to
1438         non-template methods' code been copied for each instance of the template.
1439         The patch splits RefCounted between a base class that holds non-template methods and attributes
1440         and the template RefCounted class that keeps the same functionnality.
1441
1442         On my Linux with gcc 4.3 for the Gtk port, this is:
1443         - a ~600KB save on libwebkit.so in release.
1444         - a ~1.6MB save on libwebkit.so in debug.
1445
1446         It is a wash on Sunspider and a small win on Dromaeo (not sure it is relevant).
1447         On the whole, it should be a small win as we reduce the compiled code size and the only
1448         new function call should be inlined by the compiler.
1449
1450         * wtf/RefCounted.h:
1451         (WTF::RefCountedBase::ref): Copied from RefCounted.
1452         (WTF::RefCountedBase::hasOneRef): Ditto.
1453         (WTF::RefCountedBase::refCount): Ditto.
1454         (WTF::RefCountedBase::RefCountedBase): Ditto.
1455         (WTF::RefCountedBase::~RefCountedBase): Ditto.
1456         (WTF::RefCountedBase::derefBase): Tweaked from the RefCounted version to remove
1457         template section.
1458         (WTF::RefCounted::RefCounted):
1459         (WTF::RefCounted::deref): Small wrapper around RefCountedBase::derefBase().
1460         (WTF::RefCounted::~RefCounted): Keep private destructor.
1461
1462 2008-09-18  Darin Adler  <darin@apple.com>
1463
1464         Reviewed by Maciej Stachowiak.
1465
1466         - part 1 of https://bugs.webkit.org/show_bug.cgi?id=20858
1467           make each distinct C++ class get a distinct JSC::Structure
1468
1469         * kjs/lookup.h: Removed things here that were used only in WebCore:
1470         cacheGlobalObject, JSC_DEFINE_PROTOTYPE, JSC_DEFINE_PROTOTYPE_WITH_PROTOTYPE,
1471         and JSC_IMPLEMENT_PROTOTYPE.
1472
1473 2008-09-18  Darin Adler  <darin@apple.com>
1474
1475         Reviewed by Maciej Stachowiak.
1476
1477         - https://bugs.webkit.org/show_bug.cgi?id=20927
1478           simplify/streamline the code to turn strings into identifiers while parsing
1479
1480         * kjs/grammar.y: Get rid of string from the union, and use ident for STRING as
1481         well as for IDENT.
1482
1483         * kjs/lexer.cpp:
1484         (JSC::Lexer::lex): Use makeIdentifier instead of makeUString for String.
1485         * kjs/lexer.h: Remove makeUString.
1486
1487         * kjs/nodes.h: Changed StringNode to hold an Identifier instead of UString.
1488
1489         * VM/CodeGenerator.cpp:
1490         (JSC::keyForCharacterSwitch): Updated since StringNode now holds an Identifier.
1491         (JSC::prepareJumpTableForStringSwitch): Ditto.
1492         * kjs/nodes.cpp:
1493         (JSC::StringNode::emitCode): Ditto. The comment from here is now in the lexer.
1494         (JSC::processClauseList): Ditto.
1495         * kjs/nodes2string.cpp:
1496         (JSC::StringNode::streamTo): Ditto.
1497
1498 2008-09-18  Sam Weinig  <sam@webkit.org>
1499
1500         Fix style.
1501
1502         * VM/Instruction.h:
1503         (JSC::Instruction::Instruction):
1504
1505 2008-09-18  Oliver Hunt  <oliver@apple.com>
1506
1507         Reviewed by Maciej Stachowiak.
1508
1509         Bug 20911: REGRESSION(r36480?): Reproducible assertion failure below derefStructureIDs 64-bit JavaScriptCore
1510         <https://bugs.webkit.org/show_bug.cgi?id=20911>
1511
1512         The problem was simply caused by the int constructor for Instruction
1513         failing to initialise the full struct in 64bit builds.
1514
1515         * VM/Instruction.h:
1516         (JSC::Instruction::Instruction):
1517
1518 2008-09-18  Darin Adler  <darin@apple.com>
1519
1520         - fix release build
1521
1522         * wtf/RefCountedLeakCounter.cpp: Removed stray "static".
1523
1524 2008-09-18  Darin Adler  <darin@apple.com>
1525
1526         Reviewed by Sam Weinig.
1527
1528         * kjs/JSGlobalObject.h: Tiny style guideline tweak.
1529
1530 2008-09-18  Darin Adler  <darin@apple.com>
1531
1532         Reviewed by Sam Weinig.
1533
1534         - fix https://bugs.webkit.org/show_bug.cgi?id=20925
1535           LEAK messages appear every time I quit
1536
1537         * JavaScriptCore.exp: Updated, and also added an export
1538         needed for future WebCore use of JSC::StructureID.
1539
1540         * wtf/RefCountedLeakCounter.cpp:
1541         (WTF::RefCountedLeakCounter::suppressMessages): Added.
1542         (WTF::RefCountedLeakCounter::cancelMessageSuppression): Added.
1543         (WTF::RefCountedLeakCounter::RefCountedLeakCounter): Tweaked a bit.
1544         (WTF::RefCountedLeakCounter::~RefCountedLeakCounter): Added code to
1545         log the reason there was no leak checking done.
1546         (WTF::RefCountedLeakCounter::increment): Tweaked a bit.
1547         (WTF::RefCountedLeakCounter::decrement): Ditto.
1548
1549         * wtf/RefCountedLeakCounter.h: Replaced setLogLeakMessages with two
1550         new functions, suppressMessages and cancelMessageSuppression. Also
1551         added m_ prefixes to the data member names.
1552
1553 2008-09-18  Holger Hans Peter Freyther  <zecke@selfish.org>
1554
1555         Reviewed by Mark Rowe.
1556
1557         https://bugs.webkit.org/show_bug.cgi?id=20437
1558
1559         Add a proper #define to define which XML Parser implementation to use. Client
1560         code can use #if USE(QXMLSTREAM) to decide if the Qt XML StreamReader
1561         implementation is going to be used.
1562
1563         * wtf/Platform.h:
1564
1565 2008-09-18  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
1566
1567         Reviewed by Maciej Stachowiak.
1568
1569         Make a Unicode non-breaking space count as a whitespace character in
1570         PCRE. This change was already made in WREC, and it fixes one of the
1571         Mozilla JS tests. Since it is now fixed in PCRE as well, we can check
1572         in a new set of expected test results.
1573
1574         * pcre/pcre_internal.h:
1575         (isSpaceChar):
1576         * tests/mozilla/expected.html:
1577
1578 2008-09-18  Stephanie Lewis  <slewis@apple.com>
1579
1580         Reviewed by Mark Rowe and Maciej Stachowiak.
1581
1582         add an option use arch to specify which architecture to run.
1583
1584         * tests/mozilla/jsDriver.pl:
1585
1586 2008-09-17  Oliver Hunt  <oliver@apple.com>
1587
1588         Correctly restore argument reference prior to SFX runtime calls.
1589         
1590         Reviewed by Steve Falkenburg.
1591
1592         * VM/CTI.cpp:
1593         (JSC::CTI::privateCompileSlowCases):
1594         (JSC::CTI::privateCompile):
1595
1596 2008-09-17  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
1597
1598         Reviewed by Maciej Stachowiak.
1599
1600         Bug 20876: REGRESSION (r36417, r36427): fast/js/exception-expression-offset.html fails
1601         <https://bugs.webkit.org/show_bug.cgi?id=20876>
1602
1603         r36417 and r36427 caused an get_by_id opcode to be emitted before the
1604         instanceof and construct opcodes, in order to enable inline caching of
1605         the prototype property. Unfortunately, this regressed some tests dealing
1606         with exceptions thrown by 'instanceof' and the 'new' operator. We fix
1607         these problems by detecting whether an "is not an object" exception is
1608         thrown before op_instanceof or op_construct, and emit the proper
1609         exception in those cases.
1610
1611         * VM/CodeGenerator.cpp:
1612         (JSC::CodeGenerator::emitConstruct):
1613         * VM/CodeGenerator.h:
1614         * VM/ExceptionHelpers.cpp:
1615         (JSC::createInvalidParamError):
1616         (JSC::createNotAConstructorError):
1617         (JSC::createNotAnObjectError):
1618         * VM/ExceptionHelpers.h:
1619         * VM/Machine.cpp:
1620         (JSC::Machine::getOpcode):
1621         (JSC::Machine::privateExecute):
1622         * VM/Machine.h:
1623         * kjs/nodes.cpp:
1624         (JSC::NewExprNode::emitCode):
1625         (JSC::InstanceOfNode::emitCode):
1626
1627 2008-09-17  Gavin Barraclough  <barraclough@apple.com>
1628
1629         Reviewed by Oliver Hunt.
1630
1631         JIT generation cti_op_construct_verify.
1632         
1633         Quarter to half percent progression on v8-tests.
1634         Roughly not change on SunSpider (possible minor progression).
1635
1636         * VM/CTI.cpp:
1637         (JSC::CTI::privateCompileMainPass):
1638         * VM/Machine.cpp:
1639         * VM/Machine.h:
1640
1641 2008-09-15  Steve Falkenburg  <sfalken@apple.com>
1642
1643         Improve timer accuracy for JavaScript Date object on Windows.
1644         
1645         Use a combination of ftime and QueryPerformanceCounter.
1646         ftime returns the information we want, but doesn't have sufficient resolution.
1647         QueryPerformanceCounter has high resolution, but is only usable to measure time intervals.
1648         To combine them, we call ftime and QueryPerformanceCounter initially. Later calls will use
1649         QueryPerformanceCounter by itself, adding the delta to the saved ftime.  We re-sync to
1650         correct for drift if the low-res and high-res elapsed time between calls differs by more
1651         than twice the low-resolution timer resolution.
1652         
1653         QueryPerformanceCounter may be inaccurate due to a problems with:
1654         - some PCI bridge chipsets (http://support.microsoft.com/kb/274323)
1655         - BIOS bugs (http://support.microsoft.com/kb/895980/)
1656         - BIOS/HAL bugs on multiprocessor/multicore systems (http://msdn.microsoft.com/en-us/library/ms644904.aspx)
1657         
1658         Reviewed by Darin Adler.
1659
1660         * kjs/DateMath.cpp:
1661         (JSC::highResUpTime):
1662         (JSC::lowResUTCTime):
1663         (JSC::qpcAvailable):
1664         (JSC::getCurrentUTCTimeWithMicroseconds):
1665
1666 2008-09-17  Gavin Barraclough  <barraclough@apple.com>
1667
1668         Reviewed by Geoff Garen.
1669
1670         Implement JIT generation of CallFrame initialization, for op_call.
1671
1672         1% sunspider 2.5% v8-tests.
1673
1674         * VM/CTI.cpp:
1675         (JSC::CTI::compileOpCall):
1676         * VM/Machine.cpp:
1677         (JSC::Machine::cti_op_call_JSFunction):
1678         (JSC::Machine::cti_op_call_NotJSFunction):
1679
1680 2008-09-17  Gavin Barraclough  <barraclough@apple.com>
1681
1682         Reviewed by Geoff Garen.
1683
1684         Optimizations for op_call in CTI.  Move check for (ctiCode == 0) into JIT code,
1685         move copying of scopeChain for CodeBlocks that needFullScopeChain into head of
1686         functions, instead of checking prior to making the call.
1687
1688         3% on v8-tests (4% on richards, 6% in delta-blue)
1689
1690         * VM/CTI.cpp:
1691         (JSC::CTI::compileOpCall):
1692         (JSC::CTI::privateCompileSlowCases):
1693         (JSC::CTI::privateCompile):
1694         * VM/Machine.cpp:
1695         (JSC::Machine::execute):
1696         (JSC::Machine::cti_op_call_JSFunction):
1697         (JSC::Machine::cti_vm_compile):
1698         (JSC::Machine::cti_vm_updateScopeChain):
1699         (JSC::Machine::cti_op_construct_JSConstruct):
1700         * VM/Machine.h:
1701
1702 2008-09-17  Tor Arne Vestbø  <tavestbo@trolltech.com>
1703
1704         Fix the QtWebKit/Mac build
1705
1706         * wtf/ThreadingQt.cpp:
1707         (WTF::initializeThreading): use QCoreApplication to get the main thread
1708
1709 2008-09-16  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
1710
1711         Reviewed by Maciej Stachowiak.
1712
1713         Bug 20857: REGRESSION (r36427): ASSERTION FAILED: m_refCount >= 0 in RegisterID::deref()
1714         <https://bugs.webkit.org/show_bug.cgi?id=20857>
1715
1716         Fix a problem stemming from the slightly unsafe behaviour of the
1717         CodeGenerator::finalDestination() method by putting the "func" argument
1718         of the emitConstruct() method in a RefPtr in its caller. Also, add an
1719         assertion guaranteeing that this is always the case.
1720
1721         CodeGenerator::finalDestination() is still incorrect and can cause
1722         problems with a different allocator; see bug 20340 for more details.
1723
1724         * VM/CodeGenerator.cpp:
1725         (JSC::CodeGenerator::emitConstruct):
1726         * kjs/nodes.cpp:
1727         (JSC::NewExprNode::emitCode):
1728
1729 2008-09-16  Alice Liu  <alice.liu@apple.com>
1730
1731         build fix.
1732
1733         * VM/CTI.cpp:
1734         (JSC::CTI::privateCompileMainPass):
1735
1736 2008-09-16  Gavin Barraclough  <barraclough@apple.com>
1737
1738         Reviewed by Geoff Garen.
1739
1740         CTI code generation for op_ret.  The majority of the work
1741         (updating variables on the stack & on exec) can be performed
1742         directly in generated code.
1743
1744         We still need to check, & to call out to C-code to handle
1745         activation records, profiling, and full scope chains.
1746
1747         +1.5% Sunspider, +5/6% v8 tests.
1748
1749         * VM/CTI.cpp:
1750         (JSC::CTI::emitPutCTIParam):
1751         (JSC::CTI::compileOpCall):
1752         (JSC::CTI::privateCompileMainPass):
1753         * VM/CTI.h:
1754         * VM/Machine.cpp:
1755         (JSC::Machine::cti_op_ret_activation):
1756         (JSC::Machine::cti_op_ret_profiler):
1757         (JSC::Machine::cti_op_ret_scopeChain):
1758         * VM/Machine.h:
1759
1760 2008-09-16  Dimitri Glazkov  <dglazkov@chromium.org>
1761
1762         Fix the Windows build.
1763
1764         Add some extra parentheses to stop MSVC from complaining so much.
1765
1766         * VM/Machine.cpp:
1767         (JSC::Machine::privateExecute):
1768         (JSC::Machine::cti_op_stricteq):
1769         (JSC::Machine::cti_op_nstricteq):
1770         * kjs/operations.cpp:
1771         (JSC::strictEqual):
1772
1773 2008-09-15  Maciej Stachowiak  <mjs@apple.com>
1774
1775         Reviewed by Cameron Zwarich.
1776         
1777         - speed up the === and !== operators by choosing the fast cases better
1778         
1779         No effect on SunSpider but speeds up the V8 EarlyBoyer benchmark about 4%.
1780
1781         * VM/Machine.cpp:
1782         (JSC::Machine::privateExecute):
1783         (JSC::Machine::cti_op_stricteq):
1784         (JSC::Machine::cti_op_nstricteq):
1785         * kjs/JSImmediate.h:
1786         (JSC::JSImmediate::areBothImmediate):
1787         * kjs/operations.cpp:
1788         (JSC::strictEqual):
1789         (JSC::strictEqualSlowCase):
1790         * kjs/operations.h:
1791
1792 2008-09-15  Oliver Hunt  <oliver@apple.com>
1793
1794         RS=Sam Weinig.
1795
1796         Coding style cleanup.
1797
1798         * VM/Machine.cpp:
1799         (JSC::Machine::privateExecute):
1800
1801 2008-09-15  Oliver Hunt  <oliver@apple.com>
1802
1803         Reviewed by Cameron Zwarich.
1804
1805         Bug 20874: op_resolve does not do any form of caching
1806         <https://bugs.webkit.org/show_bug.cgi?id=20874>
1807
1808         This patch adds an op_resolve_global opcode to handle (and cache)
1809         property lookup we can statically determine must occur on the global
1810         object (if at all).
1811
1812         3% progression on sunspider, 3.2x improvement to bitops-bitwise-and, and
1813         10% in math-partial-sums
1814
1815         * VM/CTI.cpp:
1816         (JSC::CTI::privateCompileMainPass):
1817         * VM/CTI.h:
1818         * VM/CodeBlock.cpp:
1819         (JSC::CodeBlock::dump):
1820         * VM/CodeGenerator.cpp:
1821         (JSC::CodeGenerator::findScopedProperty):
1822         (JSC::CodeGenerator::emitResolve):
1823         * VM/Machine.cpp:
1824         (JSC::resolveGlobal):
1825         (JSC::Machine::privateExecute):
1826         (JSC::Machine::cti_op_resolve_global):
1827         * VM/Machine.h:
1828         * VM/Opcode.h:
1829
1830 2008-09-15  Sam Weinig  <sam@webkit.org>
1831
1832         Roll out r36462.  It broke document.all.
1833
1834         * VM/CTI.cpp:
1835         (JSC::CTI::privateCompileMainPass):
1836         (JSC::CTI::privateCompileSlowCases):
1837         * VM/CTI.h:
1838         * VM/Machine.cpp:
1839         (JSC::Machine::Machine):
1840         (JSC::Machine::cti_op_eq_null):
1841         (JSC::Machine::cti_op_neq_null):
1842         * VM/Machine.h:
1843         (JSC::Machine::isJSString):
1844         * kjs/JSCell.h:
1845         * kjs/JSWrapperObject.h:
1846         * kjs/StringObject.h:
1847         * kjs/StringObjectThatMasqueradesAsUndefined.h:
1848
1849 2008-09-15  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
1850
1851         Reviewed by Maciej Stachowiak.
1852
1853         Bug 20863: ASSERTION FAILED: addressOffset < instructions.size() in CodeBlock::getHandlerForVPC
1854         <https://bugs.webkit.org/show_bug.cgi?id=20863>
1855
1856         r36427 changed the number of arguments to op_construct without changing
1857         the argument index for the vPC in the call to initializeCallFrame() in
1858         the CTI case. This caused a JSC test failure. Correcting the argument
1859         index fixes the test failure.
1860
1861         * VM/Machine.cpp:
1862         (JSC::Machine::cti_op_construct_JSConstruct):
1863
1864 2008-09-15  Mark Rowe  <mrowe@apple.com>
1865
1866         Fix GCC 4.2 build.
1867
1868         * VM/CTI.h:
1869
1870 2008-09-15  Geoffrey Garen  <ggaren@apple.com>
1871
1872         Reviewed by Maciej Stachowiak.
1873         
1874         Fixed a typo in op_get_by_id_chain that caused it to miss every time
1875         in the interpreter.
1876         
1877         Also, a little cleanup.
1878
1879         * VM/Machine.cpp:
1880         (JSC::Machine::privateExecute): Set up baseObject before entering the
1881         loop, so we compare against the right values.
1882
1883 2008-09-15  Geoffrey Garen  <ggaren@apple.com>
1884
1885         Reviewed by Sam Weinig.
1886         
1887         Removed the CalledAsConstructor flag from the call frame header. Now,
1888         we use an explicit opcode at the call site to fix up constructor results.
1889
1890         SunSpider says 0.4% faster.
1891         
1892         cti_op_construct_verify is an out-of-line function call for now, but we
1893         can fix that once StructureID holds type information like isObject.
1894
1895         * VM/CTI.cpp:
1896         (JSC::CTI::privateCompileMainPass): Codegen for the new opcode.
1897
1898         * VM/CodeBlock.cpp:
1899         (JSC::CodeBlock::dump):
1900
1901         * VM/CodeGenerator.cpp: Codegen for the new opcode. Also...
1902         (JSC::CodeGenerator::emitCall): ... don't test for known non-zero value.
1903         (JSC::CodeGenerator::emitConstruct): ... ditto.
1904
1905         * VM/Machine.cpp: No more CalledAsConstructor
1906         (JSC::Machine::privateExecute): Implementation for the new opcode.
1907         (JSC::Machine::cti_op_ret): The speedup: no need to check whether we were
1908         called as a constructor.
1909         (JSC::Machine::cti_op_construct_verify): Implementation for the new opcode.
1910         * VM/Machine.h:
1911
1912         * VM/Opcode.h: Declare new opcode.
1913
1914         * VM/RegisterFile.h:
1915         (JSC::RegisterFile::): No more CalledAsConstructor
1916
1917 2008-09-15  Gavin Barraclough  <barraclough@apple.com>
1918
1919         Reviewed by Geoff Garen.
1920
1921         Inline code generation of eq_null/neq_null for CTI.  Uses vptr checking for
1922         StringObjectsThatAreMasqueradingAsBeingUndefined.  In the long run, the
1923         masquerading may be handled differently (through the StructureIDs - see bug
1924         #20823).
1925
1926         >1% on v8-tests.
1927
1928         * VM/CTI.cpp:
1929         (JSC::CTI::emitJumpSlowCaseIfIsJSCell):
1930         (JSC::CTI::privateCompileMainPass):
1931         (JSC::CTI::privateCompileSlowCases):
1932         * VM/CTI.h:
1933         * VM/Machine.cpp:
1934         (JSC::Machine::Machine):
1935         (JSC::Machine::cti_op_eq_null):
1936         (JSC::Machine::cti_op_neq_null):
1937         * VM/Machine.h:
1938         (JSC::Machine::doesMasqueradesAsUndefined):
1939         * kjs/JSWrapperObject.h:
1940         (JSC::JSWrapperObject::):
1941         (JSC::JSWrapperObject::JSWrapperObject):
1942         * kjs/StringObject.h:
1943         (JSC::StringObject::StringObject):
1944         * kjs/StringObjectThatMasqueradesAsUndefined.h:
1945         (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
1946
1947 2008-09-15  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
1948
1949         Rubber-stamped by Oliver Hunt.
1950
1951         r36427 broke CodeBlock::dump() by changing the number of arguments to
1952         op_construct without changing the code that prints it. This patch fixes
1953         it by printing the additional argument.
1954
1955         * JavaScriptCore.xcodeproj/project.pbxproj:
1956         * VM/CodeBlock.cpp:
1957         (JSC::CodeBlock::dump):
1958
1959 2008-09-15  Adam Roben  <aroben@apple.com>
1960
1961         Build fix
1962
1963         * kjs/StructureID.cpp: Removed a stray semicolon.
1964
1965 2008-09-15  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
1966
1967         Reviewed by Maciej Stachowiak.
1968
1969         Fix a crash in fast/js/exception-expression-offset.html caused by not
1970         updating all mentions of the length of op_construct in r36427.
1971
1972         * VM/Machine.cpp:
1973         (JSC::Machine::cti_op_construct_NotJSConstruct):
1974
1975 2008-09-15  Maciej Stachowiak  <mjs@apple.com>
1976
1977         Reviewed by Cameron Zwarich.
1978         
1979         - fix layout test failure introduced by fix for 20849
1980         
1981         (The failing test was fast/js/delete-then-put.html)
1982
1983         * kjs/JSObject.cpp:
1984         (JSC::JSObject::removeDirect): Clear enumeration cache
1985         in the dictionary case.
1986         * kjs/JSObject.h:
1987         (JSC::JSObject::putDirect): Ditto.
1988         * kjs/StructureID.h:
1989         (JSC::StructureID::clearEnumerationCache): Inline to handle the
1990         clear.
1991
1992 2008-09-15  Maciej Stachowiak  <mjs@apple.com>
1993
1994         Reviewed by Cameron Zwarich.
1995         
1996         - fix JSC test failures introduced by fix for 20849
1997
1998         * kjs/PropertyMap.cpp:
1999         (JSC::PropertyMap::getEnumerablePropertyNames): Use the correct count.
2000
2001 2008-09-15  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2002
2003         Reviewed by Maciej Stachowiak.
2004
2005         Bug 20851: REGRESSION (r36410): fast/js/kde/GlobalObject.html fails
2006         <https://bugs.webkit.org/show_bug.cgi?id=20851>
2007
2008         r36410 introduced an optimization for parseInt() that is incorrect when
2009         its argument is larger than the range of a 32-bit integer. If the
2010         argument is a number that is not an immediate integer, then the correct
2011         behaviour is to return the floor of its value, unless it is an infinite
2012         value, in which case the correct behaviour is to return 0.
2013
2014         * kjs/JSGlobalObjectFunctions.cpp:
2015         (JSC::globalFuncParseInt):
2016
2017 2008-09-15  Sam Weinig  <sam@webkit.org>
2018
2019         Reviewed by Maciej Stachowiak.
2020
2021         Patch for https://bugs.webkit.org/show_bug.cgi?id=20849
2022         Cache property names for getEnumerablePropertyNames in the StructureID.
2023
2024         ~0.5% speedup on Sunspider overall (9.7% speedup on string-fasta).  ~1% speedup
2025         on the v8 test suite.
2026
2027         * kjs/JSObject.cpp:
2028         (JSC::JSObject::getPropertyNames):
2029         * kjs/PropertyMap.cpp:
2030         (JSC::PropertyMap::getEnumerablePropertyNames):
2031         * kjs/PropertyMap.h:
2032         * kjs/StructureID.cpp:
2033         (JSC::StructureID::StructureID):
2034         (JSC::StructureID::getEnumerablePropertyNames):
2035         * kjs/StructureID.h:
2036
2037 2008-09-14  Maciej Stachowiak  <mjs@apple.com>
2038
2039         Reviewed by Cameron Zwarich.
2040         
2041         - speed up JS construction by extracting "prototype" lookup so PIC applies.
2042         
2043         ~0.5% speedup on SunSpider
2044         Speeds up some of the V8 tests as well, most notably earley-boyer.
2045
2046         * VM/CTI.cpp:
2047         (JSC::CTI::compileOpCall): Account for extra arg for prototype.
2048         (JSC::CTI::privateCompileMainPass): Account for increased size of op_construct.
2049         * VM/CodeGenerator.cpp:
2050         (JSC::CodeGenerator::emitConstruct): Emit separate lookup to get prototype property.
2051         * VM/Machine.cpp:
2052         (JSC::Machine::privateExecute): Expect prototype arg in op_construct.
2053         (JSC::Machine::cti_op_construct_JSConstruct): ditto
2054         (JSC::Machine::cti_op_construct_NotJSConstruct): ditto
2055
2056 2008-09-10  Alexey Proskuryakov  <ap@webkit.org>
2057
2058         Reviewed by Eric Seidel.
2059
2060         Add a protected destructor for RefCounted.
2061
2062         It is wrong to call its destructor directly, because (1) this should be taken care of by
2063         deref(), and (2) many classes that use RefCounted have non-virtual destructors.
2064
2065         No change in behavior.
2066
2067         * wtf/RefCounted.h: (WTF::RefCounted::~RefCounted):
2068
2069 2008-09-14  Gavin Barraclough  <barraclough@apple.com>
2070
2071         Reviewed by Sam Weinig.
2072
2073         Accelerated property accesses.
2074
2075         Inline more of the array access code into the JIT code for get/put_by_val.
2076         Accelerate get/put_by_id by speculatively inlining a disable direct access
2077         into the hot path of the code, and repatch this with the correct StructureID
2078         and property map offset once these are known.  In the case of accesses to the
2079         prototype and reading the array-length a trampoline is genertaed, and the
2080         branch to the slow-case is relinked to jump to this.
2081
2082         By repatching, we mean rewriting the x86 instruction stream.  Instructions are
2083         only modified in a simple fasion - altering immediate operands, memory access
2084         deisplacements, and branch offsets.
2085         
2086         For regular get_by_id/put_by_id accesses to an object, a StructureID in an
2087         instruction's immediate operant is updateded, and a memory access operation's
2088         displacement is updated to access the correct field on the object.  In the case
2089         of more complex accesses (array length and get_by_id_prototype) the offset on
2090         the branch to slow-case is updated, to now jump to a trampoline.
2091
2092         +2.8% sunspider, +13% v8-tests
2093
2094         * VM/CTI.cpp:
2095         (JSC::CTI::emitCall):
2096         (JSC::CTI::emitJumpSlowCaseIfNotJSCell):
2097         (JSC::CTI::CTI):
2098         (JSC::CTI::privateCompileMainPass):
2099         (JSC::CTI::privateCompileSlowCases):
2100         (JSC::CTI::privateCompile):
2101         (JSC::CTI::privateCompileGetByIdSelf):
2102         (JSC::CTI::privateCompileGetByIdProto):
2103         (JSC::CTI::privateCompileGetByIdChain):
2104         (JSC::CTI::privateCompilePutByIdReplace):
2105         (JSC::CTI::privateCompilePutByIdTransition):
2106         (JSC::CTI::privateCompileArrayLengthTrampoline):
2107         (JSC::CTI::privateCompileStringLengthTrampoline):
2108         (JSC::CTI::patchGetByIdSelf):
2109         (JSC::CTI::patchPutByIdReplace):
2110         (JSC::CTI::privateCompilePatchGetArrayLength):
2111         (JSC::CTI::privateCompilePatchGetStringLength):
2112         * VM/CTI.h:
2113         (JSC::CTI::compileGetByIdSelf):
2114         (JSC::CTI::compileGetByIdProto):
2115         (JSC::CTI::compileGetByIdChain):
2116         (JSC::CTI::compilePutByIdReplace):
2117         (JSC::CTI::compilePutByIdTransition):
2118         (JSC::CTI::compileArrayLengthTrampoline):
2119         (JSC::CTI::compileStringLengthTrampoline):
2120         (JSC::CTI::compilePatchGetArrayLength):
2121         (JSC::CTI::compilePatchGetStringLength):
2122         * VM/CodeBlock.cpp:
2123         (JSC::CodeBlock::dump):
2124         (JSC::CodeBlock::~CodeBlock):
2125         * VM/CodeBlock.h:
2126         (JSC::StructureStubInfo::StructureStubInfo):
2127         (JSC::CodeBlock::getStubInfo):
2128         * VM/Machine.cpp:
2129         (JSC::Machine::tryCTICachePutByID):
2130         (JSC::Machine::tryCTICacheGetByID):
2131         (JSC::Machine::cti_op_put_by_val_array):
2132         * VM/Machine.h:
2133         * masm/X86Assembler.h:
2134         (JSC::X86Assembler::):
2135         (JSC::X86Assembler::cmpl_i8m):
2136         (JSC::X86Assembler::emitUnlinkedJa):
2137         (JSC::X86Assembler::getRelocatedAddress):
2138         (JSC::X86Assembler::getDifferenceBetweenLabels):
2139         (JSC::X86Assembler::emitModRm_opmsib):
2140
2141 2008-09-14  Maciej Stachowiak  <mjs@apple.com>
2142
2143         Reviewed by Cameron Zwarich.
2144         
2145         - split the "prototype" lookup for hasInstance into opcode stream so it can be cached
2146         
2147         ~5% speedup on v8 earley-boyer test
2148
2149         * API/JSCallbackObject.h: Add a parameter for the pre-looked-up prototype.
2150         * API/JSCallbackObjectFunctions.h:
2151         (JSC::::hasInstance): Ditto.
2152         * API/JSValueRef.cpp:
2153         (JSValueIsInstanceOfConstructor): Look up and pass in prototype.
2154         * JavaScriptCore.exp:
2155         * VM/CTI.cpp:
2156         (JSC::CTI::privateCompileMainPass): Pass along prototype.
2157         * VM/CodeBlock.cpp:
2158         (JSC::CodeBlock::dump): Print third arg.
2159         * VM/CodeGenerator.cpp:
2160         (JSC::CodeGenerator::emitInstanceOf): Implement this, now that there
2161         is a third argument.
2162         * VM/CodeGenerator.h:
2163         * VM/Machine.cpp:
2164         (JSC::Machine::privateExecute): Pass along the prototype.
2165         (JSC::Machine::cti_op_instanceof): ditto
2166         * kjs/JSObject.cpp:
2167         (JSC::JSObject::hasInstance): Expect to get a pre-looked-up prototype.
2168         * kjs/JSObject.h:
2169         * kjs/nodes.cpp:
2170         (JSC::InstanceOfNode::emitCode): Emit a get_by_id of the prototype
2171         property and pass that register to instanceof.
2172         * kjs/nodes.h:
2173
2174 2008-09-14  Gavin Barraclough  <barraclough@apple.com>
2175
2176         Reviewed by Sam Weinig.
2177
2178         Remove unnecessary virtual function call from cti_op_call_JSFunction -
2179         ~5% on richards, ~2.5% on v8-tests, ~0.5% on sunspider.
2180
2181         * VM/Machine.cpp:
2182         (JSC::Machine::cti_op_call_JSFunction):
2183
2184 2008-09-14  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2185
2186         Reviewed by Maciej Stachowiak.
2187
2188         Bug 20827: the 'typeof' operator is slow
2189         <https://bugs.webkit.org/show_bug.cgi?id=20827>
2190
2191         Optimize the 'typeof' operator when its result is compared to a constant
2192         string.
2193
2194         This is a 5.5% speedup on the V8 Earley-Boyer test.
2195
2196         * VM/CTI.cpp:
2197         (JSC::CTI::privateCompileMainPass):
2198         * VM/CodeBlock.cpp:
2199         (JSC::CodeBlock::dump):
2200         * VM/CodeGenerator.cpp:
2201         (JSC::CodeGenerator::emitEqualityOp):
2202         * VM/CodeGenerator.h:
2203         * VM/Machine.cpp:
2204         (JSC::jsIsObjectType):
2205         (JSC::jsIsFunctionType):
2206         (JSC::Machine::privateExecute):
2207         (JSC::Machine::cti_op_is_undefined):
2208         (JSC::Machine::cti_op_is_boolean):
2209         (JSC::Machine::cti_op_is_number):
2210         (JSC::Machine::cti_op_is_string):
2211         (JSC::Machine::cti_op_is_object):
2212         (JSC::Machine::cti_op_is_function):
2213         * VM/Machine.h:
2214         * VM/Opcode.h:
2215         * kjs/nodes.cpp:
2216         (JSC::BinaryOpNode::emitCode):
2217         (JSC::EqualNode::emitCode):
2218         (JSC::StrictEqualNode::emitCode):
2219         * kjs/nodes.h:
2220
2221 2008-09-14  Sam Weinig  <sam@webkit.org>
2222
2223         Reviewed by Cameron Zwarich.
2224
2225         Patch for https://bugs.webkit.org/show_bug.cgi?id=20844
2226         Speed up parseInt for numbers
2227
2228         Sunspider reports this as 1.029x as fast overall and 1.37x as fast on string-unpack-code.
2229         No change on the v8 suite.
2230
2231         * kjs/JSGlobalObjectFunctions.cpp:
2232         (JSC::globalFuncParseInt): Don't convert numbers to strings just to
2233         convert them back to numbers.
2234
2235 2008-09-14  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2236
2237         Reviewed by Oliver Hunt.
2238
2239         Bug 20816: op_lesseq should be optimized
2240         <https://bugs.webkit.org/show_bug.cgi?id=20816>
2241
2242         Add a loop_if_lesseq opcode that is similar to the loop_if_less opcode.
2243
2244         This is a 9.4% speedup on the V8 Crypto benchmark.
2245
2246         * VM/CTI.cpp:
2247         (JSC::CTI::privateCompileMainPass):
2248         (JSC::CTI::privateCompileSlowCases):
2249         * VM/CodeBlock.cpp:
2250         (JSC::CodeBlock::dump):
2251         * VM/CodeGenerator.cpp:
2252         (JSC::CodeGenerator::emitJumpIfTrue):
2253         * VM/Machine.cpp:
2254         (JSC::Machine::privateExecute):
2255         (JSC::Machine::cti_op_loop_if_lesseq):
2256         * VM/Machine.h:
2257         * VM/Opcode.h:
2258
2259 2008-09-14  Sam Weinig  <sam@webkit.org>
2260
2261         Reviewed by Cameron Zwarich.
2262
2263         Cleanup Sampling code.
2264
2265         * VM/CTI.cpp:
2266         (JSC::CTI::emitCall):
2267         (JSC::CTI::privateCompileMainPass):
2268         * VM/CTI.h:
2269         (JSC::CTI::execute):
2270         * VM/SamplingTool.cpp:
2271         (JSC::):
2272         (JSC::SamplingTool::run):
2273         (JSC::SamplingTool::dump):
2274         * VM/SamplingTool.h:
2275         (JSC::SamplingTool::callingHostFunction):
2276
2277 2008-09-13  Oliver Hunt  <oliver@apple.com>
2278
2279         Reviewed by Cameron Zwarich.
2280
2281         Bug 20821: Cache property transitions to speed up object initialization
2282         https://bugs.webkit.org/show_bug.cgi?id=20821
2283
2284         Implement a transition cache to improve the performance of new properties
2285         being added to objects.  This is extremely beneficial in constructors and
2286         shows up as a 34% improvement on access-binary-trees in SunSpider (0.8%
2287         overall)
2288
2289         * VM/CTI.cpp:
2290         (JSC::CTI::privateCompileMainPass):
2291         (JSC::):
2292         (JSC::transitionWillNeedStorageRealloc):
2293         (JSC::CTI::privateCompilePutByIdTransition):
2294         * VM/CTI.h:
2295         (JSC::CTI::compilePutByIdTransition):
2296         * VM/CodeBlock.cpp:
2297         (JSC::printPutByIdOp):
2298         (JSC::CodeBlock::printStructureIDs):
2299         (JSC::CodeBlock::dump):
2300         (JSC::CodeBlock::derefStructureIDs):
2301         (JSC::CodeBlock::refStructureIDs):
2302         * VM/CodeGenerator.cpp:
2303         (JSC::CodeGenerator::emitPutById):
2304         * VM/Machine.cpp:
2305         (JSC::cachePrototypeChain):
2306         (JSC::Machine::tryCachePutByID):
2307         (JSC::Machine::tryCacheGetByID):
2308         (JSC::Machine::privateExecute):
2309         (JSC::Machine::tryCTICachePutByID):
2310         (JSC::Machine::tryCTICacheGetByID):
2311         * VM/Machine.h:
2312         * VM/Opcode.h:
2313         * kjs/JSObject.h:
2314         (JSC::JSObject::putDirect):
2315         (JSC::JSObject::transitionTo):
2316         * kjs/PutPropertySlot.h:
2317         (JSC::PutPropertySlot::PutPropertySlot):
2318         (JSC::PutPropertySlot::wasTransition):
2319         (JSC::PutPropertySlot::setWasTransition):
2320         * kjs/StructureID.cpp:
2321         (JSC::StructureID::transitionTo):
2322         (JSC::StructureIDChain::StructureIDChain):
2323         * kjs/StructureID.h:
2324         (JSC::StructureID::previousID):
2325         (JSC::StructureID::setCachedPrototypeChain):
2326         (JSC::StructureID::cachedPrototypeChain):
2327         (JSC::StructureID::propertyMap):
2328         * masm/X86Assembler.h:
2329         (JSC::X86Assembler::addl_i8m):
2330         (JSC::X86Assembler::subl_i8m):
2331
2332 2008-09-12  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2333
2334         Reviewed by Maciej Stachowiak.
2335
2336         Bug 20819: JSValue::isObject() is slow
2337         <https://bugs.webkit.org/show_bug.cgi?id=20819>
2338
2339         Optimize JSCell::isObject() and JSCell::isString() by making them
2340         non-virtual calls that rely on the StructureID type information.
2341
2342         This is a 0.7% speedup on SunSpider and a 1.0% speedup on the V8
2343         benchmark suite.
2344
2345         * JavaScriptCore.exp:
2346         * kjs/JSCell.cpp:
2347         * kjs/JSCell.h:
2348         (JSC::JSCell::isObject):
2349         (JSC::JSCell::isString):
2350         * kjs/JSObject.cpp:
2351         * kjs/JSObject.h:
2352         * kjs/JSString.cpp:
2353         * kjs/JSString.h:
2354         (JSC::JSString::JSString):
2355         * kjs/StructureID.h:
2356         (JSC::StructureID::type):
2357
2358 2008-09-11  Stephanie Lewis  <slewis@apple.com>
2359
2360         Reviewed by Oliver Hunt.
2361
2362         Turn off PGO Optimization on CTI.cpp -> <rdar://problem/6207709>.  Fixes
2363         crash on CNN and on Dromaeo.
2364         Fix Missing close tag in vcproj. 
2365
2366         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2367
2368 2008-09-11  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2369
2370         Not reviewed.
2371
2372         Correct an SVN problem with the last commit and actually add the new
2373         files.
2374
2375         * wrec/CharacterClassConstructor.cpp: Added.
2376         (JSC::):
2377         (JSC::getCharacterClassNewline):
2378         (JSC::getCharacterClassDigits):
2379         (JSC::getCharacterClassSpaces):
2380         (JSC::getCharacterClassWordchar):
2381         (JSC::getCharacterClassNondigits):
2382         (JSC::getCharacterClassNonspaces):
2383         (JSC::getCharacterClassNonwordchar):
2384         (JSC::CharacterClassConstructor::addSorted):
2385         (JSC::CharacterClassConstructor::addSortedRange):
2386         (JSC::CharacterClassConstructor::put):
2387         (JSC::CharacterClassConstructor::flush):
2388         (JSC::CharacterClassConstructor::append):
2389         * wrec/CharacterClassConstructor.h: Added.
2390         (JSC::CharacterClassConstructor::CharacterClassConstructor):
2391         (JSC::CharacterClassConstructor::isUpsideDown):
2392         (JSC::CharacterClassConstructor::charClass):
2393
2394 2008-09-11  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2395
2396         Reviewed by Maciej Stachowiak.
2397
2398         Bug 20788: Split CharacterClassConstructor into its own file
2399         <https://bugs.webkit.org/show_bug.cgi?id=20788>
2400
2401         Split CharacterClassConstructor into its own file and clean up some
2402         style issues.
2403
2404         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2405         * JavaScriptCore.xcodeproj/project.pbxproj:
2406         * wrec/CharacterClassConstructor.cpp: Added.
2407         (JSC::):
2408         (JSC::getCharacterClassNewline):
2409         (JSC::getCharacterClassDigits):
2410         (JSC::getCharacterClassSpaces):
2411         (JSC::getCharacterClassWordchar):
2412         (JSC::getCharacterClassNondigits):
2413         (JSC::getCharacterClassNonspaces):
2414         (JSC::getCharacterClassNonwordchar):
2415         (JSC::CharacterClassConstructor::addSorted):
2416         (JSC::CharacterClassConstructor::addSortedRange):
2417         (JSC::CharacterClassConstructor::put):
2418         (JSC::CharacterClassConstructor::flush):
2419         (JSC::CharacterClassConstructor::append):
2420         * wrec/CharacterClassConstructor.h: Added.
2421         (JSC::CharacterClassConstructor::CharacterClassConstructor):
2422         (JSC::CharacterClassConstructor::isUpsideDown):
2423         (JSC::CharacterClassConstructor::charClass):
2424         * wrec/WREC.cpp:
2425         (JSC::WRECParser::parseCharacterClass):
2426
2427 2008-09-10  Simon Hausmann  <hausmann@webkit.org>
2428
2429         Not reviewed but trivial one-liner for yet unused macro.
2430
2431         Changed PLATFORM(WINCE) to PLATFORM(WIN_CE) as requested by Mark.
2432
2433         (part of https://bugs.webkit.org/show_bug.cgi?id=20746)
2434
2435         * wtf/Platform.h:
2436
2437 2008-09-10  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2438
2439         Rubber-stamped by Oliver Hunt.
2440
2441         Fix a typo by renaming the overloaded orl_rr that takes an immediate to
2442         orl_i32r.
2443
2444         * VM/CTI.cpp:
2445         (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
2446         * masm/X86Assembler.h:
2447         (JSC::X86Assembler::orl_i32r):
2448         * wrec/WREC.cpp:
2449         (JSC::WRECGenerator::generatePatternCharacter):
2450         (JSC::WRECGenerator::generateCharacterClassInverted):
2451
2452 2008-09-10  Sam Weinig  <sam@webkit.org>
2453
2454         Reviewed by Geoff Garen.
2455
2456         Add inline property storage for JSObject.
2457
2458         1.2% progression on Sunspider. .5% progression on the v8 test suite.
2459
2460         * JavaScriptCore.exp:
2461         * VM/CTI.cpp:
2462         (JSC::CTI::privateCompileGetByIdProto):
2463         (JSC::CTI::privateCompileGetByIdChain):
2464         * kjs/JSObject.cpp:
2465         (JSC::JSObject::mark): There is no reason to check storageSize now that
2466         we start from 0.
2467         (JSC::JSObject::allocatePropertyStorage): Allocates/reallocates heap storage.
2468         * kjs/JSObject.h:
2469         (JSC::JSObject::offsetForLocation): m_propertyStorage is not an OwnArrayPtr
2470         now so there is no reason to .get()
2471         (JSC::JSObject::usingInlineStorage):
2472         (JSC::JSObject::JSObject): Start with m_propertyStorage pointing to the
2473         inline storage.
2474         (JSC::JSObject::~JSObject): Free the heap storage if not using the inline
2475         storage.
2476         (JSC::JSObject::putDirect): Switch to the heap storage only when we know
2477         we know that we are about to add a property that will overflow the inline
2478         storage.
2479         * kjs/PropertyMap.cpp:
2480         (JSC::PropertyMap::createTable): Don't allocate the propertyStorage, that is
2481         now handled by JSObject.
2482         (JSC::PropertyMap::rehash): PropertyStorage is not a OwnArrayPtr anymore.
2483         * kjs/PropertyMap.h:
2484         (JSC::PropertyMap::storageSize): Rename from markingCount.
2485         * kjs/StructureID.cpp:
2486         (JSC::StructureID::addPropertyTransition): Don't resize the property storage
2487         if we are using inline storage.
2488         * kjs/StructureID.h:
2489
2490 2008-09-10  Oliver Hunt  <oliver@apple.com>
2491
2492         Reviewed by Geoff Garen.
2493
2494         Inline immediate number version of op_mul.
2495
2496         Renamed mull_rr to imull_rr as that's what it's 
2497         actually doing, and added imull_i32r for the constant
2498         case immediate multiply.
2499
2500         1.1% improvement to SunSpider.
2501
2502         * VM/CTI.cpp:
2503         (JSC::CTI::privateCompileMainPass):
2504         (JSC::CTI::privateCompileSlowCases):
2505         * masm/X86Assembler.h:
2506         (JSC::X86Assembler::):
2507         (JSC::X86Assembler::imull_rr):
2508         (JSC::X86Assembler::imull_i32r):
2509
2510 2008-09-10  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2511
2512         Not reviewed.
2513
2514         Mac build fix.
2515
2516         * JavaScriptCore.xcodeproj/project.pbxproj:
2517
2518 2008-09-09  Oliver Hunt  <oliver@apple.com>
2519
2520         Reviewed by Maciej Stachowiak.
2521
2522         Add optimised access to known properties on the global object.
2523
2524         Improve cross scope access to the global object by emitting
2525         code to access it directly rather than by walking the scope chain.
2526
2527         This is a 0.8% win in SunSpider and a 1.7% win in the v8 benchmarks.
2528
2529         * VM/CTI.cpp:
2530         (JSC::CTI::privateCompileMainPass):
2531         (JSC::CTI::emitGetVariableObjectRegister):
2532         (JSC::CTI::emitPutVariableObjectRegister):
2533         * VM/CTI.h:
2534         * VM/CodeBlock.cpp:
2535         (JSC::CodeBlock::dump):
2536         * VM/CodeGenerator.cpp:
2537         (JSC::CodeGenerator::findScopedProperty):
2538         (JSC::CodeGenerator::emitResolve):
2539         (JSC::CodeGenerator::emitGetScopedVar):
2540         (JSC::CodeGenerator::emitPutScopedVar):
2541         * VM/CodeGenerator.h:
2542         * VM/Machine.cpp:
2543         (JSC::Machine::privateExecute):
2544         * VM/Opcode.h:
2545         * kjs/nodes.cpp:
2546         (JSC::FunctionCallResolveNode::emitCode):
2547         (JSC::PostfixResolveNode::emitCode):
2548         (JSC::PrefixResolveNode::emitCode):
2549         (JSC::ReadModifyResolveNode::emitCode):
2550         (JSC::AssignResolveNode::emitCode):
2551
2552 2008-09-10  Maciej Stachowiak  <mjs@apple.com>
2553
2554         Reviewed by Oliver.
2555         
2556         - enable polymorphic inline caching of properties of primitives
2557         
2558         1.012x speedup on SunSpider.
2559
2560         We create special structure IDs for JSString and
2561         JSNumberCell. Unlike normal structure IDs, these cannot hold the
2562         true prototype. Due to JS autoboxing semantics, the prototype used
2563         when looking up string or number properties depends on the lexical
2564         global object of the call site, not the creation site. Thus we
2565         enable StructureIDs to handle this quirk for primitives.
2566         
2567         Everything else should be straightforward.
2568         
2569         * VM/CTI.cpp:
2570         (JSC::CTI::privateCompileGetByIdProto):
2571         (JSC::CTI::privateCompileGetByIdChain):
2572         * VM/CTI.h:
2573         (JSC::CTI::compileGetByIdProto):
2574         (JSC::CTI::compileGetByIdChain):
2575         * VM/JSPropertyNameIterator.h:
2576         (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
2577         * VM/Machine.cpp:
2578         (JSC::Machine::Machine):
2579         (JSC::cachePrototypeChain):
2580         (JSC::Machine::tryCachePutByID):
2581         (JSC::Machine::tryCacheGetByID):
2582         (JSC::Machine::privateExecute):
2583         (JSC::Machine::tryCTICachePutByID):
2584         (JSC::Machine::tryCTICacheGetByID):
2585         * kjs/GetterSetter.h:
2586         (JSC::GetterSetter::GetterSetter):
2587         * kjs/JSCell.h:
2588         * kjs/JSGlobalData.cpp:
2589         (JSC::JSGlobalData::JSGlobalData):
2590         * kjs/JSGlobalData.h:
2591         * kjs/JSGlobalObject.h:
2592         (JSC::StructureID::prototypeForLookup):
2593         * kjs/JSNumberCell.h:
2594         (JSC::JSNumberCell::JSNumberCell):
2595         (JSC::jsNumberCell):
2596         * kjs/JSObject.h:
2597         (JSC::JSObject::prototype):
2598         * kjs/JSString.cpp:
2599         (JSC::jsString):
2600         (JSC::jsSubstring):
2601         (JSC::jsOwnedString):
2602         * kjs/JSString.h:
2603         (JSC::JSString::JSString):
2604         (JSC::JSString::):
2605         (JSC::jsSingleCharacterString):
2606         (JSC::jsSingleCharacterSubstring):
2607         (JSC::jsNontrivialString):
2608         * kjs/SmallStrings.cpp:
2609         (JSC::SmallStrings::createEmptyString):
2610         (JSC::SmallStrings::createSingleCharacterString):
2611         * kjs/StructureID.cpp:
2612         (JSC::StructureID::StructureID):
2613         (JSC::StructureID::addPropertyTransition):
2614         (JSC::StructureID::getterSetterTransition):
2615         (JSC::StructureIDChain::StructureIDChain):
2616         * kjs/StructureID.h:
2617         (JSC::StructureID::create):
2618         (JSC::StructureID::storedPrototype):
2619
2620 2008-09-09  Joerg Bornemann  <joerg.bornemann@trolltech.com>
2621
2622         Reviewed by Sam Weinig.
2623
2624         https://bugs.webkit.org/show_bug.cgi?id=20746
2625
2626         Added WINCE platform macro.
2627
2628         * wtf/Platform.h:
2629
2630 2008-09-09  Sam Weinig  <sam@webkit.org>
2631
2632         Reviewed by Mark Rowe.
2633
2634         Remove unnecessary override of getOffset.
2635
2636         Sunspider reports this as a .6% progression.
2637
2638         * JavaScriptCore.exp:
2639         * kjs/JSObject.h:
2640         (JSC::JSObject::getDirectLocation):
2641         (JSC::JSObject::getOwnPropertySlotForWrite):
2642         (JSC::JSObject::putDirect):
2643         * kjs/PropertyMap.cpp:
2644         * kjs/PropertyMap.h:
2645
2646 2008-09-09  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2647
2648         Reviewed by Maciej Stachowiak.
2649
2650         Bug 20759: Remove MacroAssembler
2651         <https://bugs.webkit.org/show_bug.cgi?id=20759>
2652
2653         Remove MacroAssembler and move its functionality to X86Assembler.
2654
2655         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2656         * JavaScriptCore.xcodeproj/project.pbxproj:
2657         * VM/CTI.cpp:
2658         (JSC::CTI::emitGetArg):
2659         (JSC::CTI::emitGetPutArg):
2660         (JSC::CTI::emitPutArg):
2661         (JSC::CTI::emitPutCTIParam):
2662         (JSC::CTI::emitGetCTIParam):
2663         (JSC::CTI::emitPutToCallFrameHeader):
2664         (JSC::CTI::emitGetFromCallFrameHeader):
2665         (JSC::CTI::emitPutResult):
2666         (JSC::CTI::emitDebugExceptionCheck):
2667         (JSC::CTI::emitJumpSlowCaseIfNotImm):
2668         (JSC::CTI::emitJumpSlowCaseIfNotImms):
2669         (JSC::CTI::emitFastArithDeTagImmediate):
2670         (JSC::CTI::emitFastArithReTagImmediate):
2671         (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
2672         (JSC::CTI::emitFastArithImmToInt):
2673         (JSC::CTI::emitFastArithIntToImmOrSlowCase):
2674         (JSC::CTI::emitFastArithIntToImmNoCheck):
2675         (JSC::CTI::compileOpCall):
2676         (JSC::CTI::emitSlowScriptCheck):
2677         (JSC::CTI::privateCompileMainPass):
2678         (JSC::CTI::privateCompileSlowCases):
2679         (JSC::CTI::privateCompile):
2680         (JSC::CTI::privateCompileGetByIdSelf):
2681         (JSC::CTI::privateCompileGetByIdProto):
2682         (JSC::CTI::privateCompileGetByIdChain):
2683         (JSC::CTI::privateCompilePutByIdReplace):
2684         (JSC::CTI::privateArrayLengthTrampoline):
2685         (JSC::CTI::privateStringLengthTrampoline):
2686         (JSC::CTI::compileRegExp):
2687         * VM/CTI.h:
2688         (JSC::CallRecord::CallRecord):
2689         (JSC::JmpTable::JmpTable):
2690         (JSC::SlowCaseEntry::SlowCaseEntry):
2691         (JSC::CTI::JSRInfo::JSRInfo):
2692         * masm/MacroAssembler.h: Removed.
2693         * masm/MacroAssemblerWin.cpp: Removed.
2694         * masm/X86Assembler.h:
2695         (JSC::X86Assembler::emitConvertToFastCall):
2696         (JSC::X86Assembler::emitRestoreArgumentReference):
2697         * wrec/WREC.h:
2698         (JSC::WRECGenerator::WRECGenerator):
2699         (JSC::WRECParser::WRECParser):
2700
2701 2008-09-09  Sam Weinig  <sam@webkit.org>
2702
2703         Reviewed by Cameron Zwarich.
2704
2705         Don't waste the first item in the PropertyStorage.
2706
2707         - Fix typo (makingCount -> markingCount)
2708         - Remove undefined method declaration.
2709
2710         No change on Sunspider.
2711
2712         * kjs/JSObject.cpp:
2713         (JSC::JSObject::mark):
2714         * kjs/PropertyMap.cpp:
2715         (JSC::PropertyMap::put):
2716         (JSC::PropertyMap::remove):
2717         (JSC::PropertyMap::getOffset):
2718         (JSC::PropertyMap::insert):
2719         (JSC::PropertyMap::rehash):
2720         (JSC::PropertyMap::resizePropertyStorage):
2721         (JSC::PropertyMap::checkConsistency):
2722         * kjs/PropertyMap.h:
2723         (JSC::PropertyMap::markingCount): Fix typo.
2724
2725 2008-09-09  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2726
2727         Not reviewed.
2728
2729         Speculative Windows build fix.
2730
2731         * masm/MacroAssemblerWin.cpp:
2732         (JSC::MacroAssembler::emitConvertToFastCall):
2733         (JSC::MacroAssembler::emitRestoreArgumentReference):
2734
2735 2008-09-09  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2736
2737         Reviewed by Maciej Stachowiak.
2738
2739         Bug 20755: Create an X86 namespace for register names and other things
2740         <https://bugs.webkit.org/show_bug.cgi?id=20755>
2741
2742         Create an X86 namespace to put X86 register names. Perhaps I will move
2743         opcode names here later as well.
2744
2745         * VM/CTI.cpp:
2746         (JSC::CTI::emitGetArg):
2747         (JSC::CTI::emitGetPutArg):
2748         (JSC::CTI::emitPutArg):
2749         (JSC::CTI::emitPutArgConstant):
2750         (JSC::CTI::emitPutCTIParam):
2751         (JSC::CTI::emitGetCTIParam):
2752         (JSC::CTI::emitPutToCallFrameHeader):
2753         (JSC::CTI::emitGetFromCallFrameHeader):
2754         (JSC::CTI::emitPutResult):
2755         (JSC::CTI::emitDebugExceptionCheck):
2756         (JSC::CTI::emitJumpSlowCaseIfNotImms):
2757         (JSC::CTI::compileOpCall):
2758         (JSC::CTI::emitSlowScriptCheck):
2759         (JSC::CTI::privateCompileMainPass):
2760         (JSC::CTI::privateCompileSlowCases):
2761         (JSC::CTI::privateCompile):
2762         (JSC::CTI::privateCompileGetByIdSelf):
2763         (JSC::CTI::privateCompileGetByIdProto):
2764         (JSC::CTI::privateCompileGetByIdChain):
2765         (JSC::CTI::privateCompilePutByIdReplace):
2766         (JSC::CTI::privateArrayLengthTrampoline):
2767         (JSC::CTI::privateStringLengthTrampoline):
2768         (JSC::CTI::compileRegExp):
2769         * VM/CTI.h:
2770         * masm/X86Assembler.h:
2771         (JSC::X86::):
2772         (JSC::X86Assembler::emitModRm_rm):
2773         (JSC::X86Assembler::emitModRm_rm_Unchecked):
2774         (JSC::X86Assembler::emitModRm_rmsib):
2775         * wrec/WREC.cpp:
2776         (JSC::WRECGenerator::generateNonGreedyQuantifier):
2777         (JSC::WRECGenerator::generateGreedyQuantifier):
2778         (JSC::WRECGenerator::generateParentheses):
2779         (JSC::WRECGenerator::generateBackreference):
2780         (JSC::WRECGenerator::gernerateDisjunction):
2781         * wrec/WREC.h:
2782
2783 2008-09-09  Sam Weinig  <sam@webkit.org>
2784
2785         Reviewed by Geoffrey Garen.
2786
2787         Remove unnecessary friend declaration.
2788
2789         * kjs/PropertyMap.h:
2790
2791 2008-09-09  Sam Weinig  <sam@webkit.org>
2792
2793         Reviewed by Geoffrey Garen.
2794
2795         Replace uses of PropertyMap::get and PropertyMap::getLocation with
2796         PropertyMap::getOffset.
2797
2798         Sunspider reports this as a .6% improvement.
2799
2800         * JavaScriptCore.exp:
2801         * kjs/JSObject.cpp:
2802         (JSC::JSObject::put):
2803         (JSC::JSObject::deleteProperty):
2804         (JSC::JSObject::getPropertyAttributes):
2805         * kjs/JSObject.h:
2806         (JSC::JSObject::getDirect):
2807         (JSC::JSObject::getDirectLocation):
2808         (JSC::JSObject::locationForOffset):
2809         * kjs/PropertyMap.cpp:
2810         (JSC::PropertyMap::remove):
2811         (JSC::PropertyMap::getOffset):
2812         * kjs/PropertyMap.h:
2813
2814 2008-09-09  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2815
2816         Reviewed by Sam Weinig.
2817
2818         Bug 20754: Remove emit prefix from assembler opcode methods
2819         <https://bugs.webkit.org/show_bug.cgi?id=20754>
2820
2821         * VM/CTI.cpp:
2822         (JSC::CTI::emitGetArg):
2823         (JSC::CTI::emitGetPutArg):
2824         (JSC::CTI::emitPutArg):
2825         (JSC::CTI::emitPutArgConstant):
2826         (JSC::CTI::emitPutCTIParam):
2827         (JSC::CTI::emitGetCTIParam):
2828         (JSC::CTI::emitPutToCallFrameHeader):
2829         (JSC::CTI::emitGetFromCallFrameHeader):
2830         (JSC::CTI::emitPutResult):
2831         (JSC::CTI::emitDebugExceptionCheck):
2832         (JSC::CTI::emitCall):
2833         (JSC::CTI::emitJumpSlowCaseIfNotImm):
2834         (JSC::CTI::emitJumpSlowCaseIfNotImms):
2835         (JSC::CTI::emitFastArithDeTagImmediate):
2836         (JSC::CTI::emitFastArithReTagImmediate):
2837         (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
2838         (JSC::CTI::emitFastArithImmToInt):
2839         (JSC::CTI::emitFastArithIntToImmOrSlowCase):
2840         (JSC::CTI::emitFastArithIntToImmNoCheck):
2841         (JSC::CTI::compileOpCall):
2842         (JSC::CTI::emitSlowScriptCheck):
2843         (JSC::CTI::privateCompileMainPass):
2844         (JSC::CTI::privateCompileSlowCases):
2845         (JSC::CTI::privateCompile):
2846         (JSC::CTI::privateCompileGetByIdSelf):
2847         (JSC::CTI::privateCompileGetByIdProto):
2848         (JSC::CTI::privateCompileGetByIdChain):
2849         (JSC::CTI::privateCompilePutByIdReplace):
2850         (JSC::CTI::privateArrayLengthTrampoline):
2851         (JSC::CTI::privateStringLengthTrampoline):
2852         (JSC::CTI::compileRegExp):
2853         * masm/MacroAssemblerWin.cpp:
2854         (JSC::MacroAssembler::emitConvertToFastCall):
2855         (JSC::MacroAssembler::emitRestoreArgumentReference):
2856         * masm/X86Assembler.h:
2857         (JSC::X86Assembler::pushl_r):
2858         (JSC::X86Assembler::pushl_m):
2859         (JSC::X86Assembler::popl_r):
2860         (JSC::X86Assembler::popl_m):
2861         (JSC::X86Assembler::movl_rr):
2862         (JSC::X86Assembler::addl_rr):
2863         (JSC::X86Assembler::addl_i8r):
2864         (JSC::X86Assembler::addl_i32r):
2865         (JSC::X86Assembler::addl_mr):
2866         (JSC::X86Assembler::andl_rr):
2867         (JSC::X86Assembler::andl_i32r):
2868         (JSC::X86Assembler::cmpl_i8r):
2869         (JSC::X86Assembler::cmpl_rr):
2870         (JSC::X86Assembler::cmpl_rm):
2871         (JSC::X86Assembler::cmpl_i32r):
2872         (JSC::X86Assembler::cmpl_i32m):
2873         (JSC::X86Assembler::cmpw_rm):
2874         (JSC::X86Assembler::orl_rr):
2875         (JSC::X86Assembler::subl_rr):
2876         (JSC::X86Assembler::subl_i8r):
2877         (JSC::X86Assembler::subl_i32r):
2878         (JSC::X86Assembler::subl_mr):
2879         (JSC::X86Assembler::testl_i32r):
2880         (JSC::X86Assembler::testl_rr):
2881         (JSC::X86Assembler::xorl_i8r):
2882         (JSC::X86Assembler::xorl_rr):
2883         (JSC::X86Assembler::sarl_i8r):
2884         (JSC::X86Assembler::sarl_CLr):
2885         (JSC::X86Assembler::shl_i8r):
2886         (JSC::X86Assembler::shll_CLr):
2887         (JSC::X86Assembler::mull_rr):
2888         (JSC::X86Assembler::idivl_r):
2889         (JSC::X86Assembler::cdq):
2890         (JSC::X86Assembler::movl_mr):
2891         (JSC::X86Assembler::movzwl_mr):
2892         (JSC::X86Assembler::movl_rm):
2893         (JSC::X86Assembler::movl_i32r):
2894         (JSC::X86Assembler::movl_i32m):
2895         (JSC::X86Assembler::leal_mr):
2896         (JSC::X86Assembler::ret):
2897         (JSC::X86Assembler::jmp_r):
2898         (JSC::X86Assembler::jmp_m):
2899         (JSC::X86Assembler::call_r):
2900         * wrec/WREC.cpp:
2901         (JSC::WRECGenerator::generateBacktrack1):
2902         (JSC::WRECGenerator::generateBacktrackBackreference):
2903         (JSC::WRECGenerator::generateBackreferenceQuantifier):
2904         (JSC::WRECGenerator::generateNonGreedyQuantifier):
2905         (JSC::WRECGenerator::generateGreedyQuantifier):
2906         (JSC::WRECGenerator::generatePatternCharacter):
2907         (JSC::WRECGenerator::generateCharacterClassInvertedRange):
2908         (JSC::WRECGenerator::generateCharacterClassInverted):
2909         (JSC::WRECGenerator::generateCharacterClass):
2910         (JSC::WRECGenerator::generateParentheses):
2911         (JSC::WRECGenerator::gererateParenthesesResetTrampoline):
2912         (JSC::WRECGenerator::generateAssertionBOL):
2913         (JSC::WRECGenerator::generateAssertionEOL):
2914         (JSC::WRECGenerator::generateAssertionWordBoundary):
2915         (JSC::WRECGenerator::generateBackreference):
2916         (JSC::WRECGenerator::gernerateDisjunction):
2917
2918 2008-09-09  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2919
2920         Reviewed by Maciej Stachowiak.
2921
2922         Clean up the WREC code some more.
2923
2924         * VM/CTI.cpp:
2925         (JSC::CTI::compileRegExp):
2926         * wrec/WREC.cpp:
2927         (JSC::getCharacterClassNewline):
2928         (JSC::getCharacterClassDigits):
2929         (JSC::getCharacterClassSpaces):
2930         (JSC::getCharacterClassWordchar):
2931         (JSC::getCharacterClassNondigits):
2932         (JSC::getCharacterClassNonspaces):
2933         (JSC::getCharacterClassNonwordchar):
2934         (JSC::WRECGenerator::generateBacktrack1):
2935         (JSC::WRECGenerator::generateBacktrackBackreference):
2936         (JSC::WRECGenerator::generateBackreferenceQuantifier):
2937         (JSC::WRECGenerator::generateNonGreedyQuantifier):
2938         (JSC::WRECGenerator::generateGreedyQuantifier):
2939         (JSC::WRECGenerator::generatePatternCharacter):
2940         (JSC::WRECGenerator::generateCharacterClassInvertedRange):
2941         (JSC::WRECGenerator::generateCharacterClassInverted):
2942         (JSC::WRECGenerator::generateCharacterClass):
2943         (JSC::WRECGenerator::generateParentheses):
2944         (JSC::WRECGenerator::gererateParenthesesResetTrampoline):
2945         (JSC::WRECGenerator::generateAssertionBOL):
2946         (JSC::WRECGenerator::generateAssertionEOL):
2947         (JSC::WRECGenerator::generateAssertionWordBoundary):
2948         (JSC::WRECGenerator::generateBackreference):
2949         (JSC::WRECGenerator::gernerateDisjunction):
2950         (JSC::WRECParser::parseCharacterClass):
2951         (JSC::WRECParser::parseEscape):
2952         (JSC::WRECParser::parseTerm):
2953         * wrec/WREC.h:
2954
2955 2008-09-09  Mark Rowe  <mrowe@apple.com>
2956
2957         Build fix, rubber-stamped by Anders Carlsson.
2958
2959         Silence spurious build warnings about missing format attributes on functions in Assertions.cpp.
2960
2961         * JavaScriptCore.xcodeproj/project.pbxproj:
2962
2963 2008-09-09  Mark Rowe  <mrowe@apple.com>
2964
2965         Rubber-stamped by Oliver Hunt.
2966
2967         Fix builds using the "debug" variant.
2968
2969         This reverts r36130 and tweaks Identifier to export the same symbols for Debug
2970         and Release configurations.
2971
2972         * Configurations/JavaScriptCore.xcconfig:
2973         * DerivedSources.make:
2974         * JavaScriptCore.Debug.exp: Removed.
2975         * JavaScriptCore.base.exp: Removed.
2976         * JavaScriptCore.exp: Added.
2977         * JavaScriptCore.xcodeproj/project.pbxproj:
2978         * kjs/identifier.cpp:
2979         (JSC::Identifier::addSlowCase): #ifdef the call to checkSameIdentifierTable so that
2980         there is no overhead in Release builds.
2981         (JSC::Identifier::checkSameIdentifierTable): Add empty functions for Release builds.
2982         * kjs/identifier.h:
2983         (JSC::Identifier::add): #ifdef the calls to checkSameIdentifierTable so that there is
2984         no overhead in Release builds, and remove the inline definitions of checkSameIdentifierTable.
2985
2986 2008-09-09  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2987
2988         Reviewed by Maciej Stachowiak.
2989
2990         Clean up WREC a bit to bring it closer to our coding style guidelines.
2991
2992         * wrec/WREC.cpp:
2993         (JSC::):
2994         (JSC::getCharacterClass_newline):
2995         (JSC::getCharacterClass_d):
2996         (JSC::getCharacterClass_s):
2997         (JSC::getCharacterClass_w):
2998         (JSC::getCharacterClass_D):
2999         (JSC::getCharacterClass_S):
3000         (JSC::getCharacterClass_W):
3001         (JSC::CharacterClassConstructor::append):
3002         (JSC::WRECGenerator::generateNonGreedyQuantifier):
3003         (JSC::WRECGenerator::generateGreedyQuantifier):
3004         (JSC::WRECGenerator::generateCharacterClassInverted):
3005         (JSC::WRECParser::parseQuantifier):
3006         (JSC::WRECParser::parsePatternCharacterQualifier):
3007         (JSC::WRECParser::parseCharacterClassQuantifier):
3008         (JSC::WRECParser::parseBackreferenceQuantifier):
3009         * wrec/WREC.h:
3010         (JSC::Quantifier::):
3011         (JSC::Quantifier::Quantifier):
3012
3013 2008-09-09  Jungshik Shin  <jungshik.shin@gmail.com>
3014
3015         Reviewed by Alexey Proskuryakov.
3016
3017         Try MIME charset names before trying IANA names 
3018         ( https://bugs.webkit.org/show_bug.cgi?id=17537 )
3019
3020         * wtf/StringExtras.h: (strcasecmp): Added.
3021
3022 2008-09-09  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
3023
3024         Reviewed by Mark Rowe.
3025
3026         Bug 20719: REGRESSION (r36135-36244): Hangs, then crashes after several seconds
3027         <https://bugs.webkit.org/show_bug.cgi?id=20719>
3028         <rdar://problem/6205787>
3029
3030         Fix a typo in the case-insensitive matching of character patterns.
3031
3032         * wrec/WREC.cpp:
3033         (JSC::WRECGenerator::generatePatternCharacter):
3034
3035 2008-09-09  Maciej Stachowiak  <mjs@apple.com>
3036
3037         Reviewed by Sam Weinig.
3038         
3039         - allow polymorphic inline cache to handle Math object functions and possibly other similar things
3040         
3041         1.012x speedup on SunSpider.
3042
3043         * kjs/MathObject.cpp:
3044         (JSC::MathObject::getOwnPropertySlot):
3045         * kjs/lookup.cpp:
3046         (JSC::setUpStaticFunctionSlot):
3047         * kjs/lookup.h:
3048         (JSC::getStaticPropertySlot):
3049
3050 2008-09-08  Sam Weinig  <sam@webkit.org>
3051
3052         Reviewed by Maciej Stachowiak and Oliver Hunt.
3053
3054         Split storage of properties out of the PropertyMap and into the JSObject
3055         to allow sharing PropertyMap on the StructureID.  In order to get this
3056         function correctly, the StructureID's transition mappings were changed to
3057         transition based on property name and attribute pairs, instead of just
3058         property name.
3059
3060         - Removes the single property optimization now that the PropertyMap is shared.
3061           This will be replaced by in-lining some values on the JSObject.
3062
3063         This is a wash on Sunspider and a 6.7% win on the v8 test suite.
3064
3065         * JavaScriptCore.base.exp:
3066         * VM/CTI.cpp:
3067         (JSC::CTI::privateCompileGetByIdSelf): Get the storage directly off the JSObject.
3068         (JSC::CTI::privateCompileGetByIdProto): Ditto.
3069         (JSC::CTI::privateCompileGetByIdChain): Ditto.
3070         (JSC::CTI::privateCompilePutByIdReplace): Ditto.
3071         * kjs/JSObject.cpp:
3072         (JSC::JSObject::mark): Mark the PropertyStorage.
3073         (JSC::JSObject::put): Update to get the propertyMap of the StructureID.
3074         (JSC::JSObject::deleteProperty): Ditto.
3075         (JSC::JSObject::defineGetter): Return early if the property is already a getter/setter.
3076         (JSC::JSObject::defineSetter): Ditto.
3077         (JSC::JSObject::getPropertyAttributes): Update to get the propertyMap of the StructureID
3078         (JSC::JSObject::getPropertyNames): Ditto.
3079         (JSC::JSObject::removeDirect): Ditto.
3080         * kjs/JSObject.h: Remove PropertyMap and add PropertyStorage.
3081         (JSC::JSObject::propertyStorage): return the PropertyStorage.
3082         (JSC::JSObject::getDirect): Update to get the propertyMap of the StructureID.
3083         (JSC::JSObject::getDirectLocation): Ditto.
3084         (JSC::JSObject::offsetForLocation): Compute location directly.
3085         (JSC::JSObject::hasCustomProperties): Update to get the propertyMap of the StructureID.
3086         (JSC::JSObject::hasGetterSetterProperties): Ditto.
3087         (JSC::JSObject::getDirectOffset): Get by indexing into PropertyStorage.
3088         (JSC::JSObject::putDirectOffset): Put by indexing into PropertyStorage.
3089         (JSC::JSObject::getOwnPropertySlotForWrite): Update to get the propertyMap of the StructureID.
3090         (JSC::JSObject::getOwnPropertySlot): Ditto.
3091         (JSC::JSObject::putDirect): Move putting into the StructureID unless the property already exists.
3092         * kjs/PropertyMap.cpp: Use the propertyStorage as the storage for the JSValues.
3093         (JSC::PropertyMap::checkConsistency): 
3094         (JSC::PropertyMap::operator=):
3095         (JSC::PropertyMap::~PropertyMap):
3096         (JSC::PropertyMap::get):
3097         (JSC::PropertyMap::getLocation):
3098         (JSC::PropertyMap::put):
3099         (JSC::PropertyMap::getOffset):
3100         (JSC::PropertyMap::insert):
3101         (JSC::PropertyMap::expand):
3102         (JSC::PropertyMap::rehash):
3103         (JSC::PropertyMap::createTable):
3104         (JSC::PropertyMap::resizePropertyStorage): Resize the storage to match the size of the map
3105         (JSC::PropertyMap::remove):
3106         (JSC::PropertyMap::getEnumerablePropertyNames):
3107         * kjs/PropertyMap.h: 
3108         (JSC::PropertyMapEntry::PropertyMapEntry):
3109         (JSC::PropertyMap::isEmpty):
3110         (JSC::PropertyMap::size):
3111         (JSC::PropertyMap::makingCount):
3112         (JSC::PropertyMap::PropertyMap):
3113
3114         * kjs/StructureID.cpp: 
3115         (JSC::StructureID::addPropertyTransition): Transitions now are based off the property name
3116         and attributes. 
3117         (JSC::StructureID::toDictionaryTransition): Copy the map.
3118         (JSC::StructureID::changePrototypeTransition): Copy the map.
3119         (JSC::StructureID::getterSetterTransition): Copy the map.
3120         (JSC::StructureID::~StructureID): 
3121         * kjs/StructureID.h:
3122         (JSC::TransitionTableHash::hash): Custom hash for transition map.
3123         (JSC::TransitionTableHash::equal): Ditto.
3124         (JSC::TransitionTableHashTraits::emptyValue): Custom traits for transition map
3125         (JSC::TransitionTableHashTraits::constructDeletedValue): Ditto.
3126         (JSC::TransitionTableHashTraits::isDeletedValue): Ditto.
3127         (JSC::StructureID::propertyMap): Added.
3128
3129 2008-09-08  Oliver Hunt  <oliver@apple.com>
3130
3131         Reviewed by Mark Rowe.
3132
3133         Bug 20694: Slow Script error pops up when running Dromaeo tests
3134
3135         Correct error in timeout logic where execution tick count would
3136         be reset to incorrect value due to incorrect offset and indirection.
3137         Codegen for the slow script dialog was factored out into a separate
3138         method (emitSlowScriptCheck) rather than having multiple copies of
3139         the same code.  Also added calls to generate slow script checks
3140         for loop_if_less and loop_if_true opcodes.
3141
3142         * VM/CTI.cpp:
3143         (JSC::CTI::emitSlowScriptCheck):
3144         (JSC::CTI::privateCompileMainPass):
3145         (JSC::CTI::privateCompileSlowCases):
3146         * VM/CTI.h:
3147
3148 2008-09-08  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
3149
3150         Reviewed by Maciej Stachowiak.
3151
3152         Remove references to the removed WRECompiler class.
3153
3154         * VM/Machine.h:
3155         * wrec/WREC.h:
3156
3157 2008-09-08  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
3158
3159         Rubber-stamped by Mark Rowe.
3160
3161         Fix the build with CTI enabled but WREC disabled.
3162
3163         * VM/CTI.cpp:
3164         * VM/CTI.h:
3165
3166 2008-09-08  Dan Bernstein  <mitz@apple.com>
3167
3168         - build fix
3169
3170         * kjs/nodes.h:
3171         (JSC::StatementNode::):
3172         (JSC::BlockNode::):
3173
3174 2008-09-08  Kevin McCullough  <kmccullough@apple.com>
3175
3176         Reviewed by Geoff.
3177
3178        <rdar://problem/6134407> Breakpoints in for loops, while loops or
3179        conditions without curly braces don't break. (19306)
3180        -Statement Lists already emit debug hooks but conditionals without
3181        brackets are not lists.
3182
3183         * kjs/nodes.cpp:
3184         (KJS::IfNode::emitCode):
3185         (KJS::IfElseNode::emitCode):
3186         (KJS::DoWhileNode::emitCode):
3187         (KJS::WhileNode::emitCode):
3188         (KJS::ForNode::emitCode):
3189         (KJS::ForInNode::emitCode):
3190         * kjs/nodes.h:
3191         (KJS::StatementNode::):
3192         (KJS::BlockNode::):
3193
3194 2008-09-08  Maciej Stachowiak  <mjs@apple.com>
3195
3196         Reviewed by Anders Carlsson.
3197         
3198         - Cache the code generated for eval to speed up SunSpider and web sites
3199         https://bugs.webkit.org/show_bug.cgi?id=20718
3200         
3201         1.052x on SunSpider
3202         2.29x on date-format-tofte
3203         
3204         Lots of real sites seem to get many hits on this cache as well,
3205         including GMail, Google Spreadsheets, Slate and Digg (the last of
3206         these gets over 100 hits on initial page load).
3207
3208         * VM/CodeBlock.h:
3209         (JSC::EvalCodeCache::get):
3210         * VM/Machine.cpp:
3211         (JSC::Machine::callEval):
3212         (JSC::Machine::privateExecute):
3213         (JSC::Machine::cti_op_call_eval):
3214         * VM/Machine.h:
3215
3216 2008-09-07  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
3217
3218         Reviewed by Oliver Hunt.
3219
3220         Bug 20711: Change KJS prefix on preprocessor macros to JSC
3221         <https://bugs.webkit.org/show_bug.cgi?id=20711>
3222
3223         * kjs/CommonIdentifiers.cpp:
3224         (JSC::CommonIdentifiers::CommonIdentifiers):
3225         * kjs/CommonIdentifiers.h:
3226         * kjs/PropertySlot.h:
3227         (JSC::PropertySlot::getValue):
3228         (JSC::PropertySlot::putValue):
3229         (JSC::PropertySlot::setValueSlot):
3230         (JSC::PropertySlot::setValue):
3231         (JSC::PropertySlot::setRegisterSlot):
3232         * kjs/lookup.h:
3233         * kjs/nodes.cpp:
3234         * kjs/nodes.h:
3235         (JSC::Node::):
3236         (JSC::ExpressionNode::):
3237         (JSC::StatementNode::):
3238         (JSC::NullNode::):
3239         (JSC::BooleanNode::):
3240         (JSC::NumberNode::):
3241         (JSC::ImmediateNumberNode::):
3242         (JSC::StringNode::):
3243         (JSC::RegExpNode::):
3244         (JSC::ThisNode::):
3245         (JSC::ResolveNode::):
3246         (JSC::ElementNode::):
3247         (JSC::ArrayNode::):
3248         (JSC::PropertyNode::):
3249         (JSC::PropertyListNode::):
3250         (JSC::ObjectLiteralNode::):
3251         (JSC::BracketAccessorNode::):
3252         (JSC::DotAccessorNode::):
3253         (JSC::ArgumentListNode::):
3254         (JSC::ArgumentsNode::):
3255         (JSC::NewExprNode::):
3256         (JSC::EvalFunctionCallNode::):
3257         (JSC::FunctionCallValueNode::):
3258         (JSC::FunctionCallResolveNode::):
3259         (JSC::FunctionCallBracketNode::):
3260         (JSC::FunctionCallDotNode::):
3261         (JSC::PrePostResolveNode::):
3262         (JSC::PostfixResolveNode::):
3263         (JSC::PostfixBracketNode::):
3264         (JSC::PostfixDotNode::):
3265         (JSC::PostfixErrorNode::):
3266         (JSC::DeleteResolveNode::):
3267         (JSC::DeleteBracketNode::):
3268         (JSC::DeleteDotNode::):
3269         (JSC::DeleteValueNode::):
3270         (JSC::VoidNode::):
3271         (JSC::TypeOfResolveNode::):
3272         (JSC::TypeOfValueNode::):
3273         (JSC::PrefixResolveNode::):
3274         (JSC::PrefixBracketNode::):
3275         (JSC::PrefixDotNode::):
3276         (JSC::PrefixErrorNode::):
3277         (JSC::UnaryPlusNode::):
3278         (JSC::NegateNode::):
3279         (JSC::BitwiseNotNode::):
3280         (JSC::LogicalNotNode::):
3281         (JSC::MultNode::):
3282         (JSC::DivNode::):
3283         (JSC::ModNode::):
3284         (JSC::AddNode::):
3285         (JSC::SubNode::):
3286         (JSC::LeftShiftNode::):
3287         (JSC::RightShiftNode::):
3288         (JSC::UnsignedRightShiftNode::):
3289         (JSC::LessNode::):
3290         (JSC::GreaterNode::):
3291         (JSC::LessEqNode::):
3292         (JSC::GreaterEqNode::):
3293         (JSC::ThrowableBinaryOpNode::):
3294         (JSC::InstanceOfNode::):
3295         (JSC::InNode::):
3296         (JSC::EqualNode::):
3297         (JSC::NotEqualNode::):
3298         (JSC::StrictEqualNode::):
3299         (JSC::NotStrictEqualNode::):
3300         (JSC::BitAndNode::):
3301         (JSC::BitOrNode::):
3302         (JSC::BitXOrNode::):
3303         (JSC::LogicalOpNode::):
3304         (JSC::ConditionalNode::):
3305         (JSC::ReadModifyResolveNode::):
3306         (JSC::AssignResolveNode::):
3307         (JSC::ReadModifyBracketNode::):
3308         (JSC::AssignBracketNode::):
3309         (JSC::AssignDotNode::):
3310         (JSC::ReadModifyDotNode::):
3311         (JSC::AssignErrorNode::):
3312         (JSC::CommaNode::):
3313         (JSC::VarDeclCommaNode::):
3314         (JSC::ConstDeclNode::):
3315         (JSC::ConstStatementNode::):
3316         (JSC::EmptyStatementNode::):
3317         (JSC::DebuggerStatementNode::):
3318         (JSC::ExprStatementNode::):
3319         (JSC::VarStatementNode::):
3320         (JSC::IfNode::):
3321         (JSC::IfElseNode::):
3322         (JSC::DoWhileNode::):
3323         (JSC::WhileNode::):
3324         (JSC::ForNode::):
3325         (JSC::ContinueNode::):
3326         (JSC::BreakNode::):
3327         (JSC::ReturnNode::):
3328         (JSC::WithNode::):
3329         (JSC::LabelNode::):
3330         (JSC::ThrowNode::):
3331         (JSC::TryNode::):
3332         (JSC::ParameterNode::):
3333         (JSC::ScopeNode::):
3334         (JSC::ProgramNode::):
3335         (JSC::EvalNode::):
3336         (JSC::FunctionBodyNode::):
3337         (JSC::FuncExprNode::):
3338         (JSC::FuncDeclNode::):
3339         (JSC::CaseClauseNode::):
3340         (JSC::ClauseListNode::):
3341         (JSC::CaseBlockNode::):
3342         (JSC::SwitchNode::):
3343
3344 2008-09-07  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
3345
3346         Reviewed by Maciej Stachowiak.
3347
3348         Bug 20704: Replace the KJS namespace
3349         <https://bugs.webkit.org/show_bug.cgi?id=20704>
3350
3351         Rename the KJS namespace to JSC. There are still some uses of KJS in
3352         preprocessor macros and comments, but these will also be changed some
3353         time in the near future.
3354
3355         * API/APICast.h:
3356         (toJS):
3357         (toRef):
3358         (toGlobalRef):
3359         * API/JSBase.cpp:
3360         * API/JSCallbackConstructor.cpp:
3361         * API/JSCallbackConstructor.h:
3362         * API/JSCallbackFunction.cpp:
3363         * API/JSCallbackFunction.h:
3364         * API/JSCallbackObject.cpp:
3365         * API/JSCallbackObject.h:
3366         * API/JSCallbackObjectFunctions.h:
3367         * API/JSClassRef.cpp:
3368         (OpaqueJSClass::staticValues):
3369         (OpaqueJSClass::staticFunctions):
3370         * API/JSClassRef.h:
3371         * API/JSContextRef.cpp:
3372         * API/JSObjectRef.cpp:
3373         * API/JSProfilerPrivate.cpp:
3374         * API/JSStringRef.cpp:
3375         * API/JSValueRef.cpp:
3376         (JSValueGetType):
3377         * API/OpaqueJSString.cpp:
3378         * API/OpaqueJSString.h:
3379         * JavaScriptCore.Debug.exp:
3380         * JavaScriptCore.base.exp:
3381         * VM/CTI.cpp:
3382         (JSC::):
3383         * VM/CTI.h:
3384         * VM/CodeBlock.cpp:
3385         * VM/CodeBlock.h:
3386         * VM/CodeGenerator.cpp:
3387         * VM/CodeGenerator.h:
3388         * VM/ExceptionHelpers.cpp:
3389         * VM/ExceptionHelpers.h:
3390         * VM/Instruction.h:
3391         * VM/JSPropertyNameIterator.cpp:
3392         * VM/JSPropertyNameIterator.h:
3393         * VM/LabelID.h:
3394         * VM/Machine.cpp:
3395         * VM/Machine.h:
3396         * VM/Opcode.cpp:
3397         * VM/Opcode.h:
3398         * VM/Register.h:
3399         (WTF::):
3400         * VM/RegisterFile.cpp:
3401         * VM/RegisterFile.h:
3402         * VM/RegisterID.h:
3403         (WTF::):
3404         * VM/SamplingTool.cpp:
3405         * VM/SamplingTool.h:
3406         * VM/SegmentedVector.h:
3407         * kjs/ArgList.cpp:
3408         * kjs/ArgList.h:
3409         * kjs/Arguments.cpp:
3410         * kjs/Arguments.h:
3411         * kjs/ArrayConstructor.cpp:
3412         * kjs/ArrayConstructor.h:
3413         * kjs/ArrayPrototype.cpp:
3414         * kjs/ArrayPrototype.h:
3415         * kjs/BatchedTransitionOptimizer.h:
3416         * kjs/BooleanConstructor.cpp:
3417         * kjs/BooleanConstructor.h:
3418         * kjs/BooleanObject.cpp:
3419         * kjs/BooleanObject.h:
3420         * kjs/BooleanPrototype.cpp:
3421         * kjs/BooleanPrototype.h:
3422         * kjs/CallData.cpp:
3423         * kjs/CallData.h:
3424         * kjs/ClassInfo.h:
3425         * kjs/CommonIdentifiers.cpp:
3426         * kjs/CommonIdentifiers.h:
3427         * kjs/ConstructData.cpp:
3428         * kjs/ConstructData.h:
3429         * kjs/DateConstructor.cpp:
3430         * kjs/DateConstructor.h:
3431         * kjs/DateInstance.cpp:
3432         (JSC::DateInstance::msToGregorianDateTime):
3433         * kjs/DateInstance.h:
3434         * kjs/DateMath.cpp:
3435         * kjs/DateMath.h:
3436         * kjs/DatePrototype.cpp:
3437         * kjs/DatePrototype.h:
3438         * kjs/DebuggerCallFrame.cpp:
3439         * kjs/DebuggerCallFrame.h:
3440         * kjs/Error.cpp:
3441         * kjs/Error.h:
3442         * kjs/ErrorConstructor.cpp:
3443         * kjs/ErrorConstructor.h:
3444         * kjs/ErrorInstance.cpp:
3445         * kjs/ErrorInstance.h:
3446         * kjs/ErrorPrototype.cpp:
3447         * kjs/ErrorPrototype.h:
3448         * kjs/ExecState.cpp:
3449         * kjs/ExecState.h:
3450         * kjs/FunctionConstructor.cpp:
3451         * kjs/FunctionConstructor.h:
3452         * kjs/FunctionPrototype.cpp:
3453         * kjs/FunctionPrototype.h:
3454         * kjs/GetterSetter.cpp:
3455         * kjs/GetterSetter.h:
3456         * kjs/GlobalEvalFunction.cpp:
3457         * kjs/GlobalEvalFunction.h:
3458         * kjs/IndexToNameMap.cpp:
3459         * kjs/IndexToNameMap.h:
3460         * kjs/InitializeThreading.cpp:
3461         * kjs/InitializeThreading.h:
3462         * kjs/InternalFunction.cpp:
3463         * kjs/InternalFunction.h:
3464         (JSC::InternalFunction::InternalFunction):
3465         * kjs/JSActivation.cpp:
3466         * kjs/JSActivation.h:
3467         * kjs/JSArray.cpp:
3468         * kjs/JSArray.h:
3469         * kjs/JSCell.cpp:
3470         * kjs/JSCell.h:
3471         * kjs/JSFunction.cpp:
3472         * kjs/JSFunction.h:
3473         (JSC::JSFunction::JSFunction):
3474         * kjs/JSGlobalData.cpp:
3475         (JSC::JSGlobalData::JSGlobalData):
3476         * kjs/JSGlobalData.h:
3477         * kjs/JSGlobalObject.cpp:
3478         * kjs/JSGlobalObject.h:
3479         * kjs/JSGlobalObjectFunctions.cpp:
3480         * kjs/JSGlobalObjectFunctions.h:
3481         * kjs/JSImmediate.cpp:
3482         * kjs/JSImmediate.h:
3483         * kjs/JSLock.cpp:
3484         * kjs/JSLock.h:
3485         * kjs/JSNotAnObject.cpp:
3486         * kjs/JSNotAnObject.h:
3487         * kjs/JSNumberCell.cpp:
3488         * kjs/JSNumberCell.h:
3489         * kjs/JSObject.cpp:
3490         * kjs/JSObject.h:
3491         * kjs/JSStaticScopeObject.cpp:
3492         * kjs/JSStaticScopeObject.h:
3493         * kjs/JSString.cpp:
3494         * kjs/JSString.h:
3495         * kjs/JSType.h:
3496         * kjs/JSValue.cpp:
3497         * kjs/JSValue.h:
3498         * kjs/JSVariableObject.cpp:
3499         * kjs/JSVariableObject.h:
3500         * kjs/JSWrapperObject.cpp:
3501         * kjs/JSWrapperObject.h:
3502         * kjs/LabelStack.cpp:
3503         * kjs/LabelStack.h:
3504         * kjs/MathObject.cpp:
3505         * kjs/MathObject.h:
3506         * kjs/NativeErrorConstructor.cpp:
3507         * kjs/NativeErrorConstructor.h:
3508         * kjs/NativeErrorPrototype.cpp:
3509         * kjs/NativeErrorPrototype.h:
3510         * kjs/NodeInfo.h:
3511         * kjs/NumberConstructor.cpp:
3512         * kjs/NumberConstructor.h:
3513         * kjs/NumberObject.cpp:
3514         * kjs/NumberObject.h:
3515         * kjs/NumberPrototype.cpp:
3516         * kjs/NumberPrototype.h:
3517         * kjs/ObjectConstructor.cpp:
3518         * kjs/ObjectConstructor.h:
3519         * kjs/ObjectPrototype.cpp:
3520         * kjs/ObjectPrototype.h:
3521         * kjs/Parser.cpp:
3522         * kjs/Parser.h:
3523         * kjs/PropertyMap.cpp:
3524         (JSC::PropertyMapStatisticsExitLogger::~PropertyMapStatisticsExitLogger):
3525         * kjs/PropertyMap.h:
3526         * kjs/PropertyNameArray.cpp:
3527         * kjs/PropertyNameArray.h:
3528         * kjs/PropertySlot.cpp:
3529         * kjs/PropertySlot.h:
3530         * kjs/PrototypeFunction.cpp:
3531         * kjs/PrototypeFunction.h:
3532         * kjs/PutPropertySlot.h:
3533         * kjs/RegExpConstructor.cpp:
3534         * kjs/RegExpConstructor.h:
3535         * kjs/RegExpObject.cpp:
3536         * kjs/RegExpObject.h:
3537         * kjs/RegExpPrototype.cpp:
3538         * kjs/RegExpPrototype.h:
3539         * kjs/ScopeChain.cpp:
3540         * kjs/ScopeChain.h:
3541         * kjs/ScopeChainMark.h:
3542         * kjs/Shell.cpp:
3543         (jscmain):
3544         * kjs/SmallStrings.cpp:
3545         * kjs/SmallStrings.h:
3546         * kjs/SourceProvider.h:
3547         * kjs/SourceRange.h:
3548         * kjs/StringConstructor.cpp:
3549         * kjs/StringConstructor.h:
3550         * kjs/StringObject.cpp:
3551         * kjs/StringObject.h:
3552         * kjs/StringObjectThatMasqueradesAsUndefined.h:
3553         * kjs/StringPrototype.cpp:
3554         * kjs/StringPrototype.h:
3555         * kjs/StructureID.cpp:
3556         * kjs/StructureID.h:
3557         * kjs/SymbolTable.h:
3558         * kjs/collector.cpp:
3559         * kjs/collector.h:
3560         * kjs/completion.h:
3561         * kjs/create_hash_table:
3562         * kjs/debugger.cpp:
3563         * kjs/debugger.h:
3564         * kjs/dtoa.cpp:
3565         * kjs/dtoa.h:
3566         * kjs/grammar.y:
3567         * kjs/identifier.cpp:
3568         * kjs/identifier.h:
3569         (JSC::Identifier::equal):
3570         * kjs/interpreter.cpp:
3571         * kjs/interpreter.h:
3572         * kjs/lexer.cpp:
3573         (JSC::Lexer::Lexer):
3574         (JSC::Lexer::clear):
3575         (JSC::Lexer::makeIdentifier):
3576         * kjs/lexer.h:
3577         * kjs/lookup.cpp:
3578         * kjs/lookup.h:
3579         * kjs/nodes.cpp:
3580         * kjs/nodes.h:
3581         * kjs/nodes2string.cpp:
3582         * kjs/operations.cpp:
3583         * kjs/operations.h:
3584         * kjs/protect.h:
3585         * kjs/regexp.cpp:
3586         * kjs/regexp.h:
3587         * kjs/ustring.cpp:
3588         * kjs/ustring.h:
3589         (JSC::operator!=):
3590         (JSC::IdentifierRepHash::hash):
3591         (WTF::):
3592         * masm/MacroAssembler.h:
3593         * masm/MacroAssemblerWin.cpp:
3594         * masm/X86Assembler.h:
3595         * pcre/pcre_exec.cpp:
3596         * profiler/CallIdentifier.h:
3597         (WTF::):
3598         * profiler/HeavyProfile.cpp:
3599         * profiler/HeavyProfile.h:
3600         * profiler/Profile.cpp:
3601         * profiler/Profile.h:
3602         * profiler/ProfileGenerator.cpp:
3603         * profiler/ProfileGenerator.h:
3604         * profiler/ProfileNode.cpp:
3605         * profiler/ProfileNode.h:
3606         * profiler/Profiler.cpp:
3607         * profiler/Profiler.h:
3608         * profiler/TreeProfile.cpp:
3609         * profiler/TreeProfile.h:
3610         * wrec/WREC.cpp:
3611         * wrec/WREC.h:
3612         * wtf/AVLTree.h:
3613
3614 2008-09-07  Maciej Stachowiak  <mjs@apple.com>
3615
3616         Reviewed by Dan Bernstein.
3617         
3618         - rename IA32MacroAssembler class to X86Assembler
3619         
3620         We otherwise call the platform X86, and also, I don't see any macros.
3621
3622         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3623         * JavaScriptCore.xcodeproj/project.pbxproj:
3624         * masm/IA32MacroAsm.h: Removed.
3625         * masm/MacroAssembler.h:
3626         (KJS::MacroAssembler::MacroAssembler):
3627         * masm/MacroAssemblerWin.cpp:
3628         (KJS::MacroAssembler::emitRestoreArgumentReference):
3629         * masm/X86Assembler.h: Copied from masm/IA32MacroAsm.h.
3630         (KJS::X86Assembler::X86Assembler):
3631         * wrec/WREC.cpp:
3632         (KJS::WRECGenerator::generateNonGreedyQuantifier):
3633         (KJS::WRECGenerator::generateGreedyQuantifier):
3634         (KJS::WRECGenerator::generateParentheses):
3635         (KJS::WRECGenerator::generateBackreference):
3636         (KJS::WRECGenerator::gernerateDisjunction):
3637         * wrec/WREC.h: