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

updated fift/func

This commit is contained in:
ton 2019-12-12 19:16:25 +04:00
parent b6f6788532
commit d41ce55305
31 changed files with 717 additions and 66 deletions

View file

@ -135,6 +135,9 @@ class StackEntry {
tp = t_null;
return *this;
}
bool set_int(td::RefInt256 value) {
return set(t_int, std::move(value));
}
bool empty() const {
return tp == t_null;
}
@ -168,6 +171,8 @@ class StackEntry {
}
// mode: +1 = disable short ints, +2 = disable continuations
bool serialize(vm::CellBuilder& cb, int mode = 0) const;
bool deserialize(vm::CellSlice& cs, int mode = 0);
bool deserialize(Ref<Cell> cell, int mode = 0);
private:
static bool is_list(const StackEntry* se);
@ -195,6 +200,11 @@ class StackEntry {
Ref<T> move_as() & {
return tp == tag ? Ref<T>{td::static_cast_ref(), std::move(ref)} : td::Ref<T>{};
}
bool set(Type _tp, RefAny _ref) {
tp = _tp;
ref = std::move(_ref);
return ref.not_null() || tp == t_null;
}
public:
static StackEntry make_list(std::vector<StackEntry>&& elems);
@ -511,6 +521,8 @@ class Stack : public td::CntObject {
// mode: +1 = add eoln, +2 = Lisp-style lists
void dump(std::ostream& os, int mode = 1) const;
bool serialize(vm::CellBuilder& cb, int mode = 0) const;
bool deserialize(vm::CellSlice& cs, int mode = 0);
static bool deserialize_to(vm::CellSlice& cs, Ref<Stack>& stack, int mode = 0);
};
} // namespace vm