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