[starvation][whole-program] gate analysis of constructors

Summary: In whole-program mode, analysing a method requires analysing first all constructors of the same class.  This is not needed in normal mode, so gate that computation under `starvation_whole_program` for efficiency.

Reviewed By: artempyanykh

Differential Revision: D19393412

fbshipit-source-id: 2277e6b5e
master
Nikos Gorogiannis 5 years ago committed by Facebook Github Bot
parent 4322701ecf
commit c5a8f2e454

@ -329,21 +329,23 @@ let set_constructor_attributes tenv procname (astate : Domain.t) =
let set_initial_attributes tenv procname astate = let set_initial_attributes tenv procname astate =
match procname with if not Config.starvation_whole_program then astate
| Procname.Java java_pname when Procname.Java.is_class_initializer java_pname -> else
(* we are analyzing the class initializer, don't go through on-demand again *) match procname with
astate | Procname.Java java_pname when Procname.Java.is_class_initializer java_pname ->
| Procname.Java java_pname when Procname.Java.(is_constructor java_pname || is_static java_pname) (* we are analyzing the class initializer, don't go through on-demand again *)
-> astate
(* analyzing a constructor or static method, so we need the attributes established by the | Procname.Java java_pname
class initializer *) when Procname.Java.(is_constructor java_pname || is_static java_pname) ->
set_class_init_attributes procname astate (* analyzing a constructor or static method, so we need the attributes established by the
| Procname.Java _ -> class initializer *)
(* we are analyzing an instance method, so we need constructor-established attributes set_class_init_attributes procname astate
which will include those by the class initializer *) | Procname.Java _ ->
set_constructor_attributes tenv procname astate (* we are analyzing an instance method, so we need constructor-established attributes
| _ -> which will include those by the class initializer *)
astate set_constructor_attributes tenv procname astate
| _ ->
astate
let analyze_procedure {Callbacks.exe_env; summary} = let analyze_procedure {Callbacks.exe_env; summary} =

Loading…
Cancel
Save