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

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

Issue 976693002: Revert of Implement subclassing Arrays. (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.h ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-array.cc
diff --git a/src/runtime/runtime-array.cc b/src/runtime/runtime-array.cc
index 988e158950356e0817b2728904242febba79a564..6d8a11e2407530ab9b52a5371d8218c3088e65a8 100644
--- a/src/runtime/runtime-array.cc
+++ b/src/runtime/runtime-array.cc
@@ -1038,7 +1038,6 @@
static Object* ArrayConstructorCommon(Isolate* isolate,
Handle<JSFunction> constructor,
- Handle<JSFunction> original_constructor,
Handle<AllocationSite> site,
Arguments* caller_args) {
Factory* factory = isolate->factory();
@@ -1110,19 +1109,6 @@
// We must mark the allocationsite as un-inlinable.
site->SetDoNotInlineCall();
}
-
- // Set up the prototoype using original function.
- // TODO(dslomov): instead of setting the __proto__,
- // use and cache the correct map.
- if (*original_constructor != *constructor) {
- if (original_constructor->has_instance_prototype()) {
- Handle<Object> prototype =
- handle(original_constructor->instance_prototype(), isolate);
- RETURN_FAILURE_ON_EXCEPTION(
- isolate, JSObject::SetPrototype(array, prototype, false));
- }
- }
-
return *array;
}
@@ -1156,23 +1142,7 @@
DCHECK(!site->SitePointsToLiteral());
}
- return ArrayConstructorCommon(isolate, constructor, constructor, site,
- caller_args);
-}
-
-
-RUNTIME_FUNCTION(Runtime_ArrayConstructorWithSubclassing) {
- HandleScope scope(isolate);
- DCHECK(args.length() >= 2);
- int args_length = args.length();
- CHECK(args[args_length - 2]->IsJSFunction());
- CHECK(args[args_length - 1]->IsJSFunction());
- Handle<JSFunction> constructor(JSFunction::cast(args[args_length - 2]));
- Handle<JSFunction> original_constructor(
- JSFunction::cast(args[args_length - 1]));
- Arguments caller_args(args_length - 2, args.arguments());
- return ArrayConstructorCommon(isolate, constructor, original_constructor,
- Handle<AllocationSite>::null(), &caller_args);
+ return ArrayConstructorCommon(isolate, constructor, site, caller_args);
}
@@ -1191,7 +1161,7 @@
DCHECK(arg_count == caller_args->length());
}
#endif
- return ArrayConstructorCommon(isolate, constructor, constructor,
+ return ArrayConstructorCommon(isolate, constructor,
Handle<AllocationSite>::null(), caller_args);
}
« no previous file with comments | « src/runtime/runtime.h ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698