Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: src/wasm/ast-decoder.cc

Issue 2051043002: Implement Wasm GrowMemory opcode as a wasm runtime call (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Review changes Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/v8.gyp ('k') | src/wasm/wasm-module.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « src/v8.gyp ('k') | src/wasm/wasm-module.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698