Changeset 166678 in webkit for trunk/Source/JavaScriptCore/bytecode/CodeBlock.h
- Timestamp:
- Apr 2, 2014, 4:50:25 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/bytecode/CodeBlock.h
r166178 r166678 133 133 PassRefPtr<CodeBlock> releaseAlternative() { return m_alternative.release(); } 134 134 void setAlternative(PassRefPtr<CodeBlock> alternative) { m_alternative = alternative; } 135 136 template <typename Functor> void forEachRelatedCodeBlock(Functor&& functor) 137 { 138 Functor f(std::forward<Functor>(functor)); 139 Vector<CodeBlock*, 4> codeBlocks; 140 codeBlocks.append(this); 141 142 while (!codeBlocks.isEmpty()) { 143 CodeBlock* currentCodeBlock = codeBlocks.takeLast(); 144 f(currentCodeBlock); 145 146 if (CodeBlock* alternative = currentCodeBlock->alternative()) 147 codeBlocks.append(alternative); 148 if (CodeBlock* osrEntryBlock = currentCodeBlock->specialOSREntryBlockOrNull()) 149 codeBlocks.append(osrEntryBlock); 150 } 151 } 135 152 136 153 CodeSpecializationKind specializationKind() const … … 1276 1293 if (value + 1 <= 1) 1277 1294 return; 1278 1279 HashSet<CodeBlock*>::iterator iter = m_set.find(static_cast<CodeBlock*>(candidateCodeBlock));1280 if ( iter == m_set.end())1295 1296 CodeBlock* codeBlock = static_cast<CodeBlock*>(candidateCodeBlock); 1297 if (!m_oldCodeBlocks.contains(codeBlock) && !m_newCodeBlocks.contains(codeBlock)) 1281 1298 return; 1282 1283 mark( *iter);1299 1300 mark(codeBlock); 1284 1301 } 1285 1302 … … 1293 1310 1294 1311 codeBlock->m_mayBeExecuting = true; 1312 // We might not have cleared the marks for this CodeBlock, but we need to visit it. 1313 codeBlock->m_visitAggregateHasBeenCalled = false; 1295 1314 #if ENABLE(GGC) 1296 1315 m_currentlyExecuting.append(codeBlock); … … 1298 1317 } 1299 1318 1319 template <typename Functor> inline void ScriptExecutable::forEachCodeBlock(Functor&& functor) 1320 { 1321 switch (type()) { 1322 case ProgramExecutableType: { 1323 jsCast<ProgramExecutable*>(this)->m_programCodeBlock->forEachRelatedCodeBlock(std::forward<Functor>(functor)); 1324 break; 1325 } 1326 1327 case EvalExecutableType: { 1328 jsCast<EvalExecutable*>(this)->m_evalCodeBlock->forEachRelatedCodeBlock(std::forward<Functor>(functor)); 1329 break; 1330 } 1331 1332 case FunctionExecutableType: { 1333 Functor f(std::forward<Functor>(functor)); 1334 FunctionExecutable* executable = jsCast<FunctionExecutable*>(this); 1335 if (CodeBlock* codeBlock = executable->m_codeBlockForCall.get()) 1336 codeBlock->forEachRelatedCodeBlock(f); 1337 if (CodeBlock* codeBlock = executable->m_codeBlockForConstruct.get()) 1338 codeBlock->forEachRelatedCodeBlock(f); 1339 break; 1340 } 1341 default: 1342 RELEASE_ASSERT_NOT_REACHED(); 1343 } 1344 } 1345 1300 1346 } // namespace JSC 1301 1347
Note:
See TracChangeset
for help on using the changeset viewer.