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" |
11 | 11 |
12 #include "src/wasm/ast-decoder.h" | 12 #include "src/wasm/ast-decoder.h" |
13 #include "src/wasm/decoder.h" | 13 #include "src/wasm/decoder.h" |
14 #include "src/wasm/wasm-module.h" | 14 #include "src/wasm/wasm-module.h" |
15 #include "src/wasm/wasm-opcodes.h" | 15 #include "src/wasm/wasm-opcodes.h" |
16 | 16 |
17 #include "src/ostreams.h" | 17 #include "src/ostreams.h" |
18 | 18 |
19 #include "src/compiler/wasm-compiler.h" | 19 #include "src/compiler/wasm-compiler.h" |
| 20 |
20 namespace v8 { | 21 namespace v8 { |
21 namespace internal { | 22 namespace internal { |
22 namespace wasm { | 23 namespace wasm { |
23 | 24 |
24 #if DEBUG | 25 #if DEBUG |
25 #define TRACE(...) \ | 26 #define TRACE(...) \ |
26 do { \ | 27 do { \ |
27 if (FLAG_trace_wasm_decoder) PrintF(__VA_ARGS__); \ | 28 if (FLAG_trace_wasm_decoder) PrintF(__VA_ARGS__); \ |
28 } while (false) | 29 } while (false) |
29 #else | 30 #else |
(...skipping 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1030 if (FLAG_wasm_jit_prototype) { | 1031 if (FLAG_wasm_jit_prototype) { |
1031 JITSingleFunctionOperand operand(this, pc_); | 1032 JITSingleFunctionOperand operand(this, pc_); |
1032 if (Validate(pc_, operand)) { | 1033 if (Validate(pc_, operand)) { |
1033 Value index = Pop(2, kAstI32); | 1034 Value index = Pop(2, kAstI32); |
1034 Value length = Pop(1, kAstI32); | 1035 Value length = Pop(1, kAstI32); |
1035 Value base = Pop(0, kAstI32); | 1036 Value base = Pop(0, kAstI32); |
1036 TFNode* call = | 1037 TFNode* call = |
1037 BUILD(JITSingleFunction, base.node, length.node, index.node, | 1038 BUILD(JITSingleFunction, base.node, length.node, index.node, |
1038 operand.sig_index, operand.sig, position()); | 1039 operand.sig_index, operand.sig, position()); |
1039 Push(kAstI32, call); | 1040 Push(kAstI32, call); |
| 1041 break; |
1040 } | 1042 } |
1041 len = 1 + operand.length; | |
1042 break; | |
1043 } | 1043 } |
1044 } | 1044 } |
1045 default: | 1045 default: |
1046 error("Invalid opcode"); | 1046 error("Invalid opcode"); |
1047 return; | 1047 return; |
1048 } | 1048 } |
1049 } // end complex bytecode | 1049 } // end complex bytecode |
1050 | 1050 |
1051 #if DEBUG | 1051 #if DEBUG |
1052 if (FLAG_trace_wasm_decoder) { | 1052 if (FLAG_trace_wasm_decoder) { |
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1702 BitVector* AnalyzeLoopAssignmentForTesting(Zone* zone, size_t num_locals, | 1702 BitVector* AnalyzeLoopAssignmentForTesting(Zone* zone, size_t num_locals, |
1703 const byte* start, const byte* end) { | 1703 const byte* start, const byte* end) { |
1704 FunctionBody body = {nullptr, nullptr, nullptr, start, end}; | 1704 FunctionBody body = {nullptr, nullptr, nullptr, start, end}; |
1705 WasmFullDecoder decoder(zone, nullptr, body); | 1705 WasmFullDecoder decoder(zone, nullptr, body); |
1706 return decoder.AnalyzeLoopAssignmentForTesting(start, num_locals); | 1706 return decoder.AnalyzeLoopAssignmentForTesting(start, num_locals); |
1707 } | 1707 } |
1708 | 1708 |
1709 } // namespace wasm | 1709 } // namespace wasm |
1710 } // namespace internal | 1710 } // namespace internal |
1711 } // namespace v8 | 1711 } // namespace v8 |
OLD | NEW |