Skip to content

Commit f125a83

Browse files
committed
- merge funcobject.c and functionsobject.c
- hadle PyStaticMethod args with native_to_java
1 parent 4c2c435 commit f125a83

File tree

2 files changed

+7
-49
lines changed

2 files changed

+7
-49
lines changed

graalpython/com.oracle.graal.python.cext/src/funcobject.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2021, 2022, 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
@@ -41,9 +41,14 @@
4141

4242
#include "capi.h"
4343

44+
PyTypeObject PyFunction_Type = PY_TRUFFLE_TYPE_WITH_VECTORCALL("function", &PyType_Type, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_METHOD_DESCRIPTOR | _Py_TPFLAGS_HAVE_VECTORCALL, sizeof(PyFunctionObject), offsetof(PyFunctionObject, vectorcall));
4445
PyTypeObject PyStaticMethod_Type = PY_TRUFFLE_TYPE("staticmethod", &PyType_Type, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, sizeof(PyType_Type));
4546

4647
UPCALL_ID(PyStaticMethod_New)
4748
PyObject* PyStaticMethod_New(PyObject *callable) {
48-
return UPCALL_CEXT_O(_jls_PyStaticMethod_New, callable);
49+
return UPCALL_CEXT_O(_jls_PyStaticMethod_New, native_to_java(callable));
50+
}
51+
52+
PyObject* PyClassMethod_New(PyObject* method) {
53+
return UPCALL_O(PY_BUILTIN, polyglot_from_string("classmethod", SRC_CS), native_to_java(method));
4954
}

graalpython/com.oracle.graal.python.cext/src/functionobject.c

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)