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

Unified Diff: src/objects.cc

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/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 158a1650429d7a4a37b2e977bc6a0f2b729ae4f1..671411d96da8cfe1893d6f753a9d4a6edb41a66c 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -12902,7 +12902,8 @@ bool CanSubclassHaveInobjectProperties(InstanceType instance_type) {
void JSFunction::EnsureHasInitialMap(Handle<JSFunction> function) {
- DCHECK(function->IsConstructor() || function->shared()->is_resumable());
+ DCHECK(function->IsConstructor() ||
+ IsResumableFunction(function->shared()->kind()));
if (function->has_initial_map()) return;
Isolate* isolate = function->GetIsolate();
@@ -12913,7 +12914,7 @@ void JSFunction::EnsureHasInitialMap(Handle<JSFunction> function) {
// First create a new map with the size and number of in-object properties
// suggested by the function.
InstanceType instance_type;
- if (function->shared()->is_resumable()) {
+ if (IsResumableFunction(function->shared()->kind())) {
instance_type = JS_GENERATOR_OBJECT_TYPE;
} else {
instance_type = JS_OBJECT_TYPE;
@@ -13144,17 +13145,18 @@ Handle<String> JSFunction::ToString(Handle<JSFunction> function) {
}
IncrementalStringBuilder builder(isolate);
- if (!shared_info->is_arrow()) {
- if (shared_info->is_concise_method()) {
- if (shared_info->is_generator()) {
+ FunctionKind kind = shared_info->kind();
+ if (!IsArrowFunction(kind)) {
+ if (IsConciseMethod(kind)) {
+ if (IsGeneratorFunction(kind)) {
builder.AppendCharacter('*');
- } else if (shared_info->is_async()) {
+ } else if (IsAsyncFunction(kind)) {
builder.AppendCString("async ");
}
} else {
- if (shared_info->is_generator()) {
+ if (IsGeneratorFunction(kind)) {
builder.AppendCString("function* ");
- } else if (shared_info->is_async()) {
+ } else if (IsAsyncFunction(kind)) {
builder.AppendCString("async function ");
} else {
builder.AppendCString("function ");
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698