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

Side by Side Diff: src/wasm/encoder.h

Issue 2360983002: Enable component builds for fuzzers (Closed)
Patch Set: Rebase Created 4 years, 2 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
« no previous file with comments | « src/wasm/ast-decoder.h ('k') | src/wasm/module-decoder.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_ENCODER_H_ 5 #ifndef V8_WASM_ENCODER_H_
6 #define V8_WASM_ENCODER_H_ 6 #define V8_WASM_ENCODER_H_
7 7
8 #include "src/signature.h" 8 #include "src/signature.h"
9 #include "src/zone/zone-containers.h" 9 #include "src/zone/zone-containers.h"
10 10
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 104
105 private: 105 private:
106 Zone* zone_; 106 Zone* zone_;
107 byte* buffer_; 107 byte* buffer_;
108 byte* pos_; 108 byte* pos_;
109 byte* end_; 109 byte* end_;
110 }; 110 };
111 111
112 class WasmModuleBuilder; 112 class WasmModuleBuilder;
113 113
114 class WasmFunctionBuilder : public ZoneObject { 114 class V8_EXPORT_PRIVATE WasmFunctionBuilder : public ZoneObject {
115 public: 115 public:
116 // Building methods. 116 // Building methods.
117 void SetSignature(FunctionSig* sig); 117 void SetSignature(FunctionSig* sig);
118 uint32_t AddLocal(LocalType type); 118 uint32_t AddLocal(LocalType type);
119 void EmitVarInt(uint32_t val); 119 void EmitVarInt(uint32_t val);
120 void EmitCode(const byte* code, uint32_t code_size); 120 void EmitCode(const byte* code, uint32_t code_size);
121 void Emit(WasmOpcode opcode); 121 void Emit(WasmOpcode opcode);
122 void EmitGetLocal(uint32_t index); 122 void EmitGetLocal(uint32_t index);
123 void EmitSetLocal(uint32_t index); 123 void EmitSetLocal(uint32_t index);
124 void EmitI32Const(int32_t val); 124 void EmitI32Const(int32_t val);
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 ZoneVector<byte> data_; 200 ZoneVector<byte> data_;
201 uint32_t dest_; 201 uint32_t dest_;
202 }; 202 };
203 203
204 struct WasmFunctionImport { 204 struct WasmFunctionImport {
205 uint32_t sig_index; 205 uint32_t sig_index;
206 const char* name; 206 const char* name;
207 int name_length; 207 int name_length;
208 }; 208 };
209 209
210 class WasmModuleBuilder : public ZoneObject { 210 class V8_EXPORT_PRIVATE WasmModuleBuilder : public ZoneObject {
211 public: 211 public:
212 explicit WasmModuleBuilder(Zone* zone); 212 explicit WasmModuleBuilder(Zone* zone);
213 213
214 // Building methods. 214 // Building methods.
215 uint32_t AddFunction(); 215 uint32_t AddFunction();
216 uint32_t AddGlobal(LocalType type, bool exported); 216 uint32_t AddGlobal(LocalType type, bool exported);
217 WasmFunctionBuilder* FunctionAt(size_t index); 217 WasmFunctionBuilder* FunctionAt(size_t index);
218 void AddDataSegment(WasmDataSegmentEncoder* data); 218 void AddDataSegment(WasmDataSegmentEncoder* data);
219 uint32_t AddSignature(FunctionSig* sig); 219 uint32_t AddSignature(FunctionSig* sig);
220 void AddIndirectFunction(uint32_t index); 220 void AddIndirectFunction(uint32_t index);
(...skipping 20 matching lines...) Expand all
241 ZoneVector<std::pair<LocalType, bool>> globals_; 241 ZoneVector<std::pair<LocalType, bool>> globals_;
242 SignatureMap signature_map_; 242 SignatureMap signature_map_;
243 int start_function_index_; 243 int start_function_index_;
244 }; 244 };
245 245
246 } // namespace wasm 246 } // namespace wasm
247 } // namespace internal 247 } // namespace internal
248 } // namespace v8 248 } // namespace v8
249 249
250 #endif // V8_WASM_ENCODER_H_ 250 #endif // V8_WASM_ENCODER_H_
OLDNEW
« no previous file with comments | « src/wasm/ast-decoder.h ('k') | src/wasm/module-decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698