| Index: src/runtime/runtime-object.cc
|
| diff --git a/src/runtime/runtime-object.cc b/src/runtime/runtime-object.cc
|
| index 844c633bdb82d6438ac4a830be021251007b814c..bde3021df16653280c3576aa15552c39764d6bda 100644
|
| --- a/src/runtime/runtime-object.cc
|
| +++ b/src/runtime/runtime-object.cc
|
| @@ -1245,6 +1245,10 @@
|
| Handle<Object> constructor,
|
| Handle<Object> original_constructor,
|
| Handle<AllocationSite> site) {
|
| + // TODO(dslomov): implement prototype rewiring.
|
| + // The check below is a sanity check.
|
| + CHECK(*constructor == *original_constructor);
|
| +
|
| // If the constructor isn't a proper function we throw a type error.
|
| if (!constructor->IsJSFunction()) {
|
| Vector<Handle<Object> > arguments = HandleVector(&constructor, 1);
|
| @@ -1253,11 +1257,6 @@
|
| }
|
|
|
| Handle<JSFunction> function = Handle<JSFunction>::cast(constructor);
|
| -
|
| - CHECK(original_constructor->IsJSFunction());
|
| - Handle<JSFunction> original_function =
|
| - Handle<JSFunction>::cast(original_constructor);
|
| -
|
|
|
| // If function should not have prototype, construction is not allowed. In this
|
| // case generated code bailouts here, since function has no initial_map.
|
| @@ -1301,18 +1300,6 @@
|
| result = isolate->factory()->NewJSObjectWithMemento(function, site);
|
| }
|
|
|
| - // Set up the prototoype using original function.
|
| - // TODO(dslomov): instead of setting the __proto__,
|
| - // use and cache the correct map.
|
| - if (*original_function != *function) {
|
| - if (original_function->has_instance_prototype()) {
|
| - Handle<Object> prototype =
|
| - handle(original_function->instance_prototype(), isolate);
|
| - RETURN_FAILURE_ON_EXCEPTION(
|
| - isolate, JSObject::SetPrototype(result, prototype, false));
|
| - }
|
| - }
|
| -
|
| isolate->counters()->constructed_objects()->Increment();
|
| isolate->counters()->constructed_objects_runtime()->Increment();
|
|
|
|
|