1
2007-08-15 Peter Kasting <zerodpx@gmail.org>
5
http://bugs.webkit.org/show_bug.cgi?id=14967 part 1 - Eliminate most implicit
6
conversions of wtf::Vector<T> to T* by explicitly calling .data()
8
* API/JSCallbackConstructor.cpp:
9
(KJS::JSCallbackConstructor::construct):
10
* API/JSCallbackFunction.cpp:
11
(KJS::JSCallbackFunction::callAsFunction):
12
* API/JSCallbackObject.cpp:
13
(KJS::JSCallbackObject::construct):
14
(KJS::JSCallbackObject::callAsFunction):
15
* bindings/c/c_instance.cpp:
16
(KJS::Bindings::CInstance::invokeMethod):
17
(KJS::Bindings::CInstance::invokeDefaultMethod):
18
* kjs/number_object.cpp:
22
(KJS::UString::UTF8String):
24
2007-08-14 Darin Adler <darin@apple.com>
28
- fix <rdar://problem/5410570> Global initializer introduced by use of std::numeric_limits in r24919
31
(KJS::overflowIndicator): Turned into a function.
32
(KJS::maxUChars): Ditto.
33
(KJS::allocChars): Use the functions.
34
(KJS::reallocChars): Ditto.
35
(KJS::UString::expandedSize): Ditto.
37
2007-08-12 Darin Adler <darin@apple.com>
41
- fix http://bugs.webkit.org/show_bug.cgi?id=14931
42
<rdar://problem/5403816> JavaScript regular expression non-participating capturing parentheses
43
fail in 3 different ways
45
Test: fast/js/regexp-non-capturing-groups.html
47
* kjs/string_object.cpp:
48
(KJS::replace): Add missing code to handle undefined backreferences; before we'd get the empty string
49
instead of a JavaScript "undefined" value.
50
(KJS::StringProtoFunc::callAsFunction): Implemented backreference support for split.
51
* pcre/pcre_exec.c: (match): Made backreferences to undefined groups match the empty string instead
52
of always failing. Only in JAVASCRIPT mode.
54
* tests/mozilla/expected.html: Add a new expected test success, since this fixed one test result.
56
2007-08-10 Timothy Hatcher <timothy@apple.com>
60
<rdar://problem/5394449> Stop using some Carbon UI APIs for 64 bit
62
Disable the NPAPI for 64-bit on Mac OS X.
64
* Configurations/JavaScriptCore.xcconfig: Use the 64-bit export file.
65
* JavaScriptCore.xcodeproj/project.pbxproj: Create a 64-bit export file
66
that filters out the NPN fnctions.
67
* bindings/NP_jsobject.cpp: #ifdef out this for 64-bit on Mac OS X
68
* bindings/NP_jsobject.h: Ditto.
69
* bindings/c/c_class.cpp: Ditto.
70
* bindings/c/c_class.h: Ditto.
71
* bindings/c/c_instance.cpp: Ditto.
72
* bindings/c/c_instance.h: Ditto.
73
* bindings/c/c_runtime.cpp: Ditto.
74
* bindings/c/c_runtime.h: Ditto.
75
* bindings/c/c_utility.cpp: Ditto.
76
* bindings/c/c_utility.h: Ditto.
77
* bindings/npapi.h: Ditto.
78
* bindings/npruntime.cpp: Ditto.
79
* bindings/npruntime.h: Ditto.
80
* bindings/npruntime_impl.h: Ditto.
81
* bindings/npruntime_priv.h: Ditto.
82
* bindings/runtime.cpp:
83
(KJS::Bindings::Instance::createBindingForLanguageInstance):
84
don't creat an NPObject on Mac OS X in 64-bit.
86
2007-08-09 Mark Rowe <mrowe@apple.com>
90
<rdar://problem/5400709> Versioning in debug and release builds should include minor and tiny version before +
92
* Configurations/Version.xcconfig:
93
* JavaScriptCore.xcodeproj/project.pbxproj: Add a shell script phase to make to dependency between
94
Version.xcconfig and Info.plist explicit to Xcode.
96
2007-08-08 George Staikos <staikos@kde.org>
98
Make it compile with Qt again.
100
* wtf/unicode/qt4/UnicodeQt4.h:
101
(WTF::Unicode::toUpper):
103
2007-08-07 Sam Weinig <sam@webkit.org>
107
Fix for http://bugs.webkit.org/show_bug.cgi?id=14897
108
Decompilation of double negation fails and produces invalid or incorrect code
110
Test: fast/js/function-decompilation-operators.html
112
* kjs/nodes2string.cpp:
113
(UnaryPlusNode::streamTo): Put space after unary operator. Matches Firefox.
114
(NegateNode::streamTo): Diito.
115
(MultNode::streamTo): Put spaces around binary operator. Matches Firefox.
116
(AddNode::streamTo): Ditto.
118
2007-08-07 Darin Adler <darin@apple.com>
122
- fix <rdar://problem/5383104> REGRESSION: XHR.responseText is null instead of empty string
123
in http/tests/xmlhttprequest/zero-length-response.html
125
The new code to handle out of memory conditions was turning a "" into a null string.
127
* kjs/ustring.h: Removed UCharReference, which has long been obsolete and unused.
128
Removed copyForWriting, which was only used for the upper/lowercasing code and for
131
(KJS::allocChars): Removed special case that made this fail (return 0) when passed 0.
132
Instead assert that we're not passed 0. Also added an overflow check for two reasons:
133
1) for sizes that aren't checked this prevents us from allocating a buffer that's too
134
small, and 2) for sizes where we overflowed in the expandedSize function and returned
135
overflowIndicator, it guarantees we fail.
136
(KJS::reallocChars): Ditto.
137
(KJS::UString::expandedSize): Return a large number, overflowIndicator, rather than 0
138
for cases where we overflow.
139
(KJS::UString::spliceSubstringsWithSeparators): Added a special case for empty string so
140
we don't call allocChars with a length of 0.
141
(KJS::UString::operator=): Added special characters for both 0 and empty string so we
142
match the behavior of the constructor. This avoids calling allocChars with a length of 0
143
and making a null string rather than an empty string in that case, and also matches the
144
pattern used in the rest of the functions.
145
(KJS::UString::operator[]): Made the return value const so code that tries to use the
146
operator to modify the string will fail.
148
* kjs/string_object.cpp: (KJS::StringProtoFunc::callAsFunction): Rewrote uppercasing and
149
lowercasing functions so they don't need copyForWriting any more -- it wasn't really doing
150
any good for optimization purposes. Instead use a Vector and releaseBuffer.
152
* wtf/unicode/icu/UnicodeIcu.h: Eliminate one of the versions of toLower/toUpper -- we now
153
only need the version where both a source and destination buffer is passed in, not the one
155
* wtf/unicode/qt4/UnicodeQt4.h: Ditto.
157
2007-08-06 Sam Weinig <sam@webkit.org>
161
Fix for http://bugs.webkit.org/show_bug.cgi?id=14891
162
Decompilation of try block immediately following "else" fails
164
Test: fast/js/toString-try-else.html
166
* kjs/nodes2string.cpp:
167
(TryNode::streamTo): Add newline before "try".
169
2007-08-07 Mark Rowe <mrowe@apple.com>
173
<rdar://problem/5388774> REGRESSION: Hang occurs after clicking "Attach a file " link in a new .Mac message
175
Attempting to acquire the JSLock inside CollectorHeap::forceLock can lead to a deadlock if the thread currently
176
holding the lock is waiting on the thread that is forking. It is not considered safe to use system frameworks
177
after a fork without first execing[*] so it is not particularly important to ensure that the collector and
178
fastMalloc allocators are unlocked in the child process. If the child process wishes to use JavaScriptCore it
179
should exec after forking like it would to use any other system framework.
180
[*]: <http://lists.apple.com/archives/Cocoa-dev/2005/Jan/msg00676.html>
182
* kjs/CollectorHeapIntrospector.cpp: Remove forceLock and forceUnlock implementations.
183
* kjs/CollectorHeapIntrospector.h: Stub out forceLock and forceUnlock methods.
184
* wtf/FastMalloc.cpp: Ditto.
186
2007-08-06 Darin Adler <darin@apple.com>
188
Rubber stamped by Geoff.
190
* kjs/ustring.h: Added an assertion which would have helped us find the
191
previous bug more easily.
193
2007-08-06 Darin Adler <darin@apple.com>
197
- fix <rdar://problem/5387589> 9A514: Quartz Composer crash on launch in KJS::jsString
200
(JSEvaluateScript): Turn NULL for sourceURL into UString::null(), just as JSObjectMakeFunction already does.
201
(JSCheckScriptSyntax): Ditto.
203
2007-08-06 Matt Lilek <pewtermoose@gmail.com>
205
Not reviewed, build fix.
207
* kjs/string_object.cpp:
208
(KJS::StringProtoFunc::callAsFunction):
210
2007-08-04 Darin Adler <darin@apple.com>
214
- fix <rdar://problem/5371862> crash in Dashcode due to Quartz Composer JavaScript garbage collector reentrancy
216
* API/JSBase.cpp: (JSGarbageCollect): Don't call collector() if isBusy() returns true.
218
* kjs/collector.h: Added isBusy(), removed the unused return value from collect()
219
* kjs/collector.cpp: Added an "operation in progress" flag to the allocator.
220
(KJS::Collector::allocate): Call abort() if an operation is already in progress. Set the new flag instead
221
of using the debug-only GCLock.
222
(KJS::Collector::collect): Ditto.
223
(KJS::Collector::isBusy): Added.
225
2007-08-04 Maciej Stachowiak <mjs@apple.com>
227
Reviewed by Darin and Adam.
229
<rdar://problem/5368990> REGRESSION: newsgator.com sign-on 6x slower than Safari 3 beta due to GC changes (14808)
231
* kjs/string_object.cpp:
232
(KJS::replace): if the string didn't change (very common in some cases) reuse the original string value.
233
(KJS::StringProtoFunc::callAsFunction): Pass in the StringImp* when replacing, not just the UString.
234
* kjs/string_object.h:
235
(KJS::StringInstance::internalValue): covariant override to return StringImp for convenience
237
2007-08-04 Mark Rowe <mrowe@apple.com>
239
Reviewed by Oliver Hunt.
241
<rdar://problem/5385145> r24843 introduces a crash on calling fork() (14878)
242
http://bugs.webkit.org/show_bug.cgi?id=14878
244
Provide no-op functions for all members of the malloc_zone_t and malloc_introspection_t structures that we
245
register to avoid crashes in system code that assumes they will be non-null.
247
* kjs/CollectorHeapIntrospector.cpp:
248
(KJS::CollectorHeapIntrospector::CollectorHeapIntrospector):
249
(KJS::CollectorHeapIntrospector::forceLock): Grab the lock.
250
(KJS::CollectorHeapIntrospector::forceUnlock): Release the lock.
251
* kjs/CollectorHeapIntrospector.h:
252
(KJS::CollectorHeapIntrospector::goodSize):
253
(KJS::CollectorHeapIntrospector::check):
254
(KJS::CollectorHeapIntrospector::print):
255
(KJS::CollectorHeapIntrospector::log):
256
(KJS::CollectorHeapIntrospector::statistics):
257
(KJS::CollectorHeapIntrospector::size):
258
(KJS::CollectorHeapIntrospector::zoneMalloc):
259
(KJS::CollectorHeapIntrospector::zoneCalloc):
260
(KJS::CollectorHeapIntrospector::zoneFree):
261
* wtf/FastMalloc.cpp:
262
(WTF::FastMallocZone::goodSize):
263
(WTF::FastMallocZone::check):
264
(WTF::FastMallocZone::print):
265
(WTF::FastMallocZone::log):
266
(WTF::FastMallocZone::forceLock): Grab the TCMalloc locks.
267
(WTF::FastMallocZone::forceUnlock): Release the TCMalloc locks.
268
(WTF::FastMallocZone::FastMallocZone):
270
2007-08-04 Mark Rowe <mrowe@apple.com>
272
Rubber-stamped by Anders.
274
* pcre/pcre_compile.c: Remove non-ASCII character from a comment.
276
2007-08-02 Mark Rowe <mrowe@apple.com>
278
Reviewed by Geoff Garen.
280
<rdar://problem/4212199> 'leaks' reports false leaks in WebKit (because the WTF allocator uses mmap?)
282
Implement malloc zone introspection routines to allow leaks, heap, and friends to request information
283
about specific memory regions that were allocated by FastMalloc or the JavaScriptCore collector.
285
This requires tool-side support before the regions will be displayed. The addition of that support is
286
tracked by <rdar://problems/5353057&5353060>.
288
* JavaScriptCore.exp: Export the two variables that are used by leaks to introspect the allocators.
289
* JavaScriptCore.xcodeproj/project.pbxproj:
290
* kjs/AllInOneFile.cpp:
291
* kjs/CollectorHeapIntrospector.cpp: Added.
293
(KJS::CollectorHeapIntrospector::init):
294
(KJS::CollectorHeapIntrospector::CollectorHeapIntrospector): Create and register our zone with the system.
295
(KJS::CollectorHeapIntrospector::enumerate): Iterate over the CollectorBlocks that are in use and report them to the caller as being used.
296
* kjs/CollectorHeapIntrospector.h: Added.
297
(KJS::CollectorHeapIntrospector::size): Return zero to indicate the specified pointer does not belong to this zone.
299
(KJS::Collector::registerThread): Register the CollectorHeapIntrospector with the system when the first thread is registered with the collector.
300
* wtf/FastMalloc.cpp:
301
(WTF::TCMalloc_PageHeap::GetDescriptorEnsureSafe):
302
(WTF::TCMalloc_ThreadCache_FreeList::enumerateFreeObjects): Enumerate the objects on the free list.
303
(WTF::TCMalloc_ThreadCache::enumerateFreeObjects): Ditto.
304
(WTF::TCMalloc_Central_FreeList::enumerateFreeObjects): Ditto.
305
(WTF::TCMalloc_ThreadCache::InitModule): Register the FastMallocZone with the system when initializing TCMalloc.
306
(WTF::FreeObjectFinder::FreeObjectFinder):
307
(WTF::FreeObjectFinder::visit): Add an object to the free list.
308
(WTF::FreeObjectFinder::isFreeObject):
309
(WTF::FreeObjectFinder::freeObjectCount):
310
(WTF::FreeObjectFinder::findFreeObjects): Find the free objects within a thread cache or free list.
311
(WTF::PageMapFreeObjectFinder::PageMapFreeObjectFinder): Find the free objects within a TC_PageMap.
312
(WTF::PageMapFreeObjectFinder::visit): Called once per allocated span. Record whether the span or any subobjects are free.
313
(WTF::PageMapMemoryUsageRecorder::PageMapMemoryUsageRecorder):
314
(WTF::PageMapMemoryUsageRecorder::visit): Called once per allocated span. Report the range of memory as being allocated, and the span or
315
its subobjects as being used if they do not appear on the free list.
316
(WTF::FastMallocZone::enumerate): Map the key remote TCMalloc data structures into our address space. We then locate all free memory ranges
317
before reporting the other ranges as being in use.
318
(WTF::FastMallocZone::size): Determine whether the given pointer originates from within our allocation zone. If so,
319
we return its allocation size.
320
(WTF::FastMallocZone::zoneMalloc):
321
(WTF::FastMallocZone::zoneCalloc):
322
(WTF::FastMallocZone::zoneFree):
323
(WTF::FastMallocZone::zoneRealloc):
325
(WTF::FastMallocZone::FastMallocZone): Create and register our zone with the system.
326
(WTF::FastMallocZone::init):
327
* wtf/MallocZoneSupport.h: Added.
328
(WTF::RemoteMemoryReader::RemoteMemoryReader): A helper class to ease the process of mapping memory in a different process into
329
our local address space
330
(WTF::RemoteMemoryReader::operator()):
332
(TCMalloc_PageMap2::visit): Walk over the heap and visit each allocated span.
333
(TCMalloc_PageMap3::visit): Ditto.
335
2007-08-02 Mark Rowe <mrowe@apple.com>
340
(KJS::UString::expandedSize): Use std::numeric_limits<size_t>::max() rather than the non-portable SIZE_T_MAX.
342
2007-08-02 Mark Rowe <mrowe@apple.com>
346
<rdar://problem/5352887> "Out of memory" error during repeated JS string concatenation leaks hundreds of MBs of RAM
348
A call to fastRealloc was failing which lead to UString::expandCapacity leaking the buffer it was trying to reallocate.
349
It also resulted in the underlying UString::rep having both a null baseString and buf field, which meant that attempting
350
to access the contents of the string after the failed memory reallocation would crash.
352
A third issue is that expandedSize size was calculating the new length in a way that led to an integer overflow occurring.
353
Attempting to allocate a string more than 190,000,000 characters long would fail a the integer overflow would lead to a
354
memory allocation of around 3.6GB being attempted rather than the expected 390MB. Sizes that would lead to an overflow
355
are now returned as zero and callers are updated to treat this as though the memory allocation has failed.
357
* kjs/array_object.cpp:
358
(ArrayProtoFunc::callAsFunction): Check whether the append failed and raise an "Out of memory" exception if it did.
360
(KJS::allocChars): Wrapper around fastMalloc that takes a length in characters. It will return 0 when asked to allocate a zero-length buffer.
361
(KJS::reallocChars): Wrapper around fastRealloc that takes a length in characters. It will return 0 when asked to allocate a zero-length buffer.
362
(KJS::UString::expandedSize): Split the size calculation in two and guard against overflow during each step.
363
(KJS::UString::expandCapacity): Don't leak r->buf if reallocation fails. Instead free the memory and use the null representation.
364
(KJS::UString::expandPreCapacity): If fastMalloc fails then use the null representation rather than crashing in memcpy.
365
(KJS::UString::UString): If calls to expandCapacity, expandPreCapacity or fastMalloc fail then use the null representation rather than crashing in memcpy.
366
(KJS::UString::append): Ditto.
367
(KJS::UString::operator=): Ditto.
368
* kjs/ustring.h: Change return type of expandedSize from int to size_t.
370
2007-08-01 Darin Adler <darin@apple.com>
372
Reviewed by Kevin McCullough.
374
- fix <rdar://problem/5375186> pointers to pieces of class definition passed to JSClassCreate should all be const
376
* API/JSObjectRef.h: Added const.
378
* API/JSClassRef.cpp:
379
(OpaqueJSClass::OpaqueJSClass): Added const.
380
(OpaqueJSClass::create): Added const.
381
* API/JSObjectRef.cpp:
382
(JSClassCreate): Added const.
384
2007-08-01 Steve Falkenburg <sfalken@apple.com>
386
Build mod: Fix sln to match configs in vcproj.
390
* JavaScriptCore.vcproj/JavaScriptCore.make:
391
* JavaScriptCore.vcproj/JavaScriptCore.sln:
393
2007-07-30 Simon Hausmann <hausmann@kde.org>
395
Done with and reviewed by Lars.
397
Removed the __BUILDING_QT ifdef in JSStringRef.h and changed UChar for the Qt build to use wchar_t on Windows.
400
* wtf/unicode/qt4/UnicodeQt4.h:
402
2007-07-27 Simon Hausmann <hausmann@kde.org>
404
Done with and reviewed by Lars and Zack.
406
Always define JSChar to be unsigned short for the Qt builds, to ensure compatibility with UChar.
410
2007-07-27 Simon Hausmann <hausmann@kde.org>
412
Done with and reviewed by Lars and Zack.
414
Fix compilation with Qt on Windows with MingW: Implemented currentThreadStackBase() for this platform.
417
(KJS::currentThreadStackBase):
419
2007-07-27 Simon Hausmann <hausmann@kde.org>
421
Done with and reviewed by Lars and Zack.
423
Fix compilation with Qt on Windows with MingW: The MingW headers do not provide a prototype for a reentrant version of localtime. But since we don't use multiple threads for the Qt build we can use the plain localtime() function.
426
(KJS::getDSTOffsetSimple):
428
2007-07-27 Simon Hausmann <hausmann@kde.org>
430
Done with and reviewed by Lars and Zack.
432
Use $(MOVE) instead of mv to eliminated the shell dependency and replaced the long shell line to call bison and modify the css grammar file with a few lines of portable perl code.
434
* JavaScriptCore.pri:
436
2007-07-27 Simon Hausmann <hausmann@kde.org>
438
Done with and reviewed by Lars and Zack.
440
Implemented currentTime() in the interpreter by using QDateTime, so that we don't need timeGetTime() on Windows and therefore also don't need to link against Winmm.dll.
442
* kjs/interpreter.cpp:
443
(KJS::getCurrentTime):
448
2007-07-27 Simon Hausmann <hausmann@kde.org>
450
Done with and reviewed by Lars and Zack.
452
Replace the use of snprintf with QByteArray to compile under msvc 2005 express.
454
* bindings/qt/qt_instance.cpp:
455
(KJS::Bindings::QtInstance::stringValue):
457
2007-07-27 Simon Hausmann <hausmann@kde.org>
459
Done with and reviewed by Lars and Zack.
461
Don't use pthread.h unless thread support is enabled.
464
(KJS::Collector::registerAsMainThread):
467
2007-07-27 Simon Hausmann <hausmann@kde.org>
469
Done with and reviewed by Lars and Zack.
471
Removed TCSystemMalloc from the Qt build, it's not necessary it seems.
473
* JavaScriptCore.pri:
475
2007-07-27 Simon Hausmann <hausmann@kde.org>
477
Done with and reviewed by Lars and Zack.
479
Added os-win32 to the include search path for the Qt windows build in order to provide the fake stdint.h header file.
481
* JavaScriptCore.pri:
483
2007-07-25 Maciej Stachowiak <mjs@apple.com>
487
- follow-up to previous change
490
(KJS::UString::operator=): Make sure to reset the length when
491
replacing the buffer contents for a single-owned string.
493
2007-07-25 Maciej Stachowiak <mjs@apple.com>
497
- JavaScriptCore part of fix for <rdar://problem/5300291> Optimize GC to reclaim big, temporary objects (like XMLHttpRequest.responseXML) quickly
499
Also, as a side effect of optimizations included in this patch:
500
- 7% speedup on JavaScript iBench
501
- 4% speedup on "Celtic Kane" JS benchmark
503
The basic idea is explained in a big comment in collector.cpp. When unusually
504
large objecs are allocated, we push the next GC closer on the assumption that
505
most objects are short-lived.
507
I also did the following two optimizations in the course of tuning
508
this not to be a performance regression:
510
1) Change UString::Rep to hold a self-pointer as the baseString in
511
the unshared case, instead of a null pointer; this removes a
512
number of null checks in hot code because many places already
513
wanted to use the rep itself or the baseString as appropriate.
515
2) Avoid creating duplicate StringImpls when creating a
516
StringInstance (the object wrapper for a JS string) or calling
517
their methods. Since a temporary wrapper object is made every time
518
a string method is called, this resulted in two useless extra
519
StringImpls being allocated for no reason whenever a String method
520
was invoked on a string value. Now we bypass those.
524
(KJS::Collector::recordExtraCost): Basics of the extra cost mechanism.
525
(KJS::Collector::allocate): ditto
526
(KJS::Collector::collect): ditto
528
(KJS::Collector::reportExtraMemoryCost): ditto
529
* kjs/array_object.cpp:
530
(ArrayInstance::ArrayInstance): record extra cost
532
(KJS::StringImp::toObject): don't create a whole new StringImpl just
533
to be the internal value of a StringInstance! StringImpls are immutable
534
so there's no point tot his.
536
(KJS::StringImp::StringImp): report extra cost
537
* kjs/string_object.cpp:
538
(KJS::StringInstance::StringInstance): new version that takes a StringImp
539
(KJS::StringProtoFunc::callAsFunction): don't create a whole new StringImpl
540
just to convert self to string! we already have one in the internal value
541
* kjs/string_object.h: report extra cost
542
* kjs/ustring.cpp: All changes to handle baseString being self instead of null in the
545
(KJS::UString::Rep::create):
546
(KJS::UString::Rep::destroy):
547
(KJS::UString::usedCapacity):
548
(KJS::UString::usedPreCapacity):
549
(KJS::UString::expandCapacity):
550
(KJS::UString::expandPreCapacity):
551
(KJS::UString::UString):
552
(KJS::UString::append):
553
(KJS::UString::operator=):
554
(KJS::UString::copyForWriting):
556
(KJS::UString::Rep::baseIsSelf): new method, now that baseString is
557
self instead of null in the unshared case we can't just null check.
558
(KJS::UString::Rep::data): adjusted as mentioned above
559
(KJS::UString::cost): new method to compute the cost for a UString, for
563
(KJS::jsString): style fixups.
564
(KJS::jsOwnedString): new method, use this for strings allocated from UStrings
565
held by the parse tree. Tracking their cost as part of string cost is pointless,
566
because garbage collecting them will not actually free the relevant string buffer.
567
* kjs/value.h: prototyped jsOwnedString.
569
(StringNode::evaluate): use jsOwnedString as appropriate
570
(RegExpNode::evaluate): ditto
571
(PropertyNameNode::evaluate): ditto
572
(ForInNode::execute): ditto
574
* JavaScriptCore.exp: Exported some new symbols.
576
2007-07-23 Anders Carlsson <andersca@apple.com>
580
<rdar://problem/5121461> REGRESSION: Unable to load JigZone puzzle
582
* bindings/jni/jni_jsobject.cpp:
583
(JavaJSObject::createNative):
585
Call RootObject::gcProtect on the global object, thereby putting it in the
586
"protect count" set which is used for checking if a native handle is valid.
588
2007-07-23 Darin Adler <darin@apple.com>
590
* pcre/pcre_compile.c: Roll back a tiny accidental change in the unused !JAVASCRIPT
591
side of an #ifdef. This has no effect when using PCRE in JAVASCRIPT mode as we do,
592
but seems worth rolling back.
594
2007-07-23 Maciej Stachowiak <mjs@apple.com>
598
- fix remaining problems with Window shadowing
601
(VarDeclNode::evaluate): Tweak the special case a little.
603
2007-07-23 Maciej Stachowiak <mjs@apple.com>
607
- fix Window shadowing regressions caused by the previous commit.
610
(VarDeclNode::evaluate): Handle the case of global scope specially.
612
2007-07-22 Maciej Stachowiak <mjs@apple.com>
616
-fixed <rdar://problem/5353293> REGRESSION (r24287): 1% i-Bench JS slowdown from JavaScript compatibility fix (14719)
617
http://bugs.webkit.org/show_bug.cgi?id=14719
619
My fix for this actually resulted in JS iBench being 1% faster than before the regression
620
and the Celtic Kane benchmark being 5% faster than before the regression.
623
(VarDeclNode::handleSlowCase): factored out the slow code path to be out of line.
624
(VarDeclNode::evaluate): I did a couple of things:
625
(1) Don't check if the variable is already declared by looking for the property in
626
the variable object, that code path was dead code.
627
(2) Special-case the common case where the top of the scope and the variable object
628
are the same; in that case the variable must always be in the variable object.
629
(3) Don't return a jsString() of the variable name, nothing uses the return value
630
from this node types evaluate method.
633
2007-07-22 Darin Adler <darin@apple.com>
635
Reviewed by Kevin Decker.
637
- fix <rdar://problem/5126394> REGRESSION: Crash after clicking back button in test application (13250)
638
http://bugs.webkit.org/show_bug.cgi?id=13250
640
* bindings/objc/objc_utility.mm: (KJS::Bindings::convertObjcValueToValue):
641
If the object returns 0 for _imp, convert that to "undefined", since callers
642
can't cope with a JSValue of 0.
644
2007-07-19 Geoffrey Garen <ggaren@apple.com>
646
Reviewed by Darin Adler.
648
Fixed http://bugs.webkit.org/show_bug.cgi?id=10880 | <rdar://problem/5335694>
649
REGRESSION: JavaScript menu doesn't appear on pricepoint.com (14595)
651
Though the ECMA spec says auto-semicolon insertion should not occur
652
without a newline or '}', Firefox treats do-while specially, and the
653
library used by pricepoint.com requires that special treatment.
655
* JavaScriptCore.xcodeproj/project.pbxproj:
658
2007-07-19 Darin Adler <darin@apple.com>
662
- fix <rdar://problem/5345440> PCRE computes wrong length for expressions with quantifiers
663
on named recursion or subexpressions
665
It's challenging to implement proper preflighting for compiling these advanced features.
666
But we don't want them in the JavaScript engine anyway.
668
Turned off the following features of PCRE (some of these are simply parsed and not implemented):
670
\C \E \G \L \N \P \Q \U \X \Z
673
(?#) (?<=) (?<!) (?>)
682
Because of \v, the js1_2/regexp/special_characters.js test now passes.
684
To be conservative, I left some features that JavaScript doesn't want, such as
685
\012 and \x{2013}, in place. We can revisit these later; they're not directly-enough
686
related to avoiding the incorrect preflighting.
688
I also didn't try to remove unused opcodes and remove code from the execution engine.
689
That could save code size and speed things up a bit, but it would require more changes.
692
* kjs/regexp.cpp: (KJS::RegExp::RegExp): Remove the sanitizePattern workaround for
693
lack of \u support, since the PCRE code now has \u support.
695
* pcre/pcre-config.h: Set JAVASCRIPT to 1.
696
* pcre/pcre_internal.h: Added ESC_v.
698
* pcre/pcre_compile.c: Added a different escape table for when JAVASCRIPT is set that
699
omits all the escapes we don't want interpreted and includes '\v'.
700
(check_escape): Put !JAVASCRIPT around the code for '\l', '\L', '\N', '\u', and '\U',
701
and added code to handle '\u2013' inside JAVASCRIPT.
702
(compile_branch): Put !JAVASCRIPT if around all the code implementing the features we
704
(pcre_compile2): Ditto.
706
* tests/mozilla/expected.html: Updated since js1_2/regexp/special_characters.js now
709
2007-07-18 Darin Adler <darin@apple.com>
711
Reviewed by Oliver Hunt.
713
- fix <rdar://problem/5345432> PCRE computes length wrong for expressions such as "[**]"
715
Test: fast/js/regexp-charclass-crash.html
717
* pcre/pcre_compile.c: (pcre_compile2): Fix the preflight code that calls
718
check_posix_syntax to match the actual regular expression compilation code;
719
before it was missing the check of the first character.
721
2007-07-19 Holger Hans Peter Freyther <zecke@selfish.org>
725
Define __BUILDING_GDK when building for Gdk to fix building testkjs on OSX.
727
* JavaScriptCore.pri:
729
2007-07-18 Simon Hausmann <hausmann@kde.org>
731
* Fix the Qt build, call dftables from the right directory.
733
Reviewed by Adam Treat.
737
2007-07-18 Simon Hausmann <hausmann@kde.org>
741
Don't call gcc directly when building the dftables tool but use a separate .pro file for the Qt build.
743
* pcre/dftables.pro: Added.
746
2007-07-17 Cameron Zwarich <cwzwarich@uwaterloo.ca>
748
Reviewed by Darin, Maciej, and Adam.
750
Fixes <http://bugs.webkit.org/show_bug.cgi?id=9697>,
751
the failure of ecma/GlobalObject/15.1.2.2-2.js,
752
the failure of ecma/LexicalConventions/7.7.3-1.js,
753
and most of the failures of tests in ecma/TypeConversion/9.3.1-3.js.
755
Bug 9697: parseInt results may be inaccurate for numbers greater than 2^53
757
This patch also fixes similar issues in the lexer and UString::toDouble().
760
(KJS::parseIntOverflow):
766
(KJS::UString::toDouble):
767
* tests/mozilla/expected.html:
769
2007-07-16 Sam Weinig <sam@webkit.org>
773
Turn off -Wshorten-64-to-32 warning for 64-bit builds.
775
* Configurations/Base.xcconfig:
777
2007-07-14 Brady Eidson <beidson@apple.com>
779
Reviewed by Sam Weinig
781
Initial check-in for <rdar://problem/3154486> - Supporting FTP directory listings in the browser
783
* wtf/Platform.h: Add ENABLE_FTPDIR feature to handle building on platforms that don't have the
784
proper network-layer support
786
2007-07-14 Cameron Zwarich <cwzwarich@uwaterloo.ca>
790
Fixes http://bugs.webkit.org/show_bug.cgi?id=13517,
791
http://bugs.webkit.org/show_bug.cgi?id=14237, and
792
the failure of test js1_5/Scope/regress-185485.js
794
Bug 13517: DOM Exception 8 in finance.aol.com sub-page
795
Bug 14237: Javascript "var" statement interprets initialization in the topmost function scope
798
(VarDeclNode::evaluate):
799
* tests/mozilla/expected.html:
801
2007-07-12 Alexey Proskuryakov <ap@webkit.org>
805
http://bugs.webkit.org/show_bug.cgi?id=14596
806
Fix JSC compilation with KJS_VERBOSE.
809
(KJS::FunctionImp::passInParameters):
811
2007-07-11 George Staikos <staikos@kde.org>
815
* ForwardingHeaders: Added.
816
* ForwardingHeaders/JavaScriptCore: Added.
817
* ForwardingHeaders/JavaScriptCore/APICast.h: Added.
818
* ForwardingHeaders/JavaScriptCore/JSBase.h: Added.
819
* ForwardingHeaders/JavaScriptCore/JSContextRef.h: Added.
820
* ForwardingHeaders/JavaScriptCore/JSLock.h: Added.
821
* ForwardingHeaders/JavaScriptCore/JSObjectRef.h: Added.
822
* ForwardingHeaders/JavaScriptCore/JSStringRef.h: Added.
823
* ForwardingHeaders/JavaScriptCore/JSStringRefCF.h: Added.
824
* ForwardingHeaders/JavaScriptCore/JSValueRef.h: Added.
825
* ForwardingHeaders/JavaScriptCore/JavaScriptCore.h: Added.
827
2007-07-11 Holger Hans Peter Freyther <zecke@selfish.org>
831
As of http://bugs.webkit.org/show_bug.cgi?id=14527 move the
832
WebCore/ForwardingHeader/JavaScriptCore to JavaScriptCore
834
* ForwardingHeaders: Added.
835
* ForwardingHeaders/JavaScriptCore: Copied from WebCore/ForwardingHeaders/JavaScriptCore.
837
2007-07-11 Nikolas Zimmermann <zimmermann@kde.org>
841
Forwardport the hash table fix from CodeGeneratorJS.pm to create_hash_table.
842
Reran run-jsc-tests, couldn't find any regressions. Suggested by Darin.
844
* kjs/create_hash_table:
846
2007-07-09 Maciej Stachowiak <mjs@apple.com>
850
- JavaScriptCore part of fix for: <rdar://problem/5295734> Repro crash closing tab/window @ maps.google.com in WTF::HashSet<KJS::RuntimeObjectImp*, WTF::PtrHash<KJS::RuntimeObjectImp*>, WTF::HashTraits<KJS::RuntimeObjectImp*> >::add + 11
852
* JavaScriptCore.exp: Added needed export.
854
2007-07-06 Maciej Stachowiak <mjs@apple.com>
858
- <rdar://problem/5311093> JavaScriptCore fails to build with strict-aliasing warnings
860
* Configurations/Base.xcconfig: Re-enable -Wstrict-aliasing
861
* bindings/jni/jni_utility.cpp:
862
(KJS::Bindings::getJNIEnv): Type-pun via a union instead of a pointer cast.
864
(WTF::): Instead of doing type-punned assignments via pointer cast, do one of three things:
865
(1) assign directly w/o cast if storage type matches real type; (2) assign using cast
866
via union if type does not need reffing; (3) copy with memcpy and ref/deref manually if type
867
needs reffing. This is ok peref-wise because memcpy of a constant length gets optomized.
868
HashTraits are now expected to make ref()/deref() take the storage type, not the true type.
870
(WTF::): Same basic idea.
872
(WTF::): Added Assigner template for use by HashMap/HashSet. Change RefCounter to call ref()
873
and deref() via storage type, avoiding the need to
875
(WTF::RefCounter::ref): ditto
876
(WTF::RefCounter::deref): ditto
878
(WTF::): Change ref() and deref() for RefPtr HashTraits to take the storage type; cast
879
via union to pointer type.
880
* wtf/FastMalloc.cpp:
881
(WTF::TCMalloc_PageHeap::init): Changed from constructor to init function so this can go in a union.
882
(WTF::): redefine pageheap macro in terms of getPageHeap().
883
(WTF::getPageHeap): new inline function, helper for pageheap macro. This hides the cast in a union.
884
(WTF::TCMalloc_ThreadCache::InitModule): Call init() instead of using placement new to initialize page
887
(TCMalloc_PageMap1::init): Changed from constructor to init function.
888
(TCMalloc_PageMap2::init): ditto
889
(TCMalloc_PageMap3::init): ditto
892
2007-07-06 George Staikos <staikos@kde.org>
896
Switch USE(ICONDATABASE) to ENABLE(ICONDATABASE)
900
2007-07-03 Sam Weinig <sam@webkit.org>
904
Eleventh round of fixes for implicit 64-32 bit conversion errors.
905
<rdar://problem/5292262>
907
- Fixes a real bug where where we were setting long long and unsigned long long
908
values to a long field.
910
* bindings/objc/objc_utility.mm:
911
(KJS::Bindings::convertValueToObjcValue):
913
2007-07-03 Sam Weinig <sam@webkit.org>
915
Reviewed by Brady Eidson.
917
Tenth round of fixes for implicit 64-32 bit conversion errors.
918
<rdar://problem/5292262>
920
- Add explicit casts.
925
2007-07-02 Sam Weinig <sam@webkit.org>
927
Reviewed by Kevin McCullough.
929
Fourth round of fixes for implicit 64-32 bit conversion errors.
930
<rdar://problem/5292262>
932
Add custom piDouble and piFloat constants to use instead of M_PI.
934
* kjs/math_object.cpp:
935
(MathObjectImp::getValueProperty):
939
2007-06-29 Sam Weinig <sam@webkit.org>
943
Second pass at fixing implicit 64-32 bit conversion errors.
944
<rdar://problem/5292262>
946
- Add a toFloat() method to JSValue for float conversion.
948
* JavaScriptCore.exp:
950
(KJS::JSValue::toFloat):
953
2007-06-27 Kevin McCullough <kmccullough@apple.com>
957
- <rdar://problem/5271937> REGRESSION: Apparent WebKit JavaScript memory smasher when submitting comment to iWeb site (crashes in kjs_pcre_compile2)
958
- Correctly evaluate the return value of _pcre_ucp_findchar.
960
* pcre/pcre_compile.c:
965
2007-06-27 Sam Weinig <sam@webkit.org>
969
First pass at fixing implicit 64-32 bit conversion errors.
970
<rdar://problem/5292262>
972
- Add 'f' suffix where necessary.
975
(StopWatch::getElapsedMS):
977
2007-06-26 Geoffrey Garen <ggaren@apple.com>
979
Reviewed by Maciej Stachowiak.
981
Fixed <rdar://problem/5296627> JSGarbageCollect headerdoc suggests that
982
using JavaScriptCore requires leaking memory
984
* API/JSBase.h: Changed documentation to explain that you can pass NULL
987
2007-06-26 Adam Treat <adam@staikos.net>
989
Reviewed by Adam Roben.
991
Make the SQLite icon database optional.
995
2007-06-15 George Staikos <staikos@kde.org>
997
More missing files for Qt.
999
* JavaScriptCore.pri:
1002
2007-06-15 George Staikos <staikos@kde.org>
1004
Another Qt build fix.
1006
* JavaScriptCore.pri:
1009
2007-06-15 George Staikos <staikos@kde.org>
1013
* JavaScriptCore.pri:
1015
2007-06-20 Mark Rowe <mrowe@apple.com>
1019
Fix http://bugs.webkit.org/show_bug.cgi?id=14244
1020
Bug 14244: Data corruption when using a replace() callback function with data containing "$"
1022
* kjs/string_object.cpp:
1023
(KJS::replace): When 'replacement' is a function, do not replace $n placeholders in its return value.
1024
This matches the behaviour described in ECMA 262 3rd Ed section 15.5.4.1, and as implemented in Firefox.
1026
2007-06-14 Anders Carlsson <andersca@apple.com>
1030
* bindings/runtime_object.cpp:
1031
(RuntimeObjectImp::canPut):
1033
2007-06-14 Anders Carlsson <andersca@apple.com>
1037
<rdar://problem/5103077>
1038
Crash at _NPN_ReleaseObject when quitting page at http://eshop.macsales.com/shop/ModBook
1040
<rdar://problem/5183692>
1041
http://bugs.webkit.org/show_bug.cgi?id=13547
1042
REGRESSION: Crash in _NPN_ReleaseObject when closing Safari on nba.com (13547)
1044
<rdar://problem/5261499>
1045
CrashTracer: [USER] 75 crashes in Safari at com.apple.JavaScriptCore: KJS::Bindings::CInstance::~CInstance + 40
1047
Have the root object track all live instances of RuntimeObjectImp. When invalidating
1048
the root object, also invalidate all live runtime objects by zeroing out their instance ivar.
1049
This prevents instances from outliving their plug-ins which lead to crashes.
1051
* bindings/c/c_utility.cpp:
1052
(KJS::Bindings::convertValueToNPVariant):
1053
* bindings/jni/jni_jsobject.cpp:
1054
(JavaJSObject::convertValueToJObject):
1055
* bindings/jni/jni_utility.cpp:
1056
(KJS::Bindings::convertValueToJValue):
1057
* bindings/objc/objc_runtime.mm:
1058
(ObjcFallbackObjectImp::callAsFunction):
1059
* bindings/runtime_array.cpp:
1060
(RuntimeArray::RuntimeArray):
1061
* bindings/runtime_array.h:
1062
(KJS::RuntimeArray::getConcreteArray):
1063
* bindings/runtime_method.cpp:
1064
(RuntimeMethod::callAsFunction):
1065
* bindings/runtime_method.h:
1066
* bindings/runtime_object.cpp:
1067
(RuntimeObjectImp::RuntimeObjectImp):
1068
(RuntimeObjectImp::~RuntimeObjectImp):
1069
(RuntimeObjectImp::invalidate):
1070
(RuntimeObjectImp::fallbackObjectGetter):
1071
(RuntimeObjectImp::fieldGetter):
1072
(RuntimeObjectImp::methodGetter):
1073
(RuntimeObjectImp::getOwnPropertySlot):
1074
(RuntimeObjectImp::put):
1075
(RuntimeObjectImp::canPut):
1076
(RuntimeObjectImp::defaultValue):
1077
(RuntimeObjectImp::implementsCall):
1078
(RuntimeObjectImp::callAsFunction):
1079
(RuntimeObjectImp::getPropertyNames):
1080
(RuntimeObjectImp::throwInvalidAccessError):
1081
* bindings/runtime_object.h:
1082
* bindings/runtime_root.cpp:
1083
(KJS::Bindings::RootObject::invalidate):
1084
(KJS::Bindings::RootObject::addRuntimeObject):
1085
(KJS::Bindings::RootObject::removeRuntimeObject):
1086
* bindings/runtime_root.h:
1088
2007-06-14 Anders Carlsson <andersca@apple.com>
1092
<rdar://problem/5244948>
1093
Safari keeps on complaining about slow script playing NBC TV video (14133)
1095
http://bugs.webkit.org/show_bug.cgi?id=14133
1096
Runaway JavaScript timer fires when spinning around in Google Maps street view
1098
Make sure to start and stop the timeout checker around calls to JS.
1100
* bindings/NP_jsobject.cpp:
1101
(_NPN_InvokeDefault):
1104
* bindings/jni/jni_jsobject.cpp:
1105
(JavaJSObject::call):
1106
(JavaJSObject::eval):
1108
2007-06-13 Darin Adler <darin@apple.com>
1110
Reviewed by Mark Rowe.
1112
- fix http://bugs.webkit.org/show_bug.cgi?id=14132
1113
array sort with > 10000 elements sets elements > 10000 undefined
1115
Test: fast/js/sort-large-array.html
1117
* kjs/array_instance.h: Replaced pushUndefinedObjectsToEnd with
1118
compactForSorting, and removed ExecState parameters.
1120
* kjs/array_object.cpp:
1121
(ArrayInstance::sort): Changed to call compactForSorting.
1122
(ArrayInstance::compactForSorting): Do the get and delete of the
1123
properties directly on the property map instead of using public
1124
calls from JSObject. The public calls would just read the undefined
1125
values from the compacted sort results array!
1127
2007-06-13 George Staikos <staikos@kde.org>
1131
Fix Mac OS X build after last checkin.
1135
2007-06-14 Lars Knoll <lars@trolltech.com>
1139
Disable FastMalloc for the Qt build and make sure we
1140
don't reimplement the global new/delete operators
1141
when using the system malloc.
1143
* wtf/FastMalloc.cpp:
1147
2007-06-13 Anders Carlsson <andersca@apple.com>
1151
Make sure that bindings instances get correct root objects.
1153
* JavaScriptCore.exp:
1154
* bindings/NP_jsobject.cpp:
1155
(listFromVariantArgs):
1156
(_NPN_InvokeDefault):
1159
* bindings/c/c_instance.cpp:
1160
(KJS::Bindings::CInstance::invokeMethod):
1161
(KJS::Bindings::CInstance::invokeDefaultMethod):
1162
* bindings/c/c_runtime.cpp:
1163
(KJS::Bindings::CField::valueFromInstance):
1164
* bindings/c/c_utility.cpp:
1165
(KJS::Bindings::convertNPVariantToValue):
1166
* bindings/c/c_utility.h:
1167
* bindings/objc/objc_instance.mm:
1168
(ObjcInstance::invokeMethod):
1169
(ObjcInstance::invokeDefaultMethod):
1170
(ObjcInstance::getValueOfUndefinedField):
1171
* bindings/objc/objc_runtime.mm:
1172
(ObjcField::valueFromInstance):
1173
(ObjcArray::valueAt):
1174
* bindings/objc/objc_utility.h:
1175
* bindings/objc/objc_utility.mm:
1176
(KJS::Bindings::convertObjcValueToValue):
1177
* bindings/runtime.h:
1179
2007-06-13 Simon Hausmann <hausmann@kde.org>
1183
* kjs/testkjs.pro: WebKitQt is now called QtWebKit.
1185
2007-06-12 Anders Carlsson <andersca@apple.com>
1189
* bindings/qt/qt_instance.cpp:
1190
(KJS::Bindings::QtInstance::invokeMethod):
1192
2007-06-12 Anders Carlsson <andersca@apple.com>
1196
Move the notion of field type to the JNI runtime since that's the only
1197
one that was actually using it.
1199
* bindings/c/c_runtime.h:
1200
(KJS::Bindings::CField::CField):
1201
* bindings/jni/jni_runtime.h:
1202
* bindings/objc/objc_runtime.h:
1203
* bindings/objc/objc_runtime.mm:
1204
* bindings/qt/qt_runtime.h:
1205
* bindings/runtime.h:
1206
* bindings/runtime_method.cpp:
1208
2007-06-12 Anders Carlsson <andersca@apple.com>
1212
* bindings/qt/qt_class.cpp:
1213
(KJS::Bindings::QtClass::methodsNamed):
1214
* bindings/qt/qt_instance.cpp:
1215
(KJS::Bindings::QtInstance::invokeMethod):
1217
2007-06-12 Anders Carlsson <andersca@apple.com>
1221
Get rid of the MethodList class and use a good ol' Vector instead.
1223
* bindings/c/c_class.cpp:
1224
(KJS::Bindings::CClass::methodsNamed):
1225
* bindings/c/c_instance.cpp:
1226
(KJS::Bindings::CInstance::invokeMethod):
1227
* bindings/jni/jni_class.cpp:
1228
(JavaClass::JavaClass):
1229
(JavaClass::~JavaClass):
1230
* bindings/jni/jni_instance.cpp:
1231
(JavaInstance::invokeMethod):
1232
* bindings/objc/objc_class.mm:
1233
(KJS::Bindings::ObjcClass::methodsNamed):
1234
* bindings/objc/objc_instance.mm:
1235
(ObjcInstance::invokeMethod):
1236
* bindings/objc/objc_runtime.mm:
1237
(ObjcFallbackObjectImp::callAsFunction):
1238
* bindings/runtime.cpp:
1239
* bindings/runtime.h:
1240
* bindings/runtime_method.cpp:
1241
(RuntimeMethod::lengthGetter):
1242
(RuntimeMethod::callAsFunction):
1243
* bindings/runtime_object.cpp:
1244
(RuntimeObjectImp::getOwnPropertySlot):
1246
2007-06-12 Anders Carlsson <andersca@apple.com>
1250
Make RuntimeMethod's method list a pointer so that the object size doesn't
1251
grow beyond 32 bytes when we later will replace MethodList with a Vector.
1253
* bindings/runtime_method.cpp:
1254
(RuntimeMethod::RuntimeMethod):
1255
(RuntimeMethod::lengthGetter):
1256
(RuntimeMethod::callAsFunction):
1257
* bindings/runtime_method.h:
1259
2007-06-12 Anders Carlsson <andersca@apple.com>
1263
Get rid of the Parameter class.
1265
* bindings/jni/jni_instance.cpp:
1266
(JavaInstance::invokeMethod):
1267
* bindings/jni/jni_runtime.cpp:
1268
(JavaMethod::signature):
1269
* bindings/jni/jni_runtime.h:
1270
(KJS::Bindings::JavaParameter::JavaParameter):
1271
(KJS::Bindings::JavaParameter::~JavaParameter):
1272
(KJS::Bindings::JavaParameter::type):
1273
(KJS::Bindings::JavaMethod::parameterAt):
1274
(KJS::Bindings::JavaMethod::numParameters):
1275
* bindings/runtime.h:
1277
2007-06-12 Anders Carlsson <andersca@apple.com>
1281
* bindings/qt/qt_class.h:
1283
2007-06-12 Mark Rowe <mrowe@apple.com>
1287
* bindings/objc/objc_runtime.h:
1289
2007-06-12 Anders Carlsson <andersca@apple.com>
1293
Get rid of Constructor and its only subclass JavaConstructor.
1295
* bindings/c/c_class.h:
1296
* bindings/jni/jni_class.cpp:
1297
(JavaClass::JavaClass):
1298
(JavaClass::~JavaClass):
1299
* bindings/jni/jni_class.h:
1300
* bindings/jni/jni_runtime.cpp:
1301
* bindings/jni/jni_runtime.h:
1302
* bindings/objc/objc_class.h:
1303
* bindings/runtime.h:
1305
2007-06-12 Anders Carlsson <andersca@apple.com>
1309
Use RetainPtr throughout the bindings code.
1311
* bindings/objc/objc_class.h:
1312
* bindings/objc/objc_class.mm:
1313
(KJS::Bindings::ObjcClass::ObjcClass):
1314
(KJS::Bindings::ObjcClass::methodsNamed):
1315
(KJS::Bindings::ObjcClass::fieldNamed):
1316
* bindings/objc/objc_instance.h:
1317
(KJS::Bindings::ObjcInstance::getObject):
1318
* bindings/objc/objc_instance.mm:
1319
(ObjcInstance::ObjcInstance):
1320
(ObjcInstance::~ObjcInstance):
1321
(ObjcInstance::implementsCall):
1322
(ObjcInstance::invokeMethod):
1323
(ObjcInstance::invokeDefaultMethod):
1324
(ObjcInstance::defaultValue):
1325
* bindings/objc/objc_runtime.h:
1326
(KJS::Bindings::ObjcMethod::setJavaScriptName):
1327
(KJS::Bindings::ObjcMethod::javaScriptName):
1328
(KJS::Bindings::ObjcArray::getObjcArray):
1329
* bindings/objc/objc_runtime.mm:
1331
(ObjcArray::ObjcArray):
1332
(ObjcArray::setValueAt):
1333
(ObjcArray::valueAt):
1334
(ObjcArray::getLength):
1337
2007-06-12 Anders Carlsson <andersca@apple.com>
1341
Have JSCell inherit from Noncopyable.
1343
* bindings/objc/objc_runtime.h:
1344
* bindings/runtime_object.h:
1347
2007-06-12 Anders Carlsson <andersca@apple.com>
1349
Reviewed by Darin and Maciej.
1351
More cleanup. Use our Noncopyable WTF class, add a root object member
1354
* bindings/c/c_class.h:
1355
* bindings/jni/jni_class.h:
1356
* bindings/jni/jni_instance.h:
1357
* bindings/jni/jni_runtime.cpp:
1358
(JavaArray::JavaArray):
1359
* bindings/jni/jni_runtime.h:
1360
* bindings/objc/objc_class.h:
1361
* bindings/objc/objc_runtime.h:
1362
* bindings/objc/objc_runtime.mm:
1363
(ObjcArray::ObjcArray):
1364
* bindings/objc/objc_utility.mm:
1365
(KJS::Bindings::convertObjcValueToValue):
1366
* bindings/runtime.cpp:
1367
(KJS::Bindings::Array::Array):
1368
(KJS::Bindings::Array::~Array):
1369
* bindings/runtime.h:
1370
* bindings/runtime_object.h:
1371
* bindings/runtime_root.h:
1373
2007-06-08 Zack Rusin <zrusin@trolltech.com>
1377
* bindings/qt/qt_instance.cpp:
1378
(KJS::Bindings::QtInstance::QtInstance):
1379
* bindings/qt/qt_instance.h:
1381
2007-06-07 Anders Carlsson <andersca@apple.com>
1385
Get rid of Instance::setRootObject and pass the root object to the instance constructor instead.
1387
* bindings/c/c_instance.cpp:
1388
(KJS::Bindings::CInstance::CInstance):
1389
* bindings/c/c_instance.h:
1390
* bindings/jni/jni_instance.cpp:
1391
(JavaInstance::JavaInstance):
1392
* bindings/jni/jni_instance.h:
1393
* bindings/jni/jni_jsobject.cpp:
1394
(JavaJSObject::convertJObjectToValue):
1395
* bindings/objc/objc_instance.h:
1396
* bindings/objc/objc_instance.mm:
1397
(ObjcInstance::ObjcInstance):
1398
* bindings/runtime.cpp:
1399
(KJS::Bindings::Instance::Instance):
1400
(KJS::Bindings::Instance::createBindingForLanguageInstance):
1401
* bindings/runtime.h:
1403
2007-06-07 Anders Carlsson <andersca@apple.com>
1407
Don't use a JavaInstance to store the field when all we want to do is to keep the field
1408
from being garbage collected. Instead, use a JObjectWrapper.
1410
* bindings/jni/jni_instance.h:
1411
* bindings/jni/jni_runtime.cpp:
1412
(JavaField::JavaField):
1413
(JavaField::dispatchValueFromInstance):
1414
(JavaField::dispatchSetValueToInstance):
1415
* bindings/jni/jni_runtime.h:
1416
(KJS::Bindings::JavaField::JavaField):
1417
(KJS::Bindings::JavaField::operator=):
1419
2007-05-30 Alp Toker <alp.toker@collabora.co.uk>
1423
Enable logging in the Gdk port.
1424
http://bugs.webkit.org/show_bug.cgi?id=13936
1426
* wtf/Assertions.cpp:
1427
* wtf/Assertions.h: Add WTFLogVerbose which also logs
1428
the file, line number and function.
1430
2007-05-30 Mark Rowe <mrowe@apple.com>
1432
Mac build fix. Update #include.
1434
* API/JSCallbackFunction.h:
1436
2007-05-30 Luciano Montanaro <mikelima@cirulla.net>
1440
- cross-port Harri Porten's commits 636099 and 636108 from KJS:
1441
"publish a class anyway public already" and "class is being used from
1442
outside for quite some time" in preparation for further syncronizations
1445
* kjs/date_object.cpp:
1446
* kjs/date_object.h:
1449
(KJS::InternalFunctionImp::classInfo):
1450
(KJS::InternalFunctionImp::functionName):
1451
* kjs/function_object.h:
1454
(KJS::getStaticPropertySlot):
1455
(KJS::getStaticFunctionSlot):
1456
(KJS::getStaticValueSlot):
1457
* kjs/object_object.h:
1459
2007-05-29 Sam Weinig <sam@webkit.org>
1461
Reviewed by Adam Roben.
1463
Cleanup function and fix to match comparison API.
1465
* kjs/string_object.cpp:
1466
(KJS::substituteBackreferences):
1467
(KJS::localeCompare):
1469
2007-05-28 Geoffrey Garen <ggaren@apple.com>
1471
Slight clarification to an exception message.
1473
* API/JSCallbackObject.cpp:
1474
(KJS::JSCallbackObject::put):
1476
2007-05-27 Holger Freyther <zecke@selfish.org>
1478
Reviewed by Mark Rowe.
1480
* wtf/Platform.h: Move Gdk up to allow building WebKit/Gdk on Darwin
1482
2007-05-27 Darin Adler <darin@apple.com>
1484
- fix a couple ifdefs that said WIN instead of WIN_OS
1486
* kjs/collector.cpp:
1487
(KJS::allocateBlock): WIN -> WIN_OS
1488
(KJS::freeBlock): Ditto.
1490
2007-05-26 Sam Weinig <sam@webkit.org>
1494
Patch for http://bugs.webkit.org/show_bug.cgi?id=13854
1495
Port of commit 667785 from kjs
1497
- special case calling String.localeCompare() with no parameters to return 0.
1499
* kjs/string_object.cpp:
1500
(KJS::StringProtoFunc::callAsFunction):
1502
2007-05-25 Kimmo Kinnunen <kimmok@iki.fi>
1506
- Fix for http://bugs.webkit.org/show_bug.cgi?id=13456
1507
REGRESSION: setTimeout "arguments" object gets shadowed by a local variable
1509
- Add a explicit check for arguments. Previously check was done with getDirect,
1510
but since the arguments is created on-demand in ActivationImp, it doesn't
1511
show up in the test. 'arguments' should always be in the VarDeclNode's
1515
(VarDeclNode::evaluate): Additional check if the var decl identifier is 'arguments'
1517
2007-05-25 George Staikos <staikos@kde.org>
1521
- Use COMPILER(GCC), not PLATFORM(GCC) - as Platform.h defines
1525
2007-05-25 Kimmo Kinnunen <kimmok@iki.fi>
1529
- http://bugs.webkit.org/show_bug.cgi?id=13623 (Decompilation of function
1530
doesn't compile with "++(x,y)")
1531
- Create the error node based on the actual node, not the node inside
1533
- Fix applies to postfix, prefix and typeof operators
1534
- Produces run-time ReferenceError like other non-lvalue assignments etc.
1536
* kjs/grammar.y: Create {Prefix,Postfix}ErrorNode based on the actual node,
1537
not the based on the node returned by "nodeInsideAllParens()". Same for
1540
2007-05-25 Simon Hausmann <hausmann@kde.org>
1544
Fix crash in Qt JavaScript bindings when the arguments used on the Qt side are not
1545
registered with QMetaType.
1547
* bindings/qt/qt_instance.cpp:
1548
(KJS::Bindings::QtInstance::invokeMethod):
1549
* bindings/qt/qt_runtime.cpp:
1551
2007-05-24 Luciano Montanaro <mikelima@cirulla.net>
1555
Patch for http://bugs.webkit.org/show_bug.cgi?id=13855
1556
Port patch 666176 to JavaScriptCore
1558
- Renamed JSValue::downcast() to JSValue::asCell() which makes the
1559
function meaning cleaner. It's modeled after Harri Porten change in
1562
* kjs/collector.cpp:
1563
(KJS::Collector::protect):
1564
(KJS::Collector::unprotect):
1565
(KJS::Collector::collectOnMainThreadOnly):
1567
(KJS::JSValue::isObject):
1568
* kjs/string_object.cpp:
1569
(KJS::StringProtoFunc::callAsFunction):
1571
(KJS::JSValue::asCell):
1572
(KJS::JSValue::isNumber):
1573
(KJS::JSValue::isString):
1574
(KJS::JSValue::isObject):
1575
(KJS::JSValue::getNumber):
1576
(KJS::JSValue::getString):
1577
(KJS::JSValue::getObject):
1578
(KJS::JSValue::getUInt32):
1579
(KJS::JSValue::mark):
1580
(KJS::JSValue::marked):
1581
(KJS::JSValue::type):
1582
(KJS::JSValue::toPrimitive):
1583
(KJS::JSValue::toBoolean):
1584
(KJS::JSValue::toNumber):
1585
(KJS::JSValue::toString):
1586
(KJS::JSValue::toObject):
1588
2007-05-18 Holger Hans Peter Freyther <zecke@selfish.org>
1590
Reviewed by Mark Rowe.
1592
* kjs/testkjs.pro: Make the Gdk port link to icu
1594
2007-05-15 Geoffrey Garen <ggaren@apple.com>
1596
Reviewed by Adele Peterson.
1598
It helps if you swap the right variable.
1603
2007-05-15 Lars Knoll <lars@trolltech.com>
1607
Extend the QObject JavaScript bindings to work for slots with
1610
* bindings/qt/qt_instance.cpp:
1611
(KJS::Bindings::QtInstance::invokeMethod):
1613
2007-05-14 Kimmo Kinnunen <kimmok@iki.fi>
1617
- Fixes http://bugs.webkit.org/show_bug.cgi?id=13622 (Decompiler
1618
omits trailing comma in array literal)
1620
* kjs/nodes2string.cpp:
1621
(ArrayNode::streamTo): print extra ',' in case there was elision
1622
commas (check opt member var) and array elements present
1623
in the array expression
1625
2007-05-14 Geoffrey Garen <ggaren@apple.com>
1627
Reviewed by Oliver Hunt.
1629
Added HashMap::swap and HashSet::swap. WebCore now uses HashSet::swap.
1630
I figured while I was in the neighborhood I might as well add HashMap::swap,
1640
2007-05-11 Kimmo Kinnunen <kimmok@iki.fi>
1644
- Fix for bug http://bugs.webkit.org/show_bug.cgi?id=13620
1645
Bogus decompilation of "for (var j = 1 in [])"
1646
- ForInNode toString()'ed to syntax error if there was var decl
1648
- ForNode toStringed()'ed lost 'var ' if it was present
1650
* kjs/nodes2string.cpp:
1651
(VarDeclListNode::streamTo): Print "var " here
1652
(VarStatementNode::streamTo): Don't print "var " here
1653
(ForNode::streamTo): Remove TODO comment, VarDeclListNode will
1655
(ForInNode::streamTo): ForIn initializer is printed by VarDeclNode
1657
2007-05-11 Kimmo Kinnunen <kimmok@iki.fi>
1661
- Fixes http://bugs.webkit.org/show_bug.cgi?id=10878
1662
(Incorrect decompilation for "4..x")
1663
- Group numbers in dotted expressions in toString() output, so we
1664
avoid the 4.x constructs when the original input is 4..x.
1665
4..x means the same as 4. .x or (4).x or Number(4).x
1667
* kjs/nodes2string.cpp:
1668
(KJS::SourceStream::):
1669
Add boolean flag to indicate that if next item is a number, it should be grouped.
1670
Add new formatting enum which turns on the boolean flag.
1671
(KJS::SourceStream::SourceStream): Added. Initialize the flag.
1672
(SourceStream::operator<<): Added. New overloaded operator with double value as parameter.
1673
(NumberNode::streamTo): Use the double operator
1674
(ArrayNode::streamTo):
1675
(DotAccessorNode::streamTo):
1676
(FunctionCallDotNode::streamTo):
1677
(FunctionCallParenDotNode::streamTo):
1678
(PostfixDotNode::streamTo):
1679
(DeleteDotNode::streamTo):
1680
(PrefixDotNode::streamTo):
1681
(AssignDotNode::streamTo): Use the new formatting enum to turn on the grouping flag.
1683
2007-05-10 Lars Knoll <lars@trolltech.com>
1687
Fix our last three test failures in the JavaScript
1690
* wtf/unicode/qt4/UnicodeQt4.h:
1691
(WTF::Unicode::toLower):
1692
(WTF::Unicode::toUpper):
1694
2007-05-08 Geoffrey Garen <ggaren@apple.com>
1696
Reviewed by Darin Adler.
1698
Fixed #includes of JSStringRefCF.h and use of CF datatypes. I think I
1699
misunderstood this issue before.
1701
* API/JavaScriptCore.h: #include JSStringRefCF.h. Platforms that don't
1702
want this behavior can just #include individual headers, instead of the
1703
umbrella framework header. But we definitely want Mac OS X clients to
1704
get the #include of JSStringRefCF.h "for free."
1705
* API/minidom.c: Don't #include JSStringRefCF.h. (Don't need to #include
1706
JavaScriptCore.h, either.)
1707
* API/testapi.c: Don't #include JSStringRefCF.h. Do use CF datatypes
1708
regardless of whether __APPLE__ is defined. Platforms that don't support
1709
CF just shouldn't compile this file.
1712
2007-05-09 Eric Seidel <eric@webkit.org>
1716
http://bugs.webkit.org/show_bug.cgi?id=6985
1717
Cyclic __proto__ values cause WebKit to hang
1720
(KJS::JSObject::put): do a cycle check before setting __proto__
1722
2007-05-08 Kimmo Kinnunen <kimmok@iki.fi>
1724
Reviewed by darin. Landed by eseidel.
1726
- http://bugs.webkit.org/show_bug.cgi?id=10880 (Do..while loop gains
1727
a semicolon each time it is toStringed)
1728
Grammar in Ecma-66262, 12.6: "do Statement while ( Expression );"
1729
EmptyStatement was created after every do..while(expr) which
1730
had semicolon at the end.
1732
* kjs/grammar.y: Require semicolon at the end of do..while
1734
2007-05-08 Geoffrey Garen <ggaren@apple.com>
1736
Build fix -- this time for sure.
1738
APICast.h, being private, ends up in a different folder than JSValueRef.h,
1739
so we can't include one from the other using "". Instead, just forward
1740
declare the relevant data types.
1744
2007-05-08 Geoffrey Garen <ggaren@apple.com>
1746
Build fix: export APICast.h for WebCore and WebKit.
1748
* JavaScriptCore.xcodeproj/project.pbxproj:
1750
2007-05-04 Darin Adler <darin@apple.com>
1754
- fix http://bugs.webkit.org/show_bug.cgi?id=12821
1755
<rdar://problem/5007921> Number.toExponential doesn't work for negative numbers
1757
* kjs/number_object.cpp: (NumberProtoFunc::callAsFunction):
1758
Added a call to fabs before calling log10.
1760
2007-05-03 Holger Freyther <freyther@kde.org>
1762
Reviewed by Zack, landed by Simon.
1763
This is bugzilla bug 13499.
1765
* JavaScriptCore.pri: Place Qt into the qt-port scope
1766
* bindings/testbindings.pro: Place Qt into the qt-port scope
1767
* kjs/testkjs.pro: Place Qt into the qt-port scope
1768
* pcre/pcre.pri: Place Qt into the qt-port scope
1770
2007-05-02 David Harrison <harrison@apple.com>
1774
<rdar://problem/5174862> Crash resulting from DeprecatedString::insert()
1776
Added insertion support for more than one value.
1780
Added support for inserting multiple values.
1783
New. Insert at the start of vectors. Convenient for vectors used as strings.
1785
2007-05-01 Jungshik Shin <jungshik.shin@gmail.com>
1789
- get rid of non-ASCII lteral characters : suppress compiler warnings
1790
http://bugs.webkit.org/show_bug.cgi?id=13551
1793
* pcre/pcre_compile.c:
1795
2007-04-28 Jungshik Shin <jungshik.shin@gmail.com>
1797
Reviewed by Sam Weinig.
1799
- Replace copyright sign in Latin-1 (0xA9) with '(C)'
1800
http://bugs.webkit.org/show_bug.cgi?id=13531
1802
* bindings/npruntime.h:
1804
2007-04-28 Darin Adler <darin@apple.com>
1808
- fix <rdar://problem/5154144> Hamachi test fails: assertion failure in ListHashSet
1810
Test: fast/forms/add-remove-form-elements-stress-test.html
1812
* wtf/ListHashSet.h:
1813
(WTF::ListHashSetNodeAllocator::ListHashSetNodeAllocator): Initialize
1814
m_isDoneWithInitialFreeList to false.
1815
(WTF::ListHashSetNodeAllocator::allocate): Added assertions based on a debug-only
1816
m_isAllocated flag that make sure we don't allocate a block that's already allocated.
1817
These assertions helped pinpoint the bug. Set m_isDoneWithInitialFreeList when we
1818
allocate the last block of the initial free list. Once we're done with the initial
1819
free list, turn off the rule that says that the next node in the pool after the last
1820
node in the free list is also free. This rule works because any free nodes are added
1821
to the head of the free list, so a node that hasn't been allocated even once is always
1822
at the tail of the free list and all the nodes after it also haven't been allocated
1823
even once. But it doesn't work any longer once the entire pool has been used at least
1824
once, because there's nothing special about the last node on the free list any more.
1825
(WTF::ListHashSetNodeAllocator::deallocate): Set the node's m_isAllocated to false.
1826
(WTF::ListHashSetNodeAllocator::pastPool): Added. Used above.
1827
(WTF::ListHashSetNodeAllocator::inPool): Changed to use the pastPool function.
1828
(WTF::ListHashSetNode::ListHashSetNode): Initialize m_isAllocated to true.
1829
(WTF::ListHashSetNode::operator new): Removed variable name for unused size
1831
(WTF::ListHashSetNode::destroy): Changed to call the destructor rather than
1832
delete -- this gets rid of the need to define an operator delete.
1834
2007-04-27 Christopher Brichford <chrisb@adobe.com>
1836
Reviewed by Timothy Hatcher.
1838
Fix for: Bug 13211: Move JavaScriptCore mac project files for apollo port
1839
http://bugs.webkit.org/show_bug.cgi?id=13211
1841
* JavaScriptCore.apolloproj/mac/JavaScriptCore.Debug.xcconfig: Added.
1842
* JavaScriptCore.apolloproj/mac/JavaScriptCore.Release.xcconfig: Added.
1843
* JavaScriptCore.apolloproj/mac/JavaScriptCore.xcconfig: Added.
1844
* JavaScriptCore.apolloproj/mac/JavaScriptCore.xcodeproj/project.pbxproj: Added.
1845
* JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.Debug.xcconfig: Removed.
1846
* JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.Release.xcconfig: Removed.
1847
* JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcconfig: Removed.
1848
* JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj: Removed.
1850
2007-04-27 Holger Freyther <freyther@kde.org>
1854
Remove unmaintained CMake build system.
1856
* CMakeLists.txt: Removed.
1857
* pcre/CMakeLists.txt: Removed.
1859
2007-04-27 Mark Rowe <mrowe@apple.com>
1863
* JavaScriptCore.xcodeproj/project.pbxproj: Improve dependencies in Xcode project
1864
by marking dftables as a dependency of Generate Derived Sources rather than of
1865
JavaScriptCore itself.
1867
2007-04-26 Geoffrey Garen <ggaren@apple.com>
1869
Build fix -- added #includes that we used to get implicitly through
1877
2007-04-26 Geoffrey Garen <ggaren@apple.com>
1879
Reviewed by Maciej Stachowiak, Adam Roben.
1882
<rdar://problem/4885130> Remove #include of JSStringRefCF.h from JSStringRef.h
1883
<rdar://problem/4885123> JavaScriptCore is not cross-platform -- JSStringRef.h references CF datatypes
1885
* API/JSStringRef.h: Removed #include -- no clients need it anymore.
1887
2007-04-25 David Kilzer <ddkilzer@apple.com>
1891
Add assertions for debug builds.
1894
(KJS::JSLock::lock): Assert the return value of pthread_mutex_lock() in debug builds.
1895
(KJS::JSLock::unlock): Assert the return value of pthread_mutex_unlock() in debug builds.
1897
2007-04-25 Maciej Stachowiak <mjs@apple.com>
1901
- fix build problems
1903
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Disable warning that
1904
gives often downright incorrect results based on guessing what will happen in 64-bit.
1906
2007-04-25 Darin Adler <darin@apple.com>
1910
- tweak the allocator for a small speedup -- Shark showed this was a win, but I can't
1911
measure an improvement right now, but it's also clear these changes do no harm
1913
* wtf/FastMalloc.cpp:
1914
(WTF::LgFloor): Use ALWAYS_INLINE here; in testing I did a while back this was necessary
1915
to get this single-instruction function to be inlined.
1916
(WTF::SizeClass): Use ALWAYS_INLINE here too for the same reason. Also change the special
1917
case for a size of 0 to work without a branch for a bit of extra speed.
1918
(WTF::ByteSizeForClass): Use ALWAYS_INLINE here too for the same reason.
1920
2007-04-24 Maciej Stachowiak <mjs@apple.com>
1924
- use custom calling convention for everything in nodes.cpp on intel gcc for 1.5% speed boost
1926
Nearly all functions in nodes.cpp were marked up to use the
1927
regparm(3) calling convention under GCC for x86, since this is
1928
faster and they are all guaranteed to be called only internally to
1931
The only exception is destructors, since delete doesn't know how to use a custom calling convention.
1934
(dotExprDoesNotAllowCallsString):
1937
(KJS::StatementNode::):
1939
(KJS::BooleanNode::):
1940
(KJS::NumberNode::):
1941
(KJS::StringNode::):
1942
(KJS::RegExpNode::):
1944
(KJS::ResolveNode::):
1946
(KJS::ElementNode::):
1948
(KJS::PropertyNameNode::):
1949
(KJS::PropertyNode::):
1950
(KJS::PropertyListNode::):
1951
(KJS::ObjectLiteralNode::):
1952
(KJS::BracketAccessorNode::):
1953
(KJS::DotAccessorNode::):
1954
(KJS::ArgumentListNode::):
1955
(KJS::ArgumentsNode::):
1956
(KJS::NewExprNode::):
1957
(KJS::FunctionCallValueNode::):
1958
(KJS::FunctionCallResolveNode::):
1959
(KJS::FunctionCallBracketNode::):
1960
(KJS::FunctionCallParenBracketNode::):
1961
(KJS::FunctionCallDotNode::):
1962
(KJS::FunctionCallParenDotNode::):
1963
(KJS::PostfixResolveNode::):
1964
(KJS::PostfixBracketNode::):
1965
(KJS::PostfixDotNode::):
1966
(KJS::PostfixErrorNode::):
1967
(KJS::DeleteResolveNode::):
1968
(KJS::DeleteBracketNode::):
1969
(KJS::DeleteDotNode::):
1970
(KJS::DeleteValueNode::):
1972
(KJS::TypeOfResolveNode::):
1973
(KJS::TypeOfValueNode::):
1974
(KJS::PrefixResolveNode::):
1975
(KJS::PrefixBracketNode::):
1976
(KJS::PrefixDotNode::):
1977
(KJS::PrefixErrorNode::):
1978
(KJS::UnaryPlusNode::):
1979
(KJS::NegateNode::):
1980
(KJS::BitwiseNotNode::):
1981
(KJS::LogicalNotNode::):
1985
(KJS::RelationalNode::):
1987
(KJS::BitOperNode::):
1988
(KJS::BinaryLogicalNode::):
1989
(KJS::ConditionalNode::):
1990
(KJS::AssignResolveNode::):
1991
(KJS::AssignBracketNode::):
1992
(KJS::AssignDotNode::):
1993
(KJS::AssignErrorNode::):
1995
(KJS::AssignExprNode::):
1996
(KJS::VarDeclListNode::):
1997
(KJS::VarStatementNode::):
1998
(KJS::EmptyStatementNode::):
1999
(KJS::ExprStatementNode::):
2001
(KJS::DoWhileNode::):
2004
(KJS::ContinueNode::):
2006
(KJS::ReturnNode::):
2011
(KJS::ParameterNode::):
2013
(KJS::FunctionBodyNode::):
2014
(KJS::FuncExprNode::):
2015
(KJS::FuncDeclNode::):
2016
(KJS::SourceElementsNode::):
2017
(KJS::CaseClauseNode::):
2018
(KJS::ClauseListNode::):
2019
(KJS::SwitchNode::):
2021
2007-04-24 Oliver Hunt <oliver@apple.com>
2023
GTK Build fix, ::findEntry->KJS::findEntry
2026
(KJS::Lookup::findEntry):
2027
(KJS::Lookup::find):
2029
2007-04-23 Maciej Stachowiak <mjs@apple.com>
2033
- compile most of JavaScriptCore as one file for 4% JS iBench speed improvement
2035
* JavaScriptCore.xcodeproj/project.pbxproj: Add AllInOneFile.cpp, and remove files it includes
2037
* kjs/AllInOneFile.cpp: Added.
2038
* kjs/dtoa.cpp: Renamed CONST to CONST_ to avoid conflict.
2040
(Bigint::nrv_alloc):
2041
* kjs/lookup.cpp: Use "namspace KJS { ... }" instead of "using namespace KJS;"
2043
2007-04-23 Maciej Stachowiak <mjs@apple.com>
2045
Build fix, not reviewed.
2047
* kjs/collector.h: Fix struct/class mismatch.
2049
2007-04-23 Maciej Stachowiak <mjs@apple.com>
2053
- raise ALLOCATIONS_PER_COLLECTION to 4000, for 3.7% iBench speed improvement
2055
Now that the cell size is smaller and the block size is bigger, we can fit 4000 objects in
2056
the two spare cells the collector is willing to keep around, so collect a bit less often.
2058
* kjs/collector.cpp:
2060
2007-04-23 Maciej Stachowiak <mjs@apple.com>
2062
Reviewed by Darin and Geoff.
2064
- move mark and collectOnMainThreadOnly bits into separate bitmaps
2066
This saves 4 bytes per cell, allowing shrink of cell size to 32,
2067
which leads to a .8% speed improvement on iBench.
2069
This is only feasible because of all the previous changes on the branch.
2071
* kjs/collector.cpp:
2072
(KJS::allocateBlock): Adjust for some renames of constants.
2073
(KJS::Collector::markStackObjectsConservatively): Now that cells are 32 bytes (64
2074
bytes on 64-bit) the cell alignment check can be made much more strict, and also
2075
obsoletes the need for a % sizeof(CollectorCell) check. Also, we can mask off the low
2076
bits of the pointer to have a potential block pointer to look for.
2077
(KJS::Collector::collectOnMainThreadOnly): Use bitmap.
2078
(KJS::Collector::markMainThreadOnlyObjects): Use bitmap.
2079
(KJS::Collector::collect): When sweeping, use bitmaps directly to find mark bits.
2081
(KJS::): Move needed constants and type declarations here.
2082
(KJS::CollectorBitmap::get): Bit twiddling to get a bitmap value.
2083
(KJS::CollectorBitmap::set): Bit twiddling to set a bitmap bit to true.
2084
(KJS::CollectorBitmap::clear): Bit twiddling to set a bitmap bit to false.
2085
(KJS::CollectorBitmap::clearAll): Clear whole bitmap at one go.
2086
(KJS::Collector::cellBlock): New operation, compute the block pointer for
2087
a cell by masking off low bits.
2088
(KJS::Collector::cellOffset): New operation, compute the cell offset for a
2089
cell by masking off high bits and dividing (actually a shift).
2090
(KJS::Collector::isCellMarked): Check mark bit in bitmap
2091
(KJS::Collector::markCell): Set mark bit in bitmap.
2093
(KJS::JSCell::JSCell): No more bits.
2094
(KJS::JSCell::marked): Let collector handle it.
2095
(KJS::JSCell::mark): Let collector handle it.
2097
2007-04-23 Anders Carlsson <andersca@apple.com>
2101
* kjs/regexp_object.h:
2102
RegExpObjectImpPrivate is a struct, not a class.
2104
2007-04-23 Maciej Stachowiak <mjs@apple.com>
2108
- shrink FunctionImp / DeclaredFunctionImp by 4 bytes, by moving parameter list to function body
2110
I reconciled this with a similar change in KDE kjs by Maks Orlovich <maksim@kde.org>.
2113
(KJS::FunctionImp::callAsFunction):
2114
(KJS::FunctionImp::passInParameters):
2115
(KJS::FunctionImp::lengthGetter):
2116
(KJS::FunctionImp::getParameterName):
2118
* kjs/function_object.cpp:
2119
(FunctionProtoFunc::callAsFunction):
2120
(FunctionObjectImp::construct):
2122
(FunctionBodyNode::addParam):
2123
(FunctionBodyNode::paramString):
2124
(FuncDeclNode::addParams):
2125
(FuncDeclNode::processFuncDecl):
2126
(FuncExprNode::addParams):
2127
(FuncExprNode::evaluate):
2129
(KJS::Parameter::Parameter):
2130
(KJS::FunctionBodyNode::numParams):
2131
(KJS::FunctionBodyNode::paramName):
2132
(KJS::FunctionBodyNode::parameters):
2133
(KJS::FuncExprNode::FuncExprNode):
2134
(KJS::FuncDeclNode::FuncDeclNode):
2135
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Disable 64-bit warnings because
2136
they handle size_t badly.
2138
2007-04-23 Maciej Stachowiak <mjs@apple.com>
2142
- shrink RegexpObjectImp by 4 bytes
2144
Somewhat inexplicably, this seems to be a .33% speedup on JS iBench.
2146
* kjs/regexp_object.cpp:
2147
(KJS::RegExpObjectImpPrivate::RegExpObjectImpPrivate):
2148
(RegExpObjectImp::RegExpObjectImp):
2149
(RegExpObjectImp::performMatch):
2150
(RegExpObjectImp::arrayOfMatches):
2151
(RegExpObjectImp::getBackref):
2152
(RegExpObjectImp::getLastMatch):
2153
(RegExpObjectImp::getLastParen):
2154
(RegExpObjectImp::getLeftContext):
2155
(RegExpObjectImp::getRightContext):
2156
(RegExpObjectImp::getValueProperty):
2157
(RegExpObjectImp::putValueProperty):
2158
* kjs/regexp_object.h:
2160
2007-04-23 Maciej Stachowiak <mjs@apple.com>
2164
- change to 1-bit bitfields instead of 8-bit, this turns out to lead to a .51% speedup on JS iBench
2166
The 1-bit bitfields are actually faster than just plain bools, at least on Intel (go figure).
2168
* kjs/property_map.h:
2170
2007-04-23 Maciej Stachowiak <mjs@apple.com>
2174
- shrink ArrayInstance objects by 4 bytes
2175
http://bugs.webkit.org/show_bug.cgi?id=13386
2177
I did this by storing the capacity before the beginning of the storage array. It turns out
2178
it is rarely needed and is by definition 0 when the storage array is null.
2180
* kjs/array_instance.h:
2181
(KJS::ArrayInstance::capacity): Get it from the secret stash
2182
* kjs/array_object.cpp:
2183
(allocateStorage): New function to encapsulate allocating the storage with extra space ahead
2185
(reallocateStorage): ditto for realloc
2186
(ArrayInstance::ArrayInstance):
2187
(ArrayInstance::~ArrayInstance):
2188
(ArrayInstance::resizeStorage):
2190
2007-04-23 Darin Adler <darin@apple.com>
2194
- fix <rdar://problem/4840688> REGRESSION (r10588, r10621): JavaScript won't parse
2195
modifications of non-references (breaks 300themovie.warnerbros.com, fedex.com)
2197
Despite the ECMAScript specification's claim that you can treat these as syntax
2198
errors, doing so creates some website incompatibilities. So this patch turns them back
2199
into evaluation errors instead.
2201
Test: fast/js/modify-non-references.html
2203
* kjs/grammar.y: Change makeAssignNode, makePrefixNode, and makePostfixNode so that they
2204
never fail to parse. Update rules that use them. Fix a little bit of indenting. Use
2205
new PostfixErrorNode, PrefixErrorNode, and AssignErrorNode classes.
2207
* kjs/nodes.h: Added an overload of throwError that takes a char* argument.
2208
Replaced setExceptionDetailsIfNeeded and debugExceptionIfNeeded with handleException,
2209
which does both. Added PostfixErrorNode, PrefixErrorNode, and AssignErrorNode classes.
2211
* kjs/nodes.cpp: Changed exception macros to use handleException; simpler and smaller
2212
code size than the two functions that we used before.
2213
(Node::throwError): Added the overload mentioned above.
2214
(Node::handleException): Added. Contains the code from both setExceptionDetailsIfNeeded
2215
and debugExceptionIfNeeded.
2216
(PostfixErrorNode::evaluate): Added. Throws an exception.
2217
(PrefixErrorNode::evaluate): Ditto.
2218
(AssignErrorNode::evaluate): Ditto.
2219
(ThrowNode::execute): Call handleException instead of debugExceptionIfNeeded; this
2220
effectively adds a call to setExceptionDetailsIfNeeded, which may help with getting
2221
the correct file and line number for these exceptions.
2223
* kjs/nodes2string.cpp:
2224
(PostfixErrorNode::streamTo): Added.
2225
(PrefixErrorNode::streamTo): Added.
2226
(AssignErrorNode::streamTo): Added.
2228
2007-04-23 Maciej Stachowiak <mjs@apple.com>
2232
- fix test failures / crashes on PPC
2234
* kjs/property_map.h: Make the bool fields explicitly 8-bit bitfields, since bool is a full
2235
word there otherwise :-(
2237
2007-04-23 Maciej Stachowiak <mjs@apple.com>
2241
- fix more test case failures
2243
* bindings/runtime_array.cpp:
2244
(RuntimeArray::RuntimeArray): inherit from JSObject instead of ArrayInstance; it turns
2245
out that this class only needs the prototype and classInfo from ArrayInstance, not the
2246
actual class itself, and it was too big otherwise.
2247
(RuntimeArray::getOwnPropertySlot):
2248
* bindings/runtime_array.h:
2250
2007-04-23 Maciej Stachowiak <mjs@apple.com>
2254
- fix some test failures
2256
* bindings/runtime_method.cpp:
2257
(RuntimeMethod::RuntimeMethod): inherit from InternalFunctionImp instead of FunctionImpl,
2258
otherwise this is too big
2259
(RuntimeMethod::getOwnPropertySlot):
2260
* bindings/runtime_method.h:
2262
2007-04-22 Maciej Stachowiak <mjs@apple.com>
2266
- discard the arguments List for an ActivationImp when the corresponding Context is destroyed (1.7% speedup)
2267
http://bugs.webkit.org/show_bug.cgi?id=13385
2269
Based an idea by Christopher E. Hyde <C.Hyde@parableuk.force9.co.uk>. His patch to do
2270
this also had many other List changes and I found this much simpler subset of the changes
2271
was actually a hair faster.
2273
This optimization is valid because the arguments list is only kept around to
2274
lazily make the arguments object. If it's not made by the time the function
2275
exits, it never will be, since any function that captures the continuation will
2276
have its own local arguments variable in scope.
2278
Besides the 1.7% speed improvement, it shrinks List by 4 bytes
2279
(which in turn shrinks ActivationImp by 4 bytes).
2282
(KJS::Context::~Context): Clear the activation's arguments list.
2284
(KJS::ActivationImp::ActivationImp): Adjusted for list changes.
2285
(KJS::ActivationImp::mark): No need to mark, lists are always protected (this doesn't
2286
cause a ref-cycle for reasons stated above).
2287
(KJS::ActivationImp::createArgumentsObject): Clear arguments list.
2290
(KJS::List::List): No more needsMarking boolean
2291
(KJS::List::operator=): ditto
2293
(KJS::List::List): ditto
2294
(KJS::List::reset): ditto
2295
(KJS::List::deref): ditto
2297
2007-04-22 Maciej Stachowiak <mjs@apple.com>
2301
- shrink PropertyMap by 8 bytes and therefore shrink CELL_SIZE to 40 (for 32-bit;
2302
similar shrinkage for 64-bit)
2303
http://bugs.webkit.org/show_bug.cgi?id=13384
2305
Inspired by similar changes by Christopher E. Hyde <C.Hyde@parableuk.force9.co.uk>
2306
done in the kjs-tweaks branch of KDE's kjs. However, this version is somewhat
2307
cleaner style-wise and avoids some of the negative speed impact (at least on gcc/x86)
2310
This is nearly a wash performance-wise, maybe a slight slowdown, but worth doing
2311
to eventually reach cell size 32.
2313
* kjs/collector.cpp:
2315
* kjs/property_map.cpp:
2316
(KJS::PropertyMap::~PropertyMap):
2317
(KJS::PropertyMap::clear):
2318
(KJS::PropertyMap::get):
2319
(KJS::PropertyMap::getLocation):
2320
(KJS::PropertyMap::put):
2321
(KJS::PropertyMap::insert):
2322
(KJS::PropertyMap::expand):
2323
(KJS::PropertyMap::rehash):
2324
(KJS::PropertyMap::remove):
2325
(KJS::PropertyMap::mark):
2326
(KJS::PropertyMap::containsGettersOrSetters):
2327
(KJS::PropertyMap::getEnumerablePropertyNames):
2328
(KJS::PropertyMap::getSparseArrayPropertyNames):
2329
(KJS::PropertyMap::save):
2330
(KJS::PropertyMap::checkConsistency):
2331
* kjs/property_map.h:
2332
(KJS::PropertyMap::hasGetterSetterProperties):
2333
(KJS::PropertyMap::setHasGetterSetterProperties):
2334
(KJS::PropertyMap::):
2335
(KJS::PropertyMap::PropertyMap):
2337
2007-04-22 Maciej Stachowiak <mjs@apple.com>
2341
- change blocks to 64k in size, and use various platform-specific calls to allocate at 64k-aligned addresses
2342
http://bugs.webkit.org/show_bug.cgi?id=13383
2344
* kjs/collector.cpp:
2345
(KJS::allocateBlock): New function to allocate 64k of 64k-aligned memory
2346
(KJS::freeBlock): Corresponding free
2347
(KJS::Collector::allocate):
2348
(KJS::Collector::collect):
2350
2007-04-22 Maciej Stachowiak <mjs@apple.com>
2352
Reviewed by Darin and Geoff.
2354
- remove the concept of oversize objects, now that there aren't any (for now
2355
only enforced with an assert).
2356
http://bugs.webkit.org/show_bug.cgi?id=13382
2358
This change is a .66% speedup on JS iBench for 32-bit platforms, probably much more
2359
for 64-bit since it finally gives a reasonable cell size, but I did not test that.
2361
* kjs/collector.cpp:
2362
(KJS::): Use different cell size for 32-bit and 64-bit, now that there is no
2363
oversize allocation.
2364
(KJS::Collector::allocate): Remove oversize allocator.
2365
(KJS::Collector::markStackObjectsConservatively): Don't check oversize objects.
2366
(KJS::Collector::markMainThreadOnlyObjects): Ditto.
2367
(KJS::Collector::collect): Ditto.
2369
2007-04-21 Mitz Pettel <mitz@webkit.org>
2373
- fix http://bugs.webkit.org/show_bug.cgi?id=13428
2374
REGRESSION (r20973-r20976): Failing ecma/Array/15.4.4.5-3.js
2376
- fix http://bugs.webkit.org/show_bug.cgi?id=13429
2377
REGRESSION (r20973-r20976): Crashing in fast/dom/plugin-attributes-enumeration.html
2379
* kjs/array_object.cpp:
2380
(ArrayInstance::sort): Free the old storage, not the new one.
2382
2007-04-20 Maciej Stachowiak <mjs@apple.com>
2384
Not reviewed, build fix.
2386
- fix build problem with last change - -O3 complains more about uninitialized variables
2388
* pcre/pcre_compile.c:
2392
2007-04-20 Maciej Stachowiak <mjs@apple.com>
2396
- <rdar://problem/5149915> use mergesort when possible, since it leads to fewer compares (2% JS iBench speedup)
2398
* kjs/array_object.cpp:
2399
(ArrayInstance::sort): Use mergesort(3) on platforms that have it, since it tends
2400
to do fewer compares than qsort; but avoid it very on large arrays since it uses extra
2401
memory. Also added comments identifying possibly even better sorting algorithms
2402
for sort by string value and sort by compare function.
2405
2007-04-20 Maciej Stachowiak <mjs@apple.com>
2409
- bump optimization flags up to -O3 for 1% JS iBench speed improvement
2411
* Configurations/Base.xcconfig:
2413
2007-04-20 Mark Rowe <mrowe@apple.com>
2417
Fix bogus optimisation in the generic pthread code path.
2419
* kjs/collector.cpp:
2420
(KJS::currentThreadStackBase):
2422
2007-04-20 Mark Rowe <mrowe@apple.com>
2426
Improve FreeBSD compatibility, as suggested by Alexander Botero-Lowry.
2428
* kjs/collector.cpp:
2429
(KJS::currentThreadStackBase): FreeBSD requires that pthread_attr_t's are
2430
initialized via pthread_attr_init before being used in any context.
2432
2007-04-19 Mark Rowe <mrowe@apple.com>
2436
Fix http://bugs.webkit.org/show_bug.cgi?id=13401
2437
Bug 13401: Reproducible crash calling myArray.sort(compareFn) from within
2438
a sort comparison function
2440
* kjs/array_object.cpp:
2441
(ArrayInstance::sort): Save/restore the static variables around calls to qsort
2442
to ensure nested calls to ArrayInstance::sort behave correctly.
2444
2007-04-12 Deneb Meketa <dmeketa@adobe.com>
2446
Reviewed by Darin Adler.
2448
http://bugs.webkit.org/show_bug.cgi?id=13029
2449
rdar://problem/4994849
2450
Bug 13029: Permit NPAPI plug-ins to see HTTP response headers.
2451
This doesn't actually change JavaScriptCore, but that's where npapi.h is.
2454
Add headers member to NPStream struct. Also increase NP_VERSION_MINOR to 18.
2455
Increasing to >= 17 allows plug-ins to safely detect whether to look for
2456
NPStream::headers. Increasing from 17 to 18 reflects presence of NPObject
2457
enumeration, which was added in a prior patch, and which has been agreed to
2458
constitute version 18 by the plugin-futures list. Also add other missing
2459
bits of npapi.h to catch up from 14 to 18. This includes features that are
2460
not implemented in WebKit, but those are safely stubbed.
2462
2007-04-10 Geoffrey Garen <ggaren@apple.com>
2464
Reviewed by Mark Rowe.
2466
Fixed last check-in to print in release builds, too.
2468
* kjs/collector.cpp:
2469
(KJS::getPlatformThreadRegisters):
2471
2007-04-10 Geoffrey Garen <ggaren@apple.com>
2473
Reviewed by John Sullivan, Darin Adler.
2475
Fixed <rdar://problem/5121899> JavaScript garbage collection leads to
2476
later crash under Rosetta (should abort or leak instead?)
2478
Log an error message and crash if the kernel reports failure during GC.
2479
We decided to do this instead of just leaking because we don't want people
2480
to get the mistaken impression that running in Rosetta is a supported
2483
The CRASH macro will also hook into CrashReporter, which will tell us if
2484
many (any?) users run into this issue.
2486
* kjs/collector.cpp:
2487
(KJS::getPlatformThreadRegisters):
2489
2007-04-06 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
2493
Coverity fix. Coverity says:
2494
"Event var_deref_model: Variable "sourceRanges" tracked as NULL was passed to a
2495
function that dereferences it"
2497
* kjs/string_object.cpp:
2500
2007-04-06 Geoffrey Garen <ggaren@apple.com>
2502
Rubber stamped by Adele Peterson.
2504
* kjs/ExecState.h: Removed obsolete forward/friend declaration of
2507
2007-04-05 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
2511
Coverity fix. Coverity says:
2512
"Event check_after_deref: Pointer "dateString" dereferenced before NULL check"
2514
* kjs/date_object.cpp:
2517
2007-04-05 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
2521
Coverity fix. Coverity says:
2522
"Event check_after_deref: Pointer "re" dereferenced before NULL check"
2524
* pcre/pcre_study.c:
2527
2007-04-05 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
2531
Coverity fixes. Coverity says:
2532
"Event leaked_storage: Returned without freeing storage "buffer""
2534
"Event leaked_storage: Returned without freeing storage "script""
2538
(createStringWithContentsOfFile):
2540
2007-04-05 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
2544
Coverity fix: in single-threaded case currentThreadIsMainThread is always true
2545
so the code in if (!currentThreadIsMainThread) cannot possibly be reached
2546
and Coverity complains about dead code.
2548
* kjs/collector.cpp:
2549
(KJS::Collector::collect):
2551
=== Safari-5522.6 ===
2553
2007-04-03 Kevin McCullough <kmccullough@apple.com>
2557
- Testing a post-commit hook.
2559
* JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
2561
2007-04-03 Anders Carlsson <andersca@apple.com>
2565
<rdar://problem/5107534>
2566
http://bugs.webkit.org/show_bug.cgi?id=13265
2567
REGRESSION: Crash in KJS::Bindings::convertValueToNPVariant
2569
* bindings/NP_jsobject.cpp:
2570
(_NPN_InvokeDefault):
2571
Return false if the object isn't a function. Set the return value to undefined by default
2574
2007-03-30 Anders Carlsson <andersca@apple.com>
2578
* bindings/NP_jsobject.cpp:
2581
2007-03-30 Anders Carlsson <andersca@apple.com>
2585
Implement _NPN_Enumerate support.
2587
* JavaScriptCore.exp:
2588
* bindings/NP_jsobject.cpp:
2590
* bindings/c/c_instance.cpp:
2591
(KJS::Bindings::CInstance::getPropertyNames):
2592
* bindings/c/c_instance.h:
2594
* bindings/npruntime.h:
2595
* bindings/npruntime_impl.h:
2596
* bindings/runtime.h:
2597
(KJS::Bindings::Instance::getPropertyNames):
2598
* bindings/runtime_object.cpp:
2599
(RuntimeObjectImp::getPropertyNames):
2600
* bindings/runtime_object.h:
2601
(KJS::RuntimeObjectImp::getInternalInstance):
2603
2007-03-28 Jeff Walden <jwalden+code@mit.edu>
2607
http://bugs.webkit.org/show_bug.cgi?id=12963
2608
Fix some inconsistencies in the Mozilla JS Array extras implementations
2609
with respect to the Mozilla implementation:
2611
- holes in arrays should be skipped, not treated as undefined,
2613
- an element with value undefined is not a hole
2614
- Array.prototype.forEach should return undefined
2616
* kjs/array_object.cpp:
2617
(ArrayInstance::getOwnPropertySlot):
2618
(ArrayProtoFunc::callAsFunction):
2620
2007-03-27 Anders Carlsson <acarlsson@apple.com>
2624
* bindings/NP_jsobject.cpp:
2625
(_NPN_InvokeDefault):
2626
Call JSObject:call for native JavaScript objects.
2628
2007-03-26 David Carson <dacarson@gmail.com>
2630
Reviewed by Darin, landed by Anders.
2632
Fix for: REGRESSION (r19559): Java applet crash
2633
http://bugs.webkit.org/show_bug.cgi?id=13142
2634
<rdar://problem/5080340>
2636
The previous fix http://bugs.webkit.org/show_bug.cgi?id=12636
2637
introduced new JNIType to enum in jni_utility.h This is a
2638
problem on the Mac as it seems that the JNIType enum is also
2639
used in the JVM, it is used to specify the return type in
2641
Corrected the fix by moving type to the end, and changing
2642
jni_objc.mm to convert the new type to an old compatible
2645
* bindings/jni/jni_objc.mm:
2646
(KJS::Bindings::dispatchJNICall):
2647
* bindings/jni/jni_utility.h:
2649
2007-03-26 Christopher Brichford <chrisb@adobe.com>
2651
Reviewed/landed by Adam.
2653
Bug 13198: Move build settings from project file to xcconfig file for apollo
2655
http://bugs.webkit.org/show_bug.cgi?id=13198
2657
- Moving build settings from xcode project file to xcconfig files.
2659
* JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.Debug.xcconfig:
2660
* JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.Release.xcconfig:
2661
* JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcconfig:
2662
* JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj:
2664
2007-03-26 Brady Eidson <beidson@apple.com>
2666
Rubberstamped by Anders and Maciej aand Geoff (oh my!)
2668
Since CFTypeRef is really void*, a RetainPtr couldn't be used.
2669
RefType was "void", which doesn't actually exist as a type.
2670
Since RefType only existed for operator*(), and since that operator
2671
doesn't make any sense for RetainPtr, I removed them!
2673
* kjs/nodes.cpp: Touch this to force a rebuild and (hopefully) help the
2674
compiler with dependencies
2675
* wtf/RetainPtr.h: Nuke RefType and operator*()
2677
2007-03-26 Geoffrey Garen <ggaren@apple.com>
2679
Touched a file to (hopefully) help the compiler with RetainPtr dependencies.
2684
2007-03-24 Brady Eidson <beidson@apple.com>
2688
Whoops, RetainPtr should be in the WTF namespace
2692
2007-03-24 Brady Eidson <beidson@apple.com>
2696
<rdar://problem/5086210> - Move RetainPtr to WTF
2698
* wtf/RetainPtr.h: Added
2699
* JavaScriptCore.xcodeproj/project.pbxproj: Add it to the project file
2700
* JavaScriptCore.vcproj/WTF/WTF.vcproj: Ditto
2703
2007-03-23 Christopher Brichford <chrisb@adobe.com>
2705
Reviewed/landed by Adam.
2707
Bug 13175: Make apollo mac project files for JavaScriptCore actually
2709
http://bugs.webkit.org/show_bug.cgi?id=13175
2711
- Changing apollo mac project files for JavaScriptCore such that they actually build
2712
JavaScriptCore source code.
2714
* JavaScriptCore.apolloproj/ForwardingSources/grammar.cpp: Added.
2715
* JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcconfig:
2716
* JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj:
2718
2007-03-24 Mark Rowe <mrowe@apple.com>
2720
Rubber-stamped by Darin.
2722
* Configurations/JavaScriptCore.xcconfig: Remove unnecessary INFOPLIST_PREPROCESS.
2724
2007-03-22 Christopher Brichford <chrisb@adobe.com>
2726
Reviewed/landed by Adam.
2728
Bug 13164: Initial version of mac JavaScriptCore project files for
2730
http://bugs.webkit.org/show_bug.cgi?id=13164
2732
- Adding mac project files for apollo port of JavaScriptCore. Currently project
2733
just builds dftables.
2735
* JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.Debug.xcconfig: Added.
2736
* JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.Release.xcconfig: Added.
2737
* JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcconfig: Added.
2738
* JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj: Added.
2740
2007-03-21 Timothy Hatcher <timothy@apple.com>
2744
<rdar://problem/5076599> JavaScriptCore has a weak export (vtable for KJS::JSCell)
2746
* JavaScriptCore.exp: Remove __ZTVN3KJS6JSCellE.
2748
2007-03-21 Adele Peterson <adele@apple.com>
2752
* API/JSStringRef.cpp: (JSStringIsEqual): Added JSLock.
2754
2007-03-21 Zack Rusin <zrusin@trolltech.com>
2756
Fix the compile when USE(MULTIPLE_THREADS) isn't
2760
(KJS::JSLock::currentThreadIsHoldingLock):
2762
2007-03-20 Maciej Stachowiak <mjs@apple.com>
2764
Reviewed by Geoff and Adam.
2766
- make USE(MULTIPLE_THREADS) support more portable
2767
http://bugs.webkit.org/show_bug.cgi?id=13069
2769
- fixed a threadsafety bug discovered by testing this
2771
- enhanced threadsafety assertions in collector
2773
* API/JSCallbackObject.cpp:
2774
(KJS::JSCallbackObject::~JSCallbackObject): This destructor can't
2775
DropAllLocks around the finalize callback, because it gets called
2776
from garbage collection and we can't let other threads collect!
2778
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2780
(KJS::JSLock::currentThreadIsHoldingLock): Added new function
2781
to allow stronger assertions than just that the lock is held
2782
by some thread (you can now assert that the current thread is
2783
holding it, given the new JSLock design).
2785
* kjs/collector.cpp: Refactored for portability plus added some
2786
stronger assertions.
2787
(KJS::Collector::allocate):
2788
(KJS::currentThreadStackBase):
2789
(KJS::Collector::registerAsMainThread):
2790
(KJS::onMainThread):
2791
(KJS::PlatformThread::PlatformThread):
2792
(KJS::getCurrentPlatformThread):
2793
(KJS::Collector::Thread::Thread):
2794
(KJS::destroyRegisteredThread):
2795
(KJS::Collector::registerThread):
2796
(KJS::Collector::markCurrentThreadConservatively):
2797
(KJS::suspendThread):
2798
(KJS::resumeThread):
2799
(KJS::getPlatformThreadRegisters):
2800
(KJS::otherThreadStackPointer):
2801
(KJS::otherThreadStackBase):
2802
(KJS::Collector::markOtherThreadConservatively):
2803
(KJS::Collector::markStackObjectsConservatively):
2804
(KJS::Collector::protect):
2805
(KJS::Collector::unprotect):
2806
(KJS::Collector::collectOnMainThreadOnly):
2807
(KJS::Collector::markMainThreadOnlyObjects):
2808
(KJS::Collector::collect):
2810
* wtf/FastMalloc.cpp:
2811
(WTF::fastMallocSetIsMultiThreaded):
2812
* wtf/FastMallocInternal.h:
2815
2007-03-19 Darin Adler <darin@apple.com>
2817
* kjs/value.h: Roll ~JSValue change out. It was causing problems. I'll do it right later.
2819
2007-03-19 Geoffrey Garen <ggaren@apple.com>
2821
Reviewed by John Sullivan.
2823
Fixed <rdar://problem/5073380> REGRESSION: Crash occurs at WTF::fastFree()
2824
when reloading liveconnect page (applet)
2826
Best to use free when you use malloc, especially when malloc and delete
2827
use completely different libraries.
2829
* bindings/jni/jni_runtime.cpp:
2830
(JavaMethod::~JavaMethod):
2832
2007-03-19 Andrew Wellington <proton@wiretapped.net>
2836
Really set Xcode editor to use 4 space indentation (http://webkit.org/coding/coding-style.html)
2838
* JavaScriptCore.xcodeproj/project.pbxproj:
2840
2007-03-19 Darin Adler <darin@apple.com>
2844
- Changed list size threshold to 5 based on testing.
2846
I was testing the i-Bench JavaScript with the list statistics
2847
dumping on, and discovered that there were many 5-element lists.
2848
The fast case for lists was for 4 elements and fewer. By changing
2849
the threshold to 5 elements we get a measurable speedup. I believe
2850
this will help real web pages too, not just the benchmark.
2852
* kjs/list.cpp: Change constant from 4 to 5.
2854
2007-03-19 Darin Adler <darin@apple.com>
2856
* kjs/value.h: Oops, fix build.
2858
2007-03-19 Darin Adler <darin@apple.com>
2862
- remove ~JSValue; tiny low-risk performance boost
2864
* kjs/value.h: Remove unneeded empty virtual destructor from JSValue.
2865
The only class derived from JSValue is JSCell and it already has a
2866
virtual destructor. Declaring an empty constructor in JSValue had one
2867
good effect: it marked the destructor private, making it a compile
2868
time error to try to destroy a JSValue; but that's not a likely
2869
mistake for someone to make. It had two bad effects: (1) it caused gcc,
2870
at least, to generate code to fix up the virtual table pointer to
2871
point to the JSValue version of the virtual table inside the destructor
2872
of all classes derived from JSValue directly or indirectly; (2) it
2873
caused JSValue to be a polymorphic class so required a virtual table for
2874
it. It's cleaner to not have either of those.
2876
2007-03-18 Maciej Stachowiak <mjs@apple.com>
2880
- avoid static construction (and global variable access) in a smarter, more portable way,
2881
to later enable MUTLI_THREAD mode to work on other platforms and compilers.
2883
* kjs/CommonIdentifiers.cpp: Added. New class to hold all the shared identifiers.
2884
(KJS::CommonIdentifiers::CommonIdentifiers):
2885
(KJS::CommonIdentifiers::shared):
2886
* kjs/CommonIdentifiers.h: Added.
2889
(KJS::ExecState::propertyNames): Hand the CommonIdentifiers instance here for easy access.
2890
(KJS::ExecState::ExecState):
2892
* API/JSObjectRef.cpp:
2893
(JSObjectMakeConstructor):
2895
* JavaScriptCore.exp:
2896
* JavaScriptCore.pri:
2897
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2898
* JavaScriptCore.xcodeproj/project.pbxproj:
2899
* JavaScriptCoreSources.bkl:
2900
* bindings/runtime_array.cpp:
2901
(RuntimeArray::getOwnPropertySlot):
2902
(RuntimeArray::put):
2903
* bindings/runtime_method.cpp:
2904
(RuntimeMethod::getOwnPropertySlot):
2905
* kjs/array_object.cpp:
2906
(ArrayInstance::getOwnPropertySlot):
2907
(ArrayInstance::put):
2908
(ArrayInstance::deleteProperty):
2909
(ArrayProtoFunc::ArrayProtoFunc):
2910
(ArrayProtoFunc::callAsFunction):
2911
(ArrayObjectImp::ArrayObjectImp):
2912
* kjs/bool_object.cpp:
2913
(BooleanPrototype::BooleanPrototype):
2914
(BooleanProtoFunc::BooleanProtoFunc):
2915
(BooleanProtoFunc::callAsFunction):
2916
(BooleanObjectImp::BooleanObjectImp):
2918
(KJS::Completion::Completion):
2919
* kjs/date_object.cpp:
2920
(KJS::DateProtoFunc::DateProtoFunc):
2921
(KJS::DateObjectImp::DateObjectImp):
2922
(KJS::DateObjectFuncImp::DateObjectFuncImp):
2923
* kjs/error_object.cpp:
2924
(ErrorPrototype::ErrorPrototype):
2925
(ErrorProtoFunc::ErrorProtoFunc):
2926
(ErrorProtoFunc::callAsFunction):
2927
(ErrorObjectImp::ErrorObjectImp):
2928
(ErrorObjectImp::construct):
2929
(NativeErrorPrototype::NativeErrorPrototype):
2930
(NativeErrorImp::NativeErrorImp):
2931
(NativeErrorImp::construct):
2932
(NativeErrorImp::callAsFunction):
2934
(KJS::FunctionImp::getOwnPropertySlot):
2935
(KJS::FunctionImp::put):
2936
(KJS::FunctionImp::deleteProperty):
2937
(KJS::FunctionImp::getParameterName):
2938
(KJS::DeclaredFunctionImp::construct):
2939
(KJS::IndexToNameMap::unMap):
2940
(KJS::Arguments::Arguments):
2941
(KJS::ActivationImp::getOwnPropertySlot):
2942
(KJS::ActivationImp::deleteProperty):
2943
(KJS::GlobalFuncImp::GlobalFuncImp):
2944
* kjs/function_object.cpp:
2945
(FunctionPrototype::FunctionPrototype):
2946
(FunctionProtoFunc::FunctionProtoFunc):
2947
(FunctionProtoFunc::callAsFunction):
2948
(FunctionObjectImp::FunctionObjectImp):
2949
(FunctionObjectImp::construct):
2951
* kjs/identifier.cpp:
2953
* kjs/interpreter.cpp:
2954
(KJS::Interpreter::init):
2955
(KJS::Interpreter::initGlobalObject):
2956
* kjs/interpreter.h:
2958
* kjs/math_object.cpp:
2959
(MathFuncImp::MathFuncImp):
2961
(ArrayNode::evaluate):
2962
(FuncDeclNode::processFuncDecl):
2963
(FuncExprNode::evaluate):
2964
* kjs/number_object.cpp:
2965
(NumberPrototype::NumberPrototype):
2966
(NumberProtoFunc::NumberProtoFunc):
2967
(NumberObjectImp::NumberObjectImp):
2969
(KJS::JSObject::put):
2970
(KJS::JSObject::defaultValue):
2971
(KJS::JSObject::hasInstance):
2973
(KJS::JSObject::getOwnPropertySlot):
2974
* kjs/object_object.cpp:
2975
(ObjectPrototype::ObjectPrototype):
2976
(ObjectProtoFunc::ObjectProtoFunc):
2977
(ObjectObjectImp::ObjectObjectImp):
2978
* kjs/regexp_object.cpp:
2979
(RegExpPrototype::RegExpPrototype):
2980
(RegExpProtoFunc::RegExpProtoFunc):
2981
(RegExpObjectImp::RegExpObjectImp):
2982
* kjs/string_object.cpp:
2983
(KJS::StringInstance::getOwnPropertySlot):
2984
(KJS::StringInstance::put):
2985
(KJS::StringInstance::deleteProperty):
2986
(KJS::StringPrototype::StringPrototype):
2987
(KJS::StringProtoFunc::StringProtoFunc):
2988
(KJS::StringProtoFunc::callAsFunction):
2989
(KJS::StringObjectImp::StringObjectImp):
2990
(KJS::StringObjectFuncImp::StringObjectFuncImp):
2992
(TestFunctionImp::TestFunctionImp):
2994
2007-03-18 Andrew Wellington <proton@wiretapped.net>
2996
Reviewed by Mark Rowe
2998
Set Xcode editor to use 4 space indentation (http://webkit.org/coding/coding-style.html)
3000
* JavaScriptCore.xcodeproj/project.pbxproj:
3002
2007-03-19 Mark Rowe <mrowe@apple.com>
3004
Rubber-stamped by Brady.
3006
Update references to bugzilla.opendarwin.org with bugs.webkit.org.
3008
* bindings/c/c_utility.cpp:
3009
(KJS::Bindings::convertUTF8ToUTF16):
3011
(KJS::FunctionImp::callAsFunction):
3013
* kjs/keywords.table:
3015
(KJS::Lexer::shift):
3017
2007-03-18 Geoffrey Garen <ggaren@apple.com>
3019
Reviewed by Oliver Hunt.
3021
Exposed some extra toUInt32 functionality, as part of the fix for
3022
REGRESSION: Incomplete document.all implementation breaks abtelectronics.com
3023
(Style Change Through JavaScript Blanks Content)
3025
* JavaScriptCore.exp:
3027
(KJS::Identifier::toUInt32):
3029
2007-03-18 Geoffrey Garen <ggaren@apple.com>
3031
Removed duplicate export name.
3033
* JavaScriptCore.exp:
3035
2007-03-15 Geoffrey Garen <ggaren@apple.com>
3037
Reviewed by Maciej Stachowiak.
3039
Fixed <rdar://problem/5064964> Repro ASSERT failure in JS Bindings when
3040
closing window @ lowtrades.bptrade.com
3042
Unfortunately, the bindings depend on UString and Identifier as string
3043
representations. So, they need to acquire the JSLock when doing something
3044
that will ref/deref their strings.
3046
Layout tests, the original site, and Java, Flash, and Quicktime on the
3047
web work. No leaks reported. No automated test for this because testing
3048
the Java bindings, like math, is hard.
3050
* bindings/runtime.h: Made Noncopyable, just to be sure.
3052
* bindings/c/c_class.cpp:
3053
(KJS::Bindings::CClass::~CClass): Acquire the JSLock and explicitly clear the keys
3054
in our hashtable, since they're UString::Reps, and ref/deref aren't thread-safe.
3055
(KJS::Bindings::CClass::methodsNamed): Also acquire the JSLock when adding
3056
keys to the table, since the table ref's them.
3057
(KJS::Bindings::CClass::fieldNamed): ditto.
3059
* bindings/c/c_utility.cpp: Removed dead function.
3060
(KJS::Bindings::convertValueToNPVariant): Acquire the JSLock because doing
3061
it recursively is pretty cheap, and it's just too confusing to tell whether
3062
all our callers do it for us.
3063
(KJS::Bindings::convertNPVariantToValue): ditto
3064
* bindings/c/c_utility.h:
3066
* bindings/jni/jni_class.cpp: Same deal as c_class.cpp.
3067
(JavaClass::JavaClass):
3068
(JavaClass::~JavaClass):
3070
* bindings/jni/jni_instance.cpp: Same deal as c_utility.cpp.
3071
(JavaInstance::stringValue):
3072
* bindings/jni/jni_jsobject.cpp:
3073
(JavaJSObject::convertValueToJObject):
3075
* bindings/jni/jni_runtime.cpp:
3076
(JavaMethod::~JavaMethod): Moved from header, for clarity.
3077
(appendClassName): Made this static, so the set of callers is known, and
3078
we can assert that we hold the JSLock. Also changed it to take a UString
3079
reference, which makes the calling code simpler.
3080
(JavaMethod::signature): Store the ASCII value we care about instead of
3081
a UString, since UString is so much more hassle. Hold the JSLock while
3082
building up the temporary UString.
3084
* bindings/jni/jni_runtime.h: Nixed dead code in JavaMethod.
3085
(KJS::Bindings::JavaString::JavaString): Hold a UString::Rep instead of
3086
a UString, so we can acquire the JSLock and explicitly release it.
3087
(KJS::Bindings::JavaString::_commonInit):
3088
(KJS::Bindings::JavaString::~JavaString):
3089
(KJS::Bindings::JavaString::UTF8String):
3090
(KJS::Bindings::JavaString::uchars):
3091
(KJS::Bindings::JavaString::length):
3092
(KJS::Bindings::JavaString::ustring):
3094
* bindings/jni/jni_utility.cpp:
3095
(KJS::Bindings::convertArrayInstanceToJavaArray): Made this static, so
3096
the set of callers is known, and we can assert that we hold the JSLock.
3097
(KJS::Bindings::convertValueToJValue): Acquire the JSLock because doing
3098
it recursively is pretty cheap, and it's just too confusing to tell whether
3099
all our callers do it for us.
3101
* bindings/objc/objc_runtime.h: Nixed some dead code.
3102
* bindings/objc/objc_utility.mm:
3103
(KJS::Bindings::convertNSStringToString): Same drill as above.
3105
2007-03-18 Alexey Proskuryakov <ap@webkit.org>
3109
http://bugs.webkit.org/show_bug.cgi?id=13105
3110
REGRESSION: an exception raised when calculating base value of a dot expression is not returned
3112
Test: fast/js/dot-node-base-exception.html
3115
(FunctionCallDotNode::evaluate): Added the necessary KJS_CHECKEXCEPTIONVALUE.
3117
2007-03-18 Steve Falkenburg <sfalken@apple.com>
3121
* JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
3123
2007-03-17 Timothy Hatcher <timothy@apple.com>
3125
Reviewed by Mark Rowe.
3127
Made Version.xcconfig smarter when building for different configurations.
3128
Now uses the 522+ OpenSource version for Debug and Release, while using the
3129
full 522.4 version for Production builds. The system prefix is also computed
3130
based on the current system, so 4522.4 on Tiger and 5522.4 on Leopard.
3132
* Configurations/JavaScriptCore.xcconfig:
3133
* Configurations/Version.xcconfig:
3135
2007-03-15 Maciej Stachowiak <mjs@apple.com>
3141
* wtf/TCSystemAlloc.cpp:
3143
2007-03-15 Maciej Stachowiak <mjs@apple.com>
3145
Reviewed by Geoff and Steve.
3147
- fix some portability issues with TCMalloc.
3149
* JavaScriptCore.vcproj/WTF/WTF.vcproj:
3151
* wtf/FastMalloc.cpp:
3153
(WTF::InitSizeClasses):
3154
(WTF::TCMalloc_PageHeap::Split):
3155
(WTF::TCMalloc_PageHeap::RegisterSizeClass):
3156
(WTF::TCMalloc_Central_FreeList::length):
3157
(WTF::TCMalloc_ThreadCache::InitTSD):
3158
(WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
3160
* wtf/TCSystemAlloc.cpp:
3162
(TCMalloc_SystemAlloc):
3164
2007-03-15 Timothy Hatcher <timothy@apple.com>
3168
* Factored out most of our common build settings into .xcconfig files. Anything that was common in
3169
each build configuration was factored out into the shared .xcconfig file.
3170
* Adds a Version.xcconfig file to define the current framework version, to be used in other places.
3171
* Use the new $(BUNDLE_VERSION) (defined in Version.xcconfig) in the preprocessed Info.plist.
3172
* Use the versions defined in Version.xcconfig to set $(DYLIB_CURRENT_VERSION).
3174
* Configurations/Base.xcconfig: Added.
3175
* Configurations/DebugRelease.xcconfig: Added.
3176
* Configurations/JavaScriptCore.xcconfig: Added.
3177
* Configurations/Version.xcconfig: Added.
3179
* JavaScriptCore.xcodeproj/project.pbxproj:
3181
2007-03-16 Shrikant Gangoda <shrikant.gangoda@celunite.com>
3185
* kjs/DateMath.cpp: gettimeofday comes from <sys/time.h> on Linux.
3187
2007-03-14 Kevin McCullough <kmccullough@apple.com>
3191
- Fixed one more build breakage
3193
* kjs/date_object.cpp:
3194
(KJS::formatLocaleDate):
3196
2007-03-14 Kevin McCullough <kmccullough@apple.com>
3200
- Fixed a build breakage.
3203
* kjs/date_object.cpp:
3204
(KJS::formatLocaleDate):
3205
(KJS::DateObjectImp::construct):
3207
2007-03-14 Kevin McCullough <kmccullough@apple.com>
3211
- rdar://problem/5045720
3212
- DST changes in US affect JavaScript date calculations (12975)
3213
This fix was to ensure we properly test for the new changes to DST in the US.
3214
Also this fixes when we apply DST, now we correctly map most past years to current
3215
DST rules. We still have a small issue with years before 1900 or after 2100.
3216
rdar://problem/5055038
3218
* kjs/DateMath.cpp: Fix DST to match spec better.
3219
(KJS::getCurrentUTCTime):
3220
(KJS::mimimumYearForDST):
3221
(KJS::maximumYearForDST):
3222
(KJS::equivalentYearForDST):
3223
(KJS::getDSTOffset):
3224
* kjs/DateMath.h: Consolodated common funtionality.
3225
* kjs/date_object.cpp: Consolodated common functionality.
3226
(KJS::formatLocaleDate):
3227
(KJS::DateObjectImp::construct):
3228
* tests/mozilla/ecma/jsref.js: Added functions for finding the correct days when DST starts and ends.
3229
* tests/mozilla/ecma/shell.js: Added back in the old DST functions for ease of merging with mozilla if needed.
3230
* tests/mozilla/ecma_2/jsref.js: Added functions for finding the correct days when DST starts and ends.
3231
* tests/mozilla/ecma_3/Date/shell.js: Added functions for finding the correct days when DST starts and ends.
3232
* tests/mozilla/expected.html: Updated to show all date tests passing.
3234
=== Safari-5522.4 ===
3236
2007-03-13 Kevin McCullough <kmccullough@apple.com>
3240
- Adding expected failures until the are truly fixed.
3241
- rdar://problem/5060302
3243
* tests/mozilla/expected.html:
3245
2007-03-12 Kevin McCullough <kmccullough@apple.com>
3249
- Actually update tests for new DST rules.
3251
* tests/mozilla/ecma/Date/15.9.3.1-1.js:
3252
* tests/mozilla/ecma/Date/15.9.3.1-2.js:
3253
* tests/mozilla/ecma/Date/15.9.3.1-3.js:
3254
* tests/mozilla/ecma/Date/15.9.3.1-4.js:
3255
* tests/mozilla/ecma/Date/15.9.3.1-5.js:
3256
* tests/mozilla/ecma/Date/15.9.3.2-1.js:
3257
* tests/mozilla/ecma/Date/15.9.3.2-2.js:
3258
* tests/mozilla/ecma/Date/15.9.3.2-3.js:
3259
* tests/mozilla/ecma/Date/15.9.3.2-4.js:
3260
* tests/mozilla/ecma/Date/15.9.3.2-5.js:
3261
* tests/mozilla/ecma/Date/15.9.3.8-1.js:
3262
* tests/mozilla/ecma/Date/15.9.3.8-2.js:
3263
* tests/mozilla/ecma/Date/15.9.3.8-3.js:
3264
* tests/mozilla/ecma/Date/15.9.3.8-4.js:
3265
* tests/mozilla/ecma/Date/15.9.3.8-5.js:
3266
* tests/mozilla/ecma/Date/15.9.5.10-1.js:
3267
* tests/mozilla/ecma/Date/15.9.5.10-10.js:
3268
* tests/mozilla/ecma/Date/15.9.5.10-11.js:
3269
* tests/mozilla/ecma/Date/15.9.5.10-12.js:
3270
* tests/mozilla/ecma/Date/15.9.5.10-13.js:
3271
* tests/mozilla/ecma/Date/15.9.5.10-2.js:
3272
* tests/mozilla/ecma/Date/15.9.5.10-3.js:
3273
* tests/mozilla/ecma/Date/15.9.5.10-4.js:
3274
* tests/mozilla/ecma/Date/15.9.5.10-5.js:
3275
* tests/mozilla/ecma/Date/15.9.5.10-6.js:
3276
* tests/mozilla/ecma/Date/15.9.5.10-7.js:
3277
* tests/mozilla/ecma/Date/15.9.5.10-8.js:
3278
* tests/mozilla/ecma/Date/15.9.5.10-9.js:
3279
* tests/mozilla/ecma/jsref.js:
3280
* tests/mozilla/ecma_2/jsref.js:
3281
* tests/mozilla/ecma_3/Date/shell.js:
3283
2007-03-12 Kevin McCullough <kmccullough@apple.com>
3287
- Update tests for new DST rules.
3289
* tests/mozilla/ecma/shell.js:
3291
2007-03-11 Geoffrey Garen <ggaren@apple.com>
3293
Reviewed by Oliver Hunt.
3295
Fixed <rdar://problem/4681051> Installer crashes in KJS::Collector::
3296
markOtherThreadConservatively(KJS::Collector::Thread*) trying to install
3297
iLife 06 using Rosetta on an Intel Machine
3299
The problem was that our thread-specific data destructor would modify the
3300
list of active JavaScript threads without holding the JSLock, corrupting
3301
the list. Corruption was especially likely if one JavaScript thread exited
3302
while another was starting up.
3304
* JavaScriptCore.exp:
3305
* kjs/JSLock.cpp: Don't conflate locking the JSLock with registering a
3306
thread, since the thread-specific data destructor needs to lock
3307
without registering a thread. Instead, treat thread registration as a
3308
part of the convenience of the JSLock object, and whittle down JSLock::lock()
3309
to just the bits that actually do the locking.
3310
(KJS::JSLock::lock):
3311
(KJS::JSLock::registerThread):
3312
* kjs/JSLock.h: Updated comments to mention the new behavior above, and
3313
other recent changes.
3314
(KJS::JSLock::JSLock):
3315
* kjs/collector.cpp:
3316
(KJS::destroyRegisteredThread): Lock here.
3317
(KJS::Collector::registerThread): To match, assert that we're locked here.
3319
2007-03-10 Geoffrey Garen <ggaren@apple.com>
3321
Reviewed by Darin Adler.
3323
Fixed <rdar://problem/4587763> PAC file: lock inversion between QT and
3324
JSCore causes a hang @ www.panoramas.dk
3326
With a PAC file, run-webkit-tests --threaded passes, the reported site
3327
works, and all the Quicktime/JavaScript and Flash/JavaScript examples
3328
I found through Google work, too.
3330
Any time JavaScript causes arbitrary non-JavaScript code to execute, it
3331
risks deadlock, because that code may block, trying to acquire a lock
3332
owned by a thread that is waiting to execute JavaScript. In this case,
3333
the thread was a networking thread that was waiting to interpret a PAC file.
3335
Because non-JavaScript code may execute in response to, well, anything,
3336
a perfect solution to this problem is impossible. I've implemented an
3337
optimistic solution, instead: JavaScript will drop its lock whenever it
3338
makes a direct call to non-JavaScript code through a bridging/plug-in API,
3339
but will blissfully ignore the indirect ways it may cause non-JavaScript
3340
code to run (resizing a window, for example).
3342
Unfortunately, this solution introduces significant locking overhead in
3343
the bridging APIs. I don't see a way around that.
3345
This patch includes some distinct bug fixes I saw along the way:
3347
* bindings/objc/objc_instance.mm: Fixed a bug where a nested begin() call
3348
would leak its autorelease pool, because it would NULL out _pool without
3351
* bindings/runtime_object.cpp:
3352
(RuntimeObjectImp::methodGetter): Don't copy an Identifier to ASCII only
3353
to turn around and make an Identifier from the ASCII. In an earlier
3354
version of this patch, the copy caused an assertion failure. Now it's
3355
just unnecessary work.
3356
(RuntimeObjectImp::getOwnPropertySlot): ditto
3358
* bindings/objc/objc_instance.h: Removed overrides of setVAlueOfField and
3359
getValueOfField, because they did exactly what the base class versions did.
3360
Removed overrides of Noncopyable declarations for the same reason.
3362
* bindings/runtime.h: Inherit from Noncopyable instead of rolling our own.
3363
* bindings/c/c_instance.h: ditto
3365
And the actual patch:
3367
* API/JSCallbackConstructor.cpp: Drop all locks when calling out to C.
3368
(KJS::JSCallbackConstructor::construct):
3369
* API/JSCallbackFunction.cpp: ditto
3370
(KJS::JSCallbackFunction::callAsFunction):
3371
* API/JSCallbackObject.cpp: ditto
3372
(KJS::JSCallbackObject::init):
3373
(KJS::JSCallbackObject::~JSCallbackObject):
3374
(KJS::JSCallbackObject::getOwnPropertySlot):
3375
(KJS::JSCallbackObject::put):
3376
(KJS::JSCallbackObject::deleteProperty):
3377
(KJS::JSCallbackObject::construct):
3378
(KJS::JSCallbackObject::hasInstance):
3379
(KJS::JSCallbackObject::callAsFunction):
3380
(KJS::JSCallbackObject::getPropertyNames):
3381
(KJS::JSCallbackObject::toNumber):
3382
(KJS::JSCallbackObject::toString):
3383
(KJS::JSCallbackObject::staticValueGetter):
3384
(KJS::JSCallbackObject::callbackGetter):
3386
* bindings/c/c_instance.cpp: Drop all locks when calling out to C.
3387
(KJS::Bindings::CInstance::invokeMethod):
3388
(KJS::Bindings::CInstance::invokeDefaultMethod):
3389
* bindings/c/c_runtime.cpp: Drop all locks when calling out to C.
3390
(KJS::Bindings::CField::valueFromInstance):
3391
(KJS::Bindings::CField::setValueToInstance):
3392
* bindings/jni/jni_objc.mm:
3393
(KJS::Bindings::dispatchJNICall): Drop all locks when calling out to Java.
3395
* bindings/objc/objc_instance.mm: The changes here are to accomodate the
3396
fact that C++ unwinding of DropAllLocks goes crazy when you put it inside
3397
a @try block. I moved all JavaScript stuff outside of the @try blocks, and
3398
then prefixed the whole blocks with DropAllLocks objects. This required some
3399
supporting changes in other functions, which now acquire the JSLock for
3400
themselves, intead of relying on their callers to do so.
3401
(ObjcInstance::end):
3402
(ObjcInstance::invokeMethod):
3403
(ObjcInstance::invokeDefaultMethod):
3404
(ObjcInstance::setValueOfUndefinedField):
3405
(ObjcInstance::getValueOfUndefinedField):
3406
* bindings/objc/objc_runtime.mm: Same as above, except I didn't want to
3407
change throwError to acquire the JSLock for itself.
3408
(ObjcField::valueFromInstance):
3409
(ObjcField::setValueToInstance):
3410
* bindings/objc/objc_utility.mm: Supporting changes mentioned above.
3411
(KJS::Bindings::convertValueToObjcValue):
3412
(KJS::Bindings::convertObjcValueToValue):
3415
(1) Fixed DropAllLocks to behave as advertised, and drop the JSLock only
3416
if the current thread actually acquired it in the first place. This is
3417
important because WebKit needs to ensure that the JSLock has been
3418
dropped before it makes a plug-in call, even though it doesn't know if
3419
the current thread actually acquired the JSLock. (We don't want WebKit
3420
to accidentally drop a lock belonging to *another thread*.)
3421
(2) Used the new per-thread code written for (1) to make recursive calls
3422
to JSLock very cheap. JSLock now knows to call pthread_mutext_lock/
3423
pthread_mutext_unlock only at nesting level 0.
3424
(KJS::createDidLockJSMutex):
3425
(KJS::JSLock::lock):
3426
(KJS::JSLock::unlock):
3427
(KJS::DropAllLocks::DropAllLocks):
3428
(KJS::DropAllLocks::~DropAllLocks):
3429
(KJS::JSLock::lockCount):
3430
* kjs/JSLock.h: Don't duplicate Noncopyable.
3431
(KJS::JSLock::~JSLock):
3433
* wtf/Assertions.h: Blind attempt at helping the Windows build.
3435
2007-03-08 MorganL <morganl.webkit@yahoo.com>
3439
http://bugs.webkit.org/show_bug.cgi?id=13018
3440
Bug 13018: allow embedders to override the definition of CRASH.
3442
* wtf/Assertions.h: make it possible to override CRASH.
3444
2007-03-07 Anrong Hu <huanr@yahoo.com>
3448
Fix http://bugs.webkit.org/show_bug.cgi?id=12535
3449
Bug 12535: Stack-optimizing compilers can trick GC into freeing in-use objects
3452
(KJS::StringImp::toObject): Copy val onto the stack so it is not subject to garbage collection.
3454
2007-03-07 Geoffrey Garen <ggaren@apple.com>
3456
Build fix for non-multiple-thread folks.
3458
Use a shared global in the non-multiple-thread case.
3460
* wtf/FastMalloc.cpp:
3462
(WTF::fastMallocForbid):
3463
(WTF::fastMallocAllow):
3465
2007-03-07 Geoffrey Garen <ggaren@apple.com>
3467
Reviewed by Darin Adler.
3469
Fixed ASSERT failure I just introduced.
3471
Made the fastMalloc isForbidden flag per thread. (Oops!) We expect that
3472
other threads will malloc while we're marking -- we just want to prevent
3473
our own marking from malloc'ing.
3475
* wtf/FastMalloc.cpp:
3476
(WTF::initializeIsForbiddenKey):
3478
(WTF::fastMallocForbid):
3479
(WTF::fastMallocAllow):
3486
2007-03-07 Shrikant Gangoda <shrikant.gangoda@celunite.com>
3490
http://bugs.webkit.org/show_bug.cgi?id=12997
3492
Wrap pthread-specific assertion in #if USE(MULTIPLE_THREADS).
3494
* kjs/collector.cpp:
3495
(KJS::Collector::markMainThreadOnlyObjects):
3497
2007-03-06 Geoffrey Garen <ggaren@apple.com>
3499
Reviewed by Maciej Stachowiak.
3501
Fixed <rdar://problem/4576242> | http://bugs.webkit.org/show_bug.cgi?id=12586
3502
PAC file: malloc deadlock sometimes causes a hang @ www.apple.com/pro/profiles/ (12586)
3504
This is a modified version of r14752 on the branch.
3506
These changes just add debugging functionality. They ASSERT that we don't
3507
malloc during the mark phase of a garbage collection, which can cause a
3510
* kjs/collector.cpp:
3511
(KJS::Collector::collect):
3512
* wtf/FastMalloc.cpp:
3513
(WTF::fastMallocForbid):
3514
(WTF::fastMallocAllow):
3522
2007-03-06 Geoffrey Garen <ggaren@apple.com>
3524
Reviewed by Maciej Stachowiak.
3526
Fixed all known crashers exposed by run-webkit-tests --threaded. This covers:
3528
<rdar://problem/4565394> | http://bugs.webkit.org/show_bug.cgi?id=12585
3529
PAC file: after closing a window that contains macworld.com, new window
3530
crashes (KJS::PropertyMap::mark()) (12585)
3531
<rdar://problem/4571215> | http://bugs.webkit.org/show_bug.cgi?id=9211
3532
PAC file: Crash occurs when clicking on the navigation tabs at http://www.businessweek.com/ (9211)
3533
<rdar://problem/4557926>
3534
PAC file: Crash occurs when attempting to view image in slideshow mode
3535
at http://d.smugmug.com/gallery/581716 ( KJS::IfNode::execute (KJS::
3536
ExecState*) + 312) if you use a PAC file
3538
(1) Added some missing JSLocks, along with related ASSERTs.
3540
(2) Fully implemented support for objects that can only be garbage collected
3541
on the main thread. So far, only WebCore uses this. We can add it to API
3542
later if we learn that it's needed.
3544
The implementation uses a "main thread only" flag inside each object. When
3545
collecting on a secondary thread, the Collector does an extra pass through
3546
the heap to mark all flagged objects before sweeping. This solution makes
3547
the common case -- flag lots of objects, but never collect on a secondary
3548
thread -- very fast, even though the uncommon case of garbage collecting
3549
on a secondary thread isn't as fast as it could be. I left some notes
3550
about how to speed it up, if we ever care.
3552
For posterity, here are some things I learned about GC while investigating:
3554
* Each collect must either mark or delete every heap object. "Zombie"
3555
objects, which are neither marked nor deleted, raise these issues:
3557
* On the next pass, the conservative marking algorithm might mark a
3558
zombie, causing it to mark freed objects.
3560
* The client might try to use a zombie, which would seem live because
3561
its finalizer had not yet run.
3563
* A collect on the main thread is free to delete any object. Presumably,
3564
objects allocated on secondary threads have thread-safe finalizers.
3566
* A collect on a secondary thread must not delete thread-unsafe objects.
3568
* The mark function must be thread-safe.
3570
Line by line comments:
3572
* API/JSObjectRef.h: Added comment specifying that the finalize callback
3573
may run on any thread.
3575
* JavaScriptCore.exp: Nothing to see here.
3577
* bindings/npruntime.cpp:
3578
(_NPN_GetStringIdentifier): Added JSLock.
3580
* bindings/objc/objc_instance.h:
3581
* bindings/objc/objc_instance.mm:
3582
(ObjcInstance::~ObjcInstance): Use an autorelease pool. The other callers
3583
to CFRelease needed one, too, but they were dead code, so I removed them
3584
instead. (This fixes a leak seen while running run-webkit-tests --threaded,
3585
although I don't think it's specifically a threading issue.)
3587
* kjs/collector.cpp:
3588
(KJS::Collector::collectOnMainThreadOnly): New function. Tells the collector
3589
to collect a value only if it's collecting on the main thread.
3590
(KJS::Collector::markMainThreadOnlyObjects): New function. Scans the heap
3591
for "main thread only" objects and marks them.
3593
* kjs/date_object.cpp:
3594
(KJS::DateObjectImp::DateObjectImp): To make the new ASSERTs happy, allocate
3595
our globals on the heap, avoiding a seemingly unsafe destructor call at
3597
* kjs/function_object.cpp:
3598
(FunctionPrototype::FunctionPrototype): ditto
3600
* kjs/interpreter.cpp:
3601
(KJS::Interpreter::mark): Removed boolean parameter, which was an incomplete
3602
and arguably hackish way to implement markMainThreadOnlyObjects() inside WebCore.
3603
* kjs/interpreter.h:
3605
* kjs/identifier.cpp:
3606
(KJS::identifierTable): Added some ASSERTs to check for thread safety
3609
* kjs/list.cpp: Added some ASSERTs to check for thread safety problems.
3610
(KJS::allocateListImp):
3611
(KJS::List::release):
3612
(KJS::List::append):
3613
(KJS::List::empty): Make the new ASSERTs happy.
3616
(KJS::JSObject::JSObject): "m_destructorIsThreadSafe" => "m_collectOnMainThreadOnly".
3617
I removed the constructor parameter because m_collectOnMainThreadOnly,
3618
like m_marked, is a Collector bit, so only the Collector should set or get it.
3620
* kjs/object_object.cpp:
3621
(ObjectPrototype::ObjectPrototype): Make the ASSERTs happy.
3622
* kjs/regexp_object.cpp:
3623
(RegExpPrototype::RegExpPrototype): ditto
3625
* kjs/ustring.cpp: Added some ASSERTs to check for thread safety problems.
3626
(KJS::UCharReference::ref):
3627
(KJS::UString::Rep::createCopying):
3628
(KJS::UString::Rep::create):
3629
(KJS::UString::Rep::destroy):
3630
(KJS::UString::null): Make the new ASSERTs happy.
3632
(KJS::UString::Rep::ref): Added some ASSERTs to check for thread safety problems.
3633
(KJS::UString::Rep::deref):
3636
(KJS::JSCell::JSCell):
3638
2007-03-06 Geoffrey Garen <ggaren@apple.com>
3640
Reviewed by Maciej Stachowiak.
3642
2% speedup on super accurate JS iBench.
3644
(KJS::Collector::collect): Removed anti-optimization to call
3645
pthread_is_threaded_np() before calling pthread_main_np(). Almost all
3646
apps have more than one thread, so the extra call is actually worse.
3647
Interestingly, even the single-threaded testkjs shows a speed gain
3648
from removing the pthread_is_threaded_np() short-circuit. Not sure why.
3650
2007-03-04 Don Gibson <dgibson77@gmail.com>
3652
Reviewed by Nikolas Zimmermann.
3654
- fix http://bugs.webkit.org/show_bug.cgi?id=12950
3655
Assertions.cpp should not #define macros that are already defined
3657
* wtf/Assertions.cpp: Don't #define WINVER and _WIN32_WINNT if they
3658
are already defined.
3660
2007-03-02 Steve Falkenburg <sfalken@apple.com>
3664
Add unsigned int hash traits (matches existing unsigned long version)
3669
2007-03-02 Adam Roben <aroben@apple.com>
3671
Reviewed by Kevin M.
3673
Try to fix the Qt build.
3676
(KJS::msToGregorianDateTime): Removed unnecessary "struct" keyword.
3677
* kjs/DateMath.h: Moved forward declarations to the top of the file
3678
before they are used.
3679
* kjs/date_object.cpp:
3680
(KJS::formatLocaleDate): Changed to take a const GregorianDateTime&
3681
since GregorianDateTime is Noncopyable.
3683
2007-03-02 Darin Adler <darin@apple.com>
3685
Reviewed by Kevin McCullough.
3687
- fix http://bugs.webkit.org/show_bug.cgi?id=12867
3688
REGRESSION: BenchJS test 7 (dates) is 220% slower than in Safari 2.0.4
3690
* kjs/DateMath.h: Marked GregorianDateTime as noncopyable, since it has a non-trivial
3691
destructor and not the correspoding copy constructor or assignment operator.
3692
Changed the GregorianDateTime constructor to use member initialization syntax.
3693
Fixed the destructor to use the array delete operator, since timeZone is an array.
3696
(KJS::daysInYear): Changed to call isLeapYear so the rule is not repeated twice.
3697
(KJS::getUTCOffset): Added caching on PLATFORM(DARWIN), since we can rely on the
3698
notify_check function and "com.apple.system.timezone" to let us know when the
3701
2007-02-27 Geoffrey Garen <ggaren@apple.com>
3703
Reviewed by Darin Adler.
3705
Follow-up to fixing http://bugs.webkit.org/show_bug.cgi?id=12659 | <rdar://problem/4954306>
3706
JS objects not collected after closing window @ ebay.com/maps.google.com
3708
Changed Interpreter cache of global constructors and prototypes from
3709
ProtectedPtrs to bare, marked pointers. ProtectedPtrs are inefficient,
3710
and they increase the risk of reference cycles. Also, Darin said something
3711
about ProtectedPtrs giving him warts.
3713
Also changed data members to precise types from generic JSObject*'s.
3715
Layout tests and JS tests pass.
3717
* kjs/SavedBuiltins.h:
3718
* kjs/interpreter.cpp:
3719
(KJS::Interpreter::init):
3720
(KJS::Interpreter::~Interpreter):
3721
(KJS::Interpreter::initGlobalObject): Moved Identifier::init() call to
3722
constructor, for clarity.
3723
(KJS::Interpreter::mark):
3724
* kjs/interpreter.h:
3726
2007-02-27 Geoffrey Garen <ggaren@apple.com>
3728
Reviewed by Maciej Stachowiak.
3730
Fixed http://bugs.webkit.org/show_bug.cgi?id=12659 | <rdar://problem/4954306>
3731
JS objects not collected after closing window @ ebay.com/maps.google.com
3733
Don't GC in the Interpreter destructor. For that to work, the Interpreter
3734
would have to NULL out all of its ProtectedPtrs before calling collect(). But
3735
we've decided that we don't want things to work that way, anyway. We want the
3736
client to be in charge of manual GC so that it can optimize cases when
3737
it will be destroying many interpreters at once
3738
(e.g., http://bugs.webkit.org/show_bug.cgi?id=12900).
3740
Also removed Interpreter::collect() because it was redundant with
3741
Collector::collect().
3743
* JavaScriptCore.exp:
3744
* kjs/interpreter.cpp:
3745
(KJS::Interpreter::~Interpreter):
3747
(TestFunctionImp::callAsFunction):
3749
2007-02-26 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
3751
Reviewed by Adam Roben.
3753
Rename *_SUPPORT defines to ENABLE_*.
3757
2007-02-26 Maciej Stachowiak <mjs@apple.com>
3761
- <rdar://problem/5021698> Disable experimental SVG features (12883)
3763
* wtf/Platform.h: Add ENABLE() macro similar to HAVE() and USE(), to
3764
allow nicer handling of optional WebKit features.
3766
2007-02-22 George Staikos <staikos@kde.org>
3772
* wtf/unicode/qt4/UnicodeQt4.h:
3773
(WTF::Unicode::toLower):
3774
(WTF::Unicode::toUpper):
3776
2007-02-22 Oscar Cwajbaum <public@oscarc.net>
3780
Fix ARM-specific alignment problem in FastMalloc
3781
http://bugs.webkit.org/show_bug.cgi?id=12841
3783
* wtf/FastMalloc.cpp:
3784
Modify how pageheap_memory is declared to ensure proper alignment
3785
on architectures such as ARM
3787
2007-02-20 Zack Rusin <zrusin@trolltech.com>
3791
Make sure that non-void methods always return something.
3793
* wtf/unicode/qt4/UnicodeQt4.h:
3794
(WTF::Unicode::toLower):
3795
(WTF::Unicode::toUpper):
3796
(WTF::Unicode::foldCase):
3798
2007-02-18 Kevin Ollivier <kevino@theolliviers.com>
3800
Reviewed by Adam Roben.
3802
Fix cases where MSVC-specific code was identified as Win32 platform
3803
code. (as it should be compiled for e.g. wx port when using MSVC too)
3807
* wtf/StringExtras.h:
3808
changed PLATFORM(WIN) sections to COMPILER(MSVC) as necessary
3810
2007-02-17 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
3812
Reviewed by Adam Roben.
3814
Fix crashes on ARM due to different struct packing. Based on a patch
3816
* kjs/ustring.cpp: compile-time assert to make sure sizeof(UChar) == 2
3817
* kjs/ustring.h: pack UChar struct to ensure that sizeof(UChar) == 2
3818
* wtf/Assertions.h: add COMPILE_ASSERT macro for compile-time assertions
3820
2007-02-16 George Staikos <staikos@kde.org>
3824
Fix uninitialized variable
3826
* bindings/testbindings.cpp:
3829
2007-02-16 Anders Carlsson <acarlsson@apple.com>
3833
http://bugs.webkit.org/show_bug.cgi?id=12788
3834
REGRESSION: Going back one page in history has a noticeable delay
3836
Um...if all elements in two vectors are equal, then I guess we could say that
3837
the two vectors are equal too.
3842
2007-02-14 Anders Carlsson <acarlsson@apple.com>
3846
Add new canCompareWithMemcmp vector trait and use it to determine whether
3847
operator== can use memcmp.
3851
(WTF::VectorTypeOperations::compare):
3853
* wtf/VectorTraits.h:
3856
2007-02-13 Brady Eidson <beidson@apple.com>
3860
Tweaked vector a bit
3865
2007-02-13 Dex Deacon <occupant4@gmail.com>
3869
- fix for http://bugs.webkit.org/show_bug.cgi?id=12750
3870
Vector operator== was not defined correctly. It returned void,
3871
did not accept const Vectors, and used an int instead of size_t.
3873
* wtf/Vector.h: fixed comparison operators
3877
2007-02-10 David Carson <dacarson@gmail.com>
3881
- fix for http://bugs.webkit.org/show_bug.cgi?id=12636
3882
Corrected the generation of method signatures when the parameter
3884
Added support for converting a Javascript array to a Java array.
3886
* bindings/jni/jni_utility.h: added new type for array, array_type
3887
* bindings/jni/jni_runtime.cpp: add support for new array type
3888
(JavaField::valueFromInstance):
3889
(JavaField::setValueToInstance):
3890
(JavaMethod::JavaMethod):
3891
(JavaMethod::signature):
3892
* bindings/jni/jni_utility.cpp: add support for new array type
3893
(KJS::Bindings::callJNIMethod):
3894
(KJS::Bindings::callJNIStaticMethod):
3895
(KJS::Bindings::callJNIMethodIDA):
3896
(KJS::Bindings::JNITypeFromClassName):
3897
(KJS::Bindings::signatureFromPrimitiveType):
3898
(KJS::Bindings::JNITypeFromPrimitiveType):
3899
(KJS::Bindings::getJNIField):
3900
(KJS::Bindings::convertArrayInstanceToJavaArray): new method
3901
converts the Javascript array to the requested Java array.
3902
(KJS::Bindings::convertValueToJValue):
3904
2007-02-08 Anders Carlsson <acarlsson@apple.com>
3908
<rdar://problem/4930614>
3909
Safari complains about "Slow Script" if GMail is left open and machine is busy
3911
<rdar://problem/4649516>
3912
Turn off slow script dialog or crank up time that makes it come up
3914
<rdar://problem/4963589>
3915
Slow script warning is displayed after closing of PROMPT or PRINT dialog
3917
Re-do the way script timeouts are handled. No longer use a unix timer that sends signals. Instead, add a
3918
tick count and increment it in loop bodies. If the tick count reaches a threshold, do a timeout check. If the total time executing
3919
is higher than the timeout value, (possibly) interrupt the script. The timeout checker also adjusts the threshold dynamically
3920
to prevent doing the timeout check too often.
3922
* JavaScriptCore.exp:
3923
Remove pause and resume calls.
3925
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3928
* kjs/interpreter.cpp:
3929
(KJS::Interpreter::init):
3930
(KJS::Interpreter::~Interpreter):
3931
(KJS::Interpreter::startTimeoutCheck):
3932
(KJS::Interpreter::stopTimeoutCheck):
3933
(KJS::Interpreter::resetTimeoutCheck):
3934
(KJS::getCurrentTime):
3935
(KJS::Interpreter::checkTimeout):
3936
* kjs/interpreter.h:
3937
(KJS::Interpreter::timedOut):
3939
(DoWhileNode::execute):
3940
(WhileNode::execute):
3943
2007-02-07 Darin Adler <darin@apple.com>
3945
* JavaScriptCore.vcproj/JavaScriptCore.sln: Reenable testkjs.
3947
2007-02-07 Darin Adler <darin@apple.com>
3951
- another build fix; this time for sure
3953
* pcre/pcre_exec.c: (match):
3954
The compiler caught an incorrect use of the othercase variable across
3955
a call to RMATCH in character repeat processing. Local variables can
3956
change in the crazy NO_RECURSE mode that we use, so we instead need
3957
the value in othercase to be in one of the special stack frame variables.
3958
Added a new stack frame variable for this purpose named repeat_othercase.
3959
Also noted a similar error in the non-UTF-16 side of the #ifdef, but
3960
didn't try to fix that one. Also removed a SUPPORT_UCP #ifdef from the
3961
PCRE_UTF16 side; that code doesn't work without the Unicde properties
3962
table, and we don't try to use it that way.
3964
2007-02-06 Steve Falkenburg <sfalken@apple.com>
3966
Disable testkjs in sln until we figure out mysterious compiler warning.
3968
* JavaScriptCore.vcproj/JavaScriptCore.sln:
3970
2007-02-06 Steve Falkenburg <sfalken@apple.com>
3977
2007-02-06 Darin Adler <darin@apple.com>
3981
- fix <rdar://problem/4979089> PCRE should avoid setjmp/longjmp even when compiler
3984
Added a new code path that's slower and way uglier but doesn't rely on GCC's
3987
* pcre/pcre_exec.c: Added a numeric parameter to the RMATCH function. It must be
3988
different at every RMATCH call site. Changed the non-GCC NO_RECURSE version of
3989
the macro to use a label incorporating the number. Changed the RRETURN macro to
3990
use a goto instead of longjmp.
3991
(match): Added a different number at each callsite, using a perl script for the
3992
first-time task. Going forward it should be easy to maintain by hand. Added a
3993
switch statement at the bottom of the function. We'll get compile time errors
3994
if we have anything in the switch statement that's never used in an RMATCH,
3995
but errors in the other direction are silent except at runtime.
3997
2007-02-06 Darin Adler <darin@apple.com>
4001
- fix <rdar://problem/4687840> 9A241: JavaScript RegExp 25-30x slower than on 10.4.7
4003
I used Shark to figure out what to do. The test case is now 15% faster than with
4004
stock Safari. Some other regular expression cases might still be a few % slower
4005
than before, but the >10x slowdown is now completely gone.
4007
1) Fix slowness caused by setjmp/longjmp by using computed goto instead.
4009
Use GCC extensions - locally declared labels, labels as values, and computed goto -
4010
instead of using setjmp/longjmp to implemement non-recursive version of the regular
4011
expression system. We could probably make this even faster if we reduced the use
4012
of malloc a bit too.
4014
2) Fix slowness caused by allocating heapframe objects by allocating the first
4015
16 of them from the stack.
4017
3) Speed up use of malloc and free in PCRE by making it use fastMalloc and fastFree.
4019
4) Speed up the test case by adding a special case to a UString function.
4021
5) Made a small improvement to the innermost hottest loop of match by hoisting
4022
the conversion from int to pcre_uchar out of the loop.
4024
* JavaScriptCore.xcodeproj/project.pbxproj: Compile FastMallocPCRE.cpp, and don't
4025
compile pcre_globals.c.
4027
* wtf/FastMallocPCRE.cpp: Added. A copy of pcre_globals.c that uses FastMalloc.h.
4028
This is better than code that sets the PCRE allocation globals because by doing it
4029
this way there's guaranteed to be no problem with order of initialization.
4031
* kjs/ustring.cpp: (KJS::UString::spliceSubstringsWithSeparators): Add a fast
4032
special case when this is called for only one subrange and no seaprators. This
4033
was happening a lot in the test case and it seems quite reasonable to optimize this.
4035
* pcre/pcre_exec.c: Create a copy of the RMATCH and RRETURN macros that use goto
4036
instead of setjmp/longjmp. Change code that calls pcre_stack_malloc to first use
4037
storage on the stack inside the match function.
4038
(match): Move initialization of utf8 up a couple lines to avoid "possibly used
4039
uninitialized" warning. Use a local variable so we compare with pcre_uchar instead
4040
of with int inside the inner "find a character" loop.
4042
2007-02-03 George Staikos <staikos@kde.org>
4046
-1 is not a valid point. We can't handle anything > 0xffff anyway.
4047
Fixes crash on cases like eval("x");
4049
* wtf/unicode/qt4/UnicodeQt4.h:
4050
(WTF::Unicode::category):
4052
2007-02-02 Darin Adler <darin@apple.com>
4056
- fix copying and assigning a ListHashSet
4058
No test because the code path with bugs I am fixing is not used yet.
4060
* wtf/ListHashSet.h: Tweaked ListHashSetNodeAllocator a little bit for clarity.
4061
Changed m_allocator to be an OwnPtr instead of doing an explicit delete.
4062
Fixed bug in copy constructor where we'd have an uninitialized m_allocator.
4063
Fixed bug in assignment operator where it would swap only the hash table, and
4064
not the head, tail, and allocator pointers.
4066
2007-02-02 Geoffrey Garen <ggaren@apple.com>
4068
Reviewed by Maciej Stachowiak.
4070
Use WTFLog instead of fprintf for logging KJS::Node leaks.
4073
(NodeCounter::~NodeCounter): Changed count to unsigned, updated
4074
to match style guidelines.
4076
2007-02-02 Maciej Stachowiak <mjs@apple.com>
4078
- not reviewed, build fix
4080
* wtf/ListHashSet.h:
4081
(WTF::ListHashSetNodeAllocator::ListHashSetNodeAllocator): ummm, use union correctly
4083
2007-02-01 Maciej Stachowiak <mjs@apple.com>
4087
- use a custom allocator for ListHashSet, to fix ~1% perf regression using it for form control
4089
* wtf/ListHashSet.h:
4090
(WTF::ListHashSetNodeAllocator::ListHashSetNodeAllocator):
4091
(WTF::ListHashSetNodeAllocator::allocate):
4092
(WTF::ListHashSetNodeAllocator::deallocate):
4093
(WTF::ListHashSetNode::operator new):
4094
(WTF::ListHashSetNode::operator delete):
4095
(WTF::ListHashSetNode::destroy):
4096
(WTF::ListHashSetTranslator::translate):
4097
(WTF::::ListHashSet):
4098
(WTF::::~ListHashSet):
4100
(WTF::::unlinkAndDelete):
4101
(WTF::::deleteAllNodes):
4103
2007-01-31 Maciej Stachowiak <mjs@apple.com>
4107
- fix sporadic crash
4109
* wtf/ListHashSet.h:
4110
(WTF::::remove): remove before deleting
4112
2007-01-31 Maciej Stachowiak <mjs@apple.com>
4114
Reviewed by Mark with help from Lars.
4116
- added new ListHashSet class, which combines a hashtable and a linked list to provide a set
4117
that keeps elements in inserted order
4119
This is to assist in fixing the following:
4120
<rdar://problem/4751164> REGRESSION: Safari places text on incorrect button when returning to a page via back [10541]
4121
http://bugs.webkit.org/show_bug.cgi?id=10541
4123
* JavaScriptCore.vcproj/WTF/WTF.vcproj:
4124
* JavaScriptCore.xcodeproj/project.pbxproj:
4126
(WTF::HashTable::find):
4127
(WTF::HashTable::contains):
4130
* wtf/ListHashSet.h: Added.
4131
(WTF::ListHashSetNode::ListHashSetNode):
4132
(WTF::ListHashSetNodeHashFunctions::hash):
4133
(WTF::ListHashSetNodeHashFunctions::equal):
4134
(WTF::ListHashSetIterator::ListHashSetIterator):
4135
(WTF::ListHashSetIterator::get):
4136
(WTF::ListHashSetIterator::operator*):
4137
(WTF::ListHashSetIterator::operator->):
4138
(WTF::ListHashSetIterator::operator++):
4139
(WTF::ListHashSetIterator::operator--):
4140
(WTF::ListHashSetIterator::operator==):
4141
(WTF::ListHashSetIterator::operator!=):
4142
(WTF::ListHashSetIterator::operator const_iterator):
4143
(WTF::ListHashSetIterator::node):
4144
(WTF::ListHashSetConstIterator::ListHashSetConstIterator):
4145
(WTF::ListHashSetConstIterator::get):
4146
(WTF::ListHashSetConstIterator::operator*):
4147
(WTF::ListHashSetConstIterator::operator->):
4148
(WTF::ListHashSetConstIterator::operator++):
4149
(WTF::ListHashSetConstIterator::operator--):
4150
(WTF::ListHashSetConstIterator::operator==):
4151
(WTF::ListHashSetConstIterator::operator!=):
4152
(WTF::ListHashSetConstIterator::node):
4153
(WTF::ListHashSetTranslator::hash):
4154
(WTF::ListHashSetTranslator::equal):
4155
(WTF::ListHashSetTranslator::translate):
4156
(WTF::::ListHashSet):
4158
(WTF::::~ListHashSet):
4169
(WTF::::unlinkAndDelete):
4170
(WTF::::appendNode):
4171
(WTF::::deleteAllNodes):
4172
(WTF::::makeIterator):
4173
(WTF::::makeConstIterator):
4174
(WTF::deleteAllValues):
4176
2007-01-30 Darin Adler <darin@apple.com>
4178
* kjs/DateMath.cpp: Fix license header to reflect LGPL as the first license
4179
mentioned. We still mention the option of using under MPL or GPL since some
4180
of this code came from the Mozilla project with those license terms.
4182
2007-01-30 Simon Hausmann <hausmann@kde.org>
4186
Turned JavaScriptCore from a separate library into an includable
4187
project, to combine it all into libWebKitQt.
4189
* JavaScriptCore.pri: Added.
4190
* JavaScriptCore.pro: Removed.
4193
2007-01-29 Geoffrey Garen <ggaren@apple.com>
4195
Reviewed by Maciej Stachowiak.
4197
Fixed <rdar://problem/4485644> REGRESSION: JavaScriptCore has init routines
4199
The TCMalloc module now initializes, if needed, inside GetCache() and
4200
fastMallocSetIsMultiThreaded(). We leverage the same synchronization
4201
technique used for enabling / disabling the single-threaded optimization
4202
to synchronize initialization of the library without requiring a lock
4205
1,251 runs of tcmalloc_unittest, 2 runs of a custom, massively multi-threaded
4206
tcmalloc_unittest, and my custom version of the PLT show no regressions.
4207
Super-accurate JS iBench reports a .24% regression, which is right at the
4208
limit of its error range, so I'm declaring victory.
4210
* wtf/FastMalloc.cpp:
4211
(WTF::fastMallocSetIsMultiThreaded): Initialize, if needed. (InitModule()
4212
checks the "if needed" part.)
4213
(WTF::TCMalloc_ThreadCache::GetCache): Restored original TCMalloc code
4214
inside #ifdef, for posterity. Added new initialization logic.
4215
(WTF::TCMalloc_ThreadCache::InitModule): Call InitTSD(), since we don't
4216
have a static initializer to call it for us, now. This means that fastMalloc
4217
is not usable as a general libc allocator, but it never was, and if it were
4218
the general libc allocator, we wouldn't be here in the first place, so whatever.
4219
(WTF::TCMalloc_ThreadCache::InitTSD): Don't try to take the pageheap_lock,
4220
since InitModule already has it.
4222
2007-01-29 Kevin McCullough <KMcCullough@apple.com>
4224
Reviewed by Geoff and Oliver.
4226
- rdar://problem/4955561
4227
- missusing JavaScript shouldn't crash webkit. Now it doesn't, in this case.
4229
* bindings/objc/objc_runtime.mm:
4230
(ObjcFallbackObjectImp::callAsFunction):
4231
* bindings/runtime_method.cpp:
4232
(RuntimeMethod::callAsFunction):
4233
* bindings/runtime_object.cpp:
4234
(RuntimeObjectImp::callAsFunction):
4236
2007-01-28 Geoffrey Garen <ggaren@apple.com>
4238
Reviewed by Maciej Stachowiak.
4240
First step in fixing <rdar://problem/4485644> REGRESSION: JavaScriptCore
4243
Don't rely on a static initializer to store the main thread's ID (which
4244
we would use to detect allocations on secondary threads). Instead, require
4245
the caller to notify fastMalloc if it might allocate on a secondary thread.
4247
Also fixed what seemed like a race condition in do_malloc.
4249
tcmalloc_unittest and my custom versions of JS iBench and PLT show no
4252
* wtf/FastMalloc.cpp:
4253
(WTF::fastMallocSetIsMultiThreaded):
4254
(1) Renamed from "fastMallocRegisterThread", which was a misleading name because
4255
not all threads need to register with fastMalloc -- only secondary threads
4256
need to, and only for the purpose of disabling its single-threaded optimization.
4258
(2) Use the pageheap_lock instead of a custom one, since we need to synchronize
4259
with the read of isMultiThreaded inside CreateCacheIfNecessary. This is a new
4260
requirement, now that we can't guarantee that the first call to CreateCacheIfNecessary
4261
will occur on the main thread at init time, before any other threads have been created.
4263
(WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
4264
(WTF::do_malloc): Reverted WTF change only to call GetCache() if size <= kMaxSize.
4265
The WTF code would read phinited without holding the pageheap_lock, which
4266
seemed like a race condition. Regardless, calling GetCache reduces the number
4267
of code paths to module initialization, which will help in writing the
4268
final fix for this bug.
4270
2007-01-28 David Kilzer <ddkilzer@webkit.org>
4274
- fix http://bugs.webkit.org/show_bug.cgi?id=9815
4275
JavaScript TypeError loading Dean Edwards' JS compressor/obfuscator
4277
Creating a function using 'new Function()' was not setting its prototype with the
4278
same flags as 'function() { }'.
4280
Test: fast/js/function-prototype.html
4282
* kjs/function_object.cpp:
4283
(FunctionObjectImp::construct): Change flags from DontEnum|DontDelete|ReadOnly to
4284
Internal|DontDelete to match FuncDeclNode::processFuncDecl() and
4285
FuncExprNode::evaluate() in kjs/nodes.cpp.
4287
2007-01-27 Geoffrey Garen <ggaren@apple.com>
4289
Reviewed by Beth Dakin.
4291
Added some missing JSLocks, which might fix <rdar://problem/4889707>.
4293
We need to lock whenever we might allocate memory because our FastMalloc
4294
implementation requires clients to register their threads, which we do
4297
We also need to lock whenever modifying ref-counts because they're not
4300
* API/JSObjectRef.cpp:
4301
(JSClassCreate): Allocates memory
4302
(JSClassRetain): Modifies a ref-count
4303
(JSClassRelease): Modifies a ref-count
4304
(JSPropertyNameArrayRetain): Modifies a ref-count
4305
(JSPropertyNameArrayRelease): Modifies a ref-count
4306
* API/JSStringRef.cpp:
4307
(JSStringRetain): Modifies a ref-count
4308
* API/JSValueRef.cpp:
4309
(JSValueIsInstanceOfConstructor): Might allocate memory if an exception
4312
2007-01-27 Lars Knoll <lars@trolltech.com>
4316
* bindings/qt/qt_instance.h:
4318
2007-01-25 Geoffrey Garen <ggaren@apple.com>
4320
Reviewed by Maciej Stachowiak.
4322
Fixed <rdar://problem/4608404> WebScriptObject's _rootObject lack
4323
of ownership policy causes crashes (e.g., in Dashcode)
4325
The old model for RootObject ownership was either to (1) leak them or (2) assign
4326
them to a single owner -- the WebCore::Frame -- which would destroy them
4327
when it believed that all of its plug-ins had unloaded.
4329
This model was broken because of (1) and also because plug-ins are not the only
4330
RootObject clients. All Bindings clients are RootObjects clients, including
4331
applications, which outlive any particular WebCore::Frame.
4333
The new model for RootObject ownership is to reference-count them, with a
4334
throw-back to the old model: The WebCore::Frame tracks the RootObjects
4335
it creates, and invalidates them when it believes that all of its plug-ins
4338
We maintain this throw-back to avoid plug-in leaks, particularly from Java.
4339
Java is completely broken when it comes to releasing JavaScript objects.
4340
Comments in our code allege that Java does not always call finalize when
4341
collecting objects. Moreoever, my own testing reveals that, when Java does
4342
notify JavaScript of a finalize, the data it provides is totally bogus.
4344
This setup is far from ideal, but I don't think we can do better without
4345
completely rewriting the bindings code, and possibly part of the Java
4348
Layout tests pass. No additional leaks reported. WebCore/manual-tests/*liveconnect*
4349
and a few LiveConnect demos on the web also run without a hitch.
4351
const RootObject* => RootObject*, since we need to ref/deref
4353
* bindings/NP_jsobject.cpp:
4354
(jsDeallocate): deref our RootObjects. Also unprotect or JSObject, instead
4355
of just relying on the RootObject to do it for us when it's invalidated.
4356
(_isSafeScript): Check RootObject validity.
4357
(_NPN_CreateScriptObject): ditto
4358
(_NPN_Invoke): ditto
4359
(_NPN_Evaluate): ditto
4360
(_NPN_GetProperty): ditto
4361
(_NPN_SetProperty): ditto
4362
(_NPN_RemoveProperty): ditto
4363
(_NPN_HasProperty): ditto
4364
(_NPN_HasMethod): ditto
4365
(_NPN_SetException): ditto
4367
* bindings/runtime_root.cpp:
4368
Revived bit-rotted LIAR LIAR LIAR comment.
4370
LOOK: Added support for invalidating RootObjects without deleting them,
4371
which is the main goal of this patch.
4373
Moved protect counting into the RootObject class, to emphasize that
4374
the RootObject protects the JSObject, and unprotects it upon being invalidated.
4375
addNativeReference => RootObject::gcProtect
4376
removeNativeReference => RootObject::gcUnprotect
4377
ProtectCountSet::contains => RootObject::gcIsProtected
4379
I know we'll all be sad to see the word "native" go.
4381
* bindings/runtime_root.h: Added ref-counting support to RootObject, with
4382
all the standard accoutrements.
4384
* bindings/c/c_utility.cpp:
4385
(KJS::Bindings::convertValueToNPVariant): If we can't find a valid RootObject,
4386
return void instead of just leaking.
4388
* bindings/jni/jni_instance.cpp:
4389
(JavaInstance::JavaInstance): Don't take a RootObject in our constructor;
4390
be like other Instances and require the caller to call setRootObject. This
4391
reduces the number of ownership code paths.
4392
(JavaInstance::invokeMethod): Check RootObject for validity.
4393
* bindings/jni/jni_instance.h: Removed private no-arg constructor. Having
4394
an arg constructor accomplishes the same thing.
4396
* bindings/jni/jni_jsobject.cpp:
4397
(JavaJSObject::invoke): No need to call findProtectCountSet, because finalize()
4398
checks for RootObject validity.
4399
(JavaJSObject::JavaJSObject): check RootObject for validity
4400
(JavaJSObject::call): ditto
4401
(JavaJSObject::eval): ditto
4402
(JavaJSObject::getMember): ditto
4403
(JavaJSObject::setMember): ditto
4404
(JavaJSObject::removeMember): ditto
4405
(JavaJSObject::getSlot): ditto
4406
(JavaJSObject::setSlot): ditto
4407
(JavaJSObject::toString): ditto
4408
(JavaJSObject::finalize): ditto
4409
(JavaJSObject::createNative): No need to tell the RootObject to protect
4410
the global object, since the RootObject already owns the interpreter.
4412
* bindings/jni/jni_runtime.cpp:
4413
(JavaArray::JavaArray): Removed copy construcutor becaue it was unused.
4414
Dead code is dangerous code.
4416
* bindings/objc/objc_runtime.mm: Added WebUndefined protocol. Previous use
4417
of WebScriptObject was bogus, because WebUndefined is not a subclass of
4419
(convertValueToObjcObject): If we can't find a valid RootObject,
4420
return nil instead of just leaking.
4422
* bindings/objc/objc_utility.mm:
4423
(KJS::Bindings::convertValueToObjcValue): If we can't find a valid RootObject,
4424
return nil instead of just leaking.
4426
2007-01-27 Andrew Wellington <proton@wiretapped.net>
4430
Fix for Repeated string concatenation results in OOM crash
4431
http://bugs.webkit.org/show_bug.cgi?id=11131
4433
* kjs/operations.cpp:
4434
(KJS::add): Throw exception if string addition result is null
4436
(KJS::UString::UString): Don't call memcpy when malloc failed
4438
2007-01-25 Jan Kraemer <camel@gmx.de>
4442
Fix for http://bugs.webkit.org/show_bug.cgi?id=12382
4444
Fix crash on architectures with 32 bit ints and
4445
64 bit longs (For example Linux on AMD64)
4447
* kjs/dtoa.cpp: #define Long int as suggested in comment
4449
2007-01-24 Geoffrey Garen <ggaren@apple.com>
4451
Fixed up #include order for style. No review necessary.
4453
* API/JSStringRef.cpp:
4455
2007-01-24 Geoffrey Garen <ggaren@apple.com>
4457
Reviewed by Maciej Stachowiak.
4459
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
4460
Copy JSStringRefCF, in case anybody wants to use it. (I just added
4463
2007-01-24 Maciej Stachowiak <mjs@apple.com>
4465
Not reviewed, trivial property change.
4467
* JavaScriptCore.vcproj/JavaScriptCore.sln: remove svn:mime-type
4468
property which made this binary.
4470
2007-01-25 Mark Rowe <mrowe@apple.com>
4474
* Info.plist: Update copyright string.
4476
2007-01-24 Darin Adler <darin@apple.com>
4478
Reviewed by Mark Rowe.
4480
* JavaScriptCore.xcodeproj/project.pbxproj: Changed to /usr/sbin/sysctl
4481
so we don't rely on people's paths.
4483
2007-01-23 Alice Liu <alice.liu@apple.com>
4487
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
4490
2007-01-23 Geoffrey Garen <ggaren@apple.com>
4494
* API/JSStringRef.h:
4495
* JavaScriptCore.xcodeproj/project.pbxproj:
4497
2007-01-24 Mark Rowe <mrowe@apple.com>
4499
Build fix for DumpRenderTree.
4501
* JavaScriptCore.xcodeproj/project.pbxproj: Make JSStringRefCF.h public so it's copied into built framework.
4503
2007-01-23 Anders Carlsson <acarlsson@apple.com>
4507
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
4510
2007-01-23 Geoffrey Garen <ggaren@apple.com>
4512
Reviewed by Maciej Stachowiak.
4514
Fixed <rdar://problem/4885131> Move CFString function declarations from
4515
JSStringRef.h to JSStringRefCF.h
4517
Also removed remaining API FIXMEs and changed them into Radars.
4519
* API/JSClassRef.cpp:
4520
(OpaqueJSClass::OpaqueJSClass): Added Radar numbers for UTF8 conversion.
4522
* API/JSContextRef.cpp:
4523
(JSGlobalContextCreate): Replaced FIXME for NULL JSContextRef with Radar number.
4525
* API/JSObjectRef.h: Removed FIXME, which is unprofessional in a public header.
4527
* API/JSStringRef.cpp: Moved CF related implementations to JSStringRefCF.cpp.
4528
(JSStringCreateWithUTF8CString): Replaced FIXME with Radar number.
4529
* API/JSStringRef.h: Moved CF related declarations to JSStringRefCF.h. Added
4530
#include of JSStringRefCF.h as a stopgap until clients start #including
4531
it as needed by themselves.
4533
* API/JSStringRefCF.cpp: Added.
4534
(JSStringCreateWithCFString):
4535
(JSStringCopyCFString): Replaced JSChar cast with UniChar cast, which is
4536
more appropriate for a CF call.
4537
* API/JSStringRefCF.h: Added.
4538
* JavaScriptCore.xcodeproj/project.pbxproj:
4540
2007-01-18 Sanjay Madhav <sanjay12@gmail.com>
4544
Add JavaScriptCore define to help with tracing of when objects are marked.
4547
(KJS::JSObject::mark):
4549
2007-01-18 Simon Hausmann <hausmann@kde.org>
4553
* JavaScriptCore.pro: Remove generated files on make clean.
4556
2007-01-16 Alexey Proskuryakov <ap@webkit.org>
4560
http://bugs.webkit.org/show_bug.cgi?id=12268
4561
Give object prototypes their own names
4563
* kjs/lookup.h: Append "Prototype" to ClassName in KJS_IMPLEMENT_PROTOTYPE.
4565
2007-01-16 Geoffrey Garen <ggaren@apple.com>
4567
Reviewed by Darin Adler.
4569
Added re-entrency checking to GC allocation and collection. It is an error
4570
to allocate or collect from within a collection. We've had at least one
4571
case of each bug in the past.
4573
Added a comment to the API header, explaining that API clients must not
4574
make this mistake, either.
4576
Layout tests and JS tests pass.
4578
* API/JSObjectRef.h:
4579
* kjs/collector.cpp:
4580
(KJS::GCLock::GCLock):
4581
(KJS::GCLock::~GCLock):
4582
(KJS::Collector::allocate):
4583
(KJS::Collector::collect):
4585
2007-01-14 Mark Rowe <mrowe@apple.com>
4589
Minor fixes to JavaScript pretty-printing.
4591
* JavaScriptCore.exp:
4593
(KJS::Parser::prettyPrint): Return line number and error message if parsing fails.
4595
* kjs/nodes2string.cpp:
4596
(ElementNode::streamTo): Include comma delimiters in array literals.
4597
(PropertyNameNode::streamTo): Quote property names in object literals to handle the case when the property name is not a valid identifier.
4599
(doIt): Print any errors encountered while pretty-printing.
4601
2007-01-12 Anders Carlsson <acarlsson@apple.com>
4606
Add hash traits for unsigned long and unsigned long long.
4608
2007-01-12 Geoffrey Garen <ggaren@apple.com>
4612
Rolling back in r18786 with leaks fixed, and these renames slightly reworked:
4614
Because they can return 0:
4615
rootObjectForImp => findRootObject (overloaded for JSObject* and Interpreter*)
4616
rootObjectForInterpreter => findRootObject (ditto)
4617
findReferenceSet => findProtectCountSet
4619
2007-01-11 Geoffrey Garen <ggaren@apple.com>
4623
Rolling out r18786 because it caused leaks.
4625
2007-01-11 Geoffrey Garen <ggaren@apple.com>
4627
Reviewed by Anders Carlsson.
4629
Even more cleanup in preparation for fixing <rdar://problem/4608404>
4630
WebScriptObject's _executionContext lack of ownership policy causes
4631
crashes (e.g., in Dashcode)
4636
ReferencesSet | ProtectCounts => ProtectCountSet (because it's a typename for a set of GC protect counts)
4637
ReferencesByRootMap => RootObjectMap (because RootObjectToProtectCountSetMap would have been confusing)
4638
pv => protectedValues
4639
rootObjectForImp => getRootObject (overloaded for JSObject* and Interpreter*)
4640
rootObjectForInterpreter => getRootObject (ditto)
4641
findReferenceSet => getProtectCountSet
4644
(KJS::Bindings::getRootObjectMap): Changed to take advantage of built-in
4645
facility for initializing static variables.
4647
(KJS::Bindings::getProtectCountSet):
4648
(KJS::Bindings::destroyProtectCountSet): Added. Helps encapsulate the fact
4649
that getting a ProtectCountSet entails adding a RootObject to a hash table,
4650
and destroying one entails the reverse.
4652
(KJS::Bindings::getRootObject): Removed spurious NULL check.
4654
(KJS::Bindings::findReferenceSet): Renamed. Changed to use getRootObject()
4655
instead of iterating on its own.
4657
(KJS::Bindings::addNativeReference): Changed to use an early return instead
4658
of indenting the whole function.
4659
(KJS::Bindings::removeNativeReference): Ditto.
4661
2007-01-11 Geoffrey Garen <ggaren@apple.com>
4663
Reviewed by Anders Carlsson.
4665
Even more cleanup in preparation for fixing <rdar://problem/4608404>
4666
WebScriptObject's _executionContext lack of ownership policy causes
4667
crashes (e.g., in Dashcode)
4672
findRootObjectForNativeHandleFunction => createRootObject
4673
FindRootObjectForNativeHandleFunctionPtr => CreateRootObjectFunction
4675
Also removed unnecessary use of "Bindings::" prefix.
4677
* JavaScriptCore.exp:
4678
* bindings/jni/jni_jsobject.cpp:
4679
(JavaJSObject::createNative):
4680
(JavaJSObject::convertValueToJObject):
4681
(JavaJSObject::convertJObjectToValue):
4682
* bindings/runtime_root.cpp:
4683
(KJS::Bindings::RootObject::setCreateRootObject):
4684
* bindings/runtime_root.h:
4685
(KJS::Bindings::RootObject::createRootObject):
4687
2007-01-11 George Staikos <staikos@kde.org>
4691
Appears to be Mac specific right now.
4695
2007-01-10 Lars Knoll <lars@trolltech.com>
4699
Use the new functionality in Qt 4.3, to make
4700
the methods closer compliant with the Unicode
4703
Keep the old code so that it still compiles against
4706
* wtf/unicode/qt4/UnicodeQt4.h:
4707
(WTF::Unicode::toLower):
4708
(WTF::Unicode::toUpper):
4709
(WTF::Unicode::toTitleCase):
4710
(WTF::Unicode::foldCase):
4711
(WTF::Unicode::isFormatChar):
4712
(WTF::Unicode::isPrintableChar):
4713
(WTF::Unicode::isSeparatorSpace):
4714
(WTF::Unicode::isPunct):
4715
(WTF::Unicode::isDigit):
4716
(WTF::Unicode::isLower):
4717
(WTF::Unicode::isUpper):
4718
(WTF::Unicode::digitValue):
4719
(WTF::Unicode::mirroredChar):
4720
(WTF::Unicode::combiningClass):
4721
(WTF::Unicode::decompositionType):
4722
(WTF::Unicode::umemcasecmp):
4723
(WTF::Unicode::direction):
4724
(WTF::Unicode::category):
4726
2007-01-09 Darin Adler <darin@apple.com>
4728
- update 2007 Apple copyright for the new company name
4732
2007-01-09 Darin Adler <darin@apple.com>
4736
* kjs/string_object.cpp: (KJS::StringProtoFunc::callAsFunction):
4737
Actually compile it this time.
4739
2007-01-09 Darin Adler <darin@apple.com>
4743
* kjs/string_object.cpp: (KJS::StringProtoFunc::callAsFunction):
4746
2007-01-09 Darin Adler <darin@apple.com>
4748
- fix build on platforms where Unicode::UChar is != uint16_t
4750
* kjs/string_object.cpp: (KJS::StringProtoFunc::callAsFunction):
4753
2007-01-09 Mitz Pettel <mitz@webkit.org>
4757
- changes for http://bugs.webkit.org/show_bug.cgi?id=11078
4758
Forms Don't Submit (ASP Pages)
4760
* JavaScriptCore.exp:
4762
(KJS::JSValue::toInt32): Folded toInt32Inline into this method, which was its
4764
(KJS::JSValue::toUInt32): Added a variant that reports if the conversion has
4768
2007-01-09 Darin Adler <darin@apple.com>
4772
- fix http://bugs.webkit.org/show_bug.cgi?id=12174
4773
improve Unicode use (less WTF::Unicode:: prefix, centralized character names)
4775
* wtf/unicode/icu/UnicodeIcu.h: Change parameter and return types
4776
to UChar32 and UChar. Removed unneeded type casts and added some
4777
const to functions that lacked it. Removed WTF::Unicode::memcmp.
4778
(WTF::Unicode::umemcasecmp): Renamed from strcasecmp since this
4779
doesn't work on 0-terminated strings as the str functions do.
4780
* wtf/unicode/qt4/UnicodeQt4.h: Ditto.
4782
- got rid of namespace prefixes from most uses of WTF::Unicode
4785
(KJS::isStrWhiteSpace):
4786
(KJS::escapeStringForPrettyPrinting):
4788
(KJS::Lexer::isWhiteSpace):
4789
(KJS::Lexer::isIdentStart):
4790
(KJS::Lexer::isIdentPart):
4791
* kjs/string_object.cpp:
4792
(KJS::StringProtoFunc::callAsFunction):
4794
2007-01-07 David Kilzer <ddkilzer@webkit.org>
4798
- fix http://bugs.webkit.org/show_bug.cgi?id=11917
4799
setlocale() can return null
4801
* kjs/date_object.cpp:
4802
(KJS::DateProtoFunc::callAsFunction): Removed dead code.
4804
2007-01-07 David Carson <dacarson@gmail.com>
4808
- fix http://bugs.webkit.org/show_bug.cgi?id=12100
4809
JNI bindings should be available to non-Mac platforms that have JNI
4811
Change JNI so that it is not wrapped in the PLATFORM(MAC) ifdef, enabling
4812
other platforms who have JNI to use it.
4814
* bindings/jni/jni_instance.h:
4815
Removed unnecessary include of <CoreFoundation/CoreFoundation.h>
4816
* bindings/jni/jni_utility.cpp:
4817
(KJS::Bindings::setJavaVM):
4818
* bindings/jni/jni_utility.h:
4819
Added new method for clients to set the JavaVM
4820
* bindings/runtime.cpp:
4821
(KJS::Bindings::Instance::createBindingForLanguageInstance):
4822
Changed code to utilize new #if HAVE(JNI)
4824
Added new #define for JNI, ie HAVE_JNI
4826
2007-01-07 David Carson <dacarson@gmail.com>
4830
Fix http://bugs.webkit.org/show_bug.cgi?id=11431
4831
ARM platform has some byte alignment issues
4833
Fix for NaN being 4 bytes and it must start on a byte boundary
4834
for ARM architectures.
4839
2007-01-04 David Kilzer <ddkilzer@webkit.org>
4841
Reviewed by Kevin McCullough.
4843
- fix http://bugs.webkit.org/show_bug.cgi?id=12070
4844
REGRESSION: KJS::getUTCOffset() caches UTC offset but ignores time zone changes
4847
(KJS::getUTCOffset): Don't cache UTC offset.
4849
2007-01-02 Darin Adler <darin@apple.com>
4851
- minor tweak (hope this doesn't re-break Windows)
4853
* pcre/pcre_compile.c: Removed use of const pcre_uchar const * -- Mitz probably
4854
meant const pcre_uchar *const, but I think we can do without the explicit const here.
4856
* pcre/pcre_internal.h: Re-enabled warning C4114.
4858
2007-01-02 David Kilzer <ddkilzer@webkit.org>
4860
Reviewed by NOBODY (Windows build fix).
4862
The MSVC compiler requires variables to be declared at the top of the enclosing block in C source.
4864
Disable this warning to prevent MSVC from complaining about the 'const pcre_uchar const *' type:
4865
warning C4114: same type qualifier used more than once
4867
* pcre/pcre_compile.c:
4868
(pcre_compile2): Moved variable declarations to top of their respective enclosing blocks.
4869
* pcre/pcre_internal.h: Added pragma to disable compiler warning.
4871
2007-01-01 Mitz Pettel <mitz@webkit.org>
4875
- fix http://bugs.webkit.org/show_bug.cgi?id=11849
4876
REGRESSION (r18182): Google Calendar is broken (a regular expression containing a null character is not parsed correctly)
4878
Modified pcre_compile() (and the functions that it calls) to work with patterns
4879
containing null characters.
4881
Covered by JavaScriptCore tests ecma_3/RegExp/octal-002.js and ecma_3/RegExp/regress-85721.js
4884
(KJS::RegExp::RegExp): Changed to not null-terminate the pattern string and instead
4885
pass its length to pcre_compile.
4887
* pcre/pcre_compile.c:
4890
(is_counted_repeat):
4891
(check_posix_syntax):
4894
(pcre_compile): Added a parameter specifying the length of the pattern, which
4895
is no longer required to be null-terminated and may contain null characters.
4897
* pcre/pcre_internal.h:
4898
* tests/mozilla/expected.html: Updated for the two tests that this patch
4899
fixes. Also updated failing results for ecma_3/RegExp/regress-100199.js
4900
which were not updated after bug 6257 was fixed.
4902
2007-01-01 David Kilzer <ddkilzer@webkit.org>
4906
- fix http://bugs.webkit.org/show_bug.cgi?id=12057
4907
REGRESSION: JavaScript Date Is One Day In The Future in GMT time zone
4909
Because Mac OS X returns geographically and historically accurate time zone information,
4910
converting Jan 02, 1970 12:00:00 AM to local time then subtracting 24 hours did not work
4911
in GMT (London - England) since it was in BST (+0100) all year in 1970[1]. Instead, the
4912
UTC offset is calculated by converting Jan 01, 2000 12:00:00 AM to local time then
4913
subtracting that from the same date in UTC.
4915
[1] http://en.wikipedia.org/wiki/British_Summer_Time
4918
(KJS::getUTCOffset): Updated UTC offset calculation.
4919
(KJS::getDSTOffset): Improved comment.
4921
2006-12-31 David Kilzer <ddkilzer@webkit.org>
4925
Update embedded pcre library from version 6.2 to 6.4. Changes from pcre 6.2 to 6.3
4926
did not include any files in JavaScriptCore/pcre.
4928
All changes include renaming EXPORT to PCRE_EXPORT, renaming of ucp_findchar() to
4929
_pcre_ucp_findchar(), or comment changes. Additional changes noted below.
4931
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Updated source file list.
4932
* JavaScriptCore.xcodeproj/project.pbxproj: Renamed pcre_printint.c to pcre_printint.src
4933
and changed it from a source file to a header file.
4934
* JavaScriptCoreSources.bkl: Updated source file list.
4935
* pcre/CMakeLists.txt: Updated source file list.
4936
* pcre/pcre-config.h:
4937
* pcre/pcre.h: Updated version.
4938
* pcre/pcre.pri: Updated source file list.
4939
* pcre/pcre_compile.c: Include pcre_printint.src #if DEBUG.
4941
* pcre/pcre_config.c:
4944
* pcre/pcre_fullinfo.c:
4946
* pcre/pcre_internal.h: Added header guard. Removed export of _pcre_printint().
4947
* pcre/pcre_ord2utf8.c:
4948
* pcre/pcre_printint.c: Renamed to pcre_printint.src.
4949
* pcre/pcre_printint.src: Added. Renamed _pcre_printint() to pcre_printint().
4950
* pcre/pcre_refcount.c:
4951
* pcre/pcre_study.c:
4952
* pcre/pcre_tables.c:
4953
* pcre/pcre_try_flipped.c:
4954
* pcre/pcre_ucp_findchar.c: Added contents of ucp_findchar.c.
4955
* pcre/pcre_version.c:
4956
* pcre/pcre_xclass.c:
4958
* pcre/ucp.h: Removed export of ucp_findchar().
4959
* pcre/ucp_findchar.c: Removed. Contents moved to pcre_ucp_findchar.c.
4961
2006-12-29 David Kilzer <ddkilzer@webkit.org>
4965
Update embedded pcre library from version 6.1 to 6.2. From the pcre ChangeLog:
4967
3. Added "b" to the 2nd argument of fopen() in dftables.c, for non-Unix-like
4968
operating environments where this matters.
4970
5. Named capturing subpatterns were not being correctly counted when a pattern
4971
was compiled. This caused two problems: (a) If there were more than 100
4972
such subpatterns, the calculation of the memory needed for the whole
4973
compiled pattern went wrong, leading to an overflow error. (b) Numerical
4974
back references of the form \12, where the number was greater than 9, were
4975
not recognized as back references, even though there were sufficient
4976
previous subpatterns.
4978
* pcre/dftables.c: Item 3.
4980
* pcre/pcre.h: Updated version.
4981
* pcre/pcre_compile.c: Item 5.
4982
(read_repeat_counts):
4985
2006-12-29 Geoffrey Garen <ggaren@apple.com>
4987
Reviewed by Brian Dash... err... Mark Rowe.
4989
More cleanup in preparation for fixing <rdar://problem/4608404>
4990
WebScriptObject's _executionContext lack of ownership policy causes
4991
crashes (e.g., in Dashcode)
4993
The key change here is to RootObject::RootObject().
4995
* JavaScriptCore.exp:
4997
* bindings/c/c_utility.cpp:
4998
(KJS::Bindings::convertValueToNPVariant): Changed to use new constructor.
5000
* bindings/jni/jni_jsobject.cpp:
5001
(JavaJSObject::createNative): Changed to use new constructor. Replaced
5002
large 'if' followed by default condition with "if !" and explicit default
5005
* bindings/objc/objc_runtime.mm:
5006
(convertValueToObjcObject): Changed to use new constructor.
5008
* bindings/runtime_root.cpp:
5009
(KJS::Bindings::RootObject::destroy): "removeAllNativeReferences" => "destroy"
5010
because this function actually destroys the RootObject.
5012
* bindings/runtime_root.h: Changed Interpreter* to RefPtr<Interpreter>
5013
to prevent a RootObject from holding a stale Interperter*.
5015
(KJS::Bindings::RootObject::RootObject): Changed constructor to take an
5016
Interpreter*, since it's pointless to create a RootObject without one.
5017
Removed setRootObjectImp() and rootObjectImp() because they were just
5018
a confusing way of setting and getting the Interpreter's global object.
5020
(KJS::Bindings::RootObject::nativeHandle): "_nativeHandle" => "m_nativeHandle"
5021
(KJS::Bindings::RootObject::interpreter): "_interpreter" => "m_interpreter"
5023
2006-12-28 George Staikos <staikos@kde.org>
5027
* bindings/qt/qt_instance.cpp: build
5028
(KJS::Bindings::QtInstance::QtInstance):
5030
2006-12-28 Geoffrey Garen <ggaren@apple.com>
5032
Reviewed by Oliver Hunt.
5034
More cleanup. Layout tests pass.
5036
Use a helper function to initialize and access WebUndefined and WebScriptObject.
5038
* bindings/objc/objc_runtime.h:
5039
* bindings/objc/objc_runtime.mm:
5040
(KJS::Bindings::webScriptObjectClass):
5041
(KJS::Bindings::webUndefinedClass):
5042
(convertValueToObjcObject):
5043
* bindings/objc/objc_utility.mm:
5044
(KJS::Bindings::convertValueToObjcValue):
5045
(KJS::Bindings::convertObjcValueToValue):
5047
2006-12-28 Geoffrey Garen <ggaren@apple.com>
5049
Reviewed by Brady Eidson.
5051
Some cleanup in preparation for fixing <rdar://problem/4608404>
5052
WebScriptObject's _executionContext lack of ownership policy causes
5053
crashes (e.g., in Dashcode)
5055
I'm just trying to make heads or tails of this baffling code.
5057
Renamed "root" | "execContext" | "executionContext" => "rootObject", because
5058
that's the object's (admittedly vague) type name.
5060
* bindings/runtime.cpp: Removed createLanguageInstanceForValue
5061
because I'll give you a dollar if you can explain to me what it actually did.
5063
* bindings/runtime_root.cpp: Put everything in the KJS::Bindings namespace,
5064
removing the KJS::Bindings prefix from individual functions and datatypes.
5065
This matches the header and eliminates a lot of syntax cruft.
5067
* bindings/c/c_utility.cpp:
5068
(KJS::Bindings::convertValueToNPVariant): Replaced use of createLanguageInstanceForValue
5069
with call to _NPN_CreateScriptObject because that's what createLanguageInstanceForValue
5070
actually did (but don't ask me for that dollar now; that's cheating.)
5072
* bindings/objc/objc_utility.h:
5073
* bindings/objc/objc_utility.mm:
5074
(KJS::Bindings::convertValueToObjcValue): Removed. Its only purpose was
5075
to call a single function for WebKit, which WebKit can do on its own.
5077
* kjs/interpreter.h: Removed rtti() because it was unused, and this class
5078
is scheduled for demolition anyway.
5080
* kjs/interpreter.cpp: Removed createLanguageInstanceForValue because it had
5081
nothing to do with the Interpreter, and nothing makes Chuck Norris more mad
5082
than a function whose sole purpose is to call another function of the same
5083
name. (Really, I asked him.)
5085
2006-12-26 Geoffrey Garen <ggaren@apple.com>
5087
Reviewed by Eric Seidel.
5089
Some cleanup in preparation for fixing <rdar://problem/4740328> Safari
5090
crash on quit in _NPN_ReleaseObject from KJS::Bindings::CInstance::~CInstance
5092
* bindings/c/c_instance.cpp:
5093
* bindings/c/c_instance.h: Removed unused copy constructor and assignment
5094
operator. They made tracking data flow more difficult. Unused code is also
5095
dangerous because it can succumb to bit rot with the stealth of a Ninja.
5097
Replaced #include with forward declaration to reduce header dependency.
5099
* bindings/npruntime.cpp: Sorted #includes.
5100
(_NPN_GetStringIdentifier): Replaced assert with ASSERT.
5101
(_NPN_GetStringIdentifiers): ditto
5102
(_NPN_ReleaseVariantValue): ditto
5103
(_NPN_CreateObject): ditto
5104
(_NPN_RetainObject): ditto
5105
(_NPN_ReleaseObject): ditto
5106
(_NPN_DeallocateObject): ditto
5108
2006-12-20 Anders Carlsson <acarlsson@apple.com>
5110
* kjs/string_object.cpp:
5112
Another speculative Win32 fix.
5114
2006-12-20 Anders Carlsson <acarlsson@apple.com>
5116
* kjs/string_object.cpp:
5118
Speculative Win32 fix.
5120
2006-12-20 Anders Carlsson <acarlsson@apple.com>
5124
<rdar://problem/4235733>
5125
<http://bugs.webkit.org/?show_bug.cgi?id=10193>
5126
support String.localeCompare.
5128
Implement localeCompare.
5130
* JavaScriptCore.xcodeproj/project.pbxproj:
5131
* kjs/string_object.cpp:
5133
(StringProtoFunc::callAsFunction):
5134
* kjs/string_object.h:
5135
(KJS::StringProtoFunc::):
5137
2006-12-20 Timothy Hatcher <timothy@apple.com>
5139
Reviewed by Mark Rowe.
5141
* JavaScriptCore.xcodeproj/project.pbxproj: use GCC 4.0 for all the other test targets
5143
2006-12-20 Timothy Hatcher <timothy@apple.com>
5145
Reviewed by Mark Rowe.
5147
<rdar://problem/4871613> JavaScriptCore-421.31's dftables target needs to override default compiler and use gcc-4.0
5149
* JavaScriptCore.xcodeproj/project.pbxproj:
5151
2006-12-20 Lars Knoll <lars@trolltech.com>
5153
Reviewed by David Hyatt
5155
Added support to bind QObject's to
5158
* JavaScriptCore.pro:
5159
* bindings/qt/qt_class.cpp: Added.
5160
(KJS::Bindings::QtClass::QtClass):
5161
(KJS::Bindings::QtClass::~QtClass):
5162
(KJS::Bindings::QtClass::classForObject):
5163
(KJS::Bindings::QtClass::name):
5164
(KJS::Bindings::QtClass::methodsNamed):
5165
(KJS::Bindings::QtClass::fieldNamed):
5166
* bindings/qt/qt_class.h: Added.
5167
(KJS::Bindings::QtClass::constructorAt):
5168
(KJS::Bindings::QtClass::numConstructors):
5169
* bindings/qt/qt_instance.cpp: Added.
5170
(KJS::Bindings::QtInstance::QtInstance):
5171
(KJS::Bindings::QtInstance::~QtInstance):
5172
(KJS::Bindings::QtInstance::operator=):
5173
(KJS::Bindings::QtInstance::getClass):
5174
(KJS::Bindings::QtInstance::begin):
5175
(KJS::Bindings::QtInstance::end):
5176
(KJS::Bindings::QtInstance::implementsCall):
5177
(KJS::Bindings::QtInstance::invokeMethod):
5178
(KJS::Bindings::QtInstance::invokeDefaultMethod):
5179
(KJS::Bindings::QtInstance::defaultValue):
5180
(KJS::Bindings::QtInstance::stringValue):
5181
(KJS::Bindings::QtInstance::numberValue):
5182
(KJS::Bindings::QtInstance::booleanValue):
5183
(KJS::Bindings::QtInstance::valueOf):
5184
* bindings/qt/qt_instance.h: Added.
5185
(KJS::Bindings::QtInstance::getObject):
5186
* bindings/qt/qt_runtime.cpp: Added.
5187
(KJS::Bindings::convertValueToQVariant):
5188
(KJS::Bindings::convertQVariantToValue):
5189
(KJS::Bindings::QtField::name):
5190
(KJS::Bindings::QtField::valueFromInstance):
5191
(KJS::Bindings::QtField::setValueToInstance):
5192
* bindings/qt/qt_runtime.h: Added.
5193
(KJS::Bindings::QtField::QtField):
5194
(KJS::Bindings::QtField::type):
5195
(KJS::Bindings::QtMethod::QtMethod):
5196
(KJS::Bindings::QtMethod::name):
5197
(KJS::Bindings::QtMethod::numParameters):
5198
* bindings/runtime.cpp:
5199
(KJS::Bindings::Instance::createBindingForLanguageInstance):
5200
* bindings/runtime.h:
5201
(KJS::Bindings::Instance::):
5202
* bindings/testbindings.pro: Added.
5203
* bindings/testqtbindings.cpp: Added.
5204
(MyObject::MyObject):
5205
(MyObject::setTestString):
5206
(MyObject::setTestInt):
5207
(MyObject::testString):
5208
(MyObject::testInt):
5210
(Global::className):
5213
2006-12-19 Anders Carlsson <acarlsson@apple.com>
5217
Add -p option to testkjs which pretty prints the files instead of executing them.
5219
* JavaScriptCore.exp:
5220
* JavaScriptCore.xcodeproj/project.pbxproj:
5222
(KJS::Parser::prettyPrint):
5227
2006-12-19 Brady Eidson <beidson@apple.com>
5229
Rubberstamped by Lou
5231
Removed unneccessary "else"
5233
* wtf/Assertions.cpp:
5235
2006-12-19 Timothy Hatcher <timothy@apple.com>
5239
<rdar://problem/4891774> Local WebCore/WebBrowser builds fail in 9A328 due to warning about ObjC-2.0 language features
5241
* JavaScriptCore.xcodeproj/project.pbxproj:
5243
2006-12-17 Simon Hausmann <hausmann@kde.org>
5247
* kjs/testkjs.pro: Oops, make it also build on machines other than
5250
2006-12-17 Simon Hausmann <hausmann@kde.org>
5252
Reviewed by Rob Buis.
5254
* kjs/testkjs.pro: Added .pro file to build testkjs.
5256
2006-12-16 Alexey Proskuryakov <ap@webkit.org>
5260
A deleted object was accessed to prepare RegExp construction error messages.
5262
* kjs/regexp_object.cpp:
5263
(RegExpObjectImp::construct): Wrap the RegExp into an OwnPtr.
5265
2006-12-16 Mitz Pettel <mitz@webkit.org>
5269
- fix http://bugs.webkit.org/show_bug.cgi?id=11814
5270
REGRESSION(r18098): Find does not work with capital letters
5272
Test: editing/execCommand/findString-3.html
5274
* wtf/unicode/icu/UnicodeIcu.h:
5275
(WTF::Unicode::foldCase): Changed to not return an error if the result fits
5276
in the buffer without a null terminator.
5278
2006-12-13 Maciej Stachowiak <mjs@apple.com>
5282
- added equality and inequality operations for HashMap and Vector, useful for comparing more complex types
5291
2006-12-12 Alexey Proskuryakov <ap@webkit.org>
5293
Reviewed by Geoff. Based on a patch by Maks Orlovich.
5295
http://bugs.webkit.org/show_bug.cgi?id=6257
5296
Throw errors on invalid expressions (KJS merge)
5299
(KJS::RegExp::RegExp):
5300
(KJS::RegExp::~RegExp):
5301
(KJS::RegExp::match):
5303
(KJS::RegExp::flags):
5304
(KJS::RegExp::isValid):
5305
(KJS::RegExp::errorMessage):
5306
(KJS::RegExp::subPatterns):
5307
Remember and report RegExp construction failures. Renamed data members not to start with underscores.
5309
* kjs/regexp_object.cpp:
5310
(RegExpObjectImp::construct): Raise an exception if RegExp construction fails.
5311
(RegExpObjectImp::callAsFunction): Removed an obsolete comment.
5313
* tests/mozilla/ecma_3/RegExp/regress-119909.js: Reduced the number of nested parentheses to
5314
a value supported by PCRE.
5316
2006-12-11 Alexey Proskuryakov <ap@webkit.org>
5320
http://bugs.webkit.org/show_bug.cgi?id=9673
5321
Add support for window.atob() and window.btoa()
5323
* JavaScriptCore.exp: Export UString::is8Bit().
5324
* JavaScriptCore.xcodeproj/project.pbxproj: Added StringExtras.h as
5327
2006-12-11 Darin Adler <darin@apple.com>
5331
* JavaScriptCore.xcodeproj/project.pbxproj: Let Xcode update this
5332
(I think Hyatt is using an old Xcode).
5334
2006-12-11 David Hyatt <hyatt@apple.com>
5336
Fix the failing layout test. Just remove Unicode::isSpace and
5337
revert StringImpl to do the same thing it was doing before.
5341
* wtf/unicode/icu/UnicodeIcu.h:
5342
* wtf/unicode/qt4/UnicodeQt4.h:
5344
2006-12-09 George Staikos <staikos@kde.org>
5348
Fix bison again on qmake build.
5350
* JavaScriptCore.pro:
5352
2006-12-09 Lars Knoll <lars@trolltech.com>
5356
Make it possible to build WebKit with qmake.
5358
* JavaScriptCore.pro: Added.
5359
* kjs/kjs.pro: Removed.
5360
* pcre/pcre.pri: Added.
5362
2006-12-09 Zack Rusin <zack@kde.org>
5364
Fixing the compilation with platform kde after the icu changes.
5368
2006-12-09 Adam Roben <aroben@apple.com>
5372
Some updates in reaction to r18098.
5374
* wtf/unicode/icu/UnicodeIcu.h: Use !! to convert UBool to bool in all
5376
(WTF::Unicode::toLower):
5377
(WTF::Unicode::toUpper):
5378
(WTF::Unicode::isDigit):
5379
(WTF::Unicode::isSpace):
5380
(WTF::Unicode::isPunct):
5381
(WTF::Unicode::isLower):
5382
(WTF::Unicode::isUpper):
5383
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
5384
* JavaScriptCore.vcproj/WTF/WTF.vcproj:
5386
2006-12-09 George Staikos <staikos@kde.org>
5388
Patch by Lars Knoll, comment out ICU dependency on Qt platform (unused code).
5392
* bindings/c/c_utility.cpp:
5393
(KJS::Bindings::convertUTF8ToUTF16):
5395
2006-12-08 David Hyatt <hyatt@apple.com>
5397
Land the new ICU abstraction layer. Patch by Lars.
5401
* JavaScriptCore.xcodeproj/project.pbxproj:
5403
* wtf/unicode/UnicodeCategory.h: Removed.
5404
* wtf/unicode/UnicodeDecomposition.h: Removed.
5405
* wtf/unicode/UnicodeDirection.h: Removed.
5406
* wtf/unicode/icu/UnicodeIcu.h:
5408
(WTF::Unicode::foldCase):
5409
(WTF::Unicode::toLower):
5410
(WTF::Unicode::toUpper):
5411
(WTF::Unicode::toTitleCase):
5412
(WTF::Unicode::isDigit):
5413
(WTF::Unicode::isSpace):
5414
(WTF::Unicode::isPunct):
5415
(WTF::Unicode::mirroredChar):
5416
(WTF::Unicode::category):
5417
(WTF::Unicode::direction):
5418
(WTF::Unicode::isLower):
5419
(WTF::Unicode::isUpper):
5420
(WTF::Unicode::digitValue):
5421
(WTF::Unicode::combiningClass):
5422
(WTF::Unicode::decompositionType):
5423
(WTF::Unicode::strcasecmp):
5424
(WTF::Unicode::memset):
5425
* wtf/unicode/qt4/UnicodeQt4.cpp: Removed.
5426
* wtf/unicode/qt4/UnicodeQt4.h:
5428
(WTF::Unicode::toLower):
5429
(WTF::Unicode::toUpper):
5430
(WTF::Unicode::toTitleCase):
5431
(WTF::Unicode::foldCase):
5432
(WTF::Unicode::isPrintableChar):
5433
(WTF::Unicode::isLower):
5434
(WTF::Unicode::isUpper):
5435
(WTF::Unicode::digitValue):
5436
(WTF::Unicode::combiningClass):
5437
(WTF::Unicode::decompositionType):
5438
(WTF::Unicode::strcasecmp):
5439
(WTF::Unicode::memset):
5440
(WTF::Unicode::direction):
5441
(WTF::Unicode::category):
5443
=== Safari-521.32 ===
5445
2006-12-08 Adam Roben <aroben@apple.com>
5449
This is a mo' better fix for ensuring we don't use macro definitions
5455
2006-12-07 Kevin Fyure <digdog@macports.org>
5459
http://bugs.webkit.org/show_bug.cgi?id=11545
5460
Disable the testcases do not follow the ECMA-262v3 specification.
5462
* tests/mozilla/expected.html: Update Results.
5463
* tests/mozilla/js1_2/String/concat.js:
5464
4 tests disabled. The result of concat Array object is not followinig
5466
* tests/mozilla/js1_2/function/Number.js:
5467
1 test disabled. The result of Array object to Number object conversion
5468
is not following ECMA 9.3. And the test was duplicated in
5469
ecma/TypeConversion/9.3-1.js
5470
* tests/mozilla/js1_2/function/String.js:
5471
2 tests disabled. The result of Object/Array object to String object
5472
conversion is not following ECMA 15.5.1.1 and ECMA 9.8
5474
2006-11-30 Steve Falkenburg <sfalken@apple.com>
5478
Move WTF from JavaScriptCore project into a new WTF project.
5480
* JavaScriptCore.vcproj/JavaScriptCore.sln: Add WTF.vcproj to sln
5481
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Remove WTF source files
5482
* JavaScriptCore.vcproj/WTF/WTF.vcproj: Added.
5483
* JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Add dependency on WTF.lib
5485
2006-11-30 Geoffrey Garen <ggaren@apple.com>
5487
Reviewed by Beth Dakin.
5489
Fixed up garbage collection at window close time.
5491
* kjs/interpreter.cpp:
5492
(KJS::Interpreter::~Interpreter): Garbage collect here, since
5493
destroying the interpreter frees the global object and
5494
therefore creates a lot of garbage.
5496
2006-11-20 W. Andy Carrel <wac@google.com>
5500
http://bugs.webkit.org/show_bug.cgi?id=11501
5501
REGRESSION: \u no longer escapes metacharacters in RegExps
5502
http://bugs.webkit.org/show_bug.cgi?id=11502
5503
Serializing RegExps doesn't preserve Unicode escapes
5509
(Lexer::scanRegExp):
5510
Push \u parsing back down into the RegExp object rather than in the
5511
parser. This backs out r17354 in favor of a new fix that better
5512
matches the behavior of other browsers.
5516
(KJS::RegExp::RegExp):
5517
(KJS::sanitizePattern):
5520
(KJS::convertUnicode):
5522
Translate \u escaped unicode characters for the benefit of pcre.
5525
(KJS::UString::append):
5526
Fix failure to increment length on the first UChar appended to a
5527
UString that was copy-on-write.
5529
* tests/mozilla/ecma_2/RegExp/properties-001.js:
5530
Adjust tests back to the uniform standards.
5532
2006-11-20 Samuel Weinig <sam@webkit.org>
5536
Fix for http://bugs.webkit.org/show_bug.cgi?id=11647
5539
* kjs/config.h: define NOMINMAX instead of min/max
5541
* wtf/Vector.h: put back hack to ensure that min/max
5542
are not defined as macros.
5544
2006-11-19 Simon Hausmann <hausmann@kde.org>
5548
http://bugs.webkit.org/show_bug.cgi?id=11649
5549
Fix CMake Qt-only build without KDE CMake files
5552
* pcre/CMakeLists.txt:
5554
2006-11-17 Anders Carlsson <acarlsson@apple.com>
5558
Make sure that we always use std::min and std::max instead of macros.
5560
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
5564
=== Safari-521.31 ===
5566
2006-11-12 Geoffrey Garen <ggaren@apple.com>
5568
Reviewed by Beth Dakin.
5570
Added project-wide setting to disable Microsoft's made-up deprecation
5571
warnings related to std:: functions. (Doesn't have any affect yet,
5572
since we currently disable all deprecation warnings.)
5574
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
5576
2006-11-12 Mark Rowe <bdash@webkit.org>
5580
Clean up of JavaScriptCore bakefiles.
5582
* JavaScriptCoreSources.bkl:
5585
2006-11-11 Alexey Proskuryakov <ap@webkit.org>
5589
http://bugs.webkit.org/show_bug.cgi?id=11508
5590
Undisable some warnings for JSImmediate.h
5592
Fix suggested by Don Gibson.
5594
* kjs/JSImmediate.h:
5595
Re-enable all MSVC warnings, move the remaining runtime checks
5598
2006-11-10 Zalan Bujtas <zalan.bujtas@nokia.com>
5602
Added s60/symbian platform defines.
5603
http://bugs.webkit.org/show_bug.cgi?id=11540
5607
=== Safari-521.30 ===
5609
2006-11-08 Ada Chan <adachan@apple.com>
5613
Added a method to delete all the keys in a HashMap.
5616
(WTF::deleteAllPairFirsts):
5617
(WTF::deleteAllKeys):
5619
2006-11-07 Anders Carlsson <acarlsson@apple.com>
5623
* API/JSClassRef.cpp:
5624
(OpaqueJSClass::OpaqueJSClass):
5625
Initialize cachedPrototype to 0.
5627
2006-11-06 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
5631
Remove warning about garbage after #else. #else clause applies for all
5632
non-mac platforms, not only win.
5634
* kjs/date_object.cpp:
5636
2006-11-06 Mark Rowe <bdash@webkit.org>
5638
Reviewed by the wonderful Mitz Pettel.
5640
http://bugs.webkit.org/show_bug.cgi?id=11524
5641
Bug 11524: REGRESSION(r9842): Array.prototype.join should use ToString operator rather than calling toString on each element
5643
* kjs/array_object.cpp:
5644
(ArrayProtoFunc::callAsFunction): Use ToString operator on each element rather than calling their toString method.
5646
2006-11-03 Steve Falkenburg <sfalken@apple.com>
5650
* kjs/JSImmediate.h:
5652
2006-11-03 Alexey Proskuryakov <ap@nypop.com>
5656
http://bugs.webkit.org/show_bug.cgi?id=11504
5657
Fix warnings on non 32 bit platforms
5659
* kjs/JSImmediate.h:
5660
(KJS::JSImmediate::NanAsBits):
5661
(KJS::JSImmediate::oneAsBits):
5662
Rewrite in a way that moves runtime checks to compile-time.
5665
(KJS::JSImmediate::fromDouble):
5666
(KJS::JSImmediate::toDouble):
5668
2006-11-02 George Staikos <staikos@kde.org>
5673
Remove a deprecated pthreads call.
5675
2006-11-02 Anders Carlsson <acarlsson@apple.com>
5677
Reviewed by Maciej, landed by Anders.
5680
Make KDE support optional.
5682
2006-11-01 Kevin McCullough <KMcCullough@apple.com>
5686
- Fixes many JavaScriptCore tests in other timezones. The root problem is that on mac localtime() returns historically accurate information for DST, but the JavaScript spec explicitly states to not take into account historical information but rather to interpolate from valid years.
5689
(KJS::equivalentYearForDST):
5690
(KJS::getDSTOffsetSimple):
5691
(KJS::getDSTOffset):
5693
2006-10-31 Geoffrey Garen <ggaren@apple.com>
5697
Fixed http://bugs.webkit.org/show_bug.cgi?id=11477
5698
REGRESSION: GMail crashes in KJS::FunctionImp::callerGetter
5701
(KJS::FunctionImp::argumentsGetter): Removed unnecessary braces.
5702
(KJS::FunctionImp::callerGetter): More logical NULL checking.
5704
2006-10-31 Oliver Hunt <oliver@apple.com>
5708
Adding definition for PLATFORM(CI)
5712
2006-10-31 Vladimir Olexa <vladimir.olexa@gmail.com>
5716
http://bugs.webkit.org/show_bug.cgi?id=4166
5717
Function object does not support caller property
5719
Test: fast/js/caller-property.html
5722
(KJS::FunctionImp::callerGetter): added
5723
(KJS::FunctionImp::getOwnPropertySlot): added if statement to handle callerGetter()
5724
* kjs/function.h: added callerGetter() declaration
5725
* kjs/identifier.h: added caller property macro
5726
* tests/mozilla/expected.html:
5728
2006-10-30 Kevin McCullough <KMcCullough@apple.com>
5732
- Fix some timezone issues and JavaScriptCore date tests. Addresses bugzilla 4930.
5735
(KJS::GregorianDateTime::GregorianDateTime): Here's the fix, to add parenthesis for order of precedence.
5736
* kjs/date_object.cpp:
5737
(KJS::DateProtoFunc::callAsFunction):
5738
(KJS::DateObjectImp::construct): memset not needed as GregorianDateTime initializes itself.
5740
2006-10-30 Darin Adler <darin@apple.com>
5742
Reviewed by John Sullivan.
5744
* kjs/SavedBuiltins.h: Added needed include.
5745
* wtf/OwnPtr.h: (WTF::OwnPtr::set): Fixed mistake in assertion.
5747
2006-10-28 Darin Adler <darin@apple.com>
5751
- renamed PassRefPtr::release to releaseRef to make it clearer that
5752
it's the counterpart of adoptRef, and to make it harder to confuse
5753
it with the safer-to-use RefPtr::release
5755
* kjs/identifier.cpp:
5756
(KJS::CStringTranslator::translate):
5757
(KJS::UCharBufferTranslator::translate):
5759
(KJS::UString::Rep::create):
5761
(WTF::PassRefPtr::PassRefPtr):
5762
(WTF::PassRefPtr::~PassRefPtr):
5763
(WTF::PassRefPtr::get):
5764
(WTF::PassRefPtr::releaseRef):
5765
(WTF::PassRefPtr::operator->):
5766
(WTF::PassRefPtr::operator=):
5768
(WTF::static_pointer_cast):
5769
(WTF::const_pointer_cast):
5771
(WTF::RefPtr::RefPtr):
5772
(WTF::RefPtr::operator=):
5774
2006-10-28 Darin Adler <darin@apple.com>
5778
* kjs/grammar.y: Add definitions of YYMALLOC and YYFREE to fix
5779
a warning some people see (not sure why others don't see it).
5781
* JavaScriptCore.vcproj/JavaScriptCore/grammarWrapper.cpp: Touch
5782
this file to force it to re-build grammar.cpp.
5784
2006-10-28 Darin Adler <darin@apple.com>
5788
- made changes so the code compiles with the highest warning level
5789
under MSVC (disabling some warnings, making some code fixes)
5791
* API/JSCallbackConstructor.cpp:
5792
(KJS::JSCallbackConstructor::construct):
5793
* API/JSCallbackFunction.cpp:
5794
(KJS::JSCallbackFunction::callAsFunction):
5795
* API/JSCallbackObject.cpp:
5796
(KJS::JSCallbackObject::init):
5797
(KJS::JSCallbackObject::construct):
5798
(KJS::JSCallbackObject::callAsFunction):
5799
* API/JSObjectRef.cpp:
5800
(JSPropertyNameArrayGetNameAtIndex):
5801
* API/JSStringRef.cpp:
5802
(JSStringCreateWithCharacters):
5803
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
5804
* bindings/c/c_utility.cpp:
5805
(KJS::Bindings::convertUTF8ToUTF16):
5806
(KJS::Bindings::coerceValueToNPVariantStringType):
5807
(KJS::Bindings::convertValueToNPVariant):
5809
(KJS::GregorianDateTime::GregorianDateTime):
5811
(KJS::ExecState::hadException):
5812
* kjs/JSImmediate.h:
5813
(KJS::JSImmediate::fromDouble):
5814
(KJS::JSImmediate::toDouble):
5815
(KJS::JSImmediate::NanAsBits):
5816
(KJS::JSImmediate::oneAsBits):
5818
* kjs/PropertyNameArray.h:
5819
(KJS::PropertyNameArray::size):
5820
* kjs/array_object.cpp:
5821
(ArrayObjectImp::callAsFunction):
5822
* kjs/bool_object.cpp:
5823
(BooleanObjectImp::callAsFunction):
5824
* kjs/collector.cpp:
5825
(KJS::Collector::allocate):
5826
(KJS::Collector::markCurrentThreadConservatively):
5827
(KJS::Collector::collect):
5829
(KJS::Completion::isValueCompletion):
5830
* kjs/date_object.cpp:
5833
(Debugger::sourceParsed):
5834
(Debugger::sourceUnused):
5835
(Debugger::exception):
5836
(Debugger::atStatement):
5837
(Debugger::callEvent):
5838
(Debugger::returnEvent):
5840
* kjs/error_object.cpp:
5841
(ErrorObjectImp::callAsFunction):
5842
(NativeErrorImp::callAsFunction):
5844
(KJS::FunctionImp::processVarDecls):
5845
(KJS::GlobalFuncImp::callAsFunction):
5846
* kjs/function_object.cpp:
5847
(FunctionPrototype::callAsFunction):
5849
* kjs/identifier.cpp:
5850
(KJS::CStringTranslator::translate):
5851
(KJS::Identifier::add):
5855
(Lexer::isIdentStart):
5856
(Lexer::isIdentPart):
5858
(Lexer::isHexDigit):
5859
(Lexer::isOctalDigit):
5860
(Lexer::matchPunctuator):
5861
(Lexer::singleEscape):
5862
(Lexer::convertOctal):
5863
(Lexer::convertHex):
5864
(Lexer::convertUnicode):
5867
* kjs/math_object.cpp:
5868
(MathFuncImp::callAsFunction):
5869
* kjs/number_object.cpp:
5870
(integer_part_noexp):
5872
(NumberProtoFunc::callAsFunction):
5873
(NumberObjectImp::callAsFunction):
5875
(KJS::JSObject::deleteProperty):
5876
(KJS::JSObject::callAsFunction):
5877
(KJS::JSObject::toBoolean):
5878
(KJS::JSObject::toObject):
5880
(KJS::JSObject::getPropertySlot):
5881
* kjs/property_map.cpp:
5883
(KJS::PropertyMap::put):
5884
(KJS::PropertyMap::insert):
5885
(KJS::PropertyMap::containsGettersOrSetters):
5886
* kjs/property_map.h:
5887
(KJS::PropertyMap::hasGetterSetterProperties):
5888
* kjs/property_slot.h:
5889
* kjs/string_object.cpp:
5890
(StringInstance::getPropertyNames):
5891
(StringObjectImp::callAsFunction):
5892
(StringObjectFuncImp::callAsFunction):
5894
(KJS::UString::Rep::computeHash):
5895
(KJS::UString::UString):
5896
(KJS::UString::from):
5897
(KJS::UString::append):
5898
(KJS::UString::ascii):
5899
(KJS::UString::operator=):
5900
(KJS::UString::find):
5901
(KJS::UString::rfind):
5905
(KJS::UCharReference::low):
5906
(KJS::UCharReference::high):
5908
(KJS::JSValue::toUInt16):
5910
* pcre/pcre_compile.c:
5911
(get_othercase_range):
5914
* pcre/pcre_internal.h:
5915
* wtf/HashFunctions.h:
5917
(WTF::PtrHash::hash):
5922
* wtf/StringExtras.h:
5924
* wtf/unicode/icu/UnicodeIcu.h:
5925
(WTF::Unicode::isPrintableChar):
5927
2006-10-26 W. Andy Carrel <wac@google.com>
5931
- Fix http://bugs.webkit.org/show_bug.cgi?id=7445 /
5932
<rdar://problem/4614195> (and 7253 / <rdar://4694011>) by changing
5933
inline regexps so that they can have \u escaped Unicode sequences and
5934
still work properly.
5939
(Lexer::shift): Looking ahead one additional character for the benefit
5941
(Lexer::scanRegExp): Change code to support unicode escapes in inline
5943
* kjs/lexer.h: Extra lookahead added.
5945
=== Safari-521.29 ===
5947
2006-10-26 Nikolas Zimmermann <zimmermann@kde.org>
5951
Fix build with older gcc 3.3.4.
5953
* kjs/DateMath.cpp: Remove inline prefix.
5954
(KJS::equivalentYearForDST):
5956
2006-10-26 Darin Adler <darin@apple.com>
5960
- fix iteration of properties of string objects (found because of a warning
5961
emitted by the MSVC compiler)
5963
* kjs/string_object.cpp: (StringInstance::getPropertyNames): Change code that
5964
wants to format a number as a string to use UString::from. Before it was using
5965
the UString constructor that makes a string from a character!
5968
* kjs/ustring.cpp: Remove the dangerous and not all that helpful UString(char)
5971
* kjs/grammar.y: Change code to not depend on the UString(char) constructor.
5972
This is potentially more efficient anyway because we could overload the + operator
5973
some day to handle char* directly instead of creating a UString.
5975
* kjs/nodes2string.cpp: (SourceStream::operator<<): Change code to not depend on
5976
the UString(char) constructor.
5978
2006-10-25 Kevin McCullough <KMcCullough@apple.com>
5980
Reviewed by Steve (rubber stamp).
5982
- Link against your local build of JavaScriptCore.lib first, this fixes some errors on release builds of testkjs.
5984
* JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
5986
2006-10-25 Geoffrey Garen <ggaren@apple.com>
5990
Removed duplicate symbol declaration.
5992
* JavaScriptCore.xcodeproj/project.pbxproj:
5995
2006-10-24 Steve Falkenburg <sfalken@apple.com>
5999
* JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
6001
2006-10-24 Kevin McCullough <KMcCullough@apple.com>
6005
- Fixes a date formatting issue on win. Specifically strftime cannot handle some ranges of time so we shift time call strftime and then manipulate the returned string, if needed.
6007
* kjs/date_object.cpp:
6009
(KJS::formatLocaleDate):
6010
(KJS::DateProtoFunc::callAsFunction):
6012
2006-10-23 Kevin McCullough <KMcCullough@apple.com>
6018
* JavaScriptCore.xcodeproj/project.pbxproj:
6021
2006-10-23 Kevin McCullough <KMcCullough@apple.com>
6025
- Makes the toTM function an operator. Was going to piggy back on a patch but the patch needs more work.
6028
(KJS::equivalentYearForDST):
6030
(KJS::GregorianDateTime::operator tm):
6031
* kjs/date_object.cpp:
6033
(KJS::DateProtoFunc::callAsFunction):
6035
2006-10-23 Kevin McCullough <KMcCullough@apple.com>
6039
- Fixes two regressions on win. Both are stack overflows. For one the number of recursions is capped at 100, and for the other, nested parenthesis pairs are not evaluated (since they would evaluate to whatever is in them anyway).
6044
2006-10-21 Steve Falkenburg <sfalken@apple.com>
6048
Add minimal compatibility with MSVCRT leak checker
6052
2006-10-23 Kevin McCullough <KMcCullough@apple.com>
6056
- Sets the lowercase range correctly in the test and consolidates a variable to make the test more readable.
6058
* tests/mozilla/ecma/String/15.5.4.11-2.js:
6060
2006-10-21 Darin Adler <darin@apple.com>
6064
- http://bugs.webkit.org/show_bug.cgi?id=11377
6065
swap(Vector, Vector) should be O(1) instead of O(n)
6068
(WTF::VectorBuffer::swap): Added.
6069
(WTF::Vector::swap): Added.
6070
(WTF::swap): Added overload that takes two Vector objects.
6072
2006-10-21 Darin Adler <darin@apple.com>
6076
- http://bugs.webkit.org/show_bug.cgi?id=11376
6077
build scripts should invoke make with "-j" option for multiple processors
6079
* JavaScriptCore.xcodeproj/project.pbxproj: Pass -j `sysctl -n hw.ncpu` to make.
6081
2006-10-19 Kevin McCullough <KMcCullough@apple.com>
6085
Changed test to make us pass Georgian case changing for Unicode 4.0 and 5.0. This incorporates changes from the 1.4 revision of the same mozilla test.
6086
On Tiger we are still using Unicode 4.0 but on win and Leopard we are using Unicode 5.0, so this test currently allows for either answer.
6088
* tests/mozilla/ecma/String/15.5.4.11-2.js:
6090
2006-10-18 Maciej Stachowiak <mjs@apple.com>
6094
- remove vestiges of KXMLCore name (former name of WTF).
6101
(operator delete[]):
6102
* wtf/FastMallocInternal.h:
6105
* wtf/HashCountedSet.h:
6106
* wtf/HashFunctions.h:
6113
* wtf/Noncopyable.h:
6114
* wtf/OwnArrayPtr.h:
6119
* wtf/StringExtras.h:
6121
* wtf/UnusedParam.h:
6123
* wtf/VectorTraits.h:
6125
2006-10-17 Steve Falkenburg <sfalken@apple.com>
6129
Adjust include paths
6131
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
6133
2006-10-17 Kevin McCullough <KMcCullough@apple.com>
6137
Fixed a date issue where the UTC offset was not set in win.
6140
(KJS::getDSTOffsetSimple):
6141
(KJS::getDSTOffset):
6142
(KJS::msToGregorianDateTime):
6145
(KJS::GregorianDateTime::GregorianDateTime):
6147
2006-10-17 Kevin McCullough <KMcCullough@apple.com>
6151
Fixes a JavaScriptCore math issue on win.
6153
* kjs/math_object.cpp:
6154
(MathFuncImp::callAsFunction):
6158
2006-10-16 Kevin McCullough <kmccullough@apple.com>
6162
Removed unecessary global specifiers.
6164
* kjs/math_object.cpp:
6165
(MathFuncImp::callAsFunction):
6167
2006-10-16 Kevin McCullough <KMcCullough@apple.com>
6171
Fixes a compile order issue for testkjs on win.
6173
* JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
6175
2006-10-15 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
6179
Remove junk (as gcc calls it) after #else clause.
6181
* wtf/FastMalloc.cpp:
6184
2006-10-14 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
6188
Define KXMLCORE_USE_CURL for platforms that wish to use CURL as
6189
networking, and set it for GDK build
6193
2006-10-13 Marvin Decker <marv.decker@gmail.com>
6195
Reviewed by Kevin McCullough.
6197
Fixes http://bugs.webkit.org/show_bug.cgi?id=11283
6198
Fixes Qt/Linux and Windows build
6202
* kjs/date_object.cpp:
6203
(KJS::DateProtoFunc::callAsFunction):
6205
2006-10-13 Kevin McCullough <KMcCullough@apple.com>
6207
Reviewed by Adam, Geoff, Darin.
6209
Fixed displaying the UTC offset and time zone string, as well as renamed the GregorianDateTime structure and clean up.
6213
(KJS::getUTCOffset):
6214
(KJS::getDSTOffsetSimple):
6215
(KJS::gregorianDateTimeToMS):
6216
(KJS::msToGregorianDateTime):
6218
(KJS::GregorianDateTime::GregorianDateTime):
6219
(KJS::GregorianDateTime::~GregorianDateTime):
6220
(KJS::GregorianDateTime::toTM):
6221
* kjs/date_object.cpp:
6224
(KJS::formatDateUTCVariant):
6226
(KJS::fillStructuresUsingTimeArgs):
6227
(KJS::fillStructuresUsingDateArgs):
6228
(KJS::DateInstance::getTime):
6229
(KJS::DateInstance::getUTCTime):
6230
(KJS::DateProtoFunc::callAsFunction):
6231
(KJS::DateObjectImp::construct):
6232
(KJS::DateObjectImp::callAsFunction):
6233
(KJS::DateObjectFuncImp::callAsFunction):
6235
* kjs/date_object.h:
6237
2006-10-13 Kevin McCullough <KMcCullough@apple.com>
6241
Gets JavaScripCore tests running on windows.
6243
* Scripts/run-javascriptcore-tests:
6244
* Scripts/webkitdirs.pm:
6246
2006-10-12 Geoffrey Garen <ggaren@apple.com>
6250
Removed JSObjectMakeWithPrototype, clarified some comments. We really
6251
don't want people to manage their own prototypes, so we don't want an
6252
extra function in the API devoted to just that. People can still manage
6253
their own prototypes if they really want by using JSObjectSetPrototype.
6255
* API/JSClassRef.cpp:
6256
(OpaqueJSClass::createNoAutomaticPrototype):
6257
(OpaqueJSClass::create):
6259
* API/JSObjectRef.cpp:
6262
* API/JSObjectRef.h:
6265
* JavaScriptCore.exp:
6267
2006-10-12 Kevin McCullough <KMcCullough@apple.com>
6275
* kjs/date_object.cpp:
6278
2006-10-11 Kevin McCullough <KMcCullough@apple.com>
6282
Added our own tm struct to have a consistent set of fields, which lets us display the DST offset and timezone strings correctly. Also there is some code cleanup.
6286
(KJS::getUTCOffset):
6287
(KJS::getDSTOffsetSimple):
6293
* kjs/date_object.cpp:
6296
(KJS::DateProtoFunc::callAsFunction):
6297
(KJS::DateObjectImp::construct):
6298
(KJS::DateObjectImp::callAsFunction):
6299
(KJS::DateObjectFuncImp::callAsFunction):
6301
* kjs/date_object.h:
6303
2006-10-09 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
6307
Improve gdk build compiler flags (show warning, no rtti and exceptions).
6311
2006-10-06 Kevin McCullough <KMcCullough@apple.com>
6315
DST and TimeZones were wrong in some cases, specifically on some of the dates where DST changes.
6318
(KJS::equivalentYearForDST):
6319
(KJS::getUTCOffset):
6320
(KJS::getDSTOffsetSimple):
6321
(KJS::getDSTOffset):
6322
(KJS::dateToMseconds):
6325
* kjs/date_object.cpp:
6328
2006-10-05 Darin Adler <darin@apple.com>
6330
Reviewed by Kevin McCullough.
6332
* wtf/Assertions.cpp: Fix build when _DEBUG is not defined.
6334
2006-10-04 Kevin McCullough <KMcCullough@apple.com>
6338
- Removed an unnecessary assert that was stopping many pages. tm_gmtoff was not set for UTC time in mozilla but is always set for us.
6341
(KJS::getUTCOffset):
6343
* kjs/date_object.cpp:
6347
2006-10-04 Geoffrey Garen <ggaren@apple.com>
6349
Patch by Darin and me, reviewed by Maciej.
6351
Fixed <rdar://problem/4518397> REGRESSION(?): Oft-seen but unrepro crash
6352
in JavaScript garbage collection (KJS::Collector::collect())
6353
<rdar://problem/4752492> Crash in KJS::collect
6355
The issue here was allocating one garbage-collected object in the midst
6356
of allocating a second garbage-collected object. In such a case, the
6357
zeroIfFree word lies.
6359
* kjs/collector.cpp:
6360
(KJS::Collector::allocate):
6361
(KJS::Collector::collect):
6363
2006-10-04 Kevin McCullough <KMcCullough@apple.com>
6370
(KJS::dateToDayInYear): accept and correctly handle negative months
6372
2006-10-05 Kevin McCullough <KMcCullough@apple.com>
6377
(KJS::dateToDayInYear):
6379
2006-10-05 Mark Rowe <bdash@webkit.org>
6381
Reviewed by maculloch.
6385
* JavaScriptCoreSources.bkl: Add DateMath.cpp to file list.
6387
2006-10-05 Kevin McCullough <KMcCullough@apple.com>
6393
* JavaScriptCore.xcodeproj/project.pbxproj:
6395
2006-10-04 Nikolas Zimmermann <zimmermann@kde.org>
6399
Fix Qt/Linux build by adding DateMath.cpp to compilation.
6401
* CMakeLists.txt: Also replace tabs with spaces.
6403
2006-10-04 Kevin McCullough <KMcCullough@apple.com>
6405
Reviewed by DethBakin.
6407
- Apparently the build bot uses an older version of XCode which warns about conversions and the newest version does not. I hope this fixes the build but I cann't be sure on my system.
6412
(KJS::dateToDayInYear):
6414
2006-10-05 Darin Adler <darin@apple.com>
6418
* wtf/Assertions.cpp: Changed assertion formatting to omit the "======"
6419
lines so you can see more assertions in less space. Also improved format
6420
of file/line information so it works with more development environments.
6422
2006-10-04 Kevin McCullough <KMcCullough@apple.com>
6426
- The build machine is more sensitive about automatic conversions. These fixes exp
6427
licitly cast or change the input and return types of functions to avoid conversions.
6429
* JavaScriptCore.xcodeproj/project.pbxproj:
6435
(KJS::monthToDayInYear):
6436
(KJS::dateToDayInYear):
6437
(KJS::getDSTOffsetSimple):
6438
(KJS::getDSTOffset):
6439
(KJS::dateToMseconds):
6442
2006-10-04 Kevin McCullough <KMcCullough@apple.com>
6446
- This is a big makeover for our Date implemenetation. This solves many platform specific issues, specifically dates before 1970, and simplifies some ugly code. The purpose of this was to get us to pass many of the JavaScriptCore tests on windows.
6448
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
6449
* JavaScriptCore.xcodeproj/project.pbxproj:
6450
* kjs/DateMath.cpp: Added.
6453
(KJS::daysFrom1970ToYear):
6454
(KJS::msFrom1970ToYear):
6458
(KJS::isInLeapYear):
6460
(KJS::msToMilliseconds):
6466
(KJS::msToDayInMonth):
6467
(KJS::monthToDayInYear):
6468
(KJS::timeToMseconds):
6469
(KJS::dateToDayInYear):
6470
(KJS::equivalentYearForDST):
6471
(KJS::getUTCOffset):
6472
(KJS::getDSTOffsetSimple):
6473
(KJS::getDSTOffset):
6474
(KJS::localTimeToUTC):
6475
(KJS::UTCToLocalTime):
6476
(KJS::dateToMseconds):
6479
* kjs/DateMath.h: Added.
6481
* kjs/date_object.cpp:
6484
(KJS::DateInstance::getTime):
6485
(KJS::DateInstance::getUTCTime):
6486
(KJS::DateProtoFunc::callAsFunction):
6487
(KJS::DateObjectImp::construct):
6488
(KJS::DateObjectFuncImp::callAsFunction):
6491
* os-win32/stdint.h:
6493
2006-10-02 Nikolas Zimmermann <zimmermann@kde.org>
6495
Reviewed/landed by Adam.
6497
Build testkjs on Qt/Linux.
6501
2006-10-02 Nikolas Zimmermann <zimmermann@kde.org>
6503
Reviewed by eseidel. Landed by eseidel.
6505
Fix win32 build, which has no inttypes.h
6509
2006-10-02 Nikolas Zimmermann <zimmermann@kde.org>
6511
Reviewed by eseidel & mjs. Landed by eseidel.
6513
Fix Qt/Linux build with older gcc 3.3.4.
6514
http://bugs.webkit.org/show_bug.cgi?id=11116
6516
* kjs/lookup.h: Move cacheGlobalObject into KJS namespace.
6517
(KJS::cacheGlobalObject): Also remove GCC_ROOT_NS_HACK.
6518
* wtf/Assertions.h: Include inttypes.h for uintptr_t.
6520
2006-09-28 Steve Falkenburg <sfalken@apple.com>
6524
Use $(ConfigSuffix) set via vsprops files to add _debug
6525
to end of debug filenames.
6527
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
6528
* JavaScriptCore.vcproj/debug.vsprops: Added.
6529
* JavaScriptCore.vcproj/dftables/dftables.vcproj:
6530
* JavaScriptCore.vcproj/release.vsprops: Added.
6531
* JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
6533
2006-09-28 Darin Adler <darin@apple.com>
6537
- support for change that should fix <rdar://problem/4733044>
6538
REGRESSION: XML iBench shows 10% perf. regression (copying
6539
strings while decoding)
6541
* wtf/Vector.h: Changed VectorBuffer so that the general case
6542
contains an instance of the 0 case, since deriving from it
6543
was violating the Liskov Substitution Principle.
6544
(WTF::VectorBuffer::releaseBuffer): Added. Releases the buffer so it can
6545
be adopted by another data structure that uses the FastMalloc.h allocator.
6546
Returns 0 if the internal buffer was being used.
6547
(WTF::Vector::releaseBuffer): Added. Releases the buffer as above or creates
6548
a new one in the case where the internal buffer was being used.
6550
2006-09-28 Maciej Stachowiak <mjs@apple.com>
6554
- change garbage collection to happen at increments proportional to number of live objects, not always
6555
every 1000 allocations
6557
* kjs/collector.cpp:
6558
(KJS::Collector::allocate):
6560
2006-09-28 Maciej Stachowiak <mjs@apple.com>
6564
- fixed REGRESSION (r16606): javascriptCore Crash on website load
6568
- fixed some possible off-by-one bugs
6569
- use indexing, not iterators, for Vectors
6570
- store Vector by pointer instead of by value to avoid blowing out FunctionImp size
6573
(KJS::FunctionImp::addParameter):
6574
(KJS::FunctionImp::parameterString):
6575
(KJS::FunctionImp::processParameters):
6576
(KJS::FunctionImp::lengthGetter):
6577
(KJS::FunctionImp::getParameterName):
6580
2006-09-27 Steve Falkenburg <sfalken@apple.com>
6586
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
6587
* JavaScriptCore.vcproj/JavaScriptCore/dstroot-to-sdk.cmd: Removed.
6589
2006-09-27 John Sullivan <sullivan@apple.com>
6592
(KJS::FunctionImp::getParameterName):
6593
removed assertion that displeased gcc 4.0.1 (build 5420):
6594
ASSERT(static_cast<size_t>(index) == index);
6596
2006-09-27 Kevin McCullough <KMcCullough@apple.com>
6600
Cleanup of previous fix which was to address Radar: 4752492
6603
(KJS::FunctionImp::addParameter):
6604
(KJS::FunctionImp::parameterString):
6605
(KJS::FunctionImp::processParameters):
6606
(KJS::FunctionImp::lengthGetter):
6607
(KJS::FunctionImp::getParameterName):
6610
2006-09-27 Kevin McCullough <KMcCullough@apple.com>
6614
Fixes a GC stack overflow crash.
6615
The change is to move from a linked list implementation of Parameters to a Vector.
6616
The problem with the linked list is that each one creates it's own stack frame when being destroyed and in extreme cases this caused the stack to overflow.
6619
(KJS::Parameter::Parameter):
6620
(KJS::FunctionImp::addParameter):
6621
(KJS::FunctionImp::parameterString):
6622
(KJS::FunctionImp::processParameters):
6623
(KJS::FunctionImp::lengthGetter):
6624
(KJS::FunctionImp::getParameterName):
6627
2006-09-27 Steve Falkenburg <sfalken@apple.com>
6631
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
6633
2006-09-27 Steve Falkenburg <sfalken@apple.com>
6635
Set path before build.
6637
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
6639
2006-09-27 Sean Gies <seangies@apple.com>
6641
Reviewed by Adam Roben.
6643
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Debug config should link to debug runtime.
6644
* JavaScriptCore.vcproj/dftables/dftables.vcproj: Debug config should link to debug runtime.
6646
2006-09-27 Don Melton <gramps@apple.com>
6648
Reviewed by Adam Roben.
6650
Changed line ending from DOS to UNIX format so it doesn't die running
6653
* JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
6655
2006-09-23 Alexey Proskuryakov <ap@nypop.com>
6659
http://bugs.webkit.org/show_bug.cgi?id=10183
6660
REGRESSION: obfuscated JS decoding breaks because of soft hyphen removal
6661
(Fanfiction.net author pages not listing stories)
6663
Rolled out the fix for bug 4139.
6668
* tests/mozilla/ecma/Array/15.4.5.1-1.js:
6669
* tests/mozilla/expected.html:
6671
2006-09-22 Steve Falkenburg <sfalken@apple.com>
6675
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
6677
2006-09-22 Darin Adler <darin@apple.com>
6681
* wtf/Vector.h: Add an append that takes a pointer and length.
6682
Generalize the existing Vector append to work on vectors with
6683
any value for inlineCapacity. Change the append algorithm so
6684
it doesn't check capacity each time through the loop.
6686
2006-09-22 Steve Falkenburg <sfalken@apple.com>
6690
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
6692
2006-09-21 Geoffrey Garen <ggaren@apple.com>
6696
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
6697
Updated to include the right path.
6698
* wtf/FastMalloc.h: #include Platform.h, since we use Platform macros.
6700
=== Safari-521.27 ===
6702
2006-09-20 Anders Carlsson <acarlsson@apple.com>
6704
Reviewed by Dave Hyatt.
6709
2006-09-20 Sean Gies <seangies@apple.com>
6711
Reviewed by Steve Falkenburg.
6713
* wtf/Assertions.cpp: Debug messages should go into debugger console.
6715
2006-09-20 David Hyatt <hyatt@apple.com>
6717
Add an implementation of lrint for Win32.
6724
2006-09-15 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
6728
http://bugs.webkit.org/show_bug.cgi?id=10864
6729
Bug 10864: Linux\GDK build fixes
6731
* JavaScriptCoreSources.bkl:
6734
2006-09-15 Adam Roben <aroben@apple.com>
6738
* JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
6740
2006-09-15 Anders Carlsson <acarlsson@apple.com>
6742
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
6743
Fix the release build.
6745
2006-09-15 Anders Carlsson <acarlsson@apple.com>
6749
Add JavaScriptCore API to the build.
6751
* API/JSCallbackConstructor.cpp:
6752
* API/JSCallbackFunction.cpp:
6753
* API/JSCallbackObject.cpp:
6754
* API/JSClassRef.cpp:
6755
* API/JSContextRef.cpp:
6756
* API/JSObjectRef.cpp:
6757
* API/JSStringRef.cpp:
6758
* API/JSValueRef.cpp:
6759
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
6760
* os-win32/stdbool.h: Added.
6762
2006-09-12 Steve Falkenburg <sfalken@apple.com>
6766
Build tweaks (doing JavaScriptCore now since it doesn't have
6769
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
6770
* JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
6771
* JavaScriptCore.vcproj/JavaScriptCore/dstroot-to-sdk.cmd: Added.
6772
* JavaScriptCore.vcproj/dftables/dftables.vcproj:
6773
* JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
6775
2006-09-11 Brady Eidson <beidson@apple.com>
6777
Build fix - I think Tim's last checkin wasn't tested on Tiger, possibly. I simply
6778
commented out the undefined constants until he can have a chance to make the right call
6780
* bindings/objc/objc_utility.mm:
6781
(KJS::Bindings::objcValueTypeForType): Commented out undefined symbols
6783
2006-09-11 Timothy Hatcher <timothy@apple.com>
6785
Reviewed by Tim O. and Darin.
6787
Add support for more method signatures affecting ObjC methods called from JavaScript:
6788
- Added unsigned types and long long.
6789
- Allow methods that use const, oneway, bycopy and byref type modifiers.
6791
* bindings/objc/objc_instance.mm:
6792
(ObjcInstance::invokeMethod):
6793
* bindings/objc/objc_utility.h:
6795
* bindings/objc/objc_utility.mm:
6796
(KJS::Bindings::convertValueToObjcValue):
6797
(KJS::Bindings::convertObjcValueToValue):
6798
(KJS::Bindings::objcValueTypeForType):
6800
2006-09-05 Timothy Hatcher <timothy@apple.com>
6804
<rdar://problem/4715840> SEL is not char*
6806
* bindings/objc/objc_class.mm:
6807
(KJS::Bindings::ObjcClass::methodsNamed): use sel_getName instead of a char* cast.
6808
* bindings/objc/objc_runtime.mm:
6809
(ObjcFallbackObjectImp::callAsFunction): ditto
6811
2006-09-03 Alexey Proskuryakov <ap@nypop.com>
6815
http://bugs.webkit.org/show_bug.cgi?id=10693
6816
Convert JavaScript arrays to AppleScript lists
6818
* JavaScriptCore.exp: Export ArrayInstance::info and ArrayInstance::getItem().
6819
* kjs/array_instance.h:
6820
* kjs/array_object.cpp:
6821
(ArrayInstance::getItem): Added a method to access array items from C++.
6823
2006-09-02 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
6827
Bug 10454: Unix bakefile fixes
6828
http://bugs.webkit.org/show_bug.cgi?id=10454
6830
* JavaScriptCoreSources.bkl:
6832
2006-09-01 Nikolas Zimmermann <zimmermann@kde.org>
6834
Reviewed by hyatt. Landed by eseidel.
6838
* pcre/CMakeLists.txt: Add wtf/ include.
6840
2006-09-01 Nikolas Zimmermann <zimmermann@kde.org>
6842
Reviewed and landed by ap.
6844
Fix build on Linux (C89 without gcc extensions enabled).
6846
* pcre/pcre_internal.h: Use C style comments.
6847
* wtf/Assertions.h: Use C style comments.
6848
* wtf/Platform.h: Use C style comments.
6850
2006-09-01 Steve Falkenburg <sfalken@apple.com>
6854
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
6855
* JavaScriptCore.vcproj/dftables/dftables.vcproj:
6857
2006-08-31 Anders Carlsson <acarlsson@apple.com>
6861
Add new portability functions to MathExtras.h and add StringExtras.h which is for
6862
string portability functions.
6864
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
6865
* bindings/c/c_instance.cpp:
6866
* kjs/date_object.cpp:
6870
* wtf/StringExtras.h: Added.
6874
2006-08-31 Anders Carlsson <acarlsson@apple.com>
6880
* JavaScriptCore.vcproj/dftables/dftables.vcproj:
6881
* pcre/pcre_internal.h:
6883
2006-08-31 Timothy Hatcher <timothy@apple.com>
6887
Band-aid fix for PCRE to compile for ppc64 and x86_64 now that
6888
we use -Wshorten-64-to-32. Adds an INT_CAST macro that ASSERTs
6889
the value <= INT_MAX.
6891
I filed <rdar://problem/4712064> to track the need to verify
6892
PCRE's 64-bit compliance.
6894
* pcre/pcre_compile.c:
6903
(pcre_get_substring_list):
6904
* pcre/pcre_internal.h:
6905
* pcre/pcre_tables.c:
6906
* pcre/pcre_try_flipped.c:
6907
(_pcre_try_flipped):
6909
2006-08-30 Darin Adler <darin@apple.com>
6911
Reviewed by Tim Hatcher.
6913
- add WTF::getPtr, a function template that makes it possible to write
6914
generic code that gets a raw pointer out of any of our pointer types
6916
* JavaScriptCore.xcodeproj/project.pbxproj:
6917
* wtf/GetPtr.h: Added.
6918
* wtf/ListRefPtr.h: (WTF::getPtr): Added.
6919
* wtf/OwnArrayPtr.h: (WTF::getPtr): Added.
6920
* wtf/OwnPtr.h: (WTF::getPtr): Added.
6921
* wtf/PassRefPtr.h: (WTF::getPtr): Added.
6922
* wtf/RefPtr.h: (WTF::getPtr): Added.
6924
2006-08-29 waylonis <waylonis@google.com>
6926
Reviewed, tweaked by ggaren.
6928
- Added storage and accessor functions for ExecState as a fix for
6929
http://bugs.webkit.org/show_bug.cgi?id=10114
6931
* kjs/ExecState.cpp:
6932
(KJS::ExecState::ExecState):
6935
(KJS::Context::setExecState):
6936
(KJS::Context::execState):
6938
2006-08-30 Nikolas Zimmermann <zimmermann@kde.org>
6942
Commit KDE related tweaks, to be able to
6943
differentiate between a Qt-only or a KDE build.
6945
* CMakeLists.txt: Install wtf-unity library.
6946
* wtf/Platform.h: Add define for the KDE platform.
6948
2006-08-28 Darin Adler <darin@apple.com>
6952
* kjs/list.h: Use explicit in constructor (as appropriate).
6954
2006-08-24 Nikolas Zimmermann <zimmermann@kde.org>
6956
Reviewed, tweaked and landed by ap
6958
http://bugs.webkit.org/show_bug.cgi?id=10467
6959
WebKit should have Qt platform support (Part II)
6961
* CMakeLists.txt: Adjust to Anders' build fixes.
6962
* wtf/Platform.h: Fix define for the Qt platform (we don't use/need Cairo.)
6964
2006-08-23 David Hyatt <hyatt@apple.com>
6966
Fix Platform.h to include #defines for graphics features.
6970
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
6973
2006-08-23 Anders Carlsson <acarlsson@apple.com>
6977
Make the bindings compile without CoreFoundation.
6979
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
6980
* bindings/c/c_instance.cpp:
6981
* bindings/c/c_utility.cpp:
6982
(KJS::Bindings::convertUTF8ToUTF16):
6984
* bindings/runtime.cpp:
6985
(KJS::Bindings::Instance::createBindingForLanguageInstance):
6986
(KJS::Bindings::Instance::createLanguageInstanceForValue):
6987
* bindings/runtime_root.cpp:
6988
* bindings/runtime_root.h:
6989
* kjs/interpreter.cpp:
6990
(KJS::Interpreter::createLanguageInstanceForValue):
6991
* kjs/interpreter.h:
6993
2006-08-22 Anders Carlsson <acarlsson@apple.com>
6997
Move the npruntime code over to using HashMap and the runtime_root code over to using
6998
HashMap and HashCountedSet.
7000
* bindings/NP_jsobject.cpp:
7001
* bindings/c/c_utility.cpp:
7002
(KJS::Bindings::identifierFromNPIdentifier):
7003
* bindings/c/c_utility.h:
7004
* bindings/jni/jni_jsobject.cpp:
7005
(JavaJSObject::invoke):
7006
* bindings/npruntime.cpp:
7007
(getStringIdentifierMap):
7008
(getIntIdentifierMap):
7009
(_NPN_GetStringIdentifier):
7010
(_NPN_GetIntIdentifier):
7011
* bindings/runtime_root.cpp:
7012
(getReferencesByRootMap):
7014
(KJS::Bindings::findReferenceSet):
7015
(KJS::Bindings::rootForImp):
7016
(KJS::Bindings::rootForInterpreter):
7017
(KJS::Bindings::addNativeReference):
7018
(KJS::Bindings::removeNativeReference):
7019
(RootObject::removeAllNativeReferences):
7020
* bindings/runtime_root.h:
7022
2006-08-22 Anders Carlsson <acarlsson@apple.com>
7026
Switch over the NPAPI and Java bindings to using HashMaps instead of dictionaries.
7028
* JavaScriptCore.xcodeproj/project.pbxproj:
7029
* bindings/c/c_class.cpp:
7030
(KJS::Bindings::CClass::CClass):
7031
(KJS::Bindings::CClass::~CClass):
7032
(KJS::Bindings::CClass::classForIsA):
7033
(KJS::Bindings::CClass::methodsNamed):
7034
(KJS::Bindings::CClass::fieldNamed):
7035
* bindings/c/c_class.h:
7036
* bindings/jni/jni_class.cpp:
7037
(JavaClass::JavaClass):
7038
(JavaClass::~JavaClass):
7039
(JavaClass::methodsNamed):
7040
(JavaClass::fieldNamed):
7041
* bindings/jni/jni_class.h:
7042
* bindings/objc/objc_class.h:
7043
* bindings/objc/objc_class.mm:
7044
(KJS::Bindings::deleteMethod):
7045
(KJS::Bindings::deleteField):
7047
(KJS::Bindings::ObjcClass::methodsNamed):
7048
(KJS::Bindings::ObjcClass::fieldNamed):
7049
* bindings/runtime.cpp:
7050
* bindings/runtime.h:
7051
* bindings/runtime_object.cpp:
7052
(RuntimeObjectImp::fieldGetter):
7053
(RuntimeObjectImp::getOwnPropertySlot):
7054
(RuntimeObjectImp::put):
7055
(RuntimeObjectImp::canPut):
7057
2006-08-21 Vladimir Olexa <vladimir.olexa@gmail.com>
7061
http://bugs.webkit.org/show_bug.cgi?id=6252
7062
JavaScript 1.6 Array.lastIndexOf
7064
Test: fast/js/array-lastIndexOf.html
7066
* kjs/array_object.cpp:
7067
(ArrayProtoFunc::callAsFunction): Added a LastIndexOf case.
7068
* kjs/array_object.h:
7069
(KJS::ArrayProtoFunc::): Added LastIndexOf to enum.
7070
* tests/mozilla/expected.html: Two more tests now pass.
7072
2006-08-20 Nikolas Zimmermann <zimmermann@kde.org>
7074
Reviewed by Maciej. Landed by rwlbuis.
7076
Fixes parts of: http://bugs.webkit.org/show_bug.cgi?id=10463
7077
WebKit should have Qt platform support
7079
Removing obsolete QConstString/QString constructors in kjs code.
7084
2006-08-17 Nikolas Zimmermann <zimmermann@kde.org>
7086
Reviewed by Maciej. Landed by rwlbuis.
7088
Fixes: http://bugs.webkit.org/show_bug.cgi?id=10463
7089
WTF Changes needed for Qt platform code.
7092
* wtf/unicode/UnicodeDecomposition.h: Added.
7094
* wtf/unicode/UnicodeDirection.h: Added.
7096
* wtf/unicode/qt4/UnicodeQt4.cpp: Added.
7097
(WTF::Unicode::direction):
7098
(WTF::Unicode::category):
7099
(WTF::Unicode::decomposition):
7100
* wtf/unicode/qt4/UnicodeQt4.h:
7101
(WTF::Unicode::toLower):
7102
(WTF::Unicode::toUpper):
7103
(WTF::Unicode::isPrintableChar):
7104
(WTF::Unicode::isSpace):
7105
(WTF::Unicode::isPunct):
7106
(WTF::Unicode::isDigit):
7107
(WTF::Unicode::mirroredChar):
7108
(WTF::Unicode::compare):
7110
2006-08-17 Nikolas Zimmermann <zimmermann@kde.org>
7112
Reviewed by Eric. Landed by rwlbuis.
7114
Fixes: http://bugs.webkit.org/show_bug.cgi?id=10464
7115
Offer a cmake build system for Qt platform.
7117
* CMakeLists.txt: Added.
7118
* pcre/CMakeLists.txt: Added.
7120
2006-08-17 Anders Carlsson <acarlsson@apple.com>
7127
2006-08-15 Steve Falkenburg <sfalken@apple.com>
7133
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
7136
2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
7140
Build fix: DWARF and -gfull are incompatible with symbol separation.
7142
* JavaScriptCore.xcodeproj/project.pbxproj:
7144
2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
7148
http://bugs.webkit.org/show_bug.cgi?id=10394
7149
Bug 10394: WebKit Release and Production configurations should enable dead code stripping
7151
* JavaScriptCore.xcodeproj/project.pbxproj:
7153
2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
7157
http://bugs.webkit.org/show_bug.cgi?id=10384
7158
Bug 10384: Switch to DWARF for Release configuration
7160
* JavaScriptCore.xcodeproj/project.pbxproj:
7162
2006-08-13 Maks Orlovich <maksim@kde.org>
7164
Reviewed (and tweaked a little) by Maciej.
7166
- shrank the size of JSObject by 8 bytes and made the corresponding reduction to the cell size, resulting
7167
in a 1.2% speed improvement on JS iBench (and probably overall memory savings).
7169
This was done by removing _scope and _internalValue data members
7170
from JSObject and moving them only to the subclasses that actually
7174
(KJS::JSObject::mark): No need to mark scope or internal value here.
7176
(KJS::JSObject::JSObject): Don't initialize them.
7177
* kjs/JSWrapperObject.cpp: Added. New base class for object types that
7178
wrap primitive values (Number, String, Boolean, Date).
7179
(KJS::JSWrapperObject::mark):
7180
* kjs/JSWrapperObject.h: Added.
7181
(KJS::JSWrapperObject::JSWrapperObject):
7182
(KJS::JSWrapperObject::internalValue):
7183
(KJS::JSWrapperObject::setInternalValue):
7184
* kjs/array_object.cpp:
7185
(ArrayPrototype::ArrayPrototype): Don't set useless internal value.
7186
* kjs/bool_object.cpp:
7187
(BooleanInstance::BooleanInstance): Inherit from JSWrapperObject.
7188
(BooleanProtoFunc::callAsFunction): Fixed to account for fact that not all
7189
JSObjects have an internal value.
7190
(BooleanObjectImp::construct): ditto.
7191
* kjs/bool_object.h:
7192
* kjs/collector.cpp: Lowered cell size to 48.
7193
(KJS::Collector::allocate): meaningless whitespace change
7194
* kjs/date_object.cpp:
7195
(KJS::DateInstance::DateInstance): Inherit from JSWrapperObject.
7196
(KJS::DateProtoFunc::callAsFunction): adjusted for move of internalValue
7197
(KJS::DateObjectImp::construct): ditto
7198
* kjs/date_object.h:
7199
* kjs/error_object.cpp:
7200
(ErrorPrototype::ErrorPrototype): don't set internal value
7201
* kjs/function.cpp: move _scope and related handling here
7202
(KJS::FunctionImp::mark): mark scope
7204
(KJS::FunctionImp::scope): moved here from JSObject
7205
(KJS::FunctionImp::setScope): ditto
7206
* kjs/number_object.cpp:
7207
(NumberInstance::NumberInstance): inherit from JSWrapperObject
7208
(NumberProtoFunc::callAsFunction): adjusted
7209
(NumberObjectImp::construct): adjusted
7210
* kjs/number_object.h: shring RegExp-related objects a little
7211
* kjs/regexp_object.cpp:
7212
(RegExpPrototype::RegExpPrototype): Adjust for size tweaks
7213
(RegExpObjectImp::RegExpObjectImp): ditto
7214
* kjs/regexp_object.h:
7215
* kjs/string_object.cpp:
7216
(StringInstance::StringInstance): inherit from JSWrapperObject
7217
(StringProtoFunc::callAsFunction): adjusted
7218
* kjs/string_object.h:
7219
* JavaScriptCore.exp: Exported new methods as needed.
7220
* JavaScriptCore.xcodeproj/project.pbxproj: Added new files to build.
7222
2006-08-04 Brady Eidson <beidson@apple.com>
7224
Reviewed by Geoff's rubber stamp
7226
Fix a build break on Intel hardware causes by adapting stricter
7227
compiler warnings (-Wshorten-64-to-32)
7230
(assertEqualsAsNumber): manually cast some doubles to floats
7233
2006-08-04 Sam Weinig <sam.weinig@gmail.com>
7237
- patch for http://bugs.webkit.org/show_bug.cgi?id=10192
7238
Make WebCore (and friends) compile with -Wshorten-64-to-32
7240
* Adds -Wshorten-64-to-32 flag to Xcode project.
7241
* Adds explicit casts where OK.
7245
(JSNodeList_getProperty):
7246
* JavaScriptCore.xcodeproj/project.pbxproj:
7248
2006-08-04 Adam Roben <aroben@apple.com>
7252
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Convert
7255
2006-08-03 Sam Weinig <sam.weinig@gmail.com>
7259
- patch for http://bugs.webkit.org/show_bug.cgi?id=10176
7260
Make WebCore compile with -Wundef
7262
* Adds -Wundef flag to Xcode project
7263
* Converts #ifs to #ifdef and #ifndefs where needed.
7264
* Added #define YYMAXDEPTH 10000 in kjs/grammar.y
7265
to fix a warning from within Bison.
7267
* JavaScriptCore.xcodeproj/project.pbxproj:
7268
* bindings/jni/jni_jsobject.cpp:
7269
(JavaJSObject::getSlot):
7270
(JavaJSObject::setSlot):
7272
* bindings/objc/objc_class.mm:
7273
(KJS::Bindings::ObjcClass::methodsNamed):
7274
(KJS::Bindings::ObjcClass::fieldNamed):
7275
* bindings/objc/objc_instance.mm:
7276
(ObjcInstance::invokeMethod):
7277
* bindings/objc/objc_runtime.mm:
7278
(ObjcMethod::getMethodSignature):
7284
2006-08-03 Anders Carlsson <acarlsson@apple.com>
7286
Reviewed by John Sullivan.
7290
Return *this in operator=
7292
2006-08-03 Adam Roben <aroben@apple.com>
7296
- Fixed Windows build
7298
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
7299
* wtf/MathExtras.h: Implement inline versions of these functions
7303
2006-08-02 Adam Roben <aroben@apple.com>
7309
* kjs/date_object.cpp:
7312
2006-07-29 Darin Adler <darin@apple.com>
7314
- Removed tabs from these source files that still had them.
7315
We don't use them; that way source files look fine in editors
7316
that have tabs set to 8 spaces or to 4 spaces.
7317
- Removed allow-tabs Subversion property from the files too.
7319
* bindings/NP_jsobject.cpp:
7320
* bindings/c/c_utility.cpp:
7321
* bindings/jni/jni_runtime.cpp:
7322
* bindings/jni/jni_utility.cpp:
7323
* bindings/objc/objc_utility.mm:
7324
* bindings/runtime.cpp:
7325
* bindings/runtime_method.cpp:
7326
* bindings/testbindings.cpp:
7327
* bindings/testbindings.mm:
7328
* kjs/date_object.cpp:
7333
* kjs/string_object.cpp:
7336
2006-07-29 Darin Adler <darin@apple.com>
7338
* tests/mozilla/expected.html: Update test results now that regress-185165.js
7339
is succeeding. I suspect Anders fix for bug 4620655 is the reason.
7341
2006-07-29 Sam Weinig <sam.weinig@gmail.com>
7345
- patch for http://bugs.webkit.org/show_bug.cgi?id=10080
7346
Adopt pedantic changes from the Unity project to improve
7347
cross-compiler compatibility
7350
* Removing trailing semicolon from namespace braces.
7351
* Removing trailing comma from last enum declaration.
7352
* Updating to match style guidelines.
7353
* Adding missing newline to the end of the file.
7354
* Turning on gcc warning for missing newline at the end of a source file
7355
(GCC_WARN_ABOUT_MISSING_NEWLINE in Xcode, -Wnewline in gcc).
7356
* Alphabetical sorting of Xcode source list files.
7357
* Replace use of non-portable variable-size array with Vector.
7358
* Use C-style comments instead of C++ comments in files that might
7359
be included by either C or C++ files.
7361
* API/JSCallbackConstructor.cpp:
7362
(KJS::JSCallbackConstructor::construct):
7363
* API/JSCallbackFunction.cpp:
7364
(KJS::JSCallbackFunction::callAsFunction):
7365
* API/JSCallbackObject.cpp:
7366
(KJS::JSCallbackObject::construct):
7367
(KJS::JSCallbackObject::callAsFunction):
7368
* JavaScriptCore.xcodeproj/project.pbxproj:
7369
* JavaScriptCorePrefix.h:
7370
* bindings/jni/jni_class.cpp:
7371
(JavaClass::fieldNamed):
7372
* bindings/jni/jni_class.h:
7373
* bindings/jni/jni_instance.cpp:
7374
(JavaInstance::JavaInstance):
7375
(JavaInstance::valueOf):
7376
* bindings/jni/jni_objc.mm:
7377
(KJS::Bindings::dispatchJNICall):
7378
* bindings/jni/jni_runtime.cpp:
7379
(JavaParameter::JavaParameter):
7380
(JavaArray::JavaArray):
7381
* bindings/jni/jni_runtime.h:
7382
* bindings/jni/jni_utility.h:
7383
* bindings/objc/objc_instance.h:
7384
* bindings/runtime_array.h:
7390
2006-07-29 Mike Emmel <mike.emmel@gmail.com>
7394
- fixes for Linux build
7396
* JavaScriptCoreSources.bkl: Added new files to build, kjs/PropertyNameArray.cpp
7397
and kjs/testkjs.cpp, and removed old files.
7399
2006-07-24 Dan Waylonis <waylonis@google.com>
7401
Reviewed and tweaked a bit by Darin.
7403
- fix http://bugs.webkit.org/show_bug.cgi?id=9902
7404
jsNull and NSNull not properly converted between JS and ObjC
7406
* bindings/objc/objc_utility.mm: (KJS::Bindings::convertObjcValueToValue):
7407
Added case for converting NSNull to jsNull.
7409
2006-07-24 Rob Buis <buis@kde.org>
7413
http://bugs.webkit.org/show_bug.cgi?id=4258
7414
Date().toString() only includes GMT offset, not timezone string
7416
Use the info in tm_zone to append timezone abbreviation
7417
to Date().toString().
7419
* kjs/date_object.cpp:
7422
2006-07-24 Rob Buis <buis@kde.org>
7426
http://bugs.webkit.org/show_bug.cgi?id=5257
7427
setYear() does not match FireFox/IE behavior
7429
Make sure the right values end up in tm_year.
7431
* kjs/date_object.cpp:
7434
2006-07-23 Mark Rowe <opendarwin.org@bdash.net.nz>
7438
Bug 9686: [Drosera] Need the ability to break into Drosera on Javascript exceptions
7439
http://bugs.webkit.org/show_bug.cgi?id=9686
7441
JavaScriptCore portion of the fix.
7443
* JavaScriptCore.exp: Update symbol for change in argument type.
7445
(Debugger::detach): Clear map of recent exceptions.
7446
(Debugger::hasHandledException): Track the most recent exception
7447
thrown by an interpreter.
7448
(Debugger::exception): Change exception argument to a JSValue.
7451
(Node::debugExceptionIfNeeded): Notify the debugger of an exception
7452
if it hasn't seen it before.
7453
(ThrowNode::execute): Notify the debugger that an exception is being thrown.
7456
2006-07-23 Geoffrey Garen <ggaren@apple.com>
7458
Patch by Eric Albert, reviewed by Darin and me.
7460
- Fixed <rdar://problem/4645931> JavaScriptCore stack-scanning code
7461
crashes (Collector::markStackObjectsConservatively)
7463
* bindings/jni/jni_jsobject.cpp: On 64bit systems, jint is a long, not an
7465
(JavaJSObject::getSlot):
7466
(JavaJSObject::setSlot):
7467
* kjs/collector.cpp:
7468
(KJS::Collector::markCurrentThreadConservatively): Use a pointer instead of
7469
an int as 'dummy,' because on LP64 systems, an int is not pointer-aligned,
7470
and we want to scan the stack for pointers.
7471
* JavaScriptCore.xcodeproj/project.pbxproj: After a tense cease-fire, the
7472
XCode war has started up again!
7474
=== Safari-521.20 ===
7476
2006-07-21 Geoffrey Garen <ggaren@apple.com>
7480
<rdar://problem/4507265> REGRESSION: overlays don't work on HousingMaps.com (Google Maps-based site)
7482
- Added support for strings that masquerade as undefined. Currently used
7483
by WebCore to implement undetectable style.filter.
7485
The name is a little long, but it's only used in one line of code, so I
7486
thought clarity should win over brevity.
7488
* JavaScriptCore.exp:
7489
* JavaScriptCore.xcodeproj/project.pbxproj:
7491
* kjs/string_object.h:
7492
(KJS::StringInstanceThatMasqueradesAsUndefined::StringInstanceThatMasqueradesAsUndefined):
7493
(KJS::StringInstanceThatMasqueradesAsUndefined::masqueradeAsUndefined):
7494
(KJS::StringInstanceThatMasqueradesAsUndefined::toBoolean):
7496
=== Safari-521.19 ===
7498
2006-07-20 Steve Falkenburg <sfalken@apple.com>
7503
(KJS::escapeStringForPrettyPrinting):
7505
2006-07-19 Anders Carlsson <acarlsson@apple.com>
7509
<rdar://problem/4620655> REGRESSION(10.4.7-10.5): preview button for a blogger.com post doesn't work
7511
* kjs/nodes2string.cpp:
7512
(StringNode::streamTo):
7513
Return the escaped string.
7515
(RegExpNode::streamTo):
7516
Use the correct syntax.
7519
(KJS::escapeStringForPrettyPrinting):
7521
Add escape function which escapes a string for pretty-printing so it can be parsed again.
7523
* wtf/unicode/icu/UnicodeIcu.h:
7524
(WTF::Unicode::isPrintableChar):
7527
2006-07-18 Maciej Stachowiak <mjs@apple.com>
7529
Reviewed by Adele Peterson.
7531
<rdar://problem/4589530> REGRESSION: null character in JS string causes parse error (works in Tiger and in other browsers)
7537
(Lexer::scanRegExp):
7540
2006-07-18 Tim Omernick <timo@apple.com>
7542
Reviewed by Tim Hatcher.
7544
Removed a misleading comment; we recently added support for the NPNVPluginElementNPObject
7549
=== Safari-521.18 ===
7551
2006-07-18 Timothy Hatcher <timothy@apple.com>
7553
Made the following headers public:
7562
* JavaScriptCore.xcodeproj/project.pbxproj:
7564
2006-07-17 Geoffrey Garen <ggaren@apple.com>
7568
- Added automatic prototype creation for classes.
7570
A class stores a weak reference to a prototype, which is cleared when
7571
the prototype is garbage collected, to avoid a reference cycle.
7573
We now have an attributes field in JSClassDefinition, that currently is
7574
used only to override automatic prototype creation when you want to manage your
7575
own prototypes, but can be extended in the future for other nefarious purposes.
7577
Similarly, we have JSObjectMake and JSObjectMakeWithPrototype, the latter
7578
allowing you to manage your own prototypes.
7580
JSObjectMakeConstructor is more interesting now, able to make a constructor
7581
on your behalf if you just give it a class.
7583
- Removed bogus old code from minidom.js.
7585
- Tweaked the headerdocs.
7587
- Added more GC testing, which caught some leaks, and tested more funny
7588
edge cases in lookup, which caught a lookup bug. Removed some testing
7589
we used to do with MyObject because it was redundant with the new, cool
7592
While fixing the lookup bug I retracted this change:
7594
"If a static setProperty callback returns 'false', to indicate that the
7595
property was not set, we no longer forward the set request up the class
7596
chain, because that's almost certainly not what the programmer expected."
7598
Returning false when setting a static property is a little silly, but you can see
7599
it being useful when shadowing a base class's static properties, and, regardless
7600
of usefullness, this is the defined behavior of the setProperty callback.
7602
- Plus a little ASCII art, for the kids.
7604
2006-07-17 Timothy Hatcher <timothy@apple.com>
7608
<rdar://problem/4634874> WebScriptObject and WebUndefined are no longer defined by WebKit
7610
Moves WebScriptObject and WebUndefined up to WebCore.
7611
This change does create an upwards-dependancy on WebScriptObject existing
7612
in the loaded process, but this code path in JavaScriptCore does not get used
7613
unless it is through WebKit/WebCore. Moving all of the binding code out of
7614
JavaScriptCore might make sense in the future.
7616
* JavaScriptCore.exp:
7617
* JavaScriptCore.xcodeproj/project.pbxproj:
7618
* bindings/objc/WebScriptObject.h: Replaced.
7619
* bindings/objc/WebScriptObject.mm: Removed.
7620
* bindings/objc/WebScriptObjectPrivate.h: Removed.
7621
* bindings/objc/objc_class.h:
7622
* bindings/objc/objc_instance.h:
7623
* bindings/objc/objc_instance.mm:
7624
(ObjcInstance::~ObjcInstance):
7625
* bindings/objc/objc_runtime.h:
7626
* bindings/objc/objc_runtime.mm:
7627
(convertValueToObjcObject):
7628
* bindings/objc/objc_utility.mm:
7629
(KJS::Bindings::convertValueToObjcValue):
7630
(KJS::Bindings::convertObjcValueToValue):
7631
(KJS::Bindings::createObjcInstanceForValue):
7633
2006-07-17 Darin Adler <darin@apple.com>
7635
* API/JSBase.h: Fix comment formatting where things used to be lined up but
7636
are now ragged. Got rid of spaces that attempted to line things up.
7637
* API/JSObjectRef.h: Ditto. Also add missing periods for a couple of comments.
7639
2006-07-17 Geoffrey Garen <ggaren@apple.com>
7643
- Removed the exception parameter from the initialize callback and, by extension,
7644
JSObjectMake. We have never had a need for exceptions when iniitializing,
7645
so the parameter seemed likely to "get in the way."
7647
Also, an exception in JavaScript is thrown in response to input --
7648
"invalid URL", "index not a number", etc., so it's the job of the
7649
constructor function, not the initialize method, to throw.
7651
If initialize *really* wants to throw, it can communicate the throw to
7652
the constructor through the constructed object's private data (e.g., set
7653
it to NULL, signaling to the consntructor that initialization failed.)
7655
- Added JSObjectMakeWithData, which enables a constructor to set private
7656
data on an object *before* it has been initialized. That way, the initialize
7657
methods can properly operate on the data.
7659
* API/JSNode.c: Moved ref into the initialize method, for better encapsulation,
7660
now that it's possible.
7661
* API/JSNodeList.c: ditto
7663
(main): Do more aggressive garbage collection to test ref/deref and
7664
initialize/finalize.
7665
* API/minidom.js: store childNodes in a temporary so it doesn't get re-created
7666
like a thousand times. This makes debugging ref/deref easier
7668
2006-07-17 Geoffrey Garen <ggaren@apple.com>
7672
- Changed the initialize callback to run from least derived class (parent
7673
class) to most derived class. This enables C++ style initialization,
7674
and derived class overriding of member data.
7676
- Added excpetion propopgation to JSObjectMake, to support initialize
7677
exceptions, and generally round out our policy of making function
7678
signatures as long as possible.
7680
* API/JSCallbackObject.h: Use ExecState instead of ContextRef, cuz we're
7683
2006-07-17 Geoffrey Garen <ggaren@apple.com>
7687
- Changed JSObjectMakeConstructor to JSObjectMakeConstructorWithCallback,
7688
to match JSObjectMakeFunctionWithCallback.
7690
- Added prototype parameter, so the generated constructor
7691
automatically works with hasInstance / instanceof
7693
- Moved hasInstance implementation from InternalFunctionImp to JSObject
7694
so that subclasses can inherit it without inheriting function-related baggage.
7695
More refactoring here would be good, but this seems like a good short-term
7698
(KJS::JSCallbackFunction::implementsHasInstance): override and return false,
7699
because callback functions aren't constructors.
7701
2006-07-17 Maciej Stachowiak <mjs@apple.com>
7705
- add a JSContextRef parameter to all JSValueRef, JSObjectRef, and JSContextRef operations;
7706
except JSObject{Get,Set}PrivateData which can be assumed to be simple pure accessors.
7708
Also renamed the parameter "context" to "ctx" because it makes the code read better with this pervasive
7709
but usually uninteresting parameter.
7713
(JSCheckScriptSyntax):
7716
* API/JSCallbackObject.cpp:
7717
(KJS::JSCallbackObject::JSCallbackObject):
7718
(KJS::JSCallbackObject::init):
7719
(KJS::JSCallbackObject::getOwnPropertySlot):
7720
(KJS::JSCallbackObject::put):
7721
(KJS::JSCallbackObject::deleteProperty):
7722
(KJS::JSCallbackObject::toNumber):
7723
(KJS::JSCallbackObject::toString):
7724
* API/JSContextRef.cpp:
7725
(JSGlobalContextCreate):
7726
(JSGlobalContextRetain):
7727
(JSGlobalContextRelease):
7728
(JSContextGetGlobalObject):
7729
* API/JSContextRef.h:
7731
(JSNodePrototype_appendChild):
7732
(JSNodePrototype_removeChild):
7733
(JSNodePrototype_replaceChild):
7734
(JSNode_getNodeType):
7735
(JSNode_getFirstChild):
7738
(JSNodeListPrototype_item):
7739
(JSNodeList_length):
7740
(JSNodeList_getProperty):
7741
(JSNodeList_prototype):
7742
* API/JSObjectRef.cpp:
7744
(JSObjectMakeFunctionWithCallback):
7745
(JSObjectMakeConstructor):
7746
(JSObjectMakeFunction):
7747
(JSObjectGetPrototype):
7748
(JSObjectSetPrototype):
7749
(JSObjectHasProperty):
7750
(JSObjectGetProperty):
7751
(JSObjectSetProperty):
7752
(JSObjectGetPropertyAtIndex):
7753
(JSObjectSetPropertyAtIndex):
7754
(JSObjectDeleteProperty):
7755
(JSObjectIsFunction):
7756
(JSObjectCallAsFunction):
7757
(JSObjectIsConstructor):
7758
(JSObjectCallAsConstructor):
7759
(JSObjectCopyPropertyNames):
7760
* API/JSObjectRef.h:
7761
* API/JSStringRef.cpp:
7762
* API/JSValueRef.cpp:
7764
(JSValueIsUndefined):
7770
(JSValueIsObjectOfClass):
7772
(JSValueIsStrictEqual):
7773
(JSValueIsInstanceOfConstructor):
7774
(JSValueMakeUndefined):
7776
(JSValueMakeBoolean):
7777
(JSValueMakeNumber):
7778
(JSValueMakeString):
7781
(JSValueToStringCopy):
7789
(MyObject_getProperty):
7790
(MyObject_deleteProperty):
7791
(MyObject_callAsFunction):
7792
(MyObject_callAsConstructor):
7793
(MyObject_convertToType):
7794
(print_callAsFunction):
7797
2006-07-16 Geoffrey Garen <ggaren@apple.com>
7799
Approved by Maciej, RS by Beth.
7801
JSObjectMakeFunction -> JSObjectMakeFunctionWithCallback
7802
JSObjectMakeFunctionWithBody -> JSObjectMakeFunction
7804
because the latter is more common, and more fundamental, than the former.
7809
* API/JSCallbackObject.cpp:
7810
(KJS::JSCallbackObject::getOwnPropertySlot):
7811
(KJS::JSCallbackObject::put):
7812
(KJS::JSCallbackObject::deleteProperty):
7813
(KJS::JSCallbackObject::getPropertyNames):
7814
(KJS::JSCallbackObject::staticValueGetter):
7815
(KJS::JSCallbackObject::staticFunctionGetter):
7816
* API/JSClassRef.cpp:
7817
(OpaqueJSClass::OpaqueJSClass):
7818
(OpaqueJSClass::~OpaqueJSClass):
7820
* API/JSObjectRef.cpp:
7822
(JSObjectMakeFunctionWithCallback):
7823
(JSObjectMakeFunction):
7824
(OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray):
7825
(JSObjectCopyPropertyNames):
7826
* API/JSObjectRef.h:
7832
* JavaScriptCore.exp:
7834
2006-07-16 Geoffrey Garen <ggaren@apple.com>
7838
Replace __JS with OpaqueJS because the former, while used by CF, is
7839
a prefix that's triply-reserved by the compiler. (_* is reserved in global
7840
names, _[A-Z] is reserved in all names, and __ is reserved in all names
7843
Opaque is an alternative used by other Mac OS X framewokrs.
7848
* API/JSCallbackObject.cpp:
7849
(KJS::JSCallbackObject::getOwnPropertySlot):
7850
(KJS::JSCallbackObject::put):
7851
(KJS::JSCallbackObject::deleteProperty):
7852
(KJS::JSCallbackObject::getPropertyNames):
7853
(KJS::JSCallbackObject::staticValueGetter):
7854
(KJS::JSCallbackObject::staticFunctionGetter):
7855
* API/JSClassRef.cpp:
7856
(OpaqueJSClass::OpaqueJSClass):
7857
(OpaqueJSClass::~OpaqueJSClass):
7859
* API/JSObjectRef.cpp:
7861
(OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray):
7862
(JSObjectCopyPropertyNames):
7864
2006-07-16 Darin Adler <darin@apple.com>
7866
- try to fix Windows build
7868
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
7869
Added some recently added files, removed some recently removed.
7871
2006-07-16 Geoffrey Garen <ggaren@apple.com>
7875
- Change getProperty* to return undefined, rather than NULL, for missing
7876
properties, since that's what the spec says. Also added exception out
7877
parameters to the *Index functions, because they can call through to the
7878
regular functions, which can throw for custom objects.
7880
* API/JSObjectRef.cpp:
7881
(JSObjectGetProperty):
7882
(JSObjectGetPropertyAtIndex):
7883
(JSObjectSetPropertyAtIndex):
7884
* API/JSObjectRef.h:
7888
2006-07-16 Geoffrey Garen <ggaren@apple.com>
7892
- Properly document and handle NULL callbacks for static properties. We
7893
throw an exception in any case other than a ReadOnly property with a NULL
7894
setProperty callback, because a NULL callback almost certainly indicates
7895
a programming error. Also throw an exception if hasProperty returns true
7896
for a property that getProperty can't get.
7898
- If a static setProperty callback returns 'false', to indicate that the
7899
property was not set, we no longer forward the set request up the class
7900
chain, because that's almost certainly not what the programmer expected.
7902
* API/JSCallbackObject.cpp:
7903
(KJS::JSCallbackObject::getOwnPropertySlot):
7904
(KJS::JSCallbackObject::put):
7905
(KJS::JSCallbackObject::staticValueGetter):
7906
(KJS::JSCallbackObject::staticFunctionGetter):
7907
(KJS::JSCallbackObject::callbackGetter):
7908
* API/JSObjectRef.h:
7911
(MyObject_hasProperty):
7914
2006-07-16 Geoffrey Garen <ggaren@apple.com>
7918
- Added names to functions.
7920
- Removed GetPrivate/SetPrivate from callbackFunctions and callbackConstructors.
7921
The private data idiom is that a JS object stores its native implementation
7922
as private data. For functions and constructors, the native implementation is nothing
7923
more than the callback they already store, so supporting private data, too,
7924
confuses the idiom. If you *really* want, you can still create a custom
7925
function with private data.
7927
* API/JSCallbackConstructor.cpp:
7928
* API/JSCallbackConstructor.h:
7929
* API/JSCallbackFunction.cpp:
7930
(KJS::JSCallbackFunction::JSCallbackFunction):
7931
* API/JSCallbackFunction.h:
7932
* API/JSCallbackObject.cpp:
7933
(KJS::JSCallbackObject::staticFunctionGetter):
7934
* API/JSObjectRef.cpp:
7935
(JSObjectMakeFunction):
7936
(JSObjectMakeFunctionWithBody):
7937
(JSObjectGetPrivate):
7938
(JSObjectSetPrivate):
7939
* API/JSObjectRef.h:
7945
2006-07-15 Maciej Stachowiak <mjs@apple.com>
7949
- switch property lists to be vector+set of Identifiers instead of list of References
7951
This has the following benefits:
7953
- no duplicates in property lists
7954
- simplifies API calls
7955
- probably more efficient, since linked list is gone
7956
- entirely removed Reference, ReferenceList and ProtectedReference types from the API
7958
* kjs/PropertyNameArray.cpp: Added.
7959
(KJS::PropertyNameArray::add): Check set, if not already there, add to
7961
* kjs/PropertyNameArray.h: Added.
7962
(KJS::PropertyNameArray::PropertyNameArray): Newly added type, combines
7963
a set and a vector to make a unique but ordered list of identifiers.
7964
(KJS::PropertyNameArray::begin): ditto
7965
(KJS::PropertyNameArray::end): ditto
7966
(KJS::PropertyNameArray::size): ditto
7967
(KJS::PropertyNameArray::operator[]): ditto
7968
* kjs/array_instance.h:
7969
* kjs/array_object.cpp:
7970
(ArrayInstance::getPropertyNames): renamed from getPropertyList, updated
7971
for PropertyNameArray
7972
(ArrayInstance::setLength): updated for PropertyNameArray
7973
(ArrayInstance::pushUndefinedObjectsToEnd): ditto
7975
(ForInNode::execute): updated for PropertyNameArray
7978
(KJS::JSObject::getPropertyNames): renamed from getPropertyList, updated
7979
for PropertyNameArray
7981
* kjs/property_map.cpp:
7982
(KJS::PropertyMap::getEnumerablePropertyNames): updated for PropertyNameArray
7983
(KJS::PropertyMap::getSparseArrayPropertyNames): ditto
7984
* kjs/property_map.h:
7985
* kjs/protected_reference.h: Removed.
7986
* kjs/reference.cpp: Removed.
7987
* kjs/reference.h: Removed.
7988
* kjs/reference_list.cpp: Removed.
7989
* kjs/reference_list.h: Removed.
7990
* kjs/scope_chain.cpp:
7991
(KJS::ScopeChain::print): Use PropertyNamesArray instead of ReferenceList.
7992
* kjs/string_object.cpp:
7993
(StringInstance::getPropertyNames): Updated for new approach.
7994
* kjs/string_object.h:
7997
(toJS): Added overload for PropertyNameAccumulatorRef / PropertyNameArray*
8000
* API/JSCallbackObject.cpp:
8001
(KJS::JSCallbackObject::getPropertyNames): Fixed for new API.
8002
* API/JSCallbackObject.h:
8003
* API/JSObjectRef.cpp:
8004
(__JSPropertyNameArray::__JSPropertyNameArray): Type used for a publicly vended
8005
JSPropertyNameArrayRef.
8006
(JSObjectCopyPropertyNames): New API call - renamed / refactored from
8007
JSObjectCreatePropertyList
8008
(JSPropertyNameArrayRetain): new retain call for JSPropertyNameArray.
8009
(JSPropertyNameArrayRelease): new release call for - " -.
8010
(JSPropertyNameArrayGetCount): Instead of having to use a stateful enumerator you
8011
can now get the count and items in any order.
8012
(JSPropertyNameArrayGetNameAtIndex): See above.
8013
(JSPropertyNameAccumulatorAddName): What you add properties to is now an opaque
8015
* API/JSObjectRef.h: Prototyped new functions, removed old ones
8016
* JavaScriptCore.exp: Updated exported symbols.
8017
* JavaScriptCore.xcodeproj/project.pbxproj: Added new files, removed old.
8019
(MyObject_getPropertyNames): Renamed / fixed callback to fit new paradigm.
8020
(main): Updated for new API.
8022
2006-07-15 Darin Adler <darin@apple.com>
8024
- oops, missed a few more arrays that had to be const
8027
(JSNodePrototype_appendChild): Added const.
8028
(JSNodePrototype_removeChild): Ditto.
8029
(JSNodePrototype_replaceChild): Ditto.
8030
(JSNode_construct): Ditto.
8032
(JSNodeListPrototype_item): Ditto.
8033
* API/JSObjectRef.cpp:
8034
(JSObjectMakeFunctionWithBody): Ditto.
8035
(JSObjectCallAsFunction): Ditto.
8036
(JSObjectCallAsConstructor): Ditto.
8040
(MyObject_callAsFunction): Ditto.
8041
(MyObject_callAsConstructor): Ditto.
8042
(print_callAsFunction): Ditto.
8043
(myConstructor_callAsConstructor): Ditto.
8045
2006-07-15 Darin Adler <darin@apple.com>
8049
* API/JSNode.h: Made an array parameter const.
8050
* API/JSObjectRef.h: Made array parameters const. Fixed a comment.
8052
2006-07-15 Geoffrey Garen <ggaren@apple.com>
8056
- JSObjectMakeFunctionWithBody includes a function name and named parameters now.
8058
* API/JSObjectRef.cpp:
8059
(JSObjectMakeFunctionWithBody):
8060
* API/JSObjectRef.h:
8062
(assertEqualsAsUTF8String): More informative failure reporting.
8063
(main): Test more function cases.
8065
2006-07-15 Geoffrey Garen <ggaren@apple.com>
8069
- Moved the arguments passed to JSClassCreate into a single structure,
8070
called JSClassDefinition. This will enable easier structure
8071
migration/versioning in the future, if necessary.
8073
- Added support for class names.
8075
- kJSClassDefinitionNull replaces kJSObjectCallbacksNone.
8077
- JSClass is becoming a fairly complex struct, so I migrated all of its
8078
implementation other than reference counting to the sruct.
8080
- Also moved JSClass* functions in the API to JSObjectRef.cpp, since they're
8081
declared in JSObjectRef.h
8083
- Also added some more informative explanation to the class structure doc.
8085
2006-07-15 Darin Adler <darin@apple.com>
8089
- fix http://bugs.webkit.org/show_bug.cgi?id=8395
8090
<rdar://problem/4613467>
8091
REGRESSION: RegEx seems broken for hex escaped non breaking space
8093
Test: fast/js/regexp-extended-characters-more.html
8096
(match): Got rid of utf16Length local variable to guarantee there's no
8097
extra stack usage in recursive calls. Fixed two places in the PCRE_UTF16
8098
code that were using the length variable, which is the UTF-8 length of
8099
a character in the pattern, to move in the UTF-16 subject string. Instead
8100
they hardcode lengths of 1 and 2 since the code already handles BMP
8101
characters and surrogate pairs separately. Also fixed some DPRINTF so
8102
I could compile with DEBUG on.
8103
(pcre_exec): Changed a place that was checking for multibyte characters
8104
in the subject string to use ISMIDCHAR. Instead it was using hardcoded
8105
logic that was right for UTF-8 but wrong for UTF-16.
8107
* pcre/pcre_compile.c: (pcre_compile2): Fixed a DPRINTF so I could compile
8110
2006-07-14 Geoffrey Garen <ggaren@apple.com>
8114
Global replace in the API of argc/argv with argumentCount/arguments.
8116
2006-07-14 Geoffrey Garen <ggaren@apple.com>
8120
- Finalized exception handling in the API.
8122
setProperty can throw because it throws for built-in arrays. getProperty
8123
and deleteProperty can throw because setProperty can throw and we want
8124
to be consistent, and also because they seem like "actions." callAsFunction,
8125
callAsConstructor, and hasInstance can throw, because they caan throw for
8128
toBoolean can't throw because it's defined that way in the spec.
8130
- Documented that toBoolean and toObject can't be overridden by custom
8131
objects because they're defined that way in the spec.
8133
=== Safari-521.17 ===
8135
2006-07-14 Geoffrey Garen <ggaren@apple.com>
8139
- Implemented ref-counting of JSContexts by splitting into two datatypes:
8140
JSGlobalContext, which you can create/retain/release, and JSContext, which
8143
Internally, you retain a JSGlobalContext/ExecState by retaining its
8144
interpreter, which, in the case of a global ExecState, owns it.
8146
- Also made ~Interpreter() protected to catch places where Interpreter
8147
is manually deleted. (Can't make it private because some crazy fool
8148
decided it would be a good idea to subclass Interpreter in other frameworks.
8152
(toJS): Added cast for new JSGlobalContext
8153
* API/JSStringRef.h: Changed vague "you must" language to more specific
8154
(but, ultimately, equally vague) "behavior is undefined if you don't"
8156
(KJS::Interpreter::Interpreter): Factored more common initialization into
8158
* kjs/interpreter.h:
8159
(KJS::Interpreter::ref): new
8160
(KJS::Interpreter::deref): new
8161
(KJS::Interpreter::refCount): new
8163
(doIt): Ref-count the interpreter.
8165
2006-07-14 Maciej Stachowiak <mjs@apple.com>
8169
- removed bool return value from JSObjectSetProperty, since it is inefficient and
8170
also doesn't work quite right
8171
- added JSObjectGetPropertyAtIndex and JSObjectSetPropertyAtIndex
8173
* API/JSObjectRef.cpp:
8174
(JSObjectSetProperty): Removed return value and canPut stuff.
8175
(JSObjectGetPropertyAtIndex): Added.
8176
(JSObjectSetPropertyAtIndex): Added.
8177
* API/JSObjectRef.h: Prototyped and documented new functions.
8179
2006-07-14 Geoffrey Garen <ggaren@apple.com>
8183
Moved JSCheckScriptSyntax, JSEvaluateScript, and JSGarbageCollect into
8184
JSBase.h/.cpp. They don't belong in the value-specific or context-specific
8185
files because they're not part of the value or context implementations.
8188
* API/JSContextRef.cpp:
8189
(JSContextGetGlobalObject):
8190
* API/JSContextRef.h:
8191
* API/JSValueRef.cpp:
8194
* JavaScriptCore.xcodeproj/project.pbxproj:
8196
2006-07-13 Timothy Hatcher <timothy@apple.com>
8200
Moved JavaScriptCore to be a public framework.
8202
* JavaScriptCore.xcodeproj/project.pbxproj:
8204
2006-07-13 Mark Rowe <opendarwin.org@bdash.net.nz>
8206
Reviewed by Geoffrey.
8208
http://bugs.webkit.org/show_bug.cgi?id=9742
8209
Bug 9742: REGRESSION: WebKit hangs when loading <http://www.vtbook.com>
8212
(KJS::JSValue::getUInt32): Only types tagged as numeric can be converted to UInt32.
8214
2006-07-13 Geoffrey Garen <ggaren@apple.com>
8218
- Renamed JSEvaluate -> JSEvaluateScript, JSCheckSyntax -> JSCheckScriptSyntax
8219
- Added exception out parameters to JSValueTo* and JSValueIsEqual because
8221
- Removed JSObjectGetDescription because it's useless and vague, and
8222
JSValueToString/JSValueIsObjectOfClass do a better job, anyway
8223
- Clarified comments about "IsFunction/Constructor" to indicate that they
8224
are true of all functions/constructors, not just those created by JSObjectMake*
8226
2006-07-12 Geoffrey Garen <ggaren@apple.com>
8230
Finished previously approved JSInternalString -> JSString conversion
8231
by renaming the files.
8233
* API/JSCallbackObject.cpp:
8234
* API/JSInternalStringRef.cpp: Removed.
8235
* API/JSInternalStringRef.h: Removed.
8236
* API/JSStringRef.cpp: Added.
8237
* API/JSStringRef.h: Added.
8238
* API/JavaScriptCore.h:
8239
* JavaScriptCore.xcodeproj/project.pbxproj:
8241
2006-07-12 Geoffrey Garen <ggaren@apple.com>
8245
- Removed context and exception parameters from JSObjectGetPropertyEnumerator,
8246
removing the spurious use of ExecState inside JavaScriptCore that made
8247
us think this was necessary in the first place.
8249
(StringInstance::getPropertyList): Use getString instead of toString because
8250
we know we're dealing with a string -- we put it there in the first place.
8251
While we're at it, store the string's size instead of retrieving it each time
8252
through the loop, to avoid the unnecessary killing of puppies.
8253
* kjs/string_object.h:
8255
2006-07-12 Maciej Stachowiak <mjs@apple.com>
8259
- add handling of hasInstance callback for API objects
8261
* API/JSCallbackObject.cpp:
8262
(KJS::JSCallbackObject::implementsHasInstance): Check if callback is present.
8263
(KJS::JSCallbackObject::hasInstance): Invoke appropriate callback.
8264
* API/JSCallbackObject.h:
8265
* API/JSClassRef.cpp:
8266
* API/JSObjectRef.h:
8268
(MyObject_hasInstance): Test case; should match what construct would do.
8271
2006-07-11 Geoffrey Garen <ggaren@apple.com>
8275
- Implemented a vast number of renames and comment clarifications
8276
suggested during API review.
8278
JSInternalString -> JSString
8279
JS*Make -> JSValueMake*, JSObjectMake*
8280
JSTypeCode -> JSType
8281
JSValueIsInstanceOf -> JSValueIsInstanceOfConstructor (reads strangely well in client code)
8282
JSGC*Protect -> JSValue*Protect
8283
JS*Callback -> JSObject*Callback
8284
JSGetPropertyListCallback -> JSObjectAddPropertiesToListCallback
8285
JSPropertyEnumeratorGetNext -> JSPropertyEnumeratorGetNextName
8287
JSStringCreateWithUTF8CString, JSStringGetUTF8CString,
8288
JSStringGetMaximumUTF8CStringSize JSStringIsEqualToUTF8CString,
8289
JSStringCreateWithCFString, JSStringCopyCFString, JSStringCreateWithCharacters.
8291
- Changed functions taking a JSValue out arg and returning a bool indicating
8292
whether it was set to simply return a JSValue or NULL.
8294
- Removed JSStringGetCharacters because it's more documentation than code,
8295
and it's just a glorified memcpy built on existing API functionality.
8297
- Moved standard library includes into the headers that actually require them.
8299
- Standardized use of the phrase "Create Rule."
8301
- Removed JSLock from make functions that don't allocate.
8303
- Added exception handling to JSValueToBoolean, since we now allow
8304
callback objects to throw exceptions upon converting to boolean.
8306
- Renamed JSGCCollect to JSGarbageCollect.
8308
2006-07-10 Geoffrey Garen <ggaren@apple.com>
8312
- Changed public header includes to the <JavaScriptCore/ style.
8313
- Changed instances of 'buffer' to 'string' since we decided on
8314
JSInternalString instead of JSStringBuffer.
8316
* API/JSContextRef.h:
8317
* API/JSInternalStringRef.cpp:
8319
(JSInternalStringRetain):
8320
(JSInternalStringRelease):
8321
(JSValueCopyStringValue):
8322
(JSInternalStringGetLength):
8323
(JSInternalStringGetCharactersPtr):
8324
(JSInternalStringGetCharacters):
8325
(JSInternalStringGetMaxLengthUTF8):
8326
(JSInternalStringGetCharactersUTF8):
8327
(CFStringCreateWithJSInternalString):
8328
* API/JSInternalStringRef.h:
8330
(JSNodePrototype_appendChild):
8331
(JSNode_getNodeType):
8332
* API/JSObjectRef.cpp:
8333
(JSObjectCallAsConstructor):
8335
* API/JavaScriptCore.h:
8340
(MyObject_getPropertyList):
8341
(myConstructor_callAsConstructor):
8342
(main): I noticed that we were prematurely releasing some string buffers,
8343
so I moved their release calls to the end of main(). I got rid of 'Buf' in *Buf
8344
(sometimes changing to 'IString', when necessary to differentiate a variable)
8345
to match the buffer->string change.
8347
=== Safari-521.16 ===
8349
2006-07-10 Darin Adler <darin@apple.com>
8351
* kjs/value.cpp: (KJS::JSValue::toInt32Inline): Added inline keyword one more place.
8354
2006-07-10 Darin Adler <darin@apple.com>
8356
- fix the release build
8360
(KJS::JSValue::toInt32Inline): Move the code here to an inline.
8361
(KJS::JSValue::toInt32): Call the inline from both overloaded toInt32 functions.
8363
2006-07-10 David Kilzer <ddkilzer@kilzer.net>
8367
- fix http://bugs.webkit.org/show_bug.cgi?id=9179
8368
Implement select.options.add() method
8370
* JavaScriptCore.exp: Added overloaded KJS::JSValue::toInt32() method.
8371
* JavaScriptCore.xcodeproj/project.pbxproj: Altered attributes metadata for
8372
kjs/value.h to make it available as a forwarded header.
8374
(KJS::lookupPut): Extracted a lookupPut() method from the existing lookupPut() method.
8375
The new method returns a boolean value if no entry is found in the lookup table.
8377
(KJS::JSValue::toInt32): Overloaded toInt32() method with boolean "Ok" argument.
8378
* kjs/value.h: Ditto.
8380
2006-07-10 Geoffrey Garen <ggaren@apple.com>
8382
No review necessary. Removed bogus file I accidentally checked in before.
8384
* API/JSInternalSringRef.h: Removed.
8386
2006-07-10 Geoffrey Garen <ggaren@apple.com>
8390
Added exception out parameter to API object callbacks, removed semi-bogus
8391
JSContext(.*)Exception functions.
8393
To make these calls syntactically simple, I added an exceptionSlot()
8394
method to the ExecState class, which provides a JSValue** slot in which to
8395
store a JSValue* exception.
8399
* API/JSCallbackConstructor.cpp:
8400
(KJS::JSCallbackConstructor::construct):
8401
* API/JSCallbackFunction.cpp:
8402
(KJS::JSCallbackFunction::callAsFunction):
8403
* API/JSCallbackObject.cpp:
8404
(KJS::JSCallbackObject::init):
8405
(KJS::JSCallbackObject::getOwnPropertySlot):
8406
(KJS::JSCallbackObject::put):
8407
(KJS::JSCallbackObject::deleteProperty):
8408
(KJS::JSCallbackObject::construct):
8409
(KJS::JSCallbackObject::callAsFunction):
8410
(KJS::JSCallbackObject::getPropertyList):
8411
(KJS::JSCallbackObject::toBoolean):
8412
(KJS::JSCallbackObject::toNumber):
8413
(KJS::JSCallbackObject::toString):
8414
(KJS::JSCallbackObject::staticValueGetter):
8415
(KJS::JSCallbackObject::callbackGetter):
8416
* API/JSContextRef.cpp:
8418
* API/JSContextRef.h:
8420
(JSNodePrototype_appendChild):
8421
(JSNodePrototype_removeChild):
8422
(JSNodePrototype_replaceChild):
8423
(JSNode_getNodeType):
8424
(JSNode_getChildNodes):
8425
(JSNode_getFirstChild):
8429
(JSNodeListPrototype_item):
8430
(JSNodeList_length):
8431
(JSNodeList_getProperty):
8432
* API/JSObjectRef.h:
8436
(MyObject_initialize):
8437
(MyObject_hasProperty):
8438
(MyObject_getProperty):
8439
(MyObject_setProperty):
8440
(MyObject_deleteProperty):
8441
(MyObject_getPropertyList):
8442
(MyObject_callAsFunction):
8443
(MyObject_callAsConstructor):
8444
(MyObject_convertToType):
8445
(print_callAsFunction):
8446
(myConstructor_callAsConstructor):
8448
* JavaScriptCore.exp:
8450
(KJS::ExecState::exceptionHandle):
8452
2006-07-10 Geoffrey Garen <ggaren@apple.com>
8456
Improved type safety by implementing opaque JSValue/JSObject typing through
8457
abuse of 'const', not void*. Also fixed an alarming number of bugs
8458
exposed by this new type safety.
8460
I made one design change in JavaScriptCore, which is that the JSObject
8461
constructor should take a JSValue* as its prototype argument, not a JSObject*,
8462
since we allow the prototype to be any JSValue*, including jsNull(), for
8468
* API/JSCallbackConstructor.cpp:
8469
(KJS::JSCallbackConstructor::construct):
8470
* API/JSCallbackFunction.cpp:
8471
(KJS::JSCallbackFunction::callAsFunction):
8472
* API/JSCallbackObject.cpp:
8473
(KJS::JSCallbackObject::JSCallbackObject):
8474
(KJS::JSCallbackObject::getOwnPropertySlot):
8475
(KJS::JSCallbackObject::put):
8476
(KJS::JSCallbackObject::construct):
8477
(KJS::JSCallbackObject::callAsFunction):
8478
(KJS::JSCallbackObject::staticFunctionGetter):
8479
* API/JSCallbackObject.h:
8480
* API/JSContextRef.cpp:
8483
(JSNodePrototype_appendChild):
8484
(JSNodePrototype_removeChild):
8485
(JSNodePrototype_replaceChild):
8486
* API/JSObjectRef.cpp:
8488
(JSFunctionMakeWithBody):
8489
(JSObjectGetProperty):
8490
(JSObjectCallAsFunction):
8491
(JSObjectCallAsConstructor):
8492
* API/JSObjectRef.h:
8497
(KJS::JSObject::JSObject):
8499
2006-07-10 Geoffrey Garen <ggaren@apple.com>
8501
Approved by Maciej, Darin.
8503
Renamed JSStringBufferRef to JSInternalStringRef. "Internal string" means the
8504
JavaScript engine's internal string representation, which is the most
8505
low-level and efficient representation to use when interfacing with JavaScript.
8511
* API/JSCallbackObject.cpp:
8512
(KJS::JSCallbackObject::getOwnPropertySlot):
8513
(KJS::JSCallbackObject::put):
8514
(KJS::JSCallbackObject::deleteProperty):
8515
(KJS::JSCallbackObject::staticValueGetter):
8516
(KJS::JSCallbackObject::callbackGetter):
8517
* API/JSContextRef.cpp:
8520
* API/JSContextRef.h:
8521
* API/JSInternalStringRef.cpp: Added.
8523
(JSInternalStringCreate):
8524
(JSInternalStringCreateUTF8):
8525
(JSInternalStringRetain):
8526
(JSInternalStringRelease):
8527
(JSValueCopyStringValue):
8528
(JSInternalStringGetLength):
8529
(JSInternalStringGetCharactersPtr):
8530
(JSInternalStringGetCharacters):
8531
(JSInternalStringGetMaxLengthUTF8):
8532
(JSInternalStringGetCharactersUTF8):
8533
(JSInternalStringIsEqual):
8534
(JSInternalStringIsEqualUTF8):
8535
(JSInternalStringCreateCF):
8536
(CFStringCreateWithJSInternalString):
8537
* API/JSInternalStringRef.h: Added.
8539
(JSNodePrototype_appendChild):
8540
(JSNode_getNodeType):
8541
(JSNode_getChildNodes):
8542
(JSNode_getFirstChild):
8544
(JSNodeList_length):
8545
(JSNodeList_getProperty):
8546
* API/JSObjectRef.cpp:
8547
(JSFunctionMakeWithBody):
8548
(JSObjectGetDescription):
8549
(JSObjectHasProperty):
8550
(JSObjectGetProperty):
8551
(JSObjectSetProperty):
8552
(JSObjectDeleteProperty):
8553
(JSPropertyEnumeratorGetNext):
8554
(JSPropertyListAdd):
8555
* API/JSObjectRef.h:
8556
* API/JSStringBufferRef.cpp: Removed.
8557
* API/JSStringBufferRef.h: Removed.
8559
* API/JavaScriptCore.h:
8564
(assertEqualsAsUTF8String):
8565
(assertEqualsAsCharactersPtr):
8566
(assertEqualsAsCharacters):
8567
(MyObject_hasProperty):
8568
(MyObject_getProperty):
8569
(MyObject_setProperty):
8570
(MyObject_deleteProperty):
8571
(MyObject_getPropertyList):
8572
(print_callAsFunction):
8573
(myConstructor_callAsConstructor):
8575
* JavaScriptCore.exp:
8576
* JavaScriptCore.xcodeproj/project.pbxproj:
8578
2006-07-08 Tim Omernick <timo@apple.com>
8582
Added an OpenGL drawing model to the Netscape Plug-in API.
8586
2006-07-08 Timothy Hatcher <timothy@apple.com>
8590
Moved KJS_GetCreatedJavaVMs to jni_utility.cpp.
8591
Switched KJS_GetCreatedJavaVMs over to use dlopen and dlsym
8592
now that NSAddImage, NSLookupSymbolInImage and NSAddressOfSymbol
8593
are deprecated in Leopard.
8595
* JavaScriptCore.exp:
8596
* JavaScriptCore.xcodeproj/project.pbxproj:
8597
* bindings/jni/jni_utility.cpp:
8598
(KJS::Bindings::KJS_GetCreatedJavaVMs):
8599
* bindings/softlinking.c: Removed.
8600
* bindings/softlinking.h: Removed.
8602
2006-07-08 Geoffrey Garen <ggaren@apple.com>
8606
- Make JSObjectGetProperty return a JSValue or NULL, like JSEvaluate does.
8608
* API/JSObjectRef.cpp:
8609
(JSObjectGetProperty):
8610
* API/JSObjectRef.h:
8614
2006-07-08 Geoffrey Garen <ggaren@apple.com>
8616
Style change -- no review necessary.
8618
Use 0 instead of NULL in API .cpp files, to match our style guidelines.
8620
* API/JSContextRef.cpp:
8622
* API/JSObjectRef.cpp:
8623
(JSFunctionMakeWithBody):
8624
(JSObjectCallAsFunction):
8625
(JSObjectCallAsConstructor):
8626
* API/JSValueRef.cpp:
8629
2006-07-08 Geoffrey Garen <ggaren@apple.com>
8633
- Added ability to pass NULL for thisObject when calling JSObjectCallAsFunction,
8634
to match JSEvaluate.
8636
* API/JSObjectRef.cpp:
8637
(JSObjectCallAsFunction):
8638
* API/JSObjectRef.h:
8642
=== Safari-521.15 ===
8644
2006-07-07 Geoffrey Garen <ggaren@apple.com>
8648
- Standardized which functions take a JSContext as an argument. The rule is:
8649
if you might execute JavaScript, you take a JSContext, otherwise you don't.
8651
The FIXME in JSObjectRef.h requires refactoring some parts of Interpreter,
8652
but not API changes, so I'm putting it off until later.
8654
* API/JSCallbackObject.cpp:
8655
(KJS::JSCallbackObject::JSCallbackObject):
8656
(KJS::JSCallbackObject::init):
8657
* API/JSCallbackObject.h:
8658
* API/JSContextRef.cpp:
8660
* API/JSContextRef.h:
8661
* API/JSObjectRef.cpp:
8663
(JSPropertyEnumeratorGetNext):
8664
* API/JSObjectRef.h:
8666
(MyObject_initialize):
8668
* JavaScriptCore.exp:
8669
* kjs/array_object.cpp:
8670
(ArrayInstance::setLength):
8671
(ArrayInstance::pushUndefinedObjectsToEnd):
8673
(ForInNode::execute):
8674
* kjs/reference.cpp:
8675
(KJS::Reference::getPropertyName):
8676
(KJS::Reference::getValue):
8678
* kjs/scope_chain.cpp:
8679
(KJS::ScopeChain::print):
8681
2006-07-06 Geoffrey Garen <ggaren@apple.com>
8687
- Headerdoc finished
8690
- Added a JSContextRef argument to many functions, because you need a
8691
JSContextRef for doing virtually anything. I expect to add this argument
8692
to even more functions in a future patch.
8694
- Removed the globalObjectPrototype argument to JSContextCreate because
8695
you can't create an object until you have a context, so it's impossible
8696
to pass a prototype object to JSContextCreate. That's OK because (1) there's
8697
no reason to give the global object a prototype and (2) if you really want
8698
to, you can just use a separate call to JSObjectSetPrototype.
8700
- Removed the JSClassRef argument to JSClassCreate because it was unnecessary,
8701
and you need to be able to make the global object's class before you've
8702
created a JSContext.
8704
- Added an optional exception parameter to JSFunctionMakeWithBody because anything
8705
less would be uncivilized.
8707
- Made the return value parameter to JSObjectGetProperty optional to match
8708
all other return value parameters in the API.
8710
- Made JSObjectSetPrivate/JSObjectGetPrivate work on JSCallbackFunctions
8711
and JSCallbackConstructors. You could use an abstract base class or strategic
8712
placement of m_privateData in the class structure to implement this, but
8713
the former seemed like overkill, and the latter seemed too dangerous.
8715
- Fixed a bug where JSPropertyEnumeratorGetNext would skip the first property.
8718
- Reversed the logic of the JSChar #ifdef to avoid confusing headerdoc
8720
- Removed function names from @function declarations because headeroc
8721
can parse them automatically, and I wanted to rule out manual mismatch.
8723
- Changed Error::create to take a const UString& instead of a UString*
8724
because it was looking at me funny.
8726
- Renamed JSStringBufferCreateWithCFString to JSStringBufferCreateCF
8727
because the latter is more concise and it matches JSStringBufferCreateUTF8.
8729
* API/JSCallbackObject.cpp:
8730
(KJS::JSCallbackObject::getOwnPropertySlot):
8731
(KJS::JSCallbackObject::put):
8732
(KJS::JSCallbackObject::deleteProperty):
8733
(KJS::JSCallbackObject::getPropertyList):
8734
(KJS::JSCallbackObject::toBoolean):
8735
(KJS::JSCallbackObject::toNumber):
8736
(KJS::JSCallbackObject::toString):
8737
* API/JSClassRef.cpp:
8739
* API/JSContextRef.cpp:
8741
(JSContextSetException):
8742
* API/JSContextRef.h:
8744
(JSNodePrototype_class):
8747
(JSNodeListPrototype_class):
8749
* API/JSObjectRef.cpp:
8750
(JSObjectGetProperty):
8751
(JSObjectGetPrivate):
8752
(JSObjectSetPrivate):
8753
(JSObjectCallAsFunction):
8754
(JSObjectCallAsConstructor):
8755
(JSPropertyEnumeratorGetNext):
8756
* API/JSObjectRef.h:
8757
* API/JSStringBufferRef.cpp:
8758
(JSStringBufferCreateCF):
8759
* API/JSStringBufferRef.h:
8760
* API/JSValueRef.cpp:
8761
(JSValueIsInstanceOf):
8767
(MyObject_hasProperty):
8768
(MyObject_setProperty):
8769
(MyObject_deleteProperty):
8770
(MyObject_getPropertyList):
8771
(MyObject_convertToType):
8774
* JavaScriptCore.exp:
8776
2006-07-07 Geoffrey Garen <ggaren@apple.com>
8780
- Fixed a few crashes resulting from NULL parameters to JSClassCreate.
8782
* API/JSClassRef.cpp:
8785
* API/testapi.c: Added test for NULL parameters.
8788
2006-07-07 Geoffrey Garen <ggaren@apple.com>
8790
Reviewed by John, mocked by Darin.
8792
- Changed JSEvaluate to take a JSObjectRef instead of a JSValueRef as
8793
"this," since "this" must be an object.
8795
* API/JSContextRef.cpp:
8797
* API/JSContextRef.h:
8799
2006-07-07 Geoffrey Garen <ggaren@apple.com>
8806
* JavaScriptCore.xcodeproj/project.pbxproj:
8808
2006-07-05 Geoffrey Garen <ggaren@apple.com>
8812
Renamed JSCharBufferRef, which was universally unpopular, to JSStringBufferRef,
8813
which, hopefully, will be less unpopular.
8819
* API/JSCallbackObject.cpp:
8820
(KJS::JSCallbackObject::getOwnPropertySlot):
8821
(KJS::JSCallbackObject::put):
8822
(KJS::JSCallbackObject::deleteProperty):
8823
(KJS::JSCallbackObject::staticValueGetter):
8824
(KJS::JSCallbackObject::callbackGetter):
8825
* API/JSCharBufferRef.cpp: Removed.
8826
* API/JSCharBufferRef.h: Removed.
8827
* API/JSContextRef.cpp:
8830
* API/JSContextRef.h:
8832
(JSNodePrototype_appendChild):
8833
(JSNode_getNodeType):
8834
(JSNode_getChildNodes):
8835
(JSNode_getFirstChild):
8837
(JSNodeList_length):
8838
(JSNodeList_getProperty):
8839
* API/JSObjectRef.cpp:
8840
(JSFunctionMakeWithBody):
8841
(JSObjectGetDescription):
8842
(JSObjectHasProperty):
8843
(JSObjectGetProperty):
8844
(JSObjectSetProperty):
8845
(JSObjectDeleteProperty):
8846
(JSPropertyEnumeratorGetNext):
8847
(JSPropertyListAdd):
8848
* API/JSObjectRef.h:
8849
* API/JSStringBufferRef.cpp: Added.
8851
(JSStringBufferCreate):
8852
(JSStringBufferCreateUTF8):
8853
(JSStringBufferRetain):
8854
(JSStringBufferRelease):
8855
(JSValueCopyStringValue):
8856
(JSStringBufferGetLength):
8857
(JSStringBufferGetCharactersPtr):
8858
(JSStringBufferGetCharacters):
8859
(JSStringBufferGetMaxLengthUTF8):
8860
(JSStringBufferGetCharactersUTF8):
8861
(JSStringBufferIsEqual):
8862
(JSStringBufferIsEqualUTF8):
8863
(JSStringBufferCreateWithCFString):
8864
(CFStringCreateWithJSStringBuffer):
8865
* API/JSStringBufferRef.h: Added.
8867
* API/JavaScriptCore.h:
8872
(assertEqualsAsUTF8String):
8873
(assertEqualsAsCharactersPtr):
8874
(assertEqualsAsCharacters):
8875
(MyObject_hasProperty):
8876
(MyObject_getProperty):
8877
(MyObject_setProperty):
8878
(MyObject_deleteProperty):
8879
(MyObject_getPropertyList):
8880
(print_callAsFunction):
8881
(myConstructor_callAsConstructor):
8883
* JavaScriptCore.exp:
8884
* JavaScriptCore.xcodeproj/project.pbxproj:
8886
2006-07-05 Geoffrey Garen <ggaren@apple.com>
8890
Moved some code around for more logical file separation.
8893
* API/JSContextRef.h:
8894
* API/JSObjectRef.cpp:
8895
* API/JSValueRef.cpp:
8899
2006-07-03 Geoffrey Garen <ggaren@apple.com>
8903
Implemented JSFunctionMakeWithBody, which parses a script as a function body
8904
in the global scope, and returns the resulting anonymous function.
8906
I also removed private data from JSCallbackFunction. It never worked,
8907
since JSCallbackFunction doesn't inherit from JSCallbackObject.
8909
* API/JSCallbackConstructor.cpp: Removed.
8910
* API/JSCallbackConstructor.h: Removed.
8911
* API/JSCallbackFunction.cpp:
8912
(KJS::JSCallbackFunction::JSCallbackFunction):
8913
(KJS::JSCallbackFunction::implementsConstruct):
8914
(KJS::JSCallbackFunction::construct):
8915
(KJS::JSCallbackFunction::implementsCall):
8916
(KJS::JSCallbackFunction::callAsFunction):
8917
* API/JSCallbackFunction.h:
8918
* API/JSCallbackObject.cpp:
8919
(KJS::JSCallbackObject::staticFunctionGetter):
8920
* API/JSObjectRef.cpp:
8922
(JSFunctionMakeWithCallbacks):
8923
* API/JSObjectRef.h:
8929
* JavaScriptCore.exp: Programmatically added all symbols exported by
8930
API object files, and sorted results
8931
* JavaScriptCore.xcodeproj/project.pbxproj:
8933
2006-07-03 Geoffrey Garen <ggaren@apple.com>
8937
- Return syntax error in JSCheckSyntax through a JSValueRef* exception
8941
* API/JSContextRef.cpp:
8945
* JavaScriptCore.exp:
8946
* kjs/interpreter.cpp:
8947
(KJS::Interpreter::checkSyntax):
8948
* kjs/interpreter.h:
8950
2006-07-04 Darin Adler <darin@apple.com>
8954
* wtf/MathExtras.h: Oops. Added missing #endif.
8956
2006-07-04 Bjoern Graf <bjoern.graf@gmail.com>
8959
Tweaked a bit by Darin.
8961
- http://bugs.webkit.org/show_bug.cgi?id=9678
8962
work around MSVCRT's fmod function returning NaN for fmod(x, infinity) instead of x
8964
* wtf/MathExtras.h: Added include of <float.h>.
8965
(isinf): Fix to return false for NAN.
8966
(wtf_fmod): Added. An inline that works around the bug.
8969
* kjs/number_object.cpp:
8970
* kjs/operations.cpp:
8972
Added includes of MathExtras.h to all files using fmod.
8974
* JavaScriptCore.xcodeproj/project.pbxproj: Let Xcode 2.3 have its way with
8977
2006-07-01 Geoffrey Garen <ggaren@apple.com>
8981
- Refined value conversions in the API:
8982
- failed toNumber returns NaN
8983
- failed toObject returns NULL
8984
- failed toString returns empty string
8986
- Refined excpetion handling in the API:
8987
- failed value conversions do not throw exceptions
8988
- uncaught exceptions in JSEvaluate, JSObjectCallAsFunction, and
8989
JSObjectCallAsConstructor are returned through a JSValueRef* exception
8991
- removed JSContextHasException, because JSContextGetException does
8995
* API/JSCharBufferRef.cpp:
8996
(JSValueCopyStringValue):
8997
* API/JSContextRef.cpp:
8999
* API/JSContextRef.h:
9000
* API/JSNodeList.c: Added test code demonstrating how you would use
9001
toNumber, and why you probably don't need toUInt32, etc.
9002
(JSNodeListPrototype_item):
9003
(JSNodeList_getProperty):
9004
* API/JSObjectRef.cpp:
9006
(JSObjectCallAsFunction):
9007
(JSObjectCallAsConstructor):
9008
* API/JSObjectRef.h:
9009
* API/JSValueRef.cpp:
9015
(main): Added tests for new rules, and call to JSGCProtect to fix Intel
9017
* JavaScriptCore.exp:
9019
2006-07-03 Darin Adler <darin@apple.com>
9021
- Rolled out HashMap implementation of NPRuntime, at least temporarily.
9023
Fixes hang in the bindings section of layout tests seen on the
9026
This code was using HashMap<const char*, PrivateIdentifier*>.
9027
But that hashes based on pointer identity, not string value.
9028
The default hash for any pointer type is to hash based on the pointer.
9029
And WTF doesn't currently have a string hash for char*.
9030
We'll need to fix that before re-landing this patch.
9032
(Formatting was also incorrect -- extra spaces in parentheses.)
9034
* bindings/npruntime.cpp: Rolled out last change.
9036
2006-07-02 Justin Haygood <jhaygood@spsu.edu>
9038
Reviewed, tweaked, landed by ggaren.
9040
- Port NPRuntime from CFDictionary to HashMap.
9042
* bindings/npruntime.cpp:
9043
(getStringIdentifierDictionary):
9044
(getIntIdentifierDictionary):
9045
(_NPN_GetStringIdentifier):
9046
(_NPN_GetIntIdentifier):
9047
* bindings/npruntime.h:
9049
2006-07-01 Geoffrey Garen <ggaren@apple.com>
9053
- Fixed <rdar://problem/4611197> REGRESSION: Liveconnect with Java test
9054
fails at http://www-sor.inria.fr/~dedieu/notes/liveconnect/simple_example.html
9056
* JavaScriptCore.exp: Export symbols used by liveconnect
9058
2006-06-29 Geoffrey Garen <ggaren@apple.com>
9062
- Phase 2 in the JS API.
9064
- Added support for specifying static tables of values -- this should
9065
obviate the need for using complicated callbacks for most lookups.
9067
- API objects are now created with classes (JSClassRef) -- in order to support
9068
static values, and in order to prevent API objects from storing their
9069
data inline, and thus falling into the oversized (read: slow and prone to
9070
giving Maciej the frowny face) heap.
9072
- Added two specialized JSObject subclasses -- JSCallbackFunction and JSCallbackConstructor --
9073
to allow JSFunctionMake and JSConstructorMake to continue to work with
9074
the new class model. Another solution to this problem would be to create
9075
a custom class object for each function and constructor you make. This
9076
solution is more code but also more efficient.
9078
- Substantially beefed up the minidom example to demonstrate and test a
9079
lot of these techniques. Its output is still pretty haphazard, though.
9081
- Gave the <kjs/ preface to some includes -- I'm told this matters to
9082
building on some versions of Linux.
9084
- Implemented JSValueIsInstanceOf and JSValueIsObjectOfClass
9086
- Removed GetDescription callback. Something in the class datastructure
9087
should take care of this.
9090
* API/JSCallbackConstructor.cpp: Added.
9092
(KJS::JSCallbackConstructor::JSCallbackConstructor):
9093
(KJS::JSCallbackConstructor::implementsConstruct):
9094
(KJS::JSCallbackConstructor::construct):
9095
(KJS::JSCallbackConstructor::setPrivate):
9096
(KJS::JSCallbackConstructor::getPrivate):
9097
* API/JSCallbackConstructor.h: Added.
9098
(KJS::JSCallbackConstructor::classInfo):
9099
* API/JSCallbackFunction.cpp: Added.
9101
(KJS::JSCallbackFunction::JSCallbackFunction):
9102
(KJS::JSCallbackFunction::implementsCall):
9103
(KJS::JSCallbackFunction::callAsFunction):
9104
(KJS::JSCallbackFunction::setPrivate):
9105
(KJS::JSCallbackFunction::getPrivate):
9106
* API/JSCallbackFunction.h: Added.
9107
(KJS::JSCallbackFunction::classInfo):
9108
* API/JSCallbackObject.cpp:
9110
(KJS::JSCallbackObject::JSCallbackObject):
9111
(KJS::JSCallbackObject::init):
9112
(KJS::JSCallbackObject::~JSCallbackObject):
9113
(KJS::JSCallbackObject::className):
9114
(KJS::JSCallbackObject::getOwnPropertySlot):
9115
(KJS::JSCallbackObject::put):
9116
(KJS::JSCallbackObject::deleteProperty):
9117
(KJS::JSCallbackObject::implementsConstruct):
9118
(KJS::JSCallbackObject::construct):
9119
(KJS::JSCallbackObject::implementsCall):
9120
(KJS::JSCallbackObject::callAsFunction):
9121
(KJS::JSCallbackObject::getPropertyList):
9122
(KJS::JSCallbackObject::toBoolean):
9123
(KJS::JSCallbackObject::toNumber):
9124
(KJS::JSCallbackObject::toString):
9125
(KJS::JSCallbackObject::inherits):
9126
(KJS::JSCallbackObject::staticValueGetter):
9127
(KJS::JSCallbackObject::staticFunctionGetter):
9128
(KJS::JSCallbackObject::callbackGetter):
9129
* API/JSCallbackObject.h:
9130
* API/JSCharBufferRef.cpp:
9131
* API/JSClassRef.cpp: Added.
9135
* API/JSClassRef.h: Added.
9136
(StaticValueEntry::StaticValueEntry):
9137
(StaticFunctionEntry::StaticFunctionEntry):
9138
(__JSClass::__JSClass):
9139
* API/JSContextRef.cpp:
9142
* API/JSContextRef.h:
9143
* API/JSNode.c: Added.
9144
(JSNodePrototype_appendChild):
9145
(JSNodePrototype_removeChild):
9146
(JSNodePrototype_replaceChild):
9147
(JSNodePrototype_class):
9148
(JSNode_getNodeType):
9149
(JSNode_getChildNodes):
9150
(JSNode_getFirstChild):
9156
* API/JSNode.h: Added.
9157
* API/JSNodeList.c: Added.
9158
(JSNodeListPrototype_item):
9159
(JSNodeListPrototype_class):
9160
(JSNodeList_length):
9161
(JSNodeList_getProperty):
9162
(JSNodeList_finalize):
9164
(JSNodeList_prototype):
9166
* API/JSNodeList.h: Added.
9167
* API/JSObjectRef.cpp:
9170
(JSConstructorMake):
9171
(__JSPropertyEnumerator::__JSPropertyEnumerator):
9172
(JSObjectCreatePropertyEnumerator):
9173
(JSPropertyEnumeratorGetNext):
9174
(JSPropertyEnumeratorRetain):
9175
(JSPropertyEnumeratorRelease):
9176
* API/JSObjectRef.h:
9177
(__JSObjectCallbacks::):
9178
* API/JSValueRef.cpp:
9179
(JSValueIsObjectOfClass):
9180
(JSValueIsInstanceOf):
9182
* API/Node.c: Added.
9186
(Node_replaceChild):
9189
* API/Node.h: Added.
9190
* API/NodeList.c: Added.
9196
* API/NodeList.h: Added.
9200
(createStringWithContentsOfFile):
9203
(assertEqualsAsCharacters):
9204
(MyObject_getProperty):
9206
(myConstructor_callAsConstructor):
9209
* JavaScriptCore.xcodeproj/project.pbxproj:
9211
2006-06-26 Kevin Ollivier <kevino@theolliviers.com>
9213
Reviewed and tweaked by Darin.
9215
- Compile fixes for wx port / gcc 4.0.2
9217
* kjs/array_object.cpp:
9218
Added missing headers.
9221
gcc needs class prototypes before defining those classes as friend classes
9223
2006-06-30 Mike Emmel <mike.emmel@gmail.com>
9227
Compilation fixes for Linux/Gdk.
9229
* JavaScriptCore/kjs/interpreter.cpp: added include of signal.h
9230
* JavaScriptCore/kjs/ExecState.h: added missing class declaration
9231
* JavaScriptCore/kjs/ExecState.cpp: case wrong on include of context.h
9232
* JavaScriptCore/JavaScriptCoreSources.bkl: added Context.cpp and ExecState.cpp
9234
=== Safari-521.14 ===
9236
2006-06-29 Maciej Stachowiak <mjs@apple.com>
9240
- add headerdoc comments to some of the new JS API headers
9245
2006-06-28 Timothy Hatcher <timothy@apple.com>
9247
Prefer the Stabs debugging symbols format until DWARF bugs are fixed.
9249
* JavaScriptCore.xcodeproj/project.pbxproj:
9251
2006-06-27 Timothy Hatcher <timothy@apple.com>
9255
<rdar://problem/4448350> Deprecated ObjC language API used in JavaScriptCore, WebCore, WebKit and WebBrowser
9257
Switch to the new ObjC 2 API, ifdefed the old code around OBJC_API_VERSION so it still works on Tiger.
9258
Removed the use of the old stringWithCString, switched to the new Tiger version that accepts an encoding.
9259
Lots of code style cleanup.
9261
* JavaScriptCore.xcodeproj/project.pbxproj:
9262
* bindings/objc/objc_class.h:
9263
* bindings/objc/objc_class.mm:
9264
(KJS::Bindings::ObjcClass::~ObjcClass):
9265
(KJS::Bindings::_createClassesByIsAIfNecessary):
9266
(KJS::Bindings::ObjcClass::classForIsA):
9267
(KJS::Bindings::ObjcClass::name):
9268
(KJS::Bindings::ObjcClass::methodsNamed):
9269
(KJS::Bindings::ObjcClass::fieldNamed):
9270
(KJS::Bindings::ObjcClass::fallbackObject):
9271
* bindings/objc/objc_header.h:
9272
* bindings/objc/objc_instance.h:
9273
* bindings/objc/objc_instance.mm:
9274
(ObjcInstance::ObjcInstance):
9275
(ObjcInstance::~ObjcInstance):
9276
(ObjcInstance::operator=):
9277
(ObjcInstance::begin):
9278
(ObjcInstance::end):
9279
(ObjcInstance::getClass):
9280
(ObjcInstance::invokeMethod):
9281
(ObjcInstance::invokeDefaultMethod):
9282
(ObjcInstance::setValueOfField):
9283
(ObjcInstance::supportsSetValueOfUndefinedField):
9284
(ObjcInstance::setValueOfUndefinedField):
9285
(ObjcInstance::getValueOfField):
9286
(ObjcInstance::getValueOfUndefinedField):
9287
(ObjcInstance::defaultValue):
9288
(ObjcInstance::stringValue):
9289
(ObjcInstance::numberValue):
9290
(ObjcInstance::booleanValue):
9291
(ObjcInstance::valueOf):
9292
* bindings/objc/objc_runtime.h:
9293
* bindings/objc/objc_runtime.mm:
9294
(ObjcMethod::ObjcMethod):
9296
(ObjcMethod::getMethodSignature):
9297
(ObjcMethod::setJavaScriptName):
9300
(ObjcField::valueFromInstance):
9301
(convertValueToObjcObject):
9302
(ObjcField::setValueToInstance):
9303
(ObjcArray::operator=):
9304
(ObjcArray::setValueAt):
9305
(ObjcArray::valueAt):
9306
(ObjcFallbackObjectImp::ObjcFallbackObjectImp):
9307
(ObjcFallbackObjectImp::callAsFunction):
9308
(ObjcFallbackObjectImp::defaultValue):
9310
2006-06-28 Anders Carlsson <acarlsson@apple.com>
9314
http://bugs.webkit.org/show_bug.cgi?id=8636
9315
REGRESSION: JavaScript access to Java applet causes hang (_webViewURL not implemented)
9317
* bindings/jni/jni_objc.mm:
9318
(KJS::Bindings::dispatchJNICall):
9319
Just pass nil as the calling URL. This will cause the Java plugin to use the URL of the page
9320
containing the applet (which is what we used to do).
9322
2006-06-27 Timothy Hatcher <timothy@apple.com>
9326
<rdar://problem/4406785> Add an export file to TOT JavaScriptCore like the Safari-2-0-branch
9328
* JavaScriptCore.exp: Added.
9329
* JavaScriptCore.xcodeproj/project.pbxproj:
9331
2006-06-25 Geoffrey Garen <ggaren@apple.com>
9335
- Added JSConstructorMake to match JSFunctionMake, along with test code.
9337
[ I checked in the ChangeLog before without the actual files. ]
9339
* API/JSObjectRef.cpp:
9340
(JSConstructorMake):
9341
* API/JSObjectRef.h:
9343
(myConstructor_callAsConstructor):
9347
* JavaScriptCore.xcodeproj/project.pbxproj: Moved testapi.c to the testapi
9348
target -- this was an oversight in my earlier check-in.
9350
2006-06-25 Timothy Hatcher <timothy@apple.com>
9354
Bug 9574: Drosera should show inline scripts within the original HTML
9355
http://bugs.webkit.org/show_bug.cgi?id=9574
9357
Pass the starting line number and error message to the debugger.
9360
(Debugger::sourceParsed):
9363
(KJS::GlobalFuncImp::callAsFunction):
9364
* kjs/function_object.cpp:
9365
(FunctionObjectImp::construct):
9366
* kjs/interpreter.cpp:
9367
(KJS::Interpreter::evaluate):
9369
2006-06-24 Alexey Proskuryakov <ap@nypop.com>
9371
Rubber-stamped by Eric.
9373
Add a -h (do not follow symlinks) option to ln in derived sources build script (without it,
9374
a symlink was created inside the source directory on second build).
9376
* JavaScriptCore.xcodeproj/project.pbxproj:
9378
2006-06-24 David Kilzer <ddkilzer@kilzer.net>
9380
Reviewed by Timothy.
9382
* Info.plist: Fixed copyright to include 2003-2006.
9384
2006-06-24 Alexey Proskuryakov <ap@nypop.com>
9388
- http://bugs.webkit.org/show_bug.cgi?id=9418
9389
WebKit will not build when Space exists in path
9391
* JavaScriptCore.xcodeproj/project.pbxproj: Enclose search paths in quotes; create symlinks to
9392
avoid passing paths with spaces to make.
9394
2006-06-23 Timothy Hatcher <timothy@apple.com>
9398
Adding more operator[] overloads for long and short types.
9401
(WTF::Vector::operator[]):
9403
=== JavaScriptCore-521.13 ===
9405
2006-06-22 Alexey Proskuryakov <ap@nypop.com>
9409
- http://bugs.webkit.org/show_bug.cgi?id=9539
9410
Another case error preventing build
9412
* API/JSObjectRef.cpp: Changed "identifier.h" to "Identifier.h"
9414
2006-06-22 David Kilzer <ddkilzer@kilzer.net>
9418
http://bugs.webkit.org/show_bug.cgi?id=9539
9419
Another case error preventing build
9421
* API/APICast.h: Changed "UString.h" to "ustring.h".
9423
2006-06-21 Geoffrey Garen <ggaren@apple.com>
9425
Fixed release build, fixed accidental infinite recursion due to
9426
last minute global replace gone awry.
9431
(assertEqualsAsBoolean):
9432
(assertEqualsAsNumber):
9433
(assertEqualsAsUTF8String):
9434
(assertEqualsAsCharactersPtr):
9435
* JavaScriptCore.xcodeproj/project.pbxproj:
9437
2006-06-21 Geoffrey Garen <ggaren@apple.com>
9441
- First cut at C API to JavaScript. Includes a unit test, 'testapi.c',
9442
and the outline of a test app, 'minidom.c'.
9444
Includes one change to JSC internals: Rename propList to getPropertyList and have it
9445
take its target property list by reference so that subclasses can
9446
add properties to the list before calling through to their superclasses.
9448
Also, I just ran prepare-ChangeLog in about 10 seconds, and I would like
9449
to give a shout-out to that.
9451
* API/APICast.h: Added.
9454
* API/JSBase.h: Added.
9455
* API/JSCallbackObject.cpp: Added.
9457
(KJS::JSCallbackObject::JSCallbackObject):
9458
(KJS::JSCallbackObject::~JSCallbackObject):
9459
(KJS::JSCallbackObject::className):
9460
(KJS::JSCallbackObject::getOwnPropertySlot):
9461
(KJS::JSCallbackObject::put):
9462
(KJS::JSCallbackObject::deleteProperty):
9463
(KJS::JSCallbackObject::implementsConstruct):
9464
(KJS::JSCallbackObject::construct):
9465
(KJS::JSCallbackObject::implementsCall):
9466
(KJS::JSCallbackObject::callAsFunction):
9467
(KJS::JSCallbackObject::getPropertyList):
9468
(KJS::JSCallbackObject::toBoolean):
9469
(KJS::JSCallbackObject::toNumber):
9470
(KJS::JSCallbackObject::toString):
9471
(KJS::JSCallbackObject::setPrivate):
9472
(KJS::JSCallbackObject::getPrivate):
9473
(KJS::JSCallbackObject::cachedValueGetter):
9474
(KJS::JSCallbackObject::callbackGetter):
9475
* API/JSCallbackObject.h: Added.
9476
(KJS::JSCallbackObject::classInfo):
9477
* API/JSCharBufferRef.cpp: Added.
9479
(JSCharBufferCreate):
9480
(JSCharBufferCreateUTF8):
9481
(JSCharBufferRetain):
9482
(JSCharBufferRelease):
9483
(JSValueCopyStringValue):
9484
(JSCharBufferGetLength):
9485
(JSCharBufferGetCharactersPtr):
9486
(JSCharBufferGetCharacters):
9487
(JSCharBufferGetMaxLengthUTF8):
9488
(JSCharBufferGetCharactersUTF8):
9489
(JSCharBufferIsEqual):
9490
(JSCharBufferIsEqualUTF8):
9491
(JSCharBufferCreateWithCFString):
9492
(CFStringCreateWithJSCharBuffer):
9493
* API/JSCharBufferRef.h: Added.
9494
* API/JSContextRef.cpp: Added.
9497
(JSContextGetGlobalObject):
9500
(JSContextHasException):
9501
(JSContextGetException):
9502
(JSContextClearException):
9503
(JSContextSetException):
9504
* API/JSContextRef.h: Added.
9505
* API/JSObjectRef.cpp: Added.
9509
(JSObjectGetDescription):
9510
(JSObjectGetPrototype):
9511
(JSObjectSetPrototype):
9512
(JSObjectHasProperty):
9513
(JSObjectGetProperty):
9514
(JSObjectSetProperty):
9515
(JSObjectDeleteProperty):
9516
(JSObjectGetPrivate):
9517
(JSObjectSetPrivate):
9518
(JSObjectIsFunction):
9519
(JSObjectCallAsFunction):
9520
(JSObjectIsConstructor):
9521
(JSObjectCallAsConstructor):
9522
(__JSPropertyListEnumerator::__JSPropertyListEnumerator):
9523
(JSObjectCreatePropertyEnumerator):
9524
(JSPropertyEnumeratorGetNext):
9525
(JSPropertyEnumeratorRetain):
9526
(JSPropertyEnumeratorRelease):
9527
(JSPropertyListAdd):
9528
* API/JSObjectRef.h: Added.
9529
* API/JSValueRef.cpp: Added.
9531
(JSValueIsUndefined):
9538
(JSValueIsStrictEqual):
9548
* API/JSValueRef.h: Added.
9549
* API/JavaScriptCore.h: Added.
9550
* API/minidom.c: Added.
9552
* API/minidom.html: Added.
9553
* API/minidom.js: Added.
9554
* API/testapi.c: Added.
9555
(assertEqualsAsBoolean):
9556
(assertEqualsAsNumber):
9557
(assertEqualsAsUTF8String):
9558
(assertEqualsAsCharactersPtr):
9559
(assertEqualsAsCharacters):
9560
(MyObject_initialize):
9561
(MyObject_copyDescription):
9562
(MyObject_hasProperty):
9563
(MyObject_getProperty):
9564
(MyObject_setProperty):
9565
(MyObject_deleteProperty):
9566
(MyObject_getPropertyList):
9567
(MyObject_callAsFunction):
9568
(MyObject_callAsConstructor):
9569
(MyObject_convertToType):
9570
(MyObject_finalize):
9571
(print_callAsFunction):
9573
(createStringWithContentsOfFile):
9574
* API/testapi.js: Added.
9576
* JavaScriptCore.xcodeproj/project.pbxproj:
9577
* bindings/npruntime_impl.h:
9578
* kjs/array_instance.h:
9579
* kjs/array_object.cpp:
9580
(ArrayInstance::getPropertyList):
9581
* kjs/interpreter.cpp:
9582
(KJS::Interpreter::evaluate):
9584
(ForInNode::execute):
9586
(KJS::JSObject::put):
9587
(KJS::JSObject::canPut):
9588
(KJS::JSObject::deleteProperty):
9589
(KJS::JSObject::propertyIsEnumerable):
9590
(KJS::JSObject::getPropertyAttributes):
9591
(KJS::JSObject::getPropertyList):
9593
* kjs/property_map.cpp:
9594
(KJS::PropertyMap::get):
9595
* kjs/property_map.h:
9596
* kjs/scope_chain.cpp:
9597
(KJS::ScopeChain::print):
9598
* kjs/string_object.cpp:
9599
(StringInstance::getPropertyList):
9600
* kjs/string_object.h:
9602
(KJS::UString::Rep::ref):
9604
2006-06-20 Timothy Hatcher <timothy@apple.com>
9608
Make sure we clear the exception before returning so
9609
that future calls will not fail because of an earlier
9610
exception state. Assert on entry that the WebScriptObject
9611
is working with an ExecState that dose not have an exception.
9612
Document that evaluateWebScript and callWebScriptMethod return
9613
WebUndefined when an exception is thrown.
9615
* bindings/objc/WebScriptObject.h:
9616
* bindings/objc/WebScriptObject.mm:
9617
(-[WebScriptObject callWebScriptMethod:withArguments:]):
9618
(-[WebScriptObject evaluateWebScript:]):
9619
(-[WebScriptObject setValue:forKey:]):
9620
(-[WebScriptObject valueForKey:]):
9621
(-[WebScriptObject removeWebScriptKey:]):
9622
(-[WebScriptObject webScriptValueAtIndex:]):
9623
(-[WebScriptObject setWebScriptValueAtIndex:value:]):
9625
2006-06-19 Anders Carlsson <acarlsson@apple.com>
9629
* kjs/interpreter.cpp:
9630
(KJS::TimeoutChecker::pauseTimeoutCheck):
9631
(KJS::TimeoutChecker::resumeTimeoutCheck):
9632
Fix argument order in setitimer calls.
9634
2006-06-18 Anders Carlsson <acarlsson@apple.com>
9638
* kjs/interpreter.cpp:
9639
(KJS::TimeoutChecker::pauseTimeoutCheck):
9640
Do nothing if the timeout check hasn't been started.
9642
(KJS::TimeoutChecker::resumeTimeoutCheck):
9643
Do nothing if the timeout check hasn't been started.
9644
Use the right signal handler when unblocking.
9646
(KJS::Interpreter::handleTimeout):
9647
pause/resume the timeout check around the call to
9648
shouldInterruptScript().
9650
2006-06-16 Ben Goodger <beng@google.com>
9654
http://bugs.webkit.org/show_bug.cgi?id=9491
9655
Windows build breaks in interpreter.cpp
9657
* kjs/interpreter.cpp
9658
(KJS::TimeoutChecker::pauseTimeoutCheck):
9659
(KJS::TimeoutChecker::resumeTimeoutCheck):
9660
Make sure to only assert equality with s_executingInterpreter when it
9661
is being used (i.e. when HAVE(SYS_TIME_H) == true)
9663
2006-06-17 David Kilzer <ddkilzer@kilzer.net>
9667
http://bugs.webkit.org/show_bug.cgi?id=9477
9668
REGRESSION: fast/dom/replaceChild.html crashes on WebKit ToT in debug build
9671
(KJS::FunctionImp::callAsFunction): Refetch the debugger after executing the function
9672
in case the WebFrame it was running in has since been destroyed.
9674
2006-06-17 David Kilzer <ddkilzer@kilzer.net>
9678
http://bugs.webkit.org/show_bug.cgi?id=9476
9679
REGRESSION: Reproducible crash after closing window after viewing
9680
css2.1/t0803-c5501-imrgn-t-00-b-ag.html
9683
(Debugger::detach): Call setDebugger(0) for all interpreters removed from
9684
the 'attached to a debugger' list.
9686
2006-06-17 Anders Carlsson <acarlsson@apple.com>
9688
Reviewed by Maciej and Geoff.
9690
http://bugs.webkit.org/show_bug.cgi?id=7080
9691
Provide some way to stop a JavaScript infinite loop
9695
Add Interrupted completion type.
9698
(KJS::FunctionImp::callAsFunction):
9699
(KJS::GlobalFuncImp::callAsFunction):
9700
Only set the exception on the new ExecState if the current one has had one.
9702
* kjs/interpreter.cpp:
9703
(KJS::TimeoutChecker::startTimeoutCheck):
9704
(KJS::TimeoutChecker::stopTimeoutCheck):
9705
(KJS::TimeoutChecker::alarmHandler):
9706
(KJS::TimeoutChecker::pauseTimeoutCheck):
9707
(KJS::TimeoutChecker::resumeTimeoutCheck):
9708
New TimeoutChecker class which handles setting Interpreter::m_timedOut flag after a given
9709
period of time. This currently only works on Unix platforms where setitimer and signals are used.
9711
(KJS::Interpreter::Interpreter):
9712
Initialize new member variables.
9714
(KJS::Interpreter::~Interpreter):
9715
Destroy the timeout checker.
9717
(KJS::Interpreter::startTimeoutCheck):
9718
(KJS::Interpreter::stopTimeoutCheck):
9719
(KJS::Interpreter::pauseTimeoutCheck):
9720
(KJS::Interpreter::resumeTimeoutCheck):
9721
Call the timeout checker.
9723
(KJS::Interpreter::handleTimeout):
9724
Called on timeout. Resets the m_timedOut flag and calls shouldInterruptScript.
9726
* kjs/interpreter.h:
9727
(KJS::Interpreter::setTimeoutTime):
9728
New function for setting the timeout time.
9730
(KJS::Interpreter::shouldInterruptScript):
9731
New function. The idea is that this should be overridden by subclasses in order to for example
9732
pop up a dialog asking the user if the script should be interrupted.
9734
(KJS::Interpreter::checkTimeout):
9735
New function which checks the m_timedOut flag and calls handleTimeout if it's set.
9738
(DoWhileNode::execute):
9739
(WhileNode::execute):
9741
Call Interpreter::checkTimeout after each iteration of the loop.
9743
2006-06-15 Timothy Hatcher <timothy@apple.com>
9745
Reviewed by Geoff and Darin.
9747
Prefer the DWARF debugging symbols format for use in Xcode 2.3.
9749
* JavaScriptCore.xcodeproj/project.pbxproj:
9751
2006-06-14 Geoffrey Garen <ggaren@apple.com>
9755
- fixed http://bugs.webkit.org/show_bug.cgi?id=9438
9756
Someone broke ToT: cannot build
9758
* JavaScriptCore.xcodeproj/project.pbxproj:
9759
* bindings/runtime_root.h: Changed "Interpreter.h" to "interpreter.h"
9761
2006-06-12 Geoffrey Garen <ggaren@apple.com>
9765
* bindings/objc/WebScriptObject.mm:
9766
(+[WebScriptObject throwException:]): Restore assignment I accidentally
9767
deleted in previous commit
9769
2006-06-12 Geoffrey Garen <ggaren@apple.com>
9771
Reviewed by TimO, Maciej.
9773
- Merged InterpreterImp code into Interpreter, which implements
9774
all interpreter functionality now. This is part of my continuing quest
9775
to create an external notion of JS "execution context" that is unified and simple --
9776
something to replace the mix of Context, ContextImp, ExecState, Interpreter,
9777
InterpreterImp, and JSRun.
9779
All tests pass. Leaks test has not regressed from its baseline ~207 leaks
9780
with ~3460 leaked nodes.
9782
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
9783
* JavaScriptCore.xcodeproj/project.pbxproj:
9784
* bindings/NP_jsobject.cpp:
9785
* bindings/objc/WebScriptObject.mm:
9786
(+[WebScriptObject throwException:]):
9787
* bindings/runtime_root.cpp:
9788
* bindings/runtime_root.h:
9790
(KJS::Context::Context):
9791
* kjs/ExecState.cpp: Added.
9792
(KJS::ExecState::lexicalInterpreter):
9793
* kjs/ExecState.h: Added.
9794
(KJS::ExecState::dynamicInterpreter):
9795
* kjs/SavedBuiltins.h: Added.
9796
* kjs/bool_object.cpp:
9797
(BooleanPrototype::BooleanPrototype):
9798
* kjs/collector.cpp:
9799
(KJS::Collector::collect):
9800
(KJS::Collector::numInterpreters):
9806
(KJS::FunctionImp::callAsFunction):
9807
(KJS::GlobalFuncImp::callAsFunction):
9808
* kjs/function_object.cpp:
9809
(FunctionObjectImp::construct):
9812
* kjs/interpreter.cpp:
9813
(KJS::interpreterMap):
9814
(KJS::Interpreter::Interpreter):
9815
(KJS::Interpreter::init):
9816
(KJS::Interpreter::~Interpreter):
9817
(KJS::Interpreter::globalObject):
9818
(KJS::Interpreter::initGlobalObject):
9819
(KJS::Interpreter::globalExec):
9820
(KJS::Interpreter::checkSyntax):
9821
(KJS::Interpreter::evaluate):
9822
(KJS::Interpreter::builtinObject):
9823
(KJS::Interpreter::builtinFunction):
9824
(KJS::Interpreter::builtinArray):
9825
(KJS::Interpreter::builtinBoolean):
9826
(KJS::Interpreter::builtinString):
9827
(KJS::Interpreter::builtinNumber):
9828
(KJS::Interpreter::builtinDate):
9829
(KJS::Interpreter::builtinRegExp):
9830
(KJS::Interpreter::builtinError):
9831
(KJS::Interpreter::builtinObjectPrototype):
9832
(KJS::Interpreter::builtinFunctionPrototype):
9833
(KJS::Interpreter::builtinArrayPrototype):
9834
(KJS::Interpreter::builtinBooleanPrototype):
9835
(KJS::Interpreter::builtinStringPrototype):
9836
(KJS::Interpreter::builtinNumberPrototype):
9837
(KJS::Interpreter::builtinDatePrototype):
9838
(KJS::Interpreter::builtinRegExpPrototype):
9839
(KJS::Interpreter::builtinErrorPrototype):
9840
(KJS::Interpreter::builtinEvalError):
9841
(KJS::Interpreter::builtinRangeError):
9842
(KJS::Interpreter::builtinReferenceError):
9843
(KJS::Interpreter::builtinSyntaxError):
9844
(KJS::Interpreter::builtinTypeError):
9845
(KJS::Interpreter::builtinURIError):
9846
(KJS::Interpreter::builtinEvalErrorPrototype):
9847
(KJS::Interpreter::builtinRangeErrorPrototype):
9848
(KJS::Interpreter::builtinReferenceErrorPrototype):
9849
(KJS::Interpreter::builtinSyntaxErrorPrototype):
9850
(KJS::Interpreter::builtinTypeErrorPrototype):
9851
(KJS::Interpreter::builtinURIErrorPrototype):
9852
(KJS::Interpreter::mark):
9853
(KJS::Interpreter::interpreterWithGlobalObject):
9854
(KJS::Interpreter::saveBuiltins):
9855
(KJS::Interpreter::restoreBuiltins):
9856
* kjs/interpreter.h:
9857
(KJS::Interpreter::setCompatMode):
9858
(KJS::Interpreter::compatMode):
9859
(KJS::Interpreter::firstInterpreter):
9860
(KJS::Interpreter::nextInterpreter):
9861
(KJS::Interpreter::prevInterpreter):
9862
(KJS::Interpreter::debugger):
9863
(KJS::Interpreter::setDebugger):
9864
(KJS::Interpreter::setContext):
9865
(KJS::Interpreter::context):
9867
(StatementNode::hitStatement):
9868
(RegExpNode::evaluate):
9871
2006-06-12 Geoffrey Garen <ggaren@apple.com>
9875
- Have *.lut.h files #include lookup.h to eliminate surprising header
9876
include order dependency.
9878
* DerivedSources.make:
9879
* kjs/array_object.cpp:
9880
* kjs/date_object.cpp:
9881
* kjs/date_object.h:
9882
(KJS::DateProtoFunc::):
9884
* kjs/math_object.cpp:
9885
* kjs/number_object.cpp:
9886
* kjs/regexp_object.cpp:
9887
* kjs/string_object.cpp:
9889
2006-06-10 Geoffrey Garen <ggaren@apple.com>
9891
- http://bugs.webkit.org/show_bug.cgi?id=8515
9892
Linux porting compile bug
9894
Fix by Mike Emmel, Reviewed by Darin.
9896
* JavaScriptCoreSources.bkl:
9900
2006-06-09 Geoffrey Garen <ggaren@apple.com>
9902
Build fix -- I think :).
9904
* JavaScriptCore.xcodeproj/project.pbxproj:
9907
2006-06-09 Geoffrey Garen <ggaren@apple.com>
9909
Reviewed by Eric (yay!).
9911
- Removed Context wrapper for ContextImp, renamed ContextImp to Context,
9912
split Context into its own file -- Context.cpp -- renamed _var to m_var,
9913
change ' *' to '* '.
9915
* JavaScriptCore.xcodeproj/project.pbxproj:
9916
* kjs/Context.cpp: Added.
9917
(KJS::Context::Context):
9918
(KJS::Context::~Context):
9919
(KJS::Context::mark):
9921
(KJS::Context::scopeChain):
9922
(KJS::Context::variableObject):
9923
(KJS::Context::setVariableObject):
9924
(KJS::Context::thisValue):
9925
(KJS::Context::callingContext):
9926
(KJS::Context::activationObject):
9927
(KJS::Context::currentBody):
9928
(KJS::Context::function):
9929
(KJS::Context::arguments):
9930
(KJS::Context::pushScope):
9931
(KJS::Context::seenLabels):
9933
(KJS::FunctionImp::callAsFunction):
9934
(KJS::FunctionImp::processParameters):
9935
(KJS::FunctionImp::argumentsGetter):
9936
(KJS::GlobalFuncImp::callAsFunction):
9938
(KJS::InterpreterImp::evaluate):
9940
(KJS::InterpreterImp::setContext):
9941
(KJS::InterpreterImp::context):
9942
* kjs/interpreter.cpp:
9943
* kjs/interpreter.h:
9944
(KJS::ExecState::context):
9945
(KJS::ExecState::ExecState):
9949
(ThisNode::evaluate):
9950
(ResolveNode::evaluate):
9951
(FunctionCallResolveNode::evaluate):
9952
(PostfixResolveNode::evaluate):
9953
(DeleteResolveNode::evaluate):
9954
(TypeOfResolveNode::evaluate):
9955
(PrefixResolveNode::evaluate):
9956
(AssignResolveNode::evaluate):
9957
(VarDeclNode::evaluate):
9958
(VarDeclNode::processVarDecls):
9959
(DoWhileNode::execute):
9960
(WhileNode::execute):
9962
(ForInNode::execute):
9963
(ContinueNode::execute):
9964
(BreakNode::execute):
9965
(ReturnNode::execute):
9966
(WithNode::execute):
9967
(SwitchNode::execute):
9968
(LabelNode::execute):
9970
(FuncDeclNode::processFuncDecl):
9971
(FuncExprNode::evaluate):
9973
2006-06-07 Geoffrey Garen <ggaren@apple.com>
9975
Removed API directory I prematurely/accidentally added.
9979
2006-06-05 Mitz Pettel <opendarwin.org@mitzpettel.com>
9981
Reviewed and landed by Geoff.
9983
- fix a regression in ecma_3/String/regress-104375.js
9985
* kjs/string_object.cpp:
9986
(substituteBackreferences): If a 2-digit back reference is out of range,
9987
parse it as a 1-digit reference (followed by the other digit). This matches
9990
2006-06-05 Geoffrey Garen <ggaren@apple.com>
9993
Darin already reviewed this change on the branch. See <rdar://problem/4317701>.
9995
- Fixed <rdar://problem/4291345> PCRE overflow in Safari JavaScriptCore
9997
No test case because there's no behavior change.
9999
* pcre/pcre_compile.c:
10000
(read_repeat_counts): Check for integer overflow / out of bounds
10002
2006-06-05 Geoffrey Garen <ggaren@apple.com>
10006
- Changed CString length from int to size_t. We sould probably do this
10007
for UString, too. (Darin, if you're reading this: Maciej said so.)
10009
* kjs/function.cpp:
10012
(KJS::CString::CString):
10015
(KJS::CString::size):
10017
2006-06-04 Geoffrey Garen <ggaren@apple.com>
10019
Reviewed by Maciej.
10021
- http://bugs.webkit.org/show_bug.cgi?id=9304
10022
Minor cleanup in JavaScriptCore
10024
* kjs/value.h: Removed redundant declarations
10026
2006-06-04 Darin Adler <darin@apple.com>
10028
Reviewed by Anders.
10030
- changed deleteAllValues so it can work on "const" collections
10031
Deleting the values affects the values, not the pointers in the
10032
collection, so it's legitimate to do it to a const collection,
10033
and a case of that actually came up in the XPath code.
10036
(WTF::deleteAllPairSeconds): Use const iterators.
10037
(WTF::deleteAllValues): Take const HashMap reference as a parameter.
10039
(WTF::deleteAllValues): Take const HashSet reference as a parameter,
10040
and use const iterators.
10042
(WTF::deleteAllValues): Take const Vector reference as a parameter.
10044
- added more functions that are present in <math.h> on some platforms,
10045
but not on others; moved here from various files in WebCore
10047
* wtf/MathExtras.h:
10051
(lroundf): Tweaked.
10056
2006-06-02 Mitz Pettel <opendarwin.org@mitzpettel.com>
10058
Reviewed by ggaren.
10060
- http://bugs.webkit.org/show_bug.cgi?id=9234
10061
Implement $&, $' and $` replacement codes in String.prototype.replace
10063
Test: fast/js/string-replace-3.html
10065
* kjs/string_object.cpp:
10066
(substituteBackreferences): Added support for $& (matched substring),
10067
$` (everything preceding matched substring), $' (everything following
10068
matched substring) and 2-digit back references, and cleaned up a little.
10070
2006-06-02 Adele Peterson <adele@apple.com>
10074
Set incremental linking to no. This seems to fix a build problem I was seeing
10075
where dftables couldn't find a dll.
10077
* JavaScriptCore.vcproj/dftables/dftables.vcproj:
10079
2006-05-26 Steve Falkenburg <sfalken@apple.com>
10083
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
10085
=== JavaScriptCore-521.11 ===
10087
2006-05-24 Geoffrey Garen <ggaren@apple.com>
10091
- JSC half of fix for <rdar://problem/4557926> TOT REGRESSSION: Crash
10092
occurs when attempting to view image in slideshow mode at
10093
http://d.smugmug.com/gallery/581716 ( KJS::IfNode::execute
10094
(KJS::ExecState*) + 312)
10096
On alternate threads, DOMObjects remain in the
10097
ScriptInterpreter's cache because they're not collected. So, they
10098
need an opportunity to mark their children.
10100
I'm not particularly happy with this solution because it fails to
10101
resolve many outstanding issues with the DOM object cache. Since none
10102
of those issues is a crasher or a serious compatibility concern,
10103
and since the behavior of other browsers is not much to go on in this
10104
case, I've filed <rdar://problem/4561439> about that, and I'm moving on
10107
* JavaScriptCore.xcodeproj/project.pbxproj:
10108
* kjs/collector.cpp:
10109
(KJS::Collector::collect):
10110
* kjs/internal.cpp:
10111
(KJS::InterpreterImp::mark):
10113
* kjs/interpreter.cpp:
10114
(KJS::Interpreter::mark):
10115
* kjs/interpreter.h:
10117
=== JavaScriptCore-521.10 ===
10119
2006-05-22 Timothy Hatcher <timothy@apple.com>
10121
Reviewed by Eric, Kevin and Geoff.
10123
Merge open source build fixes. <rdar://problem/4555500>
10125
* kjs/collector.cpp: look at the rsp register in x86_64
10126
(KJS::Collector::markOtherThreadConservatively):
10127
* wtf/Platform.h: add x86_64 to the platform list
10129
2006-05-19 Anders Carlsson <acarlsson@apple.com>
10133
http://bugs.webkit.org/show_bug.cgi?id=8993
10134
Support function declaration in case statements
10136
* kjs/grammar.y: Get rid of StatementList and use SourceElements instead.
10139
(CaseClauseNode::evalStatements):
10140
(CaseClauseNode::processVarDecls):
10141
(CaseClauseNode::processFuncDecl):
10142
(ClauseListNode::processFuncDecl):
10143
(CaseBlockNode::processFuncDecl):
10144
(SwitchNode::processFuncDecl):
10146
(KJS::CaseClauseNode::CaseClauseNode):
10147
(KJS::ClauseListNode::ClauseListNode):
10148
(KJS::ClauseListNode::getClause):
10149
(KJS::ClauseListNode::getNext):
10150
(KJS::ClauseListNode::releaseNext):
10151
(KJS::SwitchNode::SwitchNode):
10152
Add processFuncDecl for the relevant nodes.
10154
* kjs/nodes2string.cpp:
10155
(CaseClauseNode::streamTo):
10156
next got renamed to source.
10158
2006-05-17 George Staikos <staikos@kde.org>
10160
Reviewed by Maciej, Alexey, and Eric.
10162
* pcre/pcre_compile.c:
10164
* pcre/pcre_exec.c:
10165
* wtf/UnusedParam.h:
10166
Use /**/ in .c files to compile with non-C99 and non-GCC compilers.
10169
Change include to <wtf/HashTraits.h> from "HashTraits.h" to avoid -I
10171
* wtf/unicode/qt4/UnicodeQt4.h:
10172
Use correct parentheses and correct mask for utf-32 support.
10174
2006-05-17 Alexey Proskuryakov <ap@nypop.com>
10178
- fix http://bugs.webkit.org/show_bug.cgi?id=8870
10179
Crash typing in Yahoo auto-complete widget.
10181
Test: fast/js/regexp-stack-overflow.html
10183
* pcre/pcre-config.h: Define NO_RECURSE.
10185
2006-05-16 George Staikos <staikos@kde.org>
10187
Reviewed by Maciej.
10189
Fix some warnings and strict compilation errors.
10194
2006-05-15 Alexey Proskuryakov <ap@nypop.com>
10196
* make-generated-sources.sh: Changed to be executable and removed
10197
text in the file generated by "svn diff".
10199
2006-05-15 Geoffrey Garen <ggaren@apple.com>
10201
Reviewed by Maciej.
10203
- Fixed <rdar://problem/4534904> please do not treat "debugger" as
10204
a reserved word while parsing JavaScript (and other ECMA reserved
10209
http://bugs.webkit.org/show_bug.cgi?id=6179
10210
We treat "char" as a reserved word in JavaScript and firefox/IE do
10213
(1) I unreserved most of the spec's "future reserved words" because
10214
they're not reserved in IE or FF. (Most, but not all, because IE
10215
somewhat randomly *does* reserve a few of them.)
10216
(2) I made 'debugger' a legitimate statement that acts like an empty
10217
statement because FF and IE support it.
10220
* kjs/keywords.table:
10222
2006-05-15 Tim Omernick <timo@apple.com>
10224
Reviewed by John Sullivan.
10226
Part of <rdar://problem/4466508> Add 64-bit support to the Netscape Plugin API
10228
Added to the Netscape Plugin API the concept of "plugin drawing models". The drawing model
10229
determines the kind of graphics context created by the browser for the plugin, as well as
10230
the Mac types of various Netscape Plugin API data structures.
10232
There is a drawing model to represent the old QuickDraw-based API. It is used by default
10233
if QuickDraw is available on the system, unless the plugin specifies another drawing model.
10235
The big change is the addition of the CoreGraphics drawing model. A plugin may request this
10236
drawing model to obtain access to a CGContextRef for drawing, instead of a QuickDraw CGrafPtr.
10238
* bindings/npapi.h:
10239
Define NP_NO_QUICKDRAW when compiling 64-bit; there is no 64-bit QuickDraw.
10240
Added NPNVpluginDrawingModel, NPNVsupportsQuickDrawBool, and NPNVsupportsCoreGraphicsBool
10242
Added NPDrawingModel enumeration. Currently the only drawing models are QuickDraw and
10244
NPRegion's type now depends on the drawing model specified by the plugin.
10245
NP_Port is now only defined when QuickDraw is available.
10246
Added NP_CGContext, which is the type of the NPWindow's "window" member in CoreGraphics mode.
10248
2006-05-13 Kevin M. Ollivier <kevino@theolliviers.com>
10250
Reviewed by Darin, landed by ap.
10252
- http://bugs.webkit.org/show_bug.cgi?id=8528
10253
Bakefiles (and generated Makefiles) for wx and gdk ports
10255
* make-generated-sources.sh:
10256
Added script to configure environment to run DerivedSources.make
10258
* JavaScriptCoreSources.bkl:
10259
Added JavaScriptCore sources list for Bakefile.
10262
Bakefile used to generate JavaScriptCore project files
10263
(currently only used by wx and gdk ports)
10265
2006-05-09 Steve Falkenburg <sfalken@apple.com>
10268
Minor fixes to WTF headers.
10272
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Fix include dirs, paths to files.
10273
* JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Fix include dirs.
10274
* wtf/Assertions.h: include Platform.h to get definition for COMPILER()
10275
* wtf/Vector.h: include FastMalloc.h for definition of fastMalloc, fastFree
10277
2006-05-09 Maciej Stachowiak <mjs@apple.com>
10279
Rubber stamped by Anders.
10281
- renamed kxmlcore to wtf
10287
* JavaScriptCore.xcodeproj/project.pbxproj:
10288
* bindings/c/c_instance.cpp:
10289
* bindings/objc/WebScriptObject.mm:
10290
* kjs/JSImmediate.h:
10293
* kjs/array_object.cpp:
10294
* kjs/collector.cpp:
10295
(KJS::Collector::registerThread):
10298
* kjs/function.cpp:
10299
(KJS::isStrWhiteSpace):
10301
* kjs/identifier.cpp:
10302
* kjs/internal.cpp:
10306
(Lexer::isWhiteSpace):
10307
(Lexer::isIdentStart):
10308
(Lexer::isIdentPart):
10312
* kjs/number_object.cpp:
10314
* kjs/property_map.cpp:
10315
* kjs/property_map.h:
10316
* kjs/string_object.cpp:
10317
(StringProtoFunc::callAsFunction):
10322
* kxmlcore: Removed.
10323
* kxmlcore/AlwaysInline.h: Removed.
10324
* kxmlcore/Assertions.cpp: Removed.
10325
* kxmlcore/Assertions.h: Removed.
10326
* kxmlcore/FastMalloc.cpp: Removed.
10327
* kxmlcore/FastMalloc.h: Removed.
10328
* kxmlcore/FastMallocInternal.h: Removed.
10329
* kxmlcore/Forward.h: Removed.
10330
* kxmlcore/HashCountedSet.h: Removed.
10331
* kxmlcore/HashFunctions.h: Removed.
10332
* kxmlcore/HashMap.h: Removed.
10333
* kxmlcore/HashSet.h: Removed.
10334
* kxmlcore/HashTable.cpp: Removed.
10335
* kxmlcore/HashTable.h: Removed.
10336
* kxmlcore/HashTraits.h: Removed.
10337
* kxmlcore/ListRefPtr.h: Removed.
10338
* kxmlcore/Noncopyable.h: Removed.
10339
* kxmlcore/OwnArrayPtr.h: Removed.
10340
* kxmlcore/OwnPtr.h: Removed.
10341
* kxmlcore/PassRefPtr.h: Removed.
10342
* kxmlcore/Platform.h: Removed.
10343
* kxmlcore/RefPtr.h: Removed.
10344
* kxmlcore/TCPageMap.h: Removed.
10345
* kxmlcore/TCSpinLock.h: Removed.
10346
* kxmlcore/TCSystemAlloc.cpp: Removed.
10347
* kxmlcore/TCSystemAlloc.h: Removed.
10348
* kxmlcore/UnusedParam.h: Removed.
10349
* kxmlcore/Vector.h: Removed.
10350
* kxmlcore/VectorTraits.h: Removed.
10351
* kxmlcore/unicode: Removed.
10352
* kxmlcore/unicode/Unicode.h: Removed.
10353
* kxmlcore/unicode/UnicodeCategory.h: Removed.
10354
* kxmlcore/unicode/icu: Removed.
10355
* kxmlcore/unicode/icu/UnicodeIcu.h: Removed.
10356
* kxmlcore/unicode/posix: Removed.
10357
* kxmlcore/unicode/qt3: Removed.
10358
* kxmlcore/unicode/qt4: Removed.
10359
* kxmlcore/unicode/qt4/UnicodeQt4.h: Removed.
10362
* wtf/Assertions.cpp:
10363
* wtf/Assertions.h:
10364
* wtf/FastMalloc.cpp:
10365
(WTF::TCMalloc_ThreadCache::Scavenge):
10368
(WTF::TCMallocGuard::TCMallocGuard):
10374
* wtf/FastMalloc.h:
10375
* wtf/FastMallocInternal.h:
10377
* wtf/HashCountedSet.h:
10378
* wtf/HashFunctions.h:
10381
* wtf/HashTable.cpp:
10383
* wtf/HashTraits.h:
10384
* wtf/ListRefPtr.h:
10385
* wtf/Noncopyable.h:
10386
* wtf/OwnArrayPtr.h:
10388
* wtf/PassRefPtr.h:
10390
* wtf/TCSystemAlloc.cpp:
10391
(TCMalloc_SystemAlloc):
10393
* wtf/VectorTraits.h:
10394
* wtf/unicode/UnicodeCategory.h:
10395
* wtf/unicode/icu/UnicodeIcu.h:
10397
2006-05-08 Timothy Hatcher <timothy@apple.com>
10401
* bindings/npapi.h: do not define #pragma options align=mac68k if we are 64-bit
10403
2006-05-07 Darin Adler <darin@apple.com>
10405
Reviewed and landed by Maciej.
10407
- fix http://bugs.webkit.org/show_bug.cgi?id=8765
10408
Random crashes on TOT since the form state change
10410
I haven't figured out how to construct a test for this, but this does seem to fix the
10411
problem; Mitz mentioned that a double-destroy was occurring in these functions.
10413
* kxmlcore/HashMap.h: (KXMLCore::HashMap::remove): Use RefCounter::deref instead of calling
10414
~ValueType, because ~ValueType often results in a double-destroy, since the HashTable also
10415
destroys the element based on the storage type. The RefCounter template correctly does work
10416
only in cases where ValueType and ValueStorageType differ and this class is what's used
10417
elsewhere for the same purpose; I somehow missed this case when optimizing HashMap.
10418
* kxmlcore/HashSet.h: (KXMLCore::HashSet::remove): Ditto.
10420
2006-05-05 Darin Adler <darin@apple.com>
10422
- http://bugs.webkit.org/show_bug.cgi?id=8722
10423
IE compatibility fix in date parsing
10425
* kjs/date_object.cpp: (KJS::parseDate): Merged change that George Staikos provided
10426
from KDE 3.4.3 branch that allows day values of 0 and values that are > 1000.
10428
2006-05-04 Anders Carlsson <andersca@mac.com>
10430
Reviewed by Maciej.
10432
http://bugs.webkit.org/show_bug.cgi?id=8734
10433
Would like a Vector::append that takes another Vector
10435
* kxmlcore/Vector.h:
10436
(KXMLCore::::append):
10437
New function that takes another array.
10439
2006-05-02 Steve Falkenburg <sfalken@apple.com>
10443
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: set NDEBUG for release build
10444
* kxmlcore/FastMalloc.cpp: Prevent USE_SYSTEM_MALLOC from being defined twice
10446
2006-05-02 Anders Carlsson <andersca@mac.com>
10448
Reviewed by Maciej.
10450
* kxmlcore/HashMap.h:
10451
(KXMLCore::::operator):
10454
2006-05-01 Tim Omernick <timo@apple.com>
10456
Reviewed by Tim Hatcher.
10458
<rdar://problem/4476875> Support printing for embedded Netscape plugins
10460
* bindings/npapi.h:
10461
Fixed struct alignment problem in our npapi.h. Structs must be 68k-aligned on both pre-Mac OS X
10462
and Mac OS X systems, as this is what plugins expect.
10464
2006-05-01 Timothy Hatcher <timothy@apple.com>
10466
Reviewed by Maciej.
10468
<rdar://problem/4308243> 8F36 Regression: crash in malloc_consolidate if you use a .PAC file
10470
The original fix missed the oversized cell case. Added a test for "currentThreadIsMainThread ||
10471
imp->m_destructorIsThreadSafe" where we collect oversized cells.
10473
We don't have a way to test PAC files yet, so there's no test attached.
10475
* kjs/collector.cpp:
10476
(KJS::Collector::collect): test the thread when we collect oversized cells
10478
2006-05-01 Tim Omernick <timo@apple.com>
10482
<rdar://problem/4526114> REGRESSION (two days ago): LOG() just prints @ for NSObject substitutions
10484
* kxmlcore/Assertions.cpp:
10485
Changed sense of strstr("%@") check. I already made the same fix to the WebBrowser assertions.
10487
2006-04-28 Steve Falkenburg <sfalken@apple.com>
10489
Reviewed by kdecker
10491
Actually apply the change that was reviewed insted of checking it in with an #if 0 (oops).
10494
(main): Suppress C runtime alerts
10496
2006-04-28 Steve Falkenburg <sfalken@apple.com>
10498
Reviewed by kdecker
10500
Suppress error reporting dialog that blocks Javascript tests from completing.
10502
Real error is due to an overflow in the date/time handling functions that needs
10503
to be addressed, but this will prevent the hang running the Javascript tests
10504
on the build bot (along with the related changes).
10507
(main): Suppress C runtime alerts
10509
2006-04-27 Geoffrey Garen <ggaren@apple.com>
10513
- Minor fixups I discovered while working on the autogenerator.
10516
(findEntry): ASSERT that size is not 0, because otherwise we'll % by 0,
10517
compute a garbage address, and possibly crash.
10519
(cacheGlobalObject): Don't enumerate cached objects -- ideally, they
10520
would be hidden entirely.
10522
2006-04-21 Kevin M. Ollivier <kevino@theolliviers.com>
10526
- http://bugs.webkit.org/show_bug.cgi?id=8507
10527
Compilation fixes for building on gcc 4.0.2, and without precomp headers
10529
* kjs/operations.h:
10530
* kxmlcore/Assertions.cpp:
10531
* kxmlcore/FastMalloc.cpp:
10532
Added necessary headers to resolve compilation issues when not using
10533
precompiled headers.
10535
* kjs/value.h: Declare the JSCell class before friend declaration
10536
to resolve compilation issues with gcc 4.0.2.
10538
* kxmlcore/Platform.h: Set Unicode support to use ICU on platforms
10539
other than KDE (previously only defined for Win and Mac OS)
10541
2006-04-18 Eric Seidel <eseidel@apple.com>
10543
Reviewed by ggaren.
10545
Fix "new Function()" to correctly use lexical scoping.
10546
Add ScopeChain::print() function for debugging.
10547
<rdar://problem/4067864> REGRESSION (125-407): JavaScript failure on PeopleSoft REN Server
10549
* kjs/function_object.cpp:
10550
(FunctionObjectImp::construct):
10551
* kjs/scope_chain.cpp:
10552
(KJS::ScopeChain::print):
10553
* kjs/scope_chain.h:
10555
2006-04-14 James G. Speth <speth@end.com>
10557
Reviewed by Timothy.
10559
Bug 8389: support for Cocoa bindings - binding an NSTreeController to the WebView's DOM
10560
http://bugs.webkit.org/show_bug.cgi?id=8389
10562
Adds a category to WebScriptObject with array accessors for KVC/KVO.
10564
If super valueForKey: fails it will call valueForUndefinedKey:, which is
10565
important because it causes the right behavior to happen with bindings using
10566
the "Raises for Not Applicable Keys" flag and the "Not Applicable Placeholder"
10568
* bindings/objc/WebScriptObject.mm:
10569
(-[WebScriptObject valueForKey:]):
10570
(-[WebScriptObject count]):
10571
(-[WebScriptObject objectAtIndex:]):
10572
(-[WebUndefined description]): return "undefined"
10574
2006-04-13 Geoffrey Garen <ggaren@apple.com>
10578
* kjs/internal.cpp:
10579
(KJS::InterpreterImp::initGlobalObject): Add the built-in object
10580
prototype to the end of the global object's prototype chain instead of
10581
just blowing away its existing prototype. We need to do this because
10582
the window object has a meaningful prototype now.
10584
2006-04-13 Maciej Stachowiak <mjs@apple.com>
10588
- fix testkjs to not show false-positive KJS::Node leaks in debug builds
10594
2006-04-11 Geoffrey Garen <ggaren@apple.com>
10596
Reviewed by Maciej.
10598
Minor code cleanup -- passes all the JS tests.
10600
* kjs/object_object.cpp:
10601
(ObjectObjectImp::construct):
10602
(ObjectObjectImp::callAsFunction):
10604
2006-04-11 Darin Adler <darin@apple.com>
10606
- another attempt to fix Windows build -- Vector in Forward.h was not working
10608
* kxmlcore/Forward.h: Remove Vector.
10609
* kxmlcore/Vector.h: Add back default arguments, remove include of
10612
2006-04-11 Darin Adler <darin@apple.com>
10614
- try to fix Windows build -- HashForward.h was not working
10616
* kxmlcore/HashForward.h: Removed.
10618
* JavaScriptCore.xcodeproj/project.pbxproj: Remove HashForward.h.
10619
* kjs/collector.h: Remove use of HashForward.h.
10620
* kxmlcore/HashCountedSet.h: Remove include of HashForward.h, restore
10622
* kxmlcore/HashMap.h: Ditto.
10623
* kxmlcore/HashSet.h: Ditto.
10625
2006-04-11 David Harrison <harrison@apple.com>
10629
- fixed clean build, broken by Darin's check-in
10631
* kjs/date_object.cpp: Add needed include of lookup.h.
10632
* kjs/regexp_object.cpp: Move include of .lut.h file below other includes.
10634
2006-04-10 Darin Adler <darin@apple.com>
10636
Rubber-stamped by John Sullivan.
10638
- switched from a shell script to a makefile for generated files
10639
- removed lots of unneeded includes
10640
- added new Forward.h and HashForward.h headers that allow compiling with
10641
fewer unneeded templates
10643
* DerivedSources.make: Added.
10644
* generate-derived-sources: Removed.
10645
* JavaScriptCore.xcodeproj/project.pbxproj: Added new files, changed to use
10646
DerivedSources.make.
10648
* kxmlcore/Forward.h: Added.
10649
* kxmlcore/HashForward.h: Added.
10651
* kxmlcore/HashCountedSet.h: Include HashForward for default args.
10652
* kxmlcore/HashMap.h: Ditto.
10653
* kxmlcore/HashSet.h: Ditto.
10657
Moved KJS_MAX_STACK into the .cpp file.
10659
* bindings/NP_jsobject.cpp:
10660
* bindings/c/c_instance.h:
10661
* bindings/jni/jni_class.h:
10662
* bindings/jni/jni_runtime.h:
10663
* bindings/jni/jni_utility.h:
10664
* bindings/objc/WebScriptObject.mm:
10665
* bindings/objc/WebScriptObjectPrivate.h:
10666
* bindings/objc/objc_class.h:
10667
* bindings/objc/objc_class.mm:
10668
* bindings/objc/objc_instance.h:
10669
* bindings/objc/objc_instance.mm:
10670
* bindings/objc/objc_runtime.mm:
10671
* bindings/objc/objc_utility.mm:
10672
* bindings/runtime.h:
10673
* bindings/runtime_array.cpp:
10674
* bindings/runtime_array.h:
10675
* bindings/runtime_method.cpp:
10676
* bindings/runtime_method.h:
10677
* bindings/runtime_object.cpp:
10678
* bindings/runtime_root.h:
10679
* kjs/JSImmediate.cpp:
10681
* kjs/array_object.cpp:
10682
* kjs/array_object.h:
10683
* kjs/bool_object.cpp:
10684
* kjs/bool_object.h:
10687
* kjs/debugger.cpp:
10688
* kjs/error_object.h:
10689
* kjs/function_object.h:
10692
* kjs/math_object.cpp:
10693
* kjs/math_object.h:
10696
* kjs/number_object.cpp:
10697
* kjs/number_object.h:
10698
* kjs/object_object.cpp:
10699
* kjs/operations.cpp:
10700
* kjs/protected_reference.h:
10702
* kjs/reference_list.h:
10703
* kjs/regexp_object.h:
10704
* kjs/string_object.cpp:
10705
* kjs/string_object.h:
10709
* kxmlcore/HashTable.h:
10710
* kxmlcore/ListRefPtr.h:
10711
* kxmlcore/TCPageMap.h:
10712
* kxmlcore/Vector.h:
10713
Removed unneeded header includes.
10715
2006-04-09 Geoffrey Garen <ggaren@apple.com>
10719
- Fixed http://bugs.webkit.org/show_bug.cgi?id=8284
10720
prevent unnecessary entries in the "nodes with extra refs" hash table
10722
This patch switches manually RefPtr exchange with use of
10723
RefPtr::release to ensure that a node's ref count never tops 1
10724
(in the normal case).
10727
(BlockNode::BlockNode):
10728
(CaseBlockNode::CaseBlockNode):
10730
(KJS::ArrayNode::ArrayNode):
10731
(KJS::ObjectLiteralNode::ObjectLiteralNode):
10732
(KJS::ArgumentsNode::ArgumentsNode):
10733
(KJS::VarStatementNode::VarStatementNode):
10734
(KJS::ForNode::ForNode):
10735
(KJS::CaseClauseNode::CaseClauseNode):
10736
(KJS::FuncExprNode::FuncExprNode):
10737
(KJS::FuncDeclNode::FuncDeclNode):
10739
2006-04-08 Alexey Proskuryakov <ap@nypop.com>
10743
One more attempt - use reinterpret_cast, rather than static_cast.
10745
2006-04-08 Alexey Proskuryakov <ap@nypop.com>
10749
An attempt to fix Win32 build - ICU uses wchar_t on Windows, so we need a type cast.
10751
* kxmlcore/unicode/icu/UnicodeIcu.h:
10752
(KXMLCore::Unicode::toLower):
10753
(KXMLCore::Unicode::toUpper):
10755
2006-04-08 Alexey Proskuryakov <ap@nypop.com>
10759
- fix http://bugs.webkit.org/show_bug.cgi?id=8264
10760
toLowerCase and toUpperCase don't honor special mappings
10762
Test: fast/js/string-capitalization.html
10764
* JavaScriptCore.xcodeproj/project.pbxproj: Added KXMLCore::Unicode headers to the project.
10765
* icu/unicode/putil.h: Added (copied from WebCore).
10766
* icu/unicode/uiter.h: Ditto.
10767
* icu/unicode/ustring.h: Ditto.
10768
* kjs/string_object.cpp:
10769
(StringProtoFunc::callAsFunction): Use the new KXMLCore::Unicode::toUpper() and toLower().
10770
* kjs/ustring.cpp: Removed unused (and evil) UChar::toLower() and toUpper().
10771
* kjs/ustring.h: Ditto.
10773
* kxmlcore/unicode/Unicode.h: Corrected capitalization of the word Unicode.
10774
* kxmlcore/unicode/UnicodeCategory.h: Renamed include guard macro to match file name.
10776
* kxmlcore/unicode/icu/UnicodeIcu.h:
10777
(KXMLCore::Unicode::toLower): Work on strings, not individual characters. Use ICU root locale.
10778
(KXMLCore::Unicode::toUpper): Ditto.
10779
(KXMLCore::Unicode::isFormatChar): Use int32_t, which can hold a complete code point.
10780
(KXMLCore::Unicode::isSeparatorSpace): Ditto.
10781
(KXMLCore::Unicode::category): Ditto.
10782
* kxmlcore/unicode/qt4/UnicodeQt4.h:
10783
(KXMLCore::Unicode::toLower): Work on strings, not individual characters.
10784
(KXMLCore::Unicode::toUpper): Ditto.
10785
(KXMLCore::Unicode::isFormatChar): Use int32_t, which can hold a complete code point.
10786
(KXMLCore::Unicode::isSeparatorSpace): Ditto.
10787
(KXMLCore::Unicode::category): Ditto.
10789
* tests/mozilla/ecma/String/15.5.4.12-1.js: Corrected expected results.
10790
* tests/mozilla/ecma/String/15.5.4.12-5.js: Corrected expected results.
10792
2006-04-05 Darin Adler <darin@apple.com>
10794
- attempt to fix Windows build
10796
* kxmlcore/HashMap.h: (KXMLCore::HashMap::remove): Use (*it). instead of it->.
10797
* kxmlcore/HashSet.h: (KXMLCore::HashSet::remove): Ditto.
10799
2006-04-05 Darin Adler <darin@apple.com>
10801
- attempt to fix Windows build
10803
* os-win32/stdint.h: Add int8_t, uint8_t, int64_t.
10805
2006-04-05 Darin Adler <darin@apple.com>
10807
Reviewed by Maciej.
10809
- fix memory leak introduced by the previous change
10811
* kxmlcore/HashTable.h: Specialize NeedsRef so that it correctly returns true when
10812
the value in question is a pair where one of the pair needs a ref and the other
10813
of the pair does not.
10815
2006-04-05 Darin Adler <darin@apple.com>
10817
Reviewed by Maciej.
10819
- JavaScriptCore part of fix for http://bugs.webkit.org/show_bug.cgi?id=8049
10820
StringImpl hash traits deleted value creates an init routine for WebCore
10821
<rdar://problem/4442248> REGRESSION: WebCore has init routines (8049)
10823
Change HashMap and HashSet implementation so they fold various types together.
10824
This allows us to implement maps and sets that use RefPtr<WebCore::StringImpl>
10825
and WebCore::String in terms of the underlying raw pointer type, and hence use
10826
-1 for the deleted value.
10828
* kxmlcore/HashTraits.h: Added a new type to HashTraits, StorageTraits, which is a
10829
type to be used when storing a value that has the same layout as the type itself.
10830
This is used only for non-key cases. In the case of keys, the hash function must also
10831
be considered. Moved emptyValue out of GenericHashTraitsBase into GenericHashTraits.
10832
Added a new bool to HashTraits, needsRef, which indicates whether the type needs
10833
explicit reference counting. If the type itself has needsRef true, but the storage
10834
type has needsRef false, then the HashSet or HashMap has to handle the reference
10835
counting explicitly. Added hash trait specializations for all signed integer values
10836
that give -1 as the deleted value. Gave all integers StorageTraits of the canonical
10837
integer type of the same size so int and long will share code. Gave all pointers and
10838
RefPtrs StorageTraits of the appropriately sized integer type. Removed redundant
10839
TraitType and emptyValue definitions in the pointer specialization for HashTraits.
10840
Added PairBaseHashTraits, which doesn't try to set up needsDestruction and deletedValue.
10841
Useful for types where we don't want to force the existence of deletedValue, such as
10842
the type of a pair in a HashMap which is not the actual storage type. Removed an
10843
unneeded parameter from the DeletedValueAssigner template. Added HashKeyStorageTraits
10844
template, which determines what type can be used to store a given hash key type with
10845
a given hash function, and specialized it for pointers and RefPtr so that pointer
10846
hash tables share an underlying HashTable that uses IntHash.
10848
* kxmlcore/HashTable.h: Added HashTableConstIteratorAdapter, HashTableIteratorAdapter,
10849
NeedsRef, RefCountManagerBase, RefCountManager, HashTableRefCountManagerBase, and
10850
HashTableRefCountManager. All are used by both HashSet and HashMap to handle hash
10851
tables where the type stored is not the same as the real value type.
10853
* kxmlcore/HashFunctions.h: Added a new struct named IntTypes that finds an
10854
integer type given a sizeof value. Renamed pointerHash to intHash and made it
10855
use overloading and take integer parameters. Added an IntHash struct which is
10856
a hash function that works for integers. Changed PtrHash to call IntHash with
10857
an appropriately sized integer. Made IntHash the default hash function for
10858
many integer types. Made PtrHash the default hash function for RefPtr as well
10859
as for raw pointers.
10861
* kxmlcore/HashSet.h: Changed implementation to use a separate "storage type"
10862
derived from the new traits. The HashTable will use the storage type and all
10863
necessary translation and ref/deref is done at the HashSet level. Also reorganized
10864
the file so that the HashSet is at the top and has no inline implementation inside
10865
it so it's easy to read the interface to HashSet.
10867
* kxmlcore/HashMap.h: Changed implementation to use a separate "storage type"
10868
derived from the new traits. The HashTable will use the storage type and all
10869
necessary translation and ref/deref is done at the HashMap level. Also reorganized
10870
the file so that the HashMap is at the top and has no inline implementation inside
10871
it so it's easy to read the interface to HashMap.
10873
* kxmlcore/HashMapPtrSpec.h: Removed. Superceded by optimizations in HashMap itself.
10875
* JavaScriptCore.xcodeproj/project.pbxproj: Remove HashMapPtrSpec.h, resort files,
10876
and also remove some unnecessary build settings from the aggregate target that
10877
generates derived sources.
10878
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto.
10880
2006-04-04 Timothy Hatcher <timothy@apple.com>
10884
The Debug and Release frameworks are now built with install paths relative to the build products directory.
10885
This removes the need for other projects to build with -framework WebCore and -framework JavaScriptCore.
10887
* JavaScriptCore.xcodeproj/project.pbxproj:
10889
2006-04-04 Eric Seidel <eseidel@apple.com>
10891
Reviewed by ggaren.
10894
Disable ASSERT redefinition warnings for now.
10896
* JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
10897
* kxmlcore/Assertions.h:
10899
2006-04-04 Bjrn Graf <bjoern.graf@gmail.com>
10901
Reviewed by ggaren & darin. Landed by eseidel.
10903
Integrate CURL version of gettimeofday
10904
http://bugs.webkit.org/show_bug.cgi?id=7399
10905
Disable crash report dialogs for testkjs.exe in Release mode
10906
http://bugs.webkit.org/show_bug.cgi?id=8113
10909
(StopWatch::start):
10911
(StopWatch::getElapsedMS):
10915
2006-04-04 Eric Seidel <eseidel@apple.com>
10919
* kjs/number_object.cpp:
10920
(NumberProtoFunc::callAsFunction): remove trunc() to fix win32.
10922
2006-03-12 Maciej Stachowiak <mjs@apple.com>
10926
- fixed "toPrecision sometimes messes up the last digit on intel Macs"
10927
http://bugs.webkit.org/show_bug.cgi?id=7748
10929
* kjs/number_object.cpp:
10930
(intPow10): Compute integer powers of 10 using exponentiation by squaring.
10931
(NumberProtoFunc::callAsFunction): Use intPow10(n) in place of all pow(10.0, n),
10932
plus a bit of refactoring.
10934
2006-04-03 Darin Adler <darin@apple.com>
10936
- tweak config.h and Platform.h to try to get buildbot working
10937
(making some small changes at the same time)
10939
* kjs/config.h: Removed now-unneeded HAVE_ICU.
10940
* kxmlcore/Platform.h: Tweak how platform gets set up. Move all the
10941
USE stuff to the end.
10943
2006-04-03 George Staikos <staikos@opensource.apple.com>
10945
Reviewed by Maciej.
10947
Fix Win32 build breakage from previous commit, remove unused forward.
10949
2006-04-03 George Staikos <staikos@opensource.apple.com>
10951
Reviewed by Maciej.
10953
Implement a unicode abstraction layer to make JavaScriptCore much more
10954
easily ported to other platforms without having to take in libicu. Also
10955
makes the unicode related code easier to understand.
10957
2006-04-03 Timothy Hatcher <timothy@apple.com>
10961
Fixes <rdar://problem/4498338> JavaScriptCore fails to compile for ppc64
10962
Other 64 bit build fixes.
10964
* kjs/collector.cpp:
10965
(KJS::Collector::markOtherThreadConservatively): test for __DARWIN_UNIX03 and use __r1
10967
(Bigint::): cast PRIVATE_mem to unsigned to prevent warning
10968
* bindings/jni/jni_utility.cpp:
10969
(KJS::Bindings::getJavaVM): cast jniError to long to prevent format warning
10970
(KJS::Bindings::getJNIEnv): cast jniError to long to prevent format warning
10971
* bindings/runtime_root.cpp:
10972
(KJS::Bindings::addNativeReference): cast CFDictionaryGetValue to unsigned long to prevent warning
10973
(KJS::Bindings::removeNativeReference): cast CFDictionaryGetValue to unsigned long to prevent warning
10975
2006-03-31 Darin Adler <darin@apple.com>
10979
- <rdar://problem/4395622> API: WebScriptObject.h incorrectly reports that -isSelectorExcludedFromWebScript returns NO by default
10981
* bindings/objc/WebScriptObject.h: Fixed comment.
10983
2006-03-31 Eric Seidel <eseidel@apple.com>
10987
A bit more code cleanup.
10989
* bindings/c/c_utility.cpp:
10990
(KJS::Bindings::convertValueToNPVariant):
10991
* bindings/objc/objc_runtime.mm:
10992
(convertValueToObjcObject):
10993
* bindings/objc/objc_utility.mm:
10994
(KJS::Bindings::convertValueToObjcValue):
10995
* kjs/function.cpp:
10996
(KJS::GlobalFuncImp::callAsFunction):
10997
* kjs/interpreter.cpp:
10998
(KJS::ExecState::lexicalInterpreter):
10999
* kjs/interpreter.h:
11000
* kjs/operations.cpp:
11003
2006-03-30 Eric Seidel <eseidel@apple.com>
11005
Reviewed by anders.
11007
Small code-style update.
11009
* kjs/operations.cpp:
11015
(KJS::strictEqual):
11022
2006-03-31 Anders Carlsson <andersca@mac.com>
11024
Reviewed by Maciej.
11026
Make sure the GetterSetterImp objects are marked as well.
11028
* kjs/internal.cpp:
11029
(KJS::GetterSetterImp::mark):
11030
Call JSCell::mark().
11032
2006-03-30 Eric Seidel <eseidel@apple.com>
11034
Reviewed by ggaren.
11036
* kjs/nodes.h: Some various small style fixes.
11038
2006-03-30 Eric Seidel <eseidel@apple.com>
11040
Reviewed by ggaren.
11042
Clean-up style issues in node.h, remove redundant initializations.
11045
(KJS::StatementNode::evaluate):
11046
(KJS::ArrayNode::ArrayNode):
11047
(KJS::ObjectLiteralNode::ObjectLiteralNode):
11048
(KJS::ArgumentsNode::ArgumentsNode):
11049
(KJS::NewExprNode::NewExprNode):
11050
(KJS::CaseClauseNode::CaseClauseNode):
11051
(KJS::FuncDeclNode::FuncDeclNode):
11053
2006-03-30 Tim Omernick <timo@apple.com>
11057
<rdar://problem/4212626> REGRESSION: LIVECONNECT: JavaScript type for Java Strings is function,
11060
* bindings/runtime.h:
11061
(KJS::Bindings::Instance::implementsCall):
11062
New method. Returns false by default. Concrete subclasses can override this return true when
11063
the bound object may be called as a function.
11064
(KJS::Bindings::Instance::invokeDefaultMethod):
11065
Since bound objects are no longer treated as functions by default, we can return jsUndefined()
11066
here instead of in concrete subclasses that decide not to implement the default method
11069
* bindings/runtime_object.cpp:
11070
(RuntimeObjectImp::implementsCall):
11071
Don't assume that the bound object is a function; instead, let the object instance decide whether
11074
* bindings/c/c_instance.h:
11075
* bindings/c/c_instance.cpp:
11076
(KJS::Bindings::CInstance::implementsCall):
11077
The object is callable if its class has an invokeDefault function.
11079
* bindings/objc/objc_instance.h:
11080
* bindings/objc/objc_instance.mm:
11081
(ObjcInstance::implementsCall):
11082
The object is callable if the ObjC instance responds to -invokeDefaultMethodWithArguments:.
11084
* bindings/jni/jni_instance.h:
11085
* bindings/jni/jni_instance.cpp:
11086
Moved bogus invokeDefaultMethod() to superclass.
11088
2006-03-29 Geoffrey Garen <ggaren@apple.com>
11092
- JavaScriptCore side of fix for <rdar://problem/4308243> 8F36
11093
Regression: crash in malloc_consolidate if you use a .PAC file
11095
The crash was a result of threaded deallocation of thread-unsafe
11096
objects. Pure JS objects are thread-safe because all JS execution
11097
is synchronized through JSLock. However, JS objects that wrap WebCore
11098
objects are thread-unsafe because JS and WebCore execution are not
11099
synchronized. That unsafety comes into play when the collector
11100
deallocates a JS object that wraps a WebCore object, thus causing the
11101
WebCore object to be deallocated.
11103
The solution here is to have each JSCell know whether it is safe to
11104
collect on a non-main thread, and to avoid collecting unsafe cells
11105
when on a non-main thread.
11107
We don't have a way to test PAC files yet, so there's no test
11108
attached to this patch.
11110
* kjs/collector.cpp:
11111
(KJS::Collector::collect):
11112
(1) Added the test "currentThreadIsMainThread ||
11113
imp->m_destructorIsThreadSafe".
11116
(KJS::gcProtectNullTolerant):
11117
(KJS::gcUnprotectNullTolerant):
11119
(KJS::JSCell::JSCell): The bools here must be bitfields, otherwise
11120
m_destructorIsThreadSafe becomes another whole word, ruining the
11121
collector optimizations we've made based on the size of a JSObject.
11122
* kxmlcore/FastMalloc.cpp:
11123
(KXMLCore::currentThreadIsMainThread):
11124
(KXMLCore::fastMallocRegisterThread):
11125
* kxmlcore/FastMalloc.h:
11127
2006-03-28 Darin Adler <darin@apple.com>
11131
- change some code that resulted in init routines on Mac OS X -- if the framework has
11132
init routines it will use memory and slow down applications that link with WebKit
11133
even in cases where those applications don't use WebKit
11135
* kjs/date_object.cpp: Changed constants that were derived by multiplying other constants
11136
to use immediate numbers instead. Apparently, double constant expressions of the type we
11137
had here are evaluated at load time.
11139
* kjs/list.cpp: Can't use OwnArrayPtr in ListImp because of the global instances of
11140
ListImp, so go back to using a plain old pointer.
11141
(KJS::List::List): Set overflow to 0 when initializing ListImp.
11142
(KJS::List::release): Replace a clear call with a delete and explicit set to 0.
11143
(KJS::List::append): Use raw pointers, and do a delete [] instead of finessing it with
11144
a swap of OwnArrayPtr.
11145
(KJS::List::copyFrom): Remove now-unneeded get().
11146
(KJS::List::copyTail): Ditto.
11148
* kjs/ustring.cpp: Changed UString::Rep::empty initializer a bit so that it doesn't get
11149
a static initializer routine. Had to get rid of one level of constant to get the compiler
11150
to understand it could initialize without any code.
11152
- added a build step that checks for init routines
11154
* JavaScriptCore.xcodeproj/project.pbxproj: Deleted now-unused custom build rule that
11155
was replaced by the generate-derived-sources script a while back. Added a custom build
11156
phase that invokes the check-for-global-initializers script.
11158
2006-03-28 Timothy Hatcher <timothy@apple.com>
11162
fixes <rdar://problem/4458539> Unable to include Security(public) and WebKit(private) headers
11164
* bindings/npapi.h: added #defines after the #ifndefs
11166
2006-03-27 Maciej Stachowiak <mjs@apple.com>
11168
Reviewed by Anders.
11170
- fixed <rdar://problem/4489745> REGRESSION: Safari crashes at to display http://www.lgphilips-lcd.com/
11173
(Node::deref): take into account the case where the extra refcount table was never created
11175
2006-03-23 David Carson <dacarson@gmail.com>
11179
- JSObject in LiveConnect not working.
11180
http://bugs.webkit.org/show_bug.cgi?id=7917
11182
* bindings/jni_jsobject.cpp:
11183
(JavaJSObject::convertJObjectToValue): Was trying to retrieve the native pointer from the wrong base
11184
class, and the GetFieldID was using the wrong signature.
11186
2006-03-23 Darin Adler <darin@apple.com>
11188
Reviewed by Maciej.
11192
* JavaScriptCore.xcodeproj/project.pbxproj: Change target name to JavaScriptCore (it was "include"!?).
11193
Also add -Y 3 option for linker.
11195
2006-03-23 Darin Adler <darin@apple.com>
11197
Reviewed by Maciej.
11199
- fix http://bugs.webkit.org/show_bug.cgi?id=7726
11200
REGRESSION: orbitz calendar fails (JavaScript function serialization/parsing)
11202
* kjs/object.h: Take function name, as well as source URL and line number, when
11203
using the special overloaded construct for making functions.
11204
* kjs/object.cpp: (KJS::JSObject::construct): Ditto.
11205
* kjs/function_object.h: Ditto.
11206
* kjs/function_object.cpp: (FunctionObjectImp::construct): Pass a name when
11207
constructing the function rather than null. Use "anonymous" when making a
11208
function using the default function constructor.
11210
* kjs/nodes2string.cpp: (FuncDeclNode::streamTo): Put a line break just before
11211
a function declaration.
11215
* kxmlcore/HashMapPtrSpec.h: Add missing needed friend declaration.
11217
2006-03-23 Darin Adler <darin@apple.com>
11219
Reviewed by Maciej.
11221
- fix http://bugs.webkit.org/show_bug.cgi?id=7805
11222
LEAK: method name leaks in KJS::Bindings::CInstance::invokeMethod
11224
* bindings/c/c_utility.h: Remove NPN_UTF16FromString declaration (not implemented).
11225
* bindings/c/c_utility.cpp:
11226
(KJS::Bindings::convertValueToNPVariant): Use DOUBLE_TO_NPVARIANT,
11227
BOOLEAN_TO_NPVARIANT, VOID_TO_NPVARIANT, NULL_TO_NPVARIANT, and
11228
OBJECT_TO_NPVARIANT. In the case of OBJECT, call _NPN_RetainObject in
11229
one case and remove a _NPN_ReleaseObject in another because this
11230
should return a retained value.
11231
(KJS::Bindings::convertNPVariantToValue): Use NPVARIANT_TO_BOOLEAN,
11232
NPVARIANT_TO_INT32, and NPVARIANT_TO_DOUBLE.
11234
* bindings/c/c_runtime.h: Removed implementations of CMethod::name and
11235
CField::name that called _NPN_UTF8FromIdentifier and hence leaked.
11236
* bindings/c/c_runtime.cpp:
11237
(KJS::Bindings::CMethod::name): Added. Returns the string from inside the
11239
(KJS::Bindings::CField::name): Added. Returns the string from inside the
11241
(KJS::Bindings::CField::valueFromInstance): Added call to _NPN_ReleaseVariantValue
11242
on the result of getProperty after using it to fix a storage leak.
11243
(KJS::Bindings::CField::setValueToInstance): Added call to _NPN_ReleaseVariantValue
11244
after pasing a value to setProperty now that the conversion function does a retain.
11246
* bindings/c/c_instance.cpp:
11247
(KJS::Bindings::CInstance::invokeMethod): Changed to use Vector for a local
11248
stack buffer. Removed special case for NPVARIANT_IS_VOID because the
11249
convertNPVariantToValue function handles that properly.
11250
(KJS::Bindings::CInstance::invokeDefaultMethod): Ditto.
11252
* bindings/NP_jsobject.h: Formatting changes only.
11253
* bindings/NP_jsobject.cpp:
11254
(jsDeallocate): Changed parameter type so we don't need a function cast.
11255
(_NPN_InvokeDefault): Use VOID_TO_NPVARIANT.
11256
(_NPN_Invoke): Use NULL_TO_NPVARIANT and VOID_TO_NPVARIANT.
11257
(_NPN_Evaluate): Use VOID_TO_NPVARIANT.
11258
(_NPN_GetProperty): Use NULL_TO_NPVARIANT and VOID_TO_NPVARIANT.
11260
* bindings/c/c_class.cpp: Formatting changes only.
11261
* bindings/c/c_class.h: Formatting changes only.
11263
* bindings/npruntime_priv.h: Removed obsolete and now-unused functions:
11264
NPN_VariantIsVoid, NPN_VariantIsNull, NPN_VariantIsUndefined,
11265
NPN_VariantIsBool, NPN_VariantIsInt32, NPN_VariantIsDouble,
11266
NPN_VariantIsString, NPN_VariantIsObject, NPN_VariantToBool,
11267
NPN_VariantToInt32, NPN_VariantToDouble, NPN_VariantToString,
11268
NPN_VariantToStringCopy, NPN_VariantToObject, NPN_InitializeVariantAsVoid,
11269
NPN_InitializeVariantAsNull, NPN_InitializeVariantAsUndefined,
11270
NPN_InitializeVariantWithBool, NPN_InitializeVariantWithInt32,
11271
NPN_InitializeVariantWithDouble, NPN_InitializeVariantWithString,
11272
NPN_InitializeVariantWithObject, and NPN_InitializeVariantWithVariant.
11273
* bindings/npruntime.cpp:
11274
(getIntIdentifierDictionary): Don't bother creating custom callbacks for the
11275
integer dictionary since the default behavior is fine for integers.
11277
2006-03-23 Mark Rowe <opendarwin.org@bdash.net.nz>
11279
Reviewed and landed by Maciej.
11281
- WebKit no longer builds with bison 2.1
11282
http://bugs.webkit.org/show_bug.cgi?id=7923
11284
* generate-derived-sources: Handle generated header named either grammar.cpp.h
11287
2006-03-22 Maciej Stachowiak <mjs@apple.com>
11291
* JavaScriptCore.xcodeproj/project.pbxproj:
11293
2006-03-21 Maciej Stachowiak <mjs@apple.com>
11295
* kjs/generate-derived-sources: Set executable property.
11297
2006-03-21 Maciej Stachowiak <mjs@apple.com>
11301
Ensure that generated source dependencies are handled properly, as follows:
11303
- Made an external script that generates the sources into a
11304
DerivedSources dir in the build products directory.
11305
- Added a new build target that builds all the generated sources
11306
if needed. Sadly it has to be a target, not a phase for Xcode to notice changes.
11307
- Added the DerivedSources dir in question to the include path.
11308
- Added the new DerivedSources dir and its contents to the project as build-relative.
11310
* JavaScriptCore.xcodeproj/project.pbxproj:
11311
* kjs/generate-derived-sources: Added. Based on the windows version - maybe someday they
11314
2006-03-11 Maciej Stachowiak <mjs@apple.com>
11318
- fixed "charAt layout test fails on intel macs; some NaNs are printed as -NaN"
11319
http://bugs.webkit.org/show_bug.cgi?id=7745
11322
(KJS::UString::from): Use "NaN" for all NaN values, regardless of sign.
11324
2006-03-16 Maciej Stachowiak <mjs@apple.com>
11328
- tweaks to my change to redo KJS::Node refcounting
11334
(Node::clearNewNodes):
11337
2006-03-16 Darin Adler <darin@apple.com>
11339
Reviewed by Maciej.
11341
- fixed Vector so that you can pass a reference to something in the vector
11342
to the append or insert functions
11344
* kxmlcore/Vector.h:
11345
(KXMLCore::Vector::expandCapacity): Added new overloads that take a pointer to adjust
11346
and return the adjusted value of the pointer.
11347
(KXMLCore::Vector::append): Pass a pointer when expanding the vector, and use it when
11348
adding the new element. Makes the case where the element moves when the vector
11350
(KXMLCore::Vector::insert): Ditto.
11352
2006-03-15 Eric Seidel <eseidel@apple.com>
11358
* kjs/date_object.cpp:
11359
(KJS::DateProtoFunc::callAsFunction): use size() not "len()"
11361
2006-03-15 Eric Seidel <eseidel@apple.com>
11365
Fix CString copy constructor, fixes Date.parse("") on Win32.
11367
* kjs/date_object.cpp:
11368
(KJS::DateProtoFunc::callAsFunction):
11370
(KJS::CString::CString):
11371
(KJS::CString::operator=):
11373
2006-03-13 Maciej Stachowiak <mjs@apple.com>
11375
Reviewed by Anders.
11377
- KJS::Node and KJS::StatementNode are bigger than they need to be
11378
http://bugs.webkit.org/show_bug.cgi?id=7775
11380
The memory usage of Node was reduced by 2 machine words per node:
11382
- sourceURL was removed and only kept on FunctionBodyNode. The
11383
source URL can only be distinct per function or top-level program node,
11384
and you always have one.
11386
- refcount was removed and kept in a separate hashtable when
11387
greater than 1. newNodes set represents floating nodes with
11388
refcount of 0. This helps because almost all nodes have a refcount of 1
11389
for almost all of their lifetime.
11391
* bindings/runtime_method.cpp:
11392
(RuntimeMethod::RuntimeMethod): Pass null body, added FIXME.
11394
(KJS::clearNewNodes): New nodes are tracked in nodes.cpp now, but still clear
11395
them at the appropriate time.
11397
(KJS::ContextImp::currentBody): added; used to retrieve source URL and sid
11399
(KJS::ContextImp::pushIteration): moved here from LabelStack
11400
(KJS::ContextImp::popIteration): ditto
11401
(KJS::ContextImp::inIteration): ditto
11402
(KJS::ContextImp::pushSwitch): ditto
11403
(KJS::ContextImp::popSwitch): ditto
11404
(KJS::ContextImp::inSwitch): ditto
11405
* kjs/function.cpp:
11406
(KJS::FunctionImp::FunctionImp): Add FunctionBodyNode* parameter.
11407
(KJS::FunctionImp::callAsFunction): Pass body to ContextImp.
11408
(KJS::FunctionImp::argumentsGetter): _context renamed to m_context.
11409
(KJS::DeclaredFunctionImp::DeclaredFunctionImp): Pass body to superclass
11411
(KJS::GlobalFuncImp::callAsFunction): Pass progNode as body for ContextImp in
11413
* kjs/function.h: Move body field from DeclaredFunctionImp to
11415
* kjs/grammar.y: Change DBG; statements no longer have a sourceid.
11416
* kjs/internal.cpp:
11417
(KJS::ContextImp::ContextImp): Initialize new m_currentBody, m_iterationDepth
11418
and m_switchDepth data members. New FunctionBodyNode* parameter - the
11419
function body provides source URL and SourceId.
11420
(KJS::InterpreterImp::mark): Use exception() function, not _exception directly.
11421
(KJS::InterpreterImp::evaluate): Pass progNode to ContextImp constructor
11422
to use as the body.
11424
(KJS::LabelStack::LabelStack): Remove iteration depth and switch depth;
11425
statement label stacks don't need these and it bloats their size. Put them
11426
in the ContextImp instead.
11427
* kjs/interpreter.cpp:
11428
(KJS::ExecState::lexicalInterpreter): Renamed _context to m_context.
11429
* kjs/interpreter.h:
11430
(KJS::ExecState::dynamicInterpreter): Renamed _context to m_context.
11431
(KJS::ExecState::context): ditto
11432
(KJS::ExecState::setException): Renamed _exception to m_exception
11433
(KJS::ExecState::clearException): ditto
11434
(KJS::ExecState::exception): ditto
11435
(KJS::ExecState::hadException): ditto
11436
(KJS::ExecState::ExecState): ditto both above renames
11438
(Node::Node): Removed initialization of line, source URL and refcount. Add to
11439
local newNodes set instead of involving parser.
11440
(Node::ref): Instead of managing refcount directly, story refcount over 1 in a
11441
HashCountedSet, and keep a separate HashSet of "floating" nodes with refcount
11443
(Node::deref): ditto
11444
(Node::refcount): ditto
11445
(Node::clearNewNodes): Destroy anything left in the new nodes set.
11446
(currentSourceId): Inline helper to get sourceId from function body via context.
11447
(currentSourceURL): ditto for sourceURL.
11448
(Node::createErrorCompletion): use new helper
11449
(Node::throwError): ditto
11450
(Node::setExceptionDetailsIfNeeded): ditto
11451
(StatementNode::StatementNode): remove initialization of l0 and sid, rename
11453
(StatementNode::setLoc): Set own m_lastLine and Node's m_line.
11454
(StatementNode::hitStatement): Get sid, first line, last line in the proper new ways.
11455
(StatListNode::StatListNode): updated for setLoc changes
11456
(BlockNode::BlockNode): ditto
11457
(DoWhileNode::execute): excpect iteraton counts on ContextImp, not LabelStack
11458
(WhileNode::execute): ditto
11459
(ForNode::execute): ditto
11460
(ForInNode::execute): ditto
11461
(ContinueNode::execute): excpect inIteration on ContextImp, not LabelStack
11462
(BreakNode::execute): excpect inIteration and inSwitch on ContextImp, not LabelStack
11463
(SwitchNode::execute): expect switch counts on ContextImp, not LabelStack
11464
(FunctionBodyNode::FunctionBodyNode): update for new setLoc
11465
(FunctionBodyNode::processFuncDecl): reindent
11466
(SourceElementsNode::SourceElementsNode): update for new setLoc
11468
(KJS::Node::lineNo): Renamed _line to m_line
11469
(KJS::StatementNode::firstLine): Use lineNo()
11470
(KJS::StatementNode::lastLine): Renamed l1 to m_lastLine
11471
(KJS::FunctionBodyNode::sourceId): added
11472
(KJS::FunctionBodyNode::sourceURL): added
11475
2006-03-14 Geoffrey Garen <ggaren@apple.com>
11477
- Fixed <rdar://problem/4478239> string sort puts "closed" before
11483
(KJS::compare): Inverted a < in order to treat the longer string as >
11484
the shorter string.
11486
2006-03-12 Alexey Proskuryakov <ap@nypop.com>
11488
Reviewed by Maciej.
11490
- fix http://bugs.webkit.org/show_bug.cgi?id=7708
11491
REGRESSION: Flash callback to JavaScript function not working.
11493
Test: plugins/invoke.html
11495
* bindings/c/c_utility.cpp:
11496
(KJS::Bindings::convertUTF8ToUTF16): Return a correct string length.
11498
2006-03-08 Eric Seidel <eseidel@apple.com>
11502
Partially fix JS on win32 by fixing hash table generation.
11504
* kjs/create_hash_table: limit << results to 32 bits.
11506
(TestFunctionImp::callAsFunction):
11508
2006-03-07 Darin Adler <darin@apple.com>
11510
* kxmlcore/Vector.h: Quick fix to try to get Windows compiling again.
11512
2006-03-07 Darin Adler <darin@apple.com>
11514
Reviewed by Anders.
11516
- fix http://bugs.webkit.org/show_bug.cgi?id=7655
11517
unwanted output while running layout tests
11519
* kjs/lexer.cpp: (Lexer::lex): Turn off the "yylex: ERROR" message.
11520
* kjs/regexp.cpp: (KJS::RegExp::RegExp): Remove the code to log errors from PCRE
11521
to standard output. I think we should arrange for the error text to be in JavaScript
11522
exceptions instead at some point.
11523
* kxmlcore/Vector.h: Add a check for overflow so that we'll abort if we pass a
11524
too-large size rather than allocating a buffer smaller than requested.
11526
2006-03-06 David Carson <dacarson@gmail.com>
11528
Reviewed by Darin, landed by ap.
11530
- Fixed http://bugs.webkit.org/show_bug.cgi?id=7582
11531
c_utility.cpp contains CFString OS X platform-dependent code; should use ICU
11533
Tested with test case from:
11534
http://bugs.webkit.org/show_bug.cgi?id=5163
11536
* bindings/c_utility.cpp
11537
(convertUTF8ToUTF16): Changed to using Unicode converter from ICU, and manual Latin-1 conversion.
11538
* icu/unicode/ucnv.h: Copied from WebCore.
11539
* icu/unicode/ucnv_err.h: Ditto.
11540
* icu/unicode/uenum.h: Ditto.
11542
2006-03-05 Darin Adler <darin@apple.com>
11544
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Updated.
11546
2006-03-06 Mitz Pettel <opendarwin.org@mitzpettel.com>
11548
Fix suggested by Alexey Proskuryakov <ap@nypop.com>, reviewed by Maciej and Hyatt.
11550
- fix http://bugs.webkit.org/show_bug.cgi?id=7601
11551
REGRESSION (r13089): Reproducible crash dereferencing a deallocated element on google image search
11553
* kxmlcore/Platform.h: Corrected the define to enable USE(MULTIPLE_THREADS) on Mac OS X.
11555
2006-03-05 Darin Adler <darin@apple.com>
11557
Reviewed by Maciej.
11559
- http://bugs.webkit.org/show_bug.cgi?id=7616
11560
get all references to KJS::Node out of internal.h
11562
* JavaScriptCore.xcodeproj/project.pbxproj: Updated for file changes.
11564
* kjs/Parser.cpp: Added.
11565
* kjs/Parser.h: Added.
11567
* kjs/internal.cpp: Removed the Parser class.
11568
* kjs/internal.h: Ditto. Also removed unnecessary declarations of classes
11569
not used in this header.
11571
* kjs/nodes.h: Added an include of "Parser.h".
11572
* kjs/function.h: Added a declaration of FunctionBodyNode.
11574
2006-03-05 Geoffrey Garen <ggaren@apple.com>
11576
Reviewed by Maciej.
11578
- JSC support for the fix for <rdar://problem/4467143> JavaScript
11579
enumeration of HTML element properties skips DOM node properties
11582
(1) Added the KJS_DEFINE_PROTOTYPE_WITH_PROTOTYPE macro. The
11583
class definiton macro needs to know about the prototype's prototype so
11584
that the class constructor properly sets it.
11585
(2) Removed the KJS_IMPLEMENT_PROTOTYPE_WITH_PARENT macro. The class
11586
implementation macro does not need to know about the prototype's
11587
prototype, since getOwnPropertySlot should only look in the current
11588
object's property map, and not its prototype's.
11590
2006-03-05 Andrew Wellington <proton@wiretapped.net>
11592
Reviewed by Eric, landed by ap.
11594
- Remove unused breakpoint bool from StatementNodes. No test provided as
11595
there is no functionality change.
11598
(StatementNode::StatementNode):
11601
2006-03-03 Geoffrey Garen <ggaren@apple.com>
11605
- Fixed <rdar://problem/4465598> REGRESSION (TOT): Crash occurs at
11606
http://maps.google.com/?output=html ( KJS::Identifier::add(KJS::UString::Rep*)
11608
This regression was caused by my fix for 4448098. I failed to account for the
11609
deleted entry sentinel in the mehtod that saves the contents of a property map to
11610
the back/forward cache.
11612
Manual test in WebCore/manual-tests/property-map-save-crash.html
11614
* kjs/property_map.cpp:
11615
(KJS::deletedSentinel): Use 1 instead of -1 to facilitate an easy bit mask
11616
(KJS::isValid): New function: checks if a key is null or the deleted sentinel
11617
(KJS::PropertyMap::~PropertyMap): Fixed up the branch logic here for readability
11618
and a slight performance win
11619
(KJS::PropertyMap::clear):
11620
(KJS::PropertyMap::rehash):
11621
(KJS::PropertyMap::addSparseArrayPropertiesToReferenceList):
11622
(KJS::PropertyMap::save): Check keys with isValid()
11624
2006-03-02 Maciej Stachowiak <mjs@apple.com>
11626
- now fix mac build again
11628
* kjs/identifier.cpp:
11630
2006-03-02 Maciej Stachowiak <mjs@apple.com>
11632
Rubber stamped by Anders and Eric.
11634
- add fpconst.cpp to win32 build, it is now needed
11636
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
11639
2006-03-02 Maciej Stachowiak <mjs@apple.com>
11643
- fix windows build, broken by my last patch
11645
* kjs/JSImmediate.cpp:
11646
* kjs/identifier.cpp:
11647
* kxmlcore/FastMalloc.cpp:
11648
* kxmlcore/Platform.h:
11650
2006-03-01 Maciej Stachowiak <mjs@apple.com>
11654
- Set up new prototype macros and avoid using #if without defined() in JSC
11656
Added new PLATFORM macros and related, to make sure #if's all check if relevant macros
11657
are defined, and to separate core OS-level dependencies from operating environment
11658
dependencies so you can, e.g., build KDE on Mac or Windows.
11660
* kxmlcore/Platform.h: Added.
11662
- deploy them everywhere in JavaScriptCore
11664
* JavaScriptCore.xcodeproj/project.pbxproj:
11665
* bindings/jni/jni_utility.cpp:
11666
(KJS::Bindings::convertValueToJValue):
11667
* bindings/objc/WebScriptObject.mm:
11668
* bindings/objc/objc_instance.mm:
11669
(ObjcInstance::end):
11670
* bindings/softlinking.h:
11671
* bindings/testbindings.mm:
11674
* kjs/collector.cpp:
11675
(KJS::Collector::markCurrentThreadConservatively):
11676
(KJS::Collector::markOtherThreadConservatively):
11677
(KJS::Collector::markStackObjectsConservatively):
11679
* kjs/date_object.cpp:
11682
(KJS::DateProtoFunc::callAsFunction):
11683
(KJS::DateObjectImp::construct):
11690
* kjs/identifier.cpp:
11691
* kjs/internal.cpp:
11692
* kjs/interpreter.cpp:
11693
(KJS::Interpreter::evaluate):
11694
(KJS::Interpreter::createLanguageInstanceForValue):
11695
* kjs/interpreter.h:
11698
* kjs/math_object.cpp:
11701
* kjs/operations.cpp:
11706
* kjs/operations.h:
11708
(KJS::RegExp::RegExp):
11709
(KJS::RegExp::~RegExp):
11710
(KJS::RegExp::match):
11713
(StopWatch::start):
11715
(StopWatch::getElapsedMS):
11718
* kxmlcore/AlwaysInline.h:
11719
* kxmlcore/Assertions.cpp:
11720
* kxmlcore/Assertions.h:
11721
* kxmlcore/FastMalloc.cpp:
11723
* kxmlcore/FastMalloc.h:
11724
* kxmlcore/FastMallocInternal.h:
11725
* kxmlcore/HashTable.h:
11726
* kxmlcore/TCPageMap.h:
11727
* kxmlcore/TCSpinLock.h:
11728
(TCMalloc_SpinLock::Lock):
11729
(TCMalloc_SpinLock::Unlock):
11730
(TCMalloc_SlowLock):
11731
* kxmlcore/TCSystemAlloc.cpp:
11732
(TCMalloc_SystemAlloc):
11733
* os-win32/stdint.h:
11735
2006-02-28 Geoffrey Garen <ggaren@apple.com>
11739
- Fixed <rdar://problem/4448098> Switch PropertyMap deleted entry
11740
placeholder to -1 from UString::Rep::null
11742
This turned out to be only a small speedup (.12%). That's within the
11743
margin of error for super accurate JS iBench, but Shark confirms the
11744
same, so I think it's worth landing.
11746
FYI, I also confirmed that the single entry optimization in
11747
PropertyMap is a 3.2% speedup.
11749
* kjs/property_map.cpp:
11750
(KJS::PropertyMap::~PropertyMap):
11751
(KJS::PropertyMap::clear):
11752
(KJS::PropertyMap::put):
11753
(KJS::PropertyMap::insert):
11754
(KJS::PropertyMap::rehash):
11755
(KJS::PropertyMap::remove):
11756
(KJS::PropertyMap::addSparseArrayPropertiesToReferenceList):
11757
(KJS::PropertyMap::checkConsistency):
11758
* kjs/property_map.h:
11759
(KJS::PropertyMap::deletedSentinel):
11761
2006-02-27 Eric Seidel <eseidel@apple.com>
11763
Rubber-stamped by darin.
11765
Remove fpconst.cpp, unused on win32 and the cause of linker warnings.
11767
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
11769
2006-02-27 Eric Seidel <eseidel@apple.com>
11773
Fix Assertions.cpp to compile on win32.
11775
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
11776
* kxmlcore/Assertions.cpp:
11778
2006-02-27 Eric Seidel <eseidel@apple.com>
11782
Made Assertions.cpp platform independent.
11783
Moved mac-specific logging logic up into WebCore.
11784
http://bugs.webkit.org/show_bug.cgi?id=7503
11786
* JavaScriptCore.xcodeproj/project.pbxproj:
11787
* kxmlcore/Assertions.cpp: Added.
11788
* kxmlcore/Assertions.h:
11789
* kxmlcore/Assertions.mm: Removed.
11791
2006-02-27 Darin Adler <darin@apple.com>
11793
- fixed Mac Debug build, there was an unused parameter
11795
* kxmlcore/FastMalloc.cpp: (KXMLCore::fastMallocRegisterThread):
11796
Remove parameter name.
11798
* kjs/debugger.h: Fixed comment.
11800
2006-02-27 Eric Seidel <eseidel@apple.com>
11804
* kxmlcore/Vector.h:
11805
(KXMLCore::deleteAllValues): fix unused variable warning
11807
2006-02-21 Maciej Stachowiak <mjs@apple.com>
11811
- Turn off -Wno-unused-param for JavaScriptCore and get rid of unused params
11812
http://bugs.webkit.org/show_bug.cgi?id=7384
11814
* JavaScriptCore.xcodeproj/project.pbxproj:
11815
* bindings/NP_jsobject.cpp:
11817
(_NPN_InvokeDefault):
11819
(_NPN_GetProperty):
11820
(_NPN_SetProperty):
11821
(_NPN_RemoveProperty):
11822
(_NPN_HasProperty):
11824
* bindings/c/c_class.h:
11825
(KJS::Bindings::CClass::constructorAt):
11826
* bindings/c/c_utility.cpp:
11827
(KJS::Bindings::convertNPVariantToValue):
11828
* bindings/jni/jni_class.cpp:
11829
(JavaClass::methodsNamed):
11830
(JavaClass::fieldNamed):
11831
* bindings/jni/jni_instance.cpp:
11832
(JavaInstance::invokeDefaultMethod):
11833
* bindings/jni/jni_jsobject.cpp:
11834
* bindings/jni/jni_objc.mm:
11835
(-[NSObject KJS::Bindings::]):
11836
* bindings/objc/WebScriptObject.mm:
11837
(+[WebUndefined allocWithZone:]):
11838
(-[WebUndefined initWithCoder:]):
11839
(-[WebUndefined encodeWithCoder:]):
11840
(-[WebUndefined copyWithZone:]):
11841
* bindings/objc/objc_class.h:
11842
(KJS::Bindings::ObjcClass::constructorAt):
11843
* bindings/objc/objc_class.mm:
11844
(KJS::Bindings::ObjcClass::methodsNamed):
11845
(KJS::Bindings::ObjcClass::fallbackObject):
11846
* bindings/objc/objc_instance.mm:
11847
(ObjcInstance::getValueOfUndefinedField):
11848
* bindings/objc/objc_runtime.mm:
11849
(ObjcFallbackObjectImp::getOwnPropertySlot):
11850
(ObjcFallbackObjectImp::put):
11851
(ObjcFallbackObjectImp::canPut):
11852
(ObjcFallbackObjectImp::deleteProperty):
11853
(ObjcFallbackObjectImp::toBoolean):
11854
* bindings/runtime.cpp:
11855
(KJS::Bindings::Instance::createLanguageInstanceForValue):
11856
* bindings/runtime.h:
11857
(KJS::Bindings::Instance::getValueOfUndefinedField):
11858
(KJS::Bindings::Instance::setValueOfUndefinedField):
11859
* bindings/runtime_array.cpp:
11860
(RuntimeArray::lengthGetter):
11861
(RuntimeArray::indexGetter):
11862
(RuntimeArray::put):
11863
(RuntimeArray::deleteProperty):
11864
* bindings/runtime_method.cpp:
11865
(RuntimeMethod::lengthGetter):
11866
(RuntimeMethod::execute):
11867
* bindings/runtime_object.cpp:
11868
(RuntimeObjectImp::fallbackObjectGetter):
11869
(RuntimeObjectImp::fieldGetter):
11870
(RuntimeObjectImp::methodGetter):
11871
(RuntimeObjectImp::put):
11872
(RuntimeObjectImp::canPut):
11873
(RuntimeObjectImp::deleteProperty):
11874
(RuntimeObjectImp::defaultValue):
11875
(RuntimeObjectImp::callAsFunction):
11876
* bindings/runtime_root.cpp:
11877
(performJavaScriptAccess):
11878
* kjs/array_object.cpp:
11879
(ArrayInstance::lengthGetter):
11880
(ArrayInstance::getOwnPropertySlot):
11881
(ArrayPrototype::ArrayPrototype):
11882
(ArrayPrototype::getOwnPropertySlot):
11883
* kjs/bool_object.cpp:
11884
(BooleanObjectImp::BooleanObjectImp):
11885
* kjs/date_object.cpp:
11886
(KJS::DateObjectFuncImp::DateObjectFuncImp):
11887
(KJS::DateObjectFuncImp::callAsFunction):
11888
* kjs/error_object.cpp:
11889
(ErrorObjectImp::ErrorObjectImp):
11890
(NativeErrorPrototype::NativeErrorPrototype):
11891
(NativeErrorImp::NativeErrorImp):
11892
* kjs/function.cpp:
11893
(KJS::FunctionImp::argumentsGetter):
11894
(KJS::FunctionImp::lengthGetter):
11895
(KJS::Arguments::mappedIndexGetter):
11896
(KJS::ActivationImp::argumentsGetter):
11897
(KJS::ActivationImp::put):
11898
* kjs/function_object.cpp:
11899
(FunctionObjectImp::FunctionObjectImp):
11900
* kjs/internal.cpp:
11901
(KJS::GetterSetterImp::toPrimitive):
11902
(KJS::GetterSetterImp::toBoolean):
11903
* kjs/interpreter.cpp:
11904
(KJS::Interpreter::evaluate):
11905
* kjs/interpreter.h:
11906
(KJS::Interpreter::isGlobalObject):
11907
(KJS::Interpreter::interpreterForGlobalObject):
11908
(KJS::Interpreter::isSafeScript):
11910
(Lexer::makeIdentifier):
11911
(Lexer::makeUString):
11913
(KJS::staticFunctionGetter):
11914
(KJS::staticValueGetter):
11916
(StatementNode::processFuncDecl):
11917
(PropertyNode::evaluate):
11918
(PropertyNameNode::evaluate):
11919
* kjs/number_object.cpp:
11920
(NumberObjectImp::NumberObjectImp):
11921
(NumberObjectImp::getOwnPropertySlot):
11923
(KJS::JSObject::defineGetter):
11924
(KJS::JSObject::defineSetter):
11925
(KJS::JSObject::hasInstance):
11926
(KJS::JSObject::propertyIsEnumerable):
11927
* kjs/object_object.cpp:
11928
(ObjectObjectImp::ObjectObjectImp):
11929
* kjs/property_slot.cpp:
11930
(KJS::PropertySlot::undefinedGetter):
11931
(KJS::PropertySlot::functionGetter):
11932
* kjs/reference.cpp:
11933
(KJS::Reference::getPropertyName):
11934
* kjs/reference_list.cpp:
11935
(ReferenceListIterator::operator++):
11936
* kjs/regexp_object.cpp:
11937
(RegExpObjectImp::RegExpObjectImp):
11938
(RegExpObjectImp::getValueProperty):
11939
(RegExpObjectImp::putValueProperty):
11940
* kjs/string_object.cpp:
11941
(StringInstance::lengthGetter):
11942
(StringInstance::indexGetter):
11943
(StringPrototype::StringPrototype):
11944
* kxmlcore/Assertions.mm:
11945
* kxmlcore/FastMalloc.cpp:
11946
(KXMLCore::TCMalloc_PageHeap::CheckList):
11947
* kxmlcore/HashTable.h:
11948
(KXMLCore::HashTableConstIterator::checkValidity):
11949
(KXMLCore::IdentityHashTranslator::translate):
11951
(pcre_get_stringnumber):
11953
2006-02-23 Darin Adler <darin@apple.com>
11955
- try to fix buildbot failure
11957
* bindings/c/c_utility.cpp: Touch this file, which seems to not have been
11958
recompiled after additional inlining was introduced (Xcode bug?).
11960
2006-02-23 Geoffrey Garen <ggaren@apple.com>
11962
Reviewed by Darin, Maciej.
11964
- Inline some functions suggested by Shark. 2.9% speedup on super
11965
accurate JS iBench.
11967
http://bugs.webkit.org/show_bug.cgi?id=7411
11968
<rdar://problem/4448116>
11971
(KJS::ArgumentsNode::evaluateList):
11974
(KJS::ScopeChain::release):
11975
(KJS::JSObject::toPrimitive):
11976
* kjs/scope_chain.cpp:
11979
(KJS::UString::toArrayIndex):
11982
(KJS::JSValue::toObject):
11983
* kxmlcore/FastMalloc.cpp:
11984
(KXMLCore::TCMalloc_ThreadCache_FreeList::Push):
11985
(KXMLCore::TCMalloc_ThreadCache_FreeList::Pop):
11987
2006-02-21 Eric Seidel <eseidel@apple.com>
11989
Added *.user to ignore list.
11991
2006-02-21 Eric Seidel <eseidel@apple.com>
11993
Reviewed by ggaren.
11995
Add grammarWrapper.cpp to work around visual studio bug plaguing buildbot.
11997
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
11998
* JavaScriptCore.vcproj/JavaScriptCore/grammarWrapper.cpp: Added.
12000
2006-02-21 Eric Seidel <eseidel@apple.com>
12002
Reviewed by ggaren.
12004
* kjs/testkjs.cpp: #if out timeval code on win32
12006
2006-02-21 Michael Emmel <mike.emmel@gmail.com>
12010
- fix http://bugs.webkit.org/show_bug.cgi?id=7397
12011
TCPageMap.h would not compile for me because string.h was missing
12013
* kxmlcore/TCPageMap.h: Added <string.h> include.
12015
2006-02-21 Darin Adler <darin@apple.com>
12017
Reviewed by John Sullivan.
12019
- http://bugs.webkit.org/show_bug.cgi?id=7404
12020
remove a bunch of extra implementsCall overrides
12022
* JavaScriptCore.xcodeproj/project.pbxproj: Sorted files.
12024
* kjs/internal.h: Made InternalFunctionImp::callAsFunction pure virtual so that
12025
we'll get a compile error if some derived class neglects to implement it.
12027
* kjs/function.cpp: (KJS::FunctionImp::FunctionImp): Remove unneeded initialization
12028
of param, which is an OwnPtr so it gets initialized by default.
12030
* bindings/runtime_method.cpp:
12031
* bindings/runtime_method.h:
12032
* kjs/array_object.cpp:
12033
* kjs/array_object.h:
12034
* kjs/bool_object.cpp:
12035
* kjs/bool_object.h:
12036
* kjs/date_object.cpp:
12037
* kjs/date_object.h:
12038
* kjs/error_object.cpp:
12039
* kjs/error_object.h:
12040
* kjs/function.cpp:
12042
* kjs/function_object.cpp:
12043
* kjs/function_object.h:
12044
* kjs/math_object.cpp:
12045
* kjs/math_object.h:
12046
* kjs/number_object.cpp:
12047
* kjs/number_object.h:
12048
* kjs/object_object.cpp:
12049
* kjs/object_object.h:
12050
* kjs/regexp_object.cpp:
12051
* kjs/regexp_object.h:
12052
* kjs/string_object.cpp:
12053
* kjs/string_object.h:
12054
Removed many rendundant implementations of implementsCall from subclasses of
12055
InternalFunctionImp.
12057
2006-02-21 Darin Adler <darin@apple.com>
12061
* kjs/internal.cpp: (KJS::InternalFunctionImp::implementsCall):
12064
2006-02-21 Darin Adler <darin@apple.com>
12066
Change suggested by Mitz.
12068
- http://bugs.webkit.org/show_bug.cgi?id=7402
12069
REGRESSION: Methods do not execute
12071
* kjs/internal.h: Add implementsHasCall to InternalFunctionImp.
12072
* kjs/internal.cpp: (KJS::InternalFunctionImp::implementsHasCall):
12073
Return true. All the classes derived from InternalFunctionImp need
12074
to return true from this -- later we can remove all the extra
12075
implementations too.
12077
2006-02-21 Maciej Stachowiak <mjs@apple.com>
12079
- fix build breakage caused by last-minute change to my patch
12083
2006-02-20 Maciej Stachowiak <mjs@apple.com>
12085
Reviewed by Geoff and Darin.
12087
Patch from Maks Orlovich, based on work by David Faure, hand-applied and
12088
significantly reworked by me.
12090
- Patch: give internal function names (KJS merge)
12091
http://bugs.webkit.org/show_bug.cgi?id=6279
12093
* tests/mozilla/expected.html: Updated for newly fixed test.
12095
* kjs/array_object.cpp:
12096
(ArrayProtoFunc::ArrayProtoFunc):
12097
* kjs/array_object.h:
12098
* kjs/bool_object.cpp:
12099
(BooleanPrototype::BooleanPrototype):
12100
(BooleanProtoFunc::BooleanProtoFunc):
12101
* kjs/bool_object.h:
12102
* kjs/date_object.cpp:
12103
(KJS::DateProtoFunc::DateProtoFunc):
12104
(KJS::DateObjectImp::DateObjectImp):
12105
(KJS::DateObjectFuncImp::DateObjectFuncImp):
12106
* kjs/error_object.cpp:
12107
(ErrorPrototype::ErrorPrototype):
12108
(ErrorProtoFunc::ErrorProtoFunc):
12109
* kjs/error_object.h:
12110
* kjs/function.cpp:
12111
(KJS::FunctionImp::FunctionImp):
12112
(KJS::GlobalFuncImp::GlobalFuncImp):
12114
* kjs/function_object.cpp:
12115
(FunctionPrototype::FunctionPrototype):
12116
(FunctionProtoFunc::FunctionProtoFunc):
12117
(FunctionProtoFunc::callAsFunction):
12118
* kjs/function_object.h:
12119
* kjs/internal.cpp:
12120
(KJS::InterpreterImp::initGlobalObject):
12121
(KJS::InternalFunctionImp::InternalFunctionImp):
12123
(KJS::InternalFunctionImp::functionName):
12125
(KJS::staticFunctionGetter):
12126
(KJS::HashEntryFunction::HashEntryFunction):
12127
(KJS::HashEntryFunction::implementsCall):
12128
(KJS::HashEntryFunction::toBoolean):
12129
(KJS::HashEntryFunction::implementsHasInstance):
12130
(KJS::HashEntryFunction::hasInstance):
12131
* kjs/math_object.cpp:
12132
(MathFuncImp::MathFuncImp):
12133
* kjs/math_object.h:
12134
* kjs/number_object.cpp:
12135
(NumberPrototype::NumberPrototype):
12136
(NumberProtoFunc::NumberProtoFunc):
12137
* kjs/number_object.h:
12139
(KJS::JSObject::putDirectFunction):
12140
(KJS::Error::create):
12142
* kjs/object_object.cpp:
12143
(ObjectPrototype::ObjectPrototype):
12144
(ObjectProtoFunc::ObjectProtoFunc):
12145
* kjs/object_object.h:
12146
* kjs/regexp_object.cpp:
12147
(RegExpPrototype::RegExpPrototype):
12148
(RegExpProtoFunc::RegExpProtoFunc):
12149
* kjs/regexp_object.h:
12150
* kjs/string_object.cpp:
12151
(StringProtoFunc::StringProtoFunc):
12152
(StringObjectImp::StringObjectImp):
12153
(StringObjectFuncImp::StringObjectFuncImp):
12154
* kjs/string_object.h:
12156
2006-02-20 Geoffrey Garen <ggaren@apple.com>
12158
Reviewed by Darin, with help from Eric, Maciej.
12160
- More changes to support super-accurate JS iBench. Doesn't work on
12161
Windows. (Doesn't break Windows, either.) I've filed
12162
[http://bugs.webkit.org/show_bug.cgi?id=7399] about that.
12164
* kjs/interpreter.cpp:
12165
(KJS::Interpreter::evaluate): Print line numbers with exception output
12166
* kjs/testkjs.cpp: Changed " *" to "* " because Eric says that's the
12167
way we roll with .cpp files.
12168
(StopWatch::StopWatch): New class. Provides microsecond-accurate
12170
(StopWatch::~StopWatch):
12171
(StopWatch::start):
12173
(StopWatch::getElapsedMS):
12174
(TestFunctionImp::callAsFunction): Added missing return statement.
12175
Fixed up "run" to use refactored helper functions. Removed bogus
12176
return statement from "quit" case. Made "print" output to stdout
12177
instead of stderr because that makes more sense, and PERL handles
12179
(main): Factored out KXMLCore unit tests. Removed custom exception
12180
printing code because the interpreter prints exceptions for you. Added
12181
a "delete" call for the GlobalImp we allocate.
12182
(testIsInteger): New function, result of refacotring.
12183
(createStringWithContentsOfFile): New function, result of refactoring.
12184
Renamed "code" to "buffer" to match factored-out-ness.
12186
2006-02-20 Eric Seidel <eseidel@apple.com>
12190
Fix "Copy ICU DLLs..." phase.
12192
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
12193
* JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
12195
2006-02-19 Darin Adler <darin@apple.com>
12197
- renamed ERROR to LOG_ERROR to fix build
12198
presumably Maciej had this change and forgot to land it
12200
* kjs/collector.cpp: Removed now-unneeded #undef ERROR.
12201
* kxmlcore/Assertions.h: Renamed ERROR to LOG_ERROR.
12202
* kxmlcore/FastMalloc.cpp: Changed MESSAGE macro to use LOG_ERROR.
12204
2006-02-18 Mitz Pettel <opendarwin.org@mitzpettel.com>
12206
Test: fast/js/toString-exception.html
12208
Reviewed by Maciej.
12210
- fix http://bugs.webkit.org/show_bug.cgi?id=7343
12211
REGRESSION: fast/js/toString-overrides.html fails when run multiple times
12213
* kjs/array_object.cpp:
12214
(ArrayProtoFunc::callAsFunction): Remove the object from the visited elements set before
12215
returning an error.
12217
2006-02-18 Darin Adler <darin@apple.com>
12219
Reviewed by Maciej.
12221
- http://bugs.webkit.org/show_bug.cgi?id=7345
12222
add insert and remove to KXMLCore::Vector
12224
* kxmlcore/Vector.h: Added "moveOverlapping", which is used in both
12225
insert and remove to slide elements within the vector. Also added
12226
"insert" and "remove" functions.
12228
2006-02-16 Geoffrey Garen <ggaren@apple.com>
12232
- Fixed <rdar://problem/4448534> TOT REGRESSION: crash in KJS::
12233
Bindings::Instance::deref when leaving page @ gigaom.com
12235
* bindings/c/c_instance.cpp:
12236
(KJS::Bindings::CInstance::~CInstance): Since we cache the class object
12237
globally, we shouldn't delete it, so don't.
12239
2006-02-16 Timothy Hatcher <timothy@apple.com>
12241
Added -Wno-deprecated-declarations to all the ObjC binding files to prevent deprecation
12242
warnings. Using <rdar://problem/4448350> to track this.
12244
* JavaScriptCore.xcodeproj/project.pbxproj:
12245
* bindings/objc/objc_jsobject.h: Removed empty file.
12246
* bindings/objc/objc_jsobject.mm: Removed empty file.
12248
2006-02-16 Tim Omernick <timo@apple.com>
12252
<rdar://problem/4428609> Flash Player 8.0.22 can crash Safari (and WebKit apps) with
12253
javascript disabled (7015)
12255
* bindings/NP_jsobject.cpp:
12256
(_NPN_CreateNoScriptObject):
12257
Returns an NPObject which is not bound to a JavaScript object. This kind of NPObject
12258
can be given to a plugin as the "window script object" when JavaScript is disabled.
12259
The object has a custom NPClass, NPNoScriptObjectClass, which has no defined methods.
12260
Because of this, none of the NPN_* functions called by the plugin on this "no script
12261
object" will cause entry into JavaScript code.
12262
(_NPN_InvokeDefault):
12263
Make sure the NPVariant is filled before returning from this function. This never
12264
mattered before because we never reached this case, having only created NPObjects of
12265
the class NPScriptObjectClass.
12270
(_NPN_GetProperty):
12273
* bindings/NP_jsobject.h:
12274
Declared _NPN_CreateNoScriptObject().
12276
2006-02-16 Darin Adler <darin@apple.com>
12278
Reviewed by me, change by Peter Kuemmel.
12280
* kjs/operations.cpp: (KJS::isNegInf): Fix Windows code, which was
12281
checking for positive infinity (rolling in fix from KDE side).
12283
2006-02-15 Geoffrey Garen <ggaren@apple.com>
12285
Reviewed by Maciej, Eric.
12287
- JavaScriptCore half of fix for <rdar://problem/4176077> CrashTracer: 6569
12288
crashes in DashboardClient at com.apple.JavaScriptCore:
12289
KJS::Bindings::ObjcFallbackObjectImp::type()
12291
WebCore and JavaScriptCore weren't sharing Instance objects very
12292
nicely. I made them use RefPtrs, and sent them to bed without dessert.
12294
* bindings/jni/jni_instance.cpp: Made _instance a RefPtr
12295
(JavaInstance::~JavaInstance):
12296
(JObjectWrapper::JObjectWrapper):
12297
* bindings/jni/jni_instance.h:
12298
(KJS::Bindings::JObjectWrapper::ref):
12299
(KJS::Bindings::JObjectWrapper::deref):
12300
* bindings/jni/jni_runtime.cpp: Made _array a RefPtr
12301
(JavaArray::~JavaArray):
12302
(JavaArray::JavaArray):
12303
* bindings/jni/jni_runtime.h:
12304
(KJS::Bindings::JavaArray::operator=):
12305
* bindings/objc/objc_runtime.h:
12306
- Prohibited copying because that would muss the ref count.
12307
- Prohibited construction without instance because an instance wrapper
12308
without an instance is almost certainly a bug.
12309
* bindings/objc/objc_runtime.mm:
12310
(ObjcFallbackObjectImp::ObjcFallbackObjectImp):
12311
* bindings/runtime.cpp:
12312
(KJS::Bindings::Instance::Instance):
12313
(KJS::Bindings::Instance::createBindingForLanguageInstance):
12314
(KJS::Bindings::Instance::createRuntimeObject):
12315
* bindings/runtime.h:
12316
(KJS::Bindings::Instance::ref):
12317
(KJS::Bindings::Instance::deref):
12318
* bindings/runtime_object.cpp:
12319
(RuntimeObjectImp::RuntimeObjectImp):
12320
(RuntimeObjectImp::fallbackObjectGetter):
12321
(RuntimeObjectImp::fieldGetter):
12322
(RuntimeObjectImp::methodGetter):
12323
(RuntimeObjectImp::getOwnPropertySlot):
12324
(RuntimeObjectImp::put):
12325
(RuntimeObjectImp::canPut):
12326
* bindings/runtime_object.h:
12327
- Removed ownsInstance data member because RefPtr takes care of
12328
instance lifetime now.
12329
- Prohibited copying because that would muss the ref count.
12330
- Prohibited construction without instance because an instance wrapper
12331
without an instance is almost certainly a bug.
12332
(KJS::RuntimeObjectImp::getInternalInstance):
12334
2006-02-15 Geoffrey Garen <ggaren@apple.com>
12338
- Applied the 4330457 change to CClass and ObjcClass as well.
12340
Once plugins work in DumpRenderTree, running run-webkit-tests --leaks
12343
This change isn't as critical because CClass and ObjcClass objects get
12344
cached globally and never deleted, but it's good practice, in case we
12345
ever do decide to delete CClass and ObjcClass objects.
12347
This change requires prohibiting copying, because we don't do any
12348
intelligent ref-counting -- when a Class is destroyed, it destroys its
12349
methods and fields unconditionally. (Java classes already prohibited
12352
* bindings/c/c_class.cpp:
12353
- Merged _commonInit and _commonDelete into constructor and destructor.
12356
(CClass::methodsNamed): Added delete callbacks
12357
(CClass::fieldNamed): Added delete callbacks
12358
* bindings/c/c_class.h: Prohibited copying
12359
* bindings/c/c_instance.cpp:
12360
(KJS::Bindings::CInstance::getClass): Changed to use the preferred
12361
class factory method, to take advantage of the global cache.
12363
[ Repeated changes applied to CClass for ObjcClass: ]
12365
* bindings/objc/objc_class.h:
12366
* bindings/objc/objc_class.mm:
12367
(KJS::Bindings::ObjcClass::ObjcClass):
12368
(KJS::Bindings::ObjcClass::~ObjcClass):
12369
(KJS::Bindings::ObjcClass::methodsNamed):
12370
(KJS::Bindings::ObjcClass::fieldNamed):
12371
* bindings/objc/objc_runtime.h:
12372
(KJS::Bindings::ObjcMethod::ObjcMethod): Initialized uninitialized
12373
variable to prevent bad CFRelease.
12374
(KJS::Bindings::ObjcMethod::~ObjcMethod): Removed erroneous ';' from
12375
if statement to prevent bad CFRelease.
12376
* bindings/objc/objc_runtime.cpp: Changed to use the preferred
12377
ObjectStructPtr, for clarity.
12379
2006-02-14 Geoffrey Garen <ggaren@apple.com>
12383
- Fixed <rdar://problem/4330457> CrashTracer: [REGRESSION] 3763 crashes
12384
in Safari at com.apple.JavaScriptCore: KJS::Bindings::JavaInstance::
12385
getClass const + 56
12387
Once plugins work in DumpRenderTree, running run-webkit-tests --leaks
12390
This was a memory leak in the bindings code. The leak was so extreme
12391
that it would cause Safari or the JVM to abort from lack of memory.
12392
Upon construction, Class objects create field and method objects,
12393
storing them in CFDictionaries. The bug was that upon destruction, the
12394
class objects released the dictionaries but didn't destroy the stored
12397
The fix is to supply CFDictionary callbacks for destroying the values
12398
added to the dictionary.
12400
* bindings/jni/jni_class.cpp:
12401
(JavaClass::JavaClass): Added delete callbacks
12402
* bindings/runtime.cpp: Added definitions for delete callbacks
12403
(KJS::Bindings::deleteMethodList):
12404
(KJS::Bindings::deleteMethod):
12405
(KJS::Bindings::deleteField):
12406
* bindings/runtime.h: Added declarations for delete callbacks
12408
2006-02-14 Timothy Hatcher <timothy@apple.com>
12410
Reviewed by Justin.
12412
Fixed <rdar://problem/4415050> STD: WebCore build steps use echo -n, which will change
12413
behavior due to POSIX version of sh
12415
* JavaScriptCore.xcodeproj/project.pbxproj: removed the use of echo -n, replaced with printf ""
12417
2006-02-13 Dave Hyatt <hyatt@apple.com>
12419
Fix Win32 bustage in JavaScriptCore.
12423
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
12424
Add JSImmediate to the Win32 project.
12426
* kjs/JSImmediate.h:
12427
(KJS::JSImmediate::fromDouble):
12428
(KJS::JSImmediate::toDouble):
12429
(KJS::JSImmediate::NanAsBits):
12430
(KJS::JSImmediate::oneAsBits):
12431
Win32 needs explicit returns after abort() for non-void functions.
12435
Win32 catches a bug in testkjs! The "return 2" should actually
12436
have been a return false.
12439
The extern decls of NaN and Inf need to be const.
12441
=== JavaScriptCore-521.7 ===
12443
2006-02-13 Timothy Hatcher <timothy@apple.com>
12447
Replaced the old NS_DURING exception blocking with @try/@catch.
12449
* JavaScriptCorePrefix.h: undef try and catch to workaround a C++ conflict
12450
* bindings/objc/objc_instance.mm:
12451
(ObjcInstance::invokeMethod):
12452
(ObjcInstance::invokeDefaultMethod):
12453
(ObjcInstance::setValueOfUndefinedField):
12454
(ObjcInstance::getValueOfUndefinedField):
12455
* bindings/objc/objc_runtime.mm:
12456
(ObjcField::valueFromInstance):
12457
(ObjcField::setValueToInstance):
12458
(ObjcArray::setValueAt):
12459
(ObjcArray::valueAt):
12461
2006-02-13 Darin Adler <darin@apple.com>
12463
- fix a couple problems building on Windows, based on requests
12464
from Krzysztof Kowalczyk <kkowalczyk@gmail.com>
12466
* kjs/JSImmediate.h: Change code using non-standard u_int32/64_t types
12467
to the standard uint32/64_t. Also removed curious "isIEEE()" function
12468
that checked the sizes of some types (and type sizes alone don't tell you if
12469
the floating point conforms to the IEEE-standard). Added missing include
12472
* kjs/property_slot.h: Added missing include of <assert.h>.
12474
2006-02-12 Geoffrey Garen <ggaren@apple.com>
12478
Cleaned up testkjs, added new "run" functionality to allow scripting
12479
tests from within JS. ("run" is a part of my new super-accurate
12482
No regressions in run-javascriptcore-tests.
12485
(GlobalImp::className):
12486
(TestFunctionImp::):
12487
(TestFunctionImp::callAsFunction):
12491
2006-02-11 Alexey Proskuryakov <ap@nypop.com>
12495
- improve fix for http://bugs.webkit.org/show_bug.cgi?id=5163
12496
RealPlayer.GetTitle() Crashes Safari/Dashboard
12498
* bindings/c/c_utility.cpp: (KJS::Bindings::convertUTF8ToUTF16):
12499
Use kCFStringEncodingISOLatin1 rather than kCFStringEncodingWindowsLatin1,
12500
because the latter encoding has holes, and conversion can still fail.
12502
2006-02-10 Geoffrey Garen <ggaren@apple.com>
12506
- Inlined RefPtr assignment operators. .7% performance win on
12507
super-accurate JS iBench.
12509
* kxmlcore/RefPtr.h:
12510
(KXMLCore::::operator):
12512
2006-02-10 Geoffrey Garen <ggaren@apple.com>
12514
No review needed, just a build fix. This time for sure.
12518
2006-02-10 Geoffrey Garen <ggaren@apple.com>
12522
- Fixed build. As it goes without saying, I will not mention that I
12525
* JavaScriptCore.xcodeproj/project.pbxproj:
12526
* kjs/JSImmediate.cpp:
12527
(KJS::JSImmediate::toObject):
12529
2006-02-09 Geoffrey Garen <ggaren@apple.com>
12533
- Fixed <rdar://problem/4343730> Should switch ConstantValues (null,
12534
undefined, true, false) from JS objects to immediate values similar to
12537
2.0% performance gain on my new super-accurate version of JS iBench.
12538
(I promise to land a version of it soon.)
12540
The gist of the change:
12541
(1) The SimpleNumber class (simple_number.h) is now the JSImmediate
12542
class (JSImmediate.h/.cpp), and it handles not only numbers but also
12543
null, undefined, true, and false.
12544
(2) JSImmediate provides convenience methods for the bit masking
12545
necessary to encode and decode immediate values.
12546
(3) ConstantValues, BooleanImp, NullImp, and UndefinedImp are gone.
12547
(4) JSCell no longer implements functions like getBoolean, because
12548
only a JSImmediate can be a boolean.
12549
(5) JSImmediate no longer uses ALWAYS_INLINE because there's no need,
12550
and ALWAYS_INLINE is a non-portable option of last resort.
12551
(6) Type is now JSType, and it resides in its own file, JSType.h.
12552
Since I was there, I did some header include sorting as part of this
12555
The rest pretty much explains itself.
12557
* JavaScriptCore.xcodeproj/project.pbxproj: Removed simple_number.h,
12558
added JSImmediate.h/.cpp.
12559
* bindings/c/c_instance.cpp:
12560
(KJS::Bindings::CInstance::defaultValue):
12561
* bindings/c/c_instance.h:
12562
* bindings/c/c_utility.cpp:
12563
(KJS::Bindings::convertValueToNPVariant):
12564
* bindings/jni/jni_instance.cpp:
12565
(JavaInstance::defaultValue):
12566
* bindings/jni/jni_instance.h:
12567
* bindings/jni/jni_jsobject.cpp:
12568
(JavaJSObject::convertValueToJObject):
12569
* bindings/objc/WebScriptObject.mm:
12570
(+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:]):
12571
Standardized calls to use getXXX instead of hand-rolling JSValue
12573
* bindings/objc/objc_instance.h:
12574
* bindings/objc/objc_instance.mm:
12575
(ObjcInstance::getValueOfUndefinedField):
12576
(ObjcInstance::defaultValue):
12577
* bindings/objc/objc_runtime.h:
12578
* bindings/objc/objc_runtime.mm:
12579
(ObjcFallbackObjectImp::type):
12580
(ObjcFallbackObjectImp::defaultValue):
12581
* bindings/runtime.h:
12582
(KJS::Bindings::Instance::getValueOfUndefinedField):
12583
* bindings/runtime_object.cpp:
12584
(RuntimeObjectImp::defaultValue):
12585
* bindings/runtime_object.h:
12586
* kjs/JSImmediate.h: Added.
12587
(KJS::JSImmediate::isImmediate):
12588
(KJS::JSImmediate::isNumber):
12589
(KJS::JSImmediate::isBoolean):
12590
(KJS::JSImmediate::isUndefinedOrNull):
12591
(KJS::JSImmediate::fromDouble):
12592
(KJS::JSImmediate::toDouble):
12593
(KJS::JSImmediate::toBoolean):
12594
(KJS::JSImmediate::trueImmediate):
12595
(KJS::JSImmediate::falseImmediate):
12596
(KJS::JSImmediate::NaNImmediate):
12597
(KJS::JSImmediate::undefinedImmediate):
12598
(KJS::JSImmediate::nullImmediate):
12599
(KJS::JSImmediate::tag):
12600
(KJS::JSImmediate::unTag):
12601
(KJS::JSImmediate::getTag):
12602
(KJS::JSImmediate::):
12603
(KJS::JSImmediate::isIEEE):
12604
(KJS::JSImmediate::is32bit):
12605
(KJS::JSImmediate::is64bit):
12606
(KJS::JSImmediate::NanAsBits):
12607
(KJS::JSImmediate::zeroAsBits):
12608
(KJS::JSImmediate::oneAsBits):
12610
(KJS::JSLock::lock): Removed hack-o-rama to initialize ConstantValues.
12611
* kjs/JSType.h: Added.
12612
* kjs/collector.cpp:
12613
(KJS::Collector::protect):
12614
(KJS::Collector::unprotect):
12615
(KJS::Collector::collect):
12616
* kjs/internal.cpp:
12617
(KJS::StringImp::toPrimitive):
12618
(KJS::NumberImp::toPrimitive):
12619
(KJS::NumberImp::toBoolean):
12620
(KJS::GetterSetterImp::toPrimitive):
12622
(KJS::StringImp::type):
12623
(KJS::NumberImp::type):
12625
(KJS::JSObject::type):
12626
(KJS::tryGetAndCallProperty): Replaced "Are you one of the six things
12627
I'm looking for?" test with "Are you not the one thing I'm not looking
12629
(KJS::JSObject::defaultValue):
12630
(KJS::JSObject::toPrimitive):
12632
(KJS::GetterSetterImp::type):
12633
(KJS::JSValue::isObject):
12634
* kjs/operations.cpp:
12636
(KJS::strictEqual):
12638
* kjs/reference.cpp:
12639
(KJS::Reference::deleteValue):
12640
* kjs/simple_number.h: Removed.
12641
* kjs/string_object.cpp:
12642
(StringInstance::getOwnPropertySlot): fixed indentation
12644
(KJS::JSValue::toObject):
12645
(KJS::jsNumberCell): New function to quarantine a PIC branch -- allows
12646
us to inline jsNumber without adding PIC branches to callers.
12648
(KJS::jsUndefined):
12653
(KJS::JSValue::downcast):
12654
(KJS::JSValue::isUndefinedOrNull):
12655
(KJS::JSValue::isBoolean):
12656
(KJS::JSValue::isNumber):
12657
(KJS::JSValue::isString):
12658
(KJS::JSValue::isObject):
12659
(KJS::JSValue::getBoolean):
12660
(KJS::JSValue::getNumber):
12661
(KJS::JSValue::getString):
12662
(KJS::JSValue::getObject):
12663
(KJS::JSValue::getUInt32):
12664
(KJS::JSValue::mark): Replaced !JSImmediate::is() test with assertion,
12665
resulting in a slight performance gain. Callers should always check
12666
!marked() before calling mark(), so it's impossible to call mark on
12668
(KJS::JSValue::marked):
12669
(KJS::JSValue::type):
12670
(KJS::JSValue::toPrimitive):
12671
(KJS::JSValue::toBoolean):
12672
(KJS::JSValue::toNumber):
12673
(KJS::JSValue::toString):
12675
2006-02-06 Eric Seidel <eseidel@apple.com>
12677
Add svn:ignore properties for visual studio internals.
12679
2006-02-06 Alexey Proskuryakov <ap@nypop.com>
12683
- Refactor DateInstance to provide direct access to data. Several WIN32 modifications.
12684
http://bugs.webkit.org/show_bug.cgi?id=7107
12686
- No tests added - only changed functionality on WIN32, which should be covered by
12689
* kjs/date_object.cpp:
12690
(gmtoffset): On WIN32, use the recommended global (_timezone rather than timezone).
12692
(KJS::timeZoneOffset): Removed, was basically the same as the above.
12693
(KJS::formatTime): Pass an UTC flag - UTC/local cannot be correctly selected on
12694
Windows based on struct tm itself.
12695
(KJS::DateInstance::getTime): Added.
12696
(KJS::DateInstance::getUTCTime): Added.
12697
(KJS::millisecondsToTM): Factored out from DateProtoFunc::callAsFunction().
12698
(KJS::DateObjectImp::callAsFunction): Use the new parameter to formatTime().
12699
(KJS::DateProtoFunc::callAsFunction): Updated for the other changes. The code for
12700
GetTimezoneOffset was incorrect on WIN32 - _daylight global has nothing to do
12701
with daylight savings time being in effect.
12703
* kjs/date_object.h: Added prototypes for new functions.
12705
2006-02-05 Maciej Stachowiak <mjs@apple.com>
12707
Reviewed by Anders.
12709
- fixed ~1100 KJS::Node leaked on layout tests
12710
http://bugs.webkit.org/show_bug.cgi?id=7097
12712
* kjs/internal.cpp:
12713
(KJS::Parser::noteNodeCycle):
12714
(KJS::Parser::removeNodeCycle):
12715
(KJS::clearNewNodes):
12718
(ElementNode::breakCycle):
12719
(PropertyListNode::breakCycle):
12720
(ArgumentListNode::breakCycle):
12721
(StatListNode::StatListNode):
12722
(StatListNode::breakCycle):
12723
(VarDeclListNode::breakCycle):
12724
(BlockNode::BlockNode):
12725
(ClauseListNode::breakCycle):
12726
(CaseBlockNode::CaseBlockNode):
12727
(ParameterNode::breakCycle):
12728
(SourceElementsNode::SourceElementsNode):
12729
(SourceElementsNode::breakCycle):
12731
(KJS::Node::breakCycle):
12732
(KJS::ElementNode::ElementNode):
12733
(KJS::ArrayNode::ArrayNode):
12734
(KJS::PropertyListNode::PropertyListNode):
12735
(KJS::ObjectLiteralNode::ObjectLiteralNode):
12736
(KJS::ArgumentListNode::ArgumentListNode):
12737
(KJS::ArgumentsNode::ArgumentsNode):
12738
(KJS::VarDeclListNode::VarDeclListNode):
12739
(KJS::VarStatementNode::VarStatementNode):
12740
(KJS::ForNode::ForNode):
12741
(KJS::CaseClauseNode::CaseClauseNode):
12742
(KJS::ClauseListNode::ClauseListNode):
12743
(KJS::ParameterNode::ParameterNode):
12744
(KJS::FuncExprNode::FuncExprNode):
12745
(KJS::FuncDeclNode::FuncDeclNode):
12747
2006-02-05 Maciej Stachowiak <mjs@apple.com>
12751
- fix default traits for classes to make sure default constructors get called
12753
* kxmlcore/VectorTraits.h:
12756
2006-02-04 Darin Adler <darin@apple.com>
12758
Reviewed by Maciej.
12760
- fix http://bugs.webkit.org/show_bug.cgi?id=5210
12761
REGRESSION: for/in loop with var changes global variable instead of making local
12763
Test: fast/js/for-in-var-scope.html
12766
(valueForReadModifyAssignment): Use ALWAYS_INLINE macro.
12767
(ForInNode::execute): Break out of the scope chain loop once we find and set the
12768
loop variable. We don't want to set multiple loop variables.
12769
(ForInNode::processVarDecls): Process the declaration of the loop variable.
12773
* kjs/object.cpp: (KJS::tryGetAndCallProperty): Use ALWAYS_INLINE macro.
12774
* kxmlcore/FastMalloc.cpp: Change to use ALWAYS_INLINE macro from AlwaysInline.h
12775
instead of defining it here a second time.
12777
2006-02-04 Maciej Stachowiak <mjs@apple.com>
12781
- change JavaScript collector statistics calls to use HashCountedSet instead
12782
of CFSet; other misc cleanup
12783
http://bugs.webkit.org/show_bug.cgi?id=7072
12785
* kjs/collector.cpp:
12786
(KJS::Collector::numProtectedObjects): renamed from numReferencedObjects
12788
(KJS::Collector::rootObjectTypeCounts): renamed from rootObjectClasses,
12791
(KJS::Collector::isOutOfMemory): Renamed from outOfMemory.
12794
2006-02-03 Timothy Hatcher <timothy@apple.com>
12796
Reviewed by Justin.
12798
Renamed configuration names to Debug, Release and Production.
12800
* JavaScriptCore.xcodeproj/project.pbxproj:
12802
2006-02-02 George Staikos <staikos@opensource.apple.com>
12804
Reviewed by Maciej.
12806
* kjs/lookup.h: Fix compile, merged from KDE.
12808
2006-02-02 Darin Adler <darin@apple.com>
12810
Reviewed by Maciej.
12812
- http://bugs.webkit.org/show_bug.cgi?id=7005
12813
add Noncopyable, OwnPtr, OwnArrayPtr to KXMLCore
12815
* kxmlcore/Noncopyable.h: Added.
12816
* kxmlcore/OwnArrayPtr.h: Added.
12817
* kxmlcore/OwnPtr.h: Added.
12819
* JavaScriptCore.xcodeproj/project.pbxproj: Added new files.
12822
* kjs/function.cpp: Use OwnPtr for Parameter pointers.
12824
* kjs/internal.h: Use Noncopyable for LabelStack.
12826
* kjs/list.cpp: Use OwnArrayPtr for overflow.
12828
* kjs/property_map.h:
12829
* kjs/property_map.cpp: Use OwnArrayPtr for SavedProperties.
12830
Use Vector for some stack buffers.
12832
* kjs/regexp_object.h:
12833
* kjs/regexp_object.cpp: Use OwnArrayPtr for lastOvector.
12835
2006-01-31 Maciej Stachowiak <mjs@apple.com>
12839
- fixed leak of hundreds of thousands of JS parser nodes on the layout tests, and added an exit counter
12840
that would catch them
12843
(NodeCounter::~NodeCounter): Added debug-only node counter.
12846
* kxmlcore/VectorTraits.h: Simple classes like RefPtr do in fact need destruction.
12848
2006-01-31 Darin Adler <darin@apple.com>
12850
Reviewed by Maciej.
12852
- added deleteAllValues for HashSet as well as HashMap
12853
- fixed conversion from const_iterator to iterator, which I broke a while back
12855
* kxmlcore/HashMap.h: Updated copyright date.
12856
* kxmlcore/HashSet.h: (KXMLCore::deleteAllValues): Added.
12857
* kxmlcore/HashTable.h: (KXMLCore::HashTableIterator::operator const_iterator): Added.
12859
2006-01-31 Tim Omernick <timo@apple.com>
12861
Reviewed by Geoff Garen.
12863
* bindings/c/c_utility.cpp:
12864
(KJS::Bindings::convertUTF8ToUTF16):
12865
Fixed an invalid assertion that UTF8Chars is not NULL. It is valid for it to be NULL as long as
12867
This fixes an assertion failure on TOT at <http://www.musicindiaonline.com/p/x/tJO0OOBME9.As1NMvHdW/>,
12868
where JavaScript is getting a NULL string back from some call on the Real Player plugin.
12870
2006-01-30 Anders Carlsson <andersca@mac.com>
12874
Fix http://bugs.webkit.org/show_bug.cgi?id=6907
12875
REGRESSION: United.com menus messed up due to document.all/MSIE sniff
12878
(typeStringForValue):
12879
Return "undefined" if the given object should masquerade as undefined.
12882
(KJS::JSObject::masqueradeAsUndefined):
12883
Rename from isEqualToNull.
12885
* kjs/operations.cpp:
12887
Update for name change.
12889
2006-01-29 Maciej Stachowiak <mjs@apple.com>
12893
- properly define Vector assignment operator; the private version was accidentally left
12894
in, and the template version is not enough to replace the default
12896
* kxmlcore/Vector.h:
12897
(KXMLCore::Vector::operator=):
12899
2006-01-29 Eric Seidel <eseidel@apple.com>
12903
Fix the build by applying a GCC-specific namespace hack.
12907
2006-01-29 Eric Seidel <eseidel@apple.com>
12911
Fix build on Win32.
12913
* kjs/lookup.h: fixed ::cacheGlobalObject
12914
* kxmlcore/Vector.h:
12915
(KXMLCore::Vector::operator[]): use unsigned long
12917
2006-01-29 Maciej Stachowiak <mjs@apple.com>
12919
Reviewed by Dave Hyatt.
12921
* kxmlcore/Vector.h:
12922
(KXMLCore::Vector::operator[]): Add unsigned overload
12924
2006-01-28 Darin Adler <darin@apple.com>
12926
Reviewed by John Sullivan.
12928
- http://bugs.webkit.org/show_bug.cgi?id=6895
12929
include exception names in JavaScript form of DOM exception
12931
* khtml/ecma/kjs_binding.cpp: (KJS::setDOMException): Include the name of the
12932
exception in the error message.
12934
2006-01-28 Maciej Stachowiak <mjs@apple.com>
12938
- miscellaneous Vector improvements
12940
* kxmlcore/Vector.h:
12941
(KXMLCore::Vector::at): Add range-checking asserts.
12942
(KXMLCore::Vector::first): Added as a convenience.
12943
(KXMLCore::Vector::last): Convenience for stack-style use.
12944
(KXMLCore::Vector::removeLast): ditto
12946
2006-01-28 Darin Adler <darin@apple.com>
12948
Reviewed by John Sullivan
12950
- fix http://bugs.webkit.org/show_bug.cgi?id=6870
12951
REGRESSION: JavaScript Date constructor won't accept another Date object
12953
Test: fast/js/date-constructor.html
12955
* kjs/date_object.cpp: (KJS::DateObjectImp::construct):
12956
Added a special case for constructing one date from another (to avoid losing
12957
milliseconds, which are not in the text form, to match Firefox), and changed
12958
the base code to convert to primitive before checking for string to match
12959
the standard. Also corrected a couple silly things in the "construct from
12960
current time" code path (removed a floor that does no good, and changed
12961
the constant used to convert microseconds to milliseconds to be a 1000
12962
rather than "msPerSecond").
12964
2006-01-28 Darin Adler <darin@apple.com>
12966
* kjs/create_hash_table: Added missing license.
12968
2006-01-28 Maciej Stachowiak <mjs@apple.com>
12970
Reviewed by Dave Hyatt.
12972
- added a Vector class
12973
http://bugs.webkit.org/show_bug.cgi?id=6894
12975
* JavaScriptCore.xcodeproj/project.pbxproj:
12976
* kjs/internal.cpp:
12977
(KJS::Parser::saveNewNode): Apply Vector.
12978
(KJS::clearNewNodes): ditto
12979
* kjs/number_object.cpp:
12980
(integer_part_noexp): ditto
12981
(char_sequence): ditto
12983
(KJS::UString::UTF8String): ditto
12984
* kxmlcore/HashMap.h:
12985
(KXMLCore::deleteAllValues): Tweaked this to only apply to HashMap,
12986
other versions are useful for other containers.
12987
* kxmlcore/Vector.h: Added. Implemented a Vector class, which should
12988
be usable for all Array/QVector style purposes, and also as a stack buffer
12989
with oversize handling. Also some helper classes to make vector operations
12990
as efficient as possible for POD types and for simple non-PODs like RefPtr.
12992
(KXMLCore::VectorTypeOperations::destruct):
12993
(KXMLCore::VectorTypeOperations::initialize):
12994
(KXMLCore::VectorTypeOperations::move):
12995
(KXMLCore::VectorTypeOperations::uninitializedCopy):
12996
(KXMLCore::VectorTypeOperations::uninitializedFill):
12997
(KXMLCore::VectorBuffer::VectorBuffer):
12998
(KXMLCore::VectorBuffer::~VectorBuffer):
12999
(KXMLCore::VectorBuffer::deallocateBuffer):
13000
(KXMLCore::VectorBuffer::inlineBuffer):
13001
(KXMLCore::Vector::Vector):
13002
(KXMLCore::Vector::~Vector):
13003
(KXMLCore::Vector::size):
13004
(KXMLCore::Vector::capacity):
13005
(KXMLCore::Vector::isEmpty):
13006
(KXMLCore::Vector::at):
13007
(KXMLCore::Vector::operator[]):
13008
(KXMLCore::Vector::data):
13009
(KXMLCore::Vector::operator T*):
13010
(KXMLCore::Vector::operator const T*):
13011
(KXMLCore::Vector::begin):
13012
(KXMLCore::Vector::end):
13013
(KXMLCore::Vector::clear):
13014
(KXMLCore::Vector::fill):
13015
(KXMLCore::Vector::operator=):
13016
(KXMLCore::::Vector):
13017
(KXMLCore::::operator):
13018
(KXMLCore::::fill):
13019
(KXMLCore::::expandCapacity):
13020
(KXMLCore::::resize):
13021
(KXMLCore::::reserveCapacity):
13022
(KXMLCore::::append):
13023
(KXMLCore::deleteAllValues):
13024
* kxmlcore/VectorTraits.h: Added.
13025
(KXMLCore::VectorTraits): Traits to enable making Vector efficient for
13028
2006-01-28 Alexey Proskuryakov <ap@nypop.com>
13032
- fix http://bugs.webkit.org/show_bug.cgi?id=5163
13033
RealPlayer.GetTitle() Crashes Safari/Dashboard
13035
* bindings/c/c_utility.cpp: (KJS::Bindings::convertUTF8ToUTF16):
13036
Fallback to kCFStringEncodingWindowsLatin1 if the passed buffer is not valid UTF-8, preventing crashes.
13038
2006-01-25 George Staikos <staikos@opensource.apple.com>
13042
* kxmlcore/HashFunctions.h: Merge build fix from KDE.
13044
2006-01-25 Darin Adler <darin@apple.com>
13046
- removed an unused source file
13048
* kjs/pointer_hash.h: Removed.
13049
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Removed reference to pointer_hash.h.
13051
2006-01-23 Anders Carlsson <andersca@mac.com>
13053
Reviewed by Maciej.
13055
- fix http://bugs.webkit.org/show_bug.cgi?id=6737
13056
KJS_DEFINE_PROTOTYPE should work outside of the KJS namespace
13059
Prefix all KJS types with KJS:: in KJS_DEFINE_PROTOTYPE.
13061
(cacheGlobalObject):
13062
Move this out of the KJS namespace.
13064
2006-01-23 Maciej Stachowiak <mjs@apple.com>
13068
- renamed PointerHash to PtrHash
13069
- made PtrHash the default hash function for int and pointer types that aren't further specialized
13070
- added an AtomicStringImpl class to make it easier and more typesafe to identity hash atomic strings
13071
- did appropriate consequent cleanup (very few places now need to declare a hash function)
13072
http://bugs.webkit.org/show_bug.cgi?id=6752
13074
* kjs/array_object.cpp:
13075
(ArrayProtoFunc::callAsFunction): no need to mention PointerHash
13076
* kjs/collector.cpp: ditto
13077
* kjs/identifier.cpp:
13078
(KXMLCore::): declare DefaultHash the new way
13079
* kjs/internal.cpp: no need to mention PointerHash
13081
* kxmlcore/HashCountedSet.h: change how we get the default hash to make it
13082
easier to specialize on PtrHash
13083
* kxmlcore/HashFunctions.h:
13084
(KXMLCore::): renamed PointerHash to PtrHash; changed DefaultHash so that it has
13085
a Hash typedef rather than being a hash function class itself; declared DefaultHash
13086
for int and partializy specialized for pointer types
13087
* kxmlcore/HashMapPtrSpec.h:
13088
(KXMLCore::PtrHashIteratorAdapter::PtrHashIteratorAdapter): Slight tweaks for new
13089
way of handling pointer hash
13090
(KXMLCore::PtrHashConstIteratorAdapter::PtrHashConstIteratorAdapter): ditto
13091
(KXMLCore::): ditto
13092
* kxmlcore/HashMap.h: ditto
13093
* kxmlcore/HashSet.h: ditto
13095
2006-01-23 Maciej Stachowiak <mjs@apple.com>
13097
Reviewed by Tim Omernick.
13099
- use classes instead of free functions for extractors, this better matches how other
13100
things work and should avoid the need for hacky workarounds on other compilers
13101
http://bugs.webkit.org/show_bug.cgi?id=6748
13103
* kjs/array_object.cpp:
13104
* kjs/identifier.cpp:
13105
* kjs/internal.cpp:
13106
* kxmlcore/HashMap.h:
13107
(KXMLCore::PairFirstExtractor::extract):
13108
* kxmlcore/HashMapPtrSpec.h:
13110
* kxmlcore/HashSet.h:
13111
(KXMLCore::IdentityExtractor::extract):
13112
* kxmlcore/HashTable.h:
13113
(KXMLCore::addIterator):
13114
(KXMLCore::removeIterator):
13115
(KXMLCore::HashTable::add):
13116
(KXMLCore::HashTable::isEmptyBucket):
13117
(KXMLCore::HashTable::isDeletedBucket):
13118
(KXMLCore::HashTable::HashTable):
13119
(KXMLCore::HashTable::lookup):
13120
(KXMLCore::HashTable::add):
13121
(KXMLCore::HashTable::reinsert):
13122
(KXMLCore::HashTable::find):
13123
(KXMLCore::HashTable::contains):
13124
(KXMLCore::HashTable::remove):
13125
(KXMLCore::HashTable::allocateTable):
13126
(KXMLCore::HashTable::deallocateTable):
13127
(KXMLCore::HashTable::expand):
13128
(KXMLCore::HashTable::rehash):
13129
(KXMLCore::HashTable::clear):
13130
(KXMLCore::HashTable::swap):
13131
(KXMLCore::HashTable::operator):
13132
(KXMLCore::HashTable::checkTableConsistency):
13133
(KXMLCore::HashTable::checkTableConsistencyExceptSize):
13134
(KXMLCore::HashTable::invalidateIterators):
13136
2006-01-23 Maciej Stachowiak <mjs@apple.com>
13138
Rubber stamped by Tim Hatcher.
13140
- renamed inert() operation on HashSet, HashCountedSet and HashTable to add()
13141
for consistency with HashMap
13143
* kjs/array_object.cpp:
13144
(ArrayProtoFunc::callAsFunction):
13145
* kjs/collector.cpp:
13146
(KJS::Collector::protect):
13147
* kjs/identifier.cpp:
13148
(KJS::Identifier::add):
13149
* kxmlcore/HashCountedSet.h:
13151
* kxmlcore/HashMap.h:
13152
(KXMLCore::::inlineAdd):
13153
* kxmlcore/HashSet.h:
13155
* kxmlcore/HashTable.h:
13156
(KXMLCore::HashTable::add):
13158
(KXMLCore::::HashTable):
13160
2006-01-23 Justin Garcia <justin.garcia@apple.com>
13162
Reviewed by thatcher
13164
Turned on -O2 for B&I build.
13166
* JavaScriptCore.xcodeproj/project.pbxproj:
13168
2006-01-23 Maciej Stachowiak <mjs@apple.com>
13170
Reviewed by Tim Hatcher.
13172
- it's "Franklin Street", not "Franklin Steet"
13174
* kjs/array_instance.h:
13175
* kjs/array_object.cpp:
13176
* kjs/array_object.h:
13177
* kjs/bool_object.cpp:
13178
* kjs/bool_object.h:
13179
* kjs/collector.cpp:
13181
* kjs/completion.h:
13183
* kjs/date_object.cpp:
13184
* kjs/date_object.h:
13185
* kjs/debugger.cpp:
13188
* kjs/error_object.cpp:
13189
* kjs/error_object.h:
13190
* kjs/function.cpp:
13192
* kjs/function_object.cpp:
13193
* kjs/function_object.h:
13195
* kjs/identifier.cpp:
13196
* kjs/identifier.h:
13197
* kjs/internal.cpp:
13199
* kjs/interpreter.cpp:
13200
* kjs/interpreter.h:
13207
* kjs/math_object.cpp:
13208
* kjs/math_object.h:
13211
* kjs/nodes2string.cpp:
13212
* kjs/number_object.cpp:
13213
* kjs/number_object.h:
13216
* kjs/object_object.cpp:
13217
* kjs/object_object.h:
13218
* kjs/operations.cpp:
13219
* kjs/operations.h:
13220
* kjs/property_map.cpp:
13221
* kjs/property_map.h:
13222
* kjs/property_slot.cpp:
13223
* kjs/property_slot.h:
13224
* kjs/reference.cpp:
13226
* kjs/reference_list.cpp:
13227
* kjs/reference_list.h:
13230
* kjs/regexp_object.cpp:
13231
* kjs/regexp_object.h:
13232
* kjs/scope_chain.cpp:
13233
* kjs/scope_chain.h:
13234
* kjs/simple_number.h:
13235
* kjs/string_object.cpp:
13236
* kjs/string_object.h:
13243
* kxmlcore/AlwaysInline.h:
13244
* kxmlcore/ListRefPtr.h:
13245
* kxmlcore/PassRefPtr.h:
13246
* kxmlcore/RefPtr.h:
13248
2006-01-23 Darin Adler <darin@apple.com>
13250
Reviewed by John Sullivan.
13252
- change needed for fix to http://bugs.webkit.org/show_bug.cgi?id=6617
13253
REGRESSION: Crash in cloneChildNodes when clicking element
13255
* kxmlcore/PassRefPtr.h: Fix assignment operator from RefPtr of a different
13256
type by calling get() instead of going directly at m_ptr.
13257
* kxmlcore/RefPtr.h: Ditto.
13261
* JavaScriptCore.xcodeproj/project.pbxproj: Xcode decided to change this file.
13262
It's just a resorted list of keys in a dictionary.
13264
* kjs/fpconst.cpp: Wrap this file in #if __APPLE__ since the alternate version
13265
in internal.cpp is in #if !__APPLE__. This file is to give us the "no init
13266
routine" property we want to have on OS X.
13268
2006-01-22 Maciej Stachowiak <mjs@apple.com>
13272
- Set up Page class and invert Frame / WebCoreFrameBridge ownership
13273
http://bugs.webkit.org/show_bug.cgi?id=6577
13275
* kjs/interpreter.h: make globalExec virtual so ScriptInterpreter can
13278
2006-01-23 George Staikos <staikos@opensource.apple.com>
13280
Reviewed by Maciej and Darin.
13282
* kxmlcore/Assertions.h: This file only works with __APPLE__ right now
13283
* kjs/interpreter.cpp: ditto
13284
* kjs/simple_number.h: Add assert.h and remove from config.h
13285
* kjs/array_object.cpp: Use relative paths for kxmlcore includes
13286
* kjs/testkjs.cpp: Use relative paths for kxmlcore includes
13288
2006-01-23 George Staikos <staikos@opensource.apple.com>
13290
Reviewed by Maciej.
13292
* kjs/config.h: unbreak preprocessor change
13294
2006-01-23 George Staikos <staikos@opensource.apple.com>
13296
Approved by Maciej and Darin.
13300
Update FSF address in license to make merging easier
13302
2006-01-22 George Staikos <staikos@opensource.apple.com>
13304
Reviewed by Maciej.
13306
* kjs/collector.cpp: merge major speedup from KDE on Linux
13307
patch by Maks Orlovich, bug #6145
13308
Also unify cpu detection
13309
* kjs/config.h: define simpler CPU macros
13311
2006-01-22 George Staikos <staikos@opensource.apple.com>
13313
Reviewed by Maciej.
13315
* kjs/collector.cpp: merge FreeBSD compile fix from KDE
13316
-> requires build magic for use
13318
2006-01-21 George Staikos <staikos@opensource.apple.com>
13320
Reviewed by Maciej.
13322
* kjs/nodes2string.cpp
13325
Fix pedantic compile with some gcc versions (Merge from KDE)
13327
* kjs/create_hash_table:
13328
Fix build with Perl 5.8.0 (Merge from KDE)
13330
2006-01-18 Darin Adler <darin@apple.com>
13334
- hash table fixes needed for my WebCore changes
13336
* kxmlcore/HashTable.h: (KXMLCore::HashTableConstIterator::operator=):
13337
Added a missing return statement.
13339
* kxmlcore/HashTraits.h: Fix traits so they work properly for classes where you
13340
can't instantiate with a 0 by using traits rather than ? : to select the default
13341
emtpy value of hash table keys.
13343
- small cleanup of "runtime" code left over from recent JavaScript crash fix
13345
* bindings/runtime_root.h:
13346
(KJS::Bindings::RootObject::RootObject): No explicit initialization of _imp needed
13347
since it's now a ProtectedPtr.
13348
(KJS::Bindings::RootObject::setRootObjectImp): Remove old code that relied on the
13349
fact that _imp was 0 and replaced with use of ProtectedPtr.
13350
(KJS::Bindings::RootObject::rootObjectImp): Updated since _imp is a ProtectedPtr.
13352
2006-01-17 Darin Adler <darin@apple.com>
13354
Reviewed by Anders.
13356
- http://bugs.webkit.org/show_bug.cgi?id=6611
13357
add assertions to check correct use of hash table iterators
13359
* kxmlcore/HashTable.h:
13360
(KXMLCore::addIterator): Added. Helper function that adds an iterator to the list
13361
maintained by the specified hash table.
13362
(KXMLCore::removeIterator): Added. Helper function that removes an iterator from
13363
the list maintained by the hash table it's in.
13364
(KXMLCore::HashTableConstIterator::HashTableConstIterator): Added a HashTable
13365
parameter, ignored when not debugging. Call addIterator.
13366
(KXMLCore::HashTableConstIterator::~HashTableConstIterator):
13367
(KXMLCore::HashTableConstIterator::operator=): Call removeIterator.
13368
(KXMLCore::HashTableConstIterator::operator*): Call checkValidity.
13369
(KXMLCore::HashTableConstIterator::operator->): Ditto.
13370
(KXMLCore::HashTableConstIterator::operator++): Ditto.
13371
(KXMLCore::HashTableConstIterator::operator==): Ditto.
13372
(KXMLCore::HashTableConstIterator::operator!=): Ditto.
13373
(KXMLCore::HashTableConstIterator::checkValidity): Checks that the hash table
13374
pointer is not 0 and if there are two iterators that both point at the same table.
13375
(KXMLCore::HashTableIterator::HashTableIterator): Changed to use the const iterator
13376
as an implementation detail, to avoid having two separate iterator implementations.
13377
(KXMLCore::HashTableIterator::operator*): Ditto.
13378
(KXMLCore::HashTableIterator::operator->): Ditto.
13379
(KXMLCore::HashTableIterator::operator++): Ditto.
13380
(KXMLCore::HashTableIterator::operator==): Ditto.
13381
(KXMLCore::HashTableIterator::operator!=): Ditto.
13382
(KXMLCore::HashTable::HashTable): Initialize pointer to head of iterators list.
13383
(KXMLCore::HashTable::~HashTable): Added call to invalidateIterators.
13384
(KXMLCore::HashTable::makeIterator): Pass this pointer.
13385
(KXMLCore::HashTable::makeConstIterator): Ditto.
13386
(KXMLCore::HashTable::insert): Call invalidateIterators, since this is a public
13387
entry point that modifies the hash table.
13388
(KXMLCore::HashTable::remove): Ditto.
13389
(KXMLCore::HashTable::clear): Ditto.
13390
(KXMLCore::HashTable::swap): Ditto.
13391
(KXMLCore::HashTable::invalidateIterators): Added. Walks the iterators list and
13392
clears out the table, next, and previous pointers in all of them, and then clears
13393
the head so we have an empty list.
13394
(KXMLCore::addIterator): Added. Adds the iterator the the linked list in the
13395
passed-in table, and points the iterator at the table.
13396
(KXMLCore::removeIterator): Added. Removes the iterator from the linked list in
13397
the passed-in table.
13399
* kxmlcore/HashTraits.h: A bit of tweaking and formatting.
13401
2006-01-17 Justin Garcia <justin.garcia@apple.com>
13405
Deployment builds now use -O2
13407
* JavaScriptCore.xcodeproj/project.pbxproj:
13409
2006-01-17 Darin Adler <darin@apple.com>
13411
Reviewed by Anders.
13413
- fix http://bugs.webkit.org/show_bug.cgi?id=6610
13414
change RefPtr so that it works when deref ends up deleting the RefPtr
13416
* kxmlcore/PassRefPtr.h: Always set m_ptr before calling deref.
13417
* kxmlcore/RefPtr.h: Ditto.
13419
2006-01-16 Geoffrey Garen <ggaren@apple.com>
13423
- Fixed http://bugs.webkit.org/show_bug.cgi?id=6322
13424
DateProtoFuncImp::callAsFunction can crash due to lack of type checking
13426
* kjs/date_object.cpp:
13427
(KJS::DateProtoFunc::callAsFunction): Type check calls to all methods.
13428
This matches section 15.9.5 in the spec.
13430
2006-01-16 Tim Omernick <timo@apple.com>
13432
Reviewed by John Sullivan.
13434
JavaScriptCore part of <rdar://problem/4211707> NPAPI ref count behavior differs with Mozilla
13436
* bindings/npruntime.cpp:
13437
(_NPN_ReleaseObject):
13438
Refactored part of this function out into _NPN_DeallocateObject.
13439
(_NPN_DeallocateObject):
13440
Forcibly deallocates the passed object, even if its refcount is
13443
* bindings/npruntime_impl.h:
13444
Declared _NPN_DeallocateObject().
13446
2006-01-16 Darin Adler <darin@apple.com>
13448
Reviewed by Maciej.
13450
- fix problem with ++, ==, and != on const iterators in
13451
HashMaps that are using the pointer specialization
13453
* kxmlcore/HashMapPtrSpec.h:
13454
(KXMLCore::PointerHashConstIteratorAdapter::operator++): Change type to const_iterator.
13455
(KXMLCore::PointerHashConstIteratorAdapter::operator==): Ditto.
13456
(KXMLCore::PointerHashConstIteratorAdapter::operator!=): Ditto.
13458
2006-01-15 Alexey Proskuryakov <ap@nypop.com>
13460
Reviewed by Anders.
13462
- fix http://bugs.webkit.org/show_bug.cgi?id=6561
13463
run-javascriptcore-tests doesn't work
13465
* JavaScriptCore/tests/mozilla/Getopt/Mixed.pm:
13466
Changed revision number to 1.8 (broken by svn migration).
13468
2006-01-14 David Kilzer <ddkilzer@kilzer.net>
13470
Reviewed and landed by Anders.
13472
* kjs/create_hash_table: Fixed comment typo.
13474
2006-01-13 Maks Orlovich <maksim@kde.org>
13476
Mostly merging work by Peter Kelly. Reviewed by Maciej, landed by ap.
13478
- fix http://bugs.webkit.org/show_bug.cgi?id=6261
13479
Misc. array object fixes from KJS
13481
* kjs/array_object.cpp: Don't treat 2^32-1 as a real array index property.
13482
(ArrayInstance::getOwnPropertySlot): Ditto.
13483
(ArrayInstance::deleteProperty): Ditto.
13484
(ArrayInstance::put): Ditto.
13485
(ArrayInstance::propList): Added a FIXME comment.
13486
(ArrayInstance::put): Throw exception on trying to set invalid array length.
13487
(ArrayProtoFunc::callAsFunction): Do not use a separator argument when doing toString/toLocalString.
13488
* kjs/array_object.h: Added MAX_ARRAY_INDEX.
13490
2006-01-13 Darin Adler <darin@apple.com>
13492
- Replaced tabs with spaces in source files that had less than 10 lines with tabs.
13493
- Set allow-tabs Subversion property in source files that have more than 10 lines with tabs.
13495
2006-01-13 Anders Carlsson <andersca@mac.com>
13499
* kjs/create_hash_table:
13500
Use correct size variables.
13502
2006-01-13 Anders Carlsson <andersca@mac.com>
13506
* kjs/create_hash_table:
13507
Don't create an empty entry array, instead add a entry with all fields
13508
set to null and set the hash table size to 1.
13512
Remove the hash table size check
13514
2006-01-12 Anders Carlsson <andersca@mac.com>
13516
Reviewed by Maciej.
13518
- fix http://bugs.webkit.org/show_bug.cgi?id=6494
13519
Crash when assigning a new function to a DOMParser object
13521
* JavaScriptCore.xcodeproj/project.pbxproj:
13522
Move lookup.cpp before lookup.h
13526
If the hash table is empty, return 0 early.
13528
2006-01-12 George Staikos <staikos@kde.org>
13532
* kjs/interpreter.cpp:
13534
* kjs/interpreter.h:
13535
Add helper to interpreter to call the collector in order to facilitate
13536
visibility rules in KDE.
13538
2006-01-12 George Staikos <staikos@kde.org>
13540
Reviewed by Maciej.
13542
* kjs/kjs.pro: Updates to build the whole thing on Linux at least.
13544
* kxmlcore/HashTable.h: Add missing assert.h
13546
2006-01-12 Darin Adler <darin@apple.com>
13550
- fix http://bugs.webkit.org/show_bug.cgi?id=6505
13551
retire APPLE_CHANGES from JavaScriptCore
13553
* JavaScriptCore.xcodeproj/project.pbxproj: Removed both
13554
APPLE_CHANGES and HAVE_CONFIG_H from all targets.
13556
* README: Removed. This had obsolete information in it
13557
and it wasn't clear what to replace it with.
13559
* kjs/collector.h: Removed an APPLE_CHANGES if around something
13560
that's not really platform-specific (although it does use a
13561
platform-specific API at the moment).
13562
* kjs/collector.cpp: Removed a mistaken comment.
13565
* kjs/internal.cpp:
13567
* kjs/operations.cpp:
13568
* kjs/operations.h:
13570
Use __APPLE__ instead of APPLE_CHANGES for code that should be
13571
used only on Mac OS X.
13573
* kjs/interpreter.cpp: Removed APPLE_CHANGES ifdef around the include
13574
of the runtime.h header. Even though that header isn't needed at the
13575
moment on platforms other than Mac OS X, the conditional stuff should
13576
be in the header itself, not in this one client.
13578
* kjs/math_object.cpp: (MathFuncImp::callAsFunction): Removed some
13579
code inside APPLE_CHANGES. I'm pretty sure this code isn't needed on
13580
any platform where pow is implemented corrrectly according to the IEEE
13581
standard. If it is needed on some, we can add it back with an appropriate
13582
#if for the platforms where it is needed.
13584
2006-01-12 Justin Haygood <justin@xiondigital.net>
13586
Reviewed, tweaked, and landed by Darin.
13588
- fix http://bugs.webkit.org/show_bug.cgi?id=6416
13589
lexer.cpp, grammar.y protect include of config.h with "HAVE_CONFIG_H"
13591
* kjs/dtoa.cpp: Removed HAVE_CONFIG_H, changed config.h to use
13592
quotes instead of angle brackets. Moved dtoa.h include to the top.
13593
Changed system header includes to use angle brackets instead of quotes.
13594
* kjs/grammar.y: Removed HAVE_CONFIG_H, changed config.h to use
13595
quotes instead of angle brackets.
13596
* kjs/lexer.cpp: Removed HAVE_CONFIG_H, changed config.h to use
13597
quotes instead of angle brackets. Moved lexer.h include to the top.
13598
* kjs/ustring.cpp: Removed HAVE_CONFIG_H, changed config.h to use
13599
quotes instead of angle brackets. Moved ustring.h include to the top.
13601
2006-01-12 George Staikos <staikos@kde.org>
13605
- Import initial QMake file. Doesn't fully work yet.
13607
2006-01-11 Ricci Adams <ricciadams@apple.com>
13609
Reviewed by Maciej and Darin, landed by Darin.
13611
- fix http://bugs.webkit.org/show_bug.cgi?id=5939
13612
final comma in javascript object prevents parsing
13614
* kjs/grammar.y: Added rule to allow trailing comma in
13615
object construction.
13617
2006-01-11 Ricci Adams <ricciadams@apple.com>
13619
Reviewed by Geoff, landed by Darin.
13621
- fix http://bugs.webkit.org/show_bug.cgi?id=5308
13622
Number.toFixed doesn't include leading 0
13624
* kjs/number_object.cpp: (NumberProtoFunc::callAsFunction):
13625
Fixed a "<" that should have been a "<=".
13627
2006-01-11 Ricci Adams <ricciadams@apple.com>
13629
Reviewed by Geoff, landed by Darin.
13631
- fix http://bugs.webkit.org/show_bug.cgi?id=5307
13632
Number.toFixed doesn't round 0.5 up
13634
* kjs/number_object.cpp: (NumberProtoFunc::callAsFunction):
13635
Fixed a ">" that should have been a ">=".
13637
2006-01-11 Justin Haygood <justin@xiondigital.net>
13639
Reviewed and landed by Darin.
13641
- fix http://bugs.webkit.org/show_bug.cgi?id=6486
13642
JavaScriptCore should use system malloc on Windows
13644
* kjs/config.h: Add USE_SYSTEM_MALLOC to the Win32 section.
13646
2006-01-10 Darin Adler <darin@apple.com>
13648
* Makefile: Took out unneeded "export" line.
13649
* <many-files>: Changed a lot of flags (cleared bogus executable bits, set
13650
MIME types, other small corrections).
13652
2006-01-09 Darin Adler <darin@apple.com>
13654
* Makefile.am: Removed.
13656
2006-01-07 Anders Carlsson <andersca@mac.com>
13658
Reviewed by Maciej.
13660
- fix http://bugs.webkit.org/show_bug.cgi?id=6373
13661
REGRESSION: JavaScript hang when comparing large array to null
13664
(KJS::JSObject::isEqualToNull):
13665
Add new function which returns true if an object should be treated as null when
13668
* kjs/operations.cpp:
13672
2006-01-07 Alexey Proskuryakov <ap@nypop.com>
13674
Reviewed by Maciej.
13676
- Fix WebCore development build
13677
http://bugs.webkit.org/show_bug.cgi?id=6408
13679
* kxmlcore/Assertions.h: Use __VA_ARGS__ in variadic macros.
13681
2006-01-06 Maciej Stachowiak <mjs@apple.com>
13685
- miscellaneous changes for 4% speedup on the JavaScript iBench
13686
http://bugs.webkit.org/show_bug.cgi?id=6396
13688
Changes mostly thanks to Maks Orlovich, tweaked a little by me.
13690
* kjs/create_hash_table: Use the same hash as the one used by Identifier.
13691
* kjs/function.cpp:
13692
(KJS::FunctionImp::processParameters): Use the new List::copyFrom
13693
(KJS::ActivationImp::ActivationImp): track variable while iterating
13694
* kjs/internal.cpp:
13695
(KJS::StringImp::toObject): create StringInstance directly
13697
(KJS::List::copy): implement in terms of copyFrom
13698
(KJS::List::copyFrom): more efficient way to copy in another list
13701
(keysMatch): updated to work with identifier hash
13703
(Lookup::findEntry): ditto
13704
(Lookup::find): ditto
13707
2006-01-06 Maciej Stachowiak <mjs@apple.com>
13709
- fix development build failure from the previous checkin
13711
* kjs/function.cpp:
13712
(KJS::ActivationImp::put): Use prototype() accessor in assert.
13714
2006-01-05 Maciej Stachowiak <mjs@apple.com>
13718
- fix remaining performance regression from Getter/Setter change
13719
http://bugs.webkit.org/show_bug.cgi?id=6249
13721
- Activation objects should not have __proto__ property
13722
http://bugs.webkit.org/show_bug.cgi?id=6395
13724
* kjs/function.cpp:
13725
(KJS::ActivationImp::getOwnPropertySlot): Implement directly, thus
13726
skipping getter/setter handling and __proto__ handling, as well
13727
as inlining needed superclass stuff.
13728
(KJS::ActivationImp::put): Implement directly, skipping getter/setter,
13729
__proto__, and do canPut directly in PropertyMap::put since there's no
13730
static property table either.
13732
* kjs/property_map.cpp:
13733
(KJS::PropertyMap::put): Allow optionally inlining canPut check.
13734
* kjs/property_map.h:
13736
2006-01-04 Geoffrey Garen <ggaren@apple.com>
13738
Patch by kimmo.t.kinnunen@nokia.com, reviewed by darin, tweaked by me.
13740
- Fixed http://bugs.webkit.org/show_bug.cgi?id=4921
13741
\u escape sequences in JavaScript identifiers
13743
* kjs/function_object.cpp:
13744
(FunctionObjectImp::construct):
13748
(Lexer::isWhiteSpace):
13749
(Lexer::isLineTerminator):
13750
(Lexer::isIdentStart):
13751
(Lexer::isIdentPart):
13753
(Lexer::scanRegExp):
13757
* tests/mozilla/expected.html: Updated test results.
13759
2005-12-30 Maciej Stachowiak <mjs@apple.com>
13761
No review, just test result update.
13763
* tests/mozilla/expected.html: Updated for newly passing test from recent fixes.
13765
2005-12-30 Anders Carlsson <andersca@mac.com>
13767
Reviewed by Maciej.
13769
- Fix http://bugs.webkit.org/show_bug.cgi?id=6298
13770
Getter setter test is failing
13773
(KJS::JSObject::put):
13774
Rework the getter setter part. We now walk the prototype chain, checking for
13775
getter/setter properties and only take the slow path if any are found.
13777
2005-12-30 Maks Orlovich <maksim@kde.org>
13779
Reviewed and committed by Maciej.
13781
- Handle negative, FP numbers with non-10 radix in toString
13782
http://bugs.webkit.org/show_bug.cgi?id=6259
13784
(Merged from KJS, original work by Harri Porten)
13786
* kjs/number_object.cpp:
13787
(NumberProtoFunc::callAsFunction): rewrote Number.toString(radix) to work with
13788
negative numbers, floating point and very large numbers.
13790
2005-12-29 Geoffrey Garen <ggaren@apple.com>
13792
Patch by Maks Orlovich, reviewed and landed by me.
13794
- http://bugs.webkit.org/show_bug.cgi?id=6267
13795
Fix Number.prototype.toFixed/toExponential(undefined)
13797
* kjs/number_object.cpp:
13798
(NumberProtoFunc::callAsFunction):
13800
2005-12-29 Geoffrey Garen <ggaren@apple.com>
13802
Patch by Maks Orlovich, Reviewed and landed by me.
13804
- http://bugs.webkit.org/show_bug.cgi?id=6266
13805
Minor object naming updates (to match Mozilla, KJS)
13807
* kjs/number_object.cpp:
13808
* kjs/regexp_object.cpp:
13810
2005-12-29 Geoffrey Garen <ggaren@apple.com>
13812
Patch by Maks Orlovich, reviewed by mjs.
13814
This has 2 very minor fixes, covered by KJS testsuite:
13815
1. Enumerates string indices in property list (with the same bug as array
13816
object has in corresponding code). This is a mozilla emulation thing.
13817
2. Permits properties with integer names in prototypes to be found
13819
* kjs/string_object.cpp:
13820
(StringInstance::getOwnPropertySlot):
13821
(StringInstanceImp::propList):
13822
* kjs/string_object.h:
13824
2005-12-26 Geoffrey Garen <ggaren@apple.com>
13828
- Fixed <rdar://problem/4364705> run-javascriptcore-tests crashes in
13829
KJS::BlockNode::deref
13831
http://bugs.webkit.org/show_bug.cgi?id=6233
13832
Reproducible stack-overflow crash in ~RefPtr<T> due to RefPtr<T> use in
13835
This patch does four things:
13836
(1) Standardizes all our linked list nodes to use "next" as their next
13838
(2) Creates the ListRefPtr<T> class, a subclass of RefPtr<T> specialized
13839
to iteratively deref "next" pointers.
13840
(3) Standardizes our linked list nodes to use ListRefPtr<T> and
13841
implement the releaseNext() function used by ~ListRefPtr<T>().
13842
(4) Adds to RefPtr<T> the release() method used by releaseNext().
13844
- Modified existing mozilla test to ensure it would make deployment
13845
builds crash as well.
13847
* JavaScriptCore.xcodeproj/project.pbxproj:
13849
(ElementNode::evaluate):
13850
(PropertyListNode::evaluate):
13851
(ArgumentListNode::evaluateList):
13852
(StatListNode::StatListNode):
13853
(StatListNode::execute):
13854
(StatListNode::processVarDecls):
13855
(VarDeclListNode::evaluate):
13856
(VarDeclListNode::processVarDecls):
13857
(VarStatementNode::execute):
13858
(VarStatementNode::processVarDecls):
13859
(BlockNode::BlockNode):
13860
(CaseClauseNode::evalStatements):
13861
(CaseClauseNode::processVarDecls):
13862
(ClauseListNode::processVarDecls):
13863
(CaseBlockNode::CaseBlockNode):
13864
(CaseBlockNode::evalBlock):
13865
(SourceElementsNode::SourceElementsNode):
13866
(SourceElementsNode::execute):
13867
(SourceElementsNode::processFuncDecl):
13868
(SourceElementsNode::processVarDecls):
13870
(KJS::ElementNode::ElementNode):
13871
(KJS::ElementNode::releaseNext):
13872
(KJS::ArrayNode::ArrayNode):
13873
(KJS::PropertyListNode::PropertyListNode):
13874
(KJS::PropertyListNode::releaseNext):
13875
(KJS::ObjectLiteralNode::ObjectLiteralNode):
13876
(KJS::ArgumentListNode::ArgumentListNode):
13877
(KJS::ArgumentListNode::releaseNext):
13878
(KJS::ArgumentsNode::ArgumentsNode):
13879
(KJS::StatListNode::releaseNext):
13880
(KJS::VarDeclListNode::VarDeclListNode):
13881
(KJS::VarDeclListNode::releaseNext):
13882
(KJS::VarStatementNode::VarStatementNode):
13883
(KJS::ForNode::ForNode):
13884
(KJS::CaseClauseNode::CaseClauseNode):
13885
(KJS::ClauseListNode::ClauseListNode):
13886
(KJS::ClauseListNode::getClause):
13887
(KJS::ClauseListNode::getNext):
13888
(KJS::ClauseListNode::releaseNext):
13889
(KJS::ParameterNode::ParameterNode):
13890
(KJS::ParameterNode::releaseNext):
13891
(KJS::SourceElementsNode::releaseNext):
13892
* kjs/nodes2string.cpp:
13893
(ElementNode::streamTo):
13894
(PropertyListNode::streamTo):
13895
(ArgumentListNode::streamTo):
13896
(StatListNode::streamTo):
13897
(VarDeclListNode::streamTo):
13898
(VarStatementNode::streamTo):
13899
(CaseClauseNode::streamTo):
13900
(ClauseListNode::streamTo):
13901
(CaseBlockNode::streamTo):
13902
(SourceElementsNode::streamTo):
13903
* kxmlcore/ListRefPtr.h: Added.
13904
(KXMLCore::ListRefPtr::ListRefPtr):
13905
(KXMLCore::ListRefPtr::~ListRefPtr):
13906
(KXMLCore::ListRefPtr::operator=):
13907
* kxmlcore/RefPtr.h:
13908
(KXMLCore::RefPtr::release):
13910
2005-12-29 Geoffrey Garen <ggaren@apple.com>
13914
- Fixed http://bugs.webkit.org/show_bug.cgi?id=4026
13915
Math.random() not seeded.
13917
Added call to sranddev() -- it executes the first time a process
13918
calls Math.random().
13920
* kjs/math_object.cpp:
13921
(MathFuncImp::callAsFunction):
13923
2005-12-29 Geoffrey Garen <ggaren@apple.com>
13927
- Fixed http://bugs.webkit.org/show_bug.cgi?id=6265
13928
Name change regression: Java doesn't know what JavaJSObject is
13930
Changed strings passed to Java back to original "JSObject".
13932
* bindings/jni/jni_jsobject.cpp:
13933
(JavaJSObject::convertValueToJObject):
13934
(JavaJSObject::convertJObjectToValue):
13936
2005-12-28 Anders Carlsson <andersca@mac.com>
13938
Reviewed by Maciej.
13940
- The JSC part of http://bugs.webkit.org/show_bug.cgi?id=6268
13941
Add undetectable document.all
13943
* kjs/operations.cpp:
13945
When comparing an object with null or undefined, call toPrimitive with
13946
NullType as the preferred type.
13948
2005-12-27 Anders Carlsson <andersca@mac.com>
13952
* kjs/array_object.cpp:
13953
(ArrayProtoFunc::callAsFunction):
13954
Implement filter and map. Also, make the existing
13955
array iteration functions not invoke the callback for
13956
non-existing properties, just as Mozilla does now.
13958
* kjs/array_object.h:
13959
(KJS::ArrayProtoFunc::):
13960
Add filter and map.
13962
* tests/mozilla/expected.html:
13963
Update, two 1.6 tests now pass.
13965
2005-12-27 Maciej Stachowiak <mjs@apple.com>
13967
- updated test results for new JS 1.6 tests
13969
* tests/mozilla/expected.html:
13971
2005-12-27 Anders Carlsson <andersca@mac.com>
13973
Reviewed by Maciej.
13975
Add Mozilla JS 1.6 tests.
13977
* tests/mozilla/js1_6/Array/browser.js: Added.
13978
* tests/mozilla/js1_6/Array/regress-290592.js: Added.
13979
* tests/mozilla/js1_6/Array/regress-304828.js: Added.
13980
* tests/mozilla/js1_6/Array/regress-305002.js: Added.
13981
* tests/mozilla/js1_6/Array/regress-310425-01.js: Added.
13982
* tests/mozilla/js1_6/Array/regress-310425-02.js: Added.
13983
* tests/mozilla/js1_6/Array/regress-320887.js: Added.
13984
* tests/mozilla/js1_6/Array/shell.js: Added.
13985
* tests/mozilla/js1_6/README: Added.
13986
* tests/mozilla/js1_6/Regress/browser.js: Added.
13987
* tests/mozilla/js1_6/Regress/regress-301574.js: Added.
13988
* tests/mozilla/js1_6/Regress/regress-309242.js: Added.
13989
* tests/mozilla/js1_6/Regress/regress-311157-01.js: Added.
13990
* tests/mozilla/js1_6/Regress/regress-311157-02.js: Added.
13991
* tests/mozilla/js1_6/Regress/regress-314887.js: Added.
13992
* tests/mozilla/js1_6/Regress/regress-320172.js: Added.
13993
* tests/mozilla/js1_6/Regress/shell.js: Added.
13994
* tests/mozilla/js1_6/String/browser.js: Added.
13995
* tests/mozilla/js1_6/String/regress-306591.js: Added.
13996
* tests/mozilla/js1_6/String/shell.js: Added.
13997
* tests/mozilla/js1_6/browser.js: Added.
13998
* tests/mozilla/js1_6/shell.js: Added.
13999
* tests/mozilla/js1_6/template.js: Added.
14001
2005-12-27 Maks Orlovich <maksim@kde.org>
14003
Reviewed and landed by Maciej.
14005
- fixed 6234: Can delete array index property incorrectly.
14006
http://bugs.webkit.org/show_bug.cgi?id=6234
14008
* kjs/array_object.cpp:
14009
(ArrayInstance::deleteProperty): use toArrayIndex instead of toUInt32 when
14010
looking for array properties.
14012
2005-12-27 Anders Carlsson <andersca@mac.com>
14014
Reviewed by Maciej.
14017
(KJS::JSObject::defineSetter):
14018
Remove duplicate call to putDirect.
14020
2005-12-26 Maciej Stachowiak <mjs@apple.com>
14022
Reviewed by Darin and Geoff.
14024
Changes by me and Anders.
14026
- mostly fixed REGRESSION: 5-10% performance regression on JS iBench from getter/setter change
14027
http://bugs.webkit.org/show_bug.cgi?id=6083
14029
- also fixed some warnings reported by -Winline
14031
* JavaScriptCorePrefix.h: Move new and delete definitions higher so there
14032
aren't conflicts with use in standard C++ headers
14034
(KJS::throwSetterError): Moved this piece of put into a seprate function
14035
to avoid the PIC branch.
14036
(KJS::JSObject::put): Use hasGetterSetterProperties to avoid expensive stuff
14037
when not needed. Also use GetterSetter properties attribute.
14038
(KJS::JSObject::deleteProperty): Recompute whether any properties are getter/setter
14039
properties any more, if this one was one.
14040
(KJS::JSObject::defineGetter): Let the PropertyMap know that it has getter/setter
14041
properties now (and use the new attribute).
14042
(KJS::JSObject::defineSetter): Ditto.
14043
(KJS::JSObject::fillGetterPropertySlot): Out-of-line helper for getOwnPropertySlot,
14044
to avoid global variable access in the hot code path.
14046
(KJS::): Added GetterSetter attribute.
14047
(KJS::JSCell::isObject): Moved lower to be after inline methods it uses.
14048
(KJS::JSValue::isObject): ditto
14049
(KJS::JSObject::getOwnPropertySlot): try to avoid impact of getters and setters
14050
as much as possible in the case where they are not being used
14051
* kjs/property_map.cpp:
14052
(KJS::PropertyMap::containsGettersOrSetters): New method to help with this
14053
* kjs/property_map.h:
14054
(KJS::PropertyMap::hasGetterSetterProperties): Ditto
14055
(KJS::PropertyMap::setHasGetterSetterProperties): Ditto
14056
(KJS::PropertyMap::PropertyMap): Added a crazy hack to store the
14057
global "has getter/setter properties" flag in the property map
14058
single entry, to avoid making objects any bigger.
14059
* kjs/value.h: Moved some things to object.h to make -Winline happier
14061
2005-12-24 Maciej Stachowiak <mjs@apple.com>
14063
Reviewed by Eric and Dave Hyatt.
14065
- make even const PassRefPtrs give transfer of ownership semantics
14066
http://bugs.webkit.org/show_bug.cgi?id=6238
14068
This is a somewhat cheesy change. Having to use PassRefPtr_Ref creates ambiguities
14069
in assignment and copy construction. And this makes life way easier and removes
14070
the need for pass(). It is not really correct, but we pretty much never need a real
14071
const PassRefPtr, and this takes care of things for PassRefPtr temporaries.
14073
* kjs/identifier.cpp:
14074
(KJS::Identifier::add): No more need for pass()
14075
* kjs/property_map.cpp:
14076
(KJS::PropertyMap::addSparseArrayPropertiesToReferenceList): No more need for pass()
14078
(KJS::UString::Rep::create): Use adoptRef
14079
(KJS::UString::UString): No more need for pass
14080
(KJS::UString::append): No more need for pass
14081
(KJS::UString::substr): No more need for pass
14082
* kxmlcore/PassRefPtr.h: made m_ptr mutable (ugh)
14083
(KXMLCore::PassRefPtr::PassRefPtr): Take a const PassRefPtr reference
14084
(KXMLCore::PassRefPtr::release): Made this a const method (ugh)
14085
(KXMLCore::PassRefPtr::operator=): clean up appropriately
14086
(KXMLCore::adoptRef): Added this to use instead of PassRefPtr<T>::adopt, I think
14087
it makes the behavior more clear and it is less verbose.
14088
(KXMLCore::static_pointer_cast): use adoptRef
14089
(KXMLCore::const_pointer_cast): use adoptRef
14090
* kxmlcore/RefPtr.h:
14091
(KXMLCore::RefPtr::RefPtr): take const PassRefPtr&
14092
(KXMLCore::PassRefPtr::operator=): take const PassRefPtr&
14094
2005-12-25 Eric Seidel <eseidel@apple.com>
14098
Unbreak HashTableConstIterator++ by returning const_iterator
14100
* kxmlcore/HashTable.h:
14101
(KXMLCore::HashTableConstIterator::operator++): use const_iterator
14103
2005-12-25 Eric Seidel <eseidel@apple.com>
14107
Un-break HashTable copy constructor.
14109
* kxmlcore/HashTable.h:
14110
(KXMLCore::::HashTable): use const_iterator instead
14112
2005-12-23 Maciej Stachowiak <mjs@apple.com>
14116
- fixed "HashMap does not work with const pointer keys or values"
14117
http://bugs.webkit.org/show_bug.cgi?id=6222
14119
* kxmlcore/HashMapPtrSpec.h:
14120
(KXMLCore::HashMap): In all methods, explicitly cast all pointers
14121
to void * before passing to internal implementation. Use C-style
14122
casts instead of new-style casts, because the real solution would
14123
require a combo of reinterpret_cast anc const_cast.
14126
2005-12-23 Maciej Stachowiak <mjs@apple.com>
14128
- this time for sure
14130
* kxmlcore/RefPtr.h:
14131
(KXMLCore::::swap):
14133
2005-12-22 Maciej Stachowiak <mjs@apple.com>
14135
- fix build problem from last commit.
14137
* kxmlcore/RefPtr.h:
14138
(KXMLCore::::swap):
14140
2005-12-21 Maciej Stachowiak <mjs@apple.com>
14144
- Make HashMap/HashSet support non-POD types
14145
http://bugs.webkit.org/show_bug.cgi?id=5332
14147
The changes for support are relatively simple, but I also made extensive changes to
14148
avoid copying, so that there isn't refcount thrash when you put RefPtrs into a HashMap.
14150
* kxmlcore/HashTable.h:
14151
(KXMLCore::swap): specialize swap for pairs, to swap elements individually,
14152
so that excess copies can be avoided.
14153
(KXMLCore::Mover::move): Template function to either copy or swap, used
14154
when transferring elements from old table to new.
14155
(KXMLCore::IdentityHashTranslator::hash): The old "converting lookup" templates
14156
that took two or three function parameters now take a class parameter, this is
14157
the class used to do a normal lookup.
14158
(KXMLCore::IdentityHashTranslator::equal): Ditto.
14159
(KXMLCore::IdentityHashTranslator::translate): Ditto. Translate now takes a reference
14160
to write into instead of returning a value to avoid redundant copies.
14161
(KXMLCore::HashTable::~HashTable): Use deallocateTable instead of freeing directly.
14162
(KXMLCore::HashTable::insert): Based on HashTranslator now instead of separate
14163
functions. Added a FIXME about a remaining rare excess copy.
14164
(KXMLCore::HashTable::isEmptyBucket): Use KeyTraits directly instead of unwrapping
14165
the key from Traits, to avoid creating and destroying pair, which copies.
14166
(KXMLCore::HashTable::isDeletedBucket): ditto
14167
(KXMLCore::HashTable::lookup): Use HashTranslator now instead of separate functions.
14168
(KXMLCore::HashTable::initializeBucket): Renamed from emptyBucket. Use placement new to
14169
work right for non-POD types.
14170
(KXMLCore::HashTable::deleteBucket): Use assignDeleted to avoid excess copies.
14171
(KXMLCore::HashTable::reinsert): use Mover template to copy or swap as appropriate
14172
(KXMLCore::HashTable::allocateTable): Initialize every bucket if calloc won't do.
14173
(KXMLCore::HashTable::deallocateTable): Destruct every bucket if needed.
14174
(KXMLCore::HashTable::rehash): Avoid copy before reinserting, so that swap can do its magic.
14175
(KXMLCore::HashTable::clear): use deallocateTable instead of freeing directly.
14176
(KXMLCore::HashTable::HashTable): be more dumb when copying to ensure that non-POD types
14178
* kxmlcore/HashFunctions.h:
14179
(KXMLCore::PointerHash): Specialize PointerHash for RefPtr
14180
* kxmlcore/HashMap.h:
14181
(KXMLCore::extractFirst): Return a reference not a full object to avoid
14183
(KXMLCore::HashMapTranslator::hash): Use a special translator for insertion
14184
to defer making the pair as long as possible, thus avoiding needless copies.
14185
(KXMLCore::HashMapTranslator::equal): ditto
14186
(KXMLCore::HashMapTranslator::translate): ditto
14187
(KXMLCore::::inlineAdd): Shared by set and add to insert using HashMapTranslator
14188
(KXMLCore::::set): Use inlineAdd
14189
(KXMLCore::::add): Use inlineAdd
14190
* kxmlcore/HashMapPtrSpec.h:
14191
(KXMLCore::): Pass KeyTraits along
14192
* kxmlcore/HashSet.h:
14193
(KXMLCore::identityExtract): Return a reference not a full object to avoid copies.
14194
(KXMLCore::HashSetTranslatorAdapter::hash): Redo adapter stuff to work with
14195
the new HashTranslator approach.
14196
(KXMLCore::HashSetTranslatorAdapter::equal): ditto
14197
(KXMLCore::HashSetTranslatorAdapter::translate): ditto
14198
(KXMLCore::::insert): ditto
14199
* kxmlcore/HashTraits.h:
14200
(KXMLCore::GenericHashTraits): This is intended be used as a base class for
14201
customized traits: sensible defaults.
14202
(KXMLCore::): Use it a bunch
14203
(KXMLCore::assignDeleted): template function to allow pairs to be assigned the
14204
deleted value w/o excess copies.
14205
(KXMLCore::PairHashTraits::emptyValue): Updated
14206
(KXMLCore::PairHashTraits::deletedValue): Updated
14207
(KXMLCore::PairHashTraits::assignDeletedValue): part of assignDeleted hack
14208
(KXMLCore::DeletedValueAssigner::assignDeletedValue): Use template magic
14209
to either use use deletedValue or assignDeletedValue for the cases where we care.
14210
* kxmlcore/RefPtr.h:
14211
(KXMLCore::RefPtr::swap): Added swap method.
14212
(KXMLCore::swap): Added swap free function.
14213
* kjs/identifier.cpp:
14214
(KJS::CStringTranslator::hash): Use new HashTranslator class approach to
14215
alternate type based insertion.
14216
(KJS::CStringTranslator::equal): ditto
14217
(KJS::CStringTranslator::translate): ditto
14218
(KJS::Identifier::add): ditto
14219
(KJS::UCharBufferTranslator::hash): ditto
14220
(KJS::UCharBufferTranslator::equal): ditto
14221
(KJS::UCharBufferTranslator::translate): ditto
14223
- irrelevant change:
14225
* kjs/array_object.cpp:
14226
(ArrayProtoFunc::callAsFunction): Removed a stray space.
14228
2005-12-22 Anders Carlsson <andersca@mac.com>
14230
Reviewed by Eric and Darin.
14232
- fix http://bugs.webkit.org/show_bug.cgi?id=6196
14233
Would like to be able to define prototypes in headers
14236
Move ClassName from KJS_DECLARE_PROTOTYPE to KJS_IMPLEMENT_PROTOTYPE.
14237
Also, namespace all macros by prefixing them with KJS_.
14239
2005-12-22 Darin Adler <darin@apple.com>
14241
Reviewed by Maciej.
14243
- fix http://bugs.webkit.org/show_bug.cgi?id=6191
14244
RefPtr/PassRefPtr have a leak issue, operator== issues
14246
* kxmlcore/PassRefPtr.h:
14247
(KXMLCore::PassRefPtr::PassRefPtr): Remove non-template constructor that takes RefPtr
14248
since the constructor template that takes RefPtr should be sufficient. Add a constructor
14249
template that takes PassRefPtr&.
14250
(KXMLCore::PassRefPtr::adopt): Use PassRefPtr_Ref to avoid setting pointer first to
14251
0 and then to the pointer.
14252
(KXMLCore::PassRefPtr::operator=): Added template versions that take PassRefPtr& and
14254
(KXMLCore::PassRefPtr::operator PassRefPtr<U>): Changed to fix leak -- old version
14255
would release and then ref.
14256
(KXMLCore::operator==): Make templates have two parameters so you can mix types.
14257
Also remove unneeded const in raw pointer versions.
14258
(KXMLCore::operator!=): Ditto.
14260
* kxmlcore/RefPtr.h:
14261
(KXMLCore::RefPtr::RefPtr): Add constructor template that takes PassRefPtr.
14262
(KXMLCore::RefPtr::operator=): Add assignment operator templates that take
14263
RefPtr and PassRefPtr.
14264
(KXMLCore::operator==): Make templates have two parameters so you can mix types.
14265
Also remove unneeded const in raw pointer versions.
14266
(KXMLCore::operator!=): Ditto.
14268
2005-12-21 Timothy Hatcher <timothy@apple.com>
14270
* JavaScriptCore.xcodeproj/project.pbxproj:
14271
Set tab width to 8, indent width to 4 and uses tabs to false per file.
14273
2005-12-21 Geoffrey Garen <ggaren@apple.com>
14277
Removed evil hack for determining if a type is an integer, replaced
14278
with template metaprogramming.
14280
* JavaScriptCore.xcodeproj/project.pbxproj: Set tab size to 2 for
14283
(main): Inserted asserts to test IsInteger. FIXME: Move these to
14284
KXMLCore unit tests directory when we create one.
14285
* kxmlcore/HashTraits.h:
14286
(KXMLCore::): Added IsInteger class for querying types.
14288
2005-12-20 Maciej Stachowiak <mjs@apple.com>
14292
- made ALWAYS_INLINE declare things inline as well as __attribute__((always_inline))
14293
http://bugs.webkit.org/show_bug.cgi?id=6159
14295
* kxmlcore/AlwaysInline.h:
14297
2005-12-19 Maciej Stachowiak <mjs@apple.com>
14301
- fixed a leak in the assignment operator from PassRefPtr to RefPtr
14302
http://bugs.webkit.org/show_bug.cgi?id=6158
14304
* kxmlcore/RefPtr.h:
14305
(KXMLCore::RefPtr::operator=):
14307
- fix problem with PassRefPtr that darin spotted - it lacked a copy constructor
14308
and therefore was using the default one, which can lead to excess derefs
14310
I fixed this by adding a copy constructor from non-const
14311
reference, and by adding a template pass() function that you have
14312
to use when raw pointer or RefPtr are passed where PassRefPtr is
14315
* kjs/identifier.cpp:
14316
(KJS::Identifier::add): Changed to have PassRefPtr return type and
14317
pass() the results.
14318
* kjs/identifier.h:
14319
* kjs/property_map.cpp:
14320
(KJS::PropertyMap::addSparseArrayPropertiesToReferenceList): Use pass()
14323
(KJS::UString::UString): Use pass() as needed.
14324
(KJS::UString::append): ditto
14325
(KJS::UString::substr): ditto
14327
(KJS::UString::UString): Use initializer instead of assignment
14328
* kxmlcore/PassRefPtr.h:
14329
(KXMLCore::PassRefPtr::PassRefPtr): Added copy constructor
14330
(KXMLCore::pass): new template function to make it convenient to pass
14333
2005-12-19 Geoffrey Garen <ggaren@apple.com>
14335
Reviewed by Maciej.
14337
Fixed <rdar://problem/4370397> Missing return statement in
14338
JSMethodNameToObjcMethodName.
14340
JSMethodNameToObjcMethodName had a check for a name being too long, but
14341
the check was missing a return statement.
14343
A lot of this code was confusing and some of it was wrong, so I fixed
14344
it up, added some asserts to catch this type of bug in the future,
14345
changed some comments, and renamed some variables.
14347
The two advantages of the new algorithm are (1) It makes writing past
14348
the end of the buffer virtually impossible because the test on the main
14349
loop is "while (not past end of buffer)" and (2) It's twice as fast
14350
because it doesn't call strlen. (There's no need to call strlen when
14351
we're walking the string ourselves.)
14353
methodsNamed also supports arbitrary-length method names now. Just in
14354
case the AppKit folks start getting REALLY verbose...
14356
* bindings/objc/objc_class.mm:
14357
(KJS::Bindings::ObjcClass::methodsNamed):
14358
* bindings/objc/objc_utility.h:
14359
* bindings/objc/objc_utility.mm:
14360
(KJS::Bindings::JSMethodNameToObjcMethodName):
14362
2005-12-19 Darin Adler <darin@apple.com>
14364
Originally done by both George Staikos and Alexey Proskuryakov.
14366
- fix http://bugs.webkit.org/show_bug.cgi?id=5706
14367
Sharedptr dependency can be removed
14369
Our coding guidelines say "use 0 instead of NULL" and both RefPtr and
14370
PassRefPtr were using NULL, which required including a header that
14373
* kxmlcore/PassRefPtr.h:
14374
(KXMLCore::PassRefPtr::PassRefPtr): Use 0 instead of NULL.
14375
(KXMLCore::PassRefPtr::operator!): Use ! instead of == NULL.
14376
* kxmlcore/RefPtr.h:
14377
(KXMLCore::RefPtr::RefPtr): Use 0 instead of NULL.
14378
(KXMLCore::RefPtr::operator!): Use ! instead of == NULL.
14379
Also did some reformatting.
14381
2005-12-19 Darin Adler <darin@apple.com>
14383
Reviewed by Geoff Garen and Eric Seidel.
14385
- fix http://bugs.webkit.org/show_bug.cgi?id=4923
14386
stop using <ostream> in WebCore, eliminating the <cmath> troubles it causes
14388
* kjs/simple_number.h: Removed many unnecessary includes, including
14389
the <cmath> one to work around GCC library header bugs. We may have to
14390
add some includes elsewhere for platforms other than OS X, since our
14391
prefix header takes care of some things.
14393
* kxmlcore/AlwaysInline.h: Added. Now clients that don't include
14394
simple_number.h can still get the ALWAYS_INLINE macro.
14395
* JavaScriptCore.xcodeproj/project.pbxproj: Added AlwaysInline.h.
14397
* bindings/NP_jsobject.h: Removed a lot of unnecessary includes
14398
and removed C-specific stuff from this C++-only header.
14399
* bindings/jni/jni_jsobject.h: Removed a lot of unnecessary includes
14400
and did some reformatting.
14401
* bindings/objc/objc_runtime.h: Removed an unnecessary include.
14402
* bindings/runtime.h: Removed some unneeded includes. Reformatted.
14403
* bindings/runtime.cpp: Updated to compile with header changes,
14404
including a lot of reformatting.
14405
* bindings/runtime_object.h: Removed an unnecessary include.
14407
2005-12-13 Maciej Stachowiak <mjs@apple.com>
14409
Reviewed by Geoff and Adele
14411
- replaced custom Identifier hashtable with HashSet
14413
* kjs/identifier.cpp:
14415
(KJS::identifierTable):
14416
(KJS::Identifier::equal):
14420
(KJS::Identifier::add):
14421
(KJS::Identifier::remove):
14422
* kjs/identifier.h:
14423
* kjs/internal.cpp:
14424
(KJS::InterpreterImp::initGlobalObject):
14426
2005-12-18 Justin Haygood <justin@xiondigital.net>
14428
Reviewed, tweaked, and landed by Darin.
14430
- fix http://bugs.webkit.org/show_bug.cgi?id=5227
14431
Array indexOf() extension for JavaScript 1.5 Core
14433
* kjs/array_object.h:
14434
* kjs/array_object.cpp: (ArrayProtoFunc::callAsFunction): Added implementation of indexOf.
14436
2005-12-18 Anders Carlsson <andersca@mac.com>
14438
Reviewed by Darin and Geoffrey.
14440
- fix for <http://bugs.webkit.org/show_bug.cgi?id=4000>
14441
Object.prototype is missing isPrototypeOf
14443
* kjs/object_object.cpp:
14444
(ObjectPrototype::ObjectPrototype):
14445
Add isPrototypeOf to object prototype.
14447
(ObjectProtoFunc::callAsFunction):
14448
Implement isPrototypeOf
14450
* kjs/object_object.h:
14451
(KJS::ObjectProtoFunc::):
14452
Add id for isPrototypeOf.
14454
2005-12-17 Geoffrey Garen <ggaren@apple.com>
14458
Fixed http://bugs.webkit.org/show_bug.cgi?id=6119
14459
split() function ignores case insensitive modifier.
14462
RegExpImp: The C++ object you get when JavaScript executes
14464
RegExp: A C++ wrapper object that performs regular expression
14465
matching on behalf of a RegExpImp.
14467
Instead of unnecessarily constructing a RegExp which (wrongly) lacks
14468
any modifiers, String.split() now uses the RegExp built in to the
14469
RegExpImp passed to it, which has the right modifiers already.
14471
I also cleaned up other bits of the string code to standardized how
14472
we handle RegExpImp arguments.
14475
* kjs/string_object.cpp:
14477
(StringProtoFunc::callAsFunction):
14479
2005-12-16 David Hyatt <hyatt@apple.com>
14481
Remove unused RefPtr constructors that can create an ambiguity in ustring on some platforms.
14485
* kxmlcore/RefPtr.h:
14486
(KXMLCore::RefPtr::RefPtr):
14488
2005-12-15 Darin Adler <darin@apple.com>
14490
Reviewed by Maciej.
14492
- fix http://bugs.webkit.org/show_bug.cgi?id=5688
14493
speed up JavaScript parsing by not creating a UString just to parse
14496
* kjs/internal.cpp: (KJS::InterpreterImp::evaluate): Change to take a character pointer
14497
and length rather than a UString.
14499
* kjs/interpreter.h:
14500
* kjs/interpreter.cpp: (Interpreter::evaluate): Ditto.
14502
* kjs/protect.h: Remove uneeded "convert to bool" operator since we already have a
14503
"convert to raw pointer" operator in this class.
14505
=== Safari-521~5 ===
14507
2005-12-13 Geoffrey Garen <ggaren@apple.com>
14509
Updated test results to match Anders's last fix.
14511
* tests/mozilla/expected.html:
14513
2005-12-13 Anders Carlsson <andersca@mac.com>
14515
* ChangeLog: Add titles for my bugzilla bugs.
14517
2005-12-13 Anders Carlsson <andersca@mac.com>
14521
- Fixes <http://bugs.webkit.org/show_bug.cgi?id=6041>
14522
Support property getters and setters.
14524
* bindings/runtime_array.cpp:
14525
(RuntimeArray::lengthGetter):
14526
(RuntimeArray::indexGetter):
14527
* bindings/runtime_array.h:
14528
* bindings/runtime_method.cpp:
14529
(RuntimeMethod::lengthGetter):
14530
* bindings/runtime_method.h:
14531
* bindings/runtime_object.cpp:
14532
(RuntimeObjectImp::fallbackObjectGetter):
14533
(RuntimeObjectImp::fieldGetter):
14534
(RuntimeObjectImp::methodGetter):
14535
* bindings/runtime_object.h:
14536
* kjs/array_instance.h:
14537
* kjs/array_object.cpp:
14538
(ArrayInstance::lengthGetter):
14540
Update for changes to PropertySlot::getValue and
14541
PropertySlot::GetValueFunc.
14543
* kjs/collector.cpp:
14545
Handle GetterSetterType.
14547
* kjs/function.cpp:
14548
(KJS::FunctionImp::argumentsGetter):
14549
(KJS::FunctionImp::lengthGetter):
14550
(KJS::Arguments::mappedIndexGetter):
14551
(KJS::ActivationImp::argumentsGetter):
14553
Update for changes to PropertySlot::getValue and
14554
PropertySlot::GetValueFunc.
14557
Rework grammar parts for get set declarations directly
14558
in the object literal.
14560
* kjs/internal.cpp:
14561
(KJS::GetterSetterImp::mark):
14562
(KJS::GetterSetterImp::toPrimitive):
14563
(KJS::GetterSetterImp::toBoolean):
14564
(KJS::GetterSetterImp::toNumber):
14565
(KJS::GetterSetterImp::toString):
14566
(KJS::GetterSetterImp::toObject):
14567
Add type conversion functions. These aren't meant to be called.
14570
Handle GetterSetterType.
14573
(KJS::staticFunctionGetter):
14574
(KJS::staticValueGetter):
14575
Update for changes to PropertySlot::GetValueFunc.
14578
Refactor they way properties nodes are implemented.
14579
We now have a PropertyListNode which is a list of PropertyNodes.
14580
Each PropertyNode has a name (which is a PropertyNameNode) and an associated
14581
value node. PropertyNodes can be of different types. The Constant type is the
14582
old constant declaration and the Getter and Setter types are for property getters
14584
(ResolveNode::evaluate):
14585
Update for changes to PropertySlot::getValue.
14587
(PropertyListNode::evaluate):
14588
Go through all property nodes and set them on the newly created object. If the
14589
property nodes are of type Getter or Setter, define getters and setters. Otherwise,
14590
just add the properties like before.
14592
(PropertyNode::evaluate):
14593
This should never be called directly.
14595
(PropertyNameNode::evaluate):
14596
Rename from PropertyNode::evaluate.
14598
(FunctionCallResolveNode::evaluate):
14599
(FunctionCallBracketNode::evaluate):
14600
(FunctionCallDotNode::evaluate):
14601
(PostfixResolveNode::evaluate):
14602
(PostfixBracketNode::evaluate):
14603
(PostfixDotNode::evaluate):
14604
(TypeOfResolveNode::evaluate):
14605
(PrefixResolveNode::evaluate):
14606
(PrefixBracketNode::evaluate):
14607
(PrefixDotNode::evaluate):
14608
(AssignResolveNode::evaluate):
14609
(AssignDotNode::evaluate):
14610
(AssignBracketNode::evaluate):
14611
Update for changes to PropertySlot::getValue.
14614
(KJS::PropertyNameNode::PropertyNameNode):
14615
Rename from PropertyNode.
14617
(KJS::PropertyNode::):
14618
(KJS::PropertyNode::PropertyNode):
14619
New class, representing a single property.
14621
(KJS::PropertyListNode::PropertyListNode):
14622
Rename from PropertyValueNode.
14624
(KJS::FuncExprNode::FuncExprNode):
14625
Put ParameterNode parameter last, and make it optional.
14627
(KJS::ObjectLiteralNode::ObjectLiteralNode):
14628
Use a PropertyListNode here now.
14630
* kjs/nodes2string.cpp:
14631
(PropertyListNode::streamTo):
14632
Iterate through all property nodes.
14634
(PropertyNode::streamTo):
14635
Print out the name and value. Doesn't handle getters and setters currently.
14637
(PropertyNameNode::streamTo):
14638
Rename from PropertyNode::streamTo.
14641
(KJS::JSObject::get):
14642
Update for changes to PropertySlot::getValue.
14644
(KJS::JSObject::put):
14645
If the property already exists and has a Setter, invoke
14646
the setter function instead of setting the property directly.
14648
(KJS::JSObject::defineGetter):
14649
(KJS::JSObject::defineSetter):
14650
New functions for defining property getters and setters on the object.
14653
(KJS::GetterSetterImp::type):
14654
(KJS::GetterSetterImp::GetterSetterImp):
14655
(KJS::GetterSetterImp::getGetter):
14656
(KJS::GetterSetterImp::setGetter):
14657
(KJS::GetterSetterImp::getSetter):
14658
(KJS::GetterSetterImp::setSetter):
14659
New class for properties which have getters and setters defined.
14660
This class is only used internally and should never be seen from the outside.
14662
(KJS::JSObject::getOwnPropertySlot):
14663
If the property is a getter, call setGetterSlot on the property slot.
14665
* kjs/object_object.cpp:
14666
(ObjectPrototype::ObjectPrototype):
14667
Add __defineGetter__, __defineSetter, __lookupGetter__, __lookupSetter__
14670
(ObjectProtoFunc::callAsFunction):
14671
Implement handlers for new functions.
14673
* kjs/object_object.h:
14674
(KJS::ObjectProtoFunc::):
14675
Add ids for new functions.
14677
* kjs/property_slot.cpp:
14678
(KJS::PropertySlot::undefinedGetter):
14679
Update for changes to PropertySlot::GetValueFunc.
14681
(KJS::PropertySlot::functionGetter):
14682
Call the function getter object and return its value.
14684
* kjs/property_slot.h:
14685
(KJS::PropertySlot::getValue):
14686
Add a new argument which is the original object that
14687
getPropertySlot was called on.
14689
(KJS::PropertySlot::setGetterSlot):
14690
(KJS::PropertySlot::):
14691
New function which sets a getter slot. When getValue is called on a
14692
getter slot, the getter function object is invoked.
14694
* kjs/string_object.cpp:
14695
(StringInstance::lengthGetter):
14696
(StringInstance::indexGetter):
14697
* kjs/string_object.h:
14698
Update for changes to PropertySlot::GetValueFunc.
14702
Add GetterSetterType and make GetterSetterImp a friend class of JSCell.
14704
2005-12-12 Maciej Stachowiak <mjs@apple.com>
14708
- added a new HashCountedSet class for the common pattern of mapping items to counts that can change
14710
* kxmlcore/HashCountedSet.h: Added.
14711
(KXMLCore::HashCountedSet::*): Implemented, on top of HashMap.
14712
* kxmlcore/HashMap.h:
14713
(KXMLCore::HashMap::add): New method - does not replace existing value if key already present
14714
but otherwise like set().
14715
(KXMLCore::HashMap::set): Improved comments.
14716
* kxmlcore/HashMapPtrSpec.h:
14717
(KXMLCore::HashMap::add): Added to specializations too.
14718
* JavaScriptCore.xcodeproj/project.pbxproj: Add new file.
14719
* kxmlcore/HashFunctions.h: Added include of stdint.h
14721
- replaced the custom hashtable for values protected from GC with HashCountedSet
14723
* kjs/collector.cpp:
14724
(KJS::Collector::protect): Moved code here from ProtectedValues::increaseProtectCount
14725
since the code is so simple now.
14726
(KJS::Collector::unprotect): Ditto for ProtectedValues::decreaseProtectCount.
14727
(KJS::Collector::markProtectedObjects): Updated for new way of doing things, now
14729
(KJS::Collector::numReferencedObjects): ditto
14730
(KJS::Collector::rootObjectClasses): ditto
14731
* kjs/collector.h: Added protect and unprotect static methods
14733
(KJS::gcProtect): Updated for removal of ProtectedValues class
14734
(KJS::gcUnprotect): likewise
14735
* kjs/protected_values.cpp: Removed.
14736
* kjs/protected_values.h: Removed.
14738
2005-12-10 Darin Adler <darin@apple.com>
14740
Rubber stamped by Maciej.
14742
- did long-promised KJS renaming:
14744
ValueImp -> JSValue
14745
ObjectImp -> JSObject
14746
AllocatedValueImp -> JSCell
14748
A renaming to get a class out of the way
14750
KJS::Bindings::JSObject -> JavaJSObject
14752
and some other "imp-reduction" renaming
14754
*InstanceImp -> *Instance
14755
*ProtoFuncImp -> *ProtoFunc
14756
*PrototypeImp -> *Prototype
14757
ArgumentsImp -> Arguments
14758
RuntimeArrayImp -> RuntimeArray
14759
RuntimeMethodImp -> RuntimeMethod
14761
* most files and functions
14763
2005-12-10 Darin Adler <darin@apple.com>
14765
Reviewed by Maciej.
14767
- eliminated the old Undefined(), Null(), Boolean(), Number(), and String()
14769
Code now uses jsUndefined(), jsNull(), jsBoolean(), jsNumber(), and jsString().
14771
* bindings/NP_jsobject.cpp:
14773
* bindings/c/c_instance.cpp:
14774
(KJS::Bindings::CInstance::invokeMethod):
14775
(KJS::Bindings::CInstance::invokeDefaultMethod):
14776
* bindings/c/c_runtime.cpp:
14777
(CField::valueFromInstance):
14778
* bindings/c/c_utility.cpp:
14779
(KJS::Bindings::convertNPVariantToValue):
14780
* bindings/jni/jni_instance.cpp:
14781
(JavaInstance::invokeMethod):
14782
(JavaInstance::invokeDefaultMethod):
14783
* bindings/jni/jni_jsobject.cpp:
14785
(JSObject::convertJObjectToValue):
14786
* bindings/jni/jni_runtime.cpp:
14787
(JavaArray::convertJObjectToArray):
14788
(JavaField::valueFromInstance):
14789
(JavaArray::valueAt):
14790
* bindings/objc/WebScriptObject.mm:
14791
(-[WebScriptObject callWebScriptMethod:withArguments:]):
14792
(-[WebScriptObject evaluateWebScript:]):
14793
(-[WebScriptObject valueForKey:]):
14794
(-[WebScriptObject webScriptValueAtIndex:]):
14795
* bindings/objc/objc_instance.mm:
14796
(ObjcInstance::invokeMethod):
14797
(ObjcInstance::invokeDefaultMethod):
14798
(ObjcInstance::getValueOfUndefinedField):
14799
* bindings/objc/objc_runtime.mm:
14800
(ObjcField::valueFromInstance):
14801
(ObjcFallbackObjectImp::callAsFunction):
14802
* bindings/objc/objc_utility.mm:
14803
(KJS::Bindings::convertNSStringToString):
14804
(KJS::Bindings::convertObjcValueToValue):
14805
* bindings/runtime.h:
14806
(KJS::Bindings::Class::fallbackObject):
14807
(KJS::Bindings::Instance::getValueOfUndefinedField):
14808
(KJS::Bindings::Instance::valueOf):
14809
* bindings/runtime_array.cpp:
14810
(RuntimeArrayImp::lengthGetter):
14811
* bindings/runtime_method.cpp:
14812
(RuntimeMethodImp::lengthGetter):
14813
(RuntimeMethodImp::callAsFunction):
14814
(RuntimeMethodImp::execute):
14815
* kjs/array_object.cpp:
14816
(ArrayInstanceImp::lengthGetter):
14817
(CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
14818
(ArrayPrototypeImp::ArrayPrototypeImp):
14819
(ArrayProtoFuncImp::ArrayProtoFuncImp):
14820
(ArrayProtoFuncImp::callAsFunction):
14821
(ArrayObjectImp::ArrayObjectImp):
14822
* kjs/bool_object.cpp:
14823
(BooleanPrototypeImp::BooleanPrototypeImp):
14824
(BooleanProtoFuncImp::callAsFunction):
14825
(BooleanObjectImp::BooleanObjectImp):
14826
(BooleanObjectImp::callAsFunction):
14827
* kjs/error_object.cpp:
14828
(ErrorPrototypeImp::ErrorPrototypeImp):
14829
(ErrorProtoFuncImp::ErrorProtoFuncImp):
14830
(ErrorProtoFuncImp::callAsFunction):
14831
(ErrorObjectImp::ErrorObjectImp):
14832
(NativeErrorImp::NativeErrorImp):
14833
* kjs/function.cpp:
14834
(KJS::FunctionImp::callAsFunction):
14835
(KJS::FunctionImp::processParameters):
14836
(KJS::FunctionImp::argumentsGetter):
14837
(KJS::FunctionImp::lengthGetter):
14838
(KJS::DeclaredFunctionImp::execute):
14841
(KJS::GlobalFuncImp::callAsFunction):
14842
* kjs/function_object.cpp:
14843
(FunctionPrototypeImp::FunctionPrototypeImp):
14844
(FunctionPrototypeImp::callAsFunction):
14845
(FunctionProtoFuncImp::callAsFunction):
14846
(FunctionObjectImp::FunctionObjectImp):
14847
* kjs/internal.cpp:
14848
(KJS::InterpreterImp::initGlobalObject):
14849
* kjs/interpreter.h:
14851
* kjs/math_object.cpp:
14852
(MathObjectImp::getValueProperty):
14853
(MathFuncImp::callAsFunction):
14855
(Node::setExceptionDetailsIfNeeded):
14856
(NullNode::evaluate):
14857
(PropertyNode::evaluate):
14858
(FunctionCallBracketNode::evaluate):
14859
(FunctionCallDotNode::evaluate):
14860
(PostfixBracketNode::evaluate):
14861
(PostfixDotNode::evaluate):
14862
(VoidNode::evaluate):
14863
(PrefixBracketNode::evaluate):
14864
(PrefixDotNode::evaluate):
14865
(ShiftNode::evaluate):
14866
(valueForReadModifyAssignment):
14867
(AssignDotNode::evaluate):
14868
(AssignBracketNode::evaluate):
14869
(VarDeclNode::evaluate):
14870
(VarDeclNode::processVarDecls):
14871
(VarDeclListNode::evaluate):
14872
(ReturnNode::execute):
14873
(CaseClauseNode::evalStatements):
14874
(ParameterNode::evaluate):
14875
(FuncDeclNode::processFuncDecl):
14877
(KJS::StatementNode::evaluate):
14878
* kjs/number_object.cpp:
14879
(NumberPrototypeImp::NumberPrototypeImp):
14880
(NumberProtoFuncImp::callAsFunction):
14881
(NumberObjectImp::NumberObjectImp):
14882
(NumberObjectImp::getValueProperty):
14883
(NumberObjectImp::callAsFunction):
14885
(KJS::ObjectImp::get):
14886
(KJS::Error::create):
14887
* kjs/object_object.cpp:
14888
(ObjectPrototypeImp::ObjectPrototypeImp):
14889
(ObjectProtoFuncImp::callAsFunction):
14890
(ObjectObjectImp::ObjectObjectImp):
14891
* kjs/property_slot.cpp:
14892
(KJS::PropertySlot::undefinedGetter):
14893
* kjs/regexp_object.cpp:
14894
(RegExpPrototypeImp::RegExpPrototypeImp):
14895
(RegExpProtoFuncImp::callAsFunction):
14896
(RegExpObjectImp::RegExpObjectImp):
14897
(RegExpObjectImp::arrayOfMatches):
14898
(RegExpObjectImp::getBackref):
14899
(RegExpObjectImp::getLastMatch):
14900
(RegExpObjectImp::getLastParen):
14901
(RegExpObjectImp::getLeftContext):
14902
(RegExpObjectImp::getRightContext):
14903
(RegExpObjectImp::getValueProperty):
14904
(RegExpObjectImp::construct):
14905
* kjs/string_object.cpp:
14906
(StringInstanceImp::StringInstanceImp):
14907
(StringPrototypeImp::StringPrototypeImp):
14909
(StringProtoFuncImp::callAsFunction):
14910
(StringObjectImp::StringObjectImp):
14911
(StringObjectImp::callAsFunction):
14912
(StringObjectFuncImp::StringObjectFuncImp):
14913
(StringObjectFuncImp::callAsFunction):
14915
(TestFunctionImp::callAsFunction):
14916
(VersionFunctionImp::callAsFunction):
14919
2005-12-10 Oliver Hunt <ojh16@student.canterbury.ac.nz>
14921
Reviewed by Maciej, landed by Darin.
14923
- fix http://bugs.webkit.org/show_bug.cgi?id=3539
14924
Array join and toString methods do not support circular references
14926
* kjs/array_object.cpp: (ArrayProtoFuncImp::callAsFunction):
14927
Added set of visited objects -- don't recurse if item is already in the set.
14929
2005-12-08 Maciej Stachowiak <mjs@apple.com>
14933
- fix major memory leak and resultant slowdown on JavaScript iBench from
14934
my PassRefPtr changes
14937
(KJS::UString::Rep::create): I forgot to change one of the two overloads to create
14938
with a refcount of 0 instead of 1 (the smart pointer then bumps it. But instead of
14939
changing it, I changed both to start with a refcounter of 1 and use PassRefPtr::adopt
14940
to adopt the initial refcount, this may be a hair more efficient.
14942
- made the assignment operators for smart pointers inline because Shark said so
14944
* kxmlcore/PassRefPtr.h:
14945
(KXMLCore::::operator=):
14946
* kxmlcore/RefPtr.h:
14947
(KXMLCore::::operator=):
14949
2005-12-06 Anders Carlsson <andersca@mac.com>
14953
- fix build when using gcc 4
14958
* kxmlcore/PassRefPtr.h:
14959
(KXMLCore::::operator):
14962
2005-12-05 Maciej Stachowiak <mjs@apple.com>
14966
- add PassRefPtr, a smart pointer class that works in conjunction
14967
with RefPtr but has transfer-of-ownership semantics
14968
- apply RefPtr and PassRefPtr to UString
14969
- cleaned up UString a little so that it doesn't need to have so many friend classes
14971
* JavaScriptCore.xcodeproj/project.pbxproj:
14972
* kjs/identifier.cpp:
14973
(KJS::Identifier::add):
14974
* kjs/identifier.h:
14975
(KJS::Identifier::Identifier):
14976
(KJS::Identifier::equal):
14977
* kjs/property_map.cpp:
14978
(KJS::PropertyMap::get):
14979
(KJS::PropertyMap::getLocation):
14980
(KJS::PropertyMap::put):
14981
(KJS::PropertyMap::remove):
14983
(KJS::UCharReference::operator=):
14984
(KJS::UCharReference::ref):
14985
(KJS::UString::Rep::createCopying):
14986
(KJS::UString::Rep::create):
14987
(KJS::UString::usedCapacity):
14988
(KJS::UString::usedPreCapacity):
14989
(KJS::UString::expandCapacity):
14990
(KJS::UString::expandPreCapacity):
14991
(KJS::UString::UString):
14992
(KJS::UString::spliceSubstringsWithSeparators):
14993
(KJS::UString::append):
14994
(KJS::UString::operator=):
14995
(KJS::UString::toStrictUInt32):
14996
(KJS::UString::substr):
14997
(KJS::UString::copyForWriting):
15000
(KJS::UString::UString):
15001
(KJS::UString::~UString):
15002
(KJS::UString::data):
15003
(KJS::UString::isNull):
15004
(KJS::UString::isEmpty):
15005
(KJS::UString::size):
15006
(KJS::UString::rep):
15007
* kxmlcore/RefPtr.h:
15008
(KXMLCore::RefPtr::RefPtr):
15009
(KXMLCore::RefPtr::operator*):
15010
(KXMLCore::::operator):
15011
(KXMLCore::operator==):
15012
(KXMLCore::operator!=):
15013
(KXMLCore::static_pointer_cast):
15014
(KXMLCore::const_pointer_cast):
15016
2005-12-04 Geoffrey Garen <ggaren@apple.com>
15018
Update test results to match Anders's last checkin.
15020
* tests/mozilla/expected.html:
15022
2005-12-04 Anders Carlsson <andersca@mac.com>
15024
Reviewed by Geoffrey.
15026
- Fixes <http://bugs.webkit.org/show_bug.cgi?id=3999>
15027
Object.prototype is missing propertyIsEnumerable
15030
(KJS::ObjectImp::canPut):
15031
Refactor to use getPropertyAttributes.
15033
(KJS::ObjectImp::propertyIsEnumerable):
15034
New function which checks if a property is enumerable.
15036
(KJS::ObjectImp::getPropertyAttributes):
15038
Add getPropertyAttributes and propertyIsEnumerable.
15040
* kjs/object_object.cpp:
15041
(ObjectPrototypeImp::ObjectPrototypeImp):
15042
(ObjectProtoFuncImp::callAsFunction):
15043
* kjs/object_object.h:
15044
(KJS::ObjectProtoFuncImp::):
15045
Add propertyIsEnumerable to the Object prototype.
15047
2005-12-01 Maciej Stachowiak <mjs@apple.com>
15049
Reviewed by Tim Hatcher.
15051
- removed deprecated reset, isNull and nonNull methods
15053
* kxmlcore/RefPtr.h:
15055
2005-12-01 Anders Carlsson <andersca@mac.com>
15059
- Fixes <http://bugs.webkit.org/show_bug.cgi?id=3382>
15060
nodes2strings.cpp fails to print left expression of ForInNode when 'var' is not used
15062
Patch by Mark Rowe.
15064
* kjs/nodes2string.cpp:
15065
(ForInNode::streamTo):
15066
Add lexpr if there's no varDecl.
15068
2005-12-01 Maciej Stachowiak <mjs@apple.com>
15070
Rubber stamped by Eric.
15072
- renamed SharedPtr to RefPtr via script
15074
* JavaScriptCore.xcodeproj/project.pbxproj:
15075
* kjs/function.cpp:
15076
(KJS::GlobalFuncImp::callAsFunction):
15078
* kjs/function_object.cpp:
15079
(FunctionObjectImp::construct):
15080
* kjs/internal.cpp:
15081
(KJS::Parser::parse):
15082
(KJS::InterpreterImp::checkSyntax):
15083
(KJS::InterpreterImp::evaluate):
15086
* kjs/nodes2string.cpp:
15087
(KJS::SourceStream::operator<<):
15089
* kxmlcore/RefPtr.h: Added.
15090
(KXMLCore::RefPtr::RefPtr):
15091
(KXMLCore::RefPtr::~RefPtr):
15092
(KXMLCore::RefPtr::isNull):
15093
(KXMLCore::RefPtr::notNull):
15094
(KXMLCore::RefPtr::reset):
15095
(KXMLCore::RefPtr::get):
15096
(KXMLCore::RefPtr::operator*):
15097
(KXMLCore::RefPtr::operator->):
15098
(KXMLCore::RefPtr::operator!):
15099
(KXMLCore::RefPtr::operator UnspecifiedBoolType):
15100
(KXMLCore::::operator):
15101
(KXMLCore::operator==):
15102
(KXMLCore::operator!=):
15103
(KXMLCore::static_pointer_cast):
15104
(KXMLCore::const_pointer_cast):
15105
* kxmlcore/SharedPtr.h: Removed.
15107
2005-11-30 Maciej Stachowiak <mjs@apple.com>
15109
Reviewed by Dave Hyatt.
15111
- change idiom used for implicit bool conversion of smart pointers, because the old one gives weird error messages sometimes
15114
(KJS::ProtectedPtr::operator UnspecifiedBoolType):
15115
* kxmlcore/SharedPtr.h:
15116
(KXMLCore::SharedPtr::operator UnspecifiedBoolType):
15118
2005-11-29 Mitz Pettel <opendarwin.org@mitzpettel.com>
15120
Reviewed by ggaren. Committed by eseidel.
15122
Date conversion to local time gets the DST flag wrong sometimes
15123
http://bugs.webkit.org/show_bug.cgi?id=5514
15125
* kjs/date_object.cpp:
15126
(KJS::isTime_tSigned):
15127
(KJS::DateProtoFuncImp::callAsFunction):
15129
2005-11-26 Maciej Stachowiak <mjs@apple.com>
15131
Rubber stamped by Eric.
15133
- renamed InterpreterLock to JSLock
15135
* bindings/NP_jsobject.cpp:
15138
(_NPN_GetProperty):
15139
(_NPN_SetProperty):
15140
(_NPN_RemoveProperty):
15141
(_NPN_HasProperty):
15143
(_NPN_SetException):
15144
* bindings/jni/jni_jsobject.cpp:
15147
(JSObject::getMember):
15148
(JSObject::setMember):
15149
(JSObject::removeMember):
15150
(JSObject::getSlot):
15151
(JSObject::setSlot):
15152
(JSObject::toString):
15153
(JSObject::convertJObjectToValue):
15154
* bindings/objc/WebScriptObject.mm:
15155
(-[WebScriptObject callWebScriptMethod:withArguments:]):
15156
(-[WebScriptObject evaluateWebScript:]):
15157
(-[WebScriptObject setValue:forKey:]):
15158
(-[WebScriptObject valueForKey:]):
15159
(-[WebScriptObject removeWebScriptKey:]):
15160
(-[WebScriptObject stringRepresentation]):
15161
(-[WebScriptObject webScriptValueAtIndex:]):
15162
(-[WebScriptObject setWebScriptValueAtIndex:value:]):
15163
(+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:]):
15164
* bindings/runtime.cpp:
15165
(Instance::createRuntimeObject):
15166
* bindings/runtime_root.cpp:
15167
(KJS::Bindings::addNativeReference):
15168
(KJS::Bindings::removeNativeReference):
15169
(RootObject::removeAllNativeReferences):
15170
* bindings/runtime_root.h:
15171
(KJS::Bindings::RootObject::~RootObject):
15172
(KJS::Bindings::RootObject::setRootObjectImp):
15173
* bindings/testbindings.cpp:
15175
* bindings/testbindings.mm:
15178
(KJS::initializeJSLock):
15179
(KJS::JSLock::lock):
15180
(KJS::JSLock::unlock):
15181
(KJS::JSLock::lockCount):
15182
(KJS::JSLock::DropAllLocks::DropAllLocks):
15183
(KJS::JSLock::DropAllLocks::~DropAllLocks):
15185
(KJS::JSLock::JSLock):
15186
(KJS::JSLock::~JSLock):
15187
* kjs/collector.cpp:
15188
(KJS::Collector::allocate):
15189
(KJS::Collector::collect):
15190
* kjs/internal.cpp:
15191
(KJS::InterpreterImp::InterpreterImp):
15192
(KJS::InterpreterImp::clear):
15193
(KJS::InterpreterImp::checkSyntax):
15194
(KJS::InterpreterImp::evaluate):
15195
* kjs/interpreter.cpp:
15196
(Interpreter::evaluate):
15198
(KJS::::ProtectedPtr):
15199
(KJS::::~ProtectedPtr):
15201
* kjs/protected_reference.h:
15202
(KJS::ProtectedReference::ProtectedReference):
15203
(KJS::ProtectedReference::~ProtectedReference):
15204
(KJS::ProtectedReference::operator=):
15205
* kjs/protected_values.cpp:
15206
(KJS::ProtectedValues::getProtectCount):
15207
(KJS::ProtectedValues::increaseProtectCount):
15208
(KJS::ProtectedValues::decreaseProtectCount):
15210
(TestFunctionImp::callAsFunction):
15213
2005-11-26 Darin Adler <darin@apple.com>
15215
Reviewed by eseidel. Committed by eseidel.
15217
Inline ScopeChain functions for speed.
15218
http://bugs.webkit.org/show_bug.cgi?id=5687
15221
(KJS::ScopeChain::mark):
15222
* kjs/scope_chain.cpp:
15223
* kjs/scope_chain.h:
15224
(KJS::ScopeChain::ref):
15225
(KJS::ScopeChain::operator=):
15226
(KJS::ScopeChain::bottom):
15227
(KJS::ScopeChain::push):
15228
(KJS::ScopeChain::pop):
15230
2005-11-21 Maciej Stachowiak <mjs@apple.com>
15234
<rdar://problem/4139620> Seed: WebKit: hang when sending XMLHttpRequest if automatic proxy config is used
15236
Also factored locking code completely into a separate class, and
15237
added a convenient packaged way to temporarily drop locks.
15239
* JavaScriptCore.xcodeproj/project.pbxproj:
15240
* kjs/JSLock.cpp: Added.
15241
(KJS::initializeInterpreterLock):
15242
(KJS::InterpreterLock::lock):
15243
(KJS::InterpreterLock::unlock):
15244
(KJS::InterpreterLock::lockCount):
15245
(KJS::InterpreterLock::DropAllLocks::DropAllLocks):
15246
(KJS::InterpreterLock::DropAllLocks::~DropAllLocks):
15247
* kjs/JSLock.h: Added.
15248
(KJS::InterpreterLock::InterpreterLock):
15249
(KJS::InterpreterLock::~InterpreterLock):
15250
* kjs/internal.cpp:
15252
* kjs/interpreter.cpp:
15253
* kjs/interpreter.h:
15256
(TestFunctionImp::callAsFunction):
15258
2005-11-21 Eric Seidel <eseidel@apple.com>
15260
Rubber-stamped by hyatt.
15262
Removed JavaScriptCore+SVG target.
15264
* JavaScriptCore.xcodeproj/project.pbxproj:
15266
2005-11-15 Geoffrey Garen <ggaren@apple.com>
15270
- Fixed <rdar://problem/4342216> Installer crash in
15271
KJS::ValueImp::marked() when garbage collector runs inside call to
15272
ConstantValues::init()
15274
I took responsibility for initializing and marking ConstantValues away
15275
from InterpreterImp, since it's possible to reference such a value
15276
before any interpreter has been created and after the last interpreter
15277
has been destroyed.
15279
InterpreterImp::lock now initializes ConstantValues. It's a good
15280
place for the initialization because you have to call it before
15281
creating any objects. Since ::lock can be called more than once,
15282
I added a check in ConstantValues::init to ensure that it executes
15285
Collector:collect is now responsible for marking ConstantValues.
15287
We no longer clear the ConstantValues since we can't guarantee that no
15288
one has a reference to them.
15290
FIXME: This is hackery. The long-term plan is to make ConstantValues
15291
use immediate values that require no initialization.
15294
* kjs/collector.cpp:
15295
(KJS::Collector::collect):
15296
* kjs/internal.cpp:
15297
(KJS::InterpreterImp::InterpreterImp):
15298
(KJS::InterpreterImp::lock):
15299
(KJS::InterpreterImp::clear):
15300
(KJS::InterpreterImp::mark):
15303
(KJS::ConstantValues::initIfNeeded):
15306
2005-11-08 Geoffrey Garen <ggaren@apple.com>
15310
This patch fixes some naughty naughty code -- 5 crashes and 2
15311
may-go-haywire-in-the-futures.
15313
One such crash is <rdar://problem/4247330> 8C46 Crash with with
15314
incomplete parameter list to webScript object function.
15316
I replaced early returns from within NS_DURINGs with calls to
15317
NS_VALUERETURN because the doc says, "You cannot use goto or
15318
return to exit an exception handling domain -- errors will result."
15320
I replaced hard-coded analyses of -[NSMethodSignature
15321
methodReturnType] with more abstracted alternatives, since
15322
the documentation says "This encoding is implementation-specific,
15323
so applications should use it with caution," and then emits an
15326
I removed the early return in the case where a JavaScript caller
15327
supplies an insufficient number of arguments, because the right
15328
thing to do in such a case is to use JavaScript's defined behavior
15329
of supplying "undefined" for any missing arguments.
15331
I also changed ObjcInstance::invokeMethod so that it no longer
15332
deletes the method passed to it. It doesn't create the method,
15333
so it shouldn't delete it. A friend of mine named
15334
KERNEL_PROTECTION_FAILURE agrees with me on this point.
15336
Finally, I changed an assert(true) to assert(false) because
15337
all the other asserts were making fun of it.
15339
* bindings/objc/objc_instance.mm:
15340
(ObjcInstance::invokeMethod):
15341
(ObjcInstance::invokeDefaultMethod):
15343
2005-11-06 Geoffrey Garen <ggaren@apple.com>
15347
- Fixed http://bugs.webkit.org/show_bug.cgi?id=5571
15348
REGRESSION (412.5-TOT): duplicated words/sentences at
15349
shakespeer.sourceforge.net
15351
Our UTF16-modified PCRE didn't work with extended character classes
15352
(classes involving characters > 255) because it used the GETCHARINC
15353
macro to read through them. In UTF16 mode, GETCHARINC expects UTF16
15354
input, but PCRE encodes character classes in UTF8 regardless of the
15355
input mode of the subject string.
15357
The fix is to explicitly define GETUTF8CHARINC, and to use it,
15358
rather than GETCHARINC, when reading extended character classes.
15360
In UTF8 mode, we simply define GETCHARINC to be GETUTF8CHARINC.
15362
* pcre/pcre_internal.h:
15363
* pcre/pcre_xclass.c:
15366
2005-11-05 Geoffrey Garen <ggaren@apple.com>
15368
Patch by Mitz Pettel, reviewed by Maciej.
15370
- Fixed http://bugs.webkit.org/show_bug.cgi?id=5357
15371
REGRESSION: Scriptable plugin hides properties of OBJECT element
15373
* bindings/objc/objc_class.mm:
15374
(KJS::Bindings::ObjcClass::fallbackObject):
15376
2005-11-05 Geoffrey Garen <ggaren@apple.com>
15380
- Fixed http://bugs.webkit.org/show_bug.cgi?id=5409
15381
slice() testcase doesn't pass
15383
Modified String.slice to deal with funky values.
15384
Updated test results. We now pass <js1_2/String/slice.js>.
15386
* kjs/string_object.cpp:
15387
(StringProtoFuncImp::callAsFunction):
15388
* tests/mozilla/expected.html:
15390
2005-11-04 Darin Adler <darin@apple.com>
15392
Reviewed by Tim Hatcher.
15394
* kxmlcore/HashSet.h: Fixed case of "hashfunctions.h" -- needs to be "HashFunctions.h".
15396
2005-11-03 Timothy Hatcher <timothy@apple.com>
15398
Reviewed by Darin and Vicki.
15400
* JavaScriptCore.xcodeproj/project.pbxproj:
15401
Change to use $(SYSTEM_LIBRARY_DIR) consistently and place
15402
$(NEXT_ROOT) in a few spots to make build-root work.
15404
2005-11-03 Geoffrey Garen <ggaren@apple.com>
15406
- Updated JavaScriptCore test results to reflect recent fixes.
15408
* tests/mozilla/expected.html:
15410
2005-11-03 Geoffrey Garen <ggaren@apple.com>
15414
- Fixed http://bugs.webkit.org/show_bug.cgi?id=5602
15415
REGRESSION: RegExp("[^\\s$]+", "g") returns extra matches
15417
We now update lastIndex relative to the start of the last match,
15418
rather than the start of the last search. We used to assume that
15419
the two were equal, but that is not the case when a pattern
15420
matches at a character after the first in the string.
15422
* kjs/regexp_object.cpp:
15423
(RegExpProtoFuncImp::callAsFunction):
15425
2005-10-24 John Sullivan <sullivan@apple.com>
15427
Reviewed by Darin Adler. Code changes by Alexey Proskuryakov.
15429
- fixed http://bugs.webkit.org/show_bug.cgi?id=4931
15430
Unicode format characters (Cf) should be removed from JavaScript source
15433
include <unicode/uchar.h>
15435
use KJS::UChar instead of UChar to avoid ambiguity caused by new include
15437
ditto; also, use shift(4) to skip first 4 chars to take advantage of new
15440
skip chars of type U_FORMAT_CHAR
15441
(Lexer::convertUnicode):
15442
use KJS::UChar instead of UChar to avoid ambiguity caused by new include
15445
(Lexer::makeIdentifier):
15447
(Lexer::makeUString):
15450
* tests/mozilla/ecma/Array/15.4.5.1-1.js:
15451
updated to skip soft hyphens
15453
2005-10-24 John Sullivan <sullivan@apple.com>
15455
Reviewed by Darin Adler. Code changes by George Staikos/Geoff Garen.
15457
- fixed http://bugs.webkit.org/show_bug.cgi?id=4142
15458
Date object does not always adjust daylight savings correctly
15460
* kjs/date_object.cpp:
15462
Fix the case where a time change crosses the daylight savings start/end dates.
15464
2005-10-17 Maciej Stachowiak <mjs@apple.com>
15466
Reviewed by Geoff. Code changes by Darin.
15468
- some micro-optimizations to FastMalloc to reduce math and branches.
15470
* kxmlcore/FastMalloc.cpp:
15471
(KXMLCore::TCMalloc_Central_FreeList::Populate):
15472
(KXMLCore::fastMallocRegisterThread):
15473
(KXMLCore::TCMalloc_ThreadCache::GetCache):
15474
(KXMLCore::TCMalloc_ThreadCache::GetCacheIfPresent):
15476
2005-10-15 Maciej Stachowiak <mjs@apple.com>
15478
Reverted fix for this bug, because it was part of a time range that caused a performance
15481
<rdar://problem/4260481> Remove Reference type from JavaScriptCore
15483
2005-10-15 Darin Adler <darin@apple.com>
15485
* kxmlcore/HashTable.cpp: Fixed build failure (said hashtable.h instead of HashTable.h).
15487
2005-10-14 Geoffrey Garen <ggaren@apple.com>
15489
Style changes recommended by Darin.
15491
Changed to camelCase, changed ValueImp* to ValueImp *.
15493
* kjs/simple_number.h:
15494
(KJS::SimpleNumber::make):
15495
(KJS::SimpleNumber::value):
15497
2005-10-11 Geoffrey Garen <ggaren@apple.com>
15499
Added regexp_object.lut.h build phase from JavaScriptCore
15500
to JavaScriptCore+SVG.
15504
* JavaScriptCore.xcodeproj/project.pbxproj:
15506
2005-10-11 Geoffrey Garen <ggaren@apple.com>
15508
Fixed build bustage from last checkin (stray characters
15509
in the project file).
15513
* JavaScriptCore.xcodeproj/project.pbxproj:
15515
2005-10-11 Geoffrey Garen <ggaren@apple.com>
15517
New JavaScriptCore test results to reflect the last change.
15519
* tests/mozilla/expected.html:
15521
2005-10-10 Geoffrey Garen <ggaren@apple.com>
15523
- Implemented caching of match state inside the global RegExp object
15524
(lastParen, leftContext, rightContext, lastMatch, input).
15526
exec(), test(), match(), search(), and replace() now dipatch regular
15527
expression matching through the RegExp object's performMatch function,
15528
to facilitate caching. This replaces registerRegexp and
15531
- Implemented the special '$' aliases (e.g. RegExp.input aliases to
15534
- Moved support for backreferences into the new static hash table
15535
used for other special RegExp properties. Truncated backreferences
15536
at $9 to match IE, FF, and the "What's New in Netscape 1.2?" doc.
15537
(String.replace still supports double-digit backreferences.)
15539
- Tweaked RegExp.prototype.exec to handle ginormous values in lastIndex.
15541
Fixes 11 -- count em, 11 -- JavaScriptCore tests.
15543
* fast/js/regexp-caching-expected.txt: Added.
15544
* fast/js/regexp-caching.html: Added.
15548
* JavaScriptCore.xcodeproj/project.pbxproj: Added regexp_object.lut.h
15549
* kjs/create_hash_table: Tweaked to allow for more exotic characters.
15550
We now rely on the compiler to catch illegal
15553
(KJS::RegExp::RegExp):
15554
* kjs/regexp_object.cpp:
15555
(RegExpProtoFuncImp::callAsFunction):
15556
(RegExpObjectImp::RegExpObjectImp):
15557
(RegExpObjectImp::performMatch):
15558
(RegExpObjectImp::arrayOfMatches):
15559
(RegExpObjectImp::backrefGetter):
15560
(RegExpObjectImp::getLastMatch):
15561
(RegExpObjectImp::getLastParen):
15562
(RegExpObjectImp::getLeftContext):
15563
(RegExpObjectImp::getRightContext):
15564
(RegExpObjectImp::getOwnPropertySlot):
15565
(RegExpObjectImp::getValueProperty):
15566
(RegExpObjectImp::put):
15567
(RegExpObjectImp::putValueProperty):
15568
* kjs/regexp_object.h:
15569
(KJS::RegExpObjectImp::):
15570
* kjs/string_object.cpp:
15571
(substituteBackreferences):
15573
(StringProtoFuncImp::callAsFunction):
15575
2005-10-09 Darin Adler <darin@apple.com>
15577
Reviewed by Maciej; some changes done after review.
15579
- fixed <rdar://problem/4092064> hanging loading page; rte.ie (works in IE and Firefox)
15580
- fixed http://bugs.webkit.org/show_bug.cgi?id=5280
15581
Date.setMonth fails with negative values
15582
- fixed http://bugs.webkit.org/show_bug.cgi?id=5154
15583
JSC should switch to _r variants of unix time/date functions
15584
- fixed a few possible overflow cases
15586
Retested all tests to be sure nothing broke; added layout test for bug 5280.
15588
* kjs/config.h: Removed TIME_WITH_SYS_TIME define. Also set HAVE_SYS_TIMEB_H
15589
for the __APPLE__ case (the latter is accurate but irrelevant).
15591
* kjs/date_object.h: Reformatted. Removed unnecessary include of "function_object.h".
15592
Moved declarations of helper classes and functions into the cpp file.
15594
* kjs/date_object.cpp: Removed code at top to define macros to use CoreFoundation instead of
15595
POSIX date functions.
15596
(KJS::styleFromArgString): Tweaked to return early instead of using a variable.
15597
(KJS::formatLocaleDate): Tweaked to check for undefined rather than checking argument count.
15598
(KJS::formatDate): Made parameter const.
15599
(KJS::formatDateUTCVariant): Ditto.
15600
(KJS::formatTime): Ditto.
15601
(KJS::DateProtoFuncImp::callAsFunction): Use gmtime_r and localtime_r instead of gmtime and
15603
(KJS::DateObjectImp::callAsFunction): Use localtime_r instead of localtime.
15604
(KJS::ymdhmsToSeconds): Renamed from ymdhms_to_seconds. Changed computation to avoid possible
15605
overflow if year is an extremely large or small number.
15606
(KJS::makeTime): Removed code to move large month numbers from tm_mon to tm_year; this was
15607
to accomodate CFGregorianDate, which is no longer used (and didn't handle negative values).
15608
(KJS::parseDate): Renamed from KRFCDate_parseDate; changed to return a value in milliseconds
15609
rather than in seconds. Reformatted the code. Changed to use UTF8String() instead of ascii(),
15610
since ascii() is not thread safe. Changed some variables back from int to long to avoid
15611
trouble if the result of strtol does not fit in an int (64-bit issue only).
15613
2005-10-08 Mitz Pettel <opendarwin.org@mitzpettel.com>
15616
Tweaked and landed by Darin.
15618
- fixed http://bugs.webkit.org/show_bug.cgi?id=5266
15619
Support parenthesized comments in Date.parse()
15621
* kjs/date_object.cpp:
15622
(KJS::skipSpacesAndComments): Take a pointer, and advance it past spaces,
15623
and also past anything enclosed in parentheses.
15624
(KJS::KRFCDate_parseDate): Use skipSpacesAndComments wherever we formerly had
15625
code to skip spaces.
15627
2005-10-08 Justin Haygood <justin@xiondigital.net>
15629
Reviewed, tweaked, and landed by Darin.
15631
- fixed http://bugs.webkit.org/show_bug.cgi?id=5189
15632
pcre_exec.c fails to compile using MSVC
15633
- fixed http://bugs.webkit.org/show_bug.cgi?id=5190
15634
KJS config.h adjustment for Win32
15636
* kjs/config.h: Make sure HAVE_MMAP and HAVE_SBRK are off for Win32.
15637
Turn HAVE_ERRNO_H on for Mac OS X. Sort defines so they are easy to compare
15638
with each other. Remove #undef of DEBUG_COLLECTOR.
15639
* pcre/pcre_exec.c: (match): Work around strange MSVC complaint by splitting
15640
the definition of a local variable into a separate declaration and
15643
2005-10-05 Geoffrey Garen <ggaren@apple.com>
15645
- Darin and I rewrote our implementation of the SimpleNumber class
15646
to store number bit patterns in their floating point formats.
15648
My tweaks reviewed by Darin.
15650
~1% speedup on JS iBench.
15652
* kjs/internal.h: removed obsolete jsNumber declarations.
15653
* kjs/math_object.cpp:
15654
(MathFuncImp::callAsFunction): changed KJS::isNaN to isNaN
15656
(PostfixResolveNode::evaluate): removed obsolete knownToBeInteger
15657
(PostfixBracketNode::evaluate): ditto
15658
(PostfixDotNode::evaluate): ditto
15659
(PrefixResolveNode::evaluate): ditto
15660
(PrefixBracketNode::evaluate): ditto
15661
(PrefixDotNode::evaluate): ditto
15662
(NegateNode::evaluate): ditto
15663
(valueForReadModifyAssignment): ditto
15664
* kjs/number_object.cpp: removed obsolete comment
15665
* kjs/operations.cpp:
15666
(KJS::equal): removed unnecessary isNaN checks
15667
(KJS::strictEqual): ditto
15668
(KJS::add): removed obsolete knownToBeInteger
15670
* kjs/operations.h: removed include of "value.h" to prevent circular reference
15671
* kjs/simple_number.h: removed unnecessary #includes
15672
(KJS::SimpleNumber::make): see above
15673
(KJS::SimpleNumber::is): ditto
15674
(KJS::SimpleNumber::value): ditto
15675
* kjs/string_object.cpp:
15676
(StringProtoFuncImp::callAsFunction): changed KJS::isNaN to isNaN
15677
* kjs/ustring.cpp: removed unnecessary isNaN check
15678
(KJS::UString::toUInt32): ditto
15680
(KJS::jsNumber): removed obsolete jsNumber definitions
15681
(KJS::ConstantValues::init): NaN is no longer a ConstantValue
15682
(KJS::ConstantValues::clear): ditto
15683
(KJS::ConstantValues::mark): ditto
15684
* kjs/value.h: removed obsolete knownToBeInteger
15685
(KJS::jsNaN): now returns a SimpleNumber
15686
(KJS::ValueImp::getUInt32): changed to account for NaN being a SimpleNumber
15687
(KJS::ValueImp::toBoolean): ditto
15688
(KJS::ValueImp::toString): changed to account for +/- 0.0
15689
(KJS::jsZero): changed to reflect that SimpleNumber::make takes a double
15690
(KJS::jsOne): ditto
15691
(KJS::jsTwo): ditto
15692
(KJS::Number): removed obsolete non-double constructor declarations
15694
2005-10-05 Maciej Stachowiak <mjs@apple.com>
15698
- fixed <rdar://problem/4260481> Remove Reference type from JavaScriptCore
15700
Also fixed some bugs with for..in enumeration while I was at it. object
15701
properties now come before prototype properties and duplicates
15702
between object and prototype are listed only once.
15704
* JavaScriptCore.xcodeproj/project.pbxproj:
15705
* kjs/IdentifierSequencedSet.cpp: Added.
15706
(KJS::IdentifierSequencedSet::IdentifierSequencedSet):
15707
(KJS::IdentifierSequencedSet::deallocateVector):
15708
(KJS::IdentifierSequencedSet::~IdentifierSequencedSet):
15709
(KJS::IdentifierSequencedSet::insert):
15710
* kjs/IdentifierSequencedSet.h: Added.
15711
(KJS::IdentifierSequencedSetIterator::IdentifierSequencedSetIterator):
15712
(KJS::IdentifierSequencedSetIterator::operator*):
15713
(KJS::IdentifierSequencedSetIterator::operator->):
15714
(KJS::IdentifierSequencedSetIterator::operator++):
15715
(KJS::IdentifierSequencedSetIterator::operator==):
15716
(KJS::IdentifierSequencedSetIterator::operator!=):
15717
(KJS::IdentifierSequencedSet::begin):
15718
(KJS::IdentifierSequencedSet::end):
15719
(KJS::IdentifierSequencedSet::size):
15720
* kjs/array_instance.h:
15721
* kjs/array_object.cpp:
15722
(ArrayInstanceImp::getPropertyNames):
15723
(ArrayInstanceImp::setLength):
15724
(ArrayInstanceImp::pushUndefinedObjectsToEnd):
15726
(ForInNode::execute):
15729
(KJS::ObjectImp::getPropertyNames):
15731
* kjs/property_map.cpp:
15732
(KJS::PropertyMap::getEnumerablePropertyNames):
15733
(KJS::PropertyMap::getSparseArrayPropertyNames):
15734
* kjs/property_map.h:
15736
* kjs/protected_reference.h: Removed.
15737
* kjs/reference.cpp: Removed.
15738
* kjs/reference.h: Removed.
15739
* kjs/reference_list.cpp: Removed.
15740
* kjs/reference_list.h: Removed.
15742
(KJS::UString::impl):
15743
* kxmlcore/HashSet.h:
15745
2005-10-04 Eric Seidel <eseidel@apple.com>
15749
Code cleanup, which resulted in a small win on iBench.
15752
(KJS::tryGetAndCallProperty): new static inline
15753
(KJS::ObjectImp::defaultValue): code cleanup
15755
2005-10-03 Maciej Stachowiak <mjs@apple.com>
15757
Patch from George Staikos <staikos@kde.org>, reviewed and tweaked a bit by me.
15759
- more Linux build fixes
15761
* kjs/operations.cpp:
15762
* kxmlcore/FastMalloc.h:
15763
* kxmlcore/TCSystemAlloc.cpp:
15764
(TCMalloc_SystemAlloc):
15766
2005-10-03 Maciej Stachowiak <mjs@apple.com>
15768
Patch from George Staikos <staikos@kde.org>, reviewed and tweaked a bit by me.
15770
http://bugs.webkit.org/show_bug.cgi?id=5174
15771
Add support for compiling on Linux (likely to help for other POSIX systems too)
15773
* kjs/collector.cpp:
15774
(KJS::Collector::markCurrentThreadConservatively):
15775
(KJS::Collector::markOtherThreadConservatively):
15777
* kjs/date_object.cpp:
15779
(KJS::formatDateUTCVariant):
15781
(KJS::timeZoneOffset):
15782
(KJS::DateProtoFuncImp::callAsFunction):
15783
(KJS::DateObjectImp::construct):
15784
(KJS::DateObjectImp::callAsFunction):
15786
* kjs/identifier.cpp:
15787
* kjs/internal.cpp:
15788
(KJS::initializeInterpreterLock):
15789
(KJS::lockInterpreter):
15790
(KJS::unlockInterpreter):
15791
(KJS::UndefinedImp::toPrimitive):
15792
(KJS::UndefinedImp::toBoolean):
15793
(KJS::UndefinedImp::toNumber):
15794
(KJS::UndefinedImp::toString):
15795
(KJS::NullImp::toPrimitive):
15796
(KJS::NullImp::toBoolean):
15797
(KJS::NullImp::toNumber):
15798
(KJS::NullImp::toString):
15799
(KJS::BooleanImp::toPrimitive):
15800
(KJS::BooleanImp::toBoolean):
15801
(KJS::BooleanImp::toNumber):
15802
(KJS::BooleanImp::toString):
15803
(KJS::StringImp::toPrimitive):
15804
(KJS::StringImp::toBoolean):
15805
(KJS::StringImp::toNumber):
15806
(KJS::StringImp::toString):
15808
* kjs/protected_values.cpp:
15810
2005-10-03 Maciej Stachowiak <mjs@apple.com>
15812
- fix Development build after last checkin
15814
* kxmlcore/FastMalloc.cpp:
15815
(KXMLCore::fastMallocRegisterThread):
15817
2005-10-02 Maciej Stachowiak <mjs@apple.com>
15821
<rdar://problem/4283967> REGRESSION: 3% regression on PLT from new FastMalloc
15822
http://bugs.webkit.org/show_bug.cgi?id=5243
15824
A number of optimizations to the new threadsafe malloc that make it actually as fast
15825
as dlmalloc (I measured wrong before) and as memory-efficient as the system malloc.
15827
- use fastMalloc for everything - it now gets applied to all new/delete allocations
15828
via a private inline operator new that is now included into every file via config.h.
15830
- tweaked some of the numeric parameters for size classes and amount of wasted memory
15831
allowed per allocation - this saves on memory use and consequently improves speed.
15833
- so long as the allocator is not being used on background threads, get the per-thread
15834
cache from a global variable instead of from pthread_getspecific, since the latter is slow.
15836
- inline more functions, and force the ones GCC refuses to inline with
15837
attribute(always_inline), nearly all of these have one call site so inlining them has
15840
- use some tricks to calculate allocation size more efficiently and fewer times for small
15841
allocations, to avoid hitting the huge size table array.
15843
- avoid hitting the per-thread cache on code paths that don't need it.
15845
- implement inline assembly version of spinlock for PowerPC (was already done for x86)
15847
* bindings/NP_jsobject.cpp:
15848
* bindings/c/c_class.cpp:
15849
* bindings/c/c_instance.cpp:
15850
* bindings/c/c_runtime.cpp:
15851
* bindings/c/c_utility.cpp:
15852
* bindings/jni/jni_class.cpp:
15853
* bindings/jni/jni_instance.cpp:
15854
* bindings/jni/jni_jsobject.cpp:
15855
* bindings/jni/jni_objc.mm:
15856
* bindings/jni/jni_runtime.cpp:
15857
* bindings/jni/jni_utility.cpp:
15858
* bindings/npruntime.cpp:
15859
* bindings/objc/WebScriptObject.mm:
15860
* bindings/objc/objc_class.mm:
15861
* bindings/objc/objc_instance.mm:
15862
* bindings/objc/objc_runtime.mm:
15863
* bindings/objc/objc_utility.mm:
15864
* bindings/runtime.cpp:
15865
* bindings/runtime_array.cpp:
15866
* bindings/runtime_method.cpp:
15867
* bindings/runtime_object.cpp:
15868
* bindings/runtime_root.cpp:
15869
* bindings/testbindings.cpp:
15870
* bindings/testbindings.mm:
15871
* kjs/array_object.cpp:
15872
(ArrayInstanceImp::ArrayInstanceImp):
15873
(ArrayInstanceImp::~ArrayInstanceImp):
15874
(ArrayInstanceImp::resizeStorage):
15875
* kjs/bool_object.cpp:
15876
* kjs/collector.cpp:
15877
(KJS::Collector::registerThread):
15879
* kjs/debugger.cpp:
15880
* kjs/error_object.cpp:
15881
* kjs/function.cpp:
15882
* kjs/function_object.cpp:
15883
* kjs/identifier.cpp:
15884
(KJS::Identifier::rehash):
15885
* kjs/internal.cpp:
15886
(KJS::Parser::saveNewNode):
15887
(KJS::clearNewNodes):
15888
* kjs/interpreter.cpp:
15890
(Lexer::doneParsing):
15891
(Lexer::makeIdentifier):
15892
(Lexer::makeUString):
15894
* kjs/math_object.cpp:
15897
* kjs/nodes2string.cpp:
15898
* kjs/number_object.cpp:
15899
(integer_part_noexp):
15902
* kjs/object_object.cpp:
15903
* kjs/property_map.cpp:
15904
* kjs/property_slot.cpp:
15905
* kjs/protected_values.cpp:
15906
(KJS::ProtectedValues::rehash):
15907
* kjs/reference.cpp:
15908
* kjs/reference_list.cpp:
15910
* kjs/regexp_object.cpp:
15911
* kjs/scope_chain.cpp:
15912
* kjs/scope_chain.h:
15913
* kjs/string_object.cpp:
15917
* kxmlcore/Assertions.mm:
15918
* kxmlcore/FastMalloc.cpp:
15919
(KXMLCore::InitSizeClasses):
15920
(KXMLCore::DLL_IsEmpty):
15921
(KXMLCore::DLL_Prepend):
15922
(KXMLCore::TCMalloc_Central_FreeList::Insert):
15923
(KXMLCore::TCMalloc_Central_FreeList::Remove):
15924
(KXMLCore::TCMalloc_Central_FreeList::Populate):
15925
(KXMLCore::TCMalloc_ThreadCache::Allocate):
15926
(KXMLCore::TCMalloc_ThreadCache::FetchFromCentralCache):
15927
(KXMLCore::fastMallocRegisterThread):
15928
(KXMLCore::TCMalloc_ThreadCache::GetCache):
15929
(KXMLCore::TCMalloc_ThreadCache::GetCacheIfPresent):
15930
(KXMLCore::TCMalloc_ThreadCache::CreateCacheIfNecessary):
15931
(KXMLCore::do_malloc):
15932
(KXMLCore::do_free):
15933
(KXMLCore::realloc):
15934
* kxmlcore/FastMalloc.h:
15938
(operator delete[]):
15939
* kxmlcore/HashTable.cpp:
15940
* kxmlcore/TCSpinLock.h:
15941
(TCMalloc_SpinLock::Lock):
15942
(TCMalloc_SpinLock::Unlock):
15943
(TCMalloc_SlowLock):
15944
* kxmlcore/TCSystemAlloc.cpp:
15946
2005-09-30 Geoffrey Garen <ggaren@apple.com>
15948
- Second cut at fixing <rdar://problem/4275206> Denver Regression: Seed:
15949
Past Editions of Opinions display "NAN/Undefined" for www.washingtonpost.com
15953
* kjs/date_object.cpp:
15954
(KJS::KRFCDate_parseDate): Intead of creating a timezone when one isn't specified,
15955
just rely on the fallback logic, which will do it for you. Also, return invalidDate
15956
if the date includes trailing garbage. (Somewhat accidentally, the timezone logic
15957
used to catch trailing garbage.)
15959
Added test case to fast/js/date-parse-test.html.
15961
2005-09-29 Eric Seidel <eseidel@apple.com>
15962
Fix from Mitz Pettel <opendarwin.org@mitzpettel.com>
15966
Fix JSC memory smasher in TOT.
15967
http://bugs.webkit.org/show_bug.cgi?id=5176
15969
* pcre/pcre_exec.c:
15972
2005-09-29 Eric Seidel <eseidel@apple.com>
15973
Fix from Mitz Pettel <opendarwin.org@mitzpettel.com>
15977
* JavaScriptCore.xcodeproj/project.pbxproj:
15978
Build fix for JSC+SVG after 5161.
15979
http://bugs.webkit.org/show_bug.cgi?id=5179
15981
2005-09-28 Geoffrey Garen <ggaren@apple.com>
15983
- Fixed <rdar://problem/4275206> Denver Regression: Seed: Past Editions of Opinions display
15984
"NAN/Undefined" for www.washingtonpost.com
15988
* kjs/date_object.cpp:
15989
(KJS::KRFCDate_parseDate): If the timezone isn't specified, rather than returning
15990
invalidDate, substitute the local timezone. This matches the behavior of FF/IE.
15992
2005-09-28 Maciej Stachowiak <mjs@apple.com>
15994
Patch from George Staikos, reviewed by me.
15996
- fixed some compile issues on Linux
15998
* kjs/property_slot.h:
15999
* kjs/simple_number.h:
16001
2005-09-27 Maciej Stachowiak <mjs@apple.com>
16005
- move HashMap/HashSet code down to JavaScriptCore
16006
http://bugs.webkit.org/show_bug.cgi?id=5161
16008
* JavaScriptCore.xcodeproj/project.pbxproj:
16009
* kjs/internal.cpp:
16010
(KJS::interpreterMap): Function that fetches the interpreter map on demand.
16011
(KJS::InterpreterImp::InterpreterImp): Replace use of InterpreterMap
16012
class with an appropriate HashMap.
16013
(KJS::InterpreterImp::clear): ditto
16014
(KJS::InterpreterImp::interpreterWithGlobalObject): ditto
16015
* kjs/interpreter_map.cpp: Removed.
16016
* kjs/interpreter_map.h: Removed.
16018
The HashMap/HashSet code (copied and slightly tweaked from WebCore)
16020
* kxmlcore/HashFunctions.h: Added.
16024
(KXMLCore::PointerHash::hash):
16025
(KXMLCore::PointerHash::equal):
16026
* kxmlcore/HashMap.h: Added.
16027
(KXMLCore::extractFirst):
16028
(KXMLCore::HashMap::HashMap):
16029
(KXMLCore::::size):
16030
(KXMLCore::::capacity):
16031
(KXMLCore::::isEmpty):
16032
(KXMLCore::::begin):
16034
(KXMLCore::::find):
16035
(KXMLCore::::contains):
16038
(KXMLCore::::remove):
16039
(KXMLCore::::clear):
16040
(KXMLCore::deleteAllValues):
16041
* kxmlcore/HashMapPtrSpec.h: Added.
16042
(KXMLCore::PointerHashIteratorAdapter::PointerHashIteratorAdapter):
16043
(KXMLCore::PointerHashIteratorAdapter::operator*):
16044
(KXMLCore::PointerHashIteratorAdapter::operator->):
16045
(KXMLCore::PointerHashIteratorAdapter::operator++):
16046
(KXMLCore::PointerHashIteratorAdapter::operator==):
16047
(KXMLCore::PointerHashIteratorAdapter::operator!=):
16048
(KXMLCore::PointerHashConstIteratorAdapter::PointerHashConstIteratorAdapter):
16049
(KXMLCore::PointerHashConstIteratorAdapter::operator*):
16050
(KXMLCore::PointerHashConstIteratorAdapter::operator->):
16051
(KXMLCore::PointerHashConstIteratorAdapter::operator++):
16052
(KXMLCore::PointerHashConstIteratorAdapter::operator==):
16053
(KXMLCore::PointerHashConstIteratorAdapter::operator!=):
16055
* kxmlcore/HashSet.h: Added.
16056
(KXMLCore::identityExtract):
16057
(KXMLCore::convertAdapter):
16058
(KXMLCore::HashSet::HashSet):
16059
(KXMLCore::::size):
16060
(KXMLCore::::capacity):
16061
(KXMLCore::::isEmpty):
16062
(KXMLCore::::begin):
16064
(KXMLCore::::find):
16065
(KXMLCore::::contains):
16066
(KXMLCore::::insert):
16067
(KXMLCore::::remove):
16068
(KXMLCore::::clear):
16069
* kxmlcore/HashTable.cpp: Added.
16070
(KXMLCore::HashTableStats::~HashTableStats):
16071
(KXMLCore::HashTableStats::recordCollisionAtCount):
16072
* kxmlcore/HashTable.h: Added.
16073
(KXMLCore::HashTableIterator::skipEmptyBuckets):
16074
(KXMLCore::HashTableIterator::HashTableIterator):
16075
(KXMLCore::HashTableIterator::operator*):
16076
(KXMLCore::HashTableIterator::operator->):
16077
(KXMLCore::HashTableIterator::operator++):
16078
(KXMLCore::HashTableIterator::operator==):
16079
(KXMLCore::HashTableIterator::operator!=):
16080
(KXMLCore::HashTableConstIterator::HashTableConstIterator):
16081
(KXMLCore::HashTableConstIterator::operator*):
16082
(KXMLCore::HashTableConstIterator::operator->):
16083
(KXMLCore::HashTableConstIterator::skipEmptyBuckets):
16084
(KXMLCore::HashTableConstIterator::operator++):
16085
(KXMLCore::HashTableConstIterator::operator==):
16086
(KXMLCore::HashTableConstIterator::operator!=):
16087
(KXMLCore::HashTable::HashTable):
16088
(KXMLCore::HashTable::~HashTable):
16089
(KXMLCore::HashTable::begin):
16090
(KXMLCore::HashTable::end):
16091
(KXMLCore::HashTable::size):
16092
(KXMLCore::HashTable::capacity):
16093
(KXMLCore::HashTable::insert):
16094
(KXMLCore::HashTable::isEmptyBucket):
16095
(KXMLCore::HashTable::isDeletedBucket):
16096
(KXMLCore::HashTable::isEmptyOrDeletedBucket):
16097
(KXMLCore::HashTable::hash):
16098
(KXMLCore::HashTable::equal):
16099
(KXMLCore::HashTable::identityConvert):
16100
(KXMLCore::HashTable::extractKey):
16101
(KXMLCore::HashTable::lookup):
16102
(KXMLCore::HashTable::shouldExpand):
16103
(KXMLCore::HashTable::mustRehashInPlace):
16104
(KXMLCore::HashTable::shouldShrink):
16105
(KXMLCore::HashTable::shrink):
16106
(KXMLCore::HashTable::clearBucket):
16107
(KXMLCore::HashTable::deleteBucket):
16108
(KXMLCore::HashTable::makeLookupResult):
16109
(KXMLCore::HashTable::makeIterator):
16110
(KXMLCore::HashTable::makeConstIterator):
16111
(KXMLCore::::lookup):
16112
(KXMLCore::::insert):
16113
(KXMLCore::::reinsert):
16114
(KXMLCore::::find):
16115
(KXMLCore::::contains):
16116
(KXMLCore::::remove):
16117
(KXMLCore::::allocateTable):
16118
(KXMLCore::::expand):
16119
(KXMLCore::::rehash):
16120
(KXMLCore::::clear):
16121
(KXMLCore::::HashTable):
16122
(KXMLCore::::swap):
16123
(KXMLCore::::operator):
16124
(KXMLCore::::checkTableConsistency):
16125
(KXMLCore::::checkTableConsistencyExceptSize):
16126
* kxmlcore/HashTraits.h: Added.
16127
(KXMLCore::HashTraits::emptyValue):
16129
(KXMLCore::PairHashTraits::emptyValue):
16130
(KXMLCore::PairHashTraits::deletedValue):
16132
2005-09-27 Darin Adler <darin@apple.com>
16134
Reviewed by Maciej.
16136
- update grammar to fix conflicts; fixes one of our test cases
16137
because it resolves the relationship between function expressions
16138
and declarations in the way required by the ECMA specification
16140
* kjs/grammar.y: Added lots of new grammar rules so we have no conflicts.
16141
A new set of rules for "no bracket or function at start of expression" and
16142
another set of rules for "no in anywhere in expression". Also simplified the
16143
handling of try to use only a single node and used operator precedence to
16144
get rid of the conflict in handling of if and else. Also used a macro to
16145
streamline the handling of automatic semicolons and changed parenthesis
16146
handling to use a virtual function.
16148
* kjs/nodes.h: Added nodeInsideAllParens, removed unused abortStatement.
16149
(KJS::TryNode::TryNode): Updated to hold catch and finally blocks directly instead
16150
of using a special node for each.
16152
(Node::createErrorCompletion): Added. Used instead of throwError when creating errors
16153
that should not be in a completion rather than an ExecState.
16154
(Node::throwUndefinedVariableError): Added. Sets source location unlike the call it
16156
(Node::nodeInsideAllParens): Added.
16157
(GroupNode::nodeInsideAllParens): Added.
16158
(StatListNode::execute): Removed code to move exceptions into completion objects;
16159
that's now done solely by the KJS_CHECKEXCEPTION macro.
16160
(TryNode::execute): Include execution of catch and finally here rather than using
16162
(FuncDeclNode::execute): Moved here, no longer inline.
16163
* kjs/nodes2string.cpp:
16164
(TryNode::streamTo): Updated for change.
16165
(FuncDeclNode::streamTo): Ditto.
16166
(FuncExprNode::streamTo): Ditto.
16168
* kjs/kjs-test: Removed. Was part of "make check".
16169
* kjs/kjs-test.chk: Ditto.
16170
* kjs/test.js: Ditto.
16172
* tests/mozilla/expected.html: Updated because one more test succeeds.
16174
2005-09-27 Adele Peterson <adele@apple.com>
16176
Reviewed by Maciej.
16178
Changed ints to size_t where appropriate.
16180
* kjs/collector.cpp:
16181
(KJS::Collector::allocate):
16182
(KJS::Collector::markStackObjectsConservatively):
16183
(KJS::Collector::collect):
16184
(KJS::Collector::size):
16185
(KJS::Collector::numInterpreters):
16186
(KJS::Collector::numGCNotAllowedObjects):
16187
(KJS::Collector::numReferencedObjects):
16190
2005-09-27 Eric Seidel <eseidel@apple.com>
16194
* JavaScriptCore.xcodeproj/project.pbxproj: fix after malloc changes.
16196
2005-09-27 Eric Seidel <eseidel@apple.com>
16201
(FuncExprNode::evaluate): Now sets .constructor properly.
16202
Test cases added to WebCore/layout-tests.
16203
http://bugs.webkit.org/show_bug.cgi?id=3537
16205
2005-09-26 Maciej Stachowiak <mjs@apple.com>
16209
- replace dlmalloc with tcmalloc
16210
http://bugs.webkit.org/show_bug.cgi?id=5145
16212
I also moved SharedPtr and the assertion code from WebCore into a
16213
new kxmlcore directory.
16215
* JavaScriptCore.xcodeproj/project.pbxproj:
16216
* kjs/collector.cpp:
16217
(KJS::Collector::allocate):
16218
(KJS::Collector::collect):
16220
* kjs/fast_malloc.cpp: Removed.
16221
* kjs/fast_malloc.h: Removed.
16222
* kjs/function.cpp:
16224
* kjs/function_object.cpp:
16225
* kjs/identifier.cpp:
16226
(KJS::Identifier::add):
16227
* kjs/internal.cpp:
16230
* kjs/nodes2string.cpp:
16231
* kjs/property_map.cpp:
16232
(KJS::PropertyMap::~PropertyMap):
16233
(KJS::PropertyMap::rehash):
16234
* kjs/scope_chain.h:
16235
* kjs/shared_ptr.h: Removed.
16236
* kjs/string_object.cpp:
16237
(StringObjectFuncImp::callAsFunction):
16239
(KJS::UString::Rep::createCopying):
16240
(KJS::UString::Rep::destroy):
16241
(KJS::UString::expandCapacity):
16242
(KJS::UString::expandPreCapacity):
16243
(KJS::UString::UString):
16244
(KJS::UString::spliceSubstringsWithSeparators):
16245
(KJS::UString::append):
16246
(KJS::UString::operator=):
16247
(KJS::UString::detach):
16249
* kxmlcore/Assertions.h: Added.
16250
* kxmlcore/Assertions.mm: Added.
16251
* kxmlcore/FastMalloc.cpp: Added.
16252
(KXMLCore::LgFloor):
16253
(KXMLCore::SizeClass):
16254
(KXMLCore::ByteSizeForClass):
16255
(KXMLCore::InitSizeClasses):
16256
(KXMLCore::MetaDataAlloc):
16257
(KXMLCore::PageHeapAllocator::Init):
16258
(KXMLCore::PageHeapAllocator::New):
16259
(KXMLCore::PageHeapAllocator::Delete):
16260
(KXMLCore::PageHeapAllocator::inuse):
16262
(KXMLCore::AllocationSize):
16264
(KXMLCore::NewSpan):
16265
(KXMLCore::DeleteSpan):
16266
(KXMLCore::DLL_Init):
16267
(KXMLCore::DLL_Remove):
16268
(KXMLCore::DLL_IsEmpty):
16269
(KXMLCore::DLL_Length):
16270
(KXMLCore::DLL_Print):
16271
(KXMLCore::DLL_Prepend):
16272
(KXMLCore::DLL_InsertOrdered):
16274
(KXMLCore::TCMalloc_PageHeap::GetDescriptor):
16275
(KXMLCore::TCMalloc_PageHeap::SystemBytes):
16276
(KXMLCore::TCMalloc_PageHeap::FreeBytes):
16277
(KXMLCore::TCMalloc_PageHeap::RecordSpan):
16278
(KXMLCore::TCMalloc_PageHeap::TCMalloc_PageHeap):
16279
(KXMLCore::TCMalloc_PageHeap::New):
16280
(KXMLCore::TCMalloc_PageHeap::Split):
16281
(KXMLCore::TCMalloc_PageHeap::Carve):
16282
(KXMLCore::TCMalloc_PageHeap::Delete):
16283
(KXMLCore::TCMalloc_PageHeap::RegisterSizeClass):
16284
(KXMLCore::TCMalloc_PageHeap::Dump):
16285
(KXMLCore::TCMalloc_PageHeap::GrowHeap):
16286
(KXMLCore::TCMalloc_PageHeap::Check):
16287
(KXMLCore::TCMalloc_PageHeap::CheckList):
16288
(KXMLCore::TCMalloc_ThreadCache_FreeList::Init):
16289
(KXMLCore::TCMalloc_ThreadCache_FreeList::length):
16290
(KXMLCore::TCMalloc_ThreadCache_FreeList::empty):
16291
(KXMLCore::TCMalloc_ThreadCache_FreeList::lowwatermark):
16292
(KXMLCore::TCMalloc_ThreadCache_FreeList::clear_lowwatermark):
16293
(KXMLCore::TCMalloc_ThreadCache_FreeList::Push):
16294
(KXMLCore::TCMalloc_ThreadCache_FreeList::Pop):
16295
(KXMLCore::TCMalloc_ThreadCache::freelist_length):
16296
(KXMLCore::TCMalloc_ThreadCache::Size):
16297
(KXMLCore::TCMalloc_Central_FreeList::length):
16298
(KXMLCore::TCMalloc_Central_FreeList::Init):
16299
(KXMLCore::TCMalloc_Central_FreeList::Insert):
16300
(KXMLCore::TCMalloc_Central_FreeList::Remove):
16301
(KXMLCore::TCMalloc_Central_FreeList::Populate):
16302
(KXMLCore::TCMalloc_ThreadCache::SampleAllocation):
16303
(KXMLCore::TCMalloc_ThreadCache::Init):
16304
(KXMLCore::TCMalloc_ThreadCache::Cleanup):
16305
(KXMLCore::TCMalloc_ThreadCache::Allocate):
16306
(KXMLCore::TCMalloc_ThreadCache::Deallocate):
16307
(KXMLCore::TCMalloc_ThreadCache::FetchFromCentralCache):
16308
(KXMLCore::TCMalloc_ThreadCache::ReleaseToCentralCache):
16309
(KXMLCore::TCMalloc_ThreadCache::Scavenge):
16310
(KXMLCore::TCMalloc_ThreadCache::GetCache):
16311
(KXMLCore::TCMalloc_ThreadCache::GetCacheIfPresent):
16312
(KXMLCore::TCMalloc_ThreadCache::PickNextSample):
16313
(KXMLCore::TCMalloc_ThreadCache::InitModule):
16314
(KXMLCore::TCMalloc_ThreadCache::InitTSD):
16315
(KXMLCore::TCMalloc_ThreadCache::CreateCacheIfNecessary):
16316
(KXMLCore::TCMalloc_ThreadCache::DeleteCache):
16317
(KXMLCore::TCMalloc_ThreadCache::RecomputeThreadCacheSize):
16318
(KXMLCore::TCMalloc_ThreadCache::Print):
16319
(KXMLCore::ExtractStats):
16320
(KXMLCore::DumpStats):
16321
(KXMLCore::PrintStats):
16322
(KXMLCore::DumpStackTraces):
16323
(KXMLCore::TCMallocImplementation::GetStats):
16324
(KXMLCore::TCMallocImplementation::ReadStackTraces):
16325
(KXMLCore::TCMallocImplementation::GetNumericProperty):
16326
(KXMLCore::TCMallocImplementation::SetNumericProperty):
16327
(KXMLCore::DoSampledAllocation):
16328
(KXMLCore::do_malloc):
16329
(KXMLCore::do_free):
16330
(KXMLCore::do_memalign):
16331
(KXMLCore::TCMallocGuard::TCMallocGuard):
16332
(KXMLCore::TCMallocGuard::~TCMallocGuard):
16333
(KXMLCore::malloc):
16335
(KXMLCore::calloc):
16337
(KXMLCore::realloc):
16338
(KXMLCore::memalign):
16339
(KXMLCore::posix_memalign):
16340
(KXMLCore::valloc):
16341
(KXMLCore::pvalloc):
16342
(KXMLCore::malloc_stats):
16343
(KXMLCore::mallopt):
16344
(KXMLCore::mallinfo):
16345
* kxmlcore/FastMalloc.h: Added.
16346
(KXMLCore::FastAllocated::operator new):
16347
(KXMLCore::FastAllocated::operator delete):
16348
(KXMLCore::FastAllocated::operator new[]):
16349
(KXMLCore::FastAllocated::operator delete[]):
16350
* kxmlcore/SharedPtr.h: Added.
16351
(KXMLCore::SharedPtr::SharedPtr):
16352
(KXMLCore::SharedPtr::~SharedPtr):
16353
(KXMLCore::SharedPtr::isNull):
16354
(KXMLCore::SharedPtr::notNull):
16355
(KXMLCore::SharedPtr::reset):
16356
(KXMLCore::SharedPtr::get):
16357
(KXMLCore::SharedPtr::operator*):
16358
(KXMLCore::SharedPtr::operator->):
16359
(KXMLCore::SharedPtr::operator!):
16360
(KXMLCore::SharedPtr::operator bool):
16361
(KXMLCore::::operator):
16362
(KXMLCore::operator==):
16363
(KXMLCore::operator!=):
16364
(KXMLCore::static_pointer_cast):
16365
(KXMLCore::const_pointer_cast):
16366
* kxmlcore/TCPageMap.h: Added.
16367
(TCMalloc_PageMap1::TCMalloc_PageMap1):
16368
(TCMalloc_PageMap1::Ensure):
16369
(TCMalloc_PageMap1::get):
16370
(TCMalloc_PageMap1::set):
16371
(TCMalloc_PageMap2::TCMalloc_PageMap2):
16372
(TCMalloc_PageMap2::get):
16373
(TCMalloc_PageMap2::set):
16374
(TCMalloc_PageMap2::Ensure):
16375
(TCMalloc_PageMap3::NewNode):
16376
(TCMalloc_PageMap3::TCMalloc_PageMap3):
16377
(TCMalloc_PageMap3::get):
16378
(TCMalloc_PageMap3::set):
16379
(TCMalloc_PageMap3::Ensure):
16380
* kxmlcore/TCSpinLock.h: Added.
16381
(TCMalloc_SpinLock::Init):
16382
(TCMalloc_SpinLock::Finalize):
16383
(TCMalloc_SpinLock::Lock):
16384
(TCMalloc_SpinLock::Unlock):
16385
(TCMalloc_SlowLock):
16386
(TCMalloc_SpinLockHolder::TCMalloc_SpinLockHolder):
16387
(TCMalloc_SpinLockHolder::~TCMalloc_SpinLockHolder):
16388
* kxmlcore/TCSystemAlloc.cpp: Added.
16392
(TCMalloc_SystemAlloc):
16393
* kxmlcore/TCSystemAlloc.h: Added.
16395
2005-09-23 Maciej Stachowiak <mjs@apple.com>
16399
<rdar://problem/4260479> Finish deploying PropertySlot in the interpreter
16400
http://bugs.webkit.org/show_bug.cgi?id=5112
16402
Convert postfix, prefix, delete, prefix, and for..in expressions to use
16403
PropertySlot-based lookup instead of evaluateReference.
16405
3% speedup on JS iBench.
16407
Fixed two of the JS tests:
16408
* tests/mozilla/expected.html:
16412
(PostfixResolveNode::evaluate):
16413
(PostfixBracketNode::evaluate):
16414
(PostfixDotNode::evaluate):
16415
(DeleteResolveNode::evaluate):
16416
(DeleteBracketNode::evaluate):
16417
(DeleteDotNode::evaluate):
16418
(DeleteValueNode::evaluate):
16419
(typeStringForValue):
16420
(TypeOfResolveNode::evaluate):
16421
(TypeOfValueNode::evaluate):
16422
(PrefixResolveNode::evaluate):
16423
(PrefixBracketNode::evaluate):
16424
(PrefixDotNode::evaluate):
16425
(ForInNode::execute):
16427
(KJS::PostfixResolveNode::PostfixResolveNode):
16428
(KJS::PostfixBracketNode::PostfixBracketNode):
16429
(KJS::PostfixDotNode::PostfixDotNode):
16430
(KJS::DeleteResolveNode::DeleteResolveNode):
16431
(KJS::DeleteBracketNode::DeleteBracketNode):
16432
(KJS::DeleteDotNode::DeleteDotNode):
16433
(KJS::DeleteValueNode::DeleteValueNode):
16434
(KJS::TypeOfResolveNode::TypeOfResolveNode):
16435
(KJS::TypeOfValueNode::TypeOfValueNode):
16436
(KJS::PrefixResolveNode::PrefixResolveNode):
16437
(KJS::PrefixBracketNode::PrefixBracketNode):
16438
(KJS::PrefixDotNode::PrefixDotNode):
16439
* kjs/nodes2string.cpp:
16440
(PostfixResolveNode::streamTo):
16441
(PostfixBracketNode::streamTo):
16442
(PostfixDotNode::streamTo):
16443
(DeleteResolveNode::streamTo):
16444
(DeleteBracketNode::streamTo):
16445
(DeleteDotNode::streamTo):
16446
(DeleteValueNode::streamTo):
16447
(TypeOfValueNode::streamTo):
16448
(TypeOfResolveNode::streamTo):
16449
(PrefixResolveNode::streamTo):
16450
(PrefixBracketNode::streamTo):
16451
(PrefixDotNode::streamTo):
16452
* kjs/reference.cpp:
16453
(KJS::Reference::Reference):
16454
(KJS::Reference::getPropertyName):
16455
(KJS::Reference::getValue):
16456
(KJS::Reference::deleteValue):
16459
2005-09-23 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
16461
Reviewed and landed by Darin.
16463
- a Windows-specific file
16465
* os-win32/stdint.h: Added. We plan to remove dependency on the <stdint.h> types,
16466
and if we do so, we will remove this file.
16468
2005-09-22 Geoffrey Garen <ggaren@apple.com>
16470
- Fixed http://bugs.webkit.org/show_bug.cgi?id=5053
16471
Need to restore int/long changes to simple_number.h
16473
Reviewed by darin and mjs.
16475
* kjs/simple_number.h: changed enums to indenpendent constants to clarify types
16476
(KJS::isNegativeZero): changed to static function - no reason to export
16477
(KJS::SimpleNumber::rightShiftSignExtended): new function for clarity
16478
(KJS::SimpleNumber::make): specified cast as reinterpret_cast
16479
(KJS::SimpleNumber::is): changed to use uintptr_t for portability
16480
(KJS::SimpleNumber::value): changed to use uintptr_t and rightShiftSignExtended
16481
(KJS::SimpleNumber::fits): inverted tests - probably only a performance win for double
16482
(KJS::SimpleNumber::integerFits): ditto
16484
2005-09-20 Maciej Stachowiak <mjs@apple.com>
16486
Reviewed by Geoff and partly by Darin.
16488
- fixed http://bugs.webkit.org/post_bug.cgi
16489
(Reduce conflicts in JavaScriptCore grammar)
16491
This change gets us down from over 200 shift/reduce and 45 reduce/reduce to
16492
9 shift/reduce and 45 reduce/reduce.
16495
* kjs/grammar_types.h: Removed.
16498
(KJS::Node::isGroupNode):
16499
(KJS::Node::isLocation):
16500
(KJS::Node::isResolveNode):
16501
(KJS::Node::isBracketAccessorNode):
16502
(KJS::Node::isDotAccessorNode):
16503
(KJS::ResolveNode::isLocation):
16504
(KJS::ResolveNode::isResolveNode):
16505
(KJS::ResolveNode::identifier):
16506
(KJS::GroupNode::isGroupNode):
16507
(KJS::GroupNode::leafNode):
16508
(KJS::BracketAccessorNode::isLocation):
16509
(KJS::BracketAccessorNode::isBracketAccessorNode):
16510
(KJS::BracketAccessorNode::base):
16511
(KJS::BracketAccessorNode::subscript):
16512
(KJS::DotAccessorNode::isLocation):
16513
(KJS::DotAccessorNode::isDotAccessorNode):
16514
(KJS::DotAccessorNode::base):
16515
(KJS::DotAccessorNode::identifier):
16516
(KJS::FuncExprNode::FuncExprNode):
16517
(KJS::FuncExprNode::identifier):
16518
(KJS::FuncDeclNode::FuncDeclNode):
16519
(KJS::FuncDeclNode::execute):
16521
2005-09-20 Geoffrey Garen <ggaren@apple.com>
16523
- Oops. The 4263434 change was only appropriate on the branch. Rolling out.
16527
* kjs/internal.cpp:
16528
(KJS::InterpreterImp::mark):
16530
2005-09-20 Geoffrey Garen <ggaren@apple.com>
16532
- More changes needed to fix <rdar://problem/4214783> 8F29 REGRESSION(Denver/Chardonnay):
16533
kjs_fast_malloc crash due to lack of locking on multiple threads (seen selecting volumes in
16536
Added InterpreterLocks in some places in the bindings we missed before.
16540
* bindings/runtime_root.cpp:
16541
(KJS::Bindings::addNativeReference):
16542
(KJS::Bindings::removeNativeReference):
16543
(RootObject::removeAllNativeReferences):
16544
* bindings/runtime_root.h:
16545
(KJS::Bindings::RootObject::~RootObject):
16546
(KJS::Bindings::RootObject::setRootObjectImp):
16548
2005-09-20 Geoffrey Garen <ggaren@apple.com>
16550
- Fixed <rdar://problem/4263434> <rdar://problem/4263434> Denver 8F29 Regression:
16551
KJS::InterpreterImp::mark() crash
16553
Fix by mjs, review by me.
16555
* kjs/internal.cpp:
16556
(KJS::InterpreterImp::mark): Added a null check on globExec in case a
16557
garbage collection occurs inside InterpreterImp::globalInit (called
16558
from InterpreterImp::InterpreterImp), at which point globExec has not yet been initialized.
16560
2005-09-20 Geoffrey Garen <ggaren@apple.com>
16562
- Rolled in fix for http://bugs.webkit.org/show_bug.cgi?id=4892
16563
Date constructor has problems with months larger than 11
16567
* layout-tests/fast/js/date-big-constructor-expected.txt: Added.
16568
* layout-tests/fast/js/date-big-constructor.html: Added.
16572
* kjs/date_object.cpp:
16573
(KJS::fillStructuresUsingDateArgs):
16576
2005-09-19 Geoffrey Garen <ggaren@apple.com>
16578
- Fixed http://bugs.webkit.org/show_bug.cgi?id=5028
16579
9 layout tests fail following the change from long to int
16581
- Rolled out changes to simple_number.h, and added fits(long long)
16582
and SimpleNumber::fits(unsigned long long) to the old system.
16586
* kjs/simple_number.h:
16587
(KJS::SimpleNumber::):
16588
(KJS::SimpleNumber::value):
16589
(KJS::SimpleNumber::fits):
16590
(KJS::SimpleNumber::integerFits):
16591
(KJS::SimpleNumber::make):
16593
2005-09-14 Maciej Stachowiak <mjs@apple.com>
16597
- fixed <rdar://problem/4214783> REGRESSION: kjs_fast_malloc crash due to lack of locking on multiple threads (seen selecting volumes in the installer)
16599
Make sure to lock using the InterpreterLock class in all places that need it
16600
(including anything that uses the collector, the parser, the protect count hash table,
16601
and anything that allocates via fast_malloc).
16603
Also added assertions to ensure that the locking rules are followed for the relevant
16607
* bindings/NP_jsobject.cpp:
16608
(identifierFromNPIdentifier):
16611
(_NPN_GetProperty):
16612
(_NPN_SetProperty):
16613
(_NPN_RemoveProperty):
16614
(_NPN_HasProperty):
16616
(_NPN_SetException):
16617
* bindings/jni/jni_jsobject.cpp:
16620
(JSObject::getMember):
16621
(JSObject::setMember):
16622
(JSObject::removeMember):
16623
(JSObject::getSlot):
16624
(JSObject::setSlot):
16625
(JSObject::toString):
16626
(JSObject::convertJObjectToValue):
16627
* bindings/objc/WebScriptObject.mm:
16628
(-[WebScriptObject callWebScriptMethod:withArguments:]):
16629
(-[WebScriptObject evaluateWebScript:]):
16630
(-[WebScriptObject setValue:forKey:]):
16631
(-[WebScriptObject valueForKey:]):
16632
(-[WebScriptObject removeWebScriptKey:]):
16633
(-[WebScriptObject stringRepresentation]):
16634
(-[WebScriptObject webScriptValueAtIndex:]):
16635
(-[WebScriptObject setWebScriptValueAtIndex:value:]):
16636
(+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
16637
* bindings/runtime.cpp:
16638
(Instance::createRuntimeObject):
16639
* bindings/runtime_root.h:
16640
* bindings/testbindings.cpp:
16642
* bindings/testbindings.mm:
16644
* kjs/fast_malloc.cpp:
16645
(KJS::kjs_fast_malloc):
16646
(KJS::kjs_fast_calloc):
16647
(KJS::kjs_fast_free):
16648
(KJS::kjs_fast_realloc):
16649
* kjs/fast_malloc.h:
16650
* kjs/identifier.h:
16651
* kjs/internal.cpp:
16652
(InterpreterImp::InterpreterImp):
16653
(InterpreterImp::clear):
16654
(InterpreterImp::mark):
16655
(InterpreterImp::checkSyntax):
16656
(InterpreterImp::evaluate):
16658
(KJS::InterpreterImp::globalObject):
16659
* kjs/interpreter.cpp:
16660
(Interpreter::evaluate):
16661
* kjs/interpreter.h:
16662
(KJS::InterpreterLock::InterpreterLock):
16663
(KJS::InterpreterLock::~InterpreterLock):
16666
(KJS::ProtectedValue::ProtectedValue):
16667
(KJS::ProtectedValue::~ProtectedValue):
16668
(KJS::ProtectedValue::operator=):
16669
(KJS::ProtectedObject::ProtectedObject):
16670
(KJS::ProtectedObject::~ProtectedObject):
16671
(KJS::ProtectedObject::operator=):
16672
(KJS::ProtectedReference::ProtectedReference):
16673
(KJS::ProtectedReference::~ProtectedReference):
16674
(KJS::ProtectedReference::operator=):
16675
* kjs/protected_object.h:
16676
* kjs/protected_values.cpp:
16677
(KJS::ProtectedValues::getProtectCount):
16678
(KJS::ProtectedValues::increaseProtectCount):
16679
(KJS::ProtectedValues::decreaseProtectCount):
16680
* kjs/string_object.cpp:
16681
(StringObjectImp::StringObjectImp):
16685
2005-09-16 Adele Peterson <adele@apple.com>
16687
Change by Darin, reviewed by me and Maciej.
16689
Fixes http://bugs.webkit.org/show_bug.cgi?id=4547
16690
use int instead of long for 32-bit (to prepare for LP64 compiling)
16692
* bindings/c/c_class.h:
16693
(KJS::Bindings::CClass::constructorAt):
16694
(KJS::Bindings::CClass::numConstructors):
16695
* bindings/c/c_runtime.h:
16696
(KJS::Bindings::CMethod::numParameters):
16697
* bindings/jni/jni_class.cpp:
16698
(JavaClass::JavaClass):
16699
* bindings/jni/jni_class.h:
16700
(KJS::Bindings::JavaClass::constructorAt):
16701
(KJS::Bindings::JavaClass::numConstructors):
16702
* bindings/jni/jni_instance.cpp:
16703
(JavaInstance::invokeMethod):
16704
* bindings/jni/jni_jsobject.cpp:
16705
(JSObject::convertJObjectToValue):
16706
(JSObject::listFromJArray):
16707
* bindings/jni/jni_runtime.cpp:
16708
(JavaMethod::JavaMethod):
16709
* bindings/jni/jni_runtime.h:
16710
(KJS::Bindings::JavaConstructor::_commonCopy):
16711
(KJS::Bindings::JavaConstructor::parameterAt):
16712
(KJS::Bindings::JavaConstructor::numParameters):
16713
(KJS::Bindings::JavaMethod::_commonCopy):
16714
(KJS::Bindings::JavaMethod::parameterAt):
16715
(KJS::Bindings::JavaMethod::numParameters):
16716
* bindings/npapi.h:
16717
* bindings/objc/WebScriptObject.mm:
16719
* bindings/objc/objc_class.h:
16720
(KJS::Bindings::ObjcClass::constructorAt):
16721
(KJS::Bindings::ObjcClass::numConstructors):
16722
* bindings/objc/objc_instance.h:
16723
* bindings/objc/objc_runtime.h:
16724
* bindings/objc/objc_runtime.mm:
16725
(ObjcMethod::numParameters):
16726
* bindings/runtime.h:
16727
* kjs/identifier.h:
16729
* kjs/property_slot.h:
16730
(KJS::PropertySlot::setCustomIndex):
16731
(KJS::PropertySlot::index):
16732
(KJS::PropertySlot::):
16733
* kjs/regexp_object.cpp:
16734
(RegExpObjectImp::backrefGetter):
16735
(RegExpObjectImp::getOwnPropertySlot):
16736
* kjs/simple_number.h:
16737
(KJS::SimpleNumber::):
16738
(KJS::SimpleNumber::value):
16739
(KJS::SimpleNumber::fits):
16740
(KJS::SimpleNumber::integerFits):
16741
(KJS::SimpleNumber::make):
16742
* kjs/string_object.cpp:
16743
(substituteBackreferences):
16745
(KJS::UString::from):
16746
(KJS::UString::toUInt32):
16747
(KJS::UString::find):
16748
(KJS::UString::rfind):
16754
2005-09-11 Eric Seidel <eseidel@apple.com>
16756
No review requested, build fix affects only SVG.
16758
* JavaScriptCore.xcodeproj/project.pbxproj: Fixed JSC+SVG
16759
Fixed JavaScriptCore+SVG after PCRE 6.1 merger.
16760
http://bugs.webkit.org/show_bug.cgi?id=4932
16762
2005-09-10 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
16764
Reviewed and landed by Darin.
16766
* Makefile.vc: Added.
16767
* README-Win32.txt: Added.
16769
2005-09-10 Darin Adler <darin@apple.com>
16771
- fixed compilation for WebCore (another try)
16773
* kjs/simple_number.h: Added more "using" lines.
16775
2005-09-10 Darin Adler <darin@apple.com>
16777
- fixed compilation for WebCore
16779
* kjs/simple_number.h: Have to include <cmath> here to work around a bug in the GCC
16780
standard C++ library headers.
16782
2005-09-10 Darin Adler <darin@apple.com>
16784
Windows changes by Krzysztof Kowalczyk <kkowalczyk@gmail.com>.
16786
- fixed http://bugs.webkit.org/show_bug.cgi?id=4870
16787
win portability: fix IS_NEGATIVE_ZERO macro in simple_number.h
16789
* kjs/simple_number.h:
16790
(KJS::isNegativeZero): Added. Inline function. Has a case for Windows that
16791
uses _fpclass and a case for other platforms that uses signbit.
16792
(KJS::SimpleNumber::fits): Use inline isNegativeZero instead of macro IS_NEGATIVE_ZERO.
16794
* kjs/internal.cpp: Remove definition of now-unneeded negZero global.
16796
* kjs/value.cpp: Touched the file because Xcode didn't know it needed to
16799
- improved test engine
16801
* tests/mozilla/jsDriver.pl: Sort tests in numeric order instead of using
16802
a plain-ASCII sort; now test 33 will be after test 5 in any given set of
16805
2005-09-08 Darin Adler <darin@apple.com>
16807
- fixed overloaded versions of throwError so that they substitute *all*
16808
expected parameters into the message string -- some versions used to
16809
skip parameters, resulting in "%s" being printed in the error message.
16813
* kjs/nodes.h: Updated declarations to use "const &" and not to name parameters
16814
* kjs/nodes.cpp: (Node::throwError): Updated to match above and add one missing
16815
call to substitute.
16817
2005-09-08 Darin Adler <darin@apple.com>
16821
- updated to PCRE 6.1
16823
The original PCRE 6.1 sources are checked into the tree with the tag
16824
"pcre-6-1" for reference. What we're checking in right now is the original
16825
plus our changes to make it support UTF-16 and at least one other tweak
16826
(vertical tab considered whitespace). Our work to get our changes was
16827
done on "pcre-6-1-branch", with an anchor at "pcre-6-1-anchor" so you can
16828
see the evolution of the UTF-16 changes.
16830
Note also that there was one small change made here that's not on the branch
16833
* Info.plist: Updated the part of the copyright message that's about PCRE.
16835
* JavaScriptCore.xcodeproj/project.pbxproj: Added new PCRE source files,
16836
removed obsolete ones.
16838
* pcre/AUTHORS: Updated to PCRE 6.1. Includes credits for Apple's UTF-16
16839
changes, but not the credits for Google's C++ wrapper, since we don't include that.
16840
* pcre/COPYING: Updated to PCRE 6.1.
16841
* pcre/LICENCE: Ditto.
16842
* pcre/dftables.c: Ditto.
16843
* pcre/pcre-config.h: Ditto.
16844
* pcre/pcre.h: Ditto.
16846
* pcre/pcre_compile.c: Added for PCRE 6.1.
16847
* pcre/pcre_config.c: Ditto.
16848
* pcre/pcre_exec.c: Ditto.
16849
* pcre/pcre_fullinfo.c: Ditto.
16850
* pcre/pcre_get.c: Ditto.
16851
* pcre/pcre_globals.c: Ditto.
16852
* pcre/pcre_info.c: Ditto.
16853
* pcre/pcre_internal.h: Ditto.
16854
* pcre/pcre_maketables.c: Ditto.
16855
* pcre/pcre_ord2utf8.c: Ditto.
16856
* pcre/pcre_printint.c: Ditto.
16857
* pcre/pcre_refcount.c: Ditto.
16858
* pcre/pcre_study.c: Ditto.
16859
* pcre/pcre_tables.c: Ditto.
16860
* pcre/pcre_try_flipped.c: Ditto.
16861
* pcre/pcre_ucp_findchar.c: Ditto.
16862
* pcre/pcre_version.c: Ditto.
16863
* pcre/pcre_xclass.c: Ditto.
16864
* pcre/ucp.h: Ditto.
16865
* pcre/ucp_findchar.c: Ditto.
16866
* pcre/ucpinternal.h: Ditto.
16867
* pcre/ucptable.c: Ditto.
16869
* pcre/get.c: Removed.
16870
* pcre/internal.h: Removed.
16871
* pcre/maketables.c: Removed.
16872
* pcre/pcre.c: Removed.
16873
* pcre/study.c: Removed.
16875
2005-09-07 Geoffrey Garen <ggaren@apple.com>
16877
-fixed http://bugs.webkit.org/show_bug.cgi?id=4781
16878
Date.setMonth fails with big values due to overflow
16882
* kjs/date_object.cpp:
16883
(timetUsingCF): for consistency, changed return statement to invalidDate instead of LONG_MAX
16884
(KJS::fillStructuresUsingTimeArgs): modified for readability
16885
(KJS::fillStructuresUsingDateArgs): new function analogous to fillStructuresUsingTimeArgs
16886
(KJS::DateProtoFuncImp::callAsFunction): modified to use fillStructuresUsingDateArgs
16887
(KJS::DateObjectImp::construct): moved variable declaration to proper scope
16888
(KJS::DateObjectFuncImp::callAsFunction): moved variable declaration to proper scope
16890
2005-09-07 Geoffrey Garen <ggaren@apple.com>
16891
-updated expected test results to reflect fix for
16892
http://bugs.webkit.org/show_bug.cgi?id=4698
16893
kjs does not allow named functions in function expressions
16895
* tests/mozilla/expected.html:
16897
2005-09-04 Darin Adler <darin@apple.com>
16899
* kjs/identifier.cpp: Fix comment, add missing include.
16900
(Follow-on to changes from yesterday.)
16902
2005-09-03 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
16904
Reviewed, tweaked and landed by Darin.
16906
- another try at some of the Windows compilation fixes
16907
should fix these bugs: 4546, 4831, 4834, 4643, 4830, 4832, 4833, 4835
16909
* kjs/collector.cpp: Add missing <setjmp.h> include.
16910
* kjs/date_object.cpp: Fix broken copysign macro.
16911
* kjs/dtoa.cpp: Move macro definitions down after all header includes.
16912
* kjs/fast_malloc.cpp: Add missing <assert.h> and <stddef.h> includes.
16913
* kjs/function.cpp: Remove broken isxdigit definition.
16914
* kjs/grammar.y: Add a missing semicolon (and remove an excess one).
16915
* kjs/identifier.cpp: Turn off AVOID_STATIC_CONSTRUCTORS because the placement new syntax
16916
doesn't seem to work in Visual C++ (I'm surprised to hear that, by the way).
16917
* kjs/value.h: Made ValueImp's destructor virtual because otherwise pointers to ValueImp
16918
on the stack aren't right for garbage collection on Windows (don't think it works that
16919
way with gcc's virtual table scheme, but it's a harmless change).
16921
2005-09-03 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
16923
Reviewed, tweaked and landed by Darin.
16925
- some Windows compilation fixes, hoping to fix the problems reported in these bugs:
16926
4627, 4629, 4630, 4631, 4632, 4633, 4634, 4635, 4636, 4637, 4639, 4640, 4641, 4644, 4645
16928
* kjs/collector.cpp: Include <windows.h> on WIN32. Put thread-related code inside
16929
KJS_MULTIPLE_THREADS #if directives.
16930
(KJS::Collector::markCurrentThreadConservatively): Use NT_TIB to find the stack base on Win32.
16932
* kjs/config.h: Define HAVE_SYS_TIMEB_H for Win32.
16934
* kjs/date_object.cpp: Add include of <limits.h>. Add definitions of strncasecmp, isfinite, and
16935
copysign for Win32.
16936
(KJS::KRFCDate_parseDate): Move "errno = 0" line down closer to the first call to strol -- I believe
16937
that on Win32 there's some other call before that setting errno.
16939
* kjs/date_object.h: Remove unneeded include of <sys/time.h>.
16941
* kjs/dtoa.cpp: Add an undef of strtod, needed on Win32.
16943
* kjs/fast_malloc.cpp: Put #if !WIN32 around some customization that's not appropriate on Win32.
16944
(KJS::region_list_append): Add a missing cast so this Win32-specific function compiles in C++.
16945
(KJS::sbrk): Change parameter type to match the declaration.
16947
* kjs/function.cpp: (isxdigit): Define a locale-independent isxdigit on Win32.
16949
* kjs/function.h: Remove unneeded friend class Function for FunctionImp.
16951
* kjs/identifier.cpp: Took out the APPLE_CHANGES from around the AVOID_STATIC_CONSTRUCTORS
16952
define. We ultimately intend to phase out APPLE_CHANGES entirely. Also fix the
16953
non-AVOID_STATIC_CONSTRUCTORS code path.
16955
* kjs/internal.cpp: Remove uneeded include of <strings.h>, which was confused with <string.h>!
16956
Add a Win32 implementation of copysign. Put the threads code inside KJS_MULTIPLE_THREADS.
16958
* kjs/internal.h: Define a KJS_MULTIPLE_THREADS macro on non-Win32 only. Later we can make this
16959
specific to Mac OS X if we like.
16961
* kjs/interpreter_map.cpp: Add missing include of <stdlib.h>.
16964
(KJS::ListImp::markValues): Use std::min instead of MIN.
16965
(KJS::List::copy): Ditto.
16966
(KJS::List::copyTail): Ditto.
16968
* kjs/math_object.cpp: (signbit): Add a Win32 implementation of signbit.
16970
* kjs/nodes.cpp: (Node::finalCheck): Use unsigned instead of uint.
16971
Put the use of always_inline inside __GNUC__.
16973
* kjs/number_object.cpp: (NumberProtoFuncImp::callAsFunction): Use "10.0" instead of "10"
16974
inside all the calls to pow to avoid ambiguity caused by overloading of pow on Win32, seen
16975
when passing an int rather than a double or float.
16977
* kjs/operations.cpp:
16978
(KJS::isInf): Add Win32 implementation.
16979
(KJS::isPosInf): Add Win32 implementation.
16980
(KJS::isNegInf): Add Win32 implementation.
16982
* kjs/regexp.cpp: Use unsigned instead of uint.
16983
* kjs/regexp.h: Ditto.
16984
* kjs/regexp_object.cpp: Ditto.
16985
* kjs/regexp_object.h: Ditto.
16987
2005-09-02 Beth Dakin <bdakin@apple.com>
16989
Fix for <rdar://problem/4235531> Denver Regression: Safari crash in KWQStringData::makeUnicode
16990
The other half of the fix is in WebCore.
16992
Fix written by Maciej and Darin.
16993
Reviewed by me/Maciej
16995
As Maciej said in Radar: These problems was caused by a conflict between some of our custom
16996
allocators, causing them to return null. Symptom is typically a null pointer dereference in
16997
a place where it might be expected an allocation has just occurred.
16999
* kjs/fast_malloc.cpp: Added #define for MORECORE_CONTIGUOUS, MORECORE_CANNOT_TRIM,
17000
and MALLOC_FAILURE_ACTION.
17002
2005-08-31 Geoffrey Garen <ggaren@apple.com>
17004
-rolled in fix for http://bugs.webkit.org/show_bug.cgi?id=4698
17005
kjs does not allow named functions in function expressions
17007
Fix by Arthur Langereis.
17013
(FuncExprNode::evaluate):
17015
(KJS::FuncExprNode::FuncExprNode):
17019
* layout-tests/fast/js/named-function-expression-expected.txt: Added.
17020
* layout-tests/fast/js/named-function-expression.html: Added.
17022
2005-08-31 Justin Haygood <justin@xiondigital.net>
17024
Reviewed, tweaked, and landed by Darin.
17026
- fixed http://bugs.webkit.org/show_bug.cgi?id=4085
17027
- fixed http://bugs.webkit.org/show_bug.cgi?id=4087
17028
- fixed http://bugs.webkit.org/show_bug.cgi?id=4096
17029
Some fixes for compiling on windows.
17031
* kjs/config.h: Added a WIN32 case in here, with suitable defines.
17032
(To be tweaked as necessary.)
17033
* kjs/function.cpp: Took out APPLE_CHANGES around use of ICU.
17034
* kjs/operations.cpp: Removed some bogus code that always set HAVE_FLOAT_H.
17036
2005-08-30 Darin Adler <darin@apple.com>
17038
Reviewed by John Sullivan.
17040
- fixed http://bugs.webkit.org/show_bug.cgi?id=4758
17041
unify SharedPtr in WebCore and JavaScriptCore
17043
* kjs/shared_ptr.h: Updated namespace to KXMLCore instead of kxhmlcore.
17044
Made a few small improvements to use local variables a bit more and added
17045
an "operator int" to reduce the chance that we'll convert a SharedPtr to
17046
an int by accident. Also made the == operators normal functions rather than
17047
friend functions, added a couple of comemnts.
17049
* kjs/function.h: Updated for namespace change.
17050
* kjs/function.cpp: Ditto.
17051
* kjs/function_object.cpp: Ditto.
17052
* kjs/internal.h: Ditto.
17053
* kjs/internal.cpp: Ditto.
17054
* kjs/nodes.h: Ditto.
17055
* kjs/nodes2string.cpp: Ditto.
17057
2005-08-26 Maciej Stachowiak <mjs@apple.com>
17061
<rdar://problem/4224911> many many leaks in kjsyyparse with malformed Javascript
17063
Record all nodes that are created during parsing, and delete any
17064
that are left floating with a refcount of 0.
17066
* kjs/internal.cpp:
17067
(KJS::Parser::saveNewNode):
17068
(KJS::clearNewNodes):
17069
(KJS::Parser::parse):
17074
(KJS::Node::refcount):
17076
2005-08-26 Maciej Stachowiak <mjs@apple.com>
17080
- fixed <rdar://problem/4232452> many many leaks in kjsyyparse on some well-formed JavaScript (can repro on sony.com, webkit tests)
17082
Fixed by changing the refcounting scheme for nodes. Instead of each node implementing a custom ref and
17083
deref for all its children (and being responsible for deleting them), nodes use a smart pointer to
17084
hold their children, and smart pointers are used outside the node tree as well. This change mostly
17087
* JavaScriptCore.xcodeproj/project.pbxproj:
17088
* kjs/function.cpp:
17089
(KJS::DeclaredFunctionImp::DeclaredFunctionImp):
17090
(KJS::GlobalFuncImp::callAsFunction):
17092
* kjs/function_object.cpp:
17093
(FunctionObjectImp::construct):
17095
* kjs/internal.cpp:
17096
(KJS::Parser::parse):
17097
(KJS::Parser::accept):
17098
(KJS::InterpreterImp::checkSyntax):
17099
(KJS::InterpreterImp::evaluate):
17104
(ElementNode::evaluate):
17105
(PropertyValueNode::evaluate):
17106
(ArgumentListNode::evaluateList):
17107
(NewExprNode::evaluate):
17108
(FunctionCallValueNode::evaluate):
17109
(FunctionCallBracketNode::evaluate):
17110
(FunctionCallDotNode::evaluate):
17111
(RelationalNode::evaluate):
17112
(StatListNode::execute):
17113
(StatListNode::processVarDecls):
17114
(VarDeclListNode::evaluate):
17115
(VarDeclListNode::processVarDecls):
17116
(ForInNode::ForInNode):
17117
(ClauseListNode::processVarDecls):
17118
(CaseBlockNode::evalBlock):
17119
(FuncDeclNode::processFuncDecl):
17120
(FuncExprNode::evaluate):
17121
(SourceElementsNode::execute):
17122
(SourceElementsNode::processFuncDecl):
17123
(SourceElementsNode::processVarDecls):
17126
(KJS::Node::deref):
17127
(KJS::NumberNode::NumberNode):
17128
(KJS::GroupNode::GroupNode):
17129
(KJS::ElementNode::ElementNode):
17130
(KJS::ArrayNode::ArrayNode):
17131
(KJS::PropertyValueNode::PropertyValueNode):
17132
(KJS::ObjectLiteralNode::ObjectLiteralNode):
17133
(KJS::BracketAccessorNode::BracketAccessorNode):
17134
(KJS::DotAccessorNode::DotAccessorNode):
17135
(KJS::ArgumentListNode::ArgumentListNode):
17136
(KJS::ArgumentsNode::ArgumentsNode):
17137
(KJS::NewExprNode::NewExprNode):
17138
(KJS::FunctionCallValueNode::FunctionCallValueNode):
17139
(KJS::FunctionCallResolveNode::FunctionCallResolveNode):
17140
(KJS::FunctionCallBracketNode::FunctionCallBracketNode):
17141
(KJS::FunctionCallDotNode::FunctionCallDotNode):
17142
(KJS::PostfixNode::PostfixNode):
17143
(KJS::DeleteNode::DeleteNode):
17144
(KJS::VoidNode::VoidNode):
17145
(KJS::TypeOfNode::TypeOfNode):
17146
(KJS::PrefixNode::PrefixNode):
17147
(KJS::UnaryPlusNode::UnaryPlusNode):
17148
(KJS::NegateNode::NegateNode):
17149
(KJS::BitwiseNotNode::BitwiseNotNode):
17150
(KJS::LogicalNotNode::LogicalNotNode):
17151
(KJS::MultNode::MultNode):
17152
(KJS::AddNode::AddNode):
17153
(KJS::ShiftNode::ShiftNode):
17154
(KJS::RelationalNode::RelationalNode):
17155
(KJS::EqualNode::EqualNode):
17156
(KJS::BitOperNode::BitOperNode):
17157
(KJS::BinaryLogicalNode::BinaryLogicalNode):
17158
(KJS::ConditionalNode::ConditionalNode):
17159
(KJS::AssignResolveNode::AssignResolveNode):
17160
(KJS::AssignBracketNode::AssignBracketNode):
17161
(KJS::AssignDotNode::AssignDotNode):
17162
(KJS::CommaNode::CommaNode):
17163
(KJS::AssignExprNode::AssignExprNode):
17164
(KJS::VarDeclListNode::VarDeclListNode):
17165
(KJS::VarStatementNode::VarStatementNode):
17166
(KJS::ExprStatementNode::ExprStatementNode):
17167
(KJS::IfNode::IfNode):
17168
(KJS::DoWhileNode::DoWhileNode):
17169
(KJS::WhileNode::WhileNode):
17170
(KJS::ForNode::ForNode):
17171
(KJS::ReturnNode::ReturnNode):
17172
(KJS::WithNode::WithNode):
17173
(KJS::CaseClauseNode::CaseClauseNode):
17174
(KJS::ClauseListNode::ClauseListNode):
17175
(KJS::ClauseListNode::clause):
17176
(KJS::ClauseListNode::next):
17177
(KJS::SwitchNode::SwitchNode):
17178
(KJS::LabelNode::LabelNode):
17179
(KJS::ThrowNode::ThrowNode):
17180
(KJS::CatchNode::CatchNode):
17181
(KJS::FinallyNode::FinallyNode):
17182
(KJS::TryNode::TryNode):
17183
(KJS::ParameterNode::ParameterNode):
17184
(KJS::ParameterNode::nextParam):
17185
(KJS::FuncDeclNode::FuncDeclNode):
17186
(KJS::FuncExprNode::FuncExprNode):
17187
* kjs/nodes2string.cpp:
17188
(KJS::SourceStream::operator<<):
17189
(ElementNode::streamTo):
17190
(PropertyValueNode::streamTo):
17191
(ArgumentListNode::streamTo):
17192
(StatListNode::streamTo):
17193
(VarDeclListNode::streamTo):
17194
(CaseBlockNode::streamTo):
17195
(ParameterNode::streamTo):
17196
(SourceElementsNode::streamTo):
17197
* kjs/shared_ptr.h: Added.
17198
(kxmlcore::SharedPtr::SharedPtr):
17199
(kxmlcore::SharedPtr::~SharedPtr):
17200
(kxmlcore::SharedPtr::isNull):
17201
(kxmlcore::SharedPtr::notNull):
17202
(kxmlcore::SharedPtr::reset):
17203
(kxmlcore::SharedPtr::get):
17204
(kxmlcore::SharedPtr::operator*):
17205
(kxmlcore::SharedPtr::operator->):
17206
(kxmlcore::SharedPtr::operator!):
17207
(kxmlcore::SharedPtr::operator bool):
17208
(kxmlcore::SharedPtr::operator==):
17209
(kxmlcore::::operator):
17210
(kxmlcore::operator!=):
17211
(kxmlcore::static_pointer_cast):
17212
(kxmlcore::const_pointer_cast):
17214
2005-08-26 Geoff Garen <ggaren@apple.com>
17219
- fixed http://bugs.webkit.org/show_bug.cgi?id=4664
17220
TOT Crash from backwards null check in WebScriptObject.mm
17222
* bindings/objc/WebScriptObject.mm:
17223
(+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:]):
17226
2005-08-25 Darin Adler <darin@apple.com>
17228
Reviewed by John Sullivan.
17230
- rename KJS::UString::string() to KJS::UString::domString()
17231
- rename KJS::Identifier::string() to KJS::Identifier::domString()
17233
* kjs/identifier.h: Renamed.
17234
* kjs/ustring.h: Ditto.
17236
2005-08-19 Darin Adler <darin@apple.com>
17238
Reviewed by Maciej.
17240
- fixed http://bugs.webkit.org/show_bug.cgi?id=4435
17241
speed up JavaScript by tweaking the Identifier class
17243
* kjs/identifier.h: Add a new global nullIdentifier and make Identifier::null a function
17245
* kjs/identifier.cpp: (KJS::Identifier::init): Initialize a global for the null identifier
17246
as well as all the other globals for special identifiers.
17248
* kjs/ustring.h: (KJS::UString::UString): Make this empty constructor inline.
17249
* kjs/ustring.cpp: Remove the old non-inline version.
17251
2005-08-19 Mitz Pettel <opendarwin.org@mitzpettel.com>
17253
Reviewed by Maciej.
17254
Revised and landed by Darin.
17256
- fixed http://bugs.webkit.org/show_bug.cgi?id=4474
17257
REGRESSION: Crash when using in-place operator on uninitialized array element
17260
(AssignResolveNode::evaluate): Remove unneeded "isSet" assertion.
17261
(AssignBracketNode::evaluate): Replace code that tested "isSet" with code that
17262
tests the return value of getPropertySlot.
17264
* kjs/property_slot.h: Removed unneeded "isSet" function. Property slots are
17265
either uninitialized or set. There's no "initialized and not set" state.
17267
2005-08-18 Adele Peterson <adele@apple.com>
17269
Checked "Inline Functions Hidden" box
17271
* JavaScriptCore.xcodeproj/project.pbxproj:
17273
2005-08-16 Darin Adler <darin@apple.com>
17277
- fixed crash in one of the JavaScript tests (introduced by my throwError change)
17279
* kjs/nodes.cpp: (Node::setExceptionDetailsIfNeeded): Check if the exception is an
17280
object before setting the file and line number properties on it. Something to think
17281
about in the future -- do we really want to do this on any object that's thrown?
17282
How about limiting it to error objects that were created by the JavaScript engine?
17284
- changed kjs_fast_malloc so we don't have two conflicting versions of the same function
17286
* kjs/fast_malloc.h: Took out all the ifdefs from this header.
17287
* kjs/fast_malloc.cpp: Added non-NDEBUG versions of the functions that just call
17288
the system malloc, and put the NDEBUG versions in an #else.
17290
2005-08-16 Darin Adler <darin@apple.com>
17294
- clean up exported symbols that are not in a "KJS" namespace
17296
* bindings/NP_jsobject.cpp: (identiferFromNPIdentifier): Marked this function static
17297
so it no longer has external linkage.
17298
* bindings/c/c_utility.h: Put all this stuff inside the KJS namespace.
17299
* bindings/c/c_utility.cpp: Also marked some globals static so they don't have external
17300
linkage; not as important given the namespace.
17301
* bindings/npruntime.cpp: Marked functions static so they no longer have internal linkage.
17302
Also removed unused _NPN_SetExceptionWithUTF8 function (not in header, had C++ linkage!).
17304
* bindings/jni/jni_utility.cpp: (KJS::Bindings::getJavaVM): Call KJS_GetCreatedJavaVMs
17305
using the soft linking header, instead of calling the JNI call. This allows processes
17306
to link both JavaScriptCore and JavaVM without a symbol conflict.
17307
* bindings/softlinking.c:
17308
(loadFramework): Marked this function static so it no longer has external linkage.
17309
(getFunctionPointer): Ditto.
17310
(KJS_GetCreatedJavaVMs): Renamed this so it has a KJS prefix.
17312
* JavaScriptCore.xcodeproj/project.pbxproj: Added softlinking.h.
17313
* bindings/softlinking.h: Added.
17315
* kjs/nodes2string.cpp: (streamAssignmentOperatorTo): Marked this function static so it
17316
no longer has external linkage.
17318
2005-08-15 Darin Adler <darin@apple.com>
17322
- fixed http://bugs.webkit.org/show_bug.cgi?id=4437
17323
clean up error creation with new throwError function
17325
* bindings/NP_jsobject.cpp:
17326
(_NPN_SetException):
17327
* bindings/jni/jni_instance.cpp:
17328
(JavaInstance::invokeMethod):
17329
* bindings/jni/jni_runtime.cpp:
17330
(JavaField::dispatchValueFromInstance):
17331
(JavaField::dispatchSetValueToInstance):
17332
* bindings/objc/WebScriptObject.mm:
17333
(-[WebScriptObject _initializeWithObjectImp:originExecutionContext:executionContext:]):
17334
(-[WebScriptObject _initWithObjectImp:originExecutionContext:executionContext:]):
17335
(+[WebScriptObject throwException:]):
17336
(-[WebScriptObject setException:]):
17337
(+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:]):
17338
* bindings/objc/objc_class.h:
17339
(KJS::Bindings::ObjcClass::~ObjcClass):
17340
(KJS::Bindings::ObjcClass::ObjcClass):
17341
(KJS::Bindings::ObjcClass::operator=):
17342
(KJS::Bindings::ObjcClass::constructorAt):
17343
(KJS::Bindings::ObjcClass::numConstructors):
17344
* bindings/objc/objc_header.h:
17345
* bindings/objc/objc_runtime.h:
17346
(KJS::Bindings::ObjcField::~ObjcField):
17347
(KJS::Bindings::ObjcField::ObjcField):
17348
(KJS::Bindings::ObjcField::operator=):
17349
(KJS::Bindings::ObjcMethod::ObjcMethod):
17350
(KJS::Bindings::ObjcMethod::~ObjcMethod):
17351
(KJS::Bindings::ObjcMethod::operator=):
17352
* bindings/objc/objc_runtime.mm:
17353
(ObjcField::valueFromInstance):
17354
(ObjcField::setValueToInstance):
17355
(ObjcArray::setValueAt):
17356
(ObjcArray::valueAt):
17357
* bindings/objc/objc_utility.h:
17358
* bindings/objc/objc_utility.mm:
17359
(KJS::Bindings::JSMethodNameToObjCMethodName):
17360
(KJS::Bindings::convertValueToObjcValue):
17361
(KJS::Bindings::convertNSStringToString):
17362
(KJS::Bindings::convertObjcValueToValue):
17363
(KJS::Bindings::objcValueTypeForType):
17364
(KJS::Bindings::createObjcInstanceForValue):
17365
(KJS::Bindings::throwError):
17366
* bindings/runtime.h:
17367
(KJS::Bindings::Parameter::~Parameter):
17368
(KJS::Bindings::Method::~Method):
17369
(KJS::Bindings::Instance::Instance):
17370
(KJS::Bindings::Instance::begin):
17371
(KJS::Bindings::Instance::end):
17372
(KJS::Bindings::Instance::getValueOfUndefinedField):
17373
(KJS::Bindings::Instance::supportsSetValueOfUndefinedField):
17374
(KJS::Bindings::Instance::setValueOfUndefinedField):
17375
(KJS::Bindings::Instance::valueOf):
17376
* bindings/runtime_array.cpp:
17377
(RuntimeArrayImp::put):
17378
* bindings/runtime_object.h:
17379
(KJS::RuntimeObjectImp::setInternalInstance):
17380
(KJS::RuntimeObjectImp::getInternalInstance):
17381
* kjs/array_object.cpp:
17383
(ArrayProtoFuncImp::callAsFunction):
17384
(ArrayObjectImp::construct):
17385
* kjs/bool_object.cpp:
17386
(BooleanProtoFuncImp::callAsFunction):
17387
* kjs/date_object.cpp:
17388
(KJS::DateProtoFuncImp::callAsFunction):
17389
* kjs/function.cpp:
17391
(KJS::GlobalFuncImp::callAsFunction):
17392
* kjs/function_object.cpp:
17393
(FunctionProtoFuncImp::callAsFunction):
17394
(FunctionObjectImp::construct):
17395
* kjs/internal.cpp:
17396
(KJS::UndefinedImp::toObject):
17397
(KJS::NullImp::toObject):
17398
(KJS::InterpreterImp::evaluate):
17399
(KJS::InternalFunctionImp::hasInstance):
17401
(Node::throwError):
17403
(Node::setExceptionDetailsIfNeeded):
17404
(undefinedVariableError):
17405
(ProgramNode::ProgramNode):
17406
* kjs/number_object.cpp:
17407
(NumberProtoFuncImp::callAsFunction):
17409
(KJS::ObjectImp::call):
17410
(KJS::ObjectImp::defaultValue):
17411
(KJS::Error::create):
17414
(KJS::ObjectImp::clearProperties):
17415
(KJS::ObjectImp::getPropertySlot):
17416
(KJS::ObjectImp::getOwnPropertySlot):
17417
* kjs/object_object.cpp:
17418
(ObjectProtoFuncImp::callAsFunction):
17419
* kjs/reference.cpp:
17420
(KJS::Reference::getBase):
17421
(KJS::Reference::getValue):
17422
(KJS::Reference::putValue):
17423
(KJS::Reference::deleteValue):
17424
* kjs/regexp_object.cpp:
17425
(RegExpProtoFuncImp::callAsFunction):
17426
(RegExpObjectImp::construct):
17427
* kjs/string_object.cpp:
17428
(StringProtoFuncImp::callAsFunction):
17430
2005-08-15 Anders Carlsson <andersca@mac.com>
17434
* tests/mozilla/ecma_3/Date/15.9.5.5.js:
17435
Remove the code which tests that Date.toLocaleString should be parsable
17436
by Date.parse. That is not true according to the spec.
17438
2005-08-15 Darin Adler <darin@apple.com>
17442
* kjs/collector.cpp: (KJS::Collector::allocate): Use a local instead of a global in one
17443
more place; slight speedup.
17445
2005-08-14 Darin Adler <darin@apple.com>
17447
Reviewed by Maciej.
17449
- fixed crash observed on one of the Apple-only layout tests
17451
* kjs/property_map.cpp: (KJS::PropertyMap::mark): Change code to understand that deleted
17452
entries have a value of NULL, so the deleted sentinel count doesn't need to be included
17453
in the count of things to mark since we're ignoring the keys.
17455
2005-08-14 Darin Adler <darin@apple.com>
17457
Reviewed by Maciej.
17459
- fixed http://bugs.webkit.org/show_bug.cgi?id=4421
17460
speed up JavaScript by inlining some label stack functions
17462
* kjs/internal.h: Removed the copy constructor and assignment operator for LabelStack.
17463
They were unused, and the implementations had bugs; I removed them rather than fixing them.
17464
Also removed the clear function, since that was only needed to help the assignment operator
17465
share code with the destructor, and was not efficient enough for the destructor.
17466
(KJS::LabelStack::~LabelStack): Made this inline. Also used an efficient implementation
17467
that's nice and fast when the stack is empty, better than the old clear() function which
17468
used to keep updating and refetching "tos" each time through the loop.
17469
(KJS::LabelStack::pop): Made this inline.
17471
* kjs/internal.cpp: Deleted the now-inline functions and the obsolete functions. Also
17472
deleted a commented-out line of code.
17474
2005-08-14 Darin Adler <darin@apple.com>
17476
Reviewed by Maciej.
17478
- fixed http://bugs.webkit.org/show_bug.cgi?id=4419
17479
speed up JavaScript by improving KJS::List
17481
my measurements show an improvement of 1% on iBench JavaScript
17483
* kjs/list.cpp: Rearrange list to make the values and free list share the same storage,
17484
which saves 4 bytes per list. Also remove the pointers used only on the heap from the
17485
lists that are in the pool, which saves 8 bytes per list. Moving the free list pointer
17486
closer to the start of the list object also speeds up access to the free list. New
17487
"HeapListImp" struct is used only for the lists on the heap.
17488
(KJS::List::markProtectedLists): Shadowed global variable in local and updated for the
17489
new terminology ("heap" instead of "outside pool").
17490
(KJS::allocateListImp): Updated for new terminology.
17491
(KJS::List::release): Moved the code from deallocateListImp in here -- it wasn't being
17492
inlined and didn't need to be in a separate function.
17494
2005-08-14 Darin Adler <darin@apple.com>
17496
Reviewed by Maciej.
17498
- fixed http://bugs.webkit.org/show_bug.cgi?id=4417
17499
speed up JavaScript with some small changes to the property map code
17501
my measurements show an improvement of 2% on iBench JavaScript
17503
* kjs/property_map.h: (KJS::PropertyMap::PropertyMap): Made the default constructor inline.
17504
* kjs/property_map.cpp:
17505
(KJS::PropertyMap::~PropertyMap): Changed loop to exit early once we know we've processed
17506
all the hash table entries, based on the count.
17507
(KJS::PropertyMap::mark): Ditto.
17509
* kjs/object.h: Made an arbitrary change here to force recompiling so we pick up changes to
17510
property_map.h. Works around what seems to be an Xcode header dependency bug.
17512
2005-08-14 Darin Adler <darin@apple.com>
17514
Reviewed by Maciej.
17516
- fixed http://bugs.webkit.org/show_bug.cgi?id=4416
17517
speed up JavaScript with some improvements to the garbage collector
17519
my measurements show an improvement of 2% on iBench JavaScript
17521
* kjs/collector.cpp:
17522
(KJS::Collector::allocate): Use local variables to shadow globals instead of repeatedly
17523
going at global variables. Tighten up loop implementations to make the common case fast.
17524
(KJS::Collector::markStackObjectsConservatively): Use local variables to shadow globals.
17525
Used a goto to eliminate a boolean since it was showing up in the profile.
17526
(KJS::Collector::markProtectedObjects): Iterate through the table using pointer rather
17527
than an index since the profile showed that generating better code.
17528
(KJS::Collector::collect): Added a special case for blocks where all cells are used,
17529
Use local variables to shadow globals. Eliminated a boolean by computing it another
17530
way (checking to see if the number of live objects changed). Also used local variables
17531
to shadow fields in the current cell when sweeping.
17532
(KJS::Collector::numReferencedObjects): Use AllocatedValueImp instead of ValueImp
17533
in one place -- means we get faster versions of various functions that don't worry
17534
about SimpleNumber.
17535
(KJS::className): Ditto.
17536
(KJS::Collector::rootObjectClasses): Ditto.
17538
2005-08-14 Darin Adler <darin@apple.com>
17540
- fixed http://bugs.webkit.org/show_bug.cgi?id=4344
17541
REGRESSION: JavaScript crash when going back from viewing a thread (NULL protoype)
17543
* kjs/error_object.cpp: (NativeErrorImp::NativeErrorImp): Set proto in a more
17544
straightforward way. The old code set the proto to 0 and then to the correct value.
17545
This showed up as a "false positive" when searching for places that set prototype
17546
to NULL/0 so I fixed it.
17548
* kjs/function_object.cpp: (FunctionPrototypeImp::FunctionPrototypeImp): Change to
17549
not pass an explicit "0" to the base class (InternalFunctionImp) constructor.
17551
* kjs/internal.h: Added a default constructor for InternalFunctionImp.
17552
* kjs/internal.cpp: (KJS::InternalFunctionImp::InternalFunctionImp): Added the
17553
default constructor (empty body, just calls base class's default constructor).
17556
(KJS::ObjectImp::ObjectImp): Add an assertion to catch NULL prototypes earlier
17557
in Development builds.
17558
(KJS::ObjectImp::setPrototype): Ditto.
17560
2005-08-12 Maciej Stachowiak <mjs@apple.com>
17564
- two simple speed improvements for a 3% speed gain
17566
* JavaScriptCore.xcodeproj/project.pbxproj: turn on -fstrict-aliasing
17568
* kjs/scope_chain.h:
17569
(KJS::ScopeChainIterator::ScopeChainIterator): Add a scope chain iterator
17570
so you can walk a scope chain without having to make a copy that you then mutate.
17571
(KJS::ScopeChainIterator::operator*): standard iterator operation
17572
(KJS::ScopeChainIterator::operator->): ditto
17573
(KJS::ScopeChainIterator::operator++): ditto
17574
(KJS::ScopeChainIterator::operator==): ditto
17575
(KJS::ScopeChainIterator::operator!=): ditto
17576
(KJS::ScopeChain::begin): Iterator for the top of the scope chain
17577
(KJS::ScopeChain::end): Iterator for one past the bottom (i.e. null)
17579
(ResolveNode::evaluate): Use scope chain iterator instead of copying
17580
a scope chain and then modifying the copy
17581
(ResolveNode::evaluateReference): ditto
17582
(FunctionCallResolveNode::evaluate): ditto
17583
(AssignResolveNode::evaluate): ditto
17585
2005-08-12 Maciej Stachowiak <mjs@apple.com>
17587
Patch from Anders Carlsson, reviewed by me.
17589
* kjs/nodes.h: Fix build breakage.
17591
2005-08-12 Maciej Stachowiak <mjs@apple.com>
17595
- refactor function calls, 3% speedup on JS iBench.
17599
(Node::throwError): Added new useful variants.
17600
(FunctionCallValueNode::evaluate): New node to handle calls on expressions
17601
that are strictly values, not references.
17602
(FunctionCallValueNode::ref): ditto
17603
(FunctionCallValueNode::deref): ditto
17604
(FunctionCallResolveNode::evaluate): New node to handle calls on identifier
17605
expressions, so that they are looked up in the scope chain.
17606
(FunctionCallResolveNode::ref): ditto
17607
(FunctionCallResolveNode::deref): ditto
17608
(FunctionCallBracketNode::evaluate): New node to handle calls on bracket
17609
dereferences, so that the expression before brackets is used as the this
17611
(FunctionCallBracketNode::ref): ditto
17612
(FunctionCallBracketNode::deref): ditto
17613
(FunctionCallDotNode::evaluate): New node to handle calls on dot
17614
dereferences, so that the expression before the dot is used as the this
17616
(FunctionCallDotNode::ref): ditto
17617
(FunctionCallDotNode::deref): ditto
17618
(dotExprNotAnObjectString): helper function to avoid global variable access.
17619
(dotExprDoesNotAllowCallsString): ditto
17620
* kjs/nodes.h: Declared new classes.
17621
* kjs/nodes2string.cpp:
17622
(FunctionCallValueNode::streamTo): Added - serializes the appropriate function call
17623
(FunctionCallResolveNode::streamTo): ditto
17624
(FunctionCallBracketNode::streamTo): ditto
17625
(FunctionCallParenBracketNode::streamTo): ditto
17626
(FunctionCallDotNode::streamTo): ditto
17627
(FunctionCallParenDotNode::streamTo): ditto
17629
(KJS::ObjectImp::isActivation): Change how activation objects are
17630
detected in the scope chain, a virtual function is cheaper than the
17631
old inheritance test.
17633
(KJS::ActivationImp::isActivation): Ditto.
17635
2005-08-11 Maciej Stachowiak <mjs@apple.com>
17637
- added missing file from earlier checkin
17639
* kjs/grammar_types.h: Added.
17640
(KJS::makeNodePair):
17641
(KJS::makeNodeWithIdent):
17643
2005-08-11 Maciej Stachowiak <mjs@apple.com>
17647
* kjs/date_object.cpp:
17648
(timetUsingCF): Fix one of the date tests my making the CF version of mktime
17649
have the same quirk about the DST field as the real mktime.
17650
* tests/mozilla/expected.html: Updated for newly fixed test.
17652
2005-08-11 Maciej Stachowiak <mjs@apple.com>
17654
- updated for one of the tests that Darin incidentally fixed.
17656
* tests/mozilla/expected.html:
17658
2005-08-10 Maciej Stachowiak <mjs@apple.com>
17662
Refactor assignment grammar to avoid Reference type, and to later
17663
be able to take advantage of writeable PropertySlots, when those
17664
are added. I also fixed a minor bug, turning a function to a
17665
string lost parentheses, I made sure they are printed at least
17666
where semantically significant.
17668
Test cases: see WebCore
17670
* kjs/grammar.y: Change grammar so that assignment expressions are parsed
17671
directly to nodes that know how to set the kind of location being assigned, instead
17672
of having a generic assign node that counts on evaluateReference.
17673
* kjs/lexer.cpp: Include grammar_types.h.
17675
(BracketAccessorNode): Renamed from AccessorNode1 for clarity.
17676
(DotAccessorNode): Renamed from AccessorNode2 for clarity.
17677
(combineForAssignment): Inline function for doing the proper kind of
17678
operation for various update assignments like += or *=.
17679
(AssignResolveNode): Node that handles assignment to a bare identifier.
17680
(AssignDotNode): Node that handles assignments of the form EXPR . IDENT = EXPR
17681
(AssignBracketNode): EXPR [ IDENT ] = EXPR
17682
* kjs/nodes.h: Updated for declarations/renames of new classes.
17683
* kjs/nodes2string.cpp:
17684
(GroupNode::streamTo): Fixed to print parens around the expression.
17685
(BracketAccessorNode::streamTo): Renamed.
17686
(DotAccessorNode::streamTo): Renamed.
17687
(AssignResolveNode::streamTo): Added.
17688
(AssignBracketNode::streamTo): Added.
17689
(AssignDotNode::streamTo): Added.
17690
(streamAssignmentOperatorTo): helper function for the above
17691
* kjs/property_slot.h:
17692
(KJS::PropertySlot::isSet): Made this const.
17694
2005-08-10 Adele Peterson <adele@apple.com>
17696
Bumping version to 420+
17700
2005-08-10 Geoffrey Garen <ggaren@apple.com>
17702
-fixed <rdar://problem/4151132> REGRESSION: Some applet liveconnect calls
17703
throws privilege exception.
17705
Reviewed by richard and mjs.
17707
-I removed the global static JavaClass cache, since it violated Java
17708
security to cache classes between websites and applets.
17710
* bindings/jni/jni_class.cpp:
17711
-removed global static cache dictionary
17712
-instance constructor and destructor now do the work that used to
17713
be done by static factory methods
17714
-removed obsolete functions
17715
(JavaClass::JavaClass):
17716
(JavaClass::~JavaClass):
17717
* bindings/jni/jni_class.h:
17718
-removed obsolete function declarations
17719
-made copying private since it's unused and it's also not clear
17720
excatly how copying would work with Java security
17721
-made default construction private since it's meaningless
17722
* bindings/jni/jni_instance.cpp:
17723
-removed obsolete functions
17724
(JavaInstance::~JavaInstance):
17725
(JavaInstance::getClass):
17726
* bindings/jni/jni_instance.h:
17727
-made copying private since it's unused and it's also not clear
17728
excatly how copying would work with Java security
17729
-made default construction private since it's meaningless
17731
2005-08-08 Geoffrey Garen <ggaren@apple.com>
17733
-fixed crash caused by fix for http://bugs.webkit.org/show_bug.cgi?id=4313
17735
- exceptionDescription now gets explicitly initialized to NULL in all
17736
the places listed below -- our wrapper classes used to take care of this
17739
* bindings/jni/jni_instance.cpp:
17740
(JavaInstance::invokeMethod):
17741
* bindings/jni/jni_runtime.cpp:
17742
(JavaField::dispatchValueFromInstance):
17743
(JavaField::dispatchSetValueToInstance):
17745
2005-08-08 Darin Adler <darin@apple.com>
17747
Reviewed by John Sullivan.
17749
- fixed http://bugs.webkit.org/show_bug.cgi?id=4325
17750
Mozilla Date tests have an unnecessary loop that runs 1970 times before each test
17752
* tests/mozilla/ecma/shell.js: Added TIME_YEAR_0 constant.
17754
* tests/mozilla/ecma/Date/15.9.5.10-1.js: Removed the loop and changed code to use the constant.
17755
* tests/mozilla/ecma/Date/15.9.5.10-10.js: Ditto.
17756
* tests/mozilla/ecma/Date/15.9.5.10-11.js: Ditto.
17757
* tests/mozilla/ecma/Date/15.9.5.10-12.js: Ditto.
17758
* tests/mozilla/ecma/Date/15.9.5.10-13.js: Ditto.
17759
* tests/mozilla/ecma/Date/15.9.5.10-2.js: Ditto.
17760
* tests/mozilla/ecma/Date/15.9.5.10-3.js: Ditto.
17761
* tests/mozilla/ecma/Date/15.9.5.10-4.js: Ditto.
17762
* tests/mozilla/ecma/Date/15.9.5.10-5.js: Ditto.
17763
* tests/mozilla/ecma/Date/15.9.5.10-6.js: Ditto.
17764
* tests/mozilla/ecma/Date/15.9.5.10-7.js: Ditto.
17765
* tests/mozilla/ecma/Date/15.9.5.10-8.js: Ditto.
17766
* tests/mozilla/ecma/Date/15.9.5.10-9.js: Ditto.
17767
* tests/mozilla/ecma/Date/15.9.5.11-2.js: Ditto.
17768
* tests/mozilla/ecma/Date/15.9.5.12-1.js: Ditto.
17769
* tests/mozilla/ecma/Date/15.9.5.12-2.js: Ditto.
17770
* tests/mozilla/ecma/Date/15.9.5.12-3.js: Ditto.
17771
* tests/mozilla/ecma/Date/15.9.5.12-4.js: Ditto.
17772
* tests/mozilla/ecma/Date/15.9.5.12-5.js: Ditto.
17773
* tests/mozilla/ecma/Date/15.9.5.12-6.js: Ditto.
17774
* tests/mozilla/ecma/Date/15.9.5.12-7.js: Ditto.
17775
* tests/mozilla/ecma/Date/15.9.5.12-8.js: Ditto.
17776
* tests/mozilla/ecma/Date/15.9.5.13-2.js: Ditto.
17777
* tests/mozilla/ecma/Date/15.9.5.13-8.js: Ditto.
17778
* tests/mozilla/ecma/Date/15.9.5.14.js: Ditto.
17779
* tests/mozilla/ecma/Date/15.9.5.15.js: Ditto.
17780
* tests/mozilla/ecma/Date/15.9.5.16.js: Ditto.
17781
* tests/mozilla/ecma/Date/15.9.5.17.js: Ditto.
17782
* tests/mozilla/ecma/Date/15.9.5.18.js: Ditto.
17783
* tests/mozilla/ecma/Date/15.9.5.19.js: Ditto.
17784
* tests/mozilla/ecma/Date/15.9.5.20.js: Ditto.
17785
* tests/mozilla/ecma/Date/15.9.5.21-1.js: Ditto.
17786
* tests/mozilla/ecma/Date/15.9.5.21-2.js: Ditto.
17787
* tests/mozilla/ecma/Date/15.9.5.21-3.js: Ditto.
17788
* tests/mozilla/ecma/Date/15.9.5.21-4.js: Ditto.
17789
* tests/mozilla/ecma/Date/15.9.5.21-5.js: Ditto.
17790
* tests/mozilla/ecma/Date/15.9.5.21-6.js: Ditto.
17791
* tests/mozilla/ecma/Date/15.9.5.21-7.js: Ditto.
17792
* tests/mozilla/ecma/Date/15.9.5.21-8.js: Ditto.
17793
* tests/mozilla/ecma/Date/15.9.5.22-1.js: Ditto.
17794
* tests/mozilla/ecma/Date/15.9.5.22-2.js: Ditto.
17795
* tests/mozilla/ecma/Date/15.9.5.22-3.js: Ditto.
17796
* tests/mozilla/ecma/Date/15.9.5.22-4.js: Ditto.
17797
* tests/mozilla/ecma/Date/15.9.5.22-5.js: Ditto.
17798
* tests/mozilla/ecma/Date/15.9.5.22-6.js: Ditto.
17799
* tests/mozilla/ecma/Date/15.9.5.22-7.js: Ditto.
17800
* tests/mozilla/ecma/Date/15.9.5.22-8.js: Ditto.
17801
* tests/mozilla/ecma/Date/15.9.5.23-4.js: Ditto.
17802
* tests/mozilla/ecma/Date/15.9.5.23-5.js: Ditto.
17803
* tests/mozilla/ecma/Date/15.9.5.23-6.js: Ditto.
17804
* tests/mozilla/ecma/Date/15.9.5.23-7.js: Ditto.
17805
* tests/mozilla/ecma/Date/15.9.5.23-8.js: Ditto.
17806
* tests/mozilla/ecma/Date/15.9.5.23-9.js: Ditto.
17807
* tests/mozilla/ecma/Date/15.9.5.5.js: Ditto.
17808
* tests/mozilla/ecma/Date/15.9.5.6.js: Ditto.
17809
* tests/mozilla/ecma/Date/15.9.5.7.js: Ditto.
17810
* tests/mozilla/ecma/Date/15.9.5.8.js: Ditto.
17811
* tests/mozilla/ecma/Date/15.9.5.9.js: Ditto.
17813
2005-08-08 Darin Adler <darin@apple.com>
17815
- forgot to delete an obsolete file
17817
* kjs/object_wrapper.h: Deleted.
17819
2005-08-07 Darin Adler <darin@apple.com>
17821
- fixed two problems compiling with gcc 4.0
17823
* kjs/array_object.cpp: (ArrayProtoFuncImp::callAsFunction): Initialized a
17824
variable to quiet an erroneous warning.
17825
* kjs/date_object.cpp: (KJS::makeTime): Removed extraneous KJS:: prefix.
17827
2005-08-07 Darin Adler <darin@apple.com>
17829
Rubber stamped by Maciej.
17831
- fixed http://bugs.webkit.org/show_bug.cgi?id=4313
17832
eliminate KJS::Value and KJS::Object smart pointer wrappers (for simplicity and speed)
17834
* JavaScriptCore.xcodeproj/project.pbxproj: Removed object_wrapper.h.
17836
Global replaces and other wonderful stuff.
17838
* bindings/NP_jsobject.cpp:
17841
(_NPN_GetProperty):
17842
(_NPN_SetProperty):
17844
(_NPN_SetException):
17845
* bindings/c/c_instance.cpp:
17846
(KJS::Bindings::CInstance::CInstance):
17847
(KJS::Bindings::CInstance::invokeMethod):
17848
(KJS::Bindings::CInstance::invokeDefaultMethod):
17849
(KJS::Bindings::CInstance::defaultValue):
17850
(KJS::Bindings::CInstance::stringValue):
17851
(KJS::Bindings::CInstance::numberValue):
17852
(KJS::Bindings::CInstance::booleanValue):
17853
(KJS::Bindings::CInstance::valueOf):
17854
* bindings/c/c_instance.h:
17855
* bindings/c/c_runtime.cpp:
17856
(CField::valueFromInstance):
17857
(CField::setValueToInstance):
17858
* bindings/c/c_runtime.h:
17859
* bindings/c/c_utility.cpp:
17860
(convertNPStringToUTF16):
17861
(convertUTF8ToUTF16):
17862
(coerceValueToNPVariantStringType):
17863
(convertValueToNPVariant):
17864
(convertNPVariantToValue):
17865
* bindings/c/c_utility.h:
17866
* bindings/jni/jni_instance.cpp:
17867
(JavaInstance::stringValue):
17868
(JavaInstance::numberValue):
17869
(JavaInstance::booleanValue):
17870
(JavaInstance::invokeMethod):
17871
(JavaInstance::invokeDefaultMethod):
17872
(JavaInstance::defaultValue):
17873
(JavaInstance::valueOf):
17874
* bindings/jni/jni_instance.h:
17875
* bindings/jni/jni_jsobject.cpp:
17876
(JSObject::invoke):
17879
(JSObject::getMember):
17880
(JSObject::getSlot):
17881
(JSObject::toString):
17882
(JSObject::convertValueToJObject):
17883
(JSObject::convertJObjectToValue):
17884
(JSObject::listFromJArray):
17885
* bindings/jni/jni_jsobject.h:
17886
* bindings/jni/jni_objc.mm:
17887
(KJS::Bindings::dispatchJNICall):
17888
* bindings/jni/jni_runtime.cpp:
17889
(JavaArray::convertJObjectToArray):
17890
(JavaField::dispatchValueFromInstance):
17891
(JavaField::valueFromInstance):
17892
(JavaField::dispatchSetValueToInstance):
17893
(JavaField::setValueToInstance):
17894
(JavaArray::setValueAt):
17895
(JavaArray::valueAt):
17896
* bindings/jni/jni_runtime.h:
17897
(KJS::Bindings::JavaString::ustring):
17898
* bindings/jni/jni_utility.cpp:
17899
(KJS::Bindings::getJavaVM):
17900
(KJS::Bindings::getJNIEnv):
17901
(KJS::Bindings::getMethodID):
17902
(KJS::Bindings::callJNIVoidMethod):
17903
(KJS::Bindings::callJNIObjectMethod):
17904
(KJS::Bindings::callJNIBooleanMethod):
17905
(KJS::Bindings::callJNIStaticBooleanMethod):
17906
(KJS::Bindings::callJNIByteMethod):
17907
(KJS::Bindings::callJNICharMethod):
17908
(KJS::Bindings::callJNIShortMethod):
17909
(KJS::Bindings::callJNIIntMethod):
17910
(KJS::Bindings::callJNILongMethod):
17911
(KJS::Bindings::callJNIFloatMethod):
17912
(KJS::Bindings::callJNIDoubleMethod):
17913
(KJS::Bindings::callJNIVoidMethodA):
17914
(KJS::Bindings::callJNIObjectMethodA):
17915
(KJS::Bindings::callJNIByteMethodA):
17916
(KJS::Bindings::callJNICharMethodA):
17917
(KJS::Bindings::callJNIShortMethodA):
17918
(KJS::Bindings::callJNIIntMethodA):
17919
(KJS::Bindings::callJNILongMethodA):
17920
(KJS::Bindings::callJNIFloatMethodA):
17921
(KJS::Bindings::callJNIDoubleMethodA):
17922
(KJS::Bindings::callJNIBooleanMethodA):
17923
(KJS::Bindings::callJNIVoidMethodIDA):
17924
(KJS::Bindings::callJNIObjectMethodIDA):
17925
(KJS::Bindings::callJNIByteMethodIDA):
17926
(KJS::Bindings::callJNICharMethodIDA):
17927
(KJS::Bindings::callJNIShortMethodIDA):
17928
(KJS::Bindings::callJNIIntMethodIDA):
17929
(KJS::Bindings::callJNILongMethodIDA):
17930
(KJS::Bindings::callJNIFloatMethodIDA):
17931
(KJS::Bindings::callJNIDoubleMethodIDA):
17932
(KJS::Bindings::callJNIBooleanMethodIDA):
17933
(KJS::Bindings::getCharactersFromJString):
17934
(KJS::Bindings::releaseCharactersForJString):
17935
(KJS::Bindings::getCharactersFromJStringInEnv):
17936
(KJS::Bindings::releaseCharactersForJStringInEnv):
17937
(KJS::Bindings::getUCharactersFromJStringInEnv):
17938
(KJS::Bindings::releaseUCharactersForJStringInEnv):
17939
(KJS::Bindings::JNITypeFromClassName):
17940
(KJS::Bindings::signatureFromPrimitiveType):
17941
(KJS::Bindings::JNITypeFromPrimitiveType):
17942
(KJS::Bindings::getJNIField):
17943
(KJS::Bindings::convertValueToJValue):
17944
* bindings/jni/jni_utility.h:
17945
* bindings/objc/WebScriptObject.mm:
17947
(-[WebScriptObject _initializeWithObjectImp:originExecutionContext:Bindings::executionContext:Bindings::]):
17948
(-[WebScriptObject _initWithObjectImp:originExecutionContext:Bindings::executionContext:Bindings::]):
17949
(-[WebScriptObject _imp]):
17950
(-[WebScriptObject _executionContext]):
17951
(-[WebScriptObject _setExecutionContext:]):
17952
(-[WebScriptObject _originExecutionContext]):
17953
(-[WebScriptObject _setOriginExecutionContext:]):
17954
(+[WebScriptObject throwException:]):
17956
(-[WebScriptObject callWebScriptMethod:withArguments:]):
17957
(-[WebScriptObject evaluateWebScript:]):
17958
(-[WebScriptObject setValue:forKey:]):
17959
(-[WebScriptObject valueForKey:]):
17960
(-[WebScriptObject removeWebScriptKey:]):
17961
(-[WebScriptObject stringRepresentation]):
17962
(-[WebScriptObject webScriptValueAtIndex:]):
17963
(-[WebScriptObject setException:]):
17964
(+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:Bindings::]):
17965
* bindings/objc/WebScriptObjectPrivate.h:
17966
* bindings/objc/objc_class.h:
17967
* bindings/objc/objc_class.mm:
17968
(KJS::Bindings::ObjcClass::fallbackObject):
17969
* bindings/objc/objc_instance.h:
17970
* bindings/objc/objc_instance.mm:
17971
(ObjcInstance::invokeMethod):
17972
(ObjcInstance::invokeDefaultMethod):
17973
(ObjcInstance::setValueOfField):
17974
(ObjcInstance::setValueOfUndefinedField):
17975
(ObjcInstance::getValueOfField):
17976
(ObjcInstance::getValueOfUndefinedField):
17977
(ObjcInstance::defaultValue):
17978
(ObjcInstance::stringValue):
17979
(ObjcInstance::numberValue):
17980
(ObjcInstance::booleanValue):
17981
(ObjcInstance::valueOf):
17982
* bindings/objc/objc_runtime.h:
17983
* bindings/objc/objc_runtime.mm:
17984
(ObjcField::valueFromInstance):
17985
(convertValueToObjcObject):
17986
(ObjcField::setValueToInstance):
17987
(ObjcArray::setValueAt):
17988
(ObjcArray::valueAt):
17989
(ObjcFallbackObjectImp::put):
17990
(ObjcFallbackObjectImp::callAsFunction):
17991
(ObjcFallbackObjectImp::defaultValue):
17992
* bindings/objc/objc_utility.h:
17993
* bindings/objc/objc_utility.mm:
17994
(Bindings::JSMethodNameToObjCMethodName):
17995
(Bindings::convertValueToObjcValue):
17996
(Bindings::convertNSStringToString):
17997
(Bindings::convertObjcValueToValue):
17998
(Bindings::objcValueTypeForType):
17999
(Bindings::createObjcInstanceForValue):
18000
* bindings/runtime.cpp:
18001
(Instance::getValueOfField):
18002
(Instance::setValueOfField):
18003
(Instance::createRuntimeObject):
18004
(Instance::createLanguageInstanceForValue):
18005
* bindings/runtime.h:
18006
(KJS::Bindings::Constructor::~Constructor):
18007
(KJS::Bindings::Field::~Field):
18008
(KJS::Bindings::MethodList::MethodList):
18009
(KJS::Bindings::Class::fallbackObject):
18010
(KJS::Bindings::Class::~Class):
18011
(KJS::Bindings::Instance::Instance):
18012
(KJS::Bindings::Instance::getValueOfUndefinedField):
18013
(KJS::Bindings::Instance::supportsSetValueOfUndefinedField):
18014
(KJS::Bindings::Instance::setValueOfUndefinedField):
18015
(KJS::Bindings::Instance::valueOf):
18016
(KJS::Bindings::Instance::setExecutionContext):
18017
(KJS::Bindings::Instance::~Instance):
18018
(KJS::Bindings::Array::~Array):
18019
* bindings/runtime_array.cpp:
18020
(RuntimeArrayImp::RuntimeArrayImp):
18021
(RuntimeArrayImp::lengthGetter):
18022
(RuntimeArrayImp::indexGetter):
18023
(RuntimeArrayImp::put):
18024
* bindings/runtime_array.h:
18025
* bindings/runtime_method.cpp:
18026
(RuntimeMethodImp::lengthGetter):
18027
(RuntimeMethodImp::callAsFunction):
18028
* bindings/runtime_method.h:
18029
* bindings/runtime_object.cpp:
18030
(RuntimeObjectImp::fallbackObjectGetter):
18031
(RuntimeObjectImp::fieldGetter):
18032
(RuntimeObjectImp::methodGetter):
18033
(RuntimeObjectImp::getOwnPropertySlot):
18034
(RuntimeObjectImp::put):
18035
(RuntimeObjectImp::defaultValue):
18036
(RuntimeObjectImp::callAsFunction):
18037
* bindings/runtime_object.h:
18038
* kjs/array_instance.h:
18039
* kjs/array_object.cpp:
18040
(ArrayInstanceImp::ArrayInstanceImp):
18041
(ArrayInstanceImp::lengthGetter):
18042
(ArrayInstanceImp::getOwnPropertySlot):
18043
(ArrayInstanceImp::put):
18044
(ArrayInstanceImp::propList):
18045
(ArrayInstanceImp::setLength):
18046
(compareByStringForQSort):
18047
(compareWithCompareFunctionForQSort):
18048
(ArrayInstanceImp::sort):
18049
(ArrayInstanceImp::pushUndefinedObjectsToEnd):
18050
(ArrayPrototypeImp::ArrayPrototypeImp):
18051
(ArrayProtoFuncImp::ArrayProtoFuncImp):
18052
(ArrayProtoFuncImp::callAsFunction):
18053
(ArrayObjectImp::ArrayObjectImp):
18054
(ArrayObjectImp::construct):
18055
(ArrayObjectImp::callAsFunction):
18056
* kjs/array_object.h:
18057
* kjs/bool_object.cpp:
18058
(BooleanPrototypeImp::BooleanPrototypeImp):
18059
(BooleanProtoFuncImp::BooleanProtoFuncImp):
18060
(BooleanProtoFuncImp::callAsFunction):
18061
(BooleanObjectImp::BooleanObjectImp):
18062
(BooleanObjectImp::construct):
18063
(BooleanObjectImp::callAsFunction):
18064
* kjs/bool_object.h:
18065
* kjs/collector.cpp:
18066
(KJS::Collector::markStackObjectsConservatively):
18067
(KJS::Collector::collect):
18069
* kjs/completion.h:
18070
(KJS::Completion::Completion):
18071
(KJS::Completion::value):
18072
(KJS::Completion::isValueCompletion):
18074
(KJS::ContextImp::variableObject):
18075
(KJS::ContextImp::setVariableObject):
18076
(KJS::ContextImp::thisValue):
18077
(KJS::ContextImp::activationObject):
18078
(KJS::ContextImp::pushScope):
18079
* kjs/date_object.cpp:
18080
(formatLocaleDate):
18081
(KJS::timeFromArgs):
18082
(KJS::DatePrototypeImp::DatePrototypeImp):
18083
(KJS::DateProtoFuncImp::DateProtoFuncImp):
18084
(KJS::DateProtoFuncImp::callAsFunction):
18085
(KJS::DateObjectImp::DateObjectImp):
18086
(KJS::DateObjectImp::construct):
18087
(KJS::DateObjectImp::callAsFunction):
18088
(KJS::DateObjectFuncImp::DateObjectFuncImp):
18089
(KJS::DateObjectFuncImp::callAsFunction):
18091
(KJS::KRFCDate_parseDate):
18093
* kjs/date_object.h:
18094
* kjs/debugger.cpp:
18095
(Debugger::exception):
18096
(Debugger::callEvent):
18097
(Debugger::returnEvent):
18099
* kjs/error_object.cpp:
18100
(ErrorPrototypeImp::ErrorPrototypeImp):
18101
(ErrorProtoFuncImp::ErrorProtoFuncImp):
18102
(ErrorProtoFuncImp::callAsFunction):
18103
(ErrorObjectImp::ErrorObjectImp):
18104
(ErrorObjectImp::construct):
18105
(ErrorObjectImp::callAsFunction):
18106
(NativeErrorPrototypeImp::NativeErrorPrototypeImp):
18107
(NativeErrorImp::NativeErrorImp):
18108
(NativeErrorImp::construct):
18109
(NativeErrorImp::callAsFunction):
18110
* kjs/error_object.h:
18111
* kjs/function.cpp:
18112
(KJS::FunctionImp::FunctionImp):
18113
(KJS::FunctionImp::callAsFunction):
18114
(KJS::FunctionImp::processParameters):
18115
(KJS::FunctionImp::argumentsGetter):
18116
(KJS::FunctionImp::lengthGetter):
18117
(KJS::FunctionImp::put):
18118
(KJS::DeclaredFunctionImp::DeclaredFunctionImp):
18119
(KJS::DeclaredFunctionImp::construct):
18120
(KJS::ArgumentsImp::ArgumentsImp):
18121
(KJS::ArgumentsImp::mappedIndexGetter):
18122
(KJS::ArgumentsImp::put):
18123
(KJS::ActivationImp::argumentsGetter):
18124
(KJS::GlobalFuncImp::GlobalFuncImp):
18127
(KJS::GlobalFuncImp::callAsFunction):
18129
* kjs/function_object.cpp:
18130
(FunctionPrototypeImp::FunctionPrototypeImp):
18131
(FunctionPrototypeImp::callAsFunction):
18132
(FunctionProtoFuncImp::FunctionProtoFuncImp):
18133
(FunctionProtoFuncImp::callAsFunction):
18134
(FunctionObjectImp::FunctionObjectImp):
18135
(FunctionObjectImp::construct):
18136
(FunctionObjectImp::callAsFunction):
18137
* kjs/function_object.h:
18138
* kjs/internal.cpp:
18139
(KJS::UndefinedImp::toPrimitive):
18140
(KJS::UndefinedImp::toObject):
18141
(KJS::NullImp::toPrimitive):
18142
(KJS::NullImp::toObject):
18143
(KJS::BooleanImp::toPrimitive):
18144
(KJS::BooleanImp::toObject):
18145
(KJS::StringImp::toPrimitive):
18146
(KJS::StringImp::toObject):
18147
(KJS::NumberImp::toPrimitive):
18148
(KJS::NumberImp::toObject):
18149
(KJS::NumberImp::getUInt32):
18150
(KJS::LabelStack::push):
18151
(KJS::ContextImp::ContextImp):
18152
(KJS::InterpreterImp::globalInit):
18153
(KJS::InterpreterImp::globalClear):
18154
(KJS::InterpreterImp::InterpreterImp):
18155
(KJS::InterpreterImp::initGlobalObject):
18156
(KJS::InterpreterImp::clear):
18157
(KJS::InterpreterImp::mark):
18158
(KJS::InterpreterImp::evaluate):
18159
(KJS::InternalFunctionImp::hasInstance):
18163
(KJS::InterpreterImp::builtinObject):
18164
(KJS::InterpreterImp::builtinFunction):
18165
(KJS::InterpreterImp::builtinArray):
18166
(KJS::InterpreterImp::builtinBoolean):
18167
(KJS::InterpreterImp::builtinString):
18168
(KJS::InterpreterImp::builtinNumber):
18169
(KJS::InterpreterImp::builtinDate):
18170
(KJS::InterpreterImp::builtinRegExp):
18171
(KJS::InterpreterImp::builtinError):
18172
(KJS::InterpreterImp::builtinObjectPrototype):
18173
(KJS::InterpreterImp::builtinFunctionPrototype):
18174
(KJS::InterpreterImp::builtinArrayPrototype):
18175
(KJS::InterpreterImp::builtinBooleanPrototype):
18176
(KJS::InterpreterImp::builtinStringPrototype):
18177
(KJS::InterpreterImp::builtinNumberPrototype):
18178
(KJS::InterpreterImp::builtinDatePrototype):
18179
(KJS::InterpreterImp::builtinRegExpPrototype):
18180
(KJS::InterpreterImp::builtinErrorPrototype):
18181
(KJS::InterpreterImp::builtinEvalError):
18182
(KJS::InterpreterImp::builtinRangeError):
18183
(KJS::InterpreterImp::builtinReferenceError):
18184
(KJS::InterpreterImp::builtinSyntaxError):
18185
(KJS::InterpreterImp::builtinTypeError):
18186
(KJS::InterpreterImp::builtinURIError):
18187
(KJS::InterpreterImp::builtinEvalErrorPrototype):
18188
(KJS::InterpreterImp::builtinRangeErrorPrototype):
18189
(KJS::InterpreterImp::builtinReferenceErrorPrototype):
18190
(KJS::InterpreterImp::builtinSyntaxErrorPrototype):
18191
(KJS::InterpreterImp::builtinTypeErrorPrototype):
18192
(KJS::InterpreterImp::builtinURIErrorPrototype):
18193
* kjs/interpreter.cpp:
18194
(Context::variableObject):
18195
(Context::thisValue):
18196
(Interpreter::Interpreter):
18197
(Interpreter::globalObject):
18198
(Interpreter::evaluate):
18199
(Interpreter::builtinObject):
18200
(Interpreter::builtinFunction):
18201
(Interpreter::builtinArray):
18202
(Interpreter::builtinBoolean):
18203
(Interpreter::builtinString):
18204
(Interpreter::builtinNumber):
18205
(Interpreter::builtinDate):
18206
(Interpreter::builtinRegExp):
18207
(Interpreter::builtinError):
18208
(Interpreter::builtinObjectPrototype):
18209
(Interpreter::builtinFunctionPrototype):
18210
(Interpreter::builtinArrayPrototype):
18211
(Interpreter::builtinBooleanPrototype):
18212
(Interpreter::builtinStringPrototype):
18213
(Interpreter::builtinNumberPrototype):
18214
(Interpreter::builtinDatePrototype):
18215
(Interpreter::builtinRegExpPrototype):
18216
(Interpreter::builtinErrorPrototype):
18217
(Interpreter::builtinEvalError):
18218
(Interpreter::builtinRangeError):
18219
(Interpreter::builtinReferenceError):
18220
(Interpreter::builtinSyntaxError):
18221
(Interpreter::builtinTypeError):
18222
(Interpreter::builtinURIError):
18223
(Interpreter::builtinEvalErrorPrototype):
18224
(Interpreter::builtinRangeErrorPrototype):
18225
(Interpreter::builtinReferenceErrorPrototype):
18226
(Interpreter::builtinSyntaxErrorPrototype):
18227
(Interpreter::builtinTypeErrorPrototype):
18228
(Interpreter::builtinURIErrorPrototype):
18229
(Interpreter::createLanguageInstanceForValue):
18230
* kjs/interpreter.h:
18231
(KJS::Interpreter::isGlobalObject):
18232
(KJS::ExecState::setException):
18233
(KJS::ExecState::clearException):
18234
(KJS::ExecState::exception):
18235
(KJS::ExecState::hadException):
18236
(KJS::ExecState::ExecState):
18240
(KJS::List::operator[]):
18241
(KJS::ListIterator::operator->):
18242
(KJS::ListIterator::operator*):
18243
(KJS::ListIterator::operator++):
18244
(KJS::ListIterator::operator--):
18246
(KJS::staticFunctionGetter):
18247
(KJS::staticValueGetter):
18249
(KJS::cacheGlobalObject):
18250
* kjs/math_object.cpp:
18251
(MathObjectImp::getValueProperty):
18252
(MathFuncImp::MathFuncImp):
18253
(MathFuncImp::callAsFunction):
18254
* kjs/math_object.h:
18256
(Node::evaluateReference):
18257
(Node::throwError):
18258
(Node::setExceptionDetailsIfNeeded):
18259
(NullNode::evaluate):
18260
(BooleanNode::evaluate):
18261
(NumberNode::evaluate):
18262
(StringNode::evaluate):
18263
(RegExpNode::evaluate):
18264
(ThisNode::evaluate):
18265
(ResolveNode::evaluate):
18266
(ResolveNode::evaluateReference):
18267
(GroupNode::evaluate):
18268
(ElementNode::evaluate):
18269
(ArrayNode::evaluate):
18270
(ObjectLiteralNode::evaluate):
18271
(PropertyValueNode::evaluate):
18272
(PropertyNode::evaluate):
18273
(AccessorNode1::evaluate):
18274
(AccessorNode1::evaluateReference):
18275
(AccessorNode2::evaluate):
18276
(AccessorNode2::evaluateReference):
18277
(ArgumentListNode::evaluate):
18278
(ArgumentListNode::evaluateList):
18279
(ArgumentsNode::evaluate):
18280
(NewExprNode::evaluate):
18281
(FunctionCallNode::evaluate):
18282
(PostfixNode::evaluate):
18283
(DeleteNode::evaluate):
18284
(VoidNode::evaluate):
18285
(TypeOfNode::evaluate):
18286
(PrefixNode::evaluate):
18287
(UnaryPlusNode::evaluate):
18288
(NegateNode::evaluate):
18289
(BitwiseNotNode::evaluate):
18290
(LogicalNotNode::evaluate):
18291
(MultNode::evaluate):
18292
(AddNode::evaluate):
18293
(ShiftNode::evaluate):
18294
(RelationalNode::evaluate):
18295
(EqualNode::evaluate):
18296
(BitOperNode::evaluate):
18297
(BinaryLogicalNode::evaluate):
18298
(ConditionalNode::evaluate):
18299
(AssignNode::evaluate):
18300
(CommaNode::evaluate):
18301
(StatListNode::execute):
18302
(AssignExprNode::evaluate):
18303
(VarDeclNode::evaluate):
18304
(VarDeclNode::processVarDecls):
18305
(VarDeclListNode::evaluate):
18306
(ExprStatementNode::execute):
18308
(DoWhileNode::execute):
18309
(WhileNode::execute):
18310
(ForNode::execute):
18311
(ForInNode::execute):
18312
(ContinueNode::execute):
18313
(BreakNode::execute):
18314
(ReturnNode::execute):
18315
(WithNode::execute):
18316
(CaseClauseNode::evaluate):
18317
(ClauseListNode::evaluate):
18318
(CaseBlockNode::evaluate):
18319
(CaseBlockNode::evalBlock):
18320
(SwitchNode::execute):
18321
(ThrowNode::execute):
18322
(CatchNode::execute):
18323
(TryNode::execute):
18324
(ParameterNode::evaluate):
18325
(FuncDeclNode::processFuncDecl):
18326
(FuncExprNode::evaluate):
18327
(SourceElementsNode::execute):
18329
(KJS::StatementNode::evaluate):
18330
* kjs/number_object.cpp:
18331
(NumberPrototypeImp::NumberPrototypeImp):
18332
(NumberProtoFuncImp::NumberProtoFuncImp):
18333
(NumberProtoFuncImp::callAsFunction):
18334
(NumberObjectImp::NumberObjectImp):
18335
(NumberObjectImp::getValueProperty):
18336
(NumberObjectImp::construct):
18337
(NumberObjectImp::callAsFunction):
18338
* kjs/number_object.h:
18340
(KJS::ObjectImp::call):
18341
(KJS::ObjectImp::mark):
18342
(KJS::ObjectImp::classInfo):
18343
(KJS::ObjectImp::get):
18344
(KJS::ObjectImp::getProperty):
18345
(KJS::ObjectImp::getPropertySlot):
18346
(KJS::ObjectImp::put):
18347
(KJS::ObjectImp::hasOwnProperty):
18348
(KJS::ObjectImp::defaultValue):
18349
(KJS::ObjectImp::findPropertyHashEntry):
18350
(KJS::ObjectImp::construct):
18351
(KJS::ObjectImp::callAsFunction):
18352
(KJS::ObjectImp::hasInstance):
18353
(KJS::ObjectImp::propList):
18354
(KJS::ObjectImp::toPrimitive):
18355
(KJS::ObjectImp::toNumber):
18356
(KJS::ObjectImp::toString):
18357
(KJS::ObjectImp::toObject):
18358
(KJS::ObjectImp::putDirect):
18359
(KJS::Error::create):
18363
(KJS::ObjectImp::getPropertySlot):
18364
(KJS::AllocatedValueImp::isObject):
18365
(KJS::ObjectImp::ObjectImp):
18366
(KJS::ObjectImp::internalValue):
18367
(KJS::ObjectImp::setInternalValue):
18368
(KJS::ObjectImp::prototype):
18369
(KJS::ObjectImp::setPrototype):
18370
(KJS::ObjectImp::inherits):
18371
* kjs/object_object.cpp:
18372
(ObjectPrototypeImp::ObjectPrototypeImp):
18373
(ObjectProtoFuncImp::ObjectProtoFuncImp):
18374
(ObjectProtoFuncImp::callAsFunction):
18375
(ObjectObjectImp::ObjectObjectImp):
18376
(ObjectObjectImp::construct):
18377
(ObjectObjectImp::callAsFunction):
18378
* kjs/object_object.h:
18379
* kjs/operations.cpp:
18381
(KJS::strictEqual):
18385
* kjs/operations.h:
18386
* kjs/property_map.cpp:
18387
(KJS::PropertyMap::mark):
18388
(KJS::PropertyMap::addEnumerablesToReferenceList):
18389
(KJS::PropertyMap::addSparseArrayPropertiesToReferenceList):
18390
(KJS::PropertyMap::save):
18391
(KJS::PropertyMap::restore):
18392
* kjs/property_map.h:
18393
* kjs/property_slot.cpp:
18394
(KJS::PropertySlot::undefinedGetter):
18395
* kjs/property_slot.h:
18396
(KJS::PropertySlot::getValue):
18398
(KJS::gcUnprotectNullTolerant):
18399
(KJS::ProtectedValue::ProtectedValue):
18400
(KJS::ProtectedValue::~ProtectedValue):
18401
(KJS::ProtectedValue::operator=):
18402
(KJS::ProtectedValue::operator ValueImp *):
18403
(KJS::ProtectedValue::operator->):
18404
* kjs/protected_object.h:
18405
(KJS::ProtectedObject::ProtectedObject):
18406
(KJS::ProtectedObject::operator=):
18407
(KJS::ProtectedObject::operator ValueImp *):
18408
(KJS::ProtectedObject::operator ObjectImp *):
18409
(KJS::ProtectedObject::operator->):
18410
(KJS::ProtectedReference::ProtectedReference):
18411
(KJS::ProtectedReference::~ProtectedReference):
18412
(KJS::ProtectedReference::operator=):
18413
* kjs/protected_values.cpp:
18414
(KJS::ProtectedValues::getProtectCount):
18415
(KJS::ProtectedValues::increaseProtectCount):
18416
(KJS::ProtectedValues::insert):
18417
(KJS::ProtectedValues::decreaseProtectCount):
18418
* kjs/protected_values.h:
18419
* kjs/reference.cpp:
18420
(KJS::Reference::Reference):
18421
(KJS::Reference::makeValueReference):
18422
(KJS::Reference::getBase):
18423
(KJS::Reference::getValue):
18424
(KJS::Reference::putValue):
18425
(KJS::Reference::deleteValue):
18427
(KJS::Reference::baseIfMutable):
18428
* kjs/regexp_object.cpp:
18429
(RegExpPrototypeImp::RegExpPrototypeImp):
18430
(RegExpProtoFuncImp::RegExpProtoFuncImp):
18431
(RegExpProtoFuncImp::callAsFunction):
18432
(RegExpObjectImp::RegExpObjectImp):
18433
(RegExpObjectImp::arrayOfMatches):
18434
(RegExpObjectImp::backrefGetter):
18435
(RegExpObjectImp::construct):
18436
(RegExpObjectImp::callAsFunction):
18437
* kjs/regexp_object.h:
18438
* kjs/string_object.cpp:
18439
(StringInstanceImp::lengthGetter):
18440
(StringInstanceImp::indexGetter):
18441
(StringInstanceImp::getOwnPropertySlot):
18442
(StringInstanceImp::put):
18443
(StringPrototypeImp::StringPrototypeImp):
18444
(StringProtoFuncImp::StringProtoFuncImp):
18447
(StringProtoFuncImp::callAsFunction):
18448
(StringObjectImp::StringObjectImp):
18449
(StringObjectImp::construct):
18450
(StringObjectImp::callAsFunction):
18451
(StringObjectFuncImp::StringObjectFuncImp):
18452
(StringObjectFuncImp::callAsFunction):
18453
* kjs/string_object.h:
18455
(TestFunctionImp::callAsFunction):
18456
(VersionFunctionImp::callAsFunction):
18459
(KJS::AllocatedValueImp::operator new):
18460
(KJS::AllocatedValueImp::getUInt32):
18461
(KJS::ValueImp::toInteger):
18462
(KJS::ValueImp::toInt32):
18463
(KJS::ValueImp::toUInt32):
18464
(KJS::ValueImp::toUInt16):
18465
(KJS::ValueImp::toObject):
18466
(KJS::AllocatedValueImp::getBoolean):
18467
(KJS::AllocatedValueImp::getNumber):
18468
(KJS::AllocatedValueImp::getString):
18469
(KJS::AllocatedValueImp::getObject):
18472
(KJS::ConstantValues::init):
18473
(KJS::ConstantValues::clear):
18474
(KJS::ConstantValues::mark):
18477
(KJS::jsUndefined):
18481
(KJS::ValueImp::ValueImp):
18482
(KJS::ValueImp::~ValueImp):
18483
(KJS::AllocatedValueImp::AllocatedValueImp):
18484
(KJS::AllocatedValueImp::~AllocatedValueImp):
18485
(KJS::AllocatedValueImp::isBoolean):
18486
(KJS::AllocatedValueImp::isNumber):
18487
(KJS::AllocatedValueImp::isString):
18488
(KJS::AllocatedValueImp::isObject):
18489
(KJS::AllocatedValueImp::marked):
18490
(KJS::AllocatedValueImp::mark):
18491
(KJS::ValueImp::downcast):
18492
(KJS::ValueImp::isUndefined):
18493
(KJS::ValueImp::isNull):
18494
(KJS::ValueImp::isUndefinedOrNull):
18495
(KJS::ValueImp::isBoolean):
18496
(KJS::ValueImp::isNumber):
18497
(KJS::ValueImp::isString):
18498
(KJS::ValueImp::isObject):
18499
(KJS::ValueImp::getBoolean):
18500
(KJS::ValueImp::getNumber):
18501
(KJS::ValueImp::getString):
18502
(KJS::ValueImp::getObject):
18503
(KJS::ValueImp::getUInt32):
18504
(KJS::ValueImp::mark):
18505
(KJS::ValueImp::marked):
18506
(KJS::ValueImp::type):
18507
(KJS::ValueImp::toPrimitive):
18508
(KJS::ValueImp::toBoolean):
18509
(KJS::ValueImp::toNumber):
18510
(KJS::ValueImp::toString):
18520
2005-08-06 Maciej Stachowiak <mjs@apple.com>
18524
Change over to the new PropertySlot mechanism for property
18525
lookup. This allows the elimination of hasOwnProperty
18526
methods. Also did some of the performance tuning enabled by this
18527
(but not yet all the possible improvements for function calls,
18528
assignment, ++, and so forth). And also much code cleanup.
18530
Net result is about a 2% speedup on the JS iBench.
18532
Also redid Geoff's fix for the chrashing applet by avoiding a NULL
18533
prototype in the bindings code and using the default of Null()
18536
* JavaScriptCore.xcodeproj/project.pbxproj:
18537
* bindings/objc/objc_runtime.h:
18538
* bindings/objc/objc_runtime.mm:
18539
(ObjcFallbackObjectImp::ObjcFallbackObjectImp):
18540
(ObjcFallbackObjectImp::getOwnPropertySlot):
18541
* bindings/runtime_array.cpp:
18542
(RuntimeArrayImp::lengthGetter):
18543
(RuntimeArrayImp::indexGetter):
18544
(RuntimeArrayImp::getOwnPropertySlot):
18545
* bindings/runtime_array.h:
18546
* bindings/runtime_method.cpp:
18547
(RuntimeMethodImp::lengthGetter):
18548
(RuntimeMethodImp::getOwnPropertySlot):
18549
* bindings/runtime_method.h:
18550
* bindings/runtime_object.cpp:
18551
(RuntimeObjectImp::RuntimeObjectImp):
18552
(RuntimeObjectImp::fallbackObjectGetter):
18553
(RuntimeObjectImp::fieldGetter):
18554
(RuntimeObjectImp::methodGetter):
18555
(RuntimeObjectImp::getOwnPropertySlot):
18556
* bindings/runtime_object.h:
18557
* bindings/runtime_root.h:
18558
* kjs/array_instance.h:
18559
* kjs/array_object.cpp:
18560
(ArrayInstanceImp::lengthGetter):
18561
(ArrayInstanceImp::getOwnPropertySlot):
18562
(ArrayPrototypeImp::getOwnPropertySlot):
18563
* kjs/array_object.h:
18564
* kjs/date_object.cpp:
18565
(DatePrototypeImp::getOwnPropertySlot):
18566
* kjs/date_object.h:
18567
* kjs/function.cpp:
18568
(KJS::FunctionImp::argumentsGetter):
18569
(KJS::FunctionImp::lengthGetter):
18570
(KJS::FunctionImp::getOwnPropertySlot):
18571
(KJS::FunctionImp::put):
18572
(KJS::FunctionImp::deleteProperty):
18573
(KJS::ArgumentsImp::mappedIndexGetter):
18574
(KJS::ArgumentsImp::getOwnPropertySlot):
18575
(KJS::ActivationImp::argumentsGetter):
18576
(KJS::ActivationImp::getArgumentsGetter):
18577
(KJS::ActivationImp::getOwnPropertySlot):
18578
(KJS::ActivationImp::deleteProperty):
18580
* kjs/internal.cpp:
18581
(InterpreterImp::InterpreterImp):
18582
(InterpreterImp::initGlobalObject):
18583
(InterpreterImp::~InterpreterImp):
18584
(InterpreterImp::evaluate):
18586
(KJS::InterpreterImp::globalExec):
18587
* kjs/interpreter.cpp:
18588
(Interpreter::Interpreter):
18589
(Interpreter::createLanguageInstanceForValue):
18590
* kjs/interpreter.h:
18591
(KJS::Interpreter::argumentsIdentifier):
18592
(KJS::Interpreter::specialPrototypeIdentifier):
18594
(KJS::staticFunctionGetter):
18595
(KJS::staticValueGetter):
18596
(KJS::getStaticPropertySlot):
18597
(KJS::getStaticFunctionSlot):
18598
(KJS::getStaticValueSlot):
18599
* kjs/math_object.cpp:
18600
(MathObjectImp::getOwnPropertySlot):
18601
* kjs/math_object.h:
18603
(ResolveNode::evaluate):
18604
(ResolveNode::evaluateReference):
18605
(AccessorNode1::evaluate):
18606
(AccessorNode2::evaluate):
18607
* kjs/number_object.cpp:
18608
(NumberObjectImp::getOwnPropertySlot):
18609
* kjs/number_object.h:
18611
(KJS::ObjectImp::get):
18612
(KJS::ObjectImp::getProperty):
18613
(KJS::ObjectImp::getPropertySlot):
18614
(KJS::ObjectImp::getOwnPropertySlot):
18615
(KJS::ObjectImp::put):
18616
(KJS::ObjectImp::hasProperty):
18617
(KJS::ObjectImp::hasOwnProperty):
18619
(KJS::ObjectImp::getDirectLocation):
18620
(KJS::ObjectImp::getPropertySlot):
18621
(KJS::ObjectImp::getOwnPropertySlot):
18622
* kjs/object_wrapper.h: Added.
18624
(KJS::Object::Object):
18625
(KJS::Object::operator ObjectImp *):
18626
* kjs/property_map.cpp:
18627
(KJS::PropertyMap::getLocation):
18628
* kjs/property_map.h:
18629
* kjs/property_slot.cpp: Added.
18630
(KJS::PropertySlot::undefinedGetter):
18631
* kjs/property_slot.h: Added.
18632
(KJS::PropertySlot::isSet):
18633
(KJS::PropertySlot::getValue):
18634
(KJS::PropertySlot::setValueSlot):
18635
(KJS::PropertySlot::setStaticEntry):
18636
(KJS::PropertySlot::setCustom):
18637
(KJS::PropertySlot::setCustomIndex):
18638
(KJS::PropertySlot::setUndefined):
18639
(KJS::PropertySlot::slotBase):
18640
(KJS::PropertySlot::staticEntry):
18641
(KJS::PropertySlot::index):
18642
(KJS::PropertySlot::):
18644
* kjs/protected_object.h: Added.
18645
(KJS::ProtectedObject::ProtectedObject):
18646
(KJS::ProtectedObject::~ProtectedObject):
18647
(KJS::ProtectedObject::operator=):
18648
(KJS::ProtectedReference::ProtectedReference):
18649
(KJS::ProtectedReference::~ProtectedReference):
18650
(KJS::ProtectedReference::operator=):
18652
* kjs/reference_list.cpp:
18653
* kjs/regexp_object.cpp:
18654
(RegExpObjectImp::backrefGetter):
18655
(RegExpObjectImp::getOwnPropertySlot):
18656
* kjs/regexp_object.h:
18657
* kjs/string_object.cpp:
18658
(StringInstanceImp::lengthGetter):
18659
(StringInstanceImp::indexGetter):
18660
(StringInstanceImp::getOwnPropertySlot):
18661
(StringPrototypeImp::getOwnPropertySlot):
18662
* kjs/string_object.h:
18664
2005-08-05 Adele Peterson <adele@apple.com>
18668
* JavaScriptCore.xcodeproj/project.pbxproj: Unchecked 'statics are thread safe' option.
18670
2005-08-05 Geoffrey Garen <ggaren@apple.com>
18672
-fixed <rdar://problem/4207220> REGRESSION (DENVER): Crash occurs
18673
after clicking on Hangman applet
18678
(KJS::ObjectImp::hasProperty): added check for null prototype.
18680
FIXME: The long-term plan is to make runtime objects use JS Null()
18681
instead of null pointers, which will allow us to eliminate null
18682
checks, improving performance.
18684
2005-08-05 Geoffrey Garen <ggaren@apple.com>
18686
Fix by darin, reviewed by me.
18688
- rolled in fix for: <rdar://problem/4161606> JavaScript regular
18689
expressions with certain ranges of Unicode characters cause a crash
18693
* layout-tests/fast/js/regexp-big-unicode-ranges-expected.txt: Added.
18694
* layout-tests/fast/js/regexp-big-unicode-ranges.html: Added.
18697
(compile_branch): added checks for characters > 255
18699
2005-08-04 Maciej Stachowiak <mjs@apple.com>
18701
- updated expected test results now that we no longer exlude the
18702
date tests (apparently this was overlooked)
18704
* tests/mozilla/expected.html:
18706
2005-07-31 Darin Adler <darin@apple.com>
18708
Reviewed by Maciej.
18710
- remove uses of Mac-OS-X-specific MAX macro
18711
- remove one of the many excess "APPLE_CHANGES" ifdefs
18713
* kjs/collector.cpp: (KJS::Collector::allocate): Use std::max instead of MAX.
18714
* kjs/property_map.cpp: (KJS::PropertyMap::rehash): Ditto.
18716
(KJS::UChar::toLower): Take out non-ICU code path.
18717
(KJS::UChar::toUpper): Ditto.
18718
(KJS::UString::spliceSubstringsWithSeparators): Use std::max instead of MAX.
18720
2005-07-27 Geoffrey Garen <ggaren@apple.com>
18722
- fixed http://bugs.webkit.org/show_bug.cgi?id=4147
18723
Array.toString() and toLocaleString() improvements from KDE KJS
18724
(rolled in KDE changes)
18728
* layout-tests/fast/js/toString-overrides-expected.txt: Added.
18729
* layout-tests/fast/js/toString-overrides.html: Added.
18731
* kjs/array_object.cpp:
18732
(ArrayProtoFuncImp::call):
18734
2005-07-27 Maciej Stachowiak <mjs@apple.com>
18736
Changes by Michael Kahl, reviewed by me.
18738
- fixed <rdar://problem/4194278> Need better debugging support in JavaScriptCore
18740
* JavaScriptCore.xcodeproj/project.pbxproj:
18741
* kjs/debugger.cpp:
18742
(KJS::AttachedInterpreter::AttachedInterpreter):
18743
(KJS::AttachedInterpreter::~AttachedInterpreter):
18744
(Debugger::~Debugger):
18745
(Debugger::attach):
18746
(Debugger::detach):
18747
(Debugger::sourceParsed):
18749
* kjs/function.cpp:
18750
(KJS::FunctionImp::call):
18751
(KJS::GlobalFuncImp::call):
18752
* kjs/function_object.cpp:
18753
(FunctionObjectImp::construct):
18755
* kjs/internal.cpp:
18757
(InterpreterImp::evaluate):
18759
(KJS::InterpreterImp::setDebugger):
18760
* kjs/interpreter.cpp:
18761
* kjs/interpreter.h:
18762
(KJS::Interpreter::imp):
18765
2005-07-27 Geoffrey Garen <ggaren@apple.com>
18767
- fixed http://bugs.webkit.org/show_bug.cgi?id=3381
18768
Date.prototype.setDate() incorrect for values >=128
18770
- Test cases added:
18772
* layout-tests/fast/js/date-big-setdate-expected.txt: Added.
18773
* layout-tests/fast/js/date-big-setdate.html: Added.
18777
* kjs/date_object.cpp:
18778
(DateProtoFuncImp::call):
18780
2005-07-27 Geoffrey Garen <ggaren@apple.com>
18782
-rolled in patch by Carsten Guenther <cguenther@gmail.com>
18783
for http://bugs.webkit.org/show_bug.cgi?id=3759
18784
Date object enhancements
18788
* layout-tests/fast/js/date-preserve-milliseconds-expected.txt: Added.
18789
* layout-tests/fast/js/date-preserve-milliseconds.html: Added.
18793
* kjs/date_object.cpp:
18795
(DateProtoFuncImp::call):
18796
(DateObjectImp::construct):
18797
(DateObjectFuncImp::call):
18799
* kjs/date_object.h:
18800
* tests/mozilla/expected.html:
18802
2005-07-26 Justin Garcia <justin.garcia@apple.com>
18804
Added a forward declaration to fix gcc4 build error
18808
2005-07-25 Geoffrey Garen <ggaren@apple.com>
18809
- fixed mistake in my last checkin -- the expected results included
18810
results from a patch that hasn't landed yet.
18812
* tests/mozilla/expected.html:
18814
2005-07-25 Maciej Stachowiak <mjs@apple.com>
18816
- fix mistake in last change that leads to assertion failure in the Development build
18819
(KJS::lookupGetOwnValue):
18821
2005-07-24 Maciej Stachowiak <mjs@apple.com>
18825
- http://bugs.webkit.org/show_bug.cgi?id=4124
18826
(change JavaScript property access to avoid double lookup)
18828
- 10% speedup on JavaScript iBench
18829
- 5% speedup on 24fun BenchJS benchmark
18831
Changed all get methods to getOwnProperty - they are no longer
18832
responsible for prototype lookup, and determine if the property
18833
was found as a side efect.
18835
get() is now a nonvirtual ObjectImp method which calls the virtual
18836
getOwnProperty and walks the prototype chain. A few selected
18837
methods were inlined.
18839
Changed ResolveNode::evaluate plus some other places to use
18840
getProperty which does get() and hasProperty() in one lookup.
18842
Also miscellaneous code cleanup.
18844
* bindings/objc/objc_runtime.h:
18845
* bindings/objc/objc_runtime.mm:
18846
(ObjcFallbackObjectImp::ObjcFallbackObjectImp):
18847
(ObjcFallbackObjectImp::getOwnProperty):
18848
* bindings/runtime_array.cpp:
18849
(RuntimeArrayImp::RuntimeArrayImp):
18850
(RuntimeArrayImp::getOwnProperty):
18851
* bindings/runtime_array.h:
18852
* bindings/runtime_method.cpp:
18853
(RuntimeMethodImp::getOwnProperty):
18854
* bindings/runtime_method.h:
18855
* bindings/runtime_object.cpp:
18856
(RuntimeObjectImp::getOwnProperty):
18857
* bindings/runtime_object.h:
18858
* kjs/array_instance.h:
18859
* kjs/array_object.cpp:
18860
(ArrayInstanceImp::getOwnProperty):
18861
(ArrayPrototypeImp::getOwnProperty):
18862
(ArrayProtoFuncImp::call):
18863
* kjs/array_object.h:
18864
* kjs/date_object.cpp:
18865
(DatePrototypeImp::getOwnProperty):
18866
* kjs/date_object.h:
18867
* kjs/function.cpp:
18868
(KJS::FunctionImp::getOwnProperty):
18869
(KJS::ArgumentsImp::getOwnProperty):
18870
(KJS::ActivationImp::getOwnProperty):
18873
(KJS::lookupGetOwnProperty):
18874
(KJS::lookupGetOwnFunction):
18875
(KJS::lookupGetOwnValue):
18876
* kjs/math_object.cpp:
18877
(MathObjectImp::getOwnProperty):
18878
(MathObjectImp::getValueProperty):
18879
* kjs/math_object.h:
18881
(ResolveNode::evaluate):
18882
* kjs/number_object.cpp:
18883
(NumberObjectImp::getOwnProperty):
18884
* kjs/number_object.h:
18886
(KJS::ObjectImp::get):
18887
(KJS::ObjectImp::getOwnProperty):
18888
(KJS::ObjectImp::getProperty):
18890
(KJS::ObjectImp::getProperty):
18891
(KJS::ObjectImp::getOwnProperty):
18892
* kjs/object_object.cpp:
18893
(ObjectProtoFuncImp::call):
18894
* kjs/regexp_object.cpp:
18895
(RegExpObjectImp::getOwnProperty):
18896
* kjs/regexp_object.h:
18897
* kjs/string_object.cpp:
18898
(StringInstanceImp::getOwnProperty):
18899
(StringPrototypeImp::getOwnProperty):
18900
* kjs/string_object.h:
18902
2005-07-25 Geoffrey Garen <ggaren@apple.com>
18904
- fixed http://bugs.webkit.org/show_bug.cgi?id=3971
18905
JS test suite depends on JS 1.2 behavior
18909
* tests/mozilla/js1_2/Array/tostring_1.js: now tests only for JS 1.5 behavior
18910
* tests/mozilla/js1_2/Array/tostring_2.js: ditto
18911
* tests/mozilla/expected.html:
18913
2005-07-24 Justin Garcia <justin.garcia@apple.com>
18917
Fixes make clean problem introduced in xcode2.1 transition
18921
2005-07-22 Geoffrey Garen <ggaren@apple.com>
18925
* kjs/date_object.cpp: DatePrototypeImp now identifies itself as a
18926
child class of DateInstanceImp -- this enables calls to Date.ValueOf().
18928
fixes: ecma/Date/15.9.5.js (once we enable the date tests).
18930
2005-07-22 Geoffrey Garen <ggaren@apple.com>
18935
* tests/mozilla/jsDriver.pl: now takes the path to testkjs as a command-line argument
18936
* tests/mozilla/run-mozilla-tests: Removed.
18938
2005-07-21 Geoffrey Garen <ggaren@apple.com>
18940
* JavaScriptCore.xcodeproj/.cvsignore: Added.
18942
2005-07-21 Geoffrey Garen <ggaren@apple.com>
18944
* JavaScriptCore.pbproj/project.pbxproj: Removed.
18945
* JavaScriptCore.xcodeproj/ggaren.pbxuser: Added.
18946
* JavaScriptCore.xcodeproj/ggaren.perspective: Added.
18947
* JavaScriptCore.xcodeproj/project.pbxproj: Added.
18950
2005-07-20 Maciej Stachowiak <mjs@apple.com>
18952
Patch from Trey Matteson <trey@usa.net>, reviewed by me.
18954
- fixed http://bugs.webkit.org/show_bug.cgi?id=3956
18955
some of WebKit builds with symbols, some doesn't
18957
* JavaScriptCore.pbproj/project.pbxproj: Generate symbols even for
18960
2005-07-19 Geoffrey Garen <ggaren@apple.com>
18962
-fixed http://bugs.webkit.org/show_bug.cgi?id=3991
18963
JSC doesn't implement Array.prototype.toLocaleString()
18965
-test failure: ecma_3/Array/15.4.4.3-1.js
18969
* kjs/array_object.cpp:
18970
(ArrayProtoFuncImp::call): now searches for toString and
18971
toLocaleString overrides in the array's elements
18973
* tests/mozilla/expected.html: failures are under 100! woohoo!
18975
2005-07-19 Darin Adler <darin@apple.com>
18979
* kjs/lookup.h: (KJS::lookupPut): Remove bogus const; was preventing WebCore from
18980
compiling (not sure why this didn't affect my other build machine).
18982
- one other tiny tweak (so sue me)
18984
* bindings/runtime_root.cpp: Remove unneeded declaration.
18986
2005-07-19 Darin Adler <darin@apple.com>
18988
Reviewed by Geoff Garen.
18990
- eliminated try wrappers for get/put/call since we don't use C++ exceptions any more
18992
* kjs/lookup.h: Changed tryCall in IMPLEMENT_PROTOFUNC here to call. It doesn't make
18993
sense for this macro to use the name tryCall anyway, since that's specific to how
18994
WebCore used this, so this is good anyway. On the other hand, it might be a problem
18995
for KDOM or KSVG, in which case we'll need another macro for them, since JavaScriptCore
18996
should presumably not have the C++ exception support.
18998
2005-07-18 Geoffrey Garen <ggaren@apple.com>
19000
-fixed http://bugs.webkit.org/show_bug.cgi?id=4008
19001
Error objects report incorrect length
19005
* kjs/error_object.cpp: Error objects now include a length property
19006
(ErrorObjectImp::ErrorObjectImp):
19008
* tests/mozilla/expected.html: updated expected results to reflect fix
19009
* tests/mozilla/js1_5/Exceptions/regress-123002.js: test now expects
19010
ecma compliant results
19012
2005-07-15 Geoffrey Garen <ggaren@apple.com>
19014
-rolled in KDE fixes for http://bugs.webkit.org/show_bug.cgi?id=3601
19015
Error instance type info
19019
* kjs/error_object.cpp:
19020
- Created ErrorInstanceImp class for Error() objects.
19021
- Changed parent object for Native Errors to "Function" (matches
19023
(ErrorInstanceImp::ErrorInstanceImp):
19024
(ErrorProtoFuncImp::call):
19025
(ErrorObjectImp::construct):
19026
(NativeErrorImp::construct):
19028
* kjs/error_object.h:
19029
(KJS::ErrorInstanceImp::classInfo):
19030
* kjs/object.h: made comment more informative about ClassInfo
19032
* tests/mozilla/expected.html:
19034
2005-07-14 Geoffrey Garen <ggaren@apple.com>
19036
- fixed: JS test suite expects an out of memory error
19037
that our memory efficiency avoids
19041
* tests/mozilla/js1_5/Array/regress-157652.js:
19042
test now expects normal execution
19044
* tests/mozilla/expected.html:
19046
2005-07-14 Geoffrey Garen <ggaren@apple.com>
19047
- fixed http://bugs.webkit.org/show_bug.cgi?id=4006
19048
testkjs doesn't implement gc()
19051
ecma_3/Function/regress-104584.js
19055
* kjs/interpreter.cpp:
19056
(Interpreter::finalCheck): removed misleading while && comment
19058
* kjs/testkjs.cpp: added "gc" function to global object
19059
(TestFunctionImp::):
19060
(TestFunctionImp::call):
19063
* tests/mozilla/expected.html:
19065
2005-07-14 Geoffrey Garen <ggaren@apple.com>
19067
-rolled in patches for http://bugs.webkit.org/show_bug.cgi?id=3945
19068
[PATCH] Safe merges of comments and other trivialities from KDE's kjs
19070
-patch by Martijn Klingens <klingens@kde.org>
19072
* kjs/array_instance.h:
19073
* kjs/array_object.cpp:
19074
* kjs/array_object.h:
19075
* kjs/bool_object.cpp:
19076
* kjs/bool_object.h:
19077
* kjs/collector.cpp:
19079
* kjs/completion.h:
19081
* kjs/date_object.cpp:
19082
* kjs/date_object.h:
19083
* kjs/debugger.cpp:
19086
* kjs/error_object.cpp:
19087
* kjs/error_object.h:
19088
* kjs/function.cpp:
19090
* kjs/function_object.cpp:
19091
* kjs/function_object.h:
19093
* kjs/identifier.cpp:
19094
* kjs/identifier.h:
19095
* kjs/internal.cpp:
19097
* kjs/interpreter.cpp:
19098
* kjs/interpreter.h:
19099
* kjs/interpreter_map.cpp:
19100
* kjs/interpreter_map.h:
19107
* kjs/math_object.cpp:
19108
* kjs/math_object.h:
19111
* kjs/nodes2string.cpp:
19112
* kjs/number_object.cpp:
19113
* kjs/number_object.h:
19116
* kjs/object_object.cpp:
19117
* kjs/object_object.h:
19118
* kjs/operations.cpp:
19119
* kjs/operations.h:
19120
* kjs/property_map.cpp:
19121
* kjs/property_map.h:
19122
* kjs/reference.cpp:
19124
* kjs/reference_list.cpp:
19125
* kjs/reference_list.h:
19128
* kjs/regexp_object.cpp:
19129
* kjs/regexp_object.h:
19130
* kjs/scope_chain.cpp:
19131
* kjs/scope_chain.h:
19132
* kjs/simple_number.h:
19133
* kjs/string_object.cpp:
19134
* kjs/string_object.h:
19142
2005-07-14 Geoffrey Garen <ggaren@apple.com>
19144
-fixed http://bugs.webkit.org/show_bug.cgi?id=3970
19145
throw statements fail inside eval statements
19149
* kjs/function.cpp:
19150
(KJS::GlobalFuncImp::call):
19151
Big change since I fixed the tabbing. The important part is:
19152
if (c.complType() == Throw)
19153
exec->setException(c.value());
19156
(ThrowNode::execute): removed duplicate KJS_CHECKEXCEPTION
19157
(TryNode::execute):
19158
try now clears the exception state before the finally block executes,
19159
and checks the state after the block executes, so that exceptions in
19160
finally code get caught.
19162
* tests/mozilla/expected.html:
19164
2005-07-14 Geoffrey Garen <ggaren@apple.com>
19166
-landed fix for http://bugs.webkit.org/show_bug.cgi?id=3412
19167
Object.prototype is missing toLocaleString
19169
- patch by Mark Rowe (bdash) <opendarwin.org@bdash.net.nz>
19171
-layout test info in webcore changelog
19175
* kjs/object_object.cpp:
19176
(ObjectPrototypeImp::ObjectPrototypeImp):
19177
(ObjectProtoFuncImp::call):
19178
* kjs/object_object.h:
19179
(KJS::ObjectProtoFuncImp::):
19181
2005-07-12 Geoffrey Garen <ggaren@apple.com>
19185
* kjs/function.cpp:
19186
(KJS::IndexToNameMap::operator[]): fixed infinite recursion
19187
bug in last checkin
19189
2005-07-12 Geoffrey Garen <ggaren@apple.com>
19191
-fixed http://bugs.webkit.org/show_bug.cgi?id=3881
19192
arguments object should share values with function parameters
19196
ArgumentsImp now uses a simple hash lookup to share values
19197
with the activation object.
19199
* kjs/function.cpp:
19200
(KJS::FunctionImp::getParameterName):
19201
(KJS::IndexToNameMap::IndexToNameMap):
19202
(KJS::IndexToNameMap::~IndexToNameMap):
19203
(KJS::IndexToNameMap::isMapped):
19204
(KJS::IndexToNameMap::unMap):
19205
(KJS::IndexToNameMap::operator[]):
19206
(KJS::ArgumentsImp::ArgumentsImp):
19207
(KJS::ArgumentsImp::mark):
19208
(KJS::ArgumentsImp::get):
19209
(KJS::ArgumentsImp::put):
19210
(KJS::ArgumentsImp::deleteProperty):
19211
(KJS::ArgumentsImp::hasOwnProperty):
19212
(KJS::ActivationImp::createArgumentsObject):
19214
* tests/mozilla/expected.html: updated results
19216
2005-07-09 Maciej Stachowiak <mjs@apple.com>
19218
- backing out my earlier collector change, it causes a performance regression in TOT
19220
* kjs/collector.cpp:
19221
(KJS::Collector::allocate):
19223
2005-07-08 Eric Seidel <eseidel@apple.com>
19225
Reviewed by mjs/hyatt (only in concept).
19227
* JavaScriptCore.pbproj/project.pbxproj: Added JavaScriptCore+SVG
19228
Turns on RTTI support for JavaScriptCore.framework when
19229
building the JavaScriptCore+SVG target. This is needed as
19230
kdom (part of WebCore+SVG) requires RTTI for the time being.
19232
2005-07-08 Maciej Stachowiak <mjs@apple.com>
19236
- When there are many live objects, GC less often, to try to make
19237
GC cost proportional to garbage, not proportional to total memory used.
19239
* kjs/collector.cpp:
19240
(KJS::Collector::allocate):
19242
2005-07-08 Vicki Murley <vicki@apple.com>
19244
Fix from Carsten Guenther, reviewed by Maciej
19246
- fixed http://bugs.webkit.org/show_bug.cgi?id=3644 (Error string representation)
19248
Switch from "-" to ":" in error strings.
19250
* kjs/error_object.cpp:
19251
(ErrorProtoFuncImp::call):
19252
* tests/mozilla/expected.html:
19254
2005-07-08 Geoffrey Garen <ggaren@apple.com>
19256
-rolled in patch for http://bugs.webkit.org/show_bug.cgi?id=3878
19257
arguments object should be an object not an array
19261
* kjs/function.cpp:
19262
(KJS::ArgumentsImp::ArgumentsImp): now manually handles initialization
19263
we used to get for free by inheriting from ArrayInstanceImp
19264
* kjs/function.h: ArgumentsImp now inherits from ObjectImp
19265
* tests/mozilla/expected.html: updated expected test results
19267
2005-07-07 Eric Seidel <eseidel@apple.com>
19271
* kjs/grammar.y: removed #define YYMAXDEPTH 0 for bison 2.0
19272
http://bugs.webkit.org/show_bug.cgi?id=3882
19274
2005-07-03 Maciej Stachowiak <mjs@apple.com>
19276
Original patch from Mark Rowe <opendarwin.org@bdash.net.nz>, reviewed by me.
19277
Fixes to patch by me, reviewed by John Sullivan.
19279
- fixed http://bugs.webkit.org/show_bug.cgi?id=3293
19282
* tests/mozilla/expected.html: Two tests newly pass.
19284
* bindings/objc/objc_runtime.h:
19285
* bindings/objc/objc_runtime.mm:
19286
(ObjcFallbackObjectImp::hasOwnProperty):
19287
* bindings/runtime_array.cpp:
19288
(RuntimeArrayImp::hasOwnProperty):
19289
* bindings/runtime_array.h:
19290
* bindings/runtime_object.cpp:
19291
(RuntimeObjectImp::hasOwnProperty):
19292
* bindings/runtime_object.h:
19293
* kjs/array_instance.h:
19294
* kjs/array_object.cpp:
19295
(ArrayInstanceImp::hasOwnProperty):
19296
* kjs/function.cpp:
19297
(KJS::FunctionImp::hasOwnProperty):
19298
(KJS::ActivationImp::hasOwnProperty):
19302
(KJS::ObjectImp::hasProperty):
19303
(KJS::ObjectImp::hasOwnProperty):
19305
(KJS::Object::hasOwnProperty):
19306
* kjs/object_object.cpp:
19307
(ObjectPrototypeImp::ObjectPrototypeImp):
19308
(ObjectProtoFuncImp::call):
19309
* kjs/object_object.h:
19310
(KJS::ObjectProtoFuncImp::):
19311
* kjs/string_object.cpp:
19312
(StringInstanceImp::hasOwnProperty):
19313
* kjs/string_object.h:
19315
2005-07-01 Geoffrey Garen <ggaren@apple.com>
19317
-landed patch by Eric Seidel <macdome@opendarwin.org>
19319
-for http://bugs.webkit.org/show_bug.cgi?id=3657
19320
GroundWork: Moving some functions from khtml->jsc following kjs TOT
19322
- no layout test necessary yet - only groundwork
19327
(KJS::cacheGlobalObject):
19329
2005-07-01 Geoffrey Garen <ggaren@apple.com>
19331
-landed patch by Carsten Guenther <cguenther@gmail.com>
19333
-fixes http://bugs.webkit.org/show_bug.cgi?id=3477
19334
some US-centric date formats not parsed by JavaScript (clock at news8austin.com)
19337
mozilla/ecma_3/Date/15.9.5.5.js
19338
layout-tests/fast/js/date-parse-test.html
19342
* kjs/date_object.cpp:
19343
(formatLocaleDate):
19351
(DateProtoFuncImp::call):
19352
(DateObjectImp::construct):
19354
(ymdhms_to_seconds):
19357
(KJS::KRFCDate_parseDate):
19358
* kjs/date_object.h:
19359
* tests/mozilla/expected.html: updated expected results to reflect fix
19361
2005-07-01 Geoffrey Garen <ggaren@apple.com>
19363
-fixed <rdar://problem/4168186> JavaScript fails to throw exceptions
19364
for invalid return statements
19367
ecma/Statements/12.9-1-n.js
19368
ecma_2/Exceptions/lexical-052.js
19369
ecma_2/Exceptions/statement-009.js
19371
Reviewed by sullivan.
19374
(ReturnNode::execute): now throws exception if return is not inside
19377
* tests/mozilla/expected.html: updated to reflect fix
19379
2005-07-01 Geoffrey Garen <ggaren@apple.com>
19381
Reviewed by sullivan.
19383
* tests/mozilla/expected.html: Updated test results for last fix.
19385
2005-07-01 Geoffrey Garen <ggaren@apple.com>
19387
-fixed <rdar://problem/4168161> JavaScript fails to throw an exception
19388
for invalid function calls
19390
Reviewed by sullivan.
19392
Relevant mozilla test: ecma_3/Exceptions/regress-95101.js
19395
(FunctionCallNode::evaluate): evaluate now checks for an exception
19396
after resolving a function name (in case the function is undefined)
19398
2005-07-01 Eric Seidel <eseidel@apple.com>
19402
* kjs/interpreter.h:
19403
(KJS::Context::curStmtFirstLine): stub for compatibility with KDE
19405
(KJS::Value::isValid): compatibility with KDE
19406
http://bugs.webkit.org/show_bug.cgi?id=3687
19408
2005-07-01 Eric Seidel <eseidel@apple.com>
19412
* kjs/create_hash_table: rolled in changes from KDE, including
19413
-n <namespace> support from KDOM and support for newer comments
19414
http://bugs.webkit.org/show_bug.cgi?id=3771
19416
2005-06-30 Geoffrey Garen <ggaren@apple.com>
19418
-rolled in KDE fix to <rdar://problem/4167660> JavaScript fails to
19419
throw exceptions for invalid break/continue statements
19421
No layout tests because it's already covered by the Mozilla suite
19425
* kjs/internal.h: LabelStack now tracks where you are relative to
19426
switch and iteration (loop) statements
19428
(KJS::LabelStack::LabelStack):
19429
(KJS::LabelStack::pushIteration):
19430
(KJS::LabelStack::popIteration):
19431
(KJS::LabelStack::inIteration):
19432
(KJS::LabelStack::pushSwitch):
19433
(KJS::LabelStack::popSwitch):
19434
(KJS::LabelStack::inSwitch):
19437
These files were updated to use the new LabelStack:
19438
(DoWhileNode::execute):
19439
(WhileNode::execute):
19440
(ForNode::execute):
19441
(ForInNode::execute):
19442
(SwitchNode::execute):
19444
These files were updated to throw exceptions for invalid
19445
break/continue statements:
19446
(BreakNode::execute):
19447
(ContinueNode::execute):
19449
* tests/mozilla/expected.html: Updated expected results to reflect fix
19451
2005-06-30 Kevin Decker <kdecker@apple.com>
19455
fixed: <rdar://problem/4166838> failed assertion in`Interpreter::lockCount() > 0
19457
no layout test added; this is in the bindings code.
19459
* bindings/objc/WebScriptObject.mm:
19460
(+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]): make sure to lock and unlock the interpreter around allocations.
19462
2005-06-29 Geoffrey Garen <ggaren@apple.com>
19464
Patch by Francisco Tolmasky <tolmasky@gmail.com>
19466
- fixes http://bugs.webkit.org/show_bug.cgi?id=3667
19467
Core JavaScript 1.5 Reference:Objects:Array:forEach
19469
See WebCore Changelog for layout tests added.
19473
* kjs/array_object.cpp:
19474
(ArrayProtoFuncImp::call):
19475
* kjs/array_object.h:
19476
(KJS::ArrayProtoFuncImp::):
19478
2005-06-29 Geoffrey Garen <ggaren@apple.com>
19480
Patch contributed by Oliver Hunt <ojh16@student.canterbury.ac.nz>
19482
-fixed http://bugs.webkit.org/show_bug.cgi?id=3743
19483
Incorrect error message given for certain calls
19485
See WebCore Changelog for layout test added.
19490
(KJS::ObjectImp::defaultValue):
19492
2005-06-29 Geoffrey Garen <ggaren@apple.com>
19494
Rolling out date patch from 6-28-05 because it breaks
19495
fast/js/date-parse-test
19497
* kjs/date_object.cpp:
19498
(formatLocaleDate):
19499
(DateProtoFuncImp::call):
19500
(DateObjectImp::construct):
19502
(ymdhms_to_seconds):
19504
(KJS::KRFCDate_parseDate):
19505
* kjs/date_object.h:
19506
* tests/mozilla/expected.html:
19508
2005-06-29 Geoffrey Garen <ggaren@apple.com>
19512
-fixes http://bugs.webkit.org/show_bug.cgi?id=3750
19513
build fails with KJS_VERBOSE set
19515
* kjs/nodes.cpp: changed debug print statement to use UString
19516
(VarDeclNode::evaluate):
19517
* kjs/reference.cpp: ditto
19518
(KJS::Reference::putValue):
19520
2005-06-28 Geoffrey Garen <ggaren@apple.com>
19522
Patch contributed by Carsten Guenther <cguenther@gmail.com>.
19524
-fixes http://bugs.webkit.org/show_bug.cgi?id=3477
19525
some US-centric date formats not parsed by JavaScript (clock at news8austin.com)
19529
* kjs/date_object.cpp:
19530
(formatLocaleDate):
19538
(DateProtoFuncImp::call):
19539
(DateObjectImp::construct):
19541
(ymdhms_to_seconds):
19544
(KJS::KRFCDate_parseDate):
19545
* kjs/date_object.h:
19546
* tests/mozilla/expected.html: updated expected test results to reflect fix
19548
2005-06-26 Maciej Stachowiak <mjs@apple.com>
19552
- replace hash functions with better ones
19554
* JavaScriptCore.pbproj/project.pbxproj: Add new file to build.
19555
* kjs/interpreter_map.cpp:
19556
(KJS::InterpreterMap::computeHash): Use shared pointer hash.
19557
* kjs/pointer_hash.h: Added.
19558
(KJS::pointerHash): Pointer hash based on 32-bit mix and 64-bit mix hashes.
19559
* kjs/protected_values.cpp:
19560
(KJS::ProtectedValues::computeHash): Use shared pointer hash.
19562
(KJS::UString::Rep::computeHash): Use SuperFastHash algorithm.
19564
2005-06-22 Darin Adler <darin@apple.com>
19566
Change by Anders Carlsson.
19569
- fixed <http://bugs.webkit.org/show_bug.cgi?id=3294>
19570
String.prototype.replace() fails with function as second param
19572
* kjs/string_object.cpp: (replace): Added code to handle functions.
19574
* tests/mozilla/expected.html: Updated since ecma_3/RegExp/regress-209067.js is fixed now.
19576
* tests/mozilla/run-mozilla-tests: Fix a minor coding style issue that leads to a warning each
19577
time we run the tests.
19579
2005-06-21 Adele Peterson <adele@apple.com>
19581
rolling out fix for http://bugs.webkit.org/show_bug.cgi?id=3293, since it caused layout test failures.
19582
fast/forms/element-by-name
19583
fast/loader/loadInProgress
19586
* bindings/objc/objc_runtime.h:
19587
* bindings/objc/objc_runtime.mm:
19588
(ObjcFallbackObjectImp::hasProperty):
19589
* bindings/runtime_array.cpp:
19590
(RuntimeArrayImp::hasProperty):
19591
* bindings/runtime_array.h:
19592
* bindings/runtime_object.cpp:
19593
(RuntimeObjectImp::hasProperty):
19594
* bindings/runtime_object.h:
19595
* kjs/array_instance.h:
19596
* kjs/array_object.cpp:
19597
(ArrayInstanceImp::hasProperty):
19598
* kjs/function.cpp:
19599
(KJS::FunctionImp::hasProperty):
19600
(KJS::ActivationImp::hasProperty):
19603
(KJS::ObjectImp::hasProperty):
19605
* kjs/object_object.cpp:
19606
(ObjectPrototypeImp::ObjectPrototypeImp):
19607
(ObjectProtoFuncImp::call):
19608
* kjs/object_object.h:
19609
(KJS::ObjectProtoFuncImp::):
19610
* kjs/string_object.cpp:
19611
(StringInstanceImp::hasProperty):
19612
* kjs/string_object.h:
19613
* tests/mozilla/expected.html:
19615
2005-06-21 Darin Adler <darin@apple.com>
19617
* JavaScriptCore.pbproj/project.pbxproj: Switched to a build rule rather than a build phase for
19618
.y files -- this gets rid of the problem where modifying the .y file would not cause sufficient
19621
* kjs/grammar_wrapper.cpp: Removed.
19623
2005-06-21 Adele Peterson <adele@apple.com>
19625
Patch from Anders Carlsson <andersca@mac.com>, reviewed by Darin.
19627
Fixed: <http://bugs.webkit.org/show_bug.cgi?id=3450>
19628
<rdar://problem/3881901> String.replace() method not working when regex pattern contains {n, m}
19630
* pcre/pcre.c: (pcre_compile): Remember the last char length so it can be subtracted correctly if needed.
19632
2005-06-21 Geoffrey Garen <ggaren@apple.com>
19634
- fixed <rdar://problem/4155532> 'delete' succeeds on functions
19635
- fixed <rdar://problem/4155049> javascript function named as "opener" doesn't get called because of window.opener property
19640
(FuncDeclNode::processFuncDecl): Functions now have DontDelete and Internal attributes set when appropriate.
19643
* tests/mozilla/expected.html: Updated for one new success.
19644
- see also test case added in WebCore.
19646
2005-06-20 Maciej Stachowiak <mjs@apple.com>
19648
Reviewed by Darin(first pass) and Hyatt.
19650
- fixed http://bugs.webkit.org/show_bug.cgi?id=3576
19651
(roll in support for "const" keyword from KDE tree)
19652
- make processVarDecls handle deletability of variables declared
19653
in an eval block the same as evaluate would
19654
- make eval() call processVarDecls - needed to match mozilla and
19655
to make the second change testable
19657
I started with the KDE implementation of const but I ended up changing it a bit
19658
to avoid the use of a global variable. Now instead of the global variable it distinguishes
19659
const and var at the grammar level so the appropriate node can know the right kind of
19663
* tests/mozilla/expected.html: Updated for one new test that is
19664
failing - we used to bail on it entirely because it checks for
19665
const support before starting.
19666
- see also test cases added in WebCore
19668
* kjs/grammar.y: Add rules for const declarations.
19669
* kjs/keywords.table: Add const keyword.
19671
(VarDeclNode::VarDeclNode): Add parameter.
19672
(VarDeclNode::evaluate): Add const support.
19673
(VarDeclNode::processVarDecls): Add const support.
19674
(VarStatementNode::execute): Irrelevant change.
19675
(ForInNode::ForInNode): Tell our variable node that it's a variable.
19677
(KJS::VarDeclNode::): Add declaration of type enum, extra constructor parameter.
19678
(KJS::VarStatementNode::VarStatementNode): Irrelevant change.
19679
* kjs/function.cpp:
19680
(KJS::GlobalFuncImp::call): Process var decls before evaluating.
19682
2005-06-20 Maciej Stachowiak <mjs@apple.com>
19684
Patch from Mark Rowe <opendarwin.org@bdash.net.nz>, reviewed by me.
19686
- fixed http://bugs.webkit.org/show_bug.cgi?id=3293
19689
* tests/mozilla/expected.html: Updated for two fixed tests.
19690
- also added a layout test
19692
* bindings/objc/objc_runtime.h:
19693
* bindings/objc/objc_runtime.mm:
19694
(ObjcFallbackObjectImp::hasOwnProperty):
19695
* bindings/runtime_array.cpp:
19696
(RuntimeArrayImp::hasOwnProperty):
19697
* bindings/runtime_array.h:
19698
* bindings/runtime_object.cpp:
19699
(RuntimeObjectImp::hasOwnProperty):
19700
* bindings/runtime_object.h:
19701
* kjs/array_instance.h:
19702
* kjs/array_object.cpp:
19703
(ArrayInstanceImp::hasOwnProperty):
19704
* kjs/function.cpp:
19705
(KJS::FunctionImp::hasOwnProperty):
19706
(KJS::ActivationImp::hasOwnProperty):
19709
(KJS::ObjectImp::hasProperty):
19710
(KJS::ObjectImp::hasOwnProperty):
19712
(KJS::Object::hasOwnProperty):
19713
* kjs/object_object.cpp:
19714
(ObjectPrototypeImp::ObjectPrototypeImp):
19715
(ObjectProtoFuncImp::call):
19716
* kjs/object_object.h:
19717
(KJS::ObjectProtoFuncImp::):
19718
* kjs/string_object.cpp:
19719
(StringInstanceImp::hasOwnProperty):
19720
* kjs/string_object.h:
19722
2005-06-18 Darin Adler <darin@apple.com>
19724
Reviewed by Eric Seidel.
19726
* pcre/get.c: (pcre_get_substring): Fix some computations so this works for UTF-16.
19727
This is unused in the current JavaScriptCore, but still good to fix.
19729
2005-06-18 Darin Adler <darin@apple.com>
19731
Change by Finlay Dobbie.
19734
- fixed <http://bugs.webkit.org/show_bug.cgi?id=3331>
19735
10.3.9 Build Failure: NSString may not respond to `+stringWithCString:encoding:'
19737
* bindings/objc/WebScriptObject.mm: (-[WebScriptObject stringRepresentation]):
19738
Undo change we did a while back to work around the gcc 3.3 compiler error.
19739
It no longer seems to happen, and the workaround code was 10.4-specific.
19741
2005-06-16 Geoffrey Garen <ggaren@apple.com>
19743
Fixed: <rdar://problem/4151759> 'delete' fails on variables declared inside 'eval' statements.
19748
(KJS::ContextImp::codeType): Added code type accessor for execution context objects.
19749
* kjs/internal.cpp:
19750
(ContextImp::ContextImp): Reflects change to ContextImp::codeType.
19752
(VarDeclNode::evaluate): Added separate code path for variable declarations inside 'eval' statements.
19753
* tests/mozilla/expected.html: Updated expected test results to reflect fix.
19755
2005-06-14 Geoffrey Garen <ggaren@apple.com>
19757
Updated expected.html to reflect fix to <rdar://problem/4147745>.
19761
* tests/mozilla/expected.html:
19763
2005-06-14 Geoffrey Garen <ggaren@apple.com>
19765
Fixed: <rdar://problem/4147745> JavaScript discards locally defined "arguments" property
19767
No layout tests added because this change fixes existing tests:
19768
ecma/ExecutionContexts/10.1.6.js
19769
ecma_3/Function/regress-94506.js
19770
js1_4/Functions/function-001.js
19774
* kjs/function.cpp:
19775
(KJS::ActivationImp::get): get now checks for an "arguments" property defined in the local variable object
19776
before trying to return the built-in arguments array.
19778
* kjs/function.h: ActivationImp::put no longer overrides ObjectImp::put
19780
2005-06-10 Darin Adler <darin@apple.com>
19782
Change by Mark Rowe <opendarwin.org@bdash.net.nz>.
19785
- further improvements to exception file/line number fix
19787
* kjs/nodes.h: Added setExceptionDetailsIfNeeded function.
19788
* kjs/nodes.cpp: Updated macros to call the new setExceptionDetailsIfNeeded function.
19789
(Node::setExceptionDetailsIfNeeded): Added.
19791
2005-06-09 Darin Adler <darin@apple.com>
19793
Change by Mark Rowe <opendarwin.org@bdash.net.nz>
19796
* kjs/nodes.cpp: Get rid of unneeded this->.
19798
2005-06-08 Maciej Stachowiak <mjs@apple.com>
19800
Change by Mark Rowe <opendarwin.org@bdash.net.nz>
19803
- fixed http://bugs.webkit.org/show_bug.cgi?id=3327
19804
(Exception When Setting Style to Invalid Value Lacks Line/File Information)
19806
* kjs/nodes.cpp: Include source file and line number when making exception in
19807
KJS_CHECKEXCEPTIONVALUE.
19809
2005-06-07 Darin Adler <darin@apple.com>
19811
Change by Toby Peterson <toby@opendarwin.org>.
19814
* JavaScriptCore.pbproj/project.pbxproj: Allow bison 2.0, which generates the file
19815
with a different name.
19817
2005-06-07 Darin Adler <darin@apple.com>
19819
Change by Toby Peterson <toby@opendarwin.org>.
19822
* kjs/grammar.y: Remove bogus extra line from grammar.y. Toby got this change from KDE KJS.
19824
2005-06-06 Darin Adler <darin@apple.com>
19826
* tests/mozilla/run-mozilla-tests: Wrote a perl version of this so we don't require
19827
the "jst" tool to run the tests.
19829
2005-06-04 Darin Adler <darin@apple.com>
19831
Reviewed by Maciej.
19833
- add libicu headers
19835
* JavaScriptCore.pbproj/project.pbxproj: Added icu directory to header search path.
19837
* icu/README: Added.
19838
* icu/unicode/platform.h: Added.
19839
* icu/unicode/uchar.h: Added.
19840
* icu/unicode/uconfig.h: Added.
19841
* icu/unicode/umachine.h: Added.
19842
* icu/unicode/urename.h: Added.
19843
* icu/unicode/utf.h: Added.
19844
* icu/unicode/utf16.h: Added.
19845
* icu/unicode/utf8.h: Added.
19846
* icu/unicode/utf_old.h: Added.
19847
* icu/unicode/utypes.h: Added.
19848
* icu/unicode/uversion.h: Added.
19850
2005-05-19 Darin Adler <darin@apple.com>
19852
Reviewed by Maciej.
19854
- turned off exceptions and RTTI; seems to cut JavaScriptCore code size by about 22%
19856
* JavaScriptCore.pbproj/project.pbxproj: Turn off exceptions and RTTI for both
19857
the framework and testkjs tool.
19859
2005-05-18 Darin Adler <darin@apple.com>
19861
Reviewed by Maciej.
19863
- got rid of code that depended on RTTI
19865
* kjs/collector.cpp:
19866
(KJS::className): Added. Gets class name in a KJS way, rather than a C++ RTTI way.
19867
(KJS::Collector::rootObjectClasses): Use className instead of typeid names.
19869
2005-05-18 Darin Adler <darin@apple.com>
19871
Reviewed by Maciej.
19873
- fix a failure seen in the Mozilla JavaScript tests where a live object was garbage-collected
19874
when the only reference to it was in an argList on the stack
19876
* kjs/list.h: Moved the operator= function into the .cpp file since it's too big to be
19877
a good choice to inline.
19878
* kjs/list.cpp: (KJS::List::operator=): Moved this formerly-inline function into a separate
19879
file and added missing code to update valueRefCount. It's the latter that fixes the bug.
19881
2005-05-16 Darin Adler <darin@apple.com>
19885
- fixed issues preventing us from compiling with newer versions of gcc 4.0
19888
(KJS::operator==): Remove redundant and illegal KJS:: prefix on this function's definition.
19889
(KJS::operator<): Ditto.
19890
(KJS::compare): Ditto.
19892
2005-05-09 Darin Adler <darin@apple.com>
19896
- turn on conservative GC unconditionally and start on SPI changes to
19897
eliminate the now-unneeded smart pointers since we don't ref count any more
19899
* kjs/value.h: Removed macros to turn conservative GC on and off.
19900
Removed ref and deref functions.
19901
(KJS::ValueImp::ValueImp): Removed non-conservative-GC code path.
19902
(KJS::ValueImp::isUndefined): Added. New SPI to make it easier to deal with ValueImp directly.
19903
(KJS::ValueImp::isNull): Ditto.
19904
(KJS::ValueImp::isBoolean): Ditto.
19905
(KJS::ValueImp::isNumber): Ditto.
19906
(KJS::ValueImp::isString): Ditto.
19907
(KJS::ValueImp::isObject): Ditto.
19908
(KJS::Value::Value): Removed non-conservative-GC code path and made constructor no
19909
longer explicit so we can quietly create Value wrappers from ValueImp *; inexpensive with
19910
conservative GC and eases the transition.
19911
(KJS::Value::operator ValueImp *): Added. Quietly creates ValueImp * from Value.
19912
(KJS::ValueImp::marked): Removed non-conservative-GC code path.
19915
(KJS::ValueImp::mark): Removed non-conservative-GC code path.
19916
(KJS::ValueImp::isUndefinedOrNull): Added. New SPI to make it easier to deal with ValueImp directly.
19917
(KJS::ValueImp::isBoolean): Ditto.
19918
(KJS::ValueImp::isNumber): Ditto.
19919
(KJS::ValueImp::isString): Ditto.
19920
(KJS::ValueImp::asString): Ditto.
19921
(KJS::ValueImp::isObject): Ditto.
19922
(KJS::undefined): Ditto.
19923
(KJS::null): Ditto.
19924
(KJS::boolean): Ditto.
19925
(KJS::string): Ditto.
19926
(KJS::zero): Ditto.
19929
(KJS::number): Ditto.
19931
* kjs/object.h: Made constructor no longer explicit so we can quietly create Object
19932
wrappers from ObjectImp *; inexpensive with conservative GC and eases the transition.
19933
(KJS::Object::operator ObjectImp *): Added. Quietly creates ObjectImp * from Object.
19934
(KJS::ValueImp::isObject): Added. Implementation of new object-related ValueImp function.
19935
(KJS::ValueImp::asObject): Ditto.
19938
(KJS::ObjectImp::setInternalValue): Remove non-conservative-GC code path.
19939
(KJS::ObjectImp::putDirect): Ditto.
19940
(KJS::error): Added. Function in the new SPI style to create an error object.
19942
* kjs/internal.h: Added the new number-constructing functions as friends of NumberImp.
19943
There may be a more elegant way to do this later; what's important now is the new SPI.
19945
* kjs/collector.h: Remove non-conservative-GC code path and also take out some
19946
unneeded APPLE_CHANGES.
19948
* bindings/runtime_root.cpp:
19949
(KJS::Bindings::addNativeReference): Remove non-conservative-GC code path.
19950
(KJS::Bindings::removeNativeReference): Ditto.
19951
(RootObject::removeAllNativeReferences): Ditto.
19952
* bindings/runtime_root.h:
19953
(KJS::Bindings::RootObject::~RootObject): Ditto.
19954
(KJS::Bindings::RootObject::setRootObjectImp): Ditto.
19955
* kjs/collector.cpp:
19956
(KJS::Collector::allocate): Ditto.
19957
(KJS::Collector::collect): Ditto.
19958
(KJS::Collector::numGCNotAllowedObjects): Ditto.
19959
(KJS::Collector::numReferencedObjects): Ditto.
19960
(KJS::Collector::rootObjectClasses): Ditto.
19961
* kjs/internal.cpp:
19962
(NumberImp::create): Ditto.
19963
(InterpreterImp::globalInit): Ditto.
19964
(InterpreterImp::globalClear): Ditto.
19966
(KJS::List::markProtectedLists): Ditto.
19967
(KJS::List::clear): Ditto.
19968
(KJS::List::append): Ditto.
19970
(KJS::List::List): Ditto.
19971
(KJS::List::deref): Ditto.
19972
(KJS::List::operator=): Ditto.
19974
(KJS::gcProtect): Ditto.
19975
(KJS::gcUnprotect): Ditto.
19977
2005-05-09 Chris Blumenberg <cblu@apple.com>
19979
Workaround gcc 3.3 internal compiler errors.
19983
* bindings/objc/WebScriptObject.mm:
19984
(-[WebScriptObject stringRepresentation]): call [NSString stringWithCString:encoding] rather than using @""
19986
2005-05-09 Darin Adler <darin@apple.com>
19988
* Makefile.am: Don't set up PBXIntermediatesDirectory explicitly;
19989
Not needed to make builds work, spews undesirable error messages too.
19991
2005-05-06 Darin Adler <darin@apple.com>
19993
Reviewed by Maciej.
19995
- make building multiple trees with make work better
19997
* Makefile.am: Set up Xcode build directory before invoking xcodebuild.
19999
2005-05-04 Maciej Stachowiak <mjs@apple.com>
20003
<rdar://problem/4086570> Crash in JavaScriptCore with RSS Visualizer
20005
* kjs/internal.cpp:
20006
(InterpreterImp::mark): mark staticNaN, it is usually protected by the Number
20007
prototype but there is a small window where it can get collected.
20009
2005-05-04 Darin Adler <darin@apple.com>
20011
Reviewed by Dave Hyatt.
20013
- another gcc-4.0-related fix
20015
* bindings/runtime_root.h: Take off extra namespace prefixes that apparently cause problems
20016
compiling with gcc 4.0, although I have not observed the problems.
20018
2005-05-04 Darin Adler <darin@apple.com>
20020
Reviewed by Dave Hyatt.
20022
- fixed build rules to match other projects
20024
* JavaScriptCore.pbproj/project.pbxproj: Set deployment target to 10.3 in the build styles.
20025
When built without a build style (by Apple B&I) we want to get the target from the
20026
environment. But when built with a build style (by Safari engineers and others), we want
20029
* Makefile.am: Took out extra parameters that make command-line building different from
20030
Xcode building. Now that this is fixed, you should not get a full rebuild if you switch
20031
from command line to Xcode or back.
20033
2005-05-04 Maciej Stachowiak <mjs@apple.com>
20035
- revert presumably accidental change to mozilla JS test expected results, this
20036
was making the tests fail.
20038
* tests/mozilla/expected.html:
20040
2005-05-03 Richard Williamson <rjw@apple.com>
20042
Fixed <rdar://problem/4102644> Crash in LiveConnect below KJS::Bindings::JavaInstance::stringValue() const
20044
Correctly handle accessing nil objects from a Java object array.
20048
* bindings/jni/jni_runtime.cpp:
20049
(JavaArray::valueAt):
20051
2005-05-01 Darin Adler <darin@apple.com>
20053
- move to Xcode native targets and stop checking in generated files
20055
* JavaScriptCore.pbproj/project.pbxproj: Updated to use native targets and generate all the generated
20056
files, so we don't have to check them in any more.
20057
* Info.plist: Added. Native targets use a separate file for this.
20059
* Makefile.am: Removed pcre and kjs SUBDIRS. Also removed code that deleted the embedded copy of this
20060
framework, since we haven't been embedding it for some time.
20062
* kjs/grammar_wrapper.cpp: Added. Shell used to compile grammar.cpp since we can't add a generated file
20063
easily to the list of files to be compiled.
20065
* kjs/.cvsignore: Removed.
20066
* kjs/Makefile.am: Removed.
20067
* kjs/array_object.lut.h: Removed.
20068
* kjs/date_object.lut.h: Removed.
20069
* kjs/grammar.cpp: Removed.
20070
* kjs/grammar.cpp.h: Removed.
20071
* kjs/grammar.h: Removed.
20072
* kjs/lexer.lut.h: Removed.
20073
* kjs/math_object.lut.h: Removed.
20074
* kjs/number_object.lut.h: Removed.
20075
* kjs/string_object.lut.h: Removed.
20076
* pcre/.cvsignore: Removed.
20077
* pcre/Makefile.am: Removed.
20078
* pcre/chartables.c: Removed.
20080
2005-04-28 Darin Adler <darin@apple.com>
20082
Reviewed by Dave Harrison.
20084
- fixed problems preventing us from compiling with gcc 4.0
20086
* JavaScriptCore.pbproj/project.pbxproj: Removed -Wmissing-prototypes from
20087
WARNING_CPLUSPLUSFLAGS since it's now a C-only warning.
20089
* bindings/jni/jni_jsobject.cpp:
20090
(JSObject::getSlot): Changed some %d to %ld where the parameters where long ints.
20091
(JSObject::setSlot): Ditto.
20092
* bindings/jni/jni_utility.cpp:
20093
(KJS::Bindings::getJavaVM): Ditto.
20094
(KJS::Bindings::getJNIEnv): Ditto.
20095
* bindings/objc/objc_utility.mm: Fixed include of <JavascriptCore/internal.h> that needed the
20096
letter "S" capitalized.
20097
* kjs/bool_object.cpp: (BooleanProtoFuncImp::call): Rearranged how this function returns to
20098
avoid incorrect gcc 4.0 warning.
20099
* kjs/collector.cpp: (KJS::Collector::markStackObjectsConservatively): Changed code to check
20100
the alignment of the passed-in pointers to only require pointer-level alignment, not 8-byte alignment.
20101
Prevents a crash on garbage collect when compiled with gcc 4.0.
20103
(WhileNode::execute): Added a redundant return after an infinite loop to work around incorrect gcc 4.0 warning.
20104
(ForNode::execute): Ditto.
20105
(SwitchNode::execute):Rearranged how this function returns to avoid incorrect gcc 4.0 warning.
20106
(LabelNode::execute): Ditto.
20107
* kjs/string_object.cpp: (replace): Ditto.
20109
2005-04-26 Richard Williamson <rjw@apple.com>
20111
Fixed <rdar://problem/4098713> Scripting API is incompatible with Mozilla
20113
We were incompatible with Mozilla's implementation of the scripting APIs in
20116
Their NPN_SetException has the following signature:
20118
void NPN_SetException(NPObject *npobj, const NPUTF8 *message);
20122
void NPN_SetException (NPObject * npobj, const NPString *message);
20124
Also, they expect the string returned from NPN_UTF8FromIdentifier() to be freed by caller.
20127
I changed both behaviors to match Mozilla.
20131
* bindings/NP_jsobject.cpp:
20132
(_NPN_SetException):
20133
* bindings/npruntime.cpp:
20134
(_NPN_UTF8FromIdentifier):
20135
(_NPN_IntFromIdentifier):
20136
(_NPN_SetExceptionWithUTF8):
20137
* bindings/npruntime.h:
20138
* bindings/npruntime_impl.h:
20140
2005-04-26 Maciej Stachowiak <mjs@apple.com>
20144
<rdar://problem/4092136> reproducible crash in KJS::kjs_fast_realloc loading maps.google.com
20146
* kjs/string_object.cpp:
20147
(StringObjectFuncImp::call): Allocate adopted ustring buffer properly.
20149
2005-04-22 Darin Adler <darin@apple.com>
20151
Reviewed by Maciej.
20153
* kjs/ustring.cpp: (KJS::UString::UTF8String): Fix off-by-one error in surrogate pair logic.
20155
2005-04-22 Darin Adler <darin@apple.com>
20159
- fixed <rdar://problem/4090046> JavaScript throw statement causes parse error when no semicolon is present
20161
* kjs/grammar.y: Added an additional rule for throw like the ones we have for all the other semicolon rules.
20162
Not sure why we missed this one earlier.
20164
* kjs/grammar.cpp: Regenerated.
20166
=== JavaScriptCore-412.1 ===
20168
2005-04-20 Darin Adler <darin@apple.com>
20170
Reviewed by Maciej.
20172
- speedups, total 12% on JavaScript iBench
20174
I ran the benchmark under Shark and followed its advice a lot, mainly.
20176
* kjs/collector.cpp:
20177
(KJS::Collector::allocate): Take out special case for 0; costing speed but unexercised.
20178
Use numLiveObjectsAtLastCollect instead of numAllocationsSinceLastCollect so we don't
20179
have to bump it each time we call allocate. Put numLiveObjects into a local variable to
20180
cut down on global variable accesses. Make "next" cell pointer be a byte offset rather
20181
than a pointer so we don't need a special case for NULL. Allow freeList to point to some
20182
bogus item when the entire block is full rather than going out of our way to make it
20184
(KJS::Collector::markProtectedObjects): Get table size and pointer into locals outside
20185
the loop to avoid re-loading them over and over again.
20186
(KJS::Collector::collect): Put numLiveObjects into a local variable to cut down on global
20187
variable accesses. Make "next" cell pointer be a byte offset as above. Put numLiveObjects
20188
into a local variable to cut down on global variable accesses. Set numLiveObjectsAtLastCollect
20189
rather than numAllocationsSinceLastCollect.
20190
(KJS::Collector::numReferencedObjects): Get table size and pointer into locals outside
20191
the loop to avoid re-loading them over and over again.
20192
(KJS::Collector::rootObjectClasses): Ditto.
20194
* kjs/internal.h: Make Value be a friend of NumberImp so it can construct number objects
20195
directly, avoiding the conversion from Number to Value.
20197
* kjs/internal.cpp: (StringImp::toObject): Don't use Object::dynamicCast, because we know
20198
the thing is an object and we don't want to do all the extra work; just cast directly.
20200
* kjs/list.cpp: (KJS::List::List): Construct valueRefCount in a way that avoids the need for
20201
a branch -- in the hot case this just meant avoiding checking a variable we just set to false.
20203
* kjs/lookup.cpp: (keysMatch): Marked this inline.
20205
* kjs/nodes.cpp: Disabled KJS_BREAKPOINT, to avoid calling hitStatement all the time.
20206
(BooleanNode::evaluate): Make a Value directly, rather than making a Boolean which is converted
20208
(NumberNode::evaluate): Ditto.
20209
(StringNode::evaluate): Ditto.
20210
(ArrayNode::evaluate): Ditto.
20211
(FunctionCallNode::evaluate): Use new inline baseIfMutable to avoid unnecessary getBase function.
20212
Also just use a pointer for func, rather than an Object.
20213
(PostfixNode::evaluate): Change code so that it doesn't make an excess Number, and so that it
20214
passes a "known to be integer" boolean in, often avoiding a conversion from floating point to
20216
(DeleteNode::evaluate): Make a Value directly.
20217
(TypeOfNode::evaluate): Use new inline baseIfMutable and make Value directly.
20218
(PrefixNode::evaluate): Change code so that it doesn't make an excess Number, and so that it
20219
passes a "known to be integer" boolean in, often avoiding a conversion from floating point to
20221
(UnaryPlusNode::evaluate): Make a Value directly.
20222
(NegateNode::evaluate): Change code so that it doesn't make an excess Number, and so that it
20223
passes a "known to be integer" boolean in, often avoiding a conversion from floating point to
20225
(BitwiseNotNode::evaluate): Make a Value directly.
20226
(LogicalNotNode::evaluate): Ditto.
20227
(ShiftNode::evaluate): Don't convert to a double before making a Value.
20228
(RelationalNode::evaluate): Make a Value directly.
20229
(EqualNode::evaluate): Ditto.
20230
(BitOperNode::evaluate): Ditto.
20231
(AssignNode::evaluate): Make a Value directly. Change code so that it passes a "known to be integer"
20232
boolean in, often avoiding a conversion from floating point to integer and back.
20233
(VarDeclNode::evaluate): Make a Value directly.
20234
(ForNode::execute): Remove unused local variable.
20236
* kjs/operations.h:
20237
(KJS::isNaN): Inlined.
20238
(KJS::isInf): Ditto.
20239
(KJS::isPosInf): Ditto.
20240
(KJS::isNegInf): Ditto.
20242
* kjs/operations.cpp: Change isNaN, isInf, isPosInf, and isNegInf to be inlines.
20243
(KJS::equal): Rewrite to avoid creating values and recursing back into the function.
20244
(KJS::relation): Rearranged code so that we don't need explicit isNaN checks.
20245
(KJS::add): Changed code to make Value directly, and so that it passes a "known to be integer"
20246
boolean in, often avoiding a conversion from floating point to integer and back.
20247
(KJS::mult): Ditto.
20249
* kjs/property_map.cpp:
20250
(KJS::PropertyMap::~PropertyMap): Get size and entries pointer outside loop to avoid
20251
re-getting them inside the loop.
20252
(KJS::PropertyMap::clear): Ditto. Clear value pointer in addition to key, so we can just
20253
look at the value pointer in the mark function.
20254
(KJS::PropertyMap::get): Get sizeMask and entries pointer outside loop to avoid
20255
re-getting them inside the loop.
20256
(KJS::PropertyMap::put): Ditto.
20257
(KJS::PropertyMap::insert): Ditto.
20258
(KJS::PropertyMap::remove): Ditto.
20259
(KJS::PropertyMap::mark): Get size and entries pointer outside loop to avoid
20260
re-getting them inside the loop. Don't bother checking key for 0, since we already have
20261
to check value for 0. (Also had to change clear() to set value to 0.)
20262
(KJS::PropertyMap::addEnumerablesToReferenceList): Get size and entries pointer outside
20263
loop to avoid re-getting them inside the loop.
20264
(KJS::PropertyMap::addSparseArrayPropertiesToReferenceList): Ditto.
20265
(KJS::PropertyMap::save): Ditto.
20269
* kjs/protected_values.h: Remove unneeded class name qualifiers.
20272
(KJS::Reference::baseIfMutable): New inline function: replaces isMutable().
20273
(KJS::Reference::Reference): Inlined.
20274
* kjs/reference.cpp:
20275
(KJS::Reference::getValue): Rewrite to not use getBase.
20276
(KJS::Reference::putValue): Ditto.
20277
(KJS::Reference::deleteValue): Dittol
20279
* kjs/simple_number.h:
20280
(KJS::SimpleNumber::integerFits): Added. For use when the parameter is known to be integral.
20282
* kjs/string_object.cpp: (StringProtoFuncImp::call): Create the number without first converting
20283
to double in various cases that involve integers.
20286
(KJS::UString::attach): Inlined.
20287
(KJS::UString::release): Inlined.
20289
(KJS::UString::find): Get first character outside the loop instead of re-fetching it each time.
20292
(Value::Value): Added overloads for all the various specific types of values, so you don't have
20293
to convert from, say, Number to Value, just to create one.
20294
(Number::Number): Added an overload that takes a boolean to indicate the number is already
20295
known to be an integer.
20297
* kjs/value.h: Added more Value constructors, added a version of toNumber that returns
20298
a boolean to indicate if the number is known to be an integer (because it was a "simple number").
20299
(KJS::ValueImp::marked): Inlined.
20300
(KJS::ValueImp::dispatchType): Inlined.
20301
(KJS::ValueImp::dispatchToPrimitive): Inlined.
20302
(KJS::ValueImp::dispatchToBoolean): Inlined.
20303
(KJS::ValueImp::dispatchToNumber): Inlined.
20304
(KJS::ValueImp::dispatchToString): Inlined.
20305
(KJS::ValueImp::dispatchToUInt32): Inlined.
20307
2005-04-14 Maciej Stachowiak <mjs@apple.com>
20309
- make fast_malloc.h a private header, not project
20311
* JavaScriptCore.pbproj/project.pbxproj:
20313
2005-04-12 Maciej Stachowiak <mjs@apple.com>
20315
Reviewed by Richard.
20317
<rdar://problem/4089734> JavaScript iBench can be sped up ~10% with custom allocator
20319
- use custom single-threaded malloc for all non-GC JavaScriptCore
20320
allocations, for a 9.1% speedup on JavaScript iBench
20322
* JavaScriptCore.pbproj/project.pbxproj:
20323
* kjs/collector.cpp:
20324
(KJS::Collector::allocate): Use dlmalloc to allocate the collector blocks.
20325
(KJS::Collector::collect): And dlfree to free it.
20326
* kjs/fast_malloc.cpp: Added, just the standard dlmalloc here.
20327
* kjs/fast_malloc.h: Added. Declarations for the functions. Also added a handy
20328
macro to give a class custom operator new/delete
20329
* kjs/identifier.cpp:
20330
(KJS::Identifier::add): Use dlmalloc/dlfree.
20331
* kjs/nodes.h: make nodes KJS_FAST_ALLOCATED.
20332
* kjs/property_map.cpp:
20333
(KJS::PropertyMap::~PropertyMap): Use dlmalloc/dlfree.
20334
(KJS::PropertyMap::rehash): ditto
20335
* kjs/scope_chain.h:
20337
(KJS::UString::Rep::createCopying): New named constructor that copies a passed-in
20338
buffer, to hide allocation details from webcore.
20339
(KJS::UString::UString): use createCopying when appropriate.
20340
(KJS::UString::Rep::destroy): Use dlmalloc/dlfree.
20341
(KJS::UString::expandedSize): likewise
20342
(KJS::UString::expandCapacity): likewise
20343
(KJS::UString::expandPreCapacity): likewise
20344
(KJS::UString::spliceSubstringsWithSeparators): likewise
20345
(KJS::UString::append): likewise
20346
(KJS::UString::operator=): likewise
20347
(KJS::UString::detach): likewise
20348
* kjs/ustring.h: make UString and UString::Rep KJS_FAST_ALLOCATED.
20350
2005-04-11 Maciej Stachowiak <mjs@apple.com>
20354
<rdar://problem/4086819> Avoid using protect count hash table so much for 5.6% JS iBench speedup
20356
- Avoid using protected values hash for the two most common cases
20357
- Bump up ListImp high water mark, new testing shows 508 ListImps are
20358
created during JS iBench.
20360
Net result is a 5.6% speedup on JavaScript iBench
20362
* kjs/collector.cpp:
20363
(KJS::Collector::collect): mark protected lists as appropriate.
20366
(KJS::ListImp::markValues): Moved implementation from List::markValues
20367
(KJS::List::markProtectedLists): Implemented - scan pool and overflow
20369
(KJS::allocateListImp): link lists outside the pool into a separate
20370
doubly linked list to be able to mark protected lists
20371
(KJS::deallocateListImp): do the corresponding delinking
20372
(KJS::List::derefValues): do nothing in conservative GC mode
20373
(KJS::List::refValues): do nothing in conservative GC mode
20374
(KJS::List::markValues): call ListImp version
20375
(KJS::List::append):
20390
2005-03-16 Jens Alfke <jens@apple.com>
20394
Fix for <rdar://problem/4025212> "REGRESSION (163-164): search not performed correctly; united.com"
20395
JavaScript unescape("") was returning a messed-up String object that appeared identical to an empty string, but would in some cases act as 'null' when passed to native functions, in this case the Option() constructor.
20396
In the implementation of unescape, the UString holding the result was not initialized to "", so it started out as a null string. If nothing was appended to it, it remained null, resulting in a JavaScript String object with some bad behaviors (namely, converting it to a DOMStringImpl results in a NULL pointer.)
20397
Darin says this regression occurred when we replaced our own implementation of unescape() with code from KJS.
20399
* kjs/function.cpp:
20400
(KJS::GlobalFuncImp::call):
20402
2005-03-15 Richard Williamson <rjw@apple.com>
20404
Fixed <rdar://problem/4053276> WebScripting protocol in WebKit cannot convert Boolean in Javascript to BOOL in Objective-C
20406
Added JavaScript boolean to type that can be converted to
20407
ObjC scalar parameters.
20409
Reviewed by Ken Kocienda.
20411
* bindings/objc/objc_utility.mm:
20412
(KJS::Bindings::convertValueToObjcValue):
20428
2005-02-21 Darin Adler <darin@apple.com>
20430
* kjs/date_object.cpp: (timetUsingCF): Fixed indenting.
20432
2005-02-17 Richard Williamson <rjw@apple.com>
20434
Fixed <rdar://problem/4003251> Safari crashed at www.icelandair.com in LiveConnect code converting a Java object to a string
20438
Reviewed by John Sullivan.
20440
* bindings/jni/jni_runtime.cpp:
20441
(JavaField::valueFromInstance):
20445
2005-02-11 Richard Williamson <rjw@apple.com>
20447
Fixed <rdar://problem/3985118> DOM objects not being marshaled on JS->native calls
20449
Re-factored how 'native' wrappers for JS objects are created. The interpreter now
20450
creates these wrappers. The WebCore subclass of the interpreter now overrides
20451
createLanguageInstanceForValue() and creates a DOM ObjC wrapper for DOM objects.
20455
* bindings/c/c_utility.cpp:
20456
(convertValueToNPVariant):
20457
* bindings/jni/jni_instance.cpp:
20458
(JavaInstance::invokeMethod):
20459
* bindings/jni/jni_objc.mm:
20460
(KJS::Bindings::dispatchJNICall):
20461
* bindings/jni/jni_runtime.cpp:
20462
(JavaField::valueFromInstance):
20463
(JavaArray::valueAt):
20464
* bindings/objc/WebScriptObject.mm:
20465
(-[WebScriptObject _setExecutionContext:KJS::Bindings::]):
20466
(+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
20467
* bindings/objc/WebScriptObjectPrivate.h:
20468
* bindings/objc/objc_utility.h:
20469
* bindings/objc/objc_utility.mm:
20470
(KJS::Bindings::convertObjcValueToValue):
20471
(KJS::Bindings::createObjcInstanceForValue):
20472
* bindings/runtime.cpp:
20473
(Instance::createBindingForLanguageInstance):
20474
(Instance::createRuntimeObject):
20475
(Instance::createLanguageInstanceForValue):
20476
* bindings/runtime.h:
20477
* kjs/interpreter.cpp:
20478
(Interpreter::createLanguageInstanceForValue):
20479
* kjs/interpreter.h:
20483
2005-02-10 Darin Adler <darin@apple.com>
20485
"Reviewed" by Richard (he told me the file was obsolete).
20487
- got rid of an obsolete file
20489
* bindings/npsap.h: Removed.
20495
2005-02-03 Richard Williamson <rjw@apple.com>
20497
Fixed <rdar://problem/3972905> CrashTracer: ...36 crashes at com.apple.WebCore: khtml::CSSStyleSelector::applyDeclarations + 120
20499
Revert to old (and correct) behavior of returning runtime object
20500
when passed as a parameter, rather than it's corresponding DOM
20505
* bindings/objc/WebScriptObject.mm:
20506
(+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
20510
2005-01-28 Richard Williamson <rjw@apple.com>
20512
Fixed <rdar://problem/3980389> JavaScript bindings access incorrect runtime object
20514
Only use special 'back door' property to get the runtime object if thisObj isn't
20515
already a runtime object.
20517
<gratuitous> Cleaned up a couple of strcmp on ClassInfo name. Used == on
20518
ClassInfo pointer instead.
20522
* bindings/c/c_utility.cpp:
20523
(convertValueToNPVariant):
20524
* bindings/objc/WebScriptObject.mm:
20525
(+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
20526
* bindings/runtime_method.cpp:
20527
(RuntimeMethodImp::call):
20531
2005-01-26 Richard Williamson <rjw@apple.com>
20533
Fixed <rdar://problem/3972522> (179-180) 40% slowdown on iBench JavaScript test
20535
I added a member variable to ObjectImp. This changed it's size and consequently
20536
hampered the optimizations built into the garbage collector. Objects no longer
20537
fit within the allocators cell size, and thus allocation fell back to a slower
20540
As a result of this fix I also dramatically cleaned up how runtime objects are
20541
accessed. The path mostly *removes* code.
20545
* bindings/runtime_method.cpp:
20546
(RuntimeMethodImp::call):
20547
* bindings/runtime_object.cpp:
20548
(RuntimeObjectImp::get):
20549
(RuntimeObjectImp::put):
20550
(RuntimeObjectImp::canPut):
20551
(RuntimeObjectImp::hasProperty):
20552
(RuntimeObjectImp::defaultValue):
20553
* bindings/runtime_object.h:
20555
(KJS::ObjectImp::ObjectImp):
20558
2005-01-20 Darin Adler <darin@apple.com>
20560
Reviewed by me, changes by Han Ming Ong.
20562
- <rdar://problem/3964302> SWB: A few files need to be updated to be compilable under GCC 4.0
20564
* bindings/objc/WebScriptObjectPrivate.h: Make members public.
20565
* kjs/lookup.h: Change "value.h" to "object.h" because we need KJS::Object to compile a template.
20567
2005-01-20 Richard Williamson <rjw@apple.com>
20569
Fixed <rdar://problem/3964634> undefined property value from binding seems to evaluate to true in an if statement
20571
The comprehensive fix for this problem requires new API, as described in 3965326. However,
20572
given that we can't add new API at this point, the 'ObjcFallbackObjectImp' will behave
20573
like and Undefined object if invokeUndefinedMethodFromWebScript:withArguments: isn't
20574
implemented on the bound object.
20578
* bindings/objc/objc_runtime.h:
20579
* bindings/objc/objc_runtime.mm:
20580
(ObjcFallbackObjectImp::type):
20581
(ObjcFallbackObjectImp::implementsCall):
20582
(ObjcFallbackObjectImp::toBoolean):
20583
* bindings/testbindings.mm:
20584
(+[MyFirstInterface isSelectorExcludedFromWebScript:]):
20585
(+[MyFirstInterface isKeyExcludedFromWebScript:]):
20589
2005-01-19 Richard Williamson <rjw@apple.com>
20591
Fixed <rdar://problem/3853676> Browser Crash when accessing CCWeb Progress Page - KJS::Bindings::convertValueToJValue
20593
Fixed the following problems with LiveConnect that are demonstrated by the application
20594
described in 3853676.
20596
1. If a nil object is passed in an array from Java to JavaScript we will crash.
20597
2. We sometimes will incorrectly attempt to access a generic JavaScript as a Java runtime object wrapper.
20598
3. We will sometimes fail to find the correct static method ID.
20600
Reviewed by Maciej.
20602
* bindings/jni/jni_jsobject.cpp:
20603
(JSObject::convertJObjectToValue):
20604
(JSObject::listFromJArray):
20605
* bindings/jni/jni_runtime.cpp:
20606
(JavaField::valueFromInstance):
20607
(JavaField::setValueToInstance):
20608
* bindings/jni/jni_utility.cpp:
20609
(KJS::Bindings::getMethodID):
20610
(KJS::Bindings::convertValueToJValue):
20611
* bindings/runtime_array.h:
20613
2005-01-18 Richard Williamson <rjw@apple.com>
20615
Fixed several issues all arising from analysis of plugin detection code at ifilm.com:
20617
Fixed <rdar://problem/3958592> can't script plug-ins if plug-in is invoked with <object> element instead of <embed>
20618
Fixed <rdar://problem/3958597> <object> elements with IDs do not show up as named properties of the document
20619
Fixed <rdar://problem/3960973> DOM objects for plugin elements are not accessible
20620
Fixed <rdar://problem/3958601> need an additional class ID in WebCore for the Real plug-in
20622
We now support accessing scriptable plugin objects that are specified with <applet>, <embed>, or <object>
20623
tags. Also, if any of these elements are named they can be accessed from the document or window objects.
20624
Finally, DOM methods are properties will be forwarded appropriately for the plugin's root scriptable object.
20628
* bindings/objc/objc_instance.h:
20629
* bindings/objc/objc_instance.mm:
20630
(ObjcInstance::supportsSetValueOfUndefinedField):
20631
* bindings/runtime.h:
20632
(KJS::Bindings::Instance::supportsSetValueOfUndefinedField):
20633
* bindings/runtime_object.cpp:
20634
(RuntimeObjectImp::RuntimeObjectImp):
20635
(RuntimeObjectImp::get):
20636
(RuntimeObjectImp::put):
20637
(RuntimeObjectImp::canPut):
20638
(RuntimeObjectImp::hasProperty):
20639
(RuntimeObjectImp::defaultValue):
20640
* bindings/runtime_object.h:
20641
(KJS::RuntimeObjectImp::fallbackObject):
20643
(KJS::ObjectImp::ObjectImp):
20645
(KJS::ObjectImp::forwardingScriptMessage):
20646
(KJS::ObjectImp::setForwardingScriptMessage):
20648
2005-01-18 Richard Williamson <rjw@apple.com>
20650
Back out a change that was incorrectly committed yesterday.
20654
* bindings/objc/objc_utility.mm:
20655
(KJS::Bindings::convertValueToObjcValue):
20657
2005-01-17 Richard Williamson <rjw@apple.com>
20659
Fixed <rdar://problem/3753030> Need to ensure same origin for plugin binding invocations (origin security rules)
20661
Keep track of originating execution context and target execution
20662
context for native JS object wrappers, and perform appropriate
20665
Reviewed by David Harrison.
20667
* bindings/NP_jsobject.cpp:
20669
(_NPN_CreateScriptObject):
20672
(_NPN_GetProperty):
20673
(_NPN_SetProperty):
20674
(_NPN_RemoveProperty):
20675
(_NPN_HasProperty):
20677
(_NPN_SetException):
20678
* bindings/NP_jsobject.h:
20679
* bindings/c/c_instance.cpp:
20680
(CInstance::CInstance):
20681
(CInstance::stringValue):
20682
* bindings/c/c_instance.h:
20683
* bindings/c/c_utility.cpp:
20684
(convertValueToNPVariant):
20685
* bindings/jni/jni_instance.cpp:
20686
(JavaInstance::JavaInstance):
20687
(JavaInstance::valueOf):
20688
* bindings/jni/jni_instance.h:
20689
* bindings/objc/WebScriptObject.mm:
20690
(-[WebScriptObject _initializeWithObjectImp:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
20691
(-[WebScriptObject _initWithObjectImp:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
20692
(-[WebScriptObject KJS::Bindings::]):
20693
(-[WebScriptObject _setOriginExecutionContext:KJS::Bindings::]):
20694
(-[WebScriptObject _isSafeScript]):
20695
(-[WebScriptObject callWebScriptMethod:withArguments:]):
20696
(-[WebScriptObject evaluateWebScript:]):
20697
(-[WebScriptObject setValue:forKey:]):
20698
(-[WebScriptObject valueForKey:]):
20699
(-[WebScriptObject removeWebScriptKey:]):
20700
(-[WebScriptObject stringRepresentation]):
20701
(-[WebScriptObject webScriptValueAtIndex:]):
20702
(-[WebScriptObject setWebScriptValueAtIndex:value:]):
20703
(+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
20704
* bindings/objc/WebScriptObjectPrivate.h:
20705
* bindings/objc/objc_instance.h:
20706
* bindings/objc/objc_runtime.mm:
20707
(convertValueToObjcObject):
20708
* bindings/objc/objc_utility.mm:
20709
(KJS::Bindings::convertValueToObjcValue):
20710
* bindings/runtime.cpp:
20711
(Instance::Instance):
20712
(Instance::operator=):
20713
* bindings/runtime.h:
20714
(KJS::Bindings::Instance::Instance):
20715
(KJS::Bindings::Instance::setExecutionContext):
20716
(KJS::Bindings::Instance::executionContext):
20717
* bindings/runtime_root.cpp:
20718
(RootObject::setInterpreter):
20719
* bindings/runtime_root.h:
20720
* kjs/interpreter.h:
20721
(KJS::Interpreter::isGlobalObject):
20722
(KJS::Interpreter::interpreterForGlobalObject):
20723
(KJS::Interpreter::isSafeScript):
20727
2005-01-13 Vicki Murley <vicki@apple.com>
20731
- fix <rdar://problem/3946836> Safari about box lists 2004 instead of 2005
20733
* JavaScriptCore.pbproj/project.pbxproj: bump "2004" to "2005"
20735
2005-01-12 Richard Williamson <rjw@apple.com>
20737
Avoid additional work on dealloc by adding early out to
20738
removeNativeReference(). (This will save time on dealloc
20739
for all ObjC DOM objects.)
20743
* bindings/runtime_root.cpp:
20744
(KJS::Bindings::removeNativeReference):
20746
2005-01-12 Richard Williamson <rjw@apple.com>
20748
Fixed <rdar://problem/3923356> REGRESSION: Java/JavaScript security checks working incorrectly
20750
We were always returning the first "root" object for all runtime
20751
objects. Changed 0 in loop to i, the index.
20753
Reviewed by David Harrison.
20755
* bindings/runtime_root.cpp:
20756
(KJS::Bindings::rootForImp):
20758
2005-01-11 Richard Williamson <rjw@apple.com>
20760
Fixed <rdar://problem/3887930> Must use new Java plug-in API to get/set fields so exception handling works (fixes many LiveConnect crashes)
20762
Use the new dispatching API to invoke JNI, rather than calling JNI
20765
Reviewed by David Harrison.
20767
* bindings/jni/jni_instance.cpp:
20768
(JavaInstance::invokeMethod):
20769
* bindings/jni/jni_runtime.cpp:
20770
(JavaField::dispatchValueFromInstance):
20771
(JavaField::valueFromInstance):
20772
(JavaField::dispatchSetValueToInstance):
20773
(JavaField::setValueToInstance):
20774
* bindings/jni/jni_runtime.h:
20775
* bindings/jni/jni_utility.cpp:
20776
(KJS::Bindings::convertValueToJValue):
20784
2004-12-17 Maciej Stachowiak <mjs@apple.com>
20788
<rdar://problem/3926869> Opening caches window after running PLT causes crash
20790
* kjs/protected_values.cpp:
20791
(KJS::ProtectedValues::getProtectCount): Don't include simple numbers in
20792
the protected value table.
20793
(KJS::ProtectedValues::increaseProtectCount): Ditto.
20794
(KJS::ProtectedValues::decreaseProtectCount): Ditto.
20796
2004-12-16 Darin Adler <darin@apple.com>
20798
Reviewed by Maciej.
20800
- fixed <rdar://problem/3920764> Unimplemented String methods toLocaleLowerCase and toLocaleUpperCase
20802
* kjs/string_object.h: Added toLocaleLowerCase and toLocaleUpperCase.
20803
* kjs/string_object.cpp: (StringProtoFuncImp::call): Made locale versions be synonmyms for the
20804
non-locale-specific versions.
20805
* kjs/string_object.lut.h: Regenerated.
20807
2004-12-14 Richard Williamson <rjw@apple.com>
20809
Pass URL of plugin view when call into JNI.
20813
* bindings/jni/jni_objc.mm:
20814
(KJS::Bindings::dispatchJNICall):
20816
2004-12-13 Richard Williamson <rjw@apple.com>
20818
Fixed <rdar://problem/3827799> repro. crash with IBM Rational ClearCase Web under Safari (Java/LiveConnect-related)
20820
Add support for calling static Java methods from JavaScript.
20822
Reviewed by Maciej.
20824
* bindings/jni/jni_instance.cpp:
20825
(JavaInstance::invokeMethod):
20826
* bindings/jni/jni_runtime.cpp:
20827
(JavaMethod::JavaMethod):
20828
* bindings/jni/jni_runtime.h:
20829
(KJS::Bindings::JavaMethod::isStatic):
20830
* bindings/jni/jni_utility.cpp:
20831
(callJNIStaticMethod):
20832
(KJS::Bindings::callJNIBooleanMethod):
20833
(KJS::Bindings::callJNIStaticBooleanMethod):
20834
* bindings/jni/jni_utility.h:
20836
2004-12-13 Richard Williamson <rjw@apple.com>
20838
Fixed <rdar://problem/3887767> LiveConnect doesn't propagate Java exceptions back to JavaScript (prevents security suite from running)
20842
* bindings/jni/jni_instance.cpp:
20843
(JavaInstance::invokeMethod):
20844
* bindings/jni/jni_objc.mm:
20845
(KJS::Bindings::dispatchJNICall):
20846
* bindings/jni/jni_runtime.h:
20847
* bindings/jni/jni_utility.h:
20851
2004-12-07 Maciej Stachowiak <mjs@apple.com>
20855
<rdar://problem/3908017> REGRESSION (172-173): assertion in ObjectImp::construct trying to create JS error (24hourfitness.com)
20857
The fix was to implement copy constructor and assignment operator,
20858
the ones that worked on the base class did not replace the
20859
defaults apparently!
20862
(KJS::ProtectedValue::ProtectedValue):
20863
(KJS::ProtectedValue::operator=):
20864
(KJS::ProtectedObject::ProtectedObject):
20865
(KJS::ProtectedObject::operator=):
20867
Also fixed a bug in the GC test mode that compares the results of
20868
the old collector and the new collector.
20875
2004-11-23 Richard Williamson <rjw@apple.com>
20877
Fixed <rdar://problem/3890385> field and method cache incorrectly capped (c bindings)
20881
* bindings/c/c_class.cpp:
20882
(CClass::_commonInit):
20884
2004-11-21 Maciej Stachowiak <mjs@apple.com>
20888
<rdar://problem/3889696> Enable conservative garbage collection for JavaScript
20890
* kjs/collector.cpp:
20891
(KJS::Collector::Thread::Thread):
20892
(KJS::destroyRegisteredThread):
20893
(KJS::initializeRegisteredThreadKey):
20894
(KJS::Collector::registerThread):
20895
(KJS::Collector::markStackObjectsConservatively):
20896
(KJS::Collector::markCurrentThreadConservatively):
20897
(KJS::Collector::markOtherThreadConservatively):
20899
* kjs/internal.cpp:
20905
2004-11-15 Richard Williamson <rjw@apple.com>
20907
Fixed <rdar://problem/3880561> Default string value of ObjC object in JS should be [obj description].
20911
* bindings/objc/objc_instance.mm:
20912
(ObjcInstance::stringValue):
20913
* bindings/objc/objc_utility.h:
20914
* bindings/objc/objc_utility.mm:
20915
(KJS::Bindings::convertNSStringToString):
20916
(KJS::Bindings::convertObjcValueToValue):
20920
2004-11-09 Chris Blumenberg <cblu@apple.com>
20922
Fixed: <rdar://problem/3872724> soft link against JavaVM to save ~2MB RSHRD
20927
* JavaScriptCore.pbproj/project.pbxproj: don't link against JavaVM
20928
* bindings/softlinking.c: Added.
20929
(loadFramework): new
20930
(getFunctionPointer): new
20931
(JNI_GetCreatedJavaVMs): load JavaVM if not already loaded, get _JNI_GetCreatedJavaVMs symbol if we don't already have it, call JNI_GetCreatedJavaVMs
20935
2004-11-04 Darin Adler <darin@apple.com>
20939
- fixed <rdar://problem/3865365> since -[WebScriptObject dealloc] does not call [super dealloc], the build will fail due to a warning
20940
- fixed behavior so that [[WebScriptObject alloc] initWithCoder:] doesn't leak WebUndefined instances
20941
and incidentally so that [[WebScriptObject alloc] init] returns the single shared instance rather
20942
than allocating a new one
20944
* bindings/objc/WebScriptObject.mm: Removed some stray semicolons.
20945
(+[WebUndefined allocWithZone:]): Made this the common bottleneck that returns the single instance
20946
of WebUndefined, since it's the single method that normally allocates new instances. Calls super to
20947
actually allocate only the very first time it's called.
20948
(-[WebUndefined initWithCoder:]): Simplified to just return self (no reason to re-lookup the single
20949
shared instance since there can be only one).
20950
(-[WebUndefined copyWithZone:]): Ditto.
20951
(-[WebUndefined retain]): Ditto.
20952
(-[WebUndefined retainCount]): Use UINT_MAX constant here (matches usage in NSObject.m for retain count
20954
(-[WebUndefined autorelease]): Simplified to just return self (see above).
20955
(-[WebUndefined copy]): No need to override this since it just turns around and calls copyWithZone:.
20956
(-[WebUndefined dealloc]): Added an assertion since this method should never be called. Also added
20957
a call to [super dealloc] after return; to make the new -Wdealloc-check compiler happy (fixing the
20958
bug mentioned above).
20959
(+[WebUndefined undefined]): Reimplemented; calls allocWithZone:NULL to get to the shared instance.
20960
No need to call init, since that's a no-op for this class.
20962
2004-11-03 David Harrison <harrison@apple.com>
20966
Eliminate the use of a marker file to determine how to build.
20971
2004-11-01 Richard Williamson <rjw@apple.com>
20973
Fixed <rdar://problem/3861469> Latest Real player crashes Safari on some sites.
20977
* bindings/c/c_instance.cpp:
20978
(CInstance::invokeMethod):
20979
(CInstance::invokeDefaultMethod):
20980
Initialize out parameters to void type.
20982
* bindings/c/c_runtime.cpp:
20983
(CField::valueFromInstance):
20984
(CField::setValueToInstance):
20985
Initialize out parameters to void type.
20986
Also added additional checks to protect against classes that
20987
don't implement all functions.
20989
2004-11-01 Richard Williamson <rjw@apple.com>
20991
Fixed <rdar://problem/3861257> WebUndefined should be returned for undefined values
20996
* bindings/objc/WebScriptObject.mm:
20997
(+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
20998
Added additional conversion Undefined -> WebUndefined.
20999
* bindings/objc/objc_utility.mm:
21000
(KJS::Bindings::convertObjcValueToValue):
21001
Added additional conversion WebUndefined -> Undefined.
21003
2004-11-01 Darin Adler <darin@apple.com>
21005
- fixed <rdar://problem/3855573> Remove reference to "WebScriptMethods" from WebScriptObject.h comments
21007
* bindings/objc/WebScriptObject.h: Removed unneeded #ifdef protection for multiple includes (since
21008
this is an Objective-C header and we use #import for those). Fixed comments as requested in the bug
21009
report to match the contents of the file.
21015
2004-10-22 Ken Kocienda <kocienda@apple.com>
21019
* JavaScriptCore.pbproj/project.pbxproj:
21020
Add GCC_ENABLE_OBJC_GC and GCC_FAST_OBJC_DISPATCH flags.
21024
2004-10-13 Richard Williamson <rjw@apple.com>
21026
Moved boolean checks prior to NSNumber checks. booleans are
21029
Follow on to <rdar://problem/3821515> binding layer needs to convert NSNumber-bools to js type boolean not number.
21033
* bindings/objc/objc_utility.mm:
21034
(KJS::Bindings::convertObjcValueToValue):
21036
2004-10-12 Richard Williamson <rjw@apple.com>
21038
Fixed access to DOM object via WebScriptObject API.
21039
The execution context for DOM objects wasn't being found.
21040
<rdar://problem/3831372> The valueForKey method for @"offsetLeft" on a paragraph element causes a crash.
21044
* bindings/objc/WebScriptObject.mm:
21046
(-[WebScriptObject KJS::Bindings::]):
21047
(-[WebScriptObject callWebScriptMethod:withArguments:]):
21048
(-[WebScriptObject evaluateWebScript:]):
21049
(-[WebScriptObject setValue:forKey:]):
21050
(-[WebScriptObject valueForKey:]):
21051
(-[WebScriptObject stringRepresentation]):
21052
* bindings/objc/WebScriptObjectPrivate.h:
21054
2004-10-09 Darin Adler <darin@apple.com>
21058
- fixed <rdar://problem/3804661> REGRESSION: JavaScriptCore framework now has two init routines
21060
* bindings/NP_jsobject.cpp: Fixed unnecessarily-complex globals set up that was
21061
creating an init routine.
21063
* kjs/ustring.cpp: Changed around the UString::Rep::empty construction to not
21064
require a global constructor that creates an init routine.
21066
2004-10-09 Darin Adler <darin@apple.com>
21070
- fixed <rdar://problem/3822618> REGRESSION (164-165): expedia.com's popup help doesn't work
21072
* kjs/reference.cpp: (Reference::putValue): Change so that references not found in any object
21073
work with the window object of the page the function is in, not the page of the caller. This
21074
is what all other browsers do. This code was hidden before by the "everything is defined on
21075
window object" hack in WebCore.
21077
2004-10-07 Richard Williamson <rjw@apple.com>
21079
Added simple JavaScript call tracing. Very useful for
21080
debugging complex pages.
21082
Tracing is only available in development builds and is
21085
(gdb) set traceJavaScript = 1
21089
setTraceJavaScript(true)
21091
Function, args, and return values are printed to console. Very
21096
* kjs/function_object.cpp:
21097
(FunctionProtoFuncImp::call):
21099
(KJS::Object::call):
21103
2004-10-05 Richard Williamson <rjw@apple.com>
21105
Fixed <rdar://problem/3819234> NPN_SetException (and throwException:) isn't implemented
21109
* bindings/NP_jsobject.cpp:
21110
(_NPN_SetException):
21111
* bindings/npruntime.cpp:
21112
(_NPN_SetExceptionWithUTF8):
21113
* bindings/objc/WebScriptObject.mm:
21114
(+[WebScriptObject throwException:]):
21116
(KJS::InterpreterImp::context):
21118
2004-10-05 Richard Williamson <rjw@apple.com>
21120
Fixed <rdar://problem/3821515> binding layer needs to convert NSNumber-bools to js type boolean not number
21124
* bindings/objc/objc_utility.mm:
21125
(KJS::Bindings::convertObjcValueToValue):
21127
2004-10-04 Darin Adler <darin@apple.com>
21131
- rolled in a fix the KDE folks did for the operations that generate HTML fragments
21133
* kjs/string_object.cpp: (StringProtoFuncImp::call): Added quote marks to generated HTML.
21135
- rolled out an old workaround we don't need any more
21137
* JavaScriptCore.pbproj/project.pbxproj: Remove -Wno-long-double because the <math.h> issue that
21138
required it is no longer there.
21140
2004-09-30 Richard Williamson <rjw@apple.com>
21142
Fixed <rdar://problem/3821215> NPN hasMethod and hasProperty functions should take NPObjects, not NPClass
21146
* bindings/NP_jsobject.cpp:
21147
(_NPN_GetProperty):
21148
(_NPN_HasProperty):
21150
* bindings/c/c_class.cpp:
21151
(CClass::methodsNamed):
21152
(CClass::fieldNamed):
21153
* bindings/c/c_class.h:
21154
* bindings/c/c_instance.cpp:
21155
(CInstance::invokeMethod):
21156
* bindings/jni/jni_class.cpp:
21157
(JavaClass::methodsNamed):
21158
* bindings/jni/jni_class.h:
21159
* bindings/npruntime.h:
21160
* bindings/objc/objc_class.h:
21161
* bindings/objc/objc_class.mm:
21162
(ObjcClass::methodsNamed):
21163
* bindings/runtime.h:
21164
* bindings/runtime_object.cpp:
21165
(RuntimeObjectImp::get):
21166
(RuntimeObjectImp::hasProperty):
21168
2004-09-29 Chris Blumenberg <cblu@apple.com>
21170
Prepended underscores to NPN methods so that when the QT plug-in loads these symbols, it uses the non-underscore versions in WebKit. Without this, the QT plug-in was failing to load when launching Safari from the command-line.
21174
* JavaScriptCore.pbproj/project.pbxproj:
21175
* bindings/NP_jsobject.cpp:
21176
(_NPN_CreateScriptObject):
21177
(_NPN_InvokeDefault):
21180
(_NPN_GetProperty):
21181
(_NPN_SetProperty):
21182
(_NPN_RemoveProperty):
21183
(_NPN_HasProperty):
21185
* bindings/c/c_class.cpp:
21186
(CClass::methodsNamed):
21187
(CClass::fieldNamed):
21188
* bindings/c/c_instance.cpp:
21189
(CInstance::CInstance):
21190
(CInstance::~CInstance):
21191
(CInstance::operator=):
21192
(CInstance::invokeMethod):
21193
(CInstance::invokeDefaultMethod):
21194
* bindings/c/c_runtime.cpp:
21195
* bindings/c/c_runtime.h:
21196
(KJS::Bindings::CField::name):
21197
(KJS::Bindings::CMethod::name):
21198
* bindings/npruntime.cpp:
21199
(_NPN_GetStringIdentifier):
21200
(_NPN_GetStringIdentifiers):
21201
(_NPN_GetIntIdentifier):
21202
(_NPN_IdentifierIsString):
21203
(_NPN_UTF8FromIdentifier):
21204
(_NPN_IntFromIdentifier):
21205
(NPN_InitializeVariantWithObject):
21206
(_NPN_ReleaseVariantValue):
21207
(_NPN_CreateObject):
21208
(_NPN_RetainObject):
21209
(_NPN_ReleaseObject):
21210
(_NPN_SetExceptionWithUTF8):
21211
(_NPN_SetException):
21213
2004-09-26 Darin Adler <darin@apple.com>
21215
* kjs/string_object.cpp: (StringProtoFuncImp::call): Remove strange use of high() and
21216
low() to get Unicode value of character, and just use unicode().
21218
2004-09-26 Darin Adler <darin@apple.com>
21220
- refine charAt/charCodeAt fix slightly
21222
* kjs/string_object.cpp: (StringProtoFuncImp::call): Treat undefined the same was as an
21223
omitted parameter, as we do everywhere else, and as other browsers do here.
21225
2004-09-26 Darin Adler <darin@apple.com>
21229
- fixed <rdar://problem/3816097> REGRESSION: mailblocks, and presumably many other pages, failing because variable not found
21231
* kjs/internal.cpp: (InterpreterImp::evaluate): Process variable declarations before executing
21232
the program. We were doing this properly for functions, but not entire programs.
21234
- fixed <rdar://problem/3814706> REGRESSION: text fields in mailblocks wizards do not accept keystrokes due to use of charCodeAt()
21236
* kjs/string_object.cpp: (StringProtoFuncImp::call): Changed the implementation of charAt
21237
and charCodeAt to treat a missing parameter as an index of 0, rather than an invalid index.
21239
* tests/mozilla/expected.html: Update for two tests that now pass with these changes.
21245
2004-09-14 Richard Williamson <rjw@apple.com>
21247
1. Add class parameter to object allocation function. This is somewhat redundant, given that
21248
the allocation function is in the class function vector, but people wanted to use the same
21249
allocation function for different classes.
21251
2. Renamed NPN_Class to NPN_Invoke to match the name in the function vector.
21253
3. Add support for a default function on an object. This is a feature that ActiveX supports,
21254
and will allow JavaScript code to be written that will look exactly the same for both ActiveX
21255
plugins and Netscape or WebKit plugins. There are implementations included for the 'C' and
21256
'Objective-C' bindings.
21258
There bugs are covered by
21260
<rdar://problem/3776343> Support for default functions in the JavaScript bindings
21261
<rdar://problem/3779186> NPN_Call needs to be renamed to NPN_Invoke
21262
<rdar://problem/3674754> Need to implement latest npruntime.h
21266
* bindings/NP_jsobject.cpp:
21268
(NPN_InvokeDefault):
21270
* bindings/c/c_class.cpp:
21271
* bindings/c/c_instance.cpp:
21272
(CInstance::CInstance):
21273
(CInstance::operator=):
21274
(CInstance::invokeMethod):
21275
(CInstance::invokeDefaultMethod):
21276
* bindings/c/c_instance.h:
21277
* bindings/c/c_runtime.cpp:
21278
* bindings/c/c_runtime.h:
21279
* bindings/jni/jni_instance.cpp:
21280
(JavaInstance::invokeDefaultMethod):
21281
* bindings/jni/jni_instance.h:
21282
* bindings/npruntime.cpp:
21283
(NPN_CreateObject):
21284
* bindings/npruntime.h:
21285
* bindings/objc/WebScriptObject.h:
21286
* bindings/objc/objc_class.mm:
21287
(ObjcClass::fallbackObject):
21288
* bindings/objc/objc_instance.h:
21289
* bindings/objc/objc_instance.mm:
21290
(ObjcInstance::invokeDefaultMethod):
21291
* bindings/objc/objc_runtime.h:
21292
* bindings/objc/objc_runtime.mm:
21293
(ObjcFallbackObjectImp::ObjcFallbackObjectImp):
21294
(ObjcFallbackObjectImp::get):
21295
(ObjcFallbackObjectImp::put):
21296
(ObjcFallbackObjectImp::canPut):
21297
(ObjcFallbackObjectImp::implementsCall):
21298
(ObjcFallbackObjectImp::call):
21299
(ObjcFallbackObjectImp::hasProperty):
21300
(ObjcFallbackObjectImp::deleteProperty):
21301
(ObjcFallbackObjectImp::defaultValue):
21302
* bindings/runtime.h:
21303
(KJS::Bindings::Class::fallbackObject):
21304
(KJS::Bindings::Instance::getValueOfUndefinedField):
21305
(KJS::Bindings::Instance::setValueOfUndefinedField):
21306
(KJS::Bindings::Instance::valueOf):
21307
* bindings/runtime_object.cpp:
21308
(RuntimeObjectImp::implementsCall):
21309
(RuntimeObjectImp::call):
21310
* bindings/runtime_object.h:
21312
2004-09-13 Maciej Stachowiak <mjs@apple.com>
21316
<rdar://problem/3794735> Gmail- sending a very long message with Safari is so slow it seems like a hang
21318
* kjs/string_object.cpp:
21319
(StringProtoFuncImp::call): Replaced implementation of replace()
21320
method with function below...
21321
(replace): In order to avoid excessive allocation and copying,
21322
figure out the ranges of the original string and replacement
21323
strings to be assembled, instead of constantly creating new
21324
strings at each substitution. The old behavior is basically O(N^2)
21325
for a global replace on a pattern that matches many places in the
21327
(regExpIsGlobal): Helper function for the above.
21328
(expandSourceRanges): ditto
21329
(pushSourceRange): ditto
21330
(expandReplacements): ditto
21331
(pushReplacement): ditto
21333
(KJS::UString::spliceSubstringsWithSeparators): New method that
21334
pieces together substring ranges of this string together with
21335
specified separators, all at one go.
21337
(KJS::UString::Range::Range): Added new helper class to represent
21340
2004-09-14 Maciej Stachowiak <mjs@apple.com>
21344
- fixed <rdar://problem/3800315> encode-URI-test layout test is failing
21346
* kjs/function.cpp:
21347
(KJS::GlobalFuncImp::call): Make sure to escape null
21348
characters. This is a bug in the new code that made part of the
21351
2004-09-13 Darin Adler <darin@apple.com>
21353
Reviewed by Kevin and Maciej.
21355
- new function to support fix for DIG bug in WebCore
21357
* kjs/scope_chain.h: Added new push function that pushes another entire scope chain.
21358
* kjs/scope_chain.cpp: (KJS::ScopeChain::push): Ditto.
21360
2004-09-12 Darin Adler <darin@apple.com>
21362
* tests/mozilla/expected.html: Updated test results for 3 more tests that pass with the new version
21363
of escape and unescape.
21365
2004-09-12 Darin Adler <darin@apple.com>
21367
Reviewed by Maciej.
21369
- fixed <rdar://problem/3798209> any non-ASCII characters are garbled in the result of toLocaleString
21371
* kjs/date_object.cpp:
21372
(formatLocaleDate): Replaced two old functions that used LongDateTime with this one new function that
21373
uses CFDateFormatter.
21374
(DateProtoFuncImp::call): Call the new formatLocaleDate instead of both formatLocaleDate and formatLocaleTime.
21376
2004-09-09 Maciej Stachowiak <mjs@apple.com>
21378
Reviewed by Richard.
21380
<rdar://problem/3493140> REGRESSION (85-100): cedille displays %-escaped in JavaScript message at hotmail.com
21382
* kjs/function.cpp:
21383
(KJS::GlobalFuncImp::call): Replace our escape() and unescape() implementations with
21384
ones from KDE KJS, which have the proper latin-1 behavior to match Win IE.
21386
(Lexer::isHexDigit): Made static and non-const.
21391
2004-09-06 Darin Adler <darin@apple.com>
21393
* JavaScriptCore.pbproj/project.pbxproj: Bump MACOSX_DEPLOYMENT_TARGET to 10.3.
21397
2004-09-01 Richard Williamson <rjw@apple.com>
21399
Add pid to exception messages (to help debug dashboard clients).
21403
* kjs/interpreter.cpp:
21404
(Interpreter::evaluate):
21408
2004-08-20 Richard Williamson <rjw@apple.com>
21410
Implemented new JNI abstraction. We no longer invoke Java methods
21411
directly with JNI, rather we call into the plugin. This allows the
21412
plugin to dispatch the call to the appropriate VM thread. This
21413
change should (will?) fix a whole class of threading related problems with
21418
* JavaScriptCore.pbproj/project.pbxproj:
21419
* bindings/c/c_instance.h:
21420
(KJS::Bindings::CInstance::setExecutionContext):
21421
(KJS::Bindings::CInstance::executionContext):
21422
* bindings/jni/jni_instance.cpp:
21423
(JavaInstance::JavaInstance):
21424
(JavaInstance::invokeMethod):
21425
(JavaInstance::setExecutionContext):
21426
(JavaInstance::executionContext):
21427
* bindings/jni/jni_instance.h:
21428
* bindings/jni/jni_jsobject.cpp:
21429
(JSObject::convertJObjectToValue):
21430
* bindings/jni/jni_runtime.cpp:
21431
(JavaField::JavaField):
21432
(JavaArray::convertJObjectToArray):
21433
(JavaField::valueFromInstance):
21434
(JavaArray::JavaArray):
21435
(JavaArray::valueAt):
21436
* bindings/jni/jni_runtime.h:
21437
(KJS::Bindings::JavaArray::operator=):
21438
(KJS::Bindings::JavaArray::executionContext):
21439
* bindings/jni/jni_utility.h:
21440
* bindings/objc/objc_instance.h:
21441
(KJS::Bindings::ObjcInstance::setExecutionContext):
21442
(KJS::Bindings::ObjcInstance::executionContext):
21443
* bindings/runtime.cpp:
21444
(Instance::createBindingForLanguageInstance):
21445
* bindings/runtime.h:
21446
* bindings/runtime_root.h:
21447
(KJS::Bindings::RootObject::nativeHandle):
21451
2004-08-19 Vicki Murley <vicki@apple.com>
21455
* kjs/property_map.cpp:
21456
(KJS::PropertyMap::put): initialize deletedElementIndex to zero, to make the compiler happy
21458
2004-08-17 Darin Adler <darin@apple.com>
21462
- fixed <rdar://problem/3746676> SAP WebDynpro app hangs inside JavaScript property map hash table code (deleted sentinel problem)
21464
* kjs/property_map.h: Added some private functions.
21465
* kjs/property_map.cpp:
21466
(KJS::PropertyMap::clear): Set sentinelCount to 0.
21467
(KJS::PropertyMap::put): Complete search for the element before choosing to use the deleted-element sentinel.
21468
Also keep sentinel count up to date when we destroy a sentinel by overwriting with a new added element.
21469
(KJS::PropertyMap::expand): Added. Calls rehash with a size 2x the old size, or 16.
21470
(KJS::PropertyMap::rehash): Added. Refactored the rehash code into a separate function.
21471
(KJS::PropertyMap::remove): Add one to sentinelCount, and rehash if 1/4 or more of the elements are
21472
deleted-element sentinels.
21473
(KJS::PropertyMap::checkConsistency): Check the sentinelCount.
21475
2004-08-16 Maciej Stachowiak <mjs@apple.com>
21477
Code change by Eric Albert, reviewd by me.
21479
<rdar://problem/3571960> washingtonpost.com claims I don't have cookies enabled and won't let me read articles
21481
* kjs/date_object.cpp:
21482
(timetUsingCF): Clamp time to LONG_MAX (getting rid of time_t
21483
entirely would be even better, but is not required to fix this bug.
21487
2004-08-16 Richard Williamson <rjw@apple.com>
21489
Fixed <rdar://problem/3581092> cash in KJS::Bindings::JSObject::eval at tcvetantcvetkov.com
21491
Adds bullet proofing to protect against evaluation of bogus JS in all the flavors of bindings (Java, C, and ObjC).
21495
* bindings/NP_jsobject.cpp:
21497
* bindings/jni/jni_jsobject.cpp:
21499
* bindings/objc/WebScriptObject.mm:
21500
(-[WebScriptObject evaluateWebScript:]):
21502
2004-08-15 Richard Williamson <rjw@apple.com>
21504
More updates to np headers. Implemented new NPN functions.
21508
* bindings/NP_jsobject.cpp:
21511
* bindings/npapi.h:
21512
* bindings/npruntime.h:
21514
2004-08-13 Darin Adler <darin@apple.com>
21516
- fix build so we can compile again
21518
* bindings/npapi.h: Added. Richard forgot to check this in. The one I'm checking in here
21519
is good enough so that we can compile, but it's only a stopgap measure, because I think
21520
Richard has a newer one he wants to check in.
21522
2004-08-12 Richard Williamson <rjw@apple.com>
21524
Bring npruntime.h and friends closer to compliance with
21527
Reviewed by Maciej.
21529
* JavaScriptCore.pbproj/project.pbxproj:
21530
* bindings/NP_jsobject.cpp:
21532
(_NPN_CreateScriptObject):
21537
(NPN_RemoveProperty):
21538
* bindings/NP_jsobject.h:
21539
* bindings/c/c_instance.cpp:
21540
(CInstance::invokeMethod):
21541
* bindings/c/c_utility.cpp:
21542
(convertNPVariantToValue):
21543
* bindings/npruntime.cpp:
21544
(NPN_IdentifierIsString):
21545
(NPN_VariantIsVoid):
21546
(NPN_VariantIsNull):
21547
(NPN_VariantIsUndefined):
21548
(NPN_VariantIsBool):
21549
(NPN_VariantIsInt32):
21550
(NPN_VariantIsDouble):
21551
(NPN_VariantIsString):
21552
(NPN_VariantIsObject):
21553
(NPN_VariantToBool):
21554
(NPN_VariantToString):
21555
(NPN_VariantToInt32):
21556
(NPN_VariantToDouble):
21557
(NPN_VariantToObject):
21558
(NPN_InitializeVariantAsVoid):
21559
(NPN_InitializeVariantAsNull):
21560
(NPN_InitializeVariantAsUndefined):
21561
(NPN_InitializeVariantWithBool):
21562
(NPN_InitializeVariantWithInt32):
21563
(NPN_InitializeVariantWithDouble):
21564
(NPN_InitializeVariantWithString):
21565
(NPN_InitializeVariantWithStringCopy):
21566
(NPN_InitializeVariantWithObject):
21567
(NPN_InitializeVariantWithVariant):
21568
(NPN_ReleaseVariantValue):
21569
(NPN_CreateObject):
21570
* bindings/npruntime.h:
21572
(_NPString::_NPVariant::):
21573
* bindings/npruntime_priv.h: Added.
21575
2004-08-12 Darin Adler <darin@apple.com>
21579
- fixed 3 problems with parse functions that I just wrote, fixing 3 more Mozilla JavaScript tests
21581
* kjs/function.cpp:
21582
(KJS::parseDigit): Fix typo, 'Z' instead of 'z', that prevented lowercase hex digits from working.
21583
(KJS::parseInt): Add octal support. Specification says it's optional, but I guess not.
21584
(KJS::parseFloat): Fix check for "0x" in parseFloat to return 0 rather than NaN. Also add code
21585
to skip leading "+" or "-".
21589
2004-08-12 Darin Adler <darin@apple.com>
21593
- fixed 43 Mozilla JavaScript tests
21595
* kjs/date_object.h: Change parseDate and timeClip to take and return doubles.
21596
* kjs/date_object.cpp:
21597
(DateObjectImp::construct): Change to use a timeClip function that takes and returns a double rather
21598
than constructing a number object to pass to it.
21599
(DateObjectFuncImp::call): Change to use a parseDate function that returns a double.
21600
(KJS::parseDate): Change to return a double instead of creating the Number object here.
21601
(KJS::timeClip): Implement this as specified in the language standard.
21603
* kjs/error_object.cpp: (NativeErrorImp::NativeErrorImp): Set the DontDelete, ReadOnly, and DontEnum
21604
flags on the prototype property.
21606
* kjs/function.cpp:
21607
(KJS::FunctionImp::get): Return null rather than undefined for arguments when the function is not
21608
currently in scope.
21609
(KJS::isStrWhiteSpace): Added. Matches specification for StrWhiteSpace. Could move it to some utility
21611
(KJS::parseDigit): Added. Helper function for parseInt.
21612
(KJS::parseInt): Added. Integer parser that puts result in a double so we're not limited to what
21613
strtoll can handle. Also matches standard more closely.
21614
(KJS::parseFloat): Added. Handles "0x" properly and passes flag to make empty string turn into NaN
21616
(KJS::GlobalFuncImp::call): Use the new parseInt and parseFloat.
21618
* kjs/function_object.cpp: (FunctionPrototypeImp::FunctionPrototypeImp): Add a length property.
21620
* kjs/lexer.h: Added error flag and sawError() function for detecting errors.
21622
(Lexer::setCode): Clear error state.
21623
(Lexer::lex): Set error state if the lexer encounters an error
21625
* kjs/internal.cpp:
21626
(NumberImp::toString): Roll in change from KDE version to special case 0 so we handle -0 correctly.
21627
(Parser::parse): Use new lexer error method so those errors are treated like parser errors.
21629
* kjs/math_object.cpp: (MathFuncImp::call): Change min and max to treat -0 as less than +0.
21630
Change round to round values between -0.5 and -0 to -0 instead of +0.
21632
* kjs/nodes.h: Add evaluateReference function to GroupNode.
21633
* kjs/nodes.cpp: (GroupNode::evaluateReference): Pass references through groups (parenthesized
21634
expressions) properly so that expressions like "delete (x.y)" work. Before, the parentheses
21635
would change x.y into a value that can't be deleted as a side effect.
21637
* kjs/string_object.cpp: Change parameter count for indexOf and lastIndexOf from 2 to 1 to match
21640
* kjs/testkjs.cpp: Rolled in changes from KDE to add a "quit" function to the test tool and
21641
get rid of the fixed size limit for code.
21643
* kjs/ustring.cpp: (KJS::UString::substr): Added optimized case for substr(0, length) so it just
21644
returns the string without creating a new Rep, since I'm using substr in a place where it will
21645
often be passed a 0.
21647
* tests/mozilla/ecma/String/15.5.4.11-1.js: Fixed one wrong entry in the Unicode table I added to
21648
the other day that was making a couple tests fail.
21649
* tests/mozilla/ecma/String/15.5.4.12-1.js: Ditto.
21650
* tests/mozilla/ecma/String/15.5.4.12-2.js: Ditto.
21651
* tests/mozilla/ecma/String/15.5.4.12-3.js: Ditto.
21652
* tests/mozilla/ecma/String/15.5.4.12-4.js: Ditto.
21653
* tests/mozilla/ecma/String/15.5.4.12-5.js: Ditto.
21655
* kjs/string_object.lut.h: Regenerated.
21657
2004-08-11 Darin Adler <darin@apple.com>
21659
- fixed a tiny problem with the UTF-16 PCRE check-in
21661
* pcre/maketables.c: (pcre_maketables): Fix mistake in table-generating code that sometimes caused
21662
the ctype_meta flag to get set in items that should not have it.
21664
* pcre/chartables.c: Regenerated.
21666
2004-08-10 Richard Williamson <rjw@apple.com>
21668
Fixed <rdar://problem/3674747> Need to implement invokeUndefinedMethodFromWebScript:withArguments:
21670
The following WebScripting methods are now supported on bound
21673
- (id)invokeUndefinedMethodFromWebScript:(NSString *)name withArguments:(NSArray *)args;
21674
- (void)setValue:(id)value forUndefinedKey:(NSString *)key
21675
- (id)valueForUndefinedKey:(NSString *)key
21679
* bindings/c/c_class.cpp:
21680
(CClass::fieldNamed):
21681
* bindings/c/c_class.h:
21682
* bindings/jni/jni_class.cpp:
21683
(JavaClass::fieldNamed):
21684
* bindings/jni/jni_class.h:
21685
* bindings/objc/objc_class.h:
21686
(KJS::Bindings::ObjcClass::isa):
21687
* bindings/objc/objc_class.mm:
21688
(ObjcClass::methodsNamed):
21689
(ObjcClass::fieldNamed):
21690
(ObjcClass::fallbackObject):
21691
* bindings/objc/objc_instance.h:
21692
* bindings/objc/objc_instance.mm:
21693
(ObjcInstance::invokeMethod):
21694
(ObjcInstance::setValueOfField):
21695
(ObjcInstance::setValueOfUndefinedField):
21696
(ObjcInstance::getValueOfField):
21697
(ObjcInstance::getValueOfUndefinedField):
21698
* bindings/objc/objc_runtime.h:
21699
(KJS::Bindings::ObjcField::~ObjcField):
21700
(KJS::Bindings::ObjcField::ObjcField):
21701
(KJS::Bindings::ObjcField::operator=):
21702
(KJS::Bindings::FallbackObjectImp::classInfo):
21703
* bindings/objc/objc_runtime.mm:
21704
(ObjcField::ObjcField):
21707
(ObjcField::valueFromInstance):
21708
(ObjcField::setValueToInstance):
21709
(FallbackObjectImp::FallbackObjectImp):
21710
(FallbackObjectImp::get):
21711
(FallbackObjectImp::put):
21712
(FallbackObjectImp::canPut):
21713
(FallbackObjectImp::implementsCall):
21714
(FallbackObjectImp::call):
21715
(FallbackObjectImp::hasProperty):
21716
(FallbackObjectImp::deleteProperty):
21717
(FallbackObjectImp::defaultValue):
21718
* bindings/runtime.h:
21719
(KJS::Bindings::Class::fallbackObject):
21720
(KJS::Bindings::Instance::getValueOfUndefinedField):
21721
(KJS::Bindings::Instance::setValueOfUndefinedField):
21722
* bindings/runtime_object.cpp:
21723
(RuntimeObjectImp::get):
21724
(RuntimeObjectImp::put):
21725
(RuntimeObjectImp::canPut):
21726
(RuntimeObjectImp::hasProperty):
21727
* bindings/testbindings.mm:
21728
(-[MyFirstInterface valueForUndefinedKey:]):
21729
(-[MyFirstInterface setValue:forUndefinedKey:]):
21731
2004-08-10 Darin Adler <darin@apple.com>
21735
- switch PCRE to do UTF-16 directly instead of converting to/from UTF-8 for speed
21737
* pcre/pcre.h: Added PCRE_UTF16 switch, set to 1. Added pcre_char typedef, which is char
21738
or uint16_t depending on the mode, and used appropriate in the 7 public functions
21739
that need to use it.
21740
* pcre/pcre.c: Add UTF-16 support to all functions.
21741
* pcre/study.c: Ditto.
21743
* pcre/internal.h: Added ichar typedef, which is unsigned char or uint16_t depending on
21744
the mode. Changed declarations to use symbolic constants and typedefs so we size
21745
things to ichar when needed.
21747
* pcre/maketables.c: (pcre_maketables): Change code to make tables that are
21748
sized to 16-bit characters instead of 8-bit.
21751
(pcre_copy_substring): Use pcre_char instead of char.
21752
(pcre_get_substring_list): Ditto.
21753
(pcre_free_substring_list): Ditto.
21754
(pcre_get_substring): Ditto.
21755
(pcre_free_substring): Ditto.
21757
* pcre/dftables.c: (main): Used a bit more const, and use ICHAR sizes instead
21758
of hard-coding 8-bit table sizes.
21760
* pcre/chartables.c: Regenerated.
21762
* kjs/ustring.h: Remove functions that convert UTF-16 to/from UTF-8 offsets.
21763
* kjs/ustring.cpp: Change the shared empty string to have a unicode pointer that
21764
is not null. The null string still has a null pointer. This prevents us from
21765
passing a null through to the regular expression engine (which results in a null
21766
error even when the string length is 0).
21769
(KJS::RegExp::RegExp): Null-terminate the pattern and pass it.
21770
(KJS::RegExp::match): Use the 16-bit string directly, no need to convert to UTF-8.
21772
2004-08-09 Darin Adler <darin@apple.com>
21774
Reviewed by Maciej.
21776
- fixed 28 Mozilla JavaScript tests
21778
* kjs/array_object.cpp: (ArrayProtoFuncImp::call): Check for undefined rather than
21779
checking the number of arguments for the join method.
21781
* kjs/lexer.cpp: (Lexer::lex): Parse hexadecimal and octal constants in doubles rather
21782
than integers, so we aren't limited to 32 bits.
21784
* kjs/math_object.cpp: (MathFuncImp::call): Get rid of many unneeded special cases in
21785
the implementation of the pow operation. Also simplied a case that was handling positive
21786
and negative infinity separately.
21788
* kjs/nodes.cpp: (ShiftNode::evaluate): Keep the result of shifts in a double instead of
21789
putting them in a long, so that unsigned shift will work properly.
21791
* kjs/number_object.cpp: Add the DontDelete and ReadOnly flags to the numeric constants.
21793
* kjs/operations.cpp:
21794
(KJS::isPosInf): Added an implementation inside APPLE_CHANGES that does not depend on the
21795
sign of isinf; our isinf function returns +1 even for negative infinity.
21796
(KJS::isNegInf): And again.
21797
(KJS::relation): Put in a nice simple implementation of comparison inside APPLE_CHANGES.
21798
Our floating point already handles the various infinity cases correctly.
21800
* kjs/regexp_object.cpp:
21801
(RegExpProtoFuncImp::call): Add missing return before Null() in Exec method.
21802
(RegExpObjectImp::arrayOfMatches): Put undefined rather than an empty string into the
21803
array in cases where we did not match.
21804
(RegExpObjectImp::construct): Set the DontDelete, ReadOnly, and DontEnum flags for
21805
"global", "ignoreCase", "multiline", and "source".
21807
* kjs/string_object.cpp: (StringProtoFuncImp::call): For the match method, turn a null
21808
string into undefined rather than an empty string. For the slice method, handle an
21809
undefined parameter for the limit properly as decribed in the specification, and add
21810
the limit to one case that didn't have the limit at all. For the methods that generate
21811
HTML strings, use lowercase tags instead of uppercase.
21814
(KJS::UChar::toLower): Use u_tolower from the ICU library.
21815
(KJS::UChar::toUpper): Use u_toupper from the ICU library.
21816
(KJS::UString::append): Fix some math that caused a buffer overflow.
21817
(KJS::convertUTF16OffsetsToUTF8Offsets): Ignore negative numbers (-1 is used as a special
21818
flag) rather than converting them all to 0.
21819
(KJS::convertUTF8OffsetsToUTF16Offsets): Ditto.
21821
* tests/mozilla/jsDriver.pl: Fixed the relative links to point to our actual test files.
21823
* tests/mozilla/ecma/String/15.5.4.11-1.js: Fixed the Unicode table in this test to match
21824
the Unicode specification in a few cases where it was wrong before.
21825
* tests/mozilla/ecma/String/15.5.4.11-2.js: Ditto.
21826
* tests/mozilla/ecma/String/15.5.4.11-3.js: Ditto.
21827
* tests/mozilla/ecma/String/15.5.4.11-5.js: Ditto.
21828
* tests/mozilla/ecma/String/15.5.4.11-6.js: Ditto.
21829
* tests/mozilla/ecma/String/15.5.4.12-1.js: Ditto.
21830
* tests/mozilla/ecma/String/15.5.4.12-2.js: Ditto.
21831
* tests/mozilla/ecma/String/15.5.4.12-3.js: Ditto.
21832
* tests/mozilla/ecma/String/15.5.4.12-4.js: Ditto.
21833
* tests/mozilla/ecma/String/15.5.4.12-5.js: Ditto.
21835
* JavaScriptCore.pbproj/project.pbxproj: Link to libicu.
21837
* kjs/number_object.lut.h: Regenerated.
21839
2004-08-09 Darin Adler <darin@apple.com>
21841
Reviewed by Maciej.
21843
- fixed <rdar://problem/3753467> REGRESSION (137-138): reproducible buffer overrun in UString manipulation code
21845
* kjs/ustring.cpp: (KJS::UString::append): Fix incorrect size computation. Without it
21846
we get a buffer overflow.
21850
2004-08-05 Richard Williamson <rjw@apple.com>
21852
Fixed part of 3674747. The QT guys need this for feature freeze.
21854
This patch implements support for the
21856
- (id)invokeUndefinedMethodFromWebScript:(NSString *)name withArguments:(NSArray *)args
21858
method of objects bound to JavaScript.
21863
* bindings/objc/objc_class.mm:
21864
(ObjcClass::methodsNamed):
21865
(ObjcClass::fieldNamed):
21866
* bindings/objc/objc_instance.mm:
21867
(ObjcInstance::invokeMethod):
21868
* bindings/objc/objc_runtime.h:
21869
(KJS::Bindings::ObjcMethod::~ObjcMethod):
21870
(KJS::Bindings::ObjcMethod::isFallbackMethod):
21871
(KJS::Bindings::ObjcMethod::javaScriptName):
21872
* bindings/objc/objc_runtime.mm:
21873
(ObjcMethod::ObjcMethod):
21874
(ObjcMethod::getMethodSignature):
21875
(ObjcMethod::setJavaScriptName):
21876
* bindings/testbindings.mm:
21878
2004-08-04 Vicki Murley <vicki@apple.com>
21882
- fix <rdar://problem/3649789> SAP WebGUI has problems loading first page because of parse error
21885
(Lexer::lex): if the current character is a '\' and the next character is a line terminator,
21886
go to the next line and continue parsing the string (instead of failing). This matches
21887
behavior in Mac IE and Mozilla.
21889
2004-08-03 Kevin Decker <kdecker@apple.com>
21893
Rolled in changes from the latest KJS sources that support additional
21894
Number.prototype functions.
21896
Specifically this patch covers the follow parts of the ECMA 3 spec:
21897
15.7.4.5, 15.7.4.6, and 15.7.4.7
21900
<rdar://problem/3663716> missing Number.toFixed (and toPrecision, toExponential)
21901
<rdar://problem/3749492> missing Number.toPrecision prototype implementation
21902
<rdar://problem/3749591> missing Number.toExponential prototype implementation
21904
* kjs/identifier.h: Added toFixed, toPrecision, and toExponential to the
21905
list of supported identifiers (a macro).
21906
* kjs/number_object.cpp: Implemented support for toFixed(), toPrecision(),
21907
and toExponential().
21908
(NumberPrototypeImp::NumberPrototypeImp):
21909
(NumberProtoFuncImp::call):
21910
* kjs/number_object.h: Added property names for toFixed, toPrecision,
21912
(KJS::NumberProtoFuncImp::):
21913
* tests/mozilla/expected.html: Update results.
21915
2004-08-03 Darin Adler <darin@apple.com>
21919
- added support for copying RegExp objects so 7 more Mozilla regexp tests pass
21921
* kjs/regexp_object.cpp: (RegExpObjectImp::construct): Check for case where
21922
we are supposed to just copy the regular expression object, and do so.
21923
Also tighten up arguments check to handle case where an actual "undefined"
21924
is passed rather than just omitting an argument.
21926
* tests/mozilla/expected.html: Update results.
21928
2004-08-02 Darin Adler <darin@apple.com>
21930
* tests/mozilla/.cvsignore: Added.
21931
* tests/mozilla/expected.html: Update results.
21933
2004-08-02 Darin Adler <darin@apple.com>
21937
- fixed RegExp.toString so 3 more Mozilla regexp tests pass
21939
* kjs/regexp_object.cpp: (RegExpProtoFuncImp::call):
21940
Append the flags here so more tests paseed.
21942
2004-08-02 Darin Adler <darin@apple.com>
21946
- fixed a couple things making 5 Mozilla regexp tests pass
21948
* kjs/regexp_object.cpp: (RegExpProtoFuncImp::call): Implement toString
21950
(RegExpObjectImp::construct): Fix bug where the string "undefined" would
21951
be used as the flags string when no parameter was passed.
21953
* kjs/regexp_object.h: (KJS::RegExpPrototypeImp::classInfo):
21954
Added a class info object for RegExp prototype so it can return
21955
a string instead of raising an exception when converting to a string.
21957
* tests/mozilla/expected.html: Update results.
21959
2004-08-02 Darin Adler <darin@apple.com>
21963
- fix crashes in mozilla tests due to mishandling NaN
21965
* kjs/array_object.cpp: (ArrayProtoFuncImp::call): Rerranged range checks after
21966
calls to toInteger so that NaN will get turned into something that fits in an integer.
21967
These were the ones John already fixed, but his fix used isnan and the new fix is
21970
* kjs/number_object.cpp: (NumberProtoFuncImp::call): Rearranged radix range checks
21971
after a call to toInteger to handle NaN properly. Also removed separate check
21972
for undefined that's not needed.
21974
* kjs/string_object.cpp: (StringProtoFuncImp::call): More of the same kinds of changes
21975
as in the above two files, but for a lot more functions. Also changed one place with
21976
an explicit check for undefined to instead just check isNaN.
21978
* tests/mozilla/run-mozilla-tests: Changed to invoke jst using $SYMROOTS for people
21979
like me who don't keep $SYMROOTS in their $PATH.
21985
2004-07-26 Kevin Decker <kdecker@apple.com>
21987
Changes done by Darin, reviewed by Kevin.
21989
- changed testkjs to build in Xcode rather than from Makefile
21991
* .cvsignore: Removed obsolete files from this list.
21992
* Makefile.am: Removed code to build testkjs; we do this in Xcode now.
21993
Changed to build target "All" rather than default target. This makes us
21994
build the testkjs test tool.
21995
* dummy.cpp: Removed.
21996
* kjs/.cvsignore: Removed obsolete files from this list, including
21997
the testkjs tool, which is now built in the symroots directory.
21998
* kjs/testkjs.cpp: Added copyright notice that was missing, since we have
21999
changed this file. Also this has the nice side effect of causing the tool
22000
to be rebuilt in the new location even if there are no other changes in
22001
your tree when you check this out.
22002
* tests/mozilla/run-mozilla-tests: Invoke perl explicitly so this works
22003
without setting the execute bit on jsDriver.pl.
22005
2004-07-22 Kevin Decker <kdecker@apple.com>
22009
Fixed <rdar://problem/3682340> (error console does not include source urls or line numbers of event exceptions).
22011
* kjs/function_object.cpp:
22012
(FunctionObjectImp::construct):
22013
* kjs/function_object.h:
22015
(KJS::ObjectImp::construct):
22017
(KJS::Object::construct):
22019
2004-07-21 Darin Adler <darin@apple.com>
22021
* bindings/npruntime.h: Fixed typo.
22023
2004-07-19 John Sullivan <sullivan@apple.com>
22025
Reviewed by Maciej.
22027
- bulletproofed array.slice() against NAN arguments. Harri noticed this
22028
vulnerability in my patch for 3714644
22030
* kjs/array_object.cpp:
22031
(ArrayProtoFuncImp::call):
22032
handle NAN parameters passed to slice() by clamping to 0 and length.
22034
2004-07-19 Richard Williamson <rjw@apple.com>
22036
Fixed 3733349. Prevent Java applet callbacks into JavaScript after applet
22037
has been destroyed.
22041
* bindings/jni/jni_jsobject.cpp:
22042
(JSObject::invoke):
22043
(JSObject::JSObject):
22045
2004-07-16 John Sullivan <sullivan@apple.com>
22047
Reviewed by Maciej.
22049
- fixed <rdar://problem/3714644> REGRESSION (125.8-146): bugzilla submit link
22050
hangs browser with javascript
22052
* kjs/array_object.cpp:
22053
(ArrayProtoFuncImp::call):
22054
Check for undefined type for args[0] the same way we were already checking
22055
for args[1]. In this case, args was zero-length, but we were treating
22056
args[0] like an integer anyway. Resulted in some code looping from a NAN
22057
value to 4, taking approximately forever.
22059
* JavaScriptCore.pbproj/project.pbxproj:
22064
2004-07-14 Maciej Stachowiak <mjs@apple.com>
22068
<rdar://problem/3711474>: (REGRESSION (125-146): JavaScript 'toString(16)' is broken)
22069
<rdar://problem/3644873>: (REGRESSION (125-140u): secondary list doesn't fill in at Southwest.com)
22071
* kjs/number_object.cpp:
22072
(NumberProtoFuncImp::call): Initialize radix from dradix, not from itself!
22074
2004-07-13 Kevin Decker <kdecker@apple.com>
22076
Reviewed by kocienda.
22078
- made testkjs and JavaScriptCore a subtarget of 'All'
22079
- testkjs now builds in $SYMROOTS
22081
* JavaScriptCore.pbproj/project.pbxproj:
22085
2004-06-24 Chris Blumenberg <cblu@apple.com>
22087
Ignore .mode1 files in JavaScriptCore.pbproj
22089
Reviewed by kocienda.
22091
* JavaScriptCore.pbproj/.cvsignore:
22093
2004-06-23 Richard Williamson <rjw@apple.com>
22095
Implemented changes for latest npruntime.h.
22099
* JavaScriptCore.pbproj/project.pbxproj:
22100
* bindings/NP_jsobject.cpp:
22101
(listFromVariantArgs):
22102
(identiferFromNPIdentifier):
22103
(_NPN_CreateScriptObject):
22108
(NPN_RemoveProperty):
22109
* bindings/NP_jsobject.h:
22110
* bindings/c/c_class.cpp:
22111
(CClass::methodsNamed):
22112
(CClass::fieldNamed):
22113
* bindings/c/c_instance.cpp:
22114
(CInstance::invokeMethod):
22115
* bindings/c/c_utility.cpp:
22116
(convertNPVariantToValue):
22117
* bindings/c/c_utility.h:
22118
* bindings/npruntime.cpp:
22119
(stringIdentifierEqual):
22120
(stringIdentifierHash):
22121
(getStringIdentifierDictionary):
22122
(intIdentifierEqual):
22123
(intIdentifierHash):
22124
(getIntIdentifierDictionary):
22125
(NPN_GetStringIdentifier):
22126
(NPN_GetStringIdentifiers):
22127
(NPN_GetIntIdentifier):
22128
(NPN_IdentifierIsString):
22129
(NPN_UTF8FromIdentifier):
22130
(NPN_VariantToInt32):
22131
(NPN_VariantToDouble):
22132
(NPN_SetException):
22133
* bindings/npruntime.h:
22134
* bindings/objc/WebScriptObject.mm:
22135
(+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
22136
* bindings/runtime_object.cpp:
22137
(RuntimeObjectImp::~RuntimeObjectImp):
22138
* bindings/runtime_root.cpp:
22139
(KJS::Bindings::rootForInterpreter):
22140
* bindings/testbindings.cpp:
22141
(initializeIdentifiers):
22147
=== JavaScriptCore-146.1 ===
22149
2004-06-16 Richard Williamson <rjw@apple.com>
22151
Fixed <rdar://problem/3702287> Crash returning nil from bound ObjC
22153
This turned out to be a show stopper for Dashboard. Accessing a nil
22154
ObjC property from JS caused a crash. Similar to the problem
22155
3696112 fixed below.
22159
* bindings/objc/objc_runtime.mm:
22160
(KJS::Bindings::ObjcField::valueFromInstance):
22164
2004-06-16 Richard Williamson <rjw@apple.com>
22166
Fixed <rdar://problem/3696112>: nil from an Objective-C class seems to get wrapped as a JavaScript proxy that will not print.
22168
This turned out to be a show stopper for Dashboard. We now
22169
return Undefined() when nil is returned from a ObjC method
22170
that returns an object type.
22172
Reviewed by Maciej.
22174
* bindings/objc/objc_utility.mm:
22175
(KJS::Bindings::convertObjcValueToValue):
22179
2004-06-15 Richard Williamson <rjw@apple.com>
22181
Fixed <rdar://problem/3695875>: Objective-C instances that are exported to JavaScript are too promiscuous
22183
No longer need to check respondsToSelector: for
22184
isSelectorExcludedFromWebScript: and isKeyExcludedFromWebScript:
22185
because these now have a default implementation on NSObject.
22189
* bindings/objc/objc_class.mm:
22190
(ObjcClass::methodsNamed):
22191
(ObjcClass::fieldNamed):
22193
2004-06-14 Darin Adler <darin@apple.com>
22195
Reviewed by Maciej.
22197
- fixed some things for GC that Patrick missed, or that happened after the branch
22199
* bindings/objc/WebScriptObject.mm:
22200
(-[WebScriptObject dealloc]): Moved removeNativeReference call here from private object.
22201
(-[WebScriptObject finalize]): Added.
22203
- added some missing nil checks
22205
* bindings/objc/objc_instance.mm:
22206
(ObjcInstance::ObjcInstance): Check for nil.
22207
(ObjcInstance::~ObjcInstance): Check for nil.
22208
(ObjcInstance::operator=): Check for nil.
22210
2004-06-14 Darin Adler <darin@apple.com>
22212
Reviewed by me, code changes by Patrick Beard.
22214
- fixed <rdar://problem/3671507>: (WebKit should adopt GC changes and compile with GC enabled)
22216
* bindings/objc/objc_instance.mm:
22217
(ObjcInstance::ObjcInstance): Use CFRetain instead of retain.
22218
(ObjcInstance::~ObjcInstance): Use CFRelease instead of release.
22219
(ObjcInstance::operator=): More of the same.
22220
(ObjcInstance::end): Use [pool drain] if compiling on Tiger.
22222
* bindings/objc/objc_runtime.mm:
22223
(ObjcArray::ObjcArray): Use CFRetain instead of retain.
22224
(ObjcArray::~ObjcArray): Use CFRelease instead of release.
22225
(ObjcArray::operator=): More of the same.
22227
* bindings/testbindings.mm: Fixed incorrect license.
22228
(main): Use [pool drain] if compiling on Tiger.
22232
2004-06-10 Kevin Decker <kdecker@apple.com>
22238
- fixed <rdar://problem/3682398>: (error console line numbers are offset by 1)
22240
(KJS::Lexer::lineNo):
22241
- fixed <rdar://problem/3682398>: (error console line numbers are offset by 1)
22243
=== JavaScriptCore-143.2 ===
22245
2004-06-07 Darin Adler <darin@apple.com>
22247
- fixed <rdar://problem/3682489>: (JavaScriptGlue no longer compiles because Interpreter::evaluate parameters changed)
22249
* kjs/interpreter.h: Added an overload to make JavaScriptGlue compile.
22250
* kjs/interpreter.cpp: (KJS::Interpreter::evaluate): Implemented the overload.
22252
=== JavaScriptCore-143.1 ===
22254
2004-06-04 Kevin Decker <kdecker@apple.com>
22258
- fixed <rdar://problem/3680594>
22261
(KJS::Error::create):
22265
2004-06-04 Darin Adler <darin@apple.com>
22267
* kjs/testkjs.cpp: (main): Fix build breakage by adding URL and line number parameters.
22269
2004-06-04 Kevin Decker <kdecker@apple.com>
22273
- ObjC bindings do not (yet) pass along sourceurl or line numbers
22274
- we don't have a way as of yet to accomidate line numbers and urls for dynamic javascript
22275
- changed the wording of an error message
22276
- the lexer, parser, and interpreter have been made "sourceURL aware"
22277
- stored the url into Error
22279
* bindings/NP_jsobject.cpp:
22281
* bindings/jni/jni_jsobject.cpp:
22283
* bindings/objc/WebScriptObject.mm:
22284
(-[WebScriptObject evaluateWebScript:]):
22285
* kjs/function.cpp:
22286
(GlobalFuncImp::call):
22287
* kjs/function_object.cpp:
22288
(FunctionObjectImp::construct):
22289
* kjs/internal.cpp:
22291
(InterpreterImp::checkSyntax):
22292
(InterpreterImp::evaluate):
22294
* kjs/interpreter.cpp:
22295
(Interpreter::evaluate):
22296
* kjs/interpreter.h:
22300
(KJS::Lexer::sourceURL):
22303
(Node::throwError):
22304
(FunctionCallNode::evaluate):
22307
(KJS::Error::create):
22310
2004-06-04 Richard Williamson <rjw@apple.com>
22312
Fixed crash when attempting to access properties on nil
22317
* bindings/objc/objc_instance.mm:
22318
(ObjcInstance::getClass):
22319
* bindings/runtime_object.cpp:
22320
(RuntimeObjectImp::get):
22321
* bindings/testM.js:
22322
* bindings/testbindings.mm:
22323
(-[MyFirstInterface getString]):
22325
2004-05-27 Kevin Decker <kdecker@apple.com>
22329
-revised generated error message content
22331
* kjs/error_object.cpp:
22332
(ErrorProtoFuncImp::call):
22333
* kjs/internal.cpp:
22336
(KJS::Error::create):
22340
2004-05-27 Richard Williamson <rjw@apple.com>
22342
Renamed WebScriptMethods to WebScripting based on feedback from Nancy.
22346
* bindings/objc/WebScriptObject.h:
22348
2004-05-27 Darin Adler <darin@apple.com>
22350
Reviewed by Maciej.
22352
- moved to new symlink technique for embedding frameworks
22354
* JavaScriptCore.pbproj/project.pbxproj: Get rid of embed-frameworks build step
22355
because we don't need it any more.
22357
2004-05-24 Richard Williamson <rjw@apple.com>
22359
Changed RuntimeArrayImp to inherit from ArrayInstanceImp and
22360
fixed ClassInfo to correctly reflect inheritance. This is required
22361
because of the runtime checks in JSC for arrays, i.e. in
22362
the Function objects apply method.
22366
* bindings/jni/jni_runtime.cpp:
22367
(JavaArray::convertJObjectToArray):
22368
* bindings/objc/objc_utility.mm:
22369
(KJS::Bindings::convertObjcValueToValue):
22370
* bindings/runtime_array.cpp:
22371
(RuntimeArrayImp::RuntimeArrayImp):
22372
* bindings/runtime_array.h:
22373
* bindings/testM.js: Added.
22374
* bindings/testbindings.mm:
22375
(+[MyFirstInterface webScriptNameForSelector:]):
22376
(-[MyFirstInterface logMessages:]):
22377
(-[MyFirstInterface logMessage:prefix:]):
22378
(-[MyFirstInterface callJSObject::]):
22380
2004-05-22 Darin Adler <darin@apple.com>
22382
Reviewed by Maciej.
22384
- fixed <rdar://problem/3664260>: (JS needs to listen to timezone change notifications)
22386
* kjs/date_object.cpp: (CopyLocalTimeZone): As per Chris Kane and Jordan Hubbard, use <notify.h>
22387
with a hardcoded string of "com.apple.system.timezone", and do CFTimeZoneResetSystem since
22388
CoreFoundation doesn't do this itself. Turns out this affects the default time zone as long as
22389
it hasn't been set explicitly.
22393
2004-05-20 Richard Williamson <rjw@apple.com>
22395
Implemented WebScriptObject/DOM wrapper voodoo. DOM wrappers
22396
can now be referenced like any other WebScriptObject, meaning
22397
you can do JS operations on them.
22399
All added implementation of finalizeForWebScript.
22403
* bindings/objc/WebScriptObject.h:
22404
* bindings/objc/WebScriptObject.mm:
22405
(-[WebScriptObject _initializeWithObjectImp:KJS::root:Bindings::]):
22406
(-[WebScriptObject _initWithObjectImp:KJS::root:Bindings::]):
22407
(-[WebScriptObject KJS::]):
22408
(-[WebScriptObject dealloc]):
22409
(-[WebScriptObject callWebScriptMethod:withArguments:]):
22410
(-[WebScriptObject evaluateWebScript:]):
22411
(-[WebScriptObject setValue:forKey:]):
22412
(-[WebScriptObject valueForKey:]):
22413
(-[WebScriptObject stringRepresentation]):
22414
* bindings/objc/WebScriptObjectPrivate.h:
22415
* bindings/objc/objc_instance.mm:
22416
(ObjcInstance::~ObjcInstance):
22418
2004-05-19 Richard Williamson <rjw@apple.com>
22420
Removed extraneous tabs that were added (by XCode?).
22422
* bindings/objc/WebScriptObject.h:
22424
2004-05-19 Darin Adler <darin@apple.com>
22426
- fixed headers with licenses mangled by Xcode auto-indenting
22428
* bindings/jni/jni_jsobject.cpp:
22429
* bindings/jni/jni_jsobject.h:
22430
* bindings/runtime_array.h:
22431
* bindings/runtime_root.cpp:
22432
* bindings/runtime_root.h:
22434
2004-05-18 Richard Williamson <rjw@apple.com>
22436
Added exception logging. Also check for exception and
22437
set results as appropriate.
22439
Reviewed by Maciej (partially reviewed).
22441
* bindings/objc/WebScriptObject.mm:
22442
(-[WebScriptObject callWebScriptMethod:withArguments:]):
22443
(-[WebScriptObject evaluateWebScript:]):
22444
(-[WebScriptObject setValue:forKey:]):
22445
(-[WebScriptObject valueForKey:]):
22447
2004-05-18 Richard Williamson <rjw@apple.com>
22449
Finsished implementing support for windowScriptObject.
22450
Had to make WebScriptObjectPrivate.h accessible from
22453
Reviewed by Maciej.
22455
* JavaScriptCore.pbproj/project.pbxproj:
22456
* bindings/objc/WebScriptObjectPrivate.h:
22458
2004-05-18 Richard Williamson <rjw@apple.com>
22460
Use KVC to set/get values instead of directly accessing
22463
Reviewed by Maciej.
22465
* bindings/objc/WebScriptObject.mm:
22466
(-[WebScriptObject callWebScriptMethod:withArguments:]):
22467
(+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
22468
* bindings/objc/objc_runtime.mm:
22469
(ObjcField::valueFromInstance):
22470
(convertValueToObjcObject):
22471
(ObjcField::setValueToInstance):
22473
2004-05-17 Richard Williamson <rjw@apple.com>
22475
Implemented new API for WebScriptObject.
22477
Fixed <rdar://problem/3657145>: (objc to javascript method calls do not cause updates.)
22478
Fixed <rdar://problem/3654887>: (Update to JSC to refer to new JSObject LiveConnect object) (w/ help from Vicki)
22482
* JavaScriptCore.pbproj/project.pbxproj:
22483
* bindings/c/c_instance.cpp:
22484
(CInstance::invokeMethod):
22485
* bindings/jni/jni_instance.cpp:
22486
(JavaInstance::invokeMethod):
22487
* bindings/jni/jni_jsobject.cpp:
22488
(JSObject::convertValueToJObject):
22489
* bindings/jni/jni_utility.cpp:
22490
(KJS::Bindings::getJNIField):
22491
* bindings/objc/WebScriptObject.mm:
22493
(-[WebScriptObject _initWithObjectImp:KJS::root:Bindings::]):
22494
(-[WebScriptObject KJS::]):
22495
(-[WebScriptObject dealloc]):
22496
(+[WebScriptObject throwException:]):
22498
(-[WebScriptObject callWebScriptMethod:withArguments:]):
22499
(-[WebScriptObject evaluateWebScript:]):
22500
(-[WebScriptObject setValue:forKey:]):
22501
(-[WebScriptObject valueForKey:]):
22502
(-[WebScriptObject stringRepresentation]):
22503
(+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
22504
(+[WebUndefined undefined]):
22505
(-[WebUndefined initWithCoder:]):
22506
(-[WebUndefined encodeWithCoder:]):
22507
(-[WebUndefined copyWithZone:]):
22508
(-[WebUndefined retain]):
22509
(-[WebUndefined release]):
22510
(-[WebUndefined retainCount]):
22511
(-[WebUndefined autorelease]):
22512
(-[WebUndefined dealloc]):
22513
(-[WebUndefined copy]):
22514
(-[WebUndefined replacementObjectForPortCoder:]):
22515
* bindings/objc/WebScriptObjectPrivate.h: Added.
22516
* bindings/objc/objc_class.mm:
22517
(ObjcClass::methodsNamed):
22518
(ObjcClass::fieldNamed):
22519
* bindings/objc/objc_instance.mm:
22520
(ObjcInstance::invokeMethod):
22521
* bindings/objc/objc_jsobject.h:
22522
* bindings/objc/objc_jsobject.mm:
22523
* bindings/objc/objc_runtime.mm:
22524
(ObjcField::valueFromInstance):
22525
* bindings/objc/objc_utility.mm:
22526
(KJS::Bindings::JSMethodNameToObjCMethodName):
22527
(KJS::Bindings::convertValueToObjcValue):
22528
(KJS::Bindings::convertObjcValueToValue):
22529
* bindings/runtime.cpp:
22530
(Instance::setDidExecuteFunction):
22531
(Instance::didExecuteFunction):
22532
(Instance::setValueOfField):
22533
* bindings/runtime.h:
22534
* bindings/testbindings.mm:
22535
(+[MyFirstInterface webScriptNameForSelector:]):
22536
(-[MyFirstInterface callJSObject::]):
22538
2004-05-14 Vicki Murley <vicki@apple.com>
22542
<rdar://problem/3642427>: framework marketing number should be 2.0 for DoubleBarrel release
22544
* JavaScriptCore.pbproj/project.pbxproj: change CFBundleShortVersionString to 2.0
22548
2004-05-13 Richard Williamson <rjw@apple.com>
22555
* bindings/objc/WebScriptObject.h:
22557
2004-05-13 Richard Williamson <rjw@apple.com>
22559
Approved API changes. Currently unimplemented.
22564
* JavaScriptCore.pbproj/project.pbxproj:
22565
* bindings/objc/WebScriptObject.h: Added.
22566
* bindings/objc/WebScriptObject.mm: Added.
22567
(+[WebScriptObject throwException:]):
22568
(-[WebScriptObject callWebScriptMethod:withArguments:]):
22569
(-[WebScriptObject evaluateWebScript:]):
22570
(-[WebScriptObject stringRepresentation]):
22571
(+[WebUndefined undefined]):
22572
(-[WebUndefined initWithCoder:]):
22573
(-[WebUndefined encodeWithCoder:]):
22574
(-[WebUndefined copyWithZone:]):
22576
2004-05-07 Vicki Murley <vicki@apple.com>
22580
Turn off GC since it uses ppc only instructions (which breaks
22583
* kjs/value.h: set USE_CONSERVATIVE_GC to 0
22587
2004-05-07 Maciej Stachowiak <mjs@apple.com>
22591
- add -funroll-loops=16 compiler option for approx .5% speedup on
22592
HTML iBench and .5-1% speedup on JS iBench.
22594
* JavaScriptCore.pbproj/project.pbxproj:
22596
2004-04-25 Maciej Stachowiak <mjs@apple.com>
22600
Enable full conservative GC mode in addition to test mode. When
22601
conservative GC is enabled, we now get an 11% speed improvement on
22602
the iBench. Also fix some spots I missed before.
22604
Specific noteworth changes:
22606
* kjs/collector.cpp:
22607
(KJS::Collector::markStackObjectsConservatively): Check possible
22608
cell pointers for 8-byte aligment and verify they are not 0.
22610
* kjs/protected_values.cpp:
22611
(KJS::ProtectedValues::increaseProtectCount): Move null-tolerance from here...
22612
(KJS::ProtectedValues::decreaseProtectCount): ...and here...
22614
(KJS::gcProtectNullTolerant): ...to here...
22615
(KJS::gcUnprotectNullTolerant): ...and here, because not all callers need the null
22616
tolerance, and doing the check is expensive.
22618
* kjs/protected_values.cpp:
22619
(KJS::ProtectedValues::computeHash): Replace hash function with a much faster one
22620
that is still very good.
22624
(KJS::gcUnprotect):
22625
(KJS::ProtectedValue::ProtectedValue):
22626
(KJS::ProtectedValue::~ProtectedValue):
22627
(KJS::ProtectedValue::operator=):
22628
(KJS::ProtectedObject::ProtectedObject):
22629
(KJS::ProtectedObject::~ProtectedObject):
22630
(KJS::ProtectedObject::operator=):
22631
(KJS::ProtectedReference::ProtectedReference):
22632
(KJS::ProtectedReference::~ProtectedReference):
22633
(KJS::ProtectedReference::operator=):
22634
* kjs/protected_values.cpp:
22635
(KJS::ProtectedValues::getProtectCount):
22636
(KJS::ProtectedValues::increaseProtectCount):
22637
(KJS::ProtectedValues::decreaseProtectCount):
22638
(KJS::ProtectedValues::computeHash):
22639
* bindings/runtime_root.cpp:
22640
(KJS::Bindings::addNativeReference):
22641
(KJS::Bindings::removeNativeReference):
22642
(RootObject::removeAllNativeReferences):
22643
* bindings/runtime_root.h:
22644
(KJS::Bindings::RootObject::~RootObject):
22645
(KJS::Bindings::RootObject::setRootObjectImp):
22646
* kjs/collector.cpp:
22647
(KJS::Collector::allocate):
22648
(KJS::Collector::collect):
22650
* kjs/internal.cpp:
22651
(NumberImp::create):
22652
(InterpreterImp::globalInit):
22653
(InterpreterImp::globalClear):
22654
(InterpreterImp::mark):
22656
(KJS::List::derefValues):
22657
(KJS::List::refValues):
22658
(KJS::List::append):
22660
(KJS::ObjectImp::setInternalValue):
22661
(KJS::ObjectImp::putDirect):
22664
(ValueImp::marked):
22666
(KJS::ValueImp::ValueImp):
22667
(KJS::ValueImp::~ValueImp):
22669
(KJS::Value::Value):
22670
(KJS::Value::~Value):
22671
(KJS::Value::operator=):
22673
2004-04-30 Richard Williamson <rjw@apple.com>
22675
Asking an NSInvocation for it's return value when return type
22676
is void throws an exception. Added check for void return types
22677
to avoid this exception.
22681
* bindings/objc/objc_instance.mm:
22682
(ObjcInstance::invokeMethod):
22684
2004-04-29 Richard Williamson <rjw@apple.com>
22686
Fixed several bad problems with the ObjC bindings. In particular, conversion
22687
to/from JavaScriptObject (soon to be WebScriptObject) was completely broken.
22691
* bindings/objc/objc_jsobject.h:
22692
* bindings/objc/objc_jsobject.mm:
22693
(-[JavaScriptObject initWithObjectImp:KJS::root:Bindings::]):
22694
(-[JavaScriptObject KJS::]):
22695
(+[JavaScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
22696
(-[JavaScriptObject call:arguments:]):
22697
(-[JavaScriptObject evaluate:]):
22698
(-[JavaScriptObject getMember:]):
22699
(-[JavaScriptObject getSlot:]):
22700
* bindings/objc/objc_runtime.mm:
22701
(ObjcField::valueFromInstance):
22702
(ObjcField::setValueToInstance):
22703
* bindings/objc/objc_utility.mm:
22704
(KJS::Bindings::convertValueToObjcValue):
22705
(KJS::Bindings::convertObjcValueToValue):
22706
* bindings/runtime.h:
22707
* bindings/runtime_root.cpp:
22708
(KJS::Bindings::rootForInterpreter):
22709
(KJS::Bindings::addNativeReference):
22710
(KJS::Bindings::removeNativeReference):
22711
* bindings/runtime_root.h:
22712
* bindings/testbindings.mm:
22713
(-[MyFirstInterface logMessage:]):
22714
(-[MyFirstInterface setJSObject:]):
22715
(-[MyFirstInterface callJSObject::]):
22717
2004-04-24 Darin Adler <darin@apple.com>
22721
* kjs/ustring.cpp: (KJS::UString::append): Fix one case that was allocating a buffer
22722
that is 2x too big.
22724
2004-04-23 Maciej Stachowiak <mjs@apple.com>
22728
Implementation of conservative GC, based partly on code from
22729
Darin. It's turned off for now, so it shouldn't have any effect on
22732
* JavaScriptCore.pbproj/project.pbxproj:
22733
* kjs/collector.cpp:
22734
(KJS::Collector::markStackObjectsConservatively):
22735
(KJS::Collector::markProtectedObjects):
22736
(KJS::Collector::collect):
22740
(KJS::gcUnprotect):
22741
* kjs/protected_values.cpp: Added.
22742
(KJS::ProtectedValues::getProtectCount):
22743
(KJS::ProtectedValues::increaseProtectCount):
22744
(KJS::ProtectedValues::insert):
22745
(KJS::ProtectedValues::decreaseProtectCount):
22746
(KJS::ProtectedValues::expand):
22747
(KJS::ProtectedValues::shrink):
22748
(KJS::ProtectedValues::rehash):
22749
(KJS::ProtectedValues::computeHash):
22750
* kjs/protected_values.h: Added.
22752
(ValueImp::useConservativeMark):
22754
(ValueImp::marked):
22760
2004-04-22 Richard Williamson <rjw@apple.com>
22762
Fixed build snafu (re-declaration of NPBool in npruntime.h and
22765
* bindings/npruntime.h:
22767
2004-04-22 Richard Williamson <rjw@apple.com>
22769
Updated plugin binding API to reflect latest revision from
22772
Biggest change is the introduction of NPVariant used to represent
22773
value types. NPVariant replaces the use of NPObject for the
22774
exchange of values between scripting environment and native code.
22778
* JavaScriptCore.pbproj/project.pbxproj:
22779
* bindings/NP_jsobject.cpp:
22780
(identiferFromNPIdentifier):
22786
(NPN_GetPropertyAtIndex):
22787
(NPN_SetPropertyAtIndex):
22788
* bindings/c/c_class.cpp:
22789
(CClass::methodsNamed):
22790
(CClass::fieldNamed):
22791
* bindings/c/c_instance.cpp:
22792
(CInstance::invokeMethod):
22793
(CInstance::defaultValue):
22794
* bindings/c/c_runtime.cpp:
22795
(CField::valueFromInstance):
22796
(CField::setValueToInstance):
22797
* bindings/c/c_utility.cpp:
22798
(convertNPStringToUTF16):
22799
(convertUTF8ToUTF16):
22800
(coerceValueToNPVariantStringType):
22801
(convertValueToNPVariant):
22802
(convertNPVariantToValue):
22803
* bindings/c/c_utility.h:
22804
* bindings/npruntime.cpp:
22805
(NPN_GetIdentifier):
22806
(NPN_GetIdentifiers):
22807
(NPN_UTF8FromIdentifier):
22808
(NPN_VariantIsVoid):
22809
(NPN_VariantIsNull):
22810
(NPN_VariantIsUndefined):
22811
(NPN_VariantIsBool):
22812
(NPN_VariantIsInt32):
22813
(NPN_VariantIsDouble):
22814
(NPN_VariantIsString):
22815
(NPN_VariantIsObject):
22816
(NPN_VariantToBool):
22817
(NPN_VariantToString):
22818
(NPN_VariantToInt32):
22819
(NPN_VariantToDouble):
22820
(NPN_VariantToObject):
22821
(NPN_InitializeVariantAsVoid):
22822
(NPN_InitializeVariantAsNull):
22823
(NPN_InitializeVariantAsUndefined):
22824
(NPN_InitializeVariantWithBool):
22825
(NPN_InitializeVariantWithInt32):
22826
(NPN_InitializeVariantWithDouble):
22827
(NPN_InitializeVariantWithString):
22828
(NPN_InitializeVariantWithStringCopy):
22829
(NPN_InitializeVariantWithObject):
22830
(NPN_InitializeVariantWithVariant):
22831
(NPN_ReleaseVariantValue):
22832
(NPN_CreateObject):
22833
(NPN_RetainObject):
22834
(NPN_ReleaseObject):
22835
(NPN_IsKindOfClass):
22836
(NPN_SetExceptionWithUTF8):
22837
(NPN_SetException):
22838
* bindings/npruntime.h:
22840
(_NPString::_NPVariant::):
22841
* bindings/testbindings.cpp:
22856
2004-04-22 Darin Adler <darin@apple.com>
22858
Reviewed by Maciej.
22860
- fixed <rdar://problem/3627473>: "REGRESSION (125-137): memory trasher in UString::append, causing many different crashes"
22863
(KJS::UString::expandCapacity): Fix sizeof(UChar *) that should be sizeof(UChar).
22864
Was resulting in a buffer 2x the needed size.
22865
(KJS::UString::expandPreCapacity): Ditto.
22866
(KJS::UString::append): Fix malloc that is missing a sizeof(UChar).
22868
2004-04-21 Maciej Stachowiak <mjs@apple.com>
22872
Preliminary change for conservative GC. Create "protected"
22873
subclasses to GC-protect objects when on heap, since we will soon
22874
remove the built-in refcounting of the normal wrapper classes. Use
22877
* JavaScriptCore.pbproj/project.pbxproj:
22880
(KJS::InterpreterImp::globalObject):
22881
* kjs/interpreter.h:
22882
* kjs/property_map.cpp:
22884
* kjs/reference_list.cpp:
22886
2004-04-19 Maciej Stachowiak <mjs@apple.com>
22890
Optimize prepend using the shared substring optimization. Also,
22891
limit the applicability of shared append and shared prepend. If
22892
you overdo it, it does more harm than good, because you create a
22893
bunch of strings that are disqualified from future shared
22894
append/prepend, for not much immediate savings in allocate/copy
22899
(KJS::UString::Rep::create):
22900
(KJS::UString::expandedSize):
22901
(KJS::UString::usedPreCapacity):
22902
(KJS::UString::expandCapacity):
22903
(KJS::UString::expandPreCapacity):
22904
(KJS::UString::UString):
22905
(KJS::UString::append):
22906
(KJS::UString::operator=):
22908
(KJS::UString::Rep::data):
22910
2004-04-16 Maciej Stachowiak <mjs@apple.com>
22911
Reviewed by Richard.
22913
No more need for Completion or Reference to privately inherit from
22914
Value, none of the superclass functionality is used.
22916
* kjs/completion.h:
22921
2004-04-16 Richard Williamson <rjw@apple.com>
22923
Added interpreter lock protection around object creation.
22927
* bindings/runtime.cpp:
22928
(Instance::createRuntimeObject):
22930
2004-04-16 Maciej Stachowiak <mjs@apple.com>
22934
Another JavaScript speed improvement: use the mechanism from
22935
string append optimization to make taking a substring fast, again
22936
sharing the buffer.
22938
A further 22% improvement on the 24fun string speed test.
22942
(KJS::UString::Rep::create):
22943
(KJS::UString::UString):
22944
(KJS::UString::append):
22945
(KJS::UString::operator=):
22946
(KJS::UString::substr):
22948
(KJS::UString::Rep::data):
22950
2004-04-13 Maciej Stachowiak <mjs@apple.com>
22954
- fixed <rdar://problem/3600695>: String manipulation in JavaScript 24fun test is very slow (slow)
22955
- fixed <rdar://problem/3600691>: Table generation test is really slow
22956
- fixed <rdar://problem/3600661>: 24fun date test is really slow
22958
80% speedup on the string test, lesser speedups on the other two.
22960
Two different optimizations here:
22962
1) Avoid large overhead of scanning strings to see if they are all
22963
ASCII before numeric conversion.
22966
(AssignNode::evaluate): Don't convert to integer until we know for
22967
sure the operation will need it. Attempting to convert strings to
22968
numbers is a waste when they are being appended with +=.
22970
2) Avoid huge cost of appending strings.
22972
This is done by allowing multiple strings to share a buffer but
22973
actually use different ranges of it. The first time a string is
22974
appended to, we start leaving at least 10% extra space in the
22975
buffer, so doing N appends to the same string takes O(log N)
22976
mallocs instead of O(N).
22978
* kjs/identifier.cpp:
22979
(KJS::Identifier::equal):
22980
(KJS::Identifier::add):
22983
(KJS::UCharReference::operator=):
22984
(KJS::UCharReference::ref):
22985
(KJS::UString::Rep::create):
22986
(KJS::UString::Rep::destroy):
22987
(KJS::UString::expandedSize):
22988
(KJS::UString::usedCapacity):
22989
(KJS::UString::expandCapacity):
22990
(KJS::UString::UString):
22991
(KJS::UString::null):
22992
(KJS::UString::append):
22993
(KJS::UString::operator=):
22994
(KJS::UString::toStrictUInt32):
22995
(KJS::UString::detach):
22996
(KJS::KJS::operator==):
22998
(KJS::UString::Rep::data):
22999
(KJS::UString::Rep::hash):
23001
2004-04-09 Maciej Stachowiak <mjs@apple.com>
23005
- fix deployment build by avoiding deployment-only warning.
23007
* kjs/scope_chain.cpp:
23008
(KJS::ScopeChain::bottom):
23010
2004-04-09 Maciej Stachowiak <mjs@apple.com>
23014
Changed things so that newly created objects get a prototype based
23015
on the scope chain of the current function, rather than the
23016
interpreter that started execution. This fixes the following bugs:
23018
<rdar://problem/3368523>: ARCH: wrong prototype used to create new objects (hang on lookup.atomica.com)
23019
<rdar://problem/3559173>: ARCH: Cannot scan using a HP Jetdirect product (JS object prototypes bind incorrectly)
23021
* JavaScriptCore.pbproj/project.pbxproj:
23022
* kjs/array_object.cpp:
23023
(CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
23024
(ArrayProtoFuncImp::ArrayProtoFuncImp):
23025
(ArrayProtoFuncImp::call):
23026
(ArrayObjectImp::construct):
23027
* kjs/bool_object.cpp:
23028
(BooleanObjectImp::construct):
23029
* kjs/date_object.cpp:
23030
(DateProtoFuncImp::DateProtoFuncImp):
23031
(DateProtoFuncImp::call):
23032
(DateObjectImp::construct):
23033
* kjs/error_object.cpp:
23034
(ErrorObjectImp::construct):
23035
* kjs/function.cpp:
23036
(FunctionImp::FunctionImp):
23037
(FunctionImp::call):
23038
(DeclaredFunctionImp::construct):
23039
(ArgumentsImp::ArgumentsImp):
23040
(GlobalFuncImp::call):
23041
* kjs/function_object.cpp:
23042
(FunctionProtoFuncImp::call):
23043
(FunctionObjectImp::construct):
23044
* kjs/internal.cpp:
23045
(BooleanImp::toObject):
23046
(StringImp::toObject):
23047
(NumberImp::toObject):
23048
(InterpreterImp::InterpreterImp):
23049
(InterpreterImp::clear):
23050
(InterpreterImp::interpreterWithGlobalObject):
23052
* kjs/interpreter.cpp:
23053
(ExecState::lexicalInterpreter):
23054
* kjs/interpreter.h:
23055
(KJS::ExecState::dynamicInterpreter):
23056
(KJS::ExecState::interpreter):
23057
* kjs/math_object.cpp:
23058
(MathFuncImp::MathFuncImp):
23060
(StatementNode::hitStatement):
23061
(StatementNode::abortStatement):
23062
(RegExpNode::evaluate):
23063
(ElementNode::evaluate):
23064
(ArrayNode::evaluate):
23065
(ObjectLiteralNode::evaluate):
23066
(PropertyValueNode::evaluate):
23067
(FunctionCallNode::evaluate):
23068
(FuncDeclNode::processFuncDecl):
23069
(FuncExprNode::evaluate):
23070
* kjs/number_object.cpp:
23071
(NumberObjectImp::construct):
23073
(KJS::ObjectImp::defaultValue):
23074
(KJS::Error::create):
23075
* kjs/object_object.cpp:
23076
(ObjectObjectImp::construct):
23077
* kjs/reference.cpp:
23078
(Reference::putValue):
23079
* kjs/regexp_object.cpp:
23080
(RegExpProtoFuncImp::call):
23081
(RegExpObjectImp::arrayOfMatches):
23082
(RegExpObjectImp::construct):
23083
* kjs/scope_chain.cpp:
23084
(KJS::ScopeChain::bottom):
23085
* kjs/scope_chain.h:
23086
* kjs/string_object.cpp:
23087
(StringProtoFuncImp::StringProtoFuncImp):
23088
(StringProtoFuncImp::call):
23089
(StringObjectImp::construct):
23095
2004-03-31 Richard Williamson <rjw@apple.com>
23097
Tedious renames based on feedback from plugin-futures list.
23098
NP_ functions are renamed with NPN_ prefix.
23099
Types prefix renamed from NP_ to NP.
23100
NPN_CreateStringWithUTF8 and NPN_SetExceptionWithUTF8 now take a length, optionally -1 if string is null terminated.
23102
No review because this was just a renaming patch.
23104
* bindings/NP_jsobject.cpp:
23107
(identiferFromNPIdentifier):
23112
(NPN_RemoveProperty):
23114
(NPN_GetPropertyAtIndex):
23115
(NPN_SetPropertyAtIndex):
23116
* bindings/NP_jsobject.h:
23117
* bindings/c/c_class.cpp:
23118
(CClass::_commonInit):
23119
(CClass::classForIsA):
23121
(CClass::methodsNamed):
23122
(CClass::fieldNamed):
23123
* bindings/c/c_class.h:
23124
* bindings/c/c_instance.cpp:
23125
(CInstance::CInstance):
23126
(CInstance::~CInstance):
23127
(CInstance::operator=):
23128
(CInstance::invokeMethod):
23129
(CInstance::defaultValue):
23130
* bindings/c/c_instance.h:
23131
(KJS::Bindings::CInstance::getObject):
23132
* bindings/c/c_runtime.cpp:
23133
(CField::valueFromInstance):
23134
(CField::setValueToInstance):
23135
* bindings/c/c_runtime.h:
23136
(KJS::Bindings::CField::CField):
23137
(KJS::Bindings::CField::name):
23138
(KJS::Bindings::CMethod::CMethod):
23139
(KJS::Bindings::CMethod::name):
23140
* bindings/c/c_utility.cpp:
23141
(coerceValueToNPString):
23142
(convertValueToNPValueType):
23143
(convertNPValueTypeToValue):
23144
* bindings/c/c_utility.h:
23145
* bindings/npruntime.cpp:
23146
(NPN_IdentifierFromUTF8):
23147
(NPN_IsValidIdentifier):
23148
(NPN_GetIdentifiers):
23149
(NPN_UTF8FromIdentifier):
23150
(NPN_CreateObject):
23151
(NPN_RetainObject):
23152
(NPN_ReleaseObject):
23153
(NPN_IsKindOfClass):
23154
(NPN_SetExceptionWithUTF8):
23155
(NPN_SetException):
23157
(NPN_CreateNumberWithInt):
23158
(NPN_CreateNumberWithFloat):
23159
(NPN_CreateNumberWithDouble):
23160
(NPN_IntFromNumber):
23161
(NPN_FloatFromNumber):
23162
(NPN_DoubleFromNumber):
23164
(NPN_CreateStringWithUTF8):
23165
(NPN_CreateStringWithUTF16):
23166
(NPN_DeallocateUTF8):
23167
(NPN_UTF8FromString):
23168
(NPN_UTF16FromString):
23169
(NPN_StringLength):
23171
(NPN_CreateBoolean):
23172
(NPN_BoolFromBoolean):
23175
(undefinedAllocate):
23176
(NPN_GetUndefined):
23180
(NPN_CreateArrayV):
23181
(NPN_ObjectAtIndex):
23182
* bindings/npruntime.h:
23183
* bindings/runtime.cpp:
23184
(Instance::createBindingForLanguageInstance):
23185
* bindings/testbindings.cpp:
23186
(initializeIdentifiers):
23206
2004-03-31 Richard Williamson <rjw@apple.com>
23208
Changed references to NP_runtime.h to npruntime.h
23210
* JavaScriptCore.pbproj/project.pbxproj:
23211
* bindings/NP_jsobject.h:
23212
* bindings/c/c_class.h:
23213
* bindings/c/c_instance.h:
23214
* bindings/c/c_runtime.h:
23215
* bindings/c/c_utility.h:
23216
* bindings/npruntime.cpp:
23218
2004-03-31 Richard Williamson <rjw@apple.com>
23220
Renamed NP_runtime.h to npruntime.h to match Netscape SDK.
23222
* JavaScriptCore.pbproj/project.pbxproj:
23223
* bindings/NP_jsobject.h:
23224
* bindings/npruntime.cpp:
23228
2004-03-23 Richard Williamson <rjw@apple.com>
23230
Added implementation of KJS::Value <-> NP_Object conversion functions.
23231
Augmented test program for 'C' bindings.
23232
Added asserts and parameter checking to all public API.
23236
* JavaScriptCore.pbproj/project.pbxproj:
23237
* bindings/NP_jsobject.cpp:
23239
* bindings/NP_jsobject.h: Added.
23240
* bindings/NP_runtime.cpp:
23241
(NP_IdentifierFromUTF8):
23242
(NP_IsValidIdentifier):
23243
(NP_GetIdentifiers):
23246
(NP_ReleaseObject):
23247
(NP_IsKindOfClass):
23248
(NP_SetExceptionWithUTF8):
23250
(NP_IntFromNumber):
23251
(NP_FloatFromNumber):
23252
(NP_DoubleFromNumber):
23253
(NP_CreateStringWithUTF8):
23254
(NP_CreateStringWithUTF16):
23255
(NP_DeallocateUTF8):
23256
(NP_UTF8FromString):
23257
(NP_UTF16FromString):
23259
(NP_BoolFromBoolean):
23260
* bindings/NP_runtime.h:
23261
* bindings/c/c_instance.cpp:
23262
(CInstance::invokeMethod):
23263
* bindings/c/c_utility.cpp:
23264
(coerceValueToNPString):
23265
(convertValueToNPValueType):
23266
(convertNPValueTypeToValue):
23267
* bindings/c/c_utility.h:
23268
* bindings/test.js:
23269
* bindings/testC.js: Added.
23270
* bindings/testbindings.cpp:
23280
(myInterfaceInvoke):
23281
(myInterfaceAllocate):
23285
2004-03-19 Darin Adler <darin@apple.com>
23289
- fixed problem with methods like setUTCHour
23291
* kjs/date_object.cpp: (DateProtoFuncImp::call): Fix conversion back to time_t to use the appropriate
23292
GMT vs. local time function based on the utc flag.
23294
2004-03-17 Richard Williamson <rjw@apple.com>
23296
Added a context parameter to result callbacks use by JavaScriptObject functions. This was a change requested by Eric Carlson on the QT plugin team.
23300
* bindings/NP_jsobject.cpp:
23305
(NP_GetPropertyAtIndex):
23306
* bindings/NP_runtime.h:
23308
2004-03-16 Richard Williamson <rjw@apple.com>
23310
Fixed 3590169. Regression (crash) caused by the switch to MethodLists. Crash when attempting to invoke a method from JavaScript to Java that is not implemented.
23314
* bindings/jni/jni_class.cpp:
23315
(JavaClass::methodsNamed):
23317
2004-03-15 Richard Williamson <rjw@apple.com>
23319
Fixed 3570854. Don't attempt to convert Null to strings. We
23320
were incorrectly converting to "Null".
23322
Actually fixed by Scott Kovatch.
23324
Reviewed by Richard.
23326
* bindings/jni/jni_utility.cpp:
23327
(KJS::Bindings::convertValueToJValue):
23331
2004-03-11 Richard Williamson <rjw@apple.com>
23333
Stitched together the NP stuff to our language independent
23334
JavaScript binding stuff. Very close to being done.
23336
Added program to test C bindings (and NP stuff). Just tests
23337
properties. Will add methods and JavaScript access, etc.
23339
Updated Makefile.am to account for new bindings/c directory.
23341
Change NP_UTF8 from "const char *" to "char" to allow for
23342
declarations like "const NP_UTF8 *" and "NP_UTF8 *". Ditto
23345
Added NP_IsValidIdentifier().
23349
* JavaScriptCore.pbproj/project.pbxproj:
23351
* bindings/NP_jsobject.cpp:
23352
(identiferFromNPIdentifier):
23354
* bindings/NP_runtime.cpp:
23355
(NP_IdentifierFromUTF8):
23356
(NP_IsValidIdentifier):
23357
(NP_GetIdentifiers):
23358
(NP_UTF8FromIdentifier):
23359
(NP_SetExceptionWithUTF8):
23361
(NP_CreateStringWithUTF8):
23362
(NP_CreateStringWithUTF16):
23363
(NP_UTF8FromString):
23364
(NP_UTF16FromString):
23365
* bindings/NP_runtime.h:
23366
* bindings/c/c_class.cpp: Added.
23367
(CClass::_commonDelete):
23368
(CClass::_commonCopy):
23369
(CClass::_commonInit):
23370
(_createClassesByIsAIfNecessary):
23371
(CClass::classForIsA):
23374
(CClass::methodsNamed):
23375
(CClass::fieldNamed):
23376
* bindings/c/c_class.h: Added.
23377
(KJS::Bindings::CClass::~CClass):
23378
(KJS::Bindings::CClass::CClass):
23379
(KJS::Bindings::CClass::operator=):
23380
(KJS::Bindings::CClass::constructorAt):
23381
(KJS::Bindings::CClass::numConstructors):
23382
* bindings/c/c_instance.cpp: Added.
23383
(CInstance::CInstance):
23384
(CInstance::~CInstance):
23385
(CInstance::operator=):
23386
(CInstance::getClass):
23387
(CInstance::begin):
23389
(CInstance::invokeMethod):
23390
(CInstance::defaultValue):
23391
(CInstance::stringValue):
23392
(CInstance::numberValue):
23393
(CInstance::booleanValue):
23394
(CInstance::valueOf):
23395
* bindings/c/c_instance.h: Added.
23396
(KJS::Bindings::CInstance::getObject):
23397
* bindings/c/c_runtime.cpp: Added.
23398
(CField::valueFromInstance):
23399
(CField::setValueToInstance):
23400
* bindings/c/c_runtime.h: Added.
23401
(KJS::Bindings::CField::CField):
23402
(KJS::Bindings::CField::name):
23403
(KJS::Bindings::CField::type):
23404
(KJS::Bindings::CMethod::CMethod):
23405
(KJS::Bindings::CMethod::name):
23406
(KJS::Bindings::CMethod::numParameters):
23407
* bindings/c/c_utility.cpp: Added.
23408
(coerceValueToNPValueType):
23409
(convertValueToNPValueType):
23410
(convertNPValueTypeToValue):
23411
* bindings/c/c_utility.h: Added.
23412
* bindings/make_testbindings:
23413
* bindings/runtime.cpp:
23414
(Instance::createBindingForLanguageInstance):
23415
* bindings/runtime.h:
23416
(KJS::Bindings::Instance::):
23417
* bindings/testbindings.cpp: Added.
23418
(initializeIdentifiers):
23419
(myInterfaceHasProperty):
23420
(myInterfaceHasMethod):
23421
(myInterfaceGetProperty):
23422
(myInterfaceSetProperty):
23423
(myInterfaceInvoke):
23424
(myInterfaceAllocate):
23425
(myInterfaceInvalidate):
23426
(myInterfaceDeallocate):
23427
(GlobalImp::className):
23428
(readJavaScriptFromFile):
23431
2004-03-10 Richard Williamson <rjw@apple.com>
23433
Made changes to support new asychronous approach to calls from
23434
plugin to JavaScript
23438
* bindings/NP_jsobject.cpp:
23443
(NP_GetPropertyAtIndex):
23444
* bindings/NP_runtime.h:
23445
* bindings/make_testbindings:
23446
* bindings/runtime.cpp:
23447
(Instance::createBindingForLanguageInstance):
23449
2004-03-10 Richard Williamson <rjw@apple.com>
23451
Updated header to include proposed changes from
23452
plugin-futures list. Calls from plugin to JavaScript
23453
are now asynchronous.
23457
* bindings/NP_runtime.h:
23461
2004-03-04 Richard Williamson <rjw@apple.com>
23463
Implementation of NP_JavaScriptObject. This is the 'C' class
23464
that wraps a JavaScript object.
23468
* JavaScriptCore.pbproj/project.pbxproj:
23469
* bindings/NP_jsobject.cpp: Added.
23470
(coerceValueToNPValueType):
23471
(convertValueToNPValueType):
23472
(convertNPValueTypeToValue):
23476
(identiferFromNPIdentifier):
23481
(NP_RemoveProperty):
23483
(NP_GetPropertyAtIndex):
23484
(NP_SetPropertyAtIndex):
23485
* bindings/NP_runtime.cpp:
23486
(NP_ObjectAtIndex):
23487
* bindings/NP_runtime.h:
23488
* bindings/runtime_object.h:
23490
2004-03-04 Richard Williamson <rjw@apple.com>
23492
Added NP_Array implementation.
23494
Changed NP_Boolean to just depend on two static instances, no
23495
space is required for values.
23499
* bindings/NP_runtime.cpp:
23500
(NP_CreateBoolean):
23501
(NP_BoolFromBoolean):
23506
(NP_ObjectAtIndex):
23507
* bindings/NP_runtime.h:
23509
2004-03-03 Darin Adler <darin@apple.com>
23513
* English.lproj/InfoPlist.strings: Removed. No need to localize the version and
23514
copyright string, and that's all that was in here.
23515
* JavaScriptCore.pbproj/project.pbxproj: Removed InfoPlist.strings from build.
23517
2004-03-03 Richard Williamson <rjw@apple.com>
23519
More 'C' binding implementation. Fleshed out all the
23520
'primitive' data types.
23524
* bindings/NP_runtime.cpp:
23525
(NP_ReleaseObject):
23528
(stringDeallocate):
23529
(NP_CreateStringWithUTF8):
23530
(NP_CreateStringWithUTF16):
23531
(NP_UTF8FromString):
23532
(NP_UTF16FromString):
23535
(booleanDeallocate):
23536
(NP_CreateBoolean):
23537
(NP_BoolFromBoolean):
23541
(undefinedAllocate):
23542
(undefinedDeallocate):
23544
* bindings/NP_runtime.h:
23546
2004-03-03 Richard Williamson <rjw@apple.com>
23548
More 'C' binding implementation.
23552
* bindings/NP_runtime.cpp:
23555
(getIdentifierDictionary):
23556
(NP_IdentifierFromUTF8):
23557
(NP_UTF8FromIdentifier):
23559
(NP_ReleaseObject):
23560
(NP_IsKindOfClass):
23562
(NP_CreateNumberWithInt):
23563
(NP_CreateNumberWithFloat):
23564
(NP_CreateNumberWithDouble):
23565
(NP_IntFromNumber):
23566
(NP_FloatFromNumber):
23567
(NP_DoubleFromNumber):
23568
* bindings/NP_runtime.h:
23570
2004-03-02 Richard Williamson <rjw@apple.com>
23572
Removed retain/release from NP_Class. Classes will not be allowed to implement their
23573
own customer retain/release scheme.
23577
* bindings/NP_runtime.cpp:
23579
(NP_ReleaseObject):
23580
* bindings/NP_runtime.h:
23582
2004-03-02 Richard Williamson <rjw@apple.com>
23584
C binding API. Partial implementation.
23586
Completed ObjectiveC bindings (not based on the C API). These will re-implemented over the C binding API, but I wanted to get this code in the tree.
23588
Factored root object reference counting scheme. It is now useful independent
23593
* JavaScriptCore.pbproj/project.pbxproj:
23594
* bindings/NP_runtime.cpp: Added.
23595
(NP_IdentifierFromUTF8):
23596
(NP_GetIdentifiers):
23597
(NP_UTF8FromIdentifier):
23600
(NP_ReleaseObject):
23601
(NP_IsKindOfClass):
23607
(NP_RemoveProperty):
23609
(NP_GetPropertyAtIndex):
23610
(NP_SetPropertyAtIndex):
23611
(NP_CreateNumberWithInt):
23612
(NP_CreateNumberWithFloat):
23613
(NP_CreateNumberWithDouble):
23614
(NP_IntFromNumber):
23615
(NP_FloatFromNumber):
23616
(NP_DoubleFromNumber):
23617
(NP_CreateStringWithUTF8):
23618
(NP_CreateStringWithUTF16):
23619
(NP_UTF8FromString):
23620
(NP_UTF16FromString):
23621
(NP_CreateBoolean):
23622
(NP_BoolFromBoolean):
23627
(NP_ObjectAtIndex):
23628
* bindings/NP_runtime.h: Added.
23629
* bindings/jni/jni_jsobject.cpp:
23630
(JSObject::invoke):
23631
(JSObject::finalize):
23632
(JSObject::createNative):
23633
(JSObject::convertValueToJObject):
23634
* bindings/jni/jni_jsobject.h:
23635
* bindings/objc/objc_jsobject.h:
23636
* bindings/objc/objc_jsobject.mm:
23638
(windowJavaScriptObject):
23639
(-[JavaScriptObject initWithObjectImp:KJS::root:Bindings::]):
23640
(-[JavaScriptObject dealloc]):
23641
(-[JavaScriptObject _convertValueToObjcValue:KJS::]):
23642
(-[JavaScriptObject call:arguments:]):
23643
(-[JavaScriptObject evaluate:]):
23644
(-[JavaScriptObject getMember:]):
23645
(-[JavaScriptObject setMember:value:]):
23646
(-[JavaScriptObject removeMember:]):
23647
(-[JavaScriptObject toString]):
23648
(-[JavaScriptObject getSlot:]):
23649
(-[JavaScriptObject setSlot:value:]):
23650
* bindings/objc/objc_utility.h:
23651
* bindings/objc/objc_utility.mm:
23652
(KJS::Bindings::convertValueToObjcValue):
23653
* bindings/runtime_root.cpp: Added.
23654
(getReferencesByRootDictionary):
23655
(getReferencesDictionary):
23656
(KJS::Bindings::findReferenceDictionary):
23657
(KJS::Bindings::rootForImp):
23658
(KJS::Bindings::addNativeReference):
23659
(KJS::Bindings::removeNativeReference):
23660
(completedJavaScriptAccess):
23661
(initializeJavaScriptAccessLock):
23662
(lockJavaScriptAccess):
23663
(unlockJavaScriptAccess):
23664
(RootObject::dispatchToJavaScriptThread):
23665
(performJavaScriptAccess):
23666
(RootObject::setFindRootObjectForNativeHandleFunction):
23667
(RootObject::removeAllNativeReferences):
23668
* bindings/runtime_root.h: Added.
23669
(KJS::Bindings::RootObject::RootObject):
23670
(KJS::Bindings::RootObject::~RootObject):
23671
(KJS::Bindings::RootObject::setRootObjectImp):
23672
(KJS::Bindings::RootObject::rootObjectImp):
23673
(KJS::Bindings::RootObject::setInterpreter):
23674
(KJS::Bindings::RootObject::interpreter):
23675
(KJS::Bindings::RootObject::findRootObjectForNativeHandleFunction):
23676
(KJS::Bindings::RootObject::runLoop):
23677
(KJS::Bindings::RootObject::performJavaScriptSource):
23683
2004-02-18 Richard Williamson <rjw@apple.com>
23685
Added NSNumber/Number conversion.
23687
Removed some unnecessary KJS:: namespace specifiers.
23691
* bindings/objc/objc_utility.mm:
23692
(KJS::Bindings::convertValueToObjcValue):
23693
(KJS::Bindings::convertObjcValueToValue):
23694
* bindings/runtime_array.h:
23696
2004-02-18 Richard Williamson <rjw@apple.com>
23698
Added support for export NSArrays.
23700
Updated valueAt() to take an ExecState so we can throw
23703
Implemented excludeSelectorFromJavaScript: in ObjcClass. This allows
23704
ObjectiveC classes to control the visibility of their methods in
23709
* bindings/jni/jni_runtime.cpp:
23710
(JavaField::valueFromInstance):
23711
(JavaArray::valueAt):
23712
* bindings/jni/jni_runtime.h:
23713
* bindings/objc/objc_class.mm:
23714
(ObjcClass::methodsNamed):
23715
* bindings/objc/objc_runtime.h:
23716
(KJS::Bindings::ObjcArray::getObjcArray):
23717
* bindings/objc/objc_runtime.mm:
23718
(ObjcField::valueFromInstance):
23719
(ObjcField::setValueToInstance):
23720
(ObjcArray::ObjcArray):
23721
(ObjcArray::~ObjcArray):
23722
(ObjcArray::operator=):
23723
(ObjcArray::setValueAt):
23724
(ObjcArray::valueAt):
23725
(ObjcArray::getLength):
23726
* bindings/objc/objc_utility.mm:
23727
(KJS::Bindings::convertValueToObjcValue):
23728
(KJS::Bindings::convertObjcValueToValue):
23729
* bindings/runtime.cpp:
23730
(Instance::getValueOfField):
23731
* bindings/runtime.h:
23732
* bindings/runtime_array.cpp:
23733
(RuntimeArrayImp::get):
23734
* bindings/runtime_object.cpp:
23735
(RuntimeObjectImp::get):
23737
2004-02-17 Richard Williamson <rjw@apple.com>
23739
Added String <-> NSString conversion.
23740
Added tests of String <-> NSString conversion to test program.
23744
* bindings/objc/objc_utility.mm:
23745
(KJS::Bindings::convertValueToObjcValue):
23746
(KJS::Bindings::convertObjcValueToValue):
23747
* bindings/test.js:
23748
* bindings/testbindings.mm:
23749
(-[MyFirstInterface getString]):
23751
2004-02-15 Darin Adler <darin@apple.com>
23755
* JavaScriptCore.pbproj/project.pbxproj: Tweak build styles a bit, fixing OptimizedWithSymbols,
23756
and removing redundant settings of things that match defaults in other build styles.
23758
2004-02-13 Richard Williamson <rjw@apple.com>
23760
Work towards the JavaScript ObjC bindings. The bindings now work for
23761
simple scalar types. testbindings.mm is an illustration of how the
23766
* JavaScriptCore.pbproj/project.pbxproj:
23768
* bindings/jni/jni_class.cpp:
23769
(JavaClass::methodsNamed):
23770
* bindings/jni/jni_class.h:
23771
* bindings/jni/jni_instance.cpp:
23772
(JavaInstance::invokeMethod):
23773
* bindings/jni/jni_instance.h:
23774
* bindings/jni/jni_runtime.h:
23775
(KJS::Bindings::JavaMethod::returnType):
23776
* bindings/make_testbindings: Added.
23777
* bindings/objc/objc_class.h: Added.
23778
(KJS::Bindings::ObjcClass::~ObjcClass):
23779
(KJS::Bindings::ObjcClass::ObjcClass):
23780
(KJS::Bindings::ObjcClass::operator=):
23781
(KJS::Bindings::ObjcClass::constructorAt):
23782
(KJS::Bindings::ObjcClass::numConstructors):
23783
* bindings/objc/objc_class.mm: Added.
23784
(ObjcClass::_commonDelete):
23785
(ObjcClass::_commonCopy):
23786
(ObjcClass::_commonInit):
23787
(_createClassesByIsAIfNecessary):
23788
(ObjcClass::classForIsA):
23789
(ObjcClass::ObjcClass):
23791
(ObjcClass::methodsNamed):
23792
(ObjcClass::fieldNamed):
23793
* bindings/objc/objc_header.h: Added.
23794
* bindings/objc/objc_instance.h: Added.
23795
(KJS::Bindings::ObjcInstance::getObject):
23796
* bindings/objc/objc_instance.mm: Added.
23797
(ObjcInstance::ObjcInstance):
23798
(ObjcInstance::~ObjcInstance):
23799
(ObjcInstance::operator=):
23800
(ObjcInstance::begin):
23801
(ObjcInstance::end):
23802
(ObjcInstance::getClass):
23803
(ObjcInstance::invokeMethod):
23804
(ObjcInstance::defaultValue):
23805
(ObjcInstance::stringValue):
23806
(ObjcInstance::numberValue):
23807
(ObjcInstance::booleanValue):
23808
(ObjcInstance::valueOf):
23809
* bindings/objc/objc_jsobject.h: Added.
23810
* bindings/objc/objc_jsobject.mm: Added.
23811
* bindings/objc/objc_runtime.h:
23812
(KJS::Bindings::ObjcField::~ObjcField):
23813
(KJS::Bindings::ObjcField::ObjcField):
23814
(KJS::Bindings::ObjcField::operator=):
23815
(KJS::Bindings::ObjcMethod::ObjcMethod):
23816
(KJS::Bindings::ObjcMethod::~ObjcMethod):
23817
(KJS::Bindings::ObjcMethod::operator=):
23818
* bindings/objc/objc_runtime.mm: Added.
23819
(ObjcMethod::ObjcMethod):
23820
(ObjcMethod::name):
23821
(ObjcMethod::numParameters):
23822
(ObjcMethod::getMethodSignature):
23823
(ObjcField::ObjcField):
23826
(ObjcField::valueFromInstance):
23827
(ObjcField::setValueToInstance):
23828
* bindings/objc/objc_utility.h: Added.
23830
* bindings/objc/objc_utility.mm: Added.
23831
(KJS::Bindings::JSMethodNameToObjCMethodName):
23832
(KJS::Bindings::convertValueToObjcValue):
23833
(KJS::Bindings::convertObjcValueToValue):
23834
(KJS::Bindings::objcValueTypeForType):
23835
* bindings/runtime.cpp:
23836
(MethodList::MethodList):
23837
(MethodList::operator=):
23838
(Instance::setValueOfField):
23839
(Instance::createBindingForLanguageInstance):
23840
(Instance::createRuntimeObject):
23841
* bindings/runtime.h:
23842
* bindings/runtime_method.cpp:
23843
(RuntimeMethodImp::RuntimeMethodImp):
23844
(RuntimeMethodImp::get):
23845
(RuntimeMethodImp::call):
23846
* bindings/runtime_method.h:
23847
* bindings/runtime_object.cpp:
23848
(RuntimeObjectImp::get):
23849
(RuntimeObjectImp::hasProperty):
23850
* bindings/test.js: Added.
23851
* bindings/testbindings.mm: Added.
23852
(-[MySecondInterface init]):
23853
(-[MyFirstInterface init]):
23854
(-[MyFirstInterface dealloc]):
23855
(+[MyFirstInterface JavaScriptNameForSelector:]):
23856
(-[MyFirstInterface getInt]):
23857
(-[MyFirstInterface setInt:]):
23858
(-[MyFirstInterface getMySecondInterface]):
23859
(-[MyFirstInterface logMessage:]):
23860
(GlobalImp::className):
23861
(readJavaScriptFromFile):
23866
2004-02-08 Darin Adler <darin@apple.com>
23870
- fixed things seen in the profile, for a total speedup of 4% on cvs-base (including changes across all projects)
23872
* JavaScriptCorePrefix.h: Add a workaround for a bug in our system headers that prevents the <ctype.h>
23873
macros from working right in C++ code that uses the <cctype> header.
23876
(KJS::inlineUTF8SequenceLengthNonASCII): Added.
23877
(KJS::UTF8SequenceLengthNonASCII): Added.
23878
(KJS::inlineUTF8SequenceLength): Added.
23879
(KJS::UTF8SequenceLength): Calls inlineUTF8SequenceLengthNonASCII now.
23880
(KJS::decodeUTF8Sequence): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
23881
(KJS::createSortedOffsetsArray): Add special case for 1, 2, and 3 offsets, so we don't do qsort for those.
23882
(KJS::convertUTF16OffsetsToUTF8Offsets): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
23883
(KJS::convertUTF8OffsetsToUTF16Offsets): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
23885
- fixed the test program so it won't hit the interpreter lock assertion
23887
* kjs/testkjs.cpp: (main): Just lock around the whole thing, since the test is singly threaded.
23891
2004-02-06 Richard Williamson <rjw@apple.com>
23893
Fixed 3550242 and 3546977. The first diff prevents an assert from firing. The second diff prevents a JavaScript exception, caused be an invalid conversion, which has a downstream consequence of preventing a valid conversion.
23897
* bindings/jni/jni_jsobject.cpp:
23898
(JSObject::toString):
23899
* bindings/jni/jni_utility.cpp:
23900
(KJS::Bindings::convertValueToJValue):
23902
2004-02-02 Darin Adler <darin@apple.com>
23904
Reviewed by Maciej.
23906
- fixed <rdar://problem/3546613>: array of negative size leads to crash (test page at oscar.the-rileys.net)
23908
* kjs/array_object.cpp:
23909
(ArrayInstanceImp::ArrayInstanceImp): If the length is greater than 10,000, don't allocate an array until
23910
we start putting values in. This prevents new Array(2147483647) from causing trouble.
23911
(ArrayObjectImp::construct): Check number as described in specification, and raise a range error if the
23912
number is out of range. This prevents new Array(-1) from causing trouble.
23914
- fixed <rdar://problem/3545756>: Math.round screws up on numbers bigger than 2^31 (incorrect results on HP-35 calculator page)
23916
* kjs/math_object.cpp: (MathFuncImp::call): Change implementation to be much simpler and not involve
23917
casting to int. Results now match those in other browsers.
23919
2004-02-02 Darin Adler <darin@apple.com>
23921
Reviewed by Maciej.
23923
- fixed <rdar://problem/3519285>: integer operations on large negative numbers yield bad results (discovered with "HTMLCrypt")
23924
- fixed other related overflow issues
23926
* kjs/value.h: Changed return types of toInteger, toInt32, toUInt32, and toUInt16.
23928
(ValueImp::toInteger): Change to return a double, since this operation, from the ECMA specification,
23929
must not restrict values to the range of a particular integer type.
23930
(ValueImp::toInt32): Used a sized integer type for the result of this function, and also added
23931
proper handling for negative results from fmod.
23932
(ValueImp::toUInt32): Ditto.
23933
(ValueImp::toUInt16): Ditto.
23934
(ValueImp::dispatchToUInt32): Changed result type from unsigned to uint32_t.
23936
* kjs/array_object.cpp: (ArrayProtoFuncImp::call): Use a double instead of an int to handle
23937
out-of-integer-range values better in the slice function.
23938
* kjs/internal.cpp: (KJS::roundValue): Streamline the function, handling NAN and infinity properly.
23939
* kjs/number_object.cpp: (NumberProtoFuncImp::call): Use a double instead of an int to handle
23940
out-of-integer-range values better in the toString function.
23941
* kjs/string_object.cpp: (StringProtoFuncImp::call): Use a double instead of an int to handle
23942
out-of-integer-range values better in the charAt, charCodeAt, indexOf, lastIndexOf, slice,
23943
and substr functions.
23947
2004-01-30 Richard Williamson <rjw@apple.com>
23949
Fixed 3542044. Create KJS::String using UString constructor instead of passing UTF8 string to char* constructor.
23953
* bindings/jni/jni_instance.cpp:
23954
(JavaInstance::stringValue):
23956
2004-01-26 Darin Adler <darin@apple.com>
23958
* Makefile.am: Switch from pbxbuild to xcodebuild.
23960
2004-01-22 Richard Williamson <rjw@apple.com>
23962
Added stubs for ObjC language binding to JavaScript.
23964
* JavaScriptCore.pbproj/project.pbxproj:
23965
* bindings/jni/jni_runtime.h:
23966
* bindings/objc/objc_runtime.h: Added.
23967
(KJS::Bindings::ObjcParameter::ObjcParameter):
23968
(KJS::Bindings::ObjcParameter::~ObjcParameter):
23969
(KJS::Bindings::ObjcParameter::operator=):
23970
(KJS::Bindings::ObjcParameter::type):
23971
(KJS::Bindings::ObjcConstructor::ObjcConstructor):
23972
(KJS::Bindings::ObjcConstructor::~ObjcConstructor):
23973
(KJS::Bindings::ObjcConstructor::_commonCopy):
23974
(KJS::Bindings::ObjcConstructor::operator=):
23975
(KJS::Bindings::ObjcConstructor::value):
23976
(KJS::Bindings::ObjcConstructor::parameterAt):
23977
(KJS::Bindings::ObjcConstructor::numParameters):
23978
(KJS::Bindings::ObjcField::ObjcField):
23979
(KJS::Bindings::ObjcField::~ObjcField):
23980
* bindings/runtime.h:
23982
2004-01-22 Richard Williamson <rjw@apple.com>
23984
Simplified JavaString by using UString as backing store. This
23985
revealed a bug in CString's assignment operator which I fixed.
23987
Removed some dead code.
23991
* bindings/jni/jni_runtime.h:
23992
(KJS::Bindings::JavaString::JavaString):
23993
(KJS::Bindings::JavaString::_commonInit):
23994
(KJS::Bindings::JavaString::UTF8String):
23995
(KJS::Bindings::JavaString::uchars):
23996
(KJS::Bindings::JavaString::length):
23997
(KJS::Bindings::JavaString::ustring):
23998
* bindings/runtime_object.cpp:
23999
(RuntimeObjectImp::RuntimeObjectImp):
24000
* bindings/runtime_object.h:
24002
(KJS::CString::CString):
24003
(KJS::CString::operator=):
24009
2004-01-16 Richard Williamson <rjw@apple.com>
24011
Fixed 3525853. We weren't handling mapping to overloaded Java
24012
methods very well. Even though this is undefined the other
24013
browsers support it. Also fixed a bug with returning arrays
24014
from Java functions.
24018
* bindings/jni/jni_class.cpp:
24019
(JavaClass::_commonInit):
24020
(JavaClass::methodsNamed):
24021
* bindings/jni/jni_class.h:
24022
* bindings/jni/jni_instance.cpp:
24023
(JavaInstance::invokeMethod):
24024
* bindings/jni/jni_instance.h:
24025
* bindings/jni/jni_runtime.cpp:
24026
(JavaArray::convertJObjectToArray):
24027
(JavaField::valueFromInstance):
24028
(JavaMethod::signature):
24029
(JavaArray::valueAt):
24030
* bindings/jni/jni_runtime.h:
24031
* bindings/jni_jsobject.cpp:
24033
(JSObject::convertJObjectToValue):
24034
* bindings/runtime.cpp:
24035
(MethodList::addMethod):
24036
(MethodList::length):
24037
(MethodList::methodAt):
24038
(MethodList::~MethodList):
24039
* bindings/runtime.h:
24040
(KJS::Bindings::MethodList::MethodList):
24041
* bindings/runtime_method.cpp:
24042
(RuntimeMethodImp::RuntimeMethodImp):
24043
(RuntimeMethodImp::get):
24044
(RuntimeMethodImp::call):
24045
* bindings/runtime_method.h:
24046
* bindings/runtime_object.cpp:
24047
(RuntimeObjectImp::get):
24048
(RuntimeObjectImp::hasProperty):
24050
2004-01-16 Richard Williamson <rjw@apple.com>
24052
Fixed 3531229. Another place that needs the Push/PopLocalFrame
24053
protection implemented for 3530401.
24057
* bindings/runtime_method.cpp:
24058
(RuntimeMethodImp::call):
24060
2004-01-15 Richard Williamson <rjw@apple.com>
24062
Fixed 3530401. JNI doesn't cleanup local refs created on the
24063
main thread. IMO this is a bad bug in our JMI implementation.
24065
To work-around the problem I explicitly delete all local refs.
24066
Further, I've added Push/PopLocalFrame calls to catch any refs
24067
that I may have missed. This will guarantee that we don't leak
24068
any Java references.
24072
* bindings/jni/jni_class.cpp:
24073
(JavaClass::_commonInit):
24074
(JavaClass::JavaClass):
24075
* bindings/jni/jni_instance.cpp:
24076
(JavaInstance::begin):
24077
(JavaInstance::end):
24078
* bindings/jni/jni_instance.h:
24079
* bindings/jni/jni_runtime.cpp:
24080
(JavaConstructor::JavaConstructor):
24081
(JavaMethod::JavaMethod):
24082
* bindings/jni_jsobject.cpp:
24083
(JSObject::listFromJArray):
24084
* bindings/runtime.h:
24085
(KJS::Bindings::Instance::begin):
24086
(KJS::Bindings::Instance::end):
24087
* bindings/runtime_object.cpp:
24088
(RuntimeObjectImp::get):
24089
(RuntimeObjectImp::put):
24090
(RuntimeObjectImp::canPut):
24091
(RuntimeObjectImp::hasProperty):
24092
(RuntimeObjectImp::defaultValue):
24094
2004-01-15 Vicki Murley <vicki@apple.com>
24098
* JavaScriptCore.pbproj/project.pbxproj: Update copyright date to 2004.
24100
2004-01-14 Richard Williamson <rjw@apple.com>
24102
Fixed 3529466. With recent changes to Java plugin we must no
24103
longer call DeleteLocalRef(). Not a problem, it was an optimization anyway.
24107
* bindings/jni/jni_instance.cpp:
24108
(JObjectWrapper::JObjectWrapper):
24112
2004-01-14 Richard Williamson <rjw@apple.com>
24116
Finalize may be called on an JSObject after we've already remove all our references. The assert in this case is firing because we've received a finalize call from Java for an instance that we no longer know about. The fix is to check in finalize that we're getting a call on an instance that we still care about.
24120
* bindings/jni_jsobject.cpp:
24121
(addJavaReference):
24122
(removeJavaReference):
24123
(RootObject::removeAllJavaReferencesForRoot):
24124
(JSObject::invoke):
24126
2004-01-13 Richard Williamson <rjw@apple.com>
24130
The run loop that is used to execute JavaScript (in practice, always the main run loop) is held in a class variable. It is set and retained once and should not be released. Unfortunately is it being released when the 'root' object on a LiveConnect applet is released. This has the symptom of eventually causing an deallocation of the main run loop! Usually after about 5 instantiations/destructions of a LiveConnect applet. The CFRelease of the run loop was removed.
24134
* bindings/jni_jsobject.h:
24135
(KJS::Bindings::RootObject::~RootObject):
24141
2004-01-06 Richard Williamson <rjw@apple.com>
24143
Fixed 3521814. Finalize messages weren't being dispatched!
24147
* bindings/jni_jsobject.cpp:
24148
(JSObject::invoke):
24150
2004-01-05 Richard Williamson <rjw@apple.com>
24152
Added cache of JNI method IDs to minimize allocations. This mitigates the problem
24153
described by 3515579.
24155
Also cleanup up logging of Java exceptions.
24159
* bindings/jni/jni_class.cpp:
24160
(JavaClass::classForInstance):
24161
* bindings/jni/jni_instance.cpp:
24162
(JavaInstance::JavaInstance):
24163
(JavaInstance::getClass):
24164
(JavaInstance::invokeMethod):
24165
(JObjectWrapper::JObjectWrapper):
24166
(JObjectWrapper::~JObjectWrapper):
24167
* bindings/jni/jni_instance.h:
24168
(KJS::Bindings::JavaInstance::operator=):
24169
* bindings/jni/jni_runtime.cpp:
24170
(JavaMethod::JavaMethod):
24171
(JavaMethod::methodID):
24172
* bindings/jni/jni_runtime.h:
24173
(KJS::Bindings::JavaMethod::JavaMethod):
24174
* bindings/jni/jni_utility.cpp:
24176
(callJNIMethodIDA):
24178
(KJS::Bindings::getMethodID):
24179
(KJS::Bindings::callJNIVoidMethodIDA):
24180
(KJS::Bindings::callJNIObjectMethodIDA):
24181
(KJS::Bindings::callJNIByteMethodIDA):
24182
(KJS::Bindings::callJNICharMethodIDA):
24183
(KJS::Bindings::callJNIShortMethodIDA):
24184
(KJS::Bindings::callJNIIntMethodIDA):
24185
(KJS::Bindings::callJNILongMethodIDA):
24186
(KJS::Bindings::callJNIFloatMethodIDA):
24187
(KJS::Bindings::callJNIDoubleMethodIDA):
24188
(KJS::Bindings::callJNIBooleanMethodIDA):
24189
(KJS::Bindings::getCharactersFromJStringInEnv):
24190
(KJS::Bindings::getUCharactersFromJStringInEnv):
24191
(KJS::Bindings::getJNIField):
24192
* bindings/jni/jni_utility.h:
24194
l2003-12-23 John Sullivan <sullivan@apple.com>
24196
* JavaScriptCore.pbproj/project.pbxproj:
24197
Xcode version wars, harmless
24199
2003-12-23 Darin Adler <darin@apple.com>
24201
Reviewed by John (concept, not code, which is just the old code coming back).
24203
- fixed 3518092: REGRESSION (100-119): getting NaN instead of HH:MM times
24205
* kjs/date_object.cpp: Added back our CF-based implementations of gmtime, localtime,
24206
mktime, timegm, and time, because mktime, at least, won't handle a year of 0.
24208
2003-12-19 Richard Williamson <rjw@apple.com>
24210
Fixed 3515597. When an error occurs we need
24211
to make sure result values are zeroed.
24213
Cleaned up logs by adding a newline.
24217
* bindings/jni/jni_utility.cpp:
24218
(KJS::Bindings::getJavaVM):
24219
(KJS::Bindings::getJNIEnv):
24222
(KJS::Bindings::getJNIField):
24223
* bindings/jni_jsobject.cpp:
24224
(JSObject::convertValueToJObject):
24228
2003-12-17 Richard Williamson <rjw@apple.com>
24230
Ensure that all the symbols we export are in the KJS
24231
namespace (3512245).
24233
Also renamed JavaString.characters() to JavaString.UTF8String()
24234
for enhanced clarity.
24236
Added some sanity checking to constructor of JObjectWrapper.
24241
* bindings/jni/jni_class.cpp:
24242
* bindings/jni/jni_class.h:
24243
* bindings/jni/jni_instance.cpp:
24244
(JavaInstance::invokeMethod):
24245
(JObjectWrapper::JObjectWrapper):
24246
* bindings/jni/jni_instance.h:
24247
* bindings/jni/jni_runtime.cpp:
24248
(JavaParameter::JavaParameter):
24249
(JavaField::JavaField):
24250
(JavaMethod::JavaMethod):
24251
(JavaMethod::signature):
24252
* bindings/jni/jni_runtime.h:
24253
(KJS::Bindings::JavaString::ascii):
24254
(KJS::Bindings::JavaString::UTF8String):
24255
(KJS::Bindings::JavaString::JavaString):
24256
(KJS::Bindings::JavaString::_commonInit):
24257
(KJS::Bindings::JavaString::uchars):
24258
(KJS::Bindings::JavaString::length):
24259
(KJS::Bindings::JavaString::ustring):
24260
(KJS::Bindings::JavaParameter::type):
24261
(KJS::Bindings::JavaField::name):
24262
(KJS::Bindings::JavaField::type):
24263
(KJS::Bindings::JavaMethod::name):
24264
(KJS::Bindings::JavaMethod::returnType):
24265
* bindings/jni/jni_utility.cpp:
24266
(KJS::Bindings::getJavaVM):
24267
(KJS::Bindings::getJNIEnv):
24268
(KJS::Bindings::callJNIVoidMethod):
24269
(KJS::Bindings::callJNIObjectMethod):
24270
(KJS::Bindings::callJNIBooleanMethod):
24271
(KJS::Bindings::callJNIByteMethod):
24272
(KJS::Bindings::callJNICharMethod):
24273
(KJS::Bindings::callJNIShortMethod):
24274
(KJS::Bindings::callJNIIntMethod):
24275
(KJS::Bindings::callJNILongMethod):
24276
(KJS::Bindings::callJNIFloatMethod):
24277
(KJS::Bindings::callJNIDoubleMethod):
24278
(KJS::Bindings::callJNIVoidMethodA):
24279
(KJS::Bindings::callJNIObjectMethodA):
24280
(KJS::Bindings::callJNIByteMethodA):
24281
(KJS::Bindings::callJNICharMethodA):
24282
(KJS::Bindings::callJNIShortMethodA):
24283
(KJS::Bindings::callJNIIntMethodA):
24284
(KJS::Bindings::callJNILongMethodA):
24285
(KJS::Bindings::callJNIFloatMethodA):
24286
(KJS::Bindings::callJNIDoubleMethodA):
24287
(KJS::Bindings::callJNIBooleanMethodA):
24288
(KJS::Bindings::getCharactersFromJString):
24289
(KJS::Bindings::releaseCharactersForJString):
24290
(KJS::Bindings::getCharactersFromJStringInEnv):
24291
(KJS::Bindings::releaseCharactersForJStringInEnv):
24292
(KJS::Bindings::getUCharactersFromJStringInEnv):
24293
(KJS::Bindings::releaseUCharactersForJStringInEnv):
24294
(KJS::Bindings::JNITypeFromClassName):
24295
(KJS::Bindings::signatureFromPrimitiveType):
24296
(KJS::Bindings::JNITypeFromPrimitiveType):
24297
(KJS::Bindings::getJNIField):
24298
(KJS::Bindings::convertValueToJValue):
24299
* bindings/jni/jni_utility.h:
24300
* bindings/jni_jsobject.cpp:
24301
(KJS::Bindings::JSObject::invoke):
24302
(KJS::Bindings::JSObject::JSObject):
24303
(KJS::Bindings::JSObject::call):
24304
(KJS::Bindings::JSObject::eval):
24305
(KJS::Bindings::JSObject::getMember):
24306
(KJS::Bindings::JSObject::setMember):
24307
(KJS::Bindings::JSObject::removeMember):
24308
(KJS::Bindings::JSObject::getSlot):
24309
(KJS::Bindings::JSObject::setSlot):
24310
(KJS::Bindings::JSObject::toString):
24311
(KJS::Bindings::JSObject::finalize):
24312
(KJS::Bindings::JSObject::createNative):
24313
(KJS::Bindings::JSObject::convertValueToJObject):
24314
(KJS::Bindings::JSObject::convertJObjectToValue):
24315
(KJS::Bindings::JSObject::listFromJArray):
24316
* bindings/jni_jsobject.h:
24317
* bindings/runtime.cpp:
24318
* bindings/runtime.h:
24319
* bindings/runtime_method.cpp:
24320
* bindings/runtime_method.h:
24324
2003-12-16 Richard Williamson <rjw@apple.com>
24326
Ack! More assertions. Lock ALL entry points into the interpreter!
24331
* bindings/jni_jsobject.cpp:
24332
(Bindings::JSObject::call):
24333
(Bindings::JSObject::eval):
24334
(Bindings::JSObject::getMember):
24335
(Bindings::JSObject::setMember):
24336
(Bindings::JSObject::removeMember):
24337
(Bindings::JSObject::getSlot):
24338
(Bindings::JSObject::setSlot):
24339
(Bindings::JSObject::convertJObjectToValue):
24341
2003-12-15 Richard Williamson <rjw@apple.com>
24343
Fixed a couple of snafus and removed some logging.
24345
Reviewed by Maciej.
24347
* bindings/jni_jsobject.cpp:
24348
(Bindings::performJavaScriptAccess):
24349
(Bindings::completedJavaScriptAccess):
24350
(Bindings::dispatchToJavaScriptThread):
24351
Removed some annoying JS_LOG clutter.
24353
(Bindings::RootObject::removeAllJavaReferencesForRoot):
24354
Fixed allocation of key buffer that was called after it was needed.
24356
(Bindings::JSObject::invoke):
24357
(Bindings::JSObject::JSObject):
24358
(Bindings::JSObject::getMember):
24359
(Bindings::JSObject::getSlot):
24360
Added additional interpreter locks around getMember and getSlot.
24361
These functions may cause allocation of JS impls.
24363
2003-12-15 Richard Williamson <rjw@apple.com>
24365
args weren't passed to 'call' invocation. d'oh.
24366
lock interpreter when we create instances of JS impls.
24368
Reviewed by Maciej.
24370
* bindings/jni_jsobject.cpp:
24371
(Bindings::JSObject::call):
24372
(Bindings::JSObject::eval):
24373
(Bindings::JSObject::getMember):
24374
(Bindings::JSObject::setMember):
24375
(Bindings::JSObject::getSlot):
24376
(Bindings::JSObject::convertValueToJObject):
24377
(Bindings::JSObject::convertJObjectToValue):
24378
(Bindings::JSObject::listFromJArray):
24379
* bindings/jni_jsobject.h:
24381
2003-12-15 Richard Williamson <rjw@apple.com>
24383
Last piece of LiveConnect! This checkin adds implementation
24384
of the Java to JavaScript object conversion functions.
24388
* bindings/jni/jni_instance.cpp:
24389
(JavaInstance::invokeMethod):
24390
* bindings/jni/jni_utility.cpp:
24391
* bindings/jni/jni_utility.h:
24392
* bindings/jni_jsobject.cpp:
24393
(Bindings::JSObject::invoke):
24394
(Bindings::JSObject::call):
24395
(Bindings::JSObject::eval):
24396
(Bindings::JSObject::getMember):
24397
(Bindings::JSObject::setMember):
24398
(Bindings::JSObject::getSlot):
24399
(Bindings::JSObject::setSlot):
24400
(Bindings::JSObject::createNative):
24401
(Bindings::JSObject::convertValueToJObject):
24402
(Bindings::JSObject::convertJObjectToValue):
24403
(Bindings::JSObject::listFromJArray):
24404
* bindings/jni_jsobject.h:
24406
* bindings/runtime_method.cpp:
24407
(RuntimeMethodImp::get):
24408
(RuntimeMethodImp::codeType):
24409
(RuntimeMethodImp::execute):
24411
2003-12-12 Richard Williamson <rjw@apple.com>
24413
Added implementation of stubs in JSObject. All that
24414
remains is a couple of simple conversion functions stubs and
24415
we're done with LiveConnect. Also, changed string passing to
24416
JS to use uchars instead of chars.
24418
Reviewed by Maciej.
24420
* bindings/jni/jni_runtime.h:
24421
(Bindings::JavaString::JavaString):
24422
(Bindings::JavaString::_commonInit):
24423
(Bindings::JavaString::_commonCopy):
24424
(Bindings::JavaString::_commonDelete):
24425
(Bindings::JavaString::~JavaString):
24426
(Bindings::JavaString::operator=):
24427
(Bindings::JavaString::uchars):
24428
(Bindings::JavaString::length):
24429
(Bindings::JavaString::ustring):
24430
* bindings/jni/jni_utility.cpp:
24431
(getUCharactersFromJStringInEnv):
24432
(releaseUCharactersForJStringInEnv):
24433
(convertValueToJObject):
24434
(convertJObjectToValue):
24435
* bindings/jni/jni_utility.h:
24436
* bindings/jni_jsobject.cpp:
24437
(Bindings::JSObject::invoke):
24438
(Bindings::JSObject::call):
24439
(Bindings::JSObject::eval):
24440
(Bindings::JSObject::getMember):
24441
(Bindings::JSObject::setMember):
24442
(Bindings::JSObject::removeMember):
24443
(Bindings::JSObject::getSlot):
24444
(Bindings::JSObject::setSlot):
24445
* bindings/jni_jsobject.h:
24447
2003-12-12 Richard Williamson <rjw@apple.com>
24449
Ensure that all calls from Java into JavaScript are
24450
performed on a designated thread (the main thread).
24454
* bindings/jni_jsobject.cpp:
24455
(isJavaScriptThread):
24457
(Bindings::performJavaScriptAccess):
24458
(Bindings::completedJavaScriptAccess):
24459
(Bindings::initializeJavaScriptAccessLock):
24460
(Bindings::lockJavaScriptAccess):
24461
(Bindings::unlockJavaScriptAccess):
24462
(Bindings::dispatchToJavaScriptThread):
24463
(Bindings::RootObject::setFindRootObjectForNativeHandleFunction):
24464
(Bindings::RootObject::removeAllJavaReferencesForRoot):
24465
(Bindings::JSObject::invoke):
24466
(Bindings::JSObject::JSObject):
24467
(Bindings::JSObject::call):
24468
(Bindings::JSObject::eval):
24469
(Bindings::JSObject::getMember):
24470
(Bindings::JSObject::setMember):
24471
(Bindings::JSObject::removeMember):
24472
(Bindings::JSObject::getSlot):
24473
(Bindings::JSObject::setSlot):
24474
(Bindings::JSObject::toString):
24475
(Bindings::JSObject::finalize):
24476
(Bindings::JSObject::getWindow):
24477
* bindings/jni_jsobject.h:
24478
(Bindings::RootObject::~RootObject):
24479
(Bindings::RootObject::findRootObjectForNativeHandleFunction):
24480
(Bindings::RootObject::runLoop):
24481
(Bindings::RootObject::performJavaScriptSource):
24484
2003-12-11 Richard Williamson <rjw@apple.com>
24486
Added support for calling a JavaScript function from
24487
Java. Right now this only works for void func(void)
24488
functions, but the conversion of args and return values
24491
Cleaned up and verified reference counting scheme, and
24492
dereferencing of vended JavaScript objects when applet is
24493
destroyed (actually when part is destroyed).
24495
Removed link hack for testkjs now that the Java folks think
24496
they have a solution for the 1.4.2 JavaVM link problem. Although
24497
Greg B. thinks his solution may cause problems for the 1.3.1
24498
version of the VM!?!
24503
* bindings/jni/jni_runtime.h:
24504
(Bindings::JavaString::JavaString):
24505
* bindings/jni/jni_utility.cpp:
24506
(convertValueToJValue):
24507
(convertValueToJObject):
24509
* bindings/jni/jni_utility.h:
24510
* bindings/jni_jsobject.cpp:
24511
(KJS_setFindRootObjectForNativeHandleFunction):
24512
(KJS_findRootObjectForNativeHandleFunction):
24513
(getReferencesByRootDictionary):
24514
(getReferencesDictionary):
24515
(findReferenceDictionary):
24517
(addJavaReference):
24518
(removeJavaReference):
24519
* bindings/jni_jsobject.h:
24520
(Bindings::RootObject::RootObject):
24521
(Bindings::RootObject::~RootObject):
24522
(Bindings::RootObject::setRootObjectImp):
24523
(Bindings::RootObject::rootObjectImp):
24524
(Bindings::RootObject::setInterpreter):
24525
(Bindings::RootObject::interpreter):
24529
2003-12-10 Darin Adler <darin@apple.com>
24531
Reviewed by Maciej.
24533
- fixed regression in JavaScript tests reported by the KDE guys
24534
- fixed 3506345: REGRESSION (115-116): VIP: chordfind.com no longer displays chords
24536
* kjs/ustring.h: Add tolerateEmptyString parameter to toDouble and toULong.
24538
(KJS::UString::toDouble): Separate the "tolerant" parameter into two separate ones:
24539
tolerateTrailingJunk and tolerateEmptyString. Add new overloads; better for code size
24540
and binary compatibility than default parameter values.
24541
(KJS::UString::toULong): Pass tolerateEmptyString down to toDouble. Add new overload.
24543
* kjs/string_object.cpp: (StringProtoFuncImp::call): Pass false for the new
24544
"tolerate empty string" parameter.
24546
2003-12-10 Richard Williamson <rjw@apple.com>
24548
Added code to manage reference counting of JavaScript
24549
objects passed to Java. Also added implementation of
24550
KJS_JSCreateNativeJSObject. This is the function that
24551
provides the root object to Java (KJS::Window).
24555
* JavaScriptCore.pbproj/project.pbxproj:
24556
* bindings/jni_jsobject.cpp:
24557
(KJS_setFindObjectForNativeHandleFunction):
24558
(KJS_findObjectForNativeHandleFunction):
24559
(getReferencesByOwnerDictionary):
24560
(getReferencesDictionary):
24561
(findReferenceDictionary):
24562
(addJavaReference):
24563
(removeJavaReference):
24564
(removeAllJavaReferencesForOwner):
24565
* bindings/jni_jsobject.h:
24567
2003-12-09 Richard Williamson <rjw@apple.com>
24569
LiveConnect stubs that correspond to the native methods
24570
on JSObject. These will be called from the new Java plugin
24571
when an instance of JSObject is instantiated and messaged.
24572
When these are implemented the Java will be able to originate
24573
calls into JavaScript.
24575
Also a temporary work-around added to Makefile.am to solve
24576
a link problem. The 1.4.2 JavaVM accidentally links against
24577
libobjc. This call a failure linking testkjs. Mike Hay is
24578
working with someone to fix the problem (3505587).
24582
* JavaScriptCore.pbproj/project.pbxproj:
24584
* bindings/jni_jsobject.cpp: Added.
24585
(KJS_JSCreateNativeJSObject):
24586
(KJS_JSObject_JSFinalize):
24587
(KJS_JSObject_JSObjectCall):
24588
(KJS_JSObject_JSObjectEval):
24589
(KJS_JSObject_JSObjectGetMember):
24590
(KJS_JSObject_JSObjectSetMember):
24591
(KJS_JSObject_JSObjectRemoveMember):
24592
(KJS_JSObject_JSObjectGetSlot):
24593
(KJS_JSObject_JSObjectSetSlot):
24594
(KJS_JSObject_JSObjectToString):
24595
* bindings/jni_jsobject.h: Added.
24597
2003-12-09 Maciej Stachowiak <mjs@apple.com>
24601
<rdar://problem/3505183>: JavaScriptCore should assert that interpreter is locked in collector
24603
* kjs/collector.cpp:
24604
(KJS::Collector::allocate): Assert that interpreter lock count is not 0.
24605
(KJS::Collector::collect): likewise
24607
2003-12-08 Richard Williamson <rjw@apple.com>
24609
LiveConnect: The last piece of the JavaScript side of the
24610
LiveConnect implementation. This change adds support for
24611
setting/getting values from Java arrays in JavaScript.
24615
* bindings/jni/jni_instance.h:
24616
* bindings/jni/jni_runtime.cpp:
24617
(JavaField::JavaField):
24618
(convertJObjectToArray):
24619
(JavaArray::JavaArray):
24620
(JavaArray::~JavaArray):
24621
(JavaArray::setValueAt):
24622
(JavaArray::valueAt):
24623
(JavaArray::getLength):
24624
* bindings/jni/jni_runtime.h:
24625
(Bindings::JavaArray::operator=):
24626
(Bindings::JavaArray::javaArray):
24627
* bindings/jni/jni_utility.cpp:
24628
(JNITypeFromPrimitiveType):
24629
(convertValueToJValue):
24630
* bindings/jni/jni_utility.h:
24631
* bindings/runtime.h:
24632
* bindings/runtime_array.cpp:
24633
(RuntimeArrayImp::RuntimeArrayImp):
24634
(RuntimeArrayImp::~RuntimeArrayImp):
24635
(RuntimeArrayImp::get):
24636
(RuntimeArrayImp::put):
24637
(RuntimeArrayImp::hasProperty):
24638
* bindings/runtime_array.h:
24639
(KJS::RuntimeArrayImp::getLength):
24640
(KJS::RuntimeArrayImp::getConcreteArray):
24641
* bindings/runtime_object.cpp:
24642
(RuntimeObjectImp::get):
24643
(RuntimeObjectImp::canPut):
24644
(RuntimeObjectImp::hasProperty):
24646
2003-12-05 Richard Williamson <rjw@apple.com>
24648
LiveConnect: Part 1 of supporting JS bindings to
24649
native language arrays.
24653
* JavaScriptCore.pbproj/project.pbxproj:
24654
* bindings/jni/jni_runtime.cpp:
24655
(JavaField::JavaField):
24656
(convertJObjectToArray):
24657
(JavaField::valueFromInstance):
24658
(JavaField::setValueToInstance):
24659
* bindings/jni/jni_runtime.h:
24660
* bindings/runtime.cpp:
24661
(Instance::setValueOfField):
24662
* bindings/runtime.h:
24663
(Bindings::Array::~Array):
24665
2003-12-04 Richard Williamson <rjw@apple.com>
24667
LiveConnect: Moved defaultValue into concrete implementation because
24668
more intelligent conversion can be perform with knowledge
24669
of the class of the original instance.
24673
* bindings/jni/jni_class.cpp:
24674
(JavaClass::isNumberClass):
24675
(JavaClass::isBooleanClass):
24676
(JavaClass::isStringClass):
24677
* bindings/jni/jni_class.h:
24678
* bindings/jni/jni_instance.cpp:
24679
(JavaInstance::defaultValue):
24680
(JavaInstance::valueOf):
24681
* bindings/jni/jni_instance.h:
24682
(Bindings::JavaInstance::javaInstance):
24683
* bindings/runtime.h:
24684
* bindings/runtime_object.cpp:
24685
(RuntimeObjectImp::defaultValue):
24687
2003-12-04 Richard Williamson <rjw@apple.com>
24689
LiveConnect: Added support for setting the value of Java
24694
* bindings/jni/jni_instance.cpp:
24695
(JavaInstance::invokeMethod):
24696
* bindings/jni/jni_runtime.cpp:
24697
(JavaParameter::JavaParameter):
24698
(JavaField::JavaField):
24699
(JavaField::valueFromInstance):
24700
(JavaField::setValueToInstance):
24701
(JavaMethod::JavaMethod):
24702
* bindings/jni/jni_runtime.h:
24703
(Bindings::JavaField::getJNIType):
24704
* bindings/jni/jni_utility.cpp:
24705
(JNITypeFromClassName):
24706
(convertValueToJValue):
24707
* bindings/jni/jni_utility.h:
24708
* bindings/runtime.cpp:
24709
(Instance::setValueOfField):
24710
* bindings/runtime.h:
24711
* bindings/runtime_object.cpp:
24712
(RuntimeObjectImp::get):
24713
(RuntimeObjectImp::put):
24714
(RuntimeObjectImp::defaultValue):
24716
2003-12-04 Richard Williamson <rjw@apple.com>
24718
Added support for string conversions.
24719
Changed various JavaString member variables to be inline.
24720
Implemented defaultValue for context relevant type coercion.
24724
* bindings/jni/jni_class.cpp:
24725
(JavaClass::JavaClass):
24726
(JavaClass::setClassName):
24727
(JavaClass::classForInstance):
24728
* bindings/jni/jni_class.h:
24729
* bindings/jni/jni_instance.cpp:
24730
(JavaInstance::stringValue):
24731
(JavaInstance::numberValue):
24732
(JavaInstance::booleanValue):
24733
(JavaInstance::invokeMethod):
24734
* bindings/jni/jni_instance.h:
24735
* bindings/jni/jni_runtime.cpp:
24736
(JavaParameter::JavaParameter):
24737
(JavaField::JavaField):
24738
(JavaMethod::JavaMethod):
24740
(JavaMethod::signature):
24741
* bindings/jni/jni_runtime.h:
24742
(Bindings::JavaString::JavaString):
24743
(Bindings::JavaString::~JavaString):
24744
(Bindings::JavaString::operator=):
24745
(Bindings::JavaString::characters):
24746
(Bindings::JavaParameter::JavaParameter):
24747
(Bindings::JavaParameter::~JavaParameter):
24748
(Bindings::JavaParameter::operator=):
24749
(Bindings::JavaParameter::type):
24750
(Bindings::JavaField::JavaField):
24751
(Bindings::JavaField::~JavaField):
24752
(Bindings::JavaField::operator=):
24753
(Bindings::JavaField::name):
24754
(Bindings::JavaField::type):
24755
(Bindings::JavaMethod::JavaMethod):
24756
(Bindings::JavaMethod::_commonDelete):
24757
(Bindings::JavaMethod::name):
24758
(Bindings::JavaMethod::returnType):
24759
* bindings/jni/jni_utility.cpp:
24760
(convertValueToJValue):
24761
* bindings/runtime.h:
24762
(Bindings::Instance::valueOf):
24763
* bindings/runtime_method.cpp:
24764
(RuntimeMethodImp::call):
24765
* bindings/runtime_object.cpp:
24766
(RuntimeObjectImp::RuntimeObjectImp):
24767
(RuntimeObjectImp::get):
24768
(RuntimeObjectImp::defaultValue):
24769
* bindings/runtime_object.h:
24770
(KJS::RuntimeObjectImp::classInfo):
24774
2003-12-03 Richard Williamson <rjw@apple.com>
24776
LiveConnect: Added support for parameter passing to Java and conversion
24781
* bindings/jni/jni_instance.cpp:
24782
(JavaInstance::invokeMethod):
24783
* bindings/jni/jni_instance.h:
24784
* bindings/jni/jni_runtime.cpp:
24785
(JavaParameter::JavaParameter):
24786
(JavaMethod::JavaMethod):
24787
(JavaMethod::signature):
24788
* bindings/jni/jni_runtime.h:
24789
(Bindings::JavaParameter::JavaParameter):
24790
(Bindings::JavaParameter::operator=):
24791
(Bindings::JavaParameter::getJNIType):
24792
* bindings/jni/jni_utility.cpp:
24793
(callJNIBooleanMethodA):
24794
(convertValueToJValue):
24795
* bindings/jni/jni_utility.h:
24796
* bindings/runtime.h:
24797
* bindings/runtime_method.cpp:
24798
(RuntimeMethodImp::call):
24799
* bindings/runtime_object.cpp:
24800
(RuntimeObjectImp::get):
24802
2003-12-02 Richard Williamson <rjw@apple.com>
24804
Added support for calling simple methods in Java from JavaScript.
24805
(void return and no parameters). Yay, LiveConnect lives.
24807
Still need write argument and return value conversion code.
24811
* JavaScriptCore.pbproj/project.pbxproj:
24812
* bindings/jni/jni_instance.cpp:
24813
(JavaInstance::getClass):
24814
(JavaInstance::invokeMethod):
24815
* bindings/jni/jni_instance.h:
24816
* bindings/jni/jni_runtime.cpp:
24817
(JavaMethod::JavaMethod):
24818
(JavaMethod::signature):
24819
(JavaMethod::JNIReturnType):
24820
* bindings/jni/jni_runtime.h:
24821
(Bindings::JavaMethod::_commonDelete):
24822
(Bindings::JavaMethod::_commonCopy):
24823
(Bindings::JavaMethod::name):
24824
* bindings/jni/jni_utility.cpp:
24825
(signatureFromPrimitiveType):
24826
* bindings/jni/jni_utility.h:
24827
* bindings/runtime.h:
24828
* bindings/runtime_method.cpp: Added.
24829
(RuntimeMethodImp::RuntimeMethodImp):
24830
(RuntimeMethodImp::~RuntimeMethodImp):
24831
(RuntimeMethodImp::get):
24832
(RuntimeMethodImp::implementsCall):
24833
(RuntimeMethodImp::call):
24834
(RuntimeMethodImp::codeType):
24835
(RuntimeMethodImp::execute):
24836
* bindings/runtime_method.h: Added.
24837
* bindings/runtime_object.cpp:
24838
(RuntimeObjectImp::RuntimeObjectImp):
24839
(RuntimeObjectImp::get):
24840
* bindings/runtime_object.h:
24841
* kjs/function.cpp:
24842
(FunctionImp::FunctionImp):
24843
* kjs/interpreter.h:
24845
2003-12-01 Darin Adler <darin@apple.com>
24847
Reviewed by Maciej.
24849
- fixed 3493799: JavaScript string.replace expands $ if it's the last character in replacement string
24851
* kjs/ustring.cpp: (KJS::UString::toDouble): Fix backwards handling of the "tolerant" boolean.
24852
This indirectly caused the string.replace bug.
24854
2003-12-02 Maciej Stachowiak <mjs@apple.com>
24856
Merged patches from Harri Porten and David Faure to fix:
24858
<rdar://problem/3497643>: reproducible crash printing self-referential array
24860
* kjs/array_object.cpp:
24861
(ArrayProtoFuncImp::call): Break out of the loop if an exception was thrown.
24863
(FunctionCallNode::evaluate): Move function call depth check from here...
24865
(KJS::Object::call): ...to here.
24866
* kjs/object.h: Un-inline Object::call now that it does more.
24868
2003-12-01 Richard Williamson <rjw@apple.com>
24870
Fixed mistake in method signatures used to get boolean and integer fields.
24874
* bindings/jni/jni_runtime.cpp:
24875
(JavaField::valueFromInstance):
24877
2003-12-01 Richard Williamson <rjw@apple.com>
24879
Fixed parameter passing to applet. Child elements are NOT valid in setStyle(). So we now create the widget before needed with createWidgetIfNecessary. This either happens when doing the first layout, or when JavaScript first references the applet element.
24881
Fixed early delete of the the main applet instance. When the JS collector cleaned up the last JS object referring to the applet instance we were deleting the java instance. This caused the applet instance cached on the applet element to be invalid. The applet instance is the only Java object not to be cleaned up by the JS collector.
24883
Added support for getting at Java object fields.
24887
* JavaScriptCore.pbproj/project.pbxproj:
24889
* bindings/jni/jni_instance.cpp:
24890
(JObjectWrapper::JObjectWrapper):
24891
* bindings/jni/jni_instance.h:
24892
(Bindings::JObjectWrapper::~JObjectWrapper):
24893
* bindings/jni/jni_runtime.cpp:
24894
(JavaField::valueFromInstance):
24895
* bindings/runtime_object.cpp:
24896
(RuntimeObjectImp::~RuntimeObjectImp):
24897
(RuntimeObjectImp::RuntimeObjectImp):
24898
(RuntimeObjectImp::get):
24899
(RuntimeObjectImp::deleteProperty):
24900
* bindings/runtime_object.h:
24904
2003-11-21 Maciej Stachowiak <mjs@apple.com>
24906
Patch from Harri Porten, reviewed by me.
24908
- fixed 3491712 - String slice with negative arguments does not offset from end of string
24910
* kjs/string_object.cpp:
24911
(StringProtoFuncImp::call): Handle negative arguments as offsets from end by
24912
adding length and clamping to [0,length-1].
24914
2003-11-21 Maciej Stachowiak <mjs@apple.com>
24916
Patch from Harri Porten, reviewed by me.
24918
- fixed 3491709 - using Function.apply with a primitive type as the arg list causes crash
24920
* kjs/function_object.cpp:
24921
(FunctionProtoFuncImp::call): Nest parentheses properly.
24923
2003-11-20 Richard Williamson <rjw@apple.com>
24925
More LiveConnect stuff. Primitive Java fields are now
24926
accessible from JavaScript! Yay!
24928
Reviewed by Maciej.
24930
* bindings/jni/jni_class.cpp:
24931
(JavaClass::methodNamed):
24932
(JavaClass::fieldNamed):
24933
* bindings/jni/jni_class.h:
24934
(Bindings::JavaClass::_commonDelete):
24935
* bindings/jni/jni_instance.cpp:
24936
(JavaInstance::JavaInstance):
24937
(JavaInstance::~JavaInstance):
24938
(JavaInstance::getClass):
24939
* bindings/jni/jni_instance.h:
24940
(Bindings::JavaInstance::javaInstance):
24941
* bindings/jni/jni_runtime.cpp:
24942
(JavaField::JavaField):
24943
(JavaField::valueFromInstance):
24944
* bindings/jni/jni_runtime.h:
24945
(Bindings::JavaField::JavaField):
24946
(Bindings::JavaField::~JavaField):
24947
(Bindings::JavaField::operator=):
24948
* bindings/jni/jni_utility.cpp:
24951
(callJNIVoidMethod):
24952
(callJNIObjectMethod):
24953
(callJNIBooleanMethod):
24954
(callJNIByteMethod):
24955
(callJNICharMethod):
24956
(callJNIShortMethod):
24957
(callJNIIntMethod):
24958
(callJNILongMethod):
24959
(callJNIFloatMethod):
24960
(callJNIDoubleMethod):
24961
(callJNIVoidMethodA):
24962
(callJNIObjectMethodA):
24963
(callJNIByteMethodA):
24964
(callJNICharMethodA):
24965
(callJNIShortMethodA):
24966
(callJNIIntMethodA):
24967
(callJNILongMethodA):
24968
(callJNIFloatMethodA):
24969
(callJNIDoubleMethodA):
24970
(releaseCharactersForJStringInEnv):
24971
(primitiveTypeFromClassName):
24973
* bindings/jni/jni_utility.h:
24974
* bindings/runtime.cpp:
24975
(Instance::createBindingForLanguageInstance):
24976
(Instance::getValueOfField):
24977
* bindings/runtime.h:
24978
* bindings/runtime_object.cpp:
24979
(RuntimeObjectImp::get):
24981
2003-11-20 Richard Williamson <rjw@apple.com>
24983
More LiveConnect stuff.
24987
* bindings/jni/jni_class.cpp:
24988
(JavaClass::classForName):
24989
(JavaClass::classForInstance):
24990
* bindings/jni/jni_instance.cpp:
24991
(JavaInstance::getValueOfField):
24992
* bindings/jni/jni_instance.h:
24993
(Bindings::JObjectWrapper::JObjectWrapper):
24994
* bindings/jni/jni_runtime.h:
24995
(Bindings::JavaConstructor::~JavaConstructor):
24996
(Bindings::JavaConstructor::operator=):
24997
(Bindings::JavaMethod::JavaMethod):
24998
(Bindings::JavaMethod::_commonDelete):
24999
(Bindings::JavaMethod::signature):
25000
* bindings/jni/jni_utility.cpp:
25003
* bindings/jni/jni_utility.h:
25004
* bindings/runtime.h:
25005
* bindings/runtime_object.cpp:
25006
(RuntimeObjectImp::~RuntimeObjectImp):
25007
(RuntimeObjectImp::get):
25008
* bindings/runtime_object.h:
25010
2003-11-19 Richard Williamson <rjw@apple.com>
25012
More LiveConnect stuff.
25016
* JavaScriptCore.pbproj/project.pbxproj:
25017
* bindings/jni/jni_class.cpp: Added.
25018
(JavaClass::_commonInit):
25019
(JavaClass::JavaClass):
25020
(_createClassesByNameIfNecessary):
25021
(JavaClass::classForName):
25022
(JavaClass::classForInstance):
25023
(JavaClass::methodNamed):
25024
(JavaClass::fieldNamed):
25025
* bindings/jni/jni_class.h: Added.
25026
(Bindings::JavaClass::_commonDelete):
25027
(Bindings::JavaClass::~JavaClass):
25028
(Bindings::JavaClass::_commonCopy):
25029
(Bindings::JavaClass::JavaClass):
25030
(Bindings::JavaClass::operator=):
25031
(Bindings::JavaClass::name):
25032
(Bindings::JavaClass::constructorAt):
25033
(Bindings::JavaClass::numConstructors):
25034
* bindings/jni/jni_instance.cpp: Added.
25035
(JavaInstance::JavaInstance):
25036
(JavaInstance::~JavaInstance):
25037
* bindings/jni/jni_instance.h: Added.
25038
(Bindings::JObjectWrapper::JObjectWrapper):
25039
(Bindings::JObjectWrapper::~JObjectWrapper):
25040
(Bindings::JObjectWrapper::ref):
25041
(Bindings::JObjectWrapper::deref):
25042
(Bindings::JavaInstance::getClass):
25043
(Bindings::JavaInstance::operator=):
25044
* bindings/jni/jni_runtime.cpp:
25045
(JavaMethod::JavaMethod):
25046
* bindings/jni/jni_runtime.h:
25047
(Bindings::JavaString::JavaString):
25048
(Bindings::JavaString::~JavaString):
25049
(Bindings::JavaString::operator=):
25050
* bindings/jni/jni_utility.cpp:
25053
(getCharactersFromJString):
25054
(releaseCharactersForJString):
25055
(getCharactersFromJStringInEnv):
25056
(releaseCharactersForJStringInEnv):
25057
* bindings/jni/jni_utility.h:
25058
* bindings/runtime.cpp:
25059
(Instance::createBindingForLanguageInstance):
25060
* bindings/runtime.h:
25061
(Bindings::Instance::):
25063
2003-11-18 Richard Williamson <rjw@apple.com>
25065
More live connect stubs. We're getting close.
25069
* JavaScriptCore.pbproj/project.pbxproj:
25070
* bindings/jni/jni_runtime.cpp:
25071
(JavaClass::JavaClass):
25072
(JavaInstance::JavaInstance):
25073
(JavaInstance::~JavaInstance):
25074
* bindings/jni/jni_runtime.h:
25075
(Bindings::JavaConstructor::value):
25076
(Bindings::JavaField::value):
25077
(Bindings::JavaMethod::value):
25078
(Bindings::JavaClass::_commonDelete):
25079
(Bindings::JavaClass::_commonCopy):
25080
(Bindings::JavaClass::methodNamed):
25081
(Bindings::JavaClass::fieldNamed):
25082
(Bindings::JavaInstance::getClass):
25083
* bindings/runtime.cpp: Added.
25084
* bindings/runtime.h:
25085
(Bindings::Instance::~Instance):
25086
* bindings/runtime_object.cpp: Added.
25087
(RuntimeObjectImp::classInfo):
25088
(RuntimeObjectImp::RuntimeObjectImp):
25089
(RuntimeObjectImp::get):
25090
(RuntimeObjectImp::put):
25091
(RuntimeObjectImp::canPut):
25092
(RuntimeObjectImp::hasProperty):
25093
(RuntimeObjectImp::deleteProperty):
25094
(RuntimeObjectImp::defaultValue):
25095
(RuntimeObjectImp::_initializeClassInfoFromInstance):
25096
* bindings/runtime_object.h: Added.
25097
(KJS::RuntimeObjectImp::setInternalInstance):
25098
(KJS::RuntimeObjectImp::getInternalInstance):
25100
(KJS::ObjectImp::get):
25101
(KJS::ObjectImp::hasProperty):
25105
2003-11-17 Maciej Stachowiak <mjs@apple.com>
25107
Patch from Harri, reviewed by me.
25109
- fixed 3487375 - backwards array slice causes infinite loop
25111
* kjs/array_object.cpp:
25112
(ArrayProtoFuncImp::call):
25114
2003-11-17 Maciej Stachowiak <mjs@apple.com>
25116
Patch from Harri Porten reviewed by me.
25118
- fixed 3487371 - operator precedence for bitwise or, xor and and is wrong
25120
* kjs/grammar.y: Correct the precedence.
25122
2003-11-16 Maciej Stachowiak <mjs@apple.com>
25126
- fixed 3483829 - JavaScriptCore needs workaround to compile on Merlot
25128
* JavaScriptCore.pbproj/project.pbxproj: Add -Wno-long-double to
25133
2003-11-13 Richard Williamson <rjw@apple.com>
25135
Factored common code between copy constructor and assignment operator.
25140
* bindings/jni/jni_runtime.h:
25141
(Bindings::JavaConstructor::_commonCopy):
25142
(Bindings::JavaConstructor::JavaConstructor):
25143
(Bindings::JavaConstructor::operator=):
25144
(Bindings::JavaField::type):
25145
* bindings/runtime.h:
25147
2003-11-13 Richard Williamson <rjw@apple.com>
25149
More LiveConnect stuff. This checkin adds abstract classes to model
25150
language runtimes and a JNI based set of concrete implementations for
25155
* JavaScriptCore.pbproj/project.pbxproj:
25157
* bindings/Makefile.am: Removed.
25158
* bindings/jni/Makefile.am: Removed.
25159
* bindings/jni/jni_runtime.cpp: Added.
25160
(JavaField::JavaField):
25161
(JavaConstructor::JavaConstructor):
25162
(JavaMethod::JavaMethod):
25163
(JavaClass::JavaClass):
25164
* bindings/jni/jni_runtime.h: Added.
25165
(Bindings::JavaString::JavaString):
25166
(Bindings::JavaString::~JavaString):
25167
(Bindings::JavaString::operator=):
25168
(Bindings::JavaString::characters):
25169
(Bindings::JavaParameter::JavaParameter):
25170
(Bindings::JavaParameter::~JavaParameter):
25171
(Bindings::JavaParameter::operator=):
25172
(Bindings::JavaParameter::type):
25173
(Bindings::JavaConstructor::JavaConstructor):
25174
(Bindings::JavaConstructor::~JavaConstructor):
25175
(Bindings::JavaConstructor::operator=):
25176
(Bindings::JavaConstructor::parameterAt):
25177
(Bindings::JavaConstructor::numParameters):
25178
(Bindings::JavaField::JavaField):
25179
(Bindings::JavaField::~JavaField):
25180
(Bindings::JavaField::operator=):
25181
(Bindings::JavaField::name):
25182
(Bindings::JavaField::type):
25183
(Bindings::JavaMethod::JavaMethod):
25184
(Bindings::JavaMethod::_commonDelete):
25185
(Bindings::JavaMethod::~JavaMethod):
25186
(Bindings::JavaMethod::_commonCopy):
25187
(Bindings::JavaMethod::operator=):
25188
(Bindings::JavaMethod::name):
25189
(Bindings::JavaMethod::returnType):
25190
(Bindings::JavaMethod::parameterAt):
25191
(Bindings::JavaMethod::numParameters):
25192
(Bindings::JavaClass::_commonDelete):
25193
(Bindings::JavaClass::~JavaClass):
25194
(Bindings::JavaClass::_commonCopy):
25195
(Bindings::JavaClass::JavaClass):
25196
(Bindings::JavaClass::operator=):
25197
(Bindings::JavaClass::name):
25198
(Bindings::JavaClass::methodAt):
25199
(Bindings::JavaClass::numMethods):
25200
(Bindings::JavaClass::constructorAt):
25201
(Bindings::JavaClass::numConstructors):
25202
(Bindings::JavaClass::fieldAt):
25203
(Bindings::JavaClass::numFields):
25204
* bindings/jni/jni_utility.cpp:
25207
(callJNIObjectMethod):
25208
(callJNIByteMethod):
25209
(callJNICharMethod):
25210
(callJNIShortMethod):
25211
(callJNIIntMethod):
25212
(callJNILongMethod):
25213
(callJNIFloatMethod):
25214
(callJNIDoubleMethod):
25215
(callJNIVoidMethodA):
25216
(callJNIObjectMethodA):
25217
(callJNIByteMethodA):
25218
(callJNICharMethodA):
25219
(callJNIShortMethodA):
25220
(callJNIIntMethodA):
25221
(callJNILongMethodA):
25222
(callJNIFloatMethodA):
25223
(callJNIDoubleMethodA):
25224
(getCharactersFromJString):
25225
(releaseCharactersForJString):
25226
* bindings/jni/jni_utility.h:
25227
* bindings/objc/Makefile.am: Removed.
25228
* bindings/runtime.h: Added.
25229
(Bindings::Parameter::~Parameter):
25230
(Bindings::Constructor::~Constructor):
25231
(Bindings::Field::~Field):
25232
(Bindings::Method::~Method):
25233
(Bindings::Class::~Class):
25235
2003-11-13 Maciej Stachowiak <mjs@apple.com>
25239
- fixed 3472562 - Null or Undefined variables passed to IN operator cause javascript exceptions
25242
(ForInNode::execute): If the in value is null or undefined, bail
25243
out early, since attempting to iterate its properties will throw
25246
2003-11-12 Darin Adler <darin@apple.com>
25250
* Makefile.am: Fix the build by removing the bindings directory from SUBDIRS.
25251
Later, we can either add this back and add the Makefile.am files to the top
25252
level configure.in or leave it out and remove the Makefile.am files.
25254
2003-11-12 Richard Williamson <rjw@apple.com>
25256
Added utility functions for calling JNI methods.
25260
* JavaScriptCore.pbproj/project.pbxproj:
25262
* bindings/Makefile.am: Added.
25263
* bindings/jni/Makefile.am: Added.
25264
* bindings/jni/jni_utility.cpp: Added.
25267
(callJNIVoidMethod):
25268
(callJNIObjectMethod):
25269
(callJNIByteMethod):
25270
(callJNICharMethod):
25271
(callJNIShortMethod):
25272
(callJNIIntMethod):
25273
(callJNILongMethod):
25274
(callJNIFloatMethod):
25275
(callJNIDoubleMethod):
25276
* bindings/jni/jni_utility.h: Added.
25277
* bindings/objc/Makefile.am: Added.
25279
2003-11-08 Darin Adler <darin@apple.com>
25283
- fixed 3477528 -- array.sort(function) fails if the function returns a non-zero value that rounds to zero
25285
* kjs/array_object.cpp:
25286
(compareByStringForQSort): Added checks for undefined values to match what the specification calls for.
25287
(compareWithCompareFunctionForQSort): Added checks for undefined values as above, and also changed the
25288
code that looks at the compare function result to look at the number returned without rounding to an integer.
25289
(ArrayProtoFuncImp::call): Changed the code that looks at the compare function result to look at the number
25290
returned without rounding to an integer.
25294
2003-11-03 Vicki Murley <vicki@apple.com>
25296
Reviewed by kocienda.
25298
- fixed <rdar://problem/3471096>: non-B&I builds should not use order files, because they cause false "regressions" in perf.
25300
* JavaScriptCore.pbproj/project.pbxproj: added empty SECTORDER_FLAGS variables to the Development and Deployment build styles
25302
2003-11-02 Darin Adler <darin@apple.com>
25304
Reviewed by Maciej.
25306
- changed list manipulation to use Harri Porten's idea of a circular
25307
linked list that is built from head to tail rather than building the
25308
list backwards and reversing the list when done
25310
* kjs/grammar.y: Handle CatchNode and FinallyNode in a type-safe way.
25311
Change many places that passed 0L to pass nothing at all, or to pass 0.
25314
(KJS::ElementNode::ElementNode): Build a circular list instead of a 0-terminated
25316
(KJS::ArrayNode::ArrayNode): Break the circular list instead of reversing the list.
25317
(KJS::PropertyValueNode::PropertyValueNode): Moved before ObjectLiteralNode so the
25318
inline code in ObjectLiteralNode works. Build a circular list instead of a 0-terminated
25319
backwards list. Made the case for the first node separate so we don't need a nil check.
25320
(KJS::ObjectLiteralNode::ObjectLiteralNode): Break the circular list instead of
25321
reversing the list.
25322
(KJS::ArgumentListNode::ArgumentListNode): Build a circular list instead of a 0-terminated
25323
backwards list. Also, made the constructors inline (moved here from .cpp file).
25324
(KJS::ArgumentsNode::ArgumentsNode): Break the circular list instead of
25325
reversing the list.
25326
(KJS::NewExprNode::NewExprNode): Changed a 0L to 0.
25327
(KJS::StatListNode::StatListNode): Make this constructor no longer inline (moved into
25328
.cpp file). The one in the .cpp file builds a circular list instead of a 0-terminated
25330
(KJS::VarDeclListNode::VarDeclListNode): Build a circular list instead of a 0-terminated
25332
(KJS::VarStatementNode::VarStatementNode): Break the circular list instead of reversing
25334
(KJS::BlockNode::BlockNode): Make this constructor no longer inline (moved into .cpp file).
25335
The one in the .cpp file breaks the list instead of reversing it.
25336
(KJS::ForNode::ForNode): Break the circular list instead of reversing the list.
25337
(KJS::CaseClauseNode::CaseClauseNode): Break the circular list instead of reversing the
25339
(KJS::ClauseListNode::ClauseListNode): Build a circular list instead of a 0-terminated
25341
(KJS::CaseBlockNode::CaseBlockNode): Make this constructor no longer inline (moved into
25342
.cpp file). The one in the .cpp file breaks the list instead of reversing it.
25343
(KJS::TryNode::TryNode): Changed constructor to take typed parameters for the catch and
25344
finally nodes rather than just Node.
25345
(KJS::ParameterNode::ParameterNode): Build a circular list instead of a 0-terminated
25347
(KJS::FuncDeclNode::FuncDeclNode): Break the circular list instead of reversing the
25349
(KJS::FuncExprNode::FuncExprNode): Break the circular list instead of reversing the
25353
(StatListNode::StatListNode): Moved this constructor here, no longer inline.
25354
Did the "break circular list" thing instead of the "reverse list" thing.
25355
Added setLoc calls to match KJS in the KDE tree; since we don't currently
25356
use the JavaScript debugging support, it's unclear whether there's any benefit, but
25357
later we might be using it and it's good to be as close as possible.
25358
(BlockNode::BlockNode): Moved this constructor here, no longer inline.
25359
Did the "break circular list" thing instead of the "reverse list" thing.
25360
Added setLoc calls.
25361
(CaseBlockNode::CaseBlockNode): Moved this constructor here, no longer inline.
25362
Did the "break circular list" thing instead of the "reverse list" thing.
25363
(SourceElementsNode::SourceElementsNode): Moved this constructor here, no longer inline.
25364
Did the "break circular list" thing instead of the "reverse list" thing.
25365
Added setLoc calls.
25367
* kjs/grammar.cpp: Regenerated.
25368
* kjs/grammar.cpp.h: Regenerated.
25369
* kjs/grammar.h: Regenerated.
25373
2003-10-30 Maciej Stachowiak <mjs@apple.com>
25377
- fixed 3427069 - browsing mp3.com causes leaks (KJS)
25379
* kjs/string_object.cpp:
25380
(StringProtoFuncImp::call): Don't do an early return, since that
25381
could leak a temporary regexp.
25383
2003-10-29 Maciej Stachowiak <mjs@apple.com>
25387
- fixed 3426076 - Leak of JS lexer data visiting http://www.ebay.com
25390
(yyerror): Updated the commented code.
25391
* kjs/grammar.y: Don't delete string and identifier tokens when done
25392
with them any more, they'll get cleaned up by the lexer now.
25393
* kjs/internal.cpp:
25394
(Parser::parse): Tell lexer when done parsing.
25396
(Lexer::Lexer): Initialize new data members.
25397
(Lexer::lex): Use new methods to make strings and identifiers, and
25399
(Lexer::makeIdentifier): Make a new Identifier and save it in an
25400
auto-growing array.
25401
(Lexer::makeUString): Likewise for UStrings.
25402
(Lexer::doneParsing): Clean up arrays of Ifentifiers and UStrings.
25405
2003-10-28 Maciej Stachowiak <mjs@apple.com>
25409
- fixed 3413962 - malicious web pages can kill all future JavaScript execution by breaking recursion limit check
25412
(FunctionCallNode::evaluate): If we're going to return early due
25413
to breaking the recursion limit, make sure to lower it again, or
25414
it will creep up by one each time it's exceeded.
25416
2003-10-26 Darin Adler <darin@apple.com>
25418
* JavaScriptCorePrefix.h: Added a C case to the NULL definition since we use C as well
25419
as C++ in this project.
25421
2003-10-26 Darin Adler <darin@apple.com>
25423
- rolled in some CString changes Harri Porten did on the KDE side
25426
(KJS::CString::CString): Use memcpy instead of strcpy for speed. Fix an off by one error
25427
in the copy constructor.
25428
(KJS::CString::operator=): Use memcpy instead of strcpy for speed.
25430
* JavaScriptCorePrefix.h: Add a definition of NULL here that takes advantage of the GNU
25431
__null feature even if the system C library doesn't.
25433
== Rolled over to ChangeLog-2003-10-25 ==