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 <iomanip> | 7 #include <iomanip> |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "src/disasm.h" | 10 #include "src/disasm.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 break; | 142 break; |
143 | 143 |
144 case FILLER_TYPE: | 144 case FILLER_TYPE: |
145 os << "filler"; | 145 os << "filler"; |
146 break; | 146 break; |
147 case JS_OBJECT_TYPE: // fall through | 147 case JS_OBJECT_TYPE: // fall through |
148 case JS_API_OBJECT_TYPE: | 148 case JS_API_OBJECT_TYPE: |
149 case JS_SPECIAL_API_OBJECT_TYPE: | 149 case JS_SPECIAL_API_OBJECT_TYPE: |
150 case JS_CONTEXT_EXTENSION_OBJECT_TYPE: | 150 case JS_CONTEXT_EXTENSION_OBJECT_TYPE: |
151 case JS_GENERATOR_OBJECT_TYPE: | 151 case JS_GENERATOR_OBJECT_TYPE: |
| 152 case JS_PROMISE_TYPE: |
152 case JS_ARGUMENTS_TYPE: | 153 case JS_ARGUMENTS_TYPE: |
153 case JS_ERROR_TYPE: | 154 case JS_ERROR_TYPE: |
154 JSObject::cast(this)->JSObjectPrint(os); | 155 JSObject::cast(this)->JSObjectPrint(os); |
155 break; | 156 break; |
156 case JS_PROMISE_TYPE: | |
157 JSPromise::cast(this)->JSPromisePrint(os); | |
158 break; | |
159 case JS_ARRAY_TYPE: | 157 case JS_ARRAY_TYPE: |
160 JSArray::cast(this)->JSArrayPrint(os); | 158 JSArray::cast(this)->JSArrayPrint(os); |
161 break; | 159 break; |
162 case JS_REGEXP_TYPE: | 160 case JS_REGEXP_TYPE: |
163 JSRegExp::cast(this)->JSRegExpPrint(os); | 161 JSRegExp::cast(this)->JSRegExpPrint(os); |
164 break; | 162 break; |
165 case ODDBALL_TYPE: | 163 case ODDBALL_TYPE: |
166 Oddball::cast(this)->to_string()->Print(os); | 164 Oddball::cast(this)->to_string()->Print(os); |
167 break; | 165 break; |
168 case JS_BOUND_FUNCTION_TYPE: | 166 case JS_BOUND_FUNCTION_TYPE: |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 JSObjectPrintHeader(os, this, nullptr); | 534 JSObjectPrintHeader(os, this, nullptr); |
537 JSObjectPrintBody(os, this); | 535 JSObjectPrintBody(os, this); |
538 } | 536 } |
539 | 537 |
540 void JSArray::JSArrayPrint(std::ostream& os) { // NOLINT | 538 void JSArray::JSArrayPrint(std::ostream& os) { // NOLINT |
541 JSObjectPrintHeader(os, this, "JSArray"); | 539 JSObjectPrintHeader(os, this, "JSArray"); |
542 os << "\n - length = " << Brief(this->length()); | 540 os << "\n - length = " << Brief(this->length()); |
543 JSObjectPrintBody(os, this); | 541 JSObjectPrintBody(os, this); |
544 } | 542 } |
545 | 543 |
546 void JSPromise::JSPromisePrint(std::ostream& os) { // NOLINT | |
547 JSObjectPrintHeader(os, this, "JSPromise"); | |
548 os << "\n - status = " << JSPromise::Status(status()); | |
549 os << "\n - result = " << Brief(result()); | |
550 os << "\n - deferreds = " << Brief(deferred()); | |
551 os << "\n - fulfill_reactions = " << Brief(fulfill_reactions()); | |
552 os << "\n - reject_reactions = " << Brief(reject_reactions()); | |
553 } | |
554 | 544 |
555 void JSRegExp::JSRegExpPrint(std::ostream& os) { // NOLINT | 545 void JSRegExp::JSRegExpPrint(std::ostream& os) { // NOLINT |
556 JSObjectPrintHeader(os, this, "JSRegExp"); | 546 JSObjectPrintHeader(os, this, "JSRegExp"); |
557 os << "\n - data = " << Brief(data()); | 547 os << "\n - data = " << Brief(data()); |
558 JSObjectPrintBody(os, this); | 548 JSObjectPrintBody(os, this); |
559 } | 549 } |
560 | 550 |
561 | 551 |
562 void Symbol::SymbolPrint(std::ostream& os) { // NOLINT | 552 void Symbol::SymbolPrint(std::ostream& os) { // NOLINT |
563 HeapObject::PrintHeader(os, "Symbol"); | 553 HeapObject::PrintHeader(os, "Symbol"); |
(...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1678 printf("Not a transition array\n"); | 1668 printf("Not a transition array\n"); |
1679 } else { | 1669 } else { |
1680 reinterpret_cast<i::TransitionArray*>(object)->Print(); | 1670 reinterpret_cast<i::TransitionArray*>(object)->Print(); |
1681 } | 1671 } |
1682 } | 1672 } |
1683 | 1673 |
1684 extern void _v8_internal_Print_StackTrace() { | 1674 extern void _v8_internal_Print_StackTrace() { |
1685 i::Isolate* isolate = i::Isolate::Current(); | 1675 i::Isolate* isolate = i::Isolate::Current(); |
1686 isolate->PrintStack(stdout); | 1676 isolate->PrintStack(stdout); |
1687 } | 1677 } |
OLD | NEW |