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

Unified Diff: src/frames.cc

Issue 9976003: Minimize uses of lazy initialization by adding explicit initialization functions. (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
« no previous file with comments | « src/frames.h ('k') | src/heap.cc » ('j') | src/platform-macos.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/frames.cc
diff --git a/src/frames.cc b/src/frames.cc
index 0571a813f5e56b45922ac6ee3a76dc78940749ad..7e632f58e0fffc53446027a67cc891addb299462 100644
--- a/src/frames.cc
+++ b/src/frames.cc
@@ -1369,7 +1369,7 @@ int NumRegs(RegList reglist) {
struct JSCallerSavedCodeData {
- JSCallerSavedCodeData() {
+ void Init() {
danno 2012/04/04 20:47:57 How about putting this directly in SetUpJSCallerSa
Philippe 2012/04/05 11:30:18 Done.
int i = 0;
for (int r = 0; r < kNumRegs; r++)
if ((kJSCallerSaved & (1 << r)) != 0)
@@ -1380,13 +1380,15 @@ struct JSCallerSavedCodeData {
int reg_code[kNumJSCallerSaved];
};
+JSCallerSavedCodeData caller_saved_code_data;
-static LazyInstance<JSCallerSavedCodeData>::type caller_saved_code_data =
- LAZY_INSTANCE_INITIALIZER;
+void SetUpJSCallerSavedCodeData() {
+ caller_saved_code_data.Init();
+}
int JSCallerSavedCode(int n) {
ASSERT(0 <= n && n < kNumJSCallerSaved);
- return caller_saved_code_data.Get().reg_code[n];
+ return caller_saved_code_data.reg_code[n];
}
« no previous file with comments | « src/frames.h ('k') | src/heap.cc » ('j') | src/platform-macos.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698