Revision: 5923
Author: [email protected]
Date: Tue Dec  7 03:40:36 2010
Log: Fix strict aliasing rule violation in runtime-profiler.cc

Review URL: http://codereview.chromium.org/5621005
http://code.google.com/p/v8/source/detail?r=5923

Modified:
 /branches/bleeding_edge/src/runtime-profiler.cc

=======================================
--- /branches/bleeding_edge/src/runtime-profiler.cc     Tue Dec  7 03:31:57 2010
+++ /branches/bleeding_edge/src/runtime-profiler.cc     Tue Dec  7 03:40:36 2010
@@ -94,7 +94,7 @@
 // the window might contain stale pointers. The window is updated on
 // scavenges and (parts of it) cleared on mark-sweep and
 // mark-sweep-compact.
-static JSFunction* sampler_window[kSamplerWindowSize] = { NULL, };
+static Object* sampler_window[kSamplerWindowSize] = { NULL, };
 static int sampler_window_position = 0;
 static int sampler_window_weight[kSamplerWindowSize] = { 0, };

@@ -220,7 +220,7 @@
 static int LookupSample(JSFunction* function) {
   int weight = 0;
   for (int i = 0; i < kSamplerWindowSize; i++) {
-    JSFunction* sample = sampler_window[i];
+    Object* sample = sampler_window[i];
     if (sample != NULL) {
       if (function == sample) {
         weight += sampler_window_weight[i];
@@ -351,7 +351,7 @@


 Object** RuntimeProfiler::SamplerWindowAddress() {
-  return reinterpret_cast<Object**>(sampler_window);
+  return sampler_window;
 }


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to