From: Jean Privat Date: Thu, 7 May 2015 14:11:40 +0000 (-0400) Subject: compiler: use `adapt_signature` to simplify and clean `table_send` X-Git-Tag: v0.7.5~74^2~1 X-Git-Url: http://nitlanguage.org compiler: use `adapt_signature` to simplify and clean `table_send` Signed-off-by: Jean Privat --- diff --git a/src/compiler/separate_compiler.nit b/src/compiler/separate_compiler.nit index 34e7be4..3e7fbcb 100644 --- a/src/compiler/separate_compiler.nit +++ b/src/compiler/separate_compiler.nit @@ -1436,13 +1436,14 @@ class SeparateCompilerVisitor if compiler.modelbuilder.toolcontext.opt_invocation_metrics.value then add("count_invoke_by_tables++;") assert arguments.length == mmethod.intro.msignature.arity + 1 else debug("Invalid arity for {mmethod}. {arguments.length} arguments given.") - var recv = arguments.first var res0 = before_send(mmethod, arguments) var runtime_function = mmethod.intro.virtual_runtime_function var msignature = runtime_function.called_signature + adapt_signature(mmethod.intro, arguments) + var res: nullable RuntimeVariable var ret = msignature.return_mtype if ret == null then @@ -1451,18 +1452,7 @@ class SeparateCompilerVisitor res = self.new_var(ret) end - var ss = new FlatBuffer - - ss.append("{recv}") - for i in [0..msignature.arity[ do - var a = arguments[i+1] - var t = msignature.mparameters[i].mtype - if i == msignature.vararg_rank then - t = arguments[i+1].mcasttype - end - a = self.autobox(a, t) - ss.append(", {a}") - end + var ss = arguments.join(", ") var const_color = mentity.const_color var ress