Ignore:
Timestamp:
Apr 23, 2007, 3:28:10 AM (18 years ago)
Author:
mjs
Message:

Reviewed by Darin.


  • shrink FunctionImp / DeclaredFunctionImp by 4 bytes, by moving parameter list to function body


I reconciled this with a similar change in KDE kjs by Maks Orlovich <[email protected]>.

  • kjs/function.cpp: (KJS::FunctionImp::callAsFunction): (KJS::FunctionImp::passInParameters): (KJS::FunctionImp::lengthGetter): (KJS::FunctionImp::getParameterName):
  • kjs/function.h:
  • kjs/function_object.cpp: (FunctionProtoFunc::callAsFunction): (FunctionObjectImp::construct):
  • kjs/nodes.cpp: (FunctionBodyNode::addParam): (FunctionBodyNode::paramString): (FuncDeclNode::addParams): (FuncDeclNode::processFuncDecl): (FuncExprNode::addParams): (FuncExprNode::evaluate):
  • kjs/nodes.h: (KJS::Parameter::Parameter): (KJS::FunctionBodyNode::numParams): (KJS::FunctionBodyNode::paramName): (KJS::FunctionBodyNode::parameters): (KJS::FuncExprNode::FuncExprNode): (KJS::FuncDeclNode::FuncDeclNode):
  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Disable 64-bit warnings because they handle size_t badly.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/function_object.cpp

    r20310 r21032  
    8484        DeclaredFunctionImp *fi = static_cast<DeclaredFunctionImp*>(thisObj);
    8585        return jsString("function " + fi->functionName().ustring() + "(" +
    86                         fi->parameterString() + ") " + fi->body->toString());
     86                        fi->body->paramString() + ") " + fi->body->toString());
    8787     } else if (thisObj->inherits(&InternalFunctionImp::info) &&
    8888                !static_cast<InternalFunctionImp*>(thisObj)->functionName().isNull()) {
     
    229229              c++, i++;
    230230          if (i == len) {
    231               fimp->addParameter(Identifier(param));
     231              bodyNode->addParam(Identifier(param));
    232232              params++;
    233233              break;
    234234          } else if (*c == ',') {
    235               fimp->addParameter(Identifier(param));
     235              bodyNode->addParam(Identifier(param));
    236236              params++;
    237237              c++, i++;
Note: See TracChangeset for help on using the changeset viewer.