Index: src/runtime/runtime-object.cc |
diff --git a/src/runtime/runtime-object.cc b/src/runtime/runtime-object.cc |
index 26a55ac75b36489e84028946e265318abce52fbb..59ecce0fa5f80ea57c07cc180431b0a534e47efe 100644 |
--- a/src/runtime/runtime-object.cc |
+++ b/src/runtime/runtime-object.cc |
@@ -1011,6 +1011,16 @@ static Object* Runtime_NewObjectHelper(Isolate* isolate, |
Handle<JSFunction> constructor, |
Handle<JSReceiver> new_target, |
Handle<AllocationSite> site) { |
+ DCHECK(constructor->IsConstructor()); |
+ |
+ // If called through new, new.target can be: |
+ // - a subclass of constructor, |
+ // - a proxy wrapper around constructor, or |
+ // - the constructor itself. |
+ // If called through Reflect.construct, it's guaranteed to be a constructor by |
+ // REFLECT_CONSTRUCT_PREPARE. |
+ DCHECK(new_target->IsConstructor()); |
+ |
DCHECK(!constructor->has_initial_map() || |
constructor->initial_map()->instance_type() != JS_FUNCTION_TYPE); |
@@ -1035,16 +1045,6 @@ RUNTIME_FUNCTION(Runtime_NewObject) { |
CONVERT_ARG_HANDLE_CHECKED(JSFunction, constructor, 0); |
CONVERT_ARG_HANDLE_CHECKED(JSReceiver, new_target, 1); |
- DCHECK(constructor->IsConstructor()); |
- |
- // If called through new, new.target can be: |
- // - a subclass of constructor, |
- // - a proxy wrapper around constructor, or |
- // - the constructor itself. |
- // If called through Reflect.construct, it's guaranteed to be a constructor by |
- // REFLECT_CONSTRUCT_PREPARE. |
- DCHECK(new_target->IsConstructor()); |
- |
return Runtime_NewObjectHelper(isolate, constructor, new_target, |
Handle<AllocationSite>::null()); |
} |