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

Side by Side Diff: src/wasm/function-body-decoder.cc

Issue 2595733003: [wasm] Remove non-standard kExprI8Const bytecode (Closed)
Patch Set: Created 4 years 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
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/zone-containers.h" 10 #include "src/zone/zone-containers.h"
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 } 320 }
321 case kExprI64Const: { 321 case kExprI64Const: {
322 ImmI64Operand operand(this, pc); 322 ImmI64Operand operand(this, pc);
323 return 1 + operand.length; 323 return 1 + operand.length;
324 } 324 }
325 case kExprGrowMemory: 325 case kExprGrowMemory:
326 case kExprMemorySize: { 326 case kExprMemorySize: {
327 MemoryIndexOperand operand(this, pc); 327 MemoryIndexOperand operand(this, pc);
328 return 1 + operand.length; 328 return 1 + operand.length;
329 } 329 }
330 case kExprI8Const:
331 return 2;
332 case kExprF32Const: 330 case kExprF32Const:
333 return 5; 331 return 5;
334 case kExprF64Const: 332 case kExprF64Const:
335 return 9; 333 return 9;
336 case kSimdPrefix: { 334 case kSimdPrefix: {
337 byte simd_index = checked_read_u8(pc, 1, "simd_index"); 335 byte simd_index = checked_read_u8(pc, 1, "simd_index");
338 WasmOpcode opcode = 336 WasmOpcode opcode =
339 static_cast<WasmOpcode>(kSimdPrefix << 8 | simd_index); 337 static_cast<WasmOpcode>(kSimdPrefix << 8 | simd_index);
340 switch (opcode) { 338 switch (opcode) {
341 #define DECLARE_OPCODE_CASE(name, opcode, sig) case kExpr##name: 339 #define DECLARE_OPCODE_CASE(name, opcode, sig) case kExpr##name:
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
953 } 951 }
954 case kExprReturn: { 952 case kExprReturn: {
955 DoReturn(); 953 DoReturn();
956 break; 954 break;
957 } 955 }
958 case kExprUnreachable: { 956 case kExprUnreachable: {
959 BUILD(Unreachable, position()); 957 BUILD(Unreachable, position());
960 EndControl(); 958 EndControl();
961 break; 959 break;
962 } 960 }
963 case kExprI8Const: {
964 ImmI8Operand operand(this, pc_);
965 Push(kWasmI32, BUILD(Int32Constant, operand.value));
966 len = 1 + operand.length;
967 break;
968 }
969 case kExprI32Const: { 961 case kExprI32Const: {
970 ImmI32Operand operand(this, pc_); 962 ImmI32Operand operand(this, pc_);
971 Push(kWasmI32, BUILD(Int32Constant, operand.value)); 963 Push(kWasmI32, BUILD(Int32Constant, operand.value));
972 len = 1 + operand.length; 964 len = 1 + operand.length;
973 break; 965 break;
974 } 966 }
975 case kExprI64Const: { 967 case kExprI64Const: {
976 ImmI64Operand operand(this, pc_); 968 ImmI64Operand operand(this, pc_);
977 Push(kWasmI64, BUILD(Int64Constant, operand.value)); 969 Push(kWasmI64, BUILD(Int64Constant, operand.value));
978 len = 1 + operand.length; 970 len = 1 + operand.length;
(...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after
2059 BitVector* AnalyzeLoopAssignmentForTesting(Zone* zone, size_t num_locals, 2051 BitVector* AnalyzeLoopAssignmentForTesting(Zone* zone, size_t num_locals,
2060 const byte* start, const byte* end) { 2052 const byte* start, const byte* end) {
2061 FunctionBody body = {nullptr, nullptr, nullptr, start, end}; 2053 FunctionBody body = {nullptr, nullptr, nullptr, start, end};
2062 WasmFullDecoder decoder(zone, nullptr, body); 2054 WasmFullDecoder decoder(zone, nullptr, body);
2063 return decoder.AnalyzeLoopAssignmentForTesting(start, num_locals); 2055 return decoder.AnalyzeLoopAssignmentForTesting(start, num_locals);
2064 } 2056 }
2065 2057
2066 } // namespace wasm 2058 } // namespace wasm
2067 } // namespace internal 2059 } // namespace internal
2068 } // namespace v8 2060 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698