| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent a4a9246 commit 7dd68ac
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -36,7 +36,7 @@ | |||
| 36 | 36 | ||
| 37 | 37 | # Reset this number to 0 on major V8 upgrades. | |
| 38 | 38 | # Increment by one for each non-official patch applied to deps/v8. | |
| 39 | - 'v8_embedder_string': '-node.51', | ||
| 39 | + 'v8_embedder_string': '-node.52', | ||
| 40 | 40 | ||
| 41 | 41 | ##### V8 defaults for Node.js ##### | |
| 42 | 42 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -649,11 +649,14 @@ class ArrayConcatVisitor { | |||
| 649 | 649 | index_offset_(0u), | |
| 650 | 650 | bit_field_(FastElementsField::encode(fast_elements) | | |
| 651 | 651 | ExceedsLimitField::encode(false) | | |
| 652 | - IsFixedArrayField::encode(storage->IsFixedArray()) | | ||
| 652 | + IsFixedArrayField::encode(storage->IsFixedArray(isolate)) | | ||
| 653 | 653 | HasSimpleElementsField::encode( | |
| 654 | - storage->IsFixedArray() || | ||
| 655 | - !storage->map().IsCustomElementsReceiverMap())) { | ||
| 656 | - DCHECK(!(this->fast_elements() && !is_fixed_array())); | ||
| 654 | + storage->IsFixedArray(isolate) || | ||
| 655 | + // Don't take fast path for storages that might have | ||
| 656 | + // side effects when storing to them. | ||
| 657 | + (!storage->map(isolate).IsCustomElementsReceiverMap() && | ||
| 658 | + !storage->IsJSTypedArray(isolate)))) { | ||
| 659 | + DCHECK_IMPLIES(this->fast_elements(), is_fixed_array()); | ||
| 657 | 660 | } | |
| 658 | 661 | ||
| 659 | 662 | ~ArrayConcatVisitor() { clear_storage(); } | |
@@ -1063,8 +1066,8 @@ bool IterateElements(Isolate* isolate, Handle<JSReceiver> receiver, | |||
| 1063 | 1066 | return IterateElementsSlow(isolate, receiver, length, visitor); | |
| 1064 | 1067 | } | |
| 1065 | 1068 | ||
| 1066 | - if (!HasOnlySimpleElements(isolate, *receiver) || | ||
| 1067 | - !visitor->has_simple_elements()) { | ||
| 1069 | + if (!visitor->has_simple_elements() || | ||
| 1070 | + !HasOnlySimpleElements(isolate, *receiver)) { | ||
| 1068 | 1071 | return IterateElementsSlow(isolate, receiver, length, visitor); | |
| 1069 | 1072 | } | |
| 1070 | 1073 | Handle<JSObject> array = Handle<JSObject>::cast(receiver); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -309,15 +309,15 @@ int Search(T* array, Name name, int valid_entries, int* out_insertion_index) { | |||
| 309 | 309 | double FixedDoubleArray::get_scalar(int index) { | |
| 310 | 310 | DCHECK(map() != GetReadOnlyRoots().fixed_cow_array_map() && | |
| 311 | 311 | map() != GetReadOnlyRoots().fixed_array_map()); | |
| 312 | - DCHECK(index >= 0 && index < this->length()); | ||
| 312 | + DCHECK_LT(static_cast<unsigned>(index), static_cast<unsigned>(length())); | ||
| 313 | 313 | DCHECK(!is_the_hole(index)); | |
| 314 | 314 | return ReadField<double>(kHeaderSize + index * kDoubleSize); | |
| 315 | 315 | } | |
| 316 | 316 | ||
| 317 | 317 | uint64_t FixedDoubleArray::get_representation(int index) { | |
| 318 | 318 | DCHECK(map() != GetReadOnlyRoots().fixed_cow_array_map() && | |
| 319 | 319 | map() != GetReadOnlyRoots().fixed_array_map()); | |
| 320 | - DCHECK(index >= 0 && index < this->length()); | ||
| 320 | + DCHECK_LT(static_cast<unsigned>(index), static_cast<unsigned>(length())); | ||
| 321 | 321 | int offset = kHeaderSize + index * kDoubleSize; | |
| 322 | 322 | // Bug(v8:8875): Doubles may be unaligned. | |
| 323 | 323 | return base::ReadUnalignedValue<uint64_t>(field_address(offset)); | |
@@ -335,6 +335,7 @@ Handle<Object> FixedDoubleArray::get(FixedDoubleArray array, int index, | |||
| 335 | 335 | void FixedDoubleArray::set(int index, double value) { | |
| 336 | 336 | DCHECK(map() != GetReadOnlyRoots().fixed_cow_array_map() && | |
| 337 | 337 | map() != GetReadOnlyRoots().fixed_array_map()); | |
| 338 | + DCHECK_LT(static_cast<unsigned>(index), static_cast<unsigned>(length())); | ||
| 338 | 339 | int offset = kHeaderSize + index * kDoubleSize; | |
| 339 | 340 | if (std::isnan(value)) { | |
| 340 | 341 | WriteField<double>(offset, std::numeric_limits<double>::quiet_NaN()); | |
@@ -351,6 +352,7 @@ void FixedDoubleArray::set_the_hole(Isolate* isolate, int index) { | |||
| 351 | 352 | void FixedDoubleArray::set_the_hole(int index) { | |
| 352 | 353 | DCHECK(map() != GetReadOnlyRoots().fixed_cow_array_map() && | |
| 353 | 354 | map() != GetReadOnlyRoots().fixed_array_map()); | |
| 355 | + DCHECK_LT(static_cast<unsigned>(index), static_cast<unsigned>(length())); | ||
| 354 | 356 | int offset = kHeaderSize + index * kDoubleSize; | |
| 355 | 357 | base::WriteUnalignedValue<uint64_t>(field_address(offset), kHoleNanInt64); | |
| 356 | 358 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments