Changeset 34852 in webkit for trunk/JavaScriptCore/VM/CodeGenerator.h
- Timestamp:
- Jun 28, 2008, 9:03:11 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/VM/CodeGenerator.h
r34851 r34852 129 129 // Functions for handling of dst register 130 130 131 // Returns 131 // Returns a place to write intermediate values of an operation 132 132 // which reuses dst if it is safe to do so. 133 134 RegisterID* tempDestination(RegisterID* dst) { return (dst && dst->isTemporary()) ? dst : newTemporary(); } 133 RegisterID* tempDestination(RegisterID* dst) 134 { 135 return (dst && dst != ignoredResult() && dst->isTemporary()) ? dst : newTemporary(); 136 } 135 137 136 138 // Returns the place to write the final output of an operation. 137 139 RegisterID* finalDestination(RegisterID* originalDst, RegisterID* tempDst = 0) 138 140 { 139 if (originalDst )141 if (originalDst && originalDst != ignoredResult()) 140 142 return originalDst; 143 ASSERT(tempDst != ignoredResult()); 141 144 if (tempDst && tempDst->isTemporary()) 142 145 return tempDst; … … 146 149 RegisterID* destinationForAssignResult(RegisterID* dst) 147 150 { 148 if (dst && m_codeBlock->needsFullScopeChain)151 if (dst && dst != ignoredResult() && m_codeBlock->needsFullScopeChain) 149 152 return dst->isTemporary() ? dst : newTemporary(); 150 153 return 0; 151 154 } 152 155 153 // moves src to dst if dst is not null and is different from src, otherwise just returns src 154 RegisterID* moveToDestinationIfNeeded(RegisterID* dst, RegisterID* src) { return (dst && dst != src) ? emitMove(dst, src) : src; } 156 // Moves src to dst if dst is not null and is different from src, otherwise just returns src. 157 RegisterID* moveToDestinationIfNeeded(RegisterID* dst, RegisterID* src) 158 { 159 return dst == ignoredResult() ? 0 : (dst && dst != src) ? emitMove(dst, src) : src; 160 } 155 161 156 162 PassRefPtr<LabelID> newLabel(); 157 163 158 164 // The emitNode functions are just syntactic sugar for calling 159 // Node::emitCode. They're the only functions that accept a NULL register. 165 // Node::emitCode. These functions accept a 0 for the register, 166 // meaning that the node should allocate a register, or ignoredResult(), 167 // meaning that the node need not put the result in a register. 168 // Other emit functions do not accept 0 or ignoredResult(). 160 169 RegisterID* emitNode(RegisterID* dst, Node* n) 161 170 { 162 171 // Node::emitCode assumes that dst, if provided, is either a local or a referenced temporary. 163 ASSERT(!dst || !dst->isTemporary() || dst->refCount());172 ASSERT(!dst || dst == ignoredResult() || !dst->isTemporary() || dst->refCount()); 164 173 if (!m_codeBlock->lineInfo.size() || m_codeBlock->lineInfo.last().lineNumber != n->lineNo()) { 165 174 LineInfo info = { instructions().size(), n->lineNo() };
Note:
See TracChangeset
for help on using the changeset viewer.