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

Unified Diff: src/register-allocator-ia32.h

Issue 13746: Experimental: thread live register references to deferred code.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/toiger/
Patch Set: '' Created 12 years 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
Index: src/register-allocator-ia32.h
===================================================================
--- src/register-allocator-ia32.h (revision 969)
+++ src/register-allocator-ia32.h (working copy)
@@ -68,6 +68,14 @@
}
}
+ // Copy the reference counts from this register file to the other.
+ void CopyTo(RegisterFile* other);
+
+#ifdef DEBUG
+ // True if the reference counts all match the other register file.
+ bool Equals(RegisterFile* other);
+#endif
+
static const int kNumRegisters = 8;
private:
@@ -81,7 +89,7 @@
class RegisterAllocator BASE_EMBEDDED {
public:
- RegisterAllocator(CodeGenerator* cgen) : code_generator_(cgen) {}
+ explicit RegisterAllocator(CodeGenerator* cgen) : code_generator_(cgen) {}
int num_registers() const { return RegisterFile::kNumRegisters; }
@@ -105,6 +113,24 @@
// no_reg.
Register AllocateWithoutSpilling();
+ // Copy the internal state to a register file, to be restored later
+ // by RestoreFrom.
+ void SaveTo(RegisterFile* register_file) {
+ registers_.CopyTo(register_file);
+ }
+
+ void RestoreFrom(RegisterFile* register_file) {
+ register_file->CopyTo(&registers_);
+ }
+
+#ifdef DEBUG
+ // True if the reference counts of this allocator match those saved in the
+ // given register file.
+ bool Matches(RegisterFile* register_file) {
+ return registers_.Equals(register_file);
+ }
+#endif
+
private:
CodeGenerator* code_generator_;
RegisterFile registers_;

Powered by Google App Engine
This is Rietveld 408576698