Commit b51404a8 authored by Milad Farazmand's avatar Milad Farazmand Committed by Commit Bot

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

Removing NumberToSize on PPC and S390.

Port ad44c258

Change-Id: Ic5d3132f1bb396f07a26399d2e3f6aca4689aa3f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1554227
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60691}
parent 3e1f2fc9
......@@ -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, NumberToSize(sta->length()));
CHECK_LT(index, 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, NumberToSize(sta->length()));
CHECK_LT(index, 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, NumberToSize(sta->length()));
CHECK_LT(index, 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, NumberToSize(sta->length()));
CHECK_LT(index, 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, NumberToSize(sta->length()));
CHECK_LT(index, 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, NumberToSize(sta->length()));
CHECK_LT(index, 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, NumberToSize(sta->length()));
CHECK_LT(index, sta->length());
switch (sta->type()) {
#define TYPED_ARRAY_CASE(Type, typeName, TYPE, ctype) \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment