OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1574 EnumerateOptimizedFunctionsVisitor visitor(sfis, | 1574 EnumerateOptimizedFunctionsVisitor visitor(sfis, |
1575 code_objects, | 1575 code_objects, |
1576 &compiled_funcs_count); | 1576 &compiled_funcs_count); |
1577 Deoptimizer::VisitAllOptimizedFunctions(heap->isolate(), &visitor); | 1577 Deoptimizer::VisitAllOptimizedFunctions(heap->isolate(), &visitor); |
1578 | 1578 |
1579 return compiled_funcs_count; | 1579 return compiled_funcs_count; |
1580 } | 1580 } |
1581 | 1581 |
1582 | 1582 |
1583 void Logger::LogCodeObject(Object* object) { | 1583 void Logger::LogCodeObject(Object* object) { |
1584 if (FLAG_log_code || FLAG_ll_prof || is_logging_code_events()) { | 1584 Code* code_object = Code::cast(object); |
1585 Code* code_object = Code::cast(object); | 1585 LogEventsAndTags tag = Logger::STUB_TAG; |
1586 LogEventsAndTags tag = Logger::STUB_TAG; | 1586 const char* description = "Unknown code from the snapshot"; |
1587 const char* description = "Unknown code from the snapshot"; | 1587 switch (code_object->kind()) { |
1588 switch (code_object->kind()) { | 1588 case Code::FUNCTION: |
1589 case Code::FUNCTION: | 1589 case Code::OPTIMIZED_FUNCTION: |
1590 case Code::OPTIMIZED_FUNCTION: | 1590 return; // We log this later using LogCompiledFunctions. |
1591 return; // We log this later using LogCompiledFunctions. | 1591 case Code::UNARY_OP_IC: // fall through |
1592 case Code::UNARY_OP_IC: // fall through | 1592 case Code::BINARY_OP_IC: // fall through |
1593 case Code::BINARY_OP_IC: // fall through | 1593 case Code::COMPARE_IC: // fall through |
1594 case Code::COMPARE_IC: // fall through | 1594 case Code::COMPARE_NIL_IC: // fall through |
1595 case Code::COMPARE_NIL_IC: // fall through | 1595 case Code::TO_BOOLEAN_IC: // fall through |
1596 case Code::TO_BOOLEAN_IC: // fall through | 1596 case Code::STUB: |
1597 case Code::STUB: | 1597 description = |
1598 description = | 1598 CodeStub::MajorName(CodeStub::GetMajorKey(code_object), true); |
1599 CodeStub::MajorName(CodeStub::GetMajorKey(code_object), true); | 1599 if (description == NULL) |
1600 if (description == NULL) | 1600 description = "A stub from the snapshot"; |
1601 description = "A stub from the snapshot"; | 1601 tag = Logger::STUB_TAG; |
1602 tag = Logger::STUB_TAG; | 1602 break; |
1603 break; | 1603 case Code::BUILTIN: |
1604 case Code::BUILTIN: | 1604 description = "A builtin from the snapshot"; |
1605 description = "A builtin from the snapshot"; | 1605 tag = Logger::BUILTIN_TAG; |
1606 tag = Logger::BUILTIN_TAG; | 1606 break; |
1607 break; | 1607 case Code::KEYED_LOAD_IC: |
1608 case Code::KEYED_LOAD_IC: | 1608 description = "A keyed load IC from the snapshot"; |
1609 description = "A keyed load IC from the snapshot"; | 1609 tag = Logger::KEYED_LOAD_IC_TAG; |
1610 tag = Logger::KEYED_LOAD_IC_TAG; | 1610 break; |
1611 break; | 1611 case Code::LOAD_IC: |
1612 case Code::LOAD_IC: | 1612 description = "A load IC from the snapshot"; |
1613 description = "A load IC from the snapshot"; | 1613 tag = Logger::LOAD_IC_TAG; |
1614 tag = Logger::LOAD_IC_TAG; | 1614 break; |
1615 break; | 1615 case Code::STORE_IC: |
1616 case Code::STORE_IC: | 1616 description = "A store IC from the snapshot"; |
1617 description = "A store IC from the snapshot"; | 1617 tag = Logger::STORE_IC_TAG; |
1618 tag = Logger::STORE_IC_TAG; | 1618 break; |
1619 break; | 1619 case Code::KEYED_STORE_IC: |
1620 case Code::KEYED_STORE_IC: | 1620 description = "A keyed store IC from the snapshot"; |
1621 description = "A keyed store IC from the snapshot"; | 1621 tag = Logger::KEYED_STORE_IC_TAG; |
1622 tag = Logger::KEYED_STORE_IC_TAG; | 1622 break; |
1623 break; | 1623 case Code::CALL_IC: |
1624 case Code::CALL_IC: | 1624 description = "A call IC from the snapshot"; |
1625 description = "A call IC from the snapshot"; | 1625 tag = Logger::CALL_IC_TAG; |
1626 tag = Logger::CALL_IC_TAG; | 1626 break; |
1627 break; | 1627 case Code::KEYED_CALL_IC: |
1628 case Code::KEYED_CALL_IC: | 1628 description = "A keyed call IC from the snapshot"; |
1629 description = "A keyed call IC from the snapshot"; | 1629 tag = Logger::KEYED_CALL_IC_TAG; |
1630 tag = Logger::KEYED_CALL_IC_TAG; | 1630 break; |
1631 break; | |
1632 } | |
1633 PROFILE(isolate_, CodeCreateEvent(tag, code_object, description)); | |
1634 } | 1631 } |
| 1632 PROFILE(isolate_, CodeCreateEvent(tag, code_object, description)); |
1635 } | 1633 } |
1636 | 1634 |
1637 | 1635 |
1638 void Logger::LogCodeInfo() { | 1636 void Logger::LogCodeInfo() { |
1639 if (!log_->IsEnabled() || !FLAG_ll_prof) return; | 1637 if (!log_->IsEnabled() || !FLAG_ll_prof) return; |
1640 #if V8_TARGET_ARCH_IA32 | 1638 #if V8_TARGET_ARCH_IA32 |
1641 const char arch[] = "ia32"; | 1639 const char arch[] = "ia32"; |
1642 #elif V8_TARGET_ARCH_X64 | 1640 #elif V8_TARGET_ARCH_X64 |
1643 const char arch[] = "x64"; | 1641 const char arch[] = "x64"; |
1644 #elif V8_TARGET_ARCH_ARM | 1642 #elif V8_TARGET_ARCH_ARM |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1886 profiler_ = NULL; | 1884 profiler_ = NULL; |
1887 } | 1885 } |
1888 | 1886 |
1889 delete ticker_; | 1887 delete ticker_; |
1890 ticker_ = NULL; | 1888 ticker_ = NULL; |
1891 | 1889 |
1892 return log_->Close(); | 1890 return log_->Close(); |
1893 } | 1891 } |
1894 | 1892 |
1895 } } // namespace v8::internal | 1893 } } // namespace v8::internal |
OLD | NEW |