2009-04-28 Gavin Barraclough <barraclough@apple.com>
[WebKit-https.git] / JavaScriptCore / ChangeLog
1 2009-04-28  Gavin Barraclough  <barraclough@apple.com>
2
3         Rubber stamped by Maciej "Henry Morgan" Stachowiak.
4
5         Enable YARR.
6         (Again.)
7
8         * wtf/Platform.h:
9
10 2009-04-27  Gavin Barraclough  <barraclough@apple.com>
11
12         Reviewed by Maciej Stachowiak.
13
14         Tweak a loop condition to keep GCC happy,
15         some GCCs seem to be having issues with this. :-/
16
17         * bytecompiler/BytecodeGenerator.cpp:
18         (JSC::BytecodeGenerator::breakTarget):
19         * wtf/Platform.h:
20
21 2009-04-27  Adam Roben  <aroben@apple.com>
22
23         Windows Debug build fix
24
25         Not sure why the buildbots weren't affected by this problem.
26
27         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Let VS
28         re-order the file list, and added JavaScriptCore[_debug].def to the
29         project. This was not necessary for the fix, but made making the fix
30         easier.
31
32         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
33         Removed a function that no longer exists.
34
35 2009-04-26  Gavin Barraclough  <barraclough@apple.com>
36
37         Reviewed by Weinig Sam.
38
39         Fix for https://bugs.webkit.org/show_bug.cgi?id=25416
40         "Cached prototype accesses unsafely hoist property storage load above structure checks."
41         
42         Do not hoist the load of the pointer to the property storage array.
43
44         No performance impact.
45
46         * jit/JITPropertyAccess.cpp:
47         (JSC::JIT::privateCompileGetByIdProto):
48         (JSC::JIT::privateCompileGetByIdProtoList):
49
50 2009-04-26  Gavin Barraclough  <barraclough@apple.com>
51
52         Reviewed by Geoffrey "Gaffe or energy?" Garen.
53
54         Randomize address requested by ExecutableAllocatorFixedVMPool.
55
56         * jit/ExecutableAllocatorFixedVMPool.cpp:
57         (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
58
59 2009-04-26  Sam Weinig  <sam@webkit.org>
60
61         Reviewed by Eric Seidel.
62
63         Remove scons-based build system.
64
65         * JavaScriptCore.scons: Removed.
66
67 2009-04-25  Oliver Hunt  <oliver@apple.com>
68
69         Reviewed by NOBODY (Buildfix).
70
71         Make HAVE_MADV_FREE darwin only for now
72
73         * wtf/Platform.h:
74
75 2009-04-25  Jan Michael Alonzo  <jmalonzo@webkit.org>
76
77         Reviewed by Oliver Hunt.
78
79         Gtk build fix - check if we have MADV_FREE before using it.
80
81         * interpreter/RegisterFile.cpp:
82         (JSC::RegisterFile::releaseExcessCapacity):
83         * wtf/Platform.h:
84
85 2009-04-24  Kevin Ollivier  <kevino@theolliviers.com>
86
87         wx build fix. Switching JSCore from a static lib to a dynamic lib
88         to match the Apple build and fix symbol exports.
89
90         * jscore.bkl:
91
92 2009-04-24  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
93
94         Rubber-stamped by Mark Rowe.
95
96         https://bugs.webkit.org/show_bug.cgi?id=25337
97         Move ThreadingQt.cpp under the qt directory.
98
99         * JavaScriptCore.pri:
100         * wtf/ThreadingQt.cpp: Removed.
101         * wtf/qt/ThreadingQt.cpp: Copied from JavaScriptCore/wtf/ThreadingQt.cpp.
102
103 2009-04-24  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
104
105         Rubber-stamped by Mark Rowe.
106
107         https://bugs.webkit.org/show_bug.cgi?id=25338
108         Move ThreadingGtk.cpp under the gtk directory.
109
110         * GNUmakefile.am:
111         * wtf/ThreadingGtk.cpp: Removed.
112         * wtf/gtk/ThreadingGtk.cpp: Copied from JavaScriptCore/wtf/ThreadingGtk.cpp.
113
114 2009-04-24  Gavin Barraclough  <barraclough@apple.com>
115
116         Reviewed by Sam "Wesley" Weinig.
117
118         Improve performance to YARR interpreter.
119         (From about 3x slower than PCRE on regex-dna to about 30% slower).
120
121         * yarr/RegexCompiler.cpp:
122         (JSC::Yarr::RegexPatternConstructor::setupAlternativeOffsets):
123         * yarr/RegexInterpreter.cpp:
124         (JSC::Yarr::Interpreter::checkCharacter):
125         (JSC::Yarr::Interpreter::checkCasedCharacter):
126         (JSC::Yarr::Interpreter::backtrackPatternCharacter):
127         (JSC::Yarr::Interpreter::backtrackPatternCasedCharacter):
128         (JSC::Yarr::Interpreter::matchParentheticalAssertionBegin):
129         (JSC::Yarr::Interpreter::matchParentheticalAssertionEnd):
130         (JSC::Yarr::Interpreter::backtrackParentheticalAssertionBegin):
131         (JSC::Yarr::Interpreter::backtrackParentheticalAssertionEnd):
132         (JSC::Yarr::Interpreter::matchDisjunction):
133         (JSC::Yarr::Interpreter::interpret):
134         (JSC::Yarr::ByteCompiler::atomPatternCharacter):
135         (JSC::Yarr::ByteCompiler::atomParenthesesSubpatternBegin):
136         (JSC::Yarr::ByteCompiler::atomParentheticalAssertionBegin):
137         (JSC::Yarr::ByteCompiler::closeAlternative):
138         (JSC::Yarr::ByteCompiler::closeBodyAlternative):
139         (JSC::Yarr::ByteCompiler::atomParenthesesEnd):
140         (JSC::Yarr::ByteCompiler::regexBegin):
141         (JSC::Yarr::ByteCompiler::regexEnd):
142         (JSC::Yarr::ByteCompiler::alterantiveBodyDisjunction):
143         (JSC::Yarr::ByteCompiler::alterantiveDisjunction):
144         (JSC::Yarr::ByteCompiler::emitDisjunction):
145         * yarr/RegexInterpreter.h:
146         (JSC::Yarr::ByteTerm::):
147         (JSC::Yarr::ByteTerm::ByteTerm):
148         (JSC::Yarr::ByteTerm::BodyAlternativeBegin):
149         (JSC::Yarr::ByteTerm::BodyAlternativeDisjunction):
150         (JSC::Yarr::ByteTerm::BodyAlternativeEnd):
151         (JSC::Yarr::ByteTerm::AlternativeBegin):
152         (JSC::Yarr::ByteTerm::AlternativeDisjunction):
153         (JSC::Yarr::ByteTerm::AlternativeEnd):
154         (JSC::Yarr::ByteTerm::SubpatternBegin):
155         (JSC::Yarr::ByteTerm::SubpatternEnd):
156         * yarr/RegexJIT.cpp:
157         (JSC::Yarr::RegexGenerator::generateParentheticalAssertion):
158         * yarr/RegexPattern.h:
159
160 2009-04-24  Rob Raguet-Schofield  <ragfield@gmail.com>
161
162         Rubber-stamped by Mark Rowe.
163
164         * wtf/CurrentTime.h: Fix a typo in a comment.
165
166 2009-04-24  Oliver Hunt  <oliver@apple.com>
167
168         Reviewed by NOBODY (Build fix).
169
170         Add reinterpret_cast
171
172         * interpreter/RegisterFile.cpp:
173         (JSC::RegisterFile::releaseExcessCapacity):
174
175 2009-04-23  Oliver Hunt  <oliver@apple.com>
176
177         Reviewed by Geoff Garen.
178
179         <rdar://problem/6050421> JavaScript register file should remap to release physical pages accumulated during deep recursion
180
181         We now track the maximum extent of the RegisterFile, and when we reach the final
182         return from JS (so the stack portion of the registerfile becomes empty) we see
183         if that extent is greater than maxExcessCapacity.  If it is we use madvise or
184         VirtualFree to release the physical pages that were backing the excess.
185
186         * interpreter/RegisterFile.cpp:
187         (JSC::RegisterFile::releaseExcessCapacity):
188         * interpreter/RegisterFile.h:
189         (JSC::RegisterFile::RegisterFile):
190         (JSC::RegisterFile::shrink):
191         (JSC::RegisterFile::grow):
192
193 2009-04-23  Mark Rowe  <mrowe@apple.com>
194
195         With great sadness and a heavy heart I switch us back from YARR to WREC in
196         order to restore greenness to the world once more.
197
198         * wtf/Platform.h:
199
200 2009-04-23  Mark Rowe  <mrowe@apple.com>
201
202         More Windows build fixage.
203
204         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
205         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
206
207 2009-04-23  Mark Rowe  <mrowe@apple.com>
208
209         Attempt to fix the Windows build.
210
211         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:  Remove a symbol that no longer exists.
212
213 2009-04-23  Francisco Tolmasky  <francisco@280north.com>
214
215         BUG 24604: WebKit profiler reports incorrect total times
216         <https://bugs.webkit.org/show_bug.cgi?id=24604>
217
218         Reviewed by Timothy Hatcher and Kevin McCullough.
219
220         * JavaScriptCore.exp:
221         * JavaScriptCore.xcodeproj/project.pbxproj:
222         * profiler/CallIdentifier.h:
223         (JSC::CallIdentifier::Hash::hash):
224         (JSC::CallIdentifier::Hash::equal):
225         (JSC::CallIdentifier::hash):
226         (WTF::):
227         * profiler/HeavyProfile.cpp: Removed.
228         * profiler/HeavyProfile.h: Removed.
229         * profiler/Profile.cpp: No more need for TreeProfile/HeavyProfile
230         (JSC::Profile::create):
231         * profiler/Profile.h:
232         * profiler/ProfileNode.cpp:
233         * profiler/ProfileNode.h:
234         * profiler/TreeProfile.cpp: Removed.
235         * profiler/TreeProfile.h: Removed.
236
237 2009-04-23  Gavin Barraclough  <barraclough@apple.com>
238
239         Not Reviewed.
240
241         Speculative Windows build fix II.
242
243         * yarr/RegexInterpreter.cpp:
244
245 2009-04-23  Gavin Barraclough  <barraclough@apple.com>
246
247         Not Reviewed.
248
249         Speculative Windows build fix.
250
251         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
252         * runtime/RegExp.cpp:
253
254 2009-04-23  Gavin Barraclough  <barraclough@apple.com>
255
256         Rubber stamped by salty sea dogs Sam & Geoff.
257
258         Enable YARR_JIT by default (where supported), replacing WREC.
259
260         * wtf/Platform.h:
261
262 2009-04-23  Gavin Barraclough  <barraclough@apple.com>
263
264         Reviewed by Geoff "Dread Pirate Roberts" Garen.
265
266         Various small fixes to YARR JIT, in preparation for enabling it by default.
267
268         * Correctly index into the callframe when storing restart addresses for
269           nested alternatives.
270         * Allow backtracking back into matched alternatives of parentheses.
271         * Fix callframe offset calculation for parenthetical assertions.
272         * When a set of parenthese are quantified with a fixed and variable portion,
273           and the variable portion is quantified once, this should not reset the
274           pattern match on failure to match (the last match from the firxed portion
275           should be preserved).
276         * Up the pattern size limit to match PCRE's new limit.
277         * Unlclosed parentheses should be reported with the message "missing )".
278
279         * wtf/Platform.h:
280         * yarr/RegexCompiler.cpp:
281         (JSC::Yarr::RegexPatternConstructor::quantifyAtom):
282         (JSC::Yarr::RegexPatternConstructor::setupAlternativeOffsets):
283         * yarr/RegexInterpreter.cpp:
284         (JSC::Yarr::Interpreter::matchParentheses):
285         (JSC::Yarr::Interpreter::backtrackParentheses):
286         (JSC::Yarr::ByteCompiler::emitDisjunction):
287         * yarr/RegexJIT.cpp:
288         (JSC::Yarr::RegexGenerator::loadFromFrameAndJump):
289         (JSC::Yarr::RegexGenerator::generateParenthesesDisjunction):
290         (JSC::Yarr::RegexGenerator::generateParentheticalAssertion):
291         (JSC::Yarr::RegexGenerator::generateTerm):
292         (JSC::Yarr::executeRegex):
293         * yarr/RegexParser.h:
294         (JSC::Yarr::Parser::):
295         (JSC::Yarr::Parser::parseTokens):
296         (JSC::Yarr::Parser::parse):
297         * yarr/RegexPattern.h:
298         (JSC::Yarr::PatternTerm::):
299         (JSC::Yarr::PatternTerm::PatternTerm):
300
301 2009-04-22  Mark Rowe  <mrowe@apple.com>
302
303         Rubber-stamped by Gavin Barraclough.
304
305         Add the m_ prefix on FixedVMPoolAllocator's member variables, and fix typos in a few comments.
306
307         * jit/ExecutableAllocatorFixedVMPool.cpp:
308         (JSC::FixedVMPoolAllocator::addToFreeList):
309         (JSC::FixedVMPoolAllocator::coalesceFreeSpace):
310         (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
311         (JSC::FixedVMPoolAllocator::alloc):
312         (JSC::FixedVMPoolAllocator::free):
313         (JSC::FixedVMPoolAllocator::isWithinVMPool):
314
315 2009-04-22  Mark Rowe  <mrowe@apple.com>
316
317         Rubber-stamped by Gavin Barraclough.
318
319         Add some assertions to FixedVMPoolAllocator to guard against cases where we
320         attempt to free memory that didn't originate from the pool, or we attempt to
321         hand out a bogus address from alloc.
322
323         * jit/ExecutableAllocatorFixedVMPool.cpp:
324         (JSC::FixedVMPoolAllocator::release):
325         (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
326         (JSC::FixedVMPoolAllocator::alloc):
327         (JSC::FixedVMPoolAllocator::free):
328         (JSC::FixedVMPoolAllocator::isWithinVMPool):
329
330 2009-04-22  Gavin Barraclough  <barraclough@apple.com>
331
332         Rubber stamped by Sam "Blackbeard" Weinig.
333
334         Although pirates do spell the word 'generate' as 'genertate',
335         webkit developers do not.  Fixertate.
336
337         * yarr/RegexJIT.cpp:
338         (JSC::Yarr::RegexGenerator::generateAssertionBOL):
339         (JSC::Yarr::RegexGenerator::generateAssertionEOL):
340         (JSC::Yarr::RegexGenerator::generateAssertionWordBoundary):
341         (JSC::Yarr::RegexGenerator::generatePatternCharacterSingle):
342         (JSC::Yarr::RegexGenerator::generatePatternCharacterPair):
343         (JSC::Yarr::RegexGenerator::generatePatternCharacterFixed):
344         (JSC::Yarr::RegexGenerator::generatePatternCharacterGreedy):
345         (JSC::Yarr::RegexGenerator::generatePatternCharacterNonGreedy):
346         (JSC::Yarr::RegexGenerator::generateCharacterClassSingle):
347         (JSC::Yarr::RegexGenerator::generateCharacterClassFixed):
348         (JSC::Yarr::RegexGenerator::generateCharacterClassGreedy):
349         (JSC::Yarr::RegexGenerator::generateCharacterClassNonGreedy):
350         (JSC::Yarr::RegexGenerator::generateTerm):
351
352 2009-04-22  Gavin Barraclough  <barraclough@apple.com>
353
354         Reviewed by Sam "Blackbeard" Weinig.
355
356         Improvements to YARR JIT.  This patch expands support in three key areas:
357             * Add (temporary) support for falling back to PCRE for expressions not supported.
358             * Add support for x86_64 and Windows.
359             * Add support for singly quantified parentheses (? and ??), alternatives within
360               parentheses, and parenthetical assertions.
361
362         * runtime/RegExp.cpp:
363         (JSC::RegExp::match):
364         * yarr/RegexJIT.cpp:
365         (JSC::Yarr::RegexGenerator::storeToFrame):
366         (JSC::Yarr::RegexGenerator::storeToFrameWithPatch):
367         (JSC::Yarr::RegexGenerator::loadFromFrameAndJump):
368         (JSC::Yarr::RegexGenerator::AlternativeBacktrackRecord::AlternativeBacktrackRecord):
369         (JSC::Yarr::RegexGenerator::TermGenerationState::resetAlternative):
370         (JSC::Yarr::RegexGenerator::TermGenerationState::resetTerm):
371         (JSC::Yarr::RegexGenerator::TermGenerationState::jumpToBacktrack):
372         (JSC::Yarr::RegexGenerator::TermGenerationState::plantJumpToBacktrackIfExists):
373         (JSC::Yarr::RegexGenerator::TermGenerationState::addBacktrackJump):
374         (JSC::Yarr::RegexGenerator::TermGenerationState::linkAlternativeBacktracks):
375         (JSC::Yarr::RegexGenerator::TermGenerationState::propagateBacktrackingFrom):
376         (JSC::Yarr::RegexGenerator::genertateAssertionBOL):
377         (JSC::Yarr::RegexGenerator::genertateAssertionEOL):
378         (JSC::Yarr::RegexGenerator::matchAssertionWordchar):
379         (JSC::Yarr::RegexGenerator::genertateAssertionWordBoundary):
380         (JSC::Yarr::RegexGenerator::genertatePatternCharacterSingle):
381         (JSC::Yarr::RegexGenerator::genertatePatternCharacterPair):
382         (JSC::Yarr::RegexGenerator::genertatePatternCharacterFixed):
383         (JSC::Yarr::RegexGenerator::genertatePatternCharacterGreedy):
384         (JSC::Yarr::RegexGenerator::genertatePatternCharacterNonGreedy):
385         (JSC::Yarr::RegexGenerator::genertateCharacterClassSingle):
386         (JSC::Yarr::RegexGenerator::genertateCharacterClassFixed):
387         (JSC::Yarr::RegexGenerator::genertateCharacterClassGreedy):
388         (JSC::Yarr::RegexGenerator::genertateCharacterClassNonGreedy):
389         (JSC::Yarr::RegexGenerator::generateParenthesesDisjunction):
390         (JSC::Yarr::RegexGenerator::generateParenthesesSingle):
391         (JSC::Yarr::RegexGenerator::generateParentheticalAssertion):
392         (JSC::Yarr::RegexGenerator::generateTerm):
393         (JSC::Yarr::RegexGenerator::generateDisjunction):
394         (JSC::Yarr::RegexGenerator::generateEnter):
395         (JSC::Yarr::RegexGenerator::generateReturn):
396         (JSC::Yarr::RegexGenerator::RegexGenerator):
397         (JSC::Yarr::RegexGenerator::generate):
398         (JSC::Yarr::RegexGenerator::compile):
399         (JSC::Yarr::RegexGenerator::generationFailed):
400         (JSC::Yarr::jitCompileRegex):
401         (JSC::Yarr::executeRegex):
402         * yarr/RegexJIT.h:
403         (JSC::Yarr::RegexCodeBlock::RegexCodeBlock):
404         (JSC::Yarr::RegexCodeBlock::~RegexCodeBlock):
405
406 2009-04-22  Sam Weinig  <sam@webkit.org>
407
408         Rubber-stamped by Darin Adler.
409
410         Fix for <rdar://problem/6816957>
411         Turn off Geolocation by default
412
413         * Configurations/FeatureDefines.xcconfig:
414
415 2009-04-22  Oliver Hunt  <oliver@apple.com>
416
417         Reviewed by NOBODY (Buildfix).
418
419         * interpreter/CachedCall.h:
420
421 2009-04-21  Oliver Hunt  <oliver@apple.com>
422
423         Reviewed by NOBODY (Build fix).
424
425         * runtime/StringPrototype.cpp:
426
427 2009-04-21  Oliver Hunt  <oliver@apple.com>
428
429         Reviewed by Maciej Stachowiak.
430
431         Improve String.replace performance slightly
432
433         Apply our vm reentry caching logic to String.replace with global
434         regexes.
435
436         * runtime/StringPrototype.cpp:
437         (JSC::stringProtoFuncReplace):
438
439 2009-04-21  Geoffrey Garen  <ggaren@apple.com>
440
441         Reviewed by Cameron Zwarich and Oliver Hunt.
442         
443         Re-Fixed <rdar://problem/6406045> REGRESSION: Stack overflow on PowerPC on
444         fast/workers/use-machine-stack.html (22531)
445         
446         SunSpider reports no change.
447         
448         Use a larger recursion limit on the main thread (because we can, and
449         there's some evidence that it may improve compatibility), and a smaller
450         recursion limit on secondary threads (because they tend to have smaller
451         stacks).
452
453         * interpreter/Interpreter.cpp:
454         (JSC::Interpreter::execute):
455         (JSC::Interpreter::prepareForRepeatCall):
456         * interpreter/Interpreter.h:
457         (JSC::): Ditto. I wrote the recursion test slightly funny, so that the
458         common case remains a simple compare to constant.
459
460         * runtime/ArrayPrototype.cpp:
461         (JSC::arrayProtoFuncToString):
462         (JSC::arrayProtoFuncToLocaleString):
463         (JSC::arrayProtoFuncJoin): Conservatively, set the array recursion limits
464         to the lower, secondary thread limit. We can do something fancier if
465         compatibility moves us, but this seems sufficient for now.
466
467 2009-04-21  Geoffrey Garen  <ggaren@apple.com>
468
469         Rubber-stamped by Adam Roben.
470         
471         Disabled one more Mozilla JS test because it fails intermittently on Windows.
472         (See https://bugs.webkit.org/show_bug.cgi?id=25160.)
473
474         * tests/mozilla/expected.html:
475
476 2009-04-21  Adam Roben  <aroben@apple.com>
477
478         Rename JavaScriptCore_debug.dll to JavaScriptCore.dll in the Debug
479         configuration
480
481         This matches the naming scheme for WebKit.dll, and will be necessary
482         once Safari links against JavaScriptCore.dll. This change also causes
483         run-safari not to fail (because the launcher printed by FindSafari was
484         always looking for JavaScriptCore.dll, never
485         JavaScriptCore_debug.dll).
486
487         Part of Bug 25305: can't run safari or drt on windows
488         <https://bugs.webkit.org/show_bug.cgi?id=25305>
489
490         Reviewed by Steve Falkenburg and Sam Weinig.
491
492         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
493         * JavaScriptCore.vcproj/jsc/jsc.vcproj:
494         * JavaScriptCore.vcproj/testapi/testapi.vcproj:
495         Use $(WebKitDLLConfigSuffix) for naming JavaScriptCore.{dll,lib}.
496
497 2009-04-21  Adam Roben  <aroben@apple.com>
498
499         Fix JavaScriptCore build on VC++ Express
500
501         Reviewed by Steve Falkenburg and Sam Weinig.
502
503         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Link
504         explicitly against gdi32.lib and oleaut32.lib.
505
506 2009-04-21  Geoffrey Garen  <ggaren@apple.com>
507
508         Reviewed by Mark Rowe.
509         
510         Tiger crash fix: Put VM tags in their own header file, and fixed up the
511         #ifdefs so they're not used on Tiger.
512
513         * JavaScriptCore.xcodeproj/project.pbxproj:
514         * interpreter/RegisterFile.h:
515         (JSC::RegisterFile::RegisterFile):
516         * jit/ExecutableAllocatorFixedVMPool.cpp:
517         (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
518         * jit/ExecutableAllocatorPosix.cpp:
519         (JSC::ExecutablePool::systemAlloc):
520         * runtime/Collector.cpp:
521         (JSC::allocateBlock):
522         * wtf/VMTags.h: Added.
523
524 2009-04-20  Steve Falkenburg  <sfalken@apple.com>
525
526         More Windows build fixes.
527
528         * JavaScriptCore.vcproj/JavaScriptCore.make: Copy DLLs, PDBs.
529         * JavaScriptCore.vcproj/JavaScriptCore.resources: Added.
530         * JavaScriptCore.vcproj/JavaScriptCore.resources/Info.plist: Added.
531         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.rc: Added.
532         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add version stamping, resource copying.
533
534 2009-04-20  Steve Falkenburg  <sfalken@apple.com>
535
536         Separate JavaScriptCore.dll from WebKit.dll.
537         Slight performance improvement or no change on benchmarks.
538         
539         Allows us to break a circular dependency between CFNetwork and WebKit on Windows,
540         and simplifies standalone JavaScriptCore builds.
541
542         Reviewed by Oliver Hunt.
543
544         * API/JSBase.h: Export symbols with JS_EXPORT when using MSVC.
545         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
546         * JavaScriptCore.vcproj/WTF/WTF.vcproj: Build JavaScriptCore as a DLL instead of a static library.
547         * config.h: Specify __declspec(dllexport/dllimport) appropriately when exporting data.
548         * runtime/InternalFunction.h: Specify JS_EXPORTDATA on exported data.
549         * runtime/JSArray.h: Specify JS_EXPORTDATA on exported data.
550         * runtime/JSFunction.h: Specify JS_EXPORTDATA on exported data.
551         * runtime/StringObject.h: Specify JS_EXPORTDATA on exported data.
552         * runtime/UString.h: Specify JS_EXPORTDATA on exported data.
553
554 2009-04-20  Sam Weinig  <sam@webkit.org>
555
556         Reviewed by Kevin McCullough.
557
558         Always tag mmaped memory on darwin and clean up #defines
559         now that they are a little bigger.
560
561         * interpreter/RegisterFile.h:
562         (JSC::RegisterFile::RegisterFile):
563         * jit/ExecutableAllocatorFixedVMPool.cpp:
564         (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
565         * jit/ExecutableAllocatorPosix.cpp:
566         (JSC::ExecutablePool::systemAlloc):
567         * runtime/Collector.cpp:
568         (JSC::allocateBlock):
569
570 2009-04-20  Sam Weinig  <sam@webkit.org>
571
572         Rubber-stamped by Tim Hatcher.
573
574         Add licenses for xcconfig files.
575
576         * Configurations/Base.xcconfig:
577         * Configurations/DebugRelease.xcconfig:
578         * Configurations/FeatureDefines.xcconfig:
579         * Configurations/JavaScriptCore.xcconfig:
580         * Configurations/Version.xcconfig:
581
582 2009-04-20  Ariya Hidayat  <ariya.hidayat@nokia.com>
583
584         Build fix for Qt port (after r42646). Not reviewed.
585
586         * wtf/unicode/qt4/UnicodeQt4.h: Added U16_PREV.
587
588 2009-04-19  Sam Weinig  <sam@webkit.org>
589
590         Reviewed by Darin Adler.
591
592         Better fix for JSStringCreateWithCFString hardening.
593
594         * API/JSStringRefCF.cpp:
595         (JSStringCreateWithCFString):
596
597 2009-04-19  Sam Weinig  <sam@webkit.org>
598
599         Reviewed by Dan Bernstein.
600
601         Fix for <rdar://problem/5860954>
602         Harden JSStringCreateWithCFString against malformed CFStringRefs.
603
604         * API/JSStringRefCF.cpp:
605         (JSStringCreateWithCFString):
606
607 2009-04-19  David Kilzer  <ddkilzer@apple.com>
608
609         Make FEATURE_DEFINES completely dynamic
610
611         Reviewed by Darin Adler.
612
613         Make FEATURE_DEFINES depend on individual ENABLE_FEATURE_NAME
614         variables for each feature, making it possible to remove all
615         knowledge of FEATURE_DEFINES from build-webkit.
616
617         * Configurations/FeatureDefines.xcconfig: Extract a variable
618         from FEATURE_DEFINES for each feature setting.
619
620 2009-04-18  Sam Weinig  <sam@webkit.org>
621
622         Reviewed by Dan Bernstein.
623
624         Fix typo.  s/VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE/VM_MEMORY_JAVASCRIPT_CORE/
625
626         * runtime/Collector.cpp:
627         (JSC::allocateBlock): Fix bozo typo.
628
629 2009-04-18  Sam Weinig  <sam@webkit.org>
630
631         Reviewed by Anders Carlsson.
632
633         Fix for <rdar://problem/6801555> Tag JavaScript memory on SnowLeopard
634
635         * interpreter/RegisterFile.h:
636         (JSC::RegisterFile::RegisterFile):
637         * jit/ExecutableAllocatorFixedVMPool.cpp:
638         (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
639         * jit/ExecutableAllocatorPosix.cpp:
640         (JSC::ExecutablePool::systemAlloc):
641         * runtime/Collector.cpp:
642         (JSC::allocateBlock):
643
644 2009-04-18  Drew Wilson  <amw@apple.com>
645
646         <rdar://problem/6781407> VisiblePosition.characterAfter should return UChar32
647
648         Reviewed by Dan Bernstein.
649
650         * wtf/unicode/icu/UnicodeIcu.h:
651         (WTF::Unicode::hasLineBreakingPropertyComplexContextOrIdeographic): Added.
652
653 2009-04-18  Sam Weinig  <sam@webkit.org>
654
655         Reviewed by Mark Rowe.
656
657         Fix for <rdar://problem/5861045>
658         A little bit of hardening for UString.
659
660         * runtime/UString.cpp:
661         (JSC::concatenate):
662         (JSC::UString::append):
663
664 2009-04-18  Sam Weinig  <sam@webkit.org>
665
666         Reviewed by Mark Rowe and Dan Bernstein.
667
668         Fix for <rdar://problem/5861188>
669         A little bit of hardening for Vector.
670
671         * wtf/Vector.h:
672         (WTF::Vector<T, inlineCapacity>::append):
673         (WTF::Vector<T, inlineCapacity>::insert):
674
675 2009-04-17  Gavin Barraclough  <barraclough@apple.com>
676
677         Reviewed by Geoff Garen.
678
679         On x86_64, make all JIT-code allocations from a new heap, managed
680         by FixedVMPoolAllocator.  This class allocates a single large (2Gb)
681         pool of virtual memory from which all further allocations take place.
682         Since all JIT code is allocated from this pool, we can continue to
683         safely assume (as is already asserted) that it will always be possible
684         to link any JIT-code to JIT-code jumps and calls.
685
686         * JavaScriptCore.xcodeproj/project.pbxproj:
687             Add new file.
688         * jit/ExecutableAllocatorFixedVMPool.cpp: Added.
689         (JSC::FreeListEntry::FreeListEntry):
690         (JSC::AVLTreeAbstractorForFreeList::get_less):
691         (JSC::AVLTreeAbstractorForFreeList::set_less):
692         (JSC::AVLTreeAbstractorForFreeList::get_greater):
693         (JSC::AVLTreeAbstractorForFreeList::set_greater):
694         (JSC::AVLTreeAbstractorForFreeList::get_balance_factor):
695         (JSC::AVLTreeAbstractorForFreeList::set_balance_factor):
696         (JSC::AVLTreeAbstractorForFreeList::null):
697         (JSC::AVLTreeAbstractorForFreeList::compare_key_key):
698         (JSC::AVLTreeAbstractorForFreeList::compare_key_node):
699         (JSC::AVLTreeAbstractorForFreeList::compare_node_node):
700         (JSC::sortFreeListEntriesByPointer):
701         (JSC::sortCommonSizedAllocations):
702         (JSC::FixedVMPoolAllocator::release):
703         (JSC::FixedVMPoolAllocator::reuse):
704         (JSC::FixedVMPoolAllocator::addToFreeList):
705         (JSC::FixedVMPoolAllocator::coalesceFreeSpace):
706         (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
707         (JSC::FixedVMPoolAllocator::alloc):
708         (JSC::FixedVMPoolAllocator::free):
709         (JSC::ExecutableAllocator::intializePageSize):
710         (JSC::ExecutablePool::systemAlloc):
711         (JSC::ExecutablePool::systemRelease):
712             The new 2Gb heap class!
713         * jit/ExecutableAllocatorPosix.cpp:
714             Disable use of this implementation on x86_64.
715         * wtf/AVLTree.h:
716             Add missing variable initialization.
717         (WTF::::remove):
718
719 2009-04-17  Oliver Hunt  <oliver@apple.com>
720
721         Reviewed by Darin Adler.
722
723         Fix bug where the VM reentry cache would not correctly unroll the cached callframe
724
725         Fix a check that was intended to mark a cached call as invalid when the callframe could
726         not be constructed.  Instead it was just checking that there was a place to put the
727         exception.  This eventually results in a non-recoverable RegisterFile starvation.
728
729         * interpreter/CachedCall.h:
730         (JSC::CachedCall::CachedCall):
731         (JSC::CachedCall::call): add assertion to ensure we don't use a bad callframe
732
733 2009-04-17  David Kilzer  <ddkilzer@apple.com>
734
735         Simplify FEATURE_DEFINES definition
736
737         Reviewed by Darin Adler.
738
739         This moves FEATURE_DEFINES and its related ENABLE_FEATURE_NAME
740         variables to their own FeatureDefines.xcconfig file.  It also
741         extracts a new ENABLE_GEOLOCATION variable so that
742         FEATURE_DEFINES only needs to be defined once.
743
744         * Configurations/FeatureDefines.xcconfig: Added.
745         * Configurations/JavaScriptCore.xcconfig: Removed definition of
746         ENABLE_SVG_DOM_OBJC_BINDINGS and FEATURE_DEFINES.  Added include
747         of FeatureDefines.xcconfig.
748         * JavaScriptCore.xcodeproj/project.pbxproj: Added
749         FeatureDefines.xcconfig file.
750
751 2009-04-08  Mihnea Ovidenie  <mihnea@adobe.com>
752
753         Reviewed by Oliver Hunt.
754
755         Bug 25027: JavaScript parseInt wrong on negative numbers
756         <https://bugs.webkit.org/show_bug.cgi?id=25027>
757
758         When dealing with negative numbers, parseInt should use ceil instead of floor.
759
760         * runtime/JSGlobalObjectFunctions.cpp:
761         (JSC::globalFuncParseInt):
762
763 2009-04-16  Stephanie Lewis  <slewis@apple.com>
764
765         Reviewed by Oliver Hunt.
766
767         <rdar://problem/6744652> 32-bit to 64-bit: Javascript hash tables double in size
768
769         Remove perfect hash optimization which removes 1 MB of overhead on 32-bit and almost 2 MB on 64-bit.  Removing the optimization was not a regression on SunSpider and the acid 3 test still passes.
770
771         * create_hash_table:
772         * runtime/Lookup.cpp:
773         (JSC::HashTable::createTable):
774         (JSC::HashTable::deleteTable):
775         * runtime/Lookup.h:
776         (JSC::HashEntry::initialize):
777         (JSC::HashEntry::next):
778         (JSC::HashTable::entry):
779         * runtime/Structure.cpp:
780         (JSC::Structure::getEnumerableNamesFromClassInfoTable):
781
782 2009-04-16  Oliver Hunt  <oliver@apple.com>
783
784         Reviewed by Gavin Barraclough.
785
786         Fix subtle error in optimised VM reentry in Array.sort
787
788         Basically to ensure we don't accidentally invalidate the cached callframe
789         we should be using the cached callframe rather than our own exec state.
790         While the old behaviour was wrong i have been unable to actually create a
791         test case where anything actually ends up going wrong.
792
793         * interpreter/CachedCall.h:
794         (JSC::CachedCall::newCallFrame):
795         * runtime/JSArray.cpp:
796         (JSC::AVLTreeAbstractorForArrayCompare::compare_key_key):
797
798 2009-04-16  Oliver Hunt  <oliver@apple.com>
799
800         Reviewed by Gavin Barraclough.
801
802         Optimise op_resolve_base
803
804         If we can statically find a property we are trying to resolve
805         the base of, the base is guaranteed to be the global object.
806
807         * bytecompiler/BytecodeGenerator.cpp:
808         (JSC::BytecodeGenerator::emitResolveBase):
809
810 2009-04-16  Oliver Hunt  <oliver@apple.com>
811
812         Reviewed by Gavin Barraclough.
813
814         Improve performance of read-write-modify operators
815
816         Implement cross scope optimisation for read-write-modify
817         operators, to avoid unnecessary calls to property resolve
818         helper functions.
819
820         * bytecompiler/BytecodeGenerator.cpp:
821         (JSC::BytecodeGenerator::BytecodeGenerator):
822         (JSC::BytecodeGenerator::emitLoadGlobalObject):
823         (JSC::BytecodeGenerator::emitResolveWithBase):
824         * bytecompiler/BytecodeGenerator.h:
825
826 2009-04-16  Oliver Hunt  <oliver@apple.com>
827
828         Reviewed by Gavin Barraclough.
829
830         Improve performance of remaining array enumeration functions
831
832         Make use of function entry cache for remaining Array enumeration functions.
833
834         * runtime/ArrayPrototype.cpp:
835         (JSC::arrayProtoFuncMap):
836         (JSC::arrayProtoFuncEvery):
837         (JSC::arrayProtoFuncForEach):
838         (JSC::arrayProtoFuncSome):
839
840 2009-04-15  Oliver Hunt  <oliver@apple.com>
841
842         Reviewed by Gavin Barraclough.
843
844         Improve performance of Array.sort
845
846         Cache the VM entry for Array.sort when using a JS comparison function.
847
848         * runtime/JSArray.cpp:
849         (JSC::AVLTreeAbstractorForArrayCompare::compare_key_key):
850         (JSC::JSArray::sort):
851
852 2009-04-15  Oliver Hunt  <oliver@apple.com>
853
854         Reviewed by Gavin Barraclough.
855
856         Bug 25229: Need support for Array.prototype.reduceRight
857         <https://bugs.webkit.org/show_bug.cgi?id=25229>
858
859         Implement Array.reduceRight
860
861         * runtime/ArrayPrototype.cpp:
862         (JSC::arrayProtoFuncReduceRight):
863
864 2009-04-15  Oliver Hunt  <oliver@apple.com>
865
866         Reviewed by Gavin Barraclough.
867
868         Bug 25227: Array.filter triggers an assertion when the target array shrinks while being filtered
869         <https://bugs.webkit.org/show_bug.cgi?id=25227>
870
871         We correct this simply by making the fast array path fall back on the slow path if
872         we ever discover the fast access is unsafe.
873
874         * runtime/ArrayPrototype.cpp:
875         (JSC::arrayProtoFuncFilter):
876
877 2009-04-13  Oliver Hunt  <oliver@apple.com>
878
879         Reviewed by Gavin Barraclough.
880
881         Bug 25159: Support Array.prototype.reduce
882         <https://bugs.webkit.org/show_bug.cgi?id=25159>
883
884         Implement Array.prototype.reduce
885
886         * runtime/ArrayPrototype.cpp:
887         (JSC::arrayProtoFuncReduce):
888
889 2009-04-15  Oliver Hunt  <oliver@apple.com>
890
891         Reviewed by NOBODY (Build fix).
892
893         Move CallFrameClosure from inside the Interpreter class to its own file.
894
895         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
896         * JavaScriptCore.xcodeproj/project.pbxproj:
897         * interpreter/CachedCall.h:
898         * interpreter/CallFrameClosure.h: Copied from JavaScriptCore/yarr/RegexJIT.h.
899         (JSC::CallFrameClosure::setArgument):
900         (JSC::CallFrameClosure::resetCallFrame):
901         * interpreter/Interpreter.cpp:
902         (JSC::Interpreter::prepareForRepeatCall):
903         * interpreter/Interpreter.h:
904
905 2009-04-14  Oliver Hunt  <oliver@apple.com>
906
907         Reviewed by Cameron Zwarich.
908
909         Bug 25202: Improve performance of repeated callbacks into the VM
910
911         Add the concept of a CachedCall to native code for use in Array
912         prototype and similar functions where a single callback function
913         is called repeatedly with the same number of arguments.
914
915         Used Array.prototype.filter as the test function and got a 50% win
916         over a naive non-caching specialised version.  This makes the native
917         implementation of Array.prototype.filter faster than the JS one once
918         more.
919
920         * JavaScriptCore.vcproj/JavaScriptCore.sln:
921         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
922         * JavaScriptCore.xcodeproj/project.pbxproj:
923         * interpreter/CachedCall.h: Added.
924         (JSC::CachedCall::CachedCall):
925         (JSC::CachedCall::call):
926         (JSC::CachedCall::setThis):
927         (JSC::CachedCall::setArgument):
928         (JSC::CachedCall::~CachedCall):
929            CachedCall is a wrapper that automates the calling and teardown
930            for a CallFrameClosure
931         * interpreter/CallFrame.h:
932         * interpreter/Interpreter.cpp:
933         (JSC::Interpreter::prepareForRepeatCall):
934            Create the basic entry closure for a function
935         (JSC::Interpreter::execute):
936            A new ::execute method to enter the interpreter from a closure
937         (JSC::Interpreter::endRepeatCall):
938            Clear the entry closure
939         * interpreter/Interpreter.h:
940         (JSC::Interpreter::CallFrameClosure::setArgument):
941         (JSC::Interpreter::CallFrameClosure::resetCallFrame):
942            Helper functions to simplify setting up the closure's callframe
943         * runtime/ArrayPrototype.cpp:
944         (JSC::arrayProtoFuncFilter):
945
946 2009-04-14  Xan Lopez  <xlopez@igalia.com>
947
948         Fix the build.
949
950         Add the yarr headers (and only the headers) to the build, so that
951         RegExp.cpp can compile. The headers are ifdefed out with yarr
952         disabled, so we don't need anything else for now.
953
954         * GNUmakefile.am:
955
956 2009-04-14  Adam Roben  <aroben@apple.com>
957
958         Remove support for profile-guided optimization on Windows
959
960         Rubber-stamped by Steve Falkenburg.
961
962         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Removed
963         the Release_PGO configuration. Also let VS re-order the source files
964         list.
965
966 2009-04-14  Xan Lopez  <xlopez@igalia.com>
967
968         Unreviewed build fix.
969
970         * GNUmakefile.am:
971
972 2009-04-14  Jan Michael Alonzo  <jmalonzo@webkit.org>
973
974         Gtk build fix when building minidom. Not reviewed.
975
976         Use C-style comment instead of C++ style since autotools builds
977         minidom using gcc and not g++.
978
979         * wtf/Platform.h:
980
981 2009-04-14  Gavin Barraclough  <barraclough@apple.com>
982
983         Reviewed by NOBODY - speculative build fix.
984
985         * runtime/RegExp.h:
986
987 2009-04-13  Gavin Barraclough  <barraclough@apple.com>
988
989         Reviewed by Cap'n Geoff Garen.
990
991         Yarr!
992         (Yet another regex runtime).
993
994         Currently disabled by default since the interpreter, whilst awesomely
995         functional, has not been optimized and is likely slower than PCRE, and
996         the JIT, whilst faster than WREC, is presently incomplete and does not
997         fallback to using an interpreter for the cases it cannot handle.
998
999         * JavaScriptCore.xcodeproj/project.pbxproj:
1000         * assembler/MacroAssemblerX86Common.h:
1001         (JSC::MacroAssemblerX86Common::move):
1002         (JSC::MacroAssemblerX86Common::swap):
1003         (JSC::MacroAssemblerX86Common::signExtend32ToPtr):
1004         (JSC::MacroAssemblerX86Common::zeroExtend32ToPtr):
1005         (JSC::MacroAssemblerX86Common::branch32):
1006         (JSC::MacroAssemblerX86Common::branch16):
1007         * assembler/X86Assembler.h:
1008         (JSC::X86Assembler::cmpw_im):
1009         (JSC::X86Assembler::testw_rr):
1010         (JSC::X86Assembler::X86InstructionFormatter::immediate16):
1011         * runtime/RegExp.cpp:
1012         (JSC::RegExp::RegExp):
1013         (JSC::RegExp::~RegExp):
1014         (JSC::RegExp::create):
1015         (JSC::RegExp::compile):
1016         (JSC::RegExp::match):
1017         * runtime/RegExp.h:
1018         * wtf/Platform.h:
1019         * yarr: Added.
1020         * yarr/RegexCompiler.cpp: Added.
1021         (JSC::Yarr::CharacterClassConstructor::CharacterClassConstructor):
1022         (JSC::Yarr::CharacterClassConstructor::reset):
1023         (JSC::Yarr::CharacterClassConstructor::append):
1024         (JSC::Yarr::CharacterClassConstructor::putChar):
1025         (JSC::Yarr::CharacterClassConstructor::isUnicodeUpper):
1026         (JSC::Yarr::CharacterClassConstructor::isUnicodeLower):
1027         (JSC::Yarr::CharacterClassConstructor::putRange):
1028         (JSC::Yarr::CharacterClassConstructor::charClass):
1029         (JSC::Yarr::CharacterClassConstructor::addSorted):
1030         (JSC::Yarr::CharacterClassConstructor::addSortedRange):
1031         (JSC::Yarr::newlineCreate):
1032         (JSC::Yarr::digitsCreate):
1033         (JSC::Yarr::spacesCreate):
1034         (JSC::Yarr::wordcharCreate):
1035         (JSC::Yarr::nondigitsCreate):
1036         (JSC::Yarr::nonspacesCreate):
1037         (JSC::Yarr::nonwordcharCreate):
1038         (JSC::Yarr::RegexPatternConstructor::RegexPatternConstructor):
1039         (JSC::Yarr::RegexPatternConstructor::~RegexPatternConstructor):
1040         (JSC::Yarr::RegexPatternConstructor::reset):
1041         (JSC::Yarr::RegexPatternConstructor::assertionBOL):
1042         (JSC::Yarr::RegexPatternConstructor::assertionEOL):
1043         (JSC::Yarr::RegexPatternConstructor::assertionWordBoundary):
1044         (JSC::Yarr::RegexPatternConstructor::atomPatternCharacter):
1045         (JSC::Yarr::RegexPatternConstructor::atomBuiltInCharacterClass):
1046         (JSC::Yarr::RegexPatternConstructor::atomCharacterClassBegin):
1047         (JSC::Yarr::RegexPatternConstructor::atomCharacterClassAtom):
1048         (JSC::Yarr::RegexPatternConstructor::atomCharacterClassRange):
1049         (JSC::Yarr::RegexPatternConstructor::atomCharacterClassBuiltIn):
1050         (JSC::Yarr::RegexPatternConstructor::atomCharacterClassEnd):
1051         (JSC::Yarr::RegexPatternConstructor::atomParenthesesSubpatternBegin):
1052         (JSC::Yarr::RegexPatternConstructor::atomParentheticalAssertionBegin):
1053         (JSC::Yarr::RegexPatternConstructor::atomParenthesesEnd):
1054         (JSC::Yarr::RegexPatternConstructor::atomBackReference):
1055         (JSC::Yarr::RegexPatternConstructor::copyDisjunction):
1056         (JSC::Yarr::RegexPatternConstructor::copyTerm):
1057         (JSC::Yarr::RegexPatternConstructor::quantifyAtom):
1058         (JSC::Yarr::RegexPatternConstructor::disjunction):
1059         (JSC::Yarr::RegexPatternConstructor::regexBegin):
1060         (JSC::Yarr::RegexPatternConstructor::regexEnd):
1061         (JSC::Yarr::RegexPatternConstructor::regexError):
1062         (JSC::Yarr::RegexPatternConstructor::setupAlternativeOffsets):
1063         (JSC::Yarr::RegexPatternConstructor::setupDisjunctionOffsets):
1064         (JSC::Yarr::RegexPatternConstructor::setupOffsets):
1065         (JSC::Yarr::compileRegex):
1066         * yarr/RegexCompiler.h: Added.
1067         * yarr/RegexInterpreter.cpp: Added.
1068         (JSC::Yarr::Interpreter::appendParenthesesDisjunctionContext):
1069         (JSC::Yarr::Interpreter::popParenthesesDisjunctionContext):
1070         (JSC::Yarr::Interpreter::DisjunctionContext::DisjunctionContext):
1071         (JSC::Yarr::Interpreter::DisjunctionContext::operator new):
1072         (JSC::Yarr::Interpreter::allocDisjunctionContext):
1073         (JSC::Yarr::Interpreter::freeDisjunctionContext):
1074         (JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::ParenthesesDisjunctionContext):
1075         (JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::operator new):
1076         (JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::restoreOutput):
1077         (JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::getDisjunctionContext):
1078         (JSC::Yarr::Interpreter::allocParenthesesDisjunctionContext):
1079         (JSC::Yarr::Interpreter::freeParenthesesDisjunctionContext):
1080         (JSC::Yarr::Interpreter::InputStream::InputStream):
1081         (JSC::Yarr::Interpreter::InputStream::next):
1082         (JSC::Yarr::Interpreter::InputStream::rewind):
1083         (JSC::Yarr::Interpreter::InputStream::read):
1084         (JSC::Yarr::Interpreter::InputStream::readChecked):
1085         (JSC::Yarr::Interpreter::InputStream::reread):
1086         (JSC::Yarr::Interpreter::InputStream::prev):
1087         (JSC::Yarr::Interpreter::InputStream::getPos):
1088         (JSC::Yarr::Interpreter::InputStream::setPos):
1089         (JSC::Yarr::Interpreter::InputStream::atStart):
1090         (JSC::Yarr::Interpreter::InputStream::atEnd):
1091         (JSC::Yarr::Interpreter::InputStream::checkInput):
1092         (JSC::Yarr::Interpreter::InputStream::uncheckInput):
1093         (JSC::Yarr::Interpreter::testCharacterClass):
1094         (JSC::Yarr::Interpreter::tryConsumeCharacter):
1095         (JSC::Yarr::Interpreter::checkCharacter):
1096         (JSC::Yarr::Interpreter::tryConsumeCharacterClass):
1097         (JSC::Yarr::Interpreter::checkCharacterClass):
1098         (JSC::Yarr::Interpreter::tryConsumeBackReference):
1099         (JSC::Yarr::Interpreter::matchAssertionBOL):
1100         (JSC::Yarr::Interpreter::matchAssertionEOL):
1101         (JSC::Yarr::Interpreter::matchAssertionWordBoundary):
1102         (JSC::Yarr::Interpreter::matchPatternCharacter):
1103         (JSC::Yarr::Interpreter::backtrackPatternCharacter):
1104         (JSC::Yarr::Interpreter::matchCharacterClass):
1105         (JSC::Yarr::Interpreter::backtrackCharacterClass):
1106         (JSC::Yarr::Interpreter::matchBackReference):
1107         (JSC::Yarr::Interpreter::backtrackBackReference):
1108         (JSC::Yarr::Interpreter::recordParenthesesMatch):
1109         (JSC::Yarr::Interpreter::resetMatches):
1110         (JSC::Yarr::Interpreter::resetAssertionMatches):
1111         (JSC::Yarr::Interpreter::parenthesesDoBacktrack):
1112         (JSC::Yarr::Interpreter::matchParenthesesOnceBegin):
1113         (JSC::Yarr::Interpreter::matchParenthesesOnceEnd):
1114         (JSC::Yarr::Interpreter::backtrackParenthesesOnceBegin):
1115         (JSC::Yarr::Interpreter::backtrackParenthesesOnceEnd):
1116         (JSC::Yarr::Interpreter::matchParentheticalAssertionOnceBegin):
1117         (JSC::Yarr::Interpreter::matchParentheticalAssertionOnceEnd):
1118         (JSC::Yarr::Interpreter::backtrackParentheticalAssertionOnceBegin):
1119         (JSC::Yarr::Interpreter::backtrackParentheticalAssertionOnceEnd):
1120         (JSC::Yarr::Interpreter::matchParentheses):
1121         (JSC::Yarr::Interpreter::backtrackParentheses):
1122         (JSC::Yarr::Interpreter::matchTerm):
1123         (JSC::Yarr::Interpreter::backtrackTerm):
1124         (JSC::Yarr::Interpreter::matchAlternative):
1125         (JSC::Yarr::Interpreter::matchDisjunction):
1126         (JSC::Yarr::Interpreter::matchNonZeroDisjunction):
1127         (JSC::Yarr::Interpreter::interpret):
1128         (JSC::Yarr::Interpreter::Interpreter):
1129         (JSC::Yarr::ByteCompiler::ParenthesesStackEntry::ParenthesesStackEntry):
1130         (JSC::Yarr::ByteCompiler::ByteCompiler):
1131         (JSC::Yarr::ByteCompiler::compile):
1132         (JSC::Yarr::ByteCompiler::checkInput):
1133         (JSC::Yarr::ByteCompiler::assertionBOL):
1134         (JSC::Yarr::ByteCompiler::assertionEOL):
1135         (JSC::Yarr::ByteCompiler::assertionWordBoundary):
1136         (JSC::Yarr::ByteCompiler::atomPatternCharacter):
1137         (JSC::Yarr::ByteCompiler::atomCharacterClass):
1138         (JSC::Yarr::ByteCompiler::atomBackReference):
1139         (JSC::Yarr::ByteCompiler::atomParenthesesSubpatternBegin):
1140         (JSC::Yarr::ByteCompiler::atomParentheticalAssertionBegin):
1141         (JSC::Yarr::ByteCompiler::popParenthesesStack):
1142         (JSC::Yarr::ByteCompiler::dumpDisjunction):
1143         (JSC::Yarr::ByteCompiler::closeAlternative):
1144         (JSC::Yarr::ByteCompiler::atomParenthesesEnd):
1145         (JSC::Yarr::ByteCompiler::regexBegin):
1146         (JSC::Yarr::ByteCompiler::regexEnd):
1147         (JSC::Yarr::ByteCompiler::alterantiveDisjunction):
1148         (JSC::Yarr::ByteCompiler::emitDisjunction):
1149         (JSC::Yarr::byteCompileRegex):
1150         (JSC::Yarr::interpretRegex):
1151         * yarr/RegexInterpreter.h: Added.
1152         (JSC::Yarr::ByteTerm::):
1153         (JSC::Yarr::ByteTerm::ByteTerm):
1154         (JSC::Yarr::ByteTerm::BOL):
1155         (JSC::Yarr::ByteTerm::CheckInput):
1156         (JSC::Yarr::ByteTerm::EOL):
1157         (JSC::Yarr::ByteTerm::WordBoundary):
1158         (JSC::Yarr::ByteTerm::BackReference):
1159         (JSC::Yarr::ByteTerm::AlternativeBegin):
1160         (JSC::Yarr::ByteTerm::AlternativeDisjunction):
1161         (JSC::Yarr::ByteTerm::AlternativeEnd):
1162         (JSC::Yarr::ByteTerm::PatternEnd):
1163         (JSC::Yarr::ByteTerm::invert):
1164         (JSC::Yarr::ByteTerm::capture):
1165         (JSC::Yarr::ByteDisjunction::ByteDisjunction):
1166         (JSC::Yarr::BytecodePattern::BytecodePattern):
1167         (JSC::Yarr::BytecodePattern::~BytecodePattern):
1168         * yarr/RegexJIT.cpp: Added.
1169         (JSC::Yarr::RegexGenerator::optimizeAlternative):
1170         (JSC::Yarr::RegexGenerator::matchCharacterClassRange):
1171         (JSC::Yarr::RegexGenerator::matchCharacterClass):
1172         (JSC::Yarr::RegexGenerator::jumpIfNoAvailableInput):
1173         (JSC::Yarr::RegexGenerator::jumpIfAvailableInput):
1174         (JSC::Yarr::RegexGenerator::checkInput):
1175         (JSC::Yarr::RegexGenerator::atEndOfInput):
1176         (JSC::Yarr::RegexGenerator::notAtEndOfInput):
1177         (JSC::Yarr::RegexGenerator::jumpIfCharEquals):
1178         (JSC::Yarr::RegexGenerator::jumpIfCharNotEquals):
1179         (JSC::Yarr::RegexGenerator::readCharacter):
1180         (JSC::Yarr::RegexGenerator::storeToFrame):
1181         (JSC::Yarr::RegexGenerator::loadFromFrame):
1182         (JSC::Yarr::RegexGenerator::TermGenerationState::TermGenerationState):
1183         (JSC::Yarr::RegexGenerator::TermGenerationState::resetAlternative):
1184         (JSC::Yarr::RegexGenerator::TermGenerationState::alternativeValid):
1185         (JSC::Yarr::RegexGenerator::TermGenerationState::nextAlternative):
1186         (JSC::Yarr::RegexGenerator::TermGenerationState::alternative):
1187         (JSC::Yarr::RegexGenerator::TermGenerationState::resetTerm):
1188         (JSC::Yarr::RegexGenerator::TermGenerationState::termValid):
1189         (JSC::Yarr::RegexGenerator::TermGenerationState::nextTerm):
1190         (JSC::Yarr::RegexGenerator::TermGenerationState::term):
1191         (JSC::Yarr::RegexGenerator::TermGenerationState::lookaheadTerm):
1192         (JSC::Yarr::RegexGenerator::TermGenerationState::isSinglePatternCharacterLookaheadTerm):
1193         (JSC::Yarr::RegexGenerator::TermGenerationState::inputOffset):
1194         (JSC::Yarr::RegexGenerator::TermGenerationState::jumpToBacktrack):
1195         (JSC::Yarr::RegexGenerator::TermGenerationState::setBacktrackGenerated):
1196         (JSC::Yarr::RegexGenerator::jumpToBacktrackCheckEmitPending):
1197         (JSC::Yarr::RegexGenerator::genertateAssertionBOL):
1198         (JSC::Yarr::RegexGenerator::genertateAssertionEOL):
1199         (JSC::Yarr::RegexGenerator::matchAssertionWordchar):
1200         (JSC::Yarr::RegexGenerator::genertateAssertionWordBoundary):
1201         (JSC::Yarr::RegexGenerator::genertatePatternCharacterSingle):
1202         (JSC::Yarr::RegexGenerator::genertatePatternCharacterPair):
1203         (JSC::Yarr::RegexGenerator::genertatePatternCharacterFixed):
1204         (JSC::Yarr::RegexGenerator::genertatePatternCharacterGreedy):
1205         (JSC::Yarr::RegexGenerator::genertatePatternCharacterNonGreedy):
1206         (JSC::Yarr::RegexGenerator::genertateCharacterClassSingle):
1207         (JSC::Yarr::RegexGenerator::genertateCharacterClassFixed):
1208         (JSC::Yarr::RegexGenerator::genertateCharacterClassGreedy):
1209         (JSC::Yarr::RegexGenerator::genertateCharacterClassNonGreedy):
1210         (JSC::Yarr::RegexGenerator::generateParenthesesSingleDisjunctionOneAlternative):
1211         (JSC::Yarr::RegexGenerator::generateParenthesesSingle):
1212         (JSC::Yarr::RegexGenerator::generateTerm):
1213         (JSC::Yarr::RegexGenerator::generateDisjunction):
1214         (JSC::Yarr::RegexGenerator::RegexGenerator):
1215         (JSC::Yarr::RegexGenerator::generate):
1216         (JSC::Yarr::jitCompileRegex):
1217         (JSC::Yarr::executeRegex):
1218         * yarr/RegexJIT.h: Added.
1219         (JSC::Yarr::RegexCodeBlock::RegexCodeBlock):
1220         * yarr/RegexParser.h: Added.
1221         (JSC::Yarr::):
1222         (JSC::Yarr::Parser::):
1223         (JSC::Yarr::Parser::CharacterClassParserDelegate::CharacterClassParserDelegate):
1224         (JSC::Yarr::Parser::CharacterClassParserDelegate::begin):
1225         (JSC::Yarr::Parser::CharacterClassParserDelegate::atomPatternCharacterUnescaped):
1226         (JSC::Yarr::Parser::CharacterClassParserDelegate::atomPatternCharacter):
1227         (JSC::Yarr::Parser::CharacterClassParserDelegate::atomBuiltInCharacterClass):
1228         (JSC::Yarr::Parser::CharacterClassParserDelegate::end):
1229         (JSC::Yarr::Parser::CharacterClassParserDelegate::assertionWordBoundary):
1230         (JSC::Yarr::Parser::CharacterClassParserDelegate::atomBackReference):
1231         (JSC::Yarr::Parser::CharacterClassParserDelegate::flush):
1232         (JSC::Yarr::Parser::CharacterClassParserDelegate::):
1233         (JSC::Yarr::Parser::Parser):
1234         (JSC::Yarr::Parser::parseEscape):
1235         (JSC::Yarr::Parser::parseAtomEscape):
1236         (JSC::Yarr::Parser::parseCharacterClassEscape):
1237         (JSC::Yarr::Parser::parseCharacterClass):
1238         (JSC::Yarr::Parser::parseParenthesesBegin):
1239         (JSC::Yarr::Parser::parseParenthesesEnd):
1240         (JSC::Yarr::Parser::parseQuantifier):
1241         (JSC::Yarr::Parser::parseTokens):
1242         (JSC::Yarr::Parser::parse):
1243         (JSC::Yarr::Parser::saveState):
1244         (JSC::Yarr::Parser::restoreState):
1245         (JSC::Yarr::Parser::atEndOfPattern):
1246         (JSC::Yarr::Parser::peek):
1247         (JSC::Yarr::Parser::peekIsDigit):
1248         (JSC::Yarr::Parser::peekDigit):
1249         (JSC::Yarr::Parser::consume):
1250         (JSC::Yarr::Parser::consumeDigit):
1251         (JSC::Yarr::Parser::consumeNumber):
1252         (JSC::Yarr::Parser::consumeOctal):
1253         (JSC::Yarr::Parser::tryConsume):
1254         (JSC::Yarr::Parser::tryConsumeHex):
1255         (JSC::Yarr::parse):
1256         * yarr/RegexPattern.h: Added.
1257         (JSC::Yarr::CharacterRange::CharacterRange):
1258         (JSC::Yarr::):
1259         (JSC::Yarr::PatternTerm::):
1260         (JSC::Yarr::PatternTerm::PatternTerm):
1261         (JSC::Yarr::PatternTerm::BOL):
1262         (JSC::Yarr::PatternTerm::EOL):
1263         (JSC::Yarr::PatternTerm::WordBoundary):
1264         (JSC::Yarr::PatternTerm::invert):
1265         (JSC::Yarr::PatternTerm::capture):
1266         (JSC::Yarr::PatternTerm::quantify):
1267         (JSC::Yarr::PatternAlternative::PatternAlternative):
1268         (JSC::Yarr::PatternAlternative::lastTerm):
1269         (JSC::Yarr::PatternAlternative::removeLastTerm):
1270         (JSC::Yarr::PatternDisjunction::PatternDisjunction):
1271         (JSC::Yarr::PatternDisjunction::~PatternDisjunction):
1272         (JSC::Yarr::PatternDisjunction::addNewAlternative):
1273         (JSC::Yarr::RegexPattern::RegexPattern):
1274         (JSC::Yarr::RegexPattern::~RegexPattern):
1275         (JSC::Yarr::RegexPattern::reset):
1276         (JSC::Yarr::RegexPattern::containsIllegalBackReference):
1277         (JSC::Yarr::RegexPattern::newlineCharacterClass):
1278         (JSC::Yarr::RegexPattern::digitsCharacterClass):
1279         (JSC::Yarr::RegexPattern::spacesCharacterClass):
1280         (JSC::Yarr::RegexPattern::wordcharCharacterClass):
1281         (JSC::Yarr::RegexPattern::nondigitsCharacterClass):
1282         (JSC::Yarr::RegexPattern::nonspacesCharacterClass):
1283         (JSC::Yarr::RegexPattern::nonwordcharCharacterClass):
1284
1285 2009-04-13  Oliver Hunt  <oliver@apple.com>
1286
1287         Reviewed by NOBODY (Missed code from last patch).
1288
1289         * runtime/InternalFunction.cpp:
1290         (JSC::InternalFunction::displayName):
1291         (JSC::InternalFunction::calculatedDisplayName):
1292         * runtime/InternalFunction.h:
1293
1294 2009-04-13  Francisco Tolmasky  <francisco@280north.com>
1295
1296         Reviewed by Oliver Hunt.
1297         
1298         BUG 25171: It should be possible to manually set the name of an anonymous function
1299         <https://bugs.webkit.org/show_bug.cgi?id=25171>
1300
1301         This change adds the displayName property to functions, which when set overrides the 
1302         normal name when appearing in the console.
1303
1304         * profiler/Profiler.cpp:
1305         (JSC::createCallIdentifierFromFunctionImp): Changed call to InternalFunction::name to InternalFunction::calculatedDisplayName
1306         * runtime/CommonIdentifiers.h: Added displayName common identifier.
1307         * runtime/InternalFunction.cpp:
1308         (JSC::InternalFunction::displayName): Access to user settable displayName property
1309         (JSC::InternalFunction::calculatedDisplayName): Returns displayName if it exists, if not then the natural name
1310
1311 2009-04-13  Geoffrey Garen  <ggaren@apple.com>
1312
1313         Reviewed by Sam Weinig.
1314
1315         Disabled another JavaScriptCore test because it fails on Windows but
1316         not Mac, so it makes the bots red.
1317
1318         * tests/mozilla/expected.html:
1319
1320 2009-04-13  Geoffrey Garen  <ggaren@apple.com>
1321
1322         Reviewed by Sam Weinig.
1323         
1324         Disabled two JavaScriptCore tests because they fail on Window or Mac but
1325         not both, so they make the bots red.
1326
1327         * tests/mozilla/expected.html: Updated expected results.
1328
1329 2009-04-09  Ben Murdoch  <benm@google.com>
1330
1331         Reviewed by Alexey Proskuryakov.
1332
1333         https://bugs.webkit.org/show_bug.cgi?id=25091
1334         The Android platform requires threads to be registered with the VM.
1335         This patch implements this behaviour inside ThreadingPthreads.cpp.
1336
1337         * wtf/ThreadingPthreads.cpp: Add a level above threadEntryPoint that takes care of (un)registering threads with the VM.
1338         (WTF::runThreadWithRegistration): register the thread and run entryPoint. Unregister the thread afterwards.
1339         (WTF::createThreadInternal): call runThreadWithRegistration instead of entryPoint directly.
1340
1341 2009-04-09  David Kilzer  <ddkilzer@apple.com>
1342
1343         Reinstating <rdar://problem/6718589> Option to turn off SVG DOM Objective-C bindings
1344
1345         Rolled r42345 back in.  The build failure was caused by an
1346         internal script which had not been updated the same way that
1347         build-webkit was updated.
1348
1349         * Configurations/JavaScriptCore.xcconfig:
1350
1351 2009-04-09  Alexey Proskuryakov  <ap@webkit.org>
1352
1353         Reverting <rdar://problem/6718589> Option to turn off SVG DOM Objective-C bindings.
1354         It broke Mac build, and I don't know how to fix it.
1355
1356         * Configurations/JavaScriptCore.xcconfig:
1357
1358 2009-04-09  Xan Lopez  <xlopez@igalia.com>
1359
1360         Unreviewed build fix.
1361
1362         Checking for __GLIBCXX__ being bigger than some date is not enough
1363         to get std::tr1, C++0x has to be in use too. Add another check for
1364         __GXX_EXPERIMENTAL_CXX0X__.
1365
1366         * wtf/TypeTraits.h:
1367
1368 2009-04-08  Oliver Hunt  <oliver@apple.com>
1369
1370         Reviewed by Adam Roben.
1371
1372         Fix assertion failure in function.apply
1373
1374         The result of excess arguments to function.apply is irrelevant
1375         so we don't need to provide a result register.  We were providing
1376         temporary result register but not ref'ing it resulting in an
1377         assertion failure.
1378
1379         * parser/Nodes.cpp:
1380         (JSC::ApplyFunctionCallDotNode::emitBytecode):
1381
1382 2009-04-08  David Kilzer  <ddkilzer@apple.com>
1383
1384         <rdar://problem/6718589> Option to turn off SVG DOM Objective-C bindings
1385
1386         Reviewed by Darin Adler and Maciej Stachowiak.
1387
1388         Introduce the ENABLE_SVG_DOM_OBJC_BINDINGS feature define so
1389         that SVG DOM Objective-C bindings may be optionally disabled.
1390
1391         * Configurations/JavaScriptCore.xcconfig: Added
1392         ENABLE_SVG_DOM_OBJC_BINDINGS variable and use it in
1393         FEATURE_DEFINES.
1394
1395 2009-04-08  Paul Pedriana <ppedriana@ea.com>
1396
1397         Reviewed by Darin Adler.
1398
1399         https://bugs.webkit.org/show_bug.cgi?id=20422
1400         Allow custom memory allocation control.
1401         
1402         * wtf/FastAllocBase.h:
1403         New added file. Implements allocation base class.
1404         * wtf/TypeTraits.h:
1405         Augments existing type traits support as needed by FastAllocBase.
1406         * wtf/FastMalloc.h:
1407         Changed to support FastMalloc match validation.
1408         * wtf/FastMalloc.cpp:
1409         Changed to support FastMalloc match validation.
1410         * wtf/Platform.h:
1411         Added ENABLE_FAST_MALLOC_MATCH_VALIDATION; defaults to 0.
1412         * GNUmakefile.am:
1413         Updated to include added FastAllocBase.h.
1414         * JavaScriptCore.xcodeproj/project.pbxproj:
1415         Updated to include added FastAllocBase.h.
1416         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
1417         Updated to include added FastAllocBase.h.
1418
1419 2009-04-07  Oliver Hunt  <oliver@apple.com>
1420
1421         Reviewed by Geoff Garen.
1422
1423         Improve function.apply performance
1424
1425         Jump through a few hoops to improve performance of function.apply in the general case.
1426
1427         In the case of zero or one arguments, or if there are only two arguments and the
1428         second is an array literal we treat function.apply as function.call.
1429
1430         Otherwise we use the new opcodes op_load_varargs and op_call_varargs to do the .apply call
1431         without re-entering the virtual machine.
1432
1433         * bytecode/CodeBlock.cpp:
1434         (JSC::CodeBlock::dump):
1435         * bytecode/Opcode.h:
1436         * bytecompiler/BytecodeGenerator.cpp:
1437         (JSC::BytecodeGenerator::emitJumpIfNotFunctionApply):
1438         (JSC::BytecodeGenerator::emitLoadVarargs):
1439         (JSC::BytecodeGenerator::emitCallVarargs):
1440         * bytecompiler/BytecodeGenerator.h:
1441         * interpreter/Interpreter.cpp:
1442         (JSC::Interpreter::privateExecute):
1443         * jit/JIT.cpp:
1444         (JSC::JIT::privateCompileMainPass):
1445         (JSC::JIT::privateCompileSlowCases):
1446         * jit/JIT.h:
1447         * jit/JITCall.cpp:
1448         (JSC::JIT::compileOpCallSetupArgs):
1449         (JSC::JIT::compileOpCallVarargsSetupArgs):
1450         (JSC::JIT::compileOpCallVarargs):
1451         (JSC::JIT::compileOpCallVarargsSlowCase):
1452         * jit/JITStubs.cpp:
1453         (JSC::JITStubs::cti_op_load_varargs):
1454         * jit/JITStubs.h:
1455         * parser/Grammar.y:
1456         * parser/Nodes.cpp:
1457         (JSC::ArrayNode::isSimpleArray):
1458         (JSC::ArrayNode::toArgumentList):
1459         (JSC::CallFunctionCallDotNode::emitBytecode):
1460         (JSC::ApplyFunctionCallDotNode::emitBytecode):
1461         * parser/Nodes.h:
1462         (JSC::ExpressionNode::):
1463         (JSC::ApplyFunctionCallDotNode::):
1464         * runtime/Arguments.cpp:
1465         (JSC::Arguments::copyToRegisters):
1466         (JSC::Arguments::fillArgList):
1467         * runtime/Arguments.h:
1468         (JSC::Arguments::numProvidedArguments):
1469         * runtime/FunctionPrototype.cpp:
1470         (JSC::FunctionPrototype::addFunctionProperties):
1471         * runtime/FunctionPrototype.h:
1472         * runtime/JSArray.cpp:
1473         (JSC::JSArray::copyToRegisters):
1474         * runtime/JSArray.h:
1475         * runtime/JSGlobalObject.cpp:
1476         (JSC::JSGlobalObject::reset):
1477         (JSC::JSGlobalObject::mark):
1478         * runtime/JSGlobalObject.h:
1479
1480 2009-04-08  Alexey Proskuryakov  <ap@webkit.org>
1481
1482         Reviewed by Darin Adler.
1483
1484         https://bugs.webkit.org/show_bug.cgi?id=25073
1485         JavaScriptCore tests don't run if time zone is not PST
1486
1487         * API/tests/testapi.c:
1488         (timeZoneIsPST): Added a function that checks whether the time zone is PST, using the same
1489         method as functions in DateMath.cpp do for formatting the result.
1490         (main): Skip date string format test if the time zone is not PST.
1491
1492 2009-04-07  David Levin  <levin@chromium.org>
1493
1494         Reviewed by Sam Weinig and Geoff Garen.
1495
1496         https://bugs.webkit.org/show_bug.cgi?id=25039
1497         UString refactoring to support UChar* sharing.
1498
1499         No change in sunspider perf.
1500
1501         * runtime/SmallStrings.cpp:
1502         (JSC::SmallStringsStorage::SmallStringsStorage):
1503         * runtime/UString.cpp:
1504         (JSC::initializeStaticBaseString):
1505         (JSC::initializeUString):
1506         (JSC::UString::BaseString::isShared):
1507         Encapsulate the meaning behind the refcount == 1 checks because
1508         this needs to do slightly more when sharing is added.
1509         (JSC::concatenate):
1510         (JSC::UString::append):
1511         (JSC::UString::operator=):
1512         * runtime/UString.h:
1513         Make m_baseString part of a union to get rid of casts, but make it protected because
1514         it is tricky to use it correctly since it is only valid when the Rep is not a BaseString.
1515         The void* will be filled in when sharing is added.
1516
1517         Add constructors due to the making members protected and it make ensuring proper
1518         initialization work better (like in SmallStringsStorage).
1519         (JSC::UString::Rep::create):
1520         (JSC::UString::Rep::Rep):
1521         (JSC::UString::Rep::):
1522         (JSC::UString::BaseString::BaseString):
1523         (JSC::UString::Rep::setBaseString):
1524         (JSC::UString::Rep::baseString):
1525
1526 2009-04-04  Xan Lopez  <xlopez@igalia.com>
1527
1528         Reviewed by Alexey Proskuryakov.
1529
1530         https://bugs.webkit.org/show_bug.cgi?id=25033
1531         dtoa.cpp segfaults with g++ 4.4.0
1532
1533         g++ 4.4.0 seems to be more strict about aliasing rules, so it
1534         produces incorrect code if dtoa.cpp is compiled with
1535         -fstrict-aliasing (it also emits a ton of warnings, so fair enough
1536         I guess). The problem was that we were only casting variables to
1537         union types in order to do type punning, but GCC and the C
1538         standard require that we actually use a union to store the value.
1539
1540         This patch does just that, the code is mostly copied from the dtoa
1541         version in GCC:
1542         http://gcc.gnu.org/viewcvs/trunk/libjava/classpath/native/fdlibm/dtoa.c?view=markup.
1543
1544         * wtf/dtoa.cpp:
1545         (WTF::ulp):
1546         (WTF::b2d):
1547         (WTF::ratio):
1548         (WTF::hexnan):
1549         (WTF::strtod):
1550         (WTF::dtoa):
1551
1552 2009-04-04  Kevin Ollivier  <kevino@theolliviers.com>
1553
1554         wx build fix for Win port. Build the assembler sources to get missing functions.
1555
1556         * JavaScriptCoreSources.bkl:
1557         * jscore.bkl:
1558         * wtf/Platform.h:
1559
1560 2009-04-02  Darin Adler  <darin@apple.com>
1561
1562         Reviewed by Kevin Decker.
1563
1564         <rdar://problem/6744471> crash in GC due to uninitialized callFunction pointer
1565
1566         * runtime/JSGlobalObject.h:
1567         (JSC::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData): Initialize
1568         callFunction as we do the other data members that are used in the mark function.
1569
1570 2009-04-02  Yael Aharon  <yael.aharon@nokia.com>
1571
1572         Reviewed by Simon Hausmann
1573
1574         https://bugs.webkit.org/show_bug.cgi?id=24490
1575
1576         Implement WTF::ThreadSpecific in the Qt build using
1577         QThreadStorage.
1578
1579         * wtf/ThreadSpecific.h:
1580
1581 2009-04-01  Greg Bolsinga  <bolsinga@apple.com>
1582
1583         Reviewed by Mark Rowe.
1584
1585         https://bugs.webkit.org/show_bug.cgi?id=24990
1586         Put SECTORDER_FLAGS into xcconfig files.
1587
1588         * Configurations/Base.xcconfig:
1589         * Configurations/DebugRelease.xcconfig:
1590         * JavaScriptCore.xcodeproj/project.pbxproj:
1591
1592 2009-03-27  Oliver Hunt  <oliver@apple.com>
1593
1594         Reviewed by NOBODY (Build fix).
1595
1596         Fix non-AllInOneFile builds.
1597
1598         * bytecompiler/BytecodeGenerator.cpp:
1599
1600 2009-03-27  Oliver Hunt  <oliver@apple.com>
1601
1602         Reviewed by Gavin Barraclough.
1603
1604         Improve performance of Function.prototype.call
1605         <https://bugs.webkit.org/show_bug.cgi?id=24907>
1606
1607         Optimistically assume that expression.call(..) is going to be a call to
1608         Function.prototype.call, and handle it specially to attempt to reduce the
1609         degree of VM reentrancy.
1610
1611         When everything goes right this removes the vm reentry improving .call()
1612         by around a factor of 10.
1613
1614         * JavaScriptCore.xcodeproj/project.pbxproj:
1615         * bytecode/CodeBlock.cpp:
1616         (JSC::CodeBlock::dump):
1617         * bytecode/Opcode.h:
1618         * bytecompiler/BytecodeGenerator.cpp:
1619         (JSC::BytecodeGenerator::emitJumpIfNotFunctionCall):
1620         * bytecompiler/BytecodeGenerator.h:
1621         * interpreter/Interpreter.cpp:
1622         (JSC::Interpreter::privateExecute):
1623         * jit/JIT.cpp:
1624         (JSC::JIT::privateCompileMainPass):
1625         * parser/Grammar.y:
1626         * parser/Nodes.cpp:
1627         (JSC::CallFunctionCallDotNode::emitBytecode):
1628         * parser/Nodes.h:
1629         (JSC::CallFunctionCallDotNode::):
1630         * runtime/FunctionPrototype.cpp:
1631         (JSC::FunctionPrototype::addFunctionProperties):
1632         * runtime/FunctionPrototype.h:
1633         * runtime/JSGlobalObject.cpp:
1634         (JSC::JSGlobalObject::reset):
1635         (JSC::JSGlobalObject::mark):
1636         * runtime/JSGlobalObject.h:
1637
1638 2009-03-27  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
1639
1640         Reviewed by Darin Adler.
1641
1642         Bug 24884: Include strings.h for strcasecmp()
1643         https://bugs.webkit.org/show_bug.cgi?id=24884
1644
1645         * runtime/DateMath.cpp: Reversed previous change including strings.h
1646         * wtf/StringExtras.h: Include strings.h here is available
1647
1648 2009-03-26  Adam Roben  <aroben@apple.com>
1649
1650         Copy testapi.js to $WebKitOutputDir on Windows
1651
1652         Part of Bug 24856: run-javascriptcore-tests should run testapi on
1653         Windows
1654         <https://bugs.webkit.org/show_bug.cgi?id=24856>
1655
1656         This matches what Mac does, which will help once we enable running
1657         testapi from run-javascriptcore-tests on Windows.
1658
1659         Reviewed by Steve Falkenburg.
1660
1661         * JavaScriptCore.vcproj/testapi/testapi.vcproj: Copy testapi.js next
1662         to testapi.exe.
1663
1664 2009-03-25  Oliver Hunt  <oliver@apple.com>
1665
1666         Reviewed by Geoff Garen.
1667
1668         Fix exception handling for instanceof in the interpreter.
1669
1670         * interpreter/Interpreter.cpp:
1671         (JSC::Interpreter::privateExecute):
1672
1673 2009-03-25  Geoffrey Garen  <ggaren@apple.com>
1674
1675         Reviewed by Cameron Zwarich.
1676         
1677         Fixed <rdar://problem/6724011> Write to freed memory in JSC::Label::deref
1678         when reloading http://helpme.att.net/speedtest/
1679
1680         * bytecompiler/BytecodeGenerator.h: Reversed the declaration order for
1681         m_labelScopes and m_labels to reverse their destruction order.
1682         m_labelScopes has references to memory within m_labels, so its destructor
1683         needs to run first.
1684
1685 2009-03-24  Eli Fidler  <eli.fidler@torchmobile.com>
1686
1687         Reviewed by George Staikos.
1688
1689         Correct warnings which in some environments are treated as errors.
1690
1691         * wtf/dtoa.cpp:
1692         (WTF::b2d):
1693         (WTF::d2b):
1694         (WTF::strtod):
1695         (WTF::dtoa):
1696
1697 2009-03-24  Kevin Ollivier  <kevino@theolliviers.com>
1698
1699         Reviewed by Darin Adler.
1700         
1701         Explicitly define HAVE_LANGINFO_H on Darwin. Fixes the wx build bot jscore 
1702         test failure. 
1703         
1704         https://bugs.webkit.org/show_bug.cgi?id=24780
1705
1706         * wtf/Platform.h:
1707
1708 2009-03-23  Oliver Hunt  <oliver@apple.com>
1709
1710         Reviewed by Cameron Zwarich.
1711
1712         Fix className() for API defined class
1713
1714         * API/JSCallbackObjectFunctions.h:
1715         (JSC::::className):
1716         * API/tests/testapi.c:
1717         (EmptyObject_class):
1718         (main):
1719         * API/tests/testapi.js:
1720
1721 2009-03-23  Oliver Hunt  <oliver@apple.com>
1722
1723         Reviewed by Geoff Garen.
1724
1725         Make testapi assertions run in release builds, so that testapi actually
1726         works in a release build.
1727
1728         Many of the testapi assertions have side effects that are necessary, and
1729         given testapi is a testing program, perf impact of an assertion is not
1730         important, so it makes sense to apply the assertions in release builds
1731         anyway.
1732
1733         * API/tests/testapi.c:
1734         (EvilExceptionObject_hasInstance):
1735
1736 2009-03-23  David Kilzer  <ddkilzer@apple.com>
1737
1738         Provide JavaScript exception information after slow script timeout
1739
1740         Reviewed by Oliver Hunt.
1741
1742         * runtime/Completion.cpp:
1743         (JSC::evaluate): Set the exception object as the Completion
1744         object's value for slow script timeouts.  This is used in
1745         WebCore when reporting the exception.
1746         * runtime/ExceptionHelpers.cpp:
1747         (JSC::InterruptedExecutionError::toString): Added.  Provides a
1748         description message for the exception when it is reported.
1749
1750 2009-03-23  Gustavo Noronha Silva  <gns@gnome.org> and Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
1751
1752         Reviewed by Adam Roben.
1753
1754         https://bugs.webkit.org/show_bug.cgi?id=24674
1755         Crashes in !PLATFORM(MAC)'s formatLocaleDate, in very specific situations
1756
1757         Make sure strftime never returns 2-digits years to avoid ambiguity
1758         and a crash. We wrap this new code option in HAVE_LANGINFO_H,
1759         since it is apparently not available in all platforms.
1760
1761         * runtime/DatePrototype.cpp:
1762         (JSC::formatLocaleDate):
1763         * wtf/Platform.h:
1764
1765 2009-03-22  Oliver Hunt  <oliver@apple.com>
1766
1767         Reviewed by Cameron Zwarich.
1768
1769         Fix exception handling in API
1770
1771         We can't just use the ExecState exception slot for returning exceptions
1772         from class introspection functions provided through the API as many JSC
1773         functions will explicitly clear the ExecState exception when returning.
1774
1775         * API/JSCallbackObjectFunctions.h:
1776         (JSC::JSCallbackObject<Base>::getOwnPropertySlot):
1777         (JSC::JSCallbackObject<Base>::put):
1778         (JSC::JSCallbackObject<Base>::deleteProperty):
1779         (JSC::JSCallbackObject<Base>::construct):
1780         (JSC::JSCallbackObject<Base>::hasInstance):
1781         (JSC::JSCallbackObject<Base>::call):
1782         (JSC::JSCallbackObject<Base>::toNumber):
1783         (JSC::JSCallbackObject<Base>::toString):
1784         (JSC::JSCallbackObject<Base>::staticValueGetter):
1785         (JSC::JSCallbackObject<Base>::callbackGetter):
1786         * API/tests/testapi.c:
1787         (MyObject_hasProperty):
1788         (MyObject_getProperty):
1789         (MyObject_setProperty):
1790         (MyObject_deleteProperty):
1791         (MyObject_callAsFunction):
1792         (MyObject_callAsConstructor):
1793         (MyObject_hasInstance):
1794         (EvilExceptionObject_hasInstance):
1795         (EvilExceptionObject_convertToType):
1796         (EvilExceptionObject_class):
1797         (main):
1798         * API/tests/testapi.js:
1799         (EvilExceptionObject.hasInstance):
1800         (EvilExceptionObject.toNumber):
1801         (EvilExceptionObject.toStringExplicit):
1802
1803 2009-03-21  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
1804
1805         Reviewed by Oliver Hunt.
1806
1807         Bug 20049: testapi failure: MyObject - 0 should be NaN but instead is 1.
1808         <https://bugs.webkit.org/show_bug.cgi?id=20049>
1809         <rdar://problem/6079127>
1810
1811         In this case, the test is wrong. According to the ECMA spec, subtraction
1812         uses ToNumber, not ToPrimitive. Change the test to match the spec.
1813
1814         * API/tests/testapi.js:
1815
1816 2009-03-21  Oliver Hunt  <oliver@apple.com>
1817
1818         Reviewed by Cameron Zwarich.
1819
1820         Ensure that JSObjectMakeFunction doesn't produce incorrect line numbers.
1821
1822         Also make test api correctly propagate failures.
1823
1824         * API/tests/testapi.c:
1825         (main):
1826         * runtime/FunctionConstructor.cpp:
1827         (JSC::constructFunction):
1828
1829 2009-03-21  Oliver Hunt  <oliver@apple.com>
1830
1831         Reviewed by Mark Rowe.
1832
1833         Improve testapi by making it report failures in a way we can pick up
1834         from our test scripts.
1835
1836         * API/tests/testapi.c:
1837         (assertEqualsAsBoolean):
1838         (assertEqualsAsNumber):
1839         (assertEqualsAsUTF8String):
1840         (assertEqualsAsCharactersPtr):
1841         (main):
1842         * API/tests/testapi.js:
1843         (pass):
1844         (fail):
1845         (shouldBe):
1846         (shouldThrow):
1847
1848 2009-03-20  Norbert Leser  <norbert.leser@nokia.com>
1849
1850         Reviewed by Darin Adler.
1851
1852         https://bugs.webkit.org/show_bug.cgi?id=24535
1853
1854         Fixes missing line terminator character (;) after macro call.
1855         It is common practice to add the trailing ";" where macros are substituted
1856         and not where they are defined with #define.
1857         This change is consistent with other macro declarations across webkit,
1858         and it also solves compilation failure with symbian compilers. 
1859  
1860         * runtime/UString.cpp:
1861         * wtf/Assertions.h:
1862
1863 2009-03-20  Geoffrey Garen  <ggaren@apple.com>
1864
1865         Reviewed by Darin Adler.
1866         
1867         Fixed a JavaScriptCore crash on the Windows buildbot.
1868
1869         * bytecompiler/BytecodeGenerator.h: Reduced the AST recursion limit.
1870         Apparently, Windows has small stacks.
1871
1872 2009-03-20  Geoffrey Garen  <ggaren@apple.com>
1873
1874         Reviewed by Oliver Hunt.
1875         
1876         A little cleanup in the RegisterFile code.
1877         
1878         Moved large inline functions out of the class declaration, to make it
1879         more readable.
1880         
1881         Switched over to using the roundUpAllocationSize function to avoid
1882         duplicate code and subtle bugs.
1883         
1884         Renamed m_maxCommitted to m_commitEnd, to match m_end.
1885         
1886         Renamed allocationSize to commitSize because it's the chunk size for
1887         committing memory, not allocating memory.
1888         
1889         SunSpider reports no change.
1890
1891         * interpreter/RegisterFile.h:
1892         (JSC::RegisterFile::RegisterFile):
1893         (JSC::RegisterFile::shrink):
1894         (JSC::RegisterFile::grow):
1895         * jit/ExecutableAllocator.h:
1896         (JSC::roundUpAllocationSize):
1897
1898 2009-03-19  Geoffrey Garen  <ggaren@apple.com>
1899
1900         Reviewed by Oliver Hunt.
1901         
1902         Fixed <rdar://problem/6033712> -- a little bit of hardening in the Collector.
1903         
1904         SunSpider reports no change. I also verified in the disassembly that
1905         we end up with a single compare to constant.
1906
1907         * runtime/Collector.cpp:
1908         (JSC::Heap::heapAllocate):
1909
1910 2009-03-19  Geoffrey Garen  <ggaren@apple.com>
1911
1912         Reviewed by Cameron Zwarich and Oliver Hunt.
1913
1914         Fixed <rdar://problem/6406045> REGRESSION: Stack overflow on PowerPC on
1915         fast/workers/use-machine-stack.html (22531)
1916
1917         Dialed down the re-entry allowance to 64 (from 128).
1918         
1919         On a 512K stack, this leaves about 64K for other code on the stack while
1920         JavaScript is running. Not perfect, but it solves our crash on PPC.
1921
1922         Different platforms may want to dial this down even more.
1923
1924         Also, substantially shrunk BytecodeGenerator. Since we allocate one on
1925         the stack in order to throw a stack overflow exception -- well, let's
1926         just say the old code had an appreciation for irony.
1927
1928         SunSpider reports no change.
1929
1930         * bytecompiler/BytecodeGenerator.h:
1931         * interpreter/Interpreter.h:
1932         (JSC::):
1933
1934 2009-03-19  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
1935
1936         Reviewed by Oliver Hunt.
1937
1938         Bug 24350: REGRESSION: Safari 4 breaks SPAW wysiwyg editor multiple instances
1939         <https://bugs.webkit.org/show_bug.cgi?id=24350>
1940         <rdar://problem/6674182>
1941
1942         The SPAW editor's JavaScript assumes that toString() on a function
1943         constructed with the Function constructor produces a function with
1944         a newline after the opening brace.
1945
1946         * runtime/FunctionConstructor.cpp:
1947         (JSC::constructFunction): Add a newline after the opening brace of the
1948         function's source code.
1949
1950 2009-03-19  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
1951
1952         Reviewed by Geoff Garen.
1953
1954         Bug 23771: REGRESSION (r36016): JSObjectHasProperty freezes on global class without kJSClassAttributeNoAutomaticPrototype
1955         <https://bugs.webkit.org/show_bug.cgi?id=23771>
1956         <rdar://problem/6561016>
1957
1958         * API/tests/testapi.c:
1959         (main): Add a test for this bug.
1960         * runtime/JSGlobalObject.cpp:
1961         (JSC::JSGlobalObject::resetPrototype): Don't set the prototype of the
1962         last object in the prototype chain to the object prototype when the
1963         object prototype is already the last object in the prototype chain.
1964
1965 2009-03-19  Timothy Hatcher  <timothy@apple.com>
1966
1967         <rdar://problem/6687342> -[WebView scheduleInRunLoop:forMode:] has no affect on timers
1968
1969         Reviewed by Darin Adler.
1970
1971         * wtf/Platform.h: Added HAVE_RUNLOOP_TIMER for PLATFORM(MAC).
1972
1973 2009-03-19  Geoffrey Garen  <ggaren@apple.com>
1974
1975         Reviewed by Oliver Hunt.
1976         
1977         Fixed <rdar://problem/6279213> Regular expression run-time complexity
1978         limit too low for long inputs (21485)
1979         
1980         I raised PCRE's "matchLimit" (limit on backtracking) by an order of
1981         magnitude. This fixes all the reported examples of timing out on legitimate
1982         regular expression matches.
1983         
1984         In my testing on a Core Duo MacBook Pro, the longest you can get stuck
1985         trying to match a string is still under 1s, so this seems like a safe change.
1986         
1987         I can think of a number of better solutions that are more complicated,
1988         but this is a good improvement for now.
1989
1990         * pcre/pcre_exec.cpp:
1991
1992 2009-03-19  Geoffrey Garen  <ggaren@apple.com>
1993
1994         Reviewed by Sam Weinig.
1995         
1996         Fixed <rdar://problem/6603562> REGRESSION (Safari 4): regular expression
1997         pattern size limit lower than Safari 3.2, other browsers, breaks SAP (14873)
1998         
1999         Bumped the pattern size limit to 1MB, and standardized it between PCRE
2000         and WREC. (Empirical testing says that we can easily compile a 1MB regular
2001         expression without risking a hang. Other browsers support bigger regular
2002         expressions, but also hang.)
2003         
2004         SunSpider reports no change.
2005         
2006         I started with a patch posted to Bugzilla by Erik Corry (erikcorry@google.com).
2007         
2008         * pcre/pcre_internal.h:
2009         (put3ByteValue):
2010         (get3ByteValue):
2011         (put3ByteValueAndAdvance):
2012         (putLinkValueAllowZero):
2013         (getLinkValueAllowZero): Made PCRE's "LINK_SIZE" (the number of bytes
2014         used to record jumps between bytecodes) 3, to accomodate larger potential
2015         jumps. Bumped PCRE's "MAX_PATTERN_SIZE" to 1MB. (Technically, at this
2016         LINK_SIZE, we can support even larger patterns, but we risk a hang during
2017         compilation, and it's not clear that such large patterns are important
2018         on the web.)
2019
2020         * wrec/WREC.cpp:
2021         (JSC::WREC::Generator::compileRegExp): Match PCRE's maximum pattern size,
2022         to avoid quirks between platforms.
2023
2024 2009-03-18  Ada Chan  <adachan@apple.com>
2025
2026         Rolling out r41818 since it broke the windows build.
2027         Error: ..\..\runtime\DatePrototype.cpp(30) : fatal error C1083: Cannot open include file: 'langinfo.h': No such file or directory
2028
2029         * runtime/DatePrototype.cpp:
2030         (JSC::formatLocaleDate):
2031
2032 2009-03-17  Oliver Hunt  <oliver@apple.com>
2033
2034         Reviewed by Cameron Zwarich.
2035
2036         <rdar://problem/6692138> REGRESSION (Safari 4): Incorrect function return value when using IE "try ... finally" memory leak work-around (24654)
2037         <https://bugs.webkit.org/show_bug.cgi?id=24654>
2038
2039         If the return value for a function is in a local register we need
2040         to copy it before executing any finalisers, otherwise it is possible
2041         for the finaliser to clobber the result.
2042
2043         * bytecompiler/BytecodeGenerator.h:
2044         (JSC::BytecodeGenerator::hasFinaliser):
2045         * parser/Nodes.cpp:
2046         (JSC::ReturnNode::emitBytecode):
2047
2048 2009-03-17  Kevin Ollivier  <kevino@theolliviers.com>
2049
2050         Reviewed by Mark Rowe.
2051         
2052         Move BUILDING_ON_* defines into Platform.h to make them available to other ports.
2053         Also tweak the defines so that they work with the default values set by 
2054         AvailabilityMacros.h.
2055
2056         https://bugs.webkit.org/show_bug.cgi?id=24630
2057
2058         * JavaScriptCorePrefix.h:
2059         * wtf/Platform.h:
2060
2061 2009-03-15  Simon Fraser  <simon.fraser@apple.com>
2062
2063         Revert r41718 because it broke DumpRenderTree on Tiger.
2064
2065         * JavaScriptCorePrefix.h:
2066         * wtf/Platform.h:
2067
2068 2009-03-15  Kevin Ollivier  <kevino@theolliviers.com>
2069
2070         Non-Apple Mac ports build fix. Move defines for the BUILDING_ON_ macros into
2071         Platform.h so that they're defined for all ports building on Mac, and tweak
2072         the definitions of those macros based on Mark Rowe's suggestions to accomodate
2073         cases where the values may not be <= to the .0 release for that version.
2074
2075         * JavaScriptCorePrefix.h:
2076         * wtf/Platform.h:
2077
2078 2009-03-13  Mark Rowe  <mrowe@apple.com>
2079
2080         Rubber-stamped by Dan Bernstein.
2081
2082         Take advantage of the ability of recent versions of Xcode to easily switch the active
2083         architecture.
2084
2085         * Configurations/DebugRelease.xcconfig:
2086
2087 2009-03-13  Mark Rowe  <mrowe@apple.com>
2088
2089         Reviewed by David Kilzer.
2090
2091         Prevent AllInOneFile.cpp and ProfileGenerator.cpp from rebuilding unnecessarily when
2092         switching between building in Xcode and via build-webkit.
2093
2094         build-webkit passes FEATURE_DEFINES to xcodebuild, resulting in it being present in the
2095         Derived Sources build settings.  When building in Xcode, this setting isn't present so
2096         Xcode reruns the script build phases.  This results in a new version of TracingDtrace.h
2097         being generated, and the files that include it being rebuilt.
2098
2099         * JavaScriptCore.xcodeproj/project.pbxproj:  Don't regenerate TracingDtrace.h if it is
2100         already newer than the input file.
2101
2102 2009-03-13  Norbert Leser  <norbert.leser@nokia.com>
2103
2104         Reviewed by Darin Adler.
2105
2106         Resolved name conflict with globally defined tzname in Symbian.
2107         Replaced with different name instead of using namespace qualifier
2108         (appeared to be less clumsy).
2109
2110         * runtime/DateMath.cpp:
2111
2112 2009-03-12  Mark Rowe  <mrowe@apple.com>
2113
2114         Reviewed by Darin Adler.
2115
2116         <rdar://problem/6548446> TCMalloc_SystemRelease should use madvise rather than re-mmaping span of pages
2117
2118         * wtf/FastMalloc.cpp:
2119         (WTF::mergeDecommittedStates): If either of the spans has been released to the system, release the other
2120         span as well so that the flag in the merged span is accurate.
2121         * wtf/Platform.h:
2122         * wtf/TCSystemAlloc.cpp: Track decommitted spans when using MADV_FREE_REUSABLE / MADV_FREE_REUSE.
2123         (TCMalloc_SystemRelease): Use madvise with MADV_FREE_REUSABLE when it is available.
2124         (TCMalloc_SystemCommit): Use madvise with MADV_FREE_REUSE when it is available.
2125         * wtf/TCSystemAlloc.h:
2126
2127 2009-03-12  Adam Treat  <adam.treat@torchmobile.com>
2128
2129         Reviewed by NOBODY (Build fix).
2130
2131         Include string.h for strlen usage.
2132
2133         * wtf/Threading.cpp:
2134
2135 2009-03-12  David Kilzer  <ddkilzer@apple.com>
2136
2137         Add NO_RETURN attribute to runInteractive() when not using readline
2138
2139         Reviewed by Darin Adler.
2140
2141         * jsc.cpp:
2142         (runInteractive): If the readline library is not used, this method
2143         will never return, thus the NO_RETURN attribute is needed to prevent
2144         a gcc warning.
2145
2146 2009-03-12  Adam Roben  <aroben@apple.com>
2147
2148         Adopt setThreadNameInternal on Windows
2149
2150         Also changed a Windows-only assertion about thread name length to an
2151         all-platform log message.
2152
2153         Reviewed by Adam Treat.
2154
2155         * wtf/Threading.cpp:
2156         (WTF::createThread): Warn if the thread name is longer than 31
2157         characters, as Visual Studio will truncate names longer than that
2158         length.
2159
2160         * wtf/ThreadingWin.cpp:
2161         (WTF::setThreadNameInternal): Renamed from setThreadName and changed
2162         to always operate on the current thread.
2163         (WTF::initializeThreading): Changed to use setThreadNameInternal.
2164         (WTF::createThreadInternal): Removed call to setThreadName. This is
2165         now handled by threadEntryPoint and setThreadNameInternal.
2166
2167 2009-03-11  David Kilzer  <ddkilzer@apple.com>
2168
2169         Clarify comments regarding order of FEATURE_DEFINES
2170
2171         Rubber-stamped by Mark Rowe.
2172
2173         * Configurations/JavaScriptCore.xcconfig: Added warning about
2174         the consequences when FEATURE_DEFINES are not kept in sync.
2175
2176 2009-03-11  Dan Bernstein  <mitz@apple.com>
2177
2178         Reviewed by Darin Adler.
2179
2180         - WTF support for fixing <rdar://problem/3919124> Thai text selection
2181           in Safari is incorrect
2182
2183         * wtf/unicode/icu/UnicodeIcu.h:
2184         (WTF::Unicode::hasLineBreakingPropertyComplexContext): Added. Returns
2185         whether the character has Unicode line breaking property value SA
2186         ("Complex Context").
2187         * wtf/unicode/qt4/UnicodeQt4.h:
2188         (WTF::Unicode::hasLineBreakingPropertyComplexContext): Added an
2189         implementation that always returns false.
2190
2191 2009-03-11  Darin Adler  <darin@apple.com>
2192
2193         Reviewed by Mark Rowe.
2194
2195         Give threads names on platforms with pthread_setname_np.
2196
2197         * wtf/Threading.cpp:
2198         (WTF::NewThreadContext::NewThreadContext): Initialize thread name.
2199         (WTF::threadEntryPoint): Call setThreadNameInternal.
2200         (WTF::createThread): Pass thread name.
2201
2202         * wtf/Threading.h: Added new comments, setThreadNameInternal.
2203
2204         * wtf/ThreadingGtk.cpp:
2205         (WTF::setThreadNameInternal): Added. Empty.
2206         * wtf/ThreadingNone.cpp:
2207         (WTF::setThreadNameInternal): Added. Empty.
2208         * wtf/ThreadingPthreads.cpp:
2209         (WTF::setThreadNameInternal): Call pthread_setname_np when available.
2210         * wtf/ThreadingQt.cpp:
2211         (WTF::setThreadNameInternal): Added. Empty.
2212         * wtf/ThreadingWin.cpp:
2213         (WTF::setThreadNameInternal): Added. Empty.
2214
2215 2009-03-11  Adam Roben  <aroben@apple.com>
2216
2217         Change the Windows implementation of ThreadSpecific to use functions
2218         instead of extern globals
2219
2220         This will make it easier to export ThreadSpecific from WebKit.
2221
2222         Reviewed by John Sullivan.
2223
2224         * API/JSBase.cpp:
2225         (JSEvaluateScript): 
2226         Touched this file to force ThreadSpecific.h to be copied into
2227         $WebKitOutputDir.
2228
2229         * wtf/ThreadSpecific.h: Replaced g_tls_key_count with tlsKeyCount()
2230         and g_tls_keys with tlsKeys().
2231
2232         (WTF::::ThreadSpecific):
2233         (WTF::::~ThreadSpecific):
2234         (WTF::::get):
2235         (WTF::::set):
2236         (WTF::::destroy):
2237         Updated to use the new functions.
2238
2239         * wtf/ThreadSpecificWin.cpp:
2240         (WTF::tlsKeyCount):
2241         (WTF::tlsKeys):
2242         Added.
2243
2244         (WTF::ThreadSpecificThreadExit): Changed to use the new functions.
2245
2246 2009-03-10  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2247
2248         Reviewed by Geoff Garen.
2249
2250         Bug 24291: REGRESSION (r38635): Single line JavaScript comment prevents HTML button click handler execution
2251         <https://bugs.webkit.org/show_bug.cgi?id=24291>
2252         <rdar://problem/6663472>
2253
2254         Add an extra newline to the end of the body of the program text constructed
2255         by the Function constructor for parsing. This allows single line comments to
2256         be handled correctly by the parser.
2257
2258         * runtime/FunctionConstructor.cpp:
2259         (JSC::constructFunction):
2260
2261 2009-03-09  Oliver Hunt  <oliver@apple.com>
2262
2263         Reviewed by Gavin Barraclough.
2264
2265         Bug 24447: REGRESSION (r41508): Google Maps does not complete initialization
2266         <rdar://problem/6657774>
2267
2268         r41508 actually exposed a pre-existing bug where we were not invalidating the result
2269         register cache at jump targets.  This causes problems when condition loads occur in an
2270         expression -- namely through the ?: and || operators.  This patch corrects these issues
2271         by marking the target of all forward jumps as being a jump target, and then clears the
2272         result register cache when ever it starts generating code for a targeted instruction.
2273
2274         I do not believe it is possible to cause this class of failure outside of a single
2275         expression, and expressions only provide forward branches, so this should resolve this
2276         entire class of bug.  That said i've included a test case that gets as close as possible
2277         to hitting this bug with a back branch, to hopefully prevent anyone from introducing the
2278         problem in future.
2279
2280         * assembler/AbstractMacroAssembler.h:
2281         (JSC::AbstractMacroAssembler::Label::isUsed):
2282         (JSC::AbstractMacroAssembler::Label::used):
2283         * assembler/X86Assembler.h:
2284         (JSC::X86Assembler::JmpDst::JmpDst):
2285         (JSC::X86Assembler::JmpDst::isUsed):
2286         (JSC::X86Assembler::JmpDst::used):
2287         * jit/JIT.cpp:
2288         (JSC::JIT::privateCompileMainPass):
2289
2290 2009-03-09  David Levin  <levin@chromium.org>
2291
2292         Reviewed by Darin Adler.
2293
2294         Bug 23175: String and UString should be able to share a UChar* buffer.
2295         <https://bugs.webkit.org/show_bug.cgi?id=23175>
2296
2297         Add CrossThreadRefCounted.
2298
2299         * wtf/CrossThreadRefCounted.h: Added.
2300         (WTF::CrossThreadRefCounted::create):
2301         (WTF::CrossThreadRefCounted::isShared):
2302         (WTF::CrossThreadRefCounted::dataAccessMustBeThreadSafe):
2303         (WTF::CrossThreadRefCounted::mayBePassedToAnotherThread):
2304         (WTF::CrossThreadRefCounted::CrossThreadRefCounted):
2305         (WTF::CrossThreadRefCounted::~CrossThreadRefCounted):
2306         (WTF::CrossThreadRefCounted::ref):
2307         (WTF::CrossThreadRefCounted::deref):
2308         (WTF::CrossThreadRefCounted::release):
2309         (WTF::CrossThreadRefCounted::copy):
2310         (WTF::CrossThreadRefCounted::threadSafeDeref):
2311         * wtf/RefCounted.h:
2312         * wtf/Threading.h:
2313         (WTF::ThreadSafeSharedBase::ThreadSafeSharedBase):
2314         (WTF::ThreadSafeSharedBase::derefBase):
2315         (WTF::ThreadSafeShared::ThreadSafeShared):
2316         (WTF::ThreadSafeShared::deref):
2317
2318 2009-03-09  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
2319
2320         Reviewed by George Staikos.
2321
2322         https://bugs.webkit.org/show_bug.cgi?id=24353
2323         Allow to overrule default build options for Qt build.
2324
2325         * JavaScriptCore.pri: Allow to overrule ENABLE_JIT
2326
2327 2009-03-08  Oliver Hunt  <oliver@apple.com>
2328
2329         Reviewed by NOBODY (build fix).
2330
2331         Build fix.
2332
2333         * runtime/ArrayPrototype.cpp:
2334         (JSC::arrayProtoFuncConcat):
2335
2336 2009-03-01  Oliver Hunt  <oliver@apple.com>
2337
2338         Reviewed by Cameron Zwarich.
2339
2340         Bug 24268: RuntimeArray is not a fully implemented JSArray
2341         <https://bugs.webkit.org/show_bug.cgi?id=24268>
2342
2343         Don't cast a type to JSArray, just because it reportsArray as a supertype
2344         in the JS type system.  Doesn't appear feasible to create a testcase
2345         unfortunately as setting up the failure conditions requires internal access 
2346         to JSC not present in DRT.
2347
2348         * runtime/ArrayPrototype.cpp:
2349         (JSC::arrayProtoFuncConcat):
2350
2351 2009-03-06  Gavin Barraclough  <barraclough@apple.com>
2352
2353         Reviewed by Oliver Hunt.
2354
2355         When preforming an op_mov, preserve any existing register mapping.
2356
2357         ~0.5% progression on v8 tests x86-64.
2358
2359         * jit/JIT.cpp:
2360         (JSC::JIT::privateCompileMainPass):
2361
2362 2009-03-05  Simone Fiorentino  <simone.fiorentino@consulenti.fastweb.it>
2363
2364         Bug 24382: request to add SH4 platform
2365
2366         <https://bugs.webkit.org/show_bug.cgi?id=24382>
2367
2368         Reviewed by David Kilzer.
2369
2370         * wtf/Platform.h: Added support for SH4 platform.
2371
2372 2009-03-05  Gavin Barraclough  <barraclough@apple.com>
2373
2374         Reviewed by Oliver Hunt.
2375
2376         Writes of constant values to SF registers should be made with direct memory
2377         writes where possible, rather than moving the value via a hardware register.
2378
2379         ~3% win on SunSpider tests on x86, ~1.5% win on v8 tests on x86-64.
2380
2381         * assembler/MacroAssemblerX86_64.h:
2382         (JSC::MacroAssemblerX86_64::storePtr):
2383         * assembler/X86Assembler.h:
2384         (JSC::X86Assembler::movq_i32m):
2385         * jit/JIT.cpp:
2386         (JSC::JIT::privateCompileMainPass):
2387
2388 2009-03-05  Mark Rowe  <mrowe@apple.com>
2389
2390         Fix the build.
2391
2392         Sprinkle "static" around NumberConstructor.cpp in order to please the compiler.
2393
2394         * runtime/NumberConstructor.cpp:
2395         (JSC::numberConstructorNaNValue):
2396         (JSC::numberConstructorNegInfinity):
2397         (JSC::numberConstructorPosInfinity):
2398         (JSC::numberConstructorMaxValue):
2399         (JSC::numberConstructorMinValue):
2400
2401 2009-03-04  Mark Rowe  <mrowe@apple.com>
2402
2403         Reviewed by Oliver Hunt.
2404
2405         <rdar://problem/6354858> FastMallocZone's enumeration code reports fragmented administration space
2406
2407         The handling of MALLOC_ADMIN_REGION_RANGE_TYPE in FastMalloc's zone was incorrect.  It was attempting
2408         to record the memory containing and individual span as an administrative region, when all memory
2409         allocated via MetaDataAlloc should in fact be recorded.  This was causing memory regions allocated
2410         via MetaDataAlloc to appear as "VM_ALLOCATE ?" in vmmap output.  They are now correctly reported as
2411         "MALLOC_OTHER" regions associated with the JavaScriptCore FastMalloc zone.
2412
2413         Memory is allocated via MetaDataAlloc from two locations: PageHeapAllocator, and TCMalloc_PageMap{2,3}.
2414         These two cases are handled differently.
2415
2416         PageHeapAllocator is extended to keep a linked list of memory regions that it has allocated.  The
2417         first object in an allocated region contains the link to the previously allocated region. To record
2418         the administrative regions of a PageHeapAllocator we can simply walk the linked list and record
2419         each allocated region we encounter.
2420
2421         TCMalloc_PageMaps allocate memory via MetaDataAlloc to store each level of the radix tree.  To record
2422         the administrative regions of a TCMalloc_PageMap we walk the tree and record the storage used for nodes
2423         at each position rather than the nodes themselves.
2424
2425         A small performance improvement is achieved by coalescing adjacent memory regions inside the PageMapMemoryUsageRecorder
2426         so that fewer calls in to the range recorder are necessary.  We further reduce the number of calls to the
2427         range recorder by aggregating the in-use ranges of a given memory region into a local buffer before recording
2428         them with a single call.  A similar approach is also used by AdminRegionRecorder.
2429
2430         * wtf/FastMalloc.cpp:
2431         (WTF::PageHeapAllocator::Init):
2432         (WTF::PageHeapAllocator::New):
2433         (WTF::PageHeapAllocator::recordAdministrativeRegions):
2434         (WTF::TCMallocStats::FreeObjectFinder::isFreeObject):
2435         (WTF::TCMallocStats::PageMapMemoryUsageRecorder::~PageMapMemoryUsageRecorder):
2436         (WTF::TCMallocStats::PageMapMemoryUsageRecorder::recordPendingRegions):
2437         (WTF::TCMallocStats::PageMapMemoryUsageRecorder::visit):
2438         (WTF::TCMallocStats::AdminRegionRecorder::AdminRegionRecorder):
2439         (WTF::TCMallocStats::AdminRegionRecorder::recordRegion):
2440         (WTF::TCMallocStats::AdminRegionRecorder::visit):
2441         (WTF::TCMallocStats::AdminRegionRecorder::recordPendingRegions):
2442         (WTF::TCMallocStats::AdminRegionRecorder::~AdminRegionRecorder):
2443         (WTF::TCMallocStats::FastMallocZone::enumerate):
2444         (WTF::TCMallocStats::FastMallocZone::FastMallocZone):
2445         (WTF::TCMallocStats::FastMallocZone::init):
2446         * wtf/TCPageMap.h:
2447         (TCMalloc_PageMap2::visitValues):
2448         (TCMalloc_PageMap2::visitAllocations):
2449         (TCMalloc_PageMap3::visitValues):
2450         (TCMalloc_PageMap3::visitAllocations):
2451
2452 2009-03-04  Antti Koivisto  <antti@apple.com>
2453
2454         Reviewed by Dave Hyatt.
2455
2456         https://bugs.webkit.org/show_bug.cgi?id=24359
2457         Repaint throttling mechanism
2458         
2459         Set ENABLE_REPAINT_THROTTLING to 0 by default.
2460
2461         * wtf/Platform.h:
2462
2463 2009-03-03  David Kilzer  <ddkilzer@apple.com>
2464
2465         <rdar://problem/6581203> WebCore and WebKit should install the same set of headers during installhdrs phase as build phase
2466
2467         Reviewed by Mark Rowe.
2468
2469         * Configurations/Base.xcconfig: Defined REAL_PLATFORM_NAME based
2470         on PLATFORM_NAME to work around the missing definition on Tiger.
2471         Updated HAVE_DTRACE to use REAL_PLATFORM_NAME.
2472
2473 2009-03-03  Kevin McCullough  <kmccullough@apple.com>
2474
2475         Reviewed by Oliver Hunt.
2476
2477         <rdar://problem/6639110> console.profile() doesn't work without a title
2478
2479         * profiler/Profiler.cpp:
2480         (JSC::Profiler::startProfiling): assert if there is not title to ensure
2481         we don't start profiling without one.
2482
2483 2009-03-02  Sam Weinig  <sam@webkit.org>
2484
2485         Reviewed by Mark Rowe.
2486
2487         Enable Geolocation (except on Tiger and Leopard).
2488
2489         * Configurations/JavaScriptCore.xcconfig:
2490
2491 2009-03-01  David Kilzer  <ddkilzer@apple.com>
2492
2493         <rdar://problem/6635688> Move HAVE_DTRACE check to Base.xcconfig
2494
2495         Reviewed by Mark Rowe.
2496
2497         * Configurations/Base.xcconfig: Set HAVE_DTRACE Xcode variable
2498         based on PLATFORM_NAME and MAC_OS_X_VERSION_MAJOR.  Also define
2499         it as a preprocessor macro by modifying
2500         GCC_PREPROCESSOR_DEFINITIONS.
2501         * JavaScriptCore.xcodeproj/project.pbxproj: Changed "Generate
2502         DTrace header" script phase to check for HAVE_DTRACE instead of
2503         MACOSX_DEPLOYMENT_TARGET.
2504         * wtf/Platform.h: Removed definition of HAVE_DTRACE macro since
2505         it's defined in Base.xcconfig now.
2506
2507 2009-03-01  Horia Olaru  <olaru@adobe.com>
2508
2509         By looking in grammar.y there are only a few types of statement nodes
2510         on which the debugger should stop. 
2511
2512         Removed isBlock and isLoop virtual calls. No need to emit debug hooks in
2513         the "statementListEmitCode" method as long as the necessary hooks can be
2514         added in each "emitCode".
2515
2516         https://bugs.webkit.org/show_bug.cgi?id=21073
2517
2518         Reviewed by Kevin McCullough.
2519
2520         * parser/Nodes.cpp:
2521         (JSC::ConstStatementNode::emitBytecode):
2522         (JSC::statementListEmitCode):
2523         (JSC::EmptyStatementNode::emitBytecode):
2524         (JSC::ExprStatementNode::emitBytecode):
2525         (JSC::VarStatementNode::emitBytecode):
2526         (JSC::IfNode::emitBytecode):
2527         (JSC::IfElseNode::emitBytecode):
2528         (JSC::DoWhileNode::emitBytecode):
2529         (JSC::WhileNode::emitBytecode):
2530         (JSC::ForNode::emitBytecode):
2531         (JSC::ForInNode::emitBytecode):
2532         (JSC::ContinueNode::emitBytecode):
2533         (JSC::BreakNode::emitBytecode):
2534         (JSC::ReturnNode::emitBytecode):
2535         (JSC::WithNode::emitBytecode):
2536         (JSC::SwitchNode::emitBytecode):
2537         (JSC::LabelNode::emitBytecode):
2538         (JSC::ThrowNode::emitBytecode):
2539         (JSC::TryNode::emitBytecode):
2540         * parser/Nodes.h:
2541
2542 2009-02-26  Gavin Barraclough  <barraclough@apple.com>
2543
2544         Reviewed by Geoff Garen.
2545
2546         Fix bug #23614.  Switches on double precision values were incorrectly
2547         truncating the scrutinee value.  E.g.:
2548
2549             switch (1.1) { case 1: print("FAIL"); }
2550
2551         Was resulting in FAIL.
2552
2553         * interpreter/Interpreter.cpp:
2554         (JSC::Interpreter::privateExecute):
2555         * jit/JITStubs.cpp:
2556         (JSC::JITStubs::cti_op_switch_imm):
2557
2558 2009-02-26  Gavin Barraclough  <barraclough@apple.com>
2559
2560         Reviewed by Oliver Hunt.
2561
2562         Integer Immediate representation need not be canonical in x86 JIT code.
2563         On x86-64 we already have loosened the requirement that the int immediate
2564         representation in canonical, we should bring x86 into line.
2565
2566         This patch is a minor (~0.5%) improvement on sunspider & v8-tests, and
2567         should reduce memory footoprint (reduces JIT code size).
2568
2569         * jit/JIT.cpp:
2570         (JSC::JIT::compileOpStrictEq):
2571         (JSC::JIT::privateCompileSlowCases):
2572         * jit/JIT.h:
2573         (JSC::JIT::emitJumpIfImmediateNumber):
2574         (JSC::JIT::emitJumpIfNotImmediateNumber):
2575         * jit/JITArithmetic.cpp:
2576         (JSC::JIT::putDoubleResultToJSNumberCellOrJSImmediate):
2577         (JSC::JIT::compileBinaryArithOp):
2578
2579 2009-02-26  Carol Szabo  <carol.szabo@nokia.com>
2580
2581         Reviewed by Darin Adler.
2582
2583         https://bugs.webkit.org/show_bug.cgi?id=24099
2584         ARM Compiler Warnings in pcre_exec.cpp
2585
2586         * pcre/pcre_exec.cpp:
2587         (match):
2588
2589 2009-02-25  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2590
2591         Reviewed by Gavin Barraclough.
2592
2593         Bug 24086: Regression (r40993): WebKit crashes after logging in to lists.zenbe
2594         <https://bugs.webkit.org/show_bug.cgi?id=24086>
2595         <rdar://problem/6625111>
2596
2597         The numeric sort optimization in r40993 generated bytecode for a function
2598         without generating JIT code. This breaks an assumption in some parts of
2599         the JIT's function calling logic that the presence of a CodeBlock implies
2600         the existence of JIT code.
2601
2602         In order to fix this, we simply generate JIT code whenever we check whether
2603         a function is a numeric sort function. This only incurs an additional cost
2604         in the case when the function is a numeric sort function, in which case it
2605         is not expensive to generate JIT code for it.
2606
2607         * runtime/ArrayPrototype.cpp:
2608         (JSC::isNumericCompareFunction):
2609
2610 2009-02-25  Geoffrey Garen  <ggaren@apple.com>
2611
2612         Reviewed by Maciej Stachowiak.
2613         
2614         Fixed <rdar://problem/6611174> REGRESSION (r36701): Unable to select
2615         messages on hotmail (24052)
2616         
2617         The bug was that for-in enumeration used a cached prototype chain without
2618         validating that it was up-to-date.
2619         
2620         This led me to refactor prototype chain caching so it was easier to work
2621         with and harder to get wrong.
2622         
2623         After a bit of inlining, this patch is performance-neutral on SunSpider
2624         and the v8 benchmarks.
2625
2626         * interpreter/Interpreter.cpp:
2627         (JSC::Interpreter::tryCachePutByID):
2628         (JSC::Interpreter::tryCacheGetByID):
2629         * jit/JITStubs.cpp:
2630         (JSC::JITStubs::tryCachePutByID):
2631         (JSC::JITStubs::tryCacheGetByID):
2632         (JSC::JITStubs::cti_op_get_by_id_proto_list): Use the new refactored goodness. See
2633         lines beginning with "-" and smile.
2634
2635         * runtime/JSGlobalObject.h:
2636         (JSC::Structure::prototypeForLookup): A shout out to const.
2637
2638         * runtime/JSPropertyNameIterator.h:
2639         (JSC::JSPropertyNameIterator::next): We can use a pointer comparison to
2640         see if our cached structure chain is equal to the object's structure chain,
2641         since in the case of a cache hit, we share references to the same structure
2642         chain.
2643
2644         * runtime/Operations.h:
2645         (JSC::countPrototypeChainEntriesAndCheckForProxies): Use the new refactored
2646         goodness.
2647
2648         * runtime/PropertyNameArray.h:
2649         (JSC::PropertyNameArray::PropertyNameArray):
2650         (JSC::PropertyNameArray::setShouldCache):
2651         (JSC::PropertyNameArray::shouldCache): Renamed "cacheable" to "shouldCache"
2652         to communicate that the client is specifying a recommendation, not a
2653         capability.
2654         
2655         * runtime/Structure.cpp:
2656         (JSC::Structure::Structure): No need to initialize a RefPtr.
2657         (JSC::Structure::getEnumerablePropertyNames): Moved some code into helper
2658         functions.
2659
2660         (JSC::Structure::prototypeChain): New centralized accessor for a prototype
2661         chain. Revalidates on every access, since the objects in the prototype
2662         chain may have mutated.
2663
2664         (JSC::Structure::isValid): Helper function for revalidating a cached
2665         prototype chain.
2666
2667         (JSC::Structure::getEnumerableNamesFromPropertyTable):
2668         (JSC::Structure::getEnumerableNamesFromClassInfoTable): Factored out of
2669         getEnumerablePropertyNames.
2670
2671         * runtime/Structure.h:
2672
2673         * runtime/StructureChain.cpp:
2674         (JSC::StructureChain::StructureChain):
2675         * runtime/StructureChain.h:
2676         (JSC::StructureChain::create): No need for structureChainsAreEqual, since
2677         we use pointer equality now. Refactored StructureChain to make a little
2678         more sense and eliminate special cases for null prototypes.
2679
2680 2009-02-25  Steve Falkenburg  <sfalken@apple.com>
2681
2682         Use timeBeginPeriod to enable timing resolution greater than 16ms in command line jsc for Windows.
2683         Allows more accurate reporting of benchmark times via command line jsc.exe. Doesn't affect WebKit's use of JavaScriptCore.
2684         
2685         Reviewed by Adam Roben.
2686
2687         * jsc.cpp:
2688         (main):
2689
2690 2009-02-24  Geoffrey Garen  <ggaren@apple.com>
2691
2692         Build fix?
2693
2694         * GNUmakefile.am:
2695
2696 2009-02-24  Mark Rowe  <mrowe@apple.com>
2697
2698         Reviewed by Oliver Hunt.
2699
2700         <rdar://problem/6259220> Rename AVAILABLE_AFTER_WEBKIT_VERSION_3_1 (etc.) to match the other macros
2701
2702         * API/JSBasePrivate.h:
2703         * API/JSContextRef.h:
2704         * API/JSObjectRef.h:
2705         * API/WebKitAvailability.h:
2706
2707 2009-02-23  Geoffrey Garen  <ggaren@apple.com>
2708
2709         Reviewed by Sam Weinig.
2710
2711         Next step in splitting JIT functionality out of the Interpreter class:
2712         Moved vptr storage from Interpreter to JSGlobalData, so it could be shared
2713         between Interpreter and JITStubs, and moved the *Trampoline JIT stubs
2714         into the JITStubs class. Also added a VPtrSet class to encapsulate vptr
2715         hacks during JSGlobalData initialization.
2716         
2717         SunSpider says 0.4% faster. Meh.
2718
2719         * JavaScriptCore.exp:
2720         * JavaScriptCore.xcodeproj/project.pbxproj:
2721         * interpreter/Interpreter.cpp:
2722         (JSC::Interpreter::Interpreter):
2723         (JSC::Interpreter::tryCacheGetByID):
2724         (JSC::Interpreter::privateExecute):
2725         * interpreter/Interpreter.h:
2726         * jit/JIT.cpp:
2727         (JSC::JIT::privateCompileMainPass):
2728         (JSC::JIT::privateCompile):
2729         (JSC::JIT::privateCompileCTIMachineTrampolines):
2730         * jit/JIT.h:
2731         (JSC::JIT::compileCTIMachineTrampolines):
2732         * jit/JITCall.cpp:
2733         (JSC::JIT::compileOpCall):
2734         (JSC::JIT::compileOpCallSlowCase):
2735         * jit/JITPropertyAccess.cpp:
2736         (JSC::JIT::privateCompilePatchGetArrayLength):
2737         * jit/JITStubs.cpp:
2738         (JSC::JITStubs::JITStubs):
2739         (JSC::JITStubs::tryCacheGetByID):
2740         (JSC::JITStubs::cti_vm_dontLazyLinkCall):
2741         (JSC::JITStubs::cti_op_get_by_val):
2742         (JSC::JITStubs::cti_op_get_by_val_byte_array):
2743         (JSC::JITStubs::cti_op_put_by_val):
2744         (JSC::JITStubs::cti_op_put_by_val_array):
2745         (JSC::JITStubs::cti_op_put_by_val_byte_array):
2746         (JSC::JITStubs::cti_op_is_string):
2747         * jit/JITStubs.h:
2748         (JSC::JITStubs::ctiArrayLengthTrampoline):
2749         (JSC::JITStubs::ctiStringLengthTrampoline):
2750         (JSC::JITStubs::ctiVirtualCallPreLink):
2751         (JSC::JITStubs::ctiVirtualCallLink):
2752         (JSC::JITStubs::ctiVirtualCall):
2753         * runtime/ArrayPrototype.cpp:
2754         (JSC::arrayProtoFuncPop):
2755         (JSC::arrayProtoFuncPush):
2756         * runtime/FunctionPrototype.cpp:
2757         (JSC::functionProtoFuncApply):
2758         * runtime/JSArray.h:
2759         (JSC::isJSArray):
2760         * runtime/JSByteArray.h:
2761         (JSC::asByteArray):
2762         (JSC::isJSByteArray):
2763         * runtime/JSCell.h:
2764         * runtime/JSFunction.h:
2765         * runtime/JSGlobalData.cpp:
2766         (JSC::VPtrSet::VPtrSet):
2767         (JSC::JSGlobalData::JSGlobalData):
2768         (JSC::JSGlobalData::create):
2769         (JSC::JSGlobalData::sharedInstance):
2770         * runtime/JSGlobalData.h:
2771         * runtime/JSString.h:
2772         (JSC::isJSString):
2773         * runtime/Operations.h:
2774         (JSC::jsLess):
2775         (JSC::jsLessEq):
2776         * wrec/WREC.cpp:
2777         (JSC::WREC::Generator::compileRegExp):
2778
2779 2009-02-23  Csaba Osztrogonac  <oszi@inf.u-szeged.hu>
2780
2781         Reviewed by Oliver Hunt.
2782
2783         Bug 23787: Allow JIT to generate SSE2 code if using GCC
2784         <https://bugs.webkit.org/show_bug.cgi?id=23787>
2785
2786         GCC version of the cpuid check.
2787
2788         * jit/JITArithmetic.cpp:
2789         (JSC::isSSE2Present): previous assembly code fixed.
2790
2791 2009-02-23  David Levin  <levin@chromium.org>
2792
2793         Reviewed by Alexey Proskuryakov.
2794
2795         Bug 24047: Need to simplify nested if's in WorkerRunLoop::runInMode
2796         <https://bugs.webkit.org/show_bug.cgi?id=24047>
2797
2798         * wtf/MessageQueue.h:
2799         (WTF::MessageQueue::infiniteTime):
2800         Allows for one to call waitForMessageFilteredWithTimeout and wait forever.
2801
2802         (WTF::MessageQueue::alwaysTruePredicate):
2803         (WTF::MessageQueue::waitForMessage):
2804         Made waitForMessage call waitForMessageFilteredWithTimeout, so that there is less
2805         duplicate code.
2806
2807         (WTF::MessageQueue::waitForMessageFilteredWithTimeout):
2808
2809         * wtf/ThreadingQt.cpp:
2810         (WTF::ThreadCondition::timedWait):
2811         * wtf/ThreadingWin.cpp:
2812         (WTF::ThreadCondition::timedWait):
2813         Made these two implementations consistent with the pthread and gtk implementations.
2814         Currently, the time calculations would overflow when passed large values.
2815
2816 2009-02-23  Jeremy Moskovich  <jeremy@chromium.org>
2817
2818         Reviewed by Adam Roben.
2819
2820         https://bugs.webkit.org/show_bug.cgi?id=24096
2821         PLATFORM(MAC)->PLATFORM(CF) since we want to use the CF functions in Chrome on OS X.
2822
2823         * wtf/CurrentTime.cpp:
2824
2825 2009-02-22  Geoffrey Garen  <ggaren@apple.com>
2826
2827         Build fix?
2828
2829         * GNUmakefile.am:
2830
2831 2009-02-22  Geoffrey Garen  <ggaren@apple.com>
2832
2833         Build fix.
2834
2835         * GNUmakefile.am:
2836
2837 2009-02-22  Geoffrey Garen  <ggaren@apple.com>
2838
2839         Reviewed by Sam Weinig.
2840
2841         Next step in splitting JIT functionality out of the Interpreter class:
2842         Created a JITStubs class and renamed Interpreter::cti_* to JITStubs::cti_*.
2843         
2844         Also, moved timeout checking into its own class, located in JSGlobalData,
2845         so both the Interpreter and the JIT could have access to it.
2846
2847         * JavaScriptCore.exp:
2848         * JavaScriptCore.pri:
2849         * JavaScriptCore.scons:
2850         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2851         * JavaScriptCore.xcodeproj/project.pbxproj:
2852         * JavaScriptCoreSources.bkl:
2853         * interpreter/CallFrame.h:
2854         * interpreter/Interpreter.cpp:
2855         (JSC::Interpreter::Interpreter):
2856         (JSC::Interpreter::privateExecute):
2857         * interpreter/Interpreter.h:
2858         * interpreter/Register.h:
2859         * jit/JIT.cpp:
2860         (JSC::):
2861         (JSC::JIT::emitTimeoutCheck):
2862         (JSC::JIT::privateCompileMainPass):
2863         (JSC::JIT::privateCompileSlowCases):
2864         (JSC::JIT::privateCompile):
2865         (JSC::JIT::privateCompileCTIMachineTrampolines):
2866         * jit/JIT.h:
2867         * jit/JITArithmetic.cpp:
2868         (JSC::JIT::compileFastArithSlow_op_lshift):
2869         (JSC::JIT::compileFastArithSlow_op_rshift):
2870         (JSC::JIT::compileFastArithSlow_op_bitand):
2871         (JSC::JIT::compileFastArithSlow_op_mod):
2872         (JSC::JIT::compileFastArith_op_mod):
2873         (JSC::JIT::compileFastArithSlow_op_post_inc):
2874         (JSC::JIT::compileFastArithSlow_op_post_dec):
2875         (JSC::JIT::compileFastArithSlow_op_pre_inc):
2876         (JSC::JIT::compileFastArithSlow_op_pre_dec):
2877         (JSC::JIT::compileFastArith_op_add):
2878         (JSC::JIT::compileFastArith_op_mul):
2879         (JSC::JIT::compileFastArith_op_sub):
2880         (JSC::JIT::compileBinaryArithOpSlowCase):
2881         (JSC::JIT::compileFastArithSlow_op_add):
2882         (JSC::JIT::compileFastArithSlow_op_mul):
2883         * jit/JITCall.cpp:
2884         (JSC::JIT::compileOpCall):
2885         (JSC::JIT::compileOpCallSlowCase):
2886         * jit/JITPropertyAccess.cpp:
2887         (JSC::JIT::compileGetByIdHotPath):
2888         (JSC::JIT::compilePutByIdHotPath):
2889         (JSC::JIT::compileGetByIdSlowCase):
2890         (JSC::JIT::compilePutByIdSlowCase):
2891         (JSC::JIT::privateCompilePutByIdTransition):
2892         (JSC::JIT::patchGetByIdSelf):
2893         (JSC::JIT::patchPutByIdReplace):
2894         (JSC::JIT::privateCompilePatchGetArrayLength):
2895         (JSC::JIT::privateCompileGetByIdSelf):
2896         (JSC::JIT::privateCompileGetByIdProto):
2897         (JSC::JIT::privateCompileGetByIdChain):
2898         (JSC::JIT::privateCompilePutByIdReplace):
2899         * jit/JITStubs.cpp:
2900         (JSC::JITStubs::tryCachePutByID):
2901         (JSC::JITStubs::tryCacheGetByID):
2902         (JSC::JITStubs::cti_op_convert_this):
2903         (JSC::JITStubs::cti_op_end):
2904         (JSC::JITStubs::cti_op_add):
2905         (JSC::JITStubs::cti_op_pre_inc):
2906         (JSC::JITStubs::cti_timeout_check):
2907         (JSC::JITStubs::cti_register_file_check):
2908         (JSC::JITStubs::cti_op_loop_if_less):
2909         (JSC::JITStubs::cti_op_loop_if_lesseq):
2910         (JSC::JITStubs::cti_op_new_object):
2911         (JSC::JITStubs::cti_op_put_by_id_generic):
2912         (JSC::JITStubs::cti_op_get_by_id_generic):
2913         (JSC::JITStubs::cti_op_put_by_id):
2914         (JSC::JITStubs::cti_op_put_by_id_second):
2915         (JSC::JITStubs::cti_op_put_by_id_fail):
2916         (JSC::JITStubs::cti_op_get_by_id):
2917         (JSC::JITStubs::cti_op_get_by_id_second):
2918         (JSC::JITStubs::cti_op_get_by_id_self_fail):
2919         (JSC::JITStubs::cti_op_get_by_id_proto_list):
2920         (JSC::JITStubs::cti_op_get_by_id_proto_list_full):
2921         (JSC::JITStubs::cti_op_get_by_id_proto_fail):
2922         (JSC::JITStubs::cti_op_get_by_id_array_fail):
2923         (JSC::JITStubs::cti_op_get_by_id_string_fail):
2924         (JSC::JITStubs::cti_op_instanceof):
2925         (JSC::JITStubs::cti_op_del_by_id):
2926         (JSC::JITStubs::cti_op_mul):
2927         (JSC::JITStubs::cti_op_new_func):
2928         (JSC::JITStubs::cti_op_call_JSFunction):
2929         (JSC::JITStubs::cti_op_call_arityCheck):
2930         (JSC::JITStubs::cti_vm_dontLazyLinkCall):
2931         (JSC::JITStubs::cti_vm_lazyLinkCall):
2932         (JSC::JITStubs::cti_op_push_activation):
2933         (JSC::JITStubs::cti_op_call_NotJSFunction):
2934         (JSC::JITStubs::cti_op_create_arguments):
2935         (JSC::JITStubs::cti_op_create_arguments_no_params):
2936         (JSC::JITStubs::cti_op_tear_off_activation):
2937         (JSC::JITStubs::cti_op_tear_off_arguments):
2938         (JSC::JITStubs::cti_op_profile_will_call):
2939         (JSC::JITStubs::cti_op_profile_did_call):
2940         (JSC::JITStubs::cti_op_ret_scopeChain):
2941         (JSC::JITStubs::cti_op_new_array):
2942         (JSC::JITStubs::cti_op_resolve):
2943         (JSC::JITStubs::cti_op_construct_JSConstruct):
2944         (JSC::JITStubs::cti_op_construct_NotJSConstruct):
2945         (JSC::JITStubs::cti_op_get_by_val):
2946         (JSC::JITStubs::cti_op_get_by_val_byte_array):
2947         (JSC::JITStubs::cti_op_resolve_func):
2948         (JSC::JITStubs::cti_op_sub):
2949         (JSC::JITStubs::cti_op_put_by_val):
2950         (JSC::JITStubs::cti_op_put_by_val_array):
2951         (JSC::JITStubs::cti_op_put_by_val_byte_array):
2952         (JSC::JITStubs::cti_op_lesseq):
2953         (JSC::JITStubs::cti_op_loop_if_true):
2954         (JSC::JITStubs::cti_op_negate):
2955         (JSC::JITStubs::cti_op_resolve_base):
2956         (JSC::JITStubs::cti_op_resolve_skip):
2957         (JSC::JITStubs::cti_op_resolve_global):
2958         (JSC::JITStubs::cti_op_div):
2959         (JSC::JITStubs::cti_op_pre_dec):
2960         (JSC::JITStubs::cti_op_jless):
2961         (JSC::JITStubs::cti_op_not):
2962         (JSC::JITStubs::cti_op_jtrue):
2963         (JSC::JITStubs::cti_op_post_inc):
2964         (JSC::JITStubs::cti_op_eq):
2965         (JSC::JITStubs::cti_op_lshift):
2966         (JSC::JITStubs::cti_op_bitand):
2967         (JSC::JITStubs::cti_op_rshift):
2968         (JSC::JITStubs::cti_op_bitnot):
2969         (JSC::JITStubs::cti_op_resolve_with_base):
2970         (JSC::JITStubs::cti_op_new_func_exp):
2971         (JSC::JITStubs::cti_op_mod):
2972         (JSC::JITStubs::cti_op_less):
2973         (JSC::JITStubs::cti_op_neq):
2974         (JSC::JITStubs::cti_op_post_dec):
2975         (JSC::JITStubs::cti_op_urshift):
2976         (JSC::JITStubs::cti_op_bitxor):
2977         (JSC::JITStubs::cti_op_new_regexp):
2978         (JSC::JITStubs::cti_op_bitor):
2979         (JSC::JITStubs::cti_op_call_eval):
2980         (JSC::JITStubs::cti_op_throw):
2981         (JSC::JITStubs::cti_op_get_pnames):
2982         (JSC::JITStubs::cti_op_next_pname):
2983         (JSC::JITStubs::cti_op_push_scope):
2984         (JSC::JITStubs::cti_op_pop_scope):
2985         (JSC::JITStubs::cti_op_typeof):
2986         (JSC::JITStubs::cti_op_is_undefined):
2987         (JSC::JITStubs::cti_op_is_boolean):
2988         (JSC::JITStubs::cti_op_is_number):
2989         (JSC::JITStubs::cti_op_is_string):
2990         (JSC::JITStubs::cti_op_is_object):
2991         (JSC::JITStubs::cti_op_is_function):
2992         (JSC::JITStubs::cti_op_stricteq):
2993         (JSC::JITStubs::cti_op_nstricteq):
2994         (JSC::JITStubs::cti_op_to_jsnumber):
2995         (JSC::JITStubs::cti_op_in):
2996         (JSC::JITStubs::cti_op_push_new_scope):
2997         (JSC::JITStubs::cti_op_jmp_scopes):
2998         (JSC::JITStubs::cti_op_put_by_index):
2999         (JSC::JITStubs::cti_op_switch_imm):
3000         (JSC::JITStubs::cti_op_switch_char):
3001         (JSC::JITStubs::cti_op_switch_string):
3002         (JSC::JITStubs::cti_op_del_by_val):
3003         (JSC::JITStubs::cti_op_put_getter):
3004         (JSC::JITStubs::cti_op_put_setter):
3005         (JSC::JITStubs::cti_op_new_error):
3006         (JSC::JITStubs::cti_op_debug):
3007         (JSC::JITStubs::cti_vm_throw):
3008         * jit/JITStubs.h:
3009         (JSC::):
3010         * runtime/JSFunction.h:
3011         * runtime/JSGlobalData.cpp:
3012         (JSC::JSGlobalData::JSGlobalData):
3013         * runtime/JSGlobalData.h:
3014         * runtime/JSGlobalObject.cpp:
3015         * runtime/JSGlobalObject.h:
3016         * runtime/TimeoutChecker.cpp: Copied from interpreter/Interpreter.cpp.
3017         (JSC::TimeoutChecker::TimeoutChecker):
3018         (JSC::TimeoutChecker::reset):
3019         (JSC::TimeoutChecker::didTimeOut):
3020         * runtime/TimeoutChecker.h: Copied from interpreter/Interpreter.h.
3021         (JSC::TimeoutChecker::setTimeoutInterval):
3022         (JSC::TimeoutChecker::ticksUntilNextCheck):
3023         (JSC::TimeoutChecker::start):
3024         (JSC::TimeoutChecker::stop):
3025
3026 2009-02-20  Gustavo Noronha Silva  <gns@gnome.org>
3027
3028         Unreviewed build fix after r41100.
3029
3030         * GNUmakefile.am:
3031
3032 2009-02-20  Oliver Hunt  <oliver@apple.com>
3033
3034         Reviewed by Mark Rowe.
3035
3036         <rdar://problem/6606660> 2==null returns true in 64bit jit
3037
3038         Code for op_eq_null and op_neq_null was incorrectly performing
3039         a 32bit compare, which truncated the type tag from an integer
3040         immediate, leading to incorrect behaviour.
3041
3042         * assembler/MacroAssembler.h:
3043         (JSC::MacroAssembler::setPtr):
3044         * assembler/MacroAssemblerX86_64.h:
3045         (JSC::MacroAssemblerX86_64::setPtr):
3046         * jit/JIT.cpp:
3047         (JSC::JIT::privateCompileMainPass):
3048
3049 2009-02-19  Geoffrey Garen  <ggaren@apple.com>
3050
3051         Reviewed by Gavin Barraclough.
3052         
3053         First step in splitting JIT functionality out of the Interpreter class:
3054         Created JITStubs.h/.cpp, and moved Interpreter::cti_* into JITStubs.cpp.
3055         
3056         Functions that the Interpreter and JITStubs share moved to Operations.h/.cpp.
3057
3058         * GNUmakefile.am:
3059         * JavaScriptCore.pri:
3060         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3061         * JavaScriptCore.xcodeproj/project.pbxproj:
3062         * interpreter/Interpreter.cpp:
3063         (JSC::Interpreter::resolveBase):
3064         (JSC::Interpreter::checkTimeout):
3065         (JSC::Interpreter::privateExecute):
3066         * interpreter/Interpreter.h:
3067         * jit/JITStubs.cpp: Copied from interpreter/Interpreter.cpp.
3068         (JSC::Interpreter::cti_op_resolve_base):
3069         * jit/JITStubs.h: Copied from interpreter/Interpreter.h.
3070         * runtime/Operations.cpp:
3071         (JSC::jsAddSlowCase):
3072         (JSC::jsTypeStringForValue):
3073         (JSC::jsIsObjectType):
3074         (JSC::jsIsFunctionType):
3075         * runtime/Operations.h:
3076         (JSC::jsLess):
3077         (JSC::jsLessEq):
3078         (JSC::jsAdd):
3079         (JSC::cachePrototypeChain):
3080         (JSC::countPrototypeChainEntriesAndCheckForProxies):
3081         (JSC::resolveBase):
3082
3083 2009-02-19  Gavin Barraclough  <barraclough@apple.com>
3084
3085         Reviewed by Oliver Hunt.
3086
3087         Fix for x86-64. Where the JavaScriptCore text segment lies outside
3088         a 2gb range of the heap containing JIT generated code, callbacks
3089         from JIT code to the stub functions in Interpreter will be incorrectly
3090         linked.
3091
3092         No performance impact on Sunspider, 1% regression on v8-tests,
3093         due to a 3% regression on richards.
3094
3095         * assembler/AbstractMacroAssembler.h:
3096         (JSC::AbstractMacroAssembler::Call::Call):
3097         (JSC::AbstractMacroAssembler::Jump::link):
3098         (JSC::AbstractMacroAssembler::Jump::linkTo):
3099         (JSC::AbstractMacroAssembler::CodeLocationJump::relink):
3100         (JSC::AbstractMacroAssembler::CodeLocationCall::relink):
3101         (JSC::AbstractMacroAssembler::ProcessorReturnAddress::relinkCallerToFunction):
3102         (JSC::AbstractMacroAssembler::PatchBuffer::link):
3103         (JSC::AbstractMacroAssembler::PatchBuffer::linkTailRecursive):
3104         (JSC::AbstractMacroAssembler::differenceBetween):
3105         * assembler/MacroAssembler.h:
3106         (JSC::MacroAssembler::tailRecursiveCall):
3107         (JSC::MacroAssembler::makeTailRecursiveCall):
3108         * assembler/MacroAssemblerX86.h:
3109         (JSC::MacroAssemblerX86::call):
3110         * assembler/MacroAssemblerX86Common.h:
3111         * assembler/MacroAssemblerX86_64.h:
3112         (JSC::MacroAssemblerX86_64::call):
3113         (JSC::MacroAssemblerX86_64::moveWithPatch):
3114         (JSC::MacroAssemblerX86_64::branchPtrWithPatch):
3115         (JSC::MacroAssemblerX86_64::storePtrWithPatch):
3116         * assembler/X86Assembler.h:
3117         (JSC::X86Assembler::jmp_r):
3118         (JSC::X86Assembler::linkJump):
3119         (JSC::X86Assembler::patchJump):
3120         (JSC::X86Assembler::patchCall):
3121         (JSC::X86Assembler::linkCall):
3122         (JSC::X86Assembler::patchAddress):
3123         * interpreter/Interpreter.cpp:
3124         (JSC::Interpreter::tryCTICachePutByID):
3125         * jit/JIT.cpp:
3126         (JSC::JIT::privateCompile):
3127         (JSC::JIT::privateCompileCTIMachineTrampolines):
3128         * jit/JIT.h:
3129         * jit/JITArithmetic.cpp:
3130         (JSC::JIT::putDoubleResultToJSNumberCellOrJSImmediate):
3131         (JSC::JIT::compileBinaryArithOp):
3132         * jit/JITPropertyAccess.cpp:
3133         (JSC::JIT::privateCompilePutByIdTransition):
3134         (JSC::JIT::privateCompileGetByIdSelf):
3135         (JSC::JIT::privateCompilePutByIdReplace):
3136
3137 2009-02-18  Geoffrey Garen  <ggaren@apple.com>
3138
3139         Reviewed by Oliver Hunt.
3140         
3141         Simplified .call and .apply in preparation for optimizing them. Also,
3142         a little cleanup.
3143
3144         * runtime/FunctionPrototype.cpp:
3145         (JSC::functionProtoFuncApply):
3146         (JSC::functionProtoFuncCall): No need to do any specific conversion on
3147         'this' -- op_convert_this will do it if necessary.
3148
3149         * runtime/JSImmediate.cpp:
3150         (JSC::JSImmediate::toThisObject): Slightly relaxed the rules on
3151         toThisObject to allow for 'undefined', which can be passed through
3152         .call and .apply.
3153
3154 2009-02-19  David Levin  <levin@chromium.org>
3155
3156         Reviewed by Alexey Proskuryakov.
3157
3158         Bug 23976: MessageQueue needs a way to wait for a message that satisfies an arbitrary criteria.
3159         <https://bugs.webkit.org/show_bug.cgi?id=23976>
3160
3161         * wtf/Deque.h:
3162         (WTF::Deque<T>::findIf):
3163         * wtf/MessageQueue.h:
3164         (WTF::MessageQueue<T>::waitForMessageFiltered):
3165
3166 2009-02-18  David Levin  <levin@chromium.org>
3167
3168         Reviewed by Alexey Proskuryakov.
3169
3170         Bug 23974: Deque::Remove would be a useful method.
3171         <https://bugs.webkit.org/show_bug.cgi?id=23974>
3172
3173         Add Deque::remove and DequeIteratorBase<T>::operator=.
3174
3175         Why was operator= added? Every concrete iterator (DequeIterator..DequeConstReverseIterator)
3176         was calling DequeIteratorBase::assign(), which called Base::operator=(). Base::operator=()
3177         was not implemented. This went unnoticed because the iterator copy code has been unused.
3178
3179         * wtf/Deque.h:
3180         (WTF::Deque<T>::remove):
3181         (WTF::DequeIteratorBase<T>::removeFromIteratorsList):
3182         (WTF::DequeIteratorBase<T>::operator=):
3183         (WTF::DequeIteratorBase<T>::~DequeIteratorBase):
3184
3185 2009-02-18  Gustavo Noronha Silva  <gns@gnome.org>
3186
3187         Reviewed by Holger Freyther.
3188
3189         Fix symbols.filter location, and add other missing files to the
3190         autotools build, so that make dist works.
3191
3192         * GNUmakefile.am:
3193
3194 2009-02-17  Geoffrey Garen  <ggaren@apple.com>
3195
3196         Reviewed by Sam Weinig.
3197         
3198         Fixed failure in js1_5/Regress/regress-168347.js, as seen on the Oliver
3199         bot.
3200         
3201         Technically, both behaviors are OK, but we might as well keep this test
3202         passing.
3203
3204         * runtime/FunctionPrototype.cpp:
3205         (JSC::insertSemicolonIfNeeded): No need to add a trailing semicolon
3206         after a trailing '}', since '}' ends a block, indicating the end of a
3207         statement.
3208
3209 2009-02-17  Geoffrey Garen  <ggaren@apple.com>
3210
3211         Build fix.
3212
3213         * runtime/FunctionPrototype.cpp:
3214
3215 2009-02-17  Oliver Hunt  <oliver@apple.com>
3216
3217         Reviewed by Geoff Garen.
3218
3219         Add assertion to guard against oversized pc relative calls.
3220
3221         * assembler/X86Assembler.h:
3222         (JSC::X86Assembler::link):
3223
3224 2009-02-17  Geoffrey Garen  <ggaren@apple.com>
3225
3226         Reviewed by Sam Weinig.
3227         
3228         Fixed <rdar://problem/6595040> REGRESSION: http://www.amnestyusa.org/
3229         fails to load.
3230         
3231         amnestyusa.org uses the Optimist JavaScript library, which adds event
3232         listeners by concatenating string-ified functions. This is only sure to
3233         be syntactically valid if the string-ified functions end in semicolons.
3234
3235         * parser/Lexer.cpp:
3236         (JSC::Lexer::isWhiteSpace):
3237         * parser/Lexer.h:
3238         (JSC::Lexer::isWhiteSpace):
3239         (JSC::Lexer::isLineTerminator): Added some helper functions for examining
3240         whitespace.
3241
3242         * runtime/FunctionPrototype.cpp:
3243         (JSC::appendSemicolonIfNeeded):
3244         (JSC::functionProtoFuncToString): When string-ifying a function, insert
3245         a semicolon in the last non-whitespace position, if one doesn't already exist.
3246
3247 2009-02-16  Oliver Hunt  <oliver@apple.com>
3248
3249         Reviewed by NOBODY (Build fix).
3250
3251         Roll out r41022 as it breaks qt and gtk builds
3252
3253         * jit/JITArithmetic.cpp:
3254         (JSC::isSSE2Present):
3255
3256 2009-02-16  Sam Weinig  <sam@webkit.org>
3257
3258         Reviewed by Geoffrey Garen.
3259
3260         Fix for <rdar://problem/6468156>
3261         REGRESSION (r36779): Adding link, images, flash in TinyMCE blocks entire page (21382)
3262
3263         No performance regression.
3264
3265         * runtime/Arguments.cpp:
3266         (JSC::Arguments::fillArgList): Add codepath for when the "length" property has been
3267         overridden.
3268
3269 2009-02-16  Mark Rowe  <mrowe@apple.com>
3270
3271         Build fix.
3272
3273         * wtf/FastMalloc.cpp:
3274         (WTF::TCMallocStats::):
3275         (WTF::TCMallocStats::FastMallocZone::FastMallocZone):
3276
3277 2009-02-16  Csaba Osztrogonac  <oszi@inf.u-szeged.hu>
3278
3279         Reviewed by Oliver Hunt.
3280
3281         Bug 23787: Allow JIT to generate SSE2 code if using GCC
3282         <https://bugs.webkit.org/show_bug.cgi?id=23787>
3283
3284         GCC version of the cpuid check.
3285
3286         * jit/JITArithmetic.cpp:
3287         (JSC::isSSE2Present): GCC assembly code added.
3288         6.6% progression on x86 Linux with JIT and WREC on SunSpider if using SSE2 capable machine.
3289
3290 2009-02-13  Adam Treat  <adam.treat@torchmobile.com>
3291
3292         Reviewed by George Staikos.
3293
3294         https://bugs.webkit.org/show_bug.cgi?id=23960
3295         Crash Fix.
3296
3297         Don't depend on 'initializeThreading()' to come before a call to 'isMainThread()'
3298         as QtWebKit only calls 'initializeThreading()' during QWebPage construction.
3299
3300         A client app may well make a call to QWebSettings::iconForUrl() for instance
3301         before creating a QWebPage and that call to QWebSettings triggers an
3302         ASSERT(isMainThread()) deep within WebCore.
3303
3304         * wtf/ThreadingQt.cpp:
3305         (WTF::isMainThread):
3306
3307 2009-02-13  Gavin Barraclough  <barraclough@apple.com>
3308
3309         Reviewed by Darin Adler.
3310
3311         Some data in the instruction stream is potentially uninitialized - fix this.
3312
3313         Change the OperandTypes constructor so that uninitialized memory in the int
3314         is zeroed, and modify the Instruction constructor taking an Opcode so that
3315         if !HAVE(COMPUTED_GOTO) (i.e. when Opcode is an enum, and is potentially only
3316         a byte) it zeros the Instruction first before writing the opcode.
3317
3318         * bytecode/Instruction.h:
3319         (JSC::Instruction::Instruction):
3320         * parser/ResultType.h:
3321         (JSC::OperandTypes::OperandTypes):
3322
3323 2009-02-13  Geoffrey Garen  <ggaren@apple.com>
3324
3325         Build fix for non_JIT platforms.
3326
3327         * bytecode/CodeBlock.h:
3328         (JSC::CodeBlock::setIsNumericCompareFunction):
3329         (JSC::CodeBlock::isNumericCompareFunction):
3330
3331 2009-02-13  Geoffrey Garen  <ggaren@apple.com>
3332
3333         Reviewed by Darin Adler.
3334         
3335         Fixed <rdar://problem/6584057> Optimize sort by JS numeric comparison
3336         function not to run the comparison function
3337         
3338         * bytecode/CodeBlock.cpp:
3339         (JSC::CodeBlock::CodeBlock):
3340         * bytecode/CodeBlock.h:
3341         (JSC::CodeBlock::setIsNumericCompareFunction):
3342         (JSC::CodeBlock::isNumericCompareFunction): Added the ability to track
3343         whether a CodeBlock performs a sort-like numeric comparison.
3344
3345         * bytecompiler/BytecodeGenerator.cpp:
3346         (JSC::BytecodeGenerator::generate): Set the isNumericCompareFunction bit
3347         after compiling.
3348
3349         * parser/Nodes.cpp:
3350         (JSC::FunctionBodyNode::emitBytecode): Fixed a bug that caused us to
3351         codegen an extra return at the end of all functions (eek!), since this
3352         made it harder / weirder to detect the numeric comparison pattern in
3353         bytecode.
3354
3355         * runtime/ArrayPrototype.cpp:
3356         (JSC::arrayProtoFuncSort): Use the isNumericCompareFunction bit to do
3357         a faster sort if we can.
3358
3359         * runtime/FunctionConstructor.cpp:
3360         (JSC::extractFunctionBody):
3361         (JSC::constructFunction):
3362         * runtime/FunctionConstructor.h: Renamed and exported extractFunctionBody for
3363         use in initializing lazyNumericCompareFunction.
3364
3365         * runtime/JSArray.cpp:
3366         (JSC::compareNumbersForQSort):
3367         (JSC::compareByStringPairForQSort):
3368         (JSC::JSArray::sortNumeric):
3369         (JSC::JSArray::sort):
3370         * runtime/JSArray.h: Added a fast numeric sort. Renamed ArrayQSortPair
3371         to be more specific since we do different kinds of qsort now.
3372
3373         * runtime/JSGlobalData.cpp:
3374         (JSC::JSGlobalData::JSGlobalData):
3375         (JSC::JSGlobalData::numericCompareFunction):
3376         (JSC::JSGlobalData::ClientData::~ClientData):
3377         * runtime/JSGlobalData.h: Added helper data for computing the
3378         isNumericCompareFunction bit.
3379
3380 2009-02-13  Darin Adler  <darin@apple.com>
3381
3382         * Configurations/JavaScriptCore.xcconfig: Undo accidental commit of this file.
3383
3384 2009-02-12  Darin Adler  <darin@apple.com>
3385
3386         Reviewed by Oliver Hunt and Alexey Proskuryakov.
3387
3388         Speed up a couple string functions.
3389
3390         * runtime/StringPrototype.cpp:
3391         (JSC::stringProtoFuncIndexOf): Added a fast path for cases where the second
3392         argument is either missing or an integer.
3393         (JSC::stringProtoFuncBig): Use jsNontrivialString since the string is guaranteed
3394         to be 2 or more characters long.
3395         (JSC::stringProtoFuncSmall): Ditto.
3396         (JSC::stringProtoFuncBlink): Ditto.
3397         (JSC::stringProtoFuncBold): Ditto.
3398         (JSC::stringProtoFuncItalics): Ditto.
3399         (JSC::stringProtoFuncStrike): Ditto.
3400         (JSC::stringProtoFuncSub): Ditto.
3401         (JSC::stringProtoFuncSup): Ditto.
3402         (JSC::stringProtoFuncFontcolor): Ditto.
3403         (JSC::stringProtoFuncFontsize): Make the fast path Sam recently added even faster
3404         by avoiding all but the minimum memory allocation.
3405         (JSC::stringProtoFuncAnchor): Use jsNontrivialString.
3406         (JSC::stringProtoFuncLink): Added a fast path.
3407
3408         * runtime/UString.cpp:
3409         (JSC::UString::find): Added a fast path for single-character search strings.
3410
3411 2009-02-13  David Levin  <levin@chromium.org>
3412
3413         Reviewed by Darin Adler.
3414
3415         Bug 23926: Race condition in callOnMainThreadAndWait
3416         <https://bugs.webkit.org/show_bug.cgi?id=23926>
3417
3418         * wtf/MainThread.cpp:
3419         Removed callOnMainThreadAndWait since it isn't used.
3420
3421 2009-02-13  Oliver Hunt  <oliver@apple.com>
3422
3423         Reviewed by Jon Honeycutt.
3424
3425         Math.random is really slow on windows.
3426
3427         Math.random calls WTF::randomNumber which is implemented as
3428         the secure rand_s on windows.  Unfortunately rand_s is an order
3429         of magnitude slower than arc4random.  For this reason I've
3430         added "weakRandomNumber" for use by JavaScript's Math Object.
3431         In the long term we should look at using our own secure PRNG
3432         in place of the system, but this will do for now.
3433
3434         30% win on SunSpider on Windows, resolving most of the remaining
3435         disparity vs. Mac.
3436
3437         * runtime/MathObject.cpp:
3438         (JSC::MathObject::MathObject):
3439         (JSC::mathProtoFuncRandom):
3440         * wtf/RandomNumber.cpp:
3441         (WTF::weakRandomNumber):
3442         (WTF::randomNumber):
3443         * wtf/RandomNumber.h:
3444         * wtf/RandomNumberSeed.h:
3445         (WTF::initializeWeakRandomNumberGenerator):
3446
3447 2009-02-12  Mark Rowe  <mrowe@apple.com>
3448
3449         Fix the build for other platforms.
3450
3451         * wtf/RandomNumber.cpp:
3452         (WTF::randomNumber):
3453
3454 2009-02-12  Gavin Barraclough  <barraclough@apple.com>
3455
3456         Reviewed by Sam Weinig.
3457
3458         Remove (/reduce) use of hard-wired register names from the JIT.
3459         Currently there is no abstraction of registers used in the JIT,
3460         which has a number of negative consequences.  Hard-wiring x86
3461         register names makes the JIT less portable to other platforms,
3462         and prevents us from performing dynamic register allocation to
3463         attempt to maintain more temporary values in machine registers.
3464         (The latter will be more important on x86-64, where we have more
3465         registers to make use of).
3466
3467         Also, remove MacroAssembler::mod32.  This was not providing a
3468         useful abstraction, and was not in keeping with the rest of the
3469         MacroAssembler interface, in having specific register requirements.
3470
3471         * assembler/MacroAssemblerX86Common.h:
3472         * jit/JIT.cpp:
3473         (JSC::JIT::compileOpStrictEq):
3474         (JSC::JIT::emitSlowScriptCheck):
3475         (JSC::JIT::privateCompileMainPass):
3476         (JSC::JIT::privateCompileSlowCases):
3477         (JSC::JIT::privateCompile):
3478         (JSC::JIT::privateCompileCTIMachineTrampolines):
3479         * jit/JIT.h:
3480         * jit/JITArithmetic.cpp:
3481         (JSC::JIT::compileFastArith_op_lshift):
3482         (JSC::JIT::compileFastArithSlow_op_lshift):
3483         (JSC::JIT::compileFastArith_op_rshift):
3484         (JSC::JIT::compileFastArithSlow_op_rshift):
3485         (JSC::JIT::compileFastArith_op_bitand):
3486         (JSC::JIT::compileFastArithSlow_op_bitand):
3487         (JSC::JIT::compileFastArith_op_mod):
3488         (JSC::JIT::compileFastArithSlow_op_mod):
3489         (JSC::JIT::compileFastArith_op_post_inc):
3490         (JSC::JIT::compileFastArithSlow_op_post_inc):
3491         (JSC::JIT::compileFastArith_op_post_dec):
3492         (JSC::JIT::compileFastArithSlow_op_post_dec):
3493         (JSC::JIT::compileFastArith_op_pre_inc):
3494         (JSC::JIT::compileFastArithSlow_op_pre_inc):
3495         (JSC::JIT::compileFastArith_op_pre_dec):
3496         (JSC::JIT::compileFastArithSlow_op_pre_dec):
3497         (JSC::JIT::compileFastArith_op_add):
3498         (JSC::JIT::compileFastArith_op_mul):
3499         (JSC::JIT::compileFastArith_op_sub):
3500         (JSC::JIT::compileBinaryArithOp):
3501         * jit/JITCall.cpp:
3502         (JSC::JIT::compileOpCallInitializeCallFrame):
3503         (JSC::JIT::compileOpCallSetupArgs):
3504         (JSC::JIT::compileOpCallEvalSetupArgs):
3505         (JSC::JIT::compileOpConstructSetupArgs):
3506         (JSC::JIT::compileOpCall):
3507         (JSC::JIT::compileOpCallSlowCase):
3508         * jit/JITInlineMethods.h:
3509         (JSC::JIT::emitGetVirtualRegister):
3510         (JSC::JIT::emitPutVirtualRegister):
3511         (JSC::JIT::emitNakedCall):
3512         (JSC::JIT::restoreArgumentReference):
3513         (JSC::JIT::restoreArgumentReferenceForTrampoline):
3514         * jit/JITPropertyAccess.cpp:
3515         (JSC::JIT::compileGetByIdHotPath):
3516         (JSC::JIT::compilePutByIdHotPath):
3517         (JSC::JIT::compileGetByIdSlowCase):
3518         (JSC::JIT::compilePutByIdSlowCase):
3519         (JSC::JIT::privateCompilePutByIdTransition):
3520         (JSC::JIT::privateCompilePatchGetArrayLength):
3521         (JSC::JIT::privateCompileGetByIdSelf):
3522         (JSC::JIT::privateCompileGetByIdProto):
3523         (JSC::JIT::privateCompileGetByIdSelfList):
3524         (JSC::JIT::privateCompileGetByIdProtoList):
3525         (JSC::JIT::privateCompileGetByIdChainList):
3526         (JSC::JIT::privateCompileGetByIdChain):
3527         (JSC::JIT::privateCompilePutByIdReplace):
3528
3529 2009-02-12  Horia Olaru  <olaru@adobe.com>
3530
3531         Reviewed by Oliver Hunt.
3532
3533         https://bugs.webkit.org/show_bug.cgi?id=23400
3534
3535         When throwing an exception within an eval argument string, the dst parameter was
3536         modified in the functions below and the return value for eval was altered. Changed
3537         the emitNode call in JSC::ThrowNode::emitBytecode to use a temporary register
3538         to store its results instead of dst. The JSC::FunctionCallResolveNode::emitBytecode
3539         would load the function within the dst registry, also altering the result returned
3540         by eval. Replaced it with another temporary.
3541
3542         * parser/Nodes.cpp:
3543         (JSC::FunctionCallResolveNode::emitBytecode):
3544         (JSC::ThrowNode::emitBytecode):
3545