initial import
[vuplus_webkit] / 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
3345         * runtime/Structure.cpp:
3346         (JSC::Structure::transitionTableAdd):
3347         * wtf/MathExtras.h:
3348         * wtf/Platform.h:
3349
3350 2010-04-27  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
3351
3352         Reviewed by Simon Hausmann.
3353
3354         Rename COMPILER(MSVC7) to COMPILER(MSVC7_OR_LOWER)
3355
3356         * config.h:
3357         (JSC::Structure::transitionTableAdd):
3358         * wtf/Assertions.h:
3359         * wtf/Atomics.h:
3360         * wtf/CurrentTime.h:
3361         (WTF::getLocalTime):
3362         * wtf/Platform.h:
3363         * wtf/StaticConstructors.h:
3364         * wtf/StringExtras.h:
3365         * wtf/Vector.h:
3366         (WTF::::append):
3367
3368 2010-04-15  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
3369
3370         Reviewed by Tor Arne Vestbø.
3371
3372         [Qt] Fix Mac build break.
3373
3374         https://bugs.webkit.org/show_bug.cgi?id=37867
3375         - Make sure JavaScriptCore's debug_and_release config follows that
3376           of WebCore.
3377         - Use different name for JavaScriptCore target in debug and release
3378           since they might be written in the same path at the same time on
3379           parallel builds
3380         - Consolidate the DESTDIR determination logic in JavaScriptCore.pri
3381
3382         * JavaScriptCore.pri:
3383         * JavaScriptCore.pro:
3384
3385 2010-04-21  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
3386
3387         Reviewed by Kenneth Rohde Christiansen.
3388
3389         [Qt] Make sure WebKit is not compiled using C++0x.
3390         https://bugs.webkit.org/show_bug.cgi?id=37867
3391
3392         As the rest of Qt compiles in the C++0x mode, people might start
3393         compiling it in this mode. WebKit don't support this yet.
3394
3395         Patch by Thiago Macieira <thiago.macieira@nokia.com>
3396
3397         * JavaScriptCore.pro:
3398
3399 2010-04-26  Oliver Hunt  <oliver@apple.com>
3400
3401         Fix windows
3402
3403         * jit/SpecializedThunkJIT.h:
3404         (JSC::SpecializedThunkJIT::argumentToVirtualRegister):
3405
3406 2010-04-26  Oliver Hunt  <oliver@apple.com>
3407
3408         Reviewed by Gavin Barraclough.
3409
3410         Need to support more efficient dispatch of lightweight builtins
3411         https://bugs.webkit.org/show_bug.cgi?id=38155
3412
3413         The problem with calling lightweight builtins is that marshalling
3414         the call from the nitro calling convention to the system calling
3415         convention is very expensive relative to the cost of the actually
3416         evaluating the function.  To work around this problem this patch
3417         adds the ability to define a custom thunk for a builtin.
3418
3419         This allows us to use high performance custom implementations of
3420         the common and sensible versions of simple builtins.  This patch
3421         includes a simple (use of which is currently hardcoded) thunk for
3422         charCodeAt.
3423
3424         This adds a JSInterfaceJIT subclass called SpecializedThunkJIT
3425         that has helper functions to remove (or at least reduce) the need
3426         to have separate thunk implementations for each JSValue encoding.
3427
3428         * GNUmakefile.am:
3429         * JavaScriptCore.pro:
3430         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3431         * JavaScriptCore.xcodeproj/project.pbxproj:
3432           Many project file updates
3433
3434         * create_hash_table:
3435           Add thunk generation callbacks to the hash tables, currently
3436           we hardcode the script to only support charCodeAt
3437
3438         * jit/JITStubCall.h:
3439         * jit/JITStubs.cpp:
3440         (JSC::JITThunks::~JITThunks):
3441         (JSC::JITThunks::specializedThunk):
3442         * jit/JITStubs.h:
3443         * jit/SpecializedThunkJIT.h: Added.
3444         (JSC::SpecializedThunkJIT::SpecializedThunkJIT):
3445         (JSC::SpecializedThunkJIT::loadCellArgument):
3446         (JSC::SpecializedThunkJIT::loadJSStringArgument):
3447         (JSC::SpecializedThunkJIT::loadInt32Argument):
3448         (JSC::SpecializedThunkJIT::appendFailure):
3449         (JSC::SpecializedThunkJIT::returnInt32):
3450         (JSC::SpecializedThunkJIT::finalize):
3451         (JSC::SpecializedThunkJIT::argumentToVirtualRegister):
3452         (JSC::SpecializedThunkJIT::tagReturnAsInt32):
3453         * jit/ThunkGenerators.cpp: Added.
3454         (JSC::ThunkHelpers::stringImplDataOffset):
3455         (JSC::ThunkHelpers::jsStringLengthOffset):
3456         (JSC::ThunkHelpers::jsStringValueOffset):
3457         (JSC::charCodeAtThunkGenerator):
3458         * jit/ThunkGenerators.h: Added.
3459         * runtime/Executable.h:
3460         (JSC::NativeExecutable::NativeExecutable):
3461         * runtime/JSFunction.cpp:
3462         (JSC::JSFunction::JSFunction):
3463         * runtime/JSFunction.h:
3464         * runtime/JSGlobalData.h:
3465         (JSC::JSGlobalData::getThunk):
3466         * runtime/JSString.h:
3467         (JSC::):
3468         * runtime/JSValue.h:
3469           Protect some of the JSVALUE32 and JSVALUE32_64 only constants
3470           and function behind appropriate USE() guards to make it harder
3471           to use the wrong flags for the target build.
3472         * runtime/Lookup.cpp:
3473         (JSC::HashTable::createTable):
3474         (JSC::setUpStaticFunctionSlot):
3475         * runtime/Lookup.h:
3476         (JSC::HashEntry::initialize):
3477         (JSC::HashEntry::generator):
3478         (JSC::HashEntry::):
3479           Make the lookup tables use a specialized thunkGenerator
3480           if present
3481         * wtf/text/StringImpl.h:
3482
3483 2010-04-26  Oliver Hunt  <oliver@apple.com>
3484
3485         Build fix
3486
3487         * runtime/JSImmediate.h:
3488         * runtime/JSValue.h:
3489
3490 2010-04-26  Oliver Hunt  <oliver@apple.com>
3491
3492         Reviewed by Gavin Barraclough.
3493
3494         Factor some basic JS interface logic out of JIT and into a superclass
3495         https://bugs.webkit.org/show_bug.cgi?id=38163
3496
3497         Create JSInterfaceJIT to hold some common low level functions for
3498         interacting with the JS RegisterFile.  Doing this separately from
3499         https://bugs.webkit.org/show_bug.cgi?id=38155 to ease reviewing.
3500
3501         * JavaScriptCore.xcodeproj/project.pbxproj:
3502         * jit/JIT.h:
3503         * jit/JITInlineMethods.h:
3504         (JSC::JIT::emitJumpSlowCaseIfNotJSCell):
3505         * jit/JSInterfaceJIT.h: Added.
3506         (JSC::JSInterfaceJIT::emitLoadJSCell):
3507         (JSC::JSInterfaceJIT::emitJumpIfNotJSCell):
3508         (JSC::JSInterfaceJIT::emitLoadInt32):
3509         (JSC::JSInterfaceJIT::tagFor):
3510         (JSC::JSInterfaceJIT::payloadFor):
3511         (JSC::JSInterfaceJIT::addressFor):
3512
3513 2010-04-26  Sam Weinig  <sam@webkit.org>
3514
3515         Fix Tiger build.
3516
3517         * wtf/mac/MainThreadMac.mm:
3518         (WTF::isMainThread):
3519
3520 2010-04-26  Geoffrey Garen  <ggaren@apple.com>
3521
3522         Reviewed by Sam Weinig.
3523
3524         <rdar://problem/7766413>
3525         
3526         Fixed a crash seen when using the JavaScriptCore API with WebKit.
3527         
3528         No layout test because DumpRenderTree doesn't use the JavaScriptCore API
3529         in this way.
3530
3531         * interpreter/RegisterFile.cpp:
3532         (JSC::RegisterFile::setGlobalObject):
3533         (JSC::RegisterFile::clearGlobalObject):
3534         (JSC::RegisterFile::globalObject):
3535         * interpreter/RegisterFile.h:
3536         (JSC::RegisterFile::RegisterFile): Use WeakGCPtr for managing m_globalObject,
3537         since it's a weak pointer. (We never noticed this error before because,
3538         in WebKit, global objects always have a self-reference in a global variable,
3539         so marking the register file's global variables would keep m_globalObject
3540         alive. In the JavaScriptCore API, you can allocate a global object with
3541         no self-reference.)
3542
3543         * runtime/JSActivation.h: Removed unneeded #include.
3544
3545         * runtime/JSGlobalObject.cpp:
3546         (JSC::JSGlobalObject::~JSGlobalObject): Don't use ==, since a weak
3547         pointer is 0 when the object it points to runs its destructor.
3548
3549         * runtime/WeakGCPtr.h:
3550         (JSC::WeakGCPtr::clear): Changed to return a bool indicating whether the
3551         clear actually happened.
3552         (JSC::WeakGCPtr::assign): Changed to forbid assignment of 0 as a shorthand
3553         for calling clear(). A client should never clear by assigning 0, since
3554         clear() should be conditional on whether the object doing the clearing
3555         is still pointed to by the weak pointer. (Otherwise, a zombie object might
3556         clear a pointer to a new, valid object.)
3557
3558 2010-04-25  Sam Weinig  <sam@webkit.org>
3559
3560         Reviewed by Maciej Stachowiak.
3561
3562         Fix for https://bugs.webkit.org/show_bug.cgi?id=38097
3563         Disentangle initializing the main thread from initializing threading
3564
3565         This is the first step in getting rid of the WEB_THREAD #define and
3566         paving the way to allowing mac both WebKit and WebKit2 to use the same
3567         WebCore.
3568
3569         * JavaScriptCore.exp: Export initializeMainThread and initializeMainThreadToProcessMainThread.
3570         * JavaScriptCore.xcodeproj/project.pbxproj: Sort files.
3571
3572         * wtf/MainThread.cpp:
3573         (WTF::mainThreadInitializationMutex):
3574         (WTF::mainThreadFunctionQueueMutex):
3575         (WTF::initializeMainThread):
3576         (WTF::deprecatedInitializeMainThread):
3577         * wtf/MainThread.h:
3578         Added Mac only initializeMainThreadToProcessMainThread which sets up callOnMainThread
3579         and isMainThead calls to assume that WebCore's main thread is also the
3580         process's main thread. Since it is possible that both initializeMainThread
3581         and initializeMainThreadToProcessMainThread could be called, the first one called
3582         wins (either will work).
3583
3584         * wtf/Threading.h: Moved to top of file.
3585
3586         * wtf/ThreadingPthreads.cpp:
3587         (WTF::initializeThreading): Remove call to initializeMainThread.
3588         * wtf/ThreadingWin.cpp:
3589         (WTF::initializeThreading): Ditto.
3590         * wtf/gtk/ThreadingGtk.cpp:
3591         (WTF::initializeThreading): Ditto.
3592
3593         * wtf/mac/MainThreadMac.mm:
3594         (WTF::initializeMainThreadPlatform):
3595         (WTF::initializeMainThreadToProcessMainThread):
3596         (WTF::scheduleDispatchFunctionsOnMainThread):
3597         (WTF::isMainThread):
3598         Add runtime switch between the old behavior of using the system's main
3599         thread and a stored pointer to the main thread. Tiger always uses the
3600         system's main thread.
3601
3602         * wtf/qt/ThreadingQt.cpp:
3603         (WTF::initializeThreading): Remove call to initializeMainThread.
3604         * wtf/win/MainThreadWin.cpp:
3605         (WTF::initializeMainThreadPlatform): Add call to initializeCurrentThreadInternal
3606         removed from initializeThreading.
3607
3608 2010-04-26  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
3609
3610         Reviewed by Kenneth Rohde Christiansen.
3611
3612         Fix a memory leak in the QScriptString.
3613
3614         QScriptStringPrivate's constructor shouldn't call JSStringRetain as
3615         QScriptConverter implicitly pass a JSStringRef ownership.
3616
3617         [Qt] QScriptStringPrivate c'tor problem
3618         https://bugs.webkit.org/show_bug.cgi?id=38110
3619
3620         * qt/api/qscriptstring_p.h:
3621         (QScriptStringPrivate::QScriptStringPrivate):
3622
3623 2010-04-24  Darin Adler  <darin@apple.com>
3624
3625         Reviewed by Dan Bernstein.
3626
3627         REGRESSION (r56560): Crash in parseFloat if passed invalid UTF-16 data
3628         https://bugs.webkit.org/show_bug.cgi?id=38083
3629         rdar://problem/7901044
3630
3631         Tests: fast/js/ToNumber.html
3632                fast/js/parseFloat.html
3633
3634         * runtime/JSGlobalObjectFunctions.cpp:
3635         (JSC::parseInt): Added a FIXME comment about a problem I noticed.
3636         (JSC::parseFloat): Added a FIXME comment about a problem I noticed;
3637         covered by test cases in the test I added.
3638         * runtime/UString.cpp:
3639         (JSC::UString::toDouble): Added FIXME comments about two problems I
3640         noticed; covered by test cases in the tests I added. Added a return
3641         statement so we don't crash when illegal UTF-16 sequences are present.
3642
3643 2010-04-24  Anton Muhin  <antonm@chromium.org>
3644
3645         Reviewed by Darin Adler.
3646
3647         Allow to construct HashTraits<WebCore::QualifiedName>::constructDeletedValue
3648
3649         Former implementation attempted to use AtomicString(HashTableDeletedValue)
3650         however those values cannot be used that way: one cannot construct
3651         QualifiedNameImpl out of such AtomicString as we'll try to lookup this string
3652         in the table, for example.
3653         https://bugs.webkit.org/show_bug.cgi?id=37722
3654
3655         * wtf/RefPtr.h: expose hash table deleted value
3656
3657 2010-04-23  Sam Weinig  <sam@webkit.org>
3658
3659         Reviewed by David Levin.
3660
3661         Fix for https://bugs.webkit.org/show_bug.cgi?id=38060
3662         Split up Threading.h
3663
3664         Move bits for of Threading.h into 3 new files.
3665         - Atomics.h for atomic operations.
3666         - ThreadSafeShared.h for the ThreadSafeShared class.
3667         - ThreadingPrimitives.h for the primitives and platform types.
3668
3669         Basic threading operations (creation, etc.) remain in Threading.h.
3670
3671         * GNUmakefile.am:
3672         * JavaScriptCore.gypi:
3673         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
3674         * JavaScriptCore.xcodeproj/project.pbxproj:
3675         * wtf/Atomics.h: Copied from wtf/Threading.h.
3676         * wtf/ThreadSafeShared.h: Copied from wtf/Threading.h.
3677         * wtf/Threading.h:
3678         * wtf/ThreadingPrimitives.h: Copied from wtf/Threading.h.
3679
3680 2010-04-23  Sam Weinig  <sam@webkit.org>
3681
3682         Fix Qt build.
3683
3684         * wtf/qt/MainThreadQt.cpp: #include <QThread>
3685
3686 2010-04-22  Sam Weinig  <sam@webkit.org>
3687
3688         Reviewed by Anders Carlsson.
3689
3690         Fix for https://bugs.webkit.org/show_bug.cgi?id=38022
3691         Move isMainThread predicate function to MainThread.h
3692
3693         * wtf/MainThread.cpp:
3694         (WTF::initializeMainThread):
3695         (WTF::isMainThread):
3696         * wtf/MainThread.h:
3697         * wtf/Threading.h:
3698         * wtf/ThreadingPthreads.cpp:
3699         (WTF::initializeThreading):
3700         * wtf/ThreadingWin.cpp:
3701         (WTF::initializeThreading):
3702         * wtf/gtk/ThreadingGtk.cpp:
3703         (WTF::initializeThreading):
3704         * wtf/mac/MainThreadMac.mm:
3705         (WTF::initializeMainThreadPlatform):
3706         (WTF::isMainThread):
3707         * wtf/qt/MainThreadQt.cpp:
3708         (WTF::isMainThread):
3709         * wtf/qt/ThreadingQt.cpp:
3710         (WTF::initializeThreading):
3711         * wtf/text/AtomicString.cpp:
3712
3713 2010-04-23  Gabor Rapcsanyi  <rgabor@inf.u-szeged.hu>
3714
3715         Reviewed by Laszlo Gombos.
3716
3717         Add RVCT support for Linux
3718
3719         Developed in cooperation with Gabor Loki.
3720
3721         * API/JSStringRef.h:
3722         * jit/ExecutableAllocator.h:
3723         * jit/ExecutableAllocatorPosix.cpp:
3724         (JSC::ExecutableAllocator::cacheFlush):
3725         * jit/JITStubs.cpp:
3726         * wtf/MathExtras.h:
3727         * wtf/unicode/qt4/UnicodeQt4.h:
3728
3729 2010-04-23  Patrick Gansterer  <paroga@paroga.com>
3730
3731         Reviewed by Laszlo Gombos.
3732
3733         [WIN] Move OwnPtrWin.cpp into platform specific folder.
3734         https://bugs.webkit.org/show_bug.cgi?id=38042
3735
3736         * JavaScriptCore.gypi:
3737         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
3738         * wtf/OwnPtrWin.cpp: Removed.
3739         * wtf/win/OwnPtrWin.cpp: Copied from JavaScriptCore/wtf/OwnPtrWin.cpp.
3740
3741 2010-04-23  Patrick Gansterer  <paroga@paroga.com>
3742
3743         Reviewed by Laszlo Gombos.
3744
3745         [BREWMP] Move OwnPtrBrew.cpp into platform specific folder.
3746         https://bugs.webkit.org/show_bug.cgi?id=38042
3747
3748         * wtf/OwnPtrBrew.cpp: Removed.
3749         * wtf/brew/OwnPtrBrew.cpp: Copied from JavaScriptCore/wtf/OwnPtrBrew.cpp.
3750
3751 2010-04-22  Steve Block  <steveblock@google.com>
3752
3753         Reviewed by Adam Barth.
3754
3755         Update Android to use isfinite, isinf, isnan and signbit from namespace std.
3756         https://bugs.webkit.org/show_bug.cgi?id=37948
3757
3758         * wtf/MathExtras.h:
3759
3760 2010-04-22  Fumitoshi Ukai  <ukai@chromium.org>
3761
3762         Unreviewed build fix.
3763
3764         * wtf/MD5.cpp: fix include path of CString.h
3765
3766 2010-04-22  Fumitoshi Ukai  <ukai@chromium.org>
3767
3768         Reviewed by Adam Barth.
3769
3770         MD5 is required for WebSocket new protocol implementation
3771         https://bugs.webkit.org/show_bug.cgi?id=37913
3772
3773         * GNUmakefile.am:
3774         * JavaScriptCore.exp:
3775         * JavaScriptCore.gypi:
3776         * JavaScriptCore.pro:
3777         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3778         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
3779         * JavaScriptCore.xcodeproj/project.pbxproj:
3780         * wtf/MD5.cpp: Added.
3781         * wtf/MD5.h: Added.
3782
3783 2010-04-22  Gavin Barraclough  <barraclough@apple.com>
3784
3785         Reviewed by NOBODY (build fix).
3786         Errk, accidentally committed commenting out two ASSERTs! reverting.
3787
3788         * runtime/Collector.cpp:
3789         (JSC::Heap::protect):
3790         (JSC::Heap::unprotect):
3791
3792 2010-04-22  Gavin Barraclough  <barraclough@apple.com>
3793
3794         Reviewed by Geoff Garen.
3795
3796         https://bugs.webkit.org/show_bug.cgi?id=38006
3797         Change lifetime of JSC::IdentifierTables used by WebCores to match AtomicStringTable
3798
3799         Presently JSC's IdentifierTables are owned by the JSGlobalData.  For
3800         JSGlobalData objects created via the API this should continue to be the case,
3801         but for the JSGlobalData objects used by WebCore (the main thread's common
3802         global data, and those for workers) use a IdentifierTable provided (and owned)
3803         by wtfThreadData.  This allow the lifetime of these IdentifierTable to match
3804         those of the corresponding AtomicStringTables.
3805
3806         * API/APIShims.h:
3807         (JSC::APIEntryShim::APIEntryShim):
3808         * API/JSContextRef.cpp:
3809         (JSContextGroupCreate):
3810         * runtime/Collector.cpp:
3811         (JSC::Heap::protect):
3812         (JSC::Heap::unprotect):
3813         (JSC::Heap::markRoots):
3814         * runtime/JSGlobalData.cpp:
3815         (JSC::JSGlobalData::JSGlobalData):
3816         (JSC::JSGlobalData::~JSGlobalData):
3817         (JSC::JSGlobalData::createContextGroup):
3818         (JSC::JSGlobalData::create):
3819         (JSC::JSGlobalData::sharedInstance):
3820         * runtime/JSGlobalData.h:
3821         (JSC::JSGlobalData::):
3822         (JSC::JSGlobalData::isSharedInstance):
3823         * runtime/JSLock.cpp:
3824         (JSC::JSLock::JSLock):
3825         (JSC::JSLock::lock):
3826         (JSC::JSLock::unlock):
3827         (JSC::JSLock::DropAllLocks::DropAllLocks):
3828         * wtf/WTFThreadData.cpp:
3829         (WTF::WTFThreadData::WTFThreadData):
3830         (WTF::WTFThreadData::~WTFThreadData):
3831
3832 2010-04-22  Sheriff Bot  <webkit.review.bot@gmail.com>
3833
3834         Unreviewed, rolling out r58110.
3835         http://trac.webkit.org/changeset/58110
3836         https://bugs.webkit.org/show_bug.cgi?id=38007
3837
3838         Caused an internal compiler error on Qt (Requested by abarth
3839         on #webkit).
3840
3841         * wtf/MathExtras.h:
3842
3843 2010-04-22  Gavin Barraclough  <barraclough@apple.com>
3844
3845         Reviewed by NOBODY (windows build fix).
3846
3847         * API/JSWeakObjectMapRefPrivate.cpp:
3848
3849 2010-04-22  Gavin Barraclough  <barraclough@apple.com>
3850
3851         Reviewed by NOBODY (windows build fix).
3852
3853         * API/JSBase.cpp:
3854         * API/JSCallbackObject.cpp:
3855
3856 2010-04-22  Gavin Barraclough  <barraclough@apple.com>
3857
3858         Reviewed by Geoff Garen.
3859
3860         https://bugs.webkit.org/show_bug.cgi?id=37978
3861         Unify JSC::IdentifierTable and WebCore::AtomicStringTable implementations.
3862
3863         These two classes both implement a HashSet of uniqued StringImpls, with
3864         translator classes to avoid unnecessary object creation. The only difference
3865         between the classes is which flag (isIdentifier or inTable) is set.
3866         Combine the two classes using a template predicated on which flag to use.
3867
3868         New class AtomicStringTable created, containing all the goodness from
3869         IdentifierTable & AtomicStringTable, expect for Identifier's literalTable,
3870         which has been moved onto JSGlobalData. Removed duplicate string translator
3871         classes. Renamed StringImpl's inTable flag to more explicit 'isAtomic',
3872         and set this on the empty string (which matches Identifier behaviour, and
3873         removes a redundant check for zero-length).
3874
3875         * GNUmakefile.am:
3876         * JavaScriptCore.gypi:
3877         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
3878         * JavaScriptCore.xcodeproj/project.pbxproj:
3879         * runtime/Identifier.cpp:
3880         (JSC::createLiteralTable):
3881         (JSC::deleteLiteralTable):
3882         (JSC::Identifier::add):
3883         (JSC::Identifier::addSlowCase):
3884         * runtime/Identifier.h:
3885         * runtime/JSGlobalData.cpp:
3886         (JSC::JSGlobalData::JSGlobalData):
3887         (JSC::JSGlobalData::~JSGlobalData):
3888         * runtime/JSGlobalData.h:
3889         * wtf/WTFThreadData.cpp:
3890         (WTF::WTFThreadData::WTFThreadData):
3891         (WTF::WTFThreadData::~WTFThreadData):
3892         * wtf/WTFThreadData.h:
3893         (WTF::WTFThreadData::atomicStringTable):
3894         * wtf/text/AtomicString.cpp:
3895         (WebCore::table):
3896         (WebCore::operator==):
3897         (WebCore::AtomicString::add):
3898         (WebCore::AtomicString::find):
3899         (WebCore::AtomicString::remove):
3900         * wtf/text/AtomicStringTable.h: Added.
3901         (WTF::CStringTranslator::hash):
3902         (WTF::CStringTranslator::equal):
3903         (WTF::CStringTranslator::translate):
3904         (WTF::UCharBufferTranslator::hash):
3905         (WTF::UCharBufferTranslator::equal):
3906         (WTF::UCharBufferTranslator::translate):
3907         (WTF::HashAndCharactersTranslator::hash):
3908         (WTF::HashAndCharactersTranslator::equal):
3909         (WTF::HashAndCharactersTranslator::translate):
3910         (WTF::IdentifierOrAtomicStringTable::remove):
3911         (WTF::::~IdentifierOrAtomicStringTable):
3912         (WTF::::add):
3913         (WTF::::find):
3914         * wtf/text/StringImpl.cpp:
3915         (WebCore::StringImpl::~StringImpl):
3916         * wtf/text/StringImpl.h:
3917         (WebCore::StringImpl::isAtomic):
3918         (WebCore::StringImpl::setIsAtomic):
3919         (WebCore::equal):
3920         * wtf/text/StringImplBase.h:
3921         (WTF::StringImplBase::StringImplBase):
3922
3923 2010-04-22  Steve Block  <steveblock@google.com>
3924
3925         Reviewed by Adam Barth.
3926
3927         Update Android to use isfinite, isinf, isnan and signbit from namespace std.
3928         https://bugs.webkit.org/show_bug.cgi?id=37948
3929
3930         * wtf/MathExtras.h:
3931
3932 2010-04-22  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
3933
3934         Reviewed by Kenneth Rohde Christiansen.
3935
3936         [Qt] Remove dependency of JSC to QtGui
3937         https://bugs.webkit.org/show_bug.cgi?id=37867
3938
3939         The patch also make sure that hal.h is in the include path on Symbian.
3940         The dependency to QtGui took care of that before.
3941
3942         Patch by Thiago Macieira <thiago.macieira@nokia.com>
3943              and Rohan McGovern <rohan.mcgovern@nokia.com>
3944
3945         * JavaScriptCore.pri:
3946         * JavaScriptCore.pro:
3947
3948 2010-04-22  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
3949
3950         Reviewed by Tor Arne Vestbø.
3951
3952         [Qt] Corrects symbols visibility for JavaScriptCore.
3953
3954         https://bugs.webkit.org/show_bug.cgi?id=37867
3955
3956         * JavaScriptCore.pro:
3957
3958 2010-04-22  Gabor Loki  <loki@webkit.org>
3959
3960         Reviewed by Gavin Barraclough.
3961
3962         Use BLX and BX to keep happy the return stack predictor above ARMv4
3963         https://bugs.webkit.org/show_bug.cgi?id=37862
3964
3965         Inspired by Jacob Bramley's patch from JaegerMonkey
3966
3967         * assembler/ARMAssembler.cpp:
3968         (JSC::ARMAssembler::executableCopy):
3969         * assembler/ARMAssembler.h:
3970         (JSC::ARMAssembler::):
3971         (JSC::ARMAssembler::bx):
3972         (JSC::ARMAssembler::blx):
3973         (JSC::ARMAssembler::loadBranchTarget):
3974         (JSC::ARMAssembler::jmp):
3975         (JSC::ARMAssembler::getLdrImmAddress):
3976         * assembler/MacroAssemblerARM.h:
3977         (JSC::MacroAssemblerARM::jump):
3978         (JSC::MacroAssemblerARM::nearCall):
3979         (JSC::MacroAssemblerARM::call):
3980         (JSC::MacroAssemblerARM::ret):
3981         (JSC::MacroAssemblerARM::prepareCall):
3982         (JSC::MacroAssemblerARM::call32):
3983
3984 2010-04-21  Andy Estes  <aestes@apple.com>
3985
3986         Rubber stamped by Mark Rowe.
3987
3988         Export WTF::deleteOwnedPtr(HFONT).
3989
3990         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3991
3992 2010-04-21  Gavin Barraclough  <barraclough@apple.com>
3993
3994         Rubber Stamped by Oliver Hunt.
3995
3996         Make SmallStrings store an array of RefPtr<StringImpl>,
3997         instead of a direct array of StringImpls.  This allows
3998         us to remove a friend (and a layering violation) from
3999         WTF::StringImpl, and makes it so that all StringImpls
4000         are individually heap allocated.
4001
4002         * runtime/SmallStrings.cpp:
4003         (JSC::SmallStringsStorage::rep):
4004         (JSC::SmallStringsStorage::SmallStringsStorage):
4005         * wtf/text/StringImpl.h:
4006
4007 2010-04-21  Sam Weinig  <sam@webkit.org>
4008
4009         Reviewed by Geoffrey Garen.
4010
4011         Fix for https://bugs.webkit.org/show_bug.cgi?id=37937
4012         Wean JavaScriptCore off calls to isMainThread()
4013
4014         - Replace use of isMainThread() for interpreter reentry checks
4015           with a stored value on the JSGlobalData.
4016         - Replace use of isMainThread() for useMainThread only check in the
4017           collector with a stored exclusive thread.
4018
4019         * API/JSContextRef.cpp:
4020         (JSContextGroupCreate):
4021         Always default to a small stack type for uses of the JSC API. It is
4022         unlikely that the interpreter reentry required on the web will be as
4023         important for other uses of JavaScriptCore. 
4024
4025         * JavaScriptCore.exp: 
4026         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
4027         Update exports.
4028
4029         * interpreter/Interpreter.cpp:
4030         (JSC::Interpreter::execute):
4031         (JSC::Interpreter::prepareForRepeatCall):
4032         Use new stored JSGlobalData::maxReentryDepth instead of isMainThread().
4033
4034         * interpreter/Interpreter.h:
4035         Rename MaxMainThreadReentryDepth to MaxLargeThreadReentryDepth and 
4036         MaxSecondaryThreadReentryDepth to MaxSmallThreadReentryDepth.
4037
4038         * jsc.cpp:
4039         (main): Use the a large stack for jsc since it is always using the
4040         main thread.
4041         
4042         * runtime/ArrayPrototype.cpp:
4043         (JSC::arrayProtoFuncToString):
4044         (JSC::arrayProtoFuncToLocaleString):
4045         (JSC::arrayProtoFuncJoin):
4046         Use new stored JSGlobalData::maxReentryDepth instead of isMainThread().
4047
4048         * runtime/Collector.cpp:
4049         (JSC::Heap::registerThread):
4050         Use the concept of making JSC run on an exclusiveThread instead of
4051         forcing a mainThreadOnly assertion.
4052         
4053         * runtime/JSGlobalData.cpp:
4054         (JSC::JSGlobalData::JSGlobalData):
4055         (JSC::JSGlobalData::createNonDefault):
4056         (JSC::JSGlobalData::create):
4057         (JSC::JSGlobalData::createLeaked):
4058         (JSC::JSGlobalData::sharedInstance):
4059         * runtime/JSGlobalData.h:
4060         Add ThreadStackType argument to JSGlobalData constructors and set
4061         maxReentryDepth based on it.
4062
4063 2010-04-21  Gavin Barraclough  <barraclough@apple.com>
4064
4065         Reviewed by NOBODY (windows build fix pt. 3).
4066
4067         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
4068
4069 2010-04-21  Gavin Barraclough  <barraclough@apple.com>
4070
4071         Reviewed by NOBODY (windows build fix pt. 2).
4072
4073         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
4074
4075 2010-04-21  Gavin Barraclough  <barraclough@apple.com>
4076
4077         Reviewed by NOBODY (Qt build fix).
4078
4079         * JavaScriptCore.gypi:
4080         * JavaScriptCore.pro:
4081         * wtf/qt/StringQt.cpp: Copied from WebCore/platform/text/qt/StringQt.cpp.
4082
4083 2010-04-21  Gavin Barraclough  <barraclough@apple.com>
4084
4085         Reviewed by NOBODY (windows build fix).
4086
4087         * API/JSValueRef.cpp:
4088         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
4089         * runtime/Identifier.cpp:
4090         (JSC::IdentifierTable::~IdentifierTable):
4091         (JSC::IdentifierTable::add):
4092         * runtime/Identifier.h:
4093         * wtf/WTFThreadData.h:
4094         (JSC::IdentifierTable::remove):
4095         (JSC::IdentifierTable::literalTable):
4096         * wtf/text/StringImpl.cpp:
4097         (WebCore::StringImpl::~StringImpl):
4098
4099 2010-04-20  Gavin Barraclough  <barraclough@apple.com>
4100
4101         Reviewed by Oliver Hunt, Darin Adler.
4102
4103         Bug 37906 - Remove JSC::UStringImpl; unify with StringImpl.
4104
4105         JSC::UStringImpl and WebCore::StringImpl (soon to be renamed to
4106         WTF::StringImpl) are almost identical.  Remove duplication of code by unifying
4107         the two, move missing features from UStringImpl into StringImpl & delete the
4108         class UStringImpl.
4109
4110         * API/JSClassRef.cpp:
4111         * API/JSContextRef.cpp:
4112         * GNUmakefile.am:
4113         * JavaScriptCore.exp:
4114         * JavaScriptCore.pro:
4115         * JavaScriptCore.xcodeproj/project.pbxproj:
4116         * bytecode/EvalCodeCache.h:
4117         * bytecode/JumpTable.cpp:
4118         * profiler/ProfileNode.cpp:
4119         * runtime/Identifier.cpp:
4120         (JSC::Identifier::add):
4121         * runtime/Identifier.h:
4122         (JSC::Identifier::equal):
4123         * runtime/UString.cpp:
4124         * runtime/UString.h:
4125         (WTF::):
4126         * runtime/UStringImpl.cpp: Removed.
4127         * runtime/UStringImpl.h:
4128         * wtf/text/StringHash.h:
4129         (WebCore::StringHash::equal):
4130         (WebCore::CaseFoldingHash::equal):
4131         * wtf/text/StringImpl.cpp:
4132         (WebCore::StringImpl::~StringImpl):
4133         (WebCore::StringImpl::empty):
4134         (WebCore::StringImpl::sharedBuffer):
4135         (WebCore::equal):
4136         * wtf/text/StringImpl.h:
4137         (WebCore::StringImpl::StringImpl):
4138         (WebCore::StringImpl::create):
4139         (WebCore::StringImpl::tryCreateUninitialized):
4140         (WebCore::StringImpl::cost):
4141         (WebCore::StringImpl::isIdentifier):
4142         (WebCore::StringImpl::setIsIdentifier):
4143         (WebCore::StringImpl::computeHash):
4144         (WebCore::StringImpl::copyChars):
4145         (WebCore::StringImpl::):
4146
4147 2010-04-21  Patrick Gansterer  <paroga@paroga.com>
4148
4149         Reviewed by Darin Adler.
4150
4151         Added missing #include "Lookup.h" in LUT source files.
4152         https://bugs.webkit.org/show_bug.cgi?id=37903
4153
4154         * runtime/ArrayPrototype.cpp:
4155         * runtime/DatePrototype.cpp:
4156         * runtime/JSONObject.cpp:
4157         * runtime/MathObject.cpp:
4158         * runtime/NumberConstructor.cpp:
4159         * runtime/RegExpConstructor.cpp:
4160         * runtime/RegExpObject.cpp:
4161         * runtime/StringPrototype.cpp:
4162
4163 2010-04-21  Gustavo Sverzut Barbieri  <barbieri@profusion.mobi>
4164
4165         Reviewed by Nikolas Zimmermann.
4166
4167         Add missing EFL JavaScriptCore file.
4168         http://webkit.org/b/37854
4169
4170         * wtf/efl: Added.
4171         * wtf/efl/MainThreadEfl.cpp: Added.
4172         (WTF::initializeMainThreadPlatform):
4173         (WTF::timeoutFired):
4174         (WTF::scheduleDispatchFunctionsOnMainThread):
4175
4176 2010-04-20  Xan Lopez  <xlopez@igalia.com>
4177
4178         Another attempt to fix the build.
4179
4180         * GNUmakefile.am:
4181
4182 2010-04-20  Oliver Hunt  <oliver@apple.com>
4183
4184         Reviewed by Maciej Stachowiak.
4185
4186         [ES5] RegExp literals are constants that should be persistent across multiple function calls.
4187         https://bugs.webkit.org/show_bug.cgi?id=37908
4188
4189         Dump the separate RegExp constant pool, and just use the standard JS constant pool
4190         in codeblock.  This allows us to drop op_new_regexp and all associated code as well.
4191
4192         * bytecode/CodeBlock.cpp:
4193         (JSC::CodeBlock::dump):
4194         (JSC::CodeBlock::shrinkToFit):
4195         * bytecode/CodeBlock.h:
4196         * bytecode/Opcode.h:
4197         * bytecompiler/BytecodeGenerator.cpp:
4198         (JSC::BytecodeGenerator::emitLoad):
4199         * bytecompiler/BytecodeGenerator.h:
4200         * bytecompiler/NodesCodegen.cpp:
4201         (JSC::RegExpNode::emitBytecode):
4202         * interpreter/Interpreter.cpp:
4203         (JSC::Interpreter::privateExecute):
4204         * jit/JIT.cpp:
4205         (JSC::JIT::privateCompileMainPass):
4206         * jit/JIT.h:
4207         * jit/JITOpcodes.cpp:
4208         * jit/JITStubs.cpp:
4209         * jit/JITStubs.h:
4210         (JSC::):
4211
4212 2010-04-20  Oliver Hunt  <oliver@apple.com>
4213
4214         Fix license on create_regex_tables
4215
4216         * create_regex_tables:
4217
4218 2010-04-20  Oliver Hunt  <oliver@apple.com>
4219
4220         Reviewed by NOBODY (Build fix).
4221
4222         Fix gtk
4223
4224         * GNUmakefile.am:
4225         * make-generated-sources.sh:
4226
4227 2010-04-20  Gavin Barraclough  <barraclough@apple.com>
4228
4229         Reviewed by Oliver Hunt.
4230
4231         Bug 37895 - Share common code from UStringImplBase with StringImpl
4232
4233         The implementation of StringImpl & UStringImpl is very similar.  Restructure
4234         StringImpl to match UStringImpl, moving the flags and length into a base class,
4235         so that this can be shared between both string types to increase code reuse.
4236
4237         * JavaScriptCore.xcodeproj/project.pbxproj:
4238         * runtime/RopeImpl.h:
4239         (JSC::RopeImpl::RopeImpl):
4240         * runtime/UStringImpl.h:
4241         (JSC::UStringImpl::UStringImpl):
4242         * wtf/text/StringImpl.h:
4243         (WebCore::StringImpl::StringImpl):
4244         (WebCore::StringImpl::characters):
4245         * wtf/text/StringImplBase.h: Copied from JavaScriptCore/runtime/UStringImpl.h.
4246         (WTF::StringImplBase::length):
4247         (WTF::StringImplBase::operator new):
4248         (WTF::StringImplBase::StringImplBase):
4249
4250 2010-04-20  Oliver Hunt  <oliver@apple.com>
4251
4252         Reviewed by Gavin Barraclough.
4253
4254         Autogenerate yarr character tables
4255         https://bugs.webkit.org/show_bug.cgi?id=37877
4256
4257         Use a python script to automatically generate character tables
4258         for the builtin YARR character classes.  This allows us to generate
4259         actual tables as well, by using these tables we can both increase
4260         performance of the check (for complex builtins) and reduce the actual
4261         code size.
4262
4263         4-8% win on string-unpack-code, but lots of noise on other tests so
4264         i'm only confident saying its a 1% win overall.
4265
4266         * DerivedSources.make:
4267         * JavaScriptCore.xcodeproj/project.pbxproj:
4268         * assembler/AbstractMacroAssembler.h:
4269         (JSC::AbstractMacroAssembler::ExtendedAddress::ExtendedAddress):
4270         * assembler/MacroAssembler.h:
4271         (JSC::MacroAssembler::branchTest8):
4272         * assembler/MacroAssemblerX86Common.h:
4273         (JSC::MacroAssemblerX86Common::branchTest8):
4274         * assembler/MacroAssemblerX86_64.h:
4275         (JSC::MacroAssemblerX86_64::branchTest8):
4276         * assembler/X86Assembler.h:
4277         (JSC::X86Assembler::cmpb_im):
4278         (JSC::X86Assembler::testb_im):
4279         * bytecode/SamplingTool.cpp:
4280         (JSC::SamplingTool::dump):
4281         * create_regex_tables: Added.
4282         * yarr/RegexCompiler.cpp:
4283         (JSC::Yarr::CharacterClassConstructor::charClass):
4284         * yarr/RegexJIT.cpp:
4285         (JSC::Yarr::RegexGenerator::matchCharacterClass):
4286         (JSC::Yarr::RegexGenerator::generatePatternCharacterGreedy):
4287         (JSC::Yarr::RegexGenerator::generatePatternCharacterNonGreedy):
4288         (JSC::Yarr::RegexGenerator::generateCharacterClassGreedy):
4289         * yarr/RegexPattern.h:
4290         (JSC::Yarr::CharacterClassTable::create):
4291         (JSC::Yarr::CharacterClassTable::CharacterClassTable):
4292         (JSC::Yarr::CharacterClass::CharacterClass):
4293
4294 2010-04-20  Gavin Barraclough  <barraclough@apple.com>
4295
4296         Reviewed by NOBODY (speculative windows fix - missed a bit!).
4297
4298         * wtf/text/AtomicString.h:
4299
4300 2010-04-20  Gavin Barraclough  <barraclough@apple.com>
4301
4302         Reviewed by NOBODY (speculative windows fix).
4303
4304         * wtf/text/AtomicString.h:
4305
4306 2010-04-20  Gavin Barraclough  <barraclough@apple.com>
4307
4308         Reviewed by NOBODY (windows build fix).
4309
4310         Add missing .def file entries.
4311
4312         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
4313
4314 2010-04-20  Gavin Barraclough  <barraclough@apple.com>
4315
4316         Reviewed by Geoff Garen.
4317
4318         Bug 37869 - Move URopeImpl to its own .h/.cpp
4319         
4320         Currently Ropes are implemented by the class URopeImpl, which is defined in
4321         UStringImpl.h, and then typedefed to the name JSString::Rope. Remove the
4322         typedef, and rename all uses of URopeImpl and JSString::Rope to just RopeImpl.
4323
4324         Move RopeImpl to its own header, and remove all remaining references to ropes
4325         from UStringImpl (rename UStringOrRopeImpl to UStringImplBase, rename or move
4326         the isRope & deref methods from UStringOrRopeImpl).
4327
4328         * JavaScriptCore.xcodeproj/project.pbxproj:
4329         * runtime/JSString.cpp:
4330         (JSC::JSString::resolveRope):
4331         * runtime/JSString.h:
4332         (JSC::):
4333         (JSC::RopeBuilder::JSString):
4334         (JSC::RopeBuilder::~JSString):
4335         (JSC::RopeBuilder::appendStringInConstruct):
4336         (JSC::RopeBuilder::JSStringFinalizerStruct::):
4337         * runtime/RopeImpl.cpp: Copied from JavaScriptCore/runtime/UStringImpl.cpp.
4338         (JSC::RopeImpl::derefFibersNonRecursive):
4339         (JSC::RopeImpl::destructNonRecursive):
4340         * runtime/RopeImpl.h: Copied from JavaScriptCore/runtime/UStringImpl.h.
4341         (JSC::RopeImpl::tryCreateUninitialized):
4342         (JSC::RopeImpl::isRope):
4343         (JSC::RopeImpl::deref):
4344         (JSC::RopeImpl::RopeImpl):
4345         * runtime/UStringImpl.cpp:
4346         * runtime/UStringImpl.h:
4347         (JSC::UStringImplBase::isInvalid):
4348         (JSC::UStringImplBase::ref):
4349         (JSC::UStringImplBase::UStringImplBase):
4350         (JSC::UStringImplBase::):
4351         (JSC::UStringImpl::UStringImpl):
4352
4353 2010-04-20  Gavin Barraclough  <barraclough@apple.com>
4354
4355         Reviewed by Geoff Garen.
4356
4357         Bug 37828 - Move WebCore's String classes to WTF
4358
4359         Move these classes up to WTF so they are available to all clients of WTF (in
4360         particular JSC).
4361
4362         As a first patch, making the most minimal change possible, since this patch
4363         could easily grow rather large since we'll have to change every class forward
4364         declaration ( e.g. every "namespace WebCore { class String; }" much change to
4365         "namespace WTF { class String; }").
4366
4367         Moving the files, but leaving the classes logically in the WebCore namespace -
4368         which is technically a layering violation - I'll come back and fix this up in a
4369         subsequent patch.
4370
4371         * Android.mk:
4372         * Android.v8.wtf.mk:
4373         * GNUmakefile.am:
4374         * JavaScriptCore.exp:
4375         * JavaScriptCore.gypi:
4376         * JavaScriptCore.pro:
4377         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
4378         * JavaScriptCore.xcodeproj/project.pbxproj:
4379         * config.h:
4380         * wtf/StaticConstructors.h: Copied from WebCore/platform/StaticConstructors.h.
4381         * wtf/text/AtomicString.cpp: Copied from WebCore/platform/text/AtomicString.cpp.
4382         * wtf/text/AtomicString.h: Copied from WebCore/platform/text/AtomicString.h.
4383         * wtf/text/AtomicStringImpl.h: Copied from WebCore/platform/text/AtomicStringImpl.h.
4384         * wtf/text/StringBuffer.h: Copied from WebCore/platform/text/StringBuffer.h.
4385         * wtf/text/StringHash.h: Copied from WebCore/platform/text/StringHash.h.
4386         * wtf/text/StringImpl.cpp: Copied from WebCore/platform/text/StringImpl.cpp.
4387         * wtf/text/StringImpl.h: Copied from WebCore/platform/text/StringImpl.h.
4388         * wtf/text/WTFString.cpp: Copied from WebCore/platform/text/String.cpp.
4389         (WebCore::charactersToFloat):
4390         * wtf/text/WTFString.h: Copied from WebCore/platform/text/PlatformString.h.
4391
4392 2010-04-20  Csaba Osztrogonác  <ossy@webkit.org>
4393
4394         [Qt] Unreviewed speculative buildfix for WinCE after r57882
4395         https://bugs.webkit.org/show_bug.cgi?id=37701
4396
4397         * JavaScriptCore.pri: missing wince* case added.
4398
4399 2010-04-20  Gavin Barraclough  <barraclough@apple.com>
4400
4401         Reviewed by NOBODY (build fix).
4402         Speculative Chromium/Win build fix, attempt #2.
4403
4404         * config.h:
4405
4406 2010-04-20  Gavin Barraclough  <barraclough@apple.com>
4407
4408         Reviewed by NOBODY (build fix).
4409         Speculative Chromium/Win build fix.
4410
4411         * config.h: JS_EXPORTDATA should do nothing on !JSC builds.
4412
4413 2010-04-20  Csaba Osztrogonác  <ossy@webkit.org>
4414
4415         Reviewed by Simon Hausmann.
4416
4417         [Qt] Target(WebCore,jsc,...) must depends on static library of JavaScriptCore
4418         https://bugs.webkit.org/show_bug.cgi?id=37701
4419
4420         * JavaScriptCore.pri: dependency added.
4421
4422 2010-04-20  Gavin Barraclough  <barraclough@apple.com>
4423
4424         Rubber stamped by Maciej Stachowiak (relanding r57829).
4425         Added missing JS_EXPORTDATA
4426
4427         * API/APIShims.h:
4428         (JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock):
4429         (JSC::APIEntryShimWithoutLock::~APIEntryShimWithoutLock):
4430         (JSC::APICallbackShim::APICallbackShim):
4431         (JSC::APICallbackShim::~APICallbackShim):
4432         * API/JSContextRef.cpp:
4433         * Android.mk:
4434         * Android.v8.wtf.mk:
4435         * GNUmakefile.am:
4436         * JavaScriptCore.exp:
4437         * JavaScriptCore.gypi:
4438         * JavaScriptCore.pro:
4439         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
4440         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
4441         * JavaScriptCore.xcodeproj/project.pbxproj:
4442         * runtime/Completion.cpp:
4443         (JSC::checkSyntax):
4444         (JSC::evaluate):
4445         * runtime/Identifier.cpp:
4446         (JSC::Identifier::remove):
4447         (JSC::Identifier::checkCurrentIdentifierTable):
4448         * runtime/Identifier.h:
4449         * runtime/InitializeThreading.cpp:
4450         (JSC::initializeThreadingOnce):
4451         * runtime/JSGlobalData.cpp:
4452         (JSC::JSGlobalData::create):
4453         * wtf/WTFThreadData.cpp: Copied from JavaScriptCore/wtf/WTFThreadData.cpp.
4454         * wtf/WTFThreadData.h: Copied from JavaScriptCore/wtf/WTFThreadData.h.
4455
4456 2010-04-19  Gavin Barraclough  <barraclough@apple.com>
4457
4458         Reviewed by NOBODY (rolling out r57829).
4459         This broke windows.
4460
4461         * API/APIShims.h:
4462         (JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock):
4463         (JSC::APIEntryShimWithoutLock::~APIEntryShimWithoutLock):
4464         (JSC::APICallbackShim::APICallbackShim):
4465         (JSC::APICallbackShim::~APICallbackShim):
4466         * API/JSContextRef.cpp:
4467         * Android.mk:
4468         * Android.v8.wtf.mk:
4469         * GNUmakefile.am:
4470         * JavaScriptCore.exp:
4471         * JavaScriptCore.gypi:
4472         * JavaScriptCore.pro:
4473         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
4474         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
4475         * JavaScriptCore.xcodeproj/project.pbxproj:
4476         * runtime/Completion.cpp:
4477         (JSC::checkSyntax):
4478         (JSC::evaluate):
4479         * runtime/Identifier.cpp:
4480         (JSC::Identifier::remove):
4481         (JSC::Identifier::checkCurrentIdentifierTable):
4482         (JSC::createIdentifierTableSpecificCallback):
4483         (JSC::createIdentifierTableSpecific):
4484         * runtime/Identifier.h:
4485         (JSC::ThreadIdentifierTableData::ThreadIdentifierTableData):
4486         (JSC::defaultIdentifierTable):
4487         (JSC::setDefaultIdentifierTable):
4488         (JSC::currentIdentifierTable):
4489         (JSC::setCurrentIdentifierTable):
4490         (JSC::resetCurrentIdentifierTable):
4491         * runtime/InitializeThreading.cpp:
4492         (JSC::initializeThreadingOnce):
4493         * runtime/JSGlobalData.cpp:
4494         (JSC::JSGlobalData::create):
4495         * wtf/WTFThreadData.cpp: Removed.
4496         * wtf/WTFThreadData.h: Removed.
4497
4498 2010-04-19  Douglas Gregor  <dgregor@apple.com>
4499
4500         Reviewed and landed by Anders Carlsson.
4501
4502         * runtime/UStringImpl.h:
4503         Fix class/struct declaration mismatches.
4504
4505 2010-04-19  Geoffrey Garen  <ggaren@apple.com>
4506
4507         Reviewed by Beth Dakin.
4508
4509         Checked in these tests I wrote becuase Balazs Kelemen wanted to use them.
4510
4511         * tests/perf: Added.
4512         * tests/perf/bench-allocate-nonretained.js: Added.
4513         * tests/perf/bench-allocate-retained.js: Added.
4514
4515 2010-04-19  Gavin Barraclough  <barraclough@apple.com>
4516
4517         Reviewed by NOBODY (windows build fix).
4518
4519         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
4520
4521 2010-04-16  Gavin Barraclough  <barraclough@apple.com>
4522
4523         Reviewed by Sam Weinig.
4524
4525         https://bugs.webkit.org/show_bug.cgi?id=37745
4526         Move string uniquing tables to (new) WTFThreadData class.
4527
4528         Remove AtomicString's dependency on ThreadGlobalData so that we can move
4529         WebCore's string classes up to WTF.
4530
4531         WTFThreadData.cpp/.h are based on ThreadGlobalData from WebCore.
4532         Moved JSC & WebCore's string uniquing tables to this class.
4533
4534         This patch introduces a temporary layering violation in providing forward
4535         declarations of classes from JSC and WTF; this will be resolved as we move
4536         more string code up to WTF.
4537
4538         * API/APIShims.h:
4539         (JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock):
4540         (JSC::APIEntryShimWithoutLock::~APIEntryShimWithoutLock):
4541         (JSC::APICallbackShim::APICallbackShim):
4542         (JSC::APICallbackShim::~APICallbackShim):
4543         * API/JSContextRef.cpp:
4544         * JavaScriptCore.exp:
4545         * JavaScriptCore.xcodeproj/project.pbxproj:
4546         * runtime/Completion.cpp:
4547         (JSC::checkSyntax):
4548         (JSC::evaluate):
4549         * runtime/Identifier.cpp:
4550         (JSC::Identifier::remove):
4551         (JSC::Identifier::checkCurrentIdentifierTable):
4552         * runtime/Identifier.h:
4553         * runtime/InitializeThreading.cpp:
4554         (JSC::initializeThreadingOnce):
4555         * runtime/JSGlobalData.cpp:
4556         (JSC::JSGlobalData::create):
4557         * wtf/WTFThreadData.cpp: Copied from WebCore/platform/ThreadGlobalData.cpp.
4558         (WTF::WTFThreadData::WTFThreadData):
4559         (WTF::WTFThreadData::~WTFThreadData):
4560         * wtf/WTFThreadData.h: Copied from WebCore/platform/ThreadGlobalData.h.
4561         (WTF::WTFThreadData::atomicStringTable):
4562         (WTF::WTFThreadData::initializeIdentifierTable):
4563         (WTF::WTFThreadData::currentIdentifierTable):
4564         (WTF::WTFThreadData::setCurrentIdentifierTable):
4565         (WTF::WTFThreadData::resetCurrentIdentifierTable):
4566         (WTF::wtfThreadData):
4567
4568 2010-04-19  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
4569
4570         Reviewed by Simon Hausmann.
4571
4572         [Qt] Build fix for WinCE.
4573
4574         Moved the include of the non-existing errno.h header file inside
4575         platform guard macros.
4576
4577         * jit/ExecutableAllocatorFixedVMPool.cpp:
4578
4579 2010-04-18  Kwang Yul Seo  <skyul@company100.net>
4580
4581         Reviewed by Laszlo Gombos.
4582
4583         [WINCE] Don't define WTF_CPU_MIDDLE_ENDIAN=1
4584         https://bugs.webkit.org/show_bug.cgi?id=37434
4585
4586         Windows CE supports little-endian format only, so don't define
4587         WTF_CPU_MIDDLE_ENDIAN=1.
4588
4589         * wtf/Platform.h:
4590
4591 2010-04-18  Simon Hausmann  <simon.hausmann@nokia.com>
4592
4593         Reviewed by Laszlo Gombos.
4594
4595         [Qt] Fix JavaScriptCore's include path for WinCE builds
4596
4597         https://bugs.webkit.org/show_bug.cgi?id=36751
4598
4599         * JavaScriptCore.pri:
4600
4601 2010-04-16  Gavin Barraclough  <barraclough@apple.com>
4602
4603         Reviewed by nobody, build fix.
4604
4605 2010-04-16  Gavin Barraclough  <barraclough@apple.com>
4606
4607         Reviewed by nobody, build fix.
4608
4609 2010-04-16  Gavin Barraclough  <barraclough@apple.com>
4610
4611         Reviewed by Oliver Hunt.
4612
4613         Bug 37730 - Remove JSC::UString dependencies from WebCore::StringImpl
4614         (Following on from bug #37675).
4615
4616         Make the argument ordering for UStringImpl's constructor & create
4617         methods match, when passed a shared buffer.
4618
4619         * JavaScriptCore.exp:
4620         * runtime/UStringImpl.cpp:
4621         (JSC::UStringImpl::create):
4622         * runtime/UStringImpl.h:
4623
4624 2010-04-15  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
4625
4626         Reviewed by Kenneth Rohde Christiansen.
4627
4628         Fix memory leak in QScriptEngine::evaluate().
4629
4630         QScriptEnginePrivate::evaluate should release temporary variables.
4631
4632         [Qt] QScriptEngine::evaluate has memory leak.
4633         https://bugs.webkit.org/show_bug.cgi?id=37596
4634
4635         * qt/api/qscriptengine_p.cpp:
4636         (QScriptEnginePrivate::evaluate):
4637         * qt/api/qscriptengine_p.h:
4638
4639 2010-04-14  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
4640
4641         Reviewed by Kenneth Rohde Christiansen.
4642
4643         Fix a memory leak in QScriptValue::inherits.
4644
4645         [Qt] QScriptValue::inherits has a memory leak.
4646         https://bugs.webkit.org/show_bug.cgi?id=37617
4647
4648         * qt/api/qscriptvalue_p.h:
4649         (QScriptValuePrivate::inherits):
4650
4651 2010-04-14  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
4652
4653         Reviewed by Kenneth Rohde Christiansen.
4654
4655         Fix a few memory leaks in QScriptEngine.
4656
4657         Syntax checking caused memory leak, not all temporary variables were released.
4658
4659         [Qt] Syntax checking  in the QtScript cause a memory leak.
4660         https://bugs.webkit.org/show_bug.cgi?id=37610
4661
4662         * qt/api/qscriptengine_p.cpp:
4663         (QScriptEnginePrivate::checkSyntax):
4664         * qt/api/qscriptsyntaxcheckresult.cpp:
4665         (QScriptSyntaxCheckResultPrivate::errorMessage):
4666         (QScriptSyntaxCheckResultPrivate::errorLineNumber):
4667
4668 2010-04-14  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
4669
4670         Reviewed by Kenneth Rohde Christiansen.
4671
4672         Fix memory leak inside QScriptEnginePrivate::makeJSValue.
4673
4674         QScriptEnginePrivate::makeJSValue should release temporary JSStringRef variable.
4675
4676         [Qt] tst_QScriptValue::toString has a memory leak.
4677         https://bugs.webkit.org/show_bug.cgi?id=37598
4678
4679         * qt/api/qscriptengine_p.h:
4680         (QScriptEnginePrivate::makeJSValue):
4681
4682 2010-04-14  Peter Varga  <pvarga@inf.u-szeged.hu>
4683
4684         Reviewed by Geoffrey Garen.
4685
4686         Move the YARR JIT fallback detection from RegexJIT.cpp to
4687         RegexCompiler.cpp.
4688
4689         https://bugs.webkit.org/show_bug.cgi?id=37571
4690
4691         * yarr/RegexCompiler.cpp:
4692         (JSC::Yarr::RegexPatternConstructor::atomBackReference):
4693         (JSC::Yarr::RegexPatternConstructor::quantifyAtom):
4694         * yarr/RegexJIT.cpp:
4695         (JSC::Yarr::RegexGenerator::generateTerm):
4696         (JSC::Yarr::RegexGenerator::RegexGenerator):
4697         (JSC::Yarr::jitCompileRegex):
4698         * yarr/RegexJIT.h:
4699         (JSC::Yarr::RegexCodeBlock::operator!):
4700         * yarr/RegexPattern.h:
4701         (JSC::Yarr::RegexPattern::RegexPattern):
4702         (JSC::Yarr::RegexPattern::reset):
4703
4704 2010-04-14  Kent Hansen  <kent.hansen@nokia.com>
4705
4706         Reviewed by Maciej Stachowiak.
4707
4708         Mac OS X: Use deployment target to determine whether memory tagging should be enabled
4709         https://bugs.webkit.org/show_bug.cgi?id=34888
4710
4711         When building on (Snow) Leopard but targeting Tiger
4712         (TARGETING_TIGER defined, BUILDING_ON_TIGER not defined),
4713         WebKit would crash on Tiger because the tags passed to mmap
4714         caused those function calls to fail.
4715
4716         Conversely, when building on Tiger but targeting Leopard
4717         (BUILDING_ON_TIGER defined, TARGETING_LEOPARD defined), WebKit
4718         would crash on Leopard because the tags passed to vm_map and
4719         vm_allocate caused those function calls to fail.
4720
4721         Solution: Use TARGETING_TIGER rather than BUILDING_ON_TIGER to
4722         govern the tag definitions. Use the same tags for vm_map and
4723         vm_allocate regardless of target, since they work on
4724         both. Fall back to the mmap tags that work on Tiger (that is,
4725         "no tags") if targeting Tiger, since those tags also work on
4726         Leopard.
4727
4728         * wtf/VMTags.h:
4729
4730 2010-04-12  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
4731
4732         Reviewed by nobody, build fix.
4733
4734         [Qt] Build fix for Mac when building with build-webkit --qt
4735
4736         Specifying no configuration on Mac builds WebCore both in debug
4737         and release. JavaScriptCore has to follow this rule as well.
4738
4739         * JavaScriptCore.pro:
4740
4741 2010-04-11  Mark Rowe  <mrowe@apple.com>
4742
4743         Reviewed by Sam Weinig.
4744
4745         <rdar://problem/7851332> Fix the build.
4746
4747         * wtf/FastMalloc.cpp:
4748         (WTF::TCMallocStats::): Initialize extra members of malloc_introspection_t to zero.
4749
4750 2010-04-09  Mikhail Naganov  <mnaganov@chromium.org>
4751
4752         Reviewed by Pavel Feldman.
4753
4754         Make CallIdentifier constructor to handle null urls.
4755
4756         https://bugs.webkit.org/show_bug.cgi?id=37341
4757
4758         * profiler/CallIdentifier.h:
4759         (JSC::CallIdentifier::CallIdentifier):
4760
4761 2010-04-09  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
4762
4763         Reviewed by Simon Hausmann.
4764
4765         [Qt] Fix crashes with package builds in release
4766
4767         Add NDEBUG to the defines for package build in JavaScriptCore.pri,
4768         so that it's consistently used for JavaScriptCore, WebCore, jsc and all
4769         other tools using wtf, etc. data structures directly. Mixing NDEBUG with
4770         non-NDEBUG builds causes crashes due to differences in data structures when
4771         assertions/checks are enabled.
4772
4773         * JavaScriptCore.pri:
4774
4775 2010-04-09  Patrick Gansterer  <paroga@paroga.com>
4776
4777         Reviewed by Darin Adler.
4778
4779         Implement NO_RETURN for COMPILER(MSVC).
4780         https://bugs.webkit.org/show_bug.cgi?id=33056 
4781
4782         Added NO_RETURN_WITH_VALUE for functions with non-void return type.
4783
4784         * jsc.cpp:
4785         * wtf/AlwaysInline.h:
4786         * wtf/FastMalloc.cpp:
4787
4788 2010-04-08  Kwang Yul Seo  <skyul@company100.net>
4789
4790         Reviewed by Simon Hausmann.
4791
4792         [WINCE] Check if ARM or _ARM_ is defined
4793         https://bugs.webkit.org/show_bug.cgi?id=37200
4794
4795         MSVC defines ARM and _ARM_ for Windows CE ARM. Define WTF_CPU_ARM=1
4796         when either ARM or _ARM_ is defined.
4797
4798         * wtf/Platform.h:
4799
4800 2010-04-08  Csaba Osztrogonác  <ossy@webkit.org>
4801
4802         Reviewed Oliver Hunt.
4803
4804         [Qt]r57240 broke Qt build (might be a gcc bug)
4805         https://bugs.webkit.org/show_bug.cgi?id=37253
4806
4807         Workaround until fix. On PLATFORM(QT) use inline instead of ALWAYS_INLINE.
4808
4809         * wtf/PassRefPtr.h: Qt guards added.
4810
4811 2010-04-07  Oliver Hunt  <oliver@apple.com>
4812
4813         Reviewed by Anders Carlsson.
4814
4815         Vector<UString> makes many needless calls to UString::UString and UString::~UString
4816
4817         Add a VectorTrait<UString> specialisation to allow vector to simply memset/memcpy
4818         data around.  Only difference from the VectorTrait<RefPtr<T> > traits is the inability
4819         to use memset to initialize data.
4820
4821         * runtime/UString.h:
4822         (WTF::):
4823
4824 2010-04-07  Oliver Hunt  <oliver@apple.com>
4825
4826         Reviewed by Geoff Garen.
4827
4828         Beat gcc with a clue bat -- force inlining of refIfNotNull and derefIfNotNull
4829
4830         * wtf/PassRefPtr.h:
4831
4832 2010-04-07  Kwang Yul Seo  <skyul@company100.net>
4833
4834         Reviewed by Darin Adler.
4835
4836         Replace isprint with isASCIIPrintable
4837         https://bugs.webkit.org/show_bug.cgi?id=37223
4838
4839         WebKit does not use functions in <ctype.h> as they are dependent on the current
4840         locale. Use the equivalent functions in <wtf/ASCIICType.h>. isASCIIPrintable
4841         replaces isprint.
4842
4843         * pcre/pcre_exec.cpp:
4844         (pchars):
4845
4846 2010-04-07  Enrica Casucci  <enrica@apple.com>
4847
4848         Reviewed by Darin Adler.
4849
4850         https://bugs.webkit.org/show_bug.cgi?id=37219
4851         
4852         This change disables text caret for the iPhone platflorm.
4853         
4854         * wtf/Platform.h: Disabled text caret for iPhone.
4855
4856 2010-04-06  Adam Barth  <abarth@webkit.org>
4857
4858         Reviewed by Eric Seidel.
4859
4860         REGRESSION: Worker termination via JS timeout may cause worker tests like fast/workers/worker-terminate.html fail.
4861         https://bugs.webkit.org/show_bug.cgi?id=36646
4862
4863         Add a new exception type for forcibly terminating a JavaScript stack.
4864         The new exception functions similarly to the
4865         InterruptedExecutionException but is conceptually different because
4866         execution is terminated instead of just interrupted.
4867
4868         * GNUmakefile.am:
4869             - Added new Terminator.h file.
4870         * JavaScriptCore.gypi:
4871             - Added new Terminator.h file.
4872         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
4873             - Added new Terminator.h file.
4874         * JavaScriptCore.xcodeproj/project.pbxproj:
4875             - Added new Terminator.h file.
4876         * interpreter/Interpreter.cpp:
4877         (JSC::Interpreter::throwException):
4878             - Fully unwind the stack for TerminatedExecutionException.
4879         (JSC::Interpreter::privateExecute):
4880             - Check if we've been terminated at the same time we check if we've
4881               timed out.
4882         * jit/JITStubs.cpp:
4883         (JSC::DEFINE_STUB_FUNCTION):
4884             - Check if we've been terminated at the same time we check if we've
4885               timed out.
4886         * runtime/Completion.cpp:
4887             - Some exceptions define special completion types so that calls can
4888               see why we terminated evaluation.
4889         (JSC::evaluate):
4890         * runtime/Completion.h:
4891             - Define a new completion type for termination.
4892         (JSC::):
4893         * runtime/ExceptionHelpers.cpp:
4894             - Define TerminatedExecutionException and refactor pseudo-RTTI
4895               virtual function to be more semantic.
4896         (JSC::InterruptedExecutionError::exceptionType):
4897         (JSC::TerminatedExecutionError::TerminatedExecutionError):
4898         (JSC::TerminatedExecutionError::exceptionType):
4899         (JSC::TerminatedExecutionError::toString):
4900         (JSC::createTerminatedExecutionException):
4901         * runtime/ExceptionHelpers.h:
4902             - Entry point for generating a TerminatedExecutionException.
4903         * runtime/JSGlobalData.cpp:
4904         (JSC::JSGlobalData::JSGlobalData):
4905             - Add a Terminator object that can be used to asynchronously
4906               terminate a JavaScript execution stack.
4907         * runtime/JSGlobalData.h:
4908         * runtime/JSObject.h:
4909         (JSC::JSObject::exceptionType):
4910             - Define that, by default, thrown objects have a normal exception
4911               type.
4912         * runtime/Terminator.h: Added.
4913             - Added a new controller object that can be used to terminate
4914               execution asynchronously.  This object is more or less a
4915               glorified bool.
4916         (JSC::Terminator::Terminator):
4917         (JSC::Terminator::termianteSoon):
4918         (JSC::Terminator::shouldTerminate):
4919
4920 2010-04-05  Oliver Hunt  <oliver@apple.com>
4921
4922         And another one.
4923
4924         * JavaScriptCore.vcproj/jsc/jscCommon.vsprops:
4925
4926 2010-04-05  Oliver Hunt  <oliver@apple.com>
4927
4928         And another build fix.
4929
4930         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
4931
4932 2010-04-05  Oliver Hunt  <oliver@apple.com>
4933
4934         Build fix
4935
4936         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
4937
4938 2010-04-05  Oliver Hunt  <oliver@apple.com>
4939
4940         Reviewed by Gavin Barraclough.
4941
4942         Support weak maps in JSC
4943         https://bugs.webkit.org/show_bug.cgi?id=37132
4944
4945         Expose an API to allow creation of a map for storing
4946         weak JS references.
4947
4948         * API/JSWeakObjectMapRefInternal.h: Added.
4949         (OpaqueJSWeakObjectMap::create):
4950         (OpaqueJSWeakObjectMap::map):
4951         (OpaqueJSWeakObjectMap::~OpaqueJSWeakObjectMap):
4952         (OpaqueJSWeakObjectMap::OpaqueJSWeakObjectMap):
4953         * API/JSWeakObjectMapRefPrivate.cpp: Added.
4954         * API/JSWeakObjectMapRefPrivate.h: Added.
4955         * JavaScriptCore.exp:
4956         * JavaScriptCore.xcodeproj/project.pbxproj:
4957         * runtime/JSGlobalObject.h:
4958         (JSC::JSGlobalObject::registerWeakMap):
4959         (JSC::JSGlobalObject::deregisterWeakMap):
4960
4961 2010-04-05  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
4962
4963         Reviewed by Kenneth Rohde Christiansen.
4964
4965         [Symbian] Consolidate Symbian WINSCW environment configuration
4966         https://bugs.webkit.org/show_bug.cgi?id=37100
4967
4968         Move the "undefinition" of WIN32 and _WIN32 from WebCore/config.h
4969         to JavaScriptCore/wtf/Platform.h as it is not specific to WebCore.
4970
4971         PLATFORM(WIN) and OS(WIN) no longer needs to be undefined as
4972         undefining WIN32 takes care of it.
4973
4974         * wtf/Platform.h:
4975
4976 2010-04-03  Gavin Barraclough  <barraclough@apple.com>
4977
4978         Reviewed by Oliver Hunt.
4979
4980         https://bugs.webkit.org/show_bug.cgi?id=37068
4981         Change UString to use a 0 rep for null strings instead of a null object.
4982
4983         No performance impact.
4984
4985         * JavaScriptCore.exp:
4986         * runtime/InternalFunction.cpp:
4987         (JSC::InternalFunction::InternalFunction):
4988         * runtime/JSString.h:
4989         (JSC::RopeBuilder::JSString):
4990         * runtime/UString.cpp:
4991         (JSC::initializeUString):
4992         * runtime/UString.h:
4993         (JSC::UString::UString):
4994         (JSC::UString::data):
4995         (JSC::UString::size):
4996         (JSC::UString::isNull):
4997         (JSC::UString::isEmpty):
4998         (JSC::UString::cost):
4999
5000 2010-04-03  Balazs Kelemen  <kb@inf.u-szeged.hu>
5001
5002         Reviewed by Oliver Hunt.
5003
5004         Fix uninitalised members in CallLinkInfo and BytecodeGenerator.
5005
5006         https://bugs.webkit.org/show_bug.cgi?id=36816
5007
5008         * bytecode/CodeBlock.cpp:
5009         (JSC::CodeBlock::CodeBlock):
5010         * bytecode/CodeBlock.h:
5011         (JSC::CallLinkInfo::CallLinkInfo):
5012
5013 2010-04-03  yael aharon  <yael.aharon@nokia.com>
5014
5015         Reviewed by Darin Adler.
5016
5017         Enable HTMLProgressElement for Safari on OSX
5018         https://bugs.webkit.org/show_bug.cgi?id=36961
5019
5020         * Configurations/FeatureDefines.xcconfig:
5021
5022 2010-04-02  Ruben Van Boxem  <vanboxem.ruben@gmail.com>
5023
5024         Reviewed by Eric Seidel.
5025
5026         Mingw-w64 fixes for JavaScriptCore
5027         https://bugs.webkit.org/show_bug.cgi?id=35607
5028
5029         * runtime/Collector.cpp: use the msvc code for mingw-w64 (but not mingw-w32)
5030         (JSC::Heap::allocateBlock):
5031         (JSC::Heap::freeBlockPtr):
5032         (JSC::currentThreadStackBase):
5033         (JSC::currentThreadStackBase):
5034         * wtf/Platform.h: added COMPILER(MINGW64) check to differentiate between mingw.org and mingw-w64 functions
5035
5036 2010-04-02  Geoffrey Garen  <ggaren@apple.com>
5037
5038         Build fix: updated the .def file.
5039
5040         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
5041
5042 2010-04-02  Geoffrey Garen  <ggaren@apple.com>
5043
5044         Reviewed by Oliver Hunt.
5045
5046         Inlined toThisString and toThisJSString to avoid virtual function call overhead
5047         https://bugs.webkit.org/show_bug.cgi?id=37039
5048         
5049         Maybe a 1% speedup on iBench JS.
5050
5051         * JavaScriptCore.exp: New exports.
5052
5053         * runtime/JSCell.cpp:
5054         * runtime/JSCell.h:
5055         * runtime/JSNumberCell.cpp:
5056         * runtime/JSNumberCell.h:
5057         * runtime/JSString.cpp:
5058         * runtime/JSString.h:
5059         * runtime/JSValue.h:
5060         * runtime/JSZombie.h:
5061         (JSC::JSZombie::toThisObject): Nixed the old virtual-type implementation.
5062
5063         * runtime/JSObject.h:
5064         (JSC::JSValue::toThisString):
5065         (JSC::JSValue::toThisJSString): Added the inlined implementation.
5066
5067 2010-04-02  Jeremy Moskovich  <jeremy@chromium.org>
5068
5069         Reviewed by Geoffrey Garen.
5070
5071         Beef up documentation for ASSERT* and CRASH macros a bit.
5072
5073         https://bugs.webkit.org/show_bug.cgi?id=36527
5074
5075         * wtf/Assertions.h:
5076
5077 2010-04-02  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
5078
5079         Unreviewed, minor build fix.
5080
5081         Change the order of the member initialisation list
5082         in constructor to match declaration order
5083
5084         * runtime/Collector.cpp:
5085         (JSC::Heap::Heap):
5086
5087 2010-04-01  Kinuko Yasuda  <kinuko@chromium.org>
5088
5089         Reviewed by Dmitry Titov.
5090
5091         Add FileThread for async file operation support in FileReader and FileWriter
5092         https://bugs.webkit.org/show_bug.cgi?id=36896
5093
5094         Add ENABLE_FILE_READER and ENABLE_FILE_WRITER flags.
5095
5096         * Configurations/FeatureDefines.xcconfig:
5097
5098 2010-03-31  Gavin Barraclough  <barraclough@apple.com>
5099
5100         Reviewed by NOBODY (windows build fix pt II).
5101
5102         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
5103
5104 2010-03-31  Gavin Barraclough  <barraclough@apple.com>
5105
5106         Reviewed by NOBODY (windows build fix).
5107
5108         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
5109
5110 2010-03-31  Gavin Barraclough  <barraclough@apple.com>
5111
5112         Reviewed by Geoff Garen.
5113
5114         Bug 36871 - Remove JSC::CString
5115         Use WTF::CString instead (which until recently was WebCore::CString).
5116
5117         * JavaScriptCore.exp:
5118         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
5119         * runtime/UString.cpp:
5120         * runtime/UString.h:
5121
5122 2010-03-31  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
5123
5124         Unreviewed, fix after r56842.
5125
5126         Add UNUSED_PARAM a to silence warning.
5127
5128         * jit/JITStubs.cpp:
5129         (JSC::DEFINE_STUB_FUNCTION):
5130
5131 2010-03-31  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
5132
5133         Unreviewed, Symbian build fix.
5134
5135         Refactor JITStubs.cpp so that the list of STUB_FUNCTIONs
5136         are not dependent on the JSVALUE32_64 guard.
5137
5138         * jit/JITStubs.cpp: Place the JSVALUE32_64 guard inside 
5139         the body of cti_op_eq_strings.
5140         * jit/JITStubs.h: Remove JSVALUE32_64 guard from 
5141         cti_op_eq_strings stub.
5142
5143 2010-03-30  Gavin Barraclough  <barraclough@apple.com>
5144
5145         Reviewed by NOBODY (windows build fix).
5146
5147         Fixing b0rked version of JavaScriptCore.vcproj - added lines were truncated.
5148
5149         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
5150
5151 2010-03-30  Gavin Barraclough  <barraclough@apple.com>
5152
5153         Rubber stamped by Sam Weinig.
5154
5155         https://bugs.webkit.org/show_bug.cgi?id=36866
5156         Move CString to WTF
5157
5158         * Android.mk:
5159         * GNUmakefile.am:
5160         * JavaScriptCore.exp:
5161         * JavaScriptCore.gypi:
5162         * JavaScriptCore.pro:
5163         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
5164         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
5165         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
5166         * JavaScriptCore.xcodeproj/project.pbxproj:
5167         * wtf/text: Added.
5168         * wtf/text/CString.cpp: Copied from WebCore/platform/text/CString.cpp.
5169         * wtf/text/CString.h: Copied from WebCore/platform/text/CString.h.
5170         (WTF::CStringBuffer::data):
5171         (WTF::CStringBuffer::length):
5172         (WTF::CStringBuffer::create):
5173         (WTF::CStringBuffer::CStringBuffer):
5174         (WTF::CStringBuffer::mutableData):
5175         (WTF::CString::CString):
5176         (WTF::CString::isNull):
5177         (WTF::CString::buffer):
5178         (WTF::operator!=):
5179
5180 2010-03-30  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
5181
5182         Reviewed by nobody, build break.
5183
5184         [Qt] Fix build break on Qt Mac.
5185
5186         DESTDIR path on Mac do not include the configuration path by default
5187         like on Windows. Have to force it.
5188
5189         * JavaScriptCore.pro:
5190
5191 2010-03-29  Alice Liu  <alice.liu@apple.com>
5192
5193         Reviewed by NOBODY (build fix).
5194
5195         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
5196         add JSObjectRefPrivate.h
5197
5198 2010-03-29  Chao-ying Fu  <fu@mips.com>
5199
5200         Reviewed by Oliver Hunt.
5201
5202         MIPS JIT Supports
5203         https://bugs.webkit.org/show_bug.cgi?id=30144
5204
5205         The following changes enable MIPS JIT.
5206
5207         * assembler/MIPSAssembler.h:
5208         (JSC::MIPSAssembler::lbu):
5209         (JSC::MIPSAssembler::linkWithOffset):
5210         * assembler/MacroAssemblerMIPS.h:
5211         (JSC::MacroAssemblerMIPS::load8):
5212         (JSC::MacroAssemblerMIPS::branch8):
5213         (JSC::MacroAssemblerMIPS::branchTest8):
5214         (JSC::MacroAssemblerMIPS::setTest8):
5215         (JSC::MacroAssemblerMIPS::setTest32):
5216         * jit/JIT.h:
5217         * jit/JITInlineMethods.h:
5218         (JSC::JIT::preserveReturnAddressAfterCall):
5219         (JSC::JIT::restoreReturnAddressBeforeReturn):
5220         * jit/JITOpcodes.cpp:
5221         * jit/JITStubs.cpp:
5222         (JSC::JITThunks::JITThunks):
5223         * jit/JITStubs.h:
5224         (JSC::JITStackFrame::returnAddressSlot):
5225         * wtf/Platform.h:
5226
5227 2010-02-26  Kenneth Rohde Christiansen  <kenneth@webkit.org>
5228
5229         Reviewed by Simon Fraser.
5230
5231         Add support for Widgets 1.0: View Mode Media Feature
5232         https://bugs.webkit.org/show_bug.cgi?id=35446
5233
5234         Add an enable flag for the Widgets (http://www.w3.org/TR/widgets-reqs/)
5235         and turn it on for Qt only.
5236
5237         * wtf/Platform.h:
5238
5239 2010-03-29  Patrick Gansterer  <paroga@paroga.com>
5240
5241         Reviewed by Darin Adler.
5242
5243         Corrected name of (u)int64_t compile time assert.
5244         https://bugs.webkit.org/show_bug.cgi?id=36739
5245
5246         int64_t_is_four_bytes -> int64_t_is_eight_bytes
5247
5248         * os-win32/stdint.h:
5249
5250 2010-03-29  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
5251
5252         Reviewed by Simon Hausmann.
5253
5254         [Qt] Use the -l syntax for linking against JavaScriptCore on Windows.
5255         This allow qmake to extract dependencies correctly when generating VS
5256         solutions.
5257
5258         * JavaScriptCore.pri:
5259
5260 2010-03-29  Thomas Zander  <t.zander@nokia.com>
5261
5262         Reviewed by Simon Hausmann.
5263
5264         https://bugs.webkit.org/show_bug.cgi?id=36742
5265
5266         gcc for Symbian doesn't support gcc extensions like atomicity.h - disable
5267
5268         * wtf/Threading.h: also detect os symbian
5269
5270 2010-03-28  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
5271
5272         Reviewed by Simon Hausmann.
5273
5274         [Qt] Remove the definition of WTF_CHANGES guards from the build system
5275         https://bugs.webkit.org/show_bug.cgi?id=31670
5276   
5277         * JavaScriptCore.pro: Remove the definition of WTF_CHANGES
5278         as it is already defined in config.h
5279
5280 2010-03-28  Kent Hansen  <kent.hansen@nokia.com>
5281
5282         Reviewed by Simon Hausmann.
5283
5284         [Qt] Add API for reporting additional memory cost of JavaScript objects
5285         https://bugs.webkit.org/show_bug.cgi?id=36650
5286
5287         * qt/api/qscriptengine.cpp:
5288         (QScriptEngine::reportAdditionalMemoryCost):
5289         * qt/api/qscriptengine.h:
5290         * qt/api/qscriptengine_p.h:
5291         (QScriptEnginePrivate::reportAdditionalMemoryCost):
5292         * qt/tests/qscriptengine/tst_qscriptengine.cpp:
5293         (tst_QScriptEngine::reportAdditionalMemoryCost):
5294
5295 2010-03-28  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
5296
5297         Reviewed by Simon Hausmann.
5298
5299         QScriptEngine API was enriched by globalObject() method
5300         which give an access to the global object.
5301
5302         [Qt] QScriptEngine doesn't give an access to global object
5303         https://bugs.webkit.org/show_bug.cgi?id=36603
5304
5305         * qt/api/qscriptengine.cpp:
5306         (QScriptEngine::globalObject):
5307         * qt/api/qscriptengine.h:
5308         * qt/api/qscriptengine_p.cpp:
5309         (QScriptEnginePrivate::globalObject):
5310         * qt/api/qscriptengine_p.h:
5311         * qt/tests/qscriptengine/tst_qscriptengine.cpp:
5312         (tst_QScriptEngine::globalObject):
5313
5314 2010-03-26  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
5315
5316         Reviewed by Simon Hausmann.
5317
5318         [Qt] Build JavaScriptCore as a static library.
5319         https://bugs.webkit.org/show_bug.cgi?id=36590
5320
5321         This patch takes what was left of the unused JavaScriptCore.pro
5322         and moved the compilation logic from JavaScriptCore.pri to
5323         JavaScriptCore.pro.
5324
5325         * JavaScriptCore.pri:
5326         * JavaScriptCore.pro:
5327         * jsc.pro:
5328         * qt/api/QtScript.pro:
5329
5330 2010-03-25  Gavin Barraclough  <barraclough@apple.com>
5331
5332         Reviewed by NOBODY (build fix).
5333
5334         * profiler/ProfileGenerator.cpp:
5335         (JSC::ProfileGenerator::willExecute):
5336         (JSC::ProfileGenerator::didExecute):
5337
5338 2010-03-25  Gavin Barraclough  <barraclough@apple.com>
5339
5340         Reviewed by Geoff Garen.
5341
5342         Bug 36611 - Cleanup JSC::CString
5343         Rename CString::c_str() -> CString::data(), CString::size() -> CString::length(),
5344         remove UString::getCString() (all uses are wrong, should use UString::UTF8String()).
5345
5346         * bytecode/CodeBlock.cpp:
5347         (JSC::CodeBlock::printUnaryOp):
5348         (JSC::CodeBlock::printBinaryOp):
5349         (JSC::CodeBlock::printConditionalJump):
5350         (JSC::CodeBlock::printGetByIdOp):
5351         (JSC::CodeBlock::printPutByIdOp):
5352         (JSC::printGlobalResolveInfo):
5353         (JSC::printStructureStubInfo):
5354         (JSC::CodeBlock::printStructure):
5355         (JSC::CodeBlock::printStructures):
5356         (JSC::CodeBlock::dump):
5357         * jsc.cpp:
5358         (functionPrint):
5359         (functionDebug):
5360         (runInteractive):
5361         (fillBufferWithContentsOfFile):
5362         * profiler/CallIdentifier.h:
5363         (JSC::CallIdentifier::c_str):
5364         * profiler/Profile.cpp:
5365         (JSC::Profile::debugPrintDataSampleStyle):
5366         * profiler/ProfileNode.cpp:
5367         (JSC::ProfileNode::debugPrintData):
5368         (JSC::ProfileNode::debugPrintDataSampleStyle):
5369         * runtime/DateConversion.cpp:
5370         (JSC::parseDate):
5371         * runtime/JSGlobalObjectFunctions.cpp:
5372         (JSC::encode):
5373         (JSC::globalFuncJSCPrint):
5374         * runtime/UString.cpp:
5375         (JSC::operator==):
5376         (JSC::UString::toDouble):
5377         * runtime/UString.h:
5378         (JSC::CString::length):
5379         (JSC::CString::data):
5380
5381 2010-03-25  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
5382
5383         Reviewed by nobody, build fix.
5384
5385         [Qt] Build fix on MSVC. Reverts r55633 for stdint.h
5386
5387         This file gets included in generated moc files which don't
5388         include the prefix header.
5389
5390         * os-win32/stdint.h:
5391
5392 2010-03-24  Gavin Barraclough  <barraclough@apple.com>
5393
5394         Reviewed by NOBODY (windows build fix).
5395
5396 2010-03-24  Gavin Barraclough  <barraclough@apple.com>
5397
5398         Reviewed by Sam Weinig.
5399
5400         Switch String::latin1, String::utf8, String::fromUTF8 to
5401         use WTF's Unicode conversion methods rather than TextEncoder.
5402         These methods only perform simple conversion, and don't need
5403         really require TextEncoder's full capability (to look up arbitrary
5404         encodings by name), switching to only be dependent on WTF will
5405         make it easier if we chose to move WebCore::String to WTF.
5406
5407         * JavaScriptCore.exp:
5408
5409 2010-03-24  Alexey Proskuryakov  <ap@apple.com>
5410
5411         Reviewed by Geoff Garen.
5412
5413         * wtf/FastMalloc.h: Added a using directive for fastMallocSize, like we do for all public
5414         WTF symbols. Also sorted the list alphabetically.
5415
5416 2010-03-23  Gavin Barraclough  <barraclough@apple.com>
5417
5418         Reviewed by NOBODY (speculative windows build fix part II).
5419
5420 2010-03-23  Gavin Barraclough  <barraclough@apple.com>
5421
5422         Reviewed by NOBODY (speculative windows build fix).
5423
5424 2010-03-23  Gavin Barraclough  <barraclough@apple.com>
5425
5426         Reviewed by Oliver Hunt.
5427
5428         Bug 36519 - JSGlobalContextRelease is unnecessarily slow
5429
5430         Since [ http://trac.webkit.org/changeset/35917 ], calling
5431         JSGlobalContextRelease always triggers a GC heap collection
5432         (if not a full destroy). As per 35917's changelog "This is
5433         only really necessary when the (JSGlobalObject's) last
5434         reference is released, but there is no way to determine that,
5435         and no harm in collecting slightly more often."
5436         
5437         Well, we now know of cases of API clients who are harmed by
5438         the performance penalty of collecting too often, so it's time
5439         to add a way to determine whether a call to JSGlobalContextRelease
5440         is removing the last protect from it's global object.  If further
5441         protects are retaining the global object (likely from other
5442         JSGlobalContextRefs), then don't trigger a GC collection.
5443
5444         * API/JSContextRef.cpp:
5445         * runtime/Collector.cpp:
5446         (JSC::Heap::unprotect): return a boolean indicating that the value is now unprotected.
5447         * runtime/Collector.h:
5448         * wtf/HashCountedSet.h:
5449         (WTF::::remove): return a boolean indicating whether the value was removed from the set.
5450
5451 2010-03-23  Mark Rowe  <mrowe@apple.com>
5452
5453         Build fix.
5454
5455         * runtime/ArrayPrototype.cpp:
5456         (JSC::arrayProtoFuncSplice): Some versions of GCC emit a warning about the implicit 64- to 32-bit truncation
5457         that takes place here. An explicit cast is sufficient to silence it.
5458
5459 2010-03-23  Alexey Proskuryakov  <ap@apple.com>
5460
5461         Build fix.
5462
5463         * runtime/ArrayPrototype.cpp: (JSC::arrayProtoFuncSplice): Fixed a typo - length doesn't
5464         need to be converted with toInteger().
5465
5466 2010-03-23  Alexey Proskuryakov  <ap@apple.com>
5467
5468         Reviewed by Geoff Garen.
5469
5470         https://bugs.webkit.org/show_bug.cgi?id=36511
5471         <rdar://problem/7753498> Safari freezes when using SPUTNIK JavaScript conformance check
5472
5473         Test: fast/js/sputnik-S15.4.4.12_A3_T3.html
5474
5475         * runtime/ArrayPrototype.cpp: (JSC::arrayProtoFuncSplice): We were incorrectly computing
5476         the start offset, and iterated over (almost) all integers. Note that this can be fixed
5477         without using doubles, but the code would be much more complicated, and there is no important
5478         reason to stick to integers here.
5479
5480 2010-03-23  Kent Hansen  <kent.hansen@nokia.com>
5481
5482         Reviewed by Darin Adler.
5483
5484         Fix compilation on Itanium in 32-bit mode
5485         https://bugs.webkit.org/show_bug.cgi?id=36494
5486
5487         * wtf/Platform.h: Introduce CPU(IA64_32). Don't define
5488           WTF_USE_JSVALUE64 if the CPU is in 32-bit mode.
5489
5490 2010-03-23  Geoffrey Garen  <ggaren@apple.com>
5491
5492         Reviewed by Mark Rowe.
5493
5494         Interpreter fix for <rdar://problem/7728196> REGRESSION (r46701): -(-2147483648)
5495         evaluates to -2147483648 on 32 bit (35842)
5496
5497         * interpreter/Interpreter.cpp:
5498         (JSC::Interpreter::privateExecute): Only take the fast negate path if
5499         a bit other than bit 31 is set. If none of bits 0-30 are set, then the
5500         value we're negating can only be 0 or -2147483648, and neither can be
5501         negated in int space.
5502
5503         * jit/JITArithmetic.cpp:
5504         (JSC::JIT::emit_op_negate):
5505         (JSC::JIT::emitSlow_op_negate): Updated the JIT implementation to match
5506         the interpreter, since it's slightly simpler.
5507
5508 2010-03-22  Siddharth Mathur  <siddharth.mathur@nokia.com>
5509
5510         Reviewed by Laszlo Gombos.
5511
5512         [Symbian] More efficient aligned memory allocation for JSC Collector
5513         https://bugs.webkit.org/show_bug.cgi?id=34350
5514
5515         * JavaScriptCore.pri: Added 2 new Symbian source files and HAL linkage
5516
5517         * runtime/Collector.cpp: Reduced port-specific code and added private data member
5518         (JSC::Heap::Heap):
5519         (JSC::Heap::~Heap):
5520         (JSC::Heap::destroy):
5521         (JSC::Heap::allocateBlock):
5522         (JSC::Heap::freeBlockPtr):
5523
5524         * runtime/Collector.h: Added private data member
5525
5526         * wtf/symbian: Added.
5527         * wtf/symbian/BlockAllocatorSymbian.cpp: Added.
5528         (WTF::AlignedBlockAllocator::AlignedBlockAllocator): Helper class to allocate 
5529         aligned blocks more efficiently as required by Collector
5530         (WTF::AlignedBlockAllocator::alloc):
5531         (WTF::AlignedBlockAllocator::free):
5532         (WTF::AlignedBlockAllocator::destroy):
5533         (WTF::AlignedBlockAllocator::~AlignedBlockAllocator):
5534         * wtf/symbian/BlockAllocatorSymbian.h: Added.
5535
5536 2010-03-22  Geoffrey Garen  <ggaren@apple.com>
5537
5538         Reviewed by Sam Weinig.
5539
5540         Fixed <rdar://problem/7728196> REGRESSION (r46701): -(-2147483648)
5541         evaluates to -2147483648 on 32 bit (35842)
5542         
5543         Two ways to fix the same bug:
5544         
5545         1. Check for overflow when negating, since negating the largest negative
5546         int causes overflow.
5547         
5548         2. Constant-fold even when negating a negative, since, like they say in
5549         high school, "math works."
5550
5551         * assembler/MacroAssemblerARM.h:
5552         (JSC::MacroAssemblerARM::branchNeg32):
5553         * assembler/MacroAssemblerX86Common.h:
5554         (JSC::MacroAssemblerX86Common::branchNeg32): Added a branching version
5555         of the negate operator.
5556
5557         * jit/JITArithmetic.cpp:
5558         (JSC::JIT::emit_op_negate): Use the branching version of the negate 
5559         operator to check for overflow.
5560
5561         (JSC::JIT::emitSlow_op_negate): Link the check for overflow to a slow case.
5562         (We could emit inline code for this, since we know what the result would
5563         be, but that's probably just a waste of generated code.)
5564
5565         * parser/Grammar.y: Constant fold even when negating a negative.
5566
5567 2010-03-22  David Kilzer  <ddkilzer@apple.com>
5568
5569         <http://webkit.org/b/36431> Clean up 'int' use in UString.cpp after r54789
5570
5571         Reviewed by Darin Adler.
5572
5573         * runtime/UString.cpp:
5574         (JSC::UString::from): Changed argument type from 'unsigned int'
5575         to 'unsigned' to match WebKit coding style.
5576         (JSC::UString::find): Changed static_cast<int>() to
5577         static_cast<unsigned>() now that this method returns unsigned.
5578         (JSC::UString::rfind): Ditto.
5579         * runtime/UString.h:
5580         (JSC::UString::from): Changed argument type from 'unsigned int'
5581         to 'unsigned' to match WebKit coding style.
5582
5583 2010-03-22  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
5584
5585         Reviewed by Kenneth Rohde Christiansen.
5586
5587         Add support for syntax checking in the QtScript API.
5588
5589         New class was created; the QScriptSyntaxCheckResult which main
5590         responsibility is to provide results of the ECMA Script code
5591         syntax check. The class is not fully functional as the JSC C API
5592         doesn't expose an error column number, but it is a good start point
5593         for a future development.
5594
5595         [Qt] QtScript functionality should be extended by syntax checking.
5596         https://bugs.webkit.org/show_bug.cgi?id=36123
5597
5598         * qt/api/QtScript.pro:
5599         * qt/api/qscriptengine.cpp:
5600         (QScriptEngine::checkSyntax):
5601         * qt/api/qscriptengine.h:
5602         * qt/api/qscriptengine_p.cpp:
5603         (QScriptEnginePrivate::checkSyntax):
5604         * qt/api/qscriptengine_p.h:
5605         * qt/api/qscriptsyntaxcheckresult.cpp: Added.
5606         (QScriptSyntaxCheckResult::QScriptSyntaxCheckResult):
5607         (QScriptSyntaxCheckResult::~QScriptSyntaxCheckResult):
5608         (QScriptSyntaxCheckResult::operator=):
5609         (QScriptSyntaxCheckResult::state):
5610         (QScriptSyntaxCheckResult::errorLineNumber):
5611         (QScriptSyntaxCheckResult::errorColumnNumber):
5612         (QScriptSyntaxCheckResult::errorMessage):
5613         * qt/api/qscriptsyntaxcheckresult.h: Added.
5614         * qt/api/qscriptsyntaxcheckresult_p.cpp: Added.
5615         (QScriptSyntaxCheckResultPrivate::~QScriptSyntaxCheckResultPrivate):
5616         (QScriptSyntaxCheckResultPrivate::errorMessage):
5617         (QScriptSyntaxCheckResultPrivate::errorLineNumber):
5618         * qt/api/qscriptsyntaxcheckresult_p.h: Added.
5619         (QScriptSyntaxCheckResultPrivate::get):
5620         (QScriptSyntaxCheckResultPrivate::QScriptSyntaxCheckResultPrivate):
5621         (QScriptSyntaxCheckResultPrivate::state):
5622         (QScriptSyntaxCheckResultPrivate::errorColumnNumber):
5623         * qt/tests/qscriptengine/tst_qscriptengine.cpp:
5624         (tst_QScriptEngine::checkSyntax_data):
5625         (tst_QScriptEngine::checkSyntax):
5626
5627 2010-03-21  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
5628
5629         Reviewed by Simon Hausmann.
5630
5631         New class; QScriptProgram.
5632
5633         The class should be used to evaluate the same script multiple times
5634         more efficiently.
5635
5636         [Qt] QtScript should have QScriptProgram class
5637         https://bugs.webkit.org/show_bug.cgi?id=36008
5638
5639         * qt/api/QtScript.pro:
5640         * qt/api/qscriptengine.cpp:
5641         (QScriptEngine::evaluate):
5642         * qt/api/qscriptengine.h:
5643         * qt/api/qscriptengine_p.cpp:
5644         (QScriptEnginePrivate::evaluate):
5645         * qt/api/qscriptengine_p.h:
5646         (QScriptEnginePrivate::evaluate):
5647         * qt/api/qscriptprogram.cpp: Added.
5648         (QScriptProgram::QScriptProgram):
5649         (QScriptProgram::~QScriptProgram):
5650         (QScriptProgram::operator=):
5651         (QScriptProgram::isNull):
5652         (QScriptProgram::sourceCode):
5653         (QScriptProgram::fileName):
5654         (QScriptProgram::firstLineNumber):
5655         (QScriptProgram::operator==):
5656         (QScriptProgram::operator!=):
5657         * qt/api/qscriptprogram.h: Added.
5658         * qt/api/qscriptprogram_p.h: Added.
5659         (QScriptProgramPrivate::get):
5660         (QScriptProgramPrivate::QScriptProgramPrivate):
5661         (QScriptProgramPrivate::~QScriptProgramPrivate):
5662         (QScriptProgramPrivate::isNull):
5663         (QScriptProgramPrivate::sourceCode):
5664         (QScriptProgramPrivate::fileName):
5665         (QScriptProgramPrivate::firstLineNumber):
5666         (QScriptProgramPrivate::operator==):
5667         (QScriptProgramPrivate::operator!=):
5668         (QScriptProgramPrivate::program):
5669         (QScriptProgramPrivate::file):
5670         (QScriptProgramPrivate::line):
5671         * qt/tests/qscriptengine/tst_qscriptengine.cpp:
5672         (tst_QScriptEngine::evaluateProgram):
5673
5674 2010-03-21  David Kilzer  <ddkilzer@apple.com>
5675
5676         Blind attempt #2 to fix the Windows build after r56314
5677
5678         * API/tests/testapi.c: Include JSObjectRefPrivate.h for the new
5679         methods instead of declaring them locally (and non-extern).
5680         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
5681         Backed out previous change.
5682
5683 2010-03-21  David Kilzer  <ddkilzer@apple.com>
5684
5685         Blind attempt to fix the Windows build after r56314
5686
5687         Try to fix the following errors on the Windows buildbot:
5688
5689             Linking...
5690             testapi.obj : error LNK2001: unresolved external symbol "bool __cdecl JSObjectSetPrivateProperty(struct OpaqueJSContext const *,struct OpaqueJSValue *,struct OpaqueJSString *,struct OpaqueJSValue const *)" (?JSObjectSetPrivateProperty@@YA_NPBUOpaqueJSContext@@PAUOpaqueJSValue@@PAUOpaqueJSString@@PBU2@@Z)
5691             testapi.obj : error LNK2001: unresolved external symbol "struct OpaqueJSValue const * __cdecl JSObjectGetPrivateProperty(struct OpaqueJSContext const *,struct OpaqueJSValue *,struct OpaqueJSString *)" (?JSObjectGetPrivateProperty@@YAPBUOpaqueJSValue@@PBUOpaqueJSContext@@PAU1@PAUOpaqueJSString@@@Z)
5692             C:\cygwin\home\buildbot\slave\win-release\build\WebKitBuild\bin\testapi.exe : fatal error LNK1120: 2 unresolved externals
5693
5694         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Added
5695         missing symbols to be exported.
5696
5697 2010-03-21  Oliver Hunt  <oliver@apple.com>
5698
5699         Reviewed by Maciej Stachowiak.
5700
5701         Documentation fix for previous patch.
5702
5703         * API/JSObjectRefPrivate.h:
5704
5705 2010-03-20  Oliver Hunt  <oliver@apple.com>
5706
5707         Reviewed by Maciej Stachowiak.
5708
5709         JSC needs an API to allow custom objects to have aprivate GC-accessible properties
5710         https://bugs.webkit.org/show_bug.cgi?id=36420
5711
5712         Add new API methods to support "private" properties on custom
5713         objects.
5714
5715         * API/JSCallbackObject.h:
5716         (JSC::JSCallbackObjectData::JSCallbackObjectData):
5717         (JSC::JSCallbackObjectData::~JSCallbackObjectData):
5718         (JSC::JSCallbackObjectData::getPrivateProperty):
5719         (JSC::JSCallbackObjectData::setPrivateProperty):
5720         (JSC::JSCallbackObjectData::deletePrivateProperty):
5721         (JSC::JSCallbackObjectData::markChildren):
5722         (JSC::JSCallbackObjectData::JSPrivatePropertyMap::getPrivateProperty):
5723         (JSC::JSCallbackObjectData::JSPrivatePropertyMap::setPrivateProperty):
5724         (JSC::JSCallbackObjectData::JSPrivatePropertyMap::deletePrivateProperty):
5725         (JSC::JSCallbackObjectData::JSPrivatePropertyMap::markChildren):
5726         (JSC::JSCallbackObject::getPrivateProperty):
5727         (JSC::JSCallbackObject::setPrivateProperty):
5728         (JSC::JSCallbackObject::deletePrivateProperty):
5729         (JSC::JSCallbackObject::markChildren):
5730         * API/JSObjectRef.cpp:
5731         (JSObjectGetPrivateProperty):
5732         (JSObjectSetPrivateProperty):
5733         (JSObjectDeletePrivateProperty):
5734         * API/JSObjectRefPrivate.h: Added.
5735         * API/tests/testapi.c:
5736         (main):
5737         * JavaScriptCore.exp:
5738         * JavaScriptCore.xcodeproj/project.pbxproj:
5739
5740 2010-03-20  Kevin Ollivier  <kevino@theolliviers.com>
5741
5742         [wx] Build fixes after introduction of Brew files.
5743
5744         * wscript:
5745
5746 2010-03-18  Tom Callaway  <tcallawa@redhat.com>
5747
5748         Reviewed by Darin Adler.
5749
5750         Bug 35429: Fix compile on SPARC64
5751         https://bugs.webkit.org/show_bug.cgi?id=35429
5752
5753         * wtf/Platform.h: Set WTF_USE_JSVALUE64 for SPARC64
5754
5755 2010-03-18  Oliver Hunt  <oliver@apple.com>
5756
5757         Reviewed by Sam Weinig.
5758
5759         Add API to directly expose JSON parsing
5760         https://bugs.webkit.org/show_bug.cgi?id=34887
5761
5762         Add API to expose JSON parsing directly, and add tests to testapi
5763
5764         * API/JSValueRef.cpp:
5765         (JSValueMakeFromJSONString):
5766         (JSValueCreateJSONString):
5767         * API/tests/testapi.c:
5768         (main):
5769         * JavaScriptCore.exp:
5770         * runtime/JSONObject.cpp:
5771         (JSC::JSONStringify):
5772         * runtime/JSONObject.h:
5773
5774 2010-03-16  Sam Weinig  <sam@webkit.org>
5775
5776         Reviewed by Darin Adler and Mark Rowe.
5777
5778         Update WebKit availability macros for release after 4.0.
5779
5780         * API/WebKitAvailability.h:
5781
5782 2010-03-17  Oliver Hunt  <oliver@apple.com>
5783
5784         Reviewed by Gavin Barraclough.
5785
5786         undefined, NaN, and Infinity should be ReadOnly
5787         https://bugs.webkit.org/show_bug.cgi?id=36263
5788
5789         Simply add the ReadOnly flag to these properties.
5790
5791         * runtime/JSGlobalObject.cpp:
5792         (JSC::JSGlobalObject::reset):
5793
5794 2010-03-17  Darin Adler  <darin@apple.com>
5795
5796         Reviewed by Oliver Hunt.
5797
5798         Speed up Math.round a little by removing unneeded special case
5799         https://bugs.webkit.org/show_bug.cgi?id=36107
5800
5801         Test: fast/js/math.html
5802
5803         * runtime/MathObject.cpp:
5804         (JSC::mathProtoFuncRound): This function had a special case for numbers
5805         between -0.5 and -0.0 to return -0.0. But the algorithm in the function
5806         already yields -0.0 for those cases, so the extra checking and branching
5807         is unneeded.
5808
5809 2010-03-17  Mike Homey  <glandium@debian.org>
5810
5811         Reviewed by Gustavo Noronha.
5812
5813         Build fix for SPARC. Fix missing macro value.
5814
5815         * wtf/Platform.h:
5816
5817 2010-03-16  Gavin Barraclough  <barraclough@apple.com>
5818
5819         Reviewed by Oliver Hunt, Darin Adler.
5820
5821         Bug 36083 - REGRESSION (r55772-r55834): Crash in JavaScriptCore RegExp code on PowerPC
5822
5823         The problem is a bug in our port of PCRE - that a read may take place from the first character in an
5824         empty string.  For the time being, revert to using a valid pointer in the data segment rather than
5825         an invalid non-null pointer into the zero-page for the empty string's data pointer.  A better fix for
5826         this will be to remove PCRE.
5827
5828         * runtime/UStringImpl.cpp:
5829         (JSC::UStringImpl::empty):
5830
5831 2010-03-16  Darin Adler  <darin@apple.com>
5832
5833         Rolled out r56081 since it broke the Windows build.
5834
5835 2010-03-16  Zoltan Horvath  <zoltan@webkit.org>
5836
5837         Reviewed by Darin Adler.
5838
5839         Remove extra <new> include and add guards to operator new/delete definitions
5840         https://bugs.webkit.org/show_bug.cgi?id=35967
5841
5842         Remove extra <new> header include from FastAlloc.cpp since it is included in 
5843         FastAlloc.h. Add ENABLE(GLOBAL_FASTMALLOC_NEW) macro guard to operator
5844         new/delete/new []/delete [] definitions.
5845
5846         * wtf/FastMalloc.cpp:
5847
5848 2010-03-15  Kwang Yul Seo  <skyul@company100.net>
5849
5850         Reviewed by Eric Seidel.
5851
5852         [BREWMP] Add a function to create a BREW instance without local variable declarations.
5853         https://bugs.webkit.org/show_bug.cgi?id=34705
5854
5855         Add a template function to create a BREW instance in one line.
5856
5857         * wtf/brew/ShellBrew.h: Added.
5858         (WTF::createInstance):
5859
5860 2010-03-15  Geoffrey Garen  <ggaren@apple.com>
5861
5862         Not reviewed.
5863
5864         Removed a now-incorrect comment I forgot to remove in my last check-in.
5865
5866         * wtf/FastMalloc.cpp:
5867         (WTF::TCMalloc_PageHeap::scavenge):
5868
5869 2010-03-15  Geoffrey Garen  <ggaren@apple.com>
5870
5871         Reviewed by Sam Weinig.
5872
5873         Fixed a portion of:
5874         <rdar://problem/7165917> | https://bugs.webkit.org/show_bug.cgi?id=28676
5875         Safari 4 does not release memory back to the operating system fast enough (28676)
5876
5877         Every few seconds, release a percentage of the minimum unused page count
5878         during that time period.
5879
5880         SunSpider reports no change, command-line or in-browser, Mac or Windows.
5881         
5882         * wtf/FastMalloc.cpp:
5883         (WTF::TCMalloc_PageHeap::init):
5884         (WTF::TCMalloc_PageHeap::signalScavenger):
5885         (WTF::TCMalloc_PageHeap::initializeScavenger): Renamed shouldContinueScavenging
5886         to shouldScavenge, since scavenging is no longer something that we interrupt.
5887
5888         (WTF::TCMalloc_PageHeap::scavenge): The new scavenging algorithm. Fixes
5889         a bug where the old code would release only one item from each size class
5890         per scavenge, potentially leaving large numbers of large-sized objects
5891         unreleased for a long time.
5892
5893         (WTF::TCMalloc_PageHeap::shouldScavenge):
5894         (WTF::TCMalloc_PageHeap::New):
5895         (WTF::TCMalloc_PageHeap::AllocLarge):
5896         (WTF::TCMalloc_PageHeap::Delete):
5897         (WTF::TCMalloc_PageHeap::GrowHeap):
5898         (WTF::TCMalloc_PageHeap::scavengerThread):
5899         (WTF::TCMalloc_PageHeap::periodicScavenge): Updated to track the minimum
5900         value of free_committed_pages_ during a given scavenge period.
5901
5902 2010-03-15  Gavin Barraclough  <barraclough@apple.com>
5903
5904         Reviewed by Sam Weinig.
5905
5906         https://bugs.webkit.org/show_bug.cgi?id=35843
5907         Re-land reverted fix to JSString::getIndex()
5908
5909         Calling getIndex() on a JSString in rope form may result in a JSException being thrown
5910         if there is insuficient memory so value(exec) returns UString() with length zero,
5911         which will be passed to jsSingleCharacterSubstring.
5912         Add a slow case function to trap the error & return a safe null value, until the
5913         exception is handled.
5914
5915         * runtime/JSString.cpp:
5916         (JSC::JSString::getIndexSlowCase):
5917         (JSC::JSString::getStringPropertyDescriptor):
5918         * runtime/JSString.h:
5919         (JSC::jsSingleCharacterSubstring):
5920         (JSC::JSString::getIndex):
5921         (JSC::jsSingleCharacterString):
5922         (JSC::JSString::getStringPropertySlot):
5923
5924 2010-03-04  Kenneth Rohde Christiansen  <kenneth@webkit.org>
5925
5926         Reviewed by Adam Roben.
5927
5928         Add a long long version of abs() for MSVC.
5929
5930         * wtf/MathExtras.h:
5931         (abs):
5932
5933 2010-03-15  Gabor Loki  <loki@webkit.org>
5934
5935         Reviewed by Gavin Barraclough.
5936
5937         Combine ctiTrampolines on ARM and Thumb-2
5938         https://bugs.webkit.org/show_bug.cgi?id=36014
5939
5940         * jit/JITStubs.cpp:
5941         (JSC::JITThunks::JITThunks):
5942
5943 2010-03-12  Gavin Barraclough  <barraclough@apple.com>
5944
5945         Reviewed by NOBODY (build fix).
5946
5947         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
5948
5949 2010-03-12  Gavin Barraclough  <barraclough@apple.com>
5950
5951         Reviewed by NOBODY (build fix).
5952
5953         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
5954
5955 2010-03-11  Gavin Barraclough  <barraclough@apple.com>
5956
5957         Reviewed by Oliver Hunt.
5958
5959         Bug 36075 - Clean up screwyness re static string impls & Identifiers.
5960
5961         * API/JSClassRef.cpp:
5962         (OpaqueJSClass::~OpaqueJSClass): Classname may be null/empty, and these are an identifer.  This is okay, since the null/empty strings are shared across all threads.
5963         * JavaScriptCore.exp:
5964         * runtime/Identifier.cpp:
5965         (JSC::Identifier::add): No need to explicitly hash null reps, this is done in the ststic UStringImpl constructor.
5966         (JSC::Identifier::addSlowCase): UStringImpl::empty() handled & checkCurrentIdentifierTable now called in the header.
5967         (JSC::Identifier::checkCurrentIdentifierTable): Replaces checkSameIdentifierTable (this no longer checked the rep since the identifierTable pointer was removed from UString::Rep long ago).
5968         * runtime/Identifier.h:
5969         (JSC::Identifier::add): Replace call to checkSameIdentifierTable with call to checkCurrentIdentifierTable at head of function.
5970         * runtime/UStringImpl.cpp:
5971         (JSC::UStringImpl::~UStringImpl): Remove call to checkConsistency - this function no longer checks anything interesting.
5972         * runtime/UStringImpl.h:
5973         (JSC::UStringOrRopeImpl::UStringOrRopeImpl): Set s_refCountFlagIsIdentifier in static constructor.
5974         (JSC::UStringImpl::UStringImpl): remove calls to checkConsistency (see above), add new ASSERT to substring constructor.
5975         (JSC::UStringImpl::setHash): ASSERT not static (static strings set the hash in their constructor, should not reach this code path).
5976         (JSC::UStringImpl::create): Add missing ASSERT.
5977         (JSC::UStringImpl::setIsIdentifier): ASSERT !isStatic() (static strings hash set in constructor).
5978
5979 2010-03-12  Peter Varga  <pvarga@inf.u-szeged.hu>
5980
5981         Reviewed by David Levin.
5982
5983         Two functions tryConsumeCharacter() and tryConsumeCharacterClass() are
5984         removed from yarr/RegexInterpreter.cpp because they are never called.
5985
5986         * yarr/RegexInterpreter.cpp:
5987
5988 2010-03-11  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
5989
5990         Reviewed by Simon Hausmann.
5991
5992         The JSNative state was renamed to JSPrimitive. The new name better
5993         coresponds to the ECMAScript standard.
5994
5995         Enum QScriptValuePrivate::States was renamed to State to obey Qt
5996         coding style rules ("States" name suggests that a state could
5997         mixed together with an other state using bitwise logic operators.
5998
5999         [Qt] QScriptValuePrivate::States has naming issues
6000         https://bugs.webkit.org/show_bug.cgi?id=35968
6001
6002         * qt/api/qscriptvalue_p.h:
6003         (QScriptValuePrivate::):
6004         (QScriptValuePrivate::QScriptValuePrivate):
6005         (QScriptValuePrivate::isBool):
6006         (QScriptValuePrivate::isNumber):
6007         (QScriptValuePrivate::isNull):
6008         (QScriptValuePrivate::isString):
6009         (QScriptValuePrivate::isUndefined):
6010         (QScriptValuePrivate::toString):
6011         (QScriptValuePrivate::toNumber):
6012         (QScriptValuePrivate::toBool):
6013         (QScriptValuePrivate::assignEngine):
6014         (QScriptValuePrivate::refinedJSValue):
6015
6016 2010-03-11  Gavin Barraclough  <barraclough@apple.com>
6017
6018         Reviewed by NOBODY (Windows build fix).
6019
6020         Add export.
6021
6022         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
6023
6024 2010-03-11  Gavin Barraclough  <barraclough@apple.com>
6025
6026         Reviewed by NOBODY (Windows build fix).
6027
6028         Add export.
6029
6030         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
6031
6032 2010-03-11  Gavin Barraclough  <barraclough@apple.com>
6033
6034         Rubber stamped by Oliver Hunt.
6035
6036         Remove nonsense comments used in development & commited in error.
6037
6038         * runtime/UStringImpl.h:
6039
6040 2010-03-11  Gavin Barraclough  <barraclough@apple.com>
6041
6042         Reviewed by NOBODY (Windows build fix).
6043
6044         Remove export.
6045
6046         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
6047
6048 2010-03-11  Gavin Barraclough  <barraclough@apple.com>
6049
6050         Reviewed by Oliver Hunt.
6051
6052         https://bugs.webkit.org/show_bug.cgi?id=36041
6053         Remove unnecessary differences in common code between WebCore::StringImpl & JSC::UStringImpl
6054
6055         Much of the code in WebCore::StringImpl and JSC::UStringImpl is now very similar,
6056         but has trivial and unnecessary formatting differences, such as the exact wording
6057         of comments, missing ASSERTs, functions implemented in the .h vs .cpp etc.
6058
6059         * runtime/Identifier.cpp:
6060         (JSC::Identifier::add): UStringImpl::empty() now automatically hashes, uas per WebCore strings.
6061         (JSC::Identifier::addSlowCase): UStringImpl::empty() now automatically hashes, uas per WebCore strings.
6062         * runtime/UStringImpl.cpp:
6063         (JSC::UStringImpl::~UStringImpl): Only call bufferOwnership() once, add missing ASSERTs.
6064         (JSC::UStringImpl::createUninitialized): Move from .h, not commonly called, no need to inline.
6065         (JSC::UStringImpl::create): Move from .h, not commonly called, no need to inline.
6066         (JSC::UStringImpl::sharedBuffer): Rewritten to more closely match WebCore implementation, remove need for separate baseSharedBuffer() method.
6067         * runtime/UStringImpl.h:
6068         (JSC::UStringImpl::UStringImpl): Automatically hash static strings, ASSERT m_data & m_length are non-null/non-zero in non-static strings.
6069         (JSC::UStringImpl::setHash): Add missing ASSERT.
6070         (JSC::UStringImpl::create): Moved to .cpp / added missing check for empty string creation.
6071         (JSC::UStringImpl::adopt): Vector.size() returns size_t, not unsigned.
6072         (JSC::UStringImpl::cost): Renamed m_bufferSubstring -> m_substringBuffer
6073         (JSC::UStringImpl::hash): Reordered in file.
6074         (JSC::UStringImpl::existingHash): Reordered in file.
6075         (JSC::UStringImpl::computeHash): Reordered in file, renamed parameter.
6076         (JSC::UStringImpl::checkConsistency): rewrote ASSERT.
6077         (JSC::UStringImpl::bufferOwnership): Return type should be BufferOwnership.
6078         (JSC::UStringImpl::): Moved friends to head of class.
6079
6080 2010-03-11  Mark Rowe  <mrowe@apple.com>
6081
6082         Reviewed by David Kilzer.
6083
6084         <rdar://problem/7745082> Make it possible to build WebKit for older Mac OS X versions from the current Mac OS X version
6085
6086         Default to using the appropriate SDK if the target Mac OS X version is not the current Mac OS X version.
6087
6088         * Configurations/Base.xcconfig:
6089
6090 2010-03-11  Mark Rowe  <mrowe@apple.com>
6091
6092         Reviewed by Tim Hatcher.
6093
6094         <rdar://problem/7745082> Make it possible to build WebKit for older Mac OS X versions from the current Mac OS X version
6095
6096         Introduce TARGET_MAC_OS_X_VERSION_MAJOR to represent the Mac OS X version that is being targeted.  It defaults to the
6097         current Mac OS X version unless otherwise specified.
6098
6099         Key off TARGET_MAC_OS_X_VERSION_MAJOR where we'd previously been keying off MAC_OS_X_VERSION_MAJOR.
6100
6101         Explicitly map from the target Mac OS X version to the preferred compiler since Xcode's default compiler choice
6102         may not be usable when targetting a different Mac OS X version.
6103
6104         Key off TARGET_GCC_VERSION rather than MAC_OS_X_VERSION_MAJOR in locations where we'd previously been keying off
6105         MAC_OS_X_VERSION_MAJOR but the decision is really related to the compiler version being used.
6106
6107         * Configurations/Base.xcconfig:
6108         * Configurations/DebugRelease.xcconfig:
6109         * Configurations/FeatureDefines.xcconfig:
6110         * Configurations/JavaScriptCore.xcconfig:
6111         * Configurations/Version.xcconfig:
6112
6113 2010-03-11  Simon Fraser  <simon.fraser@apple.com>
6114
6115         Reviewed by Mark Rowe.
6116
6117         Sort the project file.
6118
6119         * JavaScriptCore.xcodeproj/project.pbxproj:
6120
6121 2010-03-11  Simon Fraser  <simon.fraser@apple.com>
6122
6123         Reviewed by Mark Rowe.
6124
6125         Sort the project file .
6126
6127         * JavaScriptCore.xcodeproj/project.pbxproj:
6128
6129 2010-03-11  Gabor Loki  <loki@webkit.org>
6130
6131         Reviewed by Gavin Barraclough.
6132
6133         Buildfix for Thumb-2 after r55684. Add branch8 and branchTest8 functions.
6134         https://bugs.webkit.org/show_bug.cgi?id=35892
6135
6136         * assembler/ARMv7Assembler.h:
6137         (JSC::ARMv7Assembler::):
6138         (JSC::ARMv7Assembler::ldrb):
6139         * assembler/MacroAssemblerARMv7.h:
6140         (JSC::MacroAssemblerARMv7::load8):
6141         (JSC::MacroAssemblerARMv7::branch8):
6142         (JSC::MacroAssemblerARMv7::branchTest8):
6143         (JSC::MacroAssemblerARMv7::setTest8):
6144
6145 2010-03-10  Gavin Barraclough  <barraclough@apple.com>
6146
6147         Rubber stamped by Oliver Hunt.
6148         
6149         Rename JSC::UStringImpl::data() to characters(), to match WebCore::StringImpl.
6150
6151         * API/JSClassRef.cpp:
6152         (OpaqueJSClassContextData::OpaqueJSClassContextData):
6153         * bytecompiler/BytecodeGenerator.cpp:
6154         (JSC::keyForCharacterSwitch):
6155         * bytecompiler/NodesCodegen.cpp:
6156         (JSC::processClauseList):
6157         * interpreter/Interpreter.cpp:
6158         (JSC::Interpreter::privateExecute):
6159         * jit/JITStubs.cpp:
6160         (JSC::DEFINE_STUB_FUNCTION):
6161         * runtime/ArrayPrototype.cpp:
6162         (JSC::arrayProtoFuncToString):
6163         * runtime/Identifier.cpp:
6164         (JSC::Identifier::equal):
6165         (JSC::Identifier::addSlowCase):
6166         * runtime/JSString.cpp:
6167         (JSC::JSString::resolveRope):
6168         * runtime/UString.cpp:
6169         (JSC::UString::toStrictUInt32):
6170         (JSC::equal):
6171         * runtime/UString.h:
6172         (JSC::UString::data):
6173         * runtime/UStringImpl.h:
6174         (JSC::UStringImpl::characters):
6175         (JSC::UStringImpl::hash):
6176         (JSC::UStringImpl::setHash):
6177
6178 2010-03-10  Gavin Barraclough  <barraclough@apple.com>
6179
6180         Reviewed by Darin Adler, Geoffrey Garen, Maciej Stachowiak.
6181
6182         https://bugs.webkit.org/show_bug.cgi?id=35991
6183         Would be faster to not use a thread specific to implement StringImpl::empty()
6184
6185         Change JSC::UStringImpl's implementation of empty() match to match StringImpl's new implementation
6186         (use a static defined within the empty() method), and change the interface to match too (return
6187         a pointer not a reference). 
6188
6189         ~0% performance impact (possible minor progression from moving empty() from .h to .cpp).
6190
6191         * JavaScriptCore.exp:
6192         * runtime/Identifier.cpp:
6193         (JSC::Identifier::add):
6194         (JSC::Identifier::addSlowCase):
6195         * runtime/PropertyNameArray.cpp:
6196         (JSC::PropertyNameArray::add):
6197         * runtime/UString.cpp:
6198         (JSC::initializeUString):
6199         (JSC::UString::UString):
6200         * runtime/UStringImpl.cpp:
6201         (JSC::UStringImpl::empty):
6202         (JSC::UStringImpl::create):
6203         * runtime/UStringImpl.h:
6204         (JSC::UStringImpl::adopt):
6205         (JSC::UStringImpl::createUninitialized):
6206         (JSC::UStringImpl::tryCreateUninitialized):
6207
6208 2010-03-10  Dmitry Titov  <dimich@chromium.org>
6209
6210         Not reviewed, fixing Snow Leopard build.
6211
6212         * wtf/mac/MainThreadMac.mm: Forgot 'static' for a new local function.
6213         (WTF::postTimer):
6214
6215 2010-03-10  Dmitry Titov  <dimich@chromium.org>
6216
6217         Reviewed by Darin Adler.
6218
6219         Make Document::postTask to use a single queue of tasks, to fire them in order
6220         https://bugs.webkit.org/show_bug.cgi?id=35943
6221
6222         The patch uses CFRunLoopTimer to schedule execution of tasks instead of performSelectorOnMainThread which apparently can starve other event sources.
6223         The timer is used when the schedule request is coming on the main thread itself. This happens when the task is posted on the main thread or
6224         when too many tasks are posted and the queue does 'stop and re-schedule' to make sure run loop has a chance to execute other events.
6225
6226         * wtf/mac/MainThreadMac.mm:
6227         (WTF::timerFired):
6228         (WTF::postTimer):
6229         (WTF::scheduleDispatchFunctionsOnMainThread): Use timer posted to the current RunLoop if scheduling the task execution while on the main thread.
6230
6231 2010-03-10  Geoffrey Garen  <ggaren@apple.com>
6232
6233         Windows build fix: added new symbol.
6234
6235         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
6236
6237 2010-03-10  Geoffrey Garen  <ggaren@apple.com>
6238
6239         Windows build fix: removed old symbol.
6240
6241         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
6242
6243 2010-03-09  Geoffrey Garen  <ggaren@apple.com>
6244
6245         Reviewed by Alexey Proskuryakov, Darin Adler, and Sam Weinig.
6246
6247         Refactored fastCheckConsistency to match some review comments:
6248             - renamed fastCheckConsistency to fastMallocSize, and changed ValueCheck
6249               to ASSERT that a pointer's fastMallocSize is not 0.
6250             - implemented a version of fastMallocSize for tcmalloc.
6251             
6252         Also moved some pre-existing code around to avoid a problem related to
6253         mismatched #define/#undef of malloc/free in this source file.
6254
6255         * JavaScriptCore.exp:
6256         * wtf/FastMalloc.cpp:
6257         (WTF::fastMallocSize): Renamed. Fixed indentation.
6258
6259         (WTF::TCMalloc_PageHeap::scavenge): Removed an incorrect ASSERT that
6260         got in the way of testing the tcmalloc implementation. (More information
6261         on why this ASSERT is incorrect is in <rdar://problem/7165917>.)
6262
6263         (WTF::TCMallocStats::fastMallocSize): Implemented for tcmalloc.
6264
6265         * wtf/FastMalloc.h: Updated for rename.
6266
6267         * wtf/ValueCheck.h:
6268         (WTF::): Moved the ASSERT that used to be in fastCheckConsistency here.
6269
6270 2010-03-10  Kevin Ollivier  <kevino@theolliviers.com>
6271
6272         Reviewed by Eric Seidel.
6273
6274         Make global new/delete operators configurable for all ports and disable it
6275         for the wx port for now.
6276
6277         * wtf/FastMalloc.h:
6278         * wtf/Platform.h:
6279
6280 2010-03-09  Gavin Barraclough  <barraclough@apple.com>
6281
6282         Reviewed by NOBODY (reverting r54510).
6283
6284         This caused a performance regression, by breaking the code
6285         generator's logic to calculate the skip level for resolving
6286         variables (traced by rdar:7683350)  Reverting for now.
6287
6288         * parser/Grammar.y:
6289         * parser/NodeConstructors.h:
6290         (JSC::ContinueNode::ContinueNode):
6291         (JSC::BreakNode::BreakNode):
6292         (JSC::ForInNode::ForInNode):
6293         * runtime/CommonIdentifiers.cpp:
6294         (JSC::CommonIdentifiers::CommonIdentifiers):
6295         * runtime/CommonIdentifiers.h:
6296         * runtime/FunctionPrototype.cpp:
6297         (JSC::FunctionPrototype::FunctionPrototype):
6298         * runtime/Identifier.cpp:
6299         (JSC::Identifier::add):
6300         * runtime/PropertyNameArray.cpp:
6301         (JSC::PropertyNameArray::add):
6302
6303 2010-03-09  Geoffrey Garen  <ggaren@apple.com>
6304
6305         Reviewed by Darin Adler.
6306
6307         Changed FastMalloc statistics reporting to be a bit clearer. We now
6308         report:
6309             - Reserved VM Bytes: the VM that has been mapped into the process.
6310             - Committed VM Bytes: the subset of Reserved VM Bytes actually in use.
6311             - Free List Bytes: the subset of Committed VM Bytes in a free list.
6312
6313         * wtf/FastMalloc.cpp:
6314         (WTF::fastMallocStatistics):
6315         (WTF::TCMallocStats::fastMallocStatistics): Updated to report the statistics
6316         above. Standardized use of "ifdef WTF_CHANGES". Added a SpinLockHolder
6317         around all statistics gathering, since it reads from the page heap.
6318
6319         * wtf/FastMalloc.h: Updated to report the statistics above. 
6320
6321 2010-03-09  Gabor Loki  <loki@webkit.org>
6322
6323         Rubber-stamped by Maciej Stachowiak.
6324
6325         Buildfix for ARM after r55684. Add branch8 and branchTest8 functions.
6326         https://bugs.webkit.org/show_bug.cgi?id=35892
6327
6328         * assembler/ARMAssembler.cpp:
6329         (JSC::ARMAssembler::dataTransfer32):
6330         * assembler/ARMAssembler.h:
6331         (JSC::ARMAssembler::):
6332         * assembler/MacroAssemblerARM.h:
6333         (JSC::MacroAssemblerARM::load8):
6334         (JSC::MacroAssemblerARM::branch8):
6335         (JSC::MacroAssemblerARM::branchTest8):
6336
6337 2010-03-08  Geoffrey Garen  <ggaren@apple.com>
6338
6339         Windows build fix: 'P' is not a type. Luckily, 'void' is.
6340
6341         * wtf/FastMalloc.cpp:
6342         (WTF::fastCheckConsistency):
6343
6344 2010-03-08  Geoffrey Garen  <ggaren@apple.com>
6345
6346         Windows build fix: export a new symbol.
6347
6348         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
6349
6350 2010-03-08  Geoffrey Garen  <ggaren@apple.com>
6351
6352         Reviewed by Maciej Stachowiak.
6353
6354         Switching malloc implementations requires a world rebuild
6355         https://bugs.webkit.org/show_bug.cgi?id=35899
6356
6357         * wtf/FastMalloc.cpp:
6358         (WTF::fastCheckConsistency):
6359         (WTF::TCMallocStats::fastCheckConsistency):
6360         * wtf/FastMalloc.h:
6361         * wtf/ValueCheck.h:
6362         (WTF::): Moved pointer checking into a helper function in FastMalloc.cpp,
6363         so you can switch malloc implementations without rebuilding the world.
6364
6365 2010-03-07  Oliver Hunt  <oliver@apple.com>
6366
6367         Reviewed by Darin Adler.
6368
6369         TypeInfo is unnecessarily large
6370         https://bugs.webkit.org/show_bug.cgi?id=35850
6371
6372         Reduce the size of the type and flags members to a single
6373         byte each, reducing the size of Structure by 8 bytes.
6374
6375         * assembler/MacroAssemblerX86Common.h:
6376         (JSC::MacroAssemblerX86Common::branch8):
6377         (JSC::MacroAssemblerX86Common::branchTest8):
6378         (JSC::MacroAssemblerX86Common::setTest8):
6379           Add single byte branches, and correct setTest8 to do a
6380           single byte read from memory, and actually store the result
6381         * assembler/X86Assembler.h:
6382         (JSC::X86Assembler::):
6383         (JSC::X86Assembler::cmpb_im):
6384         (JSC::X86Assembler::testb_im):
6385         * jit/JITCall.cpp:
6386         (JSC::JIT::emit_op_construct_verify):
6387         * jit/JITOpcodes.cpp:
6388         (JSC::JIT::emit_op_instanceof):
6389         (JSC::JIT::emit_op_jeq_null):
6390         (JSC::JIT::emit_op_jneq_null):
6391         (JSC::JIT::emit_op_get_pnames):
6392         (JSC::JIT::emit_op_convert_this):
6393         (JSC::JIT::emit_op_construct_verify):
6394         (JSC::JIT::emit_op_to_jsnumber):
6395         (JSC::JIT::emit_op_eq_null):
6396         (JSC::JIT::emit_op_neq_null):
6397         * runtime/JSTypeInfo.h:
6398         (JSC::TypeInfo::TypeInfo):
6399         (JSC::TypeInfo::type):
6400
6401 2010-03-08  Gavin Barraclough  <barraclough@apple.com>
6402
6403         Reviewed by NOBODY (reverting regression).
6404
6405         Reverting 55035, this caused a regression.
6406         (https://bugs.webkit.org/show_bug.cgi?id=35843)
6407
6408         * runtime/JSString.cpp:
6409         (JSC::JSString::resolveRope):
6410         (JSC::JSString::getStringPropertyDescriptor):
6411         * runtime/JSString.h:
6412         (JSC::jsSingleCharacterSubstring):
6413         (JSC::JSString::getIndex):
6414         (JSC::JSString::getStringPropertySlot):
6415         * runtime/UStringImpl.cpp:
6416         * runtime/UStringImpl.h:
6417
6418 2010-03-08  Stuart Morgan  <stuartmorgan@chromium.org>
6419
6420         Reviewed by Darin Adler.
6421
6422         Added a new USE definition for secure text mode on the Mac.
6423         https://bugs.webkit.org/show_bug.cgi?id=31265
6424
6425         * wtf/Platform.h:
6426
6427 2010-03-08  Jian Li  <jianli@chromium.org>
6428
6429         Reviewed by Dmitry Titov.
6430
6431         Blob.slice support.
6432         https://bugs.webkit.org/show_bug.cgi?id=32993
6433
6434         Add ENABLE_BLOB_SLICE feature define.
6435         Also fix a problem that JSValue.toInteger is not exposed on Windows.
6436
6437         * Configurations/FeatureDefines.xcconfig:
6438         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
6439
6440 2010-03-07  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
6441
6442         Reviewed by Simon Hausmann.
6443
6444         Small performance fix in the QScriptConverter::toString().
6445
6446         The QByteArray was replaced by the QVarLengthArray which doesn't
6447         have to allocate any memory on heap.
6448
6449         [Qt] QScriptConverter::toString() should use QVarLengthArray instead of QByteArray
6450         https://bugs.webkit.org/show_bug.cgi?id=35577
6451
6452         * qt/api/qscriptconverter_p.h:
6453         (QScriptConverter::toString):
6454
6455 2010-03-06  Mark Rowe  <mrowe@apple.com>
6456
6457         Rubber-stamped by Sam Weinig.
6458
6459         Remove unnecessary includes of wtf/Platform.h.  This is already pulled in by config.h.
6460
6461         * API/APICast.h:
6462         * API/JSCallbackFunction.cpp:
6463         * API/JSContextRef.cpp:
6464         * API/JSObjectRef.cpp:
6465         * API/JSValueRef.cpp:
6466         * assembler/ARMAssembler.h:
6467         * assembler/ARMv7Assembler.h:
6468         * assembler/AbstractMacroAssembler.h:
6469         * assembler/AssemblerBuffer.h:
6470         * assembler/AssemblerBufferWithConstantPool.h:
6471         * assembler/CodeLocation.h:
6472         * assembler/LinkBuffer.h:
6473         * assembler/MIPSAssembler.h:
6474         * assembler/MacroAssembler.h:
6475         * assembler/MacroAssemblerARM.h:
6476         * assembler/MacroAssemblerARMv7.h:
6477         * assembler/MacroAssemblerCodeRef.h:
6478         * assembler/MacroAssemblerMIPS.h:
6479         * assembler/MacroAssemblerX86.h:
6480         * assembler/MacroAssemblerX86Common.h:
6481         * assembler/MacroAssemblerX86_64.h:
6482         * assembler/RepatchBuffer.h:
6483         * assembler/X86Assembler.h:
6484         * jit/JIT.h:
6485         * jit/JITCode.h:
6486         * jit/JITInlineMethods.h:
6487         * jit/JITStubs.h:
6488         * os-win32/stdint.h:
6489         * runtime/JSAPIValueWrapper.h:
6490         * runtime/JSImmediate.h:
6491         * wtf/ASCIICType.h:
6492         * wtf/StdLibExtras.h:
6493         * wtf/VMTags.h:
6494         * yarr/RegexCompiler.h:
6495         * yarr/RegexInterpreter.h:
6496         * yarr/RegexJIT.h:
6497         * yarr/RegexParser.h:
6498         * yarr/RegexPattern.h:
6499
6500 2010-03-06  Kwang Yul Seo  <skyul@company100.net>
6501
6502         Reviewed by Eric Seidel.
6503
6504         [BREWMP] Share OwnPtr.
6505         https://bugs.webkit.org/show_bug.cgi?id=35776
6506
6507         Share OwnPtr implementation with BREW MP and remove OwnPtrBrew.
6508
6509         * wtf/OwnPtrBrew.cpp: Added.
6510         (WTF::deleteOwnedPtr):
6511         * wtf/OwnPtrCommon.h:
6512         * wtf/brew/OwnPtrBrew.cpp: Removed.
6513         * wtf/brew/OwnPtrBrew.h: Removed.
6514
6515 2010-03-06  Patrick Gansterer  <paroga@paroga.com>
6516
6517         Reviewed by Eric Seidel.
6518
6519         Implemented JIT_OPTIMIZE_NATIVE_CALL for WinCE
6520         https://bugs.webkit.org/show_bug.cgi?id=33426
6521
6522         * jit/JITOpcodes.cpp:
6523         (JSC::JIT::privateCompileCTIMachineTrampolines):
6524
6525 2010-03-05  Oliver Hunt  <oliver@apple.com>
6526
6527         Reviewed by NOBODY (build fix).
6528
6529         Add enw exports to windows
6530
6531         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
6532
6533 2010-03-05  Oliver Hunt  <oliver@apple.com>
6534
6535         Reviewed by Gavin Barraclough.
6536
6537         JSC should cache int to Identifier conversion as it does for ordinary strings
6538         https://bugs.webkit.org/show_bug.cgi?id=35814
6539
6540         Make the NumericStrings cache cache unsigned ints in addition to signed.
6541         We keep them separate from the int cache as it both simplifies code, and
6542         also because the unsigned path is exclusive to property access and therefore
6543         seems to have different usage patterns.
6544
6545         The primary trigger for the unsigned to Identifier propertyName conversion
6546         is the construction of array-like objects out of normal objects.  Given these
6547         tend to be relative small numbers, and the array-like behaviour lends itself
6548         to sequential values this patch also adds a non-colliding cache for all small
6549         numbers.
6550
6551         * JavaScriptCore.exp:
6552         * runtime/Identifier.cpp:
6553         (JSC::Identifier::from):
6554         * runtime/Identifier.h:
6555         * runtime/NumericStrings.h:
6556         (JSC::NumericStrings::add):
6557         (JSC::NumericStrings::lookup):
6558         (JSC::NumericStrings::lookupSmallString):
6559
6560 2010-03-03  Oliver Hunt  <oliver@apple.com>
6561
6562         Reviewed by Gavin Barraclough.
6563
6564         Allow static property getters to interact with JSCs caching
6565         https://bugs.webkit.org/show_bug.cgi?id=35716
6566
6567         Add new opcodes for handling cached lookup of static value getters.
6568         More or less the same as with JS getters, all that changes is that
6569         instead of calling through a JSFunction we always know that we have
6570         a C function to call.
6571
6572         For the patching routines in the JIT we now need to pass a few
6573         new parameters to allow us to pass enough information to the stub
6574         function to allow us to call the C function correctly.  Logically
6575         this shouldn't actually be necessary as all of these functions ignore
6576         the identifier, but removing the ident parameter would require
6577         somewhat involved changes to the way we implement getOwnPropertySlot,
6578         etc.
6579
6580         * bytecode/CodeBlock.cpp:
6581         (JSC::CodeBlock::dump):
6582         (JSC::CodeBlock::derefStructures):
6583         (JSC::CodeBlock::refStructures):
6584         * bytecode/Instruction.h:
6585         (JSC::Instruction::Instruction):
6586         (JSC::Instruction::):
6587         * bytecode/Opcode.h:
6588         * interpreter/Interpreter.cpp:
6589         (JSC::Interpreter::tryCacheGetByID):
6590         (JSC::Interpreter::privateExecute):
6591         * jit/JIT.cpp:
6592         (JSC::JIT::privateCompileMainPass):
6593         * jit/JIT.h:
6594         (JSC::JIT::compileGetByIdProto):
6595         (JSC::JIT::compileGetByIdSelfList):
6596         (JSC::JIT::compileGetByIdProtoList):
6597         (JSC::JIT::compileGetByIdChainList):
6598         (JSC::JIT::compileGetByIdChain):
6599         * jit/JITPropertyAccess.cpp:
6600         (JSC::JIT::privateCompileGetByIdProto):
6601         (JSC::JIT::privateCompileGetByIdSelfList):
6602         (JSC::JIT::privateCompileGetByIdProtoList):
6603         (JSC::JIT::privateCompileGetByIdChainList):
6604         (JSC::JIT::privateCompileGetByIdChain):
6605         * jit/JITPropertyAccess32_64.cpp:
6606         (JSC::JIT::privateCompileGetByIdProto):
6607         (JSC::JIT::privateCompileGetByIdSelfList):
6608         (JSC::JIT::privateCompileGetByIdProtoList):
6609         (JSC::JIT::privateCompileGetByIdChainList):
6610         (JSC::JIT::privateCompileGetByIdChain):
6611         * jit/JITStubs.cpp:
6612         (JSC::JITThunks::tryCacheGetByID):
6613         (JSC::DEFINE_STUB_FUNCTION):
6614         * jit/JITStubs.h:
6615         (JSC::):
6616         * runtime/JSFunction.cpp:
6617         (JSC::JSFunction::getOwnPropertySlot):
6618         * runtime/Lookup.h:
6619         (JSC::getStaticPropertySlot):
6620         (JSC::getStaticValueSlot):
6621         * runtime/PropertySlot.h:
6622         (JSC::PropertySlot::):
6623         (JSC::PropertySlot::PropertySlot):
6624         (JSC::PropertySlot::cachedPropertyType):
6625         (JSC::PropertySlot::isCacheable):
6626         (JSC::PropertySlot::isCacheableValue):
6627         (JSC::PropertySlot::setValueSlot):
6628         (JSC::PropertySlot::setCacheableCustom):
6629         (JSC::PropertySlot::setGetterSlot):
6630         (JSC::PropertySlot::setCacheableGetterSlot):
6631         (JSC::PropertySlot::clearOffset):
6632         (JSC::PropertySlot::customGetter):
6633
6634 2010-03-04  Shinichiro Hamaji  <hamaji@chromium.org>
6635
6636         Unreviewed. Remove a non-ASCII character introduced in the following bug.
6637
6638         put_by_id does will incorrectly cache writes where a specific value exists, where at the point of caching the same value is being written.
6639         https://bugs.webkit.org/show_bug.cgi?id=35537
6640
6641         * runtime/JSObject.h:
6642         (JSC::JSObject::putDirectInternal):
6643
6644 2010-03-04  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
6645
6646         Reviewed by Tor Arne Vestbø.
6647
6648         [Qt] Make the OUTPUT_DIR variable in qmake projects independent of build-webkit's logic.
6649
6650         This also allows shadow builds relying only on qmake to work properly.
6651         * jsc.pro:
6652         * qt/api/QtScript.pro:
6653         * qt/tests/qscriptengine/qscriptengine.pro:
6654         * qt/tests/qscriptvalue/qscriptvalue.pro:
6655         * qt/tests/tests.pri:
6656
6657 2010-03-03  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
6658
6659         Reviewed by Simon Hausmann.
6660
6661         QScriptValue::isObject fix.
6662
6663         Fix broken internal state evaluation from JSValue to JSNative / JSObject.
6664         New function was introduced which should take care about promoting
6665         JSValue state inside QScriptValuePrivate. It should be used instead of a
6666         direct JSC C API call.
6667
6668         The bug exposed a weakness in autotest suite, as the QScriptValuePrivate
6669         is based on state machine with lazy state evaluation, there is a possibility
6670         that serial sequencial calls to the same public const function could return
6671         different results. The patch fix the issue.
6672
6673         [Qt] Sometimes QScriptValue::isObject returns an incorrect value
6674         https://bugs.webkit.org/show_bug.cgi?id=35387
6675
6676         * qt/api/qscriptvalue_p.h:
6677         (QScriptValuePrivate::isBool):
6678         (QScriptValuePrivate::isNumber):
6679         (QScriptValuePrivate::isNull):
6680         (QScriptValuePrivate::isString):
6681         (QScriptValuePrivate::isUndefined):
6682         (QScriptValuePrivate::isError):
6683         (QScriptValuePrivate::isObject):
6684         (QScriptValuePrivate::isFunction):
6685         (QScriptValuePrivate::call):
6686         (QScriptValuePrivate::refineJSValue):
6687         * qt/tests/qscriptvalue/tst_qscriptvalue_generated.cpp:
6688         (tst_QScriptValue::initScriptValues):
6689         (tst_QScriptValue::isValid_makeData):
6690         (tst_QScriptValue::isValid_test):
6691         (tst_QScriptValue::isBool_makeData):
6692         (tst_QScriptValue::isBool_test):
6693         (tst_QScriptValue::isBoolean_makeData):
6694         (tst_QScriptValue::isBoolean_test):
6695         (tst_QScriptValue::isNumber_makeData):
6696         (tst_QScriptValue::isNumber_test):
6697         (tst_QScriptValue::isFunction_test):
6698         (tst_QScriptValue::isNull_makeData):
6699         (tst_QScriptValue::isNull_test):
6700         (tst_QScriptValue::isString_makeData):
6701         (tst_QScriptValue::isString_test):
6702         (tst_QScriptValue::isUndefined_makeData):
6703         (tst_QScriptValue::isUndefined_test):
6704         (tst_QScriptValue::isObject_makeData):
6705         (tst_QScriptValue::isObject_test):
6706         (tst_QScriptValue::toString_makeData):
6707         (tst_QScriptValue::toString_test):
6708         (tst_QScriptValue::toNumber_makeData):
6709         (tst_QScriptValue::toNumber_test):
6710         (tst_QScriptValue::toBool_makeData):
6711         (tst_QScriptValue::toBool_test):
6712         (tst_QScriptValue::toBoolean_makeData):
6713         (tst_QScriptValue::toBoolean_test):
6714         (tst_QScriptValue::toInteger_makeData):
6715         (tst_QScriptValue::toInteger_test):
6716         (tst_QScriptValue::toInt32_makeData):
6717         (tst_QScriptValue::toInt32_test):
6718         (tst_QScriptValue::toUInt32_makeData):
6719         (tst_QScriptValue::toUInt32_test):
6720         (tst_QScriptValue::toUInt16_makeData):
6721         (tst_QScriptValue::toUInt16_test):
6722
6723 2010-03-03  Chao-ying Fu  <fu@mips.com>
6724
6725         Reviewed by Gavin Barraclough.
6726
6727         MIPS JIT Supports
6728         https://bugs.webkit.org/show_bug.cgi?id=30144
6729
6730         The following changes enable MIPS YARR and YARR_JIT.
6731
6732         * assembler/AbstractMacroAssembler.h:
6733         (JSC::AbstractMacroAssembler::Imm32::Imm32):
6734         * assembler/MIPSAssembler.h: Added.
6735         (JSC::MIPSRegisters::):
6736         (JSC::MIPSAssembler::MIPSAssembler):
6737         (JSC::MIPSAssembler::):
6738         (JSC::MIPSAssembler::JmpSrc::JmpSrc):
6739         (JSC::MIPSAssembler::JmpDst::JmpDst):
6740         (JSC::MIPSAssembler::JmpDst::isUsed):
6741         (JSC::MIPSAssembler::JmpDst::used):
6742         (JSC::MIPSAssembler::emitInst):
6743         (JSC::MIPSAssembler::nop):
6744         (JSC::MIPSAssembler::loadDelayNop):
6745         (JSC::MIPSAssembler::copDelayNop):
6746         (JSC::MIPSAssembler::move):
6747         (JSC::MIPSAssembler::li):
6748         (JSC::MIPSAssembler::lui):
6749         (JSC::MIPSAssembler::addiu):
6750         (JSC::MIPSAssembler::addu):
6751         (JSC::MIPSAssembler::subu):
6752         (JSC::MIPSAssembler::mult):
6753         (JSC::MIPSAssembler::mfhi):
6754         (JSC::MIPSAssembler::mflo):
6755         (JSC::MIPSAssembler::mul):
6756         (JSC::MIPSAssembler::andInsn):
6757         (JSC::MIPSAssembler::andi):
6758         (JSC::MIPSAssembler::nor):
6759         (JSC::MIPSAssembler::orInsn):
6760         (JSC::MIPSAssembler::ori):
6761         (JSC::MIPSAssembler::xorInsn):
6762         (JSC::MIPSAssembler::xori):
6763         (JSC::MIPSAssembler::slt):
6764         (JSC::MIPSAssembler::sltu):
6765         (JSC::MIPSAssembler::sltiu):
6766         (JSC::MIPSAssembler::sll):
6767         (JSC::MIPSAssembler::sllv):
6768         (JSC::MIPSAssembler::sra):
6769         (JSC::MIPSAssembler::srav):
6770         (JSC::MIPSAssembler::lw):
6771         (JSC::MIPSAssembler::lwl):
6772         (JSC::MIPSAssembler::lwr):
6773         (JSC::MIPSAssembler::lhu):
6774         (JSC::MIPSAssembler::sw):
6775         (JSC::MIPSAssembler::jr):
6776         (JSC::MIPSAssembler::jalr):
6777         (JSC::MIPSAssembler::jal):
6778         (JSC::MIPSAssembler::bkpt):
6779         (JSC::MIPSAssembler::bgez):
6780         (JSC::MIPSAssembler::bltz):
6781         (JSC::MIPSAssembler::beq):
6782         (JSC::MIPSAssembler::bne):
6783         (JSC::MIPSAssembler::bc1t):
6784         (JSC::MIPSAssembler::bc1f):
6785         (JSC::MIPSAssembler::newJmpSrc):
6786         (JSC::MIPSAssembler::appendJump):
6787         (JSC::MIPSAssembler::addd):
6788         (JSC::MIPSAssembler::subd):
6789         (JSC::MIPSAssembler::muld):
6790         (JSC::MIPSAssembler::lwc1):
6791         (JSC::MIPSAssembler::ldc1):
6792         (JSC::MIPSAssembler::swc1):
6793         (JSC::MIPSAssembler::sdc1):
6794         (JSC::MIPSAssembler::mtc1):
6795         (JSC::MIPSAssembler::mfc1):
6796         (JSC::MIPSAssembler::truncwd):
6797         (JSC::MIPSAssembler::cvtdw):
6798         (JSC::MIPSAssembler::ceqd):
6799         (JSC::MIPSAssembler::cngtd):
6800         (JSC::MIPSAssembler::cnged):
6801         (JSC::MIPSAssembler::cltd):
6802         (JSC::MIPSAssembler::cled):
6803         (JSC::MIPSAssembler::cueqd):
6804         (JSC::MIPSAssembler::coled):
6805         (JSC::MIPSAssembler::coltd):
6806         (JSC::MIPSAssembler::culed):
6807         (JSC::MIPSAssembler::cultd):
6808         (JSC::MIPSAssembler::label):
6809         (JSC::MIPSAssembler::align):
6810         (JSC::MIPSAssembler::getRelocatedAddress):
6811         (JSC::MIPSAssembler::getDifferenceBetweenLabels):
6812         (JSC::MIPSAssembler::size):
6813         (JSC::MIPSAssembler::executableCopy):
6814         (JSC::MIPSAssembler::getCallReturnOffset):
6815         (JSC::MIPSAssembler::linkJump):
6816         (JSC::MIPSAssembler::linkCall):
6817         (JSC::MIPSAssembler::linkPointer):
6818         (JSC::MIPSAssembler::relinkJump):
6819         (JSC::MIPSAssembler::relinkCall):
6820         (JSC::MIPSAssembler::repatchInt32):
6821         (JSC::MIPSAssembler::repatchPointer):
6822         (JSC::MIPSAssembler::repatchLoadPtrToLEA):
6823         (JSC::MIPSAssembler::relocateJumps):
6824         (JSC::MIPSAssembler::linkWithOffset):
6825         (JSC::MIPSAssembler::linkCallInternal):
6826         * assembler/MacroAssembler.h:
6827         * assembler/MacroAssemblerMIPS.h: Added.
6828         (JSC::MacroAssemblerMIPS::MacroAssemblerMIPS):
6829         (JSC::MacroAssemblerMIPS::):
6830         (JSC::MacroAssemblerMIPS::add32):
6831         (JSC::MacroAssemblerMIPS::and32):
6832         (JSC::MacroAssemblerMIPS::lshift32):
6833         (JSC::MacroAssemblerMIPS::mul32):
6834         (JSC::MacroAssemblerMIPS::not32):
6835         (JSC::MacroAssemblerMIPS::or32):
6836         (JSC::MacroAssemblerMIPS::rshift32):
6837         (JSC::MacroAssemblerMIPS::sub32):
6838         (JSC::MacroAssemblerMIPS::xor32):
6839         (JSC::MacroAssemblerMIPS::load32):
6840         (JSC::MacroAssemblerMIPS::load32WithUnalignedHalfWords):
6841         (JSC::MacroAssemblerMIPS::load32WithAddressOffsetPatch):
6842         (JSC::MacroAssemblerMIPS::loadPtrWithPatchToLEA):
6843         (JSC::MacroAssemblerMIPS::loadPtrWithAddressOffsetPatch):
6844         (JSC::MacroAssemblerMIPS::load16):
6845         (JSC::MacroAssemblerMIPS::store32WithAddressOffsetPatch):
6846         (JSC::MacroAssemblerMIPS::store32):
6847         (JSC::MacroAssemblerMIPS::supportsFloatingPoint):
6848         (JSC::MacroAssemblerMIPS::supportsFloatingPointTruncate):
6849         (JSC::MacroAssemblerMIPS::pop):
6850         (JSC::MacroAssemblerMIPS::push):
6851         (JSC::MacroAssemblerMIPS::move):
6852         (JSC::MacroAssemblerMIPS::swap):
6853         (JSC::MacroAssemblerMIPS::signExtend32ToPtr):
6854         (JSC::MacroAssemblerMIPS::zeroExtend32ToPtr):
6855         (JSC::MacroAssemblerMIPS::branch32):
6856         (JSC::MacroAssemblerMIPS::branch32WithUnalignedHalfWords):
6857         (JSC::MacroAssemblerMIPS::branch16):
6858         (JSC::MacroAssemblerMIPS::branchTest32):
6859         (JSC::MacroAssemblerMIPS::jump):
6860         (JSC::MacroAssemblerMIPS::branchAdd32):
6861         (JSC::MacroAssemblerMIPS::branchMul32):
6862         (JSC::MacroAssemblerMIPS::branchSub32):
6863         (JSC::MacroAssemblerMIPS::breakpoint):
6864         (JSC::MacroAssemblerMIPS::nearCall):
6865         (JSC::MacroAssemblerMIPS::call):
6866         (JSC::MacroAssemblerMIPS::ret):
6867         (JSC::MacroAssemblerMIPS::set32):
6868         (JSC::MacroAssemblerMIPS::setTest32):
6869         (JSC::MacroAssemblerMIPS::moveWithPatch):
6870         (JSC::MacroAssemblerMIPS::branchPtrWithPatch):
6871         (JSC::MacroAssemblerMIPS::storePtrWithPatch):
6872         (JSC::MacroAssemblerMIPS::tailRecursiveCall):
6873         (JSC::MacroAssemblerMIPS::makeTailRecursiveCall):
6874         (JSC::MacroAssemblerMIPS::loadDouble):
6875         (JSC::MacroAssemblerMIPS::storeDouble):
6876         (JSC::MacroAssemblerMIPS::addDouble):
6877         (JSC::MacroAssemblerMIPS::subDouble):
6878         (JSC::MacroAssemblerMIPS::mulDouble):
6879         (JSC::MacroAssemblerMIPS::convertInt32ToDouble):
6880         (JSC::MacroAssemblerMIPS::insertRelaxationWords):
6881         (JSC::MacroAssemblerMIPS::branchTrue):
6882         (JSC::MacroAssemblerMIPS::branchFalse):
6883         (JSC::MacroAssemblerMIPS::branchEqual):
6884         (JSC::MacroAssemblerMIPS::branchNotEqual):
6885         (JSC::MacroAssemblerMIPS::branchDouble):
6886         (JSC::MacroAssemblerMIPS::branchTruncateDoubleToInt32):
6887         (JSC::MacroAssemblerMIPS::linkCall):
6888         (JSC::MacroAssemblerMIPS::repatchCall):
6889         * jit/ExecutableAllocator.h:
6890         (JSC::ExecutableAllocator::cacheFlush):
6891         * wtf/Platform.h:
6892         * yarr/RegexJIT.cpp:
6893         (JSC::Yarr::RegexGenerator::generateEnter):
6894         (JSC::Yarr::RegexGenerator::generateReturn):
6895
6896 2010-03-03  Steve Falkenburg  <sfalken@apple.com>
6897
6898         Windows build fix.
6899
6900         * JavaScriptCore.vcproj/jsc/jsc.vcproj:
6901         * JavaScriptCore.vcproj/jsc/jscCommon.vsprops:
6902
6903 2010-03-03  Steve Falkenburg  <sfalken@apple.com>
6904
6905         Windows build fix.
6906
6907         * JavaScriptCore.vcproj/jsc/jsc.vcproj:
6908
6909 2010-03-03  Mark Rowe  <mrowe@apple.com>
6910
6911         Reviewed by Geoff Garen.
6912
6913         Add virtual memory tags for TCMalloc and WebCore's purgeable buffers.
6914
6915         * wtf/TCSystemAlloc.cpp:
6916         (TryMmap): Use the VM tag.
6917         * wtf/VMTags.h: Make use of VM_MEMORY_TCMALLOC and VM_MEMORY_WEBCORE_PURGEABLE_BUFFERS.
6918
6919 2010-03-03  Steve Falkenburg  <sfalken@apple.com>
6920
6921         Rubber stamped by Adam Roben.
6922
6923         Fix bogus xcopy that was polluting source tree at build time.
6924
6925         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
6926
6927 2010-03-02  Fridrich Strba  <fridrich.strba@bluewin.ch>
6928
6929         Reviewed by Oliver Hunt.
6930
6931         Allow building smoothly on win32 and win64 using GCC
6932         https://bugs.webkit.org/show_bug.cgi?id=35607
6933
6934         * jit/JITStubs.h:
6935         * runtime/Collector.cpp:
6936         (JSC::Heap::allocateBlock):
6937         (JSC::Heap::freeBlockPtr):
6938         (JSC::currentThreadStackBase):
6939
6940 2010-03-02  Jeremy Orlow  <jorlow@chromium.org>
6941
6942         Reviewed by David Levin.
6943
6944         Revert database thread changes that are no longer required
6945         https://bugs.webkit.org/show_bug.cgi?id=35519
6946
6947         Jochen Eisinger created 55214 and 55247 to track which database
6948         owns which thread.  Dmitry suggested that this could also
6949         be done via TLS, though.  After exploring the options, Jochen
6950         chose to go the TLS route, so these patches are no longer needed.
6951
6952         * wtf/Threading.h:
6953         * wtf/ThreadingNone.cpp:
6954         (WTF::isMainThread):
6955         * wtf/ThreadingPthreads.cpp:
6956         (WTF::identifierByPthreadHandle):
6957         (WTF::establishIdentifierForPthreadHandle):
6958         (WTF::pthreadHandleForIdentifier):
6959         (WTF::createThreadInternal):
6960         (WTF::currentThread):
6961         * wtf/ThreadingWin.cpp:
6962         (WTF::threadMap):
6963         (WTF::storeThreadHandleByIdentifier):
6964         (WTF::threadHandleForIdentifier):
6965         (WTF::createThreadInternal):
6966
6967 2010-03-02  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
6968
6969         Reviewed by Simon Hausmann.
6970
6971         Fix QScriptValue::toString().
6972
6973         More ECMA Script compliance, especially for values as NaN, Inifinite
6974         and really big/small numbers.
6975
6976         [Qt] QScriptValue::toString() returns incorrect values
6977         https://bugs.webkit.org/show_bug.cgi?id=34850
6978
6979         * qt/api/qscriptconverter_p.h:
6980         (QScriptConverter::toString):
6981         * qt/api/qscriptvalue_p.h:
6982         (QScriptValuePrivate::toString):
6983         * qt/tests/qscriptvalue/tst_qscriptvalue.cpp:
6984         * qt/tests/qscriptvalue/tst_qscriptvalue.h:
6985         * qt/tests/qscriptvalue/tst_qscriptvalue_generated.cpp:
6986         (tst_QScriptValue::toString_initData):
6987         (tst_QScriptValue::toString_makeData):
6988         (tst_QScriptValue::toString_test):
6989
6990 2010-03-02  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
6991
6992         Reviewed by Simon Hausmann.
6993
6994         Introduce a new class; QScriptString.
6995
6996         The QScriptString class should act as a handle to "interned"
6997         strings in a QScriptEngine.
6998
6999         [Qt] QtScript should provide QScriptString
7000         https://bugs.webkit.org/show_bug.cgi?id=34843
7001
7002         * qt/api/QtScript.pro:
7003         * qt/api/qscriptengine.cpp:
7004         (QScriptEngine::toStringHandle):
7005         * qt/api/qscriptengine.h:
7006         * qt/api/qscriptengine_p.h:
7007         (QScriptEnginePrivate::toStringHandle):
7008         * qt/api/qscriptstring.cpp: Added.
7009         (QScriptString::QScriptString):
7010         (QScriptString::~QScriptString):
7011         (QScriptString::operator=):
7012         (QScriptString::isValid):
7013         (QScriptString::operator==):
7014         (QScriptString::operator!=):
7015         (QScriptString::toArrayIndex):
7016         (QScriptString::toString):
7017         (QScriptString::operator QString):
7018         (qHash):
7019         * qt/api/qscriptstring.h: Added.
7020         * qt/api/qscriptstring_p.h: Added.
7021         (QScriptStringPrivate::QScriptStringPrivate):
7022         (QScriptStringPrivate::~QScriptStringPrivate):
7023         (QScriptStringPrivate::get):
7024         (QScriptStringPrivate::isValid):
7025         (QScriptStringPrivate::operator==):
7026         (QScriptStringPrivate::operator!=):
7027         (QScriptStringPrivate::toArrayIndex):
7028         (QScriptStringPrivate::toString):
7029         (QScriptStringPrivate::id):
7030         * qt/tests/qscriptstring/qscriptstring.pro: Added.
7031         * qt/tests/qscriptstring/tst_qscriptstring.cpp: Added.
7032         (tst_QScriptString::tst_QScriptString):
7033         (tst_QScriptString::~tst_QScriptString):
7034         (tst_QScriptString::test):
7035         (tst_QScriptString::hash):
7036         (tst_QScriptString::toArrayIndex_data):
7037         (tst_QScriptString::toArrayIndex):
7038         * qt/tests/tests.pro:
7039
7040 2010-03-02  Oliver Hunt  <oliver@apple.com>
7041
7042         Reviewed by NOBODY (Build fix).
7043
7044         Export function on windows.
7045
7046         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
7047
7048 2010-03-01  Oliver Hunt  <oliver@apple.com>
7049
7050         Reviewed by Maciej Stachowiak.
7051
7052         Refactor named getter function signature to be in line with indexing getter signature
7053         https://bugs.webkit.org/show_bug.cgi?id=35563
7054
7055         This removes the PropertySlot argument from getter functions, and makes them directly
7056         pass the slot base.  This makes the semantics for the functions match that of the
7057         indexing getters.
7058
7059         On the down side, this means that we can no longer simply use a proxy function for
7060         JS getters, so we now add another marker value to indicate that a getter is present
7061         and branch accordingly.
7062
7063         Against all rationality sunspider reports this as a perf win, but i suspect it's just noise.
7064
7065         * API/JSCallbackObject.h:
7066         * API/JSCallbackObjectFunctions.h:
7067         (JSC::::staticValueGetter):
7068         (JSC::::staticFunctionGetter):
7069         (JSC::::callbackGetter):
7070         * JavaScriptCore.exp:
7071         * runtime/JSActivation.cpp:
7072         (JSC::JSActivation::argumentsGetter):
7073         * runtime/JSActivation.h:
7074         * runtime/JSFunction.cpp:
7075         (JSC::JSFunction::argumentsGetter):
7076         (JSC::JSFunction::callerGetter):
7077         (JSC::JSFunction::lengthGetter):
7078         * runtime/JSFunction.h:
7079         * runtime/NumberConstructor.cpp:
7080         (JSC::numberConstructorNaNValue):
7081         (JSC::numberConstructorNegInfinity):
7082         (JSC::numberConstructorPosInfinity):
7083         (JSC::numberConstructorMaxValue):
7084         (JSC::numberConstructorMinValue):
7085         * runtime/PropertySlot.cpp:
7086         (JSC::PropertySlot::functionGetter):
7087         * runtime/PropertySlot.h:
7088         (JSC::PropertySlot::getValue):
7089         (JSC::PropertySlot::setGetterSlot):
7090         (JSC::PropertySlot::setCacheableGetterSlot):
7091         * runtime/RegExpConstructor.cpp:
7092         (JSC::regExpConstructorDollar1):
7093         (JSC::regExpConstructorDollar2):
7094         (JSC::regExpConstructorDollar3):
7095         (JSC::regExpConstructorDollar4):
7096         (JSC::regExpConstructorDollar5):
7097         (JSC::regExpConstructorDollar6):
7098         (JSC::regExpConstructorDollar7):
7099         (JSC::regExpConstructorDollar8):
7100         (JSC::regExpConstructorDollar9):
7101         (JSC::regExpConstructorInput):
7102         (JSC::regExpConstructorMultiline):
7103         (JSC::regExpConstructorLastMatch):
7104         (JSC::regExpConstructorLastParen):
7105         (JSC::regExpConstructorLeftContext):
7106         (JSC::regExpConstructorRightContext):
7107         * runtime/RegExpObject.cpp:
7108         (JSC::regExpObjectGlobal):
7109         (JSC::regExpObjectIgnoreCase):
7110         (JSC::regExpObjectMultiline):
7111         (JSC::regExpObjectSource):
7112         (JSC::regExpObjectLastIndex):
7113
7114 2010-03-01  Oliver Hunt  <oliver@apple.com>
7115
7116         Reviewed by Gavin Barraclough.
7117
7118         PropertySlot::getValue(ExecState, unsigned) unnecessarily converts index to an Identifier
7119         https://bugs.webkit.org/show_bug.cgi?id=35561
7120
7121         Fix this by defining a separate property getter function for index getters.  This allows
7122         us to pass an unsigned number without the conversion to an Identifier.  We then update
7123         setCustomIndex to take this new getter type.
7124
7125         * runtime/PropertySlot.h:
7126         (JSC::PropertySlot::getValue):
7127         (JSC::PropertySlot::setCustom):
7128         (JSC::PropertySlot::setCustomIndex):
7129
7130 2010-03-01  Gavin Barraclough  <barraclough@apple.com>
7131
7132         Reviewed by Oliver Hunt.
7133
7134         Bug 35537 - put_by_id does will incorrectly cache writes where a specific value exists,
7135                     where at the point of caching the same value is being written.
7136
7137         When performing a put_by_id that is replacing a property already present on the object,
7138         there are three interesting cases regarding the state of the specific value:
7139
7140         (1) No specific value set - nothing to do, leave the structure in it's current state,
7141             can cache.
7142         (2) A specific value was set, the new put is not of a specified value (i.e. function),
7143             or is of a different specific value - in these cases we need to perform a despecifying
7144             transition to clear the specific value in the structure, but having done so this is a
7145             normal property so as such we can again cache normally.
7146         (3) A specific value was set, and we are overwriting with the same value - in these cases
7147             leave the structure unchanged, but since a specific value is set we cannot cache this
7148             put (we would need the JIT to dynamically check the value being written matched).
7149
7150         Unfortunately, the current behaviour does not match this.  the checks for a specific value
7151         being present & the value matching are combined in such a way that in case (2), above we
7152         will unnecessarily prevent the transition being cached, but in case (3) we will incorrectly
7153         fail to prevent caching.
7154
7155         The bug exposes itself if multiple puts of the same specific value are performed to a
7156         property, and erroneously the put is allowed to be cached by the JIT.  Method checks may be
7157         generated caching calls of this structure.  Subsequent puts performed from JIT code may
7158         write different values without triggering a despecify transition, and as such cached method
7159         checks will continue to pass, despite the value having changed.
7160
7161         * runtime/JSObject.h:
7162         (JSC::JSObject::putDirectInternal):
7163
7164 2010-03-01  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
7165
7166         Reviewed by Simon Hausmann.
7167
7168         Fix the Qt build on Mac OS X/Cocoa 64-bit
7169
7170         * JavaScriptCore.pri: Add missing implementation file to resolve JSC symbols
7171
7172 2010-02-26  Gavin Barraclough  <barraclough@apple.com>
7173
7174         Rubber Stamped by Geoff Garen.
7175
7176         Remove wrec.  All builds should have switched to yarr by now.
7177
7178         * Android.mk:
7179         * GNUmakefile.am:
7180         * JavaScriptCore.gypi:
7181         * JavaScriptCore.pri:
7182         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
7183         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
7184         * JavaScriptCore.vcproj/jsc/jscCommon.vsprops:
7185         * JavaScriptCore.xcodeproj/project.pbxproj:
7186         * runtime/RegExp.cpp:
7187         (JSC::RegExp::match):
7188         * runtime/RegExp.h:
7189         * wrec: Removed.
7190         * wrec/CharacterClass.cpp: Removed.
7191         * wrec/CharacterClass.h: Removed.
7192         * wrec/CharacterClassConstructor.cpp: Removed.
7193         * wrec/CharacterClassConstructor.h: Removed.
7194         * wrec/Escapes.h: Removed.
7195         * wrec/Quantifier.h: Removed.
7196         * wrec/WREC.cpp: Removed.
7197         * wrec/WREC.h: Removed.
7198         * wrec/WRECFunctors.cpp: Removed.
7199         * wrec/WRECFunctors.h: Removed.
7200         * wrec/WRECGenerator.cpp: Removed.
7201         * wrec/WRECGenerator.h: Removed.
7202         * wrec/WRECParser.cpp: Removed.
7203         * wrec/WRECParser.h: Removed.
7204         * wscript:
7205
7206 2010-02-26  Oliver Hunt  <oliver@apple.com>
7207
7208         Reviewed by Geoff Garen.
7209
7210         Make the lookup table generator include an explicit cast to expected
7211         type of the function.  We do this because otherwise the blind intptr_t
7212         cast that is subsequently applied allows incorrectly typed functions
7213         to be inserted into the table, where they will only fail at runtime.
7214         This change makes such errors produce a compile time failure.
7215
7216         * create_hash_table:
7217
7218 2010-02-26  Janne Koskinen  <janne.p.koskinen@digia.com>
7219
7220         Reviewed by Simon Hausmann.
7221
7222         [Qt] Symbian specific getCPUTime implemetation
7223         https://bugs.webkit.org/show_bug.cgi?id=34742
7224
7225         Default implementation doesn't work on Symbian devices.
7226         This change adds a proper implementation by
7227         asking thread execution time from the current thread.
7228
7229         * runtime/TimeoutChecker.cpp:
7230         (JSC::getCPUTime):
7231
7232 2010-02-25  Alexey Proskuryakov  <ap@apple.com>
7233
7234         Reviewed by Anders Carlsson.
7235
7236         https://bugs.webkit.org/show_bug.cgi?id=35406
7237         <rdar://problem/6945502> Make generic array methods work with JavaArray
7238
7239         Renamed lazyCreationData to subclassData. This is extra data that can be used by JSArray
7240         subclasses (you can't add new data members, because it wouldn't fit in JSCell otherwise).
7241
7242         * JavaScriptCore.exp:
7243         * runtime/JSArray.cpp:
7244         (JSC::JSArray::JSArray):
7245         (JSC::JSArray::subclassData):
7246         (JSC::JSArray::setSubclassData):
7247         * runtime/JSArray.h:
7248         * runtime/RegExpConstructor.cpp:
7249         (JSC::RegExpMatchesArray::RegExpMatchesArray):
7250         (JSC::RegExpMatchesArray::~RegExpMatchesArray):
7251         (JSC::RegExpMatchesArray::fillArrayInstance):
7252         * runtime/RegExpMatchesArray.h:
7253         (JSC::RegExpMatchesArray::getOwnPropertySlot):
7254         (JSC::RegExpMatchesArray::getOwnPropertyDescriptor):
7255         (JSC::RegExpMatchesArray::put):
7256         (JSC::RegExpMatchesArray::deleteProperty):
7257         (JSC::RegExpMatchesArray::getOwnPropertyNames):
7258
7259 2010-02-25  Oliver Hunt  <oliver@apple.com>
7260
7261         Reviewed by Geoff Garen.
7262
7263         JSC crashes like crazy in the JSPropertyNameIterator destructor
7264
7265         Add back null check of m_cachedStructure.  Curse last minute changes.
7266
7267         * runtime/JSPropertyNameIterator.cpp:
7268         (JSC::JSPropertyNameIterator::~JSPropertyNameIterator):
7269
7270 2010-02-25  Oliver Hunt  <oliver@apple.com>
7271
7272         Reviewed by Maciej Stachowiak.
7273
7274         Race condition in JSPropertyNameIterator and Structure destruction
7275         https://bugs.webkit.org/show_bug.cgi?id=35398
7276
7277         JSPropertyNameIterator and Structure have a cyclic dependency that they
7278         manage by clearing the appropriate reference in each other during their
7279         destruction.  However if the Structure is destroyed while the 
7280         JSPropertyNameIterator is dead but not yet finalized the Structures
7281         WeakGCPtr will return null, and so prevent Structure from clearing
7282         the m_cachedStructure pointer of the iterator.  When the iterator is
7283         then finalised the m_cachedStructure is invalid, and the attempt to
7284         clear the structures back reference fails.
7285
7286         To fix this we simply make JSPropertyNameIterator keep the Structure
7287         alive, using the weak pointer to break the ref cycle.
7288
7289         * runtime/JSPropertyNameIterator.cpp:
7290         (JSC::JSPropertyNameIterator::~JSPropertyNameIterator):
7291           The iterator now keeps m_cachedStructure alive itself, so no longer needs
7292           to check for it being cleared
7293         * runtime/JSPropertyNameIterator.h:
7294         (JSC::JSPropertyNameIterator::setCachedStructure):
7295           Add an assertion to ensure correct usage
7296         (JSC::JSPropertyNameIterator::cachedStructure):
7297           Add .get()
7298         * runtime/Structure.cpp:
7299         (JSC::Structure::~Structure):
7300           Add an assertion that our iterator isn't already dead, and remove
7301           the now unnecessary attempt to clear the ref in the iterator
7302         * runtime/WeakGCPtr.h:
7303         (JSC::WeakGCPtr::hasDeadObject):
7304           An assert-only function to allow us to assert correct behaviour
7305           in the Structure destructor
7306
7307 2010-02-25  Jochen Eisinger  <jochen@chromium.org>
7308  
7309         Reviewed by Jeremy Orlow.
7310  
7311         Make the context that was passed to the ThreadFunction accessible.
7312         https://bugs.webkit.org/show_bug.cgi?id=35379
7313
7314         When a database is opened, right now you
7315         don't have any context from where it is opened. The problem is that
7316         the actual calls that open a database go through the sqlite3 vfs
7317         layer, so there's no easy way to pass this function down to to
7318         platform/sql/chromium/SQLFileSystemChromium*.cpp
7319
7320         This patch will allow you to get from anywhere within webkit a pointer
7321         to the Thread object that actually created the thread you're currently
7322         on (in case of the database, this can be either a thread forked of
7323         from the main thread or from a worker thread), and query the object
7324         for context information.
7325
7326         * wtf/Threading.h:
7327         * wtf/ThreadingNone.cpp:
7328         (WTF::threadContext):
7329         * wtf/ThreadingPthreads.cpp:
7330         (WTF::):
7331         (WTF::identifierByPthreadHandle):
7332         (WTF::establishIdentifierForPthreadHandle):
7333         (WTF::pthreadHandleForIdentifier):
7334         (WTF::contextForIdentifier):
7335         (WTF::createThreadInternal):
7336         (WTF::currentThread):
7337         (WTF::threadContext):
7338         * wtf/ThreadingWin.cpp:
7339         (WTF::):
7340         (WTF::threadMap):
7341         (WTF::storeThreadHandleByIdentifier):
7342         (WTF::threadHandleForIdentifier):
7343         (WTF::contextForIdentifier):
7344         (WTF::createThreadInternal):
7345         (WTF::threadContext):
7346
7347 2010-02-25  Jeremy Orlow  <jorlow@chromium.org>
7348
7349         Reverting to re-submit with better change log.
7350
7351         * wtf/Threading.h:
7352         * wtf/ThreadingNone.cpp:
7353         (WTF::isMainThread):
7354         * wtf/ThreadingPthreads.cpp:
7355         (WTF::identifierByPthreadHandle):
7356         (WTF::establishIdentifierForPthreadHandle):
7357         (WTF::pthreadHandleForIdentifier):
7358         (WTF::createThreadInternal):
7359         (WTF::currentThread):
7360         * wtf/ThreadingWin.cpp:
7361         (WTF::threadMap):
7362         (WTF::storeThreadHandleByIdentifier):
7363         (WTF::threadHandleForIdentifier):
7364         (WTF::createThreadInternal):
7365
7366 2010-02-25  Jochen Eisinger  <jochen@chromium.org>
7367
7368         Reviewed by Jeremy Orlow.
7369
7370         Make the context that was passed to the ThreadFunction accessible.
7371         https://bugs.webkit.org/show_bug.cgi?id=35379
7372
7373         * wtf/Threading.h:
7374         * wtf/ThreadingNone.cpp:
7375         (WTF::threadContext):
7376         * wtf/ThreadingPthreads.cpp:
7377         (WTF::):
7378         (WTF::identifierByPthreadHandle):
7379         (WTF::establishIdentifierForPthreadHandle):
7380         (WTF::pthreadHandleForIdentifier):
7381         (WTF::contextForIdentifier):
7382         (WTF::createThreadInternal):
7383         (WTF::currentThread):
7384         (WTF::threadContext):
7385         * wtf/ThreadingWin.cpp:
7386         (WTF::):
7387         (WTF::threadMap):
7388         (WTF::storeThreadHandleByIdentifier):
7389         (WTF::threadHandleForIdentifier):
7390         (WTF::contextForIdentifier):
7391         (WTF::createThreadInternal):
7392         (WTF::threadContext):
7393
7394 2010-02-24  Oliver Hunt  <oliver@apple.com>
7395
7396         Reviewed by Geoffrey Garen.
7397
7398         [REGRESSION in r55185] EXC_BAD_ACCESS on opening inspector.
7399         https://bugs.webkit.org/show_bug.cgi?id=35335
7400
7401         compileGetDirectOffset modifies the contents of the object register
7402         when the object is not using the inline storage array.  As the object
7403         register contains our 'this' pointer we can't allow it to be clobbered.
7404         The fix is simply to copy the register into a separate scratch register
7405         when we're loading off an object that doesn't use inline storage.
7406
7407         * jit/JITPropertyAccess.cpp:
7408         (JSC::JIT::privateCompileGetByIdSelfList):
7409         * jit/JITPropertyAccess32_64.cpp:
7410         (JSC::JIT::privateCompileGetByIdSelfList):
7411
7412 2010-02-24  Oliver Hunt  <oliver@apple.com>
7413
7414         Reviewed by Gavin Barraclough.
7415
7416         Speed up getter performance in the jit
7417         https://bugs.webkit.org/show_bug.cgi?id=35332
7418
7419         Implement getter lookup caching in the interpreter.
7420         The getter stubs are generated through basically the
7421         same code paths as the normal get_by_id caching.
7422         Instead of simply loading a property and returning,
7423         we load the getter slot, and pass the getter, base value
7424         and return address to a shared stub used for getter
7425         dispatch.
7426
7427         * jit/JIT.h:
7428         (JSC::JIT::compileGetByIdProto):
7429         (JSC::JIT::compileGetByIdSelfList):
7430         (JSC::JIT::compileGetByIdProtoList):
7431         (JSC::JIT::compileGetByIdChainList):
7432         (JSC::JIT::compileGetByIdChain):
7433         * jit/JITPropertyAccess.cpp:
7434         (JSC::JIT::privateCompileGetByIdProto):
7435         (JSC::JIT::privateCompileGetByIdSelfList):
7436         (JSC::JIT::privateCompileGetByIdProtoList):
7437         (JSC::JIT::privateCompileGetByIdChainList):
7438         (JSC::JIT::privateCompileGetByIdChain):
7439         * jit/JITPropertyAccess32_64.cpp:
7440         (JSC::JIT::privateCompileGetByIdProto):
7441         (JSC::JIT::privateCompileGetByIdSelfList):
7442         (JSC::JIT::privateCompileGetByIdProtoList):
7443         (JSC::JIT::privateCompileGetByIdChainList):
7444         (JSC::JIT::privateCompileGetByIdChain):
7445         * jit/JITStubs.cpp:
7446         (JSC::JITThunks::tryCacheGetByID):
7447         (JSC::DEFINE_STUB_FUNCTION):
7448         * jit/JITStubs.h:
7449         (JSC::):
7450         * runtime/GetterSetter.h:
7451
7452 2010-02-23  Oliver Hunt  <oliver@apple.com>
7453
7454         Reviewed by Maciej Stachowiak.
7455
7456         Web Inspector: Regression: r55027+: Inspector broken
7457         https://bugs.webkit.org/show_bug.cgi?id=35253
7458
7459         op_get_by_id_getter_chain was not passing the correct this parameter.
7460         The bug was caused by incorrect use of baseCell instead of baseValue,
7461         baseValue contains the original object for the lookup (and hence the
7462         correct this object), baseCell is clobbered as part of walking the
7463         prototype chain.
7464
7465         * interpreter/Interpreter.cpp:
7466         (JSC::Interpreter::privateExecute):
7467
7468 2010-02-23  Gustavo Noronha Silva  <gns@gnome.org>
7469
7470         Rubber-stamped by Dimitri Glazkov.
7471
7472         Chromium build fix.
7473
7474         * JavaScriptCore.gyp/JavaScriptCore.gyp:
7475
7476 2010-02-23  Leandro Pereira  <leandro@profusion.mobi>
7477
7478         Reviewed by Gustavo Noronha Silva.
7479
7480         Changes references of GOwnPtr to reflect their new place.
7481         http://webkit.org/b/35084
7482
7483         * JavaScriptCore/JavaScriptCore.gypi:
7484         * JavaScriptCore/wtf/Threading.h:
7485         * JavaScriptCore/wtf/unicode/glib/UnicodeGLib.h:
7486
7487 2010-02-23  Leandro Pereira  <leandro@profusion.mobi>
7488
7489         Reviewed by Kenneth Rohde Christiansen.
7490
7491         Adding the EFL implementation of JavaScriptCore.
7492         See https://bugs.webkit.org/show_bug.cgi?id=35084 for details.
7493
7494         * GNUmakefile.am: Updated to reflect the new location of GOwnPtr and
7495                           GRefPtr.
7496         * wtf/efl/MainThreadEfl.cpp: Added.
7497         * wtf/gobject/GOwnPtr.cpp: Moved from wtf/gtk.
7498         * wtf/gobject/GOwnPtr.h: Moved from wtf/gtk.
7499         * wtf/gobject/GRefPtr.cpp: Moved from wtf/gtk.
7500         * wtf/gobject/GRefPtr.h: Moved from wtf/gtk.
7501
7502 2010-02-22  Julien Chaffraix  <jchaffraix@webkit.org>
7503
7504         Reviewed by Darin Adler.
7505
7506         Remove auto_ptr usage in JavaScriptCore.
7507         https://bugs.webkit.org/show_bug.cgi?id=35221
7508
7509         * parser/Nodes.h: Removed now unneeded adopt method.
7510         * parser/Parser.cpp: Removed <memory> include as it is not required anymore.
7511         * wtf/OwnPtr.h: Removed the constructor from auto_ptr.
7512         * wtf/VectorTraits.h: Removed a template specialization for auto_ptr.
7513         * wtf/unicode/Collator.h: Made userDefault return a PassOwnPtr.
7514         * wtf/unicode/CollatorDefault.cpp:
7515         (WTF::Collator::userDefault): Changed the method to match the next signature.
7516         * wtf/unicode/icu/CollatorICU.cpp:
7517         (WTF::Collator::userDefault): Ditto.
7518
7519 2010-02-22  Huahui Wu  <hwu@google.com>
7520
7521         Reviewed by Eric Seidel.
7522
7523         Add code that enables SquirrelFish Extreme (a.k.a JSCX, JSC JIT)
7524         in Android. It's disabled by default, but is enabled when the 
7525         enveronment variable ENABLE_JSC_JIT is set to true.
7526         https://bugs.webkit.org/show_bug.cgi?id=34855
7527
7528         * Android.mk:
7529         * wtf/Platform.h:
7530
7531 2010-02-22  Gavin Barraclough  <barraclough@apple.com>
7532
7533         Reviewed by Oliver Hunt.
7534
7535         JSStringBuilder should not CRASH if allocation fails, it should throw a JSException.
7536
7537         * runtime/JSGlobalObjectFunctions.cpp:
7538         * runtime/JSStringBuilder.h:
7539         (JSC::JSStringBuilder::JSStringBuilder):
7540         (JSC::JSStringBuilder::append):
7541         (JSC::JSStringBuilder::build):
7542         * runtime/StringBuilder.h:
7543         (JSC::StringBuilder::build):
7544         * wtf/Vector.h:
7545         (WTF::VectorBufferBase::tryAllocateBuffer):
7546         (WTF::):
7547         (WTF::VectorBuffer::tryAllocateBuffer):
7548         (WTF::::tryExpandCapacity):
7549         (WTF::::tryReserveCapacity):
7550         (WTF::::tryAppend):
7551
7552 2010-02-22  Kwang Yul Seo  <skyul@company100.net>
7553
7554         Reviewed by Eric Seidel.
7555
7556         [BREWMP] Map FastMalloc to BREW memory allocator
7557         https://bugs.webkit.org/show_bug.cgi?id=33570
7558
7559         Use MALLOC macro instead of the standard malloc function.
7560         Although RVCT provides malloc, we can't use it in BREW
7561         because the loader does not initialize the base address properly.
7562
7563         * wtf/FastMalloc.cpp:
7564         * wtf/brew/SystemMallocBrew.h: Added.
7565         (mallocBrew):
7566         (callocBrew):
7567         (freeBrew):
7568         (reallocBrew):
7569
7570 2010-02-22  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
7571
7572         Build fix for make distcheck.
7573
7574         * GNUmakefile.am:
7575
7576 2010-02-22  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
7577
7578         Unreviewed build fix.
7579
7580         [Qt] Build fix for RVCT.
7581
7582         Fix after r55024. The "-i" option is for perl not for the
7583         script.
7584
7585         * DerivedSources.pro:
7586
7587 2010-02-21  Gavin Barraclough  <barraclough@apple.com>
7588
7589         Reviewed by Oliver Hunt.
7590
7591         Make UString::m_data be const, and make the UChar owned/ref-counted by CrossThreadRefCounted be const too.
7592
7593         * runtime/UStringImpl.cpp:
7594         (JSC::UStringImpl::baseSharedBuffer):
7595         (JSC::UStringImpl::~UStringImpl):
7596         * runtime/UStringImpl.h:
7597         (JSC::UStringImpl::create):
7598         (JSC::UStringImpl::data):
7599         (JSC::UStringImpl::UStringImpl):
7600         * wtf/OwnFastMallocPtr.h:
7601         (WTF::OwnFastMallocPtr::~OwnFastMallocPtr):
7602
7603 2010-02-21  Yuta Kitamura  <yutak@chromium.org>
7604
7605         Reviewed by Darin Adler.
7606
7607         HashMapTranslatorAdapter::translate() needs to set the mapped value.
7608
7609         HTTPHeaderMap::add(const char*, const String&) does not work
7610         https://bugs.webkit.org/show_bug.cgi?id=35227
7611
7612         * wtf/HashMap.h:
7613         (WTF::HashMapTranslatorAdapter::translate):
7614
7615 2010-02-19  Maciej Stachowiak  <mjs@apple.com>
7616
7617         Reviewed by David Levin.
7618
7619         Add an ENABLE flag for sandboxed iframes to make it possible to disable it in releases
7620         https://bugs.webkit.org/show_bug.cgi?id=35147
7621
7622         * Configurations/FeatureDefines.xcconfig:
7623
7624 2010-02-19  Gavin Barraclough  <barraclough@apple.com>
7625
7626         Reviewed by Oliver Hunt.
7627
7628         JSString::getIndex() calls value() to resolve the string value (is a rope)
7629         to a UString, then passes the result to jsSingleCharacterSubstring without
7630         checking for an exception.  In case of out-of-memory the returned UString
7631         is null(), which may result in an out-of-buounds substring being created.
7632         This is bad.
7633
7634         Simple fix is to be able to get an index from a rope without resolving to
7635         UString.  This may be a useful optimization in some test cases.
7636
7637         The same bug exists in some other methods is JSString, these can be fixed
7638         by changing them to call getIndex().
7639
7640         * runtime/JSString.cpp:
7641         (JSC::JSString::resolveRope):
7642         (JSC::JSString::getStringPropertyDescriptor):
7643         * runtime/JSString.h:
7644         (JSC::jsSingleCharacterSubstring):
7645         (JSC::JSString::getIndex):
7646         (JSC::jsSingleCharacterString):
7647         (JSC::JSString::getStringPropertySlot):
7648         * runtime/UStringImpl.cpp:
7649         (JSC::singleCharacterSubstring):
7650         * runtime/UStringImpl.h:
7651         (JSC::UStringImpl::singleCharacterSubstring):
7652
7653 2010-02-19  Oliver Hunt  <oliver@apple.com>
7654
7655         RS = Gavin Barraclough.
7656
7657         Split the 32/64 version of JITPropertyAccess into a separate file.
7658
7659         * GNUmakefile.am:
7660         * JavaScriptCore.gypi:
7661         * JavaScriptCore.pri:
7662         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
7663         * JavaScriptCore.xcodeproj/project.pbxproj:
7664         * jit/JITPropertyAccess.cpp:
7665         * jit/JITPropertyAccess32_64.cpp: Added.
7666         (JSC::JIT::emit_op_put_by_index):
7667         (JSC::JIT::emit_op_put_getter):
7668         (JSC::JIT::emit_op_put_setter):
7669         (JSC::JIT::emit_op_del_by_id):
7670         (JSC::JIT::emit_op_method_check):
7671         (JSC::JIT::emitSlow_op_method_check):
7672         (JSC::JIT::emit_op_get_by_val):
7673         (JSC::JIT::emitSlow_op_get_by_val):
7674         (JSC::JIT::emit_op_put_by_val):
7675         (JSC::JIT::emitSlow_op_put_by_val):
7676         (JSC::JIT::emit_op_get_by_id):
7677         (JSC::JIT::emitSlow_op_get_by_id):
7678         (JSC::JIT::emit_op_put_by_id):
7679         (JSC::JIT::emitSlow_op_put_by_id):
7680         (JSC::JIT::compileGetByIdHotPath):
7681         (JSC::JIT::compileGetByIdSlowCase):
7682         (JSC::JIT::compilePutDirectOffset):
7683         (JSC::JIT::compileGetDirectOffset):
7684         (JSC::JIT::testPrototype):
7685         (JSC::JIT::privateCompilePutByIdTransition):
7686         (JSC::JIT::patchGetByIdSelf):
7687         (JSC::JIT::patchMethodCallProto):
7688         (JSC::JIT::patchPutByIdReplace):
7689         (JSC::JIT::privateCompilePatchGetArrayLength):
7690         (JSC::JIT::privateCompileGetByIdProto):
7691         (JSC::JIT::privateCompileGetByIdSelfList):
7692         (JSC::JIT::privateCompileGetByIdProtoList):
7693         (JSC::JIT::privateCompileGetByIdChainList):
7694         (JSC::JIT::privateCompileGetByIdChain):
7695         (JSC::JIT::emit_op_get_by_pname):
7696         (JSC::JIT::emitSlow_op_get_by_pname):
7697
7698 2010-02-19  Patrick Gansterer  <paroga@paroga.com>
7699
7700         Reviewed by Laszlo Gombos.
7701
7702         Added additional parameter to create_rvct_stubs 
7703         for setting the regularexpression prefix.
7704         Renamed it because it now works for other platforms too.
7705         https://bugs.webkit.org/show_bug.cgi?id=34951
7706
7707         * DerivedSources.pro:
7708         * create_jit_stubs: Copied from JavaScriptCore/create_rvct_stubs.
7709         * create_rvct_stubs: Removed.
7710
7711 2010-02-18  Oliver Hunt  <oliver@apple.com>
7712
7713         Reviewed by Gavin Barraclough.
7714
7715         Improve interpreter getter performance
7716         https://bugs.webkit.org/show_bug.cgi?id=35138
7717
7718         Improve the performance of getter dispatch by making it possible
7719         for the interpreter to cache the GetterSetter object lookup.
7720
7721         To do this we simply need to make PropertySlot aware of getters
7722         as a potentially cacheable property, and record the base and this
7723         objects for a getter access.  This allows us to use more-or-less
7724         identical code to that used by the normal get_by_id caching, with
7725         the dispatch being the only actual difference.
7726
7727         I'm holding off of implementing this in the JIT until I do some
7728         cleanup to try and making coding in the JIT not be as horrible
7729         as it is currently.
7730
7731         * bytecode/CodeBlock.cpp:
7732         (JSC::CodeBlock::dump):
7733         (JSC::CodeBlock::derefStructures):
7734         (JSC::CodeBlock::refStructures):
7735         * bytecode/Opcode.h:
7736         * interpreter/Interpreter.cpp:
7737         (JSC::Interpreter::resolveGlobal):
7738         (JSC::Interpreter::tryCacheGetByID):
7739         (JSC::Interpreter::privateExecute):
7740         * jit/JIT.cpp:
7741         (JSC::JIT::privateCompileMainPass):
7742         * jit/JITStubs.cpp:
7743         (JSC::JITThunks::tryCacheGetByID):
7744         (JSC::DEFINE_STUB_FUNCTION):
7745         * runtime/JSObject.cpp:
7746         (JSC::JSObject::fillGetterPropertySlot):
7747         * runtime/PropertySlot.cpp:
7748         (JSC::PropertySlot::functionGetter):
7749         * runtime/PropertySlot.h:
7750         (JSC::PropertySlot::isGetter):
7751         (JSC::PropertySlot::isCacheable):
7752         (JSC::PropertySlot::isCacheableValue):
7753         (JSC::PropertySlot::setValueSlot):
7754         (JSC::PropertySlot::setGetterSlot):
7755         (JSC::PropertySlot::setCacheableGetterSlot):
7756         (JSC::PropertySlot::clearOffset):
7757         (JSC::PropertySlot::thisValue):
7758
7759 2010-02-17  Geoffrey Garen  <ggaren@apple.com>
7760
7761         Reviewed by Oliver Hunt.
7762
7763         Fixed a portion of:
7764         <rdar://problem/7165917> | https://bugs.webkit.org/show_bug.cgi?id=28676
7765         Safari 4 does not release memory back to the operating system fast enough (28676)
7766         
7767         This patch fixes a surprisingly common edge case in which the page heap
7768         would have only one free span, but that span would be larger than the
7769         minimum free size, so we would decide not to free it, even though it
7770         could be as large as 100MB or more!
7771         
7772         SunSpider reports no change on Mac or Windows.
7773
7774         * wtf/FastMalloc.cpp:
7775         (WTF::TCMalloc_PageHeap::scavenge): Call shouldContinueScavenging() instead
7776         of doing the math ourselves. Don't keep a local value for pagesDecommitted
7777         because that lets free_committed_pages_ be wrong temporarily. Instead,
7778         update free_committed_pages_ as we go. ASSERT that we aren't releasing
7779         a span that has already been released, because we think this is impossible.
7780         Finally, don't be afraid to release all free memory in the page heap when
7781         scavenging. We only scavenge after 5 seconds of the application's working
7782         set not growing, and we keep both thread caches and a central cache on
7783         top of the page heap, so the extra free pages in the page heap were just
7784         overkill.
7785
7786 2010-02-17  Gavin Barraclough  <barraclough@apple.com>
7787
7788         Reviewed by Oliver Hunt.
7789
7790         https://bugs.webkit.org/show_bug.cgi?id=35070
7791         Addition of 2 strings of length 2^31 may result in a string of length 0.
7792
7793         Check for overflow when creating a new JSString as a result of an addition
7794         or concatenation, throw an out of memory exception.
7795
7796         * runtime/JSString.h:
7797         (JSC::):
7798         * runtime/Operations.h:
7799         (JSC::jsString):
7800
7801 2010-02-17  Xan Lopez  <xlopez@igalia.com>
7802
7803         Reviewed by Gustavo Noronha.
7804
7805         [Linux] Webkit incompatible with Java plugins
7806         https://bugs.webkit.org/show_bug.cgi?id=24912
7807
7808         Add support for GFile to GOwnPtr.
7809
7810         Based on original work by Gustavo Noronha.
7811
7812         * wtf/gtk/GOwnPtr.cpp:
7813         (WTF::GFile):
7814         * wtf/gtk/GOwnPtr.h:
7815
7816 2010-02-16  Gavin Barraclough  <barraclough@apple.com>
7817
7818         Reviewed by Mark Rowe.
7819
7820         Fix a handful of other leaks seen on the buildbot.
7821
7822         * runtime/UStringImpl.h:
7823         (JSC::UStringOrRopeImpl::deref): Delegate through to the subclass version of deref to ensure that
7824         the correct cleanup takes place.  This function previously featured some code that attempted to
7825         skip deletion of static UStringImpl's.  Closer inspection revealed that it was in fact equivalent
7826         to "if (false)", meaning that UStringImpl's which had their final deref performed via this function
7827         were leaked.
7828
7829 2010-02-16  Mark Rowe  <mrowe@apple.com>
7830
7831         Reviewed by Gavin Barraclough.
7832
7833         Fix a handful of leaks seen on the buildbot.
7834
7835         * runtime/UStringImpl.h:
7836         (JSC::UStringOrRopeImpl::deref): Call URopeImpl::destructNonRecursive rather than delete
7837         to ensure that the rope's fibers are also destroyed.
7838
7839 2010-02-16  Gavin Barraclough  <barraclough@apple.com>
7840
7841         Reviewed by Oliver Hunt.
7842
7843         https://bugs.webkit.org/show_bug.cgi?id=34964
7844         Leaks tool reports false memory leaks due to Rope implementation.
7845
7846         A rope is a recursive data structure where each node in the rope holds a set of
7847         pointers, each of which may reference either a string (in UStringImpl form) or
7848         another rope node.  A low bit in each pointer is used to distinguish between
7849         rope & string elements, in a fashion similar to the recently-removed
7850         PtrAndFlags class (see https://bugs.webkit.org/show_bug.cgi?id=33731 ).  Again,
7851         this causes a problem for Leaks - refactor to remove the magic pointer
7852         mangling.
7853
7854         Move Rope out from JSString.h and rename to URopeImpl, to match UStringImpl.
7855         Give UStringImpl and URopeImpl a common parent class, UStringOrRopeImpl.
7856         Repurpose an otherwise invalid permutation to flags (static & should report
7857         memory cost) to identify ropes.
7858
7859         This allows us to change the rope's fibers to interrogate the object rather
7860         than storing a bool within the low bits of the pointer (or in some cases the
7861         use of a common parent class removes the need to determine the type at all -
7862         there is a common interface to ref or get the length of either ropes or strings).
7863
7864         * API/JSClassRef.cpp:
7865         (OpaqueJSClass::OpaqueJSClass):
7866         (OpaqueJSClassContextData::OpaqueJSClassContextData):
7867         * bytecompiler/BytecodeGenerator.cpp:
7868         (JSC::keyForCharacterSwitch):
7869         * interpreter/Interpreter.cpp:
7870         (JSC::Interpreter::privateExecute):
7871         * jit/JITStubs.cpp:
7872         (JSC::DEFINE_STUB_FUNCTION):
7873         * runtime/ArrayPrototype.cpp:
7874         (JSC::arrayProtoFuncToString):
7875         * runtime/Identifier.cpp:
7876         (JSC::Identifier::equal):
7877         (JSC::Identifier::addSlowCase):
7878         * runtime/JSString.cpp:
7879         (JSC::JSString::resolveRope):
7880         * runtime/JSString.h:
7881         (JSC::):
7882         (JSC::RopeBuilder::JSString):
7883         (JSC::RopeBuilder::~JSString):
7884         (JSC::RopeBuilder::appendStringInConstruct):
7885         (JSC::RopeBuilder::appendValueInConstructAndIncrementLength):
7886         (JSC::RopeBuilder::JSStringFinalizerStruct::JSStringFinalizerStruct):
7887         (JSC::RopeBuilder::JSStringFinalizerStruct::):
7888         * runtime/UString.cpp:
7889         (JSC::UString::toStrictUInt32):
7890         (JSC::equal):
7891         * runtime/UString.h:
7892         (JSC::UString::isEmpty):
7893         (JSC::UString::size):
7894         * runtime/UStringImpl.cpp:
7895         (JSC::URopeImpl::derefFibersNonRecursive):
7896         (JSC::URopeImpl::destructNonRecursive):
7897         * runtime/UStringImpl.h:
7898         (JSC::UStringOrRopeImpl::isRope):
7899         (JSC::UStringOrRopeImpl::length):
7900         (JSC::UStringOrRopeImpl::ref):
7901         (JSC::UStringOrRopeImpl::):
7902         (JSC::UStringOrRopeImpl::operator new):
7903         (JSC::UStringOrRopeImpl::UStringOrRopeImpl):
7904         (JSC::UStringImpl::adopt):
7905         (JSC::UStringImpl::createUninitialized):
7906         (JSC::UStringImpl::tryCreateUninitialized):
7907         (JSC::UStringImpl::data):
7908         (JSC::UStringImpl::cost):
7909         (JSC::UStringImpl::deref):
7910         (JSC::UStringImpl::UStringImpl):
7911         (JSC::UStringImpl::):
7912         (JSC::URopeImpl::tryCreateUninitialized):
7913         (JSC::URopeImpl::initializeFiber):
7914         (JSC::URopeImpl::fiberCount):
7915         (JSC::URopeImpl::fibers):
7916         (JSC::URopeImpl::deref):
7917         (JSC::URopeImpl::URopeImpl):
7918         (JSC::URopeImpl::hasOneRef):
7919         (JSC::UStringOrRopeImpl::deref):
7920
7921 2010-02-15  Gabor Loki  <loki@webkit.org>
7922
7923         Reviewed by Gavin Barraclough.
7924
7925         Fix the SP at ctiOpThrowNotCaught on Thumb2 (JSVALUE32)
7926         https://bugs.webkit.org/show_bug.cgi?id=34939
7927
7928         * jit/JITStubs.cpp:
7929
7930 2010-02-15  Gavin Barraclough  <barraclough@apple.com>
7931
7932         Reviewed by NOBODY (Build Fix!).
7933
7934         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
7935
7936 2010-02-15  Gavin Barraclough  <barraclough@apple.com>
7937
7938         Reviewed by Oliver Hunt.
7939
7940         Some general Rope related refactoring.
7941
7942         Rename Rope::m_ropeLength to m_fiberCount, to be more descriptive.
7943         Rename Rope::m_stringLength to simply m_length (since this is the
7944         more conventional name for the length of a string).  Move append
7945         behaviour out into a new RopeBuilder class, so that Rope no longer
7946         needs any knowledge of the JSString or UString implementation.
7947
7948         Make Rope no longer be nested within JSString.
7949         (Rope now no-longer need reside within JSString.h, but leaving
7950         the change of moving this out to a different header as a separate
7951         change from these renames).
7952
7953         * JavaScriptCore.exp:
7954         * jit/JITOpcodes.cpp:
7955         (JSC::JIT::privateCompileCTIMachineTrampolines):
7956         * runtime/JSString.cpp:
7957         (JSC::Rope::destructNonRecursive):
7958         (JSC::Rope::~Rope):
7959         (JSC::JSString::resolveRope):
7960         (JSC::JSString::toBoolean):
7961         (JSC::JSString::getStringPropertyDescriptor):
7962         * runtime/JSString.h:
7963         (JSC::Rope::Fiber::Fiber):
7964         (JSC::Rope::Fiber::deref):
7965         (JSC::Rope::Fiber::ref):
7966         (JSC::Rope::Fiber::refAndGetLength):
7967         (JSC::Rope::Fiber::isRope):
7968         (JSC::Rope::Fiber::rope):
7969         (JSC::Rope::Fiber::isString):
7970         (JSC::Rope::Fiber::string):
7971         (JSC::Rope::Fiber::nonFiber):
7972         (JSC::Rope::tryCreateUninitialized):
7973         (JSC::Rope::append):
7974         (JSC::Rope::fiberCount):
7975         (JSC::Rope::length):
7976         (JSC::Rope::fibers):
7977         (JSC::Rope::Rope):
7978         (JSC::Rope::operator new):
7979         (JSC::):
7980         (JSC::RopeBuilder::JSString):
7981         (JSC::RopeBuilder::~JSString):
7982         (JSC::RopeBuilder::length):
7983         (JSC::RopeBuilder::canGetIndex):
7984         (JSC::RopeBuilder::appendStringInConstruct):
7985         (JSC::RopeBuilder::appendValueInConstructAndIncrementLength):
7986         (JSC::RopeBuilder::isRope):
7987         (JSC::RopeBuilder::fiberCount):
7988         (JSC::JSString::getStringPropertySlot):
7989         * runtime/Operations.h:
7990         (JSC::jsString):
7991
7992 2010-02-15  Gavin Barraclough  <barraclough@apple.com>
7993
7994         Reviewed by NOBODY (Build fix).
7995
7996         Add missing cast for !YARR (PPC) builds.
7997
7998         * runtime/RegExp.cpp:
7999         (JSC::RegExp::match):
8000
8001 2010-02-14  Gavin Barraclough  <barraclough@apple.com>
8002
8003         Reviewed by Darin Adler.
8004
8005         https://bugs.webkit.org/show_bug.cgi?id=33731
8006         Many false leaks in release builds due to PtrAndFlags
8007
8008         StructureTransitionTable was effectively a smart pointer type,
8009         one machine word in size and wholly contained as a member of
8010         of Structure.  It either pointed to an actual table, or could
8011         be used to describe a single transtion entry without use of a
8012         table.
8013
8014         This, however, worked by using a PtrAndFlags, which is not
8015         compatible with the leaks tool.  Since there is no clear way to
8016         obtain another bit for 'free' here, and since there are bits
8017         available up in Structure, merge this functionality back up into
8018         Structure.  Having this in a separate class was quite clean
8019         from an enacapsulation perspective, but this solution doesn't
8020         seem to bad - all table access is now intermediated through the
8021         Structure::structureTransitionTableFoo methods, keeping the
8022         optimization fairly well contained.
8023
8024         This was the last use of PtrAndFlags, so removing the file too.
8025
8026         * JavaScriptCore.xcodeproj/project.pbxproj:
8027         * bytecode/CodeBlock.h:
8028         * runtime/Structure.cpp:
8029         (JSC::Structure::Structure):
8030         (JSC::Structure::~Structure):
8031         (JSC::Structure::addPropertyTransitionToExistingStructure):
8032         (JSC::Structure::addPropertyTransition):
8033         (JSC::Structure::hasTransition):
8034         * runtime/Structure.h:
8035         (JSC::Structure::):
8036         (JSC::Structure::structureTransitionTableContains):
8037         (JSC::Structure::structureTransitionTableGet):
8038         (JSC::Structure::structureTransitionTableHasTransition):
8039         (JSC::Structure::structureTransitionTableRemove):
8040         (JSC::Structure::structureTransitionTableAdd):
8041         (JSC::Structure::structureTransitionTable):
8042         (JSC::Structure::setStructureTransitionTable):
8043         (JSC::Structure::singleTransition):
8044         (JSC::Structure::setSingleTransition):
8045         * runtime/StructureTransitionTable.h:
8046         * wtf/PtrAndFlags.h: Removed.
8047
8048 2010-02-15  Gavin Barraclough  <barraclough@apple.com>
8049
8050         Rubber Stamped by Geoff Garen.
8051
8052         Bug 34948 - tryMakeString should fail on error in length calculation
8053
8054         Ooops! - "bool overflow" argument should have been "bool& overflow".
8055
8056         * runtime/UString.h:
8057         (JSC::sumWithOverflow):
8058         (JSC::tryMakeString):
8059
8060 2010-02-15  Gavin Barraclough  <barraclough@apple.com>
8061
8062         Reviewed by NOBODY (Build Fix (pt 2!)).
8063
8064         Some symbol names have changed, remove, will readd if required.
8065
8066         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
8067
8068 2010-02-15  Gavin Barraclough  <barraclough@apple.com>
8069
8070         Reviewed by NOBODY (Build Fix (pt 1?)).
8071
8072         Some symbol names have changed, remove, will readd if required.
8073
8074         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
8075
8076 2010-02-15  Geoffrey Garen  <ggaren@apple.com>
8077
8078         Reviewed by Oliver Hunt.
8079
8080         Removed some mistaken code added in http://trac.webkit.org/changeset/53860.
8081
8082         * API/APIShims.h:
8083         (JSC::APICallbackShim::APICallbackShim):
8084         (JSC::APICallbackShim::~APICallbackShim): No need to start/stop the
8085         timeout checker when calling out from the API to the client; we want to
8086         monitor the VM for timeouts, not the client. This mistake was harmless /
8087         undetectable, since it's totally redundant with the APIEntryShim, which
8088         also starts / stops the timeout checker.
8089
8090 2010-02-15  Gavin Barraclough  <barraclough@apple.com>
8091
8092         Reviewed by Geoff Garen.
8093
8094         Bug 34952 - String lengths in UString should be unsigned.
8095         This matches WebCore::StringImpl, and better unifies behaviour throughout JSC.
8096
8097         * JavaScriptCore.exp:
8098         * bytecode/EvalCodeCache.h:
8099         * runtime/Identifier.cpp:
8100         (JSC::Identifier::equal):
8101         * runtime/Identifier.h:
8102         * runtime/JSGlobalObjectFunctions.cpp:
8103         (JSC::globalFuncEscape):
8104         * runtime/JSONObject.cpp:
8105         (JSC::gap):
8106         (JSC::Stringifier::indent):
8107         * runtime/NumberPrototype.cpp:
8108         (JSC::numberProtoFuncToFixed):
8109         (JSC::numberProtoFuncToPrecision):
8110         * runtime/RegExp.cpp:
8111         (JSC::RegExp::match):
8112         * runtime/StringPrototype.cpp:
8113         (JSC::substituteBackreferencesSlow):
8114         (JSC::stringProtoFuncReplace):
8115         (JSC::stringProtoFuncSplit):
8116         (JSC::trimString):
8117         * runtime/UString.cpp:
8118         (JSC::UString::UString):
8119         (JSC::UString::from):
8120         (JSC::UString::getCString):
8121         (JSC::UString::ascii):
8122         (JSC::UString::operator[]):
8123         (JSC::UString::toStrictUInt32):
8124         (JSC::UString::find):
8125         (JSC::UString::rfind):
8126         (JSC::UString::substr):
8127         (JSC::operator<):
8128         (JSC::operator>):
8129         (JSC::compare):
8130         (JSC::equal):
8131         (JSC::UString::UTF8String):
8132         * runtime/UString.h:
8133         (JSC::UString::size):
8134         (JSC::operator==):
8135         * runtime/UStringImpl.cpp:
8136         (JSC::UStringImpl::create):
8137         * runtime/UStringImpl.h:
8138         (JSC::UStringImpl::create):
8139         (JSC::UStringImpl::size):
8140         (JSC::UStringImpl::computeHash):
8141         (JSC::UStringImpl::UStringImpl):
8142
8143 2010-02-15  Gavin Barraclough  <barraclough@apple.com>
8144
8145         Reviewed by Geoff Garen.
8146
8147         Bug 34948 - tryMakeString should fail on error in length calculation
8148
8149         The sum of the length of substrings could overflow.
8150
8151         * runtime/UString.h:
8152         (JSC::sumWithOverflow):
8153         (JSC::tryMakeString):
8154
8155 2010-02-15  Geoffrey Garen  <ggaren@apple.com>
8156
8157         Reviewed by Oliver Hunt.
8158
8159         Fixed <rdar://problem/7628524> Crash beneath JSGlobalContextRelease when
8160         typing in Google search field with GuardMalloc/full page heap enabled
8161
8162         * API/JSContextRef.cpp: Don't use APIEntryShim, since that requires
8163         a JSGlobalData, which this function destroys. Do use setCurrentIdentifierTable
8164         and JSLock instead, since those are the two features of APIEntryShim we
8165         require.
8166
8167 2010-02-15  Patrick Gansterer  <paroga@paroga.com>
8168
8169         Reviewed by Laszlo Gombos.
8170
8171         Added additional parameter to create_rvct_stubs 
8172         for setting the offset of thunkReturnAddress.
8173         https://bugs.webkit.org/show_bug.cgi?id=34657
8174
8175         * create_rvct_stubs:
8176         * jit/JITStubs.cpp:
8177
8178 2010-02-15  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
8179
8180         Reviewed by Simon Hausmann.
8181
8182         Fix QScriptValue::toIntXX methods.
8183
8184         More ECMA Script compliance.
8185
8186         [Qt] QScriptValue::toIntXX returns incorrect values
8187         https://bugs.webkit.org/show_bug.cgi?id=34847
8188
8189         * qt/api/qscriptvalue_p.h:
8190         (QScriptValuePrivate::toInteger):
8191         (QScriptValuePrivate::toInt32):
8192         (QScriptValuePrivate::toUInt32):
8193         (QScriptValuePrivate::toUInt16):
8194         * qt/tests/qscriptvalue/tst_qscriptvalue.h:
8195         * qt/tests/qscriptvalue/tst_qscriptvalue_generated.cpp:
8196         (tst_QScriptValue::toInteger_initData):
8197         (tst_QScriptValue::toInteger_makeData):
8198         (tst_QScriptValue::toInteger_test):
8199         (tst_QScriptValue::toInt32_initData):
8200         (tst_QScriptValue::toInt32_makeData):
8201         (tst_QScriptValue::toInt32_test):
8202         (tst_QScriptValue::toUInt32_initData):
8203         (tst_QScriptValue::toUInt32_makeData):
8204         (tst_QScriptValue::toUInt32_test):
8205         (tst_QScriptValue::toUInt16_initData):
8206         (tst_QScriptValue::toUInt16_makeData):
8207         (tst_QScriptValue::toUInt16_test):
8208
8209 2010-02-14  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
8210
8211         Reviewed by Adam Barth.
8212
8213         Implement NEVER_INLINE and NO_RETURN for RVCT
8214         https://bugs.webkit.org/show_bug.cgi?id=34740
8215
8216         * wtf/AlwaysInline.h:
8217
8218 2010-02-12  Gavin Barraclough  <barraclough@apple.com>
8219
8220         Reviewed by Oliver Hunt.
8221
8222         https://bugs.webkit.org/show_bug.cgi?id=33731
8223         Remove uses of PtrAndFlags from JIT data stuctures.
8224
8225         These break the OS X Leaks tool.  Free up a bit in CallLinkInfo, and invalid
8226         permutation of pointer states in MethodCallLinkInfo to represent the removed bits.
8227
8228         * bytecode/CodeBlock.h:
8229         (JSC::CallLinkInfo::seenOnce):
8230         (JSC::CallLinkInfo::setSeen):
8231         (JSC::MethodCallLinkInfo::MethodCallLinkInfo):
8232         (JSC::MethodCallLinkInfo::seenOnce):
8233         (JSC::MethodCallLinkInfo::setSeen):
8234         * jit/JIT.cpp:
8235         (JSC::JIT::unlinkCall):
8236         * jit/JITPropertyAccess.cpp:
8237         (JSC::JIT::patchMethodCallProto):
8238         * runtime/UString.h:
8239
8240 2010-02-12  Gavin Barraclough  <barraclough@apple.com>
8241
8242         Reviewed by Darin Adler.
8243
8244         https://bugs.webkit.org/show_bug.cgi?id=33731
8245         Many false leaks in release builds due to PtrAndFlags
8246
8247         Remove UntypedPtrAndBitfield (similar to PtrAndFlags) in UStringImpl,
8248         and steal bits from the refCount instead.
8249
8250         * runtime/UStringImpl.cpp:
8251         (JSC::UStringImpl::baseSharedBuffer):
8252         (JSC::UStringImpl::~UStringImpl):
8253         * runtime/UStringImpl.h:
8254         (JSC::UStringImpl::cost):
8255         (JSC::UStringImpl::isIdentifier):
8256         (JSC::UStringImpl::setIsIdentifier):
8257         (JSC::UStringImpl::ref):
8258         (JSC::UStringImpl::deref):
8259         (JSC::UStringImpl::UStringImpl):
8260         (JSC::UStringImpl::bufferOwnerString):
8261         (JSC::UStringImpl::bufferOwnership):
8262         (JSC::UStringImpl::isStatic):
8263         (JSC::UStringImpl::):
8264
8265 2010-02-12  Geoffrey Garen  <ggaren@apple.com>
8266
8267         Reviewed by Darin Adler.
8268
8269         Removed an unnecessary data dependency from my last patch.
8270
8271         * runtime/SmallStrings.cpp:
8272         (JSC::SmallStrings::markChildren): Since isAnyStringMarked being false
8273         is a condition of entering the loop, we can just use '=' instead of '|='.
8274
8275 2010-02-12  Janne Koskinen  <janne.p.koskinen@digia.com>
8276
8277         Reviewed by Tor Arne Vestbø.
8278
8279         Additional refptr/passrefptr workarounds for WINSCW compiler
8280         https://bugs.webkit.org/show_bug.cgi?id=28054
8281
8282         * wtf/PassRefPtr.h:
8283         (WTF::refIfNotNull):
8284         (WTF::PassRefPtr::PassRefPtr):
8285         (WTF::PassRefPtr::~PassRefPtr):
8286         (WTF::PassRefPtr::clear):
8287         (WTF::::operator):
8288         * wtf/RefPtr.h:
8289         (WTF::RefPtr::RefPtr):
8290         (WTF::::operator):
8291
8292 2010-02-12  Janne Koskinen  <janne.p.koskinen@digia.com>
8293
8294         Reviewed by Tor Arne Vestbø.
8295
8296         Additional refptr/passrefptr workarounds for WINSCW compiler
8297         https://bugs.webkit.org/show_bug.cgi?id=28054
8298
8299         * wtf/PassRefPtr.h:
8300         (WTF::refIfNotNull):
8301         (WTF::PassRefPtr::PassRefPtr):
8302         (WTF::PassRefPtr::~PassRefPtr):
8303         (WTF::PassRefPtr::clear):
8304         (WTF::::operator):
8305         * wtf/RefPtr.h:
8306         (WTF::RefPtr::RefPtr):
8307         (WTF::::operator):
8308
8309 2010-02-12  Janne Koskinen  <janne.p.koskinen@digia.com>
8310
8311         Reviewed by Tor Arne Vestbø.
8312
8313         Additional refptr/passrefptr workarounds for WINSCW compiler
8314         https://bugs.webkit.org/show_bug.cgi?id=28054
8315
8316         * wtf/PassRefPtr.h:
8317         (WTF::refIfNotNull):
8318         (WTF::PassRefPtr::PassRefPtr):
8319         (WTF::PassRefPtr::~PassRefPtr):
8320         (WTF::PassRefPtr::clear):
8321         (WTF::::operator):
8322         * wtf/RefPtr.h:
8323         (WTF::RefPtr::RefPtr):
8324         (WTF::::operator):
8325
8326 2010-02-12  Janne Koskinen  <janne.p.koskinen@digia.com>
8327
8328         Reviewed by Simon Hausmann.
8329
8330         Don't import the cmath functions from std:: for WINSCW.
8331
8332         * wtf/MathExtras.h:
8333
8334 2010-02-12  Kwang Yul Seo  <skyul@company100.net>
8335
8336         Reviewed by Adam Barth.
8337
8338         Typedef both JSChar and UChar to wchar_t in RVCT.
8339         https://bugs.webkit.org/show_bug.cgi?id=34560
8340
8341         Define both JSChar and UChar to wchar_t as the size
8342         of wchar_t is 2 bytes in RVCT.
8343
8344         * API/JSStringRef.h:
8345         * wtf/unicode/qt4/UnicodeQt4.h:
8346
8347 2010-02-11  Geoffrey Garen  <ggaren@apple.com>
8348
8349         Reviewed by Oliver Hunt and Darin Adler.
8350
8351         The rest of the fix for
8352         https://bugs.webkit.org/show_bug.cgi?id=34864 | <rdar://problem/7594198>
8353         Many objects left uncollected after visiting mail.google.com and closing
8354         window
8355         
8356         Don't unconditionally hang onto small strings. Instead, hang onto all
8357         small strings as long as any small string is still referenced.
8358         
8359         SunSpider reports no change.
8360
8361         * runtime/Collector.cpp:
8362         (JSC::Heap::markRoots): Mark the small strings cache last, so it can
8363         check if anything else has kept any strings alive.
8364
8365         * runtime/SmallStrings.cpp:
8366         (JSC::isMarked):
8367         (JSC::SmallStrings::markChildren): Only keep our strings alive if some
8368         other reference to at least one of them exists, too.
8369
8370 2010-02-11  Geoffrey Garen  <ggaren@apple.com>
8371
8372         Reviewed by Gavin Barraclough.
8373
8374         Some progress toward fixing
8375         https://bugs.webkit.org/show_bug.cgi?id=34864 | <rdar://problem/7594198>
8376         Many objects left uncollected after visiting mail.google.com and closing
8377         window
8378         
8379         SunSpider reports no change.
8380         
8381         Keep weak references, rather than protected references, to cached for-in
8382         property name enumerators.
8383         
8384         One problem with protected references is that a chain like 
8385             [ gc object 1 ] => [ non-gc object ] => [ gc object 2 ]
8386         takes two GC passes to break, since the first pass collects [ gc object 1 ],
8387         releasing [ non-gc object ] and unprotecting [ gc object 2 ], and only
8388         then can a second pass collect [ gc object 2 ].
8389         
8390         Another problem with protected references is that they can keep a bunch
8391         of strings alive long after they're useful. In SunSpider and a few popular
8392         websites, the size-speed tradeoff seems to favor weak references.
8393
8394         * runtime/JSPropertyNameIterator.cpp:
8395         (JSC::JSPropertyNameIterator::JSPropertyNameIterator): Moved this constructor
8396         into the .cpp file, since it's not used elsewhere.
8397
8398         (JSC::JSPropertyNameIterator::~JSPropertyNameIterator): Added a destructor
8399         to support our weak reference.
8400
8401         * runtime/JSPropertyNameIterator.h:
8402         (JSC::Structure::setEnumerationCache):
8403         (JSC::Structure::clearEnumerationCache):
8404         (JSC::Structure::enumerationCache): Added a function for clearing a
8405         Structure's enumeration cache, used by our new destructor. Also fixed
8406         indentation to match the rest of the file.
8407
8408         * runtime/Structure.h: Changed from protected pointer to weak pointer.
8409
8410 2010-02-11  Chris Rogers  <crogers@google.com>
8411
8412         Reviewed by David Levin.
8413
8414         audio engine: add Complex number class
8415         https://bugs.webkit.org/show_bug.cgi?id=34538
8416
8417         * wtf/Complex.h: Added.
8418         (WebCore::complexFromMagnitudePhase):
8419
8420 2010-02-10  Geoffrey Garen  <ggaren@apple.com>
8421
8422         Reviewed by Oliver Hunt.
8423
8424         Added an SPI for asking about all the different live objects on the heap.
8425         Useful for memory debugging.
8426
8427         * JavaScriptCore.exp: Export the new SPI.
8428
8429         * runtime/Collector.cpp:
8430         (JSC::typeName): Use a little capitalization. Don't crash in the case of
8431         a non-object cell, since it might just be an uninitialized cell.
8432
8433         (JSC::Heap::objectTypeCounts): The new SPI.
8434
8435         * runtime/Collector.h:
8436         * runtime/CollectorHeapIterator.h:
8437         (JSC::CollectorHeapIterator::advance):
8438         (JSC::LiveObjectIterator::operator++):
8439         (JSC::DeadObjectIterator::operator++):
8440         (JSC::ObjectIterator::operator++): Made 2 tweaks to these iterators:
8441         (1) Skip the last cell in the block, since it's a dummy sentinel, and
8442         we don't want it to confuse the object count; (2) Fixed a logic error
8443         in LiveObjectIterator that could cause it to iterate dead objects if
8444         m_block were equal to m_heap.nextBlock and m_cell were less than
8445         m_heap.nextCell. No test for this since I can't think of a way that this
8446         could make WebKit behave badly.
8447
8448 2010-02-11  Steve Block  <steveblock@google.com>
8449
8450         Reviewed by Darin Adler.
8451
8452         Guard cmath using declarations in MathExtras.h on Android
8453         https://bugs.webkit.org/show_bug.cgi?id=34840
8454
8455         Android does not provide these functions.
8456
8457         * wtf/MathExtras.h:
8458
8459 2010-02-08  Maciej Stachowiak  <mjs@apple.com>
8460
8461         Reviewed by Cameron Zwarich.
8462
8463         Restore ENABLE_RUBY flag so vendors can ship with Ruby disabled if they choose.
8464         https://bugs.webkit.org/show_bug.cgi?id=34698
8465
8466         * Configurations/FeatureDefines.xcconfig:
8467
8468 2010-02-10  Kevin Watters  <kevinwatters@gmail.com>
8469
8470         Reviewed by Kevin Ollivier.
8471
8472         [wx] Add Windows complex text support and Mac support for containsCharacters.
8473         
8474         https://bugs.webkit.org/show_bug.cgi?id=34759
8475
8476         * wscript:
8477
8478 2010-02-10  Alexey Proskuryakov  <ap@apple.com>
8479
8480         Addressing issues found by style bot.
8481
8482         * wtf/ValueCheck.h: Renamed header guard to match final file name.
8483
8484         * wtf/Vector.h: (WTF::::checkConsistency): Remove braces around a one-line clause.
8485
8486 2010-02-09  Alexey Proskuryakov  <ap@apple.com>
8487
8488         Reviewed by Geoffrey Garen.
8489
8490         https://bugs.webkit.org/show_bug.cgi?id=34490
8491         WebCore::ImageEventSender::dispatchPendingEvents() crashes in certain conditions
8492
8493         * GNUmakefile.am:
8494         * JavaScriptCore.gypi:
8495         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
8496         * JavaScriptCore.xcodeproj/project.pbxproj:
8497         Added ValueCheck.h.
8498
8499         * wtf/ValueCheck.h: Added. Moved code out of HashTraits, since it would be awkward to
8500         include that from Vector.h.
8501         (WTF::ValueCheck::checkConsistency): Allow null pointers, those are pretty consistent.
8502
8503         * wtf/HashTraits.h: Moved value checking code out of here.
8504
8505         * wtf/HashTable.h: (WTF::::checkTableConsistencyExceptSize): Updated for the above changes.
8506
8507         * wtf/Vector.h:
8508         (WTF::::checkConsistency): Check all vector elements.
8509         (WTF::ValueCheck): Support checking a Vector as an element in other containers. Currently
8510         unused.
8511
8512 2010-02-10  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
8513
8514         Reviewed by Simon Hausmann.
8515
8516         Fix QScriptValue::toBool.
8517
8518         Fix ECMA compliance in the QScriptValue for values like 0, NaN and
8519         empty strings.
8520
8521         [Qt] QScriptValue::toBool problem
8522         https://bugs.webkit.org/show_bug.cgi?id=34793
8523
8524         * qt/api/qscriptvalue_p.h:
8525         (QScriptValuePrivate::toBool):
8526         * qt/tests/qscriptvalue/tst_qscriptvalue.h:
8527         * qt/tests/qscriptvalue/tst_qscriptvalue_generated.cpp:
8528         (tst_QScriptValue::toBool_initData):
8529         (tst_QScriptValue::toBool_makeData):
8530         (tst_QScriptValue::toBool_test):
8531         (tst_QScriptValue::toBoolean_initData):
8532         (tst_QScriptValue::toBoolean_makeData):
8533         (tst_QScriptValue::toBoolean_test):
8534
8535 2009-10-06  Yongjun Zhang  <yongjun.zhang@nokia.com>
8536
8537         Reviewed by Simon Hausmann.
8538
8539         Use derefIfNotNull() to work around WINSCW compiler forward declaration bug
8540
8541         The compiler bug is reported at
8542         https://xdabug001.ext.nokia.com/bugzilla/show_bug.cgi?id=9812.
8543
8544         The change should be reverted when the above bug is fixed in WINSCW compiler.
8545
8546         https://bugs.webkit.org/show_bug.cgi?id=28054
8547
8548 2009-10-06  Yongjun Zhang  <yongjun.zhang@nokia.com>
8549
8550         Reviewed by Simon Hausmann.
8551
8552         Get rid of WINSCW hack for UnSpecifiedBoolType
8553
8554         Add parenthesis around (RefPtr::*UnspecifiedBoolType) to make the WINSCW
8555         compiler work with the default UnSpecifiedBoolType() operator.
8556
8557         https://bugs.webkit.org/show_bug.cgi?id=28054
8558
8559         * wtf/RefPtr.h:
8560
8561 2010-02-09  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
8562
8563         Reviewed by Simon Hausmann.
8564
8565         New functions nullValue() and undefinedValue().
8566
8567         [Qt] QScriptEngine should contain nullValue and undefinedValue methods
8568         https://bugs.webkit.org/show_bug.cgi?id=34749
8569
8570         * qt/api/qscriptengine.cpp:
8571         (QScriptEngine::nullValue):
8572         (QScriptEngine::undefinedValue):
8573         * qt/api/qscriptengine.h:
8574         * qt/tests/qscriptengine/tst_qscriptengine.cpp:
8575         (tst_QScriptEngine::nullValue):
8576         (tst_QScriptEngine::undefinedValue):
8577
8578 2010-02-09  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
8579
8580         Reviewed by Simon Hausmann.
8581
8582         Fixes for QScriptValue::toNumber().
8583
8584         Fix ECMA compliance in QScriptValue for values unbound
8585         to a QScriptEngine.
8586
8587         [Qt] QScriptValue::toNumber() is broken
8588         https://bugs.webkit.org/show_bug.cgi?id=34592
8589
8590         * qt/api/qscriptvalue_p.h:
8591         (QScriptValuePrivate::toNumber):
8592         * qt/tests/qscriptvalue/tst_qscriptvalue.h:
8593         * qt/tests/qscriptvalue/tst_qscriptvalue_generated.cpp:
8594         (tst_QScriptValue::toNumber_initData):
8595         (tst_QScriptValue::toNumber_makeData):
8596         (tst_QScriptValue::toNumber_test):
8597
8598 2010-02-09  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
8599
8600         Reviewed by Simon Hausmann.
8601
8602         Fix QScriptValue::isNumber().
8603
8604         The isNumber() should return 'true' if the value is in the CNumber
8605         state.
8606
8607         [Qt] QScriptValue::isNumber() returns an incorrect value
8608         https://bugs.webkit.org/show_bug.cgi?id=34575
8609
8610         * qt/api/qscriptvalue_p.h:
8611         (QScriptValuePrivate::isNumber):
8612         * qt/tests/qscriptvalue/tst_qscriptvalue.h:
8613         * qt/tests/qscriptvalue/tst_qscriptvalue_generated.cpp:
8614         (tst_QScriptValue::isNumber_initData):
8615         (tst_QScriptValue::isNumber_makeData):
8616         (tst_QScriptValue::isNumber_test):
8617
8618 2010-02-09  Geoffrey Garen  <ggaren@apple.com>
8619
8620         Reviewed by Oliver Hunt.
8621
8622         Small refactoring to the small strings cache to allow it to be cleared
8623         dynamically.
8624
8625         * runtime/SmallStrings.cpp:
8626         (JSC::SmallStrings::SmallStrings):
8627         (JSC::SmallStrings::clear):
8628         * runtime/SmallStrings.h: Moved initialization code into a shared function,
8629         and changed the constructor to call it.
8630
8631 2010-02-09  Gavin Barraclough  <barraclough@apple.com>
8632
8633         Rubber Stamped by Geoff Garen.
8634
8635         Rename StringBuilder::release && JSStringBuilder::releaseJSString
8636         to 'build()'.
8637
8638         * runtime/ArrayPrototype.cpp:
8639         (JSC::arrayProtoFuncToLocaleString):
8640         (JSC::arrayProtoFuncJoin):
8641         * runtime/Executable.cpp:
8642         (JSC::FunctionExecutable::paramString):
8643         * runtime/FunctionConstructor.cpp:
8644         (JSC::constructFunction):
8645         * runtime/JSGlobalObjectFunctions.cpp:
8646         (JSC::encode):
8647         (JSC::decode):
8648         (JSC::globalFuncEscape):
8649         (JSC::globalFuncUnescape):
8650         * runtime/JSONObject.cpp:
8651         (JSC::Stringifier::stringify):
8652         * runtime/JSStringBuilder.h:
8653         (JSC::JSStringBuilder::build):
8654         * runtime/LiteralParser.cpp:
8655         (JSC::LiteralParser::Lexer::lexString):
8656         * runtime/NumberPrototype.cpp:
8657         (JSC::integerPartNoExp):
8658         (JSC::numberProtoFuncToFixed):
8659         * runtime/StringBuilder.h:
8660         (JSC::StringBuilder::build):
8661
8662 2010-02-09  John Sullivan  <sullivan@apple.com>
8663
8664         https://bugs.webkit.org/show_bug.cgi?id=34772
8665         Overzealous new assertion in URStringImpl::adopt()
8666
8667         Reviewed by Adam Barth.
8668
8669         * runtime/UStringImpl.h:
8670         (JSC::UStringImpl::adopt):
8671         Only assert that vector.data() is non-zero if vector.size() is non-zero.
8672
8673 2010-02-09  Nikolas Zimmermann  <nzimmermann@rim.com>
8674
8675         Not reviewed. Try to fix build problem on SnowLeopard slaves to bring them back.
8676
8677         * API/JSClassRef.cpp:
8678         (tryCreateStringFromUTF8): Mark method as 'static inline' to suppress "warning: no previous prototype for ..."
8679
8680 2010-02-09  Gavin Barraclough  <barraclough@apple.com>
8681
8682         Reviewed by Oliver Hunt.
8683
8684         Three small string fixes:
8685         (1) StringBuilder::release should CRASH if the buffer allocation failed.
8686         (2) Remove weird, dead code from JSString::tryGetValue, replace with an ASSERT.
8687         (3) Move UString::createFromUTF8 out to the API, as tryCreateStringFromUTF8.
8688             This is only used from the API, and (now) unlike other UString::create
8689             methods may return UString::null() to indicate failure cases.  Better
8690             handle these in the API.
8691
8692         * API/JSClassRef.cpp:
8693         (tryCreateStringFromUTF8):
8694         (OpaqueJSClass::OpaqueJSClass):
8695         (OpaqueJSClassContextData::OpaqueJSClassContextData):
8696         * runtime/JSString.h:
8697         (JSC::Fiber::tryGetValue):
8698         * runtime/StringBuilder.h:
8699         (JSC::StringBuilder::release):
8700         * runtime/UString.cpp:
8701         (JSC::UString::UString):
8702         (JSC::UString::from):
8703         (JSC::UString::find):
8704         * runtime/UString.h:
8705
8706 2010-02-09  Janne Koskinen  <janne.p.koskinen@digia.com>
8707
8708         Reviewed by Laszlo Gombos.
8709
8710         [Qt] use nanval() for Symbian as nonInlineNaN
8711         https://bugs.webkit.org/show_bug.cgi?id=34170
8712
8713         numeric_limits<double>::quiet_NaN is broken in Symbian
8714         causing NaN to be evaluated as a number.
8715
8716         * runtime/JSValue.cpp:
8717         (JSC::nonInlineNaN):
8718
8719 2010-02-09  Tamas Szirbucz  <szirbucz@inf.u-szeged.hu>
8720
8721         Reviewed by Gavin Barraclough.
8722
8723         Add a soft modulo operation to ARM JIT using a trampoline function.
8724         The performance progression is about ~1.8% on ARMv7
8725         https://bugs.webkit.org/show_bug.cgi?id=34424
8726
8727         Developed in cooperation with Gabor Loki.
8728
8729         * jit/JIT.h:
8730         * jit/JITArithmetic.cpp:
8731         (JSC::JIT::emit_op_mod):
8732         (JSC::JIT::emitSlow_op_mod):
8733         * jit/JITOpcodes.cpp:
8734         (JSC::JIT::softModulo):
8735         * jit/JITStubs.h:
8736         (JSC::JITThunks::ctiSoftModulo):
8737         * wtf/Platform.h:
8738
8739 2010-02-08  Gavin Barraclough  <barraclough@apple.com>
8740
8741         Reviewed by NOBODY (SL/win build fixes).
8742
8743         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
8744         * runtime/StringPrototype.cpp:
8745
8746 2010-02-08  Gavin Barraclough  <barraclough@apple.com>
8747
8748         Reviewed by Oliver Hunt
8749
8750         Make String.replace throw an exception on out-of-memory, rather than
8751         returning a null (err, empty-ish) string.  Move String::replaceRange
8752         and String::spliceSubstringsWithSeparators out to StringPrototype -
8753         these were fairly specific use anyway, and we can better integrate
8754         throwing the JS expcetion this way.
8755
8756         Also removes redundant assignment operator from UString.
8757
8758         * JavaScriptCore.exp:
8759         * runtime/StringPrototype.cpp:
8760         (JSC::StringRange::StringRange):
8761         (JSC::jsSpliceSubstringsWithSeparators):
8762         (JSC::jsReplaceRange):
8763         (JSC::stringProtoFuncReplace):
8764         * runtime/UString.cpp:
8765         * runtime/UString.h:
8766
8767 2010-02-08  Kwang Yul Seo  <skyul@company100.net>
8768
8769         Reviewed by Eric Seidel.
8770
8771         [BREWMP] Undefine WTF_OS_WINDOWS and WTF_PLATFORM_WIN
8772         https://bugs.webkit.org/show_bug.cgi?id=34561
8773
8774         As the binary for simulator is built with MSVC 2005,
8775         WTF_OS_WINDOWS and WTF_PLATFORM_WIN are defined.
8776         Undefine them as we don't target Windows.
8777
8778         * wtf/Platform.h:
8779
8780 2010-02-08  Chris Rogers  <crogers@google.com>
8781
8782         Reviewed by Darin Adler.
8783
8784         audio engine: add Vector3 class
8785         https://bugs.webkit.org/show_bug.cgi?id=34548
8786
8787         * wtf/Vector3.h: Added.
8788         (WebCore::Vector3::Vector3):
8789         (WebCore::Vector3::abs):
8790         (WebCore::Vector3::isZero):
8791         (WebCore::Vector3::normalize):
8792         (WebCore::Vector3::x):
8793         (WebCore::Vector3::y):
8794         (WebCore::Vector3::z):
8795         (WebCore::operator+):
8796         (WebCore::operator-):
8797         (WebCore::operator*):
8798         (WebCore::dot):
8799         (WebCore::cross):
8800         (WebCore::distance):
8801
8802 2010-02-08  Oliver Hunt  <oliver@apple.com>
8803
8804         Reviewed by Gavin Barraclough.
8805
8806         Fix warning in clang++
8807
8808         * runtime/Structure.h:
8809         (JSC::Structure::propertyStorageSize):
8810
8811 2010-02-08  Gavin Barraclough  <barraclough@apple.com>
8812
8813         Reviewed by Geoff Garen.
8814
8815         Make makeString CRASH if we fail to allocate a string.
8816
8817         (tryMakeString or jsMakeNontrivialString can be used where we
8818         expect allocation may fail and want to handle the error).
8819
8820         * runtime/JSStringBuilder.h:
8821         (JSC::jsMakeNontrivialString):
8822         * runtime/UString.h:
8823         (JSC::tryMakeString):
8824         (JSC::makeString):
8825
8826 2010-02-08  Gavin Barraclough  <barraclough@apple.com>
8827
8828         Rubber Stamped by Oliver Hunt.
8829
8830         Remove a couple of unnecesary C-style casts spotted by Darin.
8831
8832         * runtime/JSGlobalObjectFunctions.cpp:
8833         (JSC::encode):
8834         (JSC::globalFuncEscape):
8835
8836 2010-02-08  Gavin Barraclough  <barraclough@apple.com>
8837
8838         Reviewed by Geoff Garen.
8839
8840         Switch some more StringBuilder/jsNontrivialString code to use
8841         JSStringBuilder/jsMakeNontrivialString - these methods will
8842         throw an exception if we hit out-of-memory, rather than just
8843         CRASHing.
8844
8845         * runtime/FunctionPrototype.cpp:
8846         (JSC::functionProtoFuncToString):
8847         * runtime/JSGlobalObjectFunctions.cpp:
8848         (JSC::encode):
8849         (JSC::decode):
8850         (JSC::globalFuncEscape):
8851
8852 2010-02-08  Gavin Barraclough  <barraclough@apple.com>
8853
8854         Reviewed by Sam Weinig.
8855
8856         Use an empty identifier instead of a null identifier for parse
8857         tokens without an identifier.
8858
8859         This helps encapsulate the null UStringImpl within UString.
8860
8861         * parser/Grammar.y:
8862         * parser/NodeConstructors.h:
8863         (JSC::ContinueNode::ContinueNode):
8864         (JSC::BreakNode::BreakNode):
8865         (JSC::ForInNode::ForInNode):
8866         * runtime/CommonIdentifiers.cpp:
8867         (JSC::CommonIdentifiers::CommonIdentifiers):
8868         * runtime/CommonIdentifiers.h:
8869         * runtime/FunctionPrototype.cpp:
8870         (JSC::FunctionPrototype::FunctionPrototype):
8871
8872 2010-02-08  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
8873
8874         Build fix for make distcheck.
8875
8876         * GNUmakefile.am:
8877
8878 2010-02-08  Simon Hausmann  <simon.hausmann@nokia.com>
8879
8880         Unreviewed RVCT build fix.
8881
8882         Similar to r54391, don't import the cmath functions from std:: for RVCT.
8883
8884         * wtf/MathExtras.h:
8885
8886 2010-02-05  Gavin Barraclough  <barraclough@apple.com>
8887
8888         Reviewed by Geoff Garen.
8889
8890         Change UStringImpl::create to CRASH if the string cannot be allocated,
8891         rather than returning a null string (which will behave like a zero-length
8892         string if used).
8893
8894         Also move createRep function from UString to become new overloaded
8895         UStringImpl::create methods.  In doing so, bring their behaviour closer to
8896         being in line with WebCore::StringImpl, in removing the behaviour that they
8897         can be used to produce null UStrings (ASSERT the char* provided is non-null).
8898         This behaviour of converting null C-strings to null UStrings is inefficient
8899         (cmompared to just using UString::null()), incompatible with WebCore::StringImpl's
8900         behaviour, and may generate unexpected behaviour, since in many cases a null
8901         UString can be used like an empty string.
8902
8903         With these changes UStringImpl need not have a concept of null impls, we can
8904         start transitioning this to become an implementation detail of UString, that
8905         internally it chooses to use a null-object rather than an actually zero impl
8906         pointer.
8907
8908         * JavaScriptCore.exp:
8909         * debugger/Debugger.cpp:
8910         (JSC::Debugger::recompileAllJSFunctions):
8911         * debugger/DebuggerCallFrame.cpp:
8912         (JSC::DebuggerCallFrame::calculatedFunctionName):
8913         * parser/Parser.cpp:
8914         (JSC::Parser::parse):
8915         * profiler/Profile.cpp:
8916         (JSC::Profile::Profile):
8917         * profiler/ProfileGenerator.cpp:
8918         (JSC::ProfileGenerator::stopProfiling):
8919         * runtime/Error.cpp:
8920         (JSC::Error::create):
8921         (JSC::throwError):
8922         * runtime/ExceptionHelpers.cpp:
8923         (JSC::createError):
8924         * runtime/Identifier.cpp:
8925         (JSC::Identifier::add):
8926         * runtime/PropertyNameArray.cpp:
8927         (JSC::PropertyNameArray::add):
8928         * runtime/UString.cpp:
8929         (JSC::initializeUString):
8930         (JSC::UString::UString):
8931         (JSC::UString::operator=):
8932         * runtime/UString.h:
8933         (JSC::UString::isNull):
8934         (JSC::UString::null):
8935         (JSC::UString::rep):
8936         (JSC::UString::UString):
8937         * runtime/UStringImpl.cpp:
8938         (JSC::UStringImpl::create):
8939         * runtime/UStringImpl.h:
8940
8941 2010-02-05  Kwang Yul Seo  <skyul@company100.net>
8942
8943         Reviewed by Eric Seidel.
8944
8945         [BREWMP] Define SYSTEM_MALLOC 1
8946         https://bugs.webkit.org/show_bug.cgi?id=34640
8947
8948         Make BREWMP use system malloc because FastMalloc is not ported.
8949
8950         * wtf/Platform.h:
8951
8952 2010-02-05  Kwang Yul Seo  <skyul@company100.net>
8953
8954         Reviewed by Alexey Proskuryakov.
8955
8956         Don't call CRASH() in fastMalloc and fastCalloc when the requested memory size is 0
8957         https://bugs.webkit.org/show_bug.cgi?id=34569
8958
8959         With USE_SYSTEM_MALLOC=1, fastMalloc and fastCalloc call CRASH()
8960         if the return value of malloc and calloc is 0.
8961         
8962         However, these functions can return 0 when the request size is 0.
8963         Libc manual says, "If size is 0, then malloc() returns either NULL,
8964         or a unique pointer value that can later be successfully passed to free()."
8965         Though malloc returns a unique pointer in most systems,
8966         0 can be returned in some systems. For instance, BREW's MALLOC returns 0
8967         when size is 0.
8968
8969         If malloc or calloc returns 0 due to allocation size, increase the size
8970         to 1 and try again.
8971
8972         * wtf/FastMalloc.cpp:
8973         (WTF::fastMalloc):
8974         (WTF::fastCalloc):
8975
8976 2010-02-04  Mark Rowe  <mrowe@apple.com>
8977
8978         Reviewed by Timothy Hatcher.
8979
8980         Build fix.  Remove a symbol corresponding to an inline function from the linker export
8981         file to prevent a weak external failure.
8982
8983         * JavaScriptCore.xcodeproj/project.pbxproj: Accommodate rename of script.
8984
8985 2010-02-04  Daniel Bates  <dbates@webkit.org>
8986
8987         [Qt] Unreviewed, build fix for Qt bot.
8988
8989         * runtime/JSStringBuilder.h: Changed #include <X.h> notation #include "X.h".
8990
8991 2010-02-04  Geoffrey Garen  <ggaren@apple.com>
8992
8993         Reviewed by Oliver Hunt.
8994
8995         Clearing a WeakGCPtr is weird
8996         https://bugs.webkit.org/show_bug.cgi?id=34627
8997
8998         Added a WeakGCPtr::clear interface.
8999         
9000         As discussed in https://bugs.webkit.org/show_bug.cgi?id=33383, the old
9001         interface made it pretty weird for a client to conditionally clear a
9002         WeakGCPtr, which is exactly what clients want to do when objects are
9003         finalized.
9004
9005         * API/JSClassRef.cpp:
9006         (clearReferenceToPrototype): Use the new WeakGCPtr::clear() interface. 
9007
9008         * runtime/WeakGCPtr.h:
9009         (JSC::WeakGCPtr::clear): Added an interface for clearing a WeakGCPtr,
9010         iff its current value is the value passed in. It's cumbersome for the
9011         client to do this test, since WeakGCPtr sometimes pretends to be null.
9012
9013 2010-02-04  Geoffrey Garen  <ggaren@apple.com>
9014
9015         Build fix: export a header.
9016
9017         * JavaScriptCore.xcodeproj/project.pbxproj:
9018
9019 2010-02-04  Gavin Barraclough  <barraclough@apple.com>
9020
9021         Reviewed by Oliver Hunt.
9022
9023         Add a JSStringBuilder class (similar-to, and derived-from StringBuilder) to
9024         construct JSStrings, throwing a JS exception should we run out of memory whilst
9025         allocating storage for the string.
9026
9027         Similarly, add jsMakeNontrivialString methods to use in cases where previously
9028         we were calling makeString & passing the result to jsNontrivialString.  Again,
9029         these new methods throw if we hit an out of memory condition.
9030
9031         Move throwOutOfMemoryError into ExceptionHelpers, to make it more widely available.
9032
9033         * JavaScriptCore.xcodeproj/project.pbxproj:
9034         * runtime/ArrayPrototype.cpp:
9035         (JSC::arrayProtoFuncToString):
9036         (JSC::arrayProtoFuncToLocaleString):
9037         (JSC::arrayProtoFuncJoin):
9038         * runtime/DateConstructor.cpp:
9039         (JSC::callDate):
9040         * runtime/DatePrototype.cpp:
9041         (JSC::dateProtoFuncToString):
9042         (JSC::dateProtoFuncToUTCString):
9043         (JSC::dateProtoFuncToGMTString):
9044         * runtime/ErrorPrototype.cpp:
9045         (JSC::errorProtoFuncToString):
9046         * runtime/ExceptionHelpers.cpp:
9047         (JSC::throwOutOfMemoryError):
9048         * runtime/ExceptionHelpers.h:
9049         * runtime/JSStringBuilder.h: Added.
9050         (JSC::JSStringBuilder::releaseJSString):
9051         (JSC::jsMakeNontrivialString):
9052         * runtime/NumberPrototype.cpp:
9053         (JSC::numberProtoFuncToPrecision):
9054         * runtime/ObjectPrototype.cpp:
9055         (JSC::objectProtoFuncToString):
9056         * runtime/Operations.cpp:
9057         * runtime/Operations.h:
9058         * runtime/RegExpPrototype.cpp:
9059         (JSC::regExpProtoFuncToString):
9060         * runtime/StringBuilder.h:
9061         (JSC::StringBuilder::append):
9062         * runtime/StringPrototype.cpp:
9063         (JSC::stringProtoFuncBig):
9064         (JSC::stringProtoFuncSmall):
9065         (JSC::stringProtoFuncBlink):
9066         (JSC::stringProtoFuncBold):
9067         (JSC::stringProtoFuncFixed):
9068         (JSC::stringProtoFuncItalics):
9069         (JSC::stringProtoFuncStrike):
9070         (JSC::stringProtoFuncSub):
9071         (JSC::stringProtoFuncSup):
9072         (JSC::stringProtoFuncFontcolor):
9073         (JSC::stringProtoFuncFontsize):
9074         (JSC::stringProtoFuncAnchor):
9075
9076 2010-02-04  Steve Falkenburg  <sfalken@apple.com>
9077
9078         Windows build fix.
9079
9080         * wtf/MathExtras.h:
9081
9082 2010-02-04  Darin Adler  <darin@apple.com>
9083
9084         Reviewed by David Levin.
9085
9086         Make MathExtras.h compatible with <cmath>
9087         https://bugs.webkit.org/show_bug.cgi?id=34618
9088
9089         * wtf/MathExtras.h: Include <cmath> instead of <math.h>.
9090         Use "using" as we do elsewhere in WTF for the four functions from <cmath>
9091         we want to use without the prefix. Later we could consider making the std
9092         explicit at call sites instead.
9093
9094 2010-02-04  Tamas Szirbucz  <szirbucz@inf.u-szeged.hu>
9095
9096         Reviewed by Gavin Barraclough.
9097
9098         Use an easily appendable structure for trampolines instead of pointer parameters.
9099         https://bugs.webkit.org/show_bug.cgi?id=34424
9100
9101         * assembler/ARMAssembler.cpp:
9102         (JSC::ARMAssembler::executableCopy):
9103         * jit/JIT.h:
9104         (JSC::JIT::compileCTIMachineTrampolines):
9105         * jit/JITOpcodes.cpp:
9106         (JSC::JIT::privateCompileCTIMachineTrampolines):
9107         * jit/JITStubs.cpp:
9108         (JSC::JITThunks::JITThunks):
9109         * jit/JITStubs.h:
9110         (JSC::JITThunks::ctiStringLengthTrampoline):
9111         (JSC::JITThunks::ctiVirtualCallLink):
9112         (JSC::JITThunks::ctiVirtualCall):
9113         (JSC::JITThunks::ctiNativeCallThunk):
9114
9115 2010-02-04  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
9116
9117         Reviewed by Simon Hausmann.
9118
9119         Increase test coverage for the QScriptValue.
9120
9121         https://bugs.webkit.org/show_bug.cgi?id=34533
9122
9123         * qt/tests/qscriptvalue/qscriptvalue.pro:
9124         * qt/tests/qscriptvalue/tst_qscriptvalue.cpp:
9125         (tst_QScriptValue::tst_QScriptValue):
9126         (tst_QScriptValue::~tst_QScriptValue):
9127         (tst_QScriptValue::dataHelper):
9128         (tst_QScriptValue::newRow):
9129         (tst_QScriptValue::testHelper):
9130         (tst_QScriptValue::ctor):
9131         * qt/tests/qscriptvalue/tst_qscriptvalue.h: Added.
9132         * qt/tests/qscriptvalue/tst_qscriptvalue_generated.cpp: Added.
9133         (tst_QScriptValue::initScriptValues):
9134         (tst_QScriptValue::isValid_initData):
9135         (tst_QScriptValue::isValid_makeData):
9136         (tst_QScriptValue::isValid_test):
9137         (tst_QScriptValue::isBool_initData):
9138         (tst_QScriptValue::isBool_makeData):
9139         (tst_QScriptValue::isBool_test):
9140         (tst_QScriptValue::isBoolean_initData):
9141         (tst_QScriptValue::isBoolean_makeData):
9142         (tst_QScriptValue::isBoolean_test):
9143         (tst_QScriptValue::isFunction_initData):
9144         (tst_QScriptValue::isFunction_makeData):
9145         (tst_QScriptValue::isFunction_test):
9146         (tst_QScriptValue::isNull_initData):
9147         (tst_QScriptValue::isNull_makeData):
9148         (tst_QScriptValue::isNull_test):
9149         (tst_QScriptValue::isString_initData):
9150         (tst_QScriptValue::isString_makeData):
9151         (tst_QScriptValue::isString_test):
9152         (tst_QScriptValue::isUndefined_initData):
9153         (tst_QScriptValue::isUndefined_makeData):
9154         (tst_QScriptValue::isUndefined_test):
9155         (tst_QScriptValue::isObject_initData):
9156         (tst_QScriptValue::isObject_makeData):
9157         (tst_QScriptValue::isObject_test):
9158
9159 2010-02-03  Kwang Yul Seo  <skyul@company100.net>
9160
9161         Reviewed by Eric Seidel.
9162
9163         [BREWMP] Define WTF_PLATFORM_BREWMP_SIMULATOR when AEE_SIMULATOR is defined
9164         https://bugs.webkit.org/show_bug.cgi?id=34514
9165
9166         PLATFORM(BREWMP_SIMULATOR) guard is needed to make distinction between BREWMP
9167         and BREWMP simulator.
9168
9169         * wtf/Platform.h:
9170
9171 2010-02-03  Kwang Yul Seo  <skyul@company100.net>
9172
9173         Reviewed by Eric Seidel.
9174
9175         [BREWMP] Remove COMPILE_ASSERT conflict with the underlying PLATFORM
9176         https://bugs.webkit.org/show_bug.cgi?id=34190
9177
9178         COMPILE_ASSERT conflicts with the underlying PLATFORM because it is defined
9179         both in WTF's Assertions.h and BREWMP's AEEClassIDs.h. Include AEEClassIDs.h
9180         in Assertions.h and undef COMPILE_ASSERT to avoid redefining COMPILE_ASSERT.
9181
9182         * wtf/Assertions.h:
9183
9184 2010-02-03  Kwang Yul Seo  <skyul@company100.net>
9185
9186         Reviewed by Eric Seidel.
9187
9188         [BREWMP] Implement OwnPtrBrew to make sure BREW instances are freed.
9189         https://bugs.webkit.org/show_bug.cgi?id=34518
9190
9191         Add OwnPtrBrew to release IFile, IFileMgr and IBitmap instances.
9192
9193         * wtf/brew/OwnPtrBrew.cpp: Added.
9194         (WTF::IFileMgr):
9195         (WTF::IFile):
9196         (WTF::IBitmap):
9197         (WTF::freeOwnedPtrBrew):
9198         * wtf/brew/OwnPtrBrew.h: Added.
9199         (WTF::OwnPtrBrew::OwnPtrBrew):
9200         (WTF::OwnPtrBrew::~OwnPtrBrew):
9201         (WTF::OwnPtrBrew::get):
9202         (WTF::OwnPtrBrew::release):
9203         (WTF::OwnPtrBrew::outPtr):
9204         (WTF::OwnPtrBrew::set):
9205         (WTF::OwnPtrBrew::clear):
9206         (WTF::OwnPtrBrew::operator*):
9207         (WTF::OwnPtrBrew::operator->):
9208         (WTF::OwnPtrBrew::operator!):
9209         (WTF::OwnPtrBrew::operator UnspecifiedBoolType):
9210         (WTF::OwnPtrBrew::swap):
9211         (WTF::swap):
9212         (WTF::operator==):
9213         (WTF::operator!=):
9214         (WTF::getPtr):
9215
9216 2010-02-03  Kwang Yul Seo  <skyul@company100.net>
9217
9218         Reviewed by Darin Adler.
9219
9220         Export WTF::fastStrDup symbol
9221         https://bugs.webkit.org/show_bug.cgi?id=34526
9222
9223         * JavaScriptCore.exp:
9224
9225 2010-02-03  Kevin Watters  <kevinwatters@gmail.com>
9226
9227         Reviewed by Kevin Ollivier.
9228
9229         [wx] Enable JIT compilation for wx.
9230         
9231         https://bugs.webkit.org/show_bug.cgi?id=34536
9232
9233         * wtf/Platform.h:
9234
9235 2010-02-02  Oliver Hunt  <oliver@apple.com>
9236
9237         Reviewed by Geoffrey Garen.
9238
9239         Crash in CollectorBitmap::get at nbcolympics.com
9240         https://bugs.webkit.org/show_bug.cgi?id=34504
9241
9242         This was caused by the use of m_offset to determine the offset of
9243         a new property into the property storage.  This patch corrects
9244         the effected cases by incorporating the anonymous slot count. It
9245         also removes the duplicate copy of anonymous slot count from the
9246         property table as keeping this up to date merely increased the
9247         chance of a mismatch.  Finally I've added a large number of
9248         assertions in an attempt to prevent such a bug from happening
9249         again.
9250
9251         With the new assertions in place the existing anonymous slot tests
9252         all fail without the m_offset fixes.
9253
9254         * runtime/PropertyMapHashTable.h:
9255         * runtime/Structure.cpp:
9256         (JSC::Structure::materializePropertyMap):
9257         (JSC::Structure::addPropertyTransitionToExistingStructure):
9258         (JSC::Structure::addPropertyTransition):
9259         (JSC::Structure::removePropertyTransition):
9260         (JSC::Structure::flattenDictionaryStructure):
9261         (JSC::Structure::addPropertyWithoutTransition):
9262         (JSC::Structure::removePropertyWithoutTransition):
9263         (JSC::Structure::copyPropertyTable):
9264         (JSC::Structure::get):
9265         (JSC::Structure::put):
9266         (JSC::Structure::remove):
9267         (JSC::Structure::insertIntoPropertyMapHashTable):
9268         (JSC::Structure::createPropertyMapHashTable):
9269         (JSC::Structure::rehashPropertyMapHashTable):
9270         (JSC::Structure::checkConsistency):
9271
9272 2010-02-02  Steve Falkenburg  <sfalken@apple.com>
9273
9274         Reviewed by Darin Adler.
9275
9276         Copyright year updating for Windows version resources should be automatic
9277         https://bugs.webkit.org/show_bug.cgi?id=34503
9278
9279         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.rc:
9280
9281 2010-02-02  Kwang Yul Seo  <skyul@company100.net>
9282
9283         Reviewed by Eric Seidel.
9284
9285         [BREWMP] Add dummy main thread functions
9286         https://bugs.webkit.org/show_bug.cgi?id=33569
9287
9288         Add dummy initializeMainThreadPlatform and
9289         scheduleDispatchFunctionsOnMainThread.
9290
9291         * wtf/brew/MainThreadBrew.cpp: Added.
9292         (WTF::initializeMainThreadPlatform):
9293         (WTF::scheduleDispatchFunctionsOnMainThread):
9294
9295 2010-02-02  Kwang Yul Seo  <skyul@company100.net>
9296
9297         Reviewed by Darin Adler.
9298
9299         Add using WTF::getLocalTime to CurrentTime.h
9300         https://bugs.webkit.org/show_bug.cgi?id=34493
9301
9302         * wtf/CurrentTime.h:
9303
9304 2010-02-02  Kwang Yul Seo  <skyul@company100.net>
9305
9306         Reviewed by Eric Seidel.
9307
9308         [BREWMP] Add HAVE_XXX definitions
9309         https://bugs.webkit.org/show_bug.cgi?id=34414
9310
9311         Add HAVE_ERRNO_H=1
9312
9313         * wtf/Platform.h:
9314
9315 2010-02-02  Kwang Yul Seo  <skyul@company100.net>
9316
9317         Reviewed by Eric Seidel.
9318
9319         [BREWMP] Don't define HAVE_TM_GMTOFF, HAVE_TM_ZONE and HAVE_TIMEGM
9320         https://bugs.webkit.org/show_bug.cgi?id=34388
9321
9322         BREWMP does not have these features.
9323
9324         * wtf/Platform.h:
9325
9326 2010-02-02  Kwang Yul Seo  <skyul@company100.net>
9327
9328         Reviewed by Eric Seidel.
9329
9330         [BREWMP] Define WTF_PLATFORM_BREWMP=1 when BUILDING_BREWMP is defined
9331         https://bugs.webkit.org/show_bug.cgi?id=34386
9332
9333         Define WTF_PLATFORM_BREWMP=1 so that PLATFORM(BREWMP) guard can be used.
9334
9335         * wtf/Platform.h:
9336
9337 2010-02-01  Kent Tamura  <tkent@chromium.org>
9338
9339         Reviewed by Darin Adler.
9340
9341         Date.UTC() should apply TimeClip operation.
9342         https://bugs.webkit.org/show_bug.cgi?id=34461
9343
9344         ECMAScript 5 15.9.4.3:
9345         > 9 Return TimeClip(MakeDate(MakeDay(yr, m, dt), MakeTime(h, min, s, milli))).
9346
9347         * runtime/DateConstructor.cpp:
9348         (JSC::dateUTC): Calls WTF::timeClip().
9349
9350 2010-02-01  Kent Tamura  <tkent@chromium.org>
9351
9352         Reviewed by Darin Adler.
9353
9354         Fix a bug that Math.round() retunrs incorrect results for huge integers
9355         https://bugs.webkit.org/show_bug.cgi?id=34462
9356
9357         * runtime/MathObject.cpp:
9358         (JSC::mathProtoFuncRound): Avoid "arg + 0.5".
9359
9360 2010-02-01  Kwang Yul Seo  <skyul@company100.net>
9361
9362         Reviewed by Eric Seidel.
9363
9364         [BREWMP] Port WTF's currentTime
9365         https://bugs.webkit.org/show_bug.cgi?id=33567
9366
9367         Combine GETUTCSECONDS and GETTIMEMS to calculate the number
9368         of milliseconds since 1970/01/01 00:00:00 UTC.
9369
9370         * wtf/CurrentTime.cpp:
9371         (WTF::currentTime):
9372
9373 2010-02-01  Patrick Gansterer  <paroga@paroga.com>
9374
9375         Reviewed by Darin Adler.
9376
9377         [Qt] WinCE buildfix after r52729 and fix for Q_BIG_ENDIAN typo.
9378         https://bugs.webkit.org/show_bug.cgi?id=34378
9379
9380         * wtf/Platform.h:
9381
9382 2010-02-01  Oliver Hunt  <oliver@apple.com>
9383
9384         Reviewed by Gavin Barraclough.
9385
9386         Structure not accounting for anonymous slots when computing property storage size
9387         https://bugs.webkit.org/show_bug.cgi?id=34441
9388
9389         Previously any Structure with anonymous storage would have a property map, so we
9390         were only including anonymous slot size if there was a property map.  Given this
9391         is no longer the case we should always include the anonymous slot count in the
9392         property storage size.
9393
9394         * runtime/Structure.h:
9395         (JSC::Structure::propertyStorageSize):
9396
9397 2010-02-01  Oliver Hunt  <oliver@apple.com>
9398
9399         Windows build fix, update exports file (again)
9400
9401         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
9402
9403 2010-02-01  Oliver Hunt  <oliver@apple.com>
9404
9405         Windows build fix, update exports file
9406
9407         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
9408
9409 2010-01-31  Oliver Hunt  <oliver@apple.com>
9410
9411         Reviewed by Maciej Stachowiak.
9412
9413         JSC is failing to propagate anonymous slot count on some transitions
9414         https://bugs.webkit.org/show_bug.cgi?id=34321
9415
9416         Remove secondary Structure constructor, and make Structure store a copy
9417         of the number of anonymous slots directly so saving an immediate allocation
9418         of a property map for all structures with anonymous storage, which also
9419         avoids the leaked property map on new property transition in the original
9420         version of this patch.
9421
9422         We need to propagate the the anonymous slot count otherwise we can end up
9423         with a structure recording incorrect information about the available and
9424         needed space for property storage, or alternatively incorrectly reusing
9425         some slots.
9426
9427         * JavaScriptCore.exp:
9428         * runtime/Structure.cpp:
9429         (JSC::Structure::Structure):
9430         (JSC::Structure::materializePropertyMap):
9431         (JSC::Structure::addPropertyTransition):
9432         (JSC::Structure::changePrototypeTransition):
9433         (JSC::Structure::despecifyFunctionTransition):
9434         (JSC::Structure::getterSetterTransition):
9435         (JSC::Structure::toDictionaryTransition):
9436         (JSC::Structure::flattenDictionaryStructure):
9437         (JSC::Structure::copyPropertyTable):
9438         (JSC::Structure::put):
9439         (JSC::Structure::remove):
9440         (JSC::Structure::insertIntoPropertyMapHashTable):
9441         (JSC::Structure::createPropertyMapHashTable):
9442         * runtime/Structure.h:
9443         (JSC::Structure::create):
9444         (JSC::Structure::hasAnonymousSlots):
9445         (JSC::Structure::anonymousSlotCount):
9446
9447 2010-01-31  Patrick Gansterer  <paroga@paroga.com>
9448
9449         Reviewed by Darin Adler.
9450
9451         Buildfix for WinCE + style fixes (TLS_OUT_OF_INDEXES is not defined).
9452         https://bugs.webkit.org/show_bug.cgi?id=34380
9453
9454         * wtf/ThreadSpecific.h:
9455
9456 2010-01-31  Kent Tamura  <tkent@chromium.org>
9457
9458         Reviewed by Darin Adler.
9459
9460         [Windows] Fix a bug of round() with huge integral numbers
9461         https://bugs.webkit.org/show_bug.cgi?id=34297
9462
9463         Fix a bug that round() for huge integral numbers returns incorrect
9464         results. For example, round(8639999913600001) returns
9465         8639999913600002 without this change though the double type can
9466         represent 8639999913600001 precisely.
9467
9468         Math.round() of JavaScript has a similar problem. But this change
9469         doesn't fix it because Math.round() doesn't use round() of
9470         MathExtra.h.
9471
9472         * wtf/MathExtras.h:
9473         (round): Avoid to do "num + 0.5" or "num - 0.5".
9474         (roundf): Fixed similarly.
9475         (llround): Calls round().
9476         (llroundf): Calls roundf().
9477         (lround): Calls round().
9478         (lroundf): Calls roundf().
9479
9480 2010-01-29  Mark Rowe  <mrowe@apple.com>
9481
9482         Sort Xcode projects.
9483
9484         * JavaScriptCore.xcodeproj/project.pbxproj:
9485
9486 2010-01-29  Mark Rowe  <mrowe@apple.com>
9487
9488         Fix the Mac build.
9489
9490         Disable ENABLE_INDEXED_DATABASE since it is "completely non-functional".
9491
9492         As the comment in FeatureDefines.xcconfig notes, the list of feature defines
9493         needs to be kept in sync across the various files.  The default values also
9494         need to be kept in sync between these files and build-webkit.
9495
9496         * Configurations/FeatureDefines.xcconfig:
9497
9498 2010-01-29  Simon Hausmann  <simon.hausmann@nokia.com>
9499
9500         Rubber-stamped by Maciej Stachowiak.
9501
9502         Fix the ARM build.
9503
9504         * runtime/JSNumberCell.h:
9505         (JSC::JSNumberCell::createStructure): Call the right Structure::create overload.
9506
9507 2010-01-28  Kevin Ollivier  <kevino@theolliviers.com>
9508
9509         [wx] Build fix for MSW, use ThreadingWin.cpp as the Windows pthreads implementation
9510         implements pthread_t in a way that makes it impossible to check its validity,
9511         which is needed by ThreadingPthreads.cpp.
9512
9513         * wscript:
9514
9515 2010-01-28  Oliver Hunt  <oliver@apple.com>
9516
9517         Reviewed by Gavin Barraclough.
9518
9519         DOM Objects shouldn't all require custom mark functions
9520         https://bugs.webkit.org/show_bug.cgi?id=34291
9521
9522         Make getAnonymousValue const-friendly
9523
9524         * runtime/JSObject.h:
9525         (JSC::JSObject::getAnonymousValue):
9526
9527 2010-01-28  Oliver Hunt  <oliver@apple.com>
9528
9529         Reviewed by Gavin Barraclough.
9530
9531         Simplify anonymous slot implementation
9532         https://bugs.webkit.org/show_bug.cgi?id=34282
9533
9534         A class must now specify the number of slots it needs at construction time
9535         rather than later on with a transition.  This makes many things simpler,
9536         we no longer need to need an additional transition on object creation to
9537         add the anonymous slots, and we remove the need for a number of transition
9538         type checks. 
9539
9540         * API/JSCallbackConstructor.h:
9541         (JSC::JSCallbackConstructor::createStructure):
9542         * API/JSCallbackFunction.h:
9543         (JSC::JSCallbackFunction::createStructure):
9544         * API/JSCallbackObject.h:
9545         (JSC::JSCallbackObject::createStructure):
9546         * JavaScriptCore.exp:
9547         * debugger/DebuggerActivation.h:
9548         (JSC::DebuggerActivation::createStructure):
9549         * runtime/Arguments.h:
9550         (JSC::Arguments::createStructure):
9551         * runtime/BooleanObject.h:
9552         (JSC::BooleanObject::createStructure):
9553         * runtime/DateInstance.h:
9554         (JSC::DateInstance::createStructure):
9555         * runtime/DatePrototype.h:
9556         (JSC::DatePrototype::createStructure):
9557         * runtime/FunctionPrototype.h:
9558         (JSC::FunctionPrototype::createStructure):
9559         * runtime/GetterSetter.h:
9560         (JSC::GetterSetter::createStructure):
9561         * runtime/GlobalEvalFunction.h:
9562         (JSC::GlobalEvalFunction::createStructure):
9563         * runtime/InternalFunction.h:
9564         (JSC::InternalFunction::createStructure):
9565         * runtime/JSAPIValueWrapper.h:
9566         (JSC::JSAPIValueWrapper::createStructure):
9567         * runtime/JSActivation.h:
9568         (JSC::JSActivation::createStructure):
9569         * runtime/JSArray.h:
9570         (JSC::JSArray::createStructure):
9571         * runtime/JSByteArray.cpp:
9572         (JSC::JSByteArray::createStructure):
9573         * runtime/JSCell.h:
9574         (JSC::JSCell::createDummyStructure):
9575         * runtime/JSFunction.h:
9576         (JSC::JSFunction::createStructure):
9577         * runtime/JSGlobalObject.h:
9578         (JSC::JSGlobalObject::createStructure):
9579         * runtime/JSNotAnObject.h:
9580         (JSC::JSNotAnObject::createStructure):
9581         * runtime/JSONObject.h:
9582         (JSC::JSONObject::createStructure):
9583         * runtime/JSObject.h:
9584         (JSC::JSObject::createStructure):
9585         (JSC::JSObject::putAnonymousValue):
9586         (JSC::JSObject::getAnonymousValue):
9587         * runtime/JSPropertyNameIterator.h:
9588         (JSC::JSPropertyNameIterator::createStructure):
9589         * runtime/JSStaticScopeObject.h:
9590         (JSC::JSStaticScopeObject::createStructure):
9591         * runtime/JSString.h:
9592         (JSC::Fiber::createStructure):
9593         * runtime/JSVariableObject.h:
9594         (JSC::JSVariableObject::createStructure):
9595         * runtime/JSWrapperObject.h:
9596         (JSC::JSWrapperObject::createStructure):
9597         (JSC::JSWrapperObject::JSWrapperObject):
9598         * runtime/MathObject.h:
9599         (JSC::MathObject::createStructure):
9600         * runtime/NumberConstructor.h:
9601         (JSC::NumberConstructor::createStructure):
9602         * runtime/NumberObject.h:
9603         (JSC::NumberObject::createStructure):
9604         * runtime/RegExpConstructor.h:
9605         (JSC::RegExpConstructor::createStructure):
9606         * runtime/RegExpObject.h:
9607         (JSC::RegExpObject::createStructure):
9608         * runtime/StringObject.h:
9609         (JSC::StringObject::createStructure):
9610         * runtime/StringObjectThatMasqueradesAsUndefined.h:
9611         (JSC::StringObjectThatMasqueradesAsUndefined::createStructure):
9612         * runtime/Structure.cpp:
9613         (JSC::Structure::~Structure):
9614         (JSC::Structure::materializePropertyMap):
9615         * runtime/Structure.h:
9616         (JSC::Structure::create):
9617         (JSC::Structure::anonymousSlotCount):
9618         * runtime/StructureTransitionTable.h:
9619
9620 2010-01-27  Oliver Hunt  <oliver@apple.com>
9621
9622         Windows build fix.
9623
9624         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
9625
9626 2010-01-27  Oliver Hunt  <oliver@apple.com>
9627
9628         Reviewed by Maciej Stachowiak.
9629
9630         MessageEvent.data should deserialize in the context of the MessageEvent's global object
9631         https://bugs.webkit.org/show_bug.cgi?id=34227
9632
9633         Add logic to allow us to create an Object, Array, or Date instance
9634         so we can create them in the context of a specific global object,
9635         rather than just using the current lexical global object.
9636
9637         * JavaScriptCore.exp:
9638         * runtime/DateInstance.cpp:
9639         (JSC::DateInstance::DateInstance):
9640         * runtime/DateInstance.h:
9641         * runtime/JSGlobalObject.h:
9642         (JSC::constructEmptyObject):
9643         (JSC::constructEmptyArray):
9644
9645 2010-01-27  Alexey Proskuryakov  <ap@apple.com>
9646
9647         Reviewed by Darin Adler.
9648
9649         https://bugs.webkit.org/show_bug.cgi?id=34150
9650         WebKit needs a mechanism to catch stale HashMap entries
9651
9652         It is very difficult to catch stale pointers that are HashMap keys - since a pointer's hash
9653         is just its value, it is very unlikely that any observable problem is reproducible.
9654
9655         This extends hash table consistency checks to check that pointers are referencing allocated
9656         memory blocks, and makes it possible to invoke the checks explicitly (it is not feasible
9657         to enable CHECK_HASHTABLE_CONSISTENCY by default, because that affects performance too much).
9658
9659         * wtf/HashMap.h: (WTF::::checkConsistency): Call through to HashTable implementation. We can
9660         add similar calls to HashSet and HashCountedSet, but I haven't seen hard to debug problems
9661         with those yet.
9662
9663         * wtf/HashSet.h: (WTF::::remove): The version of checkTableConsistency that's guarded by
9664         CHECK_HASHTABLE_CONSISTENCY is now called internalCheckTableConsistency().
9665
9666         * wtf/HashTable.h:
9667         (WTF::HashTable::internalCheckTableConsistency):
9668         (WTF::HashTable::internalCheckTableConsistencyExceptSize):
9669         (WTF::HashTable::checkTableConsistencyExceptSize):
9670         Expose checkTableConsistency() even if CHECK_HASHTABLE_CONSISTENCY is off.
9671         (WTF::::add): Updated for checkTableConsistency renaming.
9672         (WTF::::addPassingHashCode): Ditto.
9673         (WTF::::removeAndInvalidate): Ditto.
9674         (WTF::::remove): Ditto.
9675         (WTF::::rehash): Ditto.
9676         (WTF::::checkTableConsistency): The assertion for !shouldExpand() was not correct - this
9677         function returns true for tables with m_table == 0.
9678         (WTF::::checkTableConsistencyExceptSize): Call checkValueConsistency for key. Potentially,
9679         we could do the same for values.
9680
9681         * wtf/HashTraits.h:
9682         (WTF::GenericHashTraits::checkValueConsistency): An empty function that can be overridden
9683         to add checks. Currently, the only override is for pointer hashes.
9684
9685         * wtf/RefPtrHashMap.h: (WTF::::remove): Updated for checkTableConsistency renaming.
9686
9687 2010-01-27  Anton Muhin  <antonm@chromium.org>
9688
9689         Reviewed by Darin Adler.
9690
9691         Remove trailing \ from inline function code
9692         https://bugs.webkit.org/show_bug.cgi?id=34223
9693
9694         * assembler/ARMv7Assembler.h:
9695         (JSC::ARMThumbImmediate::countLeadingZerosPartial):
9696
9697 2010-01-27  Kwang Yul Seo  <skyul@company100.net>
9698
9699         Reviewed by Eric Seidel.
9700
9701         [BREWMP] Port WTF's randomNumber
9702         https://bugs.webkit.org/show_bug.cgi?id=33566
9703
9704         Use GETRAND to generate 4 byte random byte sequence to implement
9705         weakRandomNumber. Create a secure random number generator with
9706         AEECLSID_RANDOM to implement randomNumber.
9707
9708         * wtf/RandomNumber.cpp:
9709         (WTF::weakRandomNumber):
9710         (WTF::randomNumber):
9711
9712 2010-01-27  Kwang Yul Seo  <skyul@company100.net>
9713
9714         Reviewed by Eric Seidel.
9715
9716         [BREWMP] Port getCPUTime
9717         https://bugs.webkit.org/show_bug.cgi?id=33572
9718
9719         Use GETUPTIMEMS which returns a continuously and
9720         linearly increasing millisecond timer from the time the device
9721         was powered on. This function is enough to implement getCPUTime.
9722
9723         * runtime/TimeoutChecker.cpp:
9724         (JSC::getCPUTime):
9725
9726 2010-01-27  Kwang Yul Seo  <skyul@company100.net>
9727
9728         Reviewed by Oliver Hunt.
9729
9730         [BREWMP] Add MarkStack fastMalloc implementation for platforms without VirtualAlloc or mmap.
9731         https://bugs.webkit.org/show_bug.cgi?id=33582
9732
9733         Use fastMalloc and fastFree to implement MarkStack::allocateStack and
9734         MarkStack::releaseStack for platforms without page level allocation.
9735
9736         * runtime/MarkStack.h:
9737         (JSC::MarkStack::MarkStackArray::shrinkAllocation):
9738         * runtime/MarkStackNone.cpp: Added.
9739         (JSC::MarkStack::initializePagesize):
9740         (JSC::MarkStack::allocateStack):
9741         (JSC::MarkStack::releaseStack):
9742
9743 2010-01-27  Kwang Yul Seo  <skyul@company100.net>
9744
9745         Reviewed by Eric Seidel.
9746
9747         [BREWMP] Don't use time function
9748         https://bugs.webkit.org/show_bug.cgi?id=33577
9749
9750         Calling time(0) in BREW devices causes a crash because time
9751         is not properly ported in most devices. Cast currentTime() to
9752         time_t to get the same result as time(0).
9753
9754         * wtf/DateMath.cpp:
9755         (WTF::calculateUTCOffset):
9756
9757 2010-01-27  Alexey Proskuryakov  <ap@apple.com>
9758
9759         Revert r53899 (HashMap<AtomicStringImpl*, Value> key checks) and subsequent build fixes,
9760         because they make SVG tests crash in release builds.
9761
9762         * wtf/HashMap.h:
9763         (WTF::::remove):
9764         * wtf/HashSet.h:
9765         (WTF::::remove):
9766         * wtf/HashTable.h:
9767         (WTF::::add):
9768         (WTF::::addPassingHashCode):
9769         (WTF::::removeAndInvalidate):
9770         (WTF::::remove):
9771         (WTF::::rehash):
9772         (WTF::::checkTableConsistency):
9773         (WTF::::checkTableConsistencyExceptSize):
9774         * wtf/HashTraits.h:
9775         (WTF::GenericHashTraits::emptyValue):
9776         (WTF::):
9777         * wtf/RefPtrHashMap.h:
9778         (WTF::::remove):
9779
9780 2010-01-26  Alexey Proskuryakov  <ap@apple.com>
9781
9782         More Windows build fixing.
9783
9784         * wtf/HashTraits.h: _msize takes void*, remove const qualifier from type.
9785
9786 2010-01-26  Alexey Proskuryakov  <ap@apple.com>
9787
9788         Windows build fix.
9789
9790         * wtf/HashTraits.h: Include malloc.h for _msize().
9791
9792 2010-01-26  Alexey Proskuryakov  <ap@apple.com>
9793
9794         Build fix.
9795
9796         * wtf/HashTable.h: (WTF::HashTable::checkTableConsistencyExceptSize): Remove const from a
9797         static (empty) version of this function.
9798
9799 2010-01-26  Alexey Proskuryakov  <ap@apple.com>
9800
9801         Reviewed by Darin Adler.
9802
9803         https://bugs.webkit.org/show_bug.cgi?id=34150
9804         WebKit needs a mechanism to catch stale HashMap entries
9805
9806         It is very difficult to catch stale pointers that are HashMap keys - since a pointer's hash
9807         is just its value, it is very unlikely that any observable problem is reproducible.
9808
9809         This extends hash table consistency checks to check that pointers are referencing allocated
9810         memory blocks, and makes it possible to invoke the checks explicitly (it is not feasible
9811         to enable CHECK_HASHTABLE_CONSISTENCY by default, because that affects performance too much).
9812
9813         * wtf/HashMap.h: (WTF::::checkConsistency): Call through to HashTable implementation. We can
9814         add similar calls to HashSet and HashCountedSet, but I haven't seen hard to debug problems
9815         with those yet.
9816
9817         * wtf/HashSet.h: (WTF::::remove): The version of checkTableConsistency that's guarded by
9818         CHECK_HASHTABLE_CONSISTENCY is now called internalCheckTableConsistency().
9819
9820         * wtf/HashTable.h:
9821         (WTF::HashTable::internalCheckTableConsistency):
9822         (WTF::HashTable::internalCheckTableConsistencyExceptSize):
9823         (WTF::HashTable::checkTableConsistencyExceptSize):
9824         Expose checkTableConsistency() even if CHECK_HASHTABLE_CONSISTENCY is off.
9825         (WTF::::add): Updated for checkTableConsistency renaming.
9826         (WTF::::addPassingHashCode): Ditto.
9827         (WTF::::removeAndInvalidate): Ditto.
9828         (WTF::::remove): Ditto.
9829         (WTF::::rehash): Ditto.
9830         (WTF::::checkTableConsistency): The assertion for !shouldExpand() was not correct - this
9831         function returns true for tables with m_table == 0.
9832         (WTF::::checkTableConsistencyExceptSize): Call checkValueConsistency for key. Potentially,
9833         we could do the same for values.
9834
9835         * wtf/HashTraits.h:
9836         (WTF::GenericHashTraits::checkValueConsistency): An empty function that can be overridden
9837         to add checks. Currently, the only override is for pointer hashes.
9838
9839         * wtf/RefPtrHashMap.h: (WTF::::remove): Updated for checkTableConsistency renaming.
9840
9841 2010-01-26  Lyon Chen  <liachen@rim.com>
9842
9843         Reviewed by Maciej Stachowiak.
9844
9845         Opcode.h use const void* for Opcode cause error #1211 for RVCT compiler
9846         https://bugs.webkit.org/show_bug.cgi?id=33902
9847
9848         * bytecode/Opcode.h:
9849
9850 2010-01-26  Steve Falkenburg  <sfalken@apple.com>
9851
9852         Reviewed by Oliver Hunt.
9853
9854         Windows build references non-existent include paths
9855         https://bugs.webkit.org/show_bug.cgi?id=34175
9856
9857         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
9858         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
9859         * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops:
9860         * JavaScriptCore.vcproj/jsc/jscCommon.vsprops:
9861         * JavaScriptCore.vcproj/testapi/testapi.vcproj:
9862         * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops:
9863
9864 2010-01-26  Oliver Hunt  <oliver@apple.com>
9865
9866         Reviewed by Geoffrey Garen.
9867
9868         Using JavaScriptCore API with a webkit vended context can result in slow script dialog
9869         https://bugs.webkit.org/show_bug.cgi?id=34172
9870
9871         Make the APIShim correctly increment and decrement the timeout
9872         entry counter.
9873
9874         * API/APIShims.h:
9875         (JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock):
9876         (JSC::APIEntryShimWithoutLock::~APIEntryShimWithoutLock):
9877         (JSC::APICallbackShim::APICallbackShim):
9878         (JSC::APICallbackShim::~APICallbackShim):
9879
9880 2010-01-26  Simon Hausmann  <simon.hausmann@nokia.com>
9881
9882         [Qt] Fix compilation of QtScript with non-gcc compilers
9883
9884         Variable length stack arrays are a gcc extension. Use QVarLengthArray
9885         as a more portable solution that still tries to allocate on the stack
9886         first.
9887
9888         * qt/api/qscriptvalue_p.h:
9889         (QScriptValuePrivate::call):
9890
9891 2010-01-26  Simon Hausmann  <simon.hausmann@nokia.com>
9892
9893         Reviewed by Tor Arne Vestbø.
9894
9895         [Qt] Fix the build on platforms without JIT support.
9896
9897         The JIT support should be determined at compile-time via wtf/Platform.h
9898
9899         * qt/api/QtScript.pro:
9900
9901 2010-01-26  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
9902
9903         Reviewed by Simon Hausmann.
9904
9905         First steps of the QtScript API.
9906         
9907         Two new classes were created; QScriptEngine and QScriptValue.
9908         The first should encapsulate a javascript context and the second a script
9909         value.
9910         
9911         This API is still in development, so it isn't compiled by default.
9912         To trigger compilation, pass --qmakearg="CONFIG+=build-qtscript" to
9913         build-webkit.
9914
9915         https://bugs.webkit.org/show_bug.cgi?id=32565
9916
9917         * qt/api/QtScript.pro: Added.
9918         * qt/api/qscriptconverter_p.h: Added.
9919         (QScriptConverter::toString):
9920         * qt/api/qscriptengine.cpp: Added.
9921         (QScriptEngine::QScriptEngine):
9922         (QScriptEngine::~QScriptEngine):
9923         (QScriptEngine::evaluate):
9924         (QScriptEngine::collectGarbage):
9925         * qt/api/qscriptengine.h: Added.
9926         * qt/api/qscriptengine_p.cpp: Added.
9927         (QScriptEnginePrivate::QScriptEnginePrivate):
9928         (QScriptEnginePrivate::~QScriptEnginePrivate):
9929         (QScriptEnginePrivate::evaluate):
9930         * qt/api/qscriptengine_p.h: Added.
9931         (QScriptEnginePrivate::get):
9932         (QScriptEnginePrivate::collectGarbage):
9933         (QScriptEnginePrivate::makeJSValue):
9934         (QScriptEnginePrivate::context):
9935         * qt/api/qscriptvalue.cpp: Added.
9936         (QScriptValue::QScriptValue):
9937         (QScriptValue::~QScriptValue):
9938         (QScriptValue::isValid):
9939         (QScriptValue::isBool):
9940         (QScriptValue::isBoolean):
9941         (QScriptValue::isNumber):
9942         (QScriptValue::isNull):
9943         (QScriptValue::isString):
9944         (QScriptValue::isUndefined):
9945         (QScriptValue::isError):
9946         (QScriptValue::isObject):
9947         (QScriptValue::isFunction):
9948         (QScriptValue::toString):
9949         (QScriptValue::toNumber):
9950         (QScriptValue::toBool):
9951         (QScriptValue::toBoolean):
9952         (QScriptValue::toInteger):
9953         (QScriptValue::toInt32):
9954         (QScriptValue::toUInt32):
9955         (QScriptValue::toUInt16):
9956         (QScriptValue::call):
9957         (QScriptValue::engine):
9958         (QScriptValue::operator=):
9959         (QScriptValue::equals):
9960         (QScriptValue::strictlyEquals):
9961         * qt/api/qscriptvalue.h: Added.
9962         (QScriptValue::):
9963         * qt/api/qscriptvalue_p.h: Added.
9964         (QScriptValuePrivate::):
9965         (QScriptValuePrivate::get):
9966         (QScriptValuePrivate::QScriptValuePrivate):
9967         (QScriptValuePrivate::isValid):
9968         (QScriptValuePrivate::isBool):
9969         (QScriptValuePrivate::isNumber):
9970         (QScriptValuePrivate::isNull):
9971         (QScriptValuePrivate::isString):
9972         (QScriptValuePrivate::isUndefined):
9973         (QScriptValuePrivate::isError):
9974         (QScriptValuePrivate::isObject):
9975         (QScriptValuePrivate::isFunction):
9976         (QScriptValuePrivate::toString):
9977         (QScriptValuePrivate::toNumber):
9978         (QScriptValuePrivate::toBool):
9979         (QScriptValuePrivate::toInteger):
9980         (QScriptValuePrivate::toInt32):
9981         (QScriptValuePrivate::toUInt32):
9982         (QScriptValuePrivate::toUInt16):
9983         (QScriptValuePrivate::equals):
9984         (QScriptValuePrivate::strictlyEquals):
9985         (QScriptValuePrivate::assignEngine):
9986         (QScriptValuePrivate::call):
9987         (QScriptValuePrivate::engine):
9988         (QScriptValuePrivate::context):
9989         (QScriptValuePrivate::value):
9990         (QScriptValuePrivate::object):
9991         (QScriptValuePrivate::inherits):
9992         (QScriptValuePrivate::isJSBased):
9993         (QScriptValuePrivate::isNumberBased):
9994         (QScriptValuePrivate::isStringBased):
9995         * qt/api/qtscriptglobal.h: Added.
9996         * qt/tests/qscriptengine/qscriptengine.pro: Added.
9997         * qt/tests/qscriptengine/tst_qscriptengine.cpp: Added.
9998         (tst_QScriptEngine::tst_QScriptEngine):
9999         (tst_QScriptEngine::~tst_QScriptEngine):
10000         (tst_QScriptEngine::init):
10001         (tst_QScriptEngine::cleanup):
10002         (tst_QScriptEngine::collectGarbage):
10003         (tst_QScriptEngine::evaluate):
10004         * qt/tests/qscriptvalue/qscriptvalue.pro: Added.
10005         * qt/tests/qscriptvalue/tst_qscriptvalue.cpp: Added.
10006         (tst_QScriptValue::tst_QScriptValue):
10007         (tst_QScriptValue::~tst_QScriptValue):
10008         (tst_QScriptValue::init):
10009         (tst_QScriptValue::cleanup):
10010         (tst_QScriptValue::ctor):
10011         (tst_QScriptValue::toString_data):
10012         (tst_QScriptValue::toString):
10013         (tst_QScriptValue::copyConstructor_data):
10014         (tst_QScriptValue::copyConstructor):
10015         (tst_QScriptValue::assignOperator_data):
10016         (tst_QScriptValue::assignOperator):
10017         (tst_QScriptValue::dataSharing):
10018         (tst_QScriptValue::constructors_data):
10019         (tst_QScriptValue::constructors):
10020         (tst_QScriptValue::call):
10021         * qt/tests/tests.pri: Added.
10022         * qt/tests/tests.pro: Added.
10023
10024 2010-01-25  Dmitry Titov  <dimich@chromium.org>
10025
10026         Reviewed by David Levin.
10027
10028         Fix Chromium Linux tests: the pthread functions on Linux produce segfault if they receive 0 thread handle.
10029         After r53714, we can have 0 thread handles passed to pthread_join and pthread_detach if corresponding threads
10030         were already terminated and their threadMap entries cleared.
10031         Add a 0 check.
10032
10033         * wtf/ThreadingPthreads.cpp:
10034         (WTF::waitForThreadCompletion):
10035         (WTF::detachThread):
10036
10037 2010-01-24  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
10038
10039         Reviewed by Maciej Stachowiak.
10040
10041         Refactor JITStubs.cpp so that DEFINE_STUB_FUNCTION is only used once for each function
10042         https://bugs.webkit.org/show_bug.cgi?id=33866
10043
10044         Place the guard USE(JSVALUE32_64) inside the body of the DEFINE_STUB_FUNCTION
10045         macro for those functions that are always present.
10046
10047         * jit/JITStubs.cpp:
10048         (JSC::DEFINE_STUB_FUNCTION):
10049
10050 2010-01-22  Kevin Watters  <kevinwatters@gmail.com>
10051
10052         Reviewed by Kevin Ollivier.
10053
10054         [wx] Remove the Bakefile build system, which is no longer being used.
10055         
10056         https://bugs.webkit.org/show_bug.cgi?id=34022
10057
10058         * JavaScriptCoreSources.bkl: Removed.
10059         * jscore.bkl: Removed.
10060
10061 2010-01-22  Steve Falkenburg  <sfalken@apple.com>
10062
10063         Reviewed by Darin Adler.
10064
10065         https://bugs.webkit.org/show_bug.cgi?id=34025
10066         Enable client-based Geolocation abstraction for Mac, Windows AppleWebKit targets.
10067
10068         * Configurations/FeatureDefines.xcconfig:
10069
10070 2010-01-22  Dmitry Titov  <dimich@chromium.org>
10071
10072         Not reviewed, attempted Snow Leopard build fix.
10073
10074         * wtf/ThreadingPthreads.cpp: Add a forward declaration of a function which is not 'static'.
10075
10076 2009-01-22  Dmitry Titov  <dimich@chromium.org>
10077
10078         Reviewed by Maciej Stachowiak.
10079
10080         Fix the leak of ThreadIdentifiers in threadMap across threads.
10081         https://bugs.webkit.org/show_bug.cgi?id=32689
10082
10083         Test is added to DumpRenderTree.mm.
10084
10085         * Android.mk: Added file ThreadIdentifierDataPthreads.(h|cpp) to build.
10086         * Android.v8.wtf.mk: Ditto.
10087         * GNUmakefile.am: Ditto.
10088         * JavaScriptCore.gyp/JavaScriptCore.gyp: Ditto.
10089         * JavaScriptCore.gypi: Ditto.
10090         * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
10091
10092         * wtf/ThreadIdentifierDataPthreads.cpp: Added. Contains custom implementation of thread-specific data that uses custom destructor.
10093         (WTF::ThreadIdentifierData::~ThreadIdentifierData): Removes the ThreadIdentifier from the threadMap.
10094         (WTF::ThreadIdentifierData::identifier):
10095         (WTF::ThreadIdentifierData::initialize):
10096         (WTF::ThreadIdentifierData::destruct): Custom thread-specific destructor. Resets the value for the key again to cause second invoke.
10097         (WTF::ThreadIdentifierData::initializeKeyOnceHelper):
10098         (WTF::ThreadIdentifierData::initializeKeyOnce): Need to use pthread_once since initialization may come on any thread(s).
10099         * wtf/ThreadIdentifierDataPthreads.h: Added.
10100         (WTF::ThreadIdentifierData::ThreadIdentifierData):
10101
10102         * wtf/Threading.cpp:
10103         (WTF::threadEntryPoint): Move initializeCurrentThreadInternal to after the lock to make
10104                                  sure it is invoked when ThreadIdentifier is already established.
10105
10106         * wtf/Threading.h: Rename setThreadNameInternal -> initializeCurrentThreadInternal since it does more then only set the name now.
10107         * wtf/ThreadingNone.cpp:
10108         (WTF::initializeCurrentThreadInternal): Ditto.
10109         * wtf/ThreadingWin.cpp:
10110         (WTF::initializeCurrentThreadInternal): Ditto.
10111         (WTF::initializeThreading): Ditto.
10112         * wtf/gtk/ThreadingGtk.cpp:
10113         (WTF::initializeCurrentThreadInternal): Ditto.
10114         * wtf/qt/ThreadingQt.cpp:
10115         (WTF::initializeCurrentThreadInternal): Ditto.
10116
10117         * wtf/ThreadingPthreads.cpp:
10118         (WTF::establishIdentifierForPthreadHandle):
10119         (WTF::clearPthreadHandleForIdentifier): Make it not 'static' so the ~ThreadIdentifierData() in another file can call it.
10120         (WTF::initializeCurrentThreadInternal): Set the thread-specific data. The ThreadIdentifier is already established by creating thread.
10121         (WTF::waitForThreadCompletion): Remove call to clearPthreadHandleForIdentifier(threadID) since it is now done in ~ThreadIdentifierData().
10122         (WTF::detachThread): Ditto.
10123         (WTF::currentThread): Use the thread-specific data to get the ThreadIdentifier. It's many times faster then Mutex-protected iteration through the map.
10124                               Also, set the thread-specific data if called first time on the thread.
10125
10126 2010-01-21  Kwang Yul Seo  <skyul@company100.net>
10127
10128         Reviewed by Alexey Proskuryakov.
10129
10130         Add ThreadSpecific for ENABLE(SINGLE_THREADED)
10131         https://bugs.webkit.org/show_bug.cgi?id=33878
10132
10133         Implement ThreadSpecific with a simple getter/setter
10134         when ENABLE(SINGLE_THREADED) is true.
10135
10136         Due to the change in https://bugs.webkit.org/show_bug.cgi?id=33236,
10137         an implementation of ThreadSpecific must be available to build WebKit.
10138         This causes a build failure for platforms without a proper
10139         ThreadSpecific implementation.
10140
10141         * wtf/ThreadSpecific.h:
10142         (WTF::::ThreadSpecific):
10143         (WTF::::~ThreadSpecific):
10144         (WTF::::get):
10145         (WTF::::set):
10146         (WTF::::destroy):
10147
10148 2010-01-21  Kwang Yul Seo  <skyul@company100.net>
10149
10150         Reviewed by Maciej Stachowiak.
10151
10152         Add fastStrDup to FastMalloc
10153         https://bugs.webkit.org/show_bug.cgi?id=33937
10154
10155         The new string returned by fastStrDup is obtained with fastMalloc,
10156         and can be freed with fastFree. This makes the memory management 
10157         more consistent because we don't need to keep strdup allocated pointers
10158         and free them with free(). Instead we can use fastFree everywhere.
10159
10160         * wtf/FastMalloc.cpp:
10161         (WTF::fastStrDup):
10162         * wtf/FastMalloc.h:
10163
10164 2010-01-21  Brady Eidson  <beidson@apple.com>
10165
10166         Reviewed by Maciej Stachowiak.
10167
10168         history.back() for same-document history traversals isn't synchronous as the specification states.
10169         <rdar://problem/7535011> and https://bugs.webkit.org/show_bug.cgi?id=33538
10170
10171         * wtf/Platform.h: Add a "HISTORY_ALWAYS_ASYNC" enable and turn it on for Chromium.
10172
10173 2010-01-21  Geoffrey Garen  <ggaren@apple.com>
10174
10175         Reviewed by Oliver Hunt.
10176
10177         Always create a prototype for automatically managed classes.
10178         
10179         This fixes some errors where prototype chains were not correctly hooked
10180         up, and also ensures that API classes work correctly with features like
10181         instanceof.
10182
10183         * API/JSClassRef.cpp:
10184         (OpaqueJSClass::create): Cleaned up some of this code. Also changed it
10185         to always create a prototype class.
10186
10187         * API/tests/testapi.c:
10188         (Derived2_class):
10189         (main): Fixed a null value crash in the exception checking code.
10190         * API/tests/testapi.js: Added some tests for the case where a prototype
10191         chain would not be hooked up correctly.
10192
10193 2010-01-21  Oliver Hunt  <oliver@apple.com>
10194
10195         Reviewed by Geoff Garen.
10196
10197         Force JSC to create a prototype chain for API classes with a
10198         parent class but no static functions.
10199
10200         * API/JSClassRef.cpp:
10201         (OpaqueJSClass::create):
10202
10203 2010-01-21  Kent Hansen  <kent.hansen@nokia.com>
10204
10205         Reviewed by Geoffrey Garen.
10206
10207         Object.getOwnPropertyDescriptor always returns undefined for JS API objects
10208         https://bugs.webkit.org/show_bug.cgi?id=33946
10209
10210         Ideally the getOwnPropertyDescriptor() reimplementation should return an
10211         access descriptor that wraps the property getter and setter callbacks, but
10212         that approach is much more involved than returning a value descriptor.
10213         Keep it simple for now.
10214
10215         * API/JSCallbackObject.h:
10216         * API/JSCallbackObjectFunctions.h:
10217         (JSC::::getOwnPropertyDescriptor):
10218         * API/tests/testapi.js:
10219
10220 2010-01-20  Mark Rowe  <mrowe@apple.com>
10221
10222         Build fix.
10223
10224         * wtf/FastMalloc.cpp:
10225         (WTF::TCMalloc_PageHeap::initializeScavenger): Remove unnecessary function call.
10226
10227 2010-01-20  Mark Rowe  <mrowe@apple.com>
10228
10229         Reviewed by Oliver Hunt.
10230
10231         Use the inline i386 assembly for x86_64 as well rather than falling back to using pthread mutexes.
10232
10233         * wtf/TCSpinLock.h:
10234         (TCMalloc_SpinLock::Lock):
10235         (TCMalloc_SpinLock::Unlock):
10236         (TCMalloc_SlowLock):
10237
10238 2010-01-20  Mark Rowe  <mrowe@apple.com>
10239
10240         Reviewed by Oliver Hunt.
10241
10242         <rdar://problem/7215063> Use GCD instead of an extra thread for FastMalloc scavenging on platforms where it is supported
10243
10244         Abstract the background scavenging slightly so that an alternate implementation that uses GCD can be used on platforms
10245         where it is supported.
10246
10247         * wtf/FastMalloc.cpp:
10248         (WTF::TCMalloc_PageHeap::init):
10249         (WTF::TCMalloc_PageHeap::initializeScavenger):
10250         (WTF::TCMalloc_PageHeap::signalScavenger):
10251         (WTF::TCMalloc_PageHeap::shouldContinueScavenging):
10252         (WTF::TCMalloc_PageHeap::Delete):
10253         (WTF::TCMalloc_PageHeap::periodicScavenge):
10254         * wtf/Platform.h:
10255
10256 2010-01-20  Geoffrey Garen  <ggaren@apple.com>
10257
10258         Reviewed by Oliver Hunt.
10259
10260         <rdar://problem/7562708> REGRESSION(53460): Heap::destroy may not run
10261         all destructors
10262
10263         * runtime/Collector.cpp:
10264         (JSC::Heap::freeBlocks): Instead of fully marking protected objects,
10265         just set their mark bits. This prevents protected objects from keeping
10266         unprotected objects alive. Destructor order is not guaranteed, so it's
10267         OK to destroy objects pointed to by protected objects before destroying
10268         protected objects.
10269
10270 2010-01-19  David Levin  <levin@chromium.org>
10271
10272         Reviewed by Oliver Hunt.
10273
10274         CrossThreadCopier needs to support ThreadSafeShared better.
10275         https://bugs.webkit.org/show_bug.cgi?id=33698
10276
10277         * wtf/TypeTraits.cpp: Added tests for the new type traits.
10278         * wtf/TypeTraits.h:
10279         (WTF::IsSubclass): Determines if a class is a derived from another class.
10280         (WTF::IsSubclassOfTemplate): Determines if a class is a derived from a
10281         template class (with one parameter that is unknown).
10282         (WTF::RemoveTemplate): Reveals the type for a template parameter.
10283
10284 2010-01-20  Steve Falkenburg  <sfalken@apple.com>
10285
10286         Reviewed by Darin Adler and Adam Roben.
10287
10288         Feature defines are difficult to maintain on Windows builds
10289         https://bugs.webkit.org/show_bug.cgi?id=33883
10290
10291         FeatureDefines.vsprops are now maintained in a way similar to
10292         Configurations/FeatureDefines.xcconfig, with the added advantage
10293         of having a single FeatureDefines file across all projects.
10294
10295         * Configurations/FeatureDefines.xcconfig: Add comments about keeping feature definitions in sync.
10296         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add FeatureDefines.vsprops inherited property sheet.
10297         * JavaScriptCore.vcproj/WTF/WTF.vcproj: Add FeatureDefines.vsprops inherited property sheet.
10298
10299 2010-01-20  Csaba Osztrogonác  <ossy@webkit.org>
10300
10301         [Qt] Unreviewed buildfix for r53547.
10302
10303         * DerivedSources.pro:
10304
10305 2010-01-20  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
10306
10307         Reviewed by Simon Hausmann.
10308
10309         [Qt] Make extraCompilers for generated sources depend on their scripts
10310
10311         * DerivedSources.pro:
10312
10313 2010-01-19  Brian Weinstein  <bweinstein@apple.com>
10314
10315         Reviewed by Tim Hatcher.
10316
10317         When JavaScriptCore calls Debugger::Exception, have it pass a
10318         hasHandler variable that represents if exception is being handled
10319         in the same function (not in a parent on the call stack).
10320         
10321         This just adds a new parameter, no behavior is changed.
10322
10323         * debugger/Debugger.h:
10324         * interpreter/Interpreter.cpp:
10325         (JSC::Interpreter::throwException):
10326
10327 2010-01-18  Maciej Stachowiak  <mjs@apple.com>
10328
10329         Reviewed by Adam Barth.
10330
10331         Inline functions that are hot in DOM manipulation
10332         https://bugs.webkit.org/show_bug.cgi?id=33820
10333         
10334         (3% speedup on Dromaeo DOM Core tests)
10335
10336         * runtime/WeakGCMap.h:
10337         (JSC::::get): inline
10338
10339 2010-01-19  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
10340
10341         Unreviewed build fix for JIT with RVCT.
10342
10343         Remove IMPORT statement; cti_vm_throw is already defined in JITStubs.h.
10344         Remove extra ')'.
10345
10346         * jit/JITStubs.cpp:
10347         (JSC::ctiVMThrowTrampoline):
10348
10349 2010-01-19  Geoffrey Garen  <ggaren@apple.com>
10350
10351         Reviewed by Oliver Hunt.
10352
10353         REGRESSION (52082): Crash on worker thread when reloading http://radnan.public.iastate.edu/procedural/
10354         https://bugs.webkit.org/show_bug.cgi?id=33826
10355
10356         This bug was caused by a GC-protected object being destroyed early by
10357         Heap::destroy. Clients of the GC protect APIs (reasonably) expect pointers
10358         to GC-protected memory to be valid.
10359
10360         The solution is to do two passes of tear-down in Heap::destroy. The first
10361         pass tears down all unprotected objects. The second pass ASSERTs that all
10362         previously protected objects are now unprotected, and then tears down
10363         all perviously protected objects. These two passes simulate the two passes
10364         that would have been required to free a protected object during normal GC.
10365         
10366         * API/JSContextRef.cpp: Removed some ASSERTs that have moved into Heap.
10367
10368         * runtime/Collector.cpp:
10369         (JSC::Heap::destroy): Moved ASSERTs to here.
10370         (JSC::Heap::freeBlock): Tidied up the use of didShrink by moving its
10371         setter to the function that does the shrinking.
10372         (JSC::Heap::freeBlocks): Implemented above algorithm.
10373         (JSC::Heap::shrinkBlocks): Tidied up the use of didShrink.
10374
10375 2010-01-19  Gavin Barraclough  <barraclough@apple.com>
10376
10377         Reviewed by NOBODY (build fix).
10378
10379         Reverting r53455, breaks 2 javascriptcore tests.
10380
10381         * API/JSContextRef.cpp:
10382         * runtime/Collector.cpp:
10383         (JSC::Heap::destroy):
10384         (JSC::Heap::freeBlock):
10385         (JSC::Heap::freeBlocks):
10386         (JSC::Heap::shrinkBlocks):
10387
10388 2010-01-18  Gavin Barraclough  <barraclough@apple.com>
10389
10390         Reviewed by NOBODY (build fix).
10391
10392         Revert r53454, since it causes much sadness in this world.
10393
10394         * runtime/UString.cpp:
10395         (JSC::UString::spliceSubstringsWithSeparators):
10396         (JSC::UString::replaceRange):
10397         * runtime/UStringImpl.cpp:
10398         (JSC::UStringImpl::baseSharedBuffer):
10399         (JSC::UStringImpl::sharedBuffer):
10400         (JSC::UStringImpl::~UStringImpl):
10401         * runtime/UStringImpl.h:
10402         (JSC::UntypedPtrAndBitfield::UntypedPtrAndBitfield):
10403         (JSC::UntypedPtrAndBitfield::asPtr):
10404         (JSC::UntypedPtrAndBitfield::operator&=):
10405         (JSC::UntypedPtrAndBitfield::operator|=):
10406         (JSC::UntypedPtrAndBitfield::operator&):
10407         (JSC::UStringImpl::create):
10408         (JSC::UStringImpl::cost):
10409         (JSC::UStringImpl::isIdentifier):
10410         (JSC::UStringImpl::setIsIdentifier):
10411         (JSC::UStringImpl::ref):
10412         (JSC::UStringImpl::deref):
10413         (JSC::UStringImpl::checkConsistency):
10414         (JSC::UStringImpl::UStringImpl):
10415         (JSC::UStringImpl::bufferOwnerString):
10416         (JSC::UStringImpl::bufferOwnership):
10417         (JSC::UStringImpl::isStatic):
10418         * wtf/StringHashFunctions.h:
10419         (WTF::stringHash):
10420
10421 2010-01-18  Geoffrey Garen  <ggaren@apple.com>
10422
10423         Reviewed by Oliver Hunt.
10424
10425         REGRESSION (52082): Crash on worker thread when reloading http://radnan.public.iastate.edu/procedural/
10426         https://bugs.webkit.org/show_bug.cgi?id=33826
10427
10428         This bug was caused by a GC-protected object being destroyed early by
10429         Heap::destroy. Clients of the GC protect APIs (reasonably) expect pointers
10430         to GC-protected memory to be valid.
10431
10432         The solution is to do two passes of tear-down in Heap::destroy. The first
10433         pass tears down all unprotected objects. The second pass ASSERTs that all
10434         previously protected objects are now unprotected, and then tears down
10435         all perviously protected objects. These two passes simulate the two passes
10436         that would have been required to free a protected object during normal GC.
10437         
10438         * API/JSContextRef.cpp: Removed some ASSERTs that have moved into Heap.
10439
10440         * runtime/Collector.cpp:
10441         (JSC::Heap::destroy): Moved ASSERTs to here.
10442         (JSC::Heap::freeBlock): Tidied up the use of didShrink by moving its
10443         setter to the function that does the shrinking.
10444         (JSC::Heap::freeBlocks): Implemented above algorithm.
10445         (JSC::Heap::shrinkBlocks): Tidied up the use of didShrink.
10446
10447 2010-01-18  Gavin Barraclough  <barraclough@apple.com>
10448
10449         Reviewed by Oliver Hunt.
10450
10451         https://bugs.webkit.org/show_bug.cgi?id=33731
10452         Remove UntypedPtrAndBitfield from UStringImpl (akin to PtrAndFlags).
10453
10454         This break the OS X Leaks tool.  Instead, free up some more bits from the refCount.
10455
10456         * runtime/UStringImpl.cpp:
10457         (JSC::UStringImpl::sharedBuffer):
10458         (JSC::UStringImpl::~UStringImpl):
10459         * runtime/UStringImpl.h:
10460         (JSC::UStringImpl::cost):
10461         (JSC::UStringImpl::checkConsistency):
10462         (JSC::UStringImpl::UStringImpl):
10463         (JSC::UStringImpl::bufferOwnerString):
10464         (JSC::UStringImpl::):
10465         * wtf/StringHashFunctions.h:
10466         (WTF::stringHash):
10467
10468 2010-01-18  Kent Tamura  <tkent@chromium.org>
10469
10470         Reviewed by Darin Adler.
10471
10472         HTMLInputElement::valueAsDate setter support for type=month.
10473         https://bugs.webkit.org/show_bug.cgi?id=33021
10474
10475         Expose the following functions to be used by WebCore:
10476          - WTF::msToyear()
10477          - WTF::dayInYear()
10478          - WTF::monthFromDayInYear()
10479          - WTF::dayInMonthFromDayInYear()
10480
10481         * JavaScriptCore.exp:
10482         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
10483         * wtf/DateMath.cpp:
10484         (WTF::msToYear): Remove "static inline".
10485         (WTF::dayInYear): Remove "static inline".
10486         (WTF::monthFromDayInYear): Remove "static inline".
10487         (WTF::dayInMonthFromDayInYear): Remove "static inline".
10488         * wtf/DateMath.h: Declare the above functions.
10489
10490 2010-01-18  Darin Adler  <darin@apple.com>
10491
10492         Fix build by reverting the previous change.
10493
10494         * runtime/UString.h: Rolled out the FastAllocBase base class.
10495         It was making UString larger, and therefore JSString larger,
10496         and too big for a garbage collection cell.
10497
10498         This raises the unpleasant possibility that many classes became
10499         larger because we added the FastAllocBase base class. I am
10500         worried about this, and it needs to be investigated.
10501
10502 2010-01-18  Zoltan Horvath  <zoltan@webkit.org>
10503
10504         Reviewed by Darin Adler.
10505
10506         Allow custom memory allocation control for UString class
10507         https://bugs.webkit.org/show_bug.cgi?id=27831
10508
10509         Inherits the following class from FastAllocBase because it is
10510         instantiated by 'new' and no need to be copyable:
10511
10512         class name     - instantiated at:
10513         classs UString - JavaScriptCore/runtime/UString.cpp:160
10514
10515         * runtime/UString.h:
10516
10517 2010-01-18  Evan Cheng  <evan.cheng@apple.com>
10518
10519         Reviewed by Darin Adler.
10520
10521         Add some ALWAYS_INLINE for key functions not inlined by some versions of GCC.
10522         rdar://problem/7553780
10523
10524         * runtime/JSObject.h:
10525         (JSC::JSObject::getPropertySlot): ALWAYS_INLINE both overloads.
10526         * runtime/JSString.h:
10527         (JSC::JSString::JSString): ALWAYS_INLINE the version that takes a UString.
10528         * runtime/UString.h:
10529         (JSC::operator==): ALWAYS_INLINE the version that compares two UString objects.
10530
10531 2010-01-18  Csaba Osztrogonác  <ossy@webkit.org>
10532
10533         Reviewed by Darin Adler.
10534
10535         Delete dftables-xxxxxxxx.in files automatically.
10536         https://bugs.webkit.org/show_bug.cgi?id=33796
10537
10538         * pcre/dftables: unlink unnecessary temporary file.
10539
10540 2010-01-18  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
10541
10542         Reviewed by Simon Hausmann.
10543
10544         [Qt] Force qmake to generate a single makefile for DerivedSources.pro
10545
10546         * DerivedSources.pro:
10547
10548 2010-01-18  Csaba Osztrogonác  <ossy@webkit.org>
10549
10550         Rubber-stamped by Gustavo Noronha Silva.
10551
10552         Rolling out r53391 and r53392 because of random crashes on buildbots.
10553         https://bugs.webkit.org/show_bug.cgi?id=33731
10554
10555         * bytecode/CodeBlock.h:
10556         (JSC::CallLinkInfo::seenOnce):
10557         (JSC::CallLinkInfo::setSeen):
10558         (JSC::MethodCallLinkInfo::MethodCallLinkInfo):
10559         (JSC::MethodCallLinkInfo::seenOnce):
10560         (JSC::MethodCallLinkInfo::setSeen):
10561         * jit/JIT.cpp:
10562         (JSC::JIT::unlinkCall):
10563         * jit/JITPropertyAccess.cpp:
10564         (JSC::JIT::patchMethodCallProto):
10565         * runtime/UString.cpp:
10566         (JSC::UString::spliceSubstringsWithSeparators):
10567         (JSC::UString::replaceRange):
10568         * runtime/UString.h:
10569         * runtime/UStringImpl.cpp:
10570         (JSC::UStringImpl::baseSharedBuffer):
10571         (JSC::UStringImpl::sharedBuffer):
10572         (JSC::UStringImpl::~UStringImpl):
10573         * runtime/UStringImpl.h:
10574         (JSC::UntypedPtrAndBitfield::UntypedPtrAndBitfield):
10575         (JSC::UntypedPtrAndBitfield::asPtr):
10576         (JSC::UntypedPtrAndBitfield::operator&=):
10577         (JSC::UntypedPtrAndBitfield::operator|=):
10578         (JSC::UntypedPtrAndBitfield::operator&):
10579         (JSC::UStringImpl::create):
10580         (JSC::UStringImpl::cost):
10581         (JSC::UStringImpl::isIdentifier):
10582         (JSC::UStringImpl::setIsIdentifier):
10583         (JSC::UStringImpl::ref):
10584         (JSC::UStringImpl::deref):
10585         (JSC::UStringImpl::checkConsistency):
10586         (JSC::UStringImpl::UStringImpl):
10587         (JSC::UStringImpl::bufferOwnerString):
10588         (JSC::UStringImpl::bufferOwnership):
10589         (JSC::UStringImpl::isStatic):
10590         * wtf/StringHashFunctions.h:
10591         (WTF::stringHash):
10592
10593 2010-01-18  Simon Hausmann  <simon.hausmann@nokia.com>
10594
10595         Reviewed by Kenneth Rohde Christiansen.
10596
10597         Fix the build with strict gcc and RVCT versions: It's not legal to cast a
10598         pointer to a function to a void* without an intermediate cast to a non-pointer
10599         type. A cast to a ptrdiff_t inbetween fixes it.
10600
10601         * runtime/JSString.h:
10602         (JSC::Fiber::JSString):
10603
10604 2010-01-15  Gavin Barraclough  <barraclough@apple.com>
10605
10606         Reviewed by Oliver Hunt.
10607
10608         https://bugs.webkit.org/show_bug.cgi?id=33731
10609         Remove UntypedPtrAndBitfield from UStringImpl (akin to PtrAndFlags).
10610
10611         This break the OS X Leaks tool.  Instead, free up some more bits from the refCount.
10612
10613         * runtime/UStringImpl.cpp:
10614         (JSC::UStringImpl::sharedBuffer):
10615         (JSC::UStringImpl::~UStringImpl):
10616         * runtime/UStringImpl.h:
10617         (JSC::UStringImpl::cost):
10618         (JSC::UStringImpl::checkConsistency):
10619         (JSC::UStringImpl::UStringImpl):
10620         (JSC::UStringImpl::bufferOwnerString):
10621         (JSC::UStringImpl::):
10622         * wtf/StringHashFunctions.h:
10623         (WTF::stringHash):
10624
10625 2010-01-15  Gavin Barraclough  <barraclough@apple.com>
10626
10627         Reviewed by Oliver Hunt.
10628
10629         https://bugs.webkit.org/show_bug.cgi?id=33731
10630         Remove uses of PtrAndFlags from JIT data stuctures.
10631
10632         These break the OS X Leaks tool.  Free up a bit in CallLinkInfo, and invalid
10633         permutation of pointer states in MethodCallLinkInfo to represent the removed bits.
10634
10635         * bytecode/CodeBlock.h:
10636         (JSC::CallLinkInfo::seenOnce):
10637         (JSC::CallLinkInfo::setSeen):
10638         (JSC::MethodCallLinkInfo::MethodCallLinkInfo):
10639         (JSC::MethodCallLinkInfo::seenOnce):
10640         (JSC::MethodCallLinkInfo::setSeen):
10641         * jit/JIT.cpp:
10642         (JSC::JIT::unlinkCall):
10643         * jit/JITPropertyAccess.cpp:
10644         (JSC::JIT::patchMethodCallProto):
10645         * runtime/UString.h:
10646
10647 2010-01-16  Maciej Stachowiak  <mjs@apple.com>
10648
10649         Reviewed by Oliver Hunt.
10650
10651         Cache JS string values made from DOM strings (Dromaeo speedup)
10652         https://bugs.webkit.org/show_bug.cgi?id=33768
10653         <rdar://problem/7353576>
10654
10655         * runtime/JSString.h:
10656         (JSC::jsStringWithFinalizer): Added new mechanism for a string to have an optional
10657         finalizer callback, for the benefit of weak-referencing caches.
10658         (JSC::):
10659         (JSC::Fiber::JSString):
10660         (JSC::Fiber::~JSString):
10661         * runtime/JSString.cpp:
10662         (JSC::JSString::resolveRope): Clear fibers so this doesn't look like a string with a finalizer.
10663         * runtime/WeakGCMap.h: Include "Collector.h" to make this header includable by itself.
10664
10665 2010-01-15  Sam Weinig  <sam@webkit.org>
10666
10667         Reviewed by Maciej Stachowiak.
10668
10669         Fix for <rdar://problem/7548432>
10670         Add ALWAYS_INLINE to jsLess for a 1% speedup on llvm-gcc.
10671
10672         * runtime/Operations.h:
10673         (JSC::jsLess):
10674
10675 2010-01-14  Geoffrey Garen  <ggaren@apple.com>
10676
10677         Reviewed by Oliver Hunt.
10678
10679         REGRESISON: Google maps buttons not working properly
10680         https://bugs.webkit.org/show_bug.cgi?id=31871
10681
10682         REGRESSION(r52948): JavaScript exceptions thrown on Google Maps when
10683         getting directions for a second time
10684         https://bugs.webkit.org/show_bug.cgi?id=33446
10685         
10686         SunSpider and v8 report no change.
10687
10688         * interpreter/Interpreter.cpp:
10689         (JSC::Interpreter::tryCacheGetByID): Update our cached offset in case
10690         flattening the dictionary changed any of its offsets.
10691
10692         * jit/JITStubs.cpp:
10693         (JSC::JITThunks::tryCacheGetByID):
10694         (JSC::DEFINE_STUB_FUNCTION):
10695         * runtime/Operations.h:
10696         (JSC::normalizePrototypeChain): ditto
10697
10698 2010-01-14  Gavin Barraclough  <barraclough@apple.com>
10699
10700         Reviewed by Oliver Hunt.
10701
10702         https://bugs.webkit.org/show_bug.cgi?id=33705
10703         UStringImpl::create() should use internal storage
10704
10705         When creating a UStringImpl copying of a UChar*, we can use an internal buffer,
10706         by calling UStringImpl::tryCreateUninitialized().
10707
10708         Also, remove duplicate of copyChars from JSString, call UStringImpl's version.
10709
10710         Small (max 0.5%) progression on Sunspidey.
10711
10712         * runtime/JSString.cpp:
10713         (JSC::JSString::resolveRope):
10714         * runtime/UStringImpl.h:
10715         (JSC::UStringImpl::create):
10716
10717 2010-01-14  Gavin Barraclough  <barraclough@apple.com>
10718
10719         Reviewed by Sam Weinig.
10720
10721         Make naming & behaviour of UString[Impl] methods more consistent.
10722         https://bugs.webkit.org/show_bug.cgi?id=33702
10723
10724         UString::create() creates a copy of the UChar* passed, but UStringImpl::create() assumes
10725         that it should assume ownership of the provided buffer (with UString::createNonCopying()
10726         and UStringImpl::createCopying() providing the alternate behaviours).  Unify on create()
10727         taking a copy of the provided buffer.  For non-copying cases, use the name 'adopt', and
10728         make this method take a Vector<UChar>&.  For cases where non-copying construction was being
10729         used, other than from a Vector<UChar>, change the code to allocate the storage along with
10730         the UStringImpl using UStringImpl::createUninitialized().  (The adopt() method also more
10731         closely matches that of WebCore::StringImpl).
10732
10733         Also, UString::createUninitialized() and UStringImpl::createUninitialized() have incompatible
10734         behaviours, in that the UString form sets the provided UChar* to a null or non-null value to
10735         indicate success or failure, but UStringImpl uses the returned PassRefPtr<UStringImpl> to
10736         indicate when allocation has failed (potentially leaving the output Char* uninitialized).
10737         This is also incompatible with WebCore::StringImpl's behaviour, in that
10738         StringImpl::createUninitialized() will CRASH() if unable to allocate.  Some uses of
10739         createUninitialized() in JSC are unsafe, since they do not test the result for null.
10740         UStringImpl's indication is preferable, since we may want a successful call to set the result
10741         buffer to 0 (specifically, StringImpl returns 0 for the buffer where createUninitialized()
10742         returns the empty string, which seems reasonable to catch bugs early).  UString's method
10743         cannot support UStringImpl's behaviour directly, since it returns an object rather than a
10744         pointer.
10745             - remove UString::createUninitialized(), replace with calls to UStringImpl::createUninitialized()
10746             - create a UStringImpl::tryCreateUninitialized() form UStringImpl::createUninitialized(),
10747               with current behaviour, make createUninitialized() crash on failure to allocate.
10748             - make cases in JSC that do not check the result call createUninitialized(), and cases that do
10749               check call tryCreateUninitialized().
10750
10751         Rename computedHash() to existingHash(), to bring this in line wih WebCore::StringImpl.
10752
10753         * API/JSClassRef.cpp:
10754         (OpaqueJSClassContextData::OpaqueJSClassContextData):
10755         * JavaScriptCore.exp:
10756         * runtime/ArrayPrototype.cpp:
10757         (JSC::arrayProtoFuncToString):
10758         * runtime/Identifier.cpp:
10759         (JSC::CStringTranslator::translate):
10760         (JSC::UCharBufferTranslator::translate):
10761         * runtime/JSString.cpp:
10762         (JSC::JSString::resolveRope):
10763         * runtime/Lookup.cpp:
10764         (JSC::HashTable::createTable):
10765         * runtime/Lookup.h:
10766         (JSC::HashTable::entry):
10767         * runtime/StringBuilder.h:
10768         (JSC::StringBuilder::release):
10769         * runtime/StringConstructor.cpp:
10770         (JSC::stringFromCharCodeSlowCase):
10771         * runtime/StringPrototype.cpp:
10772         (JSC::substituteBackreferencesSlow):
10773         (JSC::stringProtoFuncToLowerCase):
10774         (JSC::stringProtoFuncToUpperCase):
10775         (JSC::stringProtoFuncFontsize):
10776         (JSC::stringProtoFuncLink):
10777         * runtime/Structure.cpp:
10778         (JSC::Structure::despecifyDictionaryFunction):
10779         (JSC::Structure::get):
10780         (JSC::Structure::despecifyFunction):
10781         (JSC::Structure::put):
10782         (JSC::Structure::remove):
10783         (JSC::Structure::insertIntoPropertyMapHashTable):
10784         (JSC::Structure::checkConsistency):
10785         * runtime/Structure.h:
10786         (JSC::Structure::get):
10787         * runtime/StructureTransitionTable.h:
10788         (JSC::StructureTransitionTableHash::hash):
10789         * runtime/UString.cpp:
10790         (JSC::createRep):
10791         (JSC::UString::UString):
10792         (JSC::UString::spliceSubstringsWithSeparators):
10793         (JSC::UString::replaceRange):
10794         (JSC::UString::operator=):
10795         * runtime/UString.h:
10796         (JSC::UString::adopt):
10797         (JSC::IdentifierRepHash::hash):
10798         (JSC::makeString):
10799         * runtime/UStringImpl.h:
10800         (JSC::UStringImpl::adopt):
10801         (JSC::UStringImpl::create):
10802         (JSC::UStringImpl::createUninitialized):
10803         (JSC::UStringImpl::tryCreateUninitialized):
10804         (JSC::UStringImpl::existingHash):
10805
10806 2010-01-13  Kent Hansen  <kent.hansen@nokia.com>
10807
10808         Reviewed by Oliver Hunt.
10809
10810         JSON.stringify and JSON.parse needlessly process properties in the prototype chain
10811         https://bugs.webkit.org/show_bug.cgi?id=33053
10812
10813         * runtime/JSONObject.cpp:
10814         (JSC::Stringifier::Holder::appendNextProperty):
10815         (JSC::Walker::walk):
10816
10817 2010-01-13  Gavin Barraclough  <barraclough@apple.com>
10818
10819         Reviewed by NOBODY (buildfix).
10820
10821         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
10822
10823 2010-01-13  Alexey Proskuryakov  <ap@apple.com>
10824
10825         Reviewed by Darin Adler.
10826
10827         https://bugs.webkit.org/show_bug.cgi?id=33641
10828         Assertion failure in Lexer.cpp if input stream ends while in string escape
10829
10830         Test: fast/js/end-in-string-escape.html
10831
10832         * parser/Lexer.cpp: (JSC::Lexer::lex): Bail out quickly on end of stream, not giving the
10833         assertion a chance to fire.
10834
10835 2010-01-13  Gavin Barraclough  <barraclough@apple.com>
10836
10837         Reviewed by NOBODY (buildfix).
10838
10839         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
10840
10841 2010-01-13  Gavin Barraclough  <barraclough@apple.com>
10842
10843         Rubber stamped by Sam Weinig & Darin Adler.
10844
10845         Three quick fixes to UStringImpl.
10846             - The destroy() method can be switched back to a normal destructor; since we've switched
10847               the way we protect static strings to be using an odd ref-count the destroy() won't abort.
10848             - The cost() calculation logic was wrong.  If you have multiple JSStrings wrapping substrings
10849               of a base string, they would each report the full cost of the base string to the heap.
10850               Instead we should only be reporting once for the base string.
10851             - Remove the overloaded new operator calling fastMalloc, replace this with a 'using' to pick
10852               up the implementation from the parent class.
10853
10854         * JavaScriptCore.exp:
10855         * runtime/UStringImpl.cpp:
10856         (JSC::UStringImpl::~UStringImpl):
10857         * runtime/UStringImpl.h:
10858         (JSC::UStringImpl::cost):
10859         (JSC::UStringImpl::deref):
10860
10861 2010-01-13  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
10862
10863         Reviewed by Simon Hausmann.
10864
10865         [Qt] Split the build process in two different .pro files.
10866         This allows qmake to be run once all source files are available.
10867
10868         * DerivedSources.pro: Added.
10869         * JavaScriptCore.pri: Moved source generation to DerivedSources.pro
10870         * pcre/pcre.pri: Moved source generation to DerivedSources.pro
10871
10872 2010-01-12  Kent Hansen  <kent.hansen@nokia.com>
10873
10874         Reviewed by Geoffrey Garen.
10875
10876         [ES5] Implement Object.getOwnPropertyNames
10877         https://bugs.webkit.org/show_bug.cgi?id=32242
10878
10879         Add an extra argument to getPropertyNames() and getOwnPropertyNames()
10880         (and all reimplementations thereof) that indicates whether non-enumerable
10881         properties should be added.
10882
10883         * API/JSCallbackObject.h:
10884         * API/JSCallbackObjectFunctions.h:
10885         (JSC::::getOwnPropertyNames):
10886         * JavaScriptCore.exp:
10887         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
10888         * debugger/DebuggerActivation.cpp:
10889         (JSC::DebuggerActivation::getOwnPropertyNames):
10890         * debugger/DebuggerActivation.h:
10891         * runtime/Arguments.cpp:
10892         (JSC::Arguments::getOwnPropertyNames):
10893         * runtime/Arguments.h:
10894         * runtime/CommonIdentifiers.h:
10895         * runtime/JSArray.cpp:
10896         (JSC::JSArray::getOwnPropertyNames):
10897         * runtime/JSArray.h:
10898         * runtime/JSByteArray.cpp:
10899         (JSC::JSByteArray::getOwnPropertyNames):
10900         * runtime/JSByteArray.h:
10901         * runtime/JSFunction.cpp:
10902         (JSC::JSFunction::getOwnPropertyNames):
10903         * runtime/JSFunction.h:
10904         * runtime/JSNotAnObject.cpp:
10905         (JSC::JSNotAnObject::getOwnPropertyNames):
10906         * runtime/JSNotAnObject.h:
10907         * runtime/JSObject.cpp:
10908         (JSC::getClassPropertyNames):
10909         (JSC::JSObject::getPropertyNames):
10910         (JSC::JSObject::getOwnPropertyNames):
10911         * runtime/JSObject.h:
10912         * runtime/JSVariableObject.cpp:
10913         (JSC::JSVariableObject::getOwnPropertyNames):
10914         * runtime/JSVariableObject.h:
10915         * runtime/ObjectConstructor.cpp:
10916         (JSC::ObjectConstructor::ObjectConstructor):
10917         (JSC::objectConstructorGetOwnPropertyNames):
10918         * runtime/RegExpMatchesArray.h:
10919         (JSC::RegExpMatchesArray::getOwnPropertyNames):
10920         * runtime/StringObject.cpp:
10921         (JSC::StringObject::getOwnPropertyNames):
10922         * runtime/StringObject.h:
10923         * runtime/Structure.cpp: Rename getEnumerablePropertyNames() to getPropertyNames(), which takes an extra argument.
10924         (JSC::Structure::getPropertyNames):
10925         * runtime/Structure.h:
10926         (JSC::):
10927
10928 2010-01-12  Alexey Proskuryakov  <ap@apple.com>
10929
10930         Reviewed by Darin Adler.
10931
10932         https://bugs.webkit.org/show_bug.cgi?id=33540
10933         Make it possible to build in debug mode with assertions disabled
10934
10935         * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION):
10936         * runtime/Identifier.cpp: (JSC::Identifier::checkSameIdentifierTable):
10937         * wtf/FastMalloc.cpp:
10938         * wtf/HashTable.h: (WTF::HashTableConstIterator::checkValidity):
10939         * yarr/RegexCompiler.cpp: (JSC::Yarr::compileRegex):
10940
10941 2009-11-23  Yong Li  <yoli@rim.com>
10942
10943         Reviewed by Adam Treat.
10944
10945         Make GIF decoder support down-sampling
10946         https://bugs.webkit.org/show_bug.cgi?id=31806
10947
10948         * platform/image-decoders/ImageDecoder.cpp:
10949         (WebCore::ImageDecoder::upperBoundScaledY):
10950         (WebCore::ImageDecoder::lowerBoundScaledY):
10951         * platform/image-decoders/ImageDecoder.h:
10952         (WebCore::RGBA32Buffer::scaledRect):
10953         (WebCore::RGBA32Buffer::setScaledRect):
10954         (WebCore::ImageDecoder::scaledSize):
10955         * platform/image-decoders/gif/GIFImageDecoder.cpp:
10956         (WebCore::GIFImageDecoder::sizeNowAvailable):
10957         (WebCore::GIFImageDecoder::initFrameBuffer):
10958         (WebCore::copyOnePixel):
10959         (WebCore::GIFImageDecoder::haveDecodedRow):
10960         (WebCore::GIFImageDecoder::frameComplete):
10961
10962 2010-01-12  Adam Barth  <abarth@webkit.org>
10963
10964         Reviewed by Eric Seidel.
10965
10966         ecma/Date/15.9.5.12-1.js fails every night at midnight
10967         https://bugs.webkit.org/show_bug.cgi?id=28041
10968
10969         Change the test to use a concrete time instead of "now".
10970
10971         * tests/mozilla/ecma/Date/15.9.5.10-1.js:
10972         * tests/mozilla/ecma/Date/15.9.5.12-1.js:
10973
10974 2010-01-11  Csaba Osztrogonác  <ossy@webkit.org>
10975
10976         Reviewed by Ariya Hidayat.
10977
10978         [Qt] Enable JIT and YARR_JIT if (CPU(X86_64) && OS(LINUX) && GCC_VERSION >= 40100)
10979
10980         * wtf/Platform.h:
10981
10982 2010-01-11  Geoffrey Garen  <ggaren@apple.com>
10983
10984         Reviewed by Alexey Proskuryakov.
10985
10986         https://bugs.webkit.org/show_bug.cgi?id=33481
10987         Uninitialized data members in ArrayStorage
10988         
10989         SunSpider reports no change.
10990
10991         * runtime/JSArray.cpp:
10992         (JSC::JSArray::JSArray): Initialize missing data members in the two cases
10993         where we don't use fastZeroedMalloc, so it doesn't happen automatically.
10994
10995 2010-01-11  Steve Falkenburg  <sfalken@apple.com>
10996
10997         Reviewed by Sam Weinig.
10998
10999         https://bugs.webkit.org/show_bug.cgi?id=33480
11000         
11001         Improve debugging reliability for WTF on Windows.
11002         Store WTF static library's PDB file into a better location.
11003
11004         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
11005
11006 2010-01-11  Steve Falkenburg  <sfalken@apple.com>
11007
11008         Windows build fix.
11009         Remove extraneous entries from def file causing build warning.
11010
11011         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
11012
11013 2010-01-10  Kent Hansen  <kent.hansen@nokia.com>
11014
11015         Reviewed by Darin Adler.
11016
11017         RegExp.prototype.toString returns "//" for empty regular expressions
11018         https://bugs.webkit.org/show_bug.cgi?id=33319
11019
11020         "//" starts a single-line comment, hence "/(?:)/" should be used, according to ECMA.
11021
11022         * runtime/RegExpPrototype.cpp:
11023         (JSC::regExpProtoFuncToString):
11024
11025         * tests/mozilla/ecma_2/RegExp/properties-001.js:
11026         (AddRegExpCases):
11027         * tests/mozilla/js1_2/regexp/toString.js:
11028         Update relevant Mozilla tests (Mozilla has had this behavior since November 2003).
11029
11030 2010-01-10  Darin Adler  <darin@apple.com>
11031
11032         * tests/mozilla/ecma/Array/15.4.1.1.js: Added property allow-tabs.
11033         * tests/mozilla/ecma/Array/15.4.1.2.js: Added property allow-tabs.
11034         * tests/mozilla/ecma/Array/15.4.2.1-1.js: Added property allow-tabs.
11035         * tests/mozilla/ecma/Array/15.4.2.2-1.js: Added property allow-tabs.
11036         * tests/mozilla/ecma/Array/15.4.2.2-2.js: Added property allow-tabs.
11037         * tests/mozilla/ecma/Array/15.4.2.3.js: Added property allow-tabs.
11038         * tests/mozilla/ecma/Array/15.4.3.2.js: Added property allow-tabs.
11039         * tests/mozilla/ecma/Array/15.4.3.js: Added property allow-tabs.
11040         * tests/mozilla/ecma/Array/15.4.4.1.js: Added property allow-tabs.
11041         * tests/mozilla/ecma/Array/15.4.4.js: Added property allow-tabs.
11042         * tests/mozilla/ecma/LexicalConventions/7.7.4.js: Added property allow-tabs.
11043         * tests/mozilla/ecma/Math/15.8.2.13.js: Added property allow-tabs.
11044         * tests/mozilla/ecma/Math/15.8.2.16.js: Added property allow-tabs.
11045         * tests/mozilla/ecma/Math/15.8.2.18.js: Added property allow-tabs.
11046         * tests/mozilla/ecma/Math/15.8.2.2.js: Added property allow-tabs.
11047         * tests/mozilla/ecma/Math/15.8.2.4.js: Added property allow-tabs.
11048         * tests/mozilla/ecma/Math/15.8.2.5.js: Added property allow-tabs.
11049         * tests/mozilla/ecma/Math/15.8.2.7.js: Added property allow-tabs.
11050         * tests/mozilla/ecma/String/15.5.1.js: Added property allow-tabs.
11051         * tests/mozilla/ecma/String/15.5.2.js: Added property allow-tabs.
11052         * tests/mozilla/ecma/String/15.5.3.1-3.js: Added property allow-tabs.
11053         * tests/mozilla/ecma/String/15.5.3.1-4.js: Added property allow-tabs.
11054         * tests/mozilla/ecma/String/15.5.3.js: Added property allow-tabs.
11055         * tests/mozilla/ecma/TypeConversion/9.5-2.js: Added property allow-tabs.
11056         * tests/mozilla/ecma/jsref.js: Modified property allow-tabs.
11057         * tests/mozilla/ecma/shell.js: Modified property allow-tabs.
11058         * tests/mozilla/ecma_2/LexicalConventions/keywords-001.js: Added property allow-tabs.
11059         * tests/mozilla/ecma_2/RegExp/exec-001.js: Added property allow-tabs.
11060         * tests/mozilla/ecma_2/String/match-004.js: Added property allow-tabs.
11061         * tests/mozilla/ecma_2/String/replace-001.js: Added property allow-tabs.
11062         * tests/mozilla/ecma_2/String/split-002.js: Added property allow-tabs.
11063         * tests/mozilla/ecma_2/jsref.js: Modified property allow-tabs.
11064         * tests/mozilla/ecma_2/shell.js: Added property allow-tabs.
11065         * tests/mozilla/ecma_3/Date/shell.js: Modified property allow-tabs.
11066         * tests/mozilla/ecma_3/Exceptions/regress-181654.js: Added property allow-tabs.
11067         * tests/mozilla/ecma_3/RegExp/regress-209067.js: Added property allow-tabs.
11068         * tests/mozilla/ecma_3/RegExp/regress-85721.js: Added property allow-tabs.
11069         * tests/mozilla/importList.html: Added property allow-tabs.
11070         * tests/mozilla/js1_1/shell.js: Added property allow-tabs.
11071         * tests/mozilla/js1_2/Array/general1.js: Added property allow-tabs.
11072         * tests/mozilla/js1_2/Array/general2.js: Added property allow-tabs.
11073         * tests/mozilla/js1_2/Array/slice.js: Added property allow-tabs.
11074         * tests/mozilla/js1_2/Array/splice1.js: Added property allow-tabs.
11075         * tests/mozilla/js1_2/Array/splice2.js: Added property allow-tabs.
11076         * tests/mozilla/js1_2/Objects/toString-001.js: Added property allow-tabs.
11077         * tests/mozilla/js1_2/String/charCodeAt.js: Added property allow-tabs.
11078         * tests/mozilla/js1_2/String/concat.js: Modified property allow-tabs.
11079         * tests/mozilla/js1_2/String/match.js: Added property allow-tabs.
11080         * tests/mozilla/js1_2/String/slice.js: Added property allow-tabs.
11081         * tests/mozilla/js1_2/function/Function_object.js: Added property allow-tabs.
11082         * tests/mozilla/js1_2/function/Number.js: Modified property allow-tabs.
11083         * tests/mozilla/js1_2/function/String.js: Modified property allow-tabs.
11084         * tests/mozilla/js1_2/function/nesting.js: Added property allow-tabs.
11085         * tests/mozilla/js1_2/function/regexparg-1.js: Added property allow-tabs.
11086         * tests/mozilla/js1_2/function/regexparg-2-n.js: Added property allow-tabs.
11087         * tests/mozilla/js1_2/jsref.js: Added property allow-tabs.
11088         * tests/mozilla/js1_2/operator/equality.js: Added property allow-tabs.
11089         * tests/mozilla/js1_2/operator/strictEquality.js: Added property allow-tabs.
11090         * tests/mozilla/js1_2/regexp/RegExp_dollar_number.js: Added property allow-tabs.
11091         * tests/mozilla/js1_2/regexp/RegExp_input.js: Added property allow-tabs.
11092         * tests/mozilla/js1_2/regexp/RegExp_input_as_array.js: Added property allow-tabs.
11093         * tests/mozilla/js1_2/regexp/RegExp_lastIndex.js: Added property allow-tabs.
11094         * tests/mozilla/js1_2/regexp/RegExp_lastMatch.js: Added property allow-tabs.
11095         * tests/mozilla/js1_2/regexp/RegExp_lastMatch_as_array.js: Added property allow-tabs.
11096         * tests/mozilla/js1_2/regexp/RegExp_lastParen.js: Added property allow-tabs.
11097         * tests/mozilla/js1_2/regexp/RegExp_lastParen_as_array.js: Added property allow-tabs.
11098         * tests/mozilla/js1_2/regexp/RegExp_leftContext.js: Added property allow-tabs.
11099         * tests/mozilla/js1_2/regexp/RegExp_leftContext_as_array.js: Added property allow-tabs.
11100         * tests/mozilla/js1_2/regexp/RegExp_multiline.js: Added property allow-tabs.
11101         * tests/mozilla/js1_2/regexp/RegExp_multiline_as_array.js: Added property allow-tabs.
11102         * tests/mozilla/js1_2/regexp/RegExp_object.js: Added property allow-tabs.
11103         * tests/mozilla/js1_2/regexp/RegExp_rightContext.js: Added property allow-tabs.
11104         * tests/mozilla/js1_2/regexp/RegExp_rightContext_as_array.js: Added property allow-tabs.
11105         * tests/mozilla/js1_2/regexp/alphanumeric.js: Added property allow-tabs.
11106         * tests/mozilla/js1_2/regexp/asterisk.js: Added property allow-tabs.
11107         * tests/mozilla/js1_2/regexp/backslash.js: Added property allow-tabs.
11108         * tests/mozilla/js1_2/regexp/backspace.js: Added property allow-tabs.
11109         * tests/mozilla/js1_2/regexp/beginLine.js: Added property allow-tabs.
11110         * tests/mozilla/js1_2/regexp/character_class.js: Added property allow-tabs.
11111         * tests/mozilla/js1_2/regexp/compile.js: Added property allow-tabs.
11112         * tests/mozilla/js1_2/regexp/control_characters.js: Added property allow-tabs.
11113         * tests/mozilla/js1_2/regexp/digit.js: Added property allow-tabs.
11114         * tests/mozilla/js1_2/regexp/dot.js: Added property allow-tabs.
11115         * tests/mozilla/js1_2/regexp/endLine.js: Added property allow-tabs.
11116         * tests/mozilla/js1_2/regexp/everything.js: Added property allow-tabs.
11117         * tests/mozilla/js1_2/regexp/exec.js: Added property allow-tabs.
11118         * tests/mozilla/js1_2/regexp/flags.js: Added property allow-tabs.
11119         * tests/mozilla/js1_2/regexp/global.js: Added property allow-tabs.
11120         * tests/mozilla/js1_2/regexp/hexadecimal.js: Added property allow-tabs.
11121         * tests/mozilla/js1_2/regexp/ignoreCase.js: Added property allow-tabs.
11122         * tests/mozilla/js1_2/regexp/interval.js: Added property allow-tabs.
11123         * tests/mozilla/js1_2/regexp/octal.js: Added property allow-tabs.
11124         * tests/mozilla/js1_2/regexp/parentheses.js: Added property allow-tabs.
11125         * tests/mozilla/js1_2/regexp/plus.js: Added property allow-tabs.
11126         * tests/mozilla/js1_2/regexp/question_mark.js: Added property allow-tabs.
11127         * tests/mozilla/js1_2/regexp/simple_form.js: Added property allow-tabs.
11128         * tests/mozilla/js1_2/regexp/source.js: Added property allow-tabs.
11129         * tests/mozilla/js1_2/regexp/special_characters.js: Added property allow-tabs.
11130         * tests/mozilla/js1_2/regexp/string_replace.js: Added property allow-tabs.
11131         * tests/mozilla/js1_2/regexp/string_search.js: Added property allow-tabs.
11132         * tests/mozilla/js1_2/regexp/string_split.js: Added property allow-tabs.
11133         * tests/mozilla/js1_2/regexp/test.js: Added property allow-tabs.
11134         * tests/mozilla/js1_2/regexp/toString.js: Added property allow-tabs.
11135         * tests/mozilla/js1_2/regexp/vertical_bar.js: Added property allow-tabs.
11136         * tests/mozilla/js1_2/regexp/whitespace.js: Added property allow-tabs.
11137         * tests/mozilla/js1_2/regexp/word_boundary.js: Added property allow-tabs.
11138         * tests/mozilla/js1_2/shell.js: Added property allow-tabs.
11139         * tests/mozilla/js1_2/statements/break.js: Added property allow-tabs.
11140         * tests/mozilla/js1_2/statements/continue.js: Added property allow-tabs.
11141         * tests/mozilla/js1_2/statements/do_while.js: Added property allow-tabs.
11142         * tests/mozilla/js1_2/statements/switch.js: Added property allow-tabs.
11143         * tests/mozilla/js1_2/statements/switch2.js: Added property allow-tabs.
11144         * tests/mozilla/js1_3/shell.js: Added property allow-tabs.
11145         * tests/mozilla/js1_4/shell.js: Added property allow-tabs.
11146         * tests/mozilla/js1_5/Regress/regress-111557.js: Added property allow-tabs.
11147         * tests/mozilla/js1_5/Regress/regress-216320.js: Added property allow-tabs.
11148         * tests/mozilla/menuhead.html: Added property allow-tabs.
11149         * tests/mozilla/mklistpage.pl: Added property allow-tabs.
11150         * tests/mozilla/runtests.pl: Added property allow-tabs.
11151
11152 2010-01-08  Daniel Bates  <dbates@webkit.org>
11153
11154         Reviewed by Adam Barth.
11155
11156         https://bugs.webkit.org/show_bug.cgi?id=33417
11157
11158         Cleans up style errors exposed by the patch for bug #33198.
11159         Moreover, fixes all "Weird number of spaces at line-start. Are you using a 4-space indent?"
11160         errors reported by check-webkit-style.
11161
11162         No functionality was changed. So, no new tests.
11163
11164         * wtf/Platform.h:
11165
11166 2010-01-08  Kent Hansen  <kent.hansen@nokia.com>
11167
11168         Reviewed by Eric Seidel.
11169
11170         Don't store RegExp flags string representation
11171         https://bugs.webkit.org/show_bug.cgi?id=33321
11172
11173         It's unused; the string representation is reconstructed from flags.
11174
11175         * runtime/RegExp.cpp:
11176         (JSC::RegExp::RegExp):
11177         * runtime/RegExp.h:
11178
11179 2010-01-08  Geoffrey Garen  <ggaren@apple.com>
11180
11181         Reviewed by Oliver Hunt.
11182
11183         Memory use grows grows possibly unbounded in this JavaScript Array test case
11184         https://bugs.webkit.org/show_bug.cgi?id=31675
11185
11186         This fixes one observed bug in this test case, which is that
11187         arrays don't report extra cost for the sparse value maps.
11188
11189         SunSpider reports a small speedup.
11190
11191         * runtime/JSArray.cpp:
11192         (JSC::JSArray::putSlowCase): Report extra memory cost for
11193         the sparse value map.
11194         * runtime/JSArray.h: 
11195
11196 2010-01-08  Yong Li  <yoli@rim.com>
11197
11198         Reviewed by Darin Adler.
11199
11200         Remove unnecessary #include from FastMalloc.cpp
11201         https://bugs.webkit.org/show_bug.cgi?id=33393
11202
11203         * wtf/FastMalloc.cpp:
11204
11205 2010-01-08  Eric Seidel  <eric@webkit.org>
11206
11207         No review, rolling out r52983.
11208         http://trac.webkit.org/changeset/52983
11209         https://bugs.webkit.org/show_bug.cgi?id=33321
11210
11211         Broke 59 JavaScriptCore tests.  I don't think Kent knew about
11212         run-javascriptcore-tests.  Sadly neither does the commit-bot,
11213         yet.
11214
11215         * runtime/RegExp.cpp:
11216         (JSC::RegExp::RegExp):
11217         * runtime/RegExp.h:
11218         (JSC::RegExp::flags):
11219
11220 2010-01-08  Eric Seidel  <eric@webkit.org>
11221
11222         No review, rolling out r52981.
11223         http://trac.webkit.org/changeset/52981
11224         https://bugs.webkit.org/show_bug.cgi?id=33319
11225
11226         Caused two JS tests to start failing:
11227         ecma_2/RegExp/properties-001.js and js1_2/regexp/toString.js
11228
11229         * runtime/RegExpPrototype.cpp:
11230         (JSC::regExpProtoFuncToString):
11231
11232 2010-01-08  Kent Hansen  <kent.hansen@nokia.com>
11233
11234         Reviewed by Darin Adler.
11235
11236         Don't store RegExp flags string representation
11237         https://bugs.webkit.org/show_bug.cgi?id=33321
11238
11239         It's unused; the string representation is reconstructed from flags.
11240
11241         * runtime/RegExp.cpp:
11242         (JSC::RegExp::RegExp):
11243         * runtime/RegExp.h:
11244
11245 2010-01-08  Kent Hansen  <kent.hansen@nokia.com>
11246
11247         Reviewed by Darin Adler.
11248
11249         RegExp.prototype.toString returns "//" for empty regular expressions
11250         https://bugs.webkit.org/show_bug.cgi?id=33319
11251
11252         "//" starts a single-line comment, hence "/(?:)/" should be used, according to ECMA.
11253
11254         * runtime/RegExpPrototype.cpp:
11255         (JSC::regExpProtoFuncToString):
11256
11257 2010-01-08  Norbert Leser  <norbert.leser@nokia.com>
11258
11259         Reviewed by Darin Adler.
11260
11261         RVCT compiler with "-Otime -O3" optimization tries to optimize out 
11262         inline new'ed pointers that are passed as arguments.
11263         Proposed patch assigns new'ed pointer explicitly outside function call.
11264
11265         https://bugs.webkit.org/show_bug.cgi?id=33084
11266
11267         * API/JSClassRef.cpp:
11268         (OpaqueJSClass::OpaqueJSClass):
11269         (OpaqueJSClassContextData::OpaqueJSClassContextData):
11270
11271 2010-01-08  Gabor Loki  <loki@webkit.org>
11272
11273         Reviewed by Gavin Barraclough.
11274
11275         Remove an unnecessary cacheFlush from ARM_TRADITIONAL JIT
11276         https://bugs.webkit.org/show_bug.cgi?id=33203
11277
11278         * assembler/ARMAssembler.cpp: Remove obsolete linkBranch function.
11279         (JSC::ARMAssembler::executableCopy): Inline a clean linkBranch code.
11280         * assembler/ARMAssembler.h:
11281         (JSC::ARMAssembler::getLdrImmAddress): Use inline function.
11282         (JSC::ARMAssembler::getLdrImmAddressOnPool): Ditto.
11283         (JSC::ARMAssembler::patchPointerInternal): Remove an unnecessary cacheFlush.
11284         (JSC::ARMAssembler::linkJump): Use patchPointerInternal instead of linkBranch.
11285         (JSC::ARMAssembler::linkCall): Ditto.
11286         (JSC::ARMAssembler::relinkCall): Ditto.
11287
11288 2010-01-07  Gabor Loki  <loki@webkit.org>
11289
11290         Reviewed by Gavin Barraclough.
11291
11292         Build fix for JSVALUE32 when ENABLE_JIT_OPTIMIZE* are disabled
11293         https://bugs.webkit.org/show_bug.cgi?id=33311
11294
11295         Move compileGetDirectOffset function to common part of JSVALUE32
11296
11297         * jit/JITPropertyAccess.cpp:
11298         (JSC::JIT::compileGetDirectOffset):
11299
11300 2010-01-07  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
11301
11302         Reviewed by Maciej Stachowiak.
11303
11304         Allow call sites to determine if ASSERT_* and LOG_* macros are operational
11305         https://bugs.webkit.org/show_bug.cgi?id=33020
11306
11307         * wtf/Assertions.h: Set ASSERT_MSG_DISABLED, FATAL_DISABLED,
11308         ERROR_DISABLED, LOG_DISABLED to 1 if the compiler does not support
11309         variadic macros. Refactor for better readibility.
11310
11311 2010-01-07  Daniel Bates  <dbates@rim.com>
11312
11313         Reviewed by Eric Seidel.
11314
11315         https://bugs.webkit.org/show_bug.cgi?id=32987
11316
11317         Added ENABLE_XHTMLMP flag. Disabled by default.
11318
11319         * Configurations/FeatureDefines.xcconfig:
11320
11321 2010-01-07  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
11322
11323         Reviewed by Gavin Barraclough.
11324
11325         [Symbian] Port ARM traditional JIT Trampolines to RVCT
11326         https://bugs.webkit.org/show_bug.cgi?id=30552
11327
11328         Take the GCC implementation and mechanically convert
11329         it to RVCT syntax.
11330
11331         Use 'bx rX' instead of 'mov pc, rX' when it is available.
11332
11333         Developed in cooperation with Iain Campbell and Gabor Loki.
11334
11335         * JavaScriptCore.pri: Extra step to generate RVCT stubs. The 
11336         script generation intentionally executed all the time not just
11337         for RVCT targets.
11338
11339         * create_rvct_stubs: Added. Perl script to expand precompiler macros
11340         for RVCT assembler - the template is defined in JITStubs.cpp.
11341
11342         * jit/JITStubs.cpp:
11343         (JSC::ctiTrampoline):
11344         (JSC::ctiVMThrowTrampoline):
11345         (JSC::ctiOpThrowNotCaught):
11346
11347 2010-01-07  Geoffrey Garen  <ggaren@apple.com>
11348
11349         Reviewed by Sam Weinig.
11350
11351         Fix a crash seen on the buildbots.
11352
11353         * runtime/JSGlobalObject.cpp:
11354         (JSC::JSGlobalObject::init): Disable specific function tracking here,
11355         instead of in WebCore, to ensure that the disabling happens before a
11356         specific function can be registered.
11357
11358 2010-01-07  Alexey Proskuryakov  <ap@apple.com>
11359
11360         Mac build fix.
11361
11362         * JavaScriptCore.exp: Export new JSGlobalData static data members.
11363
11364 2010-01-07  Alexey Proskuryakov  <ap@apple.com>
11365
11366         Reviewed by Geoffrey Garen.
11367
11368         https://bugs.webkit.org/show_bug.cgi?id=33057
11369         REGRESSION(r49365): typeof(xhr.responseText) != "string" in Windows
11370
11371         <rdar://problem/7296920> REGRESSION: WebKit fails to start PeaceKeeper benchmark
11372
11373         Test: fast/js/webcore-string-comparison.html
11374
11375         In r49365, some code was moved from JSString.cpp to JSString.h, and as a result, WebCore
11376         got a way to directly instantiate JSStrings over DLL borders. Since vftable for JSString was
11377         not exported, objects created from WebCore got a different vptr, and JavaScriptCore
11378         optimizations that relied on vptr of all JSString objects being equal failed.
11379
11380         * config.h: Added a JS_EXPORTCLASS macro for exporting classes. It's currently the same as
11381         JS_EXPORTDATA, but it clearly needed a new name.
11382
11383         * runtime/InitializeThreading.cpp:
11384         (JSC::initializeThreadingOnce):
11385         * runtime/JSGlobalData.cpp:
11386         (JSC::JSGlobalData::storeVPtrs):
11387         (JSC::JSGlobalData::JSGlobalData):
11388         (JSC::JSGlobalData::createNonDefault):
11389         (JSC::JSGlobalData::create):
11390         (JSC::JSGlobalData::sharedInstance):
11391         * runtime/JSGlobalData.h:
11392         Store vptrs just once, no need to repeatedly pick and copy them. This makes it possible to
11393         assert vptr correctness in object destructors (which don't have access to JSGlobalData,
11394         and even Heap::heap(this) will fail for fake objects created from storeVPtrs()).
11395
11396         * runtime/JSArray.cpp: (JSC::JSArray::~JSArray): Assert that vptr is what we expect it to be.
11397         It's important to assert in destructor, because MSVC changes the vptr after constructor
11398         is invoked.
11399         * runtime/JSByteArray.cpp: (JSC::JSByteArray::~JSByteArray): Ditto.
11400         * runtime/JSByteArray.h: Ditto.
11401         * runtime/JSFunction.h: Ditto.
11402         * runtime/JSFunction.cpp: (JSC::JSFunction::~JSFunction): Ditto.
11403
11404         * runtime/JSCell.h: (JSC::JSCell::setVPtr): Added a method to substitute vptr for another
11405         one.
11406
11407         * runtime/JSString.h: Export JSString class together with its vftable, and tell other
11408         libraries tp import it. This is needed on platforms that have a separate JavaScriptCore
11409         dynamic library - and on Mac, we already did the export via JavaScriptCore.exp.
11410         (JSC::JSString::~JSString): Assert tha vptr is what we expect it to be.
11411         (JSC::fixupVPtr): Store a previously saved primary vftable pointer (do nothing if building
11412         JavaScriptCore itself).
11413         (JSC::jsSingleCharacterString): Call fixupVPtr in case this is call across DLL boundary.
11414         (JSC::jsSingleCharacterSubstring): Ditto.
11415         (JSC::jsNontrivialString): Ditto.
11416         (JSC::jsString): Ditto.
11417         (JSC::jsSubstring): Ditto.
11418         (JSC::jsOwnedString): Ditto.
11419
11420         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Export the new static
11421         JSGlobalData members that are used in WebCore via inline functions.
11422
11423 2010-01-07  Geoffrey Garen  <ggaren@apple.com>
11424
11425         Reviewed by Sam Weinig.
11426
11427         Safari memory usage skyrockets using new Google AdWords interface
11428         https://bugs.webkit.org/show_bug.cgi?id=33343
11429
11430         The memory use was caused by the global object creating too many structures
11431         as it thrashed between different specific functions.
11432
11433         * runtime/Structure.cpp:
11434         (JSC::Structure::Structure):
11435         (JSC::Structure::addPropertyTransition):
11436         (JSC::Structure::changePrototypeTransition):
11437         (JSC::Structure::despecifyFunctionTransition):
11438         (JSC::Structure::addAnonymousSlotsTransition):
11439         (JSC::Structure::getterSetterTransition):
11440         (JSC::Structure::toDictionaryTransition):
11441         (JSC::Structure::addPropertyWithoutTransition):
11442         (JSC::Structure::despecifyAllFunctions):
11443         * runtime/Structure.h:
11444         (JSC::Structure::disableSpecificFunctionTracking): Track a thrash count
11445         for specific functions. Disable specific function tracking once the
11446         thrash count has been hit.
11447
11448 2010-01-07  Csaba Osztrogonác  <ossy@webkit.org>
11449
11450         Reviewed by Simon Hausmann.
11451
11452         [Qt] Enable JIT in debug mode on win32 after r51141 fixed the crashes.
11453
11454         * JavaScriptCore.pri:
11455
11456 2010-01-07  Zoltan Horvath  <zoltan@webkit.org>
11457
11458         Reviewed by Holger Freyther.
11459
11460         [Mac] Build fix when FAST_MALLOC_MATCH_VALIDATION=1
11461         https://bugs.webkit.org/show_bug.cgi?id=33312
11462
11463         Using of operator += cause compile error on Mac, so it is changed to
11464         "= static_cast<AllocAlignmentInteger*>(old_ptr) + 1".
11465
11466         * wtf/FastMalloc.cpp:
11467         (WTF::TCMallocStats::realloc):
11468
11469 2010-01-07  Zoltan Horvath  <zoltan@webkit.org>
11470
11471         Reviewed by Holger Freyther.
11472
11473         [Qt] Build fix when FAST_MALLOC_MATCH_VALIDATION=1
11474         https://bugs.webkit.org/show_bug.cgi?id=33312
11475
11476         Remove pByte (committed in r42344 from #20422), because pByte doesn't
11477         exist and it is unnecessary.
11478
11479         * wtf/FastMalloc.cpp:
11480         (WTF::TCMallocStats::realloc):
11481
11482 2010-01-06  Gavin Barraclough  <barraclough@apple.com>
11483
11484         QT build fix.
11485
11486         * runtime/Identifier.cpp:
11487         (JSC::createIdentifierTableSpecific):
11488
11489 2010-01-06  Gavin Barraclough  <barraclough@apple.com>
11490
11491         Windows build fix part I.
11492
11493         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
11494
11495 2010-01-06  Dan Bernstein  <mitz@apple.com>
11496
11497         Build fix
11498
11499         * runtime/Identifier.cpp:
11500         (JSC::createIdentifierTableSpecificCallback):
11501
11502 2010-01-05  Gavin Barraclough  <barraclough@apple.com>
11503
11504         Reviewed by Sam Weinig.
11505
11506         https://bugs.webkit.org/show_bug.cgi?id=33236
11507         Remove m_identifierTable pointer from UString
11508
11509         Currently every string holds a pointer so that during destruction,
11510         if a string has been used as an identifier, it can remove itself
11511         from the table.  By instead accessing the identifierTable via a
11512         thread specific tracking the table associated with the current
11513         globaldata, we can save the memory cost of this pointer.
11514
11515         * API/APIShims.h:
11516         (JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock):
11517         (JSC::APIEntryShimWithoutLock::~APIEntryShimWithoutLock):
11518         (JSC::APICallbackShim::APICallbackShim):
11519         (JSC::APICallbackShim::~APICallbackShim):
11520
11521             - change the API shims to track the identifierTable of the current JSGlobalData.
11522
11523         * API/JSContextRef.cpp:
11524         (JSContextGroupCreate):
11525
11526             - update creation of JSGlobalData for API usage to use new create method.
11527             - fix shim instanciation bug in JSGlobalContextCreateInGroup.
11528
11529         * JavaScriptCore.exp:
11530         * runtime/Completion.cpp:
11531         (JSC::checkSyntax):
11532         (JSC::evaluate):
11533
11534             - add asserts to check the identifierTable is being tracked correctly.
11535
11536         * runtime/Identifier.cpp:
11537         (JSC::IdentifierTable::~IdentifierTable):
11538         (JSC::IdentifierTable::add):
11539         (JSC::Identifier::remove):
11540         (JSC::Identifier::checkSameIdentifierTable):
11541         (JSC::createIdentifierTableSpecificCallback):
11542         (JSC::createIdentifierTableSpecific):
11543         (JSC::createDefaultDataSpecific):
11544
11545             - Use currentIdentifierTable() instead of UStringImpl::m_identifierTable.
11546             - Define methods to access the thread specific identifier tables.
11547
11548         * runtime/Identifier.h:
11549         (JSC::ThreadIdentifierTableData::ThreadIdentifierTableData):
11550         (JSC::defaultIdentifierTable):
11551         (JSC::setDefaultIdentifierTable):
11552         (JSC::currentIdentifierTable):
11553         (JSC::setCurrentIdentifierTable):
11554         (JSC::resetCurrentIdentifierTable):
11555
11556             - Declare methods to access the thread specific identifier tables.
11557
11558         * runtime/JSGlobalData.cpp:
11559         (JSC::JSGlobalData::createNonDefault):
11560         (JSC::JSGlobalData::create):
11561         (JSC::JSGlobalData::sharedInstance):
11562
11563             - creation of JSGlobalData objects, other than for API usage, associate themselves with the current thread.
11564
11565         * runtime/JSGlobalData.h:
11566         * runtime/UStringImpl.cpp:
11567         (JSC::UStringImpl::destroy):
11568
11569             - destroy() method should be using isIdentifier().
11570
11571         * runtime/UStringImpl.h:
11572         (JSC::UStringImpl::isIdentifier):
11573         (JSC::UStringImpl::setIsIdentifier):
11574         (JSC::UStringImpl::checkConsistency):
11575         (JSC::UStringImpl::UStringImpl):
11576
11577             - replace m_identifierTable with a single m_isIdentifier bit.
11578
11579         * wtf/StringHashFunctions.h:
11580         (WTF::stringHash):
11581
11582             - change string hash result from 32-bit to 31-bit, to free a bit in UStringImpl for m_isIdentifier.
11583
11584 2009-12-25 Patrick Gansterer <paroga@paroga.com>
11585  
11586         Reviewed by Eric Seidel.
11587
11588         Buildfix for WinCE + style fixes.
11589         https://bugs.webkit.org/show_bug.cgi?id=32939
11590
11591         * jsc.cpp:
11592         (functionPrint):
11593         (functionQuit):
11594         (parseArguments):
11595         (fillBufferWithContentsOfFile):
11596  
11597 2010-01-05  Patrick Gansterer  <paroga@paroga.com>
11598
11599         Reviewed by Eric Seidel.
11600
11601         WinCE buildfix after r52791 (renamed PLATFORM(WINCE) to OS(WINCE)).
11602         https://bugs.webkit.org/show_bug.cgi?id=33205
11603
11604         * jit/ExecutableAllocator.h:
11605
11606 2010-01-05  Patrick Gansterer  <paroga@paroga.com>
11607
11608         Reviewed by Darin Adler.
11609
11610         Added compiler error for unsupported platforms.
11611         https://bugs.webkit.org/show_bug.cgi?id=33112
11612
11613         * jit/JITStubs.cpp:
11614
11615 2010-01-05  Gabor Loki  <loki@webkit.org>
11616
11617         Reviewed by Maciej Stachowiak.
11618
11619         Follow r52729 in ARMAssembler.
11620         https://bugs.webkit.org/show_bug.cgi?id=33208
11621
11622         Use WTF_ARM_ARCH_AT_LEAST instead of ARM_ARCH_VERSION
11623
11624         * assembler/ARMAssembler.cpp:
11625         (JSC::ARMAssembler::encodeComplexImm): Move tmp declaration to ARMv7
11626         * assembler/ARMAssembler.h:
11627         (JSC::ARMAssembler::):
11628         (JSC::ARMAssembler::bkpt):
11629
11630 2010-01-05  Maciej Stachowiak  <mjs@apple.com>
11631
11632         Unreviewed build fix for Gtk+
11633
11634         Don't use // comments in Platform.h, at least some of them seem to make the version of GCC
11635         used on the Gtk buildbot unhappy.
11636
11637         * wtf/Platform.h:
11638
11639 2010-01-04  Maciej Stachowiak  <mjs@apple.com>
11640
11641         Reviewed by Darin Fisher.
11642
11643         Reorganize, document and rename OS() platform macros.
11644         https://bugs.webkit.org/show_bug.cgi?id=33198
11645
11646         * wtf/Platform.h: Rename, reorganize and document OS() macros.
11647
11648         Adapt to name changes. Also fixed a few incorrect OS checks.
11649
11650         * API/JSContextRef.cpp:
11651         * assembler/MacroAssemblerARM.cpp:
11652         (JSC::isVFPPresent):
11653         * assembler/MacroAssemblerX86Common.h:
11654         * bytecode/SamplingTool.cpp:
11655         * config.h:
11656         * interpreter/RegisterFile.cpp:
11657         (JSC::RegisterFile::~RegisterFile):
11658         * interpreter/RegisterFile.h:
11659         (JSC::RegisterFile::RegisterFile):
11660         (JSC::RegisterFile::grow):
11661         * jit/ExecutableAllocator.h:
11662         * jit/ExecutableAllocatorFixedVMPool.cpp:
11663         * jit/ExecutableAllocatorPosix.cpp:
11664         * jit/ExecutableAllocatorSymbian.cpp:
11665         * jit/ExecutableAllocatorWin.cpp:
11666         * jit/JITOpcodes.cpp:
11667         (JSC::JIT::privateCompileCTIMachineTrampolines):
11668         * jit/JITStubs.cpp:
11669         * jsc.cpp:
11670         (main):
11671         * parser/Grammar.y:
11672         * profiler/ProfileNode.cpp:
11673         (JSC::getCount):
11674         * runtime/Collector.cpp:
11675         (JSC::Heap::Heap):
11676         (JSC::Heap::allocateBlock):
11677         (JSC::Heap::freeBlockPtr):
11678         (JSC::currentThreadStackBase):
11679         (JSC::getCurrentPlatformThread):
11680         (JSC::suspendThread):
11681         (JSC::resumeThread):
11682         (JSC::getPlatformThreadRegisters):
11683         (JSC::otherThreadStackPointer):
11684         * runtime/Collector.h:
11685         * runtime/DateConstructor.cpp:
11686         * runtime/DatePrototype.cpp:
11687         (JSC::formatLocaleDate):
11688         * runtime/InitializeThreading.cpp:
11689         (JSC::initializeThreading):
11690         * runtime/MarkStack.h:
11691         (JSC::MarkStack::MarkStackArray::shrinkAllocation):
11692         * runtime/MarkStackPosix.cpp:
11693         * runtime/MarkStackSymbian.cpp:
11694         * runtime/MarkStackWin.cpp:
11695         * runtime/StringPrototype.cpp:
11696         (JSC::stringProtoFuncLastIndexOf):
11697         * runtime/TimeoutChecker.cpp:
11698         (JSC::getCPUTime):
11699         * runtime/UString.cpp:
11700         (JSC::UString::from):
11701         * wtf/Assertions.cpp:
11702         * wtf/Assertions.h:
11703         * wtf/CurrentTime.cpp:
11704         (WTF::lowResUTCTime):
11705         * wtf/CurrentTime.h:
11706         (WTF::getLocalTime):
11707         * wtf/DateMath.cpp:
11708         * wtf/FastMalloc.cpp:
11709         (WTF::TCMalloc_ThreadCache::InitModule):
11710         (WTF::TCMallocStats::):
11711         * wtf/FastMalloc.h:
11712         * wtf/MathExtras.h:
11713         * wtf/RandomNumber.cpp:
11714         (WTF::randomNumber):
11715         * wtf/RandomNumberSeed.h:
11716         (WTF::initializeRandomNumberGenerator):
11717         * wtf/StringExtras.h:
11718         * wtf/TCSpinLock.h:
11719         (TCMalloc_SpinLock::Unlock):
11720         (TCMalloc_SlowLock):
11721         * wtf/TCSystemAlloc.cpp:
11722         * wtf/ThreadSpecific.h:
11723         (WTF::::destroy):
11724         * wtf/Threading.h:
11725         * wtf/ThreadingPthreads.cpp:
11726         (WTF::initializeThreading):
11727         (WTF::isMainThread):
11728         * wtf/ThreadingWin.cpp:
11729         (WTF::wtfThreadEntryPoint):
11730         (WTF::createThreadInternal):
11731         * wtf/VMTags.h:
11732         * wtf/unicode/icu/CollatorICU.cpp:
11733         (WTF::Collator::userDefault):
11734         * wtf/win/MainThreadWin.cpp:
11735         (WTF::initializeMainThreadPlatform):
11736
11737 2010-01-04  Gustavo Noronha Silva  <gns@gnome.org>
11738
11739         Add missing files to the build system - make distcheck build fix.
11740
11741         * GNUmakefile.am:
11742
11743 2010-01-04  Gavin Barraclough <barraclough@apple.com>
11744
11745         Reviewed by Sam Weinig, additional coding by Mark Rowe.
11746
11747         https://bugs.webkit.org/show_bug.cgi?id=33163
11748         Add string hashing functions to WTF.
11749         Use WTF's string hashing functions from UStringImpl.
11750
11751         * GNUmakefile.am:
11752         * JavaScriptCore.exp:
11753         * JavaScriptCore.gypi:
11754         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
11755         * JavaScriptCore.xcodeproj/project.pbxproj:
11756         * runtime/UStringImpl.cpp:
11757         * runtime/UStringImpl.h:
11758         (JSC::UStringImpl::computeHash):
11759         * wtf/HashFunctions.h:
11760         * wtf/StringHashFunctions.h: Added.
11761         (WTF::stringHash):
11762
11763 2010-01-04  Dmitry Titov  <dimich@chromium.org>
11764
11765         Not reviewed, attempt to fix ARM bulid.
11766
11767         * wtf/Platform.h:
11768
11769 2010-01-04  Gavin Barraclough  <barraclough@apple.com>
11770
11771         Rubber stamped by Geoff Garen.
11772
11773         Add an 'isIdentifier' to UStringImpl, use this where appropriate
11774         (where previously 'identifierTable' was being tested).
11775
11776         * API/JSClassRef.cpp:
11777         (OpaqueJSClass::~OpaqueJSClass):
11778         (OpaqueJSClassContextData::OpaqueJSClassContextData):
11779         * runtime/Identifier.cpp:
11780         (JSC::Identifier::addSlowCase):
11781         * runtime/Identifier.h:
11782         (JSC::Identifier::add):
11783         * runtime/PropertyNameArray.cpp:
11784         (JSC::PropertyNameArray::add):
11785         * runtime/UStringImpl.h:
11786         (JSC::UStringImpl::isIdentifier):
11787
11788 2010-01-04  Gavin Barraclough  <barraclough@apple.com>
11789
11790         Reviewed by Sam "Shimmey Shimmey" Weinig.
11791
11792         https://bugs.webkit.org/show_bug.cgi?id=33158
11793         Refactor JSC API entry/exit to use RAII instead of copy/pasting code.
11794         Make it easier to change set of actions taken when passing across the API boundary.
11795
11796         * API/APIShims.h: Added.
11797         (JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock):
11798         (JSC::APIEntryShimWithoutLock::~APIEntryShimWithoutLock):
11799         (JSC::APIEntryShim::APIEntryShim):
11800         (JSC::APICallbackShim::APICallbackShim):
11801         (JSC::APICallbackShim::~APICallbackShim):
11802         * API/JSBase.cpp:
11803         (JSEvaluateScript):
11804         (JSCheckScriptSyntax):
11805         (JSGarbageCollect):
11806         (JSReportExtraMemoryCost):
11807         * API/JSCallbackConstructor.cpp:
11808         (JSC::constructJSCallback):
11809         * API/JSCallbackFunction.cpp:
11810         (JSC::JSCallbackFunction::call):
11811         * API/JSCallbackObjectFunctions.h:
11812         (JSC::::init):
11813         (JSC::::getOwnPropertySlot):
11814         (JSC::::put):
11815         (JSC::::deleteProperty):
11816         (JSC::::construct):
11817         (JSC::::hasInstance):
11818         (JSC::::call):
11819         (JSC::::getOwnPropertyNames):
11820         (JSC::::toNumber):
11821         (JSC::::toString):
11822         (JSC::::staticValueGetter):
11823         (JSC::::callbackGetter):
11824         * API/JSContextRef.cpp:
11825         * API/JSObjectRef.cpp:
11826         (JSObjectMake):
11827         (JSObjectMakeFunctionWithCallback):
11828         (JSObjectMakeConstructor):
11829         (JSObjectMakeFunction):
11830         (JSObjectMakeArray):
11831         (JSObjectMakeDate):
11832         (JSObjectMakeError):
11833         (JSObjectMakeRegExp):
11834         (JSObjectGetPrototype):
11835         (JSObjectSetPrototype):
11836         (JSObjectHasProperty):
11837         (JSObjectGetProperty):
11838         (JSObjectSetProperty):
11839         (JSObjectGetPropertyAtIndex):
11840         (JSObjectSetPropertyAtIndex):
11841         (JSObjectDeleteProperty):
11842         (JSObjectCallAsFunction):
11843         (JSObjectCallAsConstructor):
11844         (JSObjectCopyPropertyNames):
11845         (JSPropertyNameArrayRelease):
11846         (JSPropertyNameAccumulatorAddName):
11847         * API/JSValueRef.cpp:
11848         (JSValueGetType):
11849         (JSValueIsUndefined):
11850         (JSValueIsNull):
11851         (JSValueIsBoolean):
11852         (JSValueIsNumber):
11853         (JSValueIsString):
11854         (JSValueIsObject):
11855         (JSValueIsObjectOfClass):
11856         (JSValueIsEqual):
11857         (JSValueIsStrictEqual):
11858         (JSValueIsInstanceOfConstructor):
11859         (JSValueMakeUndefined):
11860         (JSValueMakeNull):
11861         (JSValueMakeBoolean):
11862         (JSValueMakeNumber):
11863         (JSValueMakeString):
11864         (JSValueToBoolean):
11865         (JSValueToNumber):
11866         (JSValueToStringCopy):
11867         (JSValueToObject):
11868         (JSValueProtect):
11869         (JSValueUnprotect):
11870         * JavaScriptCore.xcodeproj/project.pbxproj:
11871
11872 2010-01-04  Dan Bernstein  <mitz@apple.com>
11873
11874         Reviewed by Ada Chan and Mark Rowe.
11875
11876         Updated copyright string
11877
11878         * Info.plist:
11879         * JavaScriptCore.vcproj/JavaScriptCore.resources/Info.plist:
11880         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.rc:
11881
11882 2010-01-04  Adam Roben  <aroben@apple.com>
11883
11884         No review, rolling out r52741.
11885         http://trac.webkit.org/changeset/52741
11886         https://bugs.webkit.org/show_bug.cgi?id=33056
11887
11888         * wtf/AlwaysInline.h:
11889
11890 2010-01-04  Patrick Gansterer  <paroga@paroga.com>
11891
11892         Reviewed by Darin Adler.
11893
11894         Add cacheFlush support for WinCE
11895         https://bugs.webkit.org/show_bug.cgi?id=33110
11896
11897         * jit/ExecutableAllocator.h:
11898         (JSC::ExecutableAllocator::cacheFlush):
11899
11900 2010-01-04  Patrick Gansterer  <paroga@paroga.com>
11901
11902         Reviewed by Adam Roben.
11903
11904         Implement NO_RETURN for COMPILER(MSVC).
11905         https://bugs.webkit.org/show_bug.cgi?id=33056
11906
11907         * wtf/AlwaysInline.h:
11908
11909 2010-01-04  Maciej Stachowiak  <mjs@apple.com>
11910
11911         Reviewed by Simon Hausmann.
11912
11913         Fix some PLATFORM(*_ENDIAN) uses to CPU()
11914         https://bugs.webkit.org/show_bug.cgi?id=33148
11915
11916         * runtime/JSCell.cpp:
11917         (JSC::):
11918         * runtime/JSValue.h:
11919         (JSC::JSValue::):
11920
11921 2010-01-04  Maciej Stachowiak  <mjs@apple.com>
11922
11923         Reviewed by Adam Barth.
11924
11925         Document CPU() macros in comments.
11926         https://bugs.webkit.org/show_bug.cgi?id=33147
11927
11928         * wtf/Platform.h:
11929
11930 2010-01-04  Maciej Stachowiak  <mjs@apple.com>
11931
11932         Reviewed by Adam Barth.
11933
11934         Reorganize, document and rename CPU() platform macros.
11935         https://bugs.webkit.org/show_bug.cgi?id=33145
11936         ExecutableAllocatorSymbian appears to have buggy ARM version check
11937         https://bugs.webkit.org/show_bug.cgi?id=33138
11938         
11939         * wtf/Platform.h:
11940         Rename all macros related to detection of particular CPUs or
11941         classes of CPUs to CPU(), reorganize and document them.
11942
11943         All remaining changes are adapting to the renames, plus fixing the
11944         second bug cited above.
11945         
11946         * assembler/ARMAssembler.cpp:
11947         * assembler/ARMAssembler.h:
11948         * assembler/ARMv7Assembler.h:
11949         * assembler/AbstractMacroAssembler.h:
11950         (JSC::AbstractMacroAssembler::Imm32::Imm32):
11951         * assembler/MacroAssembler.h:
11952         * assembler/MacroAssemblerARM.cpp:
11953         * assembler/MacroAssemblerARM.h:
11954         * assembler/MacroAssemblerCodeRef.h:
11955         (JSC::MacroAssemblerCodePtr::MacroAssemblerCodePtr):
11956         * assembler/MacroAssemblerX86.h:
11957         * assembler/MacroAssemblerX86Common.h:
11958         * assembler/MacroAssemblerX86_64.h:
11959         * assembler/X86Assembler.h:
11960         (JSC::X86Registers::):
11961         (JSC::X86Assembler::):
11962         (JSC::X86Assembler::movl_mEAX):
11963         (JSC::X86Assembler::movl_EAXm):
11964         (JSC::X86Assembler::repatchLoadPtrToLEA):
11965         (JSC::X86Assembler::X86InstructionFormatter::memoryModRM):
11966         * jit/ExecutableAllocator.h:
11967         * jit/ExecutableAllocatorFixedVMPool.cpp:
11968         * jit/ExecutableAllocatorPosix.cpp:
11969         * jit/ExecutableAllocatorSymbian.cpp:
11970         (JSC::ExecutableAllocator::intializePageSize):
11971         * jit/JIT.cpp:
11972         * jit/JIT.h:
11973         * jit/JITArithmetic.cpp:
11974         * jit/JITInlineMethods.h:
11975         (JSC::JIT::beginUninterruptedSequence):
11976         (JSC::JIT::restoreArgumentReferenceForTrampoline):
11977         (JSC::JIT::emitCount):
11978         * jit/JITOpcodes.cpp:
11979         (JSC::JIT::privateCompileCTIMachineTrampolines):
11980         * jit/JITPropertyAccess.cpp:
11981         (JSC::JIT::privateCompileGetByIdProto):
11982         (JSC::JIT::privateCompileGetByIdProtoList):
11983         (JSC::JIT::privateCompileGetByIdChainList):
11984         (JSC::JIT::privateCompileGetByIdChain):
11985         * jit/JITStubs.cpp:
11986         (JSC::JITThunks::JITThunks):
11987         * jit/JITStubs.h:
11988         * runtime/Collector.cpp:
11989         (JSC::currentThreadStackBase):
11990         (JSC::getPlatformThreadRegisters):
11991         (JSC::otherThreadStackPointer):
11992         * wrec/WREC.h:
11993         * wrec/WRECGenerator.cpp:
11994         (JSC::WREC::Generator::generateEnter):
11995         (JSC::WREC::Generator::generateReturnSuccess):
11996         (JSC::WREC::Generator::generateReturnFailure):
11997         * wrec/WRECGenerator.h:
11998         * wtf/FastMalloc.cpp:
11999         * wtf/TCSpinLock.h:
12000         (TCMalloc_SpinLock::Lock):
12001         (TCMalloc_SpinLock::Unlock):
12002         (TCMalloc_SlowLock):
12003         * wtf/Threading.h:
12004         * wtf/dtoa.cpp:
12005         * yarr/RegexJIT.cpp:
12006         (JSC::Yarr::RegexGenerator::generateEnter):
12007         (JSC::Yarr::RegexGenerator::generateReturn):
12008         * yarr/RegexJIT.h:
12009
12010 2010-01-04  Maciej Stachowiak  <mjs@apple.com>
12011
12012         Reviewed by Adam Barth.
12013
12014         Clean up COMPILER macros and remove unused ones.
12015         https://bugs.webkit.org/show_bug.cgi?id=33132
12016         
12017         Removed values are COMPILER(BORLAND) and COMPILER(CYGWIN) - they were
12018         not used anywhere.
12019
12020         * wtf/Platform.h:
12021
12022 2010-01-03  Maciej Stachowiak  <mjs@apple.com>
12023
12024         Reviewed by Eric Seidel.
12025
12026         Update wtf/Platform.h to document the new system for porting macros.
12027         https://bugs.webkit.org/show_bug.cgi?id=33130
12028
12029         * wtf/Platform.h:
12030
12031 2009-12-29  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
12032
12033         Reviewed by Maciej Stachowiak.
12034
12035         PLATFORM(CAIRO) should be defined by WIN_CAIRO define
12036         https://bugs.webkit.org/show_bug.cgi?id=22250
12037
12038         * wtf/Platform.h: Define WTF_PLATFORM_CAIRO for GTK port only
12039         For the WinCairo port WTF_PLATFORM_CAIRO is already defined in config.h
12040
12041 2009-12-28  Shu Chang  <Chang.Shu@nokia.com>
12042
12043         Reviewed by Laszlo Gombos.
12044
12045         [Qt] Delete ThreadPrivate instance after it is finished.
12046         https://bugs.webkit.org/show_bug.cgi?id=32614
12047
12048         * wtf/qt/ThreadingQt.cpp:
12049         (WTF::ThreadMonitor::instance):
12050         (WTF::ThreadMonitor::threadFinished):
12051         (WTF::createThreadInternal):
12052         (WTF::detachThread):
12053
12054 2009-12-28  Patrick Gansterer  <paroga@paroga.com>
12055
12056         Reviewed by Maciej Stachowiak.
12057
12058         Cleanup of #define JS_EXPORT.
12059
12060         * API/JSBase.h:
12061
12062 2009-12-27  Patrick Gansterer  <paroga@paroga.com>
12063
12064         Reviewed by Adam Barth.
12065
12066         WinCE buildfix (HWND_MESSAGE isn't supported there)
12067
12068         * wtf/win/MainThreadWin.cpp:
12069         (WTF::initializeMainThreadPlatform):
12070
12071 2009-12-27  Patrick Gansterer  <paroga@paroga.com>
12072
12073         Reviewed by Adam Barth.
12074
12075         Added a file with WinMain function to link agains in WinCE.
12076
12077         * os-win32/WinMain.cpp: Added.
12078         (convertToUtf8):
12079         (WinMain):
12080
12081 2009-12-24  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
12082
12083         Unreviewed; revert of r52550.
12084
12085         The change regressed the following LayoutTests for QtWebKit.
12086
12087         fast/workers/worker-call.html -> crashed
12088         fast/workers/worker-close.html -> crashed
12089
12090         * wtf/qt/ThreadingQt.cpp:
12091         (WTF::waitForThreadCompletion):
12092         (WTF::detachThread):
12093
12094 2009-12-24  Shu Chang  <Chang.Shu@nokia.com>
12095
12096         Reviewed by Laszlo Gombos.
12097
12098         [Qt] Fix memory leak by deleting instance of ThreadPrivate
12099         in function waitForThreadCompletion(), synchronously, or in
12100         detachThread(), asynchronously.
12101         https://bugs.webkit.org/show_bug.cgi?id=32614 
12102
12103         * wtf/qt/ThreadingQt.cpp:
12104         (WTF::waitForThreadCompletion):
12105         (WTF::detachThread):
12106
12107 2009-12-23  Kwang Yul Seo  <skyul@company100.net>
12108
12109         Reviewed by Laszlo Gombos.
12110
12111         Include stddef.h for ptrdiff_t
12112         https://bugs.webkit.org/show_bug.cgi?id=32891
12113
12114         ptrdiff_t is typedef-ed in stddef.h.
12115         Include stddef.h in jit/ExecutableAllocator.h.
12116
12117         * jit/ExecutableAllocator.h:
12118
12119 2009-12-23  Patrick Gansterer  <paroga@paroga.com>
12120
12121         Reviewed by Eric Seidel.
12122
12123         Buildfix after r47092.
12124
12125         * wtf/wince/MemoryManager.cpp:
12126         (WTF::tryFastMalloc):
12127         (WTF::tryFastZeroedMalloc):
12128         (WTF::tryFastCalloc):
12129         (WTF::tryFastRealloc):
12130
12131 2009-12-23  Kent Tamura  <tkent@chromium.org>
12132
12133         Reviewed by Darin Adler.
12134
12135         HTMLInputElement::valueAsDate getter support.
12136         https://bugs.webkit.org/show_bug.cgi?id=32876
12137
12138         Expose dateToDaysFrom1970().
12139
12140         * JavaScriptCore.exp:
12141         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
12142         * wtf/DateMath.cpp:
12143         (WTF::dateToDaysFrom1970):
12144         * wtf/DateMath.h:
12145
12146 2009-12-22  Darin Adler  <darin@apple.com>
12147
12148         Reviewed by Mark Rowe.
12149
12150         Turn off datagrid by default, at least for all platforms Apple ships.
12151         The datagrid implementation isn't ready for general web use yet.
12152
12153         * Configurations/FeatureDefines.xcconfig: Turn off datagrid by default.
12154
12155 2009-12-22  Steve Block  <steveblock@google.com>
12156
12157         Reviewed by David Levin.
12158
12159         Updates Android's scheduleDispatchFunctionsOnMainThread() to use new
12160         AndroidThreading class, rather than using JavaSharedClient directly.
12161         This fixes the current layering violation.
12162         https://bugs.webkit.org/show_bug.cgi?id=32651
12163
12164         The pattern is copied from Chromium, which uses the ChromiumThreading
12165         class. This patch also fixes the style in ChromiumThreading.h.
12166
12167         * wtf/android/AndroidThreading.h: Added. Declares AndroidThreading.
12168         * wtf/android/MainThreadAndroid.cpp: Modified
12169         (WTF::scheduleDispatchFunctionsOnMainThread): Uses AndroidThreading.
12170         * wtf/chromium/ChromiumThreading.h: Modified. Fixes style.
12171
12172 2009-12-22  Gavin Barraclough  <barraclough@apple.com>
12173
12174         Reviewed by Sam Weinig.
12175
12176         Fix a couple of problems with UntypedPtrAndBitfield.
12177
12178         Add a m_leaksPtr to reduce false positives from leaks in debug builds
12179         (this isn't perfect because we'd like a solution for release builds,
12180         but this is now at least as good as a PtrAndFlags would be).
12181
12182         Switch SmallStringsto use a regular string for the base, rather than
12183         a static one.  UntypedPtrAndBitfield assumes all strings are at least
12184         8 byte aligned; this migt not be true of static strings.  Shared buffers
12185         are heap allocated, as are all UStringImpls other than static strings.
12186         Static strings cannot end up being the owner string of substrings,
12187         since the only static strings are length 0.
12188
12189         * runtime/SmallStrings.cpp:
12190         (JSC::SmallStringsStorage::SmallStringsStorage):
12191         * runtime/UStringImpl.h:
12192         (JSC::UntypedPtrAndBitfield::UntypedPtrAndBitfield):
12193         (JSC::UStringImpl::UStringImpl):
12194
12195 2009-12-22  Kwang Yul Seo  <skyul@company100.net>
12196
12197         Reviewed by Darin Adler.
12198
12199         RVCT (__ARMCC_VERSION < 400000) does not provide strcasecmp and strncasecmp
12200         https://bugs.webkit.org/show_bug.cgi?id=32857
12201
12202         Add implementation of strcasecmp and strncasecmp for RVCT < 4.0
12203         because earlier versions of RVCT 4.0 does not provide these functions.
12204
12205         * wtf/StringExtras.cpp: Added.
12206         (strcasecmp):
12207         (strncasecmp):
12208         * wtf/StringExtras.h:
12209
12210 2009-12-22  Kwang Yul Seo  <skyul@company100.net>
12211
12212         Reviewed by Darin Adler.
12213
12214         Define ALWAYS_INLINE and WTF_PRIVATE_INLINE to __forceinline for RVCT
12215         https://bugs.webkit.org/show_bug.cgi?id=32853
12216
12217         Use __forceinline forces RVCT to compile a C or C++ function
12218         inline. The compiler attempts to inline the function, regardless of
12219         the characteristics of the function.
12220
12221         * wtf/AlwaysInline.h:
12222         * wtf/FastMalloc.h:
12223
12224 2009-12-21  Simon Hausmann  <simon.hausmann@nokia.com>
12225
12226         Prospective GTK build fix: Add UStringImpl.cpp/h to the build.
12227
12228         * GNUmakefile.am:
12229
12230 2009-12-21  Simon Hausmann  <simon.hausmann@nokia.com>
12231
12232         Fix the Qt build, add UStringImpl.cpp to the build.
12233
12234         * JavaScriptCore.pri:
12235
12236 2009-12-21  Gavin Barraclough  <barraclough@apple.com>
12237
12238         Windows Build fix part 5.
12239         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
12240
12241 2009-12-21  Gavin Barraclough  <barraclough@apple.com>
12242
12243         Reviewed by NOBODY (build fix).
12244         Fix breakage of world introduced in build fix to r52463.
12245
12246         * runtime/UStringImpl.h:
12247
12248 2009-12-21  Gavin Barraclough  <barraclough@apple.com>
12249
12250         Reviewed by Darin Adler.
12251
12252         https://bugs.webkit.org/show_bug.cgi?id=32831
12253         Replace UString::Rep implementation, following introduction of ropes to JSC.
12254
12255             * Remove redundant overcapacity mechanisms.
12256             * Reduce memory cost of Rep's.
12257             * Add an inline storage mechanism akin to that in WebCore's StringImpl.
12258
12259         ~1% Sunspider progression.
12260
12261         * JavaScriptCore.exp:
12262         * JavaScriptCore.xcodeproj/project.pbxproj:
12263         * runtime/JSString.cpp:
12264         (JSC::JSString::resolveRope):
12265         * runtime/SmallStrings.cpp:
12266         (JSC::SmallStringsStorage::SmallStringsStorage):
12267         * runtime/UString.cpp:
12268         (JSC::initializeUString):
12269         (JSC::createRep):
12270         (JSC::UString::createFromUTF8):
12271         (JSC::UString::createUninitialized):
12272         (JSC::UString::spliceSubstringsWithSeparators):
12273         (JSC::UString::replaceRange):
12274         (JSC::UString::ascii):
12275         (JSC::UString::operator=):
12276         (JSC::UString::toStrictUInt32):
12277         (JSC::equal):
12278         * runtime/UString.h:
12279         (JSC::UString::isEmpty):
12280         (JSC::UString::cost):
12281         (JSC::makeString):
12282         * runtime/UStringImpl.cpp: Added.
12283         (JSC::UStringImpl::baseSharedBuffer):
12284         (JSC::UStringImpl::sharedBuffer):
12285         (JSC::UStringImpl::destroy):
12286         (JSC::UStringImpl::computeHash):
12287         * runtime/UStringImpl.h: Added.
12288         (JSC::UntypedPtrAndBitfield::UntypedPtrAndBitfield):
12289         (JSC::UntypedPtrAndBitfield::asPtr):
12290         (JSC::UntypedPtrAndBitfield::operator&=):
12291         (JSC::UntypedPtrAndBitfield::operator|=):
12292         (JSC::UntypedPtrAndBitfield::operator&):
12293         (JSC::UStringImpl::create):
12294         (JSC::UStringImpl::createCopying):
12295         (JSC::UStringImpl::createUninitialized):
12296         (JSC::UStringImpl::data):
12297         (JSC::UStringImpl::size):
12298         (JSC::UStringImpl::cost):
12299         (JSC::UStringImpl::hash):
12300         (JSC::UStringImpl::computedHash):
12301         (JSC::UStringImpl::setHash):
12302         (JSC::UStringImpl::identifierTable):
12303         (JSC::UStringImpl::setIdentifierTable):
12304         (JSC::UStringImpl::ref):
12305         (JSC::UStringImpl::deref):
12306         (JSC::UStringImpl::allocChars):
12307         (JSC::UStringImpl::copyChars):
12308         (JSC::UStringImpl::computeHash):
12309         (JSC::UStringImpl::null):
12310         (JSC::UStringImpl::empty):
12311         (JSC::UStringImpl::checkConsistency):
12312         (JSC::UStringImpl::):
12313         (JSC::UStringImpl::UStringImpl):
12314         (JSC::UStringImpl::operator new):
12315         (JSC::UStringImpl::bufferOwnerString):
12316         (JSC::UStringImpl::bufferOwnership):
12317         (JSC::UStringImpl::isStatic):
12318
12319 2009-12-18  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
12320
12321         Reviewed by Kenneth Rohde Christiansen.
12322
12323         Move some build decisions from Qt build system into source files
12324         https://bugs.webkit.org/show_bug.cgi?id=31956
12325
12326         * JavaScriptCore.pri: Compile files unconditionally
12327         * jit/ExecutableAllocatorPosix.cpp: Guard with PLATFORM(UNIX) && !PLATFORM(SYMBIAN)
12328         * jit/ExecutableAllocatorWin.cpp: Guard with PLATFORM(WIN_OS)
12329         * runtime/MarkStackPosix.cpp: Guard with PLATFORM(UNIX) && !PLATFORM(SYMBIAN)
12330         * runtime/MarkStackSymbian.cpp: Guard with PLATFORM(SYMBIAN)
12331         * runtime/MarkStackWin.cpp: Guard with PLATFORM(WIN_OS)
12332         * wtf/Platform.h: Guard ENABLE_JSC_MULTIPLE_THREADS with ENABLE_SINGLE_THREADED for the Qt port
12333         * wtf/ThreadingNone.cpp: Guard with ENABLE(SINGLE_THREADED)
12334         * wtf/qt/ThreadingQt.cpp: Guard with !ENABLE(SINGLE_THREADED)
12335
12336 2009-12-18  Gavin Barraclough  <barraclough@apple.com>
12337
12338         Reviewed by Sam Weinig.
12339
12340         Add createNonCopying method to UString to make replace constructor passed bool,
12341         to make behaviour more explicit.  Add createFromUTF8 to UString (wrapping method
12342         on UString::Rep), since other cases of transliteration (e.g.  from ascii) are
12343         performed in UString constructors.  Add/use setHash & size() accessors on Rep,
12344         rather than accessing _hash/len directly.
12345
12346         * API/JSClassRef.cpp:
12347         (OpaqueJSClass::OpaqueJSClass):
12348         * API/OpaqueJSString.cpp:
12349         (OpaqueJSString::ustring):
12350         * JavaScriptCore.exp:
12351         * runtime/ArrayPrototype.cpp:
12352         (JSC::arrayProtoFuncToString):
12353         * runtime/Identifier.cpp:
12354         (JSC::Identifier::equal):
12355         (JSC::CStringTranslator::translate):
12356         (JSC::UCharBufferTranslator::translate):
12357         (JSC::Identifier::addSlowCase):
12358         * runtime/JSString.cpp:
12359         (JSC::JSString::resolveRope):
12360         * runtime/JSString.h:
12361         (JSC::JSString::Rope::Fiber::refAndGetLength):
12362         (JSC::JSString::Rope::append):
12363         * runtime/StringBuilder.h:
12364         (JSC::StringBuilder::release):
12365         * runtime/StringConstructor.cpp:
12366         (JSC::stringFromCharCodeSlowCase):
12367         * runtime/StringPrototype.cpp:
12368         (JSC::substituteBackreferencesSlow):
12369         (JSC::stringProtoFuncToLowerCase):
12370         (JSC::stringProtoFuncToUpperCase):
12371         (JSC::stringProtoFuncFontsize):
12372         (JSC::stringProtoFuncLink):
12373         * runtime/UString.cpp:
12374         (JSC::UString::UString):
12375         (JSC::UString::createNonCopying):
12376         (JSC::UString::createFromUTF8):
12377         * runtime/UString.h:
12378         (JSC::UString::Rep::setHash):
12379         (JSC::UString::~UString):
12380         (JSC::makeString):
12381
12382 2009-12-18  Geoffrey Garen  <ggaren@apple.com>
12383
12384         Reviewed by Cameron Zwarich and Gavin Barraclough.
12385         
12386         Changed Register constructors to assignment operators, to streamline
12387         moving values into registers. (In theory, there's no difference between
12388         the two, since the constructor should just inline away, but there seems
12389         to be a big difference in the addled mind of the GCC optimizer.)
12390
12391         In the interpreter, this is a 3.5% SunSpider speedup and a 1K-2K
12392         reduction in stack usage per privateExecute stack frame.
12393
12394         * interpreter/CallFrame.h:
12395         (JSC::ExecState::setCalleeArguments):
12396         (JSC::ExecState::setCallerFrame):
12397         (JSC::ExecState::setScopeChain):
12398         (JSC::ExecState::init):
12399         (JSC::ExecState::setArgumentCount):
12400         (JSC::ExecState::setCallee):
12401         (JSC::ExecState::setCodeBlock): Added a little bit of casting so these
12402         functions could use the new Register assignment operators.
12403
12404         * interpreter/Register.h:
12405         (JSC::Register::withInt):
12406         (JSC::Register::Register):
12407         (JSC::Register::operator=): Swapped in assignment operators for constructors.
12408
12409 2009-12-18  Yongjun Zhang  <yongjun.zhang@nokia.com>
12410
12411         Reviewed by Simon Hausmann.
12412
12413         https://bugs.webkit.org/show_bug.cgi?id=32713
12414         [Qt] make wtf/Assertions.h compile in winscw compiler.
12415
12416         Add string arg before ellipsis to help winscw compiler resolve variadic
12417         macro definitions in wtf/Assertions.h. 
12418
12419         * wtf/Assertions.h:
12420
12421 2009-12-18  Geoffrey Garen  <ggaren@apple.com>
12422
12423         Reviewed by Adam Roben.
12424
12425         Fixed intermittent failure seen on Windows buildbot, and in other JSC
12426         API clients.
12427         
12428         Added a WeakGCPtr class and changed OpaqueJSClass::cachedPrototype to
12429         use it, to avoid vending a stale object as a prototype.
12430
12431         * API/JSClassRef.cpp:
12432         (OpaqueJSClassContextData::OpaqueJSClassContextData):
12433         (OpaqueJSClass::prototype):
12434         * API/JSClassRef.h: Use WeakGCPtr.
12435
12436         * JavaScriptCore.xcodeproj/project.pbxproj:
12437         * runtime/WeakGCPtr.h: Added.
12438         (JSC::WeakGCPtr::WeakGCPtr):
12439         (JSC::WeakGCPtr::get):
12440         (JSC::WeakGCPtr::clear):
12441         (JSC::WeakGCPtr::operator*):
12442         (JSC::WeakGCPtr::operator->):
12443         (JSC::WeakGCPtr::operator!):
12444         (JSC::WeakGCPtr::operator bool):
12445         (JSC::WeakGCPtr::operator UnspecifiedBoolType):
12446         (JSC::WeakGCPtr::assign):
12447         (JSC::::operator):
12448         (JSC::operator==):
12449         (JSC::operator!=):
12450         (JSC::static_pointer_cast):
12451         (JSC::const_pointer_cast):
12452         (JSC::getPtr): Added WeakGCPtr to the project.
12453
12454 2009-12-18  Gavin Barraclough  <barraclough@apple.com>
12455
12456         Reviewed by Sam Weinig.
12457
12458         https://bugs.webkit.org/show_bug.cgi?id=32720
12459
12460         * JavaScriptCore.exp:
12461             - Remove exports for UString::append
12462         * JavaScriptCore.xcodeproj/project.pbxproj:
12463             - Make StringBuilder a private header (was project).
12464
12465 2009-12-18  Martin Robinson  <martin.james.robinson@gmail.com>
12466
12467         Reviewed by Gustavo Noronha Silva.
12468
12469         [GTK] GRefPtr does not take a reference when assigned a raw pointer
12470         https://bugs.webkit.org/show_bug.cgi?id=32709
12471
12472         Ensure that when assigning a raw pointer to a GRefPtr, the reference
12473         count is incremented. Also remove the GRefPtr conversion overload as
12474         GRefPtr types have necessarily incompatible reference counting.
12475
12476         * wtf/gtk/GRefPtr.h:
12477         (WTF::GRefPtr::operator=):
12478
12479 2009-12-18  Simon Hausmann  <simon.hausmann@nokia.com>
12480
12481         Reviewed by Tor Arne Vestbø.
12482
12483         [Qt] Clean up the qmake build system to distinguish between trunk builds and package builds
12484
12485         https://bugs.webkit.org/show_bug.cgi?id=32716
12486
12487         * pcre/pcre.pri: Use standalone_package instead of QTDIR_build
12488
12489 2009-12-18  Martin Robinson  <martin.james.robinson@gmail.com>
12490
12491         Reviewed by Gustavo Noronha Silva.
12492
12493         [GTK] Compile warning from line 29 of GRefPtr.cpp
12494         https://bugs.webkit.org/show_bug.cgi?id=32703
12495
12496         Fix memory leak and compiler warning in GRefPtr GHashTable template
12497         specialization.
12498
12499         * wtf/gtk/GRefPtr.cpp:
12500         (WTF::refGPtr):
12501
12502 2009-12-17  Sam Weinig  <sam@webkit.org>
12503
12504         Reviewed by Mark Rowe.
12505
12506         Add BUILDING_ON_SNOW_LEOPARD and TARGETING_SNOW_LEOPARD #defines.
12507
12508         * wtf/Platform.h:
12509
12510 2009-12-17  Adam Roben  <aroben@apple.com>
12511
12512         Sync JavaScriptCore.vcproj with JavaScriptCore.xcodeproj and the
12513         source tree
12514
12515         Fixes <http://webkit.org/b/32665>.
12516
12517         Reviewed by Ada Chan.
12518
12519         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Moved
12520         around files and filters so that the structure matches
12521         JavaScriptCore.xcodeproj and the source tree. A few headers that were
12522         previously omitted have been added, as well as JSZombie.{cpp,h}.
12523
12524 2009-12-17  Adam Roben  <aroben@apple.com>
12525
12526         Remove HeavyProfile and TreeProfile completely
12527
12528         These were mostly removed in r42808, but the empty files were left in
12529         place.
12530
12531         Fixes <http://webkit.org/b/32664>.
12532
12533         Reviewed by John Sullivan.
12534
12535         * Android.mk:
12536         * GNUmakefile.am:
12537         * JavaScriptCore.gypi:
12538         * JavaScriptCore.pri:
12539         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
12540         * JavaScriptCoreSources.bkl:
12541         Removed HeavyProfile/TreeProfile source files.
12542
12543         * profiler/HeavyProfile.cpp: Removed.
12544         * profiler/HeavyProfile.h: Removed.
12545         * profiler/TreeProfile.cpp: Removed.
12546         * profiler/TreeProfile.h: Removed.
12547
12548 2009-12-17  Martin Robinson  <martin.james.robinson@gmail.com>
12549
12550         Reviewed by Gustavo Noronha Silva.
12551
12552         [GTK] WebKit GTK needs a wrapper for ref counted glib/gobject structs
12553         https://bugs.webkit.org/show_bug.cgi?id=21599
12554
12555         Implement GRefPtr, a smart pointer for reference counted GObject types.
12556
12557         * GNUmakefile.am:
12558         * wtf/gtk/GOwnPtr.cpp:
12559         (WTF::GDir):
12560         * wtf/gtk/GRefPtr.h: Added.
12561         (WTF::):
12562         (WTF::GRefPtr::GRefPtr):
12563         (WTF::GRefPtr::~GRefPtr):
12564         (WTF::GRefPtr::clear):
12565         (WTF::GRefPtr::get):
12566         (WTF::GRefPtr::operator*):
12567         (WTF::GRefPtr::operator->):
12568         (WTF::GRefPtr::operator!):
12569         (WTF::GRefPtr::operator UnspecifiedBoolType):
12570         (WTF::GRefPtr::hashTableDeletedValue):
12571         (WTF::::operator):
12572         (WTF::::swap):
12573         (WTF::swap):
12574         (WTF::operator==):
12575         (WTF::operator!=):
12576         (WTF::static_pointer_cast):
12577         (WTF::const_pointer_cast):
12578         (WTF::getPtr):
12579         (WTF::adoptGRef):
12580         (WTF::refGPtr):
12581         (WTF::derefGPtr):
12582
12583 2009-12-17  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
12584
12585         Unreviewed. Build fixes for make distcheck.
12586
12587         * GNUmakefile.am:
12588
12589 2009-12-16  Geoffrey Garen  <ggaren@apple.com>
12590
12591         Reviewed by Oliver Hunt.
12592
12593         Fixed <rdar://problem/7355025> Interpreter::privateExecute macro generates
12594         bloated code
12595         
12596         This patch cuts Interpreter stack use by about a third.
12597
12598         * bytecode/Opcode.h: Changed Opcode to const void* to work with the
12599         const static initiliazation we want to do in Interpreter::privateExecute.
12600
12601         * interpreter/Interpreter.cpp:
12602         (JSC::Interpreter::Interpreter): Moved hashtable initialization here to
12603         avoid polluting Interpreter::privateExecute's stack, and changed it from a
12604         series of add() calls to one add() call in a loop, to cut down on code size.
12605
12606         (JSC::Interpreter::privateExecute): Changed a series of label computations
12607         to a copy of a compile-time constant array to cut down on code size.
12608
12609 2009-12-16  Mark Rowe  <mrowe@apple.com>
12610
12611         Build fix.  Disable debug variants of WebKit frameworks.
12612
12613         * JavaScriptCore.xcodeproj/project.pbxproj:
12614
12615 2009-12-15  Geoffrey Garen  <ggaren@apple.com>
12616
12617         Reviewed by Sam "r=me" Weinig.
12618
12619         https://bugs.webkit.org/show_bug.cgi?id=32498
12620         <rdar://problem/7471495>
12621         REGRESSION(r51978-r52039): AJAX "Mark This Forum Read" function no longer
12622         works
12623         
12624         Fixed a tyop.
12625
12626         * runtime/Operations.h:
12627         (JSC::jsAdd): Use the '&&' operator, not the ',' operator.
12628
12629 2009-12-15  Geoffrey Garen  <ggaren@apple.com>
12630
12631         Try to fix the windows build: don't export this inlined function.
12632
12633         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
12634
12635 2009-12-15  Geoffrey Garen  <ggaren@apple.com>
12636
12637         Reviewed by Beth Dakin.
12638
12639         Inlined JSCell's operator new.
12640         
12641         3.7% speedup on bench-allocate-nonretained.js.
12642
12643         * JavaScriptCore.exp:
12644         * runtime/JSCell.cpp:
12645         * runtime/JSCell.h:
12646         (JSC::JSCell::operator new):
12647
12648 2009-12-15  Geoffrey Garen  <ggaren@apple.com>
12649
12650         Reviewed by Oliver Hunt.
12651
12652         Removed the number heap, replacing it with a one-item free list for
12653         numbers, taking advantage of the fact that two number cells fit inside
12654         the space for one regular cell, and number cells don't require destruction.
12655         
12656         SunSpider says 1.6% faster in JSVALUE32 mode (the only mode that
12657         heap-allocates numbers).
12658         
12659         SunSpider says 1.1% faster in JSVALUE32_64 mode. v8 says 0.8% faster
12660         in JSVALUE32_64 mode. 10% speedup on bench-alloc-nonretained.js. 6%
12661         speedup on bench-alloc-retained.js.
12662         
12663         There's a lot of formulaic change in this patch, but not much substance.
12664
12665         * JavaScriptCore.exp:
12666         * debugger/Debugger.cpp:
12667         (JSC::Debugger::recompileAllJSFunctions):
12668         * runtime/Collector.cpp:
12669         (JSC::Heap::Heap):
12670         (JSC::Heap::destroy):
12671         (JSC::Heap::allocateBlock):
12672         (JSC::Heap::freeBlock):
12673         (JSC::Heap::freeBlockPtr):
12674         (JSC::Heap::freeBlocks):
12675         (JSC::Heap::recordExtraCost):
12676         (JSC::Heap::allocate):
12677         (JSC::Heap::resizeBlocks):
12678         (JSC::Heap::growBlocks):
12679         (JSC::Heap::shrinkBlocks):
12680         (JSC::Heap::markConservatively):
12681         (JSC::Heap::clearMarkBits):
12682         (JSC::Heap::markedCells):
12683         (JSC::Heap::sweep):
12684         (JSC::Heap::markRoots):
12685         (JSC::Heap::objectCount):
12686         (JSC::Heap::addToStatistics):
12687         (JSC::Heap::statistics):
12688         (JSC::Heap::isBusy):
12689         (JSC::Heap::reset):
12690         (JSC::Heap::collectAllGarbage):
12691         (JSC::Heap::primaryHeapBegin):
12692         (JSC::Heap::primaryHeapEnd):
12693         * runtime/Collector.h:
12694         (JSC::): Removed all code pertaining to the number heap, and changed all
12695         heap template functions and classes to non-template functions and classes.
12696
12697         (JSC::Heap::allocateNumber): A new optimization to replace the number
12698         heap: allocate half-sized number cells in pairs, returning the first
12699         cell and caching the second cell for the next allocation.
12700
12701         * runtime/CollectorHeapIterator.h:
12702         (JSC::LiveObjectIterator::LiveObjectIterator):
12703         (JSC::LiveObjectIterator::operator++):
12704         (JSC::DeadObjectIterator::DeadObjectIterator):
12705         (JSC::DeadObjectIterator::operator++):
12706         (JSC::ObjectIterator::ObjectIterator):
12707         (JSC::ObjectIterator::operator++):
12708         * runtime/JSCell.h:
12709         (JSC::JSCell::isNumber): Removed all code pertaining to the number heap,
12710         and changed all heap template functions and classes to non-template functions
12711         and classes.
12712
12713 2009-12-15  Zoltan Horvath  <zoltan@webkit.org>
12714
12715         Reviewed by Darin Adler.
12716
12717         Allow custom memory allocation control for WeakGCMap class
12718         https://bugs.webkit.org/show_bug.cgi?id=32547
12719
12720         Inherits WeakGCMap from FastAllocBase because it is instantiated by
12721         'new' at: WebCore/dom/Document.cpp:512.
12722
12723         * runtime/WeakGCMap.h:
12724
12725 2009-12-15  Zoltan Horvath  <zoltan@webkit.org>
12726
12727         Reviewed by Darin Adler.
12728
12729         Allow custom memory allocation control for dtoa's P5Node struct
12730         https://bugs.webkit.org/show_bug.cgi?id=32544
12731
12732         Inherits P5Node struct from Noncopyable because it is instantiated by
12733         'new' at wtf/dtoa.cpp:588 and don't need to be copyable.
12734
12735         * wtf/dtoa.cpp:
12736
12737 2009-12-14  Geoffrey Garen  <ggaren@apple.com>
12738
12739         Reviewed by Simon Fraser.
12740
12741         https://bugs.webkit.org/show_bug.cgi?id=32524
12742         REGRESSION(52084): fast/dom/prototypes.html failing two CSS tests
12743
12744         * wtf/StdLibExtras.h:
12745         (WTF::bitCount): The original patch put the parentheses in the wrong
12746         place, completely changing the calculation and making it almost always
12747         wrong. Moved the parentheses around the '+' operation, like the original
12748         compiler warning suggested.
12749
12750 2009-12-14  Gabor Loki  <loki@inf.u-szeged.hu>
12751
12752         Unreviewed trivial buildfix.
12753
12754         Fix crosses initialization of usedPrimaryBlocks for JSValue32
12755
12756         * runtime/Collector.cpp:
12757         (JSC::Heap::markConservatively):
12758
12759 2009-12-14  Csaba Osztrogonác  <ossy@webkit.org>
12760
12761         Reviewed by Simon Hausmann.
12762
12763         GCC 4.3.x warning fixed. Suggested parantheses added.
12764         warning: ../../../JavaScriptCore/wtf/StdLibExtras.h:77: warning: suggest parentheses around + or - in operand of &
12765
12766         * wtf/StdLibExtras.h:
12767         (WTF::bitCount):
12768
12769 2009-12-13  Geoffrey Garen  <ggaren@apple.com>
12770
12771         Reviewed by Sam Weinig.
12772         
12773         Changed GC from mark-sweep to mark-allocate.
12774         
12775         Added WeakGCMap to keep WebCore blissfully ignorant about objects that
12776         have become garbage but haven't run their destructors yet.
12777         
12778         1% SunSpider speedup.
12779         7.6% v8 speedup (37% splay speedup).
12780         17% speedup on bench-alloc-nonretained.js.
12781         18% speedup on bench-alloc-retained.js.
12782
12783         * API/JSBase.cpp:
12784         (JSGarbageCollect):
12785         * API/JSContextRef.cpp:
12786         * JavaScriptCore.exp:
12787         * JavaScriptCore.xcodeproj/project.pbxproj: Updated for renames and new
12788         files.
12789
12790         * debugger/Debugger.cpp:
12791         (JSC::Debugger::recompileAllJSFunctions): Updated to use the Collector
12792         iterator abstraction.
12793
12794         * jsc.cpp:
12795         (functionGC): Updated for rename.
12796
12797         * runtime/Collector.cpp: Slightly reduced the number of allocations per
12798         collection, so that small workloads only allocate on collector block,
12799         rather than two.
12800
12801         (JSC::Heap::Heap): Updated to use the new allocateBlock function.
12802
12803         (JSC::Heap::destroy): Updated to use the new freeBlocks function.
12804
12805         (JSC::Heap::allocateBlock): New function to initialize a block when
12806         allocating it.
12807
12808         (JSC::Heap::freeBlock): Consolidated the responsibility for running
12809         destructors into this function.
12810
12811         (JSC::Heap::freeBlocks): Updated to use freeBlock.
12812
12813         (JSC::Heap::recordExtraCost): Sweep the heap in this reporting function,
12814         so that allocation, which is more common, doesn't have to check extraCost.
12815
12816         (JSC::Heap::heapAllocate): Run destructors right before recycling a
12817         garbage cell. This has better cache utilization than a separate sweep phase.
12818
12819         (JSC::Heap::resizeBlocks):
12820         (JSC::Heap::growBlocks):
12821         (JSC::Heap::shrinkBlocks): New set of functions for managing the size of
12822         the heap, now that the heap doesn't maintain any information about its
12823         size.
12824
12825         (JSC::isPointerAligned):
12826         (JSC::isHalfCellAligned):
12827         (JSC::isPossibleCell):
12828         (JSC::isCellAligned):
12829         (JSC::Heap::markConservatively): Cleaned up this code a bit.
12830
12831         (JSC::Heap::clearMarkBits):
12832         (JSC::Heap::markedCells): Some helper functions for examining the the mark
12833         bitmap.
12834
12835         (JSC::Heap::sweep): Simplified this function by using a DeadObjectIterator.
12836
12837         (JSC::Heap::markRoots): Reordered some operations for clarity.
12838
12839         (JSC::Heap::objectCount):
12840         (JSC::Heap::addToStatistics):
12841         (JSC::Heap::statistics): Rewrote these functions to calculate an object
12842         count on demand, since the heap doesn't maintain this information by 
12843         itself.
12844
12845         (JSC::Heap::reset): New function for resetting the heap once we've
12846         exhausted heap space.
12847
12848         (JSC::Heap::collectAllGarbage): This function matches the old collect()
12849         behavior, but it's now an uncommon function used only by API.
12850
12851         * runtime/Collector.h:
12852         (JSC::CollectorBitmap::count):
12853         (JSC::CollectorBitmap::isEmpty): Added some helper functions for managing
12854         the collector mark bitmap.
12855
12856         (JSC::Heap::reportExtraMemoryCost): Changed reporting from cell equivalents
12857         to bytes, so it's easier to understand.
12858         
12859         * runtime/CollectorHeapIterator.h:
12860         (JSC::CollectorHeapIterator::CollectorHeapIterator):
12861         (JSC::CollectorHeapIterator::operator!=):
12862         (JSC::CollectorHeapIterator::operator*):
12863         (JSC::CollectorHeapIterator::advance):
12864         (JSC::::LiveObjectIterator):
12865         (JSC::::operator):
12866         (JSC::::DeadObjectIterator):
12867         (JSC::::ObjectIterator): New iterators for encapsulating details about
12868         heap layout, and what's live and dead on the heap.
12869
12870         * runtime/JSArray.cpp:
12871         (JSC::JSArray::putSlowCase):
12872         (JSC::JSArray::increaseVectorLength): Delay reporting extra cost until
12873         we're fully constructed, so the heap mark phase won't visit us in an
12874         invalid state.
12875
12876         * runtime/JSCell.h:
12877         (JSC::JSCell::):
12878         (JSC::JSCell::createDummyStructure):
12879         (JSC::JSCell::JSCell):
12880         * runtime/JSGlobalData.cpp:
12881         (JSC::JSGlobalData::JSGlobalData):
12882         * runtime/JSGlobalData.h: Added a dummy cell to simplify allocation logic.
12883
12884         * runtime/JSString.h:
12885         (JSC::jsSubstring): Don't report extra cost for substrings, since they
12886         share a buffer that's already reported extra cost.
12887
12888         * runtime/Tracing.d:
12889         * runtime/Tracing.h: Changed these dtrace hooks not to report object
12890         counts, since they're no longer cheap to compute.
12891
12892         * runtime/UString.h: Updated for renames.
12893
12894         * runtime/WeakGCMap.h: Added.
12895         (JSC::WeakGCMap::isEmpty):
12896         (JSC::WeakGCMap::uncheckedGet):
12897         (JSC::WeakGCMap::uncheckedBegin):
12898         (JSC::WeakGCMap::uncheckedEnd):
12899         (JSC::::get):
12900         (JSC::::take):
12901         (JSC::::set):
12902         (JSC::::uncheckedRemove): Mentioned above.
12903
12904         * wtf/StdLibExtras.h:
12905         (WTF::bitCount): Added a bit population count function, so the heap can
12906         count live objects to fulfill statistics questions.
12907
12908 The very last cell in the block is not allocated -- should not be marked.
12909
12910 2009-12-13  Geoffrey Garen  <ggaren@apple.com>
12911
12912         Windows build fix: Export some new symbols.
12913
12914         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
12915
12916 2009-12-13  Geoffrey Garen  <ggaren@apple.com>
12917
12918         Windows build fix: Removed some old exports.
12919
12920         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
12921
12922 2009-12-13  Geoffrey Garen  <ggaren@apple.com>
12923
12924         Windows build fix: Use unsigned instead of uint32_t to avoid dependencies.
12925
12926         * wtf/StdLibExtras.h:
12927         (WTF::bitCount):
12928
12929 2009-12-13  Gavin Barraclough  <barraclough@apple.com>
12930
12931         Reviewed by NOBODY (speculative Windows build fix).
12932
12933         * runtime/JSGlobalObjectFunctions.cpp:
12934
12935 2009-12-13  Gavin Barraclough  <barraclough@apple.com>
12936
12937         Reviewed by Sam Weinig.
12938
12939         https://bugs.webkit.org/show_bug.cgi?id=32496
12940         Switch remaining cases of string construction to use StringBuilder.
12941         Builds strings using a vector rather than using string append / addition.
12942
12943         * JavaScriptCore.exp:
12944         * JavaScriptCore.xcodeproj/project.pbxproj:
12945         * runtime/Executable.cpp:
12946         (JSC::FunctionExecutable::paramString):
12947         * runtime/FunctionConstructor.cpp:
12948         (JSC::constructFunction):
12949         * runtime/JSGlobalObjectFunctions.cpp:
12950         (JSC::encode):
12951         (JSC::decode):
12952         (JSC::globalFuncEscape):
12953         (JSC::globalFuncUnescape):
12954         * runtime/JSONObject.cpp:
12955         (JSC::Stringifier::stringify):
12956         (JSC::Stringifier::indent):
12957         * runtime/JSString.h:
12958         * runtime/LiteralParser.cpp:
12959         (JSC::LiteralParser::Lexer::lexString):
12960         * runtime/NumberPrototype.cpp:
12961         (JSC::integerPartNoExp):
12962         (JSC::numberProtoFuncToFixed):
12963         (JSC::numberProtoFuncToPrecision):
12964         * runtime/Operations.h:
12965         (JSC::jsString):
12966         * runtime/StringPrototype.cpp:
12967         (JSC::substituteBackreferencesSlow):
12968         (JSC::substituteBackreferences):
12969         (JSC::stringProtoFuncConcat):
12970
12971 2009-12-08  Jeremy Moskovich  <jeremy@chromium.org>
12972
12973         Reviewed by Eric Seidel.
12974
12975         Add code to allow toggling ATSUI/Core Text rendering at runtime in ComplexTextController.
12976         https://bugs.webkit.org/show_bug.cgi?id=31802
12977
12978         The goal here is to allow for a zero runtime hit for ports that decide to select
12979         the API at compile time.
12980         When both USE(ATSUI) and USE(CORE_TEXT) are true, the API is toggled
12981         at runtime.  Core Text is used for OS Versions >= 10.6.
12982
12983         * wtf/Platform.h: #define USE_CORE_TEXT and USE_ATSUI on Chrome/Mac.
12984
12985 2009-12-11  Maciej Stachowiak  <mjs@apple.com>
12986
12987         Reviewed by Oliver Hunt.
12988
12989         Unify codegen for forward and backward variants of branches
12990         https://bugs.webkit.org/show_bug.cgi?id=32463
12991
12992         * jit/JIT.h:
12993         (JSC::JIT::emit_op_loop): Implemented in terms of forward variant.
12994         (JSC::JIT::emit_op_loop_if_true): ditto
12995         (JSC::JIT::emitSlow_op_loop_if_true): ditto
12996         (JSC::JIT::emit_op_loop_if_false): ditto
12997         (JSC::JIT::emitSlow_op_loop_if_false): ditto
12998         (JSC::JIT::emit_op_loop_if_less): ditto
12999         (JSC::JIT::emitSlow_op_loop_if_less): ditto
13000         * jit/JITOpcodes.cpp:
13001
13002 2009-12-11  Sam Weinig  <sam@webkit.org>
13003
13004         Reviewed by Anders Carlsson.
13005
13006         Allow WTFs concept of the main thread to differ from pthreads when necessary.
13007
13008         * wtf/ThreadingPthreads.cpp:
13009         (WTF::initializeThreading):
13010         (WTF::isMainThread):
13011         * wtf/mac/MainThreadMac.mm:
13012         (WTF::initializeMainThreadPlatform):
13013         (WTF::scheduleDispatchFunctionsOnMainThread):
13014
13015 2009-12-11  Gavin Barraclough  <barraclough@apple.com>
13016
13017         Reviewed by Oliver Hunt.
13018
13019         https://bugs.webkit.org/show_bug.cgi?id=32454
13020         Refactor construction of simple strings to avoid string concatenation.
13021
13022         Building strings through concatenation has a memory and performance cost -
13023         a memory cost since we must over-allocate the buffer to leave space to append
13024         into, and performance in that the string may still require reallocation (and
13025         thus copying during construction).  Instead move the full construction to
13026         within a single function call (makeString), so that the arguments' lengths
13027         can be calculated and an appropriate sized buffer allocated before copying
13028         any characters.
13029
13030         ~No performance change (~2% progression on date tests).
13031
13032         * bytecode/CodeBlock.cpp:
13033         (JSC::escapeQuotes):
13034         (JSC::valueToSourceString):
13035         (JSC::constantName):
13036         (JSC::idName):
13037         (JSC::CodeBlock::registerName):
13038         (JSC::regexpToSourceString):
13039         (JSC::regexpName):
13040         * bytecompiler/NodesCodegen.cpp:
13041         (JSC::substitute):
13042         * profiler/Profiler.cpp:
13043         (JSC::Profiler::createCallIdentifier):
13044         * runtime/DateConstructor.cpp:
13045         (JSC::callDate):
13046         * runtime/DateConversion.cpp:
13047         (JSC::formatDate):
13048         (JSC::formatDateUTCVariant):
13049         (JSC::formatTime):
13050         (JSC::formatTimeUTC):
13051         * runtime/DateConversion.h:
13052         (JSC::):
13053         * runtime/DatePrototype.cpp:
13054         (JSC::dateProtoFuncToString):
13055         (JSC::dateProtoFuncToUTCString):
13056         (JSC::dateProtoFuncToDateString):
13057         (JSC::dateProtoFuncToTimeString):
13058         (JSC::dateProtoFuncToGMTString):
13059         * runtime/ErrorPrototype.cpp:
13060         (JSC::errorProtoFuncToString):
13061         * runtime/ExceptionHelpers.cpp:
13062         (JSC::createUndefinedVariableError):
13063         (JSC::createErrorMessage):
13064         (JSC::createInvalidParamError):
13065         * runtime/FunctionPrototype.cpp:
13066         (JSC::insertSemicolonIfNeeded):
13067         (JSC::functionProtoFuncToString):
13068         * runtime/ObjectPrototype.cpp:
13069         (JSC::objectProtoFuncToString):
13070         * runtime/RegExpConstructor.cpp:
13071         (JSC::constructRegExp):
13072         * runtime/RegExpObject.cpp:
13073         (JSC::RegExpObject::match):
13074         * runtime/RegExpPrototype.cpp:
13075         (JSC::regExpProtoFuncCompile):
13076         (JSC::regExpProtoFuncToString):
13077         * runtime/StringPrototype.cpp:
13078         (JSC::stringProtoFuncBig):
13079         (JSC::stringProtoFuncSmall):
13080         (JSC::stringProtoFuncBlink):
13081         (JSC::stringProtoFuncBold):
13082         (JSC::stringProtoFuncFixed):
13083         (JSC::stringProtoFuncItalics):
13084         (JSC::stringProtoFuncStrike):
13085         (JSC::stringProtoFuncSub):
13086         (JSC::stringProtoFuncSup):
13087         (JSC::stringProtoFuncFontcolor):
13088         (JSC::stringProtoFuncFontsize):
13089         (JSC::stringProtoFuncAnchor):
13090         * runtime/UString.h:
13091         (JSC::):
13092         (JSC::makeString):
13093
13094 2009-12-10  Gavin Barraclough  <barraclough@apple.com>
13095
13096         Reviewed by Oliver Hunt.
13097
13098         https://bugs.webkit.org/show_bug.cgi?id=32400
13099         Switch remaining cases of string addition to use ropes.
13100
13101         Re-landing r51975 - added toPrimitiveString method,
13102         performs toPrimitive then subsequent toString operations.
13103
13104         ~1% progression on Sunspidey.
13105
13106         * jit/JITStubs.cpp:
13107         (JSC::DEFINE_STUB_FUNCTION):
13108         * runtime/JSString.h:
13109         (JSC::JSString::JSString):
13110         (JSC::JSString::appendStringInConstruct):
13111         * runtime/Operations.cpp:
13112         (JSC::jsAddSlowCase):
13113         * runtime/Operations.h:
13114         (JSC::jsString):
13115         (JSC::jsAdd):
13116
13117 2009-12-11  Adam Roben  <aroben@apple.com>
13118
13119         Windows build fix
13120
13121         * JavaScriptCore.vcproj/jsc/jscCommon.vsprops: Added
13122         $(WebKitOutputDir)/include/private to the include path.
13123
13124 2009-12-11  Adam Roben  <aroben@apple.com>
13125
13126         Move QuartzCorePresent.h to include/private
13127
13128         This fixes other projects that use wtf/Platform.h
13129
13130         Rubber-stamped by Steve Falkenburg.
13131
13132         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Let VS do its thang.
13133         * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh: Write
13134         QuartzCorePresent.h to $(WebKitOutputDir)/include/private.
13135
13136         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
13137         * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops:
13138         Added $(WebKitOutputDir)/include/private to the include path.
13139
13140 2009-12-11  Adam Roben  <aroben@apple.com>
13141
13142         Fix clean builds and everything rebuilding on every build
13143
13144         Reviewed by Sam Weinig.
13145
13146         * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh: Don't
13147         write out QuartzCorePresent.h if it exists but is older than
13148         QuartzCore.h. Also, create the directory we write QuartzCorePresent.h
13149         into first.
13150
13151 2009-12-11  Adam Roben  <aroben@apple.com>
13152
13153         Windows build fix for systems with spaces in their paths
13154
13155         * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh: Quote some paths.
13156
13157 2009-12-11  Chris Marrin  <cmarrin@apple.com>
13158
13159         Reviewed by Adam Roben.
13160
13161         Add check for presence of QuartzCore headers
13162         https://bugs.webkit.org/show_bug.cgi?id=31856
13163         
13164         The script now checks for the presence of QuartzCore.h. If present
13165         it will turn on ACCELERATED_COMPOSITING and 3D_RENDERING to enable
13166         HW compositing on Windows. The script writes QuartzCorePresent.h to
13167         the build directory which has a define telling whether QuartzCore is 
13168         present.
13169
13170         * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
13171         * wtf/Platform.h:
13172
13173 2009-12-11  Kent Tamura  <tkent@chromium.org>
13174
13175         Reviewed by Darin Adler.
13176
13177         Fix a problem that JSC::gregorianDateTimeToMS() returns a negative
13178         value for a huge year value.
13179         https://bugs.webkit.org/show_bug.cgi?id=32304
13180
13181         * wtf/DateMath.cpp:
13182         (WTF::dateToDaysFrom1970): Renamed from dateToDayInYear, and changed the return type to double.
13183         (WTF::calculateDSTOffset): Follow the dateToDaysFrom1970() change.
13184         (WTF::timeClip): Use maxECMAScriptTime.
13185         (JSC::gregorianDateTimeToMS): Follow the dateToDaysFrom1970() change.
13186
13187 2009-12-10  Adam Barth  <abarth@webkit.org>
13188
13189         No review, rolling out r51975.
13190         http://trac.webkit.org/changeset/51975
13191
13192         * jit/JITStubs.cpp:
13193         (JSC::DEFINE_STUB_FUNCTION):
13194         * runtime/JSString.h:
13195         (JSC::JSString::JSString):
13196         (JSC::JSString::appendStringInConstruct):
13197         * runtime/Operations.cpp:
13198         (JSC::jsAddSlowCase):
13199         * runtime/Operations.h:
13200         (JSC::jsString):
13201         (JSC::jsAdd):
13202
13203 2009-12-10  Oliver Hunt  <oliver@apple.com>
13204
13205         Reviewed by Gavin Barraclough.
13206
13207         Incorrect caching of prototype lookup with dictionary base
13208         https://bugs.webkit.org/show_bug.cgi?id=32402
13209
13210         Make sure we don't add cached prototype lookup to the proto_list
13211         lookup chain if the top level object is a dictionary.
13212
13213         * jit/JITStubs.cpp:
13214         (JSC::JITThunks::tryCacheGetByID):
13215
13216 2009-12-10  Gavin Barraclough  <barraclough@apple.com>
13217
13218         Reviewed by Oliver Hunt.
13219
13220         https://bugs.webkit.org/show_bug.cgi?id=32400
13221         Switch remaining cases of string addition to use ropes.
13222
13223         ~1% progression on Sunspidey.
13224
13225         * jit/JITStubs.cpp:
13226         (JSC::DEFINE_STUB_FUNCTION):
13227         * runtime/JSString.h:
13228         (JSC::JSString::JSString):
13229         (JSC::JSString::appendStringInConstruct):
13230         * runtime/Operations.cpp:
13231         (JSC::jsAddSlowCase):
13232         * runtime/Operations.h:
13233         (JSC::jsString):
13234         (JSC::jsAdd):
13235
13236 2009-12-10  Kent Hansen  <kent.hansen@nokia.com>
13237
13238         Reviewed by Geoffrey Garen.
13239
13240         Remove JSObject::getPropertyAttributes() and all usage of it.
13241         https://bugs.webkit.org/show_bug.cgi?id=31933
13242
13243         getOwnPropertyDescriptor() should be used instead.
13244
13245         * JavaScriptCore.exp:
13246         * JavaScriptCore.order:
13247         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
13248         * debugger/DebuggerActivation.cpp:
13249         (JSC::DebuggerActivation::getOwnPropertyDescriptor):
13250         * debugger/DebuggerActivation.h:
13251         * runtime/JSObject.cpp:
13252         (JSC::JSObject::propertyIsEnumerable):
13253         * runtime/JSObject.h:
13254         * runtime/JSVariableObject.cpp:
13255         * runtime/JSVariableObject.h:
13256
13257 2009-12-10  Gavin Barraclough  <barraclough@apple.com>
13258
13259         Reviewed by Oliver Hunt & Mark Rowe.
13260
13261         https://bugs.webkit.org/show_bug.cgi?id=32367
13262         Add support for short Ropes (up to 3 entries) inline within JSString.
13263         (rather than externally allocating an object to hold the rope).
13264         Switch jsAdd of (JSString* + JSString*) to now make use of Ropes.
13265
13266         ~1% progression on Sunspidey.
13267
13268         * interpreter/Interpreter.cpp:
13269         (JSC::Interpreter::privateExecute):
13270         * jit/JITOpcodes.cpp:
13271         (JSC::JIT::privateCompileCTIMachineTrampolines):
13272         * jit/JITStubs.cpp:
13273         (JSC::DEFINE_STUB_FUNCTION):
13274         * runtime/JSString.cpp:
13275         (JSC::JSString::resolveRope):
13276         (JSC::JSString::toBoolean):
13277         (JSC::JSString::getStringPropertyDescriptor):
13278         * runtime/JSString.h:
13279         (JSC::JSString::Rope::Fiber::deref):
13280         (JSC::JSString::Rope::Fiber::ref):
13281         (JSC::JSString::Rope::Fiber::refAndGetLength):
13282         (JSC::JSString::Rope::append):
13283         (JSC::JSString::JSString):
13284         (JSC::JSString::~JSString):
13285         (JSC::JSString::value):
13286         (JSC::JSString::tryGetValue):
13287         (JSC::JSString::length):
13288         (JSC::JSString::canGetIndex):
13289         (JSC::JSString::appendStringInConstruct):
13290         (JSC::JSString::appendValueInConstructAndIncrementLength):
13291         (JSC::JSString::isRope):
13292         (JSC::JSString::string):
13293         (JSC::JSString::ropeLength):
13294         (JSC::JSString::getStringPropertySlot):
13295         * runtime/Operations.h:
13296         (JSC::jsString):
13297         (JSC::jsAdd):
13298         (JSC::resolveBase):
13299
13300 2009-12-09  Anders Carlsson  <andersca@apple.com>
13301
13302         Reviewed by Geoffrey Garen.
13303
13304         Fix three more things found by compiling with clang++.
13305         
13306         * runtime/Structure.h:
13307         (JSC::StructureTransitionTable::reifySingleTransition):
13308         Add the 'std' qualifier to the call to make_pair.
13309
13310         * wtf/DateMath.cpp:
13311         (WTF::initializeDates):
13312         Incrementing a bool is deprecated according to the C++ specification.
13313         
13314         * wtf/PtrAndFlags.h:
13315         (WTF::PtrAndFlags::PtrAndFlags):
13316         Name lookup should not be done in dependent bases, so explicitly qualify the call to set.
13317
13318 2009-12-09  Maciej Stachowiak  <mjs@apple.com>
13319
13320         Reviewed by Oliver Hunt.
13321
13322         Google reader gets stuck in the "Loading..." state and does not complete
13323         https://bugs.webkit.org/show_bug.cgi?id=32256
13324         <rdar://problem/7456388>
13325
13326         * jit/JITArithmetic.cpp:
13327         (JSC::JIT::emitSlow_op_jless): Fix some backward branches.
13328
13329 2009-12-09  Gavin Barraclough  <barraclough@apple.com>
13330
13331         Reviewed by Oliver Hunt.
13332
13333         https://bugs.webkit.org/show_bug.cgi?id=32228
13334         Make destruction of ropes non-recursive to prevent stack exhaustion.
13335         Also, pass a UString& into initializeFiber rather than a Ustring::Rep*,
13336         since the Rep is not being ref counted this could result in usage of a
13337         Rep with refcount zero (where the Rep comes from a temporary UString
13338         returned from a function).
13339
13340         * runtime/JSString.cpp:
13341         (JSC::JSString::Rope::destructNonRecursive):
13342         (JSC::JSString::Rope::~Rope):
13343         * runtime/JSString.h:
13344         (JSC::JSString::Rope::initializeFiber):
13345         * runtime/Operations.h:
13346         (JSC::concatenateStrings):
13347
13348 2009-12-09  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
13349
13350         Reviewed by Eric Seidel.
13351
13352         https://bugs.webkit.org/show_bug.cgi?id=31930
13353
13354         Update to r51457. ASSERTs changed to COMPILE_ASSERTs.
13355         The speedup is 25%.
13356
13357         * runtime/JSGlobalData.cpp:
13358         (JSC::VPtrSet::VPtrSet):
13359
13360 2009-12-09  Steve Block  <steveblock@google.com>
13361
13362         Reviewed by Adam Barth.
13363
13364         Updates Android Makefiles with latest additions.
13365         https://bugs.webkit.org/show_bug.cgi?id=32278
13366
13367         * Android.mk: Modified.
13368         * Android.v8.wtf.mk: Modified.
13369
13370 2009-12-09  Sam Weinig  <sam@webkit.org>
13371
13372         Reviewed by Gavin Barraclough.
13373
13374         Fix a bug found while trying to compile JavaScriptCore with clang++.
13375
13376         * yarr/RegexPattern.h:
13377         (JSC::Yarr::PatternTerm::PatternTerm): Don't self assign here.  Use false instead.
13378
13379 2009-12-09  Anders Carlsson  <andersca@apple.com>
13380
13381         Reviewed by Sam Weinig.
13382
13383         Attempt to fix the Windows build.
13384         
13385         * wtf/FastMalloc.h:
13386
13387 2009-12-09  Anders Carlsson  <andersca@apple.com>
13388
13389         Reviewed by Sam Weinig.
13390
13391         Fix some things found while trying to compile JavaScriptCore with clang++.
13392
13393         * wtf/FastMalloc.h:
13394         Add correct exception specifications for the allocation/deallocation operators.
13395         
13396         * wtf/Vector.h:
13397         * wtf/VectorTraits.h:
13398         Fix a bunch of struct/class mismatches.
13399
13400 2009-12-08  Maciej Stachowiak  <mjs@apple.com>
13401
13402         Reviewed by Darin Adler.
13403
13404         move code generation portions of Nodes.cpp to bytecompiler directory
13405         https://bugs.webkit.org/show_bug.cgi?id=32284
13406
13407         * bytecompiler/NodesCodegen.cpp: Copied from parser/Nodes.cpp. Removed parts that
13408         are not about codegen.
13409         * parser/Nodes.cpp: Removed everything that is about codegen.
13410
13411         Update build systems:
13412         
13413         * Android.mk:
13414         * GNUmakefile.am:
13415         * JavaScriptCore.gypi:
13416         * JavaScriptCore.pri:
13417         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
13418         * JavaScriptCore.xcodeproj/project.pbxproj:
13419         * JavaScriptCoreSources.bkl:
13420
13421 2009-12-08  Kevin Watters  <kevinwatters@gmail.com>
13422
13423         Reviewed by Kevin Ollivier.
13424
13425         [wx] Mac plugins support.
13426         
13427         https://bugs.webkit.org/show_bug.cgi?id=32236
13428
13429         * wtf/Platform.h:
13430
13431 2009-12-08  Dmitry Titov  <dimich@chromium.org>
13432
13433         Rubber-stamped by David Levin.
13434
13435         Revert and reopen "Add asserts to RefCounted to make sure ref/deref happens on the right thread."
13436         It may have caused massive increase of reported leaks on the bots.
13437         https://bugs.webkit.org/show_bug.cgi?id=31639
13438
13439         * GNUmakefile.am:
13440         * JavaScriptCore.gypi:
13441         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
13442         * JavaScriptCore.xcodeproj/project.pbxproj:
13443         * runtime/Structure.cpp:
13444         (JSC::Structure::Structure):
13445         * wtf/RefCounted.h:
13446         (WTF::RefCountedBase::ref):
13447         (WTF::RefCountedBase::hasOneRef):
13448         (WTF::RefCountedBase::refCount):
13449         (WTF::RefCountedBase::derefBase):
13450         * wtf/ThreadVerifier.h: Removed.
13451
13452 2009-12-08  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
13453
13454         Reviewed by Darin Adler.
13455
13456         Make WebKit build correctly on FreeBSD, IA64, and Alpha.
13457         Based on work by Petr Salinger <Petr.Salinger@seznam.cz>,
13458         and Colin Watson <cjwatson@ubuntu.com>.
13459
13460         * wtf/Platform.h:
13461
13462 2009-12-08  Dmitry Titov  <dimich@chromium.org>
13463
13464         Reviewed by Darin Adler.
13465
13466         Add asserts to RefCounted to make sure ref/deref happens on the right thread.
13467         https://bugs.webkit.org/show_bug.cgi?id=31639
13468
13469         * runtime/Structure.cpp:
13470         (JSC::Structure::Structure): Disable thread verification on this class since it uses addressOfCount().
13471         * wtf/RefCounted.h:
13472         (WTF::RefCountedBase::ref): Add ASSERT.
13473         (WTF::RefCountedBase::hasOneRef): Ditto.
13474         (WTF::RefCountedBase::refCount): Ditto.
13475         (WTF::RefCountedBase::derefBase): Ditto.
13476         (WTF::RefCountedBase::disableThreadVerification): delegate to ThreadVerifier method.
13477         * wtf/ThreadVerifier.h: Added.
13478         (WTF::ThreadVerifier::ThreadVerifier): New Debug-only class to verify that ref/deref of RefCounted is done on the same thread.
13479         (WTF::ThreadVerifier::activate): Activates checks. Called when ref count becomes above 2.
13480         (WTF::ThreadVerifier::deactivate): Deactivates checks. Called when ref count drops below 2.
13481         (WTF::ThreadVerifier::disableThreadVerification): used on objects that should not be checked (StringImpl etc)
13482         (WTF::ThreadVerifier::verifyThread):
13483         * GNUmakefile.am: Add ThreadVerifier.h to the build file.
13484         * JavaScriptCore.gypi: Ditto.
13485         * JavaScriptCore.vcproj/WTF/WTF.vcproj: Ditto.
13486         * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
13487
13488 2009-12-08  Steve Block  <steveblock@google.com>
13489
13490         Reviewed by Adam Barth.
13491
13492         [Android] Adds Makefiles for Android port.
13493         https://bugs.webkit.org/show_bug.cgi?id=31325
13494
13495         * Android.mk: Added.
13496         * Android.v8.wtf.mk: Added.
13497
13498 2009-12-07  Dmitry Titov  <dimich@chromium.org>
13499
13500         Rubber-stamped by Darin Adler.
13501
13502         Remove ENABLE_SHARED_SCRIPT flags
13503         https://bugs.webkit.org/show_bug.cgi?id=32245
13504         This patch was obtained by "git revert" command and then un-reverting of ChangeLog files.
13505
13506         * Configurations/FeatureDefines.xcconfig:
13507         * wtf/Platform.h:
13508
13509 2009-12-07  Gavin Barraclough  <barraclough@apple.com>
13510
13511         Reviewed by NOBODY (Windows build fixage part I).
13512
13513         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
13514
13515 2009-12-05  Gavin Barraclough  <barraclough@apple.com>
13516
13517         Reviewed by Oliver Hunt.
13518
13519         https://bugs.webkit.org/show_bug.cgi?id=32184
13520         Handle out-of-memory conditions with JSC Ropes with a JS exception, rather than crashing.
13521         Switch from using fastMalloc to tryFastMalloc, pass an ExecState to record the exception on.
13522
13523         * API/JSCallbackObjectFunctions.h:
13524         (JSC::::toString):
13525         * API/JSValueRef.cpp:
13526         (JSValueIsStrictEqual):
13527         * JavaScriptCore.exp:
13528         * bytecompiler/BytecodeGenerator.cpp:
13529         (JSC::BytecodeGenerator::emitEqualityOp):
13530         * debugger/DebuggerCallFrame.cpp:
13531         (JSC::DebuggerCallFrame::functionName):
13532         (JSC::DebuggerCallFrame::calculatedFunctionName):
13533         * interpreter/Interpreter.cpp:
13534         (JSC::Interpreter::callEval):
13535         (JSC::Interpreter::privateExecute):
13536         * jit/JITStubs.cpp:
13537         (JSC::DEFINE_STUB_FUNCTION):
13538         * profiler/ProfileGenerator.cpp:
13539         (JSC::ProfileGenerator::addParentForConsoleStart):
13540         * profiler/Profiler.cpp:
13541         (JSC::Profiler::willExecute):
13542         (JSC::Profiler::didExecute):
13543         (JSC::Profiler::createCallIdentifier):
13544         (JSC::createCallIdentifierFromFunctionImp):
13545         * profiler/Profiler.h:
13546         * runtime/ArrayPrototype.cpp:
13547         (JSC::arrayProtoFuncIndexOf):
13548         (JSC::arrayProtoFuncLastIndexOf):
13549         * runtime/DateConstructor.cpp:
13550         (JSC::constructDate):
13551         * runtime/FunctionPrototype.cpp:
13552         (JSC::functionProtoFuncToString):
13553         * runtime/InternalFunction.cpp:
13554         (JSC::InternalFunction::name):
13555         (JSC::InternalFunction::displayName):
13556         (JSC::InternalFunction::calculatedDisplayName):
13557         * runtime/InternalFunction.h:
13558         * runtime/JSCell.cpp:
13559         (JSC::JSCell::getString):
13560         * runtime/JSCell.h:
13561         (JSC::JSValue::getString):
13562         * runtime/JSONObject.cpp:
13563         (JSC::gap):
13564         (JSC::Stringifier::Stringifier):
13565         (JSC::Stringifier::appendStringifiedValue):
13566         * runtime/JSObject.cpp:
13567         (JSC::JSObject::putDirectFunction):
13568         (JSC::JSObject::putDirectFunctionWithoutTransition):
13569         (JSC::JSObject::defineOwnProperty):
13570         * runtime/JSObject.h:
13571         * runtime/JSPropertyNameIterator.cpp:
13572         (JSC::JSPropertyNameIterator::get):
13573         * runtime/JSString.cpp:
13574         (JSC::JSString::Rope::~Rope):
13575         (JSC::JSString::resolveRope):
13576         (JSC::JSString::getPrimitiveNumber):
13577         (JSC::JSString::toNumber):
13578         (JSC::JSString::toString):
13579         (JSC::JSString::toThisString):
13580         (JSC::JSString::getStringPropertyDescriptor):
13581         * runtime/JSString.h:
13582         (JSC::JSString::Rope::createOrNull):
13583         (JSC::JSString::Rope::operator new):
13584         (JSC::JSString::value):
13585         (JSC::JSString::tryGetValue):
13586         (JSC::JSString::getIndex):
13587         (JSC::JSString::getStringPropertySlot):
13588         (JSC::JSValue::toString):
13589         * runtime/JSValue.h:
13590         * runtime/NativeErrorConstructor.cpp:
13591         (JSC::NativeErrorConstructor::NativeErrorConstructor):
13592         * runtime/Operations.cpp:
13593         (JSC::JSValue::strictEqualSlowCase):
13594         * runtime/Operations.h:
13595         (JSC::JSValue::equalSlowCaseInline):
13596         (JSC::JSValue::strictEqualSlowCaseInline):
13597         (JSC::JSValue::strictEqual):
13598         (JSC::jsLess):
13599         (JSC::jsLessEq):
13600         (JSC::jsAdd):
13601         (JSC::concatenateStrings):
13602         * runtime/PropertyDescriptor.cpp:
13603         (JSC::PropertyDescriptor::equalTo):
13604         * runtime/PropertyDescriptor.h:
13605         * runtime/StringPrototype.cpp:
13606         (JSC::stringProtoFuncReplace):
13607         (JSC::stringProtoFuncToLowerCase):
13608         (JSC::stringProtoFuncToUpperCase):
13609
13610 2009-12-07  Nikolas Zimmermann  <nzimmermann@rim.com>
13611
13612         Reviewed by Holger Freyther.
13613
13614         Turn on (SVG) Filters support, by default.
13615         https://bugs.webkit.org/show_bug.cgi?id=32224
13616
13617         * Configurations/FeatureDefines.xcconfig: Enable FILTERS build flag.
13618
13619 2009-12-07  Steve Falkenburg  <sfalken@apple.com>
13620
13621         Build fix. Be flexible about which version of ICU is used on Windows.
13622
13623         * JavaScriptCore.vcproj/jsc/jscCommon.vsprops: Add optional xcopy commands to copy ICU 4.2.
13624
13625 2009-12-07  Maciej Stachowiak  <mjs@apple.com>
13626
13627         Reviewed by Oliver Hunt.
13628
13629         op_loop_if_less JIT codegen is broken for 64-bit
13630         https://bugs.webkit.org/show_bug.cgi?id=32221
13631
13632         * jit/JITOpcodes.cpp:
13633         (JSC::JIT::emit_op_loop_if_false): Fix codegen in this version - test was backwards.
13634
13635 2009-12-07  Oliver Hunt  <oliver@apple.com>
13636
13637         Reviewed by Maciej Stachowiak.
13638
13639         Object.create fails if properties on the descriptor are getters
13640         https://bugs.webkit.org/show_bug.cgi?id=32219
13641
13642         Correctly initialise the PropertySlots with the descriptor object.
13643
13644         * runtime/ObjectConstructor.cpp:
13645         (JSC::toPropertyDescriptor):
13646
13647 2009-12-06  Maciej Stachowiak  <mjs@apple.com>
13648
13649         Not reviewed, build fix.
13650
13651         Actually tested 64-bit *and* 32-bit build this time.
13652
13653         * jit/JITOpcodes.cpp:
13654         (JSC::JIT::emit_op_loop_if_false):
13655
13656 2009-12-06  Maciej Stachowiak  <mjs@apple.com>
13657
13658         Not reviewed, build fix.
13659
13660         Really really fix 64-bit build for prior patch (actually tested this time).
13661
13662         * jit/JITOpcodes.cpp:
13663         (JSC::JIT::emit_op_loop_if_false):
13664         (JSC::JIT::emitSlow_op_loop_if_false):
13665
13666 2009-12-06  Maciej Stachowiak  <mjs@apple.com>
13667
13668         Not reviewed, build fix.
13669
13670         Really fix 64-bit build for prior patch.
13671
13672         * jit/JITArithmetic.cpp:
13673         (JSC::JIT::emitSlow_op_jless):
13674
13675 2009-12-06  Maciej Stachowiak  <mjs@apple.com>
13676
13677         Not reviewed, build fix.
13678
13679         Fix 64-bit build for prior patch.
13680
13681         * jit/JITOpcodes.cpp:
13682         (JSC::JIT::emitSlow_op_loop_if_less):
13683
13684 2009-12-05  Maciej Stachowiak  <mjs@apple.com>
13685
13686         Reviewed by Oliver Hunt.
13687
13688         conway benchmark spends half it's time in op_less (jump fusion fails)
13689         https://bugs.webkit.org/show_bug.cgi?id=32190
13690
13691         <1% speedup on SunSpider and V8
13692         2x speedup on "conway" benchmark
13693         
13694         Two optimizations:
13695         1) Improve codegen for logical operators &&, || and ! in a condition context
13696         
13697         When generating code for combinations of &&, || and !, in a
13698         condition context (i.e. in an if statement or loop condition), we
13699         used to produce a value, and then separately jump based on its
13700         truthiness. Now we pass the false and true targets in, and let the
13701         logical operators generate jumps directly. This helps in four
13702         ways:
13703
13704         a) Individual clauses of a short-circuit logical operator can now
13705         jump directly to the then or else clause of an if statement (or to
13706         the top or exit of a loop) instead of jumping to a jump.
13707         
13708         b) It used to be that jump fusion with the condition of the first
13709         clause of a logical operator was inhibited, because the register
13710         was ref'd to be used later, in the actual condition jump; this no
13711         longer happens since a jump straight to the final target is
13712         generated directly.
13713
13714         c) It used to be that jump fusion with the condition of the second
13715         clause of a logical operator was inhibited, because there was a
13716         jump target right after the second clause and before the actual
13717         condition jump. But now it's no longer necessary for the first
13718         clause to jump there so jump fusion is not blocked.
13719
13720         d) We avoid generating excess mov statements in some cases.
13721         
13722         As a concrete example this source:
13723         
13724         if (!((x < q && y < q) || (t < q && z < q))) {
13725             // ...
13726         }
13727         
13728         Used to generate this bytecode:
13729         
13730         [  34] less              r1, r-15, r-19
13731         [  38] jfalse            r1, 7(->45)
13732         [  41] less              r1, r-16, r-19
13733         [  45] jtrue             r1, 14(->59)
13734         [  48] less              r1, r-17, r-19
13735         [  52] jfalse            r1, 7(->59)
13736         [  55] less              r1, r-18, r-19
13737         [  59] jtrue             r1, 17(->76)
13738         
13739         And now generates this bytecode (also taking advantage of the second optimization below):
13740         
13741         [  34] jnless            r-15, r-19, 8(->42)
13742         [  38] jless             r-16, r-19, 26(->64)
13743         [  42] jnless            r-17, r-19, 8(->50)
13744         [  46] jless             r-18, r-19, 18(->64)
13745         
13746         Note the jump fusion and the fact that there's less jump
13747         indirection - three of the four jumps go straight to the target
13748         clause instead of indirecting through another jump.
13749         
13750         2) Implement jless opcode to take advantage of the above, since we'll now often generate
13751         a less followed by a jtrue where fusion is not forbidden.
13752        
13753         * parser/Nodes.h:
13754         (JSC::ExpressionNode::hasConditionContextCodegen): Helper function to determine
13755         whether a node supports special conditional codegen. Return false as this is the default.
13756         (JSC::ExpressionNode::emitBytecodeInConditionContext): Assert not reached - only really
13757         defined for nodes that do have conditional codegen.
13758         (JSC::UnaryOpNode::expr): Add const version.
13759         (JSC::LogicalNotNode::hasConditionContextCodegen): Returne true only if subexpression
13760         supports it.
13761         (JSC::LogicalOpNode::hasConditionContextCodegen): Return true.
13762         * parser/Nodes.cpp:
13763         (JSC::LogicalNotNode::emitBytecodeInConditionContext): Implemented - just swap
13764         the true and false targets for the child node.
13765         (JSC::LogicalOpNode::emitBytecodeInConditionContext): Implemented - handle jumps
13766         directly, improving codegen quality. Also handles further nested conditional codegen.
13767         (JSC::ConditionalNode::emitBytecode): Use condition context codegen when available.
13768         (JSC::IfNode::emitBytecode): ditto
13769         (JSC::IfElseNode::emitBytecode): ditto
13770         (JSC::DoWhileNode::emitBytecode): ditto
13771         (JSC::WhileNode::emitBytecode): ditto
13772         (JSC::ForNode::emitBytecode): ditto
13773
13774         * bytecode/Opcode.h: 
13775         - Added loop_if_false opcode - needed now that falsey jumps can be backwards.
13776         - Added jless opcode to take advantage of new fusion opportunities.
13777         * bytecode/CodeBlock.cpp:
13778         (JSC::CodeBlock::dump): Handle above.
13779         * bytecompiler/BytecodeGenerator.cpp:
13780         (JSC::BytecodeGenerator::emitJumpIfTrue): Add peephole for less + jtrue ==> jless.
13781         (JSC::BytecodeGenerator::emitJumpIfFalse): Add handling of backwrds falsey jumps.
13782         * bytecompiler/BytecodeGenerator.h:
13783         (JSC::BytecodeGenerator::emitNodeInConditionContext): Wrapper to handle tracking of
13784         overly deep expressions etc.
13785         * interpreter/Interpreter.cpp:
13786         (JSC::Interpreter::privateExecute): Implement the two new opcodes (loop_if_false, jless).
13787         * jit/JIT.cpp:
13788         (JSC::JIT::privateCompileMainPass): Implement JIT support for the two new opcodes.
13789         (JSC::JIT::privateCompileSlowCases): ditto
13790         * jit/JIT.h:
13791         * jit/JITArithmetic.cpp:
13792         (JSC::JIT::emit_op_jless):
13793         (JSC::JIT::emitSlow_op_jless): ditto
13794         (JSC::JIT::emitBinaryDoubleOp): ditto
13795         * jit/JITOpcodes.cpp:
13796         (JSC::JIT::emitSlow_op_loop_if_less): ditto
13797         (JSC::JIT::emit_op_loop_if_false): ditto
13798         (JSC::JIT::emitSlow_op_loop_if_false): ditto
13799         * jit/JITStubs.cpp:
13800         * jit/JITStubs.h:
13801         (JSC::):
13802
13803 2009-12-04  Kent Hansen  <kent.hansen@nokia.com>
13804
13805         Reviewed by Darin Adler.
13806
13807         JavaScript delete operator should return false for string properties
13808         https://bugs.webkit.org/show_bug.cgi?id=32012
13809
13810         * runtime/StringObject.cpp:
13811         (JSC::StringObject::deleteProperty):
13812
13813 2009-12-03  Drew Wilson  <atwilson@chromium.org>
13814
13815         Rolled back r51633 because it causes a perf regression in Chromium.
13816
13817         * wtf/Platform.h:
13818
13819 2009-12-03  Gavin Barraclough  <barraclough@apple.com>
13820
13821         Try and fix the Windows build.
13822
13823         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:  Export a symbol that should be exported.
13824
13825 2009-12-03  Mark Rowe  <mrowe@apple.com>
13826
13827         Try and fix the Mac build.
13828
13829         * JavaScriptCore.exp:  Export a symbol that should be exported.
13830
13831 2009-12-03  Oliver Hunt  <oliver@apple.com>
13832
13833         Reviewed by Gavin Barraclough.
13834
13835         REGRESSION(4.0.3-48777): Crash in JSC::ExecState::propertyNames() (Debug-only?)
13836         https://bugs.webkit.org/show_bug.cgi?id=32133
13837
13838         Work around odd GCC-ism and correct the scopechain for use by
13839         calls made while a cachedcall is active on the callstack.
13840
13841         * interpreter/CachedCall.h:
13842         (JSC::CachedCall::newCallFrame):
13843         * runtime/JSArray.cpp:
13844         (JSC::AVLTreeAbstractorForArrayCompare::compare_key_key):
13845         * runtime/StringPrototype.cpp:
13846         (JSC::stringProtoFuncReplace):
13847
13848 2009-12-03  Gavin Barraclough  <barraclough@apple.com>
13849
13850         Reviewed by Oliver "Brraaaaiiiinnnnnzzzzzzzz" Hunt.
13851
13852         https://bugs.webkit.org/show_bug.cgi?id=32136
13853         Add a rope representation to JSString.  Presently JSString always holds its data in UString form.
13854         Instead, allow the result of a string concatenation to be represented in a tree form - with a
13855         variable sized, reference-counted rope node retaining a set of UString::Reps (or other rope nopes).
13856
13857         Strings must still currently be resolved down to a flat UString representation before being used,
13858         but by holding the string in a rope representation during construction we can avoid copying data
13859         until we know the final size of the string.
13860
13861         ~2% progression on SunSpider (~25% on date-format-xparb, ~20% on string-validate-input).
13862
13863         * JavaScriptCore.exp:
13864
13865             - Update exports.
13866
13867         * interpreter/Interpreter.cpp:
13868         (JSC::Interpreter::privateExecute):
13869
13870             - Make use of new JSString::length() method to avoid prematurely resolving ropes.
13871
13872         * jit/JITOpcodes.cpp:
13873         (JSC::JIT::privateCompileCTIMachineTrampolines):
13874
13875             - Switch the string length trampoline to read the length directly from JSString::m_length,
13876               rather than from the JSString's UString::Rep's 'len' property.
13877
13878         * jit/JITStubs.cpp:
13879         (JSC::DEFINE_STUB_FUNCTION):
13880
13881             - Modify op_add such that addition of two strings, where either or both strings are already
13882               in rope representation, produces a rope as a result.
13883
13884         * runtime/JSString.cpp:
13885         (JSC::JSString::Rope::~Rope):
13886         (JSC::copyChars):
13887         (JSC::JSString::resolveRope):
13888         (JSC::JSString::getPrimitiveNumber):
13889         (JSC::JSString::toBoolean):
13890         (JSC::JSString::toNumber):
13891         (JSC::JSString::toString):
13892         (JSC::JSString::toThisString):
13893         (JSC::JSString::getStringPropertyDescriptor):
13894         * runtime/JSString.h:
13895         (JSC::JSString::Rope::Fiber::Fiber):
13896         (JSC::JSString::Rope::Fiber::destroy):
13897         (JSC::JSString::Rope::Fiber::isRope):
13898         (JSC::JSString::Rope::Fiber::rope):
13899         (JSC::JSString::Rope::Fiber::string):
13900         (JSC::JSString::Rope::create):
13901         (JSC::JSString::Rope::initializeFiber):
13902         (JSC::JSString::Rope::ropeLength):
13903         (JSC::JSString::Rope::stringLength):
13904         (JSC::JSString::Rope::fibers):
13905         (JSC::JSString::Rope::Rope):
13906         (JSC::JSString::Rope::operator new):
13907         (JSC::JSString::JSString):
13908         (JSC::JSString::value):
13909         (JSC::JSString::length):
13910         (JSC::JSString::isRope):
13911         (JSC::JSString::rope):
13912         (JSC::JSString::string):
13913         (JSC::JSString::canGetIndex):
13914         (JSC::jsSingleCharacterSubstring):
13915         (JSC::JSString::getIndex):
13916         (JSC::jsSubstring):
13917         (JSC::JSString::getStringPropertySlot):
13918
13919             - Add rope form.
13920
13921         * runtime/Operations.h:
13922         (JSC::jsAdd):
13923         (JSC::concatenateStrings):
13924
13925             - Update string concatenation, and addition of ropes, to produce ropes.
13926
13927         * runtime/StringObject.cpp:
13928         (JSC::StringObject::getOwnPropertyNames):
13929
13930             - Make use of new JSString::length() method to avoid prematurely resolving ropes.
13931
13932 2009-11-23  Jeremy Moskovich  <jeremy@chromium.org>
13933
13934         Reviewed by Eric Seidel.
13935
13936         Switch Chrome/Mac to use Core Text APIs rather than ATSUI APIs.
13937         https://bugs.webkit.org/show_bug.cgi?id=31802
13938
13939         No test since this is already covered by existing pixel tests.
13940
13941         * wtf/Platform.h: #define USE_CORE_TEXT for Chrome/Mac.
13942
13943 2009-12-02  Oliver Hunt  <oliver@apple.com>
13944
13945         Reviewed by Gavin Barraclough.
13946
13947         Add files missed in prior patch.
13948
13949         * runtime/JSZombie.cpp:
13950         (JSC::):
13951         (JSC::JSZombie::leakedZombieStructure):
13952         * runtime/JSZombie.h: Added.
13953         (JSC::JSZombie::JSZombie):
13954         (JSC::JSZombie::isZombie):
13955         (JSC::JSZombie::classInfo):
13956         (JSC::JSZombie::isGetterSetter):
13957         (JSC::JSZombie::isAPIValueWrapper):
13958         (JSC::JSZombie::isPropertyNameIterator):
13959         (JSC::JSZombie::getCallData):
13960         (JSC::JSZombie::getConstructData):
13961         (JSC::JSZombie::getUInt32):
13962         (JSC::JSZombie::toPrimitive):
13963         (JSC::JSZombie::getPrimitiveNumber):
13964         (JSC::JSZombie::toBoolean):
13965         (JSC::JSZombie::toNumber):
13966         (JSC::JSZombie::toString):
13967         (JSC::JSZombie::toObject):
13968         (JSC::JSZombie::markChildren):
13969         (JSC::JSZombie::put):
13970         (JSC::JSZombie::deleteProperty):
13971         (JSC::JSZombie::toThisObject):
13972         (JSC::JSZombie::toThisString):
13973         (JSC::JSZombie::toThisJSString):
13974         (JSC::JSZombie::getJSNumber):
13975         (JSC::JSZombie::getOwnPropertySlot):
13976
13977 2009-12-02  Oliver Hunt  <oliver@apple.com>
13978
13979         Reviewed by Gavin Barraclough.
13980
13981         Add zombies to JSC
13982         https://bugs.webkit.org/show_bug.cgi?id=32103
13983
13984         Add a compile time flag to make the JSC collector replace "unreachable"
13985         objects with zombie objects.  The zombie object is a JSCell subclass that
13986         ASSERTs on any attempt to use the JSCell methods.  In addition there are
13987         a number of additional assertions in bottleneck code to catch zombie usage
13988         as quickly as possible.
13989
13990         Grrr. Argh. Brains.
13991
13992         * JavaScriptCore.xcodeproj/project.pbxproj:
13993         * interpreter/Register.h:
13994         (JSC::Register::Register):
13995         * runtime/ArgList.h:
13996         (JSC::MarkedArgumentBuffer::append):
13997         (JSC::ArgList::ArgList):
13998         * runtime/Collector.cpp:
13999         (JSC::Heap::destroy):
14000         (JSC::Heap::sweep):
14001         * runtime/Collector.h:
14002         * runtime/JSCell.h:
14003         (JSC::JSCell::isZombie):
14004         (JSC::JSValue::isZombie):
14005         * runtime/JSValue.h:
14006         (JSC::JSValue::decode):
14007         (JSC::JSValue::JSValue):
14008         * wtf/Platform.h:
14009
14010 2009-12-01  Jens Alfke  <snej@chromium.org>
14011
14012         Reviewed by Darin Adler.
14013
14014         Added variants of find/contains/add that allow a foreign key type to be used.
14015         This will allow AtomicString-keyed maps to be queried by C string without
14016         having to create a temporary AtomicString (see HTTPHeaderMap.)
14017         The code for this is adapted from the equivalent in HashSet.h.
14018
14019         * wtf/HashMap.h:
14020         (WTF::HashMap::find):
14021         (WTF::HashMap::contains):
14022         (WTF::HashMap::add):
14023         * wtf/HashSet.h: Changed "method" to "function member" in a comment.
14024
14025 2009-12-01  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
14026
14027         Revert 51551 because it broke GTK+.
14028
14029         * wtf/Platform.h:
14030
14031 2009-11-30  Gavin Barraclough  <barraclough@apple.com>
14032
14033         Windows Build fix.  Reviewed by NOBODY.
14034
14035         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
14036
14037 2009-11-24  Gavin Barraclough  <barraclough@apple.com>
14038
14039         Reviewed by Geoff Garen.
14040
14041         Bug 31859 - Make world selection for JSC IsolatedWorlds automagical.
14042
14043         WebCore presently has to explicitly specify the world before entering into JSC,
14044         which is a little fragile (particularly since property access via a
14045         getter/setter might invoke execution). Instead derive the current world from
14046         the lexical global object.
14047         
14048         Remove the temporary duct tape of willExecute/didExecute virtual hooks on the JSGlobalData::ClientData - these are no longer necessary.
14049
14050         * API/JSBase.cpp:
14051         (JSEvaluateScript):
14052         * API/JSObjectRef.cpp:
14053         (JSObjectCallAsFunction):
14054         * JavaScriptCore.exp:
14055         * runtime/JSGlobalData.cpp:
14056         * runtime/JSGlobalData.h:
14057
14058 2009-11-30  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
14059
14060         Reviewed by Kenneth Rohde Christiansen.
14061
14062         [Qt] Remove obsolete PLATFORM(KDE) code
14063         https://bugs.webkit.org/show_bug.cgi?id=31958
14064
14065         KDE is now using unpatched QtWebKit.
14066
14067         * parser/Lexer.cpp: Remove obsolete KDE_USE_FINAL guard
14068         * wtf/Platform.h: Remove PLATFORM(KDE) definition and code 
14069         section that is guarded with it.
14070
14071 2009-11-30  Jan-Arve Sæther  <jan-arve.saether@nokia.com>
14072
14073         Reviewed by Simon Hausmann.
14074
14075         [Qt] Fix compilation with win32-icc
14076
14077         The Intel compiler does not support the __has_trivial_constructor type
14078         trait.  The Intel Compiler can report itself as _MSC_VER >= 1400. The
14079         reason for that is that the Intel Compiler depends on the Microsoft
14080         Platform SDK, and in order to try to be "fully" MS compatible it will
14081         "pretend" to be the same MS compiler as was shipped with the MS PSDK.
14082         (Thus, compiling with win32-icc with VC8 SDK will make the source code
14083         "think" the compiler at hand supports this type trait).
14084
14085         * wtf/TypeTraits.h:
14086
14087 2009-11-29  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
14088
14089         Reviewed by Eric Seidel.
14090
14091         [Qt] Mac build has JIT disabled
14092         https://bugs.webkit.org/show_bug.cgi?id=31828
14093
14094         * wtf/Platform.h: Enable JIT for Qt Mac builds
14095
14096 2009-11-28  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
14097
14098         Reviewed by Eric Seidel.
14099
14100         Apply workaround for the limitation of VirtualFree with MEM_RELEASE to all ports running on Windows
14101         https://bugs.webkit.org/show_bug.cgi?id=31943
14102
14103         * runtime/MarkStack.h:
14104         (JSC::MarkStack::MarkStackArray::shrinkAllocation):
14105
14106 2009-11-28  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
14107
14108         Reviewed by Gavin Barraclough.
14109
14110         https://bugs.webkit.org/show_bug.cgi?id=31930
14111
14112         Seems a typo. We don't need ~270k memory to determine the vptrs.
14113
14114         * runtime/JSGlobalData.cpp:
14115         (JSC::VPtrSet::VPtrSet):
14116
14117 2009-11-27  Shinichiro Hamaji  <hamaji@chromium.org>
14118
14119         Unreviewed. 
14120
14121         Move GOwnPtr* from wtf to wtf/gtk
14122         https://bugs.webkit.org/show_bug.cgi?id=31793
14123
14124         Build fix for chromium after r51423.
14125         Exclude gtk directory from chromium build.
14126
14127         * JavaScriptCore.gyp/JavaScriptCore.gyp:
14128
14129 2009-11-25  Oliver Hunt  <oliver@apple.com>
14130
14131         Reviewed by Gavin Barraclough.
14132
14133         Incorrect behaviour of jneq_null in the interpreter
14134         https://bugs.webkit.org/show_bug.cgi?id=31901
14135
14136         Correct the logic of jneq_null.  This is already covered by existing tests.
14137
14138         * interpreter/Interpreter.cpp:
14139         (JSC::Interpreter::privateExecute):
14140
14141 2009-11-26  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
14142
14143         Reviewed by Oliver Hunt.
14144
14145         Move GOwnPtr* from wtf to wtf/gtk
14146         https://bugs.webkit.org/show_bug.cgi?id=31793
14147
14148         * GNUmakefile.am: Change the path for GOwnPtr.*.
14149         * JavaScriptCore.gyp/JavaScriptCore.gyp: Remove
14150           GOwnPtr.cpp from the exclude list.
14151         * JavaScriptCore.gypi: Change the path for GOwnPtr.*.
14152         * wscript: Remove GOwnPtr.cpp from the exclude list.
14153         * wtf/GOwnPtr.cpp: Removed.
14154         * wtf/GOwnPtr.h: Removed.
14155         * wtf/Threading.h: Change the path for GOwnPtr.h.
14156         * wtf/gtk/GOwnPtr.cpp: Copied from JavaScriptCore/wtf/GOwnPtr.cpp.
14157         * wtf/gtk/GOwnPtr.h: Copied from JavaScriptCore/wtf/GOwnPtr.h.
14158         * wtf/unicode/glib/UnicodeGLib.h: Change the path for GOwnPtr.h.
14159
14160 2009-11-24  Dmitry Titov  <dimich@chromium.org>
14161
14162         Reviewed by Eric Seidel.
14163
14164         Add ENABLE_SHARED_SCRIPT feature define and flag for build-webkit
14165         https://bugs.webkit.org/show_bug.cgi?id=31444
14166
14167         * Configurations/FeatureDefines.xcconfig:
14168         * wtf/Platform.h:
14169
14170 2009-11-24  Chris Marrin  <cmarrin@apple.com>
14171
14172         Reviewed by Simon Fraser.
14173
14174         Add ability to enable ACCELERATED_COMPOSITING on Windows (currently disabled)
14175         https://bugs.webkit.org/show_bug.cgi?id=27314
14176
14177         * wtf/Platform.h:
14178
14179 2009-11-24  Jason Smith  <dark.panda@gmail.com>
14180
14181         Reviewed by Alexey Proskuryakov.
14182
14183         RegExp#exec's returned Array-like object behaves differently from
14184         regular Arrays
14185         https://bugs.webkit.org/show_bug.cgi?id=31689
14186
14187         * JavaScriptCore/runtime/RegExpConstructor.cpp: ensure that undefined
14188         values are added to the returned RegExpMatchesArray
14189
14190 2009-11-24  Oliver Hunt  <oliver@apple.com>
14191
14192         Reviewed by Alexey Proskuryakov.
14193
14194         JSON.stringify performance on undefined is very poor
14195         https://bugs.webkit.org/show_bug.cgi?id=31839
14196
14197         Switch from a UString to a Vector<UChar> when building
14198         the JSON string, allowing us to safely remove the substr-copy
14199         we otherwise did when unwinding an undefined property.
14200
14201         Also turns out to be a ~5% speedup on stringification.
14202
14203         * runtime/JSONObject.cpp:
14204         (JSC::Stringifier::StringBuilder::append):
14205         (JSC::Stringifier::stringify):
14206         (JSC::Stringifier::Holder::appendNextProperty):
14207
14208 2009-11-24  Mark Rowe  <mrowe@apple.com>
14209
14210         Fix production builds where the source tree may be read-only.
14211
14212         * JavaScriptCore.xcodeproj/project.pbxproj:
14213
14214 2009-11-23  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
14215
14216         Reviewed by Kenneth Rohde Christiansen.
14217
14218         Include "config.h" to meet Coding Style Guidelines
14219         https://bugs.webkit.org/show_bug.cgi?id=31792
14220
14221         * wtf/unicode/UTF8.cpp:
14222         * wtf/unicode/glib/UnicodeGLib.cpp:
14223         * wtf/unicode/wince/UnicodeWince.cpp:
14224
14225 2009-11-23  Geoffrey Garen  <ggaren@apple.com>
14226
14227         Reviewed by Oliver Hunt.
14228
14229         Streamlined some Math functions where we expect or know the result not
14230         to be representable as an int.
14231         
14232         SunSpider says 0.6% faster.
14233
14234         * runtime/JSNumberCell.h:
14235         (JSC::JSValue::JSValue):
14236         * runtime/JSValue.h:
14237         (JSC::JSValue::):
14238         (JSC::jsDoubleNumber):
14239         (JSC::JSValue::JSValue): Added a function for making a numeric JSValue
14240         and skipping the "can I encode this as an int?" check, avoiding the
14241         overhead of int <-> double roundtripping and double <-> double comparison
14242         and branching.
14243
14244         * runtime/MathObject.cpp:
14245         (JSC::mathProtoFuncACos):
14246         (JSC::mathProtoFuncASin):
14247         (JSC::mathProtoFuncATan):
14248         (JSC::mathProtoFuncATan2):
14249         (JSC::mathProtoFuncCos):
14250         (JSC::mathProtoFuncExp):
14251         (JSC::mathProtoFuncLog):
14252         (JSC::mathProtoFuncRandom):
14253         (JSC::mathProtoFuncSin):
14254         (JSC::mathProtoFuncSqrt):
14255         (JSC::mathProtoFuncTan): For these functions, which we expect or know
14256         to produce results not representable as ints, call jsDoubleNumber instead
14257         of jsNumber.
14258
14259 2009-11-23  Mark Rowe  <mrowe@apple.com>
14260
14261         Unreviewed. Unbreak the regression tests after r51329.
14262
14263         * API/JSBase.cpp:
14264         (JSEvaluateScript): Null-check clientData before dereferencing it.
14265         * API/JSObjectRef.cpp:
14266         (JSObjectCallAsFunction): Ditto.
14267
14268 2009-11-23  Gavin Barraclough  <barraclough@apple.com>
14269
14270         Reviewed by Geoff Garen.
14271
14272         Part 1/3 of <rdar://problem/7377477> REGRESSION: Many web pages fail to render after interesting script runs in isolated world
14273
14274         Some clients of the JavaScriptCore API expect to be able to make callbacks over the JSC API,
14275         and for this to automagically cause execution to take place in the world associated with the
14276         global object associated with the ExecState (JSContextRef) passed.  However this is not how
14277         things work - the world must be explicitly set within WebCore.
14278
14279         Making this work just for API calls to evaluate & call will be a far from perfect solution,
14280         since direct (non-API) use of JSC still relies on WebCore setting the current world correctly.
14281         A better solution would be to make this all work automagically all throughout WebCore, but this
14282         will require more refactoring.
14283
14284         Since the API is in JSC but worlds only exist in WebCore, add callbacks on the JSGlobalData::ClientData
14285         to allow it to update the current world on entry/exit via the JSC API.  This is temporary duck
14286         tape, and should be removed once the current world no longer needs to be explicitly tracked.
14287
14288         * API/JSBase.cpp:
14289         (JSEvaluateScript):
14290         * API/JSObjectRef.cpp:
14291         (JSObjectCallAsFunction):
14292         * JavaScriptCore.exp:
14293         * runtime/JSGlobalData.cpp:
14294         (JSC::JSGlobalData::ClientData::beginningExecution):
14295         (JSC::JSGlobalData::ClientData::completedExecution):
14296         * runtime/JSGlobalData.h:
14297
14298 2009-11-23  Steve Block  <steveblock@google.com>
14299
14300         Reviewed by Dmitry Titov.
14301
14302         Adds MainThreadAndroid.cpp with Android-specific WTF threading functions.
14303         https://bugs.webkit.org/show_bug.cgi?id=31807
14304
14305         * wtf/android: Added.
14306         * wtf/android/MainThreadAndroid.cpp: Added.
14307         (WTF::timeoutFired):
14308         (WTF::initializeMainThreadPlatform):
14309         (WTF::scheduleDispatchFunctionsOnMainThread):
14310
14311 2009-11-23  Alexey Proskuryakov  <ap@apple.com>
14312
14313         Reviewed by Brady Eidson.
14314
14315         https://bugs.webkit.org/show_bug.cgi?id=31748
14316         Make WebSocketHandleCFNet respect proxy auto-configuration files via CFProxySupport
14317
14318         * JavaScriptCore.exp: Export callOnMainThreadAndWait.
14319
14320 2009-11-23  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
14321
14322         Reviewed by Kenneth Rohde Christiansen.
14323
14324         [Symbian] Fix lastIndexOf() for Symbian
14325         https://bugs.webkit.org/show_bug.cgi?id=31773
14326
14327         Symbian soft floating point library has problems with operators
14328         comparing NaN to numbers. Without a workaround lastIndexOf() 
14329         function does not work.
14330
14331         Patch developed by David Leong.
14332
14333         * runtime/StringPrototype.cpp:
14334         (JSC::stringProtoFuncLastIndexOf):Add an extra test 
14335         to check for NaN for Symbian.
14336
14337 2009-11-23  Steve Block  <steveblock@google.com>
14338
14339         Reviewed by Eric Seidel.
14340
14341         Android port lacks implementation of atomicIncrement and atomicDecrement.
14342         https://bugs.webkit.org/show_bug.cgi?id=31715
14343
14344         * wtf/Threading.h: Modified.
14345         (WTF::atomicIncrement): Added Android implementation.
14346         (WTF::atomicDecrement): Added Android implementation.
14347
14348 2009-11-22  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
14349
14350         Unreviewed.
14351
14352         [Qt] Sort source lists and remove obsolete comments 
14353         from the build system.
14354
14355         * JavaScriptCore.pri:
14356
14357 2009-11-21  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
14358
14359         Reviewed by Eric Seidel.
14360
14361         [Qt][Mac] Turn on multiple JavaScript threads for QtWebkit on Mac
14362         https://bugs.webkit.org/show_bug.cgi?id=31753
14363
14364         * wtf/Platform.h:
14365
14366 2009-11-19  Steve Block  <steveblock@google.com>
14367
14368         Android port lacks configuration in Platform.h and config.h.
14369         https://bugs.webkit.org/show_bug.cgi?id=31671
14370
14371         * wtf/Platform.h: Modified. Added Android-specific configuration.
14372
14373 2009-11-19  Alexey Proskuryakov  <ap@apple.com>
14374
14375         Reviewed by Darin Adler.
14376
14377         https://bugs.webkit.org/show_bug.cgi?id=31690
14378         Make SocketStreamHandleCFNet work on Windows
14379
14380         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
14381         * wtf/MainThread.cpp:
14382         (WTF::FunctionWithContext::FunctionWithContext):
14383         (WTF::dispatchFunctionsFromMainThread):
14384         (WTF::callOnMainThreadAndWait):
14385         * wtf/MainThread.h:
14386         Re-add callOnMainThreadAndWait(), which was removed in bug 23926.
14387
14388 2009-11-19  Dmitry Titov  <dimich@chromium.org>
14389
14390         Reviewed by David Levin.
14391
14392         isMainThread() on Chromium (Mac and Linux) is so slow it timeouts LayoutTests..
14393         https://bugs.webkit.org/show_bug.cgi?id=31693
14394
14395         * wtf/ThreadingPthreads.cpp:
14396         (WTF::initializeThreading): grab and use the pthread_t of the main thread instead of ThreadIdentifier.
14397         (WTF::isMainThread): Ditto.
14398
14399 2009-11-19  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
14400
14401         Reviewed by Darin Adler.
14402
14403         Remove HAVE(STRING_H) guard from JavaScriptCore
14404         https://bugs.webkit.org/show_bug.cgi?id=31668
14405
14406         * config.h:
14407         * runtime/UString.cpp:
14408
14409 2009-11-19  Dumitru Daniliuc  <dumi@chromium.org>
14410
14411         Reviewed by Dmitry Titov.
14412
14413         Fixing a bug in MessageQueue::removeIf() that leads to an
14414         assertion failure.
14415
14416         https://bugs.webkit.org/show_bug.cgi?id=31657
14417
14418         * wtf/MessageQueue.h:
14419         (WTF::MessageQueue::removeIf):
14420
14421 2009-11-19  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
14422
14423         Reviewed by Darin Adler.
14424
14425         Remove HAVE(FLOAT_H) guard
14426         https://bugs.webkit.org/show_bug.cgi?id=31661
14427
14428         JavaScriptCore has a dependency on float.h, there is
14429         no need to guard float.h.
14430
14431         * runtime/DatePrototype.cpp: Remove include directive 
14432         for float.h as it is included in MathExtras.h already.
14433         * runtime/Operations.cpp: Ditto.
14434         * runtime/UString.cpp: Ditto.
14435         * wtf/dtoa.cpp: Ditto.
14436         * wtf/MathExtras.h: Remove HAVE(FLOAT_H) guard.
14437         * wtf/Platform.h: Ditto.
14438
14439 2009-11-19  Thiago Macieira <thiago.macieira@nokia.com>
14440
14441         Reviewed by Simon Hausmann.
14442
14443         Build fix for 32-bit Sparc machines: these machines are big-endian.
14444
14445         * wtf/Platform.h:
14446
14447 2009-11-18  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
14448
14449         Reviewed by Kenneth Rohde Christiansen.
14450
14451         [Qt] Remove support for Qt v4.3 or older versions
14452         https://bugs.webkit.org/show_bug.cgi?id=29469
14453
14454         * JavaScriptCore.pro:
14455         * jsc.pro:
14456         * wtf/unicode/qt4/UnicodeQt4.h:
14457
14458 2009-11-18  Kent Tamura  <tkent@chromium.org>
14459
14460         Reviewed by Darin Adler.
14461
14462         Move UString::from(double) implementation to new
14463         WTF::doubleToStringInJavaScriptFormat(), and expose it because WebCore
14464         code will use it.
14465         https://bugs.webkit.org/show_bug.cgi?id=31330
14466
14467         - Introduce new function createRep(const char*, unsigned) and
14468           UString::UString(const char*, unsigned) to reduce 2 calls to strlen().
14469         - Fix a bug that dtoa() doesn't update *rve if the input value is NaN
14470           or Infinity.
14471
14472         No new tests because this doesn't change the behavior.
14473
14474         * JavaScriptCore.exp:
14475         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
14476         * runtime/UString.cpp:
14477         (JSC::createRep):
14478         (JSC::UString::UString):
14479         (JSC::UString::from): Move the code to doubleToStringInJavaScriptFormat().
14480         * runtime/UString.h:
14481         * wtf/dtoa.cpp:
14482         (WTF::dtoa): Fix a bug about rve.
14483         (WTF::append): A helper for doubleToStringInJavaScriptFormat().
14484         (WTF::doubleToStringInJavaScriptFormat): Move the code from UString::from(double).
14485         * wtf/dtoa.h:
14486
14487 2009-11-18  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
14488
14489         Reviewed by Kenneth Rohde Christiansen.
14490
14491         [Qt] Remove WTF_USE_JAVASCRIPTCORE_BINDINGS as it is no longer used
14492         https://bugs.webkit.org/show_bug.cgi?id=31643
14493
14494         * JavaScriptCore.pro:
14495
14496 2009-11-18  Nate Chapin  <japhet@chromium.org>
14497
14498         Reviewed by Darin Fisher.
14499
14500         Remove Chromium's unnecessary dependency on wtf's tcmalloc files.
14501
14502         https://bugs.webkit.org/show_bug.cgi?id=31648
14503
14504         * JavaScriptCore.gyp/JavaScriptCore.gyp:
14505
14506 2009-11-18  Thiago Macieira <thiago.macieira@nokia.com>
14507
14508         Reviewed by Gavin Barraclough.
14509
14510         [Qt] Implement symbol hiding for JSC's JIT functions.
14511
14512         These functions are implemented directly in assembly, so they need the
14513         proper directives to enable/disable visibility. On ELF systems, it's
14514         .hidden, whereas on Mach-O systems (Mac) it's .private_extern. On
14515         Windows, it's not necessary since you have to explicitly export. I
14516         also implemented the AIX idiom, though it's unlikely anyone will
14517         implement AIX/POWER JIT.
14518         https://bugs.webkit.org/show_bug.cgi?id=30864
14519
14520         * jit/JITStubs.cpp:
14521
14522 2009-11-18  Oliver Hunt  <oliver@apple.com>
14523
14524         Reviewed by Alexey Proskuryakov.
14525
14526         Interpreter may do an out of range access when throwing an exception in the profiler.
14527         https://bugs.webkit.org/show_bug.cgi?id=31635
14528
14529         Add bounds check.
14530
14531         * interpreter/Interpreter.cpp:
14532         (JSC::Interpreter::throwException):
14533
14534 2009-11-18  Gabor Loki  <loki@inf.u-szeged.hu>
14535
14536         Reviewed by Darin Adler.
14537
14538         Fix the clobber list of cacheFlush for ARM and Thumb2 on Linux
14539         https://bugs.webkit.org/show_bug.cgi?id=31631
14540
14541         * jit/ExecutableAllocator.h:
14542         (JSC::ExecutableAllocator::cacheFlush):
14543
14544 2009-11-18  Harald Fernengel  <harald.fernengel@nokia.com>
14545
14546         Reviewed by Simon Hausmann.
14547
14548         [Qt] Fix detection of linux-g++
14549
14550         Never use "linux-g++*" to check for linux-g++, since this will break embedded
14551         builds which use linux-arm-g++ and friends. Use 'linux*-g++*' to check for any
14552         g++ on linux mkspec.
14553
14554         * JavaScriptCore.pri:
14555
14556 2009-11-17  Jon Honeycutt  <jhoneycutt@apple.com>
14557
14558         Add JSContextRefPrivate.h to list of copied files.
14559
14560         Reviewed by Mark Rowe.
14561
14562         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
14563
14564 2009-11-17  Martin Robinson  <martin.james.robinson@gmail.com>
14565
14566         Reviewed by Adam Barth.
14567
14568         [GTK] Style cleanup for GOwnPtr
14569         https://bugs.webkit.org/show_bug.cgi?id=31506
14570
14571         Remove forward declaration in GOwnPtr and do some style cleanup.
14572
14573         * wtf/GOwnPtr.cpp:
14574         * wtf/GOwnPtr.h:
14575         (WTF::GOwnPtr::GOwnPtr):
14576         (WTF::GOwnPtr::~GOwnPtr):
14577         (WTF::GOwnPtr::get):
14578         (WTF::GOwnPtr::release):
14579         (WTF::GOwnPtr::outPtr):
14580         (WTF::GOwnPtr::set):
14581         (WTF::GOwnPtr::clear):
14582         (WTF::GOwnPtr::operator*):
14583         (WTF::GOwnPtr::operator->):
14584         (WTF::GOwnPtr::operator!):
14585         (WTF::GOwnPtr::operator UnspecifiedBoolType):
14586         (WTF::GOwnPtr::swap):
14587         (WTF::swap):
14588         (WTF::operator==):
14589         (WTF::operator!=):
14590         (WTF::getPtr):
14591         (WTF::freeOwnedGPtr):
14592
14593 2009-11-17  Oliver Hunt  <oliver@apple.com>
14594
14595         Reviewed by Maciej Stachowiak.
14596
14597         Incorrect use of JavaScriptCore API in DumpRenderTree
14598         https://bugs.webkit.org/show_bug.cgi?id=31577
14599
14600         Add assertions to the 'toJS' functions to catch mistakes like
14601         this early.  Restructure existing code which blindly passed potentially
14602         null values to toJS when forwarding exceptions so that a null check is
14603         performed first.
14604
14605         * API/APICast.h:
14606         (toJS):
14607         (toJSForGC):
14608         * API/JSCallbackObjectFunctions.h:
14609         (JSC::::getOwnPropertySlot):
14610         (JSC::::put):
14611         (JSC::::deleteProperty):
14612         (JSC::::construct):
14613         (JSC::::hasInstance):
14614         (JSC::::call):
14615         (JSC::::toNumber):
14616         (JSC::::toString):
14617         (JSC::::staticValueGetter):
14618         (JSC::::callbackGetter):
14619         * API/tests/testapi.c: Fix errors in the API tester.
14620         (MyObject_getProperty):
14621         (MyObject_convertToType):
14622         (EvilExceptionObject_convertToType):
14623
14624 2009-11-16  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
14625
14626         Reviewed by Gavin Barraclough.
14627
14628         https://bugs.webkit.org/show_bug.cgi?id=31050
14629
14630         Minor fixes for JSVALUE32_64: branchConvertDoubleToInt32
14631         failed on a CortexA8 CPU, but not on a simulator; and
14632         JITCall.cpp modifications was somehow not committed to mainline.
14633
14634         * assembler/ARMAssembler.h:
14635         (JSC::ARMAssembler::fmrs_r):
14636         * assembler/MacroAssemblerARM.h:
14637         (JSC::MacroAssemblerARM::branchConvertDoubleToInt32):
14638         * jit/JITCall.cpp:
14639         (JSC::JIT::compileOpCall):
14640
14641 2009-11-16  Joerg Bornemann  <joerg.bornemann@trolltech.com>
14642
14643         Reviewed by Simon Hausmann.
14644
14645         Fix Qt build on Windows CE 6.
14646
14647         * JavaScriptCore.pri: Add missing include path.
14648         * wtf/Platform.h: Include ce_time.h for Windows CE 6.
14649
14650 2009-11-13  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
14651
14652         Reviewed by Gavin Barraclough.
14653
14654         https://bugs.webkit.org/show_bug.cgi?id=31050
14655
14656         Adding optimization support for mode JSVALUE32_64
14657         on ARM systems.
14658
14659         * jit/JIT.h:
14660         * jit/JITCall.cpp:
14661         (JSC::JIT::compileOpCall):
14662         * jit/JITPropertyAccess.cpp:
14663         (JSC::JIT::emit_op_method_check):
14664         (JSC::JIT::compileGetByIdHotPath):
14665         (JSC::JIT::compileGetByIdSlowCase):
14666         (JSC::JIT::emit_op_put_by_id):
14667
14668 2009-11-14  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
14669
14670         Reviewed by Gavin Barraclough.
14671
14672         https://bugs.webkit.org/show_bug.cgi?id=31050
14673
14674         Adding JSVALUE32_64 support for ARM (but not turning it
14675         on by default). All optimizations must be disabled, since
14676         this patch is only the first of a series of patches.
14677
14678         During the work, a lot of x86 specific code revealed and
14679         made platform independent.
14680         See revisions: 50531 50541 50593 50594 50595
14681
14682         * assembler/ARMAssembler.h:
14683         (JSC::ARMAssembler::):
14684         (JSC::ARMAssembler::fdivd_r):
14685         * assembler/MacroAssemblerARM.h:
14686         (JSC::MacroAssemblerARM::lshift32):
14687         (JSC::MacroAssemblerARM::neg32):
14688         (JSC::MacroAssemblerARM::rshift32):
14689         (JSC::MacroAssemblerARM::branchOr32):
14690         (JSC::MacroAssemblerARM::set8):
14691         (JSC::MacroAssemblerARM::setTest8):
14692         (JSC::MacroAssemblerARM::loadDouble):
14693         (JSC::MacroAssemblerARM::divDouble):
14694         (JSC::MacroAssemblerARM::convertInt32ToDouble):
14695         (JSC::MacroAssemblerARM::zeroDouble):
14696         * jit/JIT.cpp:
14697         * jit/JIT.h:
14698         * jit/JITOpcodes.cpp:
14699         (JSC::JIT::privateCompileCTIMachineTrampolines):
14700         * jit/JITStubs.cpp:
14701         * wtf/StdLibExtras.h:
14702
14703 2009-11-13  Dominik Röttsches  <dominik.roettsches@access-company.com>
14704
14705         Reviewed by Eric Seidel.
14706
14707         Unify TextBoundaries implementations by only relying on WTF Unicode abstractions
14708         https://bugs.webkit.org/show_bug.cgi?id=31468
14709
14710         Adding isAlphanumeric abstraction, required
14711         by TextBoundaries.cpp.
14712
14713         * wtf/unicode/glib/UnicodeGLib.h:
14714         (WTF::Unicode::isAlphanumeric):
14715         * wtf/unicode/icu/UnicodeIcu.h:
14716         (WTF::Unicode::isAlphanumeric):
14717
14718 2009-11-13  Norbert Leser  <norbert.leser&nokia.com>
14719
14720         Reviewed by Eric Seidel.
14721
14722         Added macros for USERINCLUDE paths within symbian blocks
14723         to guarantee inclusion of respective header files from local path
14724         first (to avoid clashes with same names of header files in system include path).
14725
14726         * JavaScriptCore.pri:
14727
14728 2009-11-13  Oliver Hunt  <oliver@apple.com>
14729
14730         Reviewed by Geoff Garen.
14731
14732         JSValueProtect and JSValueUnprotect don't protect API wrapper values
14733         https://bugs.webkit.org/show_bug.cgi?id=31485
14734
14735         Make JSValueProtect/Unprotect use a new 'toJS' function, 'toJSForGC' that
14736         does not attempt to to strip out API wrapper objects.
14737
14738         * API/APICast.h:
14739         (toJSForGC):
14740         * API/JSValueRef.cpp:
14741         (JSValueProtect):
14742         (JSValueUnprotect):
14743         * API/tests/testapi.c:
14744         (makeGlobalNumberValue):
14745         (main):
14746
14747 2009-11-13  İsmail Dönmez  <ismail@namtrac.org>
14748
14749         Reviewed by Antti Koivisto.
14750
14751         Fix typo, ce_time.cpp should be ce_time.c
14752
14753         * JavaScriptCore.pri:
14754
14755 2009-11-12  Steve VanDeBogart  <vandebo@chromium.org>
14756
14757         Reviewed by Adam Barth.
14758
14759         Calculate the time offset only if we were able to parse
14760         the date string. This saves an IPC in Chromium for
14761         invalid date strings.
14762         https://bugs.webkit.org/show_bug.cgi?id=31416
14763
14764         * wtf/DateMath.cpp:
14765         (WTF::parseDateFromNullTerminatedCharacters):
14766         (JSC::parseDateFromNullTerminatedCharacters):
14767
14768 2009-11-12  Oliver Hunt  <oliver@apple.com>
14769
14770         Rollout r50896 until i can work out why it causes failures.
14771
14772         * bytecompiler/BytecodeGenerator.cpp:
14773         (JSC::BytecodeGenerator::emitReturn):
14774         * interpreter/Interpreter.cpp:
14775         (JSC::Interpreter::execute):
14776         * parser/Nodes.cpp:
14777         (JSC::EvalNode::emitBytecode):
14778
14779 2009-11-12  Steve Falkenburg  <sfalken@apple.com>
14780
14781         Reviewed by Stephanie Lewis.
14782
14783         Remove LIBRARY directive from def file to fix Debug_All target.
14784
14785         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
14786
14787 2009-11-12  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
14788
14789         Rubber-stamped by Holger Freyther.
14790
14791         Revert r50204, since it makes DRT crash on 32 bits release builds
14792         for GTK+.
14793
14794         * wtf/FastMalloc.h:
14795
14796 2009-11-12  Oliver Hunt  <oliver@apple.com>
14797
14798         Reviewed by Gavin Barraclough.
14799
14800         Start unifying entry logic for function and eval code.
14801
14802         Eval now uses a ret instruction to end execution, and sets up
14803         a callframe more in line with what we do for function entry.
14804
14805         * bytecompiler/BytecodeGenerator.cpp:
14806         (JSC::BytecodeGenerator::emitReturn):
14807         * interpreter/Interpreter.cpp:
14808         (JSC::Interpreter::execute):
14809         * parser/Nodes.cpp:
14810         (JSC::EvalNode::emitBytecode):
14811
14812 2009-11-12  Richard Moe Gustavsen  <richard.gustavsen@nokia.com>
14813
14814         Reviewed by Kenneth Rohde Christiansen.
14815
14816         [Qt] Disable pthread_setname_np.
14817
14818         This allows Qt builds on Mac from 10.6 to run on earlier version
14819         where this symbol is not present.
14820         https://bugs.webkit.org/show_bug.cgi?id=31403
14821
14822         * wtf/Platform.h:
14823
14824 2009-11-12  Thiago Macieira <thiago.macieira@nokia.com>
14825
14826         Reviewed by Kenneth Rohde Christiansen.
14827
14828         [Qt] Fix linking on Linux 32-bit.
14829
14830         It was missing the ".text" directive at the top of the file,
14831         indicating that code would follow. Without it, the assembler created
14832         "NOTYPE" symbols, which would result in linker errors.
14833         https://bugs.webkit.org/show_bug.cgi?id=30863
14834
14835         * jit/JITStubs.cpp:
14836
14837 2009-11-11  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
14838
14839         Reviewed by Alexey Proskuryakov.
14840
14841         Refactor multiple JavaScriptCore threads
14842         https://bugs.webkit.org/show_bug.cgi?id=31328
14843
14844         Remove the id field from the PlatformThread structure 
14845         as it is not used.
14846
14847         * runtime/Collector.cpp:
14848         (JSC::getCurrentPlatformThread):
14849         (JSC::suspendThread):
14850         (JSC::resumeThread):
14851         (JSC::getPlatformThreadRegisters):
14852
14853 2009-11-10  Geoffrey Garen  <ggaren@apple.com>
14854
14855         Linux build fix: Added an #include for UINT_MAX.
14856
14857         * runtime/WeakRandom.h:
14858
14859 2009-11-10  Geoffrey Garen  <ggaren@apple.com>
14860
14861         JavaScriptGlue build fix: Marked a file 'private' instead of 'project'.
14862
14863         * JavaScriptCore.xcodeproj/project.pbxproj:
14864
14865 2009-11-10  Geoffrey Garen  <ggaren@apple.com>
14866
14867         Reviewed by Gavin "avGni arBalroguch" Barraclough.
14868
14869         Faster Math.random, based on GameRand.
14870         
14871         SunSpider says 1.4% faster.
14872
14873         * GNUmakefile.am:
14874         * JavaScriptCore.gypi:
14875         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
14876         * JavaScriptCore.xcodeproj/project.pbxproj: Added the header to the project.
14877
14878         * runtime/JSGlobalData.cpp:
14879         (JSC::JSGlobalData::JSGlobalData):
14880         * runtime/JSGlobalData.h: Use an object to track random number generation
14881         state, initialized to the current time.
14882
14883         * runtime/MathObject.cpp:
14884         (JSC::MathObject::MathObject):
14885         (JSC::mathProtoFuncRandom): Use the new hotness.
14886
14887         * runtime/WeakRandom.h: Added.
14888         (JSC::WeakRandom::WeakRandom):
14889         (JSC::WeakRandom::get):
14890         (JSC::WeakRandom::advance): The new hotness.
14891
14892 2009-11-09  Geoffrey Garen  <ggaren@apple.com>
14893
14894         Reviewed by Oliver Hunt.
14895
14896         Imported the v8 DST cache.
14897         
14898         SunSpider says 1.5% faster.
14899
14900         * runtime/JSGlobalData.cpp:
14901         (JSC::JSGlobalData::resetDateCache): Reset the DST cache when resetting
14902         other date data.
14903
14904         * runtime/JSGlobalData.h:
14905         (JSC::DSTOffsetCache::DSTOffsetCache):
14906         (JSC::DSTOffsetCache::reset): Added a struct for the DST cache.
14907
14908         * wtf/DateMath.cpp:
14909         (WTF::calculateDSTOffsetSimple):
14910         (WTF::calculateDSTOffset):
14911         (WTF::parseDateFromNullTerminatedCharacters):
14912         (JSC::getDSTOffset):
14913         (JSC::gregorianDateTimeToMS):
14914         (JSC::msToGregorianDateTime):
14915         (JSC::parseDateFromNullTerminatedCharacters):
14916         * wtf/DateMath.h: The imported code for probing and updating the cache.
14917
14918 2009-11-09  Geoffrey Garen  <ggaren@apple.com>
14919
14920         Reviewed by Oliver Hunt.
14921
14922         Fixed an edge case that could cause the engine not to notice a timezone
14923         change.
14924         
14925         No test because this case would require manual intervention to change
14926         the timezone during the test.
14927         
14928         SunSpider reports no change.
14929
14930         * runtime/DateInstanceCache.h:
14931         (JSC::DateInstanceCache::DateInstanceCache):
14932         (JSC::DateInstanceCache::reset): Added a helper function for resetting
14933         this cache. Also, shrank the cache, since we'll be resetting it often.
14934
14935         * runtime/JSGlobalData.cpp:
14936         (JSC::JSGlobalData::resetDateCache): Include resetting the DateInstanceCache
14937         in resetting Date data. (Otherwise, a cache hit could bypass a necessary
14938         timezone update check.)
14939
14940 2009-11-09  Geoffrey Garen  <ggaren@apple.com>
14941
14942         Reviewed by Sam Weinig.
14943
14944         Some manual inlining and constant propogation in Date code.
14945         
14946         SunSpider reports a 0.4% speedup on date-*, no overall speedup. Shark
14947         says some previously evident stalls are now gone.
14948
14949         * runtime/DateConstructor.cpp:
14950         (JSC::callDate):
14951         * runtime/DateConversion.cpp:
14952         (JSC::formatTime):
14953         (JSC::formatTimeUTC): Split formatTime into UTC and non-UTC variants.
14954
14955         * runtime/DateConversion.h:
14956         * runtime/DateInstance.cpp:
14957         (JSC::DateInstance::calculateGregorianDateTime):
14958         (JSC::DateInstance::calculateGregorianDateTimeUTC):
14959         * runtime/DateInstance.h:
14960         (JSC::DateInstance::gregorianDateTime):
14961         (JSC::DateInstance::gregorianDateTimeUTC): Split gregorianDateTime into
14962         a UTC and non-UTC variant, and split each variant into a fast inline
14963         case and a slow out-of-line case.
14964
14965         * runtime/DatePrototype.cpp:
14966         (JSC::formatLocaleDate):
14967         (JSC::dateProtoFuncToString):
14968         (JSC::dateProtoFuncToUTCString):
14969         (JSC::dateProtoFuncToISOString):
14970         (JSC::dateProtoFuncToDateString):
14971         (JSC::dateProtoFuncToTimeString):
14972         (JSC::dateProtoFuncGetFullYear):
14973         (JSC::dateProtoFuncGetUTCFullYear):
14974         (JSC::dateProtoFuncToGMTString):
14975         (JSC::dateProtoFuncGetMonth):
14976         (JSC::dateProtoFuncGetUTCMonth):
14977         (JSC::dateProtoFuncGetDate):
14978         (JSC::dateProtoFuncGetUTCDate):
14979         (JSC::dateProtoFuncGetDay):
14980         (JSC::dateProtoFuncGetUTCDay):
14981         (JSC::dateProtoFuncGetHours):
14982         (JSC::dateProtoFuncGetUTCHours):
14983         (JSC::dateProtoFuncGetMinutes):
14984         (JSC::dateProtoFuncGetUTCMinutes):
14985         (JSC::dateProtoFuncGetSeconds):
14986         (JSC::dateProtoFuncGetUTCSeconds):
14987         (JSC::dateProtoFuncGetTimezoneOffset):
14988         (JSC::setNewValueFromTimeArgs):
14989         (JSC::setNewValueFromDateArgs):
14990         (JSC::dateProtoFuncSetYear):
14991         (JSC::dateProtoFuncGetYear): Updated for the gregorianDateTime change above.
14992
14993 2009-11-09  Geoffrey Garen  <ggaren@apple.com>
14994
14995         Build fix: export a new symbol.
14996
14997         * JavaScriptCore.exp:
14998         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
14999
15000 2009-11-09  Geoffrey Garen  <ggaren@apple.com>
15001
15002         Reviewed by Sam "Home Wrecker" Weinig.
15003
15004         Added a tiny cache for Date parsing.
15005         
15006         SunSpider says 1.2% faster.
15007
15008         * runtime/DateConversion.cpp:
15009         (JSC::parseDate): Try to reuse the last parsed Date, if present.
15010
15011         * runtime/JSGlobalData.cpp:
15012         (JSC::JSGlobalData::resetDateCache):
15013         * runtime/JSGlobalData.h: Added storage for last parsed Date. Refactored
15014         this code to make resetting the date cache easier.
15015
15016         * runtime/JSGlobalObject.h:
15017         (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope): Updated for
15018         refactoring.
15019
15020         * wtf/DateMath.cpp:
15021         (JSC::parseDateFromNullTerminatedCharacters):
15022         * wtf/DateMath.h: Changed ExecState to be first parameter, as is the JSC custom.
15023
15024 2009-11-09  Oliver Hunt  <oliver@apple.com>
15025
15026         Reviewed by Gavin Barraclough.
15027
15028         Can cache prototype lookups on uncacheable dictionaries.
15029         https://bugs.webkit.org/show_bug.cgi?id=31198
15030
15031         Replace fromDictionaryTransition with flattenDictionaryObject and
15032         flattenDictionaryStructure.  This change is necessary as we need to
15033         guarantee that our attempt to convert away from a dictionary structure
15034         will definitely succeed, and in some cases this requires mutating the
15035         object storage itself.
15036
15037         * interpreter/Interpreter.cpp:
15038         (JSC::Interpreter::tryCacheGetByID):
15039         * jit/JITStubs.cpp:
15040         (JSC::JITThunks::tryCacheGetByID):
15041         (JSC::DEFINE_STUB_FUNCTION):
15042         * runtime/BatchedTransitionOptimizer.h:
15043         (JSC::BatchedTransitionOptimizer::~BatchedTransitionOptimizer):
15044         * runtime/JSObject.h:
15045         (JSC::JSObject::flattenDictionaryObject):
15046         * runtime/Operations.h:
15047         (JSC::normalizePrototypeChain):
15048         * runtime/Structure.cpp:
15049         (JSC::Structure::flattenDictionaryStructure):
15050         (JSC::comparePropertyMapEntryIndices):
15051         * runtime/Structure.h:
15052
15053 2009-11-09  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
15054
15055         Not reviewed, build fix.
15056
15057         Remove extra character from r50701.
15058
15059         * JavaScriptCore.pri:
15060
15061 2009-11-09  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
15062
15063         Not reviewed, build fix.
15064
15065         Revert r50695 because it broke QtWebKit (clean builds).
15066
15067         * JavaScriptCore.pri:
15068
15069 2009-11-09  Norbert Leser  <norbert.leser@nokia.com>
15070
15071         Reviewed by Kenneth Rohde Christiansen.
15072
15073         Prepended $$PWD to GENERATED_SOURCES_DIR to avoid potential ambiguities when included from WebCore.pro.
15074         Some preprocessors consider this GENERATED_SOURCES_DIR relative to current invoking dir (e.g., ./WebCore),
15075         and not the working dir of JavaCriptCore.pri (i.e., ../JavaScriptCore/).
15076
15077         * JavaScriptCore.pri:
15078
15079 2009-11-09  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
15080
15081         Reviewed by Kenneth Rohde Christiansen.
15082
15083         Use explicit parentheses to silence gcc 4.4 -Wparentheses warnings
15084         https://bugs.webkit.org/show_bug.cgi?id=31040
15085
15086         * interpreter/Interpreter.cpp:
15087         (JSC::Interpreter::privateExecute):
15088
15089 2009-11-08  David Levin  <levin@chromium.org>
15090
15091         Reviewed by NOBODY (speculative snow leopard and windows build fixes).
15092
15093         * wtf/DateMath.cpp:
15094         (WTF::parseDateFromNullTerminatedCharacters):
15095         (JSC::gregorianDateTimeToMS):
15096         (JSC::msToGregorianDateTime):
15097         (JSC::parseDateFromNullTerminatedCharacters):
15098         * wtf/DateMath.h:
15099         (JSC::GregorianDateTime::GregorianDateTime):
15100
15101 2009-11-08  David Levin  <levin@chromium.org>
15102
15103         Reviewed by NOBODY (chromium build fix).
15104         
15105         Hopefully, the last build fix.
15106
15107         Create better separation in DateMath about the JSC
15108         and non-JSC portions. Also, only expose the non-JSC
15109         version in the exports.
15110
15111         * JavaScriptCore.exp:
15112         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
15113         * wtf/DateMath.cpp:
15114         (WTF::parseDateFromNullTerminatedCharacters):
15115         (JSC::getUTCOffset):
15116         (JSC::gregorianDateTimeToMS):
15117         (JSC::msToGregorianDateTime):
15118         (JSC::parseDateFromNullTerminatedCharacters):
15119         * wtf/DateMath.h:
15120         (JSC::gmtoffset):
15121
15122 2009-11-08  David Levin  <levin@chromium.org>
15123
15124         Reviewed by NOBODY (chromium build fix).
15125
15126         For the change in DateMath.
15127
15128         * config.h:
15129         * wtf/DateMath.cpp:
15130
15131 2009-11-06  Geoffrey Garen  <ggaren@apple.com>
15132
15133         Windows build fix: export some symbols.
15134
15135         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
15136
15137 2009-11-06  Geoffrey Garen  <ggaren@apple.com>
15138
15139         Build fix: updated export file.
15140
15141         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
15142
15143 2009-11-06  Geoffrey Garen  <ggaren@apple.com>
15144
15145         Build fix: added some #includes.
15146
15147         * wtf/CurrentTime.h:
15148         * wtf/DateMath.h:
15149
15150 2009-11-06  Geoffrey Garen  <ggaren@apple.com>
15151
15152         Reviewed by Oliver Hunt.
15153         
15154         https://bugs.webkit.org/show_bug.cgi?id=31197
15155         Implemented a timezone cache not based on Mac OS X's notify_check API.
15156         
15157         If the VM calculates the local timezone offset from UTC, it caches the
15158         result until the end of the current VM invocation. (We don't want to cache
15159         forever, because the user's timezone may change over time.)
15160         
15161         This removes notify_* overhead on Mac, and, more significantly, removes
15162         OS time and date call overhead on non-Mac platforms.
15163
15164         ~8% speedup on Date microbenchmark on Mac. SunSpider reports maybe a tiny
15165         speedup on Mac. (Speedup on non-Mac platforms should be even more noticeable.)
15166
15167         * JavaScriptCore.exp:
15168
15169         * interpreter/CachedCall.h:
15170         (JSC::CachedCall::CachedCall):
15171         * interpreter/Interpreter.cpp:
15172         (JSC::Interpreter::execute):
15173         * runtime/JSGlobalObject.h:
15174         (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope): Made the 
15175         DynamicGlobalObjectScope constructor responsible for checking whether a
15176         dynamicGlobalObject has already been set. This eliminated some duplicate
15177         client code, and allowed me to avoid adding even more duplicate client
15178         code. Made DynamicGlobalObjectScope responsible for resetting the
15179         local timezone cache upon first entry to the VM.
15180
15181         * runtime/DateConstructor.cpp:
15182         (JSC::constructDate):
15183         (JSC::callDate):
15184         (JSC::dateParse):
15185         (JSC::dateUTC):
15186         * runtime/DateConversion.cpp:
15187         (JSC::parseDate):
15188         * runtime/DateConversion.h:
15189         * runtime/DateInstance.cpp:
15190         (JSC::DateInstance::gregorianDateTime):
15191         * runtime/DateInstance.h:
15192         * runtime/DateInstanceCache.h:
15193         * runtime/DatePrototype.cpp:
15194         (JSC::setNewValueFromTimeArgs):
15195         (JSC::setNewValueFromDateArgs):
15196         (JSC::dateProtoFuncSetYear):
15197         * runtime/InitializeThreading.cpp:
15198         (JSC::initializeThreadingOnce):
15199         * runtime/JSGlobalData.cpp:
15200         (JSC::JSGlobalData::JSGlobalData):
15201         * runtime/JSGlobalData.h:
15202         * wtf/DateMath.cpp:
15203         (WTF::getCurrentUTCTime):
15204         (WTF::getCurrentUTCTimeWithMicroseconds):
15205         (WTF::getLocalTime):
15206         (JSC::getUTCOffset): Use the new cache. Also, see below.
15207         (JSC::gregorianDateTimeToMS):
15208         (JSC::msToGregorianDateTime):
15209         (JSC::initializeDates):
15210         (JSC::parseDateFromNullTerminatedCharacters): Simplified the way this function
15211         accounts for the local timezone offset, to accomodate our new caching API,
15212         and a (possibly misguided) caller in WebCore. Also, see below.
15213         * wtf/DateMath.h:
15214         (JSC::GregorianDateTime::GregorianDateTime): Moved most of the code in
15215         DateMath.* into the JSC namespace. The code needed to move so it could
15216         naturally interact with ExecState and JSGlobalData to support caching.
15217         Logically, it seemed right to move it, too, since this code is not really
15218         as low-level as the WTF namespace might imply -- it implements a set of
15219         date parsing and conversion quirks that are finely tuned to the JavaScript
15220         language. Also removed the Mac OS X notify_* infrastructure.
15221         
15222         * wtf/CurrentTime.h:
15223         (WTF::currentTimeMS):
15224         (WTF::getLocalTime): Moved the rest of the DateMath code here, and renamed
15225         it to make it consistent with WTF's currentTime function.
15226
15227 2009-11-06  Gabor Loki  <loki@inf.u-szeged.hu>
15228
15229         Unreviewed trivial buildfix after r50595.
15230
15231         Rename the remaining rshiftPtr calls to rshift32
15232
15233         * jit/JITArithmetic.cpp:
15234         (JSC::JIT::emit_op_rshift):
15235         * jit/JITInlineMethods.h:
15236         (JSC::JIT::emitFastArithImmToInt):
15237
15238 2009-11-06  Gavin Barraclough  <barraclough@apple.com>
15239
15240         Reviewed by Oliver Hunt.
15241
15242         Tidy up the shift methods on the macro-assembler interface.
15243
15244         Currently behaviour of shifts of a magnitude > 0x1f is undefined.
15245         Instead defined that all shifts are masked to this range.  This makes a lot of
15246         practical sense, both since having undefined behaviour is not particularly
15247         desirable, and because this behaviour is commonly required (particularly since
15248         it is required bt ECMA-262 for shifts).
15249
15250         Update the ARM assemblers to provide this behaviour.  Remove (now) redundant
15251         masks from JITArithmetic, and remove rshiftPtr (this was used in case that
15252         could be rewritten in a simpler form using rshift32, only optimized JSVALUE32
15253         on x86-64, which uses JSVALUE64!)
15254
15255         * assembler/MacroAssembler.h:
15256         * assembler/MacroAssemblerARM.h:
15257         (JSC::MacroAssemblerARM::lshift32):
15258         (JSC::MacroAssemblerARM::rshift32):
15259         * assembler/MacroAssemblerARMv7.h:
15260         (JSC::MacroAssemblerARMv7::lshift32):
15261         (JSC::MacroAssemblerARMv7::rshift32):
15262         * assembler/MacroAssemblerX86_64.h:
15263         * jit/JITArithmetic.cpp:
15264         (JSC::JIT::emit_op_lshift):
15265         (JSC::JIT::emit_op_rshift):
15266
15267 2009-11-05  Gavin Barraclough  <barraclough@apple.com>
15268
15269         Rubber Stamped by Oliver Hunt.
15270
15271         Remove a magic number (1) from the JIT, instead compute the value with OBJECT_OFFSET.
15272
15273         * jit/JITInlineMethods.h:
15274         (JSC::JIT::emitPutJITStubArg):
15275         (JSC::JIT::emitPutJITStubArgConstant):
15276         (JSC::JIT::emitGetJITStubArg):
15277         (JSC::JIT::emitPutJITStubArgFromVirtualRegister):
15278         * jit/JITStubCall.h:
15279         (JSC::JITStubCall::JITStubCall):
15280         (JSC::JITStubCall::getArgument):
15281         * jit/JITStubs.h:
15282
15283 2009-11-05  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
15284
15285         Reviewed by Gavin Barraclough.
15286
15287         https://bugs.webkit.org/show_bug.cgi?id=31159
15288         Fix branchDouble behaviour on ARM THUMB2 JIT.
15289
15290         The x86 branchDouble behaviour is reworked, and all JIT
15291         ports should follow the x86 port. See bug 31104 and 31151
15292
15293         This patch contains a fix for the traditional ARM port
15294
15295         * assembler/ARMAssembler.h:
15296         (JSC::ARMAssembler::):
15297         (JSC::ARMAssembler::fmrs_r):
15298         (JSC::ARMAssembler::ftosid_r):
15299         * assembler/MacroAssemblerARM.h:
15300         (JSC::MacroAssemblerARM::):
15301         (JSC::MacroAssemblerARM::branchDouble):
15302         (JSC::MacroAssemblerARM::branchConvertDoubleToInt32):
15303
15304 2009-11-05  Chris Jerdonek  <chris.jerdonek@gmail.com>
15305
15306         Reviewed by Eric Seidel.
15307
15308         Removed the "this is part of the KDE project" comments from 
15309         all *.h, *.cpp, *.idl, and *.pm files.
15310         
15311         https://bugs.webkit.org/show_bug.cgi?id=31167
15312         
15313         The maintenance and architecture page in the project wiki lists
15314         this as a task.
15315         
15316         This change includes no changes or additions to test cases 
15317         since the change affects only comments.
15318         
15319         * wtf/wince/FastMallocWince.h:
15320
15321 2009-11-05  Gabor Loki  <loki@inf.u-szeged.hu>
15322
15323         Reviewed by Gavin Barraclough.
15324
15325         Use ARMv7 specific encoding for immediate constants on ARMv7 target
15326         https://bugs.webkit.org/show_bug.cgi?id=31060
15327
15328         * assembler/ARMAssembler.cpp:
15329         (JSC::ARMAssembler::getOp2): Use INVALID_IMM
15330         (JSC::ARMAssembler::getImm): Use encodeComplexImm for complex immediate
15331         (JSC::ARMAssembler::moveImm): Ditto.
15332         (JSC::ARMAssembler::encodeComplexImm): Encode a constant by one or two
15333         instructions or a PC relative load.
15334         * assembler/ARMAssembler.h: Use INVALID_IMM if a constant cannot be
15335         encoded as an immediate constant.
15336         (JSC::ARMAssembler::):
15337         (JSC::ARMAssembler::movw_r): 16-bit immediate load
15338         (JSC::ARMAssembler::movt_r): High halfword 16-bit immediate load
15339         (JSC::ARMAssembler::getImm16Op2): Encode immediate constant for
15340         movw_r and mowt_r
15341
15342 2009-11-04  Mark Mentovai  <mark@chromium.org>
15343
15344         Reviewed by Mark Rowe.
15345
15346         Provide TARGETING_TIGER and TARGETING_LEOPARD as analogues to
15347         BUILDING_ON_TIGER and BUILDING_ON_LEOPARD.  The TARGETING_ macros
15348         consider the deployment target; the BUILDING_ON_ macros consider the
15349         headers being built against.
15350
15351         * wtf/Platform.h:
15352
15353 2009-11-04  Gavin Barraclough  <barraclough@apple.com>
15354
15355         Reviewed by Oliver Hunt.
15356
15357         https://bugs.webkit.org/show_bug.cgi?id=31151
15358         Fix branchDouble behaviour on ARM THUMB2 JIT.
15359
15360         The ARMv7 JIT is currently using ARMv7Assembler::ConditionEQ to branch
15361         for DoubleEqualOrUnordered, however this is incorrect - ConditionEQ won't
15362         branch on unordered operands.  Similarly, DoubleLessThanOrUnordered &
15363         DoubleLessThanOrEqualOrUnordered use ARMv7Assembler::ConditionLO &
15364         ARMv7Assembler::ConditionLS, whereas they should be using
15365         ARMv7Assembler::ConditionLT & ARMv7Assembler::ConditionLE.
15366
15367         Fix these, and fill out the missing DoubleConditions.
15368
15369         * assembler/MacroAssemblerARMv7.h:
15370         (JSC::MacroAssemblerARMv7::):
15371         (JSC::MacroAssemblerARMv7::branchDouble):
15372
15373 2009-11-04  Gavin Barraclough  <barraclough@apple.com>
15374
15375         Rubber Stamped by Oliver Hunt.
15376
15377         Enable native call optimizations on ARMv7.  (Existing ARM_TRADITIONAL
15378         implementation was generic, worked perfectly, just needed turning on).
15379
15380         * jit/JITOpcodes.cpp:
15381         * wtf/Platform.h:
15382
15383 2009-11-04  Gavin Barraclough  <barraclough@apple.com>
15384
15385         Rubber Stamped by Mark Rowe, Oliver Hunt, and Sam Weinig.
15386
15387         Add a missing assert to the ARMv7 JIT.
15388
15389         * assembler/ARMv7Assembler.h:
15390         (JSC::ARMThumbImmediate::ARMThumbImmediate):
15391
15392 2009-11-04  Mark Rowe  <mrowe@apple.com>
15393
15394         Rubber-stamped by Oliver Hunt.
15395
15396         Remove bogus op_ prefix on dumped version of three opcodes.
15397
15398         * bytecode/CodeBlock.cpp:
15399         (JSC::CodeBlock::dump):
15400
15401 2009-11-04  Mark Rowe  <mrowe@apple.com>
15402
15403         Reviewed by Sam Weinig.
15404
15405         Fix dumping of constants in bytecode so that they aren't printed as large positive register numbers.
15406
15407         We do this by having the registerName function return information about the constant if the register
15408         number corresponds to a constant.  This requires that registerName, and several functions that call it,
15409         be converted to member functions of CodeBlock so that the constant value can be retrieved.  The
15410         ExecState also needs to be threaded down through these functions so that it can be passed on to
15411         constantName when needed.
15412
15413         * bytecode/CodeBlock.cpp:
15414         (JSC::constantName):
15415         (JSC::CodeBlock::registerName):
15416         (JSC::CodeBlock::printUnaryOp):
15417         (JSC::CodeBlock::printBinaryOp):
15418         (JSC::CodeBlock::printConditionalJump):
15419         (JSC::CodeBlock::printGetByIdOp):
15420         (JSC::CodeBlock::printPutByIdOp):
15421         (JSC::CodeBlock::dump):
15422         * bytecode/CodeBlock.h:
15423         (JSC::CodeBlock::isConstantRegisterIndex):
15424
15425 2009-11-04  Pavel Heimlich  <tropikhajma@gmail.com>
15426
15427         Reviewed by Alexey Proskuryakov.
15428
15429         https://bugs.webkit.org/show_bug.cgi?id=30647
15430         Solaris build failure due to strnstr.
15431
15432         * wtf/StringExtras.h: Enable strnstr on Solaris, too.
15433
15434 2009-11-04  Gavin Barraclough  <barraclough@apple.com>
15435
15436         Reviewed by Oliver Hunt.
15437
15438         https://bugs.webkit.org/show_bug.cgi?id=31104
15439         Refactor x86-specific behaviour out of the JIT.
15440
15441         - Add explicit double branch conditions for ordered and unordered comparisons (presently the brehaviour is a mix).
15442         - Refactor double to int conversion out into the MacroAssembler.
15443         - Remove broken double to int conversion for !JSVALUE32_64 builds - this code was broken and slowing us down, fixing it showed it not to be an improvement.
15444         - Remove exclusion of double to int conversion from (1 % X) cases in JSVALUE32_64 builds - if this was of benefit this is no longer the case; simplify.
15445
15446         * assembler/MacroAssemblerARM.h:
15447         (JSC::MacroAssemblerARM::):
15448         * assembler/MacroAssemblerARMv7.h:
15449         (JSC::MacroAssemblerARMv7::):
15450         * assembler/MacroAssemblerX86Common.h:
15451         (JSC::MacroAssemblerX86Common::):
15452         (JSC::MacroAssemblerX86Common::convertInt32ToDouble):
15453         (JSC::MacroAssemblerX86Common::branchDouble):
15454         (JSC::MacroAssemblerX86Common::branchConvertDoubleToInt32):
15455         * jit/JITArithmetic.cpp:
15456         (JSC::JIT::emitBinaryDoubleOp):
15457         (JSC::JIT::emit_op_div):
15458         (JSC::JIT::emitSlow_op_jnless):
15459         (JSC::JIT::emitSlow_op_jnlesseq):
15460         * jit/JITOpcodes.cpp:
15461         (JSC::JIT::emit_op_jfalse):
15462
15463 2009-11-04  Mark Mentovai  <mark@chromium.org>
15464
15465         Reviewed by Eric Seidel.
15466
15467         Remove BUILDING_ON_LEOPARD from JavaScriptCore.gyp.  This is supposed
15468         to be set as needed only in wtf/Platform.h.
15469
15470         * JavaScriptCore.gyp/JavaScriptCore.gyp:
15471
15472 2009-11-02  Oliver Hunt  <oliver@apple.com>
15473
15474         Reviewed by Gavin Barraclough.
15475
15476         REGRESSION (r48573): JSC may incorrectly cache chain lookups with a dictionary at the head of the chain
15477         https://bugs.webkit.org/show_bug.cgi?id=31045
15478
15479         Add guards to prevent caching of prototype chain lookups with dictionaries at the
15480         head of the chain.  Also add a few tighter assertions to cached prototype lookups
15481         to catch this in future.
15482
15483         * interpreter/Interpreter.cpp:
15484         (JSC::Interpreter::tryCacheGetByID):
15485         (JSC::Interpreter::privateExecute):
15486         * jit/JITStubs.cpp:
15487         (JSC::JITThunks::tryCacheGetByID):
15488
15489 2009-11-02  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
15490
15491         Reviewed by Darin Adler.
15492
15493         PLATFORM(CF) should be set when building for Qt on Darwin
15494         https://bugs.webkit.org/show_bug.cgi?id=23671
15495
15496         * wtf/Platform.h: Turn on CF support if both QT and DARWIN
15497         platforms are defined.
15498
15499 2009-11-02  Dmitry Titov  <dimich@chromium.org>
15500
15501         Reviewed by David Levin.
15502
15503         Remove threadsafe refcounting from tasks used with WTF::MessageQueue.
15504         https://bugs.webkit.org/show_bug.cgi?id=30612
15505
15506         * wtf/MessageQueue.h:
15507         (WTF::MessageQueue::alwaysTruePredicate):
15508         (WTF::MessageQueue::~MessageQueue):
15509         (WTF::MessageQueue::append):
15510         (WTF::MessageQueue::appendAndCheckEmpty):
15511         (WTF::MessageQueue::prepend):
15512         (WTF::MessageQueue::waitForMessage):
15513         (WTF::MessageQueue::waitForMessageFilteredWithTimeout):
15514         (WTF::MessageQueue::tryGetMessage):
15515         (WTF::MessageQueue::removeIf):
15516         The MessageQueue is changed to act as a queue of OwnPtr<DataType>. It takes ownership
15517         of posted tasks and passes it to the new owner (in another thread) when the task is fetched.
15518         All methods have arguments of type PassOwnPtr<DataType> and return the same type.
15519
15520         * wtf/Threading.cpp:
15521         (WTF::createThread):
15522         Superficial change to trigger rebuild of JSC project on Windows,
15523         workaround for https://bugs.webkit.org/show_bug.cgi?id=30890
15524
15525 2009-10-30  Geoffrey Garen  <ggaren@apple.com>
15526
15527         Reviewed by Oliver Hunt.
15528
15529         Fixed failing layout test: restore a special case I accidentally deleted.
15530
15531         * runtime/DatePrototype.cpp:
15532         (JSC::setNewValueFromDateArgs): In the case of applying a change to a date
15533         that is NaN, reset the date to 0 *and* then apply the change; don't just
15534         reset the date to 0.
15535
15536 2009-10-30  Geoffrey Garen  <ggaren@apple.com>
15537
15538         Windows build fix: update for object-to-pointer change.
15539
15540         * runtime/DatePrototype.cpp:
15541         (JSC::formatLocaleDate):
15542
15543 2009-10-29  Geoffrey Garen  <ggaren@apple.com>
15544
15545         Reviewed by Darin Adler.
15546
15547         https://bugs.webkit.org/show_bug.cgi?id=30942
15548         Use pointers instead of copies to pass GregorianDateTime objects around.
15549         
15550         SunSpider reports a shocking 4.5% speedup on date-format-xparb, and 1.3%
15551         speedup on date-format-tofte.
15552
15553         * runtime/DateInstance.cpp:
15554         (JSC::DateInstance::gregorianDateTime):
15555         * runtime/DateInstance.h:
15556         * runtime/DatePrototype.cpp:
15557         (JSC::formatLocaleDate):
15558         (JSC::dateProtoFuncToString):
15559         (JSC::dateProtoFuncToUTCString):
15560         (JSC::dateProtoFuncToISOString):
15561         (JSC::dateProtoFuncToDateString):
15562         (JSC::dateProtoFuncToTimeString):
15563         (JSC::dateProtoFuncGetFullYear):
15564         (JSC::dateProtoFuncGetUTCFullYear):
15565         (JSC::dateProtoFuncToGMTString):
15566         (JSC::dateProtoFuncGetMonth):
15567         (JSC::dateProtoFuncGetUTCMonth):
15568         (JSC::dateProtoFuncGetDate):
15569         (JSC::dateProtoFuncGetUTCDate):
15570         (JSC::dateProtoFuncGetDay):
15571         (JSC::dateProtoFuncGetUTCDay):
15572         (JSC::dateProtoFuncGetHours):
15573         (JSC::dateProtoFuncGetUTCHours):
15574         (JSC::dateProtoFuncGetMinutes):
15575         (JSC::dateProtoFuncGetUTCMinutes):
15576         (JSC::dateProtoFuncGetSeconds):
15577         (JSC::dateProtoFuncGetUTCSeconds):
15578         (JSC::dateProtoFuncGetTimezoneOffset):
15579         (JSC::setNewValueFromTimeArgs):
15580         (JSC::setNewValueFromDateArgs):
15581         (JSC::dateProtoFuncSetYear):
15582         (JSC::dateProtoFuncGetYear): Renamed getGregorianDateTime to gregorianDateTime,
15583         since it no longer has an out parameter. Uses 0 to indicate invalid dates.
15584
15585 2009-10-30  Zoltan Horvath  <zoltan@webkit.org>
15586
15587         Reviewed by Darin Adler.
15588
15589         Allow custom memory allocation control for JavaScriptCore's ListHashSet
15590         https://bugs.webkit.org/show_bug.cgi?id=30853
15591
15592         Inherits ListHashSet class from FastAllocBase because it is
15593         instantiated by 'new' in WebCore/rendering/RenderBlock.cpp:1813.
15594
15595         * wtf/ListHashSet.h:
15596
15597 2009-10-30  Oliver Hunt  <oliver@apple.com>
15598
15599         Reviewed by Gavin Barraclough.
15600
15601         Regression: crash enumerating properties of an object with getters or setters
15602         https://bugs.webkit.org/show_bug.cgi?id=30948
15603
15604         Add a guard to prevent us trying to cache property enumeration on
15605         objects with getters or setters.
15606
15607         * runtime/JSPropertyNameIterator.cpp:
15608         (JSC::JSPropertyNameIterator::create):
15609
15610 2009-10-30  Roland Steiner  <rolandsteiner@chromium.org>
15611
15612         Reviewed by Eric Seidel.
15613
15614         Remove ENABLE_RUBY guards as discussed with Dave Hyatt and Maciej Stachowiak.
15615
15616         Bug 28420 -  Implement HTML5 <ruby> rendering
15617         (https://bugs.webkit.org/show_bug.cgi?id=28420)
15618  
15619         No new tests (no functional change).
15620
15621         * Configurations/FeatureDefines.xcconfig:
15622
15623 2009-10-29  Oliver Hunt  <oliver@apple.com>
15624
15625         Reviewed by Maciej Stachowiak.
15626
15627         REGRESSION (r50218-r50262): E*TRADE accounts page is missing content
15628         https://bugs.webkit.org/show_bug.cgi?id=30947
15629         <rdar://problem/7348833>
15630
15631         The logic for flagging that a structure has non-enumerable properties
15632         was in addPropertyWithoutTransition, rather than in the core Structure::put
15633         method.  Despite this I was unable to produce a testcase that caused
15634         the failure that etrade was experiencing, but the new assertion in
15635         getEnumerablePropertyNames triggers on numerous layout tests without
15636         the fix, so in effecti all for..in enumeration in any test ends up
15637         doing the required consistency check.
15638
15639         * runtime/Structure.cpp:
15640         (JSC::Structure::addPropertyWithoutTransition):
15641         (JSC::Structure::put):
15642         (JSC::Structure::getEnumerablePropertyNames):
15643         (JSC::Structure::checkConsistency):
15644
15645 2009-10-29  Gabor Loki  <loki@inf.u-szeged.hu>
15646
15647         Reviewed by Gavin Barraclough.
15648
15649         Add cacheFlush support for Thumb-2 on Linux
15650         https://bugs.webkit.org/show_bug.cgi?id=30865
15651
15652         * jit/ExecutableAllocator.h:
15653         (JSC::ExecutableAllocator::cacheFlush):
15654
15655 2009-10-28  Gavin Barraclough  <barraclough@apple.com>
15656
15657         Reviewed by Oliver Hunt.
15658
15659         JSC JIT on ARMv7 cannot link jumps >16Mb range
15660         https://bugs.webkit.org/show_bug.cgi?id=30891
15661
15662         Start planing all relative jumps as move-32-bit-immediate-to-register-BX.
15663         In the cases where the jump would fall within a relative jump range, use a relative jump.
15664
15665         * JavaScriptCore.xcodeproj/project.pbxproj:
15666         * assembler/ARMv7Assembler.h:
15667         (JSC::ARMv7Assembler::~ARMv7Assembler):
15668         (JSC::ARMv7Assembler::LinkRecord::LinkRecord):
15669         (JSC::ARMv7Assembler::):
15670         (JSC::ARMv7Assembler::executableCopy):
15671         (JSC::ARMv7Assembler::linkJump):
15672         (JSC::ARMv7Assembler::relinkJump):
15673         (JSC::ARMv7Assembler::setInt32):
15674         (JSC::ARMv7Assembler::isB):
15675         (JSC::ARMv7Assembler::isBX):
15676         (JSC::ARMv7Assembler::isMOV_imm_T3):
15677         (JSC::ARMv7Assembler::isMOVT):
15678         (JSC::ARMv7Assembler::isNOP_T1):
15679         (JSC::ARMv7Assembler::isNOP_T2):
15680         (JSC::ARMv7Assembler::linkJumpAbsolute):
15681         (JSC::ARMv7Assembler::twoWordOp5i6Imm4Reg4EncodedImmFirst):
15682         (JSC::ARMv7Assembler::twoWordOp5i6Imm4Reg4EncodedImmSecond):
15683         (JSC::ARMv7Assembler::ARMInstructionFormatter::twoWordOp5i6Imm4Reg4EncodedImm):
15684         * assembler/MacroAssemblerARMv7.h:
15685         (JSC::MacroAssemblerARMv7::makeJump):
15686         (JSC::MacroAssemblerARMv7::makeBranch):
15687         * jit/JIT.h:
15688         * wtf/Platform.h:
15689
15690 2009-10-28  Oliver Hunt  <oliver@apple.com>
15691
15692         Reviewed by Geoff Garen.
15693
15694         Improve for..in enumeration performance
15695         https://bugs.webkit.org/show_bug.cgi?id=30887
15696
15697         Improve indexing of an object with a for..in iterator by
15698         identifying cases where get_by_val is being used with a iterator
15699         as the subscript and replace it with a new get_by_pname
15700         bytecode.  get_by_pname then optimizes lookups that directly access
15701         the base object.
15702
15703         * bytecode/CodeBlock.cpp:
15704         (JSC::CodeBlock::dump):
15705         * bytecode/Opcode.h:
15706         * bytecompiler/BytecodeGenerator.cpp:
15707         (JSC::BytecodeGenerator::emitGetByVal):
15708         * bytecompiler/BytecodeGenerator.h:
15709         (JSC::BytecodeGenerator::pushOptimisedForIn):
15710         (JSC::BytecodeGenerator::popOptimisedForIn):
15711         * interpreter/Interpreter.cpp:
15712         (JSC::Interpreter::privateExecute):
15713         * jit/JIT.cpp:
15714         (JSC::JIT::privateCompileMainPass):
15715         (JSC::JIT::privateCompileSlowCases):
15716         * jit/JIT.h:
15717         * jit/JITPropertyAccess.cpp:
15718         (JSC::JIT::compileGetDirectOffset):
15719         (JSC::JIT::emit_op_get_by_pname):
15720         (JSC::JIT::emitSlow_op_get_by_pname):
15721         * parser/Nodes.cpp:
15722         (JSC::ForInNode::emitBytecode):
15723         * runtime/JSObject.h:
15724         * runtime/JSPropertyNameIterator.cpp:
15725         (JSC::JSPropertyNameIterator::create):
15726         * runtime/JSPropertyNameIterator.h:
15727         (JSC::JSPropertyNameIterator::getOffset):
15728         (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
15729         * runtime/JSValue.h:
15730         (JSC::JSValue::):
15731         * runtime/Structure.cpp:
15732         (JSC::Structure::addPropertyTransition):
15733         (JSC::Structure::changePrototypeTransition):
15734         (JSC::Structure::despecifyFunctionTransition):
15735         (JSC::Structure::addAnonymousSlotsTransition):
15736         (JSC::Structure::getterSetterTransition):
15737         (JSC::Structure::toDictionaryTransition):
15738         (JSC::Structure::addPropertyWithoutTransition):
15739           Track the existence (or not) of non-enumerable properties.
15740         * runtime/Structure.h:
15741         (JSC::Structure::propertyStorageCapacity):
15742         (JSC::Structure::propertyStorageSize):
15743         (JSC::Structure::hasNonEnumerableProperties):
15744         (JSC::Structure::hasAnonymousSlots):
15745
15746 2009-10-28  Dmitry Titov  <dimich@chromium.org>
15747
15748         Not reviewed, attemp to fix Windows build.
15749
15750         Touch the cpp file to cause recompile.
15751
15752         * wtf/Threading.cpp:
15753         (WTF::threadEntryPoint):
15754
15755 2009-10-28  Dmitry Titov  <dimich@chromium.org>
15756
15757         Reviewed by David Levin.
15758
15759         https://bugs.webkit.org/show_bug.cgi?id=30805
15760         Add MessageQueue::removeIf(Predicate&) to remove certain tasks without pulling them from the queue.
15761         Existing Database tests cover this since Database removes tasks when it is stopped.
15762
15763         * wtf/MessageQueue.h:
15764         (WTF::::removeIf):
15765
15766 2009-10-28  Afonso R. Costa Jr.  <afonso.costa@openbossa.org>
15767
15768         Reviewed by Oliver Hunt.
15769
15770         [Qt] Enable YARR when YARR_JIT is enabled
15771         https://bugs.webkit.org/show_bug.cgi?id=30730
15772
15773         When enabling or disabling JIT using JAVASCRIPTCORE_JIT, the ENABLE_YARR should
15774         be toggled also.
15775
15776         * JavaScriptCore.pri:
15777
15778 2009-10-24  Martin Robinson  <martin.james.robinson@gmail.com>
15779
15780         Reviewed by Oliver Hunt.
15781
15782         Fix strict aliasing warning by switching reinterpret_cast to bitwise_cast.
15783
15784         strict-aliasing warnings in JSFunction.h
15785         https://bugs.webkit.org/show_bug.cgi?id=27869
15786
15787         * runtime/JSFunction.h:
15788         (JSC::JSFunction::nativeFunction):
15789         (JSC::JSFunction::scopeChain):
15790         (JSC::JSFunction::setScopeChain):
15791         (JSC::JSFunction::setNativeFunction):
15792
15793 2009-10-28  Jan-Arve Sæther <jan-arve.saether@nokia.com>
15794
15795         Reviewed by Tor Arne Vestbø.
15796
15797         Build-fix for 64-bit Windows
15798
15799         * wtf/Platform.h: Make sure to use WTF_USE_JSVALUE64
15800
15801 2009-10-28  Gavin Barraclough  <barraclough@apple.com>
15802
15803         Reviewed by NOBODY (build fix!).
15804
15805         * jit/JIT.h:
15806
15807 2009-10-26  Holger Hans Peter Freyther  <zecke@selfish.org>
15808
15809         Rubber-stamped by Darin Adler.
15810
15811         Export fastMalloc, fastCalloc, fastRealloc and fastFree on GCC/Unix
15812         https://bugs.webkit.org/show_bug.cgi?id=30769
15813
15814         When using -fvisibility=hidden to hide all internal symbols by default
15815         the malloc symbols will be hidden as well. For memory instrumentation
15816         it is needed to provide an instrumented version of these symbols and
15817         override the normal routines and by changing the visibility back to
15818         default this becomes possible.
15819
15820         The only other solution would be to use system malloc instead of the
15821         TCmalloc implementation but this will not allow to analyze memory
15822         behavior with the default allocator.
15823
15824         * wtf/FastMalloc.h: Define WTF_FAST_MALLOC_EXPORT for GCC and !darwin
15825
15826 2009-10-27  Gavin Barraclough  <barraclough@apple.com>
15827
15828         Rubber Stamped by Samuel Q. Weinig.
15829
15830         Make the asserts protecting the offsets in the JIT more descriptive.
15831
15832         * jit/JIT.h:
15833         * jit/JITCall.cpp:
15834         (JSC::JIT::compileOpCall):
15835         * jit/JITPropertyAccess.cpp:
15836         (JSC::JIT::emit_op_method_check):
15837         (JSC::JIT::compileGetByIdHotPath):
15838         (JSC::JIT::compileGetByIdSlowCase):
15839         (JSC::JIT::emit_op_put_by_id):
15840
15841 2009-10-27  Geoffrey Garen  <ggaren@apple.com>
15842
15843         Reviewed by Sam Weinig.
15844
15845         A little bit of refactoring in the date code.
15846
15847         * JavaScriptCore.exp: Don't export this unused symbol.
15848
15849         * runtime/DateConstructor.cpp:
15850         (JSC::constructDate):
15851
15852         * runtime/DateInstance.cpp:
15853         (JSC::DateInstance::DateInstance):
15854         * runtime/DateInstance.h: Removed some unused functions. Changed the default
15855         constructor to ensure that a DateInstance is always initialized.
15856
15857         * runtime/DatePrototype.cpp:
15858         (JSC::DatePrototype::DatePrototype): Pass an initializer to our constructor,
15859         since it now requires one.
15860
15861         * wtf/DateMath.cpp:
15862         (WTF::msToGregorianDateTime): Only compute our offset from UTC if our
15863         output will require it. Otherwise, our offset is 0.
15864
15865 2009-10-27  Geoffrey Garen  <ggaren@apple.com>
15866
15867         Build fix: Mark DateInstaceCache.h private, so other frameworks can see it.
15868
15869         * JavaScriptCore.xcodeproj/project.pbxproj:
15870
15871 2009-10-27  Geoffrey Garen  <ggaren@apple.com>
15872
15873         Build fix: re-readded this file.
15874
15875         * runtime/DateInstanceCache.h: Added.
15876         (JSC::DateInstanceData::create):
15877         (JSC::DateInstanceData::DateInstanceData):
15878         (JSC::DateInstanceCache::DateInstanceCache):
15879         (JSC::DateInstanceCache::add):
15880         (JSC::DateInstanceCache::lookup):
15881
15882 2009-10-27  Geoffrey Garen  <ggaren@apple.com>
15883
15884         Reviewed by Darin Adler and Oliver Hunt.
15885
15886         https://bugs.webkit.org/show_bug.cgi?id=30800
15887         Cache recently computed date data.
15888         
15889         SunSpider reports a ~0.5% speedup, mostly from date-format-tofte.js.
15890
15891         * GNUmakefile.am:
15892         * JavaScriptCore.gypi:
15893         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
15894         * JavaScriptCore.xcodeproj/project.pbxproj: Added new file.
15895
15896         * runtime/DateInstance.cpp:
15897         (JSC::DateInstance::DateInstance):
15898         (JSC::DateInstance::getGregorianDateTime): Use the shared cache.
15899
15900         * runtime/DateInstance.h: Renamed m_cache to m_data, to avoid the confusion
15901         of a "cache cache".
15902
15903         * runtime/DatePrototype.cpp:
15904         (JSC::formatLocaleDate):
15905         (JSC::dateProtoFuncToString):
15906         (JSC::dateProtoFuncToUTCString):
15907         (JSC::dateProtoFuncToISOString):
15908         (JSC::dateProtoFuncToDateString):
15909         (JSC::dateProtoFuncToTimeString):
15910         (JSC::dateProtoFuncGetFullYear):
15911         (JSC::dateProtoFuncGetUTCFullYear):
15912         (JSC::dateProtoFuncToGMTString):
15913         (JSC::dateProtoFuncGetMonth):
15914         (JSC::dateProtoFuncGetUTCMonth):
15915         (JSC::dateProtoFuncGetDate):
15916         (JSC::dateProtoFuncGetUTCDate):
15917         (JSC::dateProtoFuncGetDay):
15918         (JSC::dateProtoFuncGetUTCDay):
15919         (JSC::dateProtoFuncGetHours):
15920         (JSC::dateProtoFuncGetUTCHours):
15921         (JSC::dateProtoFuncGetMinutes):
15922         (JSC::dateProtoFuncGetUTCMinutes):
15923         (JSC::dateProtoFuncGetSeconds):
15924         (JSC::dateProtoFuncGetUTCSeconds):
15925         (JSC::dateProtoFuncGetTimezoneOffset):
15926         (JSC::setNewValueFromTimeArgs):
15927         (JSC::setNewValueFromDateArgs):
15928         (JSC::dateProtoFuncSetYear):
15929         (JSC::dateProtoFuncGetYear): Pass an ExecState to these functions, so they
15930         can access the DateInstanceCache.
15931
15932         * runtime/JSGlobalData.h: Keep a DateInstanceCache.
15933
15934 2009-10-27  James Robinson  <jamesr@chromium.org>
15935
15936         Reviewed by Darin Fisher.
15937
15938         Ensures that JavaScriptCore/wtf/CurrentTime.cpp is not built in PLATFORM(CHROMIUM) builds.
15939
15940         Chromium uses a different method to calculate the current time than is used in
15941         JavaScriptCore/wtf/CurrentTime.cpp. This can lead to time skew when calls to currentTime() and Chromium's time
15942         function are mixed.  In particular, timers can get scheduled in the past which leads to 100% CPU use.
15943         See http://code.google.com/p/chromium/issues/detail?id=25892 for an example.
15944
15945         https://bugs.webkit.org/show_bug.cgi?id=30833
15946
15947         * JavaScriptCore.gyp/JavaScriptCore.gyp:
15948         * wtf/CurrentTime.cpp:
15949
15950 2009-10-27  Peter Varga  <pvarga@inf.u-szeged.hu>
15951
15952         Rubber-stamped by Tor Arne Vestbø.
15953
15954         Fix typo in RegexInterpreter.cpp and RegexJIT.cpp alterantive to
15955         alternative.
15956
15957         * yarr/RegexInterpreter.cpp:
15958         (JSC::Yarr::ByteCompiler::alternativeBodyDisjunction):
15959         (JSC::Yarr::ByteCompiler::alternativeDisjunction):
15960         (JSC::Yarr::ByteCompiler::emitDisjunction):
15961         * yarr/RegexJIT.cpp:
15962         (JSC::Yarr::RegexGenerator::generateDisjunction):
15963
15964 2009-10-26  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
15965
15966         Reviewed by Darin Adler.
15967
15968         Make .rc files compile on Windows without depending on MFC headers
15969         https://bugs.webkit.org/show_bug.cgi?id=30750
15970
15971         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.rc: Use
15972         winresrc.h because it exists even when MFC is not installed, and is
15973         all that's needed here.
15974
15975 2009-10-26  Gabor Loki  <loki@inf.u-szeged.hu>
15976
15977         Reviewed by Gavin Barraclough.
15978
15979         The thunkReturnAddress is on JITStackFrame on ARM JIT as well
15980         https://bugs.webkit.org/show_bug.cgi?id=30782
15981
15982         Move the thunkReturnAddress from top of the stack into the JITStackFrame
15983         structure. This is a requirement for JSValue32_64 support on ARM.
15984
15985         * assembler/MacroAssemblerARM.h:
15986         (JSC::MacroAssemblerARM::ret): Return with link register
15987         (JSC::MacroAssemblerARM::prepareCall): Store the return address in link register
15988         * jit/JIT.h: Remove unused ctiReturnRegister
15989         * jit/JITInlineMethods.h: Same as ARMv7
15990         (JSC::JIT::restoreArgumentReference): Ditto.
15991         (JSC::JIT::restoreArgumentReferenceForTrampoline): Ditto.
15992         * jit/JITOpcodes.cpp: Remove ctiReturnRegister related instruction
15993         * jit/JITStubs.cpp: Store thunkReturnAddress on JITStackFrame. Use
15994         small trampoline functions which handle return addresses for each
15995         CTI_STUB_FUNCTION.
15996         * jit/JITStubs.h: Store thunkReturnAddress on JITStackFrame
15997         (JSC::JITStackFrame::returnAddressSlot): Return with the address of thunkReturnAddress
15998         * yarr/RegexJIT.cpp:
15999         (JSC::Yarr::RegexGenerator::generateEnter): Remove the unnecessary instruction
16000
16001 2009-10-26  Steve Block  <steveblock@google.com>
16002
16003         Reviewed by Darin Adler.
16004
16005         Adds ability to disable ReadWriteLock on platforms (eg Android) that use pthreads but do not support pthread_rwlock.
16006         https://bugs.webkit.org/show_bug.cgi?id=30713
16007
16008         * wtf/Platform.h: Modified. Defines HAVE_PTHREAD_RWLOCK for all platforms currently using pthreads.
16009         * wtf/Threading.h: Modified. Use pthread_rwlock_t only when HAVE_PTHREAD_RWLOCK is defined.
16010         * wtf/ThreadingPthreads.cpp: Modified. Build ReadWriteLock methods only when HAVE_PTHREAD_RWLOCK is defined.
16011
16012 2009-10-24  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
16013
16014         Reviewed by Holger Freyther.
16015
16016         [Qt] [Symbian] Set the capability and memory required to run QtWebKit for Symbian
16017         https://bugs.webkit.org/show_bug.cgi?id=30476
16018
16019         Assign ReadUserData WriteUserData NetworkServices Symbian capabilities
16020         to jsc.exe.
16021
16022         * jsc.pro:
16023
16024 2009-10-23  Steve Block  <steveblock@google.com>
16025
16026         Reviewed by Dmitry Titov.
16027
16028         Fixes a leak in createThreadInternal on Android.
16029         https://bugs.webkit.org/show_bug.cgi?id=30698
16030
16031         * wtf/ThreadingPthreads.cpp: Modified.
16032         (WTF::createThreadInternal): Avoid leaking a ThreadData object on failure.
16033
16034 2009-10-22  Geoffrey Garen  <ggaren@apple.com>
16035
16036         Reviewed by Alexey Proskuryakov.
16037
16038         Fixed ASSERT when opening Safari's Caches window while the Web Inspector
16039         is open.
16040
16041         * runtime/Collector.cpp:
16042         (JSC::typeName): Added two new types to the type name list in the Collector.
16043         These types have been around for a while, but nobody remembered to consider them here.
16044
16045         * runtime/JSCell.h:
16046         (JSC::JSCell::isPropertyNameIterator):
16047         * runtime/JSPropertyNameIterator.h:
16048         (JSC::JSPropertyNameIterator::isPropertyNameIterator): Give the Collector
16049         a way to tell if a cell is a JSPropertyNameIterator.
16050
16051 2009-10-22  Steve Falkenburg  <sfalken@apple.com>
16052
16053         Reviewed by Jon Honeycutt.
16054
16055         https://bugs.webkit.org/show_bug.cgi?id=30686
16056         Remove debug-specific def file.
16057         Only Debug_All target uses JavaScriptCore_debug.dll naming, and since
16058         that target is only used internally, maintaining two files just to
16059         suppress a single link warning isn't worthwhile.
16060
16061         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
16062         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: Removed.
16063
16064 2009-10-21  Jon Honeycutt  <jhoneycutt@apple.com>
16065
16066         <rdar://problem/7270320> Screenshots of off-screen plug-ins are blank
16067         <rdar://problem/7270314> After halting a transparent PluginView on
16068         Windows, the transparency is applied twice
16069
16070         Reviewed by Dan Bernstein.
16071
16072         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
16073         Export WTF::deleteOwnedPtr(HDC).
16074
16075         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
16076         Ditto.
16077
16078 2009-10-20  Geoffrey Garen  <ggaren@apple.com>
16079
16080         Windows build fix: updated variable name.
16081
16082         * runtime/DatePrototype.cpp:
16083         (JSC::formatLocaleDate):
16084
16085 2009-10-20  Geoffrey Garen  <ggaren@apple.com>
16086
16087         Reviewed by Mark Rowe.
16088
16089         * jit/JITOpcodes.cpp:
16090         (JSC::JIT::emit_op_next_pname): Slightly tweaked this #ifdef to match the
16091         size of a JSValue because m_jsStrings is an array of JSValues.
16092
16093 2009-10-20  Geoffrey Garen  <ggaren@apple.com>
16094
16095         Reviewed by Mark Rowe.
16096
16097         Fixed a 64-bit regression caused by the fix for
16098         https://bugs.webkit.org/show_bug.cgi?id=30570.
16099
16100         * jit/JITOpcodes.cpp:
16101         (JSC::JIT::emit_op_next_pname): Use TimesEight stepping on 64-bit, since
16102         64-bit pointers are eight bytes long.
16103
16104 2009-10-20  Geoffrey Garen  <ggaren@apple.com>
16105
16106         Reviewed by Sam Weinig.
16107
16108         Refactored DateInstance::msToGregorianDateTime so that a DateInstance's
16109         caller doesn't need to supply the DateInstance's own internal value to
16110         the DateInstance.
16111
16112         * runtime/DateInstance.cpp:
16113         (JSC::DateInstance::getGregorianDateTime): Renamed from "msToGregorianDateTime".
16114
16115         * runtime/DateInstance.h:
16116         * runtime/DatePrototype.cpp:
16117         (JSC::formatLocaleDate):
16118         (JSC::dateProtoFuncToString):
16119         (JSC::dateProtoFuncToUTCString):
16120         (JSC::dateProtoFuncToISOString):
16121         (JSC::dateProtoFuncToDateString):
16122         (JSC::dateProtoFuncToTimeString):
16123         (JSC::dateProtoFuncToLocaleString):
16124         (JSC::dateProtoFuncToLocaleDateString):
16125         (JSC::dateProtoFuncToLocaleTimeString):
16126         (JSC::dateProtoFuncGetTime):
16127         (JSC::dateProtoFuncGetFullYear):
16128         (JSC::dateProtoFuncGetUTCFullYear):
16129         (JSC::dateProtoFuncToGMTString):
16130         (JSC::dateProtoFuncGetMonth):
16131         (JSC::dateProtoFuncGetUTCMonth):
16132         (JSC::dateProtoFuncGetDate):
16133         (JSC::dateProtoFuncGetUTCDate):
16134         (JSC::dateProtoFuncGetDay):
16135         (JSC::dateProtoFuncGetUTCDay):
16136         (JSC::dateProtoFuncGetHours):
16137         (JSC::dateProtoFuncGetUTCHours):
16138         (JSC::dateProtoFuncGetMinutes):
16139         (JSC::dateProtoFuncGetUTCMinutes):
16140         (JSC::dateProtoFuncGetSeconds):
16141         (JSC::dateProtoFuncGetUTCSeconds):
16142         (JSC::dateProtoFuncGetTimezoneOffset):
16143         (JSC::setNewValueFromTimeArgs):
16144         (JSC::setNewValueFromDateArgs):
16145         (JSC::dateProtoFuncSetYear):
16146         (JSC::dateProtoFuncGetYear): Also renamed "utc" to "outputIsUTC", for clarity.
16147
16148 2009-10-20  Gabor Loki  <loki@inf.u-szeged.hu>
16149
16150         Reviewed by Geoffrey Garen.
16151
16152         The op_next_pname should use 4 bytes addressing mode in case of JSValue32
16153         https://bugs.webkit.org/show_bug.cgi?id=30570
16154
16155         * jit/JITOpcodes.cpp:
16156         (JSC::JIT::emit_op_next_pname):
16157
16158 2009-10-20  Gabor Loki  <loki@inf.u-szeged.hu>
16159
16160         Reviewed by Oliver Hunt.
16161
16162         Move OverridesMarkChildren flag from DatePrototype to its parent class
16163         https://bugs.webkit.org/show_bug.cgi?id=30372
16164
16165         * runtime/DateInstance.h:
16166         (JSC::DateInstance::createStructure):
16167         * runtime/DatePrototype.h:
16168
16169 2009-10-19  Geoffrey Garen  <ggaren@apple.com>
16170
16171         Reviewed by Oliver Hunt.
16172
16173         Tightened up some put_by_id_transition code generation.
16174         https://bugs.webkit.org/show_bug.cgi?id=30539
16175
16176         * jit/JIT.h:
16177         * jit/JITPropertyAccess.cpp:
16178         (JSC::JIT::testPrototype):
16179         (JSC::JIT::privateCompilePutByIdTransition): No need to do object type
16180         checks or read Structures and prototypes from objects: they're all known
16181         constants at compile time.
16182
16183 2009-10-19  Geoffrey Garen  <ggaren@apple.com>
16184
16185         Reviewed by Sam Weinig.
16186
16187         Added a private API for getting a global context from a context, for
16188         clients who want to preserve a context for a later callback.
16189
16190         * API/APICast.h:
16191         (toGlobalRef): Added an ASSERT, since this function is used more often
16192         than before.
16193
16194         * API/JSContextRef.cpp:
16195         * API/JSContextRefPrivate.h: Added. The new API.
16196
16197         * API/tests/testapi.c:
16198         (print_callAsFunction):
16199         (main): Test the new API.
16200
16201         * JavaScriptCore.exp:
16202         * JavaScriptCore.xcodeproj/project.pbxproj: Build and export the new API.
16203
16204 2009-10-17  Geoffrey Garen  <ggaren@apple.com>
16205
16206         Reviewed by Oliver Hunt.
16207         
16208         Tightened up some instanceof code generation.
16209         https://bugs.webkit.org/show_bug.cgi?id=30488
16210
16211         * jit/JITOpcodes.cpp:
16212         (JSC::JIT::emit_op_instanceof):
16213         (JSC::JIT::emitSlow_op_instanceof): No need to do object type checks - 
16214         cell type checks and ImplementsDefaultHasIntance checks implicitly
16215         supersede object type checks.
16216
16217 2009-10-18  Kwang Yul Seo  <skyul@company100.net>
16218
16219         Reviewed by Darin Adler.
16220
16221         Use _stricmp and _strnicmp instead of deprecated stricmp and strnicmp.
16222         https://bugs.webkit.org/show_bug.cgi?id=30474
16223
16224         stricmp and strnicmp are deprecated beginning in Visual
16225         C++ 2005. Use _stricmp and _strnicmp instead in StringExtras.h.
16226
16227         * wtf/StringExtras.h:
16228         (strncasecmp):
16229         (strcasecmp):
16230
16231 2009-10-16  Geoffrey Garen  <ggaren@apple.com>
16232
16233         Build fix: apparently we shouldn't export those symbols?
16234
16235         * JavaScriptCore.exp:
16236
16237 2009-10-16  Geoffrey Garen  <ggaren@apple.com>
16238
16239         Build fix: export some symbols.
16240
16241         * JavaScriptCore.exp:
16242
16243 2009-10-16  Oliver Hunt  <oliver@apple.com>
16244
16245         Reviewed by Gavin Barraclough.
16246
16247         structure typeinfo flags should be inherited.
16248         https://bugs.webkit.org/show_bug.cgi?id=30468
16249
16250         Add StructureFlag constant to the various JSC classes and use
16251         it for the TypeInfo construction.  This allows us to simply
16252         accumulate flags by basing each classes StructureInfo on its parents.
16253
16254         * API/JSCallbackConstructor.h:
16255         (JSC::JSCallbackConstructor::createStructure):
16256         * API/JSCallbackFunction.h:
16257         (JSC::JSCallbackFunction::createStructure):
16258         * API/JSCallbackObject.h:
16259         (JSC::JSCallbackObject::createStructure):
16260         * debugger/DebuggerActivation.h:
16261         (JSC::DebuggerActivation::createStructure):
16262         * runtime/Arguments.h:
16263         (JSC::Arguments::createStructure):
16264         * runtime/BooleanObject.h:
16265         (JSC::BooleanObject::createStructure):
16266         * runtime/DatePrototype.h:
16267         (JSC::DatePrototype::createStructure):
16268         * runtime/FunctionPrototype.h:
16269         (JSC::FunctionPrototype::createStructure):
16270         * runtime/GlobalEvalFunction.h:
16271         (JSC::GlobalEvalFunction::createStructure):
16272         * runtime/InternalFunction.h:
16273         (JSC::InternalFunction::createStructure):
16274         * runtime/JSActivation.h:
16275         (JSC::JSActivation::createStructure):
16276         * runtime/JSArray.h:
16277         (JSC::JSArray::createStructure):
16278         * runtime/JSByteArray.cpp:
16279         (JSC::JSByteArray::createStructure):
16280         * runtime/JSByteArray.h:
16281         * runtime/JSFunction.h:
16282         (JSC::JSFunction::createStructure):
16283         * runtime/JSGlobalObject.h:
16284         (JSC::JSGlobalObject::createStructure):
16285         * runtime/JSNotAnObject.h:
16286         (JSC::JSNotAnObject::createStructure):
16287         * runtime/JSONObject.h:
16288         (JSC::JSONObject::createStructure):
16289         * runtime/JSObject.h:
16290         (JSC::JSObject::createStructure):
16291         * runtime/JSStaticScopeObject.h:
16292         (JSC::JSStaticScopeObject::createStructure):
16293         * runtime/JSVariableObject.h:
16294         (JSC::JSVariableObject::createStructure):
16295         * runtime/JSWrapperObject.h:
16296         (JSC::JSWrapperObject::createStructure):
16297         * runtime/MathObject.h:
16298         (JSC::MathObject::createStructure):
16299         * runtime/NumberConstructor.h:
16300         (JSC::NumberConstructor::createStructure):
16301         * runtime/NumberObject.h:
16302         (JSC::NumberObject::createStructure):
16303         * runtime/RegExpConstructor.h:
16304         (JSC::RegExpConstructor::createStructure):
16305         * runtime/RegExpObject.h:
16306         (JSC::RegExpObject::createStructure):
16307         * runtime/StringObject.h:
16308         (JSC::StringObject::createStructure):
16309         * runtime/StringObjectThatMasqueradesAsUndefined.h:
16310         (JSC::StringObjectThatMasqueradesAsUndefined::createStructure):
16311
16312 2009-10-16  Geoffrey Garen  <ggaren@apple.com>
16313
16314         Reviewed by Oliver Hunt.
16315         
16316         Fast for-in enumeration: Cache JSPropertyNameIterator; cache JSStrings
16317         in JSPropertyNameIterator; inline more code.
16318
16319         1.024x as fast on SunSpider (fasta: 1.43x as fast).
16320
16321         * bytecode/CodeBlock.cpp:
16322         (JSC::CodeBlock::dump):
16323         * bytecode/Opcode.h:
16324         * bytecompiler/BytecodeGenerator.cpp:
16325         (JSC::BytecodeGenerator::emitGetPropertyNames):
16326         (JSC::BytecodeGenerator::emitNextPropertyName):
16327         * bytecompiler/BytecodeGenerator.h: Added a few extra operands to
16328         op_get_pnames and op_next_pname so that we can track iteration state
16329         in the register file instead of in the JSPropertyNameIterator. (To be
16330         cacheable, the JSPropertyNameIterator must be stateless.)
16331
16332         * interpreter/Interpreter.cpp:
16333         (JSC::Interpreter::tryCachePutByID):
16334         (JSC::Interpreter::tryCacheGetByID): Updated for rename to
16335         "normalizePrototypeChain" and removal of "isCacheable". 
16336
16337         (JSC::Interpreter::privateExecute): Updated for in-RegisterFile
16338         iteration state tracking.
16339
16340         * jit/JIT.cpp:
16341         (JSC::JIT::privateCompileMainPass):
16342         * jit/JIT.h:
16343         * jit/JITOpcodes.cpp:
16344         (JSC::JIT::emit_op_get_pnames): Updated for in-RegisterFile
16345         iteration state tracking.
16346
16347         (JSC::JIT::emit_op_next_pname): Inlined code generation for op_next_pname.
16348
16349         * jit/JITStubs.cpp:
16350         (JSC::JITThunks::tryCachePutByID):
16351         (JSC::JITThunks::tryCacheGetByID): Updated for rename to
16352         "normalizePrototypeChain" and removal of "isCacheable". 
16353
16354         (JSC::DEFINE_STUB_FUNCTION):
16355         * jit/JITStubs.h:
16356         (JSC::): Added has_property and to_object stubs. Removed op_next_pname
16357         stub, since has_property is all we need anymore.
16358
16359         * parser/Nodes.cpp:
16360         (JSC::ForInNode::emitBytecode): Updated for in-RegisterFile
16361         iteration state tracking.
16362
16363         * runtime/JSCell.h:
16364         * runtime/JSObject.cpp:
16365         (JSC::JSObject::getPropertyNames): Don't do caching at this layer
16366         anymore, since we don't create a JSPropertyNameIterator at this layer.
16367
16368         * runtime/JSPropertyNameIterator.cpp:
16369         (JSC::JSPropertyNameIterator::create): Do do caching at this layer.
16370         (JSC::JSPropertyNameIterator::get):  Updated for in-RegisterFile
16371         iteration state tracking.
16372         (JSC::JSPropertyNameIterator::markChildren): Mark our JSStrings.
16373
16374         * runtime/JSPropertyNameIterator.h:
16375         (JSC::JSPropertyNameIterator::size):
16376         (JSC::JSPropertyNameIterator::setCachedStructure):
16377         (JSC::JSPropertyNameIterator::cachedStructure):
16378         (JSC::JSPropertyNameIterator::setCachedPrototypeChain):
16379         (JSC::JSPropertyNameIterator::cachedPrototypeChain):
16380         (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
16381         (JSC::Structure::setEnumerationCache): Don't store iteration state in
16382         a JSPropertyNameIterator. Do cache a JSPropertyNameIterator in a
16383         Structure.
16384
16385         * runtime/JSValue.h:
16386         (JSC::asCell):
16387         * runtime/MarkStack.h: Make those mischievous #include gods happy.
16388
16389         * runtime/ObjectConstructor.cpp:
16390
16391         * runtime/Operations.h:
16392         (JSC::normalizePrototypeChain): Renamed countPrototypeChainEntriesAndCheckForProxies
16393         to normalizePrototypeChain, since it changes dictionary prototypes to
16394         non-dictionary objects.
16395
16396         * runtime/PropertyNameArray.cpp:
16397         (JSC::PropertyNameArray::add):
16398         * runtime/PropertyNameArray.h:
16399         (JSC::PropertyNameArrayData::PropertyNameArrayData):
16400         (JSC::PropertyNameArray::data):
16401         (JSC::PropertyNameArray::size):
16402         (JSC::PropertyNameArray::begin):
16403         (JSC::PropertyNameArray::end): Simplified some code here to help with
16404         current and future refactoring.
16405
16406         * runtime/Protect.h:
16407         * runtime/Structure.cpp:
16408         (JSC::Structure::~Structure):
16409         (JSC::Structure::addPropertyWithoutTransition):
16410         (JSC::Structure::removePropertyWithoutTransition): No need to clear
16411         the enumeration cache with adding / removing properties without
16412         transition. It is an error to add / remove properties without transition
16413         once an object has been observed, and we can ASSERT to catch that.
16414
16415         * runtime/Structure.h:
16416         (JSC::Structure::enumerationCache): Changed the enumeration cache to
16417         hold a JSPropertyNameIterator.
16418
16419         * runtime/StructureChain.cpp:
16420         * runtime/StructureChain.h:
16421         (JSC::StructureChain::head): Removed StructureChain::isCacheable because
16422         it was wrong-headed in two ways: (1) It gave up when a prototype was a
16423         dictionary, but instead we want un-dictionary heavily accessed
16424         prototypes; (2) It folded a test for hasDefaultGetPropertyNames() into
16425         a generic test for "cacheable-ness", but hasDefaultGetPropertyNames()
16426         is only releavant to for-in caching.
16427
16428 2009-10-16  Steve Falkenburg  <sfalken@apple.com>
16429
16430         Reviewed by Adam Roben.
16431
16432         Add a Debug_All configuration to build entire stack as debug.
16433         Change Debug_Internal to:
16434         - stop using _debug suffix for all WebKit/Safari binaries
16435         - not use _debug as a DLL naming suffix
16436         - use non-debug C runtime lib.
16437
16438         * JavaScriptCore.vcproj/JavaScriptCore.make: Debug build in makefile should build Debug_All.
16439         * JavaScriptCore.vcproj/JavaScriptCore.sln: Add Debug_All configuration.
16440         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add Debug_All configuration.
16441         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj: Renamed single configuration from "Release" to "all".
16442         * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln: Add Debug_All configuration.
16443         * JavaScriptCore.vcproj/WTF/WTF.vcproj: Add Debug_All configuration.
16444         * JavaScriptCore.vcproj/jsc/jsc.vcproj: Add Debug_All configuration.
16445         * JavaScriptCore.vcproj/testapi/testapi.vcproj: Add Debug_All configuration.
16446
16447 2009-10-16  Oliver Hunt  <oliver@apple.com>
16448
16449         Reviewed by Gavin Barraclough.
16450
16451         Make typeinfo flags default to false
16452         https://bugs.webkit.org/show_bug.cgi?id=30372
16453
16454         Last part -- replace HasDefaultGetPropertyNames with OverridesGetPropertyNames
16455         flag.
16456
16457         * API/JSCallbackConstructor.h:
16458         (JSC::JSCallbackConstructor::createStructure):
16459         * API/JSCallbackObject.h:
16460         (JSC::JSCallbackObject::createStructure):
16461         * debugger/DebuggerActivation.h:
16462         (JSC::DebuggerActivation::createStructure):
16463         * runtime/Arguments.h:
16464         (JSC::Arguments::createStructure):
16465         * runtime/BooleanObject.h:
16466         (JSC::BooleanObject::createStructure):
16467         * runtime/DatePrototype.h:
16468         (JSC::DatePrototype::createStructure):
16469         * runtime/FunctionPrototype.h:
16470         (JSC::FunctionPrototype::createStructure):
16471         * runtime/GlobalEvalFunction.h:
16472         (JSC::GlobalEvalFunction::createStructure):
16473         * runtime/JSAPIValueWrapper.h:
16474         (JSC::JSAPIValueWrapper::createStructure):
16475         * runtime/JSActivation.h:
16476         (JSC::JSActivation::createStructure):
16477         * runtime/JSArray.h:
16478         (JSC::JSArray::createStructure):
16479         * runtime/JSByteArray.cpp:
16480         (JSC::JSByteArray::createStructure):
16481         * runtime/JSFunction.h:
16482         (JSC::JSFunction::createStructure):
16483         * runtime/JSGlobalObject.h:
16484         (JSC::JSGlobalObject::createStructure):
16485         * runtime/JSNotAnObject.h:
16486         (JSC::JSNotAnObject::createStructure):
16487         * runtime/JSONObject.h:
16488         (JSC::JSONObject::createStructure):
16489         * runtime/JSObject.cpp:
16490         (JSC::JSObject::getPropertyNames):
16491         * runtime/JSObject.h:
16492         (JSC::JSObject::createStructure):
16493         * runtime/JSStaticScopeObject.h:
16494         (JSC::JSStaticScopeObject::createStructure):
16495         * runtime/JSTypeInfo.h:
16496         (JSC::TypeInfo::overridesGetPropertyNames):
16497         * runtime/JSVariableObject.h:
16498         (JSC::JSVariableObject::createStructure):
16499         * runtime/JSWrapperObject.h:
16500         (JSC::JSWrapperObject::createStructure):
16501         * runtime/MathObject.h:
16502         (JSC::MathObject::createStructure):
16503         * runtime/NumberConstructor.h:
16504         (JSC::NumberConstructor::createStructure):
16505         * runtime/NumberObject.h:
16506         (JSC::NumberObject::createStructure):
16507         * runtime/RegExpConstructor.h:
16508         (JSC::RegExpConstructor::createStructure):
16509         * runtime/RegExpObject.h:
16510         (JSC::RegExpObject::createStructure):
16511         * runtime/StringObject.h:
16512         (JSC::StringObject::createStructure):
16513         * runtime/StringObjectThatMasqueradesAsUndefined.h:
16514         (JSC::StringObjectThatMasqueradesAsUndefined::createStructure):
16515         * runtime/StructureChain.cpp:
16516         (JSC::StructureChain::isCacheable):
16517
16518 2009-10-16  Kevin Ollivier  <kevino@theolliviers.com>
16519
16520         wxMSW build fix, we can't use the simple hash there because the PlatformModuleVersion 
16521         structure differs.
16522
16523         * wtf/Platform.h:
16524
16525 2009-10-16  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
16526
16527         Reviewed by Simon Hausmann.
16528
16529         [Qt] Implement ExecutableAllocator for Symbian
16530         https://bugs.webkit.org/show_bug.cgi?id=29946
16531
16532         Tested with YARR JIT enabled for Symbian; 
16533         This patch does not (yet) enable YARR JIT by default.
16534
16535         * JavaScriptCore.pri:
16536         * jit/ExecutableAllocator.h:
16537         * jit/ExecutableAllocatorSymbian.cpp: Added.
16538         (JSC::ExecutableAllocator::intializePageSize):
16539         (JSC::ExecutablePool::systemAlloc):
16540         (JSC::ExecutablePool::systemRelease):
16541
16542 2009-10-15  Oliver Hunt  <oliver@apple.com>
16543
16544         Reviewed by Darin Adler.
16545
16546         Make typeinfo flags default to false
16547         https://bugs.webkit.org/show_bug.cgi?id=30372
16548
16549         Part 2 -- Reverse the TypeInfo HasDefaultMark flag to OverridesMarkChildren, etc
16550
16551         * API/JSCallbackConstructor.h:
16552         (JSC::JSCallbackConstructor::createStructure):
16553         * API/JSCallbackFunction.h:
16554         (JSC::JSCallbackFunction::createStructure):
16555         * API/JSCallbackObject.h:
16556         (JSC::JSCallbackObject::createStructure):
16557         * debugger/DebuggerActivation.h:
16558         (JSC::DebuggerActivation::createStructure):
16559         * runtime/Arguments.h:
16560         (JSC::Arguments::createStructure):
16561         * runtime/BooleanObject.h:
16562         (JSC::BooleanObject::createStructure):
16563         * runtime/DatePrototype.h:
16564         (JSC::DatePrototype::createStructure):
16565         * runtime/FunctionPrototype.h:
16566         (JSC::FunctionPrototype::createStructure):
16567         * runtime/GetterSetter.h:
16568         (JSC::GetterSetter::createStructure):
16569         * runtime/GlobalEvalFunction.h:
16570         (JSC::GlobalEvalFunction::createStructure):
16571         * runtime/InternalFunction.h:
16572         (JSC::InternalFunction::createStructure):
16573         * runtime/JSAPIValueWrapper.h:
16574         (JSC::JSAPIValueWrapper::createStructure):
16575         * runtime/JSActivation.h:
16576         (JSC::JSActivation::createStructure):
16577         * runtime/JSArray.h:
16578         (JSC::JSArray::createStructure):
16579         (JSC::MarkStack::markChildren):
16580         * runtime/JSByteArray.cpp:
16581         (JSC::JSByteArray::createStructure):
16582         * runtime/JSFunction.h:
16583         (JSC::JSFunction::createStructure):
16584         * runtime/JSGlobalObject.h:
16585         (JSC::JSGlobalObject::createStructure):
16586         * runtime/JSNotAnObject.h:
16587         (JSC::JSNotAnObject::createStructure):
16588         * runtime/JSNumberCell.h:
16589         (JSC::JSNumberCell::createStructure):
16590         * runtime/JSONObject.h:
16591         (JSC::JSONObject::createStructure):
16592         * runtime/JSObject.h:
16593         (JSC::JSObject::createStructure):
16594         * runtime/JSPropertyNameIterator.h:
16595         (JSC::JSPropertyNameIterator::createStructure):
16596         * runtime/JSStaticScopeObject.h:
16597         (JSC::JSStaticScopeObject::createStructure):
16598         * runtime/JSString.h:
16599         (JSC::JSString::createStructure):
16600         * runtime/JSTypeInfo.h:
16601         (JSC::TypeInfo::overridesMarkChildren):
16602         * runtime/JSVariableObject.h:
16603         (JSC::JSVariableObject::createStructure):
16604         * runtime/JSWrapperObject.h:
16605         (JSC::JSWrapperObject::createStructure):
16606         * runtime/MathObject.h:
16607         (JSC::MathObject::createStructure):
16608         * runtime/NumberConstructor.h:
16609         (JSC::NumberConstructor::createStructure):
16610         * runtime/NumberObject.h:
16611         (JSC::NumberObject::createStructure):
16612         * runtime/RegExpConstructor.h:
16613         (JSC::RegExpConstructor::createStructure):
16614         * runtime/RegExpObject.h:
16615         (JSC::RegExpObject::createStructure):
16616         * runtime/StringObject.h:
16617         (JSC::StringObject::createStructure):
16618         * runtime/StringObjectThatMasqueradesAsUndefined.h:
16619         (JSC::StringObjectThatMasqueradesAsUndefined::createStructure):
16620
16621 2009-10-14  Oliver Hunt  <oliver@apple.com>
16622
16623         Reviewed by Geoff Garen.
16624
16625         Make typeinfo flags default to false
16626         https://bugs.webkit.org/show_bug.cgi?id=30372
16627         
16628         Part 1. Reverse the HasStandardGetOwnPropertySlot flag.
16629
16630         * API/JSCallbackConstructor.h:
16631         (JSC::JSCallbackConstructor::createStructure):
16632         * API/JSCallbackFunction.h:
16633         (JSC::JSCallbackFunction::createStructure):
16634         * API/JSCallbackObject.h:
16635         (JSC::JSCallbackObject::createStructure):
16636         * debugger/DebuggerActivation.h:
16637         (JSC::DebuggerActivation::createStructure):
16638         * jit/JITStubs.cpp:
16639         (JSC::DEFINE_STUB_FUNCTION):
16640         * runtime/Arguments.h:
16641         (JSC::Arguments::createStructure):
16642         * runtime/BooleanObject.h:
16643         (JSC::BooleanObject::createStructure):
16644         * runtime/DatePrototype.h:
16645         (JSC::DatePrototype::createStructure):
16646         * runtime/FunctionPrototype.h:
16647         (JSC::FunctionPrototype::createStructure):
16648         * runtime/GlobalEvalFunction.h:
16649         (JSC::GlobalEvalFunction::createStructure):
16650         * runtime/InternalFunction.h:
16651         (JSC::InternalFunction::createStructure):
16652         * runtime/JSActivation.h:
16653         (JSC::JSActivation::createStructure):
16654         * runtime/JSArray.h:
16655         (JSC::JSArray::createStructure):
16656         * runtime/JSByteArray.cpp:
16657         (JSC::JSByteArray::createStructure):
16658         * runtime/JSFunction.h:
16659         (JSC::JSFunction::createStructure):
16660         * runtime/JSGlobalObject.h:
16661         (JSC::JSGlobalObject::createStructure):
16662         * runtime/JSNumberCell.h:
16663         (JSC::JSNumberCell::createStructure):
16664         * runtime/JSONObject.h:
16665         (JSC::JSONObject::createStructure):
16666         * runtime/JSObject.h:
16667         (JSC::JSObject::createStructure):
16668         (JSC::JSCell::fastGetOwnPropertySlot):
16669         * runtime/JSStaticScopeObject.h:
16670         (JSC::JSStaticScopeObject::createStructure):
16671         * runtime/JSString.h:
16672         (JSC::JSString::createStructure):
16673         * runtime/JSTypeInfo.h:
16674         (JSC::TypeInfo::overridesGetOwnPropertySlot):
16675         * runtime/JSVariableObject.h:
16676         (JSC::JSVariableObject::createStructure):
16677         * runtime/JSWrapperObject.h:
16678         (JSC::JSWrapperObject::createStructure):
16679         * runtime/MathObject.h:
16680         (JSC::MathObject::createStructure):
16681         * runtime/NumberConstructor.h:
16682         (JSC::NumberConstructor::createStructure):
16683         * runtime/NumberObject.h:
16684         (JSC::NumberObject::createStructure):
16685         * runtime/RegExpConstructor.h:
16686         (JSC::RegExpConstructor::createStructure):
16687         * runtime/RegExpObject.h:
16688         (JSC::RegExpObject::createStructure):
16689         * runtime/StringObject.h:
16690         (JSC::StringObject::createStructure):
16691         * runtime/StringObjectThatMasqueradesAsUndefined.h:
16692         (JSC::StringObjectThatMasqueradesAsUndefined::createStructure):
16693
16694 2009-10-14  Kevin Ollivier  <kevino@theolliviers.com>
16695 2009-10-14  Darin Adler  <darin@apple.com>
16696
16697         Additions so fix for https://bugs.webkit.org/show_bug.cgi?id=18994
16698         can build on Windows.
16699
16700         * wtf/MathExtras.h: Added llround and llroundf for Windows.
16701
16702 2009-10-14  Kevin Ollivier  <kevino@theolliviers.com>
16703
16704         wx build fix. Set ENABLE_PLUGIN_PACKAGE_SIMPLE_HASH for plugins while we're still building stubs.
16705
16706         * wtf/Platform.h:
16707
16708 2009-10-13  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
16709
16710         Reviewed by Simon Hausmann.
16711
16712         Refactor ENABLE_PLUGIN_PACKAGE_SIMPLE_HASH
16713         https://bugs.webkit.org/show_bug.cgi?id=30278
16714
16715         Move the definition of ENABLE_PLUGIN_PACKAGE_SIMPLE_HASH
16716         from the make system into common code.
16717
16718         * wtf/Platform.h:
16719
16720 2009-10-13  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
16721
16722         Reviewed by Darin Adler.
16723
16724         ARM compiler does not understand reinterpret_cast<void*>
16725         https://bugs.webkit.org/show_bug.cgi?id=29034
16726
16727         Change reinterpret_cast<void*> to regular C style (void*) cast 
16728         for the ARM RVCT compiler.
16729
16730         * assembler/MacroAssemblerCodeRef.h:
16731         (JSC::FunctionPtr::FunctionPtr): 
16732         * jit/JITOpcodes.cpp: Cast to FunctionPtr first 
16733            instead of directly casting to reinterpret_cast
16734         * jit/JITStubCall.h: Ditto + change the type of m_stub
16735           from void* to FunctionPtr.
16736         (JSC::JITStubCall::JITStubCall): 
16737         (JSC::JITStubCall::call):
16738         * jit/JITStubs.cpp: Ditto.
16739         (JSC::DEFINE_STUB_FUNCTION(EncodedJSValue, op_throw)):
16740
16741 2009-10-11  Oliver Hunt  <oliver@apple.com>
16742
16743         Re-enable the JIT.
16744
16745         * wtf/Platform.h:
16746
16747 2009-10-10  Oliver Hunt  <oliver@apple.com>
16748
16749         Reviewed by Maciej Stachowiak.
16750
16751         Support for String.trim(), String.trimLeft() and String.trimRight() methods
16752         https://bugs.webkit.org/show_bug.cgi?id=26590
16753
16754         Implement trim, trimLeft, and trimRight
16755
16756         * runtime/StringPrototype.cpp:
16757         (JSC::isTrimWhitespace):
16758            Our normal string whitespace function does not include U+200B which
16759            is needed for compatibility with mozilla's implementation of trim.
16760            U+200B does not appear to be expected according to spec, however I am
16761            choosing to be lax, and match mozilla behavior so have added this
16762            exception.
16763         (JSC::trimString):
16764
16765 2009-10-09  Geoffrey Garen  <ggaren@apple.com>
16766
16767         Reviewed by Oliver Hunt.
16768
16769         Eliminated some legacy bytecode weirdness.
16770         
16771         Use vPC[x] subscripting instead of ++vPC to access instruction operands.
16772         This is simpler, and often more efficient.
16773
16774         To support this, and to remove use of hard-coded offsets in bytecode and
16775         JIT code generation and dumping, calculate jump offsets from the beginning
16776         of an instruction, rather than the middle or end.
16777         
16778         Also, use OPCODE_LENGTH instead of hard-coded constants for the sizes of
16779         opcodes.
16780         
16781         SunSpider reports no change in JIT mode, and a 1.01x speedup in Interpreter
16782         mode.
16783
16784         * bytecode/CodeBlock.cpp:
16785         (JSC::printConditionalJump):
16786         (JSC::CodeBlock::dump):
16787         * bytecompiler/BytecodeGenerator.cpp:
16788         (JSC::BytecodeGenerator::emitJump):
16789         (JSC::BytecodeGenerator::emitJumpIfTrue):
16790         (JSC::BytecodeGenerator::emitJumpIfFalse):
16791         (JSC::BytecodeGenerator::emitJumpIfNotFunctionCall):
16792         (JSC::BytecodeGenerator::emitJumpIfNotFunctionApply):
16793         (JSC::BytecodeGenerator::emitComplexJumpScopes):
16794         (JSC::BytecodeGenerator::emitJumpScopes):
16795         (JSC::BytecodeGenerator::emitNextPropertyName):
16796         (JSC::BytecodeGenerator::emitCatch):
16797         (JSC::BytecodeGenerator::emitJumpSubroutine):
16798         (JSC::prepareJumpTableForImmediateSwitch):
16799         (JSC::prepareJumpTableForCharacterSwitch):
16800         (JSC::prepareJumpTableForStringSwitch):
16801         (JSC::BytecodeGenerator::endSwitch):
16802         * bytecompiler/Label.h:
16803         (JSC::Label::setLocation):
16804         (JSC::Label::bind):
16805         * interpreter/Interpreter.cpp:
16806         (JSC::Interpreter::resolve):
16807         (JSC::Interpreter::resolveSkip):
16808         (JSC::Interpreter::resolveGlobal):
16809         (JSC::Interpreter::resolveBase):
16810         (JSC::Interpreter::resolveBaseAndProperty):
16811         (JSC::Interpreter::createExceptionScope):
16812         (JSC::Interpreter::privateExecute):
16813         * interpreter/Interpreter.h:
16814         * jit/JIT.cpp:
16815         (JSC::JIT::privateCompile):
16816         * jit/JITArithmetic.cpp:
16817         (JSC::JIT::emit_op_jnless):
16818         (JSC::JIT::emitSlow_op_jnless):
16819         (JSC::JIT::emit_op_jnlesseq):
16820         (JSC::JIT::emitSlow_op_jnlesseq):
16821         (JSC::JIT::emitBinaryDoubleOp):
16822         * jit/JITOpcodes.cpp:
16823         (JSC::JIT::emit_op_jmp):
16824         (JSC::JIT::emit_op_loop):
16825         (JSC::JIT::emit_op_loop_if_less):
16826         (JSC::JIT::emitSlow_op_loop_if_less):
16827         (JSC::JIT::emit_op_loop_if_lesseq):
16828         (JSC::JIT::emitSlow_op_loop_if_lesseq):
16829         (JSC::JIT::emit_op_loop_if_true):
16830         (JSC::JIT::emitSlow_op_loop_if_true):
16831         (JSC::JIT::emit_op_jfalse):
16832         (JSC::JIT::emitSlow_op_jfalse):
16833         (JSC::JIT::emit_op_jtrue):
16834         (JSC::JIT::emitSlow_op_jtrue):
16835         (JSC::JIT::emit_op_jeq_null):
16836         (JSC::JIT::emit_op_jneq_null):
16837         (JSC::JIT::emit_op_jneq_ptr):
16838         (JSC::JIT::emit_op_jsr):
16839         (JSC::JIT::emit_op_next_pname):
16840         (JSC::JIT::emit_op_jmp_scopes):
16841
16842 2009-10-09  Geoffrey Garen  <ggaren@apple.com>
16843
16844         Reviewed by Sam Weinig.
16845
16846         Migrated some code that didn't belong out of Structure.
16847         
16848         SunSpider says maybe 1.03x faster.
16849
16850         * runtime/JSCell.h: Nixed Structure::markAggregate, and made marking of
16851         a Structure's prototype the direct responsility of the object using it.
16852         (Giving Structure a mark function was misleading because it implied that
16853         all live structures get marked during GC, when they don't.)
16854         
16855         * runtime/JSGlobalObject.cpp:
16856         (JSC::markIfNeeded):
16857         (JSC::JSGlobalObject::markChildren): Added code to mark prototypes stored
16858         on the global object. Maybe this wasn't necessary, but now we don't have
16859         to wonder.
16860
16861         * runtime/JSObject.cpp:
16862         (JSC::JSObject::getPropertyNames):
16863         (JSC::JSObject::getOwnPropertyNames):
16864         (JSC::JSObject::getEnumerableNamesFromClassInfoTable):
16865         * runtime/JSObject.h:
16866         (JSC::JSObject::markChildrenDirect):
16867         * runtime/PropertyNameArray.h:
16868         * runtime/Structure.cpp:
16869         * runtime/Structure.h:
16870         (JSC::Structure::setEnumerationCache):
16871         (JSC::Structure::enumerationCache): Moved property name gathering code
16872         from Structure to JSObject because having a Structure iterate its JSObject
16873         was a layering violation. A JSObject is implemented using a Structure; not
16874         the other way around.
16875
16876 2009-10-09  Mark Rowe  <mrowe@apple.com>
16877
16878         Attempt to fix the GTK release build.
16879
16880         * GNUmakefile.am: Include Grammar.cpp in release builds now that
16881         AllInOneFile.cpp is gone.
16882
16883 2009-10-09  Gabor Loki  <loki@inf.u-szeged.hu>
16884
16885         Rubber-stamped by Eric Seidel.
16886
16887         Add ARM JIT support for Gtk port (disabled by default)
16888         https://bugs.webkit.org/show_bug.cgi?id=30228
16889
16890         * GNUmakefile.am:
16891
16892 2009-10-08  Geoffrey Garen  <ggaren@apple.com>
16893
16894         Tiger build fix: added a few more variable initializations.
16895
16896         * runtime/StringPrototype.cpp:
16897         (JSC::stringProtoFuncReplace):
16898         (JSC::stringProtoFuncSearch):
16899
16900 2009-10-08  Geoffrey Garen  <ggaren@apple.com>
16901
16902         Qt build fix: added missing #include.
16903
16904         * jsc.cpp:
16905
16906 2009-10-08  Geoffrey Garen  <ggaren@apple.com>
16907
16908         Tiger build fix: initialize variable whose initialization the compiler
16909         can't otherwise figure out.
16910
16911         * runtime/RegExpObject.cpp:
16912         (JSC::RegExpObject::match):
16913
16914 2009-10-08  Geoffrey Garen  <ggaren@apple.com>
16915
16916         Windows build fix: updated exports.
16917
16918         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
16919         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
16920
16921 2009-10-08  Geoffrey Garen  <ggaren@apple.com>
16922
16923         Tiger build fix: fixed file name case.
16924
16925         * JavaScriptCore.xcodeproj/project.pbxproj:
16926
16927 2009-10-08  Geoffrey Garen  <ggaren@apple.com>
16928
16929         Reviewed by Maciej Stachowiak.
16930
16931         At long last, I pronounce the death of AllInOneFile.cpp.
16932         
16933         SunSpider reports a 1.01x speedup.
16934
16935         * AllInOneFile.cpp: Removed.
16936         * GNUmakefile.am:
16937         * JavaScriptCore.exp:
16938         * JavaScriptCore.gypi:
16939         * JavaScriptCore.xcodeproj/project.pbxproj: Added missing project files
16940         to compilation stages.
16941
16942         * parser/Grammar.y:
16943         * parser/Lexer.cpp:
16944         * parser/Lexer.h:
16945         (JSC::jscyylex):
16946         * runtime/ArrayConstructor.cpp:
16947         (JSC::constructArrayWithSizeQuirk):
16948         * runtime/Collector.h:
16949         * runtime/JSCell.cpp:
16950         (JSC::JSCell::operator new):
16951         * runtime/JSCell.h:
16952         (JSC::JSCell::operator new):
16953         * runtime/JSGlobalObject.cpp:
16954         (JSC::JSGlobalObject::operator new):
16955         * runtime/JSNumberCell.h:
16956         (JSC::JSNumberCell::operator new):
16957         * runtime/JSString.cpp:
16958         * runtime/JSString.h:
16959         (JSC::jsString):
16960         (JSC::jsSubstring):
16961         (JSC::jsOwnedString):
16962         * runtime/RegExpConstructor.cpp:
16963         * runtime/RegExpConstructor.h:
16964         (JSC::RegExpConstructorPrivate::RegExpConstructorPrivate):
16965         (JSC::RegExpConstructorPrivate::lastOvector):
16966         (JSC::RegExpConstructorPrivate::tempOvector):
16967         (JSC::RegExpConstructorPrivate::changeLastOvector):
16968         (JSC::RegExpConstructor::performMatch):
16969         * runtime/StringPrototype.cpp:
16970         (JSC::stringProtoFuncMatch):
16971         * yarr/RegexJIT.cpp:
16972         * yarr/RegexJIT.h:
16973         (JSC::Yarr::executeRegex): Inlined a few things that Shark said
16974         were hot, on the presumption that AllInOneFile.cpp used to inline them
16975         automatically.
16976
16977 2009-10-08  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
16978
16979         Reviewed by Gavin Barraclough.
16980
16981         Fix for JIT'ed op_call instructions (evals, constructs, etc.)
16982         when !ENABLE(JIT_OPTIMIZE_CALL) && USE(JSVALUE32_64)
16983
16984         https://bugs.webkit.org/show_bug.cgi?id=30201
16985
16986         * jit/JITCall.cpp:
16987         (JSC::JIT::compileOpCall):
16988
16989 2009-10-07  Geoffrey Garen  <ggaren@apple.com>
16990
16991         Windows build fix: removed no longer exported symbol.
16992
16993         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
16994         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
16995
16996 2009-10-07  Geoffrey Garen  <ggaren@apple.com>
16997
16998         Reviewed by Oliver Hunt.
16999
17000         Fixed <rdar://problem/5751979> Database code takes JSLock on secondary
17001         thread, permanently slowing down JavaScript
17002         
17003         Removed the optional lock from Heap::protect, Heap::unprotect, and friends,
17004         since WebCore no longer uses it.
17005
17006         * JavaScriptCore.exp:
17007         * runtime/Collector.cpp:
17008         (JSC::Heap::protect):
17009         (JSC::Heap::unprotect):
17010         (JSC::Heap::markProtectedObjects):
17011         (JSC::Heap::protectedGlobalObjectCount):
17012         (JSC::Heap::protectedObjectCount):
17013         (JSC::Heap::protectedObjectTypeCounts):
17014         * runtime/Collector.h:
17015
17016 2009-10-07  Zoltan Horvath  <zoltan@webkit.org>
17017
17018         Reviewed by Darin Adler.
17019
17020         Allow custom memory allocation control for JavaScriptCore's IdentifierArena
17021         https://bugs.webkit.org/show_bug.cgi?id=30158
17022
17023         Inherits IdentifierArena class from FastAllocBase because it has been
17024         instantiated by 'new' in JavaScriptCore/parser/ParserArena.cpp:36.
17025
17026         * parser/ParserArena.h:
17027
17028 2009-10-07  Adam Roben  <aroben@apple.com>
17029
17030         Export DateInstance::info in a way that works on Windows
17031
17032         Fixes <http://webkit.org/b/30171>
17033         fast/dom/Window/window-postmessage-clone.html fails on Windows
17034
17035         Reviewed by Anders Carlsson.
17036
17037         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
17038         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
17039         Removed the export of DateInstance::info from here.
17040
17041         * runtime/DateInstance.h: Use JS_EXPORTDATA to export
17042         DateInstance::info, which is the required way of exporting data on
17043         Windows.
17044
17045 2009-10-07  Jørgen Lind  <jorgen.lind@nokia.com>
17046
17047         Reviewed by Simon Hausmann.
17048
17049         When enabling or disabling the JIT through .qmake.cache, make sure
17050         to also toggle ENABLE_YARR_JIT.
17051
17052         * JavaScriptCore.pri:
17053
17054 2009-10-06  Priit Laes  <plaes@plaes.org>
17055
17056         Reviewed by Gavin Barraclough.
17057
17058         Linking fails with "relocation R_X86_64_PC32 against symbol
17059         `cti_vm_throw'"
17060         https://bugs.webkit.org/show_bug.cgi?id=28422
17061
17062         * jit/JITStubs.cpp:
17063         Mark cti_vm_throw symbol as PLT-indirect symbol, so it doesn't end up
17064         in text segment causing relocation errors on amd64 architecture.
17065         Introduced new define SYMBOL_STRING_RELOCATION for such symbols.
17066
17067 2009-10-06  Oliver Hunt  <oliver@apple.com>
17068
17069         Windows linking fix
17070
17071         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
17072         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
17073
17074 2009-10-06  Oliver Hunt  <oliver@apple.com>
17075
17076         Reviewed by NOBODY (build fix).
17077
17078         Windows build fix.
17079
17080         * runtime/DateInstance.cpp:
17081
17082 2009-10-05  Oliver Hunt  <oliver@apple.com>
17083
17084         Reviewed by Gavin Barraclough.
17085
17086         It should be possible to post (clone) built-in JS objects to Workers
17087         https://bugs.webkit.org/show_bug.cgi?id=22878
17088
17089         Expose helpers to throw correct exceptions during object graph walk
17090         used for cloning and add a helper function to create Date instances
17091         without going through the JS Date constructor function.
17092
17093         * JavaScriptCore.exp:
17094         * JavaScriptCore.xcodeproj/project.pbxproj:
17095         * runtime/DateInstance.cpp:
17096         (JSC::DateInstance::DateInstance):
17097         * runtime/DateInstance.h:
17098         * runtime/ExceptionHelpers.cpp:
17099         (JSC::createTypeError):
17100         * runtime/ExceptionHelpers.h:
17101
17102 2009-10-06  David Levin  <levin@chromium.org>
17103
17104         Reviewed by Oliver Hunt.
17105
17106         StringImpl needs a method to get an instance for another thread which doesn't copy the underlying buffer.
17107         https://bugs.webkit.org/show_bug.cgi?id=30095
17108
17109         * wtf/CrossThreadRefCounted.h:
17110         Removed an unused function and assert improvement.
17111         (WTF::CrossThreadRefCounted::isOwnedByCurrentThread): Moved out common code from asserts.
17112         (WTF::CrossThreadRefCounted::ref): Changed assert to use the common method.
17113         (WTF::CrossThreadRefCounted::deref): Changed assert to use the common method.
17114         (WTF::CrossThreadRefCounted::crossThreadCopy): Since this includes a potentially
17115         non-threadsafe operation, add an assert that the class is owned by the current thread.
17116
17117 2009-10-05  Kevin Ollivier  <kevino@theolliviers.com>
17118
17119         wx build fix. Add Symbian files to the list of excludes.
17120
17121         * wscript:
17122
17123 2009-10-05  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
17124
17125         Reviewed by Simon Hausmann.
17126
17127         [Qt] Remove precompiled header from JavaScriptCore compilation to
17128         prevent qmake warning during autonomous compilation.
17129         https://bugs.webkit.org/show_bug.cgi?id=30069
17130
17131         * JavaScriptCore.pro:
17132
17133 2009-10-02  Geoffrey Garen  <ggaren@apple.com>
17134
17135         Reviewed by Sam Weinig.
17136
17137         Removed the concept of a "fast access cutoff" in arrays, because it
17138         punished some patterns of array access too much, and made things too
17139         complex for inlining in some cases.
17140         
17141         1.3% speedup on SunSpider.
17142
17143         * jit/JITOpcodes.cpp:
17144         (JSC::JIT::emitSlow_op_get_by_val):
17145         (JSC::JIT::emitSlow_op_put_by_val):
17146         * jit/JITPropertyAccess.cpp:
17147         (JSC::JIT::emit_op_get_by_val):
17148         (JSC::JIT::emitSlow_op_get_by_val):
17149         (JSC::JIT::emit_op_put_by_val):
17150         (JSC::JIT::emitSlow_op_put_by_val):
17151         * jit/JITStubs.cpp:
17152         * jit/JITStubs.h:
17153         (JSC::): Check m_vectorLength instead of m_fastAccessCutoff when
17154         getting / putting from / to an array. Inline putting past the end of
17155         the array.
17156
17157         * runtime/JSArray.cpp:
17158         (JSC::JSArray::JSArray):
17159         (JSC::JSArray::getOwnPropertySlot):
17160         (JSC::JSArray::getOwnPropertyDescriptor):
17161         (JSC::JSArray::put):
17162         (JSC::JSArray::putSlowCase):
17163         (JSC::JSArray::deleteProperty):
17164         (JSC::JSArray::getOwnPropertyNames):
17165         (JSC::JSArray::increaseVectorLength):
17166         (JSC::JSArray::setLength):
17167         (JSC::JSArray::pop):
17168         (JSC::JSArray::push):
17169         (JSC::JSArray::sort):
17170         (JSC::JSArray::fillArgList):
17171         (JSC::JSArray::copyToRegisters):
17172         (JSC::JSArray::compactForSorting):
17173         (JSC::JSArray::checkConsistency):
17174         * runtime/JSArray.h:
17175         (JSC::JSArray::canGetIndex):
17176         (JSC::JSArray::canSetIndex):
17177         (JSC::JSArray::setIndex):
17178         (JSC::JSArray::markChildrenDirect): Removed m_fastAccessCutoff, and
17179         replaced with checks for JSValue() to detect reads and writes from / to
17180         uninitialized parts of the array.
17181
17182 2009-10-02  Jonni Rainisto  <jonni.rainisto@nokia.com>
17183
17184         Reviewed by Darin Adler.
17185
17186         Math.random() gives too low values on Win32 when _CRT_RAND_S is not defined
17187         https://bugs.webkit.org/show_bug.cgi?id=29956
17188
17189         * wtf/RandomNumber.cpp:
17190         (WTF::randomNumber): Added PLATFORM(WIN_OS) to handle 15bit rand()
17191
17192 2009-10-02  Geoffrey Garen  <ggaren@apple.com>
17193
17194         Reviewed by Sam Weinig.
17195
17196         Take one branch instead of two to test for JSValue().
17197         
17198         1.1% SunSpider speedup.
17199
17200         * jit/JITCall.cpp:
17201         (JSC::JIT::compileOpCall):
17202         * jit/JITOpcodes.cpp:
17203         (JSC::JIT::emit_op_to_jsnumber):
17204         (JSC::JIT::emit_op_create_arguments):
17205         * jit/JITPropertyAccess.cpp:
17206         (JSC::JIT::emitSlow_op_get_by_val):
17207         (JSC::JIT::emit_op_put_by_val): Test for the empty value tag, instead
17208         of testing for the cell tag with a 0 payload.
17209
17210         * runtime/JSValue.cpp:
17211         (JSC::JSValue::description): Added support for dumping the new empty value,
17212         and deleted values, in debug builds.
17213
17214         * runtime/JSValue.h:
17215         (JSC::JSValue::JSValue()): Construct JSValue() with the empty value tag.
17216
17217         (JSC::JSValue::JSValue(JSCell*)): Convert null pointer to the empty value
17218         tag, to avoid having two different c++ versions of null / empty.
17219
17220         (JSC::JSValue::operator bool): Test for the empty value tag, instead
17221         of testing for the cell tag with a 0 payload.
17222
17223 2009-10-02  Steve Falkenburg  <sfalken@apple.com>
17224
17225         Reviewed by Mark Rowe.
17226
17227         <https://bugs.webkit.org/show_bug.cgi?id=29989>
17228         Safari version number shouldn't be exposed in WebKit code
17229         
17230         For a WebKit version of 532.3.4:
17231         Product version is: 5.32.3.4 (was 4.0.3.0)
17232         File version is: 5.32.3.4 (was 4.532.3.4)
17233
17234         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.rc:
17235
17236 2009-10-02  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
17237
17238         Rubber-stamped by Simon Hausmann.
17239
17240         Fix the Qt on Mac OS X build.
17241
17242         * wtf/FastMalloc.cpp:
17243
17244 2009-10-02  Jørgen Lind  <jorgen.lind@nokia.com>
17245
17246         Reviewed by Simon Hausmann.
17247
17248         Allow enabling and disabling of the JIT through a qmake variable.
17249
17250         Qt's configure may set this variable through .qmake.cache if a
17251         commandline option is given and/or the compile test for hwcap.h
17252         failed/succeeded.
17253
17254         * JavaScriptCore.pri:
17255
17256 2009-10-01  Mark Rowe  <mrowe@apple.com>
17257
17258         Fix the Tiger build.  Don't unconditionally enable 3D canvas as it is not supported on Tiger.
17259
17260         * Configurations/FeatureDefines.xcconfig:
17261
17262 2009-10-01  Yongjun Zhang  <yongjun.zhang@nokia.com>
17263
17264         Reviewed by Darin Adler.
17265
17266         https://bugs.webkit.org/show_bug.cgi?id=29187
17267
17268         Don't inline ~ListRefPtr() to work around winscw compiler forward declaration
17269         bug regarding templated classes.
17270
17271         The compiler bug is reported at:
17272         https://xdabug001.ext.nokia.com/bugzilla/show_bug.cgi?id=9812
17273
17274         The change will be reverted when the above bug is fixed in winscw compiler.
17275
17276         * wtf/ListRefPtr.h:
17277         (WTF::::~ListRefPtr):
17278
17279 2009-10-01  Zoltan Horvath  <zoltan@webkit.org>
17280
17281         Reviewed by Simon Hausmann.
17282
17283         [Qt] Allow custom memory allocation control for the whole JavaScriptCore
17284         https://bugs.webkit.org/show_bug.cgi?id=27029
17285
17286         Since in JavaScriptCore almost every class which has been instantiated by operator new is
17287         inherited from FastAllocBase (bug #20422), we disable customizing global operator new for the Qt-port
17288         when USE_SYSTEM_MALLOC=0.
17289
17290         Add #include <unistd.h> to FastMalloc.cpp because it's used by TCMalloc_PageHeap::scavengerThread().
17291         (It's needed for the functionality of TCmalloc.)
17292
17293         Add TCSystemAlloc.cpp to JavaScriptCore.pri if USE_SYSTEM_MALLOC is disabled.
17294
17295         * JavaScriptCore.pri:
17296         * wtf/FastMalloc.cpp:
17297         (WTF::sleep):
17298         * wtf/FastMalloc.h:
17299
17300 2009-09-30  Gabor Loki  <loki@inf.u-szeged.hu>
17301
17302         Reviewed by George Staikos.
17303
17304         Defines two pseudo-platforms for ARM and Thumb-2 instruction set.
17305         https://bugs.webkit.org/show_bug.cgi?id=29122
17306
17307         Introduces WTF_PLATFORM_ARM_TRADITIONAL and WTF_PLATFORM_ARM_THUMB2
17308         macros on ARM platforms. The PLATFORM(ARM_THUMB2) should be used
17309         when Thumb-2 instruction set is the required target. The
17310         PLATFORM(ARM_TRADITIONAL) is for generic ARM instruction set. In
17311         case where the code is common the PLATFORM(ARM) have to be used.
17312
17313         Modified by George Wright  <gwright@rim.com> to correctly work
17314         with the RVCT-defined __TARGET_ARCH_ARM and __TARGET_ARCH_THUMB
17315         compiler macros, as well as adding readability changes.
17316
17317         * wtf/Platform.h:
17318
17319 2009-09-30  Oliver Hunt  <oliver@apple.com>
17320
17321         Reviewed by Geoff Garen.
17322
17323         Devirtualise array toString conversion
17324
17325         Tweak the implementation of Array.prototype.toString to have a fast path
17326         when acting on a true JSArray.
17327
17328         * runtime/ArrayPrototype.cpp:
17329         (JSC::arrayProtoFuncToString):
17330
17331 2009-09-30  Csaba Osztrogonac  <oszi@inf.u-szeged.hu>
17332
17333         Reviewed by Geoffrey Garen.
17334
17335         Buildfix for platforms using JSVALUE32.
17336         https://bugs.webkit.org/show_bug.cgi?id=29915
17337
17338         After http://trac.webkit.org/changeset/48905 the build broke in JSVALUE32 case.
17339         Also removed unreachable code.
17340
17341         * jit/JITArithmetic.cpp:
17342         (JSC::JIT::emit_op_add):
17343          - Declaration of "OperandTypes types" moved before first use.
17344          - Typos fixed: dst modified to result, regT2 added.
17345          - Unreachable code removed.
17346         (JSC::JIT::emitSlow_op_add):
17347          - Missing declaration of "OperandTypes types" added.
17348
17349 2009-09-30  Janne Koskinen  <janne.p.koskinen@digia.com> 
17350
17351         Reviewed by Simon Hausmann.
17352
17353         Reduce heap size on Symbian from 64MB to 8MB.
17354
17355         This is not a perfect fix, it requires more fine tuning.
17356         But this makes it possible again to debug in the emulator,
17357         which is more important in order to be able to fix other
17358         run-time issues.
17359
17360         * runtime/Collector.h:
17361
17362 2009-09-30  Janne Koskinen  <janne.p.koskinen@digia.com> 
17363
17364         Reviewed by Simon Hausmann.
17365
17366         Fix CRASH() macro for Symbian build.
17367
17368         * wtf/Assertions.h: Added missing }
17369
17370 2009-09-29  Geoffrey Garen  <ggaren@apple.com>
17371
17372         Reviewed by Gavin Barraclough.
17373
17374         Inlined a few math operations.
17375         
17376         ~1% SunSpider speedup.
17377
17378         * jit/JIT.h:
17379         * jit/JITArithmetic.cpp:
17380         (JSC::JIT::compileBinaryArithOpSlowCase):
17381         (JSC::JIT::emitSlow_op_add):
17382         (JSC::JIT::emitSlow_op_mul):
17383         (JSC::JIT::emit_op_sub):
17384         (JSC::JIT::emitSlow_op_sub): Don't take a stub call when operating on
17385         a constant int and a double.
17386
17387 2009-09-28  Oliver Hunt  <oliver@apple.com>
17388
17389         Reviewed by Gavin Barraclough.
17390
17391         Tidy up codeblock sampler
17392         https://bugs.webkit.org/show_bug.cgi?id=29836
17393
17394         Some rather simple refactoring of codeblock sampler so that
17395         it's easier for us to use it to find problems in non-jsc
17396         environments
17397
17398         * JavaScriptCore.exp:
17399         * bytecode/SamplingTool.h:
17400         * debugger/Debugger.cpp:
17401         (JSC::evaluateInGlobalCallFrame):
17402         * debugger/DebuggerCallFrame.cpp:
17403         (JSC::DebuggerCallFrame::evaluate):
17404         * interpreter/Interpreter.cpp:
17405         (JSC::Interpreter::Interpreter):
17406         (JSC::Interpreter::execute):
17407         (JSC::Interpreter::privateExecute):
17408         (JSC::Interpreter::enableSampler):
17409         (JSC::Interpreter::dumpSampleData):
17410         (JSC::Interpreter::startSampling):
17411         (JSC::Interpreter::stopSampling):
17412         * interpreter/Interpreter.h:
17413         (JSC::Interpreter::sampler):
17414         * jit/JIT.h:
17415         * jsc.cpp:
17416         (runWithScripts):
17417         * runtime/Completion.cpp:
17418         (JSC::checkSyntax):
17419         (JSC::evaluate):
17420         * runtime/Executable.h:
17421         (JSC::EvalExecutable::EvalExecutable):
17422         (JSC::ProgramExecutable::create):
17423         (JSC::ProgramExecutable::ProgramExecutable):
17424         * runtime/JSGlobalData.cpp:
17425         (JSC::JSGlobalData::startSampling):
17426         (JSC::JSGlobalData::stopSampling):
17427         (JSC::JSGlobalData::dumpSampleData):
17428         * runtime/JSGlobalData.h:
17429         * runtime/JSGlobalObjectFunctions.cpp:
17430         (JSC::globalFuncEval):
17431
17432 2009-09-29  Jeremy Orlow  <jorlow@chromium.org>
17433
17434         Reviewed by Dimitri Glazkov.
17435
17436         Add GYP generated files to svn:ignore
17437         https://bugs.webkit.org/show_bug.cgi?id=29895
17438
17439         The following files are generated by JavaScriptCore's GYP file and should be ignored:
17440
17441         pcre.mk
17442         wtf.scons
17443         wtf.mk
17444         SConstruct
17445         wtf_config.scons
17446         wtf_config.mk
17447         pcre.scons
17448
17449         * JavaScriptCore.gyp: Changed property svn:ignore.
17450
17451 2009-09-29  Geoffrey Garen  <ggaren@apple.com>
17452
17453         Reviewed by Sam Weinig.
17454
17455         Standardized an optimization for adding non-numbers.
17456         
17457         SunSpider says maybe a tiny speedup.
17458
17459         * jit/JITArithmetic.cpp:
17460         (JSC::JIT::emit_op_add):
17461         (JSC::JIT::emitSlow_op_add):
17462
17463 2009-09-29  Geoffrey Garen  <ggaren@apple.com>
17464
17465         Windows build fix: export a new symbol.
17466
17467         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
17468         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
17469
17470 2009-09-28  Geoffrey Garen  <ggaren@apple.com>
17471
17472         Reviewed by Sam Weinig.
17473
17474         Removed virtual destructor from JSGlobalObjectData to eliminate pointer
17475         fix-ups when accessing JSGlobalObject::d.
17476         
17477         Replaced with an explicit destructor function pointer.
17478         
17479         6% speedup on bench-alloc-nonretained.js.
17480
17481         * JavaScriptCore.exp:
17482         * runtime/JSGlobalObject.cpp:
17483         (JSC::JSGlobalObject::~JSGlobalObject):
17484         (JSC::JSGlobalObject::destroyJSGlobalObjectData):
17485         * runtime/JSGlobalObject.h:
17486         (JSC::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData):
17487         (JSC::JSGlobalObject::JSGlobalObject):
17488
17489 2009-09-29  Janne Koskinen  <janne.p.koskinen@digia.com>
17490
17491         Reviewed by David Kilzer.
17492
17493         [Qt] Assert messages prints visible in Symbian
17494         https://bugs.webkit.org/show_bug.cgi?id=29808
17495
17496         Asserts use vprintf to print the messages to stderr.
17497         In Symbian Open C it is not possible to see stderr so
17498         I routed the messages to stdout instead.
17499
17500         * wtf/Assertions.cpp:
17501
17502 2009-09-29  Janne Koskinen  <janne.p.koskinen@digia.com>
17503
17504         Reviewed by Darin Adler.
17505
17506         [Qt] Symbian CRASH macro implementation
17507
17508         Added Symbian specific crash macro that
17509         stops to crash line if JIT debugging is used.
17510         Additional differentiation of access violation
17511         (KERN-EXEC 3) and CRASH panic.
17512
17513         * wtf/Assertions.h:
17514
17515 2009-09-28  Mark Rowe  <mrowe@apple.com>
17516
17517         Fix the PowerPC build.
17518
17519         * JavaScriptCore.exp:
17520
17521 2009-09-28  Mark Rowe  <mrowe@apple.com>
17522
17523         Reviewed by Gavin Barraclough.
17524
17525         <rdar://problem/7195704> JavaScriptCore fails to mark registers when built for x86_64 using LLVM GCC.
17526
17527         * runtime/Collector.cpp:
17528         (JSC::Heap::markCurrentThreadConservatively): Force jmp_buf to use the appropriate alignment for a pointer
17529         to ensure that we correctly interpret the contents of registers during marking.
17530
17531 2009-09-28  Geoffrey Garen  <ggaren@apple.com>
17532
17533         Windows build fix: added new exports.
17534
17535         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
17536         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
17537
17538 2009-09-28  Geoffrey Garen  <ggaren@apple.com>
17539
17540         Windows build fix: removed exports that no longer exist.
17541
17542         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
17543         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
17544
17545 2009-09-28  Geoffrey Garen  <ggaren@apple.com>
17546
17547         Reviewed by Darin Adler.
17548
17549         NotNullPassRefPtr: smart pointer optimized for passing references that are not null
17550         https://bugs.webkit.org/show_bug.cgi?id=29822
17551         
17552         Added NotNullPassRefPtr, and deployed it in all places that initialize
17553         JavaScript objects.
17554         
17555         2.2% speedup on bench-allocate-nonretained.js.
17556
17557         * API/JSCallbackConstructor.cpp:
17558         (JSC::JSCallbackConstructor::JSCallbackConstructor):
17559         * API/JSCallbackConstructor.h:
17560         * API/JSCallbackObject.h:
17561         * API/JSCallbackObjectFunctions.h:
17562         (JSC::JSCallbackObject::JSCallbackObject):
17563         * JavaScriptCore.exp:
17564         * bytecode/CodeBlock.h:
17565         (JSC::CodeBlock::addFunctionDecl):
17566         (JSC::CodeBlock::addFunctionExpr):
17567         * runtime/ArrayConstructor.cpp:
17568         (JSC::ArrayConstructor::ArrayConstructor):
17569         * runtime/ArrayConstructor.h:
17570         * runtime/ArrayPrototype.cpp:
17571         (JSC::ArrayPrototype::ArrayPrototype):
17572         * runtime/ArrayPrototype.h:
17573         * runtime/BooleanConstructor.cpp:
17574         (JSC::BooleanConstructor::BooleanConstructor):
17575         * runtime/BooleanConstructor.h:
17576         * runtime/BooleanObject.cpp:
17577         (JSC::BooleanObject::BooleanObject):
17578         * runtime/BooleanObject.h:
17579         * runtime/BooleanPrototype.cpp:
17580         (JSC::BooleanPrototype::BooleanPrototype):
17581         * runtime/BooleanPrototype.h:
17582         * runtime/DateConstructor.cpp:
17583         (JSC::DateConstructor::DateConstructor):
17584         * runtime/DateConstructor.h:
17585         * runtime/DateInstance.cpp:
17586         (JSC::DateInstance::DateInstance):
17587         * runtime/DateInstance.h:
17588         * runtime/DatePrototype.cpp:
17589         (JSC::DatePrototype::DatePrototype):
17590         * runtime/DatePrototype.h:
17591         * runtime/ErrorConstructor.cpp:
17592         (JSC::ErrorConstructor::ErrorConstructor):
17593         * runtime/ErrorConstructor.h:
17594         * runtime/ErrorInstance.cpp:
17595         (JSC::ErrorInstance::ErrorInstance):
17596         * runtime/ErrorInstance.h:
17597         * runtime/ErrorPrototype.cpp:
17598         (JSC::ErrorPrototype::ErrorPrototype):
17599         * runtime/ErrorPrototype.h:
17600         * runtime/FunctionConstructor.cpp:
17601         (JSC::FunctionConstructor::FunctionConstructor):
17602         * runtime/FunctionConstructor.h:
17603         * runtime/FunctionPrototype.cpp:
17604         (JSC::FunctionPrototype::FunctionPrototype):
17605         * runtime/FunctionPrototype.h:
17606         * runtime/GlobalEvalFunction.cpp:
17607         (JSC::GlobalEvalFunction::GlobalEvalFunction):
17608         * runtime/GlobalEvalFunction.h:
17609         * runtime/InternalFunction.cpp:
17610         (JSC::InternalFunction::InternalFunction):
17611         * runtime/InternalFunction.h:
17612         (JSC::InternalFunction::InternalFunction):
17613         * runtime/JSActivation.cpp:
17614         (JSC::JSActivation::JSActivation):
17615         * runtime/JSActivation.h:
17616         (JSC::JSActivation::JSActivationData::JSActivationData):
17617         * runtime/JSArray.cpp:
17618         (JSC::JSArray::JSArray):
17619         * runtime/JSArray.h:
17620         * runtime/JSByteArray.cpp:
17621         (JSC::JSByteArray::JSByteArray):
17622         * runtime/JSByteArray.h:
17623         * runtime/JSFunction.cpp:
17624         (JSC::JSFunction::JSFunction):
17625         * runtime/JSFunction.h:
17626         * runtime/JSGlobalObject.h:
17627         (JSC::JSGlobalObject::JSGlobalObject):
17628         * runtime/JSONObject.h:
17629         (JSC::JSONObject::JSONObject):
17630         * runtime/JSObject.h:
17631         (JSC::JSObject::JSObject):
17632         (JSC::JSObject::setStructure):
17633         * runtime/JSVariableObject.h:
17634         (JSC::JSVariableObject::JSVariableObject):
17635         * runtime/JSWrapperObject.h:
17636         (JSC::JSWrapperObject::JSWrapperObject):
17637         * runtime/MathObject.cpp:
17638         (JSC::MathObject::MathObject):
17639         * runtime/MathObject.h:
17640         * runtime/NativeErrorConstructor.cpp:
17641         (JSC::NativeErrorConstructor::NativeErrorConstructor):
17642         * runtime/NativeErrorConstructor.h:
17643         * runtime/NativeErrorPrototype.cpp:
17644         (JSC::NativeErrorPrototype::NativeErrorPrototype):
17645         * runtime/NativeErrorPrototype.h:
17646         * runtime/NumberConstructor.cpp:
17647         (JSC::NumberConstructor::NumberConstructor):
17648         * runtime/NumberConstructor.h:
17649         * runtime/NumberObject.cpp:
17650         (JSC::NumberObject::NumberObject):
17651         * runtime/NumberObject.h:
17652         * runtime/NumberPrototype.cpp:
17653         (JSC::NumberPrototype::NumberPrototype):
17654         * runtime/NumberPrototype.h:
17655         * runtime/ObjectConstructor.cpp:
17656         (JSC::ObjectConstructor::ObjectConstructor):
17657         * runtime/ObjectConstructor.h:
17658         * runtime/ObjectPrototype.cpp:
17659         (JSC::ObjectPrototype::ObjectPrototype):
17660         * runtime/ObjectPrototype.h:
17661         * runtime/PropertyNameArray.h:
17662         (JSC::PropertyNameArrayData::setCachedPrototypeChain):
17663         * runtime/PrototypeFunction.cpp:
17664         (JSC::PrototypeFunction::PrototypeFunction):
17665         * runtime/PrototypeFunction.h:
17666         * runtime/RegExpConstructor.cpp:
17667         (JSC::RegExpConstructor::RegExpConstructor):
17668         * runtime/RegExpConstructor.h:
17669         * runtime/RegExpObject.cpp:
17670         (JSC::RegExpObject::RegExpObject):
17671         * runtime/RegExpObject.h:
17672         (JSC::RegExpObject::RegExpObjectData::RegExpObjectData):
17673         * runtime/RegExpPrototype.cpp:
17674         (JSC::RegExpPrototype::RegExpPrototype):
17675         * runtime/RegExpPrototype.h:
17676         * runtime/StringConstructor.cpp:
17677         (JSC::StringConstructor::StringConstructor):
17678         * runtime/StringConstructor.h:
17679         * runtime/StringObject.cpp:
17680         (JSC::StringObject::StringObject):
17681         * runtime/StringObject.h:
17682         * runtime/StringObjectThatMasqueradesAsUndefined.h:
17683         (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
17684         * runtime/StringPrototype.cpp:
17685         (JSC::StringPrototype::StringPrototype):
17686         * runtime/StringPrototype.h:
17687         * wtf/PassRefPtr.h:
17688         (WTF::NotNullPassRefPtr::NotNullPassRefPtr):
17689         (WTF::NotNullPassRefPtr::~NotNullPassRefPtr):
17690         (WTF::NotNullPassRefPtr::get):
17691         (WTF::NotNullPassRefPtr::clear):
17692         (WTF::NotNullPassRefPtr::releaseRef):
17693         (WTF::NotNullPassRefPtr::operator*):
17694         (WTF::NotNullPassRefPtr::operator->):
17695         (WTF::NotNullPassRefPtr::operator!):
17696         (WTF::NotNullPassRefPtr::operator UnspecifiedBoolType):
17697         * wtf/RefPtr.h:
17698         (WTF::RefPtr::RefPtr):
17699         (WTF::operator==):
17700
17701 2009-09-28  Oliver Hunt  <oliver@apple.com>
17702
17703         Reviewed by Geoff Garen.
17704
17705         Hard dependency on SSE2 instruction set with JIT
17706         https://bugs.webkit.org/show_bug.cgi?id=29779
17707
17708         Add floating point support checks to op_jfalse and op_jtrue, and
17709         fix the logic for the slow case of op_add
17710
17711         * jit/JITArithmetic.cpp:
17712         (JSC::JIT::emitSlow_op_add):
17713         * jit/JITOpcodes.cpp:
17714         (JSC::JIT::emit_op_jfalse):
17715         (JSC::JIT::emit_op_jtrue):
17716
17717 2009-09-28  Yaar Schnitman  <yaar@chromium.org>
17718
17719         Reviewed by Dimitri Glazkov.
17720
17721         Chromium port - recognize we are being built independently
17722         of chromium and look for dependencies under webkit/chromium rather
17723         than chromium/src.
17724
17725         https://bugs.webkit.org/show_bug.cgi?id=29722
17726
17727         * JavaScriptCore.gyp/JavaScriptCore.gyp:
17728
17729 2009-09-28  Jakub Wieczorek  <faw217@gmail.com>
17730
17731         Reviewed by Simon Hausmann.
17732
17733         [Qt] Implement XSLT support with QtXmlPatterns.
17734         https://bugs.webkit.org/show_bug.cgi?id=28303
17735
17736         * wtf/Platform.h: Add a WTF_USE_QXMLQUERY #define.
17737
17738 2009-09-28  Gabor Loki  <loki@inf.u-szeged.hu>
17739
17740         Reviewed by Simon Hausmann.
17741
17742         Remove __clear_cache which is an internal function of GCC
17743         https://bugs.webkit.org/show_bug.cgi?id=28886
17744
17745         Although __clear_cache is exported from GCC, this is an internal
17746         function. GCC makes no promises about it.
17747
17748         * jit/ExecutableAllocator.h:
17749         (JSC::ExecutableAllocator::cacheFlush):
17750
17751 2009-09-28  Sam Weinig  <sam@webkit.org>
17752
17753         Reviewed by Oliver Hunt.
17754
17755         Fix an absolute path to somewhere in Oliver's machine to a relative path
17756         for derived JSONObject.lut.h.
17757
17758         * JavaScriptCore.xcodeproj/project.pbxproj:
17759
17760 2009-09-28  Joerg Bornemann  <joerg.bornemann@nokia.com>
17761
17762         Reviewed by Simon Hausmann.
17763
17764         Add ARM version detection for Windows CE.
17765
17766         * wtf/Platform.h:
17767
17768 2009-09-26  Yongjun Zhang  <yongjun.zhang@nokia.com>
17769
17770         Reviewed by Simon Hausmann.
17771
17772         Add MarkStackSymbian.cpp to build JavascriptCore for Symbian.
17773
17774         Re-use Windows shrinkAllocation implementation because Symbian doesn't
17775         support releasing part of memory region.
17776         
17777         Use fastMalloc and fastFree to implement allocateStack and releaseStack
17778         for Symbian port.
17779
17780         * JavaScriptCore.pri:
17781         * runtime/MarkStack.h:
17782         (JSC::MarkStack::MarkStackArray::shrinkAllocation):
17783         * runtime/MarkStackSymbian.cpp: Added.
17784         (JSC::MarkStack::initializePagesize):
17785         (JSC::MarkStack::allocateStack):
17786         (JSC::MarkStack::releaseStack):
17787
17788 2009-09-25  Gabor Loki  <loki@inf.u-szeged.hu>
17789
17790         Reviewed by Gavin Barraclough.
17791
17792         Fix unaligned data access in YARR_JIT on ARMv5 and below.
17793         https://bugs.webkit.org/show_bug.cgi?id=29695
17794
17795         On ARMv5 and below all data access should be naturally aligned.
17796         In the YARR_JIT there is a case when character pairs are
17797         loaded from the input string, but this data access is not
17798         naturally aligned. This fix introduces load32WithUnalignedHalfWords
17799         and branch32WithUnalignedHalfWords functions which contain
17800         naturally aligned memory loads - half word loads - on ARMv5 and below.
17801
17802         * assembler/MacroAssemblerARM.cpp:
17803         (JSC::MacroAssemblerARM::load32WithUnalignedHalfWords):
17804         * assembler/MacroAssemblerARM.h:
17805         (JSC::MacroAssemblerARM::load32WithUnalignedHalfWords):
17806         (JSC::MacroAssemblerARM::branch32WithUnalignedHalfWords):
17807         * assembler/MacroAssemblerARMv7.h:
17808         (JSC::MacroAssemblerARMv7::load32WithUnalignedHalfWords):
17809         (JSC::MacroAssemblerARMv7::branch32):
17810         (JSC::MacroAssemblerARMv7::branch32WithUnalignedHalfWords):
17811         * assembler/MacroAssemblerX86Common.h:
17812         (JSC::MacroAssemblerX86Common::load32WithUnalignedHalfWords):
17813         (JSC::MacroAssemblerX86Common::branch32WithUnalignedHalfWords):
17814         * wtf/Platform.h:
17815         * yarr/RegexJIT.cpp:
17816         (JSC::Yarr::RegexGenerator::generatePatternCharacterPair):
17817
17818 2009-09-25  Jeremy Orlow  <jorlow@chromium.org>
17819
17820         This is breaking Chromium try bots, so I'm counting this as a build fix.
17821
17822         Add more svn:ignore exceptions.  On different platforms, these files are
17823         generated with different case for JavaScriptCore.  Also there are some
17824         wtf project files that get built apparently.
17825
17826         * JavaScriptCore.gyp: Changed property svn:ignore.
17827
17828 2009-09-25  Ada Chan  <adachan@apple.com>
17829
17830         Build fix.
17831
17832         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
17833         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
17834
17835 2009-09-25  Geoffrey Garen  <ggaren@apple.com>
17836
17837         Reviewed by Darin Adler.
17838
17839         Inlined some object creation code, including lexicalGlobalObject access
17840         https://bugs.webkit.org/show_bug.cgi?id=29750
17841         
17842         SunSpider says 0.5% faster.
17843         
17844         0.8% speedup on bench-alloc-nonretained.js.
17845         2.5% speedup on v8-splay.js.
17846
17847         * interpreter/CachedCall.h:
17848         (JSC::CachedCall::CachedCall):
17849         * interpreter/CallFrame.h:
17850         (JSC::ExecState::lexicalGlobalObject):
17851         (JSC::ExecState::globalThisValue):
17852         * interpreter/Interpreter.cpp:
17853         (JSC::Interpreter::dumpRegisters):
17854         (JSC::Interpreter::execute):
17855         (JSC::Interpreter::privateExecute):
17856         * jit/JITStubs.cpp:
17857         (JSC::DEFINE_STUB_FUNCTION):
17858         * runtime/FunctionConstructor.cpp:
17859         (JSC::constructFunction):
17860         * runtime/ScopeChain.cpp:
17861         (JSC::ScopeChainNode::print):
17862         * runtime/ScopeChain.h:
17863         (JSC::ScopeChainNode::ScopeChainNode):
17864         (JSC::ScopeChainNode::~ScopeChainNode):
17865         (JSC::ScopeChainNode::push):
17866         (JSC::ScopeChain::ScopeChain):
17867         (JSC::ScopeChain::globalObject): Added a globalObject data member to ScopeChainNode.
17868         Replaced accessor function for globalObject() with data member. Replaced
17869         globalThisObject() accessor with direct access to globalThis, to match.
17870
17871         * runtime/JSGlobalObject.cpp:
17872         (JSC::JSGlobalObject::init):
17873         * runtime/JSGlobalObject.h: Inlined array and object construction.
17874
17875 2009-09-25  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
17876
17877         Reviewed by Gavin Barraclough.
17878
17879         Add ARM version detection rules for Symbian
17880         https://bugs.webkit.org/show_bug.cgi?id=29715
17881
17882         * wtf/Platform.h:
17883
17884 2009-09-24  Xan Lopez  <xlopez@igalia.com>
17885
17886         Reviewed by Mark "Do It!" Rowe.
17887
17888         Some GCC versions don't like C++-style comments in preprocessor
17889         directives, change to C-style to shut them up.
17890
17891         * wtf/Platform.h:
17892
17893 2009-09-24  Oliver Hunt  <oliver@apple.com>
17894
17895         Reviewed by Gavin Barraclough.
17896
17897         Division is needlessly slow in 64-bit
17898         https://bugs.webkit.org/show_bug.cgi?id=29723
17899
17900         Add codegen for op_div on x86-64
17901
17902         * jit/JIT.cpp:
17903         (JSC::JIT::privateCompileMainPass):
17904         (JSC::JIT::privateCompileSlowCases):
17905         * jit/JIT.h:
17906         * jit/JITArithmetic.cpp:
17907         (JSC::JIT::compileBinaryArithOpSlowCase):
17908         (JSC::JIT::emit_op_div):
17909         (JSC::JIT::emitSlow_op_div):
17910         * jit/JITInlineMethods.h:
17911         (JSC::JIT::isOperandConstantImmediateDouble):
17912         (JSC::JIT::addressFor):
17913         (JSC::JIT::emitLoadDouble):
17914         (JSC::JIT::emitLoadInt32ToDouble):
17915         (JSC::JIT::emitJumpSlowCaseIfNotImmediateNumber):
17916
17917 2009-09-24  Jeremy Orlow  <jorlow@chromium.org>
17918
17919         Reviewed by Dimitri Glazkov.
17920
17921         Add GYP generated files to svn:ignore
17922         https://bugs.webkit.org/show_bug.cgi?id=29724
17923
17924         Adding the following files to the svn:ignore list (all in the
17925         JavaScriptCore/JavaScriptCore.gyp directory)
17926
17927         JavaScriptCore.xcodeproj
17928         JavaScriptCore.sln
17929         JavaScriptCore.vcproj
17930         JavaScriptCore_Debug.rules
17931         JavaScriptCore_Release.rules
17932         JavaScriptCore_Release - no tcmalloc.rules
17933         JavaScriptCore_Purify.rules
17934         JavaScriptCore.mk
17935         JavaScriptCore_Debug_rules.mk
17936         JavaScriptCore_Release_rules.mk
17937         JavaScriptCore_Release - no tcmalloc_rules.mk
17938         JavaScriptCore_Purify_rules.mk
17939         JavaScriptCore.scons
17940         JavaScriptCore_main.scons
17941
17942         * JavaScriptCore.gyp: Changed property svn:ignore.
17943
17944 2009-09-24  Yong Li  <yong.li@torchmobile.com>
17945
17946         Reviewed by Adam Barth.
17947
17948         Replace platform-dependent code with WTF::currentTime()
17949         https://bugs.webkit.org/show_bug.cgi?id=29148
17950
17951         * jsc.cpp:
17952         (StopWatch::start):
17953         (StopWatch::stop):
17954         (StopWatch::getElapsedMS):
17955         * runtime/TimeoutChecker.cpp:
17956         (JSC::getCPUTime):
17957
17958 2009-09-24  Mark Rowe  <mrowe@apple.com>
17959
17960         Reviewed by Sam Weinig.
17961
17962         <rdar://problem/7215058> FastMalloc scavenging thread should be named
17963
17964         * wtf/FastMalloc.cpp:
17965         (WTF::TCMalloc_PageHeap::scavengerThread): Set the thread name.
17966         * wtf/Platform.h: Move the knowledge of whether pthread_setname_np exists to here as HAVE(PTHREAD_SETNAME_NP).
17967         * wtf/ThreadingPthreads.cpp:
17968         (WTF::setThreadNameInternal): Use HAVE(PTHREAD_SETNAME_NP).
17969
17970 2009-09-24  Geoffrey Garen  <ggaren@apple.com>
17971
17972         Reviewed by Sam Weinig.
17973
17974         Renamed clear to removeAll, as suggested by Darin Adler.
17975
17976         * wtf/HashCountedSet.h:
17977         (WTF::::removeAll):
17978
17979 2009-09-24  Mark Rowe  <mrowe@apple.com>
17980
17981         Reviewed by Gavin Barraclough.
17982
17983         Fix FastMalloc to build with assertions enabled.
17984
17985         * wtf/FastMalloc.cpp:
17986         (WTF::TCMalloc_Central_FreeList::ReleaseToSpans):
17987         * wtf/TCSpinLock.h:
17988         (TCMalloc_SpinLock::IsHeld):
17989
17990 2009-09-24  Geoffrey Garen  <ggaren@apple.com>
17991
17992         Suggested by Darin Adler.
17993
17994         Removed some unnecessary parameter names.
17995
17996         * wtf/HashCountedSet.h:
17997
17998 2009-09-24  Janne Koskinen  <janne.p.koskinen@digia.com>
17999
18000         Reviewed by Simon Hausmann.
18001
18002         On Windows JSChar is typedef'ed to wchar_t.
18003
18004         When building with WINSCW for Symbian we need to do the
18005         same typedef.
18006
18007         * API/JSStringRef.h:
18008
18009 2009-09-23  Geoffrey Garen  <ggaren@apple.com>
18010
18011         A piece of my last patch that I forgot.
18012
18013         * wtf/HashCountedSet.h:
18014         (WTF::::clear): Added HashCountedSet::clear.
18015
18016 2009-09-24  Gabor Loki  <loki@inf.u-szeged.hu>
18017
18018         Reviewed by Gavin Barraclough.
18019
18020         Avoid __clear_cache built-in function if DISABLE_BUILTIN_CLEAR_CACHE define is set
18021         https://bugs.webkit.org/show_bug.cgi?id=28886
18022
18023         There are some GCC packages (for example GCC-2006q3 from CodeSourcery)
18024         which contain __clear_cache built-in function only for C while the C++
18025         version of __clear_cache is missing on ARM architectures.
18026
18027         Fixed a small bug in the inline assembly of cacheFlush function on
18028         ARM_TRADITIONAL.
18029
18030         * jit/ExecutableAllocator.h:
18031         (JSC::ExecutableAllocator::cacheFlush):
18032
18033 2009-09-23  Geoffrey Garen  <ggaren@apple.com>
18034
18035         Reviewed by Sam Weinig.
18036
18037         Added the ability to swap vectors with inline capacities, so you can
18038         store a vector with inline capacity in a hash table.
18039
18040         * wtf/Vector.h:
18041         (WTF::swap):
18042         (WTF::VectorBuffer::swap):
18043
18044 2009-09-23  David Kilzer  <ddkilzer@apple.com>
18045
18046         Move definition of USE(PLUGIN_HOST_PROCESS) from WebKitPrefix.h to Platform.h
18047
18048         Reviewed by Mark Rowe.
18049
18050         * wtf/Platform.h: Define WTF_USE_PLUGIN_HOST_PROCESS to 1 when
18051         building on 64-bit SnowLeopard.  Define to 0 elsewhere.
18052
18053 2009-09-22  Oliver Hunt  <oliver@apple.com>
18054
18055         Reviewed by Geoff Garen.
18056
18057         Code sampling builds are broken.
18058         https://bugs.webkit.org/show_bug.cgi?id=29662
18059
18060         Fix build.
18061
18062         * bytecode/EvalCodeCache.h:
18063         (JSC::EvalCodeCache::get):
18064         * bytecode/SamplingTool.cpp:
18065         (JSC::ScriptSampleRecord::sample):
18066         (JSC::SamplingTool::doRun):
18067         (JSC::SamplingTool::notifyOfScope):
18068         (JSC::compareScriptSampleRecords):
18069         (JSC::SamplingTool::dump):
18070         * bytecode/SamplingTool.h:
18071         (JSC::ScriptSampleRecord::ScriptSampleRecord):
18072         (JSC::ScriptSampleRecord::~ScriptSampleRecord):
18073         (JSC::SamplingTool::SamplingTool):
18074         * bytecompiler/BytecodeGenerator.cpp:
18075         (JSC::BytecodeGenerator::BytecodeGenerator):
18076         (JSC::BytecodeGenerator::emitNewFunction):
18077         (JSC::BytecodeGenerator::emitNewFunctionExpression):
18078         * bytecompiler/BytecodeGenerator.h:
18079         (JSC::BytecodeGenerator::makeFunction):
18080         * debugger/Debugger.cpp:
18081         (JSC::evaluateInGlobalCallFrame):
18082         * debugger/DebuggerCallFrame.cpp:
18083         (JSC::DebuggerCallFrame::evaluate):
18084         * parser/Nodes.cpp:
18085         (JSC::ScopeNode::ScopeNode):
18086         * runtime/Completion.cpp:
18087         (JSC::checkSyntax):
18088         (JSC::evaluate):
18089         * runtime/Executable.cpp:
18090         (JSC::FunctionExecutable::fromGlobalCode):
18091         * runtime/Executable.h:
18092         (JSC::ScriptExecutable::ScriptExecutable):
18093         (JSC::EvalExecutable::EvalExecutable):
18094         (JSC::EvalExecutable::create):
18095         (JSC::ProgramExecutable::ProgramExecutable):
18096         (JSC::FunctionExecutable::create):
18097         (JSC::FunctionExecutable::FunctionExecutable):
18098         * runtime/JSGlobalObjectFunctions.cpp:
18099         (JSC::globalFuncEval):
18100
18101 2009-09-22  Darin Adler  <darin@apple.com>
18102
18103         Reviewed by Sam Weinig.
18104
18105         * wtf/Forward.h: Added PassOwnPtr.
18106
18107 2009-09-22  Yaar Schnitman  <yaar@chromium.org>
18108
18109         Reviewed by David Levin.
18110
18111         Ported chromium.org's javascriptcore.gyp for the webkit chromium port.
18112
18113         https://bugs.webkit.org/show_bug.cgi?id=29617
18114
18115         * JavaScriptCore.gyp/JavaScriptCore.gyp: Added.
18116
18117 2009-09-22  Thiago Macieira  <thiago.macieira@nokia.com>
18118
18119         Reviewed by Simon Hausmann.
18120
18121         Fix compilation with WINSCW: no varargs macros
18122
18123         Disable variadic arguments for WINSCW just like we do
18124         for MSVC7.
18125
18126         * wtf/Assertions.h:
18127
18128 2009-09-22  Kent Hansen  <khansen@trolltech.com>
18129
18130         Reviewed by Simon Hausmann.
18131
18132         Disable variadic macros on MSVC7.
18133
18134         This was originally added in r26589 but not extended
18135         when LOG_DISABLED/ASSERT_DISABLED was introduced.
18136
18137         * wtf/Assertions.h:
18138
18139 2009-09-22  Simon Hausmann  <simon.hausmann@nokia.com>
18140
18141         Unreviewed build fix for Windows CE < 5
18142
18143         Define WINCEBASIC to disable the IsDebuggerPresent() code in
18144         wtf/Assertions.cpp.
18145
18146         * JavaScriptCore.pri:
18147
18148 2009-09-22  Joerg Bornemann  <joerg.bornemann@nokia.com>
18149
18150         Reviewed by Simon Hausmann.
18151
18152         Fix major memory leak in JavaScriptCore RegisterFile on Windows CE
18153
18154         https://bugs.webkit.org/show_bug.cgi?id=29367
18155
18156         On Widows CE we must decommit all committed pages before we release
18157         them. See VirtualFree documentation.
18158         Desktop Windows behaves much smoother in this situation.
18159
18160         * interpreter/RegisterFile.cpp:
18161         (JSC::RegisterFile::~RegisterFile):
18162
18163 2009-09-21  Greg Bolsinga  <bolsinga@apple.com>
18164
18165         Reviewed by Simon Fraser & Sam Weinig.
18166
18167         Add ENABLE(ORIENTATION_EVENTS)
18168         https://bugs.webkit.org/show_bug.cgi?id=29508
18169
18170         * wtf/Platform.h: Also sort PLATFORM(IPHONE) #defines.
18171
18172 2009-09-21  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
18173
18174         Reviewed by Eric Seidel.
18175
18176         [Fix] SourceCode's uninitialized member
18177         
18178         Potential source of crashes and bugs was fixed. Default constructor
18179         didn't initialized m_provider member.
18180
18181         https://bugs.webkit.org/show_bug.cgi?id=29364
18182
18183         * parser/SourceCode.h:
18184         (JSC::SourceCode::SourceCode):
18185
18186 2009-09-21  Oliver Hunt  <oliver@apple.com>
18187
18188         Reviewed by Geoff Garen.
18189
18190         REGRESSION (r48582): Crash in StructureStubInfo::initPutByIdTransition when reloading trac.webkit.org
18191         https://bugs.webkit.org/show_bug.cgi?id=29599
18192
18193         It is unsafe to attempt to cache new property transitions on
18194         dictionaries of any type.
18195
18196         * interpreter/Interpreter.cpp:
18197         (JSC::Interpreter::tryCachePutByID):
18198         * jit/JITStubs.cpp:
18199         (JSC::JITThunks::tryCachePutByID):
18200
18201 2009-09-21  Oliver Hunt  <oliver@apple.com>
18202
18203         RS=Maciej Stachowiak.
18204
18205         Re-land SNES fix with corrected assertion.
18206
18207         * interpreter/Interpreter.cpp:
18208         (JSC::Interpreter::resolveGlobal):
18209         (JSC::Interpreter::tryCachePutByID):
18210         (JSC::Interpreter::tryCacheGetByID):
18211         * jit/JITStubs.cpp:
18212         (JSC::JITThunks::tryCachePutByID):
18213         (JSC::JITThunks::tryCacheGetByID):
18214         (JSC::DEFINE_STUB_FUNCTION):
18215         * runtime/BatchedTransitionOptimizer.h:
18216         (JSC::BatchedTransitionOptimizer::BatchedTransitionOptimizer):
18217         * runtime/JSObject.cpp:
18218         (JSC::JSObject::removeDirect):
18219         * runtime/Structure.cpp:
18220         (JSC::Structure::Structure):
18221         (JSC::Structure::getEnumerablePropertyNames):
18222         (JSC::Structure::despecifyDictionaryFunction):
18223         (JSC::Structure::addPropertyTransitionToExistingStructure):
18224         (JSC::Structure::addPropertyTransition):
18225         (JSC::Structure::removePropertyTransition):
18226         (JSC::Structure::toDictionaryTransition):
18227         (JSC::Structure::toCacheableDictionaryTransition):
18228         (JSC::Structure::toUncacheableDictionaryTransition):
18229         (JSC::Structure::fromDictionaryTransition):
18230         (JSC::Structure::removePropertyWithoutTransition):
18231         * runtime/Structure.h:
18232         (JSC::Structure::isDictionary):
18233         (JSC::Structure::isUncacheableDictionary):
18234         (JSC::Structure::):
18235         * runtime/StructureChain.cpp:
18236         (JSC::StructureChain::isCacheable):
18237
18238 2009-09-21  Adam Roben  <aroben@apple.com>
18239
18240         Revert r48573, as it caused many assertion failures
18241
18242         * interpreter/Interpreter.cpp:
18243         * jit/JITStubs.cpp:
18244         * runtime/BatchedTransitionOptimizer.h:
18245         * runtime/JSObject.cpp:
18246         * runtime/Structure.cpp:
18247         * runtime/Structure.h:
18248         * runtime/StructureChain.cpp:
18249
18250 2009-09-21  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
18251
18252         Unreviewed make dist build fix. Missing files.
18253
18254         * GNUmakefile.am:
18255
18256 2009-09-19  Gavin Barraclough  <barraclough@apple.com>
18257
18258         Reviewed by Sam 'Cabin Boy' Weinig.
18259
18260         Fix stack alignment with ARM THUMB2 JIT.
18261         https://bugs.webkit.org/show_bug.cgi?id=29526
18262         
18263         Stack is currently being decremented by 0x3c, bump this to 0x40 to make this a
18264         multiple of 16 bytes.
18265
18266         * jit/JITStubs.cpp:
18267         (JSC::JITThunks::JITThunks):
18268         * jit/JITStubs.h:
18269
18270 2009-09-20  Oliver Hunt  <oliver@apple.com>
18271
18272         Reviewed by Maciej Stachowiak.
18273
18274         SNES is too slow
18275         https://bugs.webkit.org/show_bug.cgi?id=29534
18276
18277         The problem was that the emulator used multiple classes with
18278         more properties than our dictionary cutoff allowed, this resulted
18279         in more or less all critical logic inside the emulator requiring
18280         uncached property access.
18281
18282         Rather than simply bumping the dictionary cutoff, this patch
18283         recognises that there are two ways to create a "dictionary"
18284         structure.  Either by adding a large number of properties, or
18285         by removing a property.  In the case of adding properties we
18286         know all the existing properties will maintain their existing
18287         offsets, so we could cache access to those properties, if we
18288         know they won't be removed.
18289
18290         To make this possible, this patch adds the logic required to
18291         distinguish a dictionary created by addition from one created
18292         by removal.  With this logic in place we can now cache access
18293         to objects with large numbers of properties.
18294
18295         SNES performance improved by more than 6x.
18296
18297         * interpreter/Interpreter.cpp:
18298         (JSC::Interpreter::resolveGlobal):
18299         (JSC::Interpreter::tryCachePutByID):
18300         (JSC::Interpreter::tryCacheGetByID):
18301         * jit/JITStubs.cpp:
18302         (JSC::JITThunks::tryCachePutByID):
18303         (JSC::JITThunks::tryCacheGetByID):
18304         (JSC::DEFINE_STUB_FUNCTION):
18305         * runtime/BatchedTransitionOptimizer.h:
18306         (JSC::BatchedTransitionOptimizer::BatchedTransitionOptimizer):
18307         * runtime/JSObject.cpp:
18308         (JSC::JSObject::removeDirect):
18309         * runtime/Structure.cpp:
18310         (JSC::Structure::Structure):
18311         (JSC::Structure::getEnumerablePropertyNames):
18312         (JSC::Structure::despecifyDictionaryFunction):
18313         (JSC::Structure::addPropertyTransitionToExistingStructure):
18314         (JSC::Structure::addPropertyTransition):
18315         (JSC::Structure::removePropertyTransition):
18316         (JSC::Structure::toDictionaryTransition):
18317         (JSC::Structure::toCacheableDictionaryTransition):
18318         (JSC::Structure::toUncacheableDictionaryTransition):
18319         (JSC::Structure::fromDictionaryTransition):
18320         (JSC::Structure::removePropertyWithoutTransition):
18321         * runtime/Structure.h:
18322         (JSC::Structure::isDictionary):
18323         (JSC::Structure::isUncacheableDictionary):
18324         (JSC::Structure::):
18325         * runtime/StructureChain.cpp:
18326         (JSC::StructureChain::isCacheable):
18327
18328 2009-09-19  Oliver Hunt  <oliver@apple.com>
18329
18330         Reviewed by Maciej Stachowiak.
18331
18332         Implement ES5 Object.create function
18333         https://bugs.webkit.org/show_bug.cgi?id=29524
18334
18335         Implement Object.create.  Very simple patch, effectively Object.defineProperties
18336         only creating the target object itself.
18337
18338         * runtime/CommonIdentifiers.h:
18339         * runtime/ObjectConstructor.cpp:
18340         (JSC::ObjectConstructor::ObjectConstructor):
18341         (JSC::objectConstructorCreate):
18342
18343 2009-09-19  Dan Bernstein  <mitz@apple.com>
18344
18345         Fix clean debug builds.
18346
18347         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
18348
18349 2009-09-19  Joerg Bornemann  <joerg.bornemann@nokia.com>
18350
18351         Reviewed by George Staikos.
18352
18353         QtWebKit Windows CE compile fix
18354
18355         https://bugs.webkit.org/show_bug.cgi?id=29379
18356
18357         There is no _aligned_alloc or _aligned_free on Windows CE.
18358         We just use the Windows code that was there before and use VirtualAlloc.
18359         But that also means that the BLOCK_SIZE must be 64K as this function
18360         allocates on 64K boundaries.
18361
18362         * runtime/Collector.cpp:
18363         (JSC::Heap::allocateBlock):
18364         (JSC::Heap::freeBlock):
18365         * runtime/Collector.h:
18366
18367 2009-09-19  Oliver Hunt  <oliver@apple.com>
18368
18369         Reviewed by Sam Weinig.
18370
18371         Implement ES5 Object.defineProperties function
18372         https://bugs.webkit.org/show_bug.cgi?id=29522
18373
18374         Implement Object.defineProperties.  Fairly simple patch, simply makes use of
18375         existing functionality used for defineProperty.
18376
18377         * runtime/CommonIdentifiers.h:
18378         * runtime/ObjectConstructor.cpp:
18379         (JSC::ObjectConstructor::ObjectConstructor):
18380         (JSC::defineProperties):
18381         (JSC::objectConstructorDefineProperties):
18382
18383 2009-09-19  Oliver Hunt  <oliver@apple.com>
18384
18385         Reviewed by NOBODY (Build fix).
18386
18387         Windows build fix part2
18388
18389         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
18390         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
18391
18392 2009-09-19  Oliver Hunt  <oliver@apple.com>
18393
18394         Reviewed by NOBODY (Buildfix).
18395
18396         Windows build fix part 1.
18397
18398         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
18399         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
18400
18401 2009-09-18  Oliver Hunt  <oliver@apple.com>
18402
18403         Reviewed by Geoff Garen.
18404
18405         Implement ES5 Object.defineProperty function
18406         https://bugs.webkit.org/show_bug.cgi?id=29503
18407
18408         Implement Object.defineProperty.  This requires adding the API to
18409         ObjectConstructor, along with a helper function that implements the
18410         ES5 internal [[ToPropertyDescriptor]] function.  It then adds
18411         JSObject::defineOwnProperty that implements the appropriate ES5 semantics.
18412         Currently defineOwnProperty uses a delete followed by a put to redefine
18413         attributes of a property, clearly this is less efficient than it could be
18414         but we can improve this if it needs to be possible in future.
18415
18416         * JavaScriptCore.exp:
18417         * debugger/DebuggerActivation.cpp:
18418         (JSC::DebuggerActivation::defineGetter):
18419         (JSC::DebuggerActivation::defineSetter):
18420         * debugger/DebuggerActivation.h:
18421         * interpreter/Interpreter.cpp:
18422         (JSC::Interpreter::privateExecute):
18423         * jit/JITStubs.cpp:
18424           Update defineGetter/Setter calls
18425         * runtime/CommonIdentifiers.h:
18426         * runtime/JSArray.cpp:
18427         (JSC::JSArray::getOwnPropertySlot):
18428         * runtime/JSGlobalObject.cpp:
18429         (JSC::JSGlobalObject::defineGetter):
18430         (JSC::JSGlobalObject::defineSetter):
18431         * runtime/JSGlobalObject.h:
18432         * runtime/JSObject.cpp:
18433         (JSC::JSObject::defineGetter):
18434         (JSC::JSObject::defineSetter):
18435         (JSC::putDescriptor):
18436         (JSC::JSObject::defineOwnProperty):
18437         * runtime/JSObject.h:
18438         * runtime/ObjectConstructor.cpp:
18439         (JSC::ObjectConstructor::ObjectConstructor):
18440         (JSC::objectConstructorGetOwnPropertyDescriptor):
18441         (JSC::toPropertyDescriptor):
18442         (JSC::objectConstructorDefineProperty):
18443         * runtime/ObjectPrototype.cpp:
18444         (JSC::objectProtoFuncDefineGetter):
18445         (JSC::objectProtoFuncDefineSetter):
18446         * runtime/PropertyDescriptor.cpp:
18447         (JSC::PropertyDescriptor::writable):
18448         (JSC::PropertyDescriptor::enumerable):
18449         (JSC::PropertyDescriptor::configurable):
18450         (JSC::PropertyDescriptor::isDataDescriptor):
18451         (JSC::PropertyDescriptor::isGenericDescriptor):
18452         (JSC::PropertyDescriptor::isAccessorDescriptor):
18453         (JSC::PropertyDescriptor::getter):
18454         (JSC::PropertyDescriptor::setter):
18455         (JSC::PropertyDescriptor::setDescriptor):
18456         (JSC::PropertyDescriptor::setAccessorDescriptor):
18457         (JSC::PropertyDescriptor::setWritable):
18458         (JSC::PropertyDescriptor::setEnumerable):
18459         (JSC::PropertyDescriptor::setConfigurable):
18460         (JSC::PropertyDescriptor::setSetter):
18461         (JSC::PropertyDescriptor::setGetter):
18462         (JSC::PropertyDescriptor::equalTo):
18463         (JSC::PropertyDescriptor::attributesEqual):
18464         (JSC::PropertyDescriptor::attributesWithOverride):
18465         * runtime/PropertyDescriptor.h:
18466         (JSC::PropertyDescriptor::PropertyDescriptor):
18467         (JSC::PropertyDescriptor::value):
18468         (JSC::PropertyDescriptor::setValue):
18469         (JSC::PropertyDescriptor::isEmpty):
18470         (JSC::PropertyDescriptor::writablePresent):
18471         (JSC::PropertyDescriptor::enumerablePresent):
18472         (JSC::PropertyDescriptor::configurablePresent):
18473         (JSC::PropertyDescriptor::setterPresent):
18474         (JSC::PropertyDescriptor::getterPresent):
18475         (JSC::PropertyDescriptor::operator==):
18476         (JSC::PropertyDescriptor::):
18477
18478 2009-09-18  Gabor Loki  <loki@inf.u-szeged.hu>
18479
18480         Reviewed by Gavin Barraclough.
18481
18482         Build fix to enable ARM_THUMB2 on Linux
18483         https://bugs.webkit.org/show_bug.cgi?id=
18484
18485         * jit/ExecutableAllocator.h:
18486         (JSC::ExecutableAllocator::cacheFlush):
18487         * jit/JITStubs.cpp:
18488         * wtf/Platform.h:
18489
18490 2009-09-18  Gabor Loki  <loki@inf.u-szeged.hu>
18491
18492         Reviewed by Gavin Barraclough.
18493
18494         Defines two pseudo-platforms for ARM and Thumb-2 instruction set.
18495         https://bugs.webkit.org/show_bug.cgi?id=29122
18496
18497         Introduces WTF_PLATFORM_ARM_TRADITIONAL and WTF_PLATFORM_ARM_THUMB2
18498         macros on ARM platforms. The PLATFORM(ARM_THUMB2) should be used
18499         when Thumb-2 instruction set is the required target. The
18500         PLATFORM(ARM_TRADITIONAL) is for generic ARM instruction set. In
18501         case where the code is common the PLATFORM(ARM) have to be used.
18502
18503         * assembler/ARMAssembler.cpp:
18504         * assembler/ARMAssembler.h:
18505         * assembler/ARMv7Assembler.h:
18506         * assembler/MacroAssembler.h:
18507         * assembler/MacroAssemblerARM.cpp:
18508         * assembler/MacroAssemblerARM.h:
18509         * assembler/MacroAssemblerCodeRef.h:
18510         (JSC::MacroAssemblerCodePtr::MacroAssemblerCodePtr):
18511         * jit/ExecutableAllocator.h:
18512         * jit/JIT.h:
18513         * jit/JITInlineMethods.h:
18514         (JSC::JIT::beginUninterruptedSequence):
18515         (JSC::JIT::preserveReturnAddressAfterCall):
18516         (JSC::JIT::restoreReturnAddressBeforeReturn):
18517         (JSC::JIT::restoreArgumentReference):
18518         (JSC::JIT::restoreArgumentReferenceForTrampoline):
18519         * jit/JITOpcodes.cpp:
18520         * jit/JITStubs.cpp:
18521         (JSC::JITThunks::JITThunks):
18522         * jit/JITStubs.h:
18523         * wtf/Platform.h:
18524         * yarr/RegexJIT.cpp:
18525         (JSC::Yarr::RegexGenerator::generateEnter):
18526
18527 2009-09-18  Joerg Bornemann  <joerg.bornemann@nokia.com>
18528
18529         Reviewed by Simon Hausmann.
18530
18531         Fix the Qt/Windows CE build.
18532
18533         * JavaScriptCore.pri: Build the ce_time.cpp functions from
18534         within Qt externally.
18535         * wtf/DateMath.cpp: Removed unnecessary Qt #ifdef, for the
18536         Qt build these functions are no external, too.
18537
18538 2009-09-17  Janne Koskinen  <janne.p.koskinen@digia.com>
18539
18540         Reviewed by Simon Hausmann.
18541
18542         Symbian/WINSCW build fox.
18543
18544         Repeat Q_OS_WIN wchar_t hack for WINSCW, similar to
18545         revision 24774.
18546
18547         WINSCW defines wchar_t, thus UChar has to be wchar_t
18548
18549         * wtf/unicode/qt4/UnicodeQt4.h:
18550
18551 2009-09-17  Janne Koskinen  <janne.p.koskinen@digia.com>
18552
18553         Reviewed by Simon Hausmann.
18554
18555         Symbian/WINSCW build fix.
18556
18557         https://bugs.webkit.org/show_bug.cgi?id=29186
18558
18559         WINSCW Template specialisation name in declaration must the be the same as in implementation.
18560
18561         * runtime/LiteralParser.h:
18562
18563 2009-09-15  Norbert Leser  <norbert.leser@nokia.com>
18564
18565         Reviewed by Darin Adler.
18566
18567         https://bugs.webkit.org/show_bug.cgi?id=27060
18568
18569         Symbian compiler for emulator target (WINSCW) fails with
18570         "illegal operand" for m_attributesInPrevious in structure.ccp
18571         (when calling make_pair functions).
18572         This error is apparently due to the compiler not properly
18573         resolving the unsigned type of the declared bitfield.
18574
18575         Initial patch explicitly casted m_attributesInPrevious
18576         to unsigned, but since bitfield optimization is not critical for
18577         the emulator target, this conditional change in header file
18578         appears to be least intrusive.
18579
18580         * runtime/Structure.h:
18581
18582 2009-09-16  Gabor Loki  <loki@inf.u-szeged.hu>
18583
18584         Reviewed by Darin Adler.
18585
18586         Fix GCC warnings on ARM_THUMB2 platform
18587
18588         * assembler/ARMv7Assembler.h:
18589         (JSC::ARMThumbImmediate::countLeadingZerosPartial):
18590         * assembler/MacroAssemblerARMv7.h:
18591         (JSC::MacroAssemblerARMv7::branchTruncateDoubleToInt32):
18592         (JSC::MacroAssemblerARMv7::moveFixedWidthEncoding):
18593
18594 2009-09-16  Greg Bolsinga  <bolsinga@apple.com>
18595
18596         Add ENABLE(INSPECTOR)
18597         https://bugs.webkit.org/show_bug.cgi?id=29260
18598
18599         Reviewed by David Kilzer.
18600
18601         * wtf/Platform.h:
18602
18603 2009-09-16  Greg Bolsinga  <bolsinga@apple.com>
18604
18605         Add ENABLE(CONTEXT_MENUS)
18606         https://bugs.webkit.org/show_bug.cgi?id=29225
18607
18608         Reviewed by David Kilzer.
18609
18610         * wtf/Platform.h:
18611
18612 2009-09-16  Benjamin C Meyer  <benjamin.meyer@torchmobile.com>
18613
18614         Reviewed by Eric Seidel.
18615
18616         The webkit stdint and stdbool headers exists because
18617         the compiler MSVC doesn't include them.  The check
18618         should not check for PLATFORM(WIN_OS) but for MSVC.
18619
18620         * os-win32/stdbool.h:
18621         * os-win32/stdint.h:
18622
18623 2009-09-16  Greg Bolsinga  <bolsinga@apple.com>
18624
18625         Add ENABLE(DRAG_SUPPORT)
18626         https://bugs.webkit.org/show_bug.cgi?id=29233
18627
18628         Reviewed by David Kilzer.
18629
18630         * wtf/Platform.h:
18631
18632 2009-09-16  Kevin Ollivier  <kevino@theolliviers.com>
18633
18634         waf build fix after flag was moved to correct place.
18635
18636         * wscript:
18637
18638 2009-09-16  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
18639
18640         Reviewed by Simon Hausmann.
18641
18642         [Qt] Build fix for 64-bit Qt on Mac OS X
18643
18644         * wtf/Platform.h: Use JSVALUE64 on DARWIN, not only on MAC
18645
18646 2009-09-16  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
18647
18648         Reviewed by Simon Hausmann.
18649
18650         [Qt] Fix wtf/ThreadSpecific.h under Qt to free thread local objects.
18651         https://bugs.webkit.org/show_bug.cgi?id=29295
18652
18653         This is an important fix when JavaScript workers are in use, since
18654         unfreed ThreadGlobalDatas leak a big amount of memory (50-100k each).
18655         QThreadStorage calls the destructor of a given object, which is the
18656         ThreadSpecific::Data. Unlike pthread, Qt is object oriented, and does
18657         not support the calling of a static utility function when the thread
18658         is about to close. In this patch we call the ThreadSpecific::destroy()
18659         utility function from the destructor of ThreadSpecific::Data. Moreover,
18660         since Qt resets all thread local values to 0 before the calling of the
18661         appropriate destructors, we set back the pointer to its original value.
18662         This is necessary because the get() method of the ThreadSpecific
18663         object may be called during the exuction of the destructor.
18664
18665         * wtf/ThreadSpecific.h:
18666         (WTF::ThreadSpecific::Data::~Data):
18667         (WTF::::~ThreadSpecific):
18668         (WTF::::set):
18669         (WTF::::destroy):
18670
18671 2009-09-10  Oliver Hunt  <oliver@apple.com>
18672
18673         Reviewed by Geoff Garen.
18674
18675         Allow anonymous storage inside JSObject
18676         https://bugs.webkit.org/show_bug.cgi?id=29168
18677
18678         Add the concept of anonymous slots to Structures so that it is
18679         possible to store references to values that need marking in the
18680         standard JSObject storage buffer.  This allows us to reduce the
18681         malloc overhead of some objects (by allowing them to store JS
18682         values in the inline storage of the object) and reduce the 
18683         dependence of custom mark functions (if all an objects children
18684         are in the standard object property storage there's no need to
18685         mark them manually).
18686
18687         * JavaScriptCore.exp:
18688         * runtime/JSObject.h:
18689         (JSC::JSObject::putAnonymousValue):
18690         (JSC::JSObject::getAnonymousValue):
18691         (JSC::JSObject::addAnonymousSlots):
18692         * runtime/JSWrapperObject.h:
18693         (JSC::JSWrapperObject::createStructure):
18694         (JSC::JSWrapperObject::JSWrapperObject):
18695         (JSC::JSWrapperObject::setInternalValue):
18696         * runtime/PropertyMapHashTable.h:
18697         * runtime/Structure.cpp:
18698         (JSC::Structure::~Structure):
18699         (JSC::Structure::materializePropertyMap):
18700         (JSC::Structure::addAnonymousSlotsTransition):
18701         (JSC::Structure::copyPropertyTable):
18702         (JSC::Structure::put):
18703         (JSC::Structure::rehashPropertyMapHashTable):
18704         * runtime/Structure.h:
18705         (JSC::Structure::propertyStorageSize):
18706         (JSC::StructureTransitionTable::reifySingleTransition):
18707         * runtime/StructureTransitionTable.h:
18708         (JSC::StructureTransitionTable::TransitionTable::addSlotTransition):
18709         (JSC::StructureTransitionTable::TransitionTable::removeSlotTransition):
18710         (JSC::StructureTransitionTable::TransitionTable::getSlotTransition):
18711         (JSC::StructureTransitionTable::getAnonymousSlotTransition):
18712         (JSC::StructureTransitionTable::addAnonymousSlotTransition):
18713         (JSC::StructureTransitionTable::removeAnonymousSlotTransition):
18714
18715 2009-09-15  Alex Milowski  <alex@milowski.com>
18716
18717         Reviewed by Tor Arne Vestbø.
18718
18719         Added the ENABLE_MATHML define to the features
18720
18721         * Configurations/FeatureDefines.xcconfig:
18722
18723 2009-09-15 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
18724
18725         Reviewed by Tor Arne Vestbø.
18726
18727         [Qt] Build fix for windows.
18728
18729         After http://trac.webkit.org/changeset/47795 the MinGW build broke,
18730         because MinGW has __mingw_aligned_malloc instead of _aligned_malloc.
18731
18732         * runtime/Collector.cpp:
18733         (JSC::Heap::allocateBlock): MinGW case added.
18734         (JSC::Heap::freeBlock): MinGW case added.
18735
18736 2009-09-15  Csaba Osztrogonac  <oszi@inf.u-szeged.hu>
18737
18738         Reviewed by Tor Arne Vestbø.
18739
18740         [Qt] Build fix for Windows/MinGW
18741
18742         https://bugs.webkit.org/show_bug.cgi?id=29268
18743
18744         * wtf/Platform.h: JSVALUE32_64 temporarily disabled on PLATFORM(WIN_OS) with COMPILER(MINGW)
18745
18746 2009-09-14  Gabor Loki  <loki@inf.u-szeged.hu>
18747
18748         Reviewed by Gavin Barraclough.
18749
18750         Detect VFP at runtime in generic ARM port on Linux platform.
18751         https://bugs.webkit.org/show_bug.cgi?id=29076
18752
18753         * JavaScriptCore.pri:
18754         * assembler/MacroAssemblerARM.cpp: Added.
18755         (JSC::isVFPPresent):
18756         * assembler/MacroAssemblerARM.h:
18757         (JSC::MacroAssemblerARM::supportsFloatingPoint):
18758
18759 2009-09-14  Csaba Osztrogonac  <oszi@inf.u-szeged.hu>
18760
18761         Reviewed by Tor Arne Vestbø.
18762
18763         [Qt] Build fix for windows build.
18764
18765         * JavaScriptCore.pri: Correct a logic error.
18766         * pcre/dftables: Add missing paranthesis for tmpdir function.
18767
18768 2009-09-12  Oliver Hunt  <oliver@apple.com>
18769
18770         Reviewed by NOBODY (Build fix).
18771
18772         Build fix for windows exports (again).
18773
18774         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
18775         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
18776
18777 2009-09-12  Oliver Hunt  <oliver@apple.com>
18778
18779         Reviewed by NOBODY (Build fix).
18780
18781         Build fix for windows exports.
18782
18783         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
18784         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
18785
18786 2009-09-12  Oliver Hunt  <oliver@apple.com>
18787
18788         Reviewed by NOBODY (Build fix).
18789
18790         Correct fix for non-allinonefile builds
18791
18792         * runtime/ObjectConstructor.cpp:
18793
18794 2009-09-12  Oliver Hunt  <oliver@apple.com>
18795
18796         Reviewed by NOBODY (Build fix).
18797
18798         Fix non-allinonefile builds
18799
18800         * runtime/ObjectConstructor.cpp:
18801
18802 2009-09-12  Oliver Hunt  <oliver@apple.com>
18803
18804         Reviewed by Maciej Stachowiak.
18805
18806         [ES5] Implement Object.keys
18807         https://bugs.webkit.org/show_bug.cgi?id=29170
18808
18809         This patch basically requires two separate steps, the first is to split getPropertyNames
18810         into two functions -- getOwnPropertyNames and getPropertyNames, basically making them behave
18811         in the same way as getOwnPropertySlot and getPropertySlot.  In essence getOwnPropertyNames
18812         produces the list of properties on an object excluding its prototype chain and getPropertyNames
18813         just iterates the the object and its prototype chain calling getOwnPropertyNames at each level.
18814
18815         * API/JSCallbackObject.h:
18816         * API/JSCallbackObjectFunctions.h:
18817         (JSC::::getOwnPropertyNames):
18818         * JavaScriptCore.exp:
18819         * debugger/DebuggerActivation.cpp:
18820         (JSC::DebuggerActivation::getOwnPropertyNames):
18821         * debugger/DebuggerActivation.h:
18822         * runtime/CommonIdentifiers.h:
18823         * runtime/JSArray.cpp:
18824         (JSC::JSArray::getOwnPropertyNames):
18825         * runtime/JSArray.h:
18826         * runtime/JSByteArray.cpp:
18827         (JSC::JSByteArray::getOwnPropertyNames):
18828         * runtime/JSByteArray.h:
18829         * runtime/JSNotAnObject.cpp:
18830         (JSC::JSNotAnObject::getOwnPropertyNames):
18831         * runtime/JSNotAnObject.h:
18832         * runtime/JSObject.cpp:
18833         (JSC::JSObject::getOwnPropertyNames):
18834         * runtime/JSObject.h:
18835         * runtime/JSVariableObject.cpp:
18836         (JSC::JSVariableObject::getOwnPropertyNames):
18837         * runtime/JSVariableObject.h:
18838         * runtime/ObjectConstructor.cpp:
18839         (JSC::ObjectConstructor::ObjectConstructor):
18840         (JSC::objectConstructorKeys):
18841         * runtime/RegExpMatchesArray.h:
18842         (JSC::RegExpMatchesArray::getOwnPropertyNames):
18843         * runtime/StringObject.cpp:
18844         (JSC::StringObject::getOwnPropertyNames):
18845         * runtime/StringObject.h:
18846         * runtime/Structure.cpp:
18847         (JSC::Structure::getOwnEnumerablePropertyNames):
18848         (JSC::Structure::getEnumerablePropertyNames):
18849         * runtime/Structure.h:
18850
18851 2009-09-11  Oliver Hunt  <oliver@apple.com>
18852
18853         Reviewed by Sam Weinig.
18854
18855         getPropertyNames caching is invalid when the prototype chain contains objects with custom getPropertyNames
18856         https://bugs.webkit.org/show_bug.cgi?id=29214
18857
18858         Add a flag to TypeInfo to indicate whether a type overrides getPropertyNames.
18859         This flag is used to make sure that caching of the property name data is safe.
18860
18861         * API/JSCallbackConstructor.h:
18862         (JSC::JSCallbackConstructor::createStructure):
18863         * debugger/DebuggerActivation.h:
18864         (JSC::DebuggerActivation::createStructure):
18865         * runtime/BooleanObject.h:
18866         (JSC::BooleanObject::createStructure):
18867         * runtime/DatePrototype.h:
18868         (JSC::DatePrototype::createStructure):
18869         * runtime/FunctionPrototype.h:
18870         (JSC::FunctionPrototype::createStructure):
18871         * runtime/JSONObject.h:
18872         (JSC::JSONObject::createStructure):
18873         * runtime/JSObject.h:
18874         (JSC::JSObject::createStructure):
18875         * runtime/JSTypeInfo.h:
18876         (JSC::TypeInfo::hasDefaultGetPropertyNames):
18877         * runtime/JSVariableObject.h:
18878         (JSC::JSVariableObject::createStructure):
18879         * runtime/JSWrapperObject.h:
18880         (JSC::JSWrapperObject::createStructure):
18881         * runtime/MathObject.h:
18882         (JSC::MathObject::createStructure):
18883         * runtime/NumberConstructor.h:
18884         (JSC::NumberConstructor::createStructure):
18885         * runtime/NumberObject.h:
18886         (JSC::NumberObject::createStructure):
18887         * runtime/RegExpConstructor.h:
18888         (JSC::RegExpConstructor::createStructure):
18889         * runtime/RegExpObject.h:
18890         (JSC::RegExpObject::createStructure):
18891         * runtime/StructureChain.cpp:
18892         (JSC::StructureChain::isCacheable):
18893
18894 2009-09-11  Alexey Proskuryakov  <ap@webkit.org>
18895
18896         Reviewed by Geoff Garen.
18897
18898         https://bugs.webkit.org/show_bug.cgi?id=29207
18899         Add checks for using WebCore JS context on secondary threads
18900
18901         * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData):
18902         * runtime/JSGlobalData.h:
18903         Added a new mainThreadOnly flag that WebCore would set.
18904
18905         * runtime/Collector.cpp: (JSC::Heap::registerThread): JSC API methods always call this,
18906         so this is a good place to check that the API isn't used form a wrong thread.
18907
18908 2009-09-11  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
18909
18910         Reviewed by Simon Hausmann.
18911
18912         Compiling JavaScriptCore on sparc 64 with gcc fails.
18913
18914         ThreadSafeShared uses the atomic __gnu_cxx::__exchange_and_add with an int,
18915         however on sparc 64 the _Atomic_word argument is typedefed to long (8 bytes).
18916
18917         The patch disables WTF_USE_LOCKFREE_THREADSAFESHARED in ThreadSafeShared to use
18918         a mutex instead when compiling for sparc 64 with gcc.
18919
18920         https://bugs.webkit.org/show_bug.cgi?id=29175
18921
18922         * wtf/Platform.h:
18923         __sparc64__ is not defined on all OS.
18924         Uses instead: __sparc__ && __arch64__ || __sparcv9
18925         * wtf/Threading.h:
18926
18927 2009-09-11  Prasanth Ullattil  <prasanth.ullattil@nokia.com>
18928
18929         Reviewed by Simon Hausmann.
18930
18931         Fix compile error on Windows7(64Bit) with latest SDK.
18932
18933         Added the missing include file.
18934
18935         * runtime/UString.cpp:
18936
18937 2009-09-11  Joerg Bornemann  <joerg.bornemann@trolltech.com>
18938
18939         Reviewed by Simon Hausmann.
18940
18941         Qt/Windows CE compile fix, include the executable allocator and
18942         markstack implementation in the windows build.
18943
18944         * JavaScriptCore.pri:
18945
18946 2009-09-08  John Abd-El-Malek  <jam@chromium.org>
18947
18948         Reviewed by Dimitri Glazkov.
18949
18950         Remove unneeded define for ActiveX.
18951         https://bugs.webkit.org/show_bug.cgi?id=29054
18952
18953         * wtf/Platform.h:
18954
18955 2009-09-10  Mark Rowe  <mrowe@apple.com>
18956
18957         Rubber-stamped by Sam Weinig.
18958
18959         Update JavaScriptCore and WebKit's FeatureDefines.xcconfig so that they are in sync with WebCore as they need to be.
18960
18961         * Configurations/FeatureDefines.xcconfig:
18962
18963 2009-09-10  Fumitoshi Ukai  <ukai@chromium.org>
18964
18965         Reviewed by Alexey Proskuryakov.
18966
18967         Export WTF::tryFastMalloc used in WebSocketChannel.
18968         https://bugs.webkit.org/show_bug.cgi?id=28038
18969
18970         * JavaScriptCore.exp:
18971         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
18972         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
18973
18974 2009-09-10  Oliver Hunt  <oliver@apple.com>
18975
18976         Reviewed by NOBODY (Build fix).
18977
18978         Make StructureTransitionTable use an enum for the PtrAndFlags member
18979         used for the single transition slot optimisation.
18980
18981         * runtime/StructureTransitionTable.h:
18982         (JSC::StructureTransitionTable::StructureTransitionTable):
18983         (JSC::StructureTransitionTable::usingSingleTransitionSlot):
18984         (JSC::StructureTransitionTable::):
18985
18986 2009-09-10  Oliver Hunt  <oliver@apple.com>
18987
18988         Reviewed by Geoff Garen.
18989
18990         Refactor StructureTransitionTable and Structure to unify handling of the single slot optimization
18991         https://bugs.webkit.org/show_bug.cgi?id=29141
18992
18993         Make StructureTransitionTable encapsulate the single transition slot optimization.
18994
18995         * runtime/Structure.cpp:
18996         (JSC::Structure::Structure):
18997         (JSC::Structure::~Structure):
18998         (JSC::Structure::addPropertyTransitionToExistingStructure):
18999         (JSC::Structure::addPropertyTransition):
19000         (JSC::Structure::addPropertyWithoutTransition):
19001         (JSC::Structure::removePropertyWithoutTransition):
19002         (JSC::Structure::hasTransition):
19003         * runtime/Structure.h:
19004         (JSC::StructureTransitionTable::contains):
19005         (JSC::StructureTransitionTable::get):
19006         (JSC::StructureTransitionTable::hasTransition):
19007         (JSC::StructureTransitionTable::reifySingleTransition):
19008         * runtime/StructureTransitionTable.h:
19009         (JSC::StructureTransitionTable::StructureTransitionTable):
19010         (JSC::StructureTransitionTable::~StructureTransitionTable):
19011         (JSC::StructureTransitionTable::remove):
19012         (JSC::StructureTransitionTable::add):
19013         (JSC::StructureTransitionTable::table):
19014         (JSC::StructureTransitionTable::singleTransition):
19015         (JSC::StructureTransitionTable::usingSingleTransitionSlot):
19016         (JSC::StructureTransitionTable::setSingleTransition):
19017         (JSC::StructureTransitionTable::setTransitionTable):
19018         (JSC::StructureTransitionTable::):
19019         * wtf/PtrAndFlags.h:
19020         (WTF::PtrAndFlags::PtrAndFlags):
19021
19022 2009-09-10  Zoltan Horvath  <zoltan@webkit.org>
19023
19024         Reviewed by Darin Adler.
19025
19026         Implement fastDeleteSkippingDestructor for FastAllocBase and fastDeleteAllValues for HashSet
19027         https://bugs.webkit.org/show_bug.cgi?id=25930
19028
19029         FastAllocBase has been extended with fastDeleteSkippingDestructor function which
19030         releases memory without destructor call. fastDeleteAllValues has been implemented 
19031         similar as deleteAllValues but it uses fastDelete function to release memory.
19032
19033         * wtf/FastAllocBase.h:
19034         (WTF::fastDeleteSkippingDestructor):
19035         * wtf/HashSet.h:
19036         (WTF::fastDeleteAllValues):
19037
19038 2009-09-10  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
19039
19040         Reviewed by Darin Adler.
19041
19042         ARM compiler does not understand GCC visibility attribute
19043         https://bugs.webkit.org/show_bug.cgi?id=29079
19044
19045         * API/JSBase.h: Make the test more specific to hit only
19046         the GCC compiler
19047
19048 2009-09-10  Adam Barth  <abarth@webkit.org>
19049
19050         Unreviewed revert of the previous change.  It broke the tests.
19051
19052         * wtf/dtoa.cpp:
19053         (WTF::dtoa):
19054
19055 2009-09-10  Ben Laurie  <benl@google.com>
19056
19057         Reviewed by Adam Barth.
19058
19059         <https://bugs.webkit.org/show_bug.cgi?id=26836>
19060
19061         If dtoa was given a small buffer and the number was either infinite or
19062         NaN, then the buffer would be overflowed.
19063
19064         * wtf/dtoa.cpp:
19065
19066 2009-09-09  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
19067
19068         Reviewed by Darin Adler.
19069
19070         Change reinterpret_cast to static_cast in r48212.
19071
19072         * jit/ExecutableAllocator.h:
19073         (JSC::ExecutableAllocator::cacheFlush):
19074
19075 2009-09-09  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
19076
19077         Reviewed by Darin Adler.
19078
19079         Remove WTF_PLATFORM_FORCE_PACK as it is no longer used
19080         https://bugs.webkit.org/show_bug.cgi?id=29066
19081
19082         * wtf/Platform.h:
19083
19084 2009-09-09  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
19085
19086         Reviewed by Ariya Hidayat.
19087
19088         Implement flushing the instruction cache for Symbian
19089         https://bugs.webkit.org/show_bug.cgi?id=29075
19090
19091         * jit/ExecutableAllocator.h:
19092         (JSC::ExecutableAllocator::cacheFlush): Call IMB_Range to flush
19093         the instruction cache on Symbian
19094
19095 2009-09-09  Kent Hansen  <khansen@trolltech.com>
19096
19097         Reviewed by Darin Adler.
19098
19099         https://bugs.webkit.org/show_bug.cgi?id=29024
19100         Make JavaScriptCore compile on platforms with case-insensitive file systems and typeinfo.h in STL
19101
19102         These platforms include Microsoft Visual Studio 2003, and Symbian with Metrowerks compiler.
19103
19104         * JavaScriptCore.gypi:
19105         * JavaScriptCore.xcodeproj/project.pbxproj:
19106         * runtime/JSTypeInfo.h: Copied from JavaScriptCore/runtime/TypeInfo.h.
19107         * runtime/Structure.h:
19108         * runtime/TypeInfo.h: Removed.
19109
19110 2009-09-08  Oliver Hunt  <oliver@apple.com>
19111
19112         Reviewed by Maciej Stachowiak.
19113
19114         JSON.stringify(Date) loses the milliseconds information
19115         https://bugs.webkit.org/show_bug.cgi?id=29063
19116
19117         Make sure we include milliseconds in the output of toISOString.
19118
19119         * runtime/DatePrototype.cpp:
19120         (JSC::dateProtoFuncToISOString):
19121
19122 2009-09-08  Kevin Ollivier  <kevino@theolliviers.com>
19123
19124         wx build fix, generate derived sources earlier in order to make sure
19125         they're found by the build system when generating the list of sources to build.
19126
19127         * wscript:
19128
19129 2009-09-08  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
19130
19131         Reviewed by Simon Hausmann.
19132
19133         Build fix when USE(LOCKFREE_THREADSAFESHARED) is not defined
19134         https://bugs.webkit.org/show_bug.cgi?id=29011
19135
19136         * wtf/Threading.h: Use LOCKFREE_THREADSAFESHARED guard for 
19137         atomicIncrement and atomicDecrement
19138
19139 2009-09-07  Zoltan Horvath  <zoltan@webkit.org>
19140
19141         Reviewed by Darin Adler.
19142
19143         Allow custom memory allocation control in Yarr's RegexInterpreter
19144         https://bugs.webkit.org/show_bug.cgi?id=29025
19145
19146         Inherits RegexInterpreter classes from FastAllocBase (bug #20422), which has
19147         been instantiated by 'new':
19148
19149         class ByteDisjunction
19150         -> instantiated in JavaScriptCore/yarr/RegexInterpreter.cpp:1462
19151
19152         struct BytecodePattern
19153         -> instantiated in JavaScriptCore/yarr/RegexInterpreter.cpp:1279
19154
19155         * yarr/RegexInterpreter.h:
19156
19157 2009-09-07  Drew Wilson  <atwilson@google.com>
19158
19159         Reverting r48121 to fix Windows build errors.
19160
19161         * JavaScriptCore.exp:
19162
19163 2009-09-07  Drew Wilson  <atwilson@google.com>
19164
19165         Reviewed by David Levin.
19166
19167         Enable SHARED_WORKERS by default
19168         https://bugs.webkit.org/show_bug.cgi?id=28959
19169
19170         * Configurations/FeatureDefines.xcconfig:
19171
19172 2009-09-07  Fumitoshi Ukai  <ukai@chromium.org>
19173
19174         Reviewed by Alexey Proskuryakov.
19175
19176         Export WTF::tryFastMalloc used in WebSocketChannel.
19177         https://bugs.webkit.org/show_bug.cgi?id=28038
19178
19179         * JavaScriptCore.exp:
19180
19181 2009-09-04  Oliver Hunt  <oliver@apple.com>
19182
19183         Reviewed by NOBODY (Build fix).
19184
19185         Fix windows export files
19186
19187         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
19188         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
19189
19190 2009-09-04  Oliver Hunt  <oliver@apple.com>
19191
19192         Reviewed by Gavin Barraclough.
19193
19194         [[ToString]] conversion should use the actual toString function for String objects.
19195
19196         Remove incorrect specialisations of toString conversions on StringObject.
19197
19198         * JavaScriptCore.exp:
19199         * runtime/StringObject.cpp:
19200         * runtime/StringObject.h:
19201
19202 2009-09-04  Steve Falkenburg  <sfalken@apple.com>
19203
19204         Windows build fix.
19205
19206         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Add new export.
19207         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: Add new export.
19208
19209 2009-09-04  Steve Falkenburg  <sfalken@apple.com>
19210
19211         Windows build fix.
19212
19213         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Remove unneeded export.
19214         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: Remove unneeded export.
19215
19216 2009-09-04  Darin Adler  <darin@apple.com>
19217
19218         Reviewed by Geoff Garen.
19219
19220         DateInstance object collected on ARM JIT (JSValue: WTF_USE_JSVALUE32)
19221         https://bugs.webkit.org/show_bug.cgi?id=28909
19222
19223         Part two.
19224
19225         Make some improvements to garbage collection code:
19226
19227             1) Create a runtime assertion that catches any classes that
19228                override markChildren but have the HasDefaultMark bit set.
19229             2) Remove checks of the mark bit outside the MarkStack::append
19230                function; they are redundant.
19231             3) Improve the efficiency of the asObject and asArray functions
19232                when called on JSCell* to avoid a round trip to JSValue.
19233             4) Make more callers use the checked asCell and asObject
19234                casting functions rather than unchecked casts.
19235             5) Removed the JSCell::marked function and other GC-related
19236                functions because these operations are no longer things that
19237                code other than the core GC code needs to do directly. Fixed
19238                callers that were calling them.
19239
19240         * runtime/Collector.cpp:
19241         (JSC::Heap::markConservatively): Removed unneeded call to MarkStack::drain.
19242         (JSC::Heap::markProtectedObjects): Removed unneeded check of the mark
19243         bit and call to MarkStack::drain.
19244         (JSC::Heap::collect): Removed unneeded checks of the mark bit and also
19245         changed call to SmallStrings::mark to call markChildren instead to match
19246         the rest of the objects.
19247         (JSC::typeName): Removed unneeded cast to JSObject*.
19248
19249         * runtime/JSArray.h:
19250         (JSC::asArray): Added an overload for JSCell* and changed the JSValue
19251         version to call it. Removed some unneeded casts.
19252         (JSC::JSArray::markChildrenDirect): Marked this function inline. It's in
19253         a header, and if not marked inline this could lead to linking problems.
19254         (JSC::MarkStack::markChildren): Added. This helper function is used by
19255         the drain function to avoid repating code. Also added the code here to
19256         check fro default mark violations in debug code. If a markChildren
19257         function adds something to the mark stack, but the type info claimed
19258         hasDefaultMark was true, then we will get an assertion now. Also fixed
19259         the assertion about the mark bit to use the Heap function directly
19260         because we don't have a JSCell::marked function any more.
19261         (JSC::MarkStack::drain): Changed a local variable from "v" to "value",
19262         and from "currentCell" to "cell". Changed to call markChildren in two
19263         places instead of repeating a chain of if statements twice. Changed
19264         code that reads and writes the mark bit to use Heap::isCellMarked and
19265         Heap::markCell so we can eliminate the JSCell::marked and
19266         JSCell::markCellDirect functions.
19267
19268         * runtime/JSCell.h: Removed JSCell's markCellDirect and marked member
19269         functions. Added a comment explaining that asCell should be deprecated
19270         in favor of the JSValue asCell member function.
19271         (JSC::MarkStack::append): Added the assertion that catches callers
19272         that have set the HasDefaultMark bit incorrectly. Changed
19273         code that reads and writes the mark bit to use Heap::isCellMarked and
19274         Heap::markCell so we can eliminate the JSCell::marked and
19275         JSCell::markCellDirect functions. Moved the overload of
19276         MarkStack::append for JSValue here so it can call through to the cell
19277         version. The old version had a copy of all the code instead, but that
19278         repeated the conversion from JSValue to JSCell* and the check for
19279         whether a value is a cell multiple times.
19280         (JSC::Structure::markAggregate): Moved this function here to avoid
19281         dependencies for Structure.h, since this calls MarkStack::append.
19282
19283         * runtime/JSObject.cpp:
19284         (JSC::JSObject::markChildren): Added code to clear
19285         m_isCheckingForDefaultMarkViolation so the marking done by JSObject
19286         doesn't trigger the assertion.
19287
19288         * runtime/JSValue.h: Moved some stray includes that were outside the
19289         header guard inside it. Not sure how that happened! Removed the
19290         GC-related member functions markChildren, hasChildren, marked, and
19291         markDirect.
19292
19293         * runtime/JSWrapperObject.h: Made markChildren private.
19294         (JSC::JSWrapperObject::createStructure): Added. Fixes a bug where the
19295         HasDefaultMark bit was set.
19296
19297         * runtime/MarkStack.h: Added m_isCheckingForDefaultMarkViolation and
19298         initialized it to false. Moved the append function body from here to
19299         JSCell.h. Added a declaration of a private markChildren function used
19300         inside the drain function.
19301
19302         * runtime/SmallStrings.cpp:
19303         (JSC::SmallStrings::markChildren): Changed the name and style of this
19304         function to match other functions. This allows us to share the normal
19305         mark stack code path.
19306
19307         * runtime/SmallStrings.h: Changed the name and interface of mark to
19308         the more-normal markChildren style.
19309
19310         * runtime/Structure.h: Moved the body of markAggregate into the
19311         JSCell.h to avoid a circular dependency with JSCell.h.
19312
19313 2009-09-04  Darin Adler  <darin@apple.com>
19314
19315         Reviewed by Geoff Garen.
19316
19317         DateInstance object collected on ARM JIT (JSValue: WTF_USE_JSVALUE32)
19318         https://bugs.webkit.org/show_bug.cgi?id=28909
19319
19320         Part one.
19321
19322         Make some improvements to garbage collection code:
19323
19324             1) Fix the two classes that had the default mark bit set but
19325                should not.
19326             2) Remove checks of the mark bit outside the MarkStack::append
19327                function; they are redundant.
19328             3) Make more callers use the checked asCell and asObject
19329                casting functions rather than unchecked casts.
19330             4) Removed some GC-related functions because these operations are
19331                no longer things that code other than the core GC code needs
19332                to do directly. Fixed callers that were calling them.
19333
19334         * bytecode/CodeBlock.cpp:
19335         (JSC::CodeBlock::markAggregate): Removed unneeded check of the mark
19336         bit before calling MarkStack::append.
19337
19338         * interpreter/Register.h: Removed unneeded marked and markChildren
19339         functions.
19340
19341         * jit/JITStubs.cpp:
19342         (op_eq): Removed unneeded assertions, instead using checked casting
19343         functions such as asObject.
19344
19345         * runtime/ArgList.h: Added now-needed forward declaration of MarkStack.
19346
19347         * runtime/GetterSetter.cpp:
19348         (JSC::GetterSetter::markChildren): Remmoved unneeded check of the mark bit.
19349
19350         * runtime/GlobalEvalFunction.h:
19351         (JSC::GlobalEvalFunction::createStructure): Added. Fixes a bug where the
19352         HasDefaultMark bit was set.
19353
19354         * runtime/JSCell.cpp:
19355         (JSC::JSCell::getObject): Use asObject to avoid a direct static_cast.
19356
19357         * runtime/JSObject.h:
19358         (JSC::asObject): Added an overload for JSCell* and changed the JSValue
19359         version to call it.
19360         (JSC::JSValue::get): Use asObject to avoid a direct static_cast.
19361
19362         * runtime/JSWrapperObject.h: Made markChildren private.
19363         (JSC::JSWrapperObject::createStructure): Added. Fixes a bug where the
19364         HasDefaultMark bit was set. Later we may want to optimize this for
19365         wrapper types that never have cells in their internal values, but there
19366         is no measured performance regression in SunSpider or V8 doing this
19367         all the time.
19368
19369         * runtime/MarkStack.cpp: Tweaked formatting.
19370
19371 2009-09-04  Kevin Ollivier  <kevino@theolliviers.com>
19372
19373         wx build fix. Switch USE_ defines over to the compiler so that they can be
19374         checked by files not including config.h (like WebCorePrefix.h).
19375
19376         * wtf/Platform.h:
19377
19378 2009-09-03  Yong Li  <yong.li@torchmobile.com>
19379
19380         Reviewed by David Levin.
19381
19382         Remove unnecessary dependency on unistd.h
19383         https://bugs.webkit.org/show_bug.cgi?id=28962
19384
19385         * runtime/Completion.cpp:
19386
19387 2009-09-03  Fumitoshi Ukai  <ukai@chromium.org>
19388
19389         Reviewed by Eric Seidel.
19390
19391         Add strnstr for Linux and Windows in StringExtras.h
19392         https://bugs.webkit.org/show_bug.cgi?id=28901
19393
19394         * wtf/StringExtras.h:
19395         (strnstr):
19396
19397 2009-09-03  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
19398
19399         Reviewed by Darin Adler.
19400
19401         Allow custom memory allocation control for JavaScriptCore's HashEntry class
19402         https://bugs.webkit.org/show_bug.cgi?id=27830
19403
19404         Inherits HashEntry class from FastAllocBase because it has been
19405         instantiated by 'new' JavaScriptCore/runtime/Lookup.cpp:32.
19406
19407         * runtime/Lookup.h:
19408
19409 2009-09-02  Gavin Barraclough  <barraclough@apple.com>
19410
19411         Should crash if JIT code buffer allocation fails.
19412
19413         https://bugs.webkit.org/show_bug.cgi?id=28926
19414         <rdar://problem/7031922>
19415
19416         * jit/ExecutableAllocatorPosix.cpp:
19417         (JSC::ExecutablePool::systemAlloc):
19418         * jit/ExecutableAllocatorWin.cpp:
19419         (JSC::ExecutablePool::systemAlloc):
19420
19421 2009-09-02  Kevin Ollivier  <kevino@theolliviers.com>
19422
19423         waf build fixes for Windows/MSVC.
19424
19425         * wscript:
19426
19427 2009-09-02  Kevin Ollivier  <kevino@theolliviers.com>
19428
19429         Build fix for building on Windows.
19430
19431         * wtf/ThreadingPthreads.cpp:
19432
19433 2009-09-02  Norbert Leser  <norbert.leser@nokia.com>
19434
19435         Reviewed by Eric Seidel.
19436
19437         Use fastMalloc when neither MMAP nor VIRTUALALLOC are enabled
19438         
19439         RegisterFile constructor currently throws #error when both
19440         MMAP and VIRTUALALLOC conditions fail.
19441         On any platform that does not provide these features
19442         (for instance, Symbian),
19443         the fallback should be regular malloc (or fastMalloc).
19444         It is functionally equivalent in this case, even though it may
19445         have certain drawbacks such as lack of dynamic pre-allocation.
19446
19447         * interpreter/RegisterFile.cpp:
19448         (JSC::RegisterFile::~RegisterFile):
19449         * interpreter/RegisterFile.h:
19450         (JSC::RegisterFile::RegisterFile):
19451
19452 2009-08-31  Robert Agoston  <Agoston.Robert@stud.u-szeged.hu>
19453
19454         Reviewed by Gavin Barraclough.
19455
19456         Fixed typo.
19457         https://bugs.webkit.org/show_bug.cgi?id=28691
19458
19459         * parser/Parser.h:
19460         (JSC::Parser::parse):
19461
19462 2009-08-27  Oliver Hunt  <oliver@apple.com>
19463
19464         Reviewed by Maciej Stachowiak.
19465
19466         JSON Stringifier does not follow ES5 spec for handling of Number, String and Boolean objects
19467         https://bugs.webkit.org/show_bug.cgi?id=28797
19468
19469         Fixed unwrapBoxedPrimitive to do the right thing, which necessitated a couple of new exception
19470         checks, and corrected the logic in gap to correctly convert Number and String objects.
19471
19472         * runtime/JSONObject.cpp:
19473         (JSC::unwrapBoxedPrimitive):
19474         (JSC::gap):
19475         (JSC::Stringifier::Stringifier):
19476         (JSC::Stringifier::appendStringifiedValue):
19477
19478 2009-08-27  Oliver Hunt  <oliver@apple.com>
19479
19480         Reviewed by Adam Roben.
19481
19482         JSON.stringify replacer array does not accept values that are not string primitives.
19483         https://bugs.webkit.org/show_bug.cgi?id=28788
19484
19485         Update the JSON stringifier to initialise its replacer array according to the most
19486         recent version of the spec.
19487
19488         * runtime/Identifier.h:
19489         (JSC::Identifier::from):
19490         * runtime/JSONObject.cpp:
19491         (JSC::Stringifier::Stringifier):
19492
19493 2009-08-27  Alexey Proskuryakov  <ap@apple.com>
19494
19495         Reviewed by Oliver Hunt.
19496
19497         https://bugs.webkit.org/show_bug.cgi?id=28753
19498         <rdar://problem/7173448> Excessive number of threads (and a crash)
19499
19500         * wtf/Threading.h: (WTF::atomicIncrement): Changed atomicIncrement to match decrement
19501         and return the new value. Also added using directives for these functions, to match
19502         te rest of WTF.
19503
19504 2009-08-27  Brent Fulgham  <bfulgham@webkit.org>
19505
19506         Reviewed by Adam Roben.
19507
19508         Link the testapi against CFLite when building the WinCairo port.
19509
19510         * JavaScriptCore.vcproj/testapi/testapi.vcproj: Add new Release_CFLite
19511           target.  Update all targets to inherit from either the
19512           JavaScriptCF.vsprops (Apple target) or the JavaScriptCFLite.vsprops
19513           file (WinCairo target).
19514         * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops: Remove
19515           input file CoreFoundation.lib. This is provided by either the
19516           JavaScriptCF.vsprops or JavaScriptCFLite.vsprops file.
19517
19518 2009-08-27  Steve Falkenburg  <sfalken@apple.com>
19519
19520         Reviewed by Geoff Garen.
19521         
19522         Fix Windows-specific crash due to missing memory clearing call.
19523         
19524         * runtime/Collector.cpp:
19525         (JSC::Heap::allocateBlock):
19526
19527 2009-08-27  Brent Fulgham  <bfulgham@webkit.org>
19528
19529         Build fix: JavaScriptCore_debug.def missing some exports.  Apple
19530         Windows build does not use this file, so it was not noticed previously.
19531
19532         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
19533
19534 2009-08-27  Gavin Barraclough  <barraclough@apple.com>
19535
19536         Reviewed by Oliver Hunt.
19537
19538         x86-64 GTK broken due to code offsets changing, pointers sometimes packed into immediates.
19539         https://bugs.webkit.org/show_bug.cgi?id=28317
19540
19541         Missed one, fix part II.
19542
19543         * assembler/MacroAssemblerX86Common.h:
19544         (JSC::MacroAssemblerX86Common::move):
19545         * assembler/X86Assembler.h:
19546         (JSC::CAN_SIGN_EXTEND_8_32):
19547
19548 2009-08-27  Oliver Hunt  <oliver@apple.com>
19549
19550         Reviewed by Adam Roben.
19551
19552         JSON.stringify replacer array does not accept values that are not string primitives.
19553         https://bugs.webkit.org/show_bug.cgi?id=28788
19554
19555         Update the JSON stringifier to initialise its replacer array according to the most
19556         recent version of the spec.
19557
19558         * runtime/Identifier.h:
19559         (JSC::Identifier::from):
19560         * runtime/JSONObject.cpp:
19561         (JSC::Stringifier::Stringifier):
19562
19563 2009-08-27  Oliver Hunt  <oliver@apple.com>
19564
19565         Reviewed by Alexey Proskuryakov.
19566
19567         JSON parser accepts trailing comma in array literals
19568         https://bugs.webkit.org/show_bug.cgi?id=28779
19569
19570         Update parser to correctly fail if there's a trailing comma.
19571
19572         * runtime/LiteralParser.cpp:
19573         (JSC::LiteralParser::parse):
19574
19575 2009-08-26  Oliver Hunt  <oliver@apple.com>
19576
19577         Reviewed by Gavin Barraclough.
19578
19579         'this' in JSON.parse reviver is the global object
19580         https://bugs.webkit.org/show_bug.cgi?id=28752
19581
19582         This is a technically simple change, we merely update the code for calling
19583         the reviver function to pass the correct this object.  Doing so however
19584         exposes the holder to arbitrary mutation by the reviver function so it is
19585         necessary for us to now guard all property accesses against the possibility
19586         of failure.
19587
19588         * runtime/JSArray.h:
19589           JSON needs to delete a property from the array, so we friend its 
19590           Walker class so that we can make a non-virtual call to the arrays
19591           delete and getOwnPropertySlot methods.
19592         * runtime/JSONObject.cpp:
19593         (JSC::Walker::callReviver):
19594           We need to pass the correct this object
19595         (JSC::Walker::walk):
19596           Update calls to callReviver, and update property logic logic
19597           to correctly handle the holder being mutated by the reviver
19598           function.
19599
19600 2009-08-26  Alice Liu  <alice.liu@apple.com>
19601
19602         Windows build fix: added some exported symbols
19603
19604         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
19605         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
19606
19607 2009-08-26  Geoffrey Garen  <ggaren@apple.com>
19608
19609         Windows build fix: Removed some exported symbols that no longer exist.
19610
19611         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
19612         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
19613
19614 2009-08-26  Gavin Barraclough  <barraclough@apple.com>
19615
19616         Reviewed by Olliejver Hunt.
19617
19618         x86-64 GTK broken due to code offsets changing, pointers sometimes packed into immediates.
19619         https://bugs.webkit.org/show_bug.cgi?id=28317
19620
19621         We rely on a slightly OS X specific behaviour, that x86-64 applications have a 4Gb zero page,
19622         so pointers are never representable as a 32-bit integer, and always have to be represented by
19623         a separate immediate load instruction, rather than within the immediate field of an arithmetic
19624         or memory operation.
19625
19626         We explicitly check for a couple of cases where a value might be representable in 32-bit, but
19627         these probably never kick in on Mac OS, and only kick in to hose GTK.  Deleting these does not
19628         show a performance degradation on SunSpider.  Remove.
19629
19630         * assembler/MacroAssemblerX86_64.h:
19631         (JSC::MacroAssemblerX86_64::storePtr):
19632         (JSC::MacroAssemblerX86_64::branchPtr):
19633
19634 2009-08-26  Geoffrey Garen  <ggaren@apple.com>
19635
19636         Reviewed by Oliver Hunt.
19637
19638         A bit of Collector refatoring.
19639         
19640         SunSpider says no change. v8 says 1.003x faster (1.02x faster on splay).
19641
19642         * JavaScriptCore.exp:
19643
19644         * runtime/JSCell.cpp:
19645         (JSC::JSCell::toPrimitive):
19646         (JSC::JSCell::getPrimitiveNumber):
19647         (JSC::JSCell::toBoolean):
19648         (JSC::JSCell::toNumber):
19649         (JSC::JSCell::toString):
19650         (JSC::JSCell::toObject): Removed pure virtual functions from
19651         JSCell, so the collector can construct one. This allowed
19652         me to remove a bunch of ASSERT_NOT_REACHED throughout the
19653         code, too.
19654
19655         * runtime/JSCell.h:
19656         (JSC::JSCell::JSCell): ditto
19657         (JSC::Heap::heap): Inlined this function because it's trivial.
19658
19659         * JavaScriptCore.exp:
19660
19661         * runtime/Collector.cpp:
19662         (JSC::Heap::destroy):
19663         (JSC::Heap::allocateBlock):
19664         (JSC::Heap::freeBlock):
19665         (JSC::Heap::freeBlocks): Renamed freeHeap to freeBlocks, since
19666         it doesn't actually free the Heap object.
19667         (JSC::Heap::heapAllocate):
19668         (JSC::Heap::sweep):
19669         * runtime/Collector.h: Refactored block allocation and destruction
19670         into helper functions.
19671         
19672         * runtime/GetterSetter.cpp:
19673         * runtime/JSAPIValueWrapper.cpp:
19674         * runtime/JSPropertyNameIterator.cpp: Removed dummy implementations
19675         of pure virtual functions. (See above.)
19676
19677 === End re-roll-in of r47738:47740 with Windows crash fixed ===
19678
19679 2009-08-26  Geoffrey Garen  <ggaren@apple.com>
19680
19681         Build fix: start out with a 32-bit value to avoid a shortening warning.
19682
19683         * runtime/Collector.cpp:
19684         (JSC::Heap::sweep):
19685
19686 2009-08-24  Geoffrey Garen  <ggaren@apple.com>
19687
19688         Reviewed by Oliver Hunt.
19689
19690         Substantially reduced VM thrash in the GC heap.
19691         
19692         1.08x faster on v8 (1.60x faster on v8-splay).
19693         
19694         1.40x faster on bench-alloc-nonretained.
19695         
19696         1.90x faster on bench-alloc-retained.
19697         
19698         SunSpider says no change.
19699         
19700         * runtime/Collector.cpp:
19701         (JSC::Heap::heapAllocate): Fixed a long-standing bug: update a few local
19702         variables unconditionally after calling collect(), since they may be used
19703         even if we don't "goto scan". (In the bug I saw, usedBlocks got out of
19704         sync with heap.usedBlocks).
19705         (JSC::Heap::sweep): Keep enough free heap space to accomodate 
19706         the number of objects we'll allocate before the next GC, plus 25%, for
19707         good measure.
19708         * runtime/Collector.h: Bumped the block size to 256k. This seems to give
19709         the best cache performance, and it prevents us from initiating lots of
19710         VM traffic to recover very small chunks of memory.
19711
19712 === Begin re-roll-in of r47738:47740 with Windows crash fixed ===
19713
19714 2009-08-25  Drew Wilson  <atwilson@google.com>
19715
19716         Reviewed by David Levin.
19717
19718         postMessage() spec now supports sending arrays of ports
19719         https://bugs.webkit.org/show_bug.cgi?id=26902
19720
19721         Added OwnPtr to VectorTraits so we can store OwnPtrs in Vectors.
19722
19723         * wtf/VectorTraits.h:
19724
19725 2009-08-26  Xan Lopez  <xlopez@igalia.com>
19726
19727         Rubber-stamped by Gustavo Noronha.
19728
19729         Remove duplicated files from file list.
19730
19731         * GNUmakefile.am:
19732
19733 2009-08-26  Oliver Hunt  <oliver@apple.com>
19734
19735         Reviewed by NOBODY (Build fix).
19736
19737         More export fixes.
19738
19739         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
19740         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
19741
19742 2009-08-26  Oliver Hunt  <oliver@apple.com>
19743
19744         Reviewed by NOBODY (Build fix).
19745
19746         Hopefully fix all the exports from JSC on windows
19747
19748         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
19749         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
19750
19751 2009-08-26  Oliver Hunt  <oliver@apple.com>
19752
19753         Reviewed by NOBODY (Build fixes).
19754
19755         Forgot I added files to JavaScriptCore. 
19756
19757         * GNUmakefile.am:
19758         * JavaScriptCore.gypi:
19759         * JavaScriptCore.pri:
19760         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
19761         * JavaScriptCoreSources.bkl:
19762
19763 2009-08-25  Oliver Hunt  <oliver@apple.com>
19764
19765         Reviewed by Gavin Barraclough.
19766
19767         [ES5] Implement getOwnPropertyDescriptor
19768         https://bugs.webkit.org/show_bug.cgi?id=28724
19769
19770         Implement the core runtime support for getOwnPropertyDescriptor.
19771         This adds a virtual getOwnPropertyDescriptor method to every class
19772         that implements getOwnPropertySlot that shadows the behaviour of
19773         getOwnPropertySlot.  The alternative would be to make getOwnPropertySlot
19774         (or PropertySlots in general) provide property attribute information,
19775         but quick testing showed this to be a regression.
19776
19777         * JavaScriptCore.exp:
19778         * JavaScriptCore.xcodeproj/project.pbxproj:
19779         * runtime/Arguments.cpp:
19780         (JSC::Arguments::getOwnPropertyDescriptor):
19781         * runtime/Arguments.h:
19782         * runtime/ArrayPrototype.cpp:
19783         (JSC::ArrayPrototype::getOwnPropertyDescriptor):
19784         * runtime/ArrayPrototype.h:
19785         * runtime/CommonIdentifiers.h:
19786         * runtime/DatePrototype.cpp:
19787         (JSC::DatePrototype::getOwnPropertyDescriptor):
19788         * runtime/DatePrototype.h:
19789         * runtime/JSArray.cpp:
19790         (JSC::JSArray::getOwnPropertyDescriptor):
19791         * runtime/JSArray.h:
19792         * runtime/JSByteArray.cpp:
19793         (JSC::JSByteArray::getOwnPropertyDescriptor):
19794         * runtime/JSByteArray.h:
19795         * runtime/JSFunction.cpp:
19796         (JSC::JSFunction::getOwnPropertyDescriptor):
19797         * runtime/JSFunction.h:
19798         * runtime/JSGlobalObject.h:
19799         (JSC::JSGlobalObject::getOwnPropertyDescriptor):
19800         * runtime/JSNotAnObject.cpp:
19801         (JSC::JSNotAnObject::getOwnPropertyDescriptor):
19802         * runtime/JSNotAnObject.h:
19803         * runtime/JSONObject.cpp:
19804         (JSC::JSONObject::getOwnPropertySlot):
19805         (JSC::JSONObject::getOwnPropertyDescriptor):
19806         * runtime/JSONObject.h:
19807         * runtime/JSObject.cpp:
19808         (JSC::JSObject::getOwnPropertyDescriptor):
19809         (JSC::JSObject::getPropertyDescriptor):
19810         * runtime/JSObject.h:
19811         * runtime/JSString.cpp:
19812         (JSC::JSString::getStringPropertyDescriptor):
19813         (JSC::JSString::getOwnPropertyDescriptor):
19814         * runtime/JSString.h:
19815         * runtime/JSVariableObject.cpp:
19816         (JSC::JSVariableObject::symbolTableGet):
19817         * runtime/JSVariableObject.h:
19818         * runtime/Lookup.h:
19819         (JSC::getStaticPropertyDescriptor):
19820         (JSC::getStaticFunctionDescriptor):
19821         (JSC::getStaticValueDescriptor):
19822           Add property descriptor equivalents of the lookup
19823           table access functions
19824
19825         * runtime/MathObject.cpp:
19826         (JSC::MathObject::getOwnPropertySlot):
19827         (JSC::MathObject::getOwnPropertyDescriptor):
19828         * runtime/MathObject.h:
19829         * runtime/NumberConstructor.cpp:
19830         (JSC::NumberConstructor::getOwnPropertyDescriptor):
19831         * runtime/NumberConstructor.h:
19832         * runtime/ObjectConstructor.cpp:
19833         (JSC::ObjectConstructor::ObjectConstructor):
19834         (JSC::objectConstructorGetOwnPropertyDescriptor):
19835         * runtime/PropertyDescriptor.cpp: Added.
19836         (JSC::PropertyDescriptor::writable):
19837         (JSC::PropertyDescriptor::enumerable):
19838         (JSC::PropertyDescriptor::configurable):
19839         (JSC::PropertyDescriptor::hasAccessors):
19840         (JSC::PropertyDescriptor::setUndefined):
19841         (JSC::PropertyDescriptor::getter):
19842         (JSC::PropertyDescriptor::setter):
19843         (JSC::PropertyDescriptor::setDescriptor):
19844         (JSC::PropertyDescriptor::setAccessorDescriptor):
19845         * runtime/PropertyDescriptor.h: Added.
19846         (JSC::PropertyDescriptor::PropertyDescriptor):
19847         (JSC::PropertyDescriptor::attributes):
19848         (JSC::PropertyDescriptor::isValid):
19849         (JSC::PropertyDescriptor::value):
19850         * runtime/RegExpConstructor.cpp:
19851         (JSC::RegExpConstructor::getOwnPropertyDescriptor):
19852         * runtime/RegExpConstructor.h:
19853         * runtime/RegExpMatchesArray.h:
19854         (JSC::RegExpMatchesArray::getOwnPropertyDescriptor):
19855         * runtime/RegExpObject.cpp:
19856         (JSC::RegExpObject::getOwnPropertyDescriptor):
19857         * runtime/RegExpObject.h:
19858         * runtime/StringObject.cpp:
19859         (JSC::StringObject::getOwnPropertyDescriptor):
19860         * runtime/StringObject.h:
19861         * runtime/StringPrototype.cpp:
19862         (JSC::StringPrototype::getOwnPropertyDescriptor):
19863         * runtime/StringPrototype.h:
19864
19865 2009-08-24  Gavin Barraclough  <barraclough@apple.com>
19866
19867         Reviewed by Darin Adler.
19868
19869         How many copies of the parameters do you need?
19870         https://bugs.webkit.org/show_bug.cgi?id=28701
19871
19872         The function parameters in JSC get copied a lot - and unnecessarily so.
19873
19874         Originally this happened due to duplicating FunctionBodyNodes on recompilation,
19875         though the problem has been exacerbated by copying the parameters from the
19876         original function body onto the executable, then back onto the real body that
19877         will be generated (this happens on every function).  And this is all made worse
19878         since the data structures in question are a little ugly - C style arrays of C++
19879         objects containing ref counts, so they need a full copy-construct (rather than
19880         a simple memcpy).
19881
19882         This can all be greatly simplified by just punting the parameters off into
19883         their own ref-counted object, and forgoing all the copying.
19884
19885         ~no performance change, possible slight progression.
19886
19887         * bytecompiler/BytecodeGenerator.cpp:
19888         (JSC::BytecodeGenerator::BytecodeGenerator):
19889         * bytecompiler/BytecodeGenerator.h:
19890         (JSC::BytecodeGenerator::makeFunction):
19891         * parser/Nodes.cpp:
19892         (JSC::FunctionParameters::FunctionParameters):
19893         (JSC::FunctionBodyNode::FunctionBodyNode):
19894         (JSC::FunctionBodyNode::finishParsing):
19895         * parser/Nodes.h:
19896         (JSC::FunctionBodyNode::parameters):
19897         (JSC::FunctionBodyNode::parameterCount):
19898         * runtime/Executable.cpp:
19899         (JSC::FunctionExecutable::~FunctionExecutable):
19900         (JSC::FunctionExecutable::compile):
19901         (JSC::FunctionExecutable::reparseExceptionInfo):
19902         (JSC::FunctionExecutable::fromGlobalCode):
19903         (JSC::FunctionExecutable::paramString):
19904         * runtime/Executable.h:
19905         (JSC::FunctionExecutable::FunctionExecutable):
19906         (JSC::FunctionExecutable::parameterCount):
19907
19908 2009-08-25  Brent Fulgham  <bfulgham@webkit.org>
19909
19910         Reviewed by NOBODY (Buildfix).
19911
19912         * JavaScriptCore.vcproj/jsc/jsc.vcproj: Add Debug_CFLite target
19913           that inherits from the debug_wincairo property sheet and therefore
19914           links to the proper debug library.
19915         * JavaScriptCore.vcproj/testapi/testapi.vcproj: Add Debug_CFLite target
19916           that inherits from the debug_wincairo property sheet and therefore
19917           links to the proper debug library.
19918
19919 2009-08-25  Chris Marrin  <cmarrin@apple.com>
19920
19921         Reviewed by Simon Fraser.
19922
19923         Export tryFastMalloc for Canvas3D work
19924         https://bugs.webkit.org/show_bug.cgi?id=28018
19925
19926         * JavaScriptCore.exp:
19927
19928 2009-08-25  David Levin  <levin@chromium.org>
19929
19930         Reviewed by Adam Roben.
19931
19932         PLATFORM(CFNETWORK) should be USE(CFNETWORK).
19933         https://bugs.webkit.org/show_bug.cgi?id=28713
19934
19935         * wtf/Platform.h: Added a #define to catch this issue in the
19936         future. The define would generate an error on gcc without the
19937         space in the expansion, but Visual C++ needs the space to cause an error.
19938
19939 2009-08-24  Brent Fulgham  <bfulgham@webkit.org>
19940
19941         Reviewed by Steve Falkenburg.
19942
19943         Revise CFLite Debug build to emit DLL's with _debug label.
19944         https://bugs.webkit.org/show_bug.cgi?id=28695.
19945
19946         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Modify
19947           Cairo debug build to inherit from new debug_cairo property sheet.
19948         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCFLite.vsprops:
19949           Modify to look for debug CFLite when in debug build.
19950
19951 2009-08-24  Gavin Barraclough  <barraclough@apple.com>
19952
19953         Reviewed by Oliver Adler & Darin Hunt.
19954
19955         https://bugs.webkit.org/show_bug.cgi?id=28691
19956         Do not retain ScopeNodes outside of parsing
19957         
19958         There is now no need for these to exist outside of parsing - their use in the runtime is replaced by Executable types.
19959
19960         * bytecode/EvalCodeCache.h:
19961         (JSC::EvalCodeCache::get):
19962         * bytecompiler/BytecodeGenerator.cpp:
19963         (JSC::BytecodeGenerator::BytecodeGenerator):
19964         (JSC::BytecodeGenerator::emitNewFunction):
19965         (JSC::BytecodeGenerator::emitNewFunctionExpression):
19966         * bytecompiler/BytecodeGenerator.h:
19967         (JSC::BytecodeGenerator::makeFunction):
19968         * debugger/Debugger.cpp:
19969         (JSC::Debugger::recompileAllJSFunctions):
19970         (JSC::evaluateInGlobalCallFrame):
19971         * debugger/DebuggerCallFrame.cpp:
19972         (JSC::DebuggerCallFrame::evaluate):
19973         * interpreter/Interpreter.cpp:
19974         (JSC::Interpreter::execute):
19975         (JSC::Interpreter::prepareForRepeatCall):
19976         (JSC::Interpreter::privateExecute):
19977         * jit/JITStubs.cpp:
19978         (JSC::DEFINE_STUB_FUNCTION):
19979         * parser/Nodes.cpp:
19980         (JSC::ScopeNodeData::ScopeNodeData):
19981         (JSC::ProgramNode::create):
19982         (JSC::EvalNode::create):
19983         (JSC::FunctionBodyNode::create):
19984         * parser/Nodes.h:
19985         (JSC::ScopeNode::adoptData):
19986         (JSC::FunctionBodyNode::parameterCount):
19987         * parser/Parser.cpp:
19988         * parser/Parser.h:
19989         (JSC::Parser::arena):
19990         (JSC::Parser::Parser):
19991         (JSC::Parser::parse):
19992         * runtime/ArrayPrototype.cpp:
19993         (JSC::isNumericCompareFunction):
19994         (JSC::arrayProtoFuncSort):
19995         * runtime/Completion.cpp:
19996         (JSC::checkSyntax):
19997         (JSC::evaluate):
19998         * runtime/Executable.cpp:
19999         (JSC::FunctionExecutable::~FunctionExecutable):
20000         (JSC::EvalExecutable::compile):
20001         (JSC::ProgramExecutable::checkSyntax):
20002         (JSC::ProgramExecutable::compile):
20003         (JSC::FunctionExecutable::compile):
20004         (JSC::EvalExecutable::generateJITCode):
20005         (JSC::ProgramExecutable::generateJITCode):
20006         (JSC::FunctionExecutable::generateJITCode):
20007         (JSC::FunctionExecutable::reparseExceptionInfo):
20008         (JSC::EvalExecutable::reparseExceptionInfo):
20009         (JSC::FunctionExecutable::recompile):
20010         (JSC::FunctionExecutable::fromGlobalCode):
20011         (JSC::FunctionExecutable::copyParameters):
20012         (JSC::FunctionExecutable::paramString):
20013         * runtime/Executable.h:
20014         (JSC::ScriptExecutable::ScriptExecutable):
20015         (JSC::ScriptExecutable::sourceID):
20016         (JSC::ScriptExecutable::sourceURL):
20017         (JSC::ScriptExecutable::lineNo):
20018         (JSC::ScriptExecutable::lastLine):
20019         (JSC::ScriptExecutable::usesEval):
20020         (JSC::ScriptExecutable::usesArguments):
20021         (JSC::ScriptExecutable::needsActivation):
20022         (JSC::ScriptExecutable::recordParse):
20023         (JSC::EvalExecutable::bytecode):
20024         (JSC::EvalExecutable::jitCode):
20025         (JSC::ProgramExecutable::bytecode):
20026         (JSC::ProgramExecutable::reparseExceptionInfo):
20027         (JSC::ProgramExecutable::jitCode):
20028         (JSC::FunctionExecutable::FunctionExecutable):
20029         (JSC::FunctionExecutable::make):
20030         (JSC::FunctionExecutable::bytecode):
20031         (JSC::FunctionExecutable::isGenerated):
20032         (JSC::FunctionExecutable::name):
20033         (JSC::FunctionExecutable::parameterCount):
20034         (JSC::FunctionExecutable::jitCode):
20035         * runtime/FunctionConstructor.cpp:
20036         (JSC::constructFunction):
20037         * runtime/JSGlobalData.cpp:
20038         (JSC::JSGlobalData::numericCompareFunction):
20039         * runtime/JSGlobalObjectFunctions.cpp:
20040         (JSC::globalFuncEval):
20041
20042 2009-08-24  Darin Adler  <darin@apple.com>
20043
20044         * runtime/ObjectPrototype.cpp:
20045         (JSC::ObjectPrototype::put): Landed revised version I had tested but forgot
20046         to land. Leave out the branch, since we don't need one.
20047
20048 2009-08-24  Darin Adler  <darin@apple.com>
20049
20050         Reviewed by Geoff Garen.
20051
20052         Array index miss case creates a string every time
20053         https://bugs.webkit.org/show_bug.cgi?id=28664
20054
20055         SunSpider test results I saw:
20056
20057             0.5% faster overall
20058             1% faster on crypto-aes
20059             20% faster on crypto-md5
20060             13% faster on crypto-sha1
20061
20062         * runtime/ObjectPrototype.cpp:
20063         (JSC::ObjectPrototype::ObjectPrototype): Initialize m_hasNoPropertiesWithUInt32Names
20064         to true.
20065         (JSC::ObjectPrototype::put): Clearly m_hasNoPropertiesWithUInt32Names if the new
20066         property has a name that is the string form of a UInt32.
20067         (JSC::ObjectPrototype::getOwnPropertySlot): Don't call JSObject::getOwnPropertySlot
20068         if m_hasNoPropertiesWithUInt32Names is true, and it is highly likely to be true.
20069
20070         * runtime/ObjectPrototype.h: Added declarations for the above.
20071
20072 2009-08-24  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
20073
20074         Unreviewed. Fix a typo in my distcheck build fix.
20075
20076         * GNUmakefile.am:
20077
20078 2009-08-23  Gustavo Noronha Silva  <gns@gnome.org>
20079
20080         Unreviewed build fix for make distcheck.
20081
20082         * GNUmakefile.am: Added files required for the build.
20083
20084 2009-08-22  Maciej Stachowiak  <mjs@apple.com>
20085
20086         Reviewed by Mark Rowe.
20087
20088         REGRESSION(r47639-r47660): Webkit crashes on launch on PowerPC
20089         https://bugs.webkit.org/show_bug.cgi?id=28655
20090
20091         * runtime/JSFunction.cpp:
20092         (JSC::JSFunction::JSFunction): Initialize properly with a VPtrHackExecutable.
20093         * wtf/Platform.h:
20094
20095 2009-08-22  Darin Adler  <darin@apple.com>
20096
20097         Fix storage leak from syntax tree arena allocation patch.
20098
20099         * parser/Nodes.h: CommaNode needs to inherit from ParserArenaDeletable
20100         because it has a vector.
20101
20102 2009-08-21  Darin Adler  <darin@apple.com>
20103
20104         Fix Qt build.
20105
20106         * parser/Nodes.cpp:
20107         (JSC::ScopeNodeData::ScopeNodeData): Made non-inline again.
20108         This is used outside Nodes.cpp so can't be inline unless
20109         it is in the header.
20110
20111 2009-08-21  Darin Adler  <darin@apple.com>
20112
20113         Two loose ends from the last commit.
20114
20115         * JavaScriptCore.xcodeproj/project.pbxproj: Made ParserArena.h
20116         and create_hash_table project-internal instead of "private".
20117         * runtime/Executable.h: Removed accidentally-added constructor.
20118
20119 2009-08-21  Darin Adler  <darin@apple.com>
20120
20121         Reviewed by Gavin Barraclough.
20122
20123         Syntax tree nodes should use arena allocation
20124         https://bugs.webkit.org/show_bug.cgi?id=25674
20125
20126         Use an actual arena now. 0.6% speedup on SunSpider.
20127
20128         New and improved with 100% less leaking of the universe.
20129
20130         * JavaScriptCore.exp:
20131         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
20132         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
20133         Removed all exports involving the class FunctionBodyNode, which no
20134         longer needs to be used outside JavaScriptCore.
20135
20136         * JavaScriptCore.xcodeproj/project.pbxproj: Made Nodes.h and
20137         Executable.h project-internal instead of "private".
20138
20139         * bytecompiler/BytecodeGenerator.cpp:
20140         (JSC::BytecodeGenerator::BytecodeGenerator): Updated since VarStack
20141         contains const Identifier* now.
20142
20143         * parser/Grammar.y: Made identifiers from the lexer be const
20144         Identifier* and updated since VarStack contains const Identifier* now.
20145
20146         * parser/Lexer.cpp:
20147         (JSC::Lexer::setCode): Pass in ParserArena, used for identifiers.
20148         (JSC::Lexer::makeIdentifier): Changed return type to const Identifier*
20149         and changed to call ParserArena.
20150         (JSC::Lexer::clear): Removed the code to manage m_identifiers and
20151         added code to set m_arena to 0.
20152         * parser/Lexer.h: Updated for changes above.
20153
20154         * parser/NodeConstructors.h:
20155         (JSC::ParserArenaFreeable::operator new): Added. Calls allocateFreeable
20156         on the arena.
20157         (JSC::ParserArenaDeletable::operator new): Changed to call the
20158         allocateDeletable function on the arena instead of deleteWithArena.
20159         (JSC::PropertyNode::PropertyNode): Added new constructor that makes
20160         numeric identifiers. Some day we might want to optimize this for
20161         integers so it doesn't create a string for each one.
20162         (JSC::ContinueNode::ContinueNode): Initialize m_ident to nullIdentifier
20163         since it's now a const Identifier& so it can't be left uninitialized.
20164         (JSC::BreakNode::BreakNode): Ditto.
20165         (JSC::CaseClauseNode::CaseClauseNode): Updated to use SourceElements*
20166         to keep track of the statements rather than a separate statement vector.
20167         (JSC::BlockNode::BlockNode): Ditto.
20168         (JSC::ForInNode::ForInNode): Initialize m_ident to nullIdentifier.
20169
20170         * parser/Nodes.cpp: Moved the comment explaining emitBytecode in here.
20171         It seemed strangely out of place in the header.
20172         (JSC::ThrowableExpressionData::emitThrowError): Added an overload for
20173         UString as well as Identifier.
20174         (JSC::SourceElements::singleStatement): Added.
20175         (JSC::SourceElements::lastStatement): Added.
20176         (JSC::RegExpNode::emitBytecode): Changed the throwError code to use
20177         the substitution mechanism instead of doing a string append.
20178         (JSC::SourceElements::emitBytecode): Added. Replaces the old
20179         statementListEmitCode function, since we now keep the SourceElements
20180         objects around.
20181         (JSC::BlockNode::lastStatement): Added.
20182         (JSC::BlockNode::emitBytecode): Changed to use emitBytecode instead of
20183         statementListEmitCode.
20184         (JSC::CaseClauseNode::emitBytecode): Added.
20185         (JSC::CaseBlockNode::emitBytecodeForBlock): Changed to use emitBytecode
20186         instead of statementListEmitCode.
20187         (JSC::ScopeNodeData::ScopeNodeData): Changed to store the
20188         SourceElements* instead of using releaseContentsIntoVector.
20189         (JSC::ScopeNode::emitStatementsBytecode): Added.
20190         (JSC::ScopeNode::singleStatement): Added.
20191         (JSC::ProgramNode::emitBytecode): Call emitStatementsBytecode instead
20192         of statementListEmitCode.
20193         (JSC::EvalNode::emitBytecode): Ditto.
20194         (JSC::FunctionBodyNode::emitBytecode): Call emitStatementsBytecode
20195         insetad of statementListEmitCode and check for the return node using
20196         the new functions.
20197
20198         * parser/Nodes.h: Changed VarStack to store const Identifier* instead
20199         of Identifier and rely on the arena to control lifetime. Added a new
20200         ParserArenaFreeable class. Made ParserArenaDeletable inherit from
20201         FastAllocBase instead of having its own operator new. Base the Node
20202         class on ParserArenaFreeable. Changed the various Node classes
20203         to use const Identifier& instead of Identifier to avoid the need to
20204         call their destructors and allow them to function as "freeable" in the
20205         arena. Removed extraneous JSC_FAST_CALL on definitions of inline functions.
20206         Changed ElementNode, PropertyNode, ArgumentsNode, ParameterNode,
20207         CaseClauseNode, ClauseListNode, and CaseBlockNode to use ParserArenaFreeable
20208         as a base class since they do not descend from Node. Eliminated the
20209         StatementVector type and instead have various classes use SourceElements*
20210         instead of StatementVector. This prevents those classes from having to
20211         use ParserArenaDeletable to make sure the vector destructor is called.
20212
20213         * parser/Parser.cpp:
20214         (JSC::Parser::parse): Pass the arena to the lexer.
20215
20216         * parser/Parser.h: Added an include of ParserArena.h, which is no longer
20217         included by Nodes.h.
20218         (JSC::Parser::parseFunctionFromGlobalCode): Changed to use the
20219         singleStatement function, since there is no longer any children function.
20220         Removed some unneeded use of RefPtr.
20221
20222         * parser/ParserArena.cpp:
20223         (JSC::ParserArena::ParserArena): Added. Initializes the new members,
20224         m_freeableMemory, m_freeablePoolEnd, and m_identifiers.
20225         (JSC::ParserArena::freeablePool): Added. Computes the pool pointer,
20226         since we store only the current pointer and the end of pool pointer.
20227         (JSC::ParserArena::deallocateObjects): Added. Contains the common
20228         memory-deallocation logic used by both the destructor and the
20229         reset function.
20230         (JSC::ParserArena::~ParserArena): Changed to call deallocateObjects.
20231         (JSC::ParserArena::reset): Ditto. Also added code to zero out the
20232         new structures, and switched to use clear() instead of shrink(0) since
20233         we don't really reuse arenas.
20234         (JSC::ParserArena::makeNumericIdentifier): Added.
20235         (JSC::ParserArena::allocateFreeablePool): Added. Used when the pool
20236         is empty.
20237         (JSC::ParserArena::isEmpty): Added. No longer inline, which is fine
20238         since this is used only for assertions at the moment.
20239         (JSC::ParserArena::derefWithArena): Make non-inline.
20240
20241         * parser/ParserArena.h: Added an actual arena of "freeable" objects,
20242         ones that don't need destructors to be called. Also added a separate
20243         IdentifierArena object, a segmented vector of identifiers that used
20244         to be in the Lexer.
20245
20246         * runtime/Executable.h: Moved the definition of the
20247         FunctionExecutable::make function here. It can't go in JSFunction.h
20248         since that header has to be used outside JavaScriptCore and so can't
20249         include this, which includes Nodes.h. The function could be moved
20250         elswhere if we don't want to include JSFunction.h in this header, but
20251         for now this seems to be the best place.
20252
20253         * runtime/JSFunction.h: Removed the include of Executable.h and
20254         definition of the FunctionExecutable::make function.
20255
20256         * wtf/FastMalloc.cpp: Fixed an incorrect comment.
20257
20258 2009-08-21  Mark Rowe  <mrowe@apple.com>
20259
20260         Fix the non-JIT build.
20261
20262         * runtime/Executable.cpp:
20263         * runtime/Executable.h:
20264
20265 2009-08-21  Gavin Barraclough  <barraclough@apple.com>
20266
20267         Speculative QuickTime build fix.
20268
20269         * runtime/JSArray.cpp:
20270
20271 2009-08-21  Gavin Barraclough  <barraclough@apple.com>
20272
20273         Speculative QT build fix.
20274
20275         * runtime/StringPrototype.cpp:
20276
20277 2009-08-21  Gavin Barraclough  <barraclough@apple.com>
20278
20279         Reviewed by Oliver Hunt.
20280
20281         Restructure Executable types so that host functions do not hold a FunctionExecutable.
20282         https://bugs.webkit.org/show_bug.cgi?id=28621
20283
20284         All JSFunction objects have a pointer to an Executable*.  This is currently always a
20285         FunctionExecutable, however this has a couple of drawbacks.  Host functions do not
20286         store a range of information that the FunctionExecutable provides (source, name,
20287         CodeBlock & information presently held on the FunctionBodyNode). 
20288
20289         [ * nearly all... see below! ]
20290
20291         Instead, make JSFunctions hold a pointer to an ExecutableBase, move fields specific
20292         to JS sourced executable types (source, node) into a new subclass (ScriptExecutable),
20293         and create a new NativeExecutable type.  We now provide a new method in JSFunction
20294         to access & downcast to FunctionExecutable, but in doing so we can make an early
20295         check (with an ASSERT) to ensure that the Executable read from a function will only
20296         be treated as a FunctionExecutable (and thus the JS sepcific fields will only be
20297         accessed) if the JSFunction is not a host function.
20298
20299         There is one JSFunction that currently does not have an Executable, which is the
20300         object created to allow us to read out the vtable pointer.  By making this change
20301         we can also add a new Executable type fror this object (VPtrHackExecutable).
20302         Since this means that really all JSFunctions have an Executable we no longer have
20303         to null-check m_executable before us it - particularly in isHostFunction().
20304
20305         This patch removes CacheableEvalExecutable, since all subclasses of ExecutableBase
20306         can now be ref-counted - since both JSFunction holds (and ref-counts) an ExecutableBase
20307         that might be a FunctionExecutable or a NativeExecutable.  This does now mean that all
20308         ProgramExecutables and EvalExecutables (unnecessarily) provide an interface to be
20309         ref-counted, however this seems less-bad than host functions unnecessarily providing
20310         interface to access non-host specific information.
20311
20312         The class hierarcy has changed from this:
20313         
20314         - ExecutableBase
20315             - ProgramExecutable
20316             - EvalExecutable
20317                 - CacheableEvalExecutable (also RefCounted by multiple-inheritance)
20318             - FunctionExecutable (also RefCounted by multiple-inheritance, 'special' FunctionExecutable also used for host functions)
20319
20320         To this:
20321         
20322         - RefCounted
20323             - ExecutableBase
20324                 - NativeExecutable
20325                 - VPtrHackExecutable
20326                 - ScriptExecutable
20327                     - ProgramExecutable
20328                     - EvalExecutable
20329                     - FunctionExecutable
20330
20331         This patch speeds up sunspidey by a couple of ms (presumably due to the changes to isHostFunction()).
20332
20333         * bytecode/CodeBlock.cpp:
20334         (JSC::CodeBlock::CodeBlock):
20335         * bytecode/CodeBlock.h:
20336         (JSC::CodeBlock::ownerExecutable):
20337         (JSC::GlobalCodeBlock::GlobalCodeBlock):
20338         * bytecode/EvalCodeCache.h:
20339         (JSC::EvalCodeCache::get):
20340         * debugger/Debugger.cpp:
20341         (JSC::Debugger::recompileAllJSFunctions):
20342         * interpreter/CachedCall.h:
20343         (JSC::CachedCall::CachedCall):
20344         * interpreter/Interpreter.cpp:
20345         (JSC::Interpreter::callEval):
20346         (JSC::Interpreter::privateExecute):
20347         * jit/JITStubs.cpp:
20348         (JSC::DEFINE_STUB_FUNCTION):
20349         * profiler/Profiler.cpp:
20350         (JSC::createCallIdentifierFromFunctionImp):
20351         * runtime/Arguments.h:
20352         (JSC::Arguments::getArgumentsData):
20353         (JSC::Arguments::Arguments):
20354         * runtime/Executable.cpp:
20355         (JSC::NativeExecutable::~NativeExecutable):
20356         (JSC::VPtrHackExecutable::~VPtrHackExecutable):
20357         * runtime/Executable.h:
20358         (JSC::ExecutableBase::ExecutableBase):
20359         (JSC::ExecutableBase::~ExecutableBase):
20360         (JSC::ExecutableBase::isHostFunction):
20361         (JSC::NativeExecutable::NativeExecutable):
20362         (JSC::VPtrHackExecutable::VPtrHackExecutable):
20363         (JSC::ScriptExecutable::ScriptExecutable):
20364         (JSC::ScriptExecutable::source):
20365         (JSC::ScriptExecutable::sourceID):
20366         (JSC::ScriptExecutable::sourceURL):
20367         (JSC::ScriptExecutable::lineNo):
20368         (JSC::ScriptExecutable::lastLine):
20369         (JSC::ScriptExecutable::usesEval):
20370         (JSC::ScriptExecutable::usesArguments):
20371         (JSC::ScriptExecutable::needsActivation):
20372         (JSC::EvalExecutable::EvalExecutable):
20373         (JSC::EvalExecutable::create):
20374         (JSC::ProgramExecutable::ProgramExecutable):
20375         (JSC::FunctionExecutable::FunctionExecutable):
20376         * runtime/FunctionPrototype.cpp:
20377         (JSC::functionProtoFuncToString):
20378         * runtime/JSFunction.cpp:
20379         (JSC::JSFunction::JSFunction):
20380         (JSC::JSFunction::~JSFunction):
20381         (JSC::JSFunction::markChildren):
20382         (JSC::JSFunction::getCallData):
20383         (JSC::JSFunction::call):
20384         (JSC::JSFunction::lengthGetter):
20385         (JSC::JSFunction::getConstructData):
20386         (JSC::JSFunction::construct):
20387         * runtime/JSFunction.h:
20388         (JSC::JSFunction::executable):
20389         (JSC::JSFunction::jsExecutable):
20390         (JSC::JSFunction::isHostFunction):
20391
20392 2009-08-20  Oliver Hunt  <oliver@apple.com>
20393
20394         Reviewed by Maciej Stachowiak.
20395
20396         Browser hangs on opening Web Inspector.
20397         https://bugs.webkit.org/show_bug.cgi?id=28438
20398
20399         Code generation needs to be able to walk the entire scopechain in some
20400         cases, however the symbol table used by activations was a member of the
20401         codeblock.  Following recompilation this may no longer exist, leading
20402         to a crash or hang on lookup.
20403
20404         We fix this by introducing a refcounted SymbolTable subclass, SharedSymbolTable,
20405         for the CodeBlocks used by function code.  This allows activations to
20406         maintain ownership of a copy of the symbol table even after recompilation so
20407         they can continue to work.
20408
20409         * bytecode/CodeBlock.cpp:
20410         (JSC::CodeBlock::CodeBlock):
20411         * bytecode/CodeBlock.h:
20412         (JSC::CodeBlock::symbolTable):
20413         (JSC::CodeBlock::sharedSymbolTable):
20414         (JSC::GlobalCodeBlock::GlobalCodeBlock):
20415         (JSC::FunctionCodeBlock::FunctionCodeBlock):
20416         (JSC::FunctionCodeBlock::~FunctionCodeBlock):
20417         * interpreter/Interpreter.cpp:
20418         (JSC::Interpreter::retrieveArguments):
20419         * runtime/Executable.cpp:
20420         (JSC::EvalExecutable::generateBytecode):
20421         (JSC::FunctionExecutable::generateBytecode):
20422         (JSC::FunctionExecutable::reparseExceptionInfo):
20423         (JSC::EvalExecutable::reparseExceptionInfo):
20424         * runtime/JSActivation.h:
20425         (JSC::JSActivation::JSActivationData::JSActivationData):
20426         (JSC::JSActivation::JSActivationData::~JSActivationData):
20427         * runtime/SymbolTable.h:
20428
20429 2009-08-20  Xan Lopez  <xlopez@igalia.com>
20430
20431         Add new file to GTK+ build.
20432
20433         * GNUmakefile.am:
20434
20435 2009-08-20  Geoffrey Garen  <ggaren@apple.com>
20436
20437         Reviewed by Maciej Stachowiak.
20438
20439         Added a number => string cache.
20440         
20441         1.07x faster on v8 (1.7x faster on v8-splay).
20442         1.004x faster on SunSpider.
20443
20444         * runtime/JSCell.h: Moved JSValue::toString to JSString.h.
20445         * runtime/JSGlobalData.h: Holds the cache.
20446         * runtime/JSNumberCell.cpp:
20447         (JSC::JSNumberCell::toString):
20448         (JSC::JSNumberCell::toThisString): Removed -0 special case.
20449         UString handles this now, since too many clients were
20450         special-casing it.
20451
20452         * runtime/JSString.h:
20453         (JSC::JSValue::toString): Use the cache when converting
20454         an int or double to string.
20455
20456         * runtime/Operations.h:
20457         (JSC::concatenateStrings): Call toString to take advantage
20458         of the cache.
20459
20460         * runtime/SmallStrings.h:
20461         (JSC::NumericStrings::add):
20462         (JSC::NumericStrings::lookup): The cache.
20463
20464         * runtime/UString.cpp:
20465         (JSC::UString::from): Added -0 special case mentioned above.
20466         Removed appendNumeric because it's mutually exclusive with the
20467         cache.
20468
20469 2009-08-20  Oliver Hunt  <oliver@apple.com>
20470
20471         Reviewed by Gavin Barraclough.
20472
20473         REGRESSION: fast/profiler/call.html is crashing occasionally
20474         https://bugs.webkit.org/show_bug.cgi?id=28476
20475
20476         Using the codeblock for information about how many parameters and
20477         locals a function has is unsafe in certain circumstances.  The
20478         basic scenario is all function code being cleared in response to
20479         the debugger or profiler being enabled, and then an activation is
20480         marked before its associated function is re-executed.
20481
20482         To deal with this scenario we store the variable count of a function
20483         directly in the FunctionExecutable, and then use that information.
20484
20485         * runtime/Arguments.h:
20486         (JSC::Arguments::getArgumentsData):
20487         * runtime/Executable.cpp:
20488         (JSC::FunctionExecutable::generateBytecode):
20489         * runtime/Executable.h:
20490         (JSC::FunctionExecutable::FunctionExecutable):
20491         (JSC::FunctionExecutable::variableCount):
20492         * runtime/JSActivation.cpp:
20493         (JSC::JSActivation::markChildren):
20494
20495 2009-08-20  Gavin Barraclough  <barraclough@apple.com>
20496
20497         Reviewed by Oliver Hunt.
20498
20499         Numbering of arguments to emitGetJITStubArg/emitPutJITStubArg incorrect
20500         <bug lost in the great bug disasteroony of 08/20/09!>
20501
20502         The argumentNumber argument to emitGetJITStubArg/emitPutJITStubArg should match
20503         the argument number used within the stub functions in JITStubs.cpp, but it doesn't.
20504
20505         Firstly, all the numbers changed when we added a void* 'reserved' as the first slot
20506         (rather than leaving argument 0 unused), and secondly in 32_64 builds the index to
20507         peek/poke needs to be multiplies by 2 (since the argument to peek/poke is a number
20508         of machine words, and on 32_64 build the argument slots to stub functions are two
20509         words wide).
20510
20511         * jit/JIT.h:
20512         * jit/JITCall.cpp:
20513         (JSC::JIT::compileOpCallSetupArgs):
20514         (JSC::JIT::compileOpConstructSetupArgs):
20515         (JSC::JIT::compileOpCallVarargsSetupArgs):
20516         (JSC::JIT::compileOpCall):
20517         * jit/JITInlineMethods.h:
20518         (JSC::JIT::emitPutJITStubArg):
20519         (JSC::JIT::emitPutJITStubArgConstant):
20520         (JSC::JIT::emitGetJITStubArg):
20521         (JSC::JIT::emitPutJITStubArgFromVirtualRegister):
20522         * jit/JITOpcodes.cpp:
20523         (JSC::JIT::privateCompileCTIMachineTrampolines):
20524         * jit/JITPropertyAccess.cpp:
20525         (JSC::JIT::privateCompilePutByIdTransition):
20526
20527 2009-08-20  Oliver Hunt  <oliver@apple.com>
20528
20529         Reviewed by Geoff Garen.
20530
20531         REGRESSION: significant slowdown on Celtic Kane "AJAX declaration" subtest
20532         https://bugs.webkit.org/show_bug.cgi?id=28332
20533
20534         Follow up style fixes that were missed in review.
20535
20536         * runtime/Structure.cpp:
20537         (JSC::Structure::hasTransition):
20538         * runtime/Structure.h:
20539         (JSC::Structure::get):
20540         (JSC::StructureTransitionTable::contains):
20541         * runtime/StructureTransitionTable.h:
20542         (JSC::StructureTransitionTable::add):
20543
20544 2009-08-20  Oliver Hunt  <oliver@apple.com>
20545
20546         Add new exports to windows jsc build
20547
20548         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
20549         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
20550
20551 2009-08-20  Oliver Hunt  <oliver@apple.com>
20552
20553         Reviewed by Gavin Barraclough.
20554
20555         REGRESSION: significant slowdown on Celtic Kane "AJAX declaration" subtest
20556         https://bugs.webkit.org/show_bug.cgi?id=28332
20557
20558         The method check optimisation made transitions aware of the value being
20559         assigned when a transition was assigning a function.  This had the side
20560         effect of making every assignment of a function expression result in a
20561         new transition, and thus a new Structure.  The net result of this is that
20562         the common JS idiom of
20563
20564             function MyObject() {
20565                 this.myFunction = function(...){...};
20566             }
20567             new MyObject();
20568
20569         Will produce a unique structure on every iteration, meaning that all
20570         caching is defeated and there is a significant amount of structure churn.
20571
20572         The fix is to return the transition to its original form where it is
20573         keyed off a property name + attributes tuple, but have each transition
20574         support an optional transition on a specific value.
20575
20576         * JavaScriptCore.exp:
20577         * runtime/JSObject.h:
20578         (JSC::JSObject::putDirectInternal):
20579         * runtime/Structure.cpp:
20580         (JSC::Structure::~Structure):
20581         (JSC::Structure::addPropertyTransitionToExistingStructure):
20582         (JSC::Structure::addPropertyTransition):
20583         (JSC::Structure::hasTransition):
20584         * runtime/Structure.h:
20585         (JSC::Structure::transitionedFor):
20586         (JSC::Structure::hasTransition):
20587         (JSC::Structure::):
20588         (JSC::StructureTransitionTable::contains):
20589         (JSC::StructureTransitionTable::get):
20590         * runtime/StructureTransitionTable.h:
20591         (JSC::StructureTransitionTableHashTraits::emptyValue):
20592         (JSC::StructureTransitionTable::hasTransition):
20593         (JSC::StructureTransitionTable::remove):
20594         (JSC::StructureTransitionTable::add):
20595
20596 2009-08-20  Gavin Barraclough  <barraclough@apple.com>
20597
20598         Reviewed by Oliver Hunt.
20599
20600         Remove FunctionCodeBlock.
20601         https://bugs.webkit.org/show_bug.cgi?id=28502
20602
20603         These only exist to allow JIT code to dereference properties off the
20604         CodeBlock for any callee, regardless of whether it is a host function.
20605
20606         Instead just use the FunctionExecutable.  Copy the m_parameters field
20607         from the CodeBlock into the Executable, and use this to distinguish
20608         between host functions, functions that have been bytecompiled, and
20609         functions that have not.
20610
20611         m_parameters is moved to ExecutableBase rather than FunctionExecutable
20612         so that (as a separate change) we can move make a separate class of
20613         executable for host code, which is not devived from FunctionExecutable
20614         (host code does not feature any of the properties that normal executable
20615         do and will provide, such as source, attributes, and a parsed name).
20616
20617         1% win on v8 tests, 0.5% on sunspider.
20618
20619         * bytecode/CodeBlock.cpp:
20620         (JSC::CodeBlock::derefStructures):
20621         (JSC::CodeBlock::refStructures):
20622         (JSC::CodeBlock::reparseForExceptionInfoIfNecessary):
20623         (JSC::CodeBlock::handlerForBytecodeOffset):
20624         (JSC::CodeBlock::lineNumberForBytecodeOffset):
20625         (JSC::CodeBlock::expressionRangeForBytecodeOffset):
20626         (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset):
20627         (JSC::CodeBlock::functionRegisterForBytecodeOffset):
20628         (JSC::CodeBlock::hasGlobalResolveInstructionAtBytecodeOffset):
20629         (JSC::CodeBlock::hasGlobalResolveInfoAtBytecodeOffset):
20630         * bytecode/CodeBlock.h:
20631         (JSC::):
20632         (JSC::CodeBlock::source):
20633         (JSC::CodeBlock::sourceOffset):
20634         (JSC::CodeBlock::evalCodeCache):
20635         (JSC::CodeBlock::createRareDataIfNecessary):
20636         
20637             remove NativeCodeBlocks and the NativeCode code type.
20638         
20639         * jit/JIT.cpp:
20640         (JSC::JIT::linkCall):
20641
20642             Revert to previous behaviour (as currently still commented!) that Hhost functions have a null codeblock.
20643
20644         * jit/JITCall.cpp:
20645         (JSC::JIT::compileOpCallInitializeCallFrame):
20646         (JSC::JIT::compileOpCallSetupArgs):
20647         (JSC::JIT::compileOpCallVarargsSetupArgs):
20648         (JSC::JIT::compileOpConstructSetupArgs):
20649         (JSC::JIT::compileOpCallVarargs):
20650         (JSC::JIT::compileOpCall):
20651         (JSC::JIT::compileOpCallSlowCase):
20652
20653             Bring the 32_64 & non-32_64 JITs into line with each other, callee in regT0.
20654
20655         * jit/JITOpcodes.cpp:
20656         (JSC::JIT::privateCompileCTIMachineTrampolines):
20657
20658             Rewrite call trampolines to not use the CodeBlock.
20659
20660         * jit/JITStubs.cpp:
20661         (JSC::DEFINE_STUB_FUNCTION):
20662
20663             Make call_JSFunction & call_arityCheck return the callee, don't expect to be passed the CodeBlock.
20664
20665         * runtime/Executable.cpp:
20666         (JSC::FunctionExecutable::generateBytecode):
20667         (JSC::FunctionExecutable::recompile):
20668         (JSC::FunctionExecutable::FunctionExecutable):
20669         * runtime/Executable.h:
20670         (JSC::ExecutableBase::):
20671         (JSC::ExecutableBase::ExecutableBase):
20672         (JSC::FunctionExecutable::isHostFunction):
20673
20674             Add m_numParameters.
20675
20676         * runtime/JSFunction.cpp:
20677         (JSC::JSFunction::~JSFunction):
20678
20679             Only call generatedBytecode() on JSFunctions non-host FunctionExecutables.
20680
20681 2009-08-20  Yongjun Zhang  <yongjun.zhang@nokia.com>
20682
20683         Reviewed by Eric Seidel.
20684
20685         https://bugs.webkit.org/show_bug.cgi?id=28054
20686        
20687         Use a helper function to work around winscw compiler forward declaration bug
20688         regarding templated classes.
20689
20690         Add parenthesis around (PassRefPtr::*UnspecifiedBoolType) to make winscw compiler
20691         work with the default UnSpecifiedBoolType() operator, which removes the winscw
20692         specific bool cast hack.
20693
20694         * wtf/PassRefPtr.h:
20695         (WTF::derefIfNotNull):
20696         (WTF::PassRefPtr::~PassRefPtr):
20697
20698 2009-08-19  Yong Li  <yong.li@torchmobile.com>
20699
20700         Reviewed by Gavin Barraclough.
20701
20702         Change namespace ARM to ARMRegisters
20703         X86 to X86Registers to avoid conflict with macros
20704         https://bugs.webkit.org/show_bug.cgi?id=28428
20705
20706         * assembler/ARMAssembler.cpp:
20707         * assembler/ARMAssembler.h:
20708         * assembler/ARMv7Assembler.h:
20709         * assembler/MacroAssemblerARM.h:
20710         * assembler/MacroAssemblerARMv7.h:
20711         * assembler/MacroAssemblerX86Common.h:
20712         * assembler/MacroAssemblerX86_64.h:
20713         * assembler/X86Assembler.h:
20714         * jit/JIT.h:
20715         * jit/JITArithmetic.cpp:
20716         * jit/JITInlineMethods.h:
20717         * jit/JITOpcodes.cpp:
20718         * wrec/WRECGenerator.cpp:
20719         * wrec/WRECGenerator.h:
20720         * yarr/RegexJIT.cpp:
20721
20722 2009-08-19  Oliver Hunt  <oliver@apple.com>
20723
20724         Reviewed by Gavin Barraclough.
20725
20726         Devirtualise marking
20727         https://bugs.webkit.org/show_bug.cgi?id=28294
20728
20729         We actually need to mark the value in a number object if we're using the
20730         32bit number representation.
20731
20732         * runtime/NumberObject.h:
20733         (JSC::NumberObject::createStructure):
20734
20735 2009-08-19  Gavin Barraclough  <barraclough@apple.com>
20736
20737         Reviewed by Darin Adler.
20738
20739          We probably shouldn't be keeping the AST for eval nodes around forevar.
20740         https://bugs.webkit.org/show_bug.cgi?id=28469
20741
20742         EvalNodes don't destroyData() (delete their parser data) since they need to hold onto
20743         their varStack.  Copy a list of variable onto EvalCodeBlock, and this can go away.
20744
20745         * bytecode/CodeBlock.h:
20746         (JSC::EvalCodeBlock::variable):
20747         (JSC::EvalCodeBlock::numVariables):
20748         (JSC::EvalCodeBlock::adoptVariables):
20749         * bytecompiler/BytecodeGenerator.cpp:
20750         (JSC::BytecodeGenerator::BytecodeGenerator):
20751         * interpreter/Interpreter.cpp:
20752         (JSC::Interpreter::execute):
20753         * parser/Nodes.h:
20754         * runtime/Executable.cpp:
20755         (JSC::EvalExecutable::generateBytecode):
20756         * runtime/Executable.h:
20757
20758 2009-08-19  Jungshik Shin  <jshin@chromium.org>
20759
20760         Reviewed by Darin Adler.
20761
20762         http://bugs.webkit.org/show_bug.cgi?id=28441
20763
20764         Fix a build issue with ICU 4.2 or later on Windows with Visual C++. 
20765         Instead of defining all isXXX and toupper/tolower as 
20766           WTF_Please_use_ASCIICType_instead_of_ctype_see_comment_in_ASCIICType_h,
20767         #define them to be different by prepending 'WTF_...ASCIIType_h' with
20768         the originial names like 'toupper_WTF_...ASCIIType_h'. 
20769
20770         * wtf/DisallowCType.h:
20771
20772 2009-08-18  Oliver Hunt  <oliver@apple.com>
20773
20774         Reviewed by Gavin Barraclough.
20775
20776         Assigning a function to an object should always use the existing transition, even if the transition is not specialized
20777         https://bugs.webkit.org/show_bug.cgi?id=28442
20778
20779         Check for an unspecialized transition as an alternative to always failing if specialisation does not match.
20780
20781         * runtime/Structure.cpp:
20782         (JSC::Structure::addPropertyTransitionToExistingStructure):
20783
20784 2009-08-18  Dirk Schulze  <krit@webkit.org>
20785
20786         Reviewed by Oliver Hunt.
20787
20788         Added additional getter to ByteArray with an unsigned char as return.
20789         ByteArray can take unsigned char directly now.
20790
20791         * wtf/ByteArray.h:
20792         (WTF::ByteArray::set):
20793         (WTF::ByteArray::get):
20794
20795 2009-08-18  Peter Kasting  <pkasting@google.com>
20796
20797         Reviewed by Eric Seidel.
20798
20799         https://bugs.webkit.org/show_bug.cgi?id=28415
20800         Set svn:eol-style CRLF on all .sln and .vcproj files that don't already
20801         have it.
20802
20803         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj:
20804         * JavaScriptCore.vcproj/testapi/testapi.vcproj:
20805         
20806 2009-08-18  Xan Lopez  <xlopez@igalia.com>
20807
20808         Try to fix the GTK+ build.
20809
20810         * GNUmakefile.am:
20811
20812 2009-08-17  Gavin Barraclough  <barraclough@apple.com>
20813
20814         Reviewed by Sam Weinig.
20815
20816         No, silly runtime, AST nodes are not for you.
20817
20818         We still use AST nodes (ScopeNodes, particularly FunctionBodyNodes) within
20819         the runtime, which means that these nodes must be persisted outside of the
20820         arena, contain both parser & runtime data, etc.  This is all a bit of a mess.
20821
20822         Move functionality into a new FunctionExecutable class.
20823
20824         * API/JSCallbackFunction.cpp:
20825         * API/JSObjectRef.cpp:
20826         * JavaScriptCore.exp:
20827         * JavaScriptCore.xcodeproj/project.pbxproj:
20828         * bytecode/CodeBlock.cpp:
20829         (JSC::CodeBlock::CodeBlock):
20830         (JSC::CodeBlock::markAggregate):
20831         (JSC::CodeBlock::reparseForExceptionInfoIfNecessary):
20832         (JSC::CodeBlock::lineNumberForBytecodeOffset):
20833         (JSC::CodeBlock::shrinkToFit):
20834         * bytecode/CodeBlock.h:
20835         (JSC::CodeBlock::getBytecodeIndex):
20836         (JSC::CodeBlock::discardBytecode):
20837         (JSC::CodeBlock::instructionCount):
20838         (JSC::CodeBlock::getJITCode):
20839         (JSC::CodeBlock::executablePool):
20840         (JSC::CodeBlock::ownerExecutable):
20841         (JSC::CodeBlock::extractExceptionInfo):
20842         (JSC::CodeBlock::addFunctionDecl):
20843         (JSC::CodeBlock::functionDecl):
20844         (JSC::CodeBlock::numberOfFunctionDecls):
20845         (JSC::CodeBlock::addFunctionExpr):
20846         (JSC::CodeBlock::functionExpr):
20847         (JSC::GlobalCodeBlock::GlobalCodeBlock):
20848         (JSC::ProgramCodeBlock::ProgramCodeBlock):
20849         (JSC::EvalCodeBlock::EvalCodeBlock):
20850         (JSC::FunctionCodeBlock::FunctionCodeBlock):
20851         (JSC::NativeCodeBlock::NativeCodeBlock):
20852         * bytecode/EvalCodeCache.h:
20853         * bytecode/SamplingTool.cpp:
20854         (JSC::SamplingTool::doRun):
20855         * bytecompiler/BytecodeGenerator.cpp:
20856         (JSC::BytecodeGenerator::BytecodeGenerator):
20857         (JSC::BytecodeGenerator::emitNewFunction):
20858         (JSC::BytecodeGenerator::emitNewFunctionExpression):
20859         * bytecompiler/BytecodeGenerator.h:
20860         * debugger/Debugger.cpp:
20861         (JSC::Debugger::recompileAllJSFunctions):
20862         * interpreter/CachedCall.h:
20863         (JSC::CachedCall::CachedCall):
20864         * interpreter/CallFrameClosure.h:
20865         * interpreter/Interpreter.cpp:
20866         (JSC::Interpreter::unwindCallFrame):
20867         (JSC::Interpreter::throwException):
20868         (JSC::Interpreter::execute):
20869         (JSC::Interpreter::prepareForRepeatCall):
20870         (JSC::Interpreter::debug):
20871         (JSC::Interpreter::privateExecute):
20872         (JSC::Interpreter::retrieveLastCaller):
20873         * interpreter/Interpreter.h:
20874         * jit/JIT.cpp:
20875         (JSC::JIT::privateCompile):
20876         * jit/JIT.h:
20877         (JSC::JIT::compile):
20878         * jit/JITOpcodes.cpp:
20879         (JSC::JIT::privateCompileCTIMachineTrampolines):
20880         (JSC::JIT::emit_op_new_func):
20881         (JSC::JIT::emit_op_new_func_exp):
20882         * jit/JITStubs.cpp:
20883         (JSC::DEFINE_STUB_FUNCTION):
20884         * jit/JITStubs.h:
20885         (JSC::):
20886         * parser/Nodes.cpp:
20887         (JSC::FunctionBodyNode::reparseDataIfNecessary):
20888         * parser/Nodes.h:
20889         (JSC::EvalNode::partialDestroyData):
20890         * parser/Parser.h:
20891         * profiler/ProfileGenerator.cpp:
20892         * profiler/Profiler.cpp:
20893         (JSC::Profiler::createCallIdentifier):
20894         (JSC::createCallIdentifierFromFunctionImp):
20895         * runtime/Arguments.h:
20896         (JSC::Arguments::getArgumentsData):
20897         (JSC::Arguments::Arguments):
20898         (JSC::JSActivation::copyRegisters):
20899         * runtime/ArrayPrototype.cpp:
20900         (JSC::isNumericCompareFunction):
20901         * runtime/CallData.h:
20902         (JSC::):
20903         * runtime/Collector.cpp:
20904         (JSC::Heap::collect):
20905         * runtime/ConstructData.h:
20906         (JSC::):
20907         * runtime/ExceptionHelpers.cpp:
20908         (JSC::createUndefinedVariableError):
20909         (JSC::createInvalidParamError):
20910         (JSC::createNotAConstructorError):
20911         (JSC::createNotAFunctionError):
20912         (JSC::createNotAnObjectError):
20913         * runtime/Executable.cpp: Added.
20914         (JSC::EvalExecutable::generateBytecode):
20915         (JSC::ProgramExecutable::generateBytecode):
20916         (JSC::FunctionExecutable::generateBytecode):
20917         (JSC::EvalExecutable::generateJITCode):
20918         (JSC::ProgramExecutable::generateJITCode):
20919         (JSC::FunctionExecutable::generateJITCode):
20920         (JSC::FunctionExecutable::isHostFunction):
20921         (JSC::FunctionExecutable::markAggregate):
20922         (JSC::FunctionExecutable::reparseExceptionInfo):
20923         (JSC::EvalExecutable::reparseExceptionInfo):
20924         (JSC::FunctionExecutable::recompile):
20925         (JSC::FunctionExecutable::FunctionExecutable):
20926         * runtime/Executable.h:
20927         (JSC::ExecutableBase::~ExecutableBase):
20928         (JSC::ExecutableBase::ExecutableBase):
20929         (JSC::ExecutableBase::source):
20930         (JSC::ExecutableBase::sourceID):
20931         (JSC::ExecutableBase::lastLine):
20932         (JSC::ExecutableBase::usesEval):
20933         (JSC::ExecutableBase::usesArguments):
20934         (JSC::ExecutableBase::needsActivation):
20935         (JSC::ExecutableBase::astNode):
20936         (JSC::ExecutableBase::generatedJITCode):
20937         (JSC::ExecutableBase::getExecutablePool):
20938         (JSC::EvalExecutable::EvalExecutable):
20939         (JSC::EvalExecutable::bytecode):
20940         (JSC::EvalExecutable::varStack):
20941         (JSC::EvalExecutable::evalNode):
20942         (JSC::EvalExecutable::jitCode):
20943         (JSC::ProgramExecutable::ProgramExecutable):
20944         (JSC::ProgramExecutable::reparseExceptionInfo):
20945         (JSC::ProgramExecutable::bytecode):
20946         (JSC::ProgramExecutable::programNode):
20947         (JSC::ProgramExecutable::jitCode):
20948         (JSC::FunctionExecutable::FunctionExecutable):
20949         (JSC::FunctionExecutable::name):
20950         (JSC::FunctionExecutable::bytecode):
20951         (JSC::FunctionExecutable::generatedBytecode):
20952         (JSC::FunctionExecutable::usesEval):
20953         (JSC::FunctionExecutable::usesArguments):
20954         (JSC::FunctionExecutable::parameterCount):
20955         (JSC::FunctionExecutable::paramString):
20956         (JSC::FunctionExecutable::isGenerated):
20957         (JSC::FunctionExecutable::body):
20958         (JSC::FunctionExecutable::jitCode):
20959         (JSC::FunctionExecutable::createNativeThunk):
20960         * runtime/FunctionConstructor.cpp:
20961         (JSC::constructFunction):
20962         * runtime/FunctionPrototype.cpp:
20963         (JSC::functionProtoFuncToString):
20964         * runtime/JSActivation.cpp:
20965         (JSC::JSActivation::JSActivation):
20966         (JSC::JSActivation::markChildren):
20967         (JSC::JSActivation::isDynamicScope):
20968         (JSC::JSActivation::argumentsGetter):
20969         * runtime/JSActivation.h:
20970         (JSC::JSActivation::JSActivationData::JSActivationData):
20971         * runtime/JSFunction.cpp:
20972         (JSC::JSFunction::isHostFunction):
20973         (JSC::JSFunction::JSFunction):
20974         (JSC::JSFunction::~JSFunction):
20975         (JSC::JSFunction::markChildren):
20976         (JSC::JSFunction::getCallData):
20977         (JSC::JSFunction::call):
20978         (JSC::JSFunction::lengthGetter):
20979         (JSC::JSFunction::getConstructData):
20980         (JSC::JSFunction::construct):
20981         * runtime/JSFunction.h:
20982         (JSC::JSFunction::executable):
20983         (JSC::FunctionExecutable::make):
20984         * runtime/JSGlobalData.cpp:
20985         (JSC::JSGlobalData::JSGlobalData):
20986         (JSC::JSGlobalData::numericCompareFunction):
20987         * runtime/JSGlobalData.h:
20988
20989 2009-08-17  Mark Rowe  <mrowe@apple.com>
20990
20991         Reviewed by Darin Adler.
20992
20993         Fix 300,000+ leaks seen during the regression tests.
20994
20995         EvalCodeCache::get was heap-allocating an EvalExecutable instance without adopting the initial reference.
20996         While fixing this we noticed that EvalExecutable was a RefCounted type that was sometimes stack allocated.
20997         To make this cleaner and to prevent clients from attempting to ref a stack-allocated instance, we move the
20998         refcounting down to a new CacheableEvalExecutable class that derives from EvalExecutable. EvalCodeCache::get
20999         now uses CacheableEvalExecutable::create and avoids the leak.
21000
21001         * bytecode/EvalCodeCache.h:
21002         (JSC::EvalCodeCache::get):
21003         * interpreter/Interpreter.cpp:
21004         (JSC::Interpreter::callEval):
21005         * runtime/Executable.h:
21006         (JSC::CacheableEvalExecutable::create):
21007         (JSC::CacheableEvalExecutable::CacheableEvalExecutable):
21008
21009 2009-08-17  Oliver Hunt  <oliver@apple.com>
21010
21011         RS=Mark Rowe.
21012
21013         REGRESSION (r47292): Prototype.js is broken by ES5 Arguments changes
21014         https://bugs.webkit.org/show_bug.cgi?id=28341
21015         <rdar://problem/7145615>
21016
21017         Reverting r47292.  Alas Prototype.js breaks with Arguments inheriting
21018         from Array as ES5 attempted.  Prototype.js defines $A in terms of a 
21019         function it places on (among other global objects) the Array prototype,
21020         thus breaking $A for arrays.
21021
21022         * runtime/Arguments.h:
21023         (JSC::Arguments::Arguments):
21024         * runtime/JSGlobalObject.cpp:
21025         (JSC::JSGlobalObject::reset):
21026         (JSC::JSGlobalObject::markChildren):
21027         * runtime/JSGlobalObject.h:
21028         (JSC::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData):
21029         * runtime/ObjectPrototype.cpp:
21030         (JSC::ObjectPrototype::ObjectPrototype):
21031         * runtime/ObjectPrototype.h:
21032         * tests/mozilla/ecma_3/Function/arguments-001.js:
21033
21034 2009-08-17  Peter Kasting  <pkasting@google.com>
21035
21036         Reviewed by Steve Falkenburg.
21037
21038         https://bugs.webkit.org/show_bug.cgi?id=27323
21039         Only add Cygwin to the path when it isn't already there.  This avoids
21040         causing problems for people who purposefully have non-Cygwin versions of
21041         executables like svn in front of the Cygwin ones in their paths.
21042
21043         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
21044         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj:
21045         * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops:
21046         * JavaScriptCore.vcproj/jsc/jscCommon.vsprops:
21047         * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops:
21048
21049 2009-08-17  Xan Lopez  <xlopez@igalia.com>
21050
21051         Reviewed by Mark Rowe.
21052
21053         Fix build with FAST_MALLOC_MATCH_VALIDATION enabled.
21054
21055         * wtf/FastMalloc.cpp:
21056         (WTF::fastMalloc):
21057         (WTF::fastCalloc):
21058         (WTF::fastRealloc):
21059
21060 2009-08-16  Holger Hans Peter Freyther  <zecke@selfish.org>
21061
21062         Reviewed by Mark Rowe.
21063
21064         Fix crash on ./ecma_2/RegExp/exec-002.js.
21065         https://bugs.webkit.org/show_bug.cgi?id=28353
21066
21067         Change the order of freeParenthesesDisjunctionContext and
21068         popParenthesesDisjunctionContext on all call sites as the pop
21069         method is accessing backTrack->lastContext which is the context
21070         that is about to be freed.
21071
21072         * yarr/RegexInterpreter.cpp:
21073         (JSC::Yarr::Interpreter::parenthesesDoBacktrack):
21074         (JSC::Yarr::Interpreter::backtrackParentheses):
21075
21076 2009-08-16  Holger Hans Peter Freyther  <zecke@selfish.org>
21077
21078         Reviewed by Mark Rowe.
21079
21080         https://bugs.webkit.org/show_bug.cgi?id=28352
21081
21082         Fix coding style violations. Use m_ for C++ class members. Remove
21083         trailing whitespace on empty lines.
21084
21085         * yarr/RegexInterpreter.cpp:
21086         (JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::ParenthesesDisjunctionContext):
21087         (JSC::Yarr::Interpreter::tryConsumeCharacter):
21088         (JSC::Yarr::Interpreter::tryConsumeBackReference):
21089         (JSC::Yarr::Interpreter::parenthesesDoBacktrack):
21090         (JSC::Yarr::Interpreter::backtrackParentheses):
21091         (JSC::Yarr::ByteCompiler::ByteCompiler):
21092         (JSC::Yarr::ByteCompiler::compile):
21093         (JSC::Yarr::ByteCompiler::checkInput):
21094         (JSC::Yarr::ByteCompiler::assertionBOL):
21095         (JSC::Yarr::ByteCompiler::assertionEOL):
21096         (JSC::Yarr::ByteCompiler::assertionWordBoundary):
21097         (JSC::Yarr::ByteCompiler::atomPatternCharacter):
21098         (JSC::Yarr::ByteCompiler::atomCharacterClass):
21099         (JSC::Yarr::ByteCompiler::atomBackReference):
21100         (JSC::Yarr::ByteCompiler::atomParenthesesSubpatternBegin):
21101         (JSC::Yarr::ByteCompiler::atomParentheticalAssertionBegin):
21102         (JSC::Yarr::ByteCompiler::popParenthesesStack):
21103         (JSC::Yarr::ByteCompiler::closeAlternative):
21104         (JSC::Yarr::ByteCompiler::closeBodyAlternative):
21105         (JSC::Yarr::ByteCompiler::atomParenthesesEnd):
21106         (JSC::Yarr::ByteCompiler::regexBegin):
21107         (JSC::Yarr::ByteCompiler::alterantiveBodyDisjunction):
21108         (JSC::Yarr::ByteCompiler::alterantiveDisjunction):
21109         (JSC::Yarr::ByteCompiler::emitDisjunction):
21110
21111 2009-08-15  Mark Rowe  <mrowe@apple.com>
21112
21113         Fix the build with JIT disabled.
21114
21115         * runtime/Arguments.h: Only compile the jitCode method when the JIT is enabled.
21116         * runtime/Executable.h: Include PrototypeFunction.h so the compiler knows what
21117         NativeFunctionWrapper is when the JIT is disabled.
21118
21119 2009-08-15  Adam Bergkvist  <adam.bergkvist@ericsson.com>
21120
21121         Reviewed by Sam Weinig.
21122
21123         Added ENABLE_EVENTSOURCE flag.
21124         https://bugs.webkit.org/show_bug.cgi?id=14997
21125
21126         * Configurations/FeatureDefines.xcconfig:
21127
21128 2009-08-14  Gavin Barraclough  <barraclough@apple.com>
21129
21130         * parser/Parser.h:
21131         (JSC::EvalExecutable::parse):
21132         (JSC::ProgramExecutable::parse):
21133         * runtime/Executable.h:
21134
21135 2009-08-14  Gavin Barraclough  <barraclough@apple.com>
21136
21137         Reviewed by Oliver Hunt.
21138
21139         Remove AST nodes from use within the Runtime (outside of parsing), stage 1
21140         https://bugs.webkit.org/show_bug.cgi?id=28330
21141
21142         Remove the EvalNode and ProgramNode from use in the runtime.  They still exist
21143         after this patch, but are hidden behind EvalExecutable and FunctionExecutable,
21144         and are also still reachable behind CodeBlock::m_ownerNode.
21145
21146         The next step will be to beat back FunctionBodyNode in the same fashion.
21147         Then remove the usage via CodeBlock, then only construct these nodes only on
21148         demand during bytecode generation.
21149
21150         * JavaScriptCore.xcodeproj/project.pbxproj:
21151         * bytecode/CodeBlock.h:
21152         (JSC::GlobalCodeBlock::GlobalCodeBlock):
21153         (JSC::GlobalCodeBlock::~GlobalCodeBlock):
21154         (JSC::ProgramCodeBlock::ProgramCodeBlock):
21155         (JSC::EvalCodeBlock::EvalCodeBlock):
21156         (JSC::FunctionCodeBlock::FunctionCodeBlock):
21157         (JSC::NativeCodeBlock::NativeCodeBlock):
21158         * bytecode/EvalCodeCache.h:
21159         (JSC::EvalCodeCache::get):
21160         * debugger/Debugger.cpp:
21161         (JSC::evaluateInGlobalCallFrame):
21162         * debugger/DebuggerCallFrame.cpp:
21163         (JSC::DebuggerCallFrame::evaluate):
21164         * interpreter/Interpreter.cpp:
21165         (JSC::Interpreter::callEval):
21166         (JSC::Interpreter::execute):
21167         * interpreter/Interpreter.h:
21168         * parser/Nodes.cpp:
21169         (JSC::FunctionBodyNode::createNativeThunk):
21170         (JSC::FunctionBodyNode::generateBytecode):
21171         (JSC::FunctionBodyNode::bytecodeForExceptionInfoReparse):
21172         * parser/Parser.h:
21173         (JSC::Parser::parse):
21174         (JSC::Parser::reparse):
21175         (JSC::Parser::parseFunctionFromGlobalCode):
21176         (JSC::::parse):
21177         * runtime/Completion.cpp:
21178         (JSC::checkSyntax):
21179         (JSC::evaluate):
21180         * runtime/Error.cpp:
21181         (JSC::throwError):
21182         * runtime/Error.h:
21183         * runtime/Executable.h: Added.
21184         (JSC::TemplateExecutable::TemplateExecutable):
21185         (JSC::TemplateExecutable::markAggregate):
21186         (JSC::TemplateExecutable::sourceURL):
21187         (JSC::TemplateExecutable::lineNo):
21188         (JSC::TemplateExecutable::bytecode):
21189         (JSC::TemplateExecutable::jitCode):
21190         (JSC::EvalExecutable::EvalExecutable):
21191         (JSC::ProgramExecutable::ProgramExecutable):
21192         * runtime/FunctionConstructor.cpp:
21193         (JSC::constructFunction):
21194         * runtime/FunctionConstructor.h:
21195         * runtime/JSGlobalData.cpp:
21196         (JSC::JSGlobalData::numericCompareFunction):
21197         * runtime/JSGlobalObject.cpp:
21198         (JSC::JSGlobalObject::~JSGlobalObject):
21199         (JSC::JSGlobalObject::markChildren):
21200         * runtime/JSGlobalObject.h:
21201         (JSC::JSGlobalObject::codeBlocks):
21202         * runtime/JSGlobalObjectFunctions.cpp:
21203         (JSC::globalFuncEval):
21204
21205 2009-08-14  Darin Adler  <darin@apple.com>
21206
21207         Reviewed by Sam Weinig.
21208
21209         Rename the confusing isObject(<class>) to inherits(<class>).
21210         It still works on non-objects, returning false.
21211
21212         * runtime/ArrayConstructor.cpp:
21213         (JSC::arrayConstructorIsArray): Removed unneeded isObject call
21214         and updated remaining isObject call to new name, inherits.
21215
21216         * runtime/JSCell.h: Renamed isObject(<class>) to inherits(<class>)
21217         but more importantly, made it non-virtual (it was already inline)
21218         so it is now as fast as JSObject::inherits was.
21219
21220         * runtime/JSObject.h: Removed inherits function since the one
21221         in the base class is fine as-is. Also made various JSCell functions
21222         that should not be called on JSObject uncallable by making them
21223         both private and not implemented.
21224         (JSC::JSCell::inherits): Updated name.
21225         (JSC::JSValue::inherits): Ditto.
21226
21227         * debugger/Debugger.cpp:
21228         (JSC::Debugger::recompileAllJSFunctions):
21229         * interpreter/Interpreter.cpp:
21230         (JSC::Interpreter::unwindCallFrame):
21231         * runtime/ArrayPrototype.cpp:
21232         (JSC::arrayProtoFuncToString):
21233         (JSC::arrayProtoFuncToLocaleString):
21234         (JSC::arrayProtoFuncConcat):
21235         * runtime/BooleanPrototype.cpp:
21236         (JSC::booleanProtoFuncToString):
21237         (JSC::booleanProtoFuncValueOf):
21238         * runtime/DateConstructor.cpp:
21239         (JSC::constructDate):
21240         * runtime/DatePrototype.cpp:
21241         (JSC::dateProtoFuncToString):
21242         (JSC::dateProtoFuncToUTCString):
21243         (JSC::dateProtoFuncToISOString):
21244         (JSC::dateProtoFuncToDateString):
21245         (JSC::dateProtoFuncToTimeString):
21246         (JSC::dateProtoFuncToLocaleString):
21247         (JSC::dateProtoFuncToLocaleDateString):
21248         (JSC::dateProtoFuncToLocaleTimeString):
21249         (JSC::dateProtoFuncGetTime):
21250         (JSC::dateProtoFuncGetFullYear):
21251         (JSC::dateProtoFuncGetUTCFullYear):
21252         (JSC::dateProtoFuncToGMTString):
21253         (JSC::dateProtoFuncGetMonth):
21254         (JSC::dateProtoFuncGetUTCMonth):
21255         (JSC::dateProtoFuncGetDate):
21256         (JSC::dateProtoFuncGetUTCDate):
21257         (JSC::dateProtoFuncGetDay):
21258         (JSC::dateProtoFuncGetUTCDay):
21259         (JSC::dateProtoFuncGetHours):
21260         (JSC::dateProtoFuncGetUTCHours):
21261         (JSC::dateProtoFuncGetMinutes):
21262         (JSC::dateProtoFuncGetUTCMinutes):
21263         (JSC::dateProtoFuncGetSeconds):
21264         (JSC::dateProtoFuncGetUTCSeconds):
21265         (JSC::dateProtoFuncGetMilliSeconds):
21266         (JSC::dateProtoFuncGetUTCMilliseconds):
21267         (JSC::dateProtoFuncGetTimezoneOffset):
21268         (JSC::dateProtoFuncSetTime):
21269         (JSC::setNewValueFromTimeArgs):
21270         (JSC::setNewValueFromDateArgs):
21271         (JSC::dateProtoFuncSetYear):
21272         (JSC::dateProtoFuncGetYear):
21273         * runtime/FunctionPrototype.cpp:
21274         (JSC::functionProtoFuncToString):
21275         * runtime/JSActivation.cpp:
21276         (JSC::JSActivation::argumentsGetter):
21277         * runtime/JSValue.h:
21278         * runtime/RegExpConstructor.cpp:
21279         (JSC::constructRegExp):
21280         * runtime/RegExpPrototype.cpp:
21281         (JSC::regExpProtoFuncTest):
21282         (JSC::regExpProtoFuncExec):
21283         (JSC::regExpProtoFuncCompile):
21284         (JSC::regExpProtoFuncToString):
21285         * runtime/ScopeChain.cpp:
21286         (JSC::ScopeChain::localDepth):
21287         * runtime/StringPrototype.cpp:
21288         (JSC::stringProtoFuncReplace):
21289         (JSC::stringProtoFuncToString):
21290         (JSC::stringProtoFuncMatch):
21291         (JSC::stringProtoFuncSearch):
21292         (JSC::stringProtoFuncSplit):
21293         Updated to new name, inherits, from old name, isObject.
21294
21295 2009-07-31  Harald Fernengel  <harald.fernengel@nokia.com>
21296
21297         Reviewed by Simon Hausmann.
21298
21299         Adding QNX as a platform. Currently only tested with Qt.
21300
21301         https://bugs.webkit.org/show_bug.cgi?id=27885
21302
21303         * JavaScriptCore/runtime/Collector.cpp: Added retrieving of stack base
21304           since QNX doesn't have the pthread _nt functions
21305         * JavaScriptCore/wtf/Platform.h: Added WTF_PLATFORM_QNX and corresponding
21306           defines
21307         * WebCore/bridge/npapi.h: Build fix for missing typedefs on QNX
21308
21309 2009-08-14  Gabor Loki  <loki@inf.u-szeged.hu>
21310
21311         Reviewed by Simon Hausmann.
21312
21313         Currently generic ARM and ARMv7 platforms work only with JSVALUE32
21314         https://bugs.webkit.org/show_bug.cgi?id=28300
21315
21316         * wtf/Platform.h:
21317
21318 2009-08-14  Gabor Loki  <loki@inf.u-szeged.hu>
21319
21320         Reviewed by Simon Hausmann.
21321
21322         Enable JIT on ARM for QT by default
21323         https://bugs.webkit.org/show_bug.cgi?id=28259
21324
21325         * wtf/Platform.h:
21326
21327 2009-08-14  Gabor Loki  <loki@inf.u-szeged.hu>
21328
21329         Reviewed by Simon Hausmann.
21330
21331         Enable YARR_JIT on ARM for QT by default
21332         https://bugs.webkit.org/show_bug.cgi?id=28259
21333
21334         * wtf/Platform.h:
21335
21336 2009-08-14  Oliver Hunt  <oliver@apple.com>
21337
21338         Reviewed by Gavin Barraclough.
21339
21340         [ES5] Arguments object should inherit from Array
21341         https://bugs.webkit.org/show_bug.cgi?id=28298
21342
21343         Make the Arguments object conform to the behaviour specified in ES5.
21344         The simple portion of this is to make Arguments use Array.prototype
21345         as its prototype rather than Object.prototype.
21346
21347         The spec then requires us to set instance.constructor to the pristine
21348         Object constructor, and instance.toString and instance.toLocaleString
21349         to the pristine versions from Object.prototype.  To do this we now 
21350         make the ObjectPrototype constructor return its toString and
21351         toLocaleString functions (similar to the call and apply functions
21352         from FunctionPrototype).
21353
21354         Oddly enough this reports itself as a slight win, but given the code
21355         isn't hit in the tests that claim to have improved I put this down to
21356         code motion.
21357
21358         * runtime/Arguments.h:
21359         (JSC::Arguments::Arguments):
21360         (JSC::Arguments::initializeStandardProperties):
21361         * runtime/JSGlobalObject.cpp:
21362         (JSC::JSGlobalObject::reset):
21363         (JSC::JSGlobalObject::markChildren):
21364         * runtime/JSGlobalObject.h:
21365         (JSC::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData):
21366         (JSC::JSGlobalObject::objectConstructor):
21367         (JSC::JSGlobalObject::objectToStringFunction):
21368         (JSC::JSGlobalObject::objectToLocaleStringFunction):
21369         * runtime/ObjectPrototype.cpp:
21370         (JSC::ObjectPrototype::ObjectPrototype):
21371         * runtime/ObjectPrototype.h:
21372         * tests/mozilla/ecma_3/Function/arguments-001.js:
21373           Update test to new es5 behaviour
21374
21375 2009-08-14  Oliver Hunt  <oliver@apple.com>
21376
21377         Remove MarkStack::drain from the JSC exports file
21378
21379         MarkStack::drain is now marked inline, the including it in the exports file
21380         produces an ld warning
21381
21382         * JavaScriptCore.exp:
21383
21384 2009-08-13  Sam Weinig  <sam@webkit.org>
21385
21386         Reviewed by Oliver Hunt.
21387
21388         Remove accidentally left in debugging statement.
21389
21390         * runtime/JSArray.h:
21391         (JSC::MarkStack::drain):
21392
21393 2009-08-13  Oliver Hunt  <oliver@apple.com>
21394
21395         Reviewed by Maciej Stachowiak.
21396
21397         [ES5] Implement Array.isArray
21398         https://bugs.webkit.org/show_bug.cgi?id=28296
21399
21400         Add support for Array.isArray to the Array constructor
21401
21402         * runtime/ArrayConstructor.cpp:
21403         (JSC::ArrayConstructor::ArrayConstructor):
21404         (JSC::arrayConstructorIsArray):
21405         * runtime/ArrayConstructor.h:
21406         * runtime/CommonIdentifiers.h:
21407         * runtime/JSArray.h:
21408         (JSC::MarkStack::drain):
21409         * runtime/JSGlobalObject.cpp:
21410         (JSC::JSGlobalObject::reset):
21411
21412 2009-08-13  Oliver Hunt  <oliver@apple.com>
21413
21414         Reviewed by NOBODY (Buildfix).
21415
21416         Attempt to fix windows build
21417
21418         * runtime/Collector.cpp:
21419
21420 2009-08-13  Oliver Hunt  <oliver@apple.com>
21421
21422         Reviewed by Maciej Stachowiak.
21423
21424         Devirtualise marking
21425         https://bugs.webkit.org/show_bug.cgi?id=28294
21426
21427         Add a bit to TypeInfo to indicate that an object uses the standard
21428         JSObject::markChildren method.  This allows us to devirtualise marking
21429         of most objects (though a branch is still needed).  We also add a branch
21430         to identify arrays thus devirtualising marking in that case as well.
21431
21432         In order to make the best use of this devirtualisation I've also reworked
21433         the MarkStack::drain() logic to make the iteration more efficient.
21434
21435         * API/JSCallbackConstructor.h:
21436         (JSC::JSCallbackConstructor::createStructure):
21437         * API/JSCallbackFunction.h:
21438         (JSC::JSCallbackFunction::createStructure):
21439         * JavaScriptCore.exp:
21440         * runtime/BooleanObject.h:
21441         (JSC::BooleanObject::createStructure):
21442         * runtime/FunctionPrototype.h:
21443         (JSC::FunctionPrototype::createStructure):
21444         * runtime/InternalFunction.h:
21445         (JSC::InternalFunction::createStructure):
21446         * runtime/JSAPIValueWrapper.h:
21447         (JSC::JSAPIValueWrapper::JSAPIValueWrapper):
21448         * runtime/JSArray.cpp:
21449         (JSC::JSArray::markChildren):
21450         * runtime/JSArray.h:
21451         (JSC::JSArray::markChildrenDirect):
21452         (JSC::MarkStack::drain):
21453         * runtime/JSByteArray.cpp:
21454         (JSC::JSByteArray::createStructure):
21455         * runtime/JSCell.h:
21456         (JSC::MarkStack::append):
21457         * runtime/JSGlobalData.cpp:
21458         (JSC::JSGlobalData::JSGlobalData):
21459         * runtime/JSNumberCell.h:
21460         (JSC::JSNumberCell::createStructure):
21461         * runtime/JSONObject.h:
21462         (JSC::JSONObject::createStructure):
21463         * runtime/JSObject.cpp:
21464         (JSC::JSObject::markChildren):
21465         * runtime/JSObject.h:
21466         (JSC::JSObject::markChildrenDirect):
21467         (JSC::JSObject::createStructure):
21468         * runtime/JSString.h:
21469         (JSC::JSString::createStructure):
21470         * runtime/JSType.h:
21471         (JSC::):
21472         * runtime/MarkStack.h:
21473         (JSC::MarkStack::MarkStack):
21474         (JSC::MarkStack::MarkSet::MarkSet):
21475         (JSC::MarkStack::MarkStackArray::last):
21476         * runtime/MathObject.h:
21477         (JSC::MathObject::createStructure):
21478         * runtime/NumberConstructor.h:
21479         (JSC::NumberConstructor::createStructure):
21480         * runtime/NumberObject.h:
21481         (JSC::NumberObject::createStructure):
21482         * runtime/RegExpConstructor.h:
21483         (JSC::RegExpConstructor::createStructure):
21484         * runtime/RegExpObject.h:
21485         (JSC::RegExpObject::createStructure):
21486         * runtime/StringObjectThatMasqueradesAsUndefined.h:
21487         (JSC::StringObjectThatMasqueradesAsUndefined::createStructure):
21488         * runtime/TypeInfo.h:
21489         (JSC::TypeInfo::hasDefaultMark):
21490
21491 2009-08-13  Darin Adler  <darin@apple.com>
21492
21493         Reviewed by Mark Rowe.
21494
21495         Some small bits of housekeeping.
21496
21497         * JavaScriptCore.xcodeproj/project.pbxproj: Make Parser.h
21498         project instead of private. Remove JSONObject.lut.h.
21499
21500         * assembler/ARMAssembler.h: Remove unneeded WTF prefix.
21501         * assembler/AssemblerBufferWithConstantPool.h: Ditto.
21502         * bytecompiler/BytecodeGenerator.h: Ditto.
21503
21504         * wtf/SegmentedVector.h: Add a "using" statement as we do
21505         with the other WTF headers.
21506
21507 2009-08-13  Darin Adler  <darin@apple.com>
21508
21509         Fix Tiger build.
21510
21511         * parser/Grammar.y: Use a template function so we can compile
21512         setStatementLocation even if it comes before YYLTYPE is defined.
21513
21514 2009-08-13  Darin Adler  <darin@apple.com>
21515
21516         Reviewed by George Staikos.
21517
21518         Too much use of void* in Grammar.y
21519         https://bugs.webkit.org/show_bug.cgi?id=28287
21520
21521         * parser/Grammar.y: Changed all the helper functions to
21522         take a JSGlobalData* instead of a void*. A couple formatting
21523         tweaks that I missed when breaking this into pieces.
21524
21525 2009-08-13  Darin Adler  <darin@apple.com>
21526
21527         Reviewed by George Staikos.
21528
21529         Another part of https://bugs.webkit.org/show_bug.cgi?id=28287
21530
21531         * parser/Grammar.y: Reduced and sorted includes. Tweaked comment
21532         format. Marked a few more functions inline.
21533
21534 2009-08-13  Darin Adler  <darin@apple.com>
21535
21536         Reviewed by George Staikos.
21537
21538         Another part of https://bugs.webkit.org/show_bug.cgi?id=28287
21539
21540         * parser/Grammar.y: Pass the number to the PropertyNode instead of
21541         first turning it into an Identifier.
21542
21543         * parser/NodeConstructors.h:
21544         (JSC::PropertyNode::PropertyNode): Add an overload that takes a double
21545         so the code to convert to a string can be here instead of Grammar.y.
21546         * parser/Nodes.h: Ditto.
21547
21548 2009-08-13  Darin Adler  <darin@apple.com>
21549
21550         Reviewed by George Staikos.
21551
21552         Another part of https://bugs.webkit.org/show_bug.cgi?id=28287
21553
21554         * parser/Grammar.y: Eliminate the DBG macro.
21555
21556 2009-08-13  Darin Adler  <darin@apple.com>
21557
21558         Reviewed by George Staikos.
21559
21560         Another part of https://bugs.webkit.org/show_bug.cgi?id=28287
21561
21562         * parser/Grammar.y: Eliminate the SET_EXCEPTION_LOCATION macro.
21563
21564 2009-08-13  Darin Adler  <darin@apple.com>
21565
21566         Reviewed by George Staikos.
21567
21568         George asked me to break the patch from
21569         https://bugs.webkit.org/show_bug.cgi?id=28287
21570         into smaller pieces and land it in stages.
21571
21572         * parser/Grammar.y: Eliminate the LEXER macro.
21573
21574 2009-08-13  Mark Rowe  <mrowe@apple.com>
21575
21576         Try some more to fix the Windows build.
21577
21578         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Export a new symbol.
21579         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: Ditto.
21580
21581 2009-08-13  Mark Rowe  <mrowe@apple.com>
21582
21583         Try and fix the Windows build.
21584
21585         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Export a new symbol.
21586         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: Ditto.
21587
21588 2009-08-13  Darin Adler  <darin@apple.com>
21589
21590         Reviewed by David Levin.
21591
21592         JavaScriptCore tweaks to get ready for the parser arena
21593         https://bugs.webkit.org/show_bug.cgi?id=28243
21594
21595         Eliminate dependencies on Nodes.h outside JavaScriptCore,
21596         and cut down on them inside JavaScriptCore.
21597
21598         Change regular expression parsing to use identifiers as
21599         with other strings we parse.
21600
21601         Fix a couple things that are needed to use const Identifier
21602         more, which will be part of the parser arena work.
21603
21604         * JavaScriptCore.exp: Resorted and updated.
21605
21606         * JavaScriptCore.xcodeproj/project.pbxproj: Changed
21607         CollectorHeapIterator.h to be project-internal.
21608
21609         * bytecompiler/BytecodeGenerator.cpp:
21610         (JSC::BytecodeGenerator::emitPushNewScope): Added const.
21611         * bytecompiler/BytecodeGenerator.h: Ditto.
21612
21613         * debugger/Debugger.cpp:
21614         (JSC::Debugger::recompileAllJSFunctions): Moved this function
21615         here from WebCore. Here is better since it uses so many internals.
21616         Removed unimportant optimization for the no listener case.
21617         * debugger/Debugger.h: Ditto. Also removed unneeded include
21618         and tweaked formatting and comments.
21619
21620         * debugger/DebuggerCallFrame.cpp:
21621         (JSC::DebuggerCallFrame::functionName): Call asFunction instead
21622         of doing the unchecked static_cast.
21623         (JSC::DebuggerCallFrame::calculatedFunctionName): Ditto.
21624
21625         * jit/JITStubs.cpp:
21626         (JSC::op_call_JSFunction): Call isHostFunction on the body rather
21627         than on the JSFunction.
21628         (JSC::vm_lazyLinkCall): Ditto.
21629         (JSC::op_construct_JSConstruct): Ditto.
21630
21631         * parser/Grammar.y: Changed callers to use new scanRegExp with
21632         out arguments instead of relying on state in the Lexer. And
21633         callers that just want to skip a regular expression to use
21634         skipRegExp.
21635
21636         * parser/Lexer.cpp:
21637         (JSC::Lexer::scanRegExp): Changed to use out arguments, and to
21638         add a prefix argument so we can add in the "=" character as needed.
21639         Also rewrote to streamline the logic a bit inspired by suggestions
21640         by David Levin.
21641         (JSC::Lexer::skipRegExp): Added. Version of the function above that
21642         does not actually put the regular expression into a string.
21643         (JSC::Lexer::clear): Removed code to clear m_pattern and m_flags.
21644         * parser/Lexer.h: Changed scanRegExp to have out arguments. Added
21645         skipRegExp. Eliminated pattern, flags, m_pattern, and m_flags.
21646
21647         * parser/NodeConstructors.h:
21648         (JSC::RegExpNode::RegExpNode): Changed to take const Identifier&.
21649         * parser/Nodes.cpp:
21650         (JSC::RegExpNode::emitBytecode): Changed since m_pattern and
21651         m_flags are now Identifier instead of UString.
21652         (JSC::FunctionBodyNode::make): Moved this function here instead
21653         of putting it in the JSFunction.h header.
21654         * parser/Nodes.h: Changed RegExpNode to use Identifier.
21655
21656         * profiler/Profiler.cpp:
21657         (JSC::Profiler::createCallIdentifier): Changed to use isHostFunction
21658         on the body instead of on the JSFunction object.
21659         * runtime/FunctionPrototype.cpp:
21660         (JSC::functionProtoFuncToString): Ditto.
21661
21662         * runtime/JSFunction.cpp:
21663         (JSC::JSFunction::isHostFunction): Moved here from header.
21664         (JSC::JSFunction::isHostFunctionNonInline): Added.
21665         (JSC::JSFunction::JSFunction): Removed unneeded initialization of
21666         m_body to 0.
21667         (JSC::JSFunction::setBody): Moved here from header.
21668
21669         * runtime/JSFunction.h: Removed unneeded includes. Moved private
21670         constructor down to the private section. Made virtual functions
21671         private. Removed unneeded overload of setBody and moved the body
21672         of the function into the .cpp file. Changed assertions to use
21673         the non-inline version of isHostFunction.
21674
21675         * runtime/PropertySlot.cpp:
21676         (JSC::PropertySlot::functionGetter): Use asFunction instead
21677         of doing the unchecked static_cast.
21678
21679         * wtf/SegmentedVector.h:
21680         (WTF::SegmentedVector::isEmpty): Added.
21681
21682 2009-08-13  Mark Rowe  <mrowe@apple.com>
21683
21684         Rubber-stamped by Darin Adler.
21685
21686         Use the version of operator new that takes a JSGlobalData when allocating FuncDeclNode and FuncExprNode
21687         from within the grammar to prevent these nodes from being leaked.
21688
21689         * parser/Grammar.y:
21690
21691 2009-08-13  Simon Hausmann  <simon.hausmann@nokia.com>
21692
21693         Reviewed by Ariya Hidayat.
21694
21695         Remove the special-case for Qt wrt JSVALUE_32 introduced in
21696         r46709. It must've been a dependency issue on the bot, as
21697         after a manual build all the tests pass on amd64 and ia32.
21698
21699         * wtf/Platform.h:
21700
21701 2009-08-12  Gabor Loki  <loki@inf.u-szeged.hu>
21702
21703         Reviewed by Gavin Barraclough.
21704
21705         Add optimize call and property access support for ARM JIT.
21706         https://bugs.webkit.org/show_bug.cgi?id=24986
21707
21708         For tightly coupled sequences the BEGIN_UNINTERRUPTED_SEQUENCE and
21709         END_UNINTERRUPTED_SEQUENCE macros have been introduced which ensure
21710         space for instructions and constants of the named sequence. This
21711         method is vital for those architecture which are using constant pool.
21712
21713         The 'latePatch' method - which was linked to JmpSrc - is replaced with
21714         a port specific solution (each calls are marked to place their address
21715         on the constant pool).
21716
21717         * assembler/ARMAssembler.cpp:
21718         (JSC::ARMAssembler::linkBranch):
21719         (JSC::ARMAssembler::executableCopy): Add extra align for constant pool.
21720         * assembler/ARMAssembler.h:
21721         (JSC::ARMAssembler::JmpSrc::JmpSrc):
21722         (JSC::ARMAssembler::sizeOfConstantPool):
21723         (JSC::ARMAssembler::jmp):
21724         (JSC::ARMAssembler::linkCall):
21725         * assembler/ARMv7Assembler.h:
21726         * assembler/AbstractMacroAssembler.h:
21727         * assembler/AssemblerBufferWithConstantPool.h:
21728         (JSC::AssemblerBufferWithConstantPool::flushIfNoSpaceFor): Fix the
21729         computation of the remaining space.
21730         * assembler/MacroAssemblerARM.h:
21731         (JSC::MacroAssemblerARM::branch32):
21732         (JSC::MacroAssemblerARM::nearCall):
21733         (JSC::MacroAssemblerARM::call):
21734         (JSC::MacroAssemblerARM::branchPtrWithPatch):
21735         (JSC::MacroAssemblerARM::ensureSpace):
21736         (JSC::MacroAssemblerARM::sizeOfConstantPool):
21737         (JSC::MacroAssemblerARM::prepareCall):
21738         * assembler/X86Assembler.h:
21739         * jit/JIT.h:
21740         * jit/JITCall.cpp:
21741         (JSC::JIT::compileOpCall):
21742         * jit/JITInlineMethods.h:
21743         (JSC::JIT::beginUninterruptedSequence):
21744         (JSC::JIT::endUninterruptedSequence):
21745         * jit/JITPropertyAccess.cpp:
21746         (JSC::JIT::emit_op_method_check):
21747         (JSC::JIT::compileGetByIdHotPath):
21748         (JSC::JIT::compileGetByIdSlowCase):
21749         (JSC::JIT::emit_op_put_by_id):
21750
21751 2009-08-12  Gavin Barraclough  <barraclough@apple.com>
21752
21753         Rubber Stamped by Dave Kilzer.
21754
21755         Disable WTF_USE_JSVALUE32_64 on iPhone for now (support not yet added for ARMv7).
21756
21757         * wtf/Platform.h:
21758
21759 2009-08-12  Gavin Barraclough  <barraclough@apple.com>
21760
21761         Reviewed by Maciej Stachoviak.
21762
21763         Ooops - moved code that had been accidentally added to op_new_func instead of
21764         op_new_func_exp, to where it shoulds be.
21765
21766         * interpreter/Interpreter.cpp:
21767         (JSC::Interpreter::privateExecute):
21768         * wtf/Platform.h:
21769
21770 2009-08-12  Ada Chan  <adachan@apple.com>
21771
21772         Added workaround for the limitation that VirtualFree with MEM_RELEASE
21773         can only accept the base address returned by VirtualAlloc when the region
21774         was reserved and it can only free the entire region, and not a part of it.
21775
21776         Reviewed by Oliver Hunt.
21777
21778         * runtime/MarkStack.h:
21779         (JSC::MarkStack::MarkStackArray::shrinkAllocation):
21780         * runtime/MarkStackWin.cpp:
21781         (JSC::MarkStack::releaseStack):
21782
21783 2009-08-12  Balazs Kelemen  <kelemen.balazs.3@stud.u-szeged.hu>
21784
21785         Reviewed by Ariya Hidayat.
21786
21787         Build fix: use std::numeric_limits<long long>::min() instead of LLONG_MIN
21788         since LLONG_MIN is not defined in standard c++.
21789
21790         * runtime/UString.cpp:
21791         (JSC::UString::from):
21792
21793 2009-08-12  Benjamin Otte  <otte@gnome.org>
21794
21795         Reviewed by Jan Alonzo.
21796
21797         Buildfix for Gtk platforms debug builds.
21798
21799         * GNUmakefile.am: Choose MarkStackPosix.cpp or MarkStackWin.cpp
21800         depending on platform.
21801
21802 2009-08-12  Simon Hausmann  <simon.hausmann@nokia.com>
21803
21804         Prospective build fix for Mac and 32-bit Windows.
21805
21806         * runtime/UString.cpp: Include wtf/StringExtras.h for snprintf.
21807         (JSC::UString::from): Use %lld instead of %I64d for snprintf
21808         on non-windows platforms.
21809
21810 2009-08-12  Prasanth Ullattil  <prasanth.ullattil@nokia.com>
21811
21812         Reviewed by Simon Hausmann.
21813
21814         Fix compile error on 64Bit Windows, when UString::from
21815         is called with an intptr_t.
21816
21817         Added new UString::From overload with long long parameter.
21818
21819         Thanks to Holger for the long long idea.
21820
21821         * runtime/UString.cpp:
21822         (JSC::UString::from):
21823         * runtime/UString.h:
21824
21825 2009-08-11  Oliver Hunt  <oliver@apple.com>
21826
21827         Reviewed by Mark Rowe.
21828
21829         Minor style fixes.
21830
21831         * runtime/UString.h:
21832         (JSC::UString::Rep::createEmptyBuffer):
21833         * wtf/FastMalloc.h:
21834         (WTF::TryMallocReturnValue::getValue):
21835
21836 2009-08-11  Oliver Hunt  <oliver@apple.com>
21837
21838         Reviewed by Gavin Barraclough.
21839
21840         Make it harder to misuse try* allocation routines
21841         https://bugs.webkit.org/show_bug.cgi?id=27469
21842
21843         Jump through a few hoops to make it much harder to accidentally
21844         miss null-checking of values returned by the try-* allocation
21845         routines.
21846
21847         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
21848         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
21849         * JavaScriptCore.xcodeproj/project.pbxproj:
21850         * runtime/JSArray.cpp:
21851         (JSC::JSArray::putSlowCase):
21852         (JSC::JSArray::increaseVectorLength):
21853         * runtime/StringPrototype.cpp:
21854         (JSC::stringProtoFuncFontsize):
21855         (JSC::stringProtoFuncLink):
21856         * runtime/UString.cpp:
21857         (JSC::allocChars):
21858         (JSC::reallocChars):
21859         (JSC::expandCapacity):
21860         (JSC::UString::Rep::reserveCapacity):
21861         (JSC::UString::expandPreCapacity):
21862         (JSC::createRep):
21863         (JSC::concatenate):
21864         (JSC::UString::spliceSubstringsWithSeparators):
21865         (JSC::UString::replaceRange):
21866         (JSC::UString::append):
21867         (JSC::UString::operator=):
21868         * runtime/UString.h:
21869         (JSC::UString::Rep::createEmptyBuffer):
21870         * wtf/FastMalloc.cpp:
21871         (WTF::tryFastZeroedMalloc):
21872         (WTF::tryFastMalloc):
21873         (WTF::tryFastCalloc):
21874         (WTF::tryFastRealloc):
21875         (WTF::TCMallocStats::tryFastMalloc):
21876         (WTF::TCMallocStats::tryFastCalloc):
21877         (WTF::TCMallocStats::tryFastRealloc):
21878         * wtf/FastMalloc.h:
21879         (WTF::TryMallocReturnValue::TryMallocReturnValue):
21880         (WTF::TryMallocReturnValue::~TryMallocReturnValue):
21881         (WTF::TryMallocReturnValue::operator PossiblyNull<T>):
21882         (WTF::TryMallocReturnValue::getValue):
21883         * wtf/Platform.h:
21884         * wtf/PossiblyNull.h: Added.
21885         (WTF::PossiblyNull::PossiblyNull):
21886         (WTF::PossiblyNull::~PossiblyNull):
21887         (WTF::::getValue):
21888
21889 2009-08-11  Gavin Barraclough  <barraclough@apple.com>
21890
21891         Reviewed by NOBODY (build fix part deux).
21892
21893         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
21894         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
21895
21896 2009-08-11  Gavin Barraclough  <barraclough@apple.com>
21897
21898         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
21899         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
21900
21901 2009-08-11  Gavin Barraclough  <barraclough@apple.com>
21902
21903         Reviewed by Oliver Hunt.
21904
21905         Restrict use of FuncDeclNode & FuncExprNode to the parser.
21906         https://bugs.webkit.org/show_bug.cgi?id=28209
21907
21908         These objects were also being referenced from the CodeBlock.  By changing this
21909         to just retain pointers to FunctionBodyNodes these classes can be restricted to
21910         use during parsing.
21911
21912         No performance impact (or sub-percent progression).
21913
21914         * JavaScriptCore.exp:
21915             Update symbols.
21916
21917         * bytecode/CodeBlock.cpp:
21918         (JSC::CodeBlock::mark):
21919         (JSC::CodeBlock::reparseForExceptionInfoIfNecessary):
21920         (JSC::CodeBlock::shrinkToFit):
21921         * bytecode/CodeBlock.h:
21922         (JSC::CodeBlock::addFunction):
21923         (JSC::CodeBlock::function):
21924             Unify m_functions & m_functionExpressions into a single Vector<RefPtr<FuncExprNode> >.
21925
21926         * bytecompiler/BytecodeGenerator.cpp:
21927         (JSC::BytecodeGenerator::BytecodeGenerator):
21928         (JSC::BytecodeGenerator::addConstant):
21929         (JSC::BytecodeGenerator::emitNewFunction):
21930         (JSC::BytecodeGenerator::emitNewFunctionExpression):
21931         * bytecompiler/BytecodeGenerator.h:
21932             FunctionStacks now contain FunctionBodyNodes not FuncDeclNodes.
21933
21934         * interpreter/Interpreter.cpp:
21935         (JSC::Interpreter::execute):
21936         (JSC::Interpreter::privateExecute):
21937             Update to reflect chnages in CodeBlock.
21938
21939         * jit/JITOpcodes.cpp:
21940         (JSC::JIT::emit_op_new_func_exp):
21941         * jit/JITStubs.cpp:
21942         (JSC::DEFINE_STUB_FUNCTION):
21943         * jit/JITStubs.h:
21944         (JSC::):
21945             Update to reflect chnages in CodeBlock.
21946
21947         * parser/Grammar.y:
21948             FunctionStacks now contain FunctionBodyNodes not FuncDeclNodes.
21949
21950         * parser/NodeConstructors.h:
21951         (JSC::FuncExprNode::FuncExprNode):
21952         (JSC::FuncDeclNode::FuncDeclNode):
21953         * parser/Nodes.cpp:
21954         (JSC::ScopeNodeData::mark):
21955         (JSC::FunctionBodyNode::finishParsing):
21956         * parser/Nodes.h:
21957         (JSC::FunctionBodyNode::ident):
21958             Move m_ident & make methods from FuncDeclNode & FuncExprNode to FunctionBodyNode.
21959
21960         * runtime/JSFunction.h:
21961         (JSC::FunctionBodyNode::make):
21962             Make this method inline (was FuncDeclNode::makeFunction).
21963
21964 2009-08-11  Oliver Hunt  <oliver@apple.com>
21965
21966         Reviewed by Gavin Barraclough.
21967
21968         Native JSON.stringify does not omit functions
21969         https://bugs.webkit.org/show_bug.cgi?id=28117
21970
21971         Objects that are callable should be treated as undefined when
21972         serialising to JSON.
21973
21974         * runtime/JSONObject.cpp:
21975         (JSC::Stringifier::appendStringifiedValue):
21976
21977 2009-08-11  Oliver Hunt  <oliver@apple.com>
21978
21979         Reviewed by Geoff Garen.
21980
21981         REGRESSION: Hang/crash in BytecodeGenerator::constRegisterFor loading simple page
21982         https://bugs.webkit.org/show_bug.cgi?id=28169
21983
21984         Handle the case where someone has attempted to shadow a property
21985         on the global object with a constant.
21986
21987         * bytecompiler/BytecodeGenerator.cpp:
21988         (JSC::BytecodeGenerator::constRegisterFor):
21989         * parser/Nodes.cpp:
21990         (JSC::ConstDeclNode::emitCodeSingle):
21991
21992 2009-08-11  John Gregg  <johnnyg@google.com>
21993
21994         Reviewed by Maciej Stachowiak.
21995
21996         Desktop Notifications API
21997         https://bugs.webkit.org/show_bug.cgi?id=25463
21998
21999         Adds ENABLE_NOTIFICATION flag.
22000
22001         * Configurations/FeatureDefines.xcconfig:
22002         * wtf/Platform.h:
22003
22004 2009-08-11  Maxime Simon  <simon.maxime@gmail.com>
22005
22006         Reviewed by Eric Seidel.
22007
22008         Modifications on JavaScriptCore to allow Haiku port.
22009         https://bugs.webkit.org/show_bug.cgi?id=28121
22010
22011         * runtime/Collector.cpp: Haiku doesn't have sys/mman.h, using OS.h instead.
22012         (JSC::currentThreadStackBase): Haiku uses its own threading system.
22013         * wtf/Platform.h: Defining all Haiku platform values.
22014         * wtf/haiku/MainThreadHaiku.cpp: Adding a missing header (NotImplemented.h).
22015
22016 2009-08-11  Jessie Berlin  <jberlin@apple.com>
22017
22018         Reviewed by Adam Roben.
22019
22020         Fix windows build.
22021
22022         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
22023
22024 2009-08-11  Csaba Osztrogonac  <oszi@inf.u-szeged.hu>
22025
22026         Reviewed by Tor Arne Vestbø.
22027
22028         Buildfix for Qt-win platforms.
22029
22030         * JavaScriptCore.pri: Choose MarkStackPosix.cpp or MarkStackWin.cpp depend on platform.
22031
22032 2009-08-10  Oliver Hunt  <oliver@apple.com>
22033
22034         Reviewed by NOBODY (And another build fix).
22035
22036         Add new exports for MSVC
22037
22038         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
22039         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
22040         * JavaScriptCore.xcodeproj/project.pbxproj:
22041
22042 2009-08-10  Oliver Hunt  <oliver@apple.com>
22043
22044         Reviewed by NOBODY (yet another build fix).
22045
22046         Remove obsolete entries from MSVC exports file
22047
22048         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
22049         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
22050
22051 2009-08-10  Oliver Hunt  <oliver@apple.com>
22052
22053         Add includes needed for non-allinonefile builds
22054
22055         * runtime/GetterSetter.h:
22056         * runtime/ScopeChain.h:
22057
22058 2009-08-10  Oliver Hunt  <oliver@apple.com>
22059
22060         Fix export file for last build fix
22061
22062         * JavaScriptCore.exp:
22063
22064 2009-08-10  Oliver Hunt  <oliver@apple.com>
22065
22066         Hoist page size initialization into platform specific code.
22067
22068         * jit/ExecutableAllocatorPosix.cpp:
22069         * jit/ExecutableAllocatorWin.cpp:
22070         * runtime/MarkStack.h:
22071         (JSC::MarkStack::pageSize):
22072         * runtime/MarkStackPosix.cpp:
22073         (JSC::MarkStack::initializePagesize):
22074         * runtime/MarkStackWin.cpp:
22075         (JSC::MarkStack::initializePagesize):
22076
22077 2009-08-07  Oliver Hunt  <oliver@apple.com>
22078
22079         Reviewed by Gavin Barraclough.
22080
22081         Stack overflow crash in JavaScript garbage collector mark pass
22082         https://bugs.webkit.org/show_bug.cgi?id=12216
22083
22084         Make the GC mark phase iterative by using an explicit mark stack.
22085         To do this marking any single object is performed in multiple stages
22086           * The object is appended to the MarkStack, this sets the marked
22087             bit for the object using the new markDirect() function, and then
22088             returns
22089           * When the MarkStack is drain()ed the object is popped off the stack
22090             and markChildren(MarkStack&) is called on the object to collect 
22091             all of its children.  drain() then repeats until the stack is empty.
22092
22093         Additionally I renamed a number of methods from 'mark' to 'markAggregate'
22094         in order to make it more clear that marking of those object was not
22095         going to result in an actual recursive mark.
22096
22097         * GNUmakefile.am
22098         * JavaScriptCore.exp:
22099         * JavaScriptCore.gypi:
22100         * JavaScriptCore.pri:
22101         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
22102         * JavaScriptCore.xcodeproj/project.pbxproj:
22103         * bytecode/CodeBlock.cpp:
22104         (JSC::CodeBlock::markAggregate):
22105         * bytecode/CodeBlock.h:
22106         * bytecode/EvalCodeCache.h:
22107         (JSC::EvalCodeCache::markAggregate):
22108         * debugger/DebuggerActivation.cpp:
22109         (JSC::DebuggerActivation::markChildren):
22110         * debugger/DebuggerActivation.h:
22111         * interpreter/Register.h:
22112         * interpreter/RegisterFile.h:
22113         (JSC::RegisterFile::markGlobals):
22114         (JSC::RegisterFile::markCallFrames):
22115         * parser/Nodes.cpp:
22116         (JSC::ScopeNodeData::markAggregate):
22117         (JSC::EvalNode::markAggregate):
22118         (JSC::FunctionBodyNode::markAggregate):
22119         * parser/Nodes.h:
22120         (JSC::ScopeNode::markAggregate):
22121         * runtime/ArgList.cpp:
22122         (JSC::MarkedArgumentBuffer::markLists):
22123         * runtime/ArgList.h:
22124         * runtime/Arguments.cpp:
22125         (JSC::Arguments::markChildren):
22126         * runtime/Arguments.h:
22127         * runtime/Collector.cpp:
22128         (JSC::Heap::markConservatively):
22129         (JSC::Heap::markCurrentThreadConservativelyInternal):
22130         (JSC::Heap::markCurrentThreadConservatively):
22131         (JSC::Heap::markOtherThreadConservatively):
22132         (JSC::Heap::markStackObjectsConservatively):
22133         (JSC::Heap::markProtectedObjects):
22134         (JSC::Heap::collect):
22135         * runtime/Collector.h:
22136         * runtime/GetterSetter.cpp:
22137         (JSC::GetterSetter::markChildren):
22138         * runtime/GetterSetter.h:
22139         (JSC::GetterSetter::GetterSetter):
22140         (JSC::GetterSetter::createStructure):
22141         * runtime/GlobalEvalFunction.cpp:
22142         (JSC::GlobalEvalFunction::markChildren):
22143         * runtime/GlobalEvalFunction.h:
22144         * runtime/JSActivation.cpp:
22145         (JSC::JSActivation::markChildren):
22146         * runtime/JSActivation.h:
22147         * runtime/JSArray.cpp:
22148         (JSC::JSArray::markChildren):
22149         * runtime/JSArray.h:
22150         * runtime/JSCell.h:
22151         (JSC::JSCell::markCellDirect):
22152         (JSC::JSCell::markChildren):
22153         (JSC::JSValue::markDirect):
22154         (JSC::JSValue::markChildren):
22155         (JSC::JSValue::hasChildren):
22156         (JSC::MarkStack::append):
22157         (JSC::MarkStack::drain):
22158         * runtime/JSFunction.cpp:
22159         (JSC::JSFunction::markChildren):
22160         * runtime/JSFunction.h:
22161         * runtime/JSGlobalData.cpp:
22162         (JSC::JSGlobalData::JSGlobalData):
22163         * runtime/JSGlobalData.h:
22164         * runtime/JSGlobalObject.cpp:
22165         (JSC::markIfNeeded):
22166         (JSC::JSGlobalObject::markChildren):
22167         * runtime/JSGlobalObject.h:
22168         * runtime/JSNotAnObject.cpp:
22169         (JSC::JSNotAnObject::markChildren):
22170         * runtime/JSNotAnObject.h:
22171         * runtime/JSONObject.cpp:
22172         (JSC::Stringifier::markAggregate):
22173         (JSC::JSONObject::markStringifiers):
22174         * runtime/JSONObject.h:
22175         * runtime/JSObject.cpp:
22176         (JSC::JSObject::markChildren):
22177         (JSC::JSObject::defineGetter):
22178         (JSC::JSObject::defineSetter):
22179         * runtime/JSObject.h:
22180         * runtime/JSPropertyNameIterator.cpp:
22181         (JSC::JSPropertyNameIterator::markChildren):
22182         * runtime/JSPropertyNameIterator.h:
22183         (JSC::JSPropertyNameIterator::createStructure):
22184         (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
22185         (JSC::JSPropertyNameIterator::create):
22186         * runtime/JSStaticScopeObject.cpp:
22187         (JSC::JSStaticScopeObject::markChildren):
22188         * runtime/JSStaticScopeObject.h:
22189         * runtime/JSType.h:
22190         (JSC::):
22191         * runtime/JSValue.h:
22192         * runtime/JSWrapperObject.cpp:
22193         (JSC::JSWrapperObject::markChildren):
22194         * runtime/JSWrapperObject.h:
22195         * runtime/MarkStack.cpp: Added.
22196         (JSC::MarkStack::compact):
22197         * runtime/MarkStack.h: Added.
22198         (JSC::):
22199         (JSC::MarkStack::MarkStack):
22200         (JSC::MarkStack::append):
22201         (JSC::MarkStack::appendValues):
22202         (JSC::MarkStack::~MarkStack):
22203         (JSC::MarkStack::MarkSet::MarkSet):
22204         (JSC::MarkStack::pageSize):
22205         
22206         MarkStackArray is a non-shrinking, mmap-based vector type
22207         used for storing objects to be marked.
22208         (JSC::MarkStack::MarkStackArray::MarkStackArray):
22209         (JSC::MarkStack::MarkStackArray::~MarkStackArray):
22210         (JSC::MarkStack::MarkStackArray::expand):
22211         (JSC::MarkStack::MarkStackArray::append):
22212         (JSC::MarkStack::MarkStackArray::removeLast):
22213         (JSC::MarkStack::MarkStackArray::isEmpty):
22214         (JSC::MarkStack::MarkStackArray::size):
22215         (JSC::MarkStack::MarkStackArray::shrinkAllocation):
22216         * runtime/MarkStackPosix.cpp: Added.
22217         (JSC::MarkStack::allocateStack):
22218         (JSC::MarkStack::releaseStack):
22219         * runtime/MarkStackWin.cpp: Added.
22220         (JSC::MarkStack::allocateStack):
22221         (JSC::MarkStack::releaseStack):
22222
22223         * runtime/ScopeChain.h:
22224         * runtime/ScopeChainMark.h:
22225         (JSC::ScopeChain::markAggregate):
22226         * runtime/SmallStrings.cpp:
22227         (JSC::SmallStrings::mark):
22228         * runtime/Structure.h:
22229         (JSC::Structure::markAggregate):
22230
22231 2009-08-10  Mark Rowe  <mrowe@apple.com>
22232         
22233         Reviewed by Darin Adler.
22234
22235         Fix hundreds of "pointer being freed was not allocated" errors seen on the build bot.
22236
22237         * wtf/FastMalloc.h: Implement nothrow variants of the delete and delete[] operators since
22238         we implement the nothrow variants of new and new[].  The nothrow variant of delete is called
22239         explicitly in the implementation of std::sort which was resulting in FastMalloc-allocated
22240         memory being passed to the system allocator to free.
22241
22242 2009-08-10  Jan Michael Alonzo  <jmalonzo@webkit.org>
22243
22244         [Gtk] Unreviewed build fix. Move JSAPIValueWrapper.cpp/.h in the debug
22245         section. This file is already part of AllInOneFile in Release builds.
22246
22247         * GNUmakefile.am:
22248
22249 2009-08-10  Darin Adler  <darin@apple.com>
22250
22251         * wtf/FastMalloc.h: Fix build.
22252
22253 2009-08-10  Darin Adler  <darin@apple.com>
22254
22255         Reviewed by Mark Rowe.
22256
22257         FastMalloc.h has cross-platform code but marked as WinCE-only
22258         https://bugs.webkit.org/show_bug.cgi?id=28160
22259
22260         1) The support for nothrow was inside #if PLATFORM(WINCE) even though it is
22261            not platform-specific.
22262         2) The code tried to override operator delete nothrow, which does not exist.
22263         3) The code in the header checks the value of USE_SYSTEM_MALLOC, but the code
22264            in FastMalloc.cpp checks only if the macro is defined.
22265
22266         * wtf/FastMalloc.h: See above.
22267         * wtf/FastMalloc.cpp: Ditto.
22268
22269 2009-08-10  Sam Weinig  <sam@webkit.org>
22270
22271         Reviewed by Anders Carlsson.
22272
22273         Fix an annoying indentation issue.
22274
22275         * runtime/DateConstructor.cpp:
22276         (JSC::constructDate):
22277
22278 2009-08-10  Xan Lopez  <xlopez@igalia.com>
22279
22280         Unreviewed build fix.
22281
22282         Add new files to makefile.
22283
22284         * GNUmakefile.am:
22285
22286 2009-08-10  Simon Hausmann  <simon.hausmann@nokia.com>
22287
22288         Fix compilation with the interpreter instead of the JIT by including
22289         PrototypeFunction.h as forward-declared through NativeFunctionWrapper.h.
22290
22291         * runtime/ObjectConstructor.cpp:
22292
22293 2009-08-09  Oliver Hunt  <oliver@apple.com>
22294
22295         Reviewed by George Staikos.
22296
22297         JSON.stringify replacer returning undefined does not omit object properties
22298         https://bugs.webkit.org/show_bug.cgi?id=28118
22299
22300         Correct behaviour of stringify when using a replacer function that returns
22301         undefined.  This is a simple change to move the undefined value check to
22302         after the replacer function is called.  This means that the replacer function
22303         is now called for properties with the value undefined, however i've confirmed
22304         that this behaviour is correct.
22305         
22306         In addition I've made the cyclic object exception have a more useful error
22307         message.
22308
22309         * runtime/JSONObject.cpp:
22310         (JSC::Stringifier::appendStringifiedValue):
22311
22312 2009-08-08  Oliver Hunt  <oliver@apple.com>
22313
22314         Reviewed by Eric Seidel and Sam Weinig.
22315
22316         [ES5] Implement Object.getPrototypeOf
22317         https://bugs.webkit.org/show_bug.cgi?id=28114
22318
22319         Implement getPrototypeOf
22320
22321         * runtime/CommonIdentifiers.h:
22322         * runtime/JSGlobalObject.cpp:
22323         (JSC::JSGlobalObject::reset):
22324         * runtime/ObjectConstructor.cpp:
22325         (JSC::ObjectConstructor::ObjectConstructor):
22326         (JSC::objectConsGetPrototypeOf):
22327         * runtime/ObjectConstructor.h:
22328
22329 2009-08-07  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
22330
22331         Reviewed by Eric Seidel.
22332
22333         Allow custom memory allocation control for Noncopyable class
22334         https://bugs.webkit.org/show_bug.cgi?id=27879
22335
22336         Several classes which are inherited from Noncopyable are instantiated by
22337         operator new, so Noncopyable class has been inherited from FastAllocBase.
22338
22339         * wtf/Noncopyable.h:
22340
22341 2009-08-07  George Staikos <george.staikos@torchmobile.com> 
22342
22343         Reviewed by Eric Seidel.
22344
22345         https://bugs.webkit.org/show_bug.cgi?id=27305
22346         Implement WinCE-specific unicode layer.
22347         Written by George Staikos <george.staikos@torchmobile.com>
22348         with bug fixes by Yong Li <yong.li@torchmobile.com>
22349         refactored by Joe Mason <joe.mason@torchmobile.com> 
22350
22351         * wtf/Platform.h:
22352         * wtf/unicode/Unicode.h:
22353         * wtf/unicode/wince/UnicodeWince.cpp: Added.
22354         (WTF::Unicode::toLower):
22355         (WTF::Unicode::toUpper):
22356         (WTF::Unicode::foldCase):
22357         (WTF::Unicode::isPrintableChar):
22358         (WTF::Unicode::isSpace):
22359         (WTF::Unicode::isLetter):
22360         (WTF::Unicode::isUpper):
22361         (WTF::Unicode::isLower):
22362         (WTF::Unicode::isDigit):
22363         (WTF::Unicode::isPunct):
22364         (WTF::Unicode::toTitleCase):
22365         (WTF::Unicode::direction):
22366         (WTF::Unicode::category):
22367         (WTF::Unicode::decompositionType):
22368         (WTF::Unicode::combiningClass):
22369         (WTF::Unicode::mirroredChar):
22370         (WTF::Unicode::digitValue):
22371         * wtf/unicode/wince/UnicodeWince.h: Added.
22372         (WTF::Unicode::):
22373         (WTF::Unicode::isSeparatorSpace):
22374         (WTF::Unicode::isHighSurrogate):
22375         (WTF::Unicode::isLowSurrogate):
22376         (WTF::Unicode::isArabicChar):
22377         (WTF::Unicode::hasLineBreakingPropertyComplexContext):
22378         (WTF::Unicode::umemcasecmp):
22379         (WTF::Unicode::surrogateToUcs4):
22380
22381 2009-08-07  Yongjun Zhang  <yongjun.zhang@nokia.com>
22382
22383         Reviewed by Eric Seidel.
22384
22385         https://bugs.webkit.org/show_bug.cgi?id=28069
22386
22387         Add inline to help winscw compiler resolve specialized argument in 
22388         templated functions.  
22389
22390         * runtime/LiteralParser.cpp:
22391         (JSC::LiteralParser::Lexer::lexString):
22392
22393 2009-08-07  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
22394
22395         Reviewed by Eric Seidel.
22396
22397         Allow custom memory allocation control for RegExpObjectData struct
22398         http://bugs.webkit.org/show_bug.cgi?id=26750
22399
22400         Inherits RegExpObjectData struct from FastAllocBase because
22401         it has been instantiated by 'new' in JavaScriptCore/runtime/RegExpObject.cpp:62
22402
22403         * runtime/RegExpObject.h:
22404
22405 2009-08-06  Norbert Leser  <norbert.leser@nokia.com>
22406
22407         Reviewed by Darin Adler.
22408
22409         Updated patch for bug #27059:
22410         Symbian platform always uses little endian encoding,
22411         regardless of compiler.
22412         We need to make sure that we correctly detect EABI architecture
22413         for armv5 targets on Symbian,
22414         where __EABI__ is set but not __ARM_EABI__
22415
22416         * wtf/Platform.h:
22417
22418 2009-08-06  Adam Barth  <abarth@webkit.org>
22419
22420         Unreviewed revert.
22421
22422         http://bugs.webkit.org/show_bug.cgi?id=27879
22423
22424         Revert 46877 because it broke GTK.
22425
22426         * wtf/Noncopyable.h:
22427
22428 2009-08-06  Gavin Barraclough  <barraclough@apple.com>
22429
22430         Reviewed by Oliver Hunt.
22431
22432         Make get_by_id/put_by_id/method_check/call defer optimization using a data flag rather than a code modification.
22433         ( https://bugs.webkit.org/show_bug.cgi?id=27635 )
22434
22435         This improves performance of ENABLE(ASSEMBLER_WX_EXCLUSIVE) builds by 2-2.5%, reducing the overhead to about 2.5%.
22436         (No performance impact with ASSEMBLER_WX_EXCLUSIVE disabled).
22437
22438         * bytecode/CodeBlock.cpp:
22439         (JSC::printStructureStubInfo):
22440             - Make StructureStubInfo store the type as an integer, rather than an OpcodeID.
22441
22442         * bytecode/CodeBlock.h:
22443         (JSC::):
22444         (JSC::CallLinkInfo::seenOnce):
22445         (JSC::CallLinkInfo::setSeen):
22446         (JSC::MethodCallLinkInfo::seenOnce):
22447         (JSC::MethodCallLinkInfo::setSeen):
22448             - Change a pointer in CallLinkInfo/MethodCallLinkInfo to use a PtrAndFlags, use a flag to track when an op has been executed once.
22449
22450         * bytecode/StructureStubInfo.cpp:
22451         (JSC::StructureStubInfo::deref):
22452             - Make StructureStubInfo store the type as an integer, rather than an OpcodeID.
22453
22454         * bytecode/StructureStubInfo.h:
22455         (JSC::StructureStubInfo::StructureStubInfo):
22456         (JSC::StructureStubInfo::initGetByIdSelf):
22457         (JSC::StructureStubInfo::initGetByIdProto):
22458         (JSC::StructureStubInfo::initGetByIdChain):
22459         (JSC::StructureStubInfo::initGetByIdSelfList):
22460         (JSC::StructureStubInfo::initGetByIdProtoList):
22461         (JSC::StructureStubInfo::initPutByIdTransition):
22462         (JSC::StructureStubInfo::initPutByIdReplace):
22463         (JSC::StructureStubInfo::seenOnce):
22464         (JSC::StructureStubInfo::setSeen):
22465             - Make StructureStubInfo store the type as an integer, rather than an OpcodeID, add a flag to track when an op has been executed once.
22466
22467         * bytecompiler/BytecodeGenerator.cpp:
22468         (JSC::BytecodeGenerator::emitGetById):
22469         (JSC::BytecodeGenerator::emitPutById):
22470             - Make StructureStubInfo store the type as an integer, rather than an OpcodeID.
22471
22472         * jit/JIT.cpp:
22473         (JSC::JIT::privateCompileCTIMachineTrampolines):
22474         (JSC::JIT::unlinkCall):
22475             - Remove the "don't lazy link" stage of calls.
22476
22477         * jit/JIT.h:
22478         (JSC::JIT::compileCTIMachineTrampolines):
22479             - Remove the "don't lazy link" stage of calls.
22480
22481         * jit/JITCall.cpp:
22482         (JSC::JIT::compileOpCallSlowCase):
22483             - Remove the "don't lazy link" stage of calls.
22484
22485         * jit/JITStubs.cpp:
22486         (JSC::JITThunks::JITThunks):
22487         (JSC::JITThunks::tryCachePutByID):
22488         (JSC::JITThunks::tryCacheGetByID):
22489         (JSC::JITStubs::DEFINE_STUB_FUNCTION):
22490         (JSC::JITStubs::getPolymorphicAccessStructureListSlot):
22491             - Remove the "don't lazy link" stage of calls, and the "_second" stage of get_by_id/put_by_id/method_check.
22492
22493         * jit/JITStubs.h:
22494         (JSC::JITThunks::ctiStringLengthTrampoline):
22495         (JSC::JITStubs::):
22496             - Remove the "don't lazy link" stage of calls, and the "_second" stage of get_by_id/put_by_id/method_check.
22497
22498         * wtf/PtrAndFlags.h:
22499         (WTF::PtrAndFlags::PtrAndFlags):
22500         (WTF::PtrAndFlags::operator!):
22501         (WTF::PtrAndFlags::operator->):
22502             - Add ! and -> operators, add constuctor with pointer argument.
22503
22504 2009-08-06  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
22505
22506         Reviewed by Adam Barth.
22507
22508         Allow custom memory allocation control for Noncopyable class
22509         https://bugs.webkit.org/show_bug.cgi?id=27879
22510
22511         Several classes which inherited from Noncopyable are instantiated by
22512         operator new, so Noncopyable class has been inherited from FastAllocBase.
22513
22514         * wtf/Noncopyable.h:
22515
22516 2009-08-06  Mark Rowe  <mrowe@apple.com>
22517
22518         Rubber-stamped by Sam Weinig.
22519
22520         Add explicit dependencies for our build verification scripts to ensure that they always run after linking has completed.
22521
22522         * JavaScriptCore.xcodeproj/project.pbxproj:
22523
22524 2009-08-06  Mark Rowe  <mrowe@apple.com>
22525
22526         Bring a little order to our otherwise out of control lives.
22527
22528         * JavaScriptCore.xcodeproj/project.pbxproj:
22529
22530 2009-08-06  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
22531
22532         Reviewed by Darin Adler.
22533
22534         Allow custom memory allocation control for JavaScriptCore's PolymorphicAccessStructureList struct
22535         https://bugs.webkit.org/show_bug.cgi?id=27877
22536
22537         Inherits PolymorphicAccessStructureList struct from FastAllocBase because it has been instantiated by
22538         'new' in JavaScriptCore/jit/JITStubs.cpp:1229.
22539
22540         * bytecode/Instruction.h:
22541
22542 2009-08-05  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
22543
22544         Reviewed by Darin Adler.
22545
22546         Allow custom memory allocation control for JavaScriptCore's ScopeNodeData struct
22547         https://bugs.webkit.org/show_bug.cgi?id=27875
22548
22549         Inherits ScopeNodeData struct from FastAllocBase because it has been instantiated by
22550         'new' in JavaScriptCore/parser/Nodes.cpp:1848.
22551
22552         * parser/Nodes.h:
22553
22554 2009-08-05  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
22555
22556         Reviewed by Gavin Barraclough.
22557
22558         Add floating point support for generic ARM port.
22559         https://bugs.webkit.org/show_bug.cgi?id=24986
22560
22561         * assembler/ARMAssembler.cpp:
22562         (JSC::ARMAssembler::doubleTransfer):
22563         * assembler/ARMAssembler.h:
22564         (JSC::ARM::):
22565         (JSC::ARMAssembler::):
22566         (JSC::ARMAssembler::faddd_r):
22567         (JSC::ARMAssembler::fsubd_r):
22568         (JSC::ARMAssembler::fmuld_r):
22569         (JSC::ARMAssembler::fcmpd_r):
22570         (JSC::ARMAssembler::fdtr_u):
22571         (JSC::ARMAssembler::fdtr_d):
22572         (JSC::ARMAssembler::fmsr_r):
22573         (JSC::ARMAssembler::fsitod_r):
22574         (JSC::ARMAssembler::fmstat):
22575         * assembler/MacroAssemblerARM.h:
22576         (JSC::MacroAssemblerARM::):
22577         (JSC::MacroAssemblerARM::supportsFloatingPoint):
22578         (JSC::MacroAssemblerARM::loadDouble):
22579         (JSC::MacroAssemblerARM::storeDouble):
22580         (JSC::MacroAssemblerARM::addDouble):
22581         (JSC::MacroAssemblerARM::subDouble):
22582         (JSC::MacroAssemblerARM::mulDouble):
22583         (JSC::MacroAssemblerARM::convertInt32ToDouble):
22584         (JSC::MacroAssemblerARM::branchDouble):
22585         * jit/JIT.h:
22586
22587 2009-08-05  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
22588
22589         Reviewed by Gavin Barraclough.
22590
22591         Add JIT support for generic ARM port without optimizations.
22592         https://bugs.webkit.org/show_bug.cgi?id=24986
22593
22594         All JIT optimizations are disabled.
22595
22596         Signed off by Zoltan Herczeg <zherczeg@inf.u-szeged.hu>
22597         Signed off by Gabor Loki <loki@inf.u-szeged.hu>
22598
22599         * assembler/ARMAssembler.cpp:
22600         (JSC::ARMAssembler::baseIndexTransfer32):
22601         * assembler/AbstractMacroAssembler.h:
22602         (JSC::AbstractMacroAssembler::Imm32::Imm32):
22603         * assembler/MacroAssemblerARM.h:
22604         (JSC::MacroAssemblerARM::store32):
22605         (JSC::MacroAssemblerARM::move):
22606         (JSC::MacroAssemblerARM::branch32):
22607         (JSC::MacroAssemblerARM::add32):
22608         (JSC::MacroAssemblerARM::sub32):
22609         (JSC::MacroAssemblerARM::load32):
22610         * bytecode/CodeBlock.h:
22611         (JSC::CodeBlock::getBytecodeIndex):
22612         * jit/JIT.h:
22613         * jit/JITInlineMethods.h:
22614         (JSC::JIT::restoreArgumentReference):
22615         * jit/JITOpcodes.cpp:
22616         * jit/JITStubs.cpp:
22617         * jit/JITStubs.h:
22618         (JSC::JITStackFrame::returnAddressSlot):
22619         * wtf/Platform.h:
22620
22621 2009-08-04  Gavin Barraclough  <barraclough@apple.com>
22622
22623         Rubber Stamped by Oiver Hunt.
22624
22625         Revert r46643 since this breaks the Yarr::Interpreter running the v8 tests.
22626         https://bugs.webkit.org/show_bug.cgi?id=27874
22627
22628         * yarr/RegexInterpreter.cpp:
22629         (JSC::Yarr::Interpreter::allocDisjunctionContext):
22630         (JSC::Yarr::Interpreter::freeDisjunctionContext):
22631         (JSC::Yarr::Interpreter::allocParenthesesDisjunctionContext):
22632         (JSC::Yarr::Interpreter::freeParenthesesDisjunctionContext):
22633
22634 2009-08-04  Oliver Hunt  <oliver@apple.com>
22635
22636         PPC64 Build fix
22637
22638         * wtf/Platform.h:
22639
22640 2009-08-04  Benjamin C Meyer  <benjamin.meyer@torchmobile.com>
22641
22642         Reviewed by Adam Treat
22643
22644         Explicitly include limits.h header when using INT_MAX and INT_MIN
22645
22646         * interpreter/Interpreter.cpp
22647
22648 2009-08-03  Harald Fernengel  <harald.fernengel@nokia.com>
22649
22650         Reviewed by Darin Adler.
22651
22652         Fix compile error for ambigous call to abs()
22653         https://bugs.webkit.org/show_bug.cgi?id=27873
22654
22655         Fix ambiguity in abs(long int) call by calling labs() instead
22656
22657         * wtf/DateMath.cpp: replace call to abs() with labs()
22658
22659 2009-08-03  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
22660
22661         Reviewed by Eric Seidel.
22662
22663         [Qt] Consolidate common gcc flags to WebKit.pri
22664         https://bugs.webkit.org/show_bug.cgi?id=27934
22665
22666         * JavaScriptCore.pro:
22667
22668 2009-08-03  Ada Chan  <adachan@apple.com>
22669
22670         Fixed the Tiger build.
22671
22672         * wtf/FastMalloc.cpp:
22673
22674 2009-08-03  Ada Chan  <adachan@apple.com>
22675
22676         Reviewed by Darin Adler.
22677
22678         Don't use background thread to scavenge memory on Tiger until we figure out why it causes a crash.
22679         https://bugs.webkit.org/show_bug.cgi?id=27900
22680
22681         * wtf/FastMalloc.cpp:
22682
22683 2009-08-03  Fumitoshi Ukai  <ukai@chromium.org>
22684
22685         Reviewed by Jan Alonzo.
22686
22687         Fix build break on Gtk/x86_64.
22688         https://bugs.webkit.org/show_bug.cgi?id=27936
22689
22690         Use JSVALUE64 for X86_64 LINUX, except Qt.
22691
22692         * wtf/Platform.h:
22693
22694 2009-08-02  Xan Lopez  <xlopez@igalia.com>
22695
22696         Fix the GTK+ build.
22697
22698         * wtf/Platform.h:
22699
22700 2009-08-02  Geoffrey Garen  <ggaren@apple.com>
22701
22702         Reviewed by Sam Weinig.
22703
22704         Disabled JSVALUE32_64 on Qt builds, since all layout tests mysteriously
22705         crash with it enabled.
22706
22707         * wtf/Platform.h:
22708
22709 2009-08-02  Geoffrey Garen  <ggaren@apple.com>
22710
22711         Qt build fix.
22712
22713         Added JSAPIValueWrapper.cpp to the build.
22714
22715         * JavaScriptCore.pri:
22716
22717 2009-08-02  Geoffrey Garen  <ggaren@apple.com>
22718
22719         Windows build fix.
22720
22721         Exported symbols for JSAPIValueWrapper.
22722
22723         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
22724         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
22725
22726 2009-08-02  Geoffrey Garen  <ggaren@apple.com>
22727
22728         GTK build fix.
22729
22730         * jit/JITStubs.cpp: #include <stdarg.h>, for a definition of va_start.
22731
22732 2009-08-02  Geoffrey Garen  <ggaren@apple.com>
22733
22734         Qt build fix.
22735         
22736         * runtime/Collector.cpp: #include <limits.h>, for a definition of ULONG_MAX.
22737
22738 2009-08-02  Geoffrey Garen  <ggaren@apple.com>
22739
22740         Windows build fix: Nixed JSImmediate::prototype, JSImmediate::toObject,
22741         and JSImmediate::toThisObject, and removed their exported symbols.
22742
22743         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
22744         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
22745         * runtime/JSImmediate.cpp:
22746         * runtime/JSImmediate.h:
22747
22748 2009-08-02  Geoffrey Garen  <ggaren@apple.com>
22749
22750         Reviewed by Mark Rowe.
22751
22752         Enabled JSVALUE32_64 by default on all platforms other than x86_64 (which uses JSVALUE64).
22753
22754         * wtf/Platform.h:
22755
22756 2009-08-02  Kevin Ollivier  <kevino@theolliviers.com>
22757
22758         Reviewed by Jan Alonzo.
22759
22760         Script for building the JavaScriptCore library for wx.
22761         https://bugs.webkit.org/show_bug.cgi?id=27619
22762
22763         * wscript: Added.
22764
22765 2009-08-02  Yong Li  <yong.li@torchmobile.com>
22766
22767         Reviewed by George Staikos.
22768
22769         DateMath depends on strftime and localtime, which need to be imported manually on WinCE
22770         https://bugs.webkit.org/show_bug.cgi?id=26558
22771
22772         * wtf/DateMath.cpp:
22773
22774 2009-08-01  David Kilzer  <ddkilzer@apple.com>
22775
22776         wtf/Threading.h: added include of Platform.h
22777
22778         Reviewed by Mark Rowe.
22779
22780         * wtf/Threading.h: Added #include "Platform.h" since this header
22781         uses PLATFORM() and other macros.
22782
22783 2009-08-01  Mark Rowe  <mrowe@apple.com>
22784
22785         Rubber-stamped by Oliver Hunt.
22786
22787         Roll out r46668 as it was misinformed.  ScopeChain is only used with placement new.
22788
22789         * runtime/ScopeChain.h:
22790
22791 2009-08-01  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
22792
22793         Allow custom memory allocation control for JavaScriptCore's HashMap class
22794         http://bugs.webkit.org/show_bug.cgi?id=27871
22795
22796         Inherits HashMap class from FastAllocBase because it has been
22797         instantiated by 'new' in JavaScriptCore/API/JSClassRef.cpp:148.
22798
22799         * wtf/RefPtrHashMap.h:
22800         (WTF::):
22801
22802 2009-08-01  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
22803
22804         Allow custom memory allocation control for JavaScriptCore's ScopeChain class
22805         https://bugs.webkit.org/show_bug.cgi?id=27834
22806
22807         Inherits ScopeChain class from FastAllocBase because it has been
22808         instantiated by 'new' in JavaScriptCore/runtime/JSFunction.h:109.
22809
22810         * runtime/ScopeChain.h:
22811
22812 2009-08-01  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
22813
22814         Reviewed by Darin Adler.
22815
22816         Allow custom memory allocation control for JavaScriptCore's RegExpConstructorPrivate struct 
22817         https://bugs.webkit.org/show_bug.cgi?id=27833
22818
22819         Inherits RegExpConstructorPrivate class from FastAllocBase because it has been
22820         instantiated by 'new' in JavaScriptCore/runtime/RegExpConstructor.cpp:152.
22821
22822         * runtime/RegExpConstructor.cpp:
22823
22824 2009-07-31  Yong Li  <yong.li@torchmobile.com>
22825
22826         Reviewed by George Staikos.
22827
22828         Resurrect the old GetTickCount implementation of currentTime, controlled by WTF_USE_QUERY_PERFORMANCE_COUNTER
22829         currentSystemTime taken from older WebKit; currentTime written by Yong Li <yong.li@torchmobile.com>; cleanup by Joe Mason <joe.mason@torchmobile.com>
22830         https://bugs.webkit.org/show_bug.cgi?id=27848
22831
22832         * wtf/CurrentTime.cpp:
22833         (WTF::currentSystemTime): get current time with GetCurrentFT
22834         (WTF::currentTime): track msec elapsed since first currentSystemTime call using GetTickCount
22835         * wtf/Platform.h:
22836
22837 2009-07-31  Ada Chan  <adachan@apple.com>
22838
22839         Fixes the Windows release-PGO build.
22840
22841         Reviewed by Jon Honeycutt.
22842
22843         * JavaScriptCore.vcproj/WTF/WTF.vcproj: Suppresses the warning about unreachable code that we get by adding "return 0" to WTF::TCMalloc_PageHeap::runScavengerThread().
22844         * wtf/FastMalloc.cpp:
22845         (WTF::TCMalloc_PageHeap::runScavengerThread): Fixes the error about the method not returning a value in the release-PGO build.
22846
22847 2009-07-31  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
22848
22849         Change malloc to fastMalloc and free to fastFree in Yarr's RegexInterpreter.cpp
22850         https://bugs.webkit.org/show_bug.cgi?id=27874
22851
22852         Use fastMalloc and fastFree instead of malloc and free in RegexInterpreter.cpp's methods.
22853
22854         * yarr/RegexInterpreter.cpp:
22855         (JSC::Yarr::Interpreter::allocDisjunctionContext):
22856         (JSC::Yarr::Interpreter::freeDisjunctionContext):
22857         (JSC::Yarr::Interpreter::allocParenthesesDisjunctionContext):
22858         (JSC::Yarr::Interpreter::freeParenthesesDisjunctionContext):
22859
22860 2009-07-30  Xan Lopez  <xlopez@igalia.com>
22861
22862         Reviewed by Jan Alonzo.
22863
22864         Fix compiler warning.
22865
22866         GCC does not like C++-style comments in preprocessor directives.
22867
22868         * wtf/Platform.h:
22869
22870 2009-07-30  John McCall  <rjmccall@apple.com>
22871
22872         Reviewed by Gavin Barraclough.
22873
22874         Optimize the X86_64 trampolines: avoid the need for filler arguments
22875         and move the stub-args area closer to the stack pointer.
22876
22877         * jit/JIT.h: adjust patch offsets because of slight code-size change 
22878         * jit/JITCode.h:
22879         (JSC::JITCode::execute): don't pass filler args
22880         * jit/JITStubs.cpp:
22881         (ctiTrampoline): (X86_64): push args onto stack, use args directly
22882         (ctiVMThrowTrampoline): (X86_64): adjust %rsp by correct displacement
22883         (ctiOpThrowNotCaught): (X86_64): adjust %rsp by correct displacement
22884         * jit/JITStubs.h:
22885         (JITStackFrame): (X86_64): move args area earlier
22886         (ctiTrampoline): remove filler args from prototype
22887
22888 2009-07-30  Gavin Barraclough  <barraclough@apple.com>
22889
22890         Temporarily revert r46618 since this is b0rking on Linux.
22891
22892 2009-07-23  Gavin Barraclough  <barraclough@apple.com>
22893
22894         Reviewed by Oliver Hunt.
22895
22896         Make get_by_id/put_by_id/method_check/call defer optimization using a data flag rather than a code modification.
22897         ( https://bugs.webkit.org/show_bug.cgi?id=27635 )
22898
22899         This improves performance of ENABLE(ASSEMBLER_WX_EXCLUSIVE) builds by 2-2.5%, reducing the overhead to about 2.5%.
22900         (No performance impact with ASSEMBLER_WX_EXCLUSIVE disabled).
22901
22902         * bytecode/CodeBlock.cpp:
22903         (JSC::printStructureStubInfo):
22904             - Make StructureStubInfo store the type as an integer, rather than an OpcodeID.
22905
22906         * bytecode/CodeBlock.h:
22907         (JSC::):
22908         (JSC::CallLinkInfo::seenOnce):
22909         (JSC::CallLinkInfo::setSeen):
22910         (JSC::MethodCallLinkInfo::seenOnce):
22911         (JSC::MethodCallLinkInfo::setSeen):
22912             - Change a pointer in CallLinkInfo/MethodCallLinkInfo to use a PtrAndFlags, use a flag to track when an op has been executed once.
22913
22914         * bytecode/StructureStubInfo.cpp:
22915         (JSC::StructureStubInfo::deref):
22916             - Make StructureStubInfo store the type as an integer, rather than an OpcodeID.
22917
22918         * bytecode/StructureStubInfo.h:
22919         (JSC::StructureStubInfo::StructureStubInfo):
22920         (JSC::StructureStubInfo::initGetByIdSelf):
22921         (JSC::StructureStubInfo::initGetByIdProto):
22922         (JSC::StructureStubInfo::initGetByIdChain):
22923         (JSC::StructureStubInfo::initGetByIdSelfList):
22924         (JSC::StructureStubInfo::initGetByIdProtoList):
22925         (JSC::StructureStubInfo::initPutByIdTransition):
22926         (JSC::StructureStubInfo::initPutByIdReplace):
22927         (JSC::StructureStubInfo::seenOnce):
22928         (JSC::StructureStubInfo::setSeen):
22929             - Make StructureStubInfo store the type as an integer, rather than an OpcodeID, add a flag to track when an op has been executed once.
22930
22931         * bytecompiler/BytecodeGenerator.cpp:
22932         (JSC::BytecodeGenerator::emitGetById):
22933         (JSC::BytecodeGenerator::emitPutById):
22934             - Make StructureStubInfo store the type as an integer, rather than an OpcodeID.
22935
22936         * jit/JIT.cpp:
22937         (JSC::JIT::privateCompileCTIMachineTrampolines):
22938         (JSC::JIT::unlinkCall):
22939             - Remove the "don't lazy link" stage of calls.
22940
22941         * jit/JIT.h:
22942         (JSC::JIT::compileCTIMachineTrampolines):
22943             - Remove the "don't lazy link" stage of calls.
22944
22945         * jit/JITCall.cpp:
22946         (JSC::JIT::compileOpCallSlowCase):
22947             - Remove the "don't lazy link" stage of calls.
22948
22949         * jit/JITStubs.cpp:
22950         (JSC::JITThunks::JITThunks):
22951         (JSC::JITThunks::tryCachePutByID):
22952         (JSC::JITThunks::tryCacheGetByID):
22953         (JSC::JITStubs::DEFINE_STUB_FUNCTION):
22954         (JSC::JITStubs::getPolymorphicAccessStructureListSlot):
22955             - Remove the "don't lazy link" stage of calls, and the "_second" stage of get_by_id/put_by_id/method_check.
22956
22957         * jit/JITStubs.h:
22958         (JSC::JITThunks::ctiStringLengthTrampoline):
22959         (JSC::JITStubs::):
22960             - Remove the "don't lazy link" stage of calls, and the "_second" stage of get_by_id/put_by_id/method_check.
22961
22962         * wtf/PtrAndFlags.h:
22963         (WTF::PtrAndFlags::PtrAndFlags):
22964         (WTF::PtrAndFlags::operator!):
22965         (WTF::PtrAndFlags::operator->):
22966             - Add ! and -> operators, add constuctor with pointer argument.
22967
22968 2009-07-30  Geoffrey Garen  <ggaren@apple.com>
22969
22970         Reviewed by Gavin Barraclough.
22971
22972         Fixed failing tests seen on Windows buildbot.
22973
22974         * jit/JITStubs.cpp:
22975         (JSC::DEFINE_STUB_FUNCTION):
22976         * jit/JITStubs.h:
22977         (JSC::): Use "int" instead of "bool" to guarantee a 32-bit result,
22978         regardless of compiler. gcc on mac uses 32-bit values for bool,
22979         but gcc on linux and MSVC on Windows use 8-bit values.
22980
22981 2009-07-30  Geoffrey Garen  <ggaren@apple.com>
22982
22983         Windows build fix: added missing symbols on Windows.
22984
22985         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
22986         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
22987
22988 2009-07-30  Geoffrey Garen  <ggaren@apple.com>
22989
22990         Windows build fix: removed stale symbols on Windows.
22991
22992         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
22993         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
22994
22995 === End merge of nitro-extreme branch 2009-07-30 ===
22996
22997 2009-07-20  Geoffrey Garen  <ggaren@apple.com>
22998
22999         Fixed a post-review typo in r46066 that caused tons of test failures.
23000         
23001         SunSpider reports no change.
23002
23003         * runtime/JSArray.cpp:
23004         (JSC::JSArray::JSArray): Initialize the full vector capacity, to avoid
23005         uninitialized members at the end.
23006
23007 2009-07-20  Geoffrey Garen  <ggaren@apple.com>
23008
23009         Windows WebKit build fix: Added some missing exports.
23010
23011         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
23012         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
23013
23014 2009-07-17  Geoffrey Garen  <ggaren@apple.com>
23015
23016         Reviewed by Sam Weinig.
23017
23018         Get the branch working on windows.
23019         https://bugs.webkit.org/show_bug.cgi?id=27391
23020         
23021         SunSpider says 0.3% faster.
23022
23023         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
23024         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: Updated
23025         MSVC export lists to fix linker errors.
23026
23027         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Added / removed
23028         new / old project files.
23029
23030         * jit/JIT.cpp:
23031         (JSC::JIT::privateCompileCTIMachineTrampolines): Used #pragma pack to tell
23032         MSVC that these structures represent actual memory layout, and should not be
23033         automatically aligned. Changed the return value load to load a 64bit quantity
23034         into the canonical registers.
23035
23036         * jit/JIT.h: Moved OBJECT_OFFSETOF definition to StdLibExtras.h because
23037         it's needed by more than just the JIT, and it supplements a standard library
23038         macro (offsetof).
23039
23040         * jit/JITCall.cpp:
23041         (JSC::JIT::compileOpCallInitializeCallFrame): Fixed an incorrectly signed
23042         cast to resolve an MSVC warning.
23043
23044         * jit/JITStubs.h: Used #pragma pack to tell MSVC that these structures
23045         represent actual memory layout, and should not be automatically aligned. 
23046
23047         * runtime/JSArray.cpp:
23048         (JSC::JSArray::JSArray): Replaced memset_pattern8 with a for loop, since
23049         memset_pattern8 is not portable. (I verified that this version of the loop
23050         gives the best performance / generated code in GCC.)
23051
23052         * runtime/JSObject.h:
23053         (JSC::JSObject::JSObject): Removed accidental usage of FIELD_OFFSET --
23054         OBJECT_OFFSETOF is our new macro name. (FIELD_OFFSET conflicts with a
23055         definition in winnt.h.)
23056
23057         * runtime/JSValue.cpp: Added some headers needed by non-all-in-one builds.
23058         
23059         * runtime/JSValue.h:
23060         (JSC::JSValue::): Made the tag signed, to match MSVC's signed enum values.
23061         (GCC doesn't seem to care one way or the other.)
23062
23063         * wtf/MainThread.cpp: Moved the StdLibExtras.h #include -- I did this a
23064         while ago to resolve a conflict with winnt.h. I can't remember if it's truly
23065         still needed, but what the heck.
23066
23067         * wtf/StdLibExtras.h: Moved OBJECT_OFFSETOF definition here.
23068
23069 2009-07-06  Geoffrey Garen  <ggaren@apple.com>
23070
23071         Reviewed by Sam Weinig (?).
23072         
23073         Fixed an assertion seen during the stress test.
23074         
23075         Don't assume that, if op1 is constant, op2 is not, and vice versa. Sadly,
23076         not all constants get folded.
23077
23078         * jit/JITArithmetic.cpp:
23079         (JSC::JIT::emit_op_jnless):
23080         (JSC::JIT::emitSlow_op_jnless):
23081         (JSC::JIT::emit_op_jnlesseq):
23082         (JSC::JIT::emitSlow_op_jnlesseq):
23083
23084 2009-07-06  Geoffrey Garen  <ggaren@apple.com>
23085
23086         Reviewed by Sam Weinig.
23087         
23088         Include op_convert_this in result caching.
23089         
23090         No change on SunSpider or v8.
23091
23092         * jit/JITOpcodes.cpp:
23093         (JSC::JIT::emit_op_convert_this):
23094
23095         * jit/JITStubs.cpp:
23096         (JSC::DEFINE_STUB_FUNCTION):
23097         * jit/JITStubs.h:
23098         (JSC::): Made the op_convert_this JIT stub return an EncodedJSValue, so
23099         to maintain the result caching contract that { tag, payload } can be
23100         found in { regT1, regT0 }.
23101
23102 2009-07-06  Geoffrey Garen  <ggaren@apple.com>
23103
23104         Reviewed by Sam Weinig.
23105         
23106         Implemented result chaining.
23107         
23108         1% faster on SunSpider. 4%-5% faster on v8.
23109
23110         * assembler/MacroAssemblerX86Common.h:
23111         (JSC::MacroAssemblerX86Common::move):
23112         * assembler/X86Assembler.h:
23113         (JSC::X86Assembler::movl_rr): Added an optimization to eliminate
23114         no-op mov instructions, to simplify chaining.
23115
23116         * jit/JIT.cpp:
23117         (JSC::JIT::JIT):
23118         * jit/JIT.h: Added data members and helper functions for recording
23119         chained results. We record both a mapping from virtual to machine register
23120         and the opcode for which the mapping is valid, to help ensure that the
23121         mapping isn't used after the mapped register has been stomped by other
23122         instructions.
23123
23124         * jit/JITCall.cpp:
23125         (JSC::JIT::compileOpCallVarargs):
23126         (JSC::JIT::compileOpCallVarargsSlowCase):
23127         (JSC::JIT::emit_op_ret):
23128         (JSC::JIT::emit_op_construct_verify):
23129         (JSC::JIT::compileOpCall):
23130         (JSC::JIT::compileOpCallSlowCase): Chain function call results.
23131
23132         * jit/JITInlineMethods.h:
23133         (JSC::JIT::emitLoadTag):
23134         (JSC::JIT::emitLoadPayload):
23135         (JSC::JIT::emitLoad):
23136         (JSC::JIT::emitLoad2):
23137         (JSC::JIT::isLabeled):
23138         (JSC::JIT::map):
23139         (JSC::JIT::unmap):
23140         (JSC::JIT::isMapped):
23141         (JSC::JIT::getMappedPayload):
23142         (JSC::JIT::getMappedTag): Use helper functions when loading virtual
23143         registers into machine registers, in case the loads can be eliminated
23144         by chaining.
23145
23146         * jit/JITOpcodes.cpp:
23147         (JSC::JIT::emit_op_mov):
23148         (JSC::JIT::emit_op_end):
23149         (JSC::JIT::emit_op_instanceof):
23150         (JSC::JIT::emit_op_get_global_var):
23151         (JSC::JIT::emit_op_put_global_var):
23152         (JSC::JIT::emit_op_get_scoped_var):
23153         (JSC::JIT::emit_op_put_scoped_var):
23154         (JSC::JIT::emit_op_to_primitive):
23155         (JSC::JIT::emit_op_resolve_global):
23156         (JSC::JIT::emit_op_jneq_ptr):
23157         (JSC::JIT::emit_op_next_pname):
23158         (JSC::JIT::emit_op_to_jsnumber):
23159         (JSC::JIT::emit_op_catch): Chain results from these opcodes.
23160
23161         (JSC::JIT::emit_op_profile_will_call):
23162         (JSC::JIT::emit_op_profile_did_call): Load the profiler into regT2 to
23163         avoid stomping a chained result.
23164
23165         * jit/JITPropertyAccess.cpp:
23166         (JSC::JIT::emit_op_method_check):
23167         (JSC::JIT::emit_op_get_by_val):
23168         (JSC::JIT::emit_op_get_by_id): Chain results from these opcodes.
23169
23170         * jit/JITStubCall.h:
23171         (JSC::JITStubCall::addArgument): Always use { regT1, regT0 }, to facilitate
23172         chaining.
23173
23174         (JSC::JITStubCall::call): Unmap all mapped registers, since our callee
23175         stub might stomp them.
23176
23177 2009-07-01  Sam Weinig  <sam@webkit.org>
23178
23179         Reviewed by Gavin Barraclough.
23180
23181         Don't reload values in emitBinaryDoubleOp.
23182
23183         SunSpider reports a 0.6% progression. 
23184
23185         * jit/JIT.h:
23186         * jit/JITArithmetic.cpp:
23187         (JSC::JIT::emit_op_jnless):
23188         (JSC::JIT::emit_op_jnlesseq):
23189         (JSC::JIT::emitBinaryDoubleOp):
23190
23191 2009-07-01  Sam Weinig  <sam@webkit.org>
23192
23193         Reviewed by Geoffrey Garen.
23194
23195         Convert op_div to load op1 and op2 up front.
23196
23197         * jit/JITArithmetic.cpp:
23198         (JSC::JIT::emit_op_div):
23199
23200 2009-07-01  Sam Weinig  <sam@webkit.org>
23201
23202         Reviewed by Geoffrey Garen.
23203
23204         Don't emit code in emitBinaryDoubleOp if code is unreachable, observable
23205         via an empty (unlinked) jumplist passed in.  This only effects op_jnless
23206         and op_jnlesseq at present.
23207
23208         * jit/JITArithmetic.cpp:
23209         (JSC::JIT::emitSlow_op_jnless):
23210         (JSC::JIT::emitSlow_op_jnlesseq):
23211         (JSC::JIT::emitBinaryDoubleOp):
23212
23213 2009-07-01  Geoffrey Garen  <ggaren@apple.com>
23214
23215         Reviewed by Sam Weinig.
23216
23217         Converted op_mod to put { tag, payload } in { regT1, regT0 }, and
23218         tidied up its constant case.
23219         
23220         SunSpider reports a 0.2% regression, but a micro-benchmark of op_mod
23221         shows a 12% speedup, and the SunSpider test that uses op_mod most should
23222         benefit a lot from result caching in the end, since it almost always
23223         performs (expression) % constant.
23224
23225         * jit/JITArithmetic.cpp:
23226         (JSC::JIT::emit_op_mod):
23227         (JSC::JIT::emitSlow_op_mod):
23228
23229 2009-06-30  Sam Weinig  <sam@webkit.org>
23230
23231         Reviewed by Geoffrey Garen.
23232
23233         Converted some more arithmetic ops to put { tag, payload } in
23234         { regT1, regT0 }.
23235
23236         * jit/JITArithmetic.cpp:
23237         (JSC::JIT::emit_op_mul):
23238         (JSC::JIT::emitSlow_op_mul):
23239
23240 2009-06-30  Geoffrey Garen  <ggaren@apple.com>
23241
23242         Reviewed by Sam Weinig.
23243
23244         Converted some more arithmetic ops to put { tag, payload } in
23245         { regT1, regT0 }, and added a case for subtract constant.
23246         
23247         SunSpider says no change. v8 says 0.3% slower.
23248
23249         * jit/JIT.h:
23250         * jit/JITArithmetic.cpp:
23251         (JSC::JIT::emit_op_add):
23252         (JSC::JIT::emitAdd32Constant):
23253         (JSC::JIT::emitSlow_op_add):
23254         (JSC::JIT::emit_op_sub):
23255         (JSC::JIT::emitSub32Constant):
23256         (JSC::JIT::emitSlow_op_sub):
23257
23258 2009-06-30  Gavin Barraclough  <barraclough@apple.com>
23259
23260         Reviewed by Sam Weinig.
23261
23262         Remove more uses of addressFor(), load double constants directly from
23263         the constantpool in the CodeBlock, rather than from the register file.
23264
23265         * jit/JITArithmetic.cpp:
23266         (JSC::JIT::emitAdd32Constant):
23267         (JSC::JIT::emitBinaryDoubleOp):
23268
23269 2009-06-30  Geoffrey Garen  <ggaren@apple.com>
23270
23271         Reviewed by Sam Weinig.
23272         
23273         Fixed a bug in postfix ops, where we would treat x = x++ and x = x--
23274         as a no-op, even if x were not an int, and the ++/-- could have side-effects.
23275
23276         * jit/JITArithmetic.cpp:
23277         (JSC::JIT::emit_op_post_inc):
23278         (JSC::JIT::emitSlow_op_post_inc):
23279         (JSC::JIT::emit_op_post_dec):
23280         (JSC::JIT::emitSlow_op_post_dec):
23281
23282 2009-06-30  Geoffrey Garen  <ggaren@apple.com>
23283
23284         Reviewed by Sam Weinig.
23285         
23286         Converted some arithmetic ops to put { tag, payload } in
23287         { regT1, regT0 }.
23288         
23289         SunSpider says 0.7% faster. v8 says no change.
23290
23291         * jit/JIT.h:
23292         * jit/JITArithmetic.cpp:
23293         (JSC::JIT::emit_op_jnless):
23294         (JSC::JIT::emit_op_jnlesseq):
23295         (JSC::JIT::emit_op_lshift):
23296         (JSC::JIT::emit_op_rshift):
23297         (JSC::JIT::emit_op_bitand):
23298         (JSC::JIT::emit_op_bitor):
23299         (JSC::JIT::emit_op_bitxor):
23300         * jit/JITInlineMethods.h:
23301         (JSC::JIT::isOperandConstantImmediateInt):
23302         (JSC::JIT::getOperandConstantImmediateInt):
23303
23304 2009-06-30  Gavin Barraclough  <barraclough@apple.com>
23305
23306         Reviewed by Sam Weinig.
23307
23308         Start removing cases of addressFor().
23309
23310         * jit/JIT.h:
23311         * jit/JITArithmetic.cpp:
23312         (JSC::JIT::emitAdd32Constant):
23313         (JSC::JIT::emitBinaryDoubleOp):
23314         (JSC::JIT::emit_op_div):
23315         * jit/JITInlineMethods.h:
23316         (JSC::JIT::emitLoadDouble):
23317         (JSC::JIT::emitLoadInt32ToDouble):
23318         (JSC::JIT::emitStoreDouble):
23319         * jit/JITOpcodes.cpp:
23320         (JSC::JIT::emit_op_jfalse):
23321         (JSC::JIT::emit_op_jtrue):
23322
23323 2009-06-30  Geoffrey Garen  <ggaren@apple.com>
23324
23325         Rolled back in my last patch with regression fixed.
23326
23327         * jit/JIT.cpp:
23328         (JSC::JIT::privateCompileSlowCases):
23329         * jit/JIT.h:
23330         * jit/JITOpcodes.cpp:
23331         (JSC::JIT::emit_op_loop_if_less):
23332         (JSC::JIT::emit_op_loop_if_lesseq):
23333         (JSC::JIT::emit_op_resolve_global):
23334         (JSC::JIT::emitSlow_op_resolve_global):
23335         (JSC::JIT::emit_op_eq):
23336         (JSC::JIT::emitSlow_op_eq):
23337         (JSC::JIT::emit_op_neq):
23338         (JSC::JIT::emitSlow_op_neq):
23339
23340 2009-06-30  Geoffrey Garen  <ggaren@apple.com>
23341
23342         Rolled out my last patch because it was a 2% SunSpider regression.
23343
23344         * jit/JIT.cpp:
23345         (JSC::JIT::privateCompileSlowCases):
23346         * jit/JIT.h:
23347         * jit/JITOpcodes.cpp:
23348         (JSC::JIT::emit_op_loop_if_less):
23349         (JSC::JIT::emit_op_loop_if_lesseq):
23350         (JSC::JIT::emit_op_resolve_global):
23351         (JSC::JIT::emit_op_eq):
23352         (JSC::JIT::emitSlow_op_eq):
23353         (JSC::JIT::emit_op_neq):
23354         (JSC::JIT::emitSlow_op_neq):
23355
23356 2009-06-30  Geoffrey Garen  <ggaren@apple.com>
23357
23358         Reviewed by Gavin "Sam Weinig" Barraclough.
23359         
23360         Standardized the rest of our opcodes to put { tag, payload } in
23361         { regT1, regT0 } where possible.
23362
23363         * jit/JIT.cpp:
23364         (JSC::JIT::privateCompileSlowCases):
23365         * jit/JIT.h:
23366         * jit/JITOpcodes.cpp:
23367         (JSC::JIT::emit_op_loop_if_less):
23368         (JSC::JIT::emit_op_loop_if_lesseq):
23369         (JSC::JIT::emit_op_resolve_global):
23370         (JSC::JIT::emitSlow_op_resolve_global):
23371         (JSC::JIT::emit_op_eq):
23372         (JSC::JIT::emitSlow_op_eq):
23373         (JSC::JIT::emit_op_neq):
23374         (JSC::JIT::emitSlow_op_neq):
23375
23376 2009-06-30  Gavin Barraclough  <barraclough@apple.com>
23377
23378         Reviewed by Geoffrey Garen.
23379
23380         Replace calls to store32(tagFor()) and store32(payloadFor())
23381         with emitStoreInt32(), emitStoreBool(), and emitStoreCell().
23382
23383         * jit/JIT.h:
23384         * jit/JITArithmetic.cpp:
23385         (JSC::JIT::emit_op_negate):
23386         (JSC::JIT::emit_op_lshift):
23387         (JSC::JIT::emit_op_rshift):
23388         (JSC::JIT::emit_op_bitand):
23389         (JSC::JIT::emitBitAnd32Constant):
23390         (JSC::JIT::emit_op_bitor):
23391         (JSC::JIT::emitBitOr32Constant):
23392         (JSC::JIT::emit_op_bitxor):
23393         (JSC::JIT::emitBitXor32Constant):
23394         (JSC::JIT::emit_op_bitnot):
23395         (JSC::JIT::emit_op_post_inc):
23396         (JSC::JIT::emit_op_post_dec):
23397         (JSC::JIT::emit_op_pre_inc):
23398         (JSC::JIT::emit_op_pre_dec):
23399         (JSC::JIT::emit_op_add):
23400         (JSC::JIT::emitAdd32Constant):
23401         (JSC::JIT::emit_op_sub):
23402         (JSC::JIT::emitSub32ConstantLeft):
23403         (JSC::JIT::emitSub32ConstantRight):
23404         (JSC::JIT::emit_op_mul):
23405         (JSC::JIT::emitSlow_op_mul):
23406         (JSC::JIT::emit_op_div):
23407         (JSC::JIT::emit_op_mod):
23408         * jit/JITCall.cpp:
23409         (JSC::JIT::emit_op_load_varargs):
23410         * jit/JITInlineMethods.h:
23411         (JSC::JIT::emitStoreInt32):
23412         (JSC::JIT::emitStoreCell):
23413         (JSC::JIT::emitStoreBool):
23414         (JSC::JIT::emitStore):
23415         * jit/JITOpcodes.cpp:
23416         (JSC::JIT::emit_op_instanceof):
23417         (JSC::JIT::emit_op_not):
23418         (JSC::JIT::emit_op_eq):
23419         (JSC::JIT::emitSlow_op_eq):
23420         (JSC::JIT::emit_op_neq):
23421         (JSC::JIT::emitSlow_op_neq):
23422         (JSC::JIT::compileOpStrictEq):
23423         (JSC::JIT::emit_op_eq_null):
23424         (JSC::JIT::emit_op_neq_null):
23425         * jit/JITStubCall.h:
23426         (JSC::JITStubCall::call):
23427
23428 2009-06-30  Geoffrey Garen  <ggaren@apple.com>
23429
23430         Reviewed by Sam Weinig.
23431         
23432         Standardized the rest of the property access instructions to put { tag,
23433         payload } in { regT1, regT0 }.
23434
23435         Small v8 speedup, 0.2% SunSpider slowdown.
23436
23437         * jit/JIT.h:
23438         * jit/JITInlineMethods.h:
23439         (JSC::JIT::emitLoad):
23440         (JSC::JIT::emitLoad2):
23441         * jit/JITPropertyAccess.cpp:
23442         (JSC::JIT::emit_op_get_by_val):
23443         (JSC::JIT::emitSlow_op_get_by_val):
23444         (JSC::JIT::emit_op_put_by_val):
23445         (JSC::JIT::emitSlow_op_put_by_val):
23446         (JSC::JIT::emit_op_put_by_id):
23447         (JSC::JIT::emitSlow_op_put_by_id):
23448         (JSC::JIT::patchPutByIdReplace):
23449
23450 2009-06-29  Sam Weinig  <sam@webkit.org>
23451
23452         Reviewed by Gavin Barraclough.
23453
23454         Various cleanups.
23455         - Use fpRegT* instead of X86::xmm*.
23456         - Use a switch statement in emitBinaryDoubleOp instead of a bunch of
23457           if/elses.
23458
23459         * jit/JITArithmetic.cpp:
23460         (JSC::JIT::emitAdd32Constant):
23461         (JSC::JIT::emitBinaryDoubleOp):
23462         (JSC::JIT::emit_op_div):
23463
23464 2009-06-29  Sam Weinig  <sam@webkit.org>
23465
23466         Reviewed by Geoffrey Garen.
23467
23468         Add inline code dealing with doubles for op_jfalse and op_jtrue.
23469
23470         * assembler/MacroAssemblerX86Common.h:
23471         (JSC::MacroAssemblerX86Common::):
23472         (JSC::MacroAssemblerX86Common::zeroDouble):
23473         * jit/JITOpcodes.cpp:
23474         (JSC::JIT::emit_op_jfalse):
23475         (JSC::JIT::emit_op_jtrue):
23476
23477 2009-06-28  Geoffrey Garen  <ggaren@apple.com>
23478
23479         Reviewed by Sam Weinig.
23480
23481         Standardized op_get_by_id to put { tag, payload } in { regT1, regT0 }.
23482         
23483         SunSpider and v8 report maybe 0.2%-0.4% regressions, but the optimization
23484         this enables will win much more than that back.
23485
23486         * jit/JIT.cpp:
23487         (JSC::JIT::privateCompileCTIMachineTrampolines):
23488         * jit/JIT.h:
23489         * jit/JITPropertyAccess.cpp:
23490         (JSC::JIT::emit_op_method_check):
23491         (JSC::JIT::emit_op_get_by_id):
23492         (JSC::JIT::compileGetByIdHotPath):
23493         (JSC::JIT::compileGetByIdSlowCase):
23494         (JSC::JIT::patchGetByIdSelf):
23495         (JSC::JIT::privateCompilePatchGetArrayLength):
23496         (JSC::JIT::privateCompileGetByIdProto):
23497         (JSC::JIT::privateCompileGetByIdSelfList):
23498         (JSC::JIT::privateCompileGetByIdProtoList):
23499         (JSC::JIT::privateCompileGetByIdChainList):
23500         (JSC::JIT::privateCompileGetByIdChain):
23501
23502 2009-06-26  Geoffrey Garen  <ggaren@apple.com>
23503
23504         Reviewed by Maciej Stachowiak.
23505         
23506         Standardized op_call to put { tag, payload } in { regT1, regT0 }.
23507         
23508         SunSpider and v8 report no change.
23509
23510         * jit/JIT.cpp:
23511         (JSC::JIT::privateCompileCTIMachineTrampolines):
23512         * jit/JITCall.cpp:
23513         (JSC::JIT::compileOpCallInitializeCallFrame):
23514         (JSC::JIT::compileOpCallSetupArgs):
23515         (JSC::JIT::compileOpConstructSetupArgs):
23516         (JSC::JIT::compileOpCallVarargsSetupArgs):
23517         (JSC::JIT::compileOpCallVarargs):
23518         (JSC::JIT::compileOpCall):
23519         (JSC::JIT::compileOpCallSlowCase):
23520
23521 2009-06-26  Sam Weinig  <sam@webkit.org>
23522
23523         Reviewed by Geoffrey Garen.
23524
23525         Handle multiplying by zero a little better by
23526         inlining the case that both operands are non-negative
23527         into the slowpath.
23528
23529         * assembler/MacroAssemblerX86Common.h:
23530         (JSC::MacroAssemblerX86Common::branchOr32):
23531         * jit/JITArithmetic.cpp:
23532         (JSC::JIT::emit_op_mul):
23533         (JSC::JIT::emitSlow_op_mul):
23534
23535 2009-06-25  Geoffrey Garen  <ggaren@apple.com>
23536
23537         Reviewed by Sam Weinig.
23538         
23539         Optimize x++ to ++x inside for loops.
23540         
23541         Sadly, no measurable speedup, but this should help with result chaining.
23542
23543         * parser/Nodes.cpp:
23544         (JSC::ForNode::emitBytecode):
23545
23546 2009-06-25  Geoffrey Garen  <ggaren@apple.com>
23547
23548         Reviewed by Sam Weinig.
23549         
23550         Standardized some more opcodes to put { tag, payload } in { regT1, regT0 }.
23551
23552         * jit/JITArithmetic.cpp:
23553         (JSC::JIT::emitSlow_op_bitnot):
23554         (JSC::JIT::emit_op_post_inc):
23555
23556 2009-06-25  Geoffrey Garen  <ggaren@apple.com>
23557
23558         Reviewed by Sam Weinig.
23559         
23560         Standardized some more opcodes to put { tag, payload } in { regT1, regT0 }.
23561
23562         * jit/JITArithmetic.cpp:
23563         (JSC::JIT::emit_op_bitnot):
23564         (JSC::JIT::emit_op_post_dec):
23565         (JSC::JIT::emit_op_pre_inc):
23566         (JSC::JIT::emitSlow_op_pre_inc):
23567         (JSC::JIT::emit_op_pre_dec):
23568         (JSC::JIT::emitSlow_op_pre_dec):
23569
23570 2009-06-25  Geoffrey Garen  <ggaren@apple.com>
23571
23572         Reviewed by Sam Weinig.
23573         
23574         Standardized some more opcodes to put { tag, payload } in { regT1, regT0 }.
23575
23576         * jit/JITArithmetic.cpp:
23577         (JSC::JIT::emit_op_negate):
23578         (JSC::JIT::emitSlow_op_negate):
23579         * jit/JITCall.cpp:
23580         (JSC::JIT::emit_op_construct_verify):
23581         (JSC::JIT::emitSlow_op_construct_verify):
23582
23583 2009-06-25  Geoffrey Garen  <ggaren@apple.com>
23584
23585         Reviewed by Sam Weinig.
23586         
23587         Standardized some more opcodes to put { tag, payload } in { regT1, regT0 }.
23588
23589         * jit/JITOpcodes.cpp:
23590         (JSC::JIT::emit_op_loop_if_true):
23591         (JSC::JIT::emit_op_jfalse):
23592         (JSC::JIT::emit_op_jtrue):
23593         (JSC::JIT::emit_op_jeq_null):
23594         (JSC::JIT::emit_op_jneq_null):
23595         (JSC::JIT::emit_op_eq_null):
23596         (JSC::JIT::emit_op_neq_null):
23597
23598 2009-06-25  Geoffrey Garen  <ggaren@apple.com>
23599
23600         Reviewed by Sam Weinig (sort of, maybe).
23601         
23602         Fixed some ASSERTs in http/tests/security.
23603         
23604         These ASSERTs were introduced by http://trac.webkit.org/changeset/45057,
23605         but the underlying problem was actually older. http://trac.webkit.org/changeset/45057
23606         just exposed the problem by enabling optimization in more cases.
23607         
23608         The ASSERTs fired because we tested PropertySlot::slotBase() for validity,
23609         but slotBase() ASSERTs if it's invalid, so we would ASSERT before
23610         the test could happen. Solution: Remove the ASSERT. Maybe it was valid
23611         once, but it clearly goes against a pattern we've deployed of late.
23612         
23613         The underlying problem was that WebCore would re-use a PropertySlot in
23614         the case of a forwarding access, and the second use would not completely
23615         overwrite the first use. Solution: Make sure to overwrite m_offset when
23616         setting a value on a PropertySlot. (Other values already get implicitly
23617         overwritten during reuse.)
23618
23619         * runtime/PropertySlot.h:
23620         (JSC::PropertySlot::PropertySlot):
23621         (JSC::PropertySlot::setValueSlot):
23622         (JSC::PropertySlot::setValue):
23623         (JSC::PropertySlot::setRegisterSlot):
23624         (JSC::PropertySlot::setUndefined):
23625         (JSC::PropertySlot::slotBase):
23626         (JSC::PropertySlot::clearOffset):
23627
23628 2009-06-24  Gavin Barraclough  <barraclough@apple.com>
23629
23630         Reviewed by Geoff Garen.
23631
23632         Enable JIT_OPTIMIZE_METHOD_CALLS on the branch, implementation matches current implemenatation in ToT.
23633
23634         * jit/JIT.h:
23635         * jit/JITPropertyAccess.cpp:
23636         (JSC::JIT::emit_op_method_check):
23637         (JSC::JIT::emitSlow_op_method_check):
23638         (JSC::JIT::emit_op_get_by_id):
23639         (JSC::JIT::compileGetByIdHotPath):
23640         (JSC::JIT::emitSlow_op_get_by_id):
23641         (JSC::JIT::compileGetByIdSlowCase):
23642
23643 2009-06-23  Geoffrey Garen  <ggaren@apple.com>
23644
23645         Reviewed by Sam Weinig.
23646
23647         Bit off a tiny bit more of standardizing opcode behavior to help with result
23648         caching.
23649         
23650         SunSpider reports no change, v8 maybe a tiny speedup.
23651
23652         * jit/JITOpcodes.cpp:
23653         (JSC::JIT::emit_op_to_jsnumber):
23654         (JSC::JIT::emitSlow_op_to_jsnumber):
23655         (JSC::JIT::emit_op_convert_this):
23656         (JSC::JIT::emitSlow_op_convert_this):
23657
23658 2009-06-23  Geoffrey Garen  <ggaren@apple.com>
23659
23660         Reviewed by Sam Weinig.
23661
23662         Bit off a tiny bit more of standardizing opcode behavior to help with result
23663         caching -- including removing my old enemy, op_resolve_function, because
23664         it was non-standard, and removing it felt better than helping it limp along.
23665         
23666         SunSpider reports no change, v8 maybe a tiny speedup.
23667         
23668         * bytecode/CodeBlock.cpp:
23669         (JSC::CodeBlock::dump):
23670         * bytecode/Opcode.h:
23671         * bytecompiler/BytecodeGenerator.cpp:
23672         * bytecompiler/BytecodeGenerator.h:
23673         * interpreter/Interpreter.cpp:
23674         (JSC::Interpreter::privateExecute):
23675         * jit/JIT.cpp:
23676         (JSC::JIT::privateCompileMainPass):
23677         * jit/JIT.h:
23678         * jit/JITOpcodes.cpp:
23679         (JSC::JIT::emit_op_get_scoped_var):
23680         (JSC::JIT::emit_op_put_scoped_var):
23681         (JSC::JIT::emit_op_to_primitive):
23682         (JSC::JIT::emitSlow_op_to_primitive):
23683         * jit/JITStubs.cpp:
23684         * jit/JITStubs.h:
23685         * parser/Nodes.cpp:
23686         (JSC::FunctionCallResolveNode::emitBytecode):
23687
23688 2009-06-23  Geoffrey Garen  <ggaren@apple.com>
23689
23690         Reviewed by Sam Weinig.
23691         
23692         Bit off a tiny bit of standardizing opcode behavior to help with result
23693         caching.
23694         
23695         0.6% SunSpider speedup. 0.3% v8 speedup.
23696
23697         * jit/JITInlineMethods.h:
23698         (JSC::JIT::emitLoad): Accomodate a base register that overlaps with payload
23699         by loading tag before payload, to avoid stomping base/payload.
23700
23701         * jit/JITOpcodes.cpp:
23702         (JSC::JIT::emit_op_mov): Abide by the standard "tag in regT1, payload in
23703         regT0" semantics.
23704
23705         (JSC::JIT::emit_op_get_global_var):
23706         (JSC::JIT::emit_op_put_global_var): Ditto. Also, removed some irrelevent
23707         loads while I was at it. The global object's "d" pointer never changes
23708         after construction.
23709
23710 2009-06-23  Gavin Barraclough  <barraclough@apple.com>
23711
23712         Reviewed by Sam Weinig.
23713
23714         Remove 'arguments' field from Register union (again).
23715         This time do so without breaking tests (radical, I know).
23716
23717         * interpreter/CallFrame.h:
23718         (JSC::ExecState::optionalCalleeArguments):
23719         (JSC::ExecState::setArgumentCount):
23720         (JSC::ExecState::init):
23721         * interpreter/Interpreter.cpp:
23722         (JSC::Interpreter::dumpRegisters):
23723         (JSC::Interpreter::unwindCallFrame):
23724         (JSC::Interpreter::privateExecute):
23725         (JSC::Interpreter::retrieveArguments):
23726         * interpreter/Register.h:
23727         (JSC::Register::withInt):
23728         (JSC::Register::):
23729         (JSC::Register::Register):
23730         (JSC::Register::i):
23731         * jit/JITStubs.cpp:
23732         (JSC::JITStubs::cti_op_tear_off_arguments):
23733         * runtime/Arguments.h:
23734         (JSC::JSActivation::copyRegisters):
23735         (JSC::Register::arguments):
23736         * runtime/JSActivation.cpp:
23737         (JSC::JSActivation::argumentsGetter):
23738         * runtime/JSActivation.h:
23739
23740 2009-06-23  Geoffrey Garen  <ggaren@apple.com>
23741
23742         Reviewed by Sam Weinig.
23743         
23744         Removed some result register tracking cruft in preparation for a new
23745         result tracking mechanism.
23746         
23747         SunSpider reports no change.
23748
23749         * assembler/AbstractMacroAssembler.h:
23750         * assembler/X86Assembler.h:
23751         (JSC::X86Assembler::JmpDst::JmpDst): No need to track jump targets in
23752         machine code; we already do this in bytecode.
23753
23754         * jit/JIT.cpp:
23755         (JSC::JIT::JIT):
23756         (JSC::JIT::emitTimeoutCheck): Make sure to save and restore the result
23757         registers, so an opcode with a timeout check can still benefit from result
23758         register caching.
23759
23760         (JSC::JIT::privateCompileMainPass):
23761         (JSC::JIT::privateCompileSlowCases): Removed calls to killLastResultRegister()
23762         in preparation for something new.
23763
23764         * jit/JIT.h:
23765         * jit/JITArithmetic.cpp:
23766         (JSC::JIT::emit_op_jnless):
23767         (JSC::JIT::emit_op_jnlesseq):
23768         * jit/JITInlineMethods.h:
23769         (JSC::JIT::emitGetFromCallFrameHeaderPtr):
23770         (JSC::JIT::emitGetFromCallFrameHeader32):
23771         * jit/JITOpcodes.cpp:
23772         (JSC::JIT::emit_op_jmp):
23773         (JSC::JIT::emit_op_jfalse):
23774         (JSC::JIT::emit_op_jtrue):
23775         (JSC::JIT::emit_op_jeq_null):
23776         (JSC::JIT::emit_op_jneq_null):
23777         (JSC::JIT::emit_op_jneq_ptr):
23778         (JSC::JIT::emit_op_jsr):
23779         (JSC::JIT::emit_op_sret):
23780         (JSC::JIT::emit_op_jmp_scopes): ditto
23781
23782         * jit/JITStubCall.h:
23783         (JSC::JITStubCall::JITStubCall):
23784         (JSC::JITStubCall::getArgument): added a mechanism for reloading an argument
23785         you passed to a JIT stub, for use in emitTimeoutCheck.
23786
23787 2009-06-23  Sam Weinig  <sam@webkit.org>
23788
23789         Reviewed by Geoffrey Garen.
23790
23791         Remove now-useless inplace variants of binary ops.
23792
23793         * jit/JIT.h:
23794         * jit/JITArithmetic.cpp:
23795         (JSC::JIT::emit_op_bitand):
23796         (JSC::JIT::emit_op_bitor):
23797         (JSC::JIT::emit_op_bitxor):
23798         (JSC::JIT::emit_op_add):
23799         (JSC::JIT::emit_op_sub):
23800         (JSC::JIT::emit_op_mul):
23801
23802 2009-06-23  Sam Weinig  <sam@webkit.org>
23803
23804         Reviewed by Geoffrey Garen.
23805
23806         Move off memory operands to aid in re-enabling result caching.
23807
23808         - No regression measured.
23809
23810         * jit/JIT.h:
23811         * jit/JITArithmetic.cpp:
23812         (JSC::JIT::emit_op_negate):
23813         (JSC::JIT::emit_op_jnless):
23814         (JSC::JIT::emit_op_jnlesseq):
23815         (JSC::JIT::emit_op_lshift):
23816         (JSC::JIT::emit_op_rshift):
23817         (JSC::JIT::emit_op_bitand):
23818         (JSC::JIT::emitBitAnd32Constant):
23819         (JSC::JIT::emitBitAnd32InPlace):
23820         (JSC::JIT::emit_op_bitor):
23821         (JSC::JIT::emitBitOr32Constant):
23822         (JSC::JIT::emitBitOr32InPlace):
23823         (JSC::JIT::emit_op_bitxor):
23824         (JSC::JIT::emitBitXor32Constant):
23825         (JSC::JIT::emitBitXor32InPlace):
23826         (JSC::JIT::emit_op_bitnot):
23827         (JSC::JIT::emit_op_post_inc):
23828         (JSC::JIT::emit_op_post_dec):
23829         (JSC::JIT::emit_op_pre_inc):
23830         (JSC::JIT::emitSlow_op_pre_inc):
23831         (JSC::JIT::emit_op_pre_dec):
23832         (JSC::JIT::emitSlow_op_pre_dec):
23833         (JSC::JIT::emit_op_add):
23834         (JSC::JIT::emitAdd32Constant):
23835         (JSC::JIT::emitAdd32InPlace):
23836         (JSC::JIT::emitSlow_op_add):
23837         (JSC::JIT::emitSlowAdd32Constant):
23838         (JSC::JIT::emit_op_sub):
23839         (JSC::JIT::emitSlow_op_sub):
23840         (JSC::JIT::emitSub32ConstantLeft):
23841         (JSC::JIT::emitSub32ConstantRight):
23842         (JSC::JIT::emitSub32InPlaceLeft):
23843         (JSC::JIT::emitSub32InPlaceRight):
23844         (JSC::JIT::emitBinaryDoubleOp):
23845         (JSC::JIT::emit_op_mul):
23846         (JSC::JIT::emitMul32InPlace):
23847         (JSC::JIT::emit_op_div):
23848         (JSC::JIT::emit_op_mod):
23849         * jit/JITCall.cpp:
23850         (JSC::JIT::compileOpCallVarargs):
23851         * jit/JITOpcodes.cpp:
23852         (JSC::JIT::emit_op_loop_if_less):
23853         (JSC::JIT::emit_op_loop_if_lesseq):
23854         (JSC::JIT::emit_op_instanceof):
23855         (JSC::JIT::emit_op_to_primitive):
23856         (JSC::JIT::emit_op_not):
23857         (JSC::JIT::emit_op_jneq_ptr):
23858         (JSC::JIT::emit_op_eq):
23859         (JSC::JIT::emit_op_neq):
23860         (JSC::JIT::emit_op_to_jsnumber):
23861         * jit/JITPropertyAccess.cpp:
23862         (JSC::JIT::emit_op_get_by_val):
23863         (JSC::JIT::emit_op_put_by_val):
23864
23865 2009-06-23  Geoffrey Garen  <ggaren@apple.com>
23866
23867         Reviewed by Sam Weinig.
23868         
23869         Fixed some missing and/or misplaced labels in bytecode generation, so
23870         we don't have to work around them in JIT code generation.
23871
23872         * bytecompiler/BytecodeGenerator.cpp:
23873         (JSC::BytecodeGenerator::emitJumpSubroutine):
23874         * parser/Nodes.cpp:
23875         (JSC::TryNode::emitBytecode):
23876
23877 2009-06-22  Geoffrey Garen  <ggaren@apple.com>
23878
23879         Reviewed by Sam Weinig.
23880         
23881         For member function calls, emit "this" directly into the "this" slot
23882         for the function call, instead of moving it there later. This reduces
23883         time spent in op_mov during certain calls, like "a.b.c()".
23884         
23885         1%-2% speedup on v8, mostly richards and delta-blue.
23886
23887         * parser/Nodes.cpp:
23888         (JSC::FunctionCallDotNode::emitBytecode):
23889
23890 2009-06-22  Gavin Barraclough  <barraclough@apple.com>
23891
23892         Reviewed by Sam Weinig.
23893
23894         Remove 'arguments' field from Register union.  Having JSCell derived types in the union is
23895         dangerous since it opens the possibility for the field to be written as a raw pointer but
23896         then read as a JSValue.  This will lead to statle data being read for the tag, which may
23897         be dangerous.  Having removed Arguments* types form Register, all arguments objects must
23898         always explicitly be stored in the register file as JSValues.
23899
23900         * interpreter/CallFrame.h:
23901         (JSC::ExecState::optionalCalleeArguments):
23902         * interpreter/Interpreter.cpp:
23903         (JSC::Interpreter::unwindCallFrame):
23904         (JSC::Interpreter::privateExecute):
23905         (JSC::Interpreter::retrieveArguments):
23906         * interpreter/Register.h:
23907         (JSC::Register::):
23908         * jit/JITStubs.cpp:
23909         (JSC::JITStubs::cti_op_tear_off_arguments):
23910         * runtime/Arguments.h:
23911         (JSC::JSActivation::copyRegisters):
23912         * runtime/JSActivation.cpp:
23913         (JSC::JSActivation::argumentsGetter):
23914         * runtime/JSActivation.h:
23915
23916 2009-06-03  Sam Weinig  <sam@webkit.org>
23917
23918         Reviewed by Geoffrey Garen.
23919
23920         Add back known this value optimization by abstracting
23921         slow case if not JSCell jumps.
23922
23923         * jit/JIT.h:
23924         * jit/JITCall.cpp:
23925         (JSC::JIT::compileOpCallVarargs):
23926         (JSC::JIT::compileOpCallVarargsSlowCase):
23927         (JSC::JIT::compileOpCall):
23928         (JSC::JIT::compileOpCallSlowCase):
23929         * jit/JITInlineMethods.h:
23930         (JSC::JIT::emitJumpSlowCaseIfNotJSCell):
23931         (JSC::JIT::linkSlowCaseIfNotJSCell):
23932         * jit/JITOpcodes.cpp:
23933         (JSC::JIT::emit_op_instanceof):
23934         (JSC::JIT::emitSlow_op_instanceof):
23935         * jit/JITPropertyAccess.cpp:
23936         (JSC::JIT::emit_op_get_by_val):
23937         (JSC::JIT::emitSlow_op_get_by_val):
23938         (JSC::JIT::emit_op_put_by_val):
23939         (JSC::JIT::emitSlow_op_put_by_val):
23940         (JSC::JIT::emit_op_get_by_id):
23941         (JSC::JIT::emitSlow_op_get_by_id):
23942         (JSC::JIT::emit_op_put_by_id):
23943         (JSC::JIT::emitSlow_op_put_by_id):
23944
23945 2009-06-01  Geoffrey Garen  <ggaren@apple.com>
23946
23947         Reviewed by Sam Weinig.
23948         
23949         Fixed some of the regression in crypto-aes.js. (8.5% speedup in
23950         crypto-aes.js.)
23951         
23952         SunSpider reports no change overall.
23953         
23954         Division was producing double results, which took the slow path through
23955         array access code.
23956         
23957         Strangely, all my attempts at versions of this patch that modified array
23958         access code to accept ints encoded as doubles along the fast or slow paths
23959         were regressions. So I did this instead.
23960
23961         * jit/JITArithmetic.cpp:
23962         (JSC::JIT::emit_op_div): When dividing an int by an int, go ahead and try
23963         to turn the result into an int. Don't just do int division, though, because
23964         testing shows it to be slower than SSE double division, and the corner
23965         cases are pretty complicated / lengthy on top of that. Also, don't try
23966         to canonicalize division of known tiny numerators into ints, since that's a
23967         waste of time.
23968
23969 2009-05-26  Geoffrey Garen  <ggaren@apple.com>
23970
23971         Reviewed by Oliver Hunt.
23972         
23973         Fixed a regression caused by my recent fix for NaN.
23974
23975         * jit/JITArithmetic.cpp:
23976         (JSC::JIT::emitBinaryDoubleOp): Actually do the comparison in reverse
23977         order, like the ChangeLog said we would, bokay?
23978
23979 2009-05-26  Geoffrey Garen  <ggaren@apple.com>
23980
23981         Reviewed by Sam Weinig and Oliver Hunt.
23982         
23983         Fixed two edge cases in %:
23984         
23985         - Don't do -2147483648 % x as a fast case, since you might do -2147483648 % -1,
23986         which will signal a hardware exception due to overflow.
23987
23988         - In the case of a zero remainder, be sure to store negative zero if the
23989         dividend was zero.
23990         
23991         SunSpider reports no change.
23992
23993         * jit/JITArithmetic.cpp:
23994         (JSC::JIT::emit_op_mod):
23995         (JSC::JIT::emitSlow_op_mod):
23996
23997 2009-05-25  Geoffrey Garen  <ggaren@apple.com>
23998
23999         Reviewed by Maciej Stachowiak.
24000         
24001         Fixed a regression when comparing to NaN.
24002
24003         * jit/JITArithmetic.cpp:
24004         (JSC::JIT::emitBinaryDoubleOp): For op_jnless and op_jnless_eq, do the
24005         comparison in reverse order, and jump if the result is below or 
24006         below-or-equal. This ensures that we do jump in the case of NaN.
24007
24008 2009-05-25  Geoffrey Garen  <ggaren@apple.com>
24009
24010         Reviewed by Oliver Hunt.
24011         
24012         SunSpider says no change.
24013         
24014         Fixed regressions in fast/js/var-declarations-shadowing.html and
24015         fast/js/equality.html, caused by recent == and != optimizations.
24016
24017         * jit/JITStubs.cpp:
24018         (JSC::JITStubs::cti_op_eq): Don't treat "compare to string" as always
24019         numeric or string comparison. If the second operand is an object, you
24020         need to ToPrimitive it, and start all over again. Also, I wrote out each
24021         of the possible cases explicitly, to cut down on redundant branching.
24022
24023 2009-05-25  Sam Weinig  <sam@webkit.org>
24024
24025         Reviewed by Mark Rowe.
24026
24027         Fix bug in fast/js/constant-folding.html where we were not negating
24028         -0 properly.
24029
24030         * jit/JITArithmetic.cpp:
24031         (JSC::JIT::emit_op_negate):
24032
24033 2009-05-23  Geoffrey Garen  <ggaren@apple.com>
24034
24035         Reviewed by Oliver Hunt.
24036         
24037         Refactored new slow case codegen for == and !=.
24038         
24039         SunSpider reports no change, maybe a tiny speedup.
24040
24041         * jit/JITOpcodes.cpp:
24042         (JSC::JIT::emitSlow_op_eq):
24043         (JSC::JIT::emitSlow_op_neq): Made a vptr comparison a *Ptr operation,
24044         instead of *32, to make it portable to 64bit. Reorganized the string
24045         and generic cases to make their control flow a little clearer.
24046
24047 2009-05-23  Geoffrey Garen  <ggaren@apple.com>
24048
24049         Reviewed by Maciej Stachowiak.
24050         
24051         Optimized == and != for our new value representation -- especially for strings.
24052         
24053         14% speedup on date-format-tofte.
24054
24055         * jit/JITOpcodes.cpp:
24056         (JSC::JIT::emit_op_eq):
24057         (JSC::JIT::emitSlow_op_eq):
24058         (JSC::JIT::emit_op_neq):
24059         (JSC::JIT::emitSlow_op_neq):
24060         * jit/JITStubCall.h:
24061         (JSC::JITStubCall::JITStubCall):
24062         * jit/JITStubs.cpp:
24063         (JSC::JITStubs::cti_op_eq):
24064         (JSC::JITStubs::cti_op_eq_strings):
24065         (JSC::JITStubs::cti_op_call_eval):
24066         * jit/JITStubs.h:
24067         (JSC::):
24068         * runtime/JSValue.h:
24069
24070 2009-05-22  Sam Weinig  <sam@webkit.org>
24071
24072         Reviewed by Gavin Barraclough.
24073
24074         Fix non-SSE enabled builds.
24075
24076         * jit/JITArithmetic.cpp:
24077         (JSC::JIT::emitSlow_op_add): Don't early return here, we still need to call the JIT stub.
24078         (JSC::JIT::emitSlow_op_sub): Ditto.
24079
24080 2009-05-22  Geoffrey Garen  <ggaren@apple.com>
24081
24082         Reviewed by Sam Weinig.
24083         
24084         Here's a thought: let's not take a jit stub call just to multiply by 1,
24085         bokay?
24086         
24087         imul doesn't set the zero flag, so to test for a zero result, we need
24088         an explicit instruction. (Luckily, it does set the overflow flag, so
24089         we can still use that.)
24090
24091         * jit/JIT.h:
24092         * jit/JITArithmetic.cpp:
24093         (JSC::JIT::emit_op_mul):
24094         (JSC::JIT::emitSlow_op_mul):
24095         (JSC::JIT::emitMul32InPlace):
24096
24097 2009-05-22  Sam Weinig  <sam@webkit.org>
24098
24099         Reviewed by Geoffrey "Premature Commit" Garen.
24100
24101         Add back constant integer cases for op_add.
24102
24103         * jit/JIT.h:
24104         * jit/JITArithmetic.cpp:
24105         (JSC::JIT::emit_op_add):
24106         (JSC::JIT::emitAdd32Constant):
24107         (JSC::JIT::emitSlow_op_add):
24108         (JSC::JIT::emitSlowAdd32Constant):
24109         * jit/JITInlineMethods.h:
24110         (JSC::JIT::getConstantOperandImmediateDouble):
24111         (JSC::JIT::isOperandConstantImmediateDouble):
24112
24113 2009-05-22  Geoffrey Garen  <ggaren@apple.com>
24114
24115         Reviewed by Sam Weinig.
24116         
24117         Added fast double cases for op_jnless and op_jnlesseq.
24118
24119         * assembler/AbstractMacroAssembler.h:
24120         (JSC::AbstractMacroAssembler::JumpList::jumps): New accesor, used by
24121         addSlowCase.
24122
24123         * assembler/X86Assembler.h:
24124         (JSC::X86Assembler::ucomisd_rm): New method for comparing register to
24125         memory.
24126
24127         * jit/JIT.h:
24128         * jit/JITArithmetic.cpp:
24129         (JSC::JIT::emit_op_jnless):
24130         (JSC::JIT::emitSlow_op_jnless):
24131         (JSC::JIT::emit_op_jnlesseq):
24132         (JSC::JIT::emitSlow_op_jnlesseq):
24133         (JSC::JIT::emit_op_add):
24134         (JSC::JIT::emit_op_sub):
24135         (JSC::JIT::emitBinaryDoubleOp):
24136         (JSC::JIT::emit_op_mul):
24137         (JSC::JIT::emit_op_div): Modified emitBinaryDoubleOp to accept comparison/jump
24138         operations in addition to operations with explicit result registers.
24139
24140         * jit/JITInlineMethods.h:
24141         (JSC::JIT::addSlowCase): Added an "addSlowCase" for JumpLists, so clients
24142         can track multiple jumps to the same slow case condition together.
24143
24144 2009-05-21  Sam Weinig  <sam@webkit.org>
24145
24146         Reviewed by Gavin Barraclough.
24147
24148         Implement op_negate inline fast cases.
24149
24150         * assembler/MacroAssemblerX86Common.h:
24151         (JSC::MacroAssemblerX86Common::neg32):
24152         * assembler/X86Assembler.h:
24153         (JSC::X86Assembler::):
24154         (JSC::X86Assembler::negl_m):
24155         (JSC::X86Assembler::xorpd_rr):
24156         * jit/JIT.cpp:
24157         (JSC::JIT::privateCompileMainPass):
24158         (JSC::JIT::privateCompileSlowCases):
24159         * jit/JIT.h:
24160         * jit/JITArithmetic.cpp:
24161         (JSC::JIT::emit_op_negate):
24162         (JSC::JIT::emitSlow_op_negate):
24163
24164 2009-05-20  Sam Weinig  <sam@webkit.org>
24165
24166         Reviewed by Gavin Barraclough.
24167
24168         Update the patchOffsetGetByIdSlowCaseCall constant for the
24169         case that OPCODE_SAMPLING is enabled.
24170
24171         * jit/JIT.h:
24172
24173 2009-05-20  Geoffrey Garen  <ggaren@apple.com>
24174
24175         Reviewed by Sam Weinig.
24176
24177         Added support for inline subtraction of doubles.
24178
24179         * jit/JITArithmetic.cpp:
24180         (JSC::JIT::emit_op_sub):
24181         (JSC::JIT::emitSlow_op_sub):
24182         (JSC::JIT::emitSlowSub32InPlaceLeft):
24183         (JSC::JIT::emitBinaryDoubleOp):
24184
24185 2009-05-20  Sam Weinig  <sam@webkit.org>
24186
24187         Reviewed by Geoffrey Garen.
24188
24189         Added support for inline division.
24190
24191         * assembler/X86Assembler.h:
24192         (JSC::X86Assembler::):
24193         (JSC::X86Assembler::divsd_rr):
24194         (JSC::X86Assembler::divsd_mr):
24195         * bytecode/CodeBlock.cpp:
24196         (JSC::CodeBlock::dump):
24197         * bytecode/Opcode.h:
24198         * bytecompiler/BytecodeGenerator.cpp:
24199         (JSC::BytecodeGenerator::emitBinaryOp):
24200         * interpreter/Interpreter.cpp:
24201         (JSC::Interpreter::privateExecute):
24202         * jit/JIT.cpp:
24203         (JSC::JIT::privateCompileMainPass):
24204         (JSC::JIT::privateCompileSlowCases):
24205         * jit/JIT.h:
24206         * jit/JITArithmetic.cpp:
24207         (JSC::JIT::emitBinaryDoubleOp):
24208         (JSC::JIT::emit_op_div):
24209         (JSC::JIT::emitSlow_op_div):
24210
24211 2009-05-20  Geoffrey Garen  <ggaren@apple.com>
24212
24213         Reviewed by Sam Weinig.
24214
24215         Added support for inline addition of doubles.
24216
24217         * jit/JITArithmetic.cpp:
24218         (JSC::JIT::emit_op_add):
24219         (JSC::JIT::emitSlow_op_add):
24220         (JSC::JIT::emitSlowAdd32InPlace):
24221         (JSC::JIT::emitBinaryDoubleOp):
24222         (JSC::JIT::emit_op_mul):
24223         (JSC::JIT::emitSlow_op_mul):
24224
24225 2009-05-20  Geoffrey Garen  <ggaren@apple.com>
24226
24227         Reviewed by Sam Weinig.
24228         
24229         Factored inline double operations into a helper function, so that we
24230         can reuse this code for other math operations.
24231
24232         * jit/JIT.h:
24233         * jit/JITArithmetic.cpp:
24234         (JSC::JIT::emitBinaryDoubleOp):
24235         (JSC::JIT::emit_op_mul):
24236         * jit/JITCall.cpp:
24237         (JSC::JIT::compileOpCallInitializeCallFrame):
24238
24239 2009-05-20  Geoffrey Garen  <ggaren@apple.com>
24240
24241         Reviewed by Sam Weinig.
24242         
24243         Added support for inline multiplication of doubles.
24244
24245         * assembler/X86Assembler.h:
24246         (JSC::X86Assembler::cvtsi2sd_mr): New function, useful for loading an
24247         int32 into a double register.
24248
24249         * jit/JITArithmetic.cpp:
24250         (JSC::JIT::emit_op_mul):
24251         (JSC::JIT::emitSlow_op_mul): Filled out these cases for double arithmetic.
24252
24253         * jit/JIT.h:
24254         * jit/JITInlineMethods.h:
24255         (JSC::JIT::addressFor): New function, useful for addressing a JSValue's
24256         full 64bits as a double.
24257
24258 2009-05-19  Sam Weinig  <sam@webkit.org>
24259
24260         Reviewed by Geoffrey Garen.
24261
24262         Implement and enable optimized calls.
24263
24264         * jit/JIT.cpp:
24265         (JSC::JIT::privateCompileCTIMachineTrampolines): Add ENABLE(JIT_OPTIMIZE_CALL) guards
24266         around the the optimize call only trampolines (virtualCallPreLink and virtualCallLink).
24267         Update the trampolines to account for the new JSValue representation.
24268         (JSC::JIT::unlinkCall): Use NULL instead of JSValue noValue. 
24269
24270         * jit/JITCall.cpp:
24271         (JSC::JIT::compileOpCall): Update to account for the new JSValue representation
24272         (JSC::JIT::compileOpCallSlowCase): Ditto.
24273
24274         * jit/JITStubs.h: Remove incorrect !ENABLE(JIT_OPTIMIZE_CALL) guard.
24275
24276         * wtf/Platform.h: Enable ENABLE_JIT_OPTIMIZE_CALL.
24277
24278 2009-05-19  Sam Weinig  <sam@webkit.org>
24279
24280         Reviewed by Geoffrey Garen.
24281
24282         Implement and enable optimized property access.
24283
24284         * assembler/AbstractMacroAssembler.h: Fix comment.
24285         * jit/JIT.cpp:
24286         (JSC::JIT::privateCompileCTIMachineTrampolines): Remove array length trampoline
24287         and implement the string length trampoline.
24288         * jit/JIT.h: Add new constants for patch offsets.
24289         * jit/JITInlineMethods.h: Remove FIELD_OFFSET which is now in StdLibExtras.h.
24290         * jit/JITPropertyAccess.cpp: 
24291         (JSC::JIT::emit_op_get_by_id):
24292         (JSC::JIT::emitSlow_op_get_by_id):
24293         (JSC::JIT::emit_op_put_by_id):
24294         (JSC::JIT::emitSlow_op_put_by_id):
24295         (JSC::JIT::compilePutDirectOffset):
24296         (JSC::JIT::compileGetDirectOffset):
24297         (JSC::JIT::privateCompilePutByIdTransition):
24298         (JSC::JIT::patchGetByIdSelf):
24299         (JSC::JIT::patchPutByIdReplace):
24300         (JSC::JIT::privateCompilePatchGetArrayLength):
24301         (JSC::JIT::privateCompileGetByIdProto):
24302         (JSC::JIT::privateCompileGetByIdSelfList):
24303         (JSC::JIT::privateCompileGetByIdProtoList):
24304         (JSC::JIT::privateCompileGetByIdChainList):
24305         (JSC::JIT::privateCompileGetByIdChain):
24306         * jit/JITStubCall.h:
24307         (JSC::JITStubCall::addArgument): Add version of addArgument that takes
24308         two registers for the tag and payload.
24309         * jit/JITStubs.cpp:
24310         (JSC::JITStubs::JITStubs): Remove array length trampoline pointer.
24311         (JSC::JITStubs::cti_op_get_by_id_self_fail): 
24312         * jit/JITStubs.h:
24313         * runtime/JSObject.h:
24314         (JSC::JSObject::JSObject): Move m_inheritorID below the property storage
24315         to align it to a 16 byte boundary.
24316         * wtf/Platform.h: Enable ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS
24317         * wtf/StdLibExtras.h: Move FIELD_OFFSET here.
24318
24319 2009-05-17  Sam Weinig  <sam@webkit.org>
24320
24321         Reviewed by Geoffrey Garen.
24322
24323         Remove unneeded ExecState parameter from the number JSValue constructors.
24324
24325         * runtime/JSValue.h:
24326         (JSC::jsNumber):
24327         (JSC::jsNaN):
24328         (JSC::JSValue::JSValue):
24329
24330 2009-05-15  Sam Weinig  <sam@webkit.org>
24331
24332         Reviewed by Geoffrey Garen.
24333
24334         Implemented fast path for op_put_by_val when putting to arrays.
24335
24336         * jit/JITPropertyAccess.cpp:
24337         (JSC::JIT::emit_op_put_by_val):
24338         (JSC::JIT::emitSlow_op_put_by_val):
24339
24340 2009-05-15  Geoffrey Garen  <ggaren@apple.com> (Mostly by Sam)
24341
24342         Reviewed by Sam Weinig.
24343         
24344         Implemented fast path for op_get_by_val when accessing array.
24345
24346         * jit/JIT.cpp:
24347         * jit/JITPropertyAccess.cpp:
24348         (JSC::JIT::emit_op_get_by_val):
24349         (JSC::JIT::emitSlow_op_get_by_val):
24350
24351 2009-05-14  Geoffrey Garen  <ggaren@apple.com>
24352
24353         Reviewed by Sam Weinig.
24354         
24355         Fixed a failure in fast/js/math-transforms.html caused by failing to
24356         preserve -0 in multiplication.
24357
24358         * assembler/X86Assembler.h:
24359         (JSC::X86Assembler::jz):
24360         * jit/JITArithmetic.cpp:
24361         (JSC::JIT::emit_op_mul):
24362         (JSC::JIT::emitSlow_op_mul):
24363         (JSC::JIT::emitMul32Constant):
24364         (JSC::JIT::emitMul32InPlace): Check both for overflow and for zero when
24365         doing multiplication. Use a slow case to get these right.
24366
24367 2009-05-14  Geoffrey Garen  <ggaren@apple.com>
24368
24369         Reviewed by Sam Weinig.
24370         
24371         Fixed a bug in the varargs calling convention.
24372
24373         * jit/JITCall.cpp:
24374         (JSC::JIT::compileOpCallVarargs): Move the argument count into regT1,
24375         since that's where ctiVirtualCall expects it to be.
24376
24377 2009-05-14  Geoffrey Garen  <ggaren@apple.com>
24378
24379         Reviewed by Sam Weinig.
24380
24381         Fixed a small bug in instanceof's looping code.
24382
24383         * jit/JITOpcodes.cpp:
24384         (JSC::JIT::emit_op_instanceof): NULL means the object has no prototype,
24385         so only loop when *not* equal to NULL.
24386
24387 2009-05-14  Geoffrey Garen  <ggaren@apple.com>
24388
24389         Reviewed by Sam Weinig.
24390         
24391         Fixed a small bug in instanceof's result writing code.
24392
24393         * jit/JITOpcodes.cpp:
24394         (JSC::JIT::emit_op_instanceof): Make sure to fill out the payload bits
24395         in all cases.
24396
24397 2009-05-14  Sam Weinig  <sam@webkit.org>
24398
24399         Reviewed by Geoffrey Garen.
24400
24401         Removed an invalid assertion in cti_op_urshift which
24402         depended on a fast path for op_urshift which has
24403         never existed.
24404
24405         * jit/JITStubs.cpp:
24406         (JSC::JITStubs::cti_op_urshift):
24407
24408 2009-05-14  Geoffrey Garen  <ggaren@apple.com>
24409
24410         Reviewed by Sam Weinig.
24411         
24412         Fixed loop_if_true, which had the same reversed test that jtrue had.
24413
24414         * jit/JITOpcodes.cpp:
24415         (JSC::JIT::emit_op_loop_if_true):
24416
24417 2009-05-14  Sam Weinig  <sam@webkit.org>
24418
24419         Reviewed by Geoffrey Garen.
24420
24421         In op_neq, we apparently want to check that one value
24422         does *not* equal another.  Go figure.
24423
24424         * jit/JITOpcodes.cpp:
24425         (JSC::JIT::emit_op_neq):
24426
24427 2009-05-14  Sam Weinig  <sam@webkit.org>
24428
24429         Reviewed by Geoffrey Garen.
24430
24431         The slow case of op_mod should call op_mod's jit stub,
24432         not op_mul.  That would be dumb.
24433
24434         * jit/JITArithmetic.cpp:
24435         (JSC::JIT::emitSlow_op_mod):
24436
24437 2009-05-14  Geoffrey Garen  <ggaren@apple.com>
24438
24439         Reviewed by Sam Weinig.
24440         
24441         Fixed problems when using 'arguments' due to a half-initialized register.
24442
24443         * interpreter/CallFrame.h:
24444         (JSC::ExecState::setCalleeArguments):
24445         (JSC::ExecState::init): Require a full JSValue when setting up the 
24446         'arguments' virtual register, since this register is accessible from JIT
24447         code and bytecode, and needs to be a true JSValue.
24448
24449         * interpreter/CallFrameClosure.h:
24450         (JSC::CallFrameClosure::resetCallFrame): ditto
24451
24452         * interpreter/Interpreter.cpp:
24453         (JSC::Interpreter::privateExecute): ditto
24454
24455         * interpreter/Register.h: Removed the constructor that allowed assignment
24456         of a JSArguments* to a register. That is not safe. See above.
24457
24458         * jit/JITStubs.cpp:
24459         (JSC::JITStubs::cti_op_create_arguments):
24460         (JSC::JITStubs::cti_op_create_arguments_no_params): ditto
24461
24462 2009-05-14  Sam Weinig  <sam@webkit.org>
24463
24464         Reviewed by Geoffrey Garen.
24465
24466         We really want to go to the slow case in op_jfalse and
24467         op_jtrue if the value is *not* boolean. 
24468
24469         * jit/JITOpcodes.cpp:
24470         (JSC::JIT::emit_op_jfalse):
24471         (JSC::JIT::emit_op_jtrue):
24472
24473 2009-05-14  Sam Weinig  <sam@webkit.org>
24474
24475         Reviewed by Geoffrey Garen.
24476
24477         Flipped the condition when emitting a an op_loop_if_less or op_loop_if_lesseq
24478         if the first operand is a constant.
24479
24480         * jit/JITOpcodes.cpp:
24481         (JSC::JIT::emit_op_loop_if_less):
24482         (JSC::JIT::emit_op_loop_if_lesseq):
24483
24484 2009-05-14  Sam Weinig  <sam@webkit.org>
24485
24486         Reviewed by Geoffrey Garen.
24487
24488         Added missing return in op_jnless and op_jnlesseq. 
24489
24490         * jit/JITArithmetic.cpp:
24491         (JSC::JIT::emit_op_jnless):
24492         (JSC::JIT::emit_op_jnlesseq):
24493
24494 2009-05-14  Sam Weinig  <sam@webkit.org>
24495
24496         Reviewed by Geoffrey Garen.
24497
24498         Load constants into the the register file as a temporary measure to
24499         aid bring up.  This allows us to use to treat constants like any
24500         other virtual register.
24501
24502         * jit/JITOpcodes.cpp:
24503         (JSC::JIT::emit_op_enter):
24504         (JSC::JIT::emit_op_enter_with_activation):
24505
24506 2009-05-14  Geoffrey Garen  <ggaren@apple.com>
24507
24508         Reviewed by Sam Weinig.
24509         
24510         Implemented op_strict_eq. Original patch by Snowy, by way of Sam and Gavin.
24511
24512         * assembler/MacroAssemblerX86Common.h:
24513         (JSC::MacroAssemblerX86Common::set8): Added set8, since it's slightly
24514         faster than set32, and the new value representation usually doesn't
24515         need set32.
24516
24517         * jit/JIT.cpp:
24518         * jit/JIT.h:
24519         * jit/JITInlineMethods.h:
24520         (JSC::JIT::emitLoadTag):
24521         (JSC::JIT::emitLoadPayload): Added helper functions for dealing with
24522         constants. Eventually, we should write special cases for all constants,
24523         but these are helpful in the short term.
24524
24525         * jit/JITOpcodes.cpp:
24526         (JSC::JIT::compileOpStrictEq):
24527         (JSC::JIT::emitSlow_op_stricteq):
24528         (JSC::JIT::emitSlow_op_nstricteq): teh opcodez.
24529
24530         * runtime/JSValue.h:
24531         (JSC::JSValue::):
24532         (JSC::JSValue::isDouble): Added a LowestTag for clarity.
24533
24534 2009-05-13  Geoffrey Garen  <ggaren@apple.com>
24535
24536         Reviewed by Sam Weinig.
24537         
24538         Fixed some bugs in host function calls.
24539         
24540         testapi now passes!
24541
24542         * jit/JIT.cpp: Changed some registers around to avoid overwriting edx:eax,
24543         which is how JSValues are now returned. Also changed the code that
24544         passes thisValue to pass the full 64bits of the value. Also added
24545         an #error compiler directive to other platform builds, since the JSValue
24546         return signature probably won't return in edx:eax on those platforms,
24547         and we'll have to investigate a solution.
24548
24549 2009-05-13  Geoffrey Garen  <ggaren@apple.com>
24550
24551         Reviewed by Sam Weinig.
24552         
24553         Removed parameters from functions that are intended never to use their
24554         parameters.
24555
24556         * jit/JITPropertyAccess.cpp:
24557         (JSC::JIT::emitSlow_op_get_by_val):
24558         (JSC::JIT::emitSlow_op_put_by_val):
24559
24560 2009-05-13  Geoffrey Garen  <ggaren@apple.com>
24561
24562         Reviewed by Sam Weinig.
24563         
24564         Ported op_instance_of from TOT. It's basically the same, but some register
24565         stuff changed to memory stuff.
24566
24567         * jit/JITInlineMethods.h:
24568         (JSC::JIT::emitPutJITStubArgFromVirtualRegister):
24569         (JSC::JIT::emitStore): Changed to use helper functions.
24570
24571         * jit/JITOpcodes.cpp:
24572         (JSC::JIT::emit_op_instanceof):
24573         (JSC::JIT::emitSlow_op_instanceof): Ported from TOT.
24574
24575 2009-05-13  Geoffrey Garen  <ggaren@apple.com>
24576
24577         Reviewed by Gavin Barraclough.
24578         
24579         Added a comment to explain an exception-handling subtelty that we found
24580         hard to remember when reviewing my last patch.
24581
24582         * jit/JITOpcodes.cpp:
24583         (JSC::JIT::emit_op_catch):
24584
24585 2009-05-13  Geoffrey Garen  <ggaren@apple.com>
24586
24587         Reviewed by Sam Weinig.
24588         
24589         Implemented try/catch.
24590
24591         * jit/JITOpcodes.cpp:
24592         (JSC::JIT::emit_op_throw): Updated to use JITStackFrame abstraction.
24593         (JSC::JIT::emit_op_catch): Filled out.
24594
24595 2009-05-13  Sam Weinig  <sam@webkit.org>
24596
24597         Reviewed by Geoffrey Garen.
24598
24599         Implemented op_loop_if_true, op_jfalse, op_jtrue, op_jeq_null and op_jneq_null
24600
24601         * jit/JITOpcodes.cpp:
24602         (JSC::JIT::emitSlow_op_instanceof): Moved from below to be next to its
24603         fast brother.
24604
24605         (JSC::JIT::emit_op_loop_if_true): Similar to the old version
24606         in that it tries to do the integer case first and reduce the
24607         number of jumps you might need to take.
24608         (JSC::JIT::emitSlow_op_loop_if_true):
24609
24610         (JSC::JIT::emit_op_jfalse): Very similar to op_loop_if_true, only
24611         the inverse and without a timeout check.
24612         (JSC::JIT::emitSlow_op_jfalse):
24613
24614         (JSC::JIT::emit_op_jtrue): Very similar to op_loop_if_true except
24615         without the timeout check.
24616         (JSC::JIT::emitSlow_op_jtrue):
24617
24618         (JSC::JIT::emit_op_jeq_null): Very similar to the implementation
24619         of op_eq, except it takes jumps instead of copying the condition
24620         to a dst.
24621         (JSC::JIT::emit_op_jneq_null): Ditto but for op_neq.
24622
24623 2009-05-13  Geoffrey Garen  <ggaren@apple.com>
24624
24625         Reviewed by Sam Weinig.
24626         
24627         Implemented op_call_varargs.
24628
24629         * jit/JITCall.cpp:
24630         (JSC::JIT::compileOpCallVarargsSetupArgs):
24631         (JSC::JIT::compileOpCallVarargs):
24632         (JSC::JIT::emit_op_call):
24633         (JSC::JIT::emit_op_call_eval):
24634         (JSC::JIT::emit_op_load_varargs):
24635         (JSC::JIT::emit_op_call_varargs):
24636         (JSC::JIT::emit_op_construct):
24637         * jit/JITOpcodes.cpp:
24638         (JSC::JIT::emit_op_jneq_ptr):
24639
24640 2009-05-13  Geoffrey Garen  <ggaren@apple.com>
24641
24642         Reviewed by Sam Weinig.
24643         
24644         Implemented op_call_eval.
24645
24646         * jit/JITCall.cpp:
24647         (JSC::JIT::compileOpCallVarargsSetupArgs):
24648         (JSC::JIT::compileOpCall):
24649         * jit/JITStubCall.h:
24650         (JSC::CallEvalJITStub::CallEvalJITStub):
24651
24652 2009-05-13  Sam Weinig  <sam@webkit.org>
24653
24654         Reviewed by Gavin Barraclough.
24655
24656         Implemented op_not. (Gavin did most of the work!)
24657
24658         * jit/JITOpcodes.cpp:
24659         (JSC::JIT::emit_op_not):
24660         (JSC::JIT::emitSlow_op_not):
24661
24662 2009-05-13  Geoffrey Garen  <ggaren@apple.com>
24663
24664         Reviewed by Sam Weinig.
24665         
24666         Implemented op_global_resolve.
24667
24668         * jit/JITOpcodes.cpp:
24669         (JSC::JIT::emit_op_loop_if_less):
24670         (JSC::JIT::emit_op_loop_if_lesseq): Added back accidentally removed
24671         early returns. 
24672
24673         (JSC::JIT::emit_op_resolve_global):
24674         * jit/JITStubs.cpp:
24675         (JSC::JITStubs::cti_op_resolve_global): Pretty similar to the old code,
24676         but we need two reads and a TimesEight step in order to account for the
24677         64bit value size.
24678
24679         * jit/JITStubs.h:
24680         (JSC::): Slightly tweaked this code to specialize for a JSGlobalObject*,
24681         to avoid having to pass an irrelevant tag pointer to the stub.
24682
24683 2009-05-13  Sam Weinig  <sam@webkit.org>
24684
24685         Reviewed by Geoffrey Garen.
24686
24687         Implemented op_to_jsnumber.
24688
24689         * jit/JITOpcodes.cpp:
24690         (JSC::JIT::emit_op_to_jsnumber):
24691         (JSC::JIT::emitSlow_op_to_jsnumber):
24692
24693 2009-05-13  Sam Weinig  <sam@webkit.org>
24694
24695         Reviewed by Geoffrey Garen.
24696
24697         Implemented op_convert_this.
24698
24699         * jit/JITOpcodes.cpp:
24700         (JSC::JIT::emit_op_convert_this):
24701         (JSC::JIT::emitSlow_op_convert_this):
24702
24703 2009-05-13  Geoffrey Garen  <ggaren@apple.com>
24704
24705         Reviewed by Sam Weinig.
24706         
24707         Got basic JS function and constructor calls working.
24708
24709         * jit/JIT.cpp:
24710         (JSC::JIT::privateCompileCTIMachineTrampolines):
24711         * jit/JIT.h:
24712         * jit/JITCall.cpp:
24713         (JSC::JIT::compileOpCallSetupArgs):
24714         (JSC::JIT::compileOpCallVarargsSetupArgs):
24715         (JSC::JIT::compileOpConstructSetupArgs):
24716         (JSC::JIT::emit_op_ret):
24717         (JSC::JIT::emit_op_construct_verify):
24718         (JSC::JIT::emitSlow_op_construct_verify):
24719         (JSC::JIT::emitSlow_op_call):
24720         (JSC::JIT::emitSlow_op_call_eval):
24721         (JSC::JIT::emitSlow_op_call_varargs):
24722         (JSC::JIT::emitSlow_op_construct):
24723         (JSC::JIT::compileOpCall): Filled out these cases, with call_eval #if'd out.
24724
24725         * jit/JITInlineMethods.h:
24726         (JSC::JIT::emitPutJITStubArgFromVirtualRegister):
24727         (JSC::JIT::emitLoad): Restored some legacy "*CTIArg*" functions,
24728         since I wanted to avoid the complexity of revamping the API here while
24729         trying to bring it up. Eventually, we should re-remove all of these functions.
24730
24731         (JSC::JIT::recordJumpTarget): Removed unnecessary macro cruft. You will
24732         not silence me, Sam Weinig! The world will know that you are a crufty,
24733         crufty, crufty programmer!!!
24734
24735         * jit/JITOpcodes.cpp:
24736         * jit/JITStubs.cpp:
24737         (JSC::):
24738         * jit/JITStubs.h: Changed up some offsets in the JITStackFrame class, since
24739         and off-by-one error was causing stack misalignment.
24740
24741 2009-05-13  Sam Weinig  <sam@webkit.org>
24742
24743         Reviewed by Geoffrey Garen.
24744
24745         Implement op_eq_null and op_neq_null.
24746
24747         * assembler/MacroAssemblerX86Common.h:
24748         (JSC::MacroAssemblerX86Common::set8):
24749         (JSC::MacroAssemblerX86Common::setTest8):
24750         * jit/JITOpcodes.cpp:
24751         (JSC::JIT::emit_op_stricteq):
24752         (JSC::JIT::emitSlow_op_stricteq):
24753         (JSC::JIT::emit_op_nstricteq):
24754         (JSC::JIT::emitSlow_op_nstricteq):
24755         (JSC::JIT::emit_op_eq_null):
24756         (JSC::JIT::emit_op_neq_null):
24757         * jsc.cpp:
24758
24759 2009-05-12  Sam Weinig  <sam@webkit.org>
24760
24761         Reviewed by Geoffrey Garen.
24762
24763         Implement op_new_error.
24764
24765         * jit/JITOpcodes.cpp:
24766         (JSC::JIT::emit_op_new_error):
24767         * jit/JITStubCall.h:
24768         (JSC::JITStubCall::addArgument): Add a version of addArgument
24769         that takes a constant JSValue.
24770
24771 2009-05-12  Sam Weinig  <sam@webkit.org>
24772
24773         Reviewed by Geoffrey Garen.
24774
24775         Remove now unused emitGetVariableObjectRegister and emitPutVariableObjectRegister.
24776
24777         * jit/JIT.cpp:
24778         * jit/JIT.h:
24779
24780 2009-05-12  Sam Weinig  <sam@webkit.org>
24781
24782         Reviewed by Geoffrey Garen.
24783
24784         Implement op_to_primitive and op_next_pname.
24785
24786         * jit/JITOpcodes.cpp:
24787         (JSC::JIT::emitSlow_op_construct_verify):
24788         (JSC::JIT::emit_op_to_primitive):
24789         (JSC::JIT::emitSlow_op_to_primitive):
24790         (JSC::JIT::emitSlow_op_loop_if_true):
24791         (JSC::JIT::emit_op_jtrue):
24792         (JSC::JIT::emit_op_next_pname):
24793
24794 2009-05-12  Sam Weinig  <sam@webkit.org>
24795
24796         Reviewed by Geoffrey Garen.
24797
24798         Add op_get_global_var, op_put_global_var, emit_op_get_scoped_var, emit_op_put_scoped_var and
24799         op_unexpected_load.
24800
24801         * jit/JIT.h:
24802         * jit/JITInlineMethods.h:
24803         (JSC::JIT::tagFor):
24804         (JSC::JIT::payloadFor):
24805         (JSC::JIT::emitLoad):
24806         (JSC::JIT::emitStore):
24807         (JSC::JIT::emitLoadReturnValue):
24808         * jit/JITOpcodes.cpp:
24809         (JSC::JIT::emit_op_get_global_var):
24810         (JSC::JIT::emit_op_put_global_var):
24811         (JSC::JIT::emit_op_get_scoped_var):
24812         (JSC::JIT::emit_op_put_scoped_var):
24813         (JSC::JIT::emit_op_unexpected_load):
24814
24815 2009-05-12  Geoffrey Garen  <ggaren@apple.com>
24816
24817         Reviewed by Sam Weinig.
24818
24819         Added overflow handling to op_sub.
24820
24821         * jit/JIT.h:
24822         * jit/JITArithmetic.cpp:
24823         (JSC::JIT::emitSlow_op_sub):
24824         (JSC::JIT::emitSlowSub32InPlaceLeft):
24825
24826 2009-05-12  Sam Weinig  <sam@webkit.org>
24827
24828         Reviewed by Geoffrey Garen.
24829
24830         Remove a function call by folding op_get_by_id and op_put_by_id into
24831         their respective compile functions.
24832
24833         * jit/JIT.h:
24834         * jit/JITPropertyAccess.cpp:
24835         (JSC::JIT::emit_op_get_by_id):
24836         (JSC::JIT::emitSlow_op_get_by_id):
24837         (JSC::JIT::emit_op_put_by_id):
24838         (JSC::JIT::emitSlow_op_put_by_id):
24839
24840 2009-05-12  Sam Weinig  <sam@webkit.org>
24841
24842         Reviewed by Geoffrey Garen.
24843
24844         Make JITStubCall work in 64bit by making the stack index
24845         step dependent on the size of void*.
24846
24847         * jit/JITStubCall.h:
24848         (JSC::JITStubCall::JITStubCall):
24849         (JSC::JITStubCall::addArgument):
24850
24851 2009-05-12  Sam Weinig  <sam@webkit.org>
24852
24853         Reviewed by Geoffrey Garen.
24854
24855         Implement simple version of property access opcodes
24856         which just call a stub functions.
24857
24858         * jit/JITOpcodes.cpp:
24859         * jit/JITPropertyAccess.cpp:
24860         (JSC::JIT::emitSlow_op_put_by_id):
24861         (JSC::JIT::emitSlow_op_get_by_id):
24862         (JSC::JIT::emit_op_get_by_val):
24863         (JSC::JIT::emitSlow_op_get_by_val):
24864         (JSC::JIT::emit_op_put_by_val):
24865         (JSC::JIT::emitSlow_op_put_by_val):
24866         (JSC::JIT::emit_op_put_by_index):
24867         (JSC::JIT::emit_op_put_getter):
24868         (JSC::JIT::emit_op_put_setter):
24869         (JSC::JIT::emit_op_del_by_id):
24870         (JSC::JIT::compileGetByIdHotPath):
24871         (JSC::JIT::compilePutByIdHotPath):
24872         * jit/JITStubCall.h:
24873         (JSC::JITStubCall::addArgument):
24874         * jsc.cpp:
24875
24876 2009-05-12  Geoffrey Garen  <ggaren@apple.com>
24877
24878         Reviewed by Sam Weinig.
24879         
24880         Added work-around for XCode debugging echo problem.
24881
24882         * jsc.cpp:
24883         (runInteractive):
24884
24885 2009-05-12  Geoffrey Garen  <ggaren@apple.com>
24886
24887         Reviewed by Sam Weinig.
24888         
24889         Added overflow handling to op_add.
24890
24891         * jit/JIT.h:
24892         * jit/JITArithmetic.cpp:
24893         (JSC::JIT::emitSlow_op_add):
24894         (JSC::JIT::emitSlowAdd32InPlace):
24895
24896 2009-05-12  Sam Weinig  <sam@webkit.org>
24897
24898         Reviewed by Geoffrey Garen.
24899
24900         Add slow cases for op_jnless or emit_op_jnlesseq.
24901
24902         * jit/JITArithmetic.cpp:
24903         (JSC::JIT::emitSlow_op_jnless):
24904         (JSC::JIT::emitSlow_op_jnlesseq):
24905
24906 2009-05-12  Sam Weinig  <sam@webkit.org>
24907
24908         Reviewed by Geoffrey Garen.
24909
24910         Add implementations for op_jnless, emit_op_jnlesseq, op_loop_if_less and op_loop_if_lesseq.
24911         No slow cases for op_jnless or emit_op_jnlesseq yet.
24912
24913         * jit/JITArithmetic.cpp:
24914         (JSC::JIT::emit_op_jnless):
24915         (JSC::JIT::emitSlow_op_jnless):
24916         (JSC::JIT::emit_op_jnlesseq):
24917         (JSC::JIT::emitSlow_op_jnlesseq):
24918         * jit/JITOpcodes.cpp:
24919         (JSC::JIT::emit_op_loop_if_less):
24920         (JSC::JIT::emitSlow_op_loop_if_less):
24921         (JSC::JIT::emit_op_loop_if_lesseq):
24922         (JSC::JIT::emitSlow_op_loop_if_lesseq):
24923
24924 2009-05-12  Sam Weinig  <sam@webkit.org>
24925
24926         Reviewed by Geoffrey Garen.
24927
24928         Turn the RECORD_JUMP_TARGET macro into an inline function.
24929
24930         * jit/JIT.h:
24931         * jit/JITInlineMethods.h:
24932         (JSC::JIT::recordJumpTarget):
24933         * jit/JITOpcodes.cpp:
24934         (JSC::JIT::emit_op_jmp):
24935         (JSC::JIT::emit_op_jsr):
24936         (JSC::JIT::emit_op_jmp_scopes):
24937
24938 2009-05-12  Sam Weinig  <sam@webkit.org>
24939
24940         Add MacroAssemblerX86Common::set8 to fix the build.
24941
24942         * assembler/MacroAssemblerX86Common.h:
24943         (JSC::MacroAssemblerX86Common::set8):
24944
24945 2009-05-12  Geoffrey Garen  <ggaren@apple.com>
24946
24947         Reviewed by Sam Weinig.
24948         
24949         Added overflow recovery for pre_inc and pre_dec.
24950         
24951         Turned some short-circuit code into early returns, as is the WebKit style.
24952
24953         * jit/JITArithmetic.cpp:
24954         (JSC::JIT::emit_op_post_inc):
24955         (JSC::JIT::emitSlow_op_post_inc):
24956         (JSC::JIT::emit_op_post_dec):
24957         (JSC::JIT::emitSlow_op_post_dec):
24958         (JSC::JIT::emitSlow_op_pre_inc):
24959         (JSC::JIT::emitSlow_op_pre_dec):
24960
24961 2009-05-12  Sam Weinig  <sam@webkit.org>
24962
24963         Reviewed by Geoffrey Garen.
24964
24965         Implement op_jmp, op_loop, op_eq and op_neq.
24966
24967         * jit/JITOpcodes.cpp:
24968         (JSC::JIT::emit_op_jmp):
24969         (JSC::JIT::emit_op_loop):
24970         (JSC::JIT::emit_op_eq):
24971         (JSC::JIT::emitSlow_op_eq):
24972         (JSC::JIT::emit_op_neq):
24973         (JSC::JIT::emitSlow_op_neq):
24974         (JSC::JIT::emit_op_enter):
24975         (JSC::JIT::emit_op_enter_with_activation):
24976
24977 2009-05-12  Sam Weinig  <sam@webkit.org>
24978
24979         Reviewed by Geoffrey Garen.
24980
24981         Implement the slow cases for arithmetic opcodes.
24982
24983         * jit/JITArithmetic.cpp:
24984         (JSC::JIT::emitSlow_op_lshift):
24985         (JSC::JIT::emitSlow_op_rshift):
24986         (JSC::JIT::emitSlow_op_bitand):
24987         (JSC::JIT::emitSlow_op_bitor):
24988         (JSC::JIT::emitSlow_op_bitxor):
24989         (JSC::JIT::emitSlow_op_bitnot):
24990         (JSC::JIT::emitSlow_op_sub):
24991         (JSC::JIT::emitSlow_op_mul):
24992         (JSC::JIT::emitSlow_op_mod):
24993         (JSC::JIT::emit_op_mod):
24994
24995 2009-05-12  Sam Weinig  <sam@webkit.org>
24996
24997         Reviewed by Geoffrey Garen.
24998
24999         Implement op_bitnot.
25000
25001         * assembler/MacroAssemblerX86Common.h:
25002         (JSC::MacroAssemblerX86Common::not32):
25003         * assembler/X86Assembler.h:
25004         (JSC::X86Assembler::notl_m):
25005         * jit/JITArithmetic.cpp:
25006         (JSC::JIT::emit_op_bitnot):
25007
25008 2009-05-12  Sam Weinig  <sam@webkit.org>
25009
25010         Reviewed by Geoffrey Garen.
25011
25012         Add arithmetic opcode implementations from the old nitro-extreme branch.
25013
25014         * jit/JIT.h:
25015         * jit/JITArithmetic.cpp:
25016         (JSC::JIT::emit_op_jnless):
25017         (JSC::JIT::emitSlow_op_jnless):
25018         (JSC::JIT::emit_op_jnlesseq):
25019         (JSC::JIT::emitSlow_op_jnlesseq):
25020         (JSC::JIT::emit_op_lshift):
25021         (JSC::JIT::emitSlow_op_lshift):
25022         (JSC::JIT::emit_op_rshift):
25023         (JSC::JIT::emitSlow_op_rshift):
25024         (JSC::JIT::emit_op_bitand):
25025         (JSC::JIT::emitBitAnd32Constant):
25026         (JSC::JIT::emitBitAnd32InPlace):
25027         (JSC::JIT::emit_op_bitor):
25028         (JSC::JIT::emitSlow_op_bitor):
25029         (JSC::JIT::emitBitOr32Constant):
25030         (JSC::JIT::emitBitOr32InPlace):
25031         (JSC::JIT::emit_op_bitxor):
25032         (JSC::JIT::emitSlow_op_bitxor):
25033         (JSC::JIT::emitBitXor32Constant):
25034         (JSC::JIT::emitBitXor32InPlace):
25035         (JSC::JIT::emit_op_bitnot):
25036         (JSC::JIT::emitSlow_op_bitnot):
25037         (JSC::JIT::emit_op_post_inc):
25038         (JSC::JIT::emitSlow_op_post_inc):
25039         (JSC::JIT::emit_op_post_dec):
25040         (JSC::JIT::emitSlow_op_post_dec):
25041         (JSC::JIT::emit_op_pre_inc):
25042         (JSC::JIT::emitSlow_op_pre_inc):
25043         (JSC::JIT::emit_op_pre_dec):
25044         (JSC::JIT::emitSlow_op_pre_dec):
25045         (JSC::JIT::emit_op_add):
25046         (JSC::JIT::emitAdd32Constant):
25047         (JSC::JIT::emitAdd32InPlace):
25048         (JSC::JIT::emitSlow_op_add):
25049         (JSC::JIT::emit_op_sub):
25050         (JSC::JIT::emitSlow_op_sub):
25051         (JSC::JIT::emitSub32ConstantLeft):
25052         (JSC::JIT::emitSub32ConstantRight):
25053         (JSC::JIT::emitSub32InPlaceLeft):
25054         (JSC::JIT::emitSub32InPlaceRight):
25055         (JSC::JIT::emit_op_mul):
25056         (JSC::JIT::emitSlow_op_mul):
25057         (JSC::JIT::emitMul32Constant):
25058         (JSC::JIT::emitMul32InPlace):
25059         (JSC::JIT::emit_op_mod):
25060         (JSC::JIT::emitSlow_op_mod):
25061         * jit/JITOpcodes.cpp:
25062
25063 2009-05-12  Geoffrey Garen  <ggaren@apple.com>
25064
25065         Removed JIT_OPTIMIZE_ARITHMETIC setting, since it was all about 32bit
25066         value representations.
25067         
25068         Added JSAPIValueWrapper to the repository.
25069
25070         * jit/JIT.h:
25071         * jit/JITArithmetic.cpp:
25072         * runtime/JSAPIValueWrapper.cpp: Added.
25073         (JSC::JSAPIValueWrapper::toPrimitive):
25074         (JSC::JSAPIValueWrapper::getPrimitiveNumber):
25075         (JSC::JSAPIValueWrapper::toBoolean):
25076         (JSC::JSAPIValueWrapper::toNumber):
25077         (JSC::JSAPIValueWrapper::toString):
25078         (JSC::JSAPIValueWrapper::toObject):
25079         * runtime/JSAPIValueWrapper.h: Added.
25080         (JSC::JSAPIValueWrapper::value):
25081         (JSC::JSAPIValueWrapper::isAPIValueWrapper):
25082         (JSC::JSAPIValueWrapper::JSAPIValueWrapper):
25083         (JSC::jsAPIValueWrapper):
25084         * wtf/Platform.h:
25085
25086 2009-05-12  Geoffrey Garen  <ggaren@apple.com>
25087
25088         Turned on the JIT and got it building and running the most trivial of
25089         programs.
25090         
25091         All configurable optimizations are turned off, and a few opcodes are ad
25092         hoc #if'd out.
25093         
25094         So far, I've only merged op_mov and op_end, but some stub-reliant
25095         opcodes work as-is from TOT.
25096         
25097         * bytecode/CodeBlock.cpp:
25098         (JSC::CodeBlock::~CodeBlock):
25099         * bytecode/CodeBlock.h:
25100         * jit/JIT.cpp:
25101         (JSC::JIT::compileOpStrictEq):
25102         * jit/JIT.h:
25103         * jit/JITArithmetic.cpp:
25104         (JSC::JIT::emit_op_lshift):
25105         (JSC::JIT::emitSlow_op_lshift):
25106         (JSC::JIT::emit_op_rshift):
25107         (JSC::JIT::emitSlow_op_rshift):
25108         (JSC::JIT::emit_op_jnless):
25109         (JSC::JIT::emitSlow_op_jnless):
25110         (JSC::JIT::emit_op_jnlesseq):
25111         (JSC::JIT::emitSlow_op_jnlesseq):
25112         (JSC::JIT::emit_op_bitand):
25113         (JSC::JIT::emitSlow_op_bitand):
25114         (JSC::JIT::emit_op_post_inc):
25115         (JSC::JIT::emitSlow_op_post_inc):
25116         (JSC::JIT::emit_op_post_dec):
25117         (JSC::JIT::emitSlow_op_post_dec):
25118         (JSC::JIT::emit_op_pre_inc):
25119         (JSC::JIT::emitSlow_op_pre_inc):
25120         (JSC::JIT::emit_op_pre_dec):
25121         (JSC::JIT::emitSlow_op_pre_dec):
25122         (JSC::JIT::emit_op_mod):
25123         (JSC::JIT::emitSlow_op_mod):
25124         (JSC::JIT::emit_op_add):
25125         (JSC::JIT::emit_op_mul):
25126         (JSC::JIT::emit_op_sub):
25127         (JSC::JIT::compileBinaryArithOpSlowCase):
25128         (JSC::JIT::emitSlow_op_add):
25129         (JSC::JIT::emitSlow_op_mul):
25130         * jit/JITCall.cpp:
25131         (JSC::JIT::compileOpCallInitializeCallFrame):
25132         (JSC::JIT::compileOpConstructSetupArgs):
25133         (JSC::JIT::compileOpCallVarargs):
25134         (JSC::JIT::compileOpCall):
25135         (JSC::JIT::compileOpCallSlowCase):
25136         * jit/JITInlineMethods.h:
25137         (JSC::JIT::getConstantOperandImmediateInt):
25138         (JSC::JIT::isOperandConstantImmediateInt):
25139         (JSC::JIT::emitInitRegister):
25140         (JSC::JIT::addSlowCase):
25141         (JSC::JIT::addJump):
25142         (JSC::JIT::emitJumpSlowToHot):
25143         (JSC::JIT::tagFor):
25144         (JSC::JIT::payloadFor):
25145         (JSC::JIT::emitLoad):
25146         (JSC::JIT::emitLoadReturnValue):
25147         (JSC::JIT::emitStore):
25148         (JSC::JIT::emitStoreReturnValue):
25149         * jit/JITOpcodes.cpp:
25150         (JSC::JIT::emit_op_mov):
25151         (JSC::JIT::emit_op_end):
25152         (JSC::JIT::emit_op_jmp):
25153         (JSC::JIT::emit_op_loop):
25154         (JSC::JIT::emit_op_loop_if_less):
25155         (JSC::JIT::emit_op_loop_if_lesseq):
25156         (JSC::JIT::emit_op_instanceof):
25157         (JSC::JIT::emit_op_get_global_var):
25158         (JSC::JIT::emit_op_put_global_var):
25159         (JSC::JIT::emit_op_get_scoped_var):
25160         (JSC::JIT::emit_op_put_scoped_var):
25161         (JSC::JIT::emit_op_tear_off_activation):
25162         (JSC::JIT::emit_op_ret):
25163         (JSC::JIT::emit_op_construct_verify):
25164         (JSC::JIT::emit_op_to_primitive):
25165         (JSC::JIT::emit_op_loop_if_true):
25166         (JSC::JIT::emit_op_resolve_global):
25167         (JSC::JIT::emit_op_not):
25168         (JSC::JIT::emit_op_jfalse):
25169         (JSC::JIT::emit_op_jeq_null):
25170         (JSC::JIT::emit_op_jneq_null):
25171         (JSC::JIT::emit_op_jneq_ptr):
25172         (JSC::JIT::emit_op_unexpected_load):
25173         (JSC::JIT::emit_op_eq):
25174         (JSC::JIT::emit_op_bitnot):
25175         (JSC::JIT::emit_op_jtrue):
25176         (JSC::JIT::emit_op_neq):
25177         (JSC::JIT::emit_op_bitxor):
25178         (JSC::JIT::emit_op_bitor):
25179         (JSC::JIT::emit_op_throw):
25180         (JSC::JIT::emit_op_next_pname):
25181         (JSC::JIT::emit_op_push_scope):
25182         (JSC::JIT::emit_op_to_jsnumber):
25183         (JSC::JIT::emit_op_push_new_scope):
25184         (JSC::JIT::emit_op_catch):
25185         (JSC::JIT::emit_op_switch_imm):
25186         (JSC::JIT::emit_op_switch_char):
25187         (JSC::JIT::emit_op_switch_string):
25188         (JSC::JIT::emit_op_new_error):
25189         (JSC::JIT::emit_op_eq_null):
25190         (JSC::JIT::emit_op_neq_null):
25191         (JSC::JIT::emit_op_convert_this):
25192         (JSC::JIT::emit_op_profile_will_call):
25193         (JSC::JIT::emit_op_profile_did_call):
25194         (JSC::JIT::emitSlow_op_construct_verify):
25195         (JSC::JIT::emitSlow_op_get_by_val):
25196         (JSC::JIT::emitSlow_op_loop_if_less):
25197         (JSC::JIT::emitSlow_op_loop_if_lesseq):
25198         (JSC::JIT::emitSlow_op_put_by_val):
25199         (JSC::JIT::emitSlow_op_not):
25200         (JSC::JIT::emitSlow_op_instanceof):
25201         * jit/JITPropertyAccess.cpp:
25202         (JSC::JIT::emit_op_get_by_val):
25203         (JSC::JIT::emit_op_put_by_val):
25204         (JSC::JIT::emit_op_put_by_index):
25205         (JSC::JIT::emit_op_put_getter):
25206         (JSC::JIT::emit_op_put_setter):
25207         (JSC::JIT::emit_op_del_by_id):
25208         (JSC::JIT::compileGetByIdHotPath):
25209         (JSC::JIT::compilePutByIdHotPath):
25210         * jit/JITStubCall.h:
25211         (JSC::JITStubCall::JITStubCall):
25212         (JSC::JITStubCall::addArgument):
25213         (JSC::JITStubCall::call):
25214         (JSC::JITStubCall::):
25215         (JSC::CallEvalJITStub::CallEvalJITStub):
25216         * jit/JITStubs.cpp:
25217         (JSC::):
25218         (JSC::JITStubs::cti_op_add):
25219         (JSC::JITStubs::cti_op_pre_inc):
25220         (JSC::JITStubs::cti_op_mul):
25221         (JSC::JITStubs::cti_op_get_by_val):
25222         (JSC::JITStubs::cti_op_get_by_val_string):
25223         (JSC::JITStubs::cti_op_get_by_val_byte_array):
25224         (JSC::JITStubs::cti_op_sub):
25225         (JSC::JITStubs::cti_op_put_by_val):
25226         (JSC::JITStubs::cti_op_put_by_val_array):
25227         (JSC::JITStubs::cti_op_put_by_val_byte_array):
25228         (JSC::JITStubs::cti_op_negate):
25229         (JSC::JITStubs::cti_op_div):
25230         (JSC::JITStubs::cti_op_pre_dec):
25231         (JSC::JITStubs::cti_op_post_inc):
25232         (JSC::JITStubs::cti_op_eq):
25233         (JSC::JITStubs::cti_op_lshift):
25234         (JSC::JITStubs::cti_op_bitand):
25235         (JSC::JITStubs::cti_op_rshift):
25236         (JSC::JITStubs::cti_op_bitnot):
25237         (JSC::JITStubs::cti_op_mod):
25238         (JSC::JITStubs::cti_op_neq):
25239         (JSC::JITStubs::cti_op_post_dec):
25240         (JSC::JITStubs::cti_op_urshift):
25241         (JSC::JITStubs::cti_op_bitxor):
25242         (JSC::JITStubs::cti_op_bitor):
25243         (JSC::JITStubs::cti_op_switch_imm):
25244         * jit/JITStubs.h:
25245         * runtime/JSArray.cpp:
25246         (JSC::JSArray::JSArray):
25247         * runtime/JSFunction.cpp:
25248         (JSC::JSFunction::~JSFunction):
25249         * runtime/JSValue.h:
25250         (JSC::JSValue::payload):
25251         * wtf/Platform.h:
25252
25253 2009-05-07  Sam Weinig  <sam@webkit.org>
25254
25255         Reviewed by Geoffrey Garen.
25256
25257         Add some new MacroAssembler and assembler functions that will be needed shortly.
25258
25259         * assembler/MacroAssemblerX86Common.h:
25260         (JSC::MacroAssemblerX86Common::add32):
25261         (JSC::MacroAssemblerX86Common::and32):
25262         (JSC::MacroAssemblerX86Common::mul32):
25263         (JSC::MacroAssemblerX86Common::neg32):
25264         (JSC::MacroAssemblerX86Common::or32):
25265         (JSC::MacroAssemblerX86Common::sub32):
25266         (JSC::MacroAssemblerX86Common::xor32):
25267         (JSC::MacroAssemblerX86Common::branchAdd32):
25268         (JSC::MacroAssemblerX86Common::branchMul32):
25269         (JSC::MacroAssemblerX86Common::branchSub32):
25270         * assembler/X86Assembler.h:
25271         (JSC::X86Assembler::):
25272         (JSC::X86Assembler::addl_rm):
25273         (JSC::X86Assembler::andl_mr):
25274         (JSC::X86Assembler::andl_rm):
25275         (JSC::X86Assembler::andl_im):
25276         (JSC::X86Assembler::negl_r):
25277         (JSC::X86Assembler::notl_r):
25278         (JSC::X86Assembler::orl_rm):
25279         (JSC::X86Assembler::orl_im):
25280         (JSC::X86Assembler::subl_rm):
25281         (JSC::X86Assembler::xorl_mr):
25282         (JSC::X86Assembler::xorl_rm):
25283         (JSC::X86Assembler::xorl_im):
25284         (JSC::X86Assembler::imull_mr):
25285
25286 2009-05-11  Sam Weinig  <sam@webkit.org>
25287
25288         Reviewed by Cameron Zwarich.
25289
25290         Remove the NumberHeap.
25291
25292         * JavaScriptCore.exp:
25293         * runtime/Collector.cpp:
25294         (JSC::Heap::Heap):
25295         (JSC::Heap::destroy):
25296         (JSC::Heap::recordExtraCost):
25297         (JSC::Heap::heapAllocate):
25298         (JSC::Heap::markConservatively):
25299         (JSC::Heap::sweep):
25300         (JSC::Heap::collect):
25301         (JSC::Heap::objectCount):
25302         (JSC::Heap::statistics):
25303         (JSC::typeName):
25304         (JSC::Heap::isBusy):
25305         * runtime/Collector.h:
25306         (JSC::Heap::globalData):
25307         * runtime/JSCell.h:
25308
25309 2009-05-11  Geoffrey Garen  <ggaren@apple.com>
25310
25311         Reviewed by Sam Weinig.
25312
25313         Land initial commit of new number representation for 32 bit platforms,
25314         with JIT disabled.
25315
25316         * API/APICast.h:
25317         (toJS):
25318         (toRef):
25319         * API/JSCallbackObjectFunctions.h:
25320         (JSC::::hasInstance):
25321         (JSC::::toNumber):
25322         (JSC::::toString):
25323         * API/tests/testapi.c:
25324         (EvilExceptionObject_convertToType):
25325         * AllInOneFile.cpp:
25326         * JavaScriptCore.exp:
25327         * JavaScriptCore.xcodeproj/project.pbxproj:
25328         * bytecode/CodeBlock.cpp:
25329         (JSC::valueToSourceString):
25330         * bytecompiler/BytecodeGenerator.cpp:
25331         (JSC::BytecodeGenerator::emitLoad):
25332         (JSC::BytecodeGenerator::emitUnexpectedLoad):
25333         (JSC::keyForImmediateSwitch):
25334         * bytecompiler/BytecodeGenerator.h:
25335         * interpreter/Interpreter.cpp:
25336         (JSC::Interpreter::dumpRegisters):
25337         (JSC::Interpreter::privateExecute):
25338         * parser/Nodes.cpp:
25339         (JSC::ArrayNode::emitBytecode):
25340         (JSC::processClauseList):
25341         * runtime/ArgList.h:
25342         * runtime/Collector.h:
25343         (JSC::sizeof):
25344         * runtime/DateMath.cpp:
25345         * runtime/ExceptionHelpers.h:
25346         * runtime/InitializeThreading.cpp:
25347         * runtime/JSArray.cpp:
25348         (JSC::JSArray::JSArray):
25349         * runtime/JSCell.cpp:
25350         * runtime/JSCell.h:
25351         (JSC::JSCell::isAPIValueWrapper):
25352         (JSC::JSValue::isString):
25353         (JSC::JSValue::isGetterSetter):
25354         (JSC::JSValue::isObject):
25355         (JSC::JSValue::getString):
25356         (JSC::JSValue::getObject):
25357         (JSC::JSValue::getCallData):
25358         (JSC::JSValue::getConstructData):
25359         (JSC::JSValue::getUInt32):
25360         (JSC::JSValue::marked):
25361         (JSC::JSValue::toPrimitive):
25362         (JSC::JSValue::getPrimitiveNumber):
25363         (JSC::JSValue::toBoolean):
25364         (JSC::JSValue::toNumber):
25365         (JSC::JSValue::toString):
25366         (JSC::JSValue::needsThisConversion):
25367         (JSC::JSValue::toThisString):
25368         (JSC::JSValue::getJSNumber):
25369         (JSC::JSValue::toObject):
25370         (JSC::JSValue::toThisObject):
25371         * runtime/JSGlobalData.cpp:
25372         (JSC::JSGlobalData::JSGlobalData):
25373         * runtime/JSGlobalData.h:
25374         * runtime/JSGlobalObject.h:
25375         (JSC::Structure::prototypeForLookup):
25376         * runtime/JSGlobalObjectFunctions.cpp:
25377         (JSC::globalFuncParseInt):
25378         * runtime/JSImmediate.h:
25379         * runtime/JSNumberCell.cpp: Removed.
25380         * runtime/JSNumberCell.h: Removed.
25381         * runtime/JSObject.h:
25382         (JSC::JSValue::get):
25383         (JSC::JSValue::put):
25384         * runtime/JSString.h:
25385         (JSC::JSValue::toThisJSString):
25386         * runtime/JSValue.cpp:
25387         (JSC::JSValue::toInteger):
25388         (JSC::JSValue::toIntegerPreserveNaN):
25389         (JSC::JSValue::toObjectSlowCase):
25390         (JSC::JSValue::toThisObjectSlowCase):
25391         (JSC::JSValue::synthesizeObject):
25392         (JSC::JSValue::synthesizePrototype):
25393         (JSC::JSValue::description):
25394         (JSC::nonInlineNaN):
25395         * runtime/JSValue.h:
25396         (JSC::JSValue::):
25397         (JSC::EncodedJSValueHashTraits::emptyValue):
25398         (JSC::jsNaN):
25399         (JSC::operator==):
25400         (JSC::operator!=):
25401         (JSC::toInt32):
25402         (JSC::toUInt32):
25403         (JSC::JSValue::encode):
25404         (JSC::JSValue::decode):
25405         (JSC::JSValue::JSValue):
25406         (JSC::JSValue::operator bool):
25407         (JSC::JSValue::operator==):
25408         (JSC::JSValue::operator!=):
25409         (JSC::JSValue::isUndefined):
25410         (JSC::JSValue::isNull):
25411         (JSC::JSValue::isUndefinedOrNull):
25412         (JSC::JSValue::isCell):
25413         (JSC::JSValue::isInt32):
25414         (JSC::JSValue::isUInt32):
25415         (JSC::JSValue::isDouble):
25416         (JSC::JSValue::isTrue):
25417         (JSC::JSValue::isFalse):
25418         (JSC::JSValue::tag):
25419         (JSC::JSValue::asInt32):
25420         (JSC::JSValue::asUInt32):
25421         (JSC::JSValue::asDouble):
25422         (JSC::JSValue::asCell):
25423         (JSC::JSValue::isNumber):
25424         (JSC::JSValue::isBoolean):
25425         (JSC::JSValue::getBoolean):
25426         (JSC::JSValue::uncheckedGetNumber):
25427         (JSC::JSValue::toJSNumber):
25428         (JSC::JSValue::getNumber):
25429         (JSC::JSValue::toInt32):
25430         (JSC::JSValue::toUInt32):
25431         * runtime/Operations.h:
25432         (JSC::JSValue::equal):
25433         (JSC::JSValue::equalSlowCaseInline):
25434         (JSC::JSValue::strictEqual):
25435         (JSC::JSValue::strictEqualSlowCaseInline):
25436         (JSC::jsLess):
25437         (JSC::jsLessEq):
25438         (JSC::jsAdd):
25439         * runtime/PropertySlot.h:
25440         * runtime/StringPrototype.cpp:
25441         (JSC::stringProtoFuncCharAt):
25442         (JSC::stringProtoFuncCharCodeAt):
25443         (JSC::stringProtoFuncIndexOf):
25444         * wtf/Platform.h:
25445
25446 === Start merge of nitro-extreme branch 2009-07-30 ===
25447
25448 2009-07-29  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
25449
25450         Reviewed by George Staikos.
25451
25452         Resolve class/struct mixup in forward declarations
25453         https://bugs.webkit.org/show_bug.cgi?id=27708
25454
25455         * API/JSClassRef.h:
25456         * bytecode/SamplingTool.h:
25457         * interpreter/Interpreter.h:
25458         * jit/JIT.h:
25459         * profiler/ProfileGenerator.h:
25460         * profiler/Profiler.h:
25461         * runtime/ClassInfo.h:
25462         * runtime/ExceptionHelpers.h:
25463         * runtime/JSByteArray.h:
25464         * runtime/JSCell.h:
25465         * runtime/JSFunction.h:
25466         * runtime/JSGlobalData.h:
25467         * runtime/JSObject.h:
25468         * runtime/JSString.h:
25469
25470 2009-07-28  Ada Chan  <adachan@apple.com>        
25471
25472         Reviewed by Darin Adler.
25473
25474         https://bugs.webkit.org/show_bug.cgi?id=27236
25475         - Implement TCMalloc_SystemRelease and TCMalloc_SystemCommit for Windows.
25476         - Use a background thread to periodically scavenge memory to release back to the system.
25477
25478         * wtf/FastMalloc.cpp:
25479         (WTF::TCMalloc_PageHeap::init):
25480         (WTF::TCMalloc_PageHeap::runScavengerThread):
25481         (WTF::TCMalloc_PageHeap::scavenge):
25482         (WTF::TCMalloc_PageHeap::shouldContinueScavenging):
25483         (WTF::TCMalloc_PageHeap::New):
25484         (WTF::TCMalloc_PageHeap::AllocLarge):
25485         (WTF::TCMalloc_PageHeap::Delete):
25486         (WTF::TCMalloc_PageHeap::GrowHeap):
25487         (WTF::sleep):
25488         (WTF::TCMalloc_PageHeap::scavengerThread):
25489         * wtf/TCSystemAlloc.cpp:
25490         (TCMalloc_SystemRelease):
25491         (TCMalloc_SystemCommit):
25492         * wtf/TCSystemAlloc.h:
25493
25494 2009-07-28  Xan Lopez  <xlopez@igalia.com>
25495
25496         Add new files, fixes distcheck.
25497
25498         * GNUmakefile.am:
25499
25500 2009-07-28  Csaba Osztrogonac  <oszi@inf.u-szeged.hu>
25501
25502         Reviewed by Simon Hausmann.
25503
25504         [Qt] Determining whether to use JIT or interpreter
25505         moved from JavaScriptCore.pri to Platform.h
25506
25507         * JavaScriptCore.pri:
25508         * wtf/Platform.h:
25509
25510 2009-07-27  Brian Weinstein  <bweinstein@apple.com>
25511
25512         Fix of misuse of sort command.
25513
25514         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
25515         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
25516
25517 2009-07-27  Brian Weinstein  <bweinstein@apple.com>
25518
25519         Build fix for Windows.
25520
25521         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
25522         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
25523
25524 2009-07-27  Gavin Barraclough  <barraclough@apple.com>
25525
25526         Rubber stamped by Oliver Hunt.
25527
25528         Fix tyop in JIT, renamed preverveReturnAddressAfterCall -> preserveReturnAddressAfterCall.
25529
25530         * jit/JIT.cpp:
25531         (JSC::JIT::privateCompile):
25532         (JSC::JIT::privateCompileCTIMachineTrampolines):
25533         * jit/JIT.h:
25534         * jit/JITInlineMethods.h:
25535         (JSC::JIT::preserveReturnAddressAfterCall):
25536         * jit/JITPropertyAccess.cpp:
25537         (JSC::JIT::privateCompilePutByIdTransition):
25538
25539 2009-07-27  Alexey Proskuryakov  <ap@webkit.org>
25540
25541         Gtk build fix.
25542
25543         * runtime/JSLock.cpp: (JSC::JSLock::JSLock): Fix "no threading" case.
25544
25545 2009-07-27  Alexey Proskuryakov  <ap@webkit.org>
25546
25547         Release build fix.
25548
25549         * runtime/JSLock.h: (JSC::JSLock::~JSLock):
25550
25551 2009-07-27  Alexey Proskuryakov  <ap@webkit.org>
25552
25553         Reviewed by Darin Adler.
25554
25555         https://bugs.webkit.org/show_bug.cgi?id=27735
25556         Give a helpful name to JSLock constructor argument
25557
25558         * API/JSBase.cpp:
25559         (JSGarbageCollect):
25560         * API/JSContextRef.cpp:
25561         * API/JSObjectRef.cpp:
25562         (JSPropertyNameArrayRelease):
25563         (JSPropertyNameAccumulatorAddName):
25564         * JavaScriptCore.exp:
25565         * jsc.cpp:
25566         (functionGC):
25567         (cleanupGlobalData):
25568         (jscmain):
25569         * runtime/Collector.cpp:
25570         (JSC::Heap::destroy):
25571         * runtime/JSLock.cpp:
25572         (JSC::JSLock::JSLock):
25573         (JSC::JSLock::lock):
25574         (JSC::JSLock::unlock):
25575         (JSC::JSLock::DropAllLocks::DropAllLocks):
25576         (JSC::JSLock::DropAllLocks::~DropAllLocks):
25577         * runtime/JSLock.h:
25578         (JSC::):
25579         (JSC::JSLock::JSLock):
25580         (JSC::JSLock::~JSLock):
25581
25582 2009-07-25  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
25583
25584         Reviewed by Eric Seidel.
25585
25586         Allow custom memory allocation control for OpaqueJSPropertyNameArray struct
25587         https://bugs.webkit.org/show_bug.cgi?id=27342
25588
25589         Inherits OpaqueJSPropertyNameArray struct from FastAllocBase because it has been
25590         instantiated by 'new' JavaScriptCore/API/JSObjectRef.cpp:473.
25591
25592         * API/JSObjectRef.cpp:
25593
25594 2009-07-24  Ada Chan  <adachan@apple.com>
25595
25596         In preparation for https://bugs.webkit.org/show_bug.cgi?id=27236:
25597         Remove TCMALLOC_TRACK_DECOMMITED_SPANS.  We'll always track decommitted spans.
25598         We have tested this and show it has little impact on performance.
25599
25600         Reviewed by Mark Rowe.
25601
25602         * wtf/FastMalloc.cpp:
25603         (WTF::TCMalloc_PageHeap::New):
25604         (WTF::TCMalloc_PageHeap::AllocLarge):
25605         (WTF::propagateDecommittedState):
25606         (WTF::mergeDecommittedStates):
25607         (WTF::TCMalloc_PageHeap::Delete):
25608         (WTF::TCMalloc_PageHeap::IncrementalScavenge):
25609
25610 2009-07-24  Csaba Osztrogonac  <oszi@inf.u-szeged.hu>
25611
25612         Reviewed by Darin Adler and Adam Barth.
25613
25614         Build fix for x86 platforms.
25615         https://bugs.webkit.org/show_bug.cgi?id=27602
25616
25617         * jit/JIT.cpp:
25618
25619 2009-07-23  Kevin Ollivier  <kevino@theolliviers.com>
25620
25621         wx build fix, adding missing header.
25622
25623         * jit/JIT.cpp:
25624
25625 2009-07-22  Yong Li  <yong.li@torchmobile.com>
25626
25627         Reviewed by George Staikos.
25628
25629         Add wince specific memory files into wtf/wince
25630         https://bugs.webkit.org/show_bug.cgi?id=27550
25631
25632         * wtf/wince/FastMallocWince.h: Added.
25633         * wtf/wince/MemoryManager.cpp: Added.
25634         * wtf/wince/MemoryManager.h: Added.
25635
25636 2009-07-23  Norbert Leser  <norbert.leser@nokia.com>
25637
25638         Reviewed by Simon Hausmann.
25639
25640         Fix for missing mmap features in Symbian
25641         https://bugs.webkit.org/show_bug.cgi?id=24540
25642
25643         Fix, conditionally for PLATFORM(SYMBIAN), as an alternative 
25644         to missing support for the MAP_ANON property flag in mmap. 
25645         It utilizes Symbian specific memory allocation features.
25646
25647         * runtime/Collector.cpp
25648
25649 2009-07-22  Gavin Barraclough  <barraclough@apple.com>
25650
25651         Reviewed by Sam Weinig.
25652
25653         With ENABLE(ASSEMBLER_WX_EXCLUSIVE), only change permissions once per repatch event.
25654         ( https://bugs.webkit.org/show_bug.cgi?id=27564 )
25655
25656         Currently we change permissions forwards and backwards for each instruction modified,
25657         instead we should only change permissions once per complete repatching event.
25658
25659         2.5% progression running with ENABLE(ASSEMBLER_WX_EXCLUSIVE) enabled,
25660         which recoups 1/3 of the penalty of running with this mode enabled.
25661
25662         * assembler/ARMAssembler.cpp:
25663         (JSC::ARMAssembler::linkBranch):
25664             - Replace usage of MakeWritable with cacheFlush.
25665         
25666         * assembler/ARMAssembler.h:
25667         (JSC::ARMAssembler::patchPointerInternal):
25668         (JSC::ARMAssembler::repatchLoadPtrToLEA):
25669             - Replace usage of MakeWritable with cacheFlush.
25670
25671         * assembler/ARMv7Assembler.h:
25672         (JSC::ARMv7Assembler::relinkJump):
25673         (JSC::ARMv7Assembler::relinkCall):
25674         (JSC::ARMv7Assembler::repatchInt32):
25675         (JSC::ARMv7Assembler::repatchPointer):
25676         (JSC::ARMv7Assembler::repatchLoadPtrToLEA):
25677         (JSC::ARMv7Assembler::setInt32):
25678             - Replace usage of MakeWritable with cacheFlush.
25679
25680         * assembler/LinkBuffer.h:
25681         (JSC::LinkBuffer::performFinalization):
25682             - Make explicit call to cacheFlush.
25683
25684         * assembler/MacroAssemblerCodeRef.h:
25685         (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef):
25686             - Make size always available.
25687
25688         * assembler/RepatchBuffer.h:
25689         (JSC::RepatchBuffer::RepatchBuffer):
25690         (JSC::RepatchBuffer::~RepatchBuffer):
25691             - Add calls to MakeWritable & makeExecutable.
25692
25693         * assembler/X86Assembler.h:
25694         (JSC::X86Assembler::relinkJump):
25695         (JSC::X86Assembler::relinkCall):
25696         (JSC::X86Assembler::repatchInt32):
25697         (JSC::X86Assembler::repatchPointer):
25698         (JSC::X86Assembler::repatchLoadPtrToLEA):
25699             - Remove usage of MakeWritable.
25700
25701         * bytecode/CodeBlock.h:
25702         (JSC::CodeBlock::getJITCode):
25703             - Provide access to CodeBlock's JITCode.
25704
25705         * jit/ExecutableAllocator.h:
25706         (JSC::ExecutableAllocator::makeExecutable):
25707         (JSC::ExecutableAllocator::cacheFlush):
25708             - Remove MakeWritable, make cacheFlush public.
25709
25710         * jit/JIT.cpp:
25711         (JSC::ctiPatchNearCallByReturnAddress):
25712         (JSC::ctiPatchCallByReturnAddress):
25713         (JSC::JIT::privateCompile):
25714         (JSC::JIT::unlinkCall):
25715         (JSC::JIT::linkCall):
25716             - Add CodeBlock argument to RepatchBuffer.
25717
25718         * jit/JIT.h:
25719             - Pass CodeBlock argument for use by RepatchBuffer.
25720
25721         * jit/JITCode.h:
25722         (JSC::JITCode::start):
25723         (JSC::JITCode::size):
25724             - Provide access to code start & size.
25725
25726         * jit/JITPropertyAccess.cpp:
25727         (JSC::JIT::privateCompilePutByIdTransition):
25728         (JSC::JIT::patchGetByIdSelf):
25729         (JSC::JIT::patchMethodCallProto):
25730         (JSC::JIT::patchPutByIdReplace):
25731         (JSC::JIT::privateCompilePatchGetArrayLength):
25732         (JSC::JIT::privateCompileGetByIdProto):
25733         (JSC::JIT::privateCompileGetByIdSelfList):
25734         (JSC::JIT::privateCompileGetByIdProtoList):
25735         (JSC::JIT::privateCompileGetByIdChainList):
25736         (JSC::JIT::privateCompileGetByIdChain):
25737             - Add CodeBlock argument to RepatchBuffer.
25738
25739         * jit/JITStubs.cpp:
25740         (JSC::JITThunks::tryCachePutByID):
25741         (JSC::JITThunks::tryCacheGetByID):
25742         (JSC::JITStubs::DEFINE_STUB_FUNCTION):
25743             - Pass CodeBlock argument for use by RepatchBuffer.
25744
25745 2009-07-21  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
25746
25747         Reviewed by Gavin Barraclough.
25748
25749         Cache not only the structure of the method, but the
25750         structure of its prototype as well.
25751         https://bugs.webkit.org/show_bug.cgi?id=27077
25752
25753         * bytecode/CodeBlock.cpp:
25754         (JSC::CodeBlock::~CodeBlock):
25755         * bytecode/CodeBlock.h:
25756         (JSC::MethodCallLinkInfo::MethodCallLinkInfo):
25757         * jit/JITPropertyAccess.cpp:
25758         (JSC::JIT::patchMethodCallProto):
25759
25760 2009-07-21  Gavin Barraclough  <barraclough@apple.com>
25761
25762         Reviewed by Sam Weinig.
25763
25764         Move call linking / repatching down from AbstractMacroAssembler into MacroAssemblerARCH classes.
25765         ( https://bugs.webkit.org/show_bug.cgi?id=27527 )
25766
25767         This allows the implementation to be defined per architecture.  Specifically this addresses the
25768         fact that x86-64 MacroAssembler implements far calls as a load to register, followed by a call
25769         to register.  Patching the call actually requires the pointer load to be patched, rather than
25770         the call to be patched.  This is implementation detail specific to MacroAssemblerX86_64, and as
25771         such is best handled there.
25772
25773         * assembler/AbstractMacroAssembler.h:
25774         * assembler/MacroAssemblerARM.h:
25775         (JSC::MacroAssemblerARM::linkCall):
25776         (JSC::MacroAssemblerARM::repatchCall):
25777         * assembler/MacroAssemblerARMv7.h:
25778         (JSC::MacroAssemblerARMv7::linkCall):
25779         (JSC::MacroAssemblerARMv7::repatchCall):
25780         * assembler/MacroAssemblerX86.h:
25781         (JSC::MacroAssemblerX86::linkCall):
25782         (JSC::MacroAssemblerX86::repatchCall):
25783         * assembler/MacroAssemblerX86_64.h:
25784         (JSC::MacroAssemblerX86_64::linkCall):
25785         (JSC::MacroAssemblerX86_64::repatchCall):
25786
25787 2009-07-21  Adam Treat  <adam.treat@torchmobile.com>
25788
25789         Reviewed by George Staikos.
25790
25791         Every wtf file includes other wtf files with <> style includes
25792         except this one.  Fix the exception.
25793
25794         * wtf/ByteArray.h:
25795
25796 2009-07-21  Gavin Barraclough  <barraclough@apple.com>
25797
25798         Reviewed by Oliver Hunt.
25799
25800         Move LinkBuffer/RepatchBuffer out of AbstractMacroAssembler.
25801         ( https://bugs.webkit.org/show_bug.cgi?id=27485 )
25802
25803         This change is the first step in a process to move code that should be in
25804         the architecture-specific MacroAssembler classes up out of Assmbler and
25805         AbstractMacroAssembler.
25806
25807         * JavaScriptCore.xcodeproj/project.pbxproj:
25808             - added new files
25809         
25810         * assembler/ARMAssembler.h:
25811         (JSC::ARMAssembler::linkPointer):
25812             - rename patchPointer to bring it in line with the current link/repatch naming scheme
25813         
25814         * assembler/ARMv7Assembler.h:
25815         (JSC::ARMv7Assembler::linkCall):
25816         (JSC::ARMv7Assembler::linkPointer):
25817         (JSC::ARMv7Assembler::relinkCall):
25818         (JSC::ARMv7Assembler::repatchInt32):
25819         (JSC::ARMv7Assembler::repatchPointer):
25820         (JSC::ARMv7Assembler::setInt32):
25821         (JSC::ARMv7Assembler::setPointer):
25822             - rename patchPointer to bring it in line with the current link/repatch naming scheme
25823
25824         * assembler/AbstractMacroAssembler.h:
25825         (JSC::AbstractMacroAssembler::linkJump):
25826         (JSC::AbstractMacroAssembler::linkCall):
25827         (JSC::AbstractMacroAssembler::linkPointer):
25828         (JSC::AbstractMacroAssembler::getLinkerAddress):
25829         (JSC::AbstractMacroAssembler::getLinkerCallReturnOffset):
25830         (JSC::AbstractMacroAssembler::repatchJump):
25831         (JSC::AbstractMacroAssembler::repatchCall):
25832         (JSC::AbstractMacroAssembler::repatchNearCall):
25833         (JSC::AbstractMacroAssembler::repatchInt32):
25834         (JSC::AbstractMacroAssembler::repatchPointer):
25835         (JSC::AbstractMacroAssembler::repatchLoadPtrToLEA):
25836             - remove the LinkBuffer/RepatchBuffer classes, but leave a set of (private, friended) methods to interface to the Assembler
25837
25838         * assembler/LinkBuffer.h: Added.
25839         (JSC::LinkBuffer::LinkBuffer):
25840         (JSC::LinkBuffer::~LinkBuffer):
25841         (JSC::LinkBuffer::link):
25842         (JSC::LinkBuffer::patch):
25843         (JSC::LinkBuffer::locationOf):
25844         (JSC::LinkBuffer::locationOfNearCall):
25845         (JSC::LinkBuffer::returnAddressOffset):
25846         (JSC::LinkBuffer::finalizeCode):
25847         (JSC::LinkBuffer::finalizeCodeAddendum):
25848         (JSC::LinkBuffer::code):
25849         (JSC::LinkBuffer::performFinalization):
25850             - new file containing the LinkBuffer class, previously a member of AbstractMacroAssembler
25851
25852         * assembler/RepatchBuffer.h: Added.
25853         (JSC::RepatchBuffer::RepatchBuffer):
25854         (JSC::RepatchBuffer::relink):
25855         (JSC::RepatchBuffer::repatch):
25856         (JSC::RepatchBuffer::repatchLoadPtrToLEA):
25857         (JSC::RepatchBuffer::relinkCallerToTrampoline):
25858         (JSC::RepatchBuffer::relinkCallerToFunction):
25859         (JSC::RepatchBuffer::relinkNearCallerToTrampoline):
25860             - new file containing the RepatchBuffer class, previously a member of AbstractMacroAssembler
25861
25862         * assembler/X86Assembler.h:
25863         (JSC::X86Assembler::linkJump):
25864         (JSC::X86Assembler::linkCall):
25865         (JSC::X86Assembler::linkPointerForCall):
25866         (JSC::X86Assembler::linkPointer):
25867         (JSC::X86Assembler::relinkJump):
25868         (JSC::X86Assembler::relinkCall):
25869         (JSC::X86Assembler::repatchInt32):
25870         (JSC::X86Assembler::repatchPointer):
25871         (JSC::X86Assembler::setPointer):
25872         (JSC::X86Assembler::setInt32):
25873         (JSC::X86Assembler::setRel32):
25874             - rename patchPointer to bring it in line with the current link/repatch naming scheme
25875
25876         * jit/JIT.cpp:
25877         (JSC::ctiPatchNearCallByReturnAddress):
25878         (JSC::ctiPatchCallByReturnAddress):
25879             - include new headers
25880             - remove MacroAssembler:: specification from RepatchBuffer usage
25881
25882         * jit/JITPropertyAccess.cpp:
25883         * yarr/RegexJIT.cpp:
25884             - include new headers
25885
25886 2009-07-21  Robert Agoston  <Agoston.Robert@stud.u-szeged.hu>
25887
25888         Reviewed by David Levin.
25889
25890         Fixed #undef typo.
25891         https://bugs.webkit.org/show_bug.cgi?id=27506
25892
25893         * bytecode/Opcode.h:
25894
25895 2009-07-21  Adam Roben  <aroben@apple.com>
25896
25897         Roll out r46153, r46154, and r46155
25898
25899         These changes were causing build failures and assertion failures on
25900         Windows.
25901
25902         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
25903         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
25904         * JavaScriptCore.xcodeproj/project.pbxproj:
25905         * runtime/JSArray.cpp:
25906         * runtime/StringPrototype.cpp:
25907         * runtime/UString.cpp:
25908         * runtime/UString.h:
25909         * wtf/FastMalloc.cpp:
25910         * wtf/FastMalloc.h:
25911         * wtf/Platform.h:
25912         * wtf/PossiblyNull.h: Removed.
25913
25914 2009-07-21  Roland Steiner  <rolandsteiner@google.com>
25915
25916         Reviewed by David Levin.
25917
25918         Add ENABLE_RUBY to list of build options
25919         https://bugs.webkit.org/show_bug.cgi?id=27324
25920
25921         * Configurations/FeatureDefines.xcconfig: Added flag ENABLE_RUBY.
25922
25923 2009-07-20  Oliver Hunt  <oliver@apple.com>
25924
25925         Build fix attempt #2
25926
25927         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
25928         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
25929
25930 2009-07-20  Oliver Hunt  <oliver@apple.com>
25931
25932         Build fix attempt #1
25933
25934         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
25935         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
25936
25937 2009-07-20  Oliver Hunt  <oliver@apple.com>
25938
25939         Reviewed by Gavin Barraclough.
25940
25941         Make it harder to misuse try* allocation routines
25942         https://bugs.webkit.org/show_bug.cgi?id=27469
25943
25944         Jump through a few hoops to make it much harder to accidentally
25945         miss null-checking of values returned by the try-* allocation
25946         routines.
25947
25948         * JavaScriptCore.xcodeproj/project.pbxproj:
25949         * runtime/JSArray.cpp:
25950         (JSC::JSArray::putSlowCase):
25951         (JSC::JSArray::increaseVectorLength):
25952         * runtime/StringPrototype.cpp:
25953         (JSC::stringProtoFuncFontsize):
25954         (JSC::stringProtoFuncLink):
25955         * runtime/UString.cpp:
25956         (JSC::allocChars):
25957         (JSC::reallocChars):
25958         (JSC::expandCapacity):
25959         (JSC::UString::Rep::reserveCapacity):
25960         (JSC::UString::expandPreCapacity):
25961         (JSC::createRep):
25962         (JSC::concatenate):
25963         (JSC::UString::spliceSubstringsWithSeparators):
25964         (JSC::UString::replaceRange):
25965         (JSC::UString::append):
25966         (JSC::UString::operator=):
25967         * runtime/UString.h:
25968         (JSC::UString::Rep::createEmptyBuffer):
25969         * wtf/FastMalloc.cpp:
25970         (WTF::tryFastZeroedMalloc):
25971         (WTF::tryFastMalloc):
25972         (WTF::tryFastCalloc):
25973         (WTF::tryFastRealloc):
25974         (WTF::TCMallocStats::tryFastMalloc):
25975         (WTF::TCMallocStats::tryFastCalloc):
25976         (WTF::TCMallocStats::tryFastRealloc):
25977         * wtf/FastMalloc.h:
25978         (WTF::TryMallocReturnValue::TryMallocReturnValue):
25979         (WTF::TryMallocReturnValue::~TryMallocReturnValue):
25980         (WTF::TryMallocReturnValue::operator Maybe<T>):
25981         (WTF::TryMallocReturnValue::getValue):
25982         * wtf/PossiblyNull.h:
25983         (WTF::PossiblyNull::PossiblyNull):
25984         (WTF::PossiblyNull::~PossiblyNull):
25985         (WTF::PossiblyNull::getValue):
25986         * wtf/Platform.h:
25987
25988 2009-07-20  Gavin Barraclough  <barraclough@apple.com>
25989
25990         RS Oliver Hunt.
25991
25992         Add ARM assembler files to xcodeproj, for convenience editing.
25993
25994         * JavaScriptCore.xcodeproj/project.pbxproj:
25995
25996 2009-07-20  Jessie Berlin  <jberlin@apple.com>
25997
25998         Reviewed by David Levin.
25999
26000         Fix an incorrect assertion in Vector::remove.
26001         
26002         https://bugs.webkit.org/show_bug.cgi?id=27477
26003
26004         * wtf/Vector.h:
26005         (WTF::::remove):
26006         Assert that the position at which to start removing elements + the
26007         length (the number of elements to remove) is less than or equal to the
26008         size of the entire Vector.
26009
26010 2009-07-20  Peter Kasting  <pkasting@google.com>
26011
26012         Reviewed by Mark Rowe.
26013
26014         https://bugs.webkit.org/show_bug.cgi?id=27468
26015         Back out r46060, which caused problems for some Apple developers.
26016
26017         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
26018         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj:
26019         * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops:
26020         * JavaScriptCore.vcproj/jsc/jscCommon.vsprops:
26021         * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops:
26022
26023 2009-07-20  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
26024
26025         Reviewed by Oliver Hunt.
26026
26027         Allow custom memory allocation control in NewThreadContext
26028         https://bugs.webkit.org/show_bug.cgi?id=27338
26029
26030         Inherits NewThreadContext struct from FastAllocBase because it
26031         has been instantiated by 'new' JavaScriptCore/wtf/Threading.cpp:76.
26032
26033         * wtf/Threading.cpp:
26034
26035 2009-07-20  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
26036
26037         Reviewed by Oliver Hunt.
26038
26039         Allow custom memory allocation control in JavaScriptCore's JSClassRef.h
26040         https://bugs.webkit.org/show_bug.cgi?id=27340
26041
26042         Inherit StaticValueEntry and StaticFunctionEntry struct from FastAllocBase because these
26043         have been instantiated by 'new' in JavaScriptCore/API/JSClassRef.cpp:153
26044         and in JavaScriptCore/API/JSClassRef.cpp:166.
26045
26046         * API/JSClassRef.h:
26047
26048 2009-07-20  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
26049
26050         Reviewed by Darin Adler.
26051
26052         Allow custom memory allocation control in JavaScriptCore's RegexPattern.h
26053         https://bugs.webkit.org/show_bug.cgi?id=27343
26054
26055         Inherits RegexPattern.h's structs (which have been instantiated by operator new) from FastAllocBase:
26056
26057         CharacterClass (new call: JavaScriptCore/yarr/RegexCompiler.cpp:144)
26058         PatternAlternative (new call: JavaScriptCore/yarr/RegexPattern.h:221) 
26059         PatternDisjunction (new call: JavaScriptCore/yarr/RegexCompiler.cpp:446)
26060
26061         * yarr/RegexPattern.h:
26062
26063 2009-07-20  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
26064
26065         Reviewed by Darin Adler.
26066
26067         Allow custom memory allocation control for JavaScriptCore's MatchFrame struct
26068         https://bugs.webkit.org/show_bug.cgi?id=27344
26069
26070         Inherits MatchFrame struct from FastAllocBase because it has
26071         been instantiated by 'new' JavaScriptCore/pcre/pcre_exec.cpp:359.
26072
26073         * pcre/pcre_exec.cpp:
26074
26075 2009-07-20  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
26076
26077         Reviewed by Holger Freyther.
26078
26079         Remove some outdated S60 platform specific code
26080         https://bugs.webkit.org/show_bug.cgi?id=27423
26081
26082         * wtf/Platform.h:
26083
26084 2009-07-20  Csaba Osztrogonac  <oszi@inf.u-szeged.hu>
26085
26086         Reviewed by Simon Hausmann.
26087
26088         Qt build fix with MSVC and MinGW.
26089
26090         * jsc.pro: Make sure jsc is a console application, and turn off
26091         exceptions and stl support to fix the build.
26092
26093 2009-07-20  Xan Lopez  <xlopez@igalia.com>
26094
26095         Reviewed by Gustavo Noronha.
26096
26097         Do not use C++-style comments in preprocessor directives.
26098
26099         GCC does not like this in some configurations, using C-style
26100         comments is safer.
26101
26102         * wtf/Platform.h:
26103
26104 2009-07-17  Peter Kasting  <pkasting@google.com>
26105
26106         Reviewed by Steve Falkenburg.
26107
26108         https://bugs.webkit.org/show_bug.cgi?id=27323
26109         Only add Cygwin to the path when it isn't already there.  This avoids
26110         causing problems for people who purposefully have non-Cygwin versions of
26111         executables like svn in front of the Cygwin ones in their paths.
26112
26113         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
26114         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj:
26115         * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops:
26116         * JavaScriptCore.vcproj/jsc/jscCommon.vsprops:
26117         * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops:
26118
26119 2009-07-17  Gabor Loki  <loki@inf.u-szeged.hu>
26120
26121         Reviewed by Gavin Barraclough.
26122
26123         Add YARR support for generic ARM platforms (disabled by default).
26124         https://bugs.webkit.org/show_bug.cgi?id=24986
26125
26126         Add generic ARM port for MacroAssembler. It supports the whole
26127         MacroAssembler functionality except floating point.
26128
26129         The class JmpSrc is extended with a flag which enables to patch
26130         the jump destination offset during execution. This feature is
26131         required for generic ARM port.
26132
26133         Signed off by Zoltan Herczeg <zherczeg@inf.u-szeged.hu>
26134         Signed off by Gabor Loki <loki@inf.u-szeged.hu>
26135
26136         * JavaScriptCore.pri:
26137         * assembler/ARMAssembler.cpp: Added.
26138         (JSC::ARMAssembler::getLdrImmAddress):
26139         (JSC::ARMAssembler::linkBranch):
26140         (JSC::ARMAssembler::patchConstantPoolLoad):
26141         (JSC::ARMAssembler::getOp2):
26142         (JSC::ARMAssembler::genInt):
26143         (JSC::ARMAssembler::getImm):
26144         (JSC::ARMAssembler::moveImm):
26145         (JSC::ARMAssembler::dataTransfer32):
26146         (JSC::ARMAssembler::baseIndexTransfer32):
26147         (JSC::ARMAssembler::executableCopy):
26148         * assembler/ARMAssembler.h: Added.
26149         (JSC::ARM::):
26150         (JSC::ARMAssembler::ARMAssembler):
26151         (JSC::ARMAssembler::):
26152         (JSC::ARMAssembler::JmpSrc::JmpSrc):
26153         (JSC::ARMAssembler::JmpSrc::enableLatePatch):
26154         (JSC::ARMAssembler::JmpDst::JmpDst):
26155         (JSC::ARMAssembler::JmpDst::isUsed):
26156         (JSC::ARMAssembler::JmpDst::used):
26157         (JSC::ARMAssembler::emitInst):
26158         (JSC::ARMAssembler::and_r):
26159         (JSC::ARMAssembler::ands_r):
26160         (JSC::ARMAssembler::eor_r):
26161         (JSC::ARMAssembler::eors_r):
26162         (JSC::ARMAssembler::sub_r):
26163         (JSC::ARMAssembler::subs_r):
26164         (JSC::ARMAssembler::rsb_r):
26165         (JSC::ARMAssembler::rsbs_r):
26166         (JSC::ARMAssembler::add_r):
26167         (JSC::ARMAssembler::adds_r):
26168         (JSC::ARMAssembler::adc_r):
26169         (JSC::ARMAssembler::adcs_r):
26170         (JSC::ARMAssembler::sbc_r):
26171         (JSC::ARMAssembler::sbcs_r):
26172         (JSC::ARMAssembler::rsc_r):
26173         (JSC::ARMAssembler::rscs_r):
26174         (JSC::ARMAssembler::tst_r):
26175         (JSC::ARMAssembler::teq_r):
26176         (JSC::ARMAssembler::cmp_r):
26177         (JSC::ARMAssembler::orr_r):
26178         (JSC::ARMAssembler::orrs_r):
26179         (JSC::ARMAssembler::mov_r):
26180         (JSC::ARMAssembler::movs_r):
26181         (JSC::ARMAssembler::bic_r):
26182         (JSC::ARMAssembler::bics_r):
26183         (JSC::ARMAssembler::mvn_r):
26184         (JSC::ARMAssembler::mvns_r):
26185         (JSC::ARMAssembler::mul_r):
26186         (JSC::ARMAssembler::muls_r):
26187         (JSC::ARMAssembler::mull_r):
26188         (JSC::ARMAssembler::ldr_imm):
26189         (JSC::ARMAssembler::ldr_un_imm):
26190         (JSC::ARMAssembler::dtr_u):
26191         (JSC::ARMAssembler::dtr_ur):
26192         (JSC::ARMAssembler::dtr_d):
26193         (JSC::ARMAssembler::dtr_dr):
26194         (JSC::ARMAssembler::ldrh_r):
26195         (JSC::ARMAssembler::ldrh_d):
26196         (JSC::ARMAssembler::ldrh_u):
26197         (JSC::ARMAssembler::strh_r):
26198         (JSC::ARMAssembler::push_r):
26199         (JSC::ARMAssembler::pop_r):
26200         (JSC::ARMAssembler::poke_r):
26201         (JSC::ARMAssembler::peek_r):
26202         (JSC::ARMAssembler::clz_r):
26203         (JSC::ARMAssembler::bkpt):
26204         (JSC::ARMAssembler::lsl):
26205         (JSC::ARMAssembler::lsr):
26206         (JSC::ARMAssembler::asr):
26207         (JSC::ARMAssembler::lsl_r):
26208         (JSC::ARMAssembler::lsr_r):
26209         (JSC::ARMAssembler::asr_r):
26210         (JSC::ARMAssembler::size):
26211         (JSC::ARMAssembler::ensureSpace):
26212         (JSC::ARMAssembler::label):
26213         (JSC::ARMAssembler::align):
26214         (JSC::ARMAssembler::jmp):
26215         (JSC::ARMAssembler::patchPointerInternal):
26216         (JSC::ARMAssembler::patchConstantPoolLoad):
26217         (JSC::ARMAssembler::patchPointer):
26218         (JSC::ARMAssembler::repatchInt32):
26219         (JSC::ARMAssembler::repatchPointer):
26220         (JSC::ARMAssembler::repatchLoadPtrToLEA):
26221         (JSC::ARMAssembler::linkJump):
26222         (JSC::ARMAssembler::relinkJump):
26223         (JSC::ARMAssembler::linkCall):
26224         (JSC::ARMAssembler::relinkCall):
26225         (JSC::ARMAssembler::getRelocatedAddress):
26226         (JSC::ARMAssembler::getDifferenceBetweenLabels):
26227         (JSC::ARMAssembler::getCallReturnOffset):
26228         (JSC::ARMAssembler::getOp2Byte):
26229         (JSC::ARMAssembler::placeConstantPoolBarrier):
26230         (JSC::ARMAssembler::RM):
26231         (JSC::ARMAssembler::RS):
26232         (JSC::ARMAssembler::RD):
26233         (JSC::ARMAssembler::RN):
26234         (JSC::ARMAssembler::getConditionalField):
26235         * assembler/ARMv7Assembler.h:
26236         (JSC::ARMv7Assembler::JmpSrc::enableLatePatch):
26237         * assembler/AbstractMacroAssembler.h:
26238         (JSC::AbstractMacroAssembler::Call::enableLatePatch):
26239         (JSC::AbstractMacroAssembler::Jump::enableLatePatch):
26240         * assembler/MacroAssembler.h:
26241         * assembler/MacroAssemblerARM.h: Added.
26242         (JSC::MacroAssemblerARM::):
26243         (JSC::MacroAssemblerARM::add32):
26244         (JSC::MacroAssemblerARM::and32):
26245         (JSC::MacroAssemblerARM::lshift32):
26246         (JSC::MacroAssemblerARM::mul32):
26247         (JSC::MacroAssemblerARM::not32):
26248         (JSC::MacroAssemblerARM::or32):
26249         (JSC::MacroAssemblerARM::rshift32):
26250         (JSC::MacroAssemblerARM::sub32):
26251         (JSC::MacroAssemblerARM::xor32):
26252         (JSC::MacroAssemblerARM::load32):
26253         (JSC::MacroAssemblerARM::load32WithAddressOffsetPatch):
26254         (JSC::MacroAssemblerARM::loadPtrWithPatchToLEA):
26255         (JSC::MacroAssemblerARM::load16):
26256         (JSC::MacroAssemblerARM::store32WithAddressOffsetPatch):
26257         (JSC::MacroAssemblerARM::store32):
26258         (JSC::MacroAssemblerARM::pop):
26259         (JSC::MacroAssemblerARM::push):
26260         (JSC::MacroAssemblerARM::move):
26261         (JSC::MacroAssemblerARM::swap):
26262         (JSC::MacroAssemblerARM::signExtend32ToPtr):
26263         (JSC::MacroAssemblerARM::zeroExtend32ToPtr):
26264         (JSC::MacroAssemblerARM::branch32):
26265         (JSC::MacroAssemblerARM::branch16):
26266         (JSC::MacroAssemblerARM::branchTest32):
26267         (JSC::MacroAssemblerARM::jump):
26268         (JSC::MacroAssemblerARM::branchAdd32):
26269         (JSC::MacroAssemblerARM::mull32):
26270         (JSC::MacroAssemblerARM::branchMul32):
26271         (JSC::MacroAssemblerARM::branchSub32):
26272         (JSC::MacroAssemblerARM::breakpoint):
26273         (JSC::MacroAssemblerARM::nearCall):
26274         (JSC::MacroAssemblerARM::call):
26275         (JSC::MacroAssemblerARM::ret):
26276         (JSC::MacroAssemblerARM::set32):
26277         (JSC::MacroAssemblerARM::setTest32):
26278         (JSC::MacroAssemblerARM::tailRecursiveCall):
26279         (JSC::MacroAssemblerARM::makeTailRecursiveCall):
26280         (JSC::MacroAssemblerARM::moveWithPatch):
26281         (JSC::MacroAssemblerARM::branchPtrWithPatch):
26282         (JSC::MacroAssemblerARM::storePtrWithPatch):
26283         (JSC::MacroAssemblerARM::supportsFloatingPoint):
26284         (JSC::MacroAssemblerARM::supportsFloatingPointTruncate):
26285         (JSC::MacroAssemblerARM::loadDouble):
26286         (JSC::MacroAssemblerARM::storeDouble):
26287         (JSC::MacroAssemblerARM::addDouble):
26288         (JSC::MacroAssemblerARM::subDouble):
26289         (JSC::MacroAssemblerARM::mulDouble):
26290         (JSC::MacroAssemblerARM::convertInt32ToDouble):
26291         (JSC::MacroAssemblerARM::branchDouble):
26292         (JSC::MacroAssemblerARM::branchTruncateDoubleToInt32):
26293         (JSC::MacroAssemblerARM::ARMCondition):
26294         (JSC::MacroAssemblerARM::prepareCall):
26295         (JSC::MacroAssemblerARM::call32):
26296         * assembler/X86Assembler.h:
26297         (JSC::X86Assembler::JmpSrc::enableLatePatch):
26298         * jit/ExecutableAllocator.h:
26299         (JSC::ExecutableAllocator::cacheFlush):
26300         * wtf/Platform.h:
26301         * yarr/RegexJIT.cpp:
26302         (JSC::Yarr::RegexGenerator::generateEnter):
26303         (JSC::Yarr::RegexGenerator::generateReturn):
26304
26305 2009-07-17  Gabor Loki  <loki@inf.u-szeged.hu>
26306
26307         Reviewed by Gavin Barraclough.
26308
26309         Extend AssemblerBuffer with constant pool handling mechanism.
26310         https://bugs.webkit.org/show_bug.cgi?id=24986
26311
26312         Add a platform independed constant pool framework.
26313         This pool can store 32 or 64 bits values which is enough to hold
26314         any integer, pointer or double constant.
26315
26316         * assembler/AssemblerBuffer.h:
26317         (JSC::AssemblerBuffer::putIntUnchecked):
26318         (JSC::AssemblerBuffer::putInt64Unchecked):
26319         (JSC::AssemblerBuffer::append):
26320         (JSC::AssemblerBuffer::grow):
26321         * assembler/AssemblerBufferWithConstantPool.h: Added.
26322         (JSC::):
26323
26324 2009-07-17  Eric Roman  <eroman@chromium.org>
26325
26326         Reviewed by Darin Adler.
26327
26328         Build fix for non-Darwin.
26329         Add a guard for inclusion of RetainPtr.h which includes CoreFoundation.h
26330
26331         https://bugs.webkit.org/show_bug.cgi?id=27382
26332
26333         * wtf/unicode/icu/CollatorICU.cpp:
26334
26335 2009-07-17  Alexey Proskuryakov  <ap@webkit.org>
26336
26337         Reviewed by John Sullivan.
26338
26339         Get user default collation order via a CFLocale API when available.
26340
26341         * wtf/unicode/icu/CollatorICU.cpp: (WTF::Collator::userDefault):
26342
26343 2009-07-17  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
26344
26345         Reviewed by Simon Hausmann.
26346
26347         [Qt] Fix the include path for the Symbian port
26348         https://bugs.webkit.org/show_bug.cgi?id=27358
26349
26350         * JavaScriptCore.pri:
26351
26352 2009-07-17  Csaba Osztrogonac  <oszi@inf.u-szeged.hu>
26353
26354         Reviewed by David Levin.
26355
26356         Build fix on platforms don't have MMAP.
26357         https://bugs.webkit.org/show_bug.cgi?id=27365
26358
26359         * interpreter/RegisterFile.h: Including stdio.h irrespectively of HAVE(MMAP)
26360
26361 2009-07-16  Fumitoshi Ukai  <ukai@chromium.org>
26362
26363         Reviewed by David Levin.
26364
26365         Add --web-sockets flag and ENABLE_WEB_SOCKETS define.
26366         https://bugs.webkit.org/show_bug.cgi?id=27206
26367         
26368         Add ENABLE_WEB_SOCKETS
26369
26370         * Configurations/FeatureDefines.xcconfig: add ENABLE_WEB_SOCKETS
26371
26372 2009-07-16  Maxime Simon  <simon.maxime@gmail.com>
26373
26374         Reviewed by Eric Seidel.
26375
26376         Added Haiku-specific files for JavaScriptCore.
26377         https://bugs.webkit.org/show_bug.cgi?id=26620
26378
26379         * wtf/haiku/MainThreadHaiku.cpp: Added.
26380         (WTF::initializeMainThreadPlatform):
26381         (WTF::scheduleDispatchFunctionsOnMainThread):
26382
26383 2009-07-16  Gavin Barraclough  <barraclough@apple.com>
26384
26385         RS by Oliver Hunt.
26386
26387         Revert r45969, this fix does not appear to be valid.
26388         https://bugs.webkit.org/show_bug.cgi?id=27077
26389
26390         * bytecode/CodeBlock.cpp:
26391         (JSC::CodeBlock::~CodeBlock):
26392         (JSC::CodeBlock::unlinkCallers):
26393         * jit/JIT.cpp:
26394         * jit/JIT.h:
26395
26396 2009-07-16  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
26397
26398         Reviewed by Oliver Hunt.
26399
26400         Allow custom memory allocation control in ExceptionInfo and RareData struct
26401         https://bugs.webkit.org/show_bug.cgi?id=27336
26402
26403         Inherits ExceptionInfo and RareData struct from FastAllocBase because these
26404         have been instantiated by 'new' in JavaScriptCore/bytecode/CodeBlock.cpp:1289 and
26405         in JavaScriptCore/bytecode/CodeBlock.h:453.
26406
26407         Remove unnecessary WTF:: namespace from CodeBlock inheritance.
26408  
26409         * bytecode/CodeBlock.h:
26410
26411 2009-07-16  Mark Rowe  <mrowe@apple.com>
26412
26413         Rubber-stamped by Geoff Garen.
26414
26415         Fix FeatureDefines.xcconfig to not be out of sync with the rest of the world.
26416
26417         * Configurations/FeatureDefines.xcconfig:
26418
26419 2009-07-16  Yong Li  <yong.li@torchmobile.com>
26420
26421          Reviewed by George Staikos.
26422
26423          https://bugs.webkit.org/show_bug.cgi?id=27320
26424          _countof is only included in CE6; for CE5 we need to define it ourself
26425
26426          * wtf/Platform.h:
26427
26428 2009-07-16  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
26429
26430         Reviewed by Oliver Hunt.
26431
26432         Workers + garbage collector: weird crashes
26433         https://bugs.webkit.org/show_bug.cgi?id=27077
26434
26435         We need to unlink cached method call sites when a function is destroyed.
26436
26437         * JavaScriptCore.xcodeproj/project.pbxproj:
26438         * bytecode/CodeBlock.cpp:
26439         (JSC::CodeBlock::~CodeBlock):
26440         (JSC::CodeBlock::unlinkCallers):
26441         * jit/JIT.cpp:
26442         (JSC::JIT::unlinkMethodCall):
26443         * jit/JIT.h:
26444
26445 2009-07-15  Steve Falkenburg  <sfalken@apple.com>
26446
26447         Windows Build fix.
26448
26449         Visual Studio reset our intermediate directory on us.
26450         This sets it back.
26451         
26452         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
26453         * JavaScriptCore.vcproj/testapi/testapi.vcproj:
26454
26455 2009-07-15  Kwang Yul Seo  <skyul@company100.net>
26456
26457         Reviewed by Eric Seidel.
26458
26459         https://bugs.webkit.org/show_bug.cgi?id=26794
26460         Make Yacc-generated parsers to use fastMalloc/fastFree.
26461         
26462         Define YYMALLOC and YYFREE to fastMalloc and fastFree
26463         respectively.
26464
26465         * parser/Grammar.y:
26466
26467 2009-07-15  Darin Adler  <darin@apple.com>
26468
26469         Fix a build for a particular Apple configuration.
26470
26471         * wtf/FastAllocBase.h: Change include to use "" style for
26472         including another wtf header. This is the style we use for
26473         including other public headers in the same directory.
26474
26475 2009-07-15  George Staikos  <george.staikos@torchmobile.com>
26476
26477         Reviewed by Adam Treat.
26478
26479         https://bugs.webkit.org/show_bug.cgi?id=27303
26480         Implement createThreadInternal for WinCE.
26481         Contains changes by George Staikos <george.staikos@torchmobile.com> and Joe Mason <joe.mason@torchmobile.com>
26482
26483         * wtf/ThreadingWin.cpp:
26484         (WTF::createThreadInternal):
26485
26486 2009-07-15  Joe Mason  <joe.mason@torchmobile.com>
26487
26488          Reviewed by George Staikos.
26489
26490          https://bugs.webkit.org/show_bug.cgi?id=27298
26491          Platform defines for WINCE.
26492          Contains changes by Yong Li <yong.li@torchmobile.com>,
26493          George Staikos <george.staikos@torchmobile.com> and Joe Mason <joe.mason@torchmobile.com>
26494
26495          * wtf/Platform.h:
26496
26497 2009-07-15  Yong Li  <yong.li@torchmobile.com>
26498
26499          Reviewed by Adam Treat.
26500
26501          https://bugs.webkit.org/show_bug.cgi?id=27306
26502          Use RegisterClass instead of RegisterClassEx on WinCE.
26503
26504          * wtf/win/MainThreadWin.cpp:
26505          (WTF::initializeMainThreadPlatform):
26506
26507 2009-07-15  Yong Li  <yong.li@torchmobile.com>
26508
26509          Reviewed by George Staikos.
26510
26511          https://bugs.webkit.org/show_bug.cgi?id=27301
26512          Use OutputDebugStringW on WinCE since OutputDebugStringA is not supported
26513          Originally written by Yong Li <yong.li@torchmobile.com> and refactored by
26514          Joe Mason <joe.mason@torchmobile.com>
26515
26516          * wtf/Assertions.cpp: vprintf_stderr_common
26517
26518 2009-07-15  Yong Li  <yong.li@torchmobile.com>
26519
26520          Reviewed by George Staikos.
26521
26522          https://bugs.webkit.org/show_bug.cgi?id=27020
26523          msToGregorianDateTime should set utcOffset to 0 when outputIsUTC is false
26524
26525          * wtf/DateMath.cpp:
26526          (WTF::gregorianDateTimeToMS):
26527
26528 2009-07-15  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
26529
26530         Reviewed by Simon Hausmann.
26531
26532         [Qt] Cleanup - Remove obsolete code from the make system
26533         https://bugs.webkit.org/show_bug.cgi?id=27299
26534
26535         * JavaScriptCore.pro:
26536         * jsc.pro:
26537
26538 2009-07-07  Norbert Leser  <norbert.leser@nokia.com>
26539
26540         Reviewed by Simon Hausmann.
26541
26542         https://bugs.webkit.org/show_bug.cgi?id=27056
26543
26544         Alternate bool operator for codewarrior compiler (WINSCW).
26545         Compiler (latest b482) reports error for UnspecifiedBoolType construct:
26546         "illegal explicit conversion from 'WTF::OwnArrayPtr<JSC::Register>' to 'bool'"
26547
26548         Same fix as in r38391.
26549
26550         * JavaScriptCore/wtf/OwnArrayPtr.h:
26551
26552 2009-07-15  Norbert Leser  <norbert.leser@nokia.com>
26553
26554         Reviewed by Darin Adler.
26555
26556         Qualify include path with wtf to fix compilation
26557         on Symbian.
26558         https://bugs.webkit.org/show_bug.cgi?id=27055
26559
26560         * interpreter/Interpreter.h:
26561
26562 2009-07-15  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
26563
26564         Reviewed by Dave Kilzer.
26565
26566         Turn off non-portable date manipulations for SYMBIAN
26567         https://bugs.webkit.org/show_bug.cgi?id=27064
26568
26569         Introduce HAVE(TM_GMTOFF), HAVE(TM_ZONE) and HAVE(TIMEGM) guards 
26570         and place the rules for controlling the guards in Platform.h.
26571         Turn off these newly introduced guards for SYMBIAN.
26572
26573         * wtf/DateMath.cpp:
26574         (WTF::calculateUTCOffset):
26575         * wtf/DateMath.h:
26576         (WTF::GregorianDateTime::GregorianDateTime):
26577         (WTF::GregorianDateTime::operator tm):
26578         * wtf/Platform.h:
26579
26580 2009-07-15  Norbert Leser  <norbert.leser@nokia.com>
26581
26582         Reviewed by Simon Hausmann.
26583
26584         Undef ASSERT on Symbian, to avoid excessive warnings
26585         https://bugs.webkit.org/show_bug.cgi?id=27052
26586
26587         * wtf/Assertions.h:
26588
26589 2009-07-15  Oliver Hunt  <oliver@apple.com>
26590
26591         Reviewed by Simon Hausmann.
26592
26593         REGRESSION: fast/js/postfix-syntax.html fails with interpreter
26594         https://bugs.webkit.org/show_bug.cgi?id=27294
26595
26596         When postfix operators operating on locals assign to the same local
26597         the order of operations has to be to store the incremented value, then
26598         store the unmodified number.  Rather than implementing this subtle
26599         semantic in the interpreter I've just made the logic explicit in the
26600         bytecode generator, so x=x++ effectively becomes x=ToNumber(x) (for a
26601         local var x).
26602
26603         * parser/Nodes.cpp:
26604         (JSC::emitPostIncOrDec):
26605
26606 2009-07-15  Oliver Hunt  <oliver@apple.com>
26607
26608         Reviewed by Simon Hausmann.
26609
26610         REGRESSION(43559): fast/js/kde/arguments-scope.html fails with interpreter
26611         https://bugs.webkit.org/show_bug.cgi?id=27259
26612
26613         The interpreter was incorrectly basing its need to create the arguments object
26614         based on the presence of the callframe's argument reference rather than the local
26615         arguments reference.  Based on this it then overrode the local variable reference.
26616
26617         * interpreter/Interpreter.cpp:
26618         (JSC::Interpreter::privateExecute):
26619
26620 2009-07-14  Steve Falkenburg  <sfalken@apple.com>
26621
26622         Reorganize JavaScriptCore headers into:
26623         API: include/JavaScriptCore/
26624         Private: include/private/JavaScriptCore/
26625
26626         Reviewed by Darin Adler.
26627
26628         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
26629         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
26630         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
26631         * JavaScriptCore.vcproj/testapi/testapi.vcproj:
26632         * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops:
26633
26634 2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
26635
26636         Reviewed by Darin Adler.
26637
26638         Change JSCell's superclass to NoncopyableCustomAllocated
26639         https://bugs.webkit.org/show_bug.cgi?id=27248
26640
26641         JSCell class customizes operator new, since Noncopyable will be 
26642         inherited from FastAllocBase, NoncopyableCustomAllocated has 
26643         to be used.
26644
26645         * runtime/JSCell.h:
26646
26647 2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
26648
26649         Reviewed by Darin Adler.
26650
26651         Change all Noncopyable inheriting visibility to public.
26652         https://bugs.webkit.org/show_bug.cgi?id=27225
26653
26654         Change all Noncopyable inheriting visibility to public because
26655         it is needed to the custom allocation framework (bug #20422).
26656
26657         * bytecode/SamplingTool.h:
26658         * bytecompiler/RegisterID.h:
26659         * interpreter/CachedCall.h:
26660         * interpreter/RegisterFile.h:
26661         * parser/Lexer.h:
26662         * parser/Parser.h:
26663         * runtime/ArgList.h:
26664         * runtime/BatchedTransitionOptimizer.h:
26665         * runtime/Collector.h:
26666         * runtime/CommonIdentifiers.h:
26667         * runtime/JSCell.h:
26668         * runtime/JSGlobalObject.h:
26669         * runtime/JSLock.h:
26670         * runtime/JSONObject.cpp:
26671         * runtime/SmallStrings.cpp:
26672         * runtime/SmallStrings.h:
26673         * wtf/CrossThreadRefCounted.h:
26674         * wtf/GOwnPtr.h:
26675         * wtf/Locker.h:
26676         * wtf/MessageQueue.h:
26677         * wtf/OwnArrayPtr.h:
26678         * wtf/OwnFastMallocPtr.h:
26679         * wtf/OwnPtr.h:
26680         * wtf/RefCounted.h:
26681         * wtf/ThreadSpecific.h:
26682         * wtf/Threading.h:
26683         * wtf/Vector.h:
26684         * wtf/unicode/Collator.h:
26685
26686 2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
26687
26688         Reviewed by Darin Adler.
26689
26690         Change ParserArenaRefCounted's superclass to RefCountedCustomAllocated
26691         https://bugs.webkit.org/show_bug.cgi?id=27249
26692
26693         ParserArenaDeletable customizes operator new, to avoid double inheritance
26694         ParserArenaDeletable's superclass has been changed to RefCountedCustomAllocated.
26695
26696         * parser/Nodes.h:
26697
26698 2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
26699
26700         Reviewed by Darin Adler.
26701
26702         Add RefCountedCustomAllocated to RefCounted.h
26703         https://bugs.webkit.org/show_bug.cgi?id=27232
26704
26705         Some class which are inherited from RefCounted customize
26706         operator new, but RefCounted is inherited from Noncopyable
26707         which will be inherited from FastAllocBase. To avoid
26708         conflicts Noncopyable inheriting was moved down to RefCounted
26709         and to avoid double inheritance this class has been added.
26710
26711         * wtf/RefCounted.h:
26712         (WTF::RefCountedCustomAllocated::deref):
26713         (WTF::RefCountedCustomAllocated::~RefCountedCustomAllocated):
26714
26715 2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
26716
26717         Reviewed by Darin Adler.
26718
26719         Add NoncopyableCustomAllocated to Noncopyable.h.
26720         https://bugs.webkit.org/show_bug.cgi?id=27228
26721         
26722         Some classes which inherited from Noncopyable overrides operator new
26723         since Noncopyable'll be inherited from FastAllocBase, Noncopyable.h 
26724         needs to be extended with this new class to support the overriding. 
26725
26726         * wtf/Noncopyable.h:
26727         (WTFNoncopyable::NoncopyableCustomAllocated::NoncopyableCustomAllocated):
26728         (WTFNoncopyable::NoncopyableCustomAllocated::~NoncopyableCustomAllocated):
26729
26730 2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
26731
26732         Reviewed by Darin Adler.
26733
26734         Allow custom memory allocation control for JavaScriptCore's IdentifierTable class
26735         https://bugs.webkit.org/show_bug.cgi?id=27260
26736
26737         Inherits IdentifierTable class from FastAllocBase because it has been
26738         instantiated by 'new' in JavaScriptCore/runtime/Identifier.cpp:70.
26739
26740         * runtime/Identifier.cpp:
26741
26742 2009-07-14  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
26743
26744         Reviewed by Darin Adler.
26745
26746         Allow custom memory allocation control for JavaScriptCore's Profiler class
26747         https://bugs.webkit.org/show_bug.cgi?id=27253
26748
26749         Inherits Profiler class from FastAllocBase because it has been instantiated by
26750         'new' in JavaScriptCore/profiler/Profiler.cpp:56.
26751
26752         * profiler/Profiler.h:
26753
26754 2009-07-06  George Staikos  <george.staikos@torchmobile.com>
26755
26756         Reviewed by Adam Treat.
26757
26758         Authors: George Staikos <george.staikos@torchmobile.com>, Joe Mason <joe.mason@torchmobile.com>, Makoto Matsumoto <matumoto@math.keio.ac.jp>, Takuji Nishimura
26759
26760         https://bugs.webkit.org/show_bug.cgi?id=27030
26761         Implement custom RNG for WinCE using Mersenne Twister
26762
26763         * wtf/RandomNumber.cpp:
26764         (WTF::randomNumber):
26765         * wtf/RandomNumberSeed.h:
26766         (WTF::initializeRandomNumberGenerator):
26767         * wtf/wince/mt19937ar.c: Added.
26768         (init_genrand):
26769         (init_by_array):
26770         (genrand_int32):
26771         (genrand_int31):
26772         (genrand_real1):
26773         (genrand_real2):
26774         (genrand_real3):
26775         (genrand_res53):
26776
26777 2009-07-13  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
26778
26779         Unreviewed make dist build fix.
26780
26781         * GNUmakefile.am:
26782
26783 2009-07-13  Drew Wilson  <atwilson@google.com>
26784
26785         Reviewed by David Levin.
26786
26787         Add ENABLE(SHARED_WORKERS) flag and define SharedWorker APIs
26788         https://bugs.webkit.org/show_bug.cgi?id=26932
26789
26790         Added ENABLE(SHARED_WORKERS) flag (off by default).
26791
26792         * Configurations/FeatureDefines.xcconfig:
26793
26794 2009-07-07  Norbert Leser  <norbert.leser@nokia.com>
26795
26796         Reviewed by Maciej Stachoviak.
26797
26798         https://bugs.webkit.org/show_bug.cgi?id=27058
26799
26800         Removed superfluous parenthesis around single expression.
26801         Compilers on Symbian platform fail to properly parse and compile.
26802
26803         * JavaScriptCore/wtf/Platform.h:
26804
26805 2009-07-13  Norbert Leser  <norbert.leser@nokia.com>
26806
26807         Reviewed by Maciej Stachoviak.
26808
26809         https://bugs.webkit.org/show_bug.cgi?id=27054
26810
26811         Renamed Translator to HashTranslator
26812
26813         Codewarrior compiler (WINSCW) latest b482 cannot resolve typename
26814         mismatch between template declaration and definition
26815         (HashTranslator / Translator)
26816
26817         * wtf/HashSet.h:
26818
26819 2009-07-13  Norbert Leser  <norbert.leser@nokia.com>
26820
26821         Reviewed by Eric Seidel.
26822
26823         https://bugs.webkit.org/show_bug.cgi?id=27053
26824
26825         Ambiguity in LabelScope initialization
26826
26827         Codewarrior compiler (WINSCW) latest b482 on Symbian cannot resolve
26828         type of "0" unambiguously. Set expression explicitly to
26829         PassRefPtr<Label>::PassRefPtr()
26830
26831         * bytecompiler/BytecodeGenerator.cpp
26832
26833 2009-07-11  Simon Fraser  <simon.fraser@apple.com>
26834
26835         Enable support for accelerated compositing and 3d transforms on Leopard.
26836         <https://bugs.webkit.org/show_bug.cgi?id=20166>
26837         <rdar://problem/6120614>
26838
26839         Reviewed by Oliver Hunt.
26840
26841         * Configurations/FeatureDefines.xcconfig:
26842         * wtf/Platform.h:
26843
26844 2009-07-10  Mark Rowe  <mrowe@apple.com>
26845
26846         Second part of the "make Windows happier" dance.
26847
26848         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
26849         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
26850
26851 2009-07-10  Mark Rowe  <mrowe@apple.com>
26852
26853         Try and make the Windows build happy.
26854
26855         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
26856         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
26857
26858 2009-07-10  Kevin McCullough  <kmccullough@apple.com>
26859
26860         Reviewed by Geoffrey Garen.
26861
26862         * debugger/Debugger.h: Made this function virtual for use in WebCore's
26863         WebInspector.
26864
26865 2009-07-10  Kwang Yul Seo  <skyul@company100.net>
26866
26867         Reviewed by Darin Adler.
26868
26869         ParserArenaDeletable should override delete
26870         https://bugs.webkit.org/show_bug.cgi?id=26790
26871
26872         ParserArenaDeletable overrides new, but it does not override delete.
26873         ParserArenaDeletable must be freed by fastFree
26874         because it is allocated by fastMalloc.
26875
26876         * parser/NodeConstructors.h:
26877         (JSC::ParserArenaDeletable::operator delete):
26878         * parser/Nodes.h:
26879
26880 2009-07-10  Adam Roben  <aroben@apple.com>
26881
26882         Sort all our Xcode projects
26883
26884         Accomplished using sort-Xcode-project-file.
26885
26886         Requested by Dave Kilzer.
26887
26888         * JavaScriptCore.xcodeproj/project.pbxproj:
26889
26890 2009-07-09  Maciej Stachowiak  <mjs@apple.com>
26891
26892         Not reviewed, build fix.
26893
26894         Windows build fix for the last change.
26895
26896         * wtf/dtoa.cpp: Forgot to include Vector.h
26897
26898 2009-07-09  Maciej Stachowiak  <mjs@apple.com>
26899
26900         Reviewed by Darin Adler.
26901
26902         REGRESSION: crash in edge cases of floating point parsing.
26903         https://bugs.webkit.org/show_bug.cgi?id=27110
26904         <rdar://problem/7044458>
26905         
26906         Tests: fast/css/number-parsing-crash.html
26907                fast/css/number-parsing-crash.html
26908                fast/js/number-parsing-crash.html
26909         
26910         * wtf/dtoa.cpp:
26911         (WTF::BigInt::BigInt): Converted this to more a proper class, using a Vector
26912         with inline capacity
26913
26914         (WTF::lshift): Rearranged logic somewhat nontrivially to deal with the new way of sizing BigInts.
26915         Added an assertion to verify that invariants are maintained.
26916
26917         All other functions are adapted fairly mechanically to the above changes.
26918         (WTF::BigInt::clear):
26919         (WTF::BigInt::size):
26920         (WTF::BigInt::resize):
26921         (WTF::BigInt::words):
26922         (WTF::BigInt::append):
26923         (WTF::multadd):
26924         (WTF::s2b):
26925         (WTF::i2b):
26926         (WTF::mult):
26927         (WTF::cmp):
26928         (WTF::diff):
26929         (WTF::b2d):
26930         (WTF::d2b):
26931         (WTF::ratio):
26932         (WTF::strtod):
26933         (WTF::quorem):
26934         (WTF::dtoa):
26935
26936 2009-07-09  Drew Wilson  <atwilson@google.com>
26937
26938         Reviewed by Alexey Proskuryakov.
26939
26940         Turned on CHANNEL_MESSAGING by default because the MessageChannel API
26941         can now be implemented for Web Workers and is reasonably stable.
26942
26943         * Configurations/FeatureDefines.xcconfig:
26944
26945 2009-07-09  Oliver Hunt  <oliver@apple.com>
26946
26947         * interpreter/Interpreter.cpp:
26948         (JSC::Interpreter::privateExecute):
26949
26950 2009-07-09  Oliver Hunt  <oliver@apple.com>
26951
26952         Reviewed by Darin Adler.
26953
26954         Bug 27016 - Interpreter crashes due to invalid array indexes
26955         <https://bugs.webkit.org/show_bug.cgi?id=27016>
26956
26957         Unsigned vs signed conversions results in incorrect behaviour in
26958         64bit interpreter builds.
26959
26960         * interpreter/Interpreter.cpp:
26961         (JSC::Interpreter::privateExecute):
26962
26963 2009-07-09  Dimitri Glazkov  <dglazkov@chromium.org>
26964
26965         Reviewed by Darin Fisher.
26966
26967         [Chromium] Upstream JavaScriptCore.gypi, the project file for Chromium build.
26968         https://bugs.webkit.org/show_bug.cgi?id=27135
26969
26970         * JavaScriptCore.gypi: Added.
26971
26972 2009-07-09  Joe Mason  <joe.mason@torchmobile.com>
26973
26974         Reviewed by George Staikos.
26975         
26976         Authors: Yong Li <yong.li@torchmobile.com>, Joe Mason <joe.mason@torchmobile.com>
26977
26978         https://bugs.webkit.org/show_bug.cgi?id=27031
26979         Add an override for deleteOwnedPtr(HDC) on Windows
26980         
26981         * wtf/OwnPtrCommon.h:
26982         * wtf/OwnPtrWin.cpp:
26983         (WTF::deleteOwnedPtr):
26984
26985 2009-07-09  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
26986
26987         Reviewed by Darin Adler.
26988
26989         Guard singal.h dependency with HAVE(SIGNAL_H) to enable building jsc
26990         on SYMBIAN.
26991
26992         https://bugs.webkit.org/show_bug.cgi?id=27026
26993
26994         Based on Norbert Leser's work.
26995
26996         * jsc.cpp:
26997         (printUsageStatement):
26998         (parseArguments):
26999         * wtf/Platform.h:
27000
27001 2009-07-07  Gavin Barraclough  <barraclough@apple.com>
27002
27003         Reviewed by Sam Weinig.
27004
27005         Stop loading constants into the register file.
27006
27007         Instead, use high register values (highest bit bar the sign bit set) to indicate
27008         constants in the instruction stream, and when we encounter such a value load it
27009         directly from the CodeBlock.
27010
27011         Since constants are no longer copied into the register file, this patch renders
27012         the 'unexpected constant' mechanism redundant, and removes it.
27013
27014         2% improvement, thanks to Sam Weinig.
27015
27016         * bytecode/CodeBlock.cpp:
27017         (JSC::CodeBlock::dump):
27018         (JSC::CodeBlock::CodeBlock):
27019         (JSC::CodeBlock::mark):
27020         (JSC::CodeBlock::shrinkToFit):
27021         * bytecode/CodeBlock.h:
27022         (JSC::CodeBlock::isTemporaryRegisterIndex):
27023         (JSC::CodeBlock::constantRegister):
27024         (JSC::CodeBlock::isConstantRegisterIndex):
27025         (JSC::CodeBlock::getConstant):
27026         (JSC::ExecState::r):
27027         * bytecode/Opcode.h:
27028         * bytecompiler/BytecodeGenerator.cpp:
27029         (JSC::BytecodeGenerator::preserveLastVar):
27030         (JSC::BytecodeGenerator::BytecodeGenerator):
27031         (JSC::BytecodeGenerator::addConstantValue):
27032         (JSC::BytecodeGenerator::emitEqualityOp):
27033         (JSC::BytecodeGenerator::emitLoad):
27034         (JSC::BytecodeGenerator::emitResolveBase):
27035         (JSC::BytecodeGenerator::emitResolveWithBase):
27036         (JSC::BytecodeGenerator::emitNewError):
27037         * bytecompiler/BytecodeGenerator.h:
27038         (JSC::BytecodeGenerator::emitNode):
27039         * interpreter/CallFrame.h:
27040         (JSC::ExecState::noCaller):
27041         (JSC::ExecState::hasHostCallFrameFlag):
27042         (JSC::ExecState::addHostCallFrameFlag):
27043         (JSC::ExecState::removeHostCallFrameFlag):
27044         * interpreter/Interpreter.cpp:
27045         (JSC::Interpreter::resolve):
27046         (JSC::Interpreter::resolveSkip):
27047         (JSC::Interpreter::resolveGlobal):
27048         (JSC::Interpreter::resolveBase):
27049         (JSC::Interpreter::resolveBaseAndProperty):
27050         (JSC::Interpreter::resolveBaseAndFunc):
27051         (JSC::Interpreter::dumpRegisters):
27052         (JSC::Interpreter::throwException):
27053         (JSC::Interpreter::createExceptionScope):
27054         (JSC::Interpreter::privateExecute):
27055         (JSC::Interpreter::retrieveArguments):
27056         * jit/JIT.cpp:
27057         (JSC::JIT::privateCompileMainPass):
27058         * jit/JITInlineMethods.h:
27059         (JSC::JIT::emitLoadDouble):
27060         (JSC::JIT::emitLoadInt32ToDouble):
27061         * jit/JITOpcodes.cpp:
27062         (JSC::JIT::emit_op_new_error):
27063         (JSC::JIT::emit_op_enter):
27064         (JSC::JIT::emit_op_enter_with_activation):
27065         * parser/Nodes.cpp:
27066         (JSC::DeleteResolveNode::emitBytecode):
27067         (JSC::DeleteValueNode::emitBytecode):
27068         (JSC::PrefixResolveNode::emitBytecode):
27069         * runtime/JSActivation.cpp:
27070         (JSC::JSActivation::JSActivation):
27071         * wtf/Platform.h:
27072
27073 2009-07-07  Mark Rowe  <mrowe@apple.com>
27074
27075         Reviewed by Darin Adler.
27076
27077         Fix <https://bugs.webkit.org/show_bug.cgi?id=27025> / <rdar://problem/7033448>.
27078         Bug 27025: Crashes and regression test failures related to regexps in 64-bit
27079
27080         For x86_64 RegexGenerator uses rbx, a callee-save register, as a scratch register but
27081         neglects to save and restore it.  The change in handling of the output vector in r45545
27082         altered code generation so that the RegExp::match was now storing important data in rbx,
27083         which caused crashes and bogus results when it was clobbered.
27084
27085         * yarr/RegexJIT.cpp:
27086         (JSC::Yarr::RegexGenerator::generateEnter): Save rbx.
27087         (JSC::Yarr::RegexGenerator::generateReturn): Restore rbx.
27088
27089 2009-07-06  Ada Chan  <adachan@apple.com>
27090
27091         Reviewed by Darin Adler and Mark Rowe.
27092
27093         Decommitted spans are added to the list of normal spans rather than 
27094         the returned spans in TCMalloc_PageHeap::Delete().
27095         https://bugs.webkit.org/show_bug.cgi?id=26998
27096         
27097         In TCMalloc_PageHeap::Delete(), the deleted span can be decommitted in 
27098         the process of merging with neighboring spans that are also decommitted.  
27099         The merged span needs to be placed in the list of returned spans (spans 
27100         whose memory has been returned to the system).  Right now it's always added 
27101         to the list of the normal spans which can theoretically cause thrashing.  
27102
27103         * wtf/FastMalloc.cpp:
27104         (WTF::TCMalloc_PageHeap::Delete):
27105
27106 2009-07-05  Lars Knoll  <lars.knoll@nokia.com>
27107
27108         Reviewed by Maciej Stachowiak.
27109
27110         https://bugs.webkit.org/show_bug.cgi?id=26843
27111
27112         Fix run-time crashes in JavaScriptCore with the Metrowerks compiler on Symbian.
27113
27114         The Metrowerks compiler on the Symbian platform moves the globally
27115         defined Hashtables into read-only memory, despite one of the members
27116         being mutable. This causes crashes at run-time due to write access to
27117         read-only memory.
27118
27119         Avoid the use of const with this compiler by introducing the
27120         JSC_CONST_HASHTABLE macro.
27121
27122         Based on idea by Norbert Leser.
27123
27124         * runtime/Lookup.h: Define JSC_CONST_HASHTABLE as const for !WINSCW.
27125         * create_hash_table: Use JSC_CONST_HASHTABLE for hashtables.
27126         * runtime/JSGlobalData.cpp: Import various global hashtables via the macro.
27127
27128 2009-07-04  Dan Bernstein  <mitz@apple.com>
27129
27130         - debug build fix
27131
27132         * runtime/RegExpConstructor.cpp:
27133         (JSC::RegExpConstructor::getLastParen):
27134
27135 2009-07-03  Yong Li  <yong.li@torchmobile.com>
27136
27137         Reviewed by Maciej Stachowiak (and revised slightly)
27138
27139         RegExp::match to be optimized
27140         https://bugs.webkit.org/show_bug.cgi?id=26957
27141
27142         Allow regexp matching to use Vectors with inline capacity instead of
27143         allocating a new ovector buffer every time.
27144         
27145         ~5% speedup on SunSpider string-unpack-code test, 0.3% on SunSpider overall.
27146
27147         * runtime/RegExp.cpp:
27148         (JSC::RegExp::match):
27149         * runtime/RegExp.h:
27150         * runtime/RegExpConstructor.cpp:
27151         (JSC::RegExpConstructorPrivate::RegExpConstructorPrivate):
27152         (JSC::RegExpConstructorPrivate::lastOvector):
27153         (JSC::RegExpConstructorPrivate::tempOvector):
27154         (JSC::RegExpConstructorPrivate::changeLastOvector):
27155         (JSC::RegExpConstructor::performMatch):
27156         (JSC::RegExpMatchesArray::RegExpMatchesArray):
27157         (JSC::RegExpMatchesArray::fillArrayInstance):
27158         (JSC::RegExpConstructor::getBackref):
27159         (JSC::RegExpConstructor::getLastParen):
27160         (JSC::RegExpConstructor::getLeftContext):
27161         (JSC::RegExpConstructor::getRightContext):
27162         * runtime/StringPrototype.cpp:
27163         (JSC::stringProtoFuncSplit):
27164
27165 2009-06-30  Kwang Yul Seo  <skyul@company100.net>
27166
27167         Reviewed by Eric Seidel.
27168
27169         Override operator new/delete with const std::nothrow_t& as the second
27170         argument.
27171         https://bugs.webkit.org/show_bug.cgi?id=26792
27172
27173         On Windows CE, operator new/delete, new[]/delete[] with const
27174         std::nothrow_t& must be overrided because some standard template
27175         libraries use these operators.
27176
27177         The problem occurs when memory allocated by new(size_t s, const
27178         std::nothrow_t&) is freed by delete(void* p). This causes the umatched
27179         malloc/free problem.
27180
27181         The patch overrides all new, delete, new[] and delete[] to use
27182         fastMaloc and fastFree consistently.
27183
27184         * wtf/FastMalloc.h:
27185         (throw):
27186
27187 2009-06-30  Gabor Loki  <loki@inf.u-szeged.hu>
27188
27189         Reviewed by Sam Weinig.
27190
27191         <https://bugs.webkit.org/show_bug.cgi?id=24986>
27192
27193         Remove unnecessary references to AssemblerBuffer.
27194
27195         * interpreter/Interpreter.cpp:
27196         * interpreter/Interpreter.h:
27197
27198 2009-06-29  David Levin  <levin@chromium.org>
27199
27200         Reviewed by Oliver Hunt.
27201
27202         Still seeing occasional leaks from UString::sharedBuffer code
27203         https://bugs.webkit.org/show_bug.cgi?id=26420
27204
27205         The problem is that the pointer to the memory allocation isn't visible
27206         by "leaks" due to the lower bits being used as flags.  The fix is to
27207         make the pointer visible in memory (in debug only). The downside of
27208         this fix that the memory allocated by sharedBuffer will still look like
27209         a leak in non-debug builds when any flags are set.
27210
27211         * wtf/PtrAndFlags.h:
27212         (WTF::PtrAndFlags::set):
27213
27214 2009-06-29  Sam Weinig  <sam@webkit.org>
27215
27216         Reviewed by Mark Rowe.
27217
27218         Remove more unused scons support.
27219
27220         * SConstruct: Removed.
27221
27222 2009-06-29  Oliver Hunt  <oliver@apple.com>
27223
27224         Reviewed by Gavin Barraclough.
27225
27226         <rdar://problem/7016214> JSON.parse fails to parse valid JSON with most Unicode characters
27227         <https://bugs.webkit.org/show_bug.cgi?id=26802>
27228
27229         In the original JSON.parse patch unicode was handled correctly, however in some last
27230         minute "clean up" I oversimplified isSafeStringCharacter.  This patch corrects this bug.
27231
27232         * runtime/LiteralParser.cpp:
27233         (JSC::isSafeStringCharacter):
27234         (JSC::LiteralParser::Lexer::lexString):
27235
27236 2009-06-26  Oliver Hunt  <oliver@apple.com>
27237
27238         Reviewed by Dan Bernstein.
27239
27240         <rdar://problem/7009684> REGRESSION(r45039): Crashes inside JSEvent::put on PowerPC (26746)
27241         <https://bugs.webkit.org/show_bug.cgi?id=26746>
27242
27243         Fix for r45039 incorrectly uncached a get_by_id by converting it to put_by_id.  Clearly this
27244         is less than correct.  This patch corrects that error.
27245
27246         * interpreter/Interpreter.cpp:
27247         (JSC::Interpreter::tryCacheGetByID):
27248
27249 2009-06-26  Eric Seidel  <eric@webkit.org>
27250
27251         No review, only rolling out r45259.
27252
27253         Roll out r45259 after crash appeared on the bots:
27254         plugins/undefined-property-crash.html
27255         ASSERTION FAILED: s <= HeapConstants<heapType>::cellSize
27256         (leopard-intel-debug-tests/build/JavaScriptCore/runtime/Collector.cpp:278
27257         void* JSC::Heap::heapAllocate(size_t) [with JSC::HeapType heapType = PrimaryHeap])
27258
27259         * runtime/DateInstance.cpp:
27260         * runtime/Identifier.cpp:
27261         * runtime/Lookup.h:
27262         * runtime/RegExpConstructor.cpp:
27263         * runtime/RegExpObject.h:
27264         * runtime/ScopeChain.h:
27265         * runtime/UString.h:
27266
27267 2009-06-26  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
27268
27269         Reviewed by Simon Hausmann.
27270
27271         Add support for QDataStream operators to Vector.
27272
27273         * wtf/Vector.h:
27274         (WTF::operator<<):
27275         (WTF::operator>>):
27276
27277 2009-06-24  Sam Weinig  <sam@webkit.org>
27278
27279         Reviewed by Gavin Barraclough.
27280
27281         Make the opcode sampler work once again.
27282
27283         * jit/JIT.h:
27284         (JSC::JIT::compileGetByIdProto):
27285         (JSC::JIT::compileGetByIdSelfList):
27286         (JSC::JIT::compileGetByIdProtoList):
27287         (JSC::JIT::compileGetByIdChainList):
27288         (JSC::JIT::compileGetByIdChain):
27289         (JSC::JIT::compilePutByIdTransition):
27290         (JSC::JIT::compileCTIMachineTrampolines):
27291         (JSC::JIT::compilePatchGetArrayLength):
27292         * jit/JITStubCall.h:
27293         (JSC::JITStubCall::call):
27294
27295 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
27296
27297         Reviewed by Maciej Stachowiak.
27298
27299         Extend FastAllocBase.h with 'using WTF::FastAllocBase' to avoid
27300         unnecessary WTF:: usings.
27301         Remove existing unnecessary WTF:: usings.
27302
27303         * interpreter/Interpreter.h:
27304         * profiler/CallIdentifier.h:
27305         * runtime/ScopeChain.h:
27306         * wtf/FastAllocBase.h:
27307
27308 2009-06-24  David Levin  <levin@chromium.org>
27309
27310         Fix all builds.
27311
27312         * bytecode/CodeBlock.h:
27313         * bytecompiler/BytecodeGenerator.h:
27314         * interpreter/Register.h:
27315
27316 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
27317
27318         Reviewed by Maciej Stachowiak.
27319         
27320         https://bugs.webkit.org/show_bug.cgi?id=26677
27321
27322         Inherits CodeBlock class from FastAllocBase because it
27323         has been instantiated by 'new' in JavaScriptCore/bytecode/CodeBlock.h:217.
27324
27325         * bytecode/CodeBlock.h:
27326
27327 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
27328
27329         Reviewed by Maciej Stachowiak.
27330         
27331         https://bugs.webkit.org/show_bug.cgi?id=26676
27332
27333         Inherits BytecodeGenerator class from FastAllocBase because it has been
27334         instantiated by 'new' in JavaScriptCore/parser/Nodes.cpp:1892.
27335
27336         * bytecompiler/BytecodeGenerator.h:
27337
27338 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
27339
27340         Reviewed by Maciej Stachowiak.
27341         
27342         https://bugs.webkit.org/show_bug.cgi?id=26675
27343
27344         Inherits Register class from FastAllocBase because it has been
27345         instantiated by 'new' in JavaScriptCore/runtime/JSVariableObject.h:149.
27346
27347         * interpreter/Register.h:
27348
27349 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
27350
27351         Reviewed by Darin Adler.
27352         
27353         https://bugs.webkit.org/show_bug.cgi?id=26674
27354
27355         Inherits HashMap class from FastAllocBase because it has been
27356         instantiated by 'new' in JavaScriptCore/runtime/Structure.cpp:458.
27357
27358         * wtf/HashMap.h:
27359
27360 2009-06-24  Oliver Hunt  <oliver@apple.com>
27361
27362         Reviewed by Darin Adler.
27363
27364         <rdar://problem/6940519> REGRESSION (Safari 4 Public Beta - TOT): google.com/adplanner shows blank page instead of site details in "basic research'
27365
27366         The problem was caused by the page returned with a function using a
27367         var declaration list containing around ~3000 variables.  The solution
27368         to this is to flatten the comma expression representation and make
27369         codegen comma expressions and initializer lists iterative rather than
27370         recursive.
27371
27372         * parser/Grammar.y:
27373         * parser/NodeConstructors.h:
27374         (JSC::CommaNode::CommaNode):
27375         * parser/Nodes.cpp:
27376         (JSC::CommaNode::emitBytecode):
27377         * parser/Nodes.h:
27378         (JSC::ExpressionNode::isCommaNode):
27379         (JSC::CommaNode::isCommaNode):
27380         (JSC::CommaNode::append):
27381
27382 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
27383
27384         Reviewed by Maciej Stachowiak.
27385
27386         https://bugs.webkit.org/show_bug.cgi?id=26645
27387
27388         Inherits ScopeChainNode class from FastAllocBase because it has been
27389         instantiated by 'new' in JavaScriptCore/runtime/ScopeChain.h:95.
27390
27391         * wtf/RefPtr.h:
27392
27393 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
27394
27395         Reviewed by Darin Adler.
27396
27397         https://bugs.webkit.org/show_bug.cgi?id=26648
27398
27399         Inherits Deque class from FastAllocBase because it has been
27400         instantiated by 'new' with DEFINE_STATIC_LOCAL macro in 
27401         JavaScriptCore/wtf/MainThread.cpp:62.
27402
27403         * wtf/Deque.h:
27404
27405 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
27406
27407         Reviewed by Darin Adler.
27408
27409         https://bugs.webkit.org/show_bug.cgi?id=26644
27410
27411         Inherits RefPtr class from FastAllocBase because it has been
27412         instantiated by 'new' in JavaScriptCore/runtime/StructureChain.cpp:41.
27413
27414         * wtf/RefPtr.h:
27415
27416 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
27417
27418         Reviewed by Darin Adler.
27419
27420         Inherits HashSet class from FastAllocBase, because it has been
27421         instantiated by 'new' in JavaScriptCore/runtime/Collector.h:116.
27422
27423         * wtf/HashSet.h:
27424
27425 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
27426
27427         Reviewed by Darin Adler.
27428
27429         Inherits Vector class from FastAllocBase because it has been
27430         instantiated by 'new' in JavaScriptCore/runtime/Structure.cpp:633.
27431
27432         * wtf/Vector.h:
27433
27434 2009-06-24  Norbert Leser  <norbert.leser@nokia.com>
27435
27436         Reviewed by Maciej Stachoviak.
27437
27438         The BytecodeGenerator objects were instantiated on stack, which takes up ~38kB per instance
27439         (each instance includes copy of JSC::CodeBlock with large SymbolTable, etc.).
27440         Specifically, since there is nested invocation (e.g., GlobalCode --> FunctionCode),
27441         the stack overflows immediately on Symbian hardware (max. 80 kB).
27442         Proposed change allocates generator objects on heap.
27443         Performance impact (if any) should be negligible and change is proposed as general fix,
27444         rather than ifdef'd for SYMBIAN.
27445
27446         * parser/Nodes.cpp:
27447         (JSC::ProgramNode::generateBytecode):
27448         (JSC::EvalNode::generateBytecode):
27449         (JSC::EvalNode::bytecodeForExceptionInfoReparse):
27450         (JSC::FunctionBodyNode::generateBytecode):
27451         (JSC::FunctionBodyNode::bytecodeForExceptionInfoReparse):
27452
27453 2009-06-23  Oliver Hunt  <oliver@apple.com>
27454
27455         Reviewed by Gavin Barraclough.
27456
27457         <rdar://problem/6992806> REGRESSION: Enumeration can skip new properties in cases of prototypes that have more than 64 (26593)
27458         <https://bugs.webkit.org/show_bug.cgi?id=26593>
27459
27460         Do not attempt to cache structure chains if they contain a dictionary at any level.
27461
27462         * interpreter/Interpreter.cpp:
27463         (JSC::Interpreter::tryCachePutByID):
27464         (JSC::Interpreter::tryCacheGetByID):
27465         * jit/JITStubs.cpp:
27466         (JSC::JITThunks::tryCachePutByID):
27467         * runtime/Structure.cpp:
27468         (JSC::Structure::getEnumerablePropertyNames):
27469         (JSC::Structure::addPropertyTransition):
27470         * runtime/StructureChain.cpp:
27471         (JSC::StructureChain::isCacheable):
27472         * runtime/StructureChain.h:
27473
27474 2009-06-23  Yong Li  <yong.li@torchmobile.com>
27475
27476         Reviewed by George Staikos.
27477
27478         https://bugs.webkit.org/show_bug.cgi?id=26654
27479         Add the proper export define for the JavaScriptCore API when building for WINCE.
27480
27481         * API/JSBase.h:
27482
27483 2009-06-23  Joe Mason  <joe.mason@torchmobile.com>
27484
27485         Reviewed by Adam Treat.
27486
27487         Authors: Yong Li <yong.li@torchmobile.com>, Joe Mason <joe.mason@torchmobile.com>
27488
27489         https://bugs.webkit.org/show_bug.cgi?id=26611
27490         Implement currentThreadStackBase on WINCE by adding a global,
27491         g_stackBase, which must be set to the address of a local variable
27492         by the caller before calling any WebKit function that invokes JSC.
27493
27494         * runtime/Collector.cpp:
27495         (JSC::isPageWritable):
27496         (JSC::getStackBase):
27497           Starts at the top of the stack and returns the entire range of
27498           consecutive writable pages as an estimate of the actual stack.
27499           This will be much bigger than the actual stack range, so some
27500           dead objects can't be collected, but it guarantees live objects
27501           aren't collected prematurely.
27502
27503         (JSC::currentThreadStackBase):
27504           On WinCE, returns g_stackBase if set or call getStackBase as a
27505           fallback if not.
27506
27507 2009-06-23  Oliver Hunt  <oliver@apple.com>
27508
27509         Reviewed by Alexey Proskuryakov.
27510
27511         Fix stupid performance problem in the LiteralParser
27512
27513         The LiteralParser was making a new UString in order to use
27514         toDouble, however UString's toDouble allows a much wider range
27515         of numberic strings than the LiteralParser accepts, and requires
27516         an additional heap allocation or two for the construciton of the
27517         UString.  To rectify this we just call WTF::dtoa directly using
27518         a stack allocated buffer to hold the validated numeric literal.
27519
27520         * runtime/LiteralParser.cpp:
27521         (JSC::LiteralParser::Lexer::lexNumber):
27522         (JSC::LiteralParser::parse):
27523         * runtime/LiteralParser.h:
27524
27525 2009-06-22  Oliver Hunt  <oliver@apple.com>
27526
27527         Reviewed by Alexey Proskuryakov.
27528
27529         Bug 26640: JSON.stringify needs to special case Boolean objects
27530         <https://bugs.webkit.org/show_bug.cgi?id=26640>
27531
27532         Add special case handling of the Boolean object so we match current
27533         ES5 errata.
27534
27535         * runtime/JSONObject.cpp:
27536         (JSC::unwrapBoxedPrimitive): renamed from unwrapNumberOrString
27537         (JSC::gap):
27538         (JSC::Stringifier::appendStringifiedValue):
27539
27540 2009-06-22  Oliver Hunt  <oliver@apple.com>
27541
27542         Reviewed by Darin Adler.
27543
27544         Bug 26591: Support revivers in JSON.parse
27545         <https://bugs.webkit.org/show_bug.cgi?id=26591>
27546
27547         Add reviver support to JSON.parse.  This completes the JSON object.
27548
27549         * runtime/JSONObject.cpp:
27550         (JSC::Walker::Walker):
27551         (JSC::Walker::callReviver):
27552         (JSC::Walker::walk):
27553         (JSC::JSONProtoFuncParse):
27554
27555 2009-06-21  Oliver Hunt  <oliver@apple.com>
27556
27557         Reviewed by Darin Adler.
27558
27559         Bug 26592: Support standard toJSON functions
27560         <https://bugs.webkit.org/show_bug.cgi?id=26592>
27561
27562         Add support for the standard Date.toJSON function.
27563
27564         * runtime/DatePrototype.cpp:
27565         (JSC::dateProtoFuncToJSON):
27566
27567 2009-06-21  Oliver Hunt  <oliver@apple.com>
27568
27569         Reviewed by Sam Weinig.
27570
27571         Bug 26594: JSC needs to support Date.toISOString
27572         <https://bugs.webkit.org/show_bug.cgi?id=26594>
27573
27574         Add support for Date.toISOString.
27575
27576         * runtime/DatePrototype.cpp:
27577         (JSC::dateProtoFuncToISOString):
27578
27579 2009-06-21  Oliver Hunt  <oliver@apple.com>
27580
27581         Remove dead code.
27582
27583         * runtime/LiteralParser.cpp:
27584         (JSC::LiteralParser::parse):
27585
27586 2009-06-21  Oliver Hunt  <oliver@apple.com>
27587
27588         Reviewed by Darin Adler and Cameron Zwarich.
27589
27590         Bug 26587: Support JSON.parse
27591         <https://bugs.webkit.org/show_bug.cgi?id=26587>
27592
27593         Extend the LiteralParser to support the full strict JSON
27594         grammar, fix a few places where the grammar was incorrectly
27595         lenient.   Doesn't yet support the JSON.parse reviver function
27596         but that does not block the JSON.parse functionality itself.
27597
27598         * interpreter/Interpreter.cpp:
27599         (JSC::Interpreter::callEval):
27600         * runtime/JSGlobalObjectFunctions.cpp:
27601         (JSC::globalFuncEval):
27602         * runtime/JSONObject.cpp:
27603         (JSC::JSONProtoFuncParse):
27604         * runtime/LiteralParser.cpp:
27605         (JSC::LiteralParser::Lexer::lex):
27606         (JSC::isSafeStringCharacter):
27607         (JSC::LiteralParser::Lexer::lexString):
27608         (JSC::LiteralParser::parse):
27609         * runtime/LiteralParser.h:
27610         (JSC::LiteralParser::LiteralParser):
27611         (JSC::LiteralParser::tryJSONParse):
27612         (JSC::LiteralParser::):
27613         (JSC::LiteralParser::Lexer::Lexer):
27614
27615 2009-06-21  David Levin  <levin@chromium.org>
27616
27617         Reviewed by NOBODY (speculative build fix for windows).
27618
27619         Simply removed some whitespace form this file to make windows build wtf and
27620         hopefully copy the new MessageQueque.h so that WebCore picks it up.
27621
27622         * wtf/Assertions.cpp:
27623
27624 2009-06-21  Drew Wilson  <atwilson@google.com>
27625
27626         Reviewed by David Levin.
27627
27628         <https://bugs.webkit.org/show_bug.cgi?id=25043>
27629         Added support for multi-threaded MessagePorts.
27630
27631         * wtf/MessageQueue.h:
27632         (WTF::::appendAndCheckEmpty):
27633             Added API to test whether the queue was empty before adding an element.
27634   
27635 2009-06-20  David D. Kilzer  <ddkilzer@webkit.org>
27636
27637         Fix namespace comment in SegmentedVector.h
27638
27639         * wtf/SegmentedVector.h: Updated namespace comment to reflect
27640         new namespace after r44897.
27641
27642 2009-06-20  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
27643
27644         Bug 24986: ARM JIT port
27645         <https://bugs.webkit.org/show_bug.cgi?id=24986>
27646
27647         Reviewed by Oliver Hunt.
27648
27649         An Iterator added for SegmentedVector. Currently
27650         only the pre ++ operator is supported.
27651
27652         * wtf/SegmentedVector.h:
27653         (WTF::SegmentedVectorIterator::~SegmentedVectorIterator):
27654         (WTF::SegmentedVectorIterator::operator*):
27655         (WTF::SegmentedVectorIterator::operator->):
27656         (WTF::SegmentedVectorIterator::operator++):
27657         (WTF::SegmentedVectorIterator::operator==):
27658         (WTF::SegmentedVectorIterator::operator!=):
27659         (WTF::SegmentedVectorIterator::operator=):
27660         (WTF::SegmentedVectorIterator::SegmentedVectorIterator):
27661         (WTF::SegmentedVector::alloc):
27662         (WTF::SegmentedVector::begin):
27663         (WTF::SegmentedVector::end):
27664
27665 2009-06-20  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
27666
27667         Bug 24986: ARM JIT port
27668         <https://bugs.webkit.org/show_bug.cgi?id=24986>
27669
27670         Reviewed by Oliver Hunt.
27671
27672         Move SegmentedVector to /wtf subdirectory
27673         and change "namespace JSC" to "namespace WTF"
27674
27675         Additional build file updates by David Kilzer.
27676
27677         * GNUmakefile.am: Updated path to SegmentedVector.h.
27678         * JavaScriptCore.order: Updated SegmentedVector namespace from
27679         JSC to WTF in mangled C++ method name.
27680         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
27681         Removed reference to bytecompiler\SegmentedVector.h.
27682         * JavaScriptCore.vcproj/WTF/WTF.vcproj: Added reference to
27683         wtf\SegmentedVector.h.
27684         * JavaScriptCore.xcodeproj/project.pbxproj: Moved
27685         SegmentedVector.h definition from bytecompiler subdirectory to
27686         wtf subdirectory.
27687         * bytecompiler/BytecodeGenerator.h: Updated #include path to
27688         SegmentedVector.h and prepended WTF:: namespace to its use.
27689         * parser/Lexer.h: Ditto.
27690         * wtf/SegmentedVector.h: Renamed from JavaScriptCore/bytecompiler/SegmentedVector.h.
27691         (WTF::SegmentedVector::SegmentedVector):
27692         (WTF::SegmentedVector::~SegmentedVector):
27693         (WTF::SegmentedVector::size):
27694         (WTF::SegmentedVector::at):
27695         (WTF::SegmentedVector::operator[]):
27696         (WTF::SegmentedVector::last):
27697         (WTF::SegmentedVector::append):
27698         (WTF::SegmentedVector::removeLast):
27699         (WTF::SegmentedVector::grow):
27700         (WTF::SegmentedVector::clear):
27701         (WTF::SegmentedVector::deleteAllSegments):
27702         (WTF::SegmentedVector::segmentExistsFor):
27703         (WTF::SegmentedVector::segmentFor):
27704         (WTF::SegmentedVector::subscriptFor):
27705         (WTF::SegmentedVector::ensureSegmentsFor):
27706         (WTF::SegmentedVector::ensureSegment):
27707
27708 2009-06-19  Gavin Barraclough  <barraclough@apple.com>
27709
27710         Reviewed by NOBODY (build fix take 2 - rename FIELD_OFFSET to something that doesn't conflict with winnt.h).
27711
27712         * jit/JIT.cpp:
27713         (JSC::JIT::privateCompile):
27714         (JSC::JIT::privateCompileCTIMachineTrampolines):
27715         (JSC::JIT::emitGetVariableObjectRegister):
27716         (JSC::JIT::emitPutVariableObjectRegister):
27717         * jit/JIT.h:
27718         * jit/JITArithmetic.cpp:
27719         (JSC::JIT::emit_op_rshift):
27720         (JSC::JIT::emitSlow_op_jnless):
27721         (JSC::JIT::emitSlow_op_jnlesseq):
27722         (JSC::JIT::compileBinaryArithOp):
27723         * jit/JITCall.cpp:
27724         (JSC::JIT::compileOpCallInitializeCallFrame):
27725         (JSC::JIT::compileOpCall):
27726         * jit/JITInlineMethods.h:
27727         (JSC::JIT::restoreArgumentReference):
27728         (JSC::JIT::checkStructure):
27729         * jit/JITOpcodes.cpp:
27730         (JSC::JIT::emit_op_instanceof):
27731         (JSC::JIT::emit_op_get_scoped_var):
27732         (JSC::JIT::emit_op_put_scoped_var):
27733         (JSC::JIT::emit_op_construct_verify):
27734         (JSC::JIT::emit_op_resolve_global):
27735         (JSC::JIT::emit_op_jeq_null):
27736         (JSC::JIT::emit_op_jneq_null):
27737         (JSC::JIT::emit_op_to_jsnumber):
27738         (JSC::JIT::emit_op_catch):
27739         (JSC::JIT::emit_op_eq_null):
27740         (JSC::JIT::emit_op_neq_null):
27741         (JSC::JIT::emit_op_convert_this):
27742         (JSC::JIT::emit_op_profile_will_call):
27743         (JSC::JIT::emit_op_profile_did_call):
27744         (JSC::JIT::emitSlow_op_get_by_val):
27745         * jit/JITPropertyAccess.cpp:
27746         (JSC::JIT::emit_op_get_by_val):
27747         (JSC::JIT::emit_op_put_by_val):
27748         (JSC::JIT::emit_op_method_check):
27749         (JSC::JIT::compileGetByIdHotPath):
27750         (JSC::JIT::emit_op_put_by_id):
27751         (JSC::JIT::compilePutDirectOffset):
27752         (JSC::JIT::compileGetDirectOffset):
27753         (JSC::JIT::privateCompilePutByIdTransition):
27754         (JSC::JIT::privateCompilePatchGetArrayLength):
27755         * jit/JITStubs.cpp:
27756         (JSC::JITThunks::JITThunks):
27757
27758 2009-06-19  Gavin Barraclough  <barraclough@apple.com>
27759
27760         Reviewed by NOBODY (Windows build fix).
27761
27762         * jit/JIT.h:
27763         * jit/JITInlineMethods.h:
27764
27765 2009-06-19  Gabor Loki  <loki@inf.u-szeged.hu>
27766
27767         Reviewed by Gavin Barraclough.
27768
27769         Reorganize ARM architecture specific macros.
27770         Use PLATFORM_ARM_ARCH(7) instead of PLATFORM(ARM_V7).
27771
27772         Bug 24986: ARM JIT port
27773         <https://bugs.webkit.org/show_bug.cgi?id=24986>
27774
27775         * assembler/ARMv7Assembler.h:
27776         * assembler/AbstractMacroAssembler.h:
27777         (JSC::AbstractMacroAssembler::Imm32::Imm32):
27778         * assembler/MacroAssembler.h:
27779         * assembler/MacroAssemblerCodeRef.h:
27780         (JSC::MacroAssemblerCodePtr::MacroAssemblerCodePtr):
27781         * jit/ExecutableAllocator.h:
27782         (JSC::ExecutableAllocator::cacheFlush):
27783         * jit/JIT.h:
27784         * jit/JITInlineMethods.h:
27785         (JSC::JIT::restoreArgumentReferenceForTrampoline):
27786         * jit/JITStubs.cpp:
27787         * jit/JITStubs.h:
27788         * wtf/Platform.h:
27789         * yarr/RegexJIT.cpp:
27790         (JSC::Yarr::RegexGenerator::generateEnter):
27791         (JSC::Yarr::RegexGenerator::generateReturn):
27792
27793 2009-06-19  Gavin Barraclough  <barraclough@apple.com>
27794
27795         Reviewed by Oliver Hunt.
27796
27797         Fix armv7 JIT build issues.
27798
27799         Unfortunate the arm compiler does not like the use of offsetof on JITStackFrame (since it now contains non POD types),
27800         and the FIELD_OFFSET macro does not appear constantish enough for it to be happy with its use in COMPILE_ASSERT macros.
27801
27802         * Replace offsetofs with FIELD_OFFSETs (safe on C++ objects).
27803         * Move COMPILE_ASSERTs defending layout of JITStackFrame structure on armv7 into JITThunks constructor.
27804
27805         * jit/JIT.cpp:
27806         * jit/JIT.h:
27807         * jit/JITInlineMethods.h:
27808         (JSC::JIT::restoreArgumentReference):
27809         * jit/JITOpcodes.cpp:
27810         (JSC::JIT::emit_op_catch):
27811         * jit/JITStubs.cpp:
27812         (JSC::JITThunks::JITThunks):
27813
27814 2009-06-19  Adam Treat  <adam.treat@torchmobile.com>
27815
27816         Blind attempt at build fix.
27817
27818         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
27819         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
27820
27821 2009-06-19  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
27822
27823         Reviewed by Oliver Hunt.
27824
27825         Inherits CallIdentifier struct from FastAllocBase because it has been
27826         instantiated by 'new' in JavaScriptCore/profiler/CallIdentifier.h:86.
27827
27828         * wtf/HashCountedSet.h:
27829
27830 2009-06-19  Adam Treat  <adam.treat@torchmobile.com>
27831
27832         Reviewed by Oliver Hunt.
27833
27834         https://bugs.webkit.org/show_bug.cgi?id=26540
27835         Modify the test shell to add a new function 'checkSyntax' that will
27836         only parse the source instead of executing it. In this way we can test
27837         pure parsing performance against some of the larger scripts in the wild.
27838
27839         * jsc.cpp:
27840         (GlobalObject::GlobalObject):
27841         (functionCheckSyntax):
27842
27843 2009-06-19  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
27844
27845         Reviewed by Darin Adler.
27846         
27847         Inherits HashCountedSet class from FastAllocBase because it has been
27848         instantiated by 'new' in JavaScriptCore/runtime/Collector.cpp:1095.
27849
27850         * wtf/HashCountedSet.h:
27851
27852 2009-06-19  Yong Li  <yong.li@torchmobile.com>
27853
27854         Reviewed by George Staikos.
27855
27856         https://bugs.webkit.org/show_bug.cgi?id=26558
27857         Declare these symbols extern for WINCE as they are provided by libce.
27858
27859         * runtime/DateConstructor.cpp:
27860         * runtime/DatePrototype.cpp:
27861         (JSC::formatLocaleDate):
27862
27863 2009-06-19  Oliver Hunt  <oliver@apple.com>
27864
27865         Reviewed by Maciej Stachowiak.
27866
27867         <rdar://problem/6988973> ScopeChain leak in interpreter builds
27868
27869         Move the Scopechain destruction code in JSFunction outside of the ENABLE(JIT)
27870         path.
27871
27872         * runtime/JSFunction.cpp:
27873         (JSC::JSFunction::~JSFunction):
27874         * wtf/Platform.h:
27875
27876 2009-06-19  Yong Li  <yong.li@torchmobile.com>
27877
27878         Reviewed by George Staikos.
27879
27880         https://bugs.webkit.org/show_bug.cgi?id=26543
27881         Windows CE uses 'GetLastError' instead of 'errno.'
27882
27883         * interpreter/RegisterFile.h:
27884         (JSC::RegisterFile::RegisterFile):
27885         (JSC::RegisterFile::grow):
27886
27887 2009-06-19  David Levin  <levin@chromium.org>
27888
27889         Reviewed by NOBODY (Windows build fix).
27890
27891         Add export for Windows corresponding to OSX export done in r44844.
27892         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
27893         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
27894
27895 2009-06-18  Oliver Hunt  <oliver@apple.com>
27896
27897         Reviewed by Gavin "Viceroy of Venezuela" Barraclough.
27898
27899         Bug 26532: Native functions do not correctly unlink from optimised callsites when they're collected
27900         <https://bugs.webkit.org/show_bug.cgi?id=26532> <rdar://problem/6625385>
27901
27902         We need to make sure that each native function instance correctly unlinks any references to it
27903         when it is collected.  Allowing this to happen required a few changes:
27904             * Every native function needs a codeblock to track the link information
27905             * To have this codeblock, every function now also needs its own functionbodynode
27906               so we no longer get to have a single shared instance.
27907             * Identifying a host function is now done by looking for CodeBlock::codeType() == NativeCode
27908
27909         * JavaScriptCore.exp:
27910         * bytecode/CodeBlock.cpp:
27911         (JSC::CodeBlock::CodeBlock):
27912            Constructor for NativeCode CodeBlock
27913         (JSC::CodeBlock::derefStructures):
27914         (JSC::CodeBlock::refStructures):
27915         (JSC::CodeBlock::reparseForExceptionInfoIfNecessary):
27916         (JSC::CodeBlock::handlerForBytecodeOffset):
27917         (JSC::CodeBlock::lineNumberForBytecodeOffset):
27918         (JSC::CodeBlock::expressionRangeForBytecodeOffset):
27919         (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset):
27920         (JSC::CodeBlock::functionRegisterForBytecodeOffset):
27921         (JSC::CodeBlock::hasGlobalResolveInstructionAtBytecodeOffset):
27922         (JSC::CodeBlock::hasGlobalResolveInfoAtBytecodeOffset):
27923         (JSC::CodeBlock::setJITCode):
27924            Add assertions to ensure we don't try and use NativeCode CodeBlocks as
27925            a normal codeblock.
27926
27927         * bytecode/CodeBlock.h:
27928         (JSC::):
27929         (JSC::CodeBlock::source):
27930         (JSC::CodeBlock::sourceOffset):
27931         (JSC::CodeBlock::evalCodeCache):
27932         (JSC::CodeBlock::createRareDataIfNecessary):
27933           More assertions.
27934
27935         * jit/JIT.cpp:
27936         (JSC::JIT::privateCompileCTIMachineTrampolines):
27937         (JSC::JIT::linkCall):
27938           Update logic to allow native function caching
27939
27940         * jit/JITStubs.cpp:
27941         * parser/Nodes.cpp:
27942         (JSC::FunctionBodyNode::createNativeThunk):
27943         (JSC::FunctionBodyNode::isHostFunction):
27944         * parser/Nodes.h:
27945         * runtime/JSFunction.cpp:
27946         (JSC::JSFunction::JSFunction):
27947         (JSC::JSFunction::~JSFunction):
27948         (JSC::JSFunction::mark):
27949         * runtime/JSGlobalData.cpp:
27950         (JSC::JSGlobalData::~JSGlobalData):
27951         * runtime/JSGlobalData.h:
27952
27953 2009-06-18  Gavin Barraclough  <barraclough@apple.com>
27954
27955         Reviewed by NOBODY (Windows build fix).
27956
27957         * wtf/DateMath.cpp:
27958         (WTF::calculateUTCOffset):
27959
27960 2009-06-18  Gavin Barraclough  <barraclough@apple.com>
27961
27962         Reviewed by Geoff Garen.
27963
27964         Timezone calculation incorrect in Venezuela.
27965
27966         https://bugs.webkit.org/show_bug.cgi?id=26531
27967         <rdar://problem/6646169> Time is incorrectly reported to JavaScript in both Safari 3 and Firefox 3
27968
27969         The problem is that we're calculating the timezone relative to 01/01/2000,
27970         but the VET timezone changed from -4 hours to -4:30 hours on 12/09/2007.
27971         According to the spec, section 15.9.1.9 states "the time since the beginning
27972         of the year", presumably meaning the *current* year.  Change the calculation
27973         to be based on whatever the current year is, rather than a canned date.
27974
27975         No performance impact.
27976
27977         * wtf/DateMath.cpp:
27978         (WTF::calculateUTCOffset):
27979
27980 2009-06-18  Gavin Barraclough  <barraclough@apple.com>
27981
27982         Rubber Stamped by Mark Rowe (originally reviewed by Sam Weinig).
27983
27984         (Reintroducing patch added in r44492, and reverted in r44796.)
27985
27986         Change the implementation of op_throw so the stub function always modifies its
27987         return address - if it doesn't find a 'catch' it will switch to a trampoline
27988         to force a return from JIT execution.  This saves memory, by avoiding the need
27989         for a unique return for every op_throw.
27990
27991         * jit/JITOpcodes.cpp:
27992         (JSC::JIT::emit_op_throw):
27993             JITStubs::cti_op_throw now always changes its return address,
27994             remove return code generated after the stub call (this is now
27995             handled by ctiOpThrowNotCaught).
27996         * jit/JITStubs.cpp:
27997         (JSC::):
27998             Add ctiOpThrowNotCaught definitions.
27999         (JSC::JITStubs::DEFINE_STUB_FUNCTION):
28000             Change cti_op_throw to always change its return address.
28001         * jit/JITStubs.h:
28002             Add ctiOpThrowNotCaught declaration.
28003
28004 2009-06-18  Kevin McCullough  <kmccullough@apple.com>
28005
28006         Reviewed by Oliver Hunt.
28007
28008         <rdar://problem/6940880> REGRESSION: Breakpoints don't break in 64-bit
28009
28010         - Exposed functions now needed by WebCore.
28011
28012         * JavaScriptCore.exp:
28013
28014 2009-06-17  Darin Adler  <darin@apple.com>
28015
28016         Reviewed by Oliver Hunt.
28017
28018         Bug 26429: Make JSON.stringify non-recursive so it can handle objects
28019         of arbitrary complexity
28020         https://bugs.webkit.org/show_bug.cgi?id=26429
28021
28022         For marking I decided not to use gcProtect, because this is inside the engine
28023         so it's easy enough to just do marking. And that darned gcProtect does locking!
28024         Oliver tried to convince me to used MarkedArgumentBuffer, but the constructor
28025         for that class says "FIXME: Remove all clients of this API, then remove this API."
28026
28027         * runtime/Collector.cpp:
28028         (JSC::Heap::collect): Add a call to JSONObject::markStringifiers.
28029
28030         * runtime/CommonIdentifiers.cpp:
28031         (JSC::CommonIdentifiers::CommonIdentifiers): Added emptyIdentifier.
28032         * runtime/CommonIdentifiers.h: Ditto.
28033
28034         * runtime/JSGlobalData.cpp:
28035         (JSC::JSGlobalData::JSGlobalData): Initialize firstStringifierToMark to 0.
28036         * runtime/JSGlobalData.h: Added firstStringifierToMark.
28037
28038         * runtime/JSONObject.cpp: Cut down the includes to the needed ones only.
28039         (JSC::unwrapNumberOrString): Added. Helper for unwrapping number and string
28040         objects to get their number and string values.
28041         (JSC::ReplacerPropertyName::ReplacerPropertyName): Added. The class is used
28042         to wrap an identifier or integer so we don't have to do any work unless we
28043         actually call a replacer.
28044         (JSC::ReplacerPropertyName::value): Added.
28045         (JSC::gap): Added. Helper function for the Stringifier constructor.
28046         (JSC::PropertyNameForFunctionCall::PropertyNameForFunctionCall): Added.
28047         The class is used to wrap an identifier or integer so we don't have to
28048         allocate a number or string until we actually call toJSON or a replacer.
28049         (JSC::PropertyNameForFunctionCall::asJSValue): Added.
28050         (JSC::Stringifier::Stringifier): Updated and moved out of the class
28051         definition. Added code to hook this into a singly linked list for marking.
28052         (JSC::Stringifier::~Stringifier): Remove from the singly linked list.
28053         (JSC::Stringifier::mark): Mark all the objects in the holder stacks.
28054         (JSC::Stringifier::stringify): Updated.
28055         (JSC::Stringifier::appendQuotedString): Tweaked and streamlined a bit.
28056         (JSC::Stringifier::toJSON): Renamed from toJSONValue.
28057         (JSC::Stringifier::appendStringifiedValue): Renamed from stringify.
28058         Added code to use the m_holderStack to do non-recursive stringify of
28059         objects and arrays. This code also uses the timeout checker since in
28060         pathological cases it could be slow even without calling into the
28061         JavaScript virtual machine.
28062         (JSC::Stringifier::willIndent): Added.
28063         (JSC::Stringifier::indent): Added.
28064         (JSC::Stringifier::unindent): Added.
28065         (JSC::Stringifier::startNewLine): Added.
28066         (JSC::Stringifier::Holder::Holder): Added.
28067         (JSC::Stringifier::Holder::appendNextProperty): Added. This is the
28068         function that handles the format of arrays and objects.
28069         (JSC::JSONObject::getOwnPropertySlot): Moved this down to the bottom
28070         of the file so the JSONObject class is not interleaved with the
28071         Stringifier class.
28072         (JSC::JSONObject::markStringifiers): Added. Calls mark.
28073         (JSC::JSONProtoFuncStringify): Streamlined the code here. The code
28074         to compute the gap string is now a separate function.
28075
28076         * runtime/JSONObject.h: Made everything private. Added markStringifiers.
28077
28078 2009-06-17  Oliver Hunt  <oliver@apple.com>
28079
28080         Reviewed by Gavin Barraclough.
28081
28082         <rdar://problem/6974140> REGRESSION(r43849): Crash in cti_op_call_NotJSFunction when getting directions on maps.google.com
28083
28084         Roll out r43849 as it appears that we cannot rely on the address of
28085         an objects property storage being constant even if the structure is
28086         unchanged.
28087
28088         * jit/JIT.h:
28089         * jit/JITPropertyAccess.cpp:
28090         (JSC::JIT::compileGetDirectOffset):
28091         (JSC::JIT::privateCompileGetByIdProto):
28092         (JSC::JIT::privateCompileGetByIdProtoList):
28093         (JSC::JIT::privateCompileGetByIdChainList):
28094         (JSC::JIT::privateCompileGetByIdChain):
28095
28096 2009-06-17  Gavin Barraclough  <barraclough@apple.com>
28097
28098         Rubber Stamped by Mark Rowe.
28099
28100         Fully revert r44492 & r44748 while we fix a bug they cause on internal builds <rdar://problem/6955963>.
28101
28102         * jit/JITOpcodes.cpp:
28103         (JSC::JIT::emit_op_throw):
28104         * jit/JITStubs.cpp:
28105         (JSC::):
28106         (JSC::JITStubs::DEFINE_STUB_FUNCTION):
28107         * jit/JITStubs.h:
28108
28109 2009-06-17  Gavin Barraclough  <barraclough@apple.com>
28110
28111         Reviewed by Mark Rowe.
28112
28113         <rdar://problem/6947426> sunspider math-cordic.js exhibits different intermediate results running 32-bit vs. 64-bit
28114
28115         On 64-bit, NaN-encoded values must be detagged before they can be used in rshift.
28116
28117         No performance impact.
28118
28119         * jit/JITArithmetic.cpp:
28120         (JSC::JIT::emit_op_rshift):
28121
28122 2009-06-17  Adam Treat  <adam.treat@torchmobile.com>
28123
28124         Reviewed by George Staikos.
28125
28126         https://bugs.webkit.org/show_bug.cgi?id=23155
28127         Move WIN_CE -> WINCE as previously discussed with Qt WINCE folks.
28128
28129         * jsc.cpp:
28130         (main):
28131
28132 2009-06-17  George Staikos  <george.staikos@torchmobile.com>
28133
28134         Reviewed by Adam Treat.
28135
28136         https://bugs.webkit.org/show_bug.cgi?id=23155
28137         Move WIN_CE -> WINCE as previously discussed with Qt WINCE folks.
28138
28139         * config.h:
28140         * jsc.cpp:
28141         * wtf/Assertions.cpp:
28142         * wtf/Assertions.h:
28143         * wtf/CurrentTime.cpp:
28144         (WTF::lowResUTCTime):
28145         * wtf/DateMath.cpp:
28146         (WTF::getLocalTime):
28147         * wtf/MathExtras.h:
28148         * wtf/Platform.h:
28149         * wtf/StringExtras.h:
28150         * wtf/Threading.h:
28151         * wtf/win/MainThreadWin.cpp:
28152
28153 2009-06-17  Gavin Barraclough  <barraclough@apple.com>
28154
28155         Reviewed by Oliver Hunt.
28156
28157         <rdar://problem/6974175> ASSERT in JITStubs.cpp at appsaccess.apple.com
28158
28159         Remove PropertySlot::putValue - PropertySlots should only be used for getting,
28160         not putting.  Rename JSGlobalObject::getOwnPropertySlot to hasOwnPropertyForWrite,
28161         which is what it really was being used to ask, and remove some other getOwnPropertySlot
28162         & getOwnPropertySlotForWrite methods, which were unused and likely to lead to confusion.
28163
28164         * runtime/JSGlobalObject.h:
28165         (JSC::JSGlobalObject::hasOwnPropertyForWrite):
28166         * runtime/JSObject.h:
28167         * runtime/JSStaticScopeObject.cpp:
28168         * runtime/JSStaticScopeObject.h:
28169         * runtime/PropertySlot.h:
28170
28171 2009-06-16  Gavin Barraclough  <barraclough@apple.com>
28172
28173         Reviewed by Oliver hunt.
28174
28175         Temporarily partially disable r44492, since this is causing some problems on internal builds.
28176
28177         * jit/JITOpcodes.cpp:
28178         (JSC::JIT::emit_op_throw):
28179         * jit/JITStubs.cpp:
28180         (JSC::JITStubs::DEFINE_STUB_FUNCTION):
28181
28182 2009-06-16  Sam Weinig  <sam@webkit.org>
28183
28184         Fix windows build.
28185
28186         * jit/JIT.cpp:
28187         (JSC::JIT::JIT):
28188
28189 2009-06-16  Sam Weinig  <sam@webkit.org>
28190
28191         Reviewed by Oliver Hunt.
28192
28193         Initialize m_bytecodeIndex to -1 in JIT, and correctly initialize
28194         it for each type of stub using the return address to find the correct
28195         offset.
28196
28197         * jit/JIT.cpp:
28198         (JSC::JIT::JIT):
28199         * jit/JIT.h:
28200         (JSC::JIT::compileGetByIdProto):
28201         (JSC::JIT::compileGetByIdSelfList):
28202         (JSC::JIT::compileGetByIdProtoList):
28203         (JSC::JIT::compileGetByIdChainList):
28204         (JSC::JIT::compileGetByIdChain):
28205         (JSC::JIT::compilePutByIdTransition):
28206         (JSC::JIT::compileCTIMachineTrampolines):
28207         (JSC::JIT::compilePatchGetArrayLength):
28208         * jit/JITStubCall.h:
28209         (JSC::JITStubCall::call):
28210
28211 == Rolled over to ChangeLog-2009-06-16 ==