| 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 | |
| 394 // Run the script and keep track of the current recursion depth. | 392 // Run the script and keep track of the current recursion depth. |
| 395 v8::Local<v8::Value> result; | 393 v8::Local<v8::Value> result; |
| 396 { | 394 { |
| 397 if (ScriptForbiddenScope::isScriptForbidden()) | 395 if (ScriptForbiddenScope::isScriptForbidden()) |
| 398 return v8::Local<v8::Value>(); | 396 return v8::Local<v8::Value>(); |
| 399 V8RecursionScope recursionScope(isolate); | 397 V8RecursionScope recursionScope(isolate); |
| 400 result = script->Run(); | 398 result = script->Run(); |
| 401 } | 399 } |
| 402 | 400 |
| 403 if (result.IsEmpty()) | 401 if (result.IsEmpty()) |
| (...skipping 28 matching lines...) Expand all Loading... |
| 432 } | 430 } |
| 433 | 431 |
| 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) | 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) |
| 435 { | 433 { |
| 436 TRACE_EVENT0("v8", "v8.callFunction"); | 434 TRACE_EVENT0("v8", "v8.callFunction"); |
| 437 TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution"); | 435 TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution"); |
| 438 | 436 |
| 439 if (V8RecursionScope::recursionLevel(isolate) >= kMaxRecursionDepth) | 437 if (V8RecursionScope::recursionLevel(isolate) >= kMaxRecursionDepth) |
| 440 return throwStackOverflowExceptionIfNeeded(isolate); | 438 return throwStackOverflowExceptionIfNeeded(isolate); |
| 441 | 439 |
| 442 RELEASE_ASSERT(!context->isIteratingOverObservers()); | |
| 443 | |
| 444 if (ScriptForbiddenScope::isScriptForbidden()) | 440 if (ScriptForbiddenScope::isScriptForbidden()) |
| 445 return v8::Local<v8::Value>(); | 441 return v8::Local<v8::Value>(); |
| 446 V8RecursionScope recursionScope(isolate); | 442 V8RecursionScope recursionScope(isolate); |
| 447 v8::Local<v8::Value> result = function->Call(receiver, argc, args); | 443 v8::Local<v8::Value> result = function->Call(receiver, argc, args); |
| 448 crashIfV8IsDead(); | 444 crashIfV8IsDead(); |
| 449 return result; | 445 return result; |
| 450 } | 446 } |
| 451 | 447 |
| 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) | 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) |
| 453 { | 449 { |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 { | 504 { |
| 509 return cacheTag(CacheTagParser, resource); | 505 return cacheTag(CacheTagParser, resource); |
| 510 } | 506 } |
| 511 | 507 |
| 512 unsigned V8ScriptRunner::tagForCodeCache(Resource* resource) | 508 unsigned V8ScriptRunner::tagForCodeCache(Resource* resource) |
| 513 { | 509 { |
| 514 return cacheTag(CacheTagCode, resource); | 510 return cacheTag(CacheTagCode, resource); |
| 515 } | 511 } |
| 516 | 512 |
| 517 } // namespace blink | 513 } // namespace blink |
| OLD | NEW |