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