[Object.IsInstance.begin]
| 133 | |
| 134 | // [Object.IsInstance.begin] |
| 135 | int Object_IsInstance(int32_t sub_type_index, int32_t super_type_index, int32_t super_type_depth) { |
| 136 | const TVMFFITypeInfo* sub_type_info = NULL; |
| 137 | // Everything is a subclass of object. |
| 138 | if (sub_type_index == super_type_index) { |
| 139 | return 1; |
| 140 | } |
| 141 | // Invariance: parent index is always smaller than the child. |
| 142 | if (sub_type_index < super_type_index) { |
| 143 | return 0; |
| 144 | } |
| 145 | sub_type_info = TVMFFIGetTypeInfo(sub_type_index); |
| 146 | return sub_type_info->type_depth > super_type_depth && |
| 147 | sub_type_info->type_ancestors[super_type_depth]->type_index == super_type_index; |
| 148 | } |
| 149 | // [Object.IsInstance.end] |
| 150 | |
| 151 | // [Object.MoveFromAny.begin] |
nothing calls this directly
no test coverage detected