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

Side by Side Diff: src/gdb-jit.cc

Issue 2354593002: [base] Template MatchFun in TemplateHashMapImpl (Closed)
Patch Set: Remove bad search-replace Created 4 years, 2 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
« no previous file with comments | « src/base/hashmap.h ('k') | src/libsampler/sampler.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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/gdb-jit.h" 5 #include "src/gdb-jit.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/base/platform/platform.h" 10 #include "src/base/platform/platform.h"
(...skipping 1998 matching lines...) Expand 10 before | Expand all | Expand 10 after
2009 2009
2010 static uint32_t HashCodeAddress(Address addr) { 2010 static uint32_t HashCodeAddress(Address addr) {
2011 static const uintptr_t kGoldenRatio = 2654435761u; 2011 static const uintptr_t kGoldenRatio = 2654435761u;
2012 uintptr_t offset = OffsetFrom(addr); 2012 uintptr_t offset = OffsetFrom(addr);
2013 return static_cast<uint32_t>((offset >> kCodeAlignmentBits) * kGoldenRatio); 2013 return static_cast<uint32_t>((offset >> kCodeAlignmentBits) * kGoldenRatio);
2014 } 2014 }
2015 2015
2016 static base::HashMap* GetLineMap() { 2016 static base::HashMap* GetLineMap() {
2017 static base::HashMap* line_map = NULL; 2017 static base::HashMap* line_map = NULL;
2018 if (line_map == NULL) { 2018 if (line_map == NULL) {
2019 line_map = new base::HashMap(&base::HashMap::PointersMatch); 2019 line_map = new base::HashMap();
2020 } 2020 }
2021 return line_map; 2021 return line_map;
2022 } 2022 }
2023 2023
2024 2024
2025 static void PutLineInfo(Address addr, LineInfo* info) { 2025 static void PutLineInfo(Address addr, LineInfo* info) {
2026 base::HashMap* line_map = GetLineMap(); 2026 base::HashMap* line_map = GetLineMap();
2027 base::HashMap::Entry* e = 2027 base::HashMap::Entry* e =
2028 line_map->LookupOrInsert(addr, HashCodeAddress(addr)); 2028 line_map->LookupOrInsert(addr, HashCodeAddress(addr));
2029 if (e->value != NULL) delete static_cast<LineInfo*>(e->value); 2029 if (e->value != NULL) delete static_cast<LineInfo*>(e->value);
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
2213 LineInfo* line_info = reinterpret_cast<LineInfo*>(event->user_data); 2213 LineInfo* line_info = reinterpret_cast<LineInfo*>(event->user_data);
2214 PutLineInfo(reinterpret_cast<Address>(event->code_start), line_info); 2214 PutLineInfo(reinterpret_cast<Address>(event->code_start), line_info);
2215 break; 2215 break;
2216 } 2216 }
2217 } 2217 }
2218 } 2218 }
2219 #endif 2219 #endif
2220 } // namespace GDBJITInterface 2220 } // namespace GDBJITInterface
2221 } // namespace internal 2221 } // namespace internal
2222 } // namespace v8 2222 } // namespace v8
OLDNEW
« no previous file with comments | « src/base/hashmap.h ('k') | src/libsampler/sampler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698