Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Re: java and goto instuction! amazing!

Reply
Thread Tools

Re: java and goto instuction! amazing!

 
 
Tor Iver Wilhelmsen
Guest
Posts: n/a
 
      08-23-2003
"Amir Pashazadeh" <(E-Mail Removed)> writes:

> I decompiled a class file (using 3 different decompilers for
> accurancy), and every time I got the same source code, there is
> something amazing in it, it has "goto" instruction! how can it be?


Because VM instruction set is not the same as Java language keywords.

> does JVM (as executor) supports "goto" instruction, but no standard
> compiler supports it yet? so a custom compiler can use it?


The VM uses "goto" to jump around in the same sense x86 uses "jmp".
You need to have some sort of jumping instruction.

The "gotos" come from java-the-language loops (for, while) and sundry
others (break, continue).
 
Reply With Quote
 
 
 
 
David Off
Guest
Posts: n/a
 
      08-23-2003
Tor Iver Wilhelmsen wrote:
> "Amir Pashazadeh" <(E-Mail Removed)> writes:
>
>
>>I decompiled a class file (using 3 different decompilers for
>>accurancy), and every time I got the same source code, there is
>>something amazing in it, it has "goto" instruction! how can it be?

>
>
> Because VM instruction set is not the same as Java language keywords.
>
>
>>does JVM (as executor) supports "goto" instruction, but no standard
>>compiler supports it yet? so a custom compiler can use it?

>
>
> The VM uses "goto" to jump around in the same sense x86 uses "jmp".
> You need to have some sort of jumping instruction.
>


But to answer the original poster's question, you could write a compiler
that compiled to JVM bytecodes that supported gotos if you want. But
the language wouldn't be Java.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Holy boop: goto for Java markspace Java 37 08-08-2012 12:23 PM
C++ and goto - can I? Uzytkownik C++ 1 04-06-2005 09:42 AM
GOTO this link EVERY DAY and HELP Feed the STARVING world. AK Computer Support 11 11-02-2003 06:48 PM
Re: java and goto instuction! amazing! E.C. Bäck Java 0 08-25-2003 02:31 AM
Re: java and goto instuction! amazing! Roedy Green Java 1 08-24-2003 07:32 PM



Advertisments