Changeset 34457 in webkit for trunk/JavaScriptCore
- Timestamp:
- Jun 8, 2008, 5:57:28 PM (17 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r34437 r34457 1 2008-06-08 Cameron Zwarich <[email protected]> 2 3 Reviewed by Darin. 4 5 Bug 19346: REGRESSION: Mootools 1.2 Class inheritance broken in post-SquirrelFish merge 6 <https://bugs.webkit.org/show_bug.cgi?id=19346> 7 8 A check for whether a function's caller is eval code accidentally included 9 the case where the caller's caller is native code. Add a CodeType field to 10 CodeBlock and use this for the eval caller test instead. 11 12 * VM/CodeBlock.h: 13 (KJS::CodeBlock::CodeBlock): 14 (KJS::ProgramCodeBlock::ProgramCodeBlock): 15 (KJS::EvalCodeBlock::EvalCodeBlock): 16 * VM/Machine.cpp: 17 (KJS::getCallerFunctionOffset): 18 * kjs/nodes.cpp: 19 (KJS::FunctionBodyNode::generateCode): 20 (KJS::ProgramNode::generateCode): 21 1 22 2008-06-07 Cameron Zwarich <[email protected]> 2 23 -
trunk/JavaScriptCore/VM/CodeBlock.h
r34372 r34457 57 57 58 58 struct CodeBlock { 59 CodeBlock(ScopeNode* ownerNode_ )59 CodeBlock(ScopeNode* ownerNode_, CodeType codeType_) 60 60 : ownerNode(ownerNode_) 61 61 , numTemporaries(0) … … 65 65 , needsFullScopeChain(ownerNode_->usesEval() || ownerNode_->needsClosure()) 66 66 , usesEval(ownerNode_->usesEval()) 67 , codeType(codeType_) 67 68 { 68 69 } … … 82 83 bool needsFullScopeChain; 83 84 bool usesEval; 85 CodeType codeType; 84 86 85 87 Vector<Instruction> instructions; … … 102 104 103 105 struct ProgramCodeBlock : public CodeBlock { 104 ProgramCodeBlock(ScopeNode* ownerNode , JSGlobalObject* globalObject_)105 : CodeBlock(ownerNode )106 ProgramCodeBlock(ScopeNode* ownerNode_, CodeType codeType_, JSGlobalObject* globalObject_) 107 : CodeBlock(ownerNode_, codeType_) 106 108 , globalObject(globalObject_) 107 109 { … … 119 121 120 122 struct EvalCodeBlock : public ProgramCodeBlock { 121 EvalCodeBlock(ScopeNode* ownerNode , JSGlobalObject* globalObject_)122 : ProgramCodeBlock(ownerNode , globalObject_)123 EvalCodeBlock(ScopeNode* ownerNode_, JSGlobalObject* globalObject_) 124 : ProgramCodeBlock(ownerNode_, EvalCode, globalObject_) 123 125 { 124 126 } -
trunk/JavaScriptCore/VM/Machine.cpp
r34412 r34457 65 65 if (!callerCodeBlock) // test for top frame of re-entrant function call 66 66 return false; 67 67 68 if (callerCodeBlock->codeType == EvalCode) 69 return false; 70 68 71 callerOffset = callFrame[Machine::CallerRegisterOffset].u.i - callerCodeBlock->numLocals - Machine::CallFrameHeaderSize; 69 72 if (callerOffset < 0) // test for global frame 70 return false;71 72 Register* callerCallFrame = (*registerBase) + callerOffset;73 if (!callerCallFrame[Machine::CallerCodeBlock].u.codeBlock) // test for eval frame74 73 return false; 75 74 -
trunk/JavaScriptCore/kjs/nodes.cpp
r34412 r34457 1818 1818 JSGlobalObject* globalObject = scopeChain.globalObject(); 1819 1819 1820 m_code.set(new CodeBlock(this ));1820 m_code.set(new CodeBlock(this, FunctionCode)); 1821 1821 1822 1822 CodeGenerator generator(this, globalObject->debugger(), scopeChain, &m_symbolTable, m_code.get()); … … 1854 1854 JSGlobalObject* globalObject = scopeChain.globalObject(); 1855 1855 1856 m_code.set(new ProgramCodeBlock(this, globalObject));1856 m_code.set(new ProgramCodeBlock(this, GlobalCode, globalObject)); 1857 1857 1858 1858 CodeGenerator generator(this, globalObject->debugger(), scopeChain, &globalObject->symbolTable(), m_code.get(), m_varStack, m_functionStack, canCreateGlobals);
Note:
See TracChangeset
for help on using the changeset viewer.