-
-
Notifications
You must be signed in to change notification settings - Fork 925
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 9.4.12.0
- 9.4.11.0
- 9.4.10.0
- 9.4.9.0
- 9.4.8.0
- 9.4.7.0
- 9.4.6.0
- 9.4.5.0
- 9.4.4.0
- 9.4.3.0
- 9.4.2.0
- 9.4.1.0
- 9.4.0.0
- 9.3.15.0
- 9.3.14.0
- 9.3.13.0
- 9.3.12.0
- 9.3.11.0
- 9.3.10.0
- 9.3.9.0
- 9.3.8.0
- 9.3.7.0
- 9.3.6.0
- 9.3.5.0
- 9.3.4.0
- 9.3.3.0
- 9.3.2.0
- 9.3.1.0
- 9.3.0.0
- 9.2.21.0
- 9.2.20.1
- 9.2.20.0
- 9.2.19.0
- 9.2.18.0
- 9.2.17.0
- 9.2.16.0
- 9.2.15.0
- 9.2.14.0
- 9.2.13.0
- 9.2.12.0
- 9.2.11.1
- 9.2.11.0
- 9.2.10.0
- 9.2.9.0
- 9.2.8.0
- 9.2.7.0
- 9.2.6.0
- 9.2.5.0
- 9.2.4.1
- 9.2.4.0
- 9.2.3.0
- 9.2.2.0
- 9.2.1.0
- 9.2.0.0
- 9.1.17.0
- 9.1.16.0
- 9.1.15.0
- 9.1.14.0
- 9.1.13.0
- 9.1.12.0
- 9.1.11.0
- 9.1.10.0
- 9.1.9.0
- 9.1.8.0
- 9.1.7.0
- 9.1.6.0
- 9.1.5.0
- 9.1.4.0
- 9.1.3.0
- 9.1.2.0
- 9.1.1.0
- 9.1.0.0
- 9.0.5.0
- 9.0.4.0
- 9.0.3.0
- 9.0.1.0
- 9.0.0.0
- 9.0.0.0.rc2
- 9.0.0.0.rc1
- 9.0.0.0.pre2
- 9.0.0.0.pre1
Andreas Woess
committed
Dec 2, 2014
1 parent
5460e11
commit 42d8c43
Showing
43 changed files
with
706 additions
and
1,074 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
core/src/main/java/org/jruby/truffle/nodes/objectstorage/MigrateNode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright (c) 2013 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.nodes.objectstorage; | ||
|
||
import com.oracle.truffle.api.object.Shape; | ||
import org.jruby.truffle.runtime.core.RubyBasicObject; | ||
|
||
public class MigrateNode extends WriteObjectFieldChainNode { | ||
|
||
private final Shape expectedShape; | ||
|
||
public MigrateNode(Shape expectedShape, WriteObjectFieldNode next) { | ||
super(next); | ||
this.expectedShape = expectedShape; | ||
} | ||
|
||
@Override | ||
public void execute(RubyBasicObject object, Object value) { | ||
if (object.getObjectLayout() == expectedShape) { | ||
object.getDynamicObject().updateShape(); | ||
} | ||
|
||
next.execute(object, value); | ||
} | ||
|
||
} |
68 changes: 68 additions & 0 deletions
68
core/src/main/java/org/jruby/truffle/nodes/objectstorage/ReadBooleanObjectFieldNode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* | ||
* Copyright (c) 2013 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.nodes.objectstorage; | ||
|
||
import com.oracle.truffle.api.nodes.InvalidAssumptionException; | ||
import com.oracle.truffle.api.nodes.NodeCost; | ||
import com.oracle.truffle.api.nodes.NodeInfo; | ||
import com.oracle.truffle.api.nodes.UnexpectedResultException; | ||
import com.oracle.truffle.api.object.BooleanLocation; | ||
import com.oracle.truffle.api.object.Shape; | ||
import org.jruby.truffle.runtime.core.RubyBasicObject; | ||
|
||
@NodeInfo(cost = NodeCost.POLYMORPHIC) | ||
public class ReadBooleanObjectFieldNode extends ReadObjectFieldChainNode { | ||
|
||
private final Shape objectLayout; | ||
private final BooleanLocation storageLocation; | ||
|
||
public ReadBooleanObjectFieldNode(Shape objectLayout, BooleanLocation storageLocation, ReadObjectFieldNode next) { | ||
super(next); | ||
this.objectLayout = objectLayout; | ||
this.storageLocation = storageLocation; | ||
} | ||
|
||
@Override | ||
public boolean executeBoolean(RubyBasicObject object) throws UnexpectedResultException { | ||
try { | ||
objectLayout.getValidAssumption().check(); | ||
} catch (InvalidAssumptionException e) { | ||
replace(next); | ||
return next.executeBoolean(object); | ||
} | ||
|
||
final boolean condition = object.getObjectLayout() == objectLayout; | ||
|
||
if (condition) { | ||
return storageLocation.getBoolean(object.getDynamicObject(), objectLayout); | ||
} else { | ||
return next.executeBoolean(object); | ||
} | ||
} | ||
|
||
@Override | ||
public Object execute(RubyBasicObject object) { | ||
try { | ||
objectLayout.getValidAssumption().check(); | ||
} catch (InvalidAssumptionException e) { | ||
replace(next); | ||
return next.execute(object); | ||
} | ||
|
||
final boolean condition = object.getObjectLayout() == objectLayout; | ||
|
||
if (condition) { | ||
return storageLocation.get(object.getDynamicObject(), objectLayout); | ||
} else { | ||
return next.execute(object); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 0 additions & 24 deletions
24
core/src/main/java/org/jruby/truffle/nodes/objectstorage/RespecializeHook.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
core/src/main/java/org/jruby/truffle/nodes/objectstorage/WriteBooleanObjectFieldNode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
* Copyright (c) 2013 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.nodes.objectstorage; | ||
|
||
import com.oracle.truffle.api.nodes.InvalidAssumptionException; | ||
import com.oracle.truffle.api.nodes.NodeCost; | ||
import com.oracle.truffle.api.nodes.NodeInfo; | ||
import com.oracle.truffle.api.object.BooleanLocation; | ||
import com.oracle.truffle.api.object.FinalLocationException; | ||
import com.oracle.truffle.api.object.Shape; | ||
import org.jruby.truffle.runtime.core.RubyBasicObject; | ||
|
||
@NodeInfo(cost = NodeCost.POLYMORPHIC) | ||
public class WriteBooleanObjectFieldNode extends WriteObjectFieldChainNode { | ||
|
||
private final Shape expectedLayout; | ||
private final Shape newLayout; | ||
private final BooleanLocation storageLocation; | ||
|
||
public WriteBooleanObjectFieldNode(Shape expectedLayout, Shape newLayout, BooleanLocation storageLocation, WriteObjectFieldNode next) { | ||
super(next); | ||
this.expectedLayout = expectedLayout; | ||
this.newLayout = newLayout; | ||
this.storageLocation = storageLocation; | ||
} | ||
|
||
@Override | ||
public void execute(RubyBasicObject object, boolean value) { | ||
try { | ||
expectedLayout.getValidAssumption().check(); | ||
newLayout.getValidAssumption().check(); | ||
} catch (InvalidAssumptionException e) { | ||
replace(next); | ||
next.execute(object, value); | ||
return; | ||
} | ||
|
||
if (object.getObjectLayout() == expectedLayout) { | ||
try { | ||
if (newLayout == expectedLayout) { | ||
storageLocation.setBoolean(object.getDynamicObject(), value, expectedLayout); | ||
} else { | ||
storageLocation.setBoolean(object.getDynamicObject(), value, expectedLayout, newLayout); | ||
} | ||
} catch (FinalLocationException e) { | ||
replace(next, "!final").execute(object, value); | ||
} | ||
} else { | ||
next.execute(object, value); | ||
} | ||
} | ||
|
||
@Override | ||
public void execute(RubyBasicObject object, Object value) { | ||
if (value instanceof Boolean) { | ||
execute(object, (boolean) value); | ||
} else { | ||
next.execute(object, value); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
core/src/main/java/org/jruby/truffle/runtime/RubyOperations.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
/* | ||
* Copyright (c) 2014 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.runtime; | ||
|
||
import com.oracle.truffle.api.object.*; | ||
import org.jruby.truffle.runtime.core.RubyBasicObject; | ||
|
||
import java.util.LinkedHashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public class RubyOperations extends ObjectType { | ||
|
||
private final RubyContext context; | ||
|
||
public RubyOperations(RubyContext context) { | ||
this.context = context; | ||
} | ||
|
||
public void setInstanceVariable(RubyBasicObject receiver, String name, Object value) { | ||
Shape shape = receiver.getDynamicObject().getShape(); | ||
Property property = shape.getProperty(name); | ||
if (property != null) { | ||
property.setGeneric(receiver.getDynamicObject(), value, null); | ||
} else { | ||
receiver.getDynamicObject().define(name, value, 0); | ||
} | ||
} | ||
|
||
public void setInstanceVariables(RubyBasicObject receiver, Map<String, Object> instanceVariables) { | ||
for (Map.Entry<String, Object> entry : instanceVariables.entrySet()) { | ||
setInstanceVariable(receiver, entry.getKey(), entry.getValue()); | ||
} | ||
} | ||
|
||
public Object getInstanceVariable(RubyBasicObject receiver, String name) { | ||
Shape shape = receiver.getDynamicObject().getShape(); | ||
Property property = shape.getProperty(name); | ||
if (property != null) { | ||
return property.get(receiver.getDynamicObject(), false); | ||
} else { | ||
return context.getCoreLibrary().getNilObject(); | ||
} | ||
} | ||
|
||
public Map<String,Object> getInstanceVariables(RubyBasicObject receiver) { | ||
Shape shape = receiver.getDynamicObject().getShape(); | ||
Map<String, Object> vars = new LinkedHashMap<>(); | ||
List<Property> properties = shape.getPropertyList(); | ||
for (Property property : properties) { | ||
vars.put((String) property.getKey(), property.get(receiver.getDynamicObject(), false)); | ||
} | ||
return vars; | ||
} | ||
|
||
public String[] getFieldNames(RubyBasicObject receiver) { | ||
return receiver.getDynamicObject().getShape().getKeyList().toArray(new String[0]); | ||
} | ||
|
||
public boolean isFieldDefined(RubyBasicObject receiver, String name) { | ||
return receiver.getDynamicObject().getShape().hasProperty(name); | ||
} | ||
|
||
@Override | ||
public boolean equals(DynamicObject dynamicObject, Object o) { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
@Override | ||
public int hashCode(DynamicObject dynamicObject) { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 0 additions & 64 deletions
64
core/src/main/java/org/jruby/truffle/runtime/objectstorage/DoubleStorageLocation.java
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
...main/java/org/jruby/truffle/runtime/objectstorage/GeneralizeStorageLocationException.java
This file was deleted.
Oops, something went wrong.
64 changes: 0 additions & 64 deletions
64
core/src/main/java/org/jruby/truffle/runtime/objectstorage/IntegerStorageLocation.java
This file was deleted.
Oops, something went wrong.
63 changes: 0 additions & 63 deletions
63
core/src/main/java/org/jruby/truffle/runtime/objectstorage/LongStorageLocation.java
This file was deleted.
Oops, something went wrong.
233 changes: 0 additions & 233 deletions
233
core/src/main/java/org/jruby/truffle/runtime/objectstorage/ObjectLayout.java
This file was deleted.
Oops, something went wrong.
186 changes: 0 additions & 186 deletions
186
core/src/main/java/org/jruby/truffle/runtime/objectstorage/ObjectStorage.java
This file was deleted.
Oops, something went wrong.
44 changes: 0 additions & 44 deletions
44
core/src/main/java/org/jruby/truffle/runtime/objectstorage/ObjectStorageLocation.java
This file was deleted.
Oops, something went wrong.
39 changes: 0 additions & 39 deletions
39
core/src/main/java/org/jruby/truffle/runtime/objectstorage/PrimitiveStorageLocation.java
This file was deleted.
Oops, something went wrong.
35 changes: 0 additions & 35 deletions
35
core/src/main/java/org/jruby/truffle/runtime/objectstorage/StorageLocation.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters