Mercurial > hg > graal-compiler
diff graal/com.oracle.truffle.ruby.runtime/src/com/oracle/truffle/ruby/runtime/RubyContext.java @ 13563:fb846424299f
Truffle/Ruby: extend Instrumentation framework with language-agnostic interfaces for access to AST printing utilities and a Ruby implementation
author | Michael Van De Vanter <michael.van.de.vanter@oracle.com> |
---|---|
date | Tue, 07 Jan 2014 18:09:42 -0800 |
parents | 0fbee3eb71f0 |
children | 497fada09efb |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.ruby.runtime/src/com/oracle/truffle/ruby/runtime/RubyContext.java Tue Jan 07 17:52:54 2014 -0800 +++ b/graal/com.oracle.truffle.ruby.runtime/src/com/oracle/truffle/ruby/runtime/RubyContext.java Tue Jan 07 18:09:42 2014 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved. This + * Copyright (c) 2013, 2014 Oracle and/or its affiliates. All rights reserved. This * code is released under a tri EPL/GPL/LGPL license. You can use it, * redistribute it and/or modify it under the terms of the: * @@ -42,6 +42,7 @@ private final AtExitManager atExitManager; private final RubyDebugManager debugManager; private final SourceManager sourceManager; + private final ASTPrinter astPrinter; private AtomicLong nextObjectID = new AtomicLong(0); @@ -50,14 +51,19 @@ private POSIX posix = POSIXFactory.getPOSIX(); public RubyContext(RubyParser parser) { - this(new Configuration(new ConfigurationBuilder()), parser); + this(new Configuration(new ConfigurationBuilder()), parser, null); } public RubyContext(Configuration configuration, RubyParser parser) { + this(configuration, parser, null); + } + + public RubyContext(Configuration configuration, RubyParser parser, ASTPrinter astPrinter) { assert configuration != null; this.configuration = configuration; this.parser = parser; + this.astPrinter = astPrinter; objectSpaceManager = new ObjectSpaceManager(this); traceManager = new TraceManager(this); @@ -91,6 +97,10 @@ return debugManager; } + public ASTPrinter getASTPrinter() { + return astPrinter; + } + public void implementationMessage(String format, Object... arguments) { System.err.println("rubytruffle: " + String.format(format, arguments)); }