Skip to content

Commit a8f8e23

Browse files
committed
[GR-29716] Update HPy Import.
PullRequest: graalpython/1683
2 parents 4d9612b + 6834943 commit a8f8e23

34 files changed

+1294
-645
lines changed

graalpython/com.oracle.graal.python.cext/include/common/autogen_hpyfunc_declare.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
/*
2626
DO NOT EDIT THIS FILE!
2727
28-
This file is automatically generated by tools/autogen.py from tools/public_api.h.
28+
This file is automatically generated by hpy.tools.autogen.hpyfunc.autogen_hpyfunc_declare_h
29+
See also hpy.tools.autogen and hpy/tools/public_api.h
30+
2931
Run this to regenerate:
3032
make autogen
3133

graalpython/com.oracle.graal.python.cext/include/common/autogen_hpyslot.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
/*
2626
DO NOT EDIT THIS FILE!
2727
28-
This file is automatically generated by tools/autogen.py from tools/public_api.h.
28+
This file is automatically generated by hpy.tools.autogen.hpyslot.autogen_hpyslot_h
29+
See also hpy.tools.autogen and hpy/tools/public_api.h
30+
2931
Run this to regenerate:
3032
make autogen
3133

graalpython/com.oracle.graal.python.cext/include/common/autogen_impl.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
/*
2626
DO NOT EDIT THIS FILE!
2727
28-
This file is automatically generated by tools/autogen.py from tools/public_api.h.
28+
This file is automatically generated by hpy.tools.autogen.trampolines.autogen_impl_h
29+
See also hpy.tools.autogen and hpy/tools/public_api.h
30+
2931
Run this to regenerate:
3032
make autogen
3133
@@ -291,6 +293,11 @@ HPyAPI_STORAGE HPy _HPy_IMPL_NAME_NOPREFIX(InPlaceOr)(HPyContext ctx, HPy h1, HP
291293
return _py2h(PyNumber_InPlaceOr(_h2py(h1), _h2py(h2)));
292294
}
293295

296+
HPyAPI_STORAGE int _HPy_IMPL_NAME(Callable_Check)(HPyContext ctx, HPy h)
297+
{
298+
return PyCallable_Check(_h2py(h));
299+
}
300+
294301
HPyAPI_STORAGE void _HPy_IMPL_NAME(Err_SetString)(HPyContext ctx, HPy h_type, const char *message)
295302
{
296303
PyErr_SetString(_h2py(h_type), message);
@@ -471,3 +478,8 @@ HPyAPI_STORAGE HPy _HPy_IMPL_NAME(Dict_New)(HPyContext ctx)
471478
return _py2h(PyDict_New());
472479
}
473480

481+
HPyAPI_STORAGE int _HPy_IMPL_NAME(Tuple_Check)(HPyContext ctx, HPy h)
482+
{
483+
return PyTuple_Check(_h2py(h));
484+
}
485+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/* MIT License
2+
*
3+
* Copyright (c) 2021, Oracle and/or its affiliates.
4+
* Copyright (c) 2019 pyhandle
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in all
14+
* copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
* SOFTWARE.
23+
*/
24+
25+
#ifndef HPY_COMMON_RUNTIME_CALL_H
26+
#define HPY_COMMON_RUNTIME_CALL_H
27+
28+
#include <Python.h>
29+
#include "hpy.h"
30+
31+
_HPy_HIDDEN HPy
32+
ctx_CallTupleDict(HPyContext ctx, HPy callable, HPy args, HPy kw);
33+
34+
#endif /* HPY_COMMON_RUNTIME_CALL_H */

graalpython/com.oracle.graal.python.cext/include/common/version.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@
2323
*/
2424

2525
// automatically generated by setup.py:get_scm_config()
26-
#define HPY_VERSION "0.1.dev875+g7c832a2"
27-
#define HPY_GIT_REVISION "7c832a2"
26+
#define HPY_VERSION "0.1.dev950+g98f448a"
27+
#define HPY_GIT_REVISION "98f448a"

