Ignore:
Timestamp:
Jul 17, 2008, 9:00:28 PM (17 years ago)
Author:
[email protected]
Message:

2008-07-17 Geoffrey Garen <[email protected]>

Reviewed by Oliver Hunt.


Next step toward putting doubles in registers: Store constant pool
entries as registers, not JSValue*s.


SunSpider reports no change.

File:
1 edited

Legend:

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

    r34883 r35231  
    4949}
    5050
    51 static UString valueToSourceString(ExecState* exec, JSValue* val)
    52 {
    53     if (val->isString()) {
     51static UString valueToSourceString(ExecState* exec, const Register& val)
     52{
     53    if (val.isString()) {
    5454        UString result("\"");
    55         result += escapeQuotes(val->toString(exec)) + "\"";
     55        result += escapeQuotes(val.toString(exec)) + "\"";
    5656        return result;
    5757    }
    5858
    59     return val->toString(exec);
     59    return val.toString(exec);
    6060}
    6161
     
    6868}
    6969
    70 static CString constantName(ExecState* exec, int k, JSValue* value)
     70static CString constantName(ExecState* exec, int k, const Register& value)
    7171{
    7272    return (valueToSourceString(exec, value) + "(@k" + UString::from(k) + ")").UTF8String();
     
    172172    }
    173173
    174     if (jsValues.size()) {
     174    if (registers.size()) {
    175175        printf("\nConstants:\n");
    176176        size_t i = 0;
    177177        do {
    178             printf("  k%u = %s\n", static_cast<unsigned>(i), valueToSourceString(exec, jsValues[i]).ascii());
     178            printf("  k%u = %s\n", static_cast<unsigned>(i), valueToSourceString(exec, registers[i]).ascii());
    179179            ++i;
    180         } while (i < jsValues.size());
     180        } while (i < registers.size());
    181181    }
    182182   
     
    209209            int r0 = (++it)->u.operand;
    210210            int k0 = (++it)->u.operand;
    211             printf("[%4d] load\t\t %s, %s\t\t\n", location, registerName(r0).c_str(), constantName(exec, k0, jsValues[k0]).c_str());
     211            printf("[%4d] load\t\t %s, %s\t\t\n", location, registerName(r0).c_str(), constantName(exec, k0, registers[k0]).c_str());
    212212            break;
    213213        }
     
    588588            int errorType = (++it)->u.operand;
    589589            int k0 = (++it)->u.operand;
    590             printf("[%4d] new_error\t %s, %d, %s\n", location, registerName(r0).c_str(), errorType, constantName(exec, k0, jsValues[k0]).c_str());
     590            printf("[%4d] new_error\t %s, %d, %s\n", location, registerName(r0).c_str(), errorType, constantName(exec, k0, registers[k0]).c_str());
    591591            break;
    592592        }
     
    623623void CodeBlock::mark()
    624624{
    625     for (size_t i = 0; i < jsValues.size(); ++i)
    626         if (!jsValues[i]->marked())
    627             jsValues[i]->mark();
     625    for (size_t i = 0; i < registers.size(); ++i)
     626        if (!registers[i].marked())
     627            registers[i].mark();
    628628
    629629    for (size_t i = 0; i < functions.size(); ++i)
Note: See TracChangeset for help on using the changeset viewer.