Skip to content
Snippets Groups Projects
Commit 5e9ba338 authored by stepan's avatar stepan
Browse files

Add missing Truffle boundaries

parent 81ee0a4e
No related branches found
No related tags found
No related merge requests found
......@@ -35,6 +35,7 @@ import java.util.List;
import java.util.Set;
import com.oracle.truffle.api.CallTarget;
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
import com.oracle.truffle.api.Truffle;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.interop.ForeignAccess;
......@@ -140,6 +141,7 @@ public final class Managed_DownCallNodeFactory extends DownCallNodeFactory {
public CallTarget accessExecute(int argumentsLength) {
return Truffle.getRuntime().createCallTarget(new RootNode(null) {
@Override
@TruffleBoundary
public Object execute(VirtualFrame frame) {
NativeCharArray templateBytes = (NativeCharArray) ForeignAccess.getArguments(frame).get(0);
String template = new String(templateBytes.getValue(), 0, templateBytes.getValue().length - 1);
......@@ -191,6 +193,7 @@ public final class Managed_DownCallNodeFactory extends DownCallNodeFactory {
public CallTarget accessExecute(int argumentsLength) {
return Truffle.getRuntime().createCallTarget(new RootNode(null) {
@Override
@TruffleBoundary
public Object execute(VirtualFrame frame) {
NativeCharArray buffer = (NativeCharArray) ForeignAccess.getArguments(frame).get(0);
byte[] bytes = Paths.get(".").toAbsolutePath().normalize().toString().getBytes();
......
/*
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......
......@@ -58,6 +58,7 @@ public final class NativeCharArray extends NativeUInt8Array {
/**
* Finds the null terminator and creates the Java String accordingly.
*/
@TruffleBoundary
public String getStringFromOutputBuffer() {
assert !fakesNullTermination() : "create the buffer string via createOutputBuffer()";
byte[] mbuf = getValue();
......
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