Skip to content
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

Update Truffle to 1.0.0-rc5 #266

Merged
merged 36 commits into from Sep 3, 2018

Conversation

2 participants
@smarr
Copy link
Owner

commented Aug 30, 2018

This is an update to Truffle >1.0.0-rc5.

@daumayr @clementbera I'd appreciate if you could take a look.
Because of the huge number of changes, I don't really expect a complete review, but would be good if you'd be aware in which areas changes happened, and whether it may effect your work.

It took me quite a while to update SOMns, because some of our patches to Truffle needed
major revisions or reimplementation to account for some new features in Truffle.

Good news is that there are now fewer patches needed:

  • we can now use Node.notifyInserted(.) to announce new or changed tags
  • we can now use InstrumentableNode.hasTag(.) to query for tags (only necessary in tools)
  • the new polyglot Context doesn't do strict thread checks anymore, we don't need to hack around it anymore.

Some patches required a reimplementation, or were newly required:

  • we use tags for advance breakpoints, for instance on thread creation, on joining a fork join task, or sending an actor message: smarr/truffle@d448d9c
  • we use a stepping strategy to step until the next node with a given tag.
    This is very useful when I can't statically determine the target of a specific
    stepping operation, but I know that it has to be of a specific kind.
    We use this for instance to trigger a breakpoint when an async. message/callback
    is starting to execute, or just before a method returns that is going to be
    used to resolve a promise. Highly useful to step through async. code.
    smarr/truffle@7689d6f
  • much of this depends on being able to set breakpoints precisely.
    So, we also needed support for that. Currently, Truffle tries to find a
    best match, perhaps based on column and line, which isn't precise enough for
    my use case:
    smarr/truffle@3c68e3d

Other Update-related Changes

Adopting @GenerateWrapper

Truffle switched to a new approach for wrapper nodes for instrumentation.
They are now created by @GenerateWrapper and whether something is instrumentable is determined via an interface.
Beside rewriting our custom Truffle patches, the change that required most work was likely
going from @Instrumentable to @GenerateWrapper.
Details: 7c21cda

To make this work nicely, I had to change a couple of things around.
One problem with the notion of wrappers is that it is rather complicated to
ensure that they always have the right type.
The type is constrained on the one side by the field containing the child node,
and on the other side, by the node that is actually wrapped.
So, there is a tension between having few very general wrappers, and the
specifics one might want to use in some node.
It requires quite a bit of care to have a more specific field type for the
child node and make everything work out correctly.

Truffle Interop

The language interop support is something I haven't invested much time in yet.
So, the fact that Truffle's old interop testing infrastructure is gone is somewhat
unfortunate, because this means interop support is now untested.
There is only a WIP commit: 8c41970

GraalVM Launcher

To account for the new Context and GraalVM changes, I adopted a GraalSDK style launcher, but it's very basic: d338791

Work In Progress/Needs More Work

  • CPU Sampler doesn't have any output, while the old profiler had a histogram: 8a589d8
  • Truffle Interop TCK needs work to be supported: 8c41970

@smarr smarr added the enhancement label Aug 30, 2018

@smarr smarr added this to the v0.7.0 milestone Aug 30, 2018

@smarr smarr added this to Open Issues in Completeness via automation Aug 30, 2018

Repository owner deleted a comment from codacy-bot Aug 31, 2018

Repository owner deleted a comment from codacy-bot Aug 31, 2018

Repository owner deleted a comment from codacy-bot Aug 31, 2018

Repository owner deleted a comment from codacy-bot Aug 31, 2018

Repository owner deleted a comment from codacy-bot Aug 31, 2018

Repository owner deleted a comment from codacy-bot Aug 31, 2018

Repository owner deleted a comment from codacy-bot Aug 31, 2018

Repository owner deleted a comment from codacy-bot Aug 31, 2018

Repository owner deleted a comment from codacy-bot Aug 31, 2018

Repository owner deleted a comment from codacy-bot Aug 31, 2018

@smarr smarr force-pushed the update-truffle-wip branch from dd7c175 to 989540c Aug 31, 2018

Repository owner deleted a comment from codacy-bot Aug 31, 2018

Repository owner deleted a comment from codacy-bot Aug 31, 2018

Repository owner deleted a comment from codacy-bot Aug 31, 2018

Repository owner deleted a comment from codacy-bot Aug 31, 2018

Repository owner deleted a comment from codacy-bot Aug 31, 2018

@smarr smarr force-pushed the update-truffle-wip branch from 989540c to f8eff54 Aug 31, 2018

Repository owner deleted a comment from codacy-bot Aug 31, 2018

Repository owner deleted a comment from codacy-bot Aug 31, 2018

Repository owner deleted a comment from codacy-bot Aug 31, 2018

Repository owner deleted a comment from codacy-bot Aug 31, 2018

Repository owner deleted a comment from codacy-bot Aug 31, 2018

@smarr smarr force-pushed the update-truffle-wip branch from f8eff54 to 4ae23b7 Sep 1, 2018

Repository owner deleted a comment from codacy-bot Sep 1, 2018

Repository owner deleted a comment from codacy-bot Sep 1, 2018

Repository owner deleted a comment from codacy-bot Sep 1, 2018

Repository owner deleted a comment from codacy-bot Sep 1, 2018

smarr added some commits Aug 11, 2018

