Skip to content

Commit 8332adb

Browse files
committed
* RENAMED: too many methods to list
* did some work on the big bang, for MulleObjC benefit
1 parent a4ff205 commit 8332adb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1211
-947
lines changed

RELEASENOTES.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
## 0.12.1
99

1010
* _MULLE_OBJC_CLASS_HAS_CLEARABLE_PROPERTY replaces _MULLE_OBJC_CLASS_HAS_RELEASABLE_PROPERTY
11-
* _mulle_objc_object_nonatomic_infiniteretain replaces _mulle_objc_object_nonatomic_infinite_retain
11+
* _mulle_objc_object_infiniteretain_noatomic replaces _mulle_objc_object_nonatomic_infinite_retain
1212
* Adapt runtime to __MULLE_OBJC_FMC__ to compile without fast methods
1313
* adapt search so that we a root class inheriting from protocolclasses, also inherits the infraclass methods from the first protocolclass
1414
* adapted call functions to the new way of calling super, where the classid of the calling class is passed (no longer the superclassid)
@@ -87,7 +87,7 @@ It should now be possible to initialize a global universe from multiple threads.
8787
It should not be necessary to set the global universe up from a single thread,
8888
before starting other threads.
8989

90-
Only use `mulle_objc_get_or_create_universe` during loading. Makes it easier.
90+
Only use `mulle_objc_register_universe` during loading. Makes it easier.
9191

9292
Also distribute mulle-objc-uniqueid.
9393

@@ -134,7 +134,7 @@ collisions
134134
* renamed _size_of_ functions to _sizeof_ as its more c like
135135
* renamed has_category/has_protocol and related functions to has_categoryid/has_protocolid,
136136
because it is less confusing
137-
* removed misleading mulle_objc_string_for_ivarid and friends (use class to get
137+
* removed misleading mulle_objc_describe_ivarid and friends (use class to get
138138
the names)
139139

140140
## 0.7.1
@@ -144,7 +144,7 @@ the names)
144144
* moved some more call functions into "...call.c" (duh)
145145
* moved version and new "path" up for easier debugging and easier version
146146
checks its kinda useful if version is at a fixed offset
147-
* `__get_or_create_objc_runtime` has been renamed to `__get_or_create_mulle_objc_runtime`
147+
* `__get_or_create_objc_runtime` has been renamed to `__register_mulle_objc_universe`
148148
for clarity in the debugger and multi-universe code.
149149
* moved forward into a fixed position in the class structure for a future
150150
debugger

cmake/_Headers.cmake

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ src/mulle-objc-fnv1.h
4343
src/mulle-objc-infraclass.h
4444
src/mulle-objc-ivar.h
4545
src/mulle-objc-ivarlist.h
46+
src/mulle-objc-jit.inc
4647
src/mulle-objc-kvccache.h
4748
src/mulle-objc-load.h
4849
src/mulle-objc-metaabi.h

