|
138 | 138 | import com.oracle.truffle.api.Assumption;
|
139 | 139 | import com.oracle.truffle.api.CompilerAsserts;
|
140 | 140 | import com.oracle.truffle.api.CompilerDirectives;
|
141 |
| -import com.oracle.truffle.api.CompilerDirectives.CompilationFinal; |
142 | 141 | import com.oracle.truffle.api.TruffleLanguage.ContextReference;
|
143 | 142 | import com.oracle.truffle.api.TruffleLogger;
|
144 | 143 | import com.oracle.truffle.api.dsl.Cached;
|
@@ -449,32 +448,32 @@ static Object doPythonClassUncached(@SuppressWarnings("unused") CExtContext cext
|
449 | 448 | return PythonClassNativeWrapper.wrap(object, getNameNode.execute(object));
|
450 | 449 | }
|
451 | 450 |
|
452 |
| - @Specialization(guards = {"cachedClass == object.getClass()", "!isClass(object, lib)", "!isNativeObject(object)", "!isSpecialSingleton(object)"}, limit = "3") |
| 451 | + @Specialization(guards = {"cachedClass == object.getClass()", "!isClass(object, lib)", "!isNativeObject(object)", "!isSpecialSingleton(object)"}) |
453 | 452 | static Object runAbstractObjectCached(@SuppressWarnings("unused") CExtContext cextContext, PythonAbstractObject object,
|
454 | 453 | @Cached("createBinaryProfile()") ConditionProfile noWrapperProfile,
|
455 | 454 | @Cached("object.getClass()") Class<? extends PythonAbstractObject> cachedClass,
|
456 |
| - @SuppressWarnings("unused") @CachedLibrary("object") InteropLibrary lib) { |
| 455 | + @SuppressWarnings("unused") @CachedLibrary(limit = "3") InteropLibrary lib) { |
457 | 456 | assert object != PNone.NO_VALUE;
|
458 | 457 | return PythonObjectNativeWrapper.wrap(CompilerDirectives.castExact(object, cachedClass), noWrapperProfile);
|
459 | 458 | }
|
460 | 459 |
|
461 |
| - @Specialization(guards = {"!isClass(object, lib)", "!isNativeObject(object)", "!isSpecialSingleton(object)"}, replaces = "runAbstractObjectCached", limit = "3") |
| 460 | + @Specialization(guards = {"!isClass(object, lib)", "!isNativeObject(object)", "!isSpecialSingleton(object)"}, replaces = "runAbstractObjectCached") |
462 | 461 | static Object runAbstractObject(@SuppressWarnings("unused") CExtContext cextContext, PythonAbstractObject object,
|
463 | 462 | @Cached("createBinaryProfile()") ConditionProfile noWrapperProfile,
|
464 |
| - @SuppressWarnings("unused") @CachedLibrary("object") InteropLibrary lib) { |
| 463 | + @SuppressWarnings("unused") @CachedLibrary(limit = "3") InteropLibrary lib) { |
465 | 464 | assert object != PNone.NO_VALUE;
|
466 | 465 | return PythonObjectNativeWrapper.wrap(object, noWrapperProfile);
|
467 | 466 | }
|
468 | 467 |
|
469 |
| - @Specialization(guards = {"lib.isForeignObject(object)", "!isNativeWrapper(object)", "!isNativeNull(object)"}, limit = "3") |
| 468 | + @Specialization(guards = {"lib.isForeignObject(object)", "!isNativeWrapper(object)", "!isNativeNull(object)"}) |
470 | 469 | static Object doForeignObject(@SuppressWarnings("unused") CExtContext cextContext, TruffleObject object,
|
471 |
| - @SuppressWarnings("unused") @CachedLibrary("object") PythonObjectLibrary lib) { |
| 470 | + @SuppressWarnings("unused") @CachedLibrary(limit = "3") PythonObjectLibrary lib) { |
472 | 471 | return TruffleObjectNativeWrapper.wrap(object);
|
473 | 472 | }
|
474 | 473 |
|
475 |
| - @Specialization(guards = "isFallback(object, lib)", limit = "1") |
| 474 | + @Specialization(guards = "isFallback(object, lib)") |
476 | 475 | static Object run(@SuppressWarnings("unused") CExtContext cextContext, Object object,
|
477 |
| - @SuppressWarnings("unused") @CachedLibrary("object") PythonObjectLibrary lib) { |
| 476 | + @SuppressWarnings("unused") @CachedLibrary(limit = "3") PythonObjectLibrary lib) { |
478 | 477 | assert object != null : "Java 'null' cannot be a Sulong value";
|
479 | 478 | Object o = lib.getDelegatedValue(object);
|
480 | 479 | assert CApiGuards.isNativeWrapper(o) : "unknown object cannot be a Sulong value";
|
@@ -687,33 +686,33 @@ static Object doPythonClassUncached(@SuppressWarnings("unused") CExtContext cext
|
687 | 686 | return PythonClassNativeWrapper.wrapNewRef(object, getNameNode.execute(object));
|
688 | 687 | }
|
689 | 688 |
|
690 |
| - @Specialization(guards = {"cachedClass == object.getClass()", "!isClass(object, lib)", "!isNativeObject(object)", "!isSpecialSingleton(object)"}, limit = "3") |
| 689 | + @Specialization(guards = {"cachedClass == object.getClass()", "!isClass(object, lib)", "!isNativeObject(object)", "!isSpecialSingleton(object)"}) |
691 | 690 | static Object runAbstractObjectCached(@SuppressWarnings("unused") CExtContext cextContext, PythonAbstractObject object,
|
692 | 691 | @Cached("createBinaryProfile()") ConditionProfile noWrapperProfile,
|
693 | 692 | @Cached("object.getClass()") Class<? extends PythonAbstractObject> cachedClass,
|
694 |
| - @SuppressWarnings("unused") @CachedLibrary("object") InteropLibrary lib) { |
| 693 | + @SuppressWarnings("unused") @CachedLibrary(limit = "3") InteropLibrary lib) { |
695 | 694 | assert object != PNone.NO_VALUE;
|
696 | 695 | return PythonObjectNativeWrapper.wrapNewRef(CompilerDirectives.castExact(object, cachedClass), noWrapperProfile);
|
697 | 696 | }
|
698 | 697 |
|
699 |
| - @Specialization(guards = {"!isClass(object, lib)", "!isNativeObject(object)", "!isSpecialSingleton(object)"}, replaces = "runAbstractObjectCached", limit = "3") |
| 698 | + @Specialization(guards = {"!isClass(object, lib)", "!isNativeObject(object)", "!isSpecialSingleton(object)"}, replaces = "runAbstractObjectCached") |
700 | 699 | static Object runAbstractObject(@SuppressWarnings("unused") CExtContext cextContext, PythonAbstractObject object,
|
701 | 700 | @Cached("createBinaryProfile()") ConditionProfile noWrapperProfile,
|
702 |
| - @SuppressWarnings("unused") @CachedLibrary("object") InteropLibrary lib) { |
| 701 | + @SuppressWarnings("unused") @CachedLibrary(limit = "3") InteropLibrary lib) { |
703 | 702 | assert object != PNone.NO_VALUE;
|
704 | 703 | return PythonObjectNativeWrapper.wrapNewRef(object, noWrapperProfile);
|
705 | 704 | }
|
706 | 705 |
|
707 |
| - @Specialization(guards = {"lib.isForeignObject(object)", "!isNativeWrapper(object)", "!isNativeNull(object)"}, limit = "3") |
| 706 | + @Specialization(guards = {"lib.isForeignObject(object)", "!isNativeWrapper(object)", "!isNativeNull(object)"}) |
708 | 707 | static Object doForeignObject(CExtContext cextContext, TruffleObject object,
|
709 |
| - @CachedLibrary("object") PythonObjectLibrary lib) { |
| 708 | + @CachedLibrary(limit = "3") PythonObjectLibrary lib) { |
710 | 709 | // this will always be a new wrapper; it's implicitly always a new reference in any case
|
711 | 710 | return ToSulongNode.doForeignObject(cextContext, object, lib);
|
712 | 711 | }
|
713 | 712 |
|
714 |
| - @Specialization(guards = "isFallback(object, lib)", limit = "1") |
| 713 | + @Specialization(guards = "isFallback(object, lib)") |
715 | 714 | static Object run(CExtContext cextContext, Object object,
|
716 |
| - @CachedLibrary("object") PythonObjectLibrary lib) { |
| 715 | + @CachedLibrary(limit = "3") PythonObjectLibrary lib) { |
717 | 716 | return ToSulongNode.run(cextContext, object, lib);
|
718 | 717 | }
|
719 | 718 |
|
@@ -850,33 +849,33 @@ static Object doPythonClassUncached(@SuppressWarnings("unused") CExtContext cext
|
850 | 849 | return PythonClassNativeWrapper.wrapNewRef(object, getNameNode.execute(object));
|
851 | 850 | }
|
852 | 851 |
|
853 |
| - @Specialization(guards = {"cachedClass == object.getClass()", "!isClass(object, lib)", "!isNativeObject(object)", "!isSpecialSingleton(object)"}, limit = "3") |
| 852 | + @Specialization(guards = {"cachedClass == object.getClass()", "!isClass(object, lib)", "!isNativeObject(object)", "!isSpecialSingleton(object)"}) |
854 | 853 | static Object runAbstractObjectCached(@SuppressWarnings("unused") CExtContext cextContext, PythonAbstractObject object,
|
855 | 854 | @Cached("createBinaryProfile()") ConditionProfile noWrapperProfile,
|
856 | 855 | @Cached("object.getClass()") Class<? extends PythonAbstractObject> cachedClass,
|
857 |
| - @SuppressWarnings("unused") @CachedLibrary("object") InteropLibrary lib) { |
| 856 | + @SuppressWarnings("unused") @CachedLibrary(limit = "3") InteropLibrary lib) { |
858 | 857 | assert object != PNone.NO_VALUE;
|
859 | 858 | return PythonObjectNativeWrapper.wrapNewRef(CompilerDirectives.castExact(object, cachedClass), noWrapperProfile);
|
860 | 859 | }
|
861 | 860 |
|
862 |
| - @Specialization(guards = {"!isClass(object, lib)", "!isNativeObject(object)", "!isSpecialSingleton(object)"}, replaces = "runAbstractObjectCached", limit = "3") |
| 861 | + @Specialization(guards = {"!isClass(object, lib)", "!isNativeObject(object)", "!isSpecialSingleton(object)"}, replaces = "runAbstractObjectCached") |
863 | 862 | static Object runAbstractObject(@SuppressWarnings("unused") CExtContext cextContext, PythonAbstractObject object,
|
864 | 863 | @Cached("createBinaryProfile()") ConditionProfile noWrapperProfile,
|
865 |
| - @SuppressWarnings("unused") @CachedLibrary("object") InteropLibrary lib) { |
| 864 | + @SuppressWarnings("unused") @CachedLibrary(limit = "3") InteropLibrary lib) { |
866 | 865 | assert object != PNone.NO_VALUE;
|
867 | 866 | return PythonObjectNativeWrapper.wrapNewRef(object, noWrapperProfile);
|
868 | 867 | }
|
869 | 868 |
|
870 |
| - @Specialization(guards = {"lib.isForeignObject(object)", "!isNativeWrapper(object)", "!isNativeNull(object)"}, limit = "3") |
| 869 | + @Specialization(guards = {"lib.isForeignObject(object)", "!isNativeWrapper(object)", "!isNativeNull(object)"}) |
871 | 870 | static Object doForeignObject(CExtContext cextContext, TruffleObject object,
|
872 |
| - @CachedLibrary("object") PythonObjectLibrary lib) { |
| 871 | + @CachedLibrary(limit = "3") PythonObjectLibrary lib) { |
873 | 872 | // this will always be a new wrapper; it's implicitly always a new reference in any case
|
874 | 873 | return ToSulongNode.doForeignObject(cextContext, object, lib);
|
875 | 874 | }
|
876 | 875 |
|
877 |
| - @Specialization(guards = "isFallback(object, lib)", limit = "1") |
| 876 | + @Specialization(guards = "isFallback(object, lib)") |
878 | 877 | static Object run(CExtContext cextContext, Object object,
|
879 |
| - @CachedLibrary("object") PythonObjectLibrary lib) { |
| 878 | + @CachedLibrary(limit = "3") PythonObjectLibrary lib) { |
880 | 879 | return ToSulongNode.run(cextContext, object, lib);
|
881 | 880 | }
|
882 | 881 |
|
@@ -2493,7 +2492,6 @@ public abstract static class MayRaiseUnaryNode extends PythonUnaryBuiltinNode {
|
2493 | 2492 | @Child private CreateArgumentsNode createArgsNode;
|
2494 | 2493 | @Child private FunctionInvokeNode invokeNode;
|
2495 | 2494 | @Child private TransformExceptionToNativeNode transformExceptionToNativeNode;
|
2496 |
| - @CompilationFinal private ConditionProfile frameProfile; |
2497 | 2495 |
|
2498 | 2496 | private final PFunction func;
|
2499 | 2497 | private final Object errorResult;
|
@@ -2532,7 +2530,6 @@ public abstract static class MayRaiseBinaryNode extends PythonBinaryBuiltinNode
|
2532 | 2530 | @Child private CreateArgumentsNode createArgsNode;
|
2533 | 2531 | @Child private FunctionInvokeNode invokeNode;
|
2534 | 2532 | @Child private TransformExceptionToNativeNode transformExceptionToNativeNode;
|
2535 |
| - @CompilationFinal private ConditionProfile frameProfile; |
2536 | 2533 |
|
2537 | 2534 | private final PFunction func;
|
2538 | 2535 | private final Object errorResult;
|
@@ -2571,7 +2568,6 @@ public abstract static class MayRaiseTernaryNode extends PythonTernaryBuiltinNod
|
2571 | 2568 | @Child private CreateArgumentsNode createArgsNode;
|
2572 | 2569 | @Child private FunctionInvokeNode invokeNode;
|
2573 | 2570 | @Child private TransformExceptionToNativeNode transformExceptionToNativeNode;
|
2574 |
| - @CompilationFinal private ConditionProfile frameProfile; |
2575 | 2571 |
|
2576 | 2572 | private final PFunction func;
|
2577 | 2573 | private final Object errorResult;
|
@@ -2611,7 +2607,6 @@ public static class MayRaiseNode extends PythonBuiltinNode {
|
2611 | 2607 | @Child private ReadVarArgsNode readVarargsNode;
|
2612 | 2608 | @Child private CreateArgumentsNode createArgsNode;
|
2613 | 2609 | @Child private TransformExceptionToNativeNode transformExceptionToNativeNode;
|
2614 |
| - @CompilationFinal private ConditionProfile frameProfile; |
2615 | 2610 |
|
2616 | 2611 | private final PFunction func;
|
2617 | 2612 | private final Object errorResult;
|
@@ -2893,10 +2888,6 @@ public final int raiseIntWithoutFrame(int errorValue, Object errType, String for
|
2893 | 2888 | return executeInt(null, errorValue, errType, format, arguments);
|
2894 | 2889 | }
|
2895 | 2890 |
|
2896 |
| - public final Object raiseWithoutFrame(Object errorValue, Object errType, String format, Object... arguments) { |
2897 |
| - return execute(null, errorValue, errType, format, arguments); |
2898 |
| - } |
2899 |
| - |
2900 | 2891 | public abstract Object execute(Frame frame, Object errorValue, Object errType, String format, Object[] arguments);
|
2901 | 2892 |
|
2902 | 2893 | public abstract int executeInt(Frame frame, int errorValue, Object errType, String format, Object[] arguments);
|
|
0 commit comments