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

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

Issue 1667253003: Add Foreign Functions to asm to wasm (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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/encoder.h ('k') | test/mjsunit/wasm/asm-wasm.js » ('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 #include "src/signature.h" 5 #include "src/signature.h"
6 6
7 #include "src/handles.h" 7 #include "src/handles.h"
8 #include "src/v8.h" 8 #include "src/v8.h"
9 #include "src/zone-containers.h" 9 #include "src/zone-containers.h"
10 10
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 return size; 256 return size;
257 } 257 }
258 258
259 259
260 uint32_t WasmFunctionEncoder::BodySize(void) const { 260 uint32_t WasmFunctionEncoder::BodySize(void) const {
261 return external_ ? 0 : static_cast<uint32_t>(body_.size()); 261 return external_ ? 0 : static_cast<uint32_t>(body_.size());
262 } 262 }
263 263
264 264
265 uint32_t WasmFunctionEncoder::NameSize() const { 265 uint32_t WasmFunctionEncoder::NameSize() const {
266 return exported_ ? static_cast<uint32_t>(name_.size()) : 0; 266 return HasName() ? static_cast<uint32_t>(name_.size()) : 0;
267 } 267 }
268 268
269 269
270 void WasmFunctionEncoder::Serialize(byte* buffer, byte** header, 270 void WasmFunctionEncoder::Serialize(byte* buffer, byte** header,
271 byte** body) const { 271 byte** body) const {
272 uint8_t decl_bits = (exported_ ? kDeclFunctionExport : 0) | 272 uint8_t decl_bits = (exported_ ? kDeclFunctionExport : 0) |
273 (external_ ? kDeclFunctionImport : 0) | 273 (external_ ? kDeclFunctionImport : 0) |
274 (HasLocals() ? kDeclFunctionLocals : 0) | 274 (HasLocals() ? kDeclFunctionLocals : 0) |
275 (HasName() ? kDeclFunctionName : 0); 275 (HasName() ? kDeclFunctionName : 0);
276 276
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 next = next | 0x80; 577 next = next | 0x80;
578 } 578 }
579 output.push_back(next); 579 output.push_back(next);
580 shift += 7; 580 shift += 7;
581 } while ((next & 0x80) != 0); 581 } while ((next & 0x80) != 0);
582 return output; 582 return output;
583 } 583 }
584 } // namespace wasm 584 } // namespace wasm
585 } // namespace internal 585 } // namespace internal
586 } // namespace v8 586 } // namespace v8
OLDNEW
« no previous file with comments | « src/wasm/encoder.h ('k') | test/mjsunit/wasm/asm-wasm.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698