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

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

Issue 1359583002: [builtins] Add support for NewTarget to Execution::New. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE. Merge mips and mips64 ports. Created 5 years, 3 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/mips64/code-stubs-mips64.cc ('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-classes.cc
diff --git a/src/runtime/runtime-classes.cc b/src/runtime/runtime-classes.cc
index 5f098148664ff86253602185809b89e27becb2a0..6c4f47091318abfb14bde15c70d0cffef111c5f8 100644
--- a/src/runtime/runtime-classes.cc
+++ b/src/runtime/runtime-classes.cc
@@ -525,25 +525,13 @@ RUNTIME_FUNCTION(Runtime_DefaultConstructorCallSuper) {
base::SmartArrayPointer<Handle<Object>> arguments =
Runtime::GetCallerArguments(isolate, 0, &argument_count);
- // Prepare the array containing all passed arguments.
- Handle<FixedArray> elements =
- isolate->factory()->NewUninitializedFixedArray(argument_count);
- for (int i = 0; i < argument_count; ++i) {
- elements->set(i, *arguments[i]);
- }
- Handle<JSArray> array = isolate->factory()->NewJSArrayWithElements(
- elements, FAST_ELEMENTS, argument_count);
-
- // Call %reflect_construct(<super>, <args>, <new.target>) now.
- Handle<JSFunction> reflect = isolate->reflect_construct();
- Handle<Object> argv[] = {super_constructor, array, original_constructor};
Handle<Object> result;
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
- isolate, result,
- Execution::Call(isolate, reflect, isolate->factory()->undefined_value(),
- arraysize(argv), argv));
+ isolate, result, Execution::New(super_constructor, original_constructor,
+ argument_count, arguments.get()));
return *result;
}
+
} // namespace internal
} // namespace v8
« no previous file with comments | « src/mips64/code-stubs-mips64.cc ('k') | src/x64/builtins-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698