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

Side by Side Diff: src/wasm/wasm-text.cc

Issue 2646873004: Enable emplace_back for zone containers (Closed)
Patch Set: Created 3 years, 11 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/wasm-interpreter.cc ('k') | src/zone/zone-allocator.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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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/wasm/wasm-text.h" 5 #include "src/wasm/wasm-text.h"
6 6
7 #include "src/debug/interface-types.h" 7 #include "src/debug/interface-types.h"
8 #include "src/ostreams.h" 8 #include "src/ostreams.h"
9 #include "src/vector.h" 9 #include "src/vector.h"
10 #include "src/wasm/function-body-decoder.h" 10 #include "src/wasm/function-body-decoder.h"
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 } 183 }
184 184
185 for (; i.has_next(); i.next()) { 185 for (; i.has_next(); i.next()) {
186 WasmOpcode opcode = i.current(); 186 WasmOpcode opcode = i.current();
187 if (opcode == kExprElse || opcode == kExprEnd) --control_depth; 187 if (opcode == kExprElse || opcode == kExprEnd) --control_depth;
188 188
189 DCHECK_LE(0, control_depth); 189 DCHECK_LE(0, control_depth);
190 const int kMaxIndentation = 64; 190 const int kMaxIndentation = 64;
191 int indentation = std::min(kMaxIndentation, 2 * control_depth); 191 int indentation = std::min(kMaxIndentation, 2 * control_depth);
192 if (offset_table) { 192 if (offset_table) {
193 offset_table->push_back(debug::WasmDisassemblyOffsetTableEntry( 193 offset_table->emplace_back(i.pc_offset(), line_nr, indentation);
194 i.pc_offset(), line_nr, indentation));
195 } 194 }
196 195
197 // 64 whitespaces 196 // 64 whitespaces
198 const char padding[kMaxIndentation + 1] = 197 const char padding[kMaxIndentation + 1] =
199 " "; 198 " ";
200 os.write(padding, indentation); 199 os.write(padding, indentation);
201 200
202 switch (opcode) { 201 switch (opcode) {
203 case kExprLoop: 202 case kExprLoop:
204 case kExprIf: 203 case kExprIf:
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 default: 302 default:
304 UNREACHABLE(); 303 UNREACHABLE();
305 break; 304 break;
306 } 305 }
307 os << '\n'; 306 os << '\n';
308 ++line_nr; 307 ++line_nr;
309 } 308 }
310 DCHECK_EQ(0, control_depth); 309 DCHECK_EQ(0, control_depth);
311 DCHECK(i.ok()); 310 DCHECK(i.ok());
312 } 311 }
OLDNEW
« no previous file with comments | « src/wasm/wasm-interpreter.cc ('k') | src/zone/zone-allocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698