OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 CHECK(IsJSFunction()); | 545 CHECK(IsJSFunction()); |
546 VerifyObjectField(kPrototypeOrInitialMapOffset); | 546 VerifyObjectField(kPrototypeOrInitialMapOffset); |
547 } | 547 } |
548 | 548 |
549 | 549 |
550 void SharedFunctionInfo::SharedFunctionInfoPrint() { | 550 void SharedFunctionInfo::SharedFunctionInfoPrint() { |
551 HeapObject::PrintHeader("SharedFunctionInfo"); | 551 HeapObject::PrintHeader("SharedFunctionInfo"); |
552 PrintF(" - name: "); | 552 PrintF(" - name: "); |
553 name()->ShortPrint(); | 553 name()->ShortPrint(); |
554 PrintF("\n - expected_nof_properties: %d", expected_nof_properties()); | 554 PrintF("\n - expected_nof_properties: %d", expected_nof_properties()); |
555 PrintF("\n - instance class name ="); | 555 PrintF("\n - instance class name = "); |
556 instance_class_name()->Print(); | 556 instance_class_name()->Print(); |
557 PrintF("\n - code ="); | 557 PrintF("\n - code = "); |
558 code()->ShortPrint(); | 558 code()->ShortPrint(); |
559 PrintF("\n - source code ="); | 559 PrintF("\n - source code = "); |
560 GetSourceCode()->ShortPrint(); | 560 GetSourceCode()->ShortPrint(); |
561 PrintF("\n - lazy load: %s", | 561 PrintF("\n - lazy load: %s", |
562 lazy_load_data() == Heap::undefined_value() ? "no" : "yes"); | 562 lazy_load_data() == Heap::undefined_value() ? "no" : "yes"); |
563 // Script files are often large, hard to read. | 563 // Script files are often large, hard to read. |
564 // PrintF("\n - script ="); | 564 // PrintF("\n - script ="); |
565 // script()->Print(); | 565 // script()->Print(); |
566 PrintF("\n - function token position = %d", function_token_position()); | 566 PrintF("\n - function token position = %d", function_token_position()); |
567 PrintF("\n - start position = %d", start_position()); | 567 PrintF("\n - start position = %d", start_position()); |
568 PrintF("\n - end position = %d", end_position()); | 568 PrintF("\n - end position = %d", end_position()); |
569 PrintF("\n - is expression = %d", is_expression()); | 569 PrintF("\n - is expression = %d", is_expression()); |
570 PrintF("\n - debug info = "); | 570 PrintF("\n - debug info = "); |
571 debug_info()->Print(); | 571 debug_info()->ShortPrint(); |
572 PrintF("\n - length = %d", length()); | 572 PrintF("\n - length = %d", length()); |
573 PrintF("\n"); | 573 PrintF("\n"); |
574 } | 574 } |
575 | 575 |
576 void SharedFunctionInfo::SharedFunctionInfoVerify() { | 576 void SharedFunctionInfo::SharedFunctionInfoVerify() { |
577 CHECK(IsSharedFunctionInfo()); | 577 CHECK(IsSharedFunctionInfo()); |
578 VerifyObjectField(kNameOffset); | 578 VerifyObjectField(kNameOffset); |
579 VerifyObjectField(kCodeOffset); | 579 VerifyObjectField(kCodeOffset); |
580 VerifyObjectField(kInstanceClassNameOffset); | 580 VerifyObjectField(kInstanceClassNameOffset); |
581 VerifyObjectField(kExternalReferenceDataOffset); | 581 VerifyObjectField(kExternalReferenceDataOffset); |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 void AccessorInfo::AccessorInfoVerify() { | 745 void AccessorInfo::AccessorInfoVerify() { |
746 CHECK(IsAccessorInfo()); | 746 CHECK(IsAccessorInfo()); |
747 VerifyPointer(getter()); | 747 VerifyPointer(getter()); |
748 VerifyPointer(setter()); | 748 VerifyPointer(setter()); |
749 VerifyPointer(name()); | 749 VerifyPointer(name()); |
750 VerifyPointer(data()); | 750 VerifyPointer(data()); |
751 VerifyPointer(flag()); | 751 VerifyPointer(flag()); |
752 } | 752 } |
753 | 753 |
754 void AccessorInfo::AccessorInfoPrint() { | 754 void AccessorInfo::AccessorInfoPrint() { |
755 PrintF("AccessorInfo"); | 755 HeapObject::PrintHeader("AccessorInfo"); |
756 PrintF("\n - getter: "); | 756 PrintF("\n - getter: "); |
757 getter()->ShortPrint(); | 757 getter()->ShortPrint(); |
758 PrintF("\n - setter: "); | 758 PrintF("\n - setter: "); |
759 setter()->ShortPrint(); | 759 setter()->ShortPrint(); |
760 PrintF("\n - name: "); | 760 PrintF("\n - name: "); |
761 name()->ShortPrint(); | 761 name()->ShortPrint(); |
762 PrintF("\n - data: "); | 762 PrintF("\n - data: "); |
763 data()->ShortPrint(); | 763 data()->ShortPrint(); |
764 PrintF("\n - flag: "); | 764 PrintF("\n - flag: "); |
765 flag()->ShortPrint(); | 765 flag()->ShortPrint(); |
766 } | 766 } |
767 | 767 |
768 void AccessCheckInfo::AccessCheckInfoVerify() { | 768 void AccessCheckInfo::AccessCheckInfoVerify() { |
769 CHECK(IsAccessCheckInfo()); | 769 CHECK(IsAccessCheckInfo()); |
770 VerifyPointer(named_callback()); | 770 VerifyPointer(named_callback()); |
771 VerifyPointer(indexed_callback()); | 771 VerifyPointer(indexed_callback()); |
772 VerifyPointer(data()); | 772 VerifyPointer(data()); |
773 } | 773 } |
774 | 774 |
775 void AccessCheckInfo::AccessCheckInfoPrint() { | 775 void AccessCheckInfo::AccessCheckInfoPrint() { |
776 PrintF("AccessCheckInfo"); | 776 HeapObject::PrintHeader("AccessCheckInfo"); |
777 PrintF("\n - named_callback: "); | 777 PrintF("\n - named_callback: "); |
778 named_callback()->ShortPrint(); | 778 named_callback()->ShortPrint(); |
779 PrintF("\n - indexed_callback: "); | 779 PrintF("\n - indexed_callback: "); |
780 indexed_callback()->ShortPrint(); | 780 indexed_callback()->ShortPrint(); |
781 PrintF("\n - data: "); | 781 PrintF("\n - data: "); |
782 data()->ShortPrint(); | 782 data()->ShortPrint(); |
783 } | 783 } |
784 | 784 |
785 void InterceptorInfo::InterceptorInfoVerify() { | 785 void InterceptorInfo::InterceptorInfoVerify() { |
786 CHECK(IsInterceptorInfo()); | 786 CHECK(IsInterceptorInfo()); |
787 VerifyPointer(getter()); | 787 VerifyPointer(getter()); |
788 VerifyPointer(setter()); | 788 VerifyPointer(setter()); |
789 VerifyPointer(query()); | 789 VerifyPointer(query()); |
790 VerifyPointer(deleter()); | 790 VerifyPointer(deleter()); |
791 VerifyPointer(enumerator()); | 791 VerifyPointer(enumerator()); |
792 VerifyPointer(data()); | 792 VerifyPointer(data()); |
793 } | 793 } |
794 | 794 |
795 void InterceptorInfo::InterceptorInfoPrint() { | 795 void InterceptorInfo::InterceptorInfoPrint() { |
796 PrintF("InterceptorInfo"); | 796 HeapObject::PrintHeader("InterceptorInfo"); |
797 PrintF("\n - getter: "); | 797 PrintF("\n - getter: "); |
798 getter()->ShortPrint(); | 798 getter()->ShortPrint(); |
799 PrintF("\n - setter: "); | 799 PrintF("\n - setter: "); |
800 setter()->ShortPrint(); | 800 setter()->ShortPrint(); |
801 PrintF("\n - query: "); | 801 PrintF("\n - query: "); |
802 query()->ShortPrint(); | 802 query()->ShortPrint(); |
803 PrintF("\n - deleter: "); | 803 PrintF("\n - deleter: "); |
804 deleter()->ShortPrint(); | 804 deleter()->ShortPrint(); |
805 PrintF("\n - enumerator: "); | 805 PrintF("\n - enumerator: "); |
806 enumerator()->ShortPrint(); | 806 enumerator()->ShortPrint(); |
807 PrintF("\n - data: "); | 807 PrintF("\n - data: "); |
808 data()->ShortPrint(); | 808 data()->ShortPrint(); |
809 } | 809 } |
810 | 810 |
811 void CallHandlerInfo::CallHandlerInfoVerify() { | 811 void CallHandlerInfo::CallHandlerInfoVerify() { |
812 CHECK(IsCallHandlerInfo()); | 812 CHECK(IsCallHandlerInfo()); |
813 VerifyPointer(callback()); | 813 VerifyPointer(callback()); |
814 VerifyPointer(data()); | 814 VerifyPointer(data()); |
815 } | 815 } |
816 | 816 |
817 void CallHandlerInfo::CallHandlerInfoPrint() { | 817 void CallHandlerInfo::CallHandlerInfoPrint() { |
818 PrintF("CallHandlerInfo"); | 818 HeapObject::PrintHeader("CallHandlerInfo"); |
819 PrintF("\n - callback: "); | 819 PrintF("\n - callback: "); |
820 callback()->ShortPrint(); | 820 callback()->ShortPrint(); |
821 PrintF("\n - data: "); | 821 PrintF("\n - data: "); |
822 data()->ShortPrint(); | 822 data()->ShortPrint(); |
823 } | 823 } |
824 | 824 |
825 void TemplateInfo::TemplateInfoVerify() { | 825 void TemplateInfo::TemplateInfoVerify() { |
826 VerifyPointer(tag()); | 826 VerifyPointer(tag()); |
827 VerifyPointer(property_list()); | 827 VerifyPointer(property_list()); |
828 } | 828 } |
829 | 829 |
830 void FunctionTemplateInfo::FunctionTemplateInfoVerify() { | 830 void FunctionTemplateInfo::FunctionTemplateInfoVerify() { |
831 CHECK(IsFunctionTemplateInfo()); | 831 CHECK(IsFunctionTemplateInfo()); |
832 TemplateInfoVerify(); | 832 TemplateInfoVerify(); |
833 VerifyPointer(serial_number()); | 833 VerifyPointer(serial_number()); |
834 VerifyPointer(call_code()); | 834 VerifyPointer(call_code()); |
835 VerifyPointer(property_accessors()); | 835 VerifyPointer(property_accessors()); |
836 VerifyPointer(prototype_template()); | 836 VerifyPointer(prototype_template()); |
837 VerifyPointer(parent_template()); | 837 VerifyPointer(parent_template()); |
838 VerifyPointer(named_property_handler()); | 838 VerifyPointer(named_property_handler()); |
839 VerifyPointer(indexed_property_handler()); | 839 VerifyPointer(indexed_property_handler()); |
840 VerifyPointer(instance_template()); | 840 VerifyPointer(instance_template()); |
841 VerifyPointer(signature()); | 841 VerifyPointer(signature()); |
842 VerifyPointer(access_check_info()); | 842 VerifyPointer(access_check_info()); |
843 } | 843 } |
844 | 844 |
845 void FunctionTemplateInfo::FunctionTemplateInfoPrint() { | 845 void FunctionTemplateInfo::FunctionTemplateInfoPrint() { |
846 PrintF("FunctionTemplateInfo"); | 846 HeapObject::PrintHeader("FunctionTemplateInfo"); |
847 PrintF("\n - tag: "); | 847 PrintF("\n - tag: "); |
848 tag()->ShortPrint(); | 848 tag()->ShortPrint(); |
849 PrintF("\n - property_list: "); | 849 PrintF("\n - property_list: "); |
850 property_list()->ShortPrint(); | 850 property_list()->ShortPrint(); |
851 PrintF("\n - serial_number: "); | 851 PrintF("\n - serial_number: "); |
852 serial_number()->ShortPrint(); | 852 serial_number()->ShortPrint(); |
853 PrintF("\n - call_code: "); | 853 PrintF("\n - call_code: "); |
854 call_code()->ShortPrint(); | 854 call_code()->ShortPrint(); |
855 PrintF("\n - property_accessors: "); | 855 PrintF("\n - property_accessors: "); |
856 property_accessors()->ShortPrint(); | 856 property_accessors()->ShortPrint(); |
(...skipping 17 matching lines...) Expand all Loading... |
874 } | 874 } |
875 | 875 |
876 void ObjectTemplateInfo::ObjectTemplateInfoVerify() { | 876 void ObjectTemplateInfo::ObjectTemplateInfoVerify() { |
877 CHECK(IsObjectTemplateInfo()); | 877 CHECK(IsObjectTemplateInfo()); |
878 TemplateInfoVerify(); | 878 TemplateInfoVerify(); |
879 VerifyPointer(constructor()); | 879 VerifyPointer(constructor()); |
880 VerifyPointer(internal_field_count()); | 880 VerifyPointer(internal_field_count()); |
881 } | 881 } |
882 | 882 |
883 void ObjectTemplateInfo::ObjectTemplateInfoPrint() { | 883 void ObjectTemplateInfo::ObjectTemplateInfoPrint() { |
884 PrintF("ObjectTemplateInfo"); | 884 HeapObject::PrintHeader("ObjectTemplateInfo"); |
885 PrintF("\n - constructor: "); | 885 PrintF("\n - constructor: "); |
886 constructor()->ShortPrint(); | 886 constructor()->ShortPrint(); |
887 PrintF("\n - internal_field_count: "); | 887 PrintF("\n - internal_field_count: "); |
888 internal_field_count()->ShortPrint(); | 888 internal_field_count()->ShortPrint(); |
889 } | 889 } |
890 | 890 |
891 void SignatureInfo::SignatureInfoVerify() { | 891 void SignatureInfo::SignatureInfoVerify() { |
892 CHECK(IsSignatureInfo()); | 892 CHECK(IsSignatureInfo()); |
893 VerifyPointer(receiver()); | 893 VerifyPointer(receiver()); |
894 VerifyPointer(args()); | 894 VerifyPointer(args()); |
895 } | 895 } |
896 | 896 |
897 void SignatureInfo::SignatureInfoPrint() { | 897 void SignatureInfo::SignatureInfoPrint() { |
898 PrintF("SignatureInfo"); | 898 HeapObject::PrintHeader("SignatureInfo"); |
899 PrintF("\n - receiver: "); | 899 PrintF("\n - receiver: "); |
900 receiver()->ShortPrint(); | 900 receiver()->ShortPrint(); |
901 PrintF("\n - args: "); | 901 PrintF("\n - args: "); |
902 args()->ShortPrint(); | 902 args()->ShortPrint(); |
903 } | 903 } |
904 | 904 |
905 void TypeSwitchInfo::TypeSwitchInfoVerify() { | 905 void TypeSwitchInfo::TypeSwitchInfoVerify() { |
906 CHECK(IsTypeSwitchInfo()); | 906 CHECK(IsTypeSwitchInfo()); |
907 VerifyPointer(types()); | 907 VerifyPointer(types()); |
908 } | 908 } |
909 | 909 |
910 void TypeSwitchInfo::TypeSwitchInfoPrint() { | 910 void TypeSwitchInfo::TypeSwitchInfoPrint() { |
911 PrintF("TypeSwitchInfo"); | 911 HeapObject::PrintHeader("TypeSwitchInfo"); |
912 PrintF("\n - types: "); | 912 PrintF("\n - types: "); |
913 types()->ShortPrint(); | 913 types()->ShortPrint(); |
914 } | 914 } |
915 | 915 |
916 | 916 |
917 void Script::ScriptVerify() { | 917 void Script::ScriptVerify() { |
918 CHECK(IsScript()); | 918 CHECK(IsScript()); |
919 VerifyPointer(source()); | 919 VerifyPointer(source()); |
920 VerifyPointer(name()); | 920 VerifyPointer(name()); |
921 line_offset()->SmiVerify(); | 921 line_offset()->SmiVerify(); |
(...skipping 21 matching lines...) Expand all Loading... |
943 void DebugInfo::DebugInfoVerify() { | 943 void DebugInfo::DebugInfoVerify() { |
944 CHECK(IsDebugInfo()); | 944 CHECK(IsDebugInfo()); |
945 VerifyPointer(shared()); | 945 VerifyPointer(shared()); |
946 VerifyPointer(original_code()); | 946 VerifyPointer(original_code()); |
947 VerifyPointer(code()); | 947 VerifyPointer(code()); |
948 VerifyPointer(break_points()); | 948 VerifyPointer(break_points()); |
949 } | 949 } |
950 | 950 |
951 | 951 |
952 void DebugInfo::DebugInfoPrint() { | 952 void DebugInfo::DebugInfoPrint() { |
953 PrintF("DebugInfo"); | 953 HeapObject::PrintHeader("DebugInfo"); |
954 PrintF("\n - shared"); | 954 PrintF("\n - shared: "); |
955 shared()->ShortPrint(); | 955 shared()->ShortPrint(); |
956 PrintF("\n - original_code"); | 956 PrintF("\n - original_code: "); |
957 original_code()->ShortPrint(); | 957 original_code()->ShortPrint(); |
958 PrintF("\n - code"); | 958 PrintF("\n - code: "); |
959 code()->ShortPrint(); | 959 code()->ShortPrint(); |
960 PrintF("\n - break_points"); | 960 PrintF("\n - break_points: "); |
961 break_points()->ShortPrint(); | 961 break_points()->Print(); |
962 } | 962 } |
963 | 963 |
964 | 964 |
965 void BreakPointInfo::BreakPointInfoVerify() { | 965 void BreakPointInfo::BreakPointInfoVerify() { |
966 CHECK(IsBreakPointInfo()); | 966 CHECK(IsBreakPointInfo()); |
967 code_position()->SmiVerify(); | 967 code_position()->SmiVerify(); |
968 source_position()->SmiVerify(); | 968 source_position()->SmiVerify(); |
969 statement_position()->SmiVerify(); | 969 statement_position()->SmiVerify(); |
970 VerifyPointer(break_point_objects()); | 970 VerifyPointer(break_point_objects()); |
971 } | 971 } |
972 | 972 |
973 | 973 |
974 void BreakPointInfo::BreakPointInfoPrint() { | 974 void BreakPointInfo::BreakPointInfoPrint() { |
975 PrintF("BreakPointInfo"); | 975 HeapObject::PrintHeader("BreakPointInfo"); |
976 PrintF("\n - code_position %d", code_position()); | 976 PrintF("\n - code_position: %d", code_position()); |
977 PrintF("\n - source_position %d", source_position()); | 977 PrintF("\n - source_position: %d", source_position()); |
978 PrintF("\n - statement_position %d", statement_position()); | 978 PrintF("\n - statement_position: %d", statement_position()); |
979 PrintF("\n - break_point_objects "); | 979 PrintF("\n - break_point_objects: "); |
980 break_point_objects()->ShortPrint(); | 980 break_point_objects()->ShortPrint(); |
981 } | 981 } |
982 | 982 |
983 | 983 |
984 void JSObject::IncrementSpillStatistics(SpillInformation* info) { | 984 void JSObject::IncrementSpillStatistics(SpillInformation* info) { |
985 info->number_of_objects_++; | 985 info->number_of_objects_++; |
986 // Named properties | 986 // Named properties |
987 if (HasFastProperties()) { | 987 if (HasFastProperties()) { |
988 info->number_of_objects_with_fast_properties_++; | 988 info->number_of_objects_with_fast_properties_++; |
989 info->number_of_fast_used_fields_ += map()->NextFreePropertyIndex(); | 989 info->number_of_fast_used_fields_ += map()->NextFreePropertyIndex(); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1081 } | 1081 } |
1082 current = hash; | 1082 current = hash; |
1083 } | 1083 } |
1084 return true; | 1084 return true; |
1085 } | 1085 } |
1086 | 1086 |
1087 | 1087 |
1088 #endif // DEBUG | 1088 #endif // DEBUG |
1089 | 1089 |
1090 } } // namespace v8::internal | 1090 } } // namespace v8::internal |
OLD | NEW |