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/jsregexp.h" | 10 #include "src/jsregexp.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 case FIXED_ARRAY_TYPE: | 69 case FIXED_ARRAY_TYPE: |
70 FixedArray::cast(this)->FixedArrayPrint(os); | 70 FixedArray::cast(this)->FixedArrayPrint(os); |
71 break; | 71 break; |
72 case BYTE_ARRAY_TYPE: | 72 case BYTE_ARRAY_TYPE: |
73 ByteArray::cast(this)->ByteArrayPrint(os); | 73 ByteArray::cast(this)->ByteArrayPrint(os); |
74 break; | 74 break; |
75 case FREE_SPACE_TYPE: | 75 case FREE_SPACE_TYPE: |
76 FreeSpace::cast(this)->FreeSpacePrint(os); | 76 FreeSpace::cast(this)->FreeSpacePrint(os); |
77 break; | 77 break; |
78 | 78 |
79 #define PRINT_EXTERNAL_ARRAY(Type, type, TYPE, ctype, size) \ | |
80 case EXTERNAL_##TYPE##_ARRAY_TYPE: \ | |
81 External##Type##Array::cast(this)->External##Type##ArrayPrint(os); \ | |
82 break; | |
83 | |
84 TYPED_ARRAYS(PRINT_EXTERNAL_ARRAY) | |
85 #undef PRINT_EXTERNAL_ARRAY | |
86 | |
87 #define PRINT_FIXED_TYPED_ARRAY(Type, type, TYPE, ctype, size) \ | 79 #define PRINT_FIXED_TYPED_ARRAY(Type, type, TYPE, ctype, size) \ |
88 case Fixed##Type##Array::kInstanceType: \ | 80 case Fixed##Type##Array::kInstanceType: \ |
89 Fixed##Type##Array::cast(this)->FixedTypedArrayPrint(os); \ | 81 Fixed##Type##Array::cast(this)->FixedTypedArrayPrint(os); \ |
90 break; | 82 break; |
91 | 83 |
92 TYPED_ARRAYS(PRINT_FIXED_TYPED_ARRAY) | 84 TYPED_ARRAYS(PRINT_FIXED_TYPED_ARRAY) |
93 #undef PRINT_FIXED_TYPED_ARRAY | 85 #undef PRINT_FIXED_TYPED_ARRAY |
94 | 86 |
95 case FILLER_TYPE: | 87 case FILLER_TYPE: |
96 os << "filler"; | 88 os << "filler"; |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 void ByteArray::ByteArrayPrint(std::ostream& os) { // NOLINT | 191 void ByteArray::ByteArrayPrint(std::ostream& os) { // NOLINT |
200 os << "byte array, data starts at " << GetDataStartAddress(); | 192 os << "byte array, data starts at " << GetDataStartAddress(); |
201 } | 193 } |
202 | 194 |
203 | 195 |
204 void FreeSpace::FreeSpacePrint(std::ostream& os) { // NOLINT | 196 void FreeSpace::FreeSpacePrint(std::ostream& os) { // NOLINT |
205 os << "free space, size " << Size(); | 197 os << "free space, size " << Size(); |
206 } | 198 } |
207 | 199 |
208 | 200 |
209 #define EXTERNAL_ARRAY_PRINTER(Type, type, TYPE, ctype, size) \ | |
210 void External##Type##Array::External##Type##ArrayPrint(std::ostream& os) { \ | |
211 os << "external " #type " array"; \ | |
212 } | |
213 | |
214 TYPED_ARRAYS(EXTERNAL_ARRAY_PRINTER) | |
215 | |
216 #undef EXTERNAL_ARRAY_PRINTER | |
217 | |
218 | |
219 template <class Traits> | 201 template <class Traits> |
220 void FixedTypedArray<Traits>::FixedTypedArrayPrint( | 202 void FixedTypedArray<Traits>::FixedTypedArrayPrint( |
221 std::ostream& os) { // NOLINT | 203 std::ostream& os) { // NOLINT |
222 os << "fixed " << Traits::Designator(); | 204 os << "fixed " << Traits::Designator(); |
223 } | 205 } |
224 | 206 |
225 | 207 |
226 void JSObject::PrintProperties(std::ostream& os) { // NOLINT | 208 void JSObject::PrintProperties(std::ostream& os) { // NOLINT |
227 if (HasFastProperties()) { | 209 if (HasFastProperties()) { |
228 DescriptorArray* descs = map()->instance_descriptors(); | 210 DescriptorArray* descs = map()->instance_descriptors(); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 break; | 287 break; |
306 } | 288 } |
307 | 289 |
308 | 290 |
309 #define PRINT_ELEMENTS(Kind, Type) \ | 291 #define PRINT_ELEMENTS(Kind, Type) \ |
310 case Kind: { \ | 292 case Kind: { \ |
311 DoPrintElements<Type>(os, elements()); \ | 293 DoPrintElements<Type>(os, elements()); \ |
312 break; \ | 294 break; \ |
313 } | 295 } |
314 | 296 |
315 PRINT_ELEMENTS(EXTERNAL_UINT8_CLAMPED_ELEMENTS, ExternalUint8ClampedArray) | |
316 PRINT_ELEMENTS(EXTERNAL_INT8_ELEMENTS, ExternalInt8Array) | |
317 PRINT_ELEMENTS(EXTERNAL_UINT8_ELEMENTS, | |
318 ExternalUint8Array) | |
319 PRINT_ELEMENTS(EXTERNAL_INT16_ELEMENTS, ExternalInt16Array) | |
320 PRINT_ELEMENTS(EXTERNAL_UINT16_ELEMENTS, | |
321 ExternalUint16Array) | |
322 PRINT_ELEMENTS(EXTERNAL_INT32_ELEMENTS, ExternalInt32Array) | |
323 PRINT_ELEMENTS(EXTERNAL_UINT32_ELEMENTS, | |
324 ExternalUint32Array) | |
325 PRINT_ELEMENTS(EXTERNAL_FLOAT32_ELEMENTS, ExternalFloat32Array) | |
326 PRINT_ELEMENTS(EXTERNAL_FLOAT64_ELEMENTS, ExternalFloat64Array) | |
327 | |
328 PRINT_ELEMENTS(UINT8_ELEMENTS, FixedUint8Array) | 297 PRINT_ELEMENTS(UINT8_ELEMENTS, FixedUint8Array) |
329 PRINT_ELEMENTS(UINT8_CLAMPED_ELEMENTS, FixedUint8ClampedArray) | 298 PRINT_ELEMENTS(UINT8_CLAMPED_ELEMENTS, FixedUint8ClampedArray) |
330 PRINT_ELEMENTS(INT8_ELEMENTS, FixedInt8Array) | 299 PRINT_ELEMENTS(INT8_ELEMENTS, FixedInt8Array) |
331 PRINT_ELEMENTS(UINT16_ELEMENTS, FixedUint16Array) | 300 PRINT_ELEMENTS(UINT16_ELEMENTS, FixedUint16Array) |
332 PRINT_ELEMENTS(INT16_ELEMENTS, FixedInt16Array) | 301 PRINT_ELEMENTS(INT16_ELEMENTS, FixedInt16Array) |
333 PRINT_ELEMENTS(UINT32_ELEMENTS, FixedUint32Array) | 302 PRINT_ELEMENTS(UINT32_ELEMENTS, FixedUint32Array) |
334 PRINT_ELEMENTS(INT32_ELEMENTS, FixedInt32Array) | 303 PRINT_ELEMENTS(INT32_ELEMENTS, FixedInt32Array) |
335 PRINT_ELEMENTS(FLOAT32_ELEMENTS, FixedFloat32Array) | 304 PRINT_ELEMENTS(FLOAT32_ELEMENTS, FixedFloat32Array) |
336 PRINT_ELEMENTS(FLOAT64_ELEMENTS, FixedFloat64Array) | 305 PRINT_ELEMENTS(FLOAT64_ELEMENTS, FixedFloat64Array) |
337 | 306 |
(...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1223 } | 1192 } |
1224 } | 1193 } |
1225 | 1194 |
1226 | 1195 |
1227 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT | 1196 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT |
1228 TransitionArray::PrintTransitions(os, map()->raw_transitions()); | 1197 TransitionArray::PrintTransitions(os, map()->raw_transitions()); |
1229 } | 1198 } |
1230 #endif // defined(DEBUG) || defined(OBJECT_PRINT) | 1199 #endif // defined(DEBUG) || defined(OBJECT_PRINT) |
1231 } // namespace internal | 1200 } // namespace internal |
1232 } // namespace v8 | 1201 } // namespace v8 |
OLD | NEW |