From 9457a7b6c2ad17f733018118fe5e656c88501bf6 Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Fri, 27 Feb 2015 21:02:54 +0700 Subject: [PATCH] sepcomp: shortcut an inline most intern methods of Object Signed-off-by: Jean Privat --- src/compiler/separate_compiler.nit | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- 1.7.9.5