mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
chore: remove prevent_v8_code_cache
from CliModuleLoaderInner
(#25566)
This commit is contained in:
parent
1463a4ad58
commit
5e0b2aa473
2 changed files with 0 additions and 41 deletions
13
cli/cache/code_cache.rs
vendored
13
cli/cache/code_cache.rs
vendored
|
@ -80,10 +80,6 @@ impl CodeCache {
|
||||||
data,
|
data,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn remove_code_cache(&self, specifier: &str) {
|
|
||||||
Self::ensure_ok(self.inner.remove_code_cache(specifier))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl code_cache::CodeCache for CodeCache {
|
impl code_cache::CodeCache for CodeCache {
|
||||||
|
@ -162,15 +158,6 @@ impl CodeCacheInner {
|
||||||
self.conn.execute(sql, params)?;
|
self.conn.execute(sql, params)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn remove_code_cache(&self, specifier: &str) -> Result<(), AnyError> {
|
|
||||||
let sql = "
|
|
||||||
DELETE FROM codecache
|
|
||||||
WHERE specifier=$1;";
|
|
||||||
let params = params![specifier];
|
|
||||||
self.conn.execute(sql, params)?;
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn serialize_code_cache_type(
|
fn serialize_code_cache_type(
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
use std::collections::HashSet;
|
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::pin::Pin;
|
use std::pin::Pin;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
|
@ -44,7 +43,6 @@ use deno_core::error::generic_error;
|
||||||
use deno_core::error::AnyError;
|
use deno_core::error::AnyError;
|
||||||
use deno_core::futures::future::FutureExt;
|
use deno_core::futures::future::FutureExt;
|
||||||
use deno_core::futures::Future;
|
use deno_core::futures::Future;
|
||||||
use deno_core::parking_lot::Mutex;
|
|
||||||
use deno_core::resolve_url;
|
use deno_core::resolve_url;
|
||||||
use deno_core::ModuleCodeString;
|
use deno_core::ModuleCodeString;
|
||||||
use deno_core::ModuleLoader;
|
use deno_core::ModuleLoader;
|
||||||
|
@ -244,7 +242,6 @@ impl CliModuleLoaderFactory {
|
||||||
emitter: self.shared.emitter.clone(),
|
emitter: self.shared.emitter.clone(),
|
||||||
parsed_source_cache: self.shared.parsed_source_cache.clone(),
|
parsed_source_cache: self.shared.parsed_source_cache.clone(),
|
||||||
shared: self.shared.clone(),
|
shared: self.shared.clone(),
|
||||||
prevent_v8_code_cache: Default::default(),
|
|
||||||
})));
|
})));
|
||||||
ModuleLoaderAndSourceMapGetter {
|
ModuleLoaderAndSourceMapGetter {
|
||||||
module_loader: loader,
|
module_loader: loader,
|
||||||
|
@ -296,10 +293,6 @@ struct CliModuleLoaderInner<TGraphContainer: ModuleGraphContainer> {
|
||||||
emitter: Arc<Emitter>,
|
emitter: Arc<Emitter>,
|
||||||
parsed_source_cache: Arc<ParsedSourceCache>,
|
parsed_source_cache: Arc<ParsedSourceCache>,
|
||||||
graph_container: TGraphContainer,
|
graph_container: TGraphContainer,
|
||||||
// NOTE(bartlomieju): this is temporary, for deprecated import assertions.
|
|
||||||
// Should be removed in Deno 2.
|
|
||||||
// Modules stored here should not be V8 code-cached.
|
|
||||||
prevent_v8_code_cache: Arc<Mutex<HashSet<String>>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<TGraphContainer: ModuleGraphContainer>
|
impl<TGraphContainer: ModuleGraphContainer>
|
||||||
|
@ -785,14 +778,6 @@ impl<TGraphContainer: ModuleGraphContainer> ModuleLoader
|
||||||
code_cache: &[u8],
|
code_cache: &[u8],
|
||||||
) -> Pin<Box<dyn Future<Output = ()>>> {
|
) -> Pin<Box<dyn Future<Output = ()>>> {
|
||||||
if let Some(cache) = self.0.shared.code_cache.as_ref() {
|
if let Some(cache) = self.0.shared.code_cache.as_ref() {
|
||||||
if self
|
|
||||||
.0
|
|
||||||
.prevent_v8_code_cache
|
|
||||||
.lock()
|
|
||||||
.contains(specifier.as_str())
|
|
||||||
{
|
|
||||||
return std::future::ready(()).boxed_local();
|
|
||||||
}
|
|
||||||
// This log line is also used by tests.
|
// This log line is also used by tests.
|
||||||
log::debug!(
|
log::debug!(
|
||||||
"Updating V8 code cache for ES module: {specifier}, [{source_hash:?}]"
|
"Updating V8 code cache for ES module: {specifier}, [{source_hash:?}]"
|
||||||
|
@ -807,19 +792,6 @@ impl<TGraphContainer: ModuleGraphContainer> ModuleLoader
|
||||||
std::future::ready(()).boxed_local()
|
std::future::ready(()).boxed_local()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn purge_and_prevent_code_cache(&self, specifier: &str) {
|
|
||||||
if let Some(cache) = self.0.shared.code_cache.as_ref() {
|
|
||||||
// This log line is also used by tests.
|
|
||||||
log::debug!("Remove V8 code cache for ES module: {specifier}");
|
|
||||||
cache.remove_code_cache(specifier);
|
|
||||||
self
|
|
||||||
.0
|
|
||||||
.prevent_v8_code_cache
|
|
||||||
.lock()
|
|
||||||
.insert(specifier.to_string());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn get_source_map(&self, file_name: &str) -> Option<Vec<u8>> {
|
fn get_source_map(&self, file_name: &str) -> Option<Vec<u8>> {
|
||||||
let specifier = resolve_url(file_name).ok()?;
|
let specifier = resolve_url(file_name).ok()?;
|
||||||
match specifier.scheme() {
|
match specifier.scheme() {
|
||||||
|
|
Loading…
Reference in a new issue