Changeset 50254 in webkit for trunk/JavaScriptCore/bytecompiler
- Timestamp:
- Oct 28, 2009, 6:25:02 PM (16 years ago)
- Location:
- trunk/JavaScriptCore/bytecompiler
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
r49734 r50254 1282 1282 RegisterID* BytecodeGenerator::emitGetByVal(RegisterID* dst, RegisterID* base, RegisterID* property) 1283 1283 { 1284 for (size_t i = m_forInContextStack.size(); i > 0; i--) { 1285 ForInContext& context = m_forInContextStack[i - 1]; 1286 if (context.propertyRegister == property) { 1287 emitOpcode(op_get_by_pname); 1288 instructions().append(dst->index()); 1289 instructions().append(base->index()); 1290 instructions().append(property->index()); 1291 instructions().append(context.expectedSubscriptRegister->index()); 1292 instructions().append(context.iterRegister->index()); 1293 instructions().append(context.indexRegister->index()); 1294 return dst; 1295 } 1296 } 1284 1297 emitOpcode(op_get_by_val); 1285 1298 instructions().append(dst->index()); -
trunk/JavaScriptCore/bytecompiler/BytecodeGenerator.h
r49734 r50254 62 62 }; 63 63 64 struct ForInContext { 65 RefPtr<RegisterID> expectedSubscriptRegister; 66 RefPtr<RegisterID> iterRegister; 67 RefPtr<RegisterID> indexRegister; 68 RefPtr<RegisterID> propertyRegister; 69 }; 70 64 71 class BytecodeGenerator : public FastAllocBase { 65 72 public: … … 332 339 void popFinallyContext(); 333 340 341 void pushOptimisedForIn(RegisterID* expectedBase, RegisterID* iter, RegisterID* index, RegisterID* propertyRegister) 342 { 343 ForInContext context = { expectedBase, iter, index, propertyRegister }; 344 m_forInContextStack.append(context); 345 } 346 347 void popOptimisedForIn() 348 { 349 m_forInContextStack.removeLast(); 350 } 351 334 352 LabelScope* breakTarget(const Identifier&); 335 353 LabelScope* continueTarget(const Identifier&); … … 468 486 Vector<ControlFlowContext> m_scopeContextStack; 469 487 Vector<SwitchInfo> m_switchContextStack; 488 Vector<ForInContext> m_forInContextStack; 470 489 471 490 int m_nextGlobalIndex;
Note:
See TracChangeset
for help on using the changeset viewer.