| 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 "src/disasm.h" | 7 #include "src/disasm.h" |
| 8 #include "src/disassembler.h" | 8 #include "src/disassembler.h" |
| 9 #include "src/interpreter/bytecodes.h" | 9 #include "src/interpreter/bytecodes.h" |
| 10 #include "src/objects-inl.h" | 10 #include "src/objects-inl.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 break; | 112 break; |
| 113 case JS_ARRAY_TYPE: | 113 case JS_ARRAY_TYPE: |
| 114 JSArray::cast(this)->JSArrayPrint(os); | 114 JSArray::cast(this)->JSArrayPrint(os); |
| 115 break; | 115 break; |
| 116 case JS_REGEXP_TYPE: | 116 case JS_REGEXP_TYPE: |
| 117 JSRegExp::cast(this)->JSRegExpPrint(os); | 117 JSRegExp::cast(this)->JSRegExpPrint(os); |
| 118 break; | 118 break; |
| 119 case ODDBALL_TYPE: | 119 case ODDBALL_TYPE: |
| 120 Oddball::cast(this)->to_string()->Print(os); | 120 Oddball::cast(this)->to_string()->Print(os); |
| 121 break; | 121 break; |
| 122 case JS_MODULE_TYPE: | |
| 123 JSModule::cast(this)->JSModulePrint(os); | |
| 124 break; | |
| 125 case JS_BOUND_FUNCTION_TYPE: | 122 case JS_BOUND_FUNCTION_TYPE: |
| 126 JSBoundFunction::cast(this)->JSBoundFunctionPrint(os); | 123 JSBoundFunction::cast(this)->JSBoundFunctionPrint(os); |
| 127 break; | 124 break; |
| 128 case JS_FUNCTION_TYPE: | 125 case JS_FUNCTION_TYPE: |
| 129 JSFunction::cast(this)->JSFunctionPrint(os); | 126 JSFunction::cast(this)->JSFunctionPrint(os); |
| 130 break; | 127 break; |
| 131 case JS_GLOBAL_PROXY_TYPE: | 128 case JS_GLOBAL_PROXY_TYPE: |
| 132 JSGlobalProxy::cast(this)->JSGlobalProxyPrint(os); | 129 JSGlobalProxy::cast(this)->JSGlobalProxyPrint(os); |
| 133 break; | 130 break; |
| 134 case JS_GLOBAL_OBJECT_TYPE: | 131 case JS_GLOBAL_OBJECT_TYPE: |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 } | 445 } |
| 449 | 446 |
| 450 | 447 |
| 451 void JSRegExp::JSRegExpPrint(std::ostream& os) { // NOLINT | 448 void JSRegExp::JSRegExpPrint(std::ostream& os) { // NOLINT |
| 452 JSObjectPrintHeader(os, this, "JSRegExp"); | 449 JSObjectPrintHeader(os, this, "JSRegExp"); |
| 453 os << "\n - data = " << Brief(data()); | 450 os << "\n - data = " << Brief(data()); |
| 454 JSObjectPrintBody(os, this); | 451 JSObjectPrintBody(os, this); |
| 455 } | 452 } |
| 456 | 453 |
| 457 | 454 |
| 458 void JSModule::JSModulePrint(std::ostream& os) { // NOLINT | |
| 459 JSObjectPrintHeader(os, this, "JSModule"); | |
| 460 os << "\n - context = " << Brief(context()); | |
| 461 os << " - scope_info = " << Brief(scope_info()); | |
| 462 JSObjectPrintBody(os, this); | |
| 463 } | |
| 464 | |
| 465 | |
| 466 void Symbol::SymbolPrint(std::ostream& os) { // NOLINT | 455 void Symbol::SymbolPrint(std::ostream& os) { // NOLINT |
| 467 HeapObject::PrintHeader(os, "Symbol"); | 456 HeapObject::PrintHeader(os, "Symbol"); |
| 468 os << "\n - hash: " << Hash(); | 457 os << "\n - hash: " << Hash(); |
| 469 os << "\n - name: " << Brief(name()); | 458 os << "\n - name: " << Brief(name()); |
| 470 if (name()->IsUndefined(GetIsolate())) { | 459 if (name()->IsUndefined(GetIsolate())) { |
| 471 os << " (" << PrivateSymbolToName() << ")"; | 460 os << " (" << PrivateSymbolToName() << ")"; |
| 472 } | 461 } |
| 473 os << "\n - private: " << is_private(); | 462 os << "\n - private: " << is_private(); |
| 474 os << "\n"; | 463 os << "\n"; |
| 475 } | 464 } |
| (...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1390 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT | 1379 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT |
| 1391 Object* transitions = map()->raw_transitions(); | 1380 Object* transitions = map()->raw_transitions(); |
| 1392 int num_transitions = TransitionArray::NumberOfTransitions(transitions); | 1381 int num_transitions = TransitionArray::NumberOfTransitions(transitions); |
| 1393 if (num_transitions == 0) return; | 1382 if (num_transitions == 0) return; |
| 1394 os << "\n - transitions"; | 1383 os << "\n - transitions"; |
| 1395 TransitionArray::PrintTransitions(os, transitions, false); | 1384 TransitionArray::PrintTransitions(os, transitions, false); |
| 1396 } | 1385 } |
| 1397 #endif // defined(DEBUG) || defined(OBJECT_PRINT) | 1386 #endif // defined(DEBUG) || defined(OBJECT_PRINT) |
| 1398 } // namespace internal | 1387 } // namespace internal |
| 1399 } // namespace v8 | 1388 } // namespace v8 |
| OLD | NEW |