|
38 | 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
39 | 39 | * SOFTWARE.
|
40 | 40 | */
|
| 41 | +// skip GIL |
41 | 42 | package com.oracle.graal.python.builtins.objects.cext;
|
42 | 43 |
|
43 | 44 | import com.oracle.graal.python.builtins.PythonBuiltinClassType;
|
44 | 45 | import com.oracle.graal.python.builtins.objects.PythonAbstractObject;
|
45 | 46 | import com.oracle.graal.python.builtins.objects.function.PArguments.ThreadState;
|
46 | 47 | import com.oracle.graal.python.builtins.objects.object.PythonObjectLibrary;
|
47 |
| -import com.oracle.graal.python.runtime.GilNode; |
48 | 48 | import com.oracle.truffle.api.CompilerAsserts;
|
49 | 49 | import com.oracle.truffle.api.CompilerDirectives;
|
50 | 50 | import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
|
51 |
| -import com.oracle.truffle.api.dsl.Cached; |
52 |
| -import com.oracle.truffle.api.dsl.Cached.Exclusive; |
53 | 51 | import com.oracle.truffle.api.interop.InteropLibrary;
|
54 | 52 | import com.oracle.truffle.api.interop.TruffleObject;
|
55 | 53 | import com.oracle.truffle.api.interop.UnsupportedMessageException;
|
@@ -121,20 +119,15 @@ public String toString() {
|
121 | 119 |
|
122 | 120 | @ExportMessage(limit = "2")
|
123 | 121 | long hashWithState(@SuppressWarnings("unused") ThreadState state,
|
124 |
| - @CachedLibrary("this.getPointerObject()") InteropLibrary lib, @Exclusive @Cached GilNode gil) { |
125 |
| - boolean mustRelease = gil.acquire(); |
126 |
| - try { |
127 |
| - if (lib.hasIdentity(object)) { |
128 |
| - try { |
129 |
| - return lib.identityHashCode(object); |
130 |
| - } catch (UnsupportedMessageException e) { |
131 |
| - CompilerDirectives.shouldNotReachHere(e); |
132 |
| - } |
| 122 | + @CachedLibrary("this.getPointerObject()") InteropLibrary lib) { |
| 123 | + if (lib.hasIdentity(object)) { |
| 124 | + try { |
| 125 | + return lib.identityHashCode(object); |
| 126 | + } catch (UnsupportedMessageException e) { |
| 127 | + CompilerDirectives.shouldNotReachHere(e); |
133 | 128 | }
|
134 |
| - return hashCodeBoundary(object); |
135 |
| - } finally { |
136 |
| - gil.release(mustRelease); |
137 | 129 | }
|
| 130 | + return hashCodeBoundary(object); |
138 | 131 | }
|
139 | 132 |
|
140 | 133 | @TruffleBoundary
|
|
0 commit comments