Ignore:
Timestamp:
May 24, 2006, 3:42:54 PM (19 years ago)
Author:
ggaren
Message:

JavaScriptCore:

Reviewed by mjs.


On alternate threads, DOMObjects remain in the
ScriptInterpreter's cache because they're not collected. So, they
need an opportunity to mark their children.


I'm not particularly happy with this solution because it fails to
resolve many outstanding issues with the DOM object cache. Since none
of those issues is a crasher or a serious compatibility concern,
and since the behavior of other browsers is not much to go on in this
case, I've filed <rdar://problem/4561439> about that, and I'm moving on
with my life.

  • JavaScriptCore.xcodeproj/project.pbxproj:
  • kjs/collector.cpp: (KJS::Collector::collect):
  • kjs/internal.cpp: (KJS::InterpreterImp::mark):
  • kjs/internal.h:
  • kjs/interpreter.cpp: (KJS::Interpreter::mark):
  • kjs/interpreter.h:

LayoutTests:

Layout tests for DOM object cache and garbage collection,
<rdar://problem/4557926> TOT REGRESSION: Crash occurs when attempting
to view image in slideshow mode at http://d.smugmug.com/gallery/581716
( KJS::IfNode::execute (KJS::ExecState*) + 312) if you use a PAC file

  • fast/dom/gc-8-expected.txt: Added.
  • fast/dom/gc-8.html: Added.
  • fast/dom/gc-9-expected.txt: Added.
  • fast/dom/gc-9.html: Added.

WebCore:

Reviewed by mjs.

On alternate threads, DOMObjects remain in the
ScriptInterpreter's cache because they're not collected. So, they
need an opportunity to mark their children.


I'm not particularly happy with this solution because it fails to
resolve many outstanding issues with the DOM object cache. Since none
of those issues is a crasher or a serious compatibility concern,
and since the behavior of other browsers is not much to go on in this
case, I've filed <rdar://problem/4561439> about that, and I'm moving
on with my life.

Also added functionality for testing garbage collection from inside
DumpRenderTree.


Also removed XMLHttpRequest from the DOM object cache because XMLHttpRequest
objects aren't accessed through the DOM.


Also added JS locking around access to some shared data structures in
WebCoreJavaScript, even though it probably doesn't matter in practice.

  • bindings/js/JSXMLHttpRequest.cpp: (KJS::JSXMLHttpRequest::JSXMLHttpRequest): (KJS::JSXMLHttpRequest::~JSXMLHttpRequest):
  • bindings/js/kjs_binding.cpp: (KJS::ScriptInterpreter::mark):
  • bindings/js/kjs_binding.h:
  • bridge/mac/WebCoreJavaScript.h:
  • bridge/mac/WebCoreJavaScript.mm: (collect): (+[WebCoreJavaScript objectCount]): (+[WebCoreJavaScript interpreterCount]): (+[WebCoreJavaScript protectedObjectCount]): (+[WebCoreJavaScript garbageCollect]): (+[WebCoreJavaScript garbageCollectOnAlternateThread:]): (+[WebCoreJavaScript shouldPrintExceptions]): (+[WebCoreJavaScript setShouldPrintExceptions:]):

WebKitTools:

Reviewed by mjs.


Added 'GCController' to DRT to support garbage collection layout tests.


GCController.collect() and GCController.collectOnAlternateThread() do
what you would expect. The latter takes a boolean argument sepcifying
whether to wait for garbage collection to finish before continuing to
execute script.

  • DumpRenderTree/DumpRenderTree.m: (-[WaitUntilDoneDelegate webView:windowScriptObjectAvailable:]):
  • DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
  • DumpRenderTree/GCController.h: Added.
  • DumpRenderTree/GCController.mm: Added. (+[GCController isSelectorExcludedFromWebScript:]): (+[GCController webScriptNameForSelector:]): (-[GCController collect]): (-[GCController collectOnAlternateThread:]):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r14515 r14569  
    229229                E195679909E7CF1200B89D13 /* UnicodeCategory.h in Headers */ = {isa = PBXBuildFile; fileRef = E195679509E7CF1200B89D13 /* UnicodeCategory.h */; };
    230230/* End PBXBuildFile section */
     231
     232/* Begin PBXBuildStyle section */
     233                1442B6C20A24D53E00AE84F6 /* Development */ = {
     234                        isa = PBXBuildStyle;
     235                        buildSettings = {
     236                                COPY_PHASE_STRIP = NO;
     237                        };
     238                        name = Development;
     239                };
     240                1442B6C30A24D53E00AE84F6 /* Deployment */ = {
     241                        isa = PBXBuildStyle;
     242                        buildSettings = {
     243                                COPY_PHASE_STRIP = YES;
     244                        };
     245                        name = Deployment;
     246                };
     247/* End PBXBuildStyle section */
    231248
    232249/* Begin PBXContainerItemProxy section */
     
    9831000                        isa = PBXProject;
    9841001                        buildConfigurationList = 149C277108902AFE008A9EFC /* Build configuration list for PBXProject "JavaScriptCore" */;
     1002                        buildSettings = {
     1003                        };
     1004                        buildStyles = (
     1005                                1442B6C20A24D53E00AE84F6 /* Development */,
     1006                                1442B6C30A24D53E00AE84F6 /* Deployment */,
     1007                        );
    9851008                        hasScannedForEncodings = 1;
    9861009                        mainGroup = 0867D691FE84028FC02AAC07 /* JavaScriptCore */;
Note: See TracChangeset for help on using the changeset viewer.