MCPcopy Create free account
hub / github.com/VKCOM/kphp / generate_body_of_virtual_method

Function generate_body_of_virtual_method

compiler/pipes/generate-virtual-methods.cpp:402–440  ·  view source on GitHub ↗

* generated AST for virtual methods will be like this: * * function virtual_function($param1, ...) { * switch ($this->get_virt_hash()) { * case 0xDEADBEAF: { // hash of Derived1 * $tmp = instance_cast ($this); * $tmp->virtual_function($param1, ...); * break; * } * case 0x02280228: { // hash of Derived2 * $tmp = instance_cast ($this); * $tmp-

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 1

on_finishMethod · 0.85

Calls 14

sortFunction · 0.85
has_instance_methodMethod · 0.80
is_abstractMethod · 0.45
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected