From: Jean Privat Date: Fri, 27 Feb 2015 14:02:54 +0000 (+0700) Subject: sepcomp: shortcut an inline most intern methods of Object X-Git-Tag: v0.7.3~43^2~1 X-Git-Url: http://nitlanguage.org sepcomp: shortcut an inline most intern methods of Object Signed-off-by: Jean Privat --- diff --git a/src/compiler/separate_compiler.nit b/src/compiler/separate_compiler.nit index 4321eb0..a33c098 100644 --- a/src/compiler/separate_compiler.nit +++ b/src/compiler/separate_compiler.nit @@ -1163,6 +1163,12 @@ class SeparateCompilerVisitor return direct_call(tgs.first, args) end end + # Shortcut intern methods as they are not usually redefinable + if callsite.mpropdef.is_intern and callsite.mproperty.name != "object_id" then + # `object_id` is the only redefined intern method, so it can not be directly called. + # TODO find a less ugly approach? + return direct_call(callsite.mpropdef, args) + end return super end