OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1371 void Print(); | 1371 void Print(); |
1372 void SaveTiming(const char* name, int64_t ticks, unsigned size); | 1372 void SaveTiming(const char* name, int64_t ticks, unsigned size); |
1373 static HStatistics* Instance() { | 1373 static HStatistics* Instance() { |
1374 static SetOncePointer<HStatistics> instance; | 1374 static SetOncePointer<HStatistics> instance; |
1375 if (!instance.is_set()) { | 1375 if (!instance.is_set()) { |
1376 instance.set(new HStatistics()); | 1376 instance.set(new HStatistics()); |
1377 } | 1377 } |
1378 return instance.get(); | 1378 return instance.get(); |
1379 } | 1379 } |
1380 | 1380 |
| 1381 void IncrementSubtotals(int64_t create_graph, |
| 1382 int64_t optimize_graph, |
| 1383 int64_t generate_code) { |
| 1384 create_graph_ += create_graph; |
| 1385 optimize_graph_ += optimize_graph; |
| 1386 generate_code_ += generate_code; |
| 1387 } |
| 1388 |
1381 private: | 1389 private: |
1382 HStatistics() | 1390 HStatistics() |
1383 : timing_(5), | 1391 : timing_(5), |
1384 names_(5), | 1392 names_(5), |
1385 sizes_(5), | 1393 sizes_(5), |
1386 total_(0), | 1394 create_graph_(0), |
| 1395 optimize_graph_(0), |
| 1396 generate_code_(0), |
1387 total_size_(0), | 1397 total_size_(0), |
1388 full_code_gen_(0), | 1398 full_code_gen_(0), |
1389 source_size_(0) { } | 1399 source_size_(0) { } |
1390 | 1400 |
1391 List<int64_t> timing_; | 1401 List<int64_t> timing_; |
1392 List<const char*> names_; | 1402 List<const char*> names_; |
1393 List<unsigned> sizes_; | 1403 List<unsigned> sizes_; |
1394 int64_t total_; | 1404 int64_t create_graph_; |
| 1405 int64_t optimize_graph_; |
| 1406 int64_t generate_code_; |
1395 unsigned total_size_; | 1407 unsigned total_size_; |
1396 int64_t full_code_gen_; | 1408 int64_t full_code_gen_; |
1397 double source_size_; | 1409 double source_size_; |
1398 }; | 1410 }; |
1399 | 1411 |
1400 | 1412 |
1401 class HPhase BASE_EMBEDDED { | 1413 class HPhase BASE_EMBEDDED { |
1402 public: | 1414 public: |
1403 static const char* const kFullCodeGen; | 1415 static const char* const kFullCodeGen; |
1404 static const char* const kTotal; | |
1405 | 1416 |
1406 explicit HPhase(const char* name) { Begin(name, NULL, NULL, NULL); } | 1417 explicit HPhase(const char* name) { Begin(name, NULL, NULL, NULL); } |
1407 HPhase(const char* name, HGraph* graph) { | 1418 HPhase(const char* name, HGraph* graph) { |
1408 Begin(name, graph, NULL, NULL); | 1419 Begin(name, graph, NULL, NULL); |
1409 } | 1420 } |
1410 HPhase(const char* name, LChunk* chunk) { | 1421 HPhase(const char* name, LChunk* chunk) { |
1411 Begin(name, NULL, chunk, NULL); | 1422 Begin(name, NULL, chunk, NULL); |
1412 } | 1423 } |
1413 HPhase(const char* name, LAllocator* allocator) { | 1424 HPhase(const char* name, LAllocator* allocator) { |
1414 Begin(name, NULL, NULL, allocator); | 1425 Begin(name, NULL, NULL, allocator); |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1516 const char* filename_; | 1527 const char* filename_; |
1517 HeapStringAllocator string_allocator_; | 1528 HeapStringAllocator string_allocator_; |
1518 StringStream trace_; | 1529 StringStream trace_; |
1519 int indent_; | 1530 int indent_; |
1520 }; | 1531 }; |
1521 | 1532 |
1522 | 1533 |
1523 } } // namespace v8::internal | 1534 } } // namespace v8::internal |
1524 | 1535 |
1525 #endif // V8_HYDROGEN_H_ | 1536 #endif // V8_HYDROGEN_H_ |
OLD | NEW |