Skip to content

Commit

Permalink
kill is_inaccessible
Browse files Browse the repository at this point in the history
Summary: No references in www anymore, was slated for execution a long time ago

Reviewed By: jano

Differential Revision: D62553181

fbshipit-source-id: 7274a1d69f92404b3e82bab9e3b0f3eb396f3687
  • Loading branch information
Max Trivedi authored and facebook-github-bot committed Sep 17, 2024
1 parent ff8ccbc commit d87f330
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 26 deletions.
9 changes: 0 additions & 9 deletions hphp/runtime/ext/hh/ext_implicit_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<ImplicitContext>(obj);
return context->m_memoKey == kAgnosticMemoKey;
}

String HHVM_FUNCTION(get_state_unsafe) {
assertx(*ImplicitContext::activeCtx);
auto const obj = *ImplicitContext::activeCtx;
Expand Down Expand Up @@ -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,
Expand Down
9 changes: 0 additions & 9 deletions hphp/runtime/ext/hh/ext_implicit_context.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 0 additions & 4 deletions hphp/test/slow/implicit-context/ic-has-key.php
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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();
}
Expand Down
4 changes: 0 additions & 4 deletions hphp/test/slow/implicit-context/ic-has-key.php.expect
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit d87f330

Please sign in to comment.