From 2852f8d5e26223025195211dc453e6c2234a7664 Mon Sep 17 00:00:00 2001 From: "whesse@chromium.org" Date: Thu, 4 Jun 2009 11:09:17 +0000 Subject: [PATCH] Declare register names as static constants rather than external globals. Review URL: http://codereview.chromium.org/119082 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2102 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/ia32/assembler-ia32.cc | 23 ----------------------- src/ia32/assembler-ia32.h | 34 +++++++++++++++++----------------- 2 files changed, 17 insertions(+), 40 deletions(-) diff --git a/src/ia32/assembler-ia32.cc b/src/ia32/assembler-ia32.cc index 3628975d21..434bf070fd 100644 --- a/src/ia32/assembler-ia32.cc +++ b/src/ia32/assembler-ia32.cc @@ -43,29 +43,6 @@ namespace v8 { namespace internal { -// ----------------------------------------------------------------------------- -// Implementation of Register - -Register eax = { 0 }; -Register ecx = { 1 }; -Register edx = { 2 }; -Register ebx = { 3 }; -Register esp = { 4 }; -Register ebp = { 5 }; -Register esi = { 6 }; -Register edi = { 7 }; -Register no_reg = { -1 }; - -XMMRegister xmm0 = { 0 }; -XMMRegister xmm1 = { 1 }; -XMMRegister xmm2 = { 2 }; -XMMRegister xmm3 = { 3 }; -XMMRegister xmm4 = { 4 }; -XMMRegister xmm5 = { 5 }; -XMMRegister xmm6 = { 6 }; -XMMRegister xmm7 = { 7 }; - - // ----------------------------------------------------------------------------- // Implementation of CpuFeatures diff --git a/src/ia32/assembler-ia32.h b/src/ia32/assembler-ia32.h index e09038a7f8..554a3cd4e8 100644 --- a/src/ia32/assembler-ia32.h +++ b/src/ia32/assembler-ia32.h @@ -79,15 +79,15 @@ struct Register { int code_; }; -extern Register eax; -extern Register ecx; -extern Register edx; -extern Register ebx; -extern Register esp; -extern Register ebp; -extern Register esi; -extern Register edi; -extern Register no_reg; +const Register eax = {0}; +const Register ecx = { 1 }; +const Register edx = { 2 }; +const Register ebx = { 3 }; +const Register esp = { 4 }; +const Register ebp = { 5 }; +const Register esi = { 6 }; +const Register edi = { 7 }; +const Register no_reg = { -1 }; struct XMMRegister { @@ -100,14 +100,14 @@ struct XMMRegister { int code_; }; -extern XMMRegister xmm0; -extern XMMRegister xmm1; -extern XMMRegister xmm2; -extern XMMRegister xmm3; -extern XMMRegister xmm4; -extern XMMRegister xmm5; -extern XMMRegister xmm6; -extern XMMRegister xmm7; +const XMMRegister xmm0 = { 0 }; +const XMMRegister xmm1 = { 1 }; +const XMMRegister xmm2 = { 2 }; +const XMMRegister xmm3 = { 3 }; +const XMMRegister xmm4 = { 4 }; +const XMMRegister xmm5 = { 5 }; +const XMMRegister xmm6 = { 6 }; +const XMMRegister xmm7 = { 7 }; enum Condition { // any value < 0 is considered no_condition