java毕业论文外文文献翻译.pdf
《java毕业论文外文文献翻译.pdf》由会员分享,可在线阅读,更多相关《java毕业论文外文文献翻译.pdf(10页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、-.Advantages of Managed CodeMicrosoft intermediate language shares with Java byte code the idea that it is a low-level language withasimple syntax,which can be very quickly translated intonative machine code.Having this well-defineduniversal syntax for code has significant advantages.Platform indepe
2、ndencePlatform independenceFirst,it means that the same file containing byte code instructions can be placed on any platform;atruntime the final stage of compilation can then be easily accomplished so that the code will run onthatparticular platform.In other words,by compiling to IL we obtain platfo
3、rm independence for.NET,inmuch the same way as compiling to Java byte code gives Java platform independence.Performance improvementPerformance improvementIL is actually a bit more ambitious than Java bytecode.IL is always Just-In-Time compiled(known as JIT),whereas Java byte code was ofteninterprete
4、d.One of the disadvantages of Java was that,on execution,theprocess of translating from Javabyte code to native executable resulted in a loss of performance.Instead of compiling the entire application in one go(which could lead to a slow start-up time),theJITcompiler simply compiles each portion of
5、code as it is called(just-in-time).When code has beencompiled.once,the resultant native executable is stored until the application exits,so that it does not needto berecompiled the next time that portion of code is run.Microsoft argues that this process is moreefficientthan compiling the entire appl
6、ication code at the start,because of the likelihood that large portionsof anyapplication code will not actually be executed in any given run.Using the JIT compiler,such codewillnever be compiled.-考试资料-.This explains why we can expect that execution of managed IL code will be almost as fast as execut
7、ingnative machine code.What it doesnt explain is why Microsoft expects that we will get a performanceimprovement.The reason given for this is that,since the final stage of compilation takes place atruntime,the JIT compiler will know exactly what processor type the program will run on.This means that
8、 itcanoptimize the final executable code to take advantage of any features or particular machine codeinstructionsoffered by that particular processor.实际上,IL 比 Java 字节代码的作用还要大。IL 总是即时编译的(简称JIT),而 Java字节代码常常是解释型的,Java 的一个缺点是,在运行应用程序时,把Java 字节代码转换为内部可执行代码的过程可可能导致性能的损失。JIT 编译器并不是把整个应用程序一次编译完(这样会有很长的启动时间
9、),而是只编译它调用的那部分代码。代码编译过一次后,得到的内部可执行代码就存储起来,直到退出该应用程序为止,这样在下次运行这部分代码时,就不需要重新编译了。Microsoft 认为这个过程要比一开始就编译整个应用程序代码的效率高得多,因为任何应用程序的大部分代码实际上并不是在每次运行过程中都执行。使用 JIT 编译器,从来都不会编译这种代码从来都不会被编译。这解释了为什么托管IL 代码的执行几乎和内部机器代码的执行速度一样快,但是并没有说明为什么Microsoft 认为这会提高性能。其原因是编译过程的最后一部分是在运行时进行的,JIT 编译器确切地知道程序运行在什么类型的处理器上,利用该处理器
10、提供的任何特性或特定的机器代码指令来优化最后的可执行代码。传统的编译器会优化代码,但它们的优化过程是独立于代码所运行的特定处理器的。这是因为传统的编译器是在发布软件之前编译为内部机器可执行的代码。即编译器不知道代码所运行的处理器类型,例如该处理器是 x86 兼容处理器或 Alpha 处理器,这超出了基本操作的范围。例如Visual Studio 6 优化了一台一般的 Pentium机器,所以它生成的代码就不能利用Pentium III 处理器的硬件特性。相反,JIT 编译器不仅可以进行 Visual Studio6 所能完成的优化工作,还可以优化代码所运行的特定处理器。Traditional
11、compilers will optimize the code,but they can only perform optimizations that areindependentof the particular processor that the code will run on.This is because traditional compilerscompileto native executable before the software is shipped.This means that the compiler doesnt knowwhattype of proces
12、sor the code will run on beyond basic generalities,such as that it will be anx86-compatibleprocessor or an Alpha processor.Visual Studio 6,for example,optimizes for a genericPentium machine,so the code that it generates cannot take advantage of hardware features of Pentium III processors.Onthe other
13、 hand,the JIT compiler can do all the optimizations that Visual Studio 6 can,and in addition it-考试资料-.will optimize for the particular processor the code is running on.Language interoperabilityThe use of IL not only enables platform independence;it also facilitates language interoperability.Simplypu
14、t,you can compile to IL from one language,and this compiled code should then be interoperablewithcode that has been compiled to IL from another language.Youre probably now wondering which languages aside from C#are interoperable with.NET,so letsbriefly discuss how some of the other common languages
15、fit into.NET.Visual Basic.NETVisual Basic.NET has undergone a complete revamp from Visual Basic 6 to bring it up-to-datewith.NET.The way that Visual Basic has evolved over the last few years means that in its previous version,VisualBasic 6,it was not a suitable language for running.NET programs.For
16、example,it is heavilyintegratedinto COM and works by exposing only event handlers as source code to the developermost ofthe backgroundcode is not available as source code.Not only that,it does not support implementationinheritance,and the standard data types Visual Basic 6 uses are incompatible with
17、.NET.Visual Basic 6 wasupgraded to Visual Basic.NET,and the changes that were made to the language areso extensive you mightas well regard Visual Basic.NET as a new language.Existing Visual Basic 6 codedoes not compile asVisual Basic.NET code.Converting a Visual Basic 6 program to Visual Basic.NETre
18、quires extensivechanges to the code.However,Visual Studio.NET(the upgrade of VS for use with.NET)can do most of thechanges for you.If you attempt to read a Visual Basic 6 project into VisualStudio.NET,it will upgrade theproject for you,which means that it will rewrite the Visual Basic 6 source code
19、into Visual Basic.NETsource code.Although this means that the work involved for you isheavily cut down,you will need tocheck through the new Visual Basic.NET code to make sure that theproject still works as intended because-考试资料-.the conversion might not be perfect.One side effect of this language u
20、pgrade is that it is no longer possible to compile Visual Basic.NETtonative executable code.Visual Basic.NET compiles only to IL,just as C#does.If you need tocontinuecoding in Visual Basic 6,you may do so,but the executable code produced will completely ignorethe.NET Framework,and you ll need to kee
21、p Visual Studio 6 installed if you want to continue to work inthisdeveloper environment.Visual C+.NETVisual C+6 already had a large number of Microsoft-specific extensions on Windows.With VisualC+.NET,extensions have been added to support the.NET Framework.This means that existing C+sourcecode will
22、continue to compile to native executable code without modification.It also means,however,that it will run independently of the.NET runtime.If you want your C+code to run withinthe.NETFramework,then you can simply add the following line to the beginning of your code:#using You can also pass the flag/
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- java 毕业论文 外文 文献 翻译
限制150内