Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(357)

Unified Diff: src/a64/instructions-a64.h

Issue 195873009: Speed up A64 simulator by removing useless memcpy. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/a64/instructions-a64.h
diff --git a/src/a64/instructions-a64.h b/src/a64/instructions-a64.h
index f4bdbbf554bc2b27dae1bea9ff94b38e7e3df6cd..ccab39e3ac84e18f4c85b35cce2abdf171e78b40 100644
--- a/src/a64/instructions-a64.h
+++ b/src/a64/instructions-a64.h
@@ -119,14 +119,12 @@ enum Reg31Mode {
class Instruction {
public:
- Instr InstructionBits() const {
- Instr bits;
- memcpy(&bits, this, sizeof(bits));
- return bits;
+ V8_INLINE Instr InstructionBits() const {
+ return *reinterpret_cast<const Instr*>(this);
}
- void SetInstructionBits(Instr new_instr) {
- memcpy(this, &new_instr, sizeof(new_instr));
+ V8_INLINE void SetInstructionBits(Instr new_instr) {
+ *reinterpret_cast<Instr*>(this) = new_instr;
}
int Bit(int pos) const {
@@ -369,28 +367,6 @@ class Instruction {
return reinterpret_cast<uint8_t*>(this) + offset;
}
- uint32_t Literal32() {
- uint32_t literal;
- memcpy(&literal, LiteralAddress(), sizeof(literal));
-
- return literal;
- }
-
- uint64_t Literal64() {
- uint64_t literal;
- memcpy(&literal, LiteralAddress(), sizeof(literal));
-
- return literal;
- }
-
- float LiteralFP32() {
- return rawbits_to_float(Literal32());
- }
-
- double LiteralFP64() {
- return rawbits_to_double(Literal64());
- }
-
Instruction* NextInstruction() {
return this + kInstructionSize;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698