⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 201573 in webkit


Ignore:
Timestamp:
Jun 1, 2016, 3:22:04 PM (10 years ago)
Author:
ggaren@apple.com
Message:

Unreviewed, rolling in r201436.
https://bugs.webkit.org/show_bug.cgi?id=158143

r201562 should haved fixed the Dromaeo DOM core regression.

Restored changeset:

"REGRESSION: JSBench spends a lot of time transitioning
to/from dictionary"
https://bugs.webkit.org/show_bug.cgi?id=158045
http://trac.webkit.org/changeset/201436

Location:
trunk/Source/JavaScriptCore
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r201566 r201573  
     12016-06-01  Geoffrey Garen  <ggaren@apple.com>
     2
     3        Unreviewed, rolling in r201436.
     4        https://bugs.webkit.org/show_bug.cgi?id=158143
     5
     6        r201562 should haved fixed the Dromaeo DOM core regression.
     7
     8        Restored changeset:
     9
     10        "REGRESSION: JSBench spends a lot of time transitioning
     11        to/from dictionary"
     12        https://bugs.webkit.org/show_bug.cgi?id=158045
     13        http://trac.webkit.org/changeset/201436
     14
     15
    1162016-06-01  Commit Queue  <commit-queue@webkit.org>
    217
  • trunk/Source/JavaScriptCore/bytecode/ObjectPropertyConditionSet.cpp

    r201532 r201573  
    252252        structure = object->structure(vm);
    253253       
    254         // Since we're accessing a prototype repeatedly, it's a good bet that it should not be
    255         // treated as a dictionary.
    256254        if (structure->isDictionary()) {
    257             if (concurrency == MainThread)
     255            if (concurrency == MainThread) {
     256                if (structure->hasBeenFlattenedBefore()) {
     257                    if (verbose)
     258                        dataLog("Dictionary has been flattened before, so invalid.\n");
     259                    return ObjectPropertyConditionSet::invalid();
     260                }
     261
     262                if (verbose)
     263                    dataLog("Flattening ", pointerDump(structure));
    258264                structure->flattenDictionaryStructure(vm, object);
    259             else {
     265            } else {
    260266                if (verbose)
    261267                    dataLog("Cannot flatten dictionary when not on main thread, so invalid.\n");
  • trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp

    r201495 r201573  
    942942        return throwTerminatedExecutionException(callFrame);
    943943
     944    if (scope->structure()->isUncacheableDictionary())
     945        scope->flattenDictionaryObject(vm);
     946
    944947    ASSERT(codeBlock->numParameters() == 1); // 1 parameter for 'this'.
    945948
     
    11901193    }
    11911194
     1195    if (variableObject->structure()->isUncacheableDictionary())
     1196        variableObject->flattenDictionaryObject(vm);
     1197
    11921198    if (numVariables || numFunctions) {
    11931199        BatchedTransitionOptimizer optimizer(vm, variableObject);
     
    12461252    if (UNLIKELY(vm.shouldTriggerTermination(callFrame)))
    12471253        return throwTerminatedExecutionException(callFrame);
     1254
     1255    if (scope->structure()->isUncacheableDictionary())
     1256        scope->flattenDictionaryObject(vm);
    12481257
    12491258    ASSERT(codeBlock->numParameters() == 1); // 1 parameter for 'this'.
  • trunk/Source/JavaScriptCore/runtime/BatchedTransitionOptimizer.h

    r201445 r201573  
    3636public:
    3737    BatchedTransitionOptimizer(VM& vm, JSObject* object)
    38         : m_vm(&vm)
    39         , m_object(object)
    4038    {
    41         if (!m_object->structure(vm)->isDictionary())
    42             m_object->convertToDictionary(vm);
     39        if (!object->structure(vm)->isDictionary())
     40            object->convertToDictionary(vm);
    4341    }
    44 
    45     ~BatchedTransitionOptimizer()
    46     {
    47         if (m_object->structure()->isDictionary())
    48             m_object->flattenDictionaryObject(*m_vm);
    49     }
    50 
    51 private:
    52     VM* m_vm;
    53     JSObject* m_object;
    5442};
    5543
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp

    r201542 r201573  
    320320    ASSERT(vm.currentThreadIsHoldingAPILock());
    321321
     322    Base::setStructure(vm, Structure::toCacheableDictionaryTransition(vm, structure()));
     323
    322324    JSGlobalObject::globalExec()->init(0, 0, CallFrame::noCaller(), 0, 0);
    323325
  • trunk/Source/JavaScriptCore/runtime/Operations.cpp

    r201445 r201573  
    121121}
    122122
     123size_t normalizePrototypeChain(CallFrame* callFrame, Structure* structure)
     124{
     125    VM& vm = callFrame->vm();
     126    size_t count = 0;
     127    while (1) {
     128        if (structure->isProxy())
     129            return InvalidPrototypeChain;
     130        JSValue v = structure->prototypeForLookup(callFrame);
     131        if (v.isNull())
     132            return count;
     133
     134        JSCell* base = v.asCell();
     135        structure = base->structure(vm);
     136        if (structure->isDictionary()) {
     137            if (structure->hasBeenFlattenedBefore())
     138                return InvalidPrototypeChain;
     139            structure->flattenDictionaryStructure(vm, asObject(base));
     140        }
     141
     142        ++count;
     143    }
     144}
     145
    123146} // namespace JSC
  • trunk/Source/JavaScriptCore/runtime/Operations.h

    r201445 r201573  
    2828
    2929namespace JSC {
     30
     31#define InvalidPrototypeChain (std::numeric_limits<size_t>::max())
    3032
    3133NEVER_INLINE JSValue jsAddSlowCase(CallFrame*, JSValue, JSValue);
     
    3436bool jsIsObjectTypeOrNull(CallFrame*, JSValue);
    3537bool jsIsFunctionType(JSValue);
     38size_t normalizePrototypeChain(CallFrame*, Structure*);
    3639
    3740ALWAYS_INLINE JSValue jsString(ExecState* exec, JSString* s1, JSString* s2)
     
    193196}
    194197
    195 #define InvalidPrototypeChain (std::numeric_limits<size_t>::max())
    196 
    197 inline size_t normalizePrototypeChain(CallFrame* callFrame, Structure* structure)
    198 {
    199     VM& vm = callFrame->vm();
    200     size_t count = 0;
    201     while (1) {
    202         if (structure->isProxy())
    203             return InvalidPrototypeChain;
    204         JSValue v = structure->prototypeForLookup(callFrame);
    205         if (v.isNull())
    206             return count;
    207 
    208         JSCell* base = v.asCell();
    209         structure = base->structure(vm);
    210         // Since we're accessing a prototype in a loop, it's a good bet that it
    211         // should not be treated as a dictionary.
    212         if (structure->isDictionary())
    213             structure->flattenDictionaryStructure(vm, asObject(base));
    214 
    215         ++count;
    216     }
    217 }
    218 
    219198} // namespace JSC
    220199
Note: See TracChangeset for help on using the changeset viewer.