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 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
787 HeapObject::PrintHeader(out, "SharedFunctionInfo"); | 787 HeapObject::PrintHeader(out, "SharedFunctionInfo"); |
788 PrintF(out, " - name: "); | 788 PrintF(out, " - name: "); |
789 name()->ShortPrint(out); | 789 name()->ShortPrint(out); |
790 PrintF(out, "\n - expected_nof_properties: %d", expected_nof_properties()); | 790 PrintF(out, "\n - expected_nof_properties: %d", expected_nof_properties()); |
791 PrintF(out, "\n - instance class name = "); | 791 PrintF(out, "\n - instance class name = "); |
792 instance_class_name()->Print(out); | 792 instance_class_name()->Print(out); |
793 PrintF(out, "\n - code = "); | 793 PrintF(out, "\n - code = "); |
794 code()->ShortPrint(out); | 794 code()->ShortPrint(out); |
795 if (HasSourceCode()) { | 795 if (HasSourceCode()) { |
796 PrintF(out, "\n - source code = "); | 796 PrintF(out, "\n - source code = "); |
797 GetSourceCode()->ShortPrint(out); | 797 String* source = String::cast(Script::cast(script())->source()); |
| 798 int start = start_position(); |
| 799 int length = end_position() - start; |
| 800 SmartArrayPointer<char> source_string = |
| 801 source->ToCString(DISALLOW_NULLS, |
| 802 FAST_STRING_TRAVERSAL, |
| 803 start, length, NULL); |
| 804 PrintF(out, "%s", *source_string); |
798 } | 805 } |
799 // Script files are often large, hard to read. | 806 // Script files are often large, hard to read. |
800 // PrintF(out, "\n - script ="); | 807 // PrintF(out, "\n - script ="); |
801 // script()->Print(out); | 808 // script()->Print(out); |
802 PrintF(out, "\n - function token position = %d", function_token_position()); | 809 PrintF(out, "\n - function token position = %d", function_token_position()); |
803 PrintF(out, "\n - start position = %d", start_position()); | 810 PrintF(out, "\n - start position = %d", start_position()); |
804 PrintF(out, "\n - end position = %d", end_position()); | 811 PrintF(out, "\n - end position = %d", end_position()); |
805 PrintF(out, "\n - is expression = %d", is_expression()); | 812 PrintF(out, "\n - is expression = %d", is_expression()); |
806 PrintF(out, "\n - debug info = "); | 813 PrintF(out, "\n - debug info = "); |
807 debug_info()->ShortPrint(out); | 814 debug_info()->ShortPrint(out); |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1083 } | 1090 } |
1084 } | 1091 } |
1085 PrintF(out, "\n"); | 1092 PrintF(out, "\n"); |
1086 } | 1093 } |
1087 | 1094 |
1088 | 1095 |
1089 #endif // OBJECT_PRINT | 1096 #endif // OBJECT_PRINT |
1090 | 1097 |
1091 | 1098 |
1092 } } // namespace v8::internal | 1099 } } // namespace v8::internal |
OLD | NEW |