Skip to content

Commit

Permalink
Add serialize and size APIs
Browse files Browse the repository at this point in the history
Add APIs to allow assumptions to be serialized and provide their size.
However, enforce that the default implementation is never used.

Signed-off-by: Irwin D'Souza <dsouzai.gh@gmail.com>
  • Loading branch information
dsouzai committed Sep 17, 2020
1 parent 90b975b commit de88e26
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions compiler/runtime/OMRRuntimeAssumptions.hpp
Expand Up @@ -185,6 +185,20 @@ class RuntimeAssumption
virtual void compensate(TR_FrontEnd *vm, bool isSMP, void *data) = 0;
virtual bool equals(RuntimeAssumption &other) = 0;

/**
* @brief Used to serialize an assumption to a buffer
*
* @param cursor Pointer into the buffer where the assumption to be is serialized into
*/
virtual void serialize(uint8_t *cursor) { TR_ASSERT_FATAL(false, "Should not be called\n"); }

/**
* @brief Provides the size of the serialized assumption
*
* @return Returns the size of the serialized assumption
*/
virtual uint32_t size() { TR_ASSERT_FATAL(false, "Should not be called\n"); return 0; }

/*
* These functions are used to determine whether the runtime assumption falls within
* a given range. Both bounds are inclusive.
Expand Down

0 comments on commit de88e26

Please sign in to comment.