inlining of Zeek script functions

This commit is contained in:
Vern Paxson 2020-11-19 16:05:42 -08:00
parent 3c39f11726
commit c42586af2c
63 changed files with 21807 additions and 171 deletions

View file

@ -98,6 +98,15 @@ public:
Val* GetElement(const ID* id) const
{ return GetElementByID(id).get(); }
/**
* Increases the current offset being used for frame accesses.
* This is in support of inlined functions.
*
* @param incr Amount by which to increase the frame offset.
* Use a negative value to shrink the offset.
*/
void IncreaseOffset(int incr) { current_offset += incr; }
/**
* Resets all of the indexes from [*startIdx, frame_size) in
* the Frame.
@ -316,6 +325,12 @@ private:
/** Associates ID's offsets with values. */
std::unique_ptr<Element[]> frame;
/** The offset we're currently using for references into the frame.
* This is how we support inlined functions without having to
* alter the offsets associated with their local variables.
*/
int current_offset;
/** The enclosing frame of this frame. */
Frame* closure;