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