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

Unified Diff: src/platform-posix.cc

Issue 9873023: Fix performance regressions due to lazy initialization. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
Index: src/platform-posix.cc
diff --git a/src/platform-posix.cc b/src/platform-posix.cc
index a729b662605ad1377395cf7f0fb9668d3863ce48..750b9117d96c79bd8742b224da9fadf6cc6e6ba3 100644
--- a/src/platform-posix.cc
+++ b/src/platform-posix.cc
@@ -134,8 +134,10 @@ void init_fast_##name##_function() { \
fast_##name##_function = generator; \
} \
double fast_##name(double x) { \
- CallOnce(&fast_##name##_init_once, \
- &init_fast_##name##_function); \
+ if (!fast_##name##_function) { \
danno 2012/03/29 07:45:17 Since this is also could be called frequently, per
Philippe 2012/03/29 09:00:48 I tried to do that initially by calling these init
danno 2012/03/29 09:07:20 Calling it from OS::PostSetUp seems fine. I would
Philippe 2012/03/29 09:26:53 Done.
+ CallOnce(&fast_##name##_init_once, \
+ &init_fast_##name##_function); \
+ } \
return (*fast_##name##_function)(x); \
}
« src/lazy-instance.h ('K') | « src/mksnapshot.cc ('k') | src/platform-win32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698