Changeset 44870 in webkit for trunk/JavaScriptCore
- Timestamp:
- Jun 19, 2009, 1:57:33 PM (16 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r44868 r44870 1 009-06-19 Zoltan Horvath <[email protected]> 1 2009-06-19 Adam Treat <[email protected]> 2 3 Reviewed by Oliver Hunt. 4 5 https://bugs.webkit.org/show_bug.cgi?id=26540 6 Modify the test shell to add a new function 'checkSyntax' that will 7 only parse the source instead of executing it. In this way we can test 8 pure parsing performance against some of the larger scripts in the wild. 9 10 * jsc.cpp: 11 (GlobalObject::GlobalObject): 12 (functionCheckSyntax): 13 14 2009-06-19 Zoltan Horvath <[email protected]> 2 15 3 16 Reviewed by Darin Adler. -
trunk/JavaScriptCore/jsc.cpp
r44766 r44870 76 76 static JSValue JSC_HOST_CALL functionRun(ExecState*, JSObject*, JSValue, const ArgList&); 77 77 static JSValue JSC_HOST_CALL functionLoad(ExecState*, JSObject*, JSValue, const ArgList&); 78 static JSValue JSC_HOST_CALL functionCheckSyntax(ExecState*, JSObject*, JSValue, const ArgList&); 78 79 static JSValue JSC_HOST_CALL functionReadline(ExecState*, JSObject*, JSValue, const ArgList&); 79 80 static NO_RETURN JSValue JSC_HOST_CALL functionQuit(ExecState*, JSObject*, JSValue, const ArgList&); … … 185 186 putDirectFunction(globalExec(), new (globalExec()) NativeFunctionWrapper(globalExec(), prototypeFunctionStructure(), 1, Identifier(globalExec(), "run"), functionRun)); 186 187 putDirectFunction(globalExec(), new (globalExec()) NativeFunctionWrapper(globalExec(), prototypeFunctionStructure(), 1, Identifier(globalExec(), "load"), functionLoad)); 188 putDirectFunction(globalExec(), new (globalExec()) NativeFunctionWrapper(globalExec(), prototypeFunctionStructure(), 1, Identifier(globalExec(), "checkSyntax"), functionCheckSyntax)); 187 189 putDirectFunction(globalExec(), new (globalExec()) NativeFunctionWrapper(globalExec(), prototypeFunctionStructure(), 0, Identifier(globalExec(), "readline"), functionReadline)); 188 190 … … 260 262 JSGlobalObject* globalObject = exec->lexicalGlobalObject(); 261 263 Completion result = evaluate(globalObject->globalExec(), globalObject->globalScopeChain(), makeSource(script.data(), fileName)); 264 if (result.complType() == Throw) 265 exec->setException(result.value()); 266 return result.value(); 267 } 268 269 JSValue JSC_HOST_CALL functionCheckSyntax(ExecState* exec, JSObject* o, JSValue v, const ArgList& args) 270 { 271 UNUSED_PARAM(o); 272 UNUSED_PARAM(v); 273 UString fileName = args.at(0).toString(exec); 274 Vector<char> script; 275 if (!fillBufferWithContentsOfFile(fileName, script)) 276 return throwError(exec, GeneralError, "Could not open file."); 277 278 JSGlobalObject* globalObject = exec->lexicalGlobalObject(); 279 Completion result = checkSyntax(globalObject->globalExec(), makeSource(script.data(), fileName)); 262 280 if (result.complType() == Throw) 263 281 exec->setException(result.value());
Note:
See TracChangeset
for help on using the changeset viewer.