diff options
Diffstat (limited to 'chromium/v8/src/codegen/code-stub-assembler.cc')
-rw-r--r-- | chromium/v8/src/codegen/code-stub-assembler.cc | 58 |
1 files changed, 23 insertions, 35 deletions
diff --git a/chromium/v8/src/codegen/code-stub-assembler.cc b/chromium/v8/src/codegen/code-stub-assembler.cc index e4f35ddcc88..392221e8725 100644 --- a/chromium/v8/src/codegen/code-stub-assembler.cc +++ b/chromium/v8/src/codegen/code-stub-assembler.cc @@ -2608,42 +2608,38 @@ TNode<BoolT> CodeStubAssembler::IsGeneratorFunction( shared_function_info, SharedFunctionInfo::kFlagsOffset, MachineType::Uint32())); - return TNode<BoolT>::UncheckedCast(Word32Or( - Word32Or( - Word32Or( - Word32Equal(function_kind, - Int32Constant(FunctionKind::kAsyncGeneratorFunction)), - Word32Equal( - function_kind, - Int32Constant(FunctionKind::kAsyncConciseGeneratorMethod))), - Word32Equal(function_kind, - Int32Constant(FunctionKind::kGeneratorFunction))), - Word32Equal(function_kind, - Int32Constant(FunctionKind::kConciseGeneratorMethod)))); -} - -TNode<BoolT> CodeStubAssembler::HasPrototypeSlot(TNode<JSFunction> function) { - return TNode<BoolT>::UncheckedCast(IsSetWord32<Map::HasPrototypeSlotBit>( - LoadMapBitField(LoadMap(function)))); -} - -TNode<BoolT> CodeStubAssembler::HasPrototypeProperty(TNode<JSFunction> function, - TNode<Map> map) { + // See IsGeneratorFunction(FunctionKind kind). + return IsInRange(function_kind, FunctionKind::kAsyncConciseGeneratorMethod, + FunctionKind::kConciseGeneratorMethod); +} + +TNode<BoolT> CodeStubAssembler::IsJSFunctionWithPrototypeSlot( + TNode<HeapObject> object) { + // Only JSFunction maps may have HasPrototypeSlotBit set. + return TNode<BoolT>::UncheckedCast( + IsSetWord32<Map::HasPrototypeSlotBit>(LoadMapBitField(LoadMap(object)))); +} + +void CodeStubAssembler::BranchIfHasPrototypeProperty( + TNode<JSFunction> function, TNode<Int32T> function_map_bit_field, + Label* if_true, Label* if_false) { // (has_prototype_slot() && IsConstructor()) || // IsGeneratorFunction(shared()->kind()) uint32_t mask = Map::HasPrototypeSlotBit::kMask | Map::IsConstructorBit::kMask; - return TNode<BoolT>::UncheckedCast( - Word32Or(IsAllSetWord32(LoadMapBitField(map), mask), - IsGeneratorFunction(function))); + + GotoIf(IsAllSetWord32(function_map_bit_field, mask), if_true); + Branch(IsGeneratorFunction(function), if_true, if_false); } void CodeStubAssembler::GotoIfPrototypeRequiresRuntimeLookup( TNode<JSFunction> function, TNode<Map> map, Label* runtime) { // !has_prototype_property() || has_non_instance_prototype() - GotoIfNot(HasPrototypeProperty(function, map), runtime); - GotoIf(IsSetWord32<Map::HasNonInstancePrototypeBit>(LoadMapBitField(map)), - runtime); + TNode<Int32T> map_bit_field = LoadMapBitField(map); + Label next_check(this); + BranchIfHasPrototypeProperty(function, map_bit_field, &next_check, runtime); + BIND(&next_check); + GotoIf(IsSetWord32<Map::HasNonInstancePrototypeBit>(map_bit_field), runtime); } Node* CodeStubAssembler::LoadJSFunctionPrototype(Node* function, @@ -13532,14 +13528,6 @@ TNode<BoolT> CodeStubAssembler::IsElementsKindLessThanOrEqual( return Int32LessThanOrEqual(target_kind, Int32Constant(reference_kind)); } -TNode<BoolT> CodeStubAssembler::IsElementsKindInRange( - TNode<Int32T> target_kind, ElementsKind lower_reference_kind, - ElementsKind higher_reference_kind) { - return Uint32LessThanOrEqual( - Int32Sub(target_kind, Int32Constant(lower_reference_kind)), - Int32Constant(higher_reference_kind - lower_reference_kind)); -} - Node* CodeStubAssembler::IsDebugActive() { Node* is_debug_active = Load( MachineType::Uint8(), |