OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 if (hi == 0) hi = random(); | 162 if (hi == 0) hi = random(); |
163 if (lo == 0) lo = random(); | 163 if (lo == 0) lo = random(); |
164 | 164 |
165 // Mix the bits. | 165 // Mix the bits. |
166 hi = 36969 * (hi & 0xFFFF) + (hi >> 16); | 166 hi = 36969 * (hi & 0xFFFF) + (hi >> 16); |
167 lo = 18273 * (lo & 0xFFFF) + (lo >> 16); | 167 lo = 18273 * (lo & 0xFFFF) + (lo >> 16); |
168 return (hi << 16) + (lo & 0xFFFF); | 168 return (hi << 16) + (lo & 0xFFFF); |
169 } | 169 } |
170 | 170 |
171 | 171 |
172 bool V8::IdleNotification(bool is_high_priority) { | 172 bool V8::IdleNotification() { |
173 // Returning true tells the caller that there is no need to call | 173 // Returning true tells the caller that there is no need to call |
174 // IdleNotification again. | 174 // IdleNotification again. |
175 if (!FLAG_use_idle_notification) return true; | 175 if (!FLAG_use_idle_notification) return true; |
176 // Ignore high priority instances of V8. | |
177 if (is_high_priority) return true; | |
178 | 176 |
179 // Tell the heap that it may want to adjust. | 177 // Tell the heap that it may want to adjust. |
180 return Heap::IdleNotification(); | 178 return Heap::IdleNotification(); |
181 } | 179 } |
182 | 180 |
183 | 181 |
184 Smi* V8::RandomPositiveSmi() { | 182 Smi* V8::RandomPositiveSmi() { |
185 uint32_t random = Random(); | 183 uint32_t random = Random(); |
186 ASSERT(IsPowerOf2(Smi::kMaxValue + 1)); | 184 ASSERT(IsPowerOf2(Smi::kMaxValue + 1)); |
187 return Smi::FromInt(random & Smi::kMaxValue); | 185 return Smi::FromInt(random & Smi::kMaxValue); |
188 } | 186 } |
189 | 187 |
190 } } // namespace v8::internal | 188 } } // namespace v8::internal |
OLD | NEW |