为什么 JSR/RET 不推荐使用 Java 字节码?

2023-08-23Java开发问题
0

本文介绍了为什么 JSR/RET 不推荐使用 Java 字节码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

有人知道为什么 JSR/RET 字节码对在 Java 6 中被弃用了吗?

Does anyone know why the JSR/RET bytecode pair is deprecated in Java 6?

我在网上找到的唯一有意义的解释是,它们使运行时的代码分析变得越来越难执行.有人知道其他原因吗?

The only meaningful explanation I found on the net was that they made code analysis by the runtime harder and slower to perform. Does anyone know another reason?

推荐答案

JSR 和 RET 使字节码验证比其他方式更困难,因为放宽了一些正常的字节码约束(例如在JSR 的入口).好处非常小(在某些情况下可能会使用更小的方法),并且验证器在处理奇怪的 JSR/RET 模式(以及潜在的安全漏洞,以及与完整验证相关的运行时成本)方面的持续困难使其成为一个无用的功能继续拥有.

JSR and RET make bytecode verification a lot more difficult than it might otherwise be due to the relaxation of some normal bytecode constraints (such as having a consistent stack shape on entry to a JSR). The upside is very minor (potentially slightly smaller methods in some cases) and the continuing difficulties in the verifier dealing with odd JSR/RET patterns (and potential security vulnerabilities, and the associated runtime cost of full verification) make it a non-useful feature to continue having.

堆栈映射和由于数据而启用的轻量级验证器在类加载期间实现了巨大的性能提升,同时又不牺牲安全性.

Stack maps and the lighter-weight verifier that is enabled as a result of the data are a big performance win during class loading for no sacrifice in safety.

这篇关于为什么 JSR/RET 不推荐使用 Java 字节码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

如何使用 JAVA 向 COM PORT 发送数据?
How to send data to COM PORT using JAVA?(如何使用 JAVA 向 COM PORT 发送数据?)...
2024-08-25 Java开发问题
21

如何使报表页面方向更改为“rtl"?
How to make a report page direction to change to quot;rtlquot;?(如何使报表页面方向更改为“rtl?)...
2024-08-25 Java开发问题
19

在 Eclipse 项目中使用西里尔文 .properties 文件
Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)...
2024-08-25 Java开发问题
18

有没有办法在 Java 中检测 RTL 语言?
Is there any way to detect an RTL language in Java?(有没有办法在 Java 中检测 RTL 语言?)...
2024-08-25 Java开发问题
11

如何在 Java 中从 DB 加载资源包消息?
How to load resource bundle messages from DB in Java?(如何在 Java 中从 DB 加载资源包消息?)...
2024-08-25 Java开发问题
13

如何更改 Java 中的默认语言环境设置以使其保持一致?
How do I change the default locale settings in Java to make them consistent?(如何更改 Java 中的默认语言环境设置以使其保持一致?)...
2024-08-25 Java开发问题
13