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 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 JSObject* holder, | 612 JSObject* holder, |
613 Object* name) { | 613 Object* name) { |
614 #ifdef ENABLE_LOGGING_AND_PROFILING | 614 #ifdef ENABLE_LOGGING_AND_PROFILING |
615 ASSERT(name->IsString()); | 615 ASSERT(name->IsString()); |
616 if (!log_->IsEnabled() || !FLAG_log_api) return; | 616 if (!log_->IsEnabled() || !FLAG_log_api) return; |
617 String* class_name_obj = holder->class_name(); | 617 String* class_name_obj = holder->class_name(); |
618 SmartPointer<char> class_name = | 618 SmartPointer<char> class_name = |
619 class_name_obj->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); | 619 class_name_obj->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); |
620 SmartPointer<char> property_name = | 620 SmartPointer<char> property_name = |
621 String::cast(name)->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); | 621 String::cast(name)->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); |
622 LOGGER->ApiEvent("api,%s,\"%s\",\"%s\"\n", tag, *class_name, *property_name); | 622 ApiEvent("api,%s,\"%s\",\"%s\"\n", tag, *class_name, *property_name); |
623 #endif | 623 #endif |
624 } | 624 } |
625 | 625 |
626 void Logger::ApiIndexedPropertyAccess(const char* tag, | 626 void Logger::ApiIndexedPropertyAccess(const char* tag, |
627 JSObject* holder, | 627 JSObject* holder, |
628 uint32_t index) { | 628 uint32_t index) { |
629 #ifdef ENABLE_LOGGING_AND_PROFILING | 629 #ifdef ENABLE_LOGGING_AND_PROFILING |
630 if (!log_->IsEnabled() || !FLAG_log_api) return; | 630 if (!log_->IsEnabled() || !FLAG_log_api) return; |
631 String* class_name_obj = holder->class_name(); | 631 String* class_name_obj = holder->class_name(); |
632 SmartPointer<char> class_name = | 632 SmartPointer<char> class_name = |
633 class_name_obj->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); | 633 class_name_obj->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); |
634 LOGGER->ApiEvent("api,%s,\"%s\",%u\n", tag, *class_name, index); | 634 this->ApiEvent("api,%s,\"%s\",%u\n", tag, *class_name, index); |
635 #endif | 635 #endif |
636 } | 636 } |
637 | 637 |
638 void Logger::ApiObjectAccess(const char* tag, JSObject* object) { | 638 void Logger::ApiObjectAccess(const char* tag, JSObject* object) { |
639 #ifdef ENABLE_LOGGING_AND_PROFILING | 639 #ifdef ENABLE_LOGGING_AND_PROFILING |
640 if (!log_->IsEnabled() || !FLAG_log_api) return; | 640 if (!log_->IsEnabled() || !FLAG_log_api) return; |
641 String* class_name_obj = object->class_name(); | 641 String* class_name_obj = object->class_name(); |
642 SmartPointer<char> class_name = | 642 SmartPointer<char> class_name = |
643 class_name_obj->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); | 643 class_name_obj->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); |
644 LOGGER->ApiEvent("api,%s,\"%s\"\n", tag, *class_name); | 644 ApiEvent("api,%s,\"%s\"\n", tag, *class_name); |
645 #endif | 645 #endif |
646 } | 646 } |
647 | 647 |
648 | 648 |
649 void Logger::ApiEntryCall(const char* name) { | 649 void Logger::ApiEntryCall(const char* name) { |
650 #ifdef ENABLE_LOGGING_AND_PROFILING | 650 #ifdef ENABLE_LOGGING_AND_PROFILING |
651 if (!log_->IsEnabled() || !FLAG_log_api) return; | 651 if (!log_->IsEnabled() || !FLAG_log_api) return; |
652 LOGGER->ApiEvent("api,%s\n", name); | 652 ApiEvent("api,%s\n", name); |
653 #endif | 653 #endif |
654 } | 654 } |
655 | 655 |
656 | 656 |
657 void Logger::NewEvent(const char* name, void* object, size_t size) { | 657 void Logger::NewEvent(const char* name, void* object, size_t size) { |
658 #ifdef ENABLE_LOGGING_AND_PROFILING | 658 #ifdef ENABLE_LOGGING_AND_PROFILING |
659 if (!log_->IsEnabled() || !FLAG_log) return; | 659 if (!log_->IsEnabled() || !FLAG_log) return; |
660 LogMessageBuilder msg(this); | 660 LogMessageBuilder msg(this); |
661 msg.Append("new,%s,0x%" V8PRIxPTR ",%u\n", name, object, | 661 msg.Append("new,%s,0x%" V8PRIxPTR ",%u\n", name, object, |
662 static_cast<unsigned int>(size)); | 662 static_cast<unsigned int>(size)); |
(...skipping 994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1657 void SamplerRegistry::RemoveActiveSampler(Sampler* sampler) { | 1657 void SamplerRegistry::RemoveActiveSampler(Sampler* sampler) { |
1658 ASSERT(sampler->IsActive()); | 1658 ASSERT(sampler->IsActive()); |
1659 ScopedLock lock(mutex_); | 1659 ScopedLock lock(mutex_); |
1660 ASSERT(active_samplers_ != NULL); | 1660 ASSERT(active_samplers_ != NULL); |
1661 bool removed = active_samplers_->RemoveElement(sampler); | 1661 bool removed = active_samplers_->RemoveElement(sampler); |
1662 ASSERT(removed); | 1662 ASSERT(removed); |
1663 USE(removed); | 1663 USE(removed); |
1664 } | 1664 } |
1665 | 1665 |
1666 } } // namespace v8::internal | 1666 } } // namespace v8::internal |
OLD | NEW |