Changeset 129026 in webkit
- Timestamp:
- Sep 19, 2012 11:52:18 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r129024 r129026 1 2012-09-19 Kentaro Hara <haraken@chromium.org> 2 3 [V8] Remove WorkerContextExecutionProxy::runScript() 4 https://bugs.webkit.org/show_bug.cgi?id=97060 5 6 Reviewed by Adam Barth. 7 8 To kill WorkerContextExecutionProxy, this patch removes 9 WorkerContextExecutionProxy::runScript() by replacing it 10 with ScriptRunner::runCompiledScript(). 11 12 For the replacement, this patch moves TryCatch logic in 13 runCompiledScript() to the caller side. The reason why 14 we have to avoid nesting TryCatches is a V8 bug: 15 http://code.google.com/p/v8/issues/detail?id=2166 16 17 No tests. No change in behavior. 18 19 * bindings/v8/ScriptController.cpp: 20 (WebCore::ScriptController::compileAndRunScript): 21 * bindings/v8/ScriptRunner.cpp: 22 (WebCore::ScriptRunner::runCompiledScript): 23 * bindings/v8/WorkerContextExecutionProxy.cpp: 24 (WebCore::WorkerContextExecutionProxy::evaluate): 25 * bindings/v8/WorkerContextExecutionProxy.h: 26 (WorkerContextExecutionProxy): 27 1 28 2012-09-19 Rob Buis <rbuis@rim.com> 2 29 -
trunk/Source/WebCore/bindings/v8/ScriptController.cpp
r128687 r129026 282 282 RefPtr<Frame> protect(m_frame); 283 283 result = ScriptRunner::runCompiledScript(script, m_frame->document()); 284 ASSERT(!tryCatch.HasCaught() || result.IsEmpty()); 284 285 } 285 286 -
trunk/Source/WebCore/bindings/v8/ScriptRunner.cpp
r126399 r129026 48 48 // Run the script and keep track of the current recursion depth. 49 49 v8::Local<v8::Value> result; 50 v8::TryCatch tryCatch;51 tryCatch.SetVerbose(true);52 50 { 53 51 V8RecursionScope recursionScope(context); … … 57 55 if (handleOutOfMemory()) 58 56 ASSERT(result.IsEmpty()); 59 60 // Handle V8 internal error situation.61 if (tryCatch.HasCaught()) {62 ASSERT(result.IsEmpty());63 return v8::Local<v8::Value>();64 }65 57 66 58 if (result.IsEmpty()) -
trunk/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp
r128390 r129026 39 39 #include "Event.h" 40 40 #include "ScriptCallStack.h" 41 #include "ScriptRunner.h" 41 42 #include "ScriptSourceCode.h" 42 43 #include "SharedWorker.h" … … 224 225 v8::Local<v8::String> scriptString = v8ExternalString(script); 225 226 v8::Handle<v8::Script> compiledScript = ScriptSourceCode::compileScript(scriptString, fileName, scriptStartPosition); 226 v8::Local<v8::Value> result = runScript(compiledScript);227 v8::Local<v8::Value> result = ScriptRunner::runCompiledScript(compiledScript, m_workerContext); 227 228 228 229 if (!exceptionCatcher.CanContinue()) { … … 257 258 } 258 259 259 v8::Local<v8::Value> WorkerContextExecutionProxy::runScript(v8::Handle<v8::Script> script)260 {261 if (script.IsEmpty())262 return v8::Local<v8::Value>();263 264 // Compute the source string and prevent against infinite recursion.265 if (V8RecursionScope::recursionLevel() >= kMaxRecursionDepth) {266 v8::Local<v8::String> code = v8ExternalString("throw RangeError('Recursion too deep')");267 script = ScriptSourceCode::compileScript(code, "", TextPosition::minimumPosition());268 }269 270 if (handleOutOfMemory())271 ASSERT(script.IsEmpty());272 273 if (script.IsEmpty())274 return v8::Local<v8::Value>();275 276 // Run the script and keep track of the current recursion depth.277 v8::Local<v8::Value> result;278 {279 V8RecursionScope recursionScope(m_workerContext);280 result = script->Run();281 }282 283 // Handle V8 internal error situation (Out-of-memory).284 if (result.IsEmpty())285 return v8::Local<v8::Value>();286 287 return result;288 }289 290 260 void WorkerContextExecutionProxy::trackEvent(Event* event) 291 261 { -
trunk/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.h
r128382 r129026 83 83 void dispose(); 84 84 85 // Run an already compiled script.86 v8::Local<v8::Value> runScript(v8::Handle<v8::Script>);87 88 85 static bool forgetV8EventObject(Event*); 89 86
Note: See TracChangeset
for help on using the changeset viewer.