Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 //===- subzero/src/main.cpp - Entry point for bitcode translation ---------===// | 1 //===- subzero/src/main.cpp - Entry point for bitcode translation ---------===// |
| 2 // | 2 // |
| 3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 /// | 9 /// |
| 10 /// \file | 10 /// \file |
| 11 /// \brief Defines the entry point for translating PNaCl bitcode into native | 11 /// \brief Defines the entry point for translating PNaCl bitcode into native |
| 12 /// code. | 12 /// code. |
| 13 /// | 13 /// |
| 14 //===----------------------------------------------------------------------===// | 14 //===----------------------------------------------------------------------===// |
| 15 | 15 |
| 16 #include "IceBrowserCompileServer.h" | 16 #include "IceBrowserCompileServer.h" |
| 17 #include "IceBuildDefs.h" | 17 #include "IceBuildDefs.h" |
| 18 #include "IceCompileServer.h" | 18 #include "IceCompileServer.h" |
| 19 | 19 |
| 20 #ifdef __pnacl__ | |
| 21 #include <malloc.h> | |
| 22 #endif // __pnacl__ | |
| 23 | |
| 20 /// Depending on whether we are building the compiler for the browser or | 24 /// Depending on whether we are building the compiler for the browser or |
| 21 /// standalone, we will end up creating a Ice::BrowserCompileServer or | 25 /// standalone, we will end up creating a Ice::BrowserCompileServer or |
| 22 /// Ice::CLCompileServer object. Method | 26 /// Ice::CLCompileServer object. Method |
| 23 /// Ice::CompileServer::runAndReturnErrorCode is used for the invocation. | 27 /// Ice::CompileServer::runAndReturnErrorCode is used for the invocation. |
| 24 /// There are no real commandline arguments in the browser case. They are | 28 /// There are no real commandline arguments in the browser case. They are |
| 25 /// supplied via IPC so argc, and argv are not used in that case. | 29 /// supplied via IPC so argc, and argv are not used in that case. |
| 26 /// We can only compile the Ice::BrowserCompileServer object with the PNaCl | 30 /// We can only compile the Ice::BrowserCompileServer object with the PNaCl |
| 27 /// compiler toolchain, when building Subzero as a sandboxed translator. | 31 /// compiler toolchain, when building Subzero as a sandboxed translator. |
| 28 int main(int argc, char **argv) { | 32 int main(int argc, char **argv) { |
| 33 #ifdef __pnacl__ | |
|
sehr
2016/02/26 03:27:39
Comment here that the pnacl implementation of mall
John
2016/02/26 15:15:50
Done.
| |
| 34 #define M_GRANULARITY (-2) | |
| 35 mallopt(M_GRANULARITY, 16 * 1024 * 1024); | |
| 36 #undef M_GRANULARITY | |
| 37 #endif // __pnacl__ | |
| 38 | |
| 29 if (Ice::BuildDefs::browser()) { | 39 if (Ice::BuildDefs::browser()) { |
| 30 assert(argc == 1); | 40 assert(argc == 1); |
| 31 return Ice::BrowserCompileServer().runAndReturnErrorCode(); | 41 return Ice::BrowserCompileServer().runAndReturnErrorCode(); |
| 32 } | 42 } |
| 33 return Ice::CLCompileServer(argc, argv).runAndReturnErrorCode(); | 43 return Ice::CLCompileServer(argc, argv).runAndReturnErrorCode(); |
| 34 } | 44 } |
| OLD | NEW |