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