| 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 #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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |