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