Ignore:
Timestamp:
Oct 28, 2009, 6:25:02 PM (16 years ago)
Author:
[email protected]
Message:

Improve for..in enumeration performance
https://bugs.webkit.org/show_bug.cgi?id=30887

Reviewed by Geoff Garen.

Improve indexing of an object with a for..in iterator by
identifying cases where get_by_val is being used with a iterator
as the subscript and replace it with a new get_by_pname
bytecode. get_by_pname then optimizes lookups that directly access
the base object.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/bytecode/CodeBlock.cpp

    r49734 r50254  
    825825            break;
    826826        }
     827        case op_get_by_pname: {
     828            int r0 = (++it)->u.operand;
     829            int r1 = (++it)->u.operand;
     830            int r2 = (++it)->u.operand;
     831            int r3 = (++it)->u.operand;
     832            int r4 = (++it)->u.operand;
     833            int r5 = (++it)->u.operand;
     834            printf("[%4d] get_by_pname\t %s, %s, %s, %s, %s, %s\n", location, registerName(r0).c_str(), registerName(r1).c_str(), registerName(r2).c_str(), registerName(r3).c_str(), registerName(r4).c_str(), registerName(r5).c_str());
     835            break;
     836        }
    827837        case op_put_by_val: {
    828838            int r0 = (++it)->u.operand;
     
    10161026        }
    10171027        case op_get_pnames: {
    1018             int r0 = it[0].u.operand;
    1019             int r1 = it[1].u.operand;
    1020             printf("[%4d] get_pnames\t %s, %s\n", location, registerName(r0).c_str(), registerName(r1).c_str());
     1028            int r0 = it[1].u.operand;
     1029            int r1 = it[2].u.operand;
     1030            int r2 = it[3].u.operand;
     1031            int r3 = it[4].u.operand;
     1032            int offset = it[5].u.operand;
     1033            printf("[%4d] get_pnames\t %s, %s, %s, %s, %d(->%d)\n", location, registerName(r0).c_str(), registerName(r1).c_str(), registerName(r2).c_str(), registerName(r3).c_str(), offset, location + offset);
    10211034            it += OPCODE_LENGTH(op_get_pnames) - 1;
    10221035            break;
    10231036        }
    10241037        case op_next_pname: {
    1025             int dest = it[0].u.operand;
     1038            int dest = it[1].u.operand;
    10261039            int iter = it[4].u.operand;
    10271040            int offset = it[5].u.operand;
Note: See TracChangeset for help on using the changeset viewer.