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

Unified Diff: src/type-info.cc

Issue 1017263003: Properly handle non-JSFunction constructors in CanRetainOtherContext (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-filter-contexts.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/type-info.cc
diff --git a/src/type-info.cc b/src/type-info.cc
index 48d516019911b6aaffdba9fe9ce4204f82499dd0..7e1d6011d0e82ad1a26cc47c272567a7c87cc3d0 100644
--- a/src/type-info.cc
+++ b/src/type-info.cc
@@ -438,6 +438,9 @@ bool TypeFeedbackOracle::CanRetainOtherContext(Map* map,
}
constructor = map->GetConstructor();
if (constructor->IsNull()) return false;
+ // If the constructor is not null or a JSFunction, we have to conservatively
+ // assume that it may retain a native context.
+ if (!constructor->IsJSFunction()) return true;
JSFunction* function = JSFunction::cast(constructor);
return CanRetainOtherContext(function, native_context);
}
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-filter-contexts.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698