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

Unified Diff: src/compilation-info.cc

Issue 2316083002: [compiler] Stop delegating CompilationInfo::context. (Closed)
Patch Set: Created 4 years, 3 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 | « src/compilation-info.h ('k') | src/compiler/code-generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compilation-info.cc
diff --git a/src/compilation-info.cc b/src/compilation-info.cc
index 9f210a6785603ff81510f3bf5ef76b58ba947a91..4962f5ec0629d3cc99211efd13c25f84b6286c5a 100644
--- a/src/compilation-info.cc
+++ b/src/compilation-info.cc
@@ -27,8 +27,6 @@ namespace internal {
PARSE_INFO_GETTER(Handle<Script>, script)
PARSE_INFO_GETTER(FunctionLiteral*, literal)
PARSE_INFO_GETTER_WITH_DEFAULT(DeclarationScope*, scope, nullptr)
-PARSE_INFO_GETTER_WITH_DEFAULT(Handle<Context>, context,
- Handle<Context>::null())
PARSE_INFO_GETTER(Handle<SharedFunctionInfo>, shared_info)
#undef PARSE_INFO_GETTER
@@ -178,6 +176,12 @@ bool CompilationInfo::ExpectsJSReceiverAsReceiver() {
return is_sloppy(parse_info()->language_mode()) && !parse_info()->is_native();
}
+bool CompilationInfo::has_context() const { return !closure().is_null(); }
+
+Context* CompilationInfo::context() const {
+ return has_context() ? closure()->context() : nullptr;
+}
+
bool CompilationInfo::has_native_context() const {
return !closure().is_null() && (closure()->native_context() != nullptr);
}
« no previous file with comments | « src/compilation-info.h ('k') | src/compiler/code-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698