ChangeLog 884 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
2007-06-14  Lars Knoll <lars@trolltech.com>

        Reviewed by Maciej.

        Disable FastMalloc for the Qt build and make sure we
        don't reimplement the global new/delete operators
        when using the system malloc.

        * wtf/FastMalloc.cpp:
        * wtf/FastMalloc.h:
        * wtf/Platform.h:

andersca's avatar
andersca committed
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
2007-06-13  Anders Carlsson  <andersca@apple.com>

        Reviewed by Geoff.

        Make sure that bindings instances get correct root objects.
        
        * JavaScriptCore.exp:
        * bindings/NP_jsobject.cpp:
        (listFromVariantArgs):
        (_NPN_InvokeDefault):
        (_NPN_Invoke):
        (_NPN_SetProperty):
        * bindings/c/c_instance.cpp:
        (KJS::Bindings::CInstance::invokeMethod):
        (KJS::Bindings::CInstance::invokeDefaultMethod):
        * bindings/c/c_runtime.cpp:
        (KJS::Bindings::CField::valueFromInstance):
        * bindings/c/c_utility.cpp:
        (KJS::Bindings::convertNPVariantToValue):
        * bindings/c/c_utility.h:
        * bindings/objc/objc_instance.mm:
        (ObjcInstance::invokeMethod):
        (ObjcInstance::invokeDefaultMethod):
        (ObjcInstance::getValueOfUndefinedField):
        * bindings/objc/objc_runtime.mm:
        (ObjcField::valueFromInstance):
        (ObjcArray::valueAt):
        * bindings/objc/objc_utility.h:
        * bindings/objc/objc_utility.mm:
        (KJS::Bindings::convertObjcValueToValue):
        * bindings/runtime.h:

45
46
47
48
49
50
2007-06-13  Simon Hausmann  <hausmann@kde.org>

        Reviewed by Lars.

        * kjs/testkjs.pro: WebKitQt is now called QtWebKit.

andersca's avatar
andersca committed
51
52
53
54
55
56
57
2007-06-12  Anders Carlsson  <andersca@apple.com>

        Another build fix.
        
        * bindings/qt/qt_instance.cpp:
        (KJS::Bindings::QtInstance::invokeMethod):

andersca's avatar
andersca committed
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
2007-06-12  Anders Carlsson  <andersca@apple.com>

        Reviewed by Geoff.

        Move the notion of field type to the JNI runtime since that's the only 
        one that was actually using it.
        
        * bindings/c/c_runtime.h:
        (KJS::Bindings::CField::CField):
        * bindings/jni/jni_runtime.h:
        * bindings/objc/objc_runtime.h:
        * bindings/objc/objc_runtime.mm:
        * bindings/qt/qt_runtime.h:
        * bindings/runtime.h:
        * bindings/runtime_method.cpp:

andersca's avatar
andersca committed
74
75
76
77
78
79
80
81
82
2007-06-12  Anders Carlsson  <andersca@apple.com>

        Build fix.
        
        * bindings/qt/qt_class.cpp:
        (KJS::Bindings::QtClass::methodsNamed):
        * bindings/qt/qt_instance.cpp:
        (KJS::Bindings::QtInstance::invokeMethod):

andersca's avatar
andersca committed
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
2007-06-12  Anders Carlsson  <andersca@apple.com>

        Reviewed by Oliver.
        
        Get rid of the MethodList class and use a good ol' Vector instead.

        * bindings/c/c_class.cpp:
        (KJS::Bindings::CClass::methodsNamed):
        * bindings/c/c_instance.cpp:
        (KJS::Bindings::CInstance::invokeMethod):
        * bindings/jni/jni_class.cpp:
        (JavaClass::JavaClass):
        (JavaClass::~JavaClass):
        * bindings/jni/jni_instance.cpp:
        (JavaInstance::invokeMethod):
        * bindings/objc/objc_class.mm:
        (KJS::Bindings::ObjcClass::methodsNamed):
        * bindings/objc/objc_instance.mm:
        (ObjcInstance::invokeMethod):
        * bindings/objc/objc_runtime.mm:
        (ObjcFallbackObjectImp::callAsFunction):
        * bindings/runtime.cpp:
        * bindings/runtime.h:
        * bindings/runtime_method.cpp:
        (RuntimeMethod::lengthGetter):
        (RuntimeMethod::callAsFunction):
        * bindings/runtime_object.cpp:
        (RuntimeObjectImp::getOwnPropertySlot):

andersca's avatar
andersca committed
112
113
114
115
116
117
118
119
120
121
122
123
124
2007-06-12  Anders Carlsson  <andersca@apple.com>

        Reviewed by Geoff.

        Make RuntimeMethod's method list a pointer so that the object size doesn't
        grow beyond 32 bytes when we later will replace MethodList with a Vector.
        
        * bindings/runtime_method.cpp:
        (RuntimeMethod::RuntimeMethod):
        (RuntimeMethod::lengthGetter):
        (RuntimeMethod::callAsFunction):
        * bindings/runtime_method.h:

andersca's avatar
andersca committed
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
2007-06-12  Anders Carlsson  <andersca@apple.com>

        Reviewed by Geoff.

        Get rid of the Parameter class.
        
        * bindings/jni/jni_instance.cpp:
        (JavaInstance::invokeMethod):
        * bindings/jni/jni_runtime.cpp:
        (JavaMethod::signature):
        * bindings/jni/jni_runtime.h:
        (KJS::Bindings::JavaParameter::JavaParameter):
        (KJS::Bindings::JavaParameter::~JavaParameter):
        (KJS::Bindings::JavaParameter::type):
        (KJS::Bindings::JavaMethod::parameterAt):
        (KJS::Bindings::JavaMethod::numParameters):
        * bindings/runtime.h:

andersca's avatar
andersca committed
143
144
145
146
147
148
2007-06-12  Anders Carlsson  <andersca@apple.com>

        Build fix.
        
        * bindings/qt/qt_class.h:

bdash's avatar
bdash committed
149
150
151
152
153
154
2007-06-12  Mark Rowe  <mrowe@apple.com>

        Build fix.

        * bindings/objc/objc_runtime.h:

andersca's avatar
andersca committed
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
2007-06-12  Anders Carlsson  <andersca@apple.com>

        Reviewed by Geoff.

        Get rid of Constructor and its only subclass JavaConstructor.
        
        * bindings/c/c_class.h:
        * bindings/jni/jni_class.cpp:
        (JavaClass::JavaClass):
        (JavaClass::~JavaClass):
        * bindings/jni/jni_class.h:
        * bindings/jni/jni_runtime.cpp:
        * bindings/jni/jni_runtime.h:
        * bindings/objc/objc_class.h:
        * bindings/runtime.h:

andersca's avatar
andersca committed
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
2007-06-12  Anders Carlsson  <andersca@apple.com>

        Reviewed by Geoff.

        Use RetainPtr throughout the bindings code.
        
        * bindings/objc/objc_class.h:
        * bindings/objc/objc_class.mm:
        (KJS::Bindings::ObjcClass::ObjcClass):
        (KJS::Bindings::ObjcClass::methodsNamed):
        (KJS::Bindings::ObjcClass::fieldNamed):
        * bindings/objc/objc_instance.h:
        (KJS::Bindings::ObjcInstance::getObject):
        * bindings/objc/objc_instance.mm:
        (ObjcInstance::ObjcInstance):
        (ObjcInstance::~ObjcInstance):
        (ObjcInstance::implementsCall):
        (ObjcInstance::invokeMethod):
        (ObjcInstance::invokeDefaultMethod):
        (ObjcInstance::defaultValue):
        * bindings/objc/objc_runtime.h:
        (KJS::Bindings::ObjcMethod::setJavaScriptName):
        (KJS::Bindings::ObjcMethod::javaScriptName):
        (KJS::Bindings::ObjcArray::getObjcArray):
        * bindings/objc/objc_runtime.mm:
        (ObjcField::name):
        (ObjcArray::ObjcArray):
        (ObjcArray::setValueAt):
        (ObjcArray::valueAt):
        (ObjcArray::getLength):
        * wtf/RetainPtr.h:

andersca's avatar
andersca committed
203
204
205
206
207
208
209
210
211
212
2007-06-12  Anders Carlsson  <andersca@apple.com>

        Reviewed by Maciej.

        Have JSCell inherit from Noncopyable.
        
        * bindings/objc/objc_runtime.h:
        * bindings/runtime_object.h:
        * kjs/value.h:

andersca's avatar
andersca committed
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
2007-06-12  Anders Carlsson  <andersca@apple.com>

        Reviewed by Darin and Maciej.

        More cleanup. Use our Noncopyable WTF class, add a root object member
        to the Array class.
        
        * bindings/c/c_class.h:
        * bindings/jni/jni_class.h:
        * bindings/jni/jni_instance.h:
        * bindings/jni/jni_runtime.cpp:
        (JavaArray::JavaArray):
        * bindings/jni/jni_runtime.h:
        * bindings/objc/objc_class.h:
        * bindings/objc/objc_runtime.h:
        * bindings/objc/objc_runtime.mm:
        (ObjcArray::ObjcArray):
        * bindings/objc/objc_utility.mm:
        (KJS::Bindings::convertObjcValueToValue):
        * bindings/runtime.cpp:
        (KJS::Bindings::Array::Array):
        (KJS::Bindings::Array::~Array):
        * bindings/runtime.h:
        * bindings/runtime_object.h:
        * bindings/runtime_root.h:

zack's avatar
zack committed
239
240
241
242
243
244
245
246
2007-06-08  Zack Rusin  <zrusin@trolltech.com>

        Fix the Qt build

        * bindings/qt/qt_instance.cpp:
        (KJS::Bindings::QtInstance::QtInstance):
        * bindings/qt/qt_instance.h:

andersca's avatar
andersca committed
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
2007-06-07  Anders Carlsson  <andersca@apple.com>

        Reviewed by Geoff.

        Get rid of Instance::setRootObject and pass the root object to the instance constructor instead.
        
        * bindings/c/c_instance.cpp:
        (KJS::Bindings::CInstance::CInstance):
        * bindings/c/c_instance.h:
        * bindings/jni/jni_instance.cpp:
        (JavaInstance::JavaInstance):
        * bindings/jni/jni_instance.h:
        * bindings/jni/jni_jsobject.cpp:
        (JavaJSObject::convertJObjectToValue):
        * bindings/objc/objc_instance.h:
        * bindings/objc/objc_instance.mm:
        (ObjcInstance::ObjcInstance):
        * bindings/runtime.cpp:
        (KJS::Bindings::Instance::Instance):
        (KJS::Bindings::Instance::createBindingForLanguageInstance):
        * bindings/runtime.h:

andersca's avatar
andersca committed
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
2007-06-07  Anders Carlsson  <andersca@apple.com>

        Reviewed by Adam.

        Don't use a JavaInstance to store the field when all we want to do is to keep the field
        from being garbage collected. Instead, use a JObjectWrapper.
        
        * bindings/jni/jni_instance.h:
        * bindings/jni/jni_runtime.cpp:
        (JavaField::JavaField):
        (JavaField::dispatchValueFromInstance):
        (JavaField::dispatchSetValueToInstance):
        * bindings/jni/jni_runtime.h:
        (KJS::Bindings::JavaField::JavaField):
        (KJS::Bindings::JavaField::operator=):

weinig's avatar
weinig committed
285
286
287
288
289
2007-05-30  Alp Toker  <alp.toker@collabora.co.uk>

        Reviewed by Brady.

        Enable logging in the Gdk port.
290
        http://bugs.webkit.org/show_bug.cgi?id=13936
weinig's avatar
weinig committed
291
292
293
294
295

        * wtf/Assertions.cpp:
        * wtf/Assertions.h: Add WTFLogVerbose which also logs
        the file, line number and function.

bdash's avatar
bdash committed
296
297
298
299
300
301
2007-05-30  Mark Rowe  <mrowe@apple.com>

        Mac build fix.  Update #include.

        * API/JSCallbackFunction.h:

302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
2007-05-30  Luciano Montanaro  <mikelima@cirulla.net>

        Reviewed by Maciej.

        - cross-port Harri Porten's commits 636099 and 636108 from KJS: 
        "publish a class anyway public already" and "class is being used from
        outside for quite some time" in preparation for further syncronizations

        * kjs/context.h:
        * kjs/date_object.cpp:
        * kjs/date_object.h:
        * kjs/function.h:
        (KJS::):
        (KJS::InternalFunctionImp::classInfo):
        (KJS::InternalFunctionImp::functionName):
        * kjs/function_object.h:
        * kjs/internal.h:
        * kjs/lookup.h:
        (KJS::getStaticPropertySlot):
        (KJS::getStaticFunctionSlot):
        (KJS::getStaticValueSlot):
        * kjs/object_object.h:

weinig's avatar
weinig committed
325
326
327
328
329
330
331
332
333
334
2007-05-29  Sam Weinig  <sam@webkit.org>

        Reviewed by Adam Roben.

        Cleanup function and fix to match comparison API.

        * kjs/string_object.cpp:
        (KJS::substituteBackreferences):
        (KJS::localeCompare):

335
336
337
338
339
340
341
2007-05-28  Geoffrey Garen  <ggaren@apple.com>

        Slight clarification to an exception message.

        * API/JSCallbackObject.cpp:
        (KJS::JSCallbackObject::put):

weinig's avatar
weinig committed
342
343
344
345
346
347
2007-05-27  Holger Freyther  <zecke@selfish.org>

        Reviewed by Mark Rowe.

        * wtf/Platform.h: Move Gdk up to allow building WebKit/Gdk on Darwin

348
349
350
351
352
353
354
355
2007-05-27  Darin Adler  <darin@apple.com>

        - fix a couple ifdefs that said WIN instead of WIN_OS

        * kjs/collector.cpp:
        (KJS::allocateBlock): WIN -> WIN_OS
        (KJS::freeBlock): Ditto.

weinig's avatar
weinig committed
356
357
358
359
360
361
362
363
364
365
366
367
2007-05-26  Sam Weinig  <sam@webkit.org>

        Reviewed by Darin.

        Patch for http://bugs.webkit.org/show_bug.cgi?id=13854
        Port of commit 667785 from kjs

        - special case calling String.localeCompare() with no parameters to return 0.

        * kjs/string_object.cpp:
        (KJS::StringProtoFunc::callAsFunction):

