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

Unified Diff: src/parsing/parser-base.h

Issue 2372373002: Remove getters that duplicate FunctionKind in SharedFunctionInfo and ParseInfo (Closed)
Patch Set: Remove SharedFunctionInfo::is_resumable and FunctionState stuff 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/parsing/parser.cc ('k') | src/runtime/runtime-classes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser-base.h
diff --git a/src/parsing/parser-base.h b/src/parsing/parser-base.h
index f9af124bc38e2e9a8e35b9f2e6b107ca0b25c114..e2dc125458f43eb049f805349f6f973e316a2642 100644
--- a/src/parsing/parser-base.h
+++ b/src/parsing/parser-base.h
@@ -407,16 +407,12 @@ class ParserBase {
void AddProperty() { expected_property_count_++; }
int expected_property_count() { return expected_property_count_; }
- bool is_generator() const { return IsGeneratorFunction(kind()); }
- bool is_async_function() const { return IsAsyncFunction(kind()); }
- bool is_resumable() const { return is_generator() || is_async_function(); }
-
FunctionKind kind() const { return scope()->function_kind(); }
FunctionState* outer() const { return outer_function_state_; }
void set_generator_object_variable(typename Types::Variable* variable) {
DCHECK(variable != NULL);
- DCHECK(is_resumable());
+ DCHECK(IsResumableFunction(kind()));
generator_object_variable_ = variable;
}
typename Types::Variable* generator_object_variable() const {
@@ -425,7 +421,7 @@ class ParserBase {
void set_promise_variable(typename Types::Variable* variable) {
DCHECK(variable != NULL);
- DCHECK(is_async_function());
+ DCHECK(IsAsyncFunction(kind()));
promise_variable_ = variable;
}
typename Types::Variable* promise_variable() const {
@@ -940,11 +936,15 @@ class ParserBase {
LanguageMode old = scope()->language_mode();
impl()->SetLanguageMode(scope(), old > mode ? old : mode);
}
- bool is_generator() const { return function_state_->is_generator(); }
+ bool is_generator() const {
+ return IsGeneratorFunction(function_state_->kind());
+ }
bool is_async_function() const {
- return function_state_->is_async_function();
+ return IsAsyncFunction(function_state_->kind());
+ }
+ bool is_resumable() const {
+ return IsResumableFunction(function_state_->kind());
}
- bool is_resumable() const { return function_state_->is_resumable(); }
// Report syntax errors.
void ReportMessage(MessageTemplate::Template message) {
« no previous file with comments | « src/parsing/parser.cc ('k') | src/runtime/runtime-classes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698