Changeset 31277 in webkit
- Timestamp:
- Mar 24, 2008, 10:48:22 PM (17 years ago)
- Location:
- branches/squirrelfish/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/squirrelfish/JavaScriptCore/ChangeLog
r31276 r31277 1 2008-03-24 Geoffrey Garen <ggaren@apple.com> 2 3 Reviewed by Oliver Hunt. 4 5 Fixed recent 25% regression on simple for loop test. GCC seems to be 6 very finicky about the code that gets inlined into 7 Machine::privateExecute. 8 9 Everything in this patch is simply the result of experiment. 10 11 The resolve and resolve_base opcodes do not seem to have gotten slower 12 from this change. 13 14 * VM/Machine.cpp: 15 (KJS::resolve): 16 (KJS::resolveBase): 17 (KJS::Machine::privateExecute): 18 * kjs/nodes.h: 19 1 20 2008-03-24 Oliver Hunt <oliver@apple.com> 2 21 -
branches/squirrelfish/JavaScriptCore/VM/Machine.cpp
r31276 r31277 138 138 } 139 139 140 static void NEVER_INLINE resolve(ExecState* exec, Instruction* vPC, Register* r, ScopeChain* scopeChain, CodeBlock* codeBlock) 141 { 142 int r0 = (vPC + 1)->u.operand; 143 int k0 = (vPC + 2)->u.operand; 144 145 ScopeChainIterator iter = scopeChain->begin(); 146 ScopeChainIterator end = scopeChain->end(); 147 ASSERT(iter != end); 148 149 PropertySlot slot; 150 Identifier& ident = codeBlock->identifiers[k0]; 151 do { 152 JSObject* o = *iter; 153 if (o->getPropertySlot(exec, ident, slot)) { 154 r[r0].u.jsValue = slot.getValue(exec, o, ident); 155 return; 156 } 157 } while (++iter != end); 158 159 ASSERT_NOT_REACHED(); // FIXME: throw an undefined variable exception 160 } 161 162 static void NEVER_INLINE resolveBase(ExecState* exec, Instruction* vPC, Register* r, ScopeChain* scopeChain, CodeBlock* codeBlock) 163 { 164 int r0 = (vPC + 1)->u.operand; 165 int k0 = (vPC + 2)->u.operand; 166 167 ScopeChainIterator iter = scopeChain->begin(); 168 ScopeChainIterator end = scopeChain->end(); 169 ASSERT(iter != end); 170 171 PropertySlot slot; 172 Identifier& ident = codeBlock->identifiers[k0]; 173 JSObject* base; 174 do { 175 base = *iter; 176 if (base->getPropertySlot(exec, ident, slot)) { 177 r[r0].u.jsValue = base; 178 return; 179 } 180 } while (++iter != end); 181 182 r[r0].u.jsValue = base; 183 } 184 140 185 void Machine::privateExecute(ExecutionFlag flag, ExecState* exec, ScopeChain* scopeChain, CodeBlock* codeBlock) 141 186 { … … 227 272 } 228 273 BEGIN_OPCODE(op_resolve) { 229 int r0 = (++vPC)->u.operand; 230 int k0 = (++vPC)->u.operand; 231 232 ScopeChainIterator iter = scopeChain->begin(); 233 ScopeChainIterator end = scopeChain->end(); 234 ASSERT(iter != end); 235 236 PropertySlot slot; 237 Identifier& ident = codeBlock->identifiers[k0]; 238 do { 239 JSObject* o = *iter; 240 if (o->getPropertySlot(exec, ident, slot)) { 241 r[r0].u.jsValue = slot.getValue(exec, o, ident); 242 ++vPC; 243 NEXT_OPCODE; 244 } 245 } while (++iter != end); 246 247 ASSERT_NOT_REACHED(); // FIXME: throw an undefined variable exception 274 resolve(exec, vPC, r, scopeChain, codeBlock); 275 vPC += 3; 276 277 NEXT_OPCODE; 248 278 } 249 279 BEGIN_OPCODE(op_resolve_base) { 250 int r0 = (++vPC)->u.operand; 251 int k0 = (++vPC)->u.operand; 252 253 ScopeChainIterator iter = scopeChain->begin(); 254 ScopeChainIterator end = scopeChain->end(); 255 ASSERT(iter != end); 256 257 PropertySlot slot; 258 Identifier& ident = codeBlock->identifiers[k0]; 259 JSObject* base; 260 do { 261 base = *iter; 262 if (base->getPropertySlot(exec, ident, slot)) { 263 r[r0].u.jsValue = base; 264 265 ++vPC; 266 NEXT_OPCODE; 267 } 268 } while (++iter != end); 269 270 r[r0].u.jsValue = base; 271 272 ++vPC; 280 resolveBase(exec, vPC, r, scopeChain, codeBlock); 281 vPC += 3; 282 273 283 NEXT_OPCODE; 274 284 } -
branches/squirrelfish/JavaScriptCore/kjs/nodes.h
r31265 r31277 2936 2936 virtual JSValue* execute(ExecState*) KJS_FAST_CALL; 2937 2937 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 2938 ALWAYS_INLINEFunctionImp* makeFunction(ExecState*) KJS_FAST_CALL;2938 FunctionImp* makeFunction(ExecState*) KJS_FAST_CALL; 2939 2939 2940 2940 Identifier m_ident;
Note:
See TracChangeset
for help on using the changeset viewer.