Make sure DummyParent has language when needed
- also add helper to access this of node in Truffle’s guard DSL

Signed-off-by: Stefan Marr <git@stefan-marr.de>
Updated expected dym results
Signed-off-by: Stefan Marr <git@stefan-marr.de>
Update superinstructions, all ? gone, not sure why
Didn’t investigate further, but this might indicate an issue.

Signed-off-by: Stefan Marr <git@stefan-marr.de>
Need to configure debugger with our tags
Signed-off-by: Stefan Marr <git@stefan-marr.de>
ResolvePromiseNode has a HaltPrim, needs to be wrapped
Signed-off-by: Stefan Marr <git@stefan-marr.de>
Comment out @SuppressWarnings("deprecation") because of javac bug
Signed-off-by: Stefan Marr <git@stefan-marr.de>
Replaced removed Profiler with CPUSampler
Signed-off-by: Stefan Marr <git@stefan-marr.de>
Adopt new Source builder
- this requires us to work a little more to get a proper path
  otherwise, we have an URI with a `file:` prefix.

- added factory method for source to SomLanguage

- added asserts in TypeGrammarParserTest as documentation

Signed-off-by: Stefan Marr <git@stefan-marr.de>
Adopt find() methods on instruments
Signed-off-by: Stefan Marr <git@stefan-marr.de>
Restructure VM startup to account for Truffle changes
The PolyglotEngine is so, we switch to Graal SDK.

- introduce Launcher, which is the new entry point for the execution
- START source is now in Launcher
- VM object is now created by createContext, we get access to the Context later on from inside the execution. So this should work, I hope.
- do shutdown() in disposeContext()
- Use SDK Option framework, currently only to support basic interpreter tests
  - for convenience allow testSelector to be empty string. Otherwise, the OptionsKey would need a custom implementation

- restructure shutdown/exit, simply return exit code
- don’t need support for avoidExitForTesting anymore

- adapted tests to new launcher
  - this requires some reflection to get to the real value for our tests
  - make sure Context is initialized for parallel BasicInterpreterTests
    - the context initialization is not thread safe.
      Not sure it should be.
      Use similar approach to Launcher.START to simply initialize the context but do nothing else.

- moved initialization of tools into context creation
  We need it earlier, because we are missing instrumentation on the standard library otherwise.

Signed-off-by: Stefan Marr <git@stefan-marr.de>
Remove TruffleSomTCK, because TruffleTCK is gone
It is replaced with the Polyglot TCK: https://github.com/oracle/graal/blob/master/truffle/docs/TCK.md

Signed-off-by: Stefan Marr <git@stefan-marr.de>
[WIP] Add support for Polyglot TCK
This is work in progress, a LanguageProvider is a first step.

I think, the best way forward would be to allow parsing of top-level blocks.

Signed-off-by: Stefan Marr <git@stefan-marr.de>
Use Env instead of engine where possible
- this is more directly, and preferable over the access of the static context to get the engine

Signed-off-by: Stefan Marr <git@stefan-marr.de>
Update CoverallsTruffle for latest Truffle
Signed-off-by: Stefan Marr <git@stefan-marr.de>
Remember how we did debugging of javac
Signed-off-by: Stefan Marr <git@stefan-marr.de>
[WIP] Don’t have any histogram or anything for the truffle profiler yet
Signed-off-by: Stefan Marr <git@stefan-marr.de>
Update CI settings
- update Travis JDK versions and setup
- set JAVA_HOME for GitLab CI

Signed-off-by: Stefan Marr <git@stefan-marr.de>
Update codespeed.conf for ReBench 1.0
Signed-off-by: Stefan Marr <git@stefan-marr.de>
For debugging: Mark unused field in Parser
Signed-off-by: Stefan Marr <git@stefan-marr.de>
Deprecations: Change slot.getKind to access via descriptor
This change needs to be revised later when we address issue #240.
We assume here that slots belong to one descriptor.

Signed-off-by: Stefan Marr <git@stefan-marr.de>
Removed unused som.actorTracingCfg handling
This was a leftover from an earlier incomplete change.

Signed-off-by: Stefan Marr <git@stefan-marr.de>
Ignore deprecations of GraphPrintVisitor for now
There is no replacement, let’s keep using it as long as possible.

Signed-off-by: Stefan Marr <git@stefan-marr.de>

@smarr smarr force-pushed the update-truffle-wip branch from 23f8611 to b1e6781 Sep 2, 2018

Repository owner deleted a comment from codacy-bot Sep 2, 2018

// add a space so that lexer stops lexing
String testString = content + " ";
TypeParser tp = createParser(testString);
tp.parseType();
assertTrue("Should reach here, and parse without error", true);

This comment has been minimized.

@smarr smarr merged commit 5cbe0c7 into dev Sep 3, 2018

1 of 4 checks passed

continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details
Codacy/PR Quality Review Not up to standards. This pull request quality could be better.
Details
continuous-integration/travis-ci/push The Travis CI build failed
Details
coverage/coveralls First build on update-truffle-wip at 76.621%
Details

Completeness automation moved this from Open Issues to Completed Sep 3, 2018

@smarr

This comment has been minimized.

Copy link
Owner Author

commented Sep 3, 2018

With this being merged, please note that submodules will need to be updated.

@smarr smarr deleted the update-truffle-wip branch Sep 3, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.