OSDN Git Service

Revert "Merge WebKit r47420"
[android-x86/external-webkit.git] / JavaScriptCore / ChangeLog
1 2009-08-10  Oliver Hunt  <oliver@apple.com>
2
3         Reviewed by NOBODY (And another build fix).
4
5         Add new exports for MSVC
6
7         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
8         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
9         * JavaScriptCore.xcodeproj/project.pbxproj:
10
11 2009-08-10  Oliver Hunt  <oliver@apple.com>
12
13         Reviewed by NOBODY (yet another build fix).
14
15         Remove obsolete entries from MSVC exports file
16
17         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
18         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
19
20 2009-08-10  Oliver Hunt  <oliver@apple.com>
21
22         Reviewed by NOBODY (Build fix).
23
24         Add includes needed for non-allinonefile builds
25
26         * runtime/GetterSetter.h:
27         * runtime/ScopeChain.h:
28
29 2009-08-10  Oliver Hunt  <oliver@apple.com>
30
31         Reviewed by NOBODY (Build fix).
32
33         Fix export file for last build fix
34
35         * JavaScriptCore.exp:
36
37 2009-08-10  Oliver Hunt  <oliver@apple.com>
38
39         Reviewed by NOBODY (Build fix).
40
41         Hoist page size initialization into platform specific code.
42
43         * jit/ExecutableAllocatorPosix.cpp:
44         * jit/ExecutableAllocatorWin.cpp:
45         * runtime/MarkStack.h:
46         (JSC::MarkStack::pageSize):
47         * runtime/MarkStackPosix.cpp:
48         (JSC::MarkStack::initializePagesize):
49         * runtime/MarkStackWin.cpp:
50         (JSC::MarkStack::initializePagesize):
51
52 2009-08-07  Oliver Hunt  <oliver@apple.com>
53
54         Reviewed by Gavin Barraclough.
55
56         Stack overflow crash in JavaScript garbage collector mark pass
57         https://bugs.webkit.org/show_bug.cgi?id=12216
58
59         Make the GC mark phase iterative by using an explicit mark stack.
60         To do this marking any single object is performed in multiple stages
61           * The object is appended to the MarkStack, this sets the marked
62             bit for the object using the new markDirect() function, and then
63             returns
64           * When the MarkStack is drain()ed the object is popped off the stack
65             and markChildren(MarkStack&) is called on the object to collect 
66             all of its children.  drain() then repeats until the stack is empty.
67
68         Additionally I renamed a number of methods from 'mark' to 'markAggregate'
69         in order to make it more clear that marking of those object was not
70         going to result in an actual recursive mark.
71
72         * GNUmakefile.am
73         * JavaScriptCore.exp:
74         * JavaScriptCore.gypi:
75         * JavaScriptCore.pri:
76         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
77         * JavaScriptCore.xcodeproj/project.pbxproj:
78         * bytecode/CodeBlock.cpp:
79         (JSC::CodeBlock::markAggregate):
80         * bytecode/CodeBlock.h:
81         * bytecode/EvalCodeCache.h:
82         (JSC::EvalCodeCache::markAggregate):
83         * debugger/DebuggerActivation.cpp:
84         (JSC::DebuggerActivation::markChildren):
85         * debugger/DebuggerActivation.h:
86         * interpreter/Register.h:
87         * interpreter/RegisterFile.h:
88         (JSC::RegisterFile::markGlobals):
89         (JSC::RegisterFile::markCallFrames):
90         * parser/Nodes.cpp:
91         (JSC::ScopeNodeData::markAggregate):
92         (JSC::EvalNode::markAggregate):
93         (JSC::FunctionBodyNode::markAggregate):
94         * parser/Nodes.h:
95         (JSC::ScopeNode::markAggregate):
96         * runtime/ArgList.cpp:
97         (JSC::MarkedArgumentBuffer::markLists):
98         * runtime/ArgList.h:
99         * runtime/Arguments.cpp:
100         (JSC::Arguments::markChildren):
101         * runtime/Arguments.h:
102         * runtime/Collector.cpp:
103         (JSC::Heap::markConservatively):
104         (JSC::Heap::markCurrentThreadConservativelyInternal):
105         (JSC::Heap::markCurrentThreadConservatively):
106         (JSC::Heap::markOtherThreadConservatively):
107         (JSC::Heap::markStackObjectsConservatively):
108         (JSC::Heap::markProtectedObjects):
109         (JSC::Heap::collect):
110         * runtime/Collector.h:
111         * runtime/GetterSetter.cpp:
112         (JSC::GetterSetter::markChildren):
113         * runtime/GetterSetter.h:
114         (JSC::GetterSetter::GetterSetter):
115         (JSC::GetterSetter::createStructure):
116         * runtime/GlobalEvalFunction.cpp:
117         (JSC::GlobalEvalFunction::markChildren):
118         * runtime/GlobalEvalFunction.h:
119         * runtime/JSActivation.cpp:
120         (JSC::JSActivation::markChildren):
121         * runtime/JSActivation.h:
122         * runtime/JSArray.cpp:
123         (JSC::JSArray::markChildren):
124         * runtime/JSArray.h:
125         * runtime/JSCell.h:
126         (JSC::JSCell::markCellDirect):
127         (JSC::JSCell::markChildren):
128         (JSC::JSValue::markDirect):
129         (JSC::JSValue::markChildren):
130         (JSC::JSValue::hasChildren):
131         (JSC::MarkStack::append):
132         (JSC::MarkStack::drain):
133         * runtime/JSFunction.cpp:
134         (JSC::JSFunction::markChildren):
135         * runtime/JSFunction.h:
136         * runtime/JSGlobalData.cpp:
137         (JSC::JSGlobalData::JSGlobalData):
138         * runtime/JSGlobalData.h:
139         * runtime/JSGlobalObject.cpp:
140         (JSC::markIfNeeded):
141         (JSC::JSGlobalObject::markChildren):
142         * runtime/JSGlobalObject.h:
143         * runtime/JSNotAnObject.cpp:
144         (JSC::JSNotAnObject::markChildren):
145         * runtime/JSNotAnObject.h:
146         * runtime/JSONObject.cpp:
147         (JSC::Stringifier::markAggregate):
148         (JSC::JSONObject::markStringifiers):
149         * runtime/JSONObject.h:
150         * runtime/JSObject.cpp:
151         (JSC::JSObject::markChildren):
152         (JSC::JSObject::defineGetter):
153         (JSC::JSObject::defineSetter):
154         * runtime/JSObject.h:
155         * runtime/JSPropertyNameIterator.cpp:
156         (JSC::JSPropertyNameIterator::markChildren):
157         * runtime/JSPropertyNameIterator.h:
158         (JSC::JSPropertyNameIterator::createStructure):
159         (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
160         (JSC::JSPropertyNameIterator::create):
161         * runtime/JSStaticScopeObject.cpp:
162         (JSC::JSStaticScopeObject::markChildren):
163         * runtime/JSStaticScopeObject.h:
164         * runtime/JSType.h:
165         (JSC::):
166         * runtime/JSValue.h:
167         * runtime/JSWrapperObject.cpp:
168         (JSC::JSWrapperObject::markChildren):
169         * runtime/JSWrapperObject.h:
170         * runtime/MarkStack.cpp: Added.
171         (JSC::MarkStack::compact):
172         * runtime/MarkStack.h: Added.
173         (JSC::):
174         (JSC::MarkStack::MarkStack):
175         (JSC::MarkStack::append):
176         (JSC::MarkStack::appendValues):
177         (JSC::MarkStack::~MarkStack):
178         (JSC::MarkStack::MarkSet::MarkSet):
179         (JSC::MarkStack::pageSize):
180         
181         MarkStackArray is a non-shrinking, mmap-based vector type
182         used for storing objects to be marked.
183         (JSC::MarkStack::MarkStackArray::MarkStackArray):
184         (JSC::MarkStack::MarkStackArray::~MarkStackArray):
185         (JSC::MarkStack::MarkStackArray::expand):
186         (JSC::MarkStack::MarkStackArray::append):
187         (JSC::MarkStack::MarkStackArray::removeLast):
188         (JSC::MarkStack::MarkStackArray::isEmpty):
189         (JSC::MarkStack::MarkStackArray::size):
190         (JSC::MarkStack::MarkStackArray::shrinkAllocation):
191         * runtime/MarkStackPosix.cpp: Added.
192         (JSC::MarkStack::allocateStack):
193         (JSC::MarkStack::releaseStack):
194         * runtime/MarkStackWin.cpp: Added.
195         (JSC::MarkStack::allocateStack):
196         (JSC::MarkStack::releaseStack):
197
198         * runtime/ScopeChain.h:
199         * runtime/ScopeChainMark.h:
200         (JSC::ScopeChain::markAggregate):
201         * runtime/SmallStrings.cpp:
202         (JSC::SmallStrings::mark):
203         * runtime/Structure.h:
204         (JSC::Structure::markAggregate):
205
206 2009-08-10  Mark Rowe  <mrowe@apple.com>
207         
208         Reviewed by Darin Adler.
209
210         Fix hundreds of "pointer being freed was not allocated" errors seen on the build bot.
211
212         * wtf/FastMalloc.h: Implement nothrow variants of the delete and delete[] operators since
213         we implement the nothrow variants of new and new[].  The nothrow variant of delete is called
214         explicitly in the implementation of std::sort which was resulting in FastMalloc-allocated
215         memory being passed to the system allocator to free.
216
217 2009-08-10  Jan Michael Alonzo  <jmalonzo@webkit.org>
218
219         [Gtk] Unreviewed build fix. Move JSAPIValueWrapper.cpp/.h in the debug
220         section. This file is already part of AllInOneFile in Release builds.
221
222         * GNUmakefile.am:
223
224 2009-08-10  Darin Adler  <darin@apple.com>
225
226         * wtf/FastMalloc.h: Fix build.
227
228 2009-08-10  Darin Adler  <darin@apple.com>
229
230         Reviewed by Mark Rowe.
231
232         FastMalloc.h has cross-platform code but marked as WinCE-only
233         https://bugs.webkit.org/show_bug.cgi?id=28160
234
235         1) The support for nothrow was inside #if PLATFORM(WINCE) even though it is
236            not platform-specific.
237         2) The code tried to override operator delete nothrow, which does not exist.
238         3) The code in the header checks the value of USE_SYSTEM_MALLOC, but the code
239            in FastMalloc.cpp checks only if the macro is defined.
240
241         * wtf/FastMalloc.h: See above.
242         * wtf/FastMalloc.cpp: Ditto.
243
244 2009-08-10  Sam Weinig  <sam@webkit.org>
245
246         Reviewed by Anders Carlsson.
247
248         Fix an annoying indentation issue.
249
250         * runtime/DateConstructor.cpp:
251         (JSC::constructDate):
252
253 2009-08-10  Xan Lopez  <xlopez@igalia.com>
254
255         Unreviewed build fix.
256
257         Add new files to makefile.
258
259         * GNUmakefile.am:
260
261 2009-08-10  Simon Hausmann  <simon.hausmann@nokia.com>
262
263         Fix compilation with the interpreter instead of the JIT by including
264         PrototypeFunction.h as forward-declared through NativeFunctionWrapper.h.
265
266         * runtime/ObjectConstructor.cpp:
267
268 2009-08-09  Oliver Hunt  <oliver@apple.com>
269
270         Reviewed by George Staikos.
271
272         JSON.stringify replacer returning undefined does not omit object properties
273         https://bugs.webkit.org/show_bug.cgi?id=28118
274
275         Correct behaviour of stringify when using a replacer function that returns
276         undefined.  This is a simple change to move the undefined value check to
277         after the replacer function is called.  This means that the replacer function
278         is now called for properties with the value undefined, however i've confirmed
279         that this behaviour is correct.
280         
281         In addition I've made the cyclic object exception have a more useful error
282         message.
283
284         * runtime/JSONObject.cpp:
285         (JSC::Stringifier::appendStringifiedValue):
286
287 2009-08-08  Oliver Hunt  <oliver@apple.com>
288
289         Reviewed by Eric Seidel and Sam Weinig.
290
291         [ES5] Implement Object.getPrototypeOf
292         https://bugs.webkit.org/show_bug.cgi?id=28114
293
294         Implement getPrototypeOf
295
296         * runtime/CommonIdentifiers.h:
297         * runtime/JSGlobalObject.cpp:
298         (JSC::JSGlobalObject::reset):
299         * runtime/ObjectConstructor.cpp:
300         (JSC::ObjectConstructor::ObjectConstructor):
301         (JSC::objectConsGetPrototypeOf):
302         * runtime/ObjectConstructor.h:
303
304 2009-08-07  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
305
306         Reviewed by Eric Seidel.
307
308         Allow custom memory allocation control for Noncopyable class
309         https://bugs.webkit.org/show_bug.cgi?id=27879
310
311         Several classes which are inherited from Noncopyable are instantiated by
312         operator new, so Noncopyable class has been inherited from FastAllocBase.
313
314         * wtf/Noncopyable.h:
315
316 2009-08-07  George Staikos <george.staikos@torchmobile.com> 
317
318         Reviewed by Eric Seidel.
319
320         https://bugs.webkit.org/show_bug.cgi?id=27305
321         Implement WinCE-specific unicode layer.
322         Written by George Staikos <george.staikos@torchmobile.com>
323         with bug fixes by Yong Li <yong.li@torchmobile.com>
324         refactored by Joe Mason <joe.mason@torchmobile.com> 
325
326         * wtf/Platform.h:
327         * wtf/unicode/Unicode.h:
328         * wtf/unicode/wince/UnicodeWince.cpp: Added.
329         (WTF::Unicode::toLower):
330         (WTF::Unicode::toUpper):
331         (WTF::Unicode::foldCase):
332         (WTF::Unicode::isPrintableChar):
333         (WTF::Unicode::isSpace):
334         (WTF::Unicode::isLetter):
335         (WTF::Unicode::isUpper):
336         (WTF::Unicode::isLower):
337         (WTF::Unicode::isDigit):
338         (WTF::Unicode::isPunct):
339         (WTF::Unicode::toTitleCase):
340         (WTF::Unicode::direction):
341         (WTF::Unicode::category):
342         (WTF::Unicode::decompositionType):
343         (WTF::Unicode::combiningClass):
344         (WTF::Unicode::mirroredChar):
345         (WTF::Unicode::digitValue):
346         * wtf/unicode/wince/UnicodeWince.h: Added.
347         (WTF::Unicode::):
348         (WTF::Unicode::isSeparatorSpace):
349         (WTF::Unicode::isHighSurrogate):
350         (WTF::Unicode::isLowSurrogate):
351         (WTF::Unicode::isArabicChar):
352         (WTF::Unicode::hasLineBreakingPropertyComplexContext):
353         (WTF::Unicode::umemcasecmp):
354         (WTF::Unicode::surrogateToUcs4):
355
356 2009-08-07  Yongjun Zhang  <yongjun.zhang@nokia.com>
357
358         Reviewed by Eric Seidel.
359
360         https://bugs.webkit.org/show_bug.cgi?id=28069
361
362         Add inline to help winscw compiler resolve specialized argument in 
363         templated functions.  
364
365         * runtime/LiteralParser.cpp:
366         (JSC::LiteralParser::Lexer::lexString):
367
368 2009-08-07  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
369
370         Reviewed by Eric Seidel.
371
372         Allow custom memory allocation control for RegExpObjectData struct
373         http://bugs.webkit.org/show_bug.cgi?id=26750
374
375         Inherits RegExpObjectData struct from FastAllocBase because
376         it has been instantiated by 'new' in JavaScriptCore/runtime/RegExpObject.cpp:62
377
378         * runtime/RegExpObject.h:
379
380 2009-08-06  Norbert Leser  <norbert.leser@nokia.com>
381
382         Reviewed by Darin Adler.
383
384         Updated patch for bug #27059:
385         Symbian platform always uses little endian encoding,
386         regardless of compiler.
387         We need to make sure that we correctly detect EABI architecture
388         for armv5 targets on Symbian,
389         where __EABI__ is set but not __ARM_EABI__
390
391         * wtf/Platform.h:
392
393 2009-08-06  Adam Barth  <abarth@webkit.org>
394
395         Unreviewed revert.
396
397         http://bugs.webkit.org/show_bug.cgi?id=27879
398
399         Revert 46877 because it broke GTK.
400
401         * wtf/Noncopyable.h:
402
403 2009-08-06  Gavin Barraclough  <barraclough@apple.com>
404
405         Reviewed by Oliver Hunt.
406
407         Make get_by_id/put_by_id/method_check/call defer optimization using a data flag rather than a code modification.
408         ( https://bugs.webkit.org/show_bug.cgi?id=27635 )
409
410         This improves performance of ENABLE(ASSEMBLER_WX_EXCLUSIVE) builds by 2-2.5%, reducing the overhead to about 2.5%.
411         (No performance impact with ASSEMBLER_WX_EXCLUSIVE disabled).
412
413         * bytecode/CodeBlock.cpp:
414         (JSC::printStructureStubInfo):
415             - Make StructureStubInfo store the type as an integer, rather than an OpcodeID.
416
417         * bytecode/CodeBlock.h:
418         (JSC::):
419         (JSC::CallLinkInfo::seenOnce):
420         (JSC::CallLinkInfo::setSeen):
421         (JSC::MethodCallLinkInfo::seenOnce):
422         (JSC::MethodCallLinkInfo::setSeen):
423             - Change a pointer in CallLinkInfo/MethodCallLinkInfo to use a PtrAndFlags, use a flag to track when an op has been executed once.
424
425         * bytecode/StructureStubInfo.cpp:
426         (JSC::StructureStubInfo::deref):
427             - Make StructureStubInfo store the type as an integer, rather than an OpcodeID.
428
429         * bytecode/StructureStubInfo.h:
430         (JSC::StructureStubInfo::StructureStubInfo):
431         (JSC::StructureStubInfo::initGetByIdSelf):
432         (JSC::StructureStubInfo::initGetByIdProto):
433         (JSC::StructureStubInfo::initGetByIdChain):
434         (JSC::StructureStubInfo::initGetByIdSelfList):
435         (JSC::StructureStubInfo::initGetByIdProtoList):
436         (JSC::StructureStubInfo::initPutByIdTransition):
437         (JSC::StructureStubInfo::initPutByIdReplace):
438         (JSC::StructureStubInfo::seenOnce):
439         (JSC::StructureStubInfo::setSeen):
440             - Make StructureStubInfo store the type as an integer, rather than an OpcodeID, add a flag to track when an op has been executed once.
441
442         * bytecompiler/BytecodeGenerator.cpp:
443         (JSC::BytecodeGenerator::emitGetById):
444         (JSC::BytecodeGenerator::emitPutById):
445             - Make StructureStubInfo store the type as an integer, rather than an OpcodeID.
446
447         * jit/JIT.cpp:
448         (JSC::JIT::privateCompileCTIMachineTrampolines):
449         (JSC::JIT::unlinkCall):
450             - Remove the "don't lazy link" stage of calls.
451
452         * jit/JIT.h:
453         (JSC::JIT::compileCTIMachineTrampolines):
454             - Remove the "don't lazy link" stage of calls.
455
456         * jit/JITCall.cpp:
457         (JSC::JIT::compileOpCallSlowCase):
458             - Remove the "don't lazy link" stage of calls.
459
460         * jit/JITStubs.cpp:
461         (JSC::JITThunks::JITThunks):
462         (JSC::JITThunks::tryCachePutByID):
463         (JSC::JITThunks::tryCacheGetByID):
464         (JSC::JITStubs::DEFINE_STUB_FUNCTION):
465         (JSC::JITStubs::getPolymorphicAccessStructureListSlot):
466             - Remove the "don't lazy link" stage of calls, and the "_second" stage of get_by_id/put_by_id/method_check.
467
468         * jit/JITStubs.h:
469         (JSC::JITThunks::ctiStringLengthTrampoline):
470         (JSC::JITStubs::):
471             - Remove the "don't lazy link" stage of calls, and the "_second" stage of get_by_id/put_by_id/method_check.
472
473         * wtf/PtrAndFlags.h:
474         (WTF::PtrAndFlags::PtrAndFlags):
475         (WTF::PtrAndFlags::operator!):
476         (WTF::PtrAndFlags::operator->):
477             - Add ! and -> operators, add constuctor with pointer argument.
478
479 2009-08-06  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
480
481         Reviewed by Adam Barth.
482
483         Allow custom memory allocation control for Noncopyable class
484         https://bugs.webkit.org/show_bug.cgi?id=27879
485
486         Several classes which inherited from Noncopyable are instantiated by
487         operator new, so Noncopyable class has been inherited from FastAllocBase.
488
489         * wtf/Noncopyable.h:
490
491 2009-08-06  Mark Rowe  <mrowe@apple.com>
492
493         Rubber-stamped by Sam Weinig.
494
495         Add explicit dependencies for our build verification scripts to ensure that they always run after linking has completed.
496
497         * JavaScriptCore.xcodeproj/project.pbxproj:
498
499 2009-08-06  Mark Rowe  <mrowe@apple.com>
500
501         Bring a little order to our otherwise out of control lives.
502
503         * JavaScriptCore.xcodeproj/project.pbxproj:
504
505 2009-08-06  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
506
507         Reviewed by Darin Adler.
508
509         Allow custom memory allocation control for JavaScriptCore's PolymorphicAccessStructureList struct
510         https://bugs.webkit.org/show_bug.cgi?id=27877
511
512         Inherits PolymorphicAccessStructureList struct from FastAllocBase because it has been instantiated by
513         'new' in JavaScriptCore/jit/JITStubs.cpp:1229.
514
515         * bytecode/Instruction.h:
516
517 2009-08-05  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
518
519         Reviewed by Darin Adler.
520
521         Allow custom memory allocation control for JavaScriptCore's ScopeNodeData struct
522         https://bugs.webkit.org/show_bug.cgi?id=27875
523
524         Inherits ScopeNodeData struct from FastAllocBase because it has been instantiated by
525         'new' in JavaScriptCore/parser/Nodes.cpp:1848.
526
527         * parser/Nodes.h:
528
529 2009-08-05  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
530
531         Reviewed by Gavin Barraclough.
532
533         Add floating point support for generic ARM port.
534         https://bugs.webkit.org/show_bug.cgi?id=24986
535
536         * assembler/ARMAssembler.cpp:
537         (JSC::ARMAssembler::doubleTransfer):
538         * assembler/ARMAssembler.h:
539         (JSC::ARM::):
540         (JSC::ARMAssembler::):
541         (JSC::ARMAssembler::faddd_r):
542         (JSC::ARMAssembler::fsubd_r):
543         (JSC::ARMAssembler::fmuld_r):
544         (JSC::ARMAssembler::fcmpd_r):
545         (JSC::ARMAssembler::fdtr_u):
546         (JSC::ARMAssembler::fdtr_d):
547         (JSC::ARMAssembler::fmsr_r):
548         (JSC::ARMAssembler::fsitod_r):
549         (JSC::ARMAssembler::fmstat):
550         * assembler/MacroAssemblerARM.h:
551         (JSC::MacroAssemblerARM::):
552         (JSC::MacroAssemblerARM::supportsFloatingPoint):
553         (JSC::MacroAssemblerARM::loadDouble):
554         (JSC::MacroAssemblerARM::storeDouble):
555         (JSC::MacroAssemblerARM::addDouble):
556         (JSC::MacroAssemblerARM::subDouble):
557         (JSC::MacroAssemblerARM::mulDouble):
558         (JSC::MacroAssemblerARM::convertInt32ToDouble):
559         (JSC::MacroAssemblerARM::branchDouble):
560         * jit/JIT.h:
561
562 2009-08-05  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
563
564         Reviewed by Gavin Barraclough.
565
566         Add JIT support for generic ARM port without optimizations.
567         https://bugs.webkit.org/show_bug.cgi?id=24986
568
569         All JIT optimizations are disabled.
570
571         Signed off by Zoltan Herczeg <zherczeg@inf.u-szeged.hu>
572         Signed off by Gabor Loki <loki@inf.u-szeged.hu>
573
574         * assembler/ARMAssembler.cpp:
575         (JSC::ARMAssembler::baseIndexTransfer32):
576         * assembler/AbstractMacroAssembler.h:
577         (JSC::AbstractMacroAssembler::Imm32::Imm32):
578         * assembler/MacroAssemblerARM.h:
579         (JSC::MacroAssemblerARM::store32):
580         (JSC::MacroAssemblerARM::move):
581         (JSC::MacroAssemblerARM::branch32):
582         (JSC::MacroAssemblerARM::add32):
583         (JSC::MacroAssemblerARM::sub32):
584         (JSC::MacroAssemblerARM::load32):
585         * bytecode/CodeBlock.h:
586         (JSC::CodeBlock::getBytecodeIndex):
587         * jit/JIT.h:
588         * jit/JITInlineMethods.h:
589         (JSC::JIT::restoreArgumentReference):
590         * jit/JITOpcodes.cpp:
591         * jit/JITStubs.cpp:
592         * jit/JITStubs.h:
593         (JSC::JITStackFrame::returnAddressSlot):
594         * wtf/Platform.h:
595
596 2009-08-04  Gavin Barraclough  <barraclough@apple.com>
597
598         Rubber Stamped by Oiver Hunt.
599
600         Revert r46643 since this breaks the Yarr::Interpreter running the v8 tests.
601         https://bugs.webkit.org/show_bug.cgi?id=27874
602
603         * yarr/RegexInterpreter.cpp:
604         (JSC::Yarr::Interpreter::allocDisjunctionContext):
605         (JSC::Yarr::Interpreter::freeDisjunctionContext):
606         (JSC::Yarr::Interpreter::allocParenthesesDisjunctionContext):
607         (JSC::Yarr::Interpreter::freeParenthesesDisjunctionContext):
608
609 2009-08-04  Oliver Hunt  <oliver@apple.com>
610
611         Reviewed by NOBODY (build fix).
612
613         PPC64 Build fix
614
615         * wtf/Platform.h:
616
617 2009-08-04  Benjamin C Meyer  <benjamin.meyer@torchmobile.com>
618
619         Reviewed by Adam Treat
620
621         Explicitly include limits.h header when using INT_MAX and INT_MIN
622
623         * interpreter/Interpreter.cpp
624
625 2009-08-03  Harald Fernengel  <harald.fernengel@nokia.com>
626
627         Reviewed by Darin Adler.
628
629         Fix compile error for ambigous call to abs()
630         https://bugs.webkit.org/show_bug.cgi?id=27873
631
632         Fix ambiguity in abs(long int) call by calling labs() instead
633
634         * wtf/DateMath.cpp: replace call to abs() with labs()
635
636 2009-08-03  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
637
638         Reviewed by Eric Seidel.
639
640         [Qt] Consolidate common gcc flags to WebKit.pri
641         https://bugs.webkit.org/show_bug.cgi?id=27934
642
643         * JavaScriptCore.pro:
644
645 2009-08-03  Ada Chan  <adachan@apple.com>
646
647         Fixed the Tiger build.
648
649         * wtf/FastMalloc.cpp:
650
651 2009-08-03  Ada Chan  <adachan@apple.com>
652
653         Reviewed by Darin Adler.
654
655         Don't use background thread to scavenge memory on Tiger until we figure out why it causes a crash.
656         https://bugs.webkit.org/show_bug.cgi?id=27900
657
658         * wtf/FastMalloc.cpp:
659
660 2009-08-03  Fumitoshi Ukai  <ukai@chromium.org>
661
662         Reviewed by Jan Alonzo.
663
664         Fix build break on Gtk/x86_64.
665         https://bugs.webkit.org/show_bug.cgi?id=27936
666
667         Use JSVALUE64 for X86_64 LINUX, except Qt.
668
669         * wtf/Platform.h:
670
671 2009-08-02  Xan Lopez  <xlopez@igalia.com>
672
673         Fix the GTK+ build.
674
675         * wtf/Platform.h:
676
677 2009-08-02  Geoffrey Garen  <ggaren@apple.com>
678
679         Reviewed by Sam Weinig.
680
681         Disabled JSVALUE32_64 on Qt builds, since all layout tests mysteriously
682         crash with it enabled.
683
684         * wtf/Platform.h:
685
686 2009-08-02  Geoffrey Garen  <ggaren@apple.com>
687
688         Qt build fix.
689
690         Added JSAPIValueWrapper.cpp to the build.
691
692         * JavaScriptCore.pri:
693
694 2009-08-02  Geoffrey Garen  <ggaren@apple.com>
695
696         Windows build fix.
697
698         Exported symbols for JSAPIValueWrapper.
699
700         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
701         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
702
703 2009-08-02  Geoffrey Garen  <ggaren@apple.com>
704
705         GTK build fix.
706
707         * jit/JITStubs.cpp: #include <stdarg.h>, for a definition of va_start.
708
709 2009-08-02  Geoffrey Garen  <ggaren@apple.com>
710
711         Qt build fix.
712         
713         * runtime/Collector.cpp: #include <limits.h>, for a definition of ULONG_MAX.
714
715 2009-08-02  Geoffrey Garen  <ggaren@apple.com>
716
717         Windows build fix: Nixed JSImmediate::prototype, JSImmediate::toObject,
718         and JSImmediate::toThisObject, and removed their exported symbols.
719
720         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
721         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
722         * runtime/JSImmediate.cpp:
723         * runtime/JSImmediate.h:
724
725 2009-08-02  Geoffrey Garen  <ggaren@apple.com>
726
727         Reviewed by Mark Rowe.
728
729         Enabled JSVALUE32_64 by default on all platforms other than x86_64 (which uses JSVALUE64).
730
731         * wtf/Platform.h:
732
733 2009-08-02  Kevin Ollivier  <kevino@theolliviers.com>
734
735         Reviewed by Jan Alonzo.
736
737         Script for building the JavaScriptCore library for wx.
738         https://bugs.webkit.org/show_bug.cgi?id=27619
739
740         * wscript: Added.
741
742 2009-08-02  Yong Li  <yong.li@torchmobile.com>
743
744         Reviewed by George Staikos.
745
746         DateMath depends on strftime and localtime, which need to be imported manually on WinCE
747         https://bugs.webkit.org/show_bug.cgi?id=26558
748
749         * wtf/DateMath.cpp:
750
751 2009-08-01  David Kilzer  <ddkilzer@apple.com>
752
753         wtf/Threading.h: added include of Platform.h
754
755         Reviewed by Mark Rowe.
756
757         * wtf/Threading.h: Added #include "Platform.h" since this header
758         uses PLATFORM() and other macros.
759
760 2009-08-01  Mark Rowe  <mrowe@apple.com>
761
762         Rubber-stamped by Oliver Hunt.
763
764         Roll out r46668 as it was misinformed.  ScopeChain is only used with placement new.
765
766         * runtime/ScopeChain.h:
767
768 2009-08-01  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
769
770         Allow custom memory allocation control for JavaScriptCore's HashMap class
771         http://bugs.webkit.org/show_bug.cgi?id=27871
772
773         Inherits HashMap class from FastAllocBase because it has been
774         instantiated by 'new' in JavaScriptCore/API/JSClassRef.cpp:148.
775
776         * wtf/RefPtrHashMap.h:
777         (WTF::):
778
779 2009-08-01  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
780
781         Allow custom memory allocation control for JavaScriptCore's ScopeChain class
782         https://bugs.webkit.org/show_bug.cgi?id=27834
783
784         Inherits ScopeChain class from FastAllocBase because it has been
785         instantiated by 'new' in JavaScriptCore/runtime/JSFunction.h:109.
786
787         * runtime/ScopeChain.h:
788
789 2009-08-01  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
790
791         Reviewed by Darin Adler.
792
793         Allow custom memory allocation control for JavaScriptCore's RegExpConstructorPrivate struct 
794         https://bugs.webkit.org/show_bug.cgi?id=27833
795
796         Inherits RegExpConstructorPrivate class from FastAllocBase because it has been
797         instantiated by 'new' in JavaScriptCore/runtime/RegExpConstructor.cpp:152.
798
799         * runtime/RegExpConstructor.cpp:
800
801 2009-07-31  Yong Li  <yong.li@torchmobile.com>
802
803         Reviewed by George Staikos.
804
805         Resurrect the old GetTickCount implementation of currentTime, controlled by WTF_USE_QUERY_PERFORMANCE_COUNTER
806         currentSystemTime taken from older WebKit; currentTime written by Yong Li <yong.li@torchmobile.com>; cleanup by Joe Mason <joe.mason@torchmobile.com>
807         https://bugs.webkit.org/show_bug.cgi?id=27848
808
809         * wtf/CurrentTime.cpp:
810         (WTF::currentSystemTime): get current time with GetCurrentFT
811         (WTF::currentTime): track msec elapsed since first currentSystemTime call using GetTickCount
812         * wtf/Platform.h:
813
814 2009-07-31  Ada Chan  <adachan@apple.com>
815
816         Fixes the Windows release-PGO build.
817
818         Reviewed by Jon Honeycutt.
819
820         * JavaScriptCore.vcproj/WTF/WTF.vcproj: Suppresses the warning about unreachable code that we get by adding "return 0" to WTF::TCMalloc_PageHeap::runScavengerThread().
821         * wtf/FastMalloc.cpp:
822         (WTF::TCMalloc_PageHeap::runScavengerThread): Fixes the error about the method not returning a value in the release-PGO build.
823
824 2009-07-31  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
825
826         Change malloc to fastMalloc and free to fastFree in Yarr's RegexInterpreter.cpp
827         https://bugs.webkit.org/show_bug.cgi?id=27874
828
829         Use fastMalloc and fastFree instead of malloc and free in RegexInterpreter.cpp's methods.
830
831         * yarr/RegexInterpreter.cpp:
832         (JSC::Yarr::Interpreter::allocDisjunctionContext):
833         (JSC::Yarr::Interpreter::freeDisjunctionContext):
834         (JSC::Yarr::Interpreter::allocParenthesesDisjunctionContext):
835         (JSC::Yarr::Interpreter::freeParenthesesDisjunctionContext):
836
837 2009-07-30  Xan Lopez  <xlopez@igalia.com>
838
839         Reviewed by Jan Alonzo.
840
841         Fix compiler warning.
842
843         GCC does not like C++-style comments in preprocessor directives.
844
845         * wtf/Platform.h:
846
847 2009-07-30  John McCall  <rjmccall@apple.com>
848
849         Reviewed by Gavin Barraclough.
850
851         Optimize the X86_64 trampolines: avoid the need for filler arguments
852         and move the stub-args area closer to the stack pointer.
853
854         * jit/JIT.h: adjust patch offsets because of slight code-size change 
855         * jit/JITCode.h:
856         (JSC::JITCode::execute): don't pass filler args
857         * jit/JITStubs.cpp:
858         (ctiTrampoline): (X86_64): push args onto stack, use args directly
859         (ctiVMThrowTrampoline): (X86_64): adjust %rsp by correct displacement
860         (ctiOpThrowNotCaught): (X86_64): adjust %rsp by correct displacement
861         * jit/JITStubs.h:
862         (JITStackFrame): (X86_64): move args area earlier
863         (ctiTrampoline): remove filler args from prototype
864
865 2009-07-30  Gavin Barraclough  <barraclough@apple.com>
866
867         Reviewed by NOBODY (build fix).
868
869         Temporarily revert r46618 since this is b0rking on Linux.
870
871 2009-07-23  Gavin Barraclough  <barraclough@apple.com>
872
873         Reviewed by Oliver Hunt.
874
875         Make get_by_id/put_by_id/method_check/call defer optimization using a data flag rather than a code modification.
876         ( https://bugs.webkit.org/show_bug.cgi?id=27635 )
877
878         This improves performance of ENABLE(ASSEMBLER_WX_EXCLUSIVE) builds by 2-2.5%, reducing the overhead to about 2.5%.
879         (No performance impact with ASSEMBLER_WX_EXCLUSIVE disabled).
880
881         * bytecode/CodeBlock.cpp:
882         (JSC::printStructureStubInfo):
883             - Make StructureStubInfo store the type as an integer, rather than an OpcodeID.
884
885         * bytecode/CodeBlock.h:
886         (JSC::):
887         (JSC::CallLinkInfo::seenOnce):
888         (JSC::CallLinkInfo::setSeen):
889         (JSC::MethodCallLinkInfo::seenOnce):
890         (JSC::MethodCallLinkInfo::setSeen):
891             - Change a pointer in CallLinkInfo/MethodCallLinkInfo to use a PtrAndFlags, use a flag to track when an op has been executed once.
892
893         * bytecode/StructureStubInfo.cpp:
894         (JSC::StructureStubInfo::deref):
895             - Make StructureStubInfo store the type as an integer, rather than an OpcodeID.
896
897         * bytecode/StructureStubInfo.h:
898         (JSC::StructureStubInfo::StructureStubInfo):
899         (JSC::StructureStubInfo::initGetByIdSelf):
900         (JSC::StructureStubInfo::initGetByIdProto):
901         (JSC::StructureStubInfo::initGetByIdChain):
902         (JSC::StructureStubInfo::initGetByIdSelfList):
903         (JSC::StructureStubInfo::initGetByIdProtoList):
904         (JSC::StructureStubInfo::initPutByIdTransition):
905         (JSC::StructureStubInfo::initPutByIdReplace):
906         (JSC::StructureStubInfo::seenOnce):
907         (JSC::StructureStubInfo::setSeen):
908             - Make StructureStubInfo store the type as an integer, rather than an OpcodeID, add a flag to track when an op has been executed once.
909
910         * bytecompiler/BytecodeGenerator.cpp:
911         (JSC::BytecodeGenerator::emitGetById):
912         (JSC::BytecodeGenerator::emitPutById):
913             - Make StructureStubInfo store the type as an integer, rather than an OpcodeID.
914
915         * jit/JIT.cpp:
916         (JSC::JIT::privateCompileCTIMachineTrampolines):
917         (JSC::JIT::unlinkCall):
918             - Remove the "don't lazy link" stage of calls.
919
920         * jit/JIT.h:
921         (JSC::JIT::compileCTIMachineTrampolines):
922             - Remove the "don't lazy link" stage of calls.
923
924         * jit/JITCall.cpp:
925         (JSC::JIT::compileOpCallSlowCase):
926             - Remove the "don't lazy link" stage of calls.
927
928         * jit/JITStubs.cpp:
929         (JSC::JITThunks::JITThunks):
930         (JSC::JITThunks::tryCachePutByID):
931         (JSC::JITThunks::tryCacheGetByID):
932         (JSC::JITStubs::DEFINE_STUB_FUNCTION):
933         (JSC::JITStubs::getPolymorphicAccessStructureListSlot):
934             - Remove the "don't lazy link" stage of calls, and the "_second" stage of get_by_id/put_by_id/method_check.
935
936         * jit/JITStubs.h:
937         (JSC::JITThunks::ctiStringLengthTrampoline):
938         (JSC::JITStubs::):
939             - Remove the "don't lazy link" stage of calls, and the "_second" stage of get_by_id/put_by_id/method_check.
940
941         * wtf/PtrAndFlags.h:
942         (WTF::PtrAndFlags::PtrAndFlags):
943         (WTF::PtrAndFlags::operator!):
944         (WTF::PtrAndFlags::operator->):
945             - Add ! and -> operators, add constuctor with pointer argument.
946
947 2009-07-30  Geoffrey Garen  <ggaren@apple.com>
948
949         Reviewed by Gavin Barraclough.
950
951         Fixed failing tests seen on Windows buildbot.
952
953         * jit/JITStubs.cpp:
954         (JSC::DEFINE_STUB_FUNCTION):
955         * jit/JITStubs.h:
956         (JSC::): Use "int" instead of "bool" to guarantee a 32-bit result,
957         regardless of compiler. gcc on mac uses 32-bit values for bool,
958         but gcc on linux and MSVC on Windows use 8-bit values.
959
960 2009-07-30  Geoffrey Garen  <ggaren@apple.com>
961
962         Windows build fix: added missing symbols on Windows.
963
964         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
965         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
966
967 2009-07-30  Geoffrey Garen  <ggaren@apple.com>
968
969         Windows build fix: removed stale symbols on Windows.
970
971         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
972         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
973
974 === End merge of nitro-extreme branch 2009-07-30 ===
975
976 2009-07-20  Geoffrey Garen  <ggaren@apple.com>
977
978         Fixed a post-review typo in r46066 that caused tons of test failures.
979         
980         SunSpider reports no change.
981
982         * runtime/JSArray.cpp:
983         (JSC::JSArray::JSArray): Initialize the full vector capacity, to avoid
984         uninitialized members at the end.
985
986 2009-07-20  Geoffrey Garen  <ggaren@apple.com>
987
988         Windows WebKit build fix: Added some missing exports.
989
990         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
991         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
992
993 2009-07-17  Geoffrey Garen  <ggaren@apple.com>
994
995         Reviewed by Sam Weinig.
996
997         Get the branch working on windows.
998         https://bugs.webkit.org/show_bug.cgi?id=27391
999         
1000         SunSpider says 0.3% faster.
1001
1002         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1003         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: Updated
1004         MSVC export lists to fix linker errors.
1005
1006         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Added / removed
1007         new / old project files.
1008
1009         * jit/JIT.cpp:
1010         (JSC::JIT::privateCompileCTIMachineTrampolines): Used #pragma pack to tell
1011         MSVC that these structures represent actual memory layout, and should not be
1012         automatically aligned. Changed the return value load to load a 64bit quantity
1013         into the canonical registers.
1014
1015         * jit/JIT.h: Moved OBJECT_OFFSETOF definition to StdLibExtras.h because
1016         it's needed by more than just the JIT, and it supplements a standard library
1017         macro (offsetof).
1018
1019         * jit/JITCall.cpp:
1020         (JSC::JIT::compileOpCallInitializeCallFrame): Fixed an incorrectly signed
1021         cast to resolve an MSVC warning.
1022
1023         * jit/JITStubs.h: Used #pragma pack to tell MSVC that these structures
1024         represent actual memory layout, and should not be automatically aligned. 
1025
1026         * runtime/JSArray.cpp:
1027         (JSC::JSArray::JSArray): Replaced memset_pattern8 with a for loop, since
1028         memset_pattern8 is not portable. (I verified that this version of the loop
1029         gives the best performance / generated code in GCC.)
1030
1031         * runtime/JSObject.h:
1032         (JSC::JSObject::JSObject): Removed accidental usage of FIELD_OFFSET --
1033         OBJECT_OFFSETOF is our new macro name. (FIELD_OFFSET conflicts with a
1034         definition in winnt.h.)
1035
1036         * runtime/JSValue.cpp: Added some headers needed by non-all-in-one builds.
1037         
1038         * runtime/JSValue.h:
1039         (JSC::JSValue::): Made the tag signed, to match MSVC's signed enum values.
1040         (GCC doesn't seem to care one way or the other.)
1041
1042         * wtf/MainThread.cpp: Moved the StdLibExtras.h #include -- I did this a
1043         while ago to resolve a conflict with winnt.h. I can't remember if it's truly
1044         still needed, but what the heck.
1045
1046         * wtf/StdLibExtras.h: Moved OBJECT_OFFSETOF definition here.
1047
1048 2009-07-06  Geoffrey Garen  <ggaren@apple.com>
1049
1050         Reviewed by Sam Weinig (?).
1051         
1052         Fixed an assertion seen during the stress test.
1053         
1054         Don't assume that, if op1 is constant, op2 is not, and vice versa. Sadly,
1055         not all constants get folded.
1056
1057         * jit/JITArithmetic.cpp:
1058         (JSC::JIT::emit_op_jnless):
1059         (JSC::JIT::emitSlow_op_jnless):
1060         (JSC::JIT::emit_op_jnlesseq):
1061         (JSC::JIT::emitSlow_op_jnlesseq):
1062
1063 2009-07-06  Geoffrey Garen  <ggaren@apple.com>
1064
1065         Reviewed by Sam Weinig.
1066         
1067         Include op_convert_this in result caching.
1068         
1069         No change on SunSpider or v8.
1070
1071         * jit/JITOpcodes.cpp:
1072         (JSC::JIT::emit_op_convert_this):
1073
1074         * jit/JITStubs.cpp:
1075         (JSC::DEFINE_STUB_FUNCTION):
1076         * jit/JITStubs.h:
1077         (JSC::): Made the op_convert_this JIT stub return an EncodedJSValue, so
1078         to maintain the result caching contract that { tag, payload } can be
1079         found in { regT1, regT0 }.
1080
1081 2009-07-06  Geoffrey Garen  <ggaren@apple.com>
1082
1083         Reviewed by Sam Weinig.
1084         
1085         Implemented result chaining.
1086         
1087         1% faster on SunSpider. 4%-5% faster on v8.
1088
1089         * assembler/MacroAssemblerX86Common.h:
1090         (JSC::MacroAssemblerX86Common::move):
1091         * assembler/X86Assembler.h:
1092         (JSC::X86Assembler::movl_rr): Added an optimization to eliminate
1093         no-op mov instructions, to simplify chaining.
1094
1095         * jit/JIT.cpp:
1096         (JSC::JIT::JIT):
1097         * jit/JIT.h: Added data members and helper functions for recording
1098         chained results. We record both a mapping from virtual to machine register
1099         and the opcode for which the mapping is valid, to help ensure that the
1100         mapping isn't used after the mapped register has been stomped by other
1101         instructions.
1102
1103         * jit/JITCall.cpp:
1104         (JSC::JIT::compileOpCallVarargs):
1105         (JSC::JIT::compileOpCallVarargsSlowCase):
1106         (JSC::JIT::emit_op_ret):
1107         (JSC::JIT::emit_op_construct_verify):
1108         (JSC::JIT::compileOpCall):
1109         (JSC::JIT::compileOpCallSlowCase): Chain function call results.
1110
1111         * jit/JITInlineMethods.h:
1112         (JSC::JIT::emitLoadTag):
1113         (JSC::JIT::emitLoadPayload):
1114         (JSC::JIT::emitLoad):
1115         (JSC::JIT::emitLoad2):
1116         (JSC::JIT::isLabeled):
1117         (JSC::JIT::map):
1118         (JSC::JIT::unmap):
1119         (JSC::JIT::isMapped):
1120         (JSC::JIT::getMappedPayload):
1121         (JSC::JIT::getMappedTag): Use helper functions when loading virtual
1122         registers into machine registers, in case the loads can be eliminated
1123         by chaining.
1124
1125         * jit/JITOpcodes.cpp:
1126         (JSC::JIT::emit_op_mov):
1127         (JSC::JIT::emit_op_end):
1128         (JSC::JIT::emit_op_instanceof):
1129         (JSC::JIT::emit_op_get_global_var):
1130         (JSC::JIT::emit_op_put_global_var):
1131         (JSC::JIT::emit_op_get_scoped_var):
1132         (JSC::JIT::emit_op_put_scoped_var):
1133         (JSC::JIT::emit_op_to_primitive):
1134         (JSC::JIT::emit_op_resolve_global):
1135         (JSC::JIT::emit_op_jneq_ptr):
1136         (JSC::JIT::emit_op_next_pname):
1137         (JSC::JIT::emit_op_to_jsnumber):
1138         (JSC::JIT::emit_op_catch): Chain results from these opcodes.
1139
1140         (JSC::JIT::emit_op_profile_will_call):
1141         (JSC::JIT::emit_op_profile_did_call): Load the profiler into regT2 to
1142         avoid stomping a chained result.
1143
1144         * jit/JITPropertyAccess.cpp:
1145         (JSC::JIT::emit_op_method_check):
1146         (JSC::JIT::emit_op_get_by_val):
1147         (JSC::JIT::emit_op_get_by_id): Chain results from these opcodes.
1148
1149         * jit/JITStubCall.h:
1150         (JSC::JITStubCall::addArgument): Always use { regT1, regT0 }, to facilitate
1151         chaining.
1152
1153         (JSC::JITStubCall::call): Unmap all mapped registers, since our callee
1154         stub might stomp them.
1155
1156 2009-07-01  Sam Weinig  <sam@webkit.org>
1157
1158         Reviewed by Gavin Barraclough.
1159
1160         Don't reload values in emitBinaryDoubleOp.
1161
1162         SunSpider reports a 0.6% progression. 
1163
1164         * jit/JIT.h:
1165         * jit/JITArithmetic.cpp:
1166         (JSC::JIT::emit_op_jnless):
1167         (JSC::JIT::emit_op_jnlesseq):
1168         (JSC::JIT::emitBinaryDoubleOp):
1169
1170 2009-07-01  Sam Weinig  <sam@webkit.org>
1171
1172         Reviewed by Geoffrey Garen.
1173
1174         Convert op_div to load op1 and op2 up front.
1175
1176         * jit/JITArithmetic.cpp:
1177         (JSC::JIT::emit_op_div):
1178
1179 2009-07-01  Sam Weinig  <sam@webkit.org>
1180
1181         Reviewed by Geoffrey Garen.
1182
1183         Don't emit code in emitBinaryDoubleOp if code is unreachable, observable
1184         via an empty (unlinked) jumplist passed in.  This only effects op_jnless
1185         and op_jnlesseq at present.
1186
1187         * jit/JITArithmetic.cpp:
1188         (JSC::JIT::emitSlow_op_jnless):
1189         (JSC::JIT::emitSlow_op_jnlesseq):
1190         (JSC::JIT::emitBinaryDoubleOp):
1191
1192 2009-07-01  Geoffrey Garen  <ggaren@apple.com>
1193
1194         Reviewed by Sam Weinig.
1195
1196         Converted op_mod to put { tag, payload } in { regT1, regT0 }, and
1197         tidied up its constant case.
1198         
1199         SunSpider reports a 0.2% regression, but a micro-benchmark of op_mod
1200         shows a 12% speedup, and the SunSpider test that uses op_mod most should
1201         benefit a lot from result caching in the end, since it almost always
1202         performs (expression) % constant.
1203
1204         * jit/JITArithmetic.cpp:
1205         (JSC::JIT::emit_op_mod):
1206         (JSC::JIT::emitSlow_op_mod):
1207
1208 2009-06-30  Sam Weinig  <sam@webkit.org>
1209
1210         Reviewed by Geoffrey Garen.
1211
1212         Converted some more arithmetic ops to put { tag, payload } in
1213         { regT1, regT0 }.
1214
1215         * jit/JITArithmetic.cpp:
1216         (JSC::JIT::emit_op_mul):
1217         (JSC::JIT::emitSlow_op_mul):
1218
1219 2009-06-30  Geoffrey Garen  <ggaren@apple.com>
1220
1221         Reviewed by Sam Weinig.
1222
1223         Converted some more arithmetic ops to put { tag, payload } in
1224         { regT1, regT0 }, and added a case for subtract constant.
1225         
1226         SunSpider says no change. v8 says 0.3% slower.
1227
1228         * jit/JIT.h:
1229         * jit/JITArithmetic.cpp:
1230         (JSC::JIT::emit_op_add):
1231         (JSC::JIT::emitAdd32Constant):
1232         (JSC::JIT::emitSlow_op_add):
1233         (JSC::JIT::emit_op_sub):
1234         (JSC::JIT::emitSub32Constant):
1235         (JSC::JIT::emitSlow_op_sub):
1236
1237 2009-06-30  Gavin Barraclough  <barraclough@apple.com>
1238
1239         Reviewed by Sam Weinig.
1240
1241         Remove more uses of addressFor(), load double constants directly from
1242         the constantpool in the CodeBlock, rather than from the register file.
1243
1244         * jit/JITArithmetic.cpp:
1245         (JSC::JIT::emitAdd32Constant):
1246         (JSC::JIT::emitBinaryDoubleOp):
1247
1248 2009-06-30  Geoffrey Garen  <ggaren@apple.com>
1249
1250         Reviewed by Sam Weinig.
1251         
1252         Fixed a bug in postfix ops, where we would treat x = x++ and x = x--
1253         as a no-op, even if x were not an int, and the ++/-- could have side-effects.
1254
1255         * jit/JITArithmetic.cpp:
1256         (JSC::JIT::emit_op_post_inc):
1257         (JSC::JIT::emitSlow_op_post_inc):
1258         (JSC::JIT::emit_op_post_dec):
1259         (JSC::JIT::emitSlow_op_post_dec):
1260
1261 2009-06-30  Geoffrey Garen  <ggaren@apple.com>
1262
1263         Reviewed by Sam Weinig.
1264         
1265         Converted some arithmetic ops to put { tag, payload } in
1266         { regT1, regT0 }.
1267         
1268         SunSpider says 0.7% faster. v8 says no change.
1269
1270         * jit/JIT.h:
1271         * jit/JITArithmetic.cpp:
1272         (JSC::JIT::emit_op_jnless):
1273         (JSC::JIT::emit_op_jnlesseq):
1274         (JSC::JIT::emit_op_lshift):
1275         (JSC::JIT::emit_op_rshift):
1276         (JSC::JIT::emit_op_bitand):
1277         (JSC::JIT::emit_op_bitor):
1278         (JSC::JIT::emit_op_bitxor):
1279         * jit/JITInlineMethods.h:
1280         (JSC::JIT::isOperandConstantImmediateInt):
1281         (JSC::JIT::getOperandConstantImmediateInt):
1282
1283 2009-06-30  Gavin Barraclough  <barraclough@apple.com>
1284
1285         Reviewed by Sam Weinig.
1286
1287         Start removing cases of addressFor().
1288
1289         * jit/JIT.h:
1290         * jit/JITArithmetic.cpp:
1291         (JSC::JIT::emitAdd32Constant):
1292         (JSC::JIT::emitBinaryDoubleOp):
1293         (JSC::JIT::emit_op_div):
1294         * jit/JITInlineMethods.h:
1295         (JSC::JIT::emitLoadDouble):
1296         (JSC::JIT::emitLoadInt32ToDouble):
1297         (JSC::JIT::emitStoreDouble):
1298         * jit/JITOpcodes.cpp:
1299         (JSC::JIT::emit_op_jfalse):
1300         (JSC::JIT::emit_op_jtrue):
1301
1302 2009-06-30  Geoffrey Garen  <ggaren@apple.com>
1303
1304         Rolled back in my last patch with regression fixed.
1305
1306         * jit/JIT.cpp:
1307         (JSC::JIT::privateCompileSlowCases):
1308         * jit/JIT.h:
1309         * jit/JITOpcodes.cpp:
1310         (JSC::JIT::emit_op_loop_if_less):
1311         (JSC::JIT::emit_op_loop_if_lesseq):
1312         (JSC::JIT::emit_op_resolve_global):
1313         (JSC::JIT::emitSlow_op_resolve_global):
1314         (JSC::JIT::emit_op_eq):
1315         (JSC::JIT::emitSlow_op_eq):
1316         (JSC::JIT::emit_op_neq):
1317         (JSC::JIT::emitSlow_op_neq):
1318
1319 2009-06-30  Geoffrey Garen  <ggaren@apple.com>
1320
1321         Rolled out my last patch because it was a 2% SunSpider regression.
1322
1323         * jit/JIT.cpp:
1324         (JSC::JIT::privateCompileSlowCases):
1325         * jit/JIT.h:
1326         * jit/JITOpcodes.cpp:
1327         (JSC::JIT::emit_op_loop_if_less):
1328         (JSC::JIT::emit_op_loop_if_lesseq):
1329         (JSC::JIT::emit_op_resolve_global):
1330         (JSC::JIT::emit_op_eq):
1331         (JSC::JIT::emitSlow_op_eq):
1332         (JSC::JIT::emit_op_neq):
1333         (JSC::JIT::emitSlow_op_neq):
1334
1335 2009-06-30  Geoffrey Garen  <ggaren@apple.com>
1336
1337         Reviewed by Gavin "Sam Weinig" Barraclough.
1338         
1339         Standardized the rest of our opcodes to put { tag, payload } in
1340         { regT1, regT0 } where possible.
1341
1342         * jit/JIT.cpp:
1343         (JSC::JIT::privateCompileSlowCases):
1344         * jit/JIT.h:
1345         * jit/JITOpcodes.cpp:
1346         (JSC::JIT::emit_op_loop_if_less):
1347         (JSC::JIT::emit_op_loop_if_lesseq):
1348         (JSC::JIT::emit_op_resolve_global):
1349         (JSC::JIT::emitSlow_op_resolve_global):
1350         (JSC::JIT::emit_op_eq):
1351         (JSC::JIT::emitSlow_op_eq):
1352         (JSC::JIT::emit_op_neq):
1353         (JSC::JIT::emitSlow_op_neq):
1354
1355 2009-06-30  Gavin Barraclough  <barraclough@apple.com>
1356
1357         Reviewed by Geoffrey Garen.
1358
1359         Replace calls to store32(tagFor()) and store32(payloadFor())
1360         with emitStoreInt32(), emitStoreBool(), and emitStoreCell().
1361
1362         * jit/JIT.h:
1363         * jit/JITArithmetic.cpp:
1364         (JSC::JIT::emit_op_negate):
1365         (JSC::JIT::emit_op_lshift):
1366         (JSC::JIT::emit_op_rshift):
1367         (JSC::JIT::emit_op_bitand):
1368         (JSC::JIT::emitBitAnd32Constant):
1369         (JSC::JIT::emit_op_bitor):
1370         (JSC::JIT::emitBitOr32Constant):
1371         (JSC::JIT::emit_op_bitxor):
1372         (JSC::JIT::emitBitXor32Constant):
1373         (JSC::JIT::emit_op_bitnot):
1374         (JSC::JIT::emit_op_post_inc):
1375         (JSC::JIT::emit_op_post_dec):
1376         (JSC::JIT::emit_op_pre_inc):
1377         (JSC::JIT::emit_op_pre_dec):
1378         (JSC::JIT::emit_op_add):
1379         (JSC::JIT::emitAdd32Constant):
1380         (JSC::JIT::emit_op_sub):
1381         (JSC::JIT::emitSub32ConstantLeft):
1382         (JSC::JIT::emitSub32ConstantRight):
1383         (JSC::JIT::emit_op_mul):
1384         (JSC::JIT::emitSlow_op_mul):
1385         (JSC::JIT::emit_op_div):
1386         (JSC::JIT::emit_op_mod):
1387         * jit/JITCall.cpp:
1388         (JSC::JIT::emit_op_load_varargs):
1389         * jit/JITInlineMethods.h:
1390         (JSC::JIT::emitStoreInt32):
1391         (JSC::JIT::emitStoreCell):
1392         (JSC::JIT::emitStoreBool):
1393         (JSC::JIT::emitStore):
1394         * jit/JITOpcodes.cpp:
1395         (JSC::JIT::emit_op_instanceof):
1396         (JSC::JIT::emit_op_not):
1397         (JSC::JIT::emit_op_eq):
1398         (JSC::JIT::emitSlow_op_eq):
1399         (JSC::JIT::emit_op_neq):
1400         (JSC::JIT::emitSlow_op_neq):
1401         (JSC::JIT::compileOpStrictEq):
1402         (JSC::JIT::emit_op_eq_null):
1403         (JSC::JIT::emit_op_neq_null):
1404         * jit/JITStubCall.h:
1405         (JSC::JITStubCall::call):
1406
1407 2009-06-30  Geoffrey Garen  <ggaren@apple.com>
1408
1409         Reviewed by Sam Weinig.
1410         
1411         Standardized the rest of the property access instructions to put { tag,
1412         payload } in { regT1, regT0 }.
1413
1414         Small v8 speedup, 0.2% SunSpider slowdown.
1415
1416         * jit/JIT.h:
1417         * jit/JITInlineMethods.h:
1418         (JSC::JIT::emitLoad):
1419         (JSC::JIT::emitLoad2):
1420         * jit/JITPropertyAccess.cpp:
1421         (JSC::JIT::emit_op_get_by_val):
1422         (JSC::JIT::emitSlow_op_get_by_val):
1423         (JSC::JIT::emit_op_put_by_val):
1424         (JSC::JIT::emitSlow_op_put_by_val):
1425         (JSC::JIT::emit_op_put_by_id):
1426         (JSC::JIT::emitSlow_op_put_by_id):
1427         (JSC::JIT::patchPutByIdReplace):
1428
1429 2009-06-29  Sam Weinig  <sam@webkit.org>
1430
1431         Reviewed by Gavin Barraclough.
1432
1433         Various cleanups.
1434         - Use fpRegT* instead of X86::xmm*.
1435         - Use a switch statement in emitBinaryDoubleOp instead of a bunch of
1436           if/elses.
1437
1438         * jit/JITArithmetic.cpp:
1439         (JSC::JIT::emitAdd32Constant):
1440         (JSC::JIT::emitBinaryDoubleOp):
1441         (JSC::JIT::emit_op_div):
1442
1443 2009-06-29  Sam Weinig  <sam@webkit.org>
1444
1445         Reviewed by Geoffrey Garen.
1446
1447         Add inline code dealing with doubles for op_jfalse and op_jtrue.
1448
1449         * assembler/MacroAssemblerX86Common.h:
1450         (JSC::MacroAssemblerX86Common::):
1451         (JSC::MacroAssemblerX86Common::zeroDouble):
1452         * jit/JITOpcodes.cpp:
1453         (JSC::JIT::emit_op_jfalse):
1454         (JSC::JIT::emit_op_jtrue):
1455
1456 2009-06-28  Geoffrey Garen  <ggaren@apple.com>
1457
1458         Reviewed by Sam Weinig.
1459
1460         Standardized op_get_by_id to put { tag, payload } in { regT1, regT0 }.
1461         
1462         SunSpider and v8 report maybe 0.2%-0.4% regressions, but the optimization
1463         this enables will win much more than that back.
1464
1465         * jit/JIT.cpp:
1466         (JSC::JIT::privateCompileCTIMachineTrampolines):
1467         * jit/JIT.h:
1468         * jit/JITPropertyAccess.cpp:
1469         (JSC::JIT::emit_op_method_check):
1470         (JSC::JIT::emit_op_get_by_id):
1471         (JSC::JIT::compileGetByIdHotPath):
1472         (JSC::JIT::compileGetByIdSlowCase):
1473         (JSC::JIT::patchGetByIdSelf):
1474         (JSC::JIT::privateCompilePatchGetArrayLength):
1475         (JSC::JIT::privateCompileGetByIdProto):
1476         (JSC::JIT::privateCompileGetByIdSelfList):
1477         (JSC::JIT::privateCompileGetByIdProtoList):
1478         (JSC::JIT::privateCompileGetByIdChainList):
1479         (JSC::JIT::privateCompileGetByIdChain):
1480
1481 2009-06-26  Geoffrey Garen  <ggaren@apple.com>
1482
1483         Reviewed by Maciej Stachowiak.
1484         
1485         Standardized op_call to put { tag, payload } in { regT1, regT0 }.
1486         
1487         SunSpider and v8 report no change.
1488
1489         * jit/JIT.cpp:
1490         (JSC::JIT::privateCompileCTIMachineTrampolines):
1491         * jit/JITCall.cpp:
1492         (JSC::JIT::compileOpCallInitializeCallFrame):
1493         (JSC::JIT::compileOpCallSetupArgs):
1494         (JSC::JIT::compileOpConstructSetupArgs):
1495         (JSC::JIT::compileOpCallVarargsSetupArgs):
1496         (JSC::JIT::compileOpCallVarargs):
1497         (JSC::JIT::compileOpCall):
1498         (JSC::JIT::compileOpCallSlowCase):
1499
1500 2009-06-26  Sam Weinig  <sam@webkit.org>
1501
1502         Reviewed by Geoffrey Garen.
1503
1504         Handle multiplying by zero a little better by
1505         inlining the case that both operands are non-negative
1506         into the slowpath.
1507
1508         * assembler/MacroAssemblerX86Common.h:
1509         (JSC::MacroAssemblerX86Common::branchOr32):
1510         * jit/JITArithmetic.cpp:
1511         (JSC::JIT::emit_op_mul):
1512         (JSC::JIT::emitSlow_op_mul):
1513
1514 2009-06-25  Geoffrey Garen  <ggaren@apple.com>
1515
1516         Reviewed by Sam Weinig.
1517         
1518         Optimize x++ to ++x inside for loops.
1519         
1520         Sadly, no measurable speedup, but this should help with result chaining.
1521
1522         * parser/Nodes.cpp:
1523         (JSC::ForNode::emitBytecode):
1524
1525 2009-06-25  Geoffrey Garen  <ggaren@apple.com>
1526
1527         Reviewed by Sam Weinig.
1528         
1529         Standardized some more opcodes to put { tag, payload } in { regT1, regT0 }.
1530
1531         * jit/JITArithmetic.cpp:
1532         (JSC::JIT::emitSlow_op_bitnot):
1533         (JSC::JIT::emit_op_post_inc):
1534
1535 2009-06-25  Geoffrey Garen  <ggaren@apple.com>
1536
1537         Reviewed by Sam Weinig.
1538         
1539         Standardized some more opcodes to put { tag, payload } in { regT1, regT0 }.
1540
1541         * jit/JITArithmetic.cpp:
1542         (JSC::JIT::emit_op_bitnot):
1543         (JSC::JIT::emit_op_post_dec):
1544         (JSC::JIT::emit_op_pre_inc):
1545         (JSC::JIT::emitSlow_op_pre_inc):
1546         (JSC::JIT::emit_op_pre_dec):
1547         (JSC::JIT::emitSlow_op_pre_dec):
1548
1549 2009-06-25  Geoffrey Garen  <ggaren@apple.com>
1550
1551         Reviewed by Sam Weinig.
1552         
1553         Standardized some more opcodes to put { tag, payload } in { regT1, regT0 }.
1554
1555         * jit/JITArithmetic.cpp:
1556         (JSC::JIT::emit_op_negate):
1557         (JSC::JIT::emitSlow_op_negate):
1558         * jit/JITCall.cpp:
1559         (JSC::JIT::emit_op_construct_verify):
1560         (JSC::JIT::emitSlow_op_construct_verify):
1561
1562 2009-06-25  Geoffrey Garen  <ggaren@apple.com>
1563
1564         Reviewed by Sam Weinig.
1565         
1566         Standardized some more opcodes to put { tag, payload } in { regT1, regT0 }.
1567
1568         * jit/JITOpcodes.cpp:
1569         (JSC::JIT::emit_op_loop_if_true):
1570         (JSC::JIT::emit_op_jfalse):
1571         (JSC::JIT::emit_op_jtrue):
1572         (JSC::JIT::emit_op_jeq_null):
1573         (JSC::JIT::emit_op_jneq_null):
1574         (JSC::JIT::emit_op_eq_null):
1575         (JSC::JIT::emit_op_neq_null):
1576
1577 2009-06-25  Geoffrey Garen  <ggaren@apple.com>
1578
1579         Reviewed by Sam Weinig (sort of, maybe).
1580         
1581         Fixed some ASSERTs in http/tests/security.
1582         
1583         These ASSERTs were introduced by http://trac.webkit.org/changeset/45057,
1584         but the underlying problem was actually older. http://trac.webkit.org/changeset/45057
1585         just exposed the problem by enabling optimization in more cases.
1586         
1587         The ASSERTs fired because we tested PropertySlot::slotBase() for validity,
1588         but slotBase() ASSERTs if it's invalid, so we would ASSERT before
1589         the test could happen. Solution: Remove the ASSERT. Maybe it was valid
1590         once, but it clearly goes against a pattern we've deployed of late.
1591         
1592         The underlying problem was that WebCore would re-use a PropertySlot in
1593         the case of a forwarding access, and the second use would not completely
1594         overwrite the first use. Solution: Make sure to overwrite m_offset when
1595         setting a value on a PropertySlot. (Other values already get implicitly
1596         overwritten during reuse.)
1597
1598         * runtime/PropertySlot.h:
1599         (JSC::PropertySlot::PropertySlot):
1600         (JSC::PropertySlot::setValueSlot):
1601         (JSC::PropertySlot::setValue):
1602         (JSC::PropertySlot::setRegisterSlot):
1603         (JSC::PropertySlot::setUndefined):
1604         (JSC::PropertySlot::slotBase):
1605         (JSC::PropertySlot::clearOffset):
1606
1607 2009-06-24  Gavin Barraclough  <barraclough@apple.com>
1608
1609         Reviewed by Geoff Garen.
1610
1611         Enable JIT_OPTIMIZE_METHOD_CALLS on the branch, implementation matches current implemenatation in ToT.
1612
1613         * jit/JIT.h:
1614         * jit/JITPropertyAccess.cpp:
1615         (JSC::JIT::emit_op_method_check):
1616         (JSC::JIT::emitSlow_op_method_check):
1617         (JSC::JIT::emit_op_get_by_id):
1618         (JSC::JIT::compileGetByIdHotPath):
1619         (JSC::JIT::emitSlow_op_get_by_id):
1620         (JSC::JIT::compileGetByIdSlowCase):
1621
1622 2009-06-23  Geoffrey Garen  <ggaren@apple.com>
1623
1624         Reviewed by Sam Weinig.
1625
1626         Bit off a tiny bit more of standardizing opcode behavior to help with result
1627         caching.
1628         
1629         SunSpider reports no change, v8 maybe a tiny speedup.
1630
1631         * jit/JITOpcodes.cpp:
1632         (JSC::JIT::emit_op_to_jsnumber):
1633         (JSC::JIT::emitSlow_op_to_jsnumber):
1634         (JSC::JIT::emit_op_convert_this):
1635         (JSC::JIT::emitSlow_op_convert_this):
1636
1637 2009-06-23  Geoffrey Garen  <ggaren@apple.com>
1638
1639         Reviewed by Sam Weinig.
1640
1641         Bit off a tiny bit more of standardizing opcode behavior to help with result
1642         caching -- including removing my old enemy, op_resolve_function, because
1643         it was non-standard, and removing it felt better than helping it limp along.
1644         
1645         SunSpider reports no change, v8 maybe a tiny speedup.
1646         
1647         * bytecode/CodeBlock.cpp:
1648         (JSC::CodeBlock::dump):
1649         * bytecode/Opcode.h:
1650         * bytecompiler/BytecodeGenerator.cpp:
1651         * bytecompiler/BytecodeGenerator.h:
1652         * interpreter/Interpreter.cpp:
1653         (JSC::Interpreter::privateExecute):
1654         * jit/JIT.cpp:
1655         (JSC::JIT::privateCompileMainPass):
1656         * jit/JIT.h:
1657         * jit/JITOpcodes.cpp:
1658         (JSC::JIT::emit_op_get_scoped_var):
1659         (JSC::JIT::emit_op_put_scoped_var):
1660         (JSC::JIT::emit_op_to_primitive):
1661         (JSC::JIT::emitSlow_op_to_primitive):
1662         * jit/JITStubs.cpp:
1663         * jit/JITStubs.h:
1664         * parser/Nodes.cpp:
1665         (JSC::FunctionCallResolveNode::emitBytecode):
1666
1667 2009-06-23  Geoffrey Garen  <ggaren@apple.com>
1668
1669         Reviewed by Sam Weinig.
1670         
1671         Bit off a tiny bit of standardizing opcode behavior to help with result
1672         caching.
1673         
1674         0.6% SunSpider speedup. 0.3% v8 speedup.
1675
1676         * jit/JITInlineMethods.h:
1677         (JSC::JIT::emitLoad): Accomodate a base register that overlaps with payload
1678         by loading tag before payload, to avoid stomping base/payload.
1679
1680         * jit/JITOpcodes.cpp:
1681         (JSC::JIT::emit_op_mov): Abide by the standard "tag in regT1, payload in
1682         regT0" semantics.
1683
1684         (JSC::JIT::emit_op_get_global_var):
1685         (JSC::JIT::emit_op_put_global_var): Ditto. Also, removed some irrelevent
1686         loads while I was at it. The global object's "d" pointer never changes
1687         after construction.
1688
1689 2009-06-23  Gavin Barraclough  <barraclough@apple.com>
1690
1691         Reviewed by Sam Weinig.
1692
1693         Remove 'arguments' field from Register union (again).
1694         This time do so without breaking tests (radical, I know).
1695
1696         * interpreter/CallFrame.h:
1697         (JSC::ExecState::optionalCalleeArguments):
1698         (JSC::ExecState::setArgumentCount):
1699         (JSC::ExecState::init):
1700         * interpreter/Interpreter.cpp:
1701         (JSC::Interpreter::dumpRegisters):
1702         (JSC::Interpreter::unwindCallFrame):
1703         (JSC::Interpreter::privateExecute):
1704         (JSC::Interpreter::retrieveArguments):
1705         * interpreter/Register.h:
1706         (JSC::Register::withInt):
1707         (JSC::Register::):
1708         (JSC::Register::Register):
1709         (JSC::Register::i):
1710         * jit/JITStubs.cpp:
1711         (JSC::JITStubs::cti_op_tear_off_arguments):
1712         * runtime/Arguments.h:
1713         (JSC::JSActivation::copyRegisters):
1714         (JSC::Register::arguments):
1715         * runtime/JSActivation.cpp:
1716         (JSC::JSActivation::argumentsGetter):
1717         * runtime/JSActivation.h:
1718
1719 2009-06-23  Geoffrey Garen  <ggaren@apple.com>
1720
1721         Reviewed by Sam Weinig.
1722         
1723         Removed some result register tracking cruft in preparation for a new
1724         result tracking mechanism.
1725         
1726         SunSpider reports no change.
1727
1728         * assembler/AbstractMacroAssembler.h:
1729         * assembler/X86Assembler.h:
1730         (JSC::X86Assembler::JmpDst::JmpDst): No need to track jump targets in
1731         machine code; we already do this in bytecode.
1732
1733         * jit/JIT.cpp:
1734         (JSC::JIT::JIT):
1735         (JSC::JIT::emitTimeoutCheck): Make sure to save and restore the result
1736         registers, so an opcode with a timeout check can still benefit from result
1737         register caching.
1738
1739         (JSC::JIT::privateCompileMainPass):
1740         (JSC::JIT::privateCompileSlowCases): Removed calls to killLastResultRegister()
1741         in preparation for something new.
1742
1743         * jit/JIT.h:
1744         * jit/JITArithmetic.cpp:
1745         (JSC::JIT::emit_op_jnless):
1746         (JSC::JIT::emit_op_jnlesseq):
1747         * jit/JITInlineMethods.h:
1748         (JSC::JIT::emitGetFromCallFrameHeaderPtr):
1749         (JSC::JIT::emitGetFromCallFrameHeader32):
1750         * jit/JITOpcodes.cpp:
1751         (JSC::JIT::emit_op_jmp):
1752         (JSC::JIT::emit_op_jfalse):
1753         (JSC::JIT::emit_op_jtrue):
1754         (JSC::JIT::emit_op_jeq_null):
1755         (JSC::JIT::emit_op_jneq_null):
1756         (JSC::JIT::emit_op_jneq_ptr):
1757         (JSC::JIT::emit_op_jsr):
1758         (JSC::JIT::emit_op_sret):
1759         (JSC::JIT::emit_op_jmp_scopes): ditto
1760
1761         * jit/JITStubCall.h:
1762         (JSC::JITStubCall::JITStubCall):
1763         (JSC::JITStubCall::getArgument): added a mechanism for reloading an argument
1764         you passed to a JIT stub, for use in emitTimeoutCheck.
1765
1766 2009-06-23  Sam Weinig  <sam@webkit.org>
1767
1768         Reviewed by Geoffrey Garen.
1769
1770         Remove now-useless inplace variants of binary ops.
1771
1772         * jit/JIT.h:
1773         * jit/JITArithmetic.cpp:
1774         (JSC::JIT::emit_op_bitand):
1775         (JSC::JIT::emit_op_bitor):
1776         (JSC::JIT::emit_op_bitxor):
1777         (JSC::JIT::emit_op_add):
1778         (JSC::JIT::emit_op_sub):
1779         (JSC::JIT::emit_op_mul):
1780
1781 2009-06-23  Sam Weinig  <sam@webkit.org>
1782
1783         Reviewed by Geoffrey Garen.
1784
1785         Move off memory operands to aid in re-enabling result caching.
1786
1787         - No regression measured.
1788
1789         * jit/JIT.h:
1790         * jit/JITArithmetic.cpp:
1791         (JSC::JIT::emit_op_negate):
1792         (JSC::JIT::emit_op_jnless):
1793         (JSC::JIT::emit_op_jnlesseq):
1794         (JSC::JIT::emit_op_lshift):
1795         (JSC::JIT::emit_op_rshift):
1796         (JSC::JIT::emit_op_bitand):
1797         (JSC::JIT::emitBitAnd32Constant):
1798         (JSC::JIT::emitBitAnd32InPlace):
1799         (JSC::JIT::emit_op_bitor):
1800         (JSC::JIT::emitBitOr32Constant):
1801         (JSC::JIT::emitBitOr32InPlace):
1802         (JSC::JIT::emit_op_bitxor):
1803         (JSC::JIT::emitBitXor32Constant):
1804         (JSC::JIT::emitBitXor32InPlace):
1805         (JSC::JIT::emit_op_bitnot):
1806         (JSC::JIT::emit_op_post_inc):
1807         (JSC::JIT::emit_op_post_dec):
1808         (JSC::JIT::emit_op_pre_inc):
1809         (JSC::JIT::emitSlow_op_pre_inc):
1810         (JSC::JIT::emit_op_pre_dec):
1811         (JSC::JIT::emitSlow_op_pre_dec):
1812         (JSC::JIT::emit_op_add):
1813         (JSC::JIT::emitAdd32Constant):
1814         (JSC::JIT::emitAdd32InPlace):
1815         (JSC::JIT::emitSlow_op_add):
1816         (JSC::JIT::emitSlowAdd32Constant):
1817         (JSC::JIT::emit_op_sub):
1818         (JSC::JIT::emitSlow_op_sub):
1819         (JSC::JIT::emitSub32ConstantLeft):
1820         (JSC::JIT::emitSub32ConstantRight):
1821         (JSC::JIT::emitSub32InPlaceLeft):
1822         (JSC::JIT::emitSub32InPlaceRight):
1823         (JSC::JIT::emitBinaryDoubleOp):
1824         (JSC::JIT::emit_op_mul):
1825         (JSC::JIT::emitMul32InPlace):
1826         (JSC::JIT::emit_op_div):
1827         (JSC::JIT::emit_op_mod):
1828         * jit/JITCall.cpp:
1829         (JSC::JIT::compileOpCallVarargs):
1830         * jit/JITOpcodes.cpp:
1831         (JSC::JIT::emit_op_loop_if_less):
1832         (JSC::JIT::emit_op_loop_if_lesseq):
1833         (JSC::JIT::emit_op_instanceof):
1834         (JSC::JIT::emit_op_to_primitive):
1835         (JSC::JIT::emit_op_not):
1836         (JSC::JIT::emit_op_jneq_ptr):
1837         (JSC::JIT::emit_op_eq):
1838         (JSC::JIT::emit_op_neq):
1839         (JSC::JIT::emit_op_to_jsnumber):
1840         * jit/JITPropertyAccess.cpp:
1841         (JSC::JIT::emit_op_get_by_val):
1842         (JSC::JIT::emit_op_put_by_val):
1843
1844 2009-06-23  Geoffrey Garen  <ggaren@apple.com>
1845
1846         Reviewed by Sam Weinig.
1847         
1848         Fixed some missing and/or misplaced labels in bytecode generation, so
1849         we don't have to work around them in JIT code generation.
1850
1851         * bytecompiler/BytecodeGenerator.cpp:
1852         (JSC::BytecodeGenerator::emitJumpSubroutine):
1853         * parser/Nodes.cpp:
1854         (JSC::TryNode::emitBytecode):
1855
1856 2009-06-22  Geoffrey Garen  <ggaren@apple.com>
1857
1858         Reviewed by Sam Weinig.
1859         
1860         For member function calls, emit "this" directly into the "this" slot
1861         for the function call, instead of moving it there later. This reduces
1862         time spent in op_mov during certain calls, like "a.b.c()".
1863         
1864         1%-2% speedup on v8, mostly richards and delta-blue.
1865
1866         * parser/Nodes.cpp:
1867         (JSC::FunctionCallDotNode::emitBytecode):
1868
1869 2009-06-22  Gavin Barraclough  <barraclough@apple.com>
1870
1871         Reviewed by Sam Weinig.
1872
1873         Remove 'arguments' field from Register union.  Having JSCell derived types in the union is
1874         dangerous since it opens the possibility for the field to be written as a raw pointer but
1875         then read as a JSValue.  This will lead to statle data being read for the tag, which may
1876         be dangerous.  Having removed Arguments* types form Register, all arguments objects must
1877         always explicitly be stored in the register file as JSValues.
1878
1879         * interpreter/CallFrame.h:
1880         (JSC::ExecState::optionalCalleeArguments):
1881         * interpreter/Interpreter.cpp:
1882         (JSC::Interpreter::unwindCallFrame):
1883         (JSC::Interpreter::privateExecute):
1884         (JSC::Interpreter::retrieveArguments):
1885         * interpreter/Register.h:
1886         (JSC::Register::):
1887         * jit/JITStubs.cpp:
1888         (JSC::JITStubs::cti_op_tear_off_arguments):
1889         * runtime/Arguments.h:
1890         (JSC::JSActivation::copyRegisters):
1891         * runtime/JSActivation.cpp:
1892         (JSC::JSActivation::argumentsGetter):
1893         * runtime/JSActivation.h:
1894
1895 2009-06-03  Sam Weinig  <sam@webkit.org>
1896
1897         Reviewed by Geoffrey Garen.
1898
1899         Add back known this value optimization by abstracting
1900         slow case if not JSCell jumps.
1901
1902         * jit/JIT.h:
1903         * jit/JITCall.cpp:
1904         (JSC::JIT::compileOpCallVarargs):
1905         (JSC::JIT::compileOpCallVarargsSlowCase):
1906         (JSC::JIT::compileOpCall):
1907         (JSC::JIT::compileOpCallSlowCase):
1908         * jit/JITInlineMethods.h:
1909         (JSC::JIT::emitJumpSlowCaseIfNotJSCell):
1910         (JSC::JIT::linkSlowCaseIfNotJSCell):
1911         * jit/JITOpcodes.cpp:
1912         (JSC::JIT::emit_op_instanceof):
1913         (JSC::JIT::emitSlow_op_instanceof):
1914         * jit/JITPropertyAccess.cpp:
1915         (JSC::JIT::emit_op_get_by_val):
1916         (JSC::JIT::emitSlow_op_get_by_val):
1917         (JSC::JIT::emit_op_put_by_val):
1918         (JSC::JIT::emitSlow_op_put_by_val):
1919         (JSC::JIT::emit_op_get_by_id):
1920         (JSC::JIT::emitSlow_op_get_by_id):
1921         (JSC::JIT::emit_op_put_by_id):
1922         (JSC::JIT::emitSlow_op_put_by_id):
1923
1924 2009-06-01  Geoffrey Garen  <ggaren@apple.com>
1925
1926         Reviewed by Sam Weinig.
1927         
1928         Fixed some of the regression in crypto-aes.js. (8.5% speedup in
1929         crypto-aes.js.)
1930         
1931         SunSpider reports no change overall.
1932         
1933         Division was producing double results, which took the slow path through
1934         array access code.
1935         
1936         Strangely, all my attempts at versions of this patch that modified array
1937         access code to accept ints encoded as doubles along the fast or slow paths
1938         were regressions. So I did this instead.
1939
1940         * jit/JITArithmetic.cpp:
1941         (JSC::JIT::emit_op_div): When dividing an int by an int, go ahead and try
1942         to turn the result into an int. Don't just do int division, though, because
1943         testing shows it to be slower than SSE double division, and the corner
1944         cases are pretty complicated / lengthy on top of that. Also, don't try
1945         to canonicalize division of known tiny numerators into ints, since that's a
1946         waste of time.
1947
1948 2009-05-26  Geoffrey Garen  <ggaren@apple.com>
1949
1950         Reviewed by Oliver Hunt.
1951         
1952         Fixed a regression caused by my recent fix for NaN.
1953
1954         * jit/JITArithmetic.cpp:
1955         (JSC::JIT::emitBinaryDoubleOp): Actually do the comparison in reverse
1956         order, like the ChangeLog said we would, bokay?
1957
1958 2009-05-26  Geoffrey Garen  <ggaren@apple.com>
1959
1960         Reviewed by Sam Weinig and Oliver Hunt.
1961         
1962         Fixed two edge cases in %:
1963         
1964         - Don't do -2147483648 % x as a fast case, since you might do -2147483648 % -1,
1965         which will signal a hardware exception due to overflow.
1966
1967         - In the case of a zero remainder, be sure to store negative zero if the
1968         dividend was zero.
1969         
1970         SunSpider reports no change.
1971
1972         * jit/JITArithmetic.cpp:
1973         (JSC::JIT::emit_op_mod):
1974         (JSC::JIT::emitSlow_op_mod):
1975
1976 2009-05-25  Geoffrey Garen  <ggaren@apple.com>
1977
1978         Reviewed by Maciej Stachowiak.
1979         
1980         Fixed a regression when comparing to NaN.
1981
1982         * jit/JITArithmetic.cpp:
1983         (JSC::JIT::emitBinaryDoubleOp): For op_jnless and op_jnless_eq, do the
1984         comparison in reverse order, and jump if the result is below or 
1985         below-or-equal. This ensures that we do jump in the case of NaN.
1986
1987 2009-05-25  Geoffrey Garen  <ggaren@apple.com>
1988
1989         Reviewed by Oliver Hunt.
1990         
1991         SunSpider says no change.
1992         
1993         Fixed regressions in fast/js/var-declarations-shadowing.html and
1994         fast/js/equality.html, caused by recent == and != optimizations.
1995
1996         * jit/JITStubs.cpp:
1997         (JSC::JITStubs::cti_op_eq): Don't treat "compare to string" as always
1998         numeric or string comparison. If the second operand is an object, you
1999         need to ToPrimitive it, and start all over again. Also, I wrote out each
2000         of the possible cases explicitly, to cut down on redundant branching.
2001
2002 2009-05-25  Sam Weinig  <sam@webkit.org>
2003
2004         Reviewed by Mark Rowe.
2005
2006         Fix bug in fast/js/constant-folding.html where we were not negating
2007         -0 properly.
2008
2009         * jit/JITArithmetic.cpp:
2010         (JSC::JIT::emit_op_negate):
2011
2012 2009-05-23  Geoffrey Garen  <ggaren@apple.com>
2013
2014         Reviewed by Oliver Hunt.
2015         
2016         Refactored new slow case codegen for == and !=.
2017         
2018         SunSpider reports no change, maybe a tiny speedup.
2019
2020         * jit/JITOpcodes.cpp:
2021         (JSC::JIT::emitSlow_op_eq):
2022         (JSC::JIT::emitSlow_op_neq): Made a vptr comparison a *Ptr operation,
2023         instead of *32, to make it portable to 64bit. Reorganized the string
2024         and generic cases to make their control flow a little clearer.
2025
2026 2009-05-23  Geoffrey Garen  <ggaren@apple.com>
2027
2028         Reviewed by Maciej Stachowiak.
2029         
2030         Optimized == and != for our new value representation -- especially for strings.
2031         
2032         14% speedup on date-format-tofte.
2033
2034         * jit/JITOpcodes.cpp:
2035         (JSC::JIT::emit_op_eq):
2036         (JSC::JIT::emitSlow_op_eq):
2037         (JSC::JIT::emit_op_neq):
2038         (JSC::JIT::emitSlow_op_neq):
2039         * jit/JITStubCall.h:
2040         (JSC::JITStubCall::JITStubCall):
2041         * jit/JITStubs.cpp:
2042         (JSC::JITStubs::cti_op_eq):
2043         (JSC::JITStubs::cti_op_eq_strings):
2044         (JSC::JITStubs::cti_op_call_eval):
2045         * jit/JITStubs.h:
2046         (JSC::):
2047         * runtime/JSValue.h:
2048
2049 2009-05-22  Sam Weinig  <sam@webkit.org>
2050
2051         Reviewed by Gavin Barraclough.
2052
2053         Fix non-SSE enabled builds.
2054
2055         * jit/JITArithmetic.cpp:
2056         (JSC::JIT::emitSlow_op_add): Don't early return here, we still need to call the JIT stub.
2057         (JSC::JIT::emitSlow_op_sub): Ditto.
2058
2059 2009-05-22  Geoffrey Garen  <ggaren@apple.com>
2060
2061         Reviewed by Sam Weinig.
2062         
2063         Here's a thought: let's not take a jit stub call just to multiply by 1,
2064         bokay?
2065         
2066         imul doesn't set the zero flag, so to test for a zero result, we need
2067         an explicit instruction. (Luckily, it does set the overflow flag, so
2068         we can still use that.)
2069
2070         * jit/JIT.h:
2071         * jit/JITArithmetic.cpp:
2072         (JSC::JIT::emit_op_mul):
2073         (JSC::JIT::emitSlow_op_mul):
2074         (JSC::JIT::emitMul32InPlace):
2075
2076 2009-05-22  Sam Weinig  <sam@webkit.org>
2077
2078         Reviewed by Geoffrey "Premature Commit" Garen.
2079
2080         Add back constant integer cases for op_add.
2081
2082         * jit/JIT.h:
2083         * jit/JITArithmetic.cpp:
2084         (JSC::JIT::emit_op_add):
2085         (JSC::JIT::emitAdd32Constant):
2086         (JSC::JIT::emitSlow_op_add):
2087         (JSC::JIT::emitSlowAdd32Constant):
2088         * jit/JITInlineMethods.h:
2089         (JSC::JIT::getConstantOperandImmediateDouble):
2090         (JSC::JIT::isOperandConstantImmediateDouble):
2091
2092 2009-05-22  Geoffrey Garen  <ggaren@apple.com>
2093
2094         Reviewed by Sam Weinig.
2095         
2096         Added fast double cases for op_jnless and op_jnlesseq.
2097
2098         * assembler/AbstractMacroAssembler.h:
2099         (JSC::AbstractMacroAssembler::JumpList::jumps): New accesor, used by
2100         addSlowCase.
2101
2102         * assembler/X86Assembler.h:
2103         (JSC::X86Assembler::ucomisd_rm): New method for comparing register to
2104         memory.
2105
2106         * jit/JIT.h:
2107         * jit/JITArithmetic.cpp:
2108         (JSC::JIT::emit_op_jnless):
2109         (JSC::JIT::emitSlow_op_jnless):
2110         (JSC::JIT::emit_op_jnlesseq):
2111         (JSC::JIT::emitSlow_op_jnlesseq):
2112         (JSC::JIT::emit_op_add):
2113         (JSC::JIT::emit_op_sub):
2114         (JSC::JIT::emitBinaryDoubleOp):
2115         (JSC::JIT::emit_op_mul):
2116         (JSC::JIT::emit_op_div): Modified emitBinaryDoubleOp to accept comparison/jump
2117         operations in addition to operations with explicit result registers.
2118
2119         * jit/JITInlineMethods.h:
2120         (JSC::JIT::addSlowCase): Added an "addSlowCase" for JumpLists, so clients
2121         can track multiple jumps to the same slow case condition together.
2122
2123 2009-05-21  Sam Weinig  <sam@webkit.org>
2124
2125         Reviewed by Gavin Barraclough.
2126
2127         Implement op_negate inline fast cases.
2128
2129         * assembler/MacroAssemblerX86Common.h:
2130         (JSC::MacroAssemblerX86Common::neg32):
2131         * assembler/X86Assembler.h:
2132         (JSC::X86Assembler::):
2133         (JSC::X86Assembler::negl_m):
2134         (JSC::X86Assembler::xorpd_rr):
2135         * jit/JIT.cpp:
2136         (JSC::JIT::privateCompileMainPass):
2137         (JSC::JIT::privateCompileSlowCases):
2138         * jit/JIT.h:
2139         * jit/JITArithmetic.cpp:
2140         (JSC::JIT::emit_op_negate):
2141         (JSC::JIT::emitSlow_op_negate):
2142
2143 2009-05-20  Sam Weinig  <sam@webkit.org>
2144
2145         Reviewed by Gavin Barraclough.
2146
2147         Update the patchOffsetGetByIdSlowCaseCall constant for the
2148         case that OPCODE_SAMPLING is enabled.
2149
2150         * jit/JIT.h:
2151
2152 2009-05-20  Geoffrey Garen  <ggaren@apple.com>
2153
2154         Reviewed by Sam Weinig.
2155
2156         Added support for inline subtraction of doubles.
2157
2158         * jit/JITArithmetic.cpp:
2159         (JSC::JIT::emit_op_sub):
2160         (JSC::JIT::emitSlow_op_sub):
2161         (JSC::JIT::emitSlowSub32InPlaceLeft):
2162         (JSC::JIT::emitBinaryDoubleOp):
2163
2164 2009-05-20  Sam Weinig  <sam@webkit.org>
2165
2166         Reviewed by Geoffrey Garen.
2167
2168         Added support for inline division.
2169
2170         * assembler/X86Assembler.h:
2171         (JSC::X86Assembler::):
2172         (JSC::X86Assembler::divsd_rr):
2173         (JSC::X86Assembler::divsd_mr):
2174         * bytecode/CodeBlock.cpp:
2175         (JSC::CodeBlock::dump):
2176         * bytecode/Opcode.h:
2177         * bytecompiler/BytecodeGenerator.cpp:
2178         (JSC::BytecodeGenerator::emitBinaryOp):
2179         * interpreter/Interpreter.cpp:
2180         (JSC::Interpreter::privateExecute):
2181         * jit/JIT.cpp:
2182         (JSC::JIT::privateCompileMainPass):
2183         (JSC::JIT::privateCompileSlowCases):
2184         * jit/JIT.h:
2185         * jit/JITArithmetic.cpp:
2186         (JSC::JIT::emitBinaryDoubleOp):
2187         (JSC::JIT::emit_op_div):
2188         (JSC::JIT::emitSlow_op_div):
2189
2190 2009-05-20  Geoffrey Garen  <ggaren@apple.com>
2191
2192         Reviewed by Sam Weinig.
2193
2194         Added support for inline addition of doubles.
2195
2196         * jit/JITArithmetic.cpp:
2197         (JSC::JIT::emit_op_add):
2198         (JSC::JIT::emitSlow_op_add):
2199         (JSC::JIT::emitSlowAdd32InPlace):
2200         (JSC::JIT::emitBinaryDoubleOp):
2201         (JSC::JIT::emit_op_mul):
2202         (JSC::JIT::emitSlow_op_mul):
2203
2204 2009-05-20  Geoffrey Garen  <ggaren@apple.com>
2205
2206         Reviewed by Sam Weinig.
2207         
2208         Factored inline double operations into a helper function, so that we
2209         can reuse this code for other math operations.
2210
2211         * jit/JIT.h:
2212         * jit/JITArithmetic.cpp:
2213         (JSC::JIT::emitBinaryDoubleOp):
2214         (JSC::JIT::emit_op_mul):
2215         * jit/JITCall.cpp:
2216         (JSC::JIT::compileOpCallInitializeCallFrame):
2217
2218 2009-05-20  Geoffrey Garen  <ggaren@apple.com>
2219
2220         Reviewed by Sam Weinig.
2221         
2222         Added support for inline multiplication of doubles.
2223
2224         * assembler/X86Assembler.h:
2225         (JSC::X86Assembler::cvtsi2sd_mr): New function, useful for loading an
2226         int32 into a double register.
2227
2228         * jit/JITArithmetic.cpp:
2229         (JSC::JIT::emit_op_mul):
2230         (JSC::JIT::emitSlow_op_mul): Filled out these cases for double arithmetic.
2231
2232         * jit/JIT.h:
2233         * jit/JITInlineMethods.h:
2234         (JSC::JIT::addressFor): New function, useful for addressing a JSValue's
2235         full 64bits as a double.
2236
2237 2009-05-19  Sam Weinig  <sam@webkit.org>
2238
2239         Reviewed by Geoffrey Garen.
2240
2241         Implement and enable optimized calls.
2242
2243         * jit/JIT.cpp:
2244         (JSC::JIT::privateCompileCTIMachineTrampolines): Add ENABLE(JIT_OPTIMIZE_CALL) guards
2245         around the the optimize call only trampolines (virtualCallPreLink and virtualCallLink).
2246         Update the trampolines to account for the new JSValue representation.
2247         (JSC::JIT::unlinkCall): Use NULL instead of JSValue noValue. 
2248
2249         * jit/JITCall.cpp:
2250         (JSC::JIT::compileOpCall): Update to account for the new JSValue representation
2251         (JSC::JIT::compileOpCallSlowCase): Ditto.
2252
2253         * jit/JITStubs.h: Remove incorrect !ENABLE(JIT_OPTIMIZE_CALL) guard.
2254
2255         * wtf/Platform.h: Enable ENABLE_JIT_OPTIMIZE_CALL.
2256
2257 2009-05-19  Sam Weinig  <sam@webkit.org>
2258
2259         Reviewed by Geoffrey Garen.
2260
2261         Implement and enable optimized property access.
2262
2263         * assembler/AbstractMacroAssembler.h: Fix comment.
2264         * jit/JIT.cpp:
2265         (JSC::JIT::privateCompileCTIMachineTrampolines): Remove array length trampoline
2266         and implement the string length trampoline.
2267         * jit/JIT.h: Add new constants for patch offsets.
2268         * jit/JITInlineMethods.h: Remove FIELD_OFFSET which is now in StdLibExtras.h.
2269         * jit/JITPropertyAccess.cpp: 
2270         (JSC::JIT::emit_op_get_by_id):
2271         (JSC::JIT::emitSlow_op_get_by_id):
2272         (JSC::JIT::emit_op_put_by_id):
2273         (JSC::JIT::emitSlow_op_put_by_id):
2274         (JSC::JIT::compilePutDirectOffset):
2275         (JSC::JIT::compileGetDirectOffset):
2276         (JSC::JIT::privateCompilePutByIdTransition):
2277         (JSC::JIT::patchGetByIdSelf):
2278         (JSC::JIT::patchPutByIdReplace):
2279         (JSC::JIT::privateCompilePatchGetArrayLength):
2280         (JSC::JIT::privateCompileGetByIdProto):
2281         (JSC::JIT::privateCompileGetByIdSelfList):
2282         (JSC::JIT::privateCompileGetByIdProtoList):
2283         (JSC::JIT::privateCompileGetByIdChainList):
2284         (JSC::JIT::privateCompileGetByIdChain):
2285         * jit/JITStubCall.h:
2286         (JSC::JITStubCall::addArgument): Add version of addArgument that takes
2287         two registers for the tag and payload.
2288         * jit/JITStubs.cpp:
2289         (JSC::JITStubs::JITStubs): Remove array length trampoline pointer.
2290         (JSC::JITStubs::cti_op_get_by_id_self_fail): 
2291         * jit/JITStubs.h:
2292         * runtime/JSObject.h:
2293         (JSC::JSObject::JSObject): Move m_inheritorID below the property storage
2294         to align it to a 16 byte boundary.
2295         * wtf/Platform.h: Enable ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS
2296         * wtf/StdLibExtras.h: Move FIELD_OFFSET here.
2297
2298 2009-05-17  Sam Weinig  <sam@webkit.org>
2299
2300         Reviewed by Geoffrey Garen.
2301
2302         Remove unneeded ExecState parameter from the number JSValue constructors.
2303
2304         * runtime/JSValue.h:
2305         (JSC::jsNumber):
2306         (JSC::jsNaN):
2307         (JSC::JSValue::JSValue):
2308
2309 2009-05-15  Sam Weinig  <sam@webkit.org>
2310
2311         Reviewed by Geoffrey Garen.
2312
2313         Implemented fast path for op_put_by_val when putting to arrays.
2314
2315         * jit/JITPropertyAccess.cpp:
2316         (JSC::JIT::emit_op_put_by_val):
2317         (JSC::JIT::emitSlow_op_put_by_val):
2318
2319 2009-05-15  Geoffrey Garen  <ggaren@apple.com> (Mostly by Sam)
2320
2321         Reviewed by Sam Weinig.
2322         
2323         Implemented fast path for op_get_by_val when accessing array.
2324
2325         * jit/JIT.cpp:
2326         * jit/JITPropertyAccess.cpp:
2327         (JSC::JIT::emit_op_get_by_val):
2328         (JSC::JIT::emitSlow_op_get_by_val):
2329
2330 2009-05-14  Geoffrey Garen  <ggaren@apple.com>
2331
2332         Reviewed by Sam Weinig.
2333         
2334         Fixed a failure in fast/js/math-transforms.html caused by failing to
2335         preserve -0 in multiplication.
2336
2337         * assembler/X86Assembler.h:
2338         (JSC::X86Assembler::jz):
2339         * jit/JITArithmetic.cpp:
2340         (JSC::JIT::emit_op_mul):
2341         (JSC::JIT::emitSlow_op_mul):
2342         (JSC::JIT::emitMul32Constant):
2343         (JSC::JIT::emitMul32InPlace): Check both for overflow and for zero when
2344         doing multiplication. Use a slow case to get these right.
2345
2346 2009-05-14  Geoffrey Garen  <ggaren@apple.com>
2347
2348         Reviewed by Sam Weinig.
2349         
2350         Fixed a bug in the varargs calling convention.
2351
2352         * jit/JITCall.cpp:
2353         (JSC::JIT::compileOpCallVarargs): Move the argument count into regT1,
2354         since that's where ctiVirtualCall expects it to be.
2355
2356 2009-05-14  Geoffrey Garen  <ggaren@apple.com>
2357
2358         Reviewed by Sam Weinig.
2359
2360         Fixed a small bug in instanceof's looping code.
2361
2362         * jit/JITOpcodes.cpp:
2363         (JSC::JIT::emit_op_instanceof): NULL means the object has no prototype,
2364         so only loop when *not* equal to NULL.
2365
2366 2009-05-14  Geoffrey Garen  <ggaren@apple.com>
2367
2368         Reviewed by Sam Weinig.
2369         
2370         Fixed a small bug in instanceof's result writing code.
2371
2372         * jit/JITOpcodes.cpp:
2373         (JSC::JIT::emit_op_instanceof): Make sure to fill out the payload bits
2374         in all cases.
2375
2376 2009-05-14  Sam Weinig  <sam@webkit.org>
2377
2378         Reviewed by Geoffrey Garen.
2379
2380         Removed an invalid assertion in cti_op_urshift which
2381         depended on a fast path for op_urshift which has
2382         never existed.
2383
2384         * jit/JITStubs.cpp:
2385         (JSC::JITStubs::cti_op_urshift):
2386
2387 2009-05-14  Geoffrey Garen  <ggaren@apple.com>
2388
2389         Reviewed by Sam Weinig.
2390         
2391         Fixed loop_if_true, which had the same reversed test that jtrue had.
2392
2393         * jit/JITOpcodes.cpp:
2394         (JSC::JIT::emit_op_loop_if_true):
2395
2396 2009-05-14  Sam Weinig  <sam@webkit.org>
2397
2398         Reviewed by Geoffrey Garen.
2399
2400         In op_neq, we apparently want to check that one value
2401         does *not* equal another.  Go figure.
2402
2403         * jit/JITOpcodes.cpp:
2404         (JSC::JIT::emit_op_neq):
2405
2406 2009-05-14  Sam Weinig  <sam@webkit.org>
2407
2408         Reviewed by Geoffrey Garen.
2409
2410         The slow case of op_mod should call op_mod's jit stub,
2411         not op_mul.  That would be dumb.
2412
2413         * jit/JITArithmetic.cpp:
2414         (JSC::JIT::emitSlow_op_mod):
2415
2416 2009-05-14  Geoffrey Garen  <ggaren@apple.com>
2417
2418         Reviewed by Sam Weinig.
2419         
2420         Fixed problems when using 'arguments' due to a half-initialized register.
2421
2422         * interpreter/CallFrame.h:
2423         (JSC::ExecState::setCalleeArguments):
2424         (JSC::ExecState::init): Require a full JSValue when setting up the 
2425         'arguments' virtual register, since this register is accessible from JIT
2426         code and bytecode, and needs to be a true JSValue.
2427
2428         * interpreter/CallFrameClosure.h:
2429         (JSC::CallFrameClosure::resetCallFrame): ditto
2430
2431         * interpreter/Interpreter.cpp:
2432         (JSC::Interpreter::privateExecute): ditto
2433
2434         * interpreter/Register.h: Removed the constructor that allowed assignment
2435         of a JSArguments* to a register. That is not safe. See above.
2436
2437         * jit/JITStubs.cpp:
2438         (JSC::JITStubs::cti_op_create_arguments):
2439         (JSC::JITStubs::cti_op_create_arguments_no_params): ditto
2440
2441 2009-05-14  Sam Weinig  <sam@webkit.org>
2442
2443         Reviewed by Geoffrey Garen.
2444
2445         We really want to go to the slow case in op_jfalse and
2446         op_jtrue if the value is *not* boolean. 
2447
2448         * jit/JITOpcodes.cpp:
2449         (JSC::JIT::emit_op_jfalse):
2450         (JSC::JIT::emit_op_jtrue):
2451
2452 2009-05-14  Sam Weinig  <sam@webkit.org>
2453
2454         Reviewed by Geoffrey Garen.
2455
2456         Flipped the condition when emitting a an op_loop_if_less or op_loop_if_lesseq
2457         if the first operand is a constant.
2458
2459         * jit/JITOpcodes.cpp:
2460         (JSC::JIT::emit_op_loop_if_less):
2461         (JSC::JIT::emit_op_loop_if_lesseq):
2462
2463 2009-05-14  Sam Weinig  <sam@webkit.org>
2464
2465         Reviewed by Geoffrey Garen.
2466
2467         Added missing return in op_jnless and op_jnlesseq. 
2468
2469         * jit/JITArithmetic.cpp:
2470         (JSC::JIT::emit_op_jnless):
2471         (JSC::JIT::emit_op_jnlesseq):
2472
2473 2009-05-14  Sam Weinig  <sam@webkit.org>
2474
2475         Reviewed by Geoffrey Garen.
2476
2477         Load constants into the the register file as a temporary measure to
2478         aid bring up.  This allows us to use to treat constants like any
2479         other virtual register.
2480
2481         * jit/JITOpcodes.cpp:
2482         (JSC::JIT::emit_op_enter):
2483         (JSC::JIT::emit_op_enter_with_activation):
2484
2485 2009-05-14  Geoffrey Garen  <ggaren@apple.com>
2486
2487         Reviewed by Sam Weinig.
2488         
2489         Implemented op_strict_eq. Original patch by Snowy, by way of Sam and Gavin.
2490
2491         * assembler/MacroAssemblerX86Common.h:
2492         (JSC::MacroAssemblerX86Common::set8): Added set8, since it's slightly
2493         faster than set32, and the new value representation usually doesn't
2494         need set32.
2495
2496         * jit/JIT.cpp:
2497         * jit/JIT.h:
2498         * jit/JITInlineMethods.h:
2499         (JSC::JIT::emitLoadTag):
2500         (JSC::JIT::emitLoadPayload): Added helper functions for dealing with
2501         constants. Eventually, we should write special cases for all constants,
2502         but these are helpful in the short term.
2503
2504         * jit/JITOpcodes.cpp:
2505         (JSC::JIT::compileOpStrictEq):
2506         (JSC::JIT::emitSlow_op_stricteq):
2507         (JSC::JIT::emitSlow_op_nstricteq): teh opcodez.
2508
2509         * runtime/JSValue.h:
2510         (JSC::JSValue::):
2511         (JSC::JSValue::isDouble): Added a LowestTag for clarity.
2512
2513 2009-05-13  Geoffrey Garen  <ggaren@apple.com>
2514
2515         Reviewed by Sam Weinig.
2516         
2517         Fixed some bugs in host function calls.
2518         
2519         testapi now passes!
2520
2521         * jit/JIT.cpp: Changed some registers around to avoid overwriting edx:eax,
2522         which is how JSValues are now returned. Also changed the code that
2523         passes thisValue to pass the full 64bits of the value. Also added
2524         an #error compiler directive to other platform builds, since the JSValue
2525         return signature probably won't return in edx:eax on those platforms,
2526         and we'll have to investigate a solution.
2527
2528 2009-05-13  Geoffrey Garen  <ggaren@apple.com>
2529
2530         Reviewed by Sam Weinig.
2531         
2532         Removed parameters from functions that are intended never to use their
2533         parameters.
2534
2535         * jit/JITPropertyAccess.cpp:
2536         (JSC::JIT::emitSlow_op_get_by_val):
2537         (JSC::JIT::emitSlow_op_put_by_val):
2538
2539 2009-05-13  Geoffrey Garen  <ggaren@apple.com>
2540
2541         Reviewed by Sam Weinig.
2542         
2543         Ported op_instance_of from TOT. It's basically the same, but some register
2544         stuff changed to memory stuff.
2545
2546         * jit/JITInlineMethods.h:
2547         (JSC::JIT::emitPutJITStubArgFromVirtualRegister):
2548         (JSC::JIT::emitStore): Changed to use helper functions.
2549
2550         * jit/JITOpcodes.cpp:
2551         (JSC::JIT::emit_op_instanceof):
2552         (JSC::JIT::emitSlow_op_instanceof): Ported from TOT.
2553
2554 2009-05-13  Geoffrey Garen  <ggaren@apple.com>
2555
2556         Reviewed by Gavin Barraclough.
2557         
2558         Added a comment to explain an exception-handling subtelty that we found
2559         hard to remember when reviewing my last patch.
2560
2561         * jit/JITOpcodes.cpp:
2562         (JSC::JIT::emit_op_catch):
2563
2564 2009-05-13  Geoffrey Garen  <ggaren@apple.com>
2565
2566         Reviewed by Sam Weinig.
2567         
2568         Implemented try/catch.
2569
2570         * jit/JITOpcodes.cpp:
2571         (JSC::JIT::emit_op_throw): Updated to use JITStackFrame abstraction.
2572         (JSC::JIT::emit_op_catch): Filled out.
2573
2574 2009-05-13  Sam Weinig  <sam@webkit.org>
2575
2576         Reviewed by Geoffrey Garen.
2577
2578         Implemented op_loop_if_true, op_jfalse, op_jtrue, op_jeq_null and op_jneq_null
2579
2580         * jit/JITOpcodes.cpp:
2581         (JSC::JIT::emitSlow_op_instanceof): Moved from below to be next to its
2582         fast brother.
2583
2584         (JSC::JIT::emit_op_loop_if_true): Similar to the old version
2585         in that it tries to do the integer case first and reduce the
2586         number of jumps you might need to take.
2587         (JSC::JIT::emitSlow_op_loop_if_true):
2588
2589         (JSC::JIT::emit_op_jfalse): Very similar to op_loop_if_true, only
2590         the inverse and without a timeout check.
2591         (JSC::JIT::emitSlow_op_jfalse):
2592
2593         (JSC::JIT::emit_op_jtrue): Very similar to op_loop_if_true except
2594         without the timeout check.
2595         (JSC::JIT::emitSlow_op_jtrue):
2596
2597         (JSC::JIT::emit_op_jeq_null): Very similar to the implementation
2598         of op_eq, except it takes jumps instead of copying the condition
2599         to a dst.
2600         (JSC::JIT::emit_op_jneq_null): Ditto but for op_neq.
2601
2602 2009-05-13  Geoffrey Garen  <ggaren@apple.com>
2603
2604         Reviewed by Sam Weinig.
2605         
2606         Implemented op_call_varargs.
2607
2608         * jit/JITCall.cpp:
2609         (JSC::JIT::compileOpCallVarargsSetupArgs):
2610         (JSC::JIT::compileOpCallVarargs):
2611         (JSC::JIT::emit_op_call):
2612         (JSC::JIT::emit_op_call_eval):
2613         (JSC::JIT::emit_op_load_varargs):
2614         (JSC::JIT::emit_op_call_varargs):
2615         (JSC::JIT::emit_op_construct):
2616         * jit/JITOpcodes.cpp:
2617         (JSC::JIT::emit_op_jneq_ptr):
2618
2619 2009-05-13  Geoffrey Garen  <ggaren@apple.com>
2620
2621         Reviewed by Sam Weinig.
2622         
2623         Implemented op_call_eval.
2624
2625         * jit/JITCall.cpp:
2626         (JSC::JIT::compileOpCallVarargsSetupArgs):
2627         (JSC::JIT::compileOpCall):
2628         * jit/JITStubCall.h:
2629         (JSC::CallEvalJITStub::CallEvalJITStub):
2630
2631 2009-05-13  Sam Weinig  <sam@webkit.org>
2632
2633         Reviewed by Gavin Barraclough.
2634
2635         Implemented op_not. (Gavin did most of the work!)
2636
2637         * jit/JITOpcodes.cpp:
2638         (JSC::JIT::emit_op_not):
2639         (JSC::JIT::emitSlow_op_not):
2640
2641 2009-05-13  Geoffrey Garen  <ggaren@apple.com>
2642
2643         Reviewed by Sam Weinig.
2644         
2645         Implemented op_global_resolve.
2646
2647         * jit/JITOpcodes.cpp:
2648         (JSC::JIT::emit_op_loop_if_less):
2649         (JSC::JIT::emit_op_loop_if_lesseq): Added back accidentally removed
2650         early returns. 
2651
2652         (JSC::JIT::emit_op_resolve_global):
2653         * jit/JITStubs.cpp:
2654         (JSC::JITStubs::cti_op_resolve_global): Pretty similar to the old code,
2655         but we need two reads and a TimesEight step in order to account for the
2656         64bit value size.
2657
2658         * jit/JITStubs.h:
2659         (JSC::): Slightly tweaked this code to specialize for a JSGlobalObject*,
2660         to avoid having to pass an irrelevant tag pointer to the stub.
2661
2662 2009-05-13  Sam Weinig  <sam@webkit.org>
2663
2664         Reviewed by Geoffrey Garen.
2665
2666         Implemented op_to_jsnumber.
2667
2668         * jit/JITOpcodes.cpp:
2669         (JSC::JIT::emit_op_to_jsnumber):
2670         (JSC::JIT::emitSlow_op_to_jsnumber):
2671
2672 2009-05-13  Sam Weinig  <sam@webkit.org>
2673
2674         Reviewed by Geoffrey Garen.
2675
2676         Implemented op_convert_this.
2677
2678         * jit/JITOpcodes.cpp:
2679         (JSC::JIT::emit_op_convert_this):
2680         (JSC::JIT::emitSlow_op_convert_this):
2681
2682 2009-05-13  Geoffrey Garen  <ggaren@apple.com>
2683
2684         Reviewed by Sam Weinig.
2685         
2686         Got basic JS function and constructor calls working.
2687
2688         * jit/JIT.cpp:
2689         (JSC::JIT::privateCompileCTIMachineTrampolines):
2690         * jit/JIT.h:
2691         * jit/JITCall.cpp:
2692         (JSC::JIT::compileOpCallSetupArgs):
2693         (JSC::JIT::compileOpCallVarargsSetupArgs):
2694         (JSC::JIT::compileOpConstructSetupArgs):
2695         (JSC::JIT::emit_op_ret):
2696         (JSC::JIT::emit_op_construct_verify):
2697         (JSC::JIT::emitSlow_op_construct_verify):
2698         (JSC::JIT::emitSlow_op_call):
2699         (JSC::JIT::emitSlow_op_call_eval):
2700         (JSC::JIT::emitSlow_op_call_varargs):
2701         (JSC::JIT::emitSlow_op_construct):
2702         (JSC::JIT::compileOpCall): Filled out these cases, with call_eval #if'd out.
2703
2704         * jit/JITInlineMethods.h:
2705         (JSC::JIT::emitPutJITStubArgFromVirtualRegister):
2706         (JSC::JIT::emitLoad): Restored some legacy "*CTIArg*" functions,
2707         since I wanted to avoid the complexity of revamping the API here while
2708         trying to bring it up. Eventually, we should re-remove all of these functions.
2709
2710         (JSC::JIT::recordJumpTarget): Removed unnecessary macro cruft. You will
2711         not silence me, Sam Weinig! The world will know that you are a crufty,
2712         crufty, crufty programmer!!!
2713
2714         * jit/JITOpcodes.cpp:
2715         * jit/JITStubs.cpp:
2716         (JSC::):
2717         * jit/JITStubs.h: Changed up some offsets in the JITStackFrame class, since
2718         and off-by-one error was causing stack misalignment.
2719
2720 2009-05-13  Sam Weinig  <sam@webkit.org>
2721
2722         Reviewed by Geoffrey Garen.
2723
2724         Implement op_eq_null and op_neq_null.
2725
2726         * assembler/MacroAssemblerX86Common.h:
2727         (JSC::MacroAssemblerX86Common::set8):
2728         (JSC::MacroAssemblerX86Common::setTest8):
2729         * jit/JITOpcodes.cpp:
2730         (JSC::JIT::emit_op_stricteq):
2731         (JSC::JIT::emitSlow_op_stricteq):
2732         (JSC::JIT::emit_op_nstricteq):
2733         (JSC::JIT::emitSlow_op_nstricteq):
2734         (JSC::JIT::emit_op_eq_null):
2735         (JSC::JIT::emit_op_neq_null):
2736         * jsc.cpp:
2737
2738 2009-05-12  Sam Weinig  <sam@webkit.org>
2739
2740         Reviewed by Geoffrey Garen.
2741
2742         Implement op_new_error.
2743
2744         * jit/JITOpcodes.cpp:
2745         (JSC::JIT::emit_op_new_error):
2746         * jit/JITStubCall.h:
2747         (JSC::JITStubCall::addArgument): Add a version of addArgument
2748         that takes a constant JSValue.
2749
2750 2009-05-12  Sam Weinig  <sam@webkit.org>
2751
2752         Reviewed by Geoffrey Garen.
2753
2754         Remove now unused emitGetVariableObjectRegister and emitPutVariableObjectRegister.
2755
2756         * jit/JIT.cpp:
2757         * jit/JIT.h:
2758
2759 2009-05-12  Sam Weinig  <sam@webkit.org>
2760
2761         Reviewed by Geoffrey Garen.
2762
2763         Implement op_to_primitive and op_next_pname.
2764
2765         * jit/JITOpcodes.cpp:
2766         (JSC::JIT::emitSlow_op_construct_verify):
2767         (JSC::JIT::emit_op_to_primitive):
2768         (JSC::JIT::emitSlow_op_to_primitive):
2769         (JSC::JIT::emitSlow_op_loop_if_true):
2770         (JSC::JIT::emit_op_jtrue):
2771         (JSC::JIT::emit_op_next_pname):
2772
2773 2009-05-12  Sam Weinig  <sam@webkit.org>
2774
2775         Reviewed by Geoffrey Garen.
2776
2777         Add op_get_global_var, op_put_global_var, emit_op_get_scoped_var, emit_op_put_scoped_var and
2778         op_unexpected_load.
2779
2780         * jit/JIT.h:
2781         * jit/JITInlineMethods.h:
2782         (JSC::JIT::tagFor):
2783         (JSC::JIT::payloadFor):
2784         (JSC::JIT::emitLoad):
2785         (JSC::JIT::emitStore):
2786         (JSC::JIT::emitLoadReturnValue):
2787         * jit/JITOpcodes.cpp:
2788         (JSC::JIT::emit_op_get_global_var):
2789         (JSC::JIT::emit_op_put_global_var):
2790         (JSC::JIT::emit_op_get_scoped_var):
2791         (JSC::JIT::emit_op_put_scoped_var):
2792         (JSC::JIT::emit_op_unexpected_load):
2793
2794 2009-05-12  Geoffrey Garen  <ggaren@apple.com>
2795
2796         Reviewed by Sam Weinig.
2797
2798         Added overflow handling to op_sub.
2799
2800         * jit/JIT.h:
2801         * jit/JITArithmetic.cpp:
2802         (JSC::JIT::emitSlow_op_sub):
2803         (JSC::JIT::emitSlowSub32InPlaceLeft):
2804
2805 2009-05-12  Sam Weinig  <sam@webkit.org>
2806
2807         Reviewed by Geoffrey Garen.
2808
2809         Remove a function call by folding op_get_by_id and op_put_by_id into
2810         their respective compile functions.
2811
2812         * jit/JIT.h:
2813         * jit/JITPropertyAccess.cpp:
2814         (JSC::JIT::emit_op_get_by_id):
2815         (JSC::JIT::emitSlow_op_get_by_id):
2816         (JSC::JIT::emit_op_put_by_id):
2817         (JSC::JIT::emitSlow_op_put_by_id):
2818
2819 2009-05-12  Sam Weinig  <sam@webkit.org>
2820
2821         Reviewed by Geoffrey Garen.
2822
2823         Make JITStubCall work in 64bit by making the stack index
2824         step dependent on the size of void*.
2825
2826         * jit/JITStubCall.h:
2827         (JSC::JITStubCall::JITStubCall):
2828         (JSC::JITStubCall::addArgument):
2829
2830 2009-05-12  Sam Weinig  <sam@webkit.org>
2831
2832         Reviewed by Geoffrey Garen.
2833
2834         Implement simple version of property access opcodes
2835         which just call a stub functions.
2836
2837         * jit/JITOpcodes.cpp:
2838         * jit/JITPropertyAccess.cpp:
2839         (JSC::JIT::emitSlow_op_put_by_id):
2840         (JSC::JIT::emitSlow_op_get_by_id):
2841         (JSC::JIT::emit_op_get_by_val):
2842         (JSC::JIT::emitSlow_op_get_by_val):
2843         (JSC::JIT::emit_op_put_by_val):
2844         (JSC::JIT::emitSlow_op_put_by_val):
2845         (JSC::JIT::emit_op_put_by_index):
2846         (JSC::JIT::emit_op_put_getter):
2847         (JSC::JIT::emit_op_put_setter):
2848         (JSC::JIT::emit_op_del_by_id):
2849         (JSC::JIT::compileGetByIdHotPath):
2850         (JSC::JIT::compilePutByIdHotPath):
2851         * jit/JITStubCall.h:
2852         (JSC::JITStubCall::addArgument):
2853         * jsc.cpp:
2854
2855 2009-05-12  Geoffrey Garen  <ggaren@apple.com>
2856
2857         Reviewed by Sam Weinig.
2858         
2859         Added work-around for XCode debugging echo problem.
2860
2861         * jsc.cpp:
2862         (runInteractive):
2863
2864 2009-05-12  Geoffrey Garen  <ggaren@apple.com>
2865
2866         Reviewed by Sam Weinig.
2867         
2868         Added overflow handling to op_add.
2869
2870         * jit/JIT.h:
2871         * jit/JITArithmetic.cpp:
2872         (JSC::JIT::emitSlow_op_add):
2873         (JSC::JIT::emitSlowAdd32InPlace):
2874
2875 2009-05-12  Sam Weinig  <sam@webkit.org>
2876
2877         Reviewed by Geoffrey Garen.
2878
2879         Add slow cases for op_jnless or emit_op_jnlesseq.
2880
2881         * jit/JITArithmetic.cpp:
2882         (JSC::JIT::emitSlow_op_jnless):
2883         (JSC::JIT::emitSlow_op_jnlesseq):
2884
2885 2009-05-12  Sam Weinig  <sam@webkit.org>
2886
2887         Reviewed by Geoffrey Garen.
2888
2889         Add implementations for op_jnless, emit_op_jnlesseq, op_loop_if_less and op_loop_if_lesseq.
2890         No slow cases for op_jnless or emit_op_jnlesseq yet.
2891
2892         * jit/JITArithmetic.cpp:
2893         (JSC::JIT::emit_op_jnless):
2894         (JSC::JIT::emitSlow_op_jnless):
2895         (JSC::JIT::emit_op_jnlesseq):
2896         (JSC::JIT::emitSlow_op_jnlesseq):
2897         * jit/JITOpcodes.cpp:
2898         (JSC::JIT::emit_op_loop_if_less):
2899         (JSC::JIT::emitSlow_op_loop_if_less):
2900         (JSC::JIT::emit_op_loop_if_lesseq):
2901         (JSC::JIT::emitSlow_op_loop_if_lesseq):
2902
2903 2009-05-12  Sam Weinig  <sam@webkit.org>
2904
2905         Reviewed by Geoffrey Garen.
2906
2907         Turn the RECORD_JUMP_TARGET macro into an inline function.
2908
2909         * jit/JIT.h:
2910         * jit/JITInlineMethods.h:
2911         (JSC::JIT::recordJumpTarget):
2912         * jit/JITOpcodes.cpp:
2913         (JSC::JIT::emit_op_jmp):
2914         (JSC::JIT::emit_op_jsr):
2915         (JSC::JIT::emit_op_jmp_scopes):
2916
2917 2009-05-12  Sam Weinig  <sam@webkit.org>
2918
2919         Add MacroAssemblerX86Common::set8 to fix the build.
2920
2921         * assembler/MacroAssemblerX86Common.h:
2922         (JSC::MacroAssemblerX86Common::set8):
2923
2924 2009-05-12  Geoffrey Garen  <ggaren@apple.com>
2925
2926         Reviewed by Sam Weinig.
2927         
2928         Added overflow recovery for pre_inc and pre_dec.
2929         
2930         Turned some short-circuit code into early returns, as is the WebKit style.
2931
2932         * jit/JITArithmetic.cpp:
2933         (JSC::JIT::emit_op_post_inc):
2934         (JSC::JIT::emitSlow_op_post_inc):
2935         (JSC::JIT::emit_op_post_dec):
2936         (JSC::JIT::emitSlow_op_post_dec):
2937         (JSC::JIT::emitSlow_op_pre_inc):
2938         (JSC::JIT::emitSlow_op_pre_dec):
2939
2940 2009-05-12  Sam Weinig  <sam@webkit.org>
2941
2942         Reviewed by Geoffrey Garen.
2943
2944         Implement op_jmp, op_loop, op_eq and op_neq.
2945
2946         * jit/JITOpcodes.cpp:
2947         (JSC::JIT::emit_op_jmp):
2948         (JSC::JIT::emit_op_loop):
2949         (JSC::JIT::emit_op_eq):
2950         (JSC::JIT::emitSlow_op_eq):
2951         (JSC::JIT::emit_op_neq):
2952         (JSC::JIT::emitSlow_op_neq):
2953         (JSC::JIT::emit_op_enter):
2954         (JSC::JIT::emit_op_enter_with_activation):
2955
2956 2009-05-12  Sam Weinig  <sam@webkit.org>
2957
2958         Reviewed by Geoffrey Garen.
2959
2960         Implement the slow cases for arithmetic opcodes.
2961
2962         * jit/JITArithmetic.cpp:
2963         (JSC::JIT::emitSlow_op_lshift):
2964         (JSC::JIT::emitSlow_op_rshift):
2965         (JSC::JIT::emitSlow_op_bitand):
2966         (JSC::JIT::emitSlow_op_bitor):
2967         (JSC::JIT::emitSlow_op_bitxor):
2968         (JSC::JIT::emitSlow_op_bitnot):
2969         (JSC::JIT::emitSlow_op_sub):
2970         (JSC::JIT::emitSlow_op_mul):
2971         (JSC::JIT::emitSlow_op_mod):
2972         (JSC::JIT::emit_op_mod):
2973
2974 2009-05-12  Sam Weinig  <sam@webkit.org>
2975
2976         Reviewed by Geoffrey Garen.
2977
2978         Implement op_bitnot.
2979
2980         * assembler/MacroAssemblerX86Common.h:
2981         (JSC::MacroAssemblerX86Common::not32):
2982         * assembler/X86Assembler.h:
2983         (JSC::X86Assembler::notl_m):
2984         * jit/JITArithmetic.cpp:
2985         (JSC::JIT::emit_op_bitnot):
2986
2987 2009-05-12  Sam Weinig  <sam@webkit.org>
2988
2989         Reviewed by Geoffrey Garen.
2990
2991         Add arithmetic opcode implementations from the old nitro-extreme branch.
2992
2993         * jit/JIT.h:
2994         * jit/JITArithmetic.cpp:
2995         (JSC::JIT::emit_op_jnless):
2996         (JSC::JIT::emitSlow_op_jnless):
2997         (JSC::JIT::emit_op_jnlesseq):
2998         (JSC::JIT::emitSlow_op_jnlesseq):
2999         (JSC::JIT::emit_op_lshift):
3000         (JSC::JIT::emitSlow_op_lshift):
3001         (JSC::JIT::emit_op_rshift):
3002         (JSC::JIT::emitSlow_op_rshift):
3003         (JSC::JIT::emit_op_bitand):
3004         (JSC::JIT::emitBitAnd32Constant):
3005         (JSC::JIT::emitBitAnd32InPlace):
3006         (JSC::JIT::emit_op_bitor):
3007         (JSC::JIT::emitSlow_op_bitor):
3008         (JSC::JIT::emitBitOr32Constant):
3009         (JSC::JIT::emitBitOr32InPlace):
3010         (JSC::JIT::emit_op_bitxor):
3011         (JSC::JIT::emitSlow_op_bitxor):
3012         (JSC::JIT::emitBitXor32Constant):
3013         (JSC::JIT::emitBitXor32InPlace):
3014         (JSC::JIT::emit_op_bitnot):
3015         (JSC::JIT::emitSlow_op_bitnot):
3016         (JSC::JIT::emit_op_post_inc):
3017         (JSC::JIT::emitSlow_op_post_inc):
3018         (JSC::JIT::emit_op_post_dec):
3019         (JSC::JIT::emitSlow_op_post_dec):
3020         (JSC::JIT::emit_op_pre_inc):
3021         (JSC::JIT::emitSlow_op_pre_inc):
3022         (JSC::JIT::emit_op_pre_dec):
3023         (JSC::JIT::emitSlow_op_pre_dec):
3024         (JSC::JIT::emit_op_add):
3025         (JSC::JIT::emitAdd32Constant):
3026         (JSC::JIT::emitAdd32InPlace):
3027         (JSC::JIT::emitSlow_op_add):
3028         (JSC::JIT::emit_op_sub):
3029         (JSC::JIT::emitSlow_op_sub):
3030         (JSC::JIT::emitSub32ConstantLeft):
3031         (JSC::JIT::emitSub32ConstantRight):
3032         (JSC::JIT::emitSub32InPlaceLeft):
3033         (JSC::JIT::emitSub32InPlaceRight):
3034         (JSC::JIT::emit_op_mul):
3035         (JSC::JIT::emitSlow_op_mul):
3036         (JSC::JIT::emitMul32Constant):
3037         (JSC::JIT::emitMul32InPlace):
3038         (JSC::JIT::emit_op_mod):
3039         (JSC::JIT::emitSlow_op_mod):
3040         * jit/JITOpcodes.cpp:
3041
3042 2009-05-12  Geoffrey Garen  <ggaren@apple.com>
3043
3044         Removed JIT_OPTIMIZE_ARITHMETIC setting, since it was all about 32bit
3045         value representations.
3046         
3047         Added JSAPIValueWrapper to the repository.
3048
3049         * jit/JIT.h:
3050         * jit/JITArithmetic.cpp:
3051         * runtime/JSAPIValueWrapper.cpp: Added.
3052         (JSC::JSAPIValueWrapper::toPrimitive):
3053         (JSC::JSAPIValueWrapper::getPrimitiveNumber):
3054         (JSC::JSAPIValueWrapper::toBoolean):
3055         (JSC::JSAPIValueWrapper::toNumber):
3056         (JSC::JSAPIValueWrapper::toString):
3057         (JSC::JSAPIValueWrapper::toObject):
3058         * runtime/JSAPIValueWrapper.h: Added.
3059         (JSC::JSAPIValueWrapper::value):
3060         (JSC::JSAPIValueWrapper::isAPIValueWrapper):
3061         (JSC::JSAPIValueWrapper::JSAPIValueWrapper):
3062         (JSC::jsAPIValueWrapper):
3063         * wtf/Platform.h:
3064
3065 2009-05-12  Geoffrey Garen  <ggaren@apple.com>
3066
3067         Turned on the JIT and got it building and running the most trivial of
3068         programs.
3069         
3070         All configurable optimizations are turned off, and a few opcodes are ad
3071         hoc #if'd out.
3072         
3073         So far, I've only merged op_mov and op_end, but some stub-reliant
3074         opcodes work as-is from TOT.
3075         
3076         * bytecode/CodeBlock.cpp:
3077         (JSC::CodeBlock::~CodeBlock):
3078         * bytecode/CodeBlock.h:
3079         * jit/JIT.cpp:
3080         (JSC::JIT::compileOpStrictEq):
3081         * jit/JIT.h:
3082         * jit/JITArithmetic.cpp:
3083         (JSC::JIT::emit_op_lshift):
3084         (JSC::JIT::emitSlow_op_lshift):
3085         (JSC::JIT::emit_op_rshift):
3086         (JSC::JIT::emitSlow_op_rshift):
3087         (JSC::JIT::emit_op_jnless):
3088         (JSC::JIT::emitSlow_op_jnless):
3089         (JSC::JIT::emit_op_jnlesseq):
3090         (JSC::JIT::emitSlow_op_jnlesseq):
3091         (JSC::JIT::emit_op_bitand):
3092         (JSC::JIT::emitSlow_op_bitand):
3093         (JSC::JIT::emit_op_post_inc):
3094         (JSC::JIT::emitSlow_op_post_inc):
3095         (JSC::JIT::emit_op_post_dec):
3096         (JSC::JIT::emitSlow_op_post_dec):
3097         (JSC::JIT::emit_op_pre_inc):
3098         (JSC::JIT::emitSlow_op_pre_inc):
3099         (JSC::JIT::emit_op_pre_dec):
3100         (JSC::JIT::emitSlow_op_pre_dec):
3101         (JSC::JIT::emit_op_mod):
3102         (JSC::JIT::emitSlow_op_mod):
3103         (JSC::JIT::emit_op_add):
3104         (JSC::JIT::emit_op_mul):
3105         (JSC::JIT::emit_op_sub):
3106         (JSC::JIT::compileBinaryArithOpSlowCase):
3107         (JSC::JIT::emitSlow_op_add):
3108         (JSC::JIT::emitSlow_op_mul):
3109         * jit/JITCall.cpp:
3110         (JSC::JIT::compileOpCallInitializeCallFrame):
3111         (JSC::JIT::compileOpConstructSetupArgs):
3112         (JSC::JIT::compileOpCallVarargs):
3113         (JSC::JIT::compileOpCall):
3114         (JSC::JIT::compileOpCallSlowCase):
3115         * jit/JITInlineMethods.h:
3116         (JSC::JIT::getConstantOperandImmediateInt):
3117         (JSC::JIT::isOperandConstantImmediateInt):
3118         (JSC::JIT::emitInitRegister):
3119         (JSC::JIT::addSlowCase):
3120         (JSC::JIT::addJump):
3121         (JSC::JIT::emitJumpSlowToHot):
3122         (JSC::JIT::tagFor):
3123         (JSC::JIT::payloadFor):
3124         (JSC::JIT::emitLoad):
3125         (JSC::JIT::emitLoadReturnValue):
3126         (JSC::JIT::emitStore):
3127         (JSC::JIT::emitStoreReturnValue):
3128         * jit/JITOpcodes.cpp:
3129         (JSC::JIT::emit_op_mov):
3130         (JSC::JIT::emit_op_end):
3131         (JSC::JIT::emit_op_jmp):
3132         (JSC::JIT::emit_op_loop):
3133         (JSC::JIT::emit_op_loop_if_less):
3134         (JSC::JIT::emit_op_loop_if_lesseq):
3135         (JSC::JIT::emit_op_instanceof):
3136         (JSC::JIT::emit_op_get_global_var):
3137         (JSC::JIT::emit_op_put_global_var):
3138         (JSC::JIT::emit_op_get_scoped_var):
3139         (JSC::JIT::emit_op_put_scoped_var):
3140         (JSC::JIT::emit_op_tear_off_activation):
3141         (JSC::JIT::emit_op_ret):
3142         (JSC::JIT::emit_op_construct_verify):
3143         (JSC::JIT::emit_op_to_primitive):
3144         (JSC::JIT::emit_op_loop_if_true):
3145         (JSC::JIT::emit_op_resolve_global):
3146         (JSC::JIT::emit_op_not):
3147         (JSC::JIT::emit_op_jfalse):
3148         (JSC::JIT::emit_op_jeq_null):
3149         (JSC::JIT::emit_op_jneq_null):
3150         (JSC::JIT::emit_op_jneq_ptr):
3151         (JSC::JIT::emit_op_unexpected_load):
3152         (JSC::JIT::emit_op_eq):
3153         (JSC::JIT::emit_op_bitnot):
3154         (JSC::JIT::emit_op_jtrue):
3155         (JSC::JIT::emit_op_neq):
3156         (JSC::JIT::emit_op_bitxor):
3157         (JSC::JIT::emit_op_bitor):
3158         (JSC::JIT::emit_op_throw):
3159         (JSC::JIT::emit_op_next_pname):
3160         (JSC::JIT::emit_op_push_scope):
3161         (JSC::JIT::emit_op_to_jsnumber):
3162         (JSC::JIT::emit_op_push_new_scope):
3163         (JSC::JIT::emit_op_catch):
3164         (JSC::JIT::emit_op_switch_imm):
3165         (JSC::JIT::emit_op_switch_char):
3166         (JSC::JIT::emit_op_switch_string):
3167         (JSC::JIT::emit_op_new_error):
3168         (JSC::JIT::emit_op_eq_null):
3169         (JSC::JIT::emit_op_neq_null):
3170         (JSC::JIT::emit_op_convert_this):
3171         (JSC::JIT::emit_op_profile_will_call):
3172         (JSC::JIT::emit_op_profile_did_call):
3173         (JSC::JIT::emitSlow_op_construct_verify):
3174         (JSC::JIT::emitSlow_op_get_by_val):
3175         (JSC::JIT::emitSlow_op_loop_if_less):
3176         (JSC::JIT::emitSlow_op_loop_if_lesseq):
3177         (JSC::JIT::emitSlow_op_put_by_val):
3178         (JSC::JIT::emitSlow_op_not):
3179         (JSC::JIT::emitSlow_op_instanceof):
3180         * jit/JITPropertyAccess.cpp:
3181         (JSC::JIT::emit_op_get_by_val):
3182         (JSC::JIT::emit_op_put_by_val):
3183         (JSC::JIT::emit_op_put_by_index):
3184         (JSC::JIT::emit_op_put_getter):
3185         (JSC::JIT::emit_op_put_setter):
3186         (JSC::JIT::emit_op_del_by_id):
3187         (JSC::JIT::compileGetByIdHotPath):
3188         (JSC::JIT::compilePutByIdHotPath):
3189         * jit/JITStubCall.h:
3190         (JSC::JITStubCall::JITStubCall):
3191         (JSC::JITStubCall::addArgument):
3192         (JSC::JITStubCall::call):
3193         (JSC::JITStubCall::):
3194         (JSC::CallEvalJITStub::CallEvalJITStub):
3195         * jit/JITStubs.cpp:
3196         (JSC::):
3197         (JSC::JITStubs::cti_op_add):
3198         (JSC::JITStubs::cti_op_pre_inc):
3199         (JSC::JITStubs::cti_op_mul):
3200         (JSC::JITStubs::cti_op_get_by_val):
3201         (JSC::JITStubs::cti_op_get_by_val_string):
3202         (JSC::JITStubs::cti_op_get_by_val_byte_array):
3203         (JSC::JITStubs::cti_op_sub):
3204         (JSC::JITStubs::cti_op_put_by_val):
3205         (JSC::JITStubs::cti_op_put_by_val_array):
3206         (JSC::JITStubs::cti_op_put_by_val_byte_array):
3207         (JSC::JITStubs::cti_op_negate):
3208         (JSC::JITStubs::cti_op_div):
3209         (JSC::JITStubs::cti_op_pre_dec):
3210         (JSC::JITStubs::cti_op_post_inc):
3211         (JSC::JITStubs::cti_op_eq):
3212         (JSC::JITStubs::cti_op_lshift):
3213         (JSC::JITStubs::cti_op_bitand):
3214         (JSC::JITStubs::cti_op_rshift):
3215         (JSC::JITStubs::cti_op_bitnot):
3216         (JSC::JITStubs::cti_op_mod):
3217         (JSC::JITStubs::cti_op_neq):
3218         (JSC::JITStubs::cti_op_post_dec):
3219         (JSC::JITStubs::cti_op_urshift):
3220         (JSC::JITStubs::cti_op_bitxor):
3221         (JSC::JITStubs::cti_op_bitor):
3222         (JSC::JITStubs::cti_op_switch_imm):
3223         * jit/JITStubs.h:
3224         * runtime/JSArray.cpp:
3225         (JSC::JSArray::JSArray):
3226         * runtime/JSFunction.cpp:
3227         (JSC::JSFunction::~JSFunction):
3228         * runtime/JSValue.h:
3229         (JSC::JSValue::payload):
3230         * wtf/Platform.h:
3231
3232 2009-05-07  Sam Weinig  <sam@webkit.org>
3233
3234         Reviewed by Geoffrey Garen.
3235
3236         Add some new MacroAssembler and assembler functions that will be needed shortly.
3237
3238         * assembler/MacroAssemblerX86Common.h:
3239         (JSC::MacroAssemblerX86Common::add32):
3240         (JSC::MacroAssemblerX86Common::and32):
3241         (JSC::MacroAssemblerX86Common::mul32):
3242         (JSC::MacroAssemblerX86Common::neg32):
3243         (JSC::MacroAssemblerX86Common::or32):
3244         (JSC::MacroAssemblerX86Common::sub32):
3245         (JSC::MacroAssemblerX86Common::xor32):
3246         (JSC::MacroAssemblerX86Common::branchAdd32):
3247         (JSC::MacroAssemblerX86Common::branchMul32):
3248         (JSC::MacroAssemblerX86Common::branchSub32):
3249         * assembler/X86Assembler.h:
3250         (JSC::X86Assembler::):
3251         (JSC::X86Assembler::addl_rm):
3252         (JSC::X86Assembler::andl_mr):
3253         (JSC::X86Assembler::andl_rm):
3254         (JSC::X86Assembler::andl_im):
3255         (JSC::X86Assembler::negl_r):
3256         (JSC::X86Assembler::notl_r):
3257         (JSC::X86Assembler::orl_rm):
3258         (JSC::X86Assembler::orl_im):
3259         (JSC::X86Assembler::subl_rm):
3260         (JSC::X86Assembler::xorl_mr):
3261         (JSC::X86Assembler::xorl_rm):
3262         (JSC::X86Assembler::xorl_im):
3263         (JSC::X86Assembler::imull_mr):
3264
3265 2009-05-11  Sam Weinig  <sam@webkit.org>
3266
3267         Reviewed by Cameron Zwarich.
3268
3269         Remove the NumberHeap.
3270
3271         * JavaScriptCore.exp:
3272         * runtime/Collector.cpp:
3273         (JSC::Heap::Heap):
3274         (JSC::Heap::destroy):
3275         (JSC::Heap::recordExtraCost):
3276         (JSC::Heap::heapAllocate):
3277         (JSC::Heap::markConservatively):
3278         (JSC::Heap::sweep):
3279         (JSC::Heap::collect):
3280         (JSC::Heap::objectCount):
3281         (JSC::Heap::statistics):
3282         (JSC::typeName):
3283         (JSC::Heap::isBusy):
3284         * runtime/Collector.h:
3285         (JSC::Heap::globalData):
3286         * runtime/JSCell.h:
3287
3288 2009-05-11  Geoffrey Garen  <ggaren@apple.com>
3289
3290         Reviewed by Sam Weinig.
3291
3292         Land initial commit of new number representation for 32 bit platforms,
3293         with JIT disabled.
3294
3295         * API/APICast.h:
3296         (toJS):
3297         (toRef):
3298         * API/JSCallbackObjectFunctions.h:
3299         (JSC::::hasInstance):
3300         (JSC::::toNumber):
3301         (JSC::::toString):
3302         * API/tests/testapi.c:
3303         (EvilExceptionObject_convertToType):
3304         * AllInOneFile.cpp:
3305         * JavaScriptCore.exp:
3306         * JavaScriptCore.xcodeproj/project.pbxproj:
3307         * bytecode/CodeBlock.cpp:
3308         (JSC::valueToSourceString):
3309         * bytecompiler/BytecodeGenerator.cpp:
3310         (JSC::BytecodeGenerator::emitLoad):
3311         (JSC::BytecodeGenerator::emitUnexpectedLoad):
3312         (JSC::keyForImmediateSwitch):
3313         * bytecompiler/BytecodeGenerator.h:
3314         * interpreter/Interpreter.cpp:
3315         (JSC::Interpreter::dumpRegisters):
3316         (JSC::Interpreter::privateExecute):
3317         * parser/Nodes.cpp:
3318         (JSC::ArrayNode::emitBytecode):
3319         (JSC::processClauseList):
3320         * runtime/ArgList.h:
3321         * runtime/Collector.h:
3322         (JSC::sizeof):
3323         * runtime/DateMath.cpp:
3324         * runtime/ExceptionHelpers.h:
3325         * runtime/InitializeThreading.cpp:
3326         * runtime/JSArray.cpp:
3327         (JSC::JSArray::JSArray):
3328         * runtime/JSCell.cpp:
3329         * runtime/JSCell.h:
3330         (JSC::JSCell::isAPIValueWrapper):
3331         (JSC::JSValue::isString):
3332         (JSC::JSValue::isGetterSetter):
3333         (JSC::JSValue::isObject):
3334         (JSC::JSValue::getString):
3335         (JSC::JSValue::getObject):
3336         (JSC::JSValue::getCallData):
3337         (JSC::JSValue::getConstructData):
3338         (JSC::JSValue::getUInt32):
3339         (JSC::JSValue::marked):
3340         (JSC::JSValue::toPrimitive):
3341         (JSC::JSValue::getPrimitiveNumber):
3342         (JSC::JSValue::toBoolean):
3343         (JSC::JSValue::toNumber):
3344         (JSC::JSValue::toString):
3345         (JSC::JSValue::needsThisConversion):
3346         (JSC::JSValue::toThisString):
3347         (JSC::JSValue::getJSNumber):
3348         (JSC::JSValue::toObject):
3349         (JSC::JSValue::toThisObject):
3350         * runtime/JSGlobalData.cpp:
3351         (JSC::JSGlobalData::JSGlobalData):
3352         * runtime/JSGlobalData.h:
3353         * runtime/JSGlobalObject.h:
3354         (JSC::Structure::prototypeForLookup):
3355         * runtime/JSGlobalObjectFunctions.cpp:
3356         (JSC::globalFuncParseInt):
3357         * runtime/JSImmediate.h:
3358         * runtime/JSNumberCell.cpp: Removed.
3359         * runtime/JSNumberCell.h: Removed.
3360         * runtime/JSObject.h:
3361         (JSC::JSValue::get):
3362         (JSC::JSValue::put):
3363         * runtime/JSString.h:
3364         (JSC::JSValue::toThisJSString):
3365         * runtime/JSValue.cpp:
3366         (JSC::JSValue::toInteger):
3367         (JSC::JSValue::toIntegerPreserveNaN):
3368         (JSC::JSValue::toObjectSlowCase):
3369         (JSC::JSValue::toThisObjectSlowCase):
3370         (JSC::JSValue::synthesizeObject):
3371         (JSC::JSValue::synthesizePrototype):
3372         (JSC::JSValue::description):
3373         (JSC::nonInlineNaN):
3374         * runtime/JSValue.h:
3375         (JSC::JSValue::):
3376         (JSC::EncodedJSValueHashTraits::emptyValue):
3377         (JSC::jsNaN):
3378         (JSC::operator==):
3379         (JSC::operator!=):
3380         (JSC::toInt32):
3381         (JSC::toUInt32):
3382         (JSC::JSValue::encode):
3383         (JSC::JSValue::decode):
3384         (JSC::JSValue::JSValue):
3385         (JSC::JSValue::operator bool):
3386         (JSC::JSValue::operator==):
3387         (JSC::JSValue::operator!=):
3388         (JSC::JSValue::isUndefined):
3389         (JSC::JSValue::isNull):
3390         (JSC::JSValue::isUndefinedOrNull):
3391         (JSC::JSValue::isCell):
3392         (JSC::JSValue::isInt32):
3393         (JSC::JSValue::isUInt32):
3394         (JSC::JSValue::isDouble):
3395         (JSC::JSValue::isTrue):
3396         (JSC::JSValue::isFalse):
3397         (JSC::JSValue::tag):
3398         (JSC::JSValue::asInt32):
3399         (JSC::JSValue::asUInt32):
3400         (JSC::JSValue::asDouble):
3401         (JSC::JSValue::asCell):
3402         (JSC::JSValue::isNumber):
3403         (JSC::JSValue::isBoolean):
3404         (JSC::JSValue::getBoolean):
3405         (JSC::JSValue::uncheckedGetNumber):
3406         (JSC::JSValue::toJSNumber):
3407         (JSC::JSValue::getNumber):
3408         (JSC::JSValue::toInt32):
3409         (JSC::JSValue::toUInt32):
3410         * runtime/Operations.h:
3411         (JSC::JSValue::equal):
3412         (JSC::JSValue::equalSlowCaseInline):
3413         (JSC::JSValue::strictEqual):
3414         (JSC::JSValue::strictEqualSlowCaseInline):
3415         (JSC::jsLess):
3416         (JSC::jsLessEq):
3417         (JSC::jsAdd):
3418         * runtime/PropertySlot.h:
3419         * runtime/StringPrototype.cpp:
3420         (JSC::stringProtoFuncCharAt):
3421         (JSC::stringProtoFuncCharCodeAt):
3422         (JSC::stringProtoFuncIndexOf):
3423         * wtf/Platform.h:
3424
3425 === Start merge of nitro-extreme branch 2009-07-30 ===
3426
3427 2009-07-29  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
3428
3429         Reviewed by George Staikos.
3430
3431         Resolve class/struct mixup in forward declarations
3432         https://bugs.webkit.org/show_bug.cgi?id=27708
3433
3434         * API/JSClassRef.h:
3435         * bytecode/SamplingTool.h:
3436         * interpreter/Interpreter.h:
3437         * jit/JIT.h:
3438         * profiler/ProfileGenerator.h:
3439         * profiler/Profiler.h:
3440         * runtime/ClassInfo.h:
3441         * runtime/ExceptionHelpers.h:
3442         * runtime/JSByteArray.h:
3443         * runtime/JSCell.h:
3444         * runtime/JSFunction.h:
3445         * runtime/JSGlobalData.h:
3446         * runtime/JSObject.h:
3447         * runtime/JSString.h:
3448
3449 2009-07-28  Ada Chan  <adachan@apple.com>        
3450
3451         Reviewed by Darin Adler.
3452
3453         https://bugs.webkit.org/show_bug.cgi?id=27236
3454         - Implement TCMalloc_SystemRelease and TCMalloc_SystemCommit for Windows.
3455         - Use a background thread to periodically scavenge memory to release back to the system.
3456
3457         * wtf/FastMalloc.cpp:
3458         (WTF::TCMalloc_PageHeap::init):
3459         (WTF::TCMalloc_PageHeap::runScavengerThread):
3460         (WTF::TCMalloc_PageHeap::scavenge):
3461         (WTF::TCMalloc_PageHeap::shouldContinueScavenging):
3462         (WTF::TCMalloc_PageHeap::New):
3463         (WTF::TCMalloc_PageHeap::AllocLarge):
3464         (WTF::TCMalloc_PageHeap::Delete):
3465         (WTF::TCMalloc_PageHeap::GrowHeap):
3466         (WTF::sleep):
3467         (WTF::TCMalloc_PageHeap::scavengerThread):
3468         * wtf/TCSystemAlloc.cpp:
3469         (TCMalloc_SystemRelease):
3470         (TCMalloc_SystemCommit):
3471         * wtf/TCSystemAlloc.h:
3472
3473 2009-07-28  Xan Lopez  <xlopez@igalia.com>
3474
3475         Add new files, fixes distcheck.
3476
3477         * GNUmakefile.am:
3478
3479 2009-07-28  Csaba Osztrogonac  <oszi@inf.u-szeged.hu>
3480
3481         Reviewed by Simon Hausmann.
3482
3483         [Qt] Determining whether to use JIT or interpreter
3484         moved from JavaScriptCore.pri to Platform.h
3485
3486         * JavaScriptCore.pri:
3487         * wtf/Platform.h:
3488
3489 2009-07-27  Brian Weinstein  <bweinstein@apple.com>
3490
3491         Fix of misuse of sort command.
3492
3493         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3494         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
3495
3496 2009-07-27  Brian Weinstein  <bweinstein@apple.com>
3497
3498         Build fix for Windows.
3499
3500         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3501         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
3502
3503 2009-07-27  Gavin Barraclough  <barraclough@apple.com>
3504
3505         Rubber stamped by Oliver Hunt.
3506
3507         Fix tyop in JIT, renamed preverveReturnAddressAfterCall -> preserveReturnAddressAfterCall.
3508
3509         * jit/JIT.cpp:
3510         (JSC::JIT::privateCompile):
3511         (JSC::JIT::privateCompileCTIMachineTrampolines):
3512         * jit/JIT.h:
3513         * jit/JITInlineMethods.h:
3514         (JSC::JIT::preserveReturnAddressAfterCall):
3515         * jit/JITPropertyAccess.cpp:
3516         (JSC::JIT::privateCompilePutByIdTransition):
3517
3518 2009-07-27  Alexey Proskuryakov  <ap@webkit.org>
3519
3520         Gtk build fix.
3521
3522         * runtime/JSLock.cpp: (JSC::JSLock::JSLock): Fix "no threading" case.
3523
3524 2009-07-27  Alexey Proskuryakov  <ap@webkit.org>
3525
3526         Release build fix.
3527
3528         * runtime/JSLock.h: (JSC::JSLock::~JSLock):
3529
3530 2009-07-27  Alexey Proskuryakov  <ap@webkit.org>
3531
3532         Reviewed by Darin Adler.
3533
3534         https://bugs.webkit.org/show_bug.cgi?id=27735
3535         Give a helpful name to JSLock constructor argument
3536
3537         * API/JSBase.cpp:
3538         (JSGarbageCollect):
3539         * API/JSContextRef.cpp:
3540         * API/JSObjectRef.cpp:
3541         (JSPropertyNameArrayRelease):
3542         (JSPropertyNameAccumulatorAddName):
3543         * JavaScriptCore.exp:
3544         * jsc.cpp:
3545         (functionGC):
3546         (cleanupGlobalData):
3547         (jscmain):
3548         * runtime/Collector.cpp:
3549         (JSC::Heap::destroy):
3550         * runtime/JSLock.cpp:
3551         (JSC::JSLock::JSLock):
3552         (JSC::JSLock::lock):
3553         (JSC::JSLock::unlock):
3554         (JSC::JSLock::DropAllLocks::DropAllLocks):
3555         (JSC::JSLock::DropAllLocks::~DropAllLocks):
3556         * runtime/JSLock.h:
3557         (JSC::):
3558         (JSC::JSLock::JSLock):
3559         (JSC::JSLock::~JSLock):
3560
3561 2009-07-25  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
3562
3563         Reviewed by Eric Seidel.
3564
3565         Allow custom memory allocation control for OpaqueJSPropertyNameArray struct
3566         https://bugs.webkit.org/show_bug.cgi?id=27342
3567
3568         Inherits OpaqueJSPropertyNameArray struct from FastAllocBase because it has been
3569         instantiated by 'new' JavaScriptCore/API/JSObjectRef.cpp:473.
3570
3571         * API/JSObjectRef.cpp:
3572
3573 2009-07-24  Ada Chan  <adachan@apple.com>
3574
3575         In preparation for https://bugs.webkit.org/show_bug.cgi?id=27236:
3576         Remove TCMALLOC_TRACK_DECOMMITED_SPANS.  We'll always track decommitted spans.
3577         We have tested this and show it has little impact on performance.
3578
3579         Reviewed by Mark Rowe.
3580
3581         * wtf/FastMalloc.cpp:
3582         (WTF::TCMalloc_PageHeap::New):
3583         (WTF::TCMalloc_PageHeap::AllocLarge):
3584         (WTF::propagateDecommittedState):
3585         (WTF::mergeDecommittedStates):
3586         (WTF::TCMalloc_PageHeap::Delete):
3587         (WTF::TCMalloc_PageHeap::IncrementalScavenge):
3588
3589 2009-07-24  Csaba Osztrogonac  <oszi@inf.u-szeged.hu>
3590
3591         Reviewed by Darin Adler and Adam Barth.
3592
3593         Build fix for x86 platforms.
3594         https://bugs.webkit.org/show_bug.cgi?id=27602
3595
3596         * jit/JIT.cpp:
3597
3598 2009-07-23  Kevin Ollivier  <kevino@theolliviers.com>
3599
3600         wx build fix, adding missing header.
3601
3602         * jit/JIT.cpp:
3603
3604 2009-07-22  Yong Li  <yong.li@torchmobile.com>
3605
3606         Reviewed by George Staikos.
3607
3608         Add wince specific memory files into wtf/wince
3609         https://bugs.webkit.org/show_bug.cgi?id=27550
3610
3611         * wtf/wince/FastMallocWince.h: Added.
3612         * wtf/wince/MemoryManager.cpp: Added.
3613         * wtf/wince/MemoryManager.h: Added.
3614
3615 2009-07-23  Norbert Leser  <norbert.leser@nokia.com>
3616
3617         Reviewed by Simon Hausmann.
3618
3619         Fix for missing mmap features in Symbian
3620         https://bugs.webkit.org/show_bug.cgi?id=24540
3621
3622         Fix, conditionally for PLATFORM(SYMBIAN), as an alternative 
3623         to missing support for the MAP_ANON property flag in mmap. 
3624         It utilizes Symbian specific memory allocation features.
3625
3626         * runtime/Collector.cpp
3627
3628 2009-07-22  Gavin Barraclough  <barraclough@apple.com>
3629
3630         Reviewed by Sam Weinig.
3631
3632         With ENABLE(ASSEMBLER_WX_EXCLUSIVE), only change permissions once per repatch event.
3633         ( https://bugs.webkit.org/show_bug.cgi?id=27564 )
3634
3635         Currently we change permissions forwards and backwards for each instruction modified,
3636         instead we should only change permissions once per complete repatching event.
3637
3638         2.5% progression running with ENABLE(ASSEMBLER_WX_EXCLUSIVE) enabled,
3639         which recoups 1/3 of the penalty of running with this mode enabled.
3640
3641         * assembler/ARMAssembler.cpp:
3642         (JSC::ARMAssembler::linkBranch):
3643             - Replace usage of MakeWritable with cacheFlush.
3644         
3645         * assembler/ARMAssembler.h:
3646         (JSC::ARMAssembler::patchPointerInternal):
3647         (JSC::ARMAssembler::repatchLoadPtrToLEA):
3648             - Replace usage of MakeWritable with cacheFlush.
3649
3650         * assembler/ARMv7Assembler.h:
3651         (JSC::ARMv7Assembler::relinkJump):
3652         (JSC::ARMv7Assembler::relinkCall):
3653         (JSC::ARMv7Assembler::repatchInt32):
3654         (JSC::ARMv7Assembler::repatchPointer):
3655         (JSC::ARMv7Assembler::repatchLoadPtrToLEA):
3656         (JSC::ARMv7Assembler::setInt32):
3657             - Replace usage of MakeWritable with cacheFlush.
3658
3659         * assembler/LinkBuffer.h:
3660         (JSC::LinkBuffer::performFinalization):
3661             - Make explicit call to cacheFlush.
3662
3663         * assembler/MacroAssemblerCodeRef.h:
3664         (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef):
3665             - Make size always available.
3666
3667         * assembler/RepatchBuffer.h:
3668         (JSC::RepatchBuffer::RepatchBuffer):
3669         (JSC::RepatchBuffer::~RepatchBuffer):
3670             - Add calls to MakeWritable & makeExecutable.
3671
3672         * assembler/X86Assembler.h:
3673         (JSC::X86Assembler::relinkJump):
3674         (JSC::X86Assembler::relinkCall):
3675         (JSC::X86Assembler::repatchInt32):
3676         (JSC::X86Assembler::repatchPointer):
3677         (JSC::X86Assembler::repatchLoadPtrToLEA):
3678             - Remove usage of MakeWritable.
3679
3680         * bytecode/CodeBlock.h:
3681         (JSC::CodeBlock::getJITCode):
3682             - Provide access to CodeBlock's JITCode.
3683
3684         * jit/ExecutableAllocator.h:
3685         (JSC::ExecutableAllocator::makeExecutable):
3686         (JSC::ExecutableAllocator::cacheFlush):
3687             - Remove MakeWritable, make cacheFlush public.
3688
3689         * jit/JIT.cpp:
3690         (JSC::ctiPatchNearCallByReturnAddress):
3691         (JSC::ctiPatchCallByReturnAddress):
3692         (JSC::JIT::privateCompile):
3693         (JSC::JIT::unlinkCall):
3694         (JSC::JIT::linkCall):
3695             - Add CodeBlock argument to RepatchBuffer.
3696
3697         * jit/JIT.h:
3698             - Pass CodeBlock argument for use by RepatchBuffer.
3699
3700         * jit/JITCode.h:
3701         (JSC::JITCode::start):
3702         (JSC::JITCode::size):
3703             - Provide access to code start & size.
3704
3705         * jit/JITPropertyAccess.cpp:
3706         (JSC::JIT::privateCompilePutByIdTransition):
3707         (JSC::JIT::patchGetByIdSelf):
3708         (JSC::JIT::patchMethodCallProto):
3709         (JSC::JIT::patchPutByIdReplace):
3710         (JSC::JIT::privateCompilePatchGetArrayLength):
3711         (JSC::JIT::privateCompileGetByIdProto):
3712         (JSC::JIT::privateCompileGetByIdSelfList):
3713         (JSC::JIT::privateCompileGetByIdProtoList):
3714         (JSC::JIT::privateCompileGetByIdChainList):
3715         (JSC::JIT::privateCompileGetByIdChain):
3716             - Add CodeBlock argument to RepatchBuffer.
3717
3718         * jit/JITStubs.cpp:
3719         (JSC::JITThunks::tryCachePutByID):
3720         (JSC::JITThunks::tryCacheGetByID):
3721         (JSC::JITStubs::DEFINE_STUB_FUNCTION):
3722             - Pass CodeBlock argument for use by RepatchBuffer.
3723
3724 2009-07-21  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
3725
3726         Reviewed by Gavin Barraclough.
3727
3728         Cache not only the structure of the method, but the
3729         structure of its prototype as well.
3730         https://bugs.webkit.org/show_bug.cgi?id=27077
3731
3732         * bytecode/CodeBlock.cpp:
3733         (JSC::CodeBlock::~CodeBlock):
3734         * bytecode/CodeBlock.h:
3735         (JSC::MethodCallLinkInfo::MethodCallLinkInfo):
3736         * jit/JITPropertyAccess.cpp:
3737         (JSC::JIT::patchMethodCallProto):
3738
3739 2009-07-21  Gavin Barraclough  <barraclough@apple.com>
3740
3741         Reviewed by Sam Weinig.
3742
3743         Move call linking / repatching down from AbstractMacroAssembler into MacroAssemblerARCH classes.
3744         ( https://bugs.webkit.org/show_bug.cgi?id=27527 )
3745
3746         This allows the implementation to be defined per architecture.  Specifically this addresses the
3747         fact that x86-64 MacroAssembler implements far calls as a load to register, followed by a call
3748         to register.  Patching the call actually requires the pointer load to be patched, rather than
3749         the call to be patched.  This is implementation detail specific to MacroAssemblerX86_64, and as
3750         such is best handled there.
3751
3752         * assembler/AbstractMacroAssembler.h:
3753         * assembler/MacroAssemblerARM.h:
3754         (JSC::MacroAssemblerARM::linkCall):
3755         (JSC::MacroAssemblerARM::repatchCall):
3756         * assembler/MacroAssemblerARMv7.h:
3757         (JSC::MacroAssemblerARMv7::linkCall):
3758         (JSC::MacroAssemblerARMv7::repatchCall):
3759         * assembler/MacroAssemblerX86.h:
3760         (JSC::MacroAssemblerX86::linkCall):
3761         (JSC::MacroAssemblerX86::repatchCall):
3762         * assembler/MacroAssemblerX86_64.h:
3763         (JSC::MacroAssemblerX86_64::linkCall):
3764         (JSC::MacroAssemblerX86_64::repatchCall):
3765
3766 2009-07-21  Adam Treat  <adam.treat@torchmobile.com>
3767
3768         Reviewed by George Staikos.
3769
3770         Every wtf file includes other wtf files with <> style includes
3771         except this one.  Fix the exception.
3772
3773         * wtf/ByteArray.h:
3774
3775 2009-07-21  Gavin Barraclough  <barraclough@apple.com>
3776
3777         Reviewed by Oliver Hunt.
3778
3779         Move LinkBuffer/RepatchBuffer out of AbstractMacroAssembler.
3780         ( https://bugs.webkit.org/show_bug.cgi?id=27485 )
3781
3782         This change is the first step in a process to move code that should be in
3783         the architecture-specific MacroAssembler classes up out of Assmbler and
3784         AbstractMacroAssembler.
3785
3786         * JavaScriptCore.xcodeproj/project.pbxproj:
3787             - added new files
3788         
3789         * assembler/ARMAssembler.h:
3790         (JSC::ARMAssembler::linkPointer):
3791             - rename patchPointer to bring it in line with the current link/repatch naming scheme
3792         
3793         * assembler/ARMv7Assembler.h:
3794         (JSC::ARMv7Assembler::linkCall):
3795         (JSC::ARMv7Assembler::linkPointer):
3796         (JSC::ARMv7Assembler::relinkCall):
3797         (JSC::ARMv7Assembler::repatchInt32):
3798         (JSC::ARMv7Assembler::repatchPointer):
3799         (JSC::ARMv7Assembler::setInt32):
3800         (JSC::ARMv7Assembler::setPointer):
3801             - rename patchPointer to bring it in line with the current link/repatch naming scheme
3802
3803         * assembler/AbstractMacroAssembler.h:
3804         (JSC::AbstractMacroAssembler::linkJump):
3805         (JSC::AbstractMacroAssembler::linkCall):
3806         (JSC::AbstractMacroAssembler::linkPointer):
3807         (JSC::AbstractMacroAssembler::getLinkerAddress):
3808         (JSC::AbstractMacroAssembler::getLinkerCallReturnOffset):
3809         (JSC::AbstractMacroAssembler::repatchJump):
3810         (JSC::AbstractMacroAssembler::repatchCall):
3811         (JSC::AbstractMacroAssembler::repatchNearCall):
3812         (JSC::AbstractMacroAssembler::repatchInt32):
3813         (JSC::AbstractMacroAssembler::repatchPointer):
3814         (JSC::AbstractMacroAssembler::repatchLoadPtrToLEA):
3815             - remove the LinkBuffer/RepatchBuffer classes, but leave a set of (private, friended) methods to interface to the Assembler
3816
3817         * assembler/LinkBuffer.h: Added.
3818         (JSC::LinkBuffer::LinkBuffer):
3819         (JSC::LinkBuffer::~LinkBuffer):
3820         (JSC::LinkBuffer::link):
3821         (JSC::LinkBuffer::patch):
3822         (JSC::LinkBuffer::locationOf):
3823         (JSC::LinkBuffer::locationOfNearCall):
3824         (JSC::LinkBuffer::returnAddressOffset):
3825         (JSC::LinkBuffer::finalizeCode):
3826         (JSC::LinkBuffer::finalizeCodeAddendum):
3827         (JSC::LinkBuffer::code):
3828         (JSC::LinkBuffer::performFinalization):
3829             - new file containing the LinkBuffer class, previously a member of AbstractMacroAssembler
3830
3831         * assembler/RepatchBuffer.h: Added.
3832         (JSC::RepatchBuffer::RepatchBuffer):
3833         (JSC::RepatchBuffer::relink):
3834         (JSC::RepatchBuffer::repatch):
3835         (JSC::RepatchBuffer::repatchLoadPtrToLEA):
3836         (JSC::RepatchBuffer::relinkCallerToTrampoline):
3837         (JSC::RepatchBuffer::relinkCallerToFunction):
3838         (JSC::RepatchBuffer::relinkNearCallerToTrampoline):
3839             - new file containing the RepatchBuffer class, previously a member of AbstractMacroAssembler
3840
3841         * assembler/X86Assembler.h:
3842         (JSC::X86Assembler::linkJump):
3843         (JSC::X86Assembler::linkCall):
3844         (JSC::X86Assembler::linkPointerForCall):
3845         (JSC::X86Assembler::linkPointer):
3846         (JSC::X86Assembler::relinkJump):
3847         (JSC::X86Assembler::relinkCall):
3848         (JSC::X86Assembler::repatchInt32):
3849         (JSC::X86Assembler::repatchPointer):
3850         (JSC::X86Assembler::setPointer):
3851         (JSC::X86Assembler::setInt32):
3852         (JSC::X86Assembler::setRel32):
3853             - rename patchPointer to bring it in line with the current link/repatch naming scheme
3854
3855         * jit/JIT.cpp:
3856         (JSC::ctiPatchNearCallByReturnAddress):
3857         (JSC::ctiPatchCallByReturnAddress):
3858             - include new headers
3859             - remove MacroAssembler:: specification from RepatchBuffer usage
3860
3861         * jit/JITPropertyAccess.cpp:
3862         * yarr/RegexJIT.cpp:
3863             - include new headers
3864
3865 2009-07-21  Robert Agoston  <Agoston.Robert@stud.u-szeged.hu>
3866
3867         Reviewed by David Levin.
3868
3869         Fixed #undef typo.
3870         https://bugs.webkit.org/show_bug.cgi?id=27506
3871
3872         * bytecode/Opcode.h:
3873
3874 2009-07-21  Adam Roben  <aroben@apple.com>
3875
3876         Roll out r46153, r46154, and r46155
3877
3878         These changes were causing build failures and assertion failures on
3879         Windows.
3880
3881         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3882         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
3883         * JavaScriptCore.xcodeproj/project.pbxproj:
3884         * runtime/JSArray.cpp:
3885         * runtime/StringPrototype.cpp:
3886         * runtime/UString.cpp:
3887         * runtime/UString.h:
3888         * wtf/FastMalloc.cpp:
3889         * wtf/FastMalloc.h:
3890         * wtf/Platform.h:
3891         * wtf/PossiblyNull.h: Removed.
3892
3893 2009-07-21  Roland Steiner  <rolandsteiner@google.com>
3894
3895         Reviewed by David Levin.
3896
3897         Add ENABLE_RUBY to list of build options
3898         https://bugs.webkit.org/show_bug.cgi?id=27324
3899
3900         * Configurations/FeatureDefines.xcconfig: Added flag ENABLE_RUBY.
3901
3902 2009-07-20  Oliver Hunt  <oliver@apple.com>
3903
3904         Reviewed by NOBODY (Build fix).
3905
3906         Build fix attempt #2
3907
3908         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3909         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
3910
3911 2009-07-20  Oliver Hunt  <oliver@apple.com>
3912
3913         Reviewed by NOBODY (Build fix).
3914
3915         Build fix attempt #1
3916
3917         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3918         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
3919
3920 2009-07-20  Oliver Hunt  <oliver@apple.com>
3921
3922         Reviewed by Gavin Barraclough.
3923
3924         Make it harder to misuse try* allocation routines
3925         https://bugs.webkit.org/show_bug.cgi?id=27469
3926
3927         Jump through a few hoops to make it much harder to accidentally
3928         miss null-checking of values returned by the try-* allocation
3929         routines.
3930
3931         * JavaScriptCore.xcodeproj/project.pbxproj:
3932         * runtime/JSArray.cpp:
3933         (JSC::JSArray::putSlowCase):
3934         (JSC::JSArray::increaseVectorLength):
3935         * runtime/StringPrototype.cpp:
3936         (JSC::stringProtoFuncFontsize):
3937         (JSC::stringProtoFuncLink):
3938         * runtime/UString.cpp:
3939         (JSC::allocChars):
3940         (JSC::reallocChars):
3941         (JSC::expandCapacity):
3942         (JSC::UString::Rep::reserveCapacity):
3943         (JSC::UString::expandPreCapacity):
3944         (JSC::createRep):
3945         (JSC::concatenate):
3946         (JSC::UString::spliceSubstringsWithSeparators):
3947         (JSC::UString::replaceRange):
3948         (JSC::UString::append):
3949         (JSC::UString::operator=):
3950         * runtime/UString.h:
3951         (JSC::UString::Rep::createEmptyBuffer):
3952         * wtf/FastMalloc.cpp:
3953         (WTF::tryFastZeroedMalloc):
3954         (WTF::tryFastMalloc):
3955         (WTF::tryFastCalloc):
3956         (WTF::tryFastRealloc):
3957         (WTF::TCMallocStats::tryFastMalloc):
3958         (WTF::TCMallocStats::tryFastCalloc):
3959         (WTF::TCMallocStats::tryFastRealloc):
3960         * wtf/FastMalloc.h:
3961         (WTF::TryMallocReturnValue::TryMallocReturnValue):
3962         (WTF::TryMallocReturnValue::~TryMallocReturnValue):
3963         (WTF::TryMallocReturnValue::operator Maybe<T>):
3964         (WTF::TryMallocReturnValue::getValue):
3965         * wtf/PossiblyNull.h:
3966         (WTF::PossiblyNull::PossiblyNull):
3967         (WTF::PossiblyNull::~PossiblyNull):
3968         (WTF::PossiblyNull::getValue):
3969         * wtf/Platform.h:
3970
3971 2009-07-20  Gavin Barraclough  <barraclough@apple.com>
3972
3973         RS Oliver Hunt.
3974
3975         Add ARM assembler files to xcodeproj, for convenience editing.
3976
3977         * JavaScriptCore.xcodeproj/project.pbxproj:
3978
3979 2009-07-20  Jessie Berlin  <jberlin@apple.com>
3980
3981         Reviewed by David Levin.
3982
3983         Fix an incorrect assertion in Vector::remove.
3984         
3985         https://bugs.webkit.org/show_bug.cgi?id=27477
3986
3987         * wtf/Vector.h:
3988         (WTF::::remove):
3989         Assert that the position at which to start removing elements + the
3990         length (the number of elements to remove) is less than or equal to the
3991         size of the entire Vector.
3992
3993 2009-07-20  Peter Kasting  <pkasting@google.com>
3994
3995         Reviewed by Mark Rowe.
3996
3997         https://bugs.webkit.org/show_bug.cgi?id=27468
3998         Back out r46060, which caused problems for some Apple developers.
3999
4000         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
4001         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj:
4002         * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops:
4003         * JavaScriptCore.vcproj/jsc/jscCommon.vsprops:
4004         * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops:
4005
4006 2009-07-20  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
4007
4008         Reviewed by Oliver Hunt.
4009
4010         Allow custom memory allocation control in NewThreadContext
4011         https://bugs.webkit.org/show_bug.cgi?id=27338
4012
4013         Inherits NewThreadContext struct from FastAllocBase because it
4014         has been instantiated by 'new' JavaScriptCore/wtf/Threading.cpp:76.
4015
4016         * wtf/Threading.cpp:
4017
4018 2009-07-20  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
4019
4020         Reviewed by Oliver Hunt.
4021
4022         Allow custom memory allocation control in JavaScriptCore's JSClassRef.h
4023         https://bugs.webkit.org/show_bug.cgi?id=27340
4024
4025         Inherit StaticValueEntry and StaticFunctionEntry struct from FastAllocBase because these
4026         have been instantiated by 'new' in JavaScriptCore/API/JSClassRef.cpp:153
4027         and in JavaScriptCore/API/JSClassRef.cpp:166.
4028
4029         * API/JSClassRef.h:
4030
4031 2009-07-20  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
4032
4033         Reviewed by Darin Adler.
4034
4035         Allow custom memory allocation control in JavaScriptCore's RegexPattern.h
4036         https://bugs.webkit.org/show_bug.cgi?id=27343
4037
4038         Inherits RegexPattern.h's structs (which have been instantiated by operator new) from FastAllocBase:
4039
4040         CharacterClass (new call: JavaScriptCore/yarr/RegexCompiler.cpp:144)
4041         PatternAlternative (new call: JavaScriptCore/yarr/RegexPattern.h:221) 
4042         PatternDisjunction (new call: JavaScriptCore/yarr/RegexCompiler.cpp:446)
4043
4044         * yarr/RegexPattern.h:
4045
4046 2009-07-20  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
4047
4048         Reviewed by Darin Adler.
4049
4050         Allow custom memory allocation control for JavaScriptCore's MatchFrame struct
4051         https://bugs.webkit.org/show_bug.cgi?id=27344
4052
4053         Inherits MatchFrame struct from FastAllocBase because it has
4054         been instantiated by 'new' JavaScriptCore/pcre/pcre_exec.cpp:359.
4055
4056         * pcre/pcre_exec.cpp:
4057
4058 2009-07-20  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
4059
4060         Reviewed by Holger Freyther.
4061
4062         Remove some outdated S60 platform specific code
4063         https://bugs.webkit.org/show_bug.cgi?id=27423
4064
4065         * wtf/Platform.h:
4066
4067 2009-07-20  Csaba Osztrogonac  <oszi@inf.u-szeged.hu>
4068
4069         Reviewed by Simon Hausmann.
4070
4071         Qt build fix with MSVC and MinGW.
4072
4073         * jsc.pro: Make sure jsc is a console application, and turn off
4074         exceptions and stl support to fix the build.
4075
4076 2009-07-20  Xan Lopez  <xlopez@igalia.com>
4077
4078         Reviewed by Gustavo Noronha.
4079
4080         Do not use C++-style comments in preprocessor directives.
4081
4082         GCC does not like this in some configurations, using C-style
4083         comments is safer.
4084
4085         * wtf/Platform.h:
4086
4087 2009-07-17  Peter Kasting  <pkasting@google.com>
4088
4089         Reviewed by Steve Falkenburg.
4090
4091         https://bugs.webkit.org/show_bug.cgi?id=27323
4092         Only add Cygwin to the path when it isn't already there.  This avoids
4093         causing problems for people who purposefully have non-Cygwin versions of
4094         executables like svn in front of the Cygwin ones in their paths.
4095
4096         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
4097         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj:
4098         * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops:
4099         * JavaScriptCore.vcproj/jsc/jscCommon.vsprops:
4100         * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops:
4101
4102 2009-07-17  Gabor Loki  <loki@inf.u-szeged.hu>
4103
4104         Reviewed by Gavin Barraclough.
4105
4106         Add YARR support for generic ARM platforms (disabled by default).
4107         https://bugs.webkit.org/show_bug.cgi?id=24986
4108
4109         Add generic ARM port for MacroAssembler. It supports the whole
4110         MacroAssembler functionality except floating point.
4111
4112         The class JmpSrc is extended with a flag which enables to patch
4113         the jump destination offset during execution. This feature is
4114         required for generic ARM port.
4115
4116         Signed off by Zoltan Herczeg <zherczeg@inf.u-szeged.hu>
4117         Signed off by Gabor Loki <loki@inf.u-szeged.hu>
4118
4119         * JavaScriptCore.pri:
4120         * assembler/ARMAssembler.cpp: Added.
4121         (JSC::ARMAssembler::getLdrImmAddress):
4122         (JSC::ARMAssembler::linkBranch):
4123         (JSC::ARMAssembler::patchConstantPoolLoad):
4124         (JSC::ARMAssembler::getOp2):
4125         (JSC::ARMAssembler::genInt):
4126         (JSC::ARMAssembler::getImm):
4127         (JSC::ARMAssembler::moveImm):
4128         (JSC::ARMAssembler::dataTransfer32):
4129         (JSC::ARMAssembler::baseIndexTransfer32):
4130         (JSC::ARMAssembler::executableCopy):
4131         * assembler/ARMAssembler.h: Added.
4132         (JSC::ARM::):
4133         (JSC::ARMAssembler::ARMAssembler):
4134         (JSC::ARMAssembler::):
4135         (JSC::ARMAssembler::JmpSrc::JmpSrc):
4136         (JSC::ARMAssembler::JmpSrc::enableLatePatch):
4137         (JSC::ARMAssembler::JmpDst::JmpDst):
4138         (JSC::ARMAssembler::JmpDst::isUsed):
4139         (JSC::ARMAssembler::JmpDst::used):
4140         (JSC::ARMAssembler::emitInst):
4141         (JSC::ARMAssembler::and_r):
4142         (JSC::ARMAssembler::ands_r):
4143         (JSC::ARMAssembler::eor_r):
4144         (JSC::ARMAssembler::eors_r):
4145         (JSC::ARMAssembler::sub_r):
4146         (JSC::ARMAssembler::subs_r):
4147         (JSC::ARMAssembler::rsb_r):
4148         (JSC::ARMAssembler::rsbs_r):
4149         (JSC::ARMAssembler::add_r):
4150         (JSC::ARMAssembler::adds_r):
4151         (JSC::ARMAssembler::adc_r):
4152         (JSC::ARMAssembler::adcs_r):
4153         (JSC::ARMAssembler::sbc_r):
4154         (JSC::ARMAssembler::sbcs_r):
4155         (JSC::ARMAssembler::rsc_r):
4156         (JSC::ARMAssembler::rscs_r):
4157         (JSC::ARMAssembler::tst_r):
4158         (JSC::ARMAssembler::teq_r):
4159         (JSC::ARMAssembler::cmp_r):
4160         (JSC::ARMAssembler::orr_r):
4161         (JSC::ARMAssembler::orrs_r):
4162         (JSC::ARMAssembler::mov_r):
4163         (JSC::ARMAssembler::movs_r):
4164         (JSC::ARMAssembler::bic_r):
4165         (JSC::ARMAssembler::bics_r):
4166         (JSC::ARMAssembler::mvn_r):
4167         (JSC::ARMAssembler::mvns_r):
4168         (JSC::ARMAssembler::mul_r):
4169         (JSC::ARMAssembler::muls_r):
4170         (JSC::ARMAssembler::mull_r):
4171         (JSC::ARMAssembler::ldr_imm):
4172         (JSC::ARMAssembler::ldr_un_imm):
4173         (JSC::ARMAssembler::dtr_u):
4174         (JSC::ARMAssembler::dtr_ur):
4175         (JSC::ARMAssembler::dtr_d):
4176         (JSC::ARMAssembler::dtr_dr):
4177         (JSC::ARMAssembler::ldrh_r):
4178         (JSC::ARMAssembler::ldrh_d):
4179         (JSC::ARMAssembler::ldrh_u):
4180         (JSC::ARMAssembler::strh_r):
4181         (JSC::ARMAssembler::push_r):
4182         (JSC::ARMAssembler::pop_r):
4183         (JSC::ARMAssembler::poke_r):
4184         (JSC::ARMAssembler::peek_r):
4185         (JSC::ARMAssembler::clz_r):
4186         (JSC::ARMAssembler::bkpt):
4187         (JSC::ARMAssembler::lsl):
4188         (JSC::ARMAssembler::lsr):
4189         (JSC::ARMAssembler::asr):
4190         (JSC::ARMAssembler::lsl_r):
4191         (JSC::ARMAssembler::lsr_r):
4192         (JSC::ARMAssembler::asr_r):
4193         (JSC::ARMAssembler::size):
4194         (JSC::ARMAssembler::ensureSpace):
4195         (JSC::ARMAssembler::label):
4196         (JSC::ARMAssembler::align):
4197         (JSC::ARMAssembler::jmp):
4198         (JSC::ARMAssembler::patchPointerInternal):
4199         (JSC::ARMAssembler::patchConstantPoolLoad):
4200         (JSC::ARMAssembler::patchPointer):
4201         (JSC::ARMAssembler::repatchInt32):
4202         (JSC::ARMAssembler::repatchPointer):
4203         (JSC::ARMAssembler::repatchLoadPtrToLEA):
4204         (JSC::ARMAssembler::linkJump):
4205         (JSC::ARMAssembler::relinkJump):
4206         (JSC::ARMAssembler::linkCall):
4207         (JSC::ARMAssembler::relinkCall):
4208         (JSC::ARMAssembler::getRelocatedAddress):
4209         (JSC::ARMAssembler::getDifferenceBetweenLabels):
4210         (JSC::ARMAssembler::getCallReturnOffset):
4211         (JSC::ARMAssembler::getOp2Byte):
4212         (JSC::ARMAssembler::placeConstantPoolBarrier):
4213         (JSC::ARMAssembler::RM):
4214         (JSC::ARMAssembler::RS):
4215         (JSC::ARMAssembler::RD):
4216         (JSC::ARMAssembler::RN):
4217         (JSC::ARMAssembler::getConditionalField):
4218         * assembler/ARMv7Assembler.h:
4219         (JSC::ARMv7Assembler::JmpSrc::enableLatePatch):
4220         * assembler/AbstractMacroAssembler.h:
4221         (JSC::AbstractMacroAssembler::Call::enableLatePatch):
4222         (JSC::AbstractMacroAssembler::Jump::enableLatePatch):
4223         * assembler/MacroAssembler.h:
4224         * assembler/MacroAssemblerARM.h: Added.
4225         (JSC::MacroAssemblerARM::):
4226         (JSC::MacroAssemblerARM::add32):
4227         (JSC::MacroAssemblerARM::and32):
4228         (JSC::MacroAssemblerARM::lshift32):
4229         (JSC::MacroAssemblerARM::mul32):
4230         (JSC::MacroAssemblerARM::not32):
4231         (JSC::MacroAssemblerARM::or32):
4232         (JSC::MacroAssemblerARM::rshift32):
4233         (JSC::MacroAssemblerARM::sub32):
4234         (JSC::MacroAssemblerARM::xor32):
4235         (JSC::MacroAssemblerARM::load32):
4236         (JSC::MacroAssemblerARM::load32WithAddressOffsetPatch):
4237         (JSC::MacroAssemblerARM::loadPtrWithPatchToLEA):
4238         (JSC::MacroAssemblerARM::load16):
4239         (JSC::MacroAssemblerARM::store32WithAddressOffsetPatch):
4240         (JSC::MacroAssemblerARM::store32):
4241         (JSC::MacroAssemblerARM::pop):
4242         (JSC::MacroAssemblerARM::push):
4243         (JSC::MacroAssemblerARM::move):
4244         (JSC::MacroAssemblerARM::swap):
4245         (JSC::MacroAssemblerARM::signExtend32ToPtr):
4246         (JSC::MacroAssemblerARM::zeroExtend32ToPtr):
4247         (JSC::MacroAssemblerARM::branch32):
4248         (JSC::MacroAssemblerARM::branch16):
4249         (JSC::MacroAssemblerARM::branchTest32):
4250         (JSC::MacroAssemblerARM::jump):
4251         (JSC::MacroAssemblerARM::branchAdd32):
4252         (JSC::MacroAssemblerARM::mull32):
4253         (JSC::MacroAssemblerARM::branchMul32):
4254         (JSC::MacroAssemblerARM::branchSub32):
4255         (JSC::MacroAssemblerARM::breakpoint):
4256         (JSC::MacroAssemblerARM::nearCall):
4257         (JSC::MacroAssemblerARM::call):
4258         (JSC::MacroAssemblerARM::ret):
4259         (JSC::MacroAssemblerARM::set32):
4260         (JSC::MacroAssemblerARM::setTest32):
4261         (JSC::MacroAssemblerARM::tailRecursiveCall):
4262         (JSC::MacroAssemblerARM::makeTailRecursiveCall):
4263         (JSC::MacroAssemblerARM::moveWithPatch):
4264         (JSC::MacroAssemblerARM::branchPtrWithPatch):
4265         (JSC::MacroAssemblerARM::storePtrWithPatch):
4266         (JSC::MacroAssemblerARM::supportsFloatingPoint):
4267         (JSC::MacroAssemblerARM::supportsFloatingPointTruncate):
4268         (JSC::MacroAssemblerARM::loadDouble):
4269         (JSC::MacroAssemblerARM::storeDouble):
4270         (JSC::MacroAssemblerARM::addDouble):
4271         (JSC::MacroAssemblerARM::subDouble):
4272         (JSC::MacroAssemblerARM::mulDouble):
4273         (JSC::MacroAssemblerARM::convertInt32ToDouble):
4274         (JSC::MacroAssemblerARM::branchDouble):
4275         (JSC::MacroAssemblerARM::branchTruncateDoubleToInt32):
4276         (JSC::MacroAssemblerARM::ARMCondition):
4277         (JSC::MacroAssemblerARM::prepareCall):
4278         (JSC::MacroAssemblerARM::call32):
4279         * assembler/X86Assembler.h:
4280         (JSC::X86Assembler::JmpSrc::enableLatePatch):
4281         * jit/ExecutableAllocator.h:
4282         (JSC::ExecutableAllocator::cacheFlush):
4283         * wtf/Platform.h:
4284         * yarr/RegexJIT.cpp:
4285         (JSC::Yarr::RegexGenerator::generateEnter):
4286         (JSC::Yarr::RegexGenerator::generateReturn):
4287
4288 2009-07-17  Gabor Loki  <loki@inf.u-szeged.hu>
4289
4290         Reviewed by Gavin Barraclough.
4291
4292         Extend AssemblerBuffer with constant pool handling mechanism.
4293         https://bugs.webkit.org/show_bug.cgi?id=24986
4294
4295         Add a platform independed constant pool framework.
4296         This pool can store 32 or 64 bits values which is enough to hold
4297         any integer, pointer or double constant.
4298
4299         * assembler/AssemblerBuffer.h:
4300         (JSC::AssemblerBuffer::putIntUnchecked):
4301         (JSC::AssemblerBuffer::putInt64Unchecked):
4302         (JSC::AssemblerBuffer::append):
4303         (JSC::AssemblerBuffer::grow):
4304         * assembler/AssemblerBufferWithConstantPool.h: Added.
4305         (JSC::):
4306
4307 2009-07-17  Eric Roman  <eroman@chromium.org>
4308
4309         Reviewed by Darin Adler.
4310
4311         Build fix for non-Darwin.
4312         Add a guard for inclusion of RetainPtr.h which includes CoreFoundation.h
4313
4314         https://bugs.webkit.org/show_bug.cgi?id=27382
4315
4316         * wtf/unicode/icu/CollatorICU.cpp:
4317
4318 2009-07-17  Alexey Proskuryakov  <ap@webkit.org>
4319
4320         Reviewed by John Sullivan.
4321
4322         Get user default collation order via a CFLocale API when available.
4323
4324         * wtf/unicode/icu/CollatorICU.cpp: (WTF::Collator::userDefault):
4325
4326 2009-07-17  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
4327
4328         Reviewed by Simon Hausmann.
4329
4330         [Qt] Fix the include path for the Symbian port
4331         https://bugs.webkit.org/show_bug.cgi?id=27358
4332
4333         * JavaScriptCore.pri:
4334
4335 2009-07-17  Csaba Osztrogonac  <oszi@inf.u-szeged.hu>
4336
4337         Reviewed by David Levin.
4338
4339         Build fix on platforms don't have MMAP.
4340         https://bugs.webkit.org/show_bug.cgi?id=27365
4341
4342         * interpreter/RegisterFile.h: Including stdio.h irrespectively of HAVE(MMAP)
4343
4344 2009-07-16  Fumitoshi Ukai  <ukai@chromium.org>
4345
4346         Reviewed by David Levin.
4347
4348         Add --web-sockets flag and ENABLE_WEB_SOCKETS define.
4349         https://bugs.webkit.org/show_bug.cgi?id=27206
4350         
4351         Add ENABLE_WEB_SOCKETS
4352
4353         * Configurations/FeatureDefines.xcconfig: add ENABLE_WEB_SOCKETS
4354
4355 2009-07-16  Maxime Simon  <simon.maxime@gmail.com>
4356
4357         Reviewed by Eric Seidel.
4358
4359         Added Haiku-specific files for JavaScriptCore.
4360         https://bugs.webkit.org/show_bug.cgi?id=26620
4361
4362         * wtf/haiku/MainThreadHaiku.cpp: Added.
4363         (WTF::initializeMainThreadPlatform):
4364         (WTF::scheduleDispatchFunctionsOnMainThread):
4365
4366 2009-07-16  Gavin Barraclough  <barraclough@apple.com>
4367
4368         RS by Oliver Hunt.
4369
4370         Revert r45969, this fix does not appear to be valid.
4371         https://bugs.webkit.org/show_bug.cgi?id=27077
4372
4373         * bytecode/CodeBlock.cpp:
4374         (JSC::CodeBlock::~CodeBlock):
4375         (JSC::CodeBlock::unlinkCallers):
4376         * jit/JIT.cpp:
4377         * jit/JIT.h:
4378
4379 2009-07-16  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
4380
4381         Reviewed by Oliver Hunt.
4382
4383         Allow custom memory allocation control in ExceptionInfo and RareData struct
4384         https://bugs.webkit.org/show_bug.cgi?id=27336
4385
4386         Inherits ExceptionInfo and RareData struct from FastAllocBase because these
4387         have been instantiated by 'new' in JavaScriptCore/bytecode/CodeBlock.cpp:1289 and
4388         in JavaScriptCore/bytecode/CodeBlock.h:453.
4389
4390         Remove unnecessary WTF:: namespace from CodeBlock inheritance.
4391  
4392         * bytecode/CodeBlock.h:
4393
4394 2009-07-16  Mark Rowe  <mrowe@apple.com>
4395
4396         Rubber-stamped by Geoff Garen.
4397
4398         Fix FeatureDefines.xcconfig to not be out of sync with the rest of the world.
4399
4400         * Configurations/FeatureDefines.xcconfig:
4401
4402 2009-07-16  Yong Li  <yong.li@torchmobile.com>
4403
4404          Reviewed by George Staikos.
4405
4406          https://bugs.webkit.org/show_bug.cgi?id=27320
4407          _countof is only included in CE6; for CE5 we need to define it ourself
4408
4409          * wtf/Platform.h:
4410
4411 2009-07-16  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
4412
4413         Reviewed by Oliver Hunt.
4414
4415         Workers + garbage collector: weird crashes
4416         https://bugs.webkit.org/show_bug.cgi?id=27077
4417
4418         We need to unlink cached method call sites when a function is destroyed.
4419
4420         * JavaScriptCore.xcodeproj/project.pbxproj:
4421         * bytecode/CodeBlock.cpp:
4422         (JSC::CodeBlock::~CodeBlock):
4423         (JSC::CodeBlock::unlinkCallers):
4424         * jit/JIT.cpp:
4425         (JSC::JIT::unlinkMethodCall):
4426         * jit/JIT.h:
4427
4428 2009-07-15  Steve Falkenburg  <sfalken@apple.com>
4429
4430         Windows Build fix.
4431
4432         Visual Studio reset our intermediate directory on us.
4433         This sets it back.
4434         
4435         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
4436         * JavaScriptCore.vcproj/testapi/testapi.vcproj:
4437
4438 2009-07-15  Kwang Yul Seo  <skyul@company100.net>
4439
4440         Reviewed by Eric Seidel.
4441
4442         https://bugs.webkit.org/show_bug.cgi?id=26794
4443         Make Yacc-generated parsers to use fastMalloc/fastFree.
4444         
4445         Define YYMALLOC and YYFREE to fastMalloc and fastFree
4446         respectively.
4447
4448         * parser/Grammar.y:
4449
4450 2009-07-15  Darin Adler  <darin@apple.com>
4451
4452         Fix a build for a particular Apple configuration.
4453
4454         * wtf/FastAllocBase.h: Change include to use "" style for
4455         including another wtf header. This is the style we use for
4456         including other public headers in the same directory.
4457
4458 2009-07-15  George Staikos  <george.staikos@torchmobile.com>
4459
4460         Reviewed by Adam Treat.
4461
4462         https://bugs.webkit.org/show_bug.cgi?id=27303
4463         Implement createThreadInternal for WinCE.
4464         Contains changes by George Staikos <george.staikos@torchmobile.com> and Joe Mason <joe.mason@torchmobile.com>
4465
4466         * wtf/ThreadingWin.cpp:
4467         (WTF::createThreadInternal):
4468
4469 2009-07-15  Joe Mason  <joe.mason@torchmobile.com>
4470
4471          Reviewed by George Staikos.
4472
4473          https://bugs.webkit.org/show_bug.cgi?id=27298
4474          Platform defines for WINCE.
4475          Contains changes by Yong Li <yong.li@torchmobile.com>,
4476          George Staikos <george.staikos@torchmobile.com> and Joe Mason <joe.mason@torchmobile.com>
4477
4478          * wtf/Platform.h:
4479
4480 2009-07-15  Yong Li  <yong.li@torchmobile.com>
4481
4482          Reviewed by Adam Treat.
4483
4484          https://bugs.webkit.org/show_bug.cgi?id=27306
4485          Use RegisterClass instead of RegisterClassEx on WinCE.
4486
4487          * wtf/win/MainThreadWin.cpp:
4488          (WTF::initializeMainThreadPlatform):
4489
4490 2009-07-15  Yong Li  <yong.li@torchmobile.com>
4491
4492          Reviewed by George Staikos.
4493
4494          https://bugs.webkit.org/show_bug.cgi?id=27301
4495          Use OutputDebugStringW on WinCE since OutputDebugStringA is not supported
4496          Originally written by Yong Li <yong.li@torchmobile.com> and refactored by
4497          Joe Mason <joe.mason@torchmobile.com>
4498
4499          * wtf/Assertions.cpp: vprintf_stderr_common
4500
4501 2009-07-15  Yong Li  <yong.li@torchmobile.com>
4502
4503          Reviewed by George Staikos.
4504
4505          https://bugs.webkit.org/show_bug.cgi?id=27020
4506          msToGregorianDateTime should set utcOffset to 0 when outputIsUTC is false
4507
4508          * wtf/DateMath.cpp:
4509          (WTF::gregorianDateTimeToMS):
4510
4511 2009-07-15  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
4512
4513         Reviewed by Simon Hausmann.
4514
4515         [Qt] Cleanup - Remove obsolete code from the make system
4516         https://bugs.webkit.org/show_bug.cgi?id=27299
4517
4518         * JavaScriptCore.pro:
4519         * jsc.pro:
4520
4521 2009-07-07  Norbert Leser  <norbert.leser@nokia.com>
4522
4523         Reviewed by Simon Hausmann.
4524
4525         https://bugs.webkit.org/show_bug.cgi?id=27056
4526
4527         Alternate bool operator for codewarrior compiler (WINSCW).
4528         Compiler (latest b482) reports error for UnspecifiedBoolType construct:
4529         "illegal explicit conversion from 'WTF::OwnArrayPtr<JSC::Register>' to 'bool'"
4530
4531         Same fix as in r38391.
4532
4533         * JavaScriptCore/wtf/OwnArrayPtr.h:
4534
4535 2009-07-15  Norbert Leser  <norbert.leser@nokia.com>
4536
4537         Reviewed by Darin Adler.
4538
4539         Qualify include path with wtf to fix compilation
4540         on Symbian.
4541         https://bugs.webkit.org/show_bug.cgi?id=27055
4542
4543         * interpreter/Interpreter.h:
4544
4545 2009-07-15  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
4546
4547         Reviewed by Dave Kilzer.
4548
4549         Turn off non-portable date manipulations for SYMBIAN
4550         https://bugs.webkit.org/show_bug.cgi?id=27064
4551
4552         Introduce HAVE(TM_GMTOFF), HAVE(TM_ZONE) and HAVE(TIMEGM) guards 
4553         and place the rules for controlling the guards in Platform.h.
4554         Turn off these newly introduced guards for SYMBIAN.
4555
4556         * wtf/DateMath.cpp:
4557         (WTF::calculateUTCOffset):
4558         * wtf/DateMath.h:
4559         (WTF::GregorianDateTime::GregorianDateTime):
4560         (WTF::GregorianDateTime::operator tm):
4561         * wtf/Platform.h:
4562
4563 2009-07-15  Norbert Leser  <norbert.leser@nokia.com>
4564
4565         Reviewed by Simon Hausmann.
4566
4567         Undef ASSERT on Symbian, to avoid excessive warnings
4568         https://bugs.webkit.org/show_bug.cgi?id=27052
4569
4570         * wtf/Assertions.h:
4571
4572 2009-07-15  Oliver Hunt  <oliver@apple.com>
4573
4574         Reviewed by Simon Hausmann.
4575
4576         REGRESSION: fast/js/postfix-syntax.html fails with interpreter
4577         https://bugs.webkit.org/show_bug.cgi?id=27294
4578
4579         When postfix operators operating on locals assign to the same local
4580         the order of operations has to be to store the incremented value, then
4581         store the unmodified number.  Rather than implementing this subtle
4582         semantic in the interpreter I've just made the logic explicit in the
4583         bytecode generator, so x=x++ effectively becomes x=ToNumber(x) (for a
4584         local var x).
4585
4586         * parser/Nodes.cpp:
4587         (JSC::emitPostIncOrDec):
4588
4589 2009-07-15  Oliver Hunt  <oliver@apple.com>
4590
4591         Reviewed by Simon Hausmann.
4592
4593         REGRESSION(43559): fast/js/kde/arguments-scope.html fails with interpreter
4594         https://bugs.webkit.org/show_bug.cgi?id=27259
4595
4596         The interpreter was incorrectly basing its need to create the arguments object
4597         based on the presence of the callframe's argument reference rather than the local
4598         arguments reference.  Based on this it then overrode the local variable reference.
4599
4600         * interpreter/Interpreter.cpp:
4601         (JSC::Interpreter::privateExecute):
4602
4603 2009-07-14  Steve Falkenburg  <sfalken@apple.com>
4604
4605         Reorganize JavaScriptCore headers into:
4606         API: include/JavaScriptCore/
4607         Private: include/private/JavaScriptCore/
4608
4609         Reviewed by Darin Adler.
4610
4611         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
4612         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
4613         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
4614         * JavaScriptCore.vcproj/testapi/testapi.vcproj:
4615         * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops:
4616
4617 2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
4618
4619         Reviewed by Darin Adler.
4620
4621         Change JSCell's superclass to NoncopyableCustomAllocated
4622         https://bugs.webkit.org/show_bug.cgi?id=27248
4623
4624         JSCell class customizes operator new, since Noncopyable will be 
4625         inherited from FastAllocBase, NoncopyableCustomAllocated has 
4626         to be used.
4627
4628         * runtime/JSCell.h:
4629
4630 2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
4631
4632         Reviewed by Darin Adler.
4633
4634         Change all Noncopyable inheriting visibility to public.
4635         https://bugs.webkit.org/show_bug.cgi?id=27225
4636
4637         Change all Noncopyable inheriting visibility to public because
4638         it is needed to the custom allocation framework (bug #20422).
4639
4640         * bytecode/SamplingTool.h:
4641         * bytecompiler/RegisterID.h:
4642         * interpreter/CachedCall.h:
4643         * interpreter/RegisterFile.h:
4644         * parser/Lexer.h:
4645         * parser/Parser.h:
4646         * runtime/ArgList.h:
4647         * runtime/BatchedTransitionOptimizer.h:
4648         * runtime/Collector.h:
4649         * runtime/CommonIdentifiers.h:
4650         * runtime/JSCell.h:
4651         * runtime/JSGlobalObject.h:
4652         * runtime/JSLock.h:
4653         * runtime/JSONObject.cpp:
4654         * runtime/SmallStrings.cpp:
4655         * runtime/SmallStrings.h:
4656         * wtf/CrossThreadRefCounted.h:
4657         * wtf/GOwnPtr.h:
4658         * wtf/Locker.h:
4659         * wtf/MessageQueue.h:
4660         * wtf/OwnArrayPtr.h:
4661         * wtf/OwnFastMallocPtr.h:
4662         * wtf/OwnPtr.h:
4663         * wtf/RefCounted.h:
4664         * wtf/ThreadSpecific.h:
4665         * wtf/Threading.h:
4666         * wtf/Vector.h:
4667         * wtf/unicode/Collator.h:
4668
4669 2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
4670
4671         Reviewed by Darin Adler.
4672
4673         Change ParserArenaRefCounted's superclass to RefCountedCustomAllocated
4674         https://bugs.webkit.org/show_bug.cgi?id=27249
4675
4676         ParserArenaDeletable customizes operator new, to avoid double inheritance
4677         ParserArenaDeletable's superclass has been changed to RefCountedCustomAllocated.
4678
4679         * parser/Nodes.h:
4680
4681 2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
4682
4683         Reviewed by Darin Adler.
4684
4685         Add RefCountedCustomAllocated to RefCounted.h
4686         https://bugs.webkit.org/show_bug.cgi?id=27232
4687
4688         Some class which are inherited from RefCounted customize
4689         operator new, but RefCounted is inherited from Noncopyable
4690         which will be inherited from FastAllocBase. To avoid
4691         conflicts Noncopyable inheriting was moved down to RefCounted
4692         and to avoid double inheritance this class has been added.
4693
4694         * wtf/RefCounted.h:
4695         (WTF::RefCountedCustomAllocated::deref):
4696         (WTF::RefCountedCustomAllocated::~RefCountedCustomAllocated):
4697
4698 2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
4699
4700         Reviewed by Darin Adler.
4701
4702         Add NoncopyableCustomAllocated to Noncopyable.h.
4703         https://bugs.webkit.org/show_bug.cgi?id=27228
4704         
4705         Some classes which inherited from Noncopyable overrides operator new
4706         since Noncopyable'll be inherited from FastAllocBase, Noncopyable.h 
4707         needs to be extended with this new class to support the overriding. 
4708
4709         * wtf/Noncopyable.h:
4710         (WTFNoncopyable::NoncopyableCustomAllocated::NoncopyableCustomAllocated):
4711         (WTFNoncopyable::NoncopyableCustomAllocated::~NoncopyableCustomAllocated):
4712
4713 2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
4714
4715         Reviewed by Darin Adler.
4716
4717         Allow custom memory allocation control for JavaScriptCore's IdentifierTable class
4718         https://bugs.webkit.org/show_bug.cgi?id=27260
4719
4720         Inherits IdentifierTable class from FastAllocBase because it has been
4721         instantiated by 'new' in JavaScriptCore/runtime/Identifier.cpp:70.
4722
4723         * runtime/Identifier.cpp:
4724
4725 2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
4726
4727         Reviewed by Darin Adler.
4728
4729         Allow custom memory allocation control for JavaScriptCore's Profiler class
4730         https://bugs.webkit.org/show_bug.cgi?id=27253
4731
4732         Inherits Profiler class from FastAllocBase because it has been instantiated by
4733         'new' in JavaScriptCore/profiler/Profiler.cpp:56.
4734
4735         * profiler/Profiler.h:
4736
4737 2009-07-06  George Staikos  <george.staikos@torchmobile.com>
4738
4739         Reviewed by Adam Treat.
4740
4741         Authors: George Staikos <george.staikos@torchmobile.com>, Joe Mason <joe.mason@torchmobile.com>, Makoto Matsumoto <matumoto@math.keio.ac.jp>, Takuji Nishimura
4742
4743         https://bugs.webkit.org/show_bug.cgi?id=27030
4744         Implement custom RNG for WinCE using Mersenne Twister
4745
4746         * wtf/RandomNumber.cpp:
4747         (WTF::randomNumber):
4748         * wtf/RandomNumberSeed.h:
4749         (WTF::initializeRandomNumberGenerator):
4750         * wtf/wince/mt19937ar.c: Added.
4751         (init_genrand):
4752         (init_by_array):
4753         (genrand_int32):
4754         (genrand_int31):
4755         (genrand_real1):
4756         (genrand_real2):
4757         (genrand_real3):
4758         (genrand_res53):
4759
4760 2009-07-13  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
4761
4762         Unreviewed make dist build fix.
4763
4764         * GNUmakefile.am:
4765
4766 2009-07-13  Drew Wilson  <atwilson@google.com>
4767
4768         Reviewed by David Levin.
4769
4770         Add ENABLE(SHARED_WORKERS) flag and define SharedWorker APIs
4771         https://bugs.webkit.org/show_bug.cgi?id=26932
4772
4773         Added ENABLE(SHARED_WORKERS) flag (off by default).
4774
4775         * Configurations/FeatureDefines.xcconfig:
4776
4777 2009-07-07  Norbert Leser  <norbert.leser@nokia.com>
4778
4779         Reviewed by Maciej Stachoviak.
4780
4781         https://bugs.webkit.org/show_bug.cgi?id=27058
4782
4783         Removed superfluous parenthesis around single expression.
4784         Compilers on Symbian platform fail to properly parse and compile.
4785
4786         * JavaScriptCore/wtf/Platform.h:
4787
4788 2009-07-13  Norbert Leser  <norbert.leser@nokia.com>
4789
4790         Reviewed by Maciej Stachoviak.
4791
4792         https://bugs.webkit.org/show_bug.cgi?id=27054
4793
4794         Renamed Translator to HashTranslator
4795
4796         Codewarrior compiler (WINSCW) latest b482 cannot resolve typename
4797         mismatch between template declaration and definition
4798         (HashTranslator / Translator)
4799
4800         * wtf/HashSet.h:
4801
4802 2009-07-13  Norbert Leser  <norbert.leser@nokia.com>
4803
4804         Reviewed by Eric Seidel.
4805
4806         https://bugs.webkit.org/show_bug.cgi?id=27053
4807
4808         Ambiguity in LabelScope initialization
4809
4810         Codewarrior compiler (WINSCW) latest b482 on Symbian cannot resolve
4811         type of "0" unambiguously. Set expression explicitly to
4812         PassRefPtr<Label>::PassRefPtr()
4813
4814         * bytecompiler/BytecodeGenerator.cpp
4815
4816 2009-07-11  Simon Fraser  <simon.fraser@apple.com>
4817
4818         Enable support for accelerated compositing and 3d transforms on Leopard.
4819         <https://bugs.webkit.org/show_bug.cgi?id=20166>
4820         <rdar://problem/6120614>
4821
4822         Reviewed by Oliver Hunt.
4823
4824         * Configurations/FeatureDefines.xcconfig:
4825         * wtf/Platform.h:
4826
4827 2009-07-10  Mark Rowe  <mrowe@apple.com>
4828
4829         Second part of the "make Windows happier" dance.
4830
4831         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
4832         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
4833
4834 2009-07-10  Mark Rowe  <mrowe@apple.com>
4835
4836         Try and make the Windows build happy.
4837
4838         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
4839         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
4840
4841 2009-07-10  Kevin McCullough  <kmccullough@apple.com>
4842
4843         Reviewed by Geoffrey Garen.
4844
4845         * debugger/Debugger.h: Made this function virtual for use in WebCore's
4846         WebInspector.
4847
4848 2009-07-10  Kwang Yul Seo  <skyul@company100.net>
4849
4850         Reviewed by Darin Adler.
4851
4852         ParserArenaDeletable should override delete
4853         https://bugs.webkit.org/show_bug.cgi?id=26790
4854
4855         ParserArenaDeletable overrides new, but it does not override delete.
4856         ParserArenaDeletable must be freed by fastFree
4857         because it is allocated by fastMalloc.
4858
4859         * parser/NodeConstructors.h:
4860         (JSC::ParserArenaDeletable::operator delete):
4861         * parser/Nodes.h:
4862
4863 2009-07-10  Adam Roben  <aroben@apple.com>
4864
4865         Sort all our Xcode projects
4866
4867         Accomplished using sort-Xcode-project-file.
4868
4869         Requested by Dave Kilzer.
4870
4871         * JavaScriptCore.xcodeproj/project.pbxproj:
4872
4873 2009-07-09  Maciej Stachowiak  <mjs@apple.com>
4874
4875         Not reviewed, build fix.
4876
4877         Windows build fix for the last change.
4878
4879         * wtf/dtoa.cpp: Forgot to include Vector.h
4880
4881 2009-07-09  Maciej Stachowiak  <mjs@apple.com>
4882
4883         Reviewed by Darin Adler.
4884
4885         REGRESSION: crash in edge cases of floating point parsing.
4886         https://bugs.webkit.org/show_bug.cgi?id=27110
4887         <rdar://problem/7044458>
4888         
4889         Tests: fast/css/number-parsing-crash.html
4890                fast/css/number-parsing-crash.html
4891                fast/js/number-parsing-crash.html
4892         
4893         * wtf/dtoa.cpp:
4894         (WTF::BigInt::BigInt): Converted this to more a proper class, using a Vector
4895         with inline capacity
4896
4897         (WTF::lshift): Rearranged logic somewhat nontrivially to deal with the new way of sizing BigInts.
4898         Added an assertion to verify that invariants are maintained.
4899
4900         All other functions are adapted fairly mechanically to the above changes.
4901         (WTF::BigInt::clear):
4902         (WTF::BigInt::size):
4903         (WTF::BigInt::resize):
4904         (WTF::BigInt::words):
4905         (WTF::BigInt::append):
4906         (WTF::multadd):
4907         (WTF::s2b):
4908         (WTF::i2b):
4909         (WTF::mult):
4910         (WTF::cmp):
4911         (WTF::diff):
4912         (WTF::b2d):
4913         (WTF::d2b):
4914         (WTF::ratio):
4915         (WTF::strtod):
4916         (WTF::quorem):
4917         (WTF::dtoa):
4918
4919 2009-07-09  Drew Wilson  <atwilson@google.com>
4920
4921         Reviewed by Alexey Proskuryakov.
4922
4923         Turned on CHANNEL_MESSAGING by default because the MessageChannel API
4924         can now be implemented for Web Workers and is reasonably stable.
4925
4926         * Configurations/FeatureDefines.xcconfig:
4927
4928 2009-07-09  Oliver Hunt  <oliver@apple.com>
4929
4930         Reviewed by NOBODY (Build fix).
4931
4932         * interpreter/Interpreter.cpp:
4933         (JSC::Interpreter::privateExecute):
4934
4935 2009-07-09  Oliver Hunt  <oliver@apple.com>
4936
4937         Reviewed by Darin Adler.
4938
4939         Bug 27016 - Interpreter crashes due to invalid array indexes
4940         <https://bugs.webkit.org/show_bug.cgi?id=27016>
4941
4942         Unsigned vs signed conversions results in incorrect behaviour in
4943         64bit interpreter builds.
4944
4945         * interpreter/Interpreter.cpp:
4946         (JSC::Interpreter::privateExecute):
4947
4948 2009-07-09  Dimitri Glazkov  <dglazkov@chromium.org>
4949
4950         Reviewed by Darin Fisher.
4951
4952         [Chromium] Upstream JavaScriptCore.gypi, the project file for Chromium build.
4953         https://bugs.webkit.org/show_bug.cgi?id=27135
4954
4955         * JavaScriptCore.gypi: Added.
4956
4957 2009-07-09  Joe Mason  <joe.mason@torchmobile.com>
4958
4959         Reviewed by George Staikos.
4960         
4961         Authors: Yong Li <yong.li@torchmobile.com>, Joe Mason <joe.mason@torchmobile.com>
4962
4963         https://bugs.webkit.org/show_bug.cgi?id=27031
4964         Add an override for deleteOwnedPtr(HDC) on Windows
4965         
4966         * wtf/OwnPtrCommon.h:
4967         * wtf/OwnPtrWin.cpp:
4968         (WTF::deleteOwnedPtr):
4969
4970 2009-07-09  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
4971
4972         Reviewed by Darin Adler.
4973
4974         Guard singal.h dependency with HAVE(SIGNAL_H) to enable building jsc
4975         on SYMBIAN.
4976
4977         https://bugs.webkit.org/show_bug.cgi?id=27026
4978
4979         Based on Norbert Leser's work.
4980
4981         * jsc.cpp:
4982         (printUsageStatement):
4983         (parseArguments):
4984         * wtf/Platform.h:
4985
4986 2009-07-07  Gavin Barraclough  <barraclough@apple.com>
4987
4988         Reviewed by Sam Weinig.
4989
4990         Stop loading constants into the register file.
4991
4992         Instead, use high register values (highest bit bar the sign bit set) to indicate
4993         constants in the instruction stream, and when we encounter such a value load it
4994         directly from the CodeBlock.
4995
4996         Since constants are no longer copied into the register file, this patch renders
4997         the 'unexpected constant' mechanism redundant, and removes it.
4998
4999         2% improvement, thanks to Sam Weinig.
5000
5001         * bytecode/CodeBlock.cpp:
5002         (JSC::CodeBlock::dump):
5003         (JSC::CodeBlock::CodeBlock):
5004         (JSC::CodeBlock::mark):
5005         (JSC::CodeBlock::shrinkToFit):
5006         * bytecode/CodeBlock.h:
5007         (JSC::CodeBlock::isTemporaryRegisterIndex):
5008         (JSC::CodeBlock::constantRegister):
5009         (JSC::CodeBlock::isConstantRegisterIndex):
5010         (JSC::CodeBlock::getConstant):
5011         (JSC::ExecState::r):
5012         * bytecode/Opcode.h:
5013         * bytecompiler/BytecodeGenerator.cpp:
5014         (JSC::BytecodeGenerator::preserveLastVar):
5015         (JSC::BytecodeGenerator::BytecodeGenerator):
5016         (JSC::BytecodeGenerator::addConstantValue):
5017         (JSC::BytecodeGenerator::emitEqualityOp):
5018         (JSC::BytecodeGenerator::emitLoad):
5019         (JSC::BytecodeGenerator::emitResolveBase):
5020         (JSC::BytecodeGenerator::emitResolveWithBase):
5021         (JSC::BytecodeGenerator::emitNewError):
5022         * bytecompiler/BytecodeGenerator.h:
5023         (JSC::BytecodeGenerator::emitNode):
5024         * interpreter/CallFrame.h:
5025         (JSC::ExecState::noCaller):
5026         (JSC::ExecState::hasHostCallFrameFlag):
5027         (JSC::ExecState::addHostCallFrameFlag):
5028         (JSC::ExecState::removeHostCallFrameFlag):
5029         * interpreter/Interpreter.cpp:
5030         (JSC::Interpreter::resolve):
5031         (JSC::Interpreter::resolveSkip):
5032         (JSC::Interpreter::resolveGlobal):
5033         (JSC::Interpreter::resolveBase):
5034         (JSC::Interpreter::resolveBaseAndProperty):
5035         (JSC::Interpreter::resolveBaseAndFunc):
5036         (JSC::Interpreter::dumpRegisters):
5037         (JSC::Interpreter::throwException):
5038         (JSC::Interpreter::createExceptionScope):
5039         (JSC::Interpreter::privateExecute):
5040         (JSC::Interpreter::retrieveArguments):
5041         * jit/JIT.cpp:
5042         (JSC::JIT::privateCompileMainPass):
5043         * jit/JITInlineMethods.h:
5044         (JSC::JIT::emitLoadDouble):
5045         (JSC::JIT::emitLoadInt32ToDouble):
5046         * jit/JITOpcodes.cpp:
5047         (JSC::JIT::emit_op_new_error):
5048         (JSC::JIT::emit_op_enter):
5049         (JSC::JIT::emit_op_enter_with_activation):
5050         * parser/Nodes.cpp:
5051         (JSC::DeleteResolveNode::emitBytecode):
5052         (JSC::DeleteValueNode::emitBytecode):
5053         (JSC::PrefixResolveNode::emitBytecode):
5054         * runtime/JSActivation.cpp:
5055         (JSC::JSActivation::JSActivation):
5056         * wtf/Platform.h:
5057
5058 2009-07-07  Mark Rowe  <mrowe@apple.com>
5059
5060         Reviewed by Darin Adler.
5061
5062         Fix <https://bugs.webkit.org/show_bug.cgi?id=27025> / <rdar://problem/7033448>.
5063         Bug 27025: Crashes and regression test failures related to regexps in 64-bit
5064
5065         For x86_64 RegexGenerator uses rbx, a callee-save register, as a scratch register but
5066         neglects to save and restore it.  The change in handling of the output vector in r45545
5067         altered code generation so that the RegExp::match was now storing important data in rbx,
5068         which caused crashes and bogus results when it was clobbered.
5069
5070         * yarr/RegexJIT.cpp:
5071         (JSC::Yarr::RegexGenerator::generateEnter): Save rbx.
5072         (JSC::Yarr::RegexGenerator::generateReturn): Restore rbx.
5073
5074 2009-07-06  Ada Chan  <adachan@apple.com>
5075
5076         Reviewed by Darin Adler and Mark Rowe.
5077
5078         Decommitted spans are added to the list of normal spans rather than 
5079         the returned spans in TCMalloc_PageHeap::Delete().
5080         https://bugs.webkit.org/show_bug.cgi?id=26998
5081         
5082         In TCMalloc_PageHeap::Delete(), the deleted span can be decommitted in 
5083         the process of merging with neighboring spans that are also decommitted.  
5084         The merged span needs to be placed in the list of returned spans (spans 
5085         whose memory has been returned to the system).  Right now it's always added 
5086         to the list of the normal spans which can theoretically cause thrashing.  
5087
5088         * wtf/FastMalloc.cpp:
5089         (WTF::TCMalloc_PageHeap::Delete):
5090
5091 2009-07-05  Lars Knoll  <lars.knoll@nokia.com>
5092
5093         Reviewed by Maciej Stachowiak.
5094
5095         https://bugs.webkit.org/show_bug.cgi?id=26843
5096
5097         Fix run-time crashes in JavaScriptCore with the Metrowerks compiler on Symbian.
5098
5099         The Metrowerks compiler on the Symbian platform moves the globally
5100         defined Hashtables into read-only memory, despite one of the members
5101         being mutable. This causes crashes at run-time due to write access to
5102         read-only memory.
5103
5104         Avoid the use of const with this compiler by introducing the
5105         JSC_CONST_HASHTABLE macro.
5106
5107         Based on idea by Norbert Leser.
5108
5109         * runtime/Lookup.h: Define JSC_CONST_HASHTABLE as const for !WINSCW.
5110         * create_hash_table: Use JSC_CONST_HASHTABLE for hashtables.
5111         * runtime/JSGlobalData.cpp: Import various global hashtables via the macro.
5112
5113 2009-07-04  Dan Bernstein  <mitz@apple.com>
5114
5115         - debug build fix
5116
5117         * runtime/RegExpConstructor.cpp:
5118         (JSC::RegExpConstructor::getLastParen):
5119
5120 2009-07-03  Yong Li  <yong.li@torchmobile.com>
5121
5122         Reviewed by Maciej Stachowiak (and revised slightly)
5123
5124         RegExp::match to be optimized
5125         https://bugs.webkit.org/show_bug.cgi?id=26957
5126
5127         Allow regexp matching to use Vectors with inline capacity instead of
5128         allocating a new ovector buffer every time.
5129         
5130         ~5% speedup on SunSpider string-unpack-code test, 0.3% on SunSpider overall.
5131
5132         * runtime/RegExp.cpp:
5133         (JSC::RegExp::match):
5134         * runtime/RegExp.h:
5135         * runtime/RegExpConstructor.cpp:
5136         (JSC::RegExpConstructorPrivate::RegExpConstructorPrivate):
5137         (JSC::RegExpConstructorPrivate::lastOvector):
5138         (JSC::RegExpConstructorPrivate::tempOvector):
5139         (JSC::RegExpConstructorPrivate::changeLastOvector):
5140         (JSC::RegExpConstructor::performMatch):
5141         (JSC::RegExpMatchesArray::RegExpMatchesArray):
5142         (JSC::RegExpMatchesArray::fillArrayInstance):
5143         (JSC::RegExpConstructor::getBackref):
5144         (JSC::RegExpConstructor::getLastParen):
5145         (JSC::RegExpConstructor::getLeftContext):
5146         (JSC::RegExpConstructor::getRightContext):
5147         * runtime/StringPrototype.cpp:
5148         (JSC::stringProtoFuncSplit):
5149
5150 2009-06-30  Kwang Yul Seo  <skyul@company100.net>
5151
5152         Reviewed by Eric Seidel.
5153
5154         Override operator new/delete with const std::nothrow_t& as the second
5155         argument.
5156         https://bugs.webkit.org/show_bug.cgi?id=26792
5157
5158         On Windows CE, operator new/delete, new[]/delete[] with const
5159         std::nothrow_t& must be overrided because some standard template
5160         libraries use these operators.
5161
5162         The problem occurs when memory allocated by new(size_t s, const
5163         std::nothrow_t&) is freed by delete(void* p). This causes the umatched
5164         malloc/free problem.
5165
5166         The patch overrides all new, delete, new[] and delete[] to use
5167         fastMaloc and fastFree consistently.
5168
5169         * wtf/FastMalloc.h:
5170         (throw):
5171
5172 2009-06-30  Gabor Loki  <loki@inf.u-szeged.hu>
5173
5174         Reviewed by Sam Weinig.
5175
5176         <https://bugs.webkit.org/show_bug.cgi?id=24986>
5177
5178         Remove unnecessary references to AssemblerBuffer.
5179
5180         * interpreter/Interpreter.cpp:
5181         * interpreter/Interpreter.h:
5182
5183 2009-06-29  David Levin  <levin@chromium.org>
5184
5185         Reviewed by Oliver Hunt.
5186
5187         Still seeing occasional leaks from UString::sharedBuffer code
5188         https://bugs.webkit.org/show_bug.cgi?id=26420
5189
5190         The problem is that the pointer to the memory allocation isn't visible
5191         by "leaks" due to the lower bits being used as flags.  The fix is to
5192         make the pointer visible in memory (in debug only). The downside of
5193         this fix that the memory allocated by sharedBuffer will still look like
5194         a leak in non-debug builds when any flags are set.
5195
5196         * wtf/PtrAndFlags.h:
5197         (WTF::PtrAndFlags::set):
5198
5199 2009-06-29  Sam Weinig  <sam@webkit.org>
5200
5201         Reviewed by Mark Rowe.
5202
5203         Remove more unused scons support.
5204
5205         * SConstruct: Removed.
5206
5207 2009-06-29  Oliver Hunt  <oliver@apple.com>
5208
5209         Reviewed by Gavin Barraclough.
5210
5211         <rdar://problem/7016214> JSON.parse fails to parse valid JSON with most Unicode characters
5212         <https://bugs.webkit.org/show_bug.cgi?id=26802>
5213
5214         In the original JSON.parse patch unicode was handled correctly, however in some last
5215         minute "clean up" I oversimplified isSafeStringCharacter.  This patch corrects this bug.
5216
5217         * runtime/LiteralParser.cpp:
5218         (JSC::isSafeStringCharacter):
5219         (JSC::LiteralParser::Lexer::lexString):
5220
5221 2009-06-26  Oliver Hunt  <oliver@apple.com>
5222
5223         Reviewed by Dan Bernstein.
5224
5225         <rdar://problem/7009684> REGRESSION(r45039): Crashes inside JSEvent::put on PowerPC (26746)
5226         <https://bugs.webkit.org/show_bug.cgi?id=26746>
5227
5228         Fix for r45039 incorrectly uncached a get_by_id by converting it to put_by_id.  Clearly this
5229         is less than correct.  This patch corrects that error.
5230
5231         * interpreter/Interpreter.cpp:
5232         (JSC::Interpreter::tryCacheGetByID):
5233
5234 2009-06-26  Eric Seidel  <eric@webkit.org>
5235
5236         No review, only rolling out r45259.
5237
5238         Roll out r45259 after crash appeared on the bots:
5239         plugins/undefined-property-crash.html
5240         ASSERTION FAILED: s <= HeapConstants<heapType>::cellSize
5241         (leopard-intel-debug-tests/build/JavaScriptCore/runtime/Collector.cpp:278
5242         void* JSC::Heap::heapAllocate(size_t) [with JSC::HeapType heapType = PrimaryHeap])
5243
5244         * runtime/DateInstance.cpp:
5245         * runtime/Identifier.cpp:
5246         * runtime/Lookup.h:
5247         * runtime/RegExpConstructor.cpp:
5248         * runtime/RegExpObject.h:
5249         * runtime/ScopeChain.h:
5250         * runtime/UString.h:
5251
5252 2009-06-26  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
5253
5254         Reviewed by Simon Hausmann.
5255
5256         Add support for QDataStream operators to Vector.
5257
5258         * wtf/Vector.h:
5259         (WTF::operator<<):
5260         (WTF::operator>>):
5261
5262 2009-06-24  Sam Weinig  <sam@webkit.org>
5263
5264         Reviewed by Gavin Barraclough.
5265
5266         Make the opcode sampler work once again.
5267
5268         * jit/JIT.h:
5269         (JSC::JIT::compileGetByIdProto):
5270         (JSC::JIT::compileGetByIdSelfList):
5271         (JSC::JIT::compileGetByIdProtoList):
5272         (JSC::JIT::compileGetByIdChainList):
5273         (JSC::JIT::compileGetByIdChain):
5274         (JSC::JIT::compilePutByIdTransition):
5275         (JSC::JIT::compileCTIMachineTrampolines):
5276         (JSC::JIT::compilePatchGetArrayLength):
5277         * jit/JITStubCall.h:
5278         (JSC::JITStubCall::call):
5279
5280 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
5281
5282         Reviewed by Maciej Stachowiak.
5283
5284         Extend FastAllocBase.h with 'using WTF::FastAllocBase' to avoid
5285         unnecessary WTF:: usings.
5286         Remove existing unnecessary WTF:: usings.
5287
5288         * interpreter/Interpreter.h:
5289         * profiler/CallIdentifier.h:
5290         * runtime/ScopeChain.h:
5291         * wtf/FastAllocBase.h:
5292
5293 2009-06-24  David Levin  <levin@chromium.org>
5294
5295         Fix all builds.
5296
5297         * bytecode/CodeBlock.h:
5298         * bytecompiler/BytecodeGenerator.h:
5299         * interpreter/Register.h:
5300
5301 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
5302
5303         Reviewed by Maciej Stachowiak.
5304         
5305         https://bugs.webkit.org/show_bug.cgi?id=26677
5306
5307         Inherits CodeBlock class from FastAllocBase because it
5308         has been instantiated by 'new' in JavaScriptCore/bytecode/CodeBlock.h:217.
5309
5310         * bytecode/CodeBlock.h:
5311
5312 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
5313
5314         Reviewed by Maciej Stachowiak.
5315         
5316         https://bugs.webkit.org/show_bug.cgi?id=26676
5317
5318         Inherits BytecodeGenerator class from FastAllocBase because it has been
5319         instantiated by 'new' in JavaScriptCore/parser/Nodes.cpp:1892.
5320
5321         * bytecompiler/BytecodeGenerator.h:
5322
5323 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
5324
5325         Reviewed by Maciej Stachowiak.
5326         
5327         https://bugs.webkit.org/show_bug.cgi?id=26675
5328
5329         Inherits Register class from FastAllocBase because it has been
5330         instantiated by 'new' in JavaScriptCore/runtime/JSVariableObject.h:149.
5331
5332         * interpreter/Register.h:
5333
5334 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
5335
5336         Reviewed by Darin Adler.
5337         
5338         https://bugs.webkit.org/show_bug.cgi?id=26674
5339
5340         Inherits HashMap class from FastAllocBase because it has been
5341         instantiated by 'new' in JavaScriptCore/runtime/Structure.cpp:458.
5342
5343         * wtf/HashMap.h:
5344
5345 2009-06-24  Oliver Hunt  <oliver@apple.com>
5346
5347         Reviewed by Darin Adler.
5348
5349         <rdar://problem/6940519> REGRESSION (Safari 4 Public Beta - TOT): google.com/adplanner shows blank page instead of site details in "basic research'
5350
5351         The problem was caused by the page returned with a function using a
5352         var declaration list containing around ~3000 variables.  The solution
5353         to this is to flatten the comma expression representation and make
5354         codegen comma expressions and initializer lists iterative rather than
5355         recursive.
5356
5357         * parser/Grammar.y:
5358         * parser/NodeConstructors.h:
5359         (JSC::CommaNode::CommaNode):
5360         * parser/Nodes.cpp:
5361         (JSC::CommaNode::emitBytecode):
5362         * parser/Nodes.h:
5363         (JSC::ExpressionNode::isCommaNode):
5364         (JSC::CommaNode::isCommaNode):
5365         (JSC::CommaNode::append):
5366
5367 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
5368
5369         Reviewed by Maciej Stachowiak.
5370
5371         https://bugs.webkit.org/show_bug.cgi?id=26645
5372
5373         Inherits ScopeChainNode class from FastAllocBase because it has been
5374         instantiated by 'new' in JavaScriptCore/runtime/ScopeChain.h:95.
5375
5376         * wtf/RefPtr.h:
5377
5378 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
5379
5380         Reviewed by Darin Adler.
5381
5382         https://bugs.webkit.org/show_bug.cgi?id=26648
5383
5384         Inherits Deque class from FastAllocBase because it has been
5385         instantiated by 'new' with DEFINE_STATIC_LOCAL macro in 
5386         JavaScriptCore/wtf/MainThread.cpp:62.
5387
5388         * wtf/Deque.h:
5389
5390 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
5391
5392         Reviewed by Darin Adler.
5393
5394         https://bugs.webkit.org/show_bug.cgi?id=26644
5395
5396         Inherits RefPtr class from FastAllocBase because it has been
5397         instantiated by 'new' in JavaScriptCore/runtime/StructureChain.cpp:41.
5398
5399         * wtf/RefPtr.h:
5400
5401 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
5402
5403         Reviewed by Darin Adler.
5404
5405         Inherits HashSet class from FastAllocBase, because it has been
5406         instantiated by 'new' in JavaScriptCore/runtime/Collector.h:116.
5407
5408         * wtf/HashSet.h:
5409
5410 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
5411
5412         Reviewed by Darin Adler.
5413
5414         Inherits Vector class from FastAllocBase because it has been
5415         instantiated by 'new' in JavaScriptCore/runtime/Structure.cpp:633.
5416
5417         * wtf/Vector.h:
5418
5419 2009-06-24  Norbert Leser  <norbert.leser@nokia.com>
5420
5421         Reviewed by Maciej Stachoviak.
5422
5423         The BytecodeGenerator objects were instantiated on stack, which takes up ~38kB per instance
5424         (each instance includes copy of JSC::CodeBlock with large SymbolTable, etc.).
5425         Specifically, since there is nested invocation (e.g., GlobalCode --> FunctionCode),
5426         the stack overflows immediately on Symbian hardware (max. 80 kB).
5427         Proposed change allocates generator objects on heap.
5428         Performance impact (if any) should be negligible and change is proposed as general fix,
5429         rather than ifdef'd for SYMBIAN.
5430
5431         * parser/Nodes.cpp:
5432         (JSC::ProgramNode::generateBytecode):
5433         (JSC::EvalNode::generateBytecode):
5434         (JSC::EvalNode::bytecodeForExceptionInfoReparse):
5435         (JSC::FunctionBodyNode::generateBytecode):
5436         (JSC::FunctionBodyNode::bytecodeForExceptionInfoReparse):
5437
5438 2009-06-23  Oliver Hunt  <oliver@apple.com>
5439
5440         Reviewed by Gavin Barraclough.
5441
5442         <rdar://problem/6992806> REGRESSION: Enumeration can skip new properties in cases of prototypes that have more than 64 (26593)
5443         <https://bugs.webkit.org/show_bug.cgi?id=26593>
5444
5445         Do not attempt to cache structure chains if they contain a dictionary at any level.
5446
5447         * interpreter/Interpreter.cpp:
5448         (JSC::Interpreter::tryCachePutByID):
5449         (JSC::Interpreter::tryCacheGetByID):
5450         * jit/JITStubs.cpp:
5451         (JSC::JITThunks::tryCachePutByID):
5452         * runtime/Structure.cpp:
5453         (JSC::Structure::getEnumerablePropertyNames):
5454         (JSC::Structure::addPropertyTransition):
5455         * runtime/StructureChain.cpp:
5456         (JSC::StructureChain::isCacheable):
5457         * runtime/StructureChain.h:
5458
5459 2009-06-23  Yong Li  <yong.li@torchmobile.com>
5460
5461         Reviewed by George Staikos.
5462
5463         https://bugs.webkit.org/show_bug.cgi?id=26654
5464         Add the proper export define for the JavaScriptCore API when building for WINCE.
5465
5466         * API/JSBase.h:
5467
5468 2009-06-23  Joe Mason  <joe.mason@torchmobile.com>
5469
5470         Reviewed by Adam Treat.
5471
5472         Authors: Yong Li <yong.li@torchmobile.com>, Joe Mason <joe.mason@torchmobile.com>
5473
5474         https://bugs.webkit.org/show_bug.cgi?id=26611
5475         Implement currentThreadStackBase on WINCE by adding a global,
5476         g_stackBase, which must be set to the address of a local variable
5477         by the caller before calling any WebKit function that invokes JSC.
5478
5479         * runtime/Collector.cpp:
5480         (JSC::isPageWritable):
5481         (JSC::getStackBase):
5482           Starts at the top of the stack and returns the entire range of
5483           consecutive writable pages as an estimate of the actual stack.
5484           This will be much bigger than the actual stack range, so some
5485           dead objects can't be collected, but it guarantees live objects
5486           aren't collected prematurely.
5487
5488         (JSC::currentThreadStackBase):
5489           On WinCE, returns g_stackBase if set or call getStackBase as a
5490           fallback if not.
5491
5492 2009-06-23  Oliver Hunt  <oliver@apple.com>
5493
5494         Reviewed by Alexey Proskuryakov.
5495
5496         Fix stupid performance problem in the LiteralParser
5497
5498         The LiteralParser was making a new UString in order to use
5499         toDouble, however UString's toDouble allows a much wider range
5500         of numberic strings than the LiteralParser accepts, and requires
5501         an additional heap allocation or two for the construciton of the
5502         UString.  To rectify this we just call WTF::dtoa directly using
5503         a stack allocated buffer to hold the validated numeric literal.
5504
5505         * runtime/LiteralParser.cpp:
5506         (JSC::LiteralParser::Lexer::lexNumber):
5507         (JSC::LiteralParser::parse):
5508         * runtime/LiteralParser.h:
5509
5510 2009-06-22  Oliver Hunt  <oliver@apple.com>
5511
5512         Reviewed by Alexey Proskuryakov.
5513
5514         Bug 26640: JSON.stringify needs to special case Boolean objects
5515         <https://bugs.webkit.org/show_bug.cgi?id=26640>
5516
5517         Add special case handling of the Boolean object so we match current
5518         ES5 errata.
5519
5520         * runtime/JSONObject.cpp:
5521         (JSC::unwrapBoxedPrimitive): renamed from unwrapNumberOrString
5522         (JSC::gap):
5523         (JSC::Stringifier::appendStringifiedValue):
5524
5525 2009-06-22  Oliver Hunt  <oliver@apple.com>
5526
5527         Reviewed by Darin Adler.
5528
5529         Bug 26591: Support revivers in JSON.parse
5530         <https://bugs.webkit.org/show_bug.cgi?id=26591>
5531
5532         Add reviver support to JSON.parse.  This completes the JSON object.
5533
5534         * runtime/JSONObject.cpp:
5535         (JSC::Walker::Walker):
5536         (JSC::Walker::callReviver):
5537         (JSC::Walker::walk):
5538         (JSC::JSONProtoFuncParse):
5539
5540 2009-06-21  Oliver Hunt  <oliver@apple.com>
5541
5542         Reviewed by Darin Adler.
5543
5544         Bug 26592: Support standard toJSON functions
5545         <https://bugs.webkit.org/show_bug.cgi?id=26592>
5546
5547         Add support for the standard Date.toJSON function.
5548
5549         * runtime/DatePrototype.cpp:
5550         (JSC::dateProtoFuncToJSON):
5551
5552 2009-06-21  Oliver Hunt  <oliver@apple.com>
5553
5554         Reviewed by Sam Weinig.
5555
5556         Bug 26594: JSC needs to support Date.toISOString
5557         <https://bugs.webkit.org/show_bug.cgi?id=26594>
5558
5559         Add support for Date.toISOString.
5560
5561         * runtime/DatePrototype.cpp:
5562         (JSC::dateProtoFuncToISOString):
5563
5564 2009-06-21  Oliver Hunt  <oliver@apple.com>
5565
5566         Reviewed by NOBODY (Build fix).
5567
5568         Remove dead code.
5569
5570         * runtime/LiteralParser.cpp:
5571         (JSC::LiteralParser::parse):
5572
5573 2009-06-21  Oliver Hunt  <oliver@apple.com>
5574
5575         Reviewed by Darin Adler and Cameron Zwarich.
5576
5577         Bug 26587: Support JSON.parse
5578         <https://bugs.webkit.org/show_bug.cgi?id=26587>
5579
5580         Extend the LiteralParser to support the full strict JSON
5581         grammar, fix a few places where the grammar was incorrectly
5582         lenient.   Doesn't yet support the JSON.parse reviver function
5583         but that does not block the JSON.parse functionality itself.
5584
5585         * interpreter/Interpreter.cpp:
5586         (JSC::Interpreter::callEval):
5587         * runtime/JSGlobalObjectFunctions.cpp:
5588         (JSC::globalFuncEval):
5589         * runtime/JSONObject.cpp:
5590         (JSC::JSONProtoFuncParse):
5591         * runtime/LiteralParser.cpp:
5592         (JSC::LiteralParser::Lexer::lex):
5593         (JSC::isSafeStringCharacter):
5594         (JSC::LiteralParser::Lexer::lexString):
5595         (JSC::LiteralParser::parse):
5596         * runtime/LiteralParser.h:
5597         (JSC::LiteralParser::LiteralParser):
5598         (JSC::LiteralParser::tryJSONParse):
5599         (JSC::LiteralParser::):
5600         (JSC::LiteralParser::Lexer::Lexer):
5601
5602 2009-06-21  David Levin  <levin@chromium.org>
5603
5604         Reviewed by NOBODY (speculative build fix for windows).
5605
5606         Simply removed some whitespace form this file to make windows build wtf and
5607         hopefully copy the new MessageQueque.h so that WebCore picks it up.
5608
5609         * wtf/Assertions.cpp:
5610
5611 2009-06-21  Drew Wilson  <atwilson@google.com>
5612
5613         Reviewed by David Levin.
5614
5615         <https://bugs.webkit.org/show_bug.cgi?id=25043>
5616         Added support for multi-threaded MessagePorts.
5617
5618         * wtf/MessageQueue.h:
5619         (WTF::::appendAndCheckEmpty):
5620             Added API to test whether the queue was empty before adding an element.
5621   
5622 2009-06-20  David D. Kilzer  <ddkilzer@webkit.org>
5623
5624         Fix namespace comment in SegmentedVector.h
5625
5626         * wtf/SegmentedVector.h: Updated namespace comment to reflect
5627         new namespace after r44897.
5628
5629 2009-06-20  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
5630
5631         Bug 24986: ARM JIT port
5632         <https://bugs.webkit.org/show_bug.cgi?id=24986>
5633
5634         Reviewed by Oliver Hunt.
5635
5636         An Iterator added for SegmentedVector. Currently
5637         only the pre ++ operator is supported.
5638
5639         * wtf/SegmentedVector.h:
5640         (WTF::SegmentedVectorIterator::~SegmentedVectorIterator):
5641         (WTF::SegmentedVectorIterator::operator*):
5642         (WTF::SegmentedVectorIterator::operator->):
5643         (WTF::SegmentedVectorIterator::operator++):
5644         (WTF::SegmentedVectorIterator::operator==):
5645         (WTF::SegmentedVectorIterator::operator!=):
5646         (WTF::SegmentedVectorIterator::operator=):
5647         (WTF::SegmentedVectorIterator::SegmentedVectorIterator):
5648         (WTF::SegmentedVector::alloc):
5649         (WTF::SegmentedVector::begin):
5650         (WTF::SegmentedVector::end):
5651
5652 2009-06-20  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
5653
5654         Bug 24986: ARM JIT port
5655         <https://bugs.webkit.org/show_bug.cgi?id=24986>
5656
5657         Reviewed by Oliver Hunt.
5658
5659         Move SegmentedVector to /wtf subdirectory
5660         and change "namespace JSC" to "namespace WTF"
5661
5662         Additional build file updates by David Kilzer.
5663
5664         * GNUmakefile.am: Updated path to SegmentedVector.h.
5665         * JavaScriptCore.order: Updated SegmentedVector namespace from
5666         JSC to WTF in mangled C++ method name.
5667         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
5668         Removed reference to bytecompiler\SegmentedVector.h.
5669         * JavaScriptCore.vcproj/WTF/WTF.vcproj: Added reference to
5670         wtf\SegmentedVector.h.
5671         * JavaScriptCore.xcodeproj/project.pbxproj: Moved
5672         SegmentedVector.h definition from bytecompiler subdirectory to
5673         wtf subdirectory.
5674         * bytecompiler/BytecodeGenerator.h: Updated #include path to
5675         SegmentedVector.h and prepended WTF:: namespace to its use.
5676         * parser/Lexer.h: Ditto.
5677         * wtf/SegmentedVector.h: Renamed from JavaScriptCore/bytecompiler/SegmentedVector.h.
5678         (WTF::SegmentedVector::SegmentedVector):
5679         (WTF::SegmentedVector::~SegmentedVector):
5680         (WTF::SegmentedVector::size):
5681         (WTF::SegmentedVector::at):
5682         (WTF::SegmentedVector::operator[]):
5683         (WTF::SegmentedVector::last):
5684         (WTF::SegmentedVector::append):
5685         (WTF::SegmentedVector::removeLast):
5686         (WTF::SegmentedVector::grow):
5687         (WTF::SegmentedVector::clear):
5688         (WTF::SegmentedVector::deleteAllSegments):
5689         (WTF::SegmentedVector::segmentExistsFor):
5690         (WTF::SegmentedVector::segmentFor):
5691         (WTF::SegmentedVector::subscriptFor):
5692         (WTF::SegmentedVector::ensureSegmentsFor):
5693         (WTF::SegmentedVector::ensureSegment):
5694
5695 2009-06-19  Gavin Barraclough  <barraclough@apple.com>
5696
5697         Reviewed by NOBODY (build fix take 2 - rename FIELD_OFFSET to something that doesn't conflict with winnt.h).
5698
5699         * jit/JIT.cpp:
5700         (JSC::JIT::privateCompile):
5701         (JSC::JIT::privateCompileCTIMachineTrampolines):
5702         (JSC::JIT::emitGetVariableObjectRegister):
5703         (JSC::JIT::emitPutVariableObjectRegister):
5704         * jit/JIT.h:
5705         * jit/JITArithmetic.cpp:
5706         (JSC::JIT::emit_op_rshift):
5707         (JSC::JIT::emitSlow_op_jnless):
5708         (JSC::JIT::emitSlow_op_jnlesseq):
5709         (JSC::JIT::compileBinaryArithOp):
5710         * jit/JITCall.cpp:
5711         (JSC::JIT::compileOpCallInitializeCallFrame):
5712         (JSC::JIT::compileOpCall):
5713         * jit/JITInlineMethods.h:
5714         (JSC::JIT::restoreArgumentReference):
5715         (JSC::JIT::checkStructure):
5716         * jit/JITOpcodes.cpp:
5717         (JSC::JIT::emit_op_instanceof):
5718         (JSC::JIT::emit_op_get_scoped_var):
5719         (JSC::JIT::emit_op_put_scoped_var):
5720         (JSC::JIT::emit_op_construct_verify):
5721         (JSC::JIT::emit_op_resolve_global):
5722         (JSC::JIT::emit_op_jeq_null):
5723         (JSC::JIT::emit_op_jneq_null):
5724         (JSC::JIT::emit_op_to_jsnumber):
5725         (JSC::JIT::emit_op_catch):
5726         (JSC::JIT::emit_op_eq_null):
5727         (JSC::JIT::emit_op_neq_null):
5728         (JSC::JIT::emit_op_convert_this):
5729         (JSC::JIT::emit_op_profile_will_call):
5730         (JSC::JIT::emit_op_profile_did_call):
5731         (JSC::JIT::emitSlow_op_get_by_val):
5732         * jit/JITPropertyAccess.cpp:
5733         (JSC::JIT::emit_op_get_by_val):
5734         (JSC::JIT::emit_op_put_by_val):
5735         (JSC::JIT::emit_op_method_check):
5736         (JSC::JIT::compileGetByIdHotPath):
5737         (JSC::JIT::emit_op_put_by_id):
5738         (JSC::JIT::compilePutDirectOffset):
5739         (JSC::JIT::compileGetDirectOffset):
5740         (JSC::JIT::privateCompilePutByIdTransition):
5741         (JSC::JIT::privateCompilePatchGetArrayLength):
5742         * jit/JITStubs.cpp:
5743         (JSC::JITThunks::JITThunks):
5744
5745 2009-06-19  Gavin Barraclough  <barraclough@apple.com>
5746
5747         Reviewed by NOBODY (Windows build fix).
5748
5749         * jit/JIT.h:
5750         * jit/JITInlineMethods.h:
5751
5752 2009-06-19  Gabor Loki  <loki@inf.u-szeged.hu>
5753
5754         Reviewed by Gavin Barraclough.
5755
5756         Reorganize ARM architecture specific macros.
5757         Use PLATFORM_ARM_ARCH(7) instead of PLATFORM(ARM_V7).
5758
5759         Bug 24986: ARM JIT port
5760         <https://bugs.webkit.org/show_bug.cgi?id=24986>
5761
5762         * assembler/ARMv7Assembler.h:
5763         * assembler/AbstractMacroAssembler.h:
5764         (JSC::AbstractMacroAssembler::Imm32::Imm32):
5765         * assembler/MacroAssembler.h:
5766         * assembler/MacroAssemblerCodeRef.h:
5767         (JSC::MacroAssemblerCodePtr::MacroAssemblerCodePtr):
5768         * jit/ExecutableAllocator.h:
5769         (JSC::ExecutableAllocator::cacheFlush):
5770         * jit/JIT.h:
5771         * jit/JITInlineMethods.h:
5772         (JSC::JIT::restoreArgumentReferenceForTrampoline):
5773         * jit/JITStubs.cpp:
5774         * jit/JITStubs.h:
5775         * wtf/Platform.h:
5776         * yarr/RegexJIT.cpp:
5777         (JSC::Yarr::RegexGenerator::generateEnter):
5778         (JSC::Yarr::RegexGenerator::generateReturn):
5779
5780 2009-06-19  Gavin Barraclough  <barraclough@apple.com>
5781
5782         Reviewed by Oliver Hunt.
5783
5784         Fix armv7 JIT build issues.
5785
5786         Unfortunate the arm compiler does not like the use of offsetof on JITStackFrame (since it now contains non POD types),
5787         and the FIELD_OFFSET macro does not appear constantish enough for it to be happy with its use in COMPILE_ASSERT macros.
5788
5789         * Replace offsetofs with FIELD_OFFSETs (safe on C++ objects).
5790         * Move COMPILE_ASSERTs defending layout of JITStackFrame structure on armv7 into JITThunks constructor.
5791
5792         * jit/JIT.cpp:
5793         * jit/JIT.h:
5794         * jit/JITInlineMethods.h:
5795         (JSC::JIT::restoreArgumentReference):
5796         * jit/JITOpcodes.cpp:
5797         (JSC::JIT::emit_op_catch):
5798         * jit/JITStubs.cpp:
5799         (JSC::JITThunks::JITThunks):
5800
5801 2009-06-19  Adam Treat  <adam.treat@torchmobile.com>
5802
5803         Blind attempt at build fix.
5804
5805         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
5806         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
5807
5808 2009-06-19  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
5809
5810         Reviewed by Oliver Hunt.
5811
5812         Inherits CallIdentifier struct from FastAllocBase because it has been
5813         instantiated by 'new' in JavaScriptCore/profiler/CallIdentifier.h:86.
5814
5815         * wtf/HashCountedSet.h:
5816
5817 2009-06-19  Adam Treat  <adam.treat@torchmobile.com>
5818
5819         Reviewed by Oliver Hunt.
5820
5821         https://bugs.webkit.org/show_bug.cgi?id=26540
5822         Modify the test shell to add a new function 'checkSyntax' that will
5823         only parse the source instead of executing it. In this way we can test
5824         pure parsing performance against some of the larger scripts in the wild.
5825
5826         * jsc.cpp:
5827         (GlobalObject::GlobalObject):
5828         (functionCheckSyntax):
5829
5830 2009-06-19  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
5831
5832         Reviewed by Darin Adler.
5833         
5834         Inherits HashCountedSet class from FastAllocBase because it has been
5835         instantiated by 'new' in JavaScriptCore/runtime/Collector.cpp:1095.
5836
5837         * wtf/HashCountedSet.h:
5838
5839 2009-06-19  Yong Li  <yong.li@torchmobile.com>
5840
5841         Reviewed by George Staikos.
5842
5843         https://bugs.webkit.org/show_bug.cgi?id=26558
5844         Declare these symbols extern for WINCE as they are provided by libce.
5845
5846         * runtime/DateConstructor.cpp:
5847         * runtime/DatePrototype.cpp:
5848         (JSC::formatLocaleDate):
5849
5850 2009-06-19  Oliver Hunt  <oliver@apple.com>
5851
5852         Reviewed by Maciej Stachowiak.
5853
5854         <rdar://problem/6988973> ScopeChain leak in interpreter builds
5855
5856         Move the Scopechain destruction code in JSFunction outside of the ENABLE(JIT)
5857         path.
5858
5859         * runtime/JSFunction.cpp:
5860         (JSC::JSFunction::~JSFunction):
5861         * wtf/Platform.h:
5862
5863 2009-06-19  Yong Li  <yong.li@torchmobile.com>
5864
5865         Reviewed by George Staikos.
5866
5867         https://bugs.webkit.org/show_bug.cgi?id=26543
5868         Windows CE uses 'GetLastError' instead of 'errno.'
5869
5870         * interpreter/RegisterFile.h:
5871         (JSC::RegisterFile::RegisterFile):
5872         (JSC::RegisterFile::grow):
5873
5874 2009-06-19  David Levin  <levin@chromium.org>
5875
5876         Reviewed by NOBODY (Windows build fix).
5877
5878         Add export for Windows corresponding to OSX export done in r44844.
5879         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
5880         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
5881
5882 2009-06-18  Oliver Hunt  <oliver@apple.com>
5883
5884         Reviewed by Gavin "Viceroy of Venezuela" Barraclough.
5885
5886         Bug 26532: Native functions do not correctly unlink from optimised callsites when they're collected
5887         <https://bugs.webkit.org/show_bug.cgi?id=26532> <rdar://problem/6625385>
5888
5889         We need to make sure that each native function instance correctly unlinks any references to it
5890         when it is collected.  Allowing this to happen required a few changes:
5891             * Every native function needs a codeblock to track the link information
5892             * To have this codeblock, every function now also needs its own functionbodynode
5893               so we no longer get to have a single shared instance.
5894             * Identifying a host function is now done by looking for CodeBlock::codeType() == NativeCode
5895
5896         * JavaScriptCore.exp:
5897         * bytecode/CodeBlock.cpp:
5898         (JSC::CodeBlock::CodeBlock):
5899            Constructor for NativeCode CodeBlock
5900         (JSC::CodeBlock::derefStructures):
5901         (JSC::CodeBlock::refStructures):
5902         (JSC::CodeBlock::reparseForExceptionInfoIfNecessary):
5903         (JSC::CodeBlock::handlerForBytecodeOffset):
5904         (JSC::CodeBlock::lineNumberForBytecodeOffset):
5905         (JSC::CodeBlock::expressionRangeForBytecodeOffset):
5906         (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset):
5907         (JSC::CodeBlock::functionRegisterForBytecodeOffset):
5908         (JSC::CodeBlock::hasGlobalResolveInstructionAtBytecodeOffset):
5909         (JSC::CodeBlock::hasGlobalResolveInfoAtBytecodeOffset):
5910         (JSC::CodeBlock::setJITCode):
5911            Add assertions to ensure we don't try and use NativeCode CodeBlocks as
5912            a normal codeblock.
5913
5914         * bytecode/CodeBlock.h:
5915         (JSC::):
5916         (JSC::CodeBlock::source):
5917         (JSC::CodeBlock::sourceOffset):
5918         (JSC::CodeBlock::evalCodeCache):
5919         (JSC::CodeBlock::createRareDataIfNecessary):
5920           More assertions.
5921
5922         * jit/JIT.cpp:
5923         (JSC::JIT::privateCompileCTIMachineTrampolines):
5924         (JSC::JIT::linkCall):
5925           Update logic to allow native function caching
5926
5927         * jit/JITStubs.cpp:
5928         * parser/Nodes.cpp:
5929         (JSC::FunctionBodyNode::createNativeThunk):
5930         (JSC::FunctionBodyNode::isHostFunction):
5931         * parser/Nodes.h:
5932         * runtime/JSFunction.cpp:
5933         (JSC::JSFunction::JSFunction):
5934         (JSC::JSFunction::~JSFunction):
5935         (JSC::JSFunction::mark):
5936         * runtime/JSGlobalData.cpp:
5937         (JSC::JSGlobalData::~JSGlobalData):
5938         * runtime/JSGlobalData.h:
5939
5940 2009-06-18  Gavin Barraclough  <barraclough@apple.com>
5941
5942         Reviewed by NOBODY (Windows build fix).
5943
5944         * wtf/DateMath.cpp:
5945         (WTF::calculateUTCOffset):
5946
5947 2009-06-18  Gavin Barraclough  <barraclough@apple.com>
5948
5949         Reviewed by Geoff Garen.
5950
5951         Timezone calculation incorrect in Venezuela.
5952
5953         https://bugs.webkit.org/show_bug.cgi?id=26531
5954         <rdar://problem/6646169> Time is incorrectly reported to JavaScript in both Safari 3 and Firefox 3
5955
5956         The problem is that we're calculating the timezone relative to 01/01/2000,
5957         but the VET timezone changed from -4 hours to -4:30 hours on 12/09/2007.
5958         According to the spec, section 15.9.1.9 states "the time since the beginning
5959         of the year", presumably meaning the *current* year.  Change the calculation
5960         to be based on whatever the current year is, rather than a canned date.
5961
5962         No performance impact.
5963
5964         * wtf/DateMath.cpp:
5965         (WTF::calculateUTCOffset):
5966
5967 2009-06-18  Gavin Barraclough  <barraclough@apple.com>
5968
5969         Rubber Stamped by Mark Rowe (originally reviewed by Sam Weinig).
5970
5971         (Reintroducing patch added in r44492, and reverted in r44796.)
5972
5973         Change the implementation of op_throw so the stub function always modifies its
5974         return address - if it doesn't find a 'catch' it will switch to a trampoline
5975         to force a return from JIT execution.  This saves memory, by avoiding the need
5976         for a unique return for every op_throw.
5977
5978         * jit/JITOpcodes.cpp:
5979         (JSC::JIT::emit_op_throw):
5980             JITStubs::cti_op_throw now always changes its return address,
5981             remove return code generated after the stub call (this is now
5982             handled by ctiOpThrowNotCaught).
5983         * jit/JITStubs.cpp:
5984         (JSC::):
5985             Add ctiOpThrowNotCaught definitions.
5986         (JSC::JITStubs::DEFINE_STUB_FUNCTION):
5987             Change cti_op_throw to always change its return address.
5988         * jit/JITStubs.h:
5989             Add ctiOpThrowNotCaught declaration.
5990
5991 2009-06-18  Kevin McCullough  <kmccullough@apple.com>
5992
5993         Reviewed by Oliver Hunt.
5994
5995         <rdar://problem/6940880> REGRESSION: Breakpoints don't break in 64-bit
5996
5997         - Exposed functions now needed by WebCore.
5998
5999         * JavaScriptCore.exp:
6000
6001 2009-06-17  Darin Adler  <darin@apple.com>
6002
6003         Reviewed by Oliver Hunt.
6004
6005         Bug 26429: Make JSON.stringify non-recursive so it can handle objects
6006         of arbitrary complexity
6007         https://bugs.webkit.org/show_bug.cgi?id=26429
6008
6009         For marking I decided not to use gcProtect, because this is inside the engine
6010         so it's easy enough to just do marking. And that darned gcProtect does locking!
6011         Oliver tried to convince me to used MarkedArgumentBuffer, but the constructor
6012         for that class says "FIXME: Remove all clients of this API, then remove this API."
6013
6014         * runtime/Collector.cpp:
6015         (JSC::Heap::collect): Add a call to JSONObject::markStringifiers.
6016
6017         * runtime/CommonIdentifiers.cpp:
6018         (JSC::CommonIdentifiers::CommonIdentifiers): Added emptyIdentifier.
6019         * runtime/CommonIdentifiers.h: Ditto.
6020
6021         * runtime/JSGlobalData.cpp:
6022         (JSC::JSGlobalData::JSGlobalData): Initialize firstStringifierToMark to 0.
6023         * runtime/JSGlobalData.h: Added firstStringifierToMark.
6024
6025         * runtime/JSONObject.cpp: Cut down the includes to the needed ones only.
6026         (JSC::unwrapNumberOrString): Added. Helper for unwrapping number and string
6027         objects to get their number and string values.
6028         (JSC::ReplacerPropertyName::ReplacerPropertyName): Added. The class is used
6029         to wrap an identifier or integer so we don't have to do any work unless we
6030         actually call a replacer.
6031         (JSC::ReplacerPropertyName::value): Added.
6032         (JSC::gap): Added. Helper function for the Stringifier constructor.
6033         (JSC::PropertyNameForFunctionCall::PropertyNameForFunctionCall): Added.
6034         The class is used to wrap an identifier or integer so we don't have to
6035         allocate a number or string until we actually call toJSON or a replacer.
6036         (JSC::PropertyNameForFunctionCall::asJSValue): Added.
6037         (JSC::Stringifier::Stringifier): Updated and moved out of the class
6038         definition. Added code to hook this into a singly linked list for marking.
6039         (JSC::Stringifier::~Stringifier): Remove from the singly linked list.
6040         (JSC::Stringifier::mark): Mark all the objects in the holder stacks.
6041         (JSC::Stringifier::stringify): Updated.
6042         (JSC::Stringifier::appendQuotedString): Tweaked and streamlined a bit.
6043         (JSC::Stringifier::toJSON): Renamed from toJSONValue.
6044         (JSC::Stringifier::appendStringifiedValue): Renamed from stringify.
6045         Added code to use the m_holderStack to do non-recursive stringify of
6046         objects and arrays. This code also uses the timeout checker since in
6047         pathological cases it could be slow even without calling into the
6048         JavaScript virtual machine.
6049         (JSC::Stringifier::willIndent): Added.
6050         (JSC::Stringifier::indent): Added.
6051         (JSC::Stringifier::unindent): Added.
6052         (JSC::Stringifier::startNewLine): Added.
6053         (JSC::Stringifier::Holder::Holder): Added.
6054         (JSC::Stringifier::Holder::appendNextProperty): Added. This is the
6055         function that handles the format of arrays and objects.
6056         (JSC::JSONObject::getOwnPropertySlot): Moved this down to the bottom
6057         of the file so the JSONObject class is not interleaved with the
6058         Stringifier class.
6059         (JSC::JSONObject::markStringifiers): Added. Calls mark.
6060         (JSC::JSONProtoFuncStringify): Streamlined the code here. The code
6061         to compute the gap string is now a separate function.
6062
6063         * runtime/JSONObject.h: Made everything private. Added markStringifiers.
6064
6065 2009-06-17  Oliver Hunt  <oliver@apple.com>
6066
6067         Reviewed by Gavin Barraclough.
6068
6069         <rdar://problem/6974140> REGRESSION(r43849): Crash in cti_op_call_NotJSFunction when getting directions on maps.google.com
6070
6071         Roll out r43849 as it appears that we cannot rely on the address of
6072         an objects property storage being constant even if the structure is
6073         unchanged.
6074
6075         * jit/JIT.h:
6076         * jit/JITPropertyAccess.cpp:
6077         (JSC::JIT::compileGetDirectOffset):
6078         (JSC::JIT::privateCompileGetByIdProto):
6079         (JSC::JIT::privateCompileGetByIdProtoList):
6080         (JSC::JIT::privateCompileGetByIdChainList):
6081         (JSC::JIT::privateCompileGetByIdChain):
6082
6083 2009-06-17  Gavin Barraclough  <barraclough@apple.com>
6084
6085         Rubber Stamped by Mark Rowe.
6086
6087         Fully revert r44492 & r44748 while we fix a bug they cause on internal builds <rdar://problem/6955963>.
6088
6089         * jit/JITOpcodes.cpp:
6090         (JSC::JIT::emit_op_throw):
6091         * jit/JITStubs.cpp:
6092         (JSC::):
6093         (JSC::JITStubs::DEFINE_STUB_FUNCTION):
6094         * jit/JITStubs.h:
6095
6096 2009-06-17  Gavin Barraclough  <barraclough@apple.com>
6097
6098         Reviewed by Mark Rowe.
6099
6100         <rdar://problem/6947426> sunspider math-cordic.js exhibits different intermediate results running 32-bit vs. 64-bit
6101
6102         On 64-bit, NaN-encoded values must be detagged before they can be used in rshift.
6103
6104         No performance impact.
6105
6106         * jit/JITArithmetic.cpp:
6107         (JSC::JIT::emit_op_rshift):
6108
6109 2009-06-17  Adam Treat  <adam.treat@torchmobile.com>
6110
6111         Reviewed by George Staikos.
6112
6113         https://bugs.webkit.org/show_bug.cgi?id=23155
6114         Move WIN_CE -> WINCE as previously discussed with Qt WINCE folks.
6115
6116         * jsc.cpp:
6117         (main):
6118
6119 2009-06-17  George Staikos  <george.staikos@torchmobile.com>
6120
6121         Reviewed by Adam Treat.
6122
6123         https://bugs.webkit.org/show_bug.cgi?id=23155
6124         Move WIN_CE -> WINCE as previously discussed with Qt WINCE folks.
6125
6126         * config.h:
6127         * jsc.cpp:
6128         * wtf/Assertions.cpp:
6129         * wtf/Assertions.h:
6130         * wtf/CurrentTime.cpp:
6131         (WTF::lowResUTCTime):
6132         * wtf/DateMath.cpp:
6133         (WTF::getLocalTime):
6134         * wtf/MathExtras.h:
6135         * wtf/Platform.h:
6136         * wtf/StringExtras.h:
6137         * wtf/Threading.h:
6138         * wtf/win/MainThreadWin.cpp:
6139
6140 2009-06-17  Gavin Barraclough  <barraclough@apple.com>
6141
6142         Reviewed by Oliver Hunt.
6143
6144         <rdar://problem/6974175> ASSERT in JITStubs.cpp at appsaccess.apple.com
6145
6146         Remove PropertySlot::putValue - PropertySlots should only be used for getting,
6147         not putting.  Rename JSGlobalObject::getOwnPropertySlot to hasOwnPropertyForWrite,
6148         which is what it really was being used to ask, and remove some other getOwnPropertySlot
6149         & getOwnPropertySlotForWrite methods, which were unused and likely to lead to confusion.
6150
6151         * runtime/JSGlobalObject.h:
6152         (JSC::JSGlobalObject::hasOwnPropertyForWrite):
6153         * runtime/JSObject.h:
6154         * runtime/JSStaticScopeObject.cpp:
6155         * runtime/JSStaticScopeObject.h:
6156         * runtime/PropertySlot.h:
6157
6158 2009-06-16  Gavin Barraclough  <barraclough@apple.com>
6159
6160         Reviewed by Oliver hunt.
6161
6162         Temporarily partially disable r44492, since this is causing some problems on internal builds.
6163
6164         * jit/JITOpcodes.cpp:
6165         (JSC::JIT::emit_op_throw):
6166         * jit/JITStubs.cpp:
6167         (JSC::JITStubs::DEFINE_STUB_FUNCTION):
6168
6169 2009-06-16  Sam Weinig  <sam@webkit.org>
6170
6171         Fix windows build.
6172
6173         * jit/JIT.cpp:
6174         (JSC::JIT::JIT):
6175
6176 2009-06-16  Sam Weinig  <sam@webkit.org>
6177
6178         Reviewed by Oliver Hunt.
6179
6180         Initialize m_bytecodeIndex to -1 in JIT, and correctly initialize
6181         it for each type of stub using the return address to find the correct
6182         offset.
6183
6184         * jit/JIT.cpp:
6185         (JSC::JIT::JIT):
6186         * jit/JIT.h:
6187         (JSC::JIT::compileGetByIdProto):
6188         (JSC::JIT::compileGetByIdSelfList):
6189         (JSC::JIT::compileGetByIdProtoList):
6190         (JSC::JIT::compileGetByIdChainList):
6191         (JSC::JIT::compileGetByIdChain):
6192         (JSC::JIT::compilePutByIdTransition):
6193         (JSC::JIT::compileCTIMachineTrampolines):
6194         (JSC::JIT::compilePatchGetArrayLength):
6195         * jit/JITStubCall.h:
6196         (JSC::JITStubCall::call):
6197
6198 == Rolled over to ChangeLog-2009-06-16 ==