File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
sulong/projects/com.oracle.truffle.llvm.runtime/src/com/oracle/truffle/llvm/runtime Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 4848import com .oracle .truffle .llvm .runtime .except .LLVMIllegalSymbolIndexException ;
4949import com .oracle .truffle .llvm .runtime .except .LLVMLinkerException ;
5050import com .oracle .truffle .llvm .runtime .global .LLVMGlobal ;
51- import com .oracle .truffle .llvm .runtime .pointer . LLVMManagedPointer ;
51+ import com .oracle .truffle .llvm .runtime .interop . LLVMDataEscapeNode . LLVMPointerDataEscapeNode ;
5252import com .oracle .truffle .llvm .runtime .pointer .LLVMPointer ;
5353
5454@ ExportLibrary (InteropLibrary .class )
@@ -259,23 +259,21 @@ boolean isMemberReadable(@SuppressWarnings("unused") String name) {
259259 @ ExportMessage
260260 Object readMember (String globalName ,
261261 @ Cached BranchProfile exception ,
262+ @ Cached LLVMPointerDataEscapeNode escape ,
262263 @ CachedLibrary ("this" ) InteropLibrary self ) throws UnknownIdentifierException {
263264
264265 if (contains (globalName )) {
265266 LLVMSymbol symbol = get (globalName );
266- if (symbol != null && symbol . isFunction () ) {
267+ if (symbol != null ) {
267268 try {
268269 LLVMPointer value = LLVMContext .get (self ).getSymbol (symbol );
269270 if (value != null ) {
270- return LLVMManagedPointer . cast (value ). getObject ( );
271+ return escape . executeWithTarget (value );
271272 }
272273 } catch (LLVMLinkerException | LLVMIllegalSymbolIndexException e ) {
273274 // fallthrough
274275 }
275- exception .enter ();
276- throw UnknownIdentifierException .create (globalName );
277276 }
278- return symbol ;
279277 }
280278 exception .enter ();
281279 throw UnknownIdentifierException .create (globalName );
You can’t perform that action at this time.
0 commit comments