| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project 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 #include "src/wasm/wasm-interpreter.h" | 5 #include "src/wasm/wasm-interpreter.h" |
| 6 | 6 |
| 7 #include "src/utils.h" | 7 #include "src/utils.h" |
| 8 #include "src/wasm/decoder.h" | 8 #include "src/wasm/decoder.h" |
| 9 #include "src/wasm/function-body-decoder.h" | 9 #include "src/wasm/function-body-decoder.h" |
| 10 #include "src/wasm/wasm-external-refs.h" | 10 #include "src/wasm/wasm-external-refs.h" |
| (...skipping 1766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1777 class WasmInterpreterInternals : public ZoneObject { | 1777 class WasmInterpreterInternals : public ZoneObject { |
| 1778 public: | 1778 public: |
| 1779 WasmInstance* instance_; | 1779 WasmInstance* instance_; |
| 1780 // Create a copy of the module bytes for the interpreter, since the passed | 1780 // Create a copy of the module bytes for the interpreter, since the passed |
| 1781 // pointer might be invalidated after constructing the interpreter. | 1781 // pointer might be invalidated after constructing the interpreter. |
| 1782 const ZoneVector<uint8_t> module_bytes_; | 1782 const ZoneVector<uint8_t> module_bytes_; |
| 1783 CodeMap codemap_; | 1783 CodeMap codemap_; |
| 1784 ZoneVector<ThreadImpl> threads_; | 1784 ZoneVector<ThreadImpl> threads_; |
| 1785 | 1785 |
| 1786 WasmInterpreterInternals(Zone* zone, const ModuleBytesEnv& env) | 1786 WasmInterpreterInternals(Zone* zone, const ModuleBytesEnv& env) |
| 1787 : instance_(env.instance), | 1787 : instance_(env.module_env.instance), |
| 1788 module_bytes_(env.module_bytes.start(), env.module_bytes.end(), zone), | 1788 module_bytes_(env.wire_bytes.start(), env.wire_bytes.end(), zone), |
| 1789 codemap_(env.instance ? env.instance->module : nullptr, | 1789 codemap_( |
| 1790 module_bytes_.data(), zone), | 1790 env.module_env.instance ? env.module_env.instance->module : nullptr, |
| 1791 module_bytes_.data(), zone), |
| 1791 threads_(zone) { | 1792 threads_(zone) { |
| 1792 threads_.emplace_back(zone, &codemap_, env.instance); | 1793 threads_.emplace_back(zone, &codemap_, env.module_env.instance); |
| 1793 } | 1794 } |
| 1794 | 1795 |
| 1795 void Delete() { threads_.clear(); } | 1796 void Delete() { threads_.clear(); } |
| 1796 }; | 1797 }; |
| 1797 | 1798 |
| 1798 //============================================================================ | 1799 //============================================================================ |
| 1799 // Implementation of the public interface of the interpreter. | 1800 // Implementation of the public interface of the interpreter. |
| 1800 //============================================================================ | 1801 //============================================================================ |
| 1801 WasmInterpreter::WasmInterpreter(const ModuleBytesEnv& env, | 1802 WasmInterpreter::WasmInterpreter(const ModuleBytesEnv& env, |
| 1802 AccountingAllocator* allocator) | 1803 AccountingAllocator* allocator) |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1909 return none; | 1910 return none; |
| 1910 } | 1911 } |
| 1911 | 1912 |
| 1912 void InterpretedFrame::SetLocalVal(int index, WasmVal val) { UNIMPLEMENTED(); } | 1913 void InterpretedFrame::SetLocalVal(int index, WasmVal val) { UNIMPLEMENTED(); } |
| 1913 | 1914 |
| 1914 void InterpretedFrame::SetExprVal(int pc, WasmVal val) { UNIMPLEMENTED(); } | 1915 void InterpretedFrame::SetExprVal(int pc, WasmVal val) { UNIMPLEMENTED(); } |
| 1915 | 1916 |
| 1916 } // namespace wasm | 1917 } // namespace wasm |
| 1917 } // namespace internal | 1918 } // namespace internal |
| 1918 } // namespace v8 | 1919 } // namespace v8 |
| OLD | NEW |