Skip to content

Commit 1ec59c3

Browse files
author
Pavel Marek
committed
Fix style
1 parent 5fce279 commit 1ec59c3

File tree

8 files changed

+37
-33
lines changed

8 files changed

+37
-33
lines changed

com.oracle.truffle.r.ffi.impl/src/com/oracle/truffle/r/ffi/impl/llvm/TruffleLLVM_Context.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public Object callNativeFunction(Object nativeFunc, Type nativeFuncType, String
145145
Object ret;
146146
try {
147147
ret = interop.execute(nativeFunc, wrappedArgs);
148-
} catch(InteropException e) {
148+
} catch (InteropException e) {
149149
throw RInternalError.shouldNotReachHere(e);
150150
}
151151
ret = FFIUnwrapNodeGen.getUncached().execute(ret);

com.oracle.truffle.r.ffi.impl/src/com/oracle/truffle/r/ffi/impl/nfi/TruffleNFI_Context.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ public Object callNativeFunction(Object nativeFunc, Type nativeFuncType, String
410410
Object ret;
411411
try {
412412
ret = interop.execute(boundNativeFunc, wrappedArgs);
413-
} catch(InteropException e) {
413+
} catch (InteropException e) {
414414
throw RInternalError.shouldNotReachHere(e);
415415
}
416416
ret = FFIUnwrapNodeGen.getUncached().execute(ret);

com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/graphics/RGraphics.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
*/
2323
package com.oracle.truffle.r.library.graphics;
2424

25-
2625
import static com.oracle.truffle.r.runtime.context.FastROptions.LoadPackagesNativeCode;
2726
import com.oracle.truffle.r.runtime.context.RContext;
2827
import com.oracle.truffle.r.runtime.ffi.CallRFFI;

com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/context/GlobalNativeVarContext.java

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
package com.oracle.truffle.r.runtime.context;
22

33
import com.oracle.truffle.api.CompilerDirectives;
4-
import com.oracle.truffle.api.TruffleLogger;
54
import com.oracle.truffle.api.interop.InteropLibrary;
6-
import com.oracle.truffle.api.interop.InvalidArrayIndexException;
75
import com.oracle.truffle.api.interop.TruffleObject;
86
import com.oracle.truffle.api.interop.UnknownKeyException;
97
import com.oracle.truffle.api.interop.UnsupportedMessageException;
@@ -12,13 +10,10 @@
1210
import com.oracle.truffle.api.library.ExportMessage;
1311
import com.oracle.truffle.r.runtime.Collections;
1412
import com.oracle.truffle.r.runtime.RInternalError;
15-
import com.oracle.truffle.r.runtime.RLogger;
1613
import com.oracle.truffle.r.runtime.ffi.RFFIFactory;
1714

18-
import java.util.Arrays;
1915
import java.util.HashMap;
2016
import java.util.Map;
21-
import java.util.logging.Level;
2217

2318
public class GlobalNativeVarContext implements RContext.ContextState {
2419
private static final Collections.ArrayListObj<GlobalVarDescriptor> globalNativeVarDescriptors = new Collections.ArrayListObj<>(64);
@@ -41,6 +36,7 @@ public static GlobalNativeVarContext newContextState(RContext context) {
4136
/**
4237
* Allocates descriptor structure for native global var.
4338
*/
39+
@CompilerDirectives.TruffleBoundary
4440
public GlobalVarDescriptor allocGlobalVarDescr() {
4541
var descr = new GlobalVarDescriptor();
4642
globalNativeVarDescriptors.add(descr);
@@ -82,6 +78,7 @@ public void beforeFinalize(RContext context) {
8278

8379
/**
8480
* Removes {@code context} from all teh global native variable descriptors.
81+
*
8582
* @param context Context used as the key for global native variable descriptors.
8683
*/
8784
@Override
@@ -116,7 +113,7 @@ public void callAllDestructors(RContext context, InteropLibrary interop) {
116113
throw RInternalError.shouldNotReachHere(e);
117114
}
118115
Object ret = context.getRFFI().callNativeFunction(destructor.nativeFunc, destructor.nativeFuncType, Destructor.SIGNATURE,
119-
new Object[]{ptrForDestructorNative}, whichArgToWrap);
116+
new Object[]{ptrForDestructorNative}, whichArgToWrap);
120117
assert interop.isNull(ret);
121118
}
122119
}
@@ -231,16 +228,16 @@ public String toString() {
231228
}
232229

233230
/**
234-
* Represents a native function callback that is called during the context finalization.
235-
* Needed for native array global variables for which there was heap memory allocated.
231+
* Represents a native function callback that is called during the context finalization. Needed
232+
* for native array global variables for which there was heap memory allocated.
236233
*/
237234
private static final class Destructor {
238235
static final String SIGNATURE = "(pointer): void";
239236

240237
final Object globalVarDescr;
241238
/**
242-
* The signature of the native function is {@code void dtor(void *ptr)}, where {@code ptr} is the
243-
* underlying pointer fetched via {@code FASTR_GlobalVarGetPtr}.
239+
* The signature of the native function is {@code void dtor(void *ptr)}, where {@code ptr}
240+
* is the underlying pointer fetched via {@code FASTR_GlobalVarGetPtr}.
244241
*/
245242
final Object nativeFunc;
246243
final RFFIFactory.Type nativeFuncType;

com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/context/PackagePatching.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ public class PackagePatching {
7474
new Patch("Rf_KillAllDevices\\s*\\(\\s*\\)", ""),
7575
// This patch was first introduced because compilation of testthat 3.0.1 failed
7676
// on systems
77-
// with newer glibc (for example glibc version on Ubuntu >= 22.04) , as described in
77+
// with newer glibc (for example glibc version on Ubuntu >= 22.04) , as
78+
// described in
7879
// https://github.com/r-lib/testthat/issues/1373.
7980
// In newer glibc, SIGSTKSZ is no longer a constexpr, so it cannot be used in
8081
// C++ in static array declaration.

com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/context/RContext.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,9 @@ default void beforeDispose(RContext context) {
248248
}
249249

250250
/**
251-
* Called before context finalization ({@code com.oracle.truffle.api.TruffleLanguage#finalizeContext(Object)}).
252-
* Note that context finalization happens before context disposal, and generally, it should be safe to
251+
* Called before context finalization
252+
* ({@code com.oracle.truffle.api.TruffleLanguage#finalizeContext(Object)}). Note that
253+
* context finalization happens before context disposal, and generally, it should be safe to
253254
* call native functions in the context finalization.
254255
*/
255256
default void beforeFinalize(RContext context) {
@@ -648,7 +649,8 @@ public static RContext create(TruffleRLanguage language, Env env, Instrumenter i
648649
public void finalizeContext() {
649650
if (state.contains(State.INITIALIZED)) {
650651
// Engine deactive must be called from finalizeContext, because we need to call some
651-
// native functions from there, and for that, we need the context not to be in the disposal.
652+
// native functions from there, and for that, we need the context not to be in the
653+
// disposal.
652654
if (!embedded) {
653655
engine.deactivate();
654656
}

com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/FFIWrap.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,12 @@ public Object[] wrapUncached(Object[] args) {
105105
}
106106

107107
/**
108-
* Materializes and wraps some (or all) arguments with {@link com.oracle.truffle.r.runtime.data.NativeDataAccess.NativeMirror}.
108+
* Materializes and wraps some (or all) arguments with
109+
* {@link com.oracle.truffle.r.runtime.data.NativeDataAccess.NativeMirror}.
110+
*
109111
* @param args Arguments to wrap
110-
* @param whichArgToWrap If {@code whichArgToWrap[i] == true}, {@code args[i]} will be wrapped.
111-
* If {@code whichArgToWrap} is null, all arguments are wrapped.
112+
* @param whichArgToWrap If {@code whichArgToWrap[i] == true}, {@code args[i]} will be
113+
* wrapped. If {@code whichArgToWrap} is null, all arguments are wrapped.
112114
*/
113115
public Object[] wrapSomeUncached(Object[] args, boolean[] whichArgToWrap) {
114116
assert materialized.length == args.length;
@@ -130,10 +132,12 @@ public Object[] wrapAll(Object[] args, FFIMaterializeNode[] ffiMateralizeNodes,
130132
}
131133

132134
/**
133-
* Materializes and wraps some (or all) arguments with {@link com.oracle.truffle.r.runtime.data.NativeDataAccess.NativeMirror}.
135+
* Materializes and wraps some (or all) arguments with
136+
* {@link com.oracle.truffle.r.runtime.data.NativeDataAccess.NativeMirror}.
137+
*
134138
* @param args Arguments to wrap
135-
* @param whichArgToWrap If {@code whichArgToWrap[i] == true}, {@code args[i]} will be wrapped.
136-
* If {@code whichArgToWrap} is null, all arguments are wrapped.
139+
* @param whichArgToWrap If {@code whichArgToWrap[i] == true}, {@code args[i]} will be
140+
* wrapped. If {@code whichArgToWrap} is null, all arguments are wrapped.
137141
*/
138142
@ExplodeLoop
139143
public Object[] wrapSome(Object[] args, FFIMaterializeNode[] ffiMaterializeNodes, FFIToNativeMirrorNode[] ffiToNativeMirrorNodes, boolean[] whichArgToWrap) {

com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/RFFIContext.java

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -144,17 +144,18 @@ public final void registerReferenceUsedInNative(Object obj, ConditionProfile nop
144144

145145
/**
146146
* Calls a native function in slow-path. This method is a simpler alternative to
147-
* {@link com.oracle.truffle.r.runtime.ffi.DownCallNodeFactory.DownCallNode} machinery.
148-
* Use it once the native function is not known during FastR build, i.e., whenever you
149-
* cannot use {@link NativeFunction}.
147+
* {@link com.oracle.truffle.r.runtime.ffi.DownCallNodeFactory.DownCallNode} machinery. Use it
148+
* once the native function is not known during FastR build, i.e., whenever you cannot use
149+
* {@link NativeFunction}.
150150
*
151-
* @param nativeFunc (Truffle) object representing the native function to be called.
152-
* @param nativeFuncType Type of the native function - can be either {@code LLVM} or {@code NFI}.
153-
* @param signature Signature of the function. Makes sense only for {@code NFI} function type.
154-
* @param args Arguments passed to the native function, potentially processed with
155-
* {@link FFIWrap.FFIDownCallWrap}, based on {@code whichArgToWrap}.
156-
* @param whichArgToWrap If {@code whichArgToWrap[i] == true}, then element at {@code args[i]} will
157-
* be wrapped with {@link FFIWrap.FFIDownCallWrap}.
151+
* @param nativeFunc (Truffle) object representing the native function to be called.
152+
* @param nativeFuncType Type of the native function - can be either {@code LLVM} or
153+
* {@code NFI}.
154+
* @param signature Signature of the function. Makes sense only for {@code NFI} function type.
155+
* @param args Arguments passed to the native function, potentially processed with
156+
* {@link FFIWrap.FFIDownCallWrap}, based on {@code whichArgToWrap}.
157+
* @param whichArgToWrap If {@code whichArgToWrap[i] == true}, then element at {@code args[i]}
158+
* will be wrapped with {@link FFIWrap.FFIDownCallWrap}.
158159
* @return Return value directly from the native function, processed with {@link FFIUnwrapNode}.
159160
*/
160161
public Object callNativeFunction(Object nativeFunc, RFFIFactory.Type nativeFuncType, String signature, Object[] args, boolean[] whichArgToWrap) {

0 commit comments

Comments
 (0)