Changeset 35230 in webkit for trunk/JavaScriptCore
- Timestamp:
- Jul 17, 2008, 4:53:39 PM (17 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r35229 r35230 1 2008-07-17 Geoffrey Garen <[email protected]> 2 3 Reviewed by John Sullivan and Oliver Hunt. 4 5 A tiny bit of tidying in function call register allocation. 6 7 This patch saves one register when invoking a function expression and/or 8 a new expression that is stored in a temporary. 9 10 Since it's just one register, I can't make a testcase for it. 11 12 * VM/CodeGenerator.cpp: 13 (KJS::CodeGenerator::emitCall): No need to ref the function we're calling 14 or its base. We'd like the call frame to overlap with them, if possible. 15 op_call will read the function and its base before writing the call frame, 16 so this is safe. 17 18 * kjs/nodes.cpp: 19 (KJS::NewExprNode::emitCode): No need to ref the function we're new-ing, 20 for the same reasons stated above. 21 22 (KJS::FunctionCallValueNode::emitCode): ditto 23 1 24 2008-07-17 Steve Falkenburg <[email protected]> 2 25 -
trunk/JavaScriptCore/VM/CodeGenerator.cpp
r35037 r35230 863 863 { 864 864 ASSERT(opcodeID == op_call || opcodeID == op_call_eval); 865 866 RefPtr<RegisterID> refFunc = func; 867 RefPtr<RegisterID> refBase = base; 865 866 // Ordinarily, we might ref "func" and "base", to avoid allocating new 867 // temporaries in the same registers. In this case, though, we actually 868 // want the call frame we allocate to overlap "func" and "base", if they're 869 // not otherwise referenced. op_call will read "func" and "base" before 870 // writing out the call frame, so this is safe. 868 871 869 872 // Reserve space for call frame. … … 898 901 RegisterID* CodeGenerator::emitConstruct(RegisterID* dst, RegisterID* func, ArgumentsNode* argumentsNode) 899 902 { 903 // Ordinarily, we might ref "func", to avoid allocating a new temporary in 904 // the same register. In this case, though, we actually want the call 905 // frame we allocate to overlap "func", if it's not otherwise referenced. 906 // op_construct will read "func" before writing out the call frame, so this 907 // is safe. 908 900 909 // Reserve space for call frame. 901 910 Vector<RefPtr<RegisterID>, RegisterFile::CallFrameHeaderSize> callFrame; -
trunk/JavaScriptCore/kjs/nodes.cpp
r35226 r35230 400 400 RegisterID* NewExprNode::emitCode(CodeGenerator& generator, RegisterID* dst) 401 401 { 402 Re fPtr<RegisterID>r0 = generator.emitNode(m_expr.get());403 return generator.emitConstruct(generator.finalDestination(dst), r0 .get(), m_args.get());402 RegisterID* r0 = generator.emitNode(m_expr.get()); 403 return generator.emitConstruct(generator.finalDestination(dst), r0, m_args.get()); 404 404 } 405 405 … … 414 414 RegisterID* FunctionCallValueNode::emitCode(CodeGenerator& generator, RegisterID* dst) 415 415 { 416 Re fPtr<RegisterID>func = generator.emitNode(m_expr.get());417 return generator.emitCall(generator.finalDestination(dst), func .get(), 0, m_args.get());416 RegisterID* func = generator.emitNode(m_expr.get()); 417 return generator.emitCall(generator.finalDestination(dst), func, 0, m_args.get()); 418 418 } 419 419
Note:
See TracChangeset
for help on using the changeset viewer.