add: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Experimental/IO/printf.rb
File: printf.rb
===================================================================
--- [no source file]
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Experimental/IO/printf.rb;Interpret1
@@ -1,0 +1,15 @@
+$a = []
+class << $stdout
+  def write *args
+    $a << args
+  end
+end
+
+alias $stdout $foo
+printf("%d %d", 1, 2)
+
+class << STDOUT
+  remove_method :write
+end
+
+p $a
\ No newline at end of file
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/IronRuby.Tests/Driver.cs;C475621
File: Driver.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/IronRuby.Tests/Driver.cs;C475621  (server)    6/26/2008 3:28 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/IronRuby.Tests/Driver.cs;Interpret1
@@ -63,7 +63,7 @@
             _executionContext = IronRuby.GetExecutionContext(_engine);
             _engine.Options.InterpretedMode = _driver.InterpretedMode;
             ((RubyEngineOptions)_engine.Options).ShowWarnings = true;
-            _engine.Options.InterpretedMode = true;
+            _engine.Options.InterpretedMode = driver.Interpret;
         }
     }
 
@@ -79,6 +79,7 @@
         private static bool _runTokenizerDriver;
         private static bool _displayList;
         private static bool _partialTrust;
+        private static bool _interpret;
 
         public TestRuntime TestRuntime {
             get { return _testRuntime; }
@@ -100,10 +101,15 @@
             get { return _partialTrust; }
         }
 
