| 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 | 116 |
| 117 v8::Local<v8::Value> throwStackOverflowExceptionIfNeeded(v8::Isolate* isolate) | 117 v8::Local<v8::Value> throwStackOverflowExceptionIfNeeded(v8::Isolate* isolate) |
| 118 { | 118 { |
| 119 if (V8PerIsolateData::from(isolate)->isHandlingRecursionLevelError()) { | 119 if (V8PerIsolateData::from(isolate)->isHandlingRecursionLevelError()) { |
| 120 // If we are already handling a recursion level error, we should | 120 // If we are already handling a recursion level error, we should |
| 121 // not invoke v8::Function::Call. | 121 // not invoke v8::Function::Call. |
| 122 return v8::Undefined(isolate); | 122 return v8::Undefined(isolate); |
| 123 } | 123 } |
| 124 v8::MicrotasksScope microtasksScope(isolate, v8::MicrotasksScope::kDoNotRunM
icrotasks); | 124 v8::MicrotasksScope microtasksScope(isolate, v8::MicrotasksScope::kDoNotRunM
icrotasks); |
| 125 V8PerIsolateData::from(isolate)->setIsHandlingRecursionLevelError(true); | 125 V8PerIsolateData::from(isolate)->setIsHandlingRecursionLevelError(true); |
| 126 v8::Local<v8::Value> result = v8::Function::New(isolate->GetCurrentContext()
, throwStackOverflowException, v8::Local<v8::Value>(), 0, v8::ConstructorBehavio
r::kThrow).ToLocalChecked()->Call(v8::Undefined(isolate), 0, 0); | 126 v8::Local<v8::Value> result = v8::Function::New(isolate, throwStackOverflowE
xception)->Call(v8::Undefined(isolate), 0, 0); |
| 127 V8PerIsolateData::from(isolate)->setIsHandlingRecursionLevelError(false); | 127 V8PerIsolateData::from(isolate)->setIsHandlingRecursionLevelError(false); |
| 128 return result; | 128 return result; |
| 129 } | 129 } |
| 130 | 130 |
| 131 // Compile a script without any caching or compile options. | 131 // Compile a script without any caching or compile options. |
| 132 v8::MaybeLocal<v8::Script> compileWithoutOptions(V8CompileHistogram::Cacheabilit
y cacheability, v8::Isolate* isolate, v8::Local<v8::String> code, v8::ScriptOrig
in origin) | 132 v8::MaybeLocal<v8::Script> compileWithoutOptions(V8CompileHistogram::Cacheabilit
y cacheability, v8::Isolate* isolate, v8::Local<v8::String> code, v8::ScriptOrig
in origin) |
| 133 { | 133 { |
| 134 V8CompileHistogram histogramScope(cacheability); | 134 V8CompileHistogram histogramScope(cacheability); |
| 135 v8::ScriptCompiler::Source source(code, origin); | 135 v8::ScriptCompiler::Source source(code, origin); |
| 136 return v8::ScriptCompiler::Compile(isolate->GetCurrentContext(), &source, v8
::ScriptCompiler::kNoCompileOptions); | 136 return v8::ScriptCompiler::Compile(isolate->GetCurrentContext(), &source, v8
::ScriptCompiler::kNoCompileOptions); |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 // Store a timestamp to the cache as hint. | 576 // Store a timestamp to the cache as hint. |
| 577 void V8ScriptRunner::setCacheTimeStamp(CachedMetadataHandler* cacheHandler) | 577 void V8ScriptRunner::setCacheTimeStamp(CachedMetadataHandler* cacheHandler) |
| 578 { | 578 { |
| 579 double now = WTF::currentTime(); | 579 double now = WTF::currentTime(); |
| 580 unsigned tag = cacheTag(CacheTagTimeStamp, cacheHandler); | 580 unsigned tag = cacheTag(CacheTagTimeStamp, cacheHandler); |
| 581 cacheHandler->clearCachedMetadata(CachedMetadataHandler::CacheLocally); | 581 cacheHandler->clearCachedMetadata(CachedMetadataHandler::CacheLocally); |
| 582 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); |
| 583 } | 583 } |
| 584 | 584 |
| 585 } // namespace blink | 585 } // namespace blink |
| OLD | NEW |