Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 32 | 32 |
| 33 namespace v8 { | 33 namespace v8 { |
| 34 namespace internal { | 34 namespace internal { |
| 35 | 35 |
| 36 // ------------------------------------------------------------------------- | 36 // ------------------------------------------------------------------------- |
| 37 // Result implementation. | 37 // Result implementation. |
| 38 | 38 |
| 39 void Result::ToRegister() { | 39 void Result::ToRegister() { |
| 40 ASSERT(is_valid()); | 40 ASSERT(is_valid()); |
| 41 if (is_constant()) { | 41 if (is_constant()) { |
| 42 // TODO(X64): Handle constant results. | |
| 43 /* | |
| 44 Result fresh = CodeGeneratorScope::Current()->allocator()->Allocate(); | 42 Result fresh = CodeGeneratorScope::Current()->allocator()->Allocate(); |
| 45 ASSERT(fresh.is_valid()); | 43 ASSERT(fresh.is_valid()); |
| 46 if (CodeGeneratorScope::Current()->IsUnsafeSmi(handle())) { | 44 if (handle()->IsSmi()) { |
| 47 CodeGeneratorScope::Current()->LoadUnsafeSmi(fresh.reg(), handle()); | 45 if (CodeGeneratorScope::Current()->IsUnsafeSmi(handle())) { |
| 46 CodeGeneratorScope::Current()->LoadUnsafeSmi(fresh.reg(), handle()); | |
| 47 } else { | |
| 48 CodeGeneratorScope::Current()->masm()->movq(fresh.reg(), | |
| 49 handle(), | |
| 50 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
| |
| 51 } | |
| 48 } else { | 52 } else { |
| 49 CodeGeneratorScope::Current()->masm()->Set(fresh.reg(), | 53 CodeGeneratorScope::Current()->masm()->movq(fresh.reg(), |
| 50 Immediate(handle())); | 54 handle(), |
| 55 RelocInfo::EMBEDDED_OBJECT); | |
| 51 } | 56 } |
| 52 // This result becomes a copy of the fresh one. | 57 // This result becomes a copy of the fresh one. |
| 53 *this = fresh; | 58 *this = fresh; |
| 54 */ | |
| 55 } | 59 } |
| 56 ASSERT(is_register()); | 60 ASSERT(is_register()); |
| 57 } | 61 } |
| 58 | 62 |
| 59 | 63 |
| 60 void Result::ToRegister(Register target) { | 64 void Result::ToRegister(Register target) { |
| 61 ASSERT(is_valid()); | 65 ASSERT(is_valid()); |
| 62 if (!is_register() || !reg().is(target)) { | 66 if (!is_register() || !reg().is(target)) { |
| 63 Result fresh = CodeGeneratorScope::Current()->allocator()->Allocate(target); | 67 Result fresh = CodeGeneratorScope::Current()->allocator()->Allocate(target); |
| 64 ASSERT(fresh.is_valid()); | 68 ASSERT(fresh.is_valid()); |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 83 ASSERT(CodeGeneratorScope::Current()->has_valid_frame()); | 87 ASSERT(CodeGeneratorScope::Current()->has_valid_frame()); |
| 84 CodeGeneratorScope::Current()->frame()->Spill(target); | 88 CodeGeneratorScope::Current()->frame()->Spill(target); |
| 85 ASSERT(CodeGeneratorScope::Current()->allocator()->count(target) == 1); | 89 ASSERT(CodeGeneratorScope::Current()->allocator()->count(target) == 1); |
| 86 } | 90 } |
| 87 ASSERT(is_register()); | 91 ASSERT(is_register()); |
| 88 ASSERT(reg().is(target)); | 92 ASSERT(reg().is(target)); |
| 89 } | 93 } |
| 90 | 94 |
| 91 | 95 |
| 92 } } // namespace v8::internal | 96 } } // namespace v8::internal |
| OLD | NEW |