Skip to content

Commit

Permalink
Showing 4 changed files with 98 additions and 55 deletions.
62 changes: 27 additions & 35 deletions core/pom.rb
Original file line number Diff line number Diff line change
@@ -157,53 +157,45 @@
'debug' => 'true',
'verbose' => 'true',
'fork' => 'true',
'compilerArgs' => {
'arg' => '-J-Xmx1G',
'arg' => '-J-Xbootclasspath/p:${unsafe.jar}'
},
'compilerArgs' => { 'arg' => '-J-Xmx1G' },
'showWarnings' => 'true',
'showDeprecation' => 'true',
'source' => [ '${base.java.version}', '1.7' ],
'target' => [ '${base.javac.version}', '1.7' ],
'useIncrementalCompilation' => 'false' ) do
# execute_goals( 'compile',
# :id => 'anno',
# :phase => 'process-resources',
# 'includes' => [ 'org/jruby/anno/FrameField.java',
# 'org/jruby/anno/AnnotationBinder.java',
# 'org/jruby/anno/JRubyMethod.java',
# 'org/jruby/anno/FrameField.java',
# 'org/jruby/CompatVersion.java',
# 'org/jruby/runtime/Visibility.java',
# 'org/jruby/util/CodegenUtils.java',
# 'org/jruby/util/SafePropertyAccessor.java' ] )
# execute_goals( 'compile',
# :id => 'default-compile',
# :phase => 'compile',
# 'annotationProcessors' => [ 'org.jruby.anno.AnnotationBinder' ],
# 'generatedSourcesDirectory' => 'target/generated-sources',
# 'compilerArgs' => [ '-XDignore.symbol.file=true',
# '-J-Duser.language=en',
# '-J-Dfile.encoding=UTF-8',
# '-J-Xbootclasspath/p:${unsafe.jar}',
# '-J-Xmx${jruby.compile.memory}' ] )
# execute_goals( 'compile',
# :id => 'populators',
# :phase => 'process-classes',
# 'compilerArgs' => [ '-XDignore.symbol.file=true',
# '-J-Duser.language=en',
# '-J-Dfile.encoding=UTF-8',
# '-J-Xbootclasspath/p:${unsafe.jar}',
# '-J-Xmx${jruby.compile.memory}' ],
# 'includes' => [ 'org/jruby/gen/**/*.java' ] )
execute_goals( 'compile',
:id => 'eclipse-hack',
:id => 'anno',
:phase => 'process-resources',
'includes' => [ 'org/jruby/anno/FrameField.java',
'org/jruby/anno/AnnotationBinder.java',
'org/jruby/anno/JRubyMethod.java',
'org/jruby/anno/FrameField.java',
'org/jruby/CompatVersion.java',
'org/jruby/runtime/Visibility.java',
'org/jruby/util/CodegenUtils.java',
'org/jruby/util/SafePropertyAccessor.java' ] )
execute_goals( 'compile',
:id => 'default-compile',
:phase => 'compile',
'annotationProcessors' => [ 'org.jruby.anno.AnnotationBinder' ],
'generatedSourcesDirectory' => 'target/generated-sources',
'compilerArgs' => [ '-XDignore.symbol.file=true',
'-J-Duser.language=en',
'-J-Dfile.encoding=UTF-8',
'-J-Xbootclasspath/p:${unsafe.jar}',
'-J-Xmx${jruby.compile.memory}' ] )
execute_goals( 'compile',
:id => 'populators',
:phase => 'process-classes',
'compilerArgs' => [ '-XDignore.symbol.file=true',
'-J-Duser.language=en',
'-J-Dfile.encoding=UTF-8',
'-J-Xbootclasspath/p:${unsafe.jar}',
'-J-Xmx${jruby.compile.memory}' ],
'includes' => [ 'org/jruby/gen/**/*.java' ] )
execute_goals( 'compile',
:id => 'eclipse-hack',
:phase => 'process-classes',
'skipMain' => 'true',
'includes' => [ '**/*.java' ] )
end
55 changes: 53 additions & 2 deletions core/pom.xml
Original file line number Diff line number Diff line change
@@ -398,7 +398,46 @@ DO NOT MODIFIY - GENERATED CODE
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>eclipse-hack</id>
<id>anno</id>
<phase>process-resources</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<includes>
<include>org/jruby/anno/FrameField.java</include>
<include>org/jruby/anno/AnnotationBinder.java</include>
<include>org/jruby/anno/JRubyMethod.java</include>
<include>org/jruby/anno/FrameField.java</include>
<include>org/jruby/CompatVersion.java</include>
<include>org/jruby/runtime/Visibility.java</include>
<include>org/jruby/util/CodegenUtils.java</include>
<include>org/jruby/util/SafePropertyAccessor.java</include>
</includes>
</configuration>
</execution>
<execution>
<id>default-compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<annotationProcessors>
<annotationProcessor>org.jruby.anno.AnnotationBinder</annotationProcessor>
</annotationProcessors>
<generatedSourcesDirectory>target/generated-sources</generatedSourcesDirectory>
<compilerArgs>
<compilerArg>-XDignore.symbol.file=true</compilerArg>
<compilerArg>-J-Duser.language=en</compilerArg>
<compilerArg>-J-Dfile.encoding=UTF-8</compilerArg>
<compilerArg>-J-Xbootclasspath/p:${unsafe.jar}</compilerArg>
<compilerArg>-J-Xmx${jruby.compile.memory}</compilerArg>
</compilerArgs>
</configuration>
</execution>
<execution>
<id>populators</id>
<phase>process-classes</phase>
<goals>
<goal>compile</goal>
@@ -411,6 +450,18 @@ DO NOT MODIFIY - GENERATED CODE
<compilerArg>-J-Xbootclasspath/p:${unsafe.jar}</compilerArg>
<compilerArg>-J-Xmx${jruby.compile.memory}</compilerArg>
</compilerArgs>
<includes>
<include>org/jruby/gen/**/*.java</include>
</includes>
</configuration>
</execution>
<execution>
<id>eclipse-hack</id>
<phase>process-classes</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<skipMain>true</skipMain>
<includes>
<include>**/*.java</include>
@@ -424,7 +475,7 @@ DO NOT MODIFIY - GENERATED CODE
<verbose>true</verbose>
<fork>true</fork>
<compilerArgs>
<arg>-J-Xbootclasspath/p:${unsafe.jar}</arg>
<arg>-J-Xmx1G</arg>
</compilerArgs>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
34 changes: 17 additions & 17 deletions core/src/main/java/org/jruby/RubyModule.java
Original file line number Diff line number Diff line change
@@ -779,7 +779,7 @@ public synchronized void prependModule(IRubyObject arg) {
// Make sure the module we include does not already exist
checkForCyclicInclude(module);

if (hasModuleInHierarchy((RubyModule)arg)) {
if (hasModuleInHierarchy((RubyModule) arg)) {
invalidateCacheDescendants();
return;
}
@@ -965,23 +965,23 @@ public Map<String, List<JavaMethodDescriptor>> getStaticAnnotatedMethods() {
public void defineAnnotatedMethodsIndividually(Class clazz) {
TypePopulator populator;

// if (RubyInstanceConfig.FULL_TRACE_ENABLED || RubyInstanceConfig.REFLECTED_HANDLES) {
// // we want reflected invokers or need full traces, use default (slow) populator
// if (DEBUG) LOG.info("trace mode, using default populator");
if (Options.DEBUG_FULLTRACE.load() || Options.REFLECTED_HANDLES.load() || Options.INVOKEDYNAMIC_HANDLES.load()) {
// we want non-generated invokers or need full traces, use default (slow) populator
if (DEBUG) LOG.info("trace mode, using default populator");
populator = TypePopulator.DEFAULT;
// } else {
// try {
// String qualifiedName = "org.jruby.gen." + clazz.getCanonicalName().replace('.', '$');
//
// if (DEBUG) LOG.info("looking for " + qualifiedName + AnnotationBinder.POPULATOR_SUFFIX);
//
// Class populatorClass = Class.forName(qualifiedName + AnnotationBinder.POPULATOR_SUFFIX);
// populator = (TypePopulator)populatorClass.newInstance();
// } catch (Throwable t) {
// if (DEBUG) LOG.info("Could not find it, using default populator");
// populator = TypePopulator.DEFAULT;
// }
// }
} else {
try {
String qualifiedName = "org.jruby.gen." + clazz.getCanonicalName().replace('.', '$');

if (DEBUG) LOG.info("looking for " + qualifiedName + AnnotationBinder.POPULATOR_SUFFIX);

Class populatorClass = Class.forName(qualifiedName + AnnotationBinder.POPULATOR_SUFFIX);
populator = (TypePopulator)populatorClass.newInstance();
} catch (Throwable t) {
if (DEBUG) LOG.info("Could not find it, using default populator");
populator = TypePopulator.DEFAULT;
}
}

populator.populate(this, clazz);
}
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/util/cli/Options.java
Original file line number Diff line number Diff line change
@@ -100,7 +100,7 @@ public class Options {
public static final Option<Boolean> INVOKEDYNAMIC_CACHE_IVARS = bool(INVOKEDYNAMIC, "invokedynamic.cache.ivars", true, "Use invokedynamic to get/set instance variables.");
public static final Option<Boolean> INVOKEDYNAMIC_CLASS_VALUES = bool(INVOKEDYNAMIC, "invokedynamic.class.values", false, "Use ClassValue to store class-specific data.");
public static final Option<Integer> INVOKEDYNAMIC_GLOBAL_MAXFAIL = integer(INVOKEDYNAMIC, "invokedynamic.global.maxfail", 100, "Maximum global cache failures after which to use slow path.");
public static final Option<Boolean> INVOKEDYNAMIC_HANDLES = bool(INVOKEDYNAMIC, "invokedynamic.handles", true, "Use MethodHandles rather than generated code to bind Ruby methods.");
public static final Option<Boolean> INVOKEDYNAMIC_HANDLES = bool(INVOKEDYNAMIC, "invokedynamic.handles", false, "Use MethodHandles rather than generated code to bind Ruby methods.");

public static final Option<Integer> JIT_THRESHOLD = integer(JIT, "jit.threshold", Constants.JIT_THRESHOLD, "Set the JIT threshold to the specified method invocation count.");
public static final Option<Integer> JIT_MAX = integer(JIT, "jit.max", Constants.JIT_MAX_METHODS_LIMIT, "Set the max count of active methods eligible for JIT-compilation.");

0 comments on commit 6d02ba7

Please sign in to comment.