Mercurial > hg > graal-jvmci-8
comparison graal/com.oracle.truffle.api.object/src/com/oracle/truffle/api/object/ObjectType.java @ 21770:c76742cc2c6f
Polishing inter-operability APIs: Exposing only Message, TruffleObject and ForeignAccess-related classes.
author | Jaroslav Tulach <jaroslav.tulach@oracle.com> |
---|---|
date | Mon, 08 Jun 2015 04:50:13 +0200 |
parents | d6dba4c723c0 |
children | cb051c368c80 |
comparison
equal
deleted
inserted
replaced
21769:b6309a7d5a44 | 21770:c76742cc2c6f |
---|---|
22 * or visit www.oracle.com if you need additional information or have any | 22 * or visit www.oracle.com if you need additional information or have any |
23 * questions. | 23 * questions. |
24 */ | 24 */ |
25 package com.oracle.truffle.api.object; | 25 package com.oracle.truffle.api.object; |
26 | 26 |
27 import com.oracle.truffle.api.interop.Message; | |
27 import com.oracle.truffle.api.*; | 28 import com.oracle.truffle.api.*; |
28 import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary; | 29 import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary; |
29 import com.oracle.truffle.api.interop.*; | 30 import com.oracle.truffle.api.interop.*; |
30 import com.oracle.truffle.api.interop.exception.*; | |
31 import com.oracle.truffle.api.interop.messages.*; | |
32 | 31 |
33 public class ObjectType { | 32 public class ObjectType { |
34 /** | 33 /** |
35 * Delegate method for {@link DynamicObject#equals(Object)}. | 34 * Delegate method for {@link DynamicObject#equals(Object)}. |
36 */ | 35 */ |
70 * @param shapeAfter shape after the property was added | 69 * @param shapeAfter shape after the property was added |
71 */ | 70 */ |
72 public void onPropertyAdded(Property property, Shape shapeBefore, Shape shapeAfter) { | 71 public void onPropertyAdded(Property property, Shape shapeBefore, Shape shapeAfter) { |
73 } | 72 } |
74 | 73 |
75 public ForeignAccessFactory getForeignAccessFactory() { | 74 public ForeignAccess getForeignAccessFactory() { |
76 return new ForeignAccessFactory() { | 75 return ForeignAccess.create(new com.oracle.truffle.api.interop.ForeignAccess.Factory() { |
77 | 76 |
78 public InteropPredicate getLanguageCheck() { | 77 public boolean canHandle(TruffleObject obj) { |
79 throw new UnsupportedMessageException(this.toString() + " cannot be shared"); | 78 throw new IllegalArgumentException(this.toString() + " cannot be shared"); |
80 } | 79 } |
81 | 80 |
82 public CallTarget getAccess(Message tree) { | 81 public CallTarget accessMessage(Message tree) { |
83 throw new UnsupportedMessageException(this.toString() + " cannot be shared; Message not possible: " + tree.toString()); | 82 throw new IllegalArgumentException(this.toString() + " cannot be shared; Message not possible: " + tree.toString()); |
84 } | 83 } |
85 }; | 84 }); |
86 } | 85 } |
87 } | 86 } |