Changeset 38229 in webkit for trunk/JavaScriptCore
- Timestamp:
- Nov 7, 2008, 12:41:47 PM (17 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r38228 r38229 1 2008-11-07 Cameron Zwarich <[email protected]> 2 3 Reviewed by Geoff Garen. 4 5 Bug 22129: Move CTI::isConstant() to CodeBlock 6 <https://bugs.webkit.org/show_bug.cgi?id=22129> 7 8 * VM/CTI.cpp: 9 (JSC::CTI::emitGetArg): 10 (JSC::CTI::emitGetPutArg): 11 (JSC::CTI::getConstantImmediateNumericArg): 12 (JSC::CTI::printOpcodeOperandTypes): 13 (JSC::CTI::privateCompileMainPass): 14 * VM/CTI.h: 15 * VM/CodeBlock.h: 16 (JSC::CodeBlock::isConstant): 17 1 18 2008-11-07 Alp Toker <[email protected]> 2 19 -
trunk/JavaScriptCore/VM/CTI.cpp
r38209 r38229 169 169 #endif 170 170 171 ALWAYS_INLINE bool CTI::isConstant(int src)172 {173 return src >= m_codeBlock->numVars && src < m_codeBlock->numVars + m_codeBlock->numConstants;174 }175 176 171 ALWAYS_INLINE JSValue* CTI::getConstant(CallFrame* callFrame, int src) 177 172 { … … 188 183 { 189 184 // TODO: we want to reuse values that are already in registers if we can - add a register allocator! 190 if ( isConstant(src)) {185 if (m_codeBlock->isConstant(src)) { 191 186 JSValue* js = getConstant(m_callFrame, src); 192 187 m_jit.movl_i32r(asInteger(js), dst); … … 198 193 ALWAYS_INLINE void CTI::emitGetPutArg(unsigned src, unsigned offset, X86Assembler::RegisterID scratch) 199 194 { 200 if ( isConstant(src)) {195 if (m_codeBlock->isConstant(src)) { 201 196 JSValue* js = getConstant(m_callFrame, src); 202 197 m_jit.movl_i32m(asInteger(js), offset + sizeof(void*), X86::esp); … … 220 215 ALWAYS_INLINE JSValue* CTI::getConstantImmediateNumericArg(unsigned src) 221 216 { 222 if ( isConstant(src)) {217 if (m_codeBlock->isConstant(src)) { 223 218 JSValue* js = getConstant(m_callFrame, src); 224 219 return JSImmediate::isNumber(js) ? js : noValue(); … … 279 274 { 280 275 char which1 = '*'; 281 if ( isConstant(src1)) {276 if (m_codeBlock->isConstant(src1)) { 282 277 JSValue* js = getConstant(m_callFrame, src1); 283 278 which1 = … … 293 288 } 294 289 char which2 = '*'; 295 if ( isConstant(src2)) {290 if (m_codeBlock->isConstant(src2)) { 296 291 JSValue* js = getConstant(m_callFrame, src2); 297 292 which2 = … … 1007 1002 case op_mov: { 1008 1003 unsigned src = instruction[i + 2].u.operand; 1009 if ( isConstant(src))1004 if (m_codeBlock->isConstant(src)) 1010 1005 m_jit.movl_i32r(asInteger(getConstant(m_callFrame, src)), X86::eax); 1011 1006 else -
trunk/JavaScriptCore/VM/CTI.h
r38209 r38229 358 358 static uintptr_t asInteger(JSValue*); 359 359 360 bool isConstant(int src);361 360 JSValue* getConstant(CallFrame*, int src); 362 361 -
trunk/JavaScriptCore/VM/CodeBlock.h
r38205 r38229 290 290 } 291 291 292 ALWAYS_INLINE bool isConstant(int index) 293 { 294 return index >= numVars && index < numVars + numConstants; 295 } 296 292 297 #if !defined(NDEBUG) || ENABLE_OPCODE_SAMPLING 293 298 void dump(ExecState*) const;
Note:
See TracChangeset
for help on using the changeset viewer.