diff options
author | jvoung <jvoung@chromium.org> | 2015-03-31 10:19:30 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-03-31 17:20:35 +0000 |
commit | 58bea9692855603927912636d029586a90d60452 (patch) | |
tree | 7f2a712712252a5636829b90006c8a3c1ee3caab /components/nacl/browser | |
parent | e5ddc82eaa6717502f9595c571362fe8b96b3d3f (diff) | |
download | chromium_src-58bea9692855603927912636d029586a90d60452.zip chromium_src-58bea9692855603927912636d029586a90d60452.tar.gz chromium_src-58bea9692855603927912636d029586a90d60452.tar.bz2 |
Add a switch for using PNaCl Subzero and use it for -O0 translation.
Toggles use of Subzero for x86-32 when given the
--enable-pnacl-subzero flag (bikeshedding welcome).
Is not used when debug metadata is present.
Subzero O2 is approximately LLC O0 so adjust the optlevels.
There isn't a way to select Subzero O0.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=4091
CQ_EXTRA_TRYBOTS=tryserver.chromium.linux:linux_chromium_dbg_32_ng,linux_nacl_sdk_build
TEST=
(1) build 32-bit chrome under 64-bit kernel but a 32-bit linux container and install 64-bit libc/libstdc++.
(2) xvfb-run --server-args="-screen 0 1024x768x24" out/Release/browser_tests --gtest_filter=*PnaclSubzero*
Review URL: https://codereview.chromium.org/1005173006
Cr-Commit-Position: refs/heads/master@{#323063}
Diffstat (limited to 'components/nacl/browser')
-rw-r--r-- | components/nacl/browser/pnacl_host_unittest.cc | 1 | ||||
-rw-r--r-- | components/nacl/browser/pnacl_translation_cache.cc | 3 | ||||
-rw-r--r-- | components/nacl/browser/pnacl_translation_cache_unittest.cc | 7 |
3 files changed, 10 insertions, 1 deletions
diff --git a/components/nacl/browser/pnacl_host_unittest.cc b/components/nacl/browser/pnacl_host_unittest.cc index 3f2d3ef..960f8d5 100644 --- a/components/nacl/browser/pnacl_host_unittest.cc +++ b/components/nacl/browser/pnacl_host_unittest.cc @@ -115,6 +115,7 @@ static nacl::PnaclCacheInfo GetTestCacheInfo() { info.abi_version = 0; info.opt_level = 0; info.has_no_store_header = false; + info.use_subzero = false; return info; } diff --git a/components/nacl/browser/pnacl_translation_cache.cc b/components/nacl/browser/pnacl_translation_cache.cc index 5f60598..5ab1d38 100644 --- a/components/nacl/browser/pnacl_translation_cache.cc +++ b/components/nacl/browser/pnacl_translation_cache.cc @@ -414,7 +414,8 @@ std::string PnaclTranslationCache::GetKey(const nacl::PnaclCacheInfo& info) { return std::string(); std::string retval("ABI:"); retval += IntToString(info.abi_version) + ";" + "opt:" + - IntToString(info.opt_level) + ";" + "URL:"; + IntToString(info.opt_level) + + (info.use_subzero ? "subzero;" : ";") + "URL:"; // Filter the username, password, and ref components from the URL GURL::Replacements replacements; replacements.ClearUsername(); diff --git a/components/nacl/browser/pnacl_translation_cache_unittest.cc b/components/nacl/browser/pnacl_translation_cache_unittest.cc index dcba62f..a8c8093 100644 --- a/components/nacl/browser/pnacl_translation_cache_unittest.cc +++ b/components/nacl/browser/pnacl_translation_cache_unittest.cc @@ -177,6 +177,13 @@ TEST(PnaclTranslationCacheKeyTest, CacheKeyTest) { "modified:1995:11:15:6:25:24:0:UTC;etag:;" "sandbox:x86-32;extra_flags:;", PnaclTranslationCache::GetKey(info)); + // Check that Subzero gets a different cache key. + info.use_subzero = true; + EXPECT_EQ("ABI:2;opt:2subzero;URL:http://www.google.com/;" + "modified:1995:11:15:6:25:24:0:UTC;etag:;" + "sandbox:x86-32;extra_flags:;", + PnaclTranslationCache::GetKey(info)); + info.use_subzero = false; info.etag = std::string("etag"); EXPECT_EQ("ABI:2;opt:2;URL:http://www.google.com/;" "modified:1995:11:15:6:25:24:0:UTC;etag:etag;" |