Skip to content

Commit 1d258f8

Browse files
committed
Fix style and copyrights
1 parent 16bb601 commit 1d258f8

10 files changed

+62
-25
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/CtypesModuleBuiltins.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/ExternalFunctionNodes.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -297,16 +297,14 @@ public static ExternalFunctionInvokeNode create(PExternalFunctionWrapper provide
297297
}
298298

299299
/**
300-
* Decrements the ref count by one of any
301-
* {@link PythonNativeWrapper} object.
300+
* Decrements the ref count by one of any {@link PythonNativeWrapper} object.
302301
* <p>
303302
* This node avoids memory leaks for arguments given to native.<br>
304303
* Problem description:<br>
305-
* {@link PythonNativeWrapper} objects given to C
306-
* code may go to native, i.e., a handle will be allocated. In this case, no ref count
307-
* manipulation is done since the C code considers the reference to be borrowed and the Python
308-
* code just doesn't do it because we have a GC. This means that the handle will stay allocated
309-
* and we are leaking the wrapper object.
304+
* {@link PythonNativeWrapper} objects given to C code may go to native, i.e., a handle will be
305+
* allocated. In this case, no ref count manipulation is done since the C code considers the
306+
* reference to be borrowed and the Python code just doesn't do it because we have a GC. This
307+
* means that the handle will stay allocated and we are leaking the wrapper object.
310308
* </p>
311309
*/
312310
abstract static class ReleaseNativeWrapperNode extends Node {

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/capi/CAPIConversionNodeSupplier.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/capi/CExtNodes.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,8 +1197,8 @@ static PInt doBoolNativeWrapper(DynamicObjectNativeWrapper.PrimitiveNativeWrappe
11971197

11981198
@Specialization(guards = {"!isMaterialized(object, lib)", "object.isByte()"}, limit = "1")
11991199
static PInt doByteNativeWrapper(DynamicObjectNativeWrapper.PrimitiveNativeWrapper object,
1200-
@SuppressWarnings("unused") @CachedLibrary("object") PythonNativeWrapperLibrary lib,
1201-
@Shared("factory") @Cached PythonObjectFactory factory) {
1200+
@SuppressWarnings("unused") @CachedLibrary("object") PythonNativeWrapperLibrary lib,
1201+
@Shared("factory") @Cached PythonObjectFactory factory) {
12021202
PInt materializedInt = factory.createInt(object.getByte());
12031203
object.setMaterializedObject(materializedInt);
12041204
materializedInt.setNativeWrapper(object);
@@ -1544,10 +1544,10 @@ static boolean execute(@SuppressWarnings("unused") String opName, PythonNativeOb
15441544

15451545
@Specialization(guards = "cachedOpName.equals(opName)", limit = "1")
15461546
static boolean execute(@SuppressWarnings("unused") String opName, PythonNativeVoidPtr a, long b,
1547-
@Shared("cachedOpName") @Cached("opName") @SuppressWarnings("unused") String cachedOpName,
1548-
@Shared("op") @Cached(value = "findOp(opName)", allowUncached = true) int op,
1549-
@CachedLibrary(limit = "1") InteropLibrary interopLibrary,
1550-
@Shared("importCAPISymbolNode") @Cached ImportCAPISymbolNode importCAPISymbolNode) {
1547+
@Shared("cachedOpName") @Cached("opName") @SuppressWarnings("unused") String cachedOpName,
1548+
@Shared("op") @Cached(value = "findOp(opName)", allowUncached = true) int op,
1549+
@CachedLibrary(limit = "1") InteropLibrary interopLibrary,
1550+
@Shared("importCAPISymbolNode") @Cached ImportCAPISymbolNode importCAPISymbolNode) {
15511551
return executeCFunction(op, a.getPointerObject(), b, interopLibrary, importCAPISymbolNode);
15521552
}
15531553

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/capi/HandleCache.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ abstract static class GetOrInsertNode extends Node {
107107
assumptions = "singleContextAssumption()", //
108108
rewriteOn = InvalidAssumptionException.class)
109109
static PythonNativeWrapper doCachedSingleContext(@SuppressWarnings("unused") HandleCache cache, @SuppressWarnings("unused") long handle,
110-
@Cached("handle") @SuppressWarnings("unused") long cachedHandle,
111-
@Cached("resolveHandleUncached(cache, handle)") PythonNativeWrapper cachedValue,
112-
@Cached("getHandleValidAssumption(cachedValue)") Assumption associationValidAssumption) throws InvalidAssumptionException {
110+
@Cached("handle") @SuppressWarnings("unused") long cachedHandle,
111+
@Cached("resolveHandleUncached(cache, handle)") PythonNativeWrapper cachedValue,
112+
@Cached("getHandleValidAssumption(cachedValue)") Assumption associationValidAssumption) throws InvalidAssumptionException {
113113
associationValidAssumption.check();
114114
return cachedValue;
115115
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/capi/NativeReferenceCache.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,10 @@ static Object doNativeWrapper(Object pointerObject, @SuppressWarnings("unused")
121121
assumptions = "singleContextAssumption()", //
122122
limit = "1")
123123
static PythonAbstractNativeObject doCachedPointer(@SuppressWarnings("unused") Object pointerObject, @SuppressWarnings("unused") Object refCnt, boolean steal,
124-
@Shared("context") @CachedContext(PythonLanguage.class) @SuppressWarnings("unused") PythonContext context,
125-
@Shared("stealProfile") @Cached("createBinaryProfile()") ConditionProfile stealProfile,
126-
@Cached("lookupNativeReference(context, pointerObject, refCnt)") NativeObjectReference ref,
127-
@CachedLibrary(limit = "2") @SuppressWarnings("unused") InteropLibrary interoplibrary) {
124+
@Shared("context") @CachedContext(PythonLanguage.class) @SuppressWarnings("unused") PythonContext context,
125+
@Shared("stealProfile") @Cached("createBinaryProfile()") ConditionProfile stealProfile,
126+
@Cached("lookupNativeReference(context, pointerObject, refCnt)") NativeObjectReference ref,
127+
@CachedLibrary(limit = "2") @SuppressWarnings("unused") InteropLibrary interoplibrary) {
128128
PythonAbstractNativeObject wrapper = ref.get();
129129
if (wrapper != null) {
130130
// If this is stealing the reference, we need to fixup the managed reference count.

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/capi/PGetDynamicTypeNode.java

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,43 @@
1+
/*
2+
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* The Universal Permissive License (UPL), Version 1.0
6+
*
7+
* Subject to the condition set forth below, permission is hereby granted to any
8+
* person obtaining a copy of this software, associated documentation and/or
9+
* data (collectively the "Software"), free of charge and under any and all
10+
* copyright rights in the Software, and any and all patent rights owned or
11+
* freely licensable by each licensor hereunder covering either (i) the
12+
* unmodified Software as contributed to or provided by such licensor, or (ii)
13+
* the Larger Works (as defined below), to deal in both
14+
*
15+
* (a) the Software, and
16+
*
17+
* (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if
18+
* one is included with the Software each a "Larger Work" to which the Software
19+
* is contributed by such licensors),
20+
*
21+
* without restriction, including without limitation the rights to copy, create
22+
* derivative works of, display, perform, and distribute the Software and make,
23+
* use, sell, offer for sale, import, export, have made, and have sold the
24+
* Software and the Larger Work(s), and to sublicense the foregoing rights on
25+
* either these or other terms.
26+
*
27+
* This license is subject to the following condition:
28+
*
29+
* The above copyright notice and either this complete permission notice or at a
30+
* minimum a reference to the UPL must be included in all copies or substantial
31+
* portions of the Software.
32+
*
33+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
34+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
35+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
36+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
37+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
38+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
39+
* SOFTWARE.
40+
*/
141
package com.oracle.graal.python.builtins.objects.cext.capi;
242

343
import com.oracle.graal.python.PythonLanguage;

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/capi/PyBufferProcsWrapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/capi/PyDateTimeMRNode.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
package com.oracle.graal.python.builtins.objects.cext.capi;
4242

4343
import com.oracle.graal.python.builtins.objects.PythonAbstractObject.PInteropGetAttributeNode;
44-
import com.oracle.graal.python.builtins.objects.cext.capi.PyDateTimeMRNodeGen;
4544
import com.oracle.graal.python.builtins.objects.cext.capi.CArrayWrappers.CByteArrayWrapper;
4645
import com.oracle.graal.python.builtins.objects.object.PythonObject;
4746
import com.oracle.graal.python.builtins.objects.object.PythonObjectLibrary;

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/capi/PythonNativeWrapperLibrary.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0

0 commit comments

Comments
 (0)