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

Unified Diff: src/heap/objects-visiting-inl.h

Issue 1482363002: [heap] JSFunction::context always points to valid context. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/objects-visiting-inl.h
diff --git a/src/heap/objects-visiting-inl.h b/src/heap/objects-visiting-inl.h
index b6c72185c65d54a558396debb1de11c5d3b18320..3be5ce321b1398b4557d2f2c2ab8e5234a6e8610 100644
--- a/src/heap/objects-visiting-inl.h
+++ b/src/heap/objects-visiting-inl.h
@@ -603,11 +603,6 @@ void StaticMarkingVisitor<StaticVisitor>::MarkInlinedFunctionsCode(Heap* heap,
}
-inline static bool HasValidNonBuiltinContext(JSFunction* function) {
- return function->context()->IsContext() && !function->shared()->IsBuiltin();
-}
-
-
inline static bool HasSourceCode(Heap* heap, SharedFunctionInfo* info) {
Object* undefined = heap->undefined_value();
return (info->script() != undefined) &&
@@ -627,11 +622,6 @@ bool StaticMarkingVisitor<StaticVisitor>::IsFlushable(Heap* heap,
return false;
}
- // The function must have a valid context and not be a builtin.
- if (!HasValidNonBuiltinContext(function)) {
- return false;
- }
-
// We do not (yet) flush code for optimized functions.
if (function->code() != shared_info->code()) {
return false;
@@ -689,6 +679,11 @@ bool StaticMarkingVisitor<StaticVisitor>::IsFlushable(
return false;
}
+ // The function must not be a builtin.
+ if (shared_info->IsBuiltin()) {
+ return false;
+ }
+
// If this is a function initialized with %SetCode then the one-to-one
// relation between SharedFunctionInfo and Code is broken.
if (shared_info->dont_flush()) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698