Changeset 34135 in webkit for trunk/JavaScriptCore/VM/Machine.cpp
- Timestamp:
- May 26, 2008, 11:50:55 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/VM/Machine.cpp
r34095 r34135 440 440 static NEVER_INLINE JSValue* callEval(ExecState* exec, JSObject* thisObj, ScopeChainNode* scopeChain, RegisterFile* registerFile, Register* r, int argv, int argc, JSValue*& exceptionValue) 441 441 { 442 if (argc < 2) 443 return jsUndefined(); 444 445 JSValue* program = r[argv + 1].u.jsValue; 446 447 if (!program->isString()) 448 return program; 449 442 450 Profiler** profiler = Profiler::enabledProfilerReference(); 443 451 if (*profiler) 444 452 (*profiler)->willExecute(exec, scopeChain->globalObject()->evalFunction()); 445 453 446 JSValue* x = argc >= 2 ? r[argv + 1].u.jsValue : jsUndefined();447 448 if (!x->isString())449 return x;450 451 UString s = x->toString(exec);452 if (exec->hadException()) {453 exceptionValue = exec->exception();454 exec->clearException();455 return 0;456 }457 458 454 int sourceId; 459 455 int errLine; 460 456 UString errMsg; 461 RefPtr<EvalNode> evalNode = parser().parse<EvalNode>(exec, UString(), 0, UStringSourceProvider::create(s ), &sourceId, &errLine, &errMsg);457 RefPtr<EvalNode> evalNode = parser().parse<EvalNode>(exec, UString(), 0, UStringSourceProvider::create(static_cast<StringImp*>(program)->value()), &sourceId, &errLine, &errMsg); 462 458 463 459 if (!evalNode) { 464 460 exceptionValue = Error::create(exec, SyntaxError, errMsg, errLine, sourceId, NULL); 461 if (*profiler) 462 (*profiler)->didExecute(exec, scopeChain->globalObject()->evalFunction()); 465 463 return 0; 466 464 } … … 468 466 JSValue* result = machine().execute(evalNode.get(), exec, thisObj, registerFile, r - (*registerFile->basePointer()) + argv + argc, scopeChain, &exceptionValue); 469 467 470 if ( (*profiler))468 if (*profiler) 471 469 (*profiler)->didExecute(exec, scopeChain->globalObject()->evalFunction()); 472 470 … … 795 793 scopeChain = scopeChain->copy(); 796 794 795 ExecState newExec(exec, this, registerFile, scopeChain, -1); 796 797 797 Profiler** profiler = Profiler::enabledProfilerReference(); 798 798 if (*profiler) 799 799 (*profiler)->willExecute(exec, evalNode->sourceURL(), evalNode->lineNo()); 800 801 ExecState newExec(exec, this, registerFile, scopeChain, -1);802 800 803 801 m_reentryDepth++;
Note:
See TracChangeset
for help on using the changeset viewer.