From bb3a69ebb34e6f97a237530cf5fe2b863dc772fd Mon Sep 17 00:00:00 2001 From: Vern Paxson Date: Thu, 25 Mar 2021 16:16:34 -0700 Subject: [PATCH] track whether a given function/body should be included/skipped for optimization --- src/script_opt/ScriptOpt.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/script_opt/ScriptOpt.h b/src/script_opt/ScriptOpt.h index 242f9d987a..bee7f93f4c 100644 --- a/src/script_opt/ScriptOpt.h +++ b/src/script_opt/ScriptOpt.h @@ -75,6 +75,13 @@ public: void SetProfile(std::shared_ptr _pf); void SetSaveFile(std::string _sf) { save_file = std::move(_sf); } + // The following provide a way of marking FuncInfo's as + // should-be-skipped for script optimization, generally because + // the function body has a property that a given script optimizer + // doesn't know how to deal with. Defaults to don't-skip. + bool ShouldSkip() const { return skip; } + void SetSkip(bool should_skip) { skip = should_skip; } + protected: ScriptFuncPtr func; ScopePtr scope; @@ -84,6 +91,9 @@ protected: // If we're saving this function in a file, this is the name // of the file to use. std::string save_file; + + // Whether to skip optimizing this function. + bool skip = false; };