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

Unified Diff: src/compiler/instruction.h

Issue 1287383003: Re-reland: Remove register index/code indirection (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix MIPS tests again Created 5 years, 2 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 | « src/compiler/greedy-allocator.cc ('k') | src/compiler/instruction.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/instruction.h
diff --git a/src/compiler/instruction.h b/src/compiler/instruction.h
index a0718f3c215a023a1c204b9d6b0ae746ee37c596..fab184adf8090681b2aec00dcc2cfb4964a6a8b4 100644
--- a/src/compiler/instruction.h
+++ b/src/compiler/instruction.h
@@ -14,8 +14,9 @@
#include "src/compiler/frame.h"
#include "src/compiler/instruction-codes.h"
#include "src/compiler/opcodes.h"
-#include "src/compiler/register-configuration.h"
#include "src/compiler/source-position.h"
+#include "src/macro-assembler.h"
+#include "src/register-configuration.h"
#include "src/zone-allocator.h"
namespace v8 {
@@ -373,9 +374,23 @@ class AllocatedOperand : public InstructionOperand {
}
int index() const {
+ DCHECK(STACK_SLOT == allocated_kind() ||
+ DOUBLE_STACK_SLOT == allocated_kind());
return static_cast<int64_t>(value_) >> IndexField::kShift;
}
+ Register GetRegister() const {
+ DCHECK(REGISTER == allocated_kind() || DOUBLE_REGISTER == allocated_kind());
+ return Register::from_code(static_cast<int64_t>(value_) >>
+ IndexField::kShift);
+ }
+
+ DoubleRegister GetDoubleRegister() const {
+ DCHECK(REGISTER == allocated_kind() || DOUBLE_REGISTER == allocated_kind());
+ return DoubleRegister::from_code(static_cast<int64_t>(value_) >>
+ IndexField::kShift);
+ }
+
AllocatedKind allocated_kind() const {
return AllocatedKindField::decode(value_);
}
« no previous file with comments | « src/compiler/greedy-allocator.cc ('k') | src/compiler/instruction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698