| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 if (this != &other) { | 56 if (this != &other) { |
| 57 Unuse(); | 57 Unuse(); |
| 58 other.CopyTo(this); | 58 other.CopyTo(this); |
| 59 } | 59 } |
| 60 return *this; | 60 return *this; |
| 61 } | 61 } |
| 62 | 62 |
| 63 | 63 |
| 64 Result::~Result() { | 64 Result::~Result() { |
| 65 if (is_register()) { | 65 if (is_register()) { |
| 66 CodeGeneratorScope::Current()->allocator()->Unuse(reg()); | 66 CodeGeneratorScope::Current(Isolate::Current())->allocator()->Unuse(reg()); |
| 67 } | 67 } |
| 68 } | 68 } |
| 69 | 69 |
| 70 | 70 |
| 71 void Result::Unuse() { | 71 void Result::Unuse() { |
| 72 if (is_register()) { | 72 if (is_register()) { |
| 73 CodeGeneratorScope::Current()->allocator()->Unuse(reg()); | 73 CodeGeneratorScope::Current(Isolate::Current())->allocator()->Unuse(reg()); |
| 74 } | 74 } |
| 75 invalidate(); | 75 invalidate(); |
| 76 } | 76 } |
| 77 | 77 |
| 78 | 78 |
| 79 void Result::CopyTo(Result* destination) const { | 79 void Result::CopyTo(Result* destination) const { |
| 80 destination->value_ = value_; | 80 destination->value_ = value_; |
| 81 if (is_register()) { | 81 if (is_register()) { |
| 82 CodeGeneratorScope::Current()->allocator()->Use(reg()); | 82 CodeGeneratorScope::Current(Isolate::Current())->allocator()->Use(reg()); |
| 83 } | 83 } |
| 84 } | 84 } |
| 85 | 85 |
| 86 | 86 |
| 87 bool RegisterAllocator::is_used(Register reg) { | 87 bool RegisterAllocator::is_used(Register reg) { |
| 88 return registers_.is_used(ToNumber(reg)); | 88 return registers_.is_used(ToNumber(reg)); |
| 89 } | 89 } |
| 90 | 90 |
| 91 | 91 |
| 92 int RegisterAllocator::count(Register reg) { | 92 int RegisterAllocator::count(Register reg) { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 } | 132 } |
| 133 | 133 |
| 134 | 134 |
| 135 bool Result::is_double() const { | 135 bool Result::is_double() const { |
| 136 return type_info().IsDouble(); | 136 return type_info().IsDouble(); |
| 137 } | 137 } |
| 138 | 138 |
| 139 } } // namespace v8::internal | 139 } } // namespace v8::internal |
| 140 | 140 |
| 141 #endif // V8_REGISTER_ALLOCATOR_INL_H_ | 141 #endif // V8_REGISTER_ALLOCATOR_INL_H_ |
| OLD | NEW |