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

Side by Side Diff: ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h

Issue 165433003: PnaclCoordinator: Use llc's module-splitting for pexe compilation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make modules_used explicit Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_COORDINATOR_H_ 5 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_COORDINATOR_H_
6 #define NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_COORDINATOR_H_ 6 #define NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_COORDINATOR_H_
7 7
8 #include <set> 8 #include <set>
9 #include <map> 9 #include <map>
10 #include <vector> 10 #include <vector>
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 // Complete when RunTranslate is invoked. 70 // Complete when RunTranslate is invoked.
71 // START_LD_AND_LLC_SUBPROCESS_AND_INITIATE_TRANSLATION 71 // START_LD_AND_LLC_SUBPROCESS_AND_INITIATE_TRANSLATION
72 // Complete when RunTranslate returns. 72 // Complete when RunTranslate returns.
73 // TRANSLATION_COMPLETE 73 // TRANSLATION_COMPLETE
74 // Complete when TranslateFinished is invoked. 74 // Complete when TranslateFinished is invoked.
75 // 75 //
76 // OPEN_NEXE_FOR_SEL_LDR 76 // OPEN_NEXE_FOR_SEL_LDR
77 // Complete when NexeReadDidOpen is invoked. 77 // Complete when NexeReadDidOpen is invoked.
78 class PnaclCoordinator: public CallbackSource<FileStreamData> { 78 class PnaclCoordinator: public CallbackSource<FileStreamData> {
79 public: 79 public:
80 // Maximum number of object files passable to the translator. Cannot be
81 // changed without changing the RPC signatures.
82 const static size_t kMaxTranslatorObjectFiles = 16;
80 virtual ~PnaclCoordinator(); 83 virtual ~PnaclCoordinator();
81 84
82 // The factory method for translations. 85 // The factory method for translations.
83 static PnaclCoordinator* BitcodeToNative( 86 static PnaclCoordinator* BitcodeToNative(
84 Plugin* plugin, 87 Plugin* plugin,
85 const nacl::string& pexe_url, 88 const nacl::string& pexe_url,
86 const PnaclOptions& pnacl_options, 89 const PnaclOptions& pnacl_options,
87 const pp::CompletionCallback& translate_notify_callback); 90 const pp::CompletionCallback& translate_notify_callback);
88 91
89 // Call this to take ownership of the FD of the translated nexe after 92 // Call this to take ownership of the FD of the translated nexe after
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 nacl::scoped_ptr<const Manifest> manifest_; 198 nacl::scoped_ptr<const Manifest> manifest_;
196 // An auxiliary class that manages downloaded resources (llc and ld nexes). 199 // An auxiliary class that manages downloaded resources (llc and ld nexes).
197 nacl::scoped_ptr<PnaclResources> resources_; 200 nacl::scoped_ptr<PnaclResources> resources_;
198 201
199 // The URL for the pexe file. 202 // The URL for the pexe file.
200 nacl::string pexe_url_; 203 nacl::string pexe_url_;
201 // Options for translation. 204 // Options for translation.
202 PnaclOptions pnacl_options_; 205 PnaclOptions pnacl_options_;
203 206
204 // Object file, produced by the translator and consumed by the linker. 207 // Object file, produced by the translator and consumed by the linker.
205 nacl::scoped_ptr<TempFile> obj_file_; 208 std::vector<TempFile*> obj_files_;
209 // Number of split modules (threads) for llc
210 int split_module_count_;
211 int num_object_files_opened_;
212
206 // Translated nexe file, produced by the linker. 213 // Translated nexe file, produced by the linker.
207 nacl::scoped_ptr<TempFile> temp_nexe_file_; 214 nacl::scoped_ptr<TempFile> temp_nexe_file_;
208 // Passed to the browser, which sets it to true if there is a translation 215 // Passed to the browser, which sets it to true if there is a translation
209 // cache hit. 216 // cache hit.
210 PP_Bool is_cache_hit_; 217 PP_Bool is_cache_hit_;
211 218
212 // Downloader for streaming translation 219 // Downloader for streaming translation
213 nacl::scoped_ptr<FileDownloader> streaming_downloader_; 220 nacl::scoped_ptr<FileDownloader> streaming_downloader_;
214 221
215 // Used to report information when errors (PPAPI or otherwise) are reported. 222 // Used to report information when errors (PPAPI or otherwise) are reported.
(...skipping 12 matching lines...) Expand all
228 // The helper thread used to do translations via SRPC. 235 // The helper thread used to do translations via SRPC.
229 // Keep this last in declaration order to ensure the other variables 236 // Keep this last in declaration order to ensure the other variables
230 // haven't been destroyed yet when its destructor runs. 237 // haven't been destroyed yet when its destructor runs.
231 nacl::scoped_ptr<PnaclTranslateThread> translate_thread_; 238 nacl::scoped_ptr<PnaclTranslateThread> translate_thread_;
232 }; 239 };
233 240
234 //---------------------------------------------------------------------- 241 //----------------------------------------------------------------------
235 242
236 } // namespace plugin; 243 } // namespace plugin;
237 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_COORDINATOR_H_ 244 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_COORDINATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698