darin's avatar
darin committed
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
2007-05-25  Kimmo Kinnunen  <kimmok@iki.fi>

        Reviewed by Darin.

        - Fix for http://bugs.webkit.org/show_bug.cgi?id=13456
        REGRESSION: setTimeout "arguments" object gets shadowed by a local variable

        - Add a explicit check for arguments. Previously check was done with getDirect,
        but since the arguments is created on-demand in ActivationImp, it doesn't
        show up in the test. 'arguments' should always be in the VarDeclNode's
        evaluation scope.

        * kjs/nodes.cpp:
        (VarDeclNode::evaluate): Additional check if the var decl identifier is 'arguments'

383
384
385
386
387
388
389
390
2007-05-25  George Staikos  <staikos@kde.org>

        Reviewed by Maciej.

        - Use COMPILER(GCC), not PLATFORM(GCC) - as Platform.h defines

        * wtf/FastMalloc.h:

weinig's avatar
weinig committed
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
2007-05-25  Kimmo Kinnunen  <kimmok@iki.fi>

        Reviewed by Darin.

        - http://bugs.webkit.org/show_bug.cgi?id=13623 (Decompilation of function
          doesn't compile with "++(x,y)")
        - Create the error node based on the actual node, not the node inside
          parenthesis
        - Fix applies to postfix, prefix and typeof operators
        - Produces run-time ReferenceError like other non-lvalue assignments etc.

        * kjs/grammar.y: Create {Prefix,Postfix}ErrorNode based on the actual node,
        not the based on the node returned by "nodeInsideAllParens()". Same for
        TypeOfValueNode.

406
407
408
409
410
411
412
413
414
415
416
2007-05-25  Simon Hausmann  <hausmann@kde.org>

        Reviewed by Zack.

        Fix crash in Qt JavaScript bindings when the arguments used on the Qt side are not
        registered with QMetaType.

        * bindings/qt/qt_instance.cpp:
        (KJS::Bindings::QtInstance::invokeMethod):
        * bindings/qt/qt_runtime.cpp:

weinig's avatar
weinig committed
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
2007-05-24  Luciano Montanaro  <mikelima@cirulla.net>

        Reviewed by Darin

        Patch for http://bugs.webkit.org/show_bug.cgi?id=13855
        Port patch 666176 to JavaScriptCore

        - Renamed JSValue::downcast() to JSValue::asCell() which makes the
        function meaning cleaner. It's modeled after Harri Porten change in 
        KDE trunk.

        * kjs/collector.cpp:
        (KJS::Collector::protect):
        (KJS::Collector::unprotect):
        (KJS::Collector::collectOnMainThreadOnly):
        * kjs/object.h:
        (KJS::JSValue::isObject):
        * kjs/string_object.cpp:
        (KJS::StringProtoFunc::callAsFunction):
        * kjs/value.h:
        (KJS::JSValue::asCell):
        (KJS::JSValue::isNumber):
        (KJS::JSValue::isString):
        (KJS::JSValue::isObject):
        (KJS::JSValue::getNumber):
        (KJS::JSValue::getString):
        (KJS::JSValue::getObject):
        (KJS::JSValue::getUInt32):
        (KJS::JSValue::mark):
        (KJS::JSValue::marked):
        (KJS::JSValue::type):
        (KJS::JSValue::toPrimitive):
        (KJS::JSValue::toBoolean):
        (KJS::JSValue::toNumber):
        (KJS::JSValue::toString):
        (KJS::JSValue::toObject):

454
455
456
457
458
459
2007-05-18  Holger Hans Peter Freyther  <zecke@selfish.org>

        Reviewed by Mark Rowe.

        * kjs/testkjs.pro: Make the Gdk port link to icu

ggaren's avatar
ggaren committed
460
461
462
463
464
465
466
467
468
2007-05-15  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Adele Peterson.
        
        It helps if you swap the right variable.

        * wtf/HashSet.h:
        (WTF::::operator):

469
470
471
472
473
474
475
476
477
478
2007-05-15  Lars Knoll <lars@trolltech.com>

        Reviewed by Zack

        Extend the QObject JavaScript bindings to work for slots with
        arguments.

        * bindings/qt/qt_instance.cpp:
        (KJS::Bindings::QtInstance::invokeMethod):

479
480
481
482
483
484
485
486
487
488
489
490
2007-05-14  Kimmo Kinnunen  <kimmok@iki.fi>

        Reviewed by Darin.

        - Fixes http://bugs.webkit.org/show_bug.cgi?id=13622 (Decompiler
          omits trailing comma in array literal)

         * kjs/nodes2string.cpp:
         (ArrayNode::streamTo): print extra ',' in case there was elision
         commas (check opt member var) and array elements present
         in the array expression

ggaren's avatar
ggaren committed
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
2007-05-14  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Oliver Hunt.
        
        Added HashMap::swap and HashSet::swap. WebCore now uses HashSet::swap.
        I figured while I was in the neighborhood I might as well add HashMap::swap,
        too.

        * wtf/HashMap.h:
        (WTF::::operator):
        (WTF::::swap):
        * wtf/HashSet.h:
        (WTF::::operator):
        (WTF::::swap):

506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
2007-05-11  Kimmo Kinnunen  <kimmok@iki.fi>

        Reviewed by Darin.

        - Fix for bug http://bugs.webkit.org/show_bug.cgi?id=13620
          Bogus decompilation of "for (var j = 1 in [])"
        - ForInNode toString()'ed to syntax error if there was var decl
          and initializer
        - ForNode toStringed()'ed lost 'var ' if it was present

        * kjs/nodes2string.cpp:
        (VarDeclListNode::streamTo): Print "var " here
        (VarStatementNode::streamTo): Don't print "var " here
        (ForNode::streamTo): Remove TODO comment, VarDeclListNode will
        stream the "var "
        (ForInNode::streamTo): ForIn initializer is printed by VarDeclNode

523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
2007-05-11  Kimmo Kinnunen  <kimmok@iki.fi>

        Reviewed by Darin.

        - Fixes http://bugs.webkit.org/show_bug.cgi?id=10878
          (Incorrect decompilation for "4..x")
        - Group numbers in dotted expressions in toString() output, so we
          avoid the 4.x constructs  when the original input is 4..x.
          4..x means the same as 4. .x or (4).x or Number(4).x

        * kjs/nodes2string.cpp:
        (KJS::SourceStream::):
        Add boolean flag to indicate that if next item is a number, it should be grouped.
        Add new formatting enum which turns on the boolean flag.
        (KJS::SourceStream::SourceStream): Added. Initialize the flag.
        (SourceStream::operator<<): Added. New overloaded operator with double value as parameter.
        (NumberNode::streamTo): Use the double operator
        (ArrayNode::streamTo):
        (DotAccessorNode::streamTo):
        (FunctionCallDotNode::streamTo):
        (FunctionCallParenDotNode::streamTo):
        (PostfixDotNode::streamTo):
        (DeleteDotNode::streamTo):
        (PrefixDotNode::streamTo):
        (AssignDotNode::streamTo): Use the new formatting enum to turn on the grouping flag.

lars's avatar
lars committed
549
550
551
552
553
554
555
556
557
558
559
2007-05-10  Lars Knoll <lars@trolltech.com>

        Reviewed by Zack

        Fix our last three test failures in the JavaScript
        tests.

        * wtf/unicode/qt4/UnicodeQt4.h:
        (WTF::Unicode::toLower):
        (WTF::Unicode::toUpper):

ggaren's avatar
ggaren committed
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
2007-05-08  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Darin Adler.
        
        Fixed #includes of JSStringRefCF.h and use of CF datatypes. I think I 
        misunderstood this issue before.

        * API/JavaScriptCore.h: #include JSStringRefCF.h. Platforms that don't
        want this behavior can just #include individual headers, instead of the
        umbrella framework header. But we definitely want Mac OS X clients to
        get the #include of JSStringRefCF.h "for free."
        * API/minidom.c: Don't #include JSStringRefCF.h. (Don't need to #include
        JavaScriptCore.h, either.)
        * API/testapi.c: Don't #include JSStringRefCF.h. Do use CF datatypes
        regardless of whether __APPLE__ is defined. Platforms that don't support
        CF just shouldn't compile this file.
        (main):

578
579
580
581
582
583
584
585
586
587
2007-05-09  Eric Seidel  <eric@webkit.org>

        Reviewed by mjs.
        
        http://bugs.webkit.org/show_bug.cgi?id=6985
        Cyclic __proto__ values cause WebKit to hang

        * kjs/object.cpp:
        (KJS::JSObject::put): do a cycle check before setting __proto__

588
589
590
591
592
593
594
595
596
597
598
599
2007-05-08  Kimmo Kinnunen  <kimmok@iki.fi>

        Reviewed by darin.  Landed by eseidel.

        - http://bugs.webkit.org/show_bug.cgi?id=10880 (Do..while loop gains 
        a semicolon each time it is toStringed)
        Grammar in Ecma-66262, 12.6: "do Statement while ( Expression );"
        EmptyStatement was created after every do..while(expr) which
        had semicolon at the end.

        * kjs/grammar.y: Require semicolon at the end of do..while

ggaren's avatar
ggaren committed
600
601
602
603
604
605
606
607
608
609
2007-05-08  Geoffrey Garen  <ggaren@apple.com>

        Build fix -- this time for sure.
        
        APICast.h, being private, ends up in a different folder than JSValueRef.h,
        so we can't include one from the other using "". Instead, just forward
        declare the relevant data types.

        * API/APICast.h:

610
611
612
613
614
615
2007-05-08  Geoffrey Garen  <ggaren@apple.com>

        Build fix: export APICast.h for WebCore and WebKit.

        * JavaScriptCore.xcodeproj/project.pbxproj:

darin's avatar
darin committed
616
617
618
619
2007-05-04  Darin Adler  <darin@apple.com>

        Reviewed by Adele.

darin's avatar
darin committed
620
621
        - fix http://bugs.webkit.org/show_bug.cgi?id=12821
          <rdar://problem/5007921> Number.toExponential doesn't work for negative numbers
darin's avatar
darin committed
622
623
624
625

        * kjs/number_object.cpp: (NumberProtoFunc::callAsFunction):
        Added a call to fabs before calling log10.

626
627
628
629
630
631
632
633
634
635
2007-05-03  Holger Freyther <freyther@kde.org>

        Reviewed by Zack, landed by Simon.
        This is bugzilla bug 13499.

        * JavaScriptCore.pri: Place Qt into the qt-port scope
        * bindings/testbindings.pro: Place Qt into the qt-port scope
        * kjs/testkjs.pro: Place Qt into the qt-port scope
        * pcre/pcre.pri: Place Qt into the qt-port scope

harrison's avatar
harrison committed
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
2007-05-02  David Harrison  <harrison@apple.com>

        Reviewed by Antti.

        <rdar://problem/5174862> Crash resulting from DeprecatedString::insert()

        Added insertion support for more than one value.
        
        * wtf/Vector.h:
        (WTF::::insert):
        Added support for inserting multiple values.
        
        (WTF::::prepend):
        New. Insert at the start of vectors. Convenient for vectors used as strings.

651
652
653
654
655
656
657
658
659
660
2007-05-01  Jungshik Shin  <jungshik.shin@gmail.com>

        Reviewed by Alexey.

        - get rid of non-ASCII lteral characters : suppress compiler warnings
        http://bugs.webkit.org/show_bug.cgi?id=13551
         
        * kjs/testkjs.cpp:
        * pcre/pcre_compile.c:

661
662
663
664
665
666
667
668
669
2007-04-28  Jungshik Shin  <jungshik.shin@gmail.com>

        Reviewed by Sam Weinig.

        - Replace copyright sign in Latin-1 (0xA9) with '(C)'
        http://bugs.webkit.org/show_bug.cgi?id=13531

        * bindings/npruntime.h:
    
darin's avatar
darin committed
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
2007-04-28  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fix <rdar://problem/5154144> Hamachi test fails: assertion failure in ListHashSet

        Test: fast/forms/add-remove-form-elements-stress-test.html

        * wtf/ListHashSet.h:
        (WTF::ListHashSetNodeAllocator::ListHashSetNodeAllocator): Initialize
        m_isDoneWithInitialFreeList to false.
        (WTF::ListHashSetNodeAllocator::allocate): Added assertions based on a debug-only
        m_isAllocated flag that make sure we don't allocate a block that's already allocated.
        These assertions helped pinpoint the bug. Set m_isDoneWithInitialFreeList when we
        allocate the last block of the initial free list. Once we're done with the initial
        free list, turn off the rule that says that the next node in the pool after the last
        node in the free list is also free. This rule works because any free nodes are added
        to the head of the free list, so a node that hasn't been allocated even once is always
688
689
690
        at the tail of the free list and all the nodes after it also haven't been allocated
        even once. But it doesn't work any longer once the entire pool has been used at least
        once, because there's nothing special about the last node on the free list any more.
darin's avatar
darin committed
691
692
693
694
695
696
697
698
699
        (WTF::ListHashSetNodeAllocator::deallocate): Set the node's m_isAllocated to false.
        (WTF::ListHashSetNodeAllocator::pastPool): Added. Used above.
        (WTF::ListHashSetNodeAllocator::inPool): Changed to use the pastPool function.
        (WTF::ListHashSetNode::ListHashSetNode): Initialize m_isAllocated to true.
        (WTF::ListHashSetNode::operator new): Removed variable name for unused size
        parameter.
        (WTF::ListHashSetNode::destroy): Changed to call the destructor rather than
        delete -- this gets rid of the need to define an operator delete.

700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
2007-04-27  Christopher Brichford  <chrisb@adobe.com>

        Reviewed by Timothy Hatcher.

        Fix for: Bug 13211: Move JavaScriptCore mac project files for apollo port
        http://bugs.webkit.org/show_bug.cgi?id=13211

        * JavaScriptCore.apolloproj/mac/JavaScriptCore.Debug.xcconfig: Added.
        * JavaScriptCore.apolloproj/mac/JavaScriptCore.Release.xcconfig: Added.
        * JavaScriptCore.apolloproj/mac/JavaScriptCore.xcconfig: Added.
        * JavaScriptCore.apolloproj/mac/JavaScriptCore.xcodeproj/project.pbxproj: Added.
        * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.Debug.xcconfig: Removed.
        * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.Release.xcconfig: Removed.
        * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcconfig: Removed.
        * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj: Removed.

716
717
718
719
720
721
722
723
724
2007-04-27  Holger Freyther <freyther@kde.org>

        Reviewed by Maciej.

        Remove unmaintained CMake build system.

        * CMakeLists.txt: Removed.
        * pcre/CMakeLists.txt: Removed.

bdash's avatar
bdash committed
725
726
727
728
729
730
731
732
2007-04-27  Mark Rowe  <mrowe@apple.com>

        Reviewed by Oliver.

        * JavaScriptCore.xcodeproj/project.pbxproj: Improve dependencies in Xcode project
        by marking dftables as a dependency of Generate Derived Sources rather than of
        JavaScriptCore itself.

