I noticed you added your instruction by replacing one of the "unused" entries. Would things have been more complicated if there weren't any of those left?
Or is there a strict limit to the number of instructions, with existing "unused" entries for all of the free ones?
Correct. To view the JIT-emitted code, you can either use a debugger or set a special environment variable (COMPlus_JitDisasm='NameOfMyMethod') that tells the JIT to emit some logging about the code it generates for that method (it appears this is what the author of the blog post did).
Another easier way is just to run it under Visual Studio debugging session, put breakpoint on the code one wants to see and select "Show Disassembly" view.
I'm aware of this method but I've found it difficult in practice, you want to be running in Release mode for the JIT optimisatinos. Then due to method inlining your breakpoint might get inlined somewhere that "just my code" thinks is not your code. You rarely want "just my code" off in practice, so it becomes cumbersome to toggle off/on.
I think if you tried to publish an article where you tried to add an opcode to an existing JVM... Oracle would nastygram you even if you never released the source code or even if you didn't do it to a JVM based on theirs.
Something is seriously wrong with some companies.
Edit: To those downvoting, remember, if you disagree, post a reply.
Oracle gets a bit around bad reputation on HN circles, but lot of us on the enterprise world actually do like their software.
As for Java, they were already selling Java based products around 2000 and former Sun employees like James Gosling, were not happy with Google actions but Sun had run out of money for any kind of lawsuits.
Also it is easy to write angry posts about Oracle's decisions, but if Google, Red-Hat or IBM actually cared that much about Java's future they would have given work to those driving the future of the language, instead of ignoring them.
Java is just... disappointing. I learned Java 5 (1.5) a decade ago in high school, for the AP test, and it's just made very little real progress since, particularly in comparison to the rest of the field.
I look at all of the innovations and convenience features that C#(an unashamed Java clone at the start) has introduced in the meantime, and it makes me wonder what is so broken with Java.
I deslike C a lot, however it still is probably the only programming language with more market share than Java.
C design is driven by committee with deep respect for backwards compatibility, despite the inherent security flaws, the language differences between C11 and C89 are superficial.
Likewise, in spite of having Oracle at the helm, Java's design is driven by the JEP working group.
When the majority of the world depends on Java, cannot add language features just because they look cool.
C# moves fast because it mostly only Microsoft calling the shot, even if they are now taking input via Github.
We just saw Java politics recently with IBM and Red-Hat vetting jigsaw because it isn't a copy of OSGi.
> C# moves fast because it mostly only Microsoft calling the shot, even if they are now taking input via Github.
Is Microsoft, RedHat, JetBrains, Unity, Samsung and Google (Also Mono and Xamarin - though they are now part of Microsoft) - as well as the wider community via GitHub etc