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

Side by Side Diff: test/cctest/interpreter/bytecode-expectations-printer.cc

Issue 1717293002: [Interpreter] Refactor bytecode generator test suite. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Reflow REPEAT_249 macro. 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
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 "test/cctest/interpreter/bytecode-expectations-printer.h" 5 #include "test/cctest/interpreter/bytecode-expectations-printer.h"
6 6
7 #include <iostream> 7 #include <iostream>
8 #include <vector> 8 #include <vector>
9 9
10 #include "include/libplatform/libplatform.h" 10 #include "include/libplatform/libplatform.h"
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 return; 217 return;
218 } 218 }
219 } 219 }
220 220
221 void BytecodeExpectationsPrinter::PrintFrameSize( 221 void BytecodeExpectationsPrinter::PrintFrameSize(
222 std::ostream& stream, i::Handle<i::BytecodeArray> bytecode_array) const { 222 std::ostream& stream, i::Handle<i::BytecodeArray> bytecode_array) const {
223 const int kPointerSize = sizeof(void*); 223 const int kPointerSize = sizeof(void*);
224 int frame_size = bytecode_array->frame_size(); 224 int frame_size = bytecode_array->frame_size();
225 225
226 DCHECK_EQ(frame_size % kPointerSize, 0); 226 DCHECK_EQ(frame_size % kPointerSize, 0);
227 stream << "frame size: " << frame_size / kPointerSize; 227 stream << "frame size: " << frame_size / kPointerSize
228 if (frame_size > 0) stream << " # in multiples of sizeof(void*)"; 228 << "\nparameter count: " << bytecode_array->parameter_count() << '\n';
229 stream << "\nparameter count: " << bytecode_array->parameter_count() << '\n';
230 } 229 }
231 230
232 void BytecodeExpectationsPrinter::PrintBytecodeSequence( 231 void BytecodeExpectationsPrinter::PrintBytecodeSequence(
233 std::ostream& stream, i::Handle<i::BytecodeArray> bytecode_array) const { 232 std::ostream& stream, i::Handle<i::BytecodeArray> bytecode_array) const {
234 stream << "bytecodes: [\n"; 233 stream << "bytecode array length: " << bytecode_array->length()
234 << "\nbytecodes: [\n";
235 BytecodeArrayIterator bytecode_iter(bytecode_array); 235 BytecodeArrayIterator bytecode_iter(bytecode_array);
236 for (; !bytecode_iter.done(); bytecode_iter.Advance()) { 236 for (; !bytecode_iter.done(); bytecode_iter.Advance()) {
237 stream << " "; 237 stream << " ";
238 PrintBytecode(stream, bytecode_iter, bytecode_array->parameter_count()); 238 PrintBytecode(stream, bytecode_iter, bytecode_array->parameter_count());
239 stream << ",\n"; 239 stream << ",\n";
240 } 240 }
241 stream << "]\n"; 241 stream << "]\n";
242 } 242 }
243 243
244 void BytecodeExpectationsPrinter::PrintConstantPool( 244 void BytecodeExpectationsPrinter::PrintConstantPool(
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 304
305 stream << "---\n"; 305 stream << "---\n";
306 PrintCodeSnippet(stream, snippet); 306 PrintCodeSnippet(stream, snippet);
307 PrintBytecodeArray(stream, bytecode_array); 307 PrintBytecodeArray(stream, bytecode_array);
308 stream << '\n'; 308 stream << '\n';
309 } 309 }
310 310
311 } // namespace interpreter 311 } // namespace interpreter
312 } // namespace internal 312 } // namespace internal
313 } // namespace v8 313 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698