Skip to content

Commit

Permalink
Merge branch 'master' into truffle-head
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisseaton committed Dec 16, 2016
2 parents 5a98032 + e926a44 commit a14acdb
Show file tree
Hide file tree
Showing 29 changed files with 408 additions and 377 deletions.
10 changes: 1 addition & 9 deletions core/pom.rb
Expand Up @@ -13,9 +13,6 @@
'tzdata.version' => '2013d',
'tzdata.scope' => 'provided',

'unsafe.version' => '8.92.1',
'unsafe.jar' => '${settings.localRepository}/com/headius/unsafe-mock/${unsafe.version}/unsafe-mock-${unsafe.version}.jar',

'maven.build.timestamp.format' => 'yyyy-MM-dd',
'maven.test.skip' => 'true',
'build.date' => '${maven.build.timestamp}',
Expand Down Expand Up @@ -62,8 +59,7 @@

jar 'com.headius:invokebinder:1.7'
jar 'com.headius:options:1.4'
jar 'com.headius:coro-mock:1.0', :scope => 'provided'
jar 'com.headius:unsafe-mock', '${unsafe.version}', :scope => 'provided'
jar 'com.headius:unsafe-fences:1.0-SNAPSHOT'

This comment has been minimized.

Copy link
@eregon

eregon Dec 17, 2016

Member

SNAPSHOT dependency!

This comment has been minimized.

Copy link
@chrisseaton

chrisseaton Dec 18, 2016

Author Contributor

But we don't build this part any more!

