Ignore:
Timestamp:
Jul 22, 2008, 10:10:05 PM (17 years ago)
Author:
[email protected]
Message:

JavaScriptCore:

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

Reviewed by Oliver Hunt and Sam Weinig.

Next step toward putting doubles in registers: Prepare the Register class
and its clients for registers that don't contain JSValue*s.


This means a few things:


  1. Register::jsValue() clients, including ArgList clients, must now supply an ExecState* when accessing an entry in an ArgList, in case the entry will need to create a JSValue* on the fly.


  1. Register clients that definitely don't want to create a JSValue* on the fly now use different APIs: getJSValue() for clients that know the register contains a JSValue*, and v() for clients who just want a void*.


  1. I had to change some headers around in order to resolve dependency problems created by using a Register in the ArgList header.


SunSpider reports no change.

JavaScriptGlue:

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

Reviewed by Oliver Hunt and Sam Weinig.

Next step toward putting doubles in registers: Prepare the Register class
and its clients for registers that don't contain JSValue*s.

WebCore:

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

Reviewed by Oliver Hunt and Sam Weinig.

Next step toward putting doubles in registers: Prepare the Register class
and its clients for registers that don't contain JSValue*s.

File:
1 edited

Legend:

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

    r35245 r35291  
    4949}
    5050
    51 static UString valueToSourceString(ExecState* exec, const Register& val)
    52 {
    53     if (val.isString()) {
     51static UString valueToSourceString(ExecState* exec, JSValue* 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, const Register& value)
     70static CString constantName(ExecState* exec, int k, JSValue* value)
    7171{
    7272    return (valueToSourceString(exec, value) + "(@k" + UString::from(k) + ")").UTF8String();
     
    176176        size_t i = 0;
    177177        do {
    178             printf("  k%u = %s\n", static_cast<unsigned>(i), valueToSourceString(exec, registers[i]).ascii());
     178            printf("  k%u = %s\n", static_cast<unsigned>(i), valueToSourceString(exec, registers[i].jsValue(exec)).ascii());
    179179            ++i;
    180180        } while (i < registers.size());
     
    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, registers[k0]).c_str());
     211            printf("[%4d] load\t\t %s, %s\t\t\n", location, registerName(r0).c_str(), constantName(exec, k0, registers[k0].jsValue(exec)).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, registers[k0]).c_str());
     590            printf("[%4d] new_error\t %s, %d, %s\n", location, registerName(r0).c_str(), errorType, constantName(exec, k0, registers[k0].jsValue(exec)).c_str());
    591591            break;
    592592        }
Note: See TracChangeset for help on using the changeset viewer.