733
734
735
736
737
738
739
740
741
742
2007-04-26  Geoffrey Garen  <ggaren@apple.com>

        Build fix -- added #includes that we used to get implicitly through
        JSStringRef.h.

        * API/JSNode.c:
        * API/JSNodeList.c:
        * API/minidom.c:
        * API/testapi.c:

743
744
745
746
747
748
749
750
751
752
2007-04-26  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Maciej Stachowiak, Adam Roben.
        
        Fixed 
        <rdar://problem/4885130> Remove #include of JSStringRefCF.h from JSStringRef.h
        <rdar://problem/4885123> JavaScriptCore is not cross-platform -- JSStringRef.h references CF datatypes

        * API/JSStringRef.h: Removed #include -- no clients need it anymore.

753
754
755
756
757
758
759
760
761
762
2007-04-25  David Kilzer  <ddkilzer@apple.com>

        Reviewed by Maciej.

        Add assertions for debug builds.

        * kjs/JSLock.cpp:
        (KJS::JSLock::lock): Assert the return value of pthread_mutex_lock() in debug builds.
        (KJS::JSLock::unlock): Assert the return value of pthread_mutex_unlock() in debug builds.

mjs's avatar
mjs committed
763
764
765
766
767
768
769
770
771
2007-04-25  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Anders.
        
        - fix build problems

        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Disable warning that
        gives often downright incorrect results based on guessing what will happen in 64-bit.

darin's avatar
darin committed
772
773
774
775
776
777
778
779
780
781
782
783
784
785
2007-04-25  Darin Adler  <darin@apple.com>

        Reviewed by Geoff.

        - tweak the allocator for a small speedup -- Shark showed this was a win, but I can't
          measure an improvement right now, but it's also clear these changes do no harm

        * wtf/FastMalloc.cpp:
        (WTF::LgFloor): Use ALWAYS_INLINE here; in testing I did a while back this was necessary
        to get this single-instruction function to be inlined.
        (WTF::SizeClass): Use ALWAYS_INLINE here too for the same reason. Also change the special
        case for a size of 0 to work without a branch for a bit of extra speed.
        (WTF::ByteSizeForClass): Use ALWAYS_INLINE here too for the same reason.

mjs's avatar
mjs committed
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
2007-04-24  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Oliver.
        
        - use custom calling convention for everything in nodes.cpp on intel gcc for 1.5% speed boost

        Nearly all functions in nodes.cpp were marked up to use the
        regparm(3) calling convention under GCC for x86, since this is
        faster and they are all guaranteed to be called only internally to
        kjs.
        
        The only exception is destructors, since delete doesn't know how to use a custom calling convention.
        
        * kjs/nodes.cpp:
        (dotExprDoesNotAllowCallsString):
        * kjs/nodes.h:
        (KJS::Node::):
        (KJS::StatementNode::):
        (KJS::NullNode::):
        (KJS::BooleanNode::):
        (KJS::NumberNode::):
        (KJS::StringNode::):
        (KJS::RegExpNode::):
        (KJS::ThisNode::):
        (KJS::ResolveNode::):
        (KJS::GroupNode::):
        (KJS::ElementNode::):
        (KJS::ArrayNode::):
        (KJS::PropertyNameNode::):
        (KJS::PropertyNode::):
        (KJS::PropertyListNode::):
        (KJS::ObjectLiteralNode::):
        (KJS::BracketAccessorNode::):
        (KJS::DotAccessorNode::):
        (KJS::ArgumentListNode::):
        (KJS::ArgumentsNode::):
        (KJS::NewExprNode::):
        (KJS::FunctionCallValueNode::):
        (KJS::FunctionCallResolveNode::):
        (KJS::FunctionCallBracketNode::):
        (KJS::FunctionCallParenBracketNode::):
        (KJS::FunctionCallDotNode::):
        (KJS::FunctionCallParenDotNode::):
        (KJS::PostfixResolveNode::):
        (KJS::PostfixBracketNode::):
        (KJS::PostfixDotNode::):
        (KJS::PostfixErrorNode::):
        (KJS::DeleteResolveNode::):
        (KJS::DeleteBracketNode::):
        (KJS::DeleteDotNode::):
        (KJS::DeleteValueNode::):
        (KJS::VoidNode::):
        (KJS::TypeOfResolveNode::):
        (KJS::TypeOfValueNode::):
        (KJS::PrefixResolveNode::):
        (KJS::PrefixBracketNode::):
        (KJS::PrefixDotNode::):
        (KJS::PrefixErrorNode::):
        (KJS::UnaryPlusNode::):
        (KJS::NegateNode::):
        (KJS::BitwiseNotNode::):
        (KJS::LogicalNotNode::):
        (KJS::MultNode::):
        (KJS::AddNode::):
        (KJS::ShiftNode::):
        (KJS::RelationalNode::):
        (KJS::EqualNode::):
        (KJS::BitOperNode::):
        (KJS::BinaryLogicalNode::):
        (KJS::ConditionalNode::):
        (KJS::AssignResolveNode::):
        (KJS::AssignBracketNode::):
        (KJS::AssignDotNode::):
        (KJS::AssignErrorNode::):
        (KJS::CommaNode::):
        (KJS::AssignExprNode::):
        (KJS::VarDeclListNode::):
        (KJS::VarStatementNode::):
        (KJS::EmptyStatementNode::):
        (KJS::ExprStatementNode::):
        (KJS::IfNode::):
        (KJS::DoWhileNode::):
        (KJS::WhileNode::):
        (KJS::ForNode::):
        (KJS::ContinueNode::):
        (KJS::BreakNode::):
        (KJS::ReturnNode::):
        (KJS::WithNode::):
        (KJS::LabelNode::):
        (KJS::ThrowNode::):
        (KJS::TryNode::):
        (KJS::ParameterNode::):
        (KJS::Parameter::):
        (KJS::FunctionBodyNode::):
        (KJS::FuncExprNode::):
        (KJS::FuncDeclNode::):
        (KJS::SourceElementsNode::):
        (KJS::CaseClauseNode::):
        (KJS::ClauseListNode::):
        (KJS::SwitchNode::):

887
888
889
890
891
892
893
894
2007-04-24  Oliver Hunt  <oliver@apple.com>

        GTK Build fix, ::findEntry->KJS::findEntry

        * kjs/lookup.cpp:
        (KJS::Lookup::findEntry):
        (KJS::Lookup::find):

mjs's avatar
mjs committed
895
896
897
898
899
900
901
902
903
904
905
906
907
908
2007-04-23  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Geoff.
        
        - compile most of JavaScriptCore as one file for 4% JS iBench speed improvement 

        * JavaScriptCore.xcodeproj/project.pbxproj: Add AllInOneFile.cpp, and remove files it includes
        from the build.
        * kjs/AllInOneFile.cpp: Added.
        * kjs/dtoa.cpp: Renamed CONST to CONST_ to avoid conflict.
        (Bigint::):
        (Bigint::nrv_alloc):
        * kjs/lookup.cpp: Use "namspace KJS { ... }" instead of "using namespace KJS;" 

mjs's avatar
mjs committed
909
910
911
912
913
914
2007-04-23  Maciej Stachowiak  <mjs@apple.com>

        Build fix, not reviewed.

        * kjs/collector.h: Fix struct/class mismatch.

mjs's avatar
mjs committed
915
916
917
918
919
920
921
922
923
924
925
2007-04-23  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

        - raise ALLOCATIONS_PER_COLLECTION to 4000, for 3.7% iBench speed improvement
         
        Now that the cell size is smaller and the block size is bigger, we can fit 4000 objects in
        the two spare cells the collector is willing to keep around, so collect a bit less often.
        
        * kjs/collector.cpp:

mjs's avatar
mjs committed
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
2007-04-23  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin and Geoff.
        
        - move mark and collectOnMainThreadOnly bits into separate bitmaps
        
        This saves 4 bytes per cell, allowing shrink of cell size to 32,
        which leads to a .8% speed improvement on iBench.
        
        This is only feasible because of all the previous changes on the branch.

        * kjs/collector.cpp:
        (KJS::allocateBlock): Adjust for some renames of constants. 
        (KJS::Collector::markStackObjectsConservatively): Now that cells are 32 bytes (64 
        bytes on 64-bit) the cell alignment check can be made much more strict, and also
        obsoletes the need for a % sizeof(CollectorCell) check. Also, we can mask off the low
        bits of the pointer to have a potential block pointer to look for.
        (KJS::Collector::collectOnMainThreadOnly): Use bitmap.
        (KJS::Collector::markMainThreadOnlyObjects): Use bitmap.
        (KJS::Collector::collect): When sweeping, use bitmaps directly to find mark bits.
        * kjs/collector.h:
        (KJS::): Move needed constants and type declarations here.
        (KJS::CollectorBitmap::get): Bit twiddling to get a bitmap value.
        (KJS::CollectorBitmap::set): Bit twiddling to set a bitmap bit to true.
        (KJS::CollectorBitmap::clear): Bit twiddling to set a bitmap bit to false.
        (KJS::CollectorBitmap::clearAll): Clear whole bitmap at one go.
        (KJS::Collector::cellBlock): New operation, compute the block pointer for
        a cell by masking off low bits.
        (KJS::Collector::cellOffset): New operation, compute the cell offset for a
        cell by masking off high bits and dividing (actually a shift).
        (KJS::Collector::isCellMarked): Check mark bit in bitmap
        (KJS::Collector::markCell): Set mark bit in bitmap.
        * kjs/value.h:
        (KJS::JSCell::JSCell): No more bits.
        (KJS::JSCell::marked): Let collector handle it.
        (KJS::JSCell::mark): Let collector handle it.

andersca's avatar
andersca committed
963
964
965
966
967
968
969
2007-04-23  Anders Carlsson  <andersca@apple.com>

        Build fix.
        
        * kjs/regexp_object.h:
        RegExpObjectImpPrivate is a struct, not a class.
        
mjs's avatar
mjs committed
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
2007-04-23  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.
        
        - shrink FunctionImp / DeclaredFunctionImp by 4 bytes, by moving parameter list to function body
        
        I reconciled this with a similar change in KDE kjs by Maks Orlovich <maksim@kde.org>.

        * kjs/function.cpp:
        (KJS::FunctionImp::callAsFunction):
        (KJS::FunctionImp::passInParameters):
        (KJS::FunctionImp::lengthGetter):
        (KJS::FunctionImp::getParameterName):
        * kjs/function.h:
        * kjs/function_object.cpp:
        (FunctionProtoFunc::callAsFunction):
        (FunctionObjectImp::construct):
        * kjs/nodes.cpp:
        (FunctionBodyNode::addParam):
        (FunctionBodyNode::paramString):
        (FuncDeclNode::addParams):
        (FuncDeclNode::processFuncDecl):
        (FuncExprNode::addParams):
        (FuncExprNode::evaluate):
        * kjs/nodes.h:
        (KJS::Parameter::Parameter):
        (KJS::FunctionBodyNode::numParams):
        (KJS::FunctionBodyNode::paramName):
        (KJS::FunctionBodyNode::parameters):
        (KJS::FuncExprNode::FuncExprNode):
        (KJS::FuncDeclNode::FuncDeclNode):
        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Disable 64-bit warnings because
        they handle size_t badly.

mjs's avatar
mjs committed
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
2007-04-23  Maciej Stachowiak  <mjs@apple.com>
 
        Reviewed by Darin.

        - shrink RegexpObjectImp by 4 bytes
        
        Somewhat inexplicably, this seems to be a .33% speedup on JS iBench.
        
        * kjs/regexp_object.cpp:
        (KJS::RegExpObjectImpPrivate::RegExpObjectImpPrivate):
        (RegExpObjectImp::RegExpObjectImp):
        (RegExpObjectImp::performMatch):
        (RegExpObjectImp::arrayOfMatches):
        (RegExpObjectImp::getBackref):
        (RegExpObjectImp::getLastMatch):
        (RegExpObjectImp::getLastParen):
        (RegExpObjectImp::getLeftContext):
        (RegExpObjectImp::getRightContext):
        (RegExpObjectImp::getValueProperty):
        (RegExpObjectImp::putValueProperty):
        * kjs/regexp_object.h:

mjs's avatar
mjs committed
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
2007-04-23  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Oliver.
        
        - change to 1-bit bitfields instead of 8-bit, this turns out to lead to a .51% speedup on JS iBench
        
        The 1-bit bitfields are actually faster than just plain bools, at least on Intel (go figure).

        * kjs/property_map.h:

mjs's avatar
mjs committed
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
2007-04-23  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.
       
        - shrink ArrayInstance objects by 4 bytes
        http://bugs.webkit.org/show_bug.cgi?id=13386
        
        I did this by storing the capacity before the beginning of the storage array. It turns out
        it is rarely needed and is by definition 0 when the storage array is null.
 
        * kjs/array_instance.h:
        (KJS::ArrayInstance::capacity): Get it from the secret stash
        * kjs/array_object.cpp:
        (allocateStorage): New function to encapsulate allocating the storage with extra space ahead
        for the capacity.
        (reallocateStorage): ditto for realloc
        (ArrayInstance::ArrayInstance):
        (ArrayInstance::~ArrayInstance):
        (ArrayInstance::resizeStorage):

darin's avatar
darin committed
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
2007-04-23  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fix <rdar://problem/4840688> REGRESSION (r10588, r10621): JavaScript won't parse
          modifications of non-references (breaks 300themovie.warnerbros.com, fedex.com)

        Despite the ECMAScript specification's claim that you can treat these as syntax
        errors, doing so creates some website incompatibilities. So this patch turns them back
        into evaluation errors instead.

        Test: fast/js/modify-non-references.html

        * kjs/grammar.y: Change makeAssignNode, makePrefixNode, and makePostfixNode so that they
        never fail to parse. Update rules that use them. Fix a little bit of indenting. Use
        new PostfixErrorNode, PrefixErrorNode, and AssignErrorNode classes.

        * kjs/nodes.h: Added an overload of throwError that takes a char* argument.
        Replaced setExceptionDetailsIfNeeded and debugExceptionIfNeeded with handleException,
        which does both. Added PostfixErrorNode, PrefixErrorNode, and AssignErrorNode classes.

        * kjs/nodes.cpp: Changed exception macros to use handleException; simpler and smaller
        code size than the two functions that we used before.
        (Node::throwError): Added the overload mentioned above.
        (Node::handleException): Added. Contains the code from both setExceptionDetailsIfNeeded
        and debugExceptionIfNeeded.
        (PostfixErrorNode::evaluate): Added. Throws an exception.
        (PrefixErrorNode::evaluate): Ditto.
        (AssignErrorNode::evaluate): Ditto.
        (ThrowNode::execute): Call handleException instead of debugExceptionIfNeeded; this
        effectively adds a call to setExceptionDetailsIfNeeded, which may help with getting
        the correct file and line number for these exceptions.

        * kjs/nodes2string.cpp:
        (PostfixErrorNode::streamTo): Added.
        (PrefixErrorNode::streamTo): Added.
        (AssignErrorNode::streamTo): Added.

