究竟什么是字节code? [英] What exactly is bytecode?

查看:299
本文介绍了究竟什么是字节code?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

字节是code组装code和机code之间code的中间形式?而且是字节code相同的对象code?

Is byte code an intermediate form of code between assembly code and machine code? And is bytecode the same as object code?

这是我的想法 -
高水平的语言 - >大会语言 - >机code /对象code(0和1。针对不同的CPU不同)

This is what I think - High level language->Assembly language->Machine code/Object code (0s and 1s. different for different CPUs)

是不是这样?
 高水平的语言 - >大会语言 - >字节code(将虚拟机的照顾,将其转换成机器code) - >机器code

Is it like this? High level language->Assembly language-> Byte code(will be taken care of by virtual machine, which will convert it into machine code) -> Machine code

我读过这一点 - <一个href=\"http://stackoverflow.com/questions/1782415/what-is-the-difference-between-assembly-$c$c-and-byte$c$c\">SO-字节code VS汇编语言code ,但需要更好地理解它。

I've read this - SO- bytecode vs assembly language code , but need to understand it better

推荐答案

字节code无非就是一个虚拟机的指令集等等。这种实施可以或可以不涉及JIT到机器code。通常情况下,它没有。官方的Lua实现,例如,除$ P $点字节code,而不是将其转换为机器code。 .NET和Java实现几乎总是编译热路径成机器code更有效的执行。归根结底,这是一个虚拟机实现细节,无关与字节code本身,这是虚拟机只是说明。

Bytecode is nothing more than an instruction set for a VM. The implementation of this may or may not involve JIT to machine code. Often, it does not. The official Lua implementation, for example, interprets bytecode rather than converting it to machine code. .NET and Java implementations almost always compile "hot paths" into machine code for more efficient execution. Ultimately, this is a VM implementation detail and has nothing to do with bytecode itself, which is just instructions for the VM.

对象code,据我所知,总是机code。

Object code, AFAIK, is always machine code.

这篇关于究竟什么是字节code?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