New bytecode for static method calls with dynamic class name
commite82e7bd1fb0335afcfe45fb597f19fd260b1f9b5
authorArnab De <arnabde@fb.com>
Sat, 16 Apr 2022 04:32:01 +0000 (15 21:32 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Sat, 16 Apr 2022 04:32:01 +0000 (15 21:32 -0700)
treebc1a6c498df26afb57ac40f9c1da239805af2957
parent4d4f974fe1616e15b02e36e4cdba4a568b44033c
New bytecode for static method calls with dynamic class name

Summary: We should raise a warning for static method calls with dynamic class names if the class name is a string. Currently the class is already resolved when we execute a `FCallClsMethod`, therefore it cannot differentiate between a string class name and lazy class class name. Create a new bytecode for static method calls with dynamic class names. This bytecode resolves the class name itself and raises a warning if it is a string and appropriate options are set. If the method name is dynamic, we use the existing `FCallClsMethod` bytecode.

Reviewed By: periodic1236

Differential Revision: D35412118

fbshipit-source-id: 3863bae228dedffcebe79cba452c0f0255c3191b
18 files changed:
hphp/doc/bytecode.specification
hphp/hack/src/hackc/emitter/emit_expression.rs
hphp/hack/src/hackc/emitter/instruction_sequence.rs
hphp/hhbbc/dce.cpp
hphp/hhbbc/interp.cpp
hphp/runtime/vm/bytecode.cpp
hphp/runtime/vm/hhbc.h
hphp/runtime/vm/jit/irgen-call.cpp
hphp/runtime/vm/jit/translator-inl.h
hphp/runtime/vm/jit/translator.cpp
hphp/runtime/vm/opcodes.h
hphp/runtime/vm/super-inlining-bros.cpp
hphp/runtime/vm/verifier/check-func.cpp
hphp/test/quick/dynamic-call-warning.php [new file with mode: 0644]
hphp/test/quick/dynamic-call-warning.php.expectf [new file with mode: 0644]
hphp/test/quick/dynamic-call-warning.php.hphp_opts [new file with mode: 0644]
hphp/test/quick/dynamic-call-warning.php.opts [new file with mode: 0644]
hphp/tools/hhbc-gen/hhbc.rs