Add new 'replace' and 'size' paramaters in some natives.

Fix some typos
Update the test plugin
This commit is contained in:
Arkshine
2014-05-03 22:36:40 +02:00
parent f3bce9ecfd
commit b6cd247d12
4 changed files with 218 additions and 50 deletions

View File

@@ -61,19 +61,19 @@ public:
}
size_t arrayLength() const {
//assert(isArray());
assert(isArray());
return raw()->length;
}
cell *array() const {
//assert(isArray());
assert(isArray());
return reinterpret_cast<cell *>(raw()->base());
}
char *chars() const {
//assert(isString());
assert(isString());
return reinterpret_cast<char *>(raw()->base());
}
cell cell_() const {
//assert(isCell());
assert(isCell());
return data_;
}
@@ -110,13 +110,13 @@ private:
}
void setType(EntryType aType) {
control_ = uintptr_t(raw()) | uintptr_t(aType);
//assert(type() == aType);
assert(type() == aType);
}
void setTypeAndPointer(EntryType aType, ArrayInfo *ptr) {
// malloc() should guarantee 8-byte alignment at worst
//assert((uintptr_t(ptr) & 0x3) == 0);
assert((uintptr_t(ptr) & 0x3) == 0);
control_ = uintptr_t(ptr) | uintptr_t(aType);
//assert(type() == aType);
assert(type() == aType);
}
EntryType type() const {
return (EntryType)(control_ & 0x3);