Ignore:
Timestamp:
Sep 21, 2008, 2:35:23 PM (17 years ago)
Author:
Darin Adler
Message:

2008-09-21 Darin Adler <Darin Adler>

Reviewed by Sam Weinig.

No change on SunSpider. 1.29x as fast on V8 Raytrace.

  • kjs/Arguments.cpp: Moved ArgumentsData in here. Eliminated the indexToNameMap and hadDeletes data members. Changed extraArguments into an OwnArrayPtr and added deletedArguments, another OwnArrayPtr. Replaced numExtraArguments with numParameters, since that's what's used more directly in hot code paths. (JSC::Arguments::Arguments): Pass in argument count instead of ArgList. Initialize ArgumentsData the new way. (JSC::Arguments::mark): Updated. (JSC::Arguments::getOwnPropertySlot): Overload for the integer form so we don't have to convert integers to identifiers just to get an argument. Integrated the deleted case with the fast case. (JSC::Arguments::put): Ditto. (JSC::Arguments::deleteProperty): Ditto.
  • kjs/Arguments.h: Minimized includes. Made everything private. Added overloads for the integral property name case. Eliminated mappedIndexSetter. Moved ArgumentsData into the .cpp file.
  • kjs/IndexToNameMap.cpp: Emptied out and prepared for deletion.
  • kjs/IndexToNameMap.h: Ditto.
  • kjs/JSActivation.cpp: (JSC::JSActivation::createArgumentsObject): Elminated ArgList.
  • GNUmakefile.am:
  • JavaScriptCore.pri:
  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • JavaScriptCoreSources.bkl:
  • kjs/AllInOneFile.cpp: Removed IndexToNameMap.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/Arguments.h

    r36736 r36743  
    2525#define Arguments_h
    2626
    27 #include "IndexToNameMap.h"
    28 #include "JSFunction.h"
    2927#include "JSObject.h"
    3028
     
    3230
    3331    class JSActivation;
     32    class JSFunction;
    3433    class Register;
     34
     35    struct ArgumentsData;
    3536
    3637    class Arguments : public JSObject {
    3738    public:
    38         Arguments(ExecState*, JSFunction*, const ArgList&, JSActivation*, int firstArgumentIndex, Register* argv);
    39         ~Arguments();
     39        Arguments(ExecState*, JSFunction*, JSActivation*, int firstArgumentIndex, Register* argv, int argc);
     40        virtual ~Arguments();
     41
     42        static const ClassInfo info;
    4043
    4144        virtual void mark();
    4245
    43         virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
     46    private:
     47        virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&);
     48        virtual bool getOwnPropertySlot(ExecState*, unsigned propertyName, PropertySlot&);
    4449        virtual void put(ExecState*, const Identifier& propertyName, JSValue*, PutPropertySlot&);
     50        virtual void put(ExecState*, unsigned propertyName, JSValue*, PutPropertySlot&);
    4551        virtual bool deleteProperty(ExecState*, const Identifier& propertyName);
     52        virtual bool deleteProperty(ExecState*, unsigned propertyName);
    4653
    4754        virtual const ClassInfo* classInfo() const { return &info; }
    48         static const ClassInfo info;
    4955
    50     private:
    51         static JSValue* mappedIndexGetter(ExecState*, const Identifier&, const PropertySlot& slot);
    52 
    53         struct ArgumentsData {
    54             ArgumentsData(JSActivation* activation_, JSFunction* function_, const ArgList& args_, int firstArgumentIndex_)
    55                 : activation(activation_)
    56                 , indexToNameMap(function_, args_)
    57                 , firstArgumentIndex(firstArgumentIndex_)
    58                 , hadDeletes(false)
    59             {
    60                 unsigned numArguments = args_.size();
    61                 unsigned numParameters = function_->numParameters();
    62                 if (numArguments <= numParameters)
    63                     numExtraArguments = 0;
    64                 else
    65                     numExtraArguments = numArguments - numParameters;
    66             }
    67 
    68             JSActivation* activation;
    69             mutable IndexToNameMap indexToNameMap;
    70             int firstArgumentIndex;
    71             JSValue** extraArguments;
    72             unsigned numExtraArguments;
    73             bool hadDeletes;
    74         };
    75        
    7656        OwnPtr<ArgumentsData> d;
    7757    };
Note: See TracChangeset for help on using the changeset viewer.