+        public bool Interpret {
+            get { return _interpret; }
+        }
+
         private static bool ParseArguments(List<string>/*!*/ args) {
             if (args.Contains("/help") || args.Contains("-?") || args.Contains("/?") || args.Contains("-help")) {
                 Console.WriteLine("Run All Tests      : [-X:Interpret]");
                 Console.WriteLine("Partial trust      : /partial");
+                Console.WriteLine("Interpret          : /interpret");
                 Console.WriteLine("Run Specific Tests : [/debug] [/exclude] [test_to_run ...]");
                 Console.WriteLine("List Tests         : /list");
                 Console.WriteLine("Tokenizer baseline : /tokenizer <target-dir> <sources-file>");
@@ -130,6 +136,11 @@
                 _partialTrust = true;
             }
 
+            if (args.Contains("/interpret")) {
+                args.Remove("/interpret");
+                _interpret = true;
+            }
+
             if (args.Contains("/exclude")) {
                 _excludeSelectedCases = true;
                 args.Remove("/exclude");
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/ExceptionTests.cs;C468100
File: ExceptionTests.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/ExceptionTests.cs;C468100  (server)    6/26/2008 2:49 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/ExceptionTests.cs;Interpret1
@@ -156,6 +156,11 @@
         }
 
         public void Scenario_RubyExceptions7() {
+            // TODO: fix stack traces in interpreter
+            if (Engine.Options.InterpretedMode) {
+                return;
+            }
+
             AssertOutput(delegate() {
                 CompilerTest(@"
 def foo
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyClass.cs;C472854
File: RubyClass.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyClass.cs;C472854  (server)    6/26/2008 1:25 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyClass.cs;Interpret1
@@ -306,7 +306,7 @@
                     CallArguments callArgs = new CallArguments(args, rule.Parameters, (OldCallAction)action);
 
                     // check for reference-equality to this RubyClass instance and its version:
-                    rule.AddTest(Ast.Equal(callArgs.Expressions[0], Ast.RuntimeConstant(this)));
+                    rule.AddTest(Ast.Equal(callArgs.Expressions[0], Ast.Constant(this)));
                     AddFullVersionTest(rule);
 
                     SetRuleForCreateInstance(rule, callerContext.LanguageContext.Binder, callArgs, true);
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyMethod.cs;C468100
File: RubyMethod.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyMethod.cs;C468100  (server)    6/26/2008 1:25 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyMethod.cs;Interpret1
@@ -73,10 +73,10 @@
             Debug.Assert(args.Values[0] == this);
 
             // first argument must be this method:
-            rule.Test = Ast.Equal(args.Expressions[0], Ast.RuntimeConstant(this));
+            rule.Test = Ast.Equal(args.Expressions[0], Ast.Constant(this));
 
             // set the target (becomes self in the called method):
-            args.Expressions[0] = Ast.RuntimeConstant(_target);
+            args.Expressions[0] = Ast.Constant(_target);
 
             _info.SetInvocationRule(SymbolTable.IdToString(_name), binder, callerContext, rule, args);
 
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyModule.cs;C472854
File: RubyModule.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyModule.cs;C472854  (server)    6/26/2008 1:25 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyModule.cs;Interpret1
@@ -815,8 +815,8 @@
             EnsureInitialized(); // Initialization changes the version number, so ensure that the module is initialized
             rule.AddTest(AstFactory.OpCall("CheckVersionAndRuntime",
                 rule.Context,
-                Ast.RuntimeConstant(_executionContext.Context),
-                Ast.RuntimeConstant(this),
+                Ast.Constant(_executionContext.Context),
+                Ast.Constant(this),
                 Ast.Constant(_version)
             ));
         }
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/Ast/AstFactory.cs;C468100
File: AstFactory.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/Ast/AstFactory.cs;C468100  (server)    6/26/2008 1:25 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/Ast/AstFactory.cs;Interpret1
@@ -162,7 +162,7 @@
                 inlineDelegateCall = false;
             }
 
-            MSA.Expression instanceForCall = (method.Target == null) ? null : Ast.RuntimeConstant(method.Target);
+            MSA.Expression instanceForCall = (method.Target == null) ? null : Ast.Constant(method.Target);
 
             ParameterInfo[] parameters = method.Method.GetParameters();
             if (parameters.Length > 0) {
@@ -202,7 +202,7 @@
             } else {
                 // Invoke the delegate object
                 MethodInfo invokeMethod = method.GetType().GetMethod("Invoke");
-                return ComplexCallHelperInternal(Ast.RuntimeConstant(method), invokeMethod, invokeMethod.GetParameters(), hasParamArray, arguments);
+                return ComplexCallHelperInternal(Ast.Constant(method), invokeMethod, invokeMethod.GetParameters(), hasParamArray, arguments);
             }
         }
 
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/Loader.cs;C474221
File: Loader.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/Loader.cs;C474221  (server)    6/26/2008 1:53 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/Loader.cs;Interpret1
@@ -28,8 +28,6 @@
 using Ruby.Compiler;
 using Ruby.Runtime.Calls;
 
-using Microsoft.Scripting.Interpretation;
-
 namespace Ruby.Runtime {
     [Flags]
     public enum LoadFlags {
@@ -347,7 +345,7 @@
             CompiledFile compiledFile;
             if (TryGetCompiledFile(fullPath, out compiledFile)) {
                 Debug.WriteLine(String.Format("{0}: {1}", ++_cacheHitCount, sourceUnit.Path), "LOAD CACHED");
-                RunCode(compiledFile.CompiledCode, scope);
+                compiledFile.CompiledCode.Run(scope.GlobalScope);
             } else {
                 Debug.WriteLine(String.Format("{0}: {1}", ++_compiledFileCount, sourceUnit.Path), "LOAD COMPILED");
 
@@ -365,24 +363,12 @@
             }
         }
 
-        private static object RunCode(ScriptCode/*!*/ code, RubyScope/*!*/ scope) {
-            return code.Run(scope.GlobalScope);
-        }
-
-        private static object InterpretCode(ScriptCode/*!*/ code, RubyScope/*!*/ scope) {
-            return Interpreter.TopLevelExecute(code.Code, scope.GlobalScope, scope.ExecutionContext.Context);
-        }
-
         internal object CompileAndRun(RubyScope/*!*/ scope, ScriptCode/*!*/ code, bool tryEvaluate) {
-            if (tryEvaluate) {
-                return InterpretCode(code, scope);
-            }
-
             _totalILGenerationTime.Start();
             code.EnsureCompiled();
             _totalILGenerationTime.Stop();
 
-            return RunCode(code, scope);
+            return code.Run(scope.GlobalScope);
         }
 
         private ResolvedFile FindFile(CodeContext/*!*/ context, string/*!*/ path, bool appendExtensions) {
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyContext.cs;C474221
File: RubyContext.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyContext.cs;C474221  (server)    6/26/2008 1:40 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyContext.cs;Interpret1
@@ -31,6 +31,7 @@
 using Ruby.Compiler;
 using Ruby.Compiler.Ast;
 using Ruby.Runtime.Calls;
+using Microsoft.Scripting.Interpretation;
 
 namespace Ruby.Runtime {
 
@@ -114,7 +115,11 @@
                 return null;
             }
 
-            return new ScriptCode(lambda, sourceUnit);
+            if (Options.InterpretedMode) {
+                return new InterpretedScriptCode(lambda, sourceUnit);
+            } else {
+                return new ScriptCode(lambda, sourceUnit);
+            }
         }
 
         internal LambdaExpression ParseSourceCode(SourceUnit/*!*/ sourceUnit, CompilerOptions/*!*/ options, ErrorSink/*!*/ errorSink) {
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/Calls/RubyBinder.cs;C475430
File: RubyBinder.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/Calls/RubyBinder.cs;C475430  (server)    6/26/2008 1:25 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/Calls/RubyBinder.cs;Interpret1
@@ -103,8 +103,8 @@
 
             rule.AddTest(Ast.Comma(
                 AstFactory.OpCall("IsSuperCallTarget", rule.Context,
-                    Ast.RuntimeConstant(currentDeclaringModule),
-                    Ast.RuntimeConstant(currentMethodName)
+                    Ast.Constant(currentDeclaringModule),
+                    Ast.Constant(currentMethodName)
                 )
             ));
 
@@ -201,7 +201,7 @@
                 rule.AddTest(
                     Ast.Equal(
                         Ast.Convert(targetParameter, typeof(object)),
-                        Ast.Convert(Ast.RuntimeConstant(target), typeof(object))
+                        Ast.Convert(Ast.Constant(target), typeof(object))
                     )
                 );
 
@@ -334,7 +334,7 @@
                 typeIs = Ast.TypeIs(expr, toType);
             } else {
                 typeIs = Ast.Call(
-                    Ast.ConvertHelper(Ast.RuntimeConstant(toType), typeof(Type)),
+                    Ast.ConvertHelper(Ast.Constant(toType), typeof(Type)),
                     typeof(Type).GetMethod("IsInstanceOfType"),
                     Ast.ConvertHelper(expr, typeof(object))
                 );
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/Calls/RubyEventInfo.cs;C468100
File: RubyEventInfo.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/Calls/RubyEventInfo.cs;C468100  (server)    6/26/2008 1:25 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/Calls/RubyEventInfo.cs;Interpret1
@@ -45,7 +45,7 @@
                     Ast.Call(
                         typeof(RubyOps).GetMethod("HookupEvent"),
                         rule.Context,
-                        Ast.Convert(Ast.RuntimeConstant(_eventInfo), typeof(EventInfo)),
+                        Ast.Convert(Ast.Constant(_eventInfo), typeof(EventInfo)),
                         args.Expressions[0],
                         Ast.Convert(args.Expressions[blockIndex], typeof(Proc))
                     )
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/Calls/RubyLambdaMethodInfo.cs;C468100
File: RubyLambdaMethodInfo.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/Calls/RubyLambdaMethodInfo.cs;C468100  (server)    6/26/2008 1:25 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/Calls/RubyLambdaMethodInfo.cs;Interpret1
@@ -48,9 +48,9 @@
             CallArguments yieldArgs = args.RemoveAt(0);
 
             _lambda.SetProcCallRule(rule, binder, callerContext,
-                Ast.RuntimeConstant(_lambda),            // proc object
+                Ast.Constant(_lambda),            // proc object
                 args.Expressions[0],                     // self
-                Ast.RuntimeConstant(this),               // this method for super and class_eval
+                Ast.Constant(this),               // this method for super and class_eval
                 yieldArgs                                // user args
             );
         }
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Tests/common.rb;C477882
File: common.rb
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Tests/common.rb;C477882  (server)    6/26/2008 4:20 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Tests/common.rb;Interpret1
@@ -118,9 +118,9 @@
         attr_reader :mode
         
         @@mode_mapping = {
-            1 => "-D -X:SaveAssemblies",
-            2 => "-D -X:LightweightScopes",
-            3 => "-D -X:Interpret",
+            1 => "-D -X:Interpret",
+            2 => "-D",
+            3 => "-D -X:SaveAssemblies",
         }
         
         def initialize(mode, name, redirect_error=true, append_to_log=true)
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Tests/run.rb;C390406
File: run.rb
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Tests/run.rb;C390406  (server)    6/26/2008 3:35 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Tests/run.rb;Interpret1
@@ -8,6 +8,7 @@
 CURR_DIRECTORY = Dir.pwd.downcase
 
 require File.join(THIS_DIRECTORY, 'common')
+require 'benchmark'
 
 $failures = 0
 
@@ -74,25 +75,34 @@
 #   -coreclr
 
 # drivers
-applicable_drivers = [ Test::CRuby, Test::Iron_m1, Test::Iron_m2 ]
-applicable_drivers = [ Test::CRuby, Test::Iron_m1, Test::Iron_m2, Test::Iron_cc, ] if ARGV.include? "-all"
+applicable_drivers = [ Test::CRuby, Test::Iron_m1 ]
+applicable_drivers = [ Test::CRuby, Test::Iron_m1, Test::Iron_m2, Test::Iron_m3, Test::Iron_cc, ] if ARGV.include? "-all"
 applicable_drivers = [ Test::Iron_cc ]  if ARGV.include? "-coreclr"
-applicable_drivers = [ Test::Iron_m1 ]  if ARGV.include? "-fast"
-applicable_drivers = [ Test::CRuby, Test::Iron_m2 ]  if ARGV.include? "-checkin"
+applicable_drivers = [ Test::Iron_m1 ]  if ARGV.include? "-interpret"
+applicable_drivers = [ Test::Iron_m2 ]  if ARGV.include? "-compile"
+applicable_drivers = [ Test::Iron_m3 ]  if ARGV.include? "-verify"
 
 test_files = TestListFile::load 
 
+bms = []
 applicable_drivers.each do |driver|
-    puts ">>> Running under #{driver}  \n"
-    puts "    log @ #{driver.logger} \n"
-    if ARGV.include? "-neg"
-        test_files.each { |tf| tf.run_skipped_by(driver) }
-    else
-        test_files.each { |tf| tf.run_by(driver) }
-    end
-    puts "\n\n"
+	bms << Benchmark.measure(driver.to_s) do
+		puts "#{driver}"
+		puts "    log @ #{driver.logger} \n"
+	    
+		if ARGV.include? "-neg"
+			test_files.each { |tf| tf.run_skipped_by(driver) }
+		else
+			test_files.each { |tf| tf.run_by(driver) }
+		end
+		puts "\n\n"
+   end		
 end
 
+bms.each { |t|
+  puts t.format("%n\n%10.6r\n")
+}
+
 if applicable_drivers.include? Test::Iron_m2 and not ARGV.include? "-fast"
     [
         'syntax',
===================================================================
