b6a0ba7090950f49f4978f136cb394f96a7eeb83
[WebKit-https.git] / JavaScriptCore / ChangeLog
1 2010-05-15  Chao-ying Fu  <fu@mips.com>
2
3         Reviewed by Oliver Hunt.
4
5         Update MIPS JIT for unsigned right shift, Math.sqrt, load16
6         https://bugs.webkit.org/show_bug.cgi?id=38412
7
8         Fixed MIPS build failure.
9
10         * assembler/MIPSAssembler.h:
11         (JSC::MIPSAssembler::srl):
12         (JSC::MIPSAssembler::srlv):
13         (JSC::MIPSAssembler::sqrtd):
14         * assembler/MacroAssemblerMIPS.h:
15         (JSC::MacroAssemblerMIPS::urshift32):
16         (JSC::MacroAssemblerMIPS::sqrtDouble):
17         (JSC::MacroAssemblerMIPS::load16):
18         (JSC::MacroAssemblerMIPS::supportsFloatingPointSqrt):
19         * jit/JSInterfaceJIT.h:
20
21 2010-05-15  Ilya Tikhonovsky  <loislo@chromium.org>
22
23         Reviewed by Geoffrey Garen.
24
25         WebInspector: JSC Should provide heap size info for Timeline panel.
26         https://bugs.webkit.org/show_bug.cgi?id=38420
27
28         * JavaScriptCore.exp:
29         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
30         * runtime/Collector.cpp:
31         (JSC::Heap::size):
32         * runtime/Collector.h:
33
34 2010-05-15  Dave Tapuska  <dtapuska@rim.com>
35
36         Reviewed by Darin Adler.
37
38         Add a new define for we need strict arena alignment. ARMv5 with
39         double word instructions set this value.
40
41         * wtf/Platform.h:
42
43 2010-05-14  Stephanie Lewis  <slewis@apple.com>
44
45         Rubber-stamped by Mark Rowe.
46
47         Update order files.
48
49         * JavaScriptCore.order:
50
51 2010-05-14  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
52
53         Reviewed by Kenneth Rohde Christiansen.
54
55         Implementation of QtScript API that provide method to convert a value to an object.
56
57         [Qt] QtScript is missing toObject API
58         https://bugs.webkit.org/show_bug.cgi?id=36594
59
60         * qt/api/qscriptengine.cpp:
61         (QScriptEngine::toObject):
62         * qt/api/qscriptengine.h:
63         * qt/api/qscriptvalue.cpp:
64         (QScriptValue::toObject):
65         * qt/api/qscriptvalue.h:
66         * qt/api/qscriptvalue_p.h:
67         (QScriptValuePrivate::toObject):
68         * qt/tests/qscriptengine/tst_qscriptengine.cpp:
69         (tst_QScriptEngine::toObject):
70         (tst_QScriptEngine::toObjectTwoEngines):
71         * qt/tests/qscriptvalue/tst_qscriptvalue.cpp:
72         (tst_QScriptValue::toObjectSimple):
73         * qt/tests/qscriptvalue/tst_qscriptvalue.h:
74
75 2010-05-14  Chao-ying Fu  <fu@mips.com>
76
77         Reviewed by Oliver Hunt.
78
79         String Indexing Failure on JSVALUE32 targets
80         https://bugs.webkit.org/show_bug.cgi?id=39034
81
82         Remove zero-extend/shift-right code on regT1, because we already have
83         it in emit_op_get_by_val().
84
85         * jit/JITPropertyAccess.cpp:
86         (JSC::JIT::stringGetByValStubGenerator):
87
88 2010-05-10  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
89
90         Reviewed by Alexey Proskuryakov.
91
92         Fix a VS2010 assert in std::copy
93         https://bugs.webkit.org/show_bug.cgi?id=38630
94
95         The assert complains that the output iterator is null.
96
97         * wtf/Vector.h:
98         (WTF::::operator):
99
100 2010-05-13  Maciej Stachowiak  <mjs@apple.com>
101
102         No review, attempted build fix.
103
104         Try to fix Tiger build with some gratuitous initialization of
105         seemingly uninitialized variables.
106
107         * wtf/text/StringImpl.h:
108         (WebCore::StringImpl::tryCreateUninitialized):
109
110 2010-05-13  Maciej Stachowiak  <mjs@apple.com>
111
112         Reviewed by Mark Rowe.
113
114         Various JavaScript string optimizations
115         https://bugs.webkit.org/show_bug.cgi?id=39051
116
117         Approximately 1% SunSpider speedup.
118         
119         * runtime/ArrayPrototype.cpp:
120         (JSC::arrayProtoFuncJoin): Remove branches from the hot code path
121         by moving the first pass outside the loop, and duplicating the hot loop
122         to extract the loop-invariant branch.
123         * runtime/RegExp.cpp:
124         (JSC::RegExp::match): resize ovector to 0 instead of clearing to avoid
125         thrash in case of large matches.
126         * runtime/RegExpConstructor.h:
127         (JSC::RegExpConstructor::performMatch): Mark ALWAYS_INLINE to make the
128         compiler respect our authority.
129         * runtime/StringPrototype.cpp:
130         (JSC::jsSpliceSubstringsWithSeparators): Inline.
131         (JSC::stringProtoFuncSubstring): Rewrite boundary condition checks to
132         reduce the number of floating point comparisons and branches.
133
134 2010-05-12  Gavin Barraclough  <barraclough@apple.com>
135
136         Reviewed by Oliver Hunt.
137
138         https://bugs.webkit.org/show_bug.cgi?id=39039
139         Provide support for separate bytecode/JIT code translations for call/construct usage
140         This will allow us to produce code generated specifically for use as a constructor, not for general function use.
141
142         * bytecode/CodeBlock.cpp:
143         (JSC::CodeBlock::CodeBlock):
144         (JSC::CodeBlock::unlinkCallers):
145         * bytecode/CodeBlock.h:
146         (JSC::CodeBlock::getBytecodeIndex):
147         (JSC::CodeBlock::getJITCode):
148         (JSC::CodeBlock::executablePool):
149         (JSC::GlobalCodeBlock::GlobalCodeBlock):
150         (JSC::FunctionCodeBlock::FunctionCodeBlock):
151         * interpreter/Interpreter.cpp:
152         (JSC::Interpreter::executeCall):
153         (JSC::Interpreter::executeConstruct):
154         (JSC::Interpreter::prepareForRepeatCall):
155         (JSC::Interpreter::execute):
156         (JSC::Interpreter::privateExecute):
157         * interpreter/Interpreter.h:
158         * jit/JIT.cpp:
159         (JSC::JIT::unlinkCallOrConstruct):
160         (JSC::JIT::linkConstruct):
161         * jit/JIT.h:
162         * jit/JITCall.cpp:
163         (JSC::JIT::compileOpCall):
164         (JSC::JIT::compileOpCallSlowCase):
165         * jit/JITOpcodes.cpp:
166         (JSC::JIT::privateCompileCTIMachineTrampolines):
167         * jit/JITOpcodes32_64.cpp:
168         (JSC::JIT::privateCompileCTIMachineTrampolines):
169         * jit/JITPropertyAccess.cpp:
170         (JSC::JIT::emitSlow_op_get_by_val):
171         * jit/JITPropertyAccess32_64.cpp:
172         (JSC::JIT::emitSlow_op_get_by_val):
173         * jit/JITStubs.cpp:
174         (JSC::DEFINE_STUB_FUNCTION):
175         * jit/JITStubs.h:
176         (JSC::JITThunks::ctiVirtualConstructLink):
177         (JSC::JITThunks::ctiVirtualConstruct):
178         (JSC::):
179         * jit/SpecializedThunkJIT.h:
180         (JSC::SpecializedThunkJIT::finalize):
181         * runtime/Arguments.h:
182         (JSC::JSActivation::copyRegisters):
183         * runtime/ArrayPrototype.cpp:
184         (JSC::isNumericCompareFunction):
185         * runtime/Executable.cpp:
186         (JSC::FunctionExecutable::~FunctionExecutable):
187         (JSC::FunctionExecutable::compileForCall):
188         (JSC::FunctionExecutable::compileForConstruct):
189         (JSC::EvalExecutable::generateJITCode):
190         (JSC::ProgramExecutable::generateJITCode):
191         (JSC::FunctionExecutable::generateJITCodeForCall):
192         (JSC::FunctionExecutable::generateJITCodeForConstruct):
193         (JSC::FunctionExecutable::markAggregate):
194         (JSC::FunctionExecutable::reparseExceptionInfo):
195         (JSC::EvalExecutable::reparseExceptionInfo):
196         (JSC::FunctionExecutable::recompile):
197         * runtime/Executable.h:
198         (JSC::ExecutableBase::ExecutableBase):
199         (JSC::ExecutableBase::isHostFunction):
200         (JSC::ExecutableBase::generatedJITCodeForCall):
201         (JSC::ExecutableBase::generatedJITCodeForConstruct):
202         (JSC::NativeExecutable::NativeExecutable):
203         (JSC::EvalExecutable::jitCode):
204         (JSC::ProgramExecutable::jitCode):
205         (JSC::FunctionExecutable::bytecodeForCall):
206         (JSC::FunctionExecutable::isGeneratedForCall):
207         (JSC::FunctionExecutable::generatedBytecodeForCall):
208         (JSC::FunctionExecutable::bytecodeForConstruct):
209         (JSC::FunctionExecutable::isGeneratedForConstruct):
210         (JSC::FunctionExecutable::generatedBytecodeForConstruct):
211         (JSC::FunctionExecutable::symbolTable):
212         (JSC::FunctionExecutable::FunctionExecutable):
213         (JSC::FunctionExecutable::jitCodeForCall):
214         (JSC::FunctionExecutable::jitCodeForConstruct):
215         * runtime/JSActivation.h:
216         (JSC::JSActivation::JSActivationData::JSActivationData):
217         * runtime/JSFunction.cpp:
218         (JSC::JSFunction::~JSFunction):
219         (JSC::JSFunction::call):
220         (JSC::JSFunction::construct):
221         * runtime/JSGlobalData.cpp:
222         (JSC::JSGlobalData::numericCompareFunction):
223
224 2010-05-12  Oliver Hunt  <oliver@apple.com>
225
226         build fix
227
228         <rdar://problem/7977960> REGRESSION (r59282): Tiger PPC build broken
229
230         * runtime/UString.h:
231         (JSC::tryMakeString):
232
233 2010-05-12  Oliver Hunt  <oliver@apple.com>
234
235         Reviewed by Gavin Barraclough.
236
237         <rdar://7969718> Incorrect 32-bit codegen for op_jnlesseq
238         https://bugs.webkit.org/show_bug.cgi?id=39038
239
240         Correct the use of incorrect comparison operators.
241
242         * jit/JITArithmetic32_64.cpp:
243         (JSC::JIT::emit_op_jlesseq):
244         (JSC::JIT::emitBinaryDoubleOp):
245
246 2010-05-12  Caio Marcelo de Oliveira Filho  <caio.oliveira@openbossa.org>
247
248         Reviewed by Eric Seidel.
249
250         JavaScriptCore: fix build when some optimizations are disabled
251         https://bugs.webkit.org/show_bug.cgi?id=38800
252
253         Remove outdated UNUSED_PARAMs when using JIT but with
254         ENABLE_JIT_OPTIMIZE_CALL and ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS
255         disabled.
256
257         * jit/JITOpcodes.cpp:
258         * jit/JITOpcodes32_64.cpp:
259
260 2010-05-12  Oliver Hunt  <oliver@apple.com>
261
262         Reviewed by Gavin Barraclough.
263
264         Work around GCC stupidity by either explicitly inlining or by
265         using ALWAYS_INLINE
266
267         * runtime/StringPrototype.cpp:
268         (JSC::stringProtoFuncReplace):
269         * runtime/UString.h:
270         (JSC::UString::~UString):
271         * wtf/RefPtr.h:
272         (WTF::RefPtr::RefPtr):
273         (WTF::RefPtr::~RefPtr):
274         * wtf/text/StringImpl.h:
275         (WebCore::StringImpl::create):
276         (WebCore::StringImpl::tryCreateUninitialized):
277
278 2010-05-12  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
279
280         Reviewed by Kenneth Rohde Christiansen.
281
282         [Qt] Detect debug mode consistently
283         https://bugs.webkit.org/show_bug.cgi?id=38863
284
285         * JavaScriptCore.pri:
286         * JavaScriptCore.pro:
287         * jsc.pro:
288         * qt/api/QtScript.pro:
289
290 2010-05-12  Peter Varga  <pvarga@inf.u-szeged.hu>
291
292         Reviewed by Gavin Barraclough.
293
294         Remove a direct jump in generatePatternCharacterGreedy() and
295         generatePatternCharacterClassGreedy() functions if quantityCount of the term
296         is unlimited.
297         https://bugs.webkit.org/show_bug.cgi?id=38898
298
299         * yarr/RegexJIT.cpp:
300         (JSC::Yarr::RegexGenerator::generatePatternCharacterGreedy):
301         (JSC::Yarr::RegexGenerator::generateCharacterClassGreedy):
302
303 2010-05-11  Geoffrey Garen  <ggaren@apple.com>
304
305         Reviewed by Gavin Barraclough.
306
307         Slight simplification to the calling convention: read RegisterFile::end()
308         from an absolute address, instead of from a pointer to the RegisterFile
309         on the stack.
310         
311         SunSpider reports no change.
312         
313         This should free us to remove the RegisterFile argument from the stack.
314
315         * jit/JIT.cpp:
316         (JSC::JIT::privateCompile):
317
318 2010-05-11  Brian Weinstein  <bweinstein@apple.com>
319
320         Possible Gtk build fix - use ALWAYS_INLINE on functions that were inlined.
321
322         * wtf/text/AtomicString.h:
323         (WebCore::AtomicString::add): Use ALWAYS_INLINE.
324         * wtf/text/WTFString.h:
325         (WebCore::String::length): Ditto.
326         (WebCore::String::isEmpty): Ditto.
327
328 2010-05-11  Anders Carlsson  <andersca@apple.com>
329
330         Reviewed by Sam Weinig.
331
332         Add a compile time assert that sizeof(String) == sizeof(AtomicString).
333
334         * wtf/text/AtomicString.cpp:
335
336 2010-05-11  Anders Carlsson  <andersca@apple.com>
337
338         Reviewed by Mark Rowe.
339
340         https://bugs.webkit.org/show_bug.cgi?id=38961
341         Move some member variables around to reduce class sizes.
342         
343         Make AtomicString no longer inherit from FastAllocBase.
344
345         Since AtomicString's first (and only) member variable, a RefPtr, also inherits from FastAllocBase this
346         was causing the size of AtomicString to contain sizeof(void*) bytes of padding.
347
348         * wtf/text/AtomicString.h:
349
350 2010-05-11  Brian Weinstein  <bweinstein@apple.com>
351
352         Reviewed by Maciej Stachowiak.
353         Patch by Gavin Barraclough.
354         
355         Rest of REGRESSION (r57900-57919): 3% PLT Regression from moving strings into WTF.
356         https://bugs.webkit.org/show_bug.cgi?id=38930
357         <rdar://problem/7937188>
358         
359         Inline string functions that are commonly used in WTFString, CString, and AtomicString.
360
361         * JavaScriptCore.exp: Remove exports of inline functions.
362         * wtf/text/AtomicString.cpp:
363         (WebCore::AtomicString::addSlowCase): Rename add to addSlowCase, and inline the fast path
364             of add.
365         * wtf/text/AtomicString.h:
366         (WebCore::AtomicString::add): Inline the fast path of add.
367         * wtf/text/CString.cpp: Inline implementation of data and length in the header.
368         * wtf/text/CString.h:
369         (WTF::CString::data): Inline implementation of data.
370         (WTF::CString::length): Inline implementation of length.
371         * wtf/text/WTFString.cpp: Remove implementations of functions to be inlined.
372         * wtf/text/WTFString.h:
373         (WebCore::String::String): Inline implementation.
374         (WebCore::String::length): Ditto.
375         (WebCore::String::characters): Ditto.
376         (WebCore::String::operator[]): Ditto.
377         (WebCore::String::isEmpty): Ditto.
378
379 2010-05-11  Brian Weinstein  <bweinstein@apple.com>
380
381         Reviewed by Steve Falkenburg and Jon Honeycutt.
382         Patch by Gavin Barraclough.
383         
384         REGRESSION (r57900-57919): 3% PLT Regression from moving strings into WTF.
385         https://bugs.webkit.org/show_bug.cgi?id=38930
386         <rdar://problem/7937188>
387         
388         When the String classes were moved from WebCore to WTF, it meant that on Windows, all operations
389         on Strings in WebCore had to cross a DLL boundary (from WebKit.dll to JavaScript.dll).
390         
391         We fix this by refactoring some of the WTF string code, so the code in AtomicString, StringImpl, and
392         WTFString can be built by both WebCore and WTF, and we don't need to talk across a DLL to do operations
393         on Strings.
394
395         * GNUmakefile.am: Add new file to build system.
396         * JavaScriptCore.gypi: Ditto.
397         * JavaScriptCore.pro: Ditto.
398         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Remove string exports, because these are now
399             handled in WebCore.
400         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Remove the post-build step that was added
401             here (the post build step is in JavaScriptCoreCommon.vsprops).
402         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: Copy the three cpp files that need to be compiled
403             by WebCore into the WebKitOutputDir directory.
404         * JavaScriptCore.vcproj/WTF/WTF.vcproj: Add the StringStatics file.
405         * JavaScriptCore.vcproj/jsc/jsc.vcproj: Add the three WTF string cpp files to this project.
406         * JavaScriptCore.vcproj/jsc/jscCommon.vsprops: Remove the need to link against WTF.lib (since jsc links against JavaScriptCore).
407         * JavaScriptCore.xcodeproj/project.pbxproj: Add the StringStatics file.
408         * wtf/text/AtomicString.cpp: Moved code to StringStatics.
409         * wtf/text/StringImpl.cpp: Ditto.
410         * wtf/text/StringStatics.cpp: Added. Move functions in WTF Strings that define static variables to here, so 
411             the rest of the files can be compiled in WebCore.
412         (WebCore::StringImpl::empty): Moved from StringImpl.cpp to here.
413         (WebCore::AtomicString::init): Moved from AtomicString.cpp to here.
414
415 2010-05-11  Alice Liu  <alice.liu@apple.com>
416
417         Rubber-stamped by Gavin Barraclough.
418
419         Fix build error when enabling debugging block in WebKit win painting code
420
421         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
422
423 2010-05-11  Mark Rowe  <mrowe@apple.com>
424
425         Fix the world.
426
427         In r59162 a change was made to WebCore's FeatureDefines.xcconfig that enabled FILE_READER and FILE_WRITER.
428         The author and reviewer of that patch ignored the carefully-worded warning at the top of that file asking
429         that changes to the file be kept in sync across JavaScriptCore, WebCore and WebKit, as well as being kept
430         in sync with build-webkit.  This led to WebCore and WebKit having different views of Document's vtable
431         and results in crashes in Safari shortly after launch when virtual function calls resulted in the wrong
432         function in WebCore being called.
433
434         We fix this by bringing the FeatureDefines.xcconfig files in to sync.  Based on the ChangeLog message and
435         other changes in r59162 it appears that enabling FILE_WRITER was unintentional so that particular change
436         has been reverted.
437
438         * Configurations/FeatureDefines.xcconfig:
439
440 2010-05-11  Sheriff Bot  <webkit.review.bot@gmail.com>
441
442         Unreviewed, rolling out r59171.
443         http://trac.webkit.org/changeset/59171
444         https://bugs.webkit.org/show_bug.cgi?id=38933
445
446         "Broke the world" (Requested by bweinstein on #webkit).
447
448         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
449         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
450         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
451         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
452         * JavaScriptCore.vcproj/jsc/jsc.vcproj:
453         * JavaScriptCore.vcproj/jsc/jscCommon.vsprops:
454         * JavaScriptCore.xcodeproj/project.pbxproj:
455         * wtf/text/AtomicString.cpp:
456         (WebCore::AtomicString::init):
457         * wtf/text/StringImpl.cpp:
458         (WebCore::StringImpl::empty):
459         * wtf/text/StringStatics.cpp: Removed.
460
461 2010-05-11  Brian Weinstein  <bweinstein@apple.com>
462
463         Reviewed by Steve Falkenburg.
464         Patch by Gavin Barraclough.
465         
466         REGRESSION (r57900-57919): 3% PLT Regression from moving strings into WTF.
467         https://bugs.webkit.org/show_bug.cgi?id=38930
468         <rdar://problem/7937188>
469         
470         When the String classes were moved from WebCore to WTF, it meant that on Windows, all operations
471         on Strings in WebCore had to cross a DLL boundary (from WebKit.dll to JavaScript.dll).
472         
473         We fix this by refactoring some of the WTF string code, so the code in AtomicString, StringImpl, and
474         WTFString can be built by both WebCore and WTF, and we don't need to talk across a DLL to do operations
475         on Strings.
476
477         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Remove string exports, because these are now
478             handled in WebCore.
479         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Remove the post-build step that was added
480             here (the post build step is in JavaScriptCoreCommon.vsprops).
481         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: Copy the three cpp files that need to be compiled
482             by WebCore into the WebKitOutputDir directory.
483         * JavaScriptCore.vcproj/WTF/WTF.vcproj: Add the StringStatics file.
484         * JavaScriptCore.vcproj/jsc/jsc.vcproj: Add the three WTF string cpp files to this project.
485         * JavaScriptCore.vcproj/jsc/jscCommon.vsprops: Remove the need to link against WTF.lib (since jsc links against JavaScriptCore).
486         * JavaScriptCore.xcodeproj/project.pbxproj: Add the StringStatics file.
487         * wtf/text/AtomicString.cpp: Moved code to StringStatics.
488         * wtf/text/StringImpl.cpp: Ditto.
489         * wtf/text/StringStatics.cpp: Added. Move functions in WTF Strings that define static variables to here, so 
490             the rest of the files can be compiled in WebCore.
491         (WebCore::StringImpl::empty): Moved from StringImpl.cpp to here.
492         (WebCore::AtomicString::init): Moved from AtomicString.cpp to here.
493
494 2010-05-11  Geoffrey Garen  <ggaren@apple.com>
495
496         Fixed test failures seen on SnowLeopard buildbot.
497
498         * runtime/JSString.cpp:
499         (JSC::JSString::replaceCharacter): Don't use size_t and wtf::notFound.
500         Instead, use the individual types and notFound values of the string APIs
501         we're using, since they're not necessarily the same in 64bit.
502
503 2010-05-11  Geoffrey Garen  <ggaren@apple.com>
504
505         Reviewed by Oliver Hunt and Darin Adler.
506
507         Start using ropes in String.prototype.replace.
508         
509         1%-1.5% speedup on SunSpider.
510
511         * runtime/JSString.cpp:
512         (JSC::JSString::resolveRope): Updated for RopeImpl refactoring.
513
514         (JSC::JSString::replaceCharacter): Added a replaceCharacter function, which creates
515         a rope for the resulting replacement.
516
517         * runtime/JSString.h: A few changes here:
518         (JSC::):
519         (JSC::RopeBuilder::RopeIterator::RopeIterator):
520         (JSC::RopeBuilder::RopeIterator::operator++):
521         (JSC::RopeBuilder::RopeIterator::operator*):
522         (JSC::RopeBuilder::RopeIterator::operator!=):
523         (JSC::RopeBuilder::RopeIterator::WorkItem::WorkItem):
524         (JSC::RopeBuilder::RopeIterator::WorkItem::operator!=):
525         (JSC::RopeBuilder::RopeIterator::skipRopes): Created a RopeIterator abstraction.
526         We use this to do a substring find without having to resolve the rope.
527         (We could use this iterator when resolving ropes, too, but resolving
528         ropes backwards is usually more efficient.)
529
530         (JSC::RopeBuilder::JSString): Added constructors for 2 & 3 UStrings.
531
532         (JSC::RopeBuilder::appendValueInConstructAndIncrementLength):
533         (JSC::RopeBuilder::size): Updated for RopeImpl refactoring.
534
535         * runtime/Operations.h: Updated for RopeImpl refactoring.
536         (JSC::jsString): Added jsString functions for 2 & 3 UStrings.
537
538         * runtime/RopeImpl.cpp:
539         (JSC::RopeImpl::derefFibersNonRecursive):
540         * runtime/RopeImpl.h:
541         (JSC::RopeImpl::initializeFiber):
542         (JSC::RopeImpl::size):
543         (JSC::RopeImpl::fibers):
544         (JSC::RopeImpl::deref):
545         (JSC::RopeImpl::RopeImpl): A little refactoring to make this patch easier:
546         Moved statics to the top of the class; put multi-statement functions on
547         multiple lines; renamed "fiberCount" to "size" to match other collections;
548         changed the "fibers" accessor to return the fibers buffer, instead of an
549         item in the buffer, to make iteration easier.
550
551         * runtime/StringPrototype.cpp:
552         (JSC::stringProtoFuncReplace): Don't resolve a rope unless we need to. Do
553         use our new replaceCharacter function if possible. Do use a rope to
554         represent splicing three strings together.
555
556 2010-05-10  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
557
558         Reviewed by Darin Adler.
559
560         [Qt] Disable JIT support for mingw-w64
561         https://bugs.webkit.org/show_bug.cgi?id=38747
562
563         Disale JIT for mingw-w64 as it is reportedly
564         unstable.
565
566         Thanks for Vanboxem Rruben for the investigation.
567
568         * wtf/Platform.h:
569
570 2010-05-09  Fumitoshi Ukai  <ukai@chromium.org>
571
572         Reviewed by Eric Seidel.
573
574         JavaScriptCore/wtf/MD5.h: checksum should take a reference to output.
575         https://bugs.webkit.org/show_bug.cgi?id=38723
576
577         * JavaScriptCore.exp:
578         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
579         * wtf/MD5.cpp:
580         (WTF::expectMD5):
581           Fix for checksum change.
582         (WTF::MD5::checksum):
583           Take a reference to output, instead of returning the result by value, to reduce coping for performance.
584         * wtf/MD5.h:
585
586 2010-05-09  Oliver Hunt  <oliver@apple.com>
587
588         Build fix.
589
590         Fix accidental repeat addition of emit_op_new_regexp
591
592         * jit/JITOpcodes.cpp:
593
594 2010-05-09  Oliver Hunt  <oliver@apple.com>
595
596         Reviewed by Gavin Barraclough.
597
598         REGRESSION(r57955): RegExp literals should not actually be cached, so r57955 should be rolled out.
599         https://bugs.webkit.org/show_bug.cgi?id=38828
600         <rdar://problem/7961634>
601
602         Rollout r57955
603
604         * bytecode/CodeBlock.cpp:
605         (JSC::regexpToSourceString):
606         (JSC::regexpName):
607         (JSC::CodeBlock::dump):
608         (JSC::CodeBlock::shrinkToFit):
609         * bytecode/CodeBlock.h:
610         (JSC::CodeBlock::addRegExp):
611         (JSC::CodeBlock::regexp):
612         * bytecode/Opcode.h:
613         * bytecompiler/BytecodeGenerator.cpp:
614         (JSC::BytecodeGenerator::addRegExp):
615         (JSC::BytecodeGenerator::emitNewRegExp):
616         * bytecompiler/BytecodeGenerator.h:
617         * bytecompiler/NodesCodegen.cpp:
618         (JSC::RegExpNode::emitBytecode):
619         * interpreter/Interpreter.cpp:
620         (JSC::Interpreter::privateExecute):
621         * jit/JIT.cpp:
622         (JSC::JIT::privateCompileMainPass):
623         * jit/JIT.h:
624         * jit/JITOpcodes.cpp:
625         (JSC::JIT::emit_op_new_regexp):
626         * jit/JITStubs.cpp:
627         (JSC::DEFINE_STUB_FUNCTION):
628         * jit/JITStubs.h:
629         (JSC::):
630
631 2010-05-09  Geoffrey Garen  <ggaren@apple.com>
632
633         Reviewed by Oliver Hunt.
634
635         Reserve a large-ish initial capacity for Lexer::m_buffer16.
636         
637         SunSpider says 0.3% faster.
638         
639         m_buffer16 is used when parsing complex strings -- for example, strings
640         with escape sequences in them. These kinds of strings can be really long,
641         and we want to avoid repeatedly copying as we grow m_buffer16.
642         
643         The net memory cost is quite low, since it's proporitional to source
644         code we already have in memory, and we throw away m_buffer16 right when
645         we're done parsing.
646
647         * parser/Lexer.cpp:
648         (JSC::Lexer::Lexer): No need to reserve initial capacity in our constructor,
649         since setCode will be called before we're asked to lex anything.
650         (JSC::Lexer::setCode): Reserve enough space to lex half the source code
651         as a complex string without having to copy.
652         (JSC::Lexer::clear): No need to reserve initial capacity here either,
653         since setCode will be called before we're asked to lex anything.
654
655 2010-05-09  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
656
657         Reviewed by Eric Seidel.
658
659         [Qt] Remove YARR configuration rules from Qt make system
660         https://bugs.webkit.org/show_bug.cgi?id=38819
661
662         Setting YARR based on JIT seeting is now in Platform.h 
663         for all ports. This patch essentially reverses r49238.
664
665         * JavaScriptCore.pri:
666
667 2010-05-09  Oliver Hunt  <oliver@apple.com>
668
669         Reviewed by Maciej Stachowiak.
670
671         Improve string indexing performance
672         https://bugs.webkit.org/show_bug.cgi?id=38814
673
674         Add an assembly stub to do indexed loads from strings much
675         more cheaply than the current stub dispatch logic.  We can
676         do this because we are able to make guarantees about the
677         register contents when entering the stub so the call overhead
678         is negligible.
679
680         * jit/JIT.h:
681         * jit/JITInlineMethods.h:
682         * jit/JITOpcodes.cpp:
683         * jit/JITPropertyAccess.cpp:
684         (JSC::JIT::stringGetByValStubGenerator):
685         (JSC::JIT::emitSlow_op_get_by_val):
686            Moved from JITOpcodes.cpp to keep the slowcase next to
687            the normal case codegen as we do for everything else.
688         * jit/JITPropertyAccess32_64.cpp:
689         (JSC::JIT::stringGetByValStubGenerator):
690         (JSC::JIT::emitSlow_op_get_by_val):
691         * jit/JSInterfaceJIT.h:
692         (JSC::JSInterfaceJIT::emitFastArithImmToInt):
693
694 2010-05-09  Maciej Stachowiak  <mjs@apple.com>
695
696         Fixed version of: "Optimized o[s] where o is a cell and s is a string"
697         https://bugs.webkit.org/show_bug.cgi?id=38815
698         
699         Fixed the previous patch for this from Geoff Garen.
700         
701         The two problems were a missing exception check and a PropertySlot
702         initialized improperly, leading to crashes and failures in the case
703         of getters accessed with bracket syntax.
704
705     Previous patch:
706
707         Optimized o[s] where o is a cell and s is a string, removing some old
708         code that wasn't really tuned for the JIT.
709         
710         SunSpider says 0.8% faster.
711
712         * jit/JITStubs.cpp:
713         (JSC::DEFINE_STUB_FUNCTION):
714         * runtime/JSCell.h:
715
716 2010-05-08  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
717
718         Unreviewed, build fix.
719
720         Fix missing terminating ' character warning
721
722         The warning has been only seen on the Gtk buildbots.
723
724         * wtf/Platform.h:
725
726 2010-05-08  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
727
728         Reviewed by Gavin Barraclough.
729
730         Refactor YARR and YARR_JIT default rules in Platform.h
731         https://bugs.webkit.org/show_bug.cgi?id=38727
732
733         Turn on YARR and YARR JIT by default of JIT is enabled.
734         Ports can overrule this default decisions as they wish.
735
736         * wtf/Platform.h:
737
738 2010-05-08  Oliver Hunt  <oliver@apple.com>
739
740         Reviewed by Gavin Barraclough.
741
742         Split JSVALUE32_64 code out of JITOpcodes.cpp and into JITOpcodes32_64.cpp
743         https://bugs.webkit.org/show_bug.cgi?id=38808
744
745         * GNUmakefile.am:
746         * JavaScriptCore.gypi:
747         * JavaScriptCore.pro:
748         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
749         * JavaScriptCore.xcodeproj/project.pbxproj:
750         * jit/JITOpcodes.cpp:
751         * jit/JITOpcodes32_64.cpp: Added.
752         (JSC::JIT::privateCompileCTIMachineTrampolines):
753         (JSC::JIT::emit_op_mov):
754         (JSC::JIT::emit_op_end):
755         (JSC::JIT::emit_op_jmp):
756         (JSC::JIT::emit_op_loop_if_lesseq):
757         (JSC::JIT::emitSlow_op_loop_if_lesseq):
758         (JSC::JIT::emit_op_new_object):
759         (JSC::JIT::emit_op_instanceof):
760         (JSC::JIT::emitSlow_op_instanceof):
761         (JSC::JIT::emit_op_new_func):
762         (JSC::JIT::emit_op_get_global_var):
763         (JSC::JIT::emit_op_put_global_var):
764         (JSC::JIT::emit_op_get_scoped_var):
765         (JSC::JIT::emit_op_put_scoped_var):
766         (JSC::JIT::emit_op_tear_off_activation):
767         (JSC::JIT::emit_op_tear_off_arguments):
768         (JSC::JIT::emit_op_new_array):
769         (JSC::JIT::emit_op_resolve):
770         (JSC::JIT::emit_op_to_primitive):
771         (JSC::JIT::emitSlow_op_to_primitive):
772         (JSC::JIT::emit_op_strcat):
773         (JSC::JIT::emit_op_resolve_base):
774         (JSC::JIT::emit_op_resolve_skip):
775         (JSC::JIT::emit_op_resolve_global):
776         (JSC::JIT::emitSlow_op_resolve_global):
777         (JSC::JIT::emit_op_not):
778         (JSC::JIT::emitSlow_op_not):
779         (JSC::JIT::emit_op_jfalse):
780         (JSC::JIT::emitSlow_op_jfalse):
781         (JSC::JIT::emit_op_jtrue):
782         (JSC::JIT::emitSlow_op_jtrue):
783         (JSC::JIT::emit_op_jeq_null):
784         (JSC::JIT::emit_op_jneq_null):
785         (JSC::JIT::emit_op_jneq_ptr):
786         (JSC::JIT::emit_op_jsr):
787         (JSC::JIT::emit_op_sret):
788         (JSC::JIT::emit_op_eq):
789         (JSC::JIT::emitSlow_op_eq):
790         (JSC::JIT::emit_op_neq):
791         (JSC::JIT::emitSlow_op_neq):
792         (JSC::JIT::compileOpStrictEq):
793         (JSC::JIT::emit_op_stricteq):
794         (JSC::JIT::emitSlow_op_stricteq):
795         (JSC::JIT::emit_op_nstricteq):
796         (JSC::JIT::emitSlow_op_nstricteq):
797         (JSC::JIT::emit_op_eq_null):
798         (JSC::JIT::emit_op_neq_null):
799         (JSC::JIT::emit_op_resolve_with_base):
800         (JSC::JIT::emit_op_new_func_exp):
801         (JSC::JIT::emit_op_throw):
802         (JSC::JIT::emit_op_get_pnames):
803         (JSC::JIT::emit_op_next_pname):
804         (JSC::JIT::emit_op_push_scope):
805         (JSC::JIT::emit_op_pop_scope):
806         (JSC::JIT::emit_op_to_jsnumber):
807         (JSC::JIT::emitSlow_op_to_jsnumber):
808         (JSC::JIT::emit_op_push_new_scope):
809         (JSC::JIT::emit_op_catch):
810         (JSC::JIT::emit_op_jmp_scopes):
811         (JSC::JIT::emit_op_switch_imm):
812         (JSC::JIT::emit_op_switch_char):
813         (JSC::JIT::emit_op_switch_string):
814         (JSC::JIT::emit_op_new_error):
815         (JSC::JIT::emit_op_debug):
816         (JSC::JIT::emit_op_enter):
817         (JSC::JIT::emit_op_enter_with_activation):
818         (JSC::JIT::emit_op_create_arguments):
819         (JSC::JIT::emit_op_init_arguments):
820         (JSC::JIT::emit_op_convert_this):
821         (JSC::JIT::emitSlow_op_convert_this):
822         (JSC::JIT::emit_op_profile_will_call):
823         (JSC::JIT::emit_op_profile_did_call):
824
825 2010-05-08  Gabor Loki  <loki@webkit.org>
826
827         Reviewed by Gavin Barraclough.
828
829         Fix halfword loads on ARM
830         https://bugs.webkit.org/show_bug.cgi?id=38741
831
832         The BaseIndex and ImplicitAddress are contain 32bit wide offset, but
833         the load16 functions were working with 8 bit data (encoded in the
834         instruction). If the offset cannot be encoded in an instruction, it
835         should be stored in a temporary register.
836
837         * assembler/ARMAssembler.h:
838         (JSC::ARMAssembler::getOffsetForHalfwordDataTransfer):
839         * assembler/MacroAssemblerARM.h:
840         (JSC::MacroAssemblerARM::load16):
841
842 2010-05-08  Gabor Loki  <loki@webkit.org>
843
844         Reviewed by Gavin Barraclough.
845
846         Fix spanning branch instruction on Cortex-A8 with Thumb-2 JIT
847         https://bugs.webkit.org/show_bug.cgi?id=38280
848
849         If the 32-bit Thumb-2 branch instruction spans two 4KiB regions and
850         the target of the branch falls within the first region it is
851         possible for the processor to incorrectly determine the branch
852         instruction, and it is also possible in some cases for the processor
853         to enter a deadlock state.
854
855         * assembler/ARMv7Assembler.h:
856         (JSC::ARMv7Assembler::linkJumpAbsolute):
857
858 2010-05-08  Adam Barth  <abarth@webkit.org>
859
860         Reviewed by Darin Fisher.
861
862         [WTFURL] Add a buffer for managing the output of the canonicalizer
863         https://bugs.webkit.org/show_bug.cgi?id=38671
864
865         The canonicalizer produces a stream of canonicalized characters, which
866         we will store in a URLBuffer.  URLBuffer is quite similar to Vector,
867         but serves as an abstraction to isolate us from the underlying
868         character storage.  In the case of WebKit, we'll probably implement a
869         subclass of URLBuffer with Vector.  In Chromium, the backing store is a
870         std::string, which avoids an unnecessary memcpy that would be caused by
871         using Vector instead.
872
873         * wtf/url/src/URLBuffer.h: Added.
874         (WTF::URLBuffer::URLBuffer):
875         (WTF::URLBuffer::~URLBuffer):
876         (WTF::URLBuffer::at):
877         (WTF::URLBuffer::set):
878         (WTF::URLBuffer::capacity):
879         (WTF::URLBuffer::length):
880         (WTF::URLBuffer::data):
881         (WTF::URLBuffer::setLength):
882         (WTF::URLBuffer::append):
883         (WTF::URLBuffer::grow):
884
885 2010-05-08  Eric Seidel  <eric@webkit.org>
886
887         Unreviewed, just reverting commit.
888
889         REGRESSION(59000): r59000 contained all sorts of changes it should not have, needs revert.
890         https://bugs.webkit.org/show_bug.cgi?id=38798
891
892         * bytecompiler/BytecodeGenerator.cpp:
893         (JSC::BytecodeGenerator::emitResolve):
894         * jit/JITOpcodes.cpp:
895         (JSC::JIT::emit_op_resolve_global):
896
897 2010-05-04  Jer Noble  <jer.noble@apple.com>
898
899         Reviewed by Maciej Stachowiak
900
901         Safari pegs CPU and drops tons of frames using HTML5 Vimeo player
902         <https://bugs.webkit.org/show_bug.cgi?id=34005>
903         <rdar://problem/7569713>
904         
905         Added cancelCallOnMainThread.  callOnMainThread should always now be paired
906         with cancelCallOnMainThread in situations where the refcon passed to callOnMainThread
907         may be dealloced before the main thread function can be dispatched.  
908         
909         * wtf/MainThread.cpp:
910         (WTF::FunctionWithContext::operator == ): Supports the FunctionWithContextFinder predicate functor.
911         (WTF::FunctionWithContextFinder::FunctionWithContextFinder):  Predicate functor for use with Dequeue::findIf
912         (WTF::FunctionWithContextFinder::operator()):
913         (WTF::cancelCallOnMainThread):
914         * wtf/MainThread.h:
915
916 2010-05-07  Oliver Hunt  <oliver@apple.com>
917
918         Windows build fix.
919
920         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
921
922 2010-05-07  Eric Seidel  <eric@webkit.org>
923
924         Unreviewed, rolling out r58990.
925         http://trac.webkit.org/changeset/58990
926
927         Broke 4 tests on Snow Leopard and Qt.
928
929         * jit/JITStubs.cpp:
930         (JSC::DEFINE_STUB_FUNCTION):
931         * runtime/JSCell.h:
932
933 2010-05-07  Oliver Hunt  <oliver@apple.com>
934
935         Reviewed by Gavin Barraclough.
936
937         Optimize access to the global object from a function that uses eval
938         https://bugs.webkit.org/show_bug.cgi?id=38644
939
940         Fix bug where cross scope access to a global var (vs. property) would
941         be allowed without checking for intervening dynamic scopes.
942
943         * bytecompiler/BytecodeGenerator.cpp:
944         (JSC::BytecodeGenerator::emitResolve):
945
946 2010-05-07  Oliver Hunt  <oliver@apple.com>
947
948         32-bit buildfix.
949
950         Macro expansion I stab at thee!
951
952         * jit/JITOpcodes.cpp:
953         (JSC::JIT::emit_op_resolve_global):
954
955 2010-05-07  Geoffrey Garen  <ggaren@apple.com>
956
957         Reviewed by Darin Adler.
958
959         Optimized o[s] where o is a cell and s is a string, removing some old
960         code that wasn't really tuned for the JIT.
961         
962         SunSpider says 0.8% faster.
963
964         * jit/JITStubs.cpp:
965         (JSC::DEFINE_STUB_FUNCTION):
966         * runtime/JSCell.h:
967
968 2010-05-07  Oliver Hunt  <oliver@apple.com>
969
970         Windows build fix.
971
972         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
973
974 2010-05-07  Oliver Hunt  <oliver@apple.com>
975
976         Reviewed by Geoffrey Garen.
977
978         Optimize access to the global object from a function that uses eval
979         https://bugs.webkit.org/show_bug.cgi?id=38644
980
981         Add op_resolve_global_dynamic, a variant of op_resolve_global that
982         checks each node in the scope chain for dynamically inserted properties
983         and falls back to the normal resolve logic in that case.
984
985         * JavaScriptCore.exp:
986         * bytecode/CodeBlock.cpp:
987         (JSC::isGlobalResolve):
988         (JSC::CodeBlock::printStructures):
989         (JSC::CodeBlock::dump):
990         (JSC::CodeBlock::derefStructures):
991         * bytecode/Opcode.h:
992         * bytecompiler/BytecodeGenerator.cpp:
993         (JSC::BytecodeGenerator::findScopedProperty):
994            Now take an additional reference parameter to used to indicate that
995            there were nodes that may gain dynamic properties
996         (JSC::BytecodeGenerator::emitResolve):
997         (JSC::BytecodeGenerator::emitResolveBase):
998         (JSC::BytecodeGenerator::emitResolveWithBase):
999            deal with additional argument to findScopedProperty
1000         * bytecompiler/BytecodeGenerator.h:
1001         * bytecompiler/NodesCodegen.cpp:
1002         (JSC::FunctionCallResolveNode::emitBytecode):
1003         (JSC::PostfixResolveNode::emitBytecode):
1004         (JSC::PrefixResolveNode::emitBytecode):
1005         (JSC::ReadModifyResolveNode::emitBytecode):
1006         (JSC::AssignResolveNode::emitBytecode):
1007            These functions use findScopedProperty directly in order to
1008            optimise lookup.  They cannot trivially handle any degree of
1009            dynamism in the lookup so we just give up in such case.
1010         * interpreter/Interpreter.cpp:
1011         (JSC::Interpreter::resolveGlobalDynamic):
1012         (JSC::Interpreter::execute):
1013         (JSC::Interpreter::privateExecute):
1014         * interpreter/Interpreter.h:
1015         * jit/JIT.cpp:
1016         (JSC::JIT::privateCompileMainPass):
1017         (JSC::JIT::privateCompileSlowCases):
1018         * jit/JIT.h:
1019         * jit/JITOpcodes.cpp:
1020         (JSC::JIT::emit_op_resolve_global):
1021         (JSC::JIT::emit_op_resolve_global_dynamic):
1022         (JSC::JIT::emitSlow_op_resolve_global):
1023         (JSC::JIT::emitSlow_op_resolve_global_dynamic):
1024            Happily resolve_global_dynamic can share the slow case!
1025         * jit/JITStubs.h:
1026         (JSC::):
1027         * runtime/JSActivation.cpp:
1028         (JSC::JSActivation::isDynamicScope):
1029         * runtime/JSActivation.h:
1030         * runtime/JSGlobalObject.cpp:
1031         (JSC::JSGlobalObject::isDynamicScope):
1032         * runtime/JSGlobalObject.h:
1033         * runtime/JSStaticScopeObject.cpp:
1034         (JSC::JSStaticScopeObject::isDynamicScope):
1035         * runtime/JSStaticScopeObject.h:
1036         * runtime/JSVariableObject.h:
1037
1038 2010-05-07  Geoffrey Garen  <ggaren@apple.com>
1039
1040         Reviewed by Gavin Barraclough.
1041
1042         Fixed Sputnik failure seen on buildbot.
1043
1044         * runtime/NumberPrototype.cpp:
1045         (JSC::numberProtoFuncToString): Cast to unsigned before checking magnitude,
1046         to efficiently exclude negative numbers, which require two characters
1047         instead of one.
1048
1049 2010-05-07  Geoffrey Garen  <ggaren@apple.com>
1050
1051         Reviewed by Alexey Proskuryakov.
1052         
1053         Slightly more effective way to guarantee a compile-time constant, at
1054         least on gcc.
1055
1056         * runtime/NumberPrototype.cpp:
1057         (JSC::numberProtoFuncToString): Use pointer notation instead of array
1058         notation, so the compiler treats the string and its contents as constant.
1059
1060 2010-05-07  Adam Barth  <abarth@webkit.org>
1061
1062         Reviewed by Alexey Proskuryakov.
1063
1064         [WTFURL] Add core URL parser
1065         https://bugs.webkit.org/show_bug.cgi?id=38572
1066
1067         This patch adds the core of the URL parser.  The URL parser uses a
1068         templated notion of a code unit to support different string types.
1069         Later we'll add some non-templated APIs with concrete types that
1070         clients can use more conveniently.
1071
1072         The URLParser has a couple calls to ASSERT(), which I've commented out
1073         for now.  I'm not 100% sure how to handle the dependency issues there
1074         yet, so I've punted on the issue for now.
1075
1076         Also, there are a number of methods that are declared public in this
1077         patch that are only used by the canonicalizer.  My plan is to make
1078         those private or protected and make the canonicalizer a friend of the
1079         parser.  The details will be in a later patch.
1080
1081         * wtf/url/src/URLComponent.h:
1082         (WTF::URLComponent::fromRange):
1083         (WTF::URLComponent::isNonEmpty):
1084         (WTF::URLComponent::isEmptyOrInvalid):
1085         * wtf/url/src/URLParser.h: Added.
1086         (WTF::URLParser::):
1087         (WTF::URLParser::isPossibleAuthorityTerminator):
1088         (WTF::URLParser::parseAuthority):
1089         (WTF::URLParser::extractScheme):
1090         (WTF::URLParser::parseAfterScheme):
1091         (WTF::URLParser::parseStandardURL):
1092         (WTF::URLParser::parsePath):
1093         (WTF::URLParser::parsePathURL):
1094         (WTF::URLParser::parseMailtoURL):
1095         (WTF::URLParser::parsePort):
1096         (WTF::URLParser::extractFileName):
1097         (WTF::URLParser::extractQueryKeyValue):
1098         (WTF::URLParser::isURLSlash):
1099         (WTF::URLParser::shouldTrimFromURL):
1100         (WTF::URLParser::trimURL):
1101         (WTF::URLParser::consecutiveSlashes):
1102         (WTF::URLParser::isPortDigit):
1103         (WTF::URLParser::nextAuthorityTerminator):
1104         (WTF::URLParser::parseUserInfo):
1105         (WTF::URLParser::parseServerInfo):
1106
1107 2010-05-07  Geoffrey Garen  <ggaren@apple.com>
1108
1109         Reviewed by Oliver Hunt.
1110
1111         Added a fast path for number-to-character conversion via
1112         Number.prototype.toString base 36.
1113         
1114         0.7% speedup on SunSpider.
1115
1116         * runtime/NumberPrototype.cpp:
1117         (JSC::numberProtoFuncToString): Made radix interpretation a little more
1118         efficient by keeping it in int space. Turned "const char" into
1119         "static const char" just in case. Added a fast path for base 36
1120         conversion of something that will turn into a character.
1121
1122 2010-05-07  Adam Barth  <abarth@webkit.org>
1123
1124         Reviewed by Darin Fisher.
1125
1126         [WTFURL] Add a malloc-backed URLBuffer
1127         https://bugs.webkit.org/show_bug.cgi?id=38694
1128
1129         This patch adds a URLBuffer that uses new/delete to manage the backing
1130         store for the buffer.
1131
1132         * wtf/url/src/RawURLBuffer.h: Added.
1133         (WTF::RawURLBuffer::RawURLBuffer):
1134         (WTF::RawURLBuffer::~RawURLBuffer):
1135         (WTF::RawURLBuffer::resize):
1136
1137 2010-05-06  Fumitoshi Ukai  <ukai@chromium.org>
1138
1139         Reviewed by Alexey Proskuryakov.
1140
1141         JavaScriptCore/wtf/RandomNumber.h should provide using WTF::*
1142         https://bugs.webkit.org/show_bug.cgi?id=38719
1143
1144         * wtf/RandomNumber.h:
1145           Add using directives.
1146
1147 2010-05-06  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
1148
1149         Reviewed by Kenneth Rohde Christiansen.
1150
1151         [Qt] Enable YARR_JIT for X86 Mac for QtWebKit
1152         https://bugs.webkit.org/show_bug.cgi?id=38668
1153
1154         * wtf/Platform.h:
1155
1156 2010-05-06  Gavin Barraclough  <barraclough@apple.com>
1157
1158         Reviewed by Geoff Garen.
1159
1160         Bug 38714 - Add result caching for Math.sin
1161
1162         Math.sin is frequently called with the same operand, caching the result should
1163         improve performance.  CachedTranscendentalFunction adds a generic mechanism to
1164         cache results for pure functions with the signature "double func(double)", and
1165         where NaN maps to NaN.
1166
1167         CachedTranscendentalFunction uses a very simple hash function designed to be
1168         fast to execute since we cannot cache the result, and trivial to JIT generate,
1169         should we wish to do so.
1170
1171         * JavaScriptCore.xcodeproj/project.pbxproj:
1172         * runtime/CachedTranscendentalFunction.h: Added.
1173         (JSC::CachedTranscendentalFunction::CachedTranscendentalFunction):
1174         (JSC::CachedTranscendentalFunction::~CachedTranscendentalFunction):
1175         (JSC::CachedTranscendentalFunction::operator()):
1176         (JSC::CachedTranscendentalFunction::initialize):
1177         (JSC::CachedTranscendentalFunction::hash):
1178         * runtime/JSGlobalData.h:
1179         * runtime/MathObject.cpp:
1180         (JSC::mathProtoFuncSin):
1181         * wtf/Platform.h:
1182
1183 2010-05-06  Geoffrey Garen  <ggaren@apple.com>
1184
1185         Windows build fix.
1186
1187         * bytecode/SamplingTool.cpp:
1188         (JSC::SamplingFlags::sample): Use a cast, so Windows will be happy when
1189         this code is enabled.
1190         * wtf/Platform.h: Reverted last change to this file, which seems to have
1191         been accidental.
1192
1193 2010-05-06  Gavin Barraclough  <barraclough@apple.com>
1194
1195         Reviewed by Oliver Hunt.
1196
1197         Add compile switch to make debugger keyword plant breakpoint instructions.
1198
1199         * bytecompiler/BytecodeGenerator.cpp:
1200         (JSC::BytecodeGenerator::emitDebugHook):
1201         * jit/JITOpcodes.cpp:
1202         (JSC::JIT::emit_op_debug):
1203         * wtf/Platform.h:
1204
1205 2010-05-06  Oliver Hunt  <oliver@apple.com>
1206
1207         Build fix
1208
1209         Fix ARM builds
1210
1211         * assembler/MacroAssemblerARM.h:
1212         (JSC::MacroAssemblerARM::load16):
1213         * assembler/MacroAssemblerARMv7.h:
1214         (JSC::MacroAssemblerARMv7::load16):
1215
1216 2010-05-06  Oliver Hunt  <oliver@apple.com>
1217
1218         Reviewed by Geoffrey Garen.
1219
1220         Improve performance of single character string compares
1221         https://bugs.webkit.org/show_bug.cgi?id=38659
1222
1223         Add logic to the jit to identify comparisons to single character string literals
1224         and then just perform the comparison inline, rather than ignoring the evidence
1225         and attempting to perform an integer comparison.
1226
1227         Multiple changes required -- add jnlesseq opcode, add helper function to identify
1228         single character string constants, add a helper to load single character strings.
1229         Then add the 32_64 and normal codepaths to the JIT.
1230
1231         * assembler/MacroAssemblerX86Common.h:
1232         (JSC::MacroAssemblerX86Common::load16):
1233         * bytecode/CodeBlock.cpp:
1234         (JSC::CodeBlock::dump):
1235         * bytecode/Opcode.h:
1236         * bytecompiler/BytecodeGenerator.cpp:
1237         (JSC::BytecodeGenerator::emitJumpIfTrue):
1238         * interpreter/Interpreter.cpp:
1239         (JSC::Interpreter::privateExecute):
1240         * jit/JIT.cpp:
1241         (JSC::JIT::privateCompileMainPass):
1242         (JSC::JIT::privateCompileSlowCases):
1243         * jit/JIT.h:
1244         * jit/JITArithmetic.cpp:
1245         (JSC::JIT::emit_op_jnless):
1246         (JSC::JIT::emitSlow_op_jnless):
1247         (JSC::JIT::emit_op_jless):
1248         (JSC::JIT::emitSlow_op_jless):
1249         (JSC::JIT::emit_op_jlesseq):
1250         (JSC::JIT::emit_op_jnlesseq):
1251         (JSC::JIT::emitSlow_op_jlesseq):
1252         (JSC::JIT::emitSlow_op_jnlesseq):
1253         * jit/JITArithmetic32_64.cpp:
1254         (JSC::JIT::emit_op_jnless):
1255         (JSC::JIT::emitSlow_op_jnless):
1256         (JSC::JIT::emit_op_jless):
1257         (JSC::JIT::emitSlow_op_jless):
1258         (JSC::JIT::emit_op_jlesseq):
1259         (JSC::JIT::emit_op_jnlesseq):
1260         (JSC::JIT::emitSlow_op_jlesseq):
1261         (JSC::JIT::emitSlow_op_jnlesseq):
1262         (JSC::JIT::emitBinaryDoubleOp):
1263         * jit/JITInlineMethods.h:
1264         (JSC::JIT::emitLoadCharacterString):
1265         (JSC::JIT::isOperandConstantImmediateChar):
1266         * jit/JSInterfaceJIT.h:
1267         (JSC::ThunkHelpers::stringImplDataOffset):
1268         (JSC::ThunkHelpers::jsStringLengthOffset):
1269         (JSC::ThunkHelpers::jsStringValueOffset):
1270          Moved from ThunkGenerators to make it possible to share.
1271         * jit/ThunkGenerators.cpp:
1272
1273 2010-05-06  Martin Robinson  <mrobinson@webkit.org>
1274
1275         Reviewed by Gustavo Noronha Silva.
1276
1277         [GTK] Enable DOM clipboard and drag-and-drop access
1278         https://bugs.webkit.org/show_bug.cgi?id=30623
1279
1280         Convert dragging portion of drag-and-drop to use DataObjectGtk.
1281
1282         * wtf/gobject/GRefPtr.h: Add forward declarations for GObject functions.
1283
1284 2010-05-06  Steve Block  <steveblock@google.com>
1285
1286         Reviewed by Eric Seidel.
1287
1288         MAC_JAVA_BRIDGE should be renamed JAVA_BRIDGE
1289         https://bugs.webkit.org/show_bug.cgi?id=38544
1290
1291         * wtf/Platform.h:
1292
1293 2010-05-06  Adam Barth  <abarth@webkit.org>
1294
1295         Reviewed by Maciej Stachowiak.
1296
1297         [WTFURL] Add a class to represent the segments of a URL
1298         https://bugs.webkit.org/show_bug.cgi?id=38566
1299
1300         When paired with a string, this class represents a parsed URL.
1301
1302         * wtf/url/src/URLSegments.cpp: Added.
1303         (WTF::URLSegments::length):
1304         (WTF::URLSegments::charactersBefore):
1305         * wtf/url/src/URLSegments.h: Added.
1306         (WTF::URLSegments::):
1307         (WTF::URLSegments::URLSegments):
1308         * wtf/url/wtfurl.gyp:
1309
1310 2010-05-05  Tony Gentilcore  <tonyg@chromium.org>
1311
1312         Reviewed by Adam Barth.
1313
1314         Adding comment with link to RefPtr documentation.
1315         https://bugs.webkit.org/show_bug.cgi?id=38601
1316
1317         * wtf/RefPtr.h:
1318
1319 2010-05-05  Gavin Barraclough  <barraclough@apple.com>
1320
1321         Reviewed by Darin Adler.
1322
1323         Bug 38604 - workers-gc2 crashing on Qt
1324
1325         This appears to be due to a couple of issues.
1326         (1) When the atomic string table is deleted it does not clear the 'inTable' bit
1327         on AtomicStrings - it implicitly assumes that all AtomicStrings have already
1328         been deleted at this point (otherwise they will crash in their destructor when
1329         they try to remove themselves from the atomic string table).
1330         (2) We don't fix the ordering in which WTF::WTFThreadData and
1331         WebCore::ThreadGlobalData are destructed.
1332
1333         We should make sure that ThreadGlobalData is cleaned up before worker threads
1334         terminate and WTF::WTFThreadData is destroyed, and we should clear the inTable
1335         bit of members on atomic string table destruction.
1336
1337         WTF changes (fix issue 1, above) - ensure inTable property is cleared when the
1338         atomic string table is destroyed (also, rename InTable to IsAtomic, to make it
1339         clear which table we are refering to!)
1340
1341         * wtf/text/AtomicString.cpp:
1342         (WebCore::AtomicStringTable::destroy):
1343         (WebCore::CStringTranslator::translate):
1344         (WebCore::UCharBufferTranslator::translate):
1345         (WebCore::HashAndCharactersTranslator::translate):
1346         (WebCore::AtomicString::add):
1347         * wtf/text/StringImpl.cpp:
1348         (WebCore::StringImpl::~StringImpl):
1349         * wtf/text/StringImpl.h:
1350         (WebCore::StringImpl::isAtomic):
1351         (WebCore::StringImpl::setIsAtomic):
1352         * wtf/text/StringImplBase.h:
1353
1354 2010-05-05  Oliver Hunt  <oliver@apple.com>
1355
1356         Reviewed by Geoffrey Garen.
1357
1358         Make Array.join specialised for actual arrays
1359         https://bugs.webkit.org/show_bug.cgi?id=38592
1360
1361         Bring Array.join in line with the other array methods by specialising for
1362         this === an array.
1363
1364         * runtime/ArrayPrototype.cpp:
1365         (JSC::arrayProtoFuncJoin):
1366
1367 2010-05-04  Yongjun Zhang  <yongjun_zhang@apple.com>
1368
1369         Reviewed by Darin Adler.
1370
1371         WebKit crashes at DebuggerCallFrame::functionName() if m_callFrame is the top global callframe.
1372         https://bugs.webkit.org/show_bug.cgi?id=38535
1373
1374         Don't call asFunction if callee is not a FunctionType to prevent assertion failure
1375         in JSCell::isObject().
1376
1377         * debugger/DebuggerCallFrame.cpp:
1378         (JSC::DebuggerCallFrame::functionName):
1379         (JSC::DebuggerCallFrame::calculatedFunctionName):
1380
1381 2010-05-04  Steve Falkenburg  <sfalken@apple.com>
1382
1383         Remove redundant exports to fix Windows build warnings.
1384
1385         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1386
1387 2010-05-04  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
1388
1389         Reviewed by Holger Freyther.
1390
1391         Fix a memory leak inside the QScriptValue.
1392
1393         QSciptValuePrivate::toString should release all temporary variables.
1394
1395         [Qt] QScriptValue::toString have a memory leak.
1396         https://bugs.webkit.org/show_bug.cgi?id=38112
1397
1398         * qt/api/qscriptvalue_p.h:
1399         (QScriptValuePrivate::toString):
1400
1401 2010-05-04  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
1402
1403         Reviewed by Darin Adler.
1404
1405         Does not work on SPARC because of alignment issues
1406         https://bugs.webkit.org/show_bug.cgi?id=38455
1407
1408         Use AllocAlignmentInteger instead of void* on pageheap_memory to
1409         avoid crashing at runtime in some architectures. Investigated by
1410         Mike Hommey <mh@glandium.org>, change suggested by Darin Adler.
1411
1412         * wtf/FastMalloc.cpp:
1413
1414 2010-05-04  Adam Barth  <abarth@webkit.org>
1415
1416         Reviewed by Maciej Stachowiak.
1417
1418         Add first WTFURL file
1419         https://bugs.webkit.org/show_bug.cgi?id=38470
1420
1421         This class represents a component of a URL, such as the scheme or path.
1422         Essentially, the class is an index into a string buffer.
1423
1424         * wtf/url: Added.
1425             - There was some discussion about where to put the URL library.
1426               There are a number of reasonable options, but putting the library
1427               in the WTF directory seems like a reasonable alternative.  This
1428               location will make more sense once WTF is moved out of
1429               JavaScriptCore and into a top-level directory.
1430         * wtf/url/src: Added.
1431             - I've added this extra directory to the usual structure because we
1432               eventually want a "public" folder that defines the public
1433               interface to this library that clients outside of svn.webkit.org
1434               can rely upon, much like the various subfolders of the WebKit
1435               directory often define a public API.
1436         * wtf/url/src/URLComponent.h: Added.
1437             - I've added this somewhat trivial class to get the ball rolling.
1438         (WTF::URLComponent::URLComponent):
1439         (WTF::URLComponent::isValid):
1440         (WTF::URLComponent::isNonempty):
1441         (WTF::URLComponent::reset):
1442         (WTF::URLComponent::operator==):
1443         (WTF::URLComponent::begin):
1444         (WTF::URLComponent::setBegin):
1445         (WTF::URLComponent::length):
1446         (WTF::URLComponent::setLength):
1447         (WTF::URLComponent::end):
1448         * wtf/url/wtfurl.gyp: Added.
1449             - WTFURL will be an independently buildable library, hence the
1450               beginnings of a wtfurl.gyp file.
1451
1452 2010-05-03  Stephanie Lewis  <slewis@apple.com>
1453
1454         Reviewed by Geoff Garen.
1455
1456         https://bugs.webkit.org/show_bug.cgi?id=38368
1457         <rdar://problem/7834433> REGRESSSION: 1.5% PLT regression due to 56028 
1458         (return memory quicker).
1459         Instead of returning everything but the smallest spans spread out 
1460         the spans kept over several size lists.
1461
1462         * wtf/FastMalloc.cpp:
1463         (WTF::TCMalloc_PageHeap::scavenge):
1464
1465 2010-05-03  James Robinson  <jamesr@chromium.org>
1466
1467         Reviewed by Eric Seidel.
1468
1469         Clean up a few compiler warnings
1470         https://bugs.webkit.org/show_bug.cgi?id=38073
1471
1472         * wtf/text/StringImpl.cpp:
1473         (WebCore::StringImpl::ascii):
1474
1475 2010-05-03  Gavin Barraclough  <barraclough@apple.com>
1476
1477         Reviewed by NOBODY (reverting previous commit).
1478
1479         Rolling out r58114 - this introduced memory leaks of
1480         AtomicStrings then workers terminated.
1481
1482         * GNUmakefile.am:
1483         * JavaScriptCore.gypi:
1484         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
1485         * JavaScriptCore.xcodeproj/project.pbxproj:
1486         * jit/ThunkGenerators.cpp:
1487         (JSC::ThunkHelpers::stringImplDataOffset):
1488         * runtime/Identifier.cpp:
1489         (JSC::IdentifierTable::~IdentifierTable):
1490         (JSC::IdentifierTable::add):
1491         (JSC::IdentifierCStringTranslator::hash):
1492         (JSC::IdentifierCStringTranslator::equal):
1493         (JSC::IdentifierCStringTranslator::translate):
1494         (JSC::Identifier::add):
1495         (JSC::IdentifierUCharBufferTranslator::hash):
1496         (JSC::IdentifierUCharBufferTranslator::equal):
1497         (JSC::IdentifierUCharBufferTranslator::translate):
1498         (JSC::Identifier::addSlowCase):
1499         * runtime/Identifier.h:
1500         * runtime/JSGlobalData.cpp:
1501         (JSC::JSGlobalData::JSGlobalData):
1502         (JSC::JSGlobalData::~JSGlobalData):
1503         * runtime/JSGlobalData.h:
1504         * wtf/WTFThreadData.cpp:
1505         (WTF::WTFThreadData::WTFThreadData):
1506         (WTF::WTFThreadData::~WTFThreadData):
1507         * wtf/WTFThreadData.h:
1508         (JSC::IdentifierTable::remove):
1509         (JSC::IdentifierTable::literalTable):
1510         (WTF::WTFThreadData::atomicStringTable):
1511         * wtf/text/AtomicString.cpp:
1512         (WebCore::AtomicStringTable::create):
1513         (WebCore::AtomicStringTable::table):
1514         (WebCore::AtomicStringTable::destroy):
1515         (WebCore::stringTable):
1516         (WebCore::CStringTranslator::hash):
1517         (WebCore::CStringTranslator::equal):
1518         (WebCore::CStringTranslator::translate):
1519         (WebCore::operator==):
1520         (WebCore::AtomicString::add):
1521         (WebCore::equal):
1522         (WebCore::UCharBufferTranslator::hash):
1523         (WebCore::UCharBufferTranslator::equal):
1524         (WebCore::UCharBufferTranslator::translate):
1525         (WebCore::HashAndCharactersTranslator::hash):
1526         (WebCore::HashAndCharactersTranslator::equal):
1527         (WebCore::HashAndCharactersTranslator::translate):
1528         (WebCore::AtomicString::find):
1529         (WebCore::AtomicString::remove):
1530         * wtf/text/AtomicStringTable.h: Removed.
1531         * wtf/text/StringImpl.cpp:
1532         (WebCore::StringImpl::~StringImpl):
1533         * wtf/text/StringImpl.h:
1534         (WebCore::StringImpl::inTable):
1535         (WebCore::StringImpl::setInTable):
1536         (WebCore::equal):
1537         * wtf/text/StringImplBase.h:
1538         (WTF::StringImplBase::StringImplBase):
1539
1540 2010-05-03  Kevin Watters  <kevinwatters@gmail.com>
1541
1542         Reviewed by Kevin Ollivier.
1543
1544         [wx] Implement scheduleDispatchFunctionsOnMainThread for wx port.
1545         https://bugs.webkit.org/show_bug.cgi?id=38480
1546
1547         * wtf/wx/MainThreadWx.cpp:
1548         (wxCallAfter::wxCallAfter):
1549         (wxCallAfter::OnCallback):
1550         (WTF::scheduleDispatchFunctionsOnMainThread):
1551
1552 2010-05-03  Kevin Watters  <kevinwatters@gmail.com>
1553
1554         Reviewed by Kevin Ollivier.
1555
1556         [wx] Build and use Mac's ComplexTextController to support complex text in wx.
1557         https://bugs.webkit.org/show_bug.cgi?id=38482
1558
1559         * wtf/Platform.h:
1560
1561 2010-05-03  Oliver Hunt  <oliver@apple.com>
1562
1563         Reviewed by Maciej Stachowiak.
1564
1565         Interpreter crashes due to incorrect refcounting of cached structures.
1566         https://bugs.webkit.org/show_bug.cgi?id=38491
1567         rdar://problem/7926160
1568
1569         Make sure we ref/deref structures used for cached custom property getters
1570
1571         * bytecode/CodeBlock.cpp:
1572         (JSC::CodeBlock::derefStructures):
1573         (JSC::CodeBlock::refStructures):
1574
1575 2010-05-02  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
1576
1577         Reviewed by Eric Seidel.
1578
1579         [Qt] Enable JIT for QtWebKit on Symbian
1580         https://bugs.webkit.org/show_bug.cgi?id=38339
1581
1582         JIT on Symbian has been stable for quite some time, it
1583         is time to turn it on by default.
1584
1585         * wtf/Platform.h:
1586
1587 2010-04-29  Oliver Hunt  <oliver@apple.com>
1588
1589         Reviewed by Gavin Barraclough.
1590
1591         Add codegen support for unsigned right shift
1592         https://bugs.webkit.org/show_bug.cgi?id=38375
1593
1594         Expose unsigned right shift in the macro assembler, and make use of it
1595         from the jit.  Currently if the result is outside the range 0..2^31-1
1596         we simply fall back to the slow case, even in JSVALUE64 and JSVALUE32_64
1597         where technically we could still return an immediate value.
1598
1599         * assembler/MacroAssemblerARM.h:
1600         (JSC::MacroAssemblerARM::urshift32):
1601         * assembler/MacroAssemblerARMv7.h:
1602         (JSC::MacroAssemblerARMv7::urshift32):
1603         * assembler/MacroAssemblerX86Common.h:
1604         (JSC::MacroAssemblerX86Common::urshift32):
1605         * assembler/X86Assembler.h:
1606         (JSC::X86Assembler::):
1607         (JSC::X86Assembler::shrl_i8r):
1608         (JSC::X86Assembler::shrl_CLr):
1609            Add unsigned right shift to the x86 assembler
1610         * jit/JIT.cpp:
1611         (JSC::JIT::privateCompileMainPass):
1612         (JSC::JIT::privateCompileSlowCases):
1613            op_rshift no longer simply get thrown to a stub function
1614         * jit/JIT.h:
1615         * jit/JITArithmetic.cpp:
1616         (JSC::JIT::emit_op_urshift):
1617         (JSC::JIT::emitSlow_op_urshift):
1618           JSVALUE32 and JSVALUE64 implementation.  Only supports
1619           double lhs in JSVALUE64.
1620         * jit/JITArithmetic32_64.cpp:
1621         (JSC::JIT::emit_op_rshift):
1622         (JSC::JIT::emitSlow_op_rshift):
1623         (JSC::JIT::emit_op_urshift):
1624         (JSC::JIT::emitSlow_op_urshift):
1625           Refactor right shift code to have shared implementation between signed
1626           and unsigned versions.
1627
1628 2010-04-29  Oliver Hunt  <oliver@apple.com>
1629
1630         Reviewed by Gavin Barraclough.
1631
1632         Handle double on righthand side of a right shift
1633         https://bugs.webkit.org/show_bug.cgi?id=38363
1634
1635         In 64-bit we support right shift of a double, and there's no
1636         reason not to in 32-bit either.  This is a 1.1% sunspider
1637         improvement in 32bit.
1638
1639         Given high performance javascript code frequently makes
1640         use of bit operators to perform double->int conversion i'll
1641         follow this patch up with similar patches for bitwise 'and'
1642         and 'or'.
1643
1644         * jit/JITArithmetic32_64.cpp:
1645         (JSC::JIT::emit_op_rshift):
1646         (JSC::JIT::emitSlow_op_rshift):
1647
1648 2010-04-29  Oliver Hunt  <oliver@apple.com>
1649
1650         Reviewed by Geoff Garen.
1651
1652         Hoist JSVALUE32_64 arithmetic implementations into a separate file.
1653
1654         * GNUmakefile.am:
1655         * JavaScriptCore.gypi:
1656         * JavaScriptCore.pro:
1657         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1658         * JavaScriptCore.xcodeproj/project.pbxproj:
1659         * jit/JITArithmetic.cpp:
1660         (JSC::JIT::emitSlow_op_jnless):
1661         (JSC::JIT::emitSlow_op_jless):
1662         (JSC::JIT::emitSlow_op_jnlesseq):
1663         (JSC::JIT::emit_op_mod):
1664         (JSC::JIT::compileBinaryArithOpSlowCase):
1665         (JSC::JIT::emit_op_div):
1666         (JSC::JIT::compileBinaryArithOp):
1667         * jit/JITArithmetic32_64.cpp: Added.
1668         (JSC::JIT::emit_op_negate):
1669         (JSC::JIT::emitSlow_op_negate):
1670         (JSC::JIT::emit_op_jnless):
1671         (JSC::JIT::emitSlow_op_jnless):
1672         (JSC::JIT::emit_op_jless):
1673         (JSC::JIT::emitSlow_op_jless):
1674         (JSC::JIT::emit_op_jnlesseq):
1675         (JSC::JIT::emitSlow_op_jnlesseq):
1676         (JSC::JIT::emit_op_lshift):
1677         (JSC::JIT::emitSlow_op_lshift):
1678         (JSC::JIT::emit_op_rshift):
1679         (JSC::JIT::emitSlow_op_rshift):
1680         (JSC::JIT::emit_op_bitand):
1681         (JSC::JIT::emitSlow_op_bitand):
1682         (JSC::JIT::emit_op_bitor):
1683         (JSC::JIT::emitSlow_op_bitor):
1684         (JSC::JIT::emit_op_bitxor):
1685         (JSC::JIT::emitSlow_op_bitxor):
1686         (JSC::JIT::emit_op_bitnot):
1687         (JSC::JIT::emitSlow_op_bitnot):
1688         (JSC::JIT::emit_op_post_inc):
1689         (JSC::JIT::emitSlow_op_post_inc):
1690         (JSC::JIT::emit_op_post_dec):
1691         (JSC::JIT::emitSlow_op_post_dec):
1692         (JSC::JIT::emit_op_pre_inc):
1693         (JSC::JIT::emitSlow_op_pre_inc):
1694         (JSC::JIT::emit_op_pre_dec):
1695         (JSC::JIT::emitSlow_op_pre_dec):
1696         (JSC::JIT::emit_op_add):
1697         (JSC::JIT::emitAdd32Constant):
1698         (JSC::JIT::emitSlow_op_add):
1699         (JSC::JIT::emit_op_sub):
1700         (JSC::JIT::emitSub32Constant):
1701         (JSC::JIT::emitSlow_op_sub):
1702         (JSC::JIT::emitBinaryDoubleOp):
1703         (JSC::JIT::emit_op_mul):
1704         (JSC::JIT::emitSlow_op_mul):
1705         (JSC::JIT::emit_op_div):
1706         (JSC::JIT::emitSlow_op_div):
1707         (JSC::JIT::emit_op_mod):
1708         (JSC::JIT::emitSlow_op_mod):
1709
1710 2010-04-29  Zoltan Herczeg  <zherczeg@webkit.org>
1711
1712         Reviewed by Oliver Hunt
1713
1714         Add sqrt() instruction support for ARM assembler (using VFP)
1715         https://bugs.webkit.org/show_bug.cgi?id=38312
1716
1717         * assembler/ARMAssembler.h:
1718         (JSC::ARMAssembler::):
1719         (JSC::ARMAssembler::fsqrtd_r):
1720         * assembler/MacroAssemblerARM.h:
1721         (JSC::MacroAssemblerARM::supportsFloatingPointSqrt):
1722         (JSC::MacroAssemblerARM::sqrtDouble):
1723
1724 2010-04-29  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
1725
1726         Reviewed by Simon Hausmann.
1727
1728         [Qt] Refactor qtscriptglobal.h
1729         https://bugs.webkit.org/show_bug.cgi?id=37953
1730
1731         Use the same pattern in qtscriptglobal.h as in 
1732         qwebkitglobal.h without checking for specific OSs.
1733
1734         * qt/api/qtscriptglobal.h:
1735
1736 2010-04-29  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
1737
1738         Reviewed by Simon Hausmann.
1739
1740         Small cleanup.
1741
1742         QScriptValuePrivate constructor shouldn't take QScriptEngine pointer
1743         as a parameter, because it breaks a private / public separation rule.
1744         QScriptEnginePrivate::get(QScriptEngine*) should return
1745         a QScriptEnginePrivate pointer instead of a QScriptEnginePtr, it simplifies
1746         implementation.
1747
1748         [Qt] QScriptValuePrivate class needs some cleanup.
1749         https://bugs.webkit.org/show_bug.cgi?id=37729
1750
1751         * qt/api/qscriptengine_p.h:
1752         (QScriptEnginePrivate::get):
1753         * qt/api/qscriptvalue.cpp:
1754         (QScriptValue::QScriptValue):
1755         * qt/api/qscriptvalue_p.h:
1756         (QScriptValuePrivate::QScriptValuePrivate):
1757
1758 2010-04-29  Kwang Yul Seo  <skyul@company100.net>
1759
1760         Reviewed by Simon Hausmann.
1761
1762         [WINCE] Export g_stackBase with JS_EXPORTDATA
1763         https://bugs.webkit.org/show_bug.cgi?id=37437
1764
1765         Export g_stackBase with JS_EXPORTDATA as it is used by SharedTimerWince.cpp.
1766
1767         * runtime/Collector.cpp:
1768
1769 2010-04-28  Oliver Hunt  <oliver@apple.com>
1770
1771         Do an unordered compare so that we don't treat NaN incorrectly.
1772
1773         RS=Gavin Barraclough
1774
1775         * jit/ThunkGenerators.cpp:
1776         (JSC::powThunkGenerator):
1777
1778 2010-04-28  Oliver Hunt  <oliver@apple.com>
1779
1780         Reviewed by Gavin Barraclough.
1781
1782         Add fast paths for Math.pow and Math.sqrt
1783         https://bugs.webkit.org/show_bug.cgi?id=38294
1784
1785         Add specialized thunks for Math.pow and Math.sqrt.
1786         This requires adding a sqrtDouble function to the MacroAssembler
1787         and sqrtsd to the x86 assembler.
1788
1789         Math.pow is slightly more complicated, in that we have
1790         to implement exponentiation ourselves rather than relying
1791         on hardware support.  The inline exponentiation is restricted
1792         to positive integer exponents on a numeric base.  Exponentiation
1793         is finally performed through the "Exponentiation by Squaring"
1794         algorithm.
1795
1796         * assembler/AbstractMacroAssembler.h:
1797         (JSC::AbstractMacroAssembler::ImmPtr::ImmPtr):
1798         * assembler/MacroAssemblerARM.h:
1799         (JSC::MacroAssemblerARM::supportsFloatingPointSqrt):
1800         (JSC::MacroAssemblerARM::loadDouble):
1801         (JSC::MacroAssemblerARM::sqrtDouble):
1802         * assembler/MacroAssemblerARMv7.h:
1803         (JSC::MacroAssemblerARMv7::supportsFloatingPointSqrt):
1804         (JSC::MacroAssemblerARMv7::sqrtDouble):
1805         * assembler/MacroAssemblerX86.h:
1806         (JSC::MacroAssemblerX86::loadDouble):
1807         (JSC::MacroAssemblerX86::supportsFloatingPointSqrt):
1808         * assembler/MacroAssemblerX86Common.h:
1809         (JSC::MacroAssemblerX86Common::sqrtDouble):
1810         * assembler/MacroAssemblerX86_64.h:
1811         (JSC::MacroAssemblerX86_64::loadDouble):
1812         (JSC::MacroAssemblerX86_64::supportsFloatingPointSqrt):
1813         * assembler/X86Assembler.h:
1814         (JSC::X86Assembler::):
1815         (JSC::X86Assembler::movsd_mr):
1816         (JSC::X86Assembler::sqrtsd_rr):
1817         (JSC::X86Assembler::X86InstructionFormatter::twoByteOp):
1818         (JSC::X86Assembler::X86InstructionFormatter::memoryModRM):
1819         * create_hash_table:
1820         * jit/JIT.h:
1821         * jit/JITInlineMethods.h:
1822         * jit/JITOpcodes.cpp:
1823         * jit/JITStubs.h:
1824         (JSC::JITThunks::ctiNativeCallThunk):
1825         * jit/JSInterfaceJIT.h:
1826         (JSC::JSInterfaceJIT::emitLoadDouble):
1827         (JSC::JSInterfaceJIT::emitJumpIfImmediateNumber):
1828         (JSC::JSInterfaceJIT::emitJumpIfNotImmediateNumber):
1829         (JSC::JSInterfaceJIT::emitLoadInt32):
1830         * jit/SpecializedThunkJIT.h:
1831         (JSC::SpecializedThunkJIT::loadDoubleArgument):
1832         (JSC::SpecializedThunkJIT::loadInt32Argument):
1833         (JSC::SpecializedThunkJIT::returnJSValue):
1834         (JSC::SpecializedThunkJIT::returnDouble):
1835         (JSC::SpecializedThunkJIT::finalize):
1836         * jit/ThunkGenerators.cpp:
1837         (JSC::sqrtThunkGenerator):
1838         (JSC::powThunkGenerator):
1839         * jit/ThunkGenerators.h:
1840         * runtime/Executable.h:
1841         (JSC::NativeExecutable::NativeExecutable):
1842         * runtime/JSFunction.cpp:
1843         (JSC::JSFunction::JSFunction):
1844
1845 2010-04-28  Mike Thole  <mthole@apple.com>
1846
1847         Reviewed by Mark Rowe.
1848
1849         Reenable WTF_USE_PROTECTION_SPACE_AUTH_CALLBACK now that an
1850         exports file for it has been added.
1851
1852         * wtf/Platform.h:
1853
1854 2010-04-28  Mike Thole  <mthole@apple.com>
1855
1856         Build fix, not reviewed.
1857
1858         * wtf/Platform.h:
1859         Disable WTF_USE_PROTECTION_SPACE_AUTH_CALLBACK until an exports file is created.
1860
1861 2010-04-28  Mike Thole  <mthole@apple.com>
1862
1863         Reviewed by David Kilzer.
1864
1865         Add canAuthenticateAgainstProtectionSpace() to frame loader so that a protection space 
1866         can be inspected before attempting to authenticate against it
1867         https://bugs.webkit.org/show_bug.cgi?id=38271
1868
1869         * wtf/Platform.h: Add WTF_USE_PROTECTION_SPACE_AUTH_CALLBACK define.
1870
1871 2010-04-28  Darin Adler  <darin@apple.com>
1872
1873         Reviewed by Sam Weinig.
1874
1875         Don't use CFAbsoluteTimeGetCurrent on Mac OS X, since it's just a cover
1876         for gettimeofday anyway.
1877
1878         * wtf/CurrentTime.cpp:
1879         (WTF::currentTime): Remove the CF version of this. Change the "other POSIX"
1880         version to pass 0 for the time zone instead of ignoring a return value.
1881         Also get rid of unneeded type casts, since operations involving both
1882         integers and doubles are always evaluated as doubles in C without explicit
1883         type casting.
1884
1885 2010-04-28  Darin Fisher  <darin@chromium.org>
1886
1887         Reviewed by David Levin.
1888
1889         [Chromium] callOnMainThread should equate to MessageLoop::PostTask
1890         https://bugs.webkit.org/show_bug.cgi?id=38276
1891
1892         * JavaScriptCore.gyp/JavaScriptCore.gyp:
1893         * wtf/MainThread.cpp:
1894         * wtf/chromium/ChromiumThreading.h:
1895         * wtf/chromium/MainThreadChromium.cpp:
1896         (WTF::initializeMainThread):
1897         (WTF::callOnMainThread):
1898         (WTF::callOnMainThreadAndWait):
1899         (WTF::setMainThreadCallbacksPaused):
1900         (WTF::isMainThread):
1901
1902 2010-04-28  Simon Hausmann  <simon.hausmann@nokia.com>, Kent Hansen <kent.hansen@nokia.com>
1903
1904         Reviewed by Darin Adler.
1905
1906         JSC's currentThreadStackBase is not reentrant on some platforms
1907         https://bugs.webkit.org/show_bug.cgi?id=37195
1908
1909         This function needs to be reentrant to avoid memory corruption on platforms where
1910         the implementation uses global variables.
1911
1912         This patch adds a mutex lock where necessary and makes the Symbian implementation
1913         reentrant.
1914
1915         * runtime/Collector.cpp:
1916         (JSC::currentThreadStackBaseMutex):
1917         (JSC::currentThreadStackBase):
1918
1919 2010-04-28  Thiago Macieira <thiago.macieira@nokia.com>
1920
1921         Reviewed by Simon Hausmann.
1922
1923         Fix compilation with gcc 3.4.
1924
1925         AtomicStringImpl.h:29: error: base `WebCore::StringImpl' with only
1926         non-default constructor in class without a constructor
1927
1928         * wtf/text/AtomicStringImpl.h:
1929         (WebCore::AtomicStringImpl::AtomicStringImpl): Provide a default constructor.
1930         * wtf/text/StringImpl.h: Allow AtomicStringImpl to call a StringImpl constructor through a friend declaration.
1931
1932 2010-04-27  Stephanie Lewis  <slewis@apple.com>
1933
1934         Fix Tiger build.
1935
1936         * wtf/FastMalloc.cpp:
1937         (WTF::TCMalloc_PageHeap::Carve):
1938
1939 2010-04-26  Stephanie Lewis  <slewis@apple.com>
1940
1941         Reviewed by Geoff Garen.
1942
1943         https://bugs.webkit.org/show_bug.cgi?id=38154 FastMalloc calls madvise too often.
1944         <rdar://problem/7834433> REGRESSSION: 1.5% PLT regression due to 56028 (return memory quicker).  
1945         To save on madvise calls when recommitting memory recommit the entire span and then carve it
1946         instead of carving the span up and only committing the part that will be used immediately.
1947
1948         * wtf/FastMalloc.cpp:
1949         (WTF::TCMalloc_PageHeap::New):
1950         (WTF::TCMalloc_PageHeap::AllocLarge):
1951         (WTF::TCMalloc_PageHeap::Carve):
1952
1953 2010-04-26  Oliver Hunt  <oliver@apple.com>
1954
1955         Reviewed by Maciej Stachowiak.
1956
1957         Add specialized thunks for a char code related string functions
1958         https://bugs.webkit.org/show_bug.cgi?id=38177
1959
1960         This is a simple extension to my prior patch.  Basically hoist the
1961         existing character loading logic from the charCodeAt thunk and into
1962         a helper function, then add a helper to load strings from the small
1963         string cache.  This allows trivial implementations of fromCharCode
1964         and charAt. 
1965
1966         * create_hash_table:
1967         * jit/SpecializedThunkJIT.h:
1968         (JSC::SpecializedThunkJIT::returnJSCell):
1969         (JSC::SpecializedThunkJIT::tagReturnAsJSCell):
1970         * jit/ThunkGenerators.cpp:
1971         (JSC::stringCharLoad):
1972         (JSC::charToString):
1973         (JSC::charCodeAtThunkGenerator):
1974         (JSC::charAtThunkGenerator):
1975         (JSC::fromCharCodeThunkGenerator):
1976         * jit/ThunkGenerators.h:
1977         * runtime/SmallStrings.h:
1978         (JSC::SmallStrings::singleCharacterStrings):
1979         * runtime/StringConstructor.cpp:
1980         (JSC::StringConstructor::StringConstructor):
1981
1982 2010-04-27  Thomas Zander <t.zander@nokia.com>
1983
1984         Reviewed by Simon Hausmann.
1985
1986         [Qt] Fix the build on Symbian on Linux using the Makefile based mkspec
1987
1988         * JavaScriptCore.pri: It is necessary to specify the library search path
1989         when linking against JavaScriptCore.
1990
1991 2010-04-21  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
1992
1993         Reviewed by Simon Hausmann.
1994
1995         Compile fix for Visual Studio 2010
1996         https://bugs.webkit.org/show_bug.cgi?id=37867
1997
1998         Patch by Prasanth Ullattil <prasanth.ullattil@nokia.com>
1999
2000         * runtime/Structure.cpp:
2001         (JSC::Structure::transitionTableAdd):
2002         * wtf/MathExtras.h:
2003         * wtf/Platform.h:
2004
2005 2010-04-27  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
2006
2007         Reviewed by Simon Hausmann.
2008
2009         Rename COMPILER(MSVC7) to COMPILER(MSVC7_OR_LOWER)
2010
2011         * config.h:
2012         (JSC::Structure::transitionTableAdd):
2013         * wtf/Assertions.h:
2014         * wtf/Atomics.h:
2015         * wtf/CurrentTime.h:
2016         (WTF::getLocalTime):
2017         * wtf/Platform.h:
2018         * wtf/StaticConstructors.h:
2019         * wtf/StringExtras.h:
2020         * wtf/Vector.h:
2021         (WTF::::append):
2022
2023 2010-04-15  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
2024
2025         Reviewed by Tor Arne Vestbø.
2026
2027         [Qt] Fix Mac build break.
2028
2029         https://bugs.webkit.org/show_bug.cgi?id=37867
2030         - Make sure JavaScriptCore's debug_and_release config follows that
2031           of WebCore.
2032         - Use different name for JavaScriptCore target in debug and release
2033           since they might be written in the same path at the same time on
2034           parallel builds
2035         - Consolidate the DESTDIR determination logic in JavaScriptCore.pri
2036
2037         * JavaScriptCore.pri:
2038         * JavaScriptCore.pro:
2039
2040 2010-04-21  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
2041
2042         Reviewed by Kenneth Rohde Christiansen.
2043
2044         [Qt] Make sure WebKit is not compiled using C++0x.
2045         https://bugs.webkit.org/show_bug.cgi?id=37867
2046
2047         As the rest of Qt compiles in the C++0x mode, people might start
2048         compiling it in this mode. WebKit don't support this yet.
2049
2050         Patch by Thiago Macieira <thiago.macieira@nokia.com>
2051
2052         * JavaScriptCore.pro:
2053
2054 2010-04-26  Oliver Hunt  <oliver@apple.com>
2055
2056         Fix windows
2057
2058         * jit/SpecializedThunkJIT.h:
2059         (JSC::SpecializedThunkJIT::argumentToVirtualRegister):
2060
2061 2010-04-26  Oliver Hunt  <oliver@apple.com>
2062
2063         Reviewed by Gavin Barraclough.
2064
2065         Need to support more efficient dispatch of lightweight builtins
2066         https://bugs.webkit.org/show_bug.cgi?id=38155
2067
2068         The problem with calling lightweight builtins is that marshalling
2069         the call from the nitro calling convention to the system calling
2070         convention is very expensive relative to the cost of the actually
2071         evaluating the function.  To work around this problem this patch
2072         adds the ability to define a custom thunk for a builtin.
2073
2074         This allows us to use high performance custom implementations of
2075         the common and sensible versions of simple builtins.  This patch
2076         includes a simple (use of which is currently hardcoded) thunk for
2077         charCodeAt.
2078
2079         This adds a JSInterfaceJIT subclass called SpecializedThunkJIT
2080         that has helper functions to remove (or at least reduce) the need
2081         to have separate thunk implementations for each JSValue encoding.
2082
2083         * GNUmakefile.am:
2084         * JavaScriptCore.pro:
2085         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2086         * JavaScriptCore.xcodeproj/project.pbxproj:
2087           Many project file updates
2088
2089         * create_hash_table:
2090           Add thunk generation callbacks to the hash tables, currently
2091           we hardcode the script to only support charCodeAt
2092
2093         * jit/JITStubCall.h:
2094         * jit/JITStubs.cpp:
2095         (JSC::JITThunks::~JITThunks):
2096         (JSC::JITThunks::specializedThunk):
2097         * jit/JITStubs.h:
2098         * jit/SpecializedThunkJIT.h: Added.
2099         (JSC::SpecializedThunkJIT::SpecializedThunkJIT):
2100         (JSC::SpecializedThunkJIT::loadCellArgument):
2101         (JSC::SpecializedThunkJIT::loadJSStringArgument):
2102         (JSC::SpecializedThunkJIT::loadInt32Argument):
2103         (JSC::SpecializedThunkJIT::appendFailure):
2104         (JSC::SpecializedThunkJIT::returnInt32):
2105         (JSC::SpecializedThunkJIT::finalize):
2106         (JSC::SpecializedThunkJIT::argumentToVirtualRegister):
2107         (JSC::SpecializedThunkJIT::tagReturnAsInt32):
2108         * jit/ThunkGenerators.cpp: Added.
2109         (JSC::ThunkHelpers::stringImplDataOffset):
2110         (JSC::ThunkHelpers::jsStringLengthOffset):
2111         (JSC::ThunkHelpers::jsStringValueOffset):
2112         (JSC::charCodeAtThunkGenerator):
2113         * jit/ThunkGenerators.h: Added.
2114         * runtime/Executable.h:
2115         (JSC::NativeExecutable::NativeExecutable):
2116         * runtime/JSFunction.cpp:
2117         (JSC::JSFunction::JSFunction):
2118         * runtime/JSFunction.h:
2119         * runtime/JSGlobalData.h:
2120         (JSC::JSGlobalData::getThunk):
2121         * runtime/JSString.h:
2122         (JSC::):
2123         * runtime/JSValue.h:
2124           Protect some of the JSVALUE32 and JSVALUE32_64 only constants
2125           and function behind appropriate USE() guards to make it harder
2126           to use the wrong flags for the target build.
2127         * runtime/Lookup.cpp:
2128         (JSC::HashTable::createTable):
2129         (JSC::setUpStaticFunctionSlot):
2130         * runtime/Lookup.h:
2131         (JSC::HashEntry::initialize):
2132         (JSC::HashEntry::generator):
2133         (JSC::HashEntry::):
2134           Make the lookup tables use a specialized thunkGenerator
2135           if present
2136         * wtf/text/StringImpl.h:
2137
2138 2010-04-26  Oliver Hunt  <oliver@apple.com>
2139
2140         Build fix
2141
2142         * runtime/JSImmediate.h:
2143         * runtime/JSValue.h:
2144
2145 2010-04-26  Oliver Hunt  <oliver@apple.com>
2146
2147         Reviewed by Gavin Barraclough.
2148
2149         Factor some basic JS interface logic out of JIT and into a superclass
2150         https://bugs.webkit.org/show_bug.cgi?id=38163
2151
2152         Create JSInterfaceJIT to hold some common low level functions for
2153         interacting with the JS RegisterFile.  Doing this separately from
2154         https://bugs.webkit.org/show_bug.cgi?id=38155 to ease reviewing.
2155
2156         * JavaScriptCore.xcodeproj/project.pbxproj:
2157         * jit/JIT.h:
2158         * jit/JITInlineMethods.h:
2159         (JSC::JIT::emitJumpSlowCaseIfNotJSCell):
2160         * jit/JSInterfaceJIT.h: Added.
2161         (JSC::JSInterfaceJIT::emitLoadJSCell):
2162         (JSC::JSInterfaceJIT::emitJumpIfNotJSCell):
2163         (JSC::JSInterfaceJIT::emitLoadInt32):
2164         (JSC::JSInterfaceJIT::tagFor):
2165         (JSC::JSInterfaceJIT::payloadFor):
2166         (JSC::JSInterfaceJIT::addressFor):
2167
2168 2010-04-26  Sam Weinig  <sam@webkit.org>
2169
2170         Fix Tiger build.
2171
2172         * wtf/mac/MainThreadMac.mm:
2173         (WTF::isMainThread):
2174
2175 2010-04-26  Geoffrey Garen  <ggaren@apple.com>
2176
2177         Reviewed by Sam Weinig.
2178
2179         <rdar://problem/7766413>
2180         
2181         Fixed a crash seen when using the JavaScriptCore API with WebKit.
2182         
2183         No layout test because DumpRenderTree doesn't use the JavaScriptCore API
2184         in this way.
2185
2186         * interpreter/RegisterFile.cpp:
2187         (JSC::RegisterFile::setGlobalObject):
2188         (JSC::RegisterFile::clearGlobalObject):
2189         (JSC::RegisterFile::globalObject):
2190         * interpreter/RegisterFile.h:
2191         (JSC::RegisterFile::RegisterFile): Use WeakGCPtr for managing m_globalObject,
2192         since it's a weak pointer. (We never noticed this error before because,
2193         in WebKit, global objects always have a self-reference in a global variable,
2194         so marking the register file's global variables would keep m_globalObject
2195         alive. In the JavaScriptCore API, you can allocate a global object with
2196         no self-reference.)
2197
2198         * runtime/JSActivation.h: Removed unneeded #include.
2199
2200         * runtime/JSGlobalObject.cpp:
2201         (JSC::JSGlobalObject::~JSGlobalObject): Don't use ==, since a weak
2202         pointer is 0 when the object it points to runs its destructor.
2203
2204         * runtime/WeakGCPtr.h:
2205         (JSC::WeakGCPtr::clear): Changed to return a bool indicating whether the
2206         clear actually happened.
2207         (JSC::WeakGCPtr::assign): Changed to forbid assignment of 0 as a shorthand
2208         for calling clear(). A client should never clear by assigning 0, since
2209         clear() should be conditional on whether the object doing the clearing
2210         is still pointed to by the weak pointer. (Otherwise, a zombie object might
2211         clear a pointer to a new, valid object.)
2212
2213 2010-04-25  Sam Weinig  <sam@webkit.org>
2214
2215         Reviewed by Maciej Stachowiak.
2216
2217         Fix for https://bugs.webkit.org/show_bug.cgi?id=38097
2218         Disentangle initializing the main thread from initializing threading
2219
2220         This is the first step in getting rid of the WEB_THREAD #define and
2221         paving the way to allowing mac both WebKit and WebKit2 to use the same
2222         WebCore.
2223
2224         * JavaScriptCore.exp: Export initializeMainThread and initializeMainThreadToProcessMainThread.
2225         * JavaScriptCore.xcodeproj/project.pbxproj: Sort files.
2226
2227         * wtf/MainThread.cpp:
2228         (WTF::mainThreadInitializationMutex):
2229         (WTF::mainThreadFunctionQueueMutex):
2230         (WTF::initializeMainThread):
2231         (WTF::deprecatedInitializeMainThread):
2232         * wtf/MainThread.h:
2233         Added Mac only initializeMainThreadToProcessMainThread which sets up callOnMainThread
2234         and isMainThead calls to assume that WebCore's main thread is also the
2235         process's main thread. Since it is possible that both initializeMainThread
2236         and initializeMainThreadToProcessMainThread could be called, the first one called
2237         wins (either will work).
2238
2239         * wtf/Threading.h: Moved to top of file.
2240
2241         * wtf/ThreadingPthreads.cpp:
2242         (WTF::initializeThreading): Remove call to initializeMainThread.
2243         * wtf/ThreadingWin.cpp:
2244         (WTF::initializeThreading): Ditto.
2245         * wtf/gtk/ThreadingGtk.cpp:
2246         (WTF::initializeThreading): Ditto.
2247
2248         * wtf/mac/MainThreadMac.mm:
2249         (WTF::initializeMainThreadPlatform):
2250         (WTF::initializeMainThreadToProcessMainThread):
2251         (WTF::scheduleDispatchFunctionsOnMainThread):
2252         (WTF::isMainThread):
2253         Add runtime switch between the old behavior of using the system's main
2254         thread and a stored pointer to the main thread. Tiger always uses the
2255         system's main thread.
2256
2257         * wtf/qt/ThreadingQt.cpp:
2258         (WTF::initializeThreading): Remove call to initializeMainThread.
2259         * wtf/win/MainThreadWin.cpp:
2260         (WTF::initializeMainThreadPlatform): Add call to initializeCurrentThreadInternal
2261         removed from initializeThreading.
2262
2263 2010-04-26  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
2264
2265         Reviewed by Kenneth Rohde Christiansen.
2266
2267         Fix a memory leak in the QScriptString.
2268
2269         QScriptStringPrivate's constructor shouldn't call JSStringRetain as
2270         QScriptConverter implicitly pass a JSStringRef ownership.
2271
2272         [Qt] QScriptStringPrivate c'tor problem
2273         https://bugs.webkit.org/show_bug.cgi?id=38110
2274
2275         * qt/api/qscriptstring_p.h:
2276         (QScriptStringPrivate::QScriptStringPrivate):
2277
2278 2010-04-24  Darin Adler  <darin@apple.com>
2279
2280         Reviewed by Dan Bernstein.
2281
2282         REGRESSION (r56560): Crash in parseFloat if passed invalid UTF-16 data
2283         https://bugs.webkit.org/show_bug.cgi?id=38083
2284         rdar://problem/7901044
2285
2286         Tests: fast/js/ToNumber.html
2287                fast/js/parseFloat.html
2288
2289         * runtime/JSGlobalObjectFunctions.cpp:
2290         (JSC::parseInt): Added a FIXME comment about a problem I noticed.
2291         (JSC::parseFloat): Added a FIXME comment about a problem I noticed;
2292         covered by test cases in the test I added.
2293         * runtime/UString.cpp:
2294         (JSC::UString::toDouble): Added FIXME comments about two problems I
2295         noticed; covered by test cases in the tests I added. Added a return
2296         statement so we don't crash when illegal UTF-16 sequences are present.
2297
2298 2010-04-24  Anton Muhin  <antonm@chromium.org>
2299
2300         Reviewed by Darin Adler.
2301
2302         Allow to construct HashTraits<WebCore::QualifiedName>::constructDeletedValue
2303
2304         Former implementation attempted to use AtomicString(HashTableDeletedValue)
2305         however those values cannot be used that way: one cannot construct
2306         QualifiedNameImpl out of such AtomicString as we'll try to lookup this string
2307         in the table, for example.
2308         https://bugs.webkit.org/show_bug.cgi?id=37722
2309
2310         * wtf/RefPtr.h: expose hash table deleted value
2311
2312 2010-04-23  Sam Weinig  <sam@webkit.org>
2313
2314         Reviewed by David Levin.
2315
2316         Fix for https://bugs.webkit.org/show_bug.cgi?id=38060
2317         Split up Threading.h
2318
2319         Move bits for of Threading.h into 3 new files.
2320         - Atomics.h for atomic operations.
2321         - ThreadSafeShared.h for the ThreadSafeShared class.
2322         - ThreadingPrimitives.h for the primitives and platform types.
2323
2324         Basic threading operations (creation, etc.) remain in Threading.h.
2325
2326         * GNUmakefile.am:
2327         * JavaScriptCore.gypi:
2328         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
2329         * JavaScriptCore.xcodeproj/project.pbxproj:
2330         * wtf/Atomics.h: Copied from wtf/Threading.h.
2331         * wtf/ThreadSafeShared.h: Copied from wtf/Threading.h.
2332         * wtf/Threading.h:
2333         * wtf/ThreadingPrimitives.h: Copied from wtf/Threading.h.
2334
2335 2010-04-23  Sam Weinig  <sam@webkit.org>
2336
2337         Fix Qt build.
2338
2339         * wtf/qt/MainThreadQt.cpp: #include <QThread>
2340
2341 2010-04-22  Sam Weinig  <sam@webkit.org>
2342
2343         Reviewed by Anders Carlsson.
2344
2345         Fix for https://bugs.webkit.org/show_bug.cgi?id=38022
2346         Move isMainThread predicate function to MainThread.h
2347
2348         * wtf/MainThread.cpp:
2349         (WTF::initializeMainThread):
2350         (WTF::isMainThread):
2351         * wtf/MainThread.h:
2352         * wtf/Threading.h:
2353         * wtf/ThreadingPthreads.cpp:
2354         (WTF::initializeThreading):
2355         * wtf/ThreadingWin.cpp:
2356         (WTF::initializeThreading):
2357         * wtf/gtk/ThreadingGtk.cpp:
2358         (WTF::initializeThreading):
2359         * wtf/mac/MainThreadMac.mm:
2360         (WTF::initializeMainThreadPlatform):
2361         (WTF::isMainThread):
2362         * wtf/qt/MainThreadQt.cpp:
2363         (WTF::isMainThread):
2364         * wtf/qt/ThreadingQt.cpp:
2365         (WTF::initializeThreading):
2366         * wtf/text/AtomicString.cpp:
2367
2368 2010-04-23  Gabor Rapcsanyi  <rgabor@inf.u-szeged.hu>
2369
2370         Reviewed by Laszlo Gombos.
2371
2372         Add RVCT support for Linux
2373
2374         Developed in cooperation with Gabor Loki.
2375
2376         * API/JSStringRef.h:
2377         * jit/ExecutableAllocator.h:
2378         * jit/ExecutableAllocatorPosix.cpp:
2379         (JSC::ExecutableAllocator::cacheFlush):
2380         * jit/JITStubs.cpp:
2381         * wtf/MathExtras.h:
2382         * wtf/unicode/qt4/UnicodeQt4.h:
2383
2384 2010-04-23  Patrick Gansterer  <paroga@paroga.com>
2385
2386         Reviewed by Laszlo Gombos.
2387
2388         [WIN] Move OwnPtrWin.cpp into platform specific folder.
2389         https://bugs.webkit.org/show_bug.cgi?id=38042
2390
2391         * JavaScriptCore.gypi:
2392         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
2393         * wtf/OwnPtrWin.cpp: Removed.
2394         * wtf/win/OwnPtrWin.cpp: Copied from JavaScriptCore/wtf/OwnPtrWin.cpp.
2395
2396 2010-04-23  Patrick Gansterer  <paroga@paroga.com>
2397
2398         Reviewed by Laszlo Gombos.
2399
2400         [BREWMP] Move OwnPtrBrew.cpp into platform specific folder.
2401         https://bugs.webkit.org/show_bug.cgi?id=38042
2402
2403         * wtf/OwnPtrBrew.cpp: Removed.
2404         * wtf/brew/OwnPtrBrew.cpp: Copied from JavaScriptCore/wtf/OwnPtrBrew.cpp.
2405
2406 2010-04-22  Steve Block  <steveblock@google.com>
2407
2408         Reviewed by Adam Barth.
2409
2410         Update Android to use isfinite, isinf, isnan and signbit from namespace std.
2411         https://bugs.webkit.org/show_bug.cgi?id=37948
2412
2413         * wtf/MathExtras.h:
2414
2415 2010-04-22  Fumitoshi Ukai  <ukai@chromium.org>
2416
2417         Unreviewed build fix.
2418
2419         * wtf/MD5.cpp: fix include path of CString.h
2420
2421 2010-04-22  Fumitoshi Ukai  <ukai@chromium.org>
2422
2423         Reviewed by Adam Barth.
2424
2425         MD5 is required for WebSocket new protocol implementation
2426         https://bugs.webkit.org/show_bug.cgi?id=37913
2427
2428         * GNUmakefile.am:
2429         * JavaScriptCore.exp:
2430         * JavaScriptCore.gypi:
2431         * JavaScriptCore.pro:
2432         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2433         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
2434         * JavaScriptCore.xcodeproj/project.pbxproj:
2435         * wtf/MD5.cpp: Added.
2436         * wtf/MD5.h: Added.
2437
2438 2010-04-22  Gavin Barraclough  <barraclough@apple.com>
2439
2440         Reviewed by NOBODY (build fix).
2441         Errk, accidentally committed commenting out two ASSERTs! reverting.
2442
2443         * runtime/Collector.cpp:
2444         (JSC::Heap::protect):
2445         (JSC::Heap::unprotect):
2446
2447 2010-04-22  Gavin Barraclough  <barraclough@apple.com>
2448
2449         Reviewed by Geoff Garen.
2450
2451         https://bugs.webkit.org/show_bug.cgi?id=38006
2452         Change lifetime of JSC::IdentifierTables used by WebCores to match AtomicStringTable
2453
2454         Presently JSC's IdentifierTables are owned by the JSGlobalData.  For
2455         JSGlobalData objects created via the API this should continue to be the case,
2456         but for the JSGlobalData objects used by WebCore (the main thread's common
2457         global data, and those for workers) use a IdentifierTable provided (and owned)
2458         by wtfThreadData.  This allow the lifetime of these IdentifierTable to match
2459         those of the corresponding AtomicStringTables.
2460
2461         * API/APIShims.h:
2462         (JSC::APIEntryShim::APIEntryShim):
2463         * API/JSContextRef.cpp:
2464         (JSContextGroupCreate):
2465         * runtime/Collector.cpp:
2466         (JSC::Heap::protect):
2467         (JSC::Heap::unprotect):
2468         (JSC::Heap::markRoots):
2469         * runtime/JSGlobalData.cpp:
2470         (JSC::JSGlobalData::JSGlobalData):
2471         (JSC::JSGlobalData::~JSGlobalData):
2472         (JSC::JSGlobalData::createContextGroup):
2473         (JSC::JSGlobalData::create):
2474         (JSC::JSGlobalData::sharedInstance):
2475         * runtime/JSGlobalData.h:
2476         (JSC::JSGlobalData::):
2477         (JSC::JSGlobalData::isSharedInstance):
2478         * runtime/JSLock.cpp:
2479         (JSC::JSLock::JSLock):
2480         (JSC::JSLock::lock):
2481         (JSC::JSLock::unlock):
2482         (JSC::JSLock::DropAllLocks::DropAllLocks):
2483         * wtf/WTFThreadData.cpp:
2484         (WTF::WTFThreadData::WTFThreadData):
2485         (WTF::WTFThreadData::~WTFThreadData):
2486
2487 2010-04-22  Sheriff Bot  <webkit.review.bot@gmail.com>
2488
2489         Unreviewed, rolling out r58110.
2490         http://trac.webkit.org/changeset/58110
2491         https://bugs.webkit.org/show_bug.cgi?id=38007
2492
2493         Caused an internal compiler error on Qt (Requested by abarth
2494         on #webkit).
2495
2496         * wtf/MathExtras.h:
2497
2498 2010-04-22  Gavin Barraclough  <barraclough@apple.com>
2499
2500         Reviewed by NOBODY (windows build fix).
2501
2502         * API/JSWeakObjectMapRefPrivate.cpp:
2503
2504 2010-04-22  Gavin Barraclough  <barraclough@apple.com>
2505
2506         Reviewed by NOBODY (windows build fix).
2507
2508         * API/JSBase.cpp:
2509         * API/JSCallbackObject.cpp:
2510
2511 2010-04-22  Gavin Barraclough  <barraclough@apple.com>
2512
2513         Reviewed by Geoff Garen.
2514
2515         https://bugs.webkit.org/show_bug.cgi?id=37978
2516         Unify JSC::IdentifierTable and WebCore::AtomicStringTable implementations.
2517
2518         These two classes both implement a HashSet of uniqued StringImpls, with
2519         translator classes to avoid unnecessary object creation. The only difference
2520         between the classes is which flag (isIdentifier or inTable) is set.
2521         Combine the two classes using a template predicated on which flag to use.
2522
2523         New class AtomicStringTable created, containing all the goodness from
2524         IdentifierTable & AtomicStringTable, expect for Identifier's literalTable,
2525         which has been moved onto JSGlobalData. Removed duplicate string translator
2526         classes. Renamed StringImpl's inTable flag to more explicit 'isAtomic',
2527         and set this on the empty string (which matches Identifier behaviour, and
2528         removes a redundant check for zero-length).
2529
2530         * GNUmakefile.am:
2531         * JavaScriptCore.gypi:
2532         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
2533         * JavaScriptCore.xcodeproj/project.pbxproj:
2534         * runtime/Identifier.cpp:
2535         (JSC::createLiteralTable):
2536         (JSC::deleteLiteralTable):
2537         (JSC::Identifier::add):
2538         (JSC::Identifier::addSlowCase):
2539         * runtime/Identifier.h:
2540         * runtime/JSGlobalData.cpp:
2541         (JSC::JSGlobalData::JSGlobalData):
2542         (JSC::JSGlobalData::~JSGlobalData):
2543         * runtime/JSGlobalData.h:
2544         * wtf/WTFThreadData.cpp:
2545         (WTF::WTFThreadData::WTFThreadData):
2546         (WTF::WTFThreadData::~WTFThreadData):
2547         * wtf/WTFThreadData.h:
2548         (WTF::WTFThreadData::atomicStringTable):
2549         * wtf/text/AtomicString.cpp:
2550         (WebCore::table):
2551         (WebCore::operator==):
2552         (WebCore::AtomicString::add):
2553         (WebCore::AtomicString::find):
2554         (WebCore::AtomicString::remove):
2555         * wtf/text/AtomicStringTable.h: Added.
2556         (WTF::CStringTranslator::hash):
2557         (WTF::CStringTranslator::equal):
2558         (WTF::CStringTranslator::translate):
2559         (WTF::UCharBufferTranslator::hash):
2560         (WTF::UCharBufferTranslator::equal):
2561         (WTF::UCharBufferTranslator::translate):
2562         (WTF::HashAndCharactersTranslator::hash):
2563         (WTF::HashAndCharactersTranslator::equal):
2564         (WTF::HashAndCharactersTranslator::translate):
2565         (WTF::IdentifierOrAtomicStringTable::remove):
2566         (WTF::::~IdentifierOrAtomicStringTable):
2567         (WTF::::add):
2568         (WTF::::find):
2569         * wtf/text/StringImpl.cpp:
2570         (WebCore::StringImpl::~StringImpl):
2571         * wtf/text/StringImpl.h:
2572         (WebCore::StringImpl::isAtomic):
2573         (WebCore::StringImpl::setIsAtomic):
2574         (WebCore::equal):
2575         * wtf/text/StringImplBase.h:
2576         (WTF::StringImplBase::StringImplBase):
2577
2578 2010-04-22  Steve Block  <steveblock@google.com>
2579
2580         Reviewed by Adam Barth.
2581
2582         Update Android to use isfinite, isinf, isnan and signbit from namespace std.
2583         https://bugs.webkit.org/show_bug.cgi?id=37948
2584
2585         * wtf/MathExtras.h:
2586
2587 2010-04-22  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
2588
2589         Reviewed by Kenneth Rohde Christiansen.
2590
2591         [Qt] Remove dependency of JSC to QtGui
2592         https://bugs.webkit.org/show_bug.cgi?id=37867
2593
2594         The patch also make sure that hal.h is in the include path on Symbian.
2595         The dependency to QtGui took care of that before.
2596
2597         Patch by Thiago Macieira <thiago.macieira@nokia.com>
2598              and Rohan McGovern <rohan.mcgovern@nokia.com>
2599
2600         * JavaScriptCore.pri:
2601         * JavaScriptCore.pro:
2602
2603 2010-04-22  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
2604
2605         Reviewed by Tor Arne Vestbø.
2606
2607         [Qt] Corrects symbols visibility for JavaScriptCore.
2608
2609         https://bugs.webkit.org/show_bug.cgi?id=37867
2610
2611         * JavaScriptCore.pro:
2612
2613 2010-04-22  Gabor Loki  <loki@webkit.org>
2614
2615         Reviewed by Gavin Barraclough.
2616
2617         Use BLX and BX to keep happy the return stack predictor above ARMv4
2618         https://bugs.webkit.org/show_bug.cgi?id=37862
2619
2620         Inspired by Jacob Bramley's patch from JaegerMonkey
2621
2622         * assembler/ARMAssembler.cpp:
2623         (JSC::ARMAssembler::executableCopy):
2624         * assembler/ARMAssembler.h:
2625         (JSC::ARMAssembler::):
2626         (JSC::ARMAssembler::bx):
2627         (JSC::ARMAssembler::blx):
2628         (JSC::ARMAssembler::loadBranchTarget):
2629         (JSC::ARMAssembler::jmp):
2630         (JSC::ARMAssembler::getLdrImmAddress):
2631         * assembler/MacroAssemblerARM.h:
2632         (JSC::MacroAssemblerARM::jump):
2633         (JSC::MacroAssemblerARM::nearCall):
2634         (JSC::MacroAssemblerARM::call):
2635         (JSC::MacroAssemblerARM::ret):
2636         (JSC::MacroAssemblerARM::prepareCall):
2637         (JSC::MacroAssemblerARM::call32):
2638
2639 2010-04-21  Andy Estes  <aestes@apple.com>
2640
2641         Rubber stamped by Mark Rowe.
2642
2643         Export WTF::deleteOwnedPtr(HFONT).
2644
2645         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2646
2647 2010-04-21  Gavin Barraclough  <barraclough@apple.com>
2648
2649         Rubber Stamped by Oliver Hunt.
2650
2651         Make SmallStrings store an array of RefPtr<StringImpl>,
2652         instead of a direct array of StringImpls.  This allows
2653         us to remove a friend (and a layering violation) from
2654         WTF::StringImpl, and makes it so that all StringImpls
2655         are individually heap allocated.
2656
2657         * runtime/SmallStrings.cpp:
2658         (JSC::SmallStringsStorage::rep):
2659         (JSC::SmallStringsStorage::SmallStringsStorage):
2660         * wtf/text/StringImpl.h:
2661
2662 2010-04-21  Sam Weinig  <sam@webkit.org>
2663
2664         Reviewed by Geoffrey Garen.
2665
2666         Fix for https://bugs.webkit.org/show_bug.cgi?id=37937
2667         Wean JavaScriptCore off calls to isMainThread()
2668
2669         - Replace use of isMainThread() for interpreter reentry checks
2670           with a stored value on the JSGlobalData.
2671         - Replace use of isMainThread() for useMainThread only check in the
2672           collector with a stored exclusive thread.
2673
2674         * API/JSContextRef.cpp:
2675         (JSContextGroupCreate):
2676         Always default to a small stack type for uses of the JSC API. It is
2677         unlikely that the interpreter reentry required on the web will be as
2678         important for other uses of JavaScriptCore. 
2679
2680         * JavaScriptCore.exp: 
2681         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2682         Update exports.
2683
2684         * interpreter/Interpreter.cpp:
2685         (JSC::Interpreter::execute):
2686         (JSC::Interpreter::prepareForRepeatCall):
2687         Use new stored JSGlobalData::maxReentryDepth instead of isMainThread().
2688
2689         * interpreter/Interpreter.h:
2690         Rename MaxMainThreadReentryDepth to MaxLargeThreadReentryDepth and 
2691         MaxSecondaryThreadReentryDepth to MaxSmallThreadReentryDepth.
2692
2693         * jsc.cpp:
2694         (main): Use the a large stack for jsc since it is always using the
2695         main thread.
2696         
2697         * runtime/ArrayPrototype.cpp:
2698         (JSC::arrayProtoFuncToString):
2699         (JSC::arrayProtoFuncToLocaleString):
2700         (JSC::arrayProtoFuncJoin):
2701         Use new stored JSGlobalData::maxReentryDepth instead of isMainThread().
2702
2703         * runtime/Collector.cpp:
2704         (JSC::Heap::registerThread):
2705         Use the concept of making JSC run on an exclusiveThread instead of
2706         forcing a mainThreadOnly assertion.
2707         
2708         * runtime/JSGlobalData.cpp:
2709         (JSC::JSGlobalData::JSGlobalData):
2710         (JSC::JSGlobalData::createNonDefault):
2711         (JSC::JSGlobalData::create):
2712         (JSC::JSGlobalData::createLeaked):
2713         (JSC::JSGlobalData::sharedInstance):
2714         * runtime/JSGlobalData.h:
2715         Add ThreadStackType argument to JSGlobalData constructors and set
2716         maxReentryDepth based on it.
2717
2718 2010-04-21  Gavin Barraclough  <barraclough@apple.com>
2719
2720         Reviewed by NOBODY (windows build fix pt. 3).
2721
2722         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2723
2724 2010-04-21  Gavin Barraclough  <barraclough@apple.com>
2725
2726         Reviewed by NOBODY (windows build fix pt. 2).
2727
2728         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2729
2730 2010-04-21  Gavin Barraclough  <barraclough@apple.com>
2731
2732         Reviewed by NOBODY (Qt build fix).
2733
2734         * JavaScriptCore.gypi:
2735         * JavaScriptCore.pro:
2736         * wtf/qt/StringQt.cpp: Copied from WebCore/platform/text/qt/StringQt.cpp.
2737
2738 2010-04-21  Gavin Barraclough  <barraclough@apple.com>
2739
2740         Reviewed by NOBODY (windows build fix).
2741
2742         * API/JSValueRef.cpp:
2743         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2744         * runtime/Identifier.cpp:
2745         (JSC::IdentifierTable::~IdentifierTable):
2746         (JSC::IdentifierTable::add):
2747         * runtime/Identifier.h:
2748         * wtf/WTFThreadData.h:
2749         (JSC::IdentifierTable::remove):
2750         (JSC::IdentifierTable::literalTable):
2751         * wtf/text/StringImpl.cpp:
2752         (WebCore::StringImpl::~StringImpl):
2753
2754 2010-04-20  Gavin Barraclough  <barraclough@apple.com>
2755
2756         Reviewed by Oliver Hunt, Darin Adler.
2757
2758         Bug 37906 - Remove JSC::UStringImpl; unify with StringImpl.
2759
2760         JSC::UStringImpl and WebCore::StringImpl (soon to be renamed to
2761         WTF::StringImpl) are almost identical.  Remove duplication of code by unifying
2762         the two, move missing features from UStringImpl into StringImpl & delete the
2763         class UStringImpl.
2764
2765         * API/JSClassRef.cpp:
2766         * API/JSContextRef.cpp:
2767         * GNUmakefile.am:
2768         * JavaScriptCore.exp:
2769         * JavaScriptCore.pro:
2770         * JavaScriptCore.xcodeproj/project.pbxproj:
2771         * bytecode/EvalCodeCache.h:
2772         * bytecode/JumpTable.cpp:
2773         * profiler/ProfileNode.cpp:
2774         * runtime/Identifier.cpp:
2775         (JSC::Identifier::add):
2776         * runtime/Identifier.h:
2777         (JSC::Identifier::equal):
2778         * runtime/UString.cpp:
2779         * runtime/UString.h:
2780         (WTF::):
2781         * runtime/UStringImpl.cpp: Removed.
2782         * runtime/UStringImpl.h:
2783         * wtf/text/StringHash.h:
2784         (WebCore::StringHash::equal):
2785         (WebCore::CaseFoldingHash::equal):
2786         * wtf/text/StringImpl.cpp:
2787         (WebCore::StringImpl::~StringImpl):
2788         (WebCore::StringImpl::empty):
2789         (WebCore::StringImpl::sharedBuffer):
2790         (WebCore::equal):
2791         * wtf/text/StringImpl.h:
2792         (WebCore::StringImpl::StringImpl):
2793         (WebCore::StringImpl::create):
2794         (WebCore::StringImpl::tryCreateUninitialized):
2795         (WebCore::StringImpl::cost):
2796         (WebCore::StringImpl::isIdentifier):
2797         (WebCore::StringImpl::setIsIdentifier):
2798         (WebCore::StringImpl::computeHash):
2799         (WebCore::StringImpl::copyChars):
2800         (WebCore::StringImpl::):
2801
2802 2010-04-21  Patrick Gansterer  <paroga@paroga.com>
2803
2804         Reviewed by Darin Adler.
2805
2806         Added missing #include "Lookup.h" in LUT source files.
2807         https://bugs.webkit.org/show_bug.cgi?id=37903
2808
2809         * runtime/ArrayPrototype.cpp:
2810         * runtime/DatePrototype.cpp:
2811         * runtime/JSONObject.cpp:
2812         * runtime/MathObject.cpp:
2813         * runtime/NumberConstructor.cpp:
2814         * runtime/RegExpConstructor.cpp:
2815         * runtime/RegExpObject.cpp:
2816         * runtime/StringPrototype.cpp:
2817
2818 2010-04-21  Gustavo Sverzut Barbieri  <barbieri@profusion.mobi>
2819
2820         Reviewed by Nikolas Zimmermann.
2821
2822         Add missing EFL JavaScriptCore file.
2823         http://webkit.org/b/37854
2824
2825         * wtf/efl: Added.
2826         * wtf/efl/MainThreadEfl.cpp: Added.
2827         (WTF::initializeMainThreadPlatform):
2828         (WTF::timeoutFired):
2829         (WTF::scheduleDispatchFunctionsOnMainThread):
2830
2831 2010-04-20  Xan Lopez  <xlopez@igalia.com>
2832
2833         Another attempt to fix the build.
2834
2835         * GNUmakefile.am:
2836
2837 2010-04-20  Oliver Hunt  <oliver@apple.com>
2838
2839         Reviewed by Maciej Stachowiak.
2840
2841         [ES5] RegExp literals are constants that should be persistent across multiple function calls.
2842         https://bugs.webkit.org/show_bug.cgi?id=37908
2843
2844         Dump the separate RegExp constant pool, and just use the standard JS constant pool
2845         in codeblock.  This allows us to drop op_new_regexp and all associated code as well.
2846
2847         * bytecode/CodeBlock.cpp:
2848         (JSC::CodeBlock::dump):
2849         (JSC::CodeBlock::shrinkToFit):
2850         * bytecode/CodeBlock.h:
2851         * bytecode/Opcode.h:
2852         * bytecompiler/BytecodeGenerator.cpp:
2853         (JSC::BytecodeGenerator::emitLoad):
2854         * bytecompiler/BytecodeGenerator.h:
2855         * bytecompiler/NodesCodegen.cpp:
2856         (JSC::RegExpNode::emitBytecode):
2857         * interpreter/Interpreter.cpp:
2858         (JSC::Interpreter::privateExecute):
2859         * jit/JIT.cpp:
2860         (JSC::JIT::privateCompileMainPass):
2861         * jit/JIT.h:
2862         * jit/JITOpcodes.cpp:
2863         * jit/JITStubs.cpp:
2864         * jit/JITStubs.h:
2865         (JSC::):
2866
2867 2010-04-20  Oliver Hunt  <oliver@apple.com>
2868
2869         Fix license on create_regex_tables
2870
2871         * create_regex_tables:
2872
2873 2010-04-20  Oliver Hunt  <oliver@apple.com>
2874
2875         Reviewed by NOBODY (Build fix).
2876
2877         Fix gtk
2878
2879         * GNUmakefile.am:
2880         * make-generated-sources.sh:
2881
2882 2010-04-20  Gavin Barraclough  <barraclough@apple.com>
2883
2884         Reviewed by Oliver Hunt.
2885
2886         Bug 37895 - Share common code from UStringImplBase with StringImpl
2887
2888         The implementation of StringImpl & UStringImpl is very similar.  Restructure
2889         StringImpl to match UStringImpl, moving the flags and length into a base class,
2890         so that this can be shared between both string types to increase code reuse.
2891
2892         * JavaScriptCore.xcodeproj/project.pbxproj:
2893         * runtime/RopeImpl.h:
2894         (JSC::RopeImpl::RopeImpl):
2895         * runtime/UStringImpl.h:
2896         (JSC::UStringImpl::UStringImpl):
2897         * wtf/text/StringImpl.h:
2898         (WebCore::StringImpl::StringImpl):
2899         (WebCore::StringImpl::characters):
2900         * wtf/text/StringImplBase.h: Copied from JavaScriptCore/runtime/UStringImpl.h.
2901         (WTF::StringImplBase::length):
2902         (WTF::StringImplBase::operator new):
2903         (WTF::StringImplBase::StringImplBase):
2904
2905 2010-04-20  Oliver Hunt  <oliver@apple.com>
2906
2907         Reviewed by Gavin Barraclough.
2908
2909         Autogenerate yarr character tables
2910         https://bugs.webkit.org/show_bug.cgi?id=37877
2911
2912         Use a python script to automatically generate character tables
2913         for the builtin YARR character classes.  This allows us to generate
2914         actual tables as well, by using these tables we can both increase
2915         performance of the check (for complex builtins) and reduce the actual
2916         code size.
2917
2918         4-8% win on string-unpack-code, but lots of noise on other tests so
2919         i'm only confident saying its a 1% win overall.
2920
2921         * DerivedSources.make:
2922         * JavaScriptCore.xcodeproj/project.pbxproj:
2923         * assembler/AbstractMacroAssembler.h:
2924         (JSC::AbstractMacroAssembler::ExtendedAddress::ExtendedAddress):
2925         * assembler/MacroAssembler.h:
2926         (JSC::MacroAssembler::branchTest8):
2927         * assembler/MacroAssemblerX86Common.h:
2928         (JSC::MacroAssemblerX86Common::branchTest8):
2929         * assembler/MacroAssemblerX86_64.h:
2930         (JSC::MacroAssemblerX86_64::branchTest8):
2931         * assembler/X86Assembler.h:
2932         (JSC::X86Assembler::cmpb_im):
2933         (JSC::X86Assembler::testb_im):
2934         * bytecode/SamplingTool.cpp:
2935         (JSC::SamplingTool::dump):
2936         * create_regex_tables: Added.
2937         * yarr/RegexCompiler.cpp:
2938         (JSC::Yarr::CharacterClassConstructor::charClass):
2939         * yarr/RegexJIT.cpp:
2940         (JSC::Yarr::RegexGenerator::matchCharacterClass):
2941         (JSC::Yarr::RegexGenerator::generatePatternCharacterGreedy):
2942         (JSC::Yarr::RegexGenerator::generatePatternCharacterNonGreedy):
2943         (JSC::Yarr::RegexGenerator::generateCharacterClassGreedy):
2944         * yarr/RegexPattern.h:
2945         (JSC::Yarr::CharacterClassTable::create):
2946         (JSC::Yarr::CharacterClassTable::CharacterClassTable):
2947         (JSC::Yarr::CharacterClass::CharacterClass):
2948
2949 2010-04-20  Gavin Barraclough  <barraclough@apple.com>
2950
2951         Reviewed by NOBODY (speculative windows fix - missed a bit!).
2952
2953         * wtf/text/AtomicString.h:
2954
2955 2010-04-20  Gavin Barraclough  <barraclough@apple.com>
2956
2957         Reviewed by NOBODY (speculative windows fix).
2958
2959         * wtf/text/AtomicString.h:
2960
2961 2010-04-20  Gavin Barraclough  <barraclough@apple.com>
2962
2963         Reviewed by NOBODY (windows build fix).
2964
2965         Add missing .def file entries.
2966
2967         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2968
2969 2010-04-20  Gavin Barraclough  <barraclough@apple.com>
2970
2971         Reviewed by Geoff Garen.
2972
2973         Bug 37869 - Move URopeImpl to its own .h/.cpp
2974         
2975         Currently Ropes are implemented by the class URopeImpl, which is defined in
2976         UStringImpl.h, and then typedefed to the name JSString::Rope. Remove the
2977         typedef, and rename all uses of URopeImpl and JSString::Rope to just RopeImpl.
2978
2979         Move RopeImpl to its own header, and remove all remaining references to ropes
2980         from UStringImpl (rename UStringOrRopeImpl to UStringImplBase, rename or move
2981         the isRope & deref methods from UStringOrRopeImpl).
2982
2983         * JavaScriptCore.xcodeproj/project.pbxproj:
2984         * runtime/JSString.cpp:
2985         (JSC::JSString::resolveRope):
2986         * runtime/JSString.h:
2987         (JSC::):
2988         (JSC::RopeBuilder::JSString):
2989         (JSC::RopeBuilder::~JSString):
2990         (JSC::RopeBuilder::appendStringInConstruct):
2991         (JSC::RopeBuilder::JSStringFinalizerStruct::):
2992         * runtime/RopeImpl.cpp: Copied from JavaScriptCore/runtime/UStringImpl.cpp.
2993         (JSC::RopeImpl::derefFibersNonRecursive):
2994         (JSC::RopeImpl::destructNonRecursive):
2995         * runtime/RopeImpl.h: Copied from JavaScriptCore/runtime/UStringImpl.h.
2996         (JSC::RopeImpl::tryCreateUninitialized):
2997         (JSC::RopeImpl::isRope):
2998         (JSC::RopeImpl::deref):
2999         (JSC::RopeImpl::RopeImpl):
3000         * runtime/UStringImpl.cpp:
3001         * runtime/UStringImpl.h:
3002         (JSC::UStringImplBase::isInvalid):
3003         (JSC::UStringImplBase::ref):
3004         (JSC::UStringImplBase::UStringImplBase):
3005         (JSC::UStringImplBase::):
3006         (JSC::UStringImpl::UStringImpl):
3007
3008 2010-04-20  Gavin Barraclough  <barraclough@apple.com>
3009
3010         Reviewed by Geoff Garen.
3011
3012         Bug 37828 - Move WebCore's String classes to WTF
3013
3014         Move these classes up to WTF so they are available to all clients of WTF (in
3015         particular JSC).
3016
3017         As a first patch, making the most minimal change possible, since this patch
3018         could easily grow rather large since we'll have to change every class forward
3019         declaration ( e.g. every "namespace WebCore { class String; }" much change to
3020         "namespace WTF { class String; }").
3021
3022         Moving the files, but leaving the classes logically in the WebCore namespace -
3023         which is technically a layering violation - I'll come back and fix this up in a
3024         subsequent patch.
3025
3026         * Android.mk:
3027         * Android.v8.wtf.mk:
3028         * GNUmakefile.am:
3029         * JavaScriptCore.exp:
3030         * JavaScriptCore.gypi:
3031         * JavaScriptCore.pro:
3032         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
3033         * JavaScriptCore.xcodeproj/project.pbxproj:
3034         * config.h:
3035         * wtf/StaticConstructors.h: Copied from WebCore/platform/StaticConstructors.h.
3036         * wtf/text/AtomicString.cpp: Copied from WebCore/platform/text/AtomicString.cpp.
3037         * wtf/text/AtomicString.h: Copied from WebCore/platform/text/AtomicString.h.
3038         * wtf/text/AtomicStringImpl.h: Copied from WebCore/platform/text/AtomicStringImpl.h.
3039         * wtf/text/StringBuffer.h: Copied from WebCore/platform/text/StringBuffer.h.
3040         * wtf/text/StringHash.h: Copied from WebCore/platform/text/StringHash.h.
3041         * wtf/text/StringImpl.cpp: Copied from WebCore/platform/text/StringImpl.cpp.
3042         * wtf/text/StringImpl.h: Copied from WebCore/platform/text/StringImpl.h.
3043         * wtf/text/WTFString.cpp: Copied from WebCore/platform/text/String.cpp.
3044         (WebCore::charactersToFloat):
3045         * wtf/text/WTFString.h: Copied from WebCore/platform/text/PlatformString.h.
3046
3047 2010-04-20  Csaba Osztrogonác  <ossy@webkit.org>
3048
3049         [Qt] Unreviewed speculative buildfix for WinCE after r57882
3050         https://bugs.webkit.org/show_bug.cgi?id=37701
3051
3052         * JavaScriptCore.pri: missing wince* case added.
3053
3054 2010-04-20  Gavin Barraclough  <barraclough@apple.com>
3055
3056         Reviewed by NOBODY (build fix).
3057         Speculative Chromium/Win build fix, attempt #2.
3058
3059         * config.h:
3060
3061 2010-04-20  Gavin Barraclough  <barraclough@apple.com>
3062
3063         Reviewed by NOBODY (build fix).
3064         Speculative Chromium/Win build fix.
3065
3066         * config.h: JS_EXPORTDATA should do nothing on !JSC builds.
3067
3068 2010-04-20  Csaba Osztrogonác  <ossy@webkit.org>
3069
3070         Reviewed by Simon Hausmann.
3071
3072         [Qt] Target(WebCore,jsc,...) must depends on static library of JavaScriptCore
3073         https://bugs.webkit.org/show_bug.cgi?id=37701
3074
3075         * JavaScriptCore.pri: dependency added.
3076
3077 2010-04-20  Gavin Barraclough  <barraclough@apple.com>
3078
3079         Rubber stamped by Maciej Stachowiak (relanding r57829).
3080         Added missing JS_EXPORTDATA
3081
3082         * API/APIShims.h:
3083         (JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock):
3084         (JSC::APIEntryShimWithoutLock::~APIEntryShimWithoutLock):
3085         (JSC::APICallbackShim::APICallbackShim):
3086         (JSC::APICallbackShim::~APICallbackShim):
3087         * API/JSContextRef.cpp:
3088         * Android.mk:
3089         * Android.v8.wtf.mk:
3090         * GNUmakefile.am:
3091         * JavaScriptCore.exp:
3092         * JavaScriptCore.gypi:
3093         * JavaScriptCore.pro:
3094         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3095         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
3096         * JavaScriptCore.xcodeproj/project.pbxproj:
3097         * runtime/Completion.cpp:
3098         (JSC::checkSyntax):
3099         (JSC::evaluate):
3100         * runtime/Identifier.cpp:
3101         (JSC::Identifier::remove):
3102         (JSC::Identifier::checkCurrentIdentifierTable):
3103         * runtime/Identifier.h:
3104         * runtime/InitializeThreading.cpp:
3105         (JSC::initializeThreadingOnce):
3106         * runtime/JSGlobalData.cpp:
3107         (JSC::JSGlobalData::create):
3108         * wtf/WTFThreadData.cpp: Copied from JavaScriptCore/wtf/WTFThreadData.cpp.
3109         * wtf/WTFThreadData.h: Copied from JavaScriptCore/wtf/WTFThreadData.h.
3110
3111 2010-04-19  Gavin Barraclough  <barraclough@apple.com>
3112
3113         Reviewed by NOBODY (rolling out r57829).
3114         This broke windows.
3115
3116         * API/APIShims.h:
3117         (JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock):
3118         (JSC::APIEntryShimWithoutLock::~APIEntryShimWithoutLock):
3119         (JSC::APICallbackShim::APICallbackShim):
3120         (JSC::APICallbackShim::~APICallbackShim):
3121         * API/JSContextRef.cpp:
3122         * Android.mk:
3123         * Android.v8.wtf.mk:
3124         * GNUmakefile.am:
3125         * JavaScriptCore.exp:
3126         * JavaScriptCore.gypi:
3127         * JavaScriptCore.pro:
3128         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3129         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
3130         * JavaScriptCore.xcodeproj/project.pbxproj:
3131         * runtime/Completion.cpp:
3132         (JSC::checkSyntax):
3133         (JSC::evaluate):
3134         * runtime/Identifier.cpp:
3135         (JSC::Identifier::remove):
3136         (JSC::Identifier::checkCurrentIdentifierTable):
3137         (JSC::createIdentifierTableSpecificCallback):
3138         (JSC::createIdentifierTableSpecific):
3139         * runtime/Identifier.h:
3140         (JSC::ThreadIdentifierTableData::ThreadIdentifierTableData):
3141         (JSC::defaultIdentifierTable):
3142         (JSC::setDefaultIdentifierTable):
3143         (JSC::currentIdentifierTable):
3144         (JSC::setCurrentIdentifierTable):
3145         (JSC::resetCurrentIdentifierTable):
3146         * runtime/InitializeThreading.cpp:
3147         (JSC::initializeThreadingOnce):
3148         * runtime/JSGlobalData.cpp:
3149         (JSC::JSGlobalData::create):
3150         * wtf/WTFThreadData.cpp: Removed.
3151         * wtf/WTFThreadData.h: Removed.
3152
3153 2010-04-19  Douglas Gregor  <dgregor@apple.com>
3154
3155         Reviewed and landed by Anders Carlsson.
3156
3157         * runtime/UStringImpl.h:
3158         Fix class/struct declaration mismatches.
3159
3160 2010-04-19  Geoffrey Garen  <ggaren@apple.com>
3161
3162         Reviewed by Beth Dakin.
3163
3164         Checked in these tests I wrote becuase Balazs Kelemen wanted to use them.
3165
3166         * tests/perf: Added.
3167         * tests/perf/bench-allocate-nonretained.js: Added.
3168         * tests/perf/bench-allocate-retained.js: Added.
3169
3170 2010-04-19  Gavin Barraclough  <barraclough@apple.com>
3171
3172         Reviewed by NOBODY (windows build fix).
3173
3174         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3175
3176 2010-04-16  Gavin Barraclough  <barraclough@apple.com>
3177
3178         Reviewed by Sam Weinig.
3179
3180         https://bugs.webkit.org/show_bug.cgi?id=37745
3181         Move string uniquing tables to (new) WTFThreadData class.
3182
3183         Remove AtomicString's dependency on ThreadGlobalData so that we can move
3184         WebCore's string classes up to WTF.
3185
3186         WTFThreadData.cpp/.h are based on ThreadGlobalData from WebCore.
3187         Moved JSC & WebCore's string uniquing tables to this class.
3188
3189         This patch introduces a temporary layering violation in providing forward
3190         declarations of classes from JSC and WTF; this will be resolved as we move
3191         more string code up to WTF.
3192
3193         * API/APIShims.h:
3194         (JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock):
3195         (JSC::APIEntryShimWithoutLock::~APIEntryShimWithoutLock):
3196         (JSC::APICallbackShim::APICallbackShim):
3197         (JSC::APICallbackShim::~APICallbackShim):
3198         * API/JSContextRef.cpp:
3199         * JavaScriptCore.exp:
3200         * JavaScriptCore.xcodeproj/project.pbxproj:
3201         * runtime/Completion.cpp:
3202         (JSC::checkSyntax):
3203         (JSC::evaluate):
3204         * runtime/Identifier.cpp:
3205         (JSC::Identifier::remove):
3206         (JSC::Identifier::checkCurrentIdentifierTable):
3207         * runtime/Identifier.h:
3208         * runtime/InitializeThreading.cpp:
3209         (JSC::initializeThreadingOnce):
3210         * runtime/JSGlobalData.cpp:
3211         (JSC::JSGlobalData::create):
3212         * wtf/WTFThreadData.cpp: Copied from WebCore/platform/ThreadGlobalData.cpp.
3213         (WTF::WTFThreadData::WTFThreadData):
3214         (WTF::WTFThreadData::~WTFThreadData):
3215         * wtf/WTFThreadData.h: Copied from WebCore/platform/ThreadGlobalData.h.
3216         (WTF::WTFThreadData::atomicStringTable):
3217         (WTF::WTFThreadData::initializeIdentifierTable):
3218         (WTF::WTFThreadData::currentIdentifierTable):
3219         (WTF::WTFThreadData::setCurrentIdentifierTable):
3220         (WTF::WTFThreadData::resetCurrentIdentifierTable):
3221         (WTF::wtfThreadData):
3222
3223 2010-04-19  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
3224
3225         Reviewed by Simon Hausmann.
3226
3227         [Qt] Build fix for WinCE.
3228
3229         Moved the include of the non-existing errno.h header file inside
3230         platform guard macros.
3231
3232         * jit/ExecutableAllocatorFixedVMPool.cpp:
3233
3234 2010-04-18  Kwang Yul Seo  <skyul@company100.net>
3235
3236         Reviewed by Laszlo Gombos.
3237
3238         [WINCE] Don't define WTF_CPU_MIDDLE_ENDIAN=1
3239         https://bugs.webkit.org/show_bug.cgi?id=37434
3240
3241         Windows CE supports little-endian format only, so don't define
3242         WTF_CPU_MIDDLE_ENDIAN=1.
3243
3244         * wtf/Platform.h:
3245
3246 2010-04-18  Simon Hausmann  <simon.hausmann@nokia.com>
3247
3248         Reviewed by Laszlo Gombos.
3249
3250         [Qt] Fix JavaScriptCore's include path for WinCE builds
3251
3252         https://bugs.webkit.org/show_bug.cgi?id=36751
3253
3254         * JavaScriptCore.pri:
3255
3256 2010-04-16  Gavin Barraclough  <barraclough@apple.com>
3257
3258         Reviewed by nobody, build fix.
3259
3260 2010-04-16  Gavin Barraclough  <barraclough@apple.com>
3261
3262         Reviewed by nobody, build fix.
3263
3264 2010-04-16  Gavin Barraclough  <barraclough@apple.com>
3265
3266         Reviewed by Oliver Hunt.
3267
3268         Bug 37730 - Remove JSC::UString dependencies from WebCore::StringImpl
3269         (Following on from bug #37675).
3270
3271         Make the argument ordering for UStringImpl's constructor & create
3272         methods match, when passed a shared buffer.
3273
3274         * JavaScriptCore.exp:
3275         * runtime/UStringImpl.cpp:
3276         (JSC::UStringImpl::create):
3277         * runtime/UStringImpl.h:
3278
3279 2010-04-15  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
3280
3281         Reviewed by Kenneth Rohde Christiansen.
3282
3283         Fix memory leak in QScriptEngine::evaluate().
3284
3285         QScriptEnginePrivate::evaluate should release temporary variables.
3286
3287         [Qt] QScriptEngine::evaluate has memory leak.
3288         https://bugs.webkit.org/show_bug.cgi?id=37596
3289
3290         * qt/api/qscriptengine_p.cpp:
3291         (QScriptEnginePrivate::evaluate):
3292         * qt/api/qscriptengine_p.h:
3293
3294 2010-04-14  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
3295
3296         Reviewed by Kenneth Rohde Christiansen.
3297
3298         Fix a memory leak in QScriptValue::inherits.
3299
3300         [Qt] QScriptValue::inherits has a memory leak.
3301         https://bugs.webkit.org/show_bug.cgi?id=37617
3302
3303         * qt/api/qscriptvalue_p.h:
3304         (QScriptValuePrivate::inherits):
3305
3306 2010-04-14  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
3307
3308         Reviewed by Kenneth Rohde Christiansen.
3309
3310         Fix a few memory leaks in QScriptEngine.
3311
3312         Syntax checking caused memory leak, not all temporary variables were released.
3313
3314         [Qt] Syntax checking  in the QtScript cause a memory leak.
3315         https://bugs.webkit.org/show_bug.cgi?id=37610
3316
3317         * qt/api/qscriptengine_p.cpp:
3318         (QScriptEnginePrivate::checkSyntax):
3319         * qt/api/qscriptsyntaxcheckresult.cpp:
3320         (QScriptSyntaxCheckResultPrivate::errorMessage):
3321         (QScriptSyntaxCheckResultPrivate::errorLineNumber):
3322
3323 2010-04-14  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
3324
3325         Reviewed by Kenneth Rohde Christiansen.
3326
3327         Fix memory leak inside QScriptEnginePrivate::makeJSValue.
3328
3329         QScriptEnginePrivate::makeJSValue should release temporary JSStringRef variable.
3330
3331         [Qt] tst_QScriptValue::toString has a memory leak.
3332         https://bugs.webkit.org/show_bug.cgi?id=37598
3333
3334         * qt/api/qscriptengine_p.h:
3335         (QScriptEnginePrivate::makeJSValue):
3336
3337 2010-04-14  Peter Varga  <pvarga@inf.u-szeged.hu>
3338
3339         Reviewed by Geoffrey Garen.
3340
3341         Move the YARR JIT fallback detection from RegexJIT.cpp to
3342         RegexCompiler.cpp.
3343
3344         https://bugs.webkit.org/show_bug.cgi?id=37571
3345
3346         * yarr/RegexCompiler.cpp:
3347         (JSC::Yarr::RegexPatternConstructor::atomBackReference):
3348         (JSC::Yarr::RegexPatternConstructor::quantifyAtom):
3349         * yarr/RegexJIT.cpp:
3350         (JSC::Yarr::RegexGenerator::generateTerm):
3351         (JSC::Yarr::RegexGenerator::RegexGenerator):
3352         (JSC::Yarr::jitCompileRegex):
3353         * yarr/RegexJIT.h:
3354         (JSC::Yarr::RegexCodeBlock::operator!):
3355         * yarr/RegexPattern.h:
3356         (JSC::Yarr::RegexPattern::RegexPattern):
3357         (JSC::Yarr::RegexPattern::reset):
3358
3359 2010-04-14  Kent Hansen  <kent.hansen@nokia.com>
3360
3361         Reviewed by Maciej Stachowiak.
3362
3363         Mac OS X: Use deployment target to determine whether memory tagging should be enabled
3364         https://bugs.webkit.org/show_bug.cgi?id=34888
3365
3366         When building on (Snow) Leopard but targeting Tiger
3367         (TARGETING_TIGER defined, BUILDING_ON_TIGER not defined),
3368         WebKit would crash on Tiger because the tags passed to mmap
3369         caused those function calls to fail.
3370
3371         Conversely, when building on Tiger but targeting Leopard
3372         (BUILDING_ON_TIGER defined, TARGETING_LEOPARD defined), WebKit
3373         would crash on Leopard because the tags passed to vm_map and
3374         vm_allocate caused those function calls to fail.
3375
3376         Solution: Use TARGETING_TIGER rather than BUILDING_ON_TIGER to
3377         govern the tag definitions. Use the same tags for vm_map and
3378         vm_allocate regardless of target, since they work on
3379         both. Fall back to the mmap tags that work on Tiger (that is,
3380         "no tags") if targeting Tiger, since those tags also work on
3381         Leopard.
3382
3383         * wtf/VMTags.h:
3384
3385 2010-04-12  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
3386
3387         Reviewed by nobody, build fix.
3388
3389         [Qt] Build fix for Mac when building with build-webkit --qt
3390
3391         Specifying no configuration on Mac builds WebCore both in debug
3392         and release. JavaScriptCore has to follow this rule as well.
3393
3394         * JavaScriptCore.pro:
3395
3396 2010-04-11  Mark Rowe  <mrowe@apple.com>
3397
3398         Reviewed by Sam Weinig.
3399
3400         <rdar://problem/7851332> Fix the build.
3401
3402         * wtf/FastMalloc.cpp:
3403         (WTF::TCMallocStats::): Initialize extra members of malloc_introspection_t to zero.
3404
3405 2010-04-09  Mikhail Naganov  <mnaganov@chromium.org>
3406
3407         Reviewed by Pavel Feldman.
3408
3409         Make CallIdentifier constructor to handle null urls.
3410
3411         https://bugs.webkit.org/show_bug.cgi?id=37341
3412
3413         * profiler/CallIdentifier.h:
3414         (JSC::CallIdentifier::CallIdentifier):
3415
3416 2010-04-09  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
3417
3418         Reviewed by Simon Hausmann.
3419
3420         [Qt] Fix crashes with package builds in release
3421
3422         Add NDEBUG to the defines for package build in JavaScriptCore.pri,
3423         so that it's consistently used for JavaScriptCore, WebCore, jsc and all
3424         other tools using wtf, etc. data structures directly. Mixing NDEBUG with
3425         non-NDEBUG builds causes crashes due to differences in data structures when
3426         assertions/checks are enabled.
3427
3428         * JavaScriptCore.pri:
3429
3430 2010-04-09  Patrick Gansterer  <paroga@paroga.com>
3431
3432         Reviewed by Darin Adler.
3433
3434         Implement NO_RETURN for COMPILER(MSVC).
3435         https://bugs.webkit.org/show_bug.cgi?id=33056 
3436
3437         Added NO_RETURN_WITH_VALUE for functions with non-void return type.
3438
3439         * jsc.cpp:
3440         * wtf/AlwaysInline.h:
3441         * wtf/FastMalloc.cpp:
3442
3443 2010-04-08  Kwang Yul Seo  <skyul@company100.net>
3444
3445         Reviewed by Simon Hausmann.
3446
3447         [WINCE] Check if ARM or _ARM_ is defined
3448         https://bugs.webkit.org/show_bug.cgi?id=37200
3449
3450         MSVC defines ARM and _ARM_ for Windows CE ARM. Define WTF_CPU_ARM=1
3451         when either ARM or _ARM_ is defined.
3452
3453         * wtf/Platform.h:
3454
3455 2010-04-08  Csaba Osztrogonác  <ossy@webkit.org>
3456
3457         Reviewed Oliver Hunt.
3458
3459         [Qt]r57240 broke Qt build (might be a gcc bug)
3460         https://bugs.webkit.org/show_bug.cgi?id=37253
3461
3462         Workaround until fix. On PLATFORM(QT) use inline instead of ALWAYS_INLINE.
3463
3464         * wtf/PassRefPtr.h: Qt guards added.
3465
3466 2010-04-07  Oliver Hunt  <oliver@apple.com>
3467
3468         Reviewed by Anders Carlsson.
3469
3470         Vector<UString> makes many needless calls to UString::UString and UString::~UString
3471
3472         Add a VectorTrait<UString> specialisation to allow vector to simply memset/memcpy
3473         data around.  Only difference from the VectorTrait<RefPtr<T> > traits is the inability
3474         to use memset to initialize data.
3475
3476         * runtime/UString.h:
3477         (WTF::):
3478
3479 2010-04-07  Oliver Hunt  <oliver@apple.com>
3480
3481         Reviewed by Geoff Garen.
3482
3483         Beat gcc with a clue bat -- force inlining of refIfNotNull and derefIfNotNull
3484
3485         * wtf/PassRefPtr.h:
3486
3487 2010-04-07  Kwang Yul Seo  <skyul@company100.net>
3488
3489         Reviewed by Darin Adler.
3490
3491         Replace isprint with isASCIIPrintable
3492         https://bugs.webkit.org/show_bug.cgi?id=37223
3493
3494         WebKit does not use functions in <ctype.h> as they are dependent on the current
3495         locale. Use the equivalent functions in <wtf/ASCIICType.h>. isASCIIPrintable
3496         replaces isprint.
3497
3498         * pcre/pcre_exec.cpp:
3499         (pchars):
3500
3501 2010-04-07  Enrica Casucci  <enrica@apple.com>
3502
3503         Reviewed by Darin Adler.
3504
3505         https://bugs.webkit.org/show_bug.cgi?id=37219
3506         
3507         This change disables text caret for the iPhone platflorm.
3508         
3509         * wtf/Platform.h: Disabled text caret for iPhone.
3510
3511 2010-04-06  Adam Barth  <abarth@webkit.org>
3512
3513         Reviewed by Eric Seidel.
3514
3515         REGRESSION: Worker termination via JS timeout may cause worker tests like fast/workers/worker-terminate.html fail.
3516         https://bugs.webkit.org/show_bug.cgi?id=36646
3517
3518         Add a new exception type for forcibly terminating a JavaScript stack.
3519         The new exception functions similarly to the
3520         InterruptedExecutionException but is conceptually different because
3521         execution is terminated instead of just interrupted.
3522
3523         * GNUmakefile.am:
3524             - Added new Terminator.h file.
3525         * JavaScriptCore.gypi:
3526             - Added new Terminator.h file.
3527         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3528             - Added new Terminator.h file.
3529         * JavaScriptCore.xcodeproj/project.pbxproj:
3530             - Added new Terminator.h file.
3531         * interpreter/Interpreter.cpp:
3532         (JSC::Interpreter::throwException):
3533             - Fully unwind the stack for TerminatedExecutionException.
3534         (JSC::Interpreter::privateExecute):
3535             - Check if we've been terminated at the same time we check if we've
3536               timed out.
3537         * jit/JITStubs.cpp:
3538         (JSC::DEFINE_STUB_FUNCTION):
3539             - Check if we've been terminated at the same time we check if we've
3540               timed out.
3541         * runtime/Completion.cpp:
3542             - Some exceptions define special completion types so that calls can
3543               see why we terminated evaluation.
3544         (JSC::evaluate):
3545         * runtime/Completion.h:
3546             - Define a new completion type for termination.
3547         (JSC::):
3548         * runtime/ExceptionHelpers.cpp:
3549             - Define TerminatedExecutionException and refactor pseudo-RTTI
3550               virtual function to be more semantic.
3551         (JSC::InterruptedExecutionError::exceptionType):
3552         (JSC::TerminatedExecutionError::TerminatedExecutionError):
3553         (JSC::TerminatedExecutionError::exceptionType):
3554         (JSC::TerminatedExecutionError::toString):
3555         (JSC::createTerminatedExecutionException):
3556         * runtime/ExceptionHelpers.h:
3557             - Entry point for generating a TerminatedExecutionException.
3558         * runtime/JSGlobalData.cpp:
3559         (JSC::JSGlobalData::JSGlobalData):
3560             - Add a Terminator object that can be used to asynchronously
3561               terminate a JavaScript execution stack.
3562         * runtime/JSGlobalData.h:
3563         * runtime/JSObject.h:
3564         (JSC::JSObject::exceptionType):
3565             - Define that, by default, thrown objects have a normal exception
3566               type.
3567         * runtime/Terminator.h: Added.
3568             - Added a new controller object that can be used to terminate
3569               execution asynchronously.  This object is more or less a
3570               glorified bool.
3571         (JSC::Terminator::Terminator):
3572         (JSC::Terminator::termianteSoon):
3573         (JSC::Terminator::shouldTerminate):
3574
3575 2010-04-05  Oliver Hunt  <oliver@apple.com>
3576
3577         And another one.
3578
3579         * JavaScriptCore.vcproj/jsc/jscCommon.vsprops:
3580
3581 2010-04-05  Oliver Hunt  <oliver@apple.com>
3582
3583         And another build fix.
3584
3585         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
3586
3587 2010-04-05  Oliver Hunt  <oliver@apple.com>
3588
3589         Build fix
3590
3591         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3592
3593 2010-04-05  Oliver Hunt  <oliver@apple.com>
3594
3595         Reviewed by Gavin Barraclough.
3596
3597         Support weak maps in JSC
3598         https://bugs.webkit.org/show_bug.cgi?id=37132
3599
3600         Expose an API to allow creation of a map for storing
3601         weak JS references.
3602
3603         * API/JSWeakObjectMapRefInternal.h: Added.
3604         (OpaqueJSWeakObjectMap::create):
3605         (OpaqueJSWeakObjectMap::map):
3606         (OpaqueJSWeakObjectMap::~OpaqueJSWeakObjectMap):
3607         (OpaqueJSWeakObjectMap::OpaqueJSWeakObjectMap):
3608         * API/JSWeakObjectMapRefPrivate.cpp: Added.
3609         * API/JSWeakObjectMapRefPrivate.h: Added.
3610         * JavaScriptCore.exp:
3611         * JavaScriptCore.xcodeproj/project.pbxproj:
3612         * runtime/JSGlobalObject.h:
3613         (JSC::JSGlobalObject::registerWeakMap):
3614         (JSC::JSGlobalObject::deregisterWeakMap):
3615
3616 2010-04-05  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
3617
3618         Reviewed by Kenneth Rohde Christiansen.
3619
3620         [Symbian] Consolidate Symbian WINSCW environment configuration
3621         https://bugs.webkit.org/show_bug.cgi?id=37100
3622
3623         Move the "undefinition" of WIN32 and _WIN32 from WebCore/config.h
3624         to JavaScriptCore/wtf/Platform.h as it is not specific to WebCore.
3625
3626         PLATFORM(WIN) and OS(WIN) no longer needs to be undefined as
3627         undefining WIN32 takes care of it.
3628
3629         * wtf/Platform.h:
3630
3631 2010-04-03  Gavin Barraclough  <barraclough@apple.com>
3632
3633         Reviewed by Oliver Hunt.
3634
3635         https://bugs.webkit.org/show_bug.cgi?id=37068
3636         Change UString to use a 0 rep for null strings instead of a null object.
3637
3638         No performance impact.
3639
3640         * JavaScriptCore.exp:
3641         * runtime/InternalFunction.cpp:
3642         (JSC::InternalFunction::InternalFunction):
3643         * runtime/JSString.h:
3644         (JSC::RopeBuilder::JSString):
3645         * runtime/UString.cpp:
3646         (JSC::initializeUString):
3647         * runtime/UString.h:
3648         (JSC::UString::UString):
3649         (JSC::UString::data):
3650         (JSC::UString::size):
3651         (JSC::UString::isNull):
3652         (JSC::UString::isEmpty):
3653         (JSC::UString::cost):
3654
3655 2010-04-03  Balazs Kelemen  <kb@inf.u-szeged.hu>
3656
3657         Reviewed by Oliver Hunt.
3658
3659         Fix uninitalised members in CallLinkInfo and BytecodeGenerator.
3660
3661         https://bugs.webkit.org/show_bug.cgi?id=36816
3662
3663         * bytecode/CodeBlock.cpp:
3664         (JSC::CodeBlock::CodeBlock):
3665         * bytecode/CodeBlock.h:
3666         (JSC::CallLinkInfo::CallLinkInfo):
3667
3668 2010-04-03  yael aharon  <yael.aharon@nokia.com>
3669
3670         Reviewed by Darin Adler.
3671
3672         Enable HTMLProgressElement for Safari on OSX
3673         https://bugs.webkit.org/show_bug.cgi?id=36961
3674
3675         * Configurations/FeatureDefines.xcconfig:
3676
3677 2010-04-02  Ruben Van Boxem  <vanboxem.ruben@gmail.com>
3678
3679         Reviewed by Eric Seidel.
3680
3681         Mingw-w64 fixes for JavaScriptCore
3682         https://bugs.webkit.org/show_bug.cgi?id=35607
3683
3684         * runtime/Collector.cpp: use the msvc code for mingw-w64 (but not mingw-w32)
3685         (JSC::Heap::allocateBlock):
3686         (JSC::Heap::freeBlockPtr):
3687         (JSC::currentThreadStackBase):
3688         (JSC::currentThreadStackBase):
3689         * wtf/Platform.h: added COMPILER(MINGW64) check to differentiate between mingw.org and mingw-w64 functions
3690
3691 2010-04-02  Geoffrey Garen  <ggaren@apple.com>
3692
3693         Build fix: updated the .def file.
3694
3695         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3696
3697 2010-04-02  Geoffrey Garen  <ggaren@apple.com>
3698
3699         Reviewed by Oliver Hunt.
3700
3701         Inlined toThisString and toThisJSString to avoid virtual function call overhead
3702         https://bugs.webkit.org/show_bug.cgi?id=37039
3703         
3704         Maybe a 1% speedup on iBench JS.
3705
3706         * JavaScriptCore.exp: New exports.
3707
3708         * runtime/JSCell.cpp:
3709         * runtime/JSCell.h:
3710         * runtime/JSNumberCell.cpp:
3711         * runtime/JSNumberCell.h:
3712         * runtime/JSString.cpp:
3713         * runtime/JSString.h:
3714         * runtime/JSValue.h:
3715         * runtime/JSZombie.h:
3716         (JSC::JSZombie::toThisObject): Nixed the old virtual-type implementation.
3717
3718         * runtime/JSObject.h:
3719         (JSC::JSValue::toThisString):
3720         (JSC::JSValue::toThisJSString): Added the inlined implementation.
3721
3722 2010-04-02  Jeremy Moskovich  <jeremy@chromium.org>
3723
3724         Reviewed by Geoffrey Garen.
3725
3726         Beef up documentation for ASSERT* and CRASH macros a bit.
3727
3728         https://bugs.webkit.org/show_bug.cgi?id=36527
3729
3730         * wtf/Assertions.h:
3731
3732 2010-04-02  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
3733
3734         Unreviewed, minor build fix.
3735
3736         Change the order of the member initialisation list
3737         in constructor to match declaration order
3738
3739         * runtime/Collector.cpp:
3740         (JSC::Heap::Heap):
3741
3742 2010-04-01  Kinuko Yasuda  <kinuko@chromium.org>
3743
3744         Reviewed by Dmitry Titov.
3745
3746         Add FileThread for async file operation support in FileReader and FileWriter
3747         https://bugs.webkit.org/show_bug.cgi?id=36896
3748
3749         Add ENABLE_FILE_READER and ENABLE_FILE_WRITER flags.
3750
3751         * Configurations/FeatureDefines.xcconfig:
3752
3753 2010-03-31  Gavin Barraclough  <barraclough@apple.com>
3754
3755         Reviewed by NOBODY (windows build fix pt II).
3756
3757         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3758
3759 2010-03-31  Gavin Barraclough  <barraclough@apple.com>
3760
3761         Reviewed by NOBODY (windows build fix).
3762
3763         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3764
3765 2010-03-31  Gavin Barraclough  <barraclough@apple.com>
3766
3767         Reviewed by Geoff Garen.
3768
3769         Bug 36871 - Remove JSC::CString
3770         Use WTF::CString instead (which until recently was WebCore::CString).
3771
3772         * JavaScriptCore.exp:
3773         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3774         * runtime/UString.cpp:
3775         * runtime/UString.h:
3776
3777 2010-03-31  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
3778
3779         Unreviewed, fix after r56842.
3780
3781         Add UNUSED_PARAM a to silence warning.
3782
3783         * jit/JITStubs.cpp:
3784         (JSC::DEFINE_STUB_FUNCTION):
3785
3786 2010-03-31  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
3787
3788         Unreviewed, Symbian build fix.
3789
3790         Refactor JITStubs.cpp so that the list of STUB_FUNCTIONs
3791         are not dependent on the JSVALUE32_64 guard.
3792
3793         * jit/JITStubs.cpp: Place the JSVALUE32_64 guard inside 
3794         the body of cti_op_eq_strings.
3795         * jit/JITStubs.h: Remove JSVALUE32_64 guard from 
3796         cti_op_eq_strings stub.
3797
3798 2010-03-30  Gavin Barraclough  <barraclough@apple.com>
3799
3800         Reviewed by NOBODY (windows build fix).
3801
3802         Fixing b0rked version of JavaScriptCore.vcproj - added lines were truncated.
3803
3804         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3805
3806 2010-03-30  Gavin Barraclough  <barraclough@apple.com>
3807
3808         Rubber stamped by Sam Weinig.
3809
3810         https://bugs.webkit.org/show_bug.cgi?id=36866
3811         Move CString to WTF
3812
3813         * Android.mk:
3814         * GNUmakefile.am:
3815         * JavaScriptCore.exp:
3816         * JavaScriptCore.gypi:
3817         * JavaScriptCore.pro:
3818         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3819         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3820         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
3821         * JavaScriptCore.xcodeproj/project.pbxproj:
3822         * wtf/text: Added.
3823         * wtf/text/CString.cpp: Copied from WebCore/platform/text/CString.cpp.
3824         * wtf/text/CString.h: Copied from WebCore/platform/text/CString.h.
3825         (WTF::CStringBuffer::data):
3826         (WTF::CStringBuffer::length):
3827         (WTF::CStringBuffer::create):
3828         (WTF::CStringBuffer::CStringBuffer):
3829         (WTF::CStringBuffer::mutableData):
3830         (WTF::CString::CString):
3831         (WTF::CString::isNull):
3832         (WTF::CString::buffer):
3833         (WTF::operator!=):
3834
3835 2010-03-30  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
3836
3837         Reviewed by nobody, build break.
3838
3839         [Qt] Fix build break on Qt Mac.
3840
3841         DESTDIR path on Mac do not include the configuration path by default
3842         like on Windows. Have to force it.
3843
3844         * JavaScriptCore.pro:
3845
3846 2010-03-29  Alice Liu  <alice.liu@apple.com>
3847
3848         Reviewed by NOBODY (build fix).
3849
3850         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
3851         add JSObjectRefPrivate.h
3852
3853 2010-03-29  Chao-ying Fu  <fu@mips.com>
3854
3855         Reviewed by Oliver Hunt.
3856
3857         MIPS JIT Supports
3858         https://bugs.webkit.org/show_bug.cgi?id=30144
3859
3860         The following changes enable MIPS JIT.
3861
3862         * assembler/MIPSAssembler.h:
3863         (JSC::MIPSAssembler::lbu):
3864         (JSC::MIPSAssembler::linkWithOffset):
3865         * assembler/MacroAssemblerMIPS.h:
3866         (JSC::MacroAssemblerMIPS::load8):
3867         (JSC::MacroAssemblerMIPS::branch8):
3868         (JSC::MacroAssemblerMIPS::branchTest8):
3869         (JSC::MacroAssemblerMIPS::setTest8):
3870         (JSC::MacroAssemblerMIPS::setTest32):
3871         * jit/JIT.h:
3872         * jit/JITInlineMethods.h:
3873         (JSC::JIT::preserveReturnAddressAfterCall):
3874         (JSC::JIT::restoreReturnAddressBeforeReturn):
3875         * jit/JITOpcodes.cpp:
3876         * jit/JITStubs.cpp:
3877         (JSC::JITThunks::JITThunks):
3878         * jit/JITStubs.h:
3879         (JSC::JITStackFrame::returnAddressSlot):
3880         * wtf/Platform.h:
3881
3882 2010-02-26  Kenneth Rohde Christiansen  <kenneth@webkit.org>
3883
3884         Reviewed by Simon Fraser.
3885
3886         Add support for Widgets 1.0: View Mode Media Feature
3887         https://bugs.webkit.org/show_bug.cgi?id=35446
3888
3889         Add an enable flag for the Widgets (http://www.w3.org/TR/widgets-reqs/)
3890         and turn it on for Qt only.
3891
3892         * wtf/Platform.h:
3893
3894 2010-03-29  Patrick Gansterer  <paroga@paroga.com>
3895
3896         Reviewed by Darin Adler.
3897
3898         Corrected name of (u)int64_t compile time assert.
3899         https://bugs.webkit.org/show_bug.cgi?id=36739
3900
3901         int64_t_is_four_bytes -> int64_t_is_eight_bytes
3902
3903         * os-win32/stdint.h:
3904
3905 2010-03-29  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
3906
3907         Reviewed by Simon Hausmann.
3908
3909         [Qt] Use the -l syntax for linking against JavaScriptCore on Windows.
3910         This allow qmake to extract dependencies correctly when generating VS
3911         solutions.
3912
3913         * JavaScriptCore.pri:
3914
3915 2010-03-29  Thomas Zander  <t.zander@nokia.com>
3916
3917         Reviewed by Simon Hausmann.
3918
3919         https://bugs.webkit.org/show_bug.cgi?id=36742
3920
3921         gcc for Symbian doesn't support gcc extensions like atomicity.h - disable
3922
3923         * wtf/Threading.h: also detect os symbian
3924
3925 2010-03-28  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
3926
3927         Reviewed by Simon Hausmann.
3928
3929         [Qt] Remove the definition of WTF_CHANGES guards from the build system
3930         https://bugs.webkit.org/show_bug.cgi?id=31670
3931   
3932         * JavaScriptCore.pro: Remove the definition of WTF_CHANGES
3933         as it is already defined in config.h
3934
3935 2010-03-28  Kent Hansen  <kent.hansen@nokia.com>
3936
3937         Reviewed by Simon Hausmann.
3938
3939         [Qt] Add API for reporting additional memory cost of JavaScript objects
3940         https://bugs.webkit.org/show_bug.cgi?id=36650
3941
3942         * qt/api/qscriptengine.cpp:
3943         (QScriptEngine::reportAdditionalMemoryCost):
3944         * qt/api/qscriptengine.h:
3945         * qt/api/qscriptengine_p.h:
3946         (QScriptEnginePrivate::reportAdditionalMemoryCost):
3947         * qt/tests/qscriptengine/tst_qscriptengine.cpp:
3948         (tst_QScriptEngine::reportAdditionalMemoryCost):
3949
3950 2010-03-28  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
3951
3952         Reviewed by Simon Hausmann.
3953
3954         QScriptEngine API was enriched by globalObject() method
3955         which give an access to the global object.
3956
3957         [Qt] QScriptEngine doesn't give an access to global object
3958         https://bugs.webkit.org/show_bug.cgi?id=36603
3959
3960         * qt/api/qscriptengine.cpp:
3961         (QScriptEngine::globalObject):
3962         * qt/api/qscriptengine.h:
3963         * qt/api/qscriptengine_p.cpp:
3964         (QScriptEnginePrivate::globalObject):
3965         * qt/api/qscriptengine_p.h:
3966         * qt/tests/qscriptengine/tst_qscriptengine.cpp:
3967         (tst_QScriptEngine::globalObject):
3968
3969 2010-03-26  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
3970
3971         Reviewed by Simon Hausmann.
3972
3973         [Qt] Build JavaScriptCore as a static library.
3974         https://bugs.webkit.org/show_bug.cgi?id=36590
3975
3976         This patch takes what was left of the unused JavaScriptCore.pro
3977         and moved the compilation logic from JavaScriptCore.pri to
3978         JavaScriptCore.pro.
3979
3980         * JavaScriptCore.pri:
3981         * JavaScriptCore.pro:
3982         * jsc.pro:
3983         * qt/api/QtScript.pro:
3984
3985 2010-03-25  Gavin Barraclough  <barraclough@apple.com>
3986
3987         Reviewed by NOBODY (build fix).
3988
3989         * profiler/ProfileGenerator.cpp:
3990         (JSC::ProfileGenerator::willExecute):
3991         (JSC::ProfileGenerator::didExecute):
3992
3993 2010-03-25  Gavin Barraclough  <barraclough@apple.com>
3994
3995         Reviewed by Geoff Garen.
3996
3997         Bug 36611 - Cleanup JSC::CString
3998         Rename CString::c_str() -> CString::data(), CString::size() -> CString::length(),
3999         remove UString::getCString() (all uses are wrong, should use UString::UTF8String()).
4000
4001         * bytecode/CodeBlock.cpp:
4002         (JSC::CodeBlock::printUnaryOp):
4003         (JSC::CodeBlock::printBinaryOp):
4004         (JSC::CodeBlock::printConditionalJump):
4005         (JSC::CodeBlock::printGetByIdOp):
4006         (JSC::CodeBlock::printPutByIdOp):
4007         (JSC::printGlobalResolveInfo):
4008         (JSC::printStructureStubInfo):
4009         (JSC::CodeBlock::printStructure):
4010         (JSC::CodeBlock::printStructures):
4011         (JSC::CodeBlock::dump):
4012         * jsc.cpp:
4013         (functionPrint):
4014         (functionDebug):
4015         (runInteractive):
4016         (fillBufferWithContentsOfFile):
4017         * profiler/CallIdentifier.h:
4018         (JSC::CallIdentifier::c_str):
4019         * profiler/Profile.cpp:
4020         (JSC::Profile::debugPrintDataSampleStyle):
4021         * profiler/ProfileNode.cpp:
4022         (JSC::ProfileNode::debugPrintData):
4023         (JSC::ProfileNode::debugPrintDataSampleStyle):
4024         * runtime/DateConversion.cpp:
4025         (JSC::parseDate):
4026         * runtime/JSGlobalObjectFunctions.cpp:
4027         (JSC::encode):
4028         (JSC::globalFuncJSCPrint):
4029         * runtime/UString.cpp:
4030         (JSC::operator==):
4031         (JSC::UString::toDouble):
4032         * runtime/UString.h:
4033         (JSC::CString::length):
4034         (JSC::CString::data):
4035
4036 2010-03-25  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
4037
4038         Reviewed by nobody, build fix.
4039
4040         [Qt] Build fix on MSVC. Reverts r55633 for stdint.h
4041
4042         This file gets included in generated moc files which don't
4043         include the prefix header.
4044
4045         * os-win32/stdint.h:
4046
4047 2010-03-24  Gavin Barraclough  <barraclough@apple.com>
4048
4049         Reviewed by NOBODY (windows build fix).
4050
4051 2010-03-24  Gavin Barraclough  <barraclough@apple.com>
4052
4053         Reviewed by Sam Weinig.
4054
4055         Switch String::latin1, String::utf8, String::fromUTF8 to
4056         use WTF's Unicode conversion methods rather than TextEncoder.
4057         These methods only perform simple conversion, and don't need
4058         really require TextEncoder's full capability (to look up arbitrary
4059         encodings by name), switching to only be dependent on WTF will
4060         make it easier if we chose to move WebCore::String to WTF.
4061
4062         * JavaScriptCore.exp:
4063
4064 2010-03-24  Alexey Proskuryakov  <ap@apple.com>
4065
4066         Reviewed by Geoff Garen.
4067
4068         * wtf/FastMalloc.h: Added a using directive for fastMallocSize, like we do for all public
4069         WTF symbols. Also sorted the list alphabetically.
4070
4071 2010-03-23  Gavin Barraclough  <barraclough@apple.com>
4072
4073         Reviewed by NOBODY (speculative windows build fix part II).
4074
4075 2010-03-23  Gavin Barraclough  <barraclough@apple.com>
4076
4077         Reviewed by NOBODY (speculative windows build fix).
4078
4079 2010-03-23  Gavin Barraclough  <barraclough@apple.com>
4080
4081         Reviewed by Oliver Hunt.
4082
4083         Bug 36519 - JSGlobalContextRelease is unnecessarily slow
4084
4085         Since [ http://trac.webkit.org/changeset/35917 ], calling
4086         JSGlobalContextRelease always triggers a GC heap collection
4087         (if not a full destroy). As per 35917's changelog "This is
4088         only really necessary when the (JSGlobalObject's) last
4089         reference is released, but there is no way to determine that,
4090         and no harm in collecting slightly more often."
4091         
4092         Well, we now know of cases of API clients who are harmed by
4093         the performance penalty of collecting too often, so it's time
4094         to add a way to determine whether a call to JSGlobalContextRelease
4095         is removing the last protect from it's global object.  If further
4096         protects are retaining the global object (likely from other
4097         JSGlobalContextRefs), then don't trigger a GC collection.
4098
4099         * API/JSContextRef.cpp:
4100         * runtime/Collector.cpp:
4101         (JSC::Heap::unprotect): return a boolean indicating that the value is now unprotected.
4102         * runtime/Collector.h:
4103         * wtf/HashCountedSet.h:
4104         (WTF::::remove): return a boolean indicating whether the value was removed from the set.
4105
4106 2010-03-23  Mark Rowe  <mrowe@apple.com>
4107
4108         Build fix.
4109
4110         * runtime/ArrayPrototype.cpp:
4111         (JSC::arrayProtoFuncSplice): Some versions of GCC emit a warning about the implicit 64- to 32-bit truncation
4112         that takes place here. An explicit cast is sufficient to silence it.
4113
4114 2010-03-23  Alexey Proskuryakov  <ap@apple.com>
4115
4116         Build fix.
4117
4118         * runtime/ArrayPrototype.cpp: (JSC::arrayProtoFuncSplice): Fixed a typo - length doesn't
4119         need to be converted with toInteger().
4120
4121 2010-03-23  Alexey Proskuryakov  <ap@apple.com>
4122
4123         Reviewed by Geoff Garen.
4124
4125         https://bugs.webkit.org/show_bug.cgi?id=36511
4126         <rdar://problem/7753498> Safari freezes when using SPUTNIK JavaScript conformance check
4127
4128         Test: fast/js/sputnik-S15.4.4.12_A3_T3.html
4129
4130         * runtime/ArrayPrototype.cpp: (JSC::arrayProtoFuncSplice): We were incorrectly computing
4131         the start offset, and iterated over (almost) all integers. Note that this can be fixed
4132         without using doubles, but the code would be much more complicated, and there is no important
4133         reason to stick to integers here.
4134
4135 2010-03-23  Kent Hansen  <kent.hansen@nokia.com>
4136
4137         Reviewed by Darin Adler.
4138
4139         Fix compilation on Itanium in 32-bit mode
4140         https://bugs.webkit.org/show_bug.cgi?id=36494
4141
4142         * wtf/Platform.h: Introduce CPU(IA64_32). Don't define
4143           WTF_USE_JSVALUE64 if the CPU is in 32-bit mode.
4144
4145 2010-03-23  Geoffrey Garen  <ggaren@apple.com>
4146
4147         Reviewed by Mark Rowe.
4148
4149         Interpreter fix for <rdar://problem/7728196> REGRESSION (r46701): -(-2147483648)
4150         evaluates to -2147483648 on 32 bit (35842)
4151
4152         * interpreter/Interpreter.cpp:
4153         (JSC::Interpreter::privateExecute): Only take the fast negate path if
4154         a bit other than bit 31 is set. If none of bits 0-30 are set, then the
4155         value we're negating can only be 0 or -2147483648, and neither can be
4156         negated in int space.
4157
4158         * jit/JITArithmetic.cpp:
4159         (JSC::JIT::emit_op_negate):
4160         (JSC::JIT::emitSlow_op_negate): Updated the JIT implementation to match
4161         the interpreter, since it's slightly simpler.
4162
4163 2010-03-22  Siddharth Mathur  <siddharth.mathur@nokia.com>
4164
4165         Reviewed by Laszlo Gombos.
4166
4167         [Symbian] More efficient aligned memory allocation for JSC Collector
4168         https://bugs.webkit.org/show_bug.cgi?id=34350
4169
4170         * JavaScriptCore.pri: Added 2 new Symbian source files and HAL linkage
4171
4172         * runtime/Collector.cpp: Reduced port-specific code and added private data member
4173         (JSC::Heap::Heap):
4174         (JSC::Heap::~Heap):
4175         (JSC::Heap::destroy):
4176         (JSC::Heap::allocateBlock):
4177         (JSC::Heap::freeBlockPtr):
4178
4179         * runtime/Collector.h: Added private data member
4180
4181         * wtf/symbian: Added.
4182         * wtf/symbian/BlockAllocatorSymbian.cpp: Added.
4183         (WTF::AlignedBlockAllocator::AlignedBlockAllocator): Helper class to allocate 
4184         aligned blocks more efficiently as required by Collector
4185         (WTF::AlignedBlockAllocator::alloc):
4186         (WTF::AlignedBlockAllocator::free):
4187         (WTF::AlignedBlockAllocator::destroy):
4188         (WTF::AlignedBlockAllocator::~AlignedBlockAllocator):
4189         * wtf/symbian/BlockAllocatorSymbian.h: Added.
4190
4191 2010-03-22  Geoffrey Garen  <ggaren@apple.com>
4192
4193         Reviewed by Sam Weinig.
4194
4195         Fixed <rdar://problem/7728196> REGRESSION (r46701): -(-2147483648)
4196         evaluates to -2147483648 on 32 bit (35842)
4197         
4198         Two ways to fix the same bug:
4199         
4200         1. Check for overflow when negating, since negating the largest negative
4201         int causes overflow.
4202         
4203         2. Constant-fold even when negating a negative, since, like they say in
4204         high school, "math works."
4205
4206         * assembler/MacroAssemblerARM.h:
4207         (JSC::MacroAssemblerARM::branchNeg32):
4208         * assembler/MacroAssemblerX86Common.h:
4209         (JSC::MacroAssemblerX86Common::branchNeg32): Added a branching version
4210         of the negate operator.
4211
4212         * jit/JITArithmetic.cpp:
4213         (JSC::JIT::emit_op_negate): Use the branching version of the negate 
4214         operator to check for overflow.
4215
4216         (JSC::JIT::emitSlow_op_negate): Link the check for overflow to a slow case.
4217         (We could emit inline code for this, since we know what the result would