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/ast-decoder.h" | 8 #include "src/wasm/ast-decoder.h" |
9 #include "src/wasm/decoder.h" | 9 #include "src/wasm/decoder.h" |
10 #include "src/wasm/wasm-external-refs.h" | 10 #include "src/wasm/wasm-external-refs.h" |
(...skipping 1574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1585 break; \ | 1585 break; \ |
1586 } | 1586 } |
1587 | 1587 |
1588 ASMJS_STORE_CASE(I32AsmjsStoreMem8, int32_t, int8_t); | 1588 ASMJS_STORE_CASE(I32AsmjsStoreMem8, int32_t, int8_t); |
1589 ASMJS_STORE_CASE(I32AsmjsStoreMem16, int32_t, int16_t); | 1589 ASMJS_STORE_CASE(I32AsmjsStoreMem16, int32_t, int16_t); |
1590 ASMJS_STORE_CASE(I32AsmjsStoreMem, int32_t, int32_t); | 1590 ASMJS_STORE_CASE(I32AsmjsStoreMem, int32_t, int32_t); |
1591 ASMJS_STORE_CASE(F32AsmjsStoreMem, float, float); | 1591 ASMJS_STORE_CASE(F32AsmjsStoreMem, float, float); |
1592 ASMJS_STORE_CASE(F64AsmjsStoreMem, double, double); | 1592 ASMJS_STORE_CASE(F64AsmjsStoreMem, double, double); |
1593 #undef ASMJS_STORE_CASE | 1593 #undef ASMJS_STORE_CASE |
1594 case kExprGrowMemory: { | 1594 case kExprGrowMemory: { |
| 1595 MemoryIndexOperand operand(&decoder, code->at(pc)); |
1595 uint32_t delta_pages = Pop().to<uint32_t>(); | 1596 uint32_t delta_pages = Pop().to<uint32_t>(); |
1596 Push(pc, WasmVal(ExecuteGrowMemory(delta_pages, instance()))); | 1597 Push(pc, WasmVal(ExecuteGrowMemory(delta_pages, instance()))); |
| 1598 len = 1 + operand.length; |
1597 break; | 1599 break; |
1598 } | 1600 } |
1599 case kExprMemorySize: { | 1601 case kExprMemorySize: { |
| 1602 MemoryIndexOperand operand(&decoder, code->at(pc)); |
1600 Push(pc, WasmVal(static_cast<uint32_t>(instance()->mem_size / | 1603 Push(pc, WasmVal(static_cast<uint32_t>(instance()->mem_size / |
1601 WasmModule::kPageSize))); | 1604 WasmModule::kPageSize))); |
| 1605 len = 1 + operand.length; |
1602 break; | 1606 break; |
1603 } | 1607 } |
1604 #define EXECUTE_SIMPLE_BINOP(name, ctype, op) \ | 1608 #define EXECUTE_SIMPLE_BINOP(name, ctype, op) \ |
1605 case kExpr##name: { \ | 1609 case kExpr##name: { \ |
1606 WasmVal rval = Pop(); \ | 1610 WasmVal rval = Pop(); \ |
1607 WasmVal lval = Pop(); \ | 1611 WasmVal lval = Pop(); \ |
1608 WasmVal result(lval.to<ctype>() op rval.to<ctype>()); \ | 1612 WasmVal result(lval.to<ctype>() op rval.to<ctype>()); \ |
1609 Push(pc, result); \ | 1613 Push(pc, result); \ |
1610 break; \ | 1614 break; \ |
1611 } | 1615 } |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1881 | 1885 |
1882 ControlTransferMap WasmInterpreter::ComputeControlTransfersForTesting( | 1886 ControlTransferMap WasmInterpreter::ComputeControlTransfersForTesting( |
1883 Zone* zone, const byte* start, const byte* end) { | 1887 Zone* zone, const byte* start, const byte* end) { |
1884 ControlTransfers targets(zone, nullptr, nullptr, start, end); | 1888 ControlTransfers targets(zone, nullptr, nullptr, start, end); |
1885 return targets.map_; | 1889 return targets.map_; |
1886 } | 1890 } |
1887 | 1891 |
1888 } // namespace wasm | 1892 } // namespace wasm |
1889 } // namespace internal | 1893 } // namespace internal |
1890 } // namespace v8 | 1894 } // namespace v8 |
OLD | NEW |