]> git.saurik.com Git - apple/javascriptcore.git/blame - ChangeLog-PEP-2009-02-25
JavaScriptCore-1218.tar.gz
[apple/javascriptcore.git] / ChangeLog-PEP-2009-02-25
CommitLineData
93a37866
A
12009-02-23 David Kilzer <ddkilzer@apple.com>
2
3 Sync up FEATURE_DEFINES_iphoneos across all projects
4
5 * Configurations/JavaScriptCore.xcconfig: Added ENABLE_PLUGIN_PROXY_FOR_VIDEO
6 and ENABLE_TOUCH_EVENTS to FEATURE_DEFINES_iphoneos.
7
82009-02-23 David Kilzer <ddkilzer@apple.com>
9
10 Move ENABLE_VIDEO to FEATURE_DEFINES_BASE
11
12 * Configurations/JavaScriptCore.xcconfig:
13
142009-02-23 Eric Carlson <eric.carlson@apple.com>
15
16 Reviewed by Antti Koivisto.
17
18 <rdar://problem/6179001> TLF: add support for media tags <audio> and <video> (fullscreen)
19
20 * Configurations/JavaScriptCore.xcconfig: Turn on video.
21
222009-02-18 David Kilzer <ddkilzer@apple.com>
23
24 <rdar://problem/6370582> Change JavaScriptCore to build armv6/armv7 with dwarf debugging symbols
25
26 Reviewed by David Carson.
27
28 * Configurations/Base.xcconfig: Backed out r70644 now that
29 the gcc issue is fixed. All architectures build with dwarf
30 debugging symbols again.
31
322009-02-18 David Kilzer <ddkilzer@apple.com>
33
34 Clean up JavaScriptCore build configurations
35
36 Rubber-stamped by Brad Moore.
37
38 The Development_Hardware configuration was building for i386 with
39 ARCHS = $(NATIVE_ARCH) in DebugRelease.xcconfig.
40
41 * Configurations/Base.xcconfig: Moved ARCHS to DebugRelease.xcconfig
42 to match ToT WebKit.
43 * Configurations/DebugRelease.xcconfig: Moved ARCHS definitions to
44 here from Base.xcconfig.
45 * JavaScriptCore.xcodeproj/project.pbxproj: Made Deployment and
46 Deployment_Hardware configurations based on DebugRelease.xcconfig
47 instead of Base.xcconfig to match Release configuration on ToT WebKit.
48
492009-02-16 David Kilzer <ddkilzer@apple.com>
50
51 <rdar://problem/6579438> Disable JIT in Simulator
52
53 Reviewed by Paul Knight.
54
55 * wtf/Platform.h: Defined ENABLE_JIT to 0 for PLATFORM(IPHONE),
56 which covers both the hardware and the simulator.
57
582009-02-16 Yosen Lin <yosen@apple.com>
59
60 <rdar://problem/6417393> Change the way webkit returns memory to the system
61
62 Reviewed by Antti Koivisto.
63
64 Switch from using mmap to using madvise to release memory. The original mmap was not
65 impacting the Jetsam level.
66
67 * wtf/TCSystemAlloc.cpp
68 * wtf/Platform.h
69
702009-02-13 David Kilzer <ddkilzer@apple.com>
71
72 <rdar://problem/6082835> Safari 4.0 WebKit integration (Hurricane)
73
74 Merged ToT WebKit r35512-r40289 into iPhone WebKit.
75
76 18523 files changed, 607561 insertions(+), 284589 deletions(-)
77
782009-01-20 David Kilzer <ddkilzer@apple.com>
79
80 <rdar://problem/6486661> Move GCC_PREPROCESSOR_DEFINITIONS from Xcode project files to xcconfig files
81
82 Reviewed by George Dicker.
83
84 Backed out r75895 and let Xcode have its way with the file.
85
86 * JavaScriptCore.xcodeproj/project.pbxproj: Removed
87 GCC_PREPROCESSOR_DEFINITIONS.
88
892009-01-14 David Kilzer <ddkilzer@apple.com>
90
91 Bug 23153: JSC build always touches JavaScriptCore/docs/bytecode.html
92
93 Merged ToT WebKit r39931.
94
95 Changes to make-bytecode-docs.pl were backed out since DEFINE_OPCODE
96 is not used used. Changes to DerivedSources.make were altered to use
97 the correct source file (Machine.cpp instead of Interpreter.cpp).
98
99 2009-01-14 David Kilzer <ddkilzer@apple.com>
100
101 Bug 23153: JSC build always touches JavaScriptCore/docs/bytecode.html
102
103 <https://bugs.webkit.org/show_bug.cgi?id=23153>
104
105 Reviewed by Darin Adler.
106
107 Instead of building bytecode.html into ${SRCROOT}/docs/bytecode.html, build it
108 into ${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore/docs/bytecode.html.
109
110 Also fixes make-bytecode-docs.pl to actually generate documentation.
111
112 * DerivedSources.make: Changed bytecode.html to be built into local docs
113 directory in ${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore.
114 * JavaScriptCore.xcodeproj/project.pbxproj: Added "/docs" to the end of the
115 "mkdir -p" command so that the docs subdirectory is automatically created.
116 * docs/make-bytecode-docs.pl: Changed BEGIN_OPCODE to DEFINE_OPCODE so that
117 documentation is actually generated.
118
1192009-01-09 David Kilzer <ddkilzer@apple.com>
120
121 <rdar://problem/6485313> JavaScriptCore Tests: jsc built in Deployment/Simulator configuration hangs on ecma/Expressions/11.1.1.js
122
123 The previous commit also fixed the hung JavaScript test.
124
125 * tests/mozilla/ecma/Expressions/11.1.1.js: Renamed from JavaScriptCore/tests/mozilla/ecma/Expressions/11.1.1.js-disabled.
126
1272009-01-09 David Kilzer <ddkilzer@apple.com>
128
129 <rdar://problem/6485313> JavaScriptCore Tests: jsc built in Deployment/Simulator configuration hangs on ecma/Expressions/11.1.1.js
130
131 Reverted part of r75682 that was merged for ToT WebKit r35151.
132 The NDEBUG macro was not being defined on Deployment builds for
133 the iPhone Simulator, which caused all sorts of weird problems.
134
135 * JavaScriptCore.xcodeproj/project.pbxproj: Moved definition of
136 GCC_PREPROCESSOR_DEFINITIONS back into project file.
137
1382009-01-09 pknight <set EMAIL_ADDRESS environment variable>
139
140 Reviewed by NOBODY (OOPS!).
141
142 Disable the ecma/Expressions/11.1.1.js test as it is hanging jsc when built in the Deployment/Simulator configuration (<rdar://problem/6485313>)
143
144 * tests/mozilla/ecma/Expressions/11.1.1.js: Removed.
145 * tests/mozilla/ecma/Expressions/11.1.1.js-disabled: Copied from JavaScriptCore/tests/mozilla/ecma/Expressions/11.1.1.js.
146
1472009-01-08 David Kilzer <ddkilzer@apple.com>
148
149 <rdar://problem/6082835> Safari 4.0 WebKit integration (Jetstream)
150
151 Merged ToT WebKit r34504-r35511 into iPhone WebKit.
152
153 5033 files changed, 130341 insertions(+), 63984 deletions(-)
154
1552008-12-24 David Kilzer <ddkilzer@apple.com>
156
157 <rdar://problem/6082835> Safari 4.0 WebKit integration (Jetstream)
158
159 Merged ToT WebKit r33979-r34503 into iPhone WebKit.
160
161 The Squirrelfish has landed!!
162
1632008-12-02 David Kilzer <ddkilzer@apple.com>
164
165 <rdar://problem/6413288> Missing properties when enumerating built-in DOM objects
166
167 Reviewed by ToT WebKit Layout Tests.
168
169 The following ToT WebKit Layout Tests failed before this bug was
170 fixed:
171 - fast/dom/domListEnumeration.html
172 - fast/dom/plugin-attributes-enumeration.html
173 - fast/dom/xmlhttprequest-get.xhtml
174 - fast/dom/Window/window-appendages-cleared.html
175 - fast/dom/Window/window-properties.html
176 - fast/js/global-constructors.html
177 - fast/js/regexp-caching.html
178
179 * kjs/object.cpp:
180 (KJS::JSObject::getPropertyNames): The size of the compact hash
181 table is table->compactSize, not table->compactHashSizeMask. (We
182 use table->compactSize - 1 due to the condition in the for loop.)
183 This bug caused some properties of built-in DOM objects to be missed
184 when they were enumerated via JavaScript.
185
1862008-11-25 Chris Fleizach <cfleizach@apple.com>
187
188 <rdar://problem/6401430> WebCore needs AX turned on (using iphone AX model)
189
190 Reviewed by David Kilzer.
191
192 * wtf/Platform.h:
193
1942008-11-20 Aaron Golden <agolden@apple.com>
195
196 Reviewed by David Kilzer.
197
198 Bringing in the isASCIIOctalDigit function, and some related functions for <rdar://problem/6177286> TLF: Anti-phishing (safari).
199
200 * wtf/ASCIICType.h:
201 (WTF::isASCIIOctalDigit):
202
2032008-11-13 Yosen Lin <yosen@apple.com>
204
205 <rdar://problem/6333993> Reduce HashTable memory that increased with TOT WebKit merge
206
207 Reviewed by David Kilzer.
208
209 Initial patch by Yosen Lin, with variable rename tweaks and one bug
210 fix by me.
211
212 Basically, we're adding back the code that generates a "compact"
213 hash (instead of a perfect hash) to save memory on iPhone WebKit. I
214 added an ENABLE(PERFECT_HASH_SIZE) macro in lookup.h to turn the
215 perfect hash size code on and off.
216
217 * kjs/create_hash_table:
218 * kjs/lookup.cpp:
219 (KJS::HashTable::createTable):
220 * kjs/lookup.h:
221 (KJS::HashTable::entry):
222 * kjs/object.cpp:
223 (KJS::JSObject::getPropertyNames):
224
2252008-11-09 David Kilzer <ddkilzer@apple.com>
226
227 <rdar://problem/6082835> Safari 4.0 WebKit integration (Hurricane)
228
229 Merged ToT WebKit r33001-r33978.
230
2312008-11-08 David Kilzer <ddkilzer@apple.com>
232
233 <rdar://problem/6355708> REGRESSION: Static initializer in JavaScriptCore_Sim Deployment build
234
235 Reviewed by NOBODY (BUILD FIX).
236
237 * JavaScriptCore.xcodeproj/project.pbxproj: Restore
238 GCC_PREPROCESSOR_DEFINITIONS variable settings that were removed in
239 r70905. This removes the static initializer from AllInOneFile.o but
240 leaves NDEBUG defined in Deployment builds of testkjs.
241
2422008-11-06 David Kilzer <ddkilzer@apple.com>
243
244 <rdar://problem/6250281> Sunspider test sometimes fails
245
246 Reviewed by Greg Bolsinga.
247
248 JavaScriptCore.framework was being built with -DNDEBUG for
249 Deployment and Production builds, but testkjs was not, causing a
250 difference in the size of the JSGlobalObjectData structure between
251 testkjs and the framework. This was fixed by setting DEBUG_DEFINES
252 consistently across all targets.
253
254 * Configurations/Base.xcconfig: Set DEBUG_DEBUGS based on the
255 current BUILD_TYPE. Only set NDEBUG for Release and Production
256 build types.
257 * JavaScriptCore.xcodeproj/project.pbxproj: Remove all DEBUG_DEFINES
258 and GCC_PREPROCESSOR_DEFINITIONS settings since they're defined in
259 Base.xcconfig already.
260
2612008-11-05 David Kilzer <ddkilzer@apple.com>
262
263 <rdar://problem/6343665> scripter crashes when calling parseFloat from JavaScript
264
265 Merged ToT WebKit r32808.
266
267 2008-05-02 Alexey Proskuryakov <ap@webkit.org>
268
269 Reviewed by Darin.
270
271 Make JavaScriptGlue and JavaScriptCore API functions implicitly call initializeThreading
272 for the sake of non-WebKit clients.
273
274 * API/JSBase.cpp:
275 (JSGarbageCollect):
276 * API/JSContextRef.cpp:
277 (JSGlobalContextCreate):
278 These are the JavaScriptCore API bottlenecks. There are a few other JSStringRef
279 and JSClassRef functions that can be called earlier, but they do not do anything that
280 requires initializeThreading.
281
282 * kjs/InitializeThreading.cpp:
283 (KJS::doInitializeThreading):
284 (KJS::initializeThreading):
285 On Darwin, make the initialization happen under pthread_once, since there is no guarantee
286 that non-WebKit clients won't try to call this function re-entrantly.
287
288 * kjs/InitializeThreading.h:
289 * wtf/Threading.h:
290 Spell out initializeThreading contract.
291
292 * wtf/ThreadingPthreads.cpp: (WTF::isMainThread): Make sure that results are correct on
293 Darwin, even if threading was initialized from a secondary thread.
294
2952008-11-04 David Kilzer <ddkilzer@apple.com>
296
297 <rdar://problem/6342374> Update JavaScriptCore, WebCore, WebKit xcconfig files for armv7
298
299 Reviewed by Greg Bolsinga.
300
301 * Configurations/Base.xcconfig: Set DEBUG_INFORMATION_FORMAT to
302 dwarf for all architectures. Always set
303 GCC_GENERATE_DEBUGGING_SYMBOLS to YES for both armv6 and armv7.
304 * Configurations/JavaScriptCore.xcconfig: Define
305 EXPORTED_SYMBOLS_FILE_armv7 so we don't export every symbol when
306 building for armv7.
307
3082008-10-30 Greg Bolsinga <bolsinga@apple.com>
309
310 Reviewed by David Kilzer
311
312 <rdar://problem/5780286> Need a JavaScript location API for the web
313
314 1. Bring over:
315 http://trac.webkit.org/changeset/37854
316 https://bugs.webkit.org/show_bug.cgi?id=21966
317 https://bugs.webkit.org/show_bug.cgi?id=21967
318 2. Get GeolocationServiceCoreLocation into the build, load CoreLocation dynamically
319 3. Suspend/Resume Safari and switching Safari tabs will start/stop CoreLocation, if needed.
320 4. Update to the spec as of October 27, 2008
321
322 * Configurations/JavaScriptCore.xcconfig:
323 * wtf/Platform.h:
324
3252008-10-30 David Kilzer <ddkilzer@apple.com>
326
327 Removed -Wno-strict-aliasing gcc switch from iPhone builds.
328
329 iPhone WebKit r69976 fixed the remaining known strict aliasing issues
330 in WebKit, so we should no longer ignore strict aliasing warnings.
331
332 * Configurations/Base.xcconfig: Removed -Wno-strict-aliasing from
333 WARNING_CFLAGS_iphoneos.
334
3352008-10-27 David Kilzer <ddkilzer@apple.com>
336
337 <rdar://problem/6082320> JavaScriptCore should use default compiler instead of hard coding 4.0
338
339 Reviewed by Greg Bolsinga.
340
341 * JavaScriptCore.xcodeproj/project.pbxproj: Removed build rules
342 forcing the use of gcc-4.0.
343
3442008-10-14 Antti Koivisto <antti@apple.com>
345
346 Reviewed by Dave Kilzer.
347
348 <rdar://problem/6289874> FastMalloc does not return memory back to system fast enough.:
349
350 - try to return a memory span per every 64 pages (256KB) freed instead of 256 pages (1MB)
351 - allow the return rate to increase faster when the the amount of returnable memory grows
352
353 Over a run of google.com, apple.com, nytimes.com, washingtonpost.com and back to google.com this
354 reduces our resident size by ~4MB.
355
356 * wtf/FastMalloc.cpp:
357 (WTF::TCMalloc_PageHeap::IncrementalScavenge):
358
3592008-09-11 Andre Boule <aboule@apple.com>
360
361 Reviewed by agolden.
362 <rdar://problem/6132467> iPhone 2.x fails to load movies from Leopard wiki server
363 Merged the fix from TOT:
364 <rdar://problem/5934376> REGRESSION (r33379-r33416): Cannot disclose edit history in Leopard Wiki at safari.apple.com
365 http://trac.webkit.org/changeset/33443
366 2008-05-14 Alexey Proskuryakov <ap@webkit.org>
367
368 Reviewed by Darin.
369
370 <rdar://problem/5934376> REGRESSION: A script fails because of a straw BOM character in it.
371
372 <https://bugs.webkit.org/show_bug.cgi?id=4931>
373 Unicode format characters (Cf) should be removed from JavaScript source
374
375 Of all Cf characters, we are only removing BOM, because this is what Firefox trunk has
376 settled upon, after extensive discussion and investigation.
377
378 Based on Darin's work on this bug.
379
380 Test: fast/js/removing-Cf-characters.html
381
382 * kjs/lexer.cpp:
383 (KJS::Lexer::setCode): Tweak formatting. Use a call to shift(4) to read in the
384 first characters, instead of having special case code here.
385 (KJS::Lexer::shift): Add a loop when reading a character to skip BOM characters.
386
3872008-08-29 David Kilzer <ddkilzer@apple.com>
388
389 <rdar://problem/6177996> Remove JSLockC.h and implementation in JSLock.cpp
390
391 Reviewed by Greg.
392
393 * JavaScriptCore.exp: Updated export symbols.
394 * JavaScriptCore.xcodeproj/project.pbxproj: Removed references to JSLockC.h.
395 * kjs/JSLock.cpp:
396 (JSLockDropAllLocks): Removed.
397 (JSLockRecoverAllLocks): Removed.
398 (JSJavaScriptCollectionThread): Removed. Moved to KJS::Collector.
399 (JSSetJavaScriptCollectionThread): Ditto.
400 * kjs/JSLockC.h: Removed.
401 * kjs/collector.cpp:
402 (KJS::onMainThread): Updated to use Collector::javaScriptCollectionThread()
403 instead of JSJavaScriptCollectionThread().
404 (KJS::Collector::javaScriptCollectionThread): Added. Replaces
405 JSJavaScriptCollectionThread().
406 (KJS::Collector::setJavaScriptCollectionThread): Added. Replaces
407 JSSetJavaScriptCollectionThread().
408 * kjs/collector.h: Added definitions for javaScriptCollectionThread()
409 and setJavaScriptCollectionThread().
410
4112008-08-27 David Kilzer <ddkilzer@apple.com>
412
413 <rdar://problem/6157731> JavaScriptCore shouldn't set VALID_ARCHS
414
415 * Configurations/Base.xcconfig: Removed VALID_ARCHS. Left ToT WebKit
416 line as a comment.
417
4182008-08-26 Greg Bolsinga <bolsinga@apple.com>
419
420 Reviewed by Dave Kilzer
421
422 <rdar://problem/6159366> Safari on iPodTouch (32G) crashes on specific web page
423
424 In the latest JavaScriptCore, there is already thread safe drop/recover all locks
425 functionality. Use this for the SPI JSLockDrop/RecoverAllLocks instead of an
426 alternate implementation.
427
428 * kjs/JSLock.cpp:
429 * kjs/JSLockC.h:
430
4312008-08-25 David Kilzer <ddkilzer@apple.com>
432
433 Let Xcode have it's way with JavaScriptCore.
434
435 * JavaScriptCore.xcodeproj/project.pbxproj: Xcode removed redundant
436 "name" parameters when the "path" parameters matched.
437
4382008-07-29 David Kilzer <ddkilzer@apple.com>
439
440 <rdar://problem/6109759> Can't build iPhone WebKit with Debug builds of Desktop WebKit in symroots
441
442 Reviewed by Greg.
443
444 Some generated files had relative paths to Debug builds of open
445 source WebKit, which caused mysterious build failures for iPhone
446 WebKit when debug builds of open source WebKit were in the same
447 symroots directory.
448
449 * JavaScriptCore.xcodeproj/project.pbxproj: Removed relative paths.
450
4512008-07-10 David Kilzer <ddkilzer@apple.com>
452
453 <rdar://problem/6047765> Get testkjs binary from JavaScriptCore in internal installs
454
455 Reviewed by George Dicker.
456
457 For the Production_Hardware configuration of the testkjs target, we
458 set SKIP_INSTALL to NO so that it's installed in /usr/local/bin.
459 This fixes the bug.
460
461 For the Production_Deployment configuration of the minidom, testapi
462 and testkjs targets, we also set the INSTALL_PATH_ACTUAL to
463 "/usr/local/bin" (in case we want to install them later) and set
464 SKIP_INSTALL to YES (either of which may have also fixed
465 <rdar://problem/6030878>).
466
467 This allows B&I to use the "All" target for both hardware and
468 simulator builds again.
469
470 * JavaScriptCore.xcodeproj/project.pbxproj:
471
4722008-07-08 David Kilzer <ddkilzer@apple.com>
473
474 releaseFastMallocFreeMemory() should always be defined
475
476 Merged ToT WebKit r35055.
477
478 This fixes a compile failure when defining USE_SYSTEM_MALLOC with
479 Development[_Hardware] builds of iPhone WebKit.
480
481 2008-07-07 David Kilzer <ddkilzer@apple.com>
482
483 releaseFastMallocFreeMemory() should always be defined
484
485 Reviewed by Darin.
486
487 * JavaScriptCore.exp: Changed to export C++ binding for
488 WTF::releaseFastMallocFreeMemory() instead of C binding for
489 releaseFastMallocFreeMemory().
490 * wtf/FastMalloc.cpp: Moved definitions of
491 releaseFastMallocFreeMemory() to be in the WTF namespace
492 regardless whether FORCE_SYSTEM_MALLOC is defined.
493 * wtf/FastMalloc.h: Moved releaseFastMallocFreeMemory() from
494 extern "C" binding to WTF::releaseFastMallocFreeMemory().
495
4962008-06-18 Andre Boule <aboule@apple.com>
497
498 Reviewed by me.
499 Enabling SVG.
500 <rdar://problem/5452283> TLF: SVG support (incl scripting)
501
502 * Configurations/JavaScriptCore.xcconfig:
503
5042008-06-16 Greg Bolsinga <bolsinga@apple.com>
505
506 Reviewed by cblu
507
508 <rdar://problem/6005303> JavaScriptCore_Sim-462 fails to build, TARGET_OS_IPHONE is not defined
509
510 minidom, testapi, testkjs need to have base configurations to build in B&I.
511
512 * JavaScriptCore.xcodeproj/project.pbxproj:
513
5142008-06-05 Greg Bolsinga <bolsinga@apple.com>
515
516 Reviewed by Dave Kilzer
517
518 <rdar://problem/5828262> Use Opal's PLATFORM_NAME
519
520 Replace use of home grown CURRENT_PLATFORM with PLATFORM_NAME and its values.
521
522 * Configurations/Base.xcconfig:
523 * Configurations/JavaScriptCore.xcconfig:
524 * Configurations/Soil.xcconfig:
525 * JavaScriptCore.xcodeproj/project.pbxproj:
526
5272008-05-29 David Kilzer <ddkilzer@apple.com>
528
529 <rdar://problem/5973520> iPhone: Crash when assigning Array (19294)
530
531 Merged ToT WebKit r34204, r34205.
532
533 --- Submission Information ---
534 - Risk level: Low
535 - Risk details: Merged tip-of-tree WebKit fix that hasn't been in the tree
536 very long.
537 - Code reviewed by: Darin Adler. Patch by Alexey Proskuryakov.
538 - Testing details: Tested root on BigBear5A314 to verify test case is fixed and
539 that basic browsing is unaffected.
540
541 2008-05-29 Steve Falkenburg <sfalken@apple.com>
542
543 Build fix.
544
545 * kjs/array_instance.cpp:
546
547 2008-05-29 Alexey Proskuryakov <ap@webkit.org>
548
549 Reviewed by Darin.
550
551 https://bugs.webkit.org/show_bug.cgi?id=19294
552 <rdar://problem/5969062> A crash when iterating over a sparse array backwards.
553
554 * kjs/array_instance.cpp: Turned sparseArrayCutoff into a macro, so that using max() on it
555 doesn't cause a PIC branch.
556 (KJS::ArrayInstance::increaseVectorLength): Added a comment about this function not
557 preserving class invariants.
558 (KJS::ArrayInstance::put): Update m_storage after reallocation. Move values that fit to
559 the vector from the map in all code paths.
560
5612008-05-24 David Kilzer <ddkilzer@apple.com>
562
563 <rdar://problem/5951108> FastMalloc should be connected to jetsam warnings to free available memory
564
565 Merged ToT WebKit r34028.
566
567 --- Submission Information ---
568 - Risk level: Low
569 - Risk details: Added new method to call into FastMalloc to release its free pages.
570 - Code reviewed by: Maciej Stachowiak and Mark Rowe.
571 - Testing details: Tested by running iExploder on BigBear5A2797 with this enabled.
572 This configuration causes multiple jetsam logs before MobileSafari is forced to
573 quit due to bugs that caused content to be cached at the CFNetwork layer. Also
574 verified by living on a BigBear5A301 root overnight.
575
576 2008-05-22 David Kilzer <ddkilzer@apple.com>
577
578 <rdar://problem/5954233> Add method to release free memory from FastMalloc
579
580 Patch suggested by Mark Rowe. Rubber-stamped by Maciej.
581
582 * JavaScriptCore.exp: Export _releaseFastMallocFreeMemory.
583 * wtf/FastMalloc.cpp:
584 (WTF::TCMallocStats::): Added releaseFastMallocFreeMemory() for both
585 system malloc and FastMalloc code paths.
586 * wtf/FastMalloc.h: Define releaseFastMallocFreeMemory().
587
5882008-05-22 David Kilzer <ddkilzer@apple.com>
589
590 <rdar://problem/5952961> iPhone: Integer overflow in JavaScript arguments object property lookup
591
592 Merged ToT WebKit r33972.
593
594 --- Submission Information ---
595 - Risk level: Low
596 - Risk details: Changed index variable from 'int' to 'unsigned'.
597 - Code reviewed by: Anders Carlsson. Patch by Darin Adler.
598 - Testing details: Ran patch against JavaScriptCore tests with no regressions.
599 Tested root on device to verify that orignal bug is fixed.
600
601 2008-05-21 Darin Adler <darin@apple.com>
602
603 Reviewed by Anders.
604
605 - fix <rdar://problem/5952721> bug in JavaScript arguments object property lookup
606
607 Test: fast/js/arguments-bad-index.html
608
609 * kjs/function.cpp:
610 (KJS::IndexToNameMap::IndexToNameMap): Use unsigned instead of int.
611 (KJS::IndexToNameMap::isMapped): Use unsigned instead of int, and also use the
612 strict version of the numeric conversion function, since we don't want to allow
613 trailing junk.
614 (KJS::IndexToNameMap::unMap): Ditto.
615 (KJS::IndexToNameMap::operator[]): Ditto.
616 * kjs/function.h: Changed IndexToNameMap::size type from int to unsigned.
617
6182008-05-15 Greg Bolsinga <bolsinga@apple.com>
619
620 Reviewed by timo
621
622 <rdar://problem/5935292> Layout makes a blocking call for PLT even in Production
623
624 Basically cache the PLT data in WebCore until MobileSafari needs it. This means less
625 cross WebThread / main thread delegate calls. This also prevents layout getting stale
626 during layout, when the main thread invalidates layout, so this also fixes:
627
628 <rdar://problem/5833431> assert in WebCore::FrameView::layout(bool) + 3044 (FrameView.cpp:682)
629
630 * wtf/Platform.h:
631
6322008-05-06 Antti Koivisto <antti@apple.com>
633
634 Merged r30550 from ToT WebKit.
635
636 2008-02-24 Dan Bernstein <mitz@apple.com>
637
638 Reviewed by Darin Adler.
639
640 - fix http://bugs.webkit.org/show_bug.cgi?id=17511
641 REGRESSION: Reproducible crash in SegmentedSubstring::SegmentedSubstring(SegmentedSubstring const&)
642
643 * wtf/Deque.h:
644 (WTF::::expandCapacityIfNeeded): Fixed the case where m_start and m_end
645 are both zero but the buffer capacity is non-zero.
646 (WTF::::prepend): Added validity checks.
647
6482008-05-06 Antti Koivisto <antti@apple.com>
649
650 Merged r30538 from ToT WebKit.
651
652 2008-02-23 Darin Adler <darin@apple.com>
653
654 Reviewed by Anders.
655
656 - http://bugs.webkit.org/show_bug.cgi?id=17496
657 make Deque use a circular array; add iterators
658
659 * wtf/Deque.h: Wrote an all-new version of this class that uses a circular
660 buffer. Growth policy is identical to vector. Added iterators.
661
662 * wtf/Vector.h: Made two small refinements while using this to implement
663 Deque: Made VectorBufferBase derive from Noncopyable, which would have
664 saved me some debugging time if it had been there. Renamed Impl and
665 m_impl to Buffer and m_buffer.
666
6672008-04-29 Greg Bolsinga <bolsinga@apple.com>
668
669 Reviewed by Darin, ddkilzer
670
671 Wrapped Dashboard code with ENABLE(DASHBOARD_SUPPORT)
672 merge of http://trac.webkit.org/changeset/32700
673 <rdar://problem/5871022> 5A254: Safari Crashing (-[WebView(WebPrivate) _addScrollerDashboardRegions:from:])
674
675 * wtf/Platform.h:
676
6772008-04-25 David Kilzer <ddkilzer@apple.com>
678
679 <rdar://problem/5732748> DASH: Wrong line number passed to -willLeaveCallFrame
680
681 Merged ToT WebKit r32578.
682
683 2008-04-25 David Kilzer <ddkilzer@apple.com>
684
685 <rdar://problem/5819422> REGRESSION: Wrong line number passed to -willLeaveCallFrame
686
687 Patch by George Dicker and Michael Kahl. Reviewed by Darin.
688
689 When -[NSObject(WebScriptDebugDelegate) webView:willLeaveCallFrame:sourceId:line:forWebFrame:]
690 is invoked, the first line number of the function is returned instead of the last
691 line number. This regressed in r28458.
692
693 * kjs/nodes.cpp:
694 (KJS::FunctionBodyNodeWithDebuggerHooks::execute): Pass lastLine() instead of lineNo()
695 when calling Debugger::returnEvent().
696
6972008-03-28 David Kilzer <ddkilzer@apple.com>
698
699 <rdar://problem/5826340> iPhone: Safari/PCRE Memory Corruption
700
701 Merged r31388 from ToT WebKit.
702
703 2008-03-27 Darin Adler <darin@apple.com>
704
705 Reviewed by Mark Rowe.
706
707 <rdar://problem/5826236> Regular expressions with large nested repetition counts can have their
708 compiled length calculated incorrectly.
709
710 * pcre/pcre_compile.cpp:
711 (multiplyWithOverflowCheck):
712 (calculateCompiledPatternLength): Check for overflow when dealing with nested repetition counts
713 and bail with an error rather than returning incorrect results.
714
7152008-03-25 Greg Bolsinga <bolsinga@apple.com>
716
717 Reviewed by ddkilzer
718
719 <rdar://problem/5764353> archs
720
721 * Configurations/Base.xcconfig:
722
7232008-03-25 Greg Bolsinga <bolsinga@apple.com>
724
725 Reviewed by ddkilzer
726
727 Use TargetConditionals.h instead of PLATFORM(ARM) to determine iPhoneOS/iPhoneSimulator.
728
729 <rdar://problem/5764353>
730
731 * wtf/Platform.h:
732
7332008-03-25 Greg Bolsinga <bolsinga@apple.com>
734
735 Reviewed by ddkilzer
736
737 Update to use AspenSDK.xcconfig so that SDKROOT is set and /Developer/SDKs/Purple's are removed.
738
739 * Configurations/iPhone.xcconfig: Copied from JavaScriptCore/Configurations/Indigo.xcconfig.
740 * JavaScriptCore.xcodeproj/project.pbxproj:
741
7422008-03-25 David D. Kilzer <ddkilzer@apple.com>
743
744 Backed out r47092 as it broke Xcode 3.0 builds (which don't know about SDKROOT).
745
746 * Configurations/Base.xcconfig:
747 * JavaScriptCore.xcodeproj/project.pbxproj:
748 * wtf/Platform.h:
749
7502008-03-25 David D. Kilzer <ddkilzer@apple.com>
751
752 <rdar://problem/5764353> aspen isn't armv6 only
753
754 Reviewed by Greg.
755
756 * Configurations/Base.xcconfig: Added i386 to VALID_ARCHES_* settings.
757 * JavaScriptCore.xcodeproj/project.pbxproj: Use $(SDKROOT) where appropriate.
758 * wtf/Platform.h: Include TargetConditionals.h for PLATFORM(DARWIN). Use
759 target conditionals to define PLATFORM(IPHONE) and PLATFORM(IPHONE_SIMULATOR).
760
7612008-03-03 Scott Goodson <goodson@apple.com>
762
763 Find-and-replace for ASPEN -> IPHONE as called for by:
764 <rdar://problem/5777581> Change PLATFORM(ASPEN) macro to PLATFORM(IPHONE) in JavaScriptCore/WebCore/WebKit
765
7662008-02-27 David D. Kilzer <ddkilzer@apple.com>
767
768 <rdar://problem/5657178> Enable TCMalloc in JavaScriptCore now that it releases memory
769
770 Reviewed by Andre!
771
772 This changes gives us a ~200ms improvement in the MobileSafari PLT.
773
774 * wtf/FastMalloc.cpp: Removed #defined USE_SYSTEM_MALLOC to enable TCMalloc on Aspen.
775
7762008-02-21 David Kilzer <ddkilzer@apple.com>
777
778 <rdar://problem/5757526> iPhone: REGRESSION (r29425): JavaScript pop-up menu appears at wrong location when hovering image at http://news.chinatimes.com/ (17164)
779
780 Reviewed by Oliver Hunt.
781
782 --- Submission Information---
783 - Risk level: Low.
784 - Risk details: Merged ToT WebKit r29997. Merge was clean modulo
785 whitespace and variable name changes. Issue was well-understood
786 by the Safari team.
787 - Code reviewed by: Oliver Hunt for ToT WebKit.
788 - Testing details: Compiled Deployment_Hardware roots and verified
789 LayoutTests/fast/js/read-modify-eval.html test passed.
790
791 * kjs/nodes.cpp:
792 (KJS::PostIncResolveNode::evaluate):
793 (KJS::ReadModifyLocalVarNode::evaluate):
794 (KJS::ReadModifyResolveNode::evaluate):
795
7962008-02-18 David D. Kilzer <ddkilzer@apple.com>
797
798 <rdar://problem/5746633> Update license headers for files provided as binaries in WebKit open source dump
799
800 Reviewed by Greg Bolsinga.
801
802 --- Submission Information---
803 - Risk level: low
804 - Risk details: Updated copyright and license headers.
805 - Code reviewed by: Greg Bolsinga.
806 - Testing details: Compiled Deployment_Hardware configuration.
807
808 * kjs/JSLockC.h: Removed LGPL license and left Apple copyright statement.
809 Note that this file was previously distributed with open source dumps with
810 the LGPL license attached, although it was originated at Apple.
811
8122008-02-10 Greg Bolsinga <bolsinga@apple.com>
813
814 Reviewed by ddkilzer
815
816 <rdar://problem/5730567> Add FEATURE_DEFINE ENABLE_TOUCH_EVENTS
817
818 Wrap Touch / Gesture event code in ENABLE(TOUCH_EVENTS).
819
820 * wtf/Platform.h:
821
8222008-02-06 Scott Goodson <goodson@apple.com>
823
824 Reviewed by David Kilzer.
825
826 Defined PLATFORM(ASPEN_SIMULATOR) in support of:
827 <rdar://problem/5710529> Change INDIGO macro and some __arm__ macros to PLATFORM(ASPEN_SIMULATOR) in JavaScriptCore/WebCore/WebKit
828
8292008-02-06 Scott Goodson <goodson@apple.com>
830
831 Reviewed by David Kilzer.
832
833 Changed all instances of PLATFORM(IPHONE) to PLATFORM(ASPEN) as requested by:
834
835 <rdar://problem/5710518> Change PLATFORM(IPHONE) macro to PLATFORM(ASPEN) in JavaScriptCore/WebCore/WebKit
836
8372008-01-29 David D. Kilzer <ddkilzer@apple.com>
838
839 Fix file descriptor arguments in TCMalloc mmap() calls
840
841 <rdar://problem/5709236> Enabling TCMalloc causes crash in SpringBoard
842 <rdar://problem/5713347> MERGE: TCMalloc_SystemRelease() should use the same fildes argument as TryMmap()
843
844 Reviewed by Andre.
845
846 NOTE: This does not enable TCMalloc! See <rdar://problem/5657178>.
847
848 The TCMalloc crash was caused by using VM_MEMORY_TCMALLOC instead of
849 VM_MAKE_TAG(VM_MEMORY_TCMALLOC), which was a long-standing coding error
850 in JavaScriptCore (introduced in r10042).
851
852 The merge issue was caused by a new version of TCMalloc being merged into
853 JavaScriptCore from ToT WebKit, which now releases memory through
854 TCMalloc_SystemRelease(). The file descriptor was never changed from -1
855 to match the mmap() argument in TryMmap().
856
857 * wtf/TCSystemAlloc.cpp: Define static constant mmapFileDescriptor.
858 (TryMmap): Replace VM_MEMORY_TCMALLOC argument with mmapFileDescriptor in mmap().
859 (TCMalloc_SystemRelease): Replace -1 argument with mmapFileDescriptor in mmap().
860
8612008-01-11 David D. Kilzer <ddkilzer@apple.com>
862
863 Enabled Xpath and XSLT
864
865 <rdar://problem/5543132> XSLT and XPath support
866 <rdar://problem/5552152> support XPathEvaluator
867
868 Reviewed by Greg.
869
870 * Configurations/JavaScriptCore.xcconfig: Added ENABLE_XPATH and
871 ENABLE_XSLT to FEATURE_DEFINES_BASE.
872
8732008-01-11 David D. Kilzer <ddkilzer@apple.com>
874
875 <rdar://problem/5438324> TLF: Local Storage for Web Applications
876
877 Reviewed by Greg.
878
879 * Configurations/JavaScriptCore.xcconfig: Added ENABLE_DATABASE to aspen
880 and aspensim platforms. Also reconfigured FEATURE_DEFINES to match the
881 way it's defined in WebCore and WebKit.
882
8832008-01-10 David D. Kilzer <ddkilzer@apple.com>
884
885 <rdar://problem/5682880> iPhone: dtables should be rewritten as a script (16818)
886
887 Reviewed by Darin for ToT WebKit
888
889 Rewrote the dftables utility in Perl. This is a partial merge of ToT WebKit
890 r29381 and r29382.
891
892 * DerivedSources.make: Added pcre directory to VPATH and changed
893 to invoke dftables directly.
894 * JavaScriptCore.xcodeproj/project.pbxproj: Removed dftables target.
895 * pcre/dftables: Added.
896 * pcre/dftables.cpp: Removed.
897
8982007-08-24 Scott Goodson <goodson@apple.com>
899
900 This is not for Snowbird; Indigo project only.
901
902 <rdar://problem/5410927> Obfuscate class names in all Indigo dependencies.
903
904 Included CoreFoundationObfuscations.h in prefix header (CF defines some NS types).
905
906 * JavaScriptCorePrefix.h:
907
9082007-08-24 Scott Goodson <goodson@apple.com>
909
910 This is not for Snowbird; Indigo project only.
911
912 <rdar://problem/5410927> Obfuscate class names in all Indigo dependencies.
913
914 Included <Foundation/FoundationObfuscations.h> in the prefix header, if OBFUSCATE is defined.
915
916 Defined OBFUSCATE in Deployment-Indigo configuration.
917
918 Defined INDIGO in both -Indigo configurations, even though there are no current uses.
919
920 * JavaScriptCore.xcodeproj/project.pbxproj:
921 * JavaScriptCorePrefix.h:
922
9232007-08-19 David Kilzer <ddkilzer@apple.com>
924
925 Reviewed by open source ToT and me.
926
927 <rdar://problem/5414585> Web site does not display properly in iPhone 1.0.1, worked in 1.0
928
929 Merged ToT WebKit r18517 into PEP.
930
931 Modified pcre_compile() (and the functions that it calls) to work with patterns
932 containing null characters.
933
934 Covered by JavaScriptCore tests ecma_3/RegExp/octal-002.js and ecma_3/RegExp/regress-85721.js
935
936 * ChangeLog-oss-merges: Original ChangeLog entry.
937 * kjs/regexp.cpp:
938 (KJS::RegExp::RegExp): Changed to not null-terminate the pattern string and instead
939 pass its length to pcre_compile.
940 * pcre/pcre.h:
941 * pcre/pcre_compile.c:
942 (check_escape):
943 (get_ucp):
944 (is_counted_repeat):
945 (check_posix_syntax):
946 (compile_branch):
947 (compile_regex):
948 (pcre_compile): Added a parameter specifying the length of the pattern, which
949 is no longer required to be null-terminated and may contain null characters.
950 (pcre_compile2):
951 * pcre/pcre_internal.h:
952 * tests/mozilla/expected.html: Updated for the two tests that this patch
953 fixes.
954
9552007-08-19 David Kilzer <ddkilzer@apple.com>
956
957 Reviewed by Andre.
958
959 Support for WebCore patch needed to fix:
960 <rdar://problem/5405433> iPhone: Edge case in setting <iframe>, <frame>, <object> "src" attribute can bypass domain-based security check for javascript: URLs
961
962 Merged ToT WebKit r16133 into PEP.
963
964 - add WTF::getPtr, a function template that makes it possible to write
965 generic code that gets a raw pointer out of any of our pointer types
966
967 * ChangeLog-oss-merges: Original ChangeLog entry.
968 * JavaScriptCore.xcodeproj/project.pbxproj:
969 * wtf/GetPtr.h: Added.
970 (WTF::getPtr):
971 * wtf/ListRefPtr.h:
972 (WTF::ListRefPtr::ListRefPtr):
973 (WTF::ListRefPtr::operator=):
974 (WTF::getPtr):
975 * wtf/OwnArrayPtr.h:
976 (WTF::getPtr):
977 * wtf/OwnPtr.h:
978 (WTF::getPtr):
979 * wtf/PassRefPtr.h:
980 (WTF::getPtr):
981 * wtf/RefPtr.h:
982 (WTF::getPtr):
983
9842007-08-17 Scott Goodson <goodson@apple.com>
985
986 Added build configurations for Project Indigo. Special install and framework search paths.
987 No effect on existing configurations, or code.
988
989 * JavaScriptCore.xcodeproj/project.pbxproj:
990
9912007-08-14 David Kilzer <ddkilzer@apple.com>
992
993 Reviewed by Scott.
994
995 <rdar://problem/5255884> Safari crashed in JavaScriptCore::WTF::fastMalloc()
996
997 Merged ToT WebKit r23846 into PEP.
998
999 Correctly evaluate the return value of _pcre_ucp_findchar() and ucp_findchar().
1000
1001 * ChangeLog-oss-merges: Original ChangeLog entry.
1002 * pcre/pcre_compile.c:
1003 (compile_branch):
1004 * pcre/pcre_exec.c:
1005 (match):
1006 * tests/mozilla/expected.html: Updated test results. (They did not change with
1007 this commit; just updating for future use.)
1008
10092007-07-30 David Kilzer <ddkilzer@apple.com>
1010
1011 Reviewed by NOBODY (header copyright change).
1012
1013 * kjs/JSLockC.h: Updated header copyright for open source distribution.
1014
10152007-07-25 David Kilzer <ddkilzer@apple.com>
1016
1017 Reviewed by NOBODY (OOPS!).
1018
1019 <rdar://problem/5354693> Upgrade PCRE 6.1 to 6.2 in JavaScriptCore
1020
1021 Merged ToT WebKit r18483 to PEP.
1022
1023 * ChangeLog-oss-merges: Original ChangeLog entry.
1024 * pcre/dftables.c:
1025 (main):
1026 * pcre/pcre.h:
1027 * pcre/pcre_compile.c:
1028 (read_repeat_counts):
1029 (pcre_compile2):
1030
10312007-07-23 David Kilzer <ddkilzer@apple.com>
1032
1033 Reviewed by NOBODY (obvious fix).
1034
1035 <rdar://problem/5354146> Exception message in LayoutTests/fast/js/regexp-charclass-crash.html doesn't match ToT WebKit
1036
1037 Test: LayoutTests/fast/js/regexp-charclass-crash.html.
1038
1039 Merged ToT WebKit r18256 to PEP.
1040
1041 A deleted object was accessed to prepare RegExp construction error messages.
1042
1043 * ChangeLog-oss-merges: Original ChangeLog entry.
1044 * kjs/regexp_object.cpp:
1045 (RegExpObjectImp::construct): Wrap the RegExp into an OwnPtr.
1046
10472007-07-23 David Kilzer <ddkilzer@apple.com>
1048
1049 Reviewed by Chris.
1050
1051 <rdar://problem/5353976> iPhone: buffer overflow: PCRE computes wrong length for expressions with quantifiers on named recursion or subexpressions
1052
1053 Merged ToT WebKit r23824 to PEP.
1054
1055 Test progression: js1_2/regexp/special_characters.js now passes.
1056
1057 Original commit message by Darin Adler:
1058
1059 It's challenging to implement proper preflighting for compiling these advanced features.
1060 But we don't want them in the JavaScript engine anyway.
1061
1062 Turned off the following features of PCRE (some of these are simply parsed and not implemented):
1063
1064 \C \E \G \L \N \P \Q \U \X \Z
1065 \e \l \p \u \z
1066 [::] [..] [==]
1067 (?#) (?<=) (?<!) (?>)
1068 (?C) (?P) (?R)
1069 (?0) (and 1-9)
1070 (?imsxUX)
1071
1072 Added the following:
1073
1074 \u \v
1075
1076 Because of \v, the js1_2/regexp/special_characters.js test now passes.
1077
1078 To be conservative, I left some features that JavaScript doesn't want, such as
1079 \012 and \x{2013}, in place. We can revisit these later; they're not directly-enough
1080 related to avoiding the incorrect preflighting.
1081
1082 I also didn't try to remove unused opcodes and remove code from the execution engine.
1083 That could save code size and speed things up a bit, but it would require more changes.
1084
1085 * kjs/regexp.h:
1086 * kjs/regexp.cpp: (KJS::RegExp::RegExp): Remove the sanitizePattern workaround for
1087 lack of \u support, since the PCRE code now has \u support.
1088
1089 * pcre/pcre-config.h: Set JAVASCRIPT to 1.
1090 * pcre/pcre_internal.h: Added ESC_v.
1091
1092 * pcre/pcre_compile.c: Added a different escape table for when JAVASCRIPT is set that
1093 omits all the escapes we don't want interpreted and includes '\v'.
1094 (check_escape): Put !JAVASCRIPT around the code for '\l', '\L', '\N', '\u', and '\U',
1095 and added code to handle '\u2013' inside JAVASCRIPT.
1096 (compile_branch): Put !JAVASCRIPT if around all the code implementing the features we
1097 don't want.
1098 (pcre_compile2): Ditto.
1099
1100 * ChangeLog-oss-merges: Original ChangeLog entry.
1101
11022007-07-23 David Kilzer <ddkilzer@apple.com>
1103
1104 Reviewed by NOBODY (make testkjs build and link).
1105
1106 * JavaScriptCore.xcodeproj/project.pbxproj: Added testkjs.cpp and JavaScriptCore.framework
1107 to testkjs target so it will build and link.
1108
11092007-07-23 David Kilzer <ddkilzer@apple.com>
1110
1111 Reviewed by Chris.
1112
1113 <rdar://problem/5353974> iPhone: buffer overflow: PCRE computes length wrong for expressions such as "[**]"
1114
1115 Merged ToT WebKit r24430 to PEP.
1116
1117 Test: fast/js/regexp-charclass-crash.html
1118
1119 * ChangeLog-oss-merges: Original ChangeLog entry.
1120 * pcre/pcre_compile.c:
1121 (pcre_compile2): Fix the preflight code that calls check_posix_syntax to match the
1122 actual regular expression compilation code; before it was missing the check of the
1123 first character.
1124
11252007-07-06 David Kilzer <ddkilzer@apple.com>
1126
1127 Reviewed by NOBODY (test code).
1128
1129 Fixed typos introduced in r11090. Also fixed code indentation.
1130
1131 * API/minidom.c:
1132 (main): Changed name of default script from "minicom.js" to "minidom.js".
1133 * API/testapi.c:
1134 (main): Changed name of default script from "minicom.js" to "testapi.js".
1135
11362007-06-25 Andre Boule <aboule@apple.com>
1137
1138 Reviewed by francisco.
1139 Checking in these two patches:
1140 http://trac.webkit.org/projects/webkit/changeset/17862
1141 http://trac.webkit.org/projects/webkit/changeset/18182
1142 They are both related to unicode in javascript RegExp expressions.
1143 Fixes:
1144 <rdar://problem/5265583> Cypress: browser crashed 5 times - QC 30438
1145
1146 * kjs/regexp.cpp:
1147 (KJS::RegExp::RegExp):
1148 (KJS::RegExp::~RegExp):
1149 (KJS::RegExp::match):
1150 (KJS::RegExp::sanitizePattern):
1151 (KJS::RegExp::isHexDigit):
1152 (KJS::RegExp::convertHex):
1153 (KJS::RegExp::convertUnicode):
1154 * kjs/regexp.h:
1155 (KJS::RegExp::flags):
1156 (KJS::RegExp::isValid):
1157 (KJS::RegExp::errorMessage):
1158 (KJS::RegExp::subPatterns):
1159 * kjs/regexp_object.cpp:
1160 (RegExpObjectImp::construct):
1161 (RegExpObjectImp::callAsFunction):
1162 * kjs/ustring.cpp:
1163 (KJS::UString::append):
1164
11652007-05-07 David Kilzer <ddkilzer@apple.com>
1166
1167 Reviewed by Chris.
1168
1169 <rdar://problem/5181388> JavaScriptCore strlcpy() buffer overrun
1170
1171 ---P2 Submission Information---
1172 - Risk level: Low
1173 - Risk details:
1174 - No risk in changes to prevent buffer overflows in strlcpy() and strncpy().
1175 - One assert() call was added to UString::from(double) to stop buffer overflows in
1176 extreme cases. Matches existing assert() used in a similar situation in
1177 NumberProtoFunc::callAsFunction().
1178 - Code reviewed by: Chris Blumenberg
1179 - Testing details:
1180 - Ran and passed all PEP Layout Tests.
1181 - Run through various MobileSafari stress tests (hitting random URLs).
1182 - Ran changes through testkjs with ToT WebKit with no regressions reported.
1183 (The testjks test harness doesn't currrently compile on PEP JavaScriptCore.)
1184
1185 * kjs/number_object.cpp:
1186 (NumberProtoFunc::callAsFunction): Fix potential buffer overflows in strlcpy().
1187 * kjs/ustring.cpp:
1188 (KJS::UString::from): Fix potential buffer overflows in strlcpy() and strncpy().
1189 Added assert() for section of code that does not check buflength.
1190
11912007-02-26 Andre Boule <aboule@apple.com>
1192
1193 Reviewed by me.
1194 Merged in a crasher fix from TOT webkit:
1195
1196 Patch by Darin and me, reviewed by Maciej.
1197
1198 Fixed <rdar://problem/4518397> REGRESSION(?): Oft-seen but unrepro crash
1199 in JavaScript garbage collection (KJS::Collector::collect())
1200 <rdar://problem/4752492> Crash in KJS::collect
1201
1202 The issue here was allocating one garbage-collected object in the midst
1203 of allocating a second garbage-collected object. In such a case, the
1204 zeroIfFree word lies.
1205
1206
1207 * kjs/collector.cpp:
1208 (KJS::Collector::collect):
1209
12102006-11-12 Andre Boule <aboule@apple.com>
1211
1212 Reviewed by me.
1213 <rdar://problem/4771699> Cap Javascript max allocation size to 10MB
1214
1215 Indeed JavaScriptCore already had a max memory feature built in, and throws a javascript
1216 exception when reaching a max number of nodes. I tested this existing javascript node cap
1217 and it does indeed work! The default size limit is 500000 nodes. At 50kb each (conservative
1218 estimate), that's 23MB. I think an appropriate fix for this bug is to simply cut that
1219 number down to 210000, or approximately 10MB.
1220
1221 * kjs/collector.h:
1222
12232006-09-29 Andre Boule <aboule@apple.com>
1224
1225 Reviewed by me.
1226 Making mmap tag -1 on simulator like it was before.
1227
1228 * wtf/TCSystemAlloc.cpp:
1229
12302006-09-13 Andre Boule <aboule@apple.com>
1231
1232 Reviewed by rjw, eric albert.
1233 <rdar://problem/4590483> crashin markStackObjectsConservatively - need a more proper fix
1234 NSInvocation would create a separate stack which messed up our JS GC.
1235 We had a hack in place to work around this.
1236 Foundation NSInvocation has been changed to not do the separate stack, so our hack
1237 is not necessary anymore. Taking it out.
1238
1239 * kjs/collector.cpp:
1240 (KJS::Collector::markCurrentThreadConservatively):
1241
12422006-07-25 Andre Boule <aboule@apple.com>
1243
1244 Reviewed by rjw.
1245 Fast allocator enabled in Deployment configs.
1246 Plt improves almost 10%
1247 <rdar://problem/4637739>
1248
1249 * JavaScriptCore.xcodeproj/project.pbxproj:
1250 * wtf/FastMalloc.cpp:
1251 * wtf/FastMalloc.h:
1252 (operator delete[]):
1253
12542006-06-16 Andre Boule <aboule@apple.com>
1255
1256 Reviewed by Kosut, Albert.
1257 temporary workaround for : <rdar://problem/4588784> crashin markStackObjectsConservatively
1258
1259
1260 * kjs/collector.cpp:
1261 (KJS::Collector::markCurrentThreadConservatively):
1262
1263
12642005-09-22 Andre Boule <aboule@apple.com>
1265
1266 Reviewed by RJW
1267
1268 -Enabled BINDINGS
1269 -Java related bindings #ifs renamed to BINDINGS_JAVA, which remains off.
1270
12712005-09-21 Ken Kocienda <kocienda@apple.com>
1272
1273 Reviewed by me
1274
1275 Merged in changes from the opensource tree.
1276
1277 2005-09-20 Maciej Stachowiak <mjs@apple.com>
1278
1279 Reviewed by Geoff and partly by Darin.
1280
1281 - fixed http://bugzilla.opendarwin.org/post_bug.cgi
1282 (Reduce conflicts in JavaScriptCore grammar)
1283
1284 This change gets us down from over 200 shift/reduce and 45 reduce/reduce to
1285 9 shift/reduce and 45 reduce/reduce.
1286
1287 * kjs/grammar.y:
1288 * kjs/grammar_types.h: Removed.
1289 * kjs/lexer.cpp:
1290 * kjs/nodes.h:
1291 (KJS::Node::isGroupNode):
1292 (KJS::Node::isLocation):
1293 (KJS::Node::isResolveNode):
1294 (KJS::Node::isBracketAccessorNode):
1295 (KJS::Node::isDotAccessorNode):
1296 (KJS::ResolveNode::isLocation):
1297 (KJS::ResolveNode::isResolveNode):
1298 (KJS::ResolveNode::identifier):
1299 (KJS::GroupNode::isGroupNode):
1300 (KJS::GroupNode::leafNode):
1301 (KJS::BracketAccessorNode::isLocation):
1302 (KJS::BracketAccessorNode::isBracketAccessorNode):
1303 (KJS::BracketAccessorNode::base):
1304 (KJS::BracketAccessorNode::subscript):
1305 (KJS::DotAccessorNode::isLocation):
1306 (KJS::DotAccessorNode::isDotAccessorNode):
1307 (KJS::DotAccessorNode::base):
1308 (KJS::DotAccessorNode::identifier):
1309 (KJS::FuncExprNode::FuncExprNode):
1310 (KJS::FuncExprNode::identifier):
1311 (KJS::FuncDeclNode::FuncDeclNode):
1312 (KJS::FuncDeclNode::execute):
1313
1314 2005-09-20 Geoffrey Garen <ggaren@apple.com>
1315
1316 - Oops. The 4263434 change was only appropriate on the branch. Rolling out.
1317
1318 Reviewed by eric.
1319
1320 * kjs/internal.cpp:
1321 (KJS::InterpreterImp::mark):
1322
1323 2005-09-20 Geoffrey Garen <ggaren@apple.com>
1324
1325 - More changes needed to fix <rdar://problem/4214783> 8F29 REGRESSION(Denver/Chardonnay):
1326 kjs_fast_malloc crash due to lack of locking on multiple threads (seen selecting volumes in
1327 the installer)
1328
1329 Added InterpreterLocks in some places in the bindings we missed before.
1330
1331 Reviewed by john.
1332
1333 * bindings/runtime_root.cpp:
1334 (KJS::Bindings::addNativeReference):
1335 (KJS::Bindings::removeNativeReference):
1336 (RootObject::removeAllNativeReferences):
1337 * bindings/runtime_root.h:
1338 (KJS::Bindings::RootObject::~RootObject):
1339 (KJS::Bindings::RootObject::setRootObjectImp):
1340
1341 2005-09-20 Geoffrey Garen <ggaren@apple.com>
1342
1343 - Fixed <rdar://problem/4263434> <rdar://problem/4263434> Denver 8F29 Regression:
1344 KJS::InterpreterImp::mark() crash
1345
1346 Fix by mjs, review by me.
1347
1348 * kjs/internal.cpp:
1349 (KJS::InterpreterImp::mark): Added a null check on globExec in case a
1350 garbage collection occurs inside InterpreterImp::globalInit (called
1351 from InterpreterImp::InterpreterImp), at which point globExec has not yet been initialized.
1352
1353 2005-09-20 Geoffrey Garen <ggaren@apple.com>
1354
1355 - Rolled in fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=4892
1356 Date constructor has problems with months larger than 11
1357
1358 Test cases added:
1359
1360 * layout-tests/fast/js/date-big-constructor-expected.txt: Added.
1361 * layout-tests/fast/js/date-big-constructor.html: Added.
1362
1363 Reviewed by darin.
1364
1365 * kjs/date_object.cpp:
1366 (KJS::fillStructuresUsingDateArgs):
1367 (KJS::makeTime):
1368
1369 2005-09-19 Geoffrey Garen <ggaren@apple.com>
1370
1371 - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5028
1372 9 layout tests fail following the change from long to int
1373
1374 - Rolled out changes to simple_number.h, and added fits(long long)
1375 and SimpleNumber::fits(unsigned long long) to the old system.
1376
1377 Reviewed by mjs.
1378
1379 * kjs/simple_number.h:
1380 (KJS::SimpleNumber::):
1381 (KJS::SimpleNumber::value):
1382 (KJS::SimpleNumber::fits):
1383 (KJS::SimpleNumber::integerFits):
1384 (KJS::SimpleNumber::make):
1385
1386 2005-09-14 Maciej Stachowiak <mjs@apple.com>
1387
1388 Reviewed by Geoff.
1389
1390 - fixed <rdar://problem/4214783> REGRESSION: kjs_fast_malloc crash due to lack of locking on multiple threads (seen selecting volumes in the installer)
1391
1392 Make sure to lock using the InterpreterLock class in all places that need it
1393 (including anything that uses the collector, the parser, the protect count hash table,
1394 and anything that allocates via fast_malloc).
1395
1396 Also added assertions to ensure that the locking rules are followed for the relevant
1397 resources.
1398
1399 * Makefile.am:
1400 * bindings/NP_jsobject.cpp:
1401 (identifierFromNPIdentifier):
1402 (_NPN_Invoke):
1403 (_NPN_Evaluate):
1404 (_NPN_GetProperty):
1405 (_NPN_SetProperty):
1406 (_NPN_RemoveProperty):
1407 (_NPN_HasProperty):
1408 (_NPN_HasMethod):
1409 (_NPN_SetException):
1410 * bindings/jni/jni_jsobject.cpp:
1411 (JSObject::call):
1412 (JSObject::eval):
1413 (JSObject::getMember):
1414 (JSObject::setMember):
1415 (JSObject::removeMember):
1416 (JSObject::getSlot):
1417 (JSObject::setSlot):
1418 (JSObject::toString):
1419 (JSObject::convertJObjectToValue):
1420 * bindings/objc/WebScriptObject.mm:
1421 (-[WebScriptObject callWebScriptMethod:withArguments:]):
1422 (-[WebScriptObject evaluateWebScript:]):
1423 (-[WebScriptObject setValue:forKey:]):
1424 (-[WebScriptObject valueForKey:]):
1425 (-[WebScriptObject removeWebScriptKey:]):
1426 (-[WebScriptObject stringRepresentation]):
1427 (-[WebScriptObject webScriptValueAtIndex:]):
1428 (-[WebScriptObject setWebScriptValueAtIndex:value:]):
1429 (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
1430 * bindings/runtime.cpp:
1431 (Instance::createRuntimeObject):
1432 * bindings/runtime_root.h:
1433 * bindings/testbindings.cpp:
1434 (main):
1435 * bindings/testbindings.mm:
1436 (main):
1437 * kjs/fast_malloc.cpp:
1438 (KJS::kjs_fast_malloc):
1439 (KJS::kjs_fast_calloc):
1440 (KJS::kjs_fast_free):
1441 (KJS::kjs_fast_realloc):
1442 * kjs/fast_malloc.h:
1443 * kjs/identifier.h:
1444 * kjs/internal.cpp:
1445 (InterpreterImp::InterpreterImp):
1446 (InterpreterImp::clear):
1447 (InterpreterImp::mark):
1448 (InterpreterImp::checkSyntax):
1449 (InterpreterImp::evaluate):
1450 * kjs/internal.h:
1451 (KJS::InterpreterImp::globalObject):
1452 * kjs/interpreter.cpp:
1453 (Interpreter::evaluate):
1454 * kjs/interpreter.h:
1455 (KJS::InterpreterLock::InterpreterLock):
1456 (KJS::InterpreterLock::~InterpreterLock):
1457 * kjs/nodes.h:
1458 * kjs/protect.h:
1459 (KJS::ProtectedValue::ProtectedValue):
1460 (KJS::ProtectedValue::~ProtectedValue):
1461 (KJS::ProtectedValue::operator=):
1462 (KJS::ProtectedObject::ProtectedObject):
1463 (KJS::ProtectedObject::~ProtectedObject):
1464 (KJS::ProtectedObject::operator=):
1465 (KJS::ProtectedReference::ProtectedReference):
1466 (KJS::ProtectedReference::~ProtectedReference):
1467 (KJS::ProtectedReference::operator=):
1468 * kjs/protected_object.h:
1469 * kjs/protected_values.cpp:
1470 (KJS::ProtectedValues::getProtectCount):
1471 (KJS::ProtectedValues::increaseProtectCount):
1472 (KJS::ProtectedValues::decreaseProtectCount):
1473 * kjs/string_object.cpp:
1474 (StringObjectImp::StringObjectImp):
1475 * kjs/testkjs.cpp:
1476 (main):
1477
1478 2005-09-16 Adele Peterson <adele@apple.com>
1479
1480 Change by Darin, reviewed by me and Maciej.
1481
1482 Fixes http://bugzilla.opendarwin.org/show_bug.cgi?id=4547
1483 use int instead of long for 32-bit (to prepare for LP64 compiling)
1484
1485 * bindings/c/c_class.h:
1486 (KJS::Bindings::CClass::constructorAt):
1487 (KJS::Bindings::CClass::numConstructors):
1488 * bindings/c/c_runtime.h:
1489 (KJS::Bindings::CMethod::numParameters):
1490 * bindings/jni/jni_class.cpp:
1491 (JavaClass::JavaClass):
1492 * bindings/jni/jni_class.h:
1493 (KJS::Bindings::JavaClass::constructorAt):
1494 (KJS::Bindings::JavaClass::numConstructors):
1495 * bindings/jni/jni_instance.cpp:
1496 (JavaInstance::invokeMethod):
1497 * bindings/jni/jni_jsobject.cpp:
1498 (JSObject::convertJObjectToValue):
1499 (JSObject::listFromJArray):
1500 * bindings/jni/jni_runtime.cpp:
1501 (JavaMethod::JavaMethod):
1502 * bindings/jni/jni_runtime.h:
1503 (KJS::Bindings::JavaConstructor::_commonCopy):
1504 (KJS::Bindings::JavaConstructor::parameterAt):
1505 (KJS::Bindings::JavaConstructor::numParameters):
1506 (KJS::Bindings::JavaMethod::_commonCopy):
1507 (KJS::Bindings::JavaMethod::parameterAt):
1508 (KJS::Bindings::JavaMethod::numParameters):
1509 * bindings/npapi.h:
1510 * bindings/objc/WebScriptObject.mm:
1511 (listFromNSArray):
1512 * bindings/objc/objc_class.h:
1513 (KJS::Bindings::ObjcClass::constructorAt):
1514 (KJS::Bindings::ObjcClass::numConstructors):
1515 * bindings/objc/objc_instance.h:
1516 * bindings/objc/objc_runtime.h:
1517 * bindings/objc/objc_runtime.mm:
1518 (ObjcMethod::numParameters):
1519 * bindings/runtime.h:
1520 * kjs/identifier.h:
1521 * kjs/internal.h:
1522 * kjs/property_slot.h:
1523 (KJS::PropertySlot::setCustomIndex):
1524 (KJS::PropertySlot::index):
1525 (KJS::PropertySlot::):
1526 * kjs/regexp_object.cpp:
1527 (RegExpObjectImp::backrefGetter):
1528 (RegExpObjectImp::getOwnPropertySlot):
1529 * kjs/simple_number.h:
1530 (KJS::SimpleNumber::):
1531 (KJS::SimpleNumber::value):
1532 (KJS::SimpleNumber::fits):
1533 (KJS::SimpleNumber::integerFits):
1534 (KJS::SimpleNumber::make):
1535 * kjs/string_object.cpp:
1536 (substituteBackreferences):
1537 * kjs/ustring.cpp:
1538 (KJS::UString::from):
1539 (KJS::UString::toUInt32):
1540 (KJS::UString::find):
1541 (KJS::UString::rfind):
1542 * kjs/ustring.h:
1543 * kjs/value.cpp:
1544 (KJS::jsNumber):
1545 * kjs/value.h:
1546
15472005-09-13 Ken Kocienda <kocienda@apple.com>
1548
1549 Reviewed by me
1550
1551 Merged in changes from the opensource tree.
1552
1553 2005-09-10 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
1554
1555 Reviewed and landed by Darin.
1556
1557 * Makefile.vc: Added.
1558 * README-Win32.txt: Added.
1559
1560 2005-09-10 Darin Adler <darin@apple.com>
1561
1562 - fixed compilation for WebCore (another try)
1563
1564 * kjs/simple_number.h: Added more "using" lines.
1565
1566 2005-09-10 Darin Adler <darin@apple.com>
1567
1568 - fixed compilation for WebCore
1569
1570 * kjs/simple_number.h: Have to include <cmath> here to work around a bug in the GCC
1571 standard C++ library headers.
1572
1573 2005-09-10 Darin Adler <darin@apple.com>
1574
1575 Windows changes by Krzysztof Kowalczyk <kkowalczyk@gmail.com>.
1576
1577 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4870
1578 win portability: fix IS_NEGATIVE_ZERO macro in simple_number.h
1579
1580 * kjs/simple_number.h:
1581 (KJS::isNegativeZero): Added. Inline function. Has a case for Windows that
1582 uses _fpclass and a case for other platforms that uses signbit.
1583 (KJS::SimpleNumber::fits): Use inline isNegativeZero instead of macro IS_NEGATIVE_ZERO.
1584
1585 * kjs/internal.cpp: Remove definition of now-unneeded negZero global.
1586
1587 * kjs/value.cpp: Touched the file because Xcode didn't know it needed to
1588 recompile it.
1589
1590 - improved test engine
1591
1592 * tests/mozilla/jsDriver.pl: Sort tests in numeric order instead of using
1593 a plain-ASCII sort; now test 33 will be after test 5 in any given set of
1594 numbered tests.
1595
1596 2005-09-08 Darin Adler <darin@apple.com>
1597
1598 - fixed overloaded versions of throwError so that they substitute *all*
1599 expected parameters into the message string -- some versions used to
1600 skip parameters, resulting in "%s" being printed in the error message.
1601
1602 Reviewed by Geoff.
1603
1604 * kjs/nodes.h: Updated declarations to use "const &" and not to name parameters
1605 * kjs/nodes.cpp: (Node::throwError): Updated to match above and add one missing
1606 call to substitute.
1607
1608 2005-09-08 Darin Adler <darin@apple.com>
1609
1610 Reviewed by Geoff.
1611
1612 - updated to PCRE 6.1
1613
1614 The original PCRE 6.1 sources are checked into the tree with the tag
1615 "pcre-6-1" for reference. What we're checking in right now is the original
1616 plus our changes to make it support UTF-16 and at least one other tweak
1617 (vertical tab considered whitespace). Our work to get our changes was
1618 done on "pcre-6-1-branch", with an anchor at "pcre-6-1-anchor" so you can
1619 see the evolution of the UTF-16 changes.
1620
1621 Note also that there was one small change made here that's not on the branch
1622 in pcre_compile.c.
1623
1624 * Info.plist: Updated the part of the copyright message that's about PCRE.
1625
1626 * JavaScriptCore.xcodeproj/project.pbxproj: Added new PCRE source files,
1627 removed obsolete ones.
1628
1629 * pcre/AUTHORS: Updated to PCRE 6.1. Includes credits for Apple's UTF-16
1630 changes, but not the credits for Google's C++ wrapper, since we don't include that.
1631 * pcre/COPYING: Updated to PCRE 6.1.
1632 * pcre/LICENCE: Ditto.
1633 * pcre/dftables.c: Ditto.
1634 * pcre/pcre-config.h: Ditto.
1635 * pcre/pcre.h: Ditto.
1636
1637 * pcre/pcre_compile.c: Added for PCRE 6.1.
1638 * pcre/pcre_config.c: Ditto.
1639 * pcre/pcre_exec.c: Ditto.
1640 * pcre/pcre_fullinfo.c: Ditto.
1641 * pcre/pcre_get.c: Ditto.
1642 * pcre/pcre_globals.c: Ditto.
1643 * pcre/pcre_info.c: Ditto.
1644 * pcre/pcre_internal.h: Ditto.
1645 * pcre/pcre_maketables.c: Ditto.
1646 * pcre/pcre_ord2utf8.c: Ditto.
1647 * pcre/pcre_printint.c: Ditto.
1648 * pcre/pcre_refcount.c: Ditto.
1649 * pcre/pcre_study.c: Ditto.
1650 * pcre/pcre_tables.c: Ditto.
1651 * pcre/pcre_try_flipped.c: Ditto.
1652 * pcre/pcre_ucp_findchar.c: Ditto.
1653 * pcre/pcre_version.c: Ditto.
1654 * pcre/pcre_xclass.c: Ditto.
1655 * pcre/ucp.h: Ditto.
1656 * pcre/ucp_findchar.c: Ditto.
1657 * pcre/ucpinternal.h: Ditto.
1658 * pcre/ucptable.c: Ditto.
1659
1660 * pcre/get.c: Removed.
1661 * pcre/internal.h: Removed.
1662 * pcre/maketables.c: Removed.
1663 * pcre/pcre.c: Removed.
1664 * pcre/study.c: Removed.
1665
16662005-09-08 Ken Kocienda <kocienda@apple.com>
1667
1668 Reviewed by me
1669
1670 Merged in changes from the opensource tree.
1671
1672 2005-09-07 Geoffrey Garen <ggaren@apple.com>
1673
1674 -fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4781
1675 Date.setMonth fails with big values due to overflow
1676
1677 Reviewed by darin.
1678
1679 * kjs/date_object.cpp:
1680 (timetUsingCF): for consistency, changed return statement to invalidDate instead of LONG_MAX
1681 (KJS::fillStructuresUsingTimeArgs): modified for readability
1682 (KJS::fillStructuresUsingDateArgs): new function analogous to fillStructuresUsingTimeArgs
1683 (KJS::DateProtoFuncImp::callAsFunction): modified to use fillStructuresUsingDateArgs
1684 (KJS::DateObjectImp::construct): moved variable declaration to proper scope
1685 (KJS::DateObjectFuncImp::callAsFunction): moved variable declaration to proper scope
1686
1687 2005-09-07 Geoffrey Garen <ggaren@apple.com>
1688 -updated expected test results to reflect fix for
1689 http://bugzilla.opendarwin.org/show_bug.cgi?id=4698
1690 kjs does not allow named functions in function expressions
1691
1692 * tests/mozilla/expected.html:
1693
16942005-09-07 Ken Kocienda <kocienda@apple.com>
1695
1696 Reviewed by me
1697
1698 Merged in changes from the opensource tree.
1699
1700 2005-09-04 Darin Adler <darin@apple.com>
1701
1702 * kjs/identifier.cpp: Fix comment, add missing include.
1703 (Follow-on to changes from yesterday.)
1704
1705 2005-09-03 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
1706
1707 Reviewed, tweaked and landed by Darin.
1708
1709 - another try at some of the Windows compilation fixes
1710 should fix these bugs: 4546, 4831, 4834, 4643, 4830, 4832, 4833, 4835
1711
1712 * kjs/collector.cpp: Add missing <setjmp.h> include.
1713 * kjs/date_object.cpp: Fix broken copysign macro.
1714 * kjs/dtoa.cpp: Move macro definitions down after all header includes.
1715 * kjs/fast_malloc.cpp: Add missing <assert.h> and <stddef.h> includes.
1716 * kjs/function.cpp: Remove broken isxdigit definition.
1717 * kjs/grammar.y: Add a missing semicolon (and remove an excess one).
1718 * kjs/identifier.cpp: Turn off AVOID_STATIC_CONSTRUCTORS because the placement new syntax
1719 doesn't seem to work in Visual C++ (I'm surprised to hear that, by the way).
1720 * kjs/value.h: Made ValueImp's destructor virtual because otherwise pointers to ValueImp
1721 on the stack aren't right for garbage collection on Windows (don't think it works that
1722 way with gcc's virtual table scheme, but it's a harmless change).
1723
1724 2005-09-03 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
1725
1726 Reviewed, tweaked and landed by Darin.
1727
1728 - some Windows compilation fixes, hoping to fix the problems reported in these bugs:
1729 4627, 4629, 4630, 4631, 4632, 4633, 4634, 4635, 4636, 4637, 4639, 4640, 4641, 4644, 4645
1730
1731 * kjs/collector.cpp: Include <windows.h> on WIN32. Put thread-related code inside
1732 KJS_MULTIPLE_THREADS #if directives.
1733 (KJS::Collector::markCurrentThreadConservatively): Use NT_TIB to find the stack base on Win32.
1734
1735 * kjs/config.h: Define HAVE_SYS_TIMEB_H for Win32.
1736
1737 * kjs/date_object.cpp: Add include of <limits.h>. Add definitions of strncasecmp, isfinite, and
1738 copysign for Win32.
1739 (KJS::KRFCDate_parseDate): Move "errno = 0" line down closer to the first call to strol -- I believe
1740 that on Win32 there's some other call before that setting errno.
1741
1742 * kjs/date_object.h: Remove unneeded include of <sys/time.h>.
1743
1744 * kjs/dtoa.cpp: Add an undef of strtod, needed on Win32.
1745
1746 * kjs/fast_malloc.cpp: Put #if !WIN32 around some customization that's not appropriate on Win32.
1747 (KJS::region_list_append): Add a missing cast so this Win32-specific function compiles in C++.
1748 (KJS::sbrk): Change parameter type to match the declaration.
1749
1750 * kjs/function.cpp: (isxdigit): Define a locale-independent isxdigit on Win32.
1751
1752 * kjs/function.h: Remove unneeded friend class Function for FunctionImp.
1753
1754 * kjs/identifier.cpp: Took out the APPLE_CHANGES from around the AVOID_STATIC_CONSTRUCTORS
1755 define. We ultimately intend to phase out APPLE_CHANGES entirely. Also fix the
1756 non-AVOID_STATIC_CONSTRUCTORS code path.
1757
1758 * kjs/internal.cpp: Remove uneeded include of <strings.h>, which was confused with <string.h>!
1759 Add a Win32 implementation of copysign. Put the threads code inside KJS_MULTIPLE_THREADS.
1760
1761 * kjs/internal.h: Define a KJS_MULTIPLE_THREADS macro on non-Win32 only. Later we can make this
1762 specific to Mac OS X if we like.
1763
1764 * kjs/interpreter_map.cpp: Add missing include of <stdlib.h>.
1765
1766 * kjs/list.cpp:
1767 (KJS::ListImp::markValues): Use std::min instead of MIN.
1768 (KJS::List::copy): Ditto.
1769 (KJS::List::copyTail): Ditto.
1770
1771 * kjs/math_object.cpp: (signbit): Add a Win32 implementation of signbit.
1772
1773 * kjs/nodes.cpp: (Node::finalCheck): Use unsigned instead of uint.
1774 Put the use of always_inline inside __GNUC__.
1775
1776 * kjs/number_object.cpp: (NumberProtoFuncImp::callAsFunction): Use "10.0" instead of "10"
1777 inside all the calls to pow to avoid ambiguity caused by overloading of pow on Win32, seen
1778 when passing an int rather than a double or float.
1779
1780 * kjs/operations.cpp:
1781 (KJS::isInf): Add Win32 implementation.
1782 (KJS::isPosInf): Add Win32 implementation.
1783 (KJS::isNegInf): Add Win32 implementation.
1784
1785 * kjs/regexp.cpp: Use unsigned instead of uint.
1786 * kjs/regexp.h: Ditto.
1787 * kjs/regexp_object.cpp: Ditto.
1788 * kjs/regexp_object.h: Ditto.
1789
1790 2005-09-02 Beth Dakin <bdakin@apple.com>
1791
1792 Fix for <rdar://problem/4235531> Denver Regression: Safari crash in KWQStringData::makeUnicode
1793 The other half of the fix is in WebCore.
1794
1795 Fix written by Maciej and Darin.
1796 Reviewed by me/Maciej
1797
1798 As Maciej said in Radar: These problems was caused by a conflict between some of our custom
1799 allocators, causing them to return null. Symptom is typically a null pointer dereference in
1800 a place where it might be expected an allocation has just occurred.
1801
1802 * kjs/fast_malloc.cpp: Added #define for MORECORE_CONTIGUOUS, MORECORE_CANNOT_TRIM,
1803 and MALLOC_FAILURE_ACTION.
1804
1805 2005-08-31 Geoffrey Garen <ggaren@apple.com>
1806
1807 -rolled in fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=4698
1808 kjs does not allow named functions in function expressions
1809
1810 Fix by Arthur Langereis.
1811
1812 Reviewed by darin.
1813
1814 * kjs/grammar.y:
1815 * kjs/nodes.cpp:
1816 (FuncExprNode::evaluate):
1817 * kjs/nodes.h:
1818 (KJS::FuncExprNode::FuncExprNode):
1819
1820 Test cases added:
1821
1822 * layout-tests/fast/js/named-function-expression-expected.txt: Added.
1823 * layout-tests/fast/js/named-function-expression.html: Added.
1824
18252005-09-02 Andre Boule <aboule@apple.com>
1826
1827 Removed OS X target from project.
1828
1829 * JavaScriptCore.xcodeproj/project.pbxproj
1830
18312005-08-31 Ken Kocienda <kocienda@apple.com>
1832
1833 Reviewed by me
1834
1835 Merged in new file from the opensource tree.
1836
1837 2005-08-31 Justin Haygood <justin@xiondigital.net>
1838
1839 Reviewed, tweaked, and landed by Darin.
1840
1841 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4085
1842 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4087
1843 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4096
1844 Some fixes for compiling on windows.
1845
1846 * kjs/config.h: Added a WIN32 case in here, with suitable defines.
1847 (To be tweaked as necessary.)
1848 * kjs/function.cpp: Took out APPLE_CHANGES around use of ICU.
1849 * kjs/operations.cpp: Removed some bogus code that always set HAVE_FLOAT_H.
1850
1851 2005-08-30 Darin Adler <darin@apple.com>
1852
1853 Reviewed by John Sullivan.
1854
1855 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4758
1856 unify SharedPtr in WebCore and JavaScriptCore
1857
1858 * kjs/shared_ptr.h: Updated namespace to KXMLCore instead of kxhmlcore.
1859 Made a few small improvements to use local variables a bit more and added
1860 an "operator int" to reduce the chance that we'll convert a SharedPtr to
1861 an int by accident. Also made the == operators normal functions rather than
1862 friend functions, added a couple of comemnts.
1863
1864 * kjs/function.h: Updated for namespace change.
1865 * kjs/function.cpp: Ditto.
1866 * kjs/function_object.cpp: Ditto.
1867 * kjs/internal.h: Ditto.
1868 * kjs/internal.cpp: Ditto.
1869 * kjs/nodes.h: Ditto.
1870 * kjs/nodes2string.cpp: Ditto.
1871
18722005-08-29 Ken Kocienda <kocienda@apple.com>
1873
1874 Reviewed by me
1875
1876 * JavaScriptCore.xcodeproj/project.pbxproj: Fixing busted Xcode reference to shared_ptr.h.
1877
18782005-08-29 Ken Kocienda <kocienda@apple.com>
1879
1880 Reviewed by me
1881
1882 Merged in new file from the opensource tree.
1883
1884 * kjs/shared_ptr.h: Added.
1885
18862005-08-29 Ken Kocienda <kocienda@apple.com>
1887
1888 Reviewed by me
1889
1890 Merged in changes from the opensource tree.
1891
1892 2005-08-26 Maciej Stachowiak <mjs@apple.com>
1893
1894 Reviewed by John.
1895
1896 <rdar://problem/4224911> many many leaks in kjsyyparse with malformed Javascript
1897
1898 Record all nodes that are created during parsing, and delete any
1899 that are left floating with a refcount of 0.
1900
1901 * kjs/internal.cpp:
1902 (KJS::Parser::saveNewNode):
1903 (KJS::clearNewNodes):
1904 (KJS::Parser::parse):
1905 * kjs/internal.h:
1906 * kjs/nodes.cpp:
1907 (Node::Node):
1908 * kjs/nodes.h:
1909 (KJS::Node::refcount):
1910
1911 2005-08-26 Maciej Stachowiak <mjs@apple.com>
1912
1913 Reviewed by John.
1914
1915 - fixed <rdar://problem/4232452> many many leaks in kjsyyparse on some well-formed JavaScript (can repro on sony.com, webkit tests)
1916
1917 Fixed by changing the refcounting scheme for nodes. Instead of each node implementing a custom ref and
1918 deref for all its children (and being responsible for deleting them), nodes use a smart pointer to
1919 hold their children, and smart pointers are used outside the node tree as well. This change mostly
1920 removes code.
1921
1922 * JavaScriptCore.xcodeproj/project.pbxproj:
1923 * kjs/function.cpp:
1924 (KJS::DeclaredFunctionImp::DeclaredFunctionImp):
1925 (KJS::GlobalFuncImp::callAsFunction):
1926 * kjs/function.h:
1927 * kjs/function_object.cpp:
1928 (FunctionObjectImp::construct):
1929 * kjs/grammar.y:
1930 * kjs/internal.cpp:
1931 (KJS::Parser::parse):
1932 (KJS::Parser::accept):
1933 (KJS::InterpreterImp::checkSyntax):
1934 (KJS::InterpreterImp::evaluate):
1935 * kjs/internal.h:
1936 * kjs/nodes.cpp:
1937 (Node::Node):
1938 (Node::~Node):
1939 (ElementNode::evaluate):
1940 (PropertyValueNode::evaluate):
1941 (ArgumentListNode::evaluateList):
1942 (NewExprNode::evaluate):
1943 (FunctionCallValueNode::evaluate):
1944 (FunctionCallBracketNode::evaluate):
1945 (FunctionCallDotNode::evaluate):
1946 (RelationalNode::evaluate):
1947 (StatListNode::execute):
1948 (StatListNode::processVarDecls):
1949 (VarDeclListNode::evaluate):
1950 (VarDeclListNode::processVarDecls):
1951 (ForInNode::ForInNode):
1952 (ClauseListNode::processVarDecls):
1953 (CaseBlockNode::evalBlock):
1954 (FuncDeclNode::processFuncDecl):
1955 (FuncExprNode::evaluate):
1956 (SourceElementsNode::execute):
1957 (SourceElementsNode::processFuncDecl):
1958 (SourceElementsNode::processVarDecls):
1959 * kjs/nodes.h:
1960 (KJS::Node::ref):
1961 (KJS::Node::deref):
1962 (KJS::NumberNode::NumberNode):
1963 (KJS::GroupNode::GroupNode):
1964 (KJS::ElementNode::ElementNode):
1965 (KJS::ArrayNode::ArrayNode):
1966 (KJS::PropertyValueNode::PropertyValueNode):
1967 (KJS::ObjectLiteralNode::ObjectLiteralNode):
1968 (KJS::BracketAccessorNode::BracketAccessorNode):
1969 (KJS::DotAccessorNode::DotAccessorNode):
1970 (KJS::ArgumentListNode::ArgumentListNode):
1971 (KJS::ArgumentsNode::ArgumentsNode):
1972 (KJS::NewExprNode::NewExprNode):
1973 (KJS::FunctionCallValueNode::FunctionCallValueNode):
1974 (KJS::FunctionCallResolveNode::FunctionCallResolveNode):
1975 (KJS::FunctionCallBracketNode::FunctionCallBracketNode):
1976 (KJS::FunctionCallDotNode::FunctionCallDotNode):
1977 (KJS::PostfixNode::PostfixNode):
1978 (KJS::DeleteNode::DeleteNode):
1979 (KJS::VoidNode::VoidNode):
1980 (KJS::TypeOfNode::TypeOfNode):
1981 (KJS::PrefixNode::PrefixNode):
1982 (KJS::UnaryPlusNode::UnaryPlusNode):
1983 (KJS::NegateNode::NegateNode):
1984 (KJS::BitwiseNotNode::BitwiseNotNode):
1985 (KJS::LogicalNotNode::LogicalNotNode):
1986 (KJS::MultNode::MultNode):
1987 (KJS::AddNode::AddNode):
1988 (KJS::ShiftNode::ShiftNode):
1989 (KJS::RelationalNode::RelationalNode):
1990 (KJS::EqualNode::EqualNode):
1991 (KJS::BitOperNode::BitOperNode):
1992 (KJS::BinaryLogicalNode::BinaryLogicalNode):
1993 (KJS::ConditionalNode::ConditionalNode):
1994 (KJS::AssignResolveNode::AssignResolveNode):
1995 (KJS::AssignBracketNode::AssignBracketNode):
1996 (KJS::AssignDotNode::AssignDotNode):
1997 (KJS::CommaNode::CommaNode):
1998 (KJS::AssignExprNode::AssignExprNode):
1999 (KJS::VarDeclListNode::VarDeclListNode):
2000 (KJS::VarStatementNode::VarStatementNode):
2001 (KJS::ExprStatementNode::ExprStatementNode):
2002 (KJS::IfNode::IfNode):
2003 (KJS::DoWhileNode::DoWhileNode):
2004 (KJS::WhileNode::WhileNode):
2005 (KJS::ForNode::ForNode):
2006 (KJS::ReturnNode::ReturnNode):
2007 (KJS::WithNode::WithNode):
2008 (KJS::CaseClauseNode::CaseClauseNode):
2009 (KJS::ClauseListNode::ClauseListNode):
2010 (KJS::ClauseListNode::clause):
2011 (KJS::ClauseListNode::next):
2012 (KJS::SwitchNode::SwitchNode):
2013 (KJS::LabelNode::LabelNode):
2014 (KJS::ThrowNode::ThrowNode):
2015 (KJS::CatchNode::CatchNode):
2016 (KJS::FinallyNode::FinallyNode):
2017 (KJS::TryNode::TryNode):
2018 (KJS::ParameterNode::ParameterNode):
2019 (KJS::ParameterNode::nextParam):
2020 (KJS::FuncDeclNode::FuncDeclNode):
2021 (KJS::FuncExprNode::FuncExprNode):
2022 * kjs/nodes2string.cpp:
2023 (KJS::SourceStream::operator<<):
2024 (ElementNode::streamTo):
2025 (PropertyValueNode::streamTo):
2026 (ArgumentListNode::streamTo):
2027 (StatListNode::streamTo):
2028 (VarDeclListNode::streamTo):
2029 (CaseBlockNode::streamTo):
2030 (ParameterNode::streamTo):
2031 (SourceElementsNode::streamTo):
2032 * kjs/shared_ptr.h: Added.
2033 (kxmlcore::SharedPtr::SharedPtr):
2034 (kxmlcore::SharedPtr::~SharedPtr):
2035 (kxmlcore::SharedPtr::isNull):
2036 (kxmlcore::SharedPtr::notNull):
2037 (kxmlcore::SharedPtr::reset):
2038 (kxmlcore::SharedPtr::get):
2039 (kxmlcore::SharedPtr::operator*):
2040 (kxmlcore::SharedPtr::operator->):
2041 (kxmlcore::SharedPtr::operator!):
2042 (kxmlcore::SharedPtr::operator bool):
2043 (kxmlcore::SharedPtr::operator==):
2044 (kxmlcore::::operator):
2045 (kxmlcore::operator!=):
2046 (kxmlcore::static_pointer_cast):
2047 (kxmlcore::const_pointer_cast):
2048
2049 2005-08-26 Geoff Garen <ggaren@apple.com>
2050
2051 Reviewed by John.
2052 Landed by Darin.
2053
2054 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4664
2055 TOT Crash from backwards null check in WebScriptObject.mm
2056
2057 * bindings/objc/WebScriptObject.mm:
2058 (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:]):
2059 Remove bogus !.
2060
20612005-08-26 Ken Kocienda <kocienda@apple.com>
2062
2063 Reviewed by me
2064
2065 Merged in changes from the opensource tree.
2066
2067 2005-08-25 Darin Adler <darin@apple.com>
2068
2069 Reviewed by John Sullivan.
2070
2071 - rename KJS::UString::string() to KJS::UString::domString()
2072 - rename KJS::Identifier::string() to KJS::Identifier::domString()
2073
2074 * kjs/identifier.h: Renamed.
2075 * kjs/ustring.h: Ditto.
2076
20772005-08-23 Ken Kocienda <kocienda@apple.com>
2078
2079 Reviewed by me
2080
2081 * JavaScriptCore.xcodeproj/project.pbxproj: Turn on dead code stripping
2082 for deployment builds.
2083
20842005-08-22 Andre Boule <aboule@apple.com>
2085
2086 Reviewed by Ken.
2087
2088 * JavaScriptCore.xcodeproj/project.pbxproj: Rename purple target to Purple
2089 * Makefile.am: Support multiple target building using makefile
2090
20912005-08-22 Ken Kocienda <kocienda@apple.com>
2092
2093 Reviewed by me
2094
2095 Merged in changes from the opensource tree.
2096
2097 2005-08-19 Darin Adler <darin@apple.com>
2098
2099 Reviewed by Maciej.
2100
2101 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4435
2102 speed up JavaScript by tweaking the Identifier class
2103
2104 * kjs/identifier.h: Add a new global nullIdentifier and make Identifier::null a function
2105 that returns it.
2106 * kjs/identifier.cpp: (KJS::Identifier::init): Initialize a global for the null identifier
2107 as well as all the other globals for special identifiers.
2108
2109 * kjs/ustring.h: (KJS::UString::UString): Make this empty constructor inline.
2110 * kjs/ustring.cpp: Remove the old non-inline version.
2111
2112 2005-08-19 Mitz Pettel <opendarwin.org@mitzpettel.com>
2113
2114 Reviewed by Maciej.
2115 Revised and landed by Darin.
2116
2117 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4474
2118 REGRESSION: Crash when using in-place operator on uninitialized array element
2119
2120 * kjs/nodes.cpp:
2121 (AssignResolveNode::evaluate): Remove unneeded "isSet" assertion.
2122 (AssignBracketNode::evaluate): Replace code that tested "isSet" with code that
2123 tests the return value of getPropertySlot.
2124
2125 * kjs/property_slot.h: Removed unneeded "isSet" function. Property slots are
2126 either uninitialized or set. There's no "initialized and not set" state.
2127
2128 2005-08-18 Adele Peterson <adele@apple.com>
2129
2130 Checked "Inline Functions Hidden" box
2131
2132 * JavaScriptCore.xcodeproj/project.pbxproj:
2133
21342005-08-19 Andre Boule <aboule@apple.com>
2135
2136 Reviewed by Me
2137
2138 Fixed info.plist reference in project file
2139
2140 * JavaScriptCore.xcodeproj/project.pbxproj
2141
21422005-08-17 Ken Kocienda <kocienda@apple.com>
2143
2144 Reviewed by me
2145
2146 Merged in changes from the opensource tree.
2147
2148 2005-08-16 Darin Adler <darin@apple.com>
2149
2150 Reviewed by Geoff.
2151
2152 - fixed crash in one of the JavaScript tests (introduced by my throwError change)
2153
2154 * kjs/nodes.cpp: (Node::setExceptionDetailsIfNeeded): Check if the exception is an
2155 object before setting the file and line number properties on it. Something to think
2156 about in the future -- do we really want to do this on any object that's thrown?
2157 How about limiting it to error objects that were created by the JavaScript engine?
2158
2159 - changed kjs_fast_malloc so we don't have two conflicting versions of the same function
2160
2161 * kjs/fast_malloc.h: Took out all the ifdefs from this header.
2162 * kjs/fast_malloc.cpp: Added non-NDEBUG versions of the functions that just call
2163 the system malloc, and put the NDEBUG versions in an #else.
2164
2165 2005-08-16 Darin Adler <darin@apple.com>
2166
2167 Reviewed by Geoff.
2168
2169 - clean up exported symbols that are not in a "KJS" namespace
2170
2171 * bindings/NP_jsobject.cpp: (identiferFromNPIdentifier): Marked this function static
2172 so it no longer has external linkage.
2173 * bindings/c/c_utility.h: Put all this stuff inside the KJS namespace.
2174 * bindings/c/c_utility.cpp: Also marked some globals static so they don't have external
2175 linkage; not as important given the namespace.
2176 * bindings/npruntime.cpp: Marked functions static so they no longer have internal linkage.
2177 Also removed unused _NPN_SetExceptionWithUTF8 function (not in header, had C++ linkage!).
2178
2179 * bindings/jni/jni_utility.cpp: (KJS::Bindings::getJavaVM): Call KJS_GetCreatedJavaVMs
2180 using the soft linking header, instead of calling the JNI call. This allows processes
2181 to link both JavaScriptCore and JavaVM without a symbol conflict.
2182 * bindings/softlinking.c:
2183 (loadFramework): Marked this function static so it no longer has external linkage.
2184 (getFunctionPointer): Ditto.
2185 (KJS_GetCreatedJavaVMs): Renamed this so it has a KJS prefix.
2186
2187 * JavaScriptCore.xcodeproj/project.pbxproj: Added softlinking.h.
2188 * bindings/softlinking.h: Added.
2189
2190 * kjs/nodes2string.cpp: (streamAssignmentOperatorTo): Marked this function static so it
2191 no longer has external linkage.
2192
2193 2005-08-15 Darin Adler <darin@apple.com>
2194
2195 Reviewed by Geoff.
2196
2197 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4437
2198 clean up error creation with new throwError function
2199
2200 * bindings/NP_jsobject.cpp:
2201 (_NPN_SetException):
2202 * bindings/jni/jni_instance.cpp:
2203 (JavaInstance::invokeMethod):
2204 * bindings/jni/jni_runtime.cpp:
2205 (JavaField::dispatchValueFromInstance):
2206 (JavaField::dispatchSetValueToInstance):
2207 * bindings/objc/WebScriptObject.mm:
2208 (-[WebScriptObject _initializeWithObjectImp:originExecutionContext:executionContext:]):
2209 (-[WebScriptObject _initWithObjectImp:originExecutionContext:executionContext:]):
2210 (+[WebScriptObject throwException:]):
2211 (-[WebScriptObject setException:]):
2212 (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:]):
2213 * bindings/objc/objc_class.h:
2214 (KJS::Bindings::ObjcClass::~ObjcClass):
2215 (KJS::Bindings::ObjcClass::ObjcClass):
2216 (KJS::Bindings::ObjcClass::operator=):
2217 (KJS::Bindings::ObjcClass::constructorAt):
2218 (KJS::Bindings::ObjcClass::numConstructors):
2219 * bindings/objc/objc_header.h:
2220 * bindings/objc/objc_runtime.h:
2221 (KJS::Bindings::ObjcField::~ObjcField):
2222 (KJS::Bindings::ObjcField::ObjcField):
2223 (KJS::Bindings::ObjcField::operator=):
2224 (KJS::Bindings::ObjcMethod::ObjcMethod):
2225 (KJS::Bindings::ObjcMethod::~ObjcMethod):
2226 (KJS::Bindings::ObjcMethod::operator=):
2227 * bindings/objc/objc_runtime.mm:
2228 (ObjcField::valueFromInstance):
2229 (ObjcField::setValueToInstance):
2230 (ObjcArray::setValueAt):
2231 (ObjcArray::valueAt):
2232 * bindings/objc/objc_utility.h:
2233 * bindings/objc/objc_utility.mm:
2234 (KJS::Bindings::JSMethodNameToObjCMethodName):
2235 (KJS::Bindings::convertValueToObjcValue):
2236 (KJS::Bindings::convertNSStringToString):
2237 (KJS::Bindings::convertObjcValueToValue):
2238 (KJS::Bindings::objcValueTypeForType):
2239 (KJS::Bindings::createObjcInstanceForValue):
2240 (KJS::Bindings::throwError):
2241 * bindings/runtime.h:
2242 (KJS::Bindings::Parameter::~Parameter):
2243 (KJS::Bindings::Method::~Method):
2244 (KJS::Bindings::Instance::Instance):
2245 (KJS::Bindings::Instance::begin):
2246 (KJS::Bindings::Instance::end):
2247 (KJS::Bindings::Instance::getValueOfUndefinedField):
2248 (KJS::Bindings::Instance::supportsSetValueOfUndefinedField):
2249 (KJS::Bindings::Instance::setValueOfUndefinedField):
2250 (KJS::Bindings::Instance::valueOf):
2251 * bindings/runtime_array.cpp:
2252 (RuntimeArrayImp::put):
2253 * bindings/runtime_object.h:
2254 (KJS::RuntimeObjectImp::setInternalInstance):
2255 (KJS::RuntimeObjectImp::getInternalInstance):
2256 * kjs/array_object.cpp:
2257 (getProperty):
2258 (ArrayProtoFuncImp::callAsFunction):
2259 (ArrayObjectImp::construct):
2260 * kjs/bool_object.cpp:
2261 (BooleanProtoFuncImp::callAsFunction):
2262 * kjs/date_object.cpp:
2263 (KJS::DateProtoFuncImp::callAsFunction):
2264 * kjs/function.cpp:
2265 (KJS::decode):
2266 (KJS::GlobalFuncImp::callAsFunction):
2267 * kjs/function_object.cpp:
2268 (FunctionProtoFuncImp::callAsFunction):
2269 (FunctionObjectImp::construct):
2270 * kjs/internal.cpp:
2271 (KJS::UndefinedImp::toObject):
2272 (KJS::NullImp::toObject):
2273 (KJS::InterpreterImp::evaluate):
2274 (KJS::InternalFunctionImp::hasInstance):
2275 * kjs/nodes.cpp:
2276 (Node::throwError):
2277 (substitute):
2278 (Node::setExceptionDetailsIfNeeded):
2279 (undefinedVariableError):
2280 (ProgramNode::ProgramNode):
2281 * kjs/number_object.cpp:
2282 (NumberProtoFuncImp::callAsFunction):
2283 * kjs/object.cpp:
2284 (KJS::ObjectImp::call):
2285 (KJS::ObjectImp::defaultValue):
2286 (KJS::Error::create):
2287 (KJS::throwError):
2288 * kjs/object.h:
2289 (KJS::ObjectImp::clearProperties):
2290 (KJS::ObjectImp::getPropertySlot):
2291 (KJS::ObjectImp::getOwnPropertySlot):
2292 * kjs/object_object.cpp:
2293 (ObjectProtoFuncImp::callAsFunction):
2294 * kjs/reference.cpp:
2295 (KJS::Reference::getBase):
2296 (KJS::Reference::getValue):
2297 (KJS::Reference::putValue):
2298 (KJS::Reference::deleteValue):
2299 * kjs/regexp_object.cpp:
2300 (RegExpProtoFuncImp::callAsFunction):
2301 (RegExpObjectImp::construct):
2302 * kjs/string_object.cpp:
2303 (StringProtoFuncImp::callAsFunction):
2304
2305 2005-08-15 Anders Carlsson <andersca@mac.com>
2306
2307 Reviewed by Darin.
2308
2309 * tests/mozilla/ecma_3/Date/15.9.5.5.js:
2310 Remove the code which tests that Date.toLocaleString should be parsable
2311 by Date.parse. That is not true according to the spec.
2312
2313 2005-08-15 Darin Adler <darin@apple.com>
2314
2315 Reviewed by Geoff.
2316
2317 * kjs/collector.cpp: (KJS::Collector::allocate): Use a local instead of a global in one
2318 more place; slight speedup.
2319
23202005-08-15 Andre Boule <set EMAIL_ADDRESS environment variable>
2321
2322 Reviewed by me.
2323
2324 * JavaScriptCore.xcodeproj/project.pbxproj:
2325 Added Purple target. Checking in quick before new version - patching is nasty for large changes
2326 in project files
2327
23282005-08-15 Ken Kocienda <kocienda@apple.com>
2329
2330 Reviewed by me
2331
2332 Missed adding this file when I merged.
2333
2334 * kjs/grammar_types.h: Added.
2335
23362005-08-15 Ken Kocienda <kocienda@apple.com>
2337
2338 Reviewed by me
2339
2340 Merged in changes from the opensource tree.
2341
2342 2005-08-14 Darin Adler <darin@apple.com>
2343
2344 Reviewed by Maciej.
2345
2346 - fixed crash observed on one of the Apple-only layout tests
2347
2348 * kjs/property_map.cpp: (KJS::PropertyMap::mark): Change code to understand that deleted
2349 entries have a value of NULL, so the deleted sentinel count doesn't need to be included
2350 in the count of things to mark since we're ignoring the keys.
2351
2352 2005-08-14 Darin Adler <darin@apple.com>
2353
2354 Reviewed by Maciej.
2355
2356 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4421
2357 speed up JavaScript by inlining some label stack functions
2358
2359 * kjs/internal.h: Removed the copy constructor and assignment operator for LabelStack.
2360 They were unused, and the implementations had bugs; I removed them rather than fixing them.
2361 Also removed the clear function, since that was only needed to help the assignment operator
2362 share code with the destructor, and was not efficient enough for the destructor.
2363 (KJS::LabelStack::~LabelStack): Made this inline. Also used an efficient implementation
2364 that's nice and fast when the stack is empty, better than the old clear() function which
2365 used to keep updating and refetching "tos" each time through the loop.
2366 (KJS::LabelStack::pop): Made this inline.
2367
2368 * kjs/internal.cpp: Deleted the now-inline functions and the obsolete functions. Also
2369 deleted a commented-out line of code.
2370
2371 2005-08-14 Darin Adler <darin@apple.com>
2372
2373 Reviewed by Maciej.
2374
2375 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4419
2376 speed up JavaScript by improving KJS::List
2377
2378 my measurements show an improvement of 1% on iBench JavaScript
2379
2380 * kjs/list.cpp: Rearrange list to make the values and free list share the same storage,
2381 which saves 4 bytes per list. Also remove the pointers used only on the heap from the
2382 lists that are in the pool, which saves 8 bytes per list. Moving the free list pointer
2383 closer to the start of the list object also speeds up access to the free list. New
2384 "HeapListImp" struct is used only for the lists on the heap.
2385 (KJS::List::markProtectedLists): Shadowed global variable in local and updated for the
2386 new terminology ("heap" instead of "outside pool").
2387 (KJS::allocateListImp): Updated for new terminology.
2388 (KJS::List::release): Moved the code from deallocateListImp in here -- it wasn't being
2389 inlined and didn't need to be in a separate function.
2390
2391 2005-08-14 Darin Adler <darin@apple.com>
2392
2393 Reviewed by Maciej.
2394
2395 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4417
2396 speed up JavaScript with some small changes to the property map code
2397
2398 my measurements show an improvement of 2% on iBench JavaScript
2399
2400 * kjs/property_map.h: (KJS::PropertyMap::PropertyMap): Made the default constructor inline.
2401 * kjs/property_map.cpp:
2402 (KJS::PropertyMap::~PropertyMap): Changed loop to exit early once we know we've processed
2403 all the hash table entries, based on the count.
2404 (KJS::PropertyMap::mark): Ditto.
2405
2406 * kjs/object.h: Made an arbitrary change here to force recompiling so we pick up changes to
2407 property_map.h. Works around what seems to be an Xcode header dependency bug.
2408
2409 2005-08-14 Darin Adler <darin@apple.com>
2410
2411 Reviewed by Maciej.
2412
2413 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4416
2414 speed up JavaScript with some improvements to the garbage collector
2415
2416 my measurements show an improvement of 2% on iBench JavaScript
2417
2418 * kjs/collector.cpp:
2419 (KJS::Collector::allocate): Use local variables to shadow globals instead of repeatedly
2420 going at global variables. Tighten up loop implementations to make the common case fast.
2421 (KJS::Collector::markStackObjectsConservatively): Use local variables to shadow globals.
2422 Used a goto to eliminate a boolean since it was showing up in the profile.
2423 (KJS::Collector::markProtectedObjects): Iterate through the table using pointer rather
2424 than an index since the profile showed that generating better code.
2425 (KJS::Collector::collect): Added a special case for blocks where all cells are used,
2426 Use local variables to shadow globals. Eliminated a boolean by computing it another
2427 way (checking to see if the number of live objects changed). Also used local variables
2428 to shadow fields in the current cell when sweeping.
2429 (KJS::Collector::numReferencedObjects): Use AllocatedValueImp instead of ValueImp
2430 in one place -- means we get faster versions of various functions that don't worry
2431 about SimpleNumber.
2432 (KJS::className): Ditto.
2433 (KJS::Collector::rootObjectClasses): Ditto.
2434
2435 2005-08-14 Darin Adler <darin@apple.com>
2436
2437 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4344
2438 REGRESSION: JavaScript crash when going back from viewing a thread (NULL protoype)
2439
2440 * kjs/error_object.cpp: (NativeErrorImp::NativeErrorImp): Set proto in a more
2441 straightforward way. The old code set the proto to 0 and then to the correct value.
2442 This showed up as a "false positive" when searching for places that set prototype
2443 to NULL/0 so I fixed it.
2444
2445 * kjs/function_object.cpp: (FunctionPrototypeImp::FunctionPrototypeImp): Change to
2446 not pass an explicit "0" to the base class (InternalFunctionImp) constructor.
2447
2448 * kjs/internal.h: Added a default constructor for InternalFunctionImp.
2449 * kjs/internal.cpp: (KJS::InternalFunctionImp::InternalFunctionImp): Added the
2450 default constructor (empty body, just calls base class's default constructor).
2451
2452 * kjs/object.h:
2453 (KJS::ObjectImp::ObjectImp): Add an assertion to catch NULL prototypes earlier
2454 in Development builds.
2455 (KJS::ObjectImp::setPrototype): Ditto.
2456
2457 2005-08-12 Maciej Stachowiak <mjs@apple.com>
2458
2459 Reviewed by John.
2460
2461 - two simple speed improvements for a 3% speed gain
2462
2463 * JavaScriptCore.xcodeproj/project.pbxproj: turn on -fstrict-aliasing
2464
2465 * kjs/scope_chain.h:
2466 (KJS::ScopeChainIterator::ScopeChainIterator): Add a scope chain iterator
2467 so you can walk a scope chain without having to make a copy that you then mutate.
2468 (KJS::ScopeChainIterator::operator*): standard iterator operation
2469 (KJS::ScopeChainIterator::operator->): ditto
2470 (KJS::ScopeChainIterator::operator++): ditto
2471 (KJS::ScopeChainIterator::operator==): ditto
2472 (KJS::ScopeChainIterator::operator!=): ditto
2473 (KJS::ScopeChain::begin): Iterator for the top of the scope chain
2474 (KJS::ScopeChain::end): Iterator for one past the bottom (i.e. null)
2475 * kjs/nodes.cpp:
2476 (ResolveNode::evaluate): Use scope chain iterator instead of copying
2477 a scope chain and then modifying the copy
2478 (ResolveNode::evaluateReference): ditto
2479 (FunctionCallResolveNode::evaluate): ditto
2480 (AssignResolveNode::evaluate): ditto
2481
2482 2005-08-12 Maciej Stachowiak <mjs@apple.com>
2483
2484 Patch from Anders Carlsson, reviewed by me.
2485
2486 * kjs/nodes.h: Fix build breakage.
2487
2488 2005-08-12 Maciej Stachowiak <mjs@apple.com>
2489
2490 Reviewed by hyatt.
2491
2492 - refactor function calls, 3% speedup on JS iBench.
2493
2494 * kjs/grammar.y:
2495 * kjs/nodes.cpp:
2496 (Node::throwError): Added new useful variants.
2497 (FunctionCallValueNode::evaluate): New node to handle calls on expressions
2498 that are strictly values, not references.
2499 (FunctionCallValueNode::ref): ditto
2500 (FunctionCallValueNode::deref): ditto
2501 (FunctionCallResolveNode::evaluate): New node to handle calls on identifier
2502 expressions, so that they are looked up in the scope chain.
2503 (FunctionCallResolveNode::ref): ditto
2504 (FunctionCallResolveNode::deref): ditto
2505 (FunctionCallBracketNode::evaluate): New node to handle calls on bracket
2506 dereferences, so that the expression before brackets is used as the this
2507 object.
2508 (FunctionCallBracketNode::ref): ditto
2509 (FunctionCallBracketNode::deref): ditto
2510 (FunctionCallDotNode::evaluate): New node to handle calls on dot
2511 dereferences, so that the expression before the dot is used as the this
2512 object.
2513 (FunctionCallDotNode::ref): ditto
2514 (FunctionCallDotNode::deref): ditto
2515 (dotExprNotAnObjectString): helper function to avoid global variable access.
2516 (dotExprDoesNotAllowCallsString): ditto
2517 * kjs/nodes.h: Declared new classes.
2518 * kjs/nodes2string.cpp:
2519 (FunctionCallValueNode::streamTo): Added - serializes the appropriate function call
2520 (FunctionCallResolveNode::streamTo): ditto
2521 (FunctionCallBracketNode::streamTo): ditto
2522 (FunctionCallParenBracketNode::streamTo): ditto
2523 (FunctionCallDotNode::streamTo): ditto
2524 (FunctionCallParenDotNode::streamTo): ditto
2525 * kjs/object.h:
2526 (KJS::ObjectImp::isActivation): Change how activation objects are
2527 detected in the scope chain, a virtual function is cheaper than the
2528 old inheritance test.
2529 * kjs/function.h:
2530 (KJS::ActivationImp::isActivation): Ditto.
2531
2532 2005-08-11 Maciej Stachowiak <mjs@apple.com>
2533
2534 - added missing file from earlier checkin
2535
2536 * kjs/grammar_types.h: Added.
2537 (KJS::makeNodePair):
2538 (KJS::makeNodeWithIdent):
2539
2540 2005-08-11 Maciej Stachowiak <mjs@apple.com>
2541
2542 Reviewed by Geoff.
2543
2544 * kjs/date_object.cpp:
2545 (timetUsingCF): Fix one of the date tests my making the CF version of mktime
2546 have the same quirk about the DST field as the real mktime.
2547 * tests/mozilla/expected.html: Updated for newly fixed test.
2548
2549 2005-08-11 Maciej Stachowiak <mjs@apple.com>
2550
2551 - updated for one of the tests that Darin incidentally fixed.
2552
2553 * tests/mozilla/expected.html:
2554
2555 2005-08-10 Maciej Stachowiak <mjs@apple.com>
2556
2557 Reviewed by Geoff.
2558
2559 Refactor assignment grammar to avoid Reference type, and to later
2560 be able to take advantage of writeable PropertySlots, when those
2561 are added. I also fixed a minor bug, turning a function to a
2562 string lost parentheses, I made sure they are printed at least
2563 where semantically significant.
2564
2565 Test cases: see WebCore
2566
2567 * kjs/grammar.y: Change grammar so that assignment expressions are parsed
2568 directly to nodes that know how to set the kind of location being assigned, instead
2569 of having a generic assign node that counts on evaluateReference.
2570 * kjs/lexer.cpp: Include grammar_types.h.
2571 * kjs/nodes.cpp:
2572 (BracketAccessorNode): Renamed from AccessorNode1 for clarity.
2573 (DotAccessorNode): Renamed from AccessorNode2 for clarity.
2574 (combineForAssignment): Inline function for doing the proper kind of
2575 operation for various update assignments like += or *=.
2576 (AssignResolveNode): Node that handles assignment to a bare identifier.
2577 (AssignDotNode): Node that handles assignments of the form EXPR . IDENT = EXPR
2578 (AssignBracketNode): EXPR [ IDENT ] = EXPR
2579 * kjs/nodes.h: Updated for declarations/renames of new classes.
2580 * kjs/nodes2string.cpp:
2581 (GroupNode::streamTo): Fixed to print parens around the expression.
2582 (BracketAccessorNode::streamTo): Renamed.
2583 (DotAccessorNode::streamTo): Renamed.
2584 (AssignResolveNode::streamTo): Added.
2585 (AssignBracketNode::streamTo): Added.
2586 (AssignDotNode::streamTo): Added.
2587 (streamAssignmentOperatorTo): helper function for the above
2588 * kjs/property_slot.h:
2589 (KJS::PropertySlot::isSet): Made this const.
2590
2591 2005-08-10 Adele Peterson <adele@apple.com>
2592
2593 Bumping version to 420+
2594
2595 * Info.plist:
2596
2597 2005-08-10 Geoffrey Garen <ggaren@apple.com>
2598
2599 -fixed <rdar://problem/4151132> REGRESSION: Some applet liveconnect calls
2600 throws privilege exception.
2601
2602 Reviewed by richard and mjs.
2603
2604 -I removed the global static JavaClass cache, since it violated Java
2605 security to cache classes between websites and applets.
2606
2607 * bindings/jni/jni_class.cpp:
2608 -removed global static cache dictionary
2609 -instance constructor and destructor now do the work that used to
2610 be done by static factory methods
2611 -removed obsolete functions
2612 (JavaClass::JavaClass):
2613 (JavaClass::~JavaClass):
2614 * bindings/jni/jni_class.h:
2615 -removed obsolete function declarations
2616 -made copying private since it's unused and it's also not clear
2617 excatly how copying would work with Java security
2618 -made default construction private since it's meaningless
2619 * bindings/jni/jni_instance.cpp:
2620 -removed obsolete functions
2621 (JavaInstance::~JavaInstance):
2622 (JavaInstance::getClass):
2623 * bindings/jni/jni_instance.h:
2624 -made copying private since it's unused and it's also not clear
2625 excatly how copying would work with Java security
2626 -made default construction private since it's meaningless
2627
26282005-08-10 Ken Kocienda <kocienda@apple.com>
2629
2630 Reviewed by me
2631
2632 Merged in changes from the opensource tree.
2633
2634 2005-08-08 Geoffrey Garen <ggaren@apple.com>
2635
2636 -fixed crash caused by fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=4313
2637
2638 - exceptionDescription now gets explicitly initialized to NULL in all
2639 the places listed below -- our wrapper classes used to take care of this
2640 automagically
2641
2642 * bindings/jni/jni_instance.cpp:
2643 (JavaInstance::invokeMethod):
2644 * bindings/jni/jni_runtime.cpp:
2645 (JavaField::dispatchValueFromInstance):
2646 (JavaField::dispatchSetValueToInstance):
2647
2648 2005-08-08 Darin Adler <darin@apple.com>
2649
2650 - forgot to delete an obsolete file
2651
2652 * kjs/object_wrapper.h: Deleted.
2653
26542005-08-08 Ken Kocienda <kocienda@apple.com>
2655
2656 Reviewed by me
2657
2658 Merged in changes from the opensource tree.
2659
2660 2005-08-07 Darin Adler <darin@apple.com>
2661
2662 - fixed two problems compiling with gcc 4.0
2663
2664 * kjs/array_object.cpp: (ArrayProtoFuncImp::callAsFunction): Initialized a
2665 variable to quiet an erroneous warning.
2666 * kjs/date_object.cpp: (KJS::makeTime): Removed extraneous KJS:: prefix.
2667
2668 2005-08-07 Darin Adler <darin@apple.com>
2669
2670 Rubber stamped by Maciej.
2671
2672 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4313
2673 eliminate KJS::Value and KJS::Object smart pointer wrappers (for simplicity and speed)
2674
2675 * JavaScriptCore.xcodeproj/project.pbxproj: Removed object_wrapper.h.
2676
2677 Global replaces and other wonderful stuff.
2678
2679 * bindings/NP_jsobject.cpp:
2680 (_NPN_Invoke):
2681 (_NPN_Evaluate):
2682 (_NPN_GetProperty):
2683 (_NPN_SetProperty):
2684 (_NPN_HasMethod):
2685 (_NPN_SetException):
2686 * bindings/c/c_instance.cpp:
2687 (KJS::Bindings::CInstance::CInstance):
2688 (KJS::Bindings::CInstance::invokeMethod):
2689 (KJS::Bindings::CInstance::invokeDefaultMethod):
2690 (KJS::Bindings::CInstance::defaultValue):
2691 (KJS::Bindings::CInstance::stringValue):
2692 (KJS::Bindings::CInstance::numberValue):
2693 (KJS::Bindings::CInstance::booleanValue):
2694 (KJS::Bindings::CInstance::valueOf):
2695 * bindings/c/c_instance.h:
2696 * bindings/c/c_runtime.cpp:
2697 (CField::valueFromInstance):
2698 (CField::setValueToInstance):
2699 * bindings/c/c_runtime.h:
2700 * bindings/c/c_utility.cpp:
2701 (convertNPStringToUTF16):
2702 (convertUTF8ToUTF16):
2703 (coerceValueToNPVariantStringType):
2704 (convertValueToNPVariant):
2705 (convertNPVariantToValue):
2706 * bindings/c/c_utility.h:
2707 * bindings/jni/jni_instance.cpp:
2708 (JavaInstance::stringValue):
2709 (JavaInstance::numberValue):
2710 (JavaInstance::booleanValue):
2711 (JavaInstance::invokeMethod):
2712 (JavaInstance::invokeDefaultMethod):
2713 (JavaInstance::defaultValue):
2714 (JavaInstance::valueOf):
2715 * bindings/jni/jni_instance.h:
2716 * bindings/jni/jni_jsobject.cpp:
2717 (JSObject::invoke):
2718 (JSObject::call):
2719 (JSObject::eval):
2720 (JSObject::getMember):
2721 (JSObject::getSlot):
2722 (JSObject::toString):
2723 (JSObject::convertValueToJObject):
2724 (JSObject::convertJObjectToValue):
2725 (JSObject::listFromJArray):
2726 * bindings/jni/jni_jsobject.h:
2727 * bindings/jni/jni_objc.mm:
2728 (KJS::Bindings::dispatchJNICall):
2729 * bindings/jni/jni_runtime.cpp:
2730 (JavaArray::convertJObjectToArray):
2731 (JavaField::dispatchValueFromInstance):
2732 (JavaField::valueFromInstance):
2733 (JavaField::dispatchSetValueToInstance):
2734 (JavaField::setValueToInstance):
2735 (JavaArray::setValueAt):
2736 (JavaArray::valueAt):
2737 * bindings/jni/jni_runtime.h:
2738 (KJS::Bindings::JavaString::ustring):
2739 * bindings/jni/jni_utility.cpp:
2740 (KJS::Bindings::getJavaVM):
2741 (KJS::Bindings::getJNIEnv):
2742 (KJS::Bindings::getMethodID):
2743 (KJS::Bindings::callJNIVoidMethod):
2744 (KJS::Bindings::callJNIObjectMethod):
2745 (KJS::Bindings::callJNIBooleanMethod):
2746 (KJS::Bindings::callJNIStaticBooleanMethod):
2747 (KJS::Bindings::callJNIByteMethod):
2748 (KJS::Bindings::callJNICharMethod):
2749 (KJS::Bindings::callJNIShortMethod):
2750 (KJS::Bindings::callJNIIntMethod):
2751 (KJS::Bindings::callJNILongMethod):
2752 (KJS::Bindings::callJNIFloatMethod):
2753 (KJS::Bindings::callJNIDoubleMethod):
2754 (KJS::Bindings::callJNIVoidMethodA):
2755 (KJS::Bindings::callJNIObjectMethodA):
2756 (KJS::Bindings::callJNIByteMethodA):
2757 (KJS::Bindings::callJNICharMethodA):
2758 (KJS::Bindings::callJNIShortMethodA):
2759 (KJS::Bindings::callJNIIntMethodA):
2760 (KJS::Bindings::callJNILongMethodA):
2761 (KJS::Bindings::callJNIFloatMethodA):
2762 (KJS::Bindings::callJNIDoubleMethodA):
2763 (KJS::Bindings::callJNIBooleanMethodA):
2764 (KJS::Bindings::callJNIVoidMethodIDA):
2765 (KJS::Bindings::callJNIObjectMethodIDA):
2766 (KJS::Bindings::callJNIByteMethodIDA):
2767 (KJS::Bindings::callJNICharMethodIDA):
2768 (KJS::Bindings::callJNIShortMethodIDA):
2769 (KJS::Bindings::callJNIIntMethodIDA):
2770 (KJS::Bindings::callJNILongMethodIDA):
2771 (KJS::Bindings::callJNIFloatMethodIDA):
2772 (KJS::Bindings::callJNIDoubleMethodIDA):
2773 (KJS::Bindings::callJNIBooleanMethodIDA):
2774 (KJS::Bindings::getCharactersFromJString):
2775 (KJS::Bindings::releaseCharactersForJString):
2776 (KJS::Bindings::getCharactersFromJStringInEnv):
2777 (KJS::Bindings::releaseCharactersForJStringInEnv):
2778 (KJS::Bindings::getUCharactersFromJStringInEnv):
2779 (KJS::Bindings::releaseUCharactersForJStringInEnv):
2780 (KJS::Bindings::JNITypeFromClassName):
2781 (KJS::Bindings::signatureFromPrimitiveType):
2782 (KJS::Bindings::JNITypeFromPrimitiveType):
2783 (KJS::Bindings::getJNIField):
2784 (KJS::Bindings::convertValueToJValue):
2785 * bindings/jni/jni_utility.h:
2786 * bindings/objc/WebScriptObject.mm:
2787 (_didExecute):
2788 (-[WebScriptObject _initializeWithObjectImp:originExecutionContext:Bindings::executionContext:Bindings::]):
2789 (-[WebScriptObject _initWithObjectImp:originExecutionContext:Bindings::executionContext:Bindings::]):
2790 (-[WebScriptObject _imp]):
2791 (-[WebScriptObject _executionContext]):
2792 (-[WebScriptObject _setExecutionContext:]):
2793 (-[WebScriptObject _originExecutionContext]):
2794 (-[WebScriptObject _setOriginExecutionContext:]):
2795 (+[WebScriptObject throwException:]):
2796 (listFromNSArray):
2797 (-[WebScriptObject callWebScriptMethod:withArguments:]):
2798 (-[WebScriptObject evaluateWebScript:]):
2799 (-[WebScriptObject setValue:forKey:]):
2800 (-[WebScriptObject valueForKey:]):
2801 (-[WebScriptObject removeWebScriptKey:]):
2802 (-[WebScriptObject stringRepresentation]):
2803 (-[WebScriptObject webScriptValueAtIndex:]):
2804 (-[WebScriptObject setException:]):
2805 (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:Bindings::]):
2806 * bindings/objc/WebScriptObjectPrivate.h:
2807 * bindings/objc/objc_class.h:
2808 * bindings/objc/objc_class.mm:
2809 (KJS::Bindings::ObjcClass::fallbackObject):
2810 * bindings/objc/objc_instance.h:
2811 * bindings/objc/objc_instance.mm:
2812 (ObjcInstance::invokeMethod):
2813 (ObjcInstance::invokeDefaultMethod):
2814 (ObjcInstance::setValueOfField):
2815 (ObjcInstance::setValueOfUndefinedField):
2816 (ObjcInstance::getValueOfField):
2817 (ObjcInstance::getValueOfUndefinedField):
2818 (ObjcInstance::defaultValue):
2819 (ObjcInstance::stringValue):
2820 (ObjcInstance::numberValue):
2821 (ObjcInstance::booleanValue):
2822 (ObjcInstance::valueOf):
2823 * bindings/objc/objc_runtime.h:
2824 * bindings/objc/objc_runtime.mm:
2825 (ObjcField::valueFromInstance):
2826 (convertValueToObjcObject):
2827 (ObjcField::setValueToInstance):
2828 (ObjcArray::setValueAt):
2829 (ObjcArray::valueAt):
2830 (ObjcFallbackObjectImp::put):
2831 (ObjcFallbackObjectImp::callAsFunction):
2832 (ObjcFallbackObjectImp::defaultValue):
2833 * bindings/objc/objc_utility.h:
2834 * bindings/objc/objc_utility.mm:
2835 (Bindings::JSMethodNameToObjCMethodName):
2836 (Bindings::convertValueToObjcValue):
2837 (Bindings::convertNSStringToString):
2838 (Bindings::convertObjcValueToValue):
2839 (Bindings::objcValueTypeForType):
2840 (Bindings::createObjcInstanceForValue):
2841 * bindings/runtime.cpp:
2842 (Instance::getValueOfField):
2843 (Instance::setValueOfField):
2844 (Instance::createRuntimeObject):
2845 (Instance::createLanguageInstanceForValue):
2846 * bindings/runtime.h:
2847 (KJS::Bindings::Constructor::~Constructor):
2848 (KJS::Bindings::Field::~Field):
2849 (KJS::Bindings::MethodList::MethodList):
2850 (KJS::Bindings::Class::fallbackObject):
2851 (KJS::Bindings::Class::~Class):
2852 (KJS::Bindings::Instance::Instance):
2853 (KJS::Bindings::Instance::getValueOfUndefinedField):
2854 (KJS::Bindings::Instance::supportsSetValueOfUndefinedField):
2855 (KJS::Bindings::Instance::setValueOfUndefinedField):
2856 (KJS::Bindings::Instance::valueOf):
2857 (KJS::Bindings::Instance::setExecutionContext):
2858 (KJS::Bindings::Instance::~Instance):
2859 (KJS::Bindings::Array::~Array):
2860 * bindings/runtime_array.cpp:
2861 (RuntimeArrayImp::RuntimeArrayImp):
2862 (RuntimeArrayImp::lengthGetter):
2863 (RuntimeArrayImp::indexGetter):
2864 (RuntimeArrayImp::put):
2865 * bindings/runtime_array.h:
2866 * bindings/runtime_method.cpp:
2867 (RuntimeMethodImp::lengthGetter):
2868 (RuntimeMethodImp::callAsFunction):
2869 * bindings/runtime_method.h:
2870 * bindings/runtime_object.cpp:
2871 (RuntimeObjectImp::fallbackObjectGetter):
2872 (RuntimeObjectImp::fieldGetter):
2873 (RuntimeObjectImp::methodGetter):
2874 (RuntimeObjectImp::getOwnPropertySlot):
2875 (RuntimeObjectImp::put):
2876 (RuntimeObjectImp::defaultValue):
2877 (RuntimeObjectImp::callAsFunction):
2878 * bindings/runtime_object.h:
2879 * kjs/array_instance.h:
2880 * kjs/array_object.cpp:
2881 (ArrayInstanceImp::ArrayInstanceImp):
2882 (ArrayInstanceImp::lengthGetter):
2883 (ArrayInstanceImp::getOwnPropertySlot):
2884 (ArrayInstanceImp::put):
2885 (ArrayInstanceImp::propList):
2886 (ArrayInstanceImp::setLength):
2887 (compareByStringForQSort):
2888 (compareWithCompareFunctionForQSort):
2889 (ArrayInstanceImp::sort):
2890 (ArrayInstanceImp::pushUndefinedObjectsToEnd):
2891 (ArrayPrototypeImp::ArrayPrototypeImp):
2892 (ArrayProtoFuncImp::ArrayProtoFuncImp):
2893 (ArrayProtoFuncImp::callAsFunction):
2894 (ArrayObjectImp::ArrayObjectImp):
2895 (ArrayObjectImp::construct):
2896 (ArrayObjectImp::callAsFunction):
2897 * kjs/array_object.h:
2898 * kjs/bool_object.cpp:
2899 (BooleanPrototypeImp::BooleanPrototypeImp):
2900 (BooleanProtoFuncImp::BooleanProtoFuncImp):
2901 (BooleanProtoFuncImp::callAsFunction):
2902 (BooleanObjectImp::BooleanObjectImp):
2903 (BooleanObjectImp::construct):
2904 (BooleanObjectImp::callAsFunction):
2905 * kjs/bool_object.h:
2906 * kjs/collector.cpp:
2907 (KJS::Collector::markStackObjectsConservatively):
2908 (KJS::Collector::collect):
2909 (KJS::className):
2910 * kjs/completion.h:
2911 (KJS::Completion::Completion):
2912 (KJS::Completion::value):
2913 (KJS::Completion::isValueCompletion):
2914 * kjs/context.h:
2915 (KJS::ContextImp::variableObject):
2916 (KJS::ContextImp::setVariableObject):
2917 (KJS::ContextImp::thisValue):
2918 (KJS::ContextImp::activationObject):
2919 (KJS::ContextImp::pushScope):
2920 * kjs/date_object.cpp:
2921 (formatLocaleDate):
2922 (KJS::timeFromArgs):
2923 (KJS::DatePrototypeImp::DatePrototypeImp):
2924 (KJS::DateProtoFuncImp::DateProtoFuncImp):
2925 (KJS::DateProtoFuncImp::callAsFunction):
2926 (KJS::DateObjectImp::DateObjectImp):
2927 (KJS::DateObjectImp::construct):
2928 (KJS::DateObjectImp::callAsFunction):
2929 (KJS::DateObjectFuncImp::DateObjectFuncImp):
2930 (KJS::DateObjectFuncImp::callAsFunction):
2931 (KJS::parseDate):
2932 (KJS::KRFCDate_parseDate):
2933 (KJS::timeClip):
2934 * kjs/date_object.h:
2935 * kjs/debugger.cpp:
2936 (Debugger::exception):
2937 (Debugger::callEvent):
2938 (Debugger::returnEvent):
2939 * kjs/debugger.h:
2940 * kjs/error_object.cpp:
2941 (ErrorPrototypeImp::ErrorPrototypeImp):
2942 (ErrorProtoFuncImp::ErrorProtoFuncImp):
2943 (ErrorProtoFuncImp::callAsFunction):
2944 (ErrorObjectImp::ErrorObjectImp):
2945 (ErrorObjectImp::construct):
2946 (ErrorObjectImp::callAsFunction):
2947 (NativeErrorPrototypeImp::NativeErrorPrototypeImp):
2948 (NativeErrorImp::NativeErrorImp):
2949 (NativeErrorImp::construct):
2950 (NativeErrorImp::callAsFunction):
2951 * kjs/error_object.h:
2952 * kjs/function.cpp:
2953 (KJS::FunctionImp::FunctionImp):
2954 (KJS::FunctionImp::callAsFunction):
2955 (KJS::FunctionImp::processParameters):
2956 (KJS::FunctionImp::argumentsGetter):
2957 (KJS::FunctionImp::lengthGetter):
2958 (KJS::FunctionImp::put):
2959 (KJS::DeclaredFunctionImp::DeclaredFunctionImp):
2960 (KJS::DeclaredFunctionImp::construct):
2961 (KJS::ArgumentsImp::ArgumentsImp):
2962 (KJS::ArgumentsImp::mappedIndexGetter):
2963 (KJS::ArgumentsImp::put):
2964 (KJS::ActivationImp::argumentsGetter):
2965 (KJS::GlobalFuncImp::GlobalFuncImp):
2966 (KJS::encode):
2967 (KJS::decode):
2968 (KJS::GlobalFuncImp::callAsFunction):
2969 * kjs/function.h:
2970 * kjs/function_object.cpp:
2971 (FunctionPrototypeImp::FunctionPrototypeImp):
2972 (FunctionPrototypeImp::callAsFunction):
2973 (FunctionProtoFuncImp::FunctionProtoFuncImp):
2974 (FunctionProtoFuncImp::callAsFunction):
2975 (FunctionObjectImp::FunctionObjectImp):
2976 (FunctionObjectImp::construct):
2977 (FunctionObjectImp::callAsFunction):
2978 * kjs/function_object.h:
2979 * kjs/internal.cpp:
2980 (KJS::UndefinedImp::toPrimitive):
2981 (KJS::UndefinedImp::toObject):
2982 (KJS::NullImp::toPrimitive):
2983 (KJS::NullImp::toObject):
2984 (KJS::BooleanImp::toPrimitive):
2985 (KJS::BooleanImp::toObject):
2986 (KJS::StringImp::toPrimitive):
2987 (KJS::StringImp::toObject):
2988 (KJS::NumberImp::toPrimitive):
2989 (KJS::NumberImp::toObject):
2990 (KJS::NumberImp::getUInt32):
2991 (KJS::LabelStack::push):
2992 (KJS::ContextImp::ContextImp):
2993 (KJS::InterpreterImp::globalInit):
2994 (KJS::InterpreterImp::globalClear):
2995 (KJS::InterpreterImp::InterpreterImp):
2996 (KJS::InterpreterImp::initGlobalObject):
2997 (KJS::InterpreterImp::clear):
2998 (KJS::InterpreterImp::mark):
2999 (KJS::InterpreterImp::evaluate):
3000 (KJS::InternalFunctionImp::hasInstance):
3001 (KJS::roundValue):
3002 (KJS::printInfo):
3003 * kjs/internal.h:
3004 (KJS::InterpreterImp::builtinObject):
3005 (KJS::InterpreterImp::builtinFunction):
3006 (KJS::InterpreterImp::builtinArray):
3007 (KJS::InterpreterImp::builtinBoolean):
3008 (KJS::InterpreterImp::builtinString):
3009 (KJS::InterpreterImp::builtinNumber):
3010 (KJS::InterpreterImp::builtinDate):
3011 (KJS::InterpreterImp::builtinRegExp):
3012 (KJS::InterpreterImp::builtinError):
3013 (KJS::InterpreterImp::builtinObjectPrototype):
3014 (KJS::InterpreterImp::builtinFunctionPrototype):
3015 (KJS::InterpreterImp::builtinArrayPrototype):
3016 (KJS::InterpreterImp::builtinBooleanPrototype):
3017 (KJS::InterpreterImp::builtinStringPrototype):
3018 (KJS::InterpreterImp::builtinNumberPrototype):
3019 (KJS::InterpreterImp::builtinDatePrototype):
3020 (KJS::InterpreterImp::builtinRegExpPrototype):
3021 (KJS::InterpreterImp::builtinErrorPrototype):
3022 (KJS::InterpreterImp::builtinEvalError):
3023 (KJS::InterpreterImp::builtinRangeError):
3024 (KJS::InterpreterImp::builtinReferenceError):
3025 (KJS::InterpreterImp::builtinSyntaxError):
3026 (KJS::InterpreterImp::builtinTypeError):
3027 (KJS::InterpreterImp::builtinURIError):
3028 (KJS::InterpreterImp::builtinEvalErrorPrototype):
3029 (KJS::InterpreterImp::builtinRangeErrorPrototype):
3030 (KJS::InterpreterImp::builtinReferenceErrorPrototype):
3031 (KJS::InterpreterImp::builtinSyntaxErrorPrototype):
3032 (KJS::InterpreterImp::builtinTypeErrorPrototype):
3033 (KJS::InterpreterImp::builtinURIErrorPrototype):
3034 * kjs/interpreter.cpp:
3035 (Context::variableObject):
3036 (Context::thisValue):
3037 (Interpreter::Interpreter):
3038 (Interpreter::globalObject):
3039 (Interpreter::evaluate):
3040 (Interpreter::builtinObject):
3041 (Interpreter::builtinFunction):
3042 (Interpreter::builtinArray):
3043 (Interpreter::builtinBoolean):
3044 (Interpreter::builtinString):
3045 (Interpreter::builtinNumber):
3046 (Interpreter::builtinDate):
3047 (Interpreter::builtinRegExp):
3048 (Interpreter::builtinError):
3049 (Interpreter::builtinObjectPrototype):
3050 (Interpreter::builtinFunctionPrototype):
3051 (Interpreter::builtinArrayPrototype):
3052 (Interpreter::builtinBooleanPrototype):
3053 (Interpreter::builtinStringPrototype):
3054 (Interpreter::builtinNumberPrototype):
3055 (Interpreter::builtinDatePrototype):
3056 (Interpreter::builtinRegExpPrototype):
3057 (Interpreter::builtinErrorPrototype):
3058 (Interpreter::builtinEvalError):
3059 (Interpreter::builtinRangeError):
3060 (Interpreter::builtinReferenceError):
3061 (Interpreter::builtinSyntaxError):
3062 (Interpreter::builtinTypeError):
3063 (Interpreter::builtinURIError):
3064 (Interpreter::builtinEvalErrorPrototype):
3065 (Interpreter::builtinRangeErrorPrototype):
3066 (Interpreter::builtinReferenceErrorPrototype):
3067 (Interpreter::builtinSyntaxErrorPrototype):
3068 (Interpreter::builtinTypeErrorPrototype):
3069 (Interpreter::builtinURIErrorPrototype):
3070 (Interpreter::createLanguageInstanceForValue):
3071 * kjs/interpreter.h:
3072 (KJS::Interpreter::isGlobalObject):
3073 (KJS::ExecState::setException):
3074 (KJS::ExecState::clearException):
3075 (KJS::ExecState::exception):
3076 (KJS::ExecState::hadException):
3077 (KJS::ExecState::ExecState):
3078 * kjs/list.cpp:
3079 (KJS::List::at):
3080 * kjs/list.h:
3081 (KJS::List::operator[]):
3082 (KJS::ListIterator::operator->):
3083 (KJS::ListIterator::operator*):
3084 (KJS::ListIterator::operator++):
3085 (KJS::ListIterator::operator--):
3086 * kjs/lookup.h:
3087 (KJS::staticFunctionGetter):
3088 (KJS::staticValueGetter):
3089 (KJS::lookupPut):
3090 (KJS::cacheGlobalObject):
3091 * kjs/math_object.cpp:
3092 (MathObjectImp::getValueProperty):
3093 (MathFuncImp::MathFuncImp):
3094 (MathFuncImp::callAsFunction):
3095 * kjs/math_object.h:
3096 * kjs/nodes.cpp:
3097 (Node::evaluateReference):
3098 (Node::throwError):
3099 (Node::setExceptionDetailsIfNeeded):
3100 (NullNode::evaluate):
3101 (BooleanNode::evaluate):
3102 (NumberNode::evaluate):
3103 (StringNode::evaluate):
3104 (RegExpNode::evaluate):
3105 (ThisNode::evaluate):
3106 (ResolveNode::evaluate):
3107 (ResolveNode::evaluateReference):
3108 (GroupNode::evaluate):
3109 (ElementNode::evaluate):
3110 (ArrayNode::evaluate):
3111 (ObjectLiteralNode::evaluate):
3112 (PropertyValueNode::evaluate):
3113 (PropertyNode::evaluate):
3114 (AccessorNode1::evaluate):
3115 (AccessorNode1::evaluateReference):
3116 (AccessorNode2::evaluate):
3117 (AccessorNode2::evaluateReference):
3118 (ArgumentListNode::evaluate):
3119 (ArgumentListNode::evaluateList):
3120 (ArgumentsNode::evaluate):
3121 (NewExprNode::evaluate):
3122 (FunctionCallNode::evaluate):
3123 (PostfixNode::evaluate):
3124 (DeleteNode::evaluate):
3125 (VoidNode::evaluate):
3126 (TypeOfNode::evaluate):
3127 (PrefixNode::evaluate):
3128 (UnaryPlusNode::evaluate):
3129 (NegateNode::evaluate):
3130 (BitwiseNotNode::evaluate):
3131 (LogicalNotNode::evaluate):
3132 (MultNode::evaluate):
3133 (AddNode::evaluate):
3134 (ShiftNode::evaluate):
3135 (RelationalNode::evaluate):
3136 (EqualNode::evaluate):
3137 (BitOperNode::evaluate):
3138 (BinaryLogicalNode::evaluate):
3139 (ConditionalNode::evaluate):
3140 (AssignNode::evaluate):
3141 (CommaNode::evaluate):
3142 (StatListNode::execute):
3143 (AssignExprNode::evaluate):
3144 (VarDeclNode::evaluate):
3145 (VarDeclNode::processVarDecls):
3146 (VarDeclListNode::evaluate):
3147 (ExprStatementNode::execute):
3148 (IfNode::execute):
3149 (DoWhileNode::execute):
3150 (WhileNode::execute):
3151 (ForNode::execute):
3152 (ForInNode::execute):
3153 (ContinueNode::execute):
3154 (BreakNode::execute):
3155 (ReturnNode::execute):
3156 (WithNode::execute):
3157 (CaseClauseNode::evaluate):
3158 (ClauseListNode::evaluate):
3159 (CaseBlockNode::evaluate):
3160 (CaseBlockNode::evalBlock):
3161 (SwitchNode::execute):
3162 (ThrowNode::execute):
3163 (CatchNode::execute):
3164 (TryNode::execute):
3165 (ParameterNode::evaluate):
3166 (FuncDeclNode::processFuncDecl):
3167 (FuncExprNode::evaluate):
3168 (SourceElementsNode::execute):
3169 * kjs/nodes.h:
3170 (KJS::StatementNode::evaluate):
3171 * kjs/number_object.cpp:
3172 (NumberPrototypeImp::NumberPrototypeImp):
3173 (NumberProtoFuncImp::NumberProtoFuncImp):
3174 (NumberProtoFuncImp::callAsFunction):
3175 (NumberObjectImp::NumberObjectImp):
3176 (NumberObjectImp::getValueProperty):
3177 (NumberObjectImp::construct):
3178 (NumberObjectImp::callAsFunction):
3179 * kjs/number_object.h:
3180 * kjs/object.cpp:
3181 (KJS::ObjectImp::call):
3182 (KJS::ObjectImp::mark):
3183 (KJS::ObjectImp::classInfo):
3184 (KJS::ObjectImp::get):
3185 (KJS::ObjectImp::getProperty):
3186 (KJS::ObjectImp::getPropertySlot):
3187 (KJS::ObjectImp::put):
3188 (KJS::ObjectImp::hasOwnProperty):
3189 (KJS::ObjectImp::defaultValue):
3190 (KJS::ObjectImp::findPropertyHashEntry):
3191 (KJS::ObjectImp::construct):
3192 (KJS::ObjectImp::callAsFunction):
3193 (KJS::ObjectImp::hasInstance):
3194 (KJS::ObjectImp::propList):
3195 (KJS::ObjectImp::toPrimitive):
3196 (KJS::ObjectImp::toNumber):
3197 (KJS::ObjectImp::toString):
3198 (KJS::ObjectImp::toObject):
3199 (KJS::ObjectImp::putDirect):
3200 (KJS::Error::create):
3201 (KJS::error):
3202 * kjs/object.h:
3203 (KJS::):
3204 (KJS::ObjectImp::getPropertySlot):
3205 (KJS::AllocatedValueImp::isObject):
3206 (KJS::ObjectImp::ObjectImp):
3207 (KJS::ObjectImp::internalValue):
3208 (KJS::ObjectImp::setInternalValue):
3209 (KJS::ObjectImp::prototype):
3210 (KJS::ObjectImp::setPrototype):
3211 (KJS::ObjectImp::inherits):
3212 * kjs/object_object.cpp:
3213 (ObjectPrototypeImp::ObjectPrototypeImp):
3214 (ObjectProtoFuncImp::ObjectProtoFuncImp):
3215 (ObjectProtoFuncImp::callAsFunction):
3216 (ObjectObjectImp::ObjectObjectImp):
3217 (ObjectObjectImp::construct):
3218 (ObjectObjectImp::callAsFunction):
3219 * kjs/object_object.h:
3220 * kjs/operations.cpp:
3221 (KJS::equal):
3222 (KJS::strictEqual):
3223 (KJS::relation):
3224 (KJS::add):
3225 (KJS::mult):
3226 * kjs/operations.h:
3227 * kjs/property_map.cpp:
3228 (KJS::PropertyMap::mark):
3229 (KJS::PropertyMap::addEnumerablesToReferenceList):
3230 (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList):
3231 (KJS::PropertyMap::save):
3232 (KJS::PropertyMap::restore):
3233 * kjs/property_map.h:
3234 * kjs/property_slot.cpp:
3235 (KJS::PropertySlot::undefinedGetter):
3236 * kjs/property_slot.h:
3237 (KJS::PropertySlot::getValue):
3238 * kjs/protect.h:
3239 (KJS::gcUnprotectNullTolerant):
3240 (KJS::ProtectedValue::ProtectedValue):
3241 (KJS::ProtectedValue::~ProtectedValue):
3242 (KJS::ProtectedValue::operator=):
3243 (KJS::ProtectedValue::operator ValueImp *):
3244 (KJS::ProtectedValue::operator->):
3245 * kjs/protected_object.h:
3246 (KJS::ProtectedObject::ProtectedObject):
3247 (KJS::ProtectedObject::operator=):
3248 (KJS::ProtectedObject::operator ValueImp *):
3249 (KJS::ProtectedObject::operator ObjectImp *):
3250 (KJS::ProtectedObject::operator->):
3251 (KJS::ProtectedReference::ProtectedReference):
3252 (KJS::ProtectedReference::~ProtectedReference):
3253 (KJS::ProtectedReference::operator=):
3254 * kjs/protected_values.cpp:
3255 (KJS::ProtectedValues::getProtectCount):
3256 (KJS::ProtectedValues::increaseProtectCount):
3257 (KJS::ProtectedValues::insert):
3258 (KJS::ProtectedValues::decreaseProtectCount):
3259 * kjs/protected_values.h:
3260 * kjs/reference.cpp:
3261 (KJS::Reference::Reference):
3262 (KJS::Reference::makeValueReference):
3263 (KJS::Reference::getBase):
3264 (KJS::Reference::getValue):
3265 (KJS::Reference::putValue):
3266 (KJS::Reference::deleteValue):
3267 * kjs/reference.h:
3268 (KJS::Reference::baseIfMutable):
3269 * kjs/regexp_object.cpp:
3270 (RegExpPrototypeImp::RegExpPrototypeImp):
3271 (RegExpProtoFuncImp::RegExpProtoFuncImp):
3272 (RegExpProtoFuncImp::callAsFunction):
3273 (RegExpObjectImp::RegExpObjectImp):
3274 (RegExpObjectImp::arrayOfMatches):
3275 (RegExpObjectImp::backrefGetter):
3276 (RegExpObjectImp::construct):
3277 (RegExpObjectImp::callAsFunction):
3278 * kjs/regexp_object.h:
3279 * kjs/string_object.cpp:
3280 (StringInstanceImp::lengthGetter):
3281 (StringInstanceImp::indexGetter):
3282 (StringInstanceImp::getOwnPropertySlot):
3283 (StringInstanceImp::put):
3284 (StringPrototypeImp::StringPrototypeImp):
3285 (StringProtoFuncImp::StringProtoFuncImp):
3286 (regExpIsGlobal):
3287 (replace):
3288 (StringProtoFuncImp::callAsFunction):
3289 (StringObjectImp::StringObjectImp):
3290 (StringObjectImp::construct):
3291 (StringObjectImp::callAsFunction):
3292 (StringObjectFuncImp::StringObjectFuncImp):
3293 (StringObjectFuncImp::callAsFunction):
3294 * kjs/string_object.h:
3295 * kjs/testkjs.cpp:
3296 (TestFunctionImp::callAsFunction):
3297 (VersionFunctionImp::callAsFunction):
3298 (main):
3299 * kjs/value.cpp:
3300 (KJS::AllocatedValueImp::operator new):
3301 (KJS::AllocatedValueImp::getUInt32):
3302 (KJS::ValueImp::toInteger):
3303 (KJS::ValueImp::toInt32):
3304 (KJS::ValueImp::toUInt32):
3305 (KJS::ValueImp::toUInt16):
3306 (KJS::ValueImp::toObject):
3307 (KJS::AllocatedValueImp::getBoolean):
3308 (KJS::AllocatedValueImp::getNumber):
3309 (KJS::AllocatedValueImp::getString):
3310 (KJS::AllocatedValueImp::getObject):
3311 (KJS::jsString):
3312 (KJS::jsNumber):
3313 (KJS::ConstantValues::init):
3314 (KJS::ConstantValues::clear):
3315 (KJS::ConstantValues::mark):
3316 * kjs/value.h:
3317 (KJS::):
3318 (KJS::jsUndefined):
3319 (KJS::jsNull):
3320 (KJS::jsBoolean):
3321 (KJS::jsNaN):
3322 (KJS::ValueImp::ValueImp):
3323 (KJS::ValueImp::~ValueImp):
3324 (KJS::AllocatedValueImp::AllocatedValueImp):
3325 (KJS::AllocatedValueImp::~AllocatedValueImp):
3326 (KJS::AllocatedValueImp::isBoolean):
3327 (KJS::AllocatedValueImp::isNumber):
3328 (KJS::AllocatedValueImp::isString):
3329 (KJS::AllocatedValueImp::isObject):
3330 (KJS::AllocatedValueImp::marked):
3331 (KJS::AllocatedValueImp::mark):
3332 (KJS::ValueImp::downcast):
3333 (KJS::ValueImp::isUndefined):
3334 (KJS::ValueImp::isNull):
3335 (KJS::ValueImp::isUndefinedOrNull):
3336 (KJS::ValueImp::isBoolean):
3337 (KJS::ValueImp::isNumber):
3338 (KJS::ValueImp::isString):
3339 (KJS::ValueImp::isObject):
3340 (KJS::ValueImp::getBoolean):
3341 (KJS::ValueImp::getNumber):
3342 (KJS::ValueImp::getString):
3343 (KJS::ValueImp::getObject):
3344 (KJS::ValueImp::getUInt32):
3345 (KJS::ValueImp::mark):
3346 (KJS::ValueImp::marked):
3347 (KJS::ValueImp::type):
3348 (KJS::ValueImp::toPrimitive):
3349 (KJS::ValueImp::toBoolean):
3350 (KJS::ValueImp::toNumber):
3351 (KJS::ValueImp::toString):
3352 (KJS::jsZero):
3353 (KJS::jsOne):
3354 (KJS::jsTwo):
3355 (KJS::Undefined):
3356 (KJS::Null):
3357 (KJS::Boolean):
3358 (KJS::Number):
3359 (KJS::String):
3360
3361 2005-08-06 Maciej Stachowiak <mjs@apple.com>
3362
3363 Reviewed by Darin.
3364
3365 Change over to the new PropertySlot mechanism for property
3366 lookup. This allows the elimination of hasOwnProperty
3367 methods. Also did some of the performance tuning enabled by this
3368 (but not yet all the possible improvements for function calls,
3369 assignment, ++, and so forth). And also much code cleanup.
3370
3371 Net result is about a 2% speedup on the JS iBench.
3372
3373 Also redid Geoff's fix for the chrashing applet by avoiding a NULL
3374 prototype in the bindings code and using the default of Null()
3375 instead.
3376
3377 * JavaScriptCore.xcodeproj/project.pbxproj:
3378 * bindings/objc/objc_runtime.h:
3379 * bindings/objc/objc_runtime.mm:
3380 (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
3381 (ObjcFallbackObjectImp::getOwnPropertySlot):
3382 * bindings/runtime_array.cpp:
3383 (RuntimeArrayImp::lengthGetter):
3384 (RuntimeArrayImp::indexGetter):
3385 (RuntimeArrayImp::getOwnPropertySlot):
3386 * bindings/runtime_array.h:
3387 * bindings/runtime_method.cpp:
3388 (RuntimeMethodImp::lengthGetter):
3389 (RuntimeMethodImp::getOwnPropertySlot):
3390 * bindings/runtime_method.h:
3391 * bindings/runtime_object.cpp:
3392 (RuntimeObjectImp::RuntimeObjectImp):
3393 (RuntimeObjectImp::fallbackObjectGetter):
3394 (RuntimeObjectImp::fieldGetter):
3395 (RuntimeObjectImp::methodGetter):
3396 (RuntimeObjectImp::getOwnPropertySlot):
3397 * bindings/runtime_object.h:
3398 * bindings/runtime_root.h:
3399 * kjs/array_instance.h:
3400 * kjs/array_object.cpp:
3401 (ArrayInstanceImp::lengthGetter):
3402 (ArrayInstanceImp::getOwnPropertySlot):
3403 (ArrayPrototypeImp::getOwnPropertySlot):
3404 * kjs/array_object.h:
3405 * kjs/date_object.cpp:
3406 (DatePrototypeImp::getOwnPropertySlot):
3407 * kjs/date_object.h:
3408 * kjs/function.cpp:
3409 (KJS::FunctionImp::argumentsGetter):
3410 (KJS::FunctionImp::lengthGetter):
3411 (KJS::FunctionImp::getOwnPropertySlot):
3412 (KJS::FunctionImp::put):
3413 (KJS::FunctionImp::deleteProperty):
3414 (KJS::ArgumentsImp::mappedIndexGetter):
3415 (KJS::ArgumentsImp::getOwnPropertySlot):
3416 (KJS::ActivationImp::argumentsGetter):
3417 (KJS::ActivationImp::getArgumentsGetter):
3418 (KJS::ActivationImp::getOwnPropertySlot):
3419 (KJS::ActivationImp::deleteProperty):
3420 * kjs/function.h:
3421 * kjs/internal.cpp:
3422 (InterpreterImp::InterpreterImp):
3423 (InterpreterImp::initGlobalObject):
3424 (InterpreterImp::~InterpreterImp):
3425 (InterpreterImp::evaluate):
3426 * kjs/internal.h:
3427 (KJS::InterpreterImp::globalExec):
3428 * kjs/interpreter.cpp:
3429 (Interpreter::Interpreter):
3430 (Interpreter::createLanguageInstanceForValue):
3431 * kjs/interpreter.h:
3432 (KJS::Interpreter::argumentsIdentifier):
3433 (KJS::Interpreter::specialPrototypeIdentifier):
3434 * kjs/lookup.h:
3435 (KJS::staticFunctionGetter):
3436 (KJS::staticValueGetter):
3437 (KJS::getStaticPropertySlot):
3438 (KJS::getStaticFunctionSlot):
3439 (KJS::getStaticValueSlot):
3440 * kjs/math_object.cpp:
3441 (MathObjectImp::getOwnPropertySlot):
3442 * kjs/math_object.h:
3443 * kjs/nodes.cpp:
3444 (ResolveNode::evaluate):
3445 (ResolveNode::evaluateReference):
3446 (AccessorNode1::evaluate):
3447 (AccessorNode2::evaluate):
3448 * kjs/number_object.cpp:
3449 (NumberObjectImp::getOwnPropertySlot):
3450 * kjs/number_object.h:
3451 * kjs/object.cpp:
3452 (KJS::ObjectImp::get):
3453 (KJS::ObjectImp::getProperty):
3454 (KJS::ObjectImp::getPropertySlot):
3455 (KJS::ObjectImp::getOwnPropertySlot):
3456 (KJS::ObjectImp::put):
3457 (KJS::ObjectImp::hasProperty):
3458 (KJS::ObjectImp::hasOwnProperty):
3459 * kjs/object.h:
3460 (KJS::ObjectImp::getDirectLocation):
3461 (KJS::ObjectImp::getPropertySlot):
3462 (KJS::ObjectImp::getOwnPropertySlot):
3463 * kjs/object_wrapper.h: Added.
3464 (KJS::):
3465 (KJS::Object::Object):
3466 (KJS::Object::operator ObjectImp *):
3467 * kjs/property_map.cpp:
3468 (KJS::PropertyMap::getLocation):
3469 * kjs/property_map.h:
3470 * kjs/property_slot.cpp: Added.
3471 (KJS::PropertySlot::undefinedGetter):
3472 * kjs/property_slot.h: Added.
3473 (KJS::PropertySlot::isSet):
3474 (KJS::PropertySlot::getValue):
3475 (KJS::PropertySlot::setValueSlot):
3476 (KJS::PropertySlot::setStaticEntry):
3477 (KJS::PropertySlot::setCustom):
3478 (KJS::PropertySlot::setCustomIndex):
3479 (KJS::PropertySlot::setUndefined):
3480 (KJS::PropertySlot::slotBase):
3481 (KJS::PropertySlot::staticEntry):
3482 (KJS::PropertySlot::index):
3483 (KJS::PropertySlot::):
3484 * kjs/protect.h:
3485 * kjs/protected_object.h: Added.
3486 (KJS::ProtectedObject::ProtectedObject):
3487 (KJS::ProtectedObject::~ProtectedObject):
3488 (KJS::ProtectedObject::operator=):
3489 (KJS::ProtectedReference::ProtectedReference):
3490 (KJS::ProtectedReference::~ProtectedReference):
3491 (KJS::ProtectedReference::operator=):
3492 * kjs/reference.h:
3493 * kjs/reference_list.cpp:
3494 * kjs/regexp_object.cpp:
3495 (RegExpObjectImp::backrefGetter):
3496 (RegExpObjectImp::getOwnPropertySlot):
3497 * kjs/regexp_object.h:
3498 * kjs/string_object.cpp:
3499 (StringInstanceImp::lengthGetter):
3500 (StringInstanceImp::indexGetter):
3501 (StringInstanceImp::getOwnPropertySlot):
3502 (StringPrototypeImp::getOwnPropertySlot):
3503 * kjs/string_object.h:
3504
3505 2005-08-05 Adele Peterson <adele@apple.com>
3506
3507 Reviewed by Darin.
3508
3509 * JavaScriptCore.xcodeproj/project.pbxproj: Unchecked 'statics are thread safe' option.
3510
3511 2005-08-05 Geoffrey Garen <ggaren@apple.com>
3512
3513 -fixed <rdar://problem/4207220> REGRESSION (DENVER): Crash occurs
3514 after clicking on Hangman applet
3515
3516 Reviewed by darin.
3517
3518 * kjs/object.cpp:
3519 (KJS::ObjectImp::hasProperty): added check for null prototype.
3520
3521 FIXME: The long-term plan is to make runtime objects use JS Null()
3522 instead of null pointers, which will allow us to eliminate null
3523 checks, improving performance.
3524
3525 2005-08-05 Geoffrey Garen <ggaren@apple.com>
3526
3527 Fix by darin, reviewed by me.
3528
3529 - rolled in fix for: <rdar://problem/4161606> JavaScript regular
3530 expressions with certain ranges of Unicode characters cause a crash
3531
3532 Test cases added:
3533
3534 * layout-tests/fast/js/regexp-big-unicode-ranges-expected.txt: Added.
3535 * layout-tests/fast/js/regexp-big-unicode-ranges.html: Added.
3536
3537 * pcre/pcre.c:
3538 (compile_branch): added checks for characters > 255
3539
35402005-08-04 Chris Blumenberg <cblu@apple.com>
3541
3542 if'd out bindings code until we can get it to compile on Purple
3543
3544 Reviewed by andre.
3545
3546 * bindings/NP_jsobject.cpp:
3547 * bindings/NP_jsobject.h:
3548 * bindings/c/c_class.cpp:
3549 * bindings/c/c_class.h:
3550 * bindings/c/c_instance.cpp:
3551 * bindings/c/c_instance.h:
3552 * bindings/c/c_runtime.cpp:
3553 * bindings/c/c_runtime.h:
3554 * bindings/c/c_utility.cpp:
3555 * bindings/c/c_utility.h:
3556 * bindings/jni/jni_class.cpp:
3557 * bindings/jni/jni_class.h:
3558 * bindings/jni/jni_instance.cpp:
3559 * bindings/jni/jni_instance.h:
3560 * bindings/jni/jni_jsobject.cpp:
3561 * bindings/jni/jni_jsobject.h:
3562 * bindings/jni/jni_objc.mm:
3563 (KJS::Bindings::dispatchJNICall):
3564 * bindings/jni/jni_runtime.cpp:
3565 * bindings/jni/jni_runtime.h:
3566 * bindings/jni/jni_utility.cpp:
3567 * bindings/jni/jni_utility.h:
3568 * bindings/npapi.h:
3569 * bindings/npruntime.cpp:
3570 * bindings/npruntime.h:
3571 * bindings/npruntime_impl.h:
3572 * bindings/npruntime_priv.h:
3573 * bindings/objc/WebScriptObject.h:
3574 * bindings/objc/WebScriptObject.mm:
3575 * bindings/objc/WebScriptObjectPrivate.h:
3576 * bindings/objc/objc_class.h:
3577 * bindings/objc/objc_class.mm:
3578 * bindings/objc/objc_header.h:
3579 * bindings/objc/objc_instance.h:
3580 * bindings/objc/objc_instance.mm:
3581 * bindings/objc/objc_runtime.h:
3582 * bindings/objc/objc_runtime.mm:
3583 * bindings/objc/objc_utility.h:
3584 * bindings/objc/objc_utility.mm:
3585 * bindings/runtime.cpp:
3586 (Instance::createBindingForLanguageInstance):
3587 (Instance::createLanguageInstanceForValue):
3588 * bindings/runtime.h:
3589 * bindings/runtime_array.cpp:
3590 * bindings/runtime_array.h:
3591 * bindings/runtime_method.cpp:
3592 * bindings/runtime_method.h:
3593 * bindings/runtime_object.cpp:
3594 * bindings/runtime_object.h:
3595 * bindings/runtime_root.cpp:
3596 * bindings/runtime_root.h:
3597 * bindings/softlinking.c:
3598 * kjs/interpreter.cpp:
3599 * kjs/interpreter.h:
3600
36012005-08-04 Ken Kocienda <kocienda@apple.com>
3602
3603 Reviewed by me
3604
3605 Merged in changes from the opensource tree.
3606
3607 * bindings/objc/objc_class.mm:
3608 (ObjcClass::_commonInit): I see the change, but there does not
3609 seem to be a ChangeLog comment to merge. In any case, only the
3610 initial size of the dictionaries is being altered here (from 16 to 0).
3611
36122005-08-03 Chris Blumenberg <cblu@apple.com>
3613
3614 Disabled Netscape plug-in related bindings code.
3615
3616 Reviewed by kocienda.
3617
3618 * bindings/NP_jsobject.cpp:
3619 * bindings/NP_jsobject.h:
3620 * bindings/c/c_class.cpp:
3621 * bindings/c/c_class.h:
3622 * bindings/c/c_instance.cpp:
3623 * bindings/c/c_instance.h:
3624 * bindings/c/c_runtime.cpp:
3625 * bindings/c/c_runtime.h:
3626 * bindings/c/c_utility.cpp:
3627 * bindings/c/c_utility.h:
3628 * bindings/npapi.h:
3629 * bindings/npruntime.cpp:
3630 * bindings/npruntime.h:
3631 * bindings/npruntime_impl.h:
3632 * bindings/npruntime_priv.h:
3633 * bindings/runtime.cpp:
3634 (Instance::createBindingForLanguageInstance):
3635 (Instance::createLanguageInstanceForValue):
3636 * kjs/date_object.cpp:
3637
36382005-08-03 Ken Kocienda <kocienda@apple.com>
3639
3640 Reviewed by me
3641
3642 Merged in changes from the opensource tree.
3643
3644 2005-07-31 Darin Adler <darin@apple.com>
3645
3646 Reviewed by Maciej.
3647
3648 - remove uses of Mac-OS-X-specific MAX macro
3649 - remove one of the many excess "APPLE_CHANGES" ifdefs
3650
3651 * kjs/collector.cpp: (KJS::Collector::allocate): Use std::max instead of MAX.
3652 * kjs/property_map.cpp: (KJS::PropertyMap::rehash): Ditto.
3653 * kjs/ustring.cpp:
3654 (KJS::UChar::toLower): Take out non-ICU code path.
3655 (KJS::UChar::toUpper): Ditto.
3656 (KJS::UString::spliceSubstringsWithSeparators): Use std::max instead of MAX.
3657
3658 2005-07-27 Geoffrey Garen <ggaren@apple.com>
3659
3660 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4147
3661 Array.toString() and toLocaleString() improvements from KDE KJS
3662 (rolled in KDE changes)
3663
3664 Test cases added:
3665
3666 * layout-tests/fast/js/toString-overrides-expected.txt: Added.
3667 * layout-tests/fast/js/toString-overrides.html: Added.
3668
3669 * kjs/array_object.cpp:
3670 (ArrayProtoFuncImp::call):
3671
3672 2005-07-27 Maciej Stachowiak <mjs@apple.com>
3673
3674 Changes by Michael Kahl, reviewed by me.
3675
3676 - fixed <rdar://problem/4194278> Need better debugging support in JavaScriptCore
3677
3678 * JavaScriptCore.xcodeproj/project.pbxproj:
3679 * kjs/debugger.cpp:
3680 (KJS::AttachedInterpreter::AttachedInterpreter):
3681 (KJS::AttachedInterpreter::~AttachedInterpreter):
3682 (Debugger::~Debugger):
3683 (Debugger::attach):
3684 (Debugger::detach):
3685 (Debugger::sourceParsed):
3686 * kjs/debugger.h:
3687 * kjs/function.cpp:
3688 (KJS::FunctionImp::call):
3689 (KJS::GlobalFuncImp::call):
3690 * kjs/function_object.cpp:
3691 (FunctionObjectImp::construct):
3692 * kjs/grammar.y:
3693 * kjs/internal.cpp:
3694 (Parser::parse):
3695 (InterpreterImp::evaluate):
3696 * kjs/internal.h:
3697 (KJS::InterpreterImp::setDebugger):
3698 * kjs/interpreter.cpp:
3699 * kjs/interpreter.h:
3700 (KJS::Interpreter::imp):
3701 * kjs/nodes.cpp:
3702
3703 2005-07-27 Geoffrey Garen <ggaren@apple.com>
3704
3705 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3381
3706 Date.prototype.setDate() incorrect for values >=128
3707
3708 - Test cases added:
3709
3710 * layout-tests/fast/js/date-big-setdate-expected.txt: Added.
3711 * layout-tests/fast/js/date-big-setdate.html: Added.
3712
3713 Reviewed by darin.
3714
3715 * kjs/date_object.cpp:
3716 (DateProtoFuncImp::call):
3717
3718 2005-07-27 Geoffrey Garen <ggaren@apple.com>
3719
3720 -rolled in patch by Carsten Guenther <cguenther@gmail.com>
3721 for http://bugzilla.opendarwin.org/show_bug.cgi?id=3759
3722 Date object enhancements
3723
3724 Test cases added:
3725
3726 * layout-tests/fast/js/date-preserve-milliseconds-expected.txt: Added.
3727 * layout-tests/fast/js/date-preserve-milliseconds.html: Added.
3728
3729 Reviewed by darin.
3730
3731 * kjs/date_object.cpp:
3732 (timeFromArgs):
3733 (DateProtoFuncImp::call):
3734 (DateObjectImp::construct):
3735 (DateObjectFuncImp::call):
3736 (KJS::makeTime):
3737 * kjs/date_object.h:
3738 * tests/mozilla/expected.html:
3739
37402005-07-27 Ken Kocienda <kocienda@apple.com>
3741
3742 Reviewed by me
3743
3744 * JavaScriptCore.xcodeproj/project.pbxproj: Rolled out changes for building roots.
3745 Root-building smarts added to my script, rather then to the project file.
3746
37472005-07-27 Ken Kocienda <kocienda@apple.com>
3748
3749 Reviewed by me
3750
3751 Merged in changes from the opensource tree.
3752
3753 2005-07-26 Justin Garcia <justin.garcia@apple.com>
3754
3755 Added a forward declaration to fix gcc4 build error
3756
3757 * kjs/function.h:
3758
3759 2005-07-25 Geoffrey Garen <ggaren@apple.com>
3760 - fixed mistake in my last checkin -- the expected results included
3761 results from a patch that hasn't landed yet.
3762
3763 * tests/mozilla/expected.html:
3764
3765 2005-07-25 Maciej Stachowiak <mjs@apple.com>
3766
3767 - fix mistake in last change that leads to assertion failure in the Development build
3768
3769 * kjs/lookup.h:
3770 (KJS::lookupGetOwnValue):
3771
3772 2005-07-24 Maciej Stachowiak <mjs@apple.com>
3773
3774 Reviewed by Darin.
3775
3776 - http://bugzilla.opendarwin.org/show_bug.cgi?id=4124
3777 (change JavaScript property access to avoid double lookup)
3778
3779 - 10% speedup on JavaScript iBench
3780 - 5% speedup on 24fun BenchJS benchmark
3781
3782 Changed all get methods to getOwnProperty - they are no longer
3783 responsible for prototype lookup, and determine if the property
3784 was found as a side efect.
3785
3786 get() is now a nonvirtual ObjectImp method which calls the virtual
3787 getOwnProperty and walks the prototype chain. A few selected
3788 methods were inlined.
3789
3790 Changed ResolveNode::evaluate plus some other places to use
3791 getProperty which does get() and hasProperty() in one lookup.
3792
3793 Also miscellaneous code cleanup.
3794
3795 * bindings/objc/objc_runtime.h:
3796 * bindings/objc/objc_runtime.mm:
3797 (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
3798 (ObjcFallbackObjectImp::getOwnProperty):
3799 * bindings/runtime_array.cpp:
3800 (RuntimeArrayImp::RuntimeArrayImp):
3801 (RuntimeArrayImp::getOwnProperty):
3802 * bindings/runtime_array.h:
3803 * bindings/runtime_method.cpp:
3804 (RuntimeMethodImp::getOwnProperty):
3805 * bindings/runtime_method.h:
3806 * bindings/runtime_object.cpp:
3807 (RuntimeObjectImp::getOwnProperty):
3808 * bindings/runtime_object.h:
3809 * kjs/array_instance.h:
3810 * kjs/array_object.cpp:
3811 (ArrayInstanceImp::getOwnProperty):
3812 (ArrayPrototypeImp::getOwnProperty):
3813 (ArrayProtoFuncImp::call):
3814 * kjs/array_object.h:
3815 * kjs/date_object.cpp:
3816 (DatePrototypeImp::getOwnProperty):
3817 * kjs/date_object.h:
3818 * kjs/function.cpp:
3819 (KJS::FunctionImp::getOwnProperty):
3820 (KJS::ArgumentsImp::getOwnProperty):
3821 (KJS::ActivationImp::getOwnProperty):
3822 * kjs/function.h:
3823 * kjs/lookup.h:
3824 (KJS::lookupGetOwnProperty):
3825 (KJS::lookupGetOwnFunction):
3826 (KJS::lookupGetOwnValue):
3827 * kjs/math_object.cpp:
3828 (MathObjectImp::getOwnProperty):
3829 (MathObjectImp::getValueProperty):
3830 * kjs/math_object.h:
3831 * kjs/nodes.cpp:
3832 (ResolveNode::evaluate):
3833 * kjs/number_object.cpp:
3834 (NumberObjectImp::getOwnProperty):
3835 * kjs/number_object.h:
3836 * kjs/object.cpp:
3837 (KJS::ObjectImp::get):
3838 (KJS::ObjectImp::getOwnProperty):
3839 (KJS::ObjectImp::getProperty):
3840 * kjs/object.h:
3841 (KJS::ObjectImp::getProperty):
3842 (KJS::ObjectImp::getOwnProperty):
3843 * kjs/object_object.cpp:
3844 (ObjectProtoFuncImp::call):
3845 * kjs/regexp_object.cpp:
3846 (RegExpObjectImp::getOwnProperty):
3847 * kjs/regexp_object.h:
3848 * kjs/string_object.cpp:
3849 (StringInstanceImp::getOwnProperty):
3850 (StringPrototypeImp::getOwnProperty):
3851 * kjs/string_object.h:
3852
3853 2005-07-25 Geoffrey Garen <ggaren@apple.com>
3854
3855 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3971
3856 JS test suite depends on JS 1.2 behavior
3857
3858 Reviewed by darin.
3859
3860 * tests/mozilla/js1_2/Array/tostring_1.js: now tests only for JS 1.5 behavior
3861 * tests/mozilla/js1_2/Array/tostring_2.js: ditto
3862 * tests/mozilla/expected.html:
3863
38642005-07-25 Ken Kocienda <kocienda@apple.com>
3865
3866 Reviewed by me
3867
3868 Merged in changes from the opensource tree.
3869
3870 2005-07-22 Geoffrey Garen <ggaren@apple.com>
3871
3872 Reviewed by darin.
3873
3874 * kjs/date_object.cpp: DatePrototypeImp now identifies itself as a
3875 child class of DateInstanceImp -- this enables calls to Date.ValueOf().
3876
3877 fixes: ecma/Date/15.9.5.js (once we enable the date tests).
3878
38792005-07-25 Ken Kocienda <kocienda@apple.com>
3880
3881 Reviewed by me
3882
3883 Migrated all project files to Xcode 2.1
3884
3885 * JavaScriptCore.pbproj/.cvsignore: Removed.
3886 * JavaScriptCore.pbproj/project.pbxproj: Removed.
3887 * JavaScriptCore.xcodeproj/.cvsignore: Added.
3888 * JavaScriptCore.xcodeproj/project.pbxproj: Added.
3889
38902005-07-22 Ken Kocienda <kocienda@apple.com>
3891
3892 Reviewed by Richard
3893
3894 * JavaScriptCore.pbproj/project.pbxproj: Made install path /Purple.
3895
38962005-07-20 Ken Kocienda <kocienda@apple.com>
3897
3898 Reviewed by me
3899
3900 Merged changes from opensource tree.
3901
3902 2005-07-20 Maciej Stachowiak <mjs@apple.com>
3903
3904 Patch from Trey Matteson <trey@usa.net>, reviewed by me.
3905
3906 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3956
3907 some of WebKit builds with symbols, some doesn't
3908
3909 * JavaScriptCore.pbproj/project.pbxproj: Generate symbols even for
3910 Deployment.
3911
3912 2005-07-19 Geoffrey Garen <ggaren@apple.com>
3913
3914 -fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3991
3915 JSC doesn't implement Array.prototype.toLocaleString()
3916
3917 -test failure: ecma_3/Array/15.4.4.3-1.js
3918
3919 Reviewed by mjs.
3920
3921 * kjs/array_object.cpp:
3922 (ArrayProtoFuncImp::call): now searches for toString and
3923 toLocaleString overrides in the array's elements
3924
3925 * tests/mozilla/expected.html: failures are under 100! woohoo!
3926
3927 2005-07-19 Darin Adler <darin@apple.com>
3928
3929 - fixed the build
3930
3931 * kjs/lookup.h: (KJS::lookupPut): Remove bogus const; was preventing WebCore from
3932 compiling (not sure why this didn't affect my other build machine).
3933
3934 - one other tiny tweak (so sue me)
3935
3936 * bindings/runtime_root.cpp: Remove unneeded declaration.
3937
3938 2005-07-19 Darin Adler <darin@apple.com>
3939
3940 Reviewed by Geoff Garen.
3941
3942 - eliminated try wrappers for get/put/call since we don't use C++ exceptions any more
3943
3944 * kjs/lookup.h: Changed tryCall in IMPLEMENT_PROTOFUNC here to call. It doesn't make
3945 sense for this macro to use the name tryCall anyway, since that's specific to how
3946 WebCore used this, so this is good anyway. On the other hand, it might be a problem
3947 for KDOM or KSVG, in which case we'll need another macro for them, since JavaScriptCore
3948 should presumably not have the C++ exception support.
3949
3950 2005-07-18 Geoffrey Garen <ggaren@apple.com>
3951
3952 -fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4008
3953 Error objects report incorrect length
3954
3955 Reviewed by darin.
3956
3957 * kjs/error_object.cpp: Error objects now include a length property
3958 (ErrorObjectImp::ErrorObjectImp):
3959
3960 * tests/mozilla/expected.html: updated expected results to reflect fix
3961 * tests/mozilla/js1_5/Exceptions/regress-123002.js: test now expects
3962 ecma compliant results
3963
39642005-07-18 Ken Kocienda <kocienda@apple.com>
3965
3966 Reviewed by me
3967
3968 Merged changes from opensource tree.
3969
3970 2005-07-15 Geoffrey Garen <ggaren@apple.com>
3971
3972 -rolled in KDE fixes for http://bugzilla.opendarwin.org/show_bug.cgi?id=3601
3973 Error instance type info
3974
3975 Reviewed by mjs.
3976
3977 * kjs/error_object.cpp:
3978 - Created ErrorInstanceImp class for Error() objects.
3979 - Changed parent object for Native Errors to "Function" (matches
3980 ECMA spec).
3981 (ErrorInstanceImp::ErrorInstanceImp):
3982 (ErrorProtoFuncImp::call):
3983 (ErrorObjectImp::construct):
3984 (NativeErrorImp::construct):
3985
3986 * kjs/error_object.h:
3987 (KJS::ErrorInstanceImp::classInfo):
3988 * kjs/object.h: made comment more informative about ClassInfo
3989
3990 * tests/mozilla/expected.html:
3991
39922005-07-15 Ken Kocienda <kocienda@apple.com>
3993
3994 Reviewed by me
3995
3996 Merged changes from opensource tree.
3997
3998 2005-07-14 Geoffrey Garen <ggaren@apple.com>
3999
4000 - fixed: JS test suite expects an out of memory error
4001 that our memory efficiency avoids
4002
4003 Reviewed by mjs.
4004
4005 * tests/mozilla/js1_5/Array/regress-157652.js:
4006 test now expects normal execution
4007
4008 * tests/mozilla/expected.html:
4009
4010 2005-07-14 Geoffrey Garen <ggaren@apple.com>
4011 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4006
4012 testkjs doesn't implement gc()
4013
4014 - test failure:
4015 ecma_3/Function/regress-104584.js
4016
4017 Reviewed by mjs.
4018
4019 * kjs/interpreter.cpp:
4020 (Interpreter::finalCheck): removed misleading while && comment
4021
4022 * kjs/testkjs.cpp: added "gc" function to global object
4023 (TestFunctionImp::):
4024 (TestFunctionImp::call):
4025 (main):
4026
4027 * tests/mozilla/expected.html:
4028
4029 2005-07-14 Geoffrey Garen <ggaren@apple.com>
4030
4031 -rolled in patches for http://bugzilla.opendarwin.org/show_bug.cgi?id=3945
4032 [PATCH] Safe merges of comments and other trivialities from KDE's kjs
4033
4034 -patch by Martijn Klingens <klingens@kde.org>
4035
4036 * kjs/array_instance.h:
4037 * kjs/array_object.cpp:
4038 * kjs/array_object.h:
4039 * kjs/bool_object.cpp:
4040 * kjs/bool_object.h:
4041 * kjs/collector.cpp:
4042 * kjs/collector.h:
4043 * kjs/completion.h:
4044 * kjs/context.h:
4045 * kjs/date_object.cpp:
4046 * kjs/date_object.h:
4047 * kjs/debugger.cpp:
4048 * kjs/debugger.h:
4049 * kjs/dtoa.h:
4050 * kjs/error_object.cpp:
4051 * kjs/error_object.h:
4052 * kjs/function.cpp:
4053 * kjs/function.h:
4054 * kjs/function_object.cpp:
4055 * kjs/function_object.h:
4056 * kjs/grammar.y:
4057 * kjs/identifier.cpp:
4058 * kjs/identifier.h:
4059 * kjs/internal.cpp:
4060 * kjs/internal.h:
4061 * kjs/interpreter.cpp:
4062 * kjs/interpreter.h:
4063 * kjs/interpreter_map.cpp:
4064 * kjs/interpreter_map.h:
4065 * kjs/lexer.cpp:
4066 * kjs/lexer.h:
4067 * kjs/list.cpp:
4068 * kjs/list.h:
4069 * kjs/lookup.cpp:
4070 * kjs/lookup.h:
4071 * kjs/math_object.cpp:
4072 * kjs/math_object.h:
4073 * kjs/nodes.cpp:
4074 * kjs/nodes.h:
4075 * kjs/nodes2string.cpp:
4076 * kjs/number_object.cpp:
4077 * kjs/number_object.h:
4078 * kjs/object.cpp:
4079 * kjs/object.h:
4080 * kjs/object_object.cpp:
4081 * kjs/object_object.h:
4082 * kjs/operations.cpp:
4083 * kjs/operations.h:
4084 * kjs/property_map.cpp:
4085 * kjs/property_map.h:
4086 * kjs/reference.cpp:
4087 * kjs/reference.h:
4088 * kjs/reference_list.cpp:
4089 * kjs/reference_list.h:
4090 * kjs/regexp.cpp:
4091 * kjs/regexp.h:
4092 * kjs/regexp_object.cpp:
4093 * kjs/regexp_object.h:
4094 * kjs/scope_chain.cpp:
4095 * kjs/scope_chain.h:
4096 * kjs/simple_number.h:
4097 * kjs/string_object.cpp:
4098 * kjs/string_object.h:
4099 * kjs/testkjs.cpp:
4100 * kjs/types.h:
4101 * kjs/ustring.cpp:
4102 * kjs/ustring.h:
4103 * kjs/value.cpp:
4104 * kjs/value.h:
4105
4106 2005-07-14 Geoffrey Garen <ggaren@apple.com>
4107
4108 -fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3970
4109 throw statements fail inside eval statements
4110
4111 Reviewed by mjs.
4112
4113 * kjs/function.cpp:
4114 (KJS::GlobalFuncImp::call):
4115 Big change since I fixed the tabbing. The important part is:
4116 if (c.complType() == Throw)
4117 exec->setException(c.value());
4118
4119 * kjs/nodes.cpp:
4120 (ThrowNode::execute): removed duplicate KJS_CHECKEXCEPTION
4121 (TryNode::execute):
4122 try now clears the exception state before the finally block executes,
4123 and checks the state after the block executes, so that exceptions in
4124 finally code get caught.
4125
4126 * tests/mozilla/expected.html:
4127
4128 2005-07-14 Geoffrey Garen <ggaren@apple.com>
4129
4130 -landed fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=3412
4131 Object.prototype is missing toLocaleString
4132
4133 - patch by Mark Rowe (bdash) <opendarwin.org@bdash.net.nz>
4134
4135 -layout test info in webcore changelog
4136
4137 Reviewed by mjs.
4138
4139 * kjs/object_object.cpp:
4140 (ObjectPrototypeImp::ObjectPrototypeImp):
4141 (ObjectProtoFuncImp::call):
4142 * kjs/object_object.h:
4143 (KJS::ObjectProtoFuncImp::):
4144
41452005-07-13 Ken Kocienda <kocienda@apple.com>
4146
4147 Reviewed by me
4148
4149 Merged changes from opensource tree.
4150
4151 2005-07-12 Geoffrey Garen <ggaren@apple.com>
4152
4153 Reviewed by mjs.
4154
4155 * kjs/function.cpp:
4156 (KJS::IndexToNameMap::operator[]): fixed infinite recursion
4157 bug in last checkin
4158
4159 2005-07-12 Geoffrey Garen <ggaren@apple.com>
4160
4161 -fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3881
4162 arguments object should share values with function parameters
4163
4164 Reviewed by mjs.
4165
4166 ArgumentsImp now uses a simple hash lookup to share values
4167 with the activation object.
4168
4169 * kjs/function.cpp:
4170 (KJS::FunctionImp::getParameterName):
4171 (KJS::IndexToNameMap::IndexToNameMap):
4172 (KJS::IndexToNameMap::~IndexToNameMap):
4173 (KJS::IndexToNameMap::isMapped):
4174 (KJS::IndexToNameMap::unMap):
4175 (KJS::IndexToNameMap::operator[]):
4176 (KJS::ArgumentsImp::ArgumentsImp):
4177 (KJS::ArgumentsImp::mark):
4178 (KJS::ArgumentsImp::get):
4179 (KJS::ArgumentsImp::put):
4180 (KJS::ArgumentsImp::deleteProperty):
4181 (KJS::ArgumentsImp::hasOwnProperty):
4182 (KJS::ActivationImp::createArgumentsObject):
4183 * kjs/function.h:
4184 * tests/mozilla/expected.html: updated results
4185
41862005-07-11 Ken Kocienda <kocienda@apple.com>
4187
4188 Reviewed by me
4189
4190 Merged changes from opensource tree.
4191
4192 * kjs/error_object.cpp:
4193 (ErrorProtoFuncImp::call):
4194 * kjs/function.cpp:
4195 (KJS::ArgumentsImp::ArgumentsImp):
4196 * kjs/function.h:
4197 * kjs/grammar.y:
4198
4199 2005-07-09 Maciej Stachowiak <mjs@apple.com>
4200
4201 - backing out my earlier collector change, it causes a performance regression in TOT
4202
4203 * kjs/collector.cpp:
4204 (KJS::Collector::allocate):
4205
4206 2005-07-08 Maciej Stachowiak <mjs@apple.com>
4207
4208 Reviewed by hyatt.
4209
4210 - When there are many live objects, GC less often, to try to make
4211 GC cost proportional to garbage, not proportional to total memory used.
4212
4213 * kjs/collector.cpp:
4214 (KJS::Collector::allocate):
4215
4216 2005-07-08 Vicki Murley <vicki@apple.com>
4217
4218 Fix from Carsten Guenther, reviewed by Maciej
4219
4220 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3644 (Error string representation)
4221
4222 Switch from "-" to ":" in error strings.
4223
4224 * kjs/error_object.cpp:
4225 (ErrorProtoFuncImp::call):
4226 * tests/mozilla/expected.html:
4227
4228 2005-07-08 Geoffrey Garen <ggaren@apple.com>
4229
4230 -rolled in patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=3878
4231 arguments object should be an object not an array
4232
4233 Reviewed by mjs.
4234
4235 * kjs/function.cpp:
4236 (KJS::ArgumentsImp::ArgumentsImp): now manually handles initialization
4237 we used to get for free by inheriting from ArrayInstanceImp
4238 * kjs/function.h: ArgumentsImp now inherits from ObjectImp
4239 * tests/mozilla/expected.html: updated expected test results
4240
4241 2005-07-07 Eric Seidel <eseidel@apple.com>
4242
4243 Reviewed by mjs.
4244
4245 * kjs/grammar.y: removed #define YYMAXDEPTH 0 for bison 2.0
4246 http://bugzilla.opendarwin.org/show_bug.cgi?id=3882
4247
42482005-07-06 Ken Kocienda <kocienda@apple.com>
4249
4250 Reviewed by me
4251
4252 Merged in everything from the open source tree since this tree was created.
4253
42542005-07-03 Maciej Stachowiak <mjs@apple.com>
4255
4256 Original patch from Mark Rowe <opendarwin.org@bdash.net.nz>, reviewed by me.
4257 Fixes to patch by me, reviewed by John Sullivan.
4258
4259 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3293
4260
4261 Test cases added:
4262 * tests/mozilla/expected.html: Two tests newly pass.
4263
4264 * bindings/objc/objc_runtime.h:
4265 * bindings/objc/objc_runtime.mm:
4266 (ObjcFallbackObjectImp::hasOwnProperty):
4267 * bindings/runtime_array.cpp:
4268 (RuntimeArrayImp::hasOwnProperty):
4269 * bindings/runtime_array.h:
4270 * bindings/runtime_object.cpp:
4271 (RuntimeObjectImp::hasOwnProperty):
4272 * bindings/runtime_object.h:
4273 * kjs/array_instance.h:
4274 * kjs/array_object.cpp:
4275 (ArrayInstanceImp::hasOwnProperty):
4276 * kjs/function.cpp:
4277 (KJS::FunctionImp::hasOwnProperty):
4278 (KJS::ActivationImp::hasOwnProperty):
4279 * kjs/function.h:
4280 * kjs/lookup.h:
4281 * kjs/object.cpp:
4282 (KJS::ObjectImp::hasProperty):
4283 (KJS::ObjectImp::hasOwnProperty):
4284 * kjs/object.h:
4285 (KJS::Object::hasOwnProperty):
4286 * kjs/object_object.cpp:
4287 (ObjectPrototypeImp::ObjectPrototypeImp):
4288 (ObjectProtoFuncImp::call):
4289 * kjs/object_object.h:
4290 (KJS::ObjectProtoFuncImp::):
4291 * kjs/string_object.cpp:
4292 (StringInstanceImp::hasOwnProperty):
4293 * kjs/string_object.h:
4294
42952005-07-01 Geoffrey Garen <ggaren@apple.com>
4296
4297 -landed patch by Eric Seidel <macdome@opendarwin.org>
4298
4299 -for http://bugzilla.opendarwin.org/show_bug.cgi?id=3657
4300 GroundWork: Moving some functions from khtml->jsc following kjs TOT
4301
4302 - no layout test necessary yet - only groundwork
4303
4304 Reviewed by darin.
4305
4306 * kjs/lookup.h:
4307 (KJS::cacheGlobalObject):
4308
43092005-07-01 Geoffrey Garen <ggaren@apple.com>
4310
4311 -landed patch by Carsten Guenther <cguenther@gmail.com>
4312
4313 -fixes http://bugzilla.opendarwin.org/show_bug.cgi?id=3477
4314 some US-centric date formats not parsed by JavaScript (clock at news8austin.com)
4315
4316 -relevant tests:
4317 mozilla/ecma_3/Date/15.9.5.5.js
4318 layout-tests/fast/js/date-parse-test.html
4319
4320 Reviewed by darin.
4321
4322 * kjs/date_object.cpp:
4323 (formatLocaleDate):
4324 (day):
4325 (dayFromYear):
4326 (daysInYear):
4327 (timeFromYear):
4328 (yearFromTime):
4329 (weekDay):
4330 (timeZoneOffset):
4331 (DateProtoFuncImp::call):
4332 (DateObjectImp::construct):
4333 (KJS::parseDate):
4334 (ymdhms_to_seconds):
4335 (KJS::makeTime):
4336 (findMonth):
4337 (KJS::KRFCDate_parseDate):
4338 * kjs/date_object.h:
4339 * tests/mozilla/expected.html: updated expected results to reflect fix
4340
43412005-07-01 Geoffrey Garen <ggaren@apple.com>
4342
4343 -fixed <rdar://problem/4168186> JavaScript fails to throw exceptions
4344 for invalid return statements
4345
4346 relevant tests:
4347 ecma/Statements/12.9-1-n.js
4348 ecma_2/Exceptions/lexical-052.js
4349 ecma_2/Exceptions/statement-009.js
4350
4351 Reviewed by sullivan.
4352
4353 * kjs/nodes.cpp:
4354 (ReturnNode::execute): now throws exception if return is not inside
4355 a function.
4356
4357 * tests/mozilla/expected.html: updated to reflect fix
4358
43592005-07-01 Geoffrey Garen <ggaren@apple.com>
4360
4361 Reviewed by sullivan.
4362
4363 * tests/mozilla/expected.html: Updated test results for last fix.
4364
43652005-07-01 Geoffrey Garen <ggaren@apple.com>
4366
4367 -fixed <rdar://problem/4168161> JavaScript fails to throw an exception
4368 for invalid function calls
4369
4370 Reviewed by sullivan.
4371
4372 Relevant mozilla test: ecma_3/Exceptions/regress-95101.js
4373
4374 * kjs/nodes.cpp:
4375 (FunctionCallNode::evaluate): evaluate now checks for an exception
4376 after resolving a function name (in case the function is undefined)
4377
43782005-07-01 Eric Seidel <eseidel@apple.com>
4379
4380 Reviewed by darin.
4381
4382 * kjs/interpreter.h:
4383 (KJS::Context::curStmtFirstLine): stub for compatibility with KDE
4384 * kjs/value.h:
4385 (KJS::Value::isValid): compatibility with KDE
4386 http://bugzilla.opendarwin.org/show_bug.cgi?id=3687
4387
43882005-07-01 Eric Seidel <eseidel@apple.com>
4389
4390 Reviewed by darin.
4391
4392 * kjs/create_hash_table: rolled in changes from KDE, including
4393 -n <namespace> support from KDOM and support for newer comments
4394 http://bugzilla.opendarwin.org/show_bug.cgi?id=3771
4395
43962005-06-30 Geoffrey Garen <ggaren@apple.com>
4397
4398 -rolled in KDE fix to <rdar://problem/4167660> JavaScript fails to
4399 throw exceptions for invalid break/continue statements
4400
4401 No layout tests because it's already covered by the Mozilla suite
4402
4403 Reviewed by mjs.
4404
4405 * kjs/internal.h: LabelStack now tracks where you are relative to
4406 switch and iteration (loop) statements
4407
4408 (KJS::LabelStack::LabelStack):
4409 (KJS::LabelStack::pushIteration):
4410 (KJS::LabelStack::popIteration):
4411 (KJS::LabelStack::inIteration):
4412 (KJS::LabelStack::pushSwitch):
4413 (KJS::LabelStack::popSwitch):
4414 (KJS::LabelStack::inSwitch):
4415
4416 * kjs/nodes.cpp:
4417 These files were updated to use the new LabelStack:
4418 (DoWhileNode::execute):
4419 (WhileNode::execute):
4420 (ForNode::execute):
4421 (ForInNode::execute):
4422 (SwitchNode::execute):
4423
4424 These files were updated to throw exceptions for invalid
4425 break/continue statements:
4426 (BreakNode::execute):
4427 (ContinueNode::execute):
4428
4429 * tests/mozilla/expected.html: Updated expected results to reflect fix
4430
44312005-06-30 Kevin Decker <kdecker@apple.com>
4432
4433 Reviewed by rjw.
4434
4435 fixed: <rdar://problem/4166838> failed assertion in`Interpreter::lockCount() > 0
4436
4437 no layout test added; this is in the bindings code.
4438
4439 * bindings/objc/WebScriptObject.mm:
4440 (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]): make sure to lock and unlock the interpreter around allocations.
4441
44422005-06-29 Geoffrey Garen <ggaren@apple.com>
4443
4444 Patch by Francisco Tolmasky <tolmasky@gmail.com>
4445
4446 - fixes http://bugzilla.opendarwin.org/show_bug.cgi?id=3667
4447 Core JavaScript 1.5 Reference:Objects:Array:forEach
4448
4449 See WebCore Changelog for layout tests added.
4450
4451 Reviewed by darin.
4452
4453 * kjs/array_object.cpp:
4454 (ArrayProtoFuncImp::call):
4455 * kjs/array_object.h:
4456 (KJS::ArrayProtoFuncImp::):
4457
44582005-06-29 Geoffrey Garen <ggaren@apple.com>
4459
4460 Patch contributed by Oliver Hunt <ojh16@student.canterbury.ac.nz>
4461
4462 -fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3743
4463 Incorrect error message given for certain calls
4464
4465 See WebCore Changelog for layout test added.
4466
4467 Reviewed by mjs.
4468
4469 * kjs/object.cpp:
4470 (KJS::ObjectImp::defaultValue):
4471
44722005-06-29 Geoffrey Garen <ggaren@apple.com>
4473
4474 Rolling out date patch from 6-28-05 because it breaks
4475 fast/js/date-parse-test
4476
4477 Reviewed by NOBODY.
4478
4479 * kjs/date_object.cpp:
4480 (formatLocaleDate):
4481 (DateProtoFuncImp::call):
4482 (DateObjectImp::construct):
4483 (KJS::parseDate):
4484 (ymdhms_to_seconds):
4485 (isSpaceOrTab):
4486 (KJS::KRFCDate_parseDate):
4487 * kjs/date_object.h:
4488 * tests/mozilla/expected.html:
4489
44902005-06-29 Geoffrey Garen <ggaren@apple.com>
4491
4492 Reviewed by Darin.
4493
4494 -fixes http://bugzilla.opendarwin.org/show_bug.cgi?id=3750
4495 build fails with KJS_VERBOSE set
4496
4497 * kjs/nodes.cpp: changed debug print statement to use UString
4498 (VarDeclNode::evaluate):
4499 * kjs/reference.cpp: ditto
4500 (KJS::Reference::putValue):
4501
45022005-06-28 Geoffrey Garen <ggaren@apple.com>
4503
4504 Patch contributed by Carsten Guenther <cguenther@gmail.com>.
4505
4506 -fixes http://bugzilla.opendarwin.org/show_bug.cgi?id=3477
4507 some US-centric date formats not parsed by JavaScript (clock at news8austin.com)
4508
4509 Reviewed by darin.
4510
4511 * kjs/date_object.cpp:
4512 (formatLocaleDate):
4513 (day):
4514 (dayFromYear):
4515 (daysInYear):
4516 (timeFromYear):
4517 (yearFromTime):
4518 (weekDay):
4519 (timeZoneOffset):
4520 (DateProtoFuncImp::call):
4521 (DateObjectImp::construct):
4522 (KJS::parseDate):
4523 (ymdhms_to_seconds):
4524 (KJS::makeTime):
4525 (findMonth):
4526 (KJS::KRFCDate_parseDate):
4527 * kjs/date_object.h:
4528 * tests/mozilla/expected.html: updated expected test results to reflect fix
4529
45302005-06-26 Maciej Stachowiak <mjs@apple.com>
4531
4532 Reviewed by Darin.
4533
4534 - replace hash functions with better ones
4535
4536 * JavaScriptCore.pbproj/project.pbxproj: Add new file to build.
4537 * kjs/interpreter_map.cpp:
4538 (KJS::InterpreterMap::computeHash): Use shared pointer hash.
4539 * kjs/pointer_hash.h: Added.
4540 (KJS::pointerHash): Pointer hash based on 32-bit mix and 64-bit mix hashes.
4541 * kjs/protected_values.cpp:
4542 (KJS::ProtectedValues::computeHash): Use shared pointer hash.
4543 * kjs/ustring.cpp:
4544 (KJS::UString::Rep::computeHash): Use SuperFastHash algorithm.
4545
45462005-06-22 Darin Adler <darin@apple.com>
4547
4548 Change by Anders Carlsson.
4549 Reviewed by me.
4550
4551 - fixed <http://bugzilla.opendarwin.org/show_bug.cgi?id=3294>
4552 String.prototype.replace() fails with function as second param
4553
4554 * kjs/string_object.cpp: (replace): Added code to handle functions.
4555
4556 * tests/mozilla/expected.html: Updated since ecma_3/RegExp/regress-209067.js is fixed now.
4557
4558 * tests/mozilla/run-mozilla-tests: Fix a minor coding style issue that leads to a warning each
4559 time we run the tests.
4560
45612005-06-21 Adele Peterson <adele@apple.com>
4562
4563 rolling out fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=3293, since it caused layout test failures.
4564 fast/forms/element-by-name
4565 fast/loader/loadInProgress
4566
4567 * ChangeLog:
4568 * bindings/objc/objc_runtime.h:
4569 * bindings/objc/objc_runtime.mm:
4570 (ObjcFallbackObjectImp::hasProperty):
4571 * bindings/runtime_array.cpp:
4572 (RuntimeArrayImp::hasProperty):
4573 * bindings/runtime_array.h:
4574 * bindings/runtime_object.cpp:
4575 (RuntimeObjectImp::hasProperty):
4576 * bindings/runtime_object.h:
4577 * kjs/array_instance.h:
4578 * kjs/array_object.cpp:
4579 (ArrayInstanceImp::hasProperty):
4580 * kjs/function.cpp:
4581 (KJS::FunctionImp::hasProperty):
4582 (KJS::ActivationImp::hasProperty):
4583 * kjs/function.h:
4584 * kjs/object.cpp:
4585 (KJS::ObjectImp::hasProperty):
4586 * kjs/object.h:
4587 * kjs/object_object.cpp:
4588 (ObjectPrototypeImp::ObjectPrototypeImp):
4589 (ObjectProtoFuncImp::call):
4590 * kjs/object_object.h:
4591 (KJS::ObjectProtoFuncImp::):
4592 * kjs/string_object.cpp:
4593 (StringInstanceImp::hasProperty):
4594 * kjs/string_object.h:
4595 * tests/mozilla/expected.html:
4596
45972005-06-21 Darin Adler <darin@apple.com>
4598
4599 * JavaScriptCore.pbproj/project.pbxproj: Switched to a build rule rather than a build phase for
4600 .y files -- this gets rid of the problem where modifying the .y file would not cause sufficient
4601 compilation.
4602
4603 * kjs/grammar_wrapper.cpp: Removed.
4604
46052005-06-21 Adele Peterson <adele@apple.com>
4606
4607 Patch from Anders Carlsson <andersca@mac.com>, reviewed by Darin.
4608
4609 Fixed: <http://bugzilla.opendarwin.org/show_bug.cgi?id=3450>
4610 <rdar://problem/3881901> String.replace() method not working when regex pattern contains {n, m}
4611
4612 * pcre/pcre.c: (pcre_compile): Remember the last char length so it can be subtracted correctly if needed.
4613
46142005-06-21 Geoffrey Garen <ggaren@apple.com>
4615
4616 - fixed <rdar://problem/4155532> 'delete' succeeds on functions
4617 - fixed <rdar://problem/4155049> javascript function named as "opener" doesn't get called because of window.opener property
4618
4619 Reviewed by cblu.
4620
4621 * kjs/nodes.cpp:
4622 (FuncDeclNode::processFuncDecl): Functions now have DontDelete and Internal attributes set when appropriate.
4623
4624 Test cases:
4625 * tests/mozilla/expected.html: Updated for one new success.
4626 - see also test case added in WebCore.
4627
46282005-06-20 Maciej Stachowiak <mjs@apple.com>
4629
4630 Reviewed by Darin(first pass) and Hyatt.
4631
4632 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3576
4633 (roll in support for "const" keyword from KDE tree)
4634 - make processVarDecls handle deletability of variables declared
4635 in an eval block the same as evaluate would
4636 - make eval() call processVarDecls - needed to match mozilla and
4637 to make the second change testable
4638
4639 I started with the KDE implementation of const but I ended up changing it a bit
4640 to avoid the use of a global variable. Now instead of the global variable it distinguishes
4641 const and var at the grammar level so the appropriate node can know the right kind of
4642 declaration.
4643
4644 Test cases:
4645 * tests/mozilla/expected.html: Updated for one new test that is
4646 failing - we used to bail on it entirely because it checks for
4647 const support before starting.
4648 - see also test cases added in WebCore
4649
4650 * kjs/grammar.y: Add rules for const declarations.
4651 * kjs/keywords.table: Add const keyword.
4652 * kjs/nodes.cpp:
4653 (VarDeclNode::VarDeclNode): Add parameter.
4654 (VarDeclNode::evaluate): Add const support.
4655 (VarDeclNode::processVarDecls): Add const support.
4656 (VarStatementNode::execute): Irrelevant change.
4657 (ForInNode::ForInNode): Tell our variable node that it's a variable.
4658 * kjs/nodes.h:
4659 (KJS::VarDeclNode::): Add declaration of type enum, extra constructor parameter.
4660 (KJS::VarStatementNode::VarStatementNode): Irrelevant change.
4661 * kjs/function.cpp:
4662 (KJS::GlobalFuncImp::call): Process var decls before evaluating.
4663
46642005-06-20 Maciej Stachowiak <mjs@apple.com>
4665
4666 Patch from Mark Rowe <opendarwin.org@bdash.net.nz>, reviewed by me.
4667
4668 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3293
4669
4670 Test cases added:
4671 * tests/mozilla/expected.html: Updated for two fixed tests.
4672 - also added a layout test
4673
4674 * bindings/objc/objc_runtime.h:
4675 * bindings/objc/objc_runtime.mm:
4676 (ObjcFallbackObjectImp::hasOwnProperty):
4677 * bindings/runtime_array.cpp:
4678 (RuntimeArrayImp::hasOwnProperty):
4679 * bindings/runtime_array.h:
4680 * bindings/runtime_object.cpp:
4681 (RuntimeObjectImp::hasOwnProperty):
4682 * bindings/runtime_object.h:
4683 * kjs/array_instance.h:
4684 * kjs/array_object.cpp:
4685 (ArrayInstanceImp::hasOwnProperty):
4686 * kjs/function.cpp:
4687 (KJS::FunctionImp::hasOwnProperty):
4688 (KJS::ActivationImp::hasOwnProperty):
4689 * kjs/function.h:
4690 * kjs/object.cpp:
4691 (KJS::ObjectImp::hasProperty):
4692 (KJS::ObjectImp::hasOwnProperty):
4693 * kjs/object.h:
4694 (KJS::Object::hasOwnProperty):
4695 * kjs/object_object.cpp:
4696 (ObjectPrototypeImp::ObjectPrototypeImp):
4697 (ObjectProtoFuncImp::call):
4698 * kjs/object_object.h:
4699 (KJS::ObjectProtoFuncImp::):
4700 * kjs/string_object.cpp:
4701 (StringInstanceImp::hasOwnProperty):
4702 * kjs/string_object.h:
4703
47042005-06-18 Darin Adler <darin@apple.com>
4705
4706 Reviewed by Eric Seidel.
4707
4708 * pcre/get.c: (pcre_get_substring): Fix some computations so this works for UTF-16.
4709 This is unused in the current JavaScriptCore, but still good to fix.
4710
47112005-06-18 Darin Adler <darin@apple.com>
4712
4713 Change by Finlay Dobbie.
4714 Reviewed by me.
4715
4716 - fixed <http://bugzilla.opendarwin.org/show_bug.cgi?id=3331>
4717 10.3.9 Build Failure: NSString may not respond to `+stringWithCString:encoding:'
4718
4719 * bindings/objc/WebScriptObject.mm: (-[WebScriptObject stringRepresentation]):
4720 Undo change we did a while back to work around the gcc 3.3 compiler error.
4721 It no longer seems to happen, and the workaround code was 10.4-specific.
4722
47232005-06-16 Geoffrey Garen <ggaren@apple.com>
4724
4725 Fixed: <rdar://problem/4151759> 'delete' fails on variables declared inside 'eval' statements.
4726
4727 Reviewed by cblu.
4728
4729 * kjs/context.h:
4730 (KJS::ContextImp::codeType): Added code type accessor for execution context objects.
4731 * kjs/internal.cpp:
4732 (ContextImp::ContextImp): Reflects change to ContextImp::codeType.
4733 * kjs/nodes.cpp:
4734 (VarDeclNode::evaluate): Added separate code path for variable declarations inside 'eval' statements.
4735 * tests/mozilla/expected.html: Updated expected test results to reflect fix.
4736
47372005-06-14 Geoffrey Garen <ggaren@apple.com>
4738
4739 Updated expected.html to reflect fix to <rdar://problem/4147745>.
4740
4741 Reviewed by cblu.
4742
4743 * tests/mozilla/expected.html:
4744
47452005-06-14 Geoffrey Garen <ggaren@apple.com>
4746
4747 Fixed: <rdar://problem/4147745> JavaScript discards locally defined "arguments" property
4748
4749 No layout tests added because this change fixes existing tests:
4750 ecma/ExecutionContexts/10.1.6.js
4751 ecma_3/Function/regress-94506.js
4752 js1_4/Functions/function-001.js
4753
4754 Reviewed by cblu.
4755
4756 * kjs/function.cpp:
4757 (KJS::ActivationImp::get): get now checks for an "arguments" property defined in the local variable object
4758 before trying to return the built-in arguments array.
4759
4760 * kjs/function.h: ActivationImp::put no longer overrides ObjectImp::put
4761
47622005-06-10 Darin Adler <darin@apple.com>
4763
4764 Change by Mark Rowe <opendarwin.org@bdash.net.nz>.
4765 Reviewed by me.
4766
4767 - further improvements to exception file/line number fix
4768
4769 * kjs/nodes.h: Added setExceptionDetailsIfNeeded function.
4770 * kjs/nodes.cpp: Updated macros to call the new setExceptionDetailsIfNeeded function.
4771 (Node::setExceptionDetailsIfNeeded): Added.
4772
47732005-06-09 Darin Adler <darin@apple.com>
4774
4775 Change by Mark Rowe <opendarwin.org@bdash.net.nz>
4776 Reviewed by me.
4777
4778 * kjs/nodes.cpp: Get rid of unneeded this->.
4779
47802005-06-08 Maciej Stachowiak <mjs@apple.com>
4781
4782 Change by Mark Rowe <opendarwin.org@bdash.net.nz>
4783 Reviewed by me.
4784
4785 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3327
4786 (Exception When Setting Style to Invalid Value Lacks Line/File Information)
4787
4788 * kjs/nodes.cpp: Include source file and line number when making exception in
4789 KJS_CHECKEXCEPTIONVALUE.
4790
47912005-06-07 Darin Adler <darin@apple.com>
4792
4793 Change by Toby Peterson <toby@opendarwin.org>.
4794 Reviewed by me.
4795
4796 * JavaScriptCore.pbproj/project.pbxproj: Allow bison 2.0, which generates the file
4797 with a different name.
4798
47992005-06-07 Darin Adler <darin@apple.com>
4800
4801 Change by Toby Peterson <toby@opendarwin.org>.
4802 Reviewed by me.
4803
4804 * kjs/grammar.y: Remove bogus extra line from grammar.y. Toby got this change from KDE KJS.
4805
48062005-06-06 Darin Adler <darin@apple.com>
4807
4808 * tests/mozilla/run-mozilla-tests: Wrote a perl version of this so we don't require
4809 the "jst" tool to run the tests.
4810
48112005-06-04 Darin Adler <darin@apple.com>
4812
4813 Reviewed by Maciej.
4814
4815 - add libicu headers
4816
4817 * JavaScriptCore.pbproj/project.pbxproj: Added icu directory to header search path.
4818
4819 * icu/README: Added.
4820 * icu/unicode/platform.h: Added.
4821 * icu/unicode/uchar.h: Added.
4822 * icu/unicode/uconfig.h: Added.
4823 * icu/unicode/umachine.h: Added.
4824 * icu/unicode/urename.h: Added.
4825 * icu/unicode/utf.h: Added.
4826 * icu/unicode/utf16.h: Added.
4827 * icu/unicode/utf8.h: Added.
4828 * icu/unicode/utf_old.h: Added.
4829 * icu/unicode/utypes.h: Added.
4830 * icu/unicode/uversion.h: Added.
4831
48322005-05-19 Darin Adler <darin@apple.com>
4833
4834 Reviewed by Maciej.
4835
4836 - turned off exceptions and RTTI; seems to cut JavaScriptCore code size by about 22%
4837
4838 * JavaScriptCore.pbproj/project.pbxproj: Turn off exceptions and RTTI for both
4839 the framework and testkjs tool.
4840
48412005-05-18 Darin Adler <darin@apple.com>
4842
4843 Reviewed by Maciej.
4844
4845 - got rid of code that depended on RTTI
4846
4847 * kjs/collector.cpp:
4848 (KJS::className): Added. Gets class name in a KJS way, rather than a C++ RTTI way.
4849 (KJS::Collector::rootObjectClasses): Use className instead of typeid names.
4850
48512005-05-18 Darin Adler <darin@apple.com>
4852
4853 Reviewed by Maciej.
4854
4855 - fix a failure seen in the Mozilla JavaScript tests where a live object was garbage-collected
4856 when the only reference to it was in an argList on the stack
4857
4858 * kjs/list.h: Moved the operator= function into the .cpp file since it's too big to be
4859 a good choice to inline.
4860 * kjs/list.cpp: (KJS::List::operator=): Moved this formerly-inline function into a separate
4861 file and added missing code to update valueRefCount. It's the latter that fixes the bug.
4862
48632005-05-16 Darin Adler <darin@apple.com>
4864
4865 Reviewed by Adele.
4866
4867 - fixed issues preventing us from compiling with newer versions of gcc 4.0
4868
4869 * kjs/ustring.cpp:
4870 (KJS::operator==): Remove redundant and illegal KJS:: prefix on this function's definition.
4871 (KJS::operator<): Ditto.
4872 (KJS::compare): Ditto.
4873
48742005-05-09 Darin Adler <darin@apple.com>
4875
4876 Reviewed by John.
4877
4878 - turn on conservative GC unconditionally and start on SPI changes to
4879 eliminate the now-unneeded smart pointers since we don't ref count any more
4880
4881 * kjs/value.h: Removed macros to turn conservative GC on and off.
4882 Removed ref and deref functions.
4883 (KJS::ValueImp::ValueImp): Removed non-conservative-GC code path.
4884 (KJS::ValueImp::isUndefined): Added. New SPI to make it easier to deal with ValueImp directly.
4885 (KJS::ValueImp::isNull): Ditto.
4886 (KJS::ValueImp::isBoolean): Ditto.
4887 (KJS::ValueImp::isNumber): Ditto.
4888 (KJS::ValueImp::isString): Ditto.
4889 (KJS::ValueImp::isObject): Ditto.
4890 (KJS::Value::Value): Removed non-conservative-GC code path and made constructor no
4891 longer explicit so we can quietly create Value wrappers from ValueImp *; inexpensive with
4892 conservative GC and eases the transition.
4893 (KJS::Value::operator ValueImp *): Added. Quietly creates ValueImp * from Value.
4894 (KJS::ValueImp::marked): Removed non-conservative-GC code path.
4895
4896 * kjs/value.cpp:
4897 (KJS::ValueImp::mark): Removed non-conservative-GC code path.
4898 (KJS::ValueImp::isUndefinedOrNull): Added. New SPI to make it easier to deal with ValueImp directly.
4899 (KJS::ValueImp::isBoolean): Ditto.
4900 (KJS::ValueImp::isNumber): Ditto.
4901 (KJS::ValueImp::isString): Ditto.
4902 (KJS::ValueImp::asString): Ditto.
4903 (KJS::ValueImp::isObject): Ditto.
4904 (KJS::undefined): Ditto.
4905 (KJS::null): Ditto.
4906 (KJS::boolean): Ditto.
4907 (KJS::string): Ditto.
4908 (KJS::zero): Ditto.
4909 (KJS::one): Ditto.
4910 (KJS::two): Ditto.
4911 (KJS::number): Ditto.
4912
4913 * kjs/object.h: Made constructor no longer explicit so we can quietly create Object
4914 wrappers from ObjectImp *; inexpensive with conservative GC and eases the transition.
4915 (KJS::Object::operator ObjectImp *): Added. Quietly creates ObjectImp * from Object.
4916 (KJS::ValueImp::isObject): Added. Implementation of new object-related ValueImp function.
4917 (KJS::ValueImp::asObject): Ditto.
4918
4919 * kjs/object.cpp:
4920 (KJS::ObjectImp::setInternalValue): Remove non-conservative-GC code path.
4921 (KJS::ObjectImp::putDirect): Ditto.
4922 (KJS::error): Added. Function in the new SPI style to create an error object.
4923
4924 * kjs/internal.h: Added the new number-constructing functions as friends of NumberImp.
4925 There may be a more elegant way to do this later; what's important now is the new SPI.
4926
4927 * kjs/collector.h: Remove non-conservative-GC code path and also take out some
4928 unneeded APPLE_CHANGES.
4929
4930 * bindings/runtime_root.cpp:
4931 (KJS::Bindings::addNativeReference): Remove non-conservative-GC code path.
4932 (KJS::Bindings::removeNativeReference): Ditto.
4933 (RootObject::removeAllNativeReferences): Ditto.
4934 * bindings/runtime_root.h:
4935 (KJS::Bindings::RootObject::~RootObject): Ditto.
4936 (KJS::Bindings::RootObject::setRootObjectImp): Ditto.
4937 * kjs/collector.cpp:
4938 (KJS::Collector::allocate): Ditto.
4939 (KJS::Collector::collect): Ditto.
4940 (KJS::Collector::numGCNotAllowedObjects): Ditto.
4941 (KJS::Collector::numReferencedObjects): Ditto.
4942 (KJS::Collector::rootObjectClasses): Ditto.
4943 * kjs/internal.cpp:
4944 (NumberImp::create): Ditto.
4945 (InterpreterImp::globalInit): Ditto.
4946 (InterpreterImp::globalClear): Ditto.
4947 * kjs/list.cpp:
4948 (KJS::List::markProtectedLists): Ditto.
4949 (KJS::List::clear): Ditto.
4950 (KJS::List::append): Ditto.
4951 * kjs/list.h:
4952 (KJS::List::List): Ditto.
4953 (KJS::List::deref): Ditto.
4954 (KJS::List::operator=): Ditto.
4955 * kjs/protect.h:
4956 (KJS::gcProtect): Ditto.
4957 (KJS::gcUnprotect): Ditto.
4958
49592005-05-09 Chris Blumenberg <cblu@apple.com>
4960
4961 Workaround gcc 3.3 internal compiler errors.
4962
4963 Reviewed by darin.
4964
4965 * bindings/objc/WebScriptObject.mm:
4966 (-[WebScriptObject stringRepresentation]): call [NSString stringWithCString:encoding] rather than using @""
4967
49682005-05-09 Darin Adler <darin@apple.com>
4969
4970 * Makefile.am: Don't set up PBXIntermediatesDirectory explicitly;
4971 Not needed to make builds work, spews undesirable error messages too.
4972
49732005-05-06 Darin Adler <darin@apple.com>
4974
4975 Reviewed by Maciej.
4976
4977 - make building multiple trees with make work better
4978
4979 * Makefile.am: Set up Xcode build directory before invoking xcodebuild.
4980
49812005-05-04 Maciej Stachowiak <mjs@apple.com>
4982
4983 Reviewed by Darin.
4984
4985 <rdar://problem/4086570> Crash in JavaScriptCore with RSS Visualizer
4986
4987 * kjs/internal.cpp:
4988 (InterpreterImp::mark): mark staticNaN, it is usually protected by the Number
4989 prototype but there is a small window where it can get collected.
4990
49912005-05-04 Darin Adler <darin@apple.com>
4992
4993 Reviewed by Dave Hyatt.
4994
4995 - another gcc-4.0-related fix
4996
4997 * bindings/runtime_root.h: Take off extra namespace prefixes that apparently cause problems
4998 compiling with gcc 4.0, although I have not observed the problems.
4999
50002005-05-04 Darin Adler <darin@apple.com>
5001
5002 Reviewed by Dave Hyatt.
5003
5004 - fixed build rules to match other projects
5005
5006 * JavaScriptCore.pbproj/project.pbxproj: Set deployment target to 10.3 in the build styles.
5007 When built without a build style (by Apple B&I) we want to get the target from the
5008 environment. But when built with a build style (by Safari engineers and others), we want
5009 to use 10.3.
5010
5011 * Makefile.am: Took out extra parameters that make command-line building different from
5012 Xcode building. Now that this is fixed, you should not get a full rebuild if you switch
5013 from command line to Xcode or back.
5014
50152005-05-04 Maciej Stachowiak <mjs@apple.com>
5016
5017 - revert presumably accidental change to mozilla JS test expected results, this
5018 was making the tests fail.
5019
5020 * tests/mozilla/expected.html:
5021
50222005-05-03 Richard Williamson <rjw@apple.com>
5023
5024 Fixed <rdar://problem/4102644> Crash in LiveConnect below KJS::Bindings::JavaInstance::stringValue() const
5025
5026 Correctly handle accessing nil objects from a Java object array.
5027
5028 Reviewed by John.
5029
5030 * bindings/jni/jni_runtime.cpp:
5031 (JavaArray::valueAt):
5032
50332005-05-01 Darin Adler <darin@apple.com>
5034
5035 - move to Xcode native targets and stop checking in generated files
5036
5037 * JavaScriptCore.pbproj/project.pbxproj: Updated to use native targets and generate all the generated
5038 files, so we don't have to check them in any more.
5039 * Info.plist: Added. Native targets use a separate file for this.
5040
5041 * Makefile.am: Removed pcre and kjs SUBDIRS. Also removed code that deleted the embedded copy of this
5042 framework, since we haven't been embedding it for some time.
5043
5044 * kjs/grammar_wrapper.cpp: Added. Shell used to compile grammar.cpp since we can't add a generated file
5045 easily to the list of files to be compiled.
5046
5047 * kjs/.cvsignore: Removed.
5048 * kjs/Makefile.am: Removed.
5049 * kjs/array_object.lut.h: Removed.
5050 * kjs/date_object.lut.h: Removed.
5051 * kjs/grammar.cpp: Removed.
5052 * kjs/grammar.cpp.h: Removed.
5053 * kjs/grammar.h: Removed.
5054 * kjs/lexer.lut.h: Removed.
5055 * kjs/math_object.lut.h: Removed.
5056 * kjs/number_object.lut.h: Removed.
5057 * kjs/string_object.lut.h: Removed.
5058 * pcre/.cvsignore: Removed.
5059 * pcre/Makefile.am: Removed.
5060 * pcre/chartables.c: Removed.
5061
50622005-04-28 Darin Adler <darin@apple.com>
5063
5064 Reviewed by Dave Harrison.
5065
5066 - fixed problems preventing us from compiling with gcc 4.0
5067
5068 * JavaScriptCore.pbproj/project.pbxproj: Removed -Wmissing-prototypes from
5069 WARNING_CPLUSPLUSFLAGS since it's now a C-only warning.
5070
5071 * bindings/jni/jni_jsobject.cpp:
5072 (JSObject::getSlot): Changed some %d to %ld where the parameters where long ints.
5073 (JSObject::setSlot): Ditto.
5074 * bindings/jni/jni_utility.cpp:
5075 (KJS::Bindings::getJavaVM): Ditto.
5076 (KJS::Bindings::getJNIEnv): Ditto.
5077 * bindings/objc/objc_utility.mm: Fixed include of <JavascriptCore/internal.h> that needed the
5078 letter "S" capitalized.
5079 * kjs/bool_object.cpp: (BooleanProtoFuncImp::call): Rearranged how this function returns to
5080 avoid incorrect gcc 4.0 warning.
5081 * kjs/collector.cpp: (KJS::Collector::markStackObjectsConservatively): Changed code to check
5082 the alignment of the passed-in pointers to only require pointer-level alignment, not 8-byte alignment.
5083 Prevents a crash on garbage collect when compiled with gcc 4.0.
5084 * kjs/nodes.cpp:
5085 (WhileNode::execute): Added a redundant return after an infinite loop to work around incorrect gcc 4.0 warning.
5086 (ForNode::execute): Ditto.
5087 (SwitchNode::execute):Rearranged how this function returns to avoid incorrect gcc 4.0 warning.
5088 (LabelNode::execute): Ditto.
5089 * kjs/string_object.cpp: (replace): Ditto.
5090
50912005-04-26 Richard Williamson <rjw@apple.com>
5092
5093 Fixed <rdar://problem/4098713> Scripting API is incompatible with Mozilla
5094
5095 We were incompatible with Mozilla's implementation of the scripting APIs in
5096 two ways:
5097
5098 Their NPN_SetException has the following signature:
5099
5100 void NPN_SetException(NPObject *npobj, const NPUTF8 *message);
5101
5102 ours has:
5103
5104 void NPN_SetException (NPObject * npobj, const NPString *message);
5105
5106 Also, they expect the string returned from NPN_UTF8FromIdentifier() to be freed by caller.
5107 We do not.
5108
5109 I changed both behaviors to match Mozilla.
5110
5111 Reviewed by Chris.
5112
5113 * bindings/NP_jsobject.cpp:
5114 (_NPN_SetException):
5115 * bindings/npruntime.cpp:
5116 (_NPN_UTF8FromIdentifier):
5117 (_NPN_IntFromIdentifier):
5118 (_NPN_SetExceptionWithUTF8):
5119 * bindings/npruntime.h:
5120 * bindings/npruntime_impl.h:
5121
51222005-04-26 Maciej Stachowiak <mjs@apple.com>
5123
5124 Reviewed by Chris.
5125
5126 <rdar://problem/4092136> reproducible crash in KJS::kjs_fast_realloc loading maps.google.com
5127
5128 * kjs/string_object.cpp:
5129 (StringObjectFuncImp::call): Allocate adopted ustring buffer properly.
5130
51312005-04-22 Darin Adler <darin@apple.com>
5132
5133 Reviewed by Maciej.
5134
5135 * kjs/ustring.cpp: (KJS::UString::UTF8String): Fix off-by-one error in surrogate pair logic.
5136
51372005-04-22 Darin Adler <darin@apple.com>
5138
5139 Reviewed by John.
5140
5141 - fixed <rdar://problem/4090046> JavaScript throw statement causes parse error when no semicolon is present
5142
5143 * kjs/grammar.y: Added an additional rule for throw like the ones we have for all the other semicolon rules.
5144 Not sure why we missed this one earlier.
5145
5146 * kjs/grammar.cpp: Regenerated.
5147
5148=== JavaScriptCore-412.1 ===
5149
51502005-04-20 Darin Adler <darin@apple.com>
5151
5152 Reviewed by Maciej.
5153
5154 - speedups, total 12% on JavaScript iBench
5155
5156 I ran the benchmark under Shark and followed its advice a lot, mainly.
5157
5158 * kjs/collector.cpp:
5159 (KJS::Collector::allocate): Take out special case for 0; costing speed but unexercised.
5160 Use numLiveObjectsAtLastCollect instead of numAllocationsSinceLastCollect so we don't
5161 have to bump it each time we call allocate. Put numLiveObjects into a local variable to
5162 cut down on global variable accesses. Make "next" cell pointer be a byte offset rather
5163 than a pointer so we don't need a special case for NULL. Allow freeList to point to some
5164 bogus item when the entire block is full rather than going out of our way to make it
5165 point to NULL.
5166 (KJS::Collector::markProtectedObjects): Get table size and pointer into locals outside
5167 the loop to avoid re-loading them over and over again.
5168 (KJS::Collector::collect): Put numLiveObjects into a local variable to cut down on global
5169 variable accesses. Make "next" cell pointer be a byte offset as above. Put numLiveObjects
5170 into a local variable to cut down on global variable accesses. Set numLiveObjectsAtLastCollect
5171 rather than numAllocationsSinceLastCollect.
5172 (KJS::Collector::numReferencedObjects): Get table size and pointer into locals outside
5173 the loop to avoid re-loading them over and over again.
5174 (KJS::Collector::rootObjectClasses): Ditto.
5175
5176 * kjs/internal.h: Make Value be a friend of NumberImp so it can construct number objects
5177 directly, avoiding the conversion from Number to Value.
5178
5179 * kjs/internal.cpp: (StringImp::toObject): Don't use Object::dynamicCast, because we know
5180 the thing is an object and we don't want to do all the extra work; just cast directly.
5181
5182 * kjs/list.cpp: (KJS::List::List): Construct valueRefCount in a way that avoids the need for
5183 a branch -- in the hot case this just meant avoiding checking a variable we just set to false.
5184
5185 * kjs/lookup.cpp: (keysMatch): Marked this inline.
5186
5187 * kjs/nodes.cpp: Disabled KJS_BREAKPOINT, to avoid calling hitStatement all the time.
5188 (BooleanNode::evaluate): Make a Value directly, rather than making a Boolean which is converted
5189 into a Value.
5190 (NumberNode::evaluate): Ditto.
5191 (StringNode::evaluate): Ditto.
5192 (ArrayNode::evaluate): Ditto.
5193 (FunctionCallNode::evaluate): Use new inline baseIfMutable to avoid unnecessary getBase function.
5194 Also just use a pointer for func, rather than an Object.
5195 (PostfixNode::evaluate): Change code so that it doesn't make an excess Number, and so that it
5196 passes a "known to be integer" boolean in, often avoiding a conversion from floating point to
5197 integer and back.
5198 (DeleteNode::evaluate): Make a Value directly.
5199 (TypeOfNode::evaluate): Use new inline baseIfMutable and make Value directly.
5200 (PrefixNode::evaluate): Change code so that it doesn't make an excess Number, and so that it
5201 passes a "known to be integer" boolean in, often avoiding a conversion from floating point to
5202 integer and back.
5203 (UnaryPlusNode::evaluate): Make a Value directly.
5204 (NegateNode::evaluate): Change code so that it doesn't make an excess Number, and so that it
5205 passes a "known to be integer" boolean in, often avoiding a conversion from floating point to
5206 integer and back.
5207 (BitwiseNotNode::evaluate): Make a Value directly.
5208 (LogicalNotNode::evaluate): Ditto.
5209 (ShiftNode::evaluate): Don't convert to a double before making a Value.
5210 (RelationalNode::evaluate): Make a Value directly.
5211 (EqualNode::evaluate): Ditto.
5212 (BitOperNode::evaluate): Ditto.
5213 (AssignNode::evaluate): Make a Value directly. Change code so that it passes a "known to be integer"
5214 boolean in, often avoiding a conversion from floating point to integer and back.
5215 (VarDeclNode::evaluate): Make a Value directly.
5216 (ForNode::execute): Remove unused local variable.
5217
5218 * kjs/operations.h:
5219 (KJS::isNaN): Inlined.
5220 (KJS::isInf): Ditto.
5221 (KJS::isPosInf): Ditto.
5222 (KJS::isNegInf): Ditto.
5223
5224 * kjs/operations.cpp: Change isNaN, isInf, isPosInf, and isNegInf to be inlines.
5225 (KJS::equal): Rewrite to avoid creating values and recursing back into the function.
5226 (KJS::relation): Rearranged code so that we don't need explicit isNaN checks.
5227 (KJS::add): Changed code to make Value directly, and so that it passes a "known to be integer"
5228 boolean in, often avoiding a conversion from floating point to integer and back.
5229 (KJS::mult): Ditto.
5230
5231 * kjs/property_map.cpp:
5232 (KJS::PropertyMap::~PropertyMap): Get size and entries pointer outside loop to avoid
5233 re-getting them inside the loop.
5234 (KJS::PropertyMap::clear): Ditto. Clear value pointer in addition to key, so we can just
5235 look at the value pointer in the mark function.
5236 (KJS::PropertyMap::get): Get sizeMask and entries pointer outside loop to avoid
5237 re-getting them inside the loop.
5238 (KJS::PropertyMap::put): Ditto.
5239 (KJS::PropertyMap::insert): Ditto.
5240 (KJS::PropertyMap::remove): Ditto.
5241 (KJS::PropertyMap::mark): Get size and entries pointer outside loop to avoid
5242 re-getting them inside the loop. Don't bother checking key for 0, since we already have
5243 to check value for 0. (Also had to change clear() to set value to 0.)
5244 (KJS::PropertyMap::addEnumerablesToReferenceList): Get size and entries pointer outside
5245 loop to avoid re-getting them inside the loop.
5246 (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList): Ditto.
5247 (KJS::PropertyMap::save): Ditto.
5248
5249 - other changes
5250
5251 * kjs/protected_values.h: Remove unneeded class name qualifiers.
5252
5253 * kjs/reference.h:
5254 (KJS::Reference::baseIfMutable): New inline function: replaces isMutable().
5255 (KJS::Reference::Reference): Inlined.
5256 * kjs/reference.cpp:
5257 (KJS::Reference::getValue): Rewrite to not use getBase.
5258 (KJS::Reference::putValue): Ditto.
5259 (KJS::Reference::deleteValue): Dittol
5260
5261 * kjs/simple_number.h:
5262 (KJS::SimpleNumber::integerFits): Added. For use when the parameter is known to be integral.
5263
5264 * kjs/string_object.cpp: (StringProtoFuncImp::call): Create the number without first converting
5265 to double in various cases that involve integers.
5266
5267 * kjs/ustring.h:
5268 (KJS::UString::attach): Inlined.
5269 (KJS::UString::release): Inlined.
5270 * kjs/ustring.cpp:
5271 (KJS::UString::find): Get first character outside the loop instead of re-fetching it each time.
5272
5273 * kjs/value.cpp:
5274 (Value::Value): Added overloads for all the various specific types of values, so you don't have
5275 to convert from, say, Number to Value, just to create one.
5276 (Number::Number): Added an overload that takes a boolean to indicate the number is already
5277 known to be an integer.
5278
5279 * kjs/value.h: Added more Value constructors, added a version of toNumber that returns
5280 a boolean to indicate if the number is known to be an integer (because it was a "simple number").
5281 (KJS::ValueImp::marked): Inlined.
5282 (KJS::ValueImp::dispatchType): Inlined.
5283 (KJS::ValueImp::dispatchToPrimitive): Inlined.
5284 (KJS::ValueImp::dispatchToBoolean): Inlined.
5285 (KJS::ValueImp::dispatchToNumber): Inlined.
5286 (KJS::ValueImp::dispatchToString): Inlined.
5287 (KJS::ValueImp::dispatchToUInt32): Inlined.
5288
52892005-04-14 Maciej Stachowiak <mjs@apple.com>
5290
5291 - make fast_malloc.h a private header, not project
5292
5293 * JavaScriptCore.pbproj/project.pbxproj:
5294
52952005-04-12 Maciej Stachowiak <mjs@apple.com>
5296
5297 Reviewed by Richard.
5298
5299 <rdar://problem/4089734> JavaScript iBench can be sped up ~10% with custom allocator
5300
5301 - use custom single-threaded malloc for all non-GC JavaScriptCore
5302 allocations, for a 9.1% speedup on JavaScript iBench
5303
5304 * JavaScriptCore.pbproj/project.pbxproj:
5305 * kjs/collector.cpp:
5306 (KJS::Collector::allocate): Use dlmalloc to allocate the collector blocks.
5307 (KJS::Collector::collect): And dlfree to free it.
5308 * kjs/fast_malloc.cpp: Added, just the standard dlmalloc here.
5309 * kjs/fast_malloc.h: Added. Declarations for the functions. Also added a handy
5310 macro to give a class custom operator new/delete
5311 * kjs/identifier.cpp:
5312 (KJS::Identifier::add): Use dlmalloc/dlfree.
5313 * kjs/nodes.h: make nodes KJS_FAST_ALLOCATED.
5314 * kjs/property_map.cpp:
5315 (KJS::PropertyMap::~PropertyMap): Use dlmalloc/dlfree.
5316 (KJS::PropertyMap::rehash): ditto
5317 * kjs/scope_chain.h:
5318 * kjs/ustring.cpp:
5319 (KJS::UString::Rep::createCopying): New named constructor that copies a passed-in
5320 buffer, to hide allocation details from webcore.
5321 (KJS::UString::UString): use createCopying when appropriate.
5322 (KJS::UString::Rep::destroy): Use dlmalloc/dlfree.
5323 (KJS::UString::expandedSize): likewise
5324 (KJS::UString::expandCapacity): likewise
5325 (KJS::UString::expandPreCapacity): likewise
5326 (KJS::UString::spliceSubstringsWithSeparators): likewise
5327 (KJS::UString::append): likewise
5328 (KJS::UString::operator=): likewise
5329 (KJS::UString::detach): likewise
5330 * kjs/ustring.h: make UString and UString::Rep KJS_FAST_ALLOCATED.
5331
53322005-04-11 Maciej Stachowiak <mjs@apple.com>
5333
5334 Reviewed by John.
5335
5336 <rdar://problem/4086819> Avoid using protect count hash table so much for 5.6% JS iBench speedup
5337
5338 - Avoid using protected values hash for the two most common cases
5339 - Bump up ListImp high water mark, new testing shows 508 ListImps are
5340 created during JS iBench.
5341
5342 Net result is a 5.6% speedup on JavaScript iBench
5343
5344 * kjs/collector.cpp:
5345 (KJS::Collector::collect): mark protected lists as appropriate.
5346 * kjs/context.h:
5347 * kjs/list.cpp:
5348 (KJS::ListImp::markValues): Moved implementation from List::markValues
5349 (KJS::List::markProtectedLists): Implemented - scan pool and overflow
5350 list.
5351 (KJS::allocateListImp): link lists outside the pool into a separate
5352 doubly linked list to be able to mark protected lists
5353 (KJS::deallocateListImp): do the corresponding delinking
5354 (KJS::List::derefValues): do nothing in conservative GC mode
5355 (KJS::List::refValues): do nothing in conservative GC mode
5356 (KJS::List::markValues): call ListImp version
5357 (KJS::List::append):
5358 * kjs/list.h:
5359
5360=== Safari-412 ===
5361
5362=== Safari-411 ===
5363
5364=== Safari-410 ===
5365
5366=== Safari-409 ===
5367
5368=== Safari-408 ===
5369
5370=== Safari-407 ===
5371
53722005-03-16 Jens Alfke <jens@apple.com>
5373
5374 Reviewed by Kevin.
5375
5376 Fix for <rdar://problem/4025212> "REGRESSION (163-164): search not performed correctly; united.com"
5377 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.
5378 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.)
5379 Darin says this regression occurred when we replaced our own implementation of unescape() with code from KJS.
5380
5381 * kjs/function.cpp:
5382 (KJS::GlobalFuncImp::call):
5383
53842005-03-15 Richard Williamson <rjw@apple.com>
5385
5386 Fixed <rdar://problem/4053276> WebScripting protocol in WebKit cannot convert Boolean in Javascript to BOOL in Objective-C
5387
5388 Added JavaScript boolean to type that can be converted to
5389 ObjC scalar parameters.
5390
5391 Reviewed by Ken Kocienda.
5392
5393 * bindings/objc/objc_utility.mm:
5394 (KJS::Bindings::convertValueToObjcValue):
5395
5396=== Safari-406 ===
5397
5398=== Safari-405 ===
5399
5400=== Safari-403 ===
5401
5402=== Safari-402 ===
5403
5404=== Safari-401 ===
5405
5406=== Safari-400 ===
5407
5408=== Safari-188 ===
5409
54102005-02-21 Darin Adler <darin@apple.com>
5411
5412 * kjs/date_object.cpp: (timetUsingCF): Fixed indenting.
5413
54142005-02-17 Richard Williamson <rjw@apple.com>
5415
5416 Fixed <rdar://problem/4003251> Safari crashed at www.icelandair.com in LiveConnect code converting a Java object to a string
5417
5418 Added nil check.
5419
5420 Reviewed by John Sullivan.
5421
5422 * bindings/jni/jni_runtime.cpp:
5423 (JavaField::valueFromInstance):
5424
5425=== Safari-187 ===
5426
54272005-02-11 Richard Williamson <rjw@apple.com>
5428
5429 Fixed <rdar://problem/3985118> DOM objects not being marshaled on JS->native calls
5430
5431 Re-factored how 'native' wrappers for JS objects are created. The interpreter now
5432 creates these wrappers. The WebCore subclass of the interpreter now overrides
5433 createLanguageInstanceForValue() and creates a DOM ObjC wrapper for DOM objects.
5434
5435 Reviewed by Ken.
5436
5437 * bindings/c/c_utility.cpp:
5438 (convertValueToNPVariant):
5439 * bindings/jni/jni_instance.cpp:
5440 (JavaInstance::invokeMethod):
5441 * bindings/jni/jni_objc.mm:
5442 (KJS::Bindings::dispatchJNICall):
5443 * bindings/jni/jni_runtime.cpp:
5444 (JavaField::valueFromInstance):
5445 (JavaArray::valueAt):
5446 * bindings/objc/WebScriptObject.mm:
5447 (-[WebScriptObject _setExecutionContext:KJS::Bindings::]):
5448 (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
5449 * bindings/objc/WebScriptObjectPrivate.h:
5450 * bindings/objc/objc_utility.h:
5451 * bindings/objc/objc_utility.mm:
5452 (KJS::Bindings::convertObjcValueToValue):
5453 (KJS::Bindings::createObjcInstanceForValue):
5454 * bindings/runtime.cpp:
5455 (Instance::createBindingForLanguageInstance):
5456 (Instance::createRuntimeObject):
5457 (Instance::createLanguageInstanceForValue):
5458 * bindings/runtime.h:
5459 * kjs/interpreter.cpp:
5460 (Interpreter::createLanguageInstanceForValue):
5461 * kjs/interpreter.h:
5462
5463=== Safari-186 ===
5464
54652005-02-10 Darin Adler <darin@apple.com>
5466
5467 "Reviewed" by Richard (he told me the file was obsolete).
5468
5469 - got rid of an obsolete file
5470
5471 * bindings/npsap.h: Removed.
5472
5473=== Safari-185 ===
5474
5475=== Safari-183 ===
5476
54772005-02-03 Richard Williamson <rjw@apple.com>
5478
5479 Fixed <rdar://problem/3972905> CrashTracer: ...36 crashes at com.apple.WebCore: khtml::CSSStyleSelector::applyDeclarations + 120
5480
5481 Revert to old (and correct) behavior of returning runtime object
5482 when passed as a parameter, rather than it's corresponding DOM
5483 object.
5484
5485 Reviewed by Chris.
5486
5487 * bindings/objc/WebScriptObject.mm:
5488 (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
5489
5490=== Safari-182 ===
5491
54922005-01-28 Richard Williamson <rjw@apple.com>
5493
5494 Fixed <rdar://problem/3980389> JavaScript bindings access incorrect runtime object
5495
5496 Only use special 'back door' property to get the runtime object if thisObj isn't
5497 already a runtime object.
5498
5499 <gratuitous> Cleaned up a couple of strcmp on ClassInfo name. Used == on
5500 ClassInfo pointer instead.
5501
5502 Reviewed by Chris.
5503
5504 * bindings/c/c_utility.cpp:
5505 (convertValueToNPVariant):
5506 * bindings/objc/WebScriptObject.mm:
5507 (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
5508 * bindings/runtime_method.cpp:
5509 (RuntimeMethodImp::call):
5510
5511=== Safari-181 ===
5512
55132005-01-26 Richard Williamson <rjw@apple.com>
5514
5515 Fixed <rdar://problem/3972522> (179-180) 40% slowdown on iBench JavaScript test
5516
5517 I added a member variable to ObjectImp. This changed it's size and consequently
5518 hampered the optimizations built into the garbage collector. Objects no longer
5519 fit within the allocators cell size, and thus allocation fell back to a slower
5520 allocator.
5521
5522 As a result of this fix I also dramatically cleaned up how runtime objects are
5523 accessed. The path mostly *removes* code.
5524
5525 Reviewed by Chris.
5526
5527 * bindings/runtime_method.cpp:
5528 (RuntimeMethodImp::call):
5529 * bindings/runtime_object.cpp:
5530 (RuntimeObjectImp::get):
5531 (RuntimeObjectImp::put):
5532 (RuntimeObjectImp::canPut):
5533 (RuntimeObjectImp::hasProperty):
5534 (RuntimeObjectImp::defaultValue):
5535 * bindings/runtime_object.h:
5536 * kjs/object.cpp:
5537 (KJS::ObjectImp::ObjectImp):
5538 * kjs/object.h:
5539
55402005-01-20 Darin Adler <darin@apple.com>
5541
5542 Reviewed by me, changes by Han Ming Ong.
5543
5544 - <rdar://problem/3964302> SWB: A few files need to be updated to be compilable under GCC 4.0
5545
5546 * bindings/objc/WebScriptObjectPrivate.h: Make members public.
5547 * kjs/lookup.h: Change "value.h" to "object.h" because we need KJS::Object to compile a template.
5548
55492005-01-20 Richard Williamson <rjw@apple.com>
5550
5551 Fixed <rdar://problem/3964634> undefined property value from binding seems to evaluate to true in an if statement
5552
5553 The comprehensive fix for this problem requires new API, as described in 3965326. However,
5554 given that we can't add new API at this point, the 'ObjcFallbackObjectImp' will behave
5555 like and Undefined object if invokeUndefinedMethodFromWebScript:withArguments: isn't
5556 implemented on the bound object.
5557
5558 Reviewed by Chris.
5559
5560 * bindings/objc/objc_runtime.h:
5561 * bindings/objc/objc_runtime.mm:
5562 (ObjcFallbackObjectImp::type):
5563 (ObjcFallbackObjectImp::implementsCall):
5564 (ObjcFallbackObjectImp::toBoolean):
5565 * bindings/testbindings.mm:
5566 (+[MyFirstInterface isSelectorExcludedFromWebScript:]):
5567 (+[MyFirstInterface isKeyExcludedFromWebScript:]):
5568
5569=== Safari-180 ===
5570
55712005-01-19 Richard Williamson <rjw@apple.com>
5572
5573 Fixed <rdar://problem/3853676> Browser Crash when accessing CCWeb Progress Page - KJS::Bindings::convertValueToJValue
5574
5575 Fixed the following problems with LiveConnect that are demonstrated by the application
5576 described in 3853676.
5577
5578 1. If a nil object is passed in an array from Java to JavaScript we will crash.
5579 2. We sometimes will incorrectly attempt to access a generic JavaScript as a Java runtime object wrapper.
5580 3. We will sometimes fail to find the correct static method ID.
5581
5582 Reviewed by Maciej.
5583
5584 * bindings/jni/jni_jsobject.cpp:
5585 (JSObject::convertJObjectToValue):
5586 (JSObject::listFromJArray):
5587 * bindings/jni/jni_runtime.cpp:
5588 (JavaField::valueFromInstance):
5589 (JavaField::setValueToInstance):
5590 * bindings/jni/jni_utility.cpp:
5591 (KJS::Bindings::getMethodID):
5592 (KJS::Bindings::convertValueToJValue):
5593 * bindings/runtime_array.h:
5594
55952005-01-18 Richard Williamson <rjw@apple.com>
5596
5597 Fixed several issues all arising from analysis of plugin detection code at ifilm.com:
5598
5599 Fixed <rdar://problem/3958592> can't script plug-ins if plug-in is invoked with <object> element instead of <embed>
5600 Fixed <rdar://problem/3958597> <object> elements with IDs do not show up as named properties of the document
5601 Fixed <rdar://problem/3960973> DOM objects for plugin elements are not accessible
5602 Fixed <rdar://problem/3958601> need an additional class ID in WebCore for the Real plug-in
5603
5604 We now support accessing scriptable plugin objects that are specified with <applet>, <embed>, or <object>
5605 tags. Also, if any of these elements are named they can be accessed from the document or window objects.
5606 Finally, DOM methods are properties will be forwarded appropriately for the plugin's root scriptable object.
5607
5608 Reviewed by Chris.
5609
5610 * bindings/objc/objc_instance.h:
5611 * bindings/objc/objc_instance.mm:
5612 (ObjcInstance::supportsSetValueOfUndefinedField):
5613 * bindings/runtime.h:
5614 (KJS::Bindings::Instance::supportsSetValueOfUndefinedField):
5615 * bindings/runtime_object.cpp:
5616 (RuntimeObjectImp::RuntimeObjectImp):
5617 (RuntimeObjectImp::get):
5618 (RuntimeObjectImp::put):
5619 (RuntimeObjectImp::canPut):
5620 (RuntimeObjectImp::hasProperty):
5621 (RuntimeObjectImp::defaultValue):
5622 * bindings/runtime_object.h:
5623 (KJS::RuntimeObjectImp::fallbackObject):
5624 * kjs/object.cpp:
5625 (KJS::ObjectImp::ObjectImp):
5626 * kjs/object.h:
5627 (KJS::ObjectImp::forwardingScriptMessage):
5628 (KJS::ObjectImp::setForwardingScriptMessage):
5629
56302005-01-18 Richard Williamson <rjw@apple.com>
5631
5632 Back out a change that was incorrectly committed yesterday.
5633
5634 Reviewed by Chris.
5635
5636 * bindings/objc/objc_utility.mm:
5637 (KJS::Bindings::convertValueToObjcValue):
5638
56392005-01-17 Richard Williamson <rjw@apple.com>
5640
5641 Fixed <rdar://problem/3753030> Need to ensure same origin for plugin binding invocations (origin security rules)
5642
5643 Keep track of originating execution context and target execution
5644 context for native JS object wrappers, and perform appropriate
5645 security checks.
5646
5647 Reviewed by David Harrison.
5648
5649 * bindings/NP_jsobject.cpp:
5650 (_isSafeScript):
5651 (_NPN_CreateScriptObject):
5652 (_NPN_Invoke):
5653 (_NPN_Evaluate):
5654 (_NPN_GetProperty):
5655 (_NPN_SetProperty):
5656 (_NPN_RemoveProperty):
5657 (_NPN_HasProperty):
5658 (_NPN_HasMethod):
5659 (_NPN_SetException):
5660 * bindings/NP_jsobject.h:
5661 * bindings/c/c_instance.cpp:
5662 (CInstance::CInstance):
5663 (CInstance::stringValue):
5664 * bindings/c/c_instance.h:
5665 * bindings/c/c_utility.cpp:
5666 (convertValueToNPVariant):
5667 * bindings/jni/jni_instance.cpp:
5668 (JavaInstance::JavaInstance):
5669 (JavaInstance::valueOf):
5670 * bindings/jni/jni_instance.h:
5671 * bindings/objc/WebScriptObject.mm:
5672 (-[WebScriptObject _initializeWithObjectImp:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
5673 (-[WebScriptObject _initWithObjectImp:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
5674 (-[WebScriptObject KJS::Bindings::]):
5675 (-[WebScriptObject _setOriginExecutionContext:KJS::Bindings::]):
5676 (-[WebScriptObject _isSafeScript]):
5677 (-[WebScriptObject callWebScriptMethod:withArguments:]):
5678 (-[WebScriptObject evaluateWebScript:]):
5679 (-[WebScriptObject setValue:forKey:]):
5680 (-[WebScriptObject valueForKey:]):
5681 (-[WebScriptObject removeWebScriptKey:]):
5682 (-[WebScriptObject stringRepresentation]):
5683 (-[WebScriptObject webScriptValueAtIndex:]):
5684 (-[WebScriptObject setWebScriptValueAtIndex:value:]):
5685 (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
5686 * bindings/objc/WebScriptObjectPrivate.h:
5687 * bindings/objc/objc_instance.h:
5688 * bindings/objc/objc_runtime.mm:
5689 (convertValueToObjcObject):
5690 * bindings/objc/objc_utility.mm:
5691 (KJS::Bindings::convertValueToObjcValue):
5692 * bindings/runtime.cpp:
5693 (Instance::Instance):
5694 (Instance::operator=):
5695 * bindings/runtime.h:
5696 (KJS::Bindings::Instance::Instance):
5697 (KJS::Bindings::Instance::setExecutionContext):
5698 (KJS::Bindings::Instance::executionContext):
5699 * bindings/runtime_root.cpp:
5700 (RootObject::setInterpreter):
5701 * bindings/runtime_root.h:
5702 * kjs/interpreter.h:
5703 (KJS::Interpreter::isGlobalObject):
5704 (KJS::Interpreter::interpreterForGlobalObject):
5705 (KJS::Interpreter::isSafeScript):
5706
5707=== Safari-179 ===
5708
57092005-01-13 Vicki Murley <vicki@apple.com>
5710
5711 Reviewed by Adele.
5712
5713 - fix <rdar://problem/3946836> Safari about box lists 2004 instead of 2005
5714
5715 * JavaScriptCore.pbproj/project.pbxproj: bump "2004" to "2005"
5716
57172005-01-12 Richard Williamson <rjw@apple.com>
5718
5719 Avoid additional work on dealloc by adding early out to
5720 removeNativeReference(). (This will save time on dealloc
5721 for all ObjC DOM objects.)
5722
5723 Reviewed by Darin.
5724
5725 * bindings/runtime_root.cpp:
5726 (KJS::Bindings::removeNativeReference):
5727
57282005-01-12 Richard Williamson <rjw@apple.com>
5729
5730 Fixed <rdar://problem/3923356> REGRESSION: Java/JavaScript security checks working incorrectly
5731
5732 We were always returning the first "root" object for all runtime
5733 objects. Changed 0 in loop to i, the index.
5734
5735 Reviewed by David Harrison.
5736
5737 * bindings/runtime_root.cpp:
5738 (KJS::Bindings::rootForImp):
5739
57402005-01-11 Richard Williamson <rjw@apple.com>
5741
5742 Fixed <rdar://problem/3887930> Must use new Java plug-in API to get/set fields so exception handling works (fixes many LiveConnect crashes)
5743
5744 Use the new dispatching API to invoke JNI, rather than calling JNI
5745 directly.
5746
5747 Reviewed by David Harrison.
5748
5749 * bindings/jni/jni_instance.cpp:
5750 (JavaInstance::invokeMethod):
5751 * bindings/jni/jni_runtime.cpp:
5752 (JavaField::dispatchValueFromInstance):
5753 (JavaField::valueFromInstance):
5754 (JavaField::dispatchSetValueToInstance):
5755 (JavaField::setValueToInstance):
5756 * bindings/jni/jni_runtime.h:
5757 * bindings/jni/jni_utility.cpp:
5758 (KJS::Bindings::convertValueToJValue):
5759
5760=== Safari-178 ===
5761
5762=== Safari-177 ===
5763
5764=== Safari-176 ===
5765
57662004-12-17 Maciej Stachowiak <mjs@apple.com>
5767
5768 Reviewed by Kevin.
5769
5770 <rdar://problem/3926869> Opening caches window after running PLT causes crash
5771
5772 * kjs/protected_values.cpp:
5773 (KJS::ProtectedValues::getProtectCount): Don't include simple numbers in
5774 the protected value table.
5775 (KJS::ProtectedValues::increaseProtectCount): Ditto.
5776 (KJS::ProtectedValues::decreaseProtectCount): Ditto.
5777
57782004-12-16 Darin Adler <darin@apple.com>
5779
5780 Reviewed by Maciej.
5781
5782 - fixed <rdar://problem/3920764> Unimplemented String methods toLocaleLowerCase and toLocaleUpperCase
5783
5784 * kjs/string_object.h: Added toLocaleLowerCase and toLocaleUpperCase.
5785 * kjs/string_object.cpp: (StringProtoFuncImp::call): Made locale versions be synonmyms for the
5786 non-locale-specific versions.
5787 * kjs/string_object.lut.h: Regenerated.
5788
57892004-12-14 Richard Williamson <rjw@apple.com>
5790
5791 Pass URL of plugin view when call into JNI.
5792
5793 Reviewed by Chris.
5794
5795 * bindings/jni/jni_objc.mm:
5796 (KJS::Bindings::dispatchJNICall):
5797
57982004-12-13 Richard Williamson <rjw@apple.com>
5799
5800 Fixed <rdar://problem/3827799> repro. crash with IBM Rational ClearCase Web under Safari (Java/LiveConnect-related)
5801
5802 Add support for calling static Java methods from JavaScript.
5803
5804 Reviewed by Maciej.
5805
5806 * bindings/jni/jni_instance.cpp:
5807 (JavaInstance::invokeMethod):
5808 * bindings/jni/jni_runtime.cpp:
5809 (JavaMethod::JavaMethod):
5810 * bindings/jni/jni_runtime.h:
5811 (KJS::Bindings::JavaMethod::isStatic):
5812 * bindings/jni/jni_utility.cpp:
5813 (callJNIStaticMethod):
5814 (KJS::Bindings::callJNIBooleanMethod):
5815 (KJS::Bindings::callJNIStaticBooleanMethod):
5816 * bindings/jni/jni_utility.h:
5817
58182004-12-13 Richard Williamson <rjw@apple.com>
5819
5820 Fixed <rdar://problem/3887767> LiveConnect doesn't propagate Java exceptions back to JavaScript (prevents security suite from running)
5821
5822 Reviewed by John.
5823
5824 * bindings/jni/jni_instance.cpp:
5825 (JavaInstance::invokeMethod):
5826 * bindings/jni/jni_objc.mm:
5827 (KJS::Bindings::dispatchJNICall):
5828 * bindings/jni/jni_runtime.h:
5829 * bindings/jni/jni_utility.h:
5830
5831=== Safari-175 ===
5832
58332004-12-07 Maciej Stachowiak <mjs@apple.com>
5834
5835 Reviewed by Darin.
5836
5837 <rdar://problem/3908017> REGRESSION (172-173): assertion in ObjectImp::construct trying to create JS error (24hourfitness.com)
5838
5839 The fix was to implement copy constructor and assignment operator,
5840 the ones that worked on the base class did not replace the
5841 defaults apparently!
5842
5843 * kjs/protect.h:
5844 (KJS::ProtectedValue::ProtectedValue):
5845 (KJS::ProtectedValue::operator=):
5846 (KJS::ProtectedObject::ProtectedObject):
5847 (KJS::ProtectedObject::operator=):
5848
5849 Also fixed a bug in the GC test mode that compares the results of
5850 the old collector and the new collector.
5851
5852 * kjs/value.cpp:
5853 (ValueImp::mark):
5854
5855=== Safari-173 ===
5856
58572004-11-23 Richard Williamson <rjw@apple.com>
5858
5859 Fixed <rdar://problem/3890385> field and method cache incorrectly capped (c bindings)
5860
5861 Reviewed by Ken.
5862
5863 * bindings/c/c_class.cpp:
5864 (CClass::_commonInit):
5865
58662004-11-21 Maciej Stachowiak <mjs@apple.com>
5867
5868 Reviewed by Ken.
5869
5870 <rdar://problem/3889696> Enable conservative garbage collection for JavaScript
5871
5872 * kjs/collector.cpp:
5873 (KJS::Collector::Thread::Thread):
5874 (KJS::destroyRegisteredThread):
5875 (KJS::initializeRegisteredThreadKey):
5876 (KJS::Collector::registerThread):
5877 (KJS::Collector::markStackObjectsConservatively):
5878 (KJS::Collector::markCurrentThreadConservatively):
5879 (KJS::Collector::markOtherThreadConservatively):
5880 * kjs/collector.h:
5881 * kjs/internal.cpp:
5882 (lockInterpreter):
5883 * kjs/value.h:
5884
5885=== Safari-172 ===
5886
58872004-11-15 Richard Williamson <rjw@apple.com>
5888
5889 Fixed <rdar://problem/3880561> Default string value of ObjC object in JS should be [obj description].
5890
5891 Reviewed by Hyatt.
5892
5893 * bindings/objc/objc_instance.mm:
5894 (ObjcInstance::stringValue):
5895 * bindings/objc/objc_utility.h:
5896 * bindings/objc/objc_utility.mm:
5897 (KJS::Bindings::convertNSStringToString):
5898 (KJS::Bindings::convertObjcValueToValue):
5899
5900=== Safari-171 ===
5901
59022004-11-09 Chris Blumenberg <cblu@apple.com>
5903
5904 Fixed: <rdar://problem/3872724> soft link against JavaVM to save ~2MB RSHRD
5905
5906 Reviewed by rjw.
5907
5908 * ChangeLog:
5909 * JavaScriptCore.pbproj/project.pbxproj: don't link against JavaVM
5910 * bindings/softlinking.c: Added.
5911 (loadFramework): new
5912 (getFunctionPointer): new
5913 (JNI_GetCreatedJavaVMs): load JavaVM if not already loaded, get _JNI_GetCreatedJavaVMs symbol if we don't already have it, call JNI_GetCreatedJavaVMs
5914
5915=== Safari-170 ===
5916
59172004-11-04 Darin Adler <darin@apple.com>
5918
5919 Reviewed by Ken.
5920
5921 - fixed <rdar://problem/3865365> since -[WebScriptObject dealloc] does not call [super dealloc], the build will fail due to a warning
5922 - fixed behavior so that [[WebScriptObject alloc] initWithCoder:] doesn't leak WebUndefined instances
5923 and incidentally so that [[WebScriptObject alloc] init] returns the single shared instance rather
5924 than allocating a new one
5925
5926 * bindings/objc/WebScriptObject.mm: Removed some stray semicolons.
5927 (+[WebUndefined allocWithZone:]): Made this the common bottleneck that returns the single instance
5928 of WebUndefined, since it's the single method that normally allocates new instances. Calls super to
5929 actually allocate only the very first time it's called.
5930 (-[WebUndefined initWithCoder:]): Simplified to just return self (no reason to re-lookup the single
5931 shared instance since there can be only one).
5932 (-[WebUndefined copyWithZone:]): Ditto.
5933 (-[WebUndefined retain]): Ditto.
5934 (-[WebUndefined retainCount]): Use UINT_MAX constant here (matches usage in NSObject.m for retain count
5935 of class).
5936 (-[WebUndefined autorelease]): Simplified to just return self (see above).
5937 (-[WebUndefined copy]): No need to override this since it just turns around and calls copyWithZone:.
5938 (-[WebUndefined dealloc]): Added an assertion since this method should never be called. Also added
5939 a call to [super dealloc] after return; to make the new -Wdealloc-check compiler happy (fixing the
5940 bug mentioned above).
5941 (+[WebUndefined undefined]): Reimplemented; calls allocWithZone:NULL to get to the shared instance.
5942 No need to call init, since that's a no-op for this class.
5943
59442004-11-03 David Harrison <harrison@apple.com>
5945
5946 Reviewed by Darin.
5947
5948 Eliminate the use of a marker file to determine how to build.
5949
5950 * .cvsignore:
5951 * Makefile.am:
5952
59532004-11-01 Richard Williamson <rjw@apple.com>
5954
5955 Fixed <rdar://problem/3861469> Latest Real player crashes Safari on some sites.
5956
5957 Reviewed by Ken.
5958
5959 * bindings/c/c_instance.cpp:
5960 (CInstance::invokeMethod):
5961 (CInstance::invokeDefaultMethod):
5962 Initialize out parameters to void type.
5963
5964 * bindings/c/c_runtime.cpp:
5965 (CField::valueFromInstance):
5966 (CField::setValueToInstance):
5967 Initialize out parameters to void type.
5968 Also added additional checks to protect against classes that
5969 don't implement all functions.
5970
59712004-11-01 Richard Williamson <rjw@apple.com>
5972
5973 Fixed <rdar://problem/3861257> WebUndefined should be returned for undefined values
5974
5975 Reviewed by John.
5976
5977 * ChangeLog:
5978 * bindings/objc/WebScriptObject.mm:
5979 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
5980 Added additional conversion Undefined -> WebUndefined.
5981 * bindings/objc/objc_utility.mm:
5982 (KJS::Bindings::convertObjcValueToValue):
5983 Added additional conversion WebUndefined -> Undefined.
5984
59852004-11-01 Darin Adler <darin@apple.com>
5986
5987 - fixed <rdar://problem/3855573> Remove reference to "WebScriptMethods" from WebScriptObject.h comments
5988
5989 * bindings/objc/WebScriptObject.h: Removed unneeded #ifdef protection for multiple includes (since
5990 this is an Objective-C header and we use #import for those). Fixed comments as requested in the bug
5991 report to match the contents of the file.
5992
5993=== Safari-169 ===
5994
5995=== Safari-168 ===
5996
59972004-10-22 Ken Kocienda <kocienda@apple.com>
5998
5999 Reviewed by me
6000
6001 * JavaScriptCore.pbproj/project.pbxproj:
6002 Add GCC_ENABLE_OBJC_GC and GCC_FAST_OBJC_DISPATCH flags.
6003
6004=== Safari-167 ===
6005
60062004-10-13 Richard Williamson <rjw@apple.com>
6007
6008 Moved boolean checks prior to NSNumber checks. booleans are
6009 NSNumbers.
6010
6011 Follow on to <rdar://problem/3821515> binding layer needs to convert NSNumber-bools to js type boolean not number.
6012
6013 Reviewed by John.
6014
6015 * bindings/objc/objc_utility.mm:
6016 (KJS::Bindings::convertObjcValueToValue):
6017
60182004-10-12 Richard Williamson <rjw@apple.com>
6019
6020 Fixed access to DOM object via WebScriptObject API.
6021 The execution context for DOM objects wasn't being found.
6022 <rdar://problem/3831372> The valueForKey method for @"offsetLeft" on a paragraph element causes a crash.
6023
6024 Reviewed by Chris.
6025
6026 * bindings/objc/WebScriptObject.mm:
6027 (_didExecute):
6028 (-[WebScriptObject KJS::Bindings::]):
6029 (-[WebScriptObject callWebScriptMethod:withArguments:]):
6030 (-[WebScriptObject evaluateWebScript:]):
6031 (-[WebScriptObject setValue:forKey:]):
6032 (-[WebScriptObject valueForKey:]):
6033 (-[WebScriptObject stringRepresentation]):
6034 * bindings/objc/WebScriptObjectPrivate.h:
6035
60362004-10-09 Darin Adler <darin@apple.com>
6037
6038 Reviewed by Kevin.
6039
6040 - fixed <rdar://problem/3804661> REGRESSION: JavaScriptCore framework now has two init routines
6041
6042 * bindings/NP_jsobject.cpp: Fixed unnecessarily-complex globals set up that was
6043 creating an init routine.
6044
6045 * kjs/ustring.cpp: Changed around the UString::Rep::empty construction to not
6046 require a global constructor that creates an init routine.
6047
60482004-10-09 Darin Adler <darin@apple.com>
6049
6050 Reviewed by Kevin.
6051
6052 - fixed <rdar://problem/3822618> REGRESSION (164-165): expedia.com's popup help doesn't work
6053
6054 * kjs/reference.cpp: (Reference::putValue): Change so that references not found in any object
6055 work with the window object of the page the function is in, not the page of the caller. This
6056 is what all other browsers do. This code was hidden before by the "everything is defined on
6057 window object" hack in WebCore.
6058
60592004-10-07 Richard Williamson <rjw@apple.com>
6060
6061 Added simple JavaScript call tracing. Very useful for
6062 debugging complex pages.
6063
6064 Tracing is only available in development builds and is
6065 enabled by:
6066
6067 (gdb) set traceJavaScript = 1
6068
6069 or programatically
6070
6071 setTraceJavaScript(true)
6072
6073 Function, args, and return values are printed to console. Very
6074 verbose.
6075
6076 Reviewed by Ken.
6077
6078 * kjs/function_object.cpp:
6079 (FunctionProtoFuncImp::call):
6080 * kjs/object.cpp:
6081 (KJS::Object::call):
6082
6083=== Safari-166 ===
6084
60852004-10-05 Richard Williamson <rjw@apple.com>
6086
6087 Fixed <rdar://problem/3819234> NPN_SetException (and throwException:) isn't implemented
6088
6089 Reviewed by Chris.
6090
6091 * bindings/NP_jsobject.cpp:
6092 (_NPN_SetException):
6093 * bindings/npruntime.cpp:
6094 (_NPN_SetExceptionWithUTF8):
6095 * bindings/objc/WebScriptObject.mm:
6096 (+[WebScriptObject throwException:]):
6097 * kjs/internal.h:
6098 (KJS::InterpreterImp::context):
6099
61002004-10-05 Richard Williamson <rjw@apple.com>
6101
6102 Fixed <rdar://problem/3821515> binding layer needs to convert NSNumber-bools to js type boolean not number
6103
6104 Reviewed by Ken.
6105
6106 * bindings/objc/objc_utility.mm:
6107 (KJS::Bindings::convertObjcValueToValue):
6108
61092004-10-04 Darin Adler <darin@apple.com>
6110
6111 Reviewed by Ken.
6112
6113 - rolled in a fix the KDE folks did for the operations that generate HTML fragments
6114
6115 * kjs/string_object.cpp: (StringProtoFuncImp::call): Added quote marks to generated HTML.
6116
6117 - rolled out an old workaround we don't need any more
6118
6119 * JavaScriptCore.pbproj/project.pbxproj: Remove -Wno-long-double because the <math.h> issue that
6120 required it is no longer there.
6121
61222004-09-30 Richard Williamson <rjw@apple.com>
6123
6124 Fixed <rdar://problem/3821215> NPN hasMethod and hasProperty functions should take NPObjects, not NPClass
6125
6126 Reviewed by Chris.
6127
6128 * bindings/NP_jsobject.cpp:
6129 (_NPN_GetProperty):
6130 (_NPN_HasProperty):
6131 (_NPN_HasMethod):
6132 * bindings/c/c_class.cpp:
6133 (CClass::methodsNamed):
6134 (CClass::fieldNamed):
6135 * bindings/c/c_class.h:
6136 * bindings/c/c_instance.cpp:
6137 (CInstance::invokeMethod):
6138 * bindings/jni/jni_class.cpp:
6139 (JavaClass::methodsNamed):
6140 * bindings/jni/jni_class.h:
6141 * bindings/npruntime.h:
6142 * bindings/objc/objc_class.h:
6143 * bindings/objc/objc_class.mm:
6144 (ObjcClass::methodsNamed):
6145 * bindings/runtime.h:
6146 * bindings/runtime_object.cpp:
6147 (RuntimeObjectImp::get):
6148 (RuntimeObjectImp::hasProperty):
6149
61502004-09-29 Chris Blumenberg <cblu@apple.com>
6151
6152 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.
6153
6154 Reviewed by rjw.
6155
6156 * JavaScriptCore.pbproj/project.pbxproj:
6157 * bindings/NP_jsobject.cpp:
6158 (_NPN_CreateScriptObject):
6159 (_NPN_InvokeDefault):
6160 (_NPN_Invoke):
6161 (_NPN_Evaluate):
6162 (_NPN_GetProperty):
6163 (_NPN_SetProperty):
6164 (_NPN_RemoveProperty):
6165 (_NPN_HasProperty):
6166 (_NPN_HasMethod):
6167 * bindings/c/c_class.cpp:
6168 (CClass::methodsNamed):
6169 (CClass::fieldNamed):
6170 * bindings/c/c_instance.cpp:
6171 (CInstance::CInstance):
6172 (CInstance::~CInstance):
6173 (CInstance::operator=):
6174 (CInstance::invokeMethod):
6175 (CInstance::invokeDefaultMethod):
6176 * bindings/c/c_runtime.cpp:
6177 * bindings/c/c_runtime.h:
6178 (KJS::Bindings::CField::name):
6179 (KJS::Bindings::CMethod::name):
6180 * bindings/npruntime.cpp:
6181 (_NPN_GetStringIdentifier):
6182 (_NPN_GetStringIdentifiers):
6183 (_NPN_GetIntIdentifier):
6184 (_NPN_IdentifierIsString):
6185 (_NPN_UTF8FromIdentifier):
6186 (_NPN_IntFromIdentifier):
6187 (NPN_InitializeVariantWithObject):
6188 (_NPN_ReleaseVariantValue):
6189 (_NPN_CreateObject):
6190 (_NPN_RetainObject):
6191 (_NPN_ReleaseObject):
6192 (_NPN_SetExceptionWithUTF8):
6193 (_NPN_SetException):
6194
61952004-09-26 Darin Adler <darin@apple.com>
6196
6197 * kjs/string_object.cpp: (StringProtoFuncImp::call): Remove strange use of high() and
6198 low() to get Unicode value of character, and just use unicode().
6199
62002004-09-26 Darin Adler <darin@apple.com>
6201
6202 - refine charAt/charCodeAt fix slightly
6203
6204 * kjs/string_object.cpp: (StringProtoFuncImp::call): Treat undefined the same was as an
6205 omitted parameter, as we do everywhere else, and as other browsers do here.
6206
62072004-09-26 Darin Adler <darin@apple.com>
6208
6209 Reviewed by Kevin.
6210
6211 - fixed <rdar://problem/3816097> REGRESSION: mailblocks, and presumably many other pages, failing because variable not found
6212
6213 * kjs/internal.cpp: (InterpreterImp::evaluate): Process variable declarations before executing
6214 the program. We were doing this properly for functions, but not entire programs.
6215
6216 - fixed <rdar://problem/3814706> REGRESSION: text fields in mailblocks wizards do not accept keystrokes due to use of charCodeAt()
6217
6218 * kjs/string_object.cpp: (StringProtoFuncImp::call): Changed the implementation of charAt
6219 and charCodeAt to treat a missing parameter as an index of 0, rather than an invalid index.
6220
6221 * tests/mozilla/expected.html: Update for two tests that now pass with these changes.
6222
6223=== Safari-165 ===
6224
6225=== Safari-164 ===
6226
62272004-09-14 Richard Williamson <rjw@apple.com>
6228
6229 1. Add class parameter to object allocation function. This is somewhat redundant, given that
6230 the allocation function is in the class function vector, but people wanted to use the same
6231 allocation function for different classes.
6232
6233 2. Renamed NPN_Class to NPN_Invoke to match the name in the function vector.
6234
6235 3. Add support for a default function on an object. This is a feature that ActiveX supports,
6236 and will allow JavaScript code to be written that will look exactly the same for both ActiveX
6237 plugins and Netscape or WebKit plugins. There are implementations included for the 'C' and
6238 'Objective-C' bindings.
6239
6240 There bugs are covered by
6241
6242 <rdar://problem/3776343> Support for default functions in the JavaScript bindings
6243 <rdar://problem/3779186> NPN_Call needs to be renamed to NPN_Invoke
6244 <rdar://problem/3674754> Need to implement latest npruntime.h
6245
6246 Reviewed by John.
6247
6248 * bindings/NP_jsobject.cpp:
6249 (jsAllocate):
6250 (NPN_InvokeDefault):
6251 (NPN_Invoke):
6252 * bindings/c/c_class.cpp:
6253 * bindings/c/c_instance.cpp:
6254 (CInstance::CInstance):
6255 (CInstance::operator=):
6256 (CInstance::invokeMethod):
6257 (CInstance::invokeDefaultMethod):
6258 * bindings/c/c_instance.h:
6259 * bindings/c/c_runtime.cpp:
6260 * bindings/c/c_runtime.h:
6261 * bindings/jni/jni_instance.cpp:
6262 (JavaInstance::invokeDefaultMethod):
6263 * bindings/jni/jni_instance.h:
6264 * bindings/npruntime.cpp:
6265 (NPN_CreateObject):
6266 * bindings/npruntime.h:
6267 * bindings/objc/WebScriptObject.h:
6268 * bindings/objc/objc_class.mm:
6269 (ObjcClass::fallbackObject):
6270 * bindings/objc/objc_instance.h:
6271 * bindings/objc/objc_instance.mm:
6272 (ObjcInstance::invokeDefaultMethod):
6273 * bindings/objc/objc_runtime.h:
6274 * bindings/objc/objc_runtime.mm:
6275 (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
6276 (ObjcFallbackObjectImp::get):
6277 (ObjcFallbackObjectImp::put):
6278 (ObjcFallbackObjectImp::canPut):
6279 (ObjcFallbackObjectImp::implementsCall):
6280 (ObjcFallbackObjectImp::call):
6281 (ObjcFallbackObjectImp::hasProperty):
6282 (ObjcFallbackObjectImp::deleteProperty):
6283 (ObjcFallbackObjectImp::defaultValue):
6284 * bindings/runtime.h:
6285 (KJS::Bindings::Class::fallbackObject):
6286 (KJS::Bindings::Instance::getValueOfUndefinedField):
6287 (KJS::Bindings::Instance::setValueOfUndefinedField):
6288 (KJS::Bindings::Instance::valueOf):
6289 * bindings/runtime_object.cpp:
6290 (RuntimeObjectImp::implementsCall):
6291 (RuntimeObjectImp::call):
6292 * bindings/runtime_object.h:
6293
62942004-09-13 Maciej Stachowiak <mjs@apple.com>
6295
6296 Reviewed by Darin.
6297
6298 <rdar://problem/3794735> Gmail- sending a very long message with Safari is so slow it seems like a hang
6299
6300 * kjs/string_object.cpp:
6301 (StringProtoFuncImp::call): Replaced implementation of replace()
6302 method with function below...
6303 (replace): In order to avoid excessive allocation and copying,
6304 figure out the ranges of the original string and replacement
6305 strings to be assembled, instead of constantly creating new
6306 strings at each substitution. The old behavior is basically O(N^2)
6307 for a global replace on a pattern that matches many places in the
6308 string.
6309 (regExpIsGlobal): Helper function for the above.
6310 (expandSourceRanges): ditto
6311 (pushSourceRange): ditto
6312 (expandReplacements): ditto
6313 (pushReplacement): ditto
6314 * kjs/ustring.cpp:
6315 (KJS::UString::spliceSubstringsWithSeparators): New method that
6316 pieces together substring ranges of this string together with
6317 specified separators, all at one go.
6318 * kjs/ustring.h:
6319 (KJS::UString::Range::Range): Added new helper class to represent
6320 substring choices.
6321
63222004-09-14 Maciej Stachowiak <mjs@apple.com>
6323
6324 Reviewed by Darin.
6325
6326 - fixed <rdar://problem/3800315> encode-URI-test layout test is failing
6327
6328 * kjs/function.cpp:
6329 (KJS::GlobalFuncImp::call): Make sure to escape null
6330 characters. This is a bug in the new code that made part of the
6331 test fail.
6332
63332004-09-13 Darin Adler <darin@apple.com>
6334
6335 Reviewed by Kevin and Maciej.
6336
6337 - new function to support fix for DIG bug in WebCore
6338
6339 * kjs/scope_chain.h: Added new push function that pushes another entire scope chain.
6340 * kjs/scope_chain.cpp: (KJS::ScopeChain::push): Ditto.
6341
63422004-09-12 Darin Adler <darin@apple.com>
6343
6344 * tests/mozilla/expected.html: Updated test results for 3 more tests that pass with the new version
6345 of escape and unescape.
6346
63472004-09-12 Darin Adler <darin@apple.com>
6348
6349 Reviewed by Maciej.
6350
6351 - fixed <rdar://problem/3798209> any non-ASCII characters are garbled in the result of toLocaleString
6352
6353 * kjs/date_object.cpp:
6354 (formatLocaleDate): Replaced two old functions that used LongDateTime with this one new function that
6355 uses CFDateFormatter.
6356 (DateProtoFuncImp::call): Call the new formatLocaleDate instead of both formatLocaleDate and formatLocaleTime.
6357
63582004-09-09 Maciej Stachowiak <mjs@apple.com>
6359
6360 Reviewed by Richard.
6361
6362 <rdar://problem/3493140> REGRESSION (85-100): cedille displays %-escaped in JavaScript message at hotmail.com
6363
6364 * kjs/function.cpp:
6365 (KJS::GlobalFuncImp::call): Replace our escape() and unescape() implementations with
6366 ones from KDE KJS, which have the proper latin-1 behavior to match Win IE.
6367 * kjs/lexer.cpp:
6368 (Lexer::isHexDigit): Made static and non-const.
6369 * kjs/lexer.h:
6370
6371=== Safari-163 ===
6372
63732004-09-06 Darin Adler <darin@apple.com>
6374
6375 * JavaScriptCore.pbproj/project.pbxproj: Bump MACOSX_DEPLOYMENT_TARGET to 10.3.
6376
6377=== Safari-162 ===
6378
63792004-09-01 Richard Williamson <rjw@apple.com>
6380
6381 Add pid to exception messages (to help debug dashboard clients).
6382
6383 Reviewed by Chris.
6384
6385 * kjs/interpreter.cpp:
6386 (Interpreter::evaluate):
6387
6388=== Safari-161 ===
6389
63902004-08-20 Richard Williamson <rjw@apple.com>
6391
6392 Implemented new JNI abstraction. We no longer invoke Java methods
6393 directly with JNI, rather we call into the plugin. This allows the
6394 plugin to dispatch the call to the appropriate VM thread. This
6395 change should (will?) fix a whole class of threading related problems with
6396 the Java VM.
6397
6398 Reviewed by Hyatt.
6399
6400 * JavaScriptCore.pbproj/project.pbxproj:
6401 * bindings/c/c_instance.h:
6402 (KJS::Bindings::CInstance::setExecutionContext):
6403 (KJS::Bindings::CInstance::executionContext):
6404 * bindings/jni/jni_instance.cpp:
6405 (JavaInstance::JavaInstance):
6406 (JavaInstance::invokeMethod):
6407 (JavaInstance::setExecutionContext):
6408 (JavaInstance::executionContext):
6409 * bindings/jni/jni_instance.h:
6410 * bindings/jni/jni_jsobject.cpp:
6411 (JSObject::convertJObjectToValue):
6412 * bindings/jni/jni_runtime.cpp:
6413 (JavaField::JavaField):
6414 (JavaArray::convertJObjectToArray):
6415 (JavaField::valueFromInstance):
6416 (JavaArray::JavaArray):
6417 (JavaArray::valueAt):
6418 * bindings/jni/jni_runtime.h:
6419 (KJS::Bindings::JavaArray::operator=):
6420 (KJS::Bindings::JavaArray::executionContext):
6421 * bindings/jni/jni_utility.h:
6422 * bindings/objc/objc_instance.h:
6423 (KJS::Bindings::ObjcInstance::setExecutionContext):
6424 (KJS::Bindings::ObjcInstance::executionContext):
6425 * bindings/runtime.cpp:
6426 (Instance::createBindingForLanguageInstance):
6427 * bindings/runtime.h:
6428 * bindings/runtime_root.h:
6429 (KJS::Bindings::RootObject::nativeHandle):
6430
6431=== Safari-158 ===
6432
64332004-08-19 Vicki Murley <vicki@apple.com>
6434
6435 Reviewed by John.
6436
6437 * kjs/property_map.cpp:
6438 (KJS::PropertyMap::put): initialize deletedElementIndex to zero, to make the compiler happy
6439
64402004-08-17 Darin Adler <darin@apple.com>
6441
6442 Reviewed by Adele.
6443
6444 - fixed <rdar://problem/3746676> SAP WebDynpro app hangs inside JavaScript property map hash table code (deleted sentinel problem)
6445
6446 * kjs/property_map.h: Added some private functions.
6447 * kjs/property_map.cpp:
6448 (KJS::PropertyMap::clear): Set sentinelCount to 0.
6449 (KJS::PropertyMap::put): Complete search for the element before choosing to use the deleted-element sentinel.
6450 Also keep sentinel count up to date when we destroy a sentinel by overwriting with a new added element.
6451 (KJS::PropertyMap::expand): Added. Calls rehash with a size 2x the old size, or 16.
6452 (KJS::PropertyMap::rehash): Added. Refactored the rehash code into a separate function.
6453 (KJS::PropertyMap::remove): Add one to sentinelCount, and rehash if 1/4 or more of the elements are
6454 deleted-element sentinels.
6455 (KJS::PropertyMap::checkConsistency): Check the sentinelCount.
6456
64572004-08-16 Maciej Stachowiak <mjs@apple.com>
6458
6459 Code change by Eric Albert, reviewd by me.
6460
6461 <rdar://problem/3571960> washingtonpost.com claims I don't have cookies enabled and won't let me read articles
6462
6463 * kjs/date_object.cpp:
6464 (timetUsingCF): Clamp time to LONG_MAX (getting rid of time_t
6465 entirely would be even better, but is not required to fix this bug.
6466
6467=== Safari-157 ===
6468
64692004-08-16 Richard Williamson <rjw@apple.com>
6470
6471 Fixed <rdar://problem/3581092> cash in KJS::Bindings::JSObject::eval at tcvetantcvetkov.com
6472
6473 Adds bullet proofing to protect against evaluation of bogus JS in all the flavors of bindings (Java, C, and ObjC).
6474
6475 Reviewed by Chris.
6476
6477 * bindings/NP_jsobject.cpp:
6478 (NPN_Evaluate):
6479 * bindings/jni/jni_jsobject.cpp:
6480 (JSObject::eval):
6481 * bindings/objc/WebScriptObject.mm:
6482 (-[WebScriptObject evaluateWebScript:]):
6483
64842004-08-15 Richard Williamson <rjw@apple.com>
6485
6486 More updates to np headers. Implemented new NPN functions.
6487
6488 Reviewed by Darin.
6489
6490 * bindings/NP_jsobject.cpp:
6491 (NPN_HasProperty):
6492 (NPN_HasMethod):
6493 * bindings/npapi.h:
6494 * bindings/npruntime.h:
6495
64962004-08-13 Darin Adler <darin@apple.com>
6497
6498 - fix build so we can compile again
6499
6500 * bindings/npapi.h: Added. Richard forgot to check this in. The one I'm checking in here
6501 is good enough so that we can compile, but it's only a stopgap measure, because I think
6502 Richard has a newer one he wants to check in.
6503
65042004-08-12 Richard Williamson <rjw@apple.com>
6505
6506 Bring npruntime.h and friends closer to compliance with
6507 latest spec.
6508
6509 Reviewed by Maciej.
6510
6511 * JavaScriptCore.pbproj/project.pbxproj:
6512 * bindings/NP_jsobject.cpp:
6513 (jsAllocate):
6514 (_NPN_CreateScriptObject):
6515 (NPN_Call):
6516 (NPN_Evaluate):
6517 (NPN_GetProperty):
6518 (NPN_SetProperty):
6519 (NPN_RemoveProperty):
6520 * bindings/NP_jsobject.h:
6521 * bindings/c/c_instance.cpp:
6522 (CInstance::invokeMethod):
6523 * bindings/c/c_utility.cpp:
6524 (convertNPVariantToValue):
6525 * bindings/npruntime.cpp:
6526 (NPN_IdentifierIsString):
6527 (NPN_VariantIsVoid):
6528 (NPN_VariantIsNull):
6529 (NPN_VariantIsUndefined):
6530 (NPN_VariantIsBool):
6531 (NPN_VariantIsInt32):
6532 (NPN_VariantIsDouble):
6533 (NPN_VariantIsString):
6534 (NPN_VariantIsObject):
6535 (NPN_VariantToBool):
6536 (NPN_VariantToString):
6537 (NPN_VariantToInt32):
6538 (NPN_VariantToDouble):
6539 (NPN_VariantToObject):
6540 (NPN_InitializeVariantAsVoid):
6541 (NPN_InitializeVariantAsNull):
6542 (NPN_InitializeVariantAsUndefined):
6543 (NPN_InitializeVariantWithBool):
6544 (NPN_InitializeVariantWithInt32):
6545 (NPN_InitializeVariantWithDouble):
6546 (NPN_InitializeVariantWithString):
6547 (NPN_InitializeVariantWithStringCopy):
6548 (NPN_InitializeVariantWithObject):
6549 (NPN_InitializeVariantWithVariant):
6550 (NPN_ReleaseVariantValue):
6551 (NPN_CreateObject):
6552 * bindings/npruntime.h:
6553 (_NPString::):
6554 (_NPString::_NPVariant::):
6555 * bindings/npruntime_priv.h: Added.
6556
65572004-08-12 Darin Adler <darin@apple.com>
6558
6559 Reviewed by Adele.
6560
6561 - fixed 3 problems with parse functions that I just wrote, fixing 3 more Mozilla JavaScript tests
6562
6563 * kjs/function.cpp:
6564 (KJS::parseDigit): Fix typo, 'Z' instead of 'z', that prevented lowercase hex digits from working.
6565 (KJS::parseInt): Add octal support. Specification says it's optional, but I guess not.
6566 (KJS::parseFloat): Fix check for "0x" in parseFloat to return 0 rather than NaN. Also add code
6567 to skip leading "+" or "-".
6568
6569=== Safari-156 ===
6570
65712004-08-12 Darin Adler <darin@apple.com>
6572
6573 Reviewed by Ken.
6574
6575 - fixed 43 Mozilla JavaScript tests
6576
6577 * kjs/date_object.h: Change parseDate and timeClip to take and return doubles.
6578 * kjs/date_object.cpp:
6579 (DateObjectImp::construct): Change to use a timeClip function that takes and returns a double rather
6580 than constructing a number object to pass to it.
6581 (DateObjectFuncImp::call): Change to use a parseDate function that returns a double.
6582 (KJS::parseDate): Change to return a double instead of creating the Number object here.
6583 (KJS::timeClip): Implement this as specified in the language standard.
6584
6585 * kjs/error_object.cpp: (NativeErrorImp::NativeErrorImp): Set the DontDelete, ReadOnly, and DontEnum
6586 flags on the prototype property.
6587
6588 * kjs/function.cpp:
6589 (KJS::FunctionImp::get): Return null rather than undefined for arguments when the function is not
6590 currently in scope.
6591 (KJS::isStrWhiteSpace): Added. Matches specification for StrWhiteSpace. Could move it to some utility
6592 file later.
6593 (KJS::parseDigit): Added. Helper function for parseInt.
6594 (KJS::parseInt): Added. Integer parser that puts result in a double so we're not limited to what
6595 strtoll can handle. Also matches standard more closely.
6596 (KJS::parseFloat): Added. Handles "0x" properly and passes flag to make empty string turn into NaN
6597 instead of 0.
6598 (KJS::GlobalFuncImp::call): Use the new parseInt and parseFloat.
6599
6600 * kjs/function_object.cpp: (FunctionPrototypeImp::FunctionPrototypeImp): Add a length property.
6601
6602 * kjs/lexer.h: Added error flag and sawError() function for detecting errors.
6603 * kjs/lexer.cpp:
6604 (Lexer::setCode): Clear error state.
6605 (Lexer::lex): Set error state if the lexer encounters an error
6606
6607 * kjs/internal.cpp:
6608 (NumberImp::toString): Roll in change from KDE version to special case 0 so we handle -0 correctly.
6609 (Parser::parse): Use new lexer error method so those errors are treated like parser errors.
6610
6611 * kjs/math_object.cpp: (MathFuncImp::call): Change min and max to treat -0 as less than +0.
6612 Change round to round values between -0.5 and -0 to -0 instead of +0.
6613
6614 * kjs/nodes.h: Add evaluateReference function to GroupNode.
6615 * kjs/nodes.cpp: (GroupNode::evaluateReference): Pass references through groups (parenthesized
6616 expressions) properly so that expressions like "delete (x.y)" work. Before, the parentheses
6617 would change x.y into a value that can't be deleted as a side effect.
6618
6619 * kjs/string_object.cpp: Change parameter count for indexOf and lastIndexOf from 2 to 1 to match
6620 the specification.
6621
6622 * kjs/testkjs.cpp: Rolled in changes from KDE to add a "quit" function to the test tool and
6623 get rid of the fixed size limit for code.
6624
6625 * kjs/ustring.cpp: (KJS::UString::substr): Added optimized case for substr(0, length) so it just
6626 returns the string without creating a new Rep, since I'm using substr in a place where it will
6627 often be passed a 0.
6628
6629 * tests/mozilla/ecma/String/15.5.4.11-1.js: Fixed one wrong entry in the Unicode table I added to
6630 the other day that was making a couple tests fail.
6631 * tests/mozilla/ecma/String/15.5.4.12-1.js: Ditto.
6632 * tests/mozilla/ecma/String/15.5.4.12-2.js: Ditto.
6633 * tests/mozilla/ecma/String/15.5.4.12-3.js: Ditto.
6634 * tests/mozilla/ecma/String/15.5.4.12-4.js: Ditto.
6635 * tests/mozilla/ecma/String/15.5.4.12-5.js: Ditto.
6636
6637 * kjs/string_object.lut.h: Regenerated.
6638
66392004-08-11 Darin Adler <darin@apple.com>
6640
6641 - fixed a tiny problem with the UTF-16 PCRE check-in
6642
6643 * pcre/maketables.c: (pcre_maketables): Fix mistake in table-generating code that sometimes caused
6644 the ctype_meta flag to get set in items that should not have it.
6645
6646 * pcre/chartables.c: Regenerated.
6647
66482004-08-10 Richard Williamson <rjw@apple.com>
6649
6650 Fixed <rdar://problem/3674747> Need to implement invokeUndefinedMethodFromWebScript:withArguments:
6651
6652 The following WebScripting methods are now supported on bound
6653 objects:
6654
6655 - (id)invokeUndefinedMethodFromWebScript:(NSString *)name withArguments:(NSArray *)args;
6656 - (void)setValue:(id)value forUndefinedKey:(NSString *)key
6657 - (id)valueForUndefinedKey:(NSString *)key
6658
6659 Reviewed by Chris.
6660
6661 * bindings/c/c_class.cpp:
6662 (CClass::fieldNamed):
6663 * bindings/c/c_class.h:
6664 * bindings/jni/jni_class.cpp:
6665 (JavaClass::fieldNamed):
6666 * bindings/jni/jni_class.h:
6667 * bindings/objc/objc_class.h:
6668 (KJS::Bindings::ObjcClass::isa):
6669 * bindings/objc/objc_class.mm:
6670 (ObjcClass::methodsNamed):
6671 (ObjcClass::fieldNamed):
6672 (ObjcClass::fallbackObject):
6673 * bindings/objc/objc_instance.h:
6674 * bindings/objc/objc_instance.mm:
6675 (ObjcInstance::invokeMethod):
6676 (ObjcInstance::setValueOfField):
6677 (ObjcInstance::setValueOfUndefinedField):
6678 (ObjcInstance::getValueOfField):
6679 (ObjcInstance::getValueOfUndefinedField):
6680 * bindings/objc/objc_runtime.h:
6681 (KJS::Bindings::ObjcField::~ObjcField):
6682 (KJS::Bindings::ObjcField::ObjcField):
6683 (KJS::Bindings::ObjcField::operator=):
6684 (KJS::Bindings::FallbackObjectImp::classInfo):
6685 * bindings/objc/objc_runtime.mm:
6686 (ObjcField::ObjcField):
6687 (ObjcField::name):
6688 (ObjcField::type):
6689 (ObjcField::valueFromInstance):
6690 (ObjcField::setValueToInstance):
6691 (FallbackObjectImp::FallbackObjectImp):
6692 (FallbackObjectImp::get):
6693 (FallbackObjectImp::put):
6694 (FallbackObjectImp::canPut):
6695 (FallbackObjectImp::implementsCall):
6696 (FallbackObjectImp::call):
6697 (FallbackObjectImp::hasProperty):
6698 (FallbackObjectImp::deleteProperty):
6699 (FallbackObjectImp::defaultValue):
6700 * bindings/runtime.h:
6701 (KJS::Bindings::Class::fallbackObject):
6702 (KJS::Bindings::Instance::getValueOfUndefinedField):
6703 (KJS::Bindings::Instance::setValueOfUndefinedField):
6704 * bindings/runtime_object.cpp:
6705 (RuntimeObjectImp::get):
6706 (RuntimeObjectImp::put):
6707 (RuntimeObjectImp::canPut):
6708 (RuntimeObjectImp::hasProperty):
6709 * bindings/testbindings.mm:
6710 (-[MyFirstInterface valueForUndefinedKey:]):
6711 (-[MyFirstInterface setValue:forUndefinedKey:]):
6712
67132004-08-10 Darin Adler <darin@apple.com>
6714
6715 Reviewed by Dave.
6716
6717 - switch PCRE to do UTF-16 directly instead of converting to/from UTF-8 for speed
6718
6719 * pcre/pcre.h: Added PCRE_UTF16 switch, set to 1. Added pcre_char typedef, which is char
6720 or uint16_t depending on the mode, and used appropriate in the 7 public functions
6721 that need to use it.
6722 * pcre/pcre.c: Add UTF-16 support to all functions.
6723 * pcre/study.c: Ditto.
6724
6725 * pcre/internal.h: Added ichar typedef, which is unsigned char or uint16_t depending on
6726 the mode. Changed declarations to use symbolic constants and typedefs so we size
6727 things to ichar when needed.
6728
6729 * pcre/maketables.c: (pcre_maketables): Change code to make tables that are
6730 sized to 16-bit characters instead of 8-bit.
6731
6732 * pcre/get.c:
6733 (pcre_copy_substring): Use pcre_char instead of char.
6734 (pcre_get_substring_list): Ditto.
6735 (pcre_free_substring_list): Ditto.
6736 (pcre_get_substring): Ditto.
6737 (pcre_free_substring): Ditto.
6738
6739 * pcre/dftables.c: (main): Used a bit more const, and use ICHAR sizes instead
6740 of hard-coding 8-bit table sizes.
6741
6742 * pcre/chartables.c: Regenerated.
6743
6744 * kjs/ustring.h: Remove functions that convert UTF-16 to/from UTF-8 offsets.
6745 * kjs/ustring.cpp: Change the shared empty string to have a unicode pointer that
6746 is not null. The null string still has a null pointer. This prevents us from
6747 passing a null through to the regular expression engine (which results in a null
6748 error even when the string length is 0).
6749
6750 * kjs/regexp.cpp:
6751 (KJS::RegExp::RegExp): Null-terminate the pattern and pass it.
6752 (KJS::RegExp::match): Use the 16-bit string directly, no need to convert to UTF-8.
6753
67542004-08-09 Darin Adler <darin@apple.com>
6755
6756 Reviewed by Maciej.
6757
6758 - fixed 28 Mozilla JavaScript tests
6759
6760 * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Check for undefined rather than
6761 checking the number of arguments for the join method.
6762
6763 * kjs/lexer.cpp: (Lexer::lex): Parse hexadecimal and octal constants in doubles rather
6764 than integers, so we aren't limited to 32 bits.
6765
6766 * kjs/math_object.cpp: (MathFuncImp::call): Get rid of many unneeded special cases in
6767 the implementation of the pow operation. Also simplied a case that was handling positive
6768 and negative infinity separately.
6769
6770 * kjs/nodes.cpp: (ShiftNode::evaluate): Keep the result of shifts in a double instead of
6771 putting them in a long, so that unsigned shift will work properly.
6772
6773 * kjs/number_object.cpp: Add the DontDelete and ReadOnly flags to the numeric constants.
6774
6775 * kjs/operations.cpp:
6776 (KJS::isPosInf): Added an implementation inside APPLE_CHANGES that does not depend on the
6777 sign of isinf; our isinf function returns +1 even for negative infinity.
6778 (KJS::isNegInf): And again.
6779 (KJS::relation): Put in a nice simple implementation of comparison inside APPLE_CHANGES.
6780 Our floating point already handles the various infinity cases correctly.
6781
6782 * kjs/regexp_object.cpp:
6783 (RegExpProtoFuncImp::call): Add missing return before Null() in Exec method.
6784 (RegExpObjectImp::arrayOfMatches): Put undefined rather than an empty string into the
6785 array in cases where we did not match.
6786 (RegExpObjectImp::construct): Set the DontDelete, ReadOnly, and DontEnum flags for
6787 "global", "ignoreCase", "multiline", and "source".
6788
6789 * kjs/string_object.cpp: (StringProtoFuncImp::call): For the match method, turn a null
6790 string into undefined rather than an empty string. For the slice method, handle an
6791 undefined parameter for the limit properly as decribed in the specification, and add
6792 the limit to one case that didn't have the limit at all. For the methods that generate
6793 HTML strings, use lowercase tags instead of uppercase.
6794
6795 * kjs/ustring.cpp:
6796 (KJS::UChar::toLower): Use u_tolower from the ICU library.
6797 (KJS::UChar::toUpper): Use u_toupper from the ICU library.
6798 (KJS::UString::append): Fix some math that caused a buffer overflow.
6799 (KJS::convertUTF16OffsetsToUTF8Offsets): Ignore negative numbers (-1 is used as a special
6800 flag) rather than converting them all to 0.
6801 (KJS::convertUTF8OffsetsToUTF16Offsets): Ditto.
6802
6803 * tests/mozilla/jsDriver.pl: Fixed the relative links to point to our actual test files.
6804
6805 * tests/mozilla/ecma/String/15.5.4.11-1.js: Fixed the Unicode table in this test to match
6806 the Unicode specification in a few cases where it was wrong before.
6807 * tests/mozilla/ecma/String/15.5.4.11-2.js: Ditto.
6808 * tests/mozilla/ecma/String/15.5.4.11-3.js: Ditto.
6809 * tests/mozilla/ecma/String/15.5.4.11-5.js: Ditto.
6810 * tests/mozilla/ecma/String/15.5.4.11-6.js: Ditto.
6811 * tests/mozilla/ecma/String/15.5.4.12-1.js: Ditto.
6812 * tests/mozilla/ecma/String/15.5.4.12-2.js: Ditto.
6813 * tests/mozilla/ecma/String/15.5.4.12-3.js: Ditto.
6814 * tests/mozilla/ecma/String/15.5.4.12-4.js: Ditto.
6815 * tests/mozilla/ecma/String/15.5.4.12-5.js: Ditto.
6816
6817 * JavaScriptCore.pbproj/project.pbxproj: Link to libicu.
6818
6819 * kjs/number_object.lut.h: Regenerated.
6820
68212004-08-09 Darin Adler <darin@apple.com>
6822
6823 Reviewed by Maciej.
6824
6825 - fixed <rdar://problem/3753467> REGRESSION (137-138): reproducible buffer overrun in UString manipulation code
6826
6827 * kjs/ustring.cpp: (KJS::UString::append): Fix incorrect size computation. Without it
6828 we get a buffer overflow.
6829
6830=== Safari-155 ===
6831
68322004-08-05 Richard Williamson <rjw@apple.com>
6833
6834 Fixed part of 3674747. The QT guys need this for feature freeze.
6835
6836 This patch implements support for the
6837
6838 - (id)invokeUndefinedMethodFromWebScript:(NSString *)name withArguments:(NSArray *)args
6839
6840 method of objects bound to JavaScript.
6841
6842 Reviewed by John.
6843
6844 * ChangeLog:
6845 * bindings/objc/objc_class.mm:
6846 (ObjcClass::methodsNamed):
6847 (ObjcClass::fieldNamed):
6848 * bindings/objc/objc_instance.mm:
6849 (ObjcInstance::invokeMethod):
6850 * bindings/objc/objc_runtime.h:
6851 (KJS::Bindings::ObjcMethod::~ObjcMethod):
6852 (KJS::Bindings::ObjcMethod::isFallbackMethod):
6853 (KJS::Bindings::ObjcMethod::javaScriptName):
6854 * bindings/objc/objc_runtime.mm:
6855 (ObjcMethod::ObjcMethod):
6856 (ObjcMethod::getMethodSignature):
6857 (ObjcMethod::setJavaScriptName):
6858 * bindings/testbindings.mm:
6859
68602004-08-04 Vicki Murley <vicki@apple.com>
6861
6862 Reviewed by mjs.
6863
6864 - fix <rdar://problem/3649789> SAP WebGUI has problems loading first page because of parse error
6865
6866 * kjs/lexer.cpp:
6867 (Lexer::lex): if the current character is a '\' and the next character is a line terminator,
6868 go to the next line and continue parsing the string (instead of failing). This matches
6869 behavior in Mac IE and Mozilla.
6870
68712004-08-03 Kevin Decker <kdecker@apple.com>
6872
6873 Reviewed by Darin.
6874
6875 Rolled in changes from the latest KJS sources that support additional
6876 Number.prototype functions.
6877
6878 Specifically this patch covers the follow parts of the ECMA 3 spec:
6879 15.7.4.5, 15.7.4.6, and 15.7.4.7
6880
6881 Fixes:
6882 <rdar://problem/3663716> missing Number.toFixed (and toPrecision, toExponential)
6883 <rdar://problem/3749492> missing Number.toPrecision prototype implementation
6884 <rdar://problem/3749591> missing Number.toExponential prototype implementation
6885
6886 * kjs/identifier.h: Added toFixed, toPrecision, and toExponential to the
6887 list of supported identifiers (a macro).
6888 * kjs/number_object.cpp: Implemented support for toFixed(), toPrecision(),
6889 and toExponential().
6890 (NumberPrototypeImp::NumberPrototypeImp):
6891 (NumberProtoFuncImp::call):
6892 * kjs/number_object.h: Added property names for toFixed, toPrecision,
6893 and toExponential.
6894 (KJS::NumberProtoFuncImp::):
6895 * tests/mozilla/expected.html: Update results.
6896
68972004-08-03 Darin Adler <darin@apple.com>
6898
6899 Reviewed by Ken.
6900
6901 - added support for copying RegExp objects so 7 more Mozilla regexp tests pass
6902
6903 * kjs/regexp_object.cpp: (RegExpObjectImp::construct): Check for case where
6904 we are supposed to just copy the regular expression object, and do so.
6905 Also tighten up arguments check to handle case where an actual "undefined"
6906 is passed rather than just omitting an argument.
6907
6908 * tests/mozilla/expected.html: Update results.
6909
69102004-08-02 Darin Adler <darin@apple.com>
6911
6912 * tests/mozilla/.cvsignore: Added.
6913 * tests/mozilla/expected.html: Update results.
6914
69152004-08-02 Darin Adler <darin@apple.com>
6916
6917 Reviewed by Ken.
6918
6919 - fixed RegExp.toString so 3 more Mozilla regexp tests pass
6920
6921 * kjs/regexp_object.cpp: (RegExpProtoFuncImp::call):
6922 Append the flags here so more tests paseed.
6923
69242004-08-02 Darin Adler <darin@apple.com>
6925
6926 Reviewed by Ken.
6927
6928 - fixed a couple things making 5 Mozilla regexp tests pass
6929
6930 * kjs/regexp_object.cpp: (RegExpProtoFuncImp::call): Implement toString
6931 for the prototype.
6932 (RegExpObjectImp::construct): Fix bug where the string "undefined" would
6933 be used as the flags string when no parameter was passed.
6934
6935 * kjs/regexp_object.h: (KJS::RegExpPrototypeImp::classInfo):
6936 Added a class info object for RegExp prototype so it can return
6937 a string instead of raising an exception when converting to a string.
6938
6939 * tests/mozilla/expected.html: Update results.
6940
69412004-08-02 Darin Adler <darin@apple.com>
6942
6943 Reviewed by Kevin.
6944
6945 - fix crashes in mozilla tests due to mishandling NaN
6946
6947 * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Rerranged range checks after
6948 calls to toInteger so that NaN will get turned into something that fits in an integer.
6949 These were the ones John already fixed, but his fix used isnan and the new fix is
6950 more efficient.
6951
6952 * kjs/number_object.cpp: (NumberProtoFuncImp::call): Rearranged radix range checks
6953 after a call to toInteger to handle NaN properly. Also removed separate check
6954 for undefined that's not needed.
6955
6956 * kjs/string_object.cpp: (StringProtoFuncImp::call): More of the same kinds of changes
6957 as in the above two files, but for a lot more functions. Also changed one place with
6958 an explicit check for undefined to instead just check isNaN.
6959
6960 * tests/mozilla/run-mozilla-tests: Changed to invoke jst using $SYMROOTS for people
6961 like me who don't keep $SYMROOTS in their $PATH.
6962
6963=== Safari-154 ===
6964
6965=== Safari-153 ===
6966
69672004-07-26 Kevin Decker <kdecker@apple.com>
6968
6969 Changes done by Darin, reviewed by Kevin.
6970
6971 - changed testkjs to build in Xcode rather than from Makefile
6972
6973 * .cvsignore: Removed obsolete files from this list.
6974 * Makefile.am: Removed code to build testkjs; we do this in Xcode now.
6975 Changed to build target "All" rather than default target. This makes us
6976 build the testkjs test tool.
6977 * dummy.cpp: Removed.
6978 * kjs/.cvsignore: Removed obsolete files from this list, including
6979 the testkjs tool, which is now built in the symroots directory.
6980 * kjs/testkjs.cpp: Added copyright notice that was missing, since we have
6981 changed this file. Also this has the nice side effect of causing the tool
6982 to be rebuilt in the new location even if there are no other changes in
6983 your tree when you check this out.
6984 * tests/mozilla/run-mozilla-tests: Invoke perl explicitly so this works
6985 without setting the execute bit on jsDriver.pl.
6986
69872004-07-22 Kevin Decker <kdecker@apple.com>
6988
6989 Reviewed by Darin
6990
6991 Fixed <rdar://problem/3682340> (error console does not include source urls or line numbers of event exceptions).
6992
6993 * kjs/function_object.cpp:
6994 (FunctionObjectImp::construct):
6995 * kjs/function_object.h:
6996 * kjs/object.cpp:
6997 (KJS::ObjectImp::construct):
6998 * kjs/object.h:
6999 (KJS::Object::construct):
7000
70012004-07-21 Darin Adler <darin@apple.com>
7002
7003 * bindings/npruntime.h: Fixed typo.
7004
70052004-07-19 John Sullivan <sullivan@apple.com>
7006
7007 Reviewed by Maciej.
7008
7009 - bulletproofed array.slice() against NAN arguments. Harri noticed this
7010 vulnerability in my patch for 3714644
7011
7012 * kjs/array_object.cpp:
7013 (ArrayProtoFuncImp::call):
7014 handle NAN parameters passed to slice() by clamping to 0 and length.
7015
70162004-07-19 Richard Williamson <rjw@apple.com>
7017
7018 Fixed 3733349. Prevent Java applet callbacks into JavaScript after applet
7019 has been destroyed.
7020
7021 Reviewed by John.
7022
7023 * bindings/jni/jni_jsobject.cpp:
7024 (JSObject::invoke):
7025 (JSObject::JSObject):
7026
70272004-07-16 John Sullivan <sullivan@apple.com>
7028
7029 Reviewed by Maciej.
7030
7031 - fixed <rdar://problem/3714644> REGRESSION (125.8-146): bugzilla submit link
7032 hangs browser with javascript
7033
7034 * kjs/array_object.cpp:
7035 (ArrayProtoFuncImp::call):
7036 Check for undefined type for args[0] the same way we were already checking
7037 for args[1]. In this case, args was zero-length, but we were treating
7038 args[0] like an integer anyway. Resulted in some code looping from a NAN
7039 value to 4, taking approximately forever.
7040
7041 * JavaScriptCore.pbproj/project.pbxproj:
7042 version wars
7043
7044=== Safari-152 ===
7045
70462004-07-14 Maciej Stachowiak <mjs@apple.com>
7047
7048 Reviewed by John.
7049
7050 <rdar://problem/3711474>: (REGRESSION (125-146): JavaScript 'toString(16)' is broken)
7051 <rdar://problem/3644873>: (REGRESSION (125-140u): secondary list doesn't fill in at Southwest.com)
7052
7053 * kjs/number_object.cpp:
7054 (NumberProtoFuncImp::call): Initialize radix from dradix, not from itself!
7055
70562004-07-13 Kevin Decker <kdecker@apple.com>
7057
7058 Reviewed by kocienda.
7059
7060 - made testkjs and JavaScriptCore a subtarget of 'All'
7061 - testkjs now builds in $SYMROOTS
7062
7063 * JavaScriptCore.pbproj/project.pbxproj:
7064
7065=== Safari-151 ===
7066
70672004-06-24 Chris Blumenberg <cblu@apple.com>
7068
7069 Ignore .mode1 files in JavaScriptCore.pbproj
7070
7071 Reviewed by kocienda.
7072
7073 * JavaScriptCore.pbproj/.cvsignore:
7074
70752004-06-23 Richard Williamson <rjw@apple.com>
7076
7077 Implemented changes for latest npruntime.h.
7078
7079 Reviewed by Chris.
7080
7081 * JavaScriptCore.pbproj/project.pbxproj:
7082 * bindings/NP_jsobject.cpp:
7083 (listFromVariantArgs):
7084 (identiferFromNPIdentifier):
7085 (_NPN_CreateScriptObject):
7086 (NPN_Call):
7087 (NPN_Evaluate):
7088 (NPN_GetProperty):
7089 (NPN_SetProperty):
7090 (NPN_RemoveProperty):
7091 * bindings/NP_jsobject.h:
7092 * bindings/c/c_class.cpp:
7093 (CClass::methodsNamed):
7094 (CClass::fieldNamed):
7095 * bindings/c/c_instance.cpp:
7096 (CInstance::invokeMethod):
7097 * bindings/c/c_utility.cpp:
7098 (convertNPVariantToValue):
7099 * bindings/c/c_utility.h:
7100 * bindings/npruntime.cpp:
7101 (stringIdentifierEqual):
7102 (stringIdentifierHash):
7103 (getStringIdentifierDictionary):
7104 (intIdentifierEqual):
7105 (intIdentifierHash):
7106 (getIntIdentifierDictionary):
7107 (NPN_GetStringIdentifier):
7108 (NPN_GetStringIdentifiers):
7109 (NPN_GetIntIdentifier):
7110 (NPN_IdentifierIsString):
7111 (NPN_UTF8FromIdentifier):
7112 (NPN_VariantToInt32):
7113 (NPN_VariantToDouble):
7114 (NPN_SetException):
7115 * bindings/npruntime.h:
7116 * bindings/objc/WebScriptObject.mm:
7117 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
7118 * bindings/runtime_object.cpp:
7119 (RuntimeObjectImp::~RuntimeObjectImp):
7120 * bindings/runtime_root.cpp:
7121 (KJS::Bindings::rootForInterpreter):
7122 * bindings/testbindings.cpp:
7123 (initializeIdentifiers):
7124 (logMessage):
7125 (setDoubleValue):
7126 (setIntValue):
7127 (setBooleanValue):
7128
7129=== JavaScriptCore-146.1 ===
7130
71312004-06-16 Richard Williamson <rjw@apple.com>
7132
7133 Fixed <rdar://problem/3702287> Crash returning nil from bound ObjC
7134
7135 This turned out to be a show stopper for Dashboard. Accessing a nil
7136 ObjC property from JS caused a crash. Similar to the problem
7137 3696112 fixed below.
7138
7139 Reviewed by Trey.
7140
7141 * bindings/objc/objc_runtime.mm:
7142 (KJS::Bindings::ObjcField::valueFromInstance):
7143
7144=== Safari-146 ===
7145
71462004-06-16 Richard Williamson <rjw@apple.com>
7147
7148 Fixed <rdar://problem/3696112>: nil from an Objective-C class seems to get wrapped as a JavaScript proxy that will not print.
7149
7150 This turned out to be a show stopper for Dashboard. We now
7151 return Undefined() when nil is returned from a ObjC method
7152 that returns an object type.
7153
7154 Reviewed by Maciej.
7155
7156 * bindings/objc/objc_utility.mm:
7157 (KJS::Bindings::convertObjcValueToValue):
7158
7159=== Safari-145 ===
7160
71612004-06-15 Richard Williamson <rjw@apple.com>
7162
7163 Fixed <rdar://problem/3695875>: Objective-C instances that are exported to JavaScript are too promiscuous
7164
7165 No longer need to check respondsToSelector: for
7166 isSelectorExcludedFromWebScript: and isKeyExcludedFromWebScript:
7167 because these now have a default implementation on NSObject.
7168
7169 Reviewed by Trey.
7170
7171 * bindings/objc/objc_class.mm:
7172 (ObjcClass::methodsNamed):
7173 (ObjcClass::fieldNamed):
7174
71752004-06-14 Darin Adler <darin@apple.com>
7176
7177 Reviewed by Maciej.
7178
7179 - fixed some things for GC that Patrick missed, or that happened after the branch
7180
7181 * bindings/objc/WebScriptObject.mm:
7182 (-[WebScriptObject dealloc]): Moved removeNativeReference call here from private object.
7183 (-[WebScriptObject finalize]): Added.
7184
7185 - added some missing nil checks
7186
7187 * bindings/objc/objc_instance.mm:
7188 (ObjcInstance::ObjcInstance): Check for nil.
7189 (ObjcInstance::~ObjcInstance): Check for nil.
7190 (ObjcInstance::operator=): Check for nil.
7191
71922004-06-14 Darin Adler <darin@apple.com>
7193
7194 Reviewed by me, code changes by Patrick Beard.
7195
7196 - fixed <rdar://problem/3671507>: (WebKit should adopt GC changes and compile with GC enabled)
7197
7198 * bindings/objc/objc_instance.mm:
7199 (ObjcInstance::ObjcInstance): Use CFRetain instead of retain.
7200 (ObjcInstance::~ObjcInstance): Use CFRelease instead of release.
7201 (ObjcInstance::operator=): More of the same.
7202 (ObjcInstance::end): Use [pool drain] if compiling on Tiger.
7203
7204 * bindings/objc/objc_runtime.mm:
7205 (ObjcArray::ObjcArray): Use CFRetain instead of retain.
7206 (ObjcArray::~ObjcArray): Use CFRelease instead of release.
7207 (ObjcArray::operator=): More of the same.
7208
7209 * bindings/testbindings.mm: Fixed incorrect license.
7210 (main): Use [pool drain] if compiling on Tiger.
7211
7212=== Safari-144 ===
7213
72142004-06-10 Kevin Decker <kdecker@apple.com>
7215
7216 Reviewed by John.
7217
7218 * kjs/lexer.cpp:
7219 (Lexer::setCode):
7220 - fixed <rdar://problem/3682398>: (error console line numbers are offset by 1)
7221 * kjs/lexer.h:
7222 (KJS::Lexer::lineNo):
7223 - fixed <rdar://problem/3682398>: (error console line numbers are offset by 1)
7224
7225=== JavaScriptCore-143.2 ===
7226
72272004-06-07 Darin Adler <darin@apple.com>
7228
7229 - fixed <rdar://problem/3682489>: (JavaScriptGlue no longer compiles because Interpreter::evaluate parameters changed)
7230
7231 * kjs/interpreter.h: Added an overload to make JavaScriptGlue compile.
7232 * kjs/interpreter.cpp: (KJS::Interpreter::evaluate): Implemented the overload.
7233
7234=== JavaScriptCore-143.1 ===
7235
72362004-06-04 Kevin Decker <kdecker@apple.com>
7237
7238 Reviewed by Darin
7239
7240 - fixed <rdar://problem/3680594>
7241
7242 * kjs/object.cpp:
7243 (KJS::Error::create):
7244
7245=== Safari-143 ===
7246
72472004-06-04 Darin Adler <darin@apple.com>
7248
7249 * kjs/testkjs.cpp: (main): Fix build breakage by adding URL and line number parameters.
7250
72512004-06-04 Kevin Decker <kdecker@apple.com>
7252
7253 Reviewed by Dave.
7254
7255 - ObjC bindings do not (yet) pass along sourceurl or line numbers
7256 - we don't have a way as of yet to accomidate line numbers and urls for dynamic javascript
7257 - changed the wording of an error message
7258 - the lexer, parser, and interpreter have been made "sourceURL aware"
7259 - stored the url into Error
7260
7261 * bindings/NP_jsobject.cpp:
7262 (NPN_Evaluate):
7263 * bindings/jni/jni_jsobject.cpp:
7264 (JSObject::eval):
7265 * bindings/objc/WebScriptObject.mm:
7266 (-[WebScriptObject evaluateWebScript:]):
7267 * kjs/function.cpp:
7268 (GlobalFuncImp::call):
7269 * kjs/function_object.cpp:
7270 (FunctionObjectImp::construct):
7271 * kjs/internal.cpp:
7272 (Parser::parse):
7273 (InterpreterImp::checkSyntax):
7274 (InterpreterImp::evaluate):
7275 * kjs/internal.h:
7276 * kjs/interpreter.cpp:
7277 (Interpreter::evaluate):
7278 * kjs/interpreter.h:
7279 * kjs/lexer.cpp:
7280 (Lexer::setCode):
7281 * kjs/lexer.h:
7282 (KJS::Lexer::sourceURL):
7283 * kjs/nodes.cpp:
7284 (Node::Node):
7285 (Node::throwError):
7286 (FunctionCallNode::evaluate):
7287 * kjs/nodes.h:
7288 * kjs/object.cpp:
7289 (KJS::Error::create):
7290 * kjs/object.h:
7291
72922004-06-04 Richard Williamson <rjw@apple.com>
7293
7294 Fixed crash when attempting to access properties on nil
7295 object.
7296
7297 Reviewed by John.
7298
7299 * bindings/objc/objc_instance.mm:
7300 (ObjcInstance::getClass):
7301 * bindings/runtime_object.cpp:
7302 (RuntimeObjectImp::get):
7303 * bindings/testM.js:
7304 * bindings/testbindings.mm:
7305 (-[MyFirstInterface getString]):
7306
73072004-05-27 Kevin Decker <kdecker@apple.com>
7308
7309 Reviewed by Ken.
7310
7311 -revised generated error message content
7312
7313 * kjs/error_object.cpp:
7314 (ErrorProtoFuncImp::call):
7315 * kjs/internal.cpp:
7316 (Parser::parse):
7317 * kjs/object.cpp:
7318 (KJS::Error::create):
7319
7320=== Safari-142 ===
7321
73222004-05-27 Richard Williamson <rjw@apple.com>
7323
7324 Renamed WebScriptMethods to WebScripting based on feedback from Nancy.
7325
7326 Reviewed by Chris.
7327
7328 * bindings/objc/WebScriptObject.h:
7329
73302004-05-27 Darin Adler <darin@apple.com>
7331
7332 Reviewed by Maciej.
7333
7334 - moved to new symlink technique for embedding frameworks
7335
7336 * JavaScriptCore.pbproj/project.pbxproj: Get rid of embed-frameworks build step
7337 because we don't need it any more.
7338
73392004-05-24 Richard Williamson <rjw@apple.com>
7340
7341 Changed RuntimeArrayImp to inherit from ArrayInstanceImp and
7342 fixed ClassInfo to correctly reflect inheritance. This is required
7343 because of the runtime checks in JSC for arrays, i.e. in
7344 the Function objects apply method.
7345
7346 Reviewed by Ken.
7347
7348 * bindings/jni/jni_runtime.cpp:
7349 (JavaArray::convertJObjectToArray):
7350 * bindings/objc/objc_utility.mm:
7351 (KJS::Bindings::convertObjcValueToValue):
7352 * bindings/runtime_array.cpp:
7353 (RuntimeArrayImp::RuntimeArrayImp):
7354 * bindings/runtime_array.h:
7355 * bindings/testM.js: Added.
7356 * bindings/testbindings.mm:
7357 (+[MyFirstInterface webScriptNameForSelector:]):
7358 (-[MyFirstInterface logMessages:]):
7359 (-[MyFirstInterface logMessage:prefix:]):
7360 (-[MyFirstInterface callJSObject::]):
7361
73622004-05-22 Darin Adler <darin@apple.com>
7363
7364 Reviewed by Maciej.
7365
7366 - fixed <rdar://problem/3664260>: (JS needs to listen to timezone change notifications)
7367
7368 * kjs/date_object.cpp: (CopyLocalTimeZone): As per Chris Kane and Jordan Hubbard, use <notify.h>
7369 with a hardcoded string of "com.apple.system.timezone", and do CFTimeZoneResetSystem since
7370 CoreFoundation doesn't do this itself. Turns out this affects the default time zone as long as
7371 it hasn't been set explicitly.
7372
7373=== Safari-141 ===
7374
73752004-05-20 Richard Williamson <rjw@apple.com>
7376
7377 Implemented WebScriptObject/DOM wrapper voodoo. DOM wrappers
7378 can now be referenced like any other WebScriptObject, meaning
7379 you can do JS operations on them.
7380
7381 All added implementation of finalizeForWebScript.
7382
7383 Reviewed by Ken.
7384
7385 * bindings/objc/WebScriptObject.h:
7386 * bindings/objc/WebScriptObject.mm:
7387 (-[WebScriptObject _initializeWithObjectImp:KJS::root:Bindings::]):
7388 (-[WebScriptObject _initWithObjectImp:KJS::root:Bindings::]):
7389 (-[WebScriptObject KJS::]):
7390 (-[WebScriptObject dealloc]):
7391 (-[WebScriptObject callWebScriptMethod:withArguments:]):
7392 (-[WebScriptObject evaluateWebScript:]):
7393 (-[WebScriptObject setValue:forKey:]):
7394 (-[WebScriptObject valueForKey:]):
7395 (-[WebScriptObject stringRepresentation]):
7396 * bindings/objc/WebScriptObjectPrivate.h:
7397 * bindings/objc/objc_instance.mm:
7398 (ObjcInstance::~ObjcInstance):
7399
74002004-05-19 Richard Williamson <rjw@apple.com>
7401
7402 Removed extraneous tabs that were added (by XCode?).
7403
7404 * bindings/objc/WebScriptObject.h:
7405
74062004-05-19 Darin Adler <darin@apple.com>
7407
7408 - fixed headers with licenses mangled by Xcode auto-indenting
7409
7410 * bindings/jni/jni_jsobject.cpp:
7411 * bindings/jni/jni_jsobject.h:
7412 * bindings/runtime_array.h:
7413 * bindings/runtime_root.cpp:
7414 * bindings/runtime_root.h:
7415
74162004-05-18 Richard Williamson <rjw@apple.com>
7417
7418 Added exception logging. Also check for exception and
7419 set results as appropriate.
7420
7421 Reviewed by Maciej (partially reviewed).
7422
7423 * bindings/objc/WebScriptObject.mm:
7424 (-[WebScriptObject callWebScriptMethod:withArguments:]):
7425 (-[WebScriptObject evaluateWebScript:]):
7426 (-[WebScriptObject setValue:forKey:]):
7427 (-[WebScriptObject valueForKey:]):
7428
74292004-05-18 Richard Williamson <rjw@apple.com>
7430
7431 Finsished implementing support for windowScriptObject.
7432 Had to make WebScriptObjectPrivate.h accessible from
7433 WebCore.
7434
7435 Reviewed by Maciej.
7436
7437 * JavaScriptCore.pbproj/project.pbxproj:
7438 * bindings/objc/WebScriptObjectPrivate.h:
7439
74402004-05-18 Richard Williamson <rjw@apple.com>
7441
7442 Use KVC to set/get values instead of directly accessing
7443 ivars.
7444
7445 Reviewed by Maciej.
7446
7447 * bindings/objc/WebScriptObject.mm:
7448 (-[WebScriptObject callWebScriptMethod:withArguments:]):
7449 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
7450 * bindings/objc/objc_runtime.mm:
7451 (ObjcField::valueFromInstance):
7452 (convertValueToObjcObject):
7453 (ObjcField::setValueToInstance):
7454
74552004-05-17 Richard Williamson <rjw@apple.com>
7456
7457 Implemented new API for WebScriptObject.
7458
7459 Fixed <rdar://problem/3657145>: (objc to javascript method calls do not cause updates.)
7460 Fixed <rdar://problem/3654887>: (Update to JSC to refer to new JSObject LiveConnect object) (w/ help from Vicki)
7461
7462 Reviewed by Hyatt.
7463
7464 * JavaScriptCore.pbproj/project.pbxproj:
7465 * bindings/c/c_instance.cpp:
7466 (CInstance::invokeMethod):
7467 * bindings/jni/jni_instance.cpp:
7468 (JavaInstance::invokeMethod):
7469 * bindings/jni/jni_jsobject.cpp:
7470 (JSObject::convertValueToJObject):
7471 * bindings/jni/jni_utility.cpp:
7472 (KJS::Bindings::getJNIField):
7473 * bindings/objc/WebScriptObject.mm:
7474 (_didExecute):
7475 (-[WebScriptObject _initWithObjectImp:KJS::root:Bindings::]):
7476 (-[WebScriptObject KJS::]):
7477 (-[WebScriptObject dealloc]):
7478 (+[WebScriptObject throwException:]):
7479 (listFromNSArray):
7480 (-[WebScriptObject callWebScriptMethod:withArguments:]):
7481 (-[WebScriptObject evaluateWebScript:]):
7482 (-[WebScriptObject setValue:forKey:]):
7483 (-[WebScriptObject valueForKey:]):
7484 (-[WebScriptObject stringRepresentation]):
7485 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
7486 (+[WebUndefined undefined]):
7487 (-[WebUndefined initWithCoder:]):
7488 (-[WebUndefined encodeWithCoder:]):
7489 (-[WebUndefined copyWithZone:]):
7490 (-[WebUndefined retain]):
7491 (-[WebUndefined release]):
7492 (-[WebUndefined retainCount]):
7493 (-[WebUndefined autorelease]):
7494 (-[WebUndefined dealloc]):
7495 (-[WebUndefined copy]):
7496 (-[WebUndefined replacementObjectForPortCoder:]):
7497 * bindings/objc/WebScriptObjectPrivate.h: Added.
7498 * bindings/objc/objc_class.mm:
7499 (ObjcClass::methodsNamed):
7500 (ObjcClass::fieldNamed):
7501 * bindings/objc/objc_instance.mm:
7502 (ObjcInstance::invokeMethod):
7503 * bindings/objc/objc_jsobject.h:
7504 * bindings/objc/objc_jsobject.mm:
7505 * bindings/objc/objc_runtime.mm:
7506 (ObjcField::valueFromInstance):
7507 * bindings/objc/objc_utility.mm:
7508 (KJS::Bindings::JSMethodNameToObjCMethodName):
7509 (KJS::Bindings::convertValueToObjcValue):
7510 (KJS::Bindings::convertObjcValueToValue):
7511 * bindings/runtime.cpp:
7512 (Instance::setDidExecuteFunction):
7513 (Instance::didExecuteFunction):
7514 (Instance::setValueOfField):
7515 * bindings/runtime.h:
7516 * bindings/testbindings.mm:
7517 (+[MyFirstInterface webScriptNameForSelector:]):
7518 (-[MyFirstInterface callJSObject::]):
7519
75202004-05-14 Vicki Murley <vicki@apple.com>
7521
7522 Reviewed by mjs.
7523
7524 <rdar://problem/3642427>: framework marketing number should be 2.0 for DoubleBarrel release
7525
7526 * JavaScriptCore.pbproj/project.pbxproj: change CFBundleShortVersionString to 2.0
7527
7528=== Safari-140 ===
7529
75302004-05-13 Richard Williamson <rjw@apple.com>
7531
7532 Fixed indentation.
7533
7534 Reviewed by Chris.
7535
7536 * ChangeLog:
7537 * bindings/objc/WebScriptObject.h:
7538
75392004-05-13 Richard Williamson <rjw@apple.com>
7540
7541 Approved API changes. Currently unimplemented.
7542
7543 Reviewed by Chris.
7544
7545 * ChangeLog:
7546 * JavaScriptCore.pbproj/project.pbxproj:
7547 * bindings/objc/WebScriptObject.h: Added.
7548 * bindings/objc/WebScriptObject.mm: Added.
7549 (+[WebScriptObject throwException:]):
7550 (-[WebScriptObject callWebScriptMethod:withArguments:]):
7551 (-[WebScriptObject evaluateWebScript:]):
7552 (-[WebScriptObject stringRepresentation]):
7553 (+[WebUndefined undefined]):
7554 (-[WebUndefined initWithCoder:]):
7555 (-[WebUndefined encodeWithCoder:]):
7556 (-[WebUndefined copyWithZone:]):
7557
75582004-05-07 Vicki Murley <vicki@apple.com>
7559
7560 Reviewed by darin.
7561
7562 Turn off GC since it uses ppc only instructions (which breaks
7563 the B&I build).
7564
7565 * kjs/value.h: set USE_CONSERVATIVE_GC to 0
7566
7567=== Safari-139 ===
7568
75692004-05-07 Maciej Stachowiak <mjs@apple.com>
7570
7571 Reviewed by Darin.
7572
7573 - add -funroll-loops=16 compiler option for approx .5% speedup on
7574 HTML iBench and .5-1% speedup on JS iBench.
7575
7576 * JavaScriptCore.pbproj/project.pbxproj:
7577
75782004-04-25 Maciej Stachowiak <mjs@apple.com>
7579
7580 Reviewed by Darin.
7581
7582 Enable full conservative GC mode in addition to test mode. When
7583 conservative GC is enabled, we now get an 11% speed improvement on
7584 the iBench. Also fix some spots I missed before.
7585
7586 Specific noteworth changes:
7587
7588 * kjs/collector.cpp:
7589 (KJS::Collector::markStackObjectsConservatively): Check possible
7590 cell pointers for 8-byte aligment and verify they are not 0.
7591
7592 * kjs/protected_values.cpp:
7593 (KJS::ProtectedValues::increaseProtectCount): Move null-tolerance from here...
7594 (KJS::ProtectedValues::decreaseProtectCount): ...and here...
7595 * kjs/protect.h:
7596 (KJS::gcProtectNullTolerant): ...to here...
7597 (KJS::gcUnprotectNullTolerant): ...and here, because not all callers need the null
7598 tolerance, and doing the check is expensive.
7599
7600 * kjs/protected_values.cpp:
7601 (KJS::ProtectedValues::computeHash): Replace hash function with a much faster one
7602 that is still very good.
7603
7604 * kjs/protect.h:
7605 (KJS::gcProtect):
7606 (KJS::gcUnprotect):
7607 (KJS::ProtectedValue::ProtectedValue):
7608 (KJS::ProtectedValue::~ProtectedValue):
7609 (KJS::ProtectedValue::operator=):
7610 (KJS::ProtectedObject::ProtectedObject):
7611 (KJS::ProtectedObject::~ProtectedObject):
7612 (KJS::ProtectedObject::operator=):
7613 (KJS::ProtectedReference::ProtectedReference):
7614 (KJS::ProtectedReference::~ProtectedReference):
7615 (KJS::ProtectedReference::operator=):
7616 * kjs/protected_values.cpp:
7617 (KJS::ProtectedValues::getProtectCount):
7618 (KJS::ProtectedValues::increaseProtectCount):
7619 (KJS::ProtectedValues::decreaseProtectCount):
7620 (KJS::ProtectedValues::computeHash):
7621 * bindings/runtime_root.cpp:
7622 (KJS::Bindings::addNativeReference):
7623 (KJS::Bindings::removeNativeReference):
7624 (RootObject::removeAllNativeReferences):
7625 * bindings/runtime_root.h:
7626 (KJS::Bindings::RootObject::~RootObject):
7627 (KJS::Bindings::RootObject::setRootObjectImp):
7628 * kjs/collector.cpp:
7629 (KJS::Collector::allocate):
7630 (KJS::Collector::collect):
7631 * kjs/collector.h:
7632 * kjs/internal.cpp:
7633 (NumberImp::create):
7634 (InterpreterImp::globalInit):
7635 (InterpreterImp::globalClear):
7636 (InterpreterImp::mark):
7637 * kjs/list.cpp:
7638 (KJS::List::derefValues):
7639 (KJS::List::refValues):
7640 (KJS::List::append):
7641 * kjs/object.cpp:
7642 (KJS::ObjectImp::setInternalValue):
7643 (KJS::ObjectImp::putDirect):
7644 * kjs/value.cpp:
7645 (ValueImp::mark):
7646 (ValueImp::marked):
7647 * kjs/value.h:
7648 (KJS::ValueImp::ValueImp):
7649 (KJS::ValueImp::~ValueImp):
7650 (KJS::ValueImp::):
7651 (KJS::Value::Value):
7652 (KJS::Value::~Value):
7653 (KJS::Value::operator=):
7654
76552004-04-30 Richard Williamson <rjw@apple.com>
7656
7657 Asking an NSInvocation for it's return value when return type
7658 is void throws an exception. Added check for void return types
7659 to avoid this exception.
7660
7661 Reviewed by Ken.
7662
7663 * bindings/objc/objc_instance.mm:
7664 (ObjcInstance::invokeMethod):
7665
76662004-04-29 Richard Williamson <rjw@apple.com>
7667
7668 Fixed several bad problems with the ObjC bindings. In particular, conversion
7669 to/from JavaScriptObject (soon to be WebScriptObject) was completely broken.
7670
7671 Reviewed by Chris.
7672
7673 * bindings/objc/objc_jsobject.h:
7674 * bindings/objc/objc_jsobject.mm:
7675 (-[JavaScriptObject initWithObjectImp:KJS::root:Bindings::]):
7676 (-[JavaScriptObject KJS::]):
7677 (+[JavaScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
7678 (-[JavaScriptObject call:arguments:]):
7679 (-[JavaScriptObject evaluate:]):
7680 (-[JavaScriptObject getMember:]):
7681 (-[JavaScriptObject getSlot:]):
7682 * bindings/objc/objc_runtime.mm:
7683 (ObjcField::valueFromInstance):
7684 (ObjcField::setValueToInstance):
7685 * bindings/objc/objc_utility.mm:
7686 (KJS::Bindings::convertValueToObjcValue):
7687 (KJS::Bindings::convertObjcValueToValue):
7688 * bindings/runtime.h:
7689 * bindings/runtime_root.cpp:
7690 (KJS::Bindings::rootForInterpreter):
7691 (KJS::Bindings::addNativeReference):
7692 (KJS::Bindings::removeNativeReference):
7693 * bindings/runtime_root.h:
7694 * bindings/testbindings.mm:
7695 (-[MyFirstInterface logMessage:]):
7696 (-[MyFirstInterface setJSObject:]):
7697 (-[MyFirstInterface callJSObject::]):
7698
76992004-04-24 Darin Adler <darin@apple.com>
7700
7701 Reviewed by Dave.
7702
7703 * kjs/ustring.cpp: (KJS::UString::append): Fix one case that was allocating a buffer
7704 that is 2x too big.
7705
77062004-04-23 Maciej Stachowiak <mjs@apple.com>
7707
7708 Reviewed by Darin.
7709
7710 Implementation of conservative GC, based partly on code from
7711 Darin. It's turned off for now, so it shouldn't have any effect on
7712 the normal build.
7713
7714 * JavaScriptCore.pbproj/project.pbxproj:
7715 * kjs/collector.cpp:
7716 (KJS::Collector::markStackObjectsConservatively):
7717 (KJS::Collector::markProtectedObjects):
7718 (KJS::Collector::collect):
7719 * kjs/collector.h:
7720 * kjs/protect.h:
7721 (KJS::gcProtect):
7722 (KJS::gcUnprotect):
7723 * kjs/protected_values.cpp: Added.
7724 (KJS::ProtectedValues::getProtectCount):
7725 (KJS::ProtectedValues::increaseProtectCount):
7726 (KJS::ProtectedValues::insert):
7727 (KJS::ProtectedValues::decreaseProtectCount):
7728 (KJS::ProtectedValues::expand):
7729 (KJS::ProtectedValues::shrink):
7730 (KJS::ProtectedValues::rehash):
7731 (KJS::ProtectedValues::computeHash):
7732 * kjs/protected_values.h: Added.
7733 * kjs/value.cpp:
7734 (ValueImp::useConservativeMark):
7735 (ValueImp::mark):
7736 (ValueImp::marked):
7737 * kjs/value.h:
7738 (KJS::ValueImp::):
7739
7740=== Safari-138 ===
7741
77422004-04-22 Richard Williamson <rjw@apple.com>
7743
7744 Fixed build snafu (re-declaration of NPBool in npruntime.h and
7745 npapi.h).
7746
7747 * bindings/npruntime.h:
7748
77492004-04-22 Richard Williamson <rjw@apple.com>
7750
7751 Updated plugin binding API to reflect latest revision from
7752 working group.
7753
7754 Biggest change is the introduction of NPVariant used to represent
7755 value types. NPVariant replaces the use of NPObject for the
7756 exchange of values between scripting environment and native code.
7757
7758 Reviewed by John.
7759
7760 * JavaScriptCore.pbproj/project.pbxproj:
7761 * bindings/NP_jsobject.cpp:
7762 (identiferFromNPIdentifier):
7763 (NPN_Call):
7764 (NPN_Evaluate):
7765 (NPN_GetProperty):
7766 (NPN_SetProperty):
7767 (NPN_ToString):
7768 (NPN_GetPropertyAtIndex):
7769 (NPN_SetPropertyAtIndex):
7770 * bindings/c/c_class.cpp:
7771 (CClass::methodsNamed):
7772 (CClass::fieldNamed):
7773 * bindings/c/c_instance.cpp:
7774 (CInstance::invokeMethod):
7775 (CInstance::defaultValue):
7776 * bindings/c/c_runtime.cpp:
7777 (CField::valueFromInstance):
7778 (CField::setValueToInstance):
7779 * bindings/c/c_utility.cpp:
7780 (convertNPStringToUTF16):
7781 (convertUTF8ToUTF16):
7782 (coerceValueToNPVariantStringType):
7783 (convertValueToNPVariant):
7784 (convertNPVariantToValue):
7785 * bindings/c/c_utility.h:
7786 * bindings/npruntime.cpp:
7787 (NPN_GetIdentifier):
7788 (NPN_GetIdentifiers):
7789 (NPN_UTF8FromIdentifier):
7790 (NPN_VariantIsVoid):
7791 (NPN_VariantIsNull):
7792 (NPN_VariantIsUndefined):
7793 (NPN_VariantIsBool):
7794 (NPN_VariantIsInt32):
7795 (NPN_VariantIsDouble):
7796 (NPN_VariantIsString):
7797 (NPN_VariantIsObject):
7798 (NPN_VariantToBool):
7799 (NPN_VariantToString):
7800 (NPN_VariantToInt32):
7801 (NPN_VariantToDouble):
7802 (NPN_VariantToObject):
7803 (NPN_InitializeVariantAsVoid):
7804 (NPN_InitializeVariantAsNull):
7805 (NPN_InitializeVariantAsUndefined):
7806 (NPN_InitializeVariantWithBool):
7807 (NPN_InitializeVariantWithInt32):
7808 (NPN_InitializeVariantWithDouble):
7809 (NPN_InitializeVariantWithString):
7810 (NPN_InitializeVariantWithStringCopy):
7811 (NPN_InitializeVariantWithObject):
7812 (NPN_InitializeVariantWithVariant):
7813 (NPN_ReleaseVariantValue):
7814 (NPN_CreateObject):
7815 (NPN_RetainObject):
7816 (NPN_ReleaseObject):
7817 (NPN_IsKindOfClass):
7818 (NPN_SetExceptionWithUTF8):
7819 (NPN_SetException):
7820 * bindings/npruntime.h:
7821 (_NPString::):
7822 (_NPString::_NPVariant::):
7823 * bindings/testbindings.cpp:
7824 (logMessage):
7825 (setDoubleValue):
7826 (setIntValue):
7827 (setStringValue):
7828 (setBooleanValue):
7829 (getDoubleValue):
7830 (getIntValue):
7831 (getStringValue):
7832 (getBooleanValue):
7833 (myGetProperty):
7834 (mySetProperty):
7835 (myInvoke):
7836 (myAllocate):
7837
78382004-04-22 Darin Adler <darin@apple.com>
7839
7840 Reviewed by Maciej.
7841
7842 - fixed <rdar://problem/3627473>: "REGRESSION (125-137): memory trasher in UString::append, causing many different crashes"
7843
7844 * kjs/ustring.cpp:
7845 (KJS::UString::expandCapacity): Fix sizeof(UChar *) that should be sizeof(UChar).
7846 Was resulting in a buffer 2x the needed size.
7847 (KJS::UString::expandPreCapacity): Ditto.
7848 (KJS::UString::append): Fix malloc that is missing a sizeof(UChar).
7849
78502004-04-21 Maciej Stachowiak <mjs@apple.com>
7851
7852 Reviewed by Darin.
7853
7854 Preliminary change for conservative GC. Create "protected"
7855 subclasses to GC-protect objects when on heap, since we will soon
7856 remove the built-in refcounting of the normal wrapper classes. Use
7857 them where needed.
7858
7859 * JavaScriptCore.pbproj/project.pbxproj:
7860 * kjs/context.h:
7861 * kjs/internal.h:
7862 (KJS::InterpreterImp::globalObject):
7863 * kjs/interpreter.h:
7864 * kjs/property_map.cpp:
7865 * kjs/reference.h:
7866 * kjs/reference_list.cpp:
7867
78682004-04-19 Maciej Stachowiak <mjs@apple.com>
7869
7870 Reviewed by Dave.
7871
7872 Optimize prepend using the shared substring optimization. Also,
7873 limit the applicability of shared append and shared prepend. If
7874 you overdo it, it does more harm than good, because you create a
7875 bunch of strings that are disqualified from future shared
7876 append/prepend, for not much immediate savings in allocate/copy
7877 expense.
7878
7879 * kjs/ustring.cpp:
7880 (KJS::):
7881 (KJS::UString::Rep::create):
7882 (KJS::UString::expandedSize):
7883 (KJS::UString::usedPreCapacity):
7884 (KJS::UString::expandCapacity):
7885 (KJS::UString::expandPreCapacity):
7886 (KJS::UString::UString):
7887 (KJS::UString::append):
7888 (KJS::UString::operator=):
7889 * kjs/ustring.h:
7890 (KJS::UString::Rep::data):
7891
78922004-04-16 Maciej Stachowiak <mjs@apple.com>
7893 Reviewed by Richard.
7894
7895 No more need for Completion or Reference to privately inherit from
7896 Value, none of the superclass functionality is used.
7897
7898 * kjs/completion.h:
7899 * kjs/reference.h:
7900
7901=== Safari-137 ===
7902
79032004-04-16 Richard Williamson <rjw@apple.com>
7904
7905 Added interpreter lock protection around object creation.
7906
7907 Reviewed by Chris.
7908
7909 * bindings/runtime.cpp:
7910 (Instance::createRuntimeObject):
7911
79122004-04-16 Maciej Stachowiak <mjs@apple.com>
7913
7914 Reviewed by Ken.
7915
7916 Another JavaScript speed improvement: use the mechanism from
7917 string append optimization to make taking a substring fast, again
7918 sharing the buffer.
7919
7920 A further 22% improvement on the 24fun string speed test.
7921
7922 * kjs/ustring.cpp:
7923 (KJS::):
7924 (KJS::UString::Rep::create):
7925 (KJS::UString::UString):
7926 (KJS::UString::append):
7927 (KJS::UString::operator=):
7928 (KJS::UString::substr):
7929 * kjs/ustring.h:
7930 (KJS::UString::Rep::data):
7931
79322004-04-13 Maciej Stachowiak <mjs@apple.com>
7933
7934 Reviewed by Darin.
7935
7936 - fixed <rdar://problem/3600695>: String manipulation in JavaScript 24fun test is very slow (slow)
7937 - fixed <rdar://problem/3600691>: Table generation test is really slow
7938 - fixed <rdar://problem/3600661>: 24fun date test is really slow
7939
7940 80% speedup on the string test, lesser speedups on the other two.
7941
7942 Two different optimizations here:
7943
7944 1) Avoid large overhead of scanning strings to see if they are all
7945 ASCII before numeric conversion.
7946
7947 * kjs/nodes.cpp:
7948 (AssignNode::evaluate): Don't convert to integer until we know for
7949 sure the operation will need it. Attempting to convert strings to
7950 numbers is a waste when they are being appended with +=.
7951
7952 2) Avoid huge cost of appending strings.
7953
7954 This is done by allowing multiple strings to share a buffer but
7955 actually use different ranges of it. The first time a string is
7956 appended to, we start leaving at least 10% extra space in the
7957 buffer, so doing N appends to the same string takes O(log N)
7958 mallocs instead of O(N).
7959
7960 * kjs/identifier.cpp:
7961 (KJS::Identifier::equal):
7962 (KJS::Identifier::add):
7963 * kjs/ustring.cpp:
7964 (KJS::):
7965 (KJS::UCharReference::operator=):
7966 (KJS::UCharReference::ref):
7967 (KJS::UString::Rep::create):
7968 (KJS::UString::Rep::destroy):
7969 (KJS::UString::expandedSize):
7970 (KJS::UString::usedCapacity):
7971 (KJS::UString::expandCapacity):
7972 (KJS::UString::UString):
7973 (KJS::UString::null):
7974 (KJS::UString::append):
7975 (KJS::UString::operator=):
7976 (KJS::UString::toStrictUInt32):
7977 (KJS::UString::detach):
7978 (KJS::KJS::operator==):
7979 * kjs/ustring.h:
7980 (KJS::UString::Rep::data):
7981 (KJS::UString::Rep::hash):
7982
79832004-04-09 Maciej Stachowiak <mjs@apple.com>
7984
7985 Reviewed by John.
7986
7987 - fix deployment build by avoiding deployment-only warning.
7988
7989 * kjs/scope_chain.cpp:
7990 (KJS::ScopeChain::bottom):
7991
79922004-04-09 Maciej Stachowiak <mjs@apple.com>
7993
7994 Reviewed by John.
7995
7996 Changed things so that newly created objects get a prototype based
7997 on the scope chain of the current function, rather than the
7998 interpreter that started execution. This fixes the following bugs:
7999
8000 <rdar://problem/3368523>: ARCH: wrong prototype used to create new objects (hang on lookup.atomica.com)
8001 <rdar://problem/3559173>: ARCH: Cannot scan using a HP Jetdirect product (JS object prototypes bind incorrectly)
8002
8003 * JavaScriptCore.pbproj/project.pbxproj:
8004 * kjs/array_object.cpp:
8005 (CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
8006 (ArrayProtoFuncImp::ArrayProtoFuncImp):
8007 (ArrayProtoFuncImp::call):
8008 (ArrayObjectImp::construct):
8009 * kjs/bool_object.cpp:
8010 (BooleanObjectImp::construct):
8011 * kjs/date_object.cpp:
8012 (DateProtoFuncImp::DateProtoFuncImp):
8013 (DateProtoFuncImp::call):
8014 (DateObjectImp::construct):
8015 * kjs/error_object.cpp:
8016 (ErrorObjectImp::construct):
8017 * kjs/function.cpp:
8018 (FunctionImp::FunctionImp):
8019 (FunctionImp::call):
8020 (DeclaredFunctionImp::construct):
8021 (ArgumentsImp::ArgumentsImp):
8022 (GlobalFuncImp::call):
8023 * kjs/function_object.cpp:
8024 (FunctionProtoFuncImp::call):
8025 (FunctionObjectImp::construct):
8026 * kjs/internal.cpp:
8027 (BooleanImp::toObject):
8028 (StringImp::toObject):
8029 (NumberImp::toObject):
8030 (InterpreterImp::InterpreterImp):
8031 (InterpreterImp::clear):
8032 (InterpreterImp::interpreterWithGlobalObject):
8033 * kjs/internal.h:
8034 * kjs/interpreter.cpp:
8035 (ExecState::lexicalInterpreter):
8036 * kjs/interpreter.h:
8037 (KJS::ExecState::dynamicInterpreter):
8038 (KJS::ExecState::interpreter):
8039 * kjs/math_object.cpp:
8040 (MathFuncImp::MathFuncImp):
8041 * kjs/nodes.cpp:
8042 (StatementNode::hitStatement):
8043 (StatementNode::abortStatement):
8044 (RegExpNode::evaluate):
8045 (ElementNode::evaluate):
8046 (ArrayNode::evaluate):
8047 (ObjectLiteralNode::evaluate):
8048 (PropertyValueNode::evaluate):
8049 (FunctionCallNode::evaluate):
8050 (FuncDeclNode::processFuncDecl):
8051 (FuncExprNode::evaluate):
8052 * kjs/number_object.cpp:
8053 (NumberObjectImp::construct):
8054 * kjs/object.cpp:
8055 (KJS::ObjectImp::defaultValue):
8056 (KJS::Error::create):
8057 * kjs/object_object.cpp:
8058 (ObjectObjectImp::construct):
8059 * kjs/reference.cpp:
8060 (Reference::putValue):
8061 * kjs/regexp_object.cpp:
8062 (RegExpProtoFuncImp::call):
8063 (RegExpObjectImp::arrayOfMatches):
8064 (RegExpObjectImp::construct):
8065 * kjs/scope_chain.cpp:
8066 (KJS::ScopeChain::bottom):
8067 * kjs/scope_chain.h:
8068 * kjs/string_object.cpp:
8069 (StringProtoFuncImp::StringProtoFuncImp):
8070 (StringProtoFuncImp::call):
8071 (StringObjectImp::construct):
8072
8073=== Safari-136 ===
8074
8075=== Safari-135 ===
8076
80772004-03-31 Richard Williamson <rjw@apple.com>
8078
8079 Tedious renames based on feedback from plugin-futures list.
8080 NP_ functions are renamed with NPN_ prefix.
8081 Types prefix renamed from NP_ to NP.
8082 NPN_CreateStringWithUTF8 and NPN_SetExceptionWithUTF8 now take a length, optionally -1 if string is null terminated.
8083
8084 No review because this was just a renaming patch.
8085
8086 * bindings/NP_jsobject.cpp:
8087 (listFromNPArray):
8088 (jsAllocate):
8089 (identiferFromNPIdentifier):
8090 (NPN_Call):
8091 (NPN_Evaluate):
8092 (NPN_GetProperty):
8093 (NPN_SetProperty):
8094 (NPN_RemoveProperty):
8095 (NPN_ToString):
8096 (NPN_GetPropertyAtIndex):
8097 (NPN_SetPropertyAtIndex):
8098 * bindings/NP_jsobject.h:
8099 * bindings/c/c_class.cpp:
8100 (CClass::_commonInit):
8101 (CClass::classForIsA):
8102 (CClass::CClass):
8103 (CClass::methodsNamed):
8104 (CClass::fieldNamed):
8105 * bindings/c/c_class.h:
8106 * bindings/c/c_instance.cpp:
8107 (CInstance::CInstance):
8108 (CInstance::~CInstance):
8109 (CInstance::operator=):
8110 (CInstance::invokeMethod):
8111 (CInstance::defaultValue):
8112 * bindings/c/c_instance.h:
8113 (KJS::Bindings::CInstance::getObject):
8114 * bindings/c/c_runtime.cpp:
8115 (CField::valueFromInstance):
8116 (CField::setValueToInstance):
8117 * bindings/c/c_runtime.h:
8118 (KJS::Bindings::CField::CField):
8119 (KJS::Bindings::CField::name):
8120 (KJS::Bindings::CMethod::CMethod):
8121 (KJS::Bindings::CMethod::name):
8122 * bindings/c/c_utility.cpp:
8123 (coerceValueToNPString):
8124 (convertValueToNPValueType):
8125 (convertNPValueTypeToValue):
8126 * bindings/c/c_utility.h:
8127 * bindings/npruntime.cpp:
8128 (NPN_IdentifierFromUTF8):
8129 (NPN_IsValidIdentifier):
8130 (NPN_GetIdentifiers):
8131 (NPN_UTF8FromIdentifier):
8132 (NPN_CreateObject):
8133 (NPN_RetainObject):
8134 (NPN_ReleaseObject):
8135 (NPN_IsKindOfClass):
8136 (NPN_SetExceptionWithUTF8):
8137 (NPN_SetException):
8138 (numberAllocate):
8139 (NPN_CreateNumberWithInt):
8140 (NPN_CreateNumberWithFloat):
8141 (NPN_CreateNumberWithDouble):
8142 (NPN_IntFromNumber):
8143 (NPN_FloatFromNumber):
8144 (NPN_DoubleFromNumber):
8145 (stringAllocate):
8146 (NPN_CreateStringWithUTF8):
8147 (NPN_CreateStringWithUTF16):
8148 (NPN_DeallocateUTF8):
8149 (NPN_UTF8FromString):
8150 (NPN_UTF16FromString):
8151 (NPN_StringLength):
8152 (booleanAllocate):
8153 (NPN_CreateBoolean):
8154 (NPN_BoolFromBoolean):
8155 (nullAllocate):
8156 (NPN_GetNull):
8157 (undefinedAllocate):
8158 (NPN_GetUndefined):
8159 (arrayAllocate):
8160 (arrayDeallocate):
8161 (NPN_CreateArray):
8162 (NPN_CreateArrayV):
8163 (NPN_ObjectAtIndex):
8164 * bindings/npruntime.h:
8165 * bindings/runtime.cpp:
8166 (Instance::createBindingForLanguageInstance):
8167 * bindings/testbindings.cpp:
8168 (initializeIdentifiers):
8169 (myHasProperty):
8170 (myHasMethod):
8171 (myGetProperty):
8172 (mySetProperty):
8173 (logMessage):
8174 (setDoubleValue):
8175 (setIntValue):
8176 (setStringValue):
8177 (setBooleanValue):
8178 (getDoubleValue):
8179 (getIntValue):
8180 (getStringValue):
8181 (getBooleanValue):
8182 (myInvoke):
8183 (myAllocate):
8184 (myInvalidate):
8185 (myDeallocate):
8186 (main):
8187
81882004-03-31 Richard Williamson <rjw@apple.com>
8189
8190 Changed references to NP_runtime.h to npruntime.h
8191
8192 * JavaScriptCore.pbproj/project.pbxproj:
8193 * bindings/NP_jsobject.h:
8194 * bindings/c/c_class.h:
8195 * bindings/c/c_instance.h:
8196 * bindings/c/c_runtime.h:
8197 * bindings/c/c_utility.h:
8198 * bindings/npruntime.cpp:
8199
82002004-03-31 Richard Williamson <rjw@apple.com>
8201
8202 Renamed NP_runtime.h to npruntime.h to match Netscape SDK.
8203
8204 * JavaScriptCore.pbproj/project.pbxproj:
8205 * bindings/NP_jsobject.h:
8206 * bindings/npruntime.cpp:
8207
8208=== Safari-134 ===
8209
82102004-03-23 Richard Williamson <rjw@apple.com>
8211
8212 Added implementation of KJS::Value <-> NP_Object conversion functions.
8213 Augmented test program for 'C' bindings.
8214 Added asserts and parameter checking to all public API.
8215
8216 Reviewed by Ken.
8217
8218 * JavaScriptCore.pbproj/project.pbxproj:
8219 * bindings/NP_jsobject.cpp:
8220 (NP_ToString):
8221 * bindings/NP_jsobject.h: Added.
8222 * bindings/NP_runtime.cpp:
8223 (NP_IdentifierFromUTF8):
8224 (NP_IsValidIdentifier):
8225 (NP_GetIdentifiers):
8226 (NP_CreateObject):
8227 (NP_RetainObject):
8228 (NP_ReleaseObject):
8229 (NP_IsKindOfClass):
8230 (NP_SetExceptionWithUTF8):
8231 (NP_SetException):
8232 (NP_IntFromNumber):
8233 (NP_FloatFromNumber):
8234 (NP_DoubleFromNumber):
8235 (NP_CreateStringWithUTF8):
8236 (NP_CreateStringWithUTF16):
8237 (NP_DeallocateUTF8):
8238 (NP_UTF8FromString):
8239 (NP_UTF16FromString):
8240 (NP_StringLength):
8241 (NP_BoolFromBoolean):
8242 * bindings/NP_runtime.h:
8243 * bindings/c/c_instance.cpp:
8244 (CInstance::invokeMethod):
8245 * bindings/c/c_utility.cpp:
8246 (coerceValueToNPString):
8247 (convertValueToNPValueType):
8248 (convertNPValueTypeToValue):
8249 * bindings/c/c_utility.h:
8250 * bindings/test.js:
8251 * bindings/testC.js: Added.
8252 * bindings/testbindings.cpp:
8253 (logMessage):
8254 (setDoubleValue):
8255 (setIntValue):
8256 (setStringValue):
8257 (setBooleanValue):
8258 (getDoubleValue):
8259 (getIntValue):
8260 (getStringValue):
8261 (getBooleanValue):
8262 (myInterfaceInvoke):
8263 (myInterfaceAllocate):
8264
8265=== Safari-133 ===
8266
82672004-03-19 Darin Adler <darin@apple.com>
8268
8269 Reviewed by Ken.
8270
8271 - fixed problem with methods like setUTCHour
8272
8273 * kjs/date_object.cpp: (DateProtoFuncImp::call): Fix conversion back to time_t to use the appropriate
8274 GMT vs. local time function based on the utc flag.
8275
82762004-03-17 Richard Williamson <rjw@apple.com>
8277
8278 Added a context parameter to result callbacks use by JavaScriptObject functions. This was a change requested by Eric Carlson on the QT plugin team.
8279
8280 Reviewed by Ken.
8281
8282 * bindings/NP_jsobject.cpp:
8283 (NP_Call):
8284 (NP_Evaluate):
8285 (NP_GetProperty):
8286 (NP_ToString):
8287 (NP_GetPropertyAtIndex):
8288 * bindings/NP_runtime.h:
8289
82902004-03-16 Richard Williamson <rjw@apple.com>
8291
8292 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.
8293
8294 Reviewed by John.
8295
8296 * bindings/jni/jni_class.cpp:
8297 (JavaClass::methodsNamed):
8298
82992004-03-15 Richard Williamson <rjw@apple.com>
8300
8301 Fixed 3570854. Don't attempt to convert Null to strings. We
8302 were incorrectly converting to "Null".
8303
8304 Actually fixed by Scott Kovatch.
8305
8306 Reviewed by Richard.
8307
8308 * bindings/jni/jni_utility.cpp:
8309 (KJS::Bindings::convertValueToJValue):
8310
8311=== Safari-132 ===
8312
83132004-03-11 Richard Williamson <rjw@apple.com>
8314
8315 Stitched together the NP stuff to our language independent
8316 JavaScript binding stuff. Very close to being done.
8317
8318 Added program to test C bindings (and NP stuff). Just tests
8319 properties. Will add methods and JavaScript access, etc.
8320
8321 Updated Makefile.am to account for new bindings/c directory.
8322
8323 Change NP_UTF8 from "const char *" to "char" to allow for
8324 declarations like "const NP_UTF8 *" and "NP_UTF8 *". Ditto
8325 for NP_UTF16.
8326
8327 Added NP_IsValidIdentifier().
8328
8329 Reviewed by Chris.
8330
8331 * JavaScriptCore.pbproj/project.pbxproj:
8332 * Makefile.am:
8333 * bindings/NP_jsobject.cpp:
8334 (identiferFromNPIdentifier):
8335 (NP_Evaluate):
8336 * bindings/NP_runtime.cpp:
8337 (NP_IdentifierFromUTF8):
8338 (NP_IsValidIdentifier):
8339 (NP_GetIdentifiers):
8340 (NP_UTF8FromIdentifier):
8341 (NP_SetExceptionWithUTF8):
8342 (NP_SetException):
8343 (NP_CreateStringWithUTF8):
8344 (NP_CreateStringWithUTF16):
8345 (NP_UTF8FromString):
8346 (NP_UTF16FromString):
8347 * bindings/NP_runtime.h:
8348 * bindings/c/c_class.cpp: Added.
8349 (CClass::_commonDelete):
8350 (CClass::_commonCopy):
8351 (CClass::_commonInit):
8352 (_createClassesByIsAIfNecessary):
8353 (CClass::classForIsA):
8354 (CClass::CClass):
8355 (CClass::name):
8356 (CClass::methodsNamed):
8357 (CClass::fieldNamed):
8358 * bindings/c/c_class.h: Added.
8359 (KJS::Bindings::CClass::~CClass):
8360 (KJS::Bindings::CClass::CClass):
8361 (KJS::Bindings::CClass::operator=):
8362 (KJS::Bindings::CClass::constructorAt):
8363 (KJS::Bindings::CClass::numConstructors):
8364 * bindings/c/c_instance.cpp: Added.
8365 (CInstance::CInstance):
8366 (CInstance::~CInstance):
8367 (CInstance::operator=):
8368 (CInstance::getClass):
8369 (CInstance::begin):
8370 (CInstance::end):
8371 (CInstance::invokeMethod):
8372 (CInstance::defaultValue):
8373 (CInstance::stringValue):
8374 (CInstance::numberValue):
8375 (CInstance::booleanValue):
8376 (CInstance::valueOf):
8377 * bindings/c/c_instance.h: Added.
8378 (KJS::Bindings::CInstance::getObject):
8379 * bindings/c/c_runtime.cpp: Added.
8380 (CField::valueFromInstance):
8381 (CField::setValueToInstance):
8382 * bindings/c/c_runtime.h: Added.
8383 (KJS::Bindings::CField::CField):
8384 (KJS::Bindings::CField::name):
8385 (KJS::Bindings::CField::type):
8386 (KJS::Bindings::CMethod::CMethod):
8387 (KJS::Bindings::CMethod::name):
8388 (KJS::Bindings::CMethod::numParameters):
8389 * bindings/c/c_utility.cpp: Added.
8390 (coerceValueToNPValueType):
8391 (convertValueToNPValueType):
8392 (convertNPValueTypeToValue):
8393 * bindings/c/c_utility.h: Added.
8394 * bindings/make_testbindings:
8395 * bindings/runtime.cpp:
8396 (Instance::createBindingForLanguageInstance):
8397 * bindings/runtime.h:
8398 (KJS::Bindings::Instance::):
8399 * bindings/testbindings.cpp: Added.
8400 (initializeIdentifiers):
8401 (myInterfaceHasProperty):
8402 (myInterfaceHasMethod):
8403 (myInterfaceGetProperty):
8404 (myInterfaceSetProperty):
8405 (myInterfaceInvoke):
8406 (myInterfaceAllocate):
8407 (myInterfaceInvalidate):
8408 (myInterfaceDeallocate):
8409 (GlobalImp::className):
8410 (readJavaScriptFromFile):
8411 (main):
8412
84132004-03-10 Richard Williamson <rjw@apple.com>
8414
8415 Made changes to support new asychronous approach to calls from
8416 plugin to JavaScript
8417
8418 Reviewed by Chris.
8419
8420 * bindings/NP_jsobject.cpp:
8421 (NP_Call):
8422 (NP_Evaluate):
8423 (NP_GetProperty):
8424 (NP_ToString):
8425 (NP_GetPropertyAtIndex):
8426 * bindings/NP_runtime.h:
8427 * bindings/make_testbindings:
8428 * bindings/runtime.cpp:
8429 (Instance::createBindingForLanguageInstance):
8430
84312004-03-10 Richard Williamson <rjw@apple.com>
8432
8433 Updated header to include proposed changes from
8434 plugin-futures list. Calls from plugin to JavaScript
8435 are now asynchronous.
8436
8437 Reviewed by Chris.
8438
8439 * bindings/NP_runtime.h:
8440
8441=== Safari-131 ===
8442
84432004-03-04 Richard Williamson <rjw@apple.com>
8444
8445 Implementation of NP_JavaScriptObject. This is the 'C' class
8446 that wraps a JavaScript object.
8447
8448 Reviewed by Chris.
8449
8450 * JavaScriptCore.pbproj/project.pbxproj:
8451 * bindings/NP_jsobject.cpp: Added.
8452 (coerceValueToNPValueType):
8453 (convertValueToNPValueType):
8454 (convertNPValueTypeToValue):
8455 (listFromNPArray):
8456 (jsAllocate):
8457 (jsDeallocate):
8458 (identiferFromNPIdentifier):
8459 (NP_Call):
8460 (NP_Evaluate):
8461 (NP_GetProperty):
8462 (NP_SetProperty):
8463 (NP_RemoveProperty):
8464 (NP_ToString):
8465 (NP_GetPropertyAtIndex):
8466 (NP_SetPropertyAtIndex):
8467 * bindings/NP_runtime.cpp:
8468 (NP_ObjectAtIndex):
8469 * bindings/NP_runtime.h:
8470 * bindings/runtime_object.h:
8471
84722004-03-04 Richard Williamson <rjw@apple.com>
8473
8474 Added NP_Array implementation.
8475
8476 Changed NP_Boolean to just depend on two static instances, no
8477 space is required for values.
8478
8479 Reviewed by Chris.
8480
8481 * bindings/NP_runtime.cpp:
8482 (NP_CreateBoolean):
8483 (NP_BoolFromBoolean):
8484 (arrayAllocate):
8485 (arrayDeallocate):
8486 (NP_CreateArray):
8487 (NP_CreateArrayV):
8488 (NP_ObjectAtIndex):
8489 * bindings/NP_runtime.h:
8490
84912004-03-03 Darin Adler <darin@apple.com>
8492
8493 Reviewed by Vicki.
8494
8495 * English.lproj/InfoPlist.strings: Removed. No need to localize the version and
8496 copyright string, and that's all that was in here.
8497 * JavaScriptCore.pbproj/project.pbxproj: Removed InfoPlist.strings from build.
8498
84992004-03-03 Richard Williamson <rjw@apple.com>
8500
8501 More 'C' binding implementation. Fleshed out all the
8502 'primitive' data types.
8503
8504 Reviewed by Chris.
8505
8506 * bindings/NP_runtime.cpp:
8507 (NP_ReleaseObject):
8508 (numberAllocate):
8509 (stringAllocate):
8510 (stringDeallocate):
8511 (NP_CreateStringWithUTF8):
8512 (NP_CreateStringWithUTF16):
8513 (NP_UTF8FromString):
8514 (NP_UTF16FromString):
8515 (NP_StringLength):
8516 (booleanAllocate):
8517 (booleanDeallocate):
8518 (NP_CreateBoolean):
8519 (NP_BoolFromBoolean):
8520 (nullAllocate):
8521 (nullDeallocate):
8522 (NP_GetNull):
8523 (undefinedAllocate):
8524 (undefinedDeallocate):
8525 (NP_GetUndefined):
8526 * bindings/NP_runtime.h:
8527
85282004-03-03 Richard Williamson <rjw@apple.com>
8529
8530 More 'C' binding implementation.
8531
8532 Reviewed by Chris.
8533
8534 * bindings/NP_runtime.cpp:
8535 (identifierEqual):
8536 (identifierHash):
8537 (getIdentifierDictionary):
8538 (NP_IdentifierFromUTF8):
8539 (NP_UTF8FromIdentifier):
8540 (NP_CreateObject):
8541 (NP_ReleaseObject):
8542 (NP_IsKindOfClass):
8543 (numberCreate):
8544 (NP_CreateNumberWithInt):
8545 (NP_CreateNumberWithFloat):
8546 (NP_CreateNumberWithDouble):
8547 (NP_IntFromNumber):
8548 (NP_FloatFromNumber):
8549 (NP_DoubleFromNumber):
8550 * bindings/NP_runtime.h:
8551
85522004-03-02 Richard Williamson <rjw@apple.com>
8553
8554 Removed retain/release from NP_Class. Classes will not be allowed to implement their
8555 own customer retain/release scheme.
8556
8557 Reviewed by Chris.
8558
8559 * bindings/NP_runtime.cpp:
8560 (NP_RetainObject):
8561 (NP_ReleaseObject):
8562 * bindings/NP_runtime.h:
8563
85642004-03-02 Richard Williamson <rjw@apple.com>
8565
8566 C binding API. Partial implementation.
8567
8568 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.
8569
8570 Factored root object reference counting scheme. It is now useful independent
8571 of LiveConnect.
8572
8573 Reviewed by Chris.
8574
8575 * JavaScriptCore.pbproj/project.pbxproj:
8576 * bindings/NP_runtime.cpp: Added.
8577 (NP_IdentifierFromUTF8):
8578 (NP_GetIdentifiers):
8579 (NP_UTF8FromIdentifier):
8580 (NP_CreateObject):
8581 (NP_RetainObject):
8582 (NP_ReleaseObject):
8583 (NP_IsKindOfClass):
8584 (NP_SetException):
8585 (NP_Call):
8586 (NP_Evaluate):
8587 (NP_GetProperty):
8588 (NP_SetProperty):
8589 (NP_RemoveProperty):
8590 (NP_ToString):
8591 (NP_GetPropertyAtIndex):
8592 (NP_SetPropertyAtIndex):
8593 (NP_CreateNumberWithInt):
8594 (NP_CreateNumberWithFloat):
8595 (NP_CreateNumberWithDouble):
8596 (NP_IntFromNumber):
8597 (NP_FloatFromNumber):
8598 (NP_DoubleFromNumber):
8599 (NP_CreateStringWithUTF8):
8600 (NP_CreateStringWithUTF16):
8601 (NP_UTF8FromString):
8602 (NP_UTF16FromString):
8603 (NP_CreateBoolean):
8604 (NP_BoolFromBoolean):
8605 (NP_GetNull):
8606 (NP_GetUndefined):
8607 (NP_CreateArray):
8608 (NP_CreateArrayV):
8609 (NP_ObjectAtIndex):
8610 * bindings/NP_runtime.h: Added.
8611 * bindings/jni/jni_jsobject.cpp:
8612 (JSObject::invoke):
8613 (JSObject::finalize):
8614 (JSObject::createNative):
8615 (JSObject::convertValueToJObject):
8616 * bindings/jni/jni_jsobject.h:
8617 * bindings/objc/objc_jsobject.h:
8618 * bindings/objc/objc_jsobject.mm:
8619 (rootForView):
8620 (windowJavaScriptObject):
8621 (-[JavaScriptObject initWithObjectImp:KJS::root:Bindings::]):
8622 (-[JavaScriptObject dealloc]):
8623 (-[JavaScriptObject _convertValueToObjcValue:KJS::]):
8624 (-[JavaScriptObject call:arguments:]):
8625 (-[JavaScriptObject evaluate:]):
8626 (-[JavaScriptObject getMember:]):
8627 (-[JavaScriptObject setMember:value:]):
8628 (-[JavaScriptObject removeMember:]):
8629 (-[JavaScriptObject toString]):
8630 (-[JavaScriptObject getSlot:]):
8631 (-[JavaScriptObject setSlot:value:]):
8632 * bindings/objc/objc_utility.h:
8633 * bindings/objc/objc_utility.mm:
8634 (KJS::Bindings::convertValueToObjcValue):
8635 * bindings/runtime_root.cpp: Added.
8636 (getReferencesByRootDictionary):
8637 (getReferencesDictionary):
8638 (KJS::Bindings::findReferenceDictionary):
8639 (KJS::Bindings::rootForImp):
8640 (KJS::Bindings::addNativeReference):
8641 (KJS::Bindings::removeNativeReference):
8642 (completedJavaScriptAccess):
8643 (initializeJavaScriptAccessLock):
8644 (lockJavaScriptAccess):
8645 (unlockJavaScriptAccess):
8646 (RootObject::dispatchToJavaScriptThread):
8647 (performJavaScriptAccess):
8648 (RootObject::setFindRootObjectForNativeHandleFunction):
8649 (RootObject::removeAllNativeReferences):
8650 * bindings/runtime_root.h: Added.
8651 (KJS::Bindings::RootObject::RootObject):
8652 (KJS::Bindings::RootObject::~RootObject):
8653 (KJS::Bindings::RootObject::setRootObjectImp):
8654 (KJS::Bindings::RootObject::rootObjectImp):
8655 (KJS::Bindings::RootObject::setInterpreter):
8656 (KJS::Bindings::RootObject::interpreter):
8657 (KJS::Bindings::RootObject::findRootObjectForNativeHandleFunction):
8658 (KJS::Bindings::RootObject::runLoop):
8659 (KJS::Bindings::RootObject::performJavaScriptSource):
8660
8661=== Safari-130 ===
8662
8663=== Safari-129 ===
8664
86652004-02-18 Richard Williamson <rjw@apple.com>
8666
8667 Added NSNumber/Number conversion.
8668
8669 Removed some unnecessary KJS:: namespace specifiers.
8670
8671 Reviewed by Ken.
8672
8673 * bindings/objc/objc_utility.mm:
8674 (KJS::Bindings::convertValueToObjcValue):
8675 (KJS::Bindings::convertObjcValueToValue):
8676 * bindings/runtime_array.h:
8677
86782004-02-18 Richard Williamson <rjw@apple.com>
8679
8680 Added support for export NSArrays.
8681
8682 Updated valueAt() to take an ExecState so we can throw
8683 JS exceptions.
8684
8685 Implemented excludeSelectorFromJavaScript: in ObjcClass. This allows
8686 ObjectiveC classes to control the visibility of their methods in
8687 JavaScript.
8688
8689 Reviewed by Ken.
8690
8691 * bindings/jni/jni_runtime.cpp:
8692 (JavaField::valueFromInstance):
8693 (JavaArray::valueAt):
8694 * bindings/jni/jni_runtime.h:
8695 * bindings/objc/objc_class.mm:
8696 (ObjcClass::methodsNamed):
8697 * bindings/objc/objc_runtime.h:
8698 (KJS::Bindings::ObjcArray::getObjcArray):
8699 * bindings/objc/objc_runtime.mm:
8700 (ObjcField::valueFromInstance):
8701 (ObjcField::setValueToInstance):
8702 (ObjcArray::ObjcArray):
8703 (ObjcArray::~ObjcArray):
8704 (ObjcArray::operator=):
8705 (ObjcArray::setValueAt):
8706 (ObjcArray::valueAt):
8707 (ObjcArray::getLength):
8708 * bindings/objc/objc_utility.mm:
8709 (KJS::Bindings::convertValueToObjcValue):
8710 (KJS::Bindings::convertObjcValueToValue):
8711 * bindings/runtime.cpp:
8712 (Instance::getValueOfField):
8713 * bindings/runtime.h:
8714 * bindings/runtime_array.cpp:
8715 (RuntimeArrayImp::get):
8716 * bindings/runtime_object.cpp:
8717 (RuntimeObjectImp::get):
8718
87192004-02-17 Richard Williamson <rjw@apple.com>
8720
8721 Added String <-> NSString conversion.
8722 Added tests of String <-> NSString conversion to test program.
8723
8724 Reviewed by Chris.
8725
8726 * bindings/objc/objc_utility.mm:
8727 (KJS::Bindings::convertValueToObjcValue):
8728 (KJS::Bindings::convertObjcValueToValue):
8729 * bindings/test.js:
8730 * bindings/testbindings.mm:
8731 (-[MyFirstInterface getString]):
8732
87332004-02-15 Darin Adler <darin@apple.com>
8734
8735 Reviewed by Dave.
8736
8737 * JavaScriptCore.pbproj/project.pbxproj: Tweak build styles a bit, fixing OptimizedWithSymbols,
8738 and removing redundant settings of things that match defaults in other build styles.
8739
87402004-02-13 Richard Williamson <rjw@apple.com>
8741
8742 Work towards the JavaScript ObjC bindings. The bindings now work for
8743 simple scalar types. testbindings.mm is an illustration of how the
8744 bindings work.
8745
8746 Reviewed by Ken.
8747
8748 * JavaScriptCore.pbproj/project.pbxproj:
8749 * Makefile.am:
8750 * bindings/jni/jni_class.cpp:
8751 (JavaClass::methodsNamed):
8752 * bindings/jni/jni_class.h:
8753 * bindings/jni/jni_instance.cpp:
8754 (JavaInstance::invokeMethod):
8755 * bindings/jni/jni_instance.h:
8756 * bindings/jni/jni_runtime.h:
8757 (KJS::Bindings::JavaMethod::returnType):
8758 * bindings/make_testbindings: Added.
8759 * bindings/objc/objc_class.h: Added.
8760 (KJS::Bindings::ObjcClass::~ObjcClass):
8761 (KJS::Bindings::ObjcClass::ObjcClass):
8762 (KJS::Bindings::ObjcClass::operator=):
8763 (KJS::Bindings::ObjcClass::constructorAt):
8764 (KJS::Bindings::ObjcClass::numConstructors):
8765 * bindings/objc/objc_class.mm: Added.
8766 (ObjcClass::_commonDelete):
8767 (ObjcClass::_commonCopy):
8768 (ObjcClass::_commonInit):
8769 (_createClassesByIsAIfNecessary):
8770 (ObjcClass::classForIsA):
8771 (ObjcClass::ObjcClass):
8772 (ObjcClass::name):
8773 (ObjcClass::methodsNamed):
8774 (ObjcClass::fieldNamed):
8775 * bindings/objc/objc_header.h: Added.
8776 * bindings/objc/objc_instance.h: Added.
8777 (KJS::Bindings::ObjcInstance::getObject):
8778 * bindings/objc/objc_instance.mm: Added.
8779 (ObjcInstance::ObjcInstance):
8780 (ObjcInstance::~ObjcInstance):
8781 (ObjcInstance::operator=):
8782 (ObjcInstance::begin):
8783 (ObjcInstance::end):
8784 (ObjcInstance::getClass):
8785 (ObjcInstance::invokeMethod):
8786 (ObjcInstance::defaultValue):
8787 (ObjcInstance::stringValue):
8788 (ObjcInstance::numberValue):
8789 (ObjcInstance::booleanValue):
8790 (ObjcInstance::valueOf):
8791 * bindings/objc/objc_jsobject.h: Added.
8792 * bindings/objc/objc_jsobject.mm: Added.
8793 * bindings/objc/objc_runtime.h:
8794 (KJS::Bindings::ObjcField::~ObjcField):
8795 (KJS::Bindings::ObjcField::ObjcField):
8796 (KJS::Bindings::ObjcField::operator=):
8797 (KJS::Bindings::ObjcMethod::ObjcMethod):
8798 (KJS::Bindings::ObjcMethod::~ObjcMethod):
8799 (KJS::Bindings::ObjcMethod::operator=):
8800 * bindings/objc/objc_runtime.mm: Added.
8801 (ObjcMethod::ObjcMethod):
8802 (ObjcMethod::name):
8803 (ObjcMethod::numParameters):
8804 (ObjcMethod::getMethodSignature):
8805 (ObjcField::ObjcField):
8806 (ObjcField::name):
8807 (ObjcField::type):
8808 (ObjcField::valueFromInstance):
8809 (ObjcField::setValueToInstance):
8810 * bindings/objc/objc_utility.h: Added.
8811 (KJS::Bindings::):
8812 * bindings/objc/objc_utility.mm: Added.
8813 (KJS::Bindings::JSMethodNameToObjCMethodName):
8814 (KJS::Bindings::convertValueToObjcValue):
8815 (KJS::Bindings::convertObjcValueToValue):
8816 (KJS::Bindings::objcValueTypeForType):
8817 * bindings/runtime.cpp:
8818 (MethodList::MethodList):
8819 (MethodList::operator=):
8820 (Instance::setValueOfField):
8821 (Instance::createBindingForLanguageInstance):
8822 (Instance::createRuntimeObject):
8823 * bindings/runtime.h:
8824 * bindings/runtime_method.cpp:
8825 (RuntimeMethodImp::RuntimeMethodImp):
8826 (RuntimeMethodImp::get):
8827 (RuntimeMethodImp::call):
8828 * bindings/runtime_method.h:
8829 * bindings/runtime_object.cpp:
8830 (RuntimeObjectImp::get):
8831 (RuntimeObjectImp::hasProperty):
8832 * bindings/test.js: Added.
8833 * bindings/testbindings.mm: Added.
8834 (-[MySecondInterface init]):
8835 (-[MyFirstInterface init]):
8836 (-[MyFirstInterface dealloc]):
8837 (+[MyFirstInterface JavaScriptNameForSelector:]):
8838 (-[MyFirstInterface getInt]):
8839 (-[MyFirstInterface setInt:]):
8840 (-[MyFirstInterface getMySecondInterface]):
8841 (-[MyFirstInterface logMessage:]):
8842 (GlobalImp::className):
8843 (readJavaScriptFromFile):
8844 (main):
8845
8846=== Safari-128 ===
8847
88482004-02-08 Darin Adler <darin@apple.com>
8849
8850 Reviewed by Dave.
8851
8852 - fixed things seen in the profile, for a total speedup of 4% on cvs-base (including changes across all projects)
8853
8854 * JavaScriptCorePrefix.h: Add a workaround for a bug in our system headers that prevents the <ctype.h>
8855 macros from working right in C++ code that uses the <cctype> header.
8856
8857 * kjs/ustring.cpp:
8858 (KJS::inlineUTF8SequenceLengthNonASCII): Added.
8859 (KJS::UTF8SequenceLengthNonASCII): Added.
8860 (KJS::inlineUTF8SequenceLength): Added.
8861 (KJS::UTF8SequenceLength): Calls inlineUTF8SequenceLengthNonASCII now.
8862 (KJS::decodeUTF8Sequence): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
8863 (KJS::createSortedOffsetsArray): Add special case for 1, 2, and 3 offsets, so we don't do qsort for those.
8864 (KJS::convertUTF16OffsetsToUTF8Offsets): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
8865 (KJS::convertUTF8OffsetsToUTF16Offsets): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
8866
8867 - fixed the test program so it won't hit the interpreter lock assertion
8868
8869 * kjs/testkjs.cpp: (main): Just lock around the whole thing, since the test is singly threaded.
8870
8871=== Safari-127 ===
8872
88732004-02-06 Richard Williamson <rjw@apple.com>
8874
8875 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.
8876
8877 Reviewed by John.
8878
8879 * bindings/jni/jni_jsobject.cpp:
8880 (JSObject::toString):
8881 * bindings/jni/jni_utility.cpp:
8882 (KJS::Bindings::convertValueToJValue):
8883
88842004-02-02 Darin Adler <darin@apple.com>
8885
8886 Reviewed by Maciej.
8887
8888 - fixed <rdar://problem/3546613>: array of negative size leads to crash (test page at oscar.the-rileys.net)
8889
8890 * kjs/array_object.cpp:
8891 (ArrayInstanceImp::ArrayInstanceImp): If the length is greater than 10,000, don't allocate an array until
8892 we start putting values in. This prevents new Array(2147483647) from causing trouble.
8893 (ArrayObjectImp::construct): Check number as described in specification, and raise a range error if the
8894 number is out of range. This prevents new Array(-1) from causing trouble.
8895
8896 - fixed <rdar://problem/3545756>: Math.round screws up on numbers bigger than 2^31 (incorrect results on HP-35 calculator page)
8897
8898 * kjs/math_object.cpp: (MathFuncImp::call): Change implementation to be much simpler and not involve
8899 casting to int. Results now match those in other browsers.
8900
89012004-02-02 Darin Adler <darin@apple.com>
8902
8903 Reviewed by Maciej.
8904
8905 - fixed <rdar://problem/3519285>: integer operations on large negative numbers yield bad results (discovered with "HTMLCrypt")
8906 - fixed other related overflow issues
8907
8908 * kjs/value.h: Changed return types of toInteger, toInt32, toUInt32, and toUInt16.
8909 * kjs/value.cpp:
8910 (ValueImp::toInteger): Change to return a double, since this operation, from the ECMA specification,
8911 must not restrict values to the range of a particular integer type.
8912 (ValueImp::toInt32): Used a sized integer type for the result of this function, and also added
8913 proper handling for negative results from fmod.
8914 (ValueImp::toUInt32): Ditto.
8915 (ValueImp::toUInt16): Ditto.
8916 (ValueImp::dispatchToUInt32): Changed result type from unsigned to uint32_t.
8917
8918 * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Use a double instead of an int to handle
8919 out-of-integer-range values better in the slice function.
8920 * kjs/internal.cpp: (KJS::roundValue): Streamline the function, handling NAN and infinity properly.
8921 * kjs/number_object.cpp: (NumberProtoFuncImp::call): Use a double instead of an int to handle
8922 out-of-integer-range values better in the toString function.
8923 * kjs/string_object.cpp: (StringProtoFuncImp::call): Use a double instead of an int to handle
8924 out-of-integer-range values better in the charAt, charCodeAt, indexOf, lastIndexOf, slice,
8925 and substr functions.
8926
8927=== Safari-126 ===
8928
89292004-01-30 Richard Williamson <rjw@apple.com>
8930
8931 Fixed 3542044. Create KJS::String using UString constructor instead of passing UTF8 string to char* constructor.
8932
8933 Reviewed by Darin.
8934
8935 * bindings/jni/jni_instance.cpp:
8936 (JavaInstance::stringValue):
8937
89382004-01-26 Darin Adler <darin@apple.com>
8939
8940 * Makefile.am: Switch from pbxbuild to xcodebuild.
8941
89422004-01-22 Richard Williamson <rjw@apple.com>
8943
8944 Added stubs for ObjC language binding to JavaScript.
8945
8946 * JavaScriptCore.pbproj/project.pbxproj:
8947 * bindings/jni/jni_runtime.h:
8948 * bindings/objc/objc_runtime.h: Added.
8949 (KJS::Bindings::ObjcParameter::ObjcParameter):
8950 (KJS::Bindings::ObjcParameter::~ObjcParameter):
8951 (KJS::Bindings::ObjcParameter::operator=):
8952 (KJS::Bindings::ObjcParameter::type):
8953 (KJS::Bindings::ObjcConstructor::ObjcConstructor):
8954 (KJS::Bindings::ObjcConstructor::~ObjcConstructor):
8955 (KJS::Bindings::ObjcConstructor::_commonCopy):
8956 (KJS::Bindings::ObjcConstructor::operator=):
8957 (KJS::Bindings::ObjcConstructor::value):
8958 (KJS::Bindings::ObjcConstructor::parameterAt):
8959 (KJS::Bindings::ObjcConstructor::numParameters):
8960 (KJS::Bindings::ObjcField::ObjcField):
8961 (KJS::Bindings::ObjcField::~ObjcField):
8962 * bindings/runtime.h:
8963
89642004-01-22 Richard Williamson <rjw@apple.com>
8965
8966 Simplified JavaString by using UString as backing store. This
8967 revealed a bug in CString's assignment operator which I fixed.
8968
8969 Removed some dead code.
8970
8971 Reviewed by John.
8972
8973 * bindings/jni/jni_runtime.h:
8974 (KJS::Bindings::JavaString::JavaString):
8975 (KJS::Bindings::JavaString::_commonInit):
8976 (KJS::Bindings::JavaString::UTF8String):
8977 (KJS::Bindings::JavaString::uchars):
8978 (KJS::Bindings::JavaString::length):
8979 (KJS::Bindings::JavaString::ustring):
8980 * bindings/runtime_object.cpp:
8981 (RuntimeObjectImp::RuntimeObjectImp):
8982 * bindings/runtime_object.h:
8983 * kjs/ustring.cpp:
8984 (KJS::CString::CString):
8985 (KJS::CString::operator=):
8986
8987=== Safari-125 ===
8988
8989=== Safari-124 ===
8990
89912004-01-16 Richard Williamson <rjw@apple.com>
8992
8993 Fixed 3525853. We weren't handling mapping to overloaded Java
8994 methods very well. Even though this is undefined the other
8995 browsers support it. Also fixed a bug with returning arrays
8996 from Java functions.
8997
8998 Reviewed by John.
8999
9000 * bindings/jni/jni_class.cpp:
9001 (JavaClass::_commonInit):
9002 (JavaClass::methodsNamed):
9003 * bindings/jni/jni_class.h:
9004 * bindings/jni/jni_instance.cpp:
9005 (JavaInstance::invokeMethod):
9006 * bindings/jni/jni_instance.h:
9007 * bindings/jni/jni_runtime.cpp:
9008 (JavaArray::convertJObjectToArray):
9009 (JavaField::valueFromInstance):
9010 (JavaMethod::signature):
9011 (JavaArray::valueAt):
9012 * bindings/jni/jni_runtime.h:
9013 * bindings/jni_jsobject.cpp:
9014 (JSObject::call):
9015 (JSObject::convertJObjectToValue):
9016 * bindings/runtime.cpp:
9017 (MethodList::addMethod):
9018 (MethodList::length):
9019 (MethodList::methodAt):
9020 (MethodList::~MethodList):
9021 * bindings/runtime.h:
9022 (KJS::Bindings::MethodList::MethodList):
9023 * bindings/runtime_method.cpp:
9024 (RuntimeMethodImp::RuntimeMethodImp):
9025 (RuntimeMethodImp::get):
9026 (RuntimeMethodImp::call):
9027 * bindings/runtime_method.h:
9028 * bindings/runtime_object.cpp:
9029 (RuntimeObjectImp::get):
9030 (RuntimeObjectImp::hasProperty):
9031
90322004-01-16 Richard Williamson <rjw@apple.com>
9033
9034 Fixed 3531229. Another place that needs the Push/PopLocalFrame
9035 protection implemented for 3530401.
9036
9037 Reviewed by John.
9038
9039 * bindings/runtime_method.cpp:
9040 (RuntimeMethodImp::call):
9041
90422004-01-15 Richard Williamson <rjw@apple.com>
9043
9044 Fixed 3530401. JNI doesn't cleanup local refs created on the
9045 main thread. IMO this is a bad bug in our JMI implementation.
9046
9047 To work-around the problem I explicitly delete all local refs.
9048 Further, I've added Push/PopLocalFrame calls to catch any refs
9049 that I may have missed. This will guarantee that we don't leak
9050 any Java references.
9051
9052 Reviewed by John.
9053
9054 * bindings/jni/jni_class.cpp:
9055 (JavaClass::_commonInit):
9056 (JavaClass::JavaClass):
9057 * bindings/jni/jni_instance.cpp:
9058 (JavaInstance::begin):
9059 (JavaInstance::end):
9060 * bindings/jni/jni_instance.h:
9061 * bindings/jni/jni_runtime.cpp:
9062 (JavaConstructor::JavaConstructor):
9063 (JavaMethod::JavaMethod):
9064 * bindings/jni_jsobject.cpp:
9065 (JSObject::listFromJArray):
9066 * bindings/runtime.h:
9067 (KJS::Bindings::Instance::begin):
9068 (KJS::Bindings::Instance::end):
9069 * bindings/runtime_object.cpp:
9070 (RuntimeObjectImp::get):
9071 (RuntimeObjectImp::put):
9072 (RuntimeObjectImp::canPut):
9073 (RuntimeObjectImp::hasProperty):
9074 (RuntimeObjectImp::defaultValue):
9075
90762004-01-15 Vicki Murley <vicki@apple.com>
9077
9078 Reviewed by Darin.
9079
9080 * JavaScriptCore.pbproj/project.pbxproj: Update copyright date to 2004.
9081
90822004-01-14 Richard Williamson <rjw@apple.com>
9083
9084 Fixed 3529466. With recent changes to Java plugin we must no
9085 longer call DeleteLocalRef(). Not a problem, it was an optimization anyway.
9086
9087 Reviewed by John.
9088
9089 * bindings/jni/jni_instance.cpp:
9090 (JObjectWrapper::JObjectWrapper):
9091
9092=== Safari-122 ===
9093
90942004-01-14 Richard Williamson <rjw@apple.com>
9095
9096 Fixed 3529010.
9097
9098 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.
9099
9100 Reviewed by John.
9101
9102 * bindings/jni_jsobject.cpp:
9103 (addJavaReference):
9104 (removeJavaReference):
9105 (RootObject::removeAllJavaReferencesForRoot):
9106 (JSObject::invoke):
9107
91082004-01-13 Richard Williamson <rjw@apple.com>
9109
9110 Fixed 3528324.
9111
9112 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.
9113
9114 Reviewed by Hyatt.
9115
9116 * bindings/jni_jsobject.h:
9117 (KJS::Bindings::RootObject::~RootObject):
9118
9119=== Safari-121 ===
9120
9121=== Safari-120 ===
9122
91232004-01-06 Richard Williamson <rjw@apple.com>
9124
9125 Fixed 3521814. Finalize messages weren't being dispatched!
9126
9127 Reviewed by John.
9128
9129 * bindings/jni_jsobject.cpp:
9130 (JSObject::invoke):
9131
91322004-01-05 Richard Williamson <rjw@apple.com>
9133
9134 Added cache of JNI method IDs to minimize allocations. This mitigates the problem
9135 described by 3515579.
9136
9137 Also cleanup up logging of Java exceptions.
9138
9139 Reviewed by John.
9140
9141 * bindings/jni/jni_class.cpp:
9142 (JavaClass::classForInstance):
9143 * bindings/jni/jni_instance.cpp:
9144 (JavaInstance::JavaInstance):
9145 (JavaInstance::getClass):
9146 (JavaInstance::invokeMethod):
9147 (JObjectWrapper::JObjectWrapper):
9148 (JObjectWrapper::~JObjectWrapper):
9149 * bindings/jni/jni_instance.h:
9150 (KJS::Bindings::JavaInstance::operator=):
9151 * bindings/jni/jni_runtime.cpp:
9152 (JavaMethod::JavaMethod):
9153 (JavaMethod::methodID):
9154 * bindings/jni/jni_runtime.h:
9155 (KJS::Bindings::JavaMethod::JavaMethod):
9156 * bindings/jni/jni_utility.cpp:
9157 (callJNIMethod):
9158 (callJNIMethodIDA):
9159 (callJNIMethodA):
9160 (KJS::Bindings::getMethodID):
9161 (KJS::Bindings::callJNIVoidMethodIDA):
9162 (KJS::Bindings::callJNIObjectMethodIDA):
9163 (KJS::Bindings::callJNIByteMethodIDA):
9164 (KJS::Bindings::callJNICharMethodIDA):
9165 (KJS::Bindings::callJNIShortMethodIDA):
9166 (KJS::Bindings::callJNIIntMethodIDA):
9167 (KJS::Bindings::callJNILongMethodIDA):
9168 (KJS::Bindings::callJNIFloatMethodIDA):
9169 (KJS::Bindings::callJNIDoubleMethodIDA):
9170 (KJS::Bindings::callJNIBooleanMethodIDA):
9171 (KJS::Bindings::getCharactersFromJStringInEnv):
9172 (KJS::Bindings::getUCharactersFromJStringInEnv):
9173 (KJS::Bindings::getJNIField):
9174 * bindings/jni/jni_utility.h:
9175
9176l2003-12-23 John Sullivan <sullivan@apple.com>
9177
9178 * JavaScriptCore.pbproj/project.pbxproj:
9179 Xcode version wars, harmless
9180
91812003-12-23 Darin Adler <darin@apple.com>
9182
9183 Reviewed by John (concept, not code, which is just the old code coming back).
9184
9185 - fixed 3518092: REGRESSION (100-119): getting NaN instead of HH:MM times
9186
9187 * kjs/date_object.cpp: Added back our CF-based implementations of gmtime, localtime,
9188 mktime, timegm, and time, because mktime, at least, won't handle a year of 0.
9189
91902003-12-19 Richard Williamson <rjw@apple.com>
9191
9192 Fixed 3515597. When an error occurs we need
9193 to make sure result values are zeroed.
9194
9195 Cleaned up logs by adding a newline.
9196
9197 Reviewed by John.
9198
9199 * bindings/jni/jni_utility.cpp:
9200 (KJS::Bindings::getJavaVM):
9201 (KJS::Bindings::getJNIEnv):
9202 (callJNIMethod):
9203 (callJNIMethodA):
9204 (KJS::Bindings::getJNIField):
9205 * bindings/jni_jsobject.cpp:
9206 (JSObject::convertValueToJObject):
9207
9208=== Safari-119 ===
9209
92102003-12-17 Richard Williamson <rjw@apple.com>
9211
9212 Ensure that all the symbols we export are in the KJS
9213 namespace (3512245).
9214
9215 Also renamed JavaString.characters() to JavaString.UTF8String()
9216 for enhanced clarity.
9217
9218 Added some sanity checking to constructor of JObjectWrapper.
9219
9220 Reviewed by Dave.
9221
9222 * ChangeLog:
9223 * bindings/jni/jni_class.cpp:
9224 * bindings/jni/jni_class.h:
9225 * bindings/jni/jni_instance.cpp:
9226 (JavaInstance::invokeMethod):
9227 (JObjectWrapper::JObjectWrapper):
9228 * bindings/jni/jni_instance.h:
9229 * bindings/jni/jni_runtime.cpp:
9230 (JavaParameter::JavaParameter):
9231 (JavaField::JavaField):
9232 (JavaMethod::JavaMethod):
9233 (JavaMethod::signature):
9234 * bindings/jni/jni_runtime.h:
9235 (KJS::Bindings::JavaString::ascii):
9236 (KJS::Bindings::JavaString::UTF8String):
9237 (KJS::Bindings::JavaString::JavaString):
9238 (KJS::Bindings::JavaString::_commonInit):
9239 (KJS::Bindings::JavaString::uchars):
9240 (KJS::Bindings::JavaString::length):
9241 (KJS::Bindings::JavaString::ustring):
9242 (KJS::Bindings::JavaParameter::type):
9243 (KJS::Bindings::JavaField::name):
9244 (KJS::Bindings::JavaField::type):
9245 (KJS::Bindings::JavaMethod::name):
9246 (KJS::Bindings::JavaMethod::returnType):
9247 * bindings/jni/jni_utility.cpp:
9248 (KJS::Bindings::getJavaVM):
9249 (KJS::Bindings::getJNIEnv):
9250 (KJS::Bindings::callJNIVoidMethod):
9251 (KJS::Bindings::callJNIObjectMethod):
9252 (KJS::Bindings::callJNIBooleanMethod):
9253 (KJS::Bindings::callJNIByteMethod):
9254 (KJS::Bindings::callJNICharMethod):
9255 (KJS::Bindings::callJNIShortMethod):
9256 (KJS::Bindings::callJNIIntMethod):
9257 (KJS::Bindings::callJNILongMethod):
9258 (KJS::Bindings::callJNIFloatMethod):
9259 (KJS::Bindings::callJNIDoubleMethod):
9260 (KJS::Bindings::callJNIVoidMethodA):
9261 (KJS::Bindings::callJNIObjectMethodA):
9262 (KJS::Bindings::callJNIByteMethodA):
9263 (KJS::Bindings::callJNICharMethodA):
9264 (KJS::Bindings::callJNIShortMethodA):
9265 (KJS::Bindings::callJNIIntMethodA):
9266 (KJS::Bindings::callJNILongMethodA):
9267 (KJS::Bindings::callJNIFloatMethodA):
9268 (KJS::Bindings::callJNIDoubleMethodA):
9269 (KJS::Bindings::callJNIBooleanMethodA):
9270 (KJS::Bindings::getCharactersFromJString):
9271 (KJS::Bindings::releaseCharactersForJString):
9272 (KJS::Bindings::getCharactersFromJStringInEnv):
9273 (KJS::Bindings::releaseCharactersForJStringInEnv):
9274 (KJS::Bindings::getUCharactersFromJStringInEnv):
9275 (KJS::Bindings::releaseUCharactersForJStringInEnv):
9276 (KJS::Bindings::JNITypeFromClassName):
9277 (KJS::Bindings::signatureFromPrimitiveType):
9278 (KJS::Bindings::JNITypeFromPrimitiveType):
9279 (KJS::Bindings::getJNIField):
9280 (KJS::Bindings::convertValueToJValue):
9281 * bindings/jni/jni_utility.h:
9282 * bindings/jni_jsobject.cpp:
9283 (KJS::Bindings::JSObject::invoke):
9284 (KJS::Bindings::JSObject::JSObject):
9285 (KJS::Bindings::JSObject::call):
9286 (KJS::Bindings::JSObject::eval):
9287 (KJS::Bindings::JSObject::getMember):
9288 (KJS::Bindings::JSObject::setMember):
9289 (KJS::Bindings::JSObject::removeMember):
9290 (KJS::Bindings::JSObject::getSlot):
9291 (KJS::Bindings::JSObject::setSlot):
9292 (KJS::Bindings::JSObject::toString):
9293 (KJS::Bindings::JSObject::finalize):
9294 (KJS::Bindings::JSObject::createNative):
9295 (KJS::Bindings::JSObject::convertValueToJObject):
9296 (KJS::Bindings::JSObject::convertJObjectToValue):
9297 (KJS::Bindings::JSObject::listFromJArray):
9298 * bindings/jni_jsobject.h:
9299 * bindings/runtime.cpp:
9300 * bindings/runtime.h:
9301 * bindings/runtime_method.cpp:
9302 * bindings/runtime_method.h:
9303
9304=== Safari-118 ===
9305
93062003-12-16 Richard Williamson <rjw@apple.com>
9307
9308 Ack! More assertions. Lock ALL entry points into the interpreter!
9309 (3511733).
9310
9311 Reviewed by Ken.
9312
9313 * bindings/jni_jsobject.cpp:
9314 (Bindings::JSObject::call):
9315 (Bindings::JSObject::eval):
9316 (Bindings::JSObject::getMember):
9317 (Bindings::JSObject::setMember):
9318 (Bindings::JSObject::removeMember):
9319 (Bindings::JSObject::getSlot):
9320 (Bindings::JSObject::setSlot):
9321 (Bindings::JSObject::convertJObjectToValue):
9322
93232003-12-15 Richard Williamson <rjw@apple.com>
9324
9325 Fixed a couple of snafus and removed some logging.
9326
9327 Reviewed by Maciej.
9328
9329 * bindings/jni_jsobject.cpp:
9330 (Bindings::performJavaScriptAccess):
9331 (Bindings::completedJavaScriptAccess):
9332 (Bindings::dispatchToJavaScriptThread):
9333 Removed some annoying JS_LOG clutter.
9334
9335 (Bindings::RootObject::removeAllJavaReferencesForRoot):
9336 Fixed allocation of key buffer that was called after it was needed.
9337
9338 (Bindings::JSObject::invoke):
9339 (Bindings::JSObject::JSObject):
9340 (Bindings::JSObject::getMember):
9341 (Bindings::JSObject::getSlot):
9342 Added additional interpreter locks around getMember and getSlot.
9343 These functions may cause allocation of JS impls.
9344
93452003-12-15 Richard Williamson <rjw@apple.com>
9346
9347 args weren't passed to 'call' invocation. d'oh.
9348 lock interpreter when we create instances of JS impls.
9349
9350 Reviewed by Maciej.
9351
9352 * bindings/jni_jsobject.cpp:
9353 (Bindings::JSObject::call):
9354 (Bindings::JSObject::eval):
9355 (Bindings::JSObject::getMember):
9356 (Bindings::JSObject::setMember):
9357 (Bindings::JSObject::getSlot):
9358 (Bindings::JSObject::convertValueToJObject):
9359 (Bindings::JSObject::convertJObjectToValue):
9360 (Bindings::JSObject::listFromJArray):
9361 * bindings/jni_jsobject.h:
9362
93632003-12-15 Richard Williamson <rjw@apple.com>
9364
9365 Last piece of LiveConnect! This checkin adds implementation
9366 of the Java to JavaScript object conversion functions.
9367
9368 Reviewed by John.
9369
9370 * bindings/jni/jni_instance.cpp:
9371 (JavaInstance::invokeMethod):
9372 * bindings/jni/jni_utility.cpp:
9373 * bindings/jni/jni_utility.h:
9374 * bindings/jni_jsobject.cpp:
9375 (Bindings::JSObject::invoke):
9376 (Bindings::JSObject::call):
9377 (Bindings::JSObject::eval):
9378 (Bindings::JSObject::getMember):
9379 (Bindings::JSObject::setMember):
9380 (Bindings::JSObject::getSlot):
9381 (Bindings::JSObject::setSlot):
9382 (Bindings::JSObject::createNative):
9383 (Bindings::JSObject::convertValueToJObject):
9384 (Bindings::JSObject::convertJObjectToValue):
9385 (Bindings::JSObject::listFromJArray):
9386 * bindings/jni_jsobject.h:
9387 (Bindings::):
9388 * bindings/runtime_method.cpp:
9389 (RuntimeMethodImp::get):
9390 (RuntimeMethodImp::codeType):
9391 (RuntimeMethodImp::execute):
9392
93932003-12-12 Richard Williamson <rjw@apple.com>
9394
9395 Added implementation of stubs in JSObject. All that
9396 remains is a couple of simple conversion functions stubs and
9397 we're done with LiveConnect. Also, changed string passing to
9398 JS to use uchars instead of chars.
9399
9400 Reviewed by Maciej.
9401
9402 * bindings/jni/jni_runtime.h:
9403 (Bindings::JavaString::JavaString):
9404 (Bindings::JavaString::_commonInit):
9405 (Bindings::JavaString::_commonCopy):
9406 (Bindings::JavaString::_commonDelete):
9407 (Bindings::JavaString::~JavaString):
9408 (Bindings::JavaString::operator=):
9409 (Bindings::JavaString::uchars):
9410 (Bindings::JavaString::length):
9411 (Bindings::JavaString::ustring):
9412 * bindings/jni/jni_utility.cpp:
9413 (getUCharactersFromJStringInEnv):
9414 (releaseUCharactersForJStringInEnv):
9415 (convertValueToJObject):
9416 (convertJObjectToValue):
9417 * bindings/jni/jni_utility.h:
9418 * bindings/jni_jsobject.cpp:
9419 (Bindings::JSObject::invoke):
9420 (Bindings::JSObject::call):
9421 (Bindings::JSObject::eval):
9422 (Bindings::JSObject::getMember):
9423 (Bindings::JSObject::setMember):
9424 (Bindings::JSObject::removeMember):
9425 (Bindings::JSObject::getSlot):
9426 (Bindings::JSObject::setSlot):
9427 * bindings/jni_jsobject.h:
9428
94292003-12-12 Richard Williamson <rjw@apple.com>
9430
9431 Ensure that all calls from Java into JavaScript are
9432 performed on a designated thread (the main thread).
9433
9434 Reviewed by Ken.
9435
9436 * bindings/jni_jsobject.cpp:
9437 (isJavaScriptThread):
9438 (rootForImp):
9439 (Bindings::performJavaScriptAccess):
9440 (Bindings::completedJavaScriptAccess):
9441 (Bindings::initializeJavaScriptAccessLock):
9442 (Bindings::lockJavaScriptAccess):
9443 (Bindings::unlockJavaScriptAccess):
9444 (Bindings::dispatchToJavaScriptThread):
9445 (Bindings::RootObject::setFindRootObjectForNativeHandleFunction):
9446 (Bindings::RootObject::removeAllJavaReferencesForRoot):
9447 (Bindings::JSObject::invoke):
9448 (Bindings::JSObject::JSObject):
9449 (Bindings::JSObject::call):
9450 (Bindings::JSObject::eval):
9451 (Bindings::JSObject::getMember):
9452 (Bindings::JSObject::setMember):
9453 (Bindings::JSObject::removeMember):
9454 (Bindings::JSObject::getSlot):
9455 (Bindings::JSObject::setSlot):
9456 (Bindings::JSObject::toString):
9457 (Bindings::JSObject::finalize):
9458 (Bindings::JSObject::getWindow):
9459 * bindings/jni_jsobject.h:
9460 (Bindings::RootObject::~RootObject):
9461 (Bindings::RootObject::findRootObjectForNativeHandleFunction):
9462 (Bindings::RootObject::runLoop):
9463 (Bindings::RootObject::performJavaScriptSource):
9464 (Bindings::):
9465
94662003-12-11 Richard Williamson <rjw@apple.com>
9467
9468 Added support for calling a JavaScript function from
9469 Java. Right now this only works for void func(void)
9470 functions, but the conversion of args and return values
9471 will come shortly.
9472
9473 Cleaned up and verified reference counting scheme, and
9474 dereferencing of vended JavaScript objects when applet is
9475 destroyed (actually when part is destroyed).
9476
9477 Removed link hack for testkjs now that the Java folks think
9478 they have a solution for the 1.4.2 JavaVM link problem. Although
9479 Greg B. thinks his solution may cause problems for the 1.3.1
9480 version of the VM!?!
9481
9482 Reviewed by Ken.
9483
9484 * Makefile.am:
9485 * bindings/jni/jni_runtime.h:
9486 (Bindings::JavaString::JavaString):
9487 * bindings/jni/jni_utility.cpp:
9488 (convertValueToJValue):
9489 (convertValueToJObject):
9490 (listFromJArray):
9491 * bindings/jni/jni_utility.h:
9492 * bindings/jni_jsobject.cpp:
9493 (KJS_setFindRootObjectForNativeHandleFunction):
9494 (KJS_findRootObjectForNativeHandleFunction):
9495 (getReferencesByRootDictionary):
9496 (getReferencesDictionary):
9497 (findReferenceDictionary):
9498 (rootForImp):
9499 (addJavaReference):
9500 (removeJavaReference):
9501 * bindings/jni_jsobject.h:
9502 (Bindings::RootObject::RootObject):
9503 (Bindings::RootObject::~RootObject):
9504 (Bindings::RootObject::setRootObjectImp):
9505 (Bindings::RootObject::rootObjectImp):
9506 (Bindings::RootObject::setInterpreter):
9507 (Bindings::RootObject::interpreter):
9508
9509=== Safari-117 ===
9510
95112003-12-10 Darin Adler <darin@apple.com>
9512
9513 Reviewed by Maciej.
9514
9515 - fixed regression in JavaScript tests reported by the KDE guys
9516 - fixed 3506345: REGRESSION (115-116): VIP: chordfind.com no longer displays chords
9517
9518 * kjs/ustring.h: Add tolerateEmptyString parameter to toDouble and toULong.
9519 * kjs/ustring.cpp:
9520 (KJS::UString::toDouble): Separate the "tolerant" parameter into two separate ones:
9521 tolerateTrailingJunk and tolerateEmptyString. Add new overloads; better for code size
9522 and binary compatibility than default parameter values.
9523 (KJS::UString::toULong): Pass tolerateEmptyString down to toDouble. Add new overload.
9524
9525 * kjs/string_object.cpp: (StringProtoFuncImp::call): Pass false for the new
9526 "tolerate empty string" parameter.
9527
95282003-12-10 Richard Williamson <rjw@apple.com>
9529
9530 Added code to manage reference counting of JavaScript
9531 objects passed to Java. Also added implementation of
9532 KJS_JSCreateNativeJSObject. This is the function that
9533 provides the root object to Java (KJS::Window).
9534
9535 Reviewed by Hyatt.
9536
9537 * JavaScriptCore.pbproj/project.pbxproj:
9538 * bindings/jni_jsobject.cpp:
9539 (KJS_setFindObjectForNativeHandleFunction):
9540 (KJS_findObjectForNativeHandleFunction):
9541 (getReferencesByOwnerDictionary):
9542 (getReferencesDictionary):
9543 (findReferenceDictionary):
9544 (addJavaReference):
9545 (removeJavaReference):
9546 (removeAllJavaReferencesForOwner):
9547 * bindings/jni_jsobject.h:
9548
95492003-12-09 Richard Williamson <rjw@apple.com>
9550
9551 LiveConnect stubs that correspond to the native methods
9552 on JSObject. These will be called from the new Java plugin
9553 when an instance of JSObject is instantiated and messaged.
9554 When these are implemented the Java will be able to originate
9555 calls into JavaScript.
9556
9557 Also a temporary work-around added to Makefile.am to solve
9558 a link problem. The 1.4.2 JavaVM accidentally links against
9559 libobjc. This call a failure linking testkjs. Mike Hay is
9560 working with someone to fix the problem (3505587).
9561
9562 Reviewed by Chris.
9563
9564 * JavaScriptCore.pbproj/project.pbxproj:
9565 * Makefile.am:
9566 * bindings/jni_jsobject.cpp: Added.
9567 (KJS_JSCreateNativeJSObject):
9568 (KJS_JSObject_JSFinalize):
9569 (KJS_JSObject_JSObjectCall):
9570 (KJS_JSObject_JSObjectEval):
9571 (KJS_JSObject_JSObjectGetMember):
9572 (KJS_JSObject_JSObjectSetMember):
9573 (KJS_JSObject_JSObjectRemoveMember):
9574 (KJS_JSObject_JSObjectGetSlot):
9575 (KJS_JSObject_JSObjectSetSlot):
9576 (KJS_JSObject_JSObjectToString):
9577 * bindings/jni_jsobject.h: Added.
9578
95792003-12-09 Maciej Stachowiak <mjs@apple.com>
9580
9581 Reviewed by John.
9582
9583 <rdar://problem/3505183>: JavaScriptCore should assert that interpreter is locked in collector
9584
9585 * kjs/collector.cpp:
9586 (KJS::Collector::allocate): Assert that interpreter lock count is not 0.
9587 (KJS::Collector::collect): likewise
9588
95892003-12-08 Richard Williamson <rjw@apple.com>
9590
9591 LiveConnect: The last piece of the JavaScript side of the
9592 LiveConnect implementation. This change adds support for
9593 setting/getting values from Java arrays in JavaScript.
9594
9595 Reviewed by John.
9596
9597 * bindings/jni/jni_instance.h:
9598 * bindings/jni/jni_runtime.cpp:
9599 (JavaField::JavaField):
9600 (convertJObjectToArray):
9601 (JavaArray::JavaArray):
9602 (JavaArray::~JavaArray):
9603 (JavaArray::setValueAt):
9604 (JavaArray::valueAt):
9605 (JavaArray::getLength):
9606 * bindings/jni/jni_runtime.h:
9607 (Bindings::JavaArray::operator=):
9608 (Bindings::JavaArray::javaArray):
9609 * bindings/jni/jni_utility.cpp:
9610 (JNITypeFromPrimitiveType):
9611 (convertValueToJValue):
9612 * bindings/jni/jni_utility.h:
9613 * bindings/runtime.h:
9614 * bindings/runtime_array.cpp:
9615 (RuntimeArrayImp::RuntimeArrayImp):
9616 (RuntimeArrayImp::~RuntimeArrayImp):
9617 (RuntimeArrayImp::get):
9618 (RuntimeArrayImp::put):
9619 (RuntimeArrayImp::hasProperty):
9620 * bindings/runtime_array.h:
9621 (KJS::RuntimeArrayImp::getLength):
9622 (KJS::RuntimeArrayImp::getConcreteArray):
9623 * bindings/runtime_object.cpp:
9624 (RuntimeObjectImp::get):
9625 (RuntimeObjectImp::canPut):
9626 (RuntimeObjectImp::hasProperty):
9627
96282003-12-05 Richard Williamson <rjw@apple.com>
9629
9630 LiveConnect: Part 1 of supporting JS bindings to
9631 native language arrays.
9632
9633 Reviewed by Chris.
9634
9635 * JavaScriptCore.pbproj/project.pbxproj:
9636 * bindings/jni/jni_runtime.cpp:
9637 (JavaField::JavaField):
9638 (convertJObjectToArray):
9639 (JavaField::valueFromInstance):
9640 (JavaField::setValueToInstance):
9641 * bindings/jni/jni_runtime.h:
9642 * bindings/runtime.cpp:
9643 (Instance::setValueOfField):
9644 * bindings/runtime.h:
9645 (Bindings::Array::~Array):
9646
96472003-12-04 Richard Williamson <rjw@apple.com>
9648
9649 LiveConnect: Moved defaultValue into concrete implementation because
9650 more intelligent conversion can be perform with knowledge
9651 of the class of the original instance.
9652
9653 Reviewed by Chris.
9654
9655 * bindings/jni/jni_class.cpp:
9656 (JavaClass::isNumberClass):
9657 (JavaClass::isBooleanClass):
9658 (JavaClass::isStringClass):
9659 * bindings/jni/jni_class.h:
9660 * bindings/jni/jni_instance.cpp:
9661 (JavaInstance::defaultValue):
9662 (JavaInstance::valueOf):
9663 * bindings/jni/jni_instance.h:
9664 (Bindings::JavaInstance::javaInstance):
9665 * bindings/runtime.h:
9666 * bindings/runtime_object.cpp:
9667 (RuntimeObjectImp::defaultValue):
9668
96692003-12-04 Richard Williamson <rjw@apple.com>
9670
9671 LiveConnect: Added support for setting the value of Java
9672 fields.
9673
9674 Reviewed by Chris.
9675
9676 * bindings/jni/jni_instance.cpp:
9677 (JavaInstance::invokeMethod):
9678 * bindings/jni/jni_runtime.cpp:
9679 (JavaParameter::JavaParameter):
9680 (JavaField::JavaField):
9681 (JavaField::valueFromInstance):
9682 (JavaField::setValueToInstance):
9683 (JavaMethod::JavaMethod):
9684 * bindings/jni/jni_runtime.h:
9685 (Bindings::JavaField::getJNIType):
9686 * bindings/jni/jni_utility.cpp:
9687 (JNITypeFromClassName):
9688 (convertValueToJValue):
9689 * bindings/jni/jni_utility.h:
9690 * bindings/runtime.cpp:
9691 (Instance::setValueOfField):
9692 * bindings/runtime.h:
9693 * bindings/runtime_object.cpp:
9694 (RuntimeObjectImp::get):
9695 (RuntimeObjectImp::put):
9696 (RuntimeObjectImp::defaultValue):
9697
96982003-12-04 Richard Williamson <rjw@apple.com>
9699
9700 Added support for string conversions.
9701 Changed various JavaString member variables to be inline.
9702 Implemented defaultValue for context relevant type coercion.
9703
9704 Reviewed by Chris.
9705
9706 * bindings/jni/jni_class.cpp:
9707 (JavaClass::JavaClass):
9708 (JavaClass::setClassName):
9709 (JavaClass::classForInstance):
9710 * bindings/jni/jni_class.h:
9711 * bindings/jni/jni_instance.cpp:
9712 (JavaInstance::stringValue):
9713 (JavaInstance::numberValue):
9714 (JavaInstance::booleanValue):
9715 (JavaInstance::invokeMethod):
9716 * bindings/jni/jni_instance.h:
9717 * bindings/jni/jni_runtime.cpp:
9718 (JavaParameter::JavaParameter):
9719 (JavaField::JavaField):
9720 (JavaMethod::JavaMethod):
9721 (appendClassName):
9722 (JavaMethod::signature):
9723 * bindings/jni/jni_runtime.h:
9724 (Bindings::JavaString::JavaString):
9725 (Bindings::JavaString::~JavaString):
9726 (Bindings::JavaString::operator=):
9727 (Bindings::JavaString::characters):
9728 (Bindings::JavaParameter::JavaParameter):
9729 (Bindings::JavaParameter::~JavaParameter):
9730 (Bindings::JavaParameter::operator=):
9731 (Bindings::JavaParameter::type):
9732 (Bindings::JavaField::JavaField):
9733 (Bindings::JavaField::~JavaField):
9734 (Bindings::JavaField::operator=):
9735 (Bindings::JavaField::name):
9736 (Bindings::JavaField::type):
9737 (Bindings::JavaMethod::JavaMethod):
9738 (Bindings::JavaMethod::_commonDelete):
9739 (Bindings::JavaMethod::name):
9740 (Bindings::JavaMethod::returnType):
9741 * bindings/jni/jni_utility.cpp:
9742 (convertValueToJValue):
9743 * bindings/runtime.h:
9744 (Bindings::Instance::valueOf):
9745 * bindings/runtime_method.cpp:
9746 (RuntimeMethodImp::call):
9747 * bindings/runtime_object.cpp:
9748 (RuntimeObjectImp::RuntimeObjectImp):
9749 (RuntimeObjectImp::get):
9750 (RuntimeObjectImp::defaultValue):
9751 * bindings/runtime_object.h:
9752 (KJS::RuntimeObjectImp::classInfo):
9753
9754=== Safari-116 ===
9755
97562003-12-03 Richard Williamson <rjw@apple.com>
9757
9758 LiveConnect: Added support for parameter passing to Java and conversion
9759 of return values.
9760
9761 Reviewed by Chris.
9762
9763 * bindings/jni/jni_instance.cpp:
9764 (JavaInstance::invokeMethod):
9765 * bindings/jni/jni_instance.h:
9766 * bindings/jni/jni_runtime.cpp:
9767 (JavaParameter::JavaParameter):
9768 (JavaMethod::JavaMethod):
9769 (JavaMethod::signature):
9770 * bindings/jni/jni_runtime.h:
9771 (Bindings::JavaParameter::JavaParameter):
9772 (Bindings::JavaParameter::operator=):
9773 (Bindings::JavaParameter::getJNIType):
9774 * bindings/jni/jni_utility.cpp:
9775 (callJNIBooleanMethodA):
9776 (convertValueToJValue):
9777 * bindings/jni/jni_utility.h:
9778 * bindings/runtime.h:
9779 * bindings/runtime_method.cpp:
9780 (RuntimeMethodImp::call):
9781 * bindings/runtime_object.cpp:
9782 (RuntimeObjectImp::get):
9783
97842003-12-02 Richard Williamson <rjw@apple.com>
9785
9786 Added support for calling simple methods in Java from JavaScript.
9787 (void return and no parameters). Yay, LiveConnect lives.
9788
9789 Still need write argument and return value conversion code.
9790
9791 Reviewed by Chris.
9792
9793 * JavaScriptCore.pbproj/project.pbxproj:
9794 * bindings/jni/jni_instance.cpp:
9795 (JavaInstance::getClass):
9796 (JavaInstance::invokeMethod):
9797 * bindings/jni/jni_instance.h:
9798 * bindings/jni/jni_runtime.cpp:
9799 (JavaMethod::JavaMethod):
9800 (JavaMethod::signature):
9801 (JavaMethod::JNIReturnType):
9802 * bindings/jni/jni_runtime.h:
9803 (Bindings::JavaMethod::_commonDelete):
9804 (Bindings::JavaMethod::_commonCopy):
9805 (Bindings::JavaMethod::name):
9806 * bindings/jni/jni_utility.cpp:
9807 (signatureFromPrimitiveType):
9808 * bindings/jni/jni_utility.h:
9809 * bindings/runtime.h:
9810 * bindings/runtime_method.cpp: Added.
9811 (RuntimeMethodImp::RuntimeMethodImp):
9812 (RuntimeMethodImp::~RuntimeMethodImp):
9813 (RuntimeMethodImp::get):
9814 (RuntimeMethodImp::implementsCall):
9815 (RuntimeMethodImp::call):
9816 (RuntimeMethodImp::codeType):
9817 (RuntimeMethodImp::execute):
9818 * bindings/runtime_method.h: Added.
9819 * bindings/runtime_object.cpp:
9820 (RuntimeObjectImp::RuntimeObjectImp):
9821 (RuntimeObjectImp::get):
9822 * bindings/runtime_object.h:
9823 * kjs/function.cpp:
9824 (FunctionImp::FunctionImp):
9825 * kjs/interpreter.h:
9826
98272003-12-01 Darin Adler <darin@apple.com>
9828
9829 Reviewed by Maciej.
9830
9831 - fixed 3493799: JavaScript string.replace expands $ if it's the last character in replacement string
9832
9833 * kjs/ustring.cpp: (KJS::UString::toDouble): Fix backwards handling of the "tolerant" boolean.
9834 This indirectly caused the string.replace bug.
9835
98362003-12-02 Maciej Stachowiak <mjs@apple.com>
9837
9838 Merged patches from Harri Porten and David Faure to fix:
9839
9840 <rdar://problem/3497643>: reproducible crash printing self-referential array
9841
9842 * kjs/array_object.cpp:
9843 (ArrayProtoFuncImp::call): Break out of the loop if an exception was thrown.
9844 * kjs/nodes.cpp:
9845 (FunctionCallNode::evaluate): Move function call depth check from here...
9846 * kjs/object.cpp:
9847 (KJS::Object::call): ...to here.
9848 * kjs/object.h: Un-inline Object::call now that it does more.
9849
98502003-12-01 Richard Williamson <rjw@apple.com>
9851
9852 Fixed mistake in method signatures used to get boolean and integer fields.
9853
9854 Reviewed by Chris.
9855
9856 * bindings/jni/jni_runtime.cpp:
9857 (JavaField::valueFromInstance):
9858
98592003-12-01 Richard Williamson <rjw@apple.com>
9860
9861Fixed 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.
9862
9863Fixed 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.
9864
9865Added support for getting at Java object fields.
9866
9867 Reviewed by Chris.
9868
9869 * JavaScriptCore.pbproj/project.pbxproj:
9870 * Makefile.am:
9871 * bindings/jni/jni_instance.cpp:
9872 (JObjectWrapper::JObjectWrapper):
9873 * bindings/jni/jni_instance.h:
9874 (Bindings::JObjectWrapper::~JObjectWrapper):
9875 * bindings/jni/jni_runtime.cpp:
9876 (JavaField::valueFromInstance):
9877 * bindings/runtime_object.cpp:
9878 (RuntimeObjectImp::~RuntimeObjectImp):
9879 (RuntimeObjectImp::RuntimeObjectImp):
9880 (RuntimeObjectImp::get):
9881 (RuntimeObjectImp::deleteProperty):
9882 * bindings/runtime_object.h:
9883
9884=== Safari-115 ===
9885
98862003-11-21 Maciej Stachowiak <mjs@apple.com>
9887
9888 Patch from Harri Porten, reviewed by me.
9889
9890 - fixed 3491712 - String slice with negative arguments does not offset from end of string
9891
9892 * kjs/string_object.cpp:
9893 (StringProtoFuncImp::call): Handle negative arguments as offsets from end by
9894 adding length and clamping to [0,length-1].
9895
98962003-11-21 Maciej Stachowiak <mjs@apple.com>
9897
9898 Patch from Harri Porten, reviewed by me.
9899
9900 - fixed 3491709 - using Function.apply with a primitive type as the arg list causes crash
9901
9902 * kjs/function_object.cpp:
9903 (FunctionProtoFuncImp::call): Nest parentheses properly.
9904
99052003-11-20 Richard Williamson <rjw@apple.com>
9906
9907 More LiveConnect stuff. Primitive Java fields are now
9908 accessible from JavaScript! Yay!
9909
9910 Reviewed by Maciej.
9911
9912 * bindings/jni/jni_class.cpp:
9913 (JavaClass::methodNamed):
9914 (JavaClass::fieldNamed):
9915 * bindings/jni/jni_class.h:
9916 (Bindings::JavaClass::_commonDelete):
9917 * bindings/jni/jni_instance.cpp:
9918 (JavaInstance::JavaInstance):
9919 (JavaInstance::~JavaInstance):
9920 (JavaInstance::getClass):
9921 * bindings/jni/jni_instance.h:
9922 (Bindings::JavaInstance::javaInstance):
9923 * bindings/jni/jni_runtime.cpp:
9924 (JavaField::JavaField):
9925 (JavaField::valueFromInstance):
9926 * bindings/jni/jni_runtime.h:
9927 (Bindings::JavaField::JavaField):
9928 (Bindings::JavaField::~JavaField):
9929 (Bindings::JavaField::operator=):
9930 * bindings/jni/jni_utility.cpp:
9931 (callJNIMethod):
9932 (callJNIMethodA):
9933 (callJNIVoidMethod):
9934 (callJNIObjectMethod):
9935 (callJNIBooleanMethod):
9936 (callJNIByteMethod):
9937 (callJNICharMethod):
9938 (callJNIShortMethod):
9939 (callJNIIntMethod):
9940 (callJNILongMethod):
9941 (callJNIFloatMethod):
9942 (callJNIDoubleMethod):
9943 (callJNIVoidMethodA):
9944 (callJNIObjectMethodA):
9945 (callJNIByteMethodA):
9946 (callJNICharMethodA):
9947 (callJNIShortMethodA):
9948 (callJNIIntMethodA):
9949 (callJNILongMethodA):
9950 (callJNIFloatMethodA):
9951 (callJNIDoubleMethodA):
9952 (releaseCharactersForJStringInEnv):
9953 (primitiveTypeFromClassName):
9954 (getJNIField):
9955 * bindings/jni/jni_utility.h:
9956 * bindings/runtime.cpp:
9957 (Instance::createBindingForLanguageInstance):
9958 (Instance::getValueOfField):
9959 * bindings/runtime.h:
9960 * bindings/runtime_object.cpp:
9961 (RuntimeObjectImp::get):
9962
99632003-11-20 Richard Williamson <rjw@apple.com>
9964
9965 More LiveConnect stuff.
9966
9967 Reviewed by Chris.
9968
9969 * bindings/jni/jni_class.cpp:
9970 (JavaClass::classForName):
9971 (JavaClass::classForInstance):
9972 * bindings/jni/jni_instance.cpp:
9973 (JavaInstance::getValueOfField):
9974 * bindings/jni/jni_instance.h:
9975 (Bindings::JObjectWrapper::JObjectWrapper):
9976 * bindings/jni/jni_runtime.h:
9977 (Bindings::JavaConstructor::~JavaConstructor):
9978 (Bindings::JavaConstructor::operator=):
9979 (Bindings::JavaMethod::JavaMethod):
9980 (Bindings::JavaMethod::_commonDelete):
9981 (Bindings::JavaMethod::signature):
9982 * bindings/jni/jni_utility.cpp:
9983 (getJNIEnv):
9984 (attachToJavaVM):
9985 * bindings/jni/jni_utility.h:
9986 * bindings/runtime.h:
9987 * bindings/runtime_object.cpp:
9988 (RuntimeObjectImp::~RuntimeObjectImp):
9989 (RuntimeObjectImp::get):
9990 * bindings/runtime_object.h:
9991
99922003-11-19 Richard Williamson <rjw@apple.com>
9993
9994 More LiveConnect stuff.
9995
9996 Reviewed by Ken.
9997
9998 * JavaScriptCore.pbproj/project.pbxproj:
9999 * bindings/jni/jni_class.cpp: Added.
10000 (JavaClass::_commonInit):
10001 (JavaClass::JavaClass):
10002 (_createClassesByNameIfNecessary):
10003 (JavaClass::classForName):
10004 (JavaClass::classForInstance):
10005 (JavaClass::methodNamed):
10006 (JavaClass::fieldNamed):
10007 * bindings/jni/jni_class.h: Added.
10008 (Bindings::JavaClass::_commonDelete):
10009 (Bindings::JavaClass::~JavaClass):
10010 (Bindings::JavaClass::_commonCopy):
10011 (Bindings::JavaClass::JavaClass):
10012 (Bindings::JavaClass::operator=):
10013 (Bindings::JavaClass::name):
10014 (Bindings::JavaClass::constructorAt):
10015 (Bindings::JavaClass::numConstructors):
10016 * bindings/jni/jni_instance.cpp: Added.
10017 (JavaInstance::JavaInstance):
10018 (JavaInstance::~JavaInstance):
10019 * bindings/jni/jni_instance.h: Added.
10020 (Bindings::JObjectWrapper::JObjectWrapper):
10021 (Bindings::JObjectWrapper::~JObjectWrapper):
10022 (Bindings::JObjectWrapper::ref):
10023 (Bindings::JObjectWrapper::deref):
10024 (Bindings::JavaInstance::getClass):
10025 (Bindings::JavaInstance::operator=):
10026 * bindings/jni/jni_runtime.cpp:
10027 (JavaMethod::JavaMethod):
10028 * bindings/jni/jni_runtime.h:
10029 (Bindings::JavaString::JavaString):
10030 (Bindings::JavaString::~JavaString):
10031 (Bindings::JavaString::operator=):
10032 * bindings/jni/jni_utility.cpp:
10033 (getJavaVM):
10034 (getJNIEnv):
10035 (getCharactersFromJString):
10036 (releaseCharactersForJString):
10037 (getCharactersFromJStringInEnv):
10038 (releaseCharactersForJStringInEnv):
10039 * bindings/jni/jni_utility.h:
10040 * bindings/runtime.cpp:
10041 (Instance::createBindingForLanguageInstance):
10042 * bindings/runtime.h:
10043 (Bindings::Instance::):
10044
100452003-11-18 Richard Williamson <rjw@apple.com>
10046
10047 More live connect stubs. We're getting close.
10048
10049 Reviewed by Chris.
10050
10051 * JavaScriptCore.pbproj/project.pbxproj:
10052 * bindings/jni/jni_runtime.cpp:
10053 (JavaClass::JavaClass):
10054 (JavaInstance::JavaInstance):
10055 (JavaInstance::~JavaInstance):
10056 * bindings/jni/jni_runtime.h:
10057 (Bindings::JavaConstructor::value):
10058 (Bindings::JavaField::value):
10059 (Bindings::JavaMethod::value):
10060 (Bindings::JavaClass::_commonDelete):
10061 (Bindings::JavaClass::_commonCopy):
10062 (Bindings::JavaClass::methodNamed):
10063 (Bindings::JavaClass::fieldNamed):
10064 (Bindings::JavaInstance::getClass):
10065 * bindings/runtime.cpp: Added.
10066 * bindings/runtime.h:
10067 (Bindings::Instance::~Instance):
10068 * bindings/runtime_object.cpp: Added.
10069 (RuntimeObjectImp::classInfo):
10070 (RuntimeObjectImp::RuntimeObjectImp):
10071 (RuntimeObjectImp::get):
10072 (RuntimeObjectImp::put):
10073 (RuntimeObjectImp::canPut):
10074 (RuntimeObjectImp::hasProperty):
10075 (RuntimeObjectImp::deleteProperty):
10076 (RuntimeObjectImp::defaultValue):
10077 (RuntimeObjectImp::_initializeClassInfoFromInstance):
10078 * bindings/runtime_object.h: Added.
10079 (KJS::RuntimeObjectImp::setInternalInstance):
10080 (KJS::RuntimeObjectImp::getInternalInstance):
10081 * kjs/object.cpp:
10082 (KJS::ObjectImp::get):
10083 (KJS::ObjectImp::hasProperty):
10084 * kjs/value.h:
10085 (KJS::):
10086
100872003-11-17 Maciej Stachowiak <mjs@apple.com>
10088
10089 Patch from Harri, reviewed by me.
10090
10091 - fixed 3487375 - backwards array slice causes infinite loop
10092
10093 * kjs/array_object.cpp:
10094 (ArrayProtoFuncImp::call):
10095
100962003-11-17 Maciej Stachowiak <mjs@apple.com>
10097
10098 Patch from Harri Porten reviewed by me.
10099
10100 - fixed 3487371 - operator precedence for bitwise or, xor and and is wrong
10101
10102 * kjs/grammar.y: Correct the precedence.
10103
101042003-11-16 Maciej Stachowiak <mjs@apple.com>
10105
10106 Reviewed by John.
10107
10108 - fixed 3483829 - JavaScriptCore needs workaround to compile on Merlot
10109
10110 * JavaScriptCore.pbproj/project.pbxproj: Add -Wno-long-double to
10111 warning flags.
10112
10113=== Safari-114 ===
10114
101152003-11-13 Richard Williamson <rjw@apple.com>
10116
10117 Factored common code between copy constructor and assignment operator.
10118
10119 Reviewed by Chris.
10120
10121 * ChangeLog:
10122 * bindings/jni/jni_runtime.h:
10123 (Bindings::JavaConstructor::_commonCopy):
10124 (Bindings::JavaConstructor::JavaConstructor):
10125 (Bindings::JavaConstructor::operator=):
10126 (Bindings::JavaField::type):
10127 * bindings/runtime.h:
10128
101292003-11-13 Richard Williamson <rjw@apple.com>
10130
10131 More LiveConnect stuff. This checkin adds abstract classes to model
10132 language runtimes and a JNI based set of concrete implementations for
10133 Java.
10134
10135 Reviewed by Chris.
10136
10137 * JavaScriptCore.pbproj/project.pbxproj:
10138 * Makefile.am:
10139 * bindings/Makefile.am: Removed.
10140 * bindings/jni/Makefile.am: Removed.
10141 * bindings/jni/jni_runtime.cpp: Added.
10142 (JavaField::JavaField):
10143 (JavaConstructor::JavaConstructor):
10144 (JavaMethod::JavaMethod):
10145 (JavaClass::JavaClass):
10146 * bindings/jni/jni_runtime.h: Added.
10147 (Bindings::JavaString::JavaString):
10148 (Bindings::JavaString::~JavaString):
10149 (Bindings::JavaString::operator=):
10150 (Bindings::JavaString::characters):
10151 (Bindings::JavaParameter::JavaParameter):
10152 (Bindings::JavaParameter::~JavaParameter):
10153 (Bindings::JavaParameter::operator=):
10154 (Bindings::JavaParameter::type):
10155 (Bindings::JavaConstructor::JavaConstructor):
10156 (Bindings::JavaConstructor::~JavaConstructor):
10157 (Bindings::JavaConstructor::operator=):
10158 (Bindings::JavaConstructor::parameterAt):
10159 (Bindings::JavaConstructor::numParameters):
10160 (Bindings::JavaField::JavaField):
10161 (Bindings::JavaField::~JavaField):
10162 (Bindings::JavaField::operator=):
10163 (Bindings::JavaField::name):
10164 (Bindings::JavaField::type):
10165 (Bindings::JavaMethod::JavaMethod):
10166 (Bindings::JavaMethod::_commonDelete):
10167 (Bindings::JavaMethod::~JavaMethod):
10168 (Bindings::JavaMethod::_commonCopy):
10169 (Bindings::JavaMethod::operator=):
10170 (Bindings::JavaMethod::name):
10171 (Bindings::JavaMethod::returnType):
10172 (Bindings::JavaMethod::parameterAt):
10173 (Bindings::JavaMethod::numParameters):
10174 (Bindings::JavaClass::_commonDelete):
10175 (Bindings::JavaClass::~JavaClass):
10176 (Bindings::JavaClass::_commonCopy):
10177 (Bindings::JavaClass::JavaClass):
10178 (Bindings::JavaClass::operator=):
10179 (Bindings::JavaClass::name):
10180 (Bindings::JavaClass::methodAt):
10181 (Bindings::JavaClass::numMethods):
10182 (Bindings::JavaClass::constructorAt):
10183 (Bindings::JavaClass::numConstructors):
10184 (Bindings::JavaClass::fieldAt):
10185 (Bindings::JavaClass::numFields):
10186 * bindings/jni/jni_utility.cpp:
10187 (callJNIMethod):
10188 (callJNIMethodA):
10189 (callJNIObjectMethod):
10190 (callJNIByteMethod):
10191 (callJNICharMethod):
10192 (callJNIShortMethod):
10193 (callJNIIntMethod):
10194 (callJNILongMethod):
10195 (callJNIFloatMethod):
10196 (callJNIDoubleMethod):
10197 (callJNIVoidMethodA):
10198 (callJNIObjectMethodA):
10199 (callJNIByteMethodA):
10200 (callJNICharMethodA):
10201 (callJNIShortMethodA):
10202 (callJNIIntMethodA):
10203 (callJNILongMethodA):
10204 (callJNIFloatMethodA):
10205 (callJNIDoubleMethodA):
10206 (getCharactersFromJString):
10207 (releaseCharactersForJString):
10208 * bindings/jni/jni_utility.h:
10209 * bindings/objc/Makefile.am: Removed.
10210 * bindings/runtime.h: Added.
10211 (Bindings::Parameter::~Parameter):
10212 (Bindings::Constructor::~Constructor):
10213 (Bindings::Field::~Field):
10214 (Bindings::Method::~Method):
10215 (Bindings::Class::~Class):
10216
102172003-11-13 Maciej Stachowiak <mjs@apple.com>
10218
10219 Reviewed by John.
10220
10221 - fixed 3472562 - Null or Undefined variables passed to IN operator cause javascript exceptions
10222
10223 * kjs/nodes.cpp:
10224 (ForInNode::execute): If the in value is null or undefined, bail
10225 out early, since attempting to iterate its properties will throw
10226 an exception.
10227
102282003-11-12 Darin Adler <darin@apple.com>
10229
10230 - fixed the build
10231
10232 * Makefile.am: Fix the build by removing the bindings directory from SUBDIRS.
10233 Later, we can either add this back and add the Makefile.am files to the top
10234 level configure.in or leave it out and remove the Makefile.am files.
10235
102362003-11-12 Richard Williamson <rjw@apple.com>
10237
10238 Added utility functions for calling JNI methods.
10239
10240 Reviewed by Chris.
10241
10242 * JavaScriptCore.pbproj/project.pbxproj:
10243 * Makefile.am:
10244 * bindings/Makefile.am: Added.
10245 * bindings/jni/Makefile.am: Added.
10246 * bindings/jni/jni_utility.cpp: Added.
10247 (attachToJavaVM):
10248 (callJNIMethod):
10249 (callJNIVoidMethod):
10250 (callJNIObjectMethod):
10251 (callJNIByteMethod):
10252 (callJNICharMethod):
10253 (callJNIShortMethod):
10254 (callJNIIntMethod):
10255 (callJNILongMethod):
10256 (callJNIFloatMethod):
10257 (callJNIDoubleMethod):
10258 * bindings/jni/jni_utility.h: Added.
10259 * bindings/objc/Makefile.am: Added.
10260
102612003-11-08 Darin Adler <darin@apple.com>
10262
10263 Reviewed by John.
10264
10265 - fixed 3477528 -- array.sort(function) fails if the function returns a non-zero value that rounds to zero
10266
10267 * kjs/array_object.cpp:
10268 (compareByStringForQSort): Added checks for undefined values to match what the specification calls for.
10269 (compareWithCompareFunctionForQSort): Added checks for undefined values as above, and also changed the
10270 code that looks at the compare function result to look at the number returned without rounding to an integer.
10271 (ArrayProtoFuncImp::call): Changed the code that looks at the compare function result to look at the number
10272 returned without rounding to an integer.
10273
10274=== Safari-113 ===
10275
102762003-11-03 Vicki Murley <vicki@apple.com>
10277
10278 Reviewed by kocienda.
10279
10280 - fixed <rdar://problem/3471096>: non-B&I builds should not use order files, because they cause false "regressions" in perf.
10281
10282 * JavaScriptCore.pbproj/project.pbxproj: added empty SECTORDER_FLAGS variables to the Development and Deployment build styles
10283
102842003-11-02 Darin Adler <darin@apple.com>
10285
10286 Reviewed by Maciej.
10287
10288 - changed list manipulation to use Harri Porten's idea of a circular
10289 linked list that is built from head to tail rather than building the
10290 list backwards and reversing the list when done
10291
10292 * kjs/grammar.y: Handle CatchNode and FinallyNode in a type-safe way.
10293 Change many places that passed 0L to pass nothing at all, or to pass 0.
10294
10295 * kjs/nodes.h:
10296 (KJS::ElementNode::ElementNode): Build a circular list instead of a 0-terminated
10297 backwards list.
10298 (KJS::ArrayNode::ArrayNode): Break the circular list instead of reversing the list.
10299 (KJS::PropertyValueNode::PropertyValueNode): Moved before ObjectLiteralNode so the
10300 inline code in ObjectLiteralNode works. Build a circular list instead of a 0-terminated
10301 backwards list. Made the case for the first node separate so we don't need a nil check.
10302 (KJS::ObjectLiteralNode::ObjectLiteralNode): Break the circular list instead of
10303 reversing the list.
10304 (KJS::ArgumentListNode::ArgumentListNode): Build a circular list instead of a 0-terminated
10305 backwards list. Also, made the constructors inline (moved here from .cpp file).
10306 (KJS::ArgumentsNode::ArgumentsNode): Break the circular list instead of
10307 reversing the list.
10308 (KJS::NewExprNode::NewExprNode): Changed a 0L to 0.
10309 (KJS::StatListNode::StatListNode): Make this constructor no longer inline (moved into
10310 .cpp file). The one in the .cpp file builds a circular list instead of a 0-terminated
10311 backwards list.
10312 (KJS::VarDeclListNode::VarDeclListNode): Build a circular list instead of a 0-terminated
10313 backwards list.
10314 (KJS::VarStatementNode::VarStatementNode): Break the circular list instead of reversing
10315 the list.
10316 (KJS::BlockNode::BlockNode): Make this constructor no longer inline (moved into .cpp file).
10317 The one in the .cpp file breaks the list instead of reversing it.
10318 (KJS::ForNode::ForNode): Break the circular list instead of reversing the list.
10319 (KJS::CaseClauseNode::CaseClauseNode): Break the circular list instead of reversing the
10320 list.
10321 (KJS::ClauseListNode::ClauseListNode): Build a circular list instead of a 0-terminated
10322 backwards list.
10323 (KJS::CaseBlockNode::CaseBlockNode): Make this constructor no longer inline (moved into
10324 .cpp file). The one in the .cpp file breaks the list instead of reversing it.
10325 (KJS::TryNode::TryNode): Changed constructor to take typed parameters for the catch and
10326 finally nodes rather than just Node.
10327 (KJS::ParameterNode::ParameterNode): Build a circular list instead of a 0-terminated
10328 backwards list.
10329 (KJS::FuncDeclNode::FuncDeclNode): Break the circular list instead of reversing the
10330 list.
10331 (KJS::FuncExprNode::FuncExprNode): Break the circular list instead of reversing the
10332 list.
10333
10334 * kjs/nodes.cpp:
10335 (StatListNode::StatListNode): Moved this constructor here, no longer inline.
10336 Did the "break circular list" thing instead of the "reverse list" thing.
10337 Added setLoc calls to match KJS in the KDE tree; since we don't currently
10338 use the JavaScript debugging support, it's unclear whether there's any benefit, but
10339 later we might be using it and it's good to be as close as possible.
10340 (BlockNode::BlockNode): Moved this constructor here, no longer inline.
10341 Did the "break circular list" thing instead of the "reverse list" thing.
10342 Added setLoc calls.
10343 (CaseBlockNode::CaseBlockNode): Moved this constructor here, no longer inline.
10344 Did the "break circular list" thing instead of the "reverse list" thing.
10345 (SourceElementsNode::SourceElementsNode): Moved this constructor here, no longer inline.
10346 Did the "break circular list" thing instead of the "reverse list" thing.
10347 Added setLoc calls.
10348
10349 * kjs/grammar.cpp: Regenerated.
10350 * kjs/grammar.cpp.h: Regenerated.
10351 * kjs/grammar.h: Regenerated.
10352
10353=== Safari-112 ===
10354
103552003-10-30 Maciej Stachowiak <mjs@apple.com>
10356
10357 Reviewed by Ken.
10358
10359 - fixed 3427069 - browsing mp3.com causes leaks (KJS)
10360
10361 * kjs/string_object.cpp:
10362 (StringProtoFuncImp::call): Don't do an early return, since that
10363 could leak a temporary regexp.
10364
103652003-10-29 Maciej Stachowiak <mjs@apple.com>
10366
10367 Reviewed by Darin.
10368
10369 - fixed 3426076 - Leak of JS lexer data visiting http://www.ebay.com
10370
10371 * kjs/grammar.cpp:
10372 (yyerror): Updated the commented code.
10373 * kjs/grammar.y: Don't delete string and identifier tokens when done
10374 with them any more, they'll get cleaned up by the lexer now.
10375 * kjs/internal.cpp:
10376 (Parser::parse): Tell lexer when done parsing.
10377 * kjs/lexer.cpp:
10378 (Lexer::Lexer): Initialize new data members.
10379 (Lexer::lex): Use new methods to make strings and identifiers, and
10380 save them.
10381 (Lexer::makeIdentifier): Make a new Identifier and save it in an
10382 auto-growing array.
10383 (Lexer::makeUString): Likewise for UStrings.
10384 (Lexer::doneParsing): Clean up arrays of Ifentifiers and UStrings.
10385 * kjs/lexer.h:
10386
103872003-10-28 Maciej Stachowiak <mjs@apple.com>
10388
10389 Reviewed by Ken.
10390
10391 - fixed 3413962 - malicious web pages can kill all future JavaScript execution by breaking recursion limit check
10392
10393 * kjs/nodes.cpp:
10394 (FunctionCallNode::evaluate): If we're going to return early due
10395 to breaking the recursion limit, make sure to lower it again, or
10396 it will creep up by one each time it's exceeded.
10397
103982003-10-26 Darin Adler <darin@apple.com>
10399
10400 * JavaScriptCorePrefix.h: Added a C case to the NULL definition since we use C as well
10401 as C++ in this project.
10402
104032003-10-26 Darin Adler <darin@apple.com>
10404
10405 - rolled in some CString changes Harri Porten did on the KDE side
10406
10407 * kjs/ustring.cpp:
10408 (KJS::CString::CString): Use memcpy instead of strcpy for speed. Fix an off by one error
10409 in the copy constructor.
10410 (KJS::CString::operator=): Use memcpy instead of strcpy for speed.
10411
10412 * JavaScriptCorePrefix.h: Add a definition of NULL here that takes advantage of the GNU
10413 __null feature even if the system C library doesn't.
10414
10415== Rolled over to ChangeLog-2003-10-25 ==