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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 break; | 110 break; |
111 case JS_ARRAY_TYPE: | 111 case JS_ARRAY_TYPE: |
112 JSArray::cast(this)->JSArrayPrint(os); | 112 JSArray::cast(this)->JSArrayPrint(os); |
113 break; | 113 break; |
114 case JS_REGEXP_TYPE: | 114 case JS_REGEXP_TYPE: |
115 JSRegExp::cast(this)->JSRegExpPrint(os); | 115 JSRegExp::cast(this)->JSRegExpPrint(os); |
116 break; | 116 break; |
117 case ODDBALL_TYPE: | 117 case ODDBALL_TYPE: |
118 Oddball::cast(this)->to_string()->Print(os); | 118 Oddball::cast(this)->to_string()->Print(os); |
119 break; | 119 break; |
120 case JS_MODULE_TYPE: | |
121 JSModule::cast(this)->JSModulePrint(os); | |
122 break; | |
123 case JS_BOUND_FUNCTION_TYPE: | 120 case JS_BOUND_FUNCTION_TYPE: |
124 JSBoundFunction::cast(this)->JSBoundFunctionPrint(os); | 121 JSBoundFunction::cast(this)->JSBoundFunctionPrint(os); |
125 break; | 122 break; |
126 case JS_FUNCTION_TYPE: | 123 case JS_FUNCTION_TYPE: |
127 JSFunction::cast(this)->JSFunctionPrint(os); | 124 JSFunction::cast(this)->JSFunctionPrint(os); |
128 break; | 125 break; |
129 case JS_GLOBAL_PROXY_TYPE: | 126 case JS_GLOBAL_PROXY_TYPE: |
130 JSGlobalProxy::cast(this)->JSGlobalProxyPrint(os); | 127 JSGlobalProxy::cast(this)->JSGlobalProxyPrint(os); |
131 break; | 128 break; |
132 case JS_GLOBAL_OBJECT_TYPE: | 129 case JS_GLOBAL_OBJECT_TYPE: |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 } | 443 } |
447 | 444 |
448 | 445 |
449 void JSRegExp::JSRegExpPrint(std::ostream& os) { // NOLINT | 446 void JSRegExp::JSRegExpPrint(std::ostream& os) { // NOLINT |
450 JSObjectPrintHeader(os, this, "JSRegExp"); | 447 JSObjectPrintHeader(os, this, "JSRegExp"); |
451 os << "\n - data = " << Brief(data()); | 448 os << "\n - data = " << Brief(data()); |
452 JSObjectPrintBody(os, this); | 449 JSObjectPrintBody(os, this); |
453 } | 450 } |
454 | 451 |
455 | 452 |
456 void JSModule::JSModulePrint(std::ostream& os) { // NOLINT | |
457 JSObjectPrintHeader(os, this, "JSModule"); | |
458 os << "\n - context = " << Brief(context()); | |
459 os << " - scope_info = " << Brief(scope_info()); | |
460 JSObjectPrintBody(os, this); | |
461 } | |
462 | |
463 | |
464 void Symbol::SymbolPrint(std::ostream& os) { // NOLINT | 453 void Symbol::SymbolPrint(std::ostream& os) { // NOLINT |
465 HeapObject::PrintHeader(os, "Symbol"); | 454 HeapObject::PrintHeader(os, "Symbol"); |
466 os << "\n - hash: " << Hash(); | 455 os << "\n - hash: " << Hash(); |
467 os << "\n - name: " << Brief(name()); | 456 os << "\n - name: " << Brief(name()); |
468 if (name()->IsUndefined(GetIsolate())) { | 457 if (name()->IsUndefined(GetIsolate())) { |
469 os << " (" << PrivateSymbolToName() << ")"; | 458 os << " (" << PrivateSymbolToName() << ")"; |
470 } | 459 } |
471 os << "\n - private: " << is_private(); | 460 os << "\n - private: " << is_private(); |
472 os << "\n"; | 461 os << "\n"; |
473 } | 462 } |
(...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1344 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT | 1333 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT |
1345 Object* transitions = map()->raw_transitions(); | 1334 Object* transitions = map()->raw_transitions(); |
1346 int num_transitions = TransitionArray::NumberOfTransitions(transitions); | 1335 int num_transitions = TransitionArray::NumberOfTransitions(transitions); |
1347 if (num_transitions == 0) return; | 1336 if (num_transitions == 0) return; |
1348 os << "\n - transitions"; | 1337 os << "\n - transitions"; |
1349 TransitionArray::PrintTransitions(os, transitions, false); | 1338 TransitionArray::PrintTransitions(os, transitions, false); |
1350 } | 1339 } |
1351 #endif // defined(DEBUG) || defined(OBJECT_PRINT) | 1340 #endif // defined(DEBUG) || defined(OBJECT_PRINT) |
1352 } // namespace internal | 1341 } // namespace internal |
1353 } // namespace v8 | 1342 } // namespace v8 |
OLD | NEW |