From d14ed12e56b1dbb708c442d8a25f4e02307834f3 Mon Sep 17 00:00:00 2001 From: Mythri A Date: Wed, 10 Apr 2019 15:58:17 +0100 Subject: [PATCH] [ic] Remove the check for fast prototypes in LoadIC_Uninitialized When handling load named properties (without feedback vectors) we used to miss to runtimes if the prototypes aren't set. This was because we wanted to give the prototype a chance to become fast, since most prototypes start in slow mode but move to fast after the initial setup. Though this check is not really useful when we don't have feedback vectors, and once feedback vectors are allocated we will turn the prototypes fast anyway. Bug: v8:8394, v8:8860 Change-Id: Ib2247e5e921f6375bda65310560ac832fd0339bf Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1561316 Commit-Queue: Mythri Alle Reviewed-by: Toon Verwaest Cr-Commit-Position: refs/heads/master@{#60818} --- src/ic/accessor-assembler.cc | 39 +----------------------------------- src/ic/accessor-assembler.h | 4 ---- 2 files changed, 1 insertion(+), 42 deletions(-) diff --git a/src/ic/accessor-assembler.cc b/src/ic/accessor-assembler.cc index 055b6bde88..978f594b17 100644 --- a/src/ic/accessor-assembler.cc +++ b/src/ic/accessor-assembler.cc @@ -2616,46 +2616,15 @@ void AccessorAssembler::LoadIC_Noninlined(const LoadICParameters* p, } } -// TODO(8860): This check is only required so we can make prototypes fast on -// the first load. This is not really useful when there is no feedback vector -// and may not be important when lazily allocating feedback vectors. Once lazy -// allocation of feedback vectors has landed try to eliminate this check. -void AccessorAssembler::BranchIfPrototypeShouldbeFast(Node* receiver_map, - Label* prototype_not_fast, - Label* prototype_fast) { - VARIABLE(var_map, MachineRepresentation::kTagged); - var_map.Bind(receiver_map); - Label loop_body(this, &var_map); - Goto(&loop_body); - - BIND(&loop_body); - { - Node* map = var_map.value(); - Node* prototype = LoadMapPrototype(map); - GotoIf(IsNull(prototype), prototype_fast); - TNode proto_info = - LoadMapPrototypeInfo(receiver_map, prototype_not_fast); - GotoIf(IsNull(prototype), prototype_not_fast); - TNode flags = - LoadObjectField(proto_info, PrototypeInfo::kBitFieldOffset); - GotoIf(Word32Equal(flags, Uint32Constant(0)), prototype_not_fast); - - Node* prototype_map = LoadMap(prototype); - var_map.Bind(prototype_map); - Goto(&loop_body); - } -} - void AccessorAssembler::LoadIC_Uninitialized(const LoadICParameters* p) { Label miss(this, Label::kDeferred), - check_if_fast_prototype(this, Label::kDeferred), check_function_prototype(this); Node* receiver = p->receiver; GotoIf(TaggedIsSmi(receiver), &miss); Node* receiver_map = LoadMap(receiver); Node* instance_type = LoadMapInstanceType(receiver_map); - GotoIf(IsUndefined(p->vector), &check_if_fast_prototype); + GotoIf(IsUndefined(p->vector), &check_function_prototype); // Optimistically write the state transition to the vector. StoreFeedbackVectorSlot(p->vector, p->slot, LoadRoot(RootIndex::kpremonomorphic_symbol), @@ -2664,12 +2633,6 @@ void AccessorAssembler::LoadIC_Uninitialized(const LoadICParameters* p) { kTaggedSize, SMI_PARAMETERS); Goto(&check_function_prototype); - BIND(&check_if_fast_prototype); - { - BranchIfPrototypeShouldbeFast(receiver_map, &miss, - &check_function_prototype); - } - BIND(&check_function_prototype); { // Special case for Function.prototype load, because it's very common diff --git a/src/ic/accessor-assembler.h b/src/ic/accessor-assembler.h index 180d9fc43a..c3f78d6986 100644 --- a/src/ic/accessor-assembler.h +++ b/src/ic/accessor-assembler.h @@ -296,10 +296,6 @@ class V8_EXPORT_PRIVATE AccessorAssembler : public CodeStubAssembler { Representation representation, Node* value, Label* bailout); - void BranchIfPrototypeShouldbeFast(Node* receiver_map, - Label* prototype_not_fast, - Label* prototype_fast); - // Extends properties backing store by JSObject::kFieldsAdded elements, // returns updated properties backing store. Node* ExtendPropertiesBackingStore(Node* object, Node* index);