Ignore:
Timestamp:
Dec 18, 2009, 12:46:08 PM (15 years ago)
Author:
[email protected]
Message:

Fixed intermittent failure seen on Windows buildbot, and in other JSC
API clients.

Reviewed by Adam Roben.

Added a WeakGCPtr class and changed OpaqueJSClass::cachedPrototype to
use it, to avoid vending a stale object as a prototype.

  • API/JSClassRef.cpp:

(OpaqueJSClassContextData::OpaqueJSClassContextData):
(OpaqueJSClass::prototype):

  • API/JSClassRef.h: Use WeakGCPtr.
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • runtime/WeakGCPtr.h: Added.

(JSC::WeakGCPtr::WeakGCPtr):
(JSC::WeakGCPtr::get):
(JSC::WeakGCPtr::clear):
(JSC::WeakGCPtr::operator*):
(JSC::WeakGCPtr::operator->):
(JSC::WeakGCPtr::operator!):
(JSC::WeakGCPtr::operator bool):
(JSC::WeakGCPtr::operator UnspecifiedBoolType):
(JSC::WeakGCPtr::assign):
(JSC::::operator):
(JSC::operator==):
(JSC::operator!=):
(JSC::static_pointer_cast):
(JSC::const_pointer_cast):
(JSC::getPtr): Added WeakGCPtr to the project.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/API/JSClassRef.h

    r46528 r52334  
    3232#include <runtime/Protect.h>
    3333#include <runtime/UString.h>
     34#include <runtime/WeakGCPtr.h>
    3435#include <wtf/HashMap.h>
    3536#include <wtf/RefCounted.h>
     
    7778    OpaqueJSClassStaticValuesTable* staticValues;
    7879    OpaqueJSClassStaticFunctionsTable* staticFunctions;
    79     JSC::JSObject* cachedPrototype;
     80    JSC::WeakGCPtr<JSC::JSObject> cachedPrototype;
    8081};
    8182
Note: See TracChangeset for help on using the changeset viewer.