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

Side by Side Diff: test/unittests/interpreter/source-position-table-unittest.cc

Issue 1801473003: [ignition, debugger] correctly set position for return with elided bytecode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: do not use --ignition flag Created 4 years, 9 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/mjsunit/mjsunit.status ('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/interpreter/source-position-table.h" 7 #include "src/interpreter/source-position-table.h"
8 #include "test/unittests/test-utils.h" 8 #include "test/unittests/test-utils.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 15 matching lines...) Expand all
26 SourcePositionTableBuilder builder(isolate(), zone()); 26 SourcePositionTableBuilder builder(isolate(), zone());
27 for (int i = 0; i < arraysize(offsets); i++) { 27 for (int i = 0; i < arraysize(offsets); i++) {
28 builder.AddStatementPosition(offsets[i], offsets[i]); 28 builder.AddStatementPosition(offsets[i], offsets[i]);
29 } 29 }
30 30
31 // To test correctness, we rely on the assertions in ToSourcePositionTable(). 31 // To test correctness, we rely on the assertions in ToSourcePositionTable().
32 // (Also below.) 32 // (Also below.)
33 CHECK(!builder.ToSourcePositionTable().is_null()); 33 CHECK(!builder.ToSourcePositionTable().is_null());
34 } 34 }
35 35
36 TEST_F(SourcePositionTableTest, EncodeStatementDuplicates) {
37 SourcePositionTableBuilder builder(isolate(), zone());
38 for (int i = 0; i < arraysize(offsets); i++) {
39 builder.AddStatementPosition(offsets[i], offsets[i]);
40 builder.AddStatementPosition(
41 offsets[i], offsets[i],
42 (i % 2 == 0) ? SourcePositionTableBuilder::OVERWRITE_DUPLICATE
43 : SourcePositionTableBuilder::DISCARD_DUPLICATE);
44 builder.AddStatementPosition(offsets[i], offsets[i]);
45 builder.AddStatementPosition(
46 offsets[i], offsets[i],
47 (i % 2 == 0) ? SourcePositionTableBuilder::OVERWRITE_DUPLICATE
48 : SourcePositionTableBuilder::DISCARD_DUPLICATE);
49 }
50
51 // To test correctness, we rely on the assertions in ToSourcePositionTable().
52 // (Also below.)
53 CHECK(!builder.ToSourcePositionTable().is_null());
54 }
55
36 TEST_F(SourcePositionTableTest, EncodeExpression) { 56 TEST_F(SourcePositionTableTest, EncodeExpression) {
37 SourcePositionTableBuilder builder(isolate(), zone()); 57 SourcePositionTableBuilder builder(isolate(), zone());
38 for (int i = 0; i < arraysize(offsets); i++) { 58 for (int i = 0; i < arraysize(offsets); i++) {
39 builder.AddExpressionPosition(offsets[i], offsets[i]); 59 builder.AddExpressionPosition(offsets[i], offsets[i]);
40 } 60 }
41 CHECK(!builder.ToSourcePositionTable().is_null()); 61 CHECK(!builder.ToSourcePositionTable().is_null());
42 } 62 }
43 63
44 TEST_F(SourcePositionTableTest, EncodeAscending) { 64 TEST_F(SourcePositionTableTest, EncodeAscending) {
45 SourcePositionTableBuilder builder(isolate(), zone()); 65 SourcePositionTableBuilder builder(isolate(), zone());
(...skipping 17 matching lines...) Expand all
63 builder.AddExpressionPosition(accumulator, accumulator); 83 builder.AddExpressionPosition(accumulator, accumulator);
64 } 84 }
65 } 85 }
66 86
67 CHECK(!builder.ToSourcePositionTable().is_null()); 87 CHECK(!builder.ToSourcePositionTable().is_null());
68 } 88 }
69 89
70 } // namespace interpreter 90 } // namespace interpreter
71 } // namespace internal 91 } // namespace internal
72 } // namespace v8 92 } // namespace v8
OLDNEW
« no previous file with comments | « test/mjsunit/mjsunit.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698