| Index: src/register-allocator-ia32.h
|
| ===================================================================
|
| --- src/register-allocator-ia32.h (revision 1245)
|
| +++ src/register-allocator-ia32.h (working copy)
|
| @@ -28,97 +28,10 @@
|
| #ifndef V8_REGISTER_ALLOCATOR_IA32_H_
|
| #define V8_REGISTER_ALLOCATOR_IA32_H_
|
|
|
| -#include "macro-assembler.h"
|
| -
|
| namespace v8 { namespace internal {
|
|
|
|
|
| // -------------------------------------------------------------------------
|
| -// Results
|
| -//
|
| -// Results encapsulate the compile-time values manipulated by the code
|
| -// generator. They can represent registers or constants.
|
| -
|
| -class Result BASE_EMBEDDED {
|
| - public:
|
| - enum Type {
|
| - INVALID,
|
| - REGISTER,
|
| - CONSTANT
|
| - };
|
| -
|
| - // Construct an invalid result.
|
| - explicit Result(CodeGenerator* cgen) : type_(INVALID), cgen_(cgen) {}
|
| -
|
| - // Construct a register Result.
|
| - Result(Register reg, CodeGenerator* cgen);
|
| -
|
| - // Construct a Result whose value is a compile-time constant.
|
| - Result(Handle<Object> value, CodeGenerator * cgen)
|
| - : type_(CONSTANT),
|
| - cgen_(cgen) {
|
| - data_.handle_ = value.location();
|
| - }
|
| -
|
| - // The copy constructor and assignment operators could each create a new
|
| - // register reference.
|
| - Result(const Result& other) {
|
| - other.CopyTo(this);
|
| - }
|
| -
|
| - Result& operator=(const Result& other) {
|
| - if (this != &other) {
|
| - Unuse();
|
| - other.CopyTo(this);
|
| - }
|
| - return *this;
|
| - }
|
| -
|
| - ~Result() { Unuse(); }
|
| -
|
| - void Unuse();
|
| -
|
| - Type type() const { return type_; }
|
| -
|
| - bool is_valid() const { return type() != INVALID; }
|
| - bool is_register() const { return type() == REGISTER; }
|
| - bool is_constant() const { return type() == CONSTANT; }
|
| -
|
| - Register reg() const {
|
| - ASSERT(type() == REGISTER);
|
| - return data_.reg_;
|
| - }
|
| -
|
| - Handle<Object> handle() const {
|
| - ASSERT(type() == CONSTANT);
|
| - return Handle<Object>(data_.handle_);
|
| - }
|
| -
|
| - // Move this result to an arbitrary register. The register is not
|
| - // necessarily spilled from the frame or even singly-referenced outside
|
| - // it.
|
| - void ToRegister();
|
| -
|
| - // Move this result to a specified register. The register is spilled from
|
| - // the frame, and the register is singly-referenced (by this result)
|
| - // outside the frame.
|
| - void ToRegister(Register reg);
|
| -
|
| - private:
|
| - Type type_;
|
| -
|
| - union {
|
| - Register reg_;
|
| - Object** handle_;
|
| - } data_;
|
| -
|
| - CodeGenerator* cgen_;
|
| -
|
| - void CopyTo(Result* destination) const;
|
| -};
|
| -
|
| -
|
| -// -------------------------------------------------------------------------
|
| // Register file
|
| //
|
| // The register file tracks reference counts for the processor registers.
|
|
|