| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 v8::Local<v8::Value> V8ScriptRunner::runCompiledScript(v8::Isolate* isolate, v8:
:Handle<v8::Script> script, ExecutionContext* context) | 382 v8::Local<v8::Value> V8ScriptRunner::runCompiledScript(v8::Isolate* isolate, v8:
:Handle<v8::Script> script, ExecutionContext* context) |
| 383 { | 383 { |
| 384 if (script.IsEmpty()) | 384 if (script.IsEmpty()) |
| 385 return v8::Local<v8::Value>(); | 385 return v8::Local<v8::Value>(); |
| 386 TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution"); | 386 TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution"); |
| 387 TRACE_EVENT1("v8", "v8.run", "fileName", TRACE_STR_COPY(*v8::String::Utf8Val
ue(script->GetUnboundScript()->GetScriptName()))); | 387 TRACE_EVENT1("v8", "v8.run", "fileName", TRACE_STR_COPY(*v8::String::Utf8Val
ue(script->GetUnboundScript()->GetScriptName()))); |
| 388 | 388 |
| 389 if (V8RecursionScope::recursionLevel(isolate) >= kMaxRecursionDepth) | 389 if (V8RecursionScope::recursionLevel(isolate) >= kMaxRecursionDepth) |
| 390 return throwStackOverflowExceptionIfNeeded(isolate); | 390 return throwStackOverflowExceptionIfNeeded(isolate); |
| 391 | 391 |
| 392 RELEASE_ASSERT(!context->isIteratingOverObservers()); |
| 393 |
| 392 // Run the script and keep track of the current recursion depth. | 394 // Run the script and keep track of the current recursion depth. |
| 393 v8::Local<v8::Value> result; | 395 v8::Local<v8::Value> result; |
| 394 { | 396 { |
| 395 if (ScriptForbiddenScope::isScriptForbidden()) | 397 if (ScriptForbiddenScope::isScriptForbidden()) |
| 396 return v8::Local<v8::Value>(); | 398 return v8::Local<v8::Value>(); |
| 397 V8RecursionScope recursionScope(isolate); | 399 V8RecursionScope recursionScope(isolate); |
| 398 result = script->Run(); | 400 result = script->Run(); |
| 399 } | 401 } |
| 400 | 402 |
| 401 if (result.IsEmpty()) | 403 if (result.IsEmpty()) |
| (...skipping 28 matching lines...) Expand all Loading... |
| 430 } | 432 } |
| 431 | 433 |
| 432 v8::Local<v8::Value> V8ScriptRunner::callFunction(v8::Handle<v8::Function> funct
ion, ExecutionContext* context, v8::Handle<v8::Value> receiver, int argc, v8::Ha
ndle<v8::Value> args[], v8::Isolate* isolate) | 434 v8::Local<v8::Value> V8ScriptRunner::callFunction(v8::Handle<v8::Function> funct
ion, ExecutionContext* context, v8::Handle<v8::Value> receiver, int argc, v8::Ha
ndle<v8::Value> args[], v8::Isolate* isolate) |
| 433 { | 435 { |
| 434 TRACE_EVENT0("v8", "v8.callFunction"); | 436 TRACE_EVENT0("v8", "v8.callFunction"); |
| 435 TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution"); | 437 TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution"); |
| 436 | 438 |
| 437 if (V8RecursionScope::recursionLevel(isolate) >= kMaxRecursionDepth) | 439 if (V8RecursionScope::recursionLevel(isolate) >= kMaxRecursionDepth) |
| 438 return throwStackOverflowExceptionIfNeeded(isolate); | 440 return throwStackOverflowExceptionIfNeeded(isolate); |
| 439 | 441 |
| 442 RELEASE_ASSERT(!context->isIteratingOverObservers()); |
| 443 |
| 440 if (ScriptForbiddenScope::isScriptForbidden()) | 444 if (ScriptForbiddenScope::isScriptForbidden()) |
| 441 return v8::Local<v8::Value>(); | 445 return v8::Local<v8::Value>(); |
| 442 V8RecursionScope recursionScope(isolate); | 446 V8RecursionScope recursionScope(isolate); |
| 443 v8::Local<v8::Value> result = function->Call(receiver, argc, args); | 447 v8::Local<v8::Value> result = function->Call(receiver, argc, args); |
| 444 crashIfV8IsDead(); | 448 crashIfV8IsDead(); |
| 445 return result; | 449 return result; |
| 446 } | 450 } |
| 447 | 451 |
| 448 v8::Local<v8::Value> V8ScriptRunner::callInternalFunction(v8::Handle<v8::Functio
n> function, v8::Handle<v8::Value> receiver, int argc, v8::Handle<v8::Value> arg
s[], v8::Isolate* isolate) | 452 v8::Local<v8::Value> V8ScriptRunner::callInternalFunction(v8::Handle<v8::Functio
n> function, v8::Handle<v8::Value> receiver, int argc, v8::Handle<v8::Value> arg
s[], v8::Isolate* isolate) |
| 449 { | 453 { |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 { | 508 { |
| 505 return cacheTag(CacheTagParser, resource); | 509 return cacheTag(CacheTagParser, resource); |
| 506 } | 510 } |
| 507 | 511 |
| 508 unsigned V8ScriptRunner::tagForCodeCache(Resource* resource) | 512 unsigned V8ScriptRunner::tagForCodeCache(Resource* resource) |
| 509 { | 513 { |
| 510 return cacheTag(CacheTagCode, resource); | 514 return cacheTag(CacheTagCode, resource); |
| 511 } | 515 } |
| 512 | 516 |
| 513 } // namespace blink | 517 } // namespace blink |
| OLD | NEW |