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

Unified Diff: src/compilation-info.cc

Issue 2399833002: Teach Scopes whether they will end up being lazily compiled or not (Closed)
Patch Set: Created 4 years, 2 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
Index: src/compilation-info.cc
diff --git a/src/compilation-info.cc b/src/compilation-info.cc
index 2e0934a2cd0bbe1eac727c6d5c011743d9b57f21..5790a462a8ff0d375d79cc9127d328c39bea8d0e 100644
--- a/src/compilation-info.cc
+++ b/src/compilation-info.cc
@@ -24,13 +24,26 @@ namespace internal {
return parse_info() ? parse_info()->name() : def; \
}
+#define PARSE_INFO_GETTER_AND_SETTER(type, name, def) \
+ type CompilationInfo::name() const { \
+ return parse_info() ? parse_info()->name() : def; \
+ } \
+ \
+ void CompilationInfo::set_##name() { \
+ CHECK(parse_info()); \
+ parse_info()->set_##name(); \
+ }
+
PARSE_INFO_GETTER(Handle<Script>, script)
PARSE_INFO_GETTER(FunctionLiteral*, literal)
PARSE_INFO_GETTER_WITH_DEFAULT(DeclarationScope*, scope, nullptr)
PARSE_INFO_GETTER(Handle<SharedFunctionInfo>, shared_info)
+PARSE_INFO_GETTER_AND_SETTER(bool, is_debug, false)
+PARSE_INFO_GETTER_AND_SETTER(bool, will_serialize, false)
#undef PARSE_INFO_GETTER
#undef PARSE_INFO_GETTER_WITH_DEFAULT
+#undef PARSE_INFO_GETTER_AND_SETTER
bool CompilationInfo::has_shared_info() const {
return parse_info_ && !parse_info_->shared_info().is_null();

Powered by Google App Engine
This is Rietveld 408576698