Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 //===- subzero/src/WasmTranslator.h - WASM to Subzero Translation ---------===// | |
| 2 // | |
| 3 // The Subzero Code Generator | |
| 4 // | |
| 5 // This file is distributed under the University of Illinois Open Source | |
| 6 // License. See LICENSE.TXT for details. | |
| 7 // | |
| 8 //===----------------------------------------------------------------------===// | |
|
Jim Stichnoth
2016/04/01 01:46:45
The license boilerplate usually also includes a bl
Eric Holk
2016/04/01 19:15:03
Done.
| |
| 9 | |
| 10 #ifndef SUBZERO_SRC_WASMTRANSLATOR_H | |
| 11 #define SUBZERO_SRC_WASMTRANSLATOR_H | |
| 12 | |
| 13 #include "IceGlobalContext.h" | |
| 14 #include "IceTranslator.h" | |
| 15 | |
| 16 namespace v8 { | |
| 17 namespace internal { | |
| 18 class Zone; | |
| 19 namespace wasm { | |
| 20 class FunctionEnv; | |
| 21 } // end of namespace wasm | |
| 22 } // end of namespace internal | |
| 23 } // end of namespace v8 | |
| 24 | |
| 25 namespace Ice { | |
| 26 | |
| 27 class WasmTranslator : public Translator { | |
| 28 WasmTranslator() = delete; | |
| 29 WasmTranslator(const WasmTranslator &) = delete; | |
| 30 WasmTranslator &operator=(const WasmTranslator &) = delete; | |
| 31 | |
| 32 template <typename F = std::function<void(Ostream &)>> void log(F Fn) { | |
| 33 if (BuildDefs::dump() && (Ctx->getFlags().getVerbose() & IceV_Wasm)) { | |
| 34 OstreamLocker L(Ctx); | |
|
Jim Stichnoth
2016/04/01 01:46:45
The "new" Subzero style is to name this RAII varia
Eric Holk
2016/04/01 19:15:02
Done.
| |
| 35 Fn(Ctx->getStrDump()); | |
| 36 Ctx->getStrDump().flush(); | |
|
Jim Stichnoth
2016/04/01 01:46:45
Just curious if this flush() is necessary and if w
Eric Holk
2016/04/01 19:15:02
It's normally not necessary. Early on I had insert
| |
| 37 } | |
| 38 } | |
| 39 | |
| 40 public: | |
| 41 explicit WasmTranslator(GlobalContext *Ctx); | |
| 42 ~WasmTranslator() override; | |
| 43 | |
| 44 void translate(const std::string &IRFilename, | |
| 45 std::unique_ptr<llvm::DataStreamer> InputStream); | |
| 46 | |
| 47 std::unique_ptr<Cfg> translateFunction(v8::internal::Zone *zone, | |
|
Jim Stichnoth
2016/04/01 01:46:45
Capitalize variable names per LLVM convention.
Eric Holk
2016/04/01 19:15:03
Done.
| |
| 48 v8::internal::wasm::FunctionEnv *env, | |
| 49 const uint8_t *base, | |
|
Jim Stichnoth
2016/04/01 01:46:45
Can you document these arguments, especially base/
Eric Holk
2016/04/01 19:15:03
Done.
With the latest v8 changes (coming in my ne
| |
| 50 const uint8_t *start, | |
| 51 const uint8_t *end); | |
| 52 | |
| 53 private: | |
| 54 uint8_t *Buffer; | |
| 55 SizeT BufferSize; | |
| 56 }; | |
| 57 } | |
| 58 #endif // SUBZERO_SRC_WASMTRANSLATOR_H | |
| OLD | NEW |