Emit the WillExecuteStatement debugger hook before the for loop body when the stateme...
[WebKit-https.git] / JavaScriptCore / ChangeLog
1 2008-10-31  Darin Adler  <darin@apple.com>
2
3         Reviewed by Dan Bernstein.
4
5         - fix storage leak seen on buildbot
6
7         Some other cleanup too. The storage leak was caused by the fact
8         that HashTraits<CallIdentifier>::needsDestruction was false, so
9         the call identifier objects didn't get deleted.
10
11         * profiler/CallIdentifier.h:
12         
13         Added a default constructor to create empty call identifiers.
14
15         Changed the normal constructor to use const UString&
16         to avoid extra copying and reference count thrash.
17         
18         Removed the explicit copy constructor definition, since it's what
19         the compiler will automatically generate. (Rule of thumb: Either
20         you need both a custom copy constructor and a custom assignment
21         operator, or neither.)
22
23         Moved the CallIdentifier hash function out of the WTF namespace;
24         there's no reason to put it there.
25
26         Changed the CallIdentifier hash function to be a struct rather than
27         a specialization of the IntHash struct template. Having it be
28         a specialization made no sense, since CallIdentifier is not an integer,
29         and did no good.
30
31         Removed explicit definition of emptyValueIsZero in the hash traits,
32         since inheriting from GenericHashTraits already makes that false.
33
34         Removed explicit definition of emptyValue, instead relying on the
35         default constructor and GenericHashTraits.
36
37         Removed explicit definition of needsDestruction, because we want it
38         to have its default value: true, not false. This fixes the leak!
39
40         Changed constructDeletedValue and isDeletedValue to use a line number
41         of numeric_limits<unsigned>::max() to indicate a value is deleted.
42         Previously this used empty strings for the empty value and null strings
43         for the deleted value, but it's more efficient to use null for both.
44
45 2008-10-31  Timothy Hatcher  <timothy@apple.com>
46
47         Emit the WillExecuteStatement debugger hook before the for loop body
48         when the statement node for the body isn't a block. This allows
49         breakpoints on those statements in the Web Inspector.
50
51         https://bugs.webkit.org/show_bug.cgi?id=22004
52
53         Reviewed by Darin Adler.
54
55         * kjs/nodes.cpp:
56         (JSC::ForNode::emitCode): Emit the WillExecuteStatement
57         debugger hook before the statement node if isn't a block.
58         Also emit the WillExecuteStatement debugger hook for the
59         loop as the first op-code.
60         (JSC::ForInNode::emitCode): Ditto.
61
62 2008-10-31  Timothy Hatcher  <timothy@apple.com>
63
64         Fixes console warnings about not having an autorelease pool.
65         Also fixes the build for Snow Leopard, by including individual
66         Foundation headers instead of Foundation.h.
67
68         https://bugs.webkit.org/show_bug.cgi?id=21995
69
70         Reviewed by Oliver Hunt.
71
72         * profiler/ProfilerServer.mm:
73         (-[ProfilerServer init]): Create a NSAutoreleasePool and drain it.
74
75 2008-10-31  Cameron Zwarich  <zwarich@apple.com>
76
77         Not reviewed.
78
79         Speculative wxWindows build fix.
80
81         * JavaScriptCoreSources.bkl:
82         * jscore.bkl:
83
84 2008-10-31  Cameron Zwarich  <zwarich@apple.com>
85
86         Rubber-stamped by Maciej Stachowiak.
87
88         Move VM/JSPropertyNameIterator.cpp and VM/JSPropertyNameIterator.h to
89         the runtime directory.
90
91         * GNUmakefile.am:
92         * JavaScriptCore.pri:
93         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
94         * JavaScriptCore.xcodeproj/project.pbxproj:
95         * JavaScriptCoreSources.bkl:
96         * VM/JSPropertyNameIterator.cpp: Removed.
97         * VM/JSPropertyNameIterator.h: Removed.
98         * runtime/JSPropertyNameIterator.cpp: Copied from VM/JSPropertyNameIterator.cpp.
99         * runtime/JSPropertyNameIterator.h: Copied from VM/JSPropertyNameIterator.h.
100
101 2008-10-31  Cameron Zwarich  <zwarich@apple.com>
102
103         Not reviewed.
104
105         Speculative wxWindows build fix.
106
107         * jscore.bkl:
108
109 2008-10-30  Mark Rowe  <mrowe@apple.com>
110
111         Reviewed by Jon Homeycutt.
112
113         Explicitly default to building for only the native architecture in debug and release builds.
114
115         * Configurations/DebugRelease.xcconfig:
116
117 2008-10-30  Cameron Zwarich  <zwarich@apple.com>
118
119         Rubber-stamped by Sam Weinig.
120
121         Create a debugger directory in JavaScriptCore and move the relevant
122         files to it.
123
124         * GNUmakefile.am:
125         * JavaScriptCore.pri:
126         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
127         * JavaScriptCore.xcodeproj/project.pbxproj:
128         * VM/CodeBlock.cpp:
129         * VM/CodeGenerator.h:
130         * VM/Machine.cpp:
131         * debugger: Added.
132         * debugger/Debugger.cpp: Copied from kjs/debugger.cpp.
133         * debugger/Debugger.h: Copied from kjs/debugger.h.
134         * debugger/DebuggerCallFrame.cpp: Copied from kjs/DebuggerCallFrame.cpp.
135         * debugger/DebuggerCallFrame.h: Copied from kjs/DebuggerCallFrame.h.
136         * kjs/AllInOneFile.cpp:
137         * kjs/DebuggerCallFrame.cpp: Removed.
138         * kjs/DebuggerCallFrame.h: Removed.
139         * kjs/Parser.cpp:
140         * kjs/Parser.h:
141         * kjs/debugger.cpp: Removed.
142         * kjs/debugger.h: Removed.
143         * kjs/interpreter.cpp:
144         * kjs/nodes.cpp:
145         * runtime/FunctionConstructor.cpp:
146         * runtime/JSGlobalObject.cpp:
147
148 2008-10-30  Benjamin K. Stuhl  <bks24@cornell.edu>
149
150         gcc 4.3.3/linux-x86 generates "suggest parentheses around && within ||"
151         warnings; add some parentheses to disambiguate things. No functional
152         changes, so no tests.
153
154         https://bugs.webkit.org/show_bug.cgi?id=21973
155         Add parentheses to clean up some gcc warnings
156
157         Reviewed by Dan Bernstein.
158
159         * wtf/ASCIICType.h:
160         (WTF::isASCIIAlphanumeric):
161         (WTF::isASCIIHexDigit):
162
163 2008-10-30  Kevin Lindeman  <klindeman@apple.com>
164
165         Adds ProfilerServer, which is a distributed notification listener
166         that allows starting and stopping the profiler remotely for use
167         in conjunction with the profiler's DTace probes.
168
169         https://bugs.webkit.org/show_bug.cgi?id=21719
170
171         Reviewed by Timothy Hatcher.
172
173         * JavaScriptCore.xcodeproj/project.pbxproj:
174         * kjs/JSGlobalData.cpp:
175         (JSC::JSGlobalData::JSGlobalData): Calls startProfilerServerIfNeeded.
176         * profiler/ProfilerServer.h: Added.
177         * profiler/ProfilerServer.mm: Added.
178         (+[ProfilerServer sharedProfileServer]):
179         (-[ProfilerServer init]):
180         (-[ProfilerServer startProfiling]):
181         (-[ProfilerServer stopProfiling]):
182         (JSC::startProfilerServerIfNeeded):
183
184 2008-10-30  Kevin Ollivier  <kevino@theolliviers.com>
185
186         wx build fix after PropertyMap and StructureID merge.
187
188         * JavaScriptCoreSources.bkl:
189
190 2008-10-30  Cameron Zwarich  <zwarich@apple.com>
191
192         Reviewed by Mark Rowe.
193
194         Change the JavaScriptCore Xcode project to use relative paths for the
195         PCRE source files.
196
197         * JavaScriptCore.xcodeproj/project.pbxproj:
198
199 2008-10-30  Sam Weinig  <sam@webkit.org>
200
201         Reviewed by Cameron Zwarich and Geoffrey Garen.
202
203         Fix for https://bugs.webkit.org/show_bug.cgi?id=21989
204         Merge PropertyMap and StructureID
205
206         - Move PropertyMap code into StructureID in preparation for lazily
207           creating the map on gets.
208         - Make remove with transition explicit by adding removePropertyTransition.
209         - Make the put/remove without transition explicit.
210         - Make cache invalidation part of put/remove without transition.
211
212         1% speedup on SunSpider; 0.5% speedup on v8 suite.
213
214         * GNUmakefile.am:
215         * JavaScriptCore.exp:
216         * JavaScriptCore.pri:
217         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
218         * JavaScriptCore.xcodeproj/project.pbxproj:
219         * JavaScriptCoreSources.bkl:
220         * kjs/AllInOneFile.cpp:
221         * kjs/identifier.h:
222         * runtime/JSObject.cpp:
223         (JSC::JSObject::removeDirect):
224         * runtime/JSObject.h:
225         (JSC::JSObject::putDirect):
226         * runtime/PropertyMap.cpp: Removed.
227         * runtime/PropertyMap.h: Removed.
228         * runtime/PropertyMapHashTable.h: Copied from runtime/PropertyMap.h.
229         * runtime/StructureID.cpp:
230         (JSC::StructureID::dumpStatistics):
231         (JSC::StructureID::StructureID):
232         (JSC::StructureID::~StructureID):
233         (JSC::StructureID::getEnumerablePropertyNames):
234         (JSC::StructureID::addPropertyTransition):
235         (JSC::StructureID::removePropertyTransition):
236         (JSC::StructureID::toDictionaryTransition):
237         (JSC::StructureID::changePrototypeTransition):
238         (JSC::StructureID::getterSetterTransition):
239         (JSC::StructureID::addPropertyWithoutTransition):
240         (JSC::StructureID::removePropertyWithoutTransition):
241         (JSC::PropertyMapStatisticsExitLogger::~PropertyMapStatisticsExitLogger):
242         (JSC::StructureID::checkConsistency):
243         (JSC::StructureID::copyPropertyTable):
244         (JSC::StructureID::get):
245         (JSC::StructureID::put):
246         (JSC::StructureID::remove):
247         (JSC::StructureID::insertIntoPropertyMapHashTable):
248         (JSC::StructureID::expandPropertyMapHashTable):
249         (JSC::StructureID::createPropertyMapHashTable):
250         (JSC::StructureID::rehashPropertyMapHashTable):
251         (JSC::comparePropertyMapEntryIndices):
252         (JSC::StructureID::getEnumerablePropertyNamesInternal):
253         * runtime/StructureID.h:
254         (JSC::StructureID::propertyStorageSize):
255         (JSC::StructureID::isEmpty):
256         (JSC::StructureID::get):
257
258 2008-10-30  Cameron Zwarich  <zwarich@apple.com>
259
260         Reviewed by Oliver Hunt.
261
262         Bug 21987: CTI::putDoubleResultToJSNumberCellOrJSImmediate() hardcodes its result register
263         <https://bugs.webkit.org/show_bug.cgi?id=21987>
264
265         CTI::putDoubleResultToJSNumberCellOrJSImmediate() hardcodes its result
266         register as ecx, but it should be tempReg1, which is ecx at all of its
267         callsites.
268
269         * VM/CTI.cpp:
270         (JSC::CTI::putDoubleResultToJSNumberCellOrJSImmediate):
271
272 2008-10-30  Cameron Zwarich  <zwarich@apple.com>
273
274         Reviewed by Sam Weinig.
275
276         Bug 21985: Opcodes should use eax as their destination register whenever possible
277         <https://bugs.webkit.org/show_bug.cgi?id=21985>
278
279         Change more opcodes to use eax as the register for their final result,
280         and change calls to emitPutResult() that pass eax to rely on the default
281         value of eax.
282
283         * VM/CTI.cpp:
284         (JSC::CTI::privateCompileMainPass):
285
286 2008-10-30  Alp Toker  <alp@nuanti.com>
287
288         Build fix attempt for older gcc on the trunk-mac-intel build bot
289         (error: initializer for scalar variable requires one element).
290
291         Modify the initializer syntax slightly with an additional comma.
292
293         * VM/Machine.cpp:
294         (JSC::Machine::cti_op_call_JSFunction):
295         (JSC::Machine::cti_op_construct_JSConstruct):
296         (JSC::Machine::cti_op_resolve_func):
297         (JSC::Machine::cti_op_post_inc):
298         (JSC::Machine::cti_op_resolve_with_base):
299         (JSC::Machine::cti_op_post_dec):
300
301 2008-10-30  Alp Toker  <alp@nuanti.com>
302
303         Reviewed by Alexey Proskuryakov.
304
305         https://bugs.webkit.org/show_bug.cgi?id=21571
306         VoidPtrPair breaks CTI on Linux
307
308         The VoidPtrPair return change made in r37457 does not work on Linux
309         since POD structs aren't passed in registers.
310
311         This patch uses a union to vectorize VoidPtrPair to a uint64_t and
312         matches Darwin/MSVC fixing CTI/WREC on Linux.
313
314         Alexey reports no measurable change in Mac performance with this fix.
315
316         * VM/Machine.cpp:
317         (JSC::Machine::cti_op_call_JSFunction):
318         (JSC::Machine::cti_op_construct_JSConstruct):
319         (JSC::Machine::cti_op_resolve_func):
320         (JSC::Machine::cti_op_post_inc):
321         (JSC::Machine::cti_op_resolve_with_base):
322         (JSC::Machine::cti_op_post_dec):
323         * VM/Machine.h:
324         (JSC::):
325
326 2008-10-29  Oliver Hunt  <oliver@apple.com>
327
328         Reviewed by Geoff Garen.
329
330         Initial work to reduce cost of JSNumberCell allocation
331
332         This does the initial work needed to bring more of number
333         allocation into CTI code directly, rather than just falling
334         back onto the slow paths if we can't guarantee that a number
335         cell can be reused.
336
337         Initial implementation only used by op_negate to make sure
338         it all works.  In a negate heavy (though not dominated) test
339         it results in a 10% win in the non-reusable cell case.
340
341         * VM/CTI.cpp:
342         (JSC::):
343         (JSC::CTI::emitAllocateNumber):
344         (JSC::CTI::emitNakedFastCall):
345         (JSC::CTI::emitArithIntToImmWithJump):
346         (JSC::CTI::privateCompileMainPass):
347         (JSC::CTI::privateCompileSlowCases):
348         * VM/CTI.h:
349         * VM/CodeBlock.cpp:
350         (JSC::CodeBlock::dump):
351         * VM/CodeGenerator.cpp:
352         (JSC::CodeGenerator::emitUnaryOp):
353         * VM/CodeGenerator.h:
354         (JSC::CodeGenerator::emitToJSNumber):
355         (JSC::CodeGenerator::emitTypeOf):
356         (JSC::CodeGenerator::emitGetPropertyNames):
357         * VM/Machine.cpp:
358         (JSC::Machine::privateExecute):
359         * VM/Machine.h:
360         * kjs/ResultType.h:
361         (JSC::ResultType::isReusableNumber):
362         (JSC::ResultType::toInt):
363         * kjs/nodes.cpp:
364         (JSC::UnaryOpNode::emitCode):
365         (JSC::BinaryOpNode::emitCode):
366         (JSC::EqualNode::emitCode):
367         * masm/X86Assembler.h:
368         (JSC::X86Assembler::):
369         (JSC::X86Assembler::negl_r):
370         (JSC::X86Assembler::xorpd_mr):
371         * runtime/JSNumberCell.h:
372         (JSC::JSNumberCell::JSNumberCell):
373
374 2008-10-29  Steve Falkenburg  <sfalken@apple.com>
375
376         <rdar://problem/6326563> Crash on launch
377
378         For Windows, export explicit functions rather than exporting data for atomicallyInitializedStaticMutex.
379         
380         Exporting data from a DLL on Windows requires specifying __declspec(dllimport) in the header used by
381         callers, but __declspec(dllexport) when defined in the DLL implementation. By instead exporting
382         the explicit lock/unlock functions, we can avoid this.
383         
384         Fixes a crash on launch, since we were previously erroneously exporting atomicallyInitializedStaticMutex as a function.
385         
386         Reviewed by Darin Adler.
387
388         * wtf/Threading.h:
389         (WTF::lockAtomicallyInitializedStaticMutex):
390         (WTF::unlockAtomicallyInitializedStaticMutex):
391         * wtf/ThreadingWin.cpp:
392         (WTF::lockAtomicallyInitializedStaticMutex):
393         (WTF::unlockAtomicallyInitializedStaticMutex):
394
395 2008-10-29  Sam Weinig  <sam@webkit.org>
396
397         Reviewed by Oliver Hunt.
398
399         Remove direct use of PropertyMap.
400
401         * JavaScriptCore.exp:
402         * runtime/JSObject.cpp:
403         (JSC::JSObject::mark):
404         (JSC::JSObject::put):
405         (JSC::JSObject::deleteProperty):
406         (JSC::JSObject::getPropertyAttributes):
407         (JSC::JSObject::removeDirect):
408         * runtime/JSObject.h:
409         (JSC::JSObject::getDirect):
410         (JSC::JSObject::getDirectLocation):
411         (JSC::JSObject::hasCustomProperties):
412         (JSC::JSObject::JSObject):
413         (JSC::JSObject::putDirect):
414         * runtime/PropertyMap.cpp:
415         (JSC::PropertyMap::get):
416         * runtime/PropertyMap.h:
417         (JSC::PropertyMap::isEmpty):
418         (JSC::PropertyMap::get):
419         * runtime/StructureID.cpp:
420         (JSC::StructureID::dumpStatistics):
421         * runtime/StructureID.h:
422         (JSC::StructureID::propertyStorageSize):
423         (JSC::StructureID::get):
424         (JSC::StructureID::put):
425         (JSC::StructureID::remove):
426         (JSC::StructureID::isEmpty):
427
428 2008-10-29  Sam Weinig  <sam@webkit.org>
429
430         Reviewed by Geoffrey Garen.
431
432         Rename and move the StructureID transition table to its own file.
433
434         * GNUmakefile.am:
435         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
436         * JavaScriptCore.xcodeproj/project.pbxproj:
437         * runtime/StructureID.cpp:
438         (JSC::StructureID::addPropertyTransition):
439         * runtime/StructureID.h:
440         (JSC::StructureID::):
441         * runtime/StructureIDTransitionTable.h: Copied from runtime/StructureID.h.
442         (JSC::StructureIDTransitionTableHash::hash):
443         (JSC::StructureIDTransitionTableHash::equal):
444
445 2008-10-29  Sam Weinig  <sam@webkit.org>
446
447         Reviewed by Cameron Zwarich.
448
449         Fix for https://bugs.webkit.org/show_bug.cgi?id=21958
450         Pack bits in StructureID to reduce the size of each StructureID by 2 words.
451
452         * runtime/PropertyMap.h:
453         (JSC::PropertyMap::propertyMapSize):
454         * runtime/StructureID.cpp:
455         (JSC::StructureID::dumpStatistics): Add additional size statistics when dumping.
456         (JSC::StructureID::StructureID):
457         * runtime/StructureID.h:
458
459 2008-10-29  Kevin Ollivier  <kevino@theolliviers.com>
460
461         wx build fixes after addition of runtime and ImageBuffer changes.
462
463         * JavaScriptCoreSources.bkl:
464         * jscore.bkl:
465
466 2008-10-29  Timothy Hatcher  <timothy@apple.com>
467
468         Emit the WillExecuteStatement debugger hook before the "else" body
469         when there is no block for the "else" body. This allows breakpoints
470         on those statements in the Web Inspector.
471
472         https://bugs.webkit.org/show_bug.cgi?id=21944
473
474         Reviewed by Maciej Stachowiak.
475
476         * kjs/nodes.cpp:
477         (JSC::IfElseNode::emitCode): Emit the WillExecuteStatement
478         debugger hook before the else node if isn't a block.
479
480 2008-10-29  Alexey Proskuryakov  <ap@webkit.org>
481
482         Build fix.
483
484         * JavaScriptCore.exp: Export HashTable::deleteTable().
485
486 2008-10-28  Alp Toker  <alp@nuanti.com>
487
488         Fix builddir != srcdir builds after kjs -> runtime breakage. Sources
489         may now be generated in both kjs/ and runtime/.
490
491         Also sort the sources list for readability.
492
493         * GNUmakefile.am:
494
495 2008-10-28  Alp Toker  <alp@nuanti.com>
496
497         Reviewed by Cameron Zwarich.
498
499         Build fix attempt after kjs -> runtime rename.
500
501         * GNUmakefile.am:
502
503 2008-10-28  Cameron Zwarich  <zwarich@apple.com>
504
505         Not reviewed.
506
507         Remove a duplicate includes directory.
508
509         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
510
511 2008-10-28  Cameron Zwarich  <zwarich@apple.com>
512
513         Not reviewed.
514
515         Attempt to fix the Windows build.
516
517         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
518         * JavaScriptCore.vcproj/jsc/jsc.vcproj:
519
520 2008-10-28  Dan Bernstein  <mitz@apple.com>
521
522         Reviewed by Mark Rowe.
523
524         - export WTF::atomicallyInitializedStaticMutex
525
526         * JavaScriptCore.exp:
527
528 2008-10-28  Geoffrey Garen  <ggaren@apple.com>
529
530         Reviewed by Cameron Zwarich.
531         
532         Fixed CodeBlock dumping to accurately report constant register indices.
533
534         * VM/CodeBlock.cpp:
535         (JSC::CodeBlock::dump):
536
537 2008-10-28  Cameron Zwarich  <zwarich@apple.com>
538
539         Not reviewed.
540
541         More Qt build fixes.
542
543         * JavaScriptCore.pri:
544
545 2008-10-28  Cameron Zwarich  <zwarich@apple.com>
546
547         Not reviewed.
548
549         Fix the Qt build, hopefully for real this time.
550
551         * JavaScriptCore.pri:
552
553 2008-10-28  Cameron Zwarich  <zwarich@apple.com>
554
555         Not reviewed.
556
557         Fix the Qt build.
558
559         * JavaScriptCore.pri:
560
561 2008-10-28  Cameron Zwarich  <zwarich@apple.com>
562
563         Not reviewed.
564
565         Fix the Windows build.
566
567         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
568
569 2008-10-28  Cameron Zwarich  <zwarich@apple.com>
570
571         Rubber-stamped by Sam Weinig.
572
573         Create a runtime directory in JavaScriptCore and begin moving files to
574         it. This is the first step towards removing the kjs directory and
575         placing files in more meaningful subdirectories of JavaScriptCore.
576
577         * API/JSBase.cpp:
578         * API/JSCallbackConstructor.cpp:
579         * API/JSCallbackConstructor.h:
580         * API/JSCallbackFunction.cpp:
581         * API/JSClassRef.cpp:
582         * API/JSClassRef.h:
583         * API/JSStringRefCF.cpp:
584         * API/JSValueRef.cpp:
585         * API/OpaqueJSString.cpp:
586         * DerivedSources.make:
587         * GNUmakefile.am:
588         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
589         * JavaScriptCore.xcodeproj/project.pbxproj:
590         * kjs/AllInOneFile.cpp:
591         * kjs/ArrayConstructor.cpp: Removed.
592         * kjs/ArrayConstructor.h: Removed.
593         * kjs/ArrayPrototype.cpp: Removed.
594         * kjs/ArrayPrototype.h: Removed.
595         * kjs/BooleanConstructor.cpp: Removed.
596         * kjs/BooleanConstructor.h: Removed.
597         * kjs/BooleanObject.cpp: Removed.
598         * kjs/BooleanObject.h: Removed.
599         * kjs/BooleanPrototype.cpp: Removed.
600         * kjs/BooleanPrototype.h: Removed.
601         * kjs/CallData.cpp: Removed.
602         * kjs/CallData.h: Removed.
603         * kjs/ClassInfo.h: Removed.
604         * kjs/ConstructData.cpp: Removed.
605         * kjs/ConstructData.h: Removed.
606         * kjs/DateConstructor.cpp: Removed.
607         * kjs/DateConstructor.h: Removed.
608         * kjs/DateInstance.cpp: Removed.
609         * kjs/DateInstance.h: Removed.
610         * kjs/DateMath.cpp: Removed.
611         * kjs/DateMath.h: Removed.
612         * kjs/DatePrototype.cpp: Removed.
613         * kjs/DatePrototype.h: Removed.
614         * kjs/Error.cpp: Removed.
615         * kjs/Error.h: Removed.
616         * kjs/ErrorConstructor.cpp: Removed.
617         * kjs/ErrorConstructor.h: Removed.
618         * kjs/ErrorInstance.cpp: Removed.
619         * kjs/ErrorInstance.h: Removed.
620         * kjs/ErrorPrototype.cpp: Removed.
621         * kjs/ErrorPrototype.h: Removed.
622         * kjs/FunctionConstructor.cpp: Removed.
623         * kjs/FunctionConstructor.h: Removed.
624         * kjs/FunctionPrototype.cpp: Removed.
625         * kjs/FunctionPrototype.h: Removed.
626         * kjs/GlobalEvalFunction.cpp: Removed.
627         * kjs/GlobalEvalFunction.h: Removed.
628         * kjs/InternalFunction.cpp: Removed.
629         * kjs/InternalFunction.h: Removed.
630         * kjs/JSArray.cpp: Removed.
631         * kjs/JSArray.h: Removed.
632         * kjs/JSCell.cpp: Removed.
633         * kjs/JSCell.h: Removed.
634         * kjs/JSFunction.cpp: Removed.
635         * kjs/JSFunction.h: Removed.
636         * kjs/JSGlobalObject.cpp: Removed.
637         * kjs/JSGlobalObject.h: Removed.
638         * kjs/JSGlobalObjectFunctions.cpp: Removed.
639         * kjs/JSGlobalObjectFunctions.h: Removed.
640         * kjs/JSImmediate.cpp: Removed.
641         * kjs/JSImmediate.h: Removed.
642         * kjs/JSNotAnObject.cpp: Removed.
643         * kjs/JSNotAnObject.h: Removed.
644         * kjs/JSNumberCell.cpp: Removed.
645         * kjs/JSNumberCell.h: Removed.
646         * kjs/JSObject.cpp: Removed.
647         * kjs/JSObject.h: Removed.
648         * kjs/JSString.cpp: Removed.
649         * kjs/JSString.h: Removed.
650         * kjs/JSValue.cpp: Removed.
651         * kjs/JSValue.h: Removed.
652         * kjs/JSVariableObject.cpp: Removed.
653         * kjs/JSVariableObject.h: Removed.
654         * kjs/JSWrapperObject.cpp: Removed.
655         * kjs/JSWrapperObject.h: Removed.
656         * kjs/MathObject.cpp: Removed.
657         * kjs/MathObject.h: Removed.
658         * kjs/NativeErrorConstructor.cpp: Removed.
659         * kjs/NativeErrorConstructor.h: Removed.
660         * kjs/NativeErrorPrototype.cpp: Removed.
661         * kjs/NativeErrorPrototype.h: Removed.
662         * kjs/NumberConstructor.cpp: Removed.
663         * kjs/NumberConstructor.h: Removed.
664         * kjs/NumberObject.cpp: Removed.
665         * kjs/NumberObject.h: Removed.
666         * kjs/NumberPrototype.cpp: Removed.
667         * kjs/NumberPrototype.h: Removed.
668         * kjs/ObjectConstructor.cpp: Removed.
669         * kjs/ObjectConstructor.h: Removed.
670         * kjs/ObjectPrototype.cpp: Removed.
671         * kjs/ObjectPrototype.h: Removed.
672         * kjs/PropertyMap.cpp: Removed.
673         * kjs/PropertyMap.h: Removed.
674         * kjs/PropertySlot.cpp: Removed.
675         * kjs/PropertySlot.h: Removed.
676         * kjs/PrototypeFunction.cpp: Removed.
677         * kjs/PrototypeFunction.h: Removed.
678         * kjs/PutPropertySlot.h: Removed.
679         * kjs/SmallStrings.cpp: Removed.
680         * kjs/SmallStrings.h: Removed.
681         * kjs/StringConstructor.cpp: Removed.
682         * kjs/StringConstructor.h: Removed.
683         * kjs/StringObject.cpp: Removed.
684         * kjs/StringObject.h: Removed.
685         * kjs/StringObjectThatMasqueradesAsUndefined.h: Removed.
686         * kjs/StringPrototype.cpp: Removed.
687         * kjs/StringPrototype.h: Removed.
688         * kjs/StructureID.cpp: Removed.
689         * kjs/StructureID.h: Removed.
690         * kjs/completion.h:
691         * kjs/interpreter.h:
692         * runtime: Added.
693         * runtime/ArrayConstructor.cpp: Copied from kjs/ArrayConstructor.cpp.
694         * runtime/ArrayConstructor.h: Copied from kjs/ArrayConstructor.h.
695         * runtime/ArrayPrototype.cpp: Copied from kjs/ArrayPrototype.cpp.
696         * runtime/ArrayPrototype.h: Copied from kjs/ArrayPrototype.h.
697         * runtime/BooleanConstructor.cpp: Copied from kjs/BooleanConstructor.cpp.
698         * runtime/BooleanConstructor.h: Copied from kjs/BooleanConstructor.h.
699         * runtime/BooleanObject.cpp: Copied from kjs/BooleanObject.cpp.
700         * runtime/BooleanObject.h: Copied from kjs/BooleanObject.h.
701         * runtime/BooleanPrototype.cpp: Copied from kjs/BooleanPrototype.cpp.
702         * runtime/BooleanPrototype.h: Copied from kjs/BooleanPrototype.h.
703         * runtime/CallData.cpp: Copied from kjs/CallData.cpp.
704         * runtime/CallData.h: Copied from kjs/CallData.h.
705         * runtime/ClassInfo.h: Copied from kjs/ClassInfo.h.
706         * runtime/ConstructData.cpp: Copied from kjs/ConstructData.cpp.
707         * runtime/ConstructData.h: Copied from kjs/ConstructData.h.
708         * runtime/DateConstructor.cpp: Copied from kjs/DateConstructor.cpp.
709         * runtime/DateConstructor.h: Copied from kjs/DateConstructor.h.
710         * runtime/DateInstance.cpp: Copied from kjs/DateInstance.cpp.
711         * runtime/DateInstance.h: Copied from kjs/DateInstance.h.
712         * runtime/DateMath.cpp: Copied from kjs/DateMath.cpp.
713         * runtime/DateMath.h: Copied from kjs/DateMath.h.
714         * runtime/DatePrototype.cpp: Copied from kjs/DatePrototype.cpp.
715         * runtime/DatePrototype.h: Copied from kjs/DatePrototype.h.
716         * runtime/Error.cpp: Copied from kjs/Error.cpp.
717         * runtime/Error.h: Copied from kjs/Error.h.
718         * runtime/ErrorConstructor.cpp: Copied from kjs/ErrorConstructor.cpp.
719         * runtime/ErrorConstructor.h: Copied from kjs/ErrorConstructor.h.
720         * runtime/ErrorInstance.cpp: Copied from kjs/ErrorInstance.cpp.
721         * runtime/ErrorInstance.h: Copied from kjs/ErrorInstance.h.
722         * runtime/ErrorPrototype.cpp: Copied from kjs/ErrorPrototype.cpp.
723         * runtime/ErrorPrototype.h: Copied from kjs/ErrorPrototype.h.
724         * runtime/FunctionConstructor.cpp: Copied from kjs/FunctionConstructor.cpp.
725         * runtime/FunctionConstructor.h: Copied from kjs/FunctionConstructor.h.
726         * runtime/FunctionPrototype.cpp: Copied from kjs/FunctionPrototype.cpp.
727         * runtime/FunctionPrototype.h: Copied from kjs/FunctionPrototype.h.
728         * runtime/GlobalEvalFunction.cpp: Copied from kjs/GlobalEvalFunction.cpp.
729         * runtime/GlobalEvalFunction.h: Copied from kjs/GlobalEvalFunction.h.
730         * runtime/InternalFunction.cpp: Copied from kjs/InternalFunction.cpp.
731         * runtime/InternalFunction.h: Copied from kjs/InternalFunction.h.
732         * runtime/JSArray.cpp: Copied from kjs/JSArray.cpp.
733         * runtime/JSArray.h: Copied from kjs/JSArray.h.
734         * runtime/JSCell.cpp: Copied from kjs/JSCell.cpp.
735         * runtime/JSCell.h: Copied from kjs/JSCell.h.
736         * runtime/JSFunction.cpp: Copied from kjs/JSFunction.cpp.
737         * runtime/JSFunction.h: Copied from kjs/JSFunction.h.
738         * runtime/JSGlobalObject.cpp: Copied from kjs/JSGlobalObject.cpp.
739         * runtime/JSGlobalObject.h: Copied from kjs/JSGlobalObject.h.
740         * runtime/JSGlobalObjectFunctions.cpp: Copied from kjs/JSGlobalObjectFunctions.cpp.
741         * runtime/JSGlobalObjectFunctions.h: Copied from kjs/JSGlobalObjectFunctions.h.
742         * runtime/JSImmediate.cpp: Copied from kjs/JSImmediate.cpp.
743         * runtime/JSImmediate.h: Copied from kjs/JSImmediate.h.
744         * runtime/JSNotAnObject.cpp: Copied from kjs/JSNotAnObject.cpp.
745         * runtime/JSNotAnObject.h: Copied from kjs/JSNotAnObject.h.
746         * runtime/JSNumberCell.cpp: Copied from kjs/JSNumberCell.cpp.
747         * runtime/JSNumberCell.h: Copied from kjs/JSNumberCell.h.
748         * runtime/JSObject.cpp: Copied from kjs/JSObject.cpp.
749         * runtime/JSObject.h: Copied from kjs/JSObject.h.
750         * runtime/JSString.cpp: Copied from kjs/JSString.cpp.
751         * runtime/JSString.h: Copied from kjs/JSString.h.
752         * runtime/JSValue.cpp: Copied from kjs/JSValue.cpp.
753         * runtime/JSValue.h: Copied from kjs/JSValue.h.
754         * runtime/JSVariableObject.cpp: Copied from kjs/JSVariableObject.cpp.
755         * runtime/JSVariableObject.h: Copied from kjs/JSVariableObject.h.
756         * runtime/JSWrapperObject.cpp: Copied from kjs/JSWrapperObject.cpp.
757         * runtime/JSWrapperObject.h: Copied from kjs/JSWrapperObject.h.
758         * runtime/MathObject.cpp: Copied from kjs/MathObject.cpp.
759         * runtime/MathObject.h: Copied from kjs/MathObject.h.
760         * runtime/NativeErrorConstructor.cpp: Copied from kjs/NativeErrorConstructor.cpp.
761         * runtime/NativeErrorConstructor.h: Copied from kjs/NativeErrorConstructor.h.
762         * runtime/NativeErrorPrototype.cpp: Copied from kjs/NativeErrorPrototype.cpp.
763         * runtime/NativeErrorPrototype.h: Copied from kjs/NativeErrorPrototype.h.
764         * runtime/NumberConstructor.cpp: Copied from kjs/NumberConstructor.cpp.
765         * runtime/NumberConstructor.h: Copied from kjs/NumberConstructor.h.
766         * runtime/NumberObject.cpp: Copied from kjs/NumberObject.cpp.
767         * runtime/NumberObject.h: Copied from kjs/NumberObject.h.
768         * runtime/NumberPrototype.cpp: Copied from kjs/NumberPrototype.cpp.
769         * runtime/NumberPrototype.h: Copied from kjs/NumberPrototype.h.
770         * runtime/ObjectConstructor.cpp: Copied from kjs/ObjectConstructor.cpp.
771         * runtime/ObjectConstructor.h: Copied from kjs/ObjectConstructor.h.
772         * runtime/ObjectPrototype.cpp: Copied from kjs/ObjectPrototype.cpp.
773         * runtime/ObjectPrototype.h: Copied from kjs/ObjectPrototype.h.
774         * runtime/PropertyMap.cpp: Copied from kjs/PropertyMap.cpp.
775         * runtime/PropertyMap.h: Copied from kjs/PropertyMap.h.
776         * runtime/PropertySlot.cpp: Copied from kjs/PropertySlot.cpp.
777         * runtime/PropertySlot.h: Copied from kjs/PropertySlot.h.
778         * runtime/PrototypeFunction.cpp: Copied from kjs/PrototypeFunction.cpp.
779         * runtime/PrototypeFunction.h: Copied from kjs/PrototypeFunction.h.
780         * runtime/PutPropertySlot.h: Copied from kjs/PutPropertySlot.h.
781         * runtime/SmallStrings.cpp: Copied from kjs/SmallStrings.cpp.
782         * runtime/SmallStrings.h: Copied from kjs/SmallStrings.h.
783         * runtime/StringConstructor.cpp: Copied from kjs/StringConstructor.cpp.
784         * runtime/StringConstructor.h: Copied from kjs/StringConstructor.h.
785         * runtime/StringObject.cpp: Copied from kjs/StringObject.cpp.
786         * runtime/StringObject.h: Copied from kjs/StringObject.h.
787         * runtime/StringObjectThatMasqueradesAsUndefined.h: Copied from kjs/StringObjectThatMasqueradesAsUndefined.h.
788         * runtime/StringPrototype.cpp: Copied from kjs/StringPrototype.cpp.
789         * runtime/StringPrototype.h: Copied from kjs/StringPrototype.h.
790         * runtime/StructureID.cpp: Copied from kjs/StructureID.cpp.
791         * runtime/StructureID.h: Copied from kjs/StructureID.h.
792
793 2008-10-28  Geoffrey Garen  <ggaren@apple.com>
794
795         Reviewed by Sam Weinig.
796         
797         Fixed https://bugs.webkit.org/show_bug.cgi?id=21919
798         Sampler reports bogus time in op_enter during 3d-raytrace.js
799         
800         Fixed a bug where we would pass the incorrect Instruction* during some
801         parts of CTI codegen.
802
803         * VM/CTI.cpp:
804         (JSC::CTI::privateCompileMainPass):
805         (JSC::CTI::privateCompileSlowCases):
806         * VM/SamplingTool.cpp:
807         (JSC::SamplingTool::run):
808         * wtf/Platform.h:
809
810 2008-10-28  Kevin McCullough  <kmccullough@apple.com>
811
812         Reviewed by Dan Bernstein.
813
814         -Removed unused includes.
815         Apparent .4% speedup in Sunspider
816
817         * kjs/JSObject.cpp:
818         * kjs/interpreter.cpp:
819
820 2008-10-28  Alp Toker  <alp@nuanti.com>
821
822         Include copyright license files in the autotools dist target.
823
824         Change suggested by Mike Hommey.
825
826         * GNUmakefile.am:
827
828 2008-10-27  Geoffrey Garen  <ggaren@apple.com>
829
830         Reviewed by Maciej Stachowiak.
831         
832         Stop discarding CodeBlock samples that can't be charged to a specific
833         opcode. Instead, charge the relevant CodeBlock, and provide a footnote
834         explaining the situation.
835         
836         This will help us tell which CodeBlocks are hot, even if we can't
837         identify specific lines of code within the CodeBlocks.
838
839         * VM/SamplingTool.cpp:
840         (JSC::ScopeSampleRecord::sample):
841         (JSC::compareScopeSampleRecords):
842         (JSC::SamplingTool::dump):
843
844         * VM/SamplingTool.h:
845         (JSC::ScopeSampleRecord::ScopeSampleRecord):
846         (JSC::ScopeSampleRecord::~ScopeSampleRecord):
847
848 2008-10-27  Geoffrey Garen  <ggaren@apple.com>
849
850         Reviewed by Sam Weinig.
851         
852         Added a mutex around the SamplingTool's ScopeNode* map, to solve a crash
853         when sampling the v8 tests.
854
855         * VM/SamplingTool.cpp:
856         (JSC::SamplingTool::run):
857         (JSC::SamplingTool::notifyOfScope):
858         * VM/SamplingTool.h: Since new ScopeNodes can be created after
859         the SamplingTools has begun sampling, reads and writes to / from the
860         map need to be synchronized. Shark says this doesn't measurably increase
861         sampling overhead.
862
863 2008-10-25  Geoffrey Garen  <ggaren@apple.com>
864
865         Not reviewed.
866         
867         Try to fix Windows build.
868
869         * VM/Machine.cpp:
870         (JSC::Machine::privateExecute): Provide a dummy value to the
871         HostCallRecord in CTI non-sampling builds, to silence compiler warning.
872
873 2008-10-25  Geoffrey Garen  <ggaren@apple.com>
874
875         Not reviewed.
876         
877         Try to fix Windows build.
878
879         * VM/SamplingTool.h:
880         (JSC::SamplingTool::encodeSample): Explicitly cast bool to int, to
881         silence compiler warning.
882
883 2008-10-25  Geoffrey Garen  <ggaren@apple.com>
884
885         Reviewed by Sam Weinig, with Gavin Barraclough's help.
886         
887         Fixed Sampling Tool:
888             - Made CodeBlock sampling work with CTI
889             - Improved accuracy by unifying most sampling data into a single
890               32bit word, which can be written / read atomically.
891             - Split out three different #ifdefs for modularity: OPCODE_SAMPLING;
892               CODEBLOCK_SAMPLING; OPCODE_STATS.
893             - Improved reporting clarity
894             - Refactored for code clarity
895
896         * JavaScriptCore.exp: Exported another symbol.
897
898         * VM/CTI.cpp:
899         (JSC::CTI::emitCTICall):
900         (JSC::CTI::compileOpCall):
901         (JSC::CTI::emitSlowScriptCheck):
902         (JSC::CTI::compileBinaryArithOpSlowCase):
903         (JSC::CTI::privateCompileMainPass):
904         (JSC::CTI::privateCompileSlowCases):
905         (JSC::CTI::privateCompile):
906         * VM/CTI.h: Updated CTI codegen to use the unified SamplingTool interface
907         for encoding samples. (This required passing the current vPC to a lot
908         more functions, since the unified interface samples the current vPC.)
909         Added hooks for writing the current CodeBlock* on function entry and
910         after a function call, for the sake of the CodeBlock sampler. Removed
911         obsolete hook for clearing the current sample inside op_end. Also removed
912         the custom enum used to differentiate flavors of op_call, since the
913         OpcodeID enum works just as well. (This was important in an earlier
914         version of the patch, but now it's just cleanup.)
915
916         * VM/CodeBlock.cpp:
917         (JSC::CodeBlock::lineNumberForVPC):
918         * VM/CodeBlock.h: Upated for refactored #ifdefs. Changed lineNumberForVPC
919         to be robust against vPCs not recorded for exception handling, since
920         the Sampler may ask for an arbitrary vPC.
921
922         * VM/Machine.cpp:
923         (JSC::Machine::execute):
924         (JSC::Machine::privateExecute):
925         (JSC::Machine::cti_op_call_NotJSFunction):
926         (JSC::Machine::cti_op_construct_NotJSConstruct):
927         * VM/Machine.h:
928         (JSC::Machine::setSampler):
929         (JSC::Machine::sampler):
930         (JSC::Machine::jitCodeBuffer): Upated for refactored #ifdefs. Changed
931         Machine to use SamplingTool helper objects to record movement in and
932         out of host code. This makes samples a bit more precise.
933         
934         * VM/Opcode.cpp:
935         (JSC::OpcodeStats::~OpcodeStats):
936         * VM/Opcode.h: Upated for refactored #ifdefs. Added a little more padding,
937         to accomodate our more verbose opcode names.
938
939         * VM/SamplingTool.cpp:
940         (JSC::ScopeSampleRecord::sample): Only count a sample toward our total
941         if we actually record it. This solves cases where a CodeBlock will
942         claim to have been sampled many times, with reported samples that don't
943         match.
944
945         (JSC::SamplingTool::run): Read the current sample into a Sample helper
946         object, to ensure that the data doesn't change while we're analyzing it,
947         and to help decode the data. Only access the CodeBlock sampling hash
948         table if CodeBlock sampling has been enabled, so non-CodeBlock sampling
949         runs can operate with even less overhead.
950
951         (JSC::SamplingTool::dump): I reorganized this code a lot to print the
952         most important info at the top, print as a table, annotate and document
953         the stuff I didn't understand when I started, etc.
954
955         * VM/SamplingTool.h: New helper classes, described above.
956
957         * kjs/Parser.h:
958         * kjs/Shell.cpp:
959         (runWithScripts):
960         * kjs/nodes.cpp:
961         (JSC::ScopeNode::ScopeNode): Updated for new sampling APIs.
962
963         * wtf/Platform.h: Moved sampling #defines here, since our custom is to
964         put ENABLE #defines into Platform.h. Made explicit the fact that
965         CODEBLOCK_SAMPLING depends on OPCODE_SAMPLING.
966
967 2008-10-25  Jan Michael Alonzo  <jmalonzo@webkit.org>
968
969         JSC Build fix, not reviewed.
970
971         * VM/CTI.cpp: add missing include stdio.h for debug builds
972
973 2008-10-24  Eric Seidel  <eric@webkit.org>
974
975         Reviewed by Darin Adler.
976         
977         Get rid of a bonus ASSERT when using a null string as a regexp.
978         Specifically calling: RegularExpression::match() with String::empty()
979         will hit this ASSERT.
980         Chromium hits this, but I don't know of any way to make a layout test.
981
982         * pcre/pcre_exec.cpp:
983         (jsRegExpExecute):
984
985 2008-10-24  Alexey Proskuryakov  <ap@webkit.org>
986
987         Suggested and rubber-stamped by Geoff Garen.
988
989         Fix a crash when opening Font Picker.
990
991         The change also hopefully fixes this bug, which I could never reproduce:
992         https://bugs.webkit.org/show_bug.cgi?id=20241
993         <rdar://problem/6290576> Safari crashes at JSValueUnprotect() when fontpicker view close
994
995         * API/JSContextRef.cpp: (JSContextGetGlobalObject): Use lexical global object instead of
996         dynamic one.
997
998 2008-10-24  Cameron Zwarich  <zwarich@apple.com>
999
1000         Reviewed by Geoff Garen.
1001
1002         Remove ScopeChainNode::bottom() and inline it into its only caller,
1003         ScopeChainnode::globalObject().
1004
1005         * kjs/JSGlobalObject.h:
1006         (JSC::ScopeChainNode::globalObject):
1007         * kjs/ScopeChain.h:
1008         (JSC::ScopeChain::bottom):
1009
1010 2008-10-24  Cameron Zwarich  <zwarich@apple.com>
1011
1012         Reviewed by Maciej Stachowiak.
1013
1014         Bug 21862: Create JSFunction prototype property lazily
1015         <https://bugs.webkit.org/show_bug.cgi?id=21862>
1016
1017         This is a 1.5% speedup on SunSpider and a 1.4% speedup on the V8
1018         benchmark suite, including a 3.8% speedup on Earley-Boyer.
1019
1020         * kjs/JSFunction.cpp:
1021         (JSC::JSFunction::getOwnPropertySlot):
1022         * kjs/nodes.cpp:
1023         (JSC::FuncDeclNode::makeFunction):
1024         (JSC::FuncExprNode::makeFunction):
1025
1026 2008-10-24  Greg Bolsinga  <bolsinga@apple.com>
1027
1028         Reviewed by Sam Weinig.
1029
1030         https://bugs.webkit.org/show_bug.cgi?id=21475
1031         
1032         Provide support for the Geolocation API
1033         
1034         http://dev.w3.org/geo/api/spec-source.html
1035
1036         * wtf/Platform.h: ENABLE_GEOLOCATION defaults to 0
1037
1038 2008-10-24  Darin Adler  <darin@apple.com>
1039
1040         - finish rolling out https://bugs.webkit.org/show_bug.cgi?id=21732
1041
1042         * API/APICast.h:
1043         * API/JSCallbackConstructor.h:
1044         * API/JSCallbackFunction.cpp:
1045         * API/JSCallbackFunction.h:
1046         * API/JSCallbackObject.h:
1047         * API/JSCallbackObjectFunctions.h:
1048         * API/JSContextRef.cpp:
1049         * API/JSObjectRef.cpp:
1050         * API/JSValueRef.cpp:
1051         * VM/CTI.cpp:
1052         * VM/CTI.h:
1053         * VM/CodeBlock.cpp:
1054         * VM/CodeBlock.h:
1055         * VM/CodeGenerator.cpp:
1056         * VM/CodeGenerator.h:
1057         * VM/ExceptionHelpers.cpp:
1058         * VM/ExceptionHelpers.h:
1059         * VM/JSPropertyNameIterator.cpp:
1060         * VM/JSPropertyNameIterator.h:
1061         * VM/Machine.cpp:
1062         * VM/Machine.h:
1063         * VM/Register.h:
1064         * kjs/ArgList.cpp:
1065         * kjs/ArgList.h:
1066         * kjs/Arguments.cpp:
1067         * kjs/Arguments.h:
1068         * kjs/ArrayConstructor.cpp:
1069         * kjs/ArrayPrototype.cpp:
1070         * kjs/BooleanConstructor.cpp:
1071         * kjs/BooleanConstructor.h:
1072         * kjs/BooleanObject.h:
1073         * kjs/BooleanPrototype.cpp:
1074         * kjs/CallData.cpp:
1075         * kjs/CallData.h:
1076         * kjs/ConstructData.cpp:
1077         * kjs/ConstructData.h:
1078         * kjs/DateConstructor.cpp:
1079         * kjs/DateInstance.h:
1080         * kjs/DatePrototype.cpp:
1081         * kjs/DatePrototype.h:
1082         * kjs/DebuggerCallFrame.cpp:
1083         * kjs/DebuggerCallFrame.h:
1084         * kjs/ErrorConstructor.cpp:
1085         * kjs/ErrorPrototype.cpp:
1086         * kjs/ExecState.cpp:
1087         * kjs/ExecState.h:
1088         * kjs/FunctionConstructor.cpp:
1089         * kjs/FunctionPrototype.cpp:
1090         * kjs/FunctionPrototype.h:
1091         * kjs/GetterSetter.cpp:
1092         * kjs/GetterSetter.h:
1093         * kjs/InternalFunction.h:
1094         * kjs/JSActivation.cpp:
1095         * kjs/JSActivation.h:
1096         * kjs/JSArray.cpp:
1097         * kjs/JSArray.h:
1098         * kjs/JSCell.cpp:
1099         * kjs/JSCell.h:
1100         * kjs/JSFunction.cpp:
1101         * kjs/JSFunction.h:
1102         * kjs/JSGlobalData.h:
1103         * kjs/JSGlobalObject.cpp:
1104         * kjs/JSGlobalObject.h:
1105         * kjs/JSGlobalObjectFunctions.cpp:
1106         * kjs/JSGlobalObjectFunctions.h:
1107         * kjs/JSImmediate.cpp:
1108         * kjs/JSImmediate.h:
1109         * kjs/JSNotAnObject.cpp:
1110         * kjs/JSNotAnObject.h:
1111         * kjs/JSNumberCell.cpp:
1112         * kjs/JSNumberCell.h:
1113         * kjs/JSObject.cpp:
1114         * kjs/JSObject.h:
1115         * kjs/JSStaticScopeObject.cpp:
1116         * kjs/JSStaticScopeObject.h:
1117         * kjs/JSString.cpp:
1118         * kjs/JSString.h:
1119         * kjs/JSValue.h:
1120         * kjs/JSVariableObject.h:
1121         * kjs/JSWrapperObject.h:
1122         * kjs/MathObject.cpp:
1123         * kjs/MathObject.h:
1124         * kjs/NativeErrorConstructor.cpp:
1125         * kjs/NumberConstructor.cpp:
1126         * kjs/NumberConstructor.h:
1127         * kjs/NumberObject.cpp:
1128         * kjs/NumberObject.h:
1129         * kjs/NumberPrototype.cpp:
1130         * kjs/ObjectConstructor.cpp:
1131         * kjs/ObjectPrototype.cpp:
1132         * kjs/ObjectPrototype.h:
1133         * kjs/PropertyMap.h:
1134         * kjs/PropertySlot.cpp:
1135         * kjs/PropertySlot.h:
1136         * kjs/RegExpConstructor.cpp:
1137         * kjs/RegExpConstructor.h:
1138         * kjs/RegExpMatchesArray.h:
1139         * kjs/RegExpObject.cpp:
1140         * kjs/RegExpObject.h:
1141         * kjs/RegExpPrototype.cpp:
1142         * kjs/Shell.cpp:
1143         * kjs/StringConstructor.cpp:
1144         * kjs/StringObject.cpp:
1145         * kjs/StringObject.h:
1146         * kjs/StringObjectThatMasqueradesAsUndefined.h:
1147         * kjs/StringPrototype.cpp:
1148         * kjs/StructureID.cpp:
1149         * kjs/StructureID.h:
1150         * kjs/collector.cpp:
1151         * kjs/collector.h:
1152         * kjs/completion.h:
1153         * kjs/grammar.y:
1154         * kjs/interpreter.cpp:
1155         * kjs/interpreter.h:
1156         * kjs/lookup.cpp:
1157         * kjs/lookup.h:
1158         * kjs/nodes.h:
1159         * kjs/operations.cpp:
1160         * kjs/operations.h:
1161         * kjs/protect.h:
1162         * profiler/ProfileGenerator.cpp:
1163         * profiler/Profiler.cpp:
1164         * profiler/Profiler.h:
1165         Use JSValue* instead of JSValuePtr.
1166
1167 2008-10-24  David Kilzer  <ddkilzer@apple.com>
1168
1169         Rolled out r37840.
1170
1171         * wtf/Platform.h:
1172
1173 2008-10-23  Greg Bolsinga  <bolsinga@apple.com>
1174
1175         Reviewed by Sam Weinig.
1176
1177         https://bugs.webkit.org/show_bug.cgi?id=21475
1178         
1179         Provide support for the Geolocation API
1180         
1181         http://dev.w3.org/geo/api/spec-source.html
1182
1183         * wtf/Platform.h: ENABLE_GEOLOCATION defaults to 0
1184
1185 2008-10-23  David Kilzer  <ddkilzer@apple.com>
1186
1187         Bug 21832: Fix scripts using 'new File::Temp' for Perl 5.10
1188
1189         <https://bugs.webkit.org/show_bug.cgi?id=21832>
1190
1191         Reviewed by Sam Weinig.
1192
1193         * pcre/dftables: Use imported tempfile() from File::Temp instead of
1194         'new File::Temp' to make the script work with Perl 5.10.
1195
1196 2008-10-23  Gavin Barraclough  <barraclough@apple.com>
1197
1198         Reviewed by Oliver Hunt.
1199
1200         Fix hideous pathological case performance when looking up repatch info, bug #21727.
1201
1202         When repatching JIT code to optimize we look up records providing information about
1203         the generated code (also used to track recsources used in linking to be later released). 
1204         The lookup was being performed using a linear scan of all such records.
1205
1206         (1) Split up the different types of reptach information.  This means we can search them
1207             separately, and in some cases should reduce their size.
1208         (2) In the case of property accesses, search with a binary chop over the data.
1209         (3) In the case of calls, pass a pointer to the repatch info into the relink function.
1210
1211         * VM/CTI.cpp:
1212         (JSC::CTI::CTI):
1213         (JSC::CTI::compileOpCall):
1214         (JSC::CTI::privateCompileMainPass):
1215         (JSC::CTI::privateCompileSlowCases):
1216         (JSC::CTI::privateCompile):
1217         (JSC::CTI::unlinkCall):
1218         (JSC::CTI::linkCall):
1219         * VM/CTI.h:
1220         * VM/CodeBlock.cpp:
1221         (JSC::CodeBlock::dump):
1222         (JSC::CodeBlock::~CodeBlock):
1223         (JSC::CodeBlock::unlinkCallers):
1224         (JSC::CodeBlock::derefStructureIDs):
1225         * VM/CodeBlock.h:
1226         (JSC::StructureStubInfo::StructureStubInfo):
1227         (JSC::CallLinkInfo::CallLinkInfo):
1228         (JSC::CallLinkInfo::setUnlinked):
1229         (JSC::CallLinkInfo::isLinked):
1230         (JSC::getStructureStubInfoReturnLocation):
1231         (JSC::binaryChop):
1232         (JSC::CodeBlock::addCaller):
1233         (JSC::CodeBlock::getStubInfo):
1234         * VM/CodeGenerator.cpp:
1235         (JSC::CodeGenerator::emitResolve):
1236         (JSC::CodeGenerator::emitGetById):
1237         (JSC::CodeGenerator::emitPutById):
1238         (JSC::CodeGenerator::emitCall):
1239         (JSC::CodeGenerator::emitConstruct):
1240         * VM/Machine.cpp:
1241         (JSC::Machine::cti_vm_lazyLinkCall):
1242
1243 2008-10-23  Peter Kasting  <pkasting@google.com>
1244
1245         Reviewed by Adam Roben.
1246
1247         https://bugs.webkit.org/show_bug.cgi?id=21833
1248         Place JavaScript Debugger hooks under #if ENABLE(JAVASCRIPT_DEBUGGER).
1249
1250         * wtf/Platform.h:
1251
1252 2008-10-23  David Kilzer  <ddkilzer@apple.com>
1253
1254         Bug 21831: Fix create_hash_table for Perl 5.10
1255
1256         <https://bugs.webkit.org/show_bug.cgi?id=21831>
1257
1258         Reviewed by Sam Weinig.
1259
1260         * kjs/create_hash_table: Escaped square brackets so that Perl 5.10
1261         doesn't try to use @nameEntries.
1262
1263 2008-10-23  Darin Adler  <darin@apple.com>
1264
1265         - roll out https://bugs.webkit.org/show_bug.cgi?id=21732
1266           to remove the JSValuePtr class, to fix two problems
1267
1268             1) slowness under MSVC, since it doesn't handle a
1269                class with a single pointer in it as efficiently
1270                as a pointer
1271
1272             2) uninitialized pointers in Vector
1273
1274         * JavaScriptCore.exp: Updated.
1275
1276         * API/APICast.h:
1277         (toRef):
1278         * VM/CTI.cpp:
1279         (JSC::CTI::asInteger):
1280         * VM/CodeGenerator.cpp:
1281         (JSC::CodeGenerator::addConstant):
1282         * VM/CodeGenerator.h:
1283         (JSC::CodeGenerator::JSValueHashTraits::constructDeletedValue):
1284         (JSC::CodeGenerator::JSValueHashTraits::isDeletedValue):
1285         * VM/Machine.cpp:
1286         (JSC::Machine::cti_op_add):
1287         (JSC::Machine::cti_op_pre_inc):
1288         (JSC::Machine::cti_op_get_by_id):
1289         (JSC::Machine::cti_op_get_by_id_second):
1290         (JSC::Machine::cti_op_get_by_id_generic):
1291         (JSC::Machine::cti_op_get_by_id_fail):
1292         (JSC::Machine::cti_op_instanceof):
1293         (JSC::Machine::cti_op_del_by_id):
1294         (JSC::Machine::cti_op_mul):
1295         (JSC::Machine::cti_op_call_NotJSFunction):
1296         (JSC::Machine::cti_op_resolve):
1297         (JSC::Machine::cti_op_construct_NotJSConstruct):
1298         (JSC::Machine::cti_op_get_by_val):
1299         (JSC::Machine::cti_op_sub):
1300         (JSC::Machine::cti_op_lesseq):
1301         (JSC::Machine::cti_op_negate):
1302         (JSC::Machine::cti_op_resolve_base):
1303         (JSC::Machine::cti_op_resolve_skip):
1304         (JSC::Machine::cti_op_resolve_global):
1305         (JSC::Machine::cti_op_div):
1306         (JSC::Machine::cti_op_pre_dec):
1307         (JSC::Machine::cti_op_not):
1308         (JSC::Machine::cti_op_eq):
1309         (JSC::Machine::cti_op_lshift):
1310         (JSC::Machine::cti_op_bitand):
1311         (JSC::Machine::cti_op_rshift):
1312         (JSC::Machine::cti_op_bitnot):
1313         (JSC::Machine::cti_op_mod):
1314         (JSC::Machine::cti_op_less):
1315         (JSC::Machine::cti_op_neq):
1316         (JSC::Machine::cti_op_urshift):
1317         (JSC::Machine::cti_op_bitxor):
1318         (JSC::Machine::cti_op_bitor):
1319         (JSC::Machine::cti_op_call_eval):
1320         (JSC::Machine::cti_op_throw):
1321         (JSC::Machine::cti_op_next_pname):
1322         (JSC::Machine::cti_op_typeof):
1323         (JSC::Machine::cti_op_is_undefined):
1324         (JSC::Machine::cti_op_is_boolean):
1325         (JSC::Machine::cti_op_is_number):
1326         (JSC::Machine::cti_op_is_string):
1327         (JSC::Machine::cti_op_is_object):
1328         (JSC::Machine::cti_op_is_function):
1329         (JSC::Machine::cti_op_stricteq):
1330         (JSC::Machine::cti_op_nstricteq):
1331         (JSC::Machine::cti_op_to_jsnumber):
1332         (JSC::Machine::cti_op_in):
1333         (JSC::Machine::cti_op_del_by_val):
1334         (JSC::Machine::cti_vm_throw):
1335         Removed calls to payload functions.
1336
1337         * VM/Register.h:
1338         (JSC::Register::Register): Removed overload for JSCell and call
1339         to payload function.
1340
1341         * kjs/JSCell.h: Changed JSCell to derive from JSValue again.
1342         Removed JSValuePtr constructor.
1343         (JSC::asCell): Changed cast from reinterpret_cast to static_cast.
1344
1345         * kjs/JSImmediate.h: Removed JSValuePtr class. Added typedef back.
1346
1347         * kjs/JSValue.h:
1348         (JSC::JSValue::JSValue): Added empty protected inline constructor back.
1349         (JSC::JSValue::~JSValue): Same for destructor.
1350         Removed == and != operator for JSValuePtr.
1351
1352         * kjs/PropertySlot.h:
1353         (JSC::PropertySlot::PropertySlot): Chnaged argument to const JSValue*
1354         and added a const_cast.
1355
1356         * kjs/protect.h: Removed overloads and specialization for JSValuePtr.
1357
1358 2008-10-22  Oliver Hunt  <oliver@apple.com>
1359
1360         Reviewed by Maciej Stachowiak.
1361
1362         Really "fix" CTI mode on windows 2k3.
1363
1364         This adds new methods fastMallocExecutable and fastFreeExecutable
1365         to wrap allocation for cti code.  This still just makes fastMalloc
1366         return executable memory all the time, which will be fixed in a
1367         later patch.
1368
1369         However in windows debug builds all executable allocations will be
1370         allocated on separate executable pages, which should resolve any
1371         remaining 2k3 issues.  Conveniently the 2k3 bot will now also fail
1372         if there are any fastFree vs. fastFreeExecutable errors.
1373
1374         * ChangeLog:
1375         * VM/CodeBlock.cpp:
1376         (JSC::CodeBlock::~CodeBlock):
1377         * kjs/regexp.cpp:
1378         (JSC::RegExp::~RegExp):
1379         * masm/X86Assembler.h:
1380         (JSC::JITCodeBuffer::copy):
1381         * wtf/FastMalloc.cpp:
1382         (WTF::fastMallocExecutable):
1383         (WTF::fastFreeExecutable):
1384         (WTF::TCMallocStats::fastMallocExecutable):
1385         (WTF::TCMallocStats::fastFreeExecutable):
1386         * wtf/FastMalloc.h:
1387
1388 2008-10-22  Darin Adler  <darin@apple.com>
1389
1390         Reviewed by Sam Weinig.
1391
1392         - fix https://bugs.webkit.org/show_bug.cgi?id=21294
1393           Bug 21294: Devirtualize getOwnPropertySlot()
1394
1395         A bit over 3% faster on V8 tests.
1396
1397         * JavascriptCore.exp: Export leak-related functions..
1398
1399         * API/JSCallbackConstructor.h:
1400         (JSC::JSCallbackConstructor::createStructureID): Set HasStandardGetOwnPropertySlot
1401         since this class doesn't override getPropertySlot.
1402         * API/JSCallbackFunction.h:
1403         (JSC::JSCallbackFunction::createStructureID): Ditto.
1404
1405         * VM/ExceptionHelpers.cpp:
1406         (JSC::InterruptedExecutionError::InterruptedExecutionError): Use a structure
1407         that's created just for this class instead of trying to share a single "null
1408         prototype" structure.
1409
1410         * VM/Machine.cpp:
1411         (JSC::Machine::cti_op_create_arguments_no_params): Rename
1412         Arguments::ArgumentsNoParameters to Arguments::NoParameters.
1413         
1414         * kjs/Arguments.h: Rename the enum from Arguments::ArgumentsParameters to
1415         Arguments::NoParametersType and the value from Arguments::ArgumentsNoParameters
1416         to Arguments::NoParameters.
1417         (JSC::Arguments::createStructureID): Added. Returns a structure without
1418         HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
1419         (JSC::Arguments::Arguments): Added an assertion that there are no parameters.
1420
1421         * kjs/DatePrototype.h:
1422         (JSC::DatePrototype::createStructureID): Added. Returns a structure without
1423         HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
1424
1425         * kjs/FunctionPrototype.h:
1426         (JSC::FunctionPrototype::createStructureID): Set HasStandardGetOwnPropertySlot
1427         since this class doesn't override getPropertySlot.
1428         * kjs/InternalFunction.h:
1429         (JSC::InternalFunction::createStructureID): Ditto.
1430
1431         * kjs/JSArray.h:
1432         (JSC::JSArray::createStructureID): Added. Returns a structure without
1433         HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
1434
1435         * kjs/JSCell.h: Added declaration of fastGetOwnPropertySlot; a non-virtual
1436         version that uses the structure bit to decide whether to call the virtual
1437         version.
1438
1439         * kjs/JSFunction.h:
1440         (JSC::JSFunction::createStructureID): Added. Returns a structure without
1441         HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
1442
1443         * kjs/JSGlobalData.cpp:
1444         (JSC::JSGlobalData::JSGlobalData): Initialize new structures; removed
1445         nullProtoStructureID.
1446         * kjs/JSGlobalData.h: Added new structures. Removed nullProtoStructureID.
1447
1448         * kjs/JSGlobalObject.h:
1449         (JSC::JSGlobalObject::createStructureID): Added. Returns a structure without
1450         HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
1451
1452         * kjs/JSNotAnObject.h:
1453         (JSC::JSNotAnObjectErrorStub::JSNotAnObjectErrorStub): Use a structure
1454         that's created just for this class instead of trying to share a single "null
1455         prototype" structure.
1456         (JSC::JSNotAnObjectErrorStub::isNotAnObjectErrorStub): Marked this function
1457         virtual for clarity and made it private since no one should call it if they
1458         already have a pointer to this specific type.
1459         (JSC::JSNotAnObject::JSNotAnObject): Use a structure that's created just
1460         for this class instead of trying to share a single "null prototype" structure.
1461         (JSC::JSNotAnObject::createStructureID): Added. Returns a structure without
1462         HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
1463
1464         * kjs/JSObject.h:
1465         (JSC::JSObject::createStructureID): Added HasStandardGetOwnPropertySlot.
1466         (JSC::JSObject::inlineGetOwnPropertySlot): Added. Used so we can share code
1467         between getOwnPropertySlot and fastGetOwnPropertySlot.
1468         (JSC::JSObject::getOwnPropertySlot): Moved so that functions are above the
1469         functions that call them. Moved the guts of this function into
1470         inlineGetOwnPropertySlot.
1471         (JSC::JSCell::fastGetOwnPropertySlot): Added. Checks the
1472         HasStandardGetOwnPropertySlot bit and if it's set, calls
1473         inlineGetOwnPropertySlot, otherwise calls getOwnPropertySlot.
1474         (JSC::JSObject::getPropertySlot): Changed to call fastGetOwnPropertySlot.
1475         (JSC::JSValue::get): Changed to call fastGetOwnPropertySlot.
1476
1477         * kjs/JSWrapperObject.h: Made constructor protected to emphasize that
1478         this class is only a base class and never instantiated.
1479
1480         * kjs/MathObject.h:
1481         (JSC::MathObject::createStructureID): Added. Returns a structure without
1482         HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
1483         * kjs/NumberConstructor.h:
1484         (JSC::NumberConstructor::createStructureID): Ditto.
1485         * kjs/RegExpConstructor.h:
1486         (JSC::RegExpConstructor::createStructureID): Ditto.
1487         * kjs/RegExpObject.h:
1488         (JSC::RegExpObject::createStructureID): Ditto.
1489         * kjs/StringObject.h:
1490         (JSC::StringObject::createStructureID): Ditto.
1491
1492         * kjs/TypeInfo.h: Added HasStandardGetOwnPropertySlot flag and
1493         hasStandardGetOwnPropertySlot accessor function.
1494
1495 2008-10-22  Cameron Zwarich  <zwarich@apple.com>
1496
1497         Reviewed by Geoff Garen.
1498
1499         Bug 21803: Fuse op_jfalse with op_eq_null and op_neq_null
1500         <https://bugs.webkit.org/show_bug.cgi?id=21803>
1501
1502         Fuse op_jfalse with op_eq_null and op_neq_null to make the new opcodes
1503         op_jeq_null and op_jneq_null.
1504
1505         This is a 2.6% speedup on the V8 Raytrace benchmark, and strangely also
1506         a 4.7% speedup on the V8 Arguments benchmark, even though it uses
1507         neither of the two new opcodes.
1508
1509         * VM/CTI.cpp:
1510         (JSC::CTI::privateCompileMainPass):
1511         * VM/CodeBlock.cpp:
1512         (JSC::CodeBlock::dump):
1513         * VM/CodeGenerator.cpp:
1514         (JSC::CodeGenerator::emitJumpIfTrue):
1515         (JSC::CodeGenerator::emitJumpIfFalse):
1516         * VM/Machine.cpp:
1517         (JSC::Machine::privateExecute):
1518         * VM/Opcode.h:
1519
1520 2008-10-22  Darin Fisher  <darin@chromium.org>
1521
1522         Reviewed by Eric Seidel.
1523
1524         Should not define PLATFORM(WIN,MAC,GTK) when PLATFORM(CHROMIUM) is defined
1525         https://bugs.webkit.org/show_bug.cgi?id=21757
1526
1527         PLATFORM(CHROMIUM) implies HAVE_ACCESSIBILITY
1528
1529         * wtf/Platform.h:
1530
1531 2008-10-22  Cameron Zwarich  <zwarich@apple.com>
1532
1533         Reviewed by Alexey Proskuryakov.
1534
1535         Correct opcode names in documentation.
1536
1537         * VM/Machine.cpp:
1538         (JSC::Machine::privateExecute):
1539
1540 2008-10-21  Oliver Hunt <oliver@apple.com>
1541
1542         RS=Maciej Stachowiak.
1543
1544         Force FastMalloc to make all allocated pages executable in
1545         a vague hope this will allow the Win2k3 bot to be able to
1546         run tests.
1547
1548         Filed Bug 21783: Need more granular control over allocation of executable memory
1549         to cover a more granular version of this patch.
1550
1551         * wtf/TCSystemAlloc.cpp:
1552         (TryVirtualAlloc):
1553
1554 2008-10-21  Alexey Proskuryakov  <ap@webkit.org>
1555
1556         Reviewed by Darin Adler.
1557
1558         https://bugs.webkit.org/show_bug.cgi?id=21769
1559         MessagePort should be GC protected if there are messages to be delivered
1560
1561         * wtf/MessageQueue.h:
1562         (WTF::::isEmpty): Added. Also added a warning for methods that return a snapshot of queue
1563         state, thus likely to cause race conditions.
1564
1565 2008-10-21  Darin Adler  <darin@apple.com>
1566
1567         Reviewed by Maciej Stachowiak.
1568
1569         - convert post-increment to pre-increment in a couple more places for speed
1570
1571         Speeds up V8 benchmarks a little on most computers. (But, strangely, slows
1572         them down a little on my computer.)
1573
1574         * kjs/nodes.cpp:
1575         (JSC::statementListEmitCode): Removed default argument, since we always want
1576         to specify this explicitly.
1577         (JSC::ForNode::emitCode): Tolerate ignoredResult() as the dst -- means the
1578         same thing as 0.
1579         (JSC::ReturnNode::emitCode): Ditto.
1580         (JSC::ThrowNode::emitCode): Ditto.
1581         (JSC::FunctionBodyNode::emitCode): Pass ignoredResult() so that we know we
1582         don't have to compute the result of function statements.
1583
1584 2008-10-21  Peter Kasting  <pkasting@google.com>
1585
1586         Reviewed by Maciej Stachowiak.
1587
1588         Fix an include of a non-public header to use "" instead of <>.
1589
1590         * API/JSProfilerPrivate.cpp:
1591
1592 2008-10-20  Sam Weinig  <sam@webkit.org>
1593
1594         Reviewed by Cameron Zwarich.
1595
1596         Fix for https://bugs.webkit.org/show_bug.cgi?id=21766
1597         REGRESSION: 12 JSC tests fail
1598
1599         The JSGlobalObject was mutating the shared nullProtoStructureID when
1600         used in jsc.  Instead of using nullProtoStructureID, use a new StructureID.
1601
1602         * API/JSCallbackObject.h:
1603         * API/JSCallbackObjectFunctions.h:
1604         (JSC::::JSCallbackObject):
1605         * API/JSContextRef.cpp:
1606         (JSGlobalContextCreateInGroup):
1607         * kjs/JSGlobalObject.h:
1608         (JSC::JSGlobalObject::JSGlobalObject):
1609         * kjs/Shell.cpp:
1610         (GlobalObject::GlobalObject):
1611         (jscmain):
1612
1613 2008-10-20  Cameron Zwarich  <zwarich@apple.com>
1614
1615         Reviewed by Maciej Stachowiak.
1616
1617         Remove an untaken branch in CodeGenerator::emitJumpIfFalse(). This
1618         function is never called with a backwards target LabelID, and there is
1619         even an assertion to this effect at the top of the function body.
1620
1621         * VM/CodeGenerator.cpp:
1622         (JSC::CodeGenerator::emitJumpIfFalse):
1623
1624 2008-10-20  Cameron Zwarich  <zwarich@apple.com>
1625
1626         Rubber-stamped by Sam Weinig.
1627
1628         Add opcode documentation for undocumented opcodes.
1629
1630         * VM/Machine.cpp:
1631         (JSC::Machine::privateExecute):
1632
1633 2008-10-16  Sam Weinig  <sam@webkit.org>
1634
1635         Reviewed by Cameron Zwarich.
1636
1637         Fix for https://bugs.webkit.org/show_bug.cgi?id=21683
1638         Don't create intermediate StructureIDs for builtin objects
1639
1640         Second stage in reduce number of StructureIDs created when initializing the
1641         JSGlobalObject.
1642
1643         - Use putDirectWithoutTransition for the remaining singleton objects to reduce
1644           the number of StructureIDs create for about:blank from 132 to 73.
1645
1646         * kjs/ArrayConstructor.cpp:
1647         (JSC::ArrayConstructor::ArrayConstructor):
1648         * kjs/BooleanConstructor.cpp:
1649         (JSC::BooleanConstructor::BooleanConstructor):
1650         * kjs/BooleanPrototype.cpp:
1651         (JSC::BooleanPrototype::BooleanPrototype):
1652         * kjs/DateConstructor.cpp:
1653         (JSC::DateConstructor::DateConstructor):
1654         * kjs/ErrorConstructor.cpp:
1655         (JSC::ErrorConstructor::ErrorConstructor):
1656         * kjs/ErrorPrototype.cpp:
1657         (JSC::ErrorPrototype::ErrorPrototype):
1658         * kjs/FunctionConstructor.cpp:
1659         (JSC::FunctionConstructor::FunctionConstructor):
1660         * kjs/FunctionPrototype.cpp:
1661         (JSC::FunctionPrototype::FunctionPrototype):
1662         (JSC::FunctionPrototype::addFunctionProperties):
1663         * kjs/FunctionPrototype.h:
1664         (JSC::FunctionPrototype::createStructureID):
1665         * kjs/InternalFunction.cpp:
1666         * kjs/InternalFunction.h:
1667         (JSC::InternalFunction::InternalFunction):
1668         * kjs/JSGlobalObject.cpp:
1669         (JSC::JSGlobalObject::reset):
1670         * kjs/JSObject.h:
1671         * kjs/MathObject.cpp:
1672         (JSC::MathObject::MathObject):
1673         * kjs/NumberConstructor.cpp:
1674         (JSC::NumberConstructor::NumberConstructor):
1675         * kjs/NumberPrototype.cpp:
1676         (JSC::NumberPrototype::NumberPrototype):
1677         * kjs/ObjectConstructor.cpp:
1678         (JSC::ObjectConstructor::ObjectConstructor):
1679         * kjs/RegExpConstructor.cpp:
1680         (JSC::RegExpConstructor::RegExpConstructor):
1681         * kjs/RegExpPrototype.cpp:
1682         (JSC::RegExpPrototype::RegExpPrototype):
1683         * kjs/StringConstructor.cpp:
1684         (JSC::StringConstructor::StringConstructor):
1685         * kjs/StringPrototype.cpp:
1686         (JSC::StringPrototype::StringPrototype):
1687         * kjs/StructureID.cpp:
1688         (JSC::StructureID::dumpStatistics):
1689         * kjs/StructureID.h:
1690         (JSC::StructureID::setPrototypeWithoutTransition):
1691
1692 2008-10-20  Alp Toker  <alp@nuanti.com>
1693
1694         Fix autotools dist build target by listing recently added header
1695         files only. Not reviewed.
1696
1697         * GNUmakefile.am:
1698
1699 2008-10-20  Geoffrey Garen  <ggaren@apple.com>
1700
1701         Reviewed by Anders Carlsson.
1702
1703         * VM/Machine.cpp:
1704         (JSC::Machine::tryCacheGetByID): Removed a redundant and sometimes
1705         incorrect cast, which started ASSERTing after Darin's last checkin.
1706
1707 2008-10-20  Geoffrey Garen  <ggaren@apple.com>
1708
1709         Not reviewed.
1710         
1711         Re-enable CTI, which I accidentally disabled while checking in fixes
1712         to bytecode.
1713
1714         * wtf/Platform.h:
1715
1716 2008-10-20  Alp Toker  <alp@nuanti.com>
1717
1718         Rubber-stamped by Mark Rowe.
1719
1720         Typo fix in function name: mimimum -> minimum.
1721
1722         * kjs/DateMath.cpp:
1723         (JSC::minimumYearForDST):
1724         (JSC::equivalentYearForDST):
1725
1726 2008-10-20  Alp Toker  <alp@nuanti.com>
1727
1728         Reviewed by Mark Rowe.
1729
1730         Use pthread instead of GThread where possible in the GTK+ port. This
1731         fixes issues with global initialisation, particularly on GTK+/Win32
1732         where a late g_thread_init() will cause hangs.
1733
1734         * GNUmakefile.am:
1735         * wtf/Platform.h:
1736         * wtf/Threading.h:
1737         * wtf/ThreadingGtk.cpp:
1738         * wtf/ThreadingPthreads.cpp:
1739
1740 2008-10-20  Geoffrey Garen  <ggaren@apple.com>
1741
1742         Reviewed by Darin Adler.
1743         
1744         Fixed https://bugs.webkit.org/show_bug.cgi?id=21735
1745         Emit profiling instrumentation only if the Web Inspector's profiling
1746         feature is enabled
1747
1748         22.2% speedup on empty function call benchmark.
1749         2.9% speedup on v8 benchmark.
1750         0.7% speedup on SunSpider.
1751         
1752         Lesser but similar speedups in bytecode.
1753
1754         * VM/CTI.cpp:
1755         (JSC::CTI::compileOpCall):
1756         (JSC::CTI::privateCompileMainPass):
1757         (JSC::CTI::privateCompileSlowCases): Nixed JITed profiler hooks. Profiler
1758         hooks now have their own opcodes. Added support for compiling profiler
1759         hook opcodes.
1760         
1761         (JSC::CodeBlock::dump): Dump support for the new profiling opcodes.
1762
1763         * VM/CodeGenerator.h:
1764         * VM/CodeGenerator.cpp:
1765         (JSC::CodeGenerator::CodeGenerator):
1766         (JSC::CodeGenerator::emitCall):
1767         (JSC::CodeGenerator::emitConstruct): Conditionally emit profiling hooks
1768         around call and construct, at the call site. (It's easier to get things
1769         right this way, if you have profiled code calling non-profiled code.
1770         Also, you get a slightly more accurate profile, since you charge the full
1771         cost of the call / construct operation to the callee.)
1772         
1773         Also, fixed a bug where construct would fetch the ".prototype" property
1774         from the constructor before evaluating the arguments to the constructor,
1775         incorrectly allowing an "invalid constructor" exception to short-circuit
1776         argument evaluation. I encountered this bug when trying to make
1777         constructor exceptions work with profiling.
1778
1779         * VM/Machine.cpp:
1780         (JSC::Machine::callEval): Removed obsolete profiler hooks.
1781
1782         (JSC::Machine::throwException): Added a check for an exception thrown
1783         within a call instruction. We didn't need this before because the call
1784         instruction would check for a valid call before involing the profiler.
1785         (JSC::Machine::execute): Added a didExecute hook at the end of top-level
1786         function invocation, since op_ret no longer does this for us.
1787
1788         (JSC::Machine::privateExecute): Removed obsolete profiler hooks. Added
1789         profiler opcodes. Changed some ++vPC to vPC[x] notation, since the
1790         latter is better for performance, and it makes reasoning about the
1791         current opcode in exception handling much simpler.
1792
1793         (JSC::Machine::cti_op_call_NotJSFunction): Removed obsolete profiler
1794         hooks.
1795
1796         (JSC::Machine::cti_op_create_arguments_no_params): Added missing
1797         CTI_STACK_HACK that I noticed when adding CTI_STACK_HACK to the new
1798         profiler opcode functions.
1799
1800         (JSC::Machine::cti_op_profile_will_call):
1801         (JSC::Machine::cti_op_profile_did_call): The new profiler opcode
1802         functions.
1803
1804         (JSC::Machine::cti_op_construct_NotJSConstruct): Removed obsolete profiler
1805         hooks.
1806
1807         * VM/Machine.h:
1808         (JSC::Machine::isCallOpcode): Helper for exception handling.
1809
1810         * VM/Opcode.h: Declare new opcodes.
1811
1812         * kjs/JSGlobalObject.h:
1813         (JSC::JSGlobalObject::supportsProfiling): Added virtual interface that
1814         allows WebCore to specify whether the target global object has the Web
1815         Inspector's profiling feature enabled.
1816
1817         * profiler/Profiler.cpp:
1818         (JSC::Profiler::willExecute):
1819         (JSC::Profiler::didExecute):
1820         (JSC::Profiler::createCallIdentifier):
1821         * profiler/Profiler.h: Added support for invoking the profiler with
1822         an arbitrary JSValue*, and not a known object. We didn't need this
1823         before because the call instruction would check for a valid call before
1824         involing the profiler.
1825
1826 2008-10-20  Darin Adler  <darin@apple.com>
1827
1828         Reviewed by Geoff Garen.
1829
1830         - get CTI working on Windows again
1831
1832         * VM/CTI.cpp:
1833         (JSC::CTI::emitCTICall): Add an overload for functions that
1834         return JSObject*.
1835         * VM/CTI.h: Use JSValue* and JSObject* as return types for
1836         cti_op functions. Apparently, MSVC doesn't handle returning
1837         the JSValuePtr struct in a register. We'll have to look into
1838         this more.
1839
1840         * VM/Machine.cpp:
1841         (JSC::Machine::cti_op_convert_this):
1842         (JSC::Machine::cti_op_add):
1843         (JSC::Machine::cti_op_pre_inc):
1844         (JSC::Machine::cti_op_new_object):
1845         (JSC::Machine::cti_op_get_by_id):
1846         (JSC::Machine::cti_op_get_by_id_second):
1847         (JSC::Machine::cti_op_get_by_id_generic):
1848         (JSC::Machine::cti_op_get_by_id_fail):
1849         (JSC::Machine::cti_op_instanceof):
1850         (JSC::Machine::cti_op_del_by_id):
1851         (JSC::Machine::cti_op_mul):
1852         (JSC::Machine::cti_op_new_func):
1853         (JSC::Machine::cti_op_push_activation):
1854         (JSC::Machine::cti_op_call_NotJSFunction):
1855         (JSC::Machine::cti_op_new_array):
1856         (JSC::Machine::cti_op_resolve):
1857         (JSC::Machine::cti_op_construct_JSConstructFast):
1858         (JSC::Machine::cti_op_construct_NotJSConstruct):
1859         (JSC::Machine::cti_op_get_by_val):
1860         (JSC::Machine::cti_op_sub):
1861         (JSC::Machine::cti_op_lesseq):
1862         (JSC::Machine::cti_op_negate):
1863         (JSC::Machine::cti_op_resolve_base):
1864         (JSC::Machine::cti_op_resolve_skip):
1865         (JSC::Machine::cti_op_resolve_global):
1866         (JSC::Machine::cti_op_div):
1867         (JSC::Machine::cti_op_pre_dec):
1868         (JSC::Machine::cti_op_not):
1869         (JSC::Machine::cti_op_eq):
1870         (JSC::Machine::cti_op_lshift):
1871         (JSC::Machine::cti_op_bitand):
1872         (JSC::Machine::cti_op_rshift):
1873         (JSC::Machine::cti_op_bitnot):
1874         (JSC::Machine::cti_op_new_func_exp):
1875         (JSC::Machine::cti_op_mod):
1876         (JSC::Machine::cti_op_less):
1877         (JSC::Machine::cti_op_neq):
1878         (JSC::Machine::cti_op_urshift):
1879         (JSC::Machine::cti_op_bitxor):
1880         (JSC::Machine::cti_op_new_regexp):
1881         (JSC::Machine::cti_op_bitor):
1882         (JSC::Machine::cti_op_call_eval):
1883         (JSC::Machine::cti_op_throw):
1884         (JSC::Machine::cti_op_next_pname):
1885         (JSC::Machine::cti_op_typeof):
1886         (JSC::Machine::cti_op_is_undefined):
1887         (JSC::Machine::cti_op_is_boolean):
1888         (JSC::Machine::cti_op_is_number):
1889         (JSC::Machine::cti_op_is_string):
1890         (JSC::Machine::cti_op_is_object):
1891         (JSC::Machine::cti_op_is_function):
1892         (JSC::Machine::cti_op_stricteq):
1893         (JSC::Machine::cti_op_nstricteq):
1894         (JSC::Machine::cti_op_to_jsnumber):
1895         (JSC::Machine::cti_op_in):
1896         (JSC::Machine::cti_op_push_new_scope):
1897         (JSC::Machine::cti_op_del_by_val):
1898         (JSC::Machine::cti_op_new_error):
1899         (JSC::Machine::cti_vm_throw):
1900         Change these functions to return pointer types, and never
1901         JSValuePtr.
1902         * VM/Machine.h: Ditto.
1903
1904 2008-10-20  Geoffrey Garen  <ggaren@apple.com>
1905
1906         Reviewed by Darin Adler.
1907         
1908         Fixed some recent break-age in bytecode mode.
1909
1910         * VM/CodeBlock.cpp:
1911         (JSC::CodeBlock::printStructureIDs): Fixed up an ASSERT caused by
1912         Gavin's last checkin. This is a temporary fix so I can keep on moving.
1913         I'll send email about what I think is an underlying problem soon.
1914
1915         * VM/Machine.cpp:
1916         (JSC::Machine::privateExecute): Removed a redundant and sometimes
1917         incorrect cast, which started ASSERTing after Darin's last checkin.
1918
1919 2008-10-20  Darin Adler  <darin@apple.com>
1920
1921         - another similar Windows build fix
1922
1923         * VM/CTI.cpp: Changed return type to JSObject* instead of JSValuePtr.
1924
1925 2008-10-20  Darin Adler  <darin@apple.com>
1926
1927         - try to fix Windows build
1928
1929         * VM/CTI.cpp: Use JSValue* instead of JSValuePtr for ctiTrampoline.
1930         * VM/CTI.h: Ditto.
1931
1932 2008-10-19  Darin Adler  <darin@apple.com>
1933
1934         Reviewed by Cameron Zwarich.
1935
1936         - finish https://bugs.webkit.org/show_bug.cgi?id=21732
1937           improve performance by eliminating JSValue as a base class for JSCell
1938
1939         * VM/Machine.cpp:
1940         (JSC::Machine::cti_op_call_profiler): Use asFunction.
1941         (JSC::Machine::cti_vm_lazyLinkCall): Ditto.
1942         (JSC::Machine::cti_op_construct_JSConstructFast): Use asObject.
1943
1944         * kjs/JSCell.h: Re-sort friend classes. Eliminate inheritance from
1945         JSValue. Changed cast in asCell from static_cast to reinterpret_cast.
1946         Removed JSValue::getNumber(double&) and one of JSValue::getObject
1947         overloads.
1948
1949         * kjs/JSValue.h: Made the private constructor and destructor both
1950         non-virtual and also remove the definitions. This class can never
1951         be instantiated or derived.
1952
1953 2008-10-19  Darin Adler  <darin@apple.com>
1954
1955         Reviewed by Cameron Zwarich.
1956
1957         - next step of https://bugs.webkit.org/show_bug.cgi?id=21732
1958           improve performance by eliminating JSValue as a base class for JSCell
1959
1960         Change JSValuePtr from a typedef into a class. This allows us to support
1961         conversion from JSCell* to JSValuePtr even if JSCell isn't derived from
1962         JSValue.
1963
1964         * JavaScriptCore.exp: Updated symbols that involve JSValuePtr, since
1965         it's now a distinct type.
1966
1967         * API/APICast.h:
1968         (toRef): Extract the JSValuePtr payload explicitly since we can't just
1969         cast any more.
1970         * VM/CTI.cpp:
1971         (JSC::CTI::asInteger): Ditto.
1972
1973         * VM/CodeGenerator.cpp:
1974         (JSC::CodeGenerator::addConstant): Get at the payload directly.
1975         (JSC::CodeGenerator::emitLoad): Added an overload of JSCell* because
1976         otherwise classes derived from JSValue end up calling the bool
1977         overload instead of JSValuePtr.
1978         * VM/CodeGenerator.h: Ditto. Also update traits to use JSValue*
1979         and the payload functions.
1980
1981         * VM/Register.h: Added a JSCell* overload and use of payload functions.
1982
1983         * kjs/JSCell.h:
1984         (JSC::asCell): Use payload function.
1985         (JSC::JSValue::asCell): Use JSValue* instead of JSValuePtr.
1986         (JSC::JSValuePtr::JSValuePtr): Added. Constructor that takes JSCell*
1987         and creates a JSValuePtr.
1988
1989         * kjs/JSImmediate.h: Added JSValuePtr class. Also updated makeValue
1990         and makeInt to work with JSValue* and the payload function.
1991
1992         * kjs/JSValue.h: Added == and != operators for JSValuePtr. Put them
1993         here because eventually all the JSValue functions should go here
1994         except what's needed by JSImmediate. Also fix asValue to use
1995         JSValue* instead of JSValuePtr.
1996
1997         * kjs/PropertySlot.h: Change constructor to take JSValuePtr.
1998
1999         * kjs/protect.h: Update gcProtect functions to work with JSCell*
2000         as well as JSValuePtr. Also updated the ProtectedPtr<JSValuePtr>
2001         specialization to work more directly. Also changed all the call
2002         sites to use gcProtectNullTolerant.
2003
2004 2008-10-19  Darin Adler  <darin@apple.com>
2005
2006         Reviewed by Oliver Hunt.
2007
2008         - next step of https://bugs.webkit.org/show_bug.cgi?id=21732
2009           improve performance by eliminating JSValue as a base class for JSCell
2010
2011         Remove most uses of JSValue, which will be removed in a future patch.
2012
2013         * VM/Machine.cpp:
2014         (JSC::fastToUInt32): Call toUInt32SlowCase function; no longer a member
2015         of JSValue.
2016         * kjs/JSNumberCell.h:
2017         (JSC::JSNumberCell::toInt32): Ditto.
2018         (JSC::JSNumberCell::toUInt32): Ditto.
2019
2020         * kjs/JSValue.cpp:
2021         (JSC::toInt32SlowCase): Made a non-member function.
2022         (JSC::JSValue::toInt32SlowCase): Changed to call non-member function.
2023         (JSC::toUInt32SlowCase): More of the same.
2024         (JSC::JSValue::toUInt32SlowCase): Ditto.
2025
2026         * kjs/JSValue.h: Moved static member function so they are no longer
2027         member functions at all.
2028
2029         * VM/CTI.h: Removed forward declaration of JSValue.
2030         * VM/ExceptionHelpers.h: Ditto.
2031         * kjs/CallData.h: Ditto.
2032         * kjs/ConstructData.h: Ditto.
2033         * kjs/JSGlobalObjectFunctions.h: Ditto.
2034         * kjs/PropertyMap.h: Ditto.
2035         * kjs/StructureID.h: Ditto.
2036         * kjs/collector.h: Ditto.
2037         * kjs/completion.h: Ditto.
2038
2039         * kjs/grammar.y:
2040         (JSC::makeBitwiseNotNode): Call new non-member toInt32 function.
2041         (JSC::makeLeftShiftNode): More of the same.
2042         (JSC::makeRightShiftNode): Ditto.
2043
2044         * kjs/protect.h: Added a specialization for ProtectedPtr<JSValuePtr>
2045         so this can be used with JSValuePtr.
2046
2047 2008-10-18  Darin Adler  <darin@apple.com>
2048
2049         Reviewed by Oliver Hunt.
2050
2051         - next step of https://bugs.webkit.org/show_bug.cgi?id=21732
2052           improve performance by eliminating JSValue as a base class for JSCell
2053
2054         Tweak a little more to get closer to where we can make JSValuePtr a class.
2055
2056         * API/APICast.h:
2057         (toJS): Change back to JSValue* here, since we're converting the
2058         pointer type.
2059         * VM/CTI.cpp:
2060         (JSC::CTI::unlinkCall): Call asPointer.
2061         * VM/CTI.h: Cast to JSValue* here, since it's a pointer cast.
2062         * kjs/DebuggerCallFrame.h:
2063         (JSC::DebuggerCallFrame::DebuggerCallFrame): Call noValue.
2064         * kjs/JSGlobalData.cpp:
2065         (JSC::JSGlobalData::JSGlobalData): Call noValue.
2066         * kjs/JSImmediate.cpp:
2067         (JSC::JSImmediate::toObject): Remove unneeded const_cast.
2068         * kjs/JSWrapperObject.h:
2069         (JSC::JSWrapperObject::JSWrapperObject): Call noValue.
2070
2071 2008-10-18  Darin Adler  <darin@apple.com>
2072
2073         - fix non-all-in-one build
2074
2075         * kjs/completion.h:
2076         (JSC::Completion::Completion): Add include of JSValue.h.
2077
2078 2008-10-18  Darin Adler  <darin@apple.com>
2079
2080         Reviewed by Oliver Hunt.
2081
2082         - fix assertions I introduced with my casting changes
2083
2084         These were showing up as failures in the JavaScriptCore tests.
2085
2086         * VM/Machine.cpp:
2087         (JSC::Machine::cti_op_instanceof): Remove the bogus asCell casting that
2088         was at the top of the function, and instead cast at the point of use.
2089         (JSC::Machine::cti_op_construct_NotJSConstruct): Moved the cast to
2090         object after checking the construct type.
2091
2092 2008-10-18  Darin Adler  <darin@apple.com>
2093
2094         - fix non-all-in-one build
2095
2096         * kjs/JSGlobalObjectFunctions.h: Add include of JSImmedate.h (for now).
2097
2098 2008-10-18  Darin Adler  <darin@apple.com>
2099
2100         - fix build
2101
2102         * kjs/interpreter.h: Include JSValue.h instead of JSImmediate.h.
2103
2104 2008-10-18  Darin Adler  <darin@apple.com>
2105
2106         * kjs/interpreter.h: Fix include of JSImmediate.h.
2107
2108 2008-10-18  Darin Adler  <darin@apple.com>
2109
2110         - fix non-all-in-one build
2111
2112         * kjs/interpreter.h: Add include of JSImmediate.h.
2113
2114 2008-10-18  Darin Adler  <darin@apple.com>
2115
2116         - fix non-all-in-one build
2117
2118         * kjs/ConstructData.h: Add include of JSImmedate.h (for now).
2119
2120 2008-10-18  Darin Adler  <darin@apple.com>
2121
2122         - try to fix Windows build
2123
2124         * VM/Machine.cpp:
2125         (JSC::Machine::Machine): Use JSCell* type since MSVC seems to only allow
2126         calling ~JSCell directly if it's a JSCell*.
2127
2128 2008-10-18  Darin Adler  <darin@apple.com>
2129
2130         Reviewed by Cameron Zwarich.
2131
2132         - next step on https://bugs.webkit.org/show_bug.cgi?id=21732
2133           improve performance by eliminating JSValue as a base class for JSCell
2134
2135         Use JSValuePtr everywhere instead of JSValue*. In the future, we'll be
2136         changing JSValuePtr to be a class, and then eventually renaming it
2137         to JSValue once that's done.
2138
2139         * JavaScriptCore.exp: Update entry points, since some now take JSValue*
2140         instead of const JSValue*.
2141
2142         * API/APICast.h:
2143         * API/JSCallbackConstructor.h:
2144         * API/JSCallbackFunction.cpp:
2145         * API/JSCallbackFunction.h:
2146         * API/JSCallbackObject.h:
2147         * API/JSCallbackObjectFunctions.h:
2148         * API/JSContextRef.cpp:
2149         * API/JSObjectRef.cpp:
2150         * API/JSValueRef.cpp:
2151         * VM/CTI.cpp:
2152         * VM/CTI.h:
2153         * VM/CodeBlock.cpp:
2154         * VM/CodeBlock.h:
2155         * VM/CodeGenerator.cpp:
2156         * VM/CodeGenerator.h:
2157         * VM/ExceptionHelpers.cpp:
2158         * VM/ExceptionHelpers.h:
2159         * VM/JSPropertyNameIterator.cpp:
2160         * VM/JSPropertyNameIterator.h:
2161         * VM/Machine.cpp:
2162         * VM/Machine.h:
2163         * VM/Register.h:
2164         * kjs/ArgList.cpp:
2165         * kjs/ArgList.h:
2166         * kjs/Arguments.cpp:
2167         * kjs/Arguments.h:
2168         * kjs/ArrayConstructor.cpp:
2169         * kjs/ArrayPrototype.cpp:
2170         * kjs/BooleanConstructor.cpp:
2171         * kjs/BooleanConstructor.h:
2172         * kjs/BooleanObject.h:
2173         * kjs/BooleanPrototype.cpp:
2174         * kjs/CallData.cpp:
2175         * kjs/CallData.h:
2176         * kjs/ConstructData.cpp:
2177         * kjs/ConstructData.h:
2178         * kjs/DateConstructor.cpp:
2179         * kjs/DateInstance.h:
2180         * kjs/DatePrototype.cpp:
2181         * kjs/DebuggerCallFrame.cpp:
2182         * kjs/DebuggerCallFrame.h:
2183         * kjs/ErrorConstructor.cpp:
2184         * kjs/ErrorPrototype.cpp:
2185         * kjs/ExecState.cpp:
2186         * kjs/ExecState.h:
2187         * kjs/FunctionConstructor.cpp:
2188         * kjs/FunctionPrototype.cpp:
2189         * kjs/GetterSetter.cpp:
2190         * kjs/GetterSetter.h:
2191         * kjs/InternalFunction.h:
2192         * kjs/JSActivation.cpp:
2193         * kjs/JSActivation.h:
2194         * kjs/JSArray.cpp:
2195         * kjs/JSArray.h:
2196         * kjs/JSCell.cpp:
2197         * kjs/JSCell.h:
2198         * kjs/JSFunction.cpp:
2199         * kjs/JSFunction.h:
2200         * kjs/JSGlobalData.h:
2201         * kjs/JSGlobalObject.cpp:
2202         * kjs/JSGlobalObject.h:
2203         * kjs/JSGlobalObjectFunctions.cpp:
2204         * kjs/JSGlobalObjectFunctions.h:
2205         * kjs/JSImmediate.cpp:
2206         * kjs/JSImmediate.h:
2207         * kjs/JSNotAnObject.cpp:
2208         * kjs/JSNotAnObject.h:
2209         * kjs/JSNumberCell.cpp:
2210         * kjs/JSNumberCell.h:
2211         * kjs/JSObject.cpp:
2212         * kjs/JSObject.h:
2213         * kjs/JSStaticScopeObject.cpp:
2214         * kjs/JSStaticScopeObject.h:
2215         * kjs/JSString.cpp:
2216         * kjs/JSString.h:
2217         * kjs/JSValue.h:
2218         * kjs/JSVariableObject.h:
2219         * kjs/JSWrapperObject.h:
2220         * kjs/MathObject.cpp:
2221         * kjs/NativeErrorConstructor.cpp:
2222         * kjs/NumberConstructor.cpp:
2223         * kjs/NumberConstructor.h:
2224         * kjs/NumberObject.cpp:
2225         * kjs/NumberObject.h:
2226         * kjs/NumberPrototype.cpp:
2227         * kjs/ObjectConstructor.cpp:
2228         * kjs/ObjectPrototype.cpp:
2229         * kjs/ObjectPrototype.h:
2230         * kjs/PropertyMap.h:
2231         * kjs/PropertySlot.cpp:
2232         * kjs/PropertySlot.h:
2233         * kjs/RegExpConstructor.cpp:
2234         * kjs/RegExpConstructor.h:
2235         * kjs/RegExpMatchesArray.h:
2236         * kjs/RegExpObject.cpp:
2237         * kjs/RegExpObject.h:
2238         * kjs/RegExpPrototype.cpp:
2239         * kjs/Shell.cpp:
2240         * kjs/StringConstructor.cpp:
2241         * kjs/StringObject.cpp:
2242         * kjs/StringObject.h:
2243         * kjs/StringObjectThatMasqueradesAsUndefined.h:
2244         * kjs/StringPrototype.cpp:
2245         * kjs/StructureID.cpp:
2246         * kjs/StructureID.h:
2247         * kjs/collector.cpp:
2248         * kjs/collector.h:
2249         * kjs/completion.h:
2250         * kjs/grammar.y:
2251         * kjs/interpreter.cpp:
2252         * kjs/interpreter.h:
2253         * kjs/lookup.cpp:
2254         * kjs/lookup.h:
2255         * kjs/nodes.h:
2256         * kjs/operations.cpp:
2257         * kjs/operations.h:
2258         * kjs/protect.h:
2259         * profiler/ProfileGenerator.cpp:
2260         Replace JSValue* with JSValuePtr.
2261
2262 2008-10-18  Darin Adler  <darin@apple.com>
2263
2264         * VM/Machine.cpp:
2265         (JSC::Machine::cti_op_call_eval): Removed stray parentheses from my
2266         last check-in.
2267
2268 2008-10-18  Darin Adler  <darin@apple.com>
2269
2270         Reviewed by Oliver Hunt.
2271
2272         - first step of https://bugs.webkit.org/show_bug.cgi?id=21732
2273           improve performance by eliminating JSValue as a base class for JSCell
2274
2275         Remove casts from JSValue* to derived classes, replacing them with
2276         calls to inline casting functions. These functions are also a bit
2277         better than aidrect cast because they also do a runtime assertion.
2278
2279         Removed use of 0 as for JSValue*, changing call sites to use a
2280         noValue() function instead.
2281
2282         Move things needed by classes derived from JSValue out of the class,
2283         since the classes won't be deriving from JSValue any more soon.
2284
2285         I did most of these changes by changing JSValue to not be JSValue* any
2286         more, then fixing a lot of the compilation problems, then rolling out
2287         the JSValue change.
2288
2289         1.011x as fast on SunSpider (presumably due to some of the Machine.cpp changes)
2290
2291         * API/APICast.h: Removed unneeded forward declarations.
2292
2293         * API/JSCallbackObject.h: Added an asCallbackObject function for casting.
2294         * API/JSCallbackObjectFunctions.h:
2295         (JSC::JSCallbackObject::asCallbackObject): Added.
2296         (JSC::JSCallbackObject::getOwnPropertySlot): Use asObject.
2297         (JSC::JSCallbackObject::call): Use noValue.
2298         (JSC::JSCallbackObject::staticValueGetter): Use asCallbackObject.
2299         (JSC::JSCallbackObject::staticFunctionGetter): Ditto.
2300         (JSC::JSCallbackObject::callbackGetter): Ditto.
2301
2302         * JavaScriptCore.exp: Updated.
2303
2304         * JavaScriptCore.xcodeproj/project.pbxproj: Added RegExpMatchesArray.h.
2305
2306         * VM/CTI.cpp:
2307         (JSC::CTI::asInteger): Added. For use casting a JSValue to an integer.
2308         (JSC::CTI::emitGetArg): Use asInteger.
2309         (JSC::CTI::emitGetPutArg): Ditto.
2310         (JSC::CTI::getConstantImmediateNumericArg): Ditto. Also use noValue.
2311         (JSC::CTI::emitInitRegister): Use asInteger.
2312         (JSC::CTI::getDeTaggedConstantImmediate): Ditto.
2313         (JSC::CTI::compileOpCallInitializeCallFrame): Ditto.
2314         (JSC::CTI::compileOpCall): Ditto.
2315         (JSC::CTI::compileOpStrictEq): Ditto.
2316         (JSC::CTI::privateCompileMainPass): Ditto.
2317         (JSC::CTI::privateCompileGetByIdProto): Ditto.
2318         (JSC::CTI::privateCompileGetByIdChain): Ditto.
2319         (JSC::CTI::privateCompilePutByIdTransition): Ditto.
2320         * VM/CTI.h: Rewrite the ARG-related macros to use C++ casts instead of
2321         C casts and get rid of some extra parentheses. Addd declaration of
2322         asInteger.
2323
2324         * VM/CodeGenerator.cpp:
2325         (JSC::CodeGenerator::emitEqualityOp): Use asString.
2326         (JSC::CodeGenerator::emitLoad): Use noValue.
2327         (JSC::CodeGenerator::findScopedProperty): Change globalObject argument
2328         to JSObject* instead of JSValue*.
2329         (JSC::CodeGenerator::emitResolve): Remove unneeded cast.
2330         (JSC::CodeGenerator::emitGetScopedVar): Use asCell.
2331         (JSC::CodeGenerator::emitPutScopedVar): Ditto.
2332         * VM/CodeGenerator.h: Changed out argument of findScopedProperty.
2333         Also change the JSValueMap to use PtrHash explicitly instead of
2334         getting it from DefaultHash.
2335
2336         * VM/JSPropertyNameIterator.cpp:
2337         (JSC::JSPropertyNameIterator::toPrimitive): Use noValue.
2338         * VM/JSPropertyNameIterator.h:
2339         (JSC::JSPropertyNameIterator::next): Ditto.
2340
2341         * VM/Machine.cpp:
2342         (JSC::fastIsNumber): Moved isImmediate check here instead of
2343         checking for 0 inside Heap::isNumber. Use asCell and asNumberCell.
2344         (JSC::fastToInt32): Ditto.
2345         (JSC::fastToUInt32): Ditto.
2346         (JSC::jsLess): Use asString.
2347         (JSC::jsLessEq): Ditto.
2348         (JSC::jsAdd): Ditto.
2349         (JSC::jsTypeStringForValue): Use asObject.
2350         (JSC::jsIsObjectType): Ditto.
2351         (JSC::jsIsFunctionType): Ditto.
2352         (JSC::inlineResolveBase): Use noValue.
2353         (JSC::Machine::callEval): Use asString. Initialize result to
2354         undefined, not 0.
2355         (JSC::Machine::Machine): Remove unneeded casts to JSCell*.
2356         (JSC::Machine::throwException): Use asObject.
2357         (JSC::Machine::debug): Remove explicit calls to the DebuggerCallFrame
2358         constructor.
2359         (JSC::Machine::checkTimeout): Use noValue.
2360         (JSC::cachePrototypeChain): Use asObject.
2361         (JSC::Machine::tryCachePutByID): Use asCell.
2362         (JSC::Machine::tryCacheGetByID): Use aCell and asObject.
2363         (JSC::Machine::privateExecute): Use noValue, asCell, asObject, asString,
2364         asArray, asActivation, asFunction. Changed code that creates call frames
2365         for host functions to pass 0 for the function pointer -- the call frame
2366         needs a JSFunction* and a host function object is not one. This was
2367         caught by the assertions in the casting functions. Also remove some
2368         unneeded casts in cases where two values are compared.
2369         (JSC::Machine::retrieveLastCaller): Use noValue.
2370         (JSC::Machine::tryCTICachePutByID): Use asCell.
2371         (JSC::Machine::tryCTICacheGetByID): Use aCell and asObject.
2372         (JSC::setUpThrowTrampolineReturnAddress): Added this function to restore
2373         the PIC-branch-avoidance that was recently lost.
2374         (JSC::Machine::cti_op_add): Use asString.
2375         (JSC::Machine::cti_op_instanceof): Use asCell and asObject.
2376         (JSC::Machine::cti_op_call_JSFunction): Use asFunction.
2377         (JSC::Machine::cti_op_call_NotJSFunction): Changed code to pass 0 for
2378         the function pointer, since we don't have a JSFunction. Use asObject.
2379         (JSC::Machine::cti_op_tear_off_activation): Use asActivation.
2380         (JSC::Machine::cti_op_construct_JSConstruct): Use asFunction and asObject.
2381         (JSC::Machine::cti_op_construct_NotJSConstruct): use asObject.
2382         (JSC::Machine::cti_op_get_by_val): Use asArray and asString.
2383         (JSC::Machine::cti_op_resolve_func): Use asPointer; this helps prepare
2384         us for a situation where JSValue is not a pointer.
2385         (JSC::Machine::cti_op_put_by_val): Use asArray.
2386         (JSC::Machine::cti_op_put_by_val_array): Ditto.
2387         (JSC::Machine::cti_op_resolve_global): Use asGlobalObject.
2388         (JSC::Machine::cti_op_post_inc): Change VM_CHECK_EXCEPTION_2 to
2389         VM_CHECK_EXCEPTION_AT_END, since there's no observable work done after
2390         that point. Also use asPointer.
2391         (JSC::Machine::cti_op_resolve_with_base): Use asPointer.
2392         (JSC::Machine::cti_op_post_dec): Change VM_CHECK_EXCEPTION_2 to
2393         VM_CHECK_EXCEPTION_AT_END, since there's no observable work done after
2394         that point. Also use asPointer.
2395         (JSC::Machine::cti_op_call_eval): Use asObject, noValue, and change
2396         VM_CHECK_EXCEPTION_ARG to VM_THROW_EXCEPTION_AT_END.
2397         (JSC::Machine::cti_op_throw): Change return value to a JSValue*.
2398         (JSC::Machine::cti_op_in): Use asObject.
2399         (JSC::Machine::cti_op_switch_char): Use asString.
2400         (JSC::Machine::cti_op_switch_string): Ditto.
2401         (JSC::Machine::cti_op_put_getter): Use asObject.
2402         (JSC::Machine::cti_op_put_setter): Ditto.
2403         (JSC::Machine::cti_vm_throw): Change return value to a JSValue*.
2404         Use noValue.
2405         * VM/Machine.h: Change return values of both cti_op_throw and
2406         cti_vm_throw to JSValue*.
2407
2408         * VM/Register.h: Remove nullJSValue, which is the same thing
2409         as noValue(). Also removed unneeded definition of JSValue.
2410
2411         * kjs/ArgList.h: Removed unneeded definition of JSValue.
2412
2413         * kjs/Arguments.h:
2414         (JSC::asArguments): Added.
2415
2416         * kjs/ArrayPrototype.cpp:
2417         (JSC::getProperty): Use noValue.
2418         (JSC::arrayProtoFuncToString): Use asArray.
2419         (JSC::arrayProtoFuncToLocaleString): Ditto.
2420         (JSC::arrayProtoFuncConcat): Ditto.
2421         (JSC::arrayProtoFuncPop): Ditto. Also removed unneeded initialization
2422         of the result, which is set in both sides of the branch.
2423         (JSC::arrayProtoFuncPush): Ditto.
2424         (JSC::arrayProtoFuncShift): Removed unneeded initialization
2425         of the result, which is set in both sides of the branch.
2426         (JSC::arrayProtoFuncSort): Use asArray.
2427
2428         * kjs/BooleanObject.h:
2429         (JSC::asBooleanObject): Added.
2430
2431         * kjs/BooleanPrototype.cpp:
2432         (JSC::booleanProtoFuncToString): Use asBooleanObject.
2433         (JSC::booleanProtoFuncValueOf): Ditto.
2434
2435         * kjs/CallData.cpp:
2436         (JSC::call): Use asObject and asFunction.
2437         * kjs/ConstructData.cpp:
2438         (JSC::construct): Ditto.
2439
2440         * kjs/DateConstructor.cpp:
2441         (JSC::constructDate): Use asDateInstance.
2442
2443         * kjs/DateInstance.h:
2444         (JSC::asDateInstance): Added.
2445
2446         * kjs/DatePrototype.cpp:
2447         (JSC::dateProtoFuncToString): Use asDateInstance.
2448         (JSC::dateProtoFuncToUTCString): Ditto.
2449         (JSC::dateProtoFuncToDateString): Ditto.
2450         (JSC::dateProtoFuncToTimeString): Ditto.
2451         (JSC::dateProtoFuncToLocaleString): Ditto.
2452         (JSC::dateProtoFuncToLocaleDateString): Ditto.
2453         (JSC::dateProtoFuncToLocaleTimeString): Ditto.
2454         (JSC::dateProtoFuncValueOf): Ditto.
2455         (JSC::dateProtoFuncGetTime): Ditto.
2456         (JSC::dateProtoFuncGetFullYear): Ditto.
2457         (JSC::dateProtoFuncGetUTCFullYear): Ditto.
2458         (JSC::dateProtoFuncToGMTString): Ditto.
2459         (JSC::dateProtoFuncGetMonth): Ditto.
2460         (JSC::dateProtoFuncGetUTCMonth): Ditto.
2461         (JSC::dateProtoFuncGetDate): Ditto.
2462         (JSC::dateProtoFuncGetUTCDate): Ditto.
2463         (JSC::dateProtoFuncGetDay): Ditto.
2464         (JSC::dateProtoFuncGetUTCDay): Ditto.
2465         (JSC::dateProtoFuncGetHours): Ditto.
2466         (JSC::dateProtoFuncGetUTCHours): Ditto.
2467         (JSC::dateProtoFuncGetMinutes): Ditto.
2468         (JSC::dateProtoFuncGetUTCMinutes): Ditto.
2469         (JSC::dateProtoFuncGetSeconds): Ditto.
2470         (JSC::dateProtoFuncGetUTCSeconds): Ditto.
2471         (JSC::dateProtoFuncGetMilliSeconds): Ditto.
2472         (JSC::dateProtoFuncGetUTCMilliseconds): Ditto.
2473         (JSC::dateProtoFuncGetTimezoneOffset): Ditto.
2474         (JSC::dateProtoFuncSetTime): Ditto.
2475         (JSC::setNewValueFromTimeArgs): Ditto.
2476         (JSC::setNewValueFromDateArgs): Ditto.
2477         (JSC::dateProtoFuncSetYear): Ditto.
2478         (JSC::dateProtoFuncGetYear): Ditto.
2479
2480         * kjs/DebuggerCallFrame.cpp:
2481         (JSC::DebuggerCallFrame::thisObject): Use asObject.
2482         (JSC::DebuggerCallFrame::evaluate): Use noValue.
2483         * kjs/DebuggerCallFrame.h: Added a constructor that
2484         takes only a callFrame.
2485
2486         * kjs/ExecState.h:
2487         (JSC::ExecState::clearException): Use noValue.
2488
2489         * kjs/FunctionPrototype.cpp:
2490         (JSC::functionProtoFuncToString): Use asFunction.
2491         (JSC::functionProtoFuncApply): Use asArguments and asArray.
2492
2493         * kjs/GetterSetter.cpp:
2494         (JSC::GetterSetter::getPrimitiveNumber): Use noValue.
2495
2496         * kjs/GetterSetter.h:
2497         (JSC::asGetterSetter): Added.
2498
2499         * kjs/InternalFunction.cpp:
2500         (JSC::InternalFunction::name): Use asString.
2501
2502         * kjs/InternalFunction.h:
2503         (JSC::asInternalFunction): Added.
2504
2505         * kjs/JSActivation.cpp:
2506         (JSC::JSActivation::argumentsGetter): Use asActivation.
2507
2508         * kjs/JSActivation.h:
2509         (JSC::asActivation): Added.
2510
2511         * kjs/JSArray.cpp:
2512         (JSC::JSArray::putSlowCase): Use noValue.
2513         (JSC::JSArray::deleteProperty): Ditto.
2514         (JSC::JSArray::increaseVectorLength): Ditto.
2515         (JSC::JSArray::setLength): Ditto.
2516         (JSC::JSArray::pop): Ditto.
2517         (JSC::JSArray::sort): Ditto.
2518         (JSC::JSArray::compactForSorting): Ditto.
2519         * kjs/JSArray.h:
2520         (JSC::asArray): Added.
2521
2522         * kjs/JSCell.cpp:
2523         (JSC::JSCell::getJSNumber): Use noValue.
2524
2525         * kjs/JSCell.h:
2526         (JSC::asCell): Added.
2527         (JSC::JSValue::asCell): Changed to not preserve const.
2528         Given the wide use of JSValue* and JSCell*, it's not
2529         really useful to use const.
2530         (JSC::JSValue::isNumber): Use asValue.
2531         (JSC::JSValue::isString): Ditto.
2532         (JSC::JSValue::isGetterSetter): Ditto.
2533         (JSC::JSValue::isObject): Ditto.
2534         (JSC::JSValue::getNumber): Ditto.
2535         (JSC::JSValue::getString): Ditto.
2536         (JSC::JSValue::getObject): Ditto.
2537         (JSC::JSValue::getCallData): Ditto.
2538         (JSC::JSValue::getConstructData): Ditto.
2539         (JSC::JSValue::getUInt32): Ditto.
2540         (JSC::JSValue::getTruncatedInt32): Ditto.
2541         (JSC::JSValue::getTruncatedUInt32): Ditto.
2542         (JSC::JSValue::mark): Ditto.
2543         (JSC::JSValue::marked): Ditto.
2544         (JSC::JSValue::toPrimitive): Ditto.
2545         (JSC::JSValue::getPrimitiveNumber): Ditto.
2546         (JSC::JSValue::toBoolean): Ditto.
2547         (JSC::JSValue::toNumber): Ditto.
2548         (JSC::JSValue::toString): Ditto.
2549         (JSC::JSValue::toObject): Ditto.
2550         (JSC::JSValue::toThisObject): Ditto.
2551         (JSC::JSValue::needsThisConversion): Ditto.
2552         (JSC::JSValue::toThisString): Ditto.
2553         (JSC::JSValue::getJSNumber): Ditto.
2554
2555         * kjs/JSFunction.cpp:
2556         (JSC::JSFunction::argumentsGetter): Use asFunction.
2557         (JSC::JSFunction::callerGetter): Ditto.
2558         (JSC::JSFunction::lengthGetter): Ditto.
2559         (JSC::JSFunction::construct): Use asObject.
2560
2561         * kjs/JSFunction.h:
2562         (JSC::asFunction): Added.
2563
2564         * kjs/JSGlobalObject.cpp:
2565         (JSC::lastInPrototypeChain): Use asObject.
2566
2567         * kjs/JSGlobalObject.h:
2568         (JSC::asGlobalObject): Added.
2569         (JSC::ScopeChainNode::globalObject): Use asGlobalObject.
2570
2571         * kjs/JSImmediate.h: Added noValue, asPointer, and makeValue
2572         functions. Use rawValue, makeValue, and noValue consistently
2573         instead of doing reinterpret_cast in various functions.
2574
2575         * kjs/JSNumberCell.h:
2576         (JSC::asNumberCell): Added.
2577         (JSC::JSValue::uncheckedGetNumber): Use asValue and asNumberCell.
2578         (JSC::JSValue::toJSNumber): Use asValue.
2579
2580         * kjs/JSObject.cpp:
2581         (JSC::JSObject::put): Use asObject and asGetterSetter.
2582         (JSC::callDefaultValueFunction): Use noValue.
2583         (JSC::JSObject::defineGetter): Use asGetterSetter.
2584         (JSC::JSObject::defineSetter): Ditto.
2585         (JSC::JSObject::lookupGetter): Ditto. Also use asObject.
2586         (JSC::JSObject::lookupSetter): Ditto.
2587         (JSC::JSObject::hasInstance): Use asObject.
2588         (JSC::JSObject::fillGetterPropertySlot): Use asGetterSetter.
2589
2590         * kjs/JSObject.h:
2591         (JSC::JSObject::getDirect): Use noValue.
2592         (JSC::asObject): Added.
2593         (JSC::JSValue::isObject): Use asValue.
2594         (JSC::JSObject::get): Removed unneeded const_cast.
2595         (JSC::JSObject::getPropertySlot): Use asObject.
2596         (JSC::JSValue::get): Removed unneeded const_cast.
2597         Use asValue, asCell, and asObject.
2598         (JSC::JSValue::put): Ditto.
2599         (JSC::JSObject::allocatePropertyStorageInline): Fixed spelling
2600         of "oldPropertStorage".
2601
2602         * kjs/JSString.cpp:
2603         (JSC::JSString::getOwnPropertySlot): Use asObject.
2604
2605         * kjs/JSString.h:
2606         (JSC::asString): Added.
2607         (JSC::JSValue::toThisJSString): Use asValue.
2608
2609         * kjs/JSValue.h: Make PreferredPrimitiveType a top level enum
2610         instead of a member of JSValue. Added an asValue function that
2611         returns this. Removed overload of asCell for const. Use asValue
2612         instead of getting right at this.
2613
2614         * kjs/ObjectPrototype.cpp:
2615         (JSC::objectProtoFuncIsPrototypeOf): Use asObject.
2616         (JSC::objectProtoFuncDefineGetter): Ditto.
2617         (JSC::objectProtoFuncDefineSetter): Ditto.
2618
2619         * kjs/PropertySlot.h:
2620         (JSC::PropertySlot::PropertySlot): Take a const JSValue* so the
2621         callers don't have to worry about const.
2622         (JSC::PropertySlot::clearBase): Use noValue.
2623         (JSC::PropertySlot::clearValue): Ditto.
2624
2625         * kjs/RegExpConstructor.cpp:
2626         (JSC::regExpConstructorDollar1): Use asRegExpConstructor.
2627         (JSC::regExpConstructorDollar2): Ditto.
2628         (JSC::regExpConstructorDollar3): Ditto.
2629         (JSC::regExpConstructorDollar4): Ditto.
2630         (JSC::regExpConstructorDollar5): Ditto.
2631         (JSC::regExpConstructorDollar6): Ditto.
2632         (JSC::regExpConstructorDollar7): Ditto.
2633         (JSC::regExpConstructorDollar8): Ditto.
2634         (JSC::regExpConstructorDollar9): Ditto.
2635         (JSC::regExpConstructorInput): Ditto.
2636         (JSC::regExpConstructorMultiline): Ditto.
2637         (JSC::regExpConstructorLastMatch): Ditto.
2638         (JSC::regExpConstructorLastParen): Ditto.
2639         (JSC::regExpConstructorLeftContext): Ditto.
2640         (JSC::regExpConstructorRightContext): Ditto.
2641         (JSC::setRegExpConstructorInput): Ditto.
2642         (JSC::setRegExpConstructorMultiline): Ditto.
2643         (JSC::constructRegExp): Use asObject.
2644
2645         * kjs/RegExpConstructor.h:
2646         (JSC::asRegExpConstructor): Added.
2647
2648         * kjs/RegExpObject.cpp:
2649         (JSC::regExpObjectGlobal): Use asRegExpObject.
2650         (JSC::regExpObjectIgnoreCase): Ditto.
2651         (JSC::regExpObjectMultiline): Ditto.
2652         (JSC::regExpObjectSource): Ditto.
2653         (JSC::regExpObjectLastIndex): Ditto.
2654         (JSC::setRegExpObjectLastIndex): Ditto.
2655         (JSC::callRegExpObject): Ditto.
2656
2657         * kjs/RegExpObject.h:
2658         (JSC::asRegExpObject): Added.
2659
2660         * kjs/RegExpPrototype.cpp:
2661         (JSC::regExpProtoFuncTest): Use asRegExpObject.
2662         (JSC::regExpProtoFuncExec): Ditto.
2663         (JSC::regExpProtoFuncCompile): Ditto.
2664         (JSC::regExpProtoFuncToString): Ditto.
2665
2666         * kjs/StringObject.h:
2667         (JSC::StringObject::internalValue): Use asString.
2668         (JSC::asStringObject): Added.
2669
2670         * kjs/StringPrototype.cpp:
2671         (JSC::stringProtoFuncReplace): Use asRegExpObject.
2672         (JSC::stringProtoFuncToString): Ue asStringObject.
2673         (JSC::stringProtoFuncMatch): Use asRegExpObject.
2674         (JSC::stringProtoFuncSearch): Ditto.
2675         (JSC::stringProtoFuncSplit): Ditto.
2676
2677         * kjs/StructureID.cpp:
2678         (JSC::StructureID::getEnumerablePropertyNames): Use asObject.
2679         (JSC::StructureID::createCachedPrototypeChain): Ditto.
2680         (JSC::StructureIDChain::StructureIDChain): Use asCell and asObject.
2681
2682         * kjs/collector.h:
2683         (JSC::Heap::isNumber): Removed null handling. This can only be called
2684         on valid cells.
2685         (JSC::Heap::cellBlock): Removed overload for const and non-const.
2686         Whether the JSCell* is const or not really should have no effect on
2687         whether you can modify the collector block it's in.
2688
2689         * kjs/interpreter.cpp:
2690         (JSC::Interpreter::evaluate): Use noValue and noObject.
2691
2692         * kjs/nodes.cpp:
2693         (JSC::FunctionCallResolveNode::emitCode): Use JSObject for the global
2694         object rather than JSValue.
2695         (JSC::PostfixResolveNode::emitCode): Ditto.
2696         (JSC::PrefixResolveNode::emitCode): Ditto.
2697         (JSC::ReadModifyResolveNode::emitCode): Ditto.
2698         (JSC::AssignResolveNode::emitCode): Ditto.
2699
2700         * kjs/operations.h:
2701         (JSC::equalSlowCaseInline): Use asString, asCell, asNumberCell, 
2702         (JSC::strictEqualSlowCaseInline): Ditto.
2703
2704 2008-10-18  Cameron Zwarich  <zwarich@apple.com>
2705
2706         Reviewed by Oliver Hunt.
2707
2708         Bug 21702: Special op_create_activation for the case where there are no named parameters
2709         <https://bugs.webkit.org/show_bug.cgi?id=21702>
2710
2711         This is a 2.5% speedup on the V8 Raytrace benchmark and a 1.1% speedup
2712         on the V8 Earley-Boyer benchmark.
2713
2714         * VM/CTI.cpp:
2715         (JSC::CTI::privateCompileMainPass):
2716         * VM/Machine.cpp:
2717         (JSC::Machine::cti_op_create_arguments_no_params):
2718         * VM/Machine.h:
2719         * kjs/Arguments.h:
2720         (JSC::Arguments::):
2721         (JSC::Arguments::Arguments):
2722
2723 2008-10-17  Maciej Stachowiak  <mjs@apple.com>
2724
2725         Reviewed by Cameron Zwarich.
2726         
2727         - in debug builds, alter the stack to avoid blowing out MallocStackLogging
2728         
2729         (In essence, while executing a CTI function we alter the return
2730         address to jscGeneratedNativeCode so that a single consistent
2731         function is on the stack instead of many random functions without
2732         symbols.)
2733
2734         * VM/CTI.h:
2735         * VM/Machine.cpp:
2736         (JSC::doSetReturnAddress):
2737         (JSC::):
2738         (JSC::StackHack::StackHack):
2739         (JSC::StackHack::~StackHack):
2740         (JSC::Machine::cti_op_convert_this):
2741         (JSC::Machine::cti_op_end):
2742         (JSC::Machine::cti_op_add):
2743         (JSC::Machine::cti_op_pre_inc):
2744         (JSC::Machine::cti_timeout_check):
2745         (JSC::Machine::cti_register_file_check):
2746         (JSC::Machine::cti_op_loop_if_less):
2747         (JSC::Machine::cti_op_loop_if_lesseq):
2748         (JSC::Machine::cti_op_new_object):
2749         (JSC::Machine::cti_op_put_by_id):
2750         (JSC::Machine::cti_op_put_by_id_second):
2751         (JSC::Machine::cti_op_put_by_id_generic):
2752         (JSC::Machine::cti_op_put_by_id_fail):
2753         (JSC::Machine::cti_op_get_by_id):
2754         (JSC::Machine::cti_op_get_by_id_second):
2755         (JSC::Machine::cti_op_get_by_id_generic):
2756         (JSC::Machine::cti_op_get_by_id_fail):
2757         (JSC::Machine::cti_op_instanceof):
2758         (JSC::Machine::cti_op_del_by_id):
2759         (JSC::Machine::cti_op_mul):
2760         (JSC::Machine::cti_op_new_func):
2761         (JSC::Machine::cti_op_call_profiler):
2762         (JSC::Machine::cti_op_call_JSFunction):
2763         (JSC::Machine::cti_vm_lazyLinkCall):
2764         (JSC::Machine::cti_vm_compile):
2765         (JSC::Machine::cti_op_push_activation):
2766         (JSC::Machine::cti_op_call_NotJSFunction):
2767         (JSC::Machine::cti_op_create_arguments):
2768         (JSC::Machine::cti_op_tear_off_activation):
2769         (JSC::Machine::cti_op_tear_off_arguments):
2770         (JSC::Machine::cti_op_ret_profiler):
2771         (JSC::Machine::cti_op_ret_scopeChain):
2772         (JSC::Machine::cti_op_new_array):
2773         (JSC::Machine::cti_op_resolve):
2774         (JSC::Machine::cti_op_construct_JSConstructFast):
2775         (JSC::Machine::cti_op_construct_JSConstruct):
2776         (JSC::Machine::cti_op_construct_NotJSConstruct):
2777         (JSC::Machine::cti_op_get_by_val):
2778         (JSC::Machine::cti_op_resolve_func):
2779         (JSC::Machine::cti_op_sub):
2780         (JSC::Machine::cti_op_put_by_val):
2781         (JSC::Machine::cti_op_put_by_val_array):
2782         (JSC::Machine::cti_op_lesseq):
2783         (JSC::Machine::cti_op_loop_if_true):
2784         (JSC::Machine::cti_op_negate):
2785         (JSC::Machine::cti_op_resolve_base):
2786         (JSC::Machine::cti_op_resolve_skip):
2787         (JSC::Machine::cti_op_resolve_global):
2788         (JSC::Machine::cti_op_div):
2789         (JSC::Machine::cti_op_pre_dec):
2790         (JSC::Machine::cti_op_jless):
2791         (JSC::Machine::cti_op_not):
2792         (JSC::Machine::cti_op_jtrue):
2793         (JSC::Machine::cti_op_post_inc):
2794         (JSC::Machine::cti_op_eq):
2795         (JSC::Machine::cti_op_lshift):
2796         (JSC::Machine::cti_op_bitand):
2797         (JSC::Machine::cti_op_rshift):
2798         (JSC::Machine::cti_op_bitnot):
2799         (JSC::Machine::cti_op_resolve_with_base):
2800         (JSC::Machine::cti_op_new_func_exp):
2801         (JSC::Machine::cti_op_mod):
2802         (JSC::Machine::cti_op_less):
2803         (JSC::Machine::cti_op_neq):
2804         (JSC::Machine::cti_op_post_dec):
2805         (JSC::Machine::cti_op_urshift):
2806         (JSC::Machine::cti_op_bitxor):
2807         (JSC::Machine::cti_op_new_regexp):
2808         (JSC::Machine::cti_op_bitor):
2809         (JSC::Machine::cti_op_call_eval):
2810         (JSC::Machine::cti_op_throw):
2811         (JSC::Machine::cti_op_get_pnames):
2812         (JSC::Machine::cti_op_next_pname):
2813         (JSC::Machine::cti_op_push_scope):
2814         (JSC::Machine::cti_op_pop_scope):
2815         (JSC::Machine::cti_op_typeof):
2816         (JSC::Machine::cti_op_is_undefined):
2817         (JSC::Machine::cti_op_is_boolean):
2818         (JSC::Machine::cti_op_is_number):
2819         (JSC::Machine::cti_op_is_string):
2820         (JSC::Machine::cti_op_is_object):
2821         (JSC::Machine::cti_op_is_function):
2822         (JSC::Machine::cti_op_stricteq):
2823         (JSC::Machine::cti_op_nstricteq):
2824         (JSC::Machine::cti_op_to_jsnumber):
2825         (JSC::Machine::cti_op_in):
2826         (JSC::Machine::cti_op_push_new_scope):
2827         (JSC::Machine::cti_op_jmp_scopes):
2828         (JSC::Machine::cti_op_put_by_index):
2829         (JSC::Machine::cti_op_switch_imm):
2830         (JSC::Machine::cti_op_switch_char):
2831         (JSC::Machine::cti_op_switch_string):
2832         (JSC::Machine::cti_op_del_by_val):
2833         (JSC::Machine::cti_op_put_getter):
2834         (JSC::Machine::cti_op_put_setter):
2835         (JSC::Machine::cti_op_new_error):
2836         (JSC::Machine::cti_op_debug):
2837         (JSC::Machine::cti_vm_throw):
2838
2839 2008-10-17  Gavin Barraclough  <barraclough@apple.com>
2840
2841         Optimize op_call by allowing call sites to be directly linked to callees.
2842
2843         For the hot path of op_call, CTI now generates a check (initially for an impossible
2844         value), and the first time the call is executed we attempt to link the call directly
2845         to the callee.  We can currently only do so if the arity of the caller and callee
2846         match.  The (optimized) setup for the call on the hot path is linked directly to
2847         the ctiCode for the callee, without indirection.
2848         
2849         Two forms of the slow case of the call are generated, the first will be executed the
2850         first time the call is reached.  As well as this path attempting to link the call to
2851         a callee, it also relinks the slow case to a second slow case, which will not continue
2852         to attempt relinking the call.  (This policy could be changed in future, but for not
2853         this is intended to prevent thrashing).
2854
2855         If a callee that the caller has been linked to is garbage collected, then the link
2856         in the caller's JIt code will be reset back to a value that cannot match - to prevent
2857         any false positive matches.
2858
2859         ~20% progression on deltablue & richards, >12% overall reduction in v8-tests
2860         runtime, one or two percent progression on sunspider.
2861
2862         Reviewed by Oliver Hunt.
2863
2864         * VM/CTI.cpp:
2865         (JSC::):
2866         (JSC::CTI::emitNakedCall):
2867         (JSC::unreachable):
2868         (JSC::CTI::compileOpCallInitializeCallFrame):
2869         (JSC::CTI::compileOpCallSetupArgs):
2870         (JSC::CTI::compileOpCall):
2871         (JSC::CTI::privateCompileMainPass):
2872         (JSC::CTI::privateCompileSlowCases):
2873         (JSC::CTI::privateCompile):
2874         (JSC::CTI::unlinkCall):
2875         (JSC::CTI::linkCall):
2876         * VM/CTI.h:
2877         * VM/CodeBlock.cpp:
2878         (JSC::CodeBlock::~CodeBlock):
2879         (JSC::CodeBlock::unlinkCallers):
2880         (JSC::CodeBlock::derefStructureIDs):
2881         * VM/CodeBlock.h:
2882         (JSC::StructureStubInfo::StructureStubInfo):
2883         (JSC::CallLinkInfo::CallLinkInfo):
2884         (JSC::CodeBlock::addCaller):
2885         (JSC::CodeBlock::removeCaller):
2886         (JSC::CodeBlock::getStubInfo):
2887         * VM/CodeGenerator.cpp:
2888         (JSC::CodeGenerator::emitCall):
2889         (JSC::CodeGenerator::emitConstruct):
2890         * VM/Machine.cpp:
2891         (JSC::Machine::cti_op_call_profiler):
2892         (JSC::Machine::cti_op_call_JSFunction):
2893         (JSC::Machine::cti_vm_lazyLinkCall):
2894         (JSC::Machine::cti_op_construct_JSConstructFast):
2895         (JSC::Machine::cti_op_construct_JSConstruct):
2896         (JSC::Machine::cti_op_construct_NotJSConstruct):
2897         * VM/Machine.h:
2898         * kjs/JSFunction.cpp:
2899         (JSC::JSFunction::~JSFunction):
2900         * kjs/JSFunction.h:
2901         * kjs/nodes.h:
2902         (JSC::FunctionBodyNode::):
2903         * masm/X86Assembler.h:
2904         (JSC::X86Assembler::getDifferenceBetweenLabels):
2905
2906 2008-10-17  Maciej Stachowiak  <mjs@apple.com>
2907
2908         Reviewed by Geoff Garen.
2909         
2910         - remove ASSERT that makes the leaks buildbot cry
2911
2912         * kjs/JSFunction.cpp:
2913         (JSC::JSFunction::JSFunction):
2914
2915 2008-10-17  Maciej Stachowiak  <mjs@apple.com>
2916
2917         Reviewed by Cameron Zwarich
2918         
2919         - don't bother to do arguments tearoff when it will have no effect
2920
2921         ~1% on v8 raytrace
2922         
2923         * VM/CodeGenerator.cpp:
2924         (JSC::CodeGenerator::emitReturn):
2925
2926 2008-10-17  Marco Barisione  <marco.barisione@collabora.co.uk>
2927
2928         Reviewed by Sam Weinig. Landed by Jan Alonzo.
2929
2930         https://bugs.webkit.org/show_bug.cgi?id=21603
2931         [GTK] Minor fixes to GOwnPtr
2932
2933         * wtf/GOwnPtr.cpp:
2934         (WTF::GError):
2935         (WTF::GList):
2936         (WTF::GCond):
2937         (WTF::GMutex):
2938         (WTF::GPatternSpec):
2939         (WTF::GDir):
2940         * wtf/GOwnPtr.h:
2941         (WTF::freeOwnedGPtr):
2942         (WTF::GOwnPtr::~GOwnPtr):
2943         (WTF::GOwnPtr::outPtr):
2944         (WTF::GOwnPtr::set):
2945         (WTF::GOwnPtr::clear):
2946         * wtf/Threading.h:
2947
2948 2008-10-17  Maciej Stachowiak  <mjs@apple.com>
2949
2950         Reviewed by Cameron Zwarich.
2951         
2952         - speed up transitions that resize the property storage a fair bit
2953         
2954         ~3% speedup on v8 RayTrace benchmark, ~1% on DeltaBlue
2955
2956         * VM/CTI.cpp:
2957         (JSC::resizePropertyStorage): renamed from transitionObject, and reduced to just resize
2958         the object's property storage with one inline call.
2959         (JSC::CTI::privateCompilePutByIdTransition): Use a separate function for property storage
2960         resize, but still do all the rest of the work in assembly in that case, and pass the known
2961         compile-time constants of old and new size rather than structureIDs, saving a bunch of
2962         redundant memory access.
2963         * kjs/JSObject.cpp:
2964         (JSC::JSObject::allocatePropertyStorage): Just call the inline version.
2965         * kjs/JSObject.h:
2966         (JSC::JSObject::allocatePropertyStorageInline): Inline version of allocatePropertyStorage
2967         * masm/X86Assembler.h:
2968         (JSC::X86Assembler::):
2969         (JSC::X86Assembler::pushl_i32): Add code to assmeble push of a constant; code originally by Cameron Zwarich.
2970
2971 2008-10-17  Cameron Zwarich  <zwarich@apple.com>
2972
2973         Reviewed by Maciej Stachowiak.
2974
2975         Remove some C style casts.
2976
2977         * masm/X86Assembler.h:
2978         (JSC::JITCodeBuffer::putIntUnchecked):
2979         (JSC::X86Assembler::link):
2980         (JSC::X86Assembler::linkAbsoluteAddress):
2981         (JSC::X86Assembler::getRelocatedAddress):
2982
2983 2008-10-17  Cameron Zwarich  <zwarich@apple.com>
2984
2985         Rubber-stamped by Maciej Stachowiak.
2986
2987         Remove some C style casts.
2988
2989         * VM/CTI.cpp:
2990         (JSC::CTI::patchGetByIdSelf):
2991         (JSC::CTI::patchPutByIdReplace):
2992         * VM/Machine.cpp:
2993         (JSC::Machine::tryCTICachePutByID):
2994         (JSC::Machine::tryCTICacheGetByID):
2995         (JSC::Machine::cti_op_put_by_id):
2996         (JSC::Machine::cti_op_put_by_id_fail):
2997         (JSC::Machine::cti_op_get_by_id):
2998         (JSC::Machine::cti_op_get_by_id_fail):
2999
3000 2008-10-17  Maciej Stachowiak  <mjs@apple.com>
3001
3002         Reviewed by Cameron Zwarich.
3003         
3004         - Avoid restoring the caller's 'r' value in op_ret
3005         https://bugs.webkit.org/show_bug.cgi?id=21319
3006
3007         This patch stops writing the call frame at call and return points;
3008         instead it does so immediately before any CTI call.
3009         
3010         0.5% speedup or so on the v8 benchmark
3011                
3012         * VM/CTI.cpp:
3013         (JSC::CTI::emitCTICall):
3014         (JSC::CTI::compileOpCall):
3015         (JSC::CTI::emitSlowScriptCheck):
3016         (JSC::CTI::compileBinaryArithOpSlowCase):
3017         (JSC::CTI::privateCompileMainPass):
3018         (JSC::CTI::privateCompileSlowCases):
3019         (JSC::CTI::privateCompile):
3020         * VM/CTI.h:
3021
3022 2008-10-17  Cameron Zwarich  <zwarich@apple.com>
3023
3024         Reviewed by Sam Weinig.
3025
3026         Make WREC require CTI because it won't actually compile otherwise.
3027
3028         * wtf/Platform.h:
3029
3030 2008-10-16  Maciej Stachowiak  <mjs@apple.com>
3031
3032         Reviewed by Geoff Garen.
3033
3034         - fixed <rdar://problem/5806316> JavaScriptCore should not force building with gcc 4.0
3035         - use gcc 4.2 when building with Xcode 3.1 or newer on Leopard, even though this is not the default
3036
3037         This time there is no performance regression; we can avoid having
3038         to use the fastcall calling convention for CTI functions by using
3039         varargs to prevent the compiler from moving things around on the
3040         stack.
3041         
3042         * Configurations/DebugRelease.xcconfig:
3043         * JavaScriptCore.xcodeproj/project.pbxproj:
3044         * VM/CTI.cpp:
3045         * VM/Machine.h:
3046         * wtf/Platform.h:
3047
3048 2008-10-16  Maciej Stachowiak  <mjs@apple.com>
3049
3050         Reviewed by Oliver Hunt.
3051
3052         - fix for REGRESSION: r37631 causing crashes on buildbot
3053         https://bugs.webkit.org/show_bug.cgi?id=21682
3054         
3055         * kjs/collector.cpp:
3056         (JSC::Heap::collect): Avoid crashing when a GC occurs while no global objects are live.
3057
3058 2008-10-16  Sam Weinig  <sam@webkit.org>
3059
3060         Reviewed by Maciej Stachowiak.
3061
3062         Fix for https://bugs.webkit.org/show_bug.cgi?id=21683
3063         Don't create intermediate StructureIDs for builtin objects
3064
3065         First step in reduce number of StructureIDs created when initializing the
3066         JSGlobalObject.
3067
3068         - In order to avoid creating the intermediate StructureIDs use the new putDirectWithoutTransition
3069           and putDirectFunctionWithoutTransition to add properties to JSObjects without transitioning
3070           the StructureID.  This patch just implements this strategy for ObjectPrototype but alone
3071           reduces the number of StructureIDs create for about:blank by 10, from 142 to 132.
3072
3073         * kjs/JSGlobalObject.cpp:
3074         (JSC::JSGlobalObject::reset):
3075         * kjs/JSObject.cpp:
3076         (JSC::JSObject::putDirectFunctionWithoutTransition):
3077         * kjs/JSObject.h:
3078         (JSC::JSObject::putDirectWithoutTransition):
3079         * kjs/ObjectPrototype.cpp:
3080         (JSC::ObjectPrototype::ObjectPrototype):
3081         * kjs/ObjectPrototype.h:
3082         * kjs/StructureID.cpp:
3083         (JSC::StructureID::addPropertyWithoutTransition):
3084         * kjs/StructureID.h:
3085
3086 2008-10-16  Maciej Stachowiak  <mjs@apple.com>
3087
3088         Reviewed by Cameron Zwarich.
3089         
3090         - fix for: REGRESSION: over 100 StructureIDs leak loading about:blank (result of fix for bug 21633)
3091         
3092         Apparent slight progression (< 0.5%) on v8 benchmarks and SunSpider.
3093
3094         * kjs/StructureID.cpp:
3095         (JSC::StructureID::~StructureID): Don't deref this object's parent's pointer to
3096         itself from the destructor; that doesn't even make sense.
3097         (JSC::StructureID::addPropertyTransition): Don't refer the single transition;
3098         the rule is that parent StructureIDs are ref'd but child ones are not. Refing
3099         the child creates a cycle.
3100
3101 2008-10-15  Alexey Proskuryakov  <ap@webkit.org>
3102
3103         Reviewed by Darin Adler.
3104
3105         https://bugs.webkit.org/show_bug.cgi?id=21609
3106         Make MessagePorts protect their peers across heaps
3107
3108         * JavaScriptCore.exp:
3109         * kjs/JSGlobalObject.cpp:
3110         (JSC::JSGlobalObject::markCrossHeapDependentObjects):
3111         * kjs/JSGlobalObject.h:
3112         * kjs/collector.cpp:
3113         (JSC::Heap::collect):
3114         Before GC sweep phase, a function supplied by global object is now called for all global
3115         objects in the heap, making it possible to implement cross-heap dependencies.
3116
3117 2008-10-15  Alexey Proskuryakov  <ap@webkit.org>
3118
3119         Reviewed by Darin Adler.
3120
3121         https://bugs.webkit.org/show_bug.cgi?id=21610
3122         run-webkit-threads --threaded crashes in StructureID destructor
3123
3124         * kjs/StructureID.cpp:
3125         (JSC::StructureID::StructureID):
3126         (JSC::StructureID::~StructureID):
3127         Protect access to a static (debug-only) HashSet with a lock.
3128
3129 2008-10-15  Sam Weinig  <sam@webkit.org>
3130
3131         Reviewed by Goeffrey Garen.
3132
3133         Add function to dump statistics for StructureIDs.
3134
3135         * kjs/StructureID.cpp:
3136         (JSC::StructureID::dumpStatistics):
3137         (JSC::StructureID::StructureID):
3138         (JSC::StructureID::~StructureID):
3139         * kjs/StructureID.h:
3140
3141 2008-10-15  Cameron Zwarich  <zwarich@apple.com>
3142
3143         Reviewed by Maciej Stachowiak.
3144
3145         Bug 21633: Avoid using a HashMap when there is only a single transition
3146         <https://bugs.webkit.org/show_bug.cgi?id=21633>
3147
3148         This is a 0.8% speedup on SunSpider and between a 0.5% and 1.0% speedup
3149         on the V8 benchmark suite, depending on which harness we use. It will
3150         also slightly reduce the memory footprint of a StructureID.
3151
3152         * kjs/StructureID.cpp:
3153         (JSC::StructureID::StructureID):
3154         (JSC::StructureID::~StructureID):
3155         (JSC::StructureID::addPropertyTransition):
3156         * kjs/StructureID.h:
3157         (JSC::StructureID::):
3158
3159 2008-10-15  Csaba Osztrogonac  <oszi@inf.u-szeged.hu>
3160
3161         Reviewed by Geoffrey Garen.
3162
3163         1.40% speedup on SunSpider, 1.44% speedup on V8. (Linux)
3164         
3165         No change on Mac.
3166
3167         * VM/Machine.cpp:
3168         (JSC::fastIsNumber): ALWAYS_INLINE modifier added.
3169
3170 2008-10-15  Geoffrey Garen  <ggaren@apple.com>
3171
3172         Reviewed by Cameron Zwarich.
3173
3174         Fixed https://bugs.webkit.org/show_bug.cgi?id=21345
3175         Start the debugger without reloading the inspected page
3176
3177         * JavaScriptCore.exp: New symbols.
3178         * JavaScriptCore.xcodeproj/project.pbxproj: New files.
3179
3180         * VM/CodeBlock.h:
3181         (JSC::EvalCodeCache::get): Updated for tweak to parsing API.
3182
3183         * kjs/CollectorHeapIterator.h: Added. An iterator for the object heap,
3184         which we use to find all the live functions and recompile them.
3185
3186         * kjs/DebuggerCallFrame.cpp:
3187         (JSC::DebuggerCallFrame::evaluate): Updated for tweak to parsing API.
3188
3189         * kjs/FunctionConstructor.cpp:
3190         (JSC::constructFunction): Updated for tweak to parsing API.
3191
3192         * kjs/JSFunction.cpp:
3193         (JSC::JSFunction::JSFunction): Try to validate our SourceCode in debug
3194         builds by ASSERTing that it's syntactically valid. This doesn't catch
3195         all SourceCode bugs, but it catches a lot of them.
3196
3197         * kjs/JSGlobalObjectFunctions.cpp:
3198         (JSC::globalFuncEval): Updated for tweak to parsing API.
3199
3200         * kjs/Parser.cpp:
3201         (JSC::Parser::parse):
3202         * kjs/Parser.h:
3203         (JSC::Parser::parse): Tweaked the parser to make it possible to parse
3204         without an ExecState, and to allow the client to specify a debugger to
3205         notify (or not) about the source we parse. This allows the inspector
3206         to recompile even though no JavaScript is executing, then notify the
3207         debugger about all source code when it's done.
3208
3209         * kjs/Shell.cpp:
3210         (prettyPrintScript): Updated for tweak to parsing API.
3211
3212         * kjs/SourceRange.h:
3213         (JSC::SourceCode::isNull): Added to help with ASSERTs.
3214
3215         * kjs/collector.cpp:
3216         (JSC::Heap::heapAllocate):
3217         (JSC::Heap::sweep):
3218         (JSC::Heap::primaryHeapBegin):
3219         (JSC::Heap::primaryHeapEnd):
3220         * kjs/collector.h:
3221         (JSC::): Moved a bunch of declarations around to enable compilation of
3222         CollectorHeapIterator.
3223
3224         * kjs/interpreter.cpp:
3225         (JSC::Interpreter::checkSyntax):
3226         (JSC::Interpreter::evaluate): Updated for tweak to parsing API.
3227
3228         * kjs/lexer.h:
3229         (JSC::Lexer::sourceCode): BUG FIX: Calculate SourceCode ranges relative
3230         to the SourceCode range in which we're lexing, otherwise nested functions
3231         that are compiled individually get SourceCode ranges that don't reflect
3232         their nesting.
3233
3234         * kjs/nodes.cpp:
3235         (JSC::FunctionBodyNode::FunctionBodyNode):
3236         (JSC::FunctionBodyNode::finishParsing):
3237         (JSC::FunctionBodyNode::create):
3238         (JSC::FunctionBodyNode::copyParameters):
3239         * kjs/nodes.h:
3240         (JSC::ScopeNode::setSource):
3241         (JSC::FunctionBodyNode::parameterCount): Added some helper functions for
3242         copying one FunctionBodyNode's parameters to another. The recompiler uses
3243         these when calling "finishParsing".
3244
3245 2008-10-15  Joerg Bornemann  <joerg.bornemann@trolltech.com>
3246
3247         Reviewed by Darin Adler.
3248
3249         - part of https://bugs.webkit.org/show_bug.cgi?id=20746
3250           Fix compilation on Windows CE.
3251
3252         str(n)icmp, strdup and vsnprintf are not available on Windows CE,
3253         they are called _str(n)icmp, etc. instead
3254
3255         * wtf/StringExtras.h: Added inline function implementations.
3256
3257 2008-10-15  Gabor Loki  <loki@inf.u-szeged.hu>
3258
3259         Reviewed by Cameron Zwarich.
3260
3261         <https://bugs.webkit.org/show_bug.cgi?id=20912>
3262         Use simple uint32_t multiplication on op_mul if both operands are
3263         immediate number and they are between zero and 0x7FFF.
3264
3265         * VM/Machine.cpp:
3266         (JSC::Machine::privateExecute):
3267
3268 2008-10-09  Darin Fisher  <darin@chromium.org>
3269
3270         Reviewed by Sam Weinig.
3271
3272         Make pan scrolling a platform configurable option.
3273         https://bugs.webkit.org/show_bug.cgi?id=21515
3274
3275         * wtf/Platform.h: Add ENABLE_PAN_SCROLLING
3276
3277 2008-10-14  Maciej Stachowiak  <mjs@apple.com>
3278
3279         Rubber stamped by Sam Weinig.
3280         
3281         - revert r37572 and r37581 for now
3282         
3283         Turns out GCC 4.2 is still a (small) regression, we'll have to do
3284         more work to turn it on.
3285
3286         * Configurations/DebugRelease.xcconfig:
3287         * JavaScriptCore.xcodeproj/project.pbxproj:
3288         * VM/CTI.cpp:
3289         * VM/CTI.h:
3290         * VM/Machine.cpp:
3291         (JSC::Machine::cti_op_convert_this):
3292         (JSC::Machine::cti_op_end):
3293         (JSC::Machine::cti_op_add):
3294         (JSC::Machine::cti_op_pre_inc):
3295         (JSC::Machine::cti_timeout_check):
3296         (JSC::Machine::cti_register_file_check):
3297         (JSC::Machine::cti_op_loop_if_less):
3298         (JSC::Machine::cti_op_loop_if_lesseq):
3299         (JSC::Machine::cti_op_new_object):
3300         (JSC::Machine::cti_op_put_by_id):
3301         (JSC::Machine::cti_op_put_by_id_second):
3302         (JSC::Machine::cti_op_put_by_id_generic):
3303         (JSC::Machine::cti_op_put_by_id_fail):
3304         (JSC::Machine::cti_op_get_by_id):
3305         (JSC::Machine::cti_op_get_by_id_second):
3306         (JSC::Machine::cti_op_get_by_id_generic):
3307         (JSC::Machine::cti_op_get_by_id_fail):
3308         (JSC::Machine::cti_op_instanceof):
3309         (JSC::Machine::cti_op_del_by_id):
3310         (JSC::Machine::cti_op_mul):
3311         (JSC::Machine::cti_op_new_func):
3312         (JSC::Machine::cti_op_call_JSFunction):
3313         (JSC::Machine::cti_vm_compile):
3314         (JSC::Machine::cti_op_push_activation):
3315         (JSC::Machine::cti_op_call_NotJSFunction):
3316         (JSC::Machine::cti_op_create_arguments):
3317         (JSC::Machine::cti_op_tear_off_activation):
3318         (JSC::Machine::cti_op_tear_off_arguments):
3319         (JSC::Machine::cti_op_ret_profiler):
3320         (JSC::Machine::cti_op_ret_scopeChain):
3321         (JSC::Machine::cti_op_new_array):
3322         (JSC::Machine::cti_op_resolve):
3323         (JSC::Machine::cti_op_construct_JSConstruct):
3324         (JSC::Machine::cti_op_construct_NotJSConstruct):
3325         (JSC::Machine::cti_op_get_by_val):
3326         (JSC::Machine::cti_op_resolve_func):
3327         (JSC::Machine::cti_op_sub):
3328         (JSC::Machine::cti_op_put_by_val):
3329         (JSC::Machine::cti_op_put_by_val_array):
3330         (JSC::Machine::cti_op_lesseq):
3331         (JSC::Machine::cti_op_loop_if_true):
3332         (JSC::Machine::cti_op_negate):
3333         (JSC::Machine::cti_op_resolve_base):
3334         (JSC::Machine::cti_op_resolve_skip):
3335         (JSC::Machine::cti_op_resolve_global):
3336         (JSC::Machine::cti_op_div):
3337         (JSC::Machine::cti_op_pre_dec):
3338         (JSC::Machine::cti_op_jless):
3339         (JSC::Machine::cti_op_not):
3340         (JSC::Machine::cti_op_jtrue):
3341         (JSC::Machine::cti_op_post_inc):
3342         (JSC::Machine::cti_op_eq):
3343         (JSC::Machine::cti_op_lshift):
3344         (JSC::Machine::cti_op_bitand):
3345         (JSC::Machine::cti_op_rshift):
3346         (JSC::Machine::cti_op_bitnot):
3347         (JSC::Machine::cti_op_resolve_with_base):
3348         (JSC::Machine::cti_op_new_func_exp):
3349         (JSC::Machine::cti_op_mod):
3350         (JSC::Machine::cti_op_less):
3351         (JSC::Machine::cti_op_neq):
3352         (JSC::Machine::cti_op_post_dec):
3353         (JSC::Machine::cti_op_urshift):
3354         (JSC::Machine::cti_op_bitxor):
3355         (JSC::Machine::cti_op_new_regexp):
3356         (JSC::Machine::cti_op_bitor):
3357         (JSC::Machine::cti_op_call_eval):
3358         (JSC::Machine::cti_op_throw):
3359         (JSC::Machine::cti_op_get_pnames):
3360         (JSC::Machine::cti_op_next_pname):
3361         (JSC::Machine::cti_op_push_scope):
3362         (JSC::Machine::cti_op_pop_scope):
3363         (JSC::Machine::cti_op_typeof):
3364         (JSC::Machine::cti_op_is_undefined):
3365         (JSC::Machine::cti_op_is_boolean):
3366         (JSC::Machine::cti_op_is_number):
3367         (JSC::Machine::cti_op_is_string):
3368         (JSC::Machine::cti_op_is_object):
3369         (JSC::Machine::cti_op_is_function):
3370         (JSC::Machine::cti_op_stricteq):
3371         (JSC::Machine::cti_op_nstricteq):
3372         (JSC::Machine::cti_op_to_jsnumber):
3373         (JSC::Machine::cti_op_in):
3374         (JSC::Machine::cti_op_push_new_scope):
3375         (JSC::Machine::cti_op_jmp_scopes):
3376         (JSC::Machine::cti_op_put_by_index):
3377         (JSC::Machine::cti_op_switch_imm):
3378         (JSC::Machine::cti_op_switch_char):
3379         (JSC::Machine::cti_op_switch_string):
3380         (JSC::Machine::cti_op_del_by_val):
3381         (JSC::Machine::cti_op_put_getter):
3382         (JSC::Machine::cti_op_put_setter):
3383         (JSC::Machine::cti_op_new_error):
3384         (JSC::Machine::cti_op_debug):
3385         (JSC::Machine::cti_vm_throw):
3386         * VM/Machine.h:
3387         * masm/X86Assembler.h:
3388         (JSC::X86Assembler::emitRestoreArgumentReference):
3389         (JSC::X86Assembler::emitRestoreArgumentReferenceForTrampoline):
3390         * wtf/Platform.h:
3391
3392 2008-10-14  Alexey Proskuryakov  <ap@webkit.org>
3393
3394         Reviewed by Darin Adler.
3395
3396         https://bugs.webkit.org/show_bug.cgi?id=20256
3397         Array.push and other standard methods disappear
3398
3399         * kjs/JSGlobalData.cpp:
3400         (JSC::JSGlobalData::JSGlobalData):
3401         (JSC::JSGlobalData::~JSGlobalData):
3402         Don't use static hash tables even on platforms that don't enable JSC_MULTIPLE_THREADS -
3403         these tables reference IdentifierTable, which is always per-GlobalData.
3404
3405 2008-10-14  Maciej Stachowiak  <mjs@apple.com>
3406
3407         Reviewed by Cameron Zwarich.
3408         
3409         - always use CTI_ARGUMENTS and CTI_ARGUMENTS_FASTCALL
3410         
3411         This is a small regression for GCC 4.0, but simplifies the code
3412         for future improvements and lets us focus on GCC 4.2+ and MSVC.
3413
3414         * VM/CTI.cpp:
3415         * VM/CTI.h:
3416         * VM/Machine.cpp:
3417         (JSC::Machine::cti_op_convert_this):
3418         (JSC::Machine::cti_op_end):
3419         (JSC::Machine::cti_op_add):
3420         (JSC::Machine::cti_op_pre_inc):
3421         (JSC::Machine::cti_timeout_check):
3422         (JSC::Machine::cti_register_file_check):
3423         (JSC::Machine::cti_op_loop_if_less):
3424         (JSC::Machine::cti_op_loop_if_lesseq):
3425         (JSC::Machine::cti_op_new_object):
3426         (JSC::Machine::cti_op_put_by_id):
3427         (JSC::Machine::cti_op_put_by_id_second):
3428         (JSC::Machine::cti_op_put_by_id_generic):
3429         (JSC::Machine::cti_op_put_by_id_fail):
3430         (JSC::Machine::cti_op_get_by_id):
3431         (JSC::Machine::cti_op_get_by_id_second):
3432         (JSC::Machine::cti_op_get_by_id_generic):
3433         (JSC::Machine::cti_op_get_by_id_fail):
3434         (JSC::Machine::cti_op_instanceof):
3435         (JSC::Machine::cti_op_del_by_id):
3436         (JSC::Machine::cti_op_mul):
3437         (JSC::Machine::cti_op_new_func):
3438         (JSC::Machine::cti_op_call_JSFunction):
3439         (JSC::Machine::cti_vm_compile):
3440         (JSC::Machine::cti_op_push_activation):
3441         (JSC::Machine::cti_op_call_NotJSFunction):
3442         (JSC::Machine::cti_op_create_arguments):
3443         (JSC::Machine::cti_op_tear_off_activation):
3444         (JSC::Machine::cti_op_tear_off_arguments):
3445         (JSC::Machine::cti_op_ret_profiler):
3446         (JSC::Machine::cti_op_ret_scopeChain):
3447         (JSC::Machine::cti_op_new_array):
3448         (JSC::Machine::cti_op_resolve):
3449         (JSC::Machine::cti_op_construct_JSConstruct):
3450         (JSC::Machine::cti_op_construct_NotJSConstruct):
3451         (JSC::Machine::cti_op_get_by_val):
3452         (JSC::Machine::cti_op_resolve_func):
3453         (JSC::Machine::cti_op_sub):
3454         (JSC::Machine::cti_op_put_by_val):
3455         (JSC::Machine::cti_op_put_by_val_array):
3456         (JSC::Machine::cti_op_lesseq):
3457         (JSC::Machine::cti_op_loop_if_true):
3458         (JSC::Machine::cti_op_negate):
3459         (JSC::Machine::cti_op_resolve_base):
3460         (JSC::Machine::cti_op_resolve_skip):
3461         (JSC::Machine::cti_op_resolve_global):
3462         (JSC::Machine::cti_op_div):
3463         (JSC::Machine::cti_op_pre_dec):
3464         (JSC::Machine::cti_op_jless):
3465         (JSC::Machine::cti_op_not):
3466         (JSC::Machine::cti_op_jtrue):
3467         (JSC::Machine::cti_op_post_inc):
3468         (JSC::Machine::cti_op_eq):
3469         (JSC::Machine::cti_op_lshift):
3470         (JSC::Machine::cti_op_bitand):
3471         (JSC::Machine::cti_op_rshift):
3472         (JSC::Machine::cti_op_bitnot):
3473         (JSC::Machine::cti_op_resolve_with_base):
3474         (JSC::Machine::cti_op_new_func_exp):
3475         (JSC::Machine::cti_op_mod):
3476         (JSC::Machine::cti_op_less):
3477         (JSC::Machine::cti_op_neq):
3478         (JSC::Machine::cti_op_post_dec):
3479         (JSC::Machine::cti_op_urshift):
3480         (JSC::Machine::cti_op_bitxor):
3481         (JSC::Machine::cti_op_new_regexp):
3482         (JSC::Machine::cti_op_bitor):
3483         (JSC::Machine::cti_op_call_eval):
3484         (JSC::Machine::cti_op_throw):
3485         (JSC::Machine::cti_op_get_pnames):
3486         (JSC::Machine::cti_op_next_pname):
3487         (JSC::Machine::cti_op_push_scope):
3488         (JSC::Machine::cti_op_pop_scope):
3489         (JSC::Machine::cti_op_typeof):
3490         (JSC::Machine::cti_op_is_undefined):
3491         (JSC::Machine::cti_op_is_boolean):
3492         (JSC::Machine::cti_op_is_number):
3493         (JSC::Machine::cti_op_is_string):
3494         (JSC::Machine::cti_op_is_object):
3495         (JSC::Machine::cti_op_is_function):
3496         (JSC::Machine::cti_op_stricteq):
3497         (JSC::Machine::cti_op_nstricteq):
3498         (JSC::Machine::cti_op_to_jsnumber):
3499         (JSC::Machine::cti_op_in):
3500         (JSC::Machine::cti_op_push_new_scope):
3501         (JSC::Machine::cti_op_jmp_scopes):
3502         (JSC::Machine::cti_op_put_by_index):
3503         (JSC::Machine::cti_op_switch_imm):
3504         (JSC::Machine::cti_op_switch_char):
3505         (JSC::Machine::cti_op_switch_string):
3506         (JSC::Machine::cti_op_del_by_val):
3507         (JSC::Machine::cti_op_put_getter):
3508         (JSC::Machine::cti_op_put_setter):
3509         (JSC::Machine::cti_op_new_error):
3510         (JSC::Machine::cti_op_debug):
3511         (JSC::Machine::cti_vm_throw):
3512         * VM/Machine.h:
3513         * masm/X86Assembler.h:
3514         (JSC::X86Assembler::emitRestoreArgumentReference):
3515         (JSC::X86Assembler::emitRestoreArgumentReferenceForTrampoline):
3516         * wtf/Platform.h:
3517