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

Unified Diff: src/code-stubs.cc

Issue 2390043003: Remove unnecessary duplication of FunctionKind enums in CompilerHints (Closed)
Patch Set: Fix arm64 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
« no previous file with comments | « src/builtins/arm64/builtins-arm64.cc ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs.cc
diff --git a/src/code-stubs.cc b/src/code-stubs.cc
index de18700d5ee7856c0b302fdb7ef516f99e088fda..c5b154772ea62cd375aa9baa13f88a60920216d3 100644
--- a/src/code-stubs.cc
+++ b/src/code-stubs.cc
@@ -5055,33 +5055,38 @@ compiler::Node* FastNewClosureStub::Generate(CodeStubAssembler* assembler,
load_map(assembler);
Variable map_index(assembler, MachineType::PointerRepresentation());
+ STATIC_ASSERT(FunctionKind::kNormalFunction == 0);
Node* is_not_normal = assembler->Word32And(
compiler_hints,
- assembler->Int32Constant(SharedFunctionInfo::kFunctionKindMaskBits));
+ assembler->Int32Constant(SharedFunctionInfo::kAllFunctionKindBitsMask));
assembler->GotoUnless(is_not_normal, &if_normal);
Node* is_generator = assembler->Word32And(
compiler_hints,
- assembler->Int32Constant(1 << SharedFunctionInfo::kIsGeneratorBit));
+ assembler->Int32Constant(FunctionKind::kGeneratorFunction
+ << SharedFunctionInfo::kFunctionKindShift));
assembler->GotoIf(is_generator, &if_generator);
Node* is_async = assembler->Word32And(
compiler_hints,
- assembler->Int32Constant(1 << SharedFunctionInfo::kIsAsyncFunctionBit));
+ assembler->Int32Constant(FunctionKind::kAsyncFunction
+ << SharedFunctionInfo::kFunctionKindShift));
assembler->GotoIf(is_async, &if_async);
Node* is_class_constructor = assembler->Word32And(
compiler_hints,
- assembler->Int32Constant(SharedFunctionInfo::kClassConstructorBits));
+ assembler->Int32Constant(FunctionKind::kClassConstructor
+ << SharedFunctionInfo::kFunctionKindShift));
assembler->GotoIf(is_class_constructor, &if_class_constructor);
if (FLAG_debug_code) {
// Function must be a function without a prototype.
assembler->Assert(assembler->Word32And(
- compiler_hints, assembler->Int32Constant(
- SharedFunctionInfo::kAccessorFunctionBits |
- (1 << SharedFunctionInfo::kIsArrowBit) |
- (1 << SharedFunctionInfo::kIsConciseMethodBit))));
+ compiler_hints,
+ assembler->Int32Constant((FunctionKind::kAccessorFunction |
+ FunctionKind::kArrowFunction |
+ FunctionKind::kConciseMethod)
+ << SharedFunctionInfo::kFunctionKindShift)));
}
assembler->Goto(&if_function_without_prototype);
« no previous file with comments | « src/builtins/arm64/builtins-arm64.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698