Commit 9ff019b4 authored by vegorov@chromium.org's avatar vegorov@chromium.org

Fix strict aliasing rule violation in runtime-profiler.cc

Review URL: http://codereview.chromium.org/5621005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5923 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 90b33703
...@@ -94,7 +94,7 @@ static int sampler_threshold_size_factor = kSamplerThresholdSizeFactorInit; ...@@ -94,7 +94,7 @@ static int sampler_threshold_size_factor = kSamplerThresholdSizeFactorInit;
// the window might contain stale pointers. The window is updated on // the window might contain stale pointers. The window is updated on
// scavenges and (parts of it) cleared on mark-sweep and // scavenges and (parts of it) cleared on mark-sweep and
// mark-sweep-compact. // 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_position = 0;
static int sampler_window_weight[kSamplerWindowSize] = { 0, }; static int sampler_window_weight[kSamplerWindowSize] = { 0, };
...@@ -220,7 +220,7 @@ static void ClearSampleBufferNewSpaceEntries() { ...@@ -220,7 +220,7 @@ static void ClearSampleBufferNewSpaceEntries() {
static int LookupSample(JSFunction* function) { static int LookupSample(JSFunction* function) {
int weight = 0; int weight = 0;
for (int i = 0; i < kSamplerWindowSize; i++) { for (int i = 0; i < kSamplerWindowSize; i++) {
JSFunction* sample = sampler_window[i]; Object* sample = sampler_window[i];
if (sample != NULL) { if (sample != NULL) {
if (function == sample) { if (function == sample) {
weight += sampler_window_weight[i]; weight += sampler_window_weight[i];
...@@ -351,7 +351,7 @@ void RuntimeProfiler::TearDown() { ...@@ -351,7 +351,7 @@ void RuntimeProfiler::TearDown() {
Object** RuntimeProfiler::SamplerWindowAddress() { Object** RuntimeProfiler::SamplerWindowAddress() {
return reinterpret_cast<Object**>(sampler_window); return sampler_window;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment