822523801fecaa18772b29c013cb461003785568
[WebKit-https.git] / JavaScriptCore / ChangeLog
1 2009-05-17  Steve Falkenburg  <sfalken@apple.com>
2
3         Windows build fix
4
5         * JavaScriptCore.vcproj/JavaScriptCore.make:
6         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
7
8 2009-05-15  Gavin Barraclough  <barraclough@apple.com>
9
10         Reviewed by Oliver Hunt.
11
12         Looking like MSVC doesn't like static variables in inline methods?
13         Make the state of the SSE2 check a static variable on the class
14         MacroAssemblerX86Common as a speculative build fix for Windows.
15
16         * assembler/MacroAssemblerX86Common.h:
17         (JSC::MacroAssemblerX86Common::convertInt32ToDouble):
18         (JSC::MacroAssemblerX86Common::branchDouble):
19         (JSC::MacroAssemblerX86Common::branchTruncateDoubleToInt32):
20         (JSC::MacroAssemblerX86Common::isSSE2Present):
21         (JSC::MacroAssemblerX86Common::):
22         * jit/JIT.cpp:
23
24 2009-05-15  Adam Roben  <aroben@apple.com>
25
26         Add some assembler headers to JavaScriptCore.vcproj
27
28         This is just a convenience for Windows developers.
29
30         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
31
32 2009-05-15  Gavin Barraclough  <barraclough@apple.com>
33
34         Reviewed by Oliver Hunt.
35
36         Add FP support to the MacroAssembler, port JITArithmetic over to make use of this. Also add
37         API to determine whether FP support is available 'MacroAssembler::supportsFloatingPoint()',
38         FP is presently only supported on SSE2 platforms, not x87.  On platforms where a suitable
39         hardware FPU is not available 'supportsFloatingPoint()' may simply return false, and all
40         other methods ASSERT_NOT_REACHED().
41
42         * assembler/AbstractMacroAssembler.h:
43         * assembler/MacroAssemblerX86.h:
44         (JSC::MacroAssemblerX86::MacroAssemblerX86):
45         (JSC::MacroAssemblerX86::branch32):
46         (JSC::MacroAssemblerX86::branchPtrWithPatch):
47         (JSC::MacroAssemblerX86::supportsFloatingPoint):
48         * assembler/MacroAssemblerX86Common.h:
49         (JSC::MacroAssemblerX86Common::):
50         (JSC::MacroAssemblerX86Common::loadDouble):
51         (JSC::MacroAssemblerX86Common::storeDouble):
52         (JSC::MacroAssemblerX86Common::addDouble):
53         (JSC::MacroAssemblerX86Common::subDouble):
54         (JSC::MacroAssemblerX86Common::mulDouble):
55         (JSC::MacroAssemblerX86Common::convertInt32ToDouble):
56         (JSC::MacroAssemblerX86Common::branchDouble):
57         (JSC::MacroAssemblerX86Common::branchTruncateDoubleToInt32):
58         (JSC::MacroAssemblerX86Common::branch32):
59         (JSC::MacroAssemblerX86Common::branch16):
60         (JSC::MacroAssemblerX86Common::branchTest32):
61         (JSC::MacroAssemblerX86Common::branchAdd32):
62         (JSC::MacroAssemblerX86Common::branchMul32):
63         (JSC::MacroAssemblerX86Common::branchSub32):
64         (JSC::MacroAssemblerX86Common::set32):
65         (JSC::MacroAssemblerX86Common::setTest32):
66         (JSC::MacroAssemblerX86Common::x86Condition):
67         (JSC::MacroAssemblerX86Common::isSSE2Present):
68         * assembler/MacroAssemblerX86_64.h:
69         (JSC::MacroAssemblerX86_64::movePtrToDouble):
70         (JSC::MacroAssemblerX86_64::moveDoubleToPtr):
71         (JSC::MacroAssemblerX86_64::setPtr):
72         (JSC::MacroAssemblerX86_64::branchPtr):
73         (JSC::MacroAssemblerX86_64::branchTestPtr):
74         (JSC::MacroAssemblerX86_64::branchAddPtr):
75         (JSC::MacroAssemblerX86_64::branchSubPtr):
76         (JSC::MacroAssemblerX86_64::supportsFloatingPoint):
77         * assembler/X86Assembler.h:
78         * jit/JIT.cpp:
79         (JSC::JIT::JIT):
80         * jit/JIT.h:
81         * jit/JITArithmetic.cpp:
82         (JSC::JIT::emit_op_rshift):
83         (JSC::JIT::emitSlow_op_rshift):
84         (JSC::JIT::emitSlow_op_jnless):
85         (JSC::JIT::emitSlow_op_jnlesseq):
86         (JSC::JIT::compileBinaryArithOp):
87         (JSC::JIT::compileBinaryArithOpSlowCase):
88         (JSC::JIT::emit_op_add):
89         (JSC::JIT::emitSlow_op_add):
90         (JSC::JIT::emit_op_mul):
91         (JSC::JIT::emitSlow_op_mul):
92         * jit/JITPropertyAccess.cpp:
93         (JSC::JIT::privateCompilePutByIdTransition):
94
95 2009-05-15  Francisco Tolmasky  <francisco@280north.com>
96
97         BUG 25467: JavaScript debugger should use function.displayName as the function's name in the call stack
98         <https://bugs.webkit.org/show_bug.cgi?id=25467>
99         
100         Reviewed by Adam Roben.
101
102         * JavaScriptCore.exp: Added calculatedFunctionName
103         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: Added calculatedFunctionName
104         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Added calculatedFunctionName
105         * debugger/DebuggerCallFrame.cpp: Added calculatedFunctionName to match existing one in ProfileNode.
106         (JSC::DebuggerCallFrame::calculatedFunctionName):
107         * debugger/DebuggerCallFrame.h: Added calculatedFunctionName to match existing one in ProfileNode.
108
109 2009-05-14  Gavin Barraclough  <barraclough@apple.com>
110
111         Build fix, not reviewed.
112
113         Quick fixes for JIT builds with OPTIMIZE flags disabled.
114
115         * jit/JITCall.cpp:
116         (JSC::JIT::compileOpCall):
117         (JSC::JIT::compileOpCallSlowCase):
118         * jit/JITPropertyAccess.cpp:
119         (JSC::JIT::compilePutByIdHotPath):
120
121 2009-05-14  Steve Falkenburg  <sfalken@apple.com>
122
123         Back out incorrect Windows build fix
124
125         * JavaScriptCore.vcproj/JavaScriptCore.make:
126         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
127
128 2009-05-14  Steve Falkenburg  <sfalken@apple.com>
129
130         Windows build fix
131
132         * JavaScriptCore.vcproj/JavaScriptCore.make:
133         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
134
135 2009-05-14  Adam Roben  <aroben@apple.com>
136
137         Windows jsc build fix
138
139         r43648 modified jsc.vcproj's post-build event not to try to copy files
140         that aren't present. Then r43661 mistakenly un-did that modification.
141         This patch restores the modification from r43648, but puts the code in
142         jscCommon.vsprops (where it should have been added in r43648).
143
144         * JavaScriptCore.vcproj/jsc/jsc.vcproj: Restored empty
145         VCPostBuildEventTool tags.
146         * JavaScriptCore.vcproj/jsc/jscCommon.vsprops: Modified the post-build
147         event command line to match the one in jsc.vcproj from r43648.
148
149 2009-05-14  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
150
151         Reviewed by Darin Adler.
152
153         https://bugs.webkit.org/show_bug.cgi?id=25325
154
155         Make sure pthread_self() is declared before it gets called in Collector.cpp
156
157         * runtime/Collector.cpp: Include pthread.h in most Unix-like platforms
158         (not just for OPENBSD)
159
160 2009-05-14  Mark Rowe  <mrowe@apple.com>
161
162         Reviewed by Oliver Hunt.
163
164         Fix <https://bugs.webkit.org/show_bug.cgi?id=25785>.
165         Bug 25785: Segfault in mark when using JSObjectMakeConstructor
166
167         * API/JSObjectRef.cpp:
168         (JSObjectMakeConstructor): OpaqueJSClass::prototype can return 0.  We need to use the default object prototype when it does.
169         * API/tests/testapi.c:
170         (main): Add a test case.
171         * runtime/JSObject.h:
172         (JSC::JSObject::putDirect): Add a clearer assertion for a null value.  The assertion on the next line does catch this,
173         but the cause of the failure is not clear from the assertion itself.
174
175 2009-05-14  Mark Rowe  <mrowe@apple.com>
176
177         Rubber-stamped by Darin Adler.
178
179         <rdar://problem/6681868> When building with Xcode 3.1.3 should be using gcc 4.2
180
181         The meaning of XCODE_VERSION_ACTUAL is more sensible in newer versions of Xcode.
182         Update our logic to select the compiler version to use the more appropriate XCODE_VERSION_MINOR
183         if the version of Xcode supports it, and fall back to XCODE_VERSION_ACTUAL if not.
184
185         * Configurations/Base.xcconfig:
186
187 2009-05-14  Gavin Barraclough  <barraclough@apple.com>
188
189         Reviewed by Geoff Garen.
190
191         Checking register file bounds should be a ptr comparison (m_end is a Register*).
192         Also, the compare should be unsigned, pointers don'ts go negative.
193
194         * jit/JIT.cpp:
195         (JSC::JIT::privateCompile):
196
197 2009-05-13  Gavin Barraclough  <barraclough@apple.com>
198
199         Reviewed by Oliver Hunt.
200
201         Fix <rdar://problem/6882919> REGRESSION: page at Metroauto site crashes in cti_op_loop_if_less (25730)
202
203         op_loop_if_less (imm < op) was loading op into regT1, but in the slow path spills regT0.
204         This leads to bad happen.
205
206         * jit/JITOpcodes.cpp:
207         (JSC::JIT::emit_op_loop_if_less):
208         (JSC::JIT::emitSlow_op_loop_if_less):
209
210 2009-05-13  Dmitry Titov  <dimich@chromium.org>
211
212         Rubber-stamped by Mark Rowe.
213
214         https://bugs.webkit.org/show_bug.cgi?id=25746
215         Revert http://trac.webkit.org/changeset/43507 which caused crash in PPC nightlies with Safari 4.
216
217         * JavaScriptCore.exp:
218         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
219         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
220         * bytecode/SamplingTool.cpp:
221         (JSC::SamplingThread::start):
222         (JSC::SamplingThread::stop):
223         * bytecode/SamplingTool.h:
224         * wtf/CrossThreadRefCounted.h:
225         (WTF::CrossThreadRefCounted::CrossThreadRefCounted):
226         (WTF::::ref):
227         (WTF::::deref):
228         * wtf/Threading.h:
229         * wtf/ThreadingNone.cpp:
230         * wtf/ThreadingPthreads.cpp:
231         (WTF::threadMapMutex):
232         (WTF::initializeThreading):
233         (WTF::threadMap):
234         (WTF::identifierByPthreadHandle):
235         (WTF::establishIdentifierForPthreadHandle):
236         (WTF::pthreadHandleForIdentifier):
237         (WTF::clearPthreadHandleForIdentifier):
238         (WTF::createThreadInternal):
239         (WTF::waitForThreadCompletion):
240         (WTF::detachThread):
241         (WTF::currentThread):
242         * wtf/ThreadingWin.cpp:
243         (WTF::threadMapMutex):
244         (WTF::initializeThreading):
245         (WTF::threadMap):
246         (WTF::storeThreadHandleByIdentifier):
247         (WTF::threadHandleForIdentifier):
248         (WTF::clearThreadHandleForIdentifier):
249         (WTF::createThreadInternal):
250         (WTF::waitForThreadCompletion):
251         (WTF::detachThread):
252         (WTF::currentThread):
253         * wtf/gtk/ThreadingGtk.cpp:
254         (WTF::threadMapMutex):
255         (WTF::initializeThreading):
256         (WTF::threadMap):
257         (WTF::identifierByGthreadHandle):
258         (WTF::establishIdentifierForThread):
259         (WTF::threadForIdentifier):
260         (WTF::clearThreadForIdentifier):
261         (WTF::createThreadInternal):
262         (WTF::waitForThreadCompletion):
263         (WTF::currentThread):
264         * wtf/qt/ThreadingQt.cpp:
265         (WTF::threadMapMutex):
266         (WTF::threadMap):
267         (WTF::identifierByQthreadHandle):
268         (WTF::establishIdentifierForThread):
269         (WTF::clearThreadForIdentifier):
270         (WTF::threadForIdentifier):
271         (WTF::initializeThreading):
272         (WTF::createThreadInternal):
273         (WTF::waitForThreadCompletion):
274         (WTF::currentThread):
275
276 2009-05-13  Darin Adler  <darin@apple.com>
277
278         Revert the parser arena change. It was a slowdown, not a speedup.
279         Better luck next time (I'll break it up into pieces).
280
281 2009-05-13  Darin Adler  <darin@apple.com>
282
283         Tiger build fix.
284
285         * parser/Grammar.y: Add back empty code blocks, needed by older
286         versions of bison on certain rules.
287
288 2009-05-13  Steve Falkenburg  <sfalken@apple.com>
289
290         Windows build fix.
291
292         * JavaScriptCore.vcproj/jsc/jsc.vcproj:
293
294 2009-05-13  Adam Roben  <aroben@apple.com>
295
296         Windows build fixes after r43642
297
298         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
299         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
300         Updated.
301
302         * debugger/Debugger.cpp:
303         * runtime/ArrayConstructor.cpp:
304         * runtime/JSArray.cpp:
305         * runtime/RegExp.cpp:
306         * runtime/RegExpConstructor.cpp:
307         * runtime/RegExpPrototype.cpp:
308         * runtime/StringPrototype.cpp:
309         Added missing #includes.
310
311 2009-05-13  Darin Adler  <darin@apple.com>
312
313         Reviewed by Cameron Zwarich.
314
315         Bug 25674: syntax tree nodes should use arena allocation
316         https://bugs.webkit.org/show_bug.cgi?id=25674
317
318         Step 3: Add some actual arena allocation. About 1% SunSpider speedup.
319
320         * JavaScriptCore.exp: Updated.
321
322         * bytecompiler/BytecodeGenerator.cpp:
323         (JSC::BytecodeGenerator::BytecodeGenerator): Updated since VarStack
324         contains const Identifier* now.
325         (JSC::BytecodeGenerator::emitPushNewScope): Updated to take a const
326         Identifier&.
327         * bytecompiler/BytecodeGenerator.h: Ditto
328
329         * bytecompiler/SegmentedVector.h: Added isEmpty.
330
331         * debugger/Debugger.cpp:
332         (JSC::Debugger::recompileAllJSFunctions): Moved this function here from
333         WebCore so WebCore doesn't need the details of FunctionBodyNode.
334         * debugger/Debugger.h: Ditto.
335
336         * interpreter/Interpreter.cpp:
337         (JSC::Interpreter::execute): Updated since VarStack contains const
338         Identifier* now.
339
340         * jit/JITStubs.cpp:
341         (JSC::JITStubs::cti_vm_lazyLinkCall): Call isHostFunction on the body
342         rather than on the function object, since we can't easily have inlined
343         access to the FunctionBodyNode in JSFunction.h since WebCore needs
344         access to that header.
345         (JSC::JITStubs::cti_op_construct_JSConstruct): Ditto.
346         * profiler/Profiler.cpp:
347         (JSC::Profiler::createCallIdentifier): Ditto.
348
349         * parser/Grammar.y: Use JSGlobalData* to pass the global data pointer
350         around whenever possible instead of using void*. Changed
351         SET_EXCEPTION_LOCATION from a macro to an inline function. Marked
352         the structure-creating functions inline. Changed the VarStack to use
353         identifier pointers instead of actual identifiers. This takes
354         advantage of the fact that all identifier pointers come from the
355         arena and avoids reference count churn. Changed Identifier* to
356         const Identifier* to make sure we don't modify any by accident.
357         Used identifiers for regular expression strings too, using the new
358         scanRegExp that has out parameters instead of the old one that relied
359         on side effects in the Lexer. Move the creation of numeric identifiers
360         out of this file and into the PropertyNode constructor.
361
362         * parser/Lexer.cpp:
363         (JSC::Lexer::setCode): Pass in ParserArena, used for identifiers.
364         (JSC::Lexer::makeIdentifier): Changed return type to const Identifier*
365         and changed to call ParserArena.
366         (JSC::Lexer::scanRegExp): Added out arguments that are const Identifier*
367         as well as a prefix character argument so we can handle the /= case
368         without a string append.
369         (JSC::Lexer::skipRegExp): Added. Skips a regular expression without
370         allocating Identifier objects.
371         (JSC::Lexer::clear): Removed the code to manage m_identifiers, m_pattern,
372         and m_flags, and added code to set m_arena to 0.
373         * parser/Lexer.h: Updated for changes above.
374
375         * parser/NodeConstructors.h:
376         (JSC::ParserArenaFreeable::operator new): Added. Calls allocateFreeable
377         on the arena.
378         (JSC::ParserArenaDeletable::operator new): Changed to call the
379         allocateDeletable function on the arena instead of deleteWithArena.
380         (JSC::RegExpNode::RegExpNode): Changed arguments to Identifier instead
381         of UString since these come from the parser which makes identifiers.
382         (JSC::PropertyNode::PropertyNode): Added new constructor that makes
383         numeric identifiers. Some day we might want to optimize this for
384         integers so it doesn't create a string for each one.
385         (JSC::ContinueNode::ContinueNode): Initialize m_ident to nullIdentifier
386         since it's now a const Identifier& so it can't be left uninitialized.
387         (JSC::BreakNode::BreakNode): Ditto.
388         (JSC::CaseClauseNode::CaseClauseNode): Updated to use SourceElements*
389         to keep track of the statements rather than a separate statement vector.
390         (JSC::BlockNode::BlockNode): Ditto.
391         (JSC::ForInNode::ForInNode): Initialize m_ident to nullIdentifier.
392
393         * parser/Nodes.cpp: Moved the comment explaining emitBytecode in here.
394         It seemed strangely out of place in the header.
395         (JSC::ThrowableExpressionData::emitThrowError): Added an overload for
396         UString as well as Identifier.
397         (JSC::SourceElements::singleStatement): Added.
398         (JSC::SourceElements::lastStatement): Added.
399         (JSC::RegExpNode::emitBytecode): Updated since the pattern and flags
400         are now Identifier instead of UString. Also changed the throwError code
401         to use the substitution mechanism instead of doing a string append.
402         (JSC::SourceElements::emitBytecode): Added. Replaces the old
403         statementListEmitCode function, since we now keep the SourceElements
404         objects around.
405         (JSC::BlockNode::lastStatement): Added.
406         (JSC::BlockNode::emitBytecode): Changed to use emitBytecode instead of
407         statementListEmitCode.
408         (JSC::CaseClauseNode::emitBytecode): Added.
409         (JSC::CaseBlockNode::emitBytecodeForBlock): Changed to use emitBytecode
410         instead of statementListEmitCode.
411         (JSC::ScopeNodeData::ScopeNodeData): Changed to store the
412         SourceElements* instead of using releaseContentsIntoVector.
413         (JSC::ScopeNode::emitStatementsBytecode): Added.
414         (JSC::ScopeNode::singleStatement): Added.
415         (JSC::ProgramNode::emitBytecode): Call emitStatementsBytecode instead
416         of statementListEmitCode.
417         (JSC::EvalNode::emitBytecode): Ditto.
418         (JSC::EvalNode::generateBytecode): Removed code to clear the children
419         vector. This optimization is no longer possible since everything is in
420         a single arena.
421         (JSC::FunctionBodyNode::emitBytecode): Call emitStatementsBytecode
422         insetad of statementListEmitCode and check for the return node using
423         the new functions.
424
425         * parser/Nodes.h: Changed VarStack to store const Identifier* instead
426         of Identifier and rely on the arena to control lifetime. Added a new
427         ParserArenaFreeable class. Made ParserArenaDeletable inherit from
428         FastAllocBase instead of having its own operator new. Base the Node
429         class on ParserArenaFreeable. Changed the various Node classes
430         to use const Identifier& instead of Identifier to avoid the need to
431         call their destructors and allow them to function as "freeable" in the
432         arena. Removed extraneous JSC_FAST_CALL on definitions of inline functions.
433         Changed ElementNode, PropertyNode, ArgumentsNode, ParameterNode,
434         CaseClauseNode, ClauseListNode, and CaseBlockNode to use ParserArenaFreeable
435         as a base class since they do not descend from Node. Eliminated the
436         StatementVector type and instead have various classes use SourceElements*
437         instead of StatementVector. This prevents those classes from having th
438         use ParserArenaDeletable to make sure the vector destructor is called.
439
440         * parser/Parser.cpp:
441         (JSC::Parser::parse): Pass the arena to the lexer.
442
443         * parser/Parser.h: Added an include of ParserArena.h, which is no longer
444         included by Nodes.h.
445
446         * parser/ParserArena.cpp:
447         (JSC::ParserArena::ParserArena): Added. Initializes the new members,
448         m_freeableMemory, m_freeablePoolEnd, and m_identifiers.
449         (JSC::ParserArena::freeablePool): Added. Computes the pool pointer,
450         since we store only the current pointer and the end of pool pointer.
451         (JSC::ParserArena::deallocateObjects): Added. Contains the common
452         memory-deallocation logic used by both the destructor and the
453         reset function.
454         (JSC::ParserArena::~ParserArena): Changed to call deallocateObjects.
455         (JSC::ParserArena::reset): Ditto. Also added code to zero out the
456         new structures, and switched to use clear() instead of shrink(0) since
457         we don't really reuse arenas.
458         (JSC::ParserArena::makeNumericIdentifier): Added.
459         (JSC::ParserArena::allocateFreeablePool): Added. Used when the pool
460         is empty.
461         (JSC::ParserArena::isEmpty): Added. No longer inline, which is fine
462         since this is used only for assertions at the moment.
463
464         * parser/ParserArena.h: Added an actual arena of "freeable" objects,
465         ones that don't need destructors to be called. Also added the segmented
466         vector of identifiers that used to be in the Lexer.
467
468         * runtime/FunctionConstructor.cpp:
469         (JSC::extractFunctionBody): Use singleStatement function rather than
470         getting at a StatementVector.
471
472         * runtime/FunctionPrototype.cpp:
473         (JSC::functionProtoFuncToString): Call isHostFunction on the body
474         rather than the function object.
475
476         * runtime/JSFunction.cpp:
477         (JSC::JSFunction::JSFunction): Moved the structure version of this in
478         here from the header. It's not hot enough that it needs to be inlined.
479         (JSC::JSFunction::isHostFunction): Moved this in here from the header.
480         It's now a helper to be used only within the class.
481         (JSC::JSFunction::setBody): Moved this in here. It's not hot enough that
482         it needs to be inlined, and we want to be able to compile the header
483         without the definition of FunctionBodyNode.
484
485         * runtime/JSFunction.h: Eliminated the include of "Nodes.h". This was
486         exposing too much JavaScriptCore dependency to WebCore. Because of this
487         change and some changes made to WebCore, we could now export a lot fewer
488         headers from JavaScriptCore, but I have not done that yet in this check-in.
489         Made a couple functions non-inline. Removes some isHostFunction() assertions.
490         
491         * wtf/FastAllocBase.h: Added the conventional using statements we use in
492         WTF so we can use identifiers from the WTF namespace without explicit
493         namespace qualification or namespace directive. This is the usual WTF style,
494         although it's unconventional in the C++ world. We use the namespace primarily
495         for link-time disambiguation, not compile-time.
496
497         * wtf/FastMalloc.cpp: Fixed an incorrect comment.
498
499 2009-05-13  Xan Lopez  <xlopez@igalia.com>
500
501         Unreviewed build fix: add JITStubCall.h to files list.
502
503         * GNUmakefile.am:
504
505 2009-05-13  Ariya Hidayat  <ariya.hidayat@nokia.com>
506
507         Unreviewed build fix, as suggested by Yael Aharon <yael.aharon@nokia.com>.
508
509         * wtf/qt/ThreadingQt.cpp:
510         (WTF::waitForThreadCompletion): renamed IsValid to isValid.
511
512 2009-05-13  Jan Michael Alonzo  <jmalonzo@webkit.org>
513
514         Revert r43562 - [Gtk] WTF_USE_JSC is already defined in
515         WebCore/config.h.
516
517         * wtf/Platform.h:
518
519 2009-05-12  Gavin Barraclough  <barraclough@apple.com>
520
521         Reviewed by Oliver Hunt.
522
523         Add SamplingCounter tool to provide a simple mechanism for counting events in JSC
524         (enabled using ENABLE(SAMPLING_COUNTERS)).  To count events within a single function
525         use the class 'SamplingCounter', where the counter may be incremented from multiple
526         functions 'GlobalSamplingCounter' may be convenient; all other counters (stack or
527         heap allocated, rather than statically declared) should use the DeletableSamplingCounter.
528         Further description of these classes is provided alongside their definition in 
529         SamplingTool.h.
530
531         Counters may be incremented from c++ by calling the 'count()' method on the counter,
532         or may be incremented by JIT code by using the 'emitCount()' method within the JIT.
533
534         This patch also fixes CODEBLOCK_SAMPLING, which was missing a null pointer check.
535
536         * JavaScriptCore.exp:
537         * assembler/MacroAssemblerX86.h:
538         (JSC::MacroAssemblerX86::addWithCarry32):
539         (JSC::MacroAssemblerX86::and32):
540         (JSC::MacroAssemblerX86::or32):
541         * assembler/MacroAssemblerX86Common.h:
542         (JSC::MacroAssemblerX86Common::and32):
543         (JSC::MacroAssemblerX86Common::or32):
544         * assembler/MacroAssemblerX86_64.h:
545         (JSC::MacroAssemblerX86_64::and32):
546         (JSC::MacroAssemblerX86_64::or32):
547         (JSC::MacroAssemblerX86_64::addPtr):
548         * assembler/X86Assembler.h:
549         (JSC::X86Assembler::):
550         (JSC::X86Assembler::adcl_im):
551         (JSC::X86Assembler::addq_im):
552         (JSC::X86Assembler::andl_im):
553         (JSC::X86Assembler::orl_im):
554         * bytecode/SamplingTool.cpp:
555         (JSC::AbstractSamplingCounter::dump):
556         * bytecode/SamplingTool.h:
557         (JSC::AbstractSamplingCounter::count):
558         (JSC::GlobalSamplingCounter::name):
559         (JSC::SamplingCounter::SamplingCounter):
560         * jit/JIT.h:
561         * jit/JITCall.cpp:
562         (JSC::):
563         * jit/JITInlineMethods.h:
564         (JSC::JIT::setSamplingFlag):
565         (JSC::JIT::clearSamplingFlag):
566         (JSC::JIT::emitCount):
567         * jsc.cpp:
568         (runWithScripts):
569         * parser/Nodes.cpp:
570         (JSC::ScopeNode::ScopeNode):
571         * wtf/Platform.h:
572
573 2009-05-13  Steve Falkenburg  <sfalken@apple.com>
574
575         Windows build fix.
576
577         * JavaScriptCore.vcproj/JavaScriptCore.make:
578
579 2009-05-12  Steve Falkenburg  <sfalken@apple.com>
580
581         Windows build fix.
582
583         * JavaScriptCore.vcproj/JavaScriptCore.make:
584
585 2009-05-12  Oliver Hunt  <oliver@apple.com>
586
587         Reviewed by Gavin Barraclough.
588
589         <rdar://problem/6881457> Crash occurs at JSC::Interpreter::execute() when loading http://www.sears.com
590
591         We created the arguments objects before an op_push_scope but not
592         before op_push_new_scope, this meant a null arguments object could
593         be resolved inside catch blocks.
594
595         * bytecompiler/BytecodeGenerator.cpp:
596         (JSC::BytecodeGenerator::emitPushNewScope):
597
598 2009-05-12  Oliver Hunt  <oliver@apple.com>
599
600         Reviewed by Gavin Barraclough.
601
602         <rdar://problem/6879881> Crash occurs at JSC::JSActivation::mark() when loading http://www.monster.com; http://www.cnet.com
603         <https://bugs.webkit.org/show_bug.cgi?id=25736> Crash loading www.google.dk/ig (and other igoogle's as well)
604
605         Following on from the lazy arguments creation patch, it's now
606         possible for an activation to to have a null register in the callframe
607         so we can't just blindly mark the local registers in an activation,
608         and must null check first instead.
609
610         * API/tests/testapi.c:
611         (functionGC):
612         * API/tests/testapi.js:
613         (bludgeonArguments.return.g):
614         (bludgeonArguments):
615         * runtime/JSActivation.cpp:
616         (JSC::JSActivation::mark):
617
618 2009-05-12  Gavin Barraclough  <barraclough@apple.com>
619
620         Rubber stamped by Geoff Garen.
621
622         WTF_USE_CTI_REPATCH_PIC is no longer used, remove.
623
624         * jit/JIT.h:
625         * jit/JITStubCall.h:
626
627 2009-05-12  Gavin Barraclough  <barraclough@apple.com>
628
629         Reviewed by Maciej Stachowiak.
630
631         We've run into some problems where changing the size of the class JIT leads to
632         performance fluctuations.  Try forcing alignment in an attempt to stabalize this.
633
634         * jit/JIT.h:
635
636 2009-05-12  Kevin Ollivier  <kevino@theolliviers.com>
637
638         wx build fix. Add ParserArena.cpp to the build.
639
640         * JavaScriptCoreSources.bkl:
641
642 2009-05-12  Oliver Hunt  <oliver@apple.com>
643
644         Reviewed by Geoff Garen.
645
646         Unsigned underflow on 64bit cannot be treated as a negative number
647
648         This code included some placeswhere we deliberately create negative offsets
649         from unsigned values, on 32bit this is "safe", but in 64bit builds much
650         badness occurs. Solution is to use signed types as nature intended.
651
652         * jit/JITStubs.cpp:
653         (JSC::JITStubs::cti_op_load_varargs):
654
655 2009-05-12  Jan Michael Alonzo  <jmalonzo@webkit.org>
656
657         Reviewed by Holger Freyther.
658
659         [Gtk] Various autotools build refactoring and fixes
660         https://bugs.webkit.org/show_bug.cgi?id=25286
661
662         Define WTF_USE_JSC for the Gtk port.
663
664         * wtf/Platform.h:
665
666 2009-05-12  Maciej Stachowiak  <mjs@apple.com>
667
668         Reviewed by Oliver Hunt.
669         
670         - allow all of strictEqual to be inlined into cti_op_stricteq once again
671         
672         We had this optimization once but accidentally lost it at some point.
673
674         * runtime/Operations.h:
675         (JSC::JSValue::strictEqualSlowCaseInline):
676         (JSC::JSValue::strictEqual):
677
678 2009-05-12  Gavin Barraclough  <barraclough@apple.com>
679
680         Reviewed by Oliver Hunt.
681
682         instanceof should throw if the constructor being tested does not implement
683         'HasInstance" (i.e. is a function).  Instead we were returning false.
684
685         * interpreter/Interpreter.cpp:
686         (JSC::isInvalidParamForIn):
687         (JSC::isInvalidParamForInstanceOf):
688         (JSC::Interpreter::privateExecute):
689         * jit/JITStubs.cpp:
690         (JSC::JITStubs::cti_op_instanceof):
691         * tests/mozilla/ecma_2/instanceof/instanceof-003.js:
692             Fix broken test case.
693         * tests/mozilla/ecma_2/instanceof/regress-7635.js:
694             Remove broken test case (was an exact duplicate of a test in instanceof-003.js).
695
696 2009-05-12  Oliver Hunt  <oliver@apple.com>
697
698         Reviewed by Gavin Barraclough.
699
700         Improve function call forwarding performance
701
702         Make creation of the Arguments object occur lazily, so it
703         is not necessarily created for every function that references
704         it.  Then add logic to Function.apply to allow it to avoid
705         allocating the Arguments object at all.  Helps a lot with
706         the function forwarding/binding logic in jQuery, Prototype,
707         and numerous other JS libraries.
708
709         * bytecode/CodeBlock.cpp:
710         (JSC::CodeBlock::dump):
711         * bytecode/Opcode.h:
712         * bytecompiler/BytecodeGenerator.cpp:
713         (JSC::BytecodeGenerator::BytecodeGenerator):
714         (JSC::BytecodeGenerator::registerFor):
715         (JSC::BytecodeGenerator::willResolveToArguments):
716         (JSC::BytecodeGenerator::uncheckedRegisterForArguments):
717         (JSC::BytecodeGenerator::createArgumentsIfNecessary):
718         (JSC::BytecodeGenerator::emitCallEval):
719         (JSC::BytecodeGenerator::emitPushScope):
720         * bytecompiler/BytecodeGenerator.h:
721         * interpreter/Interpreter.cpp:
722         (JSC::Interpreter::privateExecute):
723         (JSC::Interpreter::retrieveArguments):
724         * jit/JIT.cpp:
725         (JSC::JIT::privateCompileMainPass):
726         * jit/JIT.h:
727         * jit/JITOpcodes.cpp:
728         (JSC::JIT::emit_op_create_arguments):
729         (JSC::JIT::emit_op_init_arguments):
730         * jit/JITStubs.cpp:
731         (JSC::JITStubs::cti_op_tear_off_arguments):
732         (JSC::JITStubs::cti_op_load_varargs):
733         * parser/Nodes.cpp:
734         (JSC::ApplyFunctionCallDotNode::emitBytecode):
735
736 2009-05-11  Gavin Barraclough  <barraclough@apple.com>
737
738         Reviewed by Oliver Hunt.
739
740         Enable use of SamplingFlags directly from JIT code.
741
742         * bytecode/SamplingTool.h:
743         * jit/JIT.h:
744         (JSC::JIT::sampleCodeBlock):
745         (JSC::JIT::sampleInstruction):
746         * jit/JITInlineMethods.h:
747         (JSC::JIT::setSamplingFlag):
748         (JSC::JIT::clearSamplingFlag):
749
750 2009-05-11  Gavin Barraclough  <barraclough@apple.com>
751
752         Reviewed by Cameron Zwarich.
753
754         Implement JIT generation for instanceof for non-objects (always returns false).
755         Also fixes the sequencing of the prototype and value isObject checks, to no match the spec.
756
757         0.5% progression on v8 tests overall, due to 3.5% on early-boyer.
758
759         * jit/JIT.cpp:
760         (JSC::JIT::privateCompileMainPass):
761         (JSC::JIT::privateCompileSlowCases):
762         * runtime/JSObject.cpp:
763         (JSC::JSObject::hasInstance):
764         * runtime/TypeInfo.h:
765         (JSC::TypeInfo::TypeInfo):
766
767 2009-05-11  Geoffrey Garen  <ggaren@apple.com>
768
769         Reviewed by Sam Weinig.
770         
771         A little more JIT refactoring.
772         
773         Rearranged code to more clearly indicate what's conditionally compiled
774         and why. Now, all shared code is at the top of our JIT files, and all
775         #if'd code is at the bottom. #if'd code is delineated by large comments.
776         
777         Moved functions that relate to the JIT but don't explicitly do codegen
778         into JIT.cpp. Refactored SSE2 check to store its result as a data member
779         in the JIT.
780
781         * jit/JIT.cpp:
782         (JSC::isSSE2Present):
783         (JSC::JIT::JIT):
784         (JSC::JIT::unlinkCall):
785         (JSC::JIT::linkCall):
786         * jit/JIT.h:
787         (JSC::JIT::isSSE2Present):
788         * jit/JITArithmetic.cpp:
789         (JSC::JIT::emit_op_mod):
790         (JSC::JIT::emitSlow_op_mod):
791         * jit/JITCall.cpp:
792         (JSC::JIT::compileOpCallVarargs):
793         (JSC::JIT::compileOpCallVarargsSlowCase):
794
795 2009-05-11  Holger Hans Peter Freyther  <zecke@selfish.org>
796
797         Build fix.
798
799         * JavaScriptCore.pri: Build the new JITOpcodes.cpp
800
801 2009-05-11  Sam Weinig  <sam@webkit.org>
802
803         Reviewed by Geoffrey Garen.
804
805         More re-factoring of JIT code generation.  Use a macro to
806         forward the main switch-statement cases to the helper functions.
807
808         * jit/JIT.cpp:
809         (JSC::JIT::privateCompileMainPass):
810         (JSC::JIT::privateCompileSlowCases):
811
812 2009-05-11  Sam Weinig  <sam@webkit.org>
813
814         Reviewed by Geoffrey Garen.
815
816         More re-factoring of JIT code generation to move opcode generation
817         to helper functions outside the main switch-statement and gave those
818         helper functions standardized names. This patch covers the remaining
819         slow cases.
820
821         * jit/JIT.cpp:
822         * jit/JIT.h:
823         * jit/JITOpcodes.cpp:
824
825 2009-05-11  Geoffrey Garen  <ggaren@apple.com>
826
827         Build fix.
828
829         * GNUmakefile.am: Added JITOpcodes.cpp and JITStubCall.h to the project.
830
831 2009-05-11  Geoffrey Garen  <ggaren@apple.com>
832
833         Build fix.
834
835         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Added
836         JITOpcodes.cpp and JITStubCall.h to the project.
837
838 2009-05-11  Geoffrey Garen  <ggaren@apple.com>
839
840         Reviewed by Sam Weinig.
841         
842         Some JIT refactoring.
843         
844         Moved JITStubCall* into its own header.
845         
846         Modified JITStubCall to ASSERT that its return value is handled correctly.
847         Also, replaced function template with explicit instantiations to resolve
848         some confusion.
849         
850         Replaced all uses of emit{Get,Put}CTIArgument with explicit peeks, pokes,
851         and calls to killLastResultRegister().
852
853         * JavaScriptCore.xcodeproj/project.pbxproj:
854         * jit/JIT.cpp:
855         (JSC::JIT::privateCompileMainPass):
856         (JSC::JIT::privateCompile):
857         * jit/JIT.h:
858         * jit/JITArithmetic.cpp:
859         * jit/JITCall.cpp:
860         * jit/JITInlineMethods.h:
861         (JSC::JIT::restoreArgumentReference):
862         * jit/JITPropertyAccess.cpp:
863         * jit/JITStubCall.h: Copied from jit/JIT.h.
864         (JSC::JITStubCall::JITStubCall):
865         (JSC::JITStubCall::addArgument):
866         (JSC::JITStubCall::call):
867         (JSC::JITStubCall::):
868
869 2009-05-11  Sam Weinig  <sam@webkit.org>
870
871         Reviewed by Geoffrey Garen.
872
873         Start re-factoring JIT code generation to move opcode generation
874         to helper functions outside the main switch-statement and gave those
875         helper functions standardized names.  This patch only covers the main
876         pass and all the arithmetic opcodes in the slow path.
877
878         * JavaScriptCore.xcodeproj/project.pbxproj:
879         * jit/JIT.cpp:
880         (JSC::JIT::privateCompileMainPass):
881         (JSC::JIT::privateCompileSlowCases):
882         * jit/JIT.h:
883         * jit/JITArithmetic.cpp:
884         * jit/JITOpcodes.cpp: Copied from jit/JIT.cpp.
885         * jit/JITPropertyAccess.cpp:
886
887 2009-05-11  Steve Falkenburg  <sfalken@apple.com>
888
889         Re-add experimental PGO configs.
890         
891         Reviewed by Adam Roben.
892
893         * JavaScriptCore.vcproj/JavaScriptCore.make:
894         * JavaScriptCore.vcproj/JavaScriptCore.sln:
895         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
896         * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln:
897         * JavaScriptCore.vcproj/jsc/jsc.vcproj:
898
899 2009-05-11  Sam Weinig  <sam@webkit.org>
900
901         Reviewed by Geoffrey "1" Garen.
902
903         Rip out the !USE(CTI_REPATCH_PIC) code.  It was untested and unused.
904
905         * jit/JIT.h:
906         (JSC::JIT::compileGetByIdChainList):
907         (JSC::JIT::compileGetByIdChain):
908         (JSC::JIT::compileCTIMachineTrampolines):
909         * jit/JITPropertyAccess.cpp:
910         (JSC::JIT::privateCompileGetByIdProto):
911         (JSC::JIT::privateCompileGetByIdChainList):
912         (JSC::JIT::privateCompileGetByIdChain):
913         * jit/JITStubs.cpp:
914         (JSC::JITStubs::tryCachePutByID):
915         (JSC::JITStubs::tryCacheGetByID):
916
917 2009-05-11  Dmitry Titov  <dimich@chromium.org>
918
919         GTK build fix - the deprecated waitForThreadCompletion is not needed on GTK.
920
921         * wtf/ThreadingPthreads.cpp: used #ifdef PLATFORM(DARWIN) around waitForThreadCompletion().
922
923 2009-05-11  Adam Roben  <aroben@apple.com>
924
925         Build fix for newer versions of GCC
926
927         * wtf/ThreadingPthreads.cpp: Added a declaration of
928         waitForThreadCompletion before its definition to silence a warning.
929
930 2009-05-11  Dmitry Titov  <dimich@chromium.org>
931
932         Reviewed by Alexey Proskuryakov and Adam Roben.
933
934         https://bugs.webkit.org/show_bug.cgi?id=25348
935         Change WTF::ThreadIdentifier to be an actual (but wrapped) thread id, remove ThreadMap.
936
937         * wtf/Threading.h:
938         (WTF::ThreadIdentifier::ThreadIdentifier):
939         (WTF::ThreadIdentifier::isValid):
940         (WTF::ThreadIdentifier::invalidate):
941         (WTF::ThreadIdentifier::platformId):
942         ThreadIdentifier is now a class, containing a PlatformThreadIdentifier and
943         methods that are used across the code on thread ids: construction, comparisons,
944         check for 'valid' state etc. '0' is used as invalid id, which happens to just work
945         with all platform-specific thread id implementations.
946
947         All the following files repeatedly reflect the new ThreadIdentifier for each platform.
948         We remove ThreadMap and threadMapMutex from all of them, remove the functions that
949         populated/searched/cleared the map and add platform-specific comparison operators
950         for ThreadIdentifier.
951
952         There are specific temporary workarounds for Safari 4 beta on OSX and Win32 since the
953         public build uses WTF threading functions with old type of ThreadingIdentifier.
954         The next time Safari 4 is rebuilt, it will 'automatically' pick up the new type and new
955         functions so the deprecated ones can be removed.
956
957         * wtf/gtk/ThreadingGtk.cpp:
958         (WTF::ThreadIdentifier::operator==):
959         (WTF::ThreadIdentifier::operator!=):
960         (WTF::initializeThreading):
961         (WTF::createThreadInternal):
962         (WTF::waitForThreadCompletion):
963         (WTF::currentThread):
964
965         * wtf/ThreadingNone.cpp:
966         (WTF::ThreadIdentifier::operator==):
967         (WTF::ThreadIdentifier::operator!=):
968
969         * wtf/ThreadingPthreads.cpp:
970         (WTF::ThreadIdentifier::operator==):
971         (WTF::ThreadIdentifier::operator!=):
972         (WTF::initializeThreading):
973         (WTF::createThreadInternal):
974         (WTF::waitForThreadCompletion):
975         (WTF::detachThread):
976         (WTF::currentThread):
977         (WTF::waitForThreadCompletion): This is a workaround for Safari 4 beta on Mac.
978         Safari 4 is linked against old definition of ThreadIdentifier so it treats it as uint32_t.
979         This 'old' variant of waitForThreadCompletion takes uint32_t and has the old decorated name, so Safari can
980         load it from JavaScriptCore library. The other functions (CurrentThread() etc) happen to match their previous
981         decorated names and, while they return pthread_t now, it is a pointer which round-trips through a uint32_t.
982         This function will be removed as soon as Safari 4 will release next public build.
983
984         * wtf/qt/ThreadingQt.cpp:
985         (WTF::ThreadIdentifier::operator==):
986         (WTF::ThreadIdentifier::operator!=):
987         (WTF::initializeThreading):
988         (WTF::createThreadInternal):
989         (WTF::waitForThreadCompletion):
990         (WTF::currentThread):
991
992         * wtf/ThreadingWin.cpp:
993         (WTF::ThreadIdentifier::operator==):
994         (WTF::ThreadIdentifier::operator!=):
995         (WTF::initializeThreading):
996         (WTF::createThreadInternal): All the platforms (except Windows) used a sequential
997         counter as a thread ID and mapped it into platform ID. Windows was using native thread
998         id and mapped it into thread handle. Since we can always obtain a thread handle
999         by thread id, createThread now closes the handle.
1000         (WTF::waitForThreadCompletion): obtains another one using OpenThread(id) API. If can not obtain a handle,
1001         it means the thread already exited.
1002         (WTF::detachThread):
1003         (WTF::currentThread):
1004         (WTF::detachThreadDeprecated): old function, renamed (for Win Safari 4 beta which uses it for now).
1005         (WTF::waitForThreadCompletionDeprecated): same.
1006         (WTF::currentThreadDeprecated): same.
1007         (WTF::createThreadDeprecated): same.
1008
1009         * bytecode/SamplingTool.h:
1010         * bytecode/SamplingTool.cpp: Use DEFINE_STATIC_LOCAL for a static ThreadIdentifier variable, to avoid static constructor.
1011
1012         * JavaScriptCore.exp: export lists - updated decorated names of the WTF threading functions
1013         since they now take a different type as a parameter.
1014         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: ditto for Windows, plus added "deprecated" functions
1015         that take old parameter type - turns out public beta of Safari 4 uses those, so they need to be kept along for a while.
1016         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: ditto.
1017
1018 2009-05-11  Darin Adler  <darin@apple.com>
1019
1020         Reviewed by Oliver Hunt.
1021
1022         Bug 25560: REGRESSION (r34821): "string value".__proto__ gets the wrong object.
1023         https://bugs.webkit.org/show_bug.cgi?id=25560
1024         rdar://problem/6861069
1025
1026         I missed this case back a year ago when I sped up handling
1027         of JavaScript wrappers. Easy to fix.
1028
1029         * runtime/JSObject.h:
1030         (JSC::JSValue::get): Return the prototype itself if the property name
1031         is __proto__.
1032         * runtime/JSString.cpp:
1033         (JSC::JSString::getOwnPropertySlot): Ditto.
1034
1035 2009-05-09  Oliver Hunt  <oliver@apple.com>
1036
1037         Reviewed by Maciej Stachowiak.
1038
1039         Rename emitGetFromCallFrameHeader to emitGetFromCallFrameHeaderPtr
1040
1041         * jit/JIT.cpp:
1042         (JSC::JIT::privateCompileMainPass):
1043         (JSC::JIT::privateCompileCTIMachineTrampolines):
1044         * jit/JIT.h:
1045         * jit/JITInlineMethods.h:
1046         (JSC::JIT::emitGetFromCallFrameHeaderPtr):
1047         (JSC::JIT::emitGetFromCallFrameHeader32):
1048
1049 2009-05-11  Holger Hans Peter Freyther  <zecke@selfish.org>
1050
1051         Unreviewed build fix. Build ParserAreana.cpp for Qt
1052
1053         * JavaScriptCore.pri:
1054
1055 2009-05-11  Norbert Leser  <norbert.leser@nokia.com>
1056
1057         Reviewed by Darin Adler.
1058
1059         https://bugs.webkit.org/show_bug.cgi?id=24536
1060
1061         Symbian compilers cannot resolve WTF::PassRefPtr<JSC::Profile>
1062         unless Profile.h is included.
1063
1064         * profiler/ProfileGenerator.h:
1065
1066 2009-05-11  Csaba Osztrogonac  <oszi@inf.u-szeged.hu>
1067
1068         Reviewed by Holger Freyther.
1069
1070         https://bugs.webkit.org/show_bug.cgi?id=24284
1071
1072         * JavaScriptCore.pri: coding style modified
1073         * jsc.pro: duplicated values removed from INCLUDEPATH, DEFINES
1074
1075 2009-05-11  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
1076
1077         Reviewed by NOBODY (build fix).
1078
1079         Also add ParserArena, in addition to AllInOne, for release builds,
1080         since adding it to AllInOne breaks Mac.
1081
1082         * GNUmakefile.am:
1083
1084 2009-05-11  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
1085
1086         Unreviewed build fix. Adding ParserArena to the autotools build.
1087
1088         * GNUmakefile.am:
1089
1090 2009-05-11  Adam Roben  <aroben@apple.com>
1091
1092         More Windows build fixes after r43479
1093
1094         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1095         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
1096         Export ParserArena::reset.
1097
1098 2009-05-11  Adam Roben  <aroben@apple.com>
1099
1100         Windows build fixes after r43479
1101
1102         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Added
1103         ParserArena to the project.
1104
1105         * parser/NodeConstructors.h: Added a missing include.
1106         (JSC::ParserArenaDeletable::operator new): Marked these as inline.
1107
1108 2009-05-10  Maciej Stachowiak  <mjs@apple.com>
1109
1110         Reviewed by Geoff Garen.
1111         
1112         - fixed REGRESSION(r43432): Many JavaScriptCore tests crash in 64-bit
1113         https://bugs.webkit.org/show_bug.cgi?id=25680
1114
1115         Accound for the 64-bit instruction prefix when rewriting mov to lea on 64-bit.
1116         
1117         * jit/JIT.h:
1118         * jit/JITPropertyAccess.cpp:
1119         (JSC::JIT::patchGetByIdSelf):
1120         (JSC::JIT::patchPutByIdReplace):
1121
1122 2009-05-10  Darin Adler  <darin@apple.com>
1123
1124         Reviewed by Cameron Zwarich.
1125
1126         Bug 25674: syntax tree nodes should use arena allocation
1127         https://bugs.webkit.org/show_bug.cgi?id=25674
1128
1129         Part two: Remove reference counting from most nodes.
1130
1131         * JavaScriptCore.exp: Updated.
1132
1133         * JavaScriptCore.xcodeproj/project.pbxproj: Added ParserArena.h and .cpp.
1134
1135         * parser/Grammar.y: Replaced uses of ParserRefCountedData with uses of
1136         ParserArenaData. Took out now-nonfunctional code that tries to manually
1137         release declaration list. Changed the new calls that create FuncDeclNode
1138         and FuncExprNode so that they use the proper version of operator new for
1139         the reference-counted idiom, not the deletion idiom.
1140
1141         * parser/NodeConstructors.h:
1142         (JSC::ParserArenaDeletable::operator new): Added.
1143         (JSC::ParserArenaRefCounted::ParserArenaRefCounted): Added.
1144         (JSC::Node::Node): Removed ParserRefCounted initializer.
1145         (JSC::ElementNode::ElementNode): Ditto.
1146         (JSC::PropertyNode::PropertyNode): Ditto.
1147         (JSC::ArgumentsNode::ArgumentsNode): Ditto.
1148         (JSC::SourceElements::SourceElements): Ditto.
1149         (JSC::ParameterNode::ParameterNode): Ditto.
1150         (JSC::FuncExprNode::FuncExprNode): Added ParserArenaRefCounted initializer.
1151         (JSC::FuncDeclNode::FuncDeclNode): Ditto.
1152         (JSC::CaseClauseNode::CaseClauseNode): Removed ParserRefCounted initializer.
1153         (JSC::ClauseListNode::ClauseListNode): Ditto.
1154         (JSC::CaseBlockNode::CaseBlockNode): Ditto.
1155
1156         * parser/NodeInfo.h: Replaced uses of ParserRefCountedData with uses of
1157         ParserArenaData.
1158
1159         * parser/Nodes.cpp:
1160         (JSC::ScopeNode::ScopeNode): Added ParserArenaRefCounted initializer.
1161         (JSC::ProgramNode::create): Use the proper version of operator new for
1162         the reference-counted idiom, not the deletion idiom. Use the arena
1163         contains function instead of the vecctor find function.
1164         (JSC::EvalNode::create): Use the proper version of operator new for
1165         the reference-counted idiom, not the deletion idiom. Use the arena
1166         reset function instead of the vector shrink function.
1167         (JSC::FunctionBodyNode::createNativeThunk): Use the proper version
1168         of operator new for the reference-counted idiom, not the deletion idiom.
1169         (JSC::FunctionBodyNode::create): More of the same.
1170
1171         * parser/Nodes.h: Added ParserArenaDeletable and ParserArenaRefCounted
1172         to replace ParserRefCounted. Fixed inheritance so only the classes that
1173         need reference counting inherit from ParserArenaRefCounted.
1174
1175         * parser/Parser.cpp:
1176         (JSC::Parser::parse): Set m_sourceElements to 0 since it now starts
1177         uninitialized. Just set it to 0 again in the failure case, since it's
1178         now just a raw pointer, not an owning one.
1179         (JSC::Parser::reparseInPlace): Removed now-unneeded get() function.
1180         (JSC::Parser::didFinishParsing): Replaced uses of ParserRefCountedData
1181         with uses of ParserArenaData.
1182
1183         * parser/Parser.h: Less RefPtr, more arena.
1184
1185         * parser/ParserArena.cpp: Added.
1186         * parser/ParserArena.h: Added.
1187
1188         * runtime/JSGlobalData.cpp:
1189         (JSC::JSGlobalData::~JSGlobalData): Removed arena-related code, since it's
1190         now in the Parser.
1191         (JSC::JSGlobalData::createLeaked): Removed unneeded #ifndef.
1192         (JSC::JSGlobalData::createNativeThunk): Tweaked #if a bit.
1193
1194         * runtime/JSGlobalData.h: Removed parserArena, which is now in Parser.
1195
1196         * wtf/RefCounted.h: Added deletionHasBegun function, for use in
1197         assertions to catch deletion not done by the deref function.
1198
1199 2009-05-10  David Kilzer  <ddkilzer@apple.com>
1200
1201         Part 2: Try to fix the Windows build by adding a symbol which is really just a re-mangling of a changed method signature
1202
1203         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1204         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
1205
1206 2009-05-10  David Kilzer  <ddkilzer@apple.com>
1207
1208         Try to fix the Windows build by removing an unknown symbol
1209
1210         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1211         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
1212
1213 2009-05-10  David Kilzer  <ddkilzer@apple.com>
1214
1215         Touch Nodes.cpp to try to fix Windows build
1216
1217         * parser/Nodes.cpp: Removed whitespace.
1218
1219 2009-05-10  Darin Adler  <darin@apple.com>
1220
1221         Reviewed by Maciej Stachowiak.
1222
1223         Quick fix for failures seen on buildbot. Maciej plans a better fix later.
1224
1225         * wtf/dtoa.cpp: Change the hardcoded number of 32-bit words in a BigInt
1226         from 32 to 64. Parsing "1e500", for example, requires more than 32 words.
1227
1228 2009-05-10  Darin Adler  <darin@apple.com>
1229
1230         Reviewed by Sam Weinig.
1231
1232         Bug 25674: syntax tree nodes should use arena allocation
1233         Part one: Change lifetimes so we won't have to use reference
1234         counting so much, but don't eliminate the reference counts
1235         entirely yet.
1236
1237         * JavaScriptCore.exp: Updated.
1238
1239         * bytecompiler/BytecodeGenerator.cpp:
1240         (JSC::BytecodeGenerator::BytecodeGenerator): Update for use of raw pointers
1241         instead of RefPtr.
1242         (JSC::BytecodeGenerator::emitCall): Ditto.
1243         (JSC::BytecodeGenerator::emitConstruct): Ditto.
1244
1245         * parser/Grammar.y: Update node creating code to use new (JSGlobalData*)
1246         instead of the plain new. At the moment this is just a hook for future
1247         arena allocation; it's inline and JSGlobalData* is not used.
1248
1249         * parser/NodeConstructors.h: Updated for name change of parserObjects to
1250         parserArena. Also added explicit initialization for raw pointers that used
1251         to be RefPtr. Also removed some uses of get() that aren't needed now that
1252         the pointers are raw pointers. Also eliminated m_parameter from FuncExprNode
1253         and FuncDeclNode. Also changed node-creating code to use new (JSGlobalData*)
1254         as above.
1255
1256         * parser/Nodes.cpp: Eliminated NodeReleaser and all use of it.
1257         (JSC::ParserRefCounted::ParserRefCounted): Updated for name change of
1258         parserObjects to parserArena.
1259         (JSC::SourceElements::append): Use raw pointers.
1260         (JSC::ArrayNode::emitBytecode): Ditto.
1261         (JSC::ArrayNode::isSimpleArray): Ditto.
1262         (JSC::ArrayNode::toArgumentList): Ditto.
1263         (JSC::ObjectLiteralNode::emitBytecode): Ditto.
1264         (JSC::PropertyListNode::emitBytecode): Ditto.
1265         (JSC::BracketAccessorNode::emitBytecode): Ditto.
1266         (JSC::DotAccessorNode::emitBytecode): Ditto.
1267         (JSC::ArgumentListNode::emitBytecode): Ditto.
1268         (JSC::NewExprNode::emitBytecode): Ditto.
1269         (JSC::EvalFunctionCallNode::emitBytecode): Ditto.
1270         (JSC::FunctionCallValueNode::emitBytecode): Ditto.
1271         (JSC::FunctionCallResolveNode::emitBytecode): Ditto.
1272         (JSC::FunctionCallBracketNode::emitBytecode): Ditto.
1273         (JSC::FunctionCallDotNode::emitBytecode): Ditto.
1274         (JSC::CallFunctionCallDotNode::emitBytecode): Ditto.
1275         (JSC::ApplyFunctionCallDotNode::emitBytecode): Ditto.
1276         (JSC::PostfixBracketNode::emitBytecode): Ditto.
1277         (JSC::PostfixDotNode::emitBytecode): Ditto.
1278         (JSC::DeleteBracketNode::emitBytecode): Ditto.
1279         (JSC::DeleteDotNode::emitBytecode): Ditto.
1280         (JSC::DeleteValueNode::emitBytecode): Ditto.
1281         (JSC::VoidNode::emitBytecode): Ditto.
1282         (JSC::TypeOfValueNode::emitBytecode): Ditto.
1283         (JSC::PrefixBracketNode::emitBytecode): Ditto.
1284         (JSC::PrefixDotNode::emitBytecode): Ditto.
1285         (JSC::UnaryOpNode::emitBytecode): Ditto.
1286         (JSC::BinaryOpNode::emitStrcat): Ditto.
1287         (JSC::BinaryOpNode::emitBytecode): Ditto.
1288         (JSC::EqualNode::emitBytecode): Ditto.
1289         (JSC::StrictEqualNode::emitBytecode): Ditto.
1290         (JSC::ReverseBinaryOpNode::emitBytecode): Ditto.
1291         (JSC::ThrowableBinaryOpNode::emitBytecode): Ditto.
1292         (JSC::InstanceOfNode::emitBytecode): Ditto.
1293         (JSC::LogicalOpNode::emitBytecode): Ditto.
1294         (JSC::ConditionalNode::emitBytecode): Ditto.
1295         (JSC::ReadModifyResolveNode::emitBytecode): Ditto.
1296         (JSC::AssignResolveNode::emitBytecode): Ditto.
1297         (JSC::AssignDotNode::emitBytecode): Ditto.
1298         (JSC::ReadModifyDotNode::emitBytecode): Ditto.
1299         (JSC::AssignBracketNode::emitBytecode): Ditto.
1300         (JSC::ReadModifyBracketNode::emitBytecode): Ditto.
1301         (JSC::CommaNode::emitBytecode): Ditto.
1302         (JSC::ConstDeclNode::emitCodeSingle): Ditto.
1303         (JSC::ConstDeclNode::emitBytecode): Ditto.
1304         (JSC::ConstStatementNode::emitBytecode): Ditto.
1305         (JSC::statementListEmitCode): Ditto.
1306         (JSC::BlockNode::emitBytecode): Ditto.
1307         (JSC::ExprStatementNode::emitBytecode): Ditto.
1308         (JSC::VarStatementNode::emitBytecode): Ditto.
1309         (JSC::IfNode::emitBytecode): Ditto.
1310         (JSC::IfElseNode::emitBytecode): Ditto.
1311         (JSC::DoWhileNode::emitBytecode): Ditto.
1312         (JSC::WhileNode::emitBytecode): Ditto.
1313         (JSC::ForNode::emitBytecode): Ditto.
1314         (JSC::ForInNode::emitBytecode): Ditto.
1315         (JSC::ReturnNode::emitBytecode): Ditto.
1316         (JSC::WithNode::emitBytecode): Ditto.
1317         (JSC::CaseBlockNode::tryOptimizedSwitch): Ditto.
1318         (JSC::CaseBlockNode::emitBytecodeForBlock): Ditto.
1319         (JSC::SwitchNode::emitBytecode): Ditto.
1320         (JSC::LabelNode::emitBytecode): Ditto.
1321         (JSC::ThrowNode::emitBytecode): Ditto.
1322         (JSC::TryNode::emitBytecode): Ditto.
1323         (JSC::ScopeNodeData::ScopeNodeData): Use swap to transfer ownership
1324         of the arena, varStack and functionStack.
1325         (JSC::ScopeNode::ScopeNode): Pass in the arena when creating the
1326         ScopeNodeData.
1327         (JSC::ProgramNode::ProgramNode): Made this inline since it's used
1328         in only one place.
1329         (JSC::ProgramNode::create): Changed this to return a PassRefPtr since
1330         we plan to have the scope nodes be outside the arena, so they will need
1331         some kind of ownership transfer (maybe auto_ptr instead of PassRefPtr
1332         in the future, though). Remove the node from the newly-created arena to
1333         avoid a circular reference. Later we'll keep the node out of the arena
1334         by using a different operator new, but for now it's the ParserRefCounted
1335         constructor that puts the node into the arena, and there's no way to
1336         bypass that.
1337         (JSC::EvalNode::EvalNode): Ditto.
1338         (JSC::EvalNode::create): Ditto.
1339         (JSC::FunctionBodyNode::FunctionBodyNode): Ditto.
1340         (JSC::FunctionBodyNode::createNativeThunk): Moved the code that
1341         reseets the arena here instead of the caller.
1342         (JSC::FunctionBodyNode::create): Same change as the other create
1343         functions above.
1344         (JSC::FunctionBodyNode::emitBytecode): Use raw pointers.
1345
1346         * parser/Nodes.h: Removed NodeReleaser. Changed FunctionStack to
1347         use raw pointers. Removed the releaseNodes function. Added an override
1348         of operator new that takes a JSGlobalData* to prepare for future arena use.
1349         Use raw pointers instead of RefPtr everywhere possible.
1350
1351         * parser/Parser.cpp:
1352         (JSC::Parser::reparseInPlace): Pass the arena in.
1353
1354         * parser/Parser.h:
1355         (JSC::Parser::parse): Updated for name change of parserObjects to parserArena.
1356         (JSC::Parser::reparse): Ditto.
1357         * runtime/FunctionConstructor.cpp:
1358         (JSC::extractFunctionBody): Ditto.
1359         * runtime/JSGlobalData.cpp:
1360         (JSC::JSGlobalData::~JSGlobalData): Ditto.
1361         (JSC::JSGlobalData::createNativeThunk): Moved arena manipulation into the
1362         FunctionBodyNode::createNativeThunk function.
1363
1364         * runtime/JSGlobalData.h: Tweaked formatting and renamed parserObjects to
1365         parserArena.
1366
1367         * wtf/NotFound.h: Added the usual "using WTF" to this header to match the
1368         rest of WTF.
1369
1370 2009-05-10  Dimitri Glazkov  <dglazkov@chromium.org>
1371
1372         Reviewed by Geoffrey Garen.
1373
1374         https://bugs.webkit.org/show_bug.cgi?id=25670
1375         Remove no longer valid chunk of code from dtoa.
1376
1377         * wtf/dtoa.cpp:
1378         (WTF::dtoa): Removed invalid code.
1379
1380 2009-05-10  Alexey Proskuryakov  <ap@webkit.org>
1381
1382         Reviewed by Geoff Garen.
1383
1384         "Class const *" is the same as "const Class*", use the latter syntax consistently.
1385
1386         See <http://www.parashift.com/c++-faq-lite/const-correctness.html#faq-18.9>.
1387
1388         * pcre/pcre_compile.cpp:
1389         (calculateCompiledPatternLength):
1390         * runtime/JSObject.h:
1391         (JSC::JSObject::offsetForLocation):
1392         (JSC::JSObject::locationForOffset):
1393
1394 2009-05-10  Maciej Stachowiak  <mjs@apple.com>
1395
1396         Reviewed by Alexey Proskuryakov.
1397         
1398         - speedup dtoa/strtod
1399         
1400         Added a bunch of inlining, and replaced malloc with stack allocation.
1401         
1402         0.5% SunSpider speedup (7% on string-tagcloud).
1403
1404         * runtime/NumberPrototype.cpp:
1405         (JSC::integerPartNoExp):
1406         (JSC::numberProtoFuncToExponential):
1407         * runtime/UString.cpp:
1408         (JSC::concatenate):
1409         (JSC::UString::from):
1410         * wtf/dtoa.cpp:
1411         (WTF::BigInt::BigInt):
1412         (WTF::BigInt::operator=):
1413         (WTF::Balloc):
1414         (WTF::Bfree):
1415         (WTF::multadd):
1416         (WTF::s2b):
1417         (WTF::i2b):
1418         (WTF::mult):
1419         (WTF::pow5mult):
1420         (WTF::lshift):
1421         (WTF::cmp):
1422         (WTF::diff):
1423         (WTF::b2d):
1424         (WTF::d2b):
1425         (WTF::ratio):
1426         (WTF::strtod):
1427         (WTF::quorem):
1428         (WTF::freedtoa):
1429         (WTF::dtoa):
1430         * wtf/dtoa.h:
1431
1432 2009-05-09  Mike Hommey  <glandium@debian.org>
1433
1434         Reviewed by Geoffrey Garen. Landed by Jan Alonzo.
1435
1436         Enable JIT on x86-64 gtk+
1437         https://bugs.webkit.org/show_bug.cgi?id=24724
1438
1439         * GNUmakefile.am:
1440
1441 2009-05-09  Geoffrey Garen  <ggaren@apple.com>
1442
1443         Reviewed by Cameron Zwarich.
1444         
1445         Removed the last non-call-related manually managed JIT stub call.
1446
1447         * jit/JITArithmetic.cpp:
1448         (JSC::JIT::compileFastArithSlow_op_rshift): Fully use the JITStubCall
1449         abstraction, instead of emitPutJITStubArg.
1450
1451 2009-05-09  Sebastian Andrzej Siewior  <sebastian@breakpoint.cc>
1452
1453         Reviewed by Gustavo Noronha.
1454
1455         https://bugs.webkit.org/show_bug.cgi?id=25653
1456         PLATFORM(X86_64) inherits ia64
1457
1458         __ia64__ is defined by gcc in an IA64 arch and has completely
1459         nothing in common with X86-64 exept both are from Intel and have
1460         an 64bit address space. That's it. Since code seems to expect x86
1461         here, ia64 has to go.
1462
1463         * wtf/Platform.h:
1464
1465 2009-05-09  Gustavo Noronha Silva  <gns@gnome.org>
1466
1467         Suggested by Geoffrey Garen.
1468
1469         Assume SSE2 is present on X86-64 and on MAC X86-32. This fixes a
1470         build breakage on non-Mac X86-64 when JIT is enabled.
1471
1472         * jit/JITArithmetic.cpp:
1473
1474 2009-05-09  Gustavo Noronha Silva  <gns@gnome.org>
1475
1476         Build fix, adding missing files to make dist.
1477
1478         * GNUmakefile.am:
1479
1480 2009-05-09  Geoffrey Garen  <ggaren@apple.com>
1481
1482         Windows build fix.
1483
1484         * assembler/X86Assembler.h:
1485         (JSC::X86Assembler::patchLoadToLEA):
1486
1487 2009-05-09  Geoffrey Garen  <ggaren@apple.com>
1488
1489         Windows build fix.
1490
1491         * assembler/X86Assembler.h:
1492         (JSC::X86Assembler::patchLoadToLEA):
1493
1494 2009-05-09  Maciej Stachowiak  <mjs@apple.com>
1495
1496         Reviewed by Gavin Barraclough.
1497         
1498         Original patch by John McCall. Updated by Cameron Zwarich. Further refined by me.
1499         
1500         - Assorted speedups to property access
1501         
1502         ~.3%-1% speedup on SunSpider
1503         
1504         1) When we know from the structure ID that an object is using inline storage, plant direct
1505         loads and stores against it; no need to indirect through storage pointer.
1506         
1507         2) Also because of the above, union the property storage pointer with the first inline property
1508         slot and add an extra inline property slot.
1509
1510         * assembler/AbstractMacroAssembler.h:
1511         (JSC::AbstractMacroAssembler::CodeLocationInstruction::CodeLocationInstruction):
1512         (JSC::AbstractMacroAssembler::CodeLocationInstruction::patchLoadToLEA):
1513         (JSC::::CodeLocationCommon::instructionAtOffset):
1514         * assembler/MacroAssembler.h:
1515         (JSC::MacroAssembler::storePtr):
1516         * assembler/MacroAssemblerX86.h:
1517         (JSC::MacroAssemblerX86::store32):
1518         * assembler/MacroAssemblerX86_64.h:
1519         (JSC::MacroAssemblerX86_64::storePtr):
1520         * assembler/X86Assembler.h:
1521         (JSC::X86Assembler::movq_EAXm):
1522         (JSC::X86Assembler::movl_rm):
1523         (JSC::X86Assembler::patchLoadToLEA):
1524         * jit/JIT.cpp:
1525         (JSC::JIT::privateCompileMainPass):
1526         * jit/JIT.h:
1527         * jit/JITPropertyAccess.cpp:
1528         (JSC::JIT::compileGetByIdHotPath):
1529         (JSC::JIT::compilePutByIdHotPath):
1530         (JSC::JIT::compilePutDirectOffset):
1531         (JSC::JIT::compileGetDirectOffset):
1532         (JSC::JIT::privateCompilePutByIdTransition):
1533         (JSC::JIT::patchGetByIdSelf):
1534         (JSC::JIT::patchPutByIdReplace):
1535         (JSC::JIT::privateCompileGetByIdSelf):
1536         (JSC::JIT::privateCompileGetByIdProto):
1537         (JSC::JIT::privateCompileGetByIdSelfList):
1538         (JSC::JIT::privateCompileGetByIdProtoList):
1539         (JSC::JIT::privateCompileGetByIdChainList):
1540         (JSC::JIT::privateCompileGetByIdChain):
1541         (JSC::JIT::privateCompilePutByIdReplace):
1542         * runtime/JSObject.cpp:
1543         (JSC::JSObject::mark):
1544         (JSC::JSObject::removeDirect):
1545         * runtime/JSObject.h:
1546         (JSC::JSObject::propertyStorage):
1547         (JSC::JSObject::getDirect):
1548         (JSC::JSObject::getOffset):
1549         (JSC::JSObject::offsetForLocation):
1550         (JSC::JSObject::locationForOffset):
1551         (JSC::JSObject::getDirectOffset):
1552         (JSC::JSObject::putDirectOffset):
1553         (JSC::JSObject::isUsingInlineStorage):
1554         (JSC::JSObject::):
1555         (JSC::JSObject::JSObject):
1556         (JSC::JSObject::~JSObject):
1557         (JSC::Structure::isUsingInlineStorage):
1558         (JSC::JSObject::putDirect):
1559         (JSC::JSObject::putDirectWithoutTransition):
1560         (JSC::JSObject::allocatePropertyStorageInline):
1561         * runtime/Structure.h:
1562
1563 2009-05-09  Geoffrey Garen  <ggaren@apple.com>
1564
1565         Reviewed by Gavin Barraclough.
1566
1567         Changed all our JIT stubs so that they return a maximum of 1 JS value or
1568         two non-JS pointers, and do all other value returning through out
1569         parameters, in preparation for 64bit JS values on a 32bit system.
1570
1571         Stubs that used to return two JSValues now return one JSValue and take
1572         and out parameter specifying where in the register array the second
1573         value should go.
1574         
1575         SunSpider reports no change.
1576
1577         * jit/JIT.cpp:
1578         (JSC::JIT::privateCompileMainPass):
1579         * jit/JITArithmetic.cpp:
1580         (JSC::JIT::compileFastArithSlow_op_post_inc):
1581         (JSC::JIT::compileFastArithSlow_op_post_dec):
1582         * jit/JITStubs.cpp:
1583         (JSC::JITStubs::cti_op_call_arityCheck):
1584         (JSC::JITStubs::cti_op_resolve_func):
1585         (JSC::JITStubs::cti_op_post_inc):
1586         (JSC::JITStubs::cti_op_resolve_with_base):
1587         (JSC::JITStubs::cti_op_post_dec):
1588         * jit/JITStubs.h:
1589         (JSC::):
1590
1591 2009-05-08  Geoffrey Garen  <ggaren@apple.com>
1592
1593         Reviewed by Cameron Zwarich.
1594         
1595         Fixed <rdar://problem/6634956> CrashTracer: [REGRESSION] >400 crashes
1596         in Safari at com.apple.JavaScriptCore • JSC::BytecodeGenerator::emitComplexJumpScopes + 468
1597         https://bugs.webkit.org/show_bug.cgi?id=25658
1598
1599         * bytecompiler/BytecodeGenerator.cpp:
1600         (JSC::BytecodeGenerator::emitComplexJumpScopes): Guard the whole loop
1601         with a bounds check. The old loop logic would decrement and read topScope
1602         without a bounds check, which could cause crashes on page boundaries.
1603
1604 2009-05-08  Jan Michael Alonzo  <jmalonzo@webkit.org>
1605
1606         Reviewed by NOBODY (BuildFix).
1607
1608         Gtk fix: add LiteralParser to the build script per r43424.
1609
1610         Add LiteralParser to the Qt and Wx build scripts too.
1611
1612         * GNUmakefile.am:
1613         * JavaScriptCore.pri:
1614         * JavaScriptCoreSources.bkl:
1615
1616 2009-05-08  Oliver Hunt  <oliver@apple.com>
1617
1618         Reviewed by Gavin Barraclough and Darin Adler.
1619
1620         Add a limited literal parser for eval to handle object and array literals fired at eval
1621
1622         This is a simplified parser and lexer that we can throw at strings passed to eval
1623         in case a site is using eval to parse JSON (eg. json2.js).  The lexer is intentionally
1624         limited (in effect it's whitelisting a limited "common" subset of the JSON grammar)
1625         as this decreases the likelihood of us wating time attempting to parse any significant
1626         amount of non-JSON content.
1627
1628         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1629         * JavaScriptCore.xcodeproj/project.pbxproj:
1630         * interpreter/Interpreter.cpp:
1631         (JSC::Interpreter::callEval):
1632         * runtime/JSGlobalObjectFunctions.cpp:
1633         (JSC::globalFuncEval):
1634         * runtime/LiteralParser.cpp: Added.
1635         (JSC::isStringCharacter):
1636         (JSC::LiteralParser::Lexer::lex):
1637         (JSC::LiteralParser::Lexer::lexString):
1638         (JSC::LiteralParser::Lexer::lexNumber):
1639         (JSC::LiteralParser::parseStatement):
1640         (JSC::LiteralParser::parseExpression):
1641         (JSC::LiteralParser::parseArray):
1642         (JSC::LiteralParser::parseObject):
1643         (JSC::LiteralParser::StackGuard::StackGuard):
1644         (JSC::LiteralParser::StackGuard::~StackGuard):
1645         (JSC::LiteralParser::StackGuard::isSafe):
1646         * runtime/LiteralParser.h: Added.
1647         (JSC::LiteralParser::LiteralParser):
1648         (JSC::LiteralParser::attemptJSONParse):
1649         (JSC::LiteralParser::):
1650         (JSC::LiteralParser::Lexer::Lexer):
1651         (JSC::LiteralParser::Lexer::next):
1652         (JSC::LiteralParser::Lexer::currentToken):
1653         (JSC::LiteralParser::abortParse):
1654
1655 2009-05-08  Geoffrey Garen  <ggaren@apple.com>
1656
1657         Not reviewed.
1658         
1659         Restored a Mozilla JS test I accidentally gutted.
1660
1661         * tests/mozilla/ecma/Array/15.4.4.2.js:
1662         (getTestCases):
1663         (test):
1664
1665 2009-05-08  Geoffrey Garen  <ggaren@apple.com>
1666
1667         Reviewed by Gavin Barraclough.
1668         
1669         More abstraction for JITStub calls from JITed code.
1670         
1671         Added a JITStubCall class that automatically handles things like assigning
1672         arguments to different stack slots and storing return values. Deployed
1673         the class in about a billion places. A bunch more places remain to be
1674         fixed up, but this is a good stopping point for now.
1675
1676         * jit/JIT.cpp:
1677         (JSC::JIT::emitTimeoutCheck):
1678         (JSC::JIT::privateCompileMainPass):
1679         (JSC::JIT::privateCompileSlowCases):
1680         (JSC::JIT::privateCompile):
1681         * jit/JIT.h:
1682         (JSC::JIT::JSRInfo::JSRInfo):
1683         (JSC::JITStubCall::JITStubCall):
1684         (JSC::JITStubCall::addArgument):
1685         (JSC::JITStubCall::call):
1686         (JSC::JITStubCall::):
1687         (JSC::CallEvalJITStub::CallEvalJITStub):
1688         * jit/JITArithmetic.cpp:
1689         (JSC::JIT::compileFastArithSlow_op_lshift):
1690         (JSC::JIT::compileFastArithSlow_op_rshift):
1691         (JSC::JIT::compileFastArithSlow_op_jnless):
1692         (JSC::JIT::compileFastArithSlow_op_bitand):
1693         (JSC::JIT::compileFastArithSlow_op_mod):
1694         (JSC::JIT::compileFastArith_op_mod):
1695         (JSC::JIT::compileFastArithSlow_op_post_inc):
1696         (JSC::JIT::compileFastArithSlow_op_post_dec):
1697         (JSC::JIT::compileFastArithSlow_op_pre_inc):
1698         (JSC::JIT::compileFastArithSlow_op_pre_dec):
1699         (JSC::JIT::compileFastArith_op_add):
1700         (JSC::JIT::compileFastArith_op_mul):
1701         (JSC::JIT::compileFastArith_op_sub):
1702         (JSC::JIT::compileBinaryArithOpSlowCase):
1703         (JSC::JIT::compileFastArithSlow_op_add):
1704         (JSC::JIT::compileFastArithSlow_op_mul):
1705         * jit/JITCall.cpp:
1706         (JSC::JIT::compileOpCall):
1707         (JSC::):
1708         * jit/JITPropertyAccess.cpp:
1709         (JSC::JIT::compileGetByIdHotPath):
1710         (JSC::JIT::compilePutByIdHotPath):
1711         (JSC::JIT::compileGetByIdSlowCase):
1712         (JSC::JIT::compilePutByIdSlowCase):
1713         * jit/JITStubs.cpp:
1714         (JSC::JITStubs::cti_op_resolve_func):
1715         (JSC::JITStubs::cti_op_resolve_with_base):
1716
1717 2009-05-08  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
1718
1719         Reviewed by Maciej Stachowiak.
1720
1721         Add a new opcode jnlesseq, and optimize its compilation in the JIT using
1722         techniques similar to what were used to optimize jnless in r43363.
1723
1724         This gives a 0.7% speedup on SunSpider, particularly on the tests 3d-cube,
1725         control-flow-recursive, date-format-xparb, and string-base64.
1726
1727         * bytecode/CodeBlock.cpp:
1728         (JSC::CodeBlock::dump): Add support for dumping op_jnlesseq.
1729         * bytecode/Opcode.h: Add op_jnlesseq to the list of opcodes.
1730         * bytecompiler/BytecodeGenerator.cpp:
1731         (JSC::BytecodeGenerator::emitJumpIfFalse): Add a peephole optimization
1732         for op_jnlesseq when emitting lesseq followed by a jump.
1733         * interpreter/Interpreter.cpp:
1734         (JSC::Interpreter::privateExecute): Add case for op_jnlesseq.
1735         * jit/JIT.cpp:
1736         (JSC::JIT::privateCompileMainPass): Add case for op_jnlesseq.
1737         (JSC::JIT::privateCompileSlowCases): Add case for op_jnlesseq.
1738         * jit/JIT.h:
1739         * jit/JITArithmetic.cpp:
1740         (JSC::JIT::compileFastArith_op_jnlesseq): Added.
1741         (JSC::JIT::compileFastArithSlow_op_jnlesseq): Added.
1742         * jit/JITStubs.cpp:
1743         (JSC::JITStubs::cti_op_jlesseq): Added.
1744         * jit/JITStubs.h:
1745
1746 2009-05-08  Maciej Stachowiak  <mjs@apple.com>
1747
1748         Reviewed by Cameron Zwarich.
1749         
1750         - fix test failures on 64-bit
1751
1752         * jit/JITArithmetic.cpp:
1753         (JSC::JIT::compileFastArithSlow_op_jnless): Avoid accidentaly treating an
1754         immediate int as an immediate float in the 64-bit value representation.
1755
1756 2009-05-08  Gavin Barraclough  <barraclough@apple.com>
1757
1758         Rubber stamped by Oliver Hunt.
1759
1760         Removing an empty constructor and an uncalled, empty function seems to be a
1761         pretty solid 1% regeression on my machine, so I'm going to put them back.
1762         Um.  Yeah, this this pretty pointles and makes no sense at all.  I officially
1763         lose the will to live in 3... 2...
1764
1765         * bytecode/SamplingTool.cpp:
1766         (JSC::SamplingTool::notifyOfScope):
1767         * bytecode/SamplingTool.h:
1768         (JSC::SamplingTool::~SamplingTool):
1769
1770 2009-05-08  Gavin Barraclough  <barraclough@apple.com>
1771
1772         Reviewed by Oliver "I see lots of ifdefs" Hunt.
1773
1774         Fix (kinda) for sampling tool breakage.  The codeblock sampling tool has become
1775         b0rked due to recent changes in native function calling.  The initialization of
1776         a ScopeNode appears to now occur before the sampling tool (or possibly the
1777         interpreter has been brought into existence, wihich leads to crashyness).
1778
1779         This patch doesn't fix the problem.  The crash occurs when tracking a Scope, but
1780         we shouldn't need to track scopes when we're just sampling opcodes, not
1781         codeblocks.  Not retaining Scopes when just opcode sampling will reduce sampling
1782         overhead reducing any instrumentation skew, which is a good thing.  As a side
1783         benefit this patch also gets the opcode sampling going again, albeit in a bit of
1784         a lame way.  Will come back later with a proper fix from codeblock sampling. 
1785
1786         * JavaScriptCore.exp:
1787         * bytecode/SamplingTool.cpp:
1788         (JSC::compareLineCountInfoSampling):
1789         (JSC::SamplingTool::dump):
1790         * bytecode/SamplingTool.h:
1791         (JSC::SamplingTool::SamplingTool):
1792         * parser/Nodes.cpp:
1793         (JSC::ScopeNode::ScopeNode):
1794
1795 2009-05-07  Mark Rowe  <mrowe@apple.com>
1796
1797         Rubber-stamped by Oliver Hunt.
1798
1799         Fix <https://bugs.webkit.org/show_bug.cgi?id=25640>.
1800         Bug 25640: Crash on quit in r43384 nightly build on Leopard w/ Safari 4 beta installed
1801         
1802         Roll out r43366 as it removed symbols that Safari 4 Beta uses.
1803
1804         * JavaScriptCore.exp:
1805         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1806         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
1807         * bytecode/SamplingTool.cpp:
1808         (JSC::SamplingThread::start):
1809         (JSC::SamplingThread::stop):
1810         * bytecode/SamplingTool.h:
1811         * wtf/CrossThreadRefCounted.h:
1812         (WTF::CrossThreadRefCounted::CrossThreadRefCounted):
1813         (WTF::::ref):
1814         (WTF::::deref):
1815         * wtf/Threading.h:
1816         * wtf/ThreadingNone.cpp:
1817         * wtf/ThreadingPthreads.cpp:
1818         (WTF::threadMapMutex):
1819         (WTF::initializeThreading):
1820         (WTF::threadMap):
1821         (WTF::identifierByPthreadHandle):
1822         (WTF::establishIdentifierForPthreadHandle):
1823         (WTF::pthreadHandleForIdentifier):
1824         (WTF::clearPthreadHandleForIdentifier):
1825         (WTF::createThreadInternal):
1826         (WTF::waitForThreadCompletion):
1827         (WTF::detachThread):
1828         (WTF::currentThread):
1829         * wtf/ThreadingWin.cpp:
1830         (WTF::threadMapMutex):
1831         (WTF::initializeThreading):
1832         (WTF::threadMap):
1833         (WTF::storeThreadHandleByIdentifier):
1834         (WTF::threadHandleForIdentifier):
1835         (WTF::clearThreadHandleForIdentifier):
1836         (WTF::createThreadInternal):
1837         (WTF::waitForThreadCompletion):
1838         (WTF::detachThread):
1839         (WTF::currentThread):
1840         * wtf/gtk/ThreadingGtk.cpp:
1841         (WTF::threadMapMutex):
1842         (WTF::initializeThreading):
1843         (WTF::threadMap):
1844         (WTF::identifierByGthreadHandle):
1845         (WTF::establishIdentifierForThread):
1846         (WTF::threadForIdentifier):
1847         (WTF::clearThreadForIdentifier):
1848         (WTF::createThreadInternal):
1849         (WTF::waitForThreadCompletion):
1850         (WTF::currentThread):
1851         * wtf/qt/ThreadingQt.cpp:
1852         (WTF::threadMapMutex):
1853         (WTF::threadMap):
1854         (WTF::identifierByQthreadHandle):
1855         (WTF::establishIdentifierForThread):
1856         (WTF::clearThreadForIdentifier):
1857         (WTF::threadForIdentifier):
1858         (WTF::initializeThreading):
1859         (WTF::createThreadInternal):
1860         (WTF::waitForThreadCompletion):
1861         (WTF::currentThread):
1862
1863 2009-05-07  Gustavo Noronha Silva  <gns@gnome.org>
1864
1865         Suggested by Oliver Hunt.
1866
1867         Also check for Linux for the special-cased calling convention.
1868
1869         * jit/JIT.cpp:
1870         (JSC::JIT::privateCompileCTIMachineTrampolines):
1871         * wtf/Platform.h:
1872
1873 2009-05-07  Gavin Barraclough  <barraclough@apple.com>
1874
1875         Reviewed by Maciej Stachowiak.
1876
1877         Previously, when appending to an existing string and growing the underlying buffer,
1878         we would actually allocate 110% of the required size in order to give us some space
1879         to expand into.  Now we treat strings differently based on their size:
1880
1881         Small Strings (up to 4 pages):
1882         Expand the allocation size to 112.5% of the amount requested.  This is largely sicking
1883         to our previous policy, however 112.5% is cheaper to calculate.
1884
1885         Medium Strings (up to 128 pages):
1886         For pages covering multiple pages over-allocation is less of a concern - any unused
1887         space will not be paged in if it is not used, so this is purely a VM overhead.  For
1888         these strings allocate 2x the requested size.
1889
1890         Large Strings (to infinity and beyond!):
1891         Revert to our 112.5% policy - probably best to limit the amount of unused VM we allow
1892         any individual string be responsible for.
1893
1894         Additionally, round small allocations up to a multiple of 16 bytes, and medium and
1895         large allocations up to a multiple of page size.
1896
1897         ~1.5% progression on Sunspider, due to 5% improvement on tagcloud & 15% on validate.
1898
1899         * runtime/UString.cpp:
1900         (JSC::expandedSize):
1901
1902 2009-05-07  Geoffrey Garen  <ggaren@apple.com>
1903
1904         Reviewed by Cameron Zwarich.
1905         
1906         Fixed a minor sequencing error introduced by recent Parser speedups.
1907
1908         * runtime/JSGlobalData.cpp:
1909         (JSC::JSGlobalData::createNativeThunk): Missed a spot in my last patch.
1910
1911 2009-05-07  Geoffrey Garen  <ggaren@apple.com>
1912
1913         Not reviewed.
1914
1915         * wtf/Platform.h: Reverted an accidental (and performance-catastrophic)
1916         change.
1917
1918 2009-05-07  Geoffrey Garen  <ggaren@apple.com>
1919
1920         Reviewed by Cameron Zwarich.
1921         
1922         Fixed a minor sequencing error introduced by recent Parser speedups.
1923
1924         * parser/Parser.cpp:
1925         (JSC::Parser::reparseInPlace): Missed a spot in my last patch.
1926
1927 2009-05-07  Geoffrey Garen  <ggaren@apple.com>
1928
1929         Reviewed by Cameron Zwarich.
1930         
1931         Fixed a minor sequencing error introduced by recent Parser speedups.
1932
1933         * parser/Parser.cpp:
1934         (JSC::Parser::parse):
1935         * parser/Parser.h:
1936         (JSC::Parser::parse):
1937         (JSC::Parser::reparse): Shrink the parsedObjects vector after allocating
1938         the root node, to avoid leaving a stray node in the vector, since that's
1939         a slight memory leak, and it causes problems during JSGlobalData teardown.
1940
1941         * runtime/JSGlobalData.cpp:
1942         (JSC::JSGlobalData::~JSGlobalData): ASSERT that we're not being torn
1943         down while we think we're still parsing, since that would cause lots of
1944         bad memory references during our destruction.
1945
1946 2009-05-07  Geoffrey Garen  <ggaren@apple.com>
1947
1948         Reviewed by Cameron Zwarich.
1949         
1950         Replaced two more macros with references to the JITStackFrame structure.
1951
1952         * jit/JIT.cpp:
1953         (JSC::JIT::privateCompileMainPass):
1954         * jit/JITInlineMethods.h:
1955         (JSC::JIT::restoreArgumentReference):
1956         * jit/JITStubs.cpp:
1957         (JSC::):
1958         * jit/JITStubs.h:
1959
1960 2009-05-07  Oliver Hunt  <oliver@apple.com>
1961
1962         Reviewed by Gavin Barraclough.
1963
1964         Improve native call performance
1965
1966         Fix the windows build by adding calling convention declarations everywhere,
1967         chose fastcall as that seemed most sensible given we were having to declare
1968         the convention explicitly.  In addition switched to fastcall on mac in the
1969         deluded belief that documented fastcall behavior on windows would match 
1970         actual its actual behavior.
1971
1972         * API/JSCallbackFunction.h:
1973         * API/JSCallbackObject.h:
1974         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1975         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
1976         * interpreter/CallFrame.h:
1977         (JSC::ExecState::argumentCount):
1978         * jit/JIT.cpp:
1979         (JSC::JIT::privateCompileCTIMachineTrampolines):
1980         * jsc.cpp:
1981         (functionPrint):
1982         (functionDebug):
1983         (functionGC):
1984         (functionVersion):
1985         (functionRun):
1986         (functionLoad):
1987         (functionSetSamplingFlags):
1988         (functionClearSamplingFlags):
1989         (functionReadline):
1990         (functionQuit):
1991         * runtime/ArrayConstructor.cpp:
1992         (JSC::callArrayConstructor):
1993         * runtime/ArrayPrototype.cpp:
1994         (JSC::arrayProtoFuncToString):
1995         (JSC::arrayProtoFuncToLocaleString):
1996         (JSC::arrayProtoFuncJoin):
1997         (JSC::arrayProtoFuncConcat):
1998         (JSC::arrayProtoFuncPop):
1999         (JSC::arrayProtoFuncPush):
2000         (JSC::arrayProtoFuncReverse):
2001         (JSC::arrayProtoFuncShift):
2002         (JSC::arrayProtoFuncSlice):
2003         (JSC::arrayProtoFuncSort):
2004         (JSC::arrayProtoFuncSplice):
2005         (JSC::arrayProtoFuncUnShift):
2006         (JSC::arrayProtoFuncFilter):
2007         (JSC::arrayProtoFuncMap):
2008         (JSC::arrayProtoFuncEvery):
2009         (JSC::arrayProtoFuncForEach):
2010         (JSC::arrayProtoFuncSome):
2011         (JSC::arrayProtoFuncReduce):
2012         (JSC::arrayProtoFuncReduceRight):
2013         (JSC::arrayProtoFuncIndexOf):
2014         (JSC::arrayProtoFuncLastIndexOf):
2015         * runtime/BooleanConstructor.cpp:
2016         (JSC::callBooleanConstructor):
2017         * runtime/BooleanPrototype.cpp:
2018         (JSC::booleanProtoFuncToString):
2019         (JSC::booleanProtoFuncValueOf):
2020         * runtime/CallData.h:
2021         * runtime/DateConstructor.cpp:
2022         (JSC::callDate):
2023         (JSC::dateParse):
2024         (JSC::dateNow):
2025         (JSC::dateUTC):
2026         * runtime/DatePrototype.cpp:
2027         (JSC::dateProtoFuncToString):
2028         (JSC::dateProtoFuncToUTCString):
2029         (JSC::dateProtoFuncToDateString):
2030         (JSC::dateProtoFuncToTimeString):
2031         (JSC::dateProtoFuncToLocaleString):
2032         (JSC::dateProtoFuncToLocaleDateString):
2033         (JSC::dateProtoFuncToLocaleTimeString):
2034         (JSC::dateProtoFuncGetTime):
2035         (JSC::dateProtoFuncGetFullYear):
2036         (JSC::dateProtoFuncGetUTCFullYear):
2037         (JSC::dateProtoFuncToGMTString):
2038         (JSC::dateProtoFuncGetMonth):
2039         (JSC::dateProtoFuncGetUTCMonth):
2040         (JSC::dateProtoFuncGetDate):
2041         (JSC::dateProtoFuncGetUTCDate):
2042         (JSC::dateProtoFuncGetDay):
2043         (JSC::dateProtoFuncGetUTCDay):
2044         (JSC::dateProtoFuncGetHours):
2045         (JSC::dateProtoFuncGetUTCHours):
2046         (JSC::dateProtoFuncGetMinutes):
2047         (JSC::dateProtoFuncGetUTCMinutes):
2048         (JSC::dateProtoFuncGetSeconds):
2049         (JSC::dateProtoFuncGetUTCSeconds):
2050         (JSC::dateProtoFuncGetMilliSeconds):
2051         (JSC::dateProtoFuncGetUTCMilliseconds):
2052         (JSC::dateProtoFuncGetTimezoneOffset):
2053         (JSC::dateProtoFuncSetTime):
2054         (JSC::dateProtoFuncSetMilliSeconds):
2055         (JSC::dateProtoFuncSetUTCMilliseconds):
2056         (JSC::dateProtoFuncSetSeconds):
2057         (JSC::dateProtoFuncSetUTCSeconds):
2058         (JSC::dateProtoFuncSetMinutes):
2059         (JSC::dateProtoFuncSetUTCMinutes):
2060         (JSC::dateProtoFuncSetHours):
2061         (JSC::dateProtoFuncSetUTCHours):
2062         (JSC::dateProtoFuncSetDate):
2063         (JSC::dateProtoFuncSetUTCDate):
2064         (JSC::dateProtoFuncSetMonth):
2065         (JSC::dateProtoFuncSetUTCMonth):
2066         (JSC::dateProtoFuncSetFullYear):
2067         (JSC::dateProtoFuncSetUTCFullYear):
2068         (JSC::dateProtoFuncSetYear):
2069         (JSC::dateProtoFuncGetYear):
2070         * runtime/ErrorConstructor.cpp:
2071         (JSC::callErrorConstructor):
2072         * runtime/ErrorPrototype.cpp:
2073         (JSC::errorProtoFuncToString):
2074         * runtime/FunctionConstructor.cpp:
2075         (JSC::callFunctionConstructor):
2076         * runtime/FunctionPrototype.cpp:
2077         (JSC::callFunctionPrototype):
2078         (JSC::functionProtoFuncToString):
2079         (JSC::functionProtoFuncApply):
2080         (JSC::functionProtoFuncCall):
2081         * runtime/JSFunction.h:
2082         (JSC::JSFunction::nativeFunction):
2083         (JSC::JSFunction::setScopeChain):
2084         * runtime/JSGlobalObjectFunctions.cpp:
2085         (JSC::globalFuncEval):
2086         (JSC::globalFuncParseInt):
2087         (JSC::globalFuncParseFloat):
2088         (JSC::globalFuncIsNaN):
2089         (JSC::globalFuncIsFinite):
2090         (JSC::globalFuncDecodeURI):
2091         (JSC::globalFuncDecodeURIComponent):
2092         (JSC::globalFuncEncodeURI):
2093         (JSC::globalFuncEncodeURIComponent):
2094         (JSC::globalFuncEscape):
2095         (JSC::globalFuncUnescape):
2096         (JSC::globalFuncJSCPrint):
2097         * runtime/JSGlobalObjectFunctions.h:
2098         * runtime/MathObject.cpp:
2099         (JSC::mathProtoFuncAbs):
2100         (JSC::mathProtoFuncACos):
2101         (JSC::mathProtoFuncASin):
2102         (JSC::mathProtoFuncATan):
2103         (JSC::mathProtoFuncATan2):
2104         (JSC::mathProtoFuncCeil):
2105         (JSC::mathProtoFuncCos):
2106         (JSC::mathProtoFuncExp):
2107         (JSC::mathProtoFuncFloor):
2108         (JSC::mathProtoFuncLog):
2109         (JSC::mathProtoFuncMax):
2110         (JSC::mathProtoFuncMin):
2111         (JSC::mathProtoFuncPow):
2112         (JSC::mathProtoFuncRandom):
2113         (JSC::mathProtoFuncRound):
2114         (JSC::mathProtoFuncSin):
2115         (JSC::mathProtoFuncSqrt):
2116         (JSC::mathProtoFuncTan):
2117         * runtime/NativeErrorConstructor.cpp:
2118         (JSC::callNativeErrorConstructor):
2119         * runtime/NativeFunctionWrapper.h:
2120         * runtime/NumberConstructor.cpp:
2121         (JSC::callNumberConstructor):
2122         * runtime/NumberPrototype.cpp:
2123         (JSC::numberProtoFuncToString):
2124         (JSC::numberProtoFuncToLocaleString):
2125         (JSC::numberProtoFuncValueOf):
2126         (JSC::numberProtoFuncToFixed):
2127         (JSC::numberProtoFuncToExponential):
2128         (JSC::numberProtoFuncToPrecision):
2129         * runtime/ObjectConstructor.cpp:
2130         (JSC::callObjectConstructor):
2131         * runtime/ObjectPrototype.cpp:
2132         (JSC::objectProtoFuncValueOf):
2133         (JSC::objectProtoFuncHasOwnProperty):
2134         (JSC::objectProtoFuncIsPrototypeOf):
2135         (JSC::objectProtoFuncDefineGetter):
2136         (JSC::objectProtoFuncDefineSetter):
2137         (JSC::objectProtoFuncLookupGetter):
2138         (JSC::objectProtoFuncLookupSetter):
2139         (JSC::objectProtoFuncPropertyIsEnumerable):
2140         (JSC::objectProtoFuncToLocaleString):
2141         (JSC::objectProtoFuncToString):
2142         * runtime/ObjectPrototype.h:
2143         * runtime/RegExpConstructor.cpp:
2144         (JSC::callRegExpConstructor):
2145         * runtime/RegExpObject.cpp:
2146         (JSC::callRegExpObject):
2147         * runtime/RegExpPrototype.cpp:
2148         (JSC::regExpProtoFuncTest):
2149         (JSC::regExpProtoFuncExec):
2150         (JSC::regExpProtoFuncCompile):
2151         (JSC::regExpProtoFuncToString):
2152         * runtime/StringConstructor.cpp:
2153         (JSC::stringFromCharCode):
2154         (JSC::callStringConstructor):
2155         * runtime/StringPrototype.cpp:
2156         (JSC::stringProtoFuncReplace):
2157         (JSC::stringProtoFuncToString):
2158         (JSC::stringProtoFuncCharAt):
2159         (JSC::stringProtoFuncCharCodeAt):
2160         (JSC::stringProtoFuncConcat):
2161         (JSC::stringProtoFuncIndexOf):
2162         (JSC::stringProtoFuncLastIndexOf):
2163         (JSC::stringProtoFuncMatch):
2164         (JSC::stringProtoFuncSearch):
2165         (JSC::stringProtoFuncSlice):
2166         (JSC::stringProtoFuncSplit):
2167         (JSC::stringProtoFuncSubstr):
2168         (JSC::stringProtoFuncSubstring):
2169         (JSC::stringProtoFuncToLowerCase):
2170         (JSC::stringProtoFuncToUpperCase):
2171         (JSC::stringProtoFuncLocaleCompare):
2172         (JSC::stringProtoFuncBig):
2173         (JSC::stringProtoFuncSmall):
2174         (JSC::stringProtoFuncBlink):
2175         (JSC::stringProtoFuncBold):
2176         (JSC::stringProtoFuncFixed):
2177         (JSC::stringProtoFuncItalics):
2178         (JSC::stringProtoFuncStrike):
2179         (JSC::stringProtoFuncSub):
2180         (JSC::stringProtoFuncSup):
2181         (JSC::stringProtoFuncFontcolor):
2182         (JSC::stringProtoFuncFontsize):
2183         (JSC::stringProtoFuncAnchor):
2184         (JSC::stringProtoFuncLink):
2185         * wtf/Platform.h:
2186
2187 2009-05-07  Geoffrey Garen  <ggaren@apple.com>
2188
2189         Not reviewed.
2190         
2191         Rolled out a portion of r43352 because it broke 64bit.
2192
2193         * jit/JITStubs.h:
2194
2195 2009-05-07  Kevin Ollivier  <kevino@theolliviers.com>
2196
2197         Build fix for functions reaturning ThreadIdentifier.
2198
2199         * wtf/ThreadingNone.cpp:
2200         (WTF::createThreadInternal):
2201         (WTF::currentThread):
2202
2203 2009-05-07  Maciej Stachowiak  <mjs@apple.com>
2204
2205         Reviewed by John Honeycutt.
2206         
2207         - enable optimization case im the last patch that I accidentally had disabled.
2208
2209         * jit/JITArithmetic.cpp:
2210         (JSC::JIT::compileFastArithSlow_op_jnless):
2211
2212 2009-05-07  Dmitry Titov  <dimich@chromium.org>
2213
2214         Attempt to fix Win build.
2215
2216         * jit/JITArithmetic.cpp:
2217         (JSC::JIT::compileFastArithSlow_op_jnless):
2218
2219 2009-05-07  Dmitry Titov  <dimich@chromium.org>
2220
2221         Reviewed by Alexey Proskuryakov and Adam Roben.
2222
2223         https://bugs.webkit.org/show_bug.cgi?id=25348
2224         Change WTF::ThreadIdentifier to be an actual (but wrapped) thread id, remove ThreadMap.
2225
2226         * wtf/Threading.h:
2227         (WTF::ThreadIdentifier::ThreadIdentifier):
2228         (WTF::ThreadIdentifier::isValid):
2229         (WTF::ThreadIdentifier::invalidate):
2230         (WTF::ThreadIdentifier::platformId):
2231         ThreadIdentifier is now a class, containing a PlatformThreadIdentifier and
2232         methods that are used across the code on thread ids: construction, comparisons,
2233         check for 'valid' state etc. '0' is used as invalid id, which happens to just work
2234         with all platform-specific thread id implementations.
2235
2236         All the following files repeatedly reflect the new ThreadIdentifier for each platform.
2237         We remove ThreadMap and threadMapMutex from all of them, remove the functions that
2238         populated/searched/cleared the map and add platform-specific comparison operators
2239         for ThreadIdentifier.
2240
2241         * wtf/gtk/ThreadingGtk.cpp:
2242         (WTF::ThreadIdentifier::operator==):
2243         (WTF::ThreadIdentifier::operator!=):
2244         (WTF::initializeThreading):
2245         (WTF::createThreadInternal):
2246         (WTF::waitForThreadCompletion):
2247         (WTF::currentThread):
2248
2249         * wtf/ThreadingNone.cpp:
2250         (WTF::ThreadIdentifier::operator==):
2251         (WTF::ThreadIdentifier::operator!=):
2252
2253         * wtf/ThreadingPthreads.cpp:
2254         (WTF::ThreadIdentifier::operator==):
2255         (WTF::ThreadIdentifier::operator!=):
2256         (WTF::initializeThreading):
2257         (WTF::createThreadInternal):
2258         (WTF::waitForThreadCompletion):
2259         (WTF::detachThread):
2260         (WTF::currentThread):
2261
2262         * wtf/qt/ThreadingQt.cpp:
2263         (WTF::ThreadIdentifier::operator==):
2264         (WTF::ThreadIdentifier::operator!=):
2265         (WTF::initializeThreading):
2266         (WTF::createThreadInternal):
2267         (WTF::waitForThreadCompletion):
2268         (WTF::currentThread):
2269
2270         * wtf/ThreadingWin.cpp:
2271         (WTF::ThreadIdentifier::operator==):
2272         (WTF::ThreadIdentifier::operator!=):
2273         (WTF::initializeThreading):
2274         (WTF::createThreadInternal): All the platforms (except Windows) used a sequential
2275         counter as a thread ID and mapped it into platform ID. Windows was using native thread
2276         id and mapped it into thread handle. Since we can always obtain a thread handle
2277         by thread id, createThread now closes the handle.
2278         (WTF::waitForThreadCompletion): obtains another one using OpenThread(id) API. If can not obtain a handle,
2279         it means the thread already exited.
2280         (WTF::detachThread):
2281         (WTF::currentThread):
2282         (WTF::detachThreadDeprecated): old function, renamed (for Win Safari 4 beta which uses it for now).
2283         (WTF::waitForThreadCompletionDeprecated): same.
2284         (WTF::currentThreadDeprecated): same.
2285         (WTF::createThreadDeprecated): same.
2286
2287         * bytecode/SamplingTool.h:
2288         * bytecode/SamplingTool.cpp: Use DEFINE_STATIC_LOCAL for a static ThreadIdentifier variable, to avoid static constructor.
2289
2290         * JavaScriptCore.exp: export lists - updated the WTF threading functions decorated names
2291         since they now take a different type as a parameter.
2292         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: ditto for Windows, plus added "deprecated" functions
2293         that take old parameter type - turns out public beta of Safari 4 uses those, so they need to be kept along for a while.
2294         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: ditto.
2295
2296 2009-05-07  Maciej Stachowiak  <mjs@apple.com>
2297
2298         Reviewed by Sam Weinig.
2299         
2300         - optimize various cases of branch-fused less
2301         
2302         1% speedup on SunSpider overall
2303         13% speedup on math-cordic
2304
2305         * jit/JIT.cpp:
2306         (JSC::JIT::privateCompileMainPass):
2307         op_loop_if_less: Optimize case of constant as first operand, just as case of constant as
2308         second operand.
2309         op_jnless: Factored out into compileFastArith_op_jnless.
2310         (JSC::JIT::privateCompileSlowCases):
2311         op_jnless: Factored out into compileFastArithSlow_op_jnless.
2312         * jit/JIT.h:
2313         * jit/JITArithmetic.cpp:
2314         (JSC::JIT::compileFastArith_op_jnless): Factored out from main compile loop.
2315         - Generate inline code for comparison of constant immediate int as first operand to another
2316         immediate int, as for loop_if_less
2317
2318         (JSC::JIT::compileFastArithSlow_op_jnless):
2319         - Generate inline code for comparing two floating point numbers.
2320         - Generate code for both cases of comparing a floating point number to a constant immediate 
2321         int.
2322         * bytecode/CodeBlock.cpp:
2323         (JSC::CodeBlock::dump): Fix dumping of op_jnless (tangentially related bugfix).
2324
2325 2009-05-07  Geoffrey Garen  <ggaren@apple.com>
2326
2327         Reviewed by Sam Weinig.
2328         
2329         Added the return address of a stub function to the JITStackFrame abstraction.
2330
2331         * jit/JIT.cpp:
2332         * jit/JIT.h:
2333         * jit/JITStubs.cpp:
2334         (JSC::):
2335         (JSC::StackHack::StackHack):
2336         (JSC::StackHack::~StackHack):
2337         (JSC::returnToThrowTrampoline):
2338         (JSC::JITStubs::cti_op_convert_this):
2339         (JSC::JITStubs::cti_op_end):
2340         (JSC::JITStubs::cti_op_add):
2341         (JSC::JITStubs::cti_op_pre_inc):
2342         (JSC::JITStubs::cti_timeout_check):
2343         (JSC::JITStubs::cti_register_file_check):
2344         (JSC::JITStubs::cti_op_loop_if_less):
2345         (JSC::JITStubs::cti_op_loop_if_lesseq):
2346         (JSC::JITStubs::cti_op_new_object):
2347         (JSC::JITStubs::cti_op_put_by_id_generic):
2348         (JSC::JITStubs::cti_op_get_by_id_generic):
2349         (JSC::JITStubs::cti_op_put_by_id):
2350         (JSC::JITStubs::cti_op_put_by_id_second):
2351         (JSC::JITStubs::cti_op_put_by_id_fail):
2352         (JSC::JITStubs::cti_op_get_by_id):
2353         (JSC::JITStubs::cti_op_get_by_id_second):
2354         (JSC::JITStubs::cti_op_get_by_id_self_fail):
2355         (JSC::JITStubs::cti_op_get_by_id_proto_list):
2356         (JSC::JITStubs::cti_op_get_by_id_proto_list_full):
2357         (JSC::JITStubs::cti_op_get_by_id_proto_fail):
2358         (JSC::JITStubs::cti_op_get_by_id_array_fail):
2359         (JSC::JITStubs::cti_op_get_by_id_string_fail):
2360         (JSC::JITStubs::cti_op_instanceof):
2361         (JSC::JITStubs::cti_op_del_by_id):
2362         (JSC::JITStubs::cti_op_mul):
2363         (JSC::JITStubs::cti_op_new_func):
2364         (JSC::JITStubs::cti_op_call_JSFunction):
2365         (JSC::JITStubs::cti_op_call_arityCheck):
2366         (JSC::JITStubs::cti_vm_dontLazyLinkCall):
2367         (JSC::JITStubs::cti_vm_lazyLinkCall):
2368         (JSC::JITStubs::cti_op_push_activation):
2369         (JSC::JITStubs::cti_op_call_NotJSFunction):
2370         (JSC::JITStubs::cti_op_create_arguments):
2371         (JSC::JITStubs::cti_op_create_arguments_no_params):
2372         (JSC::JITStubs::cti_op_tear_off_activation):
2373         (JSC::JITStubs::cti_op_tear_off_arguments):
2374         (JSC::JITStubs::cti_op_profile_will_call):
2375         (JSC::JITStubs::cti_op_profile_did_call):
2376         (JSC::JITStubs::cti_op_ret_scopeChain):
2377         (JSC::JITStubs::cti_op_new_array):
2378         (JSC::JITStubs::cti_op_resolve):
2379         (JSC::JITStubs::cti_op_construct_JSConstruct):
2380         (JSC::JITStubs::cti_op_construct_NotJSConstruct):
2381         (JSC::JITStubs::cti_op_get_by_val):
2382         (JSC::JITStubs::cti_op_get_by_val_string):
2383         (JSC::JITStubs::cti_op_get_by_val_byte_array):
2384         (JSC::JITStubs::cti_op_resolve_func):
2385         (JSC::JITStubs::cti_op_sub):
2386         (JSC::JITStubs::cti_op_put_by_val):
2387         (JSC::JITStubs::cti_op_put_by_val_array):
2388         (JSC::JITStubs::cti_op_put_by_val_byte_array):
2389         (JSC::JITStubs::cti_op_lesseq):
2390         (JSC::JITStubs::cti_op_loop_if_true):
2391         (JSC::JITStubs::cti_op_load_varargs):
2392         (JSC::JITStubs::cti_op_negate):
2393         (JSC::JITStubs::cti_op_resolve_base):
2394         (JSC::JITStubs::cti_op_resolve_skip):
2395         (JSC::JITStubs::cti_op_resolve_global):
2396         (JSC::JITStubs::cti_op_div):
2397         (JSC::JITStubs::cti_op_pre_dec):
2398         (JSC::JITStubs::cti_op_jless):
2399         (JSC::JITStubs::cti_op_not):
2400         (JSC::JITStubs::cti_op_jtrue):
2401         (JSC::JITStubs::cti_op_post_inc):
2402         (JSC::JITStubs::cti_op_eq):
2403         (JSC::JITStubs::cti_op_lshift):
2404         (JSC::JITStubs::cti_op_bitand):
2405         (JSC::JITStubs::cti_op_rshift):
2406         (JSC::JITStubs::cti_op_bitnot):
2407         (JSC::JITStubs::cti_op_resolve_with_base):
2408         (JSC::JITStubs::cti_op_new_func_exp):
2409         (JSC::JITStubs::cti_op_mod):
2410         (JSC::JITStubs::cti_op_less):
2411         (JSC::JITStubs::cti_op_neq):
2412         (JSC::JITStubs::cti_op_post_dec):
2413         (JSC::JITStubs::cti_op_urshift):
2414         (JSC::JITStubs::cti_op_bitxor):
2415         (JSC::JITStubs::cti_op_new_regexp):
2416         (JSC::JITStubs::cti_op_bitor):
2417         (JSC::JITStubs::cti_op_call_eval):
2418         (JSC::JITStubs::cti_op_throw):
2419         (JSC::JITStubs::cti_op_get_pnames):
2420         (JSC::JITStubs::cti_op_next_pname):
2421         (JSC::JITStubs::cti_op_push_scope):
2422         (JSC::JITStubs::cti_op_pop_scope):
2423         (JSC::JITStubs::cti_op_typeof):
2424         (JSC::JITStubs::cti_op_is_undefined):
2425         (JSC::JITStubs::cti_op_is_boolean):
2426         (JSC::JITStubs::cti_op_is_number):
2427         (JSC::JITStubs::cti_op_is_string):
2428         (JSC::JITStubs::cti_op_is_object):
2429         (JSC::JITStubs::cti_op_is_function):
2430         (JSC::JITStubs::cti_op_stricteq):
2431         (JSC::JITStubs::cti_op_to_primitive):
2432         (JSC::JITStubs::cti_op_strcat):
2433         (JSC::JITStubs::cti_op_nstricteq):
2434         (JSC::JITStubs::cti_op_to_jsnumber):
2435         (JSC::JITStubs::cti_op_in):
2436         (JSC::JITStubs::cti_op_push_new_scope):
2437         (JSC::JITStubs::cti_op_jmp_scopes):
2438         (JSC::JITStubs::cti_op_put_by_index):
2439         (JSC::JITStubs::cti_op_switch_imm):
2440         (JSC::JITStubs::cti_op_switch_char):
2441         (JSC::JITStubs::cti_op_switch_string):
2442         (JSC::JITStubs::cti_op_del_by_val):
2443         (JSC::JITStubs::cti_op_put_getter):
2444         (JSC::JITStubs::cti_op_put_setter):
2445         (JSC::JITStubs::cti_op_new_error):
2446         (JSC::JITStubs::cti_op_debug):
2447         (JSC::JITStubs::cti_vm_throw):
2448         * jit/JITStubs.h:
2449         (JSC::JITStackFrame::returnAddressSlot):
2450
2451 2009-05-07  Darin Adler  <darin@apple.com>
2452
2453         Reviewed by Geoff Garen.
2454
2455         * parser/Lexer.cpp:
2456         (JSC::Lexer::lex): Fix missing braces. This would make us always
2457         take the slower case for string parsing and Visual Studio correctly
2458         noticed unreachable code.
2459
2460 2009-05-07  Darin Adler  <darin@apple.com>
2461
2462         Reviewed by Sam Weinig.
2463
2464         Bug 25589: goto instead of state machine in lexer
2465         https://bugs.webkit.org/show_bug.cgi?id=25589
2466
2467         SunSpider is 0.8% faster.
2468
2469         * parser/Lexer.cpp:
2470         (JSC::Lexer::currentCharacter): Added.
2471         (JSC::Lexer::currentOffset): Changed to call currentCharacter for clarity.
2472         (JSC::Lexer::setCode): Removed code to set now-obsolete m_skipLineEnd.
2473         (JSC::Lexer::shiftLineTerminator): Added. Handles line numbers and the
2474         two-character line terminators.
2475         (JSC::Lexer::makeIdentifier): Changed to take characters and length rather
2476         than a vector, since we now make these directly out of the source buffer
2477         when possible.
2478         (JSC::Lexer::lastTokenWasRestrKeyword): Added.
2479         (JSC::isNonASCIIIdentStart): Broke out the non-inline part.
2480         (JSC::isIdentStart): Moved here.
2481         (JSC::isNonASCIIIdentPart): Broke out the non-inline part.
2482         (JSC::isIdentPart): Moved here.
2483         (JSC::singleEscape): Moved here, and removed some unneeded cases.
2484         (JSC::Lexer::record8): Moved here.
2485         (JSC::Lexer::record16): Moved here.
2486         (JSC::Lexer::lex): Rewrote this whole function to use goto and not use
2487         a state machine. Got rid of most of the local variables. Also rolled the
2488         matchPunctuator function in here.
2489         (JSC::Lexer::scanRegExp): Changed to use the new version of isLineTerminator.
2490         Clear m_buffer16 after using it instead of before.
2491
2492         * parser/Lexer.h: Removed State enum, setDone function, nextLine function,
2493         lookupKeywordFunction, one of the isLineTerminator functions, m_done data member,
2494         m_skipLineEnd data member, and m_state data member. Added shiftLineTerminator
2495         function, currentCharacter function, and changed the arguments to the makeIdentifier
2496         function. Removed one branch from the isLineTerminator function.
2497
2498         * runtime/StringPrototype.cpp:
2499         (JSC::stringProtoFuncReplace): Streamlined the case where we don't replace anything.
2500
2501 2009-05-07  Geoffrey Garen  <ggaren@apple.com>
2502
2503         Reviewed by Gavin Barraclough.
2504
2505         Removed a few more special constants, and replaced them with uses of
2506         the JITStackFrame struct.
2507
2508         Removed one of the two possible definitions of VoidPtrPair. The Mac
2509         definition was more elegant, but SunSpider doesn't think it's any
2510         faster, and it's net less elegant to have two ways of doing things.
2511
2512         * jit/JIT.cpp:
2513         (JSC::JIT::privateCompileMainPass):
2514         (JSC::JIT::privateCompile):
2515         * jit/JITStubs.h:
2516         (JSC::):
2517
2518 2009-05-07  Darin Adler  <darin@apple.com>
2519
2520         * runtime/ScopeChain.h:
2521         (JSC::ScopeChainNode::~ScopeChainNode): Tweak formatting.
2522
2523 2009-05-07  Simon Hausmann  <simon.hausmann@nokia.com>
2524
2525         Reviewed by Tor Arne Vestbø.
2526
2527         Fix the build thread stack base determination build on Symbian,
2528         by moving the code block before PLATFORM(UNIX), which is also
2529         enabled on Symbian builds.
2530
2531         * runtime/Collector.cpp:
2532         (JSC::currentThreadStackBase):
2533
2534 2009-05-07  Oliver Hunt  <oliver@apple.com>
2535
2536         Reviewed by Gavin Barraclough.
2537
2538         Fix crash due to incorrectly using an invalid scopechain 
2539
2540         stringProtoFuncReplace was checking for an exception on a CachedCall
2541         by asking for the cached callframes exception.  Unfortunately this
2542         could crash in certain circumstances as CachedCall does not guarantee
2543         a valid callframe following a call.  Even more unfortunately the check
2544         was entirely unnecessary as there is only a single exception slot per
2545         global data, so it was already checked via the initial exec->hadException()
2546         check.
2547
2548         To make bugs like this more obvious, i've added a debug only destructor
2549         to ScopeChainNode that 0's all of its fields.  This exposed a crash in
2550         the standard javascriptcore tests.
2551
2552         * runtime/ScopeChain.h:
2553         (JSC::ScopeChainNode::~ScopeChainNode):
2554         (JSC::ScopeChain::~ScopeChain):
2555         * runtime/StringPrototype.cpp:
2556         (JSC::stringProtoFuncReplace):
2557
2558 2009-05-07  Gavin Barraclough  <barraclough@apple.com>
2559
2560         Reviewed by Geoff Garen.
2561
2562         Enable op_strcat across += assignments.  This patch allows the lhs of a read/modify node
2563         to be included within the concatenation operation, and also modifies the implementation
2564         of the concatenation to attempt to reuse and cat onto the leftmost string, rather than
2565         always allocating a new empty output string to copy into (as was previously the behaviour).
2566
2567         ~0.5% progression, due to a 3%-3.5% progression on the string tests (particularly validate).
2568
2569         * parser/Nodes.cpp:
2570         (JSC::BinaryOpNode::emitStrcat):
2571         (JSC::emitReadModifyAssignment):
2572         (JSC::ReadModifyResolveNode::emitBytecode):
2573         (JSC::ReadModifyDotNode::emitBytecode):
2574         (JSC::ReadModifyBracketNode::emitBytecode):
2575         * parser/Nodes.h:
2576         * runtime/Operations.h:
2577         (JSC::concatenateStrings):
2578         * runtime/UString.cpp:
2579         (JSC::UString::reserveCapacity):
2580         * runtime/UString.h:
2581
2582 2009-05-07  Simon Hausmann  <simon.hausmann@nokia.com>
2583
2584         Reviewed by Oliver Hunt.
2585
2586         Fix the build on Windows without JIT: interpreter/RegisterFile.h needs
2587         roundUpAllocationSize, which is protected by #if ENABLED(ASSEMBLER).
2588         Moved the #ifdef down and always offer the function.
2589
2590         * jit/ExecutableAllocator.h:
2591
2592 2009-05-06  Geoffrey Garen  <ggaren@apple.com>
2593
2594         Reviewed by Gavin "++" Barraclough.
2595         
2596         Added some abstraction around the JIT stub calling convention by creating
2597         a struct to represent the persistent stack frame JIT code shares with
2598         JIT stubs.
2599         
2600         SunSpider reports no change.
2601
2602         * jit/JIT.h:
2603         * jit/JITStubs.cpp:
2604         (JSC::JITStubs::cti_op_convert_this):
2605         (JSC::JITStubs::cti_op_end):
2606         (JSC::JITStubs::cti_op_add):
2607         (JSC::JITStubs::cti_op_pre_inc):
2608         (JSC::JITStubs::cti_timeout_check):
2609         (JSC::JITStubs::cti_register_file_check):
2610         (JSC::JITStubs::cti_op_loop_if_less):
2611         (JSC::JITStubs::cti_op_loop_if_lesseq):
2612         (JSC::JITStubs::cti_op_new_object):
2613         (JSC::JITStubs::cti_op_put_by_id_generic):
2614         (JSC::JITStubs::cti_op_get_by_id_generic):
2615         (JSC::JITStubs::cti_op_put_by_id):
2616         (JSC::JITStubs::cti_op_put_by_id_second):
2617         (JSC::JITStubs::cti_op_put_by_id_fail):
2618         (JSC::JITStubs::cti_op_get_by_id):
2619         (JSC::JITStubs::cti_op_get_by_id_second):
2620         (JSC::JITStubs::cti_op_get_by_id_self_fail):
2621         (JSC::JITStubs::cti_op_get_by_id_proto_list):
2622         (JSC::JITStubs::cti_op_get_by_id_proto_list_full):
2623         (JSC::JITStubs::cti_op_get_by_id_proto_fail):
2624         (JSC::JITStubs::cti_op_get_by_id_array_fail):
2625         (JSC::JITStubs::cti_op_get_by_id_string_fail):
2626         (JSC::JITStubs::cti_op_instanceof):
2627         (JSC::JITStubs::cti_op_del_by_id):
2628         (JSC::JITStubs::cti_op_mul):
2629         (JSC::JITStubs::cti_op_new_func):
2630         (JSC::JITStubs::cti_op_call_JSFunction):
2631         (JSC::JITStubs::cti_op_call_arityCheck):
2632         (JSC::JITStubs::cti_vm_dontLazyLinkCall):
2633         (JSC::JITStubs::cti_vm_lazyLinkCall):
2634         (JSC::JITStubs::cti_op_push_activation):
2635         (JSC::JITStubs::cti_op_call_NotJSFunction):
2636         (JSC::JITStubs::cti_op_create_arguments):
2637         (JSC::JITStubs::cti_op_create_arguments_no_params):
2638         (JSC::JITStubs::cti_op_tear_off_activation):
2639         (JSC::JITStubs::cti_op_tear_off_arguments):
2640         (JSC::JITStubs::cti_op_profile_will_call):
2641         (JSC::JITStubs::cti_op_profile_did_call):
2642         (JSC::JITStubs::cti_op_ret_scopeChain):
2643         (JSC::JITStubs::cti_op_new_array):
2644         (JSC::JITStubs::cti_op_resolve):
2645         (JSC::JITStubs::cti_op_construct_JSConstruct):
2646         (JSC::JITStubs::cti_op_construct_NotJSConstruct):
2647         (JSC::JITStubs::cti_op_get_by_val):
2648         (JSC::JITStubs::cti_op_get_by_val_string):
2649         (JSC::JITStubs::cti_op_get_by_val_byte_array):
2650         (JSC::JITStubs::cti_op_resolve_func):
2651         (JSC::JITStubs::cti_op_sub):
2652         (JSC::JITStubs::cti_op_put_by_val):
2653         (JSC::JITStubs::cti_op_put_by_val_array):
2654         (JSC::JITStubs::cti_op_put_by_val_byte_array):
2655         (JSC::JITStubs::cti_op_lesseq):
2656         (JSC::JITStubs::cti_op_loop_if_true):
2657         (JSC::JITStubs::cti_op_load_varargs):
2658         (JSC::JITStubs::cti_op_negate):
2659         (JSC::JITStubs::cti_op_resolve_base):
2660         (JSC::JITStubs::cti_op_resolve_skip):
2661         (JSC::JITStubs::cti_op_resolve_global):
2662         (JSC::JITStubs::cti_op_div):
2663         (JSC::JITStubs::cti_op_pre_dec):
2664         (JSC::JITStubs::cti_op_jless):
2665         (JSC::JITStubs::cti_op_not):
2666         (JSC::JITStubs::cti_op_jtrue):
2667         (JSC::JITStubs::cti_op_post_inc):
2668         (JSC::JITStubs::cti_op_eq):
2669         (JSC::JITStubs::cti_op_lshift):
2670         (JSC::JITStubs::cti_op_bitand):
2671         (JSC::JITStubs::cti_op_rshift):
2672         (JSC::JITStubs::cti_op_bitnot):
2673         (JSC::JITStubs::cti_op_resolve_with_base):
2674         (JSC::JITStubs::cti_op_new_func_exp):
2675         (JSC::JITStubs::cti_op_mod):
2676         (JSC::JITStubs::cti_op_less):
2677         (JSC::JITStubs::cti_op_neq):
2678         (JSC::JITStubs::cti_op_post_dec):
2679         (JSC::JITStubs::cti_op_urshift):
2680         (JSC::JITStubs::cti_op_bitxor):
2681         (JSC::JITStubs::cti_op_new_regexp):
2682         (JSC::JITStubs::cti_op_bitor):
2683         (JSC::JITStubs::cti_op_call_eval):
2684         (JSC::JITStubs::cti_op_throw):
2685         (JSC::JITStubs::cti_op_get_pnames):
2686         (JSC::JITStubs::cti_op_next_pname):
2687         (JSC::JITStubs::cti_op_push_scope):
2688         (JSC::JITStubs::cti_op_pop_scope):
2689         (JSC::JITStubs::cti_op_typeof):
2690         (JSC::JITStubs::cti_op_is_undefined):
2691         (JSC::JITStubs::cti_op_is_boolean):
2692         (JSC::JITStubs::cti_op_is_number):
2693         (JSC::JITStubs::cti_op_is_string):
2694         (JSC::JITStubs::cti_op_is_object):
2695         (JSC::JITStubs::cti_op_is_function):
2696         (JSC::JITStubs::cti_op_stricteq):
2697         (JSC::JITStubs::cti_op_to_primitive):
2698         (JSC::JITStubs::cti_op_strcat):
2699         (JSC::JITStubs::cti_op_nstricteq):
2700         (JSC::JITStubs::cti_op_to_jsnumber):
2701         (JSC::JITStubs::cti_op_in):
2702         (JSC::JITStubs::cti_op_push_new_scope):
2703         (JSC::JITStubs::cti_op_jmp_scopes):
2704         (JSC::JITStubs::cti_op_put_by_index):
2705         (JSC::JITStubs::cti_op_switch_imm):
2706         (JSC::JITStubs::cti_op_switch_char):
2707         (JSC::JITStubs::cti_op_switch_string):
2708         (JSC::JITStubs::cti_op_del_by_val):
2709         (JSC::JITStubs::cti_op_put_getter):
2710         (JSC::JITStubs::cti_op_put_setter):
2711         (JSC::JITStubs::cti_op_new_error):
2712         (JSC::JITStubs::cti_op_debug):
2713         (JSC::JITStubs::cti_vm_throw):
2714         * jit/JITStubs.h:
2715         (JSC::):
2716
2717 2009-05-06  Gavin Barraclough  <barraclough@apple.com>
2718
2719         Reviewed by Maciej Stachowiak & Darin Adler.
2720
2721         Improve string concatenation (as coded in JS as a sequence of adds).
2722
2723         Detect patterns corresponding to string concatenation, and change the bytecode
2724         generation to emit a new op_strcat instruction.  By handling the full set of
2725         additions within a single function we do not need allocate JSString wrappers
2726         for intermediate results, and we can calculate the size of the output string
2727         prior to allocating storage, in order to prevent reallocation of the buffer.
2728
2729         1.5%-2% progression on Sunspider, largely due to a 30% progression on date-format-xparb.
2730
2731         * bytecode/CodeBlock.cpp:
2732         (JSC::CodeBlock::dump):
2733             Add new opcodes.
2734         * bytecode/Opcode.h:
2735             Add new opcodes.
2736         * bytecompiler/BytecodeGenerator.cpp:
2737         (JSC::BytecodeGenerator::emitStrcat):
2738         (JSC::BytecodeGenerator::emitToPrimitive):
2739             Add generation of new opcodes.
2740         * bytecompiler/BytecodeGenerator.h:
2741             Add generation of new opcodes.
2742         * interpreter/Interpreter.cpp:
2743         (JSC::Interpreter::privateExecute):
2744             Add implmentation of new opcodes.
2745         * jit/JIT.cpp:
2746         (JSC::JIT::privateCompileMainPass):
2747         (JSC::JIT::privateCompileSlowCases):
2748             Add implmentation of new opcodes.
2749         * jit/JITStubs.cpp:
2750         (JSC::JITStubs::cti_op_to_primitive):
2751         (JSC::JITStubs::cti_op_strcat):
2752             Add implmentation of new opcodes.
2753         * jit/JITStubs.h:
2754             Add implmentation of new opcodes.
2755         * parser/Nodes.cpp:
2756         (JSC::BinaryOpNode::emitStrcat):
2757         (JSC::BinaryOpNode::emitBytecode):
2758         (JSC::ReadModifyResolveNode::emitBytecode):
2759             Add generation of new opcodes.
2760         * parser/Nodes.h:
2761         (JSC::ExpressionNode::):
2762         (JSC::AddNode::):
2763             Add methods to allow identification of add nodes.
2764         * parser/ResultType.h:
2765         (JSC::ResultType::definitelyIsString):
2766         (JSC::ResultType::forAdd):
2767             Fix error in detection of adds that will produce string results.
2768         * runtime/Operations.h:
2769         (JSC::concatenateStrings):
2770             Add implmentation of new opcodes.
2771         * runtime/UString.cpp:
2772         (JSC::UString::appendNumeric):
2773             Add methods to append numbers to an existing string.
2774         * runtime/UString.h:
2775         (JSC::UString::Rep::createEmptyBuffer):
2776         (JSC::UString::BaseString::BaseString):
2777             Add support for creating an empty string with a non-zero capacity available in the BaseString.
2778
2779 2009-05-06  Darin Adler  <darin@apple.com>
2780
2781         Reviewed by Sam Weinig.
2782
2783         Made RefCounted::m_refCount private.
2784
2785         * runtime/Structure.h: Removed addressOfCount.
2786         * wtf/RefCounted.h: Made m_refCount private.
2787         Added addressOfCount.
2788
2789 2009-05-06  Darin Adler  <darin@apple.com>
2790
2791         Fixed assertion seen a lot!
2792
2793         * parser/Nodes.cpp:
2794         (JSC::FunctionBodyNode::~FunctionBodyNode): Removed now-bogus assertion.
2795
2796 2009-05-06  Darin Adler  <darin@apple.com>
2797
2798         Working with Sam Weinig.
2799
2800         Redo parse tree constructor optimization without breaking the Windows
2801         build the way I did yesterday. The previous try broke the build by adding
2802         an include of Lexer.h and all its dependencies that had to work outside
2803         the JavaScriptCore project.
2804
2805         * GNUmakefile.am: Added NodeConstructors.h.
2806         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto.
2807
2808         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
2809         Removed byteocde directory -- we no longer are trying to include Lexer.h
2810         outside JavaScriptCore.
2811
2812         * JavaScriptCore.xcodeproj/project.pbxproj: Change SegmentedVector.h
2813         and Lexer.h back to internal files. Added NodeConstructors.h.
2814
2815         * parser/Grammar.y: Added include of NodeConstructors.h.
2816         Changed use of ConstDeclNode to use public functions.
2817
2818         * parser/NodeConstructors.h: Copied from parser/Nodes.h.
2819         Just contains the inlined constructors now.
2820
2821         * parser/Nodes.cpp: Added include of NodeConstructors.h.
2822         Moved node constructors into the header.
2823         (JSC::FunctionBodyNode::FunctionBodyNode): Removed m_refCount
2824         initialization.
2825
2826         * parser/Nodes.h: Removed all the constructor definitions, and also
2827         removed the JSC_FAST_CALL from them since these are all inlined, so the
2828         calling convention is irrelevant. Made more things private. Used a data
2829         member for operator opcodes instead of a virtual function. Removed the
2830         special FunctionBodyNode::ref/deref functions since the default functions
2831         are now just as fast.
2832
2833         * runtime/FunctionConstructor.cpp:
2834         (JSC::extractFunctionBody): Fixed types here so we don't typecast until
2835         after we do type checking.
2836
2837 2009-05-06  Simon Hausmann  <simon.hausmann@nokia.com>
2838
2839         Reviewed by Ariya Hidayat.
2840
2841         Fix the Qt build on Windows.
2842
2843         * JavaScriptCore.pri: Define BUILDING_JavaScriptCore/WTF to get the meaning
2844         of the JS_EXPORTDATA macros correct
2845
2846 2009-05-06  Simon Hausmann  <simon.hausmann@nokia.com>
2847
2848         Reviewed by Ariya Hidayat.
2849
2850         Enable the JIT for the Qt build on Windows.
2851
2852         * JavaScriptCore.pri:
2853
2854 2009-05-06  Simon Hausmann  <simon.hausmann@nokia.com>
2855
2856         Reviewed by Tor Arne Vestbø.
2857
2858         Tweak JavaScriptCore.pri for being able to override the generated sources dir for the
2859         generated_files target.
2860
2861         * JavaScriptCore.pri:
2862
2863 2009-05-06  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
2864
2865         Reviewed by Simon Hausmann.
2866
2867         Build QtWebKit as a framework on Mac
2868
2869         This implies both debug and release build by default, unless
2870         one of the --debug or --release config options are passed to
2871         the build-webkit script.
2872
2873         Frameworks can be disabled by passing CONFIG+=webkit_no_framework
2874         to the build-webkit script.
2875
2876         To be able to build both debug and release targets in parallel
2877         we have to use separate output directories for the generated
2878         sources, which is not optimal, but required to avoid race conditions.
2879
2880         An optimization would be to only require this spit-up on Mac.
2881
2882         * JavaScriptCore.pri:
2883         * JavaScriptCore.pro:
2884         * jsc.pro:
2885
2886 2009-05-06  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
2887
2888         Reviewed by Simon Hausmann.
2889
2890         [Qt] Use $$GENERATED_SOURCES_DIR as output when running bison
2891
2892         A couple of the generators left the bison output file in the source
2893         tree, and then moved it into $$GENERATED_SOURCES_DIR, which did not
2894         work well when building release and debug configurations in parallel.
2895
2896         * JavaScriptCore.pri:
2897
2898 2009-05-05  Geoffrey Garen  <ggaren@apple.com>
2899
2900         Reviewed by Maciej Stachowiak.
2901         
2902         Simplified a bit of codegen.
2903
2904         * jit/JIT.cpp:
2905         (JSC::JIT::privateCompileMainPass):
2906
2907 2009-05-05  Geoffrey Garen  <ggaren@apple.com>
2908
2909         Reviewed by Cameron Zwarich.
2910         
2911         Moved all the JIT stub related code into one place.
2912
2913         * jit/JIT.cpp:
2914         * jit/JIT.h:
2915         * jit/JITCode.h:
2916         * jit/JITStubs.cpp:
2917         (JSC::):
2918         * jit/JITStubs.h:
2919
2920 2009-05-05  Sam Weinig  <sam@webkit.org>
2921
2922         Try to fix Windows build.
2923
2924         Move Node constructor to the .cpp file.
2925
2926         * parser/Nodes.cpp: 
2927         * parser/Nodes.h:
2928
2929 2009-05-05  Darin Adler  <darin@apple.com>
2930
2931         Try to fix Windows build.
2932
2933         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2934         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
2935
2936         Try to fix Mac build.
2937
2938         * JavaScriptCore.xcodeproj/project.pbxproj: Made SegmentedVector.h private.
2939
2940 2009-05-05  Darin Adler  <darin@apple.com>
2941
2942         Try to fix Mac build.
2943
2944         * JavaScriptCore.xcodeproj/project.pbxproj: Made Lexer.h private.
2945
2946 2009-05-05  Darin Adler  <darin@apple.com>
2947
2948         Reviewed by Sam Weinig.
2949
2950         Bug 25569: make ParserRefCounted use conventional reference counting
2951         https://bugs.webkit.org/show_bug.cgi?id=25569
2952
2953         SunSpider speedup of about 1.6%.
2954
2955         * JavaScriptCore.exp: Updated.
2956
2957         * parser/Nodes.cpp:
2958         (JSC::NodeReleaser::releaseAllNodes): ALWAYS_INLINE.
2959         (JSC::NodeReleaser::adopt): Ditto.
2960         (JSC::ParserRefCounted::ParserRefCounted): Removed most of the code.
2961         Add the object to a Vector<RefPtr> that gets cleared after parsing.
2962         (JSC::ParserRefCounted::~ParserRefCounted): Removed most of the code.
2963
2964         * parser/Nodes.h: Made ParserRefCounted inherit from RefCounted and
2965         made inline versions of the constructor and destructor. Made the
2966         Node constructor inline.
2967
2968         * parser/Parser.cpp:
2969         (JSC::Parser::parse): Call globalData->parserObjects.shrink(0) after
2970         parsing, where it used to call ParserRefCounted::deleteNewObjects.
2971
2972         * runtime/JSGlobalData.cpp:
2973         (JSC::JSGlobalData::JSGlobalData): Eliminated code to manage the
2974         newParserObjects and parserObjectExtraRefCounts.
2975         (JSC::JSGlobalData::~JSGlobalData): Ditto.
2976
2977         * runtime/JSGlobalData.h: Replaced the HashSet and HashCountedSet
2978         with a Vector.
2979
2980         * wtf/PassRefPtr.h:
2981         (WTF::PassRefPtr::~PassRefPtr): The most common thing to do with a
2982         PassRefPtr in hot code is to pass it and then destroy it once it's
2983         set to zero. Help the optimizer by telling it that's true.
2984
2985 2009-05-05  Xan Lopez  <xlopez@igalia.com> and Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
2986
2987         Reviewed by Oliver Hunt.
2988
2989         Disable the NativeFunctionWrapper for all non-Mac ports for now,
2990         as it is also crashing on Linux/x86.
2991
2992         * runtime/NativeFunctionWrapper.h:
2993
2994 2009-05-05  Steve Falkenburg  <sfalken@apple.com>
2995
2996         Fix build.
2997
2998         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2999         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
3000
3001 2009-05-05  Oliver Hunt  <oliver@apple.com>
3002
3003         Reviewed by Maciej Stachowiak.
3004
3005         Expose toThisObject for the DOM Window
3006
3007         * JavaScriptCore.exp:
3008
3009 2009-05-05  Oliver Hunt  <oliver@apple.com>
3010
3011         Reviewed by NOBODY (Make windows go again until i work out the
3012         accursed calling convention).
3013
3014         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3015         * jit/JIT.cpp:
3016         * runtime/NativeFunctionWrapper.h:
3017
3018 2009-05-05  Oliver Hunt  <oliver@apple.com>
3019
3020         Reviewed by NOBODY (Fix windows debug builds).
3021
3022         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
3023
3024 2009-05-05  Oliver Hunt  <oliver@apple.com>
3025
3026         Reviewed by NOBODY (Hopefully the last fix).
3027
3028         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3029
3030 2009-05-05  Oliver Hunt  <oliver@apple.com>
3031
3032         Reviewed by NOBODY (Fix the build fix caused by a different build fix).
3033
3034         * parser/Nodes.cpp:
3035         * parser/Nodes.h:
3036
3037 2009-05-05  Oliver Hunt  <oliver@apple.com>
3038
3039         Reviewed by NOBODY (No idea how my changes could have broken these).
3040
3041         * runtime/DatePrototype.cpp:
3042         * runtime/RegExpObject.cpp:
3043
3044 2009-05-05  Oliver Hunt  <oliver@apple.com>
3045
3046         Reviewed by NOBODY (Why should i expect msvc to list all the errors in a file?).
3047
3048         * parser/Nodes.cpp:
3049
3050 2009-05-05  Oliver Hunt  <oliver@apple.com>
3051
3052         Reviewed by NOBODY (Fix warning, and another missing include).
3053
3054         * jit/JIT.cpp:
3055         * parser/Nodes.h:
3056
3057 2009-05-05  Oliver Hunt  <oliver@apple.com>
3058
3059         Reviewed by NOBODY (More build fixes).
3060
3061         * runtime/ErrorPrototype.cpp:
3062         * runtime/JSGlobalObject.cpp:
3063         * runtime/NumberPrototype.cpp:
3064         * runtime/ObjectPrototype.cpp:
3065         * runtime/StringConstructor.cpp:
3066
3067 2009-05-05  Oliver Hunt  <oliver@apple.com>
3068
3069         Reviewed by NOBODY (Will the fixes never end?).
3070
3071         * runtime/FunctionPrototype.h:
3072         * runtime/Lookup.cpp:
3073
3074 2009-05-05  Oliver Hunt  <oliver@apple.com>
3075
3076         Reviewed by NOBODY (More build fixes).
3077
3078         * jit/JIT.cpp:
3079
3080 2009-05-05  Oliver Hunt  <oliver@apple.com>
3081
3082         Reviewed by NOBODY (More build fixing).
3083
3084         * runtime/CallData.h:
3085
3086 2009-05-05  Oliver Hunt  <oliver@apple.com>
3087
3088         Reviewed by NOBODY (Build fix).
3089
3090         * runtime/ArrayConstructor.cpp:
3091         * runtime/BooleanPrototype.cpp:
3092         * runtime/DateConstructor.cpp:
3093         * runtime/Error.cpp:
3094         * runtime/ObjectConstructor.cpp:
3095         * runtime/RegExpPrototype.cpp:
3096
3097 2009-05-05  Oliver Hunt  <oliver@apple.com>
3098
3099         Reviewed by NOBODY (Buildfix).
3100
3101         Add missing file
3102
3103         * runtime/NativeFunctionWrapper.h: Copied from JavaScriptCore/jit/ExecutableAllocator.cpp.
3104
3105 2009-05-05  Oliver Hunt  <oliver@apple.com>
3106
3107         Reviewed by Gavin Barraclough.
3108
3109         Bug 25559: Improve native function call performance
3110         <https://bugs.webkit.org/show_bug.cgi?id=25559>
3111
3112         In order to cache calls to native functions we now make the standard
3113         prototype functions use a small assembly thunk that converts the JS
3114         calling convention into the native calling convention.  As this is
3115         only beneficial in the JIT we use the NativeFunctionWrapper typedef
3116         to alternate between PrototypeFunction and JSFunction to keep the
3117         code sane.  This change from PrototypeFunction to NativeFunctionWrapper
3118         is the bulk of this patch.
3119
3120         * JavaScriptCore.exp:
3121         * JavaScriptCore.xcodeproj/project.pbxproj:
3122         * assembler/MacroAssemblerX86Common.h:
3123         (JSC::MacroAssemblerX86Common::call):
3124         * assembler/MacroAssemblerX86_64.h:
3125         (JSC::MacroAssemblerX86_64::addPtr):
3126         * assembler/X86Assembler.h:
3127         (JSC::X86Assembler::leaq_mr):
3128         (JSC::X86Assembler::call_m):
3129         * interpreter/Interpreter.cpp:
3130         (JSC::Interpreter::execute):
3131         (JSC::Interpreter::prepareForRepeatCall):
3132         * jit/JIT.cpp:
3133         (JSC::JIT::privateCompileCTIMachineTrampolines):
3134         * jit/JIT.h:
3135         (JSC::JIT::compileCTIMachineTrampolines):
3136         * jit/JITCall.cpp:
3137         (JSC::JIT::linkCall):
3138         (JSC::JIT::compileOpCallInitializeCallFrame):
3139         (JSC::JIT::compileOpCall):
3140         * jit/JITCode.h:
3141         (JSC::JITCode::operator bool):
3142         * jit/JITInlineMethods.h:
3143         (JSC::JIT::emitGetFromCallFrameHeader):
3144         (JSC::JIT::emitGetFromCallFrameHeader32):
3145         * jit/JITStubs.cpp:
3146         (JSC::JITStubs::JITStubs):
3147         (JSC::JITStubs::cti_op_call_JSFunction):
3148         (JSC::JITStubs::cti_vm_dontLazyLinkCall):
3149         (JSC::JITStubs::cti_vm_lazyLinkCall):
3150         (JSC::JITStubs::cti_op_construct_JSConstruct):
3151         * jit/JITStubs.h:
3152         (JSC::JITStubs::ctiNativeCallThunk):
3153         * jsc.cpp:
3154         (GlobalObject::GlobalObject):
3155         * parser/Nodes.cpp:
3156         (JSC::FunctionBodyNode::FunctionBodyNode):
3157         (JSC::FunctionBodyNode::createNativeThunk):
3158         (JSC::FunctionBodyNode::generateJITCode):
3159         * parser/Nodes.h:
3160         (JSC::FunctionBodyNode::):
3161         (JSC::FunctionBodyNode::generatedJITCode):
3162         (JSC::FunctionBodyNode::jitCode):
3163         * profiler/Profiler.cpp:
3164         (JSC::Profiler::createCallIdentifier):
3165         * runtime/ArgList.h:
3166         * runtime/ArrayPrototype.cpp:
3167         (JSC::isNumericCompareFunction):
3168         * runtime/BooleanPrototype.cpp:
3169         (JSC::BooleanPrototype::BooleanPrototype):
3170         * runtime/DateConstructor.cpp:
3171         (JSC::DateConstructor::DateConstructor):
3172         * runtime/ErrorPrototype.cpp:
3173         (JSC::ErrorPrototype::ErrorPrototype):
3174         * runtime/FunctionPrototype.cpp:
3175         (JSC::FunctionPrototype::addFunctionProperties):
3176         (JSC::functionProtoFuncToString):
3177         * runtime/FunctionPrototype.h:
3178         * runtime/JSFunction.cpp:
3179         (JSC::JSFunction::JSFunction):
3180         (JSC::JSFunction::~JSFunction):
3181         (JSC::JSFunction::mark):
3182         (JSC::JSFunction::getCallData):
3183         (JSC::JSFunction::call):
3184         (JSC::JSFunction::argumentsGetter):
3185         (JSC::JSFunction::callerGetter):
3186         (JSC::JSFunction::lengthGetter):
3187         (JSC::JSFunction::getOwnPropertySlot):
3188         (JSC::JSFunction::put):
3189         (JSC::JSFunction::deleteProperty):
3190         (JSC::JSFunction::getConstructData):
3191         (JSC::JSFunction::construct):
3192         * runtime/JSFunction.h:
3193         (JSC::JSFunction::JSFunction):
3194         (JSC::JSFunction::setScope):
3195         (JSC::JSFunction::scope):
3196         (JSC::JSFunction::isHostFunction):
3197         (JSC::JSFunction::scopeChain):
3198         (JSC::JSFunction::clearScopeChain):
3199         (JSC::JSFunction::setScopeChain):
3200         (JSC::JSFunction::nativeFunction):
3201         (JSC::JSFunction::setNativeFunction):
3202         * runtime/JSGlobalData.cpp:
3203         (JSC::JSGlobalData::~JSGlobalData):
3204         (JSC::JSGlobalData::createNativeThunk):
3205         * runtime/JSGlobalData.h:
3206         (JSC::JSGlobalData::nativeFunctionThunk):
3207         * runtime/JSGlobalObject.cpp:
3208         (JSC::JSGlobalObject::reset):
3209         * runtime/JSGlobalObject.h:
3210         * runtime/Lookup.cpp:
3211         (JSC::setUpStaticFunctionSlot):
3212         * runtime/Lookup.h:
3213         * runtime/NumberPrototype.cpp:
3214         (JSC::NumberPrototype::NumberPrototype):
3215         * runtime/ObjectPrototype.cpp:
3216         (JSC::ObjectPrototype::ObjectPrototype):
3217         * runtime/RegExpPrototype.cpp:
3218         (JSC::RegExpPrototype::RegExpPrototype):
3219         * runtime/StringConstructor.cpp:
3220         (JSC::StringConstructor::StringConstructor):
3221
3222 2009-05-05  Gavin Barraclough  <barraclough@apple.com>
3223
3224         Reviewed by Oliver Hunt.
3225
3226         For convenience, let the sampling flags tool clear multiple flags at once.
3227
3228         * jsc.cpp:
3229         (GlobalObject::GlobalObject):
3230         (functionSetSamplingFlags):
3231         (functionClearSamplingFlags):
3232
3233 2009-05-04  Maciej Stachowiak  <mjs@apple.com>
3234
3235         Rubber stamped by Gavin.
3236
3237         - inline Vector::resize for a ~1.5% speedup on string-tagcloud
3238
3239         * wtf/Vector.h:
3240         (WTF::Vector::resize): Inline
3241
3242 2009-05-03  Steve Falkenburg  <sfalken@apple.com>
3243
3244         Windows build fix.
3245
3246         * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln:
3247
3248 2009-05-03  Mark Rowe  <mrowe@apple.com>
3249
3250         Fix the 64-bit build.
3251
3252         * API/APICast.h:
3253         (toJS):
3254         (toRef):
3255         * runtime/JSNumberCell.cpp:
3256         (JSC::jsAPIMangledNumber):
3257         * runtime/JSNumberCell.h:
3258
3259 2009-05-02  Sam Weinig  <sam@webkit.org>
3260
3261         Roll JSC API number marshaling back in one last time (I hope).
3262
3263 2009-05-03  Sam Weinig  <sam@webkit.org>
3264
3265         Roll JSC API number marshaling back out. It still breaks windows.
3266
3267 2009-05-03  Sam Weinig  <sam@webkit.org>
3268
3269         Roll JSC API number marshaling back in.
3270
3271 2009-05-02  Darin Adler  <darin@apple.com>
3272
3273         Reviewed by Maciej Stachowiak.
3274
3275         Bug 25519: streamline lexer by handling BOMs differently
3276         https://bugs.webkit.org/show_bug.cgi?id=25519
3277
3278         Roughly 1% faster SunSpider.
3279
3280         * parser/Grammar.y: Tweak formatting a bit.
3281
3282         * parser/Lexer.cpp:
3283         (JSC::Lexer::Lexer): Remove unnnecessary initialization of data members
3284         that are set up by setCode.
3285         (JSC::Lexer::currentOffset): Added. Used where the old code would look at
3286         m_currentOffset.
3287         (JSC::Lexer::shift1): Replaces the old shift function. No longer does anything
3288         to handle BOM characters.
3289         (JSC::Lexer::shift2): Ditto.
3290         (JSC::Lexer::shift3): Ditto.
3291         (JSC::Lexer::shift4): Ditto.
3292         (JSC::Lexer::setCode): Updated for name change from yylineno to m_line.
3293         Removed now-unused m_eatNextIdentifier, m_stackToken, and m_restrKeyword.
3294         Replaced m_skipLF and m_skipCR with m_skipLineEnd. Replaced the old
3295         m_length with m_codeEnd and m_currentOffset with m_codeStart. Added code
3296         to scan for a BOM character and call copyCodeWithoutBOMs() if we find any.
3297         (JSC::Lexer::copyCodeWithoutBOMs): Added.
3298         (JSC::Lexer::nextLine): Updated for name change from yylineno to m_line.
3299         (JSC::Lexer::makeIdentifier): Moved up higher in the file.
3300         (JSC::Lexer::matchPunctuator): Moved up higher in the file and changed to
3301         use a switch statement instead of just if statements.
3302         (JSC::Lexer::isLineTerminator): Moved up higher in the file and changed to
3303         have fewer branches.
3304         (JSC::Lexer::lastTokenWasRestrKeyword): Added. This replaces the old
3305         m_restrKeyword boolean.
3306         (JSC::Lexer::isIdentStart): Moved up higher in the file. Changed to use
3307         fewer branches in the ASCII but not identifier case.
3308         (JSC::Lexer::isIdentPart): Ditto.
3309         (JSC::Lexer::singleEscape): Moved up higher in the file.
3310         (JSC::Lexer::convertOctal): Moved up higher in the file.
3311         (JSC::Lexer::convertHex): Moved up higher in the file. Changed to use
3312         toASCIIHexValue instead of rolling our own here.
3313         (JSC::Lexer::convertUnicode): Ditto.
3314         (JSC::Lexer::record8): Moved up higher in the file.
3315         (JSC::Lexer::record16): Moved up higher in the file.
3316         (JSC::Lexer::lex): Changed type of stringType to int. Replaced m_skipLF
3317         and m_skipCR with m_skipLineEnd, which requires fewer branches in the
3318         main lexer loop. Use currentOffset instead of m_currentOffset. Removed
3319         unneeded m_stackToken. Use isASCIIDigit instead of isDecimalDigit.
3320         Split out the two cases for InIdentifierOrKeyword and InIdentifier.
3321         Added special case tight loops for identifiers and other simple states.
3322         Removed a branch from the code that sets m_atLineStart to false using goto.
3323         Streamlined the number-handling code so we don't check for the same types
3324         twice for non-numeric cases and don't add a null to m_buffer8 when it's
3325         not being used. Removed m_eatNextIdentifier, which wasn't working anyway,
3326         and m_restrKeyword, which is redundant with m_lastToken. Set the
3327         m_delimited flag without using a branch.
3328         (JSC::Lexer::scanRegExp): Tweaked style a bit.
3329         (JSC::Lexer::clear): Clear m_codeWithoutBOMs so we don't use memory after
3330         parsing. Clear out UString objects in the more conventional way.
3331         (JSC::Lexer::sourceCode): Made this no-longer inline since it has more
3332         work to do in the case where we stripped BOMs.
3333
3334         * parser/Lexer.h: Renamed yylineno to m_lineNumber. Removed convertHex
3335         function, which is the same as toASCIIHexValue. Removed isHexDigit
3336         function, which is the same as isASCIIHedDigit. Replaced shift with four
3337         separate shift functions. Removed isWhiteSpace function that passes
3338         m_current, instead just passing m_current explicitly. Removed isOctalDigit,
3339         which is the same as isASCIIOctalDigit. Eliminated unused arguments from
3340         matchPunctuator. Added copyCoodeWithoutBOMs and currentOffset. Moved the
3341         makeIdentifier function out of the header. Added lastTokenWasRestrKeyword
3342         function. Added new constants for m_skipLineEnd. Removed unused yycolumn,
3343         m_restrKeyword, m_skipLF, m_skipCR, m_eatNextIdentifier, m_stackToken,
3344         m_position, m_length, m_currentOffset, m_nextOffset1, m_nextOffset2,
3345         m_nextOffset3. Added m_skipLineEnd, m_codeStart, m_codeEnd, and
3346         m_codeWithoutBOMs.
3347
3348         * parser/SourceProvider.h: Added hasBOMs function. In the future this can
3349         be used to tell the lexer about strings known not to have BOMs.
3350
3351         * runtime/JSGlobalObjectFunctions.cpp:
3352         (JSC::globalFuncUnescape): Changed to use isASCIIHexDigit.
3353
3354         * wtf/ASCIICType.h: Added using statements to match the design of the
3355         other WTF headers.
3356
3357 2009-05-02  Ada Chan  <adachan@apple.com>
3358
3359         Fix windows build (when doing a clean build)
3360
3361         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
3362
3363 2009-05-02  Geoffrey Garen  <ggaren@apple.com>
3364
3365         Reviewed by Sam Weinig.
3366
3367         Simplified null-ish JSValues.
3368         
3369         Replaced calls to noValue() with calls to JSValue() (which is what
3370         noValue() returned). Removed noValue().
3371         
3372         Replaced almost all uses of jsImpossibleValue() with uses of JSValue().
3373         Its one remaining use is for construction of hash table deleted values.
3374         For that specific task, I made a new, private constructor with a special
3375         tag. Removed jsImpossibleValue().
3376         
3377         Removed "JSValue()" initialiazers, since default construction happens...
3378         by default.
3379
3380         * API/JSCallbackObjectFunctions.h:
3381         (JSC::::call):
3382         * bytecompiler/BytecodeGenerator.cpp:
3383         (JSC::BytecodeGenerator::emitLoad):
3384         * bytecompiler/BytecodeGenerator.h:
3385         * debugger/DebuggerCallFrame.cpp:
3386         (JSC::DebuggerCallFrame::evaluate):
3387         * debugger/DebuggerCallFrame.h:
3388         (JSC::DebuggerCallFrame::DebuggerCallFrame):
3389         * interpreter/CallFrame.h:
3390         (JSC::ExecState::clearException):
3391         * interpreter/Interpreter.cpp:
3392         (JSC::Interpreter::privateExecute):
3393         (JSC::Interpreter::retrieveLastCaller):
3394         * interpreter/Register.h:
3395         (JSC::Register::Register):
3396         * jit/JITCall.cpp:
3397         (JSC::JIT::unlinkCall):
3398         (JSC::JIT::compileOpCallInitializeCallFrame):
3399         (JSC::JIT::compileOpCall):
3400         * jit/JITStubs.cpp:
3401         (JSC::JITStubs::cti_op_call_eval):
3402         (JSC::JITStubs::cti_vm_throw):
3403         * profiler/Profiler.cpp:
3404         (JSC::Profiler::willExecute):
3405         (JSC::Profiler::didExecute):
3406         * runtime/ArrayPrototype.cpp:
3407         (JSC::getProperty):
3408         * runtime/Completion.cpp:
3409         (JSC::evaluate):
3410         * runtime/Completion.h:
3411         (JSC::Completion::Completion):
3412         * runtime/GetterSetter.cpp:
3413         (JSC::GetterSetter::getPrimitiveNumber):
3414         * runtime/JSArray.cpp:
3415         (JSC::JSArray::putSlowCase):
3416         (JSC::JSArray::deleteProperty):
3417         (JSC::JSArray::increaseVectorLength):
3418         (JSC::JSArray::setLength):
3419         (JSC::JSArray::pop):
3420         (JSC::JSArray::sort):
3421         (JSC::JSArray::compactForSorting):
3422         * runtime/JSCell.cpp:
3423         (JSC::JSCell::getJSNumber):
3424         * runtime/JSCell.h:
3425         (JSC::JSValue::getJSNumber):
3426         * runtime/JSGlobalData.cpp:
3427         (JSC::JSGlobalData::JSGlobalData):
3428         * runtime/JSImmediate.h:
3429         (JSC::JSImmediate::fromNumberOutsideIntegerRange):
3430         (JSC::JSImmediate::from):
3431         * runtime/JSNumberCell.cpp:
3432         (JSC::jsNumberCell):
3433         * runtime/JSObject.cpp:
3434         (JSC::callDefaultValueFunction):
3435         * runtime/JSObject.h:
3436         (JSC::JSObject::getDirect):
3437         * runtime/JSPropertyNameIterator.cpp:
3438         (JSC::JSPropertyNameIterator::toPrimitive):
3439         * runtime/JSPropertyNameIterator.h:
3440         (JSC::JSPropertyNameIterator::next):
3441         * runtime/JSValue.h:
3442         (JSC::JSValue::):
3443         (JSC::JSValueHashTraits::constructDeletedValue):
3444         (JSC::JSValueHashTraits::isDeletedValue):
3445         (JSC::JSValue::JSValue):
3446         * runtime/JSWrapperObject.h:
3447         (JSC::JSWrapperObject::JSWrapperObject):
3448         * runtime/Operations.h:
3449         (JSC::resolveBase):
3450         * runtime/PropertySlot.h:
3451         (JSC::PropertySlot::clearBase):
3452         (JSC::PropertySlot::clearValue):
3453
3454 2009-05-02  Maciej Stachowiak  <mjs@apple.com>
3455
3456         Reviewed by Cameron Zwarich.
3457
3458         - speed up the lexer in various ways
3459
3460         ~2% command-line SunSpider speedup
3461
3462         * parser/Lexer.cpp:
3463         (JSC::Lexer::setCode): Moved below shift() so it can inline.
3464         (JSC::Lexer::scanRegExp):  Use resize(0) instead of clear() on Vectors, since the intent
3465         here is not to free the underlying buffer.
3466         (JSC::Lexer::lex): ditto; also, change the loop logic a bit for the main lexing loop
3467         to avoid branching on !m_done twice per iteration. Now we only check it once.
3468         (JSC::Lexer::shift): Make this ALWAYS_INLINE and tag an unusual branch as UNLIKELY
3469         * parser/Lexer.h:
3470         (JSC::Lexer::makeIdentifier): force to be ALWAYS_INLINE
3471         * wtf/Vector.h:
3472         (WTF::::append): force to be ALWAYS_INLINE (may have helped in ways other than parsing but it wasn't
3473         getting inlined in a hot code path in the lexer)
3474
3475 2009-05-01  Steve Falkenburg  <sfalken@apple.com>
3476
3477         Windows build fix.
3478
3479         * JavaScriptCore.vcproj/JavaScriptCore.make:
3480
3481 2009-05-01  Sam Weinig  <sam@webkit.org>
3482
3483         Fix 64bit build.
3484
3485         * runtime/JSNumberCell.h:
3486         (JSC::JSValue::JSValue):
3487         * runtime/JSValue.h:
3488         (JSC::jsNumber):
3489
3490 2009-05-01  Sam Weinig  <sam@webkit.org>
3491
3492         Roll out JavaScriptCore API number marshaling.
3493
3494         * API/APICast.h:
3495         (toJS):
3496         (toRef):
3497         * API/JSBase.cpp:
3498         (JSEvaluateScript):
3499         (JSCheckScriptSyntax):
3500         * API/JSCallbackConstructor.cpp:
3501         (JSC::constructJSCallback):
3502         * API/JSCallbackFunction.cpp:
3503         (JSC::JSCallbackFunction::call):
3504         * API/JSCallbackObjectFunctions.h:
3505         (JSC::::getOwnPropertySlot):
3506         (JSC::::put):
3507         (JSC::::deleteProperty):
3508         (JSC::::construct):
3509         (JSC::::hasInstance):
3510         (JSC::::call):
3511         (JSC::::toNumber):
3512         (JSC::::toString):
3513         (JSC::::staticValueGetter):
3514         (JSC::::callbackGetter):
3515         * API/JSObjectRef.cpp:
3516         (JSObjectMakeFunction):
3517         (JSObjectMakeArray):
3518         (JSObjectMakeDate):
3519         (JSObjectMakeError):
3520         (JSObjectMakeRegExp):
3521         (JSObjectGetPrototype):
3522         (JSObjectSetPrototype):
3523         (JSObjectGetProperty):
3524         (JSObjectSetProperty):
3525         (JSObjectGetPropertyAtIndex):
3526         (JSObjectSetPropertyAtIndex):
3527         (JSObjectDeleteProperty):
3528         (JSObjectCallAsFunction):
3529         (JSObjectCallAsConstructor):
3530         * API/JSValueRef.cpp:
3531         (JSValueGetType):
3532         (JSValueIsUndefined):
3533         (JSValueIsNull):
3534         (JSValueIsBoolean):
3535         (JSValueIsNumber):
3536         (JSValueIsString):
3537         (JSValueIsObject):
3538         (JSValueIsObjectOfClass):
3539         (JSValueIsEqual):
3540         (JSValueIsStrictEqual):
3541         (JSValueIsInstanceOfConstructor):
3542         (JSValueMakeUndefined):
3543         (JSValueMakeNull):
3544         (JSValueMakeBoolean):
3545         (JSValueMakeNumber):
3546         (JSValueMakeString):
3547         (JSValueToBoolean):
3548         (JSValueToNumber):
3549         (JSValueToStringCopy):
3550         (JSValueToObject):
3551         (JSValueProtect):
3552         (JSValueUnprotect):
3553         * JavaScriptCore.exp:
3554         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3555         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
3556         * runtime/JSNumberCell.cpp:
3557         * runtime/JSNumberCell.h:
3558         * runtime/JSValue.h:
3559
3560 2009-05-01  Sam Weinig  <sam@webkit.org>
3561
3562         Fix windows build.
3563
3564         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3565         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
3566
3567 2009-05-01  Sam Weinig  <sam@webkit.org>
3568
3569         Fix the build.
3570
3571         * JavaScriptCore.exp:
3572
3573 2009-05-01  Sam Weinig  <sam@webkit.org>
3574
3575         Reviewed by Geoffrey "Too Far!" Garen.
3576
3577         Move JS number construction into JSValue.
3578
3579         * runtime/JSImmediate.h:
3580         * runtime/JSNumberCell.h:
3581         (JSC::JSValue::JSValue):
3582         * runtime/JSValue.h:
3583         (JSC::jsNumber):
3584
3585 2009-05-01  Sam Weinig  <sam@webkit.org>
3586
3587         Reviewed by Geoff "The Minneapolis" Garen.
3588
3589         Add mechanism to vend heap allocated JS numbers to JavaScriptCore API clients with a
3590         representation that is independent of the number representation in the VM.
3591         - Numbers leaving the interpreter are converted to a tagged JSNumberCell.
3592         - The numbers coming into the interpreter (asserted to be the tagged JSNumberCell) are
3593           converted back to the VM's internal number representation.
3594
3595         * API/APICast.h:
3596         (toJS):
3597         (toRef):
3598         * API/JSBase.cpp:
3599         (JSEvaluateScript):
3600         (JSCheckScriptSyntax):
3601         * API/JSCallbackConstructor.cpp:
3602         (JSC::constructJSCallback):
3603         * API/JSCallbackFunction.cpp:
3604         (JSC::JSCallbackFunction::call):
3605         * API/JSCallbackObjectFunctions.h:
3606         (JSC::::getOwnPropertySlot):
3607         (JSC::::put):
3608         (JSC::::deleteProperty):
3609         (JSC::::construct):
3610         (JSC::::hasInstance):
3611         (JSC::::call):
3612         (JSC::::toNumber):
3613         (JSC::::toString):
3614         (JSC::::staticValueGetter):
3615         (JSC::::callbackGetter):
3616         * API/JSObjectRef.cpp:
3617         (JSObjectMakeFunction):
3618         (JSObjectMakeArray):
3619         (JSObjectMakeDate):
3620         (JSObjectMakeError):
3621         (JSObjectMakeRegExp):
3622         (JSObjectGetPrototype):
3623         (JSObjectSetPrototype):
3624         (JSObjectGetProperty):
3625         (JSObjectSetProperty):
3626         (JSObjectGetPropertyAtIndex):
3627         (JSObjectSetPropertyAtIndex):
3628         (JSObjectDeleteProperty):
3629         (JSObjectCallAsFunction):
3630         (JSObjectCallAsConstructor):
3631         * API/JSValueRef.cpp:
3632         (JSValueGetType):
3633         (JSValueIsUndefined):
3634         (JSValueIsNull):
3635         (JSValueIsBoolean):
3636         (JSValueIsNumber):
3637         (JSValueIsString):
3638         (JSValueIsObject):
3639         (JSValueIsObjectOfClass):
3640         (JSValueIsEqual):
3641         (JSValueIsStrictEqual):
3642         (JSValueIsInstanceOfConstructor):
3643         (JSValueMakeUndefined):
3644         (JSValueMakeNull):
3645         (JSValueMakeBoolean):
3646         (JSValueMakeNumber):
3647         (JSValueMakeString):
3648         (JSValueToBoolean):
3649         (JSValueToNumber):
3650         (JSValueToStringCopy):
3651         (JSValueToObject):
3652         (JSValueProtect):
3653         (JSValueUnprotect):
3654         * runtime/JSNumberCell.cpp:
3655         (JSC::jsAPIMangledNumber):
3656         * runtime/JSNumberCell.h:
3657         (JSC::JSNumberCell::isAPIMangledNumber):
3658         (JSC::JSNumberCell::):
3659         (JSC::JSNumberCell::JSNumberCell):
3660         (JSC::JSValue::isAPIMangledNumber):
3661         * runtime/JSValue.h:
3662
3663 2009-05-01  Geoffrey Garen  <ggaren@apple.com>
3664
3665         Windows build fix take 6.
3666
3667         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3668
3669 2009-05-01  Geoffrey Garen  <ggaren@apple.com>
3670
3671         Windows build fix take 5.
3672
3673         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
3674
3675 2009-05-01  Geoffrey Garen  <ggaren@apple.com>
3676
3677         Windows build fix take 4.
3678
3679         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
3680
3681 2009-05-01  Geoffrey Garen  <ggaren@apple.com>
3682
3683         Windows build fix take 3.
3684
3685         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
3686
3687 2009-05-01  Geoffrey Garen  <ggaren@apple.com>
3688
3689         Windows build fix take 2.
3690
3691         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3692
3693 2009-05-01  Geoffrey Garen  <ggaren@apple.com>
3694
3695         Windows build fix take 1.
3696
3697         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3698         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
3699
3700 2009-05-01  Geoffrey Garen  <ggaren@apple.com>
3701
3702         Rubber Stamped by Sam Weinig.
3703         
3704         Renamed JSValuePtr => JSValue.
3705
3706         * API/APICast.h:
3707         (toJS):
3708         (toRef):
3709         * API/JSCallbackConstructor.h:
3710         (JSC::JSCallbackConstructor::createStructure):
3711         * API/JSCallbackFunction.cpp:
3712         (JSC::JSCallbackFunction::call):
3713         * API/JSCallbackFunction.h:
3714         (JSC::JSCallbackFunction::createStructure):
3715         * API/JSCallbackObject.h:
3716         (JSC::JSCallbackObject::createStructure):
3717         * API/JSCallbackObjectFunctions.h:
3718         (JSC::::asCallbackObject):
3719         (JSC::::put):
3720         (JSC::::hasInstance):
3721         (JSC::::call):
3722         (JSC::::staticValueGetter):
3723         (JSC::::staticFunctionGetter):
3724         (JSC::::callbackGetter):
3725         * API/JSContextRef.cpp:
3726         * API/JSObjectRef.cpp:
3727         (JSObjectMakeConstructor):
3728         (JSObjectSetPrototype):
3729         (JSObjectGetProperty):
3730         (JSObjectSetProperty):
3731         (JSObjectGetPropertyAtIndex):
3732         (JSObjectSetPropertyAtIndex):
3733         * API/JSValueRef.cpp:
3734         (JSValueGetType):
3735         (JSValueIsUndefined):
3736         (JSValueIsNull):
3737         (JSValueIsBoolean):
3738         (JSValueIsNumber):
3739         (JSValueIsString):
3740         (JSValueIsObject):
3741         (JSValueIsObjectOfClass):
3742         (JSValueIsEqual):
3743         (JSValueIsStrictEqual):
3744         (JSValueIsInstanceOfConstructor):
3745         (JSValueToBoolean):
3746         (JSValueToNumber):
3747         (JSValueToStringCopy):
3748         (JSValueToObject):
3749         (JSValueProtect):
3750         (JSValueUnprotect):
3751         * JavaScriptCore.exp:
3752         * bytecode/CodeBlock.cpp:
3753         (JSC::valueToSourceString):
3754         (JSC::constantName):
3755         (JSC::CodeBlock::dump):
3756         * bytecode/CodeBlock.h:
3757         (JSC::CodeBlock::getConstant):
3758         (JSC::CodeBlock::addUnexpectedConstant):
3759         (JSC::CodeBlock::unexpectedConstant):
3760         * bytecode/EvalCodeCache.h:
3761         (JSC::EvalCodeCache::get):
3762         * bytecompiler/BytecodeGenerator.cpp:
3763         (JSC::BytecodeGenerator::addConstant):
3764         (JSC::BytecodeGenerator::addUnexpectedConstant):
3765         (JSC::BytecodeGenerator::emitLoad):
3766         (JSC::BytecodeGenerator::emitGetScopedVar):
3767         (JSC::BytecodeGenerator::emitPutScopedVar):
3768         (JSC::BytecodeGenerator::emitNewError):
3769         (JSC::keyForImmediateSwitch):
3770         * bytecompiler/BytecodeGenerator.h:
3771         (JSC::BytecodeGenerator::JSValueHashTraits::constructDeletedValue):
3772         (JSC::BytecodeGenerator::JSValueHashTraits::isDeletedValue):
3773         * debugger/Debugger.cpp:
3774         (JSC::evaluateInGlobalCallFrame):
3775         * debugger/Debugger.h:
3776         * debugger/DebuggerActivation.cpp:
3777         (JSC::DebuggerActivation::put):
3778         (JSC::DebuggerActivation::putWithAttributes):
3779         (JSC::DebuggerActivation::lookupGetter):
3780         (JSC::DebuggerActivation::lookupSetter):
3781         * debugger/DebuggerActivation.h:
3782         (JSC::DebuggerActivation::createStructure):
3783         * debugger/DebuggerCallFrame.cpp:
3784         (JSC::DebuggerCallFrame::evaluate):
3785         * debugger/DebuggerCallFrame.h:
3786         (JSC::DebuggerCallFrame::DebuggerCallFrame):
3787         (JSC::DebuggerCallFrame::exception):
3788         * interpreter/CachedCall.h:
3789         (JSC::CachedCall::CachedCall):
3790         (JSC::CachedCall::call):
3791         (JSC::CachedCall::setThis):
3792         (JSC::CachedCall::setArgument):
3793         * interpreter/CallFrame.cpp:
3794         (JSC::CallFrame::thisValue):
3795         (JSC::CallFrame::dumpCaller):
3796         * interpreter/CallFrame.h:
3797         (JSC::ExecState::setException):
3798         (JSC::ExecState::exception):
3799         (JSC::ExecState::exceptionSlot):
3800         * interpreter/CallFrameClosure.h:
3801         (JSC::CallFrameClosure::setArgument):
3802         * interpreter/Interpreter.cpp:
3803         (JSC::Interpreter::resolve):
3804         (JSC::Interpreter::resolveSkip):
3805         (JSC::Interpreter::resolveGlobal):
3806         (JSC::Interpreter::resolveBase):
3807         (JSC::Interpreter::resolveBaseAndProperty):
3808         (JSC::Interpreter::resolveBaseAndFunc):
3809         (JSC::isNotObject):
3810         (JSC::Interpreter::callEval):
3811         (JSC::Interpreter::unwindCallFrame):
3812         (JSC::Interpreter::throwException):
3813         (JSC::Interpreter::execute):
3814         (JSC::Interpreter::prepareForRepeatCall):
3815         (JSC::Interpreter::createExceptionScope):
3816         (JSC::Interpreter::tryCachePutByID):
3817         (JSC::Interpreter::tryCacheGetByID):
3818         (JSC::Interpreter::privateExecute):
3819         (JSC::Interpreter::retrieveArguments):
3820         (JSC::Interpreter::retrieveCaller):
3821         (JSC::Interpreter::retrieveLastCaller):
3822         * interpreter/Interpreter.h:
3823         * interpreter/Register.h:
3824         (JSC::Register::):
3825         (JSC::Register::Register):
3826         (JSC::Register::jsValue):
3827         * jit/JIT.cpp:
3828         (JSC::):
3829         (JSC::JIT::privateCompileMainPass):
3830         * jit/JIT.h:
3831         * jit/JITArithmetic.cpp:
3832         (JSC::JIT::compileFastArith_op_mod):
3833         * jit/JITCall.cpp:
3834         (JSC::JIT::unlinkCall):
3835         (JSC::JIT::compileOpCallInitializeCallFrame):
3836         (JSC::JIT::compileOpCall):
3837         * jit/JITCode.h:
3838         (JSC::):
3839         (JSC::JITCode::execute):
3840         * jit/JITInlineMethods.h:
3841         (JSC::JIT::emitGetVirtualRegister):
3842         (JSC::JIT::getConstantOperand):
3843         (JSC::JIT::emitPutJITStubArgFromVirtualRegister):
3844         (JSC::JIT::emitInitRegister):
3845         * jit/JITPropertyAccess.cpp:
3846         (JSC::JIT::privateCompilePutByIdTransition):
3847         (JSC::JIT::patchGetByIdSelf):
3848         (JSC::JIT::patchPutByIdReplace):
3849         (JSC::JIT::privateCompileGetByIdSelf):
3850         (JSC::JIT::privateCompileGetByIdProto):
3851         (JSC::JIT::privateCompileGetByIdSelfList):
3852         (JSC::JIT::privateCompileGetByIdProtoList):
3853         (JSC::JIT::privateCompileGetByIdChainList):
3854         (JSC::JIT::privateCompileGetByIdChain):
3855         (JSC::JIT::privateCompilePutByIdReplace):
3856         * jit/JITStubs.cpp:
3857         (JSC::JITStubs::tryCachePutByID):
3858         (JSC::JITStubs::tryCacheGetByID):
3859         (JSC::JITStubs::cti_op_convert_this):
3860         (JSC::JITStubs::cti_op_add):
3861         (JSC::JITStubs::cti_op_pre_inc):
3862         (JSC::JITStubs::cti_op_loop_if_less):
3863         (JSC::JITStubs::cti_op_loop_if_lesseq):
3864         (JSC::JITStubs::cti_op_get_by_id_generic):
3865         (JSC::JITStubs::cti_op_get_by_id):
3866         (JSC::JITStubs::cti_op_get_by_id_second):
3867         (JSC::JITStubs::cti_op_get_by_id_self_fail):
3868         (JSC::JITStubs::cti_op_get_by_id_proto_list):
3869         (JSC::JITStubs::cti_op_get_by_id_proto_list_full):
3870         (JSC::JITStubs::cti_op_get_by_id_proto_fail):
3871         (JSC::JITStubs::cti_op_get_by_id_array_fail):
3872         (JSC::JITStubs::cti_op_get_by_id_string_fail):
3873         (JSC::JITStubs::cti_op_instanceof):
3874         (JSC::JITStubs::cti_op_del_by_id):
3875         (JSC::JITStubs::cti_op_mul):
3876         (JSC::JITStubs::cti_op_call_NotJSFunction):
3877         (JSC::JITStubs::cti_op_resolve):
3878         (JSC::JITStubs::cti_op_construct_NotJSConstruct):
3879         (JSC::JITStubs::cti_op_get_by_val):
3880         (JSC::JITStubs::cti_op_get_by_val_string):
3881         (JSC::JITStubs::cti_op_get_by_val_byte_array):
3882         (JSC::JITStubs::cti_op_resolve_func):
3883         (JSC::JITStubs::cti_op_sub):
3884         (JSC::JITStubs::cti_op_put_by_val):
3885         (JSC::JITStubs::cti_op_put_by_val_array):
3886         (JSC::JITStubs::cti_op_put_by_val_byte_array):
3887         (JSC::JITStubs::cti_op_lesseq):
3888         (JSC::JITStubs::cti_op_loop_if_true):
3889         (JSC::JITStubs::cti_op_load_varargs):
3890         (JSC::JITStubs::cti_op_negate):
3891         (JSC::JITStubs::cti_op_resolve_base):
3892         (JSC::JITStubs::cti_op_resolve_skip):
3893         (JSC::JITStubs::cti_op_resolve_global):
3894         (JSC::JITStubs::cti_op_div):
3895         (JSC::JITStubs::cti_op_pre_dec):
3896         (JSC::JITStubs::cti_op_jless):
3897         (JSC::JITStubs::cti_op_not):
3898         (JSC::JITStubs::cti_op_jtrue):
3899         (JSC::JITStubs::cti_op_post_inc):
3900         (JSC::JITStubs::cti_op_eq):
3901         (JSC::JITStubs::cti_op_lshift):
3902         (JSC::JITStubs::cti_op_bitand):
3903         (JSC::JITStubs::cti_op_rshift):
3904         (JSC::JITStubs::cti_op_bitnot):
3905         (JSC::JITStubs::cti_op_resolve_with_base):
3906         (JSC::JITStubs::cti_op_mod):
3907         (JSC::JITStubs::cti_op_less):
3908         (JSC::JITStubs::cti_op_neq):
3909         (JSC::JITStubs::cti_op_post_dec):
3910         (JSC::JITStubs::cti_op_urshift):
3911         (JSC::JITStubs::cti_op_bitxor):
3912         (JSC::JITStubs::cti_op_bitor):
3913         (JSC::JITStubs::cti_op_call_eval):
3914         (JSC::JITStubs::cti_op_throw):
3915         (JSC::JITStubs::cti_op_next_pname):
3916         (JSC::JITStubs::cti_op_typeof):
3917         (JSC::JITStubs::cti_op_is_undefined):
3918         (JSC::JITStubs::cti_op_is_boolean):
3919         (JSC::JITStubs::cti_op_is_number):
3920         (JSC::JITStubs::cti_op_is_string):
3921         (JSC::JITStubs::cti_op_is_object):
3922         (JSC::JITStubs::cti_op_is_function):
3923         (JSC::JITStubs::cti_op_stricteq):
3924         (JSC::JITStubs::cti_op_nstricteq):
3925         (JSC::JITStubs::cti_op_to_jsnumber):
3926         (JSC::JITStubs::cti_op_in):
3927         (JSC::JITStubs::cti_op_switch_imm):
3928         (JSC::JITStubs::cti_op_switch_char):
3929         (JSC::JITStubs::cti_op_switch_string):
3930         (JSC::JITStubs::cti_op_del_by_val):
3931         (JSC::JITStubs::cti_op_new_error):
3932         (JSC::JITStubs::cti_vm_throw):
3933         * jit/JITStubs.h:
3934         * jsc.cpp:
3935         (functionPrint):
3936         (functionDebug):
3937         (functionGC):
3938         (functionVersion):
3939         (functionRun):
3940         (functionLoad):
3941         (functionSetSamplingFlag):
3942         (functionClearSamplingFlag):
3943         (functionReadline):
3944         (functionQuit):
3945         * parser/Nodes.cpp:
3946         (JSC::processClauseList):
3947         * profiler/ProfileGenerator.cpp:
3948         (JSC::ProfileGenerator::addParentForConsoleStart):
3949         * profiler/Profiler.cpp:
3950         (JSC::Profiler::willExecute):
3951         (JSC::Profiler::didExecute):
3952         (JSC::Profiler::createCallIdentifier):
3953         * profiler/Profiler.h:
3954         * runtime/ArgList.cpp:
3955         (JSC::MarkedArgumentBuffer::slowAppend):
3956         * runtime/ArgList.h:
3957         (JSC::MarkedArgumentBuffer::at):
3958         (JSC::MarkedArgumentBuffer::append):
3959         (JSC::ArgList::ArgList):
3960         (JSC::ArgList::at):
3961         * runtime/Arguments.cpp:
3962         (JSC::Arguments::put):
3963         * runtime/Arguments.h:
3964         (JSC::Arguments::createStructure):
3965         (JSC::asArguments):
3966         * runtime/ArrayConstructor.cpp:
3967         (JSC::callArrayConstructor):
3968         * runtime/ArrayPrototype.cpp:
3969         (JSC::getProperty):
3970         (JSC::putProperty):
3971         (JSC::arrayProtoFuncToString):
3972         (JSC::arrayProtoFuncToLocaleString):
3973         (JSC::arrayProtoFuncJoin):
3974         (JSC::arrayProtoFuncConcat):
3975         (JSC::arrayProtoFuncPop):
3976         (JSC::arrayProtoFuncPush):
3977         (JSC::arrayProtoFuncReverse):
3978         (JSC::arrayProtoFuncShift):
3979         (JSC::arrayProtoFuncSlice):
3980         (JSC::arrayProtoFuncSort):
3981         (JSC::arrayProtoFuncSplice):
3982         (JSC::arrayProtoFuncUnShift):
3983         (JSC::arrayProtoFuncFilter):
3984         (JSC::arrayProtoFuncMap):
3985         (JSC::arrayProtoFuncEvery):
3986         (JSC::arrayProtoFuncForEach):
3987         (JSC::arrayProtoFuncSome):
3988         (JSC::arrayProtoFuncReduce):
3989         (JSC::arrayProtoFuncReduceRight):
3990         (JSC::arrayProtoFuncIndexOf):
3991         (JSC::arrayProtoFuncLastIndexOf):
3992         * runtime/BooleanConstructor.cpp:
3993         (JSC::callBooleanConstructor):
3994         (JSC::constructBooleanFromImmediateBoolean):
3995         * runtime/BooleanConstructor.h:
3996         * runtime/BooleanObject.h:
3997         (JSC::asBooleanObject):
3998         * runtime/BooleanPrototype.cpp:
3999         (JSC::booleanProtoFuncToString):
4000         (JSC::booleanProtoFuncValueOf):
4001         * runtime/CallData.cpp:
4002         (JSC::call):
4003         * runtime/CallData.h:
4004         * runtime/Collector.cpp:
4005         (JSC::Heap::protect):
4006         (JSC::Heap::unprotect):
4007         (JSC::Heap::heap):
4008         * runtime/Collector.h:
4009         * runtime/Completion.cpp:
4010         (JSC::evaluate):
4011         * runtime/Completion.h:
4012         (JSC::Completion::Completion):
4013         (JSC::Completion::value):
4014         (JSC::Completion::setValue):
4015         * runtime/ConstructData.cpp:
4016         (JSC::construct):
4017         * runtime/ConstructData.h:
4018         * runtime/DateConstructor.cpp:
4019         (JSC::constructDate):
4020         (JSC::callDate):
4021         (JSC::dateParse):
4022         (JSC::dateNow):
4023         (JSC::dateUTC):
4024         * runtime/DateInstance.h:
4025         (JSC::asDateInstance):
4026         * runtime/DatePrototype.cpp:
4027         (JSC::dateProtoFuncToString):
4028         (JSC::dateProtoFuncToUTCString):
4029         (JSC::dateProtoFuncToDateString):
4030         (JSC::dateProtoFuncToTimeString):
4031         (JSC::dateProtoFuncToLocaleString):
4032         (JSC::dateProtoFuncToLocaleDateString):
4033         (JSC::dateProtoFuncToLocaleTimeString):
4034         (JSC::dateProtoFuncGetTime):
4035         (JSC::dateProtoFuncGetFullYear):
4036         (JSC::dateProtoFuncGetUTCFullYear):
4037         (JSC::dateProtoFuncToGMTString):
4038         (JSC::dateProtoFuncGetMonth):
4039         (JSC::dateProtoFuncGetUTCMonth):
4040         (JSC::dateProtoFuncGetDate):
4041         (JSC::dateProtoFuncGetUTCDate):
4042         (JSC::dateProtoFuncGetDay):
4043         (JSC::dateProtoFuncGetUTCDay):
4044         (JSC::dateProtoFuncGetHours):
4045         (JSC::dateProtoFuncGetUTCHours):
4046         (JSC::dateProtoFuncGetMinutes):
4047         (JSC::dateProtoFuncGetUTCMinutes):
4048         (JSC::dateProtoFuncGetSeconds):
4049         (JSC::dateProtoFuncGetUTCSeconds):
4050         (JSC::dateProtoFuncGetMilliSeconds):
4051         (JSC::dateProtoFuncGetUTCMilliseconds):
4052         (JSC::dateProtoFuncGetTimezoneOffset):
4053         (JSC::dateProtoFuncSetTime):
4054         (JSC::setNewValueFromTimeArgs):
4055         (JSC::setNewValueFromDateArgs):
4056         (JSC::dateProtoFuncSetMilliSeconds):
4057         (JSC::dateProtoFuncSetUTCMilliseconds):
4058         (JSC::dateProtoFuncSetSeconds):
4059         (JSC::dateProtoFuncSetUTCSeconds):
4060         (JSC::dateProtoFuncSetMinutes):
4061         (JSC::dateProtoFuncSetUTCMinutes):
4062         (JSC::dateProtoFuncSetHours):
4063         (JSC::dateProtoFuncSetUTCHours):
4064         (JSC::dateProtoFuncSetDate):
4065         (JSC::dateProtoFuncSetUTCDate):
4066         (JSC::dateProtoFuncSetMonth):
4067         (JSC::dateProtoFuncSetUTCMonth):
4068         (JSC::dateProtoFuncSetFullYear):
4069         (JSC::dateProtoFuncSetUTCFullYear):
4070         (JSC::dateProtoFuncSetYear):
4071         (JSC::dateProtoFuncGetYear):
4072         * runtime/DatePrototype.h:
4073         (JSC::DatePrototype::createStructure):
4074         * runtime/ErrorConstructor.cpp:
4075         (JSC::callErrorConstructor):
4076         * runtime/ErrorPrototype.cpp:
4077         (JSC::errorProtoFuncToString):
4078         * runtime/ExceptionHelpers.cpp:
4079         (JSC::createInterruptedExecutionException):
4080         (JSC::createError):
4081         (JSC::createStackOverflowError):
4082         (JSC::createUndefinedVariableError):
4083         (JSC::createErrorMessage):
4084         (JSC::createInvalidParamError):
4085         (JSC::createNotAConstructorError):
4086         (JSC::createNotAFunctionError):
4087         * runtime/ExceptionHelpers.h:
4088         * runtime/FunctionConstructor.cpp:
4089         (JSC::callFunctionConstructor):
4090         * runtime/FunctionPrototype.cpp:
4091         (JSC::callFunctionPrototype):
4092         (JSC::functionProtoFuncToString):
4093         (JSC::functionProtoFuncApply):
4094         (JSC::functionProtoFuncCall):
4095         * runtime/FunctionPrototype.h:
4096         (JSC::FunctionPrototype::createStructure):
4097         * runtime/GetterSetter.cpp:
4098         (JSC::GetterSetter::toPrimitive):
4099         (JSC::GetterSetter::getPrimitiveNumber):
4100         * runtime/GetterSetter.h:
4101         (JSC::asGetterSetter):
4102         * runtime/InternalFunction.cpp:
4103         (JSC::InternalFunction::displayName):
4104         * runtime/InternalFunction.h:
4105         (JSC::InternalFunction::createStructure):
4106         (JSC::asInternalFunction):
4107         * runtime/JSActivation.cpp:
4108         (JSC::JSActivation::getOwnPropertySlot):
4109         (JSC::JSActivation::put):
4110         (JSC::JSActivation::putWithAttributes):
4111         (JSC::JSActivation::argumentsGetter):
4112         * runtime/JSActivation.h:
4113         (JSC::JSActivation::createStructure):
4114         (JSC::asActivation):
4115         * runtime/JSArray.cpp:
4116         (JSC::storageSize):
4117         (JSC::JSArray::JSArray):
4118         (JSC::JSArray::getOwnPropertySlot):
4119         (JSC::JSArray::put):
4120         (JSC::JSArray::putSlowCase):
4121         (JSC::JSArray::deleteProperty):
4122         (JSC::JSArray::setLength):
4123         (JSC::JSArray::pop):
4124         (JSC::JSArray::push):
4125         (JSC::JSArray::mark):
4126         (JSC::compareNumbersForQSort):
4127         (JSC::JSArray::sortNumeric):
4128         (JSC::JSArray::sort):
4129         (JSC::JSArray::compactForSorting):
4130         (JSC::JSArray::checkConsistency):
4131         (JSC::constructArray):
4132         * runtime/JSArray.h:
4133