Changeset 39910 in webkit for trunk/JavaScriptCore
- Timestamp:
- Jan 14, 2009, 2:14:55 PM (16 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r39908 r39910 1 2009-01-14 Oliver Hunt <[email protected]> 2 3 Reviewed by Cameron Zwarich. 4 5 Bug 22903: REGRESSION (r36267): visiting this site reliably crashes WebKit nightly 6 7 EvalCodeBlock's do not reference the functions that are declared inside the eval 8 code, this means that simply marking the EvalCodeBlock through the global object 9 is insufficient to mark the declared functions. This patch corrects this by 10 explicitly marking the CodeBlocks of all the functions declared in the cached 11 EvalNode. 12 13 * bytecode/CodeBlock.cpp: 14 (JSC::CodeBlock::mark): 15 * bytecode/CodeBlock.h: 16 (JSC::CodeBlock::hasFunctions): 17 * bytecode/EvalCodeCache.h: 18 (JSC::EvalCodeCache::mark): 19 * parser/Nodes.cpp: 20 (JSC::ScopeNodeData::mark): 21 (JSC::EvalNode::mark): 22 * parser/Nodes.h: 23 1 24 2009-01-14 Dmitry Titov <[email protected]> 2 25 -
trunk/JavaScriptCore/bytecode/CodeBlock.cpp
r39752 r39910 1383 1383 m_rareData->m_unexpectedConstants[i]->mark(); 1384 1384 } 1385 m_rareData->m_evalCodeCache.mark(); 1385 1386 } 1386 1387 } -
trunk/JavaScriptCore/bytecode/CodeBlock.h
r39851 r39910 410 410 FuncDeclNode* function(int index) const { ASSERT(m_rareData); return m_rareData->m_functions[index].get(); } 411 411 412 bool hasFunctions() const { return m_functionExpressions.size() || (m_rareData && m_rareData->m_functions.size()); } 413 412 414 unsigned addUnexpectedConstant(JSValuePtr v) { createRareDataIfNecessary(); unsigned size = m_rareData->m_unexpectedConstants.size(); m_rareData->m_unexpectedConstants.append(v); return size; } 413 415 JSValuePtr unexpectedConstant(int index) const { ASSERT(m_rareData); return m_rareData->m_unexpectedConstants[index]; } -
trunk/JavaScriptCore/bytecode/EvalCodeCache.h
r39670 r39910 1 1 /* 2 * Copyright (C) 2008 Apple Inc. All rights reserved.2 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 69 69 bool isEmpty() const { return m_cacheMap.isEmpty(); } 70 70 71 void mark() 72 { 73 EvalCacheMap::iterator end = m_cacheMap.end(); 74 for (EvalCacheMap::iterator ptr = m_cacheMap.begin(); ptr != end; ++ptr) 75 ptr->second->mark(); 76 } 71 77 private: 72 78 static const int maxCacheableSourceLength = 256; 73 79 static const int maxCacheEntries = 64; 74 80 75 HashMap<RefPtr<UString::Rep>, RefPtr<EvalNode> > m_cacheMap; 81 typedef HashMap<RefPtr<UString::Rep>, RefPtr<EvalNode> > EvalCacheMap; 82 EvalCacheMap m_cacheMap; 76 83 }; 77 84 -
trunk/JavaScriptCore/parser/Nodes.cpp
r39851 r39910 2403 2403 } 2404 2404 2405 void ScopeNodeData::mark() 2406 { 2407 FunctionStack::iterator end = m_functionStack.end(); 2408 for (FunctionStack::iterator ptr = m_functionStack.begin(); ptr != end; ++ptr) { 2409 FunctionBodyNode* body = (*ptr)->body(); 2410 if (!body->isGenerated()) 2411 continue; 2412 body->generatedBytecode().mark(); 2413 } 2414 } 2415 2405 2416 // ------------------------------ ScopeNode ----------------------------- 2406 2417 … … 2533 2544 } 2534 2545 2546 void EvalNode::mark() 2547 { 2548 // We don't need to mark our own CodeBlock as the JSGlobalObject takes care of that 2549 data()->mark(); 2550 } 2551 2535 2552 // ------------------------------ FunctionBodyNode ----------------------------- 2536 2553 -
trunk/JavaScriptCore/parser/Nodes.h
r39752 r39910 2075 2075 int m_numConstants; 2076 2076 StatementVector m_children; 2077 2078 void mark(); 2077 2079 }; 2078 2080 … … 2159 2161 EvalCodeBlock& bytecodeForExceptionInfoReparse(ScopeChainNode*, CodeBlock*) JSC_FAST_CALL; 2160 2162 2163 void mark(); 2161 2164 private: 2162 2165 EvalNode(JSGlobalData*, SourceElements*, VarStack*, FunctionStack*, const SourceCode&, CodeFeatures, int numConstants) JSC_FAST_CALL;
Note:
See TracChangeset
for help on using the changeset viewer.