#endif
void OS::ReleaseStore(volatile AtomicWord* ptr, AtomicWord value) {
-#if defined(V8_TARGET_ARCH_ARM) && defined(__arm__) // don't use on a simulator
+#if defined(V8_TARGET_ARCH_ARM) && defined(__arm__)
+ // Only use on ARM hardware.
pLinuxKernelMemoryBarrier();
#else
__asm__ __volatile__("" : : : "memory");
List<CpuProfile*>* CpuProfilesCollection::GetProfilesList(
int security_token_id) {
const int index = TokenToIndex(security_token_id);
- profiles_by_token_.AddBlock(NULL, profiles_by_token_.length() - index + 1);
+ const int lists_to_add = index - profiles_by_token_.length() + 1;
+ if (lists_to_add > 0) profiles_by_token_.AddBlock(NULL, lists_to_add);
List<CpuProfile*>* unabridged_list =
profiles_by_token_[TokenToIndex(CodeEntry::kNoSecurityToken)];
const int current_count = unabridged_list->length();
profiles_by_token_[index] = new List<CpuProfile*>(current_count);
}
List<CpuProfile*>* list = profiles_by_token_[index];
- list->AddBlock(NULL, current_count - list->length());
+ const int profiles_to_add = current_count - list->length();
+ if (profiles_to_add > 0) list->AddBlock(NULL, profiles_to_add);
return list;
}