Skip to content
Snippets Groups Projects
Commit 52b27b14 authored by Lukas Stadler's avatar Lukas Stadler
Browse files

[GR-2746] Fix missing insert calls and other thread safety issues.

parents 89928c49 fd19434f
No related branches found
No related tags found
No related merge requests found
......@@ -89,14 +89,21 @@ public abstract class UpdateSlot extends RBuiltinNode {
if (checkSlotAssignFunction == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
checkSlotAssignFunction = (RFunction) checkAtAssignmentFind.execute(frame);
}
if (checkAtAssignmentCall == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
checkAtAssignmentCall = insert(CallRFunctionNode.create(checkSlotAssignFunction.getTarget()));
assert objClassHierarchy == null && valClassHierarchy == null;
}
if (objClassHierarchy == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
objClassHierarchy = insert(ClassHierarchyNodeGen.create(true, false));
}
if (valClassHierarchy == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
valClassHierarchy = insert(ClassHierarchyNodeGen.create(true, false));
}
RStringVector objClass = objClassHierarchy.execute(object);
RStringVector valClass = objClassHierarchy.execute(value);
RStringVector valClass = valClassHierarchy.execute(value);
RFunction currentFunction = (RFunction) checkAtAssignmentFind.execute(frame);
if (cached.profile(currentFunction == checkSlotAssignFunction)) {
// TODO: technically, someone could override checkAtAssignment function and access the
......
......@@ -155,15 +155,15 @@ abstract class LookupAdapter extends RBuiltinNode {
protected Object extractNativeCallInfo(VirtualFrame frame, RList symbol) {
if (nameExtract == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
nameExtract = ExtractVectorNode.create(ElementAccessMode.SUBSCRIPT, true);
nameExtract = insert(ExtractVectorNode.create(ElementAccessMode.SUBSCRIPT, true));
}
if (addressExtract == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
addressExtract = ExtractVectorNode.create(ElementAccessMode.SUBSCRIPT, true);
addressExtract = insert(ExtractVectorNode.create(ElementAccessMode.SUBSCRIPT, true));
}
if (packageExtract == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
packageExtract = ExtractVectorNode.create(ElementAccessMode.SUBSCRIPT, true);
packageExtract = insert(ExtractVectorNode.create(ElementAccessMode.SUBSCRIPT, true));
}
String name = RRuntime.asString(nameExtract.applyAccessField(frame, symbol, "name"));
SymbolHandle address = ((RExternalPtr) addressExtract.applyAccessField(frame, symbol, "address")).getAddr();
......
......@@ -273,7 +273,7 @@ final class CachedExtractVectorNode extends CachedVectorNode {
private Object extract(int dimensionIndex, RAbstractStringVector vector, Object pos, PositionProfile profile) {
if (extractDimNames == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
extractDimNames = new ExtractDimNamesNode(numberOfDimensions);
extractDimNames = insert(new ExtractDimNamesNode(numberOfDimensions));
}
return extractDimNames.extract(dimensionIndex, vector, pos, profile);
}
......
......@@ -54,7 +54,7 @@ public abstract class AsS4 extends Node {
if (complete != 0) {
if (getS4DataSlot == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
getS4DataSlot = GetS4DataSlotNodeGen.create(RType.Any);
getS4DataSlot = insert(GetS4DataSlotNodeGen.create(RType.Any));
}
RTypedValue value = getS4DataSlot.executeObject(obj);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment