fix rc in Array#fill, add rtti logging for debugging

This commit is contained in:
dcode
2019-06-01 15:57:53 +02:00
parent 066ea1fbd2
commit 1468923025
15 changed files with 129 additions and 65 deletions

View File

@ -135,7 +135,15 @@ export class Array<T> extends ArrayBufferView {
var length = this.length_;
start = start < 0 ? max(length + start, 0) : min(start, length);
end = end < 0 ? max(length + end, 0) : min(end, length);
if (sizeof<T>() == 1) {
if (isManaged<T>()) {
for (; start < end; ++start) {
let oldRef: usize = load<usize>(dataStart + (<usize>start << alignof<T>()));
if (changetype<usize>(value) != oldRef) {
store<usize>(dataStart + (<usize>start << alignof<T>()), __retain(changetype<usize>(value)));
__release(oldRef);
}
}
} else if (sizeof<T>() == 1) {
if (start < end) {
memory.fill(
dataStart + <usize>start,