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