diff options
author | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-27 02:46:10 +0000 |
---|---|---|
committer | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-27 02:46:10 +0000 |
commit | 77a25464cf7ab80f96a486753b99a1276e70d401 (patch) | |
tree | 08c50269b1d78bfd13af1df9e413c697ea08b846 /content/plugin | |
parent | 54d768dbbdc71d359966e2f755f04b23e2c0b495 (diff) | |
download | chromium_src-77a25464cf7ab80f96a486753b99a1276e70d401.zip chromium_src-77a25464cf7ab80f96a486753b99a1276e70d401.tar.gz chromium_src-77a25464cf7ab80f96a486753b99a1276e70d401.tar.bz2 |
Disable frame pointer optimization on base::debug::StackTrace() so it works properly in release builds.
Similarly disable optimizations in npobject_stub.cc so base::debug::StackTrace() can recognize more frames (This last de-optimization is only temporary, whereas the change to base::debug::StackTrace is intended to be permanent).
BUG=94179
Review URL: http://codereview.chromium.org/7763008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98542 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/plugin')
-rw-r--r-- | content/plugin/npobject_stub.cc | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/content/plugin/npobject_stub.cc b/content/plugin/npobject_stub.cc index 1d51cb2..34d631d 100644 --- a/content/plugin/npobject_stub.cc +++ b/content/plugin/npobject_stub.cc @@ -16,6 +16,26 @@ using WebKit::WebBindings; +// TODO(eroman): Remove this when done investigating 94179. +// +// The following disables optimizations for all the functions in this file. +// +// At a minimum we want to disable frame pointer optimization ("y"), so that +// base::debug::StackTrace() works better. We also prevent inlining of these +// functions so that StackTrace() is more complete. (The StackTrace() will +// probably not be able to go deeper than these functions since the callers +// will probably have FPO). +// +// Note that disabling optimizations causes warning 4748 which I have had to +// disable throughout this file. That warning was: +// +// /GS can not protect parameters and local variables from local buffer +// overrun because optimizations are disabled in function +#if defined(COMPILER_MSVC) +#pragma optimize("", off) +MSVC_PUSH_DISABLE_WARNING(4748) +#endif + NPObjectStub::NPObjectStub( NPObject* npobject, PluginChannelBase* channel, @@ -445,3 +465,9 @@ void NPObjectStub::OnEvaluate(const std::string& script, NPObjectMsg_Evaluate::WriteReplyParams(reply_msg, result_param, return_value); channel_->Send(reply_msg); } + +// Restore compiler optimizations and warnings. +#if defined(COMPILER_MSVC) +MSVC_POP_WARNING() +#pragma optimize("", on) +#endif |