mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 23:28:20 +00:00
ZAM optimizations for record creation
includes reworking of managing "auxiliary" information for ZAM instructions
This commit is contained in:
parent
9f94360cfc
commit
91cab9931d
8 changed files with 341 additions and 207 deletions
|
@ -30,10 +30,12 @@ using TableValPtr = IntrusivePtr<TableVal>;
|
|||
|
||||
namespace detail {
|
||||
|
||||
class Attributes;
|
||||
class CompositeHash;
|
||||
class Expr;
|
||||
class ListExpr;
|
||||
class Attributes;
|
||||
class ZAMCompiler;
|
||||
|
||||
using ListExprPtr = IntrusivePtr<ListExpr>;
|
||||
|
||||
// The following tracks how to initialize a given record field.
|
||||
|
@ -734,7 +736,7 @@ private:
|
|||
// Field initializations that can be deferred to first access,
|
||||
// beneficial for fields that are separately initialized prior
|
||||
// to first access. Nil pointers mean "skip initializing the field".
|
||||
std::vector<std::unique_ptr<detail::FieldInit>> deferred_inits;
|
||||
std::vector<std::shared_ptr<detail::FieldInit>> deferred_inits;
|
||||
|
||||
// Field initializations that need to be done upon record creation,
|
||||
// rather than deferred. These are expressions whose value might
|
||||
|
@ -742,10 +744,11 @@ private:
|
|||
//
|
||||
// Such initializations are uncommon, so we represent them using
|
||||
// <fieldoffset, init> pairs.
|
||||
std::vector<std::pair<int, std::unique_ptr<detail::FieldInit>>> creation_inits;
|
||||
std::vector<std::pair<int, std::shared_ptr<detail::FieldInit>>> creation_inits;
|
||||
|
||||
class CreationInitsOptimizer;
|
||||
friend zeek::RecordVal;
|
||||
friend zeek::detail::ZAMCompiler;
|
||||
const auto& DeferredInits() const { return deferred_inits; }
|
||||
const auto& CreationInits() const { return creation_inits; }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue