| 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/zone-containers.h" | 10 #include "src/zone/zone-containers.h" |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 } | 415 } |
| 416 case kExprI64Const: { | 416 case kExprI64Const: { |
| 417 ImmI64Operand operand(decoder, pc); | 417 ImmI64Operand operand(decoder, pc); |
| 418 return 1 + operand.length; | 418 return 1 + operand.length; |
| 419 } | 419 } |
| 420 case kExprGrowMemory: | 420 case kExprGrowMemory: |
| 421 case kExprMemorySize: { | 421 case kExprMemorySize: { |
| 422 MemoryIndexOperand operand(decoder, pc); | 422 MemoryIndexOperand operand(decoder, pc); |
| 423 return 1 + operand.length; | 423 return 1 + operand.length; |
| 424 } | 424 } |
| 425 case kExprI8Const: | |
| 426 return 2; | |
| 427 case kExprF32Const: | 425 case kExprF32Const: |
| 428 return 5; | 426 return 5; |
| 429 case kExprF64Const: | 427 case kExprF64Const: |
| 430 return 9; | 428 return 9; |
| 431 case kSimdPrefix: { | 429 case kSimdPrefix: { |
| 432 byte simd_index = decoder->checked_read_u8(pc, 1, "simd_index"); | 430 byte simd_index = decoder->checked_read_u8(pc, 1, "simd_index"); |
| 433 WasmOpcode opcode = | 431 WasmOpcode opcode = |
| 434 static_cast<WasmOpcode>(kSimdPrefix << 8 | simd_index); | 432 static_cast<WasmOpcode>(kSimdPrefix << 8 | simd_index); |
| 435 switch (opcode) { | 433 switch (opcode) { |
| 436 #define DECLARE_OPCODE_CASE(name, opcode, sig) case kExpr##name: | 434 #define DECLARE_OPCODE_CASE(name, opcode, sig) case kExpr##name: |
| (...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 984 } | 982 } |
| 985 case kExprReturn: { | 983 case kExprReturn: { |
| 986 DoReturn(); | 984 DoReturn(); |
| 987 break; | 985 break; |
| 988 } | 986 } |
| 989 case kExprUnreachable: { | 987 case kExprUnreachable: { |
| 990 BUILD(Unreachable, position()); | 988 BUILD(Unreachable, position()); |
| 991 EndControl(); | 989 EndControl(); |
| 992 break; | 990 break; |
| 993 } | 991 } |
| 994 case kExprI8Const: { | |
| 995 ImmI8Operand operand(this, pc_); | |
| 996 Push(kWasmI32, BUILD(Int32Constant, operand.value)); | |
| 997 len = 1 + operand.length; | |
| 998 break; | |
| 999 } | |
| 1000 case kExprI32Const: { | 992 case kExprI32Const: { |
| 1001 ImmI32Operand operand(this, pc_); | 993 ImmI32Operand operand(this, pc_); |
| 1002 Push(kWasmI32, BUILD(Int32Constant, operand.value)); | 994 Push(kWasmI32, BUILD(Int32Constant, operand.value)); |
| 1003 len = 1 + operand.length; | 995 len = 1 + operand.length; |
| 1004 break; | 996 break; |
| 1005 } | 997 } |
| 1006 case kExprI64Const: { | 998 case kExprI64Const: { |
| 1007 ImmI64Operand operand(this, pc_); | 999 ImmI64Operand operand(this, pc_); |
| 1008 Push(kWasmI64, BUILD(Int64Constant, operand.value)); | 1000 Push(kWasmI64, BUILD(Int64Constant, operand.value)); |
| 1009 len = 1 + operand.length; | 1001 len = 1 + operand.length; |
| (...skipping 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2062 BitVector* AnalyzeLoopAssignmentForTesting(Zone* zone, size_t num_locals, | 2054 BitVector* AnalyzeLoopAssignmentForTesting(Zone* zone, size_t num_locals, |
| 2063 const byte* start, const byte* end) { | 2055 const byte* start, const byte* end) { |
| 2064 Decoder decoder(start, end); | 2056 Decoder decoder(start, end); |
| 2065 return WasmDecoder::AnalyzeLoopAssignment(&decoder, start, | 2057 return WasmDecoder::AnalyzeLoopAssignment(&decoder, start, |
| 2066 static_cast<int>(num_locals), zone); | 2058 static_cast<int>(num_locals), zone); |
| 2067 } | 2059 } |
| 2068 | 2060 |
| 2069 } // namespace wasm | 2061 } // namespace wasm |
| 2070 } // namespace internal | 2062 } // namespace internal |
| 2071 } // namespace v8 | 2063 } // namespace v8 |
| OLD | NEW |