summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastien Hertz <shertz@google.com>2013-07-26 08:03:55 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-07-26 08:03:55 +0000
commit56eb9bc9da8d3863fef02891c2f4f2e4d996204d (patch)
treef29dbceb959ff35760924c9b9023639d84781f96
parenta6dd03ff8003d459ec8607d5449340c4b00fd8cb (diff)
parentb0f3f485c81266feff536ecafe26c164d21c5a43 (diff)
downloadart-56eb9bc9da8d3863fef02891c2f4f2e4d996204d.tar.gz
art-56eb9bc9da8d3863fef02891c2f4f2e4d996204d.tar.bz2
art-56eb9bc9da8d3863fef02891c2f4f2e4d996204d.zip
Merge "Avoid fetching instruction's first 16 bits twice." into dalvik-dev
-rw-r--r--runtime/dex_instruction.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/runtime/dex_instruction.h b/runtime/dex_instruction.h
index b0d85e672e..74789bbad3 100644
--- a/runtime/dex_instruction.h
+++ b/runtime/dex_instruction.h
@@ -281,9 +281,7 @@ class Instruction {
// Returns the opcode field of the instruction.
Code Opcode() const {
- const uint16_t* insns = reinterpret_cast<const uint16_t*>(this);
- int opcode = *insns & 0xFF;
- return static_cast<Code>(opcode);
+ return static_cast<Code>(Fetch16(0) & 0xFF);
}
void SetOpcode(Code opcode) {