Remi, I'm curious why doesn't @Hidden on the invoker method solve your problem?

Best regards,
Vladimir Ivanov

On 5/11/16 3:44 PM, Remi Forax wrote:
Hi all,
changing the behavior of defineAnonymousClass in 9 is huge burden for me and i 
believe for anybody that maintains a dynamic language runtime.

As an implementer, being able to choose the package of an anonymous class is an 
important feature.
I use to choose carefully the package name for:
- filtering the stack trace element that will be shown or not to the user.
  This patch specifically broke the stack trace that my runtime will emit because it 
removes "java.lang.invoke".
  I'm not the only one to filter out stacktrace element that starts with 
"java.lang.invoke", Nashorn or JRuby do that too.
  I can modify the code to use the new StackWalking API if all the method 
handle form artifact are marked with an interface or something like this.

- generate proxy in an existing package

- generate code specialization (specialization of an existing method for some 
primitive types) of an existing class in an existing package
  (for the specialization, i specialize the constant pool at runtime so i have 
no choice but to use defineAnonymousClass).

I understand that being able to generate a class in any package do not work 
well with the jigsaw view of the world but that's why defineAnonymousClass is 
in Unsafe after all.


----- Mail original -----
De: "shilpi rastogi" <>
À:, "John Rose" <>, "Michael 
Haupt" <>,
"paul sandoz" <>, "Vladimir Ivanov" 
Envoyé: Mercredi 11 Mai 2016 13:24:09
Objet: RFR[9]:Fix java/lang/invoke/MethodHandleImpl's use of    

Hi All,

Please review the following-

Solution: Changed anonymous class package name with the package name of
its host class.

Two approaches to solve this-
1.  Parse .class and get the class name index form constant pool and
patch it with new name

2. Create class with new name (With ASM)

Which approach is better?


mlvm-dev mailing list

Reply via email to