Native methods do not have Java bytecode. Native methods are implemented in foreign programming languages. In our model, native methods are implemented via ASM rules, hence they cannot be checked in the ASM model itself. We have to check from outside that the implementation of each native method is correct and does not change the state of the JVM in an unsafe way.
The check for a native method ensures that the virtual machine has native code for the method and knows what to do when the method is called. Since the only native methods are clone and equal, only those two methods are accepted as native.
We could check at run-time that the return value of a native method is of the return type of the method. However, such a check cannot be performed by the bytecode veri_er in the next chapters. The implementor of a native method is responsible that the method returns always values of the right type.
For example, the implementor of the native method clone of class Object must ensure that this method returns a valid reference and not a value of a primitive type.
JVM Related Interview Questions
|Java Script Interview Questions||Adv Java Interview Questions|
|Core Java Interview Questions||AJAX Interview Questions|
|Android Interview Questions||Java applet Interview Questions|
|Java 8 Interview Questions||JBOSS Interview Questions|
|Advanced jQuery Interview Questions||Apache Tomcat Interview Questions|
|Application Virtualization Interview Questions||Java 9 Interview Questions|
The Imperative Core Javai Of Java
The Procedural Extension Javac Of Javai
The Object-oriented Extension Javao Of Javac
The Exception-handling Extension Javae Of Javao
The Concurrent Extension Javat Of Javae
Java Is Type Safe
The Jvmi Submachine
The Procedural Extension Jvmc Of Jvmi
The Object-oriented Extension Jvmo Of Jvmc
The Exception-handling Extension Jvme Of Jvmo
Correctness Of The Compiler
The Defensive Virtual Machine
Bytecode Type Assignments
The Diligent Virtual Machine
The Dynamic Virtual Machine
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.