1 /* call.h 2 * Copyright (C) 2001-2010, Parrot Foundation. 3 * Overview: 4 * Data Structure and Algorithms: 5 * Call argument handling. 6 * History: 7 * Initial version by leo on 2005/07/22 8 * Major changes by mdiep in April 2007 9 * Notes: 10 * References: 11 * pdd03 - Calling Conventions 12 */ 13 14 #ifndef PARROT_INTER_CALL_H_GUARD 15 #define PARROT_INTER_CALL_H_GUARD 16 17 #include "parrot/context.h" 18 19 /* Wrap the jump buffer in a struct, to make it a linked list. Jump buffers are 20 * used to resume execution at a point in the runloop where an exception 21 * handler can be run. Ultimately this information should be part of 22 * Parrot_Context, but at this point a new context isn't created for every 23 * runloop ID, so it still needs to be a separate stack for a while longer. */ 24 25 typedef struct parrot_runloop_t { 26 struct parrot_runloop_t *prev; /* interpreter's runloop 27 * jump buffer stack */ 28 opcode_t *handler_start; /* Used in exception handling */ 29 int id; /* runloop id */ 30 PMC *exception; /* Reference to the exception object */ 31 32 /* let the biggest element cross the cacheline boundary */ 33 Parrot_jump_buff resume; /* jmp_buf */ 34 } parrot_runloop_t; 35 36 typedef parrot_runloop_t Parrot_runloop; 37 38 typedef enum { 39 CALLSIGNATURE_is_exception_FLAG = PObj_private0_FLAG /* last element */ 40 } callsignature_flags_enum; 41 42 #define CALLSIGNATURE_get_FLAGS(o) (PObj_get_FLAGS(o)) 43 #define CALLSIGNATURE_flag_TEST(flag, o) \ 44 (CALLSIGNATURE_get_FLAGS(o) & CALLSIGNATURE_ ## flag ## _FLAG) 45 #define CALLSIGNATURE_flag_SET(flag, o) \ 46 (CALLSIGNATURE_get_FLAGS(o) |= CALLSIGNATURE_ ## flag ## _FLAG) 47 #define CALLSIGNATURE_flag_CLEAR(flag, o) \ 48 (CALLSIGNATURE_get_FLAGS(o) &= ~(UINTVAL)(CALLSIGNATURE_ ## flag ## _FLAG)) 49 50 /* Mark if the CallSignature is for an exception handler */ 51 #define CALLSIGNATURE_is_exception_TEST(o) CALLSIGNATURE_flag_TEST(is_exception, (o)) 52 #define CALLSIGNATURE_is_exception_SET(o) CALLSIGNATURE_flag_SET(is_exception, (o)) 53 #define CALLSIGNATURE_is_exception_CLEAR(o) CALLSIGNATURE_flag_CLEAR(is_exception, (o)) 54 55 /* HEADERIZER BEGIN: src/call/pcc.c */ 56 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ 57 58 PARROT_EXPORT 59 INTVAL Parrot_pcc_do_run_ops(PARROT_INTERP, ARGIN(PMC *sub_obj)) 60 __attribute__nonnull__(1) 61 __attribute__nonnull__(2); 62 63 PARROT_EXPORT 64 void Parrot_pcc_invoke_from_sig_object(PARROT_INTERP, 65 ARGIN(PMC *sub_obj), 66 ARGIN(PMC *call_object)) 67 __attribute__nonnull__(1) 68 __attribute__nonnull__(2) 69 __attribute__nonnull__(3); 70 71 PARROT_EXPORT 72 void Parrot_pcc_invoke_method_from_c_args(PARROT_INTERP, 73 ARGIN(PMC* pmc), 74 ARGMOD(STRING *method_name), 75 ARGIN(const char *signature), 76 ...) 77 __attribute__nonnull__(1) 78 __attribute__nonnull__(2) 79 __attribute__nonnull__(3) 80 __attribute__nonnull__(4) 81 FUNC_MODIFIES(*method_name); 82 83 PARROT_EXPORT 84 void Parrot_pcc_invoke_sub_from_c_args(PARROT_INTERP, 85 ARGIN(PMC *sub_obj), 86 ARGIN(const char *sig), 87 ...) 88 __attribute__nonnull__(1) 89 __attribute__nonnull__(2) 90 __attribute__nonnull__(3); 91 92 PARROT_EXPORT 93 PARROT_CANNOT_RETURN_NULL 94 PARROT_WARN_UNUSED_RESULT 95 PMC * Parrot_pcc_new_call_object(PARROT_INTERP) 96 __attribute__nonnull__(1); 97 98 #define ASSERT_ARGS_Parrot_pcc_do_run_ops __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 99 PARROT_ASSERT_ARG(interp) \ 100 , PARROT_ASSERT_ARG(sub_obj)) 101 #define ASSERT_ARGS_Parrot_pcc_invoke_from_sig_object \ 102 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 103 PARROT_ASSERT_ARG(interp) \ 104 , PARROT_ASSERT_ARG(sub_obj) \ 105 , PARROT_ASSERT_ARG(call_object)) 106 #define ASSERT_ARGS_Parrot_pcc_invoke_method_from_c_args \ 107 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 108 PARROT_ASSERT_ARG(interp) \ 109 , PARROT_ASSERT_ARG(pmc) \ 110 , PARROT_ASSERT_ARG(method_name) \ 111 , PARROT_ASSERT_ARG(signature)) 112 #define ASSERT_ARGS_Parrot_pcc_invoke_sub_from_c_args \ 113 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 114 PARROT_ASSERT_ARG(interp) \ 115 , PARROT_ASSERT_ARG(sub_obj) \ 116 , PARROT_ASSERT_ARG(sig)) 117 #define ASSERT_ARGS_Parrot_pcc_new_call_object __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 118 PARROT_ASSERT_ARG(interp)) 119 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ 120 /* HEADERIZER END: src/call/pcc.c */ 121 122 /* HEADERIZER BEGIN: src/call/ops.c */ 123 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ 124 125 PARROT_EXPORT 126 PARROT_DEPRECATED 127 void free_runloop_jump_point(PARROT_INTERP) 128 __attribute__nonnull__(1); 129 130 PARROT_EXPORT 131 PARROT_DEPRECATED 132 void new_runloop_jump_point(PARROT_INTERP) 133 __attribute__nonnull__(1); 134 135 PARROT_EXPORT 136 void Parrot_runloop_free_jump_point(PARROT_INTERP) 137 __attribute__nonnull__(1); 138 139 PARROT_EXPORT 140 void Parrot_runloop_new_jump_point(PARROT_INTERP) 141 __attribute__nonnull__(1); 142 143 void destroy_runloop_jump_points(PARROT_INTERP) 144 __attribute__nonnull__(1); 145 146 void reset_runloop_id_counter(PARROT_INTERP) 147 __attribute__nonnull__(1); 148 149 void runops(PARROT_INTERP, size_t offs) 150 __attribute__nonnull__(1); 151 152 #define ASSERT_ARGS_free_runloop_jump_point __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 153 PARROT_ASSERT_ARG(interp)) 154 #define ASSERT_ARGS_new_runloop_jump_point __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 155 PARROT_ASSERT_ARG(interp)) 156 #define ASSERT_ARGS_Parrot_runloop_free_jump_point \ 157 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 158 PARROT_ASSERT_ARG(interp)) 159 #define ASSERT_ARGS_Parrot_runloop_new_jump_point __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 160 PARROT_ASSERT_ARG(interp)) 161 #define ASSERT_ARGS_destroy_runloop_jump_points __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 162 PARROT_ASSERT_ARG(interp)) 163 #define ASSERT_ARGS_reset_runloop_id_counter __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 164 PARROT_ASSERT_ARG(interp)) 165 #define ASSERT_ARGS_runops __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 166 PARROT_ASSERT_ARG(interp)) 167 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ 168 /* HEADERIZER END: src/call/ops.c */ 169 170 /* HEADERIZER BEGIN: src/call/args.c */ 171 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ 172 173 PARROT_EXPORT 174 PARROT_WARN_UNUSED_RESULT 175 PARROT_CANNOT_RETURN_NULL 176 PMC* Parrot_pcc_build_call_from_c_args(PARROT_INTERP, 177 ARGIN_NULLOK(PMC *signature), 178 ARGIN(const char *sig), 179 ...) 180 __attribute__nonnull__(1) 181 __attribute__nonnull__(3); 182 183 PARROT_EXPORT 184 PARROT_WARN_UNUSED_RESULT 185 PARROT_CANNOT_RETURN_NULL 186 PMC* Parrot_pcc_build_call_from_varargs(PARROT_INTERP, 187 ARGIN_NULLOK(PMC *signature), 188 ARGIN(const char *sig), 189 ARGMOD(va_list *args)) 190 __attribute__nonnull__(1) 191 __attribute__nonnull__(3) 192 __attribute__nonnull__(4) 193 FUNC_MODIFIES(*args); 194 195 PARROT_EXPORT 196 PARROT_WARN_UNUSED_RESULT 197 PARROT_CANNOT_RETURN_NULL 198 PMC* Parrot_pcc_build_sig_object_from_op(PARROT_INTERP, 199 ARGIN_NULLOK(PMC *signature), 200 ARGIN(PMC *raw_sig), 201 ARGIN(opcode_t *raw_args)) 202 __attribute__nonnull__(1) 203 __attribute__nonnull__(3) 204 __attribute__nonnull__(4); 205 206 PARROT_EXPORT 207 PARROT_WARN_UNUSED_RESULT 208 PARROT_CANNOT_RETURN_NULL 209 PMC* Parrot_pcc_build_sig_object_from_varargs(PARROT_INTERP, 210 ARGIN_NULLOK(PMC *obj), 211 ARGIN(const char *sig), 212 va_list args) 213 __attribute__nonnull__(1) 214 __attribute__nonnull__(3); 215 216 PARROT_EXPORT 217 void Parrot_pcc_fill_params_from_c_args(PARROT_INTERP, 218 ARGMOD(PMC *call_object), 219 ARGIN(const char *signature), 220 ...) 221 __attribute__nonnull__(1) 222 __attribute__nonnull__(2) 223 __attribute__nonnull__(3) 224 FUNC_MODIFIES(*call_object); 225 226 PARROT_EXPORT 227 void Parrot_pcc_fill_params_from_op(PARROT_INTERP, 228 ARGMOD_NULLOK(PMC *call_object), 229 ARGIN(PMC *raw_sig), 230 ARGIN(opcode_t *raw_params), 231 Errors_classes direction) 232 __attribute__nonnull__(1) 233 __attribute__nonnull__(3) 234 __attribute__nonnull__(4) 235 FUNC_MODIFIES(*call_object); 236 237 PARROT_EXPORT 238 void Parrot_pcc_fill_params_from_varargs(PARROT_INTERP, 239 ARGMOD_NULLOK(PMC *call_object), 240 ARGIN(const char *signature), 241 ARGMOD(va_list *args), 242 Errors_classes direction) 243 __attribute__nonnull__(1) 244 __attribute__nonnull__(3) 245 __attribute__nonnull__(4) 246 FUNC_MODIFIES(*call_object) 247 FUNC_MODIFIES(*args); 248 249 PARROT_EXPORT 250 void Parrot_pcc_set_call_from_c_args(PARROT_INTERP, 251 ARGIN(PMC *signature), 252 ARGIN(const char *sig), 253 ...) 254 __attribute__nonnull__(1) 255 __attribute__nonnull__(2) 256 __attribute__nonnull__(3); 257 258 PARROT_EXPORT 259 void Parrot_pcc_set_call_from_varargs(PARROT_INTERP, 260 ARGIN(PMC *signature), 261 ARGIN(const char *sig), 262 ARGMOD(va_list *args)) 263 __attribute__nonnull__(1) 264 __attribute__nonnull__(2) 265 __attribute__nonnull__(3) 266 __attribute__nonnull__(4) 267 FUNC_MODIFIES(*args); 268 269 void Parrot_pcc_merge_signature_for_tailcall(PARROT_INTERP, 270 ARGMOD(PMC *parent), 271 ARGMOD(PMC *tailcall)) 272 __attribute__nonnull__(1) 273 __attribute__nonnull__(2) 274 __attribute__nonnull__(3) 275 FUNC_MODIFIES(*parent) 276 FUNC_MODIFIES(*tailcall); 277 278 PARROT_CAN_RETURN_NULL 279 void Parrot_pcc_parse_signature_string(PARROT_INTERP, 280 ARGIN(STRING *signature), 281 ARGMOD(PMC **arg_flags), 282 ARGMOD(PMC **return_flags)) 283 __attribute__nonnull__(1) 284 __attribute__nonnull__(2) 285 __attribute__nonnull__(3) 286 __attribute__nonnull__(4) 287 FUNC_MODIFIES(*arg_flags) 288 FUNC_MODIFIES(*return_flags); 289 290 void Parrot_pcc_split_signature_string( 291 ARGIN(const char *signature), 292 ARGOUT(const char **arg_sig), 293 ARGOUT(const char **return_sig)) 294 __attribute__nonnull__(1) 295 __attribute__nonnull__(2) 296 __attribute__nonnull__(3) 297 FUNC_MODIFIES(*arg_sig) 298 FUNC_MODIFIES(*return_sig); 299 300 #define ASSERT_ARGS_Parrot_pcc_build_call_from_c_args \ 301 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 302 PARROT_ASSERT_ARG(interp) \ 303 , PARROT_ASSERT_ARG(sig)) 304 #define ASSERT_ARGS_Parrot_pcc_build_call_from_varargs \ 305 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 306 PARROT_ASSERT_ARG(interp) \ 307 , PARROT_ASSERT_ARG(sig) \ 308 , PARROT_ASSERT_ARG(args)) 309 #define ASSERT_ARGS_Parrot_pcc_build_sig_object_from_op \ 310 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 311 PARROT_ASSERT_ARG(interp) \ 312 , PARROT_ASSERT_ARG(raw_sig) \ 313 , PARROT_ASSERT_ARG(raw_args)) 314 #define ASSERT_ARGS_Parrot_pcc_build_sig_object_from_varargs \ 315 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 316 PARROT_ASSERT_ARG(interp) \ 317 , PARROT_ASSERT_ARG(sig)) 318 #define ASSERT_ARGS_Parrot_pcc_fill_params_from_c_args \ 319 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 320 PARROT_ASSERT_ARG(interp) \ 321 , PARROT_ASSERT_ARG(call_object) \ 322 , PARROT_ASSERT_ARG(signature)) 323 #define ASSERT_ARGS_Parrot_pcc_fill_params_from_op \ 324 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 325 PARROT_ASSERT_ARG(interp) \ 326 , PARROT_ASSERT_ARG(raw_sig) \ 327 , PARROT_ASSERT_ARG(raw_params)) 328 #define ASSERT_ARGS_Parrot_pcc_fill_params_from_varargs \ 329 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 330 PARROT_ASSERT_ARG(interp) \ 331 , PARROT_ASSERT_ARG(signature) \ 332 , PARROT_ASSERT_ARG(args)) 333 #define ASSERT_ARGS_Parrot_pcc_set_call_from_c_args \ 334 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 335 PARROT_ASSERT_ARG(interp) \ 336 , PARROT_ASSERT_ARG(signature) \ 337 , PARROT_ASSERT_ARG(sig)) 338 #define ASSERT_ARGS_Parrot_pcc_set_call_from_varargs \ 339 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 340 PARROT_ASSERT_ARG(interp) \ 341 , PARROT_ASSERT_ARG(signature) \ 342 , PARROT_ASSERT_ARG(sig) \ 343 , PARROT_ASSERT_ARG(args)) 344 #define ASSERT_ARGS_Parrot_pcc_merge_signature_for_tailcall \ 345 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 346 PARROT_ASSERT_ARG(interp) \ 347 , PARROT_ASSERT_ARG(parent) \ 348 , PARROT_ASSERT_ARG(tailcall)) 349 #define ASSERT_ARGS_Parrot_pcc_parse_signature_string \ 350 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 351 PARROT_ASSERT_ARG(interp) \ 352 , PARROT_ASSERT_ARG(signature) \ 353 , PARROT_ASSERT_ARG(arg_flags) \ 354 , PARROT_ASSERT_ARG(return_flags)) 355 #define ASSERT_ARGS_Parrot_pcc_split_signature_string \ 356 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 357 PARROT_ASSERT_ARG(signature) \ 358 , PARROT_ASSERT_ARG(arg_sig) \ 359 , PARROT_ASSERT_ARG(return_sig)) 360 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ 361 /* HEADERIZER END: src/call/args.c */ 362 363 #define ASSERT_SIG_PMC(sig) do {\ 364 PARROT_ASSERT(!PMC_IS_NULL(sig)); \ 365 PARROT_ASSERT(PObj_is_PMC_TEST(sig)); \ 366 PARROT_ASSERT((sig)->vtable->base_type == enum_class_FixedIntegerArray); \ 367 } while (0) 368 369 #define ADD_OP_VAR_PART(interp, seg, pc, n) do { \ 370 op_lib_t *_core_ops = PARROT_GET_CORE_OPLIB(interp); \ 371 if (OPCODE_IS((interp), (seg), *(pc), _core_ops, PARROT_OP_set_args_pc) \ 372 || OPCODE_IS((interp), (seg), *(pc), _core_ops, PARROT_OP_get_results_pc) \ 373 || OPCODE_IS((interp), (seg), *(pc), _core_ops, PARROT_OP_get_params_pc) \ 374 || OPCODE_IS((interp), (seg), *(pc), _core_ops, PARROT_OP_set_returns_pc)) { \ 375 PMC * const sig = (seg)->const_table->pmc.constants[(pc)[1]]; \ 376 (n) += VTABLE_elements((interp), sig); \ 377 } \ 378 } while (0) 379 380 /* Context manipulating functions */ 381 382 /* HEADERIZER BEGIN: src/call/context.c */ 383 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ 384 385 PARROT_EXPORT 386 PARROT_PURE_FUNCTION 387 PARROT_CANNOT_RETURN_NULL 388 FLOATVAL * Parrot_pcc_get_FLOATVAL_reg(PARROT_INTERP, 389 ARGIN(const PMC *ctx), 390 UINTVAL idx) 391 __attribute__nonnull__(1) 392 __attribute__nonnull__(2); 393 394 PARROT_EXPORT 395 PARROT_PURE_FUNCTION 396 PARROT_CANNOT_RETURN_NULL 397 INTVAL * Parrot_pcc_get_INTVAL_reg(PARROT_INTERP, 398 ARGIN(const PMC *ctx), 399 UINTVAL idx) 400 __attribute__nonnull__(1) 401 __attribute__nonnull__(2); 402 403 PARROT_EXPORT 404 PARROT_PURE_FUNCTION 405 PARROT_CANNOT_RETURN_NULL 406 PMC ** Parrot_pcc_get_PMC_reg(PARROT_INTERP, ARGIN(PMC *ctx), UINTVAL idx) 407 __attribute__nonnull__(1) 408 __attribute__nonnull__(2); 409 410 PARROT_EXPORT 411 PARROT_PURE_FUNCTION 412 PARROT_CANNOT_RETURN_NULL 413 Regs_ni* Parrot_pcc_get_regs_ni(PARROT_INTERP, ARGIN(const PMC *ctx)) 414 __attribute__nonnull__(2); 415 416 PARROT_EXPORT 417 PARROT_PURE_FUNCTION 418 PARROT_CANNOT_RETURN_NULL 419 Regs_ps* Parrot_pcc_get_regs_ps(PARROT_INTERP, ARGIN(PMC *ctx)) 420 __attribute__nonnull__(2); 421 422 PARROT_EXPORT 423 PARROT_PURE_FUNCTION 424 UINTVAL Parrot_pcc_get_regs_used(PARROT_INTERP, 425 ARGIN(const PMC *ctx), 426 int type) 427 __attribute__nonnull__(2); 428 429 PARROT_EXPORT 430 PARROT_PURE_FUNCTION 431 PARROT_CANNOT_RETURN_NULL 432 STRING ** Parrot_pcc_get_STRING_reg(PARROT_INTERP, 433 ARGIN(PMC *ctx), 434 UINTVAL idx) 435 __attribute__nonnull__(1) 436 __attribute__nonnull__(2); 437 438 PARROT_EXPORT 439 PARROT_PURE_FUNCTION 440 PARROT_CAN_RETURN_NULL 441 PMC* Parrot_pcc_get_sub(PARROT_INTERP, ARGIN(const PMC *ctx)) 442 __attribute__nonnull__(2); 443 444 PARROT_EXPORT 445 void Parrot_pcc_reuse_continuation(PARROT_INTERP, 446 ARGIN(PMC *call_context), 447 ARGIN_NULLOK(opcode_t *next)) 448 __attribute__nonnull__(1) 449 __attribute__nonnull__(2); 450 451 PARROT_EXPORT 452 void Parrot_pcc_set_context_func(PARROT_INTERP, ARGIN(PMC *ctx)) 453 __attribute__nonnull__(1) 454 __attribute__nonnull__(2); 455 456 PARROT_EXPORT 457 void Parrot_pcc_set_regs_ni(PARROT_INTERP, 458 ARGIN(PMC *ctx), 459 ARGIN(Regs_ni *bp)) 460 __attribute__nonnull__(2) 461 __attribute__nonnull__(3); 462 463 PARROT_EXPORT 464 void Parrot_pcc_set_regs_ps(PARROT_INTERP, 465 ARGIN(PMC *ctx), 466 ARGIN(Regs_ps *bp_ps)) 467 __attribute__nonnull__(2) 468 __attribute__nonnull__(3); 469 470 PARROT_EXPORT 471 void Parrot_pcc_set_sub(PARROT_INTERP, 472 ARGIN(PMC *ctx), 473 ARGIN_NULLOK(PMC *sub)) 474 __attribute__nonnull__(1) 475 __attribute__nonnull__(2); 476 477 PARROT_EXPORT 478 void Parrot_pop_context(PARROT_INTERP) 479 __attribute__nonnull__(1); 480 481 PARROT_EXPORT 482 PARROT_WARN_UNUSED_RESULT 483 PARROT_CANNOT_RETURN_NULL 484 PMC * Parrot_push_context(PARROT_INTERP, ARGIN(const UINTVAL *n_regs_used)) 485 __attribute__nonnull__(1) 486 __attribute__nonnull__(2); 487 488 void create_initial_context(PARROT_INTERP) 489 __attribute__nonnull__(1); 490 491 PARROT_CANNOT_RETURN_NULL 492 PARROT_WARN_UNUSED_RESULT 493 PMC * Parrot_alloc_context(PARROT_INTERP, 494 ARGIN(const UINTVAL *number_regs_used), 495 ARGIN_NULLOK(PMC *old)) 496 __attribute__nonnull__(1) 497 __attribute__nonnull__(2); 498 499 PARROT_CANNOT_RETURN_NULL 500 PARROT_WARN_UNUSED_RESULT 501 PMC * Parrot_pcc_allocate_empty_context(PARROT_INTERP, 502 ARGIN_NULLOK(PMC *old)) 503 __attribute__nonnull__(1); 504 505 void Parrot_pcc_allocate_registers(PARROT_INTERP, 506 ARGIN(PMC *pmcctx), 507 ARGIN(const UINTVAL *number_regs_used)) 508 __attribute__nonnull__(1) 509 __attribute__nonnull__(2) 510 __attribute__nonnull__(3); 511 512 void Parrot_pcc_free_registers(PARROT_INTERP, ARGIN(PMC *pmcctx)) 513 __attribute__nonnull__(1) 514 __attribute__nonnull__(2); 515 516 PARROT_CANNOT_RETURN_NULL 517 PMC * Parrot_pcc_init_context(PARROT_INTERP, 518 ARGIN(PMC *ctx), 519 ARGIN_NULLOK(PMC *old)) 520 __attribute__nonnull__(2); 521 522 PARROT_WARN_UNUSED_RESULT 523 PARROT_CANNOT_RETURN_NULL 524 PMC * Parrot_pcc_unproxy_context(PARROT_INTERP, ARGIN(PMC * proxy)) 525 __attribute__nonnull__(1) 526 __attribute__nonnull__(2); 527 528 PARROT_CANNOT_RETURN_NULL 529 PARROT_WARN_UNUSED_RESULT 530 PMC * Parrot_set_new_context(PARROT_INTERP, 531 ARGIN(const UINTVAL *number_regs_used)) 532 __attribute__nonnull__(1) 533 __attribute__nonnull__(2); 534 535 #define ASSERT_ARGS_Parrot_pcc_get_FLOATVAL_reg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 536 PARROT_ASSERT_ARG(interp) \ 537 , PARROT_ASSERT_ARG(ctx)) 538 #define ASSERT_ARGS_Parrot_pcc_get_INTVAL_reg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 539 PARROT_ASSERT_ARG(interp) \ 540 , PARROT_ASSERT_ARG(ctx)) 541 #define ASSERT_ARGS_Parrot_pcc_get_PMC_reg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 542 PARROT_ASSERT_ARG(interp) \ 543 , PARROT_ASSERT_ARG(ctx)) 544 #define ASSERT_ARGS_Parrot_pcc_get_regs_ni __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 545 PARROT_ASSERT_ARG(ctx)) 546 #define ASSERT_ARGS_Parrot_pcc_get_regs_ps __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 547 PARROT_ASSERT_ARG(ctx)) 548 #define ASSERT_ARGS_Parrot_pcc_get_regs_used __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 549 PARROT_ASSERT_ARG(ctx)) 550 #define ASSERT_ARGS_Parrot_pcc_get_STRING_reg __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 551 PARROT_ASSERT_ARG(interp) \ 552 , PARROT_ASSERT_ARG(ctx)) 553 #define ASSERT_ARGS_Parrot_pcc_get_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 554 PARROT_ASSERT_ARG(ctx)) 555 #define ASSERT_ARGS_Parrot_pcc_reuse_continuation __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 556 PARROT_ASSERT_ARG(interp) \ 557 , PARROT_ASSERT_ARG(call_context)) 558 #define ASSERT_ARGS_Parrot_pcc_set_context_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 559 PARROT_ASSERT_ARG(interp) \ 560 , PARROT_ASSERT_ARG(ctx)) 561 #define ASSERT_ARGS_Parrot_pcc_set_regs_ni __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 562 PARROT_ASSERT_ARG(ctx) \ 563 , PARROT_ASSERT_ARG(bp)) 564 #define ASSERT_ARGS_Parrot_pcc_set_regs_ps __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 565 PARROT_ASSERT_ARG(ctx) \ 566 , PARROT_ASSERT_ARG(bp_ps)) 567 #define ASSERT_ARGS_Parrot_pcc_set_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 568 PARROT_ASSERT_ARG(interp) \ 569 , PARROT_ASSERT_ARG(ctx)) 570 #define ASSERT_ARGS_Parrot_pop_context __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 571 PARROT_ASSERT_ARG(interp)) 572 #define ASSERT_ARGS_Parrot_push_context __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 573 PARROT_ASSERT_ARG(interp) \ 574 , PARROT_ASSERT_ARG(n_regs_used)) 575 #define ASSERT_ARGS_create_initial_context __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 576 PARROT_ASSERT_ARG(interp)) 577 #define ASSERT_ARGS_Parrot_alloc_context __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 578 PARROT_ASSERT_ARG(interp) \ 579 , PARROT_ASSERT_ARG(number_regs_used)) 580 #define ASSERT_ARGS_Parrot_pcc_allocate_empty_context \ 581 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 582 PARROT_ASSERT_ARG(interp)) 583 #define ASSERT_ARGS_Parrot_pcc_allocate_registers __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 584 PARROT_ASSERT_ARG(interp) \ 585 , PARROT_ASSERT_ARG(pmcctx) \ 586 , PARROT_ASSERT_ARG(number_regs_used)) 587 #define ASSERT_ARGS_Parrot_pcc_free_registers __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 588 PARROT_ASSERT_ARG(interp) \ 589 , PARROT_ASSERT_ARG(pmcctx)) 590 #define ASSERT_ARGS_Parrot_pcc_init_context __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 591 PARROT_ASSERT_ARG(ctx)) 592 #define ASSERT_ARGS_Parrot_pcc_unproxy_context __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 593 PARROT_ASSERT_ARG(interp) \ 594 , PARROT_ASSERT_ARG(proxy)) 595 #define ASSERT_ARGS_Parrot_set_new_context __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 596 PARROT_ASSERT_ARG(interp) \ 597 , PARROT_ASSERT_ARG(number_regs_used)) 598 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ 599 /* HEADERIZER END: src/call/context.c */ 600 601 #endif /* PARROT_INTER_CALL_H_GUARD */ 602 603 /* 604 * Local variables: 605 * c-file-style: "parrot" 606 * End: 607 * vim: expandtab shiftwidth=4 cinoptions='\:2=2' : 608 */ 609