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

Unified Diff: src/assembler.cc

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/assembler.h ('k') | src/compiler/c-linkage.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/assembler.cc
diff --git a/src/assembler.cc b/src/assembler.cc
index dd05a07750d12d7347d358e53c90f451730cd5b3..357d50d0934bed9c90afd6801e5a9e18dd8270c6 100644
--- a/src/assembler.cc
+++ b/src/assembler.cc
@@ -53,6 +53,7 @@
#include "src/regexp/jsregexp.h"
#include "src/regexp/regexp-macro-assembler.h"
#include "src/regexp/regexp-stack.h"
+#include "src/register-configuration.h"
#include "src/runtime/runtime.h"
#include "src/simulator.h" // For flushing instruction cache.
#include "src/snapshot/serialize.h"
@@ -105,6 +106,37 @@ namespace v8 {
namespace internal {
// -----------------------------------------------------------------------------
+// Common register code.
+
+const char* Register::ToString() {
+ // This is the mapping of allocation indices to registers.
+ DCHECK(reg_code >= 0 && reg_code < kNumRegisters);
+ return RegisterConfiguration::ArchDefault()->GetGeneralRegisterName(reg_code);
+}
+
+
+bool Register::IsAllocatable() const {
+ return ((1 << reg_code) &
+ RegisterConfiguration::ArchDefault()
+ ->allocatable_general_codes_mask()) != 0;
+}
+
+
+const char* DoubleRegister::ToString() {
+ // This is the mapping of allocation indices to registers.
+ DCHECK(reg_code >= 0 && reg_code < kMaxNumRegisters);
+ return RegisterConfiguration::ArchDefault()->GetDoubleRegisterName(reg_code);
+}
+
+
+bool DoubleRegister::IsAllocatable() const {
+ return ((1 << reg_code) &
+ RegisterConfiguration::ArchDefault()
+ ->allocatable_double_codes_mask()) != 0;
+}
+
+
+// -----------------------------------------------------------------------------
// Common double constants.
struct DoubleConstant BASE_EMBEDDED {
« no previous file with comments | « src/assembler.h ('k') | src/compiler/c-linkage.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698