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

Unified Diff: src/objects-debug.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-body-descriptors-inl.h ('k') | src/objects-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-debug.cc
diff --git a/src/objects-debug.cc b/src/objects-debug.cc
index a05d1e703626b125635e9ce15ea935164545023d..1115a5e4164d3ae47ea1cc30645fa784ca0224d3 100644
--- a/src/objects-debug.cc
+++ b/src/objects-debug.cc
@@ -114,6 +114,9 @@ void HeapObject::HeapObjectVerify() {
case JS_DATE_TYPE:
JSDate::cast(this)->JSDateVerify();
break;
+ case JS_BOUND_FUNCTION_TYPE:
+ JSBoundFunction::cast(this)->JSBoundFunctionVerify();
+ break;
case JS_FUNCTION_TYPE:
JSFunction::cast(this)->JSFunctionVerify();
break;
@@ -542,6 +545,21 @@ void SlicedString::SlicedStringVerify() {
}
+void JSBoundFunction::JSBoundFunctionVerify() {
+ CHECK(IsJSBoundFunction());
+ VerifyObjectField(kLengthOffset);
+ VerifyObjectField(kNameOffset);
+ VerifyObjectField(kBoundThisOffset);
+ VerifyObjectField(kBoundTargetFunctionOffset);
+ VerifyObjectField(kBoundArgumentsOffset);
+ VerifyObjectField(kCreationContextOffset);
+ CHECK(bound_target_function()->IsCallable());
+ CHECK(creation_context()->IsNativeContext());
+ CHECK(IsCallable());
+ CHECK_EQ(IsConstructor(), bound_target_function()->IsConstructor());
+}
+
+
void JSFunction::JSFunctionVerify() {
CHECK(IsJSFunction());
VerifyObjectField(kPrototypeOrInitialMapOffset);
« no previous file with comments | « src/objects-body-descriptors-inl.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698