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/compiler-specific.h" | 8 #include "src/base/compiler-specific.h" |
9 #include "src/base/smart-pointers.h" | 9 #include "src/base/smart-pointers.h" |
10 #include "src/flags.h" | 10 #include "src/flags.h" |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 TRACE("Result error: %s\n", error_msg_.get()); | 309 TRACE("Result error: %s\n", error_msg_.get()); |
310 result.error_code = kError; | 310 result.error_code = kError; |
311 result.start = start_; | 311 result.start = start_; |
312 result.error_pc = error_pc_; | 312 result.error_pc = error_pc_; |
313 result.error_pt = error_pt_; | 313 result.error_pt = error_pt_; |
314 // transfer ownership of the error to the result. | 314 // transfer ownership of the error to the result. |
315 result.error_msg.Reset(error_msg_.Detach()); | 315 result.error_msg.Reset(error_msg_.Detach()); |
316 } else { | 316 } else { |
317 result.error_code = kSuccess; | 317 result.error_code = kSuccess; |
318 } | 318 } |
319 result.val = val; | 319 result.val = std::move(val); |
320 return result; | 320 return result; |
321 } | 321 } |
322 | 322 |
323 // Resets the boundaries of this decoder. | 323 // Resets the boundaries of this decoder. |
324 void Reset(const byte* start, const byte* end) { | 324 void Reset(const byte* start, const byte* end) { |
325 start_ = start; | 325 start_ = start; |
326 pc_ = start; | 326 pc_ = start; |
327 limit_ = end; | 327 limit_ = end; |
328 end_ = end; | 328 end_ = end; |
329 error_pc_ = nullptr; | 329 error_pc_ = nullptr; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 return result; | 402 return result; |
403 } | 403 } |
404 }; | 404 }; |
405 | 405 |
406 #undef TRACE | 406 #undef TRACE |
407 } // namespace wasm | 407 } // namespace wasm |
408 } // namespace internal | 408 } // namespace internal |
409 } // namespace v8 | 409 } // namespace v8 |
410 | 410 |
411 #endif // V8_WASM_DECODER_H_ | 411 #endif // V8_WASM_DECODER_H_ |
OLD | NEW |