Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: bbbb5d9d79e6
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 59208f0602f5
Choose a head ref
  • 2 commits
  • 6 files changed
  • 1 contributor

Commits on Feb 23, 2016

  1. Copy the full SHA
    e01631f View commit details
  2. [Truffle] Explicitly import ShapeCachingGuards to annotate the Node i…

    …s caching on the Shape.
    eregon committed Feb 23, 2016
    Copy the full SHA
    59208f0 View commit details
Original file line number Diff line number Diff line change
@@ -265,11 +265,4 @@ public static boolean isInfinity(double value) {
return Double.isInfinite(value);
}

// Operations

@TruffleBoundary
public static boolean updateShape(DynamicObject object) {
return object.updateShape();
}

}
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@
package org.jruby.truffle.language.objects;

import com.oracle.truffle.api.dsl.Cached;
import com.oracle.truffle.api.dsl.ImportStatic;
import com.oracle.truffle.api.dsl.NodeChild;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.object.DynamicObject;
@@ -19,6 +20,7 @@
import org.jruby.truffle.core.Layouts;
import org.jruby.truffle.language.RubyNode;

@ImportStatic(ShapeCachingGuards.class)
@NodeChild(value="object", type=RubyNode.class)
public abstract class LogicalClassNode extends RubyNode {

Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@
package org.jruby.truffle.language.objects;

import com.oracle.truffle.api.dsl.Cached;
import com.oracle.truffle.api.dsl.ImportStatic;
import com.oracle.truffle.api.dsl.NodeChild;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.object.DynamicObject;
@@ -19,6 +20,7 @@
import org.jruby.truffle.core.Layouts;
import org.jruby.truffle.language.RubyNode;

@ImportStatic(ShapeCachingGuards.class)
@NodeChild(value="object", type=RubyNode.class)
public abstract class MetaClassNode extends RubyNode {

Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@
import org.jruby.truffle.RubyContext;
import org.jruby.truffle.language.RubyGuards;

@ImportStatic(RubyGuards.class)
@ImportStatic({ RubyGuards.class, ShapeCachingGuards.class })
public abstract class ReadObjectFieldNode extends Node {
private final RubyContext context;
private final Object defaultValue;
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved. This
* code is released under a tri EPL/GPL/LGPL license. You can use it,
* redistribute it and/or modify it under the terms of the:
*
* Eclipse Public License version 1.0
* GNU General Public License version 2
* GNU Lesser General Public License version 2.1
*/

package org.jruby.truffle.language.objects;

import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.object.DynamicObject;
import com.oracle.truffle.api.object.Shape;
import org.jruby.truffle.core.Layouts;

public abstract class ShapeCachingGuards {

public static boolean updateShape(DynamicObject object) {
CompilerDirectives.transferToInterpreter();
return object.updateShape();
}

public static boolean isArrayShape(Shape shape) {
return Layouts.ARRAY.isArray(shape.getObjectType());
}

public static boolean isQueueShape(Shape shape) {
return Layouts.QUEUE.isQueue(shape.getObjectType());
}

public static boolean isBasicObjectShape(Shape shape) {
return shape.getObjectType().getClass().getName().endsWith(".BasicObjectType"); // FIXME
}

}
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@
import org.jruby.truffle.RubyContext;
import org.jruby.truffle.language.RubyGuards;

@ImportStatic(RubyGuards.class)
@ImportStatic({ RubyGuards.class, ShapeCachingGuards.class })
public abstract class WriteObjectFieldNode extends Node {

private final RubyContext context;