Commit 21d7ec05 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[runtime] Deprecate RUNTIME_ASSERT from atomics.

This removes explicit uses of the RUNTIME_ASSERT macro from some runtime
function. The implicit ones in CONVERT_FOO_ARG_CHECKED will be addressed
in a separate CL for all runtime modules at once.

R=binji@chromium.org
BUG=v8:5066

Review-Url: https://codereview.chromium.org/2034063002
Cr-Commit-Position: refs/heads/master@{#36810}
parent c91c3961
...@@ -354,8 +354,8 @@ RUNTIME_FUNCTION(Runtime_AtomicsCompareExchange) { ...@@ -354,8 +354,8 @@ RUNTIME_FUNCTION(Runtime_AtomicsCompareExchange) {
CONVERT_SIZE_ARG_CHECKED(index, 1); CONVERT_SIZE_ARG_CHECKED(index, 1);
CONVERT_NUMBER_ARG_HANDLE_CHECKED(oldobj, 2); CONVERT_NUMBER_ARG_HANDLE_CHECKED(oldobj, 2);
CONVERT_NUMBER_ARG_HANDLE_CHECKED(newobj, 3); CONVERT_NUMBER_ARG_HANDLE_CHECKED(newobj, 3);
RUNTIME_ASSERT(sta->GetBuffer()->is_shared()); CHECK(sta->GetBuffer()->is_shared());
RUNTIME_ASSERT(index < NumberToSize(isolate, sta->length())); CHECK_LT(index, NumberToSize(isolate, sta->length()));
uint8_t* source = static_cast<uint8_t*>(sta->GetBuffer()->backing_store()) + uint8_t* source = static_cast<uint8_t*>(sta->GetBuffer()->backing_store()) +
NumberToSize(isolate, sta->byte_offset()); NumberToSize(isolate, sta->byte_offset());
...@@ -387,8 +387,8 @@ RUNTIME_FUNCTION(Runtime_AtomicsAdd) { ...@@ -387,8 +387,8 @@ RUNTIME_FUNCTION(Runtime_AtomicsAdd) {
CONVERT_ARG_HANDLE_CHECKED(JSTypedArray, sta, 0); CONVERT_ARG_HANDLE_CHECKED(JSTypedArray, sta, 0);
CONVERT_SIZE_ARG_CHECKED(index, 1); CONVERT_SIZE_ARG_CHECKED(index, 1);
CONVERT_NUMBER_ARG_HANDLE_CHECKED(value, 2); CONVERT_NUMBER_ARG_HANDLE_CHECKED(value, 2);
RUNTIME_ASSERT(sta->GetBuffer()->is_shared()); CHECK(sta->GetBuffer()->is_shared());
RUNTIME_ASSERT(index < NumberToSize(isolate, sta->length())); CHECK_LT(index, NumberToSize(isolate, sta->length()));
uint8_t* source = static_cast<uint8_t*>(sta->GetBuffer()->backing_store()) + uint8_t* source = static_cast<uint8_t*>(sta->GetBuffer()->backing_store()) +
NumberToSize(isolate, sta->byte_offset()); NumberToSize(isolate, sta->byte_offset());
...@@ -419,8 +419,8 @@ RUNTIME_FUNCTION(Runtime_AtomicsSub) { ...@@ -419,8 +419,8 @@ RUNTIME_FUNCTION(Runtime_AtomicsSub) {
CONVERT_ARG_HANDLE_CHECKED(JSTypedArray, sta, 0); CONVERT_ARG_HANDLE_CHECKED(JSTypedArray, sta, 0);
CONVERT_SIZE_ARG_CHECKED(index, 1); CONVERT_SIZE_ARG_CHECKED(index, 1);
CONVERT_NUMBER_ARG_HANDLE_CHECKED(value, 2); CONVERT_NUMBER_ARG_HANDLE_CHECKED(value, 2);
RUNTIME_ASSERT(sta->GetBuffer()->is_shared()); CHECK(sta->GetBuffer()->is_shared());
RUNTIME_ASSERT(index < NumberToSize(isolate, sta->length())); CHECK_LT(index, NumberToSize(isolate, sta->length()));
uint8_t* source = static_cast<uint8_t*>(sta->GetBuffer()->backing_store()) + uint8_t* source = static_cast<uint8_t*>(sta->GetBuffer()->backing_store()) +
NumberToSize(isolate, sta->byte_offset()); NumberToSize(isolate, sta->byte_offset());
...@@ -451,8 +451,8 @@ RUNTIME_FUNCTION(Runtime_AtomicsAnd) { ...@@ -451,8 +451,8 @@ RUNTIME_FUNCTION(Runtime_AtomicsAnd) {
CONVERT_ARG_HANDLE_CHECKED(JSTypedArray, sta, 0); CONVERT_ARG_HANDLE_CHECKED(JSTypedArray, sta, 0);
CONVERT_SIZE_ARG_CHECKED(index, 1); CONVERT_SIZE_ARG_CHECKED(index, 1);
CONVERT_NUMBER_ARG_HANDLE_CHECKED(value, 2); CONVERT_NUMBER_ARG_HANDLE_CHECKED(value, 2);
RUNTIME_ASSERT(sta->GetBuffer()->is_shared()); CHECK(sta->GetBuffer()->is_shared());
RUNTIME_ASSERT(index < NumberToSize(isolate, sta->length())); CHECK_LT(index, NumberToSize(isolate, sta->length()));
uint8_t* source = static_cast<uint8_t*>(sta->GetBuffer()->backing_store()) + uint8_t* source = static_cast<uint8_t*>(sta->GetBuffer()->backing_store()) +
NumberToSize(isolate, sta->byte_offset()); NumberToSize(isolate, sta->byte_offset());
...@@ -483,8 +483,8 @@ RUNTIME_FUNCTION(Runtime_AtomicsOr) { ...@@ -483,8 +483,8 @@ RUNTIME_FUNCTION(Runtime_AtomicsOr) {
CONVERT_ARG_HANDLE_CHECKED(JSTypedArray, sta, 0); CONVERT_ARG_HANDLE_CHECKED(JSTypedArray, sta, 0);
CONVERT_SIZE_ARG_CHECKED(index, 1); CONVERT_SIZE_ARG_CHECKED(index, 1);
CONVERT_NUMBER_ARG_HANDLE_CHECKED(value, 2); CONVERT_NUMBER_ARG_HANDLE_CHECKED(value, 2);
RUNTIME_ASSERT(sta->GetBuffer()->is_shared()); CHECK(sta->GetBuffer()->is_shared());
RUNTIME_ASSERT(index < NumberToSize(isolate, sta->length())); CHECK_LT(index, NumberToSize(isolate, sta->length()));
uint8_t* source = static_cast<uint8_t*>(sta->GetBuffer()->backing_store()) + uint8_t* source = static_cast<uint8_t*>(sta->GetBuffer()->backing_store()) +
NumberToSize(isolate, sta->byte_offset()); NumberToSize(isolate, sta->byte_offset());
...@@ -515,8 +515,8 @@ RUNTIME_FUNCTION(Runtime_AtomicsXor) { ...@@ -515,8 +515,8 @@ RUNTIME_FUNCTION(Runtime_AtomicsXor) {
CONVERT_ARG_HANDLE_CHECKED(JSTypedArray, sta, 0); CONVERT_ARG_HANDLE_CHECKED(JSTypedArray, sta, 0);
CONVERT_SIZE_ARG_CHECKED(index, 1); CONVERT_SIZE_ARG_CHECKED(index, 1);
CONVERT_NUMBER_ARG_HANDLE_CHECKED(value, 2); CONVERT_NUMBER_ARG_HANDLE_CHECKED(value, 2);
RUNTIME_ASSERT(sta->GetBuffer()->is_shared()); CHECK(sta->GetBuffer()->is_shared());
RUNTIME_ASSERT(index < NumberToSize(isolate, sta->length())); CHECK_LT(index, NumberToSize(isolate, sta->length()));
uint8_t* source = static_cast<uint8_t*>(sta->GetBuffer()->backing_store()) + uint8_t* source = static_cast<uint8_t*>(sta->GetBuffer()->backing_store()) +
NumberToSize(isolate, sta->byte_offset()); NumberToSize(isolate, sta->byte_offset());
...@@ -547,8 +547,8 @@ RUNTIME_FUNCTION(Runtime_AtomicsExchange) { ...@@ -547,8 +547,8 @@ RUNTIME_FUNCTION(Runtime_AtomicsExchange) {
CONVERT_ARG_HANDLE_CHECKED(JSTypedArray, sta, 0); CONVERT_ARG_HANDLE_CHECKED(JSTypedArray, sta, 0);
CONVERT_SIZE_ARG_CHECKED(index, 1); CONVERT_SIZE_ARG_CHECKED(index, 1);
CONVERT_NUMBER_ARG_HANDLE_CHECKED(value, 2); CONVERT_NUMBER_ARG_HANDLE_CHECKED(value, 2);
RUNTIME_ASSERT(sta->GetBuffer()->is_shared()); CHECK(sta->GetBuffer()->is_shared());
RUNTIME_ASSERT(index < NumberToSize(isolate, sta->length())); CHECK_LT(index, NumberToSize(isolate, sta->length()));
uint8_t* source = static_cast<uint8_t*>(sta->GetBuffer()->backing_store()) + uint8_t* source = static_cast<uint8_t*>(sta->GetBuffer()->backing_store()) +
NumberToSize(isolate, sta->byte_offset()); NumberToSize(isolate, sta->byte_offset());
......
...@@ -24,10 +24,10 @@ RUNTIME_FUNCTION(Runtime_AtomicsFutexWait) { ...@@ -24,10 +24,10 @@ RUNTIME_FUNCTION(Runtime_AtomicsFutexWait) {
CONVERT_SIZE_ARG_CHECKED(index, 1); CONVERT_SIZE_ARG_CHECKED(index, 1);
CONVERT_INT32_ARG_CHECKED(value, 2); CONVERT_INT32_ARG_CHECKED(value, 2);
CONVERT_DOUBLE_ARG_CHECKED(timeout, 3); CONVERT_DOUBLE_ARG_CHECKED(timeout, 3);
RUNTIME_ASSERT(sta->GetBuffer()->is_shared()); CHECK(sta->GetBuffer()->is_shared());
RUNTIME_ASSERT(index < NumberToSize(isolate, sta->length())); CHECK_LT(index, NumberToSize(isolate, sta->length()));
RUNTIME_ASSERT(sta->type() == kExternalInt32Array); CHECK_EQ(sta->type(), kExternalInt32Array);
RUNTIME_ASSERT(timeout == V8_INFINITY || !std::isnan(timeout)); CHECK(timeout == V8_INFINITY || !std::isnan(timeout));
Handle<JSArrayBuffer> array_buffer = sta->GetBuffer(); Handle<JSArrayBuffer> array_buffer = sta->GetBuffer();
size_t addr = (index << 2) + NumberToSize(isolate, sta->byte_offset()); size_t addr = (index << 2) + NumberToSize(isolate, sta->byte_offset());
...@@ -42,9 +42,9 @@ RUNTIME_FUNCTION(Runtime_AtomicsFutexWake) { ...@@ -42,9 +42,9 @@ RUNTIME_FUNCTION(Runtime_AtomicsFutexWake) {
CONVERT_ARG_HANDLE_CHECKED(JSTypedArray, sta, 0); CONVERT_ARG_HANDLE_CHECKED(JSTypedArray, sta, 0);
CONVERT_SIZE_ARG_CHECKED(index, 1); CONVERT_SIZE_ARG_CHECKED(index, 1);
CONVERT_INT32_ARG_CHECKED(count, 2); CONVERT_INT32_ARG_CHECKED(count, 2);
RUNTIME_ASSERT(sta->GetBuffer()->is_shared()); CHECK(sta->GetBuffer()->is_shared());
RUNTIME_ASSERT(index < NumberToSize(isolate, sta->length())); CHECK_LT(index, NumberToSize(isolate, sta->length()));
RUNTIME_ASSERT(sta->type() == kExternalInt32Array); CHECK_EQ(sta->type(), kExternalInt32Array);
Handle<JSArrayBuffer> array_buffer = sta->GetBuffer(); Handle<JSArrayBuffer> array_buffer = sta->GetBuffer();
size_t addr = (index << 2) + NumberToSize(isolate, sta->byte_offset()); size_t addr = (index << 2) + NumberToSize(isolate, sta->byte_offset());
...@@ -61,10 +61,10 @@ RUNTIME_FUNCTION(Runtime_AtomicsFutexWakeOrRequeue) { ...@@ -61,10 +61,10 @@ RUNTIME_FUNCTION(Runtime_AtomicsFutexWakeOrRequeue) {
CONVERT_INT32_ARG_CHECKED(count, 2); CONVERT_INT32_ARG_CHECKED(count, 2);
CONVERT_INT32_ARG_CHECKED(value, 3); CONVERT_INT32_ARG_CHECKED(value, 3);
CONVERT_SIZE_ARG_CHECKED(index2, 4); CONVERT_SIZE_ARG_CHECKED(index2, 4);
RUNTIME_ASSERT(sta->GetBuffer()->is_shared()); CHECK(sta->GetBuffer()->is_shared());
RUNTIME_ASSERT(index1 < NumberToSize(isolate, sta->length())); CHECK_LT(index1, NumberToSize(isolate, sta->length()));
RUNTIME_ASSERT(index2 < NumberToSize(isolate, sta->length())); CHECK_LT(index2, NumberToSize(isolate, sta->length()));
RUNTIME_ASSERT(sta->type() == kExternalInt32Array); CHECK_EQ(sta->type(), kExternalInt32Array);
Handle<JSArrayBuffer> array_buffer = sta->GetBuffer(); Handle<JSArrayBuffer> array_buffer = sta->GetBuffer();
size_t addr1 = (index1 << 2) + NumberToSize(isolate, sta->byte_offset()); size_t addr1 = (index1 << 2) + NumberToSize(isolate, sta->byte_offset());
...@@ -80,9 +80,9 @@ RUNTIME_FUNCTION(Runtime_AtomicsFutexNumWaitersForTesting) { ...@@ -80,9 +80,9 @@ RUNTIME_FUNCTION(Runtime_AtomicsFutexNumWaitersForTesting) {
DCHECK(args.length() == 2); DCHECK(args.length() == 2);
CONVERT_ARG_HANDLE_CHECKED(JSTypedArray, sta, 0); CONVERT_ARG_HANDLE_CHECKED(JSTypedArray, sta, 0);
CONVERT_SIZE_ARG_CHECKED(index, 1); CONVERT_SIZE_ARG_CHECKED(index, 1);
RUNTIME_ASSERT(sta->GetBuffer()->is_shared()); CHECK(sta->GetBuffer()->is_shared());
RUNTIME_ASSERT(index < NumberToSize(isolate, sta->length())); CHECK_LT(index, NumberToSize(isolate, sta->length()));
RUNTIME_ASSERT(sta->type() == kExternalInt32Array); CHECK_EQ(sta->type(), kExternalInt32Array);
Handle<JSArrayBuffer> array_buffer = sta->GetBuffer(); Handle<JSArrayBuffer> array_buffer = sta->GetBuffer();
size_t addr = (index << 2) + NumberToSize(isolate, sta->byte_offset()); size_t addr = (index << 2) + NumberToSize(isolate, sta->byte_offset());
......
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