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

Merge pull request #596 in G/fastr from...

Merge pull request #596 in G/fastr from ~LUKAS.STADLER_ORACLE.COM/fastr:bugfix/shape_checked_attr_access to master

* commit 'd58971d4':
  pass shape to Location.get
parents 557ea0df d58971d4
No related branches found
No related tags found
No related merge requests found
/* /*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -35,5 +35,4 @@ public abstract class FixedAttributeAccessNode extends AttributeAccessNode { ...@@ -35,5 +35,4 @@ public abstract class FixedAttributeAccessNode extends AttributeAccessNode {
assert name.intern() == name; assert name.intern() == name;
this.name = name; this.name = name;
} }
} }
/* /*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -57,12 +57,11 @@ public abstract class GetAttributeNode extends AttributeAccessNode { ...@@ -57,12 +57,11 @@ public abstract class GetAttributeNode extends AttributeAccessNode {
@Specialization(limit = "3", // @Specialization(limit = "3", //
guards = {"cachedName.equals(name)", "shapeCheck(shape, attrs)"}, // guards = {"cachedName.equals(name)", "shapeCheck(shape, attrs)"}, //
assumptions = {"shape.getValidAssumption()"}) assumptions = {"shape.getValidAssumption()"})
@SuppressWarnings("unused") protected Object getAttrCached(DynamicObject attrs, @SuppressWarnings("unused") String name,
protected Object getAttrCached(DynamicObject attrs, String name, @SuppressWarnings("unused") @Cached("name") String cachedName,
@Cached("name") String cachedName,
@Cached("lookupShape(attrs)") Shape shape, @Cached("lookupShape(attrs)") Shape shape,
@Cached("lookupLocation(shape, name)") Location location) { @Cached("lookupLocation(shape, name)") Location location) {
return location == null ? null : location.get(attrs); return location == null ? null : location.get(attrs, shape);
} }
@TruffleBoundary @TruffleBoundary
...@@ -96,5 +95,4 @@ public abstract class GetAttributeNode extends AttributeAccessNode { ...@@ -96,5 +95,4 @@ public abstract class GetAttributeNode extends AttributeAccessNode {
return recursive.execute(attributes, name); return recursive.execute(attributes, name);
} }
} }
/* /*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -81,11 +81,10 @@ public abstract class GetFixedAttributeNode extends FixedAttributeAccessNode { ...@@ -81,11 +81,10 @@ public abstract class GetFixedAttributeNode extends FixedAttributeAccessNode {
@Specialization(limit = "3", // @Specialization(limit = "3", //
guards = {"shapeCheck(shape, attrs)"}, // guards = {"shapeCheck(shape, attrs)"}, //
assumptions = {"shape.getValidAssumption()"}) assumptions = {"shape.getValidAssumption()"})
@SuppressWarnings("unused")
protected Object getAttrCached(DynamicObject attrs, protected Object getAttrCached(DynamicObject attrs,
@Cached("lookupShape(attrs)") Shape shape, @Cached("lookupShape(attrs)") Shape shape,
@Cached("lookupLocation(shape, name)") Location location) { @Cached("lookupLocation(shape, name)") Location location) {
return location == null ? null : location.get(attrs); return location == null ? null : location.get(attrs, shape);
} }
@Specialization(contains = "getAttrCached") @Specialization(contains = "getAttrCached")
...@@ -119,5 +118,4 @@ public abstract class GetFixedAttributeNode extends FixedAttributeAccessNode { ...@@ -119,5 +118,4 @@ public abstract class GetFixedAttributeNode extends FixedAttributeAccessNode {
return recursive.execute(attributes); return recursive.execute(attributes);
} }
} }
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