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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 uint16_t WasmFunctionBuilder::AddVar(LocalType type, bool param) { | 94 uint16_t WasmFunctionBuilder::AddVar(LocalType type, bool param) { |
95 locals_.push_back({param, type}); | 95 locals_.push_back({param, type}); |
96 return static_cast<uint16_t>(locals_.size() - 1); | 96 return static_cast<uint16_t>(locals_.size() - 1); |
97 } | 97 } |
98 | 98 |
99 | 99 |
100 void WasmFunctionBuilder::ReturnType(LocalType type) { return_type_ = type; } | 100 void WasmFunctionBuilder::ReturnType(LocalType type) { return_type_ = type; } |
101 | 101 |
102 | 102 |
103 void WasmFunctionBuilder::EmitCode(const byte* code, uint32_t code_size) { | 103 void WasmFunctionBuilder::EmitCode(const byte* code, uint32_t code_size) { |
104 EmitCode(code, code_size, NULL, 0); | 104 EmitCode(code, code_size, nullptr, 0); |
105 } | 105 } |
106 | 106 |
107 | 107 |
108 void WasmFunctionBuilder::EmitCode(const byte* code, uint32_t code_size, | 108 void WasmFunctionBuilder::EmitCode(const byte* code, uint32_t code_size, |
109 const uint32_t* local_indices, | 109 const uint32_t* local_indices, |
110 uint32_t indices_size) { | 110 uint32_t indices_size) { |
111 size_t size = body_.size(); | 111 size_t size = body_.size(); |
112 for (size_t i = 0; i < code_size; i++) { | 112 for (size_t i = 0; i < code_size; i++) { |
113 body_.push_back(code[i]); | 113 body_.push_back(code[i]); |
114 } | 114 } |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 next = next | 0x80; | 579 next = next | 0x80; |
580 } | 580 } |
581 output.push_back(next); | 581 output.push_back(next); |
582 shift += 7; | 582 shift += 7; |
583 } while ((next & 0x80) != 0); | 583 } while ((next & 0x80) != 0); |
584 return output; | 584 return output; |
585 } | 585 } |
586 } // namespace wasm | 586 } // namespace wasm |
587 } // namespace internal | 587 } // namespace internal |
588 } // namespace v8 | 588 } // namespace v8 |
OLD | NEW |