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