dox/API_CLASS.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ int mulle_objc_class_add_methodlist( struct _mulle_objc_class *cls,
3131
struct _mulle_objc_methodlist *list)
3232
```
3333

34-
Add methodlist `list` to `cls`. The methodlist isn't copied, so be sure that is sticks around for the lifetime of the runtime. (Check out `mulle_objc_runtime_unfailing_add_gift`)
34+
Add methodlist `list` to `cls`. The methodlist isn't copied, so be sure that is sticks around for the lifetime of the runtime. (Check out `mulle_objc_universe_add_gift_nofail`)
3535

3636

3737
### `mulle_objc_classpair_add_protocolid`

dox/API_EXCEPTION.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ This may be of interest if you are writing a compiler for the runtime.
2828
Relevant links:
2929

3030
[clang](//github.com/llvm-mirror/clang/blob/master/lib/CodeGen/CGObjCMac.cpp#L4020)
31-
[mulle_objc_exception_try_enter.h](../src/mulle_objc_exception_try_enter.h)
32-
[mulle_objc_exception_try_enter.c](../src/mulle_objc_exception_try_enter.c)
31+
[mulle_objc_exception_tryenter.h](../src/mulle_objc_exception_tryenter.h)
32+
[mulle_objc_exception_tryenter.c](../src/mulle_objc_exception_tryenter.c)
3333

dox/API_LOADINFO.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
# LoadInfo : Loading Classes, Categories, Strings
22

33
Classes, categories, static strings are all added with the same function
4-
`mulle_objc_loadinfo_unfailing_enqueue`. Usually the compiler produces these calls automatically for you.
4+
`mulle_objc_loadinfo_enqueue_nofail`. Usually the compiler produces these calls automatically for you.
55

66
## Functions
77

8-
### `mulle_objc_loadinfo_unfailing_enqueue`
8+
### `mulle_objc_loadinfo_enqueue_nofail`
99

1010
```
11-
void mulle_objc_loadinfo_unfailing_enqueue( struct _mulle_objc_loadinfo *info)
11+
void mulle_objc_loadinfo_enqueue_nofail( struct _mulle_objc_loadinfo *info)
1212
```
1313

1414
Take `info` and queue the contained classes, categories, strings up for inclusion into the runtime. If the base class of a class or category is already present, it will be added immediately to the runtime. Otherwise the inclusion will be delayed until the base class appears.
1515

16-
The **unfailing** in `mulle_objc_loadinfo_unfailing_enqueue` indicates, that the function will throw an exception or abort, if the runtime is not properly setup or if it detects errors in `info`.
16+
The **unfailing** in `mulle_objc_loadinfo_enqueue_nofail` indicates, that the function will throw an exception or abort, if the runtime is not properly setup or if it detects errors in `info`.
1717

18-
This information is usually created by the compiler, but if you want to add a class at runtime, you would also do it via `mulle_objc_loadinfo_unfailing_enqueue`.
18+
This information is usually created by the compiler, but if you want to add a class at runtime, you would also do it via `mulle_objc_loadinfo_enqueue_nofail`.
1919

2020
Checkout [demo1.c](../tests/demo/demo1.c) for a fairly well documented example, how to do this.
2121

22-
> `mulle_objc_loadinfo_unfailing_enqueue` will treat the contents of
22+
> `mulle_objc_loadinfo_enqueue_nofail` will treat the contents of
2323
> `_mulle_objc_loadinfo` as if they are in read only memory, with all
2424
> its implications, with respect to lifetime and mutability.
2525

dox/API_OBJECT.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -24,37 +24,37 @@ The non-inlining variant of sending a message to an object (calling an objects m
2424
`obj` must be a pointer to a valid object or NULL.
2525

2626

27-
### `mulle_objc_object_constant_methodid_call`
27+
### `mulle_objc_object_partialinlinecall_constantmethodid`
2828

2929
```
30-
void *mulle_objc_object_constant_methodid_call( void *obj,
31-
mulle_objc_methodid_t methodid,
32-
void *parameter)
30+
void *mulle_objc_object_partialinlinecall_constantmethodid( void *obj,
31+
mulle_objc_methodid_t methodid,
32+
void *parameter)
3333
```
3434

3535
This is an optimized variant of `mulle_objc_object_call` in cases, where
3636
`methodid` is a known constant. The compiler uses this method when optimizing
3737
with -O1.
3838

39-
Right: `mulle_objc_object_constant_methodid_call( self, 0x1848, NULL)`,
40-
Wrong: `mulle_objc_object_constant_methodid_call( self, _cmd, NULL)
39+
Right: `mulle_objc_object_partialinlinecall_constantmethodid( self, 0x1848, NULL)`,
40+
Wrong: `mulle_objc_object_partialinlinecall_constantmethodid( self, _cmd, NULL)
4141

4242

43-
### `mulle_objc_object_inline_constant_methodid_call`
43+
### `mulle_objc_object_inlinecall_constantmethodid`
4444

4545
```
46-
void *mulle_objc_object_inline_constant_methodid_call( void *obj,
47-
mulle_objc_methodid_t methodid,
48-
void *parameter)
46+
void *mulle_objc_object_inlinecall_constantmethodid( void *obj,
47+
mulle_objc_methodid_t methodid,
48+
void *parameter)
4949
```
5050

5151
This is an even further optimized variant of `mulle_objc_object_call` in cases,
5252
where `methodid` is a known constant. The compiler uses this method when
5353
optimized with -O2 and up. Frequent use of this function can increase the size
5454
of your executable by quite a bit.
5555

56-
Right: `mulle_objc_object_inline_constant_methodid_call( self, 0x1848, NULL)`,
57-
Wrong: `mulle_objc_object_inline_constant_methodid_call( self, _cmd, NULL)
56+
Right: `mulle_objc_object_inlinecall_constantmethodid( self, 0x1848, NULL)`,
57+
Wrong: `mulle_objc_object_inlinecall_constantmethodid( self, _cmd, NULL)
5858

5959

6060
### `mulle_objc_object_call_classid`

dox/API_UNIVERSE.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ other.
6565

6666
Parametername | Description
6767
--------------------|----------------------
68-
`universe` | Pointer to the universe, must not be NULL. Use `__get_or_create_mulle_objc_universe` (not `mulle_objc_get_universe`) to get the proper one for your thread
68+
`universe` | Pointer to the universe, must not be NULL. Use `__register_mulle_objc_universe` (not `mulle_objc_get_universe`) to get the proper one for your thread
6969
`classid` | Compute the `classid` from `name` with `mulle_objc_classid_from_string`
7070
`name` | The name of the class, this must be a non-empty ASCII string. This string is not copied. It must remain alive for the duration of the class's existence.
7171
`instance_size` | The space needed for instance variables (don't add the header size)
@@ -97,7 +97,7 @@ struct _mulle_objc_class *cls;
9797
char *name;
9898
mulle_objc_classid_t classid;
9999
100-
universe = __get_or_create_mulle_objc_universe();
100+
universe = __register_mulle_objc_universe();
101101
name = "Foo";
102102
classid = mulle_objc_classid_from_string( name);
103103
pair = mulle_objc_universe_new_classpair( universe, classid, name, 0, NULL);

dox/USE.md

+11-26
Original file line numberDiff line numberDiff line change
@@ -6,49 +6,34 @@ error-prone.
66
(See the few examples in `tests/`).
77

88

9-
## The missing function `__get_or_create_mulle_objc_runtime`
9+
## The missing function `__register_mulle_objc_universe`
1010

1111
The runtime needs an external function to work. This initializer function
12-
is called `__get_or_create_mulle_objc_runtime`.
12+
is called `__register_mulle_objc_universe`.
1313

1414
Here is a minimal implementation:
1515

1616
```
1717
MULLE_C_CONST_RETURN // always returns same value (in same thread)
18-
struct _mulle_objc_runtime *__get_or_create_mulle_objc_runtime( void)
18+
struct _mulle_objc_universe *__register_mulle_objc_universe( void)
1919
{
20-
struct _mulle_objc_runtime *runtime;
20+
struct _mulle_objc_universe *universe;
2121
22-
runtime = __mulle_objc_get_runtime();
23-
if( ! _mulle_objc_runtime_is_initalized( runtime))
24-
__mulle_objc_runtime_setup( runtime, NULL);
25-
return( runtime);
22+
universe = __mulle_objc_get_universe();
23+
if( ! _mulle_objc_universe_is_initialized( universe))
24+
_mulle_objc_universe_bang( universe, bang, NULL, NULL);
25+
26+
return( universe);
2627
}
2728
```
2829

29-
You may want to tweak the runtime when running the `__mulle_objc_runtime_setup`
30+
You may want to tweak the runtime when running the `_mulle_objc_universe_bang`
3031
branch of the `if`.
3132

3233
> You should not change this runtime after returning it to the caller for the first time.
3334
3435
If you want to write a Foundation yourself, check out the "foundation" spaces
35-
available to you in `struct _mulle_objc_runtime` and `struct _mulle_objc_threadconfig`.
36-
37-
38-
# Headers
39-
40-
MulleObjC wants to serve several masters
41-
42-
* C code compiled as C code (.c)
43-
* Any C or Objective-C code compiled as Objective-C code (.m)
44-
36+
available to you in `struct _mulle_objc_universe` and `struct _mulle_objc_threadinfo`.
4537

46-
Objective-C code gets everything, you #import <MulleObjC/MulleObjC.h>.
47-
If you want to compile .c, you usually don't want the inclusion of
48-
mulle-objc-runtime. Then you include <MulleObjC/ns-c.h>. This gives you
49-
access to a runtime-independent subset. (maybe should be elsewhere ?)
5038

51-
If you have for some strange reason a C-compiler but no mulle-clang compiler,
52-
and the compiled binaries, yet want to use some more MulleObjC + the runtime
53-
yo include <MulleObjC/C.h
5439

dox/global_runtime.dot

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ digraph global_concept
77

88
"thread (1)" -> "_mulle_objc_runtime"
99
"thread (n)" -> "_mulle_objc_runtime"
10-
"thread (1)" -> "_mulle_objc_threadconfig (1)"
11-
"thread (n)" -> "_mulle_objc_threadconfig (n)"
10+
"thread (1)" -> "_mulle_objc_thread_config (1)"
11+
"thread (n)" -> "_mulle_objc_thread_config (n)"
1212

1313
node [shape="note"];
1414

dox/load/LOAD.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ GNUStep basically guarantees nothing. `+load`s are performed as they are coming
6161

6262
## Call `+load` before or after addition to runtime ?
6363

64-
One question is, if `+load` should be called before the class or category
65-
is added to the runtime system or after. If the `+load` is called before
64+
One question is, if `+load` should be called before the class or category
65+
is added to the runtime system or after. If the `+load` is called before
6666
the addition, the following functionality is unavailable in `+load`:
6767

6868
#### For classes
@@ -78,9 +78,9 @@ This is not desirable and expected by the user (class programmer). Is it avoidab
7878

7979
## +load in mulle-objc-runtime
8080

81-
The **mulle-objc-runtime** allows classes and categories to specify arbitrary dependencies on other classes and categories for `+load` calls. It is the
81+
The **mulle-objc-runtime** allows classes and categories to specify arbitrary dependencies on other classes and categories for `+load` calls. It is the
8282
burden of the `+load` author to ensure, that there are no cycles.
83-
83+
8484
The **mulle-objc-runtime** automatically detects dependencies on superclasses and
8585
protocolclasses for classes. It detects dependencies on its base class and protocolclasses for categories.
8686

@@ -111,7 +111,7 @@ Each dependency either specifies the missing classid for a class, or the missing
111111
5. A class or category who's dependencies are not satisfied, is not added to
112112
the runtime system immediately. Instead its addition is postponed, until
113113
the requirements are met.
114-
114+
115115
### Other consequence of this design
116116

117117
Other C `__attribute__(constructor)` code and C++ initializers are unsequenced in relationship to `+load`. Shared libraries do not impose a sequencing order nor do they imply `+load` execution guarantees for contained loadable.
@@ -123,7 +123,7 @@ If a category does override `+initialize`, it should query the state bit with `_
123123
The MulleObjCFoundation for example guarantees, that its classes or categories
124124
do not trigger `+initialize` during `+load`.
125125

