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

Side by Side Diff: src/utils.h

Issue 6904127: ll_prof: Reduce profiling hooks overhead from >400% to 25%. (Closed)
Patch Set: Review fixes Created 9 years, 7 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/log-utils.cc ('k') | tools/ll_prof.py » ('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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 hash = ~hash + (hash << 15); // hash = (hash << 15) - hash - 1; 244 hash = ~hash + (hash << 15); // hash = (hash << 15) - hash - 1;
245 hash = hash ^ (hash >> 12); 245 hash = hash ^ (hash >> 12);
246 hash = hash + (hash << 2); 246 hash = hash + (hash << 2);
247 hash = hash ^ (hash >> 4); 247 hash = hash ^ (hash >> 4);
248 hash = hash * 2057; // hash = (hash + (hash << 3)) + (hash << 11); 248 hash = hash * 2057; // hash = (hash + (hash << 3)) + (hash << 11);
249 hash = hash ^ (hash >> 16); 249 hash = hash ^ (hash >> 16);
250 return hash; 250 return hash;
251 } 251 }
252 252
253 253
254 static inline uint32_t ComputePointerHash(void* ptr) {
255 return ComputeIntegerHash(
256 static_cast<uint32_t>(reinterpret_cast<intptr_t>(ptr)));
257 }
258
259
254 // ---------------------------------------------------------------------------- 260 // ----------------------------------------------------------------------------
255 // Miscellaneous 261 // Miscellaneous
256 262
257 // A static resource holds a static instance that can be reserved in 263 // A static resource holds a static instance that can be reserved in
258 // a local scope using an instance of Access. Attempts to re-reserve 264 // a local scope using an instance of Access. Attempts to re-reserve
259 // the instance will cause an error. 265 // the instance will cause an error.
260 template <typename T> 266 template <typename T>
261 class StaticResource { 267 class StaticResource {
262 public: 268 public:
263 StaticResource() : is_reserved_(false) {} 269 StaticResource() : is_reserved_(false) {}
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
787 INLINE(Dest BitCast(const Source& source)); 793 INLINE(Dest BitCast(const Source& source));
788 794
789 template <class Dest, class Source> 795 template <class Dest, class Source>
790 inline Dest BitCast(const Source& source) { 796 inline Dest BitCast(const Source& source) {
791 return BitCastHelper<Dest, Source>::cast(source); 797 return BitCastHelper<Dest, Source>::cast(source);
792 } 798 }
793 799
794 } } // namespace v8::internal 800 } } // namespace v8::internal
795 801
796 #endif // V8_UTILS_H_ 802 #endif // V8_UTILS_H_
OLDNEW
« no previous file with comments | « src/log-utils.cc ('k') | tools/ll_prof.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698