mjs's avatar
mjs committed
1094
1095
1096
1097
1098
1099
1100
1101
1102
2007-04-23  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.
        
        - fix test failures / crashes on PPC

        * kjs/property_map.h: Make the bool fields explicitly 8-bit bitfields, since bool is a full
        word there otherwise :-(

mjs's avatar
mjs committed
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
2007-04-23  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.
        
        - fix more test case failures

        * bindings/runtime_array.cpp:
        (RuntimeArray::RuntimeArray): inherit from JSObject instead of ArrayInstance; it turns
        out that this class only needs the prototype and classInfo from ArrayInstance, not the
        actual class itself, and it was too big otherwise.
        (RuntimeArray::getOwnPropertySlot):
        * bindings/runtime_array.h:

mjs's avatar
mjs committed
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
2007-04-23  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.
        
        - fix some test failures

        * bindings/runtime_method.cpp:
        (RuntimeMethod::RuntimeMethod): inherit from InternalFunctionImp instead of FunctionImpl,
        otherwise this is too big
        (RuntimeMethod::getOwnPropertySlot):
        * bindings/runtime_method.h:

mjs's avatar
mjs committed
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
2007-04-22  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.
        
        - discard the arguments List for an ActivationImp when the corresponding Context is destroyed (1.7% speedup)
        http://bugs.webkit.org/show_bug.cgi?id=13385

        Based an idea by Christopher E. Hyde <C.Hyde@parableuk.force9.co.uk>. His patch to do 
        this also had many other List changes and I found this much simpler subset of the changes
        was actually a hair faster.
        
        This optimization is valid because the arguments list is only kept around to
        lazily make the arguments object. If it's not made by the time the function
        exits, it never will be, since any function that captures the continuation will
        have its own local arguments variable in scope.
        
        Besides the 1.7% speed improvement, it shrinks List by 4 bytes
        (which in turn shrinks ActivationImp by 4 bytes).
        
        * kjs/Context.cpp:
        (KJS::Context::~Context): Clear the activation's arguments list.
        * kjs/function.cpp:
        (KJS::ActivationImp::ActivationImp): Adjusted for list changes.
        (KJS::ActivationImp::mark): No need to mark, lists are always protected (this doesn't
        cause a ref-cycle for reasons stated above).
        (KJS::ActivationImp::createArgumentsObject): Clear arguments list.
        * kjs/function.h:
        * kjs/list.cpp:
        (KJS::List::List): No more needsMarking boolean
        (KJS::List::operator=): ditto
        * kjs/list.h:
        (KJS::List::List): ditto
        (KJS::List::reset): ditto
        (KJS::List::deref): ditto

mjs's avatar
mjs committed
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
2007-04-22  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.
        
        - shrink PropertyMap by 8 bytes and therefore shrink CELL_SIZE to 40 (for 32-bit; 
        similar shrinkage for 64-bit)
        http://bugs.webkit.org/show_bug.cgi?id=13384

        Inspired by similar changes by Christopher E. Hyde <C.Hyde@parableuk.force9.co.uk>
        done in the kjs-tweaks branch of KDE's kjs. However, this version is somewhat 
        cleaner style-wise and avoids some of the negative speed impact (at least on gcc/x86) 
        of his version.
        
        This is nearly a wash performance-wise, maybe a slight slowdown, but worth doing
        to eventually reach cell size 32.
        
        * kjs/collector.cpp:
        (KJS::):
        * kjs/property_map.cpp:
        (KJS::PropertyMap::~PropertyMap):
        (KJS::PropertyMap::clear):
        (KJS::PropertyMap::get):
        (KJS::PropertyMap::getLocation):
        (KJS::PropertyMap::put):
        (KJS::PropertyMap::insert):
        (KJS::PropertyMap::expand):
        (KJS::PropertyMap::rehash):
        (KJS::PropertyMap::remove):
        (KJS::PropertyMap::mark):
        (KJS::PropertyMap::containsGettersOrSetters):
        (KJS::PropertyMap::getEnumerablePropertyNames):
        (KJS::PropertyMap::getSparseArrayPropertyNames):
        (KJS::PropertyMap::save):
        (KJS::PropertyMap::checkConsistency):
        * kjs/property_map.h:
        (KJS::PropertyMap::hasGetterSetterProperties):
        (KJS::PropertyMap::setHasGetterSetterProperties):
        (KJS::PropertyMap::):
        (KJS::PropertyMap::PropertyMap):

mjs's avatar
mjs committed
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
2007-04-22  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.
        
        - change blocks to 64k in size, and use various platform-specific calls to allocate at 64k-aligned addresses
        http://bugs.webkit.org/show_bug.cgi?id=13383
        
        * kjs/collector.cpp:
        (KJS::allocateBlock): New function to allocate 64k of 64k-aligned memory
        (KJS::freeBlock): Corresponding free
        (KJS::Collector::allocate):
        (KJS::Collector::collect):

mjs's avatar
mjs committed
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
2007-04-22  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin and Geoff.
        
        - remove the concept of oversize objects, now that there aren't any (for now
        only enforced with an assert).
        http://bugs.webkit.org/show_bug.cgi?id=13382

        This change is a .66% speedup on JS iBench for 32-bit platforms, probably much more
        for 64-bit since it finally gives a reasonable cell size, but I did not test that.
        
        * kjs/collector.cpp:
        (KJS::): Use different cell size for 32-bit and 64-bit, now that there is no
        oversize allocation.
        (KJS::Collector::allocate): Remove oversize allocator.
        (KJS::Collector::markStackObjectsConservatively): Don't check oversize objects.
        (KJS::Collector::markMainThreadOnlyObjects): Ditto.
        (KJS::Collector::collect): Ditto.

1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
2007-04-21  Mitz Pettel  <mitz@webkit.org>

        Reviewed by Adam.

        - fix http://bugs.webkit.org/show_bug.cgi?id=13428
          REGRESSION (r20973-r20976): Failing ecma/Array/15.4.4.5-3.js

        - fix http://bugs.webkit.org/show_bug.cgi?id=13429
          REGRESSION (r20973-r20976): Crashing in fast/dom/plugin-attributes-enumeration.html

        * kjs/array_object.cpp:
        (ArrayInstance::sort): Free the old storage, not the new one.

mjs's avatar
mjs committed
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
2007-04-20  Maciej Stachowiak  <mjs@apple.com>

        Not reviewed, build fix.

        - fix build problem with last change - -O3 complains more about uninitialized variables
        
        * pcre/pcre_compile.c:
        (compile_branch):
        (pcre_compile2):

mjs's avatar
mjs committed
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
2007-04-20  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.
        
        - <rdar://problem/5149915> use mergesort when possible, since it leads to fewer compares (2% JS iBench speedup)

        * kjs/array_object.cpp:
        (ArrayInstance::sort): Use mergesort(3) on platforms that have it, since it tends
        to do fewer compares than qsort; but avoid it very on large arrays since it uses extra
        memory. Also added comments identifying possibly even better sorting algorithms
        for sort by string value and sort by compare function.
        * kjs/config.h:

mjs's avatar
mjs committed
1271
1272
1273
1274
1275
1276
1277
1278
2007-04-20  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.
        
        - bump optimization flags up to -O3 for 1% JS iBench speed improvement 

        * Configurations/Base.xcconfig:

bdash's avatar
bdash committed
1279
1280
1281
1282
1283
1284
1285
1286
1287
2007-04-20  Mark Rowe  <mrowe@apple.com>

        Reviewed by Maciej.

        Fix bogus optimisation in the generic pthread code path.

        * kjs/collector.cpp:
        (KJS::currentThreadStackBase):

bdash's avatar
bdash committed
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
2007-04-20  Mark Rowe  <mrowe@apple.com>

        Reviewed by Anders.

        Improve FreeBSD compatibility, as suggested by Alexander Botero-Lowry.

        * kjs/collector.cpp:
        (KJS::currentThreadStackBase): FreeBSD requires that pthread_attr_t's are
        initialized via pthread_attr_init before being used in any context.

bdash's avatar
bdash committed
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
2007-04-19  Mark Rowe  <mrowe@apple.com>

        Reviewed by Darin.

        Fix http://bugs.webkit.org/show_bug.cgi?id=13401
        Bug 13401: Reproducible crash calling myArray.sort(compareFn) from within
        a sort comparison function

        * kjs/array_object.cpp:
        (ArrayInstance::sort): Save/restore the static variables around calls to qsort
        to ensure nested calls to ArrayInstance::sort behave correctly.

ggaren's avatar
ggaren committed
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
2007-04-12  Deneb Meketa  <dmeketa@adobe.com>

        Reviewed by Darin Adler.

        http://bugs.webkit.org/show_bug.cgi?id=13029
        rdar://problem/4994849
        Bug 13029: Permit NPAPI plug-ins to see HTTP response headers.
        This doesn't actually change JavaScriptCore, but that's where npapi.h is.

        * bindings/npapi.h:
        Add headers member to NPStream struct.  Also increase NP_VERSION_MINOR to 18.
        Increasing to >= 17 allows plug-ins to safely detect whether to look for
        NPStream::headers.  Increasing from 17 to 18 reflects presence of NPObject
        enumeration, which was added in a prior patch, and which has been agreed to
        constitute version 18 by the plugin-futures list.  Also add other missing
        bits of npapi.h to catch up from 14 to 18.  This includes features that are
        not implemented in WebKit, but those are safely stubbed.

ggaren's avatar
ggaren committed
1328
1329
1330
1331
1332
1333
1334
1335
1336
2007-04-10  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Mark Rowe.
        
        Fixed last check-in to print in release builds, too.

        * kjs/collector.cpp:
        (KJS::getPlatformThreadRegisters):

1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
2007-04-10  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by John Sullivan, Darin Adler.
        
        Fixed <rdar://problem/5121899> JavaScript garbage collection leads to 
        later crash under Rosetta (should abort or leak instead?)
        
        Log an error message and crash if the kernel reports failure during GC.
        We decided to do this instead of just leaking because we don't want people
        to get the mistaken impression that running in Rosetta is a supported
        configurtion.
        
        The CRASH macro will also hook into CrashReporter, which will tell us if 
        many (any?) users run into this issue.

        * kjs/collector.cpp:
        (KJS::getPlatformThreadRegisters):

kjk's avatar
kjk committed
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
2007-04-06  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>

        Reviewed by darin.

        Coverity fix. Coverity says:
        "Event var_deref_model: Variable "sourceRanges" tracked as NULL was passed to a
        function that dereferences it"

        * kjs/string_object.cpp:
        (KJS::replace):

ggaren's avatar
ggaren committed
1366
1367
1368
1369
1370
1371
1372
2007-04-06  Geoffrey Garen  <ggaren@apple.com>

        Rubber stamped by Adele Peterson.

        * kjs/ExecState.h: Removed obsolete forward/friend declaration of 
        RuntimeMethodImp.

kjk's avatar
kjk committed
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
2007-04-05  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>

        Reviewed by darin.

        Coverity fix. Coverity says:
        "Event check_after_deref: Pointer "dateString" dereferenced before NULL check"

        * kjs/date_object.cpp:
        (KJS::parseDate):

kjk's avatar
kjk committed
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
2007-04-05  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>

        Reviewed by darin.

        Coverity fix. Coverity says:
        "Event check_after_deref: Pointer "re" dereferenced before NULL check"

        * pcre/pcre_study.c:
        (pcre_study):

kjk's avatar
kjk committed
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
2007-04-05  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>

        Reviewed by darin.

        Coverity fixes. Coverity says:
        "Event leaked_storage: Returned without freeing storage "buffer""
        and:
        "Event leaked_storage: Returned without freeing storage "script""

        * kjs/testkjs.cpp:
        (doIt):
        (createStringWithContentsOfFile):

kjk's avatar
kjk committed
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
2007-04-05  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>

        Reviewed by darin.

        Coverity fix: in single-threaded case currentThreadIsMainThread is always true
        so the code in if (!currentThreadIsMainThread) cannot possibly be reached
        and Coverity complains about dead code.

        * kjs/collector.cpp:
        (KJS::Collector::collect):

bdash's avatar
bdash committed
1417
1418
=== Safari-5522.6 ===

kmccullo's avatar
kmccullo committed
1419
1420
1421
1422
1423
1424
1425
1426
2007-04-03  Kevin McCullough  <kmccullough@apple.com>

        Reviewed by Adam.

        - Testing a post-commit hook.

        * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:

andersca's avatar
andersca committed
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
2007-04-03  Anders Carlsson  <andersca@apple.com>

        Reviewed by Adam.

        <rdar://problem/5107534>
        http://bugs.webkit.org/show_bug.cgi?id=13265
        REGRESSION: Crash in KJS::Bindings::convertValueToNPVariant
        
        * bindings/NP_jsobject.cpp:
        (_NPN_InvokeDefault):
1437
1438
        Return false if the object isn't a function. Set the return value to undefined by default
        (to match Firefox).
andersca's avatar
andersca committed
1439
        
andersca's avatar
andersca committed
1440
1441
1442
1443
1444
1445
1446
2007-03-30  Anders Carlsson <andersca@apple.com>

        Build fix.
        
        * bindings/NP_jsobject.cpp:
        (_NPN_Enumerate):

andersca's avatar
andersca committed
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
2007-03-30  Anders Carlsson  <andersca@apple.com>

        Reviewed by Geoff.

        Implement _NPN_Enumerate support.
        
        * JavaScriptCore.exp:
        * bindings/NP_jsobject.cpp:
        (_NPN_Enumerate):
        * bindings/c/c_instance.cpp:
        (KJS::Bindings::CInstance::getPropertyNames):
        * bindings/c/c_instance.h:
        * bindings/npapi.h:
        * bindings/npruntime.h:
        * bindings/npruntime_impl.h:
        * bindings/runtime.h:
        (KJS::Bindings::Instance::getPropertyNames):
        * bindings/runtime_object.cpp:
        (RuntimeObjectImp::getPropertyNames):
        * bindings/runtime_object.h:
        (KJS::RuntimeObjectImp::getInternalInstance):

