OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/objects.h" | 5 #include "src/objects.h" |
6 | 6 |
| 7 #include <memory> |
| 8 |
7 #include "src/disasm.h" | 9 #include "src/disasm.h" |
8 #include "src/disassembler.h" | 10 #include "src/disassembler.h" |
9 #include "src/interpreter/bytecodes.h" | 11 #include "src/interpreter/bytecodes.h" |
10 #include "src/objects-inl.h" | 12 #include "src/objects-inl.h" |
11 #include "src/ostreams.h" | 13 #include "src/ostreams.h" |
12 #include "src/regexp/jsregexp.h" | 14 #include "src/regexp/jsregexp.h" |
13 | 15 |
14 namespace v8 { | 16 namespace v8 { |
15 namespace internal { | 17 namespace internal { |
16 | 18 |
(...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
931 os << "\n - expected_nof_properties = " << expected_nof_properties(); | 933 os << "\n - expected_nof_properties = " << expected_nof_properties(); |
932 os << "\n - ast_node_count = " << ast_node_count(); | 934 os << "\n - ast_node_count = " << ast_node_count(); |
933 os << "\n - instance class name = "; | 935 os << "\n - instance class name = "; |
934 instance_class_name()->Print(os); | 936 instance_class_name()->Print(os); |
935 os << "\n - code = " << Brief(code()); | 937 os << "\n - code = " << Brief(code()); |
936 if (HasSourceCode()) { | 938 if (HasSourceCode()) { |
937 os << "\n - source code = "; | 939 os << "\n - source code = "; |
938 String* source = String::cast(Script::cast(script())->source()); | 940 String* source = String::cast(Script::cast(script())->source()); |
939 int start = start_position(); | 941 int start = start_position(); |
940 int length = end_position() - start; | 942 int length = end_position() - start; |
941 base::SmartArrayPointer<char> source_string = source->ToCString( | 943 std::unique_ptr<char[]> source_string = source->ToCString( |
942 DISALLOW_NULLS, FAST_STRING_TRAVERSAL, start, length, NULL); | 944 DISALLOW_NULLS, FAST_STRING_TRAVERSAL, start, length, NULL); |
943 os << source_string.get(); | 945 os << source_string.get(); |
944 } | 946 } |
945 // Script files are often large, hard to read. | 947 // Script files are often large, hard to read. |
946 // os << "\n - script ="; | 948 // os << "\n - script ="; |
947 // script()->Print(os); | 949 // script()->Print(os); |
948 if (is_named_expression()) { | 950 if (is_named_expression()) { |
949 os << "\n - named expression"; | 951 os << "\n - named expression"; |
950 } else if (is_anonymous_expression()) { | 952 } else if (is_anonymous_expression()) { |
951 os << "\n - anonymous expression"; | 953 os << "\n - anonymous expression"; |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1420 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT | 1422 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT |
1421 Object* transitions = map()->raw_transitions(); | 1423 Object* transitions = map()->raw_transitions(); |
1422 int num_transitions = TransitionArray::NumberOfTransitions(transitions); | 1424 int num_transitions = TransitionArray::NumberOfTransitions(transitions); |
1423 if (num_transitions == 0) return; | 1425 if (num_transitions == 0) return; |
1424 os << "\n - transitions"; | 1426 os << "\n - transitions"; |
1425 TransitionArray::PrintTransitions(os, transitions, false); | 1427 TransitionArray::PrintTransitions(os, transitions, false); |
1426 } | 1428 } |
1427 #endif // defined(DEBUG) || defined(OBJECT_PRINT) | 1429 #endif // defined(DEBUG) || defined(OBJECT_PRINT) |
1428 } // namespace internal | 1430 } // namespace internal |
1429 } // namespace v8 | 1431 } // namespace v8 |
OLD | NEW |