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 #ifndef V8_WASM_DECODER_H_ | 5 #ifndef V8_WASM_DECODER_H_ |
6 #define V8_WASM_DECODER_H_ | 6 #define V8_WASM_DECODER_H_ |
7 | 7 |
8 #include "src/base/smart-pointers.h" | 8 #include "src/base/smart-pointers.h" |
9 #include "src/flags.h" | 9 #include "src/flags.h" |
10 #include "src/signature.h" | 10 #include "src/signature.h" |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 Result<T> result; | 191 Result<T> result; |
192 if (error_pc_) { | 192 if (error_pc_) { |
193 result.error_code = kError; | 193 result.error_code = kError; |
194 result.start = start_; | 194 result.start = start_; |
195 result.error_pc = error_pc_; | 195 result.error_pc = error_pc_; |
196 result.error_pt = error_pt_; | 196 result.error_pt = error_pt_; |
197 result.error_msg = error_msg_; | 197 result.error_msg = error_msg_; |
198 error_msg_.Reset(nullptr); | 198 error_msg_.Reset(nullptr); |
199 } else { | 199 } else { |
200 result.error_code = kSuccess; | 200 result.error_code = kSuccess; |
201 result.val = val; | |
202 } | 201 } |
| 202 result.val = val; |
203 return result; | 203 return result; |
204 } | 204 } |
205 | 205 |
206 // Resets the boundaries of this decoder. | 206 // Resets the boundaries of this decoder. |
207 void Reset(const byte* start, const byte* end) { | 207 void Reset(const byte* start, const byte* end) { |
208 start_ = start; | 208 start_ = start; |
209 pc_ = start; | 209 pc_ = start; |
210 limit_ = end; | 210 limit_ = end; |
211 error_pc_ = nullptr; | 211 error_pc_ = nullptr; |
212 error_pt_ = nullptr; | 212 error_pt_ = nullptr; |
(...skipping 11 matching lines...) Expand all Loading... |
224 const byte* error_pt_; | 224 const byte* error_pt_; |
225 base::SmartArrayPointer<char> error_msg_; | 225 base::SmartArrayPointer<char> error_msg_; |
226 }; | 226 }; |
227 | 227 |
228 #undef TRACE | 228 #undef TRACE |
229 } // namespace wasm | 229 } // namespace wasm |
230 } // namespace internal | 230 } // namespace internal |
231 } // namespace v8 | 231 } // namespace v8 |
232 | 232 |
233 #endif // V8_WASM_DECODER_H_ | 233 #endif // V8_WASM_DECODER_H_ |
OLD | NEW |