Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/objects-printer.cc

Issue 1552473002: Revert of [runtime] Introduce dedicated JSBoundFunction to represent bound functions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@FunctionConstructor
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/objects-inl.h ('k') | src/profiler/heap-snapshot-generator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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;
116 case JS_FUNCTION_TYPE: 113 case JS_FUNCTION_TYPE:
117 JSFunction::cast(this)->JSFunctionPrint(os); 114 JSFunction::cast(this)->JSFunctionPrint(os);
118 break; 115 break;
119 case JS_GLOBAL_PROXY_TYPE: 116 case JS_GLOBAL_PROXY_TYPE:
120 JSGlobalProxy::cast(this)->JSGlobalProxyPrint(os); 117 JSGlobalProxy::cast(this)->JSGlobalProxyPrint(os);
121 break; 118 break;
122 case JS_GLOBAL_OBJECT_TYPE: 119 case JS_GLOBAL_OBJECT_TYPE:
123 JSGlobalObject::cast(this)->JSGlobalObjectPrint(os); 120 JSGlobalObject::cast(this)->JSGlobalObjectPrint(os);
124 break; 121 break;
125 case JS_VALUE_TYPE: 122 case JS_VALUE_TYPE:
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 void JSDataView::JSDataViewPrint(std::ostream& os) { // NOLINT 837 void JSDataView::JSDataViewPrint(std::ostream& os) { // NOLINT
841 JSObjectPrintHeader(os, this, "JSDataView"); 838 JSObjectPrintHeader(os, this, "JSDataView");
842 os << "\n - buffer =" << Brief(buffer()); 839 os << "\n - buffer =" << Brief(buffer());
843 os << "\n - byte_offset = " << Brief(byte_offset()); 840 os << "\n - byte_offset = " << Brief(byte_offset());
844 os << "\n - byte_length = " << Brief(byte_length()); 841 os << "\n - byte_length = " << Brief(byte_length());
845 if (WasNeutered()) os << " - neutered\n"; 842 if (WasNeutered()) os << " - neutered\n";
846 JSObjectPrintBody(os, this, !WasNeutered()); 843 JSObjectPrintBody(os, this, !WasNeutered());
847 } 844 }
848 845
849 846
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
859 void JSFunction::JSFunctionPrint(std::ostream& os) { // NOLINT 847 void JSFunction::JSFunctionPrint(std::ostream& os) { // NOLINT
860 JSObjectPrintHeader(os, this, "Function"); 848 JSObjectPrintHeader(os, this, "Function");
861 os << "\n - initial_map = "; 849 os << "\n - initial_map = ";
862 if (has_initial_map()) os << Brief(initial_map()); 850 if (has_initial_map()) os << Brief(initial_map());
863 os << "\n - shared_info = " << Brief(shared()); 851 os << "\n - shared_info = " << Brief(shared());
864 os << "\n - name = " << Brief(shared()->name()); 852 os << "\n - name = " << Brief(shared()->name());
865 if (shared()->is_generator()) { 853 if (shared()->is_generator()) {
866 os << "\n - generator"; 854 os << "\n - generator";
867 } 855 }
868 os << "\n - context = " << Brief(context()); 856 os << "\n - context = " << Brief(context());
869 os << "\n - literals = " << Brief(literals()); 857 if (shared()->bound()) {
858 os << "\n - bindings = " << Brief(function_bindings());
859 } else {
860 os << "\n - literals = " << Brief(literals());
861 }
870 os << "\n - code = " << Brief(code()); 862 os << "\n - code = " << Brief(code());
871 JSObjectPrintBody(os, this); 863 JSObjectPrintBody(os, this);
872 } 864 }
873 865
874 866
875 void SharedFunctionInfo::SharedFunctionInfoPrint(std::ostream& os) { // NOLINT 867 void SharedFunctionInfo::SharedFunctionInfoPrint(std::ostream& os) { // NOLINT
876 HeapObject::PrintHeader(os, "SharedFunctionInfo"); 868 HeapObject::PrintHeader(os, "SharedFunctionInfo");
877 os << " - name: " << Brief(name()); 869 os << " - name: " << Brief(name());
878 os << "\n - expected_nof_properties: " << expected_nof_properties(); 870 os << "\n - expected_nof_properties: " << expected_nof_properties();
879 os << "\n - ast_node_count: " << ast_node_count(); 871 os << "\n - ast_node_count: " << ast_node_count();
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
1322 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT 1314 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT
1323 Object* transitions = map()->raw_transitions(); 1315 Object* transitions = map()->raw_transitions();
1324 int num_transitions = TransitionArray::NumberOfTransitions(transitions); 1316 int num_transitions = TransitionArray::NumberOfTransitions(transitions);
1325 if (num_transitions == 0) return; 1317 if (num_transitions == 0) return;
1326 os << "\n - transitions"; 1318 os << "\n - transitions";
1327 TransitionArray::PrintTransitions(os, transitions, false); 1319 TransitionArray::PrintTransitions(os, transitions, false);
1328 } 1320 }
1329 #endif // defined(DEBUG) || defined(OBJECT_PRINT) 1321 #endif // defined(DEBUG) || defined(OBJECT_PRINT)
1330 } // namespace internal 1322 } // namespace internal
1331 } // namespace v8 1323 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | src/profiler/heap-snapshot-generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698