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