Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1391)

Side by Side Diff: src/wasm/wasm-result.h

Issue 2345593003: [wasm] Master CL for Binary 0xC changes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Signed/unsigned mismatch Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <memory> 8 #include <memory>
9 9
10 #include "src/base/compiler-specific.h" 10 #include "src/base/compiler-specific.h"
11 11
12 #include "src/handles.h" 12 #include "src/handles.h"
13 #include "src/globals.h" 13 #include "src/globals.h"
14 14
15 namespace v8 { 15 namespace v8 {
16 namespace internal { 16 namespace internal {
17 17
18 class Isolate; 18 class Isolate;
19 19
20 namespace wasm { 20 namespace wasm {
21 21
22 // Error codes for programmatic checking of the decoder's verification. 22 // Error codes for programmatic checking of the decoder's verification.
23 enum ErrorCode { 23 enum ErrorCode {
24 kSuccess, 24 kSuccess,
25 kError, // TODO(titzer): remove me 25 kError, // TODO(titzer): introduce real error codes
26 kOutOfMemory, // decoder ran out of memory
27 kEndOfCode, // end of code reached prematurely
28 kInvalidOpcode, // found invalid opcode
29 kUnreachableCode, // found unreachable code
30 kImproperContinue, // improperly nested continue
31 kImproperBreak, // improperly nested break
32 kReturnCount, // return count mismatch
33 kTypeError, // type mismatch
34 kInvalidLocalIndex, // invalid local
35 kInvalidGlobalIndex, // invalid global
36 kInvalidFunctionIndex, // invalid function
37 kInvalidMemType // invalid memory type
38 }; 26 };
39 27
40 // The overall result of decoding a function or a module. 28 // The overall result of decoding a function or a module.
41 template <typename T> 29 template <typename T>
42 struct Result { 30 struct Result {
43 Result() : val(), error_code(kSuccess), start(nullptr), error_pc(nullptr) {} 31 Result() : val(), error_code(kSuccess), start(nullptr), error_pc(nullptr) {}
44 Result(Result&& other) { *this = std::move(other); } 32 Result(Result&& other) { *this = std::move(other); }
45 Result& operator=(Result&& other) { 33 Result& operator=(Result&& other) {
46 MoveFrom(other); 34 MoveFrom(other);
47 val = other.val; 35 val = other.val;
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 private: 111 private:
124 Isolate* isolate_; 112 Isolate* isolate_;
125 const char* context_; 113 const char* context_;
126 i::Handle<i::String> message_; 114 i::Handle<i::String> message_;
127 }; 115 };
128 } // namespace wasm 116 } // namespace wasm
129 } // namespace internal 117 } // namespace internal
130 } // namespace v8 118 } // namespace v8
131 119
132 #endif 120 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698