Ignore:
Timestamp:
Sep 20, 2009, 10:42:24 PM (16 years ago)
Author:
[email protected]
Message:

SNES is too slow
https://bugs.webkit.org/show_bug.cgi?id=29534

Reviewed by Maciej Stachowiak.

The problem was that the emulator used multiple classes with
more properties than our dictionary cutoff allowed, this resulted
in more or less all critical logic inside the emulator requiring
uncached property access.

Rather than simply bumping the dictionary cutoff, this patch
recognises that there are two ways to create a "dictionary"
structure. Either by adding a large number of properties, or
by removing a property. In the case of adding properties we
know all the existing properties will maintain their existing
offsets, so we could cache access to those properties, if we
know they won't be removed.

To make this possible, this patch adds the logic required to
distinguish a dictionary created by addition from one created
by removal. With this logic in place we can now cache access
to objects with large numbers of properties.

SNES performance improved by more than 6x.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/interpreter/Interpreter.cpp

    r48542 r48573  
    170170    if (globalObject->getPropertySlot(callFrame, ident, slot)) {
    171171        JSValue result = slot.getValue(callFrame, ident);
    172         if (slot.isCacheable() && !globalObject->structure()->isDictionary() && slot.slotBase() == globalObject) {
     172        if (slot.isCacheable() && !globalObject->structure()->isUncacheableDictionary() && slot.slotBase() == globalObject) {
    173173            if (vPC[4].u.structure)
    174174                vPC[4].u.structure->deref();
     
    954954    Structure* structure = baseCell->structure();
    955955
    956     if (structure->isDictionary()) {
     956    if (structure->isUncacheableDictionary()) {
    957957        vPC[0] = getOpcode(op_put_by_id_generic);
    958958        return;
     
    10411041    Structure* structure = asCell(baseValue)->structure();
    10421042
    1043     if (structure->isDictionary()) {
     1043    if (structure->isUncacheableDictionary()) {
    10441044        vPC[0] = getOpcode(op_get_by_id_generic);
    10451045        return;
Note: See TracChangeset for help on using the changeset viewer.