OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 28 matching lines...) Expand all Loading... |
39 #include "arm/lithium-arm.h" | 39 #include "arm/lithium-arm.h" |
40 #elif V8_TARGET_ARCH_MIPS | 40 #elif V8_TARGET_ARCH_MIPS |
41 #include "mips/lithium-mips.h" | 41 #include "mips/lithium-mips.h" |
42 #else | 42 #else |
43 #error "Unknown architecture." | 43 #error "Unknown architecture." |
44 #endif | 44 #endif |
45 | 45 |
46 namespace v8 { | 46 namespace v8 { |
47 namespace internal { | 47 namespace internal { |
48 | 48 |
49 | |
50 #define DEFINE_OPERAND_CACHE(name, type) \ | |
51 name name::cache[name::kNumCachedOperands]; \ | |
52 void name::SetUpCache() { \ | |
53 for (int i = 0; i < kNumCachedOperands; i++) { \ | |
54 cache[i].ConvertTo(type, i); \ | |
55 } \ | |
56 } \ | |
57 static bool name##_initialize() { \ | |
58 name::SetUpCache(); \ | |
59 return true; \ | |
60 } \ | |
61 static bool name##_cache_initialized = name##_initialize(); | |
62 | |
63 DEFINE_OPERAND_CACHE(LConstantOperand, CONSTANT_OPERAND) | |
64 DEFINE_OPERAND_CACHE(LStackSlot, STACK_SLOT) | |
65 DEFINE_OPERAND_CACHE(LDoubleStackSlot, DOUBLE_STACK_SLOT) | |
66 DEFINE_OPERAND_CACHE(LRegister, REGISTER) | |
67 DEFINE_OPERAND_CACHE(LDoubleRegister, DOUBLE_REGISTER) | |
68 | |
69 #undef DEFINE_OPERAND_CACHE | |
70 | |
71 | |
72 static inline LifetimePosition Min(LifetimePosition a, LifetimePosition b) { | 49 static inline LifetimePosition Min(LifetimePosition a, LifetimePosition b) { |
73 return a.Value() < b.Value() ? a : b; | 50 return a.Value() < b.Value() ? a : b; |
74 } | 51 } |
75 | 52 |
76 | 53 |
77 static inline LifetimePosition Max(LifetimePosition a, LifetimePosition b) { | 54 static inline LifetimePosition Max(LifetimePosition a, LifetimePosition b) { |
78 return a.Value() > b.Value() ? a : b; | 55 return a.Value() > b.Value() ? a : b; |
79 } | 56 } |
80 | 57 |
81 | 58 |
(...skipping 2050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2132 LiveRange* current = live_ranges()->at(i); | 2109 LiveRange* current = live_ranges()->at(i); |
2133 if (current != NULL) current->Verify(); | 2110 if (current != NULL) current->Verify(); |
2134 } | 2111 } |
2135 } | 2112 } |
2136 | 2113 |
2137 | 2114 |
2138 #endif | 2115 #endif |
2139 | 2116 |
2140 | 2117 |
2141 } } // namespace v8::internal | 2118 } } // namespace v8::internal |
OLD | NEW |