Ignore:
Timestamp:
Mar 18, 2011, 4:07:16 PM (14 years ago)
Author:
[email protected]
Message:

2011-03-18 Geoffrey Garen <[email protected]>

Reviewed by Oliver Hunt.

[GTK] JSC crashes in 32bit Release bots after r80743
https://bugs.webkit.org/show_bug.cgi?id=56180


The crash was caused by referencing GC memory from a GC destructor. This
is not safe because destruction time / order is not guaranteed.

  • profiler/ProfileGenerator.cpp: (JSC::ProfileGenerator::create): (JSC::ProfileGenerator::ProfileGenerator): (JSC::ProfileGenerator::willExecute): (JSC::ProfileGenerator::didExecute):
  • profiler/ProfileGenerator.h: (JSC::ProfileGenerator::origin): Made ExecState* the first argument, to match the rest of this class and JSC.


Use a JSGlobalObject* instead of an ExecState* with an indirect reference
to a JSGlobalObject* to track our origin. This is simpler and more
efficient, and it removes the destruction order dependency that was causing
our crash.

  • profiler/Profiler.cpp: (JSC::Profiler::startProfiling): Updated for change to JSGlobalObject*. (JSC::Profiler::stopProfiling): New function for stopping all profiles for a given global object. This is more straight-forward than multiplexing through the old function.

(JSC::dispatchFunctionToProfiles): Updated for change to JSGlobalObject*.

  • profiler/Profiler.h: Ditto.
  • runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::~JSGlobalObject): Ditto.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/profiler/Profiler.h

    r76248 r81525  
    3939    class ExecState;
    4040    class JSGlobalData;
     41    class JSGlobalObject;
    4142    class JSObject;
    4243    class JSValue;
     
    5859        void startProfiling(ExecState*, const UString& title);
    5960        PassRefPtr<Profile> stopProfiling(ExecState*, const UString& title);
     61        void stopProfiling(JSGlobalObject*);
    6062
    6163        void willExecute(ExecState* callerCallFrame, JSValue function);
Note: See TracChangeset for help on using the changeset viewer.