| 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/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/disasm.h" | 7 #include "src/disasm.h" |
| 8 #include "src/disassembler.h" | 8 #include "src/disassembler.h" |
| 9 #include "src/heap/objects-visiting.h" | 9 #include "src/heap/objects-visiting.h" |
| 10 #include "src/interpreter/bytecodes.h" |
| 10 #include "src/jsregexp.h" | 11 #include "src/jsregexp.h" |
| 11 #include "src/ostreams.h" | 12 #include "src/ostreams.h" |
| 12 | 13 |
| 13 namespace v8 { | 14 namespace v8 { |
| 14 namespace internal { | 15 namespace internal { |
| 15 | 16 |
| 16 #ifdef OBJECT_PRINT | 17 #ifdef OBJECT_PRINT |
| 17 | 18 |
| 18 void Object::Print() { | 19 void Object::Print() { |
| 19 OFStream os(stdout); | 20 OFStream os(stdout); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 break; | 66 break; |
| 66 case FIXED_DOUBLE_ARRAY_TYPE: | 67 case FIXED_DOUBLE_ARRAY_TYPE: |
| 67 FixedDoubleArray::cast(this)->FixedDoubleArrayPrint(os); | 68 FixedDoubleArray::cast(this)->FixedDoubleArrayPrint(os); |
| 68 break; | 69 break; |
| 69 case FIXED_ARRAY_TYPE: | 70 case FIXED_ARRAY_TYPE: |
| 70 FixedArray::cast(this)->FixedArrayPrint(os); | 71 FixedArray::cast(this)->FixedArrayPrint(os); |
| 71 break; | 72 break; |
| 72 case BYTE_ARRAY_TYPE: | 73 case BYTE_ARRAY_TYPE: |
| 73 ByteArray::cast(this)->ByteArrayPrint(os); | 74 ByteArray::cast(this)->ByteArrayPrint(os); |
| 74 break; | 75 break; |
| 76 case BYTECODE_ARRAY_TYPE: |
| 77 BytecodeArray::cast(this)->BytecodeArrayPrint(os); |
| 78 break; |
| 75 case FREE_SPACE_TYPE: | 79 case FREE_SPACE_TYPE: |
| 76 FreeSpace::cast(this)->FreeSpacePrint(os); | 80 FreeSpace::cast(this)->FreeSpacePrint(os); |
| 77 break; | 81 break; |
| 78 | 82 |
| 79 #define PRINT_EXTERNAL_ARRAY(Type, type, TYPE, ctype, size) \ | 83 #define PRINT_EXTERNAL_ARRAY(Type, type, TYPE, ctype, size) \ |
| 80 case EXTERNAL_##TYPE##_ARRAY_TYPE: \ | 84 case EXTERNAL_##TYPE##_ARRAY_TYPE: \ |
| 81 External##Type##Array::cast(this)->External##Type##ArrayPrint(os); \ | 85 External##Type##Array::cast(this)->External##Type##ArrayPrint(os); \ |
| 82 break; | 86 break; |
| 83 | 87 |
| 84 TYPED_ARRAYS(PRINT_EXTERNAL_ARRAY) | 88 TYPED_ARRAYS(PRINT_EXTERNAL_ARRAY) |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 break; | 198 break; |
| 195 } | 199 } |
| 196 } | 200 } |
| 197 | 201 |
| 198 | 202 |
| 199 void ByteArray::ByteArrayPrint(std::ostream& os) { // NOLINT | 203 void ByteArray::ByteArrayPrint(std::ostream& os) { // NOLINT |
| 200 os << "byte array, data starts at " << GetDataStartAddress(); | 204 os << "byte array, data starts at " << GetDataStartAddress(); |
| 201 } | 205 } |
| 202 | 206 |
| 203 | 207 |
| 208 void BytecodeArray::BytecodeArrayPrint(std::ostream& os) { // NOLINT |
| 209 Disassemble(os); |
| 210 } |
| 211 |
| 212 |
| 204 void FreeSpace::FreeSpacePrint(std::ostream& os) { // NOLINT | 213 void FreeSpace::FreeSpacePrint(std::ostream& os) { // NOLINT |
| 205 os << "free space, size " << Size(); | 214 os << "free space, size " << Size(); |
| 206 } | 215 } |
| 207 | 216 |
| 208 | 217 |
| 209 #define EXTERNAL_ARRAY_PRINTER(Type, type, TYPE, ctype, size) \ | 218 #define EXTERNAL_ARRAY_PRINTER(Type, type, TYPE, ctype, size) \ |
| 210 void External##Type##Array::External##Type##ArrayPrint(std::ostream& os) { \ | 219 void External##Type##Array::External##Type##ArrayPrint(std::ostream& os) { \ |
| 211 os << "external " #type " array"; \ | 220 os << "external " #type " array"; \ |
| 212 } | 221 } |
| 213 | 222 |
| (...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 757 // script()->Print(os); | 766 // script()->Print(os); |
| 758 os << "\n - function token position = " << function_token_position(); | 767 os << "\n - function token position = " << function_token_position(); |
| 759 os << "\n - start position = " << start_position(); | 768 os << "\n - start position = " << start_position(); |
| 760 os << "\n - end position = " << end_position(); | 769 os << "\n - end position = " << end_position(); |
| 761 os << "\n - is expression = " << is_expression(); | 770 os << "\n - is expression = " << is_expression(); |
| 762 os << "\n - debug info = " << Brief(debug_info()); | 771 os << "\n - debug info = " << Brief(debug_info()); |
| 763 os << "\n - length = " << length(); | 772 os << "\n - length = " << length(); |
| 764 os << "\n - optimized_code_map = " << Brief(optimized_code_map()); | 773 os << "\n - optimized_code_map = " << Brief(optimized_code_map()); |
| 765 os << "\n - feedback_vector = "; | 774 os << "\n - feedback_vector = "; |
| 766 feedback_vector()->FixedArrayPrint(os); | 775 feedback_vector()->FixedArrayPrint(os); |
| 776 os << "\n - bytecode_array = " << bytecode_array(); |
| 767 os << "\n"; | 777 os << "\n"; |
| 768 } | 778 } |
| 769 | 779 |
| 770 | 780 |
| 771 void JSGlobalProxy::JSGlobalProxyPrint(std::ostream& os) { // NOLINT | 781 void JSGlobalProxy::JSGlobalProxyPrint(std::ostream& os) { // NOLINT |
| 772 os << "global_proxy "; | 782 os << "global_proxy "; |
| 773 JSObjectPrint(os); | 783 JSObjectPrint(os); |
| 774 os << "native context : " << Brief(native_context()); | 784 os << "native context : " << Brief(native_context()); |
| 775 os << "\n"; | 785 os << "\n"; |
| 776 } | 786 } |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1171 } | 1181 } |
| 1172 } | 1182 } |
| 1173 | 1183 |
| 1174 | 1184 |
| 1175 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT | 1185 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT |
| 1176 TransitionArray::PrintTransitions(os, map()->raw_transitions()); | 1186 TransitionArray::PrintTransitions(os, map()->raw_transitions()); |
| 1177 } | 1187 } |
| 1178 #endif // defined(DEBUG) || defined(OBJECT_PRINT) | 1188 #endif // defined(DEBUG) || defined(OBJECT_PRINT) |
| 1179 } // namespace internal | 1189 } // namespace internal |
| 1180 } // namespace v8 | 1190 } // namespace v8 |
| OLD | NEW |