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

Unified Diff: src/fast-codegen.h

Issue 586002: Added helper functions for fixed register allocation. (Closed)
Patch Set: Created 10 years, 10 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
Index: src/fast-codegen.h
diff --git a/src/fast-codegen.h b/src/fast-codegen.h
index cbcb5bfa3b939413dc1fed3843fc25aee12e2ab7..4c1e04bc328ac0943070fedbc6eed3aa138c854f 100644
--- a/src/fast-codegen.h
+++ b/src/fast-codegen.h
@@ -79,13 +79,22 @@ class FastCodeGenerator: public AstVisitor {
FunctionLiteral* function() { return info_->function(); }
Scope* scope() { return info_->scope(); }
+ // Platform-specific fixed registers, all guaranteed distinct.
+ Register accumulator0();
+ Register accumulator1();
+ Register scratch0();
+ Register scratch1();
+ Register receiver_reg();
+ Register context_reg();
+
// AST node visit functions.
#define DECLARE_VISIT(type) virtual void Visit##type(type* node);
AST_NODE_LIST(DECLARE_VISIT)
#undef DECLARE_VISIT
- // Emit code to load the receiver from the stack into a given register.
- void EmitLoadReceiver(Register reg);
+ // Emit code to load the receiver from the stack into the fixed receiver
+ // register.
+ void EmitLoadReceiver();
// Emit code to check that the receiver has the same map as the
// compile-time receiver. Receiver is expected in {ia32-edx, x64-rdx,

Powered by Google App Engine
This is Rietveld 408576698