Changeset 38291 in webkit for trunk/JavaScriptCore
- Timestamp:
- Nov 10, 2008, 9:55:50 PM (17 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r38290 r38291 1 2008-11-10 Cameron Zwarich <[email protected]> 2 3 Reviewed by Maciej Stachowiak. 4 5 Make CTI::getConstant() a member function of CodeBlock instead. 6 7 * VM/CTI.cpp: 8 (JSC::CTI::emitGetArg): 9 (JSC::CTI::emitGetPutArg): 10 (JSC::CTI::getConstantImmediateNumericArg): 11 (JSC::CTI::printOpcodeOperandTypes): 12 (JSC::CTI::privateCompileMainPass): 13 * VM/CTI.h: 14 * VM/CodeBlock.h: 15 (JSC::CodeBlock::getConstant): 16 1 17 2008-11-10 Cameron Zwarich <[email protected]> 2 18 -
trunk/JavaScriptCore/VM/CTI.cpp
r38290 r38291 169 169 #endif 170 170 171 ALWAYS_INLINE JSValue* CTI::getConstant(int src)172 {173 return m_codeBlock->constantRegisters[src - m_codeBlock->numVars].getJSValue();174 }175 176 171 inline uintptr_t CTI::asInteger(JSValue* value) 177 172 { … … 184 179 // TODO: we want to reuse values that are already in registers if we can - add a register allocator! 185 180 if (m_codeBlock->isConstantRegisterIndex(src)) { 186 JSValue* js = getConstant(src);181 JSValue* js = m_codeBlock->getConstant(src); 187 182 m_jit.movl_i32r(asInteger(js), dst); 188 183 } else … … 194 189 { 195 190 if (m_codeBlock->isConstantRegisterIndex(src)) { 196 JSValue* js = getConstant(src);191 JSValue* js = m_codeBlock->getConstant(src); 197 192 m_jit.movl_i32m(asInteger(js), offset + sizeof(void*), X86::esp); 198 193 } else { … … 216 211 { 217 212 if (m_codeBlock->isConstantRegisterIndex(src)) { 218 JSValue* js = getConstant(src);213 JSValue* js = m_codeBlock->getConstant(src); 219 214 return JSImmediate::isNumber(js) ? js : noValue(); 220 215 } … … 275 270 char which1 = '*'; 276 271 if (m_codeBlock->isConstantRegisterIndex(src1)) { 277 JSValue* js = getConstant(src1);272 JSValue* js = m_codeBlock->getConstant(src1); 278 273 which1 = 279 274 JSImmediate::isImmediate(js) ? … … 289 284 char which2 = '*'; 290 285 if (m_codeBlock->isConstantRegisterIndex(src2)) { 291 JSValue* js = getConstant(src2);286 JSValue* js = m_codeBlock->getConstant(src2); 292 287 which2 = 293 288 JSImmediate::isImmediate(js) ? … … 1006 1001 unsigned src = instruction[i + 2].u.operand; 1007 1002 if (m_codeBlock->isConstantRegisterIndex(src)) 1008 m_jit.movl_i32r(asInteger( getConstant(src)), X86::eax);1003 m_jit.movl_i32r(asInteger(m_codeBlock->getConstant(src)), X86::eax); 1009 1004 else 1010 1005 emitGetArg(src, X86::eax); -
trunk/JavaScriptCore/VM/CTI.h
r38286 r38291 353 353 static uintptr_t asInteger(JSValue*); 354 354 355 JSValue* getConstant(int src);356 357 355 void privateCompileMainPass(); 358 356 void privateCompileLinkPass(); -
trunk/JavaScriptCore/VM/CodeBlock.h
r38290 r38291 296 296 } 297 297 298 ALWAYS_INLINE JSValue* getConstant(int index) 299 { 300 return constantRegisters[index - numVars].getJSValue(); 301 } 302 298 303 #if !defined(NDEBUG) || ENABLE_OPCODE_SAMPLING 299 304 void dump(ExecState*) const;
Note:
See TracChangeset
for help on using the changeset viewer.