1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

updated vm (breaking compatibility)

- updated vm
- new actor scheduler
- updated tonlib
- updated DNS smartcontract
This commit is contained in:
ton 2020-02-28 14:28:47 +04:00
parent 9e4816e7f6
commit e27fb1e09c
100 changed files with 3692 additions and 1299 deletions

View file

@ -389,7 +389,7 @@ int exec_muldivmod(VmState* st, unsigned args, int quiet) {
auto x = stack.pop_int();
typename td::BigInt256::DoubleInt tmp{0};
tmp.add_mul(*x, *y);
auto q = td::RefInt256{true};
auto q = td::make_refint();
tmp.mod_div(*z, q.unique_write(), round_mode);
switch ((args >> 2) & 3) {
case 1:
@ -401,7 +401,7 @@ int exec_muldivmod(VmState* st, unsigned args, int quiet) {
stack.push_int_quiet(std::move(q), quiet);
// fallthrough
case 2:
stack.push_int_quiet(td::RefInt256{true, tmp}, quiet);
stack.push_int_quiet(td::make_refint(tmp), quiet);
break;
}
return 0;
@ -450,17 +450,17 @@ int exec_mulshrmod(VmState* st, unsigned args, int mode) {
switch ((args >> 2) & 3) {
case 1:
tmp.rshift(z, round_mode).normalize();
stack.push_int_quiet(td::RefInt256{true, tmp}, mode & 1);
stack.push_int_quiet(td::make_refint(tmp), mode & 1);
break;
case 3: {
typename td::BigInt256::DoubleInt tmp2{tmp};
tmp2.rshift(z, round_mode).normalize();
stack.push_int_quiet(td::RefInt256{true, tmp2}, mode & 1);
stack.push_int_quiet(td::make_refint(tmp2), mode & 1);
}
// fallthrough
case 2:
tmp.mod_pow2(z, round_mode).normalize();
stack.push_int_quiet(td::RefInt256{true, tmp}, mode & 1);
stack.push_int_quiet(td::make_refint(tmp), mode & 1);
break;
}
return 0;
@ -524,24 +524,24 @@ int exec_shldivmod(VmState* st, unsigned args, int mode) {
tmp <<= y;
switch ((args >> 2) & 3) {
case 1: {
auto q = td::RefInt256{true};
auto q = td::make_refint();
tmp.mod_div(*z, q.unique_write(), round_mode);
q.unique_write().normalize();
stack.push_int_quiet(std::move(q), mode & 1);
break;
}
case 3: {
auto q = td::RefInt256{true};
auto q = td::make_refint();
tmp.mod_div(*z, q.unique_write(), round_mode);
q.unique_write().normalize();
stack.push_int_quiet(std::move(q), mode & 1);
stack.push_int_quiet(td::RefInt256{true, tmp}, mode & 1);
stack.push_int_quiet(td::make_refint(tmp), mode & 1);
break;
}
case 2: {
typename td::BigInt256::DoubleInt tmp2;
tmp.mod_div(*z, tmp2, round_mode);
stack.push_int_quiet(td::RefInt256{true, tmp}, mode & 1);
stack.push_int_quiet(td::make_refint(tmp), mode & 1);
break;
}
}
@ -740,7 +740,7 @@ int exec_bitsize(VmState* st, bool sgnd, bool quiet) {
} else if (!quiet) {
throw VmError{Excno::range_chk, "CHKSIZE for negative integer"};
} else {
stack.push_int_quiet(td::RefInt256{true}, quiet);
stack.push_int_quiet(td::make_refint(), quiet);
}
return 0;
}