1 2009-02-23 David Kilzer <ddkilzer@apple.com>
3 Sync up FEATURE_DEFINES_iphoneos across all projects
5 * Configurations/JavaScriptCore.xcconfig: Added ENABLE_PLUGIN_PROXY_FOR_VIDEO
6 and ENABLE_TOUCH_EVENTS to FEATURE_DEFINES_iphoneos.
8 2009-02-23 David Kilzer <ddkilzer@apple.com>
10 Move ENABLE_VIDEO to FEATURE_DEFINES_BASE
12 * Configurations/JavaScriptCore.xcconfig:
14 2009-02-23 Eric Carlson <eric.carlson@apple.com>
16 Reviewed by Antti Koivisto.
18 <rdar://problem/6179001> TLF: add support for media tags <audio> and <video> (fullscreen)
20 * Configurations/JavaScriptCore.xcconfig: Turn on video.
22 2009-02-18 David Kilzer <ddkilzer@apple.com>
24 <rdar://problem/6370582> Change JavaScriptCore to build armv6/armv7 with dwarf debugging symbols
26 Reviewed by David Carson.
28 * Configurations/Base.xcconfig: Backed out r70644 now that
29 the gcc issue is fixed. All architectures build with dwarf
30 debugging symbols again.
32 2009-02-18 David Kilzer <ddkilzer@apple.com>
34 Clean up JavaScriptCore build configurations
36 Rubber-stamped by Brad Moore.
38 The Development_Hardware configuration was building for i386 with
39 ARCHS = $(NATIVE_ARCH) in DebugRelease.xcconfig.
41 * Configurations/Base.xcconfig: Moved ARCHS to DebugRelease.xcconfig
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.
49 2009-02-16 David Kilzer <ddkilzer@apple.com>
51 <rdar://problem/6579438> Disable JIT in Simulator
53 Reviewed by Paul Knight.
55 * wtf/Platform.h: Defined ENABLE_JIT to 0 for PLATFORM(IPHONE),
56 which covers both the hardware and the simulator.
58 2009-02-16 Yosen Lin <yosen@apple.com>
60 <rdar://problem/6417393> Change the way webkit returns memory to the system
62 Reviewed by Antti Koivisto.
64 Switch from using mmap to using madvise to release memory. The original mmap was not
65 impacting the Jetsam level.
67 * wtf/TCSystemAlloc.cpp
70 2009-02-13 David Kilzer <ddkilzer@apple.com>
72 <rdar://problem/6082835> Safari 4.0 WebKit integration (Hurricane)
74 Merged ToT WebKit r35512-r40289 into iPhone WebKit.
76 18523 files changed, 607561 insertions(+), 284589 deletions(-)
78 2009-01-20 David Kilzer <ddkilzer@apple.com>
80 <rdar://problem/6486661> Move GCC_PREPROCESSOR_DEFINITIONS from Xcode project files to xcconfig files
82 Reviewed by George Dicker.
84 Backed out r75895 and let Xcode have its way with the file.
86 * JavaScriptCore.xcodeproj/project.pbxproj: Removed
87 GCC_PREPROCESSOR_DEFINITIONS.
89 2009-01-14 David Kilzer <ddkilzer@apple.com>
91 Bug 23153: JSC build always touches JavaScriptCore/docs/bytecode.html
93 Merged ToT WebKit r39931.
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).
99 2009-01-14 David Kilzer <ddkilzer@apple.com>
101 Bug 23153: JSC build always touches JavaScriptCore/docs/bytecode.html
103 <https://bugs.webkit.org/show_bug.cgi?id=23153>
105 Reviewed by Darin Adler.
107 Instead of building bytecode.html into ${SRCROOT}/docs/bytecode.html, build it
108 into ${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore/docs/bytecode.html.
110 Also fixes make-bytecode-docs.pl to actually generate documentation.
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.
119 2009-01-09 David Kilzer <ddkilzer@apple.com>
121 <rdar://problem/6485313> JavaScriptCore Tests: jsc built in Deployment/Simulator configuration hangs on ecma/Expressions/11.1.1.js
123 The previous commit also fixed the hung JavaScript test.
125 * tests/mozilla/ecma/Expressions/11.1.1.js: Renamed from JavaScriptCore/tests/mozilla/ecma/Expressions/11.1.1.js-disabled.
127 2009-01-09 David Kilzer <ddkilzer@apple.com>
129 <rdar://problem/6485313> JavaScriptCore Tests: jsc built in Deployment/Simulator configuration hangs on ecma/Expressions/11.1.1.js
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.
135 * JavaScriptCore.xcodeproj/project.pbxproj: Moved definition of
136 GCC_PREPROCESSOR_DEFINITIONS back into project file.
138 2009-01-09 pknight <set EMAIL_ADDRESS environment variable>
140 Reviewed by NOBODY (OOPS!).
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>)
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.
147 2009-01-08 David Kilzer <ddkilzer@apple.com>
149 <rdar://problem/6082835> Safari 4.0 WebKit integration (Jetstream)
151 Merged ToT WebKit r34504-r35511 into iPhone WebKit.
153 5033 files changed, 130341 insertions(+), 63984 deletions(-)
155 2008-12-24 David Kilzer <ddkilzer@apple.com>
157 <rdar://problem/6082835> Safari 4.0 WebKit integration (Jetstream)
159 Merged ToT WebKit r33979-r34503 into iPhone WebKit.
161 The Squirrelfish has landed!!
163 2008-12-02 David Kilzer <ddkilzer@apple.com>
165 <rdar://problem/6413288> Missing properties when enumerating built-in DOM objects
167 Reviewed by ToT WebKit Layout Tests.
169 The following ToT WebKit Layout Tests failed before this bug was
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
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.
186 2008-11-25 Chris Fleizach <cfleizach@apple.com>
188 <rdar://problem/6401430> WebCore needs AX turned on (using iphone AX model)
190 Reviewed by David Kilzer.
194 2008-11-20 Aaron Golden <agolden@apple.com>
196 Reviewed by David Kilzer.
198 Bringing in the isASCIIOctalDigit function, and some related functions for <rdar://problem/6177286> TLF: Anti-phishing (safari).
201 (WTF::isASCIIOctalDigit):
203 2008-11-13 Yosen Lin <yosen@apple.com>
205 <rdar://problem/6333993> Reduce HashTable memory that increased with TOT WebKit merge
207 Reviewed by David Kilzer.
209 Initial patch by Yosen Lin, with variable rename tweaks and one bug
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.
217 * kjs/create_hash_table:
219 (KJS::HashTable::createTable):
221 (KJS::HashTable::entry):
223 (KJS::JSObject::getPropertyNames):
225 2008-11-09 David Kilzer <ddkilzer@apple.com>
227 <rdar://problem/6082835> Safari 4.0 WebKit integration (Hurricane)
229 Merged ToT WebKit r33001-r33978.
231 2008-11-08 David Kilzer <ddkilzer@apple.com>
233 <rdar://problem/6355708> REGRESSION: Static initializer in JavaScriptCore_Sim Deployment build
235 Reviewed by NOBODY (BUILD FIX).
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.
242 2008-11-06 David Kilzer <ddkilzer@apple.com>
244 <rdar://problem/6250281> Sunspider test sometimes fails
246 Reviewed by Greg Bolsinga.
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.
254 * Configurations/Base.xcconfig: Set DEBUG_DEBUGS based on the
255 current BUILD_TYPE. Only set NDEBUG for Release and Production
257 * JavaScriptCore.xcodeproj/project.pbxproj: Remove all DEBUG_DEFINES
258 and GCC_PREPROCESSOR_DEFINITIONS settings since they're defined in
259 Base.xcconfig already.
261 2008-11-05 David Kilzer <ddkilzer@apple.com>
263 <rdar://problem/6343665> scripter crashes when calling parseFloat from JavaScript
265 Merged ToT WebKit r32808.
267 2008-05-02 Alexey Proskuryakov <ap@webkit.org>
271 Make JavaScriptGlue and JavaScriptCore API functions implicitly call initializeThreading
272 for the sake of non-WebKit clients.
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.
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.
288 * kjs/InitializeThreading.h:
290 Spell out initializeThreading contract.
292 * wtf/ThreadingPthreads.cpp: (WTF::isMainThread): Make sure that results are correct on
293 Darwin, even if threading was initialized from a secondary thread.
295 2008-11-04 David Kilzer <ddkilzer@apple.com>
297 <rdar://problem/6342374> Update JavaScriptCore, WebCore, WebKit xcconfig files for armv7
299 Reviewed by Greg Bolsinga.
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
308 2008-10-30 Greg Bolsinga <bolsinga@apple.com>
310 Reviewed by David Kilzer
312 <rdar://problem/5780286> Need a JavaScript location API for the web
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
322 * Configurations/JavaScriptCore.xcconfig:
325 2008-10-30 David Kilzer <ddkilzer@apple.com>
327 Removed -Wno-strict-aliasing gcc switch from iPhone builds.
329 iPhone WebKit r69976 fixed the remaining known strict aliasing issues
330 in WebKit, so we should no longer ignore strict aliasing warnings.
332 * Configurations/Base.xcconfig: Removed -Wno-strict-aliasing from
333 WARNING_CFLAGS_iphoneos.
335 2008-10-27 David Kilzer <ddkilzer@apple.com>
337 <rdar://problem/6082320> JavaScriptCore should use default compiler instead of hard coding 4.0
339 Reviewed by Greg Bolsinga.
341 * JavaScriptCore.xcodeproj/project.pbxproj: Removed build rules
342 forcing the use of gcc-4.0.
344 2008-10-14 Antti Koivisto <antti@apple.com>
346 Reviewed by Dave Kilzer.
348 <rdar://problem/6289874> FastMalloc does not return memory back to system fast enough.:
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
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.
356 * wtf/FastMalloc.cpp:
357 (WTF::TCMalloc_PageHeap::IncrementalScavenge):
359 2008-09-11 Andre Boule <aboule@apple.com>
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>
370 <rdar://problem/5934376> REGRESSION: A script fails because of a straw BOM character in it.
372 <https://bugs.webkit.org/show_bug.cgi?id=4931>
373 Unicode format characters (Cf) should be removed from JavaScript source
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.
378 Based on Darin's work on this bug.
380 Test: fast/js/removing-Cf-characters.html
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.
387 2008-08-29 David Kilzer <ddkilzer@apple.com>
389 <rdar://problem/6177996> Remove JSLockC.h and implementation in JSLock.cpp
393 * JavaScriptCore.exp: Updated export symbols.
394 * JavaScriptCore.xcodeproj/project.pbxproj: Removed references to JSLockC.h.
396 (JSLockDropAllLocks): Removed.
397 (JSLockRecoverAllLocks): Removed.
398 (JSJavaScriptCollectionThread): Removed. Moved to KJS::Collector.
399 (JSSetJavaScriptCollectionThread): Ditto.
400 * kjs/JSLockC.h: Removed.
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().
411 2008-08-27 David Kilzer <ddkilzer@apple.com>
413 <rdar://problem/6157731> JavaScriptCore shouldn't set VALID_ARCHS
415 * Configurations/Base.xcconfig: Removed VALID_ARCHS. Left ToT WebKit
418 2008-08-26 Greg Bolsinga <bolsinga@apple.com>
420 Reviewed by Dave Kilzer
422 <rdar://problem/6159366> Safari on iPodTouch (32G) crashes on specific web page
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.
431 2008-08-25 David Kilzer <ddkilzer@apple.com>
433 Let Xcode have it's way with JavaScriptCore.
435 * JavaScriptCore.xcodeproj/project.pbxproj: Xcode removed redundant
436 "name" parameters when the "path" parameters matched.
438 2008-07-29 David Kilzer <ddkilzer@apple.com>
440 <rdar://problem/6109759> Can't build iPhone WebKit with Debug builds of Desktop WebKit in symroots
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
449 * JavaScriptCore.xcodeproj/project.pbxproj: Removed relative paths.
451 2008-07-10 David Kilzer <ddkilzer@apple.com>
453 <rdar://problem/6047765> Get testkjs binary from JavaScriptCore in internal installs
455 Reviewed by George Dicker.
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.
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>).
467 This allows B&I to use the "All" target for both hardware and
468 simulator builds again.
470 * JavaScriptCore.xcodeproj/project.pbxproj:
472 2008-07-08 David Kilzer <ddkilzer@apple.com>
474 releaseFastMallocFreeMemory() should always be defined
476 Merged ToT WebKit r35055.
478 This fixes a compile failure when defining USE_SYSTEM_MALLOC with
479 Development[_Hardware] builds of iPhone WebKit.
481 2008-07-07 David Kilzer <ddkilzer@apple.com>
483 releaseFastMallocFreeMemory() should always be defined
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().
496 2008-06-18 Andre Boule <aboule@apple.com>
500 <rdar://problem/5452283> TLF: SVG support (incl scripting)
502 * Configurations/JavaScriptCore.xcconfig:
504 2008-06-16 Greg Bolsinga <bolsinga@apple.com>
508 <rdar://problem/6005303> JavaScriptCore_Sim-462 fails to build, TARGET_OS_IPHONE is not defined
510 minidom, testapi, testkjs need to have base configurations to build in B&I.
512 * JavaScriptCore.xcodeproj/project.pbxproj:
514 2008-06-05 Greg Bolsinga <bolsinga@apple.com>
516 Reviewed by Dave Kilzer
518 <rdar://problem/5828262> Use Opal's PLATFORM_NAME
520 Replace use of home grown CURRENT_PLATFORM with PLATFORM_NAME and its values.
522 * Configurations/Base.xcconfig:
523 * Configurations/JavaScriptCore.xcconfig:
524 * Configurations/Soil.xcconfig:
525 * JavaScriptCore.xcodeproj/project.pbxproj:
527 2008-05-29 David Kilzer <ddkilzer@apple.com>
529 <rdar://problem/5973520> iPhone: Crash when assigning Array (19294)
531 Merged ToT WebKit r34204, r34205.
533 --- Submission Information ---
535 - Risk details: Merged tip-of-tree WebKit fix that hasn't been in the tree
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.
541 2008-05-29 Steve Falkenburg <sfalken@apple.com>
545 * kjs/array_instance.cpp:
547 2008-05-29 Alexey Proskuryakov <ap@webkit.org>
551 https://bugs.webkit.org/show_bug.cgi?id=19294
552 <rdar://problem/5969062> A crash when iterating over a sparse array backwards.
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.
561 2008-05-24 David Kilzer <ddkilzer@apple.com>
563 <rdar://problem/5951108> FastMalloc should be connected to jetsam warnings to free available memory
565 Merged ToT WebKit r34028.
567 --- Submission Information ---
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.
576 2008-05-22 David Kilzer <ddkilzer@apple.com>
578 <rdar://problem/5954233> Add method to release free memory from FastMalloc
580 Patch suggested by Mark Rowe. Rubber-stamped by Maciej.
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().
588 2008-05-22 David Kilzer <ddkilzer@apple.com>
590 <rdar://problem/5952961> iPhone: Integer overflow in JavaScript arguments object property lookup
592 Merged ToT WebKit r33972.
594 --- Submission Information ---
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.
601 2008-05-21 Darin Adler <darin@apple.com>
605 - fix <rdar://problem/5952721> bug in JavaScript arguments object property lookup
607 Test: fast/js/arguments-bad-index.html
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
614 (KJS::IndexToNameMap::unMap): Ditto.
615 (KJS::IndexToNameMap::operator[]): Ditto.
616 * kjs/function.h: Changed IndexToNameMap::size type from int to unsigned.
618 2008-05-15 Greg Bolsinga <bolsinga@apple.com>
622 <rdar://problem/5935292> Layout makes a blocking call for PLT even in Production
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:
628 <rdar://problem/5833431> assert in WebCore::FrameView::layout(bool) + 3044 (FrameView.cpp:682)
632 2008-05-06 Antti Koivisto <antti@apple.com>
634 Merged r30550 from ToT WebKit.
636 2008-02-24 Dan Bernstein <mitz@apple.com>
638 Reviewed by Darin Adler.
640 - fix http://bugs.webkit.org/show_bug.cgi?id=17511
641 REGRESSION: Reproducible crash in SegmentedSubstring::SegmentedSubstring(SegmentedSubstring const&)
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.
648 2008-05-06 Antti Koivisto <antti@apple.com>
650 Merged r30538 from ToT WebKit.
652 2008-02-23 Darin Adler <darin@apple.com>
656 - http://bugs.webkit.org/show_bug.cgi?id=17496
657 make Deque use a circular array; add iterators
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.
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.
667 2008-04-29 Greg Bolsinga <bolsinga@apple.com>
669 Reviewed by Darin, ddkilzer
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:])
677 2008-04-25 David Kilzer <ddkilzer@apple.com>
679 <rdar://problem/5732748> DASH: Wrong line number passed to -willLeaveCallFrame
681 Merged ToT WebKit r32578.
683 2008-04-25 David Kilzer <ddkilzer@apple.com>
685 <rdar://problem/5819422> REGRESSION: Wrong line number passed to -willLeaveCallFrame
687 Patch by George Dicker and Michael Kahl. Reviewed by Darin.
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.
694 (KJS::FunctionBodyNodeWithDebuggerHooks::execute): Pass lastLine() instead of lineNo()
695 when calling Debugger::returnEvent().
697 2008-03-28 David Kilzer <ddkilzer@apple.com>
699 <rdar://problem/5826340> iPhone: Safari/PCRE Memory Corruption
701 Merged r31388 from ToT WebKit.
703 2008-03-27 Darin Adler <darin@apple.com>
705 Reviewed by Mark Rowe.
707 <rdar://problem/5826236> Regular expressions with large nested repetition counts can have their
708 compiled length calculated incorrectly.
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.
715 2008-03-25 Greg Bolsinga <bolsinga@apple.com>
719 <rdar://problem/5764353> archs
721 * Configurations/Base.xcconfig:
723 2008-03-25 Greg Bolsinga <bolsinga@apple.com>
727 Use TargetConditionals.h instead of PLATFORM(ARM) to determine iPhoneOS/iPhoneSimulator.
729 <rdar://problem/5764353>
733 2008-03-25 Greg Bolsinga <bolsinga@apple.com>
737 Update to use AspenSDK.xcconfig so that SDKROOT is set and /Developer/SDKs/Purple's are removed.
739 * Configurations/iPhone.xcconfig: Copied from JavaScriptCore/Configurations/Indigo.xcconfig.
740 * JavaScriptCore.xcodeproj/project.pbxproj:
742 2008-03-25 David D. Kilzer <ddkilzer@apple.com>
744 Backed out r47092 as it broke Xcode 3.0 builds (which don't know about SDKROOT).
746 * Configurations/Base.xcconfig:
747 * JavaScriptCore.xcodeproj/project.pbxproj:
750 2008-03-25 David D. Kilzer <ddkilzer@apple.com>
752 <rdar://problem/5764353> aspen isn't armv6 only
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).
761 2008-03-03 Scott Goodson <goodson@apple.com>
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
766 2008-02-27 David D. Kilzer <ddkilzer@apple.com>
768 <rdar://problem/5657178> Enable TCMalloc in JavaScriptCore now that it releases memory
772 This changes gives us a ~200ms improvement in the MobileSafari PLT.
774 * wtf/FastMalloc.cpp: Removed #defined USE_SYSTEM_MALLOC to enable TCMalloc on Aspen.
776 2008-02-21 David Kilzer <ddkilzer@apple.com>
778 <rdar://problem/5757526> iPhone: REGRESSION (r29425): JavaScript pop-up menu appears at wrong location when hovering image at http://news.chinatimes.com/ (17164)
780 Reviewed by Oliver Hunt.
782 --- Submission Information---
784 - Risk details: Merged ToT WebKit r29997. Merge was clean modulo
785 whitespace and variable name changes. Issue was well-understood
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.
792 (KJS::PostIncResolveNode::evaluate):
793 (KJS::ReadModifyLocalVarNode::evaluate):
794 (KJS::ReadModifyResolveNode::evaluate):
796 2008-02-18 David D. Kilzer <ddkilzer@apple.com>
798 <rdar://problem/5746633> Update license headers for files provided as binaries in WebKit open source dump
800 Reviewed by Greg Bolsinga.
802 --- Submission Information---
804 - Risk details: Updated copyright and license headers.
805 - Code reviewed by: Greg Bolsinga.
806 - Testing details: Compiled Deployment_Hardware configuration.
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.
812 2008-02-10 Greg Bolsinga <bolsinga@apple.com>
816 <rdar://problem/5730567> Add FEATURE_DEFINE ENABLE_TOUCH_EVENTS
818 Wrap Touch / Gesture event code in ENABLE(TOUCH_EVENTS).
822 2008-02-06 Scott Goodson <goodson@apple.com>
824 Reviewed by David Kilzer.
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
829 2008-02-06 Scott Goodson <goodson@apple.com>
831 Reviewed by David Kilzer.
833 Changed all instances of PLATFORM(IPHONE) to PLATFORM(ASPEN) as requested by:
835 <rdar://problem/5710518> Change PLATFORM(IPHONE) macro to PLATFORM(ASPEN) in JavaScriptCore/WebCore/WebKit
837 2008-01-29 David D. Kilzer <ddkilzer@apple.com>
839 Fix file descriptor arguments in TCMalloc mmap() calls
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()
846 NOTE: This does not enable TCMalloc! See <rdar://problem/5657178>.
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).
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().
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().
861 2008-01-11 David D. Kilzer <ddkilzer@apple.com>
863 Enabled Xpath and XSLT
865 <rdar://problem/5543132> XSLT and XPath support
866 <rdar://problem/5552152> support XPathEvaluator
870 * Configurations/JavaScriptCore.xcconfig: Added ENABLE_XPATH and
871 ENABLE_XSLT to FEATURE_DEFINES_BASE.
873 2008-01-11 David D. Kilzer <ddkilzer@apple.com>
875 <rdar://problem/5438324> TLF: Local Storage for Web Applications
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.
883 2008-01-10 David D. Kilzer <ddkilzer@apple.com>
885 <rdar://problem/5682880> iPhone: dtables should be rewritten as a script (16818)
887 Reviewed by Darin for ToT WebKit
889 Rewrote the dftables utility in Perl. This is a partial merge of ToT WebKit
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.
898 2007-08-24 Scott Goodson <goodson@apple.com>
900 This is not for Snowbird; Indigo project only.
902 <rdar://problem/5410927> Obfuscate class names in all Indigo dependencies.
904 Included CoreFoundationObfuscations.h in prefix header (CF defines some NS types).
906 * JavaScriptCorePrefix.h:
908 2007-08-24 Scott Goodson <goodson@apple.com>
910 This is not for Snowbird; Indigo project only.
912 <rdar://problem/5410927> Obfuscate class names in all Indigo dependencies.
914 Included <Foundation/FoundationObfuscations.h> in the prefix header, if OBFUSCATE is defined.
916 Defined OBFUSCATE in Deployment-Indigo configuration.
918 Defined INDIGO in both -Indigo configurations, even though there are no current uses.
920 * JavaScriptCore.xcodeproj/project.pbxproj:
921 * JavaScriptCorePrefix.h:
923 2007-08-19 David Kilzer <ddkilzer@apple.com>
925 Reviewed by open source ToT and me.
927 <rdar://problem/5414585> Web site does not display properly in iPhone 1.0.1, worked in 1.0
929 Merged ToT WebKit r18517 into PEP.
931 Modified pcre_compile() (and the functions that it calls) to work with patterns
932 containing null characters.
934 Covered by JavaScriptCore tests ecma_3/RegExp/octal-002.js and ecma_3/RegExp/regress-85721.js
936 * ChangeLog-oss-merges: Original ChangeLog entry.
938 (KJS::RegExp::RegExp): Changed to not null-terminate the pattern string and instead
939 pass its length to pcre_compile.
941 * pcre/pcre_compile.c:
945 (check_posix_syntax):
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.
951 * pcre/pcre_internal.h:
952 * tests/mozilla/expected.html: Updated for the two tests that this patch
955 2007-08-19 David Kilzer <ddkilzer@apple.com>
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
962 Merged ToT WebKit r16133 into PEP.
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
967 * ChangeLog-oss-merges: Original ChangeLog entry.
968 * JavaScriptCore.xcodeproj/project.pbxproj:
969 * wtf/GetPtr.h: Added.
972 (WTF::ListRefPtr::ListRefPtr):
973 (WTF::ListRefPtr::operator=):
984 2007-08-17 Scott Goodson <goodson@apple.com>
986 Added build configurations for Project Indigo. Special install and framework search paths.
987 No effect on existing configurations, or code.
989 * JavaScriptCore.xcodeproj/project.pbxproj:
991 2007-08-14 David Kilzer <ddkilzer@apple.com>
995 <rdar://problem/5255884> Safari crashed in JavaScriptCore::WTF::fastMalloc()
997 Merged ToT WebKit r23846 into PEP.
999 Correctly evaluate the return value of _pcre_ucp_findchar() and ucp_findchar().
1001 * ChangeLog-oss-merges: Original ChangeLog entry.
1002 * pcre/pcre_compile.c:
1006 * tests/mozilla/expected.html: Updated test results. (They did not change with
1007 this commit; just updating for future use.)
1009 2007-07-30 David Kilzer <ddkilzer@apple.com>
1011 Reviewed by NOBODY (header copyright change).
1013 * kjs/JSLockC.h: Updated header copyright for open source distribution.
1015 2007-07-25 David Kilzer <ddkilzer@apple.com>
1017 Reviewed by NOBODY (OOPS!).
1019 <rdar://problem/5354693> Upgrade PCRE 6.1 to 6.2 in JavaScriptCore
1021 Merged ToT WebKit r18483 to PEP.
1023 * ChangeLog-oss-merges: Original ChangeLog entry.
1027 * pcre/pcre_compile.c:
1028 (read_repeat_counts):
1031 2007-07-23 David Kilzer <ddkilzer@apple.com>
1033 Reviewed by NOBODY (obvious fix).
1035 <rdar://problem/5354146> Exception message in LayoutTests/fast/js/regexp-charclass-crash.html doesn't match ToT WebKit
1037 Test: LayoutTests/fast/js/regexp-charclass-crash.html.
1039 Merged ToT WebKit r18256 to PEP.
1041 A deleted object was accessed to prepare RegExp construction error messages.
1043 * ChangeLog-oss-merges: Original ChangeLog entry.
1044 * kjs/regexp_object.cpp:
1045 (RegExpObjectImp::construct): Wrap the RegExp into an OwnPtr.
1047 2007-07-23 David Kilzer <ddkilzer@apple.com>
1051 <rdar://problem/5353976> iPhone: buffer overflow: PCRE computes wrong length for expressions with quantifiers on named recursion or subexpressions
1053 Merged ToT WebKit r23824 to PEP.
1055 Test progression: js1_2/regexp/special_characters.js now passes.
1057 Original commit message by Darin Adler:
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.
1062 Turned off the following features of PCRE (some of these are simply parsed and not implemented):
1064 \C \E \G \L \N \P \Q \U \X \Z
1067 (?#) (?<=) (?<!) (?>)
1072 Added the following:
1076 Because of \v, the js1_2/regexp/special_characters.js test now passes.
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.
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.
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.
1089 * pcre/pcre-config.h: Set JAVASCRIPT to 1.
1090 * pcre/pcre_internal.h: Added ESC_v.
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
1098 (pcre_compile2): Ditto.
1100 * ChangeLog-oss-merges: Original ChangeLog entry.
1102 2007-07-23 David Kilzer <ddkilzer@apple.com>
1104 Reviewed by NOBODY (make testkjs build and link).
1106 * JavaScriptCore.xcodeproj/project.pbxproj: Added testkjs.cpp and JavaScriptCore.framework
1107 to testkjs target so it will build and link.
1109 2007-07-23 David Kilzer <ddkilzer@apple.com>
1113 <rdar://problem/5353974> iPhone: buffer overflow: PCRE computes length wrong for expressions such as "[**]"
1115 Merged ToT WebKit r24430 to PEP.
1117 Test: fast/js/regexp-charclass-crash.html
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
1125 2007-07-06 David Kilzer <ddkilzer@apple.com>
1127 Reviewed by NOBODY (test code).
1129 Fixed typos introduced in r11090. Also fixed code indentation.
1132 (main): Changed name of default script from "minicom.js" to "minidom.js".
1134 (main): Changed name of default script from "minicom.js" to "testapi.js".
1136 2007-06-25 Andre Boule <aboule@apple.com>
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.
1144 <rdar://problem/5265583> Cypress: browser crashed 5 times - QC 30438
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):
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):
1163 (KJS::UString::append):
1165 2007-05-07 David Kilzer <ddkilzer@apple.com>
1169 <rdar://problem/5181388> JavaScriptCore strlcpy() buffer overrun
1171 ---P2 Submission Information---
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
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.)
1185 * kjs/number_object.cpp:
1186 (NumberProtoFunc::callAsFunction): Fix potential buffer overflows in strlcpy().
1188 (KJS::UString::from): Fix potential buffer overflows in strlcpy() and strncpy().
1189 Added assert() for section of code that does not check buflength.
1191 2007-02-26 Andre Boule <aboule@apple.com>
1194 Merged in a crasher fix from TOT webkit:
1196 Patch by Darin and me, reviewed by Maciej.
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
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.
1207 * kjs/collector.cpp:
1208 (KJS::Collector::collect):
1210 2006-11-12 Andre Boule <aboule@apple.com>
1213 <rdar://problem/4771699> Cap Javascript max allocation size to 10MB
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.
1223 2006-09-29 Andre Boule <aboule@apple.com>
1226 Making mmap tag -1 on simulator like it was before.
1228 * wtf/TCSystemAlloc.cpp:
1230 2006-09-13 Andre Boule <aboule@apple.com>
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.
1239 * kjs/collector.cpp:
1240 (KJS::Collector::markCurrentThreadConservatively):
1242 2006-07-25 Andre Boule <aboule@apple.com>
1245 Fast allocator enabled in Deployment configs.
1246 Plt improves almost 10%
1247 <rdar://problem/4637739>
1249 * JavaScriptCore.xcodeproj/project.pbxproj:
1250 * wtf/FastMalloc.cpp:
1252 (operator delete[]):
1254 2006-06-16 Andre Boule <aboule@apple.com>
1256 Reviewed by Kosut, Albert.
1257 temporary workaround for : <rdar://problem/4588784> crashin markStackObjectsConservatively
1260 * kjs/collector.cpp:
1261 (KJS::Collector::markCurrentThreadConservatively):
1264 2005-09-22 Andre Boule <aboule@apple.com>
1269 -Java related bindings #ifs renamed to BINDINGS_JAVA, which remains off.
1271 2005-09-21 Ken Kocienda <kocienda@apple.com>
1275 Merged in changes from the opensource tree.
1277 2005-09-20 Maciej Stachowiak <mjs@apple.com>
1279 Reviewed by Geoff and partly by Darin.
1281 - fixed http://bugzilla.opendarwin.org/post_bug.cgi
1282 (Reduce conflicts in JavaScriptCore grammar)
1284 This change gets us down from over 200 shift/reduce and 45 reduce/reduce to
1285 9 shift/reduce and 45 reduce/reduce.
1288 * kjs/grammar_types.h: Removed.
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):
1314 2005-09-20 Geoffrey Garen <ggaren@apple.com>
1316 - Oops. The 4263434 change was only appropriate on the branch. Rolling out.
1321 (KJS::InterpreterImp::mark):
1323 2005-09-20 Geoffrey Garen <ggaren@apple.com>
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
1329 Added InterpreterLocks in some places in the bindings we missed before.
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):
1341 2005-09-20 Geoffrey Garen <ggaren@apple.com>
1343 - Fixed <rdar://problem/4263434> <rdar://problem/4263434> Denver 8F29 Regression:
1344 KJS::InterpreterImp::mark() crash
1346 Fix by mjs, review by me.
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.
1353 2005-09-20 Geoffrey Garen <ggaren@apple.com>
1355 - Rolled in fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=4892
1356 Date constructor has problems with months larger than 11
1360 * layout-tests/fast/js/date-big-constructor-expected.txt: Added.
1361 * layout-tests/fast/js/date-big-constructor.html: Added.
1365 * kjs/date_object.cpp:
1366 (KJS::fillStructuresUsingDateArgs):
1369 2005-09-19 Geoffrey Garen <ggaren@apple.com>
1371 - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5028
1372 9 layout tests fail following the change from long to int
1374 - Rolled out changes to simple_number.h, and added fits(long long)
1375 and SimpleNumber::fits(unsigned long long) to the old system.
1379 * kjs/simple_number.h:
1380 (KJS::SimpleNumber::):
1381 (KJS::SimpleNumber::value):
1382 (KJS::SimpleNumber::fits):
1383 (KJS::SimpleNumber::integerFits):
1384 (KJS::SimpleNumber::make):
1386 2005-09-14 Maciej Stachowiak <mjs@apple.com>
1390 - fixed <rdar://problem/4214783> REGRESSION: kjs_fast_malloc crash due to lack of locking on multiple threads (seen selecting volumes in the installer)
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).
1396 Also added assertions to ensure that the locking rules are followed for the relevant
1400 * bindings/NP_jsobject.cpp:
1401 (identifierFromNPIdentifier):
1406 (_NPN_RemoveProperty):
1409 (_NPN_SetException):
1410 * bindings/jni/jni_jsobject.cpp:
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:
1435 * bindings/testbindings.mm:
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:
1445 (InterpreterImp::InterpreterImp):
1446 (InterpreterImp::clear):
1447 (InterpreterImp::mark):
1448 (InterpreterImp::checkSyntax):
1449 (InterpreterImp::evaluate):
1451 (KJS::InterpreterImp::globalObject):
1452 * kjs/interpreter.cpp:
1453 (Interpreter::evaluate):
1454 * kjs/interpreter.h:
1455 (KJS::InterpreterLock::InterpreterLock):
1456 (KJS::InterpreterLock::~InterpreterLock):
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):
1478 2005-09-16 Adele Peterson <adele@apple.com>
1480 Change by Darin, reviewed by me and Maciej.
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)
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):
1510 * bindings/objc/WebScriptObject.mm:
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:
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):
1538 (KJS::UString::from):
1539 (KJS::UString::toUInt32):
1540 (KJS::UString::find):
1541 (KJS::UString::rfind):
1547 2005-09-13 Ken Kocienda <kocienda@apple.com>
1551 Merged in changes from the opensource tree.
1553 2005-09-10 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
1555 Reviewed and landed by Darin.
1557 * Makefile.vc: Added.
1558 * README-Win32.txt: Added.
1560 2005-09-10 Darin Adler <darin@apple.com>
1562 - fixed compilation for WebCore (another try)
1564 * kjs/simple_number.h: Added more "using" lines.
1566 2005-09-10 Darin Adler <darin@apple.com>
1568 - fixed compilation for WebCore
1570 * kjs/simple_number.h: Have to include <cmath> here to work around a bug in the GCC
1571 standard C++ library headers.
1573 2005-09-10 Darin Adler <darin@apple.com>
1575 Windows changes by Krzysztof Kowalczyk <kkowalczyk@gmail.com>.
1577 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4870
1578 win portability: fix IS_NEGATIVE_ZERO macro in simple_number.h
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.
1585 * kjs/internal.cpp: Remove definition of now-unneeded negZero global.
1587 * kjs/value.cpp: Touched the file because Xcode didn't know it needed to
1590 - improved test engine
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
1596 2005-09-08 Darin Adler <darin@apple.com>
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.
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
1608 2005-09-08 Darin Adler <darin@apple.com>
1612 - updated to PCRE 6.1
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.
1621 Note also that there was one small change made here that's not on the branch
1624 * Info.plist: Updated the part of the copyright message that's about PCRE.
1626 * JavaScriptCore.xcodeproj/project.pbxproj: Added new PCRE source files,
1627 removed obsolete ones.
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.
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.
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.
1666 2005-09-08 Ken Kocienda <kocienda@apple.com>
1670 Merged in changes from the opensource tree.
1672 2005-09-07 Geoffrey Garen <ggaren@apple.com>
1674 -fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4781
1675 Date.setMonth fails with big values due to overflow
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
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
1692 * tests/mozilla/expected.html:
1694 2005-09-07 Ken Kocienda <kocienda@apple.com>
1698 Merged in changes from the opensource tree.
1700 2005-09-04 Darin Adler <darin@apple.com>
1702 * kjs/identifier.cpp: Fix comment, add missing include.
1703 (Follow-on to changes from yesterday.)
1705 2005-09-03 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
1707 Reviewed, tweaked and landed by Darin.
1709 - another try at some of the Windows compilation fixes
1710 should fix these bugs: 4546, 4831, 4834, 4643, 4830, 4832, 4833, 4835
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).
1724 2005-09-03 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
1726 Reviewed, tweaked and landed by Darin.
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
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.
1735 * kjs/config.h: Define HAVE_SYS_TIMEB_H for Win32.
1737 * kjs/date_object.cpp: Add include of <limits.h>. Add definitions of strncasecmp, isfinite, and
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.
1742 * kjs/date_object.h: Remove unneeded include of <sys/time.h>.
1744 * kjs/dtoa.cpp: Add an undef of strtod, needed on Win32.
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.
1750 * kjs/function.cpp: (isxdigit): Define a locale-independent isxdigit on Win32.
1752 * kjs/function.h: Remove unneeded friend class Function for FunctionImp.
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.
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.
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.
1764 * kjs/interpreter_map.cpp: Add missing include of <stdlib.h>.
1767 (KJS::ListImp::markValues): Use std::min instead of MIN.
1768 (KJS::List::copy): Ditto.
1769 (KJS::List::copyTail): Ditto.
1771 * kjs/math_object.cpp: (signbit): Add a Win32 implementation of signbit.
1773 * kjs/nodes.cpp: (Node::finalCheck): Use unsigned instead of uint.
1774 Put the use of always_inline inside __GNUC__.
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.
1780 * kjs/operations.cpp:
1781 (KJS::isInf): Add Win32 implementation.
1782 (KJS::isPosInf): Add Win32 implementation.
1783 (KJS::isNegInf): Add Win32 implementation.
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.
1790 2005-09-02 Beth Dakin <bdakin@apple.com>
1792 Fix for <rdar://problem/4235531> Denver Regression: Safari crash in KWQStringData::makeUnicode
1793 The other half of the fix is in WebCore.
1795 Fix written by Maciej and Darin.
1796 Reviewed by me/Maciej
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.
1802 * kjs/fast_malloc.cpp: Added #define for MORECORE_CONTIGUOUS, MORECORE_CANNOT_TRIM,
1803 and MALLOC_FAILURE_ACTION.
1805 2005-08-31 Geoffrey Garen <ggaren@apple.com>
1807 -rolled in fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=4698
1808 kjs does not allow named functions in function expressions
1810 Fix by Arthur Langereis.
1816 (FuncExprNode::evaluate):
1818 (KJS::FuncExprNode::FuncExprNode):
1822 * layout-tests/fast/js/named-function-expression-expected.txt: Added.
1823 * layout-tests/fast/js/named-function-expression.html: Added.
1825 2005-09-02 Andre Boule <aboule@apple.com>
1827 Removed OS X target from project.
1829 * JavaScriptCore.xcodeproj/project.pbxproj
1831 2005-08-31 Ken Kocienda <kocienda@apple.com>
1835 Merged in new file from the opensource tree.
1837 2005-08-31 Justin Haygood <justin@xiondigital.net>
1839 Reviewed, tweaked, and landed by Darin.
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.
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.
1851 2005-08-30 Darin Adler <darin@apple.com>
1853 Reviewed by John Sullivan.
1855 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4758
1856 unify SharedPtr in WebCore and JavaScriptCore
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.
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.
1872 2005-08-29 Ken Kocienda <kocienda@apple.com>
1876 * JavaScriptCore.xcodeproj/project.pbxproj: Fixing busted Xcode reference to shared_ptr.h.
1878 2005-08-29 Ken Kocienda <kocienda@apple.com>
1882 Merged in new file from the opensource tree.
1884 * kjs/shared_ptr.h: Added.
1886 2005-08-29 Ken Kocienda <kocienda@apple.com>
1890 Merged in changes from the opensource tree.
1892 2005-08-26 Maciej Stachowiak <mjs@apple.com>
1896 <rdar://problem/4224911> many many leaks in kjsyyparse with malformed Javascript
1898 Record all nodes that are created during parsing, and delete any
1899 that are left floating with a refcount of 0.
1902 (KJS::Parser::saveNewNode):
1903 (KJS::clearNewNodes):
1904 (KJS::Parser::parse):
1909 (KJS::Node::refcount):
1911 2005-08-26 Maciej Stachowiak <mjs@apple.com>
1915 - fixed <rdar://problem/4232452> many many leaks in kjsyyparse on some well-formed JavaScript (can repro on sony.com, webkit tests)
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
1922 * JavaScriptCore.xcodeproj/project.pbxproj:
1924 (KJS::DeclaredFunctionImp::DeclaredFunctionImp):
1925 (KJS::GlobalFuncImp::callAsFunction):
1927 * kjs/function_object.cpp:
1928 (FunctionObjectImp::construct):
1931 (KJS::Parser::parse):
1932 (KJS::Parser::accept):
1933 (KJS::InterpreterImp::checkSyntax):
1934 (KJS::InterpreterImp::evaluate):
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):
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):
2049 2005-08-26 Geoff Garen <ggaren@apple.com>
2054 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4664
2055 TOT Crash from backwards null check in WebScriptObject.mm
2057 * bindings/objc/WebScriptObject.mm:
2058 (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:]):
2061 2005-08-26 Ken Kocienda <kocienda@apple.com>
2065 Merged in changes from the opensource tree.
2067 2005-08-25 Darin Adler <darin@apple.com>
2069 Reviewed by John Sullivan.
2071 - rename KJS::UString::string() to KJS::UString::domString()
2072 - rename KJS::Identifier::string() to KJS::Identifier::domString()
2074 * kjs/identifier.h: Renamed.
2075 * kjs/ustring.h: Ditto.
2077 2005-08-23 Ken Kocienda <kocienda@apple.com>
2081 * JavaScriptCore.xcodeproj/project.pbxproj: Turn on dead code stripping
2082 for deployment builds.
2084 2005-08-22 Andre Boule <aboule@apple.com>
2088 * JavaScriptCore.xcodeproj/project.pbxproj: Rename purple target to Purple
2089 * Makefile.am: Support multiple target building using makefile
2091 2005-08-22 Ken Kocienda <kocienda@apple.com>
2095 Merged in changes from the opensource tree.
2097 2005-08-19 Darin Adler <darin@apple.com>
2101 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4435
2102 speed up JavaScript by tweaking the Identifier class
2104 * kjs/identifier.h: Add a new global nullIdentifier and make Identifier::null a function
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.
2109 * kjs/ustring.h: (KJS::UString::UString): Make this empty constructor inline.
2110 * kjs/ustring.cpp: Remove the old non-inline version.
2112 2005-08-19 Mitz Pettel <opendarwin.org@mitzpettel.com>
2115 Revised and landed by Darin.
2117 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4474
2118 REGRESSION: Crash when using in-place operator on uninitialized array element
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.
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.
2128 2005-08-18 Adele Peterson <adele@apple.com>
2130 Checked "Inline Functions Hidden" box
2132 * JavaScriptCore.xcodeproj/project.pbxproj:
2134 2005-08-19 Andre Boule <aboule@apple.com>
2138 Fixed info.plist reference in project file
2140 * JavaScriptCore.xcodeproj/project.pbxproj
2142 2005-08-17 Ken Kocienda <kocienda@apple.com>
2146 Merged in changes from the opensource tree.
2148 2005-08-16 Darin Adler <darin@apple.com>
2152 - fixed crash in one of the JavaScript tests (introduced by my throwError change)
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?
2159 - changed kjs_fast_malloc so we don't have two conflicting versions of the same function
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.
2165 2005-08-16 Darin Adler <darin@apple.com>
2169 - clean up exported symbols that are not in a "KJS" namespace
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!).
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.
2187 * JavaScriptCore.xcodeproj/project.pbxproj: Added softlinking.h.
2188 * bindings/softlinking.h: Added.
2190 * kjs/nodes2string.cpp: (streamAssignmentOperatorTo): Marked this function static so it
2191 no longer has external linkage.
2193 2005-08-15 Darin Adler <darin@apple.com>
2197 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4437
2198 clean up error creation with new throwError function
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:
2258 (ArrayProtoFuncImp::callAsFunction):
2259 (ArrayObjectImp::construct):
2260 * kjs/bool_object.cpp:
2261 (BooleanProtoFuncImp::callAsFunction):
2262 * kjs/date_object.cpp:
2263 (KJS::DateProtoFuncImp::callAsFunction):
2266 (KJS::GlobalFuncImp::callAsFunction):
2267 * kjs/function_object.cpp:
2268 (FunctionProtoFuncImp::callAsFunction):
2269 (FunctionObjectImp::construct):
2271 (KJS::UndefinedImp::toObject):
2272 (KJS::NullImp::toObject):
2273 (KJS::InterpreterImp::evaluate):
2274 (KJS::InternalFunctionImp::hasInstance):
2278 (Node::setExceptionDetailsIfNeeded):
2279 (undefinedVariableError):
2280 (ProgramNode::ProgramNode):
2281 * kjs/number_object.cpp:
2282 (NumberProtoFuncImp::callAsFunction):
2284 (KJS::ObjectImp::call):
2285 (KJS::ObjectImp::defaultValue):
2286 (KJS::Error::create):
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):
2305 2005-08-15 Anders Carlsson <andersca@mac.com>
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.
2313 2005-08-15 Darin Adler <darin@apple.com>
2317 * kjs/collector.cpp: (KJS::Collector::allocate): Use a local instead of a global in one
2318 more place; slight speedup.
2320 2005-08-15 Andre Boule <set EMAIL_ADDRESS environment variable>
2324 * JavaScriptCore.xcodeproj/project.pbxproj:
2325 Added Purple target. Checking in quick before new version - patching is nasty for large changes
2328 2005-08-15 Ken Kocienda <kocienda@apple.com>
2332 Missed adding this file when I merged.
2334 * kjs/grammar_types.h: Added.
2336 2005-08-15 Ken Kocienda <kocienda@apple.com>
2340 Merged in changes from the opensource tree.
2342 2005-08-14 Darin Adler <darin@apple.com>
2346 - fixed crash observed on one of the Apple-only layout tests
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.
2352 2005-08-14 Darin Adler <darin@apple.com>
2356 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4421
2357 speed up JavaScript by inlining some label stack functions
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.
2368 * kjs/internal.cpp: Deleted the now-inline functions and the obsolete functions. Also
2369 deleted a commented-out line of code.
2371 2005-08-14 Darin Adler <darin@apple.com>
2375 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4419
2376 speed up JavaScript by improving KJS::List
2378 my measurements show an improvement of 1% on iBench JavaScript
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.
2391 2005-08-14 Darin Adler <darin@apple.com>
2395 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4417
2396 speed up JavaScript with some small changes to the property map code
2398 my measurements show an improvement of 2% on iBench JavaScript
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.
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.
2409 2005-08-14 Darin Adler <darin@apple.com>
2413 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4416
2414 speed up JavaScript with some improvements to the garbage collector
2416 my measurements show an improvement of 2% on iBench JavaScript
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
2432 (KJS::className): Ditto.
2433 (KJS::Collector::rootObjectClasses): Ditto.
2435 2005-08-14 Darin Adler <darin@apple.com>
2437 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4344
2438 REGRESSION: JavaScript crash when going back from viewing a thread (NULL protoype)
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.
2445 * kjs/function_object.cpp: (FunctionPrototypeImp::FunctionPrototypeImp): Change to
2446 not pass an explicit "0" to the base class (InternalFunctionImp) constructor.
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).
2453 (KJS::ObjectImp::ObjectImp): Add an assertion to catch NULL prototypes earlier
2454 in Development builds.
2455 (KJS::ObjectImp::setPrototype): Ditto.
2457 2005-08-12 Maciej Stachowiak <mjs@apple.com>
2461 - two simple speed improvements for a 3% speed gain
2463 * JavaScriptCore.xcodeproj/project.pbxproj: turn on -fstrict-aliasing
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)
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
2482 2005-08-12 Maciej Stachowiak <mjs@apple.com>
2484 Patch from Anders Carlsson, reviewed by me.
2486 * kjs/nodes.h: Fix build breakage.
2488 2005-08-12 Maciej Stachowiak <mjs@apple.com>
2492 - refactor function calls, 3% speedup on JS iBench.
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
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
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
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.
2530 (KJS::ActivationImp::isActivation): Ditto.
2532 2005-08-11 Maciej Stachowiak <mjs@apple.com>
2534 - added missing file from earlier checkin
2536 * kjs/grammar_types.h: Added.
2537 (KJS::makeNodePair):
2538 (KJS::makeNodeWithIdent):
2540 2005-08-11 Maciej Stachowiak <mjs@apple.com>
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.
2549 2005-08-11 Maciej Stachowiak <mjs@apple.com>
2551 - updated for one of the tests that Darin incidentally fixed.
2553 * tests/mozilla/expected.html:
2555 2005-08-10 Maciej Stachowiak <mjs@apple.com>
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.
2565 Test cases: see WebCore
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.
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.
2591 2005-08-10 Adele Peterson <adele@apple.com>
2593 Bumping version to 420+
2597 2005-08-10 Geoffrey Garen <ggaren@apple.com>
2599 -fixed <rdar://problem/4151132> REGRESSION: Some applet liveconnect calls
2600 throws privilege exception.
2602 Reviewed by richard and mjs.
2604 -I removed the global static JavaClass cache, since it violated Java
2605 security to cache classes between websites and applets.
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
2628 2005-08-10 Ken Kocienda <kocienda@apple.com>
2632 Merged in changes from the opensource tree.
2634 2005-08-08 Geoffrey Garen <ggaren@apple.com>
2636 -fixed crash caused by fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=4313
2638 - exceptionDescription now gets explicitly initialized to NULL in all
2639 the places listed below -- our wrapper classes used to take care of this
2642 * bindings/jni/jni_instance.cpp:
2643 (JavaInstance::invokeMethod):
2644 * bindings/jni/jni_runtime.cpp:
2645 (JavaField::dispatchValueFromInstance):
2646 (JavaField::dispatchSetValueToInstance):
2648 2005-08-08 Darin Adler <darin@apple.com>
2650 - forgot to delete an obsolete file
2652 * kjs/object_wrapper.h: Deleted.
2654 2005-08-08 Ken Kocienda <kocienda@apple.com>
2658 Merged in changes from the opensource tree.
2660 2005-08-07 Darin Adler <darin@apple.com>
2662 - fixed two problems compiling with gcc 4.0
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.
2668 2005-08-07 Darin Adler <darin@apple.com>
2670 Rubber stamped by Maciej.
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)
2675 * JavaScriptCore.xcodeproj/project.pbxproj: Removed object_wrapper.h.
2677 Global replaces and other wonderful stuff.
2679 * bindings/NP_jsobject.cpp:
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:
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:
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:]):
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):
2911 (KJS::Completion::Completion):
2912 (KJS::Completion::value):
2913 (KJS::Completion::isValueCompletion):
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:
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):
2932 (KJS::KRFCDate_parseDate):
2934 * kjs/date_object.h:
2936 (Debugger::exception):
2937 (Debugger::callEvent):
2938 (Debugger::returnEvent):
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:
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):
2968 (KJS::GlobalFuncImp::callAsFunction):
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:
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):
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):
3081 (KJS::List::operator[]):
3082 (KJS::ListIterator::operator->):
3083 (KJS::ListIterator::operator*):
3084 (KJS::ListIterator::operator++):
3085 (KJS::ListIterator::operator--):
3087 (KJS::staticFunctionGetter):
3088 (KJS::staticValueGetter):
3090 (KJS::cacheGlobalObject):
3091 * kjs/math_object.cpp:
3092 (MathObjectImp::getValueProperty):
3093 (MathFuncImp::MathFuncImp):
3094 (MathFuncImp::callAsFunction):
3095 * kjs/math_object.h:
3097 (Node::evaluateReference):
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):
3149 (DoWhileNode::execute):
3150 (WhileNode::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):
3165 (ParameterNode::evaluate):
3166 (FuncDeclNode::processFuncDecl):
3167 (FuncExprNode::evaluate):
3168 (SourceElementsNode::execute):
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:
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):
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:
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):
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):
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):
3288 (StringProtoFuncImp::callAsFunction):
3289 (StringObjectImp::StringObjectImp):
3290 (StringObjectImp::construct):
3291 (StringObjectImp::callAsFunction):
3292 (StringObjectFuncImp::StringObjectFuncImp):
3293 (StringObjectFuncImp::callAsFunction):
3294 * kjs/string_object.h:
3296 (TestFunctionImp::callAsFunction):
3297 (VersionFunctionImp::callAsFunction):
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):
3313 (KJS::ConstantValues::init):
3314 (KJS::ConstantValues::clear):
3315 (KJS::ConstantValues::mark):
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):
3361 2005-08-06 Maciej Stachowiak <mjs@apple.com>
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.
3371 Net result is about a 2% speedup on the JS iBench.
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()
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:
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):
3422 (InterpreterImp::InterpreterImp):
3423 (InterpreterImp::initGlobalObject):
3424 (InterpreterImp::~InterpreterImp):
3425 (InterpreterImp::evaluate):
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):
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:
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:
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):
3460 (KJS::ObjectImp::getDirectLocation):
3461 (KJS::ObjectImp::getPropertySlot):
3462 (KJS::ObjectImp::getOwnPropertySlot):
3463 * kjs/object_wrapper.h: Added.
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::):
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=):
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:
3505 2005-08-05 Adele Peterson <adele@apple.com>
3509 * JavaScriptCore.xcodeproj/project.pbxproj: Unchecked 'statics are thread safe' option.
3511 2005-08-05 Geoffrey Garen <ggaren@apple.com>
3513 -fixed <rdar://problem/4207220> REGRESSION (DENVER): Crash occurs
3514 after clicking on Hangman applet
3519 (KJS::ObjectImp::hasProperty): added check for null prototype.
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.
3525 2005-08-05 Geoffrey Garen <ggaren@apple.com>
3527 Fix by darin, reviewed by me.
3529 - rolled in fix for: <rdar://problem/4161606> JavaScript regular
3530 expressions with certain ranges of Unicode characters cause a crash
3534 * layout-tests/fast/js/regexp-big-unicode-ranges-expected.txt: Added.
3535 * layout-tests/fast/js/regexp-big-unicode-ranges.html: Added.
3538 (compile_branch): added checks for characters > 255
3540 2005-08-04 Chris Blumenberg <cblu@apple.com>
3542 if'd out bindings code until we can get it to compile on Purple
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:
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:
3601 2005-08-04 Ken Kocienda <kocienda@apple.com>
3605 Merged in changes from the opensource tree.
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).
3612 2005-08-03 Chris Blumenberg <cblu@apple.com>
3614 Disabled Netscape plug-in related bindings code.
3616 Reviewed by kocienda.
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:
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:
3638 2005-08-03 Ken Kocienda <kocienda@apple.com>
3642 Merged in changes from the opensource tree.
3644 2005-07-31 Darin Adler <darin@apple.com>
3648 - remove uses of Mac-OS-X-specific MAX macro
3649 - remove one of the many excess "APPLE_CHANGES" ifdefs
3651 * kjs/collector.cpp: (KJS::Collector::allocate): Use std::max instead of MAX.
3652 * kjs/property_map.cpp: (KJS::PropertyMap::rehash): Ditto.
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.
3658 2005-07-27 Geoffrey Garen <ggaren@apple.com>
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)
3666 * layout-tests/fast/js/toString-overrides-expected.txt: Added.
3667 * layout-tests/fast/js/toString-overrides.html: Added.
3669 * kjs/array_object.cpp:
3670 (ArrayProtoFuncImp::call):
3672 2005-07-27 Maciej Stachowiak <mjs@apple.com>
3674 Changes by Michael Kahl, reviewed by me.
3676 - fixed <rdar://problem/4194278> Need better debugging support in JavaScriptCore
3678 * JavaScriptCore.xcodeproj/project.pbxproj:
3680 (KJS::AttachedInterpreter::AttachedInterpreter):
3681 (KJS::AttachedInterpreter::~AttachedInterpreter):
3682 (Debugger::~Debugger):
3685 (Debugger::sourceParsed):
3688 (KJS::FunctionImp::call):
3689 (KJS::GlobalFuncImp::call):
3690 * kjs/function_object.cpp:
3691 (FunctionObjectImp::construct):
3695 (InterpreterImp::evaluate):
3697 (KJS::InterpreterImp::setDebugger):
3698 * kjs/interpreter.cpp:
3699 * kjs/interpreter.h:
3700 (KJS::Interpreter::imp):
3703 2005-07-27 Geoffrey Garen <ggaren@apple.com>
3705 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3381
3706 Date.prototype.setDate() incorrect for values >=128
3710 * layout-tests/fast/js/date-big-setdate-expected.txt: Added.
3711 * layout-tests/fast/js/date-big-setdate.html: Added.
3715 * kjs/date_object.cpp:
3716 (DateProtoFuncImp::call):
3718 2005-07-27 Geoffrey Garen <ggaren@apple.com>
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
3726 * layout-tests/fast/js/date-preserve-milliseconds-expected.txt: Added.
3727 * layout-tests/fast/js/date-preserve-milliseconds.html: Added.
3731 * kjs/date_object.cpp:
3733 (DateProtoFuncImp::call):
3734 (DateObjectImp::construct):
3735 (DateObjectFuncImp::call):
3737 * kjs/date_object.h:
3738 * tests/mozilla/expected.html:
3740 2005-07-27 Ken Kocienda <kocienda@apple.com>
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.
3747 2005-07-27 Ken Kocienda <kocienda@apple.com>
3751 Merged in changes from the opensource tree.
3753 2005-07-26 Justin Garcia <justin.garcia@apple.com>
3755 Added a forward declaration to fix gcc4 build error
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.
3763 * tests/mozilla/expected.html:
3765 2005-07-25 Maciej Stachowiak <mjs@apple.com>
3767 - fix mistake in last change that leads to assertion failure in the Development build
3770 (KJS::lookupGetOwnValue):
3772 2005-07-24 Maciej Stachowiak <mjs@apple.com>
3776 - http://bugzilla.opendarwin.org/show_bug.cgi?id=4124
3777 (change JavaScript property access to avoid double lookup)
3779 - 10% speedup on JavaScript iBench
3780 - 5% speedup on 24fun BenchJS benchmark
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.
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.
3790 Changed ResolveNode::evaluate plus some other places to use
3791 getProperty which does get() and hasProperty() in one lookup.
3793 Also miscellaneous code cleanup.
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:
3819 (KJS::FunctionImp::getOwnProperty):
3820 (KJS::ArgumentsImp::getOwnProperty):
3821 (KJS::ActivationImp::getOwnProperty):
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:
3832 (ResolveNode::evaluate):
3833 * kjs/number_object.cpp:
3834 (NumberObjectImp::getOwnProperty):
3835 * kjs/number_object.h:
3837 (KJS::ObjectImp::get):
3838 (KJS::ObjectImp::getOwnProperty):
3839 (KJS::ObjectImp::getProperty):
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:
3853 2005-07-25 Geoffrey Garen <ggaren@apple.com>
3855 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3971
3856 JS test suite depends on JS 1.2 behavior
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:
3864 2005-07-25 Ken Kocienda <kocienda@apple.com>
3868 Merged in changes from the opensource tree.
3870 2005-07-22 Geoffrey Garen <ggaren@apple.com>
3874 * kjs/date_object.cpp: DatePrototypeImp now identifies itself as a
3875 child class of DateInstanceImp -- this enables calls to Date.ValueOf().
3877 fixes: ecma/Date/15.9.5.js (once we enable the date tests).
3879 2005-07-25 Ken Kocienda <kocienda@apple.com>
3883 Migrated all project files to Xcode 2.1
3885 * JavaScriptCore.pbproj/.cvsignore: Removed.
3886 * JavaScriptCore.pbproj/project.pbxproj: Removed.
3887 * JavaScriptCore.xcodeproj/.cvsignore: Added.
3888 * JavaScriptCore.xcodeproj/project.pbxproj: Added.
3890 2005-07-22 Ken Kocienda <kocienda@apple.com>
3894 * JavaScriptCore.pbproj/project.pbxproj: Made install path /Purple.
3896 2005-07-20 Ken Kocienda <kocienda@apple.com>
3900 Merged changes from opensource tree.
3902 2005-07-20 Maciej Stachowiak <mjs@apple.com>
3904 Patch from Trey Matteson <trey@usa.net>, reviewed by me.
3906 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3956
3907 some of WebKit builds with symbols, some doesn't
3909 * JavaScriptCore.pbproj/project.pbxproj: Generate symbols even for
3912 2005-07-19 Geoffrey Garen <ggaren@apple.com>
3914 -fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3991
3915 JSC doesn't implement Array.prototype.toLocaleString()
3917 -test failure: ecma_3/Array/15.4.4.3-1.js
3921 * kjs/array_object.cpp:
3922 (ArrayProtoFuncImp::call): now searches for toString and
3923 toLocaleString overrides in the array's elements
3925 * tests/mozilla/expected.html: failures are under 100! woohoo!
3927 2005-07-19 Darin Adler <darin@apple.com>
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).
3934 - one other tiny tweak (so sue me)
3936 * bindings/runtime_root.cpp: Remove unneeded declaration.
3938 2005-07-19 Darin Adler <darin@apple.com>
3940 Reviewed by Geoff Garen.
3942 - eliminated try wrappers for get/put/call since we don't use C++ exceptions any more
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.
3950 2005-07-18 Geoffrey Garen <ggaren@apple.com>
3952 -fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4008
3953 Error objects report incorrect length
3957 * kjs/error_object.cpp: Error objects now include a length property
3958 (ErrorObjectImp::ErrorObjectImp):
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
3964 2005-07-18 Ken Kocienda <kocienda@apple.com>
3968 Merged changes from opensource tree.
3970 2005-07-15 Geoffrey Garen <ggaren@apple.com>
3972 -rolled in KDE fixes for http://bugzilla.opendarwin.org/show_bug.cgi?id=3601
3973 Error instance type info
3977 * kjs/error_object.cpp:
3978 - Created ErrorInstanceImp class for Error() objects.
3979 - Changed parent object for Native Errors to "Function" (matches
3981 (ErrorInstanceImp::ErrorInstanceImp):
3982 (ErrorProtoFuncImp::call):
3983 (ErrorObjectImp::construct):
3984 (NativeErrorImp::construct):
3986 * kjs/error_object.h:
3987 (KJS::ErrorInstanceImp::classInfo):
3988 * kjs/object.h: made comment more informative about ClassInfo
3990 * tests/mozilla/expected.html:
3992 2005-07-15 Ken Kocienda <kocienda@apple.com>
3996 Merged changes from opensource tree.
3998 2005-07-14 Geoffrey Garen <ggaren@apple.com>
4000 - fixed: JS test suite expects an out of memory error
4001 that our memory efficiency avoids
4005 * tests/mozilla/js1_5/Array/regress-157652.js:
4006 test now expects normal execution
4008 * tests/mozilla/expected.html:
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()
4015 ecma_3/Function/regress-104584.js
4019 * kjs/interpreter.cpp:
4020 (Interpreter::finalCheck): removed misleading while && comment
4022 * kjs/testkjs.cpp: added "gc" function to global object
4023 (TestFunctionImp::):
4024 (TestFunctionImp::call):
4027 * tests/mozilla/expected.html:
4029 2005-07-14 Geoffrey Garen <ggaren@apple.com>
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
4034 -patch by Martijn Klingens <klingens@kde.org>
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:
4045 * kjs/date_object.cpp:
4046 * kjs/date_object.h:
4050 * kjs/error_object.cpp:
4051 * kjs/error_object.h:
4054 * kjs/function_object.cpp:
4055 * kjs/function_object.h:
4057 * kjs/identifier.cpp:
4061 * kjs/interpreter.cpp:
4062 * kjs/interpreter.h:
4063 * kjs/interpreter_map.cpp:
4064 * kjs/interpreter_map.h:
4071 * kjs/math_object.cpp:
4072 * kjs/math_object.h:
4075 * kjs/nodes2string.cpp:
4076 * kjs/number_object.cpp:
4077 * kjs/number_object.h:
4080 * kjs/object_object.cpp:
4081 * kjs/object_object.h:
4082 * kjs/operations.cpp:
4084 * kjs/property_map.cpp:
4085 * kjs/property_map.h:
4086 * kjs/reference.cpp:
4088 * kjs/reference_list.cpp:
4089 * kjs/reference_list.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:
4106 2005-07-14 Geoffrey Garen <ggaren@apple.com>
4108 -fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3970
4109 throw statements fail inside eval statements
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());
4120 (ThrowNode::execute): removed duplicate KJS_CHECKEXCEPTION
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.
4126 * tests/mozilla/expected.html:
4128 2005-07-14 Geoffrey Garen <ggaren@apple.com>
4130 -landed fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=3412
4131 Object.prototype is missing toLocaleString
4133 - patch by Mark Rowe (bdash) <opendarwin.org@bdash.net.nz>
4135 -layout test info in webcore changelog
4139 * kjs/object_object.cpp:
4140 (ObjectPrototypeImp::ObjectPrototypeImp):
4141 (ObjectProtoFuncImp::call):
4142 * kjs/object_object.h:
4143 (KJS::ObjectProtoFuncImp::):
4145 2005-07-13 Ken Kocienda <kocienda@apple.com>
4149 Merged changes from opensource tree.
4151 2005-07-12 Geoffrey Garen <ggaren@apple.com>
4156 (KJS::IndexToNameMap::operator[]): fixed infinite recursion
4159 2005-07-12 Geoffrey Garen <ggaren@apple.com>
4161 -fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3881
4162 arguments object should share values with function parameters
4166 ArgumentsImp now uses a simple hash lookup to share values
4167 with the activation object.
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):
4184 * tests/mozilla/expected.html: updated results
4186 2005-07-11 Ken Kocienda <kocienda@apple.com>
4190 Merged changes from opensource tree.
4192 * kjs/error_object.cpp:
4193 (ErrorProtoFuncImp::call):
4195 (KJS::ArgumentsImp::ArgumentsImp):
4199 2005-07-09 Maciej Stachowiak <mjs@apple.com>
4201 - backing out my earlier collector change, it causes a performance regression in TOT
4203 * kjs/collector.cpp:
4204 (KJS::Collector::allocate):
4206 2005-07-08 Maciej Stachowiak <mjs@apple.com>
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.
4213 * kjs/collector.cpp:
4214 (KJS::Collector::allocate):
4216 2005-07-08 Vicki Murley <vicki@apple.com>
4218 Fix from Carsten Guenther, reviewed by Maciej
4220 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3644 (Error string representation)
4222 Switch from "-" to ":" in error strings.
4224 * kjs/error_object.cpp:
4225 (ErrorProtoFuncImp::call):
4226 * tests/mozilla/expected.html:
4228 2005-07-08 Geoffrey Garen <ggaren@apple.com>
4230 -rolled in patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=3878
4231 arguments object should be an object not an array
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
4241 2005-07-07 Eric Seidel <eseidel@apple.com>
4245 * kjs/grammar.y: removed #define YYMAXDEPTH 0 for bison 2.0
4246 http://bugzilla.opendarwin.org/show_bug.cgi?id=3882
4248 2005-07-06 Ken Kocienda <kocienda@apple.com>
4252 Merged in everything from the open source tree since this tree was created.
4254 2005-07-03 Maciej Stachowiak <mjs@apple.com>
4256 Original patch from Mark Rowe <opendarwin.org@bdash.net.nz>, reviewed by me.
4257 Fixes to patch by me, reviewed by John Sullivan.
4259 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3293
4262 * tests/mozilla/expected.html: Two tests newly pass.
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):
4277 (KJS::FunctionImp::hasOwnProperty):
4278 (KJS::ActivationImp::hasOwnProperty):
4282 (KJS::ObjectImp::hasProperty):
4283 (KJS::ObjectImp::hasOwnProperty):
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:
4295 2005-07-01 Geoffrey Garen <ggaren@apple.com>
4297 -landed patch by Eric Seidel <macdome@opendarwin.org>
4299 -for http://bugzilla.opendarwin.org/show_bug.cgi?id=3657
4300 GroundWork: Moving some functions from khtml->jsc following kjs TOT
4302 - no layout test necessary yet - only groundwork
4307 (KJS::cacheGlobalObject):
4309 2005-07-01 Geoffrey Garen <ggaren@apple.com>
4311 -landed patch by Carsten Guenther <cguenther@gmail.com>
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)
4317 mozilla/ecma_3/Date/15.9.5.5.js
4318 layout-tests/fast/js/date-parse-test.html
4322 * kjs/date_object.cpp:
4331 (DateProtoFuncImp::call):
4332 (DateObjectImp::construct):
4334 (ymdhms_to_seconds):
4337 (KJS::KRFCDate_parseDate):
4338 * kjs/date_object.h:
4339 * tests/mozilla/expected.html: updated expected results to reflect fix
4341 2005-07-01 Geoffrey Garen <ggaren@apple.com>
4343 -fixed <rdar://problem/4168186> JavaScript fails to throw exceptions
4344 for invalid return statements
4347 ecma/Statements/12.9-1-n.js
4348 ecma_2/Exceptions/lexical-052.js
4349 ecma_2/Exceptions/statement-009.js
4351 Reviewed by sullivan.
4354 (ReturnNode::execute): now throws exception if return is not inside
4357 * tests/mozilla/expected.html: updated to reflect fix
4359 2005-07-01 Geoffrey Garen <ggaren@apple.com>
4361 Reviewed by sullivan.
4363 * tests/mozilla/expected.html: Updated test results for last fix.
4365 2005-07-01 Geoffrey Garen <ggaren@apple.com>
4367 -fixed <rdar://problem/4168161> JavaScript fails to throw an exception
4368 for invalid function calls
4370 Reviewed by sullivan.
4372 Relevant mozilla test: ecma_3/Exceptions/regress-95101.js
4375 (FunctionCallNode::evaluate): evaluate now checks for an exception
4376 after resolving a function name (in case the function is undefined)
4378 2005-07-01 Eric Seidel <eseidel@apple.com>
4382 * kjs/interpreter.h:
4383 (KJS::Context::curStmtFirstLine): stub for compatibility with KDE
4385 (KJS::Value::isValid): compatibility with KDE
4386 http://bugzilla.opendarwin.org/show_bug.cgi?id=3687
4388 2005-07-01 Eric Seidel <eseidel@apple.com>
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
4396 2005-06-30 Geoffrey Garen <ggaren@apple.com>
4398 -rolled in KDE fix to <rdar://problem/4167660> JavaScript fails to
4399 throw exceptions for invalid break/continue statements
4401 No layout tests because it's already covered by the Mozilla suite
4405 * kjs/internal.h: LabelStack now tracks where you are relative to
4406 switch and iteration (loop) statements
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):
4417 These files were updated to use the new LabelStack:
4418 (DoWhileNode::execute):
4419 (WhileNode::execute):
4421 (ForInNode::execute):
4422 (SwitchNode::execute):
4424 These files were updated to throw exceptions for invalid
4425 break/continue statements:
4426 (BreakNode::execute):
4427 (ContinueNode::execute):
4429 * tests/mozilla/expected.html: Updated expected results to reflect fix
4431 2005-06-30 Kevin Decker <kdecker@apple.com>
4435 fixed: <rdar://problem/4166838> failed assertion in`Interpreter::lockCount() > 0
4437 no layout test added; this is in the bindings code.
4439 * bindings/objc/WebScriptObject.mm:
4440 (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]): make sure to lock and unlock the interpreter around allocations.
4442 2005-06-29 Geoffrey Garen <ggaren@apple.com>
4444 Patch by Francisco Tolmasky <tolmasky@gmail.com>
4446 - fixes http://bugzilla.opendarwin.org/show_bug.cgi?id=3667
4447 Core JavaScript 1.5 Reference:Objects:Array:forEach
4449 See WebCore Changelog for layout tests added.
4453 * kjs/array_object.cpp:
4454 (ArrayProtoFuncImp::call):
4455 * kjs/array_object.h:
4456 (KJS::ArrayProtoFuncImp::):
4458 2005-06-29 Geoffrey Garen <ggaren@apple.com>
4460 Patch contributed by Oliver Hunt <ojh16@student.canterbury.ac.nz>
4462 -fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3743
4463 Incorrect error message given for certain calls
4465 See WebCore Changelog for layout test added.
4470 (KJS::ObjectImp::defaultValue):
4472 2005-06-29 Geoffrey Garen <ggaren@apple.com>
4474 Rolling out date patch from 6-28-05 because it breaks
4475 fast/js/date-parse-test
4479 * kjs/date_object.cpp:
4481 (DateProtoFuncImp::call):
4482 (DateObjectImp::construct):
4484 (ymdhms_to_seconds):
4486 (KJS::KRFCDate_parseDate):
4487 * kjs/date_object.h:
4488 * tests/mozilla/expected.html:
4490 2005-06-29 Geoffrey Garen <ggaren@apple.com>
4494 -fixes http://bugzilla.opendarwin.org/show_bug.cgi?id=3750
4495 build fails with KJS_VERBOSE set
4497 * kjs/nodes.cpp: changed debug print statement to use UString
4498 (VarDeclNode::evaluate):
4499 * kjs/reference.cpp: ditto
4500 (KJS::Reference::putValue):
4502 2005-06-28 Geoffrey Garen <ggaren@apple.com>
4504 Patch contributed by Carsten Guenther <cguenther@gmail.com>.
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)
4511 * kjs/date_object.cpp:
4520 (DateProtoFuncImp::call):
4521 (DateObjectImp::construct):
4523 (ymdhms_to_seconds):
4526 (KJS::KRFCDate_parseDate):
4527 * kjs/date_object.h:
4528 * tests/mozilla/expected.html: updated expected test results to reflect fix
4530 2005-06-26 Maciej Stachowiak <mjs@apple.com>
4534 - replace hash functions with better ones
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.
4544 (KJS::UString::Rep::computeHash): Use SuperFastHash algorithm.
4546 2005-06-22 Darin Adler <darin@apple.com>
4548 Change by Anders Carlsson.
4551 - fixed <http://bugzilla.opendarwin.org/show_bug.cgi?id=3294>
4552 String.prototype.replace() fails with function as second param
4554 * kjs/string_object.cpp: (replace): Added code to handle functions.
4556 * tests/mozilla/expected.html: Updated since ecma_3/RegExp/regress-209067.js is fixed now.
4558 * tests/mozilla/run-mozilla-tests: Fix a minor coding style issue that leads to a warning each
4559 time we run the tests.
4561 2005-06-21 Adele Peterson <adele@apple.com>
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
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):
4581 (KJS::FunctionImp::hasProperty):
4582 (KJS::ActivationImp::hasProperty):
4585 (KJS::ObjectImp::hasProperty):
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:
4597 2005-06-21 Darin Adler <darin@apple.com>
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
4603 * kjs/grammar_wrapper.cpp: Removed.
4605 2005-06-21 Adele Peterson <adele@apple.com>
4607 Patch from Anders Carlsson <andersca@mac.com>, reviewed by Darin.
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}
4612 * pcre/pcre.c: (pcre_compile): Remember the last char length so it can be subtracted correctly if needed.
4614 2005-06-21 Geoffrey Garen <ggaren@apple.com>
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
4622 (FuncDeclNode::processFuncDecl): Functions now have DontDelete and Internal attributes set when appropriate.
4625 * tests/mozilla/expected.html: Updated for one new success.
4626 - see also test case added in WebCore.
4628 2005-06-20 Maciej Stachowiak <mjs@apple.com>
4630 Reviewed by Darin(first pass) and Hyatt.
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
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
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
4650 * kjs/grammar.y: Add rules for const declarations.
4651 * kjs/keywords.table: Add const keyword.
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.
4659 (KJS::VarDeclNode::): Add declaration of type enum, extra constructor parameter.
4660 (KJS::VarStatementNode::VarStatementNode): Irrelevant change.
4662 (KJS::GlobalFuncImp::call): Process var decls before evaluating.
4664 2005-06-20 Maciej Stachowiak <mjs@apple.com>
4666 Patch from Mark Rowe <opendarwin.org@bdash.net.nz>, reviewed by me.
4668 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3293
4671 * tests/mozilla/expected.html: Updated for two fixed tests.
4672 - also added a layout test
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):
4687 (KJS::FunctionImp::hasOwnProperty):
4688 (KJS::ActivationImp::hasOwnProperty):
4691 (KJS::ObjectImp::hasProperty):
4692 (KJS::ObjectImp::hasOwnProperty):
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:
4704 2005-06-18 Darin Adler <darin@apple.com>
4706 Reviewed by Eric Seidel.
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.
4711 2005-06-18 Darin Adler <darin@apple.com>
4713 Change by Finlay Dobbie.
4716 - fixed <http://bugzilla.opendarwin.org/show_bug.cgi?id=3331>
4717 10.3.9 Build Failure: NSString may not respond to `+stringWithCString:encoding:'
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.
4723 2005-06-16 Geoffrey Garen <ggaren@apple.com>
4725 Fixed: <rdar://problem/4151759> 'delete' fails on variables declared inside 'eval' statements.
4730 (KJS::ContextImp::codeType): Added code type accessor for execution context objects.
4732 (ContextImp::ContextImp): Reflects change to ContextImp::codeType.
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.
4737 2005-06-14 Geoffrey Garen <ggaren@apple.com>
4739 Updated expected.html to reflect fix to <rdar://problem/4147745>.
4743 * tests/mozilla/expected.html:
4745 2005-06-14 Geoffrey Garen <ggaren@apple.com>
4747 Fixed: <rdar://problem/4147745> JavaScript discards locally defined "arguments" property
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
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.
4760 * kjs/function.h: ActivationImp::put no longer overrides ObjectImp::put
4762 2005-06-10 Darin Adler <darin@apple.com>
4764 Change by Mark Rowe <opendarwin.org@bdash.net.nz>.
4767 - further improvements to exception file/line number fix
4769 * kjs/nodes.h: Added setExceptionDetailsIfNeeded function.
4770 * kjs/nodes.cpp: Updated macros to call the new setExceptionDetailsIfNeeded function.
4771 (Node::setExceptionDetailsIfNeeded): Added.
4773 2005-06-09 Darin Adler <darin@apple.com>
4775 Change by Mark Rowe <opendarwin.org@bdash.net.nz>
4778 * kjs/nodes.cpp: Get rid of unneeded this->.
4780 2005-06-08 Maciej Stachowiak <mjs@apple.com>
4782 Change by Mark Rowe <opendarwin.org@bdash.net.nz>
4785 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3327
4786 (Exception When Setting Style to Invalid Value Lacks Line/File Information)
4788 * kjs/nodes.cpp: Include source file and line number when making exception in
4789 KJS_CHECKEXCEPTIONVALUE.
4791 2005-06-07 Darin Adler <darin@apple.com>
4793 Change by Toby Peterson <toby@opendarwin.org>.
4796 * JavaScriptCore.pbproj/project.pbxproj: Allow bison 2.0, which generates the file
4797 with a different name.
4799 2005-06-07 Darin Adler <darin@apple.com>
4801 Change by Toby Peterson <toby@opendarwin.org>.
4804 * kjs/grammar.y: Remove bogus extra line from grammar.y. Toby got this change from KDE KJS.
4806 2005-06-06 Darin Adler <darin@apple.com>
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.
4811 2005-06-04 Darin Adler <darin@apple.com>
4815 - add libicu headers
4817 * JavaScriptCore.pbproj/project.pbxproj: Added icu directory to header search path.
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.
4832 2005-05-19 Darin Adler <darin@apple.com>
4836 - turned off exceptions and RTTI; seems to cut JavaScriptCore code size by about 22%
4838 * JavaScriptCore.pbproj/project.pbxproj: Turn off exceptions and RTTI for both
4839 the framework and testkjs tool.
4841 2005-05-18 Darin Adler <darin@apple.com>
4845 - got rid of code that depended on RTTI
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.
4851 2005-05-18 Darin Adler <darin@apple.com>
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
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.
4863 2005-05-16 Darin Adler <darin@apple.com>
4867 - fixed issues preventing us from compiling with newer versions of gcc 4.0
4870 (KJS::operator==): Remove redundant and illegal KJS:: prefix on this function's definition.
4871 (KJS::operator<): Ditto.
4872 (KJS::compare): Ditto.
4874 2005-05-09 Darin Adler <darin@apple.com>
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
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.
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.
4906 (KJS::boolean): Ditto.
4907 (KJS::string): Ditto.
4911 (KJS::number): Ditto.
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.
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.
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.
4927 * kjs/collector.h: Remove non-conservative-GC code path and also take out some
4928 unneeded APPLE_CHANGES.
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.
4944 (NumberImp::create): Ditto.
4945 (InterpreterImp::globalInit): Ditto.
4946 (InterpreterImp::globalClear): Ditto.
4948 (KJS::List::markProtectedLists): Ditto.
4949 (KJS::List::clear): Ditto.
4950 (KJS::List::append): Ditto.
4952 (KJS::List::List): Ditto.
4953 (KJS::List::deref): Ditto.
4954 (KJS::List::operator=): Ditto.
4956 (KJS::gcProtect): Ditto.
4957 (KJS::gcUnprotect): Ditto.
4959 2005-05-09 Chris Blumenberg <cblu@apple.com>
4961 Workaround gcc 3.3 internal compiler errors.
4965 * bindings/objc/WebScriptObject.mm:
4966 (-[WebScriptObject stringRepresentation]): call [NSString stringWithCString:encoding] rather than using @""
4968 2005-05-09 Darin Adler <darin@apple.com>
4970 * Makefile.am: Don't set up PBXIntermediatesDirectory explicitly;
4971 Not needed to make builds work, spews undesirable error messages too.
4973 2005-05-06 Darin Adler <darin@apple.com>
4977 - make building multiple trees with make work better
4979 * Makefile.am: Set up Xcode build directory before invoking xcodebuild.
4981 2005-05-04 Maciej Stachowiak <mjs@apple.com>
4985 <rdar://problem/4086570> Crash in JavaScriptCore with RSS Visualizer
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.
4991 2005-05-04 Darin Adler <darin@apple.com>
4993 Reviewed by Dave Hyatt.
4995 - another gcc-4.0-related fix
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.
5000 2005-05-04 Darin Adler <darin@apple.com>
5002 Reviewed by Dave Hyatt.
5004 - fixed build rules to match other projects
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
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.
5015 2005-05-04 Maciej Stachowiak <mjs@apple.com>
5017 - revert presumably accidental change to mozilla JS test expected results, this
5018 was making the tests fail.
5020 * tests/mozilla/expected.html:
5022 2005-05-03 Richard Williamson <rjw@apple.com>
5024 Fixed <rdar://problem/4102644> Crash in LiveConnect below KJS::Bindings::JavaInstance::stringValue() const
5026 Correctly handle accessing nil objects from a Java object array.
5030 * bindings/jni/jni_runtime.cpp:
5031 (JavaArray::valueAt):
5033 2005-05-01 Darin Adler <darin@apple.com>
5035 - move to Xcode native targets and stop checking in generated files
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.
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.
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.
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.
5062 2005-04-28 Darin Adler <darin@apple.com>
5064 Reviewed by Dave Harrison.
5066 - fixed problems preventing us from compiling with gcc 4.0
5068 * JavaScriptCore.pbproj/project.pbxproj: Removed -Wmissing-prototypes from
5069 WARNING_CPLUSPLUSFLAGS since it's now a C-only warning.
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.
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.
5091 2005-04-26 Richard Williamson <rjw@apple.com>
5093 Fixed <rdar://problem/4098713> Scripting API is incompatible with Mozilla
5095 We were incompatible with Mozilla's implementation of the scripting APIs in
5098 Their NPN_SetException has the following signature:
5100 void NPN_SetException(NPObject *npobj, const NPUTF8 *message);
5104 void NPN_SetException (NPObject * npobj, const NPString *message);
5106 Also, they expect the string returned from NPN_UTF8FromIdentifier() to be freed by caller.
5109 I changed both behaviors to match Mozilla.
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:
5122 2005-04-26 Maciej Stachowiak <mjs@apple.com>
5126 <rdar://problem/4092136> reproducible crash in KJS::kjs_fast_realloc loading maps.google.com
5128 * kjs/string_object.cpp:
5129 (StringObjectFuncImp::call): Allocate adopted ustring buffer properly.
5131 2005-04-22 Darin Adler <darin@apple.com>
5135 * kjs/ustring.cpp: (KJS::UString::UTF8String): Fix off-by-one error in surrogate pair logic.
5137 2005-04-22 Darin Adler <darin@apple.com>
5141 - fixed <rdar://problem/4090046> JavaScript throw statement causes parse error when no semicolon is present
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.
5146 * kjs/grammar.cpp: Regenerated.
5148 === JavaScriptCore-412.1 ===
5150 2005-04-20 Darin Adler <darin@apple.com>
5154 - speedups, total 12% on JavaScript iBench
5156 I ran the benchmark under Shark and followed its advice a lot, mainly.
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
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.
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.
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.
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.
5185 * kjs/lookup.cpp: (keysMatch): Marked this inline.
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
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
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
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
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.
5219 (KJS::isNaN): Inlined.
5220 (KJS::isInf): Ditto.
5221 (KJS::isPosInf): Ditto.
5222 (KJS::isNegInf): Ditto.
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.
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.
5251 * kjs/protected_values.h: Remove unneeded class name qualifiers.
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
5261 * kjs/simple_number.h:
5262 (KJS::SimpleNumber::integerFits): Added. For use when the parameter is known to be integral.
5264 * kjs/string_object.cpp: (StringProtoFuncImp::call): Create the number without first converting
5265 to double in various cases that involve integers.
5268 (KJS::UString::attach): Inlined.
5269 (KJS::UString::release): Inlined.
5271 (KJS::UString::find): Get first character outside the loop instead of re-fetching it each time.
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.
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.
5289 2005-04-14 Maciej Stachowiak <mjs@apple.com>
5291 - make fast_malloc.h a private header, not project
5293 * JavaScriptCore.pbproj/project.pbxproj:
5295 2005-04-12 Maciej Stachowiak <mjs@apple.com>
5297 Reviewed by Richard.
5299 <rdar://problem/4089734> JavaScript iBench can be sped up ~10% with custom allocator
5301 - use custom single-threaded malloc for all non-GC JavaScriptCore
5302 allocations, for a 9.1% speedup on JavaScript iBench
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:
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.
5332 2005-04-11 Maciej Stachowiak <mjs@apple.com>
5336 <rdar://problem/4086819> Avoid using protect count hash table so much for 5.6% JS iBench speedup
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.
5342 Net result is a 5.6% speedup on JavaScript iBench
5344 * kjs/collector.cpp:
5345 (KJS::Collector::collect): mark protected lists as appropriate.
5348 (KJS::ListImp::markValues): Moved implementation from List::markValues
5349 (KJS::List::markProtectedLists): Implemented - scan pool and overflow
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):
5372 2005-03-16 Jens Alfke <jens@apple.com>
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.
5382 (KJS::GlobalFuncImp::call):
5384 2005-03-15 Richard Williamson <rjw@apple.com>
5386 Fixed <rdar://problem/4053276> WebScripting protocol in WebKit cannot convert Boolean in Javascript to BOOL in Objective-C
5388 Added JavaScript boolean to type that can be converted to
5389 ObjC scalar parameters.
5391 Reviewed by Ken Kocienda.
5393 * bindings/objc/objc_utility.mm:
5394 (KJS::Bindings::convertValueToObjcValue):
5410 2005-02-21 Darin Adler <darin@apple.com>
5412 * kjs/date_object.cpp: (timetUsingCF): Fixed indenting.
5414 2005-02-17 Richard Williamson <rjw@apple.com>
5416 Fixed <rdar://problem/4003251> Safari crashed at www.icelandair.com in LiveConnect code converting a Java object to a string
5420 Reviewed by John Sullivan.
5422 * bindings/jni/jni_runtime.cpp:
5423 (JavaField::valueFromInstance):
5427 2005-02-11 Richard Williamson <rjw@apple.com>
5429 Fixed <rdar://problem/3985118> DOM objects not being marshaled on JS->native calls
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.
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:
5465 2005-02-10 Darin Adler <darin@apple.com>
5467 "Reviewed" by Richard (he told me the file was obsolete).
5469 - got rid of an obsolete file
5471 * bindings/npsap.h: Removed.
5477 2005-02-03 Richard Williamson <rjw@apple.com>
5479 Fixed <rdar://problem/3972905> CrashTracer: ...36 crashes at com.apple.WebCore: khtml::CSSStyleSelector::applyDeclarations + 120
5481 Revert to old (and correct) behavior of returning runtime object
5482 when passed as a parameter, rather than it's corresponding DOM
5487 * bindings/objc/WebScriptObject.mm:
5488 (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
5492 2005-01-28 Richard Williamson <rjw@apple.com>
5494 Fixed <rdar://problem/3980389> JavaScript bindings access incorrect runtime object
5496 Only use special 'back door' property to get the runtime object if thisObj isn't
5497 already a runtime object.
5499 <gratuitous> Cleaned up a couple of strcmp on ClassInfo name. Used == on
5500 ClassInfo pointer instead.
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):
5513 2005-01-26 Richard Williamson <rjw@apple.com>
5515 Fixed <rdar://problem/3972522> (179-180) 40% slowdown on iBench JavaScript test
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
5522 As a result of this fix I also dramatically cleaned up how runtime objects are
5523 accessed. The path mostly *removes* code.
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:
5537 (KJS::ObjectImp::ObjectImp):
5540 2005-01-20 Darin Adler <darin@apple.com>
5542 Reviewed by me, changes by Han Ming Ong.
5544 - <rdar://problem/3964302> SWB: A few files need to be updated to be compilable under GCC 4.0
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.
5549 2005-01-20 Richard Williamson <rjw@apple.com>
5551 Fixed <rdar://problem/3964634> undefined property value from binding seems to evaluate to true in an if statement
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.
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:]):
5571 2005-01-19 Richard Williamson <rjw@apple.com>
5573 Fixed <rdar://problem/3853676> Browser Crash when accessing CCWeb Progress Page - KJS::Bindings::convertValueToJValue
5575 Fixed the following problems with LiveConnect that are demonstrated by the application
5576 described in 3853676.
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.
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:
5595 2005-01-18 Richard Williamson <rjw@apple.com>
5597 Fixed several issues all arising from analysis of plugin detection code at ifilm.com:
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
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.
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):
5625 (KJS::ObjectImp::ObjectImp):
5627 (KJS::ObjectImp::forwardingScriptMessage):
5628 (KJS::ObjectImp::setForwardingScriptMessage):
5630 2005-01-18 Richard Williamson <rjw@apple.com>
5632 Back out a change that was incorrectly committed yesterday.
5636 * bindings/objc/objc_utility.mm:
5637 (KJS::Bindings::convertValueToObjcValue):
5639 2005-01-17 Richard Williamson <rjw@apple.com>
5641 Fixed <rdar://problem/3753030> Need to ensure same origin for plugin binding invocations (origin security rules)
5643 Keep track of originating execution context and target execution
5644 context for native JS object wrappers, and perform appropriate
5647 Reviewed by David Harrison.
5649 * bindings/NP_jsobject.cpp:
5651 (_NPN_CreateScriptObject):
5656 (_NPN_RemoveProperty):
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):
5709 2005-01-13 Vicki Murley <vicki@apple.com>
5713 - fix <rdar://problem/3946836> Safari about box lists 2004 instead of 2005
5715 * JavaScriptCore.pbproj/project.pbxproj: bump "2004" to "2005"
5717 2005-01-12 Richard Williamson <rjw@apple.com>
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.)
5725 * bindings/runtime_root.cpp:
5726 (KJS::Bindings::removeNativeReference):
5728 2005-01-12 Richard Williamson <rjw@apple.com>
5730 Fixed <rdar://problem/3923356> REGRESSION: Java/JavaScript security checks working incorrectly
5732 We were always returning the first "root" object for all runtime
5733 objects. Changed 0 in loop to i, the index.
5735 Reviewed by David Harrison.
5737 * bindings/runtime_root.cpp:
5738 (KJS::Bindings::rootForImp):
5740 2005-01-11 Richard Williamson <rjw@apple.com>
5742 Fixed <rdar://problem/3887930> Must use new Java plug-in API to get/set fields so exception handling works (fixes many LiveConnect crashes)
5744 Use the new dispatching API to invoke JNI, rather than calling JNI
5747 Reviewed by David Harrison.
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):
5766 2004-12-17 Maciej Stachowiak <mjs@apple.com>
5770 <rdar://problem/3926869> Opening caches window after running PLT causes crash
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.
5778 2004-12-16 Darin Adler <darin@apple.com>
5782 - fixed <rdar://problem/3920764> Unimplemented String methods toLocaleLowerCase and toLocaleUpperCase
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.
5789 2004-12-14 Richard Williamson <rjw@apple.com>
5791 Pass URL of plugin view when call into JNI.
5795 * bindings/jni/jni_objc.mm:
5796 (KJS::Bindings::dispatchJNICall):
5798 2004-12-13 Richard Williamson <rjw@apple.com>
5800 Fixed <rdar://problem/3827799> repro. crash with IBM Rational ClearCase Web under Safari (Java/LiveConnect-related)
5802 Add support for calling static Java methods from JavaScript.
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:
5818 2004-12-13 Richard Williamson <rjw@apple.com>
5820 Fixed <rdar://problem/3887767> LiveConnect doesn't propagate Java exceptions back to JavaScript (prevents security suite from running)
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:
5833 2004-12-07 Maciej Stachowiak <mjs@apple.com>
5837 <rdar://problem/3908017> REGRESSION (172-173): assertion in ObjectImp::construct trying to create JS error (24hourfitness.com)
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!
5844 (KJS::ProtectedValue::ProtectedValue):
5845 (KJS::ProtectedValue::operator=):
5846 (KJS::ProtectedObject::ProtectedObject):
5847 (KJS::ProtectedObject::operator=):
5849 Also fixed a bug in the GC test mode that compares the results of
5850 the old collector and the new collector.
5857 2004-11-23 Richard Williamson <rjw@apple.com>
5859 Fixed <rdar://problem/3890385> field and method cache incorrectly capped (c bindings)
5863 * bindings/c/c_class.cpp:
5864 (CClass::_commonInit):
5866 2004-11-21 Maciej Stachowiak <mjs@apple.com>
5870 <rdar://problem/3889696> Enable conservative garbage collection for JavaScript
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):
5887 2004-11-15 Richard Williamson <rjw@apple.com>
5889 Fixed <rdar://problem/3880561> Default string value of ObjC object in JS should be [obj description].
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):
5902 2004-11-09 Chris Blumenberg <cblu@apple.com>
5904 Fixed: <rdar://problem/3872724> soft link against JavaVM to save ~2MB RSHRD
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
5917 2004-11-04 Darin Adler <darin@apple.com>
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
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
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.
5944 2004-11-03 David Harrison <harrison@apple.com>
5948 Eliminate the use of a marker file to determine how to build.
5953 2004-11-01 Richard Williamson <rjw@apple.com>
5955 Fixed <rdar://problem/3861469> Latest Real player crashes Safari on some sites.
5959 * bindings/c/c_instance.cpp:
5960 (CInstance::invokeMethod):
5961 (CInstance::invokeDefaultMethod):
5962 Initialize out parameters to void type.
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.
5971 2004-11-01 Richard Williamson <rjw@apple.com>
5973 Fixed <rdar://problem/3861257> WebUndefined should be returned for undefined values
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.
5985 2004-11-01 Darin Adler <darin@apple.com>
5987 - fixed <rdar://problem/3855573> Remove reference to "WebScriptMethods" from WebScriptObject.h comments
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.
5997 2004-10-22 Ken Kocienda <kocienda@apple.com>
6001 * JavaScriptCore.pbproj/project.pbxproj:
6002 Add GCC_ENABLE_OBJC_GC and GCC_FAST_OBJC_DISPATCH flags.
6006 2004-10-13 Richard Williamson <rjw@apple.com>
6008 Moved boolean checks prior to NSNumber checks. booleans are
6011 Follow on to <rdar://problem/3821515> binding layer needs to convert NSNumber-bools to js type boolean not number.
6015 * bindings/objc/objc_utility.mm:
6016 (KJS::Bindings::convertObjcValueToValue):
6018 2004-10-12 Richard Williamson <rjw@apple.com>
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.
6026 * bindings/objc/WebScriptObject.mm:
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:
6036 2004-10-09 Darin Adler <darin@apple.com>
6040 - fixed <rdar://problem/3804661> REGRESSION: JavaScriptCore framework now has two init routines
6042 * bindings/NP_jsobject.cpp: Fixed unnecessarily-complex globals set up that was
6043 creating an init routine.
6045 * kjs/ustring.cpp: Changed around the UString::Rep::empty construction to not
6046 require a global constructor that creates an init routine.
6048 2004-10-09 Darin Adler <darin@apple.com>
6052 - fixed <rdar://problem/3822618> REGRESSION (164-165): expedia.com's popup help doesn't work
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.
6059 2004-10-07 Richard Williamson <rjw@apple.com>
6061 Added simple JavaScript call tracing. Very useful for
6062 debugging complex pages.
6064 Tracing is only available in development builds and is
6067 (gdb) set traceJavaScript = 1
6071 setTraceJavaScript(true)
6073 Function, args, and return values are printed to console. Very
6078 * kjs/function_object.cpp:
6079 (FunctionProtoFuncImp::call):
6081 (KJS::Object::call):
6085 2004-10-05 Richard Williamson <rjw@apple.com>
6087 Fixed <rdar://problem/3819234> NPN_SetException (and throwException:) isn't implemented
6091 * bindings/NP_jsobject.cpp:
6092 (_NPN_SetException):
6093 * bindings/npruntime.cpp:
6094 (_NPN_SetExceptionWithUTF8):
6095 * bindings/objc/WebScriptObject.mm:
6096 (+[WebScriptObject throwException:]):
6098 (KJS::InterpreterImp::context):
6100 2004-10-05 Richard Williamson <rjw@apple.com>
6102 Fixed <rdar://problem/3821515> binding layer needs to convert NSNumber-bools to js type boolean not number
6106 * bindings/objc/objc_utility.mm:
6107 (KJS::Bindings::convertObjcValueToValue):
6109 2004-10-04 Darin Adler <darin@apple.com>
6113 - rolled in a fix the KDE folks did for the operations that generate HTML fragments
6115 * kjs/string_object.cpp: (StringProtoFuncImp::call): Added quote marks to generated HTML.
6117 - rolled out an old workaround we don't need any more
6119 * JavaScriptCore.pbproj/project.pbxproj: Remove -Wno-long-double because the <math.h> issue that
6120 required it is no longer there.
6122 2004-09-30 Richard Williamson <rjw@apple.com>
6124 Fixed <rdar://problem/3821215> NPN hasMethod and hasProperty functions should take NPObjects, not NPClass
6128 * bindings/NP_jsobject.cpp:
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):
6150 2004-09-29 Chris Blumenberg <cblu@apple.com>
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.
6156 * JavaScriptCore.pbproj/project.pbxproj:
6157 * bindings/NP_jsobject.cpp:
6158 (_NPN_CreateScriptObject):
6159 (_NPN_InvokeDefault):
6164 (_NPN_RemoveProperty):
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):
6195 2004-09-26 Darin Adler <darin@apple.com>
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().
6200 2004-09-26 Darin Adler <darin@apple.com>
6202 - refine charAt/charCodeAt fix slightly
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.
6207 2004-09-26 Darin Adler <darin@apple.com>
6211 - fixed <rdar://problem/3816097> REGRESSION: mailblocks, and presumably many other pages, failing because variable not found
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.
6216 - fixed <rdar://problem/3814706> REGRESSION: text fields in mailblocks wizards do not accept keystrokes due to use of charCodeAt()
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.
6221 * tests/mozilla/expected.html: Update for two tests that now pass with these changes.
6227 2004-09-14 Richard Williamson <rjw@apple.com>
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.
6233 2. Renamed NPN_Class to NPN_Invoke to match the name in the function vector.
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.
6240 There bugs are covered by
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
6248 * bindings/NP_jsobject.cpp:
6250 (NPN_InvokeDefault):
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:
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:
6294 2004-09-13 Maciej Stachowiak <mjs@apple.com>
6298 <rdar://problem/3794735> Gmail- sending a very long message with Safari is so slow it seems like a hang
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
6309 (regExpIsGlobal): Helper function for the above.
6310 (expandSourceRanges): ditto
6311 (pushSourceRange): ditto
6312 (expandReplacements): ditto
6313 (pushReplacement): ditto
6315 (KJS::UString::spliceSubstringsWithSeparators): New method that
6316 pieces together substring ranges of this string together with
6317 specified separators, all at one go.
6319 (KJS::UString::Range::Range): Added new helper class to represent
6322 2004-09-14 Maciej Stachowiak <mjs@apple.com>
6326 - fixed <rdar://problem/3800315> encode-URI-test layout test is failing
6329 (KJS::GlobalFuncImp::call): Make sure to escape null
6330 characters. This is a bug in the new code that made part of the
6333 2004-09-13 Darin Adler <darin@apple.com>
6335 Reviewed by Kevin and Maciej.
6337 - new function to support fix for DIG bug in WebCore
6339 * kjs/scope_chain.h: Added new push function that pushes another entire scope chain.
6340 * kjs/scope_chain.cpp: (KJS::ScopeChain::push): Ditto.
6342 2004-09-12 Darin Adler <darin@apple.com>
6344 * tests/mozilla/expected.html: Updated test results for 3 more tests that pass with the new version
6345 of escape and unescape.
6347 2004-09-12 Darin Adler <darin@apple.com>
6351 - fixed <rdar://problem/3798209> any non-ASCII characters are garbled in the result of toLocaleString
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.
6358 2004-09-09 Maciej Stachowiak <mjs@apple.com>
6360 Reviewed by Richard.
6362 <rdar://problem/3493140> REGRESSION (85-100): cedille displays %-escaped in JavaScript message at hotmail.com
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.
6368 (Lexer::isHexDigit): Made static and non-const.
6373 2004-09-06 Darin Adler <darin@apple.com>
6375 * JavaScriptCore.pbproj/project.pbxproj: Bump MACOSX_DEPLOYMENT_TARGET to 10.3.
6379 2004-09-01 Richard Williamson <rjw@apple.com>
6381 Add pid to exception messages (to help debug dashboard clients).
6385 * kjs/interpreter.cpp:
6386 (Interpreter::evaluate):
6390 2004-08-20 Richard Williamson <rjw@apple.com>
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
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):
6433 2004-08-19 Vicki Murley <vicki@apple.com>
6437 * kjs/property_map.cpp:
6438 (KJS::PropertyMap::put): initialize deletedElementIndex to zero, to make the compiler happy
6440 2004-08-17 Darin Adler <darin@apple.com>
6444 - fixed <rdar://problem/3746676> SAP WebDynpro app hangs inside JavaScript property map hash table code (deleted sentinel problem)
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.
6457 2004-08-16 Maciej Stachowiak <mjs@apple.com>
6459 Code change by Eric Albert, reviewd by me.
6461 <rdar://problem/3571960> washingtonpost.com claims I don't have cookies enabled and won't let me read articles
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.
6469 2004-08-16 Richard Williamson <rjw@apple.com>
6471 Fixed <rdar://problem/3581092> cash in KJS::Bindings::JSObject::eval at tcvetantcvetkov.com
6473 Adds bullet proofing to protect against evaluation of bogus JS in all the flavors of bindings (Java, C, and ObjC).
6477 * bindings/NP_jsobject.cpp:
6479 * bindings/jni/jni_jsobject.cpp:
6481 * bindings/objc/WebScriptObject.mm:
6482 (-[WebScriptObject evaluateWebScript:]):
6484 2004-08-15 Richard Williamson <rjw@apple.com>
6486 More updates to np headers. Implemented new NPN functions.
6490 * bindings/NP_jsobject.cpp:
6494 * bindings/npruntime.h:
6496 2004-08-13 Darin Adler <darin@apple.com>
6498 - fix build so we can compile again
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.
6504 2004-08-12 Richard Williamson <rjw@apple.com>
6506 Bring npruntime.h and friends closer to compliance with
6511 * JavaScriptCore.pbproj/project.pbxproj:
6512 * bindings/NP_jsobject.cpp:
6514 (_NPN_CreateScriptObject):
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):
6552 * bindings/npruntime.h:
6554 (_NPString::_NPVariant::):
6555 * bindings/npruntime_priv.h: Added.
6557 2004-08-12 Darin Adler <darin@apple.com>
6561 - fixed 3 problems with parse functions that I just wrote, fixing 3 more Mozilla JavaScript tests
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 "-".
6571 2004-08-12 Darin Adler <darin@apple.com>
6575 - fixed 43 Mozilla JavaScript tests
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.
6585 * kjs/error_object.cpp: (NativeErrorImp::NativeErrorImp): Set the DontDelete, ReadOnly, and DontEnum
6586 flags on the prototype property.
6589 (KJS::FunctionImp::get): Return null rather than undefined for arguments when the function is not
6591 (KJS::isStrWhiteSpace): Added. Matches specification for StrWhiteSpace. Could move it to some utility
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
6598 (KJS::GlobalFuncImp::call): Use the new parseInt and parseFloat.
6600 * kjs/function_object.cpp: (FunctionPrototypeImp::FunctionPrototypeImp): Add a length property.
6602 * kjs/lexer.h: Added error flag and sawError() function for detecting errors.
6604 (Lexer::setCode): Clear error state.
6605 (Lexer::lex): Set error state if the lexer encounters an error
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.
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.
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.
6619 * kjs/string_object.cpp: Change parameter count for indexOf and lastIndexOf from 2 to 1 to match
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.
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.
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.
6637 * kjs/string_object.lut.h: Regenerated.
6639 2004-08-11 Darin Adler <darin@apple.com>
6641 - fixed a tiny problem with the UTF-16 PCRE check-in
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.
6646 * pcre/chartables.c: Regenerated.
6648 2004-08-10 Richard Williamson <rjw@apple.com>
6650 Fixed <rdar://problem/3674747> Need to implement invokeUndefinedMethodFromWebScript:withArguments:
6652 The following WebScripting methods are now supported on bound
6655 - (id)invokeUndefinedMethodFromWebScript:(NSString *)name withArguments:(NSArray *)args;
6656 - (void)setValue:(id)value forUndefinedKey:(NSString *)key
6657 - (id)valueForUndefinedKey:(NSString *)key
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):
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:]):
6713 2004-08-10 Darin Adler <darin@apple.com>
6717 - switch PCRE to do UTF-16 directly instead of converting to/from UTF-8 for speed
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.
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.
6729 * pcre/maketables.c: (pcre_maketables): Change code to make tables that are
6730 sized to 16-bit characters instead of 8-bit.
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.
6739 * pcre/dftables.c: (main): Used a bit more const, and use ICHAR sizes instead
6740 of hard-coding 8-bit table sizes.
6742 * pcre/chartables.c: Regenerated.
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).
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.
6754 2004-08-09 Darin Adler <darin@apple.com>
6758 - fixed 28 Mozilla JavaScript tests
6760 * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Check for undefined rather than
6761 checking the number of arguments for the join method.
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.
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.
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.
6773 * kjs/number_object.cpp: Add the DontDelete and ReadOnly flags to the numeric constants.
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.
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".
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.
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.
6803 * tests/mozilla/jsDriver.pl: Fixed the relative links to point to our actual test files.
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.
6817 * JavaScriptCore.pbproj/project.pbxproj: Link to libicu.
6819 * kjs/number_object.lut.h: Regenerated.
6821 2004-08-09 Darin Adler <darin@apple.com>
6825 - fixed <rdar://problem/3753467> REGRESSION (137-138): reproducible buffer overrun in UString manipulation code
6827 * kjs/ustring.cpp: (KJS::UString::append): Fix incorrect size computation. Without it
6828 we get a buffer overflow.
6832 2004-08-05 Richard Williamson <rjw@apple.com>
6834 Fixed part of 3674747. The QT guys need this for feature freeze.
6836 This patch implements support for the
6838 - (id)invokeUndefinedMethodFromWebScript:(NSString *)name withArguments:(NSArray *)args
6840 method of objects bound to JavaScript.
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:
6860 2004-08-04 Vicki Murley <vicki@apple.com>
6864 - fix <rdar://problem/3649789> SAP WebGUI has problems loading first page because of parse error
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.
6871 2004-08-03 Kevin Decker <kdecker@apple.com>
6875 Rolled in changes from the latest KJS sources that support additional
6876 Number.prototype functions.
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
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
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,
6894 (KJS::NumberProtoFuncImp::):
6895 * tests/mozilla/expected.html: Update results.
6897 2004-08-03 Darin Adler <darin@apple.com>
6901 - added support for copying RegExp objects so 7 more Mozilla regexp tests pass
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.
6908 * tests/mozilla/expected.html: Update results.
6910 2004-08-02 Darin Adler <darin@apple.com>
6912 * tests/mozilla/.cvsignore: Added.
6913 * tests/mozilla/expected.html: Update results.
6915 2004-08-02 Darin Adler <darin@apple.com>
6919 - fixed RegExp.toString so 3 more Mozilla regexp tests pass
6921 * kjs/regexp_object.cpp: (RegExpProtoFuncImp::call):
6922 Append the flags here so more tests paseed.
6924 2004-08-02 Darin Adler <darin@apple.com>
6928 - fixed a couple things making 5 Mozilla regexp tests pass
6930 * kjs/regexp_object.cpp: (RegExpProtoFuncImp::call): Implement toString
6932 (RegExpObjectImp::construct): Fix bug where the string "undefined" would
6933 be used as the flags string when no parameter was passed.
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.
6939 * tests/mozilla/expected.html: Update results.
6941 2004-08-02 Darin Adler <darin@apple.com>
6945 - fix crashes in mozilla tests due to mishandling NaN
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
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.
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.
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.
6967 2004-07-26 Kevin Decker <kdecker@apple.com>
6969 Changes done by Darin, reviewed by Kevin.
6971 - changed testkjs to build in Xcode rather than from Makefile
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.
6987 2004-07-22 Kevin Decker <kdecker@apple.com>
6991 Fixed <rdar://problem/3682340> (error console does not include source urls or line numbers of event exceptions).
6993 * kjs/function_object.cpp:
6994 (FunctionObjectImp::construct):
6995 * kjs/function_object.h:
6997 (KJS::ObjectImp::construct):
6999 (KJS::Object::construct):
7001 2004-07-21 Darin Adler <darin@apple.com>
7003 * bindings/npruntime.h: Fixed typo.
7005 2004-07-19 John Sullivan <sullivan@apple.com>
7009 - bulletproofed array.slice() against NAN arguments. Harri noticed this
7010 vulnerability in my patch for 3714644
7012 * kjs/array_object.cpp:
7013 (ArrayProtoFuncImp::call):
7014 handle NAN parameters passed to slice() by clamping to 0 and length.
7016 2004-07-19 Richard Williamson <rjw@apple.com>
7018 Fixed 3733349. Prevent Java applet callbacks into JavaScript after applet
7023 * bindings/jni/jni_jsobject.cpp:
7025 (JSObject::JSObject):
7027 2004-07-16 John Sullivan <sullivan@apple.com>
7031 - fixed <rdar://problem/3714644> REGRESSION (125.8-146): bugzilla submit link
7032 hangs browser with javascript
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.
7041 * JavaScriptCore.pbproj/project.pbxproj:
7046 2004-07-14 Maciej Stachowiak <mjs@apple.com>
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)
7053 * kjs/number_object.cpp:
7054 (NumberProtoFuncImp::call): Initialize radix from dradix, not from itself!
7056 2004-07-13 Kevin Decker <kdecker@apple.com>
7058 Reviewed by kocienda.
7060 - made testkjs and JavaScriptCore a subtarget of 'All'
7061 - testkjs now builds in $SYMROOTS
7063 * JavaScriptCore.pbproj/project.pbxproj:
7067 2004-06-24 Chris Blumenberg <cblu@apple.com>
7069 Ignore .mode1 files in JavaScriptCore.pbproj
7071 Reviewed by kocienda.
7073 * JavaScriptCore.pbproj/.cvsignore:
7075 2004-06-23 Richard Williamson <rjw@apple.com>
7077 Implemented changes for latest npruntime.h.
7081 * JavaScriptCore.pbproj/project.pbxproj:
7082 * bindings/NP_jsobject.cpp:
7083 (listFromVariantArgs):
7084 (identiferFromNPIdentifier):
7085 (_NPN_CreateScriptObject):
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):
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):
7129 === JavaScriptCore-146.1 ===
7131 2004-06-16 Richard Williamson <rjw@apple.com>
7133 Fixed <rdar://problem/3702287> Crash returning nil from bound ObjC
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.
7141 * bindings/objc/objc_runtime.mm:
7142 (KJS::Bindings::ObjcField::valueFromInstance):
7146 2004-06-16 Richard Williamson <rjw@apple.com>
7148 Fixed <rdar://problem/3696112>: nil from an Objective-C class seems to get wrapped as a JavaScript proxy that will not print.
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.
7156 * bindings/objc/objc_utility.mm:
7157 (KJS::Bindings::convertObjcValueToValue):
7161 2004-06-15 Richard Williamson <rjw@apple.com>
7163 Fixed <rdar://problem/3695875>: Objective-C instances that are exported to JavaScript are too promiscuous
7165 No longer need to check respondsToSelector: for
7166 isSelectorExcludedFromWebScript: and isKeyExcludedFromWebScript:
7167 because these now have a default implementation on NSObject.
7171 * bindings/objc/objc_class.mm:
7172 (ObjcClass::methodsNamed):
7173 (ObjcClass::fieldNamed):
7175 2004-06-14 Darin Adler <darin@apple.com>
7179 - fixed some things for GC that Patrick missed, or that happened after the branch
7181 * bindings/objc/WebScriptObject.mm:
7182 (-[WebScriptObject dealloc]): Moved removeNativeReference call here from private object.
7183 (-[WebScriptObject finalize]): Added.
7185 - added some missing nil checks
7187 * bindings/objc/objc_instance.mm:
7188 (ObjcInstance::ObjcInstance): Check for nil.
7189 (ObjcInstance::~ObjcInstance): Check for nil.
7190 (ObjcInstance::operator=): Check for nil.
7192 2004-06-14 Darin Adler <darin@apple.com>
7194 Reviewed by me, code changes by Patrick Beard.
7196 - fixed <rdar://problem/3671507>: (WebKit should adopt GC changes and compile with GC enabled)
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.
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.
7209 * bindings/testbindings.mm: Fixed incorrect license.
7210 (main): Use [pool drain] if compiling on Tiger.
7214 2004-06-10 Kevin Decker <kdecker@apple.com>
7220 - fixed <rdar://problem/3682398>: (error console line numbers are offset by 1)
7222 (KJS::Lexer::lineNo):
7223 - fixed <rdar://problem/3682398>: (error console line numbers are offset by 1)
7225 === JavaScriptCore-143.2 ===
7227 2004-06-07 Darin Adler <darin@apple.com>
7229 - fixed <rdar://problem/3682489>: (JavaScriptGlue no longer compiles because Interpreter::evaluate parameters changed)
7231 * kjs/interpreter.h: Added an overload to make JavaScriptGlue compile.
7232 * kjs/interpreter.cpp: (KJS::Interpreter::evaluate): Implemented the overload.
7234 === JavaScriptCore-143.1 ===
7236 2004-06-04 Kevin Decker <kdecker@apple.com>
7240 - fixed <rdar://problem/3680594>
7243 (KJS::Error::create):
7247 2004-06-04 Darin Adler <darin@apple.com>
7249 * kjs/testkjs.cpp: (main): Fix build breakage by adding URL and line number parameters.
7251 2004-06-04 Kevin Decker <kdecker@apple.com>
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
7261 * bindings/NP_jsobject.cpp:
7263 * bindings/jni/jni_jsobject.cpp:
7265 * bindings/objc/WebScriptObject.mm:
7266 (-[WebScriptObject evaluateWebScript:]):
7268 (GlobalFuncImp::call):
7269 * kjs/function_object.cpp:
7270 (FunctionObjectImp::construct):
7273 (InterpreterImp::checkSyntax):
7274 (InterpreterImp::evaluate):
7276 * kjs/interpreter.cpp:
7277 (Interpreter::evaluate):
7278 * kjs/interpreter.h:
7282 (KJS::Lexer::sourceURL):
7286 (FunctionCallNode::evaluate):
7289 (KJS::Error::create):
7292 2004-06-04 Richard Williamson <rjw@apple.com>
7294 Fixed crash when attempting to access properties on nil
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]):
7307 2004-05-27 Kevin Decker <kdecker@apple.com>
7311 -revised generated error message content
7313 * kjs/error_object.cpp:
7314 (ErrorProtoFuncImp::call):
7318 (KJS::Error::create):
7322 2004-05-27 Richard Williamson <rjw@apple.com>
7324 Renamed WebScriptMethods to WebScripting based on feedback from Nancy.
7328 * bindings/objc/WebScriptObject.h:
7330 2004-05-27 Darin Adler <darin@apple.com>
7334 - moved to new symlink technique for embedding frameworks
7336 * JavaScriptCore.pbproj/project.pbxproj: Get rid of embed-frameworks build step
7337 because we don't need it any more.
7339 2004-05-24 Richard Williamson <rjw@apple.com>
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.
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::]):
7362 2004-05-22 Darin Adler <darin@apple.com>
7366 - fixed <rdar://problem/3664260>: (JS needs to listen to timezone change notifications)
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.
7375 2004-05-20 Richard Williamson <rjw@apple.com>
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.
7381 All added implementation of finalizeForWebScript.
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):
7400 2004-05-19 Richard Williamson <rjw@apple.com>
7402 Removed extraneous tabs that were added (by XCode?).
7404 * bindings/objc/WebScriptObject.h:
7406 2004-05-19 Darin Adler <darin@apple.com>
7408 - fixed headers with licenses mangled by Xcode auto-indenting
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:
7416 2004-05-18 Richard Williamson <rjw@apple.com>
7418 Added exception logging. Also check for exception and
7419 set results as appropriate.
7421 Reviewed by Maciej (partially reviewed).
7423 * bindings/objc/WebScriptObject.mm:
7424 (-[WebScriptObject callWebScriptMethod:withArguments:]):
7425 (-[WebScriptObject evaluateWebScript:]):
7426 (-[WebScriptObject setValue:forKey:]):
7427 (-[WebScriptObject valueForKey:]):
7429 2004-05-18 Richard Williamson <rjw@apple.com>
7431 Finsished implementing support for windowScriptObject.
7432 Had to make WebScriptObjectPrivate.h accessible from
7437 * JavaScriptCore.pbproj/project.pbxproj:
7438 * bindings/objc/WebScriptObjectPrivate.h:
7440 2004-05-18 Richard Williamson <rjw@apple.com>
7442 Use KVC to set/get values instead of directly accessing
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):
7455 2004-05-17 Richard Williamson <rjw@apple.com>
7457 Implemented new API for WebScriptObject.
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)
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:
7475 (-[WebScriptObject _initWithObjectImp:KJS::root:Bindings::]):
7476 (-[WebScriptObject KJS::]):
7477 (-[WebScriptObject dealloc]):
7478 (+[WebScriptObject throwException:]):
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::]):
7520 2004-05-14 Vicki Murley <vicki@apple.com>
7524 <rdar://problem/3642427>: framework marketing number should be 2.0 for DoubleBarrel release
7526 * JavaScriptCore.pbproj/project.pbxproj: change CFBundleShortVersionString to 2.0
7530 2004-05-13 Richard Williamson <rjw@apple.com>
7537 * bindings/objc/WebScriptObject.h:
7539 2004-05-13 Richard Williamson <rjw@apple.com>
7541 Approved API changes. Currently unimplemented.
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:]):
7558 2004-05-07 Vicki Murley <vicki@apple.com>
7562 Turn off GC since it uses ppc only instructions (which breaks
7565 * kjs/value.h: set USE_CONSERVATIVE_GC to 0
7569 2004-05-07 Maciej Stachowiak <mjs@apple.com>
7573 - add -funroll-loops=16 compiler option for approx .5% speedup on
7574 HTML iBench and .5-1% speedup on JS iBench.
7576 * JavaScriptCore.pbproj/project.pbxproj:
7578 2004-04-25 Maciej Stachowiak <mjs@apple.com>
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.
7586 Specific noteworth changes:
7588 * kjs/collector.cpp:
7589 (KJS::Collector::markStackObjectsConservatively): Check possible
7590 cell pointers for 8-byte aligment and verify they are not 0.
7592 * kjs/protected_values.cpp:
7593 (KJS::ProtectedValues::increaseProtectCount): Move null-tolerance from here...
7594 (KJS::ProtectedValues::decreaseProtectCount): ...and here...
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.
7600 * kjs/protected_values.cpp:
7601 (KJS::ProtectedValues::computeHash): Replace hash function with a much faster one
7602 that is still very good.
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):
7633 (NumberImp::create):
7634 (InterpreterImp::globalInit):
7635 (InterpreterImp::globalClear):
7636 (InterpreterImp::mark):
7638 (KJS::List::derefValues):
7639 (KJS::List::refValues):
7640 (KJS::List::append):
7642 (KJS::ObjectImp::setInternalValue):
7643 (KJS::ObjectImp::putDirect):
7648 (KJS::ValueImp::ValueImp):
7649 (KJS::ValueImp::~ValueImp):
7651 (KJS::Value::Value):
7652 (KJS::Value::~Value):
7653 (KJS::Value::operator=):
7655 2004-04-30 Richard Williamson <rjw@apple.com>
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.
7663 * bindings/objc/objc_instance.mm:
7664 (ObjcInstance::invokeMethod):
7666 2004-04-29 Richard Williamson <rjw@apple.com>
7668 Fixed several bad problems with the ObjC bindings. In particular, conversion
7669 to/from JavaScriptObject (soon to be WebScriptObject) was completely broken.
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::]):
7699 2004-04-24 Darin Adler <darin@apple.com>
7703 * kjs/ustring.cpp: (KJS::UString::append): Fix one case that was allocating a buffer
7706 2004-04-23 Maciej Stachowiak <mjs@apple.com>
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
7714 * JavaScriptCore.pbproj/project.pbxproj:
7715 * kjs/collector.cpp:
7716 (KJS::Collector::markStackObjectsConservatively):
7717 (KJS::Collector::markProtectedObjects):
7718 (KJS::Collector::collect):
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.
7734 (ValueImp::useConservativeMark):
7742 2004-04-22 Richard Williamson <rjw@apple.com>
7744 Fixed build snafu (re-declaration of NPBool in npruntime.h and
7747 * bindings/npruntime.h:
7749 2004-04-22 Richard Williamson <rjw@apple.com>
7751 Updated plugin binding API to reflect latest revision from
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.
7760 * JavaScriptCore.pbproj/project.pbxproj:
7761 * bindings/NP_jsobject.cpp:
7762 (identiferFromNPIdentifier):
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):
7816 (NPN_ReleaseObject):
7817 (NPN_IsKindOfClass):
7818 (NPN_SetExceptionWithUTF8):
7820 * bindings/npruntime.h:
7822 (_NPString::_NPVariant::):
7823 * bindings/testbindings.cpp:
7838 2004-04-22 Darin Adler <darin@apple.com>
7842 - fixed <rdar://problem/3627473>: "REGRESSION (125-137): memory trasher in UString::append, causing many different crashes"
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).
7850 2004-04-21 Maciej Stachowiak <mjs@apple.com>
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
7859 * JavaScriptCore.pbproj/project.pbxproj:
7862 (KJS::InterpreterImp::globalObject):
7863 * kjs/interpreter.h:
7864 * kjs/property_map.cpp:
7866 * kjs/reference_list.cpp:
7868 2004-04-19 Maciej Stachowiak <mjs@apple.com>
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
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=):
7890 (KJS::UString::Rep::data):
7892 2004-04-16 Maciej Stachowiak <mjs@apple.com>
7893 Reviewed by Richard.
7895 No more need for Completion or Reference to privately inherit from
7896 Value, none of the superclass functionality is used.
7903 2004-04-16 Richard Williamson <rjw@apple.com>
7905 Added interpreter lock protection around object creation.
7909 * bindings/runtime.cpp:
7910 (Instance::createRuntimeObject):
7912 2004-04-16 Maciej Stachowiak <mjs@apple.com>
7916 Another JavaScript speed improvement: use the mechanism from
7917 string append optimization to make taking a substring fast, again
7920 A further 22% improvement on the 24fun string speed test.
7924 (KJS::UString::Rep::create):
7925 (KJS::UString::UString):
7926 (KJS::UString::append):
7927 (KJS::UString::operator=):
7928 (KJS::UString::substr):
7930 (KJS::UString::Rep::data):
7932 2004-04-13 Maciej Stachowiak <mjs@apple.com>
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
7940 80% speedup on the string test, lesser speedups on the other two.
7942 Two different optimizations here:
7944 1) Avoid large overhead of scanning strings to see if they are all
7945 ASCII before numeric conversion.
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 +=.
7952 2) Avoid huge cost of appending strings.
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).
7960 * kjs/identifier.cpp:
7961 (KJS::Identifier::equal):
7962 (KJS::Identifier::add):
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==):
7980 (KJS::UString::Rep::data):
7981 (KJS::UString::Rep::hash):
7983 2004-04-09 Maciej Stachowiak <mjs@apple.com>
7987 - fix deployment build by avoiding deployment-only warning.
7989 * kjs/scope_chain.cpp:
7990 (KJS::ScopeChain::bottom):
7992 2004-04-09 Maciej Stachowiak <mjs@apple.com>
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:
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)
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):
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):
8027 (BooleanImp::toObject):
8028 (StringImp::toObject):
8029 (NumberImp::toObject):
8030 (InterpreterImp::InterpreterImp):
8031 (InterpreterImp::clear):
8032 (InterpreterImp::interpreterWithGlobalObject):
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):
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):
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):
8077 2004-03-31 Richard Williamson <rjw@apple.com>
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.
8084 No review because this was just a renaming patch.
8086 * bindings/NP_jsobject.cpp:
8089 (identiferFromNPIdentifier):
8094 (NPN_RemoveProperty):
8096 (NPN_GetPropertyAtIndex):
8097 (NPN_SetPropertyAtIndex):
8098 * bindings/NP_jsobject.h:
8099 * bindings/c/c_class.cpp:
8100 (CClass::_commonInit):
8101 (CClass::classForIsA):
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):
8134 (NPN_ReleaseObject):
8135 (NPN_IsKindOfClass):
8136 (NPN_SetExceptionWithUTF8):
8139 (NPN_CreateNumberWithInt):
8140 (NPN_CreateNumberWithFloat):
8141 (NPN_CreateNumberWithDouble):
8142 (NPN_IntFromNumber):
8143 (NPN_FloatFromNumber):
8144 (NPN_DoubleFromNumber):
8146 (NPN_CreateStringWithUTF8):
8147 (NPN_CreateStringWithUTF16):
8148 (NPN_DeallocateUTF8):
8149 (NPN_UTF8FromString):
8150 (NPN_UTF16FromString):
8153 (NPN_CreateBoolean):
8154 (NPN_BoolFromBoolean):
8157 (undefinedAllocate):
8163 (NPN_ObjectAtIndex):
8164 * bindings/npruntime.h:
8165 * bindings/runtime.cpp:
8166 (Instance::createBindingForLanguageInstance):
8167 * bindings/testbindings.cpp:
8168 (initializeIdentifiers):
8188 2004-03-31 Richard Williamson <rjw@apple.com>
8190 Changed references to NP_runtime.h to npruntime.h
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:
8200 2004-03-31 Richard Williamson <rjw@apple.com>
8202 Renamed NP_runtime.h to npruntime.h to match Netscape SDK.
8204 * JavaScriptCore.pbproj/project.pbxproj:
8205 * bindings/NP_jsobject.h:
8206 * bindings/npruntime.cpp:
8210 2004-03-23 Richard Williamson <rjw@apple.com>
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.
8218 * JavaScriptCore.pbproj/project.pbxproj:
8219 * bindings/NP_jsobject.cpp:
8221 * bindings/NP_jsobject.h: Added.
8222 * bindings/NP_runtime.cpp:
8223 (NP_IdentifierFromUTF8):
8224 (NP_IsValidIdentifier):
8225 (NP_GetIdentifiers):
8230 (NP_SetExceptionWithUTF8):
8233 (NP_FloatFromNumber):
8234 (NP_DoubleFromNumber):
8235 (NP_CreateStringWithUTF8):
8236 (NP_CreateStringWithUTF16):
8237 (NP_DeallocateUTF8):
8238 (NP_UTF8FromString):
8239 (NP_UTF16FromString):
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:
8251 * bindings/testC.js: Added.
8252 * bindings/testbindings.cpp:
8262 (myInterfaceInvoke):
8263 (myInterfaceAllocate):
8267 2004-03-19 Darin Adler <darin@apple.com>
8271 - fixed problem with methods like setUTCHour
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.
8276 2004-03-17 Richard Williamson <rjw@apple.com>
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.
8282 * bindings/NP_jsobject.cpp:
8287 (NP_GetPropertyAtIndex):
8288 * bindings/NP_runtime.h:
8290 2004-03-16 Richard Williamson <rjw@apple.com>
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.
8296 * bindings/jni/jni_class.cpp:
8297 (JavaClass::methodsNamed):
8299 2004-03-15 Richard Williamson <rjw@apple.com>
8301 Fixed 3570854. Don't attempt to convert Null to strings. We
8302 were incorrectly converting to "Null".
8304 Actually fixed by Scott Kovatch.
8306 Reviewed by Richard.
8308 * bindings/jni/jni_utility.cpp:
8309 (KJS::Bindings::convertValueToJValue):
8313 2004-03-11 Richard Williamson <rjw@apple.com>
8315 Stitched together the NP stuff to our language independent
8316 JavaScript binding stuff. Very close to being done.
8318 Added program to test C bindings (and NP stuff). Just tests
8319 properties. Will add methods and JavaScript access, etc.
8321 Updated Makefile.am to account for new bindings/c directory.
8323 Change NP_UTF8 from "const char *" to "char" to allow for
8324 declarations like "const NP_UTF8 *" and "NP_UTF8 *". Ditto
8327 Added NP_IsValidIdentifier().
8331 * JavaScriptCore.pbproj/project.pbxproj:
8333 * bindings/NP_jsobject.cpp:
8334 (identiferFromNPIdentifier):
8336 * bindings/NP_runtime.cpp:
8337 (NP_IdentifierFromUTF8):
8338 (NP_IsValidIdentifier):
8339 (NP_GetIdentifiers):
8340 (NP_UTF8FromIdentifier):
8341 (NP_SetExceptionWithUTF8):
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):
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):
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):
8413 2004-03-10 Richard Williamson <rjw@apple.com>
8415 Made changes to support new asychronous approach to calls from
8416 plugin to JavaScript
8420 * bindings/NP_jsobject.cpp:
8425 (NP_GetPropertyAtIndex):
8426 * bindings/NP_runtime.h:
8427 * bindings/make_testbindings:
8428 * bindings/runtime.cpp:
8429 (Instance::createBindingForLanguageInstance):
8431 2004-03-10 Richard Williamson <rjw@apple.com>
8433 Updated header to include proposed changes from
8434 plugin-futures list. Calls from plugin to JavaScript
8435 are now asynchronous.
8439 * bindings/NP_runtime.h:
8443 2004-03-04 Richard Williamson <rjw@apple.com>
8445 Implementation of NP_JavaScriptObject. This is the 'C' class
8446 that wraps a JavaScript object.
8450 * JavaScriptCore.pbproj/project.pbxproj:
8451 * bindings/NP_jsobject.cpp: Added.
8452 (coerceValueToNPValueType):
8453 (convertValueToNPValueType):
8454 (convertNPValueTypeToValue):
8458 (identiferFromNPIdentifier):
8463 (NP_RemoveProperty):
8465 (NP_GetPropertyAtIndex):
8466 (NP_SetPropertyAtIndex):
8467 * bindings/NP_runtime.cpp:
8469 * bindings/NP_runtime.h:
8470 * bindings/runtime_object.h:
8472 2004-03-04 Richard Williamson <rjw@apple.com>
8474 Added NP_Array implementation.
8476 Changed NP_Boolean to just depend on two static instances, no
8477 space is required for values.
8481 * bindings/NP_runtime.cpp:
8483 (NP_BoolFromBoolean):
8489 * bindings/NP_runtime.h:
8491 2004-03-03 Darin Adler <darin@apple.com>
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.
8499 2004-03-03 Richard Williamson <rjw@apple.com>
8501 More 'C' binding implementation. Fleshed out all the
8502 'primitive' data types.
8506 * bindings/NP_runtime.cpp:
8511 (NP_CreateStringWithUTF8):
8512 (NP_CreateStringWithUTF16):
8513 (NP_UTF8FromString):
8514 (NP_UTF16FromString):
8517 (booleanDeallocate):
8519 (NP_BoolFromBoolean):
8523 (undefinedAllocate):
8524 (undefinedDeallocate):
8526 * bindings/NP_runtime.h:
8528 2004-03-03 Richard Williamson <rjw@apple.com>
8530 More 'C' binding implementation.
8534 * bindings/NP_runtime.cpp:
8537 (getIdentifierDictionary):
8538 (NP_IdentifierFromUTF8):
8539 (NP_UTF8FromIdentifier):
8544 (NP_CreateNumberWithInt):
8545 (NP_CreateNumberWithFloat):
8546 (NP_CreateNumberWithDouble):
8548 (NP_FloatFromNumber):
8549 (NP_DoubleFromNumber):
8550 * bindings/NP_runtime.h:
8552 2004-03-02 Richard Williamson <rjw@apple.com>
8554 Removed retain/release from NP_Class. Classes will not be allowed to implement their
8555 own customer retain/release scheme.
8559 * bindings/NP_runtime.cpp:
8562 * bindings/NP_runtime.h:
8564 2004-03-02 Richard Williamson <rjw@apple.com>
8566 C binding API. Partial implementation.
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.
8570 Factored root object reference counting scheme. It is now useful independent
8575 * JavaScriptCore.pbproj/project.pbxproj:
8576 * bindings/NP_runtime.cpp: Added.
8577 (NP_IdentifierFromUTF8):
8578 (NP_GetIdentifiers):
8579 (NP_UTF8FromIdentifier):
8589 (NP_RemoveProperty):
8591 (NP_GetPropertyAtIndex):
8592 (NP_SetPropertyAtIndex):
8593 (NP_CreateNumberWithInt):
8594 (NP_CreateNumberWithFloat):
8595 (NP_CreateNumberWithDouble):
8597 (NP_FloatFromNumber):
8598 (NP_DoubleFromNumber):
8599 (NP_CreateStringWithUTF8):
8600 (NP_CreateStringWithUTF16):
8601 (NP_UTF8FromString):
8602 (NP_UTF16FromString):
8604 (NP_BoolFromBoolean):
8610 * bindings/NP_runtime.h: Added.
8611 * bindings/jni/jni_jsobject.cpp:
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:
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):
8665 2004-02-18 Richard Williamson <rjw@apple.com>
8667 Added NSNumber/Number conversion.
8669 Removed some unnecessary KJS:: namespace specifiers.
8673 * bindings/objc/objc_utility.mm:
8674 (KJS::Bindings::convertValueToObjcValue):
8675 (KJS::Bindings::convertObjcValueToValue):
8676 * bindings/runtime_array.h:
8678 2004-02-18 Richard Williamson <rjw@apple.com>
8680 Added support for export NSArrays.
8682 Updated valueAt() to take an ExecState so we can throw
8685 Implemented excludeSelectorFromJavaScript: in ObjcClass. This allows
8686 ObjectiveC classes to control the visibility of their methods in
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):
8719 2004-02-17 Richard Williamson <rjw@apple.com>
8721 Added String <-> NSString conversion.
8722 Added tests of String <-> NSString conversion to test program.
8726 * bindings/objc/objc_utility.mm:
8727 (KJS::Bindings::convertValueToObjcValue):
8728 (KJS::Bindings::convertObjcValueToValue):
8730 * bindings/testbindings.mm:
8731 (-[MyFirstInterface getString]):
8733 2004-02-15 Darin Adler <darin@apple.com>
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.
8740 2004-02-13 Richard Williamson <rjw@apple.com>
8742 Work towards the JavaScript ObjC bindings. The bindings now work for
8743 simple scalar types. testbindings.mm is an illustration of how the
8748 * JavaScriptCore.pbproj/project.pbxproj:
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):
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):
8803 (ObjcMethod::numParameters):
8804 (ObjcMethod::getMethodSignature):
8805 (ObjcField::ObjcField):
8808 (ObjcField::valueFromInstance):
8809 (ObjcField::setValueToInstance):
8810 * bindings/objc/objc_utility.h: Added.
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):
8848 2004-02-08 Darin Adler <darin@apple.com>
8852 - fixed things seen in the profile, for a total speedup of 4% on cvs-base (including changes across all projects)
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.
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.
8867 - fixed the test program so it won't hit the interpreter lock assertion
8869 * kjs/testkjs.cpp: (main): Just lock around the whole thing, since the test is singly threaded.
8873 2004-02-06 Richard Williamson <rjw@apple.com>
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.
8879 * bindings/jni/jni_jsobject.cpp:
8880 (JSObject::toString):
8881 * bindings/jni/jni_utility.cpp:
8882 (KJS::Bindings::convertValueToJValue):
8884 2004-02-02 Darin Adler <darin@apple.com>
8888 - fixed <rdar://problem/3546613>: array of negative size leads to crash (test page at oscar.the-rileys.net)
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.
8896 - fixed <rdar://problem/3545756>: Math.round screws up on numbers bigger than 2^31 (incorrect results on HP-35 calculator page)
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.
8901 2004-02-02 Darin Adler <darin@apple.com>
8905 - fixed <rdar://problem/3519285>: integer operations on large negative numbers yield bad results (discovered with "HTMLCrypt")
8906 - fixed other related overflow issues
8908 * kjs/value.h: Changed return types of toInteger, toInt32, toUInt32, and toUInt16.
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.
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.
8929 2004-01-30 Richard Williamson <rjw@apple.com>
8931 Fixed 3542044. Create KJS::String using UString constructor instead of passing UTF8 string to char* constructor.
8935 * bindings/jni/jni_instance.cpp:
8936 (JavaInstance::stringValue):
8938 2004-01-26 Darin Adler <darin@apple.com>
8940 * Makefile.am: Switch from pbxbuild to xcodebuild.
8942 2004-01-22 Richard Williamson <rjw@apple.com>
8944 Added stubs for ObjC language binding to JavaScript.
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:
8964 2004-01-22 Richard Williamson <rjw@apple.com>
8966 Simplified JavaString by using UString as backing store. This
8967 revealed a bug in CString's assignment operator which I fixed.
8969 Removed some dead code.
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:
8984 (KJS::CString::CString):
8985 (KJS::CString::operator=):
8991 2004-01-16 Richard Williamson <rjw@apple.com>
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.
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:
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):
9032 2004-01-16 Richard Williamson <rjw@apple.com>
9034 Fixed 3531229. Another place that needs the Push/PopLocalFrame
9035 protection implemented for 3530401.
9039 * bindings/runtime_method.cpp:
9040 (RuntimeMethodImp::call):
9042 2004-01-15 Richard Williamson <rjw@apple.com>
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.
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.
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):
9076 2004-01-15 Vicki Murley <vicki@apple.com>
9080 * JavaScriptCore.pbproj/project.pbxproj: Update copyright date to 2004.
9082 2004-01-14 Richard Williamson <rjw@apple.com>
9084 Fixed 3529466. With recent changes to Java plugin we must no
9085 longer call DeleteLocalRef(). Not a problem, it was an optimization anyway.
9089 * bindings/jni/jni_instance.cpp:
9090 (JObjectWrapper::JObjectWrapper):
9094 2004-01-14 Richard Williamson <rjw@apple.com>
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.
9102 * bindings/jni_jsobject.cpp:
9104 (removeJavaReference):
9105 (RootObject::removeAllJavaReferencesForRoot):
9108 2004-01-13 Richard Williamson <rjw@apple.com>
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.
9116 * bindings/jni_jsobject.h:
9117 (KJS::Bindings::RootObject::~RootObject):
9123 2004-01-06 Richard Williamson <rjw@apple.com>
9125 Fixed 3521814. Finalize messages weren't being dispatched!
9129 * bindings/jni_jsobject.cpp:
9132 2004-01-05 Richard Williamson <rjw@apple.com>
9134 Added cache of JNI method IDs to minimize allocations. This mitigates the problem
9135 described by 3515579.
9137 Also cleanup up logging of Java exceptions.
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:
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:
9176 l2003-12-23 John Sullivan <sullivan@apple.com>
9178 * JavaScriptCore.pbproj/project.pbxproj:
9179 Xcode version wars, harmless
9181 2003-12-23 Darin Adler <darin@apple.com>
9183 Reviewed by John (concept, not code, which is just the old code coming back).
9185 - fixed 3518092: REGRESSION (100-119): getting NaN instead of HH:MM times
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.
9190 2003-12-19 Richard Williamson <rjw@apple.com>
9192 Fixed 3515597. When an error occurs we need
9193 to make sure result values are zeroed.
9195 Cleaned up logs by adding a newline.
9199 * bindings/jni/jni_utility.cpp:
9200 (KJS::Bindings::getJavaVM):
9201 (KJS::Bindings::getJNIEnv):
9204 (KJS::Bindings::getJNIField):
9205 * bindings/jni_jsobject.cpp:
9206 (JSObject::convertValueToJObject):
9210 2003-12-17 Richard Williamson <rjw@apple.com>
9212 Ensure that all the symbols we export are in the KJS
9213 namespace (3512245).
9215 Also renamed JavaString.characters() to JavaString.UTF8String()
9216 for enhanced clarity.
9218 Added some sanity checking to constructor of JObjectWrapper.
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:
9306 2003-12-16 Richard Williamson <rjw@apple.com>
9308 Ack! More assertions. Lock ALL entry points into the interpreter!
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):
9323 2003-12-15 Richard Williamson <rjw@apple.com>
9325 Fixed a couple of snafus and removed some logging.
9329 * bindings/jni_jsobject.cpp:
9330 (Bindings::performJavaScriptAccess):
9331 (Bindings::completedJavaScriptAccess):
9332 (Bindings::dispatchToJavaScriptThread):
9333 Removed some annoying JS_LOG clutter.
9335 (Bindings::RootObject::removeAllJavaReferencesForRoot):
9336 Fixed allocation of key buffer that was called after it was needed.
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.
9345 2003-12-15 Richard Williamson <rjw@apple.com>
9347 args weren't passed to 'call' invocation. d'oh.
9348 lock interpreter when we create instances of JS impls.
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:
9363 2003-12-15 Richard Williamson <rjw@apple.com>
9365 Last piece of LiveConnect! This checkin adds implementation
9366 of the Java to JavaScript object conversion functions.
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:
9388 * bindings/runtime_method.cpp:
9389 (RuntimeMethodImp::get):
9390 (RuntimeMethodImp::codeType):
9391 (RuntimeMethodImp::execute):
9393 2003-12-12 Richard Williamson <rjw@apple.com>
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.
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:
9429 2003-12-12 Richard Williamson <rjw@apple.com>
9431 Ensure that all calls from Java into JavaScript are
9432 performed on a designated thread (the main thread).
9436 * bindings/jni_jsobject.cpp:
9437 (isJavaScriptThread):
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):
9466 2003-12-11 Richard Williamson <rjw@apple.com>
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
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).
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!?!
9485 * bindings/jni/jni_runtime.h:
9486 (Bindings::JavaString::JavaString):
9487 * bindings/jni/jni_utility.cpp:
9488 (convertValueToJValue):
9489 (convertValueToJObject):
9491 * bindings/jni/jni_utility.h:
9492 * bindings/jni_jsobject.cpp:
9493 (KJS_setFindRootObjectForNativeHandleFunction):
9494 (KJS_findRootObjectForNativeHandleFunction):
9495 (getReferencesByRootDictionary):
9496 (getReferencesDictionary):
9497 (findReferenceDictionary):
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):
9511 2003-12-10 Darin Adler <darin@apple.com>
9515 - fixed regression in JavaScript tests reported by the KDE guys
9516 - fixed 3506345: REGRESSION (115-116): VIP: chordfind.com no longer displays chords
9518 * kjs/ustring.h: Add tolerateEmptyString parameter to toDouble and toULong.
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.
9525 * kjs/string_object.cpp: (StringProtoFuncImp::call): Pass false for the new
9526 "tolerate empty string" parameter.
9528 2003-12-10 Richard Williamson <rjw@apple.com>
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).
9537 * JavaScriptCore.pbproj/project.pbxproj:
9538 * bindings/jni_jsobject.cpp:
9539 (KJS_setFindObjectForNativeHandleFunction):
9540 (KJS_findObjectForNativeHandleFunction):
9541 (getReferencesByOwnerDictionary):
9542 (getReferencesDictionary):
9543 (findReferenceDictionary):
9545 (removeJavaReference):
9546 (removeAllJavaReferencesForOwner):
9547 * bindings/jni_jsobject.h:
9549 2003-12-09 Richard Williamson <rjw@apple.com>
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.
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).
9564 * JavaScriptCore.pbproj/project.pbxproj:
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.
9579 2003-12-09 Maciej Stachowiak <mjs@apple.com>
9583 <rdar://problem/3505183>: JavaScriptCore should assert that interpreter is locked in collector
9585 * kjs/collector.cpp:
9586 (KJS::Collector::allocate): Assert that interpreter lock count is not 0.
9587 (KJS::Collector::collect): likewise
9589 2003-12-08 Richard Williamson <rjw@apple.com>
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.
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):
9628 2003-12-05 Richard Williamson <rjw@apple.com>
9630 LiveConnect: Part 1 of supporting JS bindings to
9631 native language arrays.
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):
9647 2003-12-04 Richard Williamson <rjw@apple.com>
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.
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):
9669 2003-12-04 Richard Williamson <rjw@apple.com>
9671 LiveConnect: Added support for setting the value of Java
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):
9698 2003-12-04 Richard Williamson <rjw@apple.com>
9700 Added support for string conversions.
9701 Changed various JavaString member variables to be inline.
9702 Implemented defaultValue for context relevant type coercion.
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):
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):
9756 2003-12-03 Richard Williamson <rjw@apple.com>
9758 LiveConnect: Added support for parameter passing to Java and conversion
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):
9784 2003-12-02 Richard Williamson <rjw@apple.com>
9786 Added support for calling simple methods in Java from JavaScript.
9787 (void return and no parameters). Yay, LiveConnect lives.
9789 Still need write argument and return value conversion code.
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:
9824 (FunctionImp::FunctionImp):
9825 * kjs/interpreter.h:
9827 2003-12-01 Darin Adler <darin@apple.com>
9831 - fixed 3493799: JavaScript string.replace expands $ if it's the last character in replacement string
9833 * kjs/ustring.cpp: (KJS::UString::toDouble): Fix backwards handling of the "tolerant" boolean.
9834 This indirectly caused the string.replace bug.
9836 2003-12-02 Maciej Stachowiak <mjs@apple.com>
9838 Merged patches from Harri Porten and David Faure to fix:
9840 <rdar://problem/3497643>: reproducible crash printing self-referential array
9842 * kjs/array_object.cpp:
9843 (ArrayProtoFuncImp::call): Break out of the loop if an exception was thrown.
9845 (FunctionCallNode::evaluate): Move function call depth check from here...
9847 (KJS::Object::call): ...to here.
9848 * kjs/object.h: Un-inline Object::call now that it does more.
9850 2003-12-01 Richard Williamson <rjw@apple.com>
9852 Fixed mistake in method signatures used to get boolean and integer fields.
9856 * bindings/jni/jni_runtime.cpp:
9857 (JavaField::valueFromInstance):
9859 2003-12-01 Richard Williamson <rjw@apple.com>
9861 Fixed parameter passing to applet. Child elements are NOT valid in setStyle(). So we now create the widget before needed with createWidgetIfNecessary. This either happens when doing the first layout, or when JavaScript first references the applet element.
9863 Fixed early delete of the the main applet instance. When the JS collector cleaned up the last JS object referring to the applet instance we were deleting the java instance. This caused the applet instance cached on the applet element to be invalid. The applet instance is the only Java object not to be cleaned up by the JS collector.
9865 Added support for getting at Java object fields.
9869 * JavaScriptCore.pbproj/project.pbxproj:
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:
9886 2003-11-21 Maciej Stachowiak <mjs@apple.com>
9888 Patch from Harri Porten, reviewed by me.
9890 - fixed 3491712 - String slice with negative arguments does not offset from end of string
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].
9896 2003-11-21 Maciej Stachowiak <mjs@apple.com>
9898 Patch from Harri Porten, reviewed by me.
9900 - fixed 3491709 - using Function.apply with a primitive type as the arg list causes crash
9902 * kjs/function_object.cpp:
9903 (FunctionProtoFuncImp::call): Nest parentheses properly.
9905 2003-11-20 Richard Williamson <rjw@apple.com>
9907 More LiveConnect stuff. Primitive Java fields are now
9908 accessible from JavaScript! Yay!
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:
9933 (callJNIVoidMethod):
9934 (callJNIObjectMethod):
9935 (callJNIBooleanMethod):
9936 (callJNIByteMethod):
9937 (callJNICharMethod):
9938 (callJNIShortMethod):
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):
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):
9963 2003-11-20 Richard Williamson <rjw@apple.com>
9965 More LiveConnect stuff.
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:
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:
9992 2003-11-19 Richard Williamson <rjw@apple.com>
9994 More LiveConnect stuff.
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:
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::):
10045 2003-11-18 Richard Williamson <rjw@apple.com>
10047 More live connect stubs. We're getting close.
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):
10082 (KJS::ObjectImp::get):
10083 (KJS::ObjectImp::hasProperty):
10087 2003-11-17 Maciej Stachowiak <mjs@apple.com>
10089 Patch from Harri, reviewed by me.
10091 - fixed 3487375 - backwards array slice causes infinite loop
10093 * kjs/array_object.cpp:
10094 (ArrayProtoFuncImp::call):
10096 2003-11-17 Maciej Stachowiak <mjs@apple.com>
10098 Patch from Harri Porten reviewed by me.
10100 - fixed 3487371 - operator precedence for bitwise or, xor and and is wrong
10102 * kjs/grammar.y: Correct the precedence.
10104 2003-11-16 Maciej Stachowiak <mjs@apple.com>
10108 - fixed 3483829 - JavaScriptCore needs workaround to compile on Merlot
10110 * JavaScriptCore.pbproj/project.pbxproj: Add -Wno-long-double to
10115 2003-11-13 Richard Williamson <rjw@apple.com>
10117 Factored common code between copy constructor and assignment operator.
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:
10129 2003-11-13 Richard Williamson <rjw@apple.com>
10131 More LiveConnect stuff. This checkin adds abstract classes to model
10132 language runtimes and a JNI based set of concrete implementations for
10137 * JavaScriptCore.pbproj/project.pbxproj:
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:
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):
10217 2003-11-13 Maciej Stachowiak <mjs@apple.com>
10221 - fixed 3472562 - Null or Undefined variables passed to IN operator cause javascript exceptions
10224 (ForInNode::execute): If the in value is null or undefined, bail
10225 out early, since attempting to iterate its properties will throw
10228 2003-11-12 Darin Adler <darin@apple.com>
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.
10236 2003-11-12 Richard Williamson <rjw@apple.com>
10238 Added utility functions for calling JNI methods.
10242 * JavaScriptCore.pbproj/project.pbxproj:
10244 * bindings/Makefile.am: Added.
10245 * bindings/jni/Makefile.am: Added.
10246 * bindings/jni/jni_utility.cpp: Added.
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.
10261 2003-11-08 Darin Adler <darin@apple.com>
10265 - fixed 3477528 -- array.sort(function) fails if the function returns a non-zero value that rounds to zero
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.
10276 2003-11-03 Vicki Murley <vicki@apple.com>
10278 Reviewed by kocienda.
10280 - fixed <rdar://problem/3471096>: non-B&I builds should not use order files, because they cause false "regressions" in perf.
10282 * JavaScriptCore.pbproj/project.pbxproj: added empty SECTORDER_FLAGS variables to the Development and Deployment build styles
10284 2003-11-02 Darin Adler <darin@apple.com>
10286 Reviewed by Maciej.
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
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.
10296 (KJS::ElementNode::ElementNode): Build a circular list instead of a 0-terminated
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
10312 (KJS::VarDeclListNode::VarDeclListNode): Build a circular list instead of a 0-terminated
10314 (KJS::VarStatementNode::VarStatementNode): Break the circular list instead of reversing
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
10321 (KJS::ClauseListNode::ClauseListNode): Build a circular list instead of a 0-terminated
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
10329 (KJS::FuncDeclNode::FuncDeclNode): Break the circular list instead of reversing the
10331 (KJS::FuncExprNode::FuncExprNode): Break the circular list instead of reversing the
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.
10349 * kjs/grammar.cpp: Regenerated.
10350 * kjs/grammar.cpp.h: Regenerated.
10351 * kjs/grammar.h: Regenerated.
10355 2003-10-30 Maciej Stachowiak <mjs@apple.com>
10359 - fixed 3427069 - browsing mp3.com causes leaks (KJS)
10361 * kjs/string_object.cpp:
10362 (StringProtoFuncImp::call): Don't do an early return, since that
10363 could leak a temporary regexp.
10365 2003-10-29 Maciej Stachowiak <mjs@apple.com>
10369 - fixed 3426076 - Leak of JS lexer data visiting http://www.ebay.com
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.
10378 (Lexer::Lexer): Initialize new data members.
10379 (Lexer::lex): Use new methods to make strings and identifiers, and
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.
10387 2003-10-28 Maciej Stachowiak <mjs@apple.com>
10391 - fixed 3413962 - malicious web pages can kill all future JavaScript execution by breaking recursion limit check
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.
10398 2003-10-26 Darin Adler <darin@apple.com>
10400 * JavaScriptCorePrefix.h: Added a C case to the NULL definition since we use C as well
10401 as C++ in this project.
10403 2003-10-26 Darin Adler <darin@apple.com>
10405 - rolled in some CString changes Harri Porten did on the KDE side
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.
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.
10415 == Rolled over to ChangeLog-2003-10-25 ==