Changeset 210947 in webkit for trunk/Source/JavaScriptCore/runtime/StructureInlines.h
- Timestamp:
- Jan 19, 2017, 6:38:45 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/StructureInlines.h
r210829 r210947 244 244 } 245 245 246 ALWAYS_INLINE bool Structure::checkOffsetConsistency() const 247 { 248 PropertyTable* propertyTable = propertyTableOrNull(); 249 250 if (!propertyTable) { 251 ASSERT(!isPinnedPropertyTable()); 252 return true; 253 } 254 246 template<typename DetailsFunc> 247 ALWAYS_INLINE bool Structure::checkOffsetConsistency(PropertyTable* propertyTable, const DetailsFunc& detailsFunc) const 248 { 255 249 // We cannot reliably assert things about the property table in the concurrent 256 250 // compilation thread. It is possible for the table to be stolen and then have … … 273 267 dataLog("inlineOverflowAccordingToTotalSize = ", inlineOverflowAccordingToTotalSize, "\n"); 274 268 dataLog("numberOfOutOfLineSlotsForLastOffset = ", numberOfOutOfLineSlotsForLastOffset(m_offset), "\n"); 269 detailsFunc(); 275 270 UNREACHABLE_FOR_PLATFORM(); 276 271 }; … … 284 279 } 285 280 281 ALWAYS_INLINE bool Structure::checkOffsetConsistency() const 282 { 283 PropertyTable* propertyTable = propertyTableOrNull(); 284 285 if (!propertyTable) { 286 ASSERT(!isPinnedPropertyTable()); 287 return true; 288 } 289 290 // We cannot reliably assert things about the property table in the concurrent 291 // compilation thread. It is possible for the table to be stolen and then have 292 // things added to it, which leads to the offsets being all messed up. We could 293 // get around this by grabbing a lock here, but I think that would be overkill. 294 if (isCompilationThread()) 295 return true; 296 297 return checkOffsetConsistency(propertyTable, [] () { }); 298 } 299 286 300 inline void Structure::checkConsistency() 287 301 { … … 303 317 } 304 318 305 template< typename Func>319 template<Structure::ShouldPin shouldPin, typename Func> 306 320 inline PropertyOffset Structure::add(VM& vm, PropertyName propertyName, unsigned attributes, const Func& func) 307 321 { … … 309 323 310 324 GCSafeConcurrentJSLocker locker(m_lock, vm.heap); 311 312 setPropertyTable(vm, table); 325 326 switch (shouldPin) { 327 case ShouldPin::Yes: 328 pin(locker, vm, table); 329 break; 330 case ShouldPin::No: 331 setPropertyTable(vm, table); 332 break; 333 } 313 334 314 335 ASSERT(!JSC::isValidOffset(get(vm, propertyName))); … … 367 388 inline PropertyOffset Structure::addPropertyWithoutTransition(VM& vm, PropertyName propertyName, unsigned attributes, const Func& func) 368 389 { 369 pin(vm, ensurePropertyTable(vm)); 370 371 return add(vm, propertyName, attributes, func); 390 return add<ShouldPin::Yes>(vm, propertyName, attributes, func); 372 391 } 373 392
Note:
See TracChangeset
for help on using the changeset viewer.