From: Jérémie Astor Date: Sun, 13 Jun 2021 10:20:32 +0000 (+0200) Subject: :art: update includes X-Git-Tag: nightly~598 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=7b51eafb25f898c994aef13003c401cada6622a4;p=gwion.git :art: update includes --- diff --git a/include/emit.h b/include/emit.h index c64154a7..cdfd55ef 100644 --- a/include/emit.h +++ b/include/emit.h @@ -44,7 +44,7 @@ ANEW ANN Emitter new_emitter(MemPool); ANN void free_emitter(MemPool, Emitter); ANN m_bool emit_ast(const Env env, Ast ast); ANN m_bool emit_func_def(const Emitter emit, const Func_Def fdef); -ANN m_bool emit_exp_call1(const Emitter, const Func); +ANN m_bool emit_exp_call1(const Emitter, const Func, const bool is_static); ANN2(1) Instr emit_add_instr(const Emitter, const f_instr) __attribute__((returns_nonnull)); ANN Code* emit_class_code(const Emitter, const m_str); ANN m_bool emit_array_extend(const Emitter, const Type, const Exp); @@ -66,4 +66,11 @@ ANN static inline Instr emit_compound_addref(const Emitter emit, const Type t, c return !tflag(t, tflag_struct) ? emit_object_addref(emit, size, emit_var) : emit_struct_addref(emit, t, size, emit_var); } + +ANN static inline bool is_static_call(const Emitter emit, const Exp e) { + if(e->exp_type != ae_exp_dot) + return true; + const Exp_Dot *member = &e->d.exp_dot; + return GET_FLAG(member->base->type, final) || is_class(emit->gwion, member->base->type) || member->base->exp_type == ae_exp_cast; +} #endif diff --git a/include/vm.h b/include/vm.h index 8d90a8cb..1150ae41 100644 --- a/include/vm.h +++ b/include/vm.h @@ -31,10 +31,10 @@ struct VM_Code_ { bool is_memoize; }; -struct frame_t { +typedef struct frame_t { uint32_t push, pc; VM_Code code; -}; +} frame_t; typedef struct Shreduler_* Shreduler; typedef struct Emitter_ * Emitter;