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

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

Issue 2788413004: [inspector] cache stack frame for call sites (Closed)
Patch Set: reverted v8-debugger change Created 3 years, 8 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/source-position-matcher.cc ('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 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 CHECK_EQ(bytecodes()->at(i), expected_bytes[i]); 141 CHECK_EQ(bytecodes()->at(i), expected_bytes[i]);
142 } 142 }
143 143
144 Handle<BytecodeArray> bytecode_array = writer()->ToBytecodeArray( 144 Handle<BytecodeArray> bytecode_array = writer()->ToBytecodeArray(
145 isolate(), 0, 0, factory()->empty_fixed_array()); 145 isolate(), 0, 0, factory()->empty_fixed_array());
146 CHECK_EQ(bytecodes()->size(), arraysize(expected_bytes)); 146 CHECK_EQ(bytecodes()->size(), arraysize(expected_bytes));
147 147
148 PositionTableEntry expected_positions[] = { 148 PositionTableEntry expected_positions[] = {
149 {0, 10, false}, {1, 55, true}, {9, 70, true}}; 149 {0, 10, false}, {1, 55, true}, {9, 70, true}};
150 SourcePositionTableIterator source_iterator( 150 SourcePositionTableIterator source_iterator(
151 bytecode_array->source_position_table()); 151 bytecode_array->SourcePositionTable());
152 for (size_t i = 0; i < arraysize(expected_positions); ++i) { 152 for (size_t i = 0; i < arraysize(expected_positions); ++i) {
153 const PositionTableEntry& expected = expected_positions[i]; 153 const PositionTableEntry& expected = expected_positions[i];
154 CHECK_EQ(source_iterator.code_offset(), expected.code_offset); 154 CHECK_EQ(source_iterator.code_offset(), expected.code_offset);
155 CHECK_EQ(source_iterator.source_position().ScriptOffset(), 155 CHECK_EQ(source_iterator.source_position().ScriptOffset(),
156 expected.source_position); 156 expected.source_position);
157 CHECK_EQ(source_iterator.is_statement(), expected.is_statement); 157 CHECK_EQ(source_iterator.is_statement(), expected.is_statement);
158 source_iterator.Advance(); 158 source_iterator.Advance();
159 } 159 }
160 CHECK(source_iterator.done()); 160 CHECK(source_iterator.done());
161 } 161 }
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 226
227 CHECK_EQ(bytecodes()->size(), arraysize(expected_bytes)); 227 CHECK_EQ(bytecodes()->size(), arraysize(expected_bytes));
228 for (size_t i = 0; i < arraysize(expected_bytes); ++i) { 228 for (size_t i = 0; i < arraysize(expected_bytes); ++i) {
229 CHECK_EQ(static_cast<int>(bytecodes()->at(i)), 229 CHECK_EQ(static_cast<int>(bytecodes()->at(i)),
230 static_cast<int>(expected_bytes[i])); 230 static_cast<int>(expected_bytes[i]));
231 } 231 }
232 232
233 Handle<BytecodeArray> bytecode_array = writer()->ToBytecodeArray( 233 Handle<BytecodeArray> bytecode_array = writer()->ToBytecodeArray(
234 isolate(), 0, 0, factory()->empty_fixed_array()); 234 isolate(), 0, 0, factory()->empty_fixed_array());
235 SourcePositionTableIterator source_iterator( 235 SourcePositionTableIterator source_iterator(
236 bytecode_array->source_position_table()); 236 bytecode_array->SourcePositionTable());
237 for (size_t i = 0; i < arraysize(expected_positions); ++i) { 237 for (size_t i = 0; i < arraysize(expected_positions); ++i) {
238 const PositionTableEntry& expected = expected_positions[i]; 238 const PositionTableEntry& expected = expected_positions[i];
239 CHECK_EQ(source_iterator.code_offset(), expected.code_offset); 239 CHECK_EQ(source_iterator.code_offset(), expected.code_offset);
240 CHECK_EQ(source_iterator.source_position().ScriptOffset(), 240 CHECK_EQ(source_iterator.source_position().ScriptOffset(),
241 expected.source_position); 241 expected.source_position);
242 CHECK_EQ(source_iterator.is_statement(), expected.is_statement); 242 CHECK_EQ(source_iterator.is_statement(), expected.is_statement);
243 source_iterator.Advance(); 243 source_iterator.Advance();
244 } 244 }
245 CHECK(source_iterator.done()); 245 CHECK(source_iterator.done());
246 } 246 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 278
279 CHECK_EQ(bytecodes()->size(), arraysize(expected_bytes)); 279 CHECK_EQ(bytecodes()->size(), arraysize(expected_bytes));
280 for (size_t i = 0; i < arraysize(expected_bytes); ++i) { 280 for (size_t i = 0; i < arraysize(expected_bytes); ++i) {
281 CHECK_EQ(static_cast<int>(bytecodes()->at(i)), 281 CHECK_EQ(static_cast<int>(bytecodes()->at(i)),
282 static_cast<int>(expected_bytes[i])); 282 static_cast<int>(expected_bytes[i]));
283 } 283 }
284 284
285 Handle<BytecodeArray> bytecode_array = writer()->ToBytecodeArray( 285 Handle<BytecodeArray> bytecode_array = writer()->ToBytecodeArray(
286 isolate(), 0, 0, factory()->empty_fixed_array()); 286 isolate(), 0, 0, factory()->empty_fixed_array());
287 SourcePositionTableIterator source_iterator( 287 SourcePositionTableIterator source_iterator(
288 bytecode_array->source_position_table()); 288 bytecode_array->SourcePositionTable());
289 for (size_t i = 0; i < arraysize(expected_positions); ++i) { 289 for (size_t i = 0; i < arraysize(expected_positions); ++i) {
290 const PositionTableEntry& expected = expected_positions[i]; 290 const PositionTableEntry& expected = expected_positions[i];
291 CHECK_EQ(source_iterator.code_offset(), expected.code_offset); 291 CHECK_EQ(source_iterator.code_offset(), expected.code_offset);
292 CHECK_EQ(source_iterator.source_position().ScriptOffset(), 292 CHECK_EQ(source_iterator.source_position().ScriptOffset(),
293 expected.source_position); 293 expected.source_position);
294 CHECK_EQ(source_iterator.is_statement(), expected.is_statement); 294 CHECK_EQ(source_iterator.is_statement(), expected.is_statement);
295 source_iterator.Advance(); 295 source_iterator.Advance();
296 } 296 }
297 CHECK(source_iterator.done()); 297 CHECK(source_iterator.done());
298 } 298 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 344
345 CHECK_EQ(bytecodes()->size(), arraysize(expected_bytes)); 345 CHECK_EQ(bytecodes()->size(), arraysize(expected_bytes));
346 for (size_t i = 0; i < arraysize(expected_bytes); ++i) { 346 for (size_t i = 0; i < arraysize(expected_bytes); ++i) {
347 CHECK_EQ(static_cast<int>(bytecodes()->at(i)), 347 CHECK_EQ(static_cast<int>(bytecodes()->at(i)),
348 static_cast<int>(expected_bytes[i])); 348 static_cast<int>(expected_bytes[i]));
349 } 349 }
350 350
351 Handle<BytecodeArray> bytecode_array = writer()->ToBytecodeArray( 351 Handle<BytecodeArray> bytecode_array = writer()->ToBytecodeArray(
352 isolate(), 0, 0, factory()->empty_fixed_array()); 352 isolate(), 0, 0, factory()->empty_fixed_array());
353 SourcePositionTableIterator source_iterator( 353 SourcePositionTableIterator source_iterator(
354 bytecode_array->source_position_table()); 354 bytecode_array->SourcePositionTable());
355 for (size_t i = 0; i < arraysize(expected_positions); ++i) { 355 for (size_t i = 0; i < arraysize(expected_positions); ++i) {
356 const PositionTableEntry& expected = expected_positions[i]; 356 const PositionTableEntry& expected = expected_positions[i];
357 CHECK_EQ(source_iterator.code_offset(), expected.code_offset); 357 CHECK_EQ(source_iterator.code_offset(), expected.code_offset);
358 CHECK_EQ(source_iterator.source_position().ScriptOffset(), 358 CHECK_EQ(source_iterator.source_position().ScriptOffset(),
359 expected.source_position); 359 expected.source_position);
360 CHECK_EQ(source_iterator.is_statement(), expected.is_statement); 360 CHECK_EQ(source_iterator.is_statement(), expected.is_statement);
361 source_iterator.Advance(); 361 source_iterator.Advance();
362 } 362 }
363 CHECK(source_iterator.done()); 363 CHECK(source_iterator.done());
364 } 364 }
365 365
366 } // namespace interpreter 366 } // namespace interpreter
367 } // namespace internal 367 } // namespace internal
368 } // namespace v8 368 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/interpreter/source-position-matcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698