| 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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 TRACE("<end>\n"); | 296 TRACE("<end>\n"); |
| 297 pc_ = limit_; | 297 pc_ = limit_; |
| 298 return t; | 298 return t; |
| 299 } | 299 } |
| 300 | 300 |
| 301 // Converts the given value to a {Result}, copying the error if necessary. | 301 // Converts the given value to a {Result}, copying the error if necessary. |
| 302 template <typename T> | 302 template <typename T> |
| 303 Result<T> toResult(T val) { | 303 Result<T> toResult(T val) { |
| 304 Result<T> result; | 304 Result<T> result; |
| 305 if (error_pc_) { | 305 if (error_pc_) { |
| 306 TRACE("Result error: %s\n", error_msg_.get()); |
| 306 result.error_code = kError; | 307 result.error_code = kError; |
| 307 result.start = start_; | 308 result.start = start_; |
| 308 result.error_pc = error_pc_; | 309 result.error_pc = error_pc_; |
| 309 result.error_pt = error_pt_; | 310 result.error_pt = error_pt_; |
| 310 // transfer ownership of the error to the result. | 311 // transfer ownership of the error to the result. |
| 311 result.error_msg.Reset(error_msg_.Detach()); | 312 result.error_msg.Reset(error_msg_.Detach()); |
| 312 } else { | 313 } else { |
| 313 result.error_code = kSuccess; | 314 result.error_code = kSuccess; |
| 314 } | 315 } |
| 315 result.val = val; | 316 result.val = val; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 return result; | 399 return result; |
| 399 } | 400 } |
| 400 }; | 401 }; |
| 401 | 402 |
| 402 #undef TRACE | 403 #undef TRACE |
| 403 } // namespace wasm | 404 } // namespace wasm |
| 404 } // namespace internal | 405 } // namespace internal |
| 405 } // namespace v8 | 406 } // namespace v8 |
| 406 | 407 |
| 407 #endif // V8_WASM_DECODER_H_ | 408 #endif // V8_WASM_DECODER_H_ |
| OLD | NEW |