Changeset 201573 in webkit
- Timestamp:
- Jun 1, 2016, 3:22:04 PM (10 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 7 edited
-
ChangeLog (modified) (1 diff)
-
bytecode/ObjectPropertyConditionSet.cpp (modified) (1 diff)
-
interpreter/Interpreter.cpp (modified) (3 diffs)
-
runtime/BatchedTransitionOptimizer.h (modified) (1 diff)
-
runtime/JSGlobalObject.cpp (modified) (1 diff)
-
runtime/Operations.cpp (modified) (1 diff)
-
runtime/Operations.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r201566 r201573 1 2016-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 1 16 2016-06-01 Commit Queue <commit-queue@webkit.org> 2 17 -
trunk/Source/JavaScriptCore/bytecode/ObjectPropertyConditionSet.cpp
r201532 r201573 252 252 structure = object->structure(vm); 253 253 254 // Since we're accessing a prototype repeatedly, it's a good bet that it should not be255 // treated as a dictionary.256 254 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)); 258 264 structure->flattenDictionaryStructure(vm, object); 259 else {265 } else { 260 266 if (verbose) 261 267 dataLog("Cannot flatten dictionary when not on main thread, so invalid.\n"); -
trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp
r201495 r201573 942 942 return throwTerminatedExecutionException(callFrame); 943 943 944 if (scope->structure()->isUncacheableDictionary()) 945 scope->flattenDictionaryObject(vm); 946 944 947 ASSERT(codeBlock->numParameters() == 1); // 1 parameter for 'this'. 945 948 … … 1190 1193 } 1191 1194 1195 if (variableObject->structure()->isUncacheableDictionary()) 1196 variableObject->flattenDictionaryObject(vm); 1197 1192 1198 if (numVariables || numFunctions) { 1193 1199 BatchedTransitionOptimizer optimizer(vm, variableObject); … … 1246 1252 if (UNLIKELY(vm.shouldTriggerTermination(callFrame))) 1247 1253 return throwTerminatedExecutionException(callFrame); 1254 1255 if (scope->structure()->isUncacheableDictionary()) 1256 scope->flattenDictionaryObject(vm); 1248 1257 1249 1258 ASSERT(codeBlock->numParameters() == 1); // 1 parameter for 'this'. -
trunk/Source/JavaScriptCore/runtime/BatchedTransitionOptimizer.h
r201445 r201573 36 36 public: 37 37 BatchedTransitionOptimizer(VM& vm, JSObject* object) 38 : m_vm(&vm)39 , m_object(object)40 38 { 41 if (! m_object->structure(vm)->isDictionary())42 m_object->convertToDictionary(vm);39 if (!object->structure(vm)->isDictionary()) 40 object->convertToDictionary(vm); 43 41 } 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;54 42 }; 55 43 -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
r201542 r201573 320 320 ASSERT(vm.currentThreadIsHoldingAPILock()); 321 321 322 Base::setStructure(vm, Structure::toCacheableDictionaryTransition(vm, structure())); 323 322 324 JSGlobalObject::globalExec()->init(0, 0, CallFrame::noCaller(), 0, 0); 323 325 -
trunk/Source/JavaScriptCore/runtime/Operations.cpp
r201445 r201573 121 121 } 122 122 123 size_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 123 146 } // namespace JSC -
trunk/Source/JavaScriptCore/runtime/Operations.h
r201445 r201573 28 28 29 29 namespace JSC { 30 31 #define InvalidPrototypeChain (std::numeric_limits<size_t>::max()) 30 32 31 33 NEVER_INLINE JSValue jsAddSlowCase(CallFrame*, JSValue, JSValue); … … 34 36 bool jsIsObjectTypeOrNull(CallFrame*, JSValue); 35 37 bool jsIsFunctionType(JSValue); 38 size_t normalizePrototypeChain(CallFrame*, Structure*); 36 39 37 40 ALWAYS_INLINE JSValue jsString(ExecState* exec, JSString* s1, JSString* s2) … … 193 196 } 194 197 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 it211 // should not be treated as a dictionary.212 if (structure->isDictionary())213 structure->flattenDictionaryStructure(vm, asObject(base));214 215 ++count;216 }217 }218 219 198 } // namespace JSC 220 199
Note:
See TracChangeset
for help on using the changeset viewer.