dsmith's avatar
dsmith committed
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
2007-03-28  Jeff Walden  <jwalden+code@mit.edu>

        Reviewed by Darin.

        http://bugs.webkit.org/show_bug.cgi?id=12963
        Fix some inconsistencies in the Mozilla JS Array extras implementations
        with respect to the Mozilla implementation:

          - holes in arrays should be skipped, not treated as undefined,
            by all such methods
          - an element with value undefined is not a hole
          - Array.prototype.forEach should return undefined

        * kjs/array_object.cpp:
        (ArrayInstance::getOwnPropertySlot):
        (ArrayProtoFunc::callAsFunction):

andersca's avatar
andersca committed
1486
1487
1488
1489
1490
1491
1492
1493
2007-03-27  Anders Carlsson  <acarlsson@apple.com>

        Reviewed by Geoff.

        * bindings/NP_jsobject.cpp:
        (_NPN_InvokeDefault):
        Call JSObject:call for native JavaScript objects.

andersca's avatar
andersca committed
1494
1495
1496
1497
2007-03-26  David Carson  <dacarson@gmail.com>

        Reviewed by Darin, landed by Anders.

ddkilzer's avatar
ddkilzer committed
1498
1499
1500
        Fix for: REGRESSION (r19559): Java applet crash
        http://bugs.webkit.org/show_bug.cgi?id=13142
        <rdar://problem/5080340>
andersca's avatar
andersca committed
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514

        The previous fix http://bugs.webkit.org/show_bug.cgi?id=12636 
        introduced new JNIType to enum in jni_utility.h This is a 
        problem on the Mac as it seems that the JNIType enum is also
        used in the JVM, it is used to specify the return type in
        jni_objc.mm
        Corrected the fix by moving type to the end, and changing
        jni_objc.mm to convert the new type to an old compatible
        type.

        * bindings/jni/jni_objc.mm:
        (KJS::Bindings::dispatchJNICall):
        * bindings/jni/jni_utility.h:

aroben's avatar
aroben committed
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
2007-03-26  Christopher Brichford  <chrisb@adobe.com>

        Reviewed/landed by Adam.

        Bug 13198: Move build settings from project file to xcconfig file for apollo
        port JSCore
        http://bugs.webkit.org/show_bug.cgi?id=13198

        - Moving build settings from xcode project file to xcconfig files.

        * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.Debug.xcconfig:
        * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.Release.xcconfig:
        * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcconfig:
        * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj:

1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
2007-03-26  Brady Eidson  <beidson@apple.com>

        Rubberstamped by Anders and Maciej aand Geoff (oh my!)
        
        Since CFTypeRef is really void*, a RetainPtr couldn't be used. 
        RefType was "void", which doesn't actually exist as a type.
        Since RefType only existed for operator*(), and since that operator
        doesn't make any sense for RetainPtr, I removed them!

        * kjs/nodes.cpp: Touch this to force a rebuild and (hopefully) help the
          compiler with dependencies
        * wtf/RetainPtr.h: Nuke RefType and operator*()

1543
1544
1545
1546
1547
1548
1549
2007-03-26  Geoffrey Garen  <ggaren@apple.com>

        Touched a file to (hopefully) help the compiler with RetainPtr dependencies.

        * kjs/nodes.cpp:
        (Node::deref):

beidson's avatar
beidson committed
1550
1551
1552
1553
1554
1555
1556
1557
2007-03-24  Brady Eidson  <beidson@apple.com>

        Reviewed by Adam

        Whoops, RetainPtr should be in the WTF namespace

        * wtf/RetainPtr.h:

beidson's avatar
beidson committed
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
2007-03-24  Brady Eidson  <beidson@apple.com>

        Reviewed by Adam
        
        <rdar://problem/5086210> - Move RetainPtr to WTF

        * wtf/RetainPtr.h: Added
        * JavaScriptCore.xcodeproj/project.pbxproj: Add it to the project file
        * JavaScriptCore.vcproj/WTF/WTF.vcproj: Ditto


aroben's avatar
aroben committed
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
2007-03-23  Christopher Brichford  <chrisb@adobe.com>

        Reviewed/landed by Adam.

        Bug 13175: Make apollo mac project files for JavaScriptCore actually
        build something
        http://bugs.webkit.org/show_bug.cgi?id=13175

        - Changing apollo mac project files for JavaScriptCore such that they actually build
        JavaScriptCore source code.

        * JavaScriptCore.apolloproj/ForwardingSources/grammar.cpp: Added.
        * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcconfig:
        * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj:

bdash's avatar
bdash committed
1584
1585
1586
1587
1588
1589
2007-03-24  Mark Rowe  <mrowe@apple.com>

        Rubber-stamped by Darin.

        * Configurations/JavaScriptCore.xcconfig: Remove unnecessary INFOPLIST_PREPROCESS.

aroben's avatar
aroben committed
1590
1591
1592
1593
2007-03-22  Christopher Brichford  <chrisb@adobe.com>

        Reviewed/landed by Adam.

aroben's avatar
aroben committed
1594
1595
1596
1597
        Bug 13164: Initial version of mac JavaScriptCore project files for
        apollo port 
        http://bugs.webkit.org/show_bug.cgi?id=13164

aroben's avatar
aroben committed
1598
1599
1600
1601
1602
1603
1604
1605
        - Adding mac project files for apollo port of JavaScriptCore. Currently project
        just builds dftables.

        * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.Debug.xcconfig: Added.
        * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.Release.xcconfig: Added.
        * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcconfig: Added.
        * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj: Added.

thatcher's avatar
thatcher committed
1606
1607
1608
1609
1610
1611
1612
1613
2007-03-21  Timothy Hatcher  <timothy@apple.com>

        Reviewed by Darin.

        <rdar://problem/5076599> JavaScriptCore has a weak export (vtable for KJS::JSCell)

        * JavaScriptCore.exp: Remove __ZTVN3KJS6JSCellE.

adele's avatar
adele committed
1614
1615
1616
1617
1618
1619
2007-03-21  Adele Peterson  <adele@apple.com>

        Reviewed by Geoff.

        * API/JSStringRef.cpp: (JSStringIsEqual): Added JSLock.

1620
1621
1622
1623
1624
1625
1626
1627
2007-03-21  Zack Rusin  <zrusin@trolltech.com>

        Fix the compile when USE(MULTIPLE_THREADS) isn't
        defined

        * kjs/JSLock.cpp:
        (KJS::JSLock::currentThreadIsHoldingLock):

mjs's avatar
mjs committed
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
2007-03-20  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Geoff and Adam.
        
        - make USE(MULTIPLE_THREADS) support more portable
        http://bugs.webkit.org/show_bug.cgi?id=13069
        
        - fixed a threadsafety bug discovered by testing this
        
        - enhanced threadsafety assertions in collector

        * API/JSCallbackObject.cpp:
        (KJS::JSCallbackObject::~JSCallbackObject): This destructor can't
        DropAllLocks around the finalize callback, because it gets called
        from garbage collection and we can't let other threads collect!

        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
        * kjs/JSLock.cpp:
        (KJS::JSLock::currentThreadIsHoldingLock): Added new function
        to allow stronger assertions than just that the lock is held
        by some thread (you can now assert that the current thread is
        holding it, given the new JSLock design).
        * kjs/JSLock.h:
        * kjs/collector.cpp: Refactored for portability plus added some
        stronger assertions.
        (KJS::Collector::allocate):
        (KJS::currentThreadStackBase):
        (KJS::Collector::registerAsMainThread):
        (KJS::onMainThread):
        (KJS::PlatformThread::PlatformThread):
        (KJS::getCurrentPlatformThread):
        (KJS::Collector::Thread::Thread):
        (KJS::destroyRegisteredThread):
        (KJS::Collector::registerThread):
        (KJS::Collector::markCurrentThreadConservatively):
        (KJS::suspendThread):
        (KJS::resumeThread):
        (KJS::getPlatformThreadRegisters):
        (KJS::otherThreadStackPointer):
        (KJS::otherThreadStackBase):
        (KJS::Collector::markOtherThreadConservatively):
        (KJS::Collector::markStackObjectsConservatively):
        (KJS::Collector::protect):
        (KJS::Collector::unprotect):
        (KJS::Collector::collectOnMainThreadOnly):
        (KJS::Collector::markMainThreadOnlyObjects):
        (KJS::Collector::collect):
        * kjs/collector.h:
        * wtf/FastMalloc.cpp:
        (WTF::fastMallocSetIsMultiThreaded):
        * wtf/FastMallocInternal.h:
        * wtf/Platform.h:

1681
1682
1683
1684
2007-03-19  Darin Adler  <darin@apple.com>

        * kjs/value.h: Roll ~JSValue change out. It was causing problems. I'll do it right later.

ggaren's avatar
ggaren committed
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
2007-03-19  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by John Sullivan.

        Fixed <rdar://problem/5073380> REGRESSION: Crash occurs at WTF::fastFree() 
        when reloading liveconnect page (applet)
        
        Best to use free when you use malloc, especially when malloc and delete
        use completely different libraries.

        * bindings/jni/jni_runtime.cpp:
        (JavaMethod::~JavaMethod):

