summaryrefslogtreecommitdiff
path: root/deps/v8/src/ic
diff options
context:
space:
mode:
authorMyles Borins <mylesborins@google.com>2017-08-01 11:36:44 -0500
committerMyles Borins <mylesborins@google.com>2017-08-01 15:23:15 -0500
commit0a66b223e149a841669bfad5598e4254589730cb (patch)
tree5ec050f7f78aafbf5b1e0e50d639fb843141e162 /deps/v8/src/ic
parent1782b3836ba58ef0da6b687f2bb970c0bd8199ad (diff)
downloadandroid-node-v8-0a66b223e149a841669bfad5598e4254589730cb.tar.gz
android-node-v8-0a66b223e149a841669bfad5598e4254589730cb.tar.bz2
android-node-v8-0a66b223e149a841669bfad5598e4254589730cb.zip
deps: update V8 to 6.0.286.52
PR-URL: https://github.com/nodejs/node/pull/14004 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'deps/v8/src/ic')
-rw-r--r--deps/v8/src/ic/accessor-assembler.cc94
-rw-r--r--deps/v8/src/ic/accessor-assembler.h2
-rw-r--r--deps/v8/src/ic/arm/handler-compiler-arm.cc5
-rw-r--r--deps/v8/src/ic/arm64/handler-compiler-arm64.cc5
-rw-r--r--deps/v8/src/ic/ia32/handler-compiler-ia32.cc5
-rw-r--r--deps/v8/src/ic/ic.cc114
-rw-r--r--deps/v8/src/ic/ic.h17
-rw-r--r--deps/v8/src/ic/keyed-store-generic.cc10
-rw-r--r--deps/v8/src/ic/mips/OWNERS7
-rw-r--r--deps/v8/src/ic/mips/handler-compiler-mips.cc5
-rw-r--r--deps/v8/src/ic/mips64/OWNERS7
-rw-r--r--deps/v8/src/ic/mips64/handler-compiler-mips64.cc48
-rw-r--r--deps/v8/src/ic/ppc/handler-compiler-ppc.cc5
-rw-r--r--deps/v8/src/ic/s390/handler-compiler-s390.cc5
-rw-r--r--deps/v8/src/ic/stub-cache.cc38
-rw-r--r--deps/v8/src/ic/stub-cache.h3
-rw-r--r--deps/v8/src/ic/x64/handler-compiler-x64.cc5
17 files changed, 171 insertions, 204 deletions
diff --git a/deps/v8/src/ic/accessor-assembler.cc b/deps/v8/src/ic/accessor-assembler.cc
index eb3971c54f..6508169558 100644
--- a/deps/v8/src/ic/accessor-assembler.cc
+++ b/deps/v8/src/ic/accessor-assembler.cc
@@ -984,15 +984,7 @@ void AccessorAssembler::HandleStoreFieldAndReturn(Node* handler_word,
BIND(&if_out_of_object);
{
if (transition_to_field) {
- Label storage_extended(this);
- GotoIfNot(IsSetWord<StoreHandler::ExtendStorageBits>(handler_word),
- &storage_extended);
- Comment("[ Extend storage");
- ExtendPropertiesBackingStore(holder);
- Comment("] Extend storage");
- Goto(&storage_extended);
-
- BIND(&storage_extended);
+ ExtendPropertiesBackingStore(holder, handler_word);
}
StoreNamedField(handler_word, holder, false, representation, prepared_value,
@@ -1053,7 +1045,12 @@ Node* AccessorAssembler::PrepareValueForStore(Node* handler_word, Node* holder,
return value;
}
-void AccessorAssembler::ExtendPropertiesBackingStore(Node* object) {
+void AccessorAssembler::ExtendPropertiesBackingStore(Node* object,
+ Node* handler_word) {
+ Label done(this);
+ GotoIfNot(IsSetWord<StoreHandler::ExtendStorageBits>(handler_word), &done);
+ Comment("[ Extend storage");
+
ParameterMode mode = OptimalParameterMode();
Node* properties = LoadProperties(object);
@@ -1061,6 +1058,14 @@ void AccessorAssembler::ExtendPropertiesBackingStore(Node* object) {
? LoadAndUntagFixedArrayBaseLength(properties)
: LoadFixedArrayBaseLength(properties);
+ // Previous property deletion could have left behind unused backing store
+ // capacity even for a map that think it doesn't have any unused fields.
+ // Perform a bounds check to see if we actually have to grow the array.
+ Node* offset = DecodeWord<StoreHandler::FieldOffsetBits>(handler_word);
+ Node* size = ElementOffsetFromIndex(length, FAST_ELEMENTS, mode,
+ FixedArray::kHeaderSize);
+ GotoIf(UintPtrLessThan(offset, size), &done);
+
Node* delta = IntPtrOrSmiConstant(JSObject::kFieldsAdded, mode);
Node* new_capacity = IntPtrOrSmiAdd(length, delta, mode);
@@ -1088,6 +1093,10 @@ void AccessorAssembler::ExtendPropertiesBackingStore(Node* object) {
SKIP_WRITE_BARRIER, mode);
StoreObjectField(object, JSObject::kPropertiesOffset, new_properties);
+ Comment("] Extend storage");
+ Goto(&done);
+
+ BIND(&done);
}
void AccessorAssembler::StoreNamedField(Node* handler_word, Node* object,
@@ -1512,7 +1521,10 @@ void AccessorAssembler::GenericPropertyLoad(Node* receiver, Node* receiver_map,
TryProbeStubCache(isolate()->load_stub_cache(), receiver, key,
&found_handler, &var_handler, &stub_cache_miss);
BIND(&found_handler);
- { HandleLoadICHandlerCase(p, var_handler.value(), slow, &direct_exit); }
+ {
+ HandleLoadICHandlerCase(p, var_handler.value(), &stub_cache_miss,
+ &direct_exit);
+ }
BIND(&stub_cache_miss);
{
@@ -1865,33 +1877,19 @@ void AccessorAssembler::LoadIC_Uninitialized(const LoadICParameters* p) {
LoadRoot(Heap::kpremonomorphic_symbolRootIndex),
SKIP_WRITE_BARRIER, 0, SMI_PARAMETERS);
- Label not_function_prototype(this);
- GotoIf(Word32NotEqual(instance_type, Int32Constant(JS_FUNCTION_TYPE)),
- &not_function_prototype);
- GotoIfNot(WordEqual(p->name, LoadRoot(Heap::kprototype_stringRootIndex)),
- &not_function_prototype);
- Node* bit_field = LoadMapBitField(receiver_map);
- GotoIf(IsSetWord32(bit_field, 1 << Map::kHasNonInstancePrototype),
- &not_function_prototype);
- // Function.prototype load.
- {
- // TODO(jkummerow): Unify with LoadIC_FunctionPrototype builtin
- // (when we have a shared CSA base class for all builtins).
- Node* proto_or_map =
- LoadObjectField(receiver, JSFunction::kPrototypeOrInitialMapOffset);
- GotoIf(IsTheHole(proto_or_map), &miss);
-
- VARIABLE(var_result, MachineRepresentation::kTagged, proto_or_map);
- Label done(this, &var_result);
- GotoIfNot(IsMap(proto_or_map), &done);
-
- var_result.Bind(LoadMapPrototype(proto_or_map));
- Goto(&done);
-
- BIND(&done);
- Return(var_result.value());
+ {
+ // Special case for Function.prototype load, because it's very common
+ // for ICs that are only executed once (MyFunc.prototype.foo = ...).
+ Label not_function_prototype(this);
+ GotoIf(Word32NotEqual(instance_type, Int32Constant(JS_FUNCTION_TYPE)),
+ &not_function_prototype);
+ GotoIfNot(IsPrototypeString(p->name), &not_function_prototype);
+ Node* bit_field = LoadMapBitField(receiver_map);
+ GotoIf(IsSetWord32(bit_field, 1 << Map::kHasNonInstancePrototype),
+ &not_function_prototype);
+ Return(LoadJSFunctionPrototype(receiver, &miss));
+ BIND(&not_function_prototype);
}
- BIND(&not_function_prototype);
GenericPropertyLoad(receiver, receiver_map, instance_type, p->name, p, &miss,
kDontUseStubCache);
@@ -2090,15 +2088,15 @@ void AccessorAssembler::KeyedLoadICGeneric(const LoadICParameters* p) {
VARIABLE(var_index, MachineType::PointerRepresentation());
VARIABLE(var_unique, MachineRepresentation::kTagged);
var_unique.Bind(p->name); // Dummy initialization.
- Label if_index(this), if_unique_name(this), slow(this);
+ Label if_index(this), if_unique_name(this), if_notunique(this), slow(this);
Node* receiver = p->receiver;
GotoIf(TaggedIsSmi(receiver), &slow);
Node* receiver_map = LoadMap(receiver);
Node* instance_type = LoadMapInstanceType(receiver_map);
- TryToName(p->name, &if_index, &var_index, &if_unique_name, &var_unique,
- &slow);
+ TryToName(p->name, &if_index, &var_index, &if_unique_name, &var_unique, &slow,
+ &if_notunique);
BIND(&if_index);
{
@@ -2112,6 +2110,22 @@ void AccessorAssembler::KeyedLoadICGeneric(const LoadICParameters* p) {
var_unique.value(), p, &slow);
}
+ BIND(&if_notunique);
+ {
+ if (FLAG_internalize_on_the_fly) {
+ Label not_in_string_table(this);
+ TryInternalizeString(p->name, &if_index, &var_index, &if_unique_name,
+ &var_unique, &not_in_string_table, &slow);
+
+ BIND(&not_in_string_table);
+ // If the string was not found in the string table, then no object can
+ // have a property with that name.
+ Return(UndefinedConstant());
+ } else {
+ Goto(&slow);
+ }
+ }
+
BIND(&slow);
{
Comment("KeyedLoadGeneric_slow");
diff --git a/deps/v8/src/ic/accessor-assembler.h b/deps/v8/src/ic/accessor-assembler.h
index f2cafdb128..5644fa8ae8 100644
--- a/deps/v8/src/ic/accessor-assembler.h
+++ b/deps/v8/src/ic/accessor-assembler.h
@@ -193,7 +193,7 @@ class AccessorAssembler : public CodeStubAssembler {
Node* value, Label* bailout);
// Extends properties backing store by JSObject::kFieldsAdded elements.
- void ExtendPropertiesBackingStore(Node* object);
+ void ExtendPropertiesBackingStore(Node* object, Node* handler_word);
void StoreNamedField(Node* handler_word, Node* object, bool is_inobject,
Representation representation, Node* value,
diff --git a/deps/v8/src/ic/arm/handler-compiler-arm.cc b/deps/v8/src/ic/arm/handler-compiler-arm.cc
index dd99a21219..317a95146f 100644
--- a/deps/v8/src/ic/arm/handler-compiler-arm.cc
+++ b/deps/v8/src/ic/arm/handler-compiler-arm.cc
@@ -221,10 +221,8 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall(
Isolate* isolate = masm->isolate();
Handle<CallHandlerInfo> api_call_info = optimization.api_call_info();
- bool call_data_undefined = false;
// Put call data in place.
if (api_call_info->data()->IsUndefined(isolate)) {
- call_data_undefined = true;
__ LoadRoot(data, Heap::kUndefinedValueRootIndex);
} else {
if (optimization.is_constant_call()) {
@@ -249,8 +247,7 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall(
__ mov(api_function_address, Operand(ref));
// Jump to stub.
- CallApiCallbackStub stub(isolate, is_store, call_data_undefined,
- !optimization.is_constant_call());
+ CallApiCallbackStub stub(isolate, is_store, !optimization.is_constant_call());
__ TailCallStub(&stub);
}
diff --git a/deps/v8/src/ic/arm64/handler-compiler-arm64.cc b/deps/v8/src/ic/arm64/handler-compiler-arm64.cc
index 68bd393cab..db6dc639a1 100644
--- a/deps/v8/src/ic/arm64/handler-compiler-arm64.cc
+++ b/deps/v8/src/ic/arm64/handler-compiler-arm64.cc
@@ -156,10 +156,8 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall(
Isolate* isolate = masm->isolate();
Handle<CallHandlerInfo> api_call_info = optimization.api_call_info();
- bool call_data_undefined = false;
// Put call data in place.
if (api_call_info->data()->IsUndefined(isolate)) {
- call_data_undefined = true;
__ LoadRoot(data, Heap::kUndefinedValueRootIndex);
} else {
if (optimization.is_constant_call()) {
@@ -184,8 +182,7 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall(
__ Mov(api_function_address, ref);
// Jump to stub.
- CallApiCallbackStub stub(isolate, is_store, call_data_undefined,
- !optimization.is_constant_call());
+ CallApiCallbackStub stub(isolate, is_store, !optimization.is_constant_call());
__ TailCallStub(&stub);
}
diff --git a/deps/v8/src/ic/ia32/handler-compiler-ia32.cc b/deps/v8/src/ic/ia32/handler-compiler-ia32.cc
index 324dc10d03..2cfa49b15b 100644
--- a/deps/v8/src/ic/ia32/handler-compiler-ia32.cc
+++ b/deps/v8/src/ic/ia32/handler-compiler-ia32.cc
@@ -161,10 +161,8 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall(
Isolate* isolate = masm->isolate();
Handle<CallHandlerInfo> api_call_info = optimization.api_call_info();
- bool call_data_undefined = false;
// Put call data in place.
if (api_call_info->data()->IsUndefined(isolate)) {
- call_data_undefined = true;
__ mov(data, Immediate(isolate->factory()->undefined_value()));
} else {
if (optimization.is_constant_call()) {
@@ -182,8 +180,7 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall(
__ mov(api_function_address, Immediate(function_address));
// Jump to stub.
- CallApiCallbackStub stub(isolate, is_store, call_data_undefined,
- !optimization.is_constant_call());
+ CallApiCallbackStub stub(isolate, is_store, !optimization.is_constant_call());
__ TailCallStub(&stub);
}
diff --git a/deps/v8/src/ic/ic.cc b/deps/v8/src/ic/ic.cc
index ca3f70df2a..5dca55ed3e 100644
--- a/deps/v8/src/ic/ic.cc
+++ b/deps/v8/src/ic/ic.cc
@@ -549,7 +549,7 @@ void IC::ConfigureVectorState(Handle<Name> name, Handle<Map> map,
OnFeedbackChanged(isolate(), GetHostFunction());
}
-void IC::ConfigureVectorState(Handle<Name> name, MapHandleList* maps,
+void IC::ConfigureVectorState(Handle<Name> name, MapHandles const& maps,
List<Handle<Object>>* handlers) {
DCHECK(!IsLoadGlobalIC());
// Non-keyed ICs don't track the name explicitly.
@@ -636,16 +636,15 @@ MaybeHandle<Object> LoadGlobalIC::Load(Handle<Name> name) {
return LoadIC::Load(global, name);
}
-static bool AddOneReceiverMapIfMissing(MapHandleList* receiver_maps,
+static bool AddOneReceiverMapIfMissing(MapHandles* receiver_maps,
Handle<Map> new_receiver_map) {
DCHECK(!new_receiver_map.is_null());
- for (int current = 0; current < receiver_maps->length(); ++current) {
- if (!receiver_maps->at(current).is_null() &&
- receiver_maps->at(current).is_identical_to(new_receiver_map)) {
+ for (Handle<Map> map : *receiver_maps) {
+ if (!map.is_null() && map.is_identical_to(new_receiver_map)) {
return false;
}
}
- receiver_maps->Add(new_receiver_map);
+ receiver_maps->push_back(new_receiver_map);
return true;
}
@@ -653,11 +652,11 @@ bool IC::UpdatePolymorphicIC(Handle<Name> name, Handle<Object> handler) {
DCHECK(IsHandler(*handler));
if (is_keyed() && state() != RECOMPUTE_HANDLER) return false;
Handle<Map> map = receiver_map();
- MapHandleList maps;
+ MapHandles maps;
List<Handle<Object>> handlers;
TargetMaps(&maps);
- int number_of_maps = maps.length();
+ int number_of_maps = static_cast<int>(maps.size());
int deprecated_maps = 0;
int handler_to_overwrite = -1;
@@ -684,7 +683,9 @@ bool IC::UpdatePolymorphicIC(Handle<Name> name, Handle<Object> handler) {
if (number_of_maps == 0 && state() != MONOMORPHIC && state() != POLYMORPHIC) {
return false;
}
- if (!nexus()->FindHandlers(&handlers, maps.length())) return false;
+ if (!nexus()->FindHandlers(&handlers, static_cast<int>(maps.size()))) {
+ return false;
+ }
number_of_valid_maps++;
if (number_of_valid_maps > 1 && is_keyed()) return false;
@@ -694,14 +695,14 @@ bool IC::UpdatePolymorphicIC(Handle<Name> name, Handle<Object> handler) {
if (handler_to_overwrite >= 0) {
handlers.Set(handler_to_overwrite, handler);
if (!map.is_identical_to(maps.at(handler_to_overwrite))) {
- maps.Set(handler_to_overwrite, map);
+ maps[handler_to_overwrite] = map;
}
} else {
- maps.Add(map);
+ maps.push_back(map);
handlers.Add(handler);
}
- ConfigureVectorState(name, &maps, &handlers);
+ ConfigureVectorState(name, maps, &handlers);
}
return true;
@@ -714,11 +715,11 @@ void IC::UpdateMonomorphicIC(Handle<Object> handler, Handle<Name> name) {
void IC::CopyICToMegamorphicCache(Handle<Name> name) {
- MapHandleList maps;
+ MapHandles maps;
List<Handle<Object>> handlers;
TargetMaps(&maps);
- if (!nexus()->FindHandlers(&handlers, maps.length())) return;
- for (int i = 0; i < maps.length(); i++) {
+ if (!nexus()->FindHandlers(&handlers, static_cast<int>(maps.size()))) return;
+ for (int i = 0; i < static_cast<int>(maps.size()); i++) {
UpdateMegamorphicCache(*maps.at(i), *name, *handlers.at(i));
}
}
@@ -732,9 +733,9 @@ bool IC::IsTransitionOfMonomorphicTarget(Map* source_map, Map* target_map) {
source_map->elements_kind(), target_elements_kind);
Map* transitioned_map = nullptr;
if (more_general_transition) {
- MapHandleList map_list;
- map_list.Add(handle(target_map));
- transitioned_map = source_map->FindElementsKindTransitionedMap(&map_list);
+ MapHandles map_list;
+ map_list.push_back(handle(target_map));
+ transitioned_map = source_map->FindElementsKindTransitionedMap(map_list);
}
return transitioned_map == target_map;
}
@@ -1334,16 +1335,15 @@ void KeyedLoadIC::UpdateLoadElement(Handle<HeapObject> receiver) {
Handle<Map> receiver_map(receiver->map(), isolate());
DCHECK(receiver_map->instance_type() != JS_VALUE_TYPE &&
receiver_map->instance_type() != JS_PROXY_TYPE); // Checked by caller.
- MapHandleList target_receiver_maps;
+ MapHandles target_receiver_maps;
TargetMaps(&target_receiver_maps);
- if (target_receiver_maps.length() == 0) {
+ if (target_receiver_maps.empty()) {
Handle<Object> handler = LoadElementHandler(receiver_map);
return ConfigureVectorState(Handle<Name>(), receiver_map, handler);
}
- for (int i = 0; i < target_receiver_maps.length(); i++) {
- Handle<Map> map = target_receiver_maps.at(i);
+ for (Handle<Map> map : target_receiver_maps) {
if (map.is_null()) continue;
if (map->instance_type() == JS_VALUE_TYPE) {
TRACE_GENERIC_IC("JSValue");
@@ -1383,14 +1383,20 @@ void KeyedLoadIC::UpdateLoadElement(Handle<HeapObject> receiver) {
// If the maximum number of receiver maps has been exceeded, use the generic
// version of the IC.
- if (target_receiver_maps.length() > kMaxKeyedPolymorphism) {
+ if (target_receiver_maps.size() > kMaxKeyedPolymorphism) {
TRACE_GENERIC_IC("max polymorph exceeded");
return;
}
- List<Handle<Object>> handlers(target_receiver_maps.length());
+ List<Handle<Object>> handlers(static_cast<int>(target_receiver_maps.size()));
LoadElementPolymorphicHandlers(&target_receiver_maps, &handlers);
- ConfigureVectorState(Handle<Name>(), &target_receiver_maps, &handlers);
+ DCHECK_LE(1, target_receiver_maps.size());
+ if (target_receiver_maps.size() == 1) {
+ ConfigureVectorState(Handle<Name>(), target_receiver_maps[0],
+ handlers.at(0));
+ } else {
+ ConfigureVectorState(Handle<Name>(), target_receiver_maps, &handlers);
+ }
}
Handle<Object> KeyedLoadIC::LoadElementHandler(Handle<Map> receiver_map) {
@@ -1434,15 +1440,20 @@ Handle<Object> KeyedLoadIC::LoadElementHandler(Handle<Map> receiver_map) {
}
void KeyedLoadIC::LoadElementPolymorphicHandlers(
- MapHandleList* receiver_maps, List<Handle<Object>>* handlers) {
- for (int i = 0; i < receiver_maps->length(); ++i) {
- Handle<Map> receiver_map(receiver_maps->at(i));
-
+ MapHandles* receiver_maps, List<Handle<Object>>* handlers) {
+ // Filter out deprecated maps to ensure their instances get migrated.
+ receiver_maps->erase(
+ std::remove_if(
+ receiver_maps->begin(), receiver_maps->end(),
+ [](const Handle<Map>& map) { return map->is_deprecated(); }),
+ receiver_maps->end());
+
+ for (Handle<Map> receiver_map : *receiver_maps) {
// Mark all stable receiver maps that have elements kind transition map
// among receiver_maps as unstable because the optimizing compilers may
// generate an elements kind transition for this kind of receivers.
if (receiver_map->is_stable()) {
- Map* tmap = receiver_map->FindElementsKindTransitionedMap(receiver_maps);
+ Map* tmap = receiver_map->FindElementsKindTransitionedMap(*receiver_maps);
if (tmap != nullptr) {
receiver_map->NotifyLeafMapLayoutChange();
}
@@ -1925,9 +1936,9 @@ Handle<Code> StoreIC::CompileHandler(LookupIterator* lookup) {
void KeyedStoreIC::UpdateStoreElement(Handle<Map> receiver_map,
KeyedAccessStoreMode store_mode) {
- MapHandleList target_receiver_maps;
+ MapHandles target_receiver_maps;
TargetMaps(&target_receiver_maps);
- if (target_receiver_maps.length() == 0) {
+ if (target_receiver_maps.empty()) {
Handle<Map> monomorphic_map =
ComputeTransitionedMap(receiver_map, store_mode);
store_mode = GetNonTransitioningStoreMode(store_mode);
@@ -1935,9 +1946,8 @@ void KeyedStoreIC::UpdateStoreElement(Handle<Map> receiver_map,
return ConfigureVectorState(Handle<Name>(), monomorphic_map, handler);
}
- for (int i = 0; i < target_receiver_maps.length(); i++) {
- if (!target_receiver_maps.at(i).is_null() &&
- target_receiver_maps.at(i)->instance_type() == JS_VALUE_TYPE) {
+ for (Handle<Map> map : target_receiver_maps) {
+ if (!map.is_null() && map->instance_type() == JS_VALUE_TYPE) {
TRACE_GENERIC_IC("JSValue");
return;
}
@@ -2002,7 +2012,7 @@ void KeyedStoreIC::UpdateStoreElement(Handle<Map> receiver_map,
// If the maximum number of receiver maps has been exceeded, use the
// megamorphic version of the IC.
- if (target_receiver_maps.length() > kMaxKeyedPolymorphism) return;
+ if (target_receiver_maps.size() > kMaxKeyedPolymorphism) return;
// Make sure all polymorphic handlers have the same store mode, otherwise the
// megamorphic stub must be used.
@@ -2020,22 +2030,28 @@ void KeyedStoreIC::UpdateStoreElement(Handle<Map> receiver_map,
// receivers are either external arrays, or all "normal" arrays. Otherwise,
// use the megamorphic stub.
if (store_mode != STANDARD_STORE) {
- int external_arrays = 0;
- for (int i = 0; i < target_receiver_maps.length(); ++i) {
- if (target_receiver_maps[i]->has_fixed_typed_array_elements()) {
+ size_t external_arrays = 0;
+ for (Handle<Map> map : target_receiver_maps) {
+ if (map->has_fixed_typed_array_elements()) {
external_arrays++;
}
}
if (external_arrays != 0 &&
- external_arrays != target_receiver_maps.length()) {
+ external_arrays != target_receiver_maps.size()) {
TRACE_GENERIC_IC("unsupported combination of external and normal arrays");
return;
}
}
- List<Handle<Object>> handlers(target_receiver_maps.length());
+ List<Handle<Object>> handlers(static_cast<int>(target_receiver_maps.size()));
StoreElementPolymorphicHandlers(&target_receiver_maps, &handlers, store_mode);
- ConfigureVectorState(Handle<Name>(), &target_receiver_maps, &handlers);
+ DCHECK_LE(1, target_receiver_maps.size());
+ if (target_receiver_maps.size() == 1) {
+ ConfigureVectorState(Handle<Name>(), target_receiver_maps[0],
+ handlers.at(0));
+ } else {
+ ConfigureVectorState(Handle<Name>(), target_receiver_maps, &handlers);
+ }
}
@@ -2100,15 +2116,21 @@ Handle<Object> KeyedStoreIC::StoreElementHandler(
}
void KeyedStoreIC::StoreElementPolymorphicHandlers(
- MapHandleList* receiver_maps, List<Handle<Object>>* handlers,
+ MapHandles* receiver_maps, List<Handle<Object>>* handlers,
KeyedAccessStoreMode store_mode) {
DCHECK(store_mode == STANDARD_STORE ||
store_mode == STORE_AND_GROW_NO_TRANSITION ||
store_mode == STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS ||
store_mode == STORE_NO_TRANSITION_HANDLE_COW);
- for (int i = 0; i < receiver_maps->length(); ++i) {
- Handle<Map> receiver_map(receiver_maps->at(i));
+ // Filter out deprecated maps to ensure their instances get migrated.
+ receiver_maps->erase(
+ std::remove_if(
+ receiver_maps->begin(), receiver_maps->end(),
+ [](const Handle<Map>& map) { return map->is_deprecated(); }),
+ receiver_maps->end());
+
+ for (Handle<Map> receiver_map : *receiver_maps) {
Handle<Object> handler;
Handle<Map> transitioned_map;
@@ -2122,7 +2144,7 @@ void KeyedStoreIC::StoreElementPolymorphicHandlers(
} else {
{
Map* tmap =
- receiver_map->FindElementsKindTransitionedMap(receiver_maps);
+ receiver_map->FindElementsKindTransitionedMap(*receiver_maps);
if (tmap != nullptr) {
if (receiver_map->is_stable()) {
receiver_map->NotifyLeafMapLayoutChange();
diff --git a/deps/v8/src/ic/ic.h b/deps/v8/src/ic/ic.h
index 4649bc0b0e..9ea8905757 100644
--- a/deps/v8/src/ic/ic.h
+++ b/deps/v8/src/ic/ic.h
@@ -10,6 +10,7 @@
#include "src/ic/ic-state.h"
#include "src/macro-assembler.h"
#include "src/messages.h"
+#include "src/objects/map.h"
namespace v8 {
namespace internal {
@@ -96,7 +97,7 @@ class IC {
void ConfigureVectorState(Handle<Name> name, Handle<Map> map,
Handle<Object> handler);
// Configure the vector for POLYMORPHIC.
- void ConfigureVectorState(Handle<Name> name, MapHandleList* maps,
+ void ConfigureVectorState(Handle<Name> name, MapHandles const& maps,
List<Handle<Object>>* handlers);
char TransitionMarkFromState(IC::State state);
@@ -164,16 +165,16 @@ class IC {
}
}
- void TargetMaps(MapHandleList* list) {
+ void TargetMaps(MapHandles* list) {
FindTargetMaps();
- for (int i = 0; i < target_maps_.length(); i++) {
- list->Add(target_maps_.at(i));
+ for (Handle<Map> map : target_maps_) {
+ list->push_back(map);
}
}
Map* FirstTargetMap() {
FindTargetMaps();
- return target_maps_.length() > 0 ? *target_maps_.at(0) : NULL;
+ return !target_maps_.empty() ? *target_maps_[0] : NULL;
}
Handle<FeedbackVector> vector() const { return nexus()->vector_handle(); }
@@ -223,7 +224,7 @@ class IC {
MaybeHandle<Object> maybe_handler_;
ExtraICState extra_ic_state_;
- MapHandleList target_maps_;
+ MapHandles target_maps_;
bool target_maps_set_;
const char* slow_stub_reason_;
@@ -328,7 +329,7 @@ class KeyedLoadIC : public LoadIC {
Handle<Object> LoadElementHandler(Handle<Map> receiver_map);
- void LoadElementPolymorphicHandlers(MapHandleList* receiver_maps,
+ void LoadElementPolymorphicHandlers(MapHandles* receiver_maps,
List<Handle<Object>>* handlers);
};
@@ -414,7 +415,7 @@ class KeyedStoreIC : public StoreIC {
Handle<Object> StoreElementHandler(Handle<Map> receiver_map,
KeyedAccessStoreMode store_mode);
- void StoreElementPolymorphicHandlers(MapHandleList* receiver_maps,
+ void StoreElementPolymorphicHandlers(MapHandles* receiver_maps,
List<Handle<Object>>* handlers,
KeyedAccessStoreMode store_mode);
diff --git a/deps/v8/src/ic/keyed-store-generic.cc b/deps/v8/src/ic/keyed-store-generic.cc
index 29d666d620..19c7e47caa 100644
--- a/deps/v8/src/ic/keyed-store-generic.cc
+++ b/deps/v8/src/ic/keyed-store-generic.cc
@@ -697,10 +697,9 @@ void KeyedStoreGenericAssembler::OverwriteExistingFastProperty(
BIND(&inobject);
{
- Node* field_offset =
- IntPtrMul(IntPtrSub(LoadMapInstanceSize(object_map),
- IntPtrSub(inobject_properties, field_index)),
- IntPtrConstant(kPointerSize));
+ Node* field_offset = TimesPointerSize(IntPtrAdd(
+ IntPtrSub(LoadMapInstanceSize(object_map), inobject_properties),
+ field_index));
Label tagged_rep(this), double_rep(this);
Branch(Word32Equal(representation, Int32Constant(Representation::kDouble)),
&double_rep, &tagged_rep);
@@ -789,6 +788,7 @@ void KeyedStoreGenericAssembler::EmitGenericPropertyStore(
BIND(&data_property);
{
+ CheckForAssociatedProtector(p->name, slow);
OverwriteExistingFastProperty(receiver, receiver_map, properties,
descriptors, name_index, details,
p->value, slow);
@@ -822,6 +822,7 @@ void KeyedStoreGenericAssembler::EmitGenericPropertyStore(
BIND(&overwrite);
{
+ CheckForAssociatedProtector(p->name, slow);
StoreValueByKeyIndex<NameDictionary>(properties, var_name_index.value(),
p->value);
Return(p->value);
@@ -830,6 +831,7 @@ void KeyedStoreGenericAssembler::EmitGenericPropertyStore(
BIND(&not_found);
{
+ CheckForAssociatedProtector(p->name, slow);
Label extensible(this);
GotoIf(IsPrivateSymbol(p->name), &extensible);
Node* bitfield2 = LoadMapBitField2(receiver_map);
diff --git a/deps/v8/src/ic/mips/OWNERS b/deps/v8/src/ic/mips/OWNERS
index 89455a4fbd..3f8fbfc7c8 100644
--- a/deps/v8/src/ic/mips/OWNERS
+++ b/deps/v8/src/ic/mips/OWNERS
@@ -1,6 +1,3 @@
-paul.lind@imgtec.com
-gergely.kis@imgtec.com
-akos.palfi@imgtec.com
-balazs.kilvady@imgtec.com
-dusan.milosavljevic@imgtec.com
ivica.bogosavljevic@imgtec.com
+Miran.Karic@imgtec.com
+dusan.simicic@imgtec.com
diff --git a/deps/v8/src/ic/mips/handler-compiler-mips.cc b/deps/v8/src/ic/mips/handler-compiler-mips.cc
index 6e581a5bf2..9f0174f44d 100644
--- a/deps/v8/src/ic/mips/handler-compiler-mips.cc
+++ b/deps/v8/src/ic/mips/handler-compiler-mips.cc
@@ -211,10 +211,8 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall(
Isolate* isolate = masm->isolate();
Handle<CallHandlerInfo> api_call_info = optimization.api_call_info();
- bool call_data_undefined = false;
// Put call data in place.
if (api_call_info->data()->IsUndefined(isolate)) {
- call_data_undefined = true;
__ LoadRoot(data, Heap::kUndefinedValueRootIndex);
} else {
if (optimization.is_constant_call()) {
@@ -238,8 +236,7 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall(
__ li(api_function_address, Operand(ref));
// Jump to stub.
- CallApiCallbackStub stub(isolate, is_store, call_data_undefined,
- !optimization.is_constant_call());
+ CallApiCallbackStub stub(isolate, is_store, !optimization.is_constant_call());
__ TailCallStub(&stub);
}
diff --git a/deps/v8/src/ic/mips64/OWNERS b/deps/v8/src/ic/mips64/OWNERS
index 89455a4fbd..3f8fbfc7c8 100644
--- a/deps/v8/src/ic/mips64/OWNERS
+++ b/deps/v8/src/ic/mips64/OWNERS
@@ -1,6 +1,3 @@
-paul.lind@imgtec.com
-gergely.kis@imgtec.com
-akos.palfi@imgtec.com
-balazs.kilvady@imgtec.com
-dusan.milosavljevic@imgtec.com
ivica.bogosavljevic@imgtec.com
+Miran.Karic@imgtec.com
+dusan.simicic@imgtec.com
diff --git a/deps/v8/src/ic/mips64/handler-compiler-mips64.cc b/deps/v8/src/ic/mips64/handler-compiler-mips64.cc
index 99ca45a136..99638f5493 100644
--- a/deps/v8/src/ic/mips64/handler-compiler-mips64.cc
+++ b/deps/v8/src/ic/mips64/handler-compiler-mips64.cc
@@ -50,7 +50,7 @@ void NamedStoreHandlerCompiler::GenerateStoreViaSetter(
// Call the JavaScript setter with receiver and value on the stack.
if (map->IsJSGlobalObjectMap()) {
// Swap in the global receiver.
- __ ld(scratch,
+ __ Ld(scratch,
FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset));
receiver = scratch;
}
@@ -115,27 +115,26 @@ void PropertyHandlerCompiler::GenerateDictionaryNegativeLookup(
// Bail out if the receiver has a named interceptor or requires access checks.
Register map = scratch1;
- __ ld(map, FieldMemOperand(receiver, HeapObject::kMapOffset));
- __ lbu(scratch0, FieldMemOperand(map, Map::kBitFieldOffset));
+ __ Ld(map, FieldMemOperand(receiver, HeapObject::kMapOffset));
+ __ Lbu(scratch0, FieldMemOperand(map, Map::kBitFieldOffset));
__ And(scratch0, scratch0, Operand(kInterceptorOrAccessCheckNeededMask));
__ Branch(miss_label, ne, scratch0, Operand(zero_reg));
// Check that receiver is a JSObject.
- __ lbu(scratch0, FieldMemOperand(map, Map::kInstanceTypeOffset));
+ __ Lbu(scratch0, FieldMemOperand(map, Map::kInstanceTypeOffset));
__ Branch(miss_label, lt, scratch0, Operand(FIRST_JS_RECEIVER_TYPE));
// Load properties array.
Register properties = scratch0;
- __ ld(properties, FieldMemOperand(receiver, JSObject::kPropertiesOffset));
+ __ Ld(properties, FieldMemOperand(receiver, JSObject::kPropertiesOffset));
// Check that the properties array is a dictionary.
- __ ld(map, FieldMemOperand(properties, HeapObject::kMapOffset));
+ __ Ld(map, FieldMemOperand(properties, HeapObject::kMapOffset));
Register tmp = properties;
__ LoadRoot(tmp, Heap::kHashTableMapRootIndex);
__ Branch(miss_label, ne, map, Operand(tmp));
// Restore the temporarily used register.
- __ ld(properties, FieldMemOperand(receiver, JSObject::kPropertiesOffset));
-
+ __ Ld(properties, FieldMemOperand(receiver, JSObject::kPropertiesOffset));
NameDictionaryLookupStub::GenerateNegativeLookup(
masm, miss_label, &done, receiver, properties, name, scratch1);
@@ -155,7 +154,7 @@ void PropertyHandlerCompiler::GenerateCheckPropertyCell(
DCHECK(cell->value()->IsTheHole(isolate));
Handle<WeakCell> weak_cell = isolate->factory()->NewWeakCell(cell);
__ LoadWeakValue(scratch, weak_cell, miss);
- __ ld(scratch, FieldMemOperand(scratch, PropertyCell::kValueOffset));
+ __ Ld(scratch, FieldMemOperand(scratch, PropertyCell::kValueOffset));
__ LoadRoot(at, Heap::kTheHoleValueRootIndex);
__ Branch(miss, ne, scratch, Operand(at));
}
@@ -197,11 +196,11 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall(
__ Move(holder, receiver);
break;
case CallOptimization::kHolderFound:
- __ ld(holder, FieldMemOperand(receiver, HeapObject::kMapOffset));
- __ ld(holder, FieldMemOperand(holder, Map::kPrototypeOffset));
+ __ Ld(holder, FieldMemOperand(receiver, HeapObject::kMapOffset));
+ __ Ld(holder, FieldMemOperand(holder, Map::kPrototypeOffset));
for (int i = 1; i < holder_depth; i++) {
- __ ld(holder, FieldMemOperand(holder, HeapObject::kMapOffset));
- __ ld(holder, FieldMemOperand(holder, Map::kPrototypeOffset));
+ __ Ld(holder, FieldMemOperand(holder, HeapObject::kMapOffset));
+ __ Ld(holder, FieldMemOperand(holder, Map::kPrototypeOffset));
}
break;
case CallOptimization::kHolderNotFound:
@@ -211,23 +210,21 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall(
Isolate* isolate = masm->isolate();
Handle<CallHandlerInfo> api_call_info = optimization.api_call_info();
- bool call_data_undefined = false;
// Put call data in place.
if (api_call_info->data()->IsUndefined(isolate)) {
- call_data_undefined = true;
__ LoadRoot(data, Heap::kUndefinedValueRootIndex);
} else {
if (optimization.is_constant_call()) {
- __ ld(data,
+ __ Ld(data,
FieldMemOperand(callee, JSFunction::kSharedFunctionInfoOffset));
- __ ld(data,
+ __ Ld(data,
FieldMemOperand(data, SharedFunctionInfo::kFunctionDataOffset));
- __ ld(data, FieldMemOperand(data, FunctionTemplateInfo::kCallCodeOffset));
+ __ Ld(data, FieldMemOperand(data, FunctionTemplateInfo::kCallCodeOffset));
} else {
- __ ld(data,
+ __ Ld(data,
FieldMemOperand(callee, FunctionTemplateInfo::kCallCodeOffset));
}
- __ ld(data, FieldMemOperand(data, CallHandlerInfo::kDataOffset));
+ __ Ld(data, FieldMemOperand(data, CallHandlerInfo::kDataOffset));
}
// Put api_function_address in place.
@@ -238,8 +235,7 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall(
__ li(api_function_address, Operand(ref));
// Jump to stub.
- CallApiCallbackStub stub(isolate, is_store, call_data_undefined,
- !optimization.is_constant_call());
+ CallApiCallbackStub stub(isolate, is_store, !optimization.is_constant_call());
__ TailCallStub(&stub);
}
@@ -260,7 +256,7 @@ void PropertyHandlerCompiler::GenerateAccessCheck(
Label* miss, bool compare_native_contexts_only) {
Label done;
// Load current native context.
- __ ld(scratch1, NativeContextMemOperand());
+ __ Ld(scratch1, NativeContextMemOperand());
// Load expected native context.
__ LoadWeakValue(scratch2, native_context_cell, miss);
@@ -268,8 +264,8 @@ void PropertyHandlerCompiler::GenerateAccessCheck(
__ Branch(&done, eq, scratch1, Operand(scratch2));
// Compare security tokens of current and expected native contexts.
- __ ld(scratch1, ContextMemOperand(scratch1, Context::SECURITY_TOKEN_INDEX));
- __ ld(scratch2, ContextMemOperand(scratch2, Context::SECURITY_TOKEN_INDEX));
+ __ Ld(scratch1, ContextMemOperand(scratch1, Context::SECURITY_TOKEN_INDEX));
+ __ Ld(scratch2, ContextMemOperand(scratch2, Context::SECURITY_TOKEN_INDEX));
}
__ Branch(miss, ne, scratch1, Operand(scratch2));
@@ -291,7 +287,7 @@ Register PropertyHandlerCompiler::CheckPrototypes(
if (!validity_cell.is_null()) {
DCHECK_EQ(Smi::FromInt(Map::kPrototypeChainValid), validity_cell->value());
__ li(scratch1, Operand(validity_cell));
- __ ld(scratch1, FieldMemOperand(scratch1, Cell::kValueOffset));
+ __ Ld(scratch1, FieldMemOperand(scratch1, Cell::kValueOffset));
__ Branch(miss, ne, scratch1,
Operand(Smi::FromInt(Map::kPrototypeChainValid)));
}
diff --git a/deps/v8/src/ic/ppc/handler-compiler-ppc.cc b/deps/v8/src/ic/ppc/handler-compiler-ppc.cc
index 5736c12ffc..877e3996e0 100644
--- a/deps/v8/src/ic/ppc/handler-compiler-ppc.cc
+++ b/deps/v8/src/ic/ppc/handler-compiler-ppc.cc
@@ -216,10 +216,8 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall(
Isolate* isolate = masm->isolate();
Handle<CallHandlerInfo> api_call_info = optimization.api_call_info();
- bool call_data_undefined = false;
// Put call data in place.
if (api_call_info->data()->IsUndefined(isolate)) {
- call_data_undefined = true;
__ LoadRoot(data, Heap::kUndefinedValueRootIndex);
} else {
if (optimization.is_constant_call()) {
@@ -244,8 +242,7 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall(
__ mov(api_function_address, Operand(ref));
// Jump to stub.
- CallApiCallbackStub stub(isolate, is_store, call_data_undefined,
- !optimization.is_constant_call());
+ CallApiCallbackStub stub(isolate, is_store, !optimization.is_constant_call());
__ TailCallStub(&stub);
}
diff --git a/deps/v8/src/ic/s390/handler-compiler-s390.cc b/deps/v8/src/ic/s390/handler-compiler-s390.cc
index bfca871bab..718b24d608 100644
--- a/deps/v8/src/ic/s390/handler-compiler-s390.cc
+++ b/deps/v8/src/ic/s390/handler-compiler-s390.cc
@@ -208,10 +208,8 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall(
Isolate* isolate = masm->isolate();
Handle<CallHandlerInfo> api_call_info = optimization.api_call_info();
- bool call_data_undefined = false;
// Put call data in place.
if (api_call_info->data()->IsUndefined(isolate)) {
- call_data_undefined = true;
__ LoadRoot(data, Heap::kUndefinedValueRootIndex);
} else {
if (optimization.is_constant_call()) {
@@ -236,8 +234,7 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall(
__ mov(api_function_address, Operand(ref));
// Jump to stub.
- CallApiCallbackStub stub(isolate, is_store, call_data_undefined,
- !optimization.is_constant_call());
+ CallApiCallbackStub stub(isolate, is_store, !optimization.is_constant_call());
__ TailCallStub(&stub);
}
diff --git a/deps/v8/src/ic/stub-cache.cc b/deps/v8/src/ic/stub-cache.cc
index d62aceec96..6396c57061 100644
--- a/deps/v8/src/ic/stub-cache.cc
+++ b/deps/v8/src/ic/stub-cache.cc
@@ -111,43 +111,5 @@ void StubCache::Clear() {
}
}
-
-void StubCache::CollectMatchingMaps(SmallMapList* types, Handle<Name> name,
- Handle<Context> native_context,
- Zone* zone) {
- for (int i = 0; i < kPrimaryTableSize; i++) {
- if (primary_[i].key == *name) {
- Map* map = primary_[i].map;
- // Map can be nullptr, if the stub is constant function call
- // with a primitive receiver.
- if (map == nullptr) continue;
-
- int offset = PrimaryOffset(*name, map);
- if (entry(primary_, offset) == &primary_[i] &&
- TypeFeedbackOracle::IsRelevantFeedback(map, *native_context)) {
- types->AddMapIfMissing(Handle<Map>(map), zone);
- }
- }
- }
-
- for (int i = 0; i < kSecondaryTableSize; i++) {
- if (secondary_[i].key == *name) {
- Map* map = secondary_[i].map;
- // Map can be nullptr, if the stub is constant function call
- // with a primitive receiver.
- if (map == nullptr) continue;
-
- // Lookup in primary table and skip duplicates.
- int primary_offset = PrimaryOffset(*name, map);
-
- // Lookup in secondary table and add matches.
- int offset = SecondaryOffset(*name, primary_offset);
- if (entry(secondary_, offset) == &secondary_[i] &&
- TypeFeedbackOracle::IsRelevantFeedback(map, *native_context)) {
- types->AddMapIfMissing(Handle<Map>(map), zone);
- }
- }
- }
-}
} // namespace internal
} // namespace v8
diff --git a/deps/v8/src/ic/stub-cache.h b/deps/v8/src/ic/stub-cache.h
index 4054b329d3..ffb0a398ad 100644
--- a/deps/v8/src/ic/stub-cache.h
+++ b/deps/v8/src/ic/stub-cache.h
@@ -45,9 +45,6 @@ class StubCache {
Object* Get(Name* name, Map* map);
// Clear the lookup table (@ mark compact collection).
void Clear();
- // Collect all maps that match the name.
- void CollectMatchingMaps(SmallMapList* types, Handle<Name> name,
- Handle<Context> native_context, Zone* zone);
enum Table { kPrimary, kSecondary };
diff --git a/deps/v8/src/ic/x64/handler-compiler-x64.cc b/deps/v8/src/ic/x64/handler-compiler-x64.cc
index cd831c8b5f..eeddd55a7b 100644
--- a/deps/v8/src/ic/x64/handler-compiler-x64.cc
+++ b/deps/v8/src/ic/x64/handler-compiler-x64.cc
@@ -139,10 +139,8 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall(
Isolate* isolate = masm->isolate();
Handle<CallHandlerInfo> api_call_info = optimization.api_call_info();
- bool call_data_undefined = false;
// Put call data in place.
if (api_call_info->data()->IsUndefined(isolate)) {
- call_data_undefined = true;
__ LoadRoot(data, Heap::kUndefinedValueRootIndex);
} else {
if (optimization.is_constant_call()) {
@@ -164,8 +162,7 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall(
RelocInfo::EXTERNAL_REFERENCE);
// Jump to stub.
- CallApiCallbackStub stub(isolate, is_store, call_data_undefined,
- !optimization.is_constant_call());
+ CallApiCallbackStub stub(isolate, is_store, !optimization.is_constant_call());
__ TailCallStub(&stub);
}