| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 | 43 |
| 44 void Result::ToRegister(Register target) { | 44 void Result::ToRegister(Register target) { |
| 45 UNIMPLEMENTED(); | 45 UNIMPLEMENTED(); |
| 46 } | 46 } |
| 47 | 47 |
| 48 | 48 |
| 49 // ------------------------------------------------------------------------- | 49 // ------------------------------------------------------------------------- |
| 50 // RegisterAllocator implementation. | 50 // RegisterAllocator implementation. |
| 51 | 51 |
| 52 RegisterFile RegisterAllocator::Reserved() { | |
| 53 RegisterFile reserved; | |
| 54 reserved.Use(sp); | |
| 55 reserved.Use(fp); | |
| 56 reserved.Use(cp); | |
| 57 reserved.Use(pc); | |
| 58 return reserved; | |
| 59 } | |
| 60 | |
| 61 | |
| 62 void RegisterAllocator::UnuseReserved(RegisterFile* register_file) { | |
| 63 register_file->ref_counts_[sp.code()] = 0; | |
| 64 register_file->ref_counts_[fp.code()] = 0; | |
| 65 register_file->ref_counts_[cp.code()] = 0; | |
| 66 register_file->ref_counts_[pc.code()] = 0; | |
| 67 } | |
| 68 | |
| 69 | |
| 70 bool RegisterAllocator::IsReserved(int reg_code) { | |
| 71 return (reg_code == sp.code()) | |
| 72 || (reg_code == fp.code()) | |
| 73 || (reg_code == cp.code()) | |
| 74 || (reg_code == pc.code()); | |
| 75 } | |
| 76 | |
| 77 | |
| 78 void RegisterAllocator::Initialize() { | |
| 79 Reset(); | |
| 80 // The following registers are live on function entry, saved in the | |
| 81 // frame, and available for allocation during execution. | |
| 82 Use(r1); // JS function. | |
| 83 Use(lr); // Return address. | |
| 84 } | |
| 85 | |
| 86 | |
| 87 void RegisterAllocator::Reset() { | |
| 88 registers_.Reset(); | |
| 89 // The following registers are live on function entry and reserved | |
| 90 // during execution. | |
| 91 Use(sp); // Stack pointer. | |
| 92 Use(fp); // Frame pointer (caller's frame pointer on entry). | |
| 93 Use(cp); // Context context (callee's context on entry). | |
| 94 Use(pc); // Program counter. | |
| 95 } | |
| 96 | |
| 97 | |
| 98 Result RegisterAllocator::AllocateByteRegisterWithoutSpilling() { | 52 Result RegisterAllocator::AllocateByteRegisterWithoutSpilling() { |
| 99 UNIMPLEMENTED(); | 53 // No byte registers on ARM. |
| 54 UNREACHABLE(); |
| 100 return Result(); | 55 return Result(); |
| 101 } | 56 } |
| 102 | 57 |
| 103 | 58 |
| 104 } } // namespace v8::internal | 59 } } // namespace v8::internal |
| OLD | NEW |