Ignore:
Timestamp:
Jun 23, 2018, 3:47:58 AM (7 years ago)
Author:
[email protected]
Message:

We need to have a getDirectConcurrently for use in the compilers
https://bugs.webkit.org/show_bug.cgi?id=186954

Reviewed by Mark Lam.

It used to be that the propertyStorage of an object never shrunk
so if you called getDirect with some offset it would never be an
OOB read. However, this property storage can shrink when calling
flattenDictionaryStructure. Fortunately, flattenDictionaryStructure
holds the Structure's ConcurrentJSLock while shrinking. This patch,
adds a getDirectConcurrently that will safely try to load from the
butterfly.

  • bytecode/ObjectPropertyConditionSet.cpp:
  • bytecode/PropertyCondition.cpp:

(JSC::PropertyCondition::isStillValidAssumingImpurePropertyWatchpoint const):
(JSC::PropertyCondition::attemptToMakeEquivalenceWithoutBarrier const):

  • dfg/DFGGraph.cpp:

(JSC::DFG::Graph::tryGetConstantProperty):

  • runtime/JSObject.h:

(JSC::JSObject::getDirectConcurrently const):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/bytecode/PropertyCondition.cpp

    r233114 r233124  
    238238        }
    239239
    240         JSValue currentValue = base->getDirect(currentOffset);
     240        JSValue currentValue = base->getDirectConcurrently(structure, currentOffset);
    241241        if (currentValue != requiredValue()) {
    242242            if (PropertyConditionInternal::verbose) {
     
    393393{
    394394    Structure* structure = base->structure(vm);
    395     if (!structure->isValidOffset(offset()))
    396         return PropertyCondition();
    397     JSValue value = base->getDirect(offset());
     395
     396    JSValue value = base->getDirectConcurrently(structure, offset());
    398397    if (!isValidValueForPresence(vm, value))
    399398        return PropertyCondition();
Note: See TracChangeset for help on using the changeset viewer.