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

Unified Diff: src/lithium.h

Issue 9860028: Valgrind cleanliness, part 2: Delete lithium operand caches on exit. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review comments addressed Created 8 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 | src/lithium.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lithium.h
diff --git a/src/lithium.h b/src/lithium.h
index d1e2e3cdef2edc104f6e5831db0580694e869b45..2ccbf56c50c55597327730a4d76a84ce9c5ca26c 100644
--- a/src/lithium.h
+++ b/src/lithium.h
@@ -35,6 +35,14 @@
namespace v8 {
namespace internal {
+#define LITHIUM_OPERAND_LIST(V) \
+ V(ConstantOperand, CONSTANT_OPERAND) \
+ V(StackSlot, STACK_SLOT) \
+ V(DoubleStackSlot, DOUBLE_STACK_SLOT) \
+ V(Register, REGISTER) \
+ V(DoubleRegister, DOUBLE_REGISTER)
+
+
class LOperand: public ZoneObject {
public:
enum Kind {
@@ -52,14 +60,13 @@ class LOperand: public ZoneObject {
Kind kind() const { return KindField::decode(value_); }
int index() const { return static_cast<int>(value_) >> kKindFieldWidth; }
- bool IsConstantOperand() const { return kind() == CONSTANT_OPERAND; }
- bool IsStackSlot() const { return kind() == STACK_SLOT; }
- bool IsDoubleStackSlot() const { return kind() == DOUBLE_STACK_SLOT; }
- bool IsRegister() const { return kind() == REGISTER; }
- bool IsDoubleRegister() const { return kind() == DOUBLE_REGISTER; }
- bool IsArgument() const { return kind() == ARGUMENT; }
- bool IsUnallocated() const { return kind() == UNALLOCATED; }
- bool IsIgnored() const { return kind() == INVALID; }
+#define LITHIUM_OPERAND_PREDICATE(name, type) \
+ bool Is##name() const { return kind() == type; }
+ LITHIUM_OPERAND_LIST(LITHIUM_OPERAND_PREDICATE)
+ LITHIUM_OPERAND_PREDICATE(Argument, ARGUMENT)
+ LITHIUM_OPERAND_PREDICATE(Unallocated, UNALLOCATED)
+ LITHIUM_OPERAND_PREDICATE(Ignored, INVALID)
+#undef LITHIUM_OPERAND_PREDICATE
bool Equals(LOperand* other) const { return value_ == other->value_; }
void PrintTo(StringStream* stream);
@@ -69,9 +76,9 @@ class LOperand: public ZoneObject {
ASSERT(this->index() == index);
}
- // Calls SetUpCache() for each subclass. Don't forget to update this method
- // if you add a new LOperand subclass.
+ // Calls SetUpCache()/TearDownCache() for each subclass.
static void SetUpCaches();
+ static void TearDownCaches();
protected:
static const int kKindFieldWidth = 3;
@@ -265,6 +272,7 @@ class LConstantOperand: public LOperand {
}
static void SetUpCache();
+ static void TearDownCache();
private:
static const int kNumCachedOperands = 128;
@@ -300,6 +308,7 @@ class LStackSlot: public LOperand {
}
static void SetUpCache();
+ static void TearDownCache();
private:
static const int kNumCachedOperands = 128;
@@ -324,6 +333,7 @@ class LDoubleStackSlot: public LOperand {
}
static void SetUpCache();
+ static void TearDownCache();
private:
static const int kNumCachedOperands = 128;
@@ -348,6 +358,7 @@ class LRegister: public LOperand {
}
static void SetUpCache();
+ static void TearDownCache();
private:
static const int kNumCachedOperands = 16;
@@ -372,6 +383,7 @@ class LDoubleRegister: public LOperand {
}
static void SetUpCache();
+ static void TearDownCache();
private:
static const int kNumCachedOperands = 16;
« no previous file with comments | « no previous file | src/lithium.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698