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

Unified Diff: src/virtual-frame-ia32.h

Issue 13665: Allow non-spilled frames into VisitCompareOperation, and allow them... (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
« no previous file with comments | « src/codegen-ia32.cc ('k') | src/virtual-frame-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/virtual-frame-ia32.h
===================================================================
--- src/virtual-frame-ia32.h (revision 978)
+++ src/virtual-frame-ia32.h (working copy)
@@ -40,7 +40,7 @@
class Result BASE_EMBEDDED {
public:
// Construct a register Result.
- explicit Result(Register reg, CodeGenerator* cgen);
+ Result(Register reg, CodeGenerator* cgen);
// Construct a Result whose value is a compile-time constant.
Result(Handle<Object> value, CodeGenerator * cgen) :
@@ -50,14 +50,16 @@
}
~Result() {
- // We have called Unuse() before Result goes out of scope.
- ASSERT(!is_register() || reg().is(no_reg));
+ if (is_register()) {
+ Unuse();
+ }
}
void Unuse();
bool is_register() const { return type() == REGISTER; }
bool is_constant() const { return type() == CONSTANT; }
+ bool is_valid() const { return type() != INVALID; }
Register reg() const {
ASSERT(type() == REGISTER);
@@ -69,8 +71,16 @@
return Handle<Object>(data_.handle_);
}
+ // Change a result to a register result. If the result is not already
+ // in a register, allocate a register from the code generator, and emit
+ // code to move the value into that register.
+ void ToRegister();
private:
- enum Type { REGISTER, CONSTANT };
+ enum Type {
+ REGISTER,
+ CONSTANT,
+ INVALID
+ };
Type type_;
@@ -85,9 +95,6 @@
};
-// A result in a register just means that the value can be read from the register
-
-
// -------------------------------------------------------------------------
// Virtual frame elements
//
« no previous file with comments | « src/codegen-ia32.cc ('k') | src/virtual-frame-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698