Skip to content

Instantly share code, notes, and snippets.

~/projects/jruby ➔ ast -e "a = 2; a += 1; foo {|a,b| puts a,b}"
RootNode 0
BlockNode 0
NewlineNode 0
LocalAsgnNode:a 0
FixnumNode 0
NewlineNode 0
LocalAsgnNode:a 0
CallOneArgNode:+ 0
~/projects/juby ➔ JAVA_HOME=../davinci/sources/build/bsd-i586/j2sdk-image/ JAVA_OPTS=-XX:+EnableInvokeDynamic CLASSPATH=src jruby -I ../bitescript/lib/ src/compiler.rb -e "puts 1.compareTo 2"
~/projects/juby ➔ ../davinci/sources/build/bsd-i586/j2sdk-image/bin/javap -c dash_eCompiled from "dash_e"
public class dash_e extends java.lang.Object {
public static void main(java.lang.String[]);
Code:
0: ldc2_w #7; //long 1l
3: invokestatic #14; //Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
6: ldc2_w #15; //long 2l
9: invokestatic #14; //Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
require 'rubygems'
require 'bitescript'
require 'jruby'
BiteScript.bytecode_version = BiteScript::JAVA1_7
class org::jruby::ast::ArrayNode
def compile(compiler)
if lightweight?
child_nodes.each {|node| compiler.compile(node)}
~/projects/juby ➔ jruby -I../bitescript/lib src/compiler.rb -e "puts 1"
~/projects/juby ➔ javap -c dash_e
Compiled from dash_e
public class dash_e extends java.lang.Object{
public static void main(java.lang.String[]);
Code:
0: aconst_null
1: ldc2_w #7; //long 1l
4: invokestatic #14; //Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
~/projects/ruby2java ➔ javap -v RubyMain
Compiled from "examples.ruby_main.rb"
public class RubyMain extends org.jruby.RubyObject
SourceFile: "examples/ruby_main.rb"
minor version: 0
major version: 48
Constant pool:
const #1 = Asciz RubyMain;
const #2 = class #1; // RubyMain
const #3 = Asciz org/jruby/RubyObject;
2008 conferences:
RubyConf, RailsConf, RailsConf EU, acts_as_conference, Euruko, Ruby Kaigi, Mountain West RubyConf, eRubyCon, Ruby Hoedown, Amsterdam Ruby en Rails, Scotland on Rails, RubyFools Copenhagen, RubyFools Oslo, Voices that Matter, South Carolina Ruby Conference, Lone Star RubyConf, RuPy, Gotham Ruby Conference, Silicon Valley Ruby Conference, RubyCamp, Conferencia Rails, Rails Summit Latin America, Ruby Manor, Atlanta Merb Day, ...
2008 books:
NetBeans™ Ruby and Rails IDE with JRuby, Learning Rails, Rails for .NET Developers, Wicked Cool Ruby Scripts, JRuby Cookbook, Enterprise Recipes with Ruby and Rails, Developing Facebook Platform Applications with Rails, Foundation Rails 2, Enterprise Rails, Ruby On Rails Bible, Rails: Up and Running, Rails Pocket Reference, Ruby Phrasebook, Scripted GUI Testing with Ruby, Aptana RadRails, Advanced Rails Recipes, Deploying Rails Applications, The Art of Rails, Simply Rails 2, Practical REST on Rails 2 Projects, Ruby on Rails Web Mashup Projects, FXRuby: Cr
diff --git a/indy.patch b/indy.patch
--- a/indy.patch
+++ b/indy.patch
@@ -1338,6 +1338,15 @@
import static sun.dyn.MemberName.newIllegalArgumentException;
import static sun.dyn.MemberName.newNoAccessException;
+@@ -223,7 +226,7 @@
+ MethodHandle bindArgument(Access token,
+ MethodHandle target, int argnum, Object receiver) {
[exec] cc -O2 -fno-omit-frame-pointer -fno-strict-aliasing -DNDEBUG -W -Werror -Wall -Wno-unused -Wno-parentheses -Wundef -I"/Users/headius/projects/jffi/build/jni" -I"/Users/headius/projects/jffi/jni/jffi" -I"/Users/headius/projects/jffi/build/jni/libffi-darwin/include" -I"/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/include" -I"/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/include/darwin" -D_REENTRANT -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -isysroot /Developer/SDKs/MacOSX10.4u.sdk -DTARGET_RT_MAC_CFM=0 -arch i386 -arch x86_64 -arch ppc -c /Users/headius/projects/jffi/jni/jffi/Array.c -o /Users/headius/projects/jffi/build/jni/jffi/Array.o
[exec] In file included from /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/include/jni.h:27,
[exec] from /Users/headius/projects/jffi/jni/jffi/Array.c:23:
[exec] /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/include/jni_md.h:15:5: error: "__LP64__" is not defined
public class WhileNode extends Node {
private final Node conditionNode;
private final Node bodyNode;
private final boolean evaluateAtStart;
public boolean containsNonlocalFlow = false;
public WhileNode(ISourcePosition position, Node conditionNode, Node bodyNode) {
this(position, conditionNode, bodyNode, true);
}
public class InvokeDynamicSupport {
// Subclass of CallSite to hold the "call type" for Ruby purposes
public static class JRubyCallSite extends CallSite {
private final CallType callType;
public JRubyCallSite(Class caller, String name, MethodType type, CallType callType) {
super(caller, name, type);
this.callType = callType;
}