Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Unified Diff: ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.cc

Issue 12623004: Allow PNaCl NMF to set translator optimization options for experimentation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Default to -O0 instead of the default for now Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.cc
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 2be99684f17664432522414e30530a9f4c190d39..a7d3f24f17fc2c614cd8715893f62f7cec690064 100644
--- a/ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.cc
+++ b/ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.cc
@@ -39,6 +39,7 @@ void PnaclTranslateThread::RunTranslate(
TempFile* nexe_file,
ErrorInfo* error_info,
PnaclResources* resources,
+ PnaclOptions* pnacl_options,
PnaclCoordinator* coordinator,
Plugin* plugin) {
PLUGIN_PRINTF(("PnaclStreamingTranslateThread::RunTranslate)\n"));
@@ -48,6 +49,7 @@ void PnaclTranslateThread::RunTranslate(
nexe_file_ = nexe_file;
coordinator_error_info_ = error_info;
resources_ = resources;
+ pnacl_options_ = pnacl_options;
coordinator_ = coordinator;
plugin_ = plugin;
@@ -153,10 +155,25 @@ void PnaclTranslateThread::DoTranslate() {
}
int64_t compile_start_time = NaClGetTimeOfDayMicroseconds();
- if (!llc_subprocess_->InvokeSrpcMethod("StreamInit",
- "h",
- &params,
- llc_out_file->desc())) {
+ bool init_success;
+ if (pnacl_options_->HasDefaultOpts()) {
+ PLUGIN_PRINTF(("PnaclCoordinator: StreamInit with default options\n"));
+ init_success = llc_subprocess_->InvokeSrpcMethod("StreamInit",
+ "h",
+ &params,
+ llc_out_file->desc());
+ } else {
+ std::vector<char> options = pnacl_options_->GetOptCommandline();
+ init_success = llc_subprocess_->InvokeSrpcMethod(
+ "StreamInitWithOverrides",
+ "hC",
+ &params,
+ llc_out_file->desc(),
+ &options[0],
+ options.size());
+ }
+
+ 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

Powered by Google App Engine
This is Rietveld 408576698