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

Side by Side Diff: src/wasm/wasm-module-builder.h

Issue 2398023002: [wasm] asm.js - Parse and convert asm.js to wasm a function at a time. (Closed)
Patch Set: fix Created 4 years 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/parsing/parser.cc ('k') | src/wasm/wasm-module-builder.cc » ('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_WASM_MODULE_BUILDER_H_ 5 #ifndef V8_WASM_WASM_MODULE_BUILDER_H_
6 #define V8_WASM_WASM_MODULE_BUILDER_H_ 6 #define V8_WASM_WASM_MODULE_BUILDER_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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 uint32_t AddImport(const char* name, int name_length, FunctionSig* sig); 223 uint32_t AddImport(const char* name, int name_length, FunctionSig* sig);
224 void SetImportName(uint32_t index, const char* name, int name_length) { 224 void SetImportName(uint32_t index, const char* name, int name_length) {
225 imports_[index].name = name; 225 imports_[index].name = name;
226 imports_[index].name_length = name_length; 226 imports_[index].name_length = name_length;
227 } 227 }
228 WasmFunctionBuilder* AddFunction(FunctionSig* sig = nullptr); 228 WasmFunctionBuilder* AddFunction(FunctionSig* sig = nullptr);
229 uint32_t AddGlobal(LocalType type, bool exported, bool mutability = true, 229 uint32_t AddGlobal(LocalType type, bool exported, bool mutability = true,
230 const WasmInitExpr& init = WasmInitExpr()); 230 const WasmInitExpr& init = WasmInitExpr());
231 void AddDataSegment(const byte* data, uint32_t size, uint32_t dest); 231 void AddDataSegment(const byte* data, uint32_t size, uint32_t dest);
232 uint32_t AddSignature(FunctionSig* sig); 232 uint32_t AddSignature(FunctionSig* sig);
233 void AddIndirectFunction(uint32_t index); 233 uint32_t AllocateIndirectFunctions(uint32_t count);
234 void SetIndirectFunction(uint32_t indirect, uint32_t direct);
234 void MarkStartFunction(WasmFunctionBuilder* builder); 235 void MarkStartFunction(WasmFunctionBuilder* builder);
235 236
236 // Writing methods. 237 // Writing methods.
237 void WriteTo(ZoneBuffer& buffer) const; 238 void WriteTo(ZoneBuffer& buffer) const;
238 void WriteAsmJsOffsetTable(ZoneBuffer& buffer) const; 239 void WriteAsmJsOffsetTable(ZoneBuffer& buffer) const;
239 240
240 // TODO(titzer): use SignatureMap from signature-map.h here. 241 // TODO(titzer): use SignatureMap from signature-map.h here.
241 // This signature map is zone-allocated, but the other is heap allocated. 242 // This signature map is zone-allocated, but the other is heap allocated.
242 struct CompareFunctionSigs { 243 struct CompareFunctionSigs {
243 bool operator()(FunctionSig* a, FunctionSig* b) const; 244 bool operator()(FunctionSig* a, FunctionSig* b) const;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 282
282 inline FunctionSig* WasmFunctionBuilder::signature() { 283 inline FunctionSig* WasmFunctionBuilder::signature() {
283 return builder_->signatures_[signature_index_]; 284 return builder_->signatures_[signature_index_];
284 } 285 }
285 286
286 } // namespace wasm 287 } // namespace wasm
287 } // namespace internal 288 } // namespace internal
288 } // namespace v8 289 } // namespace v8
289 290
290 #endif // V8_WASM_WASM_MODULE_BUILDER_H_ 291 #endif // V8_WASM_WASM_MODULE_BUILDER_H_
OLDNEW
« no previous file with comments | « src/parsing/parser.cc ('k') | src/wasm/wasm-module-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698