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

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

Issue 2081703002: Use zig-zag encoding in the source position table. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: addressed comments Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/interpreter/source-position-table.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/interpreter/source-position-table-unittest.cc
diff --git a/test/unittests/interpreter/source-position-table-unittest.cc b/test/unittests/interpreter/source-position-table-unittest.cc
index 230e57d32628ee1424aceff2ef76d3df663983c6..87d58fd99f27b554df58baa7441ce883bcaa2940 100644
--- a/test/unittests/interpreter/source-position-table-unittest.cc
+++ b/test/unittests/interpreter/source-position-table-unittest.cc
@@ -56,23 +56,26 @@ TEST_F(SourcePositionTableTest, EncodeExpression) {
TEST_F(SourcePositionTableTest, EncodeAscending) {
SourcePositionTableBuilder builder(isolate(), zone());
- int accumulator = 0;
+ int code_offset = 0;
+ int source_position = 0;
for (int i = 0; i < arraysize(offsets); i++) {
- accumulator += offsets[i];
+ code_offset += offsets[i];
+ source_position += offsets[i];
if (i % 2) {
- builder.AddPosition(accumulator, accumulator, true);
+ builder.AddPosition(code_offset, source_position, true);
} else {
- builder.AddPosition(accumulator, accumulator, false);
+ builder.AddPosition(code_offset, source_position, false);
}
}
- // Also test negative offsets:
+ // Also test negative offsets for source positions:
for (int i = 0; i < arraysize(offsets); i++) {
- accumulator -= offsets[i];
+ code_offset += offsets[i];
+ source_position -= offsets[i];
if (i % 2) {
- builder.AddPosition(accumulator, accumulator, true);
+ builder.AddPosition(code_offset, source_position, true);
} else {
- builder.AddPosition(accumulator, accumulator, false);
+ builder.AddPosition(code_offset, source_position, false);
}
}
« no previous file with comments | « src/interpreter/source-position-table.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698