summaryrefslogtreecommitdiff
path: root/deps/v8/src/objects/map-inl.h
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2019-11-08 15:39:11 +0100
committerMichaël Zasso <targos@protonmail.com>2019-11-08 15:46:25 +0100
commit6ca81ad72a3c6fdf16c683335be748f22aaa9a0d (patch)
tree33c8ee75f729aed76c2c0b89c63f9bf1b4dd66aa /deps/v8/src/objects/map-inl.h
parent1eee0b8bf8bba39b600fb16a9223e545e3bac2bc (diff)
downloadandroid-node-v8-6ca81ad72a3c6fdf16c683335be748f22aaa9a0d.tar.gz
android-node-v8-6ca81ad72a3c6fdf16c683335be748f22aaa9a0d.tar.bz2
android-node-v8-6ca81ad72a3c6fdf16c683335be748f22aaa9a0d.zip
deps: update V8 to 7.9.317.20
PR-URL: https://github.com/nodejs/node/pull/30020 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'deps/v8/src/objects/map-inl.h')
-rw-r--r--deps/v8/src/objects/map-inl.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/deps/v8/src/objects/map-inl.h b/deps/v8/src/objects/map-inl.h
index 48bb86e2da..557c004401 100644
--- a/deps/v8/src/objects/map-inl.h
+++ b/deps/v8/src/objects/map-inl.h
@@ -112,7 +112,7 @@ bool Map::IsMostGeneralFieldType(Representation representation,
bool Map::CanHaveFastTransitionableElementsKind(InstanceType instance_type) {
return instance_type == JS_ARRAY_TYPE ||
instance_type == JS_PRIMITIVE_WRAPPER_TYPE ||
- instance_type == JS_ARGUMENTS_TYPE;
+ instance_type == JS_ARGUMENTS_OBJECT_TYPE;
}
bool Map::CanHaveFastTransitionableElementsKind() const {
@@ -177,10 +177,10 @@ PropertyDetails Map::GetLastDescriptorDetails(Isolate* isolate) const {
return instance_descriptors(isolate).GetDetails(LastAdded());
}
-int Map::LastAdded() const {
+InternalIndex Map::LastAdded() const {
int number_of_own_descriptors = NumberOfOwnDescriptors();
DCHECK_GT(number_of_own_descriptors, 0);
- return number_of_own_descriptors - 1;
+ return InternalIndex(number_of_own_descriptors - 1);
}
int Map::NumberOfOwnDescriptors() const {
@@ -194,6 +194,10 @@ void Map::SetNumberOfOwnDescriptors(int number) {
set_bit_field3(NumberOfOwnDescriptorsBits::update(bit_field3(), number));
}
+InternalIndex::Range Map::IterateOwnDescriptors() const {
+ return InternalIndex::Range(NumberOfOwnDescriptors());
+}
+
int Map::EnumLength() const { return EnumLengthBits::decode(bit_field3()); }
void Map::SetEnumLength(int length) {
@@ -207,7 +211,8 @@ void Map::SetEnumLength(int length) {
FixedArrayBase Map::GetInitialElements() const {
FixedArrayBase result;
- if (has_fast_elements() || has_fast_string_wrapper_elements()) {
+ if (has_fast_elements() || has_fast_string_wrapper_elements() ||
+ has_any_nonextensible_elements()) {
result = GetReadOnlyRoots().empty_fixed_array();
} else if (has_fast_sloppy_arguments_elements()) {
result = GetReadOnlyRoots().empty_sloppy_arguments_elements();
@@ -540,12 +545,12 @@ void Map::mark_unstable() {
bool Map::is_stable() const { return !IsUnstableBit::decode(bit_field3()); }
bool Map::CanBeDeprecated() const {
- int descriptor = LastAdded();
- for (int i = 0; i <= descriptor; i++) {
+ for (InternalIndex i : IterateOwnDescriptors()) {
PropertyDetails details = instance_descriptors().GetDetails(i);
if (details.representation().IsNone()) return true;
if (details.representation().IsSmi()) return true;
- if (details.representation().IsDouble()) return true;
+ if (details.representation().IsDouble() && FLAG_unbox_double_fields)
+ return true;
if (details.representation().IsHeapObject()) return true;
if (details.kind() == kData && details.location() == kDescriptor) {
return true;
@@ -584,7 +589,7 @@ bool Map::IsNullOrUndefinedMap() const {
}
bool Map::IsPrimitiveMap() const {
- return instance_type() <= LAST_PRIMITIVE_TYPE;
+ return instance_type() <= LAST_PRIMITIVE_HEAP_OBJECT_TYPE;
}
LayoutDescriptor Map::layout_descriptor_gc_safe() const {
@@ -675,8 +680,10 @@ void Map::AppendDescriptor(Isolate* isolate, Descriptor* desc) {
// barrier.
descriptors.Append(desc);
SetNumberOfOwnDescriptors(number_of_own_descriptors + 1);
+#ifndef V8_DISABLE_WRITE_BARRIERS
MarkingBarrierForDescriptorArray(isolate->heap(), *this, descriptors,
number_of_own_descriptors + 1);
+#endif
}
// Properly mark the map if the {desc} is an "interesting symbol".
if (desc->GetKey()->IsInterestingSymbol()) {