graalpython/com.oracle.graal.python.cext/include/cpython/autogen_hpyfunc_trampolines.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
/*
2727
DO NOT EDIT THIS FILE!
2828
29-
This file is automatically generated by tools/autogen.py from tools/public_api.h.
29+
This file is automatically generated by hpy.tools.autogen.hpyfunc.autogen_cpython_hpyfunc_trampoline_h
30+
See also hpy.tools.autogen and hpy/tools/public_api.h
31+
3032
Run this to regenerate:
3133
make autogen
3234

graalpython/com.oracle.graal.python.cext/include/cpython/hpy.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ HPy_AsPyObject(HPyContext ctx, HPy h)
296296
#include "../common/hpydef.h"
297297
#include "../common/hpytype.h"
298298
#include "../common/hpymodule.h"
299+
#include "../common/runtime/ctx_call.h"
299300
#include "../common/runtime/ctx_module.h"
300301
#include "../common/runtime/ctx_type.h"
301302
#include "../common/runtime/ctx_listbuilder.h"
@@ -339,6 +340,12 @@ _HPy_Cast(HPyContext ctx, HPy h)
339340
return ctx_Cast(ctx, h);
340341
}
341342

343+
HPyAPI_FUNC(HPy)
344+
HPy_CallTupleDict(HPyContext ctx, HPy callable, HPy args, HPy kw)
345+
{
346+
return ctx_CallTupleDict(ctx, callable, args, kw);
347+
}
348+
342349
HPyAPI_FUNC(HPyListBuilder)
343350
HPyListBuilder_New(HPyContext ctx, HPy_ssize_t initial_size)
344351
{

graalpython/com.oracle.graal.python.cext/include/universal/autogen_ctx.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
/*
2727
DO NOT EDIT THIS FILE!
2828
29-
This file is automatically generated by tools/autogen.py from tools/public_api.h.
29+
This file is automatically generated by hpy.tools.autogen.ctx.autogen_ctx_h
30+
See also hpy.tools.autogen and hpy/tools/public_api.h
31+
3032
Run this to regenerate:
3133
make autogen
3234
@@ -171,6 +173,9 @@ struct _HPyContext_s {
171173
HPy (*ctx_InPlaceAnd)(HPyContext ctx, HPy h1, HPy h2);
172174
HPy (*ctx_InPlaceXor)(HPyContext ctx, HPy h1, HPy h2);
173175
HPy (*ctx_InPlaceOr)(HPyContext ctx, HPy h1, HPy h2);
176+
int (*ctx_Callable_Check)(HPyContext ctx, HPy h);
177+
HPy (*ctx_CallTupleDict)(HPyContext ctx, HPy callable, HPy args, HPy kw);
178+
void (*ctx_FatalError)(HPyContext ctx, const char *message);
174179
void (*ctx_Err_SetString)(HPyContext ctx, HPy h_type, const char *message);
175180
void (*ctx_Err_SetObject)(HPyContext ctx, HPy h_type, HPy h_value);
176181
int (*ctx_Err_Occurred)(HPyContext ctx);
@@ -216,8 +221,8 @@ struct _HPyContext_s {
216221
int (*ctx_List_Append)(HPyContext ctx, HPy h_list, HPy h_item);
217222
int (*ctx_Dict_Check)(HPyContext ctx, HPy h);
218223
HPy (*ctx_Dict_New)(HPyContext ctx);
219-
void (*ctx_FatalError)(HPyContext ctx, const char *message);
220224
HPy (*ctx_Tuple_FromArray)(HPyContext ctx, _HPyPtr items, HPy_ssize_t n);
225+
int (*ctx_Tuple_Check)(HPyContext ctx, HPy h);
221226
HPy (*ctx_FromPyObject)(HPyContext ctx, cpy_PyObject *obj);
222227
cpy_PyObject *(*ctx_AsPyObject)(HPyContext ctx, HPy h);
223228
void (*ctx_CallRealFunctionFromTrampoline)(HPyContext ctx, HPyFunc_Signature sig, void *func, void *args);

graalpython/com.oracle.graal.python.cext/include/universal/autogen_hpyfunc_trampolines.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
/*
2727
DO NOT EDIT THIS FILE!
2828
29-
This file is automatically generated by tools/autogen.py from tools/public_api.h.
29+
This file is automatically generated by hpy.tools.autogen.hpyfunc.autogen_hpyfunc_trampoline_h
30+
See also hpy.tools.autogen and hpy/tools/public_api.h
31+
3032
Run this to regenerate:
3133
make autogen
3234

graalpython/com.oracle.graal.python.cext/include/universal/autogen_trampolines.h

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
/*
2727
DO NOT EDIT THIS FILE!
2828
29-
This file is automatically generated by tools/autogen.py from tools/public_api.h.
29+
This file is automatically generated by hpy.tools.autogen.trampolines.autogen_trampolines_h
30+
See also hpy.tools.autogen and hpy/tools/public_api.h
31+
3032
Run this to regenerate:
3133
make autogen
3234
@@ -261,6 +263,14 @@ static inline HPy HPy_InPlaceOr(HPyContext ctx, HPy h1, HPy h2) {
261263
return WRAP(ctx->ctx_InPlaceOr ( ctx, UNWRAP(h1), UNWRAP(h2) ));
262264
}
263265

266+
static inline int HPyCallable_Check(HPyContext ctx, HPy h) {
267+
return ctx->ctx_Callable_Check ( ctx, UNWRAP(h) );
268+
}
269+
270+
static inline HPy HPy_CallTupleDict(HPyContext ctx, HPy callable, HPy args, HPy kw) {
271+
return WRAP(ctx->ctx_CallTupleDict ( ctx, UNWRAP(callable), UNWRAP(args), UNWRAP(kw) ));
272+
}
273+
264274
static inline void HPyErr_SetString(HPyContext ctx, HPy h_type, const char *message) {
265275
ctx->ctx_Err_SetString ( ctx, UNWRAP(h_type), message );
266276
}
@@ -437,6 +447,10 @@ static inline HPy HPyDict_New(HPyContext ctx) {
437447
return WRAP(ctx->ctx_Dict_New ( ctx ));
438448
}
439449

450+
static inline int HPyTuple_Check(HPyContext ctx, HPy h) {
451+
return ctx->ctx_Tuple_Check ( ctx, UNWRAP(h) );
452+
}
453+
440454
static inline HPy HPyTuple_FromArray(HPyContext ctx, HPy items[], HPy_ssize_t n) {
441455
return WRAP(ctx->ctx_Tuple_FromArray ( ctx, (_HPyPtr)items, n ));
442456
}

0 commit comments

Comments
 (0)