Revert "PPC/S390: [typedarray] Make JSTypedArray::length authoritative."

This reverts commit b51404a8a1.

Reason for revert: Need to revert this change due to a revert on this commit: 1810066662

Original change's description:
> PPC/S390: [typedarray] Make JSTypedArray::length authoritative.
> 
> Removing NumberToSize on PPC and S390.
> 
> Port ad44c258d7
> 
> Change-Id: Ic5d3132f1bb396f07a26399d2e3f6aca4689aa3f
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1554227
> Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#60691}

TBR=jarin@chromium.org,titzer@chromium.org,petermarshall@chromium.org,bmeurer@chromium.org,miladfar@ca.ibm.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: Idd6cf715ce25ed35f9cb55c70e20183072c660d3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1598308
Reviewed-by: Milad Farazmand <miladfar@ca.ibm.com>
Commit-Queue: Milad Farazmand <miladfar@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#61257}
This commit is contained in:
Milad Farazmand 2019-05-07 01:52:51 +00:00 committed by Commit Bot
parent 023905b97b
commit f59744fe9f

View File

@ -361,7 +361,7 @@ Object GetModifySetValueInBuffer(Arguments args, Isolate* isolate) {
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, bigint,
BigInt::FromObject(isolate, value_obj));
// SharedArrayBuffers are not detachable.
CHECK_LT(index, sta->length());
CHECK_LT(index, NumberToSize(sta->length()));
if (sta->type() == kExternalBigInt64Array) {
return Op<int64_t>::Do(isolate, source, index, bigint);
}
@ -373,7 +373,7 @@ Object GetModifySetValueInBuffer(Arguments args, Isolate* isolate) {
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, value,
Object::ToInteger(isolate, value_obj));
// SharedArrayBuffers are not detachable.
CHECK_LT(index, sta->length());
CHECK_LT(index, NumberToSize(sta->length()));
switch (sta->type()) {
#define TYPED_ARRAY_CASE(Type, typeName, TYPE, ctype) \
@ -403,7 +403,7 @@ RUNTIME_FUNCTION(Runtime_AtomicsLoad64) {
DCHECK(sta->type() == kExternalBigInt64Array ||
sta->type() == kExternalBigUint64Array);
// SharedArrayBuffers are not detachable.
CHECK_LT(index, sta->length());
CHECK_LT(index, NumberToSize(sta->length()));
if (sta->type() == kExternalBigInt64Array) {
return Load<int64_t>::Do(isolate, source, index);
}
@ -429,7 +429,7 @@ RUNTIME_FUNCTION(Runtime_AtomicsStore64) {
DCHECK(sta->type() == kExternalBigInt64Array ||
sta->type() == kExternalBigUint64Array);
// SharedArrayBuffers are not detachable.
CHECK_LT(index, sta->length());
CHECK_LT(index, NumberToSize(sta->length()));
if (sta->type() == kExternalBigInt64Array) {
Store<int64_t>::Do(isolate, source, index, bigint);
return *bigint;
@ -451,7 +451,7 @@ RUNTIME_FUNCTION(Runtime_AtomicsCompareExchange) {
CONVERT_ARG_HANDLE_CHECKED(Object, old_value_obj, 2);
CONVERT_ARG_HANDLE_CHECKED(Object, new_value_obj, 3);
CHECK(sta->GetBuffer()->is_shared());
CHECK_LT(index, sta->length());
CHECK_LT(index, NumberToSize(sta->length()));
uint8_t* source = static_cast<uint8_t*>(sta->GetBuffer()->backing_store()) +
sta->byte_offset();
@ -464,7 +464,7 @@ RUNTIME_FUNCTION(Runtime_AtomicsCompareExchange) {
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
isolate, new_bigint, BigInt::FromObject(isolate, new_value_obj));
// SharedArrayBuffers are not detachable.
CHECK_LT(index, sta->length());
CHECK_LT(index, NumberToSize(sta->length()));
if (sta->type() == kExternalBigInt64Array) {
return DoCompareExchange<int64_t>(isolate, source, index, old_bigint,
new_bigint);
@ -481,7 +481,7 @@ RUNTIME_FUNCTION(Runtime_AtomicsCompareExchange) {
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, new_value,
Object::ToInteger(isolate, new_value_obj));
// SharedArrayBuffers are not detachable.
CHECK_LT(index, sta->length());
CHECK_LT(index, NumberToSize(sta->length()));
switch (sta->type()) {
#define TYPED_ARRAY_CASE(Type, typeName, TYPE, ctype) \