Commit 08b7bc9d authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[runtime] Deprecate RUNTIME_ASSERT from internal ops.

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

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

Review-Url: https://codereview.chromium.org/2057543002
Cr-Commit-Position: refs/heads/master@{#36869}
parent e7de678a
...@@ -21,7 +21,7 @@ namespace internal { ...@@ -21,7 +21,7 @@ namespace internal {
RUNTIME_FUNCTION(Runtime_CheckIsBootstrapping) { RUNTIME_FUNCTION(Runtime_CheckIsBootstrapping) {
SealHandleScope shs(isolate); SealHandleScope shs(isolate);
DCHECK(args.length() == 0); DCHECK(args.length() == 0);
RUNTIME_ASSERT(isolate->bootstrapper()->IsActive()); CHECK(isolate->bootstrapper()->IsActive());
return isolate->heap()->undefined_value(); return isolate->heap()->undefined_value();
} }
...@@ -30,7 +30,7 @@ RUNTIME_FUNCTION(Runtime_ExportFromRuntime) { ...@@ -30,7 +30,7 @@ RUNTIME_FUNCTION(Runtime_ExportFromRuntime) {
HandleScope scope(isolate); HandleScope scope(isolate);
DCHECK(args.length() == 1); DCHECK(args.length() == 1);
CONVERT_ARG_HANDLE_CHECKED(JSObject, container, 0); CONVERT_ARG_HANDLE_CHECKED(JSObject, container, 0);
RUNTIME_ASSERT(isolate->bootstrapper()->IsActive()); CHECK(isolate->bootstrapper()->IsActive());
JSObject::NormalizeProperties(container, KEEP_INOBJECT_PROPERTIES, 10, JSObject::NormalizeProperties(container, KEEP_INOBJECT_PROPERTIES, 10,
"ExportFromRuntime"); "ExportFromRuntime");
Bootstrapper::ExportFromRuntime(isolate, container); Bootstrapper::ExportFromRuntime(isolate, container);
...@@ -43,7 +43,7 @@ RUNTIME_FUNCTION(Runtime_ExportExperimentalFromRuntime) { ...@@ -43,7 +43,7 @@ RUNTIME_FUNCTION(Runtime_ExportExperimentalFromRuntime) {
HandleScope scope(isolate); HandleScope scope(isolate);
DCHECK(args.length() == 1); DCHECK(args.length() == 1);
CONVERT_ARG_HANDLE_CHECKED(JSObject, container, 0); CONVERT_ARG_HANDLE_CHECKED(JSObject, container, 0);
RUNTIME_ASSERT(isolate->bootstrapper()->IsActive()); CHECK(isolate->bootstrapper()->IsActive());
JSObject::NormalizeProperties(container, KEEP_INOBJECT_PROPERTIES, 10, JSObject::NormalizeProperties(container, KEEP_INOBJECT_PROPERTIES, 10,
"ExportExperimentalFromRuntime"); "ExportExperimentalFromRuntime");
Bootstrapper::ExportExperimentalFromRuntime(isolate, container); Bootstrapper::ExportExperimentalFromRuntime(isolate, container);
...@@ -56,21 +56,21 @@ RUNTIME_FUNCTION(Runtime_InstallToContext) { ...@@ -56,21 +56,21 @@ RUNTIME_FUNCTION(Runtime_InstallToContext) {
HandleScope scope(isolate); HandleScope scope(isolate);
DCHECK(args.length() == 1); DCHECK(args.length() == 1);
CONVERT_ARG_HANDLE_CHECKED(JSArray, array, 0); CONVERT_ARG_HANDLE_CHECKED(JSArray, array, 0);
RUNTIME_ASSERT(array->HasFastElements()); CHECK(array->HasFastElements());
RUNTIME_ASSERT(isolate->bootstrapper()->IsActive()); CHECK(isolate->bootstrapper()->IsActive());
Handle<Context> native_context = isolate->native_context(); Handle<Context> native_context = isolate->native_context();
Handle<FixedArray> fixed_array(FixedArray::cast(array->elements())); Handle<FixedArray> fixed_array(FixedArray::cast(array->elements()));
int length = Smi::cast(array->length())->value(); int length = Smi::cast(array->length())->value();
for (int i = 0; i < length; i += 2) { for (int i = 0; i < length; i += 2) {
RUNTIME_ASSERT(fixed_array->get(i)->IsString()); CHECK(fixed_array->get(i)->IsString());
Handle<String> name(String::cast(fixed_array->get(i))); Handle<String> name(String::cast(fixed_array->get(i)));
RUNTIME_ASSERT(fixed_array->get(i + 1)->IsJSObject()); CHECK(fixed_array->get(i + 1)->IsJSObject());
Handle<JSObject> object(JSObject::cast(fixed_array->get(i + 1))); Handle<JSObject> object(JSObject::cast(fixed_array->get(i + 1)));
int index = Context::ImportedFieldIndexForName(name); int index = Context::ImportedFieldIndexForName(name);
if (index == Context::kNotFound) { if (index == Context::kNotFound) {
index = Context::IntrinsicIndexForName(name); index = Context::IntrinsicIndexForName(name);
} }
RUNTIME_ASSERT(index != Context::kNotFound); CHECK(index != Context::kNotFound);
native_context->set(index, *object); native_context->set(index, *object);
} }
return isolate->heap()->undefined_value(); return isolate->heap()->undefined_value();
...@@ -273,8 +273,7 @@ RUNTIME_FUNCTION(Runtime_PromiseRevokeReject) { ...@@ -273,8 +273,7 @@ RUNTIME_FUNCTION(Runtime_PromiseRevokeReject) {
CONVERT_ARG_HANDLE_CHECKED(JSObject, promise, 0); CONVERT_ARG_HANDLE_CHECKED(JSObject, promise, 0);
Handle<Symbol> key = isolate->factory()->promise_has_handler_symbol(); Handle<Symbol> key = isolate->factory()->promise_has_handler_symbol();
// At this point, no revocation has been issued before // At this point, no revocation has been issued before
RUNTIME_ASSERT( CHECK(JSReceiver::GetDataProperty(promise, key)->IsUndefined(isolate));
JSReceiver::GetDataProperty(promise, key)->IsUndefined(isolate));
isolate->ReportPromiseReject(promise, Handle<Object>(), isolate->ReportPromiseReject(promise, Handle<Object>(),
v8::kPromiseHandlerAddedAfterReject); v8::kPromiseHandlerAddedAfterReject);
return isolate->heap()->undefined_value(); return isolate->heap()->undefined_value();
...@@ -306,9 +305,9 @@ RUNTIME_FUNCTION(Runtime_AllocateInNewSpace) { ...@@ -306,9 +305,9 @@ RUNTIME_FUNCTION(Runtime_AllocateInNewSpace) {
HandleScope scope(isolate); HandleScope scope(isolate);
DCHECK(args.length() == 1); DCHECK(args.length() == 1);
CONVERT_SMI_ARG_CHECKED(size, 0); CONVERT_SMI_ARG_CHECKED(size, 0);
RUNTIME_ASSERT(IsAligned(size, kPointerSize)); CHECK(IsAligned(size, kPointerSize));
RUNTIME_ASSERT(size > 0); CHECK(size > 0);
RUNTIME_ASSERT(size <= Page::kMaxRegularHeapObjectSize); CHECK(size <= Page::kMaxRegularHeapObjectSize);
return *isolate->factory()->NewFillerObject(size, false, NEW_SPACE); return *isolate->factory()->NewFillerObject(size, false, NEW_SPACE);
} }
...@@ -318,9 +317,9 @@ RUNTIME_FUNCTION(Runtime_AllocateInTargetSpace) { ...@@ -318,9 +317,9 @@ RUNTIME_FUNCTION(Runtime_AllocateInTargetSpace) {
DCHECK(args.length() == 2); DCHECK(args.length() == 2);
CONVERT_SMI_ARG_CHECKED(size, 0); CONVERT_SMI_ARG_CHECKED(size, 0);
CONVERT_SMI_ARG_CHECKED(flags, 1); CONVERT_SMI_ARG_CHECKED(flags, 1);
RUNTIME_ASSERT(IsAligned(size, kPointerSize)); CHECK(IsAligned(size, kPointerSize));
RUNTIME_ASSERT(size > 0); CHECK(size > 0);
RUNTIME_ASSERT(size <= Page::kMaxRegularHeapObjectSize); CHECK(size <= Page::kMaxRegularHeapObjectSize);
bool double_align = AllocateDoubleAlignFlag::decode(flags); bool double_align = AllocateDoubleAlignFlag::decode(flags);
AllocationSpace space = AllocateTargetSpace::decode(flags); AllocationSpace space = AllocateTargetSpace::decode(flags);
return *isolate->factory()->NewFillerObject(size, double_align, space); return *isolate->factory()->NewFillerObject(size, double_align, space);
...@@ -402,7 +401,7 @@ RUNTIME_FUNCTION(Runtime_FormatMessageString) { ...@@ -402,7 +401,7 @@ RUNTIME_FUNCTION(Runtime_FormatMessageString) {
CONVERT_ARG_HANDLE_CHECKED(JSObject, call_site_obj, 0); \ CONVERT_ARG_HANDLE_CHECKED(JSObject, call_site_obj, 0); \
Handle<String> result; \ Handle<String> result; \
CallSite call_site(isolate, call_site_obj); \ CallSite call_site(isolate, call_site_obj); \
RUNTIME_ASSERT(call_site.IsJavaScript() || call_site.IsWasm()); \ CHECK(call_site.IsJavaScript() || call_site.IsWasm()); \
return RETURN(call_site.NAME(), isolate); \ return RETURN(call_site.NAME(), isolate); \
} }
......
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