Changeset 37320 in webkit for trunk/JavaScriptCore
- Timestamp:
- Oct 5, 2008, 3:47:24 PM (17 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r37316 r37320 1 2008-10-05 Cameron Zwarich <[email protected]> 2 3 Reviewed by Maciej Stachowiak. 4 5 Bug 21364: Remove the branch in op_ret for OptionalCalleeActivation and OptionalCalleeArguments 6 <https://bugs.webkit.org/show_bug.cgi?id=21364> 7 8 This patch does not yet remove the branch, but it does a bit of refactoring 9 so that a CodeGenerator now knows whether the associated CodeBlock will need 10 a full scope before doing any code generation. This makes it possible to emit 11 explicit tear-off instructions before every op_ret. 12 13 * VM/CodeBlock.h: 14 (JSC::CodeBlock::CodeBlock): 15 * VM/CodeGenerator.cpp: 16 (JSC::CodeGenerator::generate): 17 (JSC::CodeGenerator::CodeGenerator): 18 (JSC::CodeGenerator::emitPushScope): 19 (JSC::CodeGenerator::emitPushNewScope): 20 * kjs/nodes.h: 21 (JSC::ScopeNode::needsActivation): 22 1 23 2008-10-05 Gavin Barraclough <[email protected]> 2 24 -
trunk/JavaScriptCore/VM/CodeBlock.h
r37275 r37320 193 193 , numVars(0) 194 194 , numParameters(0) 195 , needsFullScopeChain(ownerNode_-> usesEval() || ownerNode_->containsClosures())195 , needsFullScopeChain(ownerNode_->needsActivation()) 196 196 , usesEval(ownerNode_->usesEval()) 197 197 , codeType(codeType_) -
trunk/JavaScriptCore/VM/CodeGenerator.cpp
r37294 r37320 132 132 m_codeBlock->thisRegister = m_thisRegister.index(); 133 133 134 if (m_shouldEmitDebugHooks)135 m_codeBlock->needsFullScopeChain = true;136 137 134 m_scopeNode->emitCode(*this); 138 139 if (m_codeType == FunctionCode && m_codeBlock->needsFullScopeChain) {140 ASSERT(globalData()->machine->getOpcodeID(m_codeBlock->instructions[0].u.opcode) == op_enter);141 m_codeBlock->instructions[0] = globalData()->machine->getOpcode(op_enter_with_activation);142 }143 135 144 136 #ifndef NDEBUG … … 217 209 , m_lastOpcodeID(op_end) 218 210 { 211 if (m_shouldEmitDebugHooks) 212 m_codeBlock->needsFullScopeChain = true; 213 219 214 emitOpcode(op_enter); 220 215 codeBlock->globalData = m_globalData; … … 290 285 , m_lastOpcodeID(op_end) 291 286 { 292 emitOpcode(op_enter); 287 if (m_shouldEmitDebugHooks) 288 m_codeBlock->needsFullScopeChain = true; 289 290 if (m_codeBlock->needsFullScopeChain) 291 emitOpcode(op_enter_with_activation); 292 else 293 emitOpcode(op_enter); 294 293 295 codeBlock->globalData = m_globalData; 294 296 … … 348 350 , m_lastOpcodeID(op_end) 349 351 { 352 if (m_shouldEmitDebugHooks) 353 m_codeBlock->needsFullScopeChain = true; 354 350 355 emitOpcode(op_enter); 351 356 codeBlock->globalData = m_globalData; … … 1201 1206 RegisterID* CodeGenerator::emitPushScope(RegisterID* scope) 1202 1207 { 1203 m_codeBlock->needsFullScopeChain = true;1204 1208 ControlFlowContext context; 1205 1209 context.isFinallyBlock = false; … … 1417 1421 void CodeGenerator::emitPushNewScope(RegisterID* dst, Identifier& property, RegisterID* value) 1418 1422 { 1419 m_codeBlock->needsFullScopeChain = true;1420 1423 ControlFlowContext context; 1421 1424 context.isFinallyBlock = false; -
trunk/JavaScriptCore/kjs/nodes.h
r37285 r37320 2194 2194 void setUsesArguments() { m_features |= ArgumentsFeature; } 2195 2195 bool usesThis() const { return m_features & ThisFeature; } 2196 bool needsActivation() const { return m_features & (EvalFeature | ClosureFeature | WithFeature | CatchFeature); } 2196 2197 2197 2198 VarStack& varStack() { return m_varStack; }
Note:
See TracChangeset
for help on using the changeset viewer.