summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authorjvoung@google.com <jvoung@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-17 18:04:06 +0000
committerjvoung@google.com <jvoung@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-17 18:04:06 +0000
commit9505c88a23c783068dfc39054e922076ffeeccc6 (patch)
tree74355dfe0d7e84ca9fa36f152dcde8253a153915 /ppapi
parent593525de45714e9dee4498dcfae74292cc74d149 (diff)
downloadchromium_src-9505c88a23c783068dfc39054e922076ffeeccc6.zip
chromium_src-9505c88a23c783068dfc39054e922076ffeeccc6.tar.gz
chromium_src-9505c88a23c783068dfc39054e922076ffeeccc6.tar.bz2
Bump the min PNaCl version of M35 to what we send out to M34. Delete fallback.
By the time M35 rolls around, most users will have upgraded to the M34 PNaCl. However, for those that haven't we can use the on-demand update. Given this minimum PNaCl version, we don't need to attempt a fallback IPC (from < M34) when the M34 IPC isn't available. Cleanup for: BUG=https://code.google.com/p/nativeclient/issues/detail?id=3777 R=cpu@chromium.org, teravest@chromium.org Review URL: https://codereview.chromium.org/197023007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257465 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.cc95
-rw-r--r--ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.h8
2 files changed, 31 insertions, 72 deletions
diff --git a/ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.cc b/ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.cc
index 47cb621..8d297398 100644
--- a/ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.cc
+++ b/ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.cc
@@ -173,25 +173,23 @@ void PnaclTranslateThread::DoTranslate() {
int64_t compile_start_time = NaClGetTimeOfDayMicroseconds();
bool init_success;
- std::vector<char> options = pnacl_options_->GetOptCommandline();
- // Try to init with splitting
+ std::vector<char> split_args;
+ nacl::stringstream ss;
// TODO(dschuff): This CL override is ugly. Change llc to default to using
// the number of modules specified in the first param, and ignore multiple
// uses of -split-module
- std::vector<char> split_args;
- nacl::stringstream ss;
ss << "-split-module=" << obj_files_->size();
nacl::string split_arg = ss.str();
std::copy(split_arg.begin(), split_arg.end(), std::back_inserter(split_args));
split_args.push_back('\x00');
+ std::vector<char> options = pnacl_options_->GetOptCommandline();
std::copy(options.begin(), options.end(), std::back_inserter(split_args));
- int modules_used = static_cast<int>(obj_files_->size());
init_success = llc_subprocess_->InvokeSrpcMethod(
"StreamInitWithSplit",
"ihhhhhhhhhhhhhhhhC",
&params,
- modules_used,
+ static_cast<int>(obj_files_->size()),
llc_out_files[0]->desc(),
llc_out_files[1]->desc(),
llc_out_files[2]->desc(),
@@ -211,17 +209,6 @@ void PnaclTranslateThread::DoTranslate() {
&split_args[0],
split_args.size());
if (!init_success) {
- init_success = llc_subprocess_->InvokeSrpcMethod(
- "StreamInitWithOverrides",
- "hC",
- &params,
- llc_out_files[0]->desc(),
- &options[0],
- options.size());
- modules_used = 1;
- }
-
- if (!init_success) {
if (llc_subprocess_->srpc_client()->GetLastError() ==
NACL_SRPC_RESULT_APP_ERROR) {
// The error message is only present if the error was returned from llc
@@ -299,33 +286,19 @@ void PnaclTranslateThread::DoTranslate() {
time_stats_.pnacl_compile_time =
(NaClGetTimeOfDayMicroseconds() - compile_start_time);
- // LLC returns values that are used to determine how linking is done.
- int is_shared_library = (params.outs()[0]->u.ival != 0);
- nacl::string soname = params.outs()[1]->arrays.str;
- nacl::string lib_dependencies = params.outs()[2]->arrays.str;
- PLUGIN_PRINTF(("PnaclCoordinator: compile (translator=%p) succeeded"
- " is_shared_library=%d, soname='%s', lib_dependencies='%s')\n",
- this, is_shared_library, soname.c_str(),
- lib_dependencies.c_str()));
-
// Shut down the llc subprocess.
NaClXMutexLock(&subprocess_mu_);
llc_subprocess_active_ = false;
llc_subprocess_.reset(NULL);
NaClXMutexUnlock(&subprocess_mu_);
- if(!RunLdSubprocess(
- modules_used, is_shared_library, soname, lib_dependencies)) {
+ if(!RunLdSubprocess()) {
return;
}
core->CallOnMainThread(0, report_translate_finished_, PP_OK);
}
-bool PnaclTranslateThread::RunLdSubprocess(int modules_used,
- int is_shared_library,
- const nacl::string& soname,
- const nacl::string& lib_dependencies
- ) {
+bool PnaclTranslateThread::RunLdSubprocess() {
ErrorInfo error_info;
SrpcParams params;
@@ -368,40 +341,28 @@ bool PnaclTranslateThread::RunLdSubprocess(int modules_used,
int64_t link_start_time = NaClGetTimeOfDayMicroseconds();
// Run LD.
- bool success;
- // If we ran LLC with module splitting, we can't fall back here.
- if (modules_used > 1) {
- success = ld_subprocess_->InvokeSrpcMethod("RunWithSplit",
- "ihhhhhhhhhhhhhhhhh",
- &params,
- modules_used,
- ld_in_files[0]->desc(),
- ld_in_files[1]->desc(),
- ld_in_files[2]->desc(),
- ld_in_files[3]->desc(),
- ld_in_files[4]->desc(),
- ld_in_files[5]->desc(),
- ld_in_files[6]->desc(),
- ld_in_files[7]->desc(),
- ld_in_files[8]->desc(),
- ld_in_files[9]->desc(),
- ld_in_files[10]->desc(),
- ld_in_files[11]->desc(),
- ld_in_files[12]->desc(),
- ld_in_files[13]->desc(),
- ld_in_files[14]->desc(),
- ld_in_files[15]->desc(),
- ld_out_file->desc());
- } else {
- success = ld_subprocess_->InvokeSrpcMethod("RunWithDefaultCommandLine",
- "hhiss",
- &params,
- ld_in_files[0]->desc(),
- ld_out_file->desc(),
- is_shared_library,
- soname.c_str(),
- lib_dependencies.c_str());
- }
+ bool success = ld_subprocess_->InvokeSrpcMethod(
+ "RunWithSplit",
+ "ihhhhhhhhhhhhhhhhh",
+ &params,
+ static_cast<int>(obj_files_->size()),
+ ld_in_files[0]->desc(),
+ ld_in_files[1]->desc(),
+ ld_in_files[2]->desc(),
+ ld_in_files[3]->desc(),
+ ld_in_files[4]->desc(),
+ ld_in_files[5]->desc(),
+ ld_in_files[6]->desc(),
+ ld_in_files[7]->desc(),
+ ld_in_files[8]->desc(),
+ ld_in_files[9]->desc(),
+ ld_in_files[10]->desc(),
+ ld_in_files[11]->desc(),
+ ld_in_files[12]->desc(),
+ ld_in_files[13]->desc(),
+ ld_in_files[14]->desc(),
+ ld_in_files[15]->desc(),
+ ld_out_file->desc());
if (!success) {
TranslateFailed(PP_NACL_ERROR_PNACL_LD_INTERNAL,
"link failed.");
diff --git a/ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.h b/ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.h
index dc9971b..5a20181 100644
--- a/ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.h
+++ b/ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.h
@@ -85,11 +85,9 @@ class PnaclTranslateThread {
// Signal that Pnacl translation failed, from the translation thread only.
void TranslateFailed(PP_NaClError err_code,
const nacl::string& error_string);
- // Run the LD subprocess, returning true on success
- bool RunLdSubprocess(int modules_used,
- int is_shared_library,
- const nacl::string& soname,
- const nacl::string& lib_dependencies);
+ // Run the LD subprocess, returning true on success.
+ // On failure, it returns false and runs the callback.
+ bool RunLdSubprocess();
// Callback to run when tasks are completed or an error has occurred.