Changeset 37684 in webkit for trunk/JavaScriptCore/kjs/MathObject.cpp
- Timestamp:
- Oct 18, 2008, 6:52:42 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/MathObject.cpp
r37498 r37684 32 32 ASSERT_CLASS_FITS_IN_CELL(MathObject); 33 33 34 static JSValue * mathProtoFuncAbs(ExecState*, JSObject*, JSValue*, const ArgList&);35 static JSValue * mathProtoFuncACos(ExecState*, JSObject*, JSValue*, const ArgList&);36 static JSValue * mathProtoFuncASin(ExecState*, JSObject*, JSValue*, const ArgList&);37 static JSValue * mathProtoFuncATan(ExecState*, JSObject*, JSValue*, const ArgList&);38 static JSValue * mathProtoFuncATan2(ExecState*, JSObject*, JSValue*, const ArgList&);39 static JSValue * mathProtoFuncCeil(ExecState*, JSObject*, JSValue*, const ArgList&);40 static JSValue * mathProtoFuncCos(ExecState*, JSObject*, JSValue*, const ArgList&);41 static JSValue * mathProtoFuncExp(ExecState*, JSObject*, JSValue*, const ArgList&);42 static JSValue * mathProtoFuncFloor(ExecState*, JSObject*, JSValue*, const ArgList&);43 static JSValue * mathProtoFuncLog(ExecState*, JSObject*, JSValue*, const ArgList&);44 static JSValue * mathProtoFuncMax(ExecState*, JSObject*, JSValue*, const ArgList&);45 static JSValue * mathProtoFuncMin(ExecState*, JSObject*, JSValue*, const ArgList&);46 static JSValue * mathProtoFuncPow(ExecState*, JSObject*, JSValue*, const ArgList&);47 static JSValue * mathProtoFuncRandom(ExecState*, JSObject*, JSValue*, const ArgList&);48 static JSValue * mathProtoFuncRound(ExecState*, JSObject*, JSValue*, const ArgList&);49 static JSValue * mathProtoFuncSin(ExecState*, JSObject*, JSValue*, const ArgList&);50 static JSValue * mathProtoFuncSqrt(ExecState*, JSObject*, JSValue*, const ArgList&);51 static JSValue * mathProtoFuncTan(ExecState*, JSObject*, JSValue*, const ArgList&);34 static JSValuePtr mathProtoFuncAbs(ExecState*, JSObject*, JSValuePtr, const ArgList&); 35 static JSValuePtr mathProtoFuncACos(ExecState*, JSObject*, JSValuePtr, const ArgList&); 36 static JSValuePtr mathProtoFuncASin(ExecState*, JSObject*, JSValuePtr, const ArgList&); 37 static JSValuePtr mathProtoFuncATan(ExecState*, JSObject*, JSValuePtr, const ArgList&); 38 static JSValuePtr mathProtoFuncATan2(ExecState*, JSObject*, JSValuePtr, const ArgList&); 39 static JSValuePtr mathProtoFuncCeil(ExecState*, JSObject*, JSValuePtr, const ArgList&); 40 static JSValuePtr mathProtoFuncCos(ExecState*, JSObject*, JSValuePtr, const ArgList&); 41 static JSValuePtr mathProtoFuncExp(ExecState*, JSObject*, JSValuePtr, const ArgList&); 42 static JSValuePtr mathProtoFuncFloor(ExecState*, JSObject*, JSValuePtr, const ArgList&); 43 static JSValuePtr mathProtoFuncLog(ExecState*, JSObject*, JSValuePtr, const ArgList&); 44 static JSValuePtr mathProtoFuncMax(ExecState*, JSObject*, JSValuePtr, const ArgList&); 45 static JSValuePtr mathProtoFuncMin(ExecState*, JSObject*, JSValuePtr, const ArgList&); 46 static JSValuePtr mathProtoFuncPow(ExecState*, JSObject*, JSValuePtr, const ArgList&); 47 static JSValuePtr mathProtoFuncRandom(ExecState*, JSObject*, JSValuePtr, const ArgList&); 48 static JSValuePtr mathProtoFuncRound(ExecState*, JSObject*, JSValuePtr, const ArgList&); 49 static JSValuePtr mathProtoFuncSin(ExecState*, JSObject*, JSValuePtr, const ArgList&); 50 static JSValuePtr mathProtoFuncSqrt(ExecState*, JSObject*, JSValuePtr, const ArgList&); 51 static JSValuePtr mathProtoFuncTan(ExecState*, JSObject*, JSValuePtr, const ArgList&); 52 52 53 53 } … … 113 113 // ------------------------------ Functions -------------------------------- 114 114 115 JSValue * mathProtoFuncAbs(ExecState* exec, JSObject*, JSValue*, const ArgList& args)115 JSValuePtr mathProtoFuncAbs(ExecState* exec, JSObject*, JSValuePtr, const ArgList& args) 116 116 { 117 117 return jsNumber(exec, fabs(args.at(exec, 0)->toNumber(exec))); 118 118 } 119 119 120 JSValue * mathProtoFuncACos(ExecState* exec, JSObject*, JSValue*, const ArgList& args)120 JSValuePtr mathProtoFuncACos(ExecState* exec, JSObject*, JSValuePtr, const ArgList& args) 121 121 { 122 122 return jsNumber(exec, acos(args.at(exec, 0)->toNumber(exec))); 123 123 } 124 124 125 JSValue * mathProtoFuncASin(ExecState* exec, JSObject*, JSValue*, const ArgList& args)125 JSValuePtr mathProtoFuncASin(ExecState* exec, JSObject*, JSValuePtr, const ArgList& args) 126 126 { 127 127 return jsNumber(exec, asin(args.at(exec, 0)->toNumber(exec))); 128 128 } 129 129 130 JSValue * mathProtoFuncATan(ExecState* exec, JSObject*, JSValue*, const ArgList& args)130 JSValuePtr mathProtoFuncATan(ExecState* exec, JSObject*, JSValuePtr, const ArgList& args) 131 131 { 132 132 return jsNumber(exec, atan(args.at(exec, 0)->toNumber(exec))); 133 133 } 134 134 135 JSValue * mathProtoFuncATan2(ExecState* exec, JSObject*, JSValue*, const ArgList& args)135 JSValuePtr mathProtoFuncATan2(ExecState* exec, JSObject*, JSValuePtr, const ArgList& args) 136 136 { 137 137 return jsNumber(exec, atan2(args.at(exec, 0)->toNumber(exec), args.at(exec, 1)->toNumber(exec))); 138 138 } 139 139 140 JSValue * mathProtoFuncCeil(ExecState* exec, JSObject*, JSValue*, const ArgList& args)140 JSValuePtr mathProtoFuncCeil(ExecState* exec, JSObject*, JSValuePtr, const ArgList& args) 141 141 { 142 142 return jsNumber(exec, ceil(args.at(exec, 0)->toNumber(exec))); 143 143 } 144 144 145 JSValue * mathProtoFuncCos(ExecState* exec, JSObject*, JSValue*, const ArgList& args)145 JSValuePtr mathProtoFuncCos(ExecState* exec, JSObject*, JSValuePtr, const ArgList& args) 146 146 { 147 147 return jsNumber(exec, cos(args.at(exec, 0)->toNumber(exec))); 148 148 } 149 149 150 JSValue * mathProtoFuncExp(ExecState* exec, JSObject*, JSValue*, const ArgList& args)150 JSValuePtr mathProtoFuncExp(ExecState* exec, JSObject*, JSValuePtr, const ArgList& args) 151 151 { 152 152 return jsNumber(exec, exp(args.at(exec, 0)->toNumber(exec))); 153 153 } 154 154 155 JSValue * mathProtoFuncFloor(ExecState* exec, JSObject*, JSValue*, const ArgList& args)155 JSValuePtr mathProtoFuncFloor(ExecState* exec, JSObject*, JSValuePtr, const ArgList& args) 156 156 { 157 157 return jsNumber(exec, floor(args.at(exec, 0)->toNumber(exec))); 158 158 } 159 159 160 JSValue * mathProtoFuncLog(ExecState* exec, JSObject*, JSValue*, const ArgList& args)160 JSValuePtr mathProtoFuncLog(ExecState* exec, JSObject*, JSValuePtr, const ArgList& args) 161 161 { 162 162 return jsNumber(exec, log(args.at(exec, 0)->toNumber(exec))); 163 163 } 164 164 165 JSValue * mathProtoFuncMax(ExecState* exec, JSObject*, JSValue*, const ArgList& args)165 JSValuePtr mathProtoFuncMax(ExecState* exec, JSObject*, JSValuePtr, const ArgList& args) 166 166 { 167 167 unsigned argsCount = args.size(); … … 179 179 } 180 180 181 JSValue * mathProtoFuncMin(ExecState* exec, JSObject*, JSValue*, const ArgList& args)181 JSValuePtr mathProtoFuncMin(ExecState* exec, JSObject*, JSValuePtr, const ArgList& args) 182 182 { 183 183 unsigned argsCount = args.size(); … … 195 195 } 196 196 197 JSValue * mathProtoFuncPow(ExecState* exec, JSObject*, JSValue*, const ArgList& args)197 JSValuePtr mathProtoFuncPow(ExecState* exec, JSObject*, JSValuePtr, const ArgList& args) 198 198 { 199 199 // ECMA 15.8.2.1.13 … … 209 209 } 210 210 211 JSValue * mathProtoFuncRandom(ExecState* exec, JSObject*, JSValue*, const ArgList&)211 JSValuePtr mathProtoFuncRandom(ExecState* exec, JSObject*, JSValuePtr, const ArgList&) 212 212 { 213 213 #if !ENABLE(JSC_MULTIPLE_THREADS) … … 222 222 } 223 223 224 JSValue * mathProtoFuncRound(ExecState* exec, JSObject*, JSValue*, const ArgList& args)224 JSValuePtr mathProtoFuncRound(ExecState* exec, JSObject*, JSValuePtr, const ArgList& args) 225 225 { 226 226 double arg = args.at(exec, 0)->toNumber(exec); … … 230 230 } 231 231 232 JSValue * mathProtoFuncSin(ExecState* exec, JSObject*, JSValue*, const ArgList& args)232 JSValuePtr mathProtoFuncSin(ExecState* exec, JSObject*, JSValuePtr, const ArgList& args) 233 233 { 234 234 return jsNumber(exec, sin(args.at(exec, 0)->toNumber(exec))); 235 235 } 236 236 237 JSValue * mathProtoFuncSqrt(ExecState* exec, JSObject*, JSValue*, const ArgList& args)237 JSValuePtr mathProtoFuncSqrt(ExecState* exec, JSObject*, JSValuePtr, const ArgList& args) 238 238 { 239 239 return jsNumber(exec, sqrt(args.at(exec, 0)->toNumber(exec))); 240 240 } 241 241 242 JSValue * mathProtoFuncTan(ExecState* exec, JSObject*, JSValue*, const ArgList& args)242 JSValuePtr mathProtoFuncTan(ExecState* exec, JSObject*, JSValuePtr, const ArgList& args) 243 243 { 244 244 return jsNumber(exec, tan(args.at(exec, 0)->toNumber(exec)));
Note:
See TracChangeset
for help on using the changeset viewer.