| 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" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 } | 107 } |
| 108 return true; | 108 return true; |
| 109 } | 109 } |
| 110 error(pc, pc + 1, "invalid local index"); | 110 error(pc, pc + 1, "invalid local index"); |
| 111 return false; | 111 return false; |
| 112 } | 112 } |
| 113 | 113 |
| 114 inline bool Validate(const byte* pc, GlobalIndexOperand& operand) { | 114 inline bool Validate(const byte* pc, GlobalIndexOperand& operand) { |
| 115 ModuleEnv* m = module_; | 115 ModuleEnv* m = module_; |
| 116 if (m && m->module && operand.index < m->module->globals.size()) { | 116 if (m && m->module && operand.index < m->module->globals.size()) { |
| 117 operand.machine_type = m->module->globals[operand.index].type; | 117 operand.type = m->module->globals[operand.index].type; |
| 118 operand.type = WasmOpcodes::LocalTypeFor(operand.machine_type); | |
| 119 return true; | 118 return true; |
| 120 } | 119 } |
| 121 error(pc, pc + 1, "invalid global index"); | 120 error(pc, pc + 1, "invalid global index"); |
| 122 return false; | 121 return false; |
| 123 } | 122 } |
| 124 | 123 |
| 125 inline bool Complete(const byte* pc, CallFunctionOperand& operand) { | 124 inline bool Complete(const byte* pc, CallFunctionOperand& operand) { |
| 126 ModuleEnv* m = module_; | 125 ModuleEnv* m = module_; |
| 127 if (m && m->module && operand.index < m->module->functions.size()) { | 126 if (m && m->module && operand.index < m->module->functions.size()) { |
| 128 operand.sig = m->module->functions[operand.index].sig; | 127 operand.sig = m->module->functions[operand.index].sig; |
| (...skipping 1574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1703 BitVector* AnalyzeLoopAssignmentForTesting(Zone* zone, size_t num_locals, | 1702 BitVector* AnalyzeLoopAssignmentForTesting(Zone* zone, size_t num_locals, |
| 1704 const byte* start, const byte* end) { | 1703 const byte* start, const byte* end) { |
| 1705 FunctionBody body = {nullptr, nullptr, nullptr, start, end}; | 1704 FunctionBody body = {nullptr, nullptr, nullptr, start, end}; |
| 1706 WasmFullDecoder decoder(zone, nullptr, body); | 1705 WasmFullDecoder decoder(zone, nullptr, body); |
| 1707 return decoder.AnalyzeLoopAssignmentForTesting(start, num_locals); | 1706 return decoder.AnalyzeLoopAssignmentForTesting(start, num_locals); |
| 1708 } | 1707 } |
| 1709 | 1708 |
| 1710 } // namespace wasm | 1709 } // namespace wasm |
| 1711 } // namespace internal | 1710 } // namespace internal |
| 1712 } // namespace v8 | 1711 } // namespace v8 |
| OLD | NEW |