(We do, but only for testing purposes, and won't in the next few days).


jar 'bsf:bsf:2.4.0', :scope => 'provided'
jar 'com.jcraft:jzlib:1.1.3'
Expand Down Expand Up @@ -192,17 +188,13 @@
'compilerArgs' => [ '-XDignore.symbol.file=true',
'-J-Duser.language=en',
'-J-Dfile.encoding=UTF-8',
'-J-Xbootclasspath/p:${unsafe.jar}',
'-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}',
'-Xbootclasspath/p:${unsafe.jar}',
'-J-Xmx${jruby.compile.memory}' ],
'includes' => [ 'org/jruby/gen/**/*.java' ] )
execute_goals( 'compile',
Expand Down
17 changes: 2 additions & 15 deletions core/pom.xml
Expand Up @@ -22,7 +22,6 @@ DO NOT MODIFIY - GENERATED CODE
<spec.tags.dir>${spec.dir}/tags</spec.tags.dir>
<polyglot.dump.pom>pom.xml</polyglot.dump.pom>
<pkg.dir>${build.dir}/pkg</pkg.dir>
<unsafe.jar>${settings.localRepository}/com/headius/unsafe-mock/${unsafe.version}/unsafe-mock-${unsafe.version}.jar</unsafe.jar>
<spec.dir>spec</spec.dir>
<maven.build.timestamp.format>yyyy-MM-dd</maven.build.timestamp.format>
<jruby.test.memory.permgen>2G</jruby.test.memory.permgen>
Expand All @@ -41,7 +40,6 @@ DO NOT MODIFIY - GENERATED CODE
<jruby.launch.memory>1024M</jruby.launch.memory>
<jruby.compile.memory>2G</jruby.compile.memory>
<version.ruby.major>2.3</version.ruby.major>
<unsafe.version>8.92.1</unsafe.version>
<release.dir>release</release.dir>
<create.sources.jar>false</create.sources.jar>
<lib.dir>lib</lib.dir>
Expand Down Expand Up @@ -204,15 +202,8 @@ DO NOT MODIFIY - GENERATED CODE
</dependency>
<dependency>
<groupId>com.headius</groupId>
<artifactId>coro-mock</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.headius</groupId>
<artifactId>unsafe-mock</artifactId>
<version>${unsafe.version}</version>
<scope>provided</scope>
<artifactId>unsafe-fences</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>bsf</groupId>
Expand Down Expand Up @@ -496,8 +487,6 @@ DO NOT MODIFIY - GENERATED CODE
<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>-Xbootclasspath/p:${unsafe.jar}</compilerArg>
<compilerArg>-J-Xmx${jruby.compile.memory}</compilerArg>
</compilerArgs>
</configuration>
Expand All @@ -513,8 +502,6 @@ DO NOT MODIFIY - GENERATED CODE
<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>-Xbootclasspath/p:${unsafe.jar}</compilerArg>
<compilerArg>-J-Xmx${jruby.compile.memory}</compilerArg>
</compilerArgs>
<includes>
Expand Down
33 changes: 33 additions & 0 deletions core/src/main/java/org/jruby/ObjectFlags.java
@@ -0,0 +1,33 @@
package org.jruby;

import org.jruby.ext.stringio.StringIO;

/**
* Flags used by RubyBasicObject descendants.
*/
public interface ObjectFlags {
FlagRegistry registry = new FlagRegistry();

// These flags must be registered from top of hierarchy down to maintain order.
// TODO: Replace these during the build with their calculated values.
int FALSE_F = registry.newFlag(RubyBasicObject.class);
int NIL_F = registry.newFlag(RubyBasicObject.class);
int FROZEN_F = registry.newFlag(RubyBasicObject.class);
int TAINTED_F = registry.newFlag(RubyBasicObject.class);

int CACHEPROXY_F = registry.newFlag(RubyModule.class);
int NEEDSIMPL_F = registry.newFlag(RubyModule.class);
int REFINED_MODULE_F = registry.newFlag(RubyModule.class);
int IS_OVERLAID_F = registry.newFlag(RubyModule.class);

int CR_7BIT_F = registry.newFlag(RubyString.class);
int CR_VALID_F = registry.newFlag(RubyString.class);

int STRIO_READABLE = registry.newFlag(StringIO.class);
int STRIO_WRITABLE = registry.newFlag(StringIO.class);

int MATCH_BUSY = registry.newFlag(RubyMatchData.class);

int COMPARE_BY_IDENTITY_F = registry.newFlag(RubyHash.class);
int PROCDEFAULT_HASH_F = registry.newFlag(RubyHash.class);
}
9 changes: 4 additions & 5 deletions core/src/main/java/org/jruby/RubyBasicObject.java
Expand Up @@ -30,7 +30,6 @@
import org.jcodings.Encoding;
import org.jcodings.specific.UTF8Encoding;
import org.jruby.ir.interpreter.Interpreter;
import org.jruby.runtime.Constants;
import org.jruby.runtime.JavaSites;
import org.jruby.runtime.JavaSites.BasicObjectSites;
import org.jruby.runtime.ivars.VariableAccessor;
Expand Down Expand Up @@ -143,7 +142,7 @@ public class RubyBasicObject implements Cloneable, IRubyObject, Serializable, Co
public static final String ERR_INSECURE_SET_INST_VAR = "Insecure: can't modify instance variable";

public static final int ALL_F = -1;
public static final int FALSE_F = Constants.FALSE_F;
public static final int FALSE_F = ObjectFlags.FALSE_F;
/**
* This flag is a bit funny. It's used to denote that this value
* is nil. It's a bit counterintuitive for a Java programmer to
Expand All @@ -154,9 +153,9 @@ public class RubyBasicObject implements Cloneable, IRubyObject, Serializable, Co
* final. It turns out using a flag for this actually gives us
* better performance than having a polymorphic {@link #isNil()} method.
*/
public static final int NIL_F = Constants.NIL_F;
public static final int FROZEN_F = Constants.FROZEN_F;
public static final int TAINTED_F = Constants.TAINTED_F;
public static final int NIL_F = ObjectFlags.NIL_F;
public static final int FROZEN_F = ObjectFlags.FROZEN_F;
public static final int TAINTED_F = ObjectFlags.TAINTED_F;

/**
* A value that is used as a null sentinel in among other places
Expand Down
11 changes: 2 additions & 9 deletions core/src/main/java/org/jruby/RubyHash.java
Expand Up @@ -44,20 +44,13 @@
import org.jruby.common.IRubyWarnings.ID;
import org.jruby.exceptions.RaiseException;
import org.jruby.javasupport.JavaUtil;
import org.jruby.parser.StaticScope;
import org.jruby.runtime.Arity;
import org.jruby.runtime.Binding;
import org.jruby.runtime.Block;
import org.jruby.runtime.BlockBody;
import org.jruby.runtime.ClassIndex;
import org.jruby.runtime.Constants;
import org.jruby.runtime.Frame;
import org.jruby.runtime.Helpers;
import org.jruby.runtime.JavaSites.HashSites;
import org.jruby.runtime.ObjectAllocator;
import org.jruby.runtime.Signature;
import org.jruby.runtime.ThreadContext;
import org.jruby.runtime.Visibility;
import org.jruby.runtime.builtin.IRubyObject;
import org.jruby.runtime.marshal.MarshalStream;
import org.jruby.runtime.marshal.UnmarshalStream;
Expand Down Expand Up @@ -118,7 +111,7 @@
public class RubyHash extends RubyObject implements Map {
public static final int DEFAULT_INSPECT_STR_SIZE = 20;

public static final int COMPARE_BY_IDENTITY_F = Constants.COMPARE_BY_IDENTITY_F;
public static final int COMPARE_BY_IDENTITY_F = ObjectFlags.COMPARE_BY_IDENTITY_F;

public static RubyClass createHashClass(Ruby runtime) {
RubyClass hashc = runtime.defineClass("Hash", runtime.getObject(), HASH_ALLOCATOR);
Expand Down Expand Up @@ -231,7 +224,7 @@ public static final RubyHash newHash(Ruby runtime, Map valueMap, IRubyObject def
protected int size = 0;
private int threshold;

private static final int PROCDEFAULT_HASH_F = Constants.PROCDEFAULT_HASH_F;
private static final int PROCDEFAULT_HASH_F = ObjectFlags.PROCDEFAULT_HASH_F;

private IRubyObject ifNone;

Expand Down
3 changes: 1 addition & 2 deletions core/src/main/java/org/jruby/RubyMatchData.java
Expand Up @@ -46,7 +46,6 @@
import org.jruby.anno.JRubyClass;
import org.jruby.runtime.Block;
import org.jruby.runtime.ClassIndex;
import org.jruby.runtime.Constants;
import org.jruby.runtime.ObjectAllocator;
import org.jruby.runtime.ThreadContext;
import org.jruby.runtime.Visibility;
Expand Down Expand Up @@ -276,7 +275,7 @@ private void updateCharOffset() {
charOffsetUpdated = true;
}

private static final int MATCH_BUSY = Constants.MATCH_BUSY;
private static final int MATCH_BUSY = ObjectFlags.MATCH_BUSY;

// rb_match_busy
public final void use() {
Expand Down
9 changes: 4 additions & 5 deletions core/src/main/java/org/jruby/RubyModule.java
Expand Up @@ -93,7 +93,6 @@
import org.jruby.runtime.Block;
import org.jruby.runtime.CallSite;
import org.jruby.runtime.ClassIndex;
import org.jruby.runtime.Constants;
import org.jruby.runtime.Helpers;
import org.jruby.runtime.IRBlockBody;
import org.jruby.runtime.MethodFactory;
Expand Down Expand Up @@ -134,10 +133,10 @@ public class RubyModule extends RubyObject {
private static final Logger LOG = LoggerFactory.getLogger(RubyModule.class);
// static { LOG.setDebugEnable(true); } // enable DEBUG output

public static final int CACHEPROXY_F = Constants.CACHEPROXY_F;
public static final int NEEDSIMPL_F = Constants.NEEDSIMPL_F;
public static final int REFINED_MODULE_F = Constants.REFINED_MODULE_F;
public static final int IS_OVERLAID_F = Constants.IS_OVERLAID_F;
public static final int CACHEPROXY_F = ObjectFlags.CACHEPROXY_F;
public static final int NEEDSIMPL_F = ObjectFlags.NEEDSIMPL_F;
public static final int REFINED_MODULE_F = ObjectFlags.REFINED_MODULE_F;
public static final int IS_OVERLAID_F = ObjectFlags.IS_OVERLAID_F;

public static final ObjectAllocator MODULE_ALLOCATOR = new ObjectAllocator() {
@Override
Expand Down
7 changes: 3 additions & 4 deletions core/src/main/java/org/jruby/ext/stringio/StringIO.java
Expand Up @@ -32,7 +32,7 @@

import org.jcodings.Encoding;
import org.jcodings.specific.ASCIIEncoding;
import org.jruby.FlagRegistry;
import org.jruby.ObjectFlags;
import org.jruby.Ruby;
import org.jruby.RubyArray;
import org.jruby.RubyClass;
Expand All @@ -49,7 +49,6 @@
import org.jruby.ast.util.ArgsUtil;
import org.jruby.java.addons.IOJavaAddons;
import org.jruby.runtime.Block;
import org.jruby.runtime.Constants;
import org.jruby.runtime.ObjectAllocator;
import org.jruby.runtime.ThreadContext;
import org.jruby.runtime.builtin.IRubyObject;
Expand Down Expand Up @@ -81,8 +80,8 @@ static class StringIOData {
}
StringIOData ptr;

private static final int STRIO_READABLE = Constants.STRIO_READABLE;
private static final int STRIO_WRITABLE = Constants.STRIO_WRITABLE;
private static final int STRIO_READABLE = ObjectFlags.STRIO_READABLE;
private static final int STRIO_WRITABLE = ObjectFlags.STRIO_WRITABLE;
private static final int STRIO_READWRITE = (STRIO_READABLE | STRIO_WRITABLE);

private static ObjectAllocator STRINGIO_ALLOCATOR = new ObjectAllocator() {
Expand Down

This file was deleted.

0 comments on commit a14acdb

Please sign in to comment.