| OLD | NEW |
| 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
| 2 // All Rights Reserved. | 2 // All Rights Reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // met: |
| 7 // | 7 // |
| 8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
| 9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
| 10 // | 10 // |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 // such that we use an enum in optimized mode, and the struct in debug | 66 // such that we use an enum in optimized mode, and the struct in debug |
| 67 // mode. This way we get the compile-time error checking in debug mode | 67 // mode. This way we get the compile-time error checking in debug mode |
| 68 // and best performance in optimized code. | 68 // and best performance in optimized code. |
| 69 | 69 |
| 70 | 70 |
| 71 // ----------------------------------------------------------------------------- | 71 // ----------------------------------------------------------------------------- |
| 72 // Implementation of Register and FPURegister | 72 // Implementation of Register and FPURegister |
| 73 | 73 |
| 74 // Core register. | 74 // Core register. |
| 75 struct Register { | 75 struct Register { |
| 76 bool is_valid() const { return 0 <= code_ && code_ < kNumRegisters; } | 76 bool is_valid() const { return 0 <= code_ && code_ < kNumRegisters; } |
| 77 bool is(Register reg) const { return code_ == reg.code_; } | 77 bool is(Register reg) const { return code_ == reg.code_; } |
| 78 int code() const { | 78 int code() const { |
| 79 ASSERT(is_valid()); | 79 ASSERT(is_valid()); |
| 80 return code_; | 80 return code_; |
| 81 } | 81 } |
| 82 int bit() const { | 82 int bit() const { |
| 83 ASSERT(is_valid()); | 83 ASSERT(is_valid()); |
| 84 return 1 << code_; | 84 return 1 << code_; |
| 85 } | 85 } |
| 86 | 86 |
| 87 // Unfortunately we can't make this private in a struct. | 87 // Unfortunately we can't make this private in a struct. |
| 88 int code_; | 88 int code_; |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 extern const Register no_reg; | 91 extern const Register no_reg; |
| 92 | 92 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 122 extern const Register sp; | 122 extern const Register sp; |
| 123 extern const Register s8_fp; | 123 extern const Register s8_fp; |
| 124 extern const Register ra; | 124 extern const Register ra; |
| 125 | 125 |
| 126 int ToNumber(Register reg); | 126 int ToNumber(Register reg); |
| 127 | 127 |
| 128 Register ToRegister(int num); | 128 Register ToRegister(int num); |
| 129 | 129 |
| 130 // Coprocessor register. | 130 // Coprocessor register. |
| 131 struct FPURegister { | 131 struct FPURegister { |
| 132 bool is_valid() const { return 0 <= code_ && code_ < kNumFPURegister ; } | 132 bool is_valid() const { return 0 <= code_ && code_ < kNumFPURegister ; } |
| 133 bool is(FPURegister creg) const { return code_ == creg.code_; } | 133 bool is(FPURegister creg) const { return code_ == creg.code_; } |
| 134 int code() const { | 134 int code() const { |
| 135 ASSERT(is_valid()); | 135 ASSERT(is_valid()); |
| 136 return code_; | 136 return code_; |
| 137 } | 137 } |
| 138 int bit() const { | 138 int bit() const { |
| 139 ASSERT(is_valid()); | 139 ASSERT(is_valid()); |
| 140 return 1 << code_; | 140 return 1 << code_; |
| 141 } | 141 } |
| 142 | 142 |
| 143 // Unfortunately we can't make this private in a struct. | 143 // Unfortunately we can't make this private in a struct. |
| 144 int code_; | 144 int code_; |
| 145 }; | 145 }; |
| 146 | 146 |
| 147 extern const FPURegister no_creg; | 147 extern const FPURegister no_creg; |
| 148 | 148 |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 658 void link_to(Label* L, Label* appendix); | 658 void link_to(Label* L, Label* appendix); |
| 659 void next(Label* L); | 659 void next(Label* L); |
| 660 | 660 |
| 661 friend class RegExpMacroAssemblerMIPS; | 661 friend class RegExpMacroAssemblerMIPS; |
| 662 friend class RelocInfo; | 662 friend class RelocInfo; |
| 663 }; | 663 }; |
| 664 | 664 |
| 665 } } // namespace v8::internal | 665 } } // namespace v8::internal |
| 666 | 666 |
| 667 #endif // V8_ARM_ASSEMBLER_MIPS_H_ | 667 #endif // V8_ARM_ASSEMBLER_MIPS_H_ |
| 668 | |
| OLD | NEW |