Skip to content

Commit

Permalink
Delete unused LoadMethodCache counter
Browse files Browse the repository at this point in the history
Summary:
The ones for LoadTypeMethodCache and LoadTypeAttrCache are used, but not this
one.  LoadMethodCache pointers are created in the LIR generator for
LoadMethodCached instructions.

Reviewed By: jbower-fb

Differential Revision: D55765270

fbshipit-source-id: fd7e76d6620d92e96a5e5e6ff2785ad36a3f64ee
  • Loading branch information
Alex Malyshev authored and facebook-github-bot committed Apr 8, 2024
1 parent 49970ce commit 8e6058f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
1 change: 0 additions & 1 deletion cinderx/Jit/hir/builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2197,7 +2197,6 @@ void HIRBuilder::emitLoadMethod(
Environment& env,
const jit::BytecodeInstruction& bc_instr) {
Register* receiver = tc.frame.stack.pop();
env.allocateLoadMethodCache();
Register* result = temps_.AllocateStack();
Register* method_instance = temps_.AllocateStack();
tc.emit<LoadMethodCached>(result, receiver, bc_instr.oparg(), tc.frame);
Expand Down
9 changes: 0 additions & 9 deletions cinderx/Jit/hir/hir.h
Original file line number Diff line number Diff line change
Expand Up @@ -4036,14 +4036,6 @@ class Environment {
return next_load_type_attr_cache_;
}

int allocateLoadMethodCache() {
return next_load_method_cache_++;
}

int numLoadMethodCaches() const {
return next_load_method_cache_;
}

int allocateLoadTypeMethodCache() {
return next_load_type_method_cache_++;
}
Expand All @@ -4059,7 +4051,6 @@ class Environment {
ReferenceSet references_;
int next_register_id_{0};
int next_load_type_attr_cache_{0};
int next_load_method_cache_{0};
int next_load_type_method_cache_{0};
};

Expand Down
3 changes: 2 additions & 1 deletion cinderx/PythonLib/test_cinderx/test_cinderjit.py
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,8 @@ def test():
cinderjit.force_compile(tmp_b.test)
self.assertTrue(cinderjit.is_jit_compiled(tmp_b.test))
self.assertTrue(
"LoadModuleMethodCached" in cinderjit.get_function_hir_opcode_counts(tmp_b.test)
"LoadModuleMethodCached"
in cinderjit.get_function_hir_opcode_counts(tmp_b.test)
)
# prime the cache
self.assertEqual(tmp_b.test(), 3)
Expand Down

0 comments on commit 8e6058f

Please sign in to comment.