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