OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 assertEntry(codeMap, 'code {1}', 0x1700); | 150 assertEntry(codeMap, 'code {1}', 0x1700); |
151 })(); | 151 })(); |
152 | 152 |
153 | 153 |
154 (function testStaticEntriesExport() { | 154 (function testStaticEntriesExport() { |
155 var codeMap = new CodeMap(); | 155 var codeMap = new CodeMap(); |
156 codeMap.addStaticCode(0x1500, newCodeEntry(0x3000, 'lib1')); | 156 codeMap.addStaticCode(0x1500, newCodeEntry(0x3000, 'lib1')); |
157 codeMap.addStaticCode(0x15500, newCodeEntry(0x5000, 'lib2')); | 157 codeMap.addStaticCode(0x15500, newCodeEntry(0x5000, 'lib2')); |
158 codeMap.addStaticCode(0x155500, newCodeEntry(0x10000, 'lib3')); | 158 codeMap.addStaticCode(0x155500, newCodeEntry(0x10000, 'lib3')); |
159 var allStatics = codeMap.getAllStaticEntries(); | 159 var allStatics = codeMap.getAllStaticEntries(); |
| 160 allStatics = allStatics.map(String); |
160 allStatics.sort(); | 161 allStatics.sort(); |
161 assertEquals(['lib1: 3000', 'lib2: 5000', 'lib3: 10000'], allStatics); | 162 assertEquals(['lib1: 3000', 'lib2: 5000', 'lib3: 10000'], allStatics); |
162 })(); | 163 })(); |
163 | 164 |
164 | 165 |
165 (function testDynamicEntriesExport() { | 166 (function testDynamicEntriesExport() { |
166 var codeMap = new CodeMap(); | 167 var codeMap = new CodeMap(); |
167 codeMap.addCode(0x1500, newCodeEntry(0x200, 'code1')); | 168 codeMap.addCode(0x1500, newCodeEntry(0x200, 'code1')); |
168 codeMap.addCode(0x1700, newCodeEntry(0x100, 'code2')); | 169 codeMap.addCode(0x1700, newCodeEntry(0x100, 'code2')); |
169 codeMap.addCode(0x1900, newCodeEntry(0x50, 'code3')); | 170 codeMap.addCode(0x1900, newCodeEntry(0x50, 'code3')); |
170 var allDynamics = codeMap.getAllDynamicEntries(); | 171 var allDynamics = codeMap.getAllDynamicEntries(); |
| 172 allDynamics = allDynamics.map(String); |
171 allDynamics.sort(); | 173 allDynamics.sort(); |
172 assertEquals(['code1: 200', 'code2: 100', 'code3: 50'], allDynamics); | 174 assertEquals(['code1: 200', 'code2: 100', 'code3: 50'], allDynamics); |
173 codeMap.deleteCode(0x1700); | 175 codeMap.deleteCode(0x1700); |
174 var allDynamics2 = codeMap.getAllDynamicEntries(); | 176 var allDynamics2 = codeMap.getAllDynamicEntries(); |
| 177 allDynamics2 = allDynamics2.map(String); |
175 allDynamics2.sort(); | 178 allDynamics2.sort(); |
176 assertEquals(['code1: 200', 'code3: 50'], allDynamics2); | 179 assertEquals(['code1: 200', 'code3: 50'], allDynamics2); |
177 codeMap.deleteCode(0x1500); | 180 codeMap.deleteCode(0x1500); |
178 var allDynamics3 = codeMap.getAllDynamicEntries(); | 181 var allDynamics3 = codeMap.getAllDynamicEntries(); |
179 assertEquals(['code3: 50'], allDynamics3); | 182 assertEquals(['code3: 50'], allDynamics3.map(String)); |
180 })(); | 183 })(); |
OLD | NEW |