decoration decoration
Stories

GROKLAW
When you want to know more...
decoration
For layout only
Home
Archives
Site Map
Search
About Groklaw
Awards
Legal Research
Timelines
ApplevSamsung
ApplevSamsung p.2
ArchiveExplorer
Autozone
Bilski
Cases
Cast: Lawyers
Comes v. MS
Contracts/Documents
Courts
DRM
Gordon v MS
GPL
Grokdoc
HTML How To
IPI v RH
IV v. Google
Legal Docs
Lodsys
MS Litigations
MSvB&N
News Picks
Novell v. MS
Novell-MS Deal
ODF/OOXML
OOXML Appeals
OraclevGoogle
Patents
ProjectMonterey
Psystar
Quote Database
Red Hat v SCO
Salus Book
SCEA v Hotz
SCO Appeals
SCO Bankruptcy
SCO Financials
SCO Overview
SCO v IBM
SCO v Novell
SCO:Soup2Nuts
SCOsource
Sean Daly
Software Patents
Switch to Linux
Transcripts
Unix Books

Gear

Groklaw Gear

Click here to send an email to the editor of this weblog.


You won't find me on Facebook


Donate

Donate Paypal


No Legal Advice

The information on Groklaw is not intended to constitute legal advice. While Mark is a lawyer and he has asked other lawyers and law students to contribute articles, all of these articles are offered to help educate, not to provide specific legal advice. They are not your lawyers.

Here's Groklaw's comments policy.


What's New

STORIES
No new stories

COMMENTS last 48 hrs
No new comments


Sponsors

Hosting:
hosted by ibiblio

On servers donated to ibiblio by AMD.

Webmaster
Dalvik is register-based | 286 comments | Create New Account
Comments belong to whoever posts them. Please notify us of inappropriate comments.
Dalvik is register-based
Authored by: Anonymous on Monday, May 21 2012 @ 06:16 PM EDT
A Java VM is stack-based. Dalvik is register-based.

The difference has to do with how the bytecode instructions do their work.
In compiled Java code, the bytecode instructions push temporary values
on a stack, and/or take their arguments off a stack.

So code like X = Y + 5;

In a Java VM, it would produce something like this:
- An instruction to get field Y's value, and push it on the stack
- An instruction to push the number 5 on the stack
- An instruction to pop two numbers off the stack and add them together,
pushing the result on the stack
- An instruction to pop a number off the stack and store it into field X.
That is stack-based bytecode.

In Dalvik (register-based), you would instead have something sort of like
this:
- An instruction to get field Y's value and put it in register 4.
- An instruction to put the number 5 into register 1.
- An instruction to add together registers 4 and 1, and store the result in
register 6.
- An instruction to store the result from register 6 into the field X.

Anyway, you can see that the details are different, but both types of
instruction set allow you to carry out any kind of computations.

In order to "simulate execution" of Java bytecodes, you would need to

pretend to execute them and keep track of what happens to the stack. To
simulate execution of Dalvik bytecodes, you would have to simulate the
register file. But the optimization Oracle is challenging with their '104
patent is performed on Java bytecodes by the dex compiler tool, so it
would need to simulate that stack in order to "simulate execution" of
the
instructions being optimized (the Java bytecode instructions).

[ Reply to This | Parent | # ]

IIRC it was a google argument
Authored by: jjs on Monday, May 21 2012 @ 06:19 PM EDT
correction - it's Sun/Oracle's JVM that's stack-based, dalvik
is register-based (which is better for small memory and slow
memory, what you find in embedded devices).

A stack is like the stack of plates in a buffet line at an
"all you can eat" restaurant. You add by dumping plates in
the top, and you can only remove from the top.

---
(Note IANAL, I don't play one on TV, etc, consult a practicing attorney, etc,
etc)

[ Reply to This | Parent | # ]

Groklaw © Copyright 2003-2013 Pamela Jones.
All trademarks and copyrights on this page are owned by their respective owners.
Comments are owned by the individual posters.

PJ's articles are licensed under a Creative Commons License. ( Details )