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

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

Issue 1963663002: [interpreter] Add checks for source position to test-bytecode-generator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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 | « test/cctest/interpreter/bytecode_expectations/WithStatement.golden ('k') | no next file » | 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 <fstream> 5 #include <fstream>
6 6
7 #include "src/v8.h" 7 #include "src/v8.h"
8 8
9 #include "src/compiler.h" 9 #include "src/compiler.h"
10 #include "src/interpreter/bytecode-array-iterator.h" 10 #include "src/interpreter/bytecode-array-iterator.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 std::string BuildActual(const BytecodeExpectationsPrinter& printer, 101 std::string BuildActual(const BytecodeExpectationsPrinter& printer,
102 const char* (&snippet_list)[N], 102 const char* (&snippet_list)[N],
103 const char* prologue = nullptr, 103 const char* prologue = nullptr,
104 const char* epilogue = nullptr) { 104 const char* epilogue = nullptr) {
105 std::ostringstream actual_stream; 105 std::ostringstream actual_stream;
106 for (const char* snippet : snippet_list) { 106 for (const char* snippet : snippet_list) {
107 std::string source_code; 107 std::string source_code;
108 if (prologue) source_code += prologue; 108 if (prologue) source_code += prologue;
109 source_code += snippet; 109 source_code += snippet;
110 if (epilogue) source_code += epilogue; 110 if (epilogue) source_code += epilogue;
111 if (source_code.size() > 0 && source_code.back() != '\n') {
112 source_code += '\n';
rmcilroy 2016/05/09 15:36:52 Does this get hit in the current code? Is there a
113 }
111 printer.PrintExpectation(actual_stream, source_code); 114 printer.PrintExpectation(actual_stream, source_code);
112 } 115 }
113 return actual_stream.str(); 116 return actual_stream.str();
114 } 117 }
115 118
116 using ConstantPoolType = BytecodeExpectationsPrinter::ConstantPoolType; 119 using ConstantPoolType = BytecodeExpectationsPrinter::ConstantPoolType;
117 120
118 TEST(PrimitiveReturnStatements) { 121 TEST(PrimitiveReturnStatements) {
119 InitializedIgnitionHandleScope scope; 122 InitializedIgnitionHandleScope scope;
120 BytecodeExpectationsPrinter printer(CcTest::isolate(), 123 BytecodeExpectationsPrinter printer(CcTest::isolate(),
(...skipping 2047 matching lines...) Expand 10 before | Expand all | Expand 10 after
2168 }; 2171 };
2169 2172
2170 CHECK_EQ(BuildActual(printer, snippets), LoadGolden("Generators.golden")); 2173 CHECK_EQ(BuildActual(printer, snippets), LoadGolden("Generators.golden"));
2171 2174
2172 FLAG_ignition_generators = old_flag; 2175 FLAG_ignition_generators = old_flag;
2173 } 2176 }
2174 2177
2175 } // namespace interpreter 2178 } // namespace interpreter
2176 } // namespace internal 2179 } // namespace internal
2177 } // namespace v8 2180 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/interpreter/bytecode_expectations/WithStatement.golden ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698