| 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/interpreter/bytecodes.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 HeapNumber::cast(this)->HeapNumberPrint(os); | 57 HeapNumber::cast(this)->HeapNumberPrint(os); |
| 58 break; | 58 break; |
| 59 case MUTABLE_HEAP_NUMBER_TYPE: | 59 case MUTABLE_HEAP_NUMBER_TYPE: |
| 60 os << "<mutable "; | 60 os << "<mutable "; |
| 61 HeapNumber::cast(this)->HeapNumberPrint(os); | 61 HeapNumber::cast(this)->HeapNumberPrint(os); |
| 62 os << ">"; | 62 os << ">"; |
| 63 break; | 63 break; |
| 64 case FLOAT32X4_TYPE: | 64 case FLOAT32X4_TYPE: |
| 65 Float32x4::cast(this)->Float32x4Print(os); | 65 Float32x4::cast(this)->Float32x4Print(os); |
| 66 break; | 66 break; |
| 67 case INT32X4_TYPE: |
| 68 Int32x4::cast(this)->Int32x4Print(os); |
| 69 break; |
| 70 case BOOL32X4_TYPE: |
| 71 Bool32x4::cast(this)->Bool32x4Print(os); |
| 72 break; |
| 73 case INT16X8_TYPE: |
| 74 Int16x8::cast(this)->Int16x8Print(os); |
| 75 break; |
| 76 case BOOL16X8_TYPE: |
| 77 Bool16x8::cast(this)->Bool16x8Print(os); |
| 78 break; |
| 79 case INT8X16_TYPE: |
| 80 Int16x8::cast(this)->Int16x8Print(os); |
| 81 break; |
| 82 case BOOL8X16_TYPE: |
| 83 Bool16x8::cast(this)->Bool16x8Print(os); |
| 84 break; |
| 67 case FIXED_DOUBLE_ARRAY_TYPE: | 85 case FIXED_DOUBLE_ARRAY_TYPE: |
| 68 FixedDoubleArray::cast(this)->FixedDoubleArrayPrint(os); | 86 FixedDoubleArray::cast(this)->FixedDoubleArrayPrint(os); |
| 69 break; | 87 break; |
| 70 case FIXED_ARRAY_TYPE: | 88 case FIXED_ARRAY_TYPE: |
| 71 FixedArray::cast(this)->FixedArrayPrint(os); | 89 FixedArray::cast(this)->FixedArrayPrint(os); |
| 72 break; | 90 break; |
| 73 case BYTE_ARRAY_TYPE: | 91 case BYTE_ARRAY_TYPE: |
| 74 ByteArray::cast(this)->ByteArrayPrint(os); | 92 ByteArray::cast(this)->ByteArrayPrint(os); |
| 75 break; | 93 break; |
| 76 case BYTECODE_ARRAY_TYPE: | 94 case BYTECODE_ARRAY_TYPE: |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 #undef MAKE_STRUCT_CASE | 203 #undef MAKE_STRUCT_CASE |
| 186 | 204 |
| 187 default: | 205 default: |
| 188 os << "UNKNOWN TYPE " << map()->instance_type(); | 206 os << "UNKNOWN TYPE " << map()->instance_type(); |
| 189 UNREACHABLE(); | 207 UNREACHABLE(); |
| 190 break; | 208 break; |
| 191 } | 209 } |
| 192 } | 210 } |
| 193 | 211 |
| 194 | 212 |
| 213 void Float32x4::Float32x4Print(std::ostream& os) { // NOLINT |
| 214 char arr[100]; |
| 215 Vector<char> buffer(arr, arraysize(arr)); |
| 216 os << std::string(DoubleToCString(get_lane(0), buffer)) << ", " |
| 217 << std::string(DoubleToCString(get_lane(1), buffer)) << ", " |
| 218 << std::string(DoubleToCString(get_lane(2), buffer)) << ", " |
| 219 << std::string(DoubleToCString(get_lane(3), buffer)); |
| 220 } |
| 221 |
| 222 |
| 223 void Int32x4::Int32x4Print(std::ostream& os) { // NOLINT |
| 224 char arr[100]; |
| 225 Vector<char> buffer(arr, arraysize(arr)); |
| 226 os << std::string(IntToCString(get_lane(0), buffer)) << ", " |
| 227 << std::string(IntToCString(get_lane(1), buffer)) << ", " |
| 228 << std::string(IntToCString(get_lane(2), buffer)) << ", " |
| 229 << std::string(IntToCString(get_lane(3), buffer)); |
| 230 } |
| 231 |
| 232 |
| 233 void Bool32x4::Bool32x4Print(std::ostream& os) { // NOLINT |
| 234 os << std::string(get_lane(0) ? "true" : "false") << ", " |
| 235 << std::string(get_lane(1) ? "true" : "false") << ", " |
| 236 << std::string(get_lane(2) ? "true" : "false") << ", " |
| 237 << std::string(get_lane(3) ? "true" : "false"); |
| 238 } |
| 239 |
| 240 |
| 241 void Int16x8::Int16x8Print(std::ostream& os) { // NOLINT |
| 242 char arr[100]; |
| 243 Vector<char> buffer(arr, arraysize(arr)); |
| 244 os << std::string(IntToCString(get_lane(0), buffer)); |
| 245 for (int i = 1; i < 8; i++) { |
| 246 os << ", " << std::string(IntToCString(get_lane(i), buffer)); |
| 247 } |
| 248 } |
| 249 |
| 250 |
| 251 void Bool16x8::Bool16x8Print(std::ostream& os) { // NOLINT |
| 252 char arr[100]; |
| 253 Vector<char> buffer(arr, arraysize(arr)); |
| 254 os << std::string(get_lane(0) ? "true" : "false"); |
| 255 for (int i = 1; i < 8; i++) { |
| 256 os << ", " << std::string(get_lane(i) ? "true" : "false"); |
| 257 } |
| 258 } |
| 259 |
| 260 |
| 261 void Int8x16::Int8x16Print(std::ostream& os) { // NOLINT |
| 262 char arr[100]; |
| 263 Vector<char> buffer(arr, arraysize(arr)); |
| 264 os << std::string(IntToCString(get_lane(0), buffer)); |
| 265 for (int i = 1; i < 16; i++) { |
| 266 os << ", " << std::string(IntToCString(get_lane(i), buffer)); |
| 267 } |
| 268 } |
| 269 |
| 270 |
| 271 void Bool8x16::Bool8x16Print(std::ostream& os) { // NOLINT |
| 272 char arr[100]; |
| 273 Vector<char> buffer(arr, arraysize(arr)); |
| 274 os << std::string(get_lane(0) ? "true" : "false"); |
| 275 for (int i = 1; i < 16; i++) { |
| 276 os << ", " << std::string(get_lane(i) ? "true" : "false"); |
| 277 } |
| 278 } |
| 279 |
| 280 |
| 195 void ByteArray::ByteArrayPrint(std::ostream& os) { // NOLINT | 281 void ByteArray::ByteArrayPrint(std::ostream& os) { // NOLINT |
| 196 os << "byte array, data starts at " << GetDataStartAddress(); | 282 os << "byte array, data starts at " << GetDataStartAddress(); |
| 197 } | 283 } |
| 198 | 284 |
| 199 | 285 |
| 200 void BytecodeArray::BytecodeArrayPrint(std::ostream& os) { // NOLINT | 286 void BytecodeArray::BytecodeArrayPrint(std::ostream& os) { // NOLINT |
| 201 Disassemble(os); | 287 Disassemble(os); |
| 202 } | 288 } |
| 203 | 289 |
| 204 | 290 |
| (...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1204 } | 1290 } |
| 1205 } | 1291 } |
| 1206 | 1292 |
| 1207 | 1293 |
| 1208 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT | 1294 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT |
| 1209 TransitionArray::PrintTransitions(os, map()->raw_transitions()); | 1295 TransitionArray::PrintTransitions(os, map()->raw_transitions()); |
| 1210 } | 1296 } |
| 1211 #endif // defined(DEBUG) || defined(OBJECT_PRINT) | 1297 #endif // defined(DEBUG) || defined(OBJECT_PRINT) |
| 1212 } // namespace internal | 1298 } // namespace internal |
| 1213 } // namespace v8 | 1299 } // namespace v8 |
| OLD | NEW |