[YARR] Precompute BMP / non-BMP status when constructing character classes
[WebKit-https.git] / Source / JavaScriptCore / ChangeLog-2010-05-24
1 2010-05-24  Gavin Barraclough  <barraclough@apple.com>
2
3         Rubber Stamped by Sam Weinig.
4
5         Accidentally committed double write of codeblock in Interpreter.
6
7         * interpreter/Interpreter.cpp:
8         (JSC::Interpreter::privateExecute):
9
10 2010-05-24  Gavin Barraclough  <barraclough@apple.com>
11
12         Reviewed by Sam Weinig.
13
14         https://bugs.webkit.org/show_bug.cgi?id=39583
15         Move creation of 'this' object from caller to callee in construction.
16
17         Presently the caller of a constructor is responsible for providing a this
18         object.  Instead, move the object creation into a new op_create_this opcode,
19         planted in the head of the contructor bytecode for a function.  Since the
20         prototype for the object is provided by performing a get_by_id on the callee,
21         also add a new get_callee opcode (this is used to get the callee JSFunction
22         into a register so that a normal get_by_id can be used).
23
24         Currently the caller is also responsible for detecting when op_construct is
25         performed on a JSFunction representing a host function, in which case an
26         exception is thrown – and this check currently takes place when constructing
27         the this object.  Instead, mirroring the recent changes for non-host functions,
28         add a parallel code-path for native constructors to follow, with a thunk for
29         invoking native constructors provided by JITStubs, and a constructor-specific
30         NativeFunction on NativeExecutable.  Provide an implementation of a host
31         constructor which will throw an exception.
32
33         * bytecode/CodeBlock.cpp:
34         (JSC::CodeBlock::dump):
35         (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset):
36         * bytecode/CodeBlock.h:
37         * bytecode/Opcode.h:
38         * bytecompiler/BytecodeGenerator.cpp:
39         (JSC::BytecodeGenerator::BytecodeGenerator):
40         (JSC::BytecodeGenerator::emitConstruct):
41         * bytecompiler/BytecodeGenerator.h:
42         (JSC::BytecodeGenerator::emitGetByIdExceptionInfo):
43         * interpreter/Interpreter.cpp:
44         (JSC::Interpreter::privateExecute):
45         * jit/JIT.cpp:
46         (JSC::JIT::privateCompileMainPass):
47         * jit/JIT.h:
48         * jit/JITCall.cpp:
49         (JSC::JIT::compileOpCall):
50         (JSC::JIT::compileOpCallSlowCase):
51         * jit/JITCall32_64.cpp:
52         (JSC::JIT::compileOpCall):
53         (JSC::JIT::compileOpCallSlowCase):
54         * jit/JITOpcodes.cpp:
55         (JSC::JIT::privateCompileCTIMachineTrampolines):
56         (JSC::JIT::privateCompileCTINativeCall):
57         (JSC::JIT::emit_op_neq_null):
58         (JSC::JIT::emit_op_convert_this):
59         (JSC::JIT::emit_op_get_callee):
60         (JSC::JIT::emit_op_create_this):
61         * jit/JITOpcodes32_64.cpp:
62         (JSC::JIT::privateCompileCTIMachineTrampolines):
63         (JSC::JIT::privateCompileCTINativeCall):
64         (JSC::JIT::emit_op_get_callee):
65         (JSC::JIT::emit_op_create_this):
66         * jit/JITStubs.cpp:
67         (JSC::DEFINE_STUB_FUNCTION):
68         (JSC::JITThunks::hostFunctionStub):
69         * jit/JITStubs.h:
70         (JSC::JITThunks::ctiNativeConstruct):
71         (JSC::):
72         * runtime/ExceptionHelpers.cpp:
73         (JSC::createNotAnObjectError):
74         * runtime/Executable.h:
75         (JSC::NativeExecutable::create):
76         (JSC::NativeExecutable::NativeExecutable):
77         * runtime/JSFunction.cpp:
78         (JSC::callHostFunctionAsConstructor):
79         * runtime/JSFunction.h:
80
81 2010-05-23  Sam Weinig  <sam@webkit.org>
82
83         Fix windows build.
84
85         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
86
87 2010-05-23  Sam Weinig  <sam@webkit.org>
88
89         Reviewed by Oliver Hunt.
90
91         Fix for https://bugs.webkit.org/show_bug.cgi?id=39575
92         Make JS DOMObject inherit from JSObjectWithGlobalObject instead of JSObject
93
94         Expose the global object stored in JSObjectWithGlobalObject.
95
96         * JavaScriptCore.exp:
97         * JavaScriptCore.xcodeproj/project.pbxproj:
98         * runtime/JSObjectWithGlobalObject.cpp:
99         (JSC::JSObjectWithGlobalObject::JSObjectWithGlobalObject):
100         (JSC::JSObjectWithGlobalObject::globalObject):
101         * runtime/JSObjectWithGlobalObject.h:
102
103 2010-05-21  Oliver Hunt  <oliver@apple.com>
104
105         "asm volatile" isn't valid outside of functions.
106
107         Reviewed by Gavin Barraclough.
108
109         * jit/JITStubs.cpp:
110
111 2010-05-21  Gavin Barraclough  <barraclough@apple.com>
112
113         Unreviewed build fix.
114
115         Interpreter fix following r59974.
116
117         * interpreter/Interpreter.cpp:
118         (JSC::Interpreter::privateExecute):
119         * runtime/JSPropertyNameIterator.cpp:
120         (JSC::JSPropertyNameIterator::get):
121         * runtime/JSPropertyNameIterator.h:
122
123 2010-05-21  Gavin Barraclough  <barraclough@apple.com>
124
125         Rubber stamped by Oliver Hunt.
126
127         Interpreter fix following r59939.
128
129         * interpreter/Interpreter.cpp:
130         (JSC::Interpreter::privateExecute):
131
132 2010-05-21  David Levin  <levin@chromium.org>
133
134         Unreviewed build fix.
135
136         * wtf/SizeLimits.cpp: Removed a check while I figure out how to write it properly.
137
138 2010-05-21  David Levin  <levin@chromium.org>
139
140         Reviewed by Darin Adler.
141
142         Enforce size constraints on various data structures in JavaScriptCore/wtf.
143         https://bugs.webkit.org/show_bug.cgi?id=39327
144
145         I only modified the default build for OSX and Chromium's build file to include WTFCompileAsserts.cpp
146         as those should be sufficient to catch regressions on the size of the data structures.
147
148         * JavaScriptCore.gypi: Added the WTFCompileAsserts.cpp file.
149         * JavaScriptCore.xcodeproj/project.pbxproj: Added the WTFCompileAsserts.cpp file.
150         * runtime/UString.cpp: Added a compile assert for UString size.
151         * wtf/SizeLimits.cpp: Added compile asserts for data structures that didn't have cpp files.
152         * wtf/text/StringImpl.cpp: Added a compile assert for StringImpl size.
153
154 2010-05-21  Gavin Barraclough  <barraclough@apple.com>
155
156         Reviewed by Oliver Hunt.
157
158         Bug 39509 - Exceptions raised when JSString::value() is called not always properly thrown.
159         Missing some CHECK_FOR_EXCEPTION()s, cleanup NativeError construction (adding a property
160         via the prototype was inefficient, and whilst trivially true that the property is is not
161         a rope - and thus couldn't except - it would be hard to prove this).
162
163         * interpreter/Interpreter.cpp:
164         (JSC::Interpreter::callEval):
165         (JSC::Interpreter::privateExecute):
166         * jit/JITStubs.cpp:
167         (JSC::DEFINE_STUB_FUNCTION):
168         * runtime/InternalFunction.cpp:
169         (JSC::InternalFunction::name):
170         (JSC::InternalFunction::displayName):
171         * runtime/JSFunction.cpp:
172         (JSC::JSFunction::name):
173         (JSC::JSFunction::displayName):
174         * runtime/JSGlobalObject.cpp:
175         (JSC::JSGlobalObject::reset):
176         * runtime/JSPropertyNameIterator.cpp:
177         * runtime/JSPropertyNameIterator.h:
178         * runtime/JSString.h:
179         (JSC::RopeBuilder::tryGetValue):
180         (JSC::JSString::getIndex):
181         * runtime/NativeErrorConstructor.cpp:
182         (JSC::NativeErrorConstructor::NativeErrorConstructor):
183         * runtime/NativeErrorConstructor.h:
184         * runtime/NativeErrorPrototype.cpp:
185         (JSC::NativeErrorPrototype::NativeErrorPrototype):
186         * runtime/NativeErrorPrototype.h:
187         * runtime/StringPrototype.cpp:
188         (JSC::stringProtoFuncReplace):
189
190 2010-05-21  Gavin Barraclough  <barraclough@apple.com>
191
192         Reviewed by NOBODY (build fix).
193
194         Fix interpreter build.
195
196         * interpreter/Interpreter.cpp:
197         (JSC::Interpreter::privateExecute):
198
199 2010-05-21  Geoffrey Garen  <ggaren@apple.com>
200
201         Reviewed by Gavin Barraclough.
202
203         Split out JITCall32_64.cpp, and tightened up some #ifdefs in the hopes
204         of improving compile times.
205         https://bugs.webkit.org/show_bug.cgi?id=39507
206
207         * JavaScriptCore.xcodeproj/project.pbxproj:
208         * jit/JIT.cpp:
209         * jit/JITArithmetic.cpp:
210         * jit/JITArithmetic32_64.cpp:
211         * jit/JITCall.cpp:
212         * jit/JITCall32_64.cpp: Copied from jit/JITCall.cpp.
213         * jit/JITOpcodes.cpp:
214         * jit/JITOpcodes32_64.cpp:
215         * jit/JITPropertyAccess.cpp:
216         * jit/JITPropertyAccess32_64.cpp:
217         * jit/JITStubs.cpp:
218
219 2010-05-21  Csaba Osztrogonác  <ossy@webkit.org>
220
221         Unreviewed buildfix for Qt after r59941.
222
223         * JavaScriptCore.pro: missing runtime/JSObjectWithGlobalObject.cpp added to SOURCES.
224
225 2010-05-21  Oliver Hunt  <oliver@apple.com>
226
227         Windows build fix #3
228
229         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
230
231 2010-05-21  Oliver Hunt  <oliver@apple.com>
232
233         Windows build fix #2
234
235         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
236
237 2010-05-21  Oliver Hunt  <oliver@apple.com>
238
239         Windows build fix #1
240
241         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
242
243 2010-05-21  Oliver Hunt  <oliver@apple.com>
244
245         Reviewed by Geoffrey Garen.
246
247         All callable objects should have a global object reference
248         https://bugs.webkit.org/show_bug.cgi?id=39495
249
250         All objects that may ever return a value other CallTypeNone
251         or ConstructTypeNone now get a global object in their constructor
252         and store that in their first anonymous slot.  We add a new type
253         JSObjectWithGlobalObject to allow us to share this logic as much
254         as possible, however some objects have specific inheritance 
255         requirements so we can't just use it universally.
256
257         To enforce this requirement JSValue::getCallData and getConstructData
258         make use of a new "isValidCallee" function to assert that any object
259         that returns a value other than CallType/ConstructTypeNone has a
260         global object in anonymous slot 0.
261
262         In order to ensure that static function slots are converted into
263         function objects with the correct global object, all prototype objects
264         and other classes with static function slots also gain a global object
265         reference.  Happily this fixes the long standing issue where host
266         function objects get a prototype from the lexical global object of the
267         first function that calls them, instead of the global object that they
268         are defined on.
269
270         * API/JSCallbackConstructor.cpp:
271         (JSC::JSCallbackConstructor::JSCallbackConstructor):
272         * API/JSCallbackConstructor.h:
273         * API/JSCallbackFunction.cpp:
274         (JSC::JSCallbackFunction::JSCallbackFunction):
275         * API/JSCallbackFunction.h:
276         * API/JSCallbackObject.cpp:
277         (JSC::):
278         * API/JSCallbackObject.h:
279         * API/JSCallbackObjectFunctions.h:
280         (JSC::::JSCallbackObject):
281         (JSC::::staticFunctionGetter):
282         * API/JSClassRef.cpp:
283         (OpaqueJSClass::prototype):
284         * API/JSContextRef.cpp:
285         * API/JSObjectRef.cpp:
286         (JSObjectMake):
287         (JSObjectMakeFunctionWithCallback):
288         (JSObjectMakeConstructor):
289         (JSObjectGetPrivate):
290         (JSObjectSetPrivate):
291         (JSObjectGetPrivateProperty):
292         (JSObjectSetPrivateProperty):
293         (JSObjectDeletePrivateProperty):
294         * API/JSValueRef.cpp:
295         (JSValueIsObjectOfClass):
296         * API/JSWeakObjectMapRefPrivate.cpp:
297         * CMakeLists.txt:
298         * GNUmakefile.am:
299         * JavaScriptCore.exp:
300         * JavaScriptCore.gypi:
301         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
302         * JavaScriptCore.xcodeproj/project.pbxproj:
303         * interpreter/Interpreter.cpp:
304         (JSC::Interpreter::privateExecute):
305         * jit/JITStubs.cpp:
306         (JSC::DEFINE_STUB_FUNCTION):
307         * jsc.cpp:
308         (GlobalObject::GlobalObject):
309         * runtime/ArrayConstructor.cpp:
310         (JSC::ArrayConstructor::ArrayConstructor):
311         * runtime/ArrayConstructor.h:
312         * runtime/ArrayPrototype.cpp:
313         (JSC::ArrayPrototype::ArrayPrototype):
314         * runtime/ArrayPrototype.h:
315         (JSC::ArrayPrototype::createStructure):
316         * runtime/BooleanConstructor.cpp:
317         (JSC::BooleanConstructor::BooleanConstructor):
318         * runtime/BooleanConstructor.h:
319         * runtime/BooleanPrototype.cpp:
320         (JSC::BooleanPrototype::BooleanPrototype):
321         * runtime/BooleanPrototype.h:
322         * runtime/DateConstructor.cpp:
323         (JSC::DateConstructor::DateConstructor):
324         * runtime/DateConstructor.h:
325         * runtime/DatePrototype.cpp:
326         (JSC::DatePrototype::DatePrototype):
327         * runtime/DatePrototype.h:
328         * runtime/ErrorConstructor.cpp:
329         (JSC::ErrorConstructor::ErrorConstructor):
330         * runtime/ErrorConstructor.h:
331         * runtime/ErrorPrototype.cpp:
332         (JSC::ErrorPrototype::ErrorPrototype):
333         * runtime/ErrorPrototype.h:
334         * runtime/FunctionConstructor.cpp:
335         (JSC::FunctionConstructor::FunctionConstructor):
336         * runtime/FunctionConstructor.h:
337         * runtime/FunctionPrototype.cpp:
338         (JSC::FunctionPrototype::FunctionPrototype):
339         (JSC::FunctionPrototype::addFunctionProperties):
340         * runtime/FunctionPrototype.h:
341         * runtime/GlobalEvalFunction.cpp:
342         (JSC::GlobalEvalFunction::GlobalEvalFunction):
343         * runtime/GlobalEvalFunction.h:
344         * runtime/InternalFunction.cpp:
345         (JSC::InternalFunction::InternalFunction):
346         * runtime/InternalFunction.h:
347         * runtime/JSCell.h:
348         (JSC::JSValue::getCallData):
349         (JSC::JSValue::getConstructData):
350         * runtime/JSFunction.cpp:
351         (JSC::JSFunction::JSFunction):
352         * runtime/JSFunction.h:
353         * runtime/JSGlobalObject.cpp:
354         (JSC::JSGlobalObject::reset):
355         * runtime/JSGlobalObject.h:
356         (JSC::JSGlobalObject::JSGlobalObject):
357         * runtime/JSONObject.cpp:
358         (JSC::JSONObject::JSONObject):
359         * runtime/JSONObject.h:
360         * runtime/JSObject.h:
361         * runtime/JSObjectWithGlobalObject.cpp: Added.
362         (JSC::JSObjectWithGlobalObject::JSObjectWithGlobalObject):
363         * runtime/JSObjectWithGlobalObject.h: Added.
364         (JSC::JSObjectWithGlobalObject::createStructure):
365         (JSC::JSObjectWithGlobalObject::JSObjectWithGlobalObject):
366         * runtime/JSValue.cpp:
367         (JSC::JSValue::isValidCallee):
368         * runtime/JSValue.h:
369         * runtime/Lookup.cpp:
370         (JSC::setUpStaticFunctionSlot):
371         * runtime/MathObject.cpp:
372         (JSC::MathObject::MathObject):
373         * runtime/MathObject.h:
374         * runtime/NativeErrorConstructor.cpp:
375         (JSC::NativeErrorConstructor::NativeErrorConstructor):
376         * runtime/NativeErrorConstructor.h:
377         * runtime/NativeErrorPrototype.cpp:
378         (JSC::NativeErrorPrototype::NativeErrorPrototype):
379         * runtime/NativeErrorPrototype.h:
380         * runtime/NumberConstructor.cpp:
381         (JSC::NumberConstructor::NumberConstructor):
382         * runtime/NumberConstructor.h:
383         * runtime/NumberPrototype.cpp:
384         (JSC::NumberPrototype::NumberPrototype):
385         * runtime/NumberPrototype.h:
386         * runtime/ObjectConstructor.cpp:
387         (JSC::ObjectConstructor::ObjectConstructor):
388         * runtime/ObjectConstructor.h:
389         * runtime/ObjectPrototype.cpp:
390         (JSC::ObjectPrototype::ObjectPrototype):
391         * runtime/ObjectPrototype.h:
392         * runtime/PrototypeFunction.cpp:
393         (JSC::PrototypeFunction::PrototypeFunction):
394         * runtime/PrototypeFunction.h:
395         * runtime/RegExpConstructor.cpp:
396         (JSC::RegExpConstructor::RegExpConstructor):
397         (JSC::constructRegExp):
398         * runtime/RegExpConstructor.h:
399         * runtime/RegExpObject.cpp:
400         (JSC::RegExpObject::RegExpObject):
401         * runtime/RegExpObject.h:
402         * runtime/RegExpPrototype.cpp:
403         (JSC::RegExpPrototype::RegExpPrototype):
404         * runtime/RegExpPrototype.h:
405         * runtime/StringConstructor.cpp:
406         (JSC::StringConstructor::StringConstructor):
407         * runtime/StringConstructor.h:
408         * runtime/StringPrototype.cpp:
409         (JSC::StringPrototype::StringPrototype):
410         * runtime/StringPrototype.h:
411
412 2010-05-21  Geoffrey Garen  <ggaren@apple.com>
413
414         Reviewed by Oliver Hunt.
415
416         Removed the unused entry in the CallFrame
417         https://bugs.webkit.org/show_bug.cgi?id=39470
418         
419         Removed the unused entry in the CallFrame, and reordered CallFrame
420         writes on the hot path to be in forwards order.
421         
422         SunSpider says 0.3% faster.
423
424         * interpreter/RegisterFile.h:
425         (JSC::RegisterFile::):
426         * jit/JITCall.cpp:
427         (JSC::JIT::compileOpCall):
428
429 2010-05-21  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
430
431         Reviewed by Kenneth Rohde Christiansen.
432
433         Split the QScriptValue autotest into smaller chunks.
434
435         File tst_qscriptvalue_generated.cpp was huge and it was difficult to compile
436         it with MSVS2008, because of the code optimization.
437
438         Tests were splited into a few files for better use of distributed
439         compilation.
440         Repeated calls to insert() and operator<<() where replaced by loops,
441         that should reduce time of code optimizing.
442
443         New files were generated by the same application, test logic wasn't changed.
444
445         [Qt] The QScriptValue autotest should be refactored.
446         https://bugs.webkit.org/show_bug.cgi?id=38987
447
448         * qt/tests/qscriptvalue/qscriptvalue.pro:
449         * qt/tests/qscriptvalue/tst_qscriptvalue.h:
450         * qt/tests/qscriptvalue/tst_qscriptvalue_generated.cpp: Removed.
451         * qt/tests/qscriptvalue/tst_qscriptvalue_generated_init.cpp: Added.
452         (tst_QScriptValue::initScriptValues):
453         * qt/tests/qscriptvalue/tst_qscriptvalue_generated_istype.cpp: Added.
454         (tst_QScriptValue::isValid_initData):
455         (tst_QScriptValue::isValid_makeData):
456         (tst_QScriptValue::isValid_test):
457         (tst_QScriptValue::isBool_initData):
458         (tst_QScriptValue::isBool_makeData):
459         (tst_QScriptValue::isBool_test):
460         (tst_QScriptValue::isBoolean_initData):
461         (tst_QScriptValue::isBoolean_makeData):
462         (tst_QScriptValue::isBoolean_test):
463         (tst_QScriptValue::isNumber_initData):
464         (tst_QScriptValue::isNumber_makeData):
465         (tst_QScriptValue::isNumber_test):
466         (tst_QScriptValue::isFunction_initData):
467         (tst_QScriptValue::isFunction_makeData):
468         (tst_QScriptValue::isFunction_test):
469         (tst_QScriptValue::isNull_initData):
470         (tst_QScriptValue::isNull_makeData):
471         (tst_QScriptValue::isNull_test):
472         (tst_QScriptValue::isString_initData):
473         (tst_QScriptValue::isString_makeData):
474         (tst_QScriptValue::isString_test):
475         (tst_QScriptValue::isUndefined_initData):
476         (tst_QScriptValue::isUndefined_makeData):
477         (tst_QScriptValue::isUndefined_test):
478         (tst_QScriptValue::isObject_initData):
479         (tst_QScriptValue::isObject_makeData):
480         (tst_QScriptValue::isObject_test):
481         * qt/tests/qscriptvalue/tst_qscriptvalue_generated_totype.cpp: Added.
482         (tst_QScriptValue::toString_initData):
483         (tst_QScriptValue::toString_makeData):
484         (tst_QScriptValue::toString_test):
485         (tst_QScriptValue::toNumber_initData):
486         (tst_QScriptValue::toNumber_makeData):
487         (tst_QScriptValue::toNumber_test):
488         (tst_QScriptValue::toBool_initData):
489         (tst_QScriptValue::toBool_makeData):
490         (tst_QScriptValue::toBool_test):
491         (tst_QScriptValue::toBoolean_initData):
492         (tst_QScriptValue::toBoolean_makeData):
493         (tst_QScriptValue::toBoolean_test):
494         (tst_QScriptValue::toInteger_initData):
495         (tst_QScriptValue::toInteger_makeData):
496         (tst_QScriptValue::toInteger_test):
497         (tst_QScriptValue::toInt32_initData):
498         (tst_QScriptValue::toInt32_makeData):
499         (tst_QScriptValue::toInt32_test):
500         (tst_QScriptValue::toUInt32_initData):
501         (tst_QScriptValue::toUInt32_makeData):
502         (tst_QScriptValue::toUInt32_test):
503         (tst_QScriptValue::toUInt16_initData):
504         (tst_QScriptValue::toUInt16_makeData):
505         (tst_QScriptValue::toUInt16_test):
506
507 2010-05-21  Kwang Yul Seo  <skyul@company100.net>
508
509         Reviewed by Eric Seidel.
510
511         Add COMPILER(MSVC) guard for strnstr
512         https://bugs.webkit.org/show_bug.cgi?id=39397
513
514         BREWMP uses MSVC for simulator build, but it is not OS(WINDOWS).
515         Add COMPILER(MSVC) guard for strnstr.
516
517         * wtf/StringExtras.h:
518
519 2010-05-21  Kwang Yul Seo  <skyul@company100.net>
520
521         Reviewed by Eric Seidel.
522
523         [BREWMP] Add !PLATFORM(BREWMP) guard for isMainThread
524         https://bugs.webkit.org/show_bug.cgi?id=39396
525
526         BREWMP sets ENABLE(SINGLE_THREADED), so it uses isMainThread from ThreadingNone.cpp.
527         Exclude isMainThread in MainThread.cpp.
528
529         * wtf/MainThread.cpp:
530
531 2010-05-20  Kwang Yul Seo  <skyul@company100.net>
532
533         Reviewed by Eric Seidel.
534
535         [BREWMP] Use skia as BREW MP's graphics backend.
536         https://bugs.webkit.org/show_bug.cgi?id=39407
537
538         Define WTF_PLATFORM_SKIA=1 for BREW MP.
539
540         * wtf/Platform.h:
541
542 2010-05-20  Geoffrey Garen  <ggaren@apple.com>
543
544         Reviewed by Beth Dakin.
545
546         Fixed naming mixup: it's op_call_put_result, not ret_result.
547
548         * bytecode/CodeBlock.cpp:
549         (JSC::CodeBlock::dump):
550         * interpreter/Interpreter.cpp:
551         (JSC::Interpreter::privateExecute):
552
553 2010-05-20  Geoffrey Garen  <ggaren@apple.com>
554
555         Reviewed by Oliver Hunt.
556
557         Whittling away at CodeBlock use: Removed a little wonkiness in closure lookup
558         https://bugs.webkit.org/show_bug.cgi?id=39444
559         
560         Calculate all lookup depths at compile time. I'm not sure why we couldn't
561         do this before, but whatever the reason, it seems to be gone now.
562
563         * bytecompiler/BytecodeGenerator.cpp:
564         (JSC::BytecodeGenerator::findScopedProperty):
565         * bytecompiler/BytecodeGenerator.h:
566         * interpreter/Interpreter.cpp:
567         (JSC::Interpreter::resolveSkip):
568         (JSC::Interpreter::resolveGlobalDynamic):
569         (JSC::Interpreter::privateExecute):
570         * jit/JITOpcodes.cpp:
571         (JSC::JIT::emit_op_get_scoped_var):
572         (JSC::JIT::emit_op_put_scoped_var):
573         (JSC::JIT::emit_op_resolve_skip):
574         (JSC::JIT::emit_op_resolve_global_dynamic):
575         (JSC::JIT::emitSlow_op_resolve_global_dynamic):
576         * jit/JITOpcodes32_64.cpp:
577         (JSC::JIT::emit_op_get_scoped_var):
578         (JSC::JIT::emit_op_put_scoped_var):
579         (JSC::JIT::emit_op_resolve_skip):
580
581 2010-05-20  Darin Adler  <darin@apple.com>
582
583         Reviewed by Eric Seidel.
584
585         Fix warnings seen on the buildbots today
586         https://bugs.webkit.org/show_bug.cgi?id=39368
587
588         * profiler/ProfileNode.cpp:
589         (JSC::getCount): Removed unneeded initialization of global variable.
590         These are all initialized to zero anyway, so no need to try to initialize
591         it and get a warning.
592
593         * wtf/CurrentTime.cpp:
594         (WTF::currentTime): Removed unused global variable.
595
596 2010-05-20  Geoffrey Garen  <ggaren@apple.com>
597
598         Reviewed by Darin Adler.
599
600         Removed some reliance on callFame[CodeBlock] by storing CodeBlock in a
601         local variable in the Interpreter.
602         https://bugs.webkit.org/show_bug.cgi?id=39447
603
604         Small speedup on SunSpider in Interpreter mode.
605
606         * interpreter/Interpreter.cpp:
607         (JSC::Interpreter::privateExecute):
608         * jsc.cpp:
609         * wtf/Platform.h:
610
611 2010-05-19  Gavin Barraclough  <barraclough@apple.com>
612
613         Reviewed by Oliver Hunt.
614
615         Bug 39408 - Unify JIT/interpreter return behaviour.
616
617         Presently the JIT and the interpreter have differing implementations in how
618         they handle storing the result of a function call back to the register file.
619         In both cases the op_call ( / _eval / _varargs / op_construct) opcode has an
620         operand indicating the VM register in which the result should be stored.
621         The JIT plants code after the call to store the result, so the value will be
622         stored as soon as the callee has returned.  In the interpreter the call
623         passes the return value register id into the callee via the callee callframe,
624         and the callee is responsible for writing the result back into its callers
625         register file after it has restored the parents callframe pointer, but before
626         returning.
627
628         Instead, move the task of writing the call result to the register file into a
629         new opcode (op_call_put_result), and after returning the callee should leave
630         the return value in a canonical location.  In the case of the interpreter,
631         this canonical location is a local variable in privateExecute
632         (functionReturnValue), in the case of the JIT this is the normal return value
633         registers (regT0, or regT1:regT0 in JSVALUE32_64).  op_call_put_result stores
634         the result from the canonical location to the registerfile.
635
636         In addition to unifying JIT & interpreter behaviour this change allows us to
637         remove a slot from the callframe, omit the write of the result where the
638         return value from the call is not used, and provides a 2% speedup on sunspider
639         in the interpreter.
640
641         * bytecode/CodeBlock.cpp:
642         (JSC::CodeBlock::dump):
643         * bytecode/Opcode.h:
644         * bytecompiler/BytecodeGenerator.cpp:
645         (JSC::BytecodeGenerator::emitCall):
646         (JSC::BytecodeGenerator::emitCallVarargs):
647         (JSC::BytecodeGenerator::emitConstruct):
648         * bytecompiler/BytecodeGenerator.h:
649         (JSC::BytecodeGenerator::finalDestinationOrIgnored):
650         * bytecompiler/NodesCodegen.cpp:
651         (JSC::NewExprNode::emitBytecode):
652         (JSC::FunctionCallValueNode::emitBytecode):
653         (JSC::FunctionCallResolveNode::emitBytecode):
654         (JSC::FunctionCallBracketNode::emitBytecode):
655         (JSC::FunctionCallDotNode::emitBytecode):
656         (JSC::CallFunctionCallDotNode::emitBytecode):
657         (JSC::ApplyFunctionCallDotNode::emitBytecode):
658         * interpreter/CallFrame.h:
659         (JSC::ExecState::init):
660         (JSC::ExecState::noCaller):
661         * interpreter/Interpreter.cpp:
662         (JSC::Interpreter::dumpRegisters):
663         (JSC::Interpreter::throwException):
664         (JSC::Interpreter::privateExecute):
665         * interpreter/RegisterFile.h:
666         (JSC::RegisterFile::):
667         * jit/JIT.cpp:
668         (JSC::JIT::privateCompileMainPass):
669         * jit/JIT.h:
670         * jit/JITCall.cpp:
671         (JSC::JIT::compileOpCallSetupArgs):
672         (JSC::JIT::compileOpConstructSetupArgs):
673         (JSC::JIT::emit_op_call_put_result):
674         (JSC::JIT::compileOpCallVarargs):
675         (JSC::JIT::compileOpCallVarargsSlowCase):
676         (JSC::JIT::compileOpCall):
677         (JSC::JIT::compileOpCallSlowCase):
678         (JSC::JIT::compileOpCallVarargsSetupArgs):
679
680 2010-05-20  Steve Block  <steveblock@google.com>
681
682         Reviewed by Jeremy Orlow.
683
684         Provide bindings for DeviceOrientation
685         https://bugs.webkit.org/show_bug.cgi?id=39210
686
687         Adds ENABLE_DEVICE_ORIENTATION to XCode project file, always disabled.
688
689         * Configurations/FeatureDefines.xcconfig:
690
691 2010-05-19  Gavin Barraclough  <barraclough@apple.com>
692
693         Reviewed by Geoff Garen.
694
695         Errk! rename op_constructor_ret as requested in review of Bug 39399.
696
697         * bytecode/CodeBlock.cpp:
698         (JSC::CodeBlock::dump):
699         * bytecode/Opcode.h:
700         * bytecompiler/BytecodeGenerator.cpp:
701         (JSC::BytecodeGenerator::emitReturn):
702         * interpreter/Interpreter.cpp:
703         (JSC::Interpreter::privateExecute):
704         * jit/JIT.cpp:
705         (JSC::JIT::privateCompileMainPass):
706         * jit/JIT.h:
707         * jit/JITCall.cpp:
708         (JSC::JIT::emit_op_ret_object_or_this):
709         * jit/JITOpcodes.cpp:
710         (JSC::JIT::emit_op_ret_object_or_this):
711
712 2010-05-19  Gavin Barraclough  <barraclough@apple.com>
713
714         Reviewed by Geoff Garen.
715
716         Bug 39399 - Move responsibility for verifying constructors return objects from the caller to the callee.
717         
718         This is a necessary step to move object creation from caller to callee.
719
720         * bytecode/CodeBlock.cpp:
721         (JSC::CodeBlock::dump):
722         * bytecode/Opcode.h:
723         * bytecompiler/BytecodeGenerator.cpp:
724         (JSC::BytecodeGenerator::BytecodeGenerator):
725         (JSC::BytecodeGenerator::emitReturn):
726         (JSC::BytecodeGenerator::emitConstruct):
727         * bytecompiler/BytecodeGenerator.h:
728         (JSC::BytecodeGenerator::isConstructor):
729         * bytecompiler/NodesCodegen.cpp:
730         (JSC::FunctionBodyNode::emitBytecode):
731         * interpreter/Interpreter.cpp:
732         (JSC::Interpreter::privateExecute):
733         * jit/JIT.cpp:
734         (JSC::JIT::privateCompileMainPass):
735         (JSC::JIT::privateCompileSlowCases):
736         * jit/JIT.h:
737         * jit/JITCall.cpp:
738         (JSC::JIT::emit_op_constructor_ret):
739         * jit/JITOpcodes.cpp:
740         (JSC::JIT::emit_op_constructor_ret):
741
742 2010-05-19  Gavin Barraclough  <barraclough@apple.com>
743
744         Reviewed by NOBODY (build fix).
745
746         Fix windows build II.
747
748         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
749
750 2010-05-19  Gavin Barraclough  <barraclough@apple.com>
751
752         Reviewed by NOBODY (build fix).
753
754         Fix windows build.
755
756         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
757
758 2010-05-19  Gavin Barraclough  <barraclough@apple.com>
759
760         Reviewed by Oliver Hunt.
761
762         Bug 39393 - JSFunction need not be a subclass of InternalFunction.
763
764         re-landing r59800.
765
766         * JavaScriptCore.exp:
767         * interpreter/Interpreter.cpp:
768         (JSC::Interpreter::retrieveCaller):
769         (JSC::Interpreter::findFunctionCallFrame):
770         * interpreter/Interpreter.h:
771         * profiler/Profiler.cpp:
772         (JSC::Profiler::createCallIdentifier):
773         * runtime/FunctionPrototype.cpp:
774         (JSC::functionProtoFuncToString):
775         * runtime/JSFunction.cpp:
776         (JSC::):
777         (JSC::JSFunction::JSFunction):
778         (JSC::JSFunction::name):
779         (JSC::JSFunction::displayName):
780         (JSC::JSFunction::calculatedDisplayName):
781         * runtime/JSFunction.h:
782         * runtime/JSObject.cpp:
783         (JSC::JSObject::putDirectFunction):
784         (JSC::JSObject::putDirectFunctionWithoutTransition):
785         * runtime/JSObject.h:
786         * runtime/Lookup.cpp:
787         (JSC::setUpStaticFunctionSlot):
788
789 2010-05-19  Gavin Barraclough  <barraclough@apple.com>
790
791         Reviewed by NOBODY (build fix).
792
793         Reverting r59800, this b0rked stuff.
794
795         * JavaScriptCore.exp:
796         * interpreter/Interpreter.cpp:
797         (JSC::Interpreter::retrieveCaller):
798         (JSC::Interpreter::findFunctionCallFrame):
799         * interpreter/Interpreter.h:
800         * profiler/Profiler.cpp:
801         (JSC::Profiler::createCallIdentifier):
802         * runtime/FunctionPrototype.cpp:
803         (JSC::functionProtoFuncToString):
804         * runtime/JSFunction.cpp:
805         (JSC::):
806         (JSC::JSFunction::JSFunction):
807         * runtime/JSFunction.h:
808         * runtime/JSObject.cpp:
809         * runtime/JSObject.h:
810         * runtime/Lookup.cpp:
811         (JSC::setUpStaticFunctionSlot):
812
813 2010-05-19  Gavin Barraclough  <barraclough@apple.com>
814
815         Reviewed by Oliver Hunt.
816
817         Bug 39393 - JSFunction need not be a subclass of InternalFunction.
818
819         This may prevent us from introducing a more useful parent class to
820         JSFunction, e.g. a JSObject that holds an executable, which could
821         also reference an eval or program executable.
822
823         * JavaScriptCore.exp:
824         * interpreter/Interpreter.cpp:
825         (JSC::Interpreter::retrieveCaller):
826         (JSC::Interpreter::findFunctionCallFrame):
827         * interpreter/Interpreter.h:
828         * profiler/Profiler.cpp:
829         (JSC::Profiler::createCallIdentifier):
830         * runtime/FunctionPrototype.cpp:
831         (JSC::functionProtoFuncToString):
832         * runtime/JSFunction.cpp:
833         (JSC::):
834         (JSC::JSFunction::JSFunction):
835         (JSC::JSFunction::name):
836         (JSC::JSFunction::displayName):
837         (JSC::JSFunction::calculatedDisplayName):
838         * runtime/JSFunction.h:
839         * runtime/JSObject.cpp:
840         (JSC::JSObject::putDirectFunction):
841         (JSC::JSObject::putDirectFunctionWithoutTransition):
842         * runtime/JSObject.h:
843         * runtime/Lookup.cpp:
844         (JSC::setUpStaticFunctionSlot):
845
846 2010-05-19  Oliver Hunt  <oliver@apple.com>
847
848         Reviewed by Geoffrey Garen.
849
850         emitJumpIfNotJSCell should special case constant immediate values
851         https://bugs.webkit.org/show_bug.cgi?id=39392
852         <rdar://problem/8001324>
853
854         Make emitJumpSlowCaseIfNotJSCell special case constant immediate
855         values, in addition to the immediate JSCell optimisation.
856
857         Also add assertions to make sure no one else produces code that
858         attempts to load constants from the register file.
859
860         * jit/JITInlineMethods.h:
861         (JSC::JIT::emitJumpSlowCaseIfNotJSCell):
862         * jit/JSInterfaceJIT.h:
863         (JSC::JSInterfaceJIT::emitJumpIfNotJSCell):
864         (JSC::JSInterfaceJIT::emitLoadInt32):
865         (JSC::JSInterfaceJIT::tagFor):
866         (JSC::JSInterfaceJIT::payloadFor):
867         (JSC::JSInterfaceJIT::emitLoadDouble):
868         (JSC::JSInterfaceJIT::addressFor):
869         * jit/ThunkGenerators.cpp:
870
871 2010-05-19  Geoffrey Garen  <ggaren@apple.com>
872
873         Reviewed by Sam Weinig.
874
875         Slight refactoring to CodeBlock bytecode access
876         https://bugs.webkit.org/show_bug.cgi?id=39384
877
878         * bytecode/CodeBlock.h:
879         (JSC::CodeBlock::bytecodeOffset):
880         * interpreter/CallFrame.h:
881         (JSC::ExecState::returnPC):
882         * interpreter/Interpreter.cpp:
883         (JSC::Interpreter::unwindCallFrame):
884         (JSC::Interpreter::retrieveLastCaller): Moved bytecode access into a
885         CodeBlock helper function. Changed CallFrame to accurately represent
886         how the returnPC is stored in JIT vs Interpreter.
887
888 2010-05-19  Geoffrey Garen  <ggaren@apple.com>
889
890         Reviewed by Sam Weinig.
891
892         Don't build the Interpreter into JIT builds.
893         https://bugs.webkit.org/show_bug.cgi?id=39373
894
895         SunSpider says no change.
896
897         * interpreter/Interpreter.cpp:
898         (JSC::Interpreter::privateExecute):
899         * interpreter/Interpreter.h:
900         * wtf/Platform.h:
901
902 2010-05-19  Geoffrey Garen  <ggaren@apple.com>
903
904         Reviewed by Gavin Barraclough.
905         
906         Standardized naming: "bytecode offset" wins; "bytecode index" loses.
907         
908         Also renamed getBytecodeOffset to bytecodeOffset, to match the WebKit
909         naming style.
910
911         * bytecode/CodeBlock.h:
912         (JSC::CallReturnOffsetToBytecodeOffset::CallReturnOffsetToBytecodeOffset):
913         (JSC::getCallReturnOffset):
914         (JSC::CodeBlock::bytecodeOffset):
915         (JSC::CodeBlock::callReturnIndexVector):
916         * interpreter/Interpreter.cpp:
917         (JSC::bytecodeOffsetForPC):
918         * jit/JIT.cpp:
919         (JSC::JIT::JIT):
920         (JSC::JIT::privateCompileMainPass):
921         (JSC::JIT::privateCompileLinkPass):
922         (JSC::JIT::privateCompileSlowCases):
923         (JSC::JIT::privateCompile):
924         * jit/JIT.h:
925         (JSC::CallRecord::CallRecord):
926         (JSC::JumpTable::JumpTable):
927         (JSC::SwitchRecord::SwitchRecord):
928         * jit/JITCall.cpp:
929         (JSC::JIT::compileOpCallVarargsSlowCase):
930         (JSC::JIT::compileOpCall):
931         * jit/JITInlineMethods.h:
932         (JSC::JIT::emitNakedCall):
933         (JSC::JIT::addSlowCase):
934         (JSC::JIT::addJump):
935         (JSC::JIT::emitJumpSlowToHot):
936         (JSC::JIT::isLabeled):
937         (JSC::JIT::map):
938         (JSC::JIT::unmap):
939         (JSC::JIT::isMapped):
940         (JSC::JIT::getMappedPayload):
941         (JSC::JIT::getMappedTag):
942         (JSC::JIT::emitGetVirtualRegister):
943         * jit/JITOpcodes.cpp:
944         (JSC::JIT::emit_op_switch_imm):
945         (JSC::JIT::emit_op_switch_char):
946         (JSC::JIT::emit_op_switch_string):
947         (JSC::JIT::emit_op_new_error):
948         * jit/JITOpcodes32_64.cpp:
949         (JSC::JIT::emit_op_mov):
950         (JSC::JIT::emit_op_get_global_var):
951         (JSC::JIT::emit_op_put_global_var):
952         (JSC::JIT::emit_op_get_scoped_var):
953         (JSC::JIT::emit_op_put_scoped_var):
954         (JSC::JIT::emit_op_to_primitive):
955         (JSC::JIT::emit_op_resolve_global):
956         (JSC::JIT::emit_op_to_jsnumber):
957         (JSC::JIT::emit_op_catch):
958         (JSC::JIT::emit_op_switch_imm):
959         (JSC::JIT::emit_op_switch_char):
960         (JSC::JIT::emit_op_switch_string):
961         (JSC::JIT::emit_op_new_error):
962         (JSC::JIT::emit_op_convert_this):
963         * jit/JITPropertyAccess.cpp:
964         (JSC::JIT::emit_op_method_check):
965         (JSC::JIT::emitSlow_op_method_check):
966         * jit/JITPropertyAccess32_64.cpp:
967         (JSC::JIT::emit_op_method_check):
968         (JSC::JIT::emitSlow_op_method_check):
969         (JSC::JIT::emit_op_get_by_val):
970         (JSC::JIT::emit_op_get_by_id):
971         (JSC::JIT::emit_op_get_by_pname):
972         * jit/JITStubCall.h:
973         (JSC::JITStubCall::call):
974         * jit/JITStubs.cpp:
975         (JSC::DEFINE_STUB_FUNCTION):
976
977 2010-05-19  Peter Varga  <pvarga@inf.u-szeged.hu>
978
979         Reviewed by Darin Adler.
980
981         The backtrackParenthesesOnceEnd function should store the start position
982         of the subpattern's non-greedy match at the place of the subpattern's
983         start index in the output array instead of the place of the
984         subpattern's end index.
985         Add layout test for checking of non-greedy matching of subpattern in
986         regular expressions.
987         https://bugs.webkit.org/show_bug.cgi?id=39289
988
989         * yarr/RegexInterpreter.cpp:
990         (JSC::Yarr::Interpreter::backtrackParenthesesOnceEnd):
991
992 2010-05-18  Gavin Barraclough  <barraclough@apple.com>
993
994         Reviewed by Geoff Garen.
995
996         Bug 39343 - Dynamically generate a native call thunk per NativeFunction
997         
998         https://bugs.webkit.org/show_bug.cgi?id=39252 regressed performance on i386,
999         by adding an extra indirection to making a native call.  By introducing per-
1000         NativeFunction thunks we can hard code the function pointer into the thunk
1001         so that it need not be loaded from the callee.
1002
1003         * jit/JIT.h:
1004         (JSC::JIT::compileCTINativeCall):
1005         * jit/JITOpcodes.cpp:
1006         (JSC::JIT::privateCompileCTINativeCall):
1007         * jit/JITOpcodes32_64.cpp:
1008         (JSC::JIT::privateCompileCTINativeCall):
1009         * jit/JITPropertyAccess.cpp:
1010         (JSC::JIT::emitSlow_op_get_by_val):
1011         * jit/JITPropertyAccess32_64.cpp:
1012         (JSC::JIT::emitSlow_op_get_by_val):
1013         * jit/JITStubs.cpp:
1014         (JSC::JITThunks::ctiStub):
1015         (JSC::JITThunks::hostFunctionStub):
1016         * jit/JITStubs.h:
1017         * jit/SpecializedThunkJIT.h:
1018         (JSC::SpecializedThunkJIT::finalize):
1019         * jit/ThunkGenerators.cpp:
1020         (JSC::charCodeAtThunkGenerator):
1021         (JSC::charAtThunkGenerator):
1022         (JSC::fromCharCodeThunkGenerator):
1023         (JSC::sqrtThunkGenerator):
1024         (JSC::powThunkGenerator):
1025         * runtime/JSFunction.cpp:
1026         (JSC::JSFunction::JSFunction):
1027         * runtime/JSGlobalData.cpp:
1028         (JSC::JSGlobalData::getHostFunction):
1029         * runtime/JSGlobalData.h:
1030         (JSC::JSGlobalData::getCTIStub):
1031         * runtime/Lookup.cpp:
1032         (JSC::setUpStaticFunctionSlot):
1033         * runtime/StringConstructor.cpp:
1034         (JSC::StringConstructor::StringConstructor):
1035         * wtf/Platform.h:
1036
1037 2010-05-18  Geoffrey Garen  <ggaren@apple.com>
1038
1039         Reviewed by Darin Adler.
1040
1041         Simplified handling of 'arguments' -- 1.2% SunSpider speedup
1042         https://bugs.webkit.org/show_bug.cgi?id=39200
1043         
1044         Removed the reserved OptionalCalleeArguments slot from the CallFrame.
1045         Now, slots for 'arguments' are allocated and initialized only by
1046         functions that might need them.
1047         
1048         * bytecode/CodeBlock.cpp:
1049         (JSC::CodeBlock::dump): Updated for new bytecode operands.
1050
1051         (JSC::CodeBlock::CodeBlock):
1052         * bytecode/CodeBlock.h:
1053         (JSC::unmodifiedArgumentsRegister): Added a helper function for mapping
1054         from the arguments register to its unmodified counterpart.
1055
1056         (JSC::CodeBlock::setArgumentsRegister):
1057         (JSC::CodeBlock::argumentsRegister):
1058         (JSC::CodeBlock::usesArguments):  Changed from a "usesArguments" bool to
1059         an optional int index representing the arguments register.
1060
1061         * bytecode/Opcode.h: Updated for new bytecode operands.
1062
1063         * bytecompiler/BytecodeGenerator.cpp:
1064         (JSC::BytecodeGenerator::addVar): Factored out a helper function for
1065         allocating an anonymous var.
1066
1067         (JSC::BytecodeGenerator::BytecodeGenerator): Merged / simplified some
1068         arguments vs activation logic, and added code to allocate the arguments
1069         registers when needed.
1070
1071         (JSC::BytecodeGenerator::createArgumentsIfNecessary): Updated for new bytecode operands.
1072
1073         (JSC::BytecodeGenerator::emitCallEval): No need to create the arguments
1074         object before calling eval; the activation object will lazily create the
1075         arguments object if eval resolves it.
1076
1077         (JSC::BytecodeGenerator::emitReturn): Updated for new bytecode operands.
1078
1079         (JSC::BytecodeGenerator::emitPushScope):
1080         (JSC::BytecodeGenerator::emitPushNewScope): Ditto emitCallEval.
1081
1082         * bytecompiler/BytecodeGenerator.h:
1083         (JSC::BytecodeGenerator::addVar): Factored out a helper function for
1084         allocating an anonymous var.
1085
1086         (JSC::BytecodeGenerator::registerFor): No more need for special handling
1087         of the arguments registers; they're allocated just like normal registers
1088         now.
1089
1090         * interpreter/CallFrame.h:
1091         (JSC::ExecState::callerFrame):
1092         (JSC::ExecState::init):
1093         * interpreter/CallFrameClosure.h:
1094         (JSC::CallFrameClosure::resetCallFrame): Nixed optionalCalleeArguments.
1095
1096         * interpreter/Interpreter.cpp:
1097         (JSC::Interpreter::dumpRegisters):
1098         (JSC::Interpreter::unwindCallFrame):
1099         (JSC::Interpreter::privateExecute):
1100         (JSC::Interpreter::retrieveArguments): Opcodes accessing 'arguments' now
1101         take operands specifying registers, just like all other opcodes.
1102         JSActivation::copyRegisters is no longer responsible for tearing off the
1103         arguments object; instead, the VM is responsible for both.
1104
1105         Also, a behavior change: Each access to f.arguments creates a new object,
1106         unless f itself uses 'arguments'. This matches Chrome, and is necessary
1107         for the optimization. f.arguments is a nonstandard, deprecated feature,
1108         so high fidelity to a given implementation is not necessarily a goal.
1109         Also, as illustrated by the new test case, the identity of f.arguments
1110         has been broken since 2008, except in the case where f itself accesses
1111         f.arguments -- but nobody seemed to notice. So, hopefully this change won't
1112         break the web.
1113         
1114         * interpreter/Register.h: Nixed the special arguments accessor. It's no
1115         longer needed.
1116
1117         * interpreter/RegisterFile.h:
1118         (JSC::RegisterFile::):
1119         * jit/JITCall.cpp:
1120         (JSC::JIT::compileOpCallInitializeCallFrame):
1121         (JSC::JIT::compileOpCall):
1122         * jit/JITOpcodes.cpp:
1123         (JSC::JIT::emit_op_tear_off_activation):
1124         (JSC::JIT::emit_op_tear_off_arguments):
1125         (JSC::JIT::emit_op_create_arguments):
1126         (JSC::JIT::emit_op_init_arguments):
1127         * jit/JITOpcodes32_64.cpp:
1128         (JSC::JIT::emit_op_tear_off_activation):
1129         (JSC::JIT::emit_op_tear_off_arguments):
1130         (JSC::JIT::emit_op_create_arguments):
1131         (JSC::JIT::emit_op_init_arguments): The actual optimization: Removed
1132         OptionalCalleeArguments from the callframe slot. Now, it doesn't need
1133         to be initialized for most calls.
1134
1135         * jit/JITStubs.cpp:
1136         (JSC::DEFINE_STUB_FUNCTION):
1137         * jit/JITStubs.h:
1138         (JSC::): Updated stubs to support arbitrary 'arguments' registers,
1139         instead of hard-coding something in the call frame.
1140
1141         * runtime/Arguments.h:
1142         (JSC::JSActivation::copyRegisters): Removed some obfuscatory abstraction.
1143
1144         * runtime/Executable.h:
1145         (JSC::FunctionExecutable::generatedByteCode): Added a helper for accessing
1146         the 'arguments' register. In a future patch, that kind of data should
1147         probably move out of CodeBlock and into Executable.
1148
1149         * runtime/JSActivation.cpp:
1150         (JSC::JSActivation::getOwnPropertySlot):
1151         (JSC::JSActivation::argumentsGetter):
1152         * runtime/JSActivation.h: Simplified / fixed access to 'arguments' via
1153         the activation object. It now implements the same behavior implemented
1154         by optimized variable access in the VM. This simplifies some other
1155         things, too -- like eval code generation.
1156
1157 2010-05-18  Sam Weinig  <sam@webkit.org>
1158
1159         Try to fix the windows build.
1160
1161         * API/JSStringRefBSTR.cpp:
1162
1163 2010-05-18  Anders Carlsson  <andersca@apple.com>
1164
1165         Reviewed by Sam Weinig.
1166
1167         Add an inlineCapacity template parameter to ListHashSet and use it to shrink the positioned object list hash set.
1168         https://bugs.webkit.org/show_bug.cgi?id=39304
1169         <rdar://problem/7998366>
1170
1171         Add an inlineCapacity template parameter to ListHashSet.
1172
1173         * wtf/ListHashSet.h:
1174         (WTF::::ListHashSet):
1175         (WTF::::operator):
1176         (WTF::::swap):
1177         (WTF::::~ListHashSet):
1178         (WTF::::size):
1179         (WTF::::capacity):
1180         (WTF::::isEmpty):
1181         (WTF::::begin):
1182         (WTF::::end):
1183         (WTF::::find):
1184         (WTF::::contains):
1185         (WTF::::add):
1186         (WTF::::insertBefore):
1187         (WTF::::remove):
1188         (WTF::::clear):
1189         (WTF::::unlinkAndDelete):
1190         (WTF::::appendNode):
1191         (WTF::::insertNodeBefore):
1192         (WTF::::deleteAllNodes):
1193         (WTF::::makeIterator):
1194         (WTF::::makeConstIterator):
1195         (WTF::deleteAllValues):
1196
1197 2010-05-18  Gabor Loki  <loki@webkit.org>
1198
1199         Reviewed by Darin Adler.
1200
1201         Fix the interpreter after r59637
1202         https://bugs.webkit.org/show_bug.cgi?id=39287
1203
1204         * runtime/Executable.h:
1205         * runtime/JSFunction.cpp:
1206         (JSC::JSFunction::JSFunction):
1207         (JSC::JSFunction::getCallData):
1208         * runtime/JSGlobalData.cpp:
1209         * runtime/JSGlobalData.h:
1210
1211 2010-05-17  Gavin Barraclough  <barraclough@apple.com>
1212
1213         Reviewed by Geoff Garen.
1214
1215         Oops, meant ebx not eax there.  Fix Qt (and probably Win too).
1216
1217         * jit/JITOpcodes32_64.cpp:
1218
1219 2010-05-17  Gavin Barraclough  <barraclough@apple.com>
1220
1221         Reviewed by Geoff Garen.
1222
1223         Bug 39252 - Move host/native JSFunction's NativeFunction onto NativeExecutable.
1224
1225         Currently host functions reuse JSFunction's ScopeChain as storage for their
1226         NativeFunction (the C function pointer to the host function implementation).
1227         Instead, move this onto NativeExecutable.  This will allow host functions to
1228         have a scopechain (which will be implemented as a separate patch).
1229
1230         * JavaScriptCore.xcodeproj/project.pbxproj:
1231         * jit/JIT.h:
1232         * jit/JITCall.cpp:
1233         (JSC::JIT::compileOpCallInitializeCallFrame):
1234         (JSC::JIT::compileOpCall):
1235         * jit/JITOpcodes.cpp:
1236         (JSC::JIT::privateCompileCTIMachineTrampolines):
1237         * jit/JITOpcodes32_64.cpp:
1238         * jit/JITPropertyAccess.cpp:
1239         (JSC::JIT::stringGetByValStubGenerator):
1240         (JSC::JIT::emitSlow_op_get_by_val):
1241         * jit/JITPropertyAccess32_64.cpp:
1242         (JSC::JIT::stringGetByValStubGenerator):
1243         (JSC::JIT::emitSlow_op_get_by_val):
1244         * jit/JITStubs.cpp:
1245         (JSC::JITThunks::specializedThunk):
1246         * jit/JITStubs.h:
1247         (JSC::JITThunks::ctiNativeCall):
1248         * jit/SpecializedThunkJIT.h:
1249         (JSC::SpecializedThunkJIT::finalize):
1250         * jit/ThunkGenerators.cpp:
1251         (JSC::charCodeAtThunkGenerator):
1252         (JSC::charAtThunkGenerator):
1253         (JSC::fromCharCodeThunkGenerator):
1254         (JSC::sqrtThunkGenerator):
1255         (JSC::powThunkGenerator):
1256         * jit/ThunkGenerators.h:
1257         * runtime/Executable.h:
1258         (JSC::NativeExecutable::create):
1259         (JSC::NativeExecutable::function):
1260         (JSC::NativeExecutable::NativeExecutable):
1261         (JSC::JSFunction::nativeFunction):
1262         * runtime/JSFunction.cpp:
1263         (JSC::JSFunction::JSFunction):
1264         (JSC::JSFunction::~JSFunction):
1265         (JSC::JSFunction::markChildren):
1266         (JSC::JSFunction::getCallData):
1267         (JSC::JSFunction::call):
1268         (JSC::JSFunction::getOwnPropertySlot):
1269         (JSC::JSFunction::getConstructData):
1270         (JSC::JSFunction::construct):
1271         * runtime/JSFunction.h:
1272         (JSC::JSFunction::scope):
1273         * runtime/JSGlobalData.h:
1274         (JSC::JSGlobalData::getThunk):
1275         * runtime/Lookup.cpp:
1276         (JSC::setUpStaticFunctionSlot):
1277         * runtime/StringConstructor.cpp:
1278         (JSC::StringConstructor::StringConstructor):
1279
1280 2010-05-17  Patrick Gansterer  <paroga@paroga.com>
1281
1282         Reviewed by Laszlo Gombos.
1283
1284         [Qt] Remove WinCE endian dedection.
1285         https://bugs.webkit.org/show_bug.cgi?id=38511
1286
1287         Windows CE supports little-endian format only.
1288         Correct dedection was added in r57804.
1289
1290         * wtf/Platform.h:
1291
1292 2010-05-16  Simon Fraser  <simon.fraser@apple.com>
1293
1294         Reviewed by Darin Adler.
1295
1296         Reduce the size of FunctionExecutable
1297         https://bugs.webkit.org/show_bug.cgi?id=39180
1298         
1299         Change m_numVariables from a size_t to 31 bits in a bitfield,
1300         packed with another bit for m_forceUsesArguments (which in turn
1301         get packed with the base class).
1302         
1303         Reduces the size of FunctionExecutable from 160 to 152 bytes.
1304
1305         * runtime/Executable.h:
1306         (JSC::FunctionExecutable::variableCount):
1307         (JSC::FunctionExecutable::FunctionExecutable):
1308
1309 2010-05-15  Oliver Hunt  <oliver@apple.com>
1310
1311         Reviewed by Maciej Stachowiak.
1312
1313         Incorrect codegen for slowcase of < in 64-bit
1314         https://bugs.webkit.org/show_bug.cgi?id=39151
1315
1316         Call the correct stud for the slowcases of the < operator.
1317
1318         * jit/JITArithmetic.cpp:
1319         (JSC::JIT::emitSlow_op_jnless):
1320         (JSC::JIT::emitSlow_op_jless):
1321
1322 2010-05-15  Leo Yang  <leo.yang@torchmobile.com.cn>
1323
1324         Reviewed by Darin Adler.
1325
1326         Fix bug https://bugs.webkit.org/show_bug.cgi?id=38890
1327
1328         * runtime/DatePrototype.cpp:
1329         (JSC::formatLocaleDate):
1330
1331 2010-05-15  Leandro Pereira  <leandro@profusion.mobi>
1332
1333         Reviewed by Adam Treat.
1334
1335         [EFL] Add build system for the EFL port.
1336         http://webkit.org/b/37945
1337
1338         * CMakeLists.txt: Added.
1339         * CMakeListsEfl.txt: Added.
1340         * config.h: Add conditional to look for cmakeconfig.h.
1341         * jsc/CMakeLists.txt: Added.
1342         * jsc/CMakeListsEfl.txt: Added.
1343         * wtf/CMakeLists.txt: Added.
1344         * wtf/CMakeListsEfl.txt: Added.
1345
1346 2010-05-15  Chao-ying Fu  <fu@mips.com>
1347
1348         Reviewed by Oliver Hunt.
1349
1350         Update MIPS JIT for unsigned right shift, Math.sqrt, load16
1351         https://bugs.webkit.org/show_bug.cgi?id=38412
1352
1353         Fixed MIPS build failure.
1354
1355         * assembler/MIPSAssembler.h:
1356         (JSC::MIPSAssembler::srl):
1357         (JSC::MIPSAssembler::srlv):
1358         (JSC::MIPSAssembler::sqrtd):
1359         * assembler/MacroAssemblerMIPS.h:
1360         (JSC::MacroAssemblerMIPS::urshift32):
1361         (JSC::MacroAssemblerMIPS::sqrtDouble):
1362         (JSC::MacroAssemblerMIPS::load16):
1363         (JSC::MacroAssemblerMIPS::supportsFloatingPointSqrt):
1364         * jit/JSInterfaceJIT.h:
1365
1366 2010-05-15  Ilya Tikhonovsky  <loislo@chromium.org>
1367
1368         Reviewed by Geoffrey Garen.
1369
1370         WebInspector: JSC Should provide heap size info for Timeline panel.
1371         https://bugs.webkit.org/show_bug.cgi?id=38420
1372
1373         * JavaScriptCore.exp:
1374         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1375         * runtime/Collector.cpp:
1376         (JSC::Heap::size):
1377         * runtime/Collector.h:
1378
1379 2010-05-15  Dave Tapuska  <dtapuska@rim.com>
1380
1381         Reviewed by Darin Adler.
1382
1383         Add a new define for we need strict arena alignment. ARMv5 with
1384         double word instructions set this value.
1385
1386         * wtf/Platform.h:
1387
1388 2010-05-14  Stephanie Lewis  <slewis@apple.com>
1389
1390         Rubber-stamped by Mark Rowe.
1391
1392         Update order files.
1393
1394         * JavaScriptCore.order:
1395
1396 2010-05-14  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
1397
1398         Reviewed by Kenneth Rohde Christiansen.
1399
1400         Implementation of QtScript API that provide method to convert a value to an object.
1401
1402         [Qt] QtScript is missing toObject API
1403         https://bugs.webkit.org/show_bug.cgi?id=36594
1404
1405         * qt/api/qscriptengine.cpp:
1406         (QScriptEngine::toObject):
1407         * qt/api/qscriptengine.h:
1408         * qt/api/qscriptvalue.cpp:
1409         (QScriptValue::toObject):
1410         * qt/api/qscriptvalue.h:
1411         * qt/api/qscriptvalue_p.h:
1412         (QScriptValuePrivate::toObject):
1413         * qt/tests/qscriptengine/tst_qscriptengine.cpp:
1414         (tst_QScriptEngine::toObject):
1415         (tst_QScriptEngine::toObjectTwoEngines):
1416         * qt/tests/qscriptvalue/tst_qscriptvalue.cpp:
1417         (tst_QScriptValue::toObjectSimple):
1418         * qt/tests/qscriptvalue/tst_qscriptvalue.h:
1419
1420 2010-05-14  Chao-ying Fu  <fu@mips.com>
1421
1422         Reviewed by Oliver Hunt.
1423
1424         String Indexing Failure on JSVALUE32 targets
1425         https://bugs.webkit.org/show_bug.cgi?id=39034
1426
1427         Remove zero-extend/shift-right code on regT1, because we already have
1428         it in emit_op_get_by_val().
1429
1430         * jit/JITPropertyAccess.cpp:
1431         (JSC::JIT::stringGetByValStubGenerator):
1432
1433 2010-05-10  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
1434
1435         Reviewed by Alexey Proskuryakov.
1436
1437         Fix a VS2010 assert in std::copy
1438         https://bugs.webkit.org/show_bug.cgi?id=38630
1439
1440         The assert complains that the output iterator is null.
1441
1442         * wtf/Vector.h:
1443         (WTF::::operator):
1444
1445 2010-05-13  Maciej Stachowiak  <mjs@apple.com>
1446
1447         No review, attempted build fix.
1448
1449         Try to fix Tiger build with some gratuitous initialization of
1450         seemingly uninitialized variables.
1451
1452         * wtf/text/StringImpl.h:
1453         (WebCore::StringImpl::tryCreateUninitialized):
1454
1455 2010-05-13  Maciej Stachowiak  <mjs@apple.com>
1456
1457         Reviewed by Mark Rowe.
1458
1459         Various JavaScript string optimizations
1460         https://bugs.webkit.org/show_bug.cgi?id=39051
1461
1462         Approximately 1% SunSpider speedup.
1463         
1464         * runtime/ArrayPrototype.cpp:
1465         (JSC::arrayProtoFuncJoin): Remove branches from the hot code path
1466         by moving the first pass outside the loop, and duplicating the hot loop
1467         to extract the loop-invariant branch.
1468         * runtime/RegExp.cpp:
1469         (JSC::RegExp::match): resize ovector to 0 instead of clearing to avoid
1470         thrash in case of large matches.
1471         * runtime/RegExpConstructor.h:
1472         (JSC::RegExpConstructor::performMatch): Mark ALWAYS_INLINE to make the
1473         compiler respect our authority.
1474         * runtime/StringPrototype.cpp:
1475         (JSC::jsSpliceSubstringsWithSeparators): Inline.
1476         (JSC::stringProtoFuncSubstring): Rewrite boundary condition checks to
1477         reduce the number of floating point comparisons and branches.
1478
1479 2010-05-12  Gavin Barraclough  <barraclough@apple.com>
1480
1481         Reviewed by Oliver Hunt.
1482
1483         https://bugs.webkit.org/show_bug.cgi?id=39039
1484         Provide support for separate bytecode/JIT code translations for call/construct usage
1485         This will allow us to produce code generated specifically for use as a constructor, not for general function use.
1486
1487         * bytecode/CodeBlock.cpp:
1488         (JSC::CodeBlock::CodeBlock):
1489         (JSC::CodeBlock::unlinkCallers):
1490         * bytecode/CodeBlock.h:
1491         (JSC::CodeBlock::getBytecodeIndex):
1492         (JSC::CodeBlock::getJITCode):
1493         (JSC::CodeBlock::executablePool):
1494         (JSC::GlobalCodeBlock::GlobalCodeBlock):
1495         (JSC::FunctionCodeBlock::FunctionCodeBlock):
1496         * interpreter/Interpreter.cpp:
1497         (JSC::Interpreter::executeCall):
1498         (JSC::Interpreter::executeConstruct):
1499         (JSC::Interpreter::prepareForRepeatCall):
1500         (JSC::Interpreter::execute):
1501         (JSC::Interpreter::privateExecute):
1502         * interpreter/Interpreter.h:
1503         * jit/JIT.cpp:
1504         (JSC::JIT::unlinkCallOrConstruct):
1505         (JSC::JIT::linkConstruct):
1506         * jit/JIT.h:
1507         * jit/JITCall.cpp:
1508         (JSC::JIT::compileOpCall):
1509         (JSC::JIT::compileOpCallSlowCase):
1510         * jit/JITOpcodes.cpp:
1511         (JSC::JIT::privateCompileCTIMachineTrampolines):
1512         * jit/JITOpcodes32_64.cpp:
1513         (JSC::JIT::privateCompileCTIMachineTrampolines):
1514         * jit/JITPropertyAccess.cpp:
1515         (JSC::JIT::emitSlow_op_get_by_val):
1516         * jit/JITPropertyAccess32_64.cpp:
1517         (JSC::JIT::emitSlow_op_get_by_val):
1518         * jit/JITStubs.cpp:
1519         (JSC::DEFINE_STUB_FUNCTION):
1520         * jit/JITStubs.h:
1521         (JSC::JITThunks::ctiVirtualConstructLink):
1522         (JSC::JITThunks::ctiVirtualConstruct):
1523         (JSC::):
1524         * jit/SpecializedThunkJIT.h:
1525         (JSC::SpecializedThunkJIT::finalize):
1526         * runtime/Arguments.h:
1527         (JSC::JSActivation::copyRegisters):
1528         * runtime/ArrayPrototype.cpp:
1529         (JSC::isNumericCompareFunction):
1530         * runtime/Executable.cpp:
1531         (JSC::FunctionExecutable::~FunctionExecutable):
1532         (JSC::FunctionExecutable::compileForCall):
1533         (JSC::FunctionExecutable::compileForConstruct):
1534         (JSC::EvalExecutable::generateJITCode):
1535         (JSC::ProgramExecutable::generateJITCode):
1536         (JSC::FunctionExecutable::generateJITCodeForCall):
1537         (JSC::FunctionExecutable::generateJITCodeForConstruct):
1538         (JSC::FunctionExecutable::markAggregate):
1539         (JSC::FunctionExecutable::reparseExceptionInfo):
1540         (JSC::EvalExecutable::reparseExceptionInfo):
1541         (JSC::FunctionExecutable::recompile):
1542         * runtime/Executable.h:
1543         (JSC::ExecutableBase::ExecutableBase):
1544         (JSC::ExecutableBase::isHostFunction):
1545         (JSC::ExecutableBase::generatedJITCodeForCall):
1546         (JSC::ExecutableBase::generatedJITCodeForConstruct):
1547         (JSC::NativeExecutable::NativeExecutable):
1548         (JSC::EvalExecutable::jitCode):
1549         (JSC::ProgramExecutable::jitCode):
1550         (JSC::FunctionExecutable::bytecodeForCall):
1551         (JSC::FunctionExecutable::isGeneratedForCall):
1552         (JSC::FunctionExecutable::generatedBytecodeForCall):
1553         (JSC::FunctionExecutable::bytecodeForConstruct):
1554         (JSC::FunctionExecutable::isGeneratedForConstruct):
1555         (JSC::FunctionExecutable::generatedBytecodeForConstruct):
1556         (JSC::FunctionExecutable::symbolTable):
1557         (JSC::FunctionExecutable::FunctionExecutable):
1558         (JSC::FunctionExecutable::jitCodeForCall):
1559         (JSC::FunctionExecutable::jitCodeForConstruct):
1560         * runtime/JSActivation.h:
1561         (JSC::JSActivation::JSActivationData::JSActivationData):
1562         * runtime/JSFunction.cpp:
1563         (JSC::JSFunction::~JSFunction):
1564         (JSC::JSFunction::call):
1565         (JSC::JSFunction::construct):
1566         * runtime/JSGlobalData.cpp:
1567         (JSC::JSGlobalData::numericCompareFunction):
1568
1569 2010-05-12  Oliver Hunt  <oliver@apple.com>
1570
1571         build fix
1572
1573         <rdar://problem/7977960> REGRESSION (r59282): Tiger PPC build broken
1574
1575         * runtime/UString.h:
1576         (JSC::tryMakeString):
1577
1578 2010-05-12  Oliver Hunt  <oliver@apple.com>
1579
1580         Reviewed by Gavin Barraclough.
1581
1582         <rdar://7969718> Incorrect 32-bit codegen for op_jnlesseq
1583         https://bugs.webkit.org/show_bug.cgi?id=39038
1584
1585         Correct the use of incorrect comparison operators.
1586
1587         * jit/JITArithmetic32_64.cpp:
1588         (JSC::JIT::emit_op_jlesseq):
1589         (JSC::JIT::emitBinaryDoubleOp):
1590
1591 2010-05-12  Caio Marcelo de Oliveira Filho  <caio.oliveira@openbossa.org>
1592
1593         Reviewed by Eric Seidel.
1594
1595         JavaScriptCore: fix build when some optimizations are disabled
1596         https://bugs.webkit.org/show_bug.cgi?id=38800
1597
1598         Remove outdated UNUSED_PARAMs when using JIT but with
1599         ENABLE_JIT_OPTIMIZE_CALL and ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS
1600         disabled.
1601
1602         * jit/JITOpcodes.cpp:
1603         * jit/JITOpcodes32_64.cpp:
1604
1605 2010-05-12  Oliver Hunt  <oliver@apple.com>
1606
1607         Reviewed by Gavin Barraclough.
1608
1609         Work around GCC stupidity by either explicitly inlining or by
1610         using ALWAYS_INLINE
1611
1612         * runtime/StringPrototype.cpp:
1613         (JSC::stringProtoFuncReplace):
1614         * runtime/UString.h:
1615         (JSC::UString::~UString):
1616         * wtf/RefPtr.h:
1617         (WTF::RefPtr::RefPtr):
1618         (WTF::RefPtr::~RefPtr):
1619         * wtf/text/StringImpl.h:
1620         (WebCore::StringImpl::create):
1621         (WebCore::StringImpl::tryCreateUninitialized):
1622
1623 2010-05-12  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
1624
1625         Reviewed by Kenneth Rohde Christiansen.
1626
1627         [Qt] Detect debug mode consistently
1628         https://bugs.webkit.org/show_bug.cgi?id=38863
1629
1630         * JavaScriptCore.pri:
1631         * JavaScriptCore.pro:
1632         * jsc.pro:
1633         * qt/api/QtScript.pro:
1634
1635 2010-05-12  Peter Varga  <pvarga@inf.u-szeged.hu>
1636
1637         Reviewed by Gavin Barraclough.
1638
1639         Remove a direct jump in generatePatternCharacterGreedy() and
1640         generatePatternCharacterClassGreedy() functions if quantityCount of the term
1641         is unlimited.
1642         https://bugs.webkit.org/show_bug.cgi?id=38898
1643
1644         * yarr/RegexJIT.cpp:
1645         (JSC::Yarr::RegexGenerator::generatePatternCharacterGreedy):
1646         (JSC::Yarr::RegexGenerator::generateCharacterClassGreedy):
1647
1648 2010-05-11  Geoffrey Garen  <ggaren@apple.com>
1649
1650         Reviewed by Gavin Barraclough.
1651
1652         Slight simplification to the calling convention: read RegisterFile::end()
1653         from an absolute address, instead of from a pointer to the RegisterFile
1654         on the stack.
1655         
1656         SunSpider reports no change.
1657         
1658         This should free us to remove the RegisterFile argument from the stack.
1659
1660         * jit/JIT.cpp:
1661         (JSC::JIT::privateCompile):
1662
1663 2010-05-11  Brian Weinstein  <bweinstein@apple.com>
1664
1665         Possible Gtk build fix - use ALWAYS_INLINE on functions that were inlined.
1666
1667         * wtf/text/AtomicString.h:
1668         (WebCore::AtomicString::add): Use ALWAYS_INLINE.
1669         * wtf/text/WTFString.h:
1670         (WebCore::String::length): Ditto.
1671         (WebCore::String::isEmpty): Ditto.
1672
1673 2010-05-11  Anders Carlsson  <andersca@apple.com>
1674
1675         Reviewed by Sam Weinig.
1676
1677         Add a compile time assert that sizeof(String) == sizeof(AtomicString).
1678
1679         * wtf/text/AtomicString.cpp:
1680
1681 2010-05-11  Anders Carlsson  <andersca@apple.com>
1682
1683         Reviewed by Mark Rowe.
1684
1685         https://bugs.webkit.org/show_bug.cgi?id=38961
1686         Move some member variables around to reduce class sizes.
1687         
1688         Make AtomicString no longer inherit from FastAllocBase.
1689
1690         Since AtomicString's first (and only) member variable, a RefPtr, also inherits from FastAllocBase this
1691         was causing the size of AtomicString to contain sizeof(void*) bytes of padding.
1692
1693         * wtf/text/AtomicString.h:
1694
1695 2010-05-11  Brian Weinstein  <bweinstein@apple.com>
1696
1697         Reviewed by Maciej Stachowiak.
1698         Patch by Gavin Barraclough.
1699         
1700         Rest of REGRESSION (r57900-57919): 3% PLT Regression from moving strings into WTF.
1701         https://bugs.webkit.org/show_bug.cgi?id=38930
1702         <rdar://problem/7937188>
1703         
1704         Inline string functions that are commonly used in WTFString, CString, and AtomicString.
1705
1706         * JavaScriptCore.exp: Remove exports of inline functions.
1707         * wtf/text/AtomicString.cpp:
1708         (WebCore::AtomicString::addSlowCase): Rename add to addSlowCase, and inline the fast path
1709             of add.
1710         * wtf/text/AtomicString.h:
1711         (WebCore::AtomicString::add): Inline the fast path of add.
1712         * wtf/text/CString.cpp: Inline implementation of data and length in the header.
1713         * wtf/text/CString.h:
1714         (WTF::CString::data): Inline implementation of data.
1715         (WTF::CString::length): Inline implementation of length.
1716         * wtf/text/WTFString.cpp: Remove implementations of functions to be inlined.
1717         * wtf/text/WTFString.h:
1718         (WebCore::String::String): Inline implementation.
1719         (WebCore::String::length): Ditto.
1720         (WebCore::String::characters): Ditto.
1721         (WebCore::String::operator[]): Ditto.
1722         (WebCore::String::isEmpty): Ditto.
1723
1724 2010-05-11  Brian Weinstein  <bweinstein@apple.com>
1725
1726         Reviewed by Steve Falkenburg and Jon Honeycutt.
1727         Patch by Gavin Barraclough.
1728         
1729         REGRESSION (r57900-57919): 3% PLT Regression from moving strings into WTF.
1730         https://bugs.webkit.org/show_bug.cgi?id=38930
1731         <rdar://problem/7937188>
1732         
1733         When the String classes were moved from WebCore to WTF, it meant that on Windows, all operations
1734         on Strings in WebCore had to cross a DLL boundary (from WebKit.dll to JavaScript.dll).
1735         
1736         We fix this by refactoring some of the WTF string code, so the code in AtomicString, StringImpl, and
1737         WTFString can be built by both WebCore and WTF, and we don't need to talk across a DLL to do operations
1738         on Strings.
1739
1740         * GNUmakefile.am: Add new file to build system.
1741         * JavaScriptCore.gypi: Ditto.
1742         * JavaScriptCore.pro: Ditto.
1743         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Remove string exports, because these are now
1744             handled in WebCore.
1745         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Remove the post-build step that was added
1746             here (the post build step is in JavaScriptCoreCommon.vsprops).
1747         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: Copy the three cpp files that need to be compiled
1748             by WebCore into the WebKitOutputDir directory.
1749         * JavaScriptCore.vcproj/WTF/WTF.vcproj: Add the StringStatics file.
1750         * JavaScriptCore.vcproj/jsc/jsc.vcproj: Add the three WTF string cpp files to this project.
1751         * JavaScriptCore.vcproj/jsc/jscCommon.vsprops: Remove the need to link against WTF.lib (since jsc links against JavaScriptCore).
1752         * JavaScriptCore.xcodeproj/project.pbxproj: Add the StringStatics file.
1753         * wtf/text/AtomicString.cpp: Moved code to StringStatics.
1754         * wtf/text/StringImpl.cpp: Ditto.
1755         * wtf/text/StringStatics.cpp: Added. Move functions in WTF Strings that define static variables to here, so 
1756             the rest of the files can be compiled in WebCore.
1757         (WebCore::StringImpl::empty): Moved from StringImpl.cpp to here.
1758         (WebCore::AtomicString::init): Moved from AtomicString.cpp to here.
1759
1760 2010-05-11  Alice Liu  <alice.liu@apple.com>
1761
1762         Rubber-stamped by Gavin Barraclough.
1763
1764         Fix build error when enabling debugging block in WebKit win painting code
1765
1766         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1767
1768 2010-05-11  Mark Rowe  <mrowe@apple.com>
1769
1770         Fix the world.
1771
1772         In r59162 a change was made to WebCore's FeatureDefines.xcconfig that enabled FILE_READER and FILE_WRITER.
1773         The author and reviewer of that patch ignored the carefully-worded warning at the top of that file asking
1774         that changes to the file be kept in sync across JavaScriptCore, WebCore and WebKit, as well as being kept
1775         in sync with build-webkit.  This led to WebCore and WebKit having different views of Document's vtable
1776         and results in crashes in Safari shortly after launch when virtual function calls resulted in the wrong
1777         function in WebCore being called.
1778
1779         We fix this by bringing the FeatureDefines.xcconfig files in to sync.  Based on the ChangeLog message and
1780         other changes in r59162 it appears that enabling FILE_WRITER was unintentional so that particular change
1781         has been reverted.
1782
1783         * Configurations/FeatureDefines.xcconfig:
1784
1785 2010-05-11  Sheriff Bot  <webkit.review.bot@gmail.com>
1786
1787         Unreviewed, rolling out r59171.
1788         http://trac.webkit.org/changeset/59171
1789         https://bugs.webkit.org/show_bug.cgi?id=38933
1790
1791         "Broke the world" (Requested by bweinstein on #webkit).
1792
1793         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1794         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1795         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
1796         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
1797         * JavaScriptCore.vcproj/jsc/jsc.vcproj:
1798         * JavaScriptCore.vcproj/jsc/jscCommon.vsprops:
1799         * JavaScriptCore.xcodeproj/project.pbxproj:
1800         * wtf/text/AtomicString.cpp:
1801         (WebCore::AtomicString::init):
1802         * wtf/text/StringImpl.cpp:
1803         (WebCore::StringImpl::empty):
1804         * wtf/text/StringStatics.cpp: Removed.
1805
1806 2010-05-11  Brian Weinstein  <bweinstein@apple.com>
1807
1808         Reviewed by Steve Falkenburg.
1809         Patch by Gavin Barraclough.
1810         
1811         REGRESSION (r57900-57919): 3% PLT Regression from moving strings into WTF.
1812         https://bugs.webkit.org/show_bug.cgi?id=38930
1813         <rdar://problem/7937188>
1814         
1815         When the String classes were moved from WebCore to WTF, it meant that on Windows, all operations
1816         on Strings in WebCore had to cross a DLL boundary (from WebKit.dll to JavaScript.dll).
1817         
1818         We fix this by refactoring some of the WTF string code, so the code in AtomicString, StringImpl, and
1819         WTFString can be built by both WebCore and WTF, and we don't need to talk across a DLL to do operations
1820         on Strings.
1821
1822         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Remove string exports, because these are now
1823             handled in WebCore.
1824         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Remove the post-build step that was added
1825             here (the post build step is in JavaScriptCoreCommon.vsprops).
1826         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: Copy the three cpp files that need to be compiled
1827             by WebCore into the WebKitOutputDir directory.
1828         * JavaScriptCore.vcproj/WTF/WTF.vcproj: Add the StringStatics file.
1829         * JavaScriptCore.vcproj/jsc/jsc.vcproj: Add the three WTF string cpp files to this project.
1830         * JavaScriptCore.vcproj/jsc/jscCommon.vsprops: Remove the need to link against WTF.lib (since jsc links against JavaScriptCore).
1831         * JavaScriptCore.xcodeproj/project.pbxproj: Add the StringStatics file.
1832         * wtf/text/AtomicString.cpp: Moved code to StringStatics.
1833         * wtf/text/StringImpl.cpp: Ditto.
1834         * wtf/text/StringStatics.cpp: Added. Move functions in WTF Strings that define static variables to here, so 
1835             the rest of the files can be compiled in WebCore.
1836         (WebCore::StringImpl::empty): Moved from StringImpl.cpp to here.
1837         (WebCore::AtomicString::init): Moved from AtomicString.cpp to here.
1838
1839 2010-05-11  Geoffrey Garen  <ggaren@apple.com>
1840
1841         Fixed test failures seen on SnowLeopard buildbot.
1842
1843         * runtime/JSString.cpp:
1844         (JSC::JSString::replaceCharacter): Don't use size_t and wtf::notFound.
1845         Instead, use the individual types and notFound values of the string APIs
1846         we're using, since they're not necessarily the same in 64bit.
1847
1848 2010-05-11  Geoffrey Garen  <ggaren@apple.com>
1849
1850         Reviewed by Oliver Hunt and Darin Adler.
1851
1852         Start using ropes in String.prototype.replace.
1853         
1854         1%-1.5% speedup on SunSpider.
1855
1856         * runtime/JSString.cpp:
1857         (JSC::JSString::resolveRope): Updated for RopeImpl refactoring.
1858
1859         (JSC::JSString::replaceCharacter): Added a replaceCharacter function, which creates
1860         a rope for the resulting replacement.
1861
1862         * runtime/JSString.h: A few changes here:
1863         (JSC::):
1864         (JSC::RopeBuilder::RopeIterator::RopeIterator):
1865         (JSC::RopeBuilder::RopeIterator::operator++):
1866         (JSC::RopeBuilder::RopeIterator::operator*):
1867         (JSC::RopeBuilder::RopeIterator::operator!=):
1868         (JSC::RopeBuilder::RopeIterator::WorkItem::WorkItem):
1869         (JSC::RopeBuilder::RopeIterator::WorkItem::operator!=):
1870         (JSC::RopeBuilder::RopeIterator::skipRopes): Created a RopeIterator abstraction.
1871         We use this to do a substring find without having to resolve the rope.
1872         (We could use this iterator when resolving ropes, too, but resolving
1873         ropes backwards is usually more efficient.)
1874
1875         (JSC::RopeBuilder::JSString): Added constructors for 2 & 3 UStrings.
1876
1877         (JSC::RopeBuilder::appendValueInConstructAndIncrementLength):
1878         (JSC::RopeBuilder::size): Updated for RopeImpl refactoring.
1879
1880         * runtime/Operations.h: Updated for RopeImpl refactoring.
1881         (JSC::jsString): Added jsString functions for 2 & 3 UStrings.
1882
1883         * runtime/RopeImpl.cpp:
1884         (JSC::RopeImpl::derefFibersNonRecursive):
1885         * runtime/RopeImpl.h:
1886         (JSC::RopeImpl::initializeFiber):
1887         (JSC::RopeImpl::size):
1888         (JSC::RopeImpl::fibers):
1889         (JSC::RopeImpl::deref):
1890         (JSC::RopeImpl::RopeImpl): A little refactoring to make this patch easier:
1891         Moved statics to the top of the class; put multi-statement functions on
1892         multiple lines; renamed "fiberCount" to "size" to match other collections;
1893         changed the "fibers" accessor to return the fibers buffer, instead of an
1894         item in the buffer, to make iteration easier.
1895
1896         * runtime/StringPrototype.cpp:
1897         (JSC::stringProtoFuncReplace): Don't resolve a rope unless we need to. Do
1898         use our new replaceCharacter function if possible. Do use a rope to
1899         represent splicing three strings together.
1900
1901 2010-05-10  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
1902
1903         Reviewed by Darin Adler.
1904
1905         [Qt] Disable JIT support for mingw-w64
1906         https://bugs.webkit.org/show_bug.cgi?id=38747
1907
1908         Disale JIT for mingw-w64 as it is reportedly
1909         unstable.
1910
1911         Thanks for Vanboxem Rruben for the investigation.
1912
1913         * wtf/Platform.h:
1914
1915 2010-05-09  Fumitoshi Ukai  <ukai@chromium.org>
1916
1917         Reviewed by Eric Seidel.
1918
1919         JavaScriptCore/wtf/MD5.h: checksum should take a reference to output.
1920         https://bugs.webkit.org/show_bug.cgi?id=38723
1921
1922         * JavaScriptCore.exp:
1923         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1924         * wtf/MD5.cpp:
1925         (WTF::expectMD5):
1926           Fix for checksum change.
1927         (WTF::MD5::checksum):
1928           Take a reference to output, instead of returning the result by value, to reduce coping for performance.
1929         * wtf/MD5.h:
1930
1931 2010-05-09  Oliver Hunt  <oliver@apple.com>
1932
1933         Build fix.
1934
1935         Fix accidental repeat addition of emit_op_new_regexp
1936
1937         * jit/JITOpcodes.cpp:
1938
1939 2010-05-09  Oliver Hunt  <oliver@apple.com>
1940
1941         Reviewed by Gavin Barraclough.
1942
1943         REGRESSION(r57955): RegExp literals should not actually be cached, so r57955 should be rolled out.
1944         https://bugs.webkit.org/show_bug.cgi?id=38828
1945         <rdar://problem/7961634>
1946
1947         Rollout r57955
1948
1949         * bytecode/CodeBlock.cpp:
1950         (JSC::regexpToSourceString):
1951         (JSC::regexpName):
1952         (JSC::CodeBlock::dump):
1953         (JSC::CodeBlock::shrinkToFit):
1954         * bytecode/CodeBlock.h:
1955         (JSC::CodeBlock::addRegExp):
1956         (JSC::CodeBlock::regexp):
1957         * bytecode/Opcode.h:
1958         * bytecompiler/BytecodeGenerator.cpp:
1959         (JSC::BytecodeGenerator::addRegExp):
1960         (JSC::BytecodeGenerator::emitNewRegExp):
1961         * bytecompiler/BytecodeGenerator.h:
1962         * bytecompiler/NodesCodegen.cpp:
1963         (JSC::RegExpNode::emitBytecode):
1964         * interpreter/Interpreter.cpp:
1965         (JSC::Interpreter::privateExecute):
1966         * jit/JIT.cpp:
1967         (JSC::JIT::privateCompileMainPass):
1968         * jit/JIT.h:
1969         * jit/JITOpcodes.cpp:
1970         (JSC::JIT::emit_op_new_regexp):
1971         * jit/JITStubs.cpp:
1972         (JSC::DEFINE_STUB_FUNCTION):
1973         * jit/JITStubs.h:
1974         (JSC::):
1975
1976 2010-05-09  Geoffrey Garen  <ggaren@apple.com>
1977
1978         Reviewed by Oliver Hunt.
1979
1980         Reserve a large-ish initial capacity for Lexer::m_buffer16.
1981         
1982         SunSpider says 0.3% faster.
1983         
1984         m_buffer16 is used when parsing complex strings -- for example, strings
1985         with escape sequences in them. These kinds of strings can be really long,
1986         and we want to avoid repeatedly copying as we grow m_buffer16.
1987         
1988         The net memory cost is quite low, since it's proporitional to source
1989         code we already have in memory, and we throw away m_buffer16 right when
1990         we're done parsing.
1991
1992         * parser/Lexer.cpp:
1993         (JSC::Lexer::Lexer): No need to reserve initial capacity in our constructor,
1994         since setCode will be called before we're asked to lex anything.
1995         (JSC::Lexer::setCode): Reserve enough space to lex half the source code
1996         as a complex string without having to copy.
1997         (JSC::Lexer::clear): No need to reserve initial capacity here either,
1998         since setCode will be called before we're asked to lex anything.
1999
2000 2010-05-09  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
2001
2002         Reviewed by Eric Seidel.
2003
2004         [Qt] Remove YARR configuration rules from Qt make system
2005         https://bugs.webkit.org/show_bug.cgi?id=38819
2006
2007         Setting YARR based on JIT seeting is now in Platform.h 
2008         for all ports. This patch essentially reverses r49238.
2009
2010         * JavaScriptCore.pri:
2011
2012 2010-05-09  Oliver Hunt  <oliver@apple.com>
2013
2014         Reviewed by Maciej Stachowiak.
2015
2016         Improve string indexing performance
2017         https://bugs.webkit.org/show_bug.cgi?id=38814
2018
2019         Add an assembly stub to do indexed loads from strings much
2020         more cheaply than the current stub dispatch logic.  We can
2021         do this because we are able to make guarantees about the
2022         register contents when entering the stub so the call overhead
2023         is negligible.
2024
2025         * jit/JIT.h:
2026         * jit/JITInlineMethods.h:
2027         * jit/JITOpcodes.cpp:
2028         * jit/JITPropertyAccess.cpp:
2029         (JSC::JIT::stringGetByValStubGenerator):
2030         (JSC::JIT::emitSlow_op_get_by_val):
2031            Moved from JITOpcodes.cpp to keep the slowcase next to
2032            the normal case codegen as we do for everything else.
2033         * jit/JITPropertyAccess32_64.cpp:
2034         (JSC::JIT::stringGetByValStubGenerator):
2035         (JSC::JIT::emitSlow_op_get_by_val):
2036         * jit/JSInterfaceJIT.h:
2037         (JSC::JSInterfaceJIT::emitFastArithImmToInt):
2038
2039 2010-05-09  Maciej Stachowiak  <mjs@apple.com>
2040
2041         Fixed version of: "Optimized o[s] where o is a cell and s is a string"
2042         https://bugs.webkit.org/show_bug.cgi?id=38815
2043         
2044         Fixed the previous patch for this from Geoff Garen.
2045         
2046         The two problems were a missing exception check and a PropertySlot
2047         initialized improperly, leading to crashes and failures in the case
2048         of getters accessed with bracket syntax.
2049
2050     Previous patch:
2051
2052         Optimized o[s] where o is a cell and s is a string, removing some old
2053         code that wasn't really tuned for the JIT.
2054         
2055         SunSpider says 0.8% faster.
2056
2057         * jit/JITStubs.cpp:
2058         (JSC::DEFINE_STUB_FUNCTION):
2059         * runtime/JSCell.h:
2060
2061 2010-05-08  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
2062
2063         Unreviewed, build fix.
2064
2065         Fix missing terminating ' character warning
2066
2067         The warning has been only seen on the Gtk buildbots.
2068
2069         * wtf/Platform.h:
2070
2071 2010-05-08  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
2072
2073         Reviewed by Gavin Barraclough.
2074
2075         Refactor YARR and YARR_JIT default rules in Platform.h
2076         https://bugs.webkit.org/show_bug.cgi?id=38727
2077
2078         Turn on YARR and YARR JIT by default of JIT is enabled.
2079         Ports can overrule this default decisions as they wish.
2080
2081         * wtf/Platform.h:
2082
2083 2010-05-08  Oliver Hunt  <oliver@apple.com>
2084
2085         Reviewed by Gavin Barraclough.
2086
2087         Split JSVALUE32_64 code out of JITOpcodes.cpp and into JITOpcodes32_64.cpp
2088         https://bugs.webkit.org/show_bug.cgi?id=38808
2089
2090         * GNUmakefile.am:
2091         * JavaScriptCore.gypi:
2092         * JavaScriptCore.pro:
2093         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2094         * JavaScriptCore.xcodeproj/project.pbxproj:
2095         * jit/JITOpcodes.cpp:
2096         * jit/JITOpcodes32_64.cpp: Added.
2097         (JSC::JIT::privateCompileCTIMachineTrampolines):
2098         (JSC::JIT::emit_op_mov):
2099         (JSC::JIT::emit_op_end):
2100         (JSC::JIT::emit_op_jmp):
2101         (JSC::JIT::emit_op_loop_if_lesseq):
2102         (JSC::JIT::emitSlow_op_loop_if_lesseq):
2103         (JSC::JIT::emit_op_new_object):
2104         (JSC::JIT::emit_op_instanceof):
2105         (JSC::JIT::emitSlow_op_instanceof):
2106         (JSC::JIT::emit_op_new_func):
2107         (JSC::JIT::emit_op_get_global_var):
2108         (JSC::JIT::emit_op_put_global_var):
2109         (JSC::JIT::emit_op_get_scoped_var):
2110         (JSC::JIT::emit_op_put_scoped_var):
2111         (JSC::JIT::emit_op_tear_off_activation):
2112         (JSC::JIT::emit_op_tear_off_arguments):
2113         (JSC::JIT::emit_op_new_array):
2114         (JSC::JIT::emit_op_resolve):
2115         (JSC::JIT::emit_op_to_primitive):
2116         (JSC::JIT::emitSlow_op_to_primitive):
2117         (JSC::JIT::emit_op_strcat):
2118         (JSC::JIT::emit_op_resolve_base):
2119         (JSC::JIT::emit_op_resolve_skip):
2120         (JSC::JIT::emit_op_resolve_global):
2121         (JSC::JIT::emitSlow_op_resolve_global):
2122         (JSC::JIT::emit_op_not):
2123         (JSC::JIT::emitSlow_op_not):
2124         (JSC::JIT::emit_op_jfalse):
2125         (JSC::JIT::emitSlow_op_jfalse):
2126         (JSC::JIT::emit_op_jtrue):
2127         (JSC::JIT::emitSlow_op_jtrue):
2128         (JSC::JIT::emit_op_jeq_null):
2129         (JSC::JIT::emit_op_jneq_null):
2130         (JSC::JIT::emit_op_jneq_ptr):
2131         (JSC::JIT::emit_op_jsr):
2132         (JSC::JIT::emit_op_sret):
2133         (JSC::JIT::emit_op_eq):
2134         (JSC::JIT::emitSlow_op_eq):
2135         (JSC::JIT::emit_op_neq):
2136         (JSC::JIT::emitSlow_op_neq):
2137         (JSC::JIT::compileOpStrictEq):
2138         (JSC::JIT::emit_op_stricteq):
2139         (JSC::JIT::emitSlow_op_stricteq):
2140         (JSC::JIT::emit_op_nstricteq):
2141         (JSC::JIT::emitSlow_op_nstricteq):
2142         (JSC::JIT::emit_op_eq_null):
2143         (JSC::JIT::emit_op_neq_null):
2144         (JSC::JIT::emit_op_resolve_with_base):
2145         (JSC::JIT::emit_op_new_func_exp):
2146         (JSC::JIT::emit_op_throw):
2147         (JSC::JIT::emit_op_get_pnames):
2148         (JSC::JIT::emit_op_next_pname):
2149         (JSC::JIT::emit_op_push_scope):
2150         (JSC::JIT::emit_op_pop_scope):
2151         (JSC::JIT::emit_op_to_jsnumber):
2152         (JSC::JIT::emitSlow_op_to_jsnumber):
2153         (JSC::JIT::emit_op_push_new_scope):
2154         (JSC::JIT::emit_op_catch):
2155         (JSC::JIT::emit_op_jmp_scopes):
2156         (JSC::JIT::emit_op_switch_imm):
2157         (JSC::JIT::emit_op_switch_char):
2158         (JSC::JIT::emit_op_switch_string):
2159         (JSC::JIT::emit_op_new_error):
2160         (JSC::JIT::emit_op_debug):
2161         (JSC::JIT::emit_op_enter):
2162         (JSC::JIT::emit_op_enter_with_activation):
2163         (JSC::JIT::emit_op_create_arguments):
2164         (JSC::JIT::emit_op_init_arguments):
2165         (JSC::JIT::emit_op_convert_this):
2166         (JSC::JIT::emitSlow_op_convert_this):
2167         (JSC::JIT::emit_op_profile_will_call):
2168         (JSC::JIT::emit_op_profile_did_call):
2169
2170 2010-05-08  Gabor Loki  <loki@webkit.org>
2171
2172         Reviewed by Gavin Barraclough.
2173
2174         Fix halfword loads on ARM
2175         https://bugs.webkit.org/show_bug.cgi?id=38741
2176
2177         The BaseIndex and ImplicitAddress are contain 32bit wide offset, but
2178         the load16 functions were working with 8 bit data (encoded in the
2179         instruction). If the offset cannot be encoded in an instruction, it
2180         should be stored in a temporary register.
2181
2182         * assembler/ARMAssembler.h:
2183         (JSC::ARMAssembler::getOffsetForHalfwordDataTransfer):
2184         * assembler/MacroAssemblerARM.h:
2185         (JSC::MacroAssemblerARM::load16):
2186
2187 2010-05-08  Gabor Loki  <loki@webkit.org>
2188
2189         Reviewed by Gavin Barraclough.
2190
2191         Fix spanning branch instruction on Cortex-A8 with Thumb-2 JIT
2192         https://bugs.webkit.org/show_bug.cgi?id=38280
2193
2194         If the 32-bit Thumb-2 branch instruction spans two 4KiB regions and
2195         the target of the branch falls within the first region it is
2196         possible for the processor to incorrectly determine the branch
2197         instruction, and it is also possible in some cases for the processor
2198         to enter a deadlock state.
2199
2200         * assembler/ARMv7Assembler.h:
2201         (JSC::ARMv7Assembler::linkJumpAbsolute):
2202
2203 2010-05-08  Adam Barth  <abarth@webkit.org>
2204
2205         Reviewed by Darin Fisher.
2206
2207         [WTFURL] Add a buffer for managing the output of the canonicalizer
2208         https://bugs.webkit.org/show_bug.cgi?id=38671
2209
2210         The canonicalizer produces a stream of canonicalized characters, which
2211         we will store in a URLBuffer.  URLBuffer is quite similar to Vector,
2212         but serves as an abstraction to isolate us from the underlying
2213         character storage.  In the case of WebKit, we'll probably implement a
2214         subclass of URLBuffer with Vector.  In Chromium, the backing store is a
2215         std::string, which avoids an unnecessary memcpy that would be caused by
2216         using Vector instead.
2217
2218         * wtf/url/src/URLBuffer.h: Added.
2219         (WTF::URLBuffer::URLBuffer):
2220         (WTF::URLBuffer::~URLBuffer):
2221         (WTF::URLBuffer::at):
2222         (WTF::URLBuffer::set):
2223         (WTF::URLBuffer::capacity):
2224         (WTF::URLBuffer::length):
2225         (WTF::URLBuffer::data):
2226         (WTF::URLBuffer::setLength):
2227         (WTF::URLBuffer::append):
2228         (WTF::URLBuffer::grow):
2229
2230 2010-05-08  Eric Seidel  <eric@webkit.org>
2231
2232         Unreviewed, just reverting commit.
2233
2234         REGRESSION(59000): r59000 contained all sorts of changes it should not have, needs revert.
2235         https://bugs.webkit.org/show_bug.cgi?id=38798
2236
2237         * bytecompiler/BytecodeGenerator.cpp:
2238         (JSC::BytecodeGenerator::emitResolve):
2239         * jit/JITOpcodes.cpp:
2240         (JSC::JIT::emit_op_resolve_global):
2241
2242 2010-05-04  Jer Noble  <jer.noble@apple.com>
2243
2244         Reviewed by Maciej Stachowiak
2245
2246         Safari pegs CPU and drops tons of frames using HTML5 Vimeo player
2247         <https://bugs.webkit.org/show_bug.cgi?id=34005>
2248         <rdar://problem/7569713>
2249         
2250         Added cancelCallOnMainThread.  callOnMainThread should always now be paired
2251         with cancelCallOnMainThread in situations where the refcon passed to callOnMainThread
2252         may be dealloced before the main thread function can be dispatched.  
2253         
2254         * wtf/MainThread.cpp:
2255         (WTF::FunctionWithContext::operator == ): Supports the FunctionWithContextFinder predicate functor.
2256         (WTF::FunctionWithContextFinder::FunctionWithContextFinder):  Predicate functor for use with Dequeue::findIf
2257         (WTF::FunctionWithContextFinder::operator()):
2258         (WTF::cancelCallOnMainThread):
2259         * wtf/MainThread.h:
2260
2261 2010-05-07  Oliver Hunt  <oliver@apple.com>
2262
2263         Windows build fix.
2264
2265         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2266
2267 2010-05-07  Eric Seidel  <eric@webkit.org>
2268
2269         Unreviewed, rolling out r58990.
2270         http://trac.webkit.org/changeset/58990
2271
2272         Broke 4 tests on Snow Leopard and Qt.
2273
2274         * jit/JITStubs.cpp:
2275         (JSC::DEFINE_STUB_FUNCTION):
2276         * runtime/JSCell.h:
2277
2278 2010-05-07  Oliver Hunt  <oliver@apple.com>
2279
2280         Reviewed by Gavin Barraclough.
2281
2282         Optimize access to the global object from a function that uses eval
2283         https://bugs.webkit.org/show_bug.cgi?id=38644
2284
2285         Fix bug where cross scope access to a global var (vs. property) would
2286         be allowed without checking for intervening dynamic scopes.
2287
2288         * bytecompiler/BytecodeGenerator.cpp:
2289         (JSC::BytecodeGenerator::emitResolve):
2290
2291 2010-05-07  Oliver Hunt  <oliver@apple.com>
2292
2293         32-bit buildfix.
2294
2295         Macro expansion I stab at thee!
2296
2297         * jit/JITOpcodes.cpp:
2298         (JSC::JIT::emit_op_resolve_global):
2299
2300 2010-05-07  Geoffrey Garen  <ggaren@apple.com>
2301
2302         Reviewed by Darin Adler.
2303
2304         Optimized o[s] where o is a cell and s is a string, removing some old
2305         code that wasn't really tuned for the JIT.
2306         
2307         SunSpider says 0.8% faster.
2308
2309         * jit/JITStubs.cpp:
2310         (JSC::DEFINE_STUB_FUNCTION):
2311         * runtime/JSCell.h:
2312
2313 2010-05-07  Oliver Hunt  <oliver@apple.com>
2314
2315         Windows build fix.
2316
2317         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2318
2319 2010-05-07  Oliver Hunt  <oliver@apple.com>
2320
2321         Reviewed by Geoffrey Garen.
2322
2323         Optimize access to the global object from a function that uses eval
2324         https://bugs.webkit.org/show_bug.cgi?id=38644
2325
2326         Add op_resolve_global_dynamic, a variant of op_resolve_global that
2327         checks each node in the scope chain for dynamically inserted properties
2328         and falls back to the normal resolve logic in that case.
2329
2330         * JavaScriptCore.exp:
2331         * bytecode/CodeBlock.cpp:
2332         (JSC::isGlobalResolve):
2333         (JSC::CodeBlock::printStructures):
2334         (JSC::CodeBlock::dump):
2335         (JSC::CodeBlock::derefStructures):
2336         * bytecode/Opcode.h:
2337         * bytecompiler/BytecodeGenerator.cpp:
2338         (JSC::BytecodeGenerator::findScopedProperty):
2339            Now take an additional reference parameter to used to indicate that
2340            there were nodes that may gain dynamic properties
2341         (JSC::BytecodeGenerator::emitResolve):
2342         (JSC::BytecodeGenerator::emitResolveBase):
2343         (JSC::BytecodeGenerator::emitResolveWithBase):
2344            deal with additional argument to findScopedProperty
2345         * bytecompiler/BytecodeGenerator.h:
2346         * bytecompiler/NodesCodegen.cpp:
2347         (JSC::FunctionCallResolveNode::emitBytecode):
2348         (JSC::PostfixResolveNode::emitBytecode):
2349         (JSC::PrefixResolveNode::emitBytecode):
2350         (JSC::ReadModifyResolveNode::emitBytecode):
2351         (JSC::AssignResolveNode::emitBytecode):
2352            These functions use findScopedProperty directly in order to
2353            optimise lookup.  They cannot trivially handle any degree of
2354            dynamism in the lookup so we just give up in such case.
2355         * interpreter/Interpreter.cpp:
2356         (JSC::Interpreter::resolveGlobalDynamic):
2357         (JSC::Interpreter::execute):
2358         (JSC::Interpreter::privateExecute):
2359         * interpreter/Interpreter.h:
2360         * jit/JIT.cpp:
2361         (JSC::JIT::privateCompileMainPass):
2362         (JSC::JIT::privateCompileSlowCases):
2363         * jit/JIT.h:
2364         * jit/JITOpcodes.cpp:
2365         (JSC::JIT::emit_op_resolve_global):
2366         (JSC::JIT::emit_op_resolve_global_dynamic):
2367         (JSC::JIT::emitSlow_op_resolve_global):
2368         (JSC::JIT::emitSlow_op_resolve_global_dynamic):
2369            Happily resolve_global_dynamic can share the slow case!
2370         * jit/JITStubs.h:
2371         (JSC::):
2372         * runtime/JSActivation.cpp:
2373         (JSC::JSActivation::isDynamicScope):
2374         * runtime/JSActivation.h:
2375         * runtime/JSGlobalObject.cpp:
2376         (JSC::JSGlobalObject::isDynamicScope):
2377         * runtime/JSGlobalObject.h:
2378         * runtime/JSStaticScopeObject.cpp:
2379         (JSC::JSStaticScopeObject::isDynamicScope):
2380         * runtime/JSStaticScopeObject.h:
2381         * runtime/JSVariableObject.h:
2382
2383 2010-05-07  Geoffrey Garen  <ggaren@apple.com>
2384
2385         Reviewed by Gavin Barraclough.
2386
2387         Fixed Sputnik failure seen on buildbot.
2388
2389         * runtime/NumberPrototype.cpp:
2390         (JSC::numberProtoFuncToString): Cast to unsigned before checking magnitude,
2391         to efficiently exclude negative numbers, which require two characters
2392         instead of one.
2393
2394 2010-05-07  Geoffrey Garen  <ggaren@apple.com>
2395
2396         Reviewed by Alexey Proskuryakov.
2397         
2398         Slightly more effective way to guarantee a compile-time constant, at
2399         least on gcc.
2400
2401         * runtime/NumberPrototype.cpp:
2402         (JSC::numberProtoFuncToString): Use pointer notation instead of array
2403         notation, so the compiler treats the string and its contents as constant.
2404
2405 2010-05-07  Adam Barth  <abarth@webkit.org>
2406
2407         Reviewed by Alexey Proskuryakov.
2408
2409         [WTFURL] Add core URL parser
2410         https://bugs.webkit.org/show_bug.cgi?id=38572
2411
2412         This patch adds the core of the URL parser.  The URL parser uses a
2413         templated notion of a code unit to support different string types.
2414         Later we'll add some non-templated APIs with concrete types that
2415         clients can use more conveniently.
2416
2417         The URLParser has a couple calls to ASSERT(), which I've commented out
2418         for now.  I'm not 100% sure how to handle the dependency issues there
2419         yet, so I've punted on the issue for now.
2420
2421         Also, there are a number of methods that are declared public in this
2422         patch that are only used by the canonicalizer.  My plan is to make
2423         those private or protected and make the canonicalizer a friend of the
2424         parser.  The details will be in a later patch.
2425
2426         * wtf/url/src/URLComponent.h:
2427         (WTF::URLComponent::fromRange):
2428         (WTF::URLComponent::isNonEmpty):
2429         (WTF::URLComponent::isEmptyOrInvalid):
2430         * wtf/url/src/URLParser.h: Added.
2431         (WTF::URLParser::):
2432         (WTF::URLParser::isPossibleAuthorityTerminator):
2433         (WTF::URLParser::parseAuthority):
2434         (WTF::URLParser::extractScheme):
2435         (WTF::URLParser::parseAfterScheme):
2436         (WTF::URLParser::parseStandardURL):
2437         (WTF::URLParser::parsePath):
2438         (WTF::URLParser::parsePathURL):
2439         (WTF::URLParser::parseMailtoURL):
2440         (WTF::URLParser::parsePort):
2441         (WTF::URLParser::extractFileName):
2442         (WTF::URLParser::extractQueryKeyValue):
2443         (WTF::URLParser::isURLSlash):
2444         (WTF::URLParser::shouldTrimFromURL):
2445         (WTF::URLParser::trimURL):
2446         (WTF::URLParser::consecutiveSlashes):
2447         (WTF::URLParser::isPortDigit):
2448         (WTF::URLParser::nextAuthorityTerminator):
2449         (WTF::URLParser::parseUserInfo):
2450         (WTF::URLParser::parseServerInfo):
2451
2452 2010-05-07  Geoffrey Garen  <ggaren@apple.com>
2453
2454         Reviewed by Oliver Hunt.
2455
2456         Added a fast path for number-to-character conversion via
2457         Number.prototype.toString base 36.
2458         
2459         0.7% speedup on SunSpider.
2460
2461         * runtime/NumberPrototype.cpp:
2462         (JSC::numberProtoFuncToString): Made radix interpretation a little more
2463         efficient by keeping it in int space. Turned "const char" into
2464         "static const char" just in case. Added a fast path for base 36
2465         conversion of something that will turn into a character.
2466
2467 2010-05-07  Adam Barth  <abarth@webkit.org>
2468
2469         Reviewed by Darin Fisher.
2470
2471         [WTFURL] Add a malloc-backed URLBuffer
2472         https://bugs.webkit.org/show_bug.cgi?id=38694
2473
2474         This patch adds a URLBuffer that uses new/delete to manage the backing
2475         store for the buffer.
2476
2477         * wtf/url/src/RawURLBuffer.h: Added.
2478         (WTF::RawURLBuffer::RawURLBuffer):
2479         (WTF::RawURLBuffer::~RawURLBuffer):
2480         (WTF::RawURLBuffer::resize):
2481
2482 2010-05-06  Fumitoshi Ukai  <ukai@chromium.org>
2483
2484         Reviewed by Alexey Proskuryakov.
2485
2486         JavaScriptCore/wtf/RandomNumber.h should provide using WTF::*
2487         https://bugs.webkit.org/show_bug.cgi?id=38719
2488
2489         * wtf/RandomNumber.h:
2490           Add using directives.
2491
2492 2010-05-06  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
2493
2494         Reviewed by Kenneth Rohde Christiansen.
2495
2496         [Qt] Enable YARR_JIT for X86 Mac for QtWebKit
2497         https://bugs.webkit.org/show_bug.cgi?id=38668
2498
2499         * wtf/Platform.h:
2500
2501 2010-05-06  Gavin Barraclough  <barraclough@apple.com>
2502
2503         Reviewed by Geoff Garen.
2504
2505         Bug 38714 - Add result caching for Math.sin
2506
2507         Math.sin is frequently called with the same operand, caching the result should
2508         improve performance.  CachedTranscendentalFunction adds a generic mechanism to
2509         cache results for pure functions with the signature "double func(double)", and
2510         where NaN maps to NaN.
2511
2512         CachedTranscendentalFunction uses a very simple hash function designed to be
2513         fast to execute since we cannot cache the result, and trivial to JIT generate,
2514         should we wish to do so.
2515
2516         * JavaScriptCore.xcodeproj/project.pbxproj:
2517         * runtime/CachedTranscendentalFunction.h: Added.
2518         (JSC::CachedTranscendentalFunction::CachedTranscendentalFunction):
2519         (JSC::CachedTranscendentalFunction::~CachedTranscendentalFunction):
2520         (JSC::CachedTranscendentalFunction::operator()):
2521         (JSC::CachedTranscendentalFunction::initialize):
2522         (JSC::CachedTranscendentalFunction::hash):
2523         * runtime/JSGlobalData.h:
2524         * runtime/MathObject.cpp:
2525         (JSC::mathProtoFuncSin):
2526         * wtf/Platform.h:
2527
2528 2010-05-06  Geoffrey Garen  <ggaren@apple.com>
2529
2530         Windows build fix.
2531
2532         * bytecode/SamplingTool.cpp:
2533         (JSC::SamplingFlags::sample): Use a cast, so Windows will be happy when
2534         this code is enabled.
2535         * wtf/Platform.h: Reverted last change to this file, which seems to have
2536         been accidental.
2537
2538 2010-05-06  Gavin Barraclough  <barraclough@apple.com>
2539
2540         Reviewed by Oliver Hunt.
2541
2542         Add compile switch to make debugger keyword plant breakpoint instructions.
2543
2544         * bytecompiler/BytecodeGenerator.cpp:
2545         (JSC::BytecodeGenerator::emitDebugHook):
2546         * jit/JITOpcodes.cpp:
2547         (JSC::JIT::emit_op_debug):
2548         * wtf/Platform.h:
2549
2550 2010-05-06  Oliver Hunt  <oliver@apple.com>
2551
2552         Build fix
2553
2554         Fix ARM builds
2555
2556         * assembler/MacroAssemblerARM.h:
2557         (JSC::MacroAssemblerARM::load16):
2558         * assembler/MacroAssemblerARMv7.h:
2559         (JSC::MacroAssemblerARMv7::load16):
2560
2561 2010-05-06  Oliver Hunt  <oliver@apple.com>
2562
2563         Reviewed by Geoffrey Garen.
2564
2565         Improve performance of single character string compares
2566         https://bugs.webkit.org/show_bug.cgi?id=38659
2567
2568         Add logic to the jit to identify comparisons to single character string literals
2569         and then just perform the comparison inline, rather than ignoring the evidence
2570         and attempting to perform an integer comparison.
2571
2572         Multiple changes required -- add jnlesseq opcode, add helper function to identify
2573         single character string constants, add a helper to load single character strings.
2574         Then add the 32_64 and normal codepaths to the JIT.
2575
2576         * assembler/MacroAssemblerX86Common.h:
2577         (JSC::MacroAssemblerX86Common::load16):
2578         * bytecode/CodeBlock.cpp:
2579         (JSC::CodeBlock::dump):
2580         * bytecode/Opcode.h:
2581         * bytecompiler/BytecodeGenerator.cpp:
2582         (JSC::BytecodeGenerator::emitJumpIfTrue):
2583         * interpreter/Interpreter.cpp:
2584         (JSC::Interpreter::privateExecute):
2585         * jit/JIT.cpp:
2586         (JSC::JIT::privateCompileMainPass):
2587         (JSC::JIT::privateCompileSlowCases):
2588         * jit/JIT.h:
2589         * jit/JITArithmetic.cpp:
2590         (JSC::JIT::emit_op_jnless):
2591         (JSC::JIT::emitSlow_op_jnless):
2592         (JSC::JIT::emit_op_jless):
2593         (JSC::JIT::emitSlow_op_jless):
2594         (JSC::JIT::emit_op_jlesseq):
2595         (JSC::JIT::emit_op_jnlesseq):
2596         (JSC::JIT::emitSlow_op_jlesseq):
2597         (JSC::JIT::emitSlow_op_jnlesseq):
2598         * jit/JITArithmetic32_64.cpp:
2599         (JSC::JIT::emit_op_jnless):
2600         (JSC::JIT::emitSlow_op_jnless):
2601         (JSC::JIT::emit_op_jless):
2602         (JSC::JIT::emitSlow_op_jless):
2603         (JSC::JIT::emit_op_jlesseq):
2604         (JSC::JIT::emit_op_jnlesseq):
2605         (JSC::JIT::emitSlow_op_jlesseq):
2606         (JSC::JIT::emitSlow_op_jnlesseq):
2607         (JSC::JIT::emitBinaryDoubleOp):
2608         * jit/JITInlineMethods.h:
2609         (JSC::JIT::emitLoadCharacterString):
2610         (JSC::JIT::isOperandConstantImmediateChar):
2611         * jit/JSInterfaceJIT.h:
2612         (JSC::ThunkHelpers::stringImplDataOffset):
2613         (JSC::ThunkHelpers::jsStringLengthOffset):
2614         (JSC::ThunkHelpers::jsStringValueOffset):
2615          Moved from ThunkGenerators to make it possible to share.
2616         * jit/ThunkGenerators.cpp:
2617
2618 2010-05-06  Martin Robinson  <mrobinson@webkit.org>
2619
2620         Reviewed by Gustavo Noronha Silva.
2621
2622         [GTK] Enable DOM clipboard and drag-and-drop access
2623         https://bugs.webkit.org/show_bug.cgi?id=30623
2624
2625         Convert dragging portion of drag-and-drop to use DataObjectGtk.
2626
2627         * wtf/gobject/GRefPtr.h: Add forward declarations for GObject functions.
2628
2629 2010-05-06  Steve Block  <steveblock@google.com>
2630
2631         Reviewed by Eric Seidel.
2632
2633         MAC_JAVA_BRIDGE should be renamed JAVA_BRIDGE
2634         https://bugs.webkit.org/show_bug.cgi?id=38544
2635
2636         * wtf/Platform.h:
2637
2638 2010-05-06  Adam Barth  <abarth@webkit.org>
2639
2640         Reviewed by Maciej Stachowiak.
2641
2642         [WTFURL] Add a class to represent the segments of a URL
2643         https://bugs.webkit.org/show_bug.cgi?id=38566
2644
2645         When paired with a string, this class represents a parsed URL.
2646
2647         * wtf/url/src/URLSegments.cpp: Added.
2648         (WTF::URLSegments::length):
2649         (WTF::URLSegments::charactersBefore):
2650         * wtf/url/src/URLSegments.h: Added.
2651         (WTF::URLSegments::):
2652         (WTF::URLSegments::URLSegments):
2653         * wtf/url/wtfurl.gyp:
2654
2655 2010-05-05  Tony Gentilcore  <tonyg@chromium.org>
2656
2657         Reviewed by Adam Barth.
2658
2659         Adding comment with link to RefPtr documentation.
2660         https://bugs.webkit.org/show_bug.cgi?id=38601
2661
2662         * wtf/RefPtr.h:
2663
2664 2010-05-05  Gavin Barraclough  <barraclough@apple.com>
2665
2666         Reviewed by Darin Adler.
2667
2668         Bug 38604 - workers-gc2 crashing on Qt
2669
2670         This appears to be due to a couple of issues.
2671         (1) When the atomic string table is deleted it does not clear the 'inTable' bit
2672         on AtomicStrings - it implicitly assumes that all AtomicStrings have already
2673         been deleted at this point (otherwise they will crash in their destructor when
2674         they try to remove themselves from the atomic string table).
2675         (2) We don't fix the ordering in which WTF::WTFThreadData and
2676         WebCore::ThreadGlobalData are destructed.
2677
2678         We should make sure that ThreadGlobalData is cleaned up before worker threads
2679         terminate and WTF::WTFThreadData is destroyed, and we should clear the inTable
2680         bit of members on atomic string table destruction.
2681
2682         WTF changes (fix issue 1, above) - ensure inTable property is cleared when the
2683         atomic string table is destroyed (also, rename InTable to IsAtomic, to make it
2684         clear which table we are refering to!)
2685
2686         * wtf/text/AtomicString.cpp:
2687         (WebCore::AtomicStringTable::destroy):
2688         (WebCore::CStringTranslator::translate):
2689         (WebCore::UCharBufferTranslator::translate):
2690         (WebCore::HashAndCharactersTranslator::translate):
2691         (WebCore::AtomicString::add):
2692         * wtf/text/StringImpl.cpp:
2693         (WebCore::StringImpl::~StringImpl):
2694         * wtf/text/StringImpl.h:
2695         (WebCore::StringImpl::isAtomic):
2696         (WebCore::StringImpl::setIsAtomic):
2697         * wtf/text/StringImplBase.h:
2698
2699 2010-05-05  Oliver Hunt  <oliver@apple.com>
2700
2701         Reviewed by Geoffrey Garen.
2702
2703         Make Array.join specialised for actual arrays
2704         https://bugs.webkit.org/show_bug.cgi?id=38592
2705
2706         Bring Array.join in line with the other array methods by specialising for
2707         this === an array.
2708
2709         * runtime/ArrayPrototype.cpp:
2710         (JSC::arrayProtoFuncJoin):
2711
2712 2010-05-04  Yongjun Zhang  <yongjun_zhang@apple.com>
2713
2714         Reviewed by Darin Adler.
2715
2716         WebKit crashes at DebuggerCallFrame::functionName() if m_callFrame is the top global callframe.
2717         https://bugs.webkit.org/show_bug.cgi?id=38535
2718
2719         Don't call asFunction if callee is not a FunctionType to prevent assertion failure
2720         in JSCell::isObject().
2721
2722         * debugger/DebuggerCallFrame.cpp:
2723         (JSC::DebuggerCallFrame::functionName):
2724         (JSC::DebuggerCallFrame::calculatedFunctionName):
2725
2726 2010-05-04  Steve Falkenburg  <sfalken@apple.com>
2727
2728         Remove redundant exports to fix Windows build warnings.
2729
2730         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2731
2732 2010-05-04  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
2733
2734         Reviewed by Holger Freyther.
2735
2736         Fix a memory leak inside the QScriptValue.
2737
2738         QSciptValuePrivate::toString should release all temporary variables.
2739
2740         [Qt] QScriptValue::toString have a memory leak.
2741         https://bugs.webkit.org/show_bug.cgi?id=38112
2742
2743         * qt/api/qscriptvalue_p.h:
2744         (QScriptValuePrivate::toString):
2745
2746 2010-05-04  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
2747
2748         Reviewed by Darin Adler.
2749
2750         Does not work on SPARC because of alignment issues
2751         https://bugs.webkit.org/show_bug.cgi?id=38455
2752
2753         Use AllocAlignmentInteger instead of void* on pageheap_memory to
2754         avoid crashing at runtime in some architectures. Investigated by
2755         Mike Hommey <mh@glandium.org>, change suggested by Darin Adler.
2756
2757         * wtf/FastMalloc.cpp:
2758
2759 2010-05-04  Adam Barth  <abarth@webkit.org>
2760
2761         Reviewed by Maciej Stachowiak.
2762
2763         Add first WTFURL file
2764         https://bugs.webkit.org/show_bug.cgi?id=38470
2765
2766         This class represents a component of a URL, such as the scheme or path.
2767         Essentially, the class is an index into a string buffer.
2768
2769         * wtf/url: Added.
2770             - There was some discussion about where to put the URL library.
2771               There are a number of reasonable options, but putting the library
2772               in the WTF directory seems like a reasonable alternative.  This
2773               location will make more sense once WTF is moved out of
2774               JavaScriptCore and into a top-level directory.
2775         * wtf/url/src: Added.
2776             - I've added this extra directory to the usual structure because we
2777               eventually want a "public" folder that defines the public
2778               interface to this library that clients outside of svn.webkit.org
2779               can rely upon, much like the various subfolders of the WebKit
2780               directory often define a public API.
2781         * wtf/url/src/URLComponent.h: Added.
2782             - I've added this somewhat trivial class to get the ball rolling.
2783         (WTF::URLComponent::URLComponent):
2784         (WTF::URLComponent::isValid):
2785         (WTF::URLComponent::isNonempty):
2786         (WTF::URLComponent::reset):
2787         (WTF::URLComponent::operator==):
2788         (WTF::URLComponent::begin):
2789         (WTF::URLComponent::setBegin):
2790         (WTF::URLComponent::length):
2791         (WTF::URLComponent::setLength):
2792         (WTF::URLComponent::end):
2793         * wtf/url/wtfurl.gyp: Added.
2794             - WTFURL will be an independently buildable library, hence the
2795               beginnings of a wtfurl.gyp file.
2796
2797 2010-05-03  Stephanie Lewis  <slewis@apple.com>
2798
2799         Reviewed by Geoff Garen.
2800
2801         https://bugs.webkit.org/show_bug.cgi?id=38368
2802         <rdar://problem/7834433> REGRESSSION: 1.5% PLT regression due to 56028 
2803         (return memory quicker).
2804         Instead of returning everything but the smallest spans spread out 
2805         the spans kept over several size lists.
2806
2807         * wtf/FastMalloc.cpp:
2808         (WTF::TCMalloc_PageHeap::scavenge):
2809
2810 2010-05-03  James Robinson  <jamesr@chromium.org>
2811
2812         Reviewed by Eric Seidel.
2813
2814         Clean up a few compiler warnings
2815         https://bugs.webkit.org/show_bug.cgi?id=38073
2816
2817         * wtf/text/StringImpl.cpp:
2818         (WebCore::StringImpl::ascii):
2819
2820 2010-05-03  Gavin Barraclough  <barraclough@apple.com>
2821
2822         Reviewed by NOBODY (reverting previous commit).
2823
2824         Rolling out r58114 - this introduced memory leaks of
2825         AtomicStrings then workers terminated.
2826
2827         * GNUmakefile.am:
2828         * JavaScriptCore.gypi:
2829         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
2830         * JavaScriptCore.xcodeproj/project.pbxproj:
2831         * jit/ThunkGenerators.cpp:
2832         (JSC::ThunkHelpers::stringImplDataOffset):
2833         * runtime/Identifier.cpp:
2834         (JSC::IdentifierTable::~IdentifierTable):
2835         (JSC::IdentifierTable::add):
2836         (JSC::IdentifierCStringTranslator::hash):
2837         (JSC::IdentifierCStringTranslator::equal):
2838         (JSC::IdentifierCStringTranslator::translate):
2839         (JSC::Identifier::add):
2840         (JSC::IdentifierUCharBufferTranslator::hash):
2841         (JSC::IdentifierUCharBufferTranslator::equal):
2842         (JSC::IdentifierUCharBufferTranslator::translate):
2843         (JSC::Identifier::addSlowCase):
2844         * runtime/Identifier.h:
2845         * runtime/JSGlobalData.cpp:
2846         (JSC::JSGlobalData::JSGlobalData):
2847         (JSC::JSGlobalData::~JSGlobalData):
2848         * runtime/JSGlobalData.h:
2849         * wtf/WTFThreadData.cpp:
2850         (WTF::WTFThreadData::WTFThreadData):
2851         (WTF::WTFThreadData::~WTFThreadData):
2852         * wtf/WTFThreadData.h:
2853         (JSC::IdentifierTable::remove):
2854         (JSC::IdentifierTable::literalTable):
2855         (WTF::WTFThreadData::atomicStringTable):
2856         * wtf/text/AtomicString.cpp:
2857         (WebCore::AtomicStringTable::create):
2858         (WebCore::AtomicStringTable::table):
2859         (WebCore::AtomicStringTable::destroy):
2860         (WebCore::stringTable):
2861         (WebCore::CStringTranslator::hash):
2862         (WebCore::CStringTranslator::equal):
2863         (WebCore::CStringTranslator::translate):
2864         (WebCore::operator==):
2865         (WebCore::AtomicString::add):
2866         (WebCore::equal):
2867         (WebCore::UCharBufferTranslator::hash):
2868         (WebCore::UCharBufferTranslator::equal):
2869         (WebCore::UCharBufferTranslator::translate):
2870         (WebCore::HashAndCharactersTranslator::hash):
2871         (WebCore::HashAndCharactersTranslator::equal):
2872         (WebCore::HashAndCharactersTranslator::translate):
2873         (WebCore::AtomicString::find):
2874         (WebCore::AtomicString::remove):
2875         * wtf/text/AtomicStringTable.h: Removed.
2876         * wtf/text/StringImpl.cpp:
2877         (WebCore::StringImpl::~StringImpl):
2878         * wtf/text/StringImpl.h:
2879         (WebCore::StringImpl::inTable):
2880         (WebCore::StringImpl::setInTable):
2881         (WebCore::equal):
2882         * wtf/text/StringImplBase.h:
2883         (WTF::StringImplBase::StringImplBase):
2884
2885 2010-05-03  Kevin Watters  <kevinwatters@gmail.com>
2886
2887         Reviewed by Kevin Ollivier.
2888
2889         [wx] Implement scheduleDispatchFunctionsOnMainThread for wx port.
2890         https://bugs.webkit.org/show_bug.cgi?id=38480
2891
2892         * wtf/wx/MainThreadWx.cpp:
2893         (wxCallAfter::wxCallAfter):
2894         (wxCallAfter::OnCallback):
2895         (WTF::scheduleDispatchFunctionsOnMainThread):
2896
2897 2010-05-03  Kevin Watters  <kevinwatters@gmail.com>
2898
2899         Reviewed by Kevin Ollivier.
2900
2901         [wx] Build and use Mac's ComplexTextController to support complex text in wx.
2902         https://bugs.webkit.org/show_bug.cgi?id=38482
2903
2904         * wtf/Platform.h:
2905
2906 2010-05-03  Oliver Hunt  <oliver@apple.com>
2907
2908         Reviewed by Maciej Stachowiak.
2909
2910         Interpreter crashes due to incorrect refcounting of cached structures.
2911         https://bugs.webkit.org/show_bug.cgi?id=38491
2912         rdar://problem/7926160
2913
2914         Make sure we ref/deref structures used for cached custom property getters
2915
2916         * bytecode/CodeBlock.cpp:
2917         (JSC::CodeBlock::derefStructures):
2918         (JSC::CodeBlock::refStructures):
2919
2920 2010-05-02  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
2921
2922         Reviewed by Eric Seidel.
2923
2924         [Qt] Enable JIT for QtWebKit on Symbian
2925         https://bugs.webkit.org/show_bug.cgi?id=38339
2926
2927         JIT on Symbian has been stable for quite some time, it
2928         is time to turn it on by default.
2929
2930         * wtf/Platform.h:
2931
2932 2010-04-29  Oliver Hunt  <oliver@apple.com>
2933
2934         Reviewed by Gavin Barraclough.
2935
2936         Add codegen support for unsigned right shift
2937         https://bugs.webkit.org/show_bug.cgi?id=38375
2938
2939         Expose unsigned right shift in the macro assembler, and make use of it
2940         from the jit.  Currently if the result is outside the range 0..2^31-1
2941         we simply fall back to the slow case, even in JSVALUE64 and JSVALUE32_64
2942         where technically we could still return an immediate value.
2943
2944         * assembler/MacroAssemblerARM.h:
2945         (JSC::MacroAssemblerARM::urshift32):
2946         * assembler/MacroAssemblerARMv7.h:
2947         (JSC::MacroAssemblerARMv7::urshift32):
2948         * assembler/MacroAssemblerX86Common.h:
2949         (JSC::MacroAssemblerX86Common::urshift32):
2950         * assembler/X86Assembler.h:
2951         (JSC::X86Assembler::):
2952         (JSC::X86Assembler::shrl_i8r):
2953         (JSC::X86Assembler::shrl_CLr):
2954            Add unsigned right shift to the x86 assembler
2955         * jit/JIT.cpp:
2956         (JSC::JIT::privateCompileMainPass):
2957         (JSC::JIT::privateCompileSlowCases):
2958            op_rshift no longer simply get thrown to a stub function
2959         * jit/JIT.h:
2960         * jit/JITArithmetic.cpp:
2961         (JSC::JIT::emit_op_urshift):
2962         (JSC::JIT::emitSlow_op_urshift):
2963           JSVALUE32 and JSVALUE64 implementation.  Only supports
2964           double lhs in JSVALUE64.
2965         * jit/JITArithmetic32_64.cpp:
2966         (JSC::JIT::emit_op_rshift):
2967         (JSC::JIT::emitSlow_op_rshift):
2968         (JSC::JIT::emit_op_urshift):
2969         (JSC::JIT::emitSlow_op_urshift):
2970           Refactor right shift code to have shared implementation between signed
2971           and unsigned versions.
2972
2973 2010-04-29  Oliver Hunt  <oliver@apple.com>
2974
2975         Reviewed by Gavin Barraclough.
2976
2977         Handle double on righthand side of a right shift
2978         https://bugs.webkit.org/show_bug.cgi?id=38363
2979
2980         In 64-bit we support right shift of a double, and there's no
2981         reason not to in 32-bit either.  This is a 1.1% sunspider
2982         improvement in 32bit.
2983
2984         Given high performance javascript code frequently makes
2985         use of bit operators to perform double->int conversion i'll
2986         follow this patch up with similar patches for bitwise 'and'
2987         and 'or'.
2988
2989         * jit/JITArithmetic32_64.cpp:
2990         (JSC::JIT::emit_op_rshift):
2991         (JSC::JIT::emitSlow_op_rshift):
2992
2993 2010-04-29  Oliver Hunt  <oliver@apple.com>
2994
2995         Reviewed by Geoff Garen.
2996
2997         Hoist JSVALUE32_64 arithmetic implementations into a separate file.
2998
2999         * GNUmakefile.am:
3000         * JavaScriptCore.gypi:
3001         * JavaScriptCore.pro:
3002         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3003         * JavaScriptCore.xcodeproj/project.pbxproj:
3004         * jit/JITArithmetic.cpp:
3005         (JSC::JIT::emitSlow_op_jnless):
3006         (JSC::JIT::emitSlow_op_jless):
3007         (JSC::JIT::emitSlow_op_jnlesseq):
3008         (JSC::JIT::emit_op_mod):
3009         (JSC::JIT::compileBinaryArithOpSlowCase):
3010         (JSC::JIT::emit_op_div):
3011         (JSC::JIT::compileBinaryArithOp):
3012         * jit/JITArithmetic32_64.cpp: Added.
3013         (JSC::JIT::emit_op_negate):
3014         (JSC::JIT::emitSlow_op_negate):
3015         (JSC::JIT::emit_op_jnless):
3016         (JSC::JIT::emitSlow_op_jnless):
3017         (JSC::JIT::emit_op_jless):
3018         (JSC::JIT::emitSlow_op_jless):
3019         (JSC::JIT::emit_op_jnlesseq):
3020         (JSC::JIT::emitSlow_op_jnlesseq):
3021         (JSC::JIT::emit_op_lshift):
3022         (JSC::JIT::emitSlow_op_lshift):
3023         (JSC::JIT::emit_op_rshift):
3024         (JSC::JIT::emitSlow_op_rshift):
3025         (JSC::JIT::emit_op_bitand):
3026         (JSC::JIT::emitSlow_op_bitand):
3027         (JSC::JIT::emit_op_bitor):
3028         (JSC::JIT::emitSlow_op_bitor):
3029         (JSC::JIT::emit_op_bitxor):
3030         (JSC::JIT::emitSlow_op_bitxor):
3031         (JSC::JIT::emit_op_bitnot):
3032         (JSC::JIT::emitSlow_op_bitnot):
3033         (JSC::JIT::emit_op_post_inc):
3034         (JSC::JIT::emitSlow_op_post_inc):
3035         (JSC::JIT::emit_op_post_dec):
3036         (JSC::JIT::emitSlow_op_post_dec):
3037         (JSC::JIT::emit_op_pre_inc):
3038         (JSC::JIT::emitSlow_op_pre_inc):
3039         (JSC::JIT::emit_op_pre_dec):
3040         (JSC::JIT::emitSlow_op_pre_dec):
3041         (JSC::JIT::emit_op_add):
3042         (JSC::JIT::emitAdd32Constant):
3043         (JSC::JIT::emitSlow_op_add):
3044         (JSC::JIT::emit_op_sub):
3045         (JSC::JIT::emitSub32Constant):
3046         (JSC::JIT::emitSlow_op_sub):
3047         (JSC::JIT::emitBinaryDoubleOp):
3048         (JSC::JIT::emit_op_mul):
3049         (JSC::JIT::emitSlow_op_mul):
3050         (JSC::JIT::emit_op_div):
3051         (JSC::JIT::emitSlow_op_div):
3052         (JSC::JIT::emit_op_mod):
3053         (JSC::JIT::emitSlow_op_mod):
3054
3055 2010-04-29  Zoltan Herczeg  <zherczeg@webkit.org>
3056
3057         Reviewed by Oliver Hunt
3058
3059         Add sqrt() instruction support for ARM assembler (using VFP)
3060         https://bugs.webkit.org/show_bug.cgi?id=38312
3061
3062         * assembler/ARMAssembler.h:
3063         (JSC::ARMAssembler::):
3064         (JSC::ARMAssembler::fsqrtd_r):
3065         * assembler/MacroAssemblerARM.h:
3066         (JSC::MacroAssemblerARM::supportsFloatingPointSqrt):
3067         (JSC::MacroAssemblerARM::sqrtDouble):
3068
3069 2010-04-29  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
3070
3071         Reviewed by Simon Hausmann.
3072
3073         [Qt] Refactor qtscriptglobal.h
3074         https://bugs.webkit.org/show_bug.cgi?id=37953
3075
3076         Use the same pattern in qtscriptglobal.h as in 
3077         qwebkitglobal.h without checking for specific OSs.
3078
3079         * qt/api/qtscriptglobal.h:
3080
3081 2010-04-29  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
3082
3083         Reviewed by Simon Hausmann.
3084
3085         Small cleanup.
3086
3087         QScriptValuePrivate constructor shouldn't take QScriptEngine pointer
3088         as a parameter, because it breaks a private / public separation rule.
3089         QScriptEnginePrivate::get(QScriptEngine*) should return
3090         a QScriptEnginePrivate pointer instead of a QScriptEnginePtr, it simplifies
3091         implementation.
3092
3093         [Qt] QScriptValuePrivate class needs some cleanup.
3094         https://bugs.webkit.org/show_bug.cgi?id=37729
3095
3096         * qt/api/qscriptengine_p.h:
3097         (QScriptEnginePrivate::get):
3098         * qt/api/qscriptvalue.cpp:
3099         (QScriptValue::QScriptValue):
3100         * qt/api/qscriptvalue_p.h:
3101         (QScriptValuePrivate::QScriptValuePrivate):
3102
3103 2010-04-29  Kwang Yul Seo  <skyul@company100.net>
3104
3105         Reviewed by Simon Hausmann.
3106
3107         [WINCE] Export g_stackBase with JS_EXPORTDATA
3108         https://bugs.webkit.org/show_bug.cgi?id=37437
3109
3110         Export g_stackBase with JS_EXPORTDATA as it is used by SharedTimerWince.cpp.
3111
3112         * runtime/Collector.cpp:
3113
3114 2010-04-28  Oliver Hunt  <oliver@apple.com>
3115
3116         Do an unordered compare so that we don't treat NaN incorrectly.
3117
3118         RS=Gavin Barraclough
3119
3120         * jit/ThunkGenerators.cpp:
3121         (JSC::powThunkGenerator):
3122
3123 2010-04-28  Oliver Hunt  <oliver@apple.com>
3124
3125         Reviewed by Gavin Barraclough.
3126
3127         Add fast paths for Math.pow and Math.sqrt
3128         https://bugs.webkit.org/show_bug.cgi?id=38294
3129
3130         Add specialized thunks for Math.pow and Math.sqrt.
3131         This requires adding a sqrtDouble function to the MacroAssembler
3132         and sqrtsd to the x86 assembler.
3133
3134         Math.pow is slightly more complicated, in that we have
3135         to implement exponentiation ourselves rather than relying
3136         on hardware support.  The inline exponentiation is restricted
3137         to positive integer exponents on a numeric base.  Exponentiation
3138         is finally performed through the "Exponentiation by Squaring"
3139         algorithm.
3140
3141         * assembler/AbstractMacroAssembler.h:
3142         (JSC::AbstractMacroAssembler::ImmPtr::ImmPtr):
3143         * assembler/MacroAssemblerARM.h:
3144         (JSC::MacroAssemblerARM::supportsFloatingPointSqrt):
3145         (JSC::MacroAssemblerARM::loadDouble):
3146         (JSC::MacroAssemblerARM::sqrtDouble):
3147         * assembler/MacroAssemblerARMv7.h:
3148         (JSC::MacroAssemblerARMv7::supportsFloatingPointSqrt):
3149         (JSC::MacroAssemblerARMv7::sqrtDouble):
3150         * assembler/MacroAssemblerX86.h:
3151         (JSC::MacroAssemblerX86::loadDouble):
3152         (JSC::MacroAssemblerX86::supportsFloatingPointSqrt):
3153         * assembler/MacroAssemblerX86Common.h:
3154         (JSC::MacroAssemblerX86Common::sqrtDouble):
3155         * assembler/MacroAssemblerX86_64.h:
3156         (JSC::MacroAssemblerX86_64::loadDouble):
3157         (JSC::MacroAssemblerX86_64::supportsFloatingPointSqrt):
3158         * assembler/X86Assembler.h:
3159         (JSC::X86Assembler::):
3160         (JSC::X86Assembler::movsd_mr):
3161         (JSC::X86Assembler::sqrtsd_rr):
3162         (JSC::X86Assembler::X86InstructionFormatter::twoByteOp):
3163         (JSC::X86Assembler::X86InstructionFormatter::memoryModRM):
3164         * create_hash_table:
3165         * jit/JIT.h:
3166         * jit/JITInlineMethods.h:
3167         * jit/JITOpcodes.cpp:
3168         * jit/JITStubs.h:
3169         (JSC::JITThunks::ctiNativeCallThunk):
3170         * jit/JSInterfaceJIT.h:
3171         (JSC::JSInterfaceJIT::emitLoadDouble):
3172         (JSC::JSInterfaceJIT::emitJumpIfImmediateNumber):
3173         (JSC::JSInterfaceJIT::emitJumpIfNotImmediateNumber):
3174         (JSC::JSInterfaceJIT::emitLoadInt32):
3175         * jit/SpecializedThunkJIT.h:
3176         (JSC::SpecializedThunkJIT::loadDoubleArgument):
3177         (JSC::SpecializedThunkJIT::loadInt32Argument):
3178         (JSC::SpecializedThunkJIT::returnJSValue):
3179         (JSC::SpecializedThunkJIT::returnDouble):
3180         (JSC::SpecializedThunkJIT::finalize):
3181         * jit/ThunkGenerators.cpp:
3182         (JSC::sqrtThunkGenerator):
3183         (JSC::powThunkGenerator):
3184         * jit/ThunkGenerators.h:
3185         * runtime/Executable.h:
3186         (JSC::NativeExecutable::NativeExecutable):
3187         * runtime/JSFunction.cpp:
3188         (JSC::JSFunction::JSFunction):
3189
3190 2010-04-28  Mike Thole  <mthole@apple.com>
3191
3192         Reviewed by Mark Rowe.
3193
3194         Reenable WTF_USE_PROTECTION_SPACE_AUTH_CALLBACK now that an
3195         exports file for it has been added.
3196
3197         * wtf/Platform.h:
3198
3199 2010-04-28  Mike Thole  <mthole@apple.com>
3200
3201         Build fix, not reviewed.
3202
3203         * wtf/Platform.h:
3204         Disable WTF_USE_PROTECTION_SPACE_AUTH_CALLBACK until an exports file is created.
3205
3206 2010-04-28  Mike Thole  <mthole@apple.com>
3207
3208         Reviewed by David Kilzer.
3209
3210         Add canAuthenticateAgainstProtectionSpace() to frame loader so that a protection space 
3211         can be inspected before attempting to authenticate against it
3212         https://bugs.webkit.org/show_bug.cgi?id=38271
3213
3214         * wtf/Platform.h: Add WTF_USE_PROTECTION_SPACE_AUTH_CALLBACK define.
3215
3216 2010-04-28  Darin Adler  <darin@apple.com>
3217
3218         Reviewed by Sam Weinig.
3219
3220         Don't use CFAbsoluteTimeGetCurrent on Mac OS X, since it's just a cover
3221         for gettimeofday anyway.
3222
3223         * wtf/CurrentTime.cpp:
3224         (WTF::currentTime): Remove the CF version of this. Change the "other POSIX"
3225         version to pass 0 for the time zone instead of ignoring a return value.
3226         Also get rid of unneeded type casts, since operations involving both
3227         integers and doubles are always evaluated as doubles in C without explicit
3228         type casting.
3229
3230 2010-04-28  Darin Fisher  <darin@chromium.org>
3231
3232         Reviewed by David Levin.
3233
3234         [Chromium] callOnMainThread should equate to MessageLoop::PostTask
3235         https://bugs.webkit.org/show_bug.cgi?id=38276
3236
3237         * JavaScriptCore.gyp/JavaScriptCore.gyp:
3238         * wtf/MainThread.cpp:
3239         * wtf/chromium/ChromiumThreading.h:
3240         * wtf/chromium/MainThreadChromium.cpp:
3241         (WTF::initializeMainThread):
3242         (WTF::callOnMainThread):
3243         (WTF::callOnMainThreadAndWait):
3244         (WTF::setMainThreadCallbacksPaused):
3245         (WTF::isMainThread):
3246
3247 2010-04-28  Simon Hausmann  <simon.hausmann@nokia.com>, Kent Hansen <kent.hansen@nokia.com>
3248
3249         Reviewed by Darin Adler.
3250
3251         JSC's currentThreadStackBase is not reentrant on some platforms
3252         https://bugs.webkit.org/show_bug.cgi?id=37195
3253
3254         This function needs to be reentrant to avoid memory corruption on platforms where
3255         the implementation uses global variables.
3256
3257         This patch adds a mutex lock where necessary and makes the Symbian implementation
3258         reentrant.
3259
3260         * runtime/Collector.cpp:
3261         (JSC::currentThreadStackBaseMutex):
3262         (JSC::currentThreadStackBase):
3263
3264 2010-04-28  Thiago Macieira <thiago.macieira@nokia.com>
3265
3266         Reviewed by Simon Hausmann.
3267
3268         Fix compilation with gcc 3.4.
3269
3270         AtomicStringImpl.h:29: error: base `WebCore::StringImpl' with only
3271         non-default constructor in class without a constructor
3272
3273         * wtf/text/AtomicStringImpl.h:
3274         (WebCore::AtomicStringImpl::AtomicStringImpl): Provide a default constructor.
3275         * wtf/text/StringImpl.h: Allow AtomicStringImpl to call a StringImpl constructor through a friend declaration.
3276
3277 2010-04-27  Stephanie Lewis  <slewis@apple.com>
3278
3279         Fix Tiger build.
3280
3281         * wtf/FastMalloc.cpp:
3282         (WTF::TCMalloc_PageHeap::Carve):
3283
3284 2010-04-26  Stephanie Lewis  <slewis@apple.com>
3285
3286         Reviewed by Geoff Garen.
3287
3288         https://bugs.webkit.org/show_bug.cgi?id=38154 FastMalloc calls madvise too often.
3289         <rdar://problem/7834433> REGRESSSION: 1.5% PLT regression due to 56028 (return memory quicker).  
3290         To save on madvise calls when recommitting memory recommit the entire span and then carve it
3291         instead of carving the span up and only committing the part that will be used immediately.
3292
3293         * wtf/FastMalloc.cpp:
3294         (WTF::TCMalloc_PageHeap::New):
3295         (WTF::TCMalloc_PageHeap::AllocLarge):
3296         (WTF::TCMalloc_PageHeap::Carve):
3297
3298 2010-04-26  Oliver Hunt  <oliver@apple.com>
3299
3300         Reviewed by Maciej Stachowiak.
3301
3302         Add specialized thunks for a char code related string functions
3303         https://bugs.webkit.org/show_bug.cgi?id=38177
3304
3305         This is a simple extension to my prior patch.  Basically hoist the
3306         existing character loading logic from the charCodeAt thunk and into
3307         a helper function, then add a helper to load strings from the small
3308         string cache.  This allows trivial implementations of fromCharCode
3309         and charAt. 
3310
3311         * create_hash_table:
3312         * jit/SpecializedThunkJIT.h:
3313         (JSC::SpecializedThunkJIT::returnJSCell):
3314         (JSC::SpecializedThunkJIT::tagReturnAsJSCell):
3315         * jit/ThunkGenerators.cpp:
3316         (JSC::stringCharLoad):
3317         (JSC::charToString):
3318         (JSC::charCodeAtThunkGenerator):
3319         (JSC::charAtThunkGenerator):
3320         (JSC::fromCharCodeThunkGenerator):
3321         * jit/ThunkGenerators.h:
3322         * runtime/SmallStrings.h:
3323         (JSC::SmallStrings::singleCharacterStrings):
3324         * runtime/StringConstructor.cpp:
3325         (JSC::StringConstructor::StringConstructor):
3326
3327 2010-04-27  Thomas Zander <t.zander@nokia.com>
3328
3329         Reviewed by Simon Hausmann.
3330
3331         [Qt] Fix the build on Symbian on Linux using the Makefile based mkspec
3332
3333         * JavaScriptCore.pri: It is necessary to specify the library search path
3334         when linking against JavaScriptCore.
3335
3336 2010-04-21  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
3337
3338         Reviewed by Simon Hausmann.
3339
3340         Compile fix for Visual Studio 2010
3341         https://bugs.webkit.org/show_bug.cgi?id=37867
3342
3343         Patch by Prasanth Ullattil <prasanth.ullattil@nokia.com>
3344