Changeset 43216 in webkit for trunk/JavaScriptCore/jsc.cpp
- Timestamp:
- May 5, 2009, 1:58:17 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/jsc.cpp
r43122 r43216 79 79 80 80 #if ENABLE(SAMPLING_FLAGS) 81 static JSValue functionSetSamplingFlag (ExecState*, JSObject*, JSValue, const ArgList&);82 static JSValue functionClearSamplingFlag (ExecState*, JSObject*, JSValue, const ArgList&);81 static JSValue functionSetSamplingFlags(ExecState*, JSObject*, JSValue, const ArgList&); 82 static JSValue functionClearSamplingFlags(ExecState*, JSObject*, JSValue, const ArgList&); 83 83 #endif 84 84 … … 187 187 188 188 #if ENABLE(SAMPLING_FLAGS) 189 putDirectFunction(globalExec(), new (globalExec()) PrototypeFunction(globalExec(), prototypeFunctionStructure(), 1, Identifier(globalExec(), "setSamplingFlag "), functionSetSamplingFlag));190 putDirectFunction(globalExec(), new (globalExec()) PrototypeFunction(globalExec(), prototypeFunctionStructure(), 1, Identifier(globalExec(), "clearSamplingFlag "), functionClearSamplingFlag));189 putDirectFunction(globalExec(), new (globalExec()) PrototypeFunction(globalExec(), prototypeFunctionStructure(), 1, Identifier(globalExec(), "setSamplingFlags"), functionSetSamplingFlags)); 190 putDirectFunction(globalExec(), new (globalExec()) PrototypeFunction(globalExec(), prototypeFunctionStructure(), 1, Identifier(globalExec(), "clearSamplingFlags"), functionClearSamplingFlags)); 191 191 #endif 192 192 … … 263 263 264 264 #if ENABLE(SAMPLING_FLAGS) 265 JSValue functionSetSamplingFlag(ExecState* exec, JSObject*, JSValue, const ArgList& args) 266 { 267 unsigned flag = static_cast<unsigned>(args.at(0).toNumber(exec)); 268 269 // Sanitize the input into the range 1..32. 270 if (flag > 32) 271 flag &= 31; 272 if (!flag) 273 flag = 32; 274 275 SamplingFlags::setFlag(flag); 276 265 JSValue functionSetSamplingFlags(ExecState* exec, JSObject*, JSValue, const ArgList& args) 266 { 267 for (unsigned i = 0; i < args.size(); ++i) { 268 unsigned flag = static_cast<unsigned>(args.at(i).toNumber(exec)); 269 if ((flag >= 1) && (flag <= 32)) 270 SamplingFlags::setFlag(flag); 271 } 277 272 return jsNull(); 278 273 } 279 274 280 JSValue functionClearSamplingFlag(ExecState* exec, JSObject*, JSValue, const ArgList& args) 281 { 282 unsigned flag = static_cast<unsigned>(args.at(0).toNumber(exec)); 283 284 // Sanitize the input into the range 1..32. 285 if (flag > 32) 286 flag &= 31; 287 if (!flag) 288 flag = 32; 289 290 SamplingFlags::clearFlag(flag); 291 275 JSValue functionClearSamplingFlags(ExecState* exec, JSObject*, JSValue, const ArgList& args) 276 { 277 for (unsigned i = 0; i < args.size(); ++i) { 278 unsigned flag = static_cast<unsigned>(args.at(i).toNumber(exec)); 279 if ((flag >= 1) && (flag <= 32)) 280 SamplingFlags::clearFlag(flag); 281 } 292 282 return jsNull(); 293 283 }
Note:
See TracChangeset
for help on using the changeset viewer.