Chromium Code Reviews| Index: src/runtime/runtime-object.cc |
| diff --git a/src/runtime/runtime-object.cc b/src/runtime/runtime-object.cc |
| index 43620bb9b65fc4a8fad883b147781a46a201d669..0bd8fe69b1a0c2e787cbfc29bbae0d89157db10d 100644 |
| --- a/src/runtime/runtime-object.cc |
| +++ b/src/runtime/runtime-object.cc |
| @@ -1282,6 +1282,7 @@ RUNTIME_FUNCTION(Runtime_AllocateHeapNumber) { |
| static Object* Runtime_NewObjectHelper(Isolate* isolate, |
| Handle<Object> constructor, |
| + Handle<Object> original_constructor, |
| Handle<AllocationSite> site) { |
| // If the constructor isn't a proper function we throw a type error. |
| if (!constructor->IsJSFunction()) { |
| @@ -1343,16 +1344,19 @@ static Object* Runtime_NewObjectHelper(Isolate* isolate, |
| RUNTIME_FUNCTION(Runtime_NewObject) { |
| HandleScope scope(isolate); |
| - DCHECK(args.length() == 1); |
| + DCHECK(args.length() == 2); |
| CONVERT_ARG_HANDLE_CHECKED(Object, constructor, 0); |
| - return Runtime_NewObjectHelper(isolate, constructor, |
| + CONVERT_ARG_HANDLE_CHECKED(Object, original_constructor, 1); |
| + CHECK(*constructor == *original_constructor); |
|
arv (Not doing code reviews)
2015/01/21 19:18:56
Why are we passing two args here?
Dmitry Lomov (no reviews)
2015/01/22 11:59:00
We will need both args once prototype rewiring is
|
| + return Runtime_NewObjectHelper(isolate, constructor, original_constructor, |
| Handle<AllocationSite>::null()); |
| } |
| RUNTIME_FUNCTION(Runtime_NewObjectWithAllocationSite) { |
| HandleScope scope(isolate); |
| - DCHECK(args.length() == 2); |
| + DCHECK(args.length() == 3); |
| + CONVERT_ARG_HANDLE_CHECKED(Object, original_constructor, 2); |
| CONVERT_ARG_HANDLE_CHECKED(Object, constructor, 1); |
| CONVERT_ARG_HANDLE_CHECKED(Object, feedback, 0); |
| Handle<AllocationSite> site; |
| @@ -1360,7 +1364,8 @@ RUNTIME_FUNCTION(Runtime_NewObjectWithAllocationSite) { |
| // The feedback can be an AllocationSite or undefined. |
| site = Handle<AllocationSite>::cast(feedback); |
| } |
| - return Runtime_NewObjectHelper(isolate, constructor, site); |
| + return Runtime_NewObjectHelper(isolate, constructor, original_constructor, |
| + site); |
| } |