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

Unified Diff: src/interpreter/bytecode-register-allocator.h

Issue 1997653002: [interpreter] Bytecode register optimizer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Decouple a test from implementation. Created 4 years, 7 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/interpreter/bytecode-pipeline.cc ('k') | src/interpreter/bytecode-register-allocator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-register-allocator.h
diff --git a/src/interpreter/bytecode-register-allocator.h b/src/interpreter/bytecode-register-allocator.h
index a4f68459cbc4696e8501394dbf812ee0de773b73..b8f737be79386641907f6903123f592f23be838b 100644
--- a/src/interpreter/bytecode-register-allocator.h
+++ b/src/interpreter/bytecode-register-allocator.h
@@ -14,6 +14,7 @@ namespace interpreter {
class BytecodeArrayBuilder;
class Register;
+class TemporaryRegisterObserver;
class TemporaryRegisterAllocator final {
public:
@@ -54,6 +55,9 @@ class TemporaryRegisterAllocator final {
// Returns the number of temporary register allocations made.
int allocation_count() const { return allocation_count_; }
+ // Sets an observer for temporary register events.
+ void set_observer(TemporaryRegisterObserver* observer);
+
private:
// Allocate a temporary register.
int AllocateTemporaryRegister();
@@ -61,10 +65,17 @@ class TemporaryRegisterAllocator final {
ZoneSet<int> free_temporaries_;
int allocation_base_;
int allocation_count_;
+ TemporaryRegisterObserver* observer_;
DISALLOW_COPY_AND_ASSIGN(TemporaryRegisterAllocator);
};
+class TemporaryRegisterObserver {
+ public:
+ virtual ~TemporaryRegisterObserver() {}
+ virtual void TemporaryRegisterFreeEvent(Register reg) = 0;
+};
+
// A class that allows the instantiator to allocate temporary registers that are
// cleaned up when scope is closed.
class BytecodeRegisterAllocator final {
« no previous file with comments | « src/interpreter/bytecode-pipeline.cc ('k') | src/interpreter/bytecode-register-allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698