OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/base/platform/platform.h" | 9 #include "src/base/platform/platform.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 // IC utilities | 307 // IC utilities |
308 #define IC_ENTRY(name) \ | 308 #define IC_ENTRY(name) \ |
309 { IC_UTILITY, \ | 309 { IC_UTILITY, \ |
310 IC::k##name, \ | 310 IC::k##name, \ |
311 "IC::" #name }, | 311 "IC::" #name }, |
312 | 312 |
313 IC_UTIL_LIST(IC_ENTRY) | 313 IC_UTIL_LIST(IC_ENTRY) |
314 #undef IC_ENTRY | 314 #undef IC_ENTRY |
315 }; // end of ref_table[]. | 315 }; // end of ref_table[]. |
316 | 316 |
317 for (size_t i = 0; i < arraysize(ref_table); ++i) { | 317 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(ref_table); ++i) { |
318 AddFromId(ref_table[i].type, | 318 AddFromId(ref_table[i].type, |
319 ref_table[i].id, | 319 ref_table[i].id, |
320 ref_table[i].name, | 320 ref_table[i].name, |
321 isolate); | 321 isolate); |
322 } | 322 } |
323 | 323 |
324 // Stat counters | 324 // Stat counters |
325 struct StatsRefTableEntry { | 325 struct StatsRefTableEntry { |
326 StatsCounter* (Counters::*counter)(); | 326 StatsCounter* (Counters::*counter)(); |
327 uint16_t id; | 327 uint16_t id; |
328 const char* name; | 328 const char* name; |
329 }; | 329 }; |
330 | 330 |
331 const StatsRefTableEntry stats_ref_table[] = { | 331 const StatsRefTableEntry stats_ref_table[] = { |
332 #define COUNTER_ENTRY(name, caption) \ | 332 #define COUNTER_ENTRY(name, caption) \ |
333 { &Counters::name, \ | 333 { &Counters::name, \ |
334 Counters::k_##name, \ | 334 Counters::k_##name, \ |
335 "Counters::" #name }, | 335 "Counters::" #name }, |
336 | 336 |
337 STATS_COUNTER_LIST_1(COUNTER_ENTRY) | 337 STATS_COUNTER_LIST_1(COUNTER_ENTRY) |
338 STATS_COUNTER_LIST_2(COUNTER_ENTRY) | 338 STATS_COUNTER_LIST_2(COUNTER_ENTRY) |
339 #undef COUNTER_ENTRY | 339 #undef COUNTER_ENTRY |
340 }; // end of stats_ref_table[]. | 340 }; // end of stats_ref_table[]. |
341 | 341 |
342 Counters* counters = isolate->counters(); | 342 Counters* counters = isolate->counters(); |
343 for (size_t i = 0; i < arraysize(stats_ref_table); ++i) { | 343 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(stats_ref_table); ++i) { |
344 Add(reinterpret_cast<Address>(GetInternalPointer( | 344 Add(reinterpret_cast<Address>(GetInternalPointer( |
345 (counters->*(stats_ref_table[i].counter))())), | 345 (counters->*(stats_ref_table[i].counter))())), |
346 STATS_COUNTER, | 346 STATS_COUNTER, |
347 stats_ref_table[i].id, | 347 stats_ref_table[i].id, |
348 stats_ref_table[i].name); | 348 stats_ref_table[i].name); |
349 } | 349 } |
350 | 350 |
351 // Top addresses | 351 // Top addresses |
352 | 352 |
353 const char* AddressNames[] = { | 353 const char* AddressNames[] = { |
(...skipping 1602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1956 | 1956 |
1957 int SerializedCodeData::CheckSum(String* string) { | 1957 int SerializedCodeData::CheckSum(String* string) { |
1958 int checksum = Version::Hash(); | 1958 int checksum = Version::Hash(); |
1959 #ifdef DEBUG | 1959 #ifdef DEBUG |
1960 uint32_t seed = static_cast<uint32_t>(checksum); | 1960 uint32_t seed = static_cast<uint32_t>(checksum); |
1961 checksum = static_cast<int>(IteratingStringHasher::Hash(string, seed)); | 1961 checksum = static_cast<int>(IteratingStringHasher::Hash(string, seed)); |
1962 #endif // DEBUG | 1962 #endif // DEBUG |
1963 return checksum; | 1963 return checksum; |
1964 } | 1964 } |
1965 } } // namespace v8::internal | 1965 } } // namespace v8::internal |
OLD | NEW |