| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/signature.h" | 5 #include "src/signature.h" |
| 6 | 6 |
| 7 #include "src/bit-vector.h" | 7 #include "src/bit-vector.h" |
| 8 #include "src/flags.h" | 8 #include "src/flags.h" |
| 9 #include "src/handles.h" | 9 #include "src/handles.h" |
| 10 #include "src/zone-containers.h" | 10 #include "src/zone-containers.h" |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 } | 324 } |
| 325 | 325 |
| 326 #define DECLARE_OPCODE_CASE(name, opcode, sig) \ | 326 #define DECLARE_OPCODE_CASE(name, opcode, sig) \ |
| 327 case kExpr##name: \ | 327 case kExpr##name: \ |
| 328 return kArity_##sig; | 328 return kArity_##sig; |
| 329 | 329 |
| 330 FOREACH_LOAD_MEM_OPCODE(DECLARE_OPCODE_CASE) | 330 FOREACH_LOAD_MEM_OPCODE(DECLARE_OPCODE_CASE) |
| 331 FOREACH_STORE_MEM_OPCODE(DECLARE_OPCODE_CASE) | 331 FOREACH_STORE_MEM_OPCODE(DECLARE_OPCODE_CASE) |
| 332 FOREACH_MISC_MEM_OPCODE(DECLARE_OPCODE_CASE) | 332 FOREACH_MISC_MEM_OPCODE(DECLARE_OPCODE_CASE) |
| 333 FOREACH_SIMPLE_OPCODE(DECLARE_OPCODE_CASE) | 333 FOREACH_SIMPLE_OPCODE(DECLARE_OPCODE_CASE) |
| 334 FOREACH_SIMPLE_MEM_OPCODE(DECLARE_OPCODE_CASE) |
| 334 FOREACH_ASMJS_COMPAT_OPCODE(DECLARE_OPCODE_CASE) | 335 FOREACH_ASMJS_COMPAT_OPCODE(DECLARE_OPCODE_CASE) |
| 335 FOREACH_SIMD_OPCODE(DECLARE_OPCODE_CASE) | 336 FOREACH_SIMD_OPCODE(DECLARE_OPCODE_CASE) |
| 336 #undef DECLARE_OPCODE_CASE | 337 #undef DECLARE_OPCODE_CASE |
| 337 default: | 338 default: |
| 338 UNREACHABLE(); | 339 UNREACHABLE(); |
| 339 return 0; | 340 return 0; |
| 340 } | 341 } |
| 341 } | 342 } |
| 342 | 343 |
| 343 unsigned OpcodeLength(const byte* pc) { | 344 unsigned OpcodeLength(const byte* pc) { |
| (...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 988 case kExprF32StoreMem: | 989 case kExprF32StoreMem: |
| 989 len = DecodeStoreMem(kAstF32, MachineType::Float32()); | 990 len = DecodeStoreMem(kAstF32, MachineType::Float32()); |
| 990 break; | 991 break; |
| 991 case kExprF64StoreMem: | 992 case kExprF64StoreMem: |
| 992 len = DecodeStoreMem(kAstF64, MachineType::Float64()); | 993 len = DecodeStoreMem(kAstF64, MachineType::Float64()); |
| 993 break; | 994 break; |
| 994 | 995 |
| 995 case kExprMemorySize: | 996 case kExprMemorySize: |
| 996 Push(kAstI32, BUILD(MemSize, 0)); | 997 Push(kAstI32, BUILD(MemSize, 0)); |
| 997 break; | 998 break; |
| 998 case kExprGrowMemory: { | |
| 999 Value val = Pop(0, kAstI32); | |
| 1000 USE(val); // TODO(titzer): build node for grow memory | |
| 1001 Push(kAstI32, BUILD(Int32Constant, 0)); | |
| 1002 break; | |
| 1003 } | |
| 1004 case kExprCallFunction: { | 999 case kExprCallFunction: { |
| 1005 CallFunctionOperand operand(this, pc_); | 1000 CallFunctionOperand operand(this, pc_); |
| 1006 if (Validate(pc_, operand)) { | 1001 if (Validate(pc_, operand)) { |
| 1007 TFNode** buffer = PopArgs(operand.sig); | 1002 TFNode** buffer = PopArgs(operand.sig); |
| 1008 TFNode* call = | 1003 TFNode* call = |
| 1009 BUILD(CallDirect, operand.index, buffer, position()); | 1004 BUILD(CallDirect, operand.index, buffer, position()); |
| 1010 Push(GetReturnType(operand.sig), call); | 1005 Push(GetReturnType(operand.sig), call); |
| 1011 } | 1006 } |
| 1012 len = 1 + operand.length; | 1007 len = 1 + operand.length; |
| 1013 break; | 1008 break; |
| (...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1684 BitVector* AnalyzeLoopAssignmentForTesting(Zone* zone, size_t num_locals, | 1679 BitVector* AnalyzeLoopAssignmentForTesting(Zone* zone, size_t num_locals, |
| 1685 const byte* start, const byte* end) { | 1680 const byte* start, const byte* end) { |
| 1686 FunctionBody body = {nullptr, nullptr, nullptr, start, end}; | 1681 FunctionBody body = {nullptr, nullptr, nullptr, start, end}; |
| 1687 SR_WasmDecoder decoder(zone, nullptr, body); | 1682 SR_WasmDecoder decoder(zone, nullptr, body); |
| 1688 return decoder.AnalyzeLoopAssignmentForTesting(start, num_locals); | 1683 return decoder.AnalyzeLoopAssignmentForTesting(start, num_locals); |
| 1689 } | 1684 } |
| 1690 | 1685 |
| 1691 } // namespace wasm | 1686 } // namespace wasm |
| 1692 } // namespace internal | 1687 } // namespace internal |
| 1693 } // namespace v8 | 1688 } // namespace v8 |
| OLD | NEW |