From fc16648088759e460854cd70760f3037a8be2854 Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Mon, 25 Nov 2024 11:35:32 -0500 Subject: [PATCH] remove autogates for compile cache --- src/workerd/jsg/BUILD.bazel | 1 - src/workerd/jsg/modules.c++ | 16 ++++++---------- src/workerd/jsg/resource-test.c++ | 2 -- src/workerd/util/autogate.c++ | 2 -- src/workerd/util/autogate.h | 1 - 5 files changed, 6 insertions(+), 16 deletions(-) diff --git a/src/workerd/jsg/BUILD.bazel b/src/workerd/jsg/BUILD.bazel index c3660a0e309..d713c28bd75 100644 --- a/src/workerd/jsg/BUILD.bazel +++ b/src/workerd/jsg/BUILD.bazel @@ -62,7 +62,6 @@ wd_cc_library( ":observer", ":url", "//src/workerd/util", - "//src/workerd/util:autogate", "//src/workerd/util:sentry", "//src/workerd/util:thread-scopes", "//src/workerd/util:uuid", diff --git a/src/workerd/jsg/modules.c++ b/src/workerd/jsg/modules.c++ index 55a26362b55..63905a1567c 100644 --- a/src/workerd/jsg/modules.c++ +++ b/src/workerd/jsg/modules.c++ @@ -6,8 +6,6 @@ #include "jsg.h" #include "setup.h" -#include - #include #include @@ -395,14 +393,12 @@ v8::Local compileEsmModule(jsg::Lock& js, contentStr = jsg::v8Str(js.v8Isolate, content); } - if (util::Autogate::isEnabled(util::AutogateKey::COMPILE_CACHE_FOR_BUILTINS)) { - if (compileCache.size() > 0 && compileCache.begin() != nullptr) { - auto cached = std::make_unique( - compileCache.begin(), compileCache.size()); - v8::ScriptCompiler::Source source(contentStr, origin, cached.release()); - return jsg::check(v8::ScriptCompiler::CompileModule( - js.v8Isolate, &source, v8::ScriptCompiler::kConsumeCodeCache)); - } + if (compileCache.size() > 0 && compileCache.begin() != nullptr) { + auto cached = + std::make_unique(compileCache.begin(), compileCache.size()); + v8::ScriptCompiler::Source source(contentStr, origin, cached.release()); + return jsg::check(v8::ScriptCompiler::CompileModule( + js.v8Isolate, &source, v8::ScriptCompiler::kConsumeCodeCache)); } v8::ScriptCompiler::Source source(contentStr, origin); diff --git a/src/workerd/jsg/resource-test.c++ b/src/workerd/jsg/resource-test.c++ index 499883d38a1..7293041367c 100644 --- a/src/workerd/jsg/resource-test.c++ +++ b/src/workerd/jsg/resource-test.c++ @@ -5,7 +5,6 @@ #include "jsg-test.h" #include -#include namespace workerd::jsg::test { namespace { @@ -591,7 +590,6 @@ struct JsBundleContext: public ContextGlobalObject { JSG_DECLARE_ISOLATE_TYPE(JsBundleIsolate, JsBundleContext); KJ_TEST("expectEvalModule function works") { - util::Autogate::initAutogate({}); Evaluator e( v8System); e.expectEvalModule("export function run() { return 123; }", "number", "123"); diff --git a/src/workerd/util/autogate.c++ b/src/workerd/util/autogate.c++ index 0371cc3a26a..79376ebbf1b 100644 --- a/src/workerd/util/autogate.c++ +++ b/src/workerd/util/autogate.c++ @@ -17,8 +17,6 @@ kj::StringPtr KJ_STRINGIFY(AutogateKey key) { switch (key) { case AutogateKey::TEST_WORKERD: return "test-workerd"_kj; - case AutogateKey::COMPILE_CACHE_FOR_BUILTINS: - return "compile-cache-for-builtins"_kj; case AutogateKey::NumOfKeys: KJ_FAIL_ASSERT("NumOfKeys should not be used in getName"); } diff --git a/src/workerd/util/autogate.h b/src/workerd/util/autogate.h index a9c77ee5fba..e6e1cf97b46 100644 --- a/src/workerd/util/autogate.h +++ b/src/workerd/util/autogate.h @@ -14,7 +14,6 @@ namespace workerd::util { // Workerd-specific list of autogate keys (can also be used in internal repo). enum class AutogateKey { TEST_WORKERD, - COMPILE_CACHE_FOR_BUILTINS, NumOfKeys // Reserved for iteration. };