| 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/wasm/module-decoder.h" | 5 #include "src/wasm/module-decoder.h" |
| 6 | 6 |
| 7 #include "src/base/functional.h" | 7 #include "src/base/functional.h" |
| 8 #include "src/base/platform/platform.h" | 8 #include "src/base/platform/platform.h" |
| 9 #include "src/flags.h" | 9 #include "src/flags.h" |
| 10 #include "src/macro-assembler.h" | 10 #include "src/macro-assembler.h" |
| (...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1099 } | 1099 } |
| 1100 | 1100 |
| 1101 FunctionSig* DecodeWasmSignatureForTesting(Zone* zone, const byte* start, | 1101 FunctionSig* DecodeWasmSignatureForTesting(Zone* zone, const byte* start, |
| 1102 const byte* end) { | 1102 const byte* end) { |
| 1103 ModuleDecoder decoder(zone, start, end, kWasmOrigin); | 1103 ModuleDecoder decoder(zone, start, end, kWasmOrigin); |
| 1104 return decoder.DecodeFunctionSignature(start); | 1104 return decoder.DecodeFunctionSignature(start); |
| 1105 } | 1105 } |
| 1106 | 1106 |
| 1107 WasmInitExpr DecodeWasmInitExprForTesting(const byte* start, const byte* end) { | 1107 WasmInitExpr DecodeWasmInitExprForTesting(const byte* start, const byte* end) { |
| 1108 AccountingAllocator allocator; | 1108 AccountingAllocator allocator; |
| 1109 Zone zone(&allocator); | 1109 Zone zone(&allocator, ZONE_NAME); |
| 1110 ModuleDecoder decoder(&zone, start, end, kWasmOrigin); | 1110 ModuleDecoder decoder(&zone, start, end, kWasmOrigin); |
| 1111 return decoder.DecodeInitExpr(start); | 1111 return decoder.DecodeInitExpr(start); |
| 1112 } | 1112 } |
| 1113 | 1113 |
| 1114 FunctionResult DecodeWasmFunction(Isolate* isolate, Zone* zone, | 1114 FunctionResult DecodeWasmFunction(Isolate* isolate, Zone* zone, |
| 1115 ModuleEnv* module_env, | 1115 ModuleEnv* module_env, |
| 1116 const byte* function_start, | 1116 const byte* function_start, |
| 1117 const byte* function_end) { | 1117 const byte* function_end) { |
| 1118 HistogramTimerScope wasm_decode_function_time_scope( | 1118 HistogramTimerScope wasm_decode_function_time_scope( |
| 1119 isolate->counters()->wasm_decode_function_time()); | 1119 isolate->counters()->wasm_decode_function_time()); |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1205 table.push_back(std::move(func_asm_offsets)); | 1205 table.push_back(std::move(func_asm_offsets)); |
| 1206 } | 1206 } |
| 1207 if (decoder.more()) decoder.error("unexpected additional bytes"); | 1207 if (decoder.more()) decoder.error("unexpected additional bytes"); |
| 1208 | 1208 |
| 1209 return decoder.toResult(std::move(table)); | 1209 return decoder.toResult(std::move(table)); |
| 1210 } | 1210 } |
| 1211 | 1211 |
| 1212 } // namespace wasm | 1212 } // namespace wasm |
| 1213 } // namespace internal | 1213 } // namespace internal |
| 1214 } // namespace v8 | 1214 } // namespace v8 |
| OLD | NEW |