Changeset 36743 in webkit for trunk/JavaScriptCore/kjs/Arguments.h
- Timestamp:
- Sep 21, 2008, 2:35:23 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/Arguments.h
r36736 r36743 25 25 #define Arguments_h 26 26 27 #include "IndexToNameMap.h"28 #include "JSFunction.h"29 27 #include "JSObject.h" 30 28 … … 32 30 33 31 class JSActivation; 32 class JSFunction; 34 33 class Register; 34 35 struct ArgumentsData; 35 36 36 37 class Arguments : public JSObject { 37 38 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; 40 43 41 44 virtual void mark(); 42 45 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&); 44 49 virtual void put(ExecState*, const Identifier& propertyName, JSValue*, PutPropertySlot&); 50 virtual void put(ExecState*, unsigned propertyName, JSValue*, PutPropertySlot&); 45 51 virtual bool deleteProperty(ExecState*, const Identifier& propertyName); 52 virtual bool deleteProperty(ExecState*, unsigned propertyName); 46 53 47 54 virtual const ClassInfo* classInfo() const { return &info; } 48 static const ClassInfo info;49 55 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 else65 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 76 56 OwnPtr<ArgumentsData> d; 77 57 };
Note:
See TracChangeset
for help on using the changeset viewer.