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

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

Issue 803933008: new classes: change semantics of super(...) call and add new.target to construct stub. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix x64 Created 5 years, 11 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/builtins-x64.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 0b212a7800bbb028ca01cd34d8e9d0ae054e4782..340a6452e8f3844c06597e8eb5bd41c65181132b 100644
--- a/src/runtime/runtime-object.cc
+++ b/src/runtime/runtime-object.cc
@@ -1279,7 +1279,12 @@ RUNTIME_FUNCTION(Runtime_AllocateHeapNumber) {
static Object* Runtime_NewObjectHelper(Isolate* isolate,
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);
@@ -1340,16 +1345,18 @@ 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);
+ 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;
@@ -1357,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);
}
« no previous file with comments | « src/runtime/runtime.h ('k') | src/x64/builtins-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698