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_RESULT_H_ | 5 #ifndef V8_WASM_RESULT_H_ |
6 #define V8_WASM_RESULT_H_ | 6 #define V8_WASM_RESULT_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 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 kTypeError, // type mismatch | 31 kTypeError, // type mismatch |
32 kInvalidLocalIndex, // invalid local | 32 kInvalidLocalIndex, // invalid local |
33 kInvalidGlobalIndex, // invalid global | 33 kInvalidGlobalIndex, // invalid global |
34 kInvalidFunctionIndex, // invalid function | 34 kInvalidFunctionIndex, // invalid function |
35 kInvalidMemType // invalid memory type | 35 kInvalidMemType // invalid memory type |
36 }; | 36 }; |
37 | 37 |
38 // The overall result of decoding a function or a module. | 38 // The overall result of decoding a function or a module. |
39 template <typename T> | 39 template <typename T> |
40 struct Result { | 40 struct Result { |
41 Result() | 41 Result() : val(), error_code(kSuccess), start(nullptr), error_pc(nullptr) { |
42 : val(nullptr), error_code(kSuccess), start(nullptr), error_pc(nullptr) { | |
43 error_msg.Reset(nullptr); | 42 error_msg.Reset(nullptr); |
44 } | 43 } |
45 | 44 |
46 T val; | 45 T val; |
47 ErrorCode error_code; | 46 ErrorCode error_code; |
48 const byte* start; | 47 const byte* start; |
49 const byte* error_pc; | 48 const byte* error_pc; |
50 const byte* error_pt; | 49 const byte* error_pt; |
51 base::SmartArrayPointer<char> error_msg; | 50 base::SmartArrayPointer<char> error_msg; |
52 | 51 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 private: | 107 private: |
109 Isolate* isolate_; | 108 Isolate* isolate_; |
110 const char* context_; | 109 const char* context_; |
111 bool error_; | 110 bool error_; |
112 }; | 111 }; |
113 } // namespace wasm | 112 } // namespace wasm |
114 } // namespace internal | 113 } // namespace internal |
115 } // namespace v8 | 114 } // namespace v8 |
116 | 115 |
117 #endif | 116 #endif |
OLD | NEW |