From fc5827cfcd4ffafaca2c2fdf951538a09a233571 Mon Sep 17 00:00:00 2001 From: Shin-ichi MORITA Date: Sat, 17 Feb 2024 06:58:37 +0900 Subject: [PATCH] Removed support for rebinding methods. --- CMakeLists.txt | 2 +- include/xemmai/method.h | 11 ----------- src/code.cc | 5 +---- 3 files changed, 2 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fbec8ca5..577e341b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.12) -project(xemmai VERSION 202310) +project(xemmai VERSION 202402) find_package(Iconv REQUIRED) find_package(Threads REQUIRED) set(CMAKE_INSTALL_RPATH "\$ORIGIN/../lib") diff --git a/include/xemmai/method.h b/include/xemmai/method.h index 7c1f06da..7d12ea0e 100644 --- a/include/xemmai/method.h +++ b/include/xemmai/method.h @@ -19,12 +19,6 @@ class t_method { } ~t_method() = default; - -public: - t_object* f_function() const - { - return v_function; - } }; template<> @@ -43,11 +37,6 @@ struct t_type_of : t_uninstantiatable> a_stack[1] = p.v_self; return p.v_function->f_call_without_loop(a_stack, a_n); } - static size_t f_do_get_at(t_object* a_this, t_pvalue* a_stack) - { - a_stack[0] = a_this->f_type()->f_new(a_this->f_as().v_function, a_stack[2]); - return -1; - } }; } diff --git a/src/code.cc b/src/code.cc index aea41096..fb58a803 100644 --- a/src/code.cc +++ b/src/code.cc @@ -319,10 +319,7 @@ size_t t_code::f_loop(t_context* a_context) ++pc; auto p = static_cast(stack[0]); if (reinterpret_cast(p) < e_tag__OBJECT) goto label__THROW_NOT_SUPPORTED; - if (p->f_type() == f_global()->f_type()) - stack[0] = p->f_as().f_function(); - else if (!f_is_bindable(p)) - f_method_bind(stack); + if (!p->f_type()->v_bindable) f_method_bind(stack); } XEMMAI__CODE__BREAK XEMMAI__CODE__CASE(GLOBAL_GET)