Skip to content

[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

Closed
wants to merge 19 commits into from

Conversation

tautschnig
Copy link
Collaborator

None of this is my work - these are commits already merged into develop (test-gen-support).

Copy link
Contributor

@allredj allredj left a 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.

@tautschnig
Copy link
Collaborator Author

FWIW I just added as reviewers all those that have at least one commit in this series.

@tautschnig
Copy link
Collaborator Author

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;
Copy link
Member

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now #1289.

}

/// retrieves the member at offset
/// \par parameters: an object and a memory offset
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use \param

Copy link
Collaborator Author

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.

@tautschnig tautschnig self-assigned this Aug 23, 2017
@tautschnig tautschnig changed the title [develop->master] Interpreter fixes [depends: #1281, develop->master] Interpreter fixes Aug 23, 2017
Copy link
Contributor

@mgudemann mgudemann left a 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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could be const, too

Copy link
Collaborator Author

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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const reference ?

Copy link
Collaborator Author

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.

@smowton
Copy link
Contributor

smowton commented Aug 23, 2017

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?

@tautschnig
Copy link
Collaborator Author

@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?

@tautschnig tautschnig changed the title [depends: #1281, develop->master] Interpreter fixes [depends: #1281, #1290, develop->master] Interpreter fixes Aug 23, 2017
@tautschnig tautschnig changed the title [depends: #1281, #1290, develop->master] Interpreter fixes [depends: #1281, #1289, #1290, develop->master] Interpreter fixes Aug 23, 2017
@tautschnig tautschnig changed the title [depends: #1281, #1289, #1290, develop->master] Interpreter fixes [depends: #1289, #1290, develop->master] Interpreter fixes Sep 1, 2017
@tautschnig tautschnig changed the title [depends: #1289, #1290, develop->master] Interpreter fixes [depends: #1289, develop->master] Interpreter fixes Sep 1, 2017
@tautschnig tautschnig changed the title [depends: #1289, develop->master] Interpreter fixes [depends: #1289] Interpreter fixes Sep 2, 2017
@tautschnig tautschnig changed the title [depends: #1289] Interpreter fixes [depends: #1289,#1330] Interpreter fixes Sep 2, 2017
@tautschnig tautschnig changed the title [depends: #1289,#1330] Interpreter fixes [depends: #1330] Interpreter fixes Sep 3, 2017
@tautschnig tautschnig changed the title [depends: #1330] Interpreter fixes [depends: #1330,#1338] Interpreter fixes Sep 3, 2017
@tautschnig tautschnig changed the title [depends: #1330,#1338] Interpreter fixes [depends: #1330] Interpreter fixes Sep 4, 2017
dcattaruzza and others added 17 commits September 4, 2017 07:53
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.
@smowton smowton removed their request for review October 4, 2017 16:19
@smowton
Copy link
Contributor

smowton commented Oct 4, 2017

Dismissed stale review request

@tautschnig
Copy link
Collaborator Author

I believe we are not going ahead with a selective develop->master transition, thus closing.

@tautschnig tautschnig closed this Feb 23, 2018
@tautschnig tautschnig deleted the interpreter branch February 23, 2018 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants