-
Notifications
You must be signed in to change notification settings - Fork 277
[depends: #1330] Interpreter fixes #1274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know much about this code, but I suppose it's alright if it's taken out directly from develop, and if Travis passes.
FWIW I just added as reviewers all those that have at least one commit in this series. |
I'm looking at the linter failures and will submit a pull request to develop to address those first. |
mp_integer value; | ||
// Initialized is annotated even during reads | ||
// Set to 1 when written-before-read, -1 when read-before-written | ||
mutable char initialized; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably, this should be turned into a three-valued enum.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is now #1289.
src/goto-programs/interpreter.cpp
Outdated
} | ||
|
||
/// retrieves the member at offset | ||
/// \par parameters: an object and a memory offset |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use \param
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
git grep -w '\\par' | wc -l
yields 273 -- I'll start fixing this, but it looks like a somewhat larger documentation cleanup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but I have not much insight in the code of the interpreter
mp_vectort &dest) const | ||
{ | ||
// copy memory region | ||
std::size_t address_val=integer2size_t(address); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could be const
, too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added this to #1289.
|
||
/// reserves memory block of size at address | ||
void interpretert::allocate( | ||
mp_integer address, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const
reference ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added this to #1289.
Happy with the smaller commits (perhaps consider folding the final bugfix commit into the appropriate sparse-vector commit?), the first one is too big to review meaningfully though. It looks like it is itself a big merge -- any chance of finding the original commits that constituted it? |
ef9d2d1
to
6862fc3
Compare
@smowton Thanks a lot for the feedback; are you referring to ac2e5b3 as the big one? @mgudemann would you have any input on where this has come from? |
2bd6781
to
4a11fbd
Compare
to_ulong() will negate a negative number, rather than returning its two's complement representation as an unsigned type as we might reasonably suppose. Instead use to_long() everywhere to preserve the bitwise representation and then use sign-bit filling to make sure the value is correctly re-encoded as mp_integer.
This adds some checks about the operands for mp_arith operations. These are used mainly in the interpreter and the chosen limit is the size of signed/unsigned long long int types.
Sparse vectors represent a 2^64 sized space while allocating only space that is used.
This will allow large address reservations for unbounded-sized objects, with actual cells allocated on demand. Original patch: From: Chris Smowton <chris@smowton.net> Date: Tue, 21 Mar 2017 15:24:03 +0000 Subject: [PATCH 1/3] Interpreter: switch to sparse vector memory map
They get allocated 2^32 address space each (of a 2^64 sized space) using the sparse-vector memory representation to keep the actual storage requirements sensible. Original patch: From: Chris Smowton <chris@smowton.net> Date: Tue, 21 Mar 2017 17:13:43 +0000 Subject: [PATCH 2/3] Add support for unbounded-size objects Corrected linting issues Using empty, and comments on get_size
Fixes a build issue with testgen
This is only used in derivative out-of-repo classes, and therefore should be moved there.
Make "Infinite size arrays not supported" and "Failed to concretize variable array" warnings rather than errors.
This could previously overestimate object sizes, potentially by including all other objects in the address space in the size estimate. That could lead to overly long variable-length arrays, with performance cost though most likely no correctness problems in Java, since all arrays have an explicit length.
Use from_integer, everywhere.
4a11fbd
to
fdbb38e
Compare
Dismissed stale review request |
I believe we are not going ahead with a selective develop->master transition, thus closing. |
None of this is my work - these are commits already merged into develop (test-gen-support).