Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Side by Side Diff: src/frames.cc

Issue 6723014: Avoid TLS access for counters. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix lint Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/compiler.cc ('k') | src/ia32/assembler-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after
1140 HeapObject* next = iterator.next(); 1140 HeapObject* next = iterator.next();
1141 if (next == NULL || next->address() >= pc) { 1141 if (next == NULL || next->address() >= pc) {
1142 return GcSafeCastToCode(previous, pc); 1142 return GcSafeCastToCode(previous, pc);
1143 } 1143 }
1144 previous = next; 1144 previous = next;
1145 } 1145 }
1146 } 1146 }
1147 1147
1148 1148
1149 PcToCodeCache::PcToCodeCacheEntry* PcToCodeCache::GetCacheEntry(Address pc) { 1149 PcToCodeCache::PcToCodeCacheEntry* PcToCodeCache::GetCacheEntry(Address pc) {
1150 COUNTERS->pc_to_code()->Increment(); 1150 isolate_->counters()->pc_to_code()->Increment();
1151 ASSERT(IsPowerOf2(kPcToCodeCacheSize)); 1151 ASSERT(IsPowerOf2(kPcToCodeCacheSize));
1152 uint32_t hash = ComputeIntegerHash( 1152 uint32_t hash = ComputeIntegerHash(
1153 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(pc))); 1153 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(pc)));
1154 uint32_t index = hash & (kPcToCodeCacheSize - 1); 1154 uint32_t index = hash & (kPcToCodeCacheSize - 1);
1155 PcToCodeCacheEntry* entry = cache(index); 1155 PcToCodeCacheEntry* entry = cache(index);
1156 if (entry->pc == pc) { 1156 if (entry->pc == pc) {
1157 COUNTERS->pc_to_code_cached()->Increment(); 1157 isolate_->counters()->pc_to_code_cached()->Increment();
1158 ASSERT(entry->code == GcSafeFindCodeForPc(pc)); 1158 ASSERT(entry->code == GcSafeFindCodeForPc(pc));
1159 } else { 1159 } else {
1160 // Because this code may be interrupted by a profiling signal that 1160 // Because this code may be interrupted by a profiling signal that
1161 // also queries the cache, we cannot update pc before the code has 1161 // also queries the cache, we cannot update pc before the code has
1162 // been set. Otherwise, we risk trying to use a cache entry before 1162 // been set. Otherwise, we risk trying to use a cache entry before
1163 // the code has been computed. 1163 // the code has been computed.
1164 entry->code = GcSafeFindCodeForPc(pc); 1164 entry->code = GcSafeFindCodeForPc(pc);
1165 entry->safepoint_entry.Reset(); 1165 entry->safepoint_entry.Reset();
1166 entry->pc = pc; 1166 entry->pc = pc;
1167 } 1167 }
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
1233 ZoneList<StackFrame*> list(10); 1233 ZoneList<StackFrame*> list(10);
1234 for (StackFrameIterator it; !it.done(); it.Advance()) { 1234 for (StackFrameIterator it; !it.done(); it.Advance()) {
1235 StackFrame* frame = AllocateFrameCopy(it.frame()); 1235 StackFrame* frame = AllocateFrameCopy(it.frame());
1236 list.Add(frame); 1236 list.Add(frame);
1237 } 1237 }
1238 return list.ToVector(); 1238 return list.ToVector();
1239 } 1239 }
1240 1240
1241 1241
1242 } } // namespace v8::internal 1242 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/compiler.cc ('k') | src/ia32/assembler-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698