From d87f330ce2766640272fd26402c4cc6125b2a3c9 Mon Sep 17 00:00:00 2001 From: Max Trivedi Date: Tue, 17 Sep 2024 14:26:47 -0700 Subject: [PATCH] kill is_inaccessible Summary: No references in www anymore, was slated for execution a long time ago Reviewed By: jano Differential Revision: D62553181 fbshipit-source-id: 7274a1d69f92404b3e82bab9e3b0f3eb396f3687 --- hphp/runtime/ext/hh/ext_implicit_context.cpp | 9 --------- hphp/runtime/ext/hh/ext_implicit_context.php | 9 --------- hphp/test/slow/implicit-context/ic-has-key.php | 4 ---- hphp/test/slow/implicit-context/ic-has-key.php.expect | 4 ---- 4 files changed, 26 deletions(-) diff --git a/hphp/runtime/ext/hh/ext_implicit_context.cpp b/hphp/runtime/ext/hh/ext_implicit_context.cpp index 71726b42686020..fdbac7703bdb82 100644 --- a/hphp/runtime/ext/hh/ext_implicit_context.cpp +++ b/hphp/runtime/ext/hh/ext_implicit_context.cpp @@ -220,13 +220,6 @@ bool HHVM_FUNCTION(has_key, StringArg keyArg) { return context->m_map.find(key) != context->m_map.end(); } -bool HHVM_FUNCTION(is_inaccessible) { - assertx(*ImplicitContext::activeCtx); - auto const obj = *ImplicitContext::activeCtx; - auto const context = Native::data(obj); - return context->m_memoKey == kAgnosticMemoKey; -} - String HHVM_FUNCTION(get_state_unsafe) { assertx(*ImplicitContext::activeCtx); auto const obj = *ImplicitContext::activeCtx; @@ -354,8 +347,6 @@ static struct HHImplicitContext final : Extension { HHVM_FN(create_implicit_context)); HHVM_NAMED_FE(HH\\ImplicitContext\\_Private\\get_implicit_context_memo_key, HHVM_FN(get_implicit_context_memo_key)); - HHVM_NAMED_FE(HH\\ImplicitContext\\is_inaccessible, - HHVM_FN(is_inaccessible)); HHVM_NAMED_FE(HH\\ImplicitContext\\_Private\\has_key, HHVM_FN(has_key)); HHVM_NAMED_FE(HH\\ImplicitContext\\_Private\\get_implicit_context_debug_info, diff --git a/hphp/runtime/ext/hh/ext_implicit_context.php b/hphp/runtime/ext/hh/ext_implicit_context.php index bc6947f910723f..db3f818574be98 100644 --- a/hphp/runtime/ext/hh/ext_implicit_context.php +++ b/hphp/runtime/ext/hh/ext_implicit_context.php @@ -70,15 +70,6 @@ enum State: string as string { <<__Native>> function get_state_unsafe()[zoned]: string /* State */; -/** - * Returns True if we are in the empty IC state - * False otherwise - * - * Does not affect the state of the IC - */ -<<__Native>> -function is_inaccessible()[zoned]: bool; - } // namespace ImplicitContext namespace ImplicitContext\_Private { diff --git a/hphp/test/slow/implicit-context/ic-has-key.php b/hphp/test/slow/implicit-context/ic-has-key.php index b7aae217c039e7..698b114a65da73 100644 --- a/hphp/test/slow/implicit-context/ic-has-key.php +++ b/hphp/test/slow/implicit-context/ic-has-key.php @@ -9,21 +9,18 @@ function print_state(string $s, bool $b)[zoned]: void { function backdoored_fn(): void { echo "in backdoored_fn\n"; print_state('ClassContext::exists', ClassContext::exists()); - print_state('!HH\ImplicitContext\is_inaccessible', !HH\ImplicitContext\is_inaccessible()); } <<__Memoize(#KeyedByIC)>> function memo($a, $b)[zoned]: mixed{ echo "in keyedbyIC memo\n"; print_state('ClassContext::exists', ClassContext::exists()); - print_state('!HH\ImplicitContext\is_inaccessible', !HH\ImplicitContext\is_inaccessible()); } <<__Memoize>> function memo2($a, $b): mixed{ echo "in default memo\n"; print_state('ClassContext::exists', ClassContext::exists()); - print_state('!HH\ImplicitContext\is_inaccessible', !HH\ImplicitContext\is_inaccessible()); } function g()[zoned]: mixed{ @@ -34,7 +31,6 @@ function g()[zoned]: mixed{ function f()[zoned]: mixed{ echo "in zoned...\n"; print_state('ClassContext::exists', ClassContext::exists()); - print_state('!HH\ImplicitContext\is_inaccessible', !HH\ImplicitContext\is_inaccessible()); memo(1, 3); g(); } diff --git a/hphp/test/slow/implicit-context/ic-has-key.php.expect b/hphp/test/slow/implicit-context/ic-has-key.php.expect index e5bc5af8269ce2..4c7437f6b456f1 100644 --- a/hphp/test/slow/implicit-context/ic-has-key.php.expect +++ b/hphp/test/slow/implicit-context/ic-has-key.php.expect @@ -1,12 +1,8 @@ in zoned... ClassContext::exists: True -!HH\ImplicitContext\is_inaccessible: True in keyedbyIC memo ClassContext::exists: True -!HH\ImplicitContext\is_inaccessible: True in backdoored_fn ClassContext::exists: False -!HH\ImplicitContext\is_inaccessible: False in default memo ClassContext::exists: False -!HH\ImplicitContext\is_inaccessible: False