Chromium Code Reviews| Index: src/x64/register-allocator-x64.cc |
| =================================================================== |
| --- src/x64/register-allocator-x64.cc (revision 2241) |
| +++ src/x64/register-allocator-x64.cc (working copy) |
| @@ -39,19 +39,23 @@ |
| void Result::ToRegister() { |
| ASSERT(is_valid()); |
| if (is_constant()) { |
| - // TODO(X64): Handle constant results. |
| - /* |
| Result fresh = CodeGeneratorScope::Current()->allocator()->Allocate(); |
| ASSERT(fresh.is_valid()); |
| - if (CodeGeneratorScope::Current()->IsUnsafeSmi(handle())) { |
| - CodeGeneratorScope::Current()->LoadUnsafeSmi(fresh.reg(), handle()); |
| + if (handle()->IsSmi()) { |
| + if (CodeGeneratorScope::Current()->IsUnsafeSmi(handle())) { |
| + CodeGeneratorScope::Current()->LoadUnsafeSmi(fresh.reg(), handle()); |
| + } else { |
| + CodeGeneratorScope::Current()->masm()->movq(fresh.reg(), |
| + handle(), |
| + RelocInfo::NONE); |
|
William Hesse
2009/06/22 19:14:23
Could you say
CodeGeneratorScope::Current()->masm(
Mads Ager (chromium)
2009/06/22 19:25:00
Done. And also done for the same piece of code be
|
| + } |
| } else { |
| - CodeGeneratorScope::Current()->masm()->Set(fresh.reg(), |
| - Immediate(handle())); |
| + CodeGeneratorScope::Current()->masm()->movq(fresh.reg(), |
| + handle(), |
| + RelocInfo::EMBEDDED_OBJECT); |
| } |
| // This result becomes a copy of the fresh one. |
| *this = fresh; |
| - */ |
| } |
| ASSERT(is_register()); |
| } |