| 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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 std::unique_ptr<CompileFn> compileFn = streamer | 387 std::unique_ptr<CompileFn> compileFn = streamer |
| 388 ? selectCompileFunction(cacheOptions, resource, streamer) | 388 ? selectCompileFunction(cacheOptions, resource, streamer) |
| 389 : selectCompileFunction(cacheOptions, cacheHandler, code, cacheabilityIf
NoHandler); | 389 : selectCompileFunction(cacheOptions, cacheHandler, code, cacheabilityIf
NoHandler); |
| 390 | 390 |
| 391 return (*compileFn)(isolate, code, origin); | 391 return (*compileFn)(isolate, code, origin); |
| 392 } | 392 } |
| 393 | 393 |
| 394 v8::MaybeLocal<v8::Value> V8ScriptRunner::runCompiledScript(v8::Isolate* isolate
, v8::Local<v8::Script> script, ExecutionContext* context) | 394 v8::MaybeLocal<v8::Value> V8ScriptRunner::runCompiledScript(v8::Isolate* isolate
, v8::Local<v8::Script> script, ExecutionContext* context) |
| 395 { | 395 { |
| 396 ASSERT(!script.IsEmpty()); | 396 ASSERT(!script.IsEmpty()); |
| 397 ScopedFrameBlamer frameBlamer(context->isDocument() ? toDocument(context)->f
rame() : nullptr); |
| 397 TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution"); | 398 TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution"); |
| 398 TRACE_EVENT1("v8", "v8.run", "fileName", TRACE_STR_COPY(*v8::String::Utf8Val
ue(script->GetUnboundScript()->GetScriptName()))); | 399 TRACE_EVENT1("v8", "v8.run", "fileName", TRACE_STR_COPY(*v8::String::Utf8Val
ue(script->GetUnboundScript()->GetScriptName()))); |
| 399 | 400 |
| 400 if (v8::MicrotasksScope::GetCurrentDepth(isolate) >= kMaxRecursionDepth) | 401 if (v8::MicrotasksScope::GetCurrentDepth(isolate) >= kMaxRecursionDepth) |
| 401 return throwStackOverflowExceptionIfNeeded(isolate); | 402 return throwStackOverflowExceptionIfNeeded(isolate); |
| 402 | 403 |
| 403 RELEASE_ASSERT(!context->isIteratingOverObservers()); | 404 RELEASE_ASSERT(!context->isIteratingOverObservers()); |
| 404 | 405 |
| 405 // Run the script and keep track of the current recursion depth. | 406 // Run the script and keep track of the current recursion depth. |
| 406 v8::MaybeLocal<v8::Value> result; | 407 v8::MaybeLocal<v8::Value> result; |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 // Store a timestamp to the cache as hint. | 576 // Store a timestamp to the cache as hint. |
| 576 void V8ScriptRunner::setCacheTimeStamp(CachedMetadataHandler* cacheHandler) | 577 void V8ScriptRunner::setCacheTimeStamp(CachedMetadataHandler* cacheHandler) |
| 577 { | 578 { |
| 578 double now = WTF::currentTime(); | 579 double now = WTF::currentTime(); |
| 579 unsigned tag = cacheTag(CacheTagTimeStamp, cacheHandler); | 580 unsigned tag = cacheTag(CacheTagTimeStamp, cacheHandler); |
| 580 cacheHandler->clearCachedMetadata(CachedMetadataHandler::CacheLocally); | 581 cacheHandler->clearCachedMetadata(CachedMetadataHandler::CacheLocally); |
| 581 cacheHandler->setCachedMetadata(tag, reinterpret_cast<char*>(&now), sizeof(n
ow), CachedMetadataHandler::SendToPlatform); | 582 cacheHandler->setCachedMetadata(tag, reinterpret_cast<char*>(&now), sizeof(n
ow), CachedMetadataHandler::SendToPlatform); |
| 582 } | 583 } |
| 583 | 584 |
| 584 } // namespace blink | 585 } // namespace blink |
| OLD | NEW |