126-
126+
127127
## How classes and categories are loaded in mulle-objc-runtime
128128

129129

@@ -132,7 +132,7 @@ do not trigger `+initialize` during `+load`.
132132
> is called a loadable for short.
133133
134134

135-
If we assume, that the executable is composed of a complete set of loadcategories and loadclasses without missing dependencies, then all classes and categories will be installed ahead of `main`. They get installed via `__attribute__((constructor))` function calls to `mulle_objc_loadinfo_unfailing_enqueue`, the **mulle-clang** compiler emits:
135+
If we assume, that the executable is composed of a complete set of loadcategories and loadclasses without missing dependencies, then all classes and categories will be installed ahead of `main`. They get installed via `__attribute__((constructor))` function calls to `mulle_objc_loadinfo_enqueue_nofail`, the **mulle-clang** compiler emits:
136136

137137
![Excecutable](executable.svg)
138138

dox/load/executable.dot

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ digraph executable
1515
}
1616

1717

18-
"executable" -> "a.o" -> "__attribute_constructor( a.o)" -> "mulle_objc_loadinfo_unfailing_enqueue( &a.loadinfo)";
19-
"executable" -> "b.o" -> "__attribute_constructor( b.o)" -> "mulle_objc_loadinfo_unfailing_enqueue( &b.loadinfo)";
20-
"executable" -> "main.o" -> "__attribute_constructor( main.o)" -> "mulle_objc_loadinfo_unfailing_enqueue( &main.loadinfo)";
18+
"executable" -> "a.o" -> "__attribute_constructor( a.o)" -> "mulle_objc_loadinfo_enqueue_nofail( &a.loadinfo)";
19+
"executable" -> "b.o" -> "__attribute_constructor( b.o)" -> "mulle_objc_loadinfo_enqueue_nofail( &b.loadinfo)";
20+
"executable" -> "main.o" -> "__attribute_constructor( main.o)" -> "mulle_objc_loadinfo_enqueue_nofail( &main.loadinfo)";
2121
"executable" -> "shared library"
22-
"shared library" -> "c.o" -> "__attribute_constructor( c.o)" -> "mulle_objc_loadinfo_unfailing_enqueue( &c.loadinfo)";
22+
"shared library" -> "c.o" -> "__attribute_constructor( c.o)" -> "mulle_objc_loadinfo_enqueue_nofail( &c.loadinfo)";
2323

2424
{ rank = same; "int main( argc, argv)" }
2525

0 commit comments

Comments
 (0)