From 7e1c789685d718b22061aba34aaf92d141f1cc2c Mon Sep 17 00:00:00 2001 From: "yangguo@chromium.org" Date: Tue, 20 May 2014 15:20:02 +0000 Subject: [PATCH] Remove unused thread locals from debugger. R=ulan@chromium.org Review URL: https://codereview.chromium.org/286903003 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21391 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/arm/frames-arm.h | 2 -- src/arm64/frames-arm64.h | 1 - src/debug.cc | 9 +-------- src/debug.h | 6 ------ src/ia32/frames-ia32.h | 2 -- src/mips/frames-mips.h | 2 -- src/x64/frames-x64.h | 2 -- 7 files changed, 1 insertion(+), 23 deletions(-) diff --git a/src/arm/frames-arm.h b/src/arm/frames-arm.h index 6dd5186..ce65e88 100644 --- a/src/arm/frames-arm.h +++ b/src/arm/frames-arm.h @@ -29,8 +29,6 @@ const RegList kJSCallerSaved = const int kNumJSCallerSaved = 4; -typedef Object* JSCallerSavedBuffer[kNumJSCallerSaved]; - // Return the code of the n-th caller-saved register available to JavaScript // e.g. JSCallerSavedReg(0) returns r0.code() == 0 int JSCallerSavedCode(int n); diff --git a/src/arm64/frames-arm64.h b/src/arm64/frames-arm64.h index 3996bd7..7ac274a 100644 --- a/src/arm64/frames-arm64.h +++ b/src/arm64/frames-arm64.h @@ -15,7 +15,6 @@ const int kNumRegs = kNumberOfRegisters; // Registers x0-x17 are caller-saved. const int kNumJSCallerSaved = 18; const RegList kJSCallerSaved = 0x3ffff; -typedef Object* JSCallerSavedBuffer[kNumJSCallerSaved]; // Number of registers for which space is reserved in safepoints. Must be a // multiple of eight. diff --git a/src/debug.cc b/src/debug.cc index a994eb0..b13a163 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -40,7 +40,6 @@ Debug::Debug(Isolate* isolate) promise_catch_handlers_(0), promise_getters_(0), isolate_(isolate) { - memset(registers_, 0, sizeof(JSCallerSavedBuffer)); ThreadInit(); } @@ -518,10 +517,7 @@ void Debug::ThreadInit() { char* Debug::ArchiveDebug(char* storage) { char* to = storage; OS::MemCopy(to, reinterpret_cast(&thread_local_), sizeof(ThreadLocal)); - to += sizeof(ThreadLocal); - OS::MemCopy(to, reinterpret_cast(®isters_), sizeof(registers_)); ThreadInit(); - ASSERT(to <= storage + ArchiveSpacePerThread()); return storage + ArchiveSpacePerThread(); } @@ -530,15 +526,12 @@ char* Debug::RestoreDebug(char* storage) { char* from = storage; OS::MemCopy( reinterpret_cast(&thread_local_), from, sizeof(ThreadLocal)); - from += sizeof(ThreadLocal); - OS::MemCopy(reinterpret_cast(®isters_), from, sizeof(registers_)); - ASSERT(from <= storage + ArchiveSpacePerThread()); return storage + ArchiveSpacePerThread(); } int Debug::ArchiveSpacePerThread() { - return sizeof(ThreadLocal) + sizeof(JSCallerSavedBuffer); + return sizeof(ThreadLocal); } diff --git a/src/debug.h b/src/debug.h index 80e6970..9a11047 100644 --- a/src/debug.h +++ b/src/debug.h @@ -350,11 +350,6 @@ class Debug { return reinterpret_cast(address); } - // Support for saving/restoring registers when handling debug break calls. - Object** register_address(int r) { - return ®isters_[r]; - } - static const int kEstimatedNofDebugInfoEntries = 16; static const int kEstimatedNofBreakPointsInFunction = 16; @@ -586,7 +581,6 @@ class Debug { }; // Storage location for registers when handling debug break calls - JSCallerSavedBuffer registers_; ThreadLocal thread_local_; void ThreadInit(); diff --git a/src/ia32/frames-ia32.h b/src/ia32/frames-ia32.h index fcfabda..1290ad6 100644 --- a/src/ia32/frames-ia32.h +++ b/src/ia32/frames-ia32.h @@ -24,8 +24,6 @@ const RegList kJSCallerSaved = const int kNumJSCallerSaved = 5; -typedef Object* JSCallerSavedBuffer[kNumJSCallerSaved]; - // Number of registers for which space is reserved in safepoints. const int kNumSafepointRegisters = 8; diff --git a/src/mips/frames-mips.h b/src/mips/frames-mips.h index c7b88aa..5666f64 100644 --- a/src/mips/frames-mips.h +++ b/src/mips/frames-mips.h @@ -87,8 +87,6 @@ const RegList kSafepointSavedRegisters = kJSCallerSaved | kCalleeSaved; const int kNumSafepointSavedRegisters = kNumJSCallerSaved + kNumCalleeSaved; -typedef Object* JSCallerSavedBuffer[kNumJSCallerSaved]; - const int kUndefIndex = -1; // Map with indexes on stack that corresponds to codes of saved registers. const int kSafepointRegisterStackIndexMap[kNumRegs] = { diff --git a/src/x64/frames-x64.h b/src/x64/frames-x64.h index 43c1196..8813030 100644 --- a/src/x64/frames-x64.h +++ b/src/x64/frames-x64.h @@ -18,8 +18,6 @@ const RegList kJSCallerSaved = const int kNumJSCallerSaved = 5; -typedef Object* JSCallerSavedBuffer[kNumJSCallerSaved]; - // Number of registers for which space is reserved in safepoints. const int kNumSafepointRegisters = 16; -- 2.7.4