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/kjs/JSGlobalObjectFunctions.cpp

    r35247 r35291  
    5151static JSValue* encode(ExecState* exec, const ArgList& args, const char* doNotEscape)
    5252{
    53     UString str = args[0]->toString(exec);
     53    UString str = args.at(exec, 0)->toString(exec);
    5454    CString cstr = str.UTF8String(true);
    5555    if (!cstr.c_str())
     
    7474{
    7575    UString result = "";
    76     UString str = args[0]->toString(exec);
     76    UString str = args.at(exec, 0)->toString(exec);
    7777    int k = 0;
    7878    int len = str.size();
     
    275275        return throwError(exec, EvalError, "The \"this\" value passed to eval must be the global object from which eval originated");
    276276
    277     JSValue* x = args[0];
     277    JSValue* x = args.at(exec, 0);
    278278    if (!x->isString())
    279279        return x;
     
    295295JSValue* globalFuncParseInt(ExecState* exec, JSObject*, JSValue*, const ArgList& args)
    296296{
    297     return jsNumber(exec, parseInt(args[0]->toString(exec), args[1]->toInt32(exec)));
     297    return jsNumber(exec, parseInt(args.at(exec, 0)->toString(exec), args.at(exec, 1)->toInt32(exec)));
    298298}
    299299
    300300JSValue* globalFuncParseFloat(ExecState* exec, JSObject*, JSValue*, const ArgList& args)
    301301{
    302     return jsNumber(exec, parseFloat(args[0]->toString(exec)));
     302    return jsNumber(exec, parseFloat(args.at(exec, 0)->toString(exec)));
    303303}
    304304
    305305JSValue* globalFuncIsNaN(ExecState* exec, JSObject*, JSValue*, const ArgList& args)
    306306{
    307     return jsBoolean(isnan(args[0]->toNumber(exec)));
     307    return jsBoolean(isnan(args.at(exec, 0)->toNumber(exec)));
    308308}
    309309
    310310JSValue* globalFuncIsFinite(ExecState* exec, JSObject*, JSValue*, const ArgList& args)
    311311{
    312     double n = args[0]->toNumber(exec);
     312    double n = args.at(exec, 0)->toNumber(exec);
    313313    return jsBoolean(!isnan(n) && !isinf(n));
    314314}
     
    359359    UString result = "";
    360360    UString s;
    361     UString str = args[0]->toString(exec);
     361    UString str = args.at(exec, 0)->toString(exec);
    362362    const UChar* c = str.data();
    363363    for (int k = 0; k < str.size(); k++, c++) {
     
    383383{
    384384    UString result = "";
    385     UString str = args[0]->toString(exec);
     385    UString str = args.at(exec, 0)->toString(exec);
    386386    int k = 0;
    387387    int len = str.size();
     
    411411{
    412412    CStringBuffer string;
    413     args[0]->toString(exec).getCString(string);
     413    args.at(exec, 0)->toString(exec).getCString(string);
    414414    puts(string.data());
    415415    return jsUndefined();
Note: See TracChangeset for help on using the changeset viewer.