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

Unified Diff: src/objects-printer.cc

Issue 1542963002: [runtime] Introduce dedicated JSBoundFunction to represent bound functions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@FunctionConstructor
Patch Set: arm port. Created 5 years 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 side-by-side diff with in-line comments
Download patch
Index: src/objects-printer.cc
diff --git a/src/objects-printer.cc b/src/objects-printer.cc
index 27dbdd1d623d3748270bd035c43603b3e406ab98..db716505deabb8ed8fe66e9e855ababe06935e22 100644
--- a/src/objects-printer.cc
+++ b/src/objects-printer.cc
@@ -110,6 +110,9 @@ void HeapObject::HeapObjectPrint(std::ostream& os) { // NOLINT
case JS_MODULE_TYPE:
JSModule::cast(this)->JSModulePrint(os);
break;
+ case JS_BOUND_FUNCTION_TYPE:
+ JSBoundFunction::cast(this)->JSBoundFunctionPrint(os);
+ break;
case JS_FUNCTION_TYPE:
JSFunction::cast(this)->JSFunctionPrint(os);
break;
@@ -844,6 +847,15 @@ void JSDataView::JSDataViewPrint(std::ostream& os) { // NOLINT
}
+void JSBoundFunction::JSBoundFunctionPrint(std::ostream& os) { // NOLINT
+ JSObjectPrintHeader(os, this, "JSBoundFunction");
+ os << "\n - bound_target_function = " << Brief(bound_target_function());
+ os << "\n - bound_this = " << Brief(bound_this());
+ os << "\n - bound_arguments = " << Brief(bound_arguments());
+ JSObjectPrintBody(os, this);
+}
+
+
void JSFunction::JSFunctionPrint(std::ostream& os) { // NOLINT
JSObjectPrintHeader(os, this, "Function");
os << "\n - initial_map = ";
@@ -854,11 +866,7 @@ void JSFunction::JSFunctionPrint(std::ostream& os) { // NOLINT
os << "\n - generator";
}
os << "\n - context = " << Brief(context());
- if (shared()->bound()) {
- os << "\n - bindings = " << Brief(function_bindings());
- } else {
- os << "\n - literals = " << Brief(literals());
- }
+ os << "\n - literals = " << Brief(literals());
os << "\n - code = " << Brief(code());
JSObjectPrintBody(os, this);
}

Powered by Google App Engine
This is Rietveld 408576698