Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(937)

Unified Diff: src/runtime/runtime-object.cc

Issue 911363002: Revert of new classes: implement new.target passing to superclass constructor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime/runtime-function.cc ('k') | src/runtime/runtime-scopes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « src/runtime/runtime-function.cc ('k') | src/runtime/runtime-scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698