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

Unified Diff: test/mjsunit/tools/codemap.js

Issue 149513: TickProcessor: more accurate mapping of statically compiled code on Linux. (Closed)
Patch Set: Created 11 years, 5 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 | « no previous file | test/mjsunit/tools/profile.js » ('j') | tools/tickprocessor.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/tools/codemap.js
diff --git a/test/mjsunit/tools/codemap.js b/test/mjsunit/tools/codemap.js
index 55b875883592faeb612500a5d609ad8b53bf2c4a..06a91e81028de1ab4aab8e37d3a95e87ade974c7 100644
--- a/test/mjsunit/tools/codemap.js
+++ b/test/mjsunit/tools/codemap.js
@@ -46,11 +46,11 @@ function assertNoEntry(codeMap, addr) {
};
-(function testStaticCode() {
+(function testLibrariesAndStaticCode() {
var codeMap = new devtools.profiler.CodeMap();
- codeMap.addStaticCode(0x1500, newCodeEntry(0x3000, 'lib1'));
- codeMap.addStaticCode(0x15500, newCodeEntry(0x5000, 'lib2'));
- codeMap.addStaticCode(0x155500, newCodeEntry(0x10000, 'lib3'));
+ codeMap.addLibrary(0x1500, newCodeEntry(0x3000, 'lib1'));
+ codeMap.addLibrary(0x15500, newCodeEntry(0x5000, 'lib2'));
+ codeMap.addLibrary(0x155500, newCodeEntry(0x10000, 'lib3'));
assertNoEntry(codeMap, 0);
assertNoEntry(codeMap, 0x1500 - 1);
assertEntry(codeMap, 'lib1', 0x1500);
@@ -71,6 +71,28 @@ function assertNoEntry(codeMap, addr) {
assertEntry(codeMap, 'lib3', 0x155500 + 0x10000 - 1);
assertNoEntry(codeMap, 0x155500 + 0x10000);
assertNoEntry(codeMap, 0xFFFFFFFF);
+
+ codeMap.addStaticCode(0x1510, newCodeEntry(0x30, 'lib1-f1'));
+ codeMap.addStaticCode(0x1600, newCodeEntry(0x50, 'lib1-f2'));
+ codeMap.addStaticCode(0x15520, newCodeEntry(0x100, 'lib2-f1'));
+ assertEntry(codeMap, 'lib1', 0x1500);
+ assertEntry(codeMap, 'lib1', 0x1510 - 1);
+ assertEntry(codeMap, 'lib1-f1', 0x1510);
+ assertEntry(codeMap, 'lib1-f1', 0x1510 + 0x15);
+ assertEntry(codeMap, 'lib1-f1', 0x1510 + 0x30 - 1);
+ assertEntry(codeMap, 'lib1', 0x1510 + 0x30);
+ assertEntry(codeMap, 'lib1', 0x1600 - 1);
+ assertEntry(codeMap, 'lib1-f2', 0x1600);
+ assertEntry(codeMap, 'lib1-f2', 0x1600 + 0x30);
+ assertEntry(codeMap, 'lib1-f2', 0x1600 + 0x50 - 1);
+ assertEntry(codeMap, 'lib1', 0x1600 + 0x50);
+ assertEntry(codeMap, 'lib2', 0x15500);
+ assertEntry(codeMap, 'lib2', 0x15520 - 1);
+ assertEntry(codeMap, 'lib2-f1', 0x15520);
+ assertEntry(codeMap, 'lib2-f1', 0x15520 + 0x80);
+ assertEntry(codeMap, 'lib2-f1', 0x15520 + 0x100 - 1);
+ assertEntry(codeMap, 'lib2', 0x15520 + 0x100);
+
})();
« no previous file with comments | « no previous file | test/mjsunit/tools/profile.js » ('j') | tools/tickprocessor.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698