Overview
Comment: | Let OF_ENSURE use OBJC_ERROR in runtime |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
8f271bed2227472d57cdecd8f0aabb3c |
User & Date: | js on 2020-12-20 03:06:55 |
Other Links: | manifest | tags |
Context
2020-12-20
| ||
03:32 | runtime: Use exit(1) instead of abort() on AmigaOS check-in: 169832c303 user: js tags: trunk | |
03:06 | Let OF_ENSURE use OBJC_ERROR in runtime check-in: 8f271bed22 user: js tags: trunk | |
02:48 | runtime: Show fatal errors as requester on AmigaOS check-in: f2fdb37bec user: js tags: trunk | |
Changes
Modified src/macros.h from [365b468ef6] to [42109558ee].
︙ | |||
353 354 355 356 357 358 359 | 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 | + + + + + + + - + - + + | # endif # endif #endif #define OF_RETAIN_COUNT_MAX UINT_MAX #define OF_NOT_FOUND SIZE_MAX #ifdef OBJC_COMPILING_RUNTIME # define OF_ENSURE(cond) \ do { \ if OF_UNLIKELY (!(cond)) \ OBJC_ERROR("Failed to ensure condition:\n" #cond); \ } while(0) #else |
︙ |
Modified src/runtime/Makefile from [db9b1528cf] to [f0432ebc20].
︙ | |||
54 55 56 57 58 59 60 61 62 63 64 65 66 | 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | + | ${SFDC_INLINE_H}: ${SFD_FILE} sfdc -q --target=${SFDC_TARGET} --mode=macros -o $@ $<; \ ${CVINCLUDE_INLINE_H}: morphos.fd morphos-clib.h cvinclude.pl --quiet --fd=morphos.fd --clib=morphos-clib.h --inlines=$@ CPPFLAGS += -I. -I.. -I../.. \ -DOBJC_COMPILING_RUNTIME \ -DOBJFWRT_AMIGA_LIB=\"${OBJFWRT_AMIGA_LIB}\" \ -DOBJFWRT_LIB_MAJOR=${OBJFWRT_LIB_MAJOR} \ -DOBJFWRT_LIB_MINOR=${OBJFWRT_LIB_MINOR} AMIGA_LIB_CFLAGS += -DOBJC_COMPILING_AMIGA_LIBRARY LD = ${OBJC} FRAMEWORK_LIBS = ${LIBS} |
Modified src/runtime/amiga-library.m from [8dd763a2ab] to [d04f6c69e6].
︙ | |||
483 484 485 486 487 488 489 | 483 484 485 486 487 488 489 490 491 492 493 494 495 496 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | void free(void *ptr) { libc.free(ptr); } |
︙ | |||
619 620 621 622 623 624 625 626 627 628 629 630 631 632 | 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | #endif int * objc_get_errno(void) { return libc.get_errno(); } #ifdef OF_AMIGAOS_M68K int snprintf(char *restrict str, size_t size, const char *restrict fmt, ...) { va_list args; int ret; va_start(args, fmt); ret = vsnprintf(str, size, fmt, args); va_end(args); return ret; } int vsnprintf(char *restrict str, size_t size, const char *restrict fmt, va_list args) { return libc.vsnprintf(str, size, fmt, args); } #endif void abort(void) { libc.abort(); OF_UNREACHABLE } #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpedantic" static CONST_APTR functionTable[] = { #ifdef OF_MORPHOS (CONST_APTR)FUNCARRAY_BEGIN, (CONST_APTR)FUNCARRAY_32BIT_NATIVE, |
︙ |
Modified src/runtime/arc.m from [7f174d7d34] to [4544515edf].
︙ | |||
48 49 50 51 52 53 54 | 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | - + | OF_CONSTRUCTOR() { hashtable = objc_hashtable_new(hash, equal, 2); #ifdef OF_HAVE_THREADS if (!of_spinlock_new(&spinlock)) |
︙ | |||
119 120 121 122 123 124 125 | 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | - + | id objc_storeWeak(id *object, id value) { struct weak_ref *old; #ifdef OF_HAVE_THREADS if (!of_spinlock_lock(&spinlock)) |
︙ | |||
166 167 168 169 170 171 172 | 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 | - + - + - + - + | objc_hashtable_set(hashtable, value, ref); } if ((ref->locations = realloc(ref->locations, (ref->count + 1) * sizeof(id *))) == NULL) OBJC_ERROR("Not enough memory to allocate weak " |
︙ | |||
241 242 243 244 245 246 247 | 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 | - + - + - + - + | void objc_moveWeak(id *dest, id *src) { struct weak_ref *ref; #ifdef OF_HAVE_THREADS if (!of_spinlock_lock(&spinlock)) |
Modified src/runtime/class.m from [0dc727f4b5] to [0b3dadf0dd].
︙ | |||
466 467 468 469 470 471 472 | 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 | - + - + | Class objc_allocateClassPair(Class superclass, const char *name, size_t extraBytes) { struct objc_class *class, *metaclass; Class iter, rootclass = Nil; if (extraBytes > LONG_MAX) |
︙ |
Modified src/runtime/exception.m from [ff0a7a161b] to [3255d28641].
︙ | |||
245 246 247 248 249 250 251 | 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 | - + | static struct objc_exception emergencyExceptions[NUM_EMERGENCY_EXCEPTIONS]; #ifdef OF_HAVE_THREADS static of_spinlock_t emergencyExceptionsSpinlock; OF_CONSTRUCTOR() { if (!of_spinlock_new(&emergencyExceptionsSpinlock)) |
︙ | |||
306 307 308 309 310 311 312 | 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 | - + - + - + | #endif #ifdef HAVE__UNWIND_GETTEXTRELBASE case DW_EH_PE_textrel: return _Unwind_GetTextRelBase(ctx); #endif } |
︙ | |||
367 368 369 370 371 372 373 | 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 | - + | case DW_EH_PE_sdata2: READ(int16_t) case DW_EH_PE_sdata4: READ(int32_t) case DW_EH_PE_sdata8: READ(int64_t) default: |
︙ | |||
556 557 558 559 560 561 562 | 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 | - + | if (classMatches(class, e->object)) { *filterPtr = filter; return HANDLER_FOUND; } } else if (filter == 0) return CLEANUP_FOUND; else if (filter < 0) |
︙ | |||
688 689 690 691 692 693 694 | 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 | + - + | (uintptr_t)ex); _Unwind_SetGR(ctx, __builtin_eh_return_data_regno(1), filter); _Unwind_SetIP(ctx, landingpad); return _URC_INSTALL_CONTEXT; } OBJC_ERROR( |
︙ | |||
743 744 745 746 747 748 749 | 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 | - + - + | #ifdef OF_HAVE_THREADS if (!of_spinlock_unlock(&emergencyExceptionsSpinlock)) OBJC_ERROR("Cannot lock spinlock!"); #endif } if (e == NULL) |
︙ |
Modified src/runtime/linklib/linklib.m from [452f883c82] to [9324d0a33d].
︙ | |||
81 82 83 84 85 86 87 | 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | - - - - - - | { static bool initialized = false; struct objc_libc libc = { .malloc = malloc, .calloc = calloc, .realloc = realloc, .free = free, |
︙ | |||
116 117 118 119 120 121 122 123 124 125 126 127 128 129 | 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | + + + + | .__deregister_frame_info = __deregister_frame_info, #endif #ifdef OF_MORPHOS .__register_frame = __register_frame, .__deregister_frame = __deregister_frame, #endif .get_errno = get_errno, #ifdef OF_AMIGAOS_M68K .vsnprintf = vsnprintf, #endif .abort = abort, }; if (initialized) return; if ((ObjFWRTBase = OpenLibrary(OBJFWRT_AMIGA_LIB, OBJFWRT_LIB_MINOR)) == NULL) { |
︙ |
Modified src/runtime/private.h from [01662866bf] to [85a2ea1403].
︙ | |||
221 222 223 224 225 226 227 | 221 222 223 224 225 226 227 228 229 230 231 232 233 234 | - - - - - - - | #if defined(OBJC_COMPILING_AMIGA_LIBRARY) || \ defined(OBJC_COMPILING_AMIGA_LINKLIB) struct objc_libc { void *_Nullable (*_Nonnull malloc)(size_t); void *_Nullable (*_Nonnull calloc)(size_t, size_t); void *_Nullable (*_Nonnull realloc)(void *_Nullable, size_t); void (*_Nonnull free)(void *_Nullable); |
︙ | |||
258 259 260 261 262 263 264 265 266 267 268 269 270 271 | 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 | + + + + + | void *(*_Nonnull __deregister_frame_info)(const void *_Nonnull); # endif # ifdef OF_MORPHOS void (*_Nonnull __register_frame)(void *_Nonnull); void (*_Nonnull __deregister_frame)(void *_Nonnull); # endif int *_Nonnull (*_Nonnull get_errno)(void); # ifdef OF_AMIGAOS_M68K int (*_Nonnull vsnprintf)(char *restrict _Nonnull str, size_t size, const char *_Nonnull restrict fmt, va_list args); # endif void (*_Nonnull abort)(void); }; #endif #ifdef OBJC_COMPILING_AMIGA_LIBRARY # if defined(__MORPHOS__) # include <ppcinline/macros.h> # define OBJC_M68K_ARG(type, name, reg) type name = (type)REG_##reg; |
︙ | |||
349 350 351 352 353 354 355 | 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 | - + | return dtable->buckets[i]->buckets[j]; #endif } extern void OF_NO_RETURN_FUNC objc_error(const char *file, unsigned int line, const char *format, ...); |
︙ |
Modified src/runtime/property.m from [f51e3c1883] to [6195775ed5].
︙ | |||
30 31 32 33 34 35 36 | 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | - + | #endif #ifdef OF_HAVE_THREADS OF_CONSTRUCTOR() { for (size_t i = 0; i < NUM_SPINLOCKS; i++) if (!of_spinlock_new(&spinlocks[i])) |
︙ |
Modified src/runtime/synchronized.m from [dcf43cf9c5] to [106c451b62].
︙ | |||
34 35 36 37 38 39 40 | 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | - + | } *locks = NULL; static of_mutex_t mutex; OF_CONSTRUCTOR() { if (!of_mutex_new(&mutex)) |
︙ |