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

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: [arm64] Poke does not preserve flags with --debug-code. 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
« no previous file with comments | « src/objects-inl.h ('k') | src/profiler/heap-snapshot-generator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« 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