Skip to content

Commit

Permalink
Showing 113 changed files with 3,331 additions and 696 deletions.
4 changes: 1 addition & 3 deletions core/pom.rb
Original file line number Diff line number Diff line change
@@ -53,7 +53,7 @@

jar 'org.jruby.joni:joni:2.1.8'
jar 'org.jruby.extras:bytelist:1.0.13'
jar 'org.jruby.jcodings:jcodings:1.0.13'
jar 'org.jruby.jcodings:jcodings:1.0.16-SNAPSHOT'
jar 'org.jruby:dirgra:0.3'

jar 'com.headius:invokebinder:1.5'
@@ -73,8 +73,6 @@
jar 'org.jruby:joda-timezones:${tzdata.version}', :scope => '${tzdata.scope}'
jar 'joda-time:joda-time:${joda.time.version}'

jar 'com.boundary:high-scale-lib:1.0.6'

plugin_management do
plugin( 'org.eclipse.m2e:lifecycle-mapping:1.0.0',
'lifecycleMappingMetadata' => {
7 changes: 1 addition & 6 deletions core/pom.xml
Original file line number Diff line number Diff line change
@@ -184,7 +184,7 @@ DO NOT MODIFIY - GENERATED CODE
<dependency>
<groupId>org.jruby.jcodings</groupId>
<artifactId>jcodings</artifactId>
<version>1.0.13</version>
<version>1.0.16-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.jruby</groupId>
@@ -263,11 +263,6 @@ DO NOT MODIFIY - GENERATED CODE
<artifactId>joda-time</artifactId>
<version>${joda.time.version}</version>
</dependency>
<dependency>
<groupId>com.boundary</groupId>
<artifactId>high-scale-lib</artifactId>
<version>1.0.6</version>
</dependency>
</dependencies>
<build>
<defaultGoal>package</defaultGoal>
51 changes: 27 additions & 24 deletions core/src/main/java/org/jruby/RubyModule.java
Original file line number Diff line number Diff line change
@@ -38,6 +38,24 @@
package org.jruby;

import org.jcodings.Encoding;

import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.security.AccessControlException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.IdentityHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;

import org.jruby.anno.AnnotationBinder;
import org.jruby.anno.AnnotationHelper;
import org.jruby.anno.JRubyClass;
@@ -100,24 +118,8 @@
import org.jruby.util.log.Logger;
import org.jruby.util.log.LoggerFactory;

import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.security.AccessControlException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.IdentityHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;

import static org.jruby.anno.FrameField.*;
import static org.jruby.anno.FrameField.VISIBILITY;
import static org.jruby.runtime.Visibility.*;


@@ -3122,10 +3124,6 @@ public IRubyObject const_get_2_0(ThreadContext context, IRubyObject[] args) {
@JRubyMethod(name = "const_set", required = 2)
public IRubyObject const_set(IRubyObject symbol, IRubyObject value) {
IRubyObject constant = setConstant(validateConstant(symbol).intern(), value);

if (constant instanceof RubyModule) {
((RubyModule)constant).calculateName();
}
return constant;
}

@@ -3614,27 +3612,32 @@ private IRubyObject setConstantCommon(String name, IRubyObject value, boolean hi
if (warn) {
getRuntime().getWarnings().warn(ID.CONSTANT_ALREADY_INITIALIZED, "already initialized constant " + name);
}
setParentForModule(name, value);
// might just call storeConstant(name, value, hidden) but to maintain
// backwards compatibility with calling #storeConstant overrides
if (hidden) storeConstant(name, value, true);
else storeConstant(name, value);
}
} else {
setParentForModule(name, value);
if (hidden) storeConstant(name, value, true);
else storeConstant(name, value);
}

invalidateConstantCache(name);
return value;
}

private void setParentForModule(final String name, final IRubyObject value) {
// if adding a module under a constant name, set that module's basename to the constant name
if (value instanceof RubyModule) {
RubyModule module = (RubyModule)value;
if ( value instanceof RubyModule ) {
RubyModule module = (RubyModule) value;
if (module != this && module.getBaseName() == null) {
module.setBaseName(name);
module.setParent(this);
}
module.calculateName();
}
return value;
}

@Deprecated
8 changes: 4 additions & 4 deletions core/src/main/java/org/jruby/RubyObjectSpace.java
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
* Copyright (C) 2002-2004 Anders Bengtsson <ndrsbngtssn@yahoo.se>
* Copyright (C) 2004 Thomas E Enebo <enebo@acm.org>
* Copyright (C) 2004 Stefan Matthias Aust <sma@3plus4.de>
*
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
@@ -51,12 +51,12 @@
public class RubyObjectSpace {

/** Create the ObjectSpace module and add it to the Ruby runtime.
*
*
*/
public static RubyModule createObjectSpaceModule(Ruby runtime) {
RubyModule objectSpaceModule = runtime.defineModule("ObjectSpace");
runtime.setObjectSpaceModule(objectSpaceModule);

objectSpaceModule.defineAnnotatedMethods(RubyObjectSpace.class);

WeakMap.createWeakMap(runtime);
@@ -118,7 +118,7 @@ public static IRubyObject id2ref(IRubyObject recv, IRubyObject id) {
}
}
}

public static IRubyObject each_objectInternal(final ThreadContext context, IRubyObject recv, IRubyObject[] args, final Block block) {
RubyModule tmpClass;
if (args.length == 0) {
14 changes: 14 additions & 0 deletions core/src/main/java/org/jruby/ast/RootNode.java
Original file line number Diff line number Diff line change
@@ -48,8 +48,13 @@ public class RootNode extends Node {
private StaticScope staticScope;
private Node bodyNode;
private String file;
private int endPosition;

public RootNode(ISourcePosition position, DynamicScope scope, Node bodyNode, String file) {
this(position, scope, bodyNode, file, -1);
}

public RootNode(ISourcePosition position, DynamicScope scope, Node bodyNode, String file, int endPosition) {
super(position, bodyNode.containsVariableAssignment());

assert bodyNode != null : "bodyNode is not null";
@@ -58,6 +63,7 @@ public RootNode(ISourcePosition position, DynamicScope scope, Node bodyNode, Str
this.staticScope = scope.getStaticScope();
this.bodyNode = bodyNode;
this.file = file;
this.endPosition = endPosition;
}

public NodeType getNodeType() {
@@ -108,4 +114,12 @@ public <T> T accept(NodeVisitor<T> iVisitor) {
public List<Node> childNodes() {
return createList(bodyNode);
}

public boolean hasEndPosition() {
return endPosition != -1;
}

public int getEndPosition() {
return endPosition;
}
}
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/ast/StarNode.java
Original file line number Diff line number Diff line change
@@ -55,7 +55,7 @@ public NodeType getNodeType() {
* @see Node#accept(NodeVisitor)
*/
public Object accept(NodeVisitor visitor) {
return null; // never visited, should be fine
return visitor.visitStarNode(this);
}

public List<Node> childNodes() {
Original file line number Diff line number Diff line change
@@ -503,6 +503,11 @@ public T visitSplatNode(SplatNode node) {
return defaultVisit(node);
}

@Override
public T visitStarNode(StarNode node) {
return defaultVisit(node);
}

@Override
public T visitStrNode(StrNode node) {
return defaultVisit(node);
Loading

0 comments on commit 7b1f07b

Please sign in to comment.