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

Side by Side Diff: test/unittests/interpreter/bytecode-array-writer-unittest.cc

Issue 2248673002: Avoid accessing Isolate in source position logging. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 4 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/source-position-table.cc ('k') | test/unittests/source-position-table-unittest.cc » ('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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/factory.h" 8 #include "src/factory.h"
9 #include "src/interpreter/bytecode-array-writer.h" 9 #include "src/interpreter/bytecode-array-writer.h"
10 #include "src/interpreter/bytecode-label.h" 10 #include "src/interpreter/bytecode-label.h"
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 Write(Bytecode::kReturn, {85, true}); 228 Write(Bytecode::kReturn, {85, true});
229 CHECK_EQ(max_register_count(), 8); 229 CHECK_EQ(max_register_count(), 8);
230 #undef R 230 #undef R
231 231
232 CHECK_EQ(bytecodes()->size(), arraysize(expected_bytes)); 232 CHECK_EQ(bytecodes()->size(), arraysize(expected_bytes));
233 for (size_t i = 0; i < arraysize(expected_bytes); ++i) { 233 for (size_t i = 0; i < arraysize(expected_bytes); ++i) {
234 CHECK_EQ(static_cast<int>(bytecodes()->at(i)), 234 CHECK_EQ(static_cast<int>(bytecodes()->at(i)),
235 static_cast<int>(expected_bytes[i])); 235 static_cast<int>(expected_bytes[i]));
236 } 236 }
237 237
238 Handle<ByteArray> source_positions = 238 Handle<BytecodeArray> bytecode_array =
239 source_position_table_builder()->ToSourcePositionTable(); 239 writer()->ToBytecodeArray(0, 0, factory()->empty_fixed_array());
240 SourcePositionTableIterator source_iterator(*source_positions); 240 SourcePositionTableIterator source_iterator(
241 bytecode_array->source_position_table());
241 for (size_t i = 0; i < arraysize(expected_positions); ++i) { 242 for (size_t i = 0; i < arraysize(expected_positions); ++i) {
242 const PositionTableEntry& expected = expected_positions[i]; 243 const PositionTableEntry& expected = expected_positions[i];
243 CHECK_EQ(source_iterator.code_offset(), expected.code_offset); 244 CHECK_EQ(source_iterator.code_offset(), expected.code_offset);
244 CHECK_EQ(source_iterator.source_position(), expected.source_position); 245 CHECK_EQ(source_iterator.source_position(), expected.source_position);
245 CHECK_EQ(source_iterator.is_statement(), expected.is_statement); 246 CHECK_EQ(source_iterator.is_statement(), expected.is_statement);
246 source_iterator.Advance(); 247 source_iterator.Advance();
247 } 248 }
248 CHECK(source_iterator.done()); 249 CHECK(source_iterator.done());
249 } 250 }
250 251
251 } // namespace interpreter 252 } // namespace interpreter
252 } // namespace internal 253 } // namespace internal
253 } // namespace v8 254 } // namespace v8
OLDNEW
« no previous file with comments | « src/source-position-table.cc ('k') | test/unittests/source-position-table-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698