| 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 break; | 103 break; |
| 104 case JS_REGEXP_TYPE: | 104 case JS_REGEXP_TYPE: |
| 105 JSRegExp::cast(this)->JSRegExpPrint(os); | 105 JSRegExp::cast(this)->JSRegExpPrint(os); |
| 106 break; | 106 break; |
| 107 case ODDBALL_TYPE: | 107 case ODDBALL_TYPE: |
| 108 Oddball::cast(this)->to_string()->Print(os); | 108 Oddball::cast(this)->to_string()->Print(os); |
| 109 break; | 109 break; |
| 110 case JS_MODULE_TYPE: | 110 case JS_MODULE_TYPE: |
| 111 JSModule::cast(this)->JSModulePrint(os); | 111 JSModule::cast(this)->JSModulePrint(os); |
| 112 break; | 112 break; |
| 113 case JS_BOUND_FUNCTION_TYPE: |
| 114 JSBoundFunction::cast(this)->JSBoundFunctionPrint(os); |
| 115 break; |
| 113 case JS_FUNCTION_TYPE: | 116 case JS_FUNCTION_TYPE: |
| 114 JSFunction::cast(this)->JSFunctionPrint(os); | 117 JSFunction::cast(this)->JSFunctionPrint(os); |
| 115 break; | 118 break; |
| 116 case JS_GLOBAL_PROXY_TYPE: | 119 case JS_GLOBAL_PROXY_TYPE: |
| 117 JSGlobalProxy::cast(this)->JSGlobalProxyPrint(os); | 120 JSGlobalProxy::cast(this)->JSGlobalProxyPrint(os); |
| 118 break; | 121 break; |
| 119 case JS_GLOBAL_OBJECT_TYPE: | 122 case JS_GLOBAL_OBJECT_TYPE: |
| 120 JSGlobalObject::cast(this)->JSGlobalObjectPrint(os); | 123 JSGlobalObject::cast(this)->JSGlobalObjectPrint(os); |
| 121 break; | 124 break; |
| 122 case JS_VALUE_TYPE: | 125 case JS_VALUE_TYPE: |
| (...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 837 void JSDataView::JSDataViewPrint(std::ostream& os) { // NOLINT | 840 void JSDataView::JSDataViewPrint(std::ostream& os) { // NOLINT |
| 838 JSObjectPrintHeader(os, this, "JSDataView"); | 841 JSObjectPrintHeader(os, this, "JSDataView"); |
| 839 os << "\n - buffer =" << Brief(buffer()); | 842 os << "\n - buffer =" << Brief(buffer()); |
| 840 os << "\n - byte_offset = " << Brief(byte_offset()); | 843 os << "\n - byte_offset = " << Brief(byte_offset()); |
| 841 os << "\n - byte_length = " << Brief(byte_length()); | 844 os << "\n - byte_length = " << Brief(byte_length()); |
| 842 if (WasNeutered()) os << " - neutered\n"; | 845 if (WasNeutered()) os << " - neutered\n"; |
| 843 JSObjectPrintBody(os, this, !WasNeutered()); | 846 JSObjectPrintBody(os, this, !WasNeutered()); |
| 844 } | 847 } |
| 845 | 848 |
| 846 | 849 |
| 850 void JSBoundFunction::JSBoundFunctionPrint(std::ostream& os) { // NOLINT |
| 851 JSObjectPrintHeader(os, this, "JSBoundFunction"); |
| 852 os << "\n - bound_target_function = " << Brief(bound_target_function()); |
| 853 os << "\n - bound_this = " << Brief(bound_this()); |
| 854 os << "\n - bound_arguments = " << Brief(bound_arguments()); |
| 855 JSObjectPrintBody(os, this); |
| 856 } |
| 857 |
| 858 |
| 847 void JSFunction::JSFunctionPrint(std::ostream& os) { // NOLINT | 859 void JSFunction::JSFunctionPrint(std::ostream& os) { // NOLINT |
| 848 JSObjectPrintHeader(os, this, "Function"); | 860 JSObjectPrintHeader(os, this, "Function"); |
| 849 os << "\n - initial_map = "; | 861 os << "\n - initial_map = "; |
| 850 if (has_initial_map()) os << Brief(initial_map()); | 862 if (has_initial_map()) os << Brief(initial_map()); |
| 851 os << "\n - shared_info = " << Brief(shared()); | 863 os << "\n - shared_info = " << Brief(shared()); |
| 852 os << "\n - name = " << Brief(shared()->name()); | 864 os << "\n - name = " << Brief(shared()->name()); |
| 853 if (shared()->is_generator()) { | 865 if (shared()->is_generator()) { |
| 854 os << "\n - generator"; | 866 os << "\n - generator"; |
| 855 } | 867 } |
| 856 os << "\n - context = " << Brief(context()); | 868 os << "\n - context = " << Brief(context()); |
| 857 if (shared()->bound()) { | 869 os << "\n - literals = " << Brief(literals()); |
| 858 os << "\n - bindings = " << Brief(function_bindings()); | |
| 859 } else { | |
| 860 os << "\n - literals = " << Brief(literals()); | |
| 861 } | |
| 862 os << "\n - code = " << Brief(code()); | 870 os << "\n - code = " << Brief(code()); |
| 863 JSObjectPrintBody(os, this); | 871 JSObjectPrintBody(os, this); |
| 864 } | 872 } |
| 865 | 873 |
| 866 | 874 |
| 867 void SharedFunctionInfo::SharedFunctionInfoPrint(std::ostream& os) { // NOLINT | 875 void SharedFunctionInfo::SharedFunctionInfoPrint(std::ostream& os) { // NOLINT |
| 868 HeapObject::PrintHeader(os, "SharedFunctionInfo"); | 876 HeapObject::PrintHeader(os, "SharedFunctionInfo"); |
| 869 os << " - name: " << Brief(name()); | 877 os << " - name: " << Brief(name()); |
| 870 os << "\n - expected_nof_properties: " << expected_nof_properties(); | 878 os << "\n - expected_nof_properties: " << expected_nof_properties(); |
| 871 os << "\n - ast_node_count: " << ast_node_count(); | 879 os << "\n - ast_node_count: " << ast_node_count(); |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1314 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT | 1322 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT |
| 1315 Object* transitions = map()->raw_transitions(); | 1323 Object* transitions = map()->raw_transitions(); |
| 1316 int num_transitions = TransitionArray::NumberOfTransitions(transitions); | 1324 int num_transitions = TransitionArray::NumberOfTransitions(transitions); |
| 1317 if (num_transitions == 0) return; | 1325 if (num_transitions == 0) return; |
| 1318 os << "\n - transitions"; | 1326 os << "\n - transitions"; |
| 1319 TransitionArray::PrintTransitions(os, transitions, false); | 1327 TransitionArray::PrintTransitions(os, transitions, false); |
| 1320 } | 1328 } |
| 1321 #endif // defined(DEBUG) || defined(OBJECT_PRINT) | 1329 #endif // defined(DEBUG) || defined(OBJECT_PRINT) |
| 1322 } // namespace internal | 1330 } // namespace internal |
| 1323 } // namespace v8 | 1331 } // namespace v8 |
| OLD | NEW |