andrew's avatar
andrew committed
1698
1699
1700
1701
1702
1703
1704
1705
2007-03-19  Andrew Wellington  <proton@wiretapped.net>

        Reviewed by Maciej.

        Really set Xcode editor to use 4 space indentation (http://webkit.org/coding/coding-style.html)

        * JavaScriptCore.xcodeproj/project.pbxproj:

darin's avatar
darin committed
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
2007-03-19  Darin Adler  <darin@apple.com>

        Reviewed by Geoff.

        - Changed list size threshold to 5 based on testing.

        I was testing the i-Bench JavaScript with the list statistics
        dumping on, and discovered that there were many 5-element lists.
        The fast case for lists was for 4 elements and fewer. By changing
        the threshold to 5 elements we get a measurable speedup. I believe
        this will help real web pages too, not just the benchmark.

        * kjs/list.cpp: Change constant from 4 to 5.

darin's avatar
darin committed
1720
1721
1722
1723
2007-03-19  Darin Adler  <darin@apple.com>

        * kjs/value.h: Oops, fix build.

darin's avatar
darin committed
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
2007-03-19  Darin Adler  <darin@apple.com>

        Reviewed by Geoff.

        - remove ~JSValue; tiny low-risk performance boost

        * kjs/value.h: Remove unneeded empty virtual destructor from JSValue.
        The only class derived from JSValue is JSCell and it already has a
        virtual destructor. Declaring an empty constructor in JSValue had one
        good effect: it marked the destructor private, making it a compile
        time error to try to destroy a JSValue; but that's not a likely
        mistake for someone to make. It had two bad effects: (1) it caused gcc,
        at least, to generate code to fix up the virtual table pointer to
        point to the JSValue version of the virtual table inside the destructor
        of all classes derived from JSValue directly or indirectly; (2) it
        caused JSValue to be a polymorphic class so required a virtual table for
        it. It's cleaner to not have either of those.

mjs's avatar
mjs committed
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
2007-03-18  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Mark.
        
        - avoid static construction (and global variable access) in a smarter, more portable way,
        to later enable MUTLI_THREAD mode to work on other platforms and compilers.
        
        * kjs/CommonIdentifiers.cpp: Added. New class to hold all the shared identifiers.
        (KJS::CommonIdentifiers::CommonIdentifiers):
        (KJS::CommonIdentifiers::shared):
        * kjs/CommonIdentifiers.h: Added.

        * kjs/ExecState.h:
        (KJS::ExecState::propertyNames): Hand the CommonIdentifiers instance here for easy access.
        (KJS::ExecState::ExecState):

        * API/JSObjectRef.cpp:
        (JSObjectMakeConstructor):
        * CMakeLists.txt:
        * JavaScriptCore.exp:
        * JavaScriptCore.pri:
        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
        * JavaScriptCore.xcodeproj/project.pbxproj:
        * JavaScriptCoreSources.bkl:
        * bindings/runtime_array.cpp:
        (RuntimeArray::getOwnPropertySlot):
        (RuntimeArray::put):
        * bindings/runtime_method.cpp:
        (RuntimeMethod::getOwnPropertySlot):
        * kjs/array_object.cpp:
        (ArrayInstance::getOwnPropertySlot):
        (ArrayInstance::put):
        (ArrayInstance::deleteProperty):
        (ArrayProtoFunc::ArrayProtoFunc):
        (ArrayProtoFunc::callAsFunction):
        (ArrayObjectImp::ArrayObjectImp):
        * kjs/bool_object.cpp:
        (BooleanPrototype::BooleanPrototype):
        (BooleanProtoFunc::BooleanProtoFunc):
        (BooleanProtoFunc::callAsFunction):
        (BooleanObjectImp::BooleanObjectImp):
        * kjs/completion.h:
        (KJS::Completion::Completion):
        * kjs/date_object.cpp:
        (KJS::DateProtoFunc::DateProtoFunc):
        (KJS::DateObjectImp::DateObjectImp):
        (KJS::DateObjectFuncImp::DateObjectFuncImp):
        * kjs/error_object.cpp:
        (ErrorPrototype::ErrorPrototype):
        (ErrorProtoFunc::ErrorProtoFunc):
        (ErrorProtoFunc::callAsFunction):
        (ErrorObjectImp::ErrorObjectImp):
        (ErrorObjectImp::construct):
        (NativeErrorPrototype::NativeErrorPrototype):
        (NativeErrorImp::NativeErrorImp):
        (NativeErrorImp::construct):
        (NativeErrorImp::callAsFunction):
        * kjs/function.cpp:
        (KJS::FunctionImp::getOwnPropertySlot):
        (KJS::FunctionImp::put):
        (KJS::FunctionImp::deleteProperty):
        (KJS::FunctionImp::getParameterName):
        (KJS::DeclaredFunctionImp::construct):
        (KJS::IndexToNameMap::unMap):
        (KJS::Arguments::Arguments):
        (KJS::ActivationImp::getOwnPropertySlot):
        (KJS::ActivationImp::deleteProperty):
        (KJS::GlobalFuncImp::GlobalFuncImp):
        * kjs/function_object.cpp:
        (FunctionPrototype::FunctionPrototype):
        (FunctionProtoFunc::FunctionProtoFunc):
        (FunctionProtoFunc::callAsFunction):
        (FunctionObjectImp::FunctionObjectImp):
        (FunctionObjectImp::construct):
        * kjs/grammar.y:
        * kjs/identifier.cpp:
        * kjs/identifier.h:
        * kjs/interpreter.cpp:
        (KJS::Interpreter::init):
        (KJS::Interpreter::initGlobalObject):
        * kjs/interpreter.h:
        * kjs/lookup.h:
        * kjs/math_object.cpp:
        (MathFuncImp::MathFuncImp):
        * kjs/nodes.cpp:
        (ArrayNode::evaluate):
        (FuncDeclNode::processFuncDecl):
        (FuncExprNode::evaluate):
        * kjs/number_object.cpp:
        (NumberPrototype::NumberPrototype):
        (NumberProtoFunc::NumberProtoFunc):
        (NumberObjectImp::NumberObjectImp):
        * kjs/object.cpp:
        (KJS::JSObject::put):
        (KJS::JSObject::defaultValue):
        (KJS::JSObject::hasInstance):
        * kjs/object.h:
        (KJS::JSObject::getOwnPropertySlot):
        * kjs/object_object.cpp:
        (ObjectPrototype::ObjectPrototype):
        (ObjectProtoFunc::ObjectProtoFunc):
        (ObjectObjectImp::ObjectObjectImp):
        * kjs/regexp_object.cpp:
        (RegExpPrototype::RegExpPrototype):
        (RegExpProtoFunc::RegExpProtoFunc):
        (RegExpObjectImp::RegExpObjectImp):
        * kjs/string_object.cpp:
        (KJS::StringInstance::getOwnPropertySlot):
        (KJS::StringInstance::put):
        (KJS::StringInstance::deleteProperty):
        (KJS::StringPrototype::StringPrototype):
        (KJS::StringProtoFunc::StringProtoFunc):
        (KJS::StringProtoFunc::callAsFunction):
        (KJS::StringObjectImp::StringObjectImp):
        (KJS::StringObjectFuncImp::StringObjectFuncImp):
        * kjs/testkjs.cpp:
        (TestFunctionImp::TestFunctionImp):

andrew's avatar
andrew committed
1860
1861
1862
1863
1864
1865
1866
1867
2007-03-18  Andrew Wellington  <proton@wiretapped.net>

        Reviewed by Mark Rowe
        
        Set Xcode editor to use 4 space indentation (http://webkit.org/coding/coding-style.html) 

        * JavaScriptCore.xcodeproj/project.pbxproj:

bdash's avatar
bdash committed
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
2007-03-19  Mark Rowe  <mrowe@apple.com>

        Rubber-stamped by Brady.

        Update references to bugzilla.opendarwin.org with bugs.webkit.org.

        * bindings/c/c_utility.cpp:
        (KJS::Bindings::convertUTF8ToUTF16):
        * kjs/function.cpp:
        (KJS::FunctionImp::callAsFunction):
        * kjs/grammar.y:
        * kjs/keywords.table:
        * kjs/lexer.cpp:
        (KJS::Lexer::shift):

ggaren's avatar
ggaren committed
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
2007-03-18  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Oliver Hunt.
        
        Exposed some extra toUInt32 functionality, as part of the fix for
        REGRESSION: Incomplete document.all implementation breaks abtelectronics.com 
        (Style Change Through JavaScript Blanks Content)

        * JavaScriptCore.exp:
        * kjs/identifier.h:
        (KJS::Identifier::toUInt32):

ggaren's avatar
ggaren committed
1895
1896
1897
1898
1899
1900
2007-03-18  Geoffrey Garen  <ggaren@apple.com>

        Removed duplicate export name.
        
        * JavaScriptCore.exp:

ggaren's avatar
ggaren committed
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
2007-03-15  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Maciej Stachowiak.
        
        Fixed <rdar://problem/5064964> Repro ASSERT failure in JS Bindings when 
        closing window @ lowtrades.bptrade.com
        
        Unfortunately, the bindings depend on UString and Identifier as string 
        representations. So, they need to acquire the JSLock when doing something
        that will ref/deref their strings.

        Layout tests, the original site, and Java, Flash, and Quicktime on the 
        web work. No leaks reported. No automated test for this because testing 
        the Java bindings, like math, is hard.
        
        * bindings/runtime.h: Made Noncopyable, just to be sure.
        
        * bindings/c/c_class.cpp: 
        (KJS::Bindings::CClass::~CClass): Acquire the JSLock and explicitly clear the keys
        in our hashtable, since they're UString::Reps, and ref/deref aren't thread-safe.
        (KJS::Bindings::CClass::methodsNamed): Also acquire the JSLock when adding
        keys to the table, since the table ref's them.
        (KJS::Bindings::CClass::fieldNamed): ditto.

        * bindings/c/c_utility.cpp: Removed dead function.
        (KJS::Bindings::convertValueToNPVariant): Acquire the JSLock because doing
        it recursively is pretty cheap, and it's just too confusing to tell whether
        all our callers do it for us.
        (KJS::Bindings::convertNPVariantToValue): ditto
        * bindings/c/c_utility.h:

        * bindings/jni/jni_class.cpp: Same deal as c_class.cpp.
        (JavaClass::JavaClass):
        (JavaClass::~JavaClass):

        * bindings/jni/jni_instance.cpp: Same deal as c_utility.cpp.
        (JavaInstance::stringValue):
        * bindings/jni/jni_jsobject.cpp:
        (JavaJSObject::convertValueToJObject):

        * bindings/jni/jni_runtime.cpp:
        (JavaMethod::~JavaMethod): Moved from header, for clarity.
        (appendClassName): Made this static, so the set of callers is known, and
        we can assert that we hold the JSLock. Also changed it to take a UString
        reference, which makes the calling code simpler.
        (JavaMethod::signature): Store the ASCII value we care about instead of
        a UString, since UString is so much more hassle. Hold the JSLock while
        building up the temporary UString.

        * bindings/jni/jni_runtime.h: Nixed dead code in JavaMethod.
        (KJS::Bindings::JavaString::JavaString): Hold a UString::Rep instead of
        a UString, so we can acquire the JSLock and explicitly release it.
        (KJS::Bindings::JavaString::_commonInit):
        (KJS::Bindings::JavaString::~JavaString):
        (KJS::Bindings::JavaString::UTF8String):
        (KJS::Bindings::JavaString::uchars):
        (KJS::Bindings::JavaString::length):
        (KJS::Bindings::JavaString::ustring):

        * bindings/jni/jni_utility.cpp:
        (KJS::Bindings::convertArrayInstanceToJavaArray): Made this static, so 
        the set of callers is known, and we can assert that we hold the JSLock. 
        (KJS::Bindings::convertValueToJValue): Acquire the JSLock because doing
        it recursively is pretty cheap, and it's just too confusing to tell whether
        all our callers do it for us.

        * bindings/objc/objc_runtime.h: Nixed some dead code.
        * bindings/objc/objc_utility.mm:
        (KJS::Bindings::convertNSStringToString): Same drill as above.

ap's avatar
ap committed
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
2007-03-18  Alexey Proskuryakov  <ap@webkit.org>

        Reviewed by Geoff.

        http://bugs.webkit.org/show_bug.cgi?id=13105
        REGRESSION: an exception raised when calculating base value of a dot expression is not returned

        Test: fast/js/dot-node-base-exception.html

        * kjs/nodes.cpp:
        (FunctionCallDotNode::evaluate): Added the necessary KJS_CHECKEXCEPTIONVALUE.

1983
1984
1985
1986
1987
1988
2007-03-18  Steve Falkenburg  <sfalken@apple.com>

        Build fix.

        * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:

thatcher's avatar
thatcher committed
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2007-03-17  Timothy Hatcher  <timothy@apple.com>

        Reviewed by Mark Rowe.

        Made Version.xcconfig smarter when building for different configurations.
        Now uses the 522+ OpenSource version for Debug and Release, while using the
        full 522.4 version for Production builds. The system prefix is also computed
        based on the current system, so 4522.4 on Tiger and 5522.4 on Leopard.

        * Configurations/JavaScriptCore.xcconfig:
        * Configurations/Version.xcconfig:

mjs's avatar
mjs committed
2001
2002
2003
2004
2005
2006
2007
2008
2007-03-15  Maciej Stachowiak  <mjs@apple.com>

        Not reviewed.
        
        - build fix

        * wtf/TCSystemAlloc.cpp:

mjs's avatar
mjs committed
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2007-03-15  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Geoff and Steve.
        
        - fix some portability issues with TCMalloc.

        * JavaScriptCore.vcproj/WTF/WTF.vcproj:
        * kjs/config.h:
        * wtf/FastMalloc.cpp:
        (WTF::SizeClass):
        (WTF::InitSizeClasses):
        (WTF::TCMalloc_PageHeap::Split):
        (WTF::TCMalloc_PageHeap::RegisterSizeClass):
        (WTF::TCMalloc_Central_FreeList::length):
        (WTF::TCMalloc_ThreadCache::InitTSD):
        (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
        * wtf/TCSpinLock.h:
        * wtf/TCSystemAlloc.cpp:
        (TryVirtualAlloc):
        (TCMalloc_SystemAlloc):

thatcher's avatar
thatcher committed
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2007-03-15  Timothy Hatcher  <timothy@apple.com>

        Reviewed by John.

        * Factored out most of our common build settings into .xcconfig files. Anything that was common in
          each build configuration was factored out into the shared .xcconfig file.
        * Adds a Version.xcconfig file to define the current framework version, to be used in other places.
        * Use the new $(BUNDLE_VERSION) (defined in Version.xcconfig) in the preprocessed Info.plist.
        * Use the versions defined in Version.xcconfig to set $(DYLIB_CURRENT_VERSION).

        * Configurations/Base.xcconfig: Added.
        * Configurations/DebugRelease.xcconfig: Added.
        * Configurations/JavaScriptCore.xcconfig: Added.
        * Configurations/Version.xcconfig: Added.
        * Info.plist:
        * JavaScriptCore.xcodeproj/project.pbxproj:

2047
2048
2049
2050
2051
2052
2007-03-16  Shrikant Gangoda  <shrikant.gangoda@celunite.com>

        Gdk build fix.

        * kjs/DateMath.cpp:  gettimeofday comes from <sys/time.h> on Linux.

kmccullo's avatar
kmccullo committed
2053
2054
2055
2056
2057
2058
2059
2060
2061
2007-03-14  Kevin McCullough  <kmccullough@apple.com>

        Reviewed by .

        - Fixed one more build breakage

        * kjs/date_object.cpp:
        (KJS::formatLocaleDate):

kmccullo's avatar
kmccullo committed
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2007-03-14  Kevin McCullough  <kmccullough@apple.com>

        Reviewed by .

        - Fixed a build breakage.

        * kjs/DateMath.cpp:
        * kjs/date_object.cpp:
        (KJS::formatLocaleDate):
        (KJS::DateObjectImp::construct):

kmccullo's avatar
kmccullo committed
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2007-03-14  Kevin McCullough  <kmccullough@apple.com>

        Reviewed by Geoff.

        - rdar://problem/5045720
        - DST changes in US affect JavaScript date calculations (12975)
        This fix was to ensure we properly test for the new changes to DST in the US.
        Also this fixes when we apply DST, now we correctly map most past years to current
        DST rules.  We still have a small issue with years before 1900 or after 2100.
        rdar://problem/5055038

        * kjs/DateMath.cpp: Fix DST to match spec better.
        (KJS::getCurrentUTCTime):
        (KJS::mimimumYearForDST):
        (KJS::maximumYearForDST):
        (KJS::equivalentYearForDST):
        (KJS::getDSTOffset):
        * kjs/DateMath.h: Consolodated common funtionality.
        * kjs/date_object.cpp: Consolodated common functionality.
        (KJS::formatLocaleDate):
        (KJS::DateObjectImp::construct):
        * tests/mozilla/ecma/jsref.js: Added functions for finding the correct days when DST starts and ends.
        * tests/mozilla/ecma/shell.js: Added back in the old DST functions for ease of merging with mozilla if needed.
        * tests/mozilla/ecma_2/jsref.js: Added functions for finding the correct days when DST starts and ends.
        * tests/mozilla/ecma_3/Date/shell.js: Added functions for finding the correct days when DST starts and ends.
        * tests/mozilla/expected.html: Updated to show all date tests passing.

thatcher's avatar
thatcher committed
2100
2101
=== Safari-5522.4 ===

kmccullo's avatar
kmccullo committed
2102
2103
2104
2105
2106
2107
2108
2109
2110
2007-03-13  Kevin McCullough  <kmccullough@apple.com>

        Reviewed by .

        - Adding expected failures until the are truly fixed. 
        - rdar://problem/5060302

        * tests/mozilla/expected.html:

kmccullo's avatar
kmccullo committed
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2007-03-12  Kevin McCullough  <kmccullough@apple.com>

        Reviewed by .

        - Actually update tests for new DST rules.

        * tests/mozilla/ecma/Date/15.9.3.1-1.js:
        * tests/mozilla/ecma/Date/15.9.3.1-2.js:
        * tests/mozilla/ecma/Date/15.9.3.1-3.js:
        * tests/mozilla/ecma/Date/15.9.3.1-4.js:
        * tests/mozilla/ecma/Date/15.9.3.1-5.js:
        * tests/mozilla/ecma/Date/15.9.3.2-1.js:
        * tests/mozilla/ecma/Date/15.9.3.2-2.js:
        * tests/mozilla/ecma/Date/15.9.3.2-3.js:
        * tests/mozilla/ecma/Date/15.9.3.2-4.js:
        * tests/mozilla/ecma/Date/15.9.3.2-5.js:
        * tests/mozilla/ecma/Date/15.9.3.8-1.js:
        * tests/mozilla/ecma/Date/15.9.3.8-2.js:
        * tests/mozilla/ecma/Date/15.9.3.8-3.js:
        * tests/mozilla/ecma/Date/15.9.3.8-4.js:
        * tests/mozilla/ecma/Date/15.9.3.8-5.js:
        * tests/mozilla/ecma/Date/15.9.5.10-1.js:
        * tests/mozilla/ecma/Date/15.9.5.10-10.js:
        * tests/mozilla/ecma/Date/15.9.5.10-11.js:
        * tests/mozilla/ecma/Date/15.9.5.10-12.js:
        * tests/mozilla/ecma/Date/15.9.5.10-13.js:
        * tests/mozilla/ecma/Date/15.9.5.10-2.js:
        * tests/mozilla/ecma/Date/15.9.5.10-3.js:
        * tests/mozilla/ecma/Date/15.9.5.10-4.js:
        * tests/mozilla/ecma/Date/15.9.5.10-5.js:
        * tests/mozilla/ecma/Date/15.9.5.10-6.js:
        * tests/mozilla/ecma/Date/15.9.5.10-7.js:
        * tests/mozilla/ecma/Date/15.9.5.10-8.js:
        * tests/mozilla/ecma/Date/15.9.5.10-9.js:
        * tests/mozilla/ecma/jsref.js:
        * tests/mozilla/ecma_2/jsref.js:
        * tests/mozilla/ecma_3/Date/shell.js:

kmccullo's avatar
kmccullo committed
2149
2150
2151
2152
2153
2154
2155
2156
2007-03-12  Kevin McCullough  <kmccullough@apple.com>

        Reviewed by .

        - Update tests for new DST rules.

        * tests/mozilla/ecma/shell.js:

ggaren's avatar
ggaren committed
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2007-03-11  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Oliver Hunt.
        
        Fixed <rdar://problem/4681051> Installer crashes in KJS::Collector::
        markOtherThreadConservatively(KJS::Collector::Thread*) trying to install 
        iLife 06 using Rosetta on an Intel Machine
        
        The problem was that our thread-specific data destructor would modify the
        list of active JavaScript threads without holding the JSLock, corrupting
        the list. Corruption was especially likely if one JavaScript thread exited 
        while another was starting up.

        * JavaScriptCore.exp:
        * kjs/JSLock.cpp: Don't conflate locking the JSLock with registering a
        thread, since the thread-specific data destructor needs to lock
        without registering a thread. Instead, treat thread registration as a
        part of the convenience of the JSLock object, and whittle down JSLock::lock()
        to just the bits that actually do the locking.
        (KJS::JSLock::lock):
        (KJS::JSLock::registerThread):
        * kjs/JSLock.h: Updated comments to mention the new behavior above, and
        other recent changes.
        (KJS::JSLock::JSLock):
        * kjs/collector.cpp:
        (KJS::destroyRegisteredThread): Lock here.
        (KJS::Collector::registerThread): To match, assert that we're locked here.

ggaren's avatar
ggaren committed
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2007-03-10  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Darin Adler.

        Fixed <rdar://problem/4587763> PAC file: lock inversion between QT and 
        JSCore causes a hang @ www.panoramas.dk
        
        With a PAC file, run-webkit-tests --threaded passes, the reported site
        works, and all the Quicktime/JavaScript and Flash/JavaScript examples
        I found through Google work, too.
        
        Any time JavaScript causes arbitrary non-JavaScript code to execute, it 
        risks deadlock, because that code may block, trying to acquire a lock 
        owned by a thread that is waiting to execute JavaScript. In this case,
        the thread was a networking thread that was waiting to interpret a PAC file.
        
        Because non-JavaScript code may execute in response to, well, anything,
        a perfect solution to this problem is impossible. I've implemented an
        optimistic solution, instead: JavaScript will drop its lock whenever it
        makes a direct call to non-JavaScript code through a bridging/plug-in API,
        but will blissfully ignore the indirect ways it may cause non-JavaScript 
        code to run (resizing a window, for example). 
        
        Unfortunately, this solution introduces significant locking overhead in 
        the bridging APIs. I don't see a way around that.

        This patch includes some distinct bug fixes I saw along the way:
        
        * bindings/objc/objc_instance.mm: Fixed a bug where a nested begin() call
        would leak its autorelease pool, because it would NULL out _pool without
        draining it.

        * bindings/runtime_object.cpp:
        (RuntimeObjectImp::methodGetter): Don't copy an Identifier to ASCII only
        to turn around and make an Identifier from the ASCII. In an earlier 
        version of this patch, the copy caused an assertion failure. Now it's 
        just unnecessary work.
        (RuntimeObjectImp::getOwnPropertySlot): ditto

        * bindings/objc/objc_instance.h: Removed overrides of setVAlueOfField and
        getValueOfField, because they did exactly what the base class versions did.
        Removed overrides of Noncopyable declarations for the same reason.

        * bindings/runtime.h: Inherit from Noncopyable instead of rolling our own.
        * bindings/c/c_instance.h: ditto

        And the actual patch:
        
        * API/JSCallbackConstructor.cpp: Drop all locks when calling out to C.
        (KJS::JSCallbackConstructor::construct):
        * API/JSCallbackFunction.cpp: ditto
        (KJS::JSCallbackFunction::callAsFunction):
        * API/JSCallbackObject.cpp: ditto
        (KJS::JSCallbackObject::init):
        (KJS::JSCallbackObject::~JSCallbackObject):
        (KJS::JSCallbackObject::getOwnPropertySlot):
        (KJS::JSCallbackObject::put):
        (KJS::JSCallbackObject::deleteProperty):
        (KJS::JSCallbackObject::construct):
        (KJS::JSCallbackObject::hasInstance):
        (KJS::JSCallbackObject::callAsFunction):
        (KJS::JSCallbackObject::getPropertyNames):
        (KJS::JSCallbackObject::toNumber):
        (KJS::JSCallbackObject::toString):
        (KJS::JSCallbackObject::staticValueGetter):
        (KJS::JSCallbackObject::callbackGetter):
        
        * bindings/c/c_instance.cpp: Drop all locks when calling out to C.
        (KJS::Bindings::CInstance::invokeMethod):
        (KJS::Bindings::CInstance::invokeDefaultMethod):
        * bindings/c/c_runtime.cpp: Drop all locks when calling out to C.
        (KJS::Bindings::CField::valueFromInstance):
        (KJS::Bindings::CField::setValueToInstance):
        * bindings/jni/jni_objc.mm:
        (KJS::Bindings::dispatchJNICall): Drop all locks when calling out to Java.

        * bindings/objc/objc_instance.mm: The changes here are to accomodate the
        fact that C++ unwinding of DropAllLocks goes crazy when you put it inside
        a @try block. I moved all JavaScript stuff outside of the @try blocks, and 
        then prefixed the whole blocks with DropAllLocks objects. This required some
        supporting changes in other functions, which now acquire the JSLock for
        themselves, intead of relying on their callers to do so.
        (ObjcInstance::end):
        (ObjcInstance::invokeMethod):
        (ObjcInstance::invokeDefaultMethod):
        (ObjcInstance::setValueOfUndefinedField):
        (ObjcInstance::getValueOfUndefinedField):
        * bindings/objc/objc_runtime.mm: Same as above, except I didn't want to
        change throwError to acquire the JSLock for itself.
        (ObjcField::valueFromInstance):
        (ObjcField::setValueToInstance):
        * bindings/objc/objc_utility.mm: Supporting changes mentioned above.
        (KJS::Bindings::convertValueToObjcValue):
        (KJS::Bindings::convertObjcValueToValue):

        * kjs/JSLock.cpp: 
        (1) Fixed DropAllLocks to behave as advertised, and drop the JSLock only 
        if the current thread actually acquired it in the first place. This is 
        important because WebKit needs to ensure that the JSLock has been 
        dropped before it makes a plug-in call, even though it doesn't know if 
        the current thread actually acquired the JSLock. (We don't want WebKit
        to accidentally drop a lock belonging to *another thread*.)
        (2) Used the new per-thread code written for (1) to make recursive calls
        to JSLock very cheap. JSLock now knows to call pthread_mutext_lock/ 
        pthread_mutext_unlock only at nesting level 0.
        (KJS::createDidLockJSMutex):
        (KJS::JSLock::lock):
        (KJS::JSLock::unlock):
        (KJS::DropAllLocks::DropAllLocks):
        (KJS::DropAllLocks::~DropAllLocks):
        (KJS::JSLock::lockCount):
        * kjs/JSLock.h: Don't duplicate Noncopyable.
        (KJS::JSLock::~JSLock):

        * wtf/Assertions.h: Blind attempt at helping the Windows build.

2301
2302
2303
2304
2305
2306
2307
2308
2309
2007-03-08  MorganL  <morganl.webkit@yahoo.com>

        Reviewed by Darin.

        http://bugs.webkit.org/show_bug.cgi?id=13018
        Bug 13018: allow embedders to override the definition of CRASH.

        * wtf/Assertions.h: make it possible to override CRASH.

bdash's avatar
bdash committed
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2007-03-07  Anrong Hu  <huanr@yahoo.com>

        Reviewed by Maciej.

        Fix http://bugs.webkit.org/show_bug.cgi?id=12535
        Bug 12535: Stack-optimizing compilers can trick GC into freeing in-use objects

        * kjs/internal.cpp:
        (KJS::StringImp::toObject): Copy val onto the stack so it is not subject to garbage collection.

2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2007-03-07  Geoffrey Garen  <ggaren@apple.com>

        Build fix for non-multiple-thread folks.
        
        Use a shared global in the non-multiple-thread case.

        * wtf/FastMalloc.cpp:
        (WTF::isForbidden):
        (WTF::fastMallocForbid):
        (WTF::fastMallocAllow):

ggaren's avatar
ggaren committed
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2007-03-07  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Darin Adler.
        
        Fixed ASSERT failure I just introduced.
        
        Made the fastMalloc isForbidden flag per thread. (Oops!) We expect that
        other threads will malloc while we're marking -- we just want to prevent
        our own marking from malloc'ing.

        * wtf/FastMalloc.cpp:
        (WTF::initializeIsForbiddenKey):
        (WTF::isForbidden):
        (WTF::fastMallocForbid):
        (WTF::fastMallocAllow):
        (WTF::fastMalloc):
        (WTF::fastCalloc):
        (WTF::fastFree):
        (WTF::fastRealloc):
        (WTF::do_malloc):

2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2007-03-07  Shrikant Gangoda  <shrikant.gangoda@celunite.com>

        Reviewed by Maciej.

        http://bugs.webkit.org/show_bug.cgi?id=12997

        Wrap pthread-specific assertion in #if USE(MULTIPLE_THREADS).

        * kjs/collector.cpp:
        (KJS::Collector::markMainThreadOnlyObjects):

ggaren's avatar
ggaren committed
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2007-03-06  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Maciej Stachowiak.
        
        Fixed <rdar://problem/4576242> | http://bugs.webkit.org/show_bug.cgi?id=12586
        PAC file: malloc deadlock sometimes causes a hang @ www.apple.com/pro/profiles/ (12586)
        
        This is a modified version of r14752 on the branch.
        
        These changes just add debugging functionality. They ASSERT that we don't 
        malloc during the mark phase of a garbage collection, which can cause a
        deadlock.

        * kjs/collector.cpp:
        (KJS::Collector::collect):
        * wtf/FastMalloc.cpp:
        (WTF::fastMallocForbid):
        (WTF::fastMallocAllow):
        (WTF::fastMalloc):
        (WTF::fastCalloc):
        (WTF::fastFree):
        (WTF::fastRealloc):
        (WTF::do_malloc):
        * wtf/FastMalloc.h:

ggaren's avatar
ggaren committed
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2007-03-06  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Maciej Stachowiak.
        
        Fixed all known crashers exposed by run-webkit-tests --threaded. This covers:

        <rdar://problem/4565394> | http://bugs.webkit.org/show_bug.cgi?id=12585 
            PAC file: after closing a window that contains macworld.com, new window 
            crashes (KJS::PropertyMap::mark()) (12585)
        <rdar://problem/4571215> | http://bugs.webkit.org/show_bug.cgi?id=9211
            PAC file: Crash occurs when clicking on the navigation tabs at http://www.businessweek.com/ (9211)
        <rdar://problem/4557926> 
            PAC file: Crash occurs when attempting to view image in slideshow mode 
            at http://d.smugmug.com/gallery/581716 ( KJS::IfNode::execute (KJS::
            ExecState*) + 312) if you use a PAC file

        (1) Added some missing JSLocks, along with related ASSERTs.
        
        (2) Fully implemented support for objects that can only be garbage collected
        on the main thread. So far, only WebCore uses this. We can add it to API
        later if we learn that it's needed. 
        
        The implementation uses a "main thread only" flag inside each object. When 
        collecting on a secondary thread, the Collector does an extra pass through 
        the heap to mark all flagged objects before sweeping. This solution makes
        the common case -- flag lots of objects, but never collect on a secondary 
        thread -- very fast, even though the uncommon case of garbage collecting
        on a secondary thread isn't as fast as it could be. I left some notes 
        about how to speed it up, if we ever care.
        
        For posterity, here are some things I learned about GC while investigating:
        
        * Each collect must either mark or delete every heap object. "Zombie" 
        objects, which are neither marked nor deleted, raise these issues:

            * On the next pass, the conservative marking algorithm might mark a 
            zombie, causing it to mark freed objects.

            * The client might try to use a zombie, which would seem live because 
            its finalizer had not yet run.

        * A collect on the main thread is free to delete any object. Presumably, 
        objects allocated on secondary threads have thread-safe finalizers.

        * A collect on a secondary thread must not delete thread-unsafe objects.

        * The mark function must be thread-safe.
        
        Line by line comments:

        * API/JSObjectRef.h: Added comment specifying that the finalize callback 
        may run on any thread.

        * JavaScriptCore.exp: Nothing to see here.

        * bindings/npruntime.cpp:
        (_NPN_GetStringIdentifier): Added JSLock.

        * bindings/objc/objc_instance.h:
        * bindings/objc/objc_instance.mm:
        (ObjcInstance::~ObjcInstance): Use an autorelease pool. The other callers 
        to CFRelease needed one, too, but they were dead code, so I removed them 
        instead. (This fixes a leak seen while running run-webkit-tests --threaded,
        although I don't think it's specifically a threading issue.) 
        
        * kjs/collector.cpp:
        (KJS::Collector::collectOnMainThreadOnly): New function. Tells the collector
        to collect a value only if it's collecting on the main thread.
        (KJS::Collector::markMainThreadOnlyObjects): New function. Scans the heap
        for "main thread only" objects and marks them.

        * kjs/date_object.cpp: 
        (KJS::DateObjectImp::DateObjectImp): To make the new ASSERTs happy, allocate 
        our globals on the heap, avoiding a seemingly unsafe destructor call at 
        program exit time.
        * kjs/function_object.cpp:
        (FunctionPrototype::FunctionPrototype): ditto

        * kjs/interpreter.cpp:
        (KJS::Interpreter::mark): Removed boolean parameter, which was an incomplete
        and arguably hackish way to implement markMainThreadOnlyObjects() inside WebCore.
        * kjs/interpreter.h:

        * kjs/identifier.cpp:
        (KJS::identifierTable): Added some ASSERTs to check for thread safety 
        problems.

        * kjs/list.cpp: Added some ASSERTs to check for thread safety problems.
        (KJS::allocateListImp):
        (KJS::List::release):
        (KJS::List::append):
        (KJS::List::empty): Make the new ASSERTs happy.

        * kjs/object.h:
        (KJS::JSObject::JSObject): "m_destructorIsThreadSafe" => "m_collectOnMainThreadOnly".
        I removed the constructor parameter because m_collectOnMainThreadOnly,
        like m_marked, is a Collector bit, so only the Collector should set or get it.

        * kjs/object_object.cpp:
        (ObjectPrototype::ObjectPrototype): Make the ASSERTs happy.
        * kjs/regexp_object.cpp:
        (RegExpPrototype::RegExpPrototype): ditto

        * kjs/ustring.cpp: Added some ASSERTs to check for thread safety problems.
        (KJS::UCharReference::ref): 
        (KJS::UString::Rep::createCopying):
        (KJS::UString::Rep::create):
        (KJS::UString::Rep::destroy):
        (KJS::UString::null): Make the new ASSERTs happy.
        * kjs/ustring.h:
        (KJS::UString::Rep::ref): Added some ASSERTs to check for thread safety problems.
        (KJS::UString::Rep::deref):

        * kjs/value.h:
        (KJS::JSCell::JSCell):

ggaren's avatar
ggaren committed
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2007-03-06  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Maciej Stachowiak.
        
        2% speedup on super accurate JS iBench.

        (KJS::Collector::collect): Removed anti-optimization to call
        pthread_is_threaded_np() before calling pthread_main_np(). Almost all 
        apps have more than one thread, so the extra call is actually worse.
        Interestingly, even the single-threaded testkjs shows a speed gain
        from removing the pthread_is_threaded_np() short-circuit. Not sure why.

ddkilzer's avatar
ddkilzer committed
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2007-03-04  Don Gibson  <dgibson77@gmail.com>

        Reviewed by Nikolas Zimmermann.

        - fix http://bugs.webkit.org/show_bug.cgi?id=12950
          Assertions.cpp should not #define macros that are already defined

        * wtf/Assertions.cpp: Don't #define WINVER and _WIN32_WINNT if they
        are already defined.

2526
2527
2528
2529
2530
2531
2532
2533
2534
2007-03-02  Steve Falkenburg  <sfalken@apple.com>

        Reviewed by Anders.
        
        Add unsigned int hash traits (matches existing unsigned long version)

        * wtf/HashTraits.h:
        (WTF::):

aroben's avatar
aroben committed
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2007-03-02  Adam Roben  <aroben@apple.com>

        Reviewed by Kevin M.

        Try to fix the Qt build.

        * kjs/DateMath.cpp:
        (KJS::msToGregorianDateTime): Removed unnecessary "struct" keyword.
        * kjs/DateMath.h: Moved forward declarations to the top of the file
        before they are used.
        * kjs/date_object.cpp:
        (KJS::formatLocaleDate): Changed to take a const GregorianDateTime&
        since GregorianDateTime is Noncopyable.

darin's avatar
darin committed
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2007-03-02  Darin Adler  <darin@apple.com>

        Reviewed by Kevin McCullough.

        - fix http://bugs.webkit.org/show_bug.cgi?id=12867
          REGRESSION: BenchJS test 7 (dates) is 220% slower than in Safari 2.0.4

        * kjs/DateMath.h: Marked GregorianDateTime as noncopyable, since it has a non-trivial
        destructor and not the correspoding copy constructor or assignment operator.
        Changed the GregorianDateTime constructor to use member initialization syntax.
        Fixed the destructor to use the array delete operator, since timeZone is an array.

        * kjs/DateMath.cpp:
        (KJS::daysInYear): Changed to call isLeapYear so the rule is not repeated twice.
        (KJS::getUTCOffset): Added caching on PLATFORM(DARWIN), since we can rely on the
        notify_check function and "com.apple.system.timezone" to let us know when the
        offset has changed.

ggaren's avatar
ggaren committed
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2007-02-27  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Darin Adler.
        
        Follow-up to fixing http://bugs.webkit.org/show_bug.cgi?id=12659 | <rdar://problem/4954306>
        JS objects not collected after closing window @ ebay.com/maps.google.com
        
        Changed Interpreter cache of global constructors and prototypes from
        ProtectedPtrs to bare, marked pointers. ProtectedPtrs are inefficient,
        and they increase the risk of reference cycles. Also, Darin said something
        about ProtectedPtrs giving him warts.
        
        Also changed data members to precise types from generic JSObject*'s.
        
        Layout tests and JS tests pass.

        * kjs/SavedBuiltins.h:
        * kjs/interpreter.cpp:
        (KJS::Interpreter::init):
        (KJS::Interpreter::~Interpreter):
        (KJS::Interpreter::initGlobalObject): Moved Identifier::init() call to
        constructor, for clarity.
        (KJS::Interpreter::mark):
        * kjs/interpreter.h:

ggaren's avatar
ggaren committed
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2007-02-27  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Maciej Stachowiak.
        
        Fixed http://bugs.webkit.org/show_bug.cgi?id=12659 | <rdar://problem/4954306>
        JS objects not collected after closing window @ ebay.com/maps.google.com

        Don't GC in the Interpreter destructor. For that to work, the Interpreter
        would have to NULL out all of its ProtectedPtrs before calling collect(). But 
        we've decided that we don't want things to work that way, anyway. We want the
        client to be in charge of manual GC so that it can optimize cases when
        it will be destroying many interpreters at once
        (e.g., http://bugs.webkit.org/show_bug.cgi?id=12900).
        
        Also removed Interpreter::collect() because it was redundant with 
        Collector::collect().

        * JavaScriptCore.exp:
        * kjs/interpreter.cpp:
        (KJS::Interpreter::~Interpreter):
        * kjs/testkjs.cpp:
        (TestFunctionImp::callAsFunction):

kjk's avatar
kjk committed
2615
2616
2617
2618
2619
2620
2621
2622
2007-02-26  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>

        Reviewed by Adam Roben.

        Rename *_SUPPORT defines to ENABLE_*.

        * jscore.bkl:

mjs's avatar
mjs committed
2623
2624
2625
2626
2627
2628
2629
2630
2631
2007-02-26  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Lars.
        
        - <rdar://problem/5021698> Disable experimental SVG features (12883)

        * wtf/Platform.h: Add ENABLE() macro similar to HAVE() and USE(), to
        allow nicer handling of optional WebKit features.

staikos's avatar
staikos committed
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2007-02-22  George Staikos  <staikos@kde.org>

        Reviewed by Lars.

        Add return values

        * wtf/unicode/qt4/UnicodeQt4.h:
        (WTF::Unicode::toLower):
        (WTF::Unicode::toUpper):

weinig's avatar
weinig committed
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2007-02-22  Oscar Cwajbaum  <public@oscarc.net>

        Reviewed by Maciej.

        Fix ARM-specific alignment problem in FastMalloc
        http://bugs.webkit.org/show_bug.cgi?id=12841

        * wtf/FastMalloc.cpp:
        Modify how pageheap_memory is declared to ensure proper alignment
        on architectures such as ARM

2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2007-02-20  Zack Rusin  <zrusin@trolltech.com>

        Reviewed by Lars

        Make sure that non-void methods always return something.

        * wtf/unicode/qt4/UnicodeQt4.h:
        (WTF::Unicode::toLower):
        (WTF::Unicode::toUpper):
        (WTF::Unicode::foldCase):

2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2007-02-18  Kevin Ollivier  <kevino@theolliviers.com>

        Reviewed by Adam Roben.

        Fix cases where MSVC-specific code was identified as Win32 platform
        code. (as it should be compiled for e.g. wx port when using MSVC too)
        
        * wtf/Assertions.h: 
        * wtf/MathExtras.h:
        * wtf/StringExtras.h:
        changed PLATFORM(WIN) sections to COMPILER(MSVC) as necessary

kjk's avatar
kjk committed
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2007-02-17  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>

        Reviewed by Adam Roben.

        Fix crashes on ARM due to different struct packing. Based on a patch
        by Mike Emmel.
        * kjs/ustring.cpp: compile-time assert to make sure sizeof(UChar) == 2
        * kjs/ustring.h: pack UChar struct to ensure that sizeof(UChar) == 2
        * wtf/Assertions.h: add COMPILE_ASSERT macro for compile-time assertions

staikos's avatar
staikos committed
2686
2687
2688
2689
2690
2691
2692
2693
2694
2007-02-16  George Staikos  <staikos@kde.org>

        Reviewed by Maciej.

        Fix uninitialized variable

        * bindings/testbindings.cpp:
        (myAllocate):

andersca's avatar
andersca committed
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2007-02-16  Anders Carlsson  <acarlsson@apple.com>

        Reviewed by Mitz.

        http://bugs.webkit.org/show_bug.cgi?id=12788
        REGRESSION: Going back one page in history has a noticeable delay
        
        Um...if all elements in two vectors are equal, then I guess we could say that
        the two vectors are equal too.
        
        * wtf/Vector.h:
        (WTF::):

andersca's avatar
andersca committed
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2007-02-14  Anders Carlsson  <acarlsson@apple.com>

        Reviewed by Darin.

        Add new canCompareWithMemcmp vector trait and use it to determine whether
        operator== can use memcmp.
        
        * wtf/Vector.h:
        (WTF::):
        (WTF::VectorTypeOperations::compare):
        (WTF::operator==):
        * wtf/VectorTraits.h:
        (WTF::):

beidson's avatar
beidson committed
2722
2723
2724
2725
2726
2727
2728
2729
2730
2007-02-13  Brady Eidson  <beidson@apple.com>

        Reviewed by Darin
        
        Tweaked vector a bit

        * wtf/Vector.h:
        (WTF::operator==):

darin's avatar
darin committed
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2007-02-13  Dex Deacon  <occupant4@gmail.com>

        Reviewed by Darin.

        - fix for http://bugs.webkit.org/show_bug.cgi?id=12750
          Vector operator== was not defined correctly. It returned void,
          did not accept const Vectors, and used an int instead of size_t. 

        * wtf/Vector.h: fixed comparison operators
        (WTF::operator==):
        (WTF::operator!=):

ddkilzer's avatar
ddkilzer committed
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2007-02-10  David Carson  <dacarson@gmail.com>

        Reviewed by Maciej.

        - fix for http://bugs.webkit.org/show_bug.cgi?id=12636
        Corrected the generation of method signatures when the parameter
        is an Array. 
        Added support for converting a Javascript array to a Java array.

        * bindings/jni/jni_utility.h: added new type for array, array_type
        * bindings/jni/jni_runtime.cpp: add support for new array type
        (JavaField::valueFromInstance):
        (JavaField::setValueToInstance):
        (JavaMethod::JavaMethod):
        (JavaMethod::signature):
        * bindings/jni/jni_utility.cpp: add support for new array type
        (KJS::Bindings::callJNIMethod):
        (KJS::Bindings::callJNIStaticMethod):
        (KJS::Bindings::callJNIMethodIDA):
        (KJS::Bindings::JNITypeFromClassName):
        (KJS::Bindings::signatureFromPrimitiveType):
        (KJS::Bindings::JNITypeFromPrimitiveType):
        (KJS::Bindings::getJNIField):
        (KJS::Bindings::convertArrayInstanceToJavaArray): new method
        converts the Javascript array to the requested Java array.
        (KJS::Bindings::convertValueToJValue):

andersca's avatar
andersca committed
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2007-02-08  Anders Carlsson  <acarlsson@apple.com>

        Reviewed by Geoff.

        <rdar://problem/4930614>
        Safari complains about "Slow Script" if GMail is left open and machine is busy
        
        <rdar://problem/4649516>
        Turn off slow script dialog or crank up time that makes it come up
        
        <rdar://problem/4963589>
        Slow script warning is displayed after closing of PROMPT or PRINT dialog
        
        Re-do the way script timeouts are handled. No longer use a unix timer that sends signals. Instead, add a 
        tick count and increment it in loop bodies. If the tick count reaches a threshold, do a timeout check. If the total time executing
        is higher than the timeout value, (possibly) interrupt the script. The timeout checker also adjusts the threshold dynamically
        to prevent doing the timeout check too often.
         
        * JavaScriptCore.exp:
        Remove pause and resume calls.
        
        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
        Add winmm.lib.

        * kjs/interpreter.cpp:
        (KJS::Interpreter::init):
        (KJS::Interpreter::~Interpreter):
        (KJS::Interpreter::startTimeoutCheck):
        (KJS::Interpreter::stopTimeoutCheck):
        (KJS::Interpreter::resetTimeoutCheck):
        (KJS::getCurrentTime):
        (KJS::Interpreter::checkTimeout):
        * kjs/interpreter.h:
        (KJS::Interpreter::timedOut):
        * kjs/nodes.cpp:
        (DoWhileNode::execute):
        (WhileNode::execute):
        (ForNode::execute):

2809
2810
2811
2812
2007-02-07  Darin Adler  <darin@apple.com>

        * JavaScriptCore.vcproj/JavaScriptCore.sln: Reenable testkjs.

darin's avatar
darin committed
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2007-02-07  Darin Adler  <darin@apple.com>

        Reviewed by Geoff.

        - another build fix; this time for sure

        * pcre/pcre_exec.c: (match):
        The compiler caught an incorrect use of the othercase variable across
        a call to RMATCH in character repeat processing. Local variables can
        change in the crazy NO_RECURSE mode that we use, so we instead need
        the value in othercase to be in one of the special stack frame variables.
        Added a new stack frame variable for this purpose named repeat_othercase.
        Also noted a similar error in the non-UTF-16 side of the #ifdef, but
        didn't try to fix that one. Also removed a SUPPORT_UCP #ifdef from the
        PCRE_UTF16 side; that code doesn't work without the Unicde properties
        table, and we don't try to use it that way.

2830
2831
2832
2833
2834
2835
2007-02-06  Steve Falkenburg  <sfalken@apple.com>

        Disable testkjs in sln until we figure out mysterious compiler warning.

        * JavaScriptCore.vcproj/JavaScriptCore.sln:

2836
2837
2838
2839
2840
2841
2842
2007-02-06  Steve Falkenburg  <sfalken@apple.com>

        Build fix by ggaren

        * pcre/pcre_exec.c:
        (match):

darin's avatar
darin committed
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2007-02-06  Darin Adler  <darin@apple.com>

        Reviewed by Geoff.

        - fix <rdar://problem/4979089> PCRE should avoid setjmp/longjmp even when compiler
          is not GCC

        Added a new code path that's slower and way uglier but doesn't rely on GCC's
        computed gotos.

        * pcre/pcre_exec.c: Added a numeric parameter to the RMATCH function. It must be
        different at every RMATCH call site. Changed the non-GCC NO_RECURSE version of
        the macro to use a label incorporating the number. Changed the RRETURN macro to
        use a goto instead of longjmp.
        (match): Added a different number at each callsite, using a perl script for the
        first-time task. Going forward it should be easy to maintain by hand. Added a
        switch statement at the bottom of the function. We'll get compile time errors
        if we have anything in the switch statement that's never used in an RMATCH,
        but errors in the other direction are silent except at runtime.

darin's avatar
darin committed
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890