OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1180 } | 1180 } |
1181 previous = next; | 1181 previous = next; |
1182 } | 1182 } |
1183 } | 1183 } |
1184 | 1184 |
1185 | 1185 |
1186 PcToCodeCache::PcToCodeCacheEntry* PcToCodeCache::GetCacheEntry(Address pc) { | 1186 PcToCodeCache::PcToCodeCacheEntry* PcToCodeCache::GetCacheEntry(Address pc) { |
1187 isolate_->counters()->pc_to_code()->Increment(); | 1187 isolate_->counters()->pc_to_code()->Increment(); |
1188 ASSERT(IsPowerOf2(kPcToCodeCacheSize)); | 1188 ASSERT(IsPowerOf2(kPcToCodeCacheSize)); |
1189 uint32_t hash = ComputeIntegerHash( | 1189 uint32_t hash = ComputeIntegerHash( |
1190 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(pc))); | 1190 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(pc)), |
| 1191 v8::internal::kZeroHashSeed); |
1191 uint32_t index = hash & (kPcToCodeCacheSize - 1); | 1192 uint32_t index = hash & (kPcToCodeCacheSize - 1); |
1192 PcToCodeCacheEntry* entry = cache(index); | 1193 PcToCodeCacheEntry* entry = cache(index); |
1193 if (entry->pc == pc) { | 1194 if (entry->pc == pc) { |
1194 isolate_->counters()->pc_to_code_cached()->Increment(); | 1195 isolate_->counters()->pc_to_code_cached()->Increment(); |
1195 ASSERT(entry->code == GcSafeFindCodeForPc(pc)); | 1196 ASSERT(entry->code == GcSafeFindCodeForPc(pc)); |
1196 } else { | 1197 } else { |
1197 // Because this code may be interrupted by a profiling signal that | 1198 // Because this code may be interrupted by a profiling signal that |
1198 // also queries the cache, we cannot update pc before the code has | 1199 // also queries the cache, we cannot update pc before the code has |
1199 // been set. Otherwise, we risk trying to use a cache entry before | 1200 // been set. Otherwise, we risk trying to use a cache entry before |
1200 // the code has been computed. | 1201 // the code has been computed. |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1270 ZoneList<StackFrame*> list(10); | 1271 ZoneList<StackFrame*> list(10); |
1271 for (StackFrameIterator it; !it.done(); it.Advance()) { | 1272 for (StackFrameIterator it; !it.done(); it.Advance()) { |
1272 StackFrame* frame = AllocateFrameCopy(it.frame()); | 1273 StackFrame* frame = AllocateFrameCopy(it.frame()); |
1273 list.Add(frame); | 1274 list.Add(frame); |
1274 } | 1275 } |
1275 return list.ToVector(); | 1276 return list.ToVector(); |
1276 } | 1277 } |
1277 | 1278 |
1278 | 1279 |
1279 } } // namespace v8::internal | 1280 } } // namespace v8::internal